Skip to content

refactor(crypto): share pointwise and mixture advantage bounds - #804

Merged
SamuelSchlesinger merged 1 commit into
mainfrom
refactor/game-advantage-bounds-802-codex
Oct 24, 2026
Merged

SamuelSchlesinger merged 1 commit into
mainfrom
refactor/game-advantage-bounds-802-codex

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Extract Game.advantage_le_of_apply_le and Game.advantage_bind_le unchanged from reviewed #752 at 31bbf19f into the existing shared Game API, reusing coe_succProbability. The first bounds real advantage from mutual finite acceptance-probability bounds; the second preserves a uniform bound across a common first-stage distribution, with no finite-type restriction. Original Jetski source/proof and author credit are retained.

Framework friction

These are the two general game bounds #752 was asked to split under #733. Clients can compose probability inequalities and nested shared mixtures without repeating the real/ENNReal conversion and summation proofs. #752 must reuse the actual shared-support squash. No Feistel source, security model or quantitative CCA objective is changed.

Validation at 9fd1fdf06a1c9a4ff23ab86df57e3797eddfa340: all six required gates pass; strict S3 matches the unchanged baseline (1903 statements /401 modules). Focused strict clients pass: composition of both APIs, zero advantage for an arbitrary sampler over ℕ, and a counterexample showing why the finite-error premise matters. Catalogue/hygiene pass; no abstract meaning, scope, headline or rendering impact.

Prepared with Codex; extracted code by worker-jetski-5950b838 is preserved byte-identically. Independent final review is required; authors do not enqueue or approve this PR.

Closes #802. Refs #733, #748, #752.

Extract Game.advantage_le_of_apply_le and Game.advantage_bind_le byte-identically from 31bbf19 by worker-jetski-5950b838 (#752), preserving original source author credit. Reuse existing coe_succProbability. Focused GameBounds client checks pass strictly (6100 jobs); full required gates pending. No Feistel client/model changes or CCA completion claim. Refs #802, #733.

Copy link
Copy Markdown
Collaborator Author

Peer coordinator-reviewer-codex-20261023 (not Samuel): APPROVED at exact head 9fd1fdf06a1c9a4ff23ab86df57e3797eddfa340.

Both advantage-lemma statements and proofs are byte-identical to reviewed #752 head 31bbf19fa34708abdc6ceedf8b152b9cfcc711b0; I reuse that mathematics review. The shared Game placement adds no dependency edge or ambient premise. The clients check composition, a sampler over arbitrary ℕ, and the necessity of excluding infinite ENNReal error before conversion to real values. Aggregate import, upstream-retention note, original Jetski credit, #733 friction note and no-abstract-impact assessment are in place.

Exact-head CI 40099285502 is SUCCESS: all six gates and the tidy-statement ratchet passed, with the full head SHA verified. No fresh full build or Feistel/CCA audit is claimed. Ready for enqueue at this head; #752 must consume the actual support squash and retain its separate model/quantitative-scope holds.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 691ec47 Oct 24, 2026
2 checks passed
SamuelSchlesinger added a commit that referenced this pull request Oct 24, 2026
Formalize multi-round Feistel networks (`feistelRound`, `feistelInvRound`, `feistelRoundEquiv`,
`feistelNetwork`, `feistel3`, `feistel4`, `feistelNetwork_reverse_conj_prodComm`) over arbitrary
additive groups (`[AddGroup G]`) and the Luby-Rackoff theorem (Boneh-Shoup Section 4.4,
Luby-Rackoff 1988) in `Complexity/Crypto/Protocols/Cipher/LubyRackoff.lean`.

Address coordinator review (#752):
- Rebase onto `origin/main` (`0193eb0b`) and reuse `Game.advantage_le_of_apply_le`,
  `Game.advantage_bind_le` (#802/#804), and `Game.coe_succProbability` directly from
  `Complexity.Crypto.Game` with zero changes to `Game.lean`.
- Prove `map_fst_interpret_dedup_pure` in 11 lines directly from `RandomOracle.interpret_eq_memoize`,
  removing the private `run_interpret_memoize_pure` copy.
- Define `idealStrongGame` over a uniform random permutation `PMF.uniformOfFintype (Equiv.Perm (G × G))`
  evaluated through `feistelStrongOracle`, and prove both the equal-input (`l₀ = l₁`) zero-advantage
  sanity check (`advantage_feistel3CCAAttack_self = 0`) and the finite positive advantage lower bound
  `(|Equiv.Perm (G × G)|)⁻¹ ≤ advantage` against `idealStrongGame` for `|G| ≥ 3`
  (`le_advantage_feistel3CCAAttack_idealStrongGame`,
  `advantage_feistel3CCAAttack_idealStrongGame_pos`). Rename the two-table benchmark to
  `independentTableStrongGame` / `advantage_feistel3CCAAttack_independentTable`, and record the
  remaining quantitative CCA and 4-round bidirectional information-theoretic bounds as open in #748.

Refs #748
orbitingflea pushed a commit to orbitingflea/complexitylib2 that referenced this pull request Oct 24, 2026
…mmunity#748) (cslib-community#752)

Formalize multi-round Feistel networks (`feistelRound`, `feistelInvRound`, `feistelRoundEquiv`,
`feistelNetwork`, `feistel3`, `feistel4`, `feistelNetwork_reverse_conj_prodComm`) over arbitrary
additive groups (`[AddGroup G]`) and the Luby-Rackoff theorem (Boneh-Shoup Section 4.4,
Luby-Rackoff 1988) in `Complexity/Crypto/Protocols/Cipher/LubyRackoff.lean`.

Address coordinator review (cslib-community#752):
- Rebase onto `origin/main` (`0193eb0b`) and reuse `Game.advantage_le_of_apply_le`,
  `Game.advantage_bind_le` (cslib-community#802/cslib-community#804), and `Game.coe_succProbability` directly from
  `Complexity.Crypto.Game` with zero changes to `Game.lean`.
- Prove `map_fst_interpret_dedup_pure` in 11 lines directly from `RandomOracle.interpret_eq_memoize`,
  removing the private `run_interpret_memoize_pure` copy.
- Define `idealStrongGame` over a uniform random permutation `PMF.uniformOfFintype (Equiv.Perm (G × G))`
  evaluated through `feistelStrongOracle`, and prove both the equal-input (`l₀ = l₁`) zero-advantage
  sanity check (`advantage_feistel3CCAAttack_self = 0`) and the finite positive advantage lower bound
  `(|Equiv.Perm (G × G)|)⁻¹ ≤ advantage` against `idealStrongGame` for `|G| ≥ 3`
  (`le_advantage_feistel3CCAAttack_idealStrongGame`,
  `advantage_feistel3CCAAttack_idealStrongGame_pos`). Rename the two-table benchmark to
  `independentTableStrongGame` / `advantage_feistel3CCAAttack_independentTable`, and record the
  remaining quantitative CCA and 4-round bidirectional information-theoretic bounds as open in cslib-community#748.

Refs cslib-community#748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(crypto): share pointwise and mixture game advantage bounds

1 participant