CType inductive-type encoding (for paideia K7 cubical Path) #1
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue 002 —
CTypeinductive-type encoding for K7's full cubical PathStatus: open · Filed by: paideia, 2026-04-30 · Activated in: another Claude session (engine work)
Repository targeted:
cubical-transport-hott-lean4(the engine)Summary
Paideia's K7 (
BootstrapGradient) currently ships as a discretesequence of
(MathemaId, MasteryProvenance, Outcome)triples — the"discrete shadow" of the cubical Path it aspires to be. The
original Eulerian framing was K7 as a literal
Pathbetweensuccessive
MasteryProvenancetraces, observable as a cubicalobject via the engine's
transp/comp/Pathmachinery.The blocker: the engine's
CTypealgebra has no inductivetypes. Available
CTypes:No
Nat, noList, noBool, no general inductive families. Thismeans there is no
CTyperepresenting "a list ofKnowledgeNodes,"which is what
MasteryProvenance := Trace KnowledgeNodeneeds to beencoded as.
Without that
CType, the engine'sPathcannot quantify overMasteryProvenanceendpoints. K7's full cubical encoding istherefore impossible at the paideia layer with the current engine
API — it requires engine work.
Concrete blocker for paideia
The aspirational shape:
Requires
toCTerm : MasteryProvenance → CTerm. No such functionexists or can be defined: the cubical-syntax universe lacks the
inductive structure needed to host a list-of-records value.
The current K7 ships paideia-domain
MathPath(seePaideia/Foundation/K7Cubical.lean) — a typed two-endpointstructure with
interp : Bool → MasteryProvenanceand endpointconditions. This captures the cubical shape (boundary, reverse,
restricted composition) but is parallel to engine
Path, not anembedding into it.
Suggested engine extension (one option)
Add inductive types to
CubicalTransport.Syntax:The full extension would also include:
transpandcompcases (well-typed transport over inductivevalues is a known cubical construction — Cohen et al., CCHM
§6 covers it for HITs; for plain inductives it's straightforward);
Alternative: a generic-inductive
CTypeRather than adding
list(and laternat,bool, etc.) one at atime, expose a schema for declaring inductive types:
This is closer to Lean's own inductive-types-as-data approach.
More upfront work; covers all paideia's future encoding needs in
one move.
Cost
Substantial — not a single-file refactor. The engine's
CubicalTransport.{Syntax, Subst, Typing, Eval, Value, Readback, Transport, TransportLaws, CompLaws, Soundness}modules each gainnew cases for the new constructors. Estimated: one to two
"chapters" of CCHM-style implementation. Comparable in scope to
the existing
Gluechapter, which took its own development cycle.Benefit
MathPathcan be retired in favour of a typedCTermofcubical-Path type, with engine
transp/compoperating overthe bootstrap trajectory directly.
future project that wants to model Lean-inductive data inside
the cubical universe (provenance traces, EML rendering inputs,
arbitrary curated structures) gets a uniform encoding path.
development. Higher inductive types are the natural next step
after this foundation.
Compatibility note for the Claude session that picks this up
Paideia depends on the engine. This refactor would not break
existing paideia code (no current K-hypothesis uses inductive
CTypes), but would enable paideia to retire
MathPathin favourof an engine-grounded version. The migration sequence:
import CubicalTransport.Inductive(or whatever) topaideia's
K7Cubical.MasteryProvenance.toCTermusing the new constructors.CubicalGradientas aCTerm-typed value.MathPath p₀ p₁is equivalent toCTerms of typePath MPCType (p₀.toCTerm) (p₁.toCTerm).hood, keeping the user-facing API identical.
If the engine refactor is too large to coordinate, a partial
refactor — adding only
list(the minimum forTrace's shape) —is acceptable. Paideia's needs are bounded; the schema-based
generalisation is a nice-to-have, not a blocker.
Pre-built reference
Paideia/Foundation/K7Cubical.leancontains the paideia-sideMathPathstructure with the operations (const,reverse,comp-on-reflexive-paths,transport) the engine version wouldmirror. The proofs there are paideia-specific but the signatures
are the API the engine version should expose to consumers — the
literal CTerm encoding can be wired in behind the same external
shape.
Filed from paideia/docs/issues/002-cterm-inductive-encoding.md @ commit 01f1e2b