Dev/MonadicDependence/CliqueCrossing/Contract.lean
1import Mathlib.Combinatorics.SimpleGraph.Maps
2import Dev.MonadicDependence.Flip.Contract
3import Dev.MonadicDependence.StarCrossing.Contract
4
5namespace Dev.MonadicDependence.CliqueCrossing
6
7open Dev.MonadicDependence.Subdivision
8open Dev.MonadicDependence.Flip
9open Dev.MonadicDependence.StarCrossing
10
11/-- The clique `r`-crossing of order `n` (Mählmann p. 14). Obtained from
12the star `r`-crossing (`starCrossing n r`) by turning each root's
13adjacent path-endpoint set into a clique:
14
15* for every `i : Fin n` and distinct `j, j' : Fin n`, add the edge
16 `π_{i,j,1} — π_{i,j',1}` (left end, at root `a_i`);
17* for every `j : Fin n` and distinct `i, i' : Fin n`, add the edge
18 `π_{i,j,r} — π_{i',j,r}` (right end, at root `b_j`).
19
20The interior path vertices `π_{i,j,ℓ}` for `2 ≤ ℓ ≤ r − 1` keep the same
21neighborhoods as in the star crossing. `SimpleGraph.fromRel` adds the
22`x ≠ y` guard, so the distinct-edge requirement (`j ≠ j'` for the left
23clique, `i ≠ i'` for the right) is automatic. -/
24def cliqueCrossing (n r : ℕ) : SimpleGraph (SubdividedBicliqueVert n r) :=
25 starCrossing n r ⊔
26 (SimpleGraph.fromRel fun x y =>
27 match x, y with
28 | .inr ⟨⟨i, _⟩, k⟩, .inr ⟨⟨i', _⟩, k'⟩ =>
29 (i = i' ∧ k.val = 0 ∧ k'.val = 0)
30 | _, _ => False) ⊔
31 (SimpleGraph.fromRel fun x y =>
32 match x, y with
33 | .inr ⟨⟨_, j⟩, k⟩, .inr ⟨⟨_, j'⟩, k'⟩ =>
34 (j = j' ∧ k.val = r - 1 ∧ k'.val = r - 1)
35 | _, _ => False)
36
37/-- A graph `H` is a *flipped clique `r`-crossing of order `n`*
38(Mählmann p. 14) iff it is isomorphic to `flip (cliqueCrossing n r) layer
39F Fsymm` for some symmetric relation `F` on the `r + 2` layers. The
40layer partition is shared with the star `r`-crossing
41(`Dev.MonadicDependence.StarCrossing.layer`). -/
42def IsFlippedCliqueCrossing {V : Type*} (H : SimpleGraph V) (n r : ℕ) : Prop :=
43 ∃ (F : Fin (r + 2) → Fin (r + 2) → Prop) (Fsymm : Symmetric F),
44 Nonempty (H ≃g flip (cliqueCrossing n r) layer F Fsymm)
45
46end Dev.MonadicDependence.CliqueCrossing
47