Vertical neighbours of different parity are separated by a horizontal step to Face-graph adjacency as absence of a walk step between cells
TheoremVertical neighbours of different parity are separated by a horizontal step#✓fully proved
If cells (a, b) and (a, b + 1) have different ray parities, a horizontal step separates
them.
theorem mid_nonempty_of_ne (d : Fin n → Fin 4) (a b : ℤ)
(h : rayParity d a b ≠ rayParity d a (b + 1)) : (midSet d a (b + 1)).Nonempty
def rayParity (d : Fin n → Fin 4) (a b : ℤ) : ZMod 2 := (upCross d a b : ZMod 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/JordanParity.lean:55
def midSet (d : Fin n → Fin 4) (a b : ℤ) : Finset (Fin n) :=
Finset.univ.filter (fun k : Fin n =>
isHorizEdge (d k) ∧ min ((pos d k).1) ((pos d (k + 1)).1) = a ∧ (pos d k).2 = b)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/RayFlipV.lean:41
Uses 5 · Used by 1
TheoremInterior of a simple closed walk has no pinch points#✓fully proved
The interior of a simple closed walk has no pinch points.
theorem pinch_free (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (_hn : 3 ≤ n) (v : ℤ × ℤ) :
¬ pinchAt (interiorCells d hclosed) v
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
def pinchAt (S : Finset (ℤ × ℤ)) (v : ℤ × ℤ) : Prop :=
(v ∈ S ∧ (v.1 - 1, v.2 - 1) ∈ S ∧ (v.1 - 1, v.2) ∉ S ∧ (v.1, v.2 - 1) ∉ S) ∨
((v.1 - 1, v.2) ∈ S ∧ (v.1, v.2 - 1) ∈ S ∧ v ∉ S ∧ (v.1 - 1, v.2 - 1) ∉ S)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellPinch.lean:40
noncomputable def interiorCells (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
Finset (ℤ × ℤ) := (interiorSet_finite d hclosed).toFinset
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:114
Uses 16 · Used by 2
TheoremPinch count of the ray-parity interior is zero#✓fully proved
The interior of a simple closed walk has pinch count 0. See also
StatMech.Onsager.WalkCellLocal.pinchCount_interiorCells_eq_zero.
theorem pinchCount_eq_zero (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n) :
pinchCount (interiorCells d hclosed) = 0
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
def pinchCount (S : Finset (ℤ × ℤ)) : ℤ := ∑ v ∈ cellVerts S, pinchW S v
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellPinch.lean:52
noncomputable def interiorCells (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
Finset (ℤ × ℤ) := (interiorSet_finite d hclosed).toFinset
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:114
Uses 8 · Used by 2
TheoremZero corner weight of the interior off the walk#✓fully proved
A lattice point off the walk has corner weight 0 for the interior.
theorem cornerWeight_zero_of_notMem_image (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(vx vy : ℤ) (hnv : ∀ k : Fin n, pos d k ≠ (vx, vy)) :
cornerWeight (cornerCount (interiorCells d hclosed) (vx, vy)) = 0
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
def cornerWeight (k : ℕ) : ℤ := (if k = 1 then 1 else 0) - (if k = 3 then 1 else 0)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellEuler.lean:74
def cornerCount (S : Finset (ℤ × ℤ)) (v : ℤ × ℤ) : ℕ :=
(S.filter (fun c => v ∈ cornersOf c)).card
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellCount.lean:46
noncomputable def interiorCells (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
Finset (ℤ × ℤ) := (interiorSet_finite d hclosed).toFinset
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:114
Uses 8 · Used by 1
TheoremCorner defect of the interior as a sum over walk vertices#✓fully proved
For a simple closed walk, the corner defect of the interior is the sum of the corner weights at the walk vertices.
theorem cornerDiff_interior_eq_walk_sum (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) :
cornerDiff (interiorCells d hclosed)
= ∑ k : Fin n, cornerWeight (cornerCount (interiorCells d hclosed) (pos d k))
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
def cornerDiff (S : Finset (ℤ × ℤ)) : ℤ :=
((cellVerts S).filter (fun v => cornerCount S v = 1)).card
- ((cellVerts S).filter (fun v => cornerCount S v = 3)).card
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellEuler.lean:51
noncomputable def interiorCells (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
Finset (ℤ × ℤ) := (interiorSet_finite d hclosed).toFinset
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:114
def cornerWeight (k : ℕ) : ℤ := (if k = 1 then 1 else 0) - (if k = 3 then 1 else 0)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellEuler.lean:74
def cornerCount (S : Finset (ℤ × ℤ)) (v : ℤ × ℤ) : ℕ :=
(S.filter (fun c => v ∈ cornersOf c)).card
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellCount.lean:46
Uses 10 · Used by 2
TheoremCorner weights at the turns of a walk without right turns#✓fully proved
The corner weight of the interior at the vertex after step i is ±1 (sign given by the
orientation) at a left turn and 0 at a straight step.
theorem cornerWeight_master (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n)
(hreflexfree : ∀ i : Fin n, d (i + 1) - d i = 0 ∨ d (i + 1) - d i = 1) (i : Fin n) :
cornerWeight (cornerCount (interiorCells d hclosed) (pos d (i + 1)))
= (if leftParity d 0 = 1 then (1 : ℤ) else -1) * (if d (i + 1) - d i = 1 then 1 else 0)
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
def cornerWeight (k : ℕ) : ℤ := (if k = 1 then 1 else 0) - (if k = 3 then 1 else 0)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellEuler.lean:74
def cornerCount (S : Finset (ℤ × ℤ)) (v : ℤ × ℤ) : ℕ :=
(S.filter (fun c => v ∈ cornersOf c)).card
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellCount.lean:46
noncomputable def interiorCells (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
Finset (ℤ × ℤ) := (interiorSet_finite d hclosed).toFinset
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:114
def leftParity (d : Fin n → Fin 4) (k : Fin n) : ZMod 2 :=
rayParity d (leftCell (d k) (pos d k)).1 (leftCell (d k) (pos d k)).2
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/Orientation.lean:212
Uses 14 · Used by 1
TheoremCorner defect of the interior is the number of left turns up to sign#✓fully proved
The corner defect of the interior equals ±cc d, the sign given by the orientation of the
walk.
theorem cornerDiff_eq_weight_mul_cc (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n)
(hreflexfree : ∀ i : Fin n, d (i + 1) - d i = 0 ∨ d (i + 1) - d i = 1) :
cornerDiff (interiorCells d hclosed)
= (if leftParity d 0 = 1 then (1 : ℤ) else -1) * (cc d : ℤ)
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
def cornerDiff (S : Finset (ℤ × ℤ)) : ℤ :=
((cellVerts S).filter (fun v => cornerCount S v = 1)).card
- ((cellVerts S).filter (fun v => cornerCount S v = 3)).card
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellEuler.lean:51
noncomputable def interiorCells (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
Finset (ℤ × ℤ) := (interiorSet_finite d hclosed).toFinset
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:114
def leftParity (d : Fin n → Fin 4) (k : Fin n) : ZMod 2 :=
rayParity d (leftCell (d k) (pos d k)).1 (leftCell (d k) (pos d k)).2
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/Orientation.lean:212
def cc {n : ℕ} [NeZero n] (d : Fin n → Fin 4) : ℕ :=
(Finset.univ.filter (fun i : Fin n => d (i + 1) - d i = 1)).card
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:62
Uses 10 · Used by 2
TheoremFour left turns from a pinch-free interior of Euler characteristic 1#✓fully proved
A simple closed walk without right turns whose interior is pinch-free with Euler characteristic
1 has four left turns.
theorem cc_eq_four (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n)
(hreflexfree : ∀ i : Fin n, d (i + 1) - d i = 0 ∨ d (i + 1) - d i = 1)
(hpinch : pinchCount (interiorCells d hclosed) = 0)
(hchi : eulerChar (interiorCells d hclosed) = 1) :
cc d = 4
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
def pinchCount (S : Finset (ℤ × ℤ)) : ℤ := ∑ v ∈ cellVerts S, pinchW S v
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellPinch.lean:52
noncomputable def interiorCells (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
Finset (ℤ × ℤ) := (interiorSet_finite d hclosed).toFinset
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:114
def eulerChar (S : Finset (ℤ × ℤ)) : ℤ :=
((cellVerts S).card : ℤ) - (cellEdges S).card + S.card
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellEuler.lean:176
def cc {n : ℕ} [NeZero n] (d : Fin n → Fin 4) : ℕ :=
(Finset.univ.filter (fun i : Fin n => d (i + 1) - d i = 1)).card
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:62
DefinitionVertex of a walk as a lattice site#✓fully proved
The i-th vertex of the walk as a site of ℤ².
def posSite {m : ℕ} (d : Fin (m + 3) → Fin 4) (i : Fin (m + 3)) : Site 2 :=
![(pos d i).1, (pos d i).2]
abbrev Site (d : ℕ) : Type := Fin d → ℤ
MathlibExt/Combinatorics/SimpleGraph/Lattice/HypercubicLattice.lean:55
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
Uses 2 · Used by 13
TheoremVertices of a simple walk are distinct sites#✓fully proved
The vertices of a simple walk are distinct sites.
theorem posSite_injective {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hsimple : Function.Injective (pos d)) : Function.Injective (posSite d)
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
def posSite {m : ℕ} (d : Fin (m + 3) → Fin 4) (i : Fin (m + 3)) : Site 2 :=
![(pos d i).1, (pos d i).2]
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkPlanarSubgraph.lean:52
TheoremEach lattice step has \(\ell^1\)-length one#✓fully proved
Each step has ℓ¹-length 1.
theorem stepOf_natAbs_sum (w : Fin 4) :
(stepOf w).1.natAbs + (stepOf w).2.natAbs = 1
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
Uses 1 · Used by 1
TheoremConsecutive walk vertices are adjacent in the square lattice#✓fully proved
Consecutive vertices of the walk are adjacent in the square lattice.
theorem walk_isSub {m : ℕ} (d : Fin (m + 3) → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
⦃i j : Fin (m + 3)⦄ (hadj : (cycleGraph (m + 3)).Adj i j) :
(hypercubicLattice 2).Adj (posSite d i) (posSite d j)
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
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 posSite {m : ℕ} (d : Fin (m + 3) → Fin 4) (i : Fin (m + 3)) : Site 2 :=
![(pos d i).1, (pos d i).2]
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkPlanarSubgraph.lean:52
Uses 7 · Used by 1
DefinitionSimple closed walk as an embedded cycle graph#✓fully proved
A simple closed walk as a planar subgraph of ℤ²: the cycle graph cycleGraph (m + 3) embedded
by its vertex positions.
noncomputable def walkSubgraph {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0) (hsimple : Function.Injective (pos d)) :
PlanarZ2Subgraph where
V := Fin (m + 3)
finV := inferInstance
decV := inferInstance
G := cycleGraph (m + 3)
emb := ⟨posSite d, posSite_injective d hsimple⟩
isSub := walk_isSub d hclosed
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
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 posSite {m : ℕ} (d : Fin (m + 3) → Fin 4) (i : Fin (m + 3)) : Site 2 :=
![(pos d i).1, (pos d i).2]
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkPlanarSubgraph.lean:52
theorem posSite_injective {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hsimple : Function.Injective (pos d)) : Function.Injective (posSite d)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkPlanarSubgraph.lean:62
theorem walk_isSub {m : ℕ} (d : Fin (m + 3) → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
⦃i j : Fin (m + 3)⦄ (hadj : (cycleGraph (m + 3)).Adj i j) :
(hypercubicLattice 2).Adj (posSite d i) (posSite d j)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkPlanarSubgraph.lean:77
Uses 8 · Used by 5
TheoremA cycle graph has one connected component#✓fully proved
A cycle graph has one connected component. A specialization of
SimpleGraph.Preconnected.subsingleton_connectedComponent.
theorem cycleGraph_card_components_one (m : ℕ) :
Nat.card (cycleGraph (m + 3)).ConnectedComponent = 1
Used by 1
TheoremNumber of edges of a cycle graph#✓fully proved
The cycle graph on m + 3 vertices has m + 3 edges.
theorem cycleGraph_card_edges (m : ℕ) :
(cycleGraph (m + 3)).edgeSet.ncard = m + 3
Used by 1
TheoremCycle graph has cycle rank one#✓fully proved
The cycle graph has nullity (cycle rank) 1.
theorem cycle_nullity_one (m : ℕ) : nullity (cycleGraph (m + 3)) = 1
noncomputable def nullity (G : SimpleGraph V) : ℕ :=
(G.edgeSet.ncard + Nat.card G.ConnectedComponent) - Nat.card V
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:267
Uses 3 · Used by 1
TheoremSubgraph of a simple closed lattice walk has cycle rank one#✓fully proved
The planar subgraph of a simple closed walk has nullity 1.
theorem walkSubgraph_nullity_one {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0) (hsimple : Function.Injective (pos d)) :
nullity (walkSubgraph d hclosed hsimple).G = 1
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
noncomputable def nullity (G : SimpleGraph V) : ℕ :=
(G.edgeSet.ncard + Nat.card G.ConnectedComponent) - Nat.card V
MathlibExt/Combinatorics/SimpleGraph/Lattice/CycleRank.lean:267
noncomputable def walkSubgraph {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0) (hsimple : Function.Injective (pos d)) :
PlanarZ2Subgraph where
V := Fin (m + 3)
finV := inferInstance
decV := inferInstance
G := cycleGraph (m + 3)
emb := ⟨posSite d, posSite_injective d hsimple⟩
isSub := walk_isSub d hclosed
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkPlanarSubgraph.lean:102
TheoremLattice Jordan curve theorem for simple closed walks#✓fully proved
Lattice Jordan curve theorem for a simple closed walk: its complement in the face graph of ℤ²
has exactly one bounded connected component.
theorem walk_one_bounded_region {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0) (hsimple : Function.Injective (pos d)) :
Nat.card {c : (whb_faceRegion (imageGraph (walkSubgraph d hclosed hsimple))).ConnectedComponent
// c.supp.Finite} = 1
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
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 walkSubgraph {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0) (hsimple : Function.Injective (pos d)) :
PlanarZ2Subgraph where
V := Fin (m + 3)
finV := inferInstance
decV := inferInstance
G := cycleGraph (m + 3)
emb := ⟨posSite d, posSite_injective d hsimple⟩
isSub := walk_isSub d hclosed
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkPlanarSubgraph.lean:102
Uses 11
DefinitionRay-parity interior equals the bounded face components#✓fully proved
The ray-parity interior of the walk coincides with the union of bounded face components.
def BridgeParityMembership {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0) (hsimple : Function.Injective (pos d)) : Prop :=
∀ a b : ℤ, rayParity d a b = 1 ↔
((whb_faceRegion (imageGraph (walkSubgraph d hclosed hsimple))).connectedComponentMk
![a, b]).supp.Finite
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
def rayParity (d : Fin n → Fin 4) (a b : ℤ) : ZMod 2 := (upCross d a b : ZMod 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/JordanParity.lean:55
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 walkSubgraph {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0) (hsimple : Function.Injective (pos d)) :
PlanarZ2Subgraph where
V := Fin (m + 3)
finV := inferInstance
decV := inferInstance
G := cycleGraph (m + 3)
emb := ⟨posSite d, posSite_injective d hsimple⟩
isSub := walk_isSub d hclosed
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkPlanarSubgraph.lean:102
Uses 7
DefinitionFace-graph adjacency as absence of a walk step between cells#✓fully proved
Adjacency in the face graph of the walk is the absence of a walk step on the common side of two cells.
def BridgeAdjacencyClimb {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0) (hsimple : Function.Injective (pos d)) : Prop :=
∀ a b : ℤ,
((whb_faceRegion (imageGraph (walkSubgraph d hclosed hsimple))).Adj ![a, b] ![a + 1, b] ↔
(∀ k : Fin (m + 3), isVertEdge (d k) → (pos d k).1 = a + 1 →
¬ (min ((pos d k).2) ((pos d (k + 1)).2) ≤ b ∧
b < max ((pos d k).2) ((pos d (k + 1)).2)))) ∧
((whb_faceRegion (imageGraph (walkSubgraph d hclosed hsimple))).Adj ![a, b] ![a, b + 1] ↔
(∀ k : Fin (m + 3), isHorizEdge (d k) →
min ((pos d k).1) ((pos d (k + 1)).1) = a → (pos d k).2 ≠ b + 1))
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
def pos {n : ℕ} [NeZero n] (d : Fin n → Fin 4) (k : Fin n) : ℤ × ℤ :=
∑ i ∈ Finset.filter (· < k) Finset.univ, stepOf (d i)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:57
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 walkSubgraph {m : ℕ} (d : Fin (m + 3) → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0) (hsimple : Function.Injective (pos d)) :
PlanarZ2Subgraph where
V := Fin (m + 3)
finV := inferInstance
decV := inferInstance
G := cycleGraph (m + 3)
emb := ⟨posSite d, posSite_injective d hsimple⟩
isSub := walk_isSub d hclosed
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkPlanarSubgraph.lean:102
def isVertEdge (w : Fin 4) : Prop := w = 1 ∨ w = 3
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkCrossing.lean:52
def isHorizEdge (w : Fin 4) : Prop := w = 0 ∨ w = 2
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkCrossing.lean:55
Uses 8
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.