Commit 52fcdb6
proofs(idris2): Q5 option 3 — propositional Equiv migration (closes equivTrans)
Migrates Filesystem.Model.equiv from a boolean Foldable-backed shape to
a propositional Data.List.Quantifiers.All / Data.List.Elem.Elem shape.
Background
----------
The Q1-C pilot (PR #133) unblocked primitive-eq leaf reflexivity via 2
named axStringEqRefl / axBits8EqRefl axioms, sufficient to close
equivRefl. The same-session attempt to also close equivTrans failed:
in Idris2 0.8.0, `all p (x :: rs)` does NOT reduce to `(p x && all p
rs)` by Refl — the elaborator produces a foldl-shaped term via
foldMap @{All} that no straightforward rewrite can destructure.
Q5 option 3 (per the design report from this same session) replaces
the boolean form entirely:
```idris
data Equiv : Filesystem -> Filesystem -> Type where
MkEquiv : All (\e => Elem e (entries fs2)) (entries fs1) ->
All (\e => Elem e (entries fs1)) (entries fs2) ->
Equiv fs1 fs2
```
`Data.List.Quantifiers.All` reduces structurally on cons by definition
— no foldMap, no foldl wall.
What closes
-----------
* `equivRefl` — structural induction on entries with `Here` at the
head + `mapProperty There` for the recursive case. No primitive-eq
axioms needed.
* `equivSym` — constructor swap of the two All witnesses.
* `equivTrans` (was the open hole) — `mapProperty (\e => indexAll e
fwd23) fwd12` plus the symmetric backward direction. Closes #119
Cat-B for the equiv-trans branch.
What stays open
---------------
* `cnoWriteSameContent` — migrated signature (boolean -> propositional)
+ commented body finding: under the duplicate-keyed model the
theorem is refutable even with the propositional shape, because
`getFileContent` only constrains the FIRST entry at p. Closure needs
a "no duplicate keys" invariant on Filesystem; documented in the
comment + PROOF-NEEDS.md. NOT closed; left as a hole.
* 7 reversibility theorems in Operations.idr + 4 in Composition.idr +
3 RMO non-theorems-as-stated (filed as #129/#130/#131): unaffected
by this change.
Axiom inventory
---------------
* believe_me count in Axioms.idr: 2 (unchanged)
* IDRIS2_AXIOMS.a2ml entries: 2 (unchanged)
* CI guard `.github/scripts/check-idris2-believe-me.sh` passes
* Note: pathEqRefl / fsEntryEqRefl / entryEqRefl kept in Model.idr —
unused for Equiv now, but available for future proofs that need
leaf-level (==) = True
Hole inventory: 16 -> 14 (this PR closes equivTrans; equivRefl was
closed by Q1-C pilot).
Verified locally:
* `idris2 --build valence-shell.ipkg` exit 0 (all 5 modules clean)
* `.github/scripts/check-idris2-believe-me.sh` passes
* `grep -c '?equivTrans' Model.idr` → 0
* `grep -c '?equivRefl' Model.idr` → 0
* Model.idr has zero open ?holes
Builds on PR #133 (Q1-C pilot axiom infrastructure).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 231aa19 commit 52fcdb6
3 files changed
Lines changed: 91 additions & 127 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | 205 | | |
217 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
218 | 211 | | |
219 | 212 | | |
220 | 213 | | |
| |||
244 | 237 | | |
245 | 238 | | |
246 | 239 | | |
247 | | - | |
| 240 | + | |
248 | 241 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
253 | 252 | | |
254 | 253 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
306 | 271 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
322 | 282 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
338 | 292 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
348 | 304 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
243 | 241 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
247 | 256 | | |
248 | 257 | | |
249 | 258 | | |
250 | 259 | | |
251 | 260 | | |
252 | 261 | | |
253 | | - | |
| 262 | + | |
254 | 263 | | |
0 commit comments