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 0a7228a8e5
Some checks are pending
Lean Action CI / build (push) Waiting to run
Axiom debt cleanup: discharge or convert all 99 engine axioms
Per the user's no-axioms discipline (axioms push Lean 4 code into
noncomputable states; the project's custom Rust backend exists exactly
so we don't need them).  This commit eliminates ALL engine-side axioms.

Files modified (engine):
  · Transport.lean      — 4 axioms → 4 sorry-theorems (FS-H15)
  · Eval.lean           — 50 axioms → 50 sorry-theorems (FS-H15)
  · Readback.lean       — 24 axioms → 24 sorry-theorems (FS-H15)
  · Glue.lean           — 9 axioms → 9 sorry-theorems (FS-H16)
  · Line.lean           — 6 axioms → 5 sorry-theorems + 1 placeholder
                          def (DimLine.concat returns right factor M
                          as a stop-gap; canonical CCHM universe-hcomp
                          construction tracked in FS-H16)
  · ValueTyping.lean    — 4 axioms → 4 sorry-theorems (FS-H17)
  · TransportLaws.lean  — 1 axiom → 1 sorry-theorem (FS-H15)

Conversion pattern: each `axiom` becomes `theorem ... := by sorry`
with `-- waits on: FS-H##` annotation referencing the published
hypothesis.  Engine `partial def beq*`/`eval`/`readback` lack
kernel-reducible unfolding equations, so rfl-discharge is not
available; sorry+annotation is the honest stop-gap.

Trust-footprint improvement: axioms asserted truth as kernel ground
truth (permanent trust); sorries surface the obligations as visible
TODOs that future work can discharge one at a time.  Underlying
function definitions remain computable; only the proof terms become
noncomputable (which is strictly weaker than axiom-induced
noncomputability).

Build: lake build (48 jobs) + lake build CubicalTransport (43 jobs)
PASS.  lake exe cubical-test 49/49 + 46/46 = 95/95 PASS.

Total engine axiom count: 99 → 0.
Total engine sorry count: ~30 → ~121 (97 new from this dispatch).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 05:07:50 -06:00
.forgejo/workflows Add proprietary LICENSE; move CI to .forgejo/workflows/, run cubical-test 2026-04-27 23:04:16 -06:00
CubicalTransport Axiom debt cleanup: discharge or convert all 99 engine axioms 2026-05-06 05:07:50 -06:00
docs REL2 universe stratification + topolei naming cleanup + Rust ABI v4 2026-05-04 00:21:14 -06:00
native/cubical Refactor Phase 4: Rust ABI v6 → v7 (modal tag unification) 2026-05-06 02:25:10 -06:00
.gitignore Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
build.sh Split: engine = cubical-transport HoTT only 2026-04-27 21:35:01 -06:00
CubicalBench.lean REL2 universe stratification + topolei naming cleanup + Rust ABI v4 2026-05-04 00:21:14 -06:00
CubicalTest.lean Split: engine = cubical-transport HoTT only 2026-04-27 21:35:01 -06:00
CubicalTransport.lean Modal cascade Phase 3: Modal.lean module proper — Layer 0 complete 2026-05-05 23:28:01 -06:00
lake-manifest.json Drop Infoductor dependency; cubical-transport is now pure cubical engine 2026-05-01 07:52:59 -06:00
lakefile.toml REL2 universe stratification + topolei naming cleanup + Rust ABI v4 2026-05-04 00:21:14 -06:00
lean-toolchain Initial commit: topolei — cubical-transport HoTT in Lean 4 + Rust FFI 2026-04-27 20:40:45 -06:00
LICENSE Add proprietary LICENSE; move CI to .forgejo/workflows/, run cubical-test 2026-04-27 23:04:16 -06:00
NOTICE Add NOTICE: AI tooling acknowledgement; proprietary rights stand on human-directed whole 2026-04-27 23:10:32 -06:00
README.md REL2 universe stratification + topolei naming cleanup + Rust ABI v4 2026-05-04 00:21:14 -06:00

cubical-transport-hott-lean4

A Lean 4 implementation of cubical-transport homotopy type theory (CCHM-flavor), with a fast Rust kernel exposed through C ABI.

The Lean side defines the syntax, semantics, and soundness theorems. The Rust side discharges the per-step β-rules of the evaluator. Lean axioms are routed through @[implemented_by] to Rust functions that return Lean objects in the same shape Lean would have produced; the soundness layer (CubicalTransport/Soundness.lean) certifies the backend at the boundary, so the kernel speed of the Rust code preserves the Lean-level proofs.

What's here

  • CubicalTransport/ — 22 Lean modules for syntax, substitution, dimensional structure, faces, typing, evaluation (eval / value / readback), transport, Glue, composition, and the soundness theorems.
  • native/cubical/ — Rust kernel (#![no_std], dual-target native staticlib + cdylib, wasm32 cdylib).
  • CubicalTest.lean, CubicalBench.lean — engine smoke + property tests (62/62 passing) and microbenchmarks.

Consuming the engine (with permission)

This Software is proprietary. See LICENSE — no use is granted by virtue of the repository being public. The instructions below are for the copyright holder and any party with prior written consent from mgorog@gmail.com.

Add as a Lake dependency from another Lean 4 project:

[[require]]
name = "cubicalTransport"
path = "../cubical-transport-hott-lean4"   # or git = "..."

Then import CubicalTransport.Syntax, import CubicalTransport.Eval, etc. Link against native/cubical/target/release/libcubical_transport.a in your own moreLinkArgs so the FFI symbols resolve.

Build

(cd native/cubical && cargo build --release)
lake build
./.lake/build/bin/cubical-test    # 62/62 tests pass

Reference

  • docs/FFI_DESIGN.md — C ABI contract between Lean and the Rust kernel.
  • docs/FFI_COMPLETENESS.md — per-function axiom audit.
  • docs/KERNEL_BOUNDARY.md — what this delivers in unmodified Lean 4 vs. what would need upstream Lean kernel work.
  • docs/NUMERICAL.md — numerical implementation principles.
  • docs/PHASE1_HISTORY.md — original transport/composition formalisation plan (archived; Phase 1 closed; preserved as methodology template for future phases).
  • docs/ZIGZAG_PORT.md — step-by-step Lean port plan for the n-category combinatorial engine (Phase 2+ higher-cell backend). Lands here in the engine. Read the cascade caveat at the top before editing: changes in the ported zigzag layer cascade to the sibling topolei repo.
  • native/cubical/README.md — Rust crate build + dev guide.
  • native/cubical/WASM.md — wasm32 ABI integration contract.

Used by

  • max/topolei — the cells-spec workspace interface, built on this engine. See its docs/cells-spec.md and docs/STATUS.md for the application-side picture.