Skip to content

Commit 5d89512

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 recording the authoritative, coqc/grep-verified state of the four L1 admits (region_shrink dissolves via tropical carrier refactor; 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 independent GO verdict from the foundation-repo trust audit (epistemic/echo/tropical), and two threatened CI gates (coq-build-gate not required; status-gate broken+unwired). Does not supersede §1–§4 (which track main). Companion plan docs live in PR #299. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5ed0141 commit 5d89512

1 file changed

Lines changed: 140 additions & 0 deletions

File tree

PROOF-NEEDS.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,146 @@ are all `admit.`-free.
324324

325325
---
326326

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

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

0 commit comments

Comments
 (0)