Interior cells by the even-odd rule to Horizontal neighbours of different parity are separated by a vertical step
DefinitionInterior cells by the even-odd rule#✓fully proved
The cells inside the walk by the even-odd rule: those with ray parity 1.
def interiorSet (d : Fin n → Fin 4) : Set (ℤ × ℤ) := {c | rayParity d c.1 c.2 = 1}
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
Uses 1 · Used by 6
DefinitionMinimal height of a walk#✓fully proved
The minimal height of a vertex of the walk.
noncomputable def yInf (d : Fin n → Fin 4) : ℤ :=
Finset.univ.inf' Finset.univ_nonempty (fun k => (pos d k).2)
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 1 · Used by 2
DefinitionMaximal height of a walk#✓fully proved
The maximal height of a vertex of the walk.
noncomputable def ySup (d : Fin n → Fin 4) : ℤ :=
Finset.univ.sup' Finset.univ_nonempty (fun k => (pos d k).2)
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 1 · Used by 1
TheoremAn inside cell lies below a horizontal step#✓fully proved
An inside cell lies directly below some horizontal step of the walk.
theorem exists_edge_of_rayParity (d : Fin n → Fin 4) (a b : ℤ) (h : rayParity d a b = 1) :
∃ k : Fin n, isHorizEdge (d k) ∧ min ((pos d k).1) ((pos d (k + 1)).1) = a ∧
b < (pos d k).2
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 isHorizEdge (w : Fin 4) : Prop := w = 0 ∨ w = 2
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkCrossing.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 4 · Used by 1
TheoremCells below a walk are outside#✓fully proved
Cells below the walk are outside.
theorem rayParity_zero_of_lt_yInf (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(a b : ℤ) (hb : b < yInf d) : rayParity d a b = 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
noncomputable def yInf (d : Fin n → Fin 4) : ℤ :=
Finset.univ.inf' Finset.univ_nonempty (fun k => (pos d k).2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:47
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
Uses 8 · Used by 1
TheoremFiniteness of the interior of a closed walk#✓fully proved
A closed walk has finitely many inside cells.
theorem interiorSet_finite (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
(interiorSet d).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 interiorSet (d : Fin n → Fin 4) : Set (ℤ × ℤ) := {c | rayParity d c.1 c.2 = 1}
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:44
DefinitionFinite set of interior cells of a closed walk#✓fully proved
The finite set of cells inside a closed walk (ray parity 1). See also
StatMech.Onsager.WalkCellRegion.interiorCells, the bounded face of the walk; the two agree for
simple walks without right turns (StatMech.Onsager.UmlaufsatzFinal.interiorCells_bridge).
noncomputable def interiorCells (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
Finset (ℤ × ℤ) := (interiorSet_finite d hclosed).toFinset
def stepOf : Fin 4 → ℤ × ℤ
| 0 => (1, 0)
| 1 => (0, 1)
| 2 => (-1, 0)
| 3 => (0, -1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/DirectionWalk.lean:49
theorem interiorSet_finite (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) :
(interiorSet d).Finite
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/InteriorCells.lean:93
Uses 3 · Used by 20
TheoremCorner count of the interior counts inside cells around a point#✓fully proved
The corner count of the interior at (vx, vy) counts the inside cells among the four cells
around that point.
theorem cornerCount_interior_eq (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(vx vy : ℤ) :
(cornerCount (interiorCells d hclosed) (vx, vy) : ℤ)
= (if rayParity d vx vy = 1 then (1 : ℤ) else 0)
+ (if rayParity d (vx - 1) vy = 1 then 1 else 0)
+ (if rayParity d vx (vy - 1) = 1 then 1 else 0)
+ (if rayParity d (vx - 1) (vy - 1) = 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 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 rayParity (d : Fin n → Fin 4) (a b : ℤ) : ZMod 2 := (upCross d a b : ZMod 2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/JordanParity.lean:55
Uses 8 · Used by 8
TheoremRay parity is constant around a non-vertex point#✓fully proved
At a lattice point that is not a vertex of the walk, the four cells around it have the same ray parity.
theorem rayParity_const_of_not_vertex (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(vx vy : ℤ) (hv : ∀ k : Fin n, pos d k ≠ (vx, vy)) :
rayParity d (vx - 1) vy = rayParity d vx vy
∧ rayParity d vx (vy - 1) = rayParity d vx vy
∧ rayParity d (vx - 1) (vy - 1) = rayParity d vx vy
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
Uses 9 · Used by 2
TheoremCorner weight at a left turn into the east direction#✓fully proved
At a left turn made of a south step followed by an east step, the corner weight of the interior
is 1 if the cell to the left of the walk is inside and -1 otherwise.
theorem cornerWeight_leftTurn_E (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n) (i : Fin n)
(hei : d i = 3) (he : d (i + 1) = 0) :
cornerWeight (cornerCount (interiorCells d hclosed) (pos d (i + 1)))
= if rayParity d (leftCell (d (i + 1)) (pos d (i + 1))).1
(leftCell (d (i + 1)) (pos d (i + 1))).2 = 1 then (1 : ℤ) else -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
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 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 leftCell : Fin 4 → ℤ × ℤ → ℤ × ℤ
| 0, p => p
| 1, p => (p.1 - 1, p.2)
| 2, p => (p.1 - 1, p.2 - 1)
| 3, p => (p.1, p.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/Orientation.lean:46
Uses 20 · Used by 2
TheoremCorner weight at a left turn into the north direction#✓fully proved
At a left turn made of an east step followed by a north step, the corner weight of the interior
is 1 if the cell to the left of the walk is inside and -1 otherwise.
theorem cornerWeight_leftTurn_N (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n) (i : Fin n)
(hei : d i = 0) (he : d (i + 1) = 1) :
cornerWeight (cornerCount (interiorCells d hclosed) (pos d (i + 1)))
= if rayParity d (leftCell (d (i + 1)) (pos d (i + 1))).1
(leftCell (d (i + 1)) (pos d (i + 1))).2 = 1 then (1 : ℤ) else -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
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 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 leftCell : Fin 4 → ℤ × ℤ → ℤ × ℤ
| 0, p => p
| 1, p => (p.1 - 1, p.2)
| 2, p => (p.1 - 1, p.2 - 1)
| 3, p => (p.1, p.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/Orientation.lean:46
Uses 20 · Used by 2
TheoremCorner weight at a left turn into the south direction#✓fully proved
At a left turn made of a west step followed by a south step, the corner weight of the interior
is 1 if the cell to the left of the walk is inside and -1 otherwise.
theorem cornerWeight_leftTurn_S (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n) (i : Fin n)
(hei : d i = 2) (he : d (i + 1) = 3) :
cornerWeight (cornerCount (interiorCells d hclosed) (pos d (i + 1)))
= if rayParity d (leftCell (d (i + 1)) (pos d (i + 1))).1
(leftCell (d (i + 1)) (pos d (i + 1))).2 = 1 then (1 : ℤ) else -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
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 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 leftCell : Fin 4 → ℤ × ℤ → ℤ × ℤ
| 0, p => p
| 1, p => (p.1 - 1, p.2)
| 2, p => (p.1 - 1, p.2 - 1)
| 3, p => (p.1, p.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/Orientation.lean:46
Uses 20 · Used by 2
TheoremCorner weight at a left turn into the west direction#✓fully proved
At a left turn made of a north step followed by a west step, the corner weight of the interior
is 1 if the cell to the left of the walk is inside and -1 otherwise.
theorem cornerWeight_leftTurn_W (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n) (i : Fin n)
(hei : d i = 1) (he : d (i + 1) = 2) :
cornerWeight (cornerCount (interiorCells d hclosed) (pos d (i + 1)))
= if rayParity d (leftCell (d (i + 1)) (pos d (i + 1))).1
(leftCell (d (i + 1)) (pos d (i + 1))).2 = 1 then (1 : ℤ) else -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
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 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 leftCell : Fin 4 → ℤ × ℤ → ℤ × ℤ
| 0, p => p
| 1, p => (p.1 - 1, p.2)
| 2, p => (p.1 - 1, p.2 - 1)
| 3, p => (p.1, p.2 - 1)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/Orientation.lean:46
Uses 18 · Used by 2
TheoremA horizontal direction is not vertical#✓fully proved
A horizontal direction is not vertical.
theorem not_isVert_of_isHoriz {w : Fin 4} (h : isHorizEdge w) : ¬ isVertEdge w
def isHorizEdge (w : Fin 4) : Prop := w = 0 ∨ w = 2
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkCrossing.lean:55
def isVertEdge (w : Fin 4) : Prop := w = 1 ∨ w = 3
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkCrossing.lean:52
Uses 2 · Used by 2
TheoremA vertical direction is not horizontal#✓fully proved
A vertical direction is not horizontal.
theorem not_isHoriz_of_isVert {w : Fin 4} (h : isVertEdge w) : ¬ isHorizEdge w
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 2 · Used by 1
TheoremEven corner counts have zero corner weight#✓fully proved
An even corner count has weight 0.
theorem cornerWeight_eq_zero_of_two_dvd
(d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) (v : ℤ × ℤ)
(hdvd : 2 ∣ cornerCount (interiorCells d hclosed) v) :
cornerWeight (cornerCount (interiorCells d hclosed) v) = 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 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 cornerWeight (k : ℕ) : ℤ := (if k = 1 then 1 else 0) - (if k = 3 then 1 else 0)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/CellEuler.lean:74
Uses 4 · Used by 2
TheoremZero corner weight where the walk continues horizontally#✓fully proved
A vertex where the walk continues horizontally has weight 0.
theorem cornerWeight_straight_horiz (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (i : Fin n)
(hstraight : d (i + 1) = d i) (hh : isHorizEdge (d i)) :
cornerWeight (cornerCount (interiorCells d hclosed) (pos d (i + 1))) = 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 isHorizEdge (w : Fin 4) : Prop := w = 0 ∨ w = 2
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkCrossing.lean:55
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 14 · Used by 1
TheoremZero corner weight where the walk continues vertically#✓fully proved
A vertex where the walk continues vertically has weight 0.
theorem cornerWeight_straight_vert (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (i : Fin n)
(hstraight : d (i + 1) = d i) (hv : isVertEdge (d i)) :
cornerWeight (cornerCount (interiorCells d hclosed) (pos d (i + 1))) = 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 isVertEdge (w : Fin 4) : Prop := w = 1 ∨ w = 3
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkCrossing.lean:52
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 14 · Used by 1
TheoremStraight steps of a simple closed walk carry no corner weight#✓fully proved
A vertex where a simple closed walk goes straight has corner weight 0 for the interior.
theorem cornerWeight_straight (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (i : Fin n) (hstraight : d (i + 1) = d i) :
cornerWeight (cornerCount (interiorCells d hclosed) (pos d (i + 1))) = 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 10 · Used by 2
TheoremHorizontal neighbours of different parity are separated by a vertical step#✓fully proved
If cells (a, b) and (a + 1, b) have different ray parities, a vertical step separates
them.
theorem straddle_nonempty_of_ne (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) (a b : ℤ)
(h : rayParity d a b ≠ rayParity d (a + 1) b) : (straddleSet d a b).Nonempty
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 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 straddleSet (d : Fin n → Fin 4) (a b : ℤ) : Finset (Fin n) :=
Finset.univ.filter (fun k : Fin n =>
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))
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/RayFlipH.lean:44
Uses 6 · Used by 1
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.