1-- With labels respecting the walls of the cube, a labelled face on any wall2-- lies on the far wall of the last coordinate, so the boundary doors of the3-- parity count are exactly the labelled faces there4-- Part of Cumulus, the Grace17 mathematics library.5-- Copyright (c) 2026 Grant Passmore.6-- Released under the Apache License 2.0. See LICENSE in the repository root.7-- Authors: Grant Passmore89module Grace.Cumulus.FixedPoint.KuhnWallFace10import KuhnParity1112def topWallFaces (p m lab : Set) : Set:=13 { f ∈ labelledFaces(p, succ(m), lab) |∀ x ∈ f, x(m) = p }1415-- A labelled face on any wall lies on the far wall of the last coordinate.16theorem labelledFaces.wall_top (m p : Nat) (lab f : Set)17requires zeroWall : ∀ x ∈ functionSpace(succ(m), succ(p)), ∀ j ∈ succ(m), x(j) =0→ lab(x)(j) =018requires fullWall : ∀ x ∈ functionSpace(succ(m), succ(p)), ∀ j ∈ succ(m), x(j) = p → lab(x)(j) =119requires hf : f ∈ labelledFaces(p, succ(m), lab)20requires wall : ∃ j ∈ succ(m), (∀ x ∈ f, x(j) =0) ∨ (∀ x ∈ f, x(j) = p)21shows∀ x ∈ f, x(m) = p22proof23have parts := labelledFaces.membership.forward with hf24have inCube := powerset.membership_iff.forward with parts.left25have labels := parts.right.right26obtain⟨j, hj, flat⟩:= wall27have jNat := natural.member at succ(m) with hj28cases flat with zero | full29 . exfalso30have jInImage : j ∈ labelImage(succ(m), lab, f) by rwa labels31obtain⟨jIn, x, hx, shape⟩:= labelImage.membership.forward with jInImage32have xInCube := inCube with x, hx33have forX := zeroWall with xInCube34have labelZero := forX with hj, (zero with hx)35have different := reduced.ne_of_zero with hj, labelZero36apply different37 symm38exact shape39 . intros x hx40have alternatives : j = m ∨ j ≠ m bytauto41cases alternatives with same | different42 . rw← same43exact full with hx44 . exfalso45have jBelow : j ∈ m46havesplit:= bootstrap.succ.membership.forward with hj47casessplitwith below | top48 . exact below49 . exfalso50exact different with top51have jLess := Less.of_membership with jBelow52have mInImage : m ∈ labelImage(succ(m), lab, f)53rw labels54exact bootstrap.succ.self55obtain⟨mIn, y, hy, yShape⟩:= labelImage.membership.forward with mInImage56have yInCube := inCube with y, hy57have forY := fullWall with yInCube58have labelOne := forY with hj, (full with hy)59have nonzero : lab(y)(j) ≠060rw labelOne61intro equal62arith63have bound := reduced.le_of_nonzero with hj, nonzero64rw← yShape at bound65arith6667theorem boundaryDoors.top_wall (m p : Nat) (lab : Set)68requires zeroWall : ∀ x ∈ functionSpace(succ(m), succ(p)), ∀ j ∈ succ(m), x(j) =0→ lab(x)(j) =069requires fullWall : ∀ x ∈ functionSpace(succ(m), succ(p)), ∀ j ∈ succ(m), x(j) = p → lab(x)(j) =170shows boundaryDoors(faceIncidence(p, succ(m), lab), kuhnSimplices(p, succ(m)), labelledFaces(p, succ(m), lab)) =71 topWallFaces(p, m, lab)72proof73have zeroLess : 0 < succ(m) byarith74have positive := membership.of_Less with zeroLess75ext f76have walls := boundaryDoors.wall at succ(m), p, lab, f with positive77constructor78 . intro hf79obtain⟨fIn, wall⟩:= walls.forward with hf80apply topWallFaces.membership.backward81constructor82 . exact fIn83 . exact labelledFaces.wall_top with zeroWall, fullWall, fIn, wall84 . intro hf85obtain⟨fIn, top⟩:= topWallFaces.membership.forward with hf86apply walls.backward87constructor88 . exact fIn89 . witness m90constructor91 . exact bootstrap.succ.self at m92 . right93exact top94