Steps on a horizontal unit segment join its endpoints to A closed walk crosses each vertical line an even number of times
TheoremSteps on a horizontal unit segment join its endpoints#✓fully proved
A step on the horizontal segment [a, a + 1] × {b} goes from one endpoint to the other.
theorem midSet_endpoints (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) (a b : ℤ)
(k : Fin n) (hk : k ∈ midSet d a b) :
(pos d k = (a, b) ∧ pos d (k + 1) = (a + 1, b))
∨ (pos d k = (a + 1, b) ∧ pos d (k + 1) = (a, b))
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 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
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
TheoremSteps on a vertical unit segment join its endpoints#✓fully proved
A step on the vertical segment {a + 1} × [b, b + 1] goes from one endpoint to the other.
theorem straddleSet_endpoints (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) (a b : ℤ)
(k : Fin n) (hk : k ∈ straddleSet d a b) :
(pos d k = (a + 1, b) ∧ pos d (k + 1) = (a + 1, b + 1))
∨ (pos d k = (a + 1, b + 1) ∧ pos d (k + 1) = (a + 1, b))
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 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
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 6 · Used by 2
TheoremA simple closed walk traverses each horizontal segment at most once#✓fully proved
A simple closed walk traverses each horizontal unit segment at most once.
theorem midSet_card_le_one (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n) (a b : ℤ) :
(midSet d a b).card ≤ 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 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
TheoremA simple closed walk traverses each vertical segment at most once#✓fully proved
A simple closed walk traverses each vertical unit segment at most once.
theorem straddleSet_card_le_one (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d)) (hn : 3 ≤ n) (a b : ℤ) :
(straddleSet d a b).card ≤ 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 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 5 · Used by 5
TheoremSome north-then-west corner has its below-left cell inside#✓fully proved
A simple closed walk without right turns has a north-then-west corner M whose below-left cell
((pos d M).1 - 1, (pos d M).2 - 1) has ray parity 1.
theorem lexmax_corner_cell_inside
(d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hsimple : Function.Injective (pos d))
(hreflexfree : ∀ i : Fin n, d (i + 1) - d i = 0 ∨ d (i + 1) - d i = 1) :
∃ M : Fin n, d (M - 1) = 1 ∧ d M = 2 ∧
rayParity d ((pos d M).1 - 1) ((pos d M).2 - 1) = 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 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 10 · Used by 2
TheoremNo north step leaves a highest vertex#✓fully proved
No north step leaves a vertex of maximal height.
theorem top_out_ne_N (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
{M v : Fin n} (hmax : ∀ j : Fin n, (pos d j).2 ≤ (pos d M).2)
(hv : (pos d v).2 = (pos d M).2) :
d v ≠ 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
Uses 3 · Used by 1
TheoremNo south step arrives at a highest vertex#✓fully proved
No south step arrives at a vertex of maximal height.
theorem top_in_ne_S (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
{M v : Fin n} (hmax : ∀ j : Fin n, (pos d j).2 ≤ (pos d M).2)
(hv : (pos d v).2 = (pos d M).2) :
d (v - 1) ≠ 3
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
Uses 3
TheoremPosition after a run of west steps#✓fully proved
After j consecutive west steps from vertex M, the walk is j units to the left of M at
the same height.
theorem forward_west_run (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) (M : Fin n)
(j : ℕ) (hj : ∀ i : ℕ, i < j → d (M + (Nat.cast i : Fin n)) = 2) :
pos d (M + (Nat.cast j : Fin n)) = ((pos d M).1 - (j : ℤ), (pos d M).2)
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
DefinitionSingle west run covering the top row#✓fully proved
Every vertex of the walk at the height of M is reached from M by a run of consecutive west
steps.
def SingleTopRun (d : Fin n → Fin 4) (M : Fin n) : Prop :=
∀ v : Fin n, (pos d v).2 = (pos d M).2 →
∃ j : ℕ, (∀ i : ℕ, i < j → d (M + (Nat.cast i : Fin n)) = 2) ∧
(pos d v).1 = (pos d M).1 - (j : ℤ)
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
TheoremA single top run makes the top row contiguous#✓fully proved
If the top row is covered by a single west run from a highest vertex, it is contiguous.
theorem topRowContiguous_of_singleTopRun (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
{M : Fin n} (hmax : ∀ j : Fin n, (pos d j).2 ≤ (pos d M).2)
(hrun : SingleTopRun d M) :
StatMech.Onsager.UmlaufsatzStrip.TopRowContiguous 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 SingleTopRun (d : Fin n → Fin 4) (M : Fin n) : Prop :=
∀ v : Fin n, (pos d v).2 = (pos d M).2 →
∃ j : ℕ, (∀ i : ℕ, i < j → d (M + (Nat.cast i : Fin n)) = 2) ∧
(pos d v).1 = (pos d M).1 - (j : ℤ)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TopRow.lean:98
def TopRowContiguous (d : Fin n → Fin 4) : Prop :=
∃ M : Fin n, (∀ j : Fin n, (pos d j).2 ≤ (pos d M).2) ∧
∀ a b : Fin n, (pos d a).2 = (pos d M).2 → (pos d b).2 = (pos d M).2 →
∀ x : ℤ, (pos d a).1 ≤ x → x ≤ (pos d b).1 →
∃ c : Fin n, pos d c = (x, (pos d M).2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/ExtremeCorners.lean:212
Uses 5 · Used by 1
TheoremTop row is contiguous when every top corner starts a single run#✓fully proved
If every highest north-then-west corner starts a single top run, the top row is contiguous.
theorem topRowContiguous_of_residue (d : Fin n → Fin 4)
(hclosed : ∑ i, stepOf (d i) = 0)
(hreflexfree : ∀ i : Fin n, d (i + 1) - d i = 0 ∨ d (i + 1) - d i = 1)
(hres : ∀ M : Fin n, d (M - 1) = 1 → d M = 2 →
(∀ j : Fin n, (pos d j).2 ≤ (pos d M).2) → SingleTopRun d M) :
StatMech.Onsager.UmlaufsatzStrip.TopRowContiguous 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 SingleTopRun (d : Fin n → Fin 4) (M : Fin n) : Prop :=
∀ v : Fin n, (pos d v).2 = (pos d M).2 →
∃ j : ℕ, (∀ i : ℕ, i < j → d (M + (Nat.cast i : Fin n)) = 2) ∧
(pos d v).1 = (pos d M).1 - (j : ℤ)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TopRow.lean:98
def TopRowContiguous (d : Fin n → Fin 4) : Prop :=
∃ M : Fin n, (∀ j : Fin n, (pos d j).2 ≤ (pos d M).2) ∧
∀ a b : Fin n, (pos d a).2 = (pos d M).2 → (pos d b).2 = (pos d M).2 →
∀ x : ℤ, (pos d a).1 ≤ x → x ≤ (pos d b).1 →
∃ c : Fin n, pos d c = (x, (pos d M).2)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/ExtremeCorners.lean:212
TheoremA north step into a highest vertex is followed by a west step#✓fully proved
In a closed walk without right turns, a north step arriving at a highest vertex is followed by a west step.
theorem top_arrival_west (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hreflexfree : ∀ i : Fin n, d (i + 1) - d i = 0 ∨ d (i + 1) - d i = 1)
{M v : Fin n} (hmax : ∀ j : Fin n, (pos d j).2 ≤ (pos d M).2)
(hv : (pos d v).2 = (pos d M).2) (harr : d (v - 1) = 1) :
d v = 2
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
Uses 3
TheoremA west step on the top row is followed by west or south#✓fully proved
A west step on the top row is followed by a west or a south step, and stays on the top row.
theorem top_west_next (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hreflexfree : ∀ i : Fin n, d (i + 1) - d i = 0 ∨ d (i + 1) - d i = 1)
{M v : Fin n} (_hmax : ∀ j : Fin n, (pos d j).2 ≤ (pos d M).2)
(hv : (pos d v).2 = (pos d M).2) (hw : d v = 2) :
(pos d (v + 1)).2 = (pos d M).2 ∧ (d (v + 1) = 2 ∨ d (v + 1) = 3)
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
Uses 4 · Used by 1
TheoremA closed walk is not all west steps#✓fully proved
A closed walk does not consist of west steps only.
theorem exists_step_ne_west (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) (M : Fin n) :
∃ i : ℕ, d (M + (Nat.cast i : Fin n)) ≠ 2
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
TheoremA west run from a highest vertex ends in a south step#✓fully proved
From a highest vertex where the walk turns west, it makes J ≥ 1 west steps and then a south
step.
theorem exists_west_run_end (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0)
(hreflexfree : ∀ i : Fin n, d (i + 1) - d i = 0 ∨ d (i + 1) - d i = 1)
(M : Fin n) (hmax : ∀ j : Fin n, (pos d j).2 ≤ (pos d M).2) (hout : d M = 2) :
∃ J : ℕ, 1 ≤ J ∧ (∀ i : ℕ, i < J → d (M + (Nat.cast i : Fin n)) = 2) ∧
d (M + (Nat.cast J : Fin n)) = 3
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
TheoremA west run covering the top row is a single top run#✓fully proved
A west run from M whose vertices cover the top row is a single top run.
theorem singleTopRun_of_runCoversTop (d : Fin n → Fin 4) (M : Fin n) (J : ℕ)
(hrun : ∀ i : ℕ, i < J → d (M + (Nat.cast i : Fin n)) = 2)
(hcover : ∀ v : Fin n, (pos d v).2 = (pos d M).2 →
∃ i : ℕ, i ≤ J ∧ (pos d v).1 = (pos d M).1 - (i : ℤ)) :
StatMech.Onsager.TopRow.SingleTopRun d M
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 SingleTopRun (d : Fin n → Fin 4) (M : Fin n) : Prop :=
∀ v : Fin n, (pos d v).2 = (pos d M).2 →
∃ j : ℕ, (∀ i : ℕ, i < j → d (M + (Nat.cast i : Fin n)) = 2) ∧
(pos d v).1 = (pos d M).1 - (j : ℤ)
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/TopRow.lean:98
Uses 2
TheoremA step changes the x-coordinate by at most one#✓fully proved
A step changes the x-coordinate by 0 or ±1.
theorem fst_step_bound (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) (k : Fin n) :
(pos d (k + 1)).1 = (pos d k).1 ∨ (pos d (k + 1)).1 = (pos d k).1 + 1 ∨
(pos d (k + 1)).1 = (pos d k).1 - 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
Uses 3 · Used by 1
DefinitionNumber of crossings of a vertical line#✓fully proved
The number of horizontal steps of the walk crossing the vertical line x = m + 1/2.
def vertColCross (d : Fin n → Fin 4) (m : ℤ) : ℕ :=
(Finset.univ.filter (fun k : Fin n =>
isHorizEdge (d k) ∧ min ((pos d k).1) ((pos d (k + 1)).1) = m)).card
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 2 · Used by 2
TheoremA closed walk crosses a vertical line equally often left and right#✓fully proved
A walk crosses the line x = m + 1/2 to the right as often as to the left.
theorem leftRight_card_eq (d : Fin n → Fin 4) (m : ℤ) :
(Finset.univ.filter
(fun k : Fin n => (pos d k).1 ≤ m ∧ m + 1 ≤ (pos d (k + 1)).1)).card
= (Finset.univ.filter
(fun k : Fin n => m + 1 ≤ (pos d k).1 ∧ (pos d (k + 1)).1 ≤ m)).card
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
TheoremA closed walk crosses each vertical line an even number of times#✓fully proved
A closed walk crosses each vertical line x = m + 1/2 an even number of times.
theorem vertColCross_even (d : Fin n → Fin 4) (hclosed : ∑ i, stepOf (d i) = 0) (m : ℤ) :
Even (vertColCross d m)
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 vertColCross (d : Fin n → Fin 4) (m : ℤ) : ℕ :=
(Finset.univ.filter (fun k : Fin n =>
isHorizEdge (d k) ∧ min ((pos d k).1) ((pos d (k + 1)).1) = m)).card
MathlibExt/Combinatorics/SimpleGraph/Lattice/TurningNumber/WalkCrossingV.lean:45
Uses 9 · Used by 1
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.