Skip to content

Commit db37c59

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 eb404ac commit db37c59

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
@@ -113,42 +113,61 @@ primitive-eq blocker as the Cat-B set above. Each requires showing
113113
that the post-operation precondition holds, which reduces to
114114
`(p == p) = True` on opaque `Path` — blocked.
115115

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

148167
Separately, `undoRedoIdentityProof` and `undoRedoCompositionProof`
149-
need a Cat-A redesign (missing `isReversible op = True` precondition;
150-
provably refuted for non-reversible `op`) before primitive-eq is even
151-
relevant.
168+
still need a Cat-A redesign (missing `isReversible op = True`
169+
precondition; provably refuted for non-reversible `op`) before either
170+
blocker is relevant.
152171

153172
#### Priority 3 — Tier-S foundational (research-level)
154173

0 commit comments

Comments
 (0)