Commit 11cbb52
refactor(OracleReduction): generic challenge-oracle reindexing; add lawful + disjoint append inclusions
Addresses review findings on the challenge-oracle append inclusions.
1. Right abstraction instead of two bespoke copies.
The two inclusions were built from four hand-written helper defs (`challengeInl/InrOn
Query/Response`) that differed only in which index map and transport lemma they used. Replace
them with one construction in `ProtocolSpec/Basic.lean`, beside `challengeOracleInterface`:
an index map `f : p.ChallengeIdx → q.ChallengeIdx` plus a transport
`∀ i, q.Challenge (f i) = p.Challenge i` induces `subSpecOfChallengeReindex`. That data
determines the lift uniquely (the transport is an equality of types), which is what makes the
induced inclusion canonical rather than merely well-typed. `seqCompose` is the intended second
client; it is not instantiated here since nothing consumes it yet.
2. `LawfulSubSpec` (the substantive gap).
`SubSpec` is pure data: on its own it does not force the lift to preserve the uniform
distribution on challenges. `LawfulSubSpec` -- `onResponse` bijective on every fibre, i.e. a
cartesian lens -- is what VCV-io requires for `evalDist_liftComp`, `probEvent_liftComp`,
`probOutput_liftComp` and `support_liftComp`, and for `lawfulSubSpec_right_add_right_add` to
carry lawfulness through the `oSpec + .` layer that `Prover.append_run` actually lifts across.
Neither inclusion had it, so `append_run` could not have fed the security proofs even once
proved. Now provided generically (`lawfulSubSpecOfChallengeReindex`, from
`challengeReindexResponse_bijective`) and instantiated on both sides; verified that
`(oSpec + [pSpecᵢ.Challenge]ₒ) ˡ⊂ₒ (oSpec + [(pSpec₁ ++ₚ pSpec₂).Challenge]ₒ)` now synthesises.
3. `DisjointSubSpec`, both orientations, matching VCV-io's
`disjointSubSpec_add_left_right` / `..._right_left`: a left-injected round index is `< m` and a
right-injected one is `≥ m`, so the two components' challenge queries cannot alias.
4. Deduplication. `challenge_append_inl` / `_inr` re-derived by `simp` what
`append_Type_castAdd` / `append_Type_natAdd` already state 320 lines up in the same file; they
are now those lemmas at the underlying round index. Conversely
`CoordinateWiseSpecialSoundness/SeqCompose.lean` was re-deriving the same transport inline as
`cast (by simp [...])`; it now cites `challenge_append_inl` / `_inr`, removing a fourth copy and
giving the lemmas real consumers.
Also: dropped the `SampleableType` `variable` line left dangling with no declarations after it, and
documented the `pSpec ++ₚ pSpec` instance-overlap (resolution picks `..._right`, as upstream does
for `spec + spec`).
Verified: `lake build` green (4135 jobs, 0 errors); `#print axioms` reports
[propext, Classical.choice, Quot.sound] for all 11 new/changed declarations; `Prover.append_run`
still resolves through `subSpec_challenge_append_left` / `_right` under `pp.explicit`; 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 4397764 commit 11cbb52
4 files changed
Lines changed: 122 additions & 56 deletions
File tree
- ArkLib/OracleReduction
- Composition/Sequential
- ProtocolSpec
- Security/CoordinateWiseSpecialSoundness
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
336 | 338 | | |
337 | 339 | | |
338 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
684 | 742 | | |
685 | 743 | | |
686 | 744 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
| 436 | + | |
436 | 437 | | |
437 | | - | |
438 | | - | |
439 | | - | |
| 438 | + | |
| 439 | + | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
| 442 | + | |
| 443 | + | |
443 | 444 | | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
463 | 450 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
485 | 467 | | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
493 | 499 | | |
494 | 500 | | |
495 | 501 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
0 commit comments