Documentation

GaudisCrypt.Lib.RO.OneWayness_GameHop.Game1

OneWayness GameHop: Game 1 reduction #

This module reduces Game 1's bad event (chal_x_queried_gh = true) to the abstract guess_experiment framework, ultimately bounding it by (q+1)/|input|.

Game 1 variants #

Correspondence (relational) #

game_1_correspondence couples the match-tracking run to the recording run with one pRHL invariant (see InvG1 below); the former Game 1' explicit-match variants and their bridge lemmas are gone.

Flag-elision (lazy ↔ tracked) #

ow_game_1_wp_eq_ow_game_1_tracked_wp_of_flag_ignoring — at flag-ignoring posts, Game 1's lazy oracle and tracked oracle are wp-equivalent. Bridges the OW theorem's "lazy" Game 1 to our "tracked" Game 1.

Body of guess_experiment_game_1: adv query + lazy_query_tracked (which internally flips chal_x_queried_gh when inp = chal_x). Doesn't use the bound target x.

Equations
Instances For

    Final of guess_experiment_game_1: oracle on response. Doesn't use the bound target.

    Equations
    Instances For

      Body recording for Game 1 bad: same shape as guess_experiment_game_1.body but appends inp (adv's query) to qs.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Final recording for Game 1 bad: the last query attempt records resp.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          body_recording_game_1 bumps queries_input.length by at most 1 per iteration.

          final_recording_game_1 bumps queries_input.length by at most 1.

          The relational correspondence #

          The match-tracking run (left: body_game_1, whose lazy_query_tracked flips chal_x_queried_gh when the query equals chal_x = t) is coupled to the recording run (right: body_recording_game_1, which appends each query to queries_input) by the invariant InvG1 below: the recording state is the tracking state with the three bookkeeping lenses overwritten; the left flag mirrors membership of the target in the recorded list; the left challenge is pinned to the target. The right flag value m is existential — the right run's lazy_query_tracked junk-flips it against tv = chal_x.get σ', and the ending overwrites it anyway.

          This one invariant replaces the entire former Game 1' apparatus (the explicit-match variants, eight bridge lemmas, the queries-input invisibility block, and two maxHeartbeats game-level conversions — see git history).

          @[reducible, inline]
          abbrev InvG1 (t tv : input) (σ₁ σ₂ : state) :

          The Game-1 coupling invariant.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            The ending: reading the tracking flag (left) returns the same boolean as the deferred membership test (right).

            Loop-body judgment: one tracking step vs one recording step.

            theorem ow_game_1_tracked_bad_le_guess_input_bound (ow_adv : GaudisCrypt.ProgramDenotation state Unit) (h_ow_adv_RO : ow_adv.inFootprint (GaudisCrypt.Lens.footprint random_oracle_state)ᶜ) (h_ow_adv_chal_y : ow_adv.inFootprint (GaudisCrypt.Lens.footprint ow_challenge_y)ᶜ) (h_ow_adv_chal_x : ow_adv.inFootprint (GaudisCrypt.Lens.footprint ow_challenge_x)ᶜ) (h_ow_adv_chal_x_queried_gh : ow_adv.inFootprint (GaudisCrypt.Lens.footprint chal_x_queried_gh)ᶜ) (h_ow_adv_queries : ow_adv.inFootprint (GaudisCrypt.Lens.footprint queries_input)ᶜ) (h_ow_adv_mass_one : ∀ (σ : state), ow_adv.wp (fun (x : Unit × state) => 1) σ = 1) (q : ℕ) (σ : state) :
            (ow_game_1_tracked ow_adv q).wp (fun (bσ : Bool × state) => if chal_x_queried_gh.get bσ.2 = true then 1 else 0) σ ≤ (↑q + 1) / ↑(Fintype.card input)

            Reduction: bad-in-Game-1 ≤ Guess(input, q+1).

            Routes via guess_experiment_game_1 → interim → collector → bound.

            Flag-elision bridge: untracked Game 1 ↔ tracked Game 1 #

            For postconditions that don't read chal_x_queried_gh, the tracked and untracked variants of Game 1 agree at the wp level.

            Flag elision at the game level: ow_game_1 and ow_game_1_tracked have equal wp's for flag-ignoring postconditions.

            Proof via the EquivModuloLens calculus: bind congruence chains compose oracle_loop_n_equiv (loop-level), lazy_query_equiv_lazy_query_tracked (final query), and set_equiv_pure (initial set chal_x_queried_gh false).