P3221T2ClosedWalkCirculation #
Adapted from Wesley Pegden’s Apache-2.0 Trellis formalization of Levine–Pegden–Smart. Changes: pool module paths, public exports, project namespace and current Mathlib compatibility.
theorem
ApollonianSuperharmonic.P3221T2ClosedWalkCirculation :
(∀ (T : ProtoTile),
LatticeTile T →
∀ (D : GaussianInt → GaussianInt → ℤ),
(∀ (a b : LatticeCell), FourNeighborAdjacent a b → {a, b} ∈ FootprintEdges T → D b a = -D a b) →
(∀ x ∈ T.cells,
D x (x + 1) + D (x + 1) (x + 1 + { re := 0, im := 1 }) + D (x + 1 + { re := 0, im := 1 }) (x + { re := 0, im := 1 }) + D (x + { re := 0, im := 1 }) x = 0) →
∀ (p : List GaussianInt) (x : GaussianInt),
p.head? = some x →
p.getLast? = some x →
List.IsChain (fun (a b : LatticeCell) => FourNeighborAdjacent a b ∧ {a, b} ∈ FootprintEdges T) p →
(List.zipWith D p p.tail).sum = 0) ∧ ∀ (D : GaussianInt → GaussianInt → ℤ),
(∀ (a b : LatticeCell), FourNeighborAdjacent a b → D b a = -D a b) →
(∀ (x : GaussianInt),
D x (x + 1) + D (x + 1) (x + 1 + { re := 0, im := 1 }) + D (x + 1 + { re := 0, im := 1 }) (x + { re := 0, im := 1 }) + D (x + { re := 0, im := 1 }) x = 0) →
∀ (p : List GaussianInt) (x : GaussianInt),
p.head? = some x →
p.getLast? = some x → List.IsChain FourNeighborAdjacent p → (List.zipWith D p p.tail).sum = 0