You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
proof(solo-core/idris): close preservation (#108) — total, hole-free (#120)
## What
Discharges the **Idris2 twin's `preservation`** (Phase F1.4, #108) — the
last open normative *must*. The solo core is now **hole-free on both
proof tracks** (Coq already complete + axiom-free).
## How
**`Substitution.idr`**
- `uaddAssoc` — associativity of the partial `uadd` (existential form),
by structural recursion; heads reassociate via `qAddAssoc`.
- `subst2Lemma` — two-variable `LetPair` substitution, mirroring Coq
`subst2_lemma`: two nested `substLemma0` applications (pre-shifted `u2`
under the inner binder, then `u1`), residual usages realigned via
`uaddAssoc`/`uaddComm`.
- local `coeUsage` (retype along a usage equality); export `justInj'`.
- **Module dependency inverted**: dropped the unused `import Soundness`
so `Soundness` can import `Substitution` (no cycle).
**`Soundness.idr`**
- replaced `?todo_preservation` with the full proof by induction on
`Step`, mirroring the Coq twin. Reduction cases consume `substLemma0`
(App/Case/Let) and `subst2Lemma` (LetPair); congruence cases recurse.
- the reduct term is taken **explicitly (relevant)**, exactly as
`progress` does, so the substitution lemmas receive the bound body +
substituted value under Idris index erasure. `affinePreservation`
follows as the corollary.
## Verification (in-environment, not asserted)
- `idris2 --build solo-core.ipkg` → exit 0 (8/8 modules).
- `:total` confirms `preservation`, `affinePreservation`, `subst2Lemma`,
`uaddAssoc`, `substLemma0` are all **total**.
- No holes / `postulate` / `believe_me` / `assert_total`; `%default
total` throughout.
- Coq twin recompiled fresh; `Print Assumptions preservation` /
`affine_pres` → *"Closed under the global context"* (axiom-free).
## Docs (honesty discipline)
- `proofs/STATUS.md`: Idris `preservation` row → **locally-checked**;
solo core hole-free.
- `docs/STATUS.adoc`: normative MUST met.
- `AFFIRMATION.adoc`: revision 2 (preservation moved from the open
boundary to affirmed-true).
- `docs/handoff/NEXT-SESSION.md`: redirected to the compilation axis
(wasm32 → RISC-V → typed-wasm).
- Stale "hole" comments in both modules refreshed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01BwV2DWsjkBiNP3oscimMLV
---
_Generated by [Claude
Code](https://claude.ai/code/session_01BwV2DWsjkBiNP3oscimMLV)_
---------
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
|`progress`| Idris2 `solo-core/Soundness`|**locally-checked**| Hole-free total function (no `?todo_progress`); accepted by `idris2`, package built in CI (`proofs.yml`). Phase F1.3. **Re-proven over the SEPARATED context (`Tctx`/`Uvec`) + both products (`TWith`/`TTensor`, `LetPair`) in the 2026-06-15 F1.4 design migration** — closed-term inversions now massage only the usage vector (`uaddEmpty`/`uscaleEmpty`), since the shared type context stays `TEmpty` automatically; `:total progress` confirms totality. |
63
63
|`preservation`| Coq `solo-core/SoloCore`|**machine-checked**|`Theorem preservation : Preservation.`, real `Qed`, axiom-free, via the open-context QTT substitution lemma `ht_subst`. Phase F1.4. CI: `proofs.yml` compiles it + asserts `Print Assumptions` closed (and likewise `affine_pres`). |
64
-
| `preservation` | Idris2 `solo-core/Soundness` | **statement-only** | `?todo_preservation`, **now stated over the CORRECT design** (separated context + genuine products). The OLD Idris design (split-intro `Pair` + project-elim `Fst`/`Snd`) made the same-usage statement UNSOUND (issue #93); the 2026-06-15 migration makes it provable. Proof obligation = Phase F1.4 (Idris track), #108 — the QTT substitution lemma (`htSubst` + `subst2Lemma`) lands in a companion `Substitution.idr` and is wired in here once discharged. NOT described as proved. **Progress (2026-06-19): `Substitution.idr` (in the ipkg) now carries the append-context algebra, the shape invariant (`shapeVar`/`shapeType`), `hvShift`/`htShift` (term weakening, all 14 cases), the substitution accounting algebra (`qReassoc`/`vecReassoc`/`substReassocAdd`/`substReassocMult`/`usplit3`/`uaddSplitBoundary2`), `hvSubst`, the FULL `htSubst` (the QTT substitution lemma — all 15 cases, total, hole-free), and `substLemma0` (the `subst0` corollary). The `b`-index-erasure obstruction (ADR-003) is resolved by carrying `b` as an erased implicit in `hvSubst`/`htSubst`. `idris2 --build` exits 0; the ONLY remaining hole in the whole solo-core is `?todo_preservation`. REMAINING for `preservation`: `uaddAssoc` -> `subst2Lemma` (two-variable LetPair substitution) -> the `Step`-induction. PENDING (still NOT proved).** |
64
+
| `preservation` | Idris2 `solo-core/Soundness` | **locally-checked** | **DISCHARGED 2026-06-21 (#108).** `preservation : (t : Tm) -> Has g d t a -> Step t t' -> Has g d t' a` is a total, hole-free function by induction on `Step` — `:total preservation` confirms; `%default total`, no `postulate`/`believe_me`/`assert_total`/`?hole`. Mirrors the Coq twin `preservation`: the β/projection/elimination cases consume the QTT substitution lemmas from `Substitution.idr` — `substLemma0` (App/Case/Let single-variable) and `subst2Lemma` (LetPair two-variable) — realigning the residual usage with `d` via `uadd` commutativity/associativity (`uaddAssoc`) and `uscale One`; congruence cases recurse structurally. Stated over the CORRECT design (separated context + genuine products) that made the same-usage statement sound (issue #93). The reduct term `t` is taken explicitly (relevant), exactly as `progress` does, because Idris erases the derivation's term/type indices while the substitution lemmas compute on the bound body + substituted value. `affinePreservation` follows as the Solo-kernel corollary (`:total` too). Supporting chain in `Substitution.idr` (all total, hole-free): append-context algebra, shape invariant (`shapeVar`/`shapeType`), `hvShift`/`htShift`, the accounting algebra (`qReassoc`/`vecReassoc`/`substReassocAdd`/`substReassocMult`/`usplit3`/`uaddSplitBoundary2`/`uaddAssoc`), `hvSubst`, the FULL `htSubst` (all 15 cases), `substLemma0`, `subst2Lemma`. The `b`-index-erasure obstruction (ADR-003) is resolved by carrying `b` erased. `idris2 --build solo-core.ipkg` exits 0; **the solo core is now HOLE-FREE**. CI: `proofs.yml` Idris job. |
65
65
| Small-step `step`| Coq `solo-core/SoloCore`|**definitions-only**| CBV left-to-right relation, all redex + congruence constructors. Committed in F1.1. |
66
66
| Small-step `Step`| Idris2 `solo-core/Soundness`|**definitions-only**| CBV left-to-right relation, both products: additive `SFst`/`SSnd` fire on `With` values, multiplicative `SLetPair` fires on a `Tensor` value via `subst2`; plus the echo residue rules (`SWeaken`). Consumed by the verified `progress`. Migrated 2026-06-15. |
0 commit comments