Discrete Jordan curve theorem for the square lattice
DefinitionSquare lattice with a set of vertices removed#✓fully proved
The square lattice with every vertex of B removed (edges with an endpoint in B deleted).
def ffc_offSupportLattice (B : Set (Site 2)) : SimpleGraph (Site 2) where
Adj x y := (hypercubicLattice 2).Adj x y ∧ x ∉ B ∧ y ∉ B
symm := by
refine ⟨?_⟩
rintro x y ⟨hadj, hx, hy⟩
exact ⟨hadj.symm, hy, hx⟩
loopless := ⟨fun x h => (hypercubicLattice 2).irrefl h.1⟩
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
DefinitionLattice walk avoiding a set, lifted to the reduced lattice#✓fully proved
A lattice walk avoiding B, viewed as a walk in ffc_offSupportLattice B.
def ffc_lift_walk {B : Set (Site 2)} :
∀ {x y : Site 2} (p : (hypercubicLattice 2).Walk x y),
(∀ z ∈ p.support, z ∉ B) → (ffc_offSupportLattice B).Walk x y
| _, _, SimpleGraph.Walk.nil, _ => SimpleGraph.Walk.nil
| _, _, SimpleGraph.Walk.cons hab p, hp =>
SimpleGraph.Walk.cons
⟨hab, hp _ (by simp), hp _ (by
rw [SimpleGraph.Walk.support_cons]; right; exact p.start_mem_support)⟩
(ffc_lift_walk p (fun z hz => hp z (by
rw [SimpleGraph.Walk.support_cons]; exact List.mem_cons_of_mem _ hz)))
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def ffc_offSupportLattice (B : Set (Site 2)) : SimpleGraph (Site 2) where
Adj x y := (hypercubicLattice 2).Adj x y ∧ x ∉ B ∧ y ∉ B
symm := by
refine ⟨?_⟩
rintro x y ⟨hadj, hx, hy⟩
exact ⟨hadj.symm, hy, hx⟩
loopless := ⟨fun x h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/FloodFillConnected.lean:45
Uses 3 · Used by 1
DefinitionFlood fill avoiding a set of sites#✓fully proved
The flood fill of seed avoiding B: the sites reachable from seed in the lattice with
B removed.
def ffc_floodFill (B : Set (Site 2)) (seed : Site 2) : Set (Site 2) :=
{z | (ffc_offSupportLattice B).Reachable seed z}
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def ffc_offSupportLattice (B : Set (Site 2)) : SimpleGraph (Site 2) where
Adj x y := (hypercubicLattice 2).Adj x y ∧ x ∉ B ∧ y ∉ B
symm := by
refine ⟨?_⟩
rintro x y ⟨hadj, hx, hy⟩
exact ⟨hadj.symm, hy, hx⟩
loopless := ⟨fun x h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/FloodFillConnected.lean:45
Uses 2
DefinitionSquare lattice with a closed walk's vertices removed#✓fully proved
The square lattice with the vertices of the closed walk Vc removed. It is the same graph as
StatMech.Lattice.ffc_offSupportLattice {z | z ∈ Vc.support}.
noncomputable def offSupport {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) :
SimpleGraph (Site 2) where
Adj x y := (hypercubicLattice 2).Adj x y ∧ x ∉ Vc.support ∧ y ∉ Vc.support
symm := by
refine ⟨?_⟩
intro x y ⟨hadj, hx, hy⟩
exact ⟨hadj.symm, hy, hx⟩
loopless := ⟨fun x h => (hypercubicLattice 2).irrefl h.1⟩
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
Uses 2 · Used by 2
DefinitionComponent off a closed walk containing a seed#✓fully proved
The sites reachable from seed in the lattice with the vertices of Vc removed.
def offSupportComponent {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) (seed : Site 2) :
Set (Site 2) :=
{z | (offSupport Vc).Reachable seed z}
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
noncomputable def offSupport {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) :
SimpleGraph (Site 2) where
Adj x y := (hypercubicLattice 2).Adj x y ∧ x ∉ Vc.support ∧ y ∉ Vc.support
symm := by
refine ⟨?_⟩
intro x y ⟨hadj, hx, hy⟩
exact ⟨hadj.symm, hy, hx⟩
loopless := ⟨fun x h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/InsideConnected.lean:47
Uses 3 · Used by 1
TheoremEvery edge of a finite even-degree graph lies on a cycle#✓fully proved
In a finite graph in which every vertex has even degree, every edge lies on a cycle. See also
Mathlib's SimpleGraph.adj_and_reachable_delete_edges_iff_exists_cycle, which this combines
with StatMech.Lattice.reachable_deleteEdges_of_even.
theorem exists_cycle_through_edge_of_even (heven : ∀ x, Even (G.degree x))
{v w : V} (hadj : G.Adj v w) :
∃ (u : V) (p : G.Walk u u), p.IsCycle ∧ s(v, w) ∈ p.edges
DefinitionPrimal edge shared by adjacent faces#✓fully proved
The primal edge of ℤ² separating the adjacent unit faces with lower left corners f and
g.
noncomputable def sharedPrimalEdge (f g : Site 2) : Sym2 (Site 2) := by
classical
exact if f 0 = g 0 then
s(![f 0, max (f 1) (g 1)], ![f 0 + 1, max (f 1) (g 1)])
else
s(![max (f 0) (g 0), f 1], ![max (f 0) (g 0), f 1 + 1])
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 51
DefinitionBoundary edge of a set#✓fully proved
The edge e has exactly one endpoint in S.
def bdEdge (S : Set (Site 2)) (e : Sym2 (Site 2)) : Prop := by
classical
exact Sym2.lift ⟨fun x y => (x ∈ S ↔ y ∉ S), by
intro x y
simp only [eq_iff_iff]
by_cases hx : x ∈ S <;> by_cases hy : y ∈ S <;> simp_all⟩ e
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 29
DefinitionFace-boundary graph of a set#✓fully proved
The face-boundary graph of S: two adjacent faces are joined when the primal edge between
them has exactly one endpoint in S. Its edges are the dual edges crossing the boundary of
S.
def faceBoundaryGraph (S : Set (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ bdEdge S (sharedPrimalEdge f g)
symm := by
refine ⟨fun f g ⟨hadj, hbd⟩ => ?_⟩
refine ⟨hadj.symm, ?_⟩
rwa [← sharedPrimalEdge_comm_of_adj hadj]
loopless := by
refine ⟨fun f h => ?_⟩
exact (hypercubicLattice 2).irrefl h.1
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def bdEdge (S : Set (Site 2)) (e : Sym2 (Site 2)) : Prop := by
classical
exact Sym2.lift ⟨fun x y => (x ∈ S ↔ y ∉ S), by
intro x y
simp only [eq_iff_iff]
by_cases hx : x ∈ S <;> by_cases hy : y ∈ S <;> simp_all⟩ e
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEnclosure.lean:259
noncomputable def sharedPrimalEdge (f g : Site 2) : Sym2 (Site 2) := by
classical
exact if f 0 = g 0 then
s(![f 0, max (f 1) (g 1)], ![f 0 + 1, max (f 1) (g 1)])
else
s(![max (f 0) (g 0), f 1], ![max (f 0) (g 0), f 1 + 1])
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEnclosure.lean:223
Uses 4 · Used by 38
DefinitionFour unit faces at a lattice site#✓fully proved
The four unit faces having the site c as a corner.
def cornerFaces (c : Site 2) : Finset (Site 2) :=
{![c 0 - 1, c 1 - 1], ![c 0 - 1, c 1], ![c 0, c 1 - 1], ![c 0, c 1]}
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 9
DefinitionNumber of boundary crossings of a walk#✓fully proved
The number of edges of the walk w with exactly one endpoint in S.
noncomputable def crossCount (S : Set (Site 2)) {x y : Site 2}
(w : (hypercubicLattice 2).Walk x y) : ℕ := by
classical
exact w.edges.countP (fun e => decide (bdEdge S e))
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
Uses 3 · Used by 3
DefinitionSquare lattice with the boundary edges of a set removed#✓fully proved
The square lattice with every edge having exactly one endpoint in S removed.
noncomputable def latticeMinusBarrier (S : Set (Site 2)) : SimpleGraph (Site 2) where
Adj x y := (hypercubicLattice 2).Adj x y ∧ ¬ bdEdge S s(x, y)
symm := by
refine ⟨?_⟩
intro x y ⟨hadj, hbd⟩
refine ⟨hadj.symm, ?_⟩
rwa [Sym2.eq_swap]
loopless := ⟨fun x h => (hypercubicLattice 2).irrefl h.1⟩
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def bdEdge (S : Set (Site 2)) (e : Sym2 (Site 2)) : Prop := by
classical
exact Sym2.lift ⟨fun x y => (x ∈ S ↔ y ∉ S), by
intro x y
simp only [eq_iff_iff]
by_cases hx : x ∈ S <;> by_cases hy : y ∈ S <;> simp_all⟩ e
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEnclosure.lean:259
Uses 3 · Used by 10
DefinitionExterior of a box maps into the face-region graph#✓fully proved
For H and f0g0 inside [-R, R]², the lattice on the exterior of [-(R + 1), R + 1]²
maps into the face-region graph of H with f0g0 deleted.
noncomputable def jfd_extToDeletedHom (H : SimpleGraph (Site 2)) (R : ℕ) (f0 g0 : Site 2)
(hHR : ∀ v ∈ H.support, v ∈ box 2 R) (hf0 : f0 ∈ box 2 R) (hg0 : g0 ∈ box 2 R) :
(hypercubicLattice 2).induce (exterior 2 (R + 1)) →g
(whb_faceRegion H).deleteEdges {s(f0, g0)} where
toFun v := (v : Site 2)
map_rel' := by
intro a b hab
exact jfd_deleted_adj_of_exterior H R f0 g0 hHR hf0 hg0 a.2 b.2 hab
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def box (d n : ℕ) : Set (Site d) := {x | ∀ i, (x i).natAbs ≤ n}
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:86
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def exterior (d R : ℕ) : Set (Site d) := {x | ∃ i, R < (x i).natAbs}
MathlibExt/Combinatorics/SimpleGraph/Lattice/UniqueInfiniteComponent.lean:47
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
TheoremJordan curve theorem for cycles: face count two#✓fully proved
A cycle, as a graph on its own vertices, has face count two: the combinatorial form of the Jordan curve theorem for cycles (C. Jordan, Cours d'analyse, 1887).
theorem jcs_cycle_faceCount_eq_two {V : Type*} {G : SimpleGraph V} {v : V}
(c : G.Walk v v) (hc : c.IsCycle) :
faceCount c.toSubgraph.coe = 2
noncomputable def faceCount (G : SimpleGraph V) : ℕ := nullity G + 1
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:273
Uses 2
DefinitionJordan region of the cut lattice#✓fully proved
S and its complement are nonempty, and any two sites on the same side of S are connected
in the lattice with the boundary edges of S removed.
def jcs_JordanRegion (S : Set (Site 2)) : Prop :=
(∃ x, x ∈ S) ∧ (∃ y, y ∉ S) ∧
(∀ a b : Site 2, a ∈ S → b ∈ S → (latticeMinusBarrier S).Reachable a b) ∧
(∀ a b : Site 2, a ∉ S → b ∉ S → (latticeMinusBarrier S).Reachable a b)
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
noncomputable def latticeMinusBarrier (S : Set (Site 2)) : SimpleGraph (Site 2) where
Adj x y := (hypercubicLattice 2).Adj x y ∧ ¬ bdEdge S s(x, y)
symm := by
refine ⟨?_⟩
intro x y ⟨hadj, hbd⟩
refine ⟨hadj.symm, ?_⟩
rwa [Sym2.eq_swap]
loopless := ⟨fun x h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/CrossingParity.lean:131
Uses 2
DefinitionBounded region count as cycle rank#✓fully proved
The number of bounded regions of a finite graph, defined as its cycle rank nullity G.
noncomputable def jes_boundedRegionCount [Finite V] [DecidableEq V] (G : SimpleGraph V) : ℕ :=
nullity G
noncomputable def nullity (G : SimpleGraph V) : ℕ :=
(G.edgeSet.ncard + Nat.card G.ConnectedComponent) - Nat.card V
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:267
Uses 1
DefinitionQuadrant below and left of a site#✓fully proved
The quadrant of sites p with p 0 ≤ z 0 - 1 and p 1 ≤ z 1 - 1.
def jec_quad (z : Site 2) : Set (Site 2) := {p | p 0 ≤ z 0 - 1 ∧ p 1 ≤ z 1 - 1}
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
DefinitionRay edges left of a site#✓fully proved
The vertical lattice edges in a column left of z joining rows z 1 - 1 and z 1: the
edges crossed by a horizontal ray going left from the face corner of z.
def jec_rayEdge (z : Site 2) (e : Sym2 (Site 2)) : Prop := by
classical
exact Sym2.lift ⟨fun x y =>
(x 0 = y 0 ∧ x 0 ≤ z 0 - 1) ∧
((x 1 = z 1 - 1 ∧ y 1 = z 1) ∨ (y 1 = z 1 - 1 ∧ x 1 = z 1)), by
intro x y; simp only [eq_iff_iff]
constructor
· rintro ⟨⟨h1, h2⟩, h3⟩; exact ⟨⟨h1.symm, h1 ▸ h2⟩, by tauto⟩
· rintro ⟨⟨h1, h2⟩, h3⟩; exact ⟨⟨h1.symm, h1 ▸ h2⟩, by tauto⟩⟩ e
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 2
DefinitionWall edges below a site#✓fully proved
The horizontal lattice edges in a row below z joining columns z 0 - 1 and z 0: the
edges crossed by a vertical ray going down from the face corner of z.
def jec_wallEdge (z : Site 2) (e : Sym2 (Site 2)) : Prop := by
classical
exact Sym2.lift ⟨fun x y =>
(x 1 = y 1 ∧ x 1 ≤ z 1 - 1) ∧
((x 0 = z 0 - 1 ∧ y 0 = z 0) ∨ (y 0 = z 0 - 1 ∧ x 0 = z 0)), by
intro x y; simp only [eq_iff_iff]
constructor
· rintro ⟨⟨h1, h2⟩, h3⟩; exact ⟨⟨h1.symm, h1 ▸ h2⟩, by tauto⟩
· rintro ⟨⟨h1, h2⟩, h3⟩; exact ⟨⟨h1.symm, h1 ▸ h2⟩, by tauto⟩⟩ e
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 2
DefinitionRay-crossing count of a walk#✓fully proved
The number of ray edges of z traversed by the walk w.
noncomputable def jec_rayCount (z : Site 2) {x y : Site 2}
(w : (hypercubicLattice 2).Walk x y) : ℕ :=
w.edges.countP (fun e => decide (jec_rayEdge z e))
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def jec_rayEdge (z : Site 2) (e : Sym2 (Site 2)) : Prop := by
classical
exact Sym2.lift ⟨fun x y =>
(x 0 = y 0 ∧ x 0 ≤ z 0 - 1) ∧
((x 1 = z 1 - 1 ∧ y 1 = z 1) ∨ (y 1 = z 1 - 1 ∧ x 1 = z 1)), by
intro x y; simp only [eq_iff_iff]
constructor
· rintro ⟨⟨h1, h2⟩, h3⟩; exact ⟨⟨h1.symm, h1 ▸ h2⟩, by tauto⟩
· rintro ⟨⟨h1, h2⟩, h3⟩; exact ⟨⟨h1.symm, h1 ▸ h2⟩, by tauto⟩⟩ e
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanExteriorClosure.lean:66
DefinitionWall-crossing count of a walk#✓fully proved
The number of wall edges of z traversed by the walk w.
noncomputable def jec_wallCount (z : Site 2) {x y : Site 2}
(w : (hypercubicLattice 2).Walk x y) : ℕ :=
w.edges.countP (fun e => decide (jec_wallEdge z e))
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def jec_wallEdge (z : Site 2) (e : Sym2 (Site 2)) : Prop := by
classical
exact Sym2.lift ⟨fun x y =>
(x 1 = y 1 ∧ x 1 ≤ z 1 - 1) ∧
((x 0 = z 0 - 1 ∧ y 0 = z 0) ∨ (y 0 = z 0 - 1 ∧ x 0 = z 0)), by
intro x y; simp only [eq_iff_iff]
constructor
· rintro ⟨⟨h1, h2⟩, h3⟩; exact ⟨⟨h1.symm, h1 ▸ h2⟩, by tauto⟩
· rintro ⟨⟨h1, h2⟩, h3⟩; exact ⟨⟨h1.symm, h1 ▸ h2⟩, by tauto⟩⟩ e
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanExteriorClosure.lean:84
Uses 3 · Used by 1
DefinitionInside of a closed walk by the even-odd rule#✓fully proved
The inside of a closed walk Vc by the even–odd rule: sites whose ray count with respect to
Vc is odd.
def jec_leftRegion {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) : Set (Site 2) :=
{z | ¬ Even (jec_rayCount z Vc)}
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
noncomputable def jec_rayCount (z : Site 2) {x y : Site 2}
(w : (hypercubicLattice 2).Walk x y) : ℕ :=
w.edges.countP (fun e => decide (jec_rayEdge z e))
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanExteriorClosure.lean:113
Uses 3 · Used by 4
DefinitionVertical lattice path upward#✓fully proved
The vertical lattice path from (col, r) up to (col, r + k).
def jec_vsegUp (col : ℤ) : (r : ℤ) → (k : ℕ) →
(hypercubicLattice 2).Walk ![col, r] ![col, r + (k:ℤ)]
| r, 0 => (SimpleGraph.Walk.nil).copy rfl (by norm_num)
| r, (k+1) => by
have hadj : (hypercubicLattice 2).Adj ![col, r] ![col, r+1] := by
simp [hypercubicLattice_adj, Fin.sum_univ_two]
exact (SimpleGraph.Walk.cons hadj (jec_vsegUp col (r+1) k)).copy rfl (by push_cast; ring_nf)
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
Uses 2 · Used by 2
DefinitionHorizontal lattice path rightward#✓fully proved
The horizontal lattice path from (t, row) right to (t + k, row).
def jec_hsegRight (row : ℤ) : (t : ℤ) → (k : ℕ) →
(hypercubicLattice 2).Walk ![t, row] ![t + (k:ℤ), row]
| t, 0 => (SimpleGraph.Walk.nil).copy rfl (by norm_num)
| t, (k+1) => by
have hadj : (hypercubicLattice 2).Adj ![t, row] ![t+1, row] := by
simp [hypercubicLattice_adj, Fin.sum_univ_two]
exact (SimpleGraph.Walk.cons hadj (jec_hsegRight row (t+1) k)).copy rfl
(by push_cast; ring_nf)
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
Uses 2 · Used by 2
DefinitionReturn path around a rectangle#✓fully proved
A lattice path from (b0, d) back to (a0, c) running outside the rectangle [α, β] × [c,
d]: up, left to column α - 1, down to row c - 1, right, and up.
StatMech.Lattice.jec_retPath · 16 lines
def jec_retPath (α a0 b0 c d : ℤ) (_ha : α ≤ a0) (_hb : α ≤ b0) (_hcd : c ≤ d) :
(hypercubicLattice 2).Walk ![b0, d] ![a0, c] :=
let s1 : (hypercubicLattice 2).Walk ![b0, d] ![b0, d+1] :=
(jec_vsegUp b0 d 1).copy rfl (by ext i; fin_cases i <;> simp)
let s2 : (hypercubicLattice 2).Walk ![b0, d+1] ![α-1, d+1] :=
((jec_hsegRight (d+1) (α-1) (b0-(α-1)).toNat).copy rfl
(by ext i; fin_cases i <;> (simp; try omega))).reverse
let s3 : (hypercubicLattice 2).Walk ![α-1, d+1] ![α-1, c-1] :=
((jec_vsegUp (α-1) (c-1) (d+1-(c-1)).toNat).copy rfl
(by ext i; fin_cases i <;> (simp; try omega))).reverse
let s4 : (hypercubicLattice 2).Walk ![α-1, c-1] ![a0, c-1] :=
(jec_hsegRight (c-1) (α-1) (a0-(α-1)).toNat).copy rfl
(by ext i; fin_cases i <;> (simp; try omega))
let s5 : (hypercubicLattice 2).Walk ![a0, c-1] ![a0, c] :=
(jec_vsegUp a0 (c-1) 1).copy rfl (by ext i; fin_cases i <;> simp)
s1.append (s2.append (s3.append (s4.append s5)))
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def jec_vsegUp (col : ℤ) : (r : ℤ) → (k : ℕ) →
(hypercubicLattice 2).Walk ![col, r] ![col, r + (k:ℤ)]
| r, 0 => (SimpleGraph.Walk.nil).copy rfl (by norm_num)
| r, (k+1) => by
have hadj : (hypercubicLattice 2).Adj ![col, r] ![col, r+1] := by
simp [hypercubicLattice_adj, Fin.sum_univ_two]
exact (SimpleGraph.Walk.cons hadj (jec_vsegUp col (r+1) k)).copy rfl (by push_cast; ring_nf)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanExteriorClosure.lean:301
Uses 4 · Used by 1
DefinitionHalf-plane below a row#✓fully proved
The half-plane of sites in rows below y.
def jec_belowSet (y : ℤ) : Set (Site 2) := {p | p 1 ≤ y - 1}
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
TheoremOpen vertical crossings separate the sides of a rectangle#✓fully proved
For every configuration, every overlap rectangle, and every α < β, c ≤ d, the arc-side
property StatMech.Universality.CrossingArcSides holds: an open vertical crossing of the
overlap separates the left side of [α, β] × [c, d] from its right side.
theorem jec_crossingArcSides (ω : ConfigSpace (Sym2 (Site 2))) {α β m m' c d : ℤ}
(hαβ : α < β) (hcd : c ≤ d) :
StatMech.Universality.CrossingArcSides ω α β m m' c d
abbrev ConfigSpace (E : Type*) : Type _ := E → Bool
MathlibExt/Probability/Configuration/ConfigSpace.lean:40
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def CrossingArcSides (ω : ConfigSpace (Sym2 (Site 2))) (α β m m' c d : ℤ) : Prop :=
α ≤ m → m ≤ m' → m' ≤ β →
∀ (xB : Site 2) (hxB : xB ∈ rect m m' c d),
xB ∈ bottomSide m m' c d →
∀ (yT : Site 2) (hyT : yT ∈ topSide m m' c d),
ConnectedWithin 2 ω (rect m m' c d) ⟨xB, hxB⟩ ⟨yT, topSide_subset hyT⟩ →
∃ L : Set (Site 2),
(∀ z : Site 2, z ∈ rect α β c d → z 0 = α → z ∈ L) ∧
(∀ z : Site 2, z ∈ rect α β c d → z 0 = β → z ∉ L) ∧
(∀ u v : Site 2, u ∈ rect α β c d → v ∈ rect α β c d →
(hypercubicLattice 2).Adj u v → bdEdge L s(u, v) →
u ∈ overlapComp ω m m' c d xB hxB ∨ v ∈ overlapComp ω m m' c d xB hxB)
MathlibExt/Probability/Percolation/Universality/CrossingSeparation.lean:120
Uses 25
DefinitionSet of sites is the inside of a closed lattice walk#✓fully proved
Some closed lattice walk has odd ray count exactly at the sites of K, so K is the inside
of that walk.
def ccs_OrbitIsLoop (K : Set (Site 2)) : Prop :=
∃ (a : Site 2) (Vc : (hypercubicLattice 2).Walk a a),
(∀ z, z ∈ K → ¬ Even (jec_rayCount z Vc)) ∧
(∀ z, z ∉ K → Even (jec_rayCount z Vc))
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
noncomputable def jec_rayCount (z : Site 2) {x y : Site 2}
(w : (hypercubicLattice 2).Walk x y) : ℕ :=
w.edges.countP (fun e => decide (jec_rayEdge z e))
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanExteriorClosure.lean:113
Uses 3
DefinitionInside and outside of a closed walk are connected#✓fully proved
The inside and the outside of Vc are nonempty and each is connected in the lattice with the
boundary edges of the inside removed. This is StatMech.Lattice.jcs_JordanRegion
(jec_leftRegion Vc).
def egf_LoopFloodFill {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) : Prop :=
(∃ x, x ∈ jec_leftRegion Vc) ∧ (∃ y, y ∉ jec_leftRegion Vc) ∧
(∀ p q : Site 2, p ∈ jec_leftRegion Vc → q ∈ jec_leftRegion Vc →
(latticeMinusBarrier (jec_leftRegion Vc)).Reachable p q) ∧
(∀ p q : Site 2, p ∉ jec_leftRegion Vc → q ∉ jec_leftRegion Vc →
(latticeMinusBarrier (jec_leftRegion Vc)).Reachable p q)
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def jec_leftRegion {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) : Set (Site 2) :=
{z | ¬ Even (jec_rayCount z Vc)}
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanExteriorClosure.lean:282
noncomputable def latticeMinusBarrier (S : Set (Site 2)) : SimpleGraph (Site 2) where
Adj x y := (hypercubicLattice 2).Adj x y ∧ ¬ bdEdge S s(x, y)
symm := by
refine ⟨?_⟩
intro x y ⟨hadj, hbd⟩
refine ⟨hadj.symm, ?_⟩
rwa [Sym2.eq_swap]
loopless := ⟨fun x h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/CrossingParity.lean:131
DefinitionLattice off a closed walk#✓fully proved
The subgraph of the square lattice induced on the sites not visited by Vc.
noncomputable def fcb_offComplGraph {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) :
SimpleGraph {z : Site 2 // z ∉ Vc.support} :=
(ffc_offSupportLattice {z | z ∈ Vc.support}).induce {z : Site 2 | z ∉ Vc.support}
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def ffc_offSupportLattice (B : Set (Site 2)) : SimpleGraph (Site 2) where
Adj x y := (hypercubicLattice 2).Adj x y ∧ x ∉ B ∧ y ∉ B
symm := by
refine ⟨?_⟩
rintro x y ⟨hadj, hx, hy⟩
exact ⟨hadj.symm, hy, hx⟩
loopless := ⟨fun x h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/FloodFillConnected.lean:45
DefinitionJordan region property off a closed walk#✓fully proved
Both sides of Vc contain sites off Vc, and any two sites off Vc on the same side are
joined by a lattice path avoiding Vc.
def fcb_OffComplJordanRegion {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) : Prop :=
(∃ x, x ∈ jec_leftRegion Vc ∧ x ∉ Vc.support) ∧
(∃ y, y ∉ jec_leftRegion Vc ∧ y ∉ Vc.support) ∧
(∀ s t : Site 2, s ∈ jec_leftRegion Vc → t ∈ jec_leftRegion Vc →
s ∉ Vc.support → t ∉ Vc.support →
∃ p : (hypercubicLattice 2).Walk s t, ∀ z ∈ p.support, z ∉ Vc.support) ∧
(∀ s t : Site 2, s ∉ jec_leftRegion Vc → t ∉ jec_leftRegion Vc →
s ∉ Vc.support → t ∉ Vc.support →
∃ p : (hypercubicLattice 2).Walk s t, ∀ z ∈ p.support, z ∉ Vc.support)
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def jec_leftRegion {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) : Set (Site 2) :=
{z | ¬ Even (jec_rayCount z Vc)}
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanExteriorClosure.lean:282
TheoremVeblen's theorem step for unions of cycles#✓fully proved
One step of Veblen's theorem (O. Veblen, 1912) for graphs whose vertices all have degree zero or two: a nonempty such graph has a subgraph of the same kind with fewer edges and face count one less (obtained by deleting a cycle).
theorem jvp_isCycles_veblenStep {V : Type*} [Finite V]
(K : SimpleGraph V) [LocallyFinite K] (hcyc : K.IsCycles) (hne : K.edgeSet.Nonempty) :
∃ K' : SimpleGraph V, K' ≤ K ∧ K'.IsCycles ∧
K'.edgeSet.ncard < K.edgeSet.ncard ∧ faceCount K' + 1 = faceCount K
noncomputable def faceCount (G : SimpleGraph V) : ℕ := nullity G + 1
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:273
DefinitionAdjacency relation of the cut horizontal axis#✓fully proved
Both sites lie on the horizontal axis and the pair is not {(0, 0), (1, 0)}.
def jkr_lineRel (a b : Site 2) : Prop :=
a 1 = 0 ∧ b 1 = 0 ∧ ¬ ({a 0, b 0} = ({0, 1} : Finset ℤ))
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
DefinitionHorizontal axis with one edge removed#✓fully proved
The horizontal axis of ℤ² with the edge from (0, 0) to (1, 0) removed.
def jkr_lineH : SimpleGraph (Site 2) where
Adj a b := (hypercubicLattice 2).Adj a b ∧ jkr_lineRel a b
symm := by
refine ⟨?_⟩
rintro a b ⟨hadj, h0, h1, hne⟩
refine ⟨hadj.symm, h1, h0, ?_⟩
rwa [Finset.pair_comm]
loopless := ⟨fun a h => (hypercubicLattice 2).irrefl h.1⟩
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def jkr_lineRel (a b : Site 2) : Prop :=
a 1 = 0 ∧ b 1 = 0 ∧ ¬ ({a 0, b 0} = ({0, 1} : Finset ℤ))
MathlibExt/Combinatorics/SimpleGraph/Lattice/KeepReconnectCounterexample.lean:47
DefinitionKeep-reconnect residue for finite graphs#✓fully proved
For every graph H of ℤ² with finitely many edges and every lattice edge pq outside H
with dual edge f0g0: if p and q are disconnected in H, then f0 and g0 are
connected in the face-region graph of H with f0g0 deleted.
def jkr_FiniteKeepReconnectResidue : Prop :=
∀ (H : SimpleGraph (Site 2)) (p q f0 g0 : Site 2),
H.edgeSet.Finite →
(hypercubicLattice 2).Adj p q → s(p, q) ∉ H.edgeSet →
(hypercubicLattice 2).Adj f0 g0 → sharedPrimalEdge f0 g0 = s(p, q) →
¬ H.Reachable p q →
((whb_faceRegion H).deleteEdges {s(f0, g0)}).Reachable f0 g0
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
noncomputable def sharedPrimalEdge (f g : Site 2) : Sym2 (Site 2) := by
classical
exact if f 0 = g 0 then
s(![f 0, max (f 1) (g 1)], ![f 0 + 1, max (f 1) (g 1)])
else
s(![max (f 0) (g 0), f 1], ![max (f 0) (g 0), f 1 + 1])
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEnclosure.lean:223
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
DefinitionRotated region graph of a lattice subgraph#✓fully proved
The square lattice with the edge crossEdge e removed for every edge e of G. Since
crossEdge is a global rotation, this is not the faithful dual complement; see
StatMech.Lattice.whb_faceRegion for the version using sharedPrimalEdge.
def regionGraph (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ crossEdge.symm s(f, g) ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hcross⟩
exact ⟨hadj.symm, by rwa [Sym2.eq_swap]⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def crossEdge : Sym2 (Site 2) ≃ Sym2 (Site 2) := sym2Congr rot90Equiv
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarDual.lean:144
Uses 3 · Used by 5
StructurePlanar lattice subgraph of the square lattice#✓fully proved
A finite graph together with an injective map into ℤ² that sends edges to lattice edges.
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
isSub : ∀ ⦃x y : V⦄, G.Adj x y → (hypercubicLattice 2).Adj (emb x) (emb y)
V : Type
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:68
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
G : SimpleGraph V
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:74
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
emb : V ↪ Site 2
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:76
Uses 2 · Used by 54
DefinitionImage of a planar lattice subgraph in the square lattice#✓fully proved
The image of a PlanarZ2Subgraph as a subgraph of the square lattice.
noncomputable def imageGraph (P : PlanarZ2Subgraph) : SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, P.G.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := by
refine ⟨?_⟩
rintro a b ⟨x, y, hadj, rfl, rfl⟩
exact ⟨y, x, hadj.symm, rfl, rfl⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact P.G.irrefl (this ▸ hadj)⟩
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 2 · Used by 43
DefinitionGeometric count of bounded regions#✓fully proved
The number of finite connected components of the region graph of P.
noncomputable def geometricRegionCount (P : PlanarZ2Subgraph) : ℕ :=
Nat.card {c : (regionGraph (imageGraph P)).ConnectedComponent // c.supp.Finite}
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def regionGraph (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ crossEdge.symm s(f, g) ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hcross⟩
exact ⟨hadj.symm, by rwa [Sym2.eq_swap]⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:50
noncomputable def imageGraph (P : PlanarZ2Subgraph) : SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, P.G.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := by
refine ⟨?_⟩
rintro a b ⟨x, y, hadj, rfl, rfl⟩
exact ⟨y, x, hadj.symm, rfl, rfl⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact P.G.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:83
DefinitionBox exterior embeds in the region graph#✓fully proved
Outside a box containing the image of P, the lattice embeds in the region graph.
noncomputable def exteriorToRegionHom (P : PlanarZ2Subgraph) (R : ℕ)
(hR : ∀ v : P.V, P.emb v ∈ box 2 R) :
((hypercubicLattice 2).induce (exterior 2 R)) →g (regionGraph (imageGraph P)) where
toFun := Subtype.val
map_rel' := by
intro a b hab
exact regionGraph_adj_of_exterior P R hR (mem_box_compl_of_exterior a.2) hab
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def box (d n : ℕ) : Set (Site d) := {x | ∀ i, (x i).natAbs ≤ n}
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:86
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
def exterior (d R : ℕ) : Set (Site d) := {x | ∃ i, R < (x i).natAbs}
MathlibExt/Combinatorics/SimpleGraph/Lattice/UniqueInfiniteComponent.lean:47
def regionGraph (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ crossEdge.symm s(f, g) ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hcross⟩
exact ⟨hadj.symm, by rwa [Sym2.eq_swap]⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:50
noncomputable def imageGraph (P : PlanarZ2Subgraph) : SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, P.G.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := by
refine ⟨?_⟩
rintro a b ⟨x, y, hadj, rfl, rfl⟩
exact ⟨y, x, hadj.symm, rfl, rfl⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact P.G.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:83
Uses 11 · Used by 1
DefinitionEven-degree condition on a subgraph#✓fully proved
Every vertex of K has even degree.
def jcx_IsEven {V : Type*} (K : SimpleGraph V) : Prop :=
∀ v : V, Even (Nat.card (K.neighborSet v))
InductiveEven-peelable graph#✓fully proved
K reduces to the empty graph by repeatedly deleting a cycle through a base vertex v such
that, after the deletion, the other vertices of the cycle are isolated.
inductive jcx_IsEvenPeelable {V : Type*} : SimpleGraph V → Prop where
| bot : jcx_IsEvenPeelable (⊥ : SimpleGraph V)
| cycle {K : SimpleGraph V} (hev : jcx_IsEven K) {v : V} (p : K.Walk v v) (hp : p.IsCycle)
(hiso : ∀ u ∈ p.support, u ≠ v → ∀ w, ¬ (K.deleteEdges p.toSubgraph.edgeSet).Adj u w)
(hrec : jcx_IsEvenPeelable (K.deleteEdges p.toSubgraph.edgeSet)) : jcx_IsEvenPeelable K
def jcx_IsEven {V : Type*} (K : SimpleGraph V) : Prop :=
∀ v : V, Even (Nat.card (K.neighborSet v))
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanCrossingCount.lean:48
Uses 1
DefinitionVertices of two unit squares sharing a corner#✓fully proved
The vertices of two unit squares [0, 1]² and [1, 2]² sharing the corner (1, 1).
def jcx_cross_emb (i : Fin 7) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![1, 1] | 3 => ![0, 1]
| 4 => ![2, 1] | 5 => ![2, 2] | 6 => ![1, 2]
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
DefinitionAdjacency relation of two corner-sharing squares#✓fully proved
Adjacency of the two squares sharing a corner, as a Boolean relation.
def jcx_cross_rel (i j : Fin 7) : Bool :=
(i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3) ||
(i == 2 && j == 4) || (i == 4 && j == 2) || (i == 4 && j == 5) || (i == 5 && j == 4) ||
(i == 5 && j == 6) || (i == 6 && j == 5) || (i == 6 && j == 2) || (i == 2 && j == 6)
DefinitionTwo 4-cycles sharing a vertex#✓fully proved
Two 4-cycles sharing the vertex 2, on Fin 7.
def jcx_cross_G : SimpleGraph (Fin 7) where
Adj i j := jcx_cross_rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
def jcx_cross_rel (i j : Fin 7) : Bool :=
(i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3) ||
(i == 2 && j == 4) || (i == 4 && j == 2) || (i == 4 && j == 5) || (i == 5 && j == 4) ||
(i == 5 && j == 6) || (i == 6 && j == 5) || (i == 6 && j == 2) || (i == 2 && j == 6)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanCrossingCount.lean:477
Uses 1 · Used by 2
DefinitionTwo corner-sharing unit squares as a planar lattice subgraph#✓fully proved
Two unit squares sharing a corner as a PlanarZ2Subgraph.
noncomputable def jcx_cross_P : PlanarZ2Subgraph where
V := Fin 7
finV := inferInstance
decV := inferInstance
G := jcx_cross_G
emb := ⟨jcx_cross_emb, jcx_cross_emb_inj⟩
isSub := jcx_cross_isSub
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jcx_cross_G : SimpleGraph (Fin 7) where
Adj i j := jcx_cross_rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanCrossingCount.lean:484
def jcx_cross_emb (i : Fin 7) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![1, 1] | 3 => ![0, 1]
| 4 => ![2, 1] | 5 => ![2, 2] | 6 => ![1, 2]
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanCrossingCount.lean:469
theorem jcx_cross_emb_inj : Function.Injective jcx_cross_emb
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanCrossingCount.lean:474
theorem jcx_cross_isSub : ∀ ⦃i j : Fin 7⦄, jcx_cross_G.Adj i j →
(hypercubicLattice 2).Adj (jcx_cross_emb i) (jcx_cross_emb j)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanCrossingCount.lean:491
DefinitionUpper 4-cycle based at the shared vertex#✓fully proved
The 4-cycle of the upper square, based at the shared vertex.
def jcx_cross_cycB : jcx_cross_G.Walk 2 2 :=
Walk.cons (by rw [jcx_cross_G_adj]; decide : jcx_cross_G.Adj 2 4)
(Walk.cons (by rw [jcx_cross_G_adj]; decide : jcx_cross_G.Adj 4 5)
(Walk.cons (by rw [jcx_cross_G_adj]; decide : jcx_cross_G.Adj 5 6)
(Walk.cons (by rw [jcx_cross_G_adj]; decide : jcx_cross_G.Adj 6 2) Walk.nil)))
def jcx_cross_G : SimpleGraph (Fin 7) where
Adj i j := jcx_cross_rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanCrossingCount.lean:484
Uses 2
DefinitionAdjacency relation of the lower 4-cycle#✓fully proved
Adjacency of the lower 4-cycle, as a Boolean relation.
def jcx_cross_A_rel (i j : Fin 7) : Bool :=
(i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3)
Used by 1
DefinitionLower 4-cycle left after deleting the upper one#✓fully proved
The lower 4-cycle, which remains after deleting the upper one.
def jcx_cross_A : SimpleGraph (Fin 7) where
Adj i j := jcx_cross_A_rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
def jcx_cross_A_rel (i j : Fin 7) : Bool :=
(i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanCrossingCount.lean:565
Uses 1
DefinitionPushforward of a subgraph into the square lattice#✓fully proved
The image in ℤ² of a subgraph K of a PlanarZ2Subgraph P.
noncomputable def jei_pushGraph (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) :
SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, K.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := ⟨by rintro a b ⟨x, y, hadj, rfl, rfl⟩; exact ⟨y, x, hadj.symm, rfl, rfl⟩⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact K.irrefl (this ▸ hadj)⟩
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 2 · Used by 11
DefinitionEven-degree subgraphs have as many regions as their face count#✓fully proved
Every subgraph K of P whose image has all degrees even has exactly faceCount K
face-region components.
def jcx_EvenCountResidue (P : PlanarZ2Subgraph) : Prop :=
∀ (K : SimpleGraph P.V), K ≤ P.G →
jce_ClosedContour (jei_pushGraph P K).edgeSet →
Nat.card (whb_faceRegion (jei_pushGraph P K)).ConnectedComponent = faceCount K
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jce_ClosedContour (E : Set (Sym2 (Site 2))) : Prop :=
∀ v : Site 2, Even (jce_degree E v)
MathlibExt/Combinatorics/SimpleGraph/Lattice/EvenContourColoring.lean:68
noncomputable def jei_pushGraph (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) :
SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, K.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := ⟨by rintro a b ⟨x, y, hadj, rfl, rfl⟩; exact ⟨y, x, hadj.symm, rfl, rfl⟩⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact K.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEulerInduction.lean:109
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
noncomputable def faceCount (G : SimpleGraph V) : ℕ := nullity G + 1
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:273
DefinitionPeeling a cycle from an even-degree subgraph#✓fully proved
Every nonempty subgraph K of P whose image has all degrees even contains a subgraph of
the same kind with fewer edges, face count one less, and one fewer face-region component.
def jcx_EvenPeel (P : PlanarZ2Subgraph) : Prop :=
∀ (K : SimpleGraph P.V), K ≤ P.G → jce_ClosedContour (jei_pushGraph P K).edgeSet →
K ≠ ⊥ →
∃ K' : SimpleGraph P.V, K' ≤ P.G ∧ jce_ClosedContour (jei_pushGraph P K').edgeSet ∧
K'.edgeSet.ncard < K.edgeSet.ncard ∧
faceCount K' + 1 = faceCount K ∧
Nat.card (whb_faceRegion (jei_pushGraph P K)).ConnectedComponent
= Nat.card (whb_faceRegion (jei_pushGraph P K')).ConnectedComponent + 1
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jce_ClosedContour (E : Set (Sym2 (Site 2))) : Prop :=
∀ v : Site 2, Even (jce_degree E v)
MathlibExt/Combinatorics/SimpleGraph/Lattice/EvenContourColoring.lean:68
noncomputable def jei_pushGraph (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) :
SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, K.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := ⟨by rintro a b ⟨x, y, hadj, rfl, rfl⟩; exact ⟨y, x, hadj.symm, rfl, rfl⟩⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact K.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEulerInduction.lean:109
noncomputable def faceCount (G : SimpleGraph V) : ℕ := nullity G + 1
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:273
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
DefinitionSquare lattice minus the edges of a graph#✓fully proved
The square lattice with the edges of H deleted.
noncomputable def jbc_latticeMinusEdges (H : SimpleGraph (Site 2)) : SimpleGraph (Site 2) :=
(hypercubicLattice 2).deleteEdges H.edgeSet
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
Uses 2 · Used by 2
DefinitionQuarter-turn isomorphism onto the region graph#✓fully proved
The quarter-turn rotation is an isomorphism from the lattice minus the edges of H onto the
region graph of H.
noncomputable def jbc_rotIso (H : SimpleGraph (Site 2)) :
jbc_latticeMinusEdges H ≃g regionGraph H where
toEquiv := rot90Equiv
map_rel_iff' := by
intro a b
rw [rot90Equiv_apply, rot90Equiv_apply, jbc_regionGraph_rot_adj]
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
noncomputable def jbc_latticeMinusEdges (H : SimpleGraph (Site 2)) : SimpleGraph (Site 2) :=
(hypercubicLattice 2).deleteEdges H.edgeSet
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanBridgeCycle.lean:66
def regionGraph (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ crossEdge.symm s(f, g) ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hcross⟩
exact ⟨hadj.symm, by rwa [Sym2.eq_swap]⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:50
def rot90Equiv : Site 2 ≃ Site 2 where
toFun := rot90Fun
invFun := rot90Inv
left_inv := by intro x; funext i; fin_cases i <;> simp [rot90Fun, rot90Inv]
right_inv := by intro x; funext i; fin_cases i <;> simp [rot90Fun, rot90Inv]
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarDual.lean:77
Uses 8
DefinitionDisconnected sites are joined in the lattice minus a bridged graph#✓fully proved
If x and y are not connected in K, they are connected in the lattice minus the image of
K ⊔ edge x y.
def jbc_BridgeDirection (P : PlanarZ2Subgraph) : Prop :=
∀ (K : SimpleGraph P.V), K ≤ P.G → ∀ {x y : P.V}, P.G.Adj x y → ¬ K.Adj x y →
¬ K.Reachable x y →
(jbc_latticeMinusEdges (jei_pushGraph P (K ⊔ edge x y))).Reachable (P.emb x) (P.emb y)
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
noncomputable def jbc_latticeMinusEdges (H : SimpleGraph (Site 2)) : SimpleGraph (Site 2) :=
(hypercubicLattice 2).deleteEdges H.edgeSet
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanBridgeCycle.lean:66
noncomputable def jei_pushGraph (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) :
SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, K.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := ⟨by rintro a b ⟨x, y, hadj, rfl, rfl⟩; exact ⟨y, x, hadj.symm, rfl, rfl⟩⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact K.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEulerInduction.lean:109
DefinitionCorners of the unit square in cyclic order#✓fully proved
The four corners (0, 0), (1, 0), (1, 1), (0, 1) of the unit square, in cyclic order.
def jbc_csq (i : Fin 4) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![1, 1] | 3 => ![0, 1]
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
DefinitionAdjacency relation of the 4-cycle#✓fully proved
Adjacency of the 4-cycle 0 – 1 – 2 – 3 – 0, as a Boolean relation.
def jbc_cyc4Rel (i j : Fin 4) : Bool :=
(i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3)
Used by 2
DefinitionThe 4-cycle graph#✓fully proved
The 4-cycle on Fin 4.
def jbc_cyc4 : SimpleGraph (Fin 4) where
Adj i j := jbc_cyc4Rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
def jbc_cyc4Rel (i j : Fin 4) : Bool :=
(i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanBridgeCycle.lean:139
Uses 1 · Used by 1
DefinitionVertex 0 of the 4-cycle#✓fully proved
The vertex 0 of the 4-cycle.
def jbc_v0 : Fin 4 := 0
DefinitionVertex 1 of the 4-cycle#✓fully proved
The vertex 1 of the 4-cycle.
def jbc_v1 : Fin 4 := 1
DefinitionUnit square as a planar lattice subgraph#✓fully proved
The unit square: the 4-cycle embedded on the corners of [0, 1]².
noncomputable def jbc_Pce : PlanarZ2Subgraph where
V := Fin 4
finV := inferInstance
decV := inferInstance
G := jbc_cyc4
emb := ⟨jbc_csq, jbc_csq_inj⟩
isSub := jbc_csq_isSub
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jbc_cyc4 : SimpleGraph (Fin 4) where
Adj i j := jbc_cyc4Rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanBridgeCycle.lean:144
def jbc_csq (i : Fin 4) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![1, 1] | 3 => ![0, 1]
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanBridgeCycle.lean:129
theorem jbc_csq_inj : Function.Injective jbc_csq
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanBridgeCycle.lean:133
theorem jbc_csq_isSub :
∀ ⦃i j : Fin 4⦄, jbc_cyc4.Adj i j → (hypercubicLattice 2).Adj (jbc_csq i) (jbc_csq j)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanBridgeCycle.lean:151
InductiveCactus graph, defined by peeling leaves and cycles#✓fully proved
K reduces to the empty graph by repeatedly deleting a leaf edge or, when K is a union of
cycles, one of its cycles.
inductive jgc_IsCactus {V : Type*} : SimpleGraph V → Prop where
| bot : jgc_IsCactus (⊥ : SimpleGraph V)
| leaf {K : SimpleGraph V} {x z : V} (hadj : K.Adj x z) (huniq : ∀ w, K.Adj x w → w = z)
(hrec : jgc_IsCactus (K.deleteEdges {s(x, z)})) : jgc_IsCactus K
| cycle {K : SimpleGraph V} (hcyc : K.IsCycles) {v : V} (p : K.Walk v v) (hp : p.IsCycle)
(hrec : jgc_IsCactus (K.deleteEdges p.toSubgraph.edgeSet)) : jgc_IsCactus K
DefinitionUnit square corners with a pendant site#✓fully proved
The corners of the unit square together with the site (-1, 0).
def jgc_pend_emb (i : Fin 5) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![1, 1] | 3 => ![0, 1] | 4 => ![-1, 0]
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
DefinitionAdjacency relation of a 4-cycle with a pendant edge#✓fully proved
Adjacency of the 4-cycle on 0, 1, 2, 3 with the pendant edge {0, 4}, as a Boolean
relation.
Definition4-cycle with a pendant edge#✓fully proved
The 4-cycle with a pendant edge, on Fin 5.
def jgc_pend_G : SimpleGraph (Fin 5) where
Adj i j := jgc_pend_rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
def jgc_pend_rel (i j : Fin 5) : Bool :=
(i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3) ||
(i == 0 && j == 4) || (i == 4 && j == 0)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanGeneralCount.lean:243
Uses 1 · Used by 1
DefinitionUnit square with a pendant edge as a planar lattice subgraph#✓fully proved
The unit square with a pendant edge as a PlanarZ2Subgraph.
noncomputable def jgc_pend_P : PlanarZ2Subgraph where
V := Fin 5
finV := inferInstance
decV := inferInstance
G := jgc_pend_G
emb := ⟨jgc_pend_emb, jgc_pend_emb_inj⟩
isSub := jgc_pend_isSub
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jgc_pend_G : SimpleGraph (Fin 5) where
Adj i j := jgc_pend_rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanGeneralCount.lean:249
def jgc_pend_emb (i : Fin 5) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![1, 1] | 3 => ![0, 1] | 4 => ![-1, 0]
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanGeneralCount.lean:235
theorem jgc_pend_emb_inj : Function.Injective jgc_pend_emb
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanGeneralCount.lean:239
theorem jgc_pend_isSub : ∀ ⦃i j : Fin 5⦄, jgc_pend_G.Adj i j →
(hypercubicLattice 2).Adj (jgc_pend_emb i) (jgc_pend_emb j)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanGeneralCount.lean:256
Definition4-cycle core of the pendant example#✓fully proved
The 4-cycle on 0, 1, 2, 3 inside Fin 5.
def jgc_pend_core : SimpleGraph (Fin 5) where
Adj i j :=
((i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3) : Bool)
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
DefinitionNumber of face regions of a subgraph's image#✓fully proved
The number of connected components of the face-region graph of the image of K.
noncomputable def jic_tc (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) : ℕ :=
Nat.card (whb_faceRegion (jei_pushGraph P K)).ConnectedComponent
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
noncomputable def jei_pushGraph (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) :
SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, K.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := ⟨by rintro a b ⟨x, y, hadj, rfl, rfl⟩; exact ⟨y, x, hadj.symm, rfl, rfl⟩⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact K.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEulerInduction.lean:109
DefinitionCorners of two distant unit squares#✓fully proved
The corners of the unit squares at (0, 0) and (10, 0).
def jic_twoSq_emb (i : Fin 8) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![1, 1] | 3 => ![0, 1]
| 4 => ![10, 0] | 5 => ![11, 0] | 6 => ![11, 1] | 7 => ![10, 1]
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
DefinitionAdjacency relation of two disjoint 4-cycles#✓fully proved
Adjacency of two disjoint 4-cycles on Fin 8, as a Boolean relation.
def jic_twoSq_rel (i j : Fin 8) : Bool :=
(i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3) ||
(i == 4 && j == 5) || (i == 5 && j == 4) || (i == 5 && j == 6) || (i == 6 && j == 5) ||
(i == 6 && j == 7) || (i == 7 && j == 6) || (i == 7 && j == 4) || (i == 4 && j == 7)
Used by 2
DefinitionTwo disjoint 4-cycles#✓fully proved
Two disjoint 4-cycles on Fin 8.
def jic_twoSq_G : SimpleGraph (Fin 8) where
Adj i j := jic_twoSq_rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
def jic_twoSq_rel (i j : Fin 8) : Bool :=
(i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1) ||
(i == 2 && j == 3) || (i == 3 && j == 2) || (i == 3 && j == 0) || (i == 0 && j == 3) ||
(i == 4 && j == 5) || (i == 5 && j == 4) || (i == 5 && j == 6) || (i == 6 && j == 5) ||
(i == 6 && j == 7) || (i == 7 && j == 6) || (i == 7 && j == 4) || (i == 4 && j == 7)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanIsCyclesCount.lean:604
Uses 1 · Used by 1
DefinitionTwo disjoint unit squares as a planar lattice subgraph#✓fully proved
Two disjoint unit squares as a PlanarZ2Subgraph.
noncomputable def jic_twoSq_P : PlanarZ2Subgraph where
V := Fin 8
finV := inferInstance
decV := inferInstance
G := jic_twoSq_G
emb := ⟨jic_twoSq_emb, jic_twoSq_emb_inj⟩
isSub := jic_twoSq_isSub
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jic_twoSq_G : SimpleGraph (Fin 8) where
Adj i j := jic_twoSq_rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanIsCyclesCount.lean:611
def jic_twoSq_emb (i : Fin 8) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![1, 1] | 3 => ![0, 1]
| 4 => ![10, 0] | 5 => ![11, 0] | 6 => ![11, 1] | 7 => ![10, 1]
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanIsCyclesCount.lean:596
theorem jic_twoSq_emb_inj : Function.Injective jic_twoSq_emb
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanIsCyclesCount.lean:601
theorem jic_twoSq_isSub : ∀ ⦃i j : Fin 8⦄, jic_twoSq_G.Adj i j →
(hypercubicLattice 2).Adj (jic_twoSq_emb i) (jic_twoSq_emb j)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanIsCyclesCount.lean:618
DefinitionRadius of a box containing a planar lattice subgraph#✓fully proved
A radius R such that the image of P lies in box 2 R.
noncomputable def outerBoxRadius (P : PlanarZ2Subgraph) : ℕ := (image_subset_box P).choose
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
theorem image_subset_box (P : PlanarZ2Subgraph) :
∃ R : ℕ, ∀ v : P.V, P.emb v ∈ box 2 R
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:130
Uses 4 · Used by 11
DefinitionOuter region of the rotated region graph#✓fully proved
The outer region: the component of the region graph containing the far site beacon 2 R.
noncomputable def outerRegion (P : PlanarZ2Subgraph) :
(regionGraph (imageGraph P)).ConnectedComponent :=
(regionGraph (imageGraph P)).connectedComponentMk (beacon 2 (outerBoxRadius P))
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def regionGraph (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ crossEdge.symm s(f, g) ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hcross⟩
exact ⟨hadj.symm, by rwa [Sym2.eq_swap]⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:50
noncomputable def imageGraph (P : PlanarZ2Subgraph) : SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, P.G.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := by
refine ⟨?_⟩
rintro a b ⟨x, y, hadj, rfl, rfl⟩
exact ⟨y, x, hadj.symm, rfl, rfl⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact P.G.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:83
def beacon (d R : ℕ) : Site d := fun _ => (R : ℤ) + 1
MathlibExt/Combinatorics/SimpleGraph/Lattice/UniqueInfiniteComponent.lean:153
noncomputable def outerBoxRadius (P : PlanarZ2Subgraph) : ℕ := (image_subset_box P).choose
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanOuterFaceUnique.lean:49
Uses 6 · Used by 1
DefinitionBounded regions are the components other than the outer one#✓fully proved
The finite components of the region graph are exactly the components other than the outer region.
def boundedRegionEquivNeOuter (P : PlanarZ2Subgraph) :
{C : (regionGraph (imageGraph P)).ConnectedComponent // C.supp.Finite} ≃
{C : (regionGraph (imageGraph P)).ConnectedComponent // C ≠ outerRegion P} :=
Equiv.subtypeEquivRight (boundedRegion_iff_ne_outer P)
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def regionGraph (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ crossEdge.symm s(f, g) ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hcross⟩
exact ⟨hadj.symm, by rwa [Sym2.eq_swap]⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:50
noncomputable def imageGraph (P : PlanarZ2Subgraph) : SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, P.G.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := by
refine ⟨?_⟩
rintro a b ⟨x, y, hadj, rfl, rfl⟩
exact ⟨y, x, hadj.symm, rfl, rfl⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact P.G.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:83
noncomputable def outerRegion (P : PlanarZ2Subgraph) :
(regionGraph (imageGraph P)).ConnectedComponent :=
(regionGraph (imageGraph P)).connectedComponentMk (beacon 2 (outerBoxRadius P))
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanOuterFaceUnique.lean:56
theorem boundedRegion_iff_ne_outer (P : PlanarZ2Subgraph)
(C : (regionGraph (imageGraph P)).ConnectedComponent) :
C.supp.Finite ↔ C ≠ outerRegion P
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanOuterFaceUnique.lean:110
Uses 13
DefinitionWhitney cut-cycle duality for a planar lattice subgraph#✓fully proved
Whitney's cut–cycle duality for P: for every subgraph K of P and edge xy of P not
in K, with f0g0 the dual edge across it, x and y are connected in K iff f0 and
g0 are disconnected in the face-region graph of K with f0g0 deleted.
def jfc_WhbSync (P : PlanarZ2Subgraph) : Prop :=
∀ (K : SimpleGraph P.V), K ≤ P.G → ∀ {x y : P.V}, P.G.Adj x y → ¬ K.Adj x y →
∀ {f0 g0 : Site 2}, (hypercubicLattice 2).Adj f0 g0 →
sharedPrimalEdge f0 g0 = s(P.emb x, P.emb y) →
(K.Reachable x y ↔
¬ ((whb_faceRegion (jei_pushGraph P K)).deleteEdges {s(f0, g0)}).Reachable f0 g0)
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
noncomputable def sharedPrimalEdge (f g : Site 2) : Sym2 (Site 2) := by
classical
exact if f 0 = g 0 then
s(![f 0, max (f 1) (g 1)], ![f 0 + 1, max (f 1) (g 1)])
else
s(![max (f 0) (g 0), f 1], ![max (f 0) (g 0), f 1 + 1])
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEnclosure.lean:223
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
noncomputable def jei_pushGraph (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) :
SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, K.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := ⟨by rintro a b ⟨x, y, hadj, rfl, rfl⟩; exact ⟨y, x, hadj.symm, rfl, rfl⟩⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact K.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEulerInduction.lean:109
DefinitionOuter face region of a planar lattice subgraph#✓fully proved
The outer region: the component of the face-region graph of P containing a face far from
P.
noncomputable def jfc_whb_outerRegion (P : PlanarZ2Subgraph) :
(whb_faceRegion (imageGraph P)).ConnectedComponent :=
(whb_faceRegion (imageGraph P)).connectedComponentMk (beacon 2 (outerBoxRadius P + 1))
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
noncomputable def imageGraph (P : PlanarZ2Subgraph) : SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, P.G.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := by
refine ⟨?_⟩
rintro a b ⟨x, y, hadj, rfl, rfl⟩
exact ⟨y, x, hadj.symm, rfl, rfl⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact P.G.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:83
def beacon (d R : ℕ) : Site d := fun _ => (R : ℤ) + 1
MathlibExt/Combinatorics/SimpleGraph/Lattice/UniqueInfiniteComponent.lean:153
noncomputable def outerBoxRadius (P : PlanarZ2Subgraph) : ℕ := (image_subset_box P).choose
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanOuterFaceUnique.lean:49
Uses 6 · Used by 7
DefinitionPushed-forward subgraphs are locally finite#✓fully proved
The image of a subgraph of a PlanarZ2Subgraph is locally finite.
@[instance_reducible]
noncomputable def jfc_pushGraph_locallyFinite (P : PlanarZ2Subgraph) (K : SimpleGraph P.V)
(hKle : K ≤ P.G) : SimpleGraph.LocallyFinite (jei_pushGraph P K) := fun _v =>
Set.Finite.fintype (Set.Finite.subset (Set.toFinite _) (fun _w hw =>
(SimpleGraph.mem_neighborSet _ _ _).mpr (jfc_pushGraph_le_lattice P K hKle hw)))
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
noncomputable def jei_pushGraph (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) :
SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, K.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := ⟨by rintro a b ⟨x, y, hadj, rfl, rfl⟩; exact ⟨y, x, hadj.symm, rfl, rfl⟩⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact K.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEulerInduction.lean:109
theorem jfc_pushGraph_le_lattice (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) (hKle : K ≤ P.G) :
jei_pushGraph P K ≤ hypercubicLattice 2
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanFaithfulCount.lean:446
Uses 8 · Used by 2
DefinitionWhitney duality for even-degree planar lattice subgraphs#✓fully proved
Every PlanarZ2Subgraph whose image has all degrees even satisfies jfc_WhbSync.
def jfc_EvenDegreeThreading : Prop :=
∀ (P : PlanarZ2Subgraph), jeb_EvenDegreeSubgraph P → jfc_WhbSync P
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jeb_EvenDegreeSubgraph (P : PlanarZ2Subgraph) : Prop :=
jce_ClosedContour (imageGraph P).edgeSet
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEvenBiconditional.lean:376
def jfc_WhbSync (P : PlanarZ2Subgraph) : Prop :=
∀ (K : SimpleGraph P.V), K ≤ P.G → ∀ {x y : P.V}, P.G.Adj x y → ¬ K.Adj x y →
∀ {f0 g0 : Site 2}, (hypercubicLattice 2).Adj f0 g0 →
sharedPrimalEdge f0 g0 = s(P.emb x, P.emb y) →
(K.Reachable x y ↔
¬ ((whb_faceRegion (jei_pushGraph P K)).deleteEdges {s(f0, g0)}).Reachable f0 g0)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanFaithfulCount.lean:247
DefinitionInterior region of the unit square#✓fully proved
The component of the face (0, 0) in the face-region graph of the unit square.
noncomputable def jfc_sq_interior : (whb_faceRegion (imageGraph jbc_Pce)).ConnectedComponent :=
(whb_faceRegion (imageGraph jbc_Pce)).connectedComponentMk ![0, 0]
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
noncomputable def imageGraph (P : PlanarZ2Subgraph) : SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, P.G.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := by
refine ⟨?_⟩
rintro a b ⟨x, y, hadj, rfl, rfl⟩
exact ⟨y, x, hadj.symm, rfl, rfl⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact P.G.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:83
noncomputable def jbc_Pce : PlanarZ2Subgraph where
V := Fin 4
finV := inferInstance
decV := inferInstance
G := jbc_cyc4
emb := ⟨jbc_csq, jbc_csq_inj⟩
isSub := jbc_csq_isSub
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanBridgeCycle.lean:167
DefinitionVeblen step property for even-degree subgraphs#✓fully proved
Every nonempty subgraph K of P with even-degree image contains an even-degree subgraph
with fewer edges and face count one less.
def jvp_VeblenStep (P : PlanarZ2Subgraph) : Prop :=
∀ (K : SimpleGraph P.V), K ≤ P.G → jce_ClosedContour (jei_pushGraph P K).edgeSet → K ≠ ⊥ →
∃ K' : SimpleGraph P.V, K' ≤ K ∧ jce_ClosedContour (jei_pushGraph P K').edgeSet ∧
K'.edgeSet.ncard < K.edgeSet.ncard ∧ faceCount K' + 1 = faceCount K
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jce_ClosedContour (E : Set (Sym2 (Site 2))) : Prop :=
∀ v : Site 2, Even (jce_degree E v)
MathlibExt/Combinatorics/SimpleGraph/Lattice/EvenContourColoring.lean:68
noncomputable def jei_pushGraph (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) :
SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, K.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := ⟨by rintro a b ⟨x, y, hadj, rfl, rfl⟩; exact ⟨y, x, hadj.symm, rfl, rfl⟩⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact K.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEulerInduction.lean:109
noncomputable def faceCount (G : SimpleGraph V) : ℕ := nullity G + 1
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:273
DefinitionRegion step property for even-degree subgraphs#✓fully proved
Whenever K' ≤ K are even-degree subgraphs of P with fewer edges and face count one less,
the face-region graph of K has one more component than that of K'.
def jvp_RegionStep (P : PlanarZ2Subgraph) : Prop :=
∀ (K K' : SimpleGraph P.V), K ≤ P.G → K' ≤ K →
jce_ClosedContour (jei_pushGraph P K).edgeSet →
jce_ClosedContour (jei_pushGraph P K').edgeSet →
K'.edgeSet.ncard < K.edgeSet.ncard → faceCount K' + 1 = faceCount K →
Nat.card (whb_faceRegion (jei_pushGraph P K)).ConnectedComponent
= Nat.card (whb_faceRegion (jei_pushGraph P K')).ConnectedComponent + 1
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jce_ClosedContour (E : Set (Sym2 (Site 2))) : Prop :=
∀ v : Site 2, Even (jce_degree E v)
MathlibExt/Combinatorics/SimpleGraph/Lattice/EvenContourColoring.lean:68
noncomputable def jei_pushGraph (P : PlanarZ2Subgraph) (K : SimpleGraph P.V) :
SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, K.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := ⟨by rintro a b ⟨x, y, hadj, rfl, rfl⟩; exact ⟨y, x, hadj.symm, rfl, rfl⟩⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact K.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEulerInduction.lean:109
noncomputable def faceCount (G : SimpleGraph V) : ℕ := nullity G + 1
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:273
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
DefinitionNine sites of a 3 by 3 grid#✓fully proved
The nine sites of [0, 2]², indexed row by row.
def jkd_gr9emb (i : Fin 9) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![2, 0]
| 3 => ![0, 1] | 4 => ![1, 1] | 5 => ![2, 1]
| 6 => ![0, 2] | 7 => ![1, 2] | 8 => ![2, 2]
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
DefinitionAdjacency relation of the 3 by 3 grid#✓fully proved
Adjacency of the 3 × 3 grid on Fin 9, as a Boolean relation.
def jkd_gr9rel (i j : Fin 9) : Bool :=
let ci := (i : ℕ) % 3; let ri := (i : ℕ) / 3
let cj := (j : ℕ) % 3; let rj := (j : ℕ) / 3
(ci == cj && (ri == rj + 1 || rj == ri + 1)) || (ri == rj && (ci == cj + 1 || cj == ci + 1))
Used by 2
DefinitionThe 3 by 3 grid graph#✓fully proved
The 3 × 3 grid graph on Fin 9.
def jkd_gr9G : SimpleGraph (Fin 9) where
Adj i j := jkd_gr9rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
def jkd_gr9rel (i j : Fin 9) : Bool :=
let ci := (i : ℕ) % 3; let ri := (i : ℕ) / 3
let cj := (j : ℕ) % 3; let rj := (j : ℕ) / 3
(ci == cj && (ri == rj + 1 || rj == ri + 1)) || (ri == rj && (ci == cj + 1 || cj == ci + 1))
MathlibExt/Combinatorics/SimpleGraph/Lattice/KeepResidueExamples.lean:119
Uses 1 · Used by 1
Definition3 by 3 grid as a planar lattice subgraph#✓fully proved
The 3 × 3 grid as a PlanarZ2Subgraph.
noncomputable def jkd_ringP : PlanarZ2Subgraph where
V := Fin 9
finV := inferInstance
decV := inferInstance
G := jkd_gr9G
emb := ⟨jkd_gr9emb, jkd_gr9emb_inj⟩
isSub := jkd_gr9_isSub
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jkd_gr9G : SimpleGraph (Fin 9) where
Adj i j := jkd_gr9rel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/KeepResidueExamples.lean:125
def jkd_gr9emb (i : Fin 9) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![2, 0]
| 3 => ![0, 1] | 4 => ![1, 1] | 5 => ![2, 1]
| 6 => ![0, 2] | 7 => ![1, 2] | 8 => ![2, 2]
MathlibExt/Combinatorics/SimpleGraph/Lattice/KeepResidueExamples.lean:110
theorem jkd_gr9emb_inj : Function.Injective jkd_gr9emb
MathlibExt/Combinatorics/SimpleGraph/Lattice/KeepResidueExamples.lean:116
theorem jkd_gr9_isSub : ∀ ⦃i j : Fin 9⦄, jkd_gr9G.Adj i j →
(hypercubicLattice 2).Adj (jkd_gr9emb i) (jkd_gr9emb j)
MathlibExt/Combinatorics/SimpleGraph/Lattice/KeepResidueExamples.lean:132
DefinitionGrid vertex \((0, 0)\)#✓fully proved
The vertex (0, 0) of the grid.
def jkd_r0 : Fin 9 := 0
DefinitionGrid vertex \((1, 0)\)#✓fully proved
The vertex (1, 0) of the grid.
def jkd_r1 : Fin 9 := 1
TheoremAdding an edge between two components merges them#✓fully proved
Adding an edge between two components merges them. This assumes only finitely many
components; see also StatMech.Lattice.card_components_sup_edge_of_not_reachable for finite
vertex types.
theorem jsf_card_components_sup_edge_merge {V : Type*}
(G : SimpleGraph V) [Finite G.ConnectedComponent] {a b : V} (hab : ¬ G.Reachable a b) :
Nat.card (G ⊔ edge a b).ConnectedComponent + 1 = Nat.card G.ConnectedComponent
Uses 1 · Used by 1
DefinitionCut set of a face coloring#✓fully proved
The primal edges sharedPrimalEdge a b between adjacent faces a, b on which T takes
different values.
def jed_cutSet (T : Site 2 → Prop) : Set (Sym2 (Site 2)) :=
{e | ∃ a b : Site 2, (hypercubicLattice 2).Adj a b ∧ e = sharedPrimalEdge a b ∧ (T a ↔ ¬ T b)}
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
noncomputable def sharedPrimalEdge (f g : Site 2) : Sym2 (Site 2) := by
classical
exact if f 0 = g 0 then
s(![f 0, max (f 1) (g 1)], ![f 0 + 1, max (f 1) (g 1)])
else
s(![max (f 0) (g 0), f 1], ![max (f 0) (g 0), f 1 + 1])
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEnclosure.lean:223
Uses 3 · Used by 1
DefinitionLattice graph spanned by an edge set#✓fully proved
The graph on ℤ² whose edges are the lattice edges in E.
def jed_primalGraph (E : Set (Sym2 (Site 2))) : SimpleGraph (Site 2) where
Adj u w := (hypercubicLattice 2).Adj u w ∧ s(u, w) ∈ E
symm := ⟨by rintro u w ⟨h1, h2⟩; exact ⟨h1.symm, by rwa [Sym2.eq_swap]⟩⟩
loopless := ⟨fun u h => (hypercubicLattice 2).irrefl h.1⟩
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
Uses 2 · Used by 2
TheoremBounded faces of a finite lattice graph are counted by its cycle rank#✓fully proved
For a
PlanarZ2Subgraph P, the finite components of the face-region graph whb_faceRegion of its
image (faces of ℤ², two adjacent faces joined unless the primal edge between them lies in P)
are equinumerous with Fin (nullity P.G), so the number of bounded faces is |E| - |V| + c.
This is a count: it does not identify each bounded face with the interior of a particular cycle
of P. References: H. Whitney, Planar graphs (1933); C. Thomassen, The Jordan–Schönflies
theorem and the classification of surfaces (1992).
theorem jed_faithfulDiscreteJordan (P : PlanarZ2Subgraph) : whc_FaithfulDiscreteJordan P
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def whc_FaithfulDiscreteJordan (P : PlanarZ2Subgraph) : Prop :=
Nonempty ({c : (whb_faceRegion (imageGraph P)).ConnectedComponent // c.supp.Finite} ≃
Fin (nullity P.G))
MathlibExt/Combinatorics/SimpleGraph/Lattice/CutColoring.lean:352
Uses 57 · Used by 5
DefinitionTwelve boundary edges of a 3 by 3 rectangle#✓fully proved
The twelve lattice edges of the boundary of the rectangle [-1, 2] × [-2, 1].
noncomputable def jed_boxEdges : Finset (Sym2 (Site 2)) :=
{ s(![(-1:ℤ), -2], ![0, -2]), s(![(0:ℤ), -2], ![1, -2]), s(![(1:ℤ), -2], ![2, -2]),
s(![(-1:ℤ), 1], ![0, 1]), s(![(0:ℤ), 1], ![1, 1]), s(![(1:ℤ), 1], ![2, 1]),
s(![(-1:ℤ), -2], ![-1, -1]), s(![(-1:ℤ), -1], ![-1, 0]), s(![(-1:ℤ), 0], ![-1, 1]),
s(![(2:ℤ), -2], ![2, -1]), s(![(2:ℤ), -1], ![2, 0]), s(![(2:ℤ), 0], ![2, 1]) }
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
DefinitionBoundary of a 3 by 3 rectangle as a graph#✓fully proved
The boundary of the rectangle [-1, 2] × [-2, 1] as a graph.
noncomputable def jed_boxH : SimpleGraph (Site 2) :=
jed_primalGraph (jed_boxEdges : Set (Sym2 (Site 2)))
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def jed_primalGraph (E : Set (Sym2 (Site 2))) : SimpleGraph (Site 2) where
Adj u w := (hypercubicLattice 2).Adj u w ∧ s(u, w) ∈ E
symm := ⟨by rintro u w ⟨h1, h2⟩; exact ⟨h1.symm, by rwa [Sym2.eq_swap]⟩⟩
loopless := ⟨fun u h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEnclosureDuality.lean:121
noncomputable def jed_boxEdges : Finset (Sym2 (Site 2)) :=
{ s(![(-1:ℤ), -2], ![0, -2]), s(![(0:ℤ), -2], ![1, -2]), s(![(1:ℤ), -2], ![2, -2]),
s(![(-1:ℤ), 1], ![0, 1]), s(![(0:ℤ), 1], ![1, 1]), s(![(1:ℤ), 1], ![2, 1]),
s(![(-1:ℤ), -2], ![-1, -1]), s(![(-1:ℤ), -1], ![-1, 0]), s(![(-1:ℤ), 0], ![-1, 1]),
s(![(2:ℤ), -2], ![2, -1]), s(![(2:ℤ), -1], ![2, 0]), s(![(2:ℤ), 0], ![2, 1]) }
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEnclosureDuality.lean:305
AbbreviationBounded regions of a planar lattice subgraph#✓fully proved
The bounded (finite) connected components of the face-region graph of P.
abbrev jcb_BoundedRegion (P : PlanarZ2Subgraph) : Type :=
{c : (whb_faceRegion (imageGraph P)).ConnectedComponent // c.supp.Finite}
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
noncomputable def whb_faceRegion (G : SimpleGraph (Site 2)) : SimpleGraph (Site 2) where
Adj f g := (hypercubicLattice 2).Adj f g ∧ sharedPrimalEdge f g ∉ G.edgeSet
symm := by
refine ⟨?_⟩
intro f g ⟨hadj, hs⟩
exact ⟨hadj.symm, by rwa [sharedPrimalEdge_comm_of_adj hadj] at hs⟩
loopless := ⟨fun f h => (hypercubicLattice 2).irrefl h.1⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/WhitneyBridge.lean:95
noncomputable def imageGraph (P : PlanarZ2Subgraph) : SimpleGraph (Site 2) where
Adj a b := ∃ x y : P.V, P.G.Adj x y ∧ P.emb x = a ∧ P.emb y = b
symm := by
refine ⟨?_⟩
rintro a b ⟨x, y, hadj, rfl, rfl⟩
exact ⟨y, x, hadj.symm, rfl, rfl⟩
loopless := ⟨by
rintro a ⟨x, y, hadj, hx, hy⟩
have : x = y := P.emb.injective (hx.trans hy.symm)
exact P.G.irrefl (this ▸ hadj)⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:83
Uses 4 · Used by 8
DefinitionBounded regions indexed by the cycle rank#✓fully proved
The bijection between bounded regions of P and Fin (nullity P.G) given by the discrete
Jordan–Euler theorem.
noncomputable def jcb_boundedRegionEquiv (P : PlanarZ2Subgraph) :
jcb_BoundedRegion P ≃ Fin (nullity P.G) :=
(jed_faithfulDiscreteJordan P).some
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
abbrev jcb_BoundedRegion (P : PlanarZ2Subgraph) : Type :=
{c : (whb_faceRegion (imageGraph P)).ConnectedComponent // c.supp.Finite}
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:53
noncomputable def nullity (G : SimpleGraph V) : ℕ :=
(G.edgeSet.ncard + Nat.card G.ConnectedComponent) - Nat.card V
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:267
theorem jed_faithfulDiscreteJordan (P : PlanarZ2Subgraph) : whc_FaithfulDiscreteJordan P
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanEnclosureDuality.lean:294
Uses 7 · Used by 3
DefinitionCycle rank one gives a unique bounded region#✓fully proved
A PlanarZ2Subgraph of cycle rank one has exactly one bounded region.
@[reducible] noncomputable def jcb_uniqueBoundedRegion_of_nullity_one (P : PlanarZ2Subgraph)
(h1 : nullity P.G = 1) : Unique (jcb_BoundedRegion P) := by
have hcard : Nat.card (jcb_BoundedRegion P) = 1 := by
rw [jcb_boundedRegion_card_eq_nullity, h1]
obtain ⟨hsub, hne⟩ := Nat.card_eq_one_iff_unique.mp hcard
exact ⟨⟨hne.some⟩, fun a => hsub.elim a hne.some⟩
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
noncomputable def nullity (G : SimpleGraph V) : ℕ :=
(G.edgeSet.ncard + Nat.card G.ConnectedComponent) - Nat.card V
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:267
abbrev jcb_BoundedRegion (P : PlanarZ2Subgraph) : Type :=
{c : (whb_faceRegion (imageGraph P)).ConnectedComponent // c.supp.Finite}
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:53
DefinitionJordan curve theorem#✓fully proved
Jordan curve theorem for lattice cycles: a connected PlanarZ2Subgraph with as many
edges as vertices has exactly one bounded region. Reference: C. Jordan, Cours d'analyse
(1887); for the discrete form, C. Thomassen, The Jordan–Schönflies theorem and the
classification of surfaces (1992).
@[reducible] noncomputable def jcb_uniqueBoundedRegion_of_connected_cycle (P : PlanarZ2Subgraph)
(hconn : P.G.Connected) (hcard : P.G.edgeSet.ncard = Nat.card P.V) :
Unique (jcb_BoundedRegion P) :=
jcb_uniqueBoundedRegion_of_nullity_one P
(jcb_nullity_eq_one_of_connected_card_eq P.G hconn hcard)
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
abbrev jcb_BoundedRegion (P : PlanarZ2Subgraph) : Type :=
{c : (whb_faceRegion (imageGraph P)).ConnectedComponent // c.supp.Finite}
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:53
@[reducible] noncomputable def jcb_uniqueBoundedRegion_of_nullity_one (P : PlanarZ2Subgraph)
(h1 : nullity P.G = 1) : Unique (jcb_BoundedRegion P) := by
have hcard : Nat.card (jcb_BoundedRegion P) = 1 := by
rw [jcb_boundedRegion_card_eq_nullity, h1]
obtain ⟨hsub, hne⟩ := Nat.card_eq_one_iff_unique.mp hcard
exact ⟨⟨hne.some⟩, fun a => hsub.elim a hne.some⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:88
theorem jcb_nullity_eq_one_of_connected_card_eq {V : Type} [Finite V] (G : SimpleGraph V)
(hconn : G.Connected) (hcard : G.edgeSet.ncard = Nat.card V) :
nullity G = 1
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:67
DefinitionLattice points around the L-shaped tromino#✓fully proved
The eight lattice points around the L-shaped tromino, in cyclic order.
def jcb_Lemb (i : Fin 8) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![2, 0] | 3 => ![2, 1]
| 4 => ![1, 1] | 5 => ![1, 2] | 6 => ![0, 2] | 7 => ![0, 1]
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1 · Used by 1
DefinitionAdjacency relation of the 8-cycle#✓fully proved
Adjacency of the 8-cycle on Fin 8, as a Boolean relation.
Used by 2
DefinitionThe 8-cycle graph#✓fully proved
The 8-cycle on Fin 8.
def jcb_Lcyc : SimpleGraph (Fin 8) where
Adj i j := jcb_LcycRel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
def jcb_LcycRel (i j : Fin 8) : Bool := (i + 1 == j) || (j + 1 == i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:149
Uses 1 · Used by 1
Definition8-cycle around the L-tromino as a planar lattice subgraph#✓fully proved
The 8-cycle around the L-shaped tromino as a PlanarZ2Subgraph.
noncomputable def jcb_LPce : PlanarZ2Subgraph where
V := Fin 8
finV := inferInstance
decV := inferInstance
G := jcb_Lcyc
emb := ⟨jcb_Lemb, jcb_Lemb_inj⟩
isSub := jcb_Lemb_isSub
structure PlanarZ2Subgraph where
/-- The vertex type. -/
V : Type
/-- The vertex type is finite. -/
finV : Finite V
/-- Equality of vertices is decidable. -/
decV : DecidableEq V
/-- The abstract graph. -/
G : SimpleGraph V
/-- The embedding of the vertices into `ℤ²`. -/
emb : V ↪ Site 2
/-- Edges are mapped to lattice edges. -/
⋯
MathlibExt/Combinatorics/SimpleGraph/Lattice/PlanarFaceGeometric.lean:66
def jcb_Lcyc : SimpleGraph (Fin 8) where
Adj i j := jcb_LcycRel i j
symm := ⟨by intro i j h; revert h; revert i j; decide⟩
loopless := ⟨by intro i h; revert h; revert i; decide⟩
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:152
def jcb_Lemb (i : Fin 8) : Site 2 :=
match i with
| 0 => ![0, 0] | 1 => ![1, 0] | 2 => ![2, 0] | 3 => ![2, 1]
| 4 => ![1, 1] | 5 => ![1, 2] | 6 => ![0, 2] | 7 => ![0, 1]
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:141
theorem jcb_Lemb_inj : Function.Injective jcb_Lemb
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:146
theorem jcb_Lemb_isSub :
∀ ⦃i j : Fin 8⦄, jcb_Lcyc.Adj i j → (hypercubicLattice 2).Adj (jcb_Lemb i) (jcb_Lemb j)
MathlibExt/Combinatorics/SimpleGraph/Lattice/JordanClusterBridge.lean:163
DefinitionTwo diagonally touching sites#✓fully proved
The two-site set {(0, 0), (1, 1)}, which touches diagonally.
def jcb_diagK : Set (Site 2) := {![0, 0], ![1, 1]}
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
Uses 1
DefinitionFacial orbit of a boundary dart#✓fully proved
The orbit of a boundary dart of C, as a connected component of the successor graph on
boundary darts.
noncomputable def rsf_facialOrbit (C : Set (Site 2)) (e : {d : Dart // IsBoundaryDart C d}) :
(dartSuccGraph C).ConnectedComponent :=
(dartSuccGraph C).connectedComponentMk e
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
structure Dart where
/-- The site the dart starts at. -/
tail : Site 2
/-- The site the dart points to. -/
head : Site 2
/-- The tail and head are nearest neighbours. -/
adj : (hypercubicLattice 2).Adj tail head
MathlibExt/Combinatorics/SimpleGraph/Lattice/DartDef.lean:57
def IsBoundaryDart (K : Set (Site 2)) (e : Dart) : Prop :=
e.tail ∈ K ∧ e.head ∉ K
MathlibExt/Combinatorics/SimpleGraph/Lattice/DartNext.lean:98
noncomputable def dartSuccGraph (K : Set (Site 2)) :
SimpleGraph {e : Dart // IsBoundaryDart K e} where
Adj a b := a ≠ b ∧ (dartNextSub K a = b ∨ dartNextSub K b = a)
symm := ⟨by rintro a b ⟨hne, h⟩; exact ⟨hne.symm, h.symm⟩⟩
loopless := by refine ⟨?_⟩; rintro a ⟨hne, _⟩; exact hne rfl
MathlibExt/Combinatorics/SimpleGraph/Lattice/DartOrbit.lean:155
Uses 4
DefinitionBoundary darts of a component off a closed walk#✓fully proved
The set of boundary darts of a connected component of the sites off the support of Vc.
noncomputable def rsf_componentDarts {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) :
(fcb_offComplGraph Vc).ConnectedComponent → Set Dart :=
ConnectedComponent.lift
(fun v => {e : Dart | IsBoundaryDart (offSupportComponent Vc (v : Site 2)) e})
(by
intro u v p _
rw [rsf_fcb_reachable_offSupportComponent_eq Vc ⟨p⟩])
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
noncomputable def fcb_offComplGraph {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) :
SimpleGraph {z : Site 2 // z ∉ Vc.support} :=
(ffc_offSupportLattice {z | z ∈ Vc.support}).induce {z : Site 2 | z ∉ Vc.support}
MathlibExt/Combinatorics/SimpleGraph/Lattice/FaceComponentBijection.lean:46
structure Dart where
/-- The site the dart starts at. -/
tail : Site 2
/-- The site the dart points to. -/
head : Site 2
/-- The tail and head are nearest neighbours. -/
adj : (hypercubicLattice 2).Adj tail head
MathlibExt/Combinatorics/SimpleGraph/Lattice/DartDef.lean:57
def IsBoundaryDart (K : Set (Site 2)) (e : Dart) : Prop :=
e.tail ∈ K ∧ e.head ∉ K
MathlibExt/Combinatorics/SimpleGraph/Lattice/DartNext.lean:98
def offSupportComponent {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) (seed : Site 2) :
Set (Site 2) :=
{z | (offSupport Vc).Reachable seed z}
MathlibExt/Combinatorics/SimpleGraph/Lattice/InsideConnected.lean:213
Uses 9 · Used by 1
DefinitionFacial orbits cover the components of the complement#✓fully proved
The boundary dart sets of the components of the complement of Vc are exactly the members of
𝓕.
def rsf_FacialOrbitsCoverComponents {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a)
(𝓕 : Set (Set Dart)) : Prop :=
Set.range (rsf_componentDarts Vc) = 𝓕
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
structure Dart where
/-- The site the dart starts at. -/
tail : Site 2
/-- The site the dart points to. -/
head : Site 2
/-- The tail and head are nearest neighbours. -/
adj : (hypercubicLattice 2).Adj tail head
MathlibExt/Combinatorics/SimpleGraph/Lattice/DartDef.lean:57
noncomputable def rsf_componentDarts {a : Site 2} (Vc : (hypercubicLattice 2).Walk a a) :
(fcb_offComplGraph Vc).ConnectedComponent → Set Dart :=
ConnectedComponent.lift
(fun v => {e : Dart | IsBoundaryDart (offSupportComponent Vc (v : Site 2)) e})
(by
intro u v p _
rw [rsf_fcb_reachable_offSupportComponent_eq Vc ⟨p⟩])
MathlibExt/Combinatorics/SimpleGraph/Lattice/RotationSystemFaces.lean:163
DefinitionSeparating side between inside and outside sites#✓fully proved
Some set S contains inside, misses outside, and every lattice edge between sites of D
that leaves S has an endpoint in B.
def jcu_HasSeparatingSide (D B inside outside : Set (Site 2)) : Prop :=
∃ S : Set (Site 2),
(∀ z ∈ inside, z ∈ S) ∧
(∀ z ∈ outside, z ∉ S) ∧
(∀ u v : Site 2, u ∈ D → v ∈ D → (hypercubicLattice 2).Adj u v →
u ∈ S → v ∉ S → (u ∈ B ∨ v ∈ B))
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def hypercubicLattice (d : ℕ) : SimpleGraph (Site d) where
Adj := NearestNeighbour d
symm := ⟨fun _ _ h => nearestNeighbour_symm d h⟩
loopless := nearestNeighbour_irrefl d
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:76
Uses 2
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.