Lands the full Level 2 question algebra and a first-stage Level 3
tactic per QUESTIONS.md §4.2 / §4.3.
CubicalTransport/Question.lean:
- TranspQ: transport question reified. ask delegates to
eval (.transp …), engine-distinct from CompQ.ofTransp (the latter
routes through .comp whose full-face arm substitutes inside t).
Classifiers (10 total) + Decidable instances. Restated theorems:
ask_of_full_face (eval_transp_top) @[simp]
ask_of_const_line (eval_transp_const) @[simp]
ask_of_path_line (eval_transp_path) @[simp]
ask_of_pi_line (eval_transp_pi) @[simp]
ask_of_stuck (eval_transp_stuck)
ask_of_interval_line (eval_transp_interval) @[simp]
ask_of_ind_stuck (eval_transp_ind via stuck)
ask_face_congr (eval_transp_face_congr)
toCompQ_ask_eq_ask_full_face — bridge under base-dim-absent
- HCompQ: homogeneous-comp question (value-level). ask delegates
to vHCompValue. Classifiers IsFullFace, IsPiLine + Decidable.
Theorems: ask_of_full_face, ask_of_pi_line @[simp], ask_of_stuck.
- CompNQ: multi-clause heterogeneous-comp question. ask delegates
to vCompNAtTerm. Bool-valued hasTopClause + liveClauses helpers.
Classifiers HasTopClause, AllBotOrEmpty, IsSingleLive + Decidable.
Anatomy theorem ask_def restating vCompNAtTerm_def.
- IsNonPathNonGlueNonPi composite classifier on CompQ for the stuck
case discharge.
Top-level cubical_simp tactic:
- macro expanding to a simp call pre-loaded with every classifier
definition + every @[simp]-tagged ask_of_* lemma.
- Two surfaces: bare cubical_simp and cubical_simp [extra_args].
- Four end-to-end tactic-test examples verify the routing fires
on full-face CompQ, full-face TranspQ, interval-line TranspQ,
full-face HCompQ.
Pure derived theorems — no new axioms. All 89/89 tests still pass.
The cubical_simp tactic is the visible user surface for Level 3
question-driven proofs; full classifier-graph walking (with
methodology library + transport-along-MetaPath) lands in Phase D'
of ALGEBRA_PLAN.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .forgejo/workflows | ||
| CubicalTransport | ||
| docs | ||
| native/cubical | ||
| .gitignore | ||
| build.sh | ||
| CubicalBench.lean | ||
| CubicalTest.lean | ||
| CubicalTransport.lean | ||
| lake-manifest.json | ||
| lakefile.toml | ||
| lean-toolchain | ||
| LICENSE | ||
| NOTICE | ||
| README.md | ||
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/libtopolei_cubical.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 siblingtopoleirepo.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 itsdocs/cells-spec.mdanddocs/STATUS.mdfor the application-side picture.