Skip to content

Add bidirectional RP/RF switching lemma over StrongURP #500

In review

Description

@MarcIlunga

Background

How can adaptive CC proofs over a bidirectional ideal permutation StrongURP X (such as sponge indifferentiability, ideal-cipher constructions, and bidirectional RP/RF hybrids) switch cleanly from StrongURP X to a lazy with-replacement bidirectional random function within C(q, 2) / |X| via equivalence as games (≡g), while also exposing exact transcript probability formulas 1 / (|X|)_k and 1 / |X|^k for direct H-coefficient proofs?

Commons.Definitions.LazyPermutation presents the forward-only URP lazily, and Commons.Definitions.CollisionBound bounds one-way URF collisions, but no bidirectional counterpart exists for StrongURP X on Bidirectional X q. Providing Commons.Definitions.BidirectionalSwitching supplies both the reusable 2-hop switching lemma (StrongURP ≈ LazyBidirectionalRF within C(q, 2) / |X|) and the exact partial-bijection transcript mass formulas.

Proposed change

Add Commons.Definitions.BidirectionalSwitching (src/Commons/Definitions/BidirectionalSwitching.lean, exported from src/Commons.lean):

  1. Lazy StrongURP presentation and exact partial-bijection counting:
    • Define partial-bijection table helpers (lookupForward, lookupInverse, IsPartialBijection, Agrees, completions, unusedOutputs, unusedInputs) and lazyStrongURP X q, proving lazyStrongURP_eq_strongURP : lazyStrongURP X q = StrongURP X (q := q).
    • Prove strongURP_mass_of_bijective_table: any admitted transcript whose consistent permutations are characterized by a partial bijection of length k has exact StrongURP mass 1 / (|X|)_k.
  2. Lazy with-replacement bidirectional random function and rejection-coin game:
    • Define LazyBidirectionalRF X q : TypedSystem (Bidirectional X q) and its collision-monitoring game lazyBidirectionalRFGame X q with lazyBidirectionalRFGame_visible : (lazyBidirectionalRFGame X q).visible = LazyBidirectionalRF X q.
    • Define strongURPRejectionGame X q : TypedGame (Bidirectional X q) (draws uniformly from X on fresh queries, resamples from the unused set on collision and sets the MBO) with strongURPRejectionGame_visible : (strongURPRejectionGame X q).visible = StrongURP X (q := q).
    • Prove exact equivalence as games (strongURPRejectionGame_gameEquivalent_lazyBidirectionalRFGame) and exact unset transcript mass 1 / |X|^k (lazyBidirectionalRF_unset_mass).
  3. Adaptive winning and CC switching bounds:
    • Prove lazyBidirectionalRFGame_win_le and strongURPRejectionGame_win_le (≤ C(q, 2) / |X|).
    • Prove strongURP_dist_lazyBidirectionalRF_le : Δ (StrongURP X (q := q)) (LazyBidirectionalRF X q) ≤ ENNReal.ofReal ((q.choose 2 : ℝ) / Fintype.card X), strongURP_attach_dist_lazyBidirectionalRF_le (Δ, •), and strongURP_substitutesWithin_lazyBidirectionalRF (≃[...]).

Acceptance criteria

  • Tests.BidirectionalSwitching verifies:
    • Visible-system equalities, exact 2-edge mixed forward/inverse transcript masses (1 / 56 vs 1 / 64), and Δ ≤ 6 / 8 on Fin 8 (q = 4).
    • Keccak 1600-bit (ByteState 200) switching distance, converter attachment, and ≃[...] corollaries.
    • cc_normalize and cc_calc statistical compatibility under CC custom notation (Δ, •, ≫, ≃[...]).
    • #print axioms on all 11 exported theorems confirming dependence only on propext, Classical.choice, and Quot.sound.
  • lake build --wfail, scripts/check-sources.sh, scripts/check-axioms.sh, and lake env lean -Dweak.linter.mathlibStandardSet=true pass with zero warnings.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions