Skip to content

Commit 231aa19

Browse files
hyperpolymathclaude
andcommitted
docs(proof-needs): record second blocker (all/foldMap reduction wall)
Followup to the Q1-C pilot finding: attempting to close equivTrans on the same branch revealed a second, independent structural problem. `all p (x :: rest)` does NOT reduce to `(p x && all p rest)` by Refl in Idris2 0.8.0. The `all` definition elaborates through `foldMap @{All}` and even though foldMap's default body is foldr- based, the elaborator produces a foldl-shaped term that no straightforward rewrite can directly destructure into the textbook &&-chain. Empirical witness: `example : all p (x :: rs) = (p x && all p rs); example = Refl` fails to typecheck. Consequently the primitive-eq axioms (Blocker 1) UNBLOCK leaf-level reflexivity (equivRefl) but cannot bridge the foldMap-shaped reduction wall (Blocker 2). equivTrans / cnoWriteSameContent / the 7 Operations reversibility theorems remain frozen. Three closure paths for Blocker 2 documented (all owner-decision): 1. Replace equiv with a structural myAll-based definition. 2. Prove allCons : all p (x :: rs) = (p x && all p rs) via foldl lemmas. 3. Migrate equiv to propositional Data.List.Quantifiers.All. No source changes; documentation honesty only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8af2f7a commit 231aa19

1 file changed

Lines changed: 48 additions & 29 deletions

File tree

PROOF-NEEDS.md

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -110,42 +110,61 @@ primitive-eq blocker as the Cat-B set above. Each requires showing
110110
that the post-operation precondition holds, which reduces to
111111
`(p == p) = True` on opaque `Path` — blocked.
112112

113-
#### Priority 2 — primitive-eq groundwork (foundational, owner-decision required)
114-
115-
Every remaining tractable hole reduces to a `(s == s) = True` step on
116-
opaque `String` or `Bits8` — Idris2 0.8.0 only reduces these on
117-
literals. `DecEq Path` does NOT help because it transitively depends
118-
on `DecEq String`, which itself depends on primitive `==`.
119-
120-
Three closure paths, each requiring owner sign-off:
121-
122-
1. **Add `String` / `Bits8` reflexivity axioms** — `axStringEqRefl :
123-
(s : String) -> (s == s) = True := believe_me Refl`, gated by CI
124-
allow-list (per the Cat-D `believe_me` pattern). Smallest change,
125-
but introduces `believe_me` into the proof system which prior
126-
sessions explicitly avoided.
127-
2. **Migrate `Path` to a structural representation** — replace
128-
`String`-component paths with `Nat`-encoded interned identifiers.
129-
`Nat == Nat` IS reducible on opaque values. Bigger migration but
130-
no `believe_me`.
131-
3. **Reformulate every blocked theorem to use `decEq`-style branches**
132-
rather than `==`-style booleans. Avoids touching the `Eq` instance
133-
but ripples through ~20 theorem statements.
134-
135-
Until one path is chosen, the following holes are **frozen**:
136-
137-
- `equivReflProof` (Model.idr:216)
138-
- `equivTransProof` (Model.idr:244)
113+
#### Priority 2 — TWO blockers (primitive-eq UNBLOCKED; `all`/`foldMap` still blocked)
114+
115+
Status as of the 2026-06-02 PM Q1-C pilot (PR #133):
116+
117+
**Blocker 1 (primitive-eq) — UNBLOCKED.** The pilot adds
118+
`axStringEqRefl` + `axBits8EqRefl` in `Filesystem.Axioms` with a CI
119+
allow-list guard. `equivReflProof` closed as proof-of-concept. The
120+
axioms are operationally true and gated; soundness audit trail
121+
preserved via the `IDRIS2_AXIOMS.a2ml` registry.
122+
123+
**Blocker 2 (`all`/`foldMap` reduction) — DISCOVERED.** Attempting to
124+
close `equivTrans` in the same session revealed a second, independent
125+
problem: **`all p (x :: rest)` does NOT reduce to `(p x && all p rest)`
126+
by `Refl` in Idris2 0.8.0.** The `all` definition elaborates through
127+
`foldMap @{All}` — even though `foldMap`'s default body is `foldr`-
128+
based, the elaborator produces a `foldl`-shaped term that neither
129+
`Refl` nor any straightforward rewrite can directly destructure into
130+
the textbook `&&`-chain. Empirical witness:
131+
`example : all p (x :: rs) = (p x && all p rs) ; example = Refl`
132+
fails to typecheck — the unifier reports
133+
`foldl ... (neutral <+> p x) rs` on one side, `p x && Delay (all p rs)`
134+
on the other.
135+
136+
Consequently, **`equivTrans`, `cnoWriteSameContent`, and the 7
137+
reversibility theorems** are still blocked. The primitive-eq axioms
138+
unblock the LEAF reflexivity step but cannot bridge the foldMap-shaped
139+
reduction wall.
140+
141+
Three closure paths for blocker 2 (owner-decision required):
142+
143+
1. **Replace `equiv` with a structural `myAll`-based definition** that
144+
reduces by `Refl`. Touches the `equiv` shape but contained to
145+
`Model.idr`. Probably 1 PR.
146+
2. **Prove `allCons : all p (x :: rs) = (p x && all p rs)` via a chain
147+
of `foldl` lemmas**`foldlAndAccTrue` + `foldlAndFalseStays` +
148+
careful with-clauses. Pure mathematics but ~50 lines of fiddly
149+
proof engineering against an opaque elaboration order.
150+
3. **Migrate `equiv` to a propositional `All`-based shape** (via
151+
`Data.List.Quantifiers.All`) — cleanest mathematically but ripples
152+
through every call-site of `equiv`.
153+
154+
Until one of these lands, the following holes remain frozen even with
155+
the axiom infrastructure live:
156+
157+
- `equivTransProof` (Model.idr:353)
139158
- `cnoWriteSameContentProof` (Operations.idr:254)
140159
- 4 `?XXXPrfAfter` sub-holes in Operations.idr
141160
- 7 reversibility theorems in Operations.idr (mkdirRmdir, rmdirMkdir,
142161
touchRm, rmTouch, writeFile, operationIndependence,
143162
cnoWriteSameContent)
144163

145164
Separately, `undoRedoIdentityProof` and `undoRedoCompositionProof`
146-
need a Cat-A redesign (missing `isReversible op = True` precondition;
147-
provably refuted for non-reversible `op`) before primitive-eq is even
148-
relevant.
165+
still need a Cat-A redesign (missing `isReversible op = True`
166+
precondition; provably refuted for non-reversible `op`) before either
167+
blocker is relevant.
149168

150169
#### Priority 3 — Tier-S foundational (research-level)
151170

0 commit comments

Comments
 (0)