Commit 69f1102
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.
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.
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.
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 7c720a2 commit 69f1102
2 files changed
Lines changed: 94 additions & 98 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
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 | 67 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 81 | + | |
86 | 82 | | |
87 | 83 | | |
88 | 84 | | |
| |||
99 | 95 | | |
100 | 96 | | |
101 | 97 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
| |||
221 | 220 | | |
222 | 221 | | |
223 | 222 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
229 | 227 | | |
230 | 228 | | |
231 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
| 112 | + | |
114 | 113 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 114 | + | |
| 115 | + | |
125 | 116 | | |
126 | 117 | | |
127 | 118 | | |
| 119 | + | |
128 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
129 | 124 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
139 | 131 | | |
140 | 132 | | |
141 | 133 | | |
| |||
213 | 205 | | |
214 | 206 | | |
215 | 207 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
229 | 212 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
242 | 216 | | |
243 | 217 | | |
244 | 218 | | |
| |||
285 | 259 | | |
286 | 260 | | |
287 | 261 | | |
288 | | - | |
289 | | - | |
| 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 | + | |
290 | 292 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
299 | 298 | | |
300 | | - | |
301 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
302 | 309 | | |
303 | 310 | | |
304 | 311 | | |
305 | 312 | | |
306 | 313 | | |
307 | | - | |
| 314 | + | |
308 | 315 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
0 commit comments