Documentation

GaudisCrypt.Lib.RO.OneWayness_GameHop.Game2

OneWayness GameHop: Game 2 reduction #

This module reduces Game 2's win event to the abstract guess_experiment framework, ultimately bounding it by (q+1)/|output|.

Game 2 components #

Bridges and bound #

Length-bound helpers #

ProgramDenotation.wp_qs_length_preserved_of_inFootprint, loop_n_wp_linear_bound, body_recording_game_2_qs_length_bump, etc. — used to discharge h_qs_length_le (the |queries| ≤ q+1 hypothesis of guess_experiment_interim_wp_bound).

The relational bridge: Game 2 wins ≤ guess-experiment matched #

The two programs share their entire probabilistic structure (same prefix, same adversary loop, same final query); the guess experiment additionally maintains the write-only matched_chal_y flag. The coupling invariant is

InvM σ₁ σ₂ := ∃ b, σ₂ = matched_chal_y.set b σ₁

("the guess-experiment state is the game state with some matched-flag value on top"), and the final post is win → matched: when the game's verification succeeds (y_check = y), the experiment's final match-check fires. One rel judgment (only the ≤ direction is needed) replaces the former manual seq-descent and its body_v2/loop-conversion machinery.

Collector-based per-game instances and reductions #

For each game, define body_recording and final_recording that record guesses into the appropriate queries list, then assume the per-game inequality guess_experiment_game_X ≤ guess_experiment_interim_game_X and the length invariant. This closes the chain via: Game → guess_experiment → guess_experiment_interim → (n+1)/|T|.

Game 2 schema: shared query subprograms for body and body_recording #

For the schema-based correspondence, body_game_2 and body_recording_game_2 share a q_body_game_2 subprogram that returns the y_val value. Similarly for final.

Game 2 wins bound: combines the direct bridge with the framework bound. Routes via guess_experiment_game_2 → interim → collector → bound. Uses the schema-based correspondence (no per-game ad-hoc lemma needed).