Lean 4 cubical-transport HoTT engine + Rust naga-IR FFI. The backend that powers topolei. Cells-spec implementation; the proof IS the implementation.
Find a file
Maximus Gorog c2e3ecb3e3
Some checks are pending
Lean Action CI / build (push) Waiting to run
Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI
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>
2026-04-27 20:40:45 -06:00
.github/workflows Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
native Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
Topolei Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
.gitignore Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
build.sh Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
cells-spec.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
CubicalBench.lean Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
CubicalTest.lean Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
exp-log.pdf Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
FFI_COMPLETENESS.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
FFI_DESIGN.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
HYPOTHESES.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
KERNEL_BOUNDARY.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
lake-manifest.json Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
lakefile.toml Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
lean-toolchain Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
Main.lean Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
NAGA_IR_PLAN.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
NUMERICAL.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
PLAN.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
ProbeTest.lean Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
README.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
REFERENCES.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
RENDER_BRIDGE_GAP.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
STATUS.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
Topolei.lean Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
TRANSPORT_PLAN.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
ZIGZAG_PORT.md Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00

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 direct naga::Module construction from EMLPath (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 — H1H4 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.