ISAR is a Lean 4 formalization of a minimal combinatory calculus whose operational quotient — the Invariant Layer — is the terminal object in a stated category of closed computational dialects (Kernel). Lambda calculus, term rewriting systems, stack VM bytecode, hereditarily finite sets, and linear interaction nets are modelled as views that factor through this quotient via structure-preserving morphisms. Modules are machine-checked; see STATUS for axiom / vacuity notes and a dated program status / next list (sorry-free ≠ non-vacuous).
Related literature for the intended claims: Rutten–Aczel (coalgebras), Abramsky–Ong (applicative bisimilarity), Jones/Gomard/Sestoft (partial evaluation). Terminality is relative to the formal Kernel interface, not a claim that other calculi lack models or encodings.
The core factorization pattern is:
-
ISAR.lean — Syntax, rewrite rules, confluence, unique normal forms for
ISKTerm, and basis completeness (derives$S$ from$I, K, W, C, B$ ). -
InvariantLayer.lean —
OperEqjoinability quotient,app_congruence,cd_loop_fuel, linear fuel certificates.
2a. CanonicalRepresentative.lean — cd / cd_loop_fuel as explicit OperEq representatives; Gross–Knuth: finite cd reaches the unique NF iff HasNF; unrestricted canonical_rep_eq proved (nf_of_term = NF or class exists_rep).
-
LambdaFragment.lean — de Bruijn
LTerm, bracket abstractionabstract0, compilercompile, simulation:compile_simulates_stepandcompile_simulates_red. -
TensorSemantics.lean — Term model (
TensorSpace := ITerm,ExtEq=IRedjoinability, B/C/W);denot_sound, adequacy separating$I$ ,$K$ ,$K_2$ . -
KernelCategory.lean —
Kernelstructure,ISAR_Kernelterminal object,ComputableISAR_Kernel,morphism_uniqueness(terminality).
-
HFSet.lean — Inductive
HFtype, AckermanntoNatbijection, membership, extensional equality, set axioms. -
HFSetEncoding.lean — Constructed Ackermann
fromNat/ ISK Gödel numbering; constructednoncomputablelayerToNat/natToLayer(min-Gödel enumeration);HF_encode/decode_layer. -
HFSetSemantics.lean — Lifts set constructors to
InvariantLayer; provesHF_encodeis a homomorphism. -
ZFCInterpretation.lean —
HF_Kernelinstance, interpretation theorem, unique factorization throughISAR_Kernel.
-
DialectKernel.lean —
Dialectstructure: encode, decode, eval, preservation law. -
ViewIndependence.lean —
ObservationalIsomorphism, No Preferred Syntax Theorem (no_preferred_syntax), reflexivity/symmetry/transitivity. -
ReverseRosetta.lean —
closure_preserved_under_reachability(forward invariance),referentially_open_requires_anchor(referential openness). -
TRSView.lean —
TTermSKI dialect,trs_encode,decode_raw,TRS_Dialect. -
BytecodeView.lean — Stack VM (
push_I,push_K,push_S,app),run,compile_decompileidentity,Bytecode_Dialect. -
QuantityKernel.lean — 4-layer quantity algebra,
QuantityKernel : Kernel; namedQuantity ≃ Natbridge (String/FloatblockEncodable). -
ViewUnification.lean —
AdmissibleDialect,KernelIsomorphism, Universal Factorization Theorem (universal_factorization_theorem). -
Futamura.lean — Subst-layer mix;
PESetup2nd/3rd projections;TrivialPE(¬Nontrivial), fragmentOptimizingPE, and onlineJGS_PEfor the fullIStepsignature (provedNontrivial). Not 1993 polyvariant mix.
-
ISARMatrices.lean —
$4 \times 4$ integer matrices,$I^2 = I$ (idempotency),$(IRAS)^2 = 0$ (nilpotency), gauge equivalence$P K_1 P^{-1} = K_2$ . -
InvariantLayer.lean —
LinearIKTerm,dupCount,cd_size_lt_LinearIK,sufficient_fuelcertificate andsufficient_fuel_correct. -
KernelCategory.lean —
ComputableISAR_Kernel_Optimalwith optimal fuel certificate.
- ISARApproximation.lean — Named analytic axiom
ISAR_UAT(Leshno-style, not proved) plus named completion/embedding axioms.KernelAddresshas no metric;KernelAddressLimitis not MathlibMetric.Completion. Frozen pending a metric.
LinearIKTerm Property |
HVM2 / Interaction Net Concept |
|---|---|
LinearIKTerm predicate |
Linearity constraint (no nested duplicator nodes) |
dupCount t = 0 |
Pure linear fragment, |
dup operator |
Duplicator / fan node |
Complete development cd
|
Parallel reduction layer |
cd_size_lt_LinearIK |
Size decrease, termination |
sufficient_fuel_correct |
Max interaction bound |
| Relational |
Port linking |
Two computable reduction strategies, both sound w.r.t. the proved IStep relation:
| Strategy | File | What it does |
|---|---|---|
cd (parallel) |
Eval.lean |
Complete development: contracts every redex in one pass. Iterated via cd_loop_fuel. |
step? (LO) |
Reduce.lean |
Leftmost-outermost single step. reduceFuel iterates it. Proved sound: step? t = some u → IStep t u. |
# In-Lean #eval / #guard (compile-time checked):
lake env lean src/ISAR/Eval.lean # cd strategy goldens
lake env lean src/ISAR/Reduce.lean # step? strategy goldens
# CLI golden suite (both strategies, printed NF + step count):
lake env lean --run Main.lean
# Reduce a single term (S-expression, atoms: I K S B C D):
lake env lean --run Main.lean --term "((S K) K) I"
# Host congruence check (Python step must match Lean NF):
python host/congruence.py
# λ dialect: Turner → IStepBasis (dupβ/swapβ) → IStep (gold):
python host/lambda_dialect.py
python host/lambda_dialect.py --term "((\\x. \\y. (y x)) S) I"
python host/lambda_congruence.pyPipeline: familiar \x.e → Turner degenerate collapse → IStepBasis-only preprocess (dialect) → IStep reduce (kernel). C/W are compile alphabet; their β fires in the dialect pass, not as a second kernel. Lean abstract0 is a weaker proved compiler (simulation theorems), not this dialect’s authority — congruence is observational on applied NFs.
| Layer | What | Source of truth |
|---|---|---|
| Carriers | I,R,A,S 4×4 matrices |
ISARMatrices.lean, kernel.py |
| Gauge | K1_K2_gauge_equiv |
ISARMatrices.lean, ISARBridge.lean |
| Ops → terms | term_signature_val (norm→I1, s→S1, konst→K1, dup→A1, swap→R1, comp→0) |
BasisCompleteness.lean |
| Quotient fragment | ISK only (norm, konst, sₛ, app) on ISKSubtype |
InvariantLayer.lean |
| Full surface syntax | + dup, swap, comp, var | Kernel.lean |
Main reduce IStep |
I/K/B/S β + appL/appR — no dupβ/swapβ | Kernel.lean |
| Operator basis | IStepBasis adds dupβ, swapβ; derived_s recovers S |
Kernel.lean, TensorSemantics.lean |
- Not Lafont interaction nets. No δ/ε/γ annihilation. "Interaction-looking" is analogy for the BCKW-style agents; the formal alphabet is ISK (quotient) / ISKWBCS (syntax).
- plex-shell is parked. No kernel work, no emit/cogen claims from that tree. The ISAR kernel lives here in
isar-proofs. - No cogen/emit product.
cdandstep?are interpreters. Future cogen targets are projections of the Invariant Layer quotient; they are not in this slice.
git clone https://github.com/cypoe/isar-proofs.git
cd isar-proofs
lake buildBlueprint (PDF + HTML):
cd blueprint
latexmk -pdf src/print.tex # twice to resolve cross-refs
plastex -c src/plastex.cfg src/web.texOr via Docker (no local LaTeX install):
docker run --rm -v "${PWD}:/doc" -w /doc/blueprint/src texlive/texlive xelatex print.texValidate all 87 blueprint declarations against the Lean source:
lake exe checkdecls blueprint/lean_decls- Phase 1: story.md
- Phase 2: hf_story.md
- Phase 3: reverse_rosetta_story.md
Session record and Python/Lean kernels for D-finite certificates under integral / sum / product closure, with theorem-backed refusal of general composition.
- Session: docs/holonomic_closure_and_isar_session.md (§12 Lean status)
- Python: scratch/isar_holonomic_closure_algebra.py —
python scratch/isar_holonomic_closure_algebra.py - Lean:
ISAR.Holonomic,ISAR.HolonomicClosure,ISAR.HolonomicInstances,ISAR.HolonomicCompose