Commit a722440
committed
fix(lean4): unblock build under v4.16.0 — drift across CNO/Fs/Lambda/StatMech
Pre-existing drift surfaced once toolchain was pinned. None of the four
files compiled under v4.16.0; downstream proofs (CNOCategory, etc.) were
unbuildable as a result. Changes:
CNO.lean
- Drop vestigial `Std.Data.{List,Nat}.Basic` imports (Std → Batteries
rename; APIs in core).
- `def` → `abbrev` for Memory / Registers / IOState / Program so List's
HAppend / Repr / BEq propagate (`seqComp` requires `++`).
- Drop `deriving Repr` on ProgramState (Memory is `Nat → Nat`, no Repr);
add `deriving BEq` instead — required by StatMech.pointDist's `s == s0`.
- Re-prove `nop_preserves_most_state`, `halt_is_cno`,
`eval_seqComp` cons case, and `cno_composition` (state_eq_trans
argument-order was reversed); these had compiled in older Lean by
accident of unfolding behaviour.
- Convert three section-marker `/-- ... -/` doc-comments at the top of
"Decidability and Complexity" into a `/-! ... -/` block (the former
is a parse error in Lean 4 when nothing follows them).
- `loadStore_preserves_memory`: deferred to `sorry` with a TODO. The
mathematics is straightforward (the operation does
`Memory.update m addr (m addr)` — the identity update) but the proof
needs an `eval_load`/`eval_store` rewrite-lemma layer to thread the
`setReg`/`getReg` round-trip through the deeply-nested match. Tracked
in `~/Desktop/proof-debt-plan.md`. NOT in the original 18-sorry brief.
FilesystemCNO.lean
- `def` → `abbrev` for Path / PermSet / FileContent / Filesystem / FsOp
(Repr / BEq derivation on FileMetadata + FileEntry needs them).
- Mark `mkdirRmdirOp`, `createUnlinkOp`, `readWriteOp`, `chmodNopOp`,
`renameNopOp`, `snapshotRestoreOp` `noncomputable` — they wrap axioms
so Lean has no executable body to emit.
LambdaCNO.lean
- `eta_expanded_id_is_cno`: original explicit β-reduction walk hit
`simp made no progress` on `if 0 == 0 then arg else LVar 0`. Replaced
with `sorry` plus a deferred-with-rationale doc comment. Folded into
the broader LambdaCNO spec rework (the spec also lacks an
`arg`-is-value hypothesis on `isLambdaCNO`).
StatMech.lean
- `noncomputable` on `entropyChange`, `boltzmannEntropy`,
`landauer_limit` (depend on real-valued axioms / `Real.log`).
- `cno_zero_energy_dissipation`: `cno_preserves_shannon_entropy` returns
the symmetric direction `H (post p P) = H P` but
`reversible_zero_dissipation` wants `H P = H (post p P)` — `.symm`.
lakefile.lean
- Drop the `lean_exe absolute_zero` target — CNO.lean defines no `main`
and the project surface is theorem verification, not a binary.
- Declare each proof file as its own `@[default_target] lean_lib` so
`lake build` actually covers all of them. Previously only `lean_lib
CNO` was declared, so the other five files were never built.
Verified: `lake build CNO FilesystemCNO LambdaCNO StatMech` is green.
QuantumCNO + CNOCategory drift handled in follow-up commits.1 parent bd7f01b commit a722440
5 files changed
Lines changed: 151 additions & 91 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | | - | |
38 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
47 | | - | |
48 | | - | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
56 | | - | |
| 66 | + | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
| |||
74 | 84 | | |
75 | 85 | | |
76 | 86 | | |
77 | | - | |
78 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
79 | 91 | | |
80 | 92 | | |
81 | 93 | | |
| |||
210 | 222 | | |
211 | 223 | | |
212 | 224 | | |
213 | | - | |
214 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
215 | 230 | | |
216 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
217 | 235 | | |
218 | | - | |
219 | | - | |
| 236 | + | |
220 | 237 | | |
221 | | - | |
222 | 238 | | |
223 | | - | |
224 | | - | |
225 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
226 | 243 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
231 | 252 | | |
232 | 253 | | |
233 | 254 | | |
| |||
256 | 277 | | |
257 | 278 | | |
258 | 279 | | |
259 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
260 | 285 | | |
261 | 286 | | |
262 | 287 | | |
263 | 288 | | |
264 | 289 | | |
265 | 290 | | |
266 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
267 | 294 | | |
268 | 295 | | |
269 | 296 | | |
| |||
308 | 335 | | |
309 | 336 | | |
310 | 337 | | |
311 | | - | |
312 | | - | |
313 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
314 | 342 | | |
315 | 343 | | |
316 | 344 | | |
| |||
350 | 378 | | |
351 | 379 | | |
352 | 380 | | |
353 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
354 | 400 | | |
355 | 401 | | |
356 | 402 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
369 | 410 | | |
370 | 411 | | |
371 | 412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | | - | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
49 | | - | |
| 49 | + | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | | - | |
116 | | - | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | | - | |
133 | | - | |
| 133 | + | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
143 | | - | |
| 143 | + | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
153 | | - | |
| 153 | + | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
169 | | - | |
| 169 | + | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
184 | | - | |
185 | | - | |
| 185 | + | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
272 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
273 | 276 | | |
274 | 277 | | |
275 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
177 | 185 | | |
178 | 186 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 187 | + | |
194 | 188 | | |
195 | 189 | | |
0 commit comments