Commit d348ca9
refactor(OracleReduction): generalise the lift helper; drop dead code and linter warnings
Addresses review findings on the identity-soundness / log-discard proofs. No statement changes;
both theorems remain axiom-clean.
1. Generalise the private helper and use core lemmas properly.
`OptionT_liftM_bind_fst` was hard-coded to `OptionT m` at `Type 0`, and proved by unfolding
`liftM` / `MonadLift.monadLift` / `OptionT.lift` / `OptionT.mk` through a goal-changing `show`
plus `congr 1` -- of whose six `simp` arguments five were unused. It is in fact the
`monadLift`-generic form of `bind_map_left`, so restate it for any
`[MonadLiftT m n] [LawfulMonadLiftT m n]` over arbitrary universes as `monadLift_bind_fst`,
proved by `rw [monadLift_map, bind_map_left]` (both Lean core). Shorter, strictly more general,
and it no longer depends on how `OptionT`'s lift happens to be implemented.
2. Dead code, in the region these changes own.
- Removed the ~20-line commented-out `calc` attempt below the now-proved theorem; the docstring
that referred to it ("a partial `calc` attempt is retained in comments") is already gone.
- Removed `private lemma Monad.map_of_prod_fst_eq_prod_fst`, which nothing references.
3. Linter warnings. The above removes all 8 that `lake build` reported inside the new code
(1 × `linter.style.show`, 7 × `linter.unusedSimpArgs`). The warnings remaining in
`Execution.lean` are pre-existing.
4. Comments. Replaced the "Remaining: ..." / "should equal" note in front of the closing `rfl`,
which read as unfinished work, with a statement of what the `rfl` discharges; and recorded why
the verifier-logging step needs an explicit induction rather than reusing VCV-io's
`loggingOracle.fst_map_run_simulateQ` or ArkLib's `loggingOracle.map_fst_run_simulateQ` (the
verifier's run sits under `liftM` inside `OptionT`, so its log is consumed by an `OptionT` bind
rather than a `Prod.fst` map -- six drop-in variants of those lemmas were tried and none
applies). Named the three anonymous shadowing `have`s at the end of `Verifier.id_soundness`.
Correction to the previous commit message: it says all three declarations that depend on
`Verifier.id_soundness` reach it by implicit `simp` firing and are invisible to a text search. Only
`OracleVerifier.id_soundness` does. `Verifier.seqCompose_soundness` names it outright
(`Composition/Sequential/General.lean`, `exact Verifier.id_soundness init impl`) and
`OracleVerifier.seqCompose_soundness` reaches it through that. The substantive claim is unaffected:
a library-wide `Lean.collectAxioms` sweep confirms exactly three declarations move from
`sorryAx`-tainted to clean -- `Verifier.id_soundness`, `OracleVerifier.id_soundness` (the one
silent dependent) and `Reduction.runWithLog_discard_logs_eq_run`.
Verified: `lake build` green (4135 jobs, 0 errors); `#print axioms` reports
[propext, Classical.choice, Quot.sound] for both theorems and for `OracleVerifier.id_soundness`;
no style-lint error and no build-linter warning inside the changed ranges.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 0a6d73a commit d348ca9
2 files changed
Lines changed: 31 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
424 | 418 | | |
425 | 419 | | |
426 | 420 | | |
| |||
429 | 423 | | |
430 | 424 | | |
431 | 425 | | |
432 | | - | |
433 | | - | |
434 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
435 | 431 | | |
436 | 432 | | |
437 | 433 | | |
438 | 434 | | |
439 | | - | |
440 | | - | |
| 435 | + | |
441 | 436 | | |
442 | 437 | | |
443 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
444 | 443 | | |
445 | 444 | | |
446 | 445 | | |
447 | 446 | | |
448 | 447 | | |
449 | 448 | | |
450 | | - | |
451 | | - | |
452 | | - | |
| 449 | + | |
| 450 | + | |
453 | 451 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | 452 | | |
471 | 453 | | |
472 | 454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
| |||
0 commit comments