Skip to content

Commit fa1b37a

Browse files
hyperpolymathclaude
andcommitted
docs(proof): PROOF-NEEDS §5 — ground-truthed L1 status + closure plan + foundation audit (2026-06-16)
Add a dated status+plan section (§5) recording the coqc/grep-verified state of the four L1 admits (region_shrink dissolves via tropical carrier; region_liveness false→repaired; step_pop = the 9-case eliminator fork; preservation_l1 capstone), the committed choreographic-tropical closure route, the Idris2 ABI proof-needs axis (E1–E6, E5 highest-leverage), the foundation trust-audit GO, and two threatened CI gates. Also corrects a real main-wide count drift surfaced by the sweep: step_pop carries an outer Admitted on main too, so formal/ holds 5 outer Admitted (1 legacy + 4 L1), not the 4 the §4 status-gate marker + prose claimed. Marker 4→5 and the per-file table row 3→4 corrected to match coqc/grep ground truth; §5.2 is now authoritative for current line numbers. The companion fix/proof-gates PR repairs + wires the gate. Companion plan docs (L1-REGION-REFOUNDATION-PLAN.md, L1-ELIMINATOR-FORK.md) are in PR #299. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5ed0141 commit fa1b37a

1 file changed

Lines changed: 158 additions & 6 deletions

File tree

PROOF-NEEDS.md

Lines changed: 158 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,17 @@ to the owner**:
238238
## §4. Counts + file-by-file map
239239

240240
<!-- status-gate marker: do not move. scripts/status-gate.sh reads this line. -->
241-
Coq admitted proofs remaining: 4
241+
Coq admitted proofs remaining: 5
242242

243243
(1 outer `Admitted.` in `formal/Semantics.v` — sacrosanct legacy
244-
preservation, provably false per `Counterexample.v` + 3 outer
245-
`Admitted.` markers in `formal/Semantics_L1.v` covering 5 internal
246-
`admit.` cases — all pre-existing L1 structural debt + parallel
247-
mirrors. See the per-file table and seam audit below.)
244+
preservation, provably false per `Counterexample.v` + **4** outer
245+
`Admitted.` markers in `formal/Semantics_L1.v` — the four open L1 lemmas
246+
`region_shrink` / `region_liveness` / `step_pop` / `preservation_l1`.
247+
**Corrected 2026-06-16 from `4`: the marker and the per-file table below were
248+
written 2026-06-01, predate the `step_pop_disjoint_from_type_l1` outer marker,
249+
and had drifted by one against `coqc`/grep ground truth. §5.2 carries the
250+
authoritative current line numbers and the internal-`admit.` breakdown; the
251+
2026-06-01 seam-audit line numbers below are superseded by it.**)
248252

249253
### Per-file Qed / Admitted summary (as of 2026-06-01)
250254

@@ -256,7 +260,7 @@ mirrors. See the per-file table and seam audit below.)
256260
| `formal/Counterexample_L2.v` | **5** | 0 | ✅ Phase 4c soundness-gap witness — fresh-region scope crossing (`v_typed_at_empty`, `outer_typed`, `e_before_typed`, `e_step`, `e_after_untypable`) |
257261
| `formal/Counterexample_L2_nested.v` | **5** | 0 | ✅ Phase 3b soundness-gap witness — nested TFunEff (analogue structure to `Counterexample_L2.v`) |
258262
| `formal/TypingL1.v` | **2** | 0 | ✅ active — L1 judgment, modality-indexed |
259-
| `formal/Semantics_L1.v` | **37+** | **3** | ✅ active — Phase 3b Stage 1a + 1b landed via PRs #252 + #253. 3 outer `Admitted.` markers cover 4 internal `admit.` cases. See seam audit below for current line numbers. |
263+
| `formal/Semantics_L1.v` | **37+** | **4** | ✅ active — Phase 3b Stage 1a + 1b landed via PRs #252 + #253. **4** outer `Admitted.` markers — the four open L1 lemmas (`region_shrink` / `region_liveness` / `step_pop` / `preservation_l1`). **Corrected 2026-06-16 from `3` (the `step_pop` marker was missed). §5.2 has the authoritative current line numbers + the 13 internal `admit.` cases; the 2026-06-01 line numbers in the seam audit below are superseded.** |
260264
| `formal/Modality.v` | **1** | 0 | ✅ active — L2 core, zero axioms (`linear_to_affine`) |
261265
| `formal/Echo.v` | **12** | 0 | ✅ active — L3 calculus mechanised |
262266
| `formal/TypingL2.v` | **10** | 0 | ✅ active — `weaken_modality` (+ Affine_id + 3 `_le_*` variants), `preservation_l2_via_l1` (conditional on `preservation_l1`), `linear_value_retype_l1_m`, and 3 β-case lemmas (`preservation_l2_app_eff_beta_linear`, `_ground_nonlinear`, `_tfuneff` conditional on Stage 1b side conditions). NOT a wrapper. |
@@ -324,6 +328,154 @@ are all `admit.`-free.
324328

325329
---
326330

331+
## §5. Closure plan + current-branch state + foundation audit (2026-06-16)
332+
333+
> This section is a dated **status + plan** snapshot. It does **not**
334+
> supersede §1–§4 (which track `main`); it records (a) the authoritative
335+
> ground-truthed admit set on the current proof branch, (b) the committed
336+
> closure route, and (c) the independent trust audit of the foundation
337+
> repos the route builds on. Sourced from a ground-truth sweep
338+
> (`coqc`/`grep`-verified, not doc-trusted), not from prose.
339+
>
340+
> **Companion design docs** `L1-REGION-REFOUNDATION-PLAN.md` and
341+
> `L1-ELIMINATOR-FORK.md` (referenced below) live in **PR #299**
342+
> (branch `docs/l1-closure-research`), pending merge to `formal/`. The
343+
> tropical applicability case study is `tropical-resource-typing` PR #21
344+
> (`docs/applications/ephapax-l1-regions.adoc`).
345+
346+
### 5.1 Current proof branch
347+
348+
Branch `proofs/l1-effect-typing-Aprime` (A′ effect-typed-only lambdas).
349+
**A′ closes 0 of 4 L1 admits** — the open obligations are region/eliminator
350+
cases, not lambda-rigidity cases — so its adoption-vs-revert disposition is
351+
still open (it is groundwork for the choreographic `S_App_Step2` case, not a
352+
closure).
353+
354+
All four L1 lemmas (`region_shrink`, `region_liveness`, `step_pop`,
355+
`preservation_l1`) each carry an outer `Admitted.` on **both** this branch
356+
**and `main`** (`step_pop_disjoint_from_type_l1` is present on `main` too, at
357+
`Semantics_L1.v:3178`/`:3433`). So `formal/` holds **5 outer `Admitted.`**
358+
(1 legacy + 4 L1) on main — **but the §4 `status-gate` marker reads `4` and
359+
the §4 prose says "3 outer `Admitted.` in `Semantics_L1.v`": both are stale by
360+
one** (the true `Semantics_L1.v` count is 4 outer markers, → 5 with the
361+
legacy). This is a real **`main`-wide** drift, not branch-local — and exactly
362+
the drift the **broken + unwired** `status-gate` (see §5.7) was supposed to
363+
catch but couldn't. §4's marker is corrected to `5` in this PR; the companion
364+
`fix/proof-gates` PR repairs the script (`//``#`) and wires it into CI so
365+
future drift is flagged. (A′ shifts the line numbers but not the count.)
366+
367+
### 5.2 The four L1 admits — authoritative classification (this branch)
368+
369+
| # | Lemma | Site (this branch) | Internal admits | Class | Closes via |
370+
|---|---|---|---|---|---|
371+
| 1 | `region_shrink_preserves_typing_l1_gen_m` | `Semantics_L1.v:441` | `:572`, `:642` | **live structural** (list-vs-multiset tear) | **Dissolves** — carrier refactor `region_env : list` → count-map. `L1-REGION-REFOUNDATION-PLAN.md` |
372+
| 2 | `region_liveness_at_split_l1_gen` | `Semantics_L1.v:1904` | `:1956`, `:1976` | **provably FALSE** as written (witness `ERegion rv (EI32 5)` at `R=[rv]`) | **Repaired** — restate as graded `live R rv ∧ no-exit-of-rv ⇒ live R' rv`; prove from `count_occ_le_l1_m` monotonicity + ~13-site call audit. `L1-REGION-REFOUNDATION-PLAN.md §5` |
373+
| 3 | `step_pop_disjoint_from_type_l1` | `Semantics_L1.v:3106` | **~9–11** across every eliminator/erasing context (`S_App_Step2`, `S_Pair_Step2`, `S_Inl/Inr_Step`, `S_Case_Step`, `S_Let_Step`, `S_Region_Step`) — all blocked on the §4.8 lambda-rigidity gap | **the eliminator fork** | **Open research** — choreographic typing across time segments, used foundationally. `L1-ELIMINATOR-FORK.md` |
374+
| 4 | `preservation_l1` (capstone) | `Semantics_L1.v:3367` | `:3379` | **gated** on 1–3 | follows once 1–3 land |
375+
376+
`preservation_l3` (`Semantics_L1.v`, **Qed**) is real and depends on **only**
377+
admit #1 (`region_shrink`); it flips **unconditional** the moment #1 closes.
378+
`L4.v` is **scaffold-unbuilt** (`ProgramMode` + round-trip mapping;
379+
definitions only, no theorems — not debt, just not yet built). No hidden 5th
380+
admit, no `Axiom`/`Parameter`/`Hypothesis` smuggled assumption, no fake-`Qed`
381+
was found anywhere in `formal/*.v`.
382+
383+
### 5.3 Idris2 ABI proof needs (a separate axis from the Coq L1 admits)
384+
385+
`src/abi/Ephapax/ABI/Invariants.idr` states six compiler-correctness
386+
invariants as **erased (0-quantity) postulates**, each an explicit *owed*
387+
forward to a discharging proof:
388+
389+
| ID | Invariant | Status |
390+
|---|---|---|
391+
| E1 | Type preservation (operational) | **owed** — forwards to Coq `preservation` (legacy is false; real obligation is `preservation_l1`) |
392+
| E2 | Linear consumption across control flow | E2a position-form **DISCHARGED** (`splitLinearCoverage`, Qed, `Formal/Qualifier.idr`); E2b control-flow form **owed** |
393+
| E3 | No region escape | static/type-level **DISCHARGED** (`noEscapeTheorem`, Qed, `Formal/RegionLinear.idr`); operational form **owed** |
394+
| E4 | No runtime GC | **owed + flagged**`noGCExtract` is a **tautological/vacuous wrapper** (returns inputs unchanged), not a proof |
395+
| E5 | WASM compilation correctness | **owed — no formalisation exists** (Rust backend only). Highest-leverage compiler-correctness gap; enables `compileOkImpliesWasmTyped` in `Foreign.idr` |
396+
| E6 | IR (S-expr) lowering correctness | **owed — no formalisation** |
397+
398+
Real Idris Qed proofs verified clean (no `believe_me`/`assert_total`/holes):
399+
`splitLinearCoverage`, `noEscapeTheorem`, `orthogonalityLemma`,
400+
`compileResultRoundTrip`, `outlivesTransitive`. Both `abi-verify.yml` and
401+
`coq-build.yml` are hard CI gates (`idris2 --build`; `coq_makefile` +
402+
`Print Assumptions` on the Phase-D top-level results).
403+
404+
### 5.4 Committed closure route (owner-committed 2026-06-16)
405+
406+
1. **Clean win (deterministic):** tropical carrier refactor → dissolves #1,
407+
repairs the false #2, then flips `preservation_l3` unconditional.
408+
**Net 4 → 2 admits, 0 false lemmas.** (`L1-REGION-REFOUNDATION-PLAN.md`.)
409+
2. **Deciding experiment (cheap, do before the general theory):** the minimal
410+
`EDrop (EVar j : TString rv)` choreography over two segments — does subject
411+
reduction carry liveness through `S_Region_Exit rv` coherently, or relocate
412+
it into a projection-coherence side-condition? (`L1-ELIMINATOR-FORK.md §6`.)
413+
3. **If green → choreographic-foundational re-derivation:** region liveness as
414+
a tropically-graded choreography across time segments (regions = session-
415+
typed resources, scopes = segments, preservation = subject reduction).
416+
Closes #3**2 → 0**, and likely gives **L4** its dyadic (2-party
417+
choreography) structure for free — one foundation, all four layers.
418+
419+
### 5.5 Foundation trust audit (2026-06-16) — GO
420+
421+
The route reuses proofs from three sibling repos. An independent ground-truth
422+
audit (cold rebuilds + kernel/flag probes, not doc-trust) cleared all three —
423+
the owner's "did an LLM let a blank/sorry through?" concern **did not
424+
materialise**:
425+
426+
* **`epistemic-types`** (Agda 2.8.0) — **trustworthy/GO.** `agda
427+
--no-libraries … All.agda` exit 0; `-W error` still exit 0; `--safe`
428+
*proven enforced* (postulate-injection probe rejected, exit 42); zero
429+
escape hatches; zero orphans. Caveat: its `EchoBridge` is a deliberate
430+
scaffold (grade plumbing, no proven graded-loss laws).
431+
* **`tropical-resource-typing`** (Lean 4.13.0) — **trustworthy/GO (strongest).**
432+
Cold `lake build` exit 0 ×2; kernel `#print axioms` on all 17 load-bearing
433+
results → only `propext`/`Quot.sound` or none (**no `sorryAx`, no
434+
`Classical.choice`**). Every lemma the route reuses is non-vacuous.
435+
* **`echo-types`** (Agda 2.8.0) — **trustworthy/GO, build on the WIRED layer
436+
only.** 164 wired files (`--safe --without-K`, exit 0, zero postulates) vs
437+
15 orphaned (~8%). Three caveats: (a) the **one** real postulate lives in
438+
the orphaned, exempted exploratory `EchoImageFactorizationPropPostulated.agda`
439+
(honest quarantine, imported by nothing); (b) the experimental
440+
`echo-additive` **variance** suite is **orphaned + RETRACTED (R-2026-05-18)**
441+
and `VarianceGate.agda` self-declares "NO proven theorems" — **do not cite
442+
variance as proven**; (c) two dangling `libraries` configs cause false
443+
"name not found" failures — fix before handing off.
444+
445+
### 5.7 Gate integrity — threatened (surfaced 2026-06-16, NOT yet fixed)
446+
447+
Two CI-gate findings threaten the "is it proved?" guarantee and are
448+
recorded here so they are not lost (no fix applied — surfaced for decision):
449+
450+
* **`coq-build-gate` is implemented but NOT a *required* status check.**
451+
`.github/settings.yml:113-118` requires only `hypatia-scan` + `codeql`;
452+
the always-on `coq-build-gate` aggregator (PR #254) is not in
453+
`required_status_checks`. **Consequence: a new `Admitted.`/`Axiom`, or a
454+
proof that fails `coqc`, could merge to `main` undetected.** This is the
455+
single highest-priority gate fix.
456+
* **`scripts/status-gate.sh` is doubly dead:** (a) line 3 is a `//` C-style
457+
comment (should be `#`) → the script is syntactically invalid and aborts
458+
immediately (a delimiter bug, fixable without touching the owner string);
459+
(b) it is wired into no CI workflow (only `just status-gate`). So the
460+
"Coq admitted proofs remaining: N" drift check in §4 never runs in CI —
461+
which is also why the §5.1 count drift (4 vs 5 on this branch) was never
462+
flagged automatically.
463+
464+
(Lower-severity: `scorecard-enforcer` defaults the parsed score to `0` on a
465+
malformed SARIF → possible false-fail; `boj-build.yml` `continue-on-error`
466+
is acceptable for an external service.)
467+
468+
### 5.6 Bottom line
469+
470+
ephapax's remaining proof work = the 4 L1 admits (→ 2 by the deterministic
471+
clean win, → 0 if the eliminator-fork experiment goes green) + the unbuilt L4
472+
+ the owed Idris ABI obligations (E1, E2b, E3-operational, E4, E5, E6, with
473+
E5 the highest leverage). The legacy `Semantics.v preservation` is **not
474+
debt** — it is a deliberate, witnessed false result. The plan is staged,
475+
ground-truthed, and the foundation it builds on is independently verified.
476+
477+
---
478+
327479
## Cross-references
328480

329481
* [`STATUS.adoc`](STATUS.adoc) — past / present / future temporal map.

0 commit comments

Comments
 (0)