Commit b369577
fix(proofs/idris2): redesign auditTrailCompleteness as a per-insertion theorem (closes #131)
Closes the third non-theorem from the #119 Category A inventory.
Mirrors the #60 / #61 / #119A precedent: rather than discharging a
provably-false claim with `believe_me`, restate it as a structurally
honest one.
## auditTrailCompleteness (RMO.idr)
Was:
auditTrailCompleteness :
(entries : List AuditEntry) ->
(p : Path) ->
(obliterated : ObliterationProof p) ->
Elem p (map AuditEntry.path entries)
Refutable by `entries := []`: an `ObliterationProof` for any `p`
exists (just `MkObliterationProof p Clear 0 "unlink"`), yet the empty
log contains no paths. The signature said "any obliteration is in
any log" — plainly false.
Now:
auditTrailCompleteness :
(log : List AuditEntry) ->
(entry : AuditEntry) ->
(p : Path) ->
(insertedPath : AuditEntry.path entry = p) ->
Elem p (map AuditEntry.path (appendAuditEntry log entry))
auditTrailCompleteness log entry p insertedPath =
rewrite sym insertedPath in
elemMap AuditEntry.path (elemAppRightSelf log entry)
The corrected shape encodes the actual invariant: the path is
present in the post-append log *because* the entry recording it was
appended via the official `appendAuditEntry` constructor. The
`insertedPath` premise witnesses the caller's commitment that the
new entry indeed names the path we claim is logged.
## Closure path (zero new axioms)
1. `appendAuditEntry log entry` reduces to `log ++ [entry]` by
definition (already proved as `appendOnlyAuditLog : Refl`).
2. `Data.List.Elem.elemMap` lifts list membership through `map`,
giving `Elem (AuditEntry.path entry) (map AuditEntry.path
(log ++ [entry]))`.
3. A short local helper `elemAppRightSelf` proves
`Elem x (xs ++ [x])` by induction on the prefix — the lemma is
not in Idris2 0.8.0 base.
4. The `insertedPath` equality rewrites `AuditEntry.path entry` to
`p` in the goal.
## Verification
Local Idris2 0.8.0:
$ cd proofs/idris2 && rm -rf build && idris2 --build valence-shell.ipkg
1/4: Building Filesystem.Model OK
2/4: Building Filesystem.RMO OK
3/4: Building Filesystem.Operations OK
4/4: Building Filesystem.Composition OK
$ grep -c '?auditTrailCompleteness' proofs/idris2/src/Filesystem/RMO.idr
0
$ grep -c 'believe_me' proofs/idris2/src/Filesystem/RMO.idr
2 # both inside ||| doc comments; no invocations
No regressions. `--total` honoured. One hole eliminated; tree drops
from 16 to 15. PROOF-NEEDS.md inventory + closure-history table
updated to reflect the new state.
Closes #131.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a10005d commit b369577
2 files changed
Lines changed: 68 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 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 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
263 | 309 | | |
264 | 310 | | |
265 | | - | |
| 311 | + | |
| 312 | + | |
266 | 313 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
0 commit comments