Implements the cells-spec vision: a computation space that preserves auditability, correctness, interactivity. Phase 1 (Lean kernel + naga-IR Rust backend) is closed; foundation hypothesis stack (Selection H1+H2, Subobject H3, Trace H5, Obs.Ctx C2, Cubical.Trace) landed. Highlights: - Cubical-HoTT syntax + value/eval/readback in Lean - naga-IR pipeline (no GLSL string crosses FFI; 17/17 probes pass) - Honesty audit: every non-transport (sealed cells, vertex shader, Y-flip, presentation conventions) is documented as such - Polymorphic Trace α as free monoid; Cubical.Trace gives CTerm → Trace CTerm by structural fold (homomorphism = definition) - Selection as Huet zipper; Subobject as Boolean algebra over WCell - All theorems proven; the proof IS the implementation See STATUS.md for the resume guide. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.3 KiB
topolei
A Lean 4 extension adding cubical-transport homotopy type theory to Lean 4 via a Rust FFI module.
Documents
STATUS.md— current formal status, Phase 1 closure, open obligations, three-stream priority order.PLAN.md— architecture plan: rendering stack, window FFI surfaces, phase roadmap.cells-spec.md— full system specification: cubical core, cells, shader pipeline, runtime, boundary, self-hosting.TRANSPORT_PLAN.md— step-by-step cubical evaluator formalization plan (Phase 1 history).ZIGZAG_PORT.md— step-by-step Lean port plan for the n-category combinatorial engine. Parallel to TRANSPORT_PLAN but for Phase 2+ higher-cell backend.NAGA_IR_PLAN.md— staged plan for directnaga::Moduleconstruction fromEMLPath(eliminating the last text-format stage in the render pipeline). Seven-stage roadmap with reading list and known pitfalls; pick up in a fresh session.NUMERICAL.md— principles for numerical implementations: separation of mathematical content from execution context, contracts, registry, construction faults to avoid.HYPOTHESES.md— H1–H4 hypotheses about the approach.REFERENCES.md— papers and code references (CCHM, cubicaltt, Agda Cubical, EML).zigzag-engine/— reference Rust implementation of the n-category engine (~11K LOC) + papers. Port-from material, NOT a dependency. See its own README.
Core framing
Topolei is a Lean 4 extension. Everything external to Lean is
first specified as Lean axioms; the one Rust FFI component later
discharges those axioms via @[extern] + @[implemented_by].
The one Rust component is the cubical evaluator backend (plus GPU runtime within the same crate). Its purpose is extending Lean 4 with computational cubical-transport HoTT.
Everything else is Lean, including the zigzag n-category engine (being ported in) and the numerical layer. The medium-term goal is to maximise what can be reasoned about inside Lean; Rust is used only where fundamentally required (effects) or as a post-spec optimisation target.
The cubical core (Phase 1) is closed with zero Rust dependency. Many subsequent phases (Cells, Reactive, Color, Shader IR, Boundary models, Meta, Zigzag) are pure-Lean extensions of the axiom base.