Documentation

CslibFrontier.Computability.PCP.TwoProverGame.Seeded.Basic

Two-prover games with private verifier randomness #

A SeededGame samples a seed, sends each prover its question, and checks the answers against the sampled seed. An ordinary TwoProverGame is the special case where the seed is the question pair. The answer distributions depend only on the questions.

Main definitions #

Main results #

structure Cslib.PCP.SeededGame (R : Type u_1) (X : Type u_2) (Y : Type u_3) (A : Type u_4) (B : Type u_5) :
Type (max (max (max (max u_1 u_2) u_3) u_4) u_5)

A two-prover game with private verifier randomness: the verifier draws a seed r from seed, sends the questions query r, and accepts the answers (a, b) when accepts r a b.

  • seed : PMF R

    The distribution of the verifier's seed.

  • query : R → X × Y

    The questions sent on the seed r.

  • accepts : R → A → B → Prop

    The verifier's decision on the seed r and the answers.

def Cslib.PCP.SeededGame.AcceptsRound {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) :
R × A × B → Prop

The verdict of G on a seed and answers.

noncomputable def Cslib.PCP.SeededGame.answersWinProb {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) (ans : X → Y → PMF (A × B)) :

The probability of winning G when the answers to questions (x, y) are drawn from ans x y.

theorem Cslib.PCP.SeededGame.answersWinProb_nonneg {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) (ans : X → Y → PMF (A × B)) :
theorem Cslib.PCP.SeededGame.answersWinProb_le_one {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) (ans : X → Y → PMF (A × B)) :
theorem Cslib.PCP.SeededGame.answersWinProb_eq_sum {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) [Fintype R] [Fintype A] [Fintype B] [(r : R) → (a : A) → (b : B) → Decidable (G.accepts r a b)] (ans : X → Y → PMF (A × B)) :
G.answersWinProb ans = ∑ r : R, (G.seed r).toReal * ∑ a : A, ∑ b : B, if G.accepts r a b then ((ans (G.query r).1 (G.query r).2) (a, b)).toReal else 0

The winning probability ∑_r Pr[r] ∑_{a,b} [accepts r a b] Pr[(a, b) | query r].

def Cslib.PCP.SeededGame.pullbackSeed {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) {T : Type u_6} (law : PMF T) (f : T → R) :
SeededGame T X Y A B

Run the questions and checks of G using seeds obtained by mapping a new private law. This lets clients work directly with the random choices of a subtest.

theorem Cslib.PCP.SeededGame.answersWinProb_pullbackSeed {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) {T : Type u_6} (law : PMF T) (f : T → R) (ans : X → Y → PMF (A × B)) :
(G.pullbackSeed law f).answersWinProb ans = { seed := PMF.map f law, query := G.query, accepts := G.accepts }.answersWinProb ans

Mapping private seeds before running the verifier gives the same score as pulling the verifier back to the original seed type.

theorem Cslib.PCP.SeededGame.answersWinProb_bind_seed {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) {I : Type u_6} [Fintype I] (law : PMF I) (conditional : I → PMF R) (ans : X → Y → PMF (A × B)) :
{ seed := law.bind conditional, query := G.query, accepts := G.accepts }.answersWinProb ans = ∑ i : I, (law i).toReal * { seed := conditional i, query := G.query, accepts := G.accepts }.answersWinProb ans

If the seed law first draws a finite index and then samples from its conditional law, the verifier's score is the weighted sum of the conditional scores.

theorem Cslib.PCP.SeededGame.answersWinProb_bind_uniformSeed {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) {I : Type u_6} [Fintype I] [Nonempty I] (conditional : I → PMF R) (ans : X → Y → PMF (A × B)) :
{ seed := (Probability.PMF.uniformOfFintype I).bind conditional, query := G.query, accepts := G.accepts }.answersWinProb ans = Finset.univ.expect fun (i : I) => { seed := conditional i, query := G.query, accepts := G.accepts }.answersWinProb ans

Drawing a uniform index gives the uniform average of the conditional scores.

theorem Cslib.PCP.SeededGame.weighted_rejection_le_of_bind_seed {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) {I : Type u_6} [Finite I] (law : PMF I) (conditional : I → PMF R) (ans : X → Y → PMF (A × B)) (i : I) :
(law i).toReal * (1 - { seed := conditional i, query := G.query, accepts := G.accepts }.answersWinProb ans) ≤ 1 - { seed := law.bind conditional, query := G.query, accepts := G.accepts }.answersWinProb ans

The weighted rejection probability of one conditional law is bounded by the rejection probability under the mixed law.

theorem Cslib.PCP.SeededGame.rejection_eq_sum {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) [Fintype R] (ans : X → Y → PMF (A × B)) :
1 - G.answersWinProb ans = ∑ r : R, (G.seed r).toReal * (1 - { seed := PMF.pure r, query := G.query, accepts := G.accepts }.answersWinProb ans)

Over a finite seed type, rejection is the sum of the seed-weighted rejection probabilities for deterministic seeds.

theorem Cslib.PCP.SeededGame.weighted_rejection_pullback_uniform_le {R : Type u_1} {X : Type u_2} {Y : Type u_3} {A : Type u_4} {B : Type u_5} (G : SeededGame R X Y A B) [Fintype R] [Nonempty R] {T : Type u_6} [Fintype T] [Nonempty T] (f : T ↪ R) (ans : X → Y → PMF (A × B)) :

An injective restriction of a uniform seed retains at most the total rejection budget, after weighting by the proportion of seeds retained.

def Cslib.PCP.TwoProverGame.toSeeded {X : Type u_1} {Y : Type u_2} {A : Type u_3} {B : Type u_4} (G : TwoProverGame X Y A B) :
SeededGame (X × Y) X Y A B

A two-prover game as a seeded game: the seed is the pair of questions.