Problem
The current boundary analysis in SpernerGrid.lean is built on an incorrect lemma:
boundary_verts_on_face is mathematically wrong. It claims that when gridAdj s k = none and k < d, all vertices j ≠ k have (s.verts j).onFace k (k-th barycentric coordinate = 0). This is false — cell face position does NOT correspond to barycentric coordinate.
no_boundary_doors_face_lt depends on this incorrect lemma.
Correct Architecture
Step 1: Remove incorrect lemmas
Delete boundary_verts_on_face and no_boundary_doors_face_lt.
Step 2: Prove boundary doors only occur at face d
After fixing boundaryFlip0 (#9043):
- Face k for 0 < k < d:
gridAdj dispatches to interiorFlip which always returns some. No boundary faces.
- Face 0:
boundaryFlip0 returns some for all valid simplices (d=0 excluded, d=1 returns none only on geometric boundary, d≥2 always returns some after fix). So boundary doors at face 0 only for d=1.
- Face d:
boundaryFlipLast returns none iff v₀.coords(incDir(d-1)) = 0. This correctly identifies geometric face incDir(d-1).
Step 3: Characterize boundary doors at face d
When boundaryFlipLast returns none:
- All vertices
v₀, ..., v_{d-1} have incDir(d-1) coordinate = 0 (on geometric face incDir(d-1))
- Sperner condition on this face: color
incDir(d-1) is forbidden
- A door at face d requires colors
{0, ..., d-1} on the face {v₀, ..., v_{d-1}}
- If
incDir(d-1).val < d, color incDir(d-1) is in {0,...,d-1} but forbidden → NOT a door
- If
incDir(d-1).val = d, then miss must be some value < d (since miss ≠ incDir(d-1) = d)
- The face vertices use colors from
{0,...,d-1} \ {miss} ∪ (possibly miss if not on that face)
- This is the only case where boundary doors at face d can exist
Step 4: Prove boundary_doors_odd by induction on d
Base case (d = 0): Single vertex, no doors, count = 0... hmm, but we need ODD count. Actually for d=0, the standard simplex has a single vertex colored 0, and the panchromatic condition is trivially satisfied. The boundary door count setup needs to be verified for d=0.
Inductive step: Boundary doors at face d of the d-simplex grid correspond to doors in the (d-1)-dimensional boundary triangulation. By induction, this count is odd.
This is the hardest proof in the file and requires constructing the (d-1)-dimensional boundary complex from the face d simplices.
Acceptance Criteria
Affected Files
proofs/Proofs/SpernerGrid.lean — boundary analysis redesign
Test Plan
Dependencies
References
Problem
The current boundary analysis in
SpernerGrid.leanis built on an incorrect lemma:boundary_verts_on_faceis mathematically wrong. It claims that whengridAdj s k = noneandk < d, all verticesj ≠ khave(s.verts j).onFace k(k-th barycentric coordinate = 0). This is false — cell face position does NOT correspond to barycentric coordinate.no_boundary_doors_face_ltdepends on this incorrect lemma.Correct Architecture
Step 1: Remove incorrect lemmas
Delete
boundary_verts_on_faceandno_boundary_doors_face_lt.Step 2: Prove boundary doors only occur at face d
After fixing boundaryFlip0 (#9043):
gridAdjdispatches tointeriorFlipwhich always returnssome. No boundary faces.boundaryFlip0returnssomefor all valid simplices (d=0 excluded, d=1 returns none only on geometric boundary, d≥2 always returns some after fix). So boundary doors at face 0 only for d=1.boundaryFlipLastreturnsnoneiffv₀.coords(incDir(d-1)) = 0. This correctly identifies geometric faceincDir(d-1).Step 3: Characterize boundary doors at face d
When
boundaryFlipLastreturnsnone:v₀, ..., v_{d-1}haveincDir(d-1)coordinate = 0 (on geometric faceincDir(d-1))incDir(d-1)is forbidden{0, ..., d-1}on the face{v₀, ..., v_{d-1}}incDir(d-1).val < d, colorincDir(d-1)is in{0,...,d-1}but forbidden → NOT a doorincDir(d-1).val = d, thenmissmust be some value < d (since miss ≠ incDir(d-1) = d){0,...,d-1} \ {miss}∪ (possibly miss if not on that face)Step 4: Prove boundary_doors_odd by induction on d
Base case (d = 0): Single vertex, no doors, count = 0... hmm, but we need ODD count. Actually for d=0, the standard simplex has a single vertex colored 0, and the panchromatic condition is trivially satisfied. The boundary door count setup needs to be verified for d=0.
Inductive step: Boundary doors at face d of the d-simplex grid correspond to doors in the (d-1)-dimensional boundary triangulation. By induction, this count is odd.
This is the hardest proof in the file and requires constructing the (d-1)-dimensional boundary complex from the face d simplices.
Acceptance Criteria
boundary_verts_on_faceremoved (incorrect)no_boundary_doors_face_ltremoved or replaced with correct versionboundary_doors_oddproved (0 sorry)sperner_gridend-to-end theorem worksAffected Files
proofs/Proofs/SpernerGrid.lean— boundary analysis redesignTest Plan
./proofs/scripts/docker-build.sh Proofs.SpernerGridwith 0 errorssperner_gridtheorem compiles with only theCellComplex.spernersorry (proved in SpernerMathlib4.lean)Dependencies
References
research/sperner-grid-analysis.md(PR Analysis: Sperner grid boundary flip bug and architecture for Part 2 #9040)