Documentation

CslibFrontier.Computability.Complexity.Classes.IP.Games

Private-coin interactive games with a fixed pattern of moves #

The interactive proofs with a constant number of rounds of Goldwasser and Sipser, in the form of IP[k] in Arora and Barak, Definition 8.6. A move is IPMove.verifier (the verifier sends a message computed from its private coins) or IPMove.prover (the prover sends a message). A shape List (IPMove × ℕ) lists the moves with their lengths, and a polynomial shape evaluates to a shape at the length n of the encoded instance (Cslib.Complexity.IPGame.evalShape).

The verifier is deterministic given its coins: a pair of polynomial-time functions, the message msg (a, c, j, p) at its move number j after the transcript p with coins c, and the decision dec (a, c, t) on the whole transcript t. The coins are ρ(n) bits and the prover never sees them. A message is read as a string of the length of its move (Cslib.BitString.ofList), so every verifier respects the shape.

The value of a game is counted exactly, as for public-coin games (Cslib.Complexity.AMGame.count). Cslib.Complexity.IPGame.count sums over the verifier's messages and takes the maximum over the prover's messages. At a complete transcript the payoff Cslib.Complexity.IPGame.acceptedCoins counts the coins that agree with every verifier message of the transcript (Cslib.Complexity.IPGame.agrees) and accept it. The resulting Cslib.Complexity.IPGame.bestCount is the number of coins accepted against an optimal prover: every deterministic prover P, which sees the move number and the transcript so far, is accepted on at most bestCount coin strings (Cslib.Complexity.IPGame.card_filter_run_le_bestCount), and some prover attains it (Cslib.Complexity.IPGame.exists_card_filter_run_eq_bestCount). So the count agrees with the definition of IP[k] by acceptance probabilities against all provers (Cslib.Complexity.isIPGameVerifier_iff_provers). Randomized provers do no better than the best deterministic one, so they are not modelled.

A problem A is in IPGameClass enc π when some polynomial shape with move pattern π, some polynomial ρ and some polynomial-time verifier accept at least two thirds of the coin strings on members against an optimal prover, and at most one third on non-members. IPk enc k is the alternating pattern of k moves, the verifier first. A public-coin verifier is a private-coin verifier that sends its coins as its messages, so AMGameClass π ⊆ IPGameClass π and AM[k] ⊆ IP[k].

The bookkeeping of shapes shared by the later constructions is here too: how Cslib.Complexity.IPGame.evalShape, Cslib.Complexity.IPGame.verifierBits, Cslib.Complexity.IPGame.verifierMoves and Cslib.Complexity.IPGame.count behave on concatenations, and the bound Cslib.Complexity.IPGame.count_le_two_pow of a count of a 0/1-valued payoff.

Main definitions #

Main results #

Parallel repetition is in CslibFrontier.Computability.Complexity.Classes.IP.Games.Repetition.

References #

A move of a private-coin interactive game.

  • verifier : IPMove

    The verifier sends a message computed from its private coins.

  • prover : IPMove

    The prover sends a message.

Instances For
    @[instance_reducible]

    The public-coin move with the same speaker: the verifier is Arthur, the prover is Merlin.

    The public-coin move pattern with the same speakers.

    The count of a private-coin game shape g on a payoff f: a sum over the verifier's messages and a maximum over the prover's messages, with f evaluated on the complete transcript.

    theorem Cslib.Complexity.IPGame.count_verifier (n : ℕ) (g : List (IPMove × ℕ)) (f : List Bool → ℕ) :
    count ((IPMove.verifier, n) :: g) f = ∑ m : Fin n → Bool, count g fun (t : List Bool) => f (List.ofFn m ++ t)
    theorem Cslib.Complexity.IPGame.count_prover (n : ℕ) (g : List (IPMove × ℕ)) (f : List Bool → ℕ) :
    count ((IPMove.prover, n) :: g) f = Finset.univ.sup fun (y : Fin n → Bool) => count g fun (t : List Bool) => f (List.ofFn y ++ t)

    Total length of a transcript of a game.

    theorem Cslib.Complexity.IPGame.count_mono_of_length (g : List (IPMove × ℕ)) {f f' : List Bool → ℕ} (h : ∀ (t : List Bool), t.length = transcriptLength g → f t ≤ f' t) :
    count g f ≤ count g f'
    theorem Cslib.Complexity.IPGame.count_congr_of_length (g : List (IPMove × ℕ)) {f f' : List Bool → ℕ} (h : ∀ (t : List Bool), t.length = transcriptLength g → f t = f' t) :
    count g f = count g f'

    The public-coin shape with the same moves.

    The number of bits the verifier sends in a game shape.

    @[simp]

    The number of verifier moves of a private-coin game shape.

    theorem Cslib.Complexity.IPGame.count_eq_value (g : List (IPMove × ℕ)) (f : List Bool → ℕ) :
    ↑(count g f) = 2 ^ verifierBits g * AMGame.value true (toAM g) fun (t : List Bool) => ↑(f t)

    The count of a private-coin game is 2 ^ B times the value of the public-coin game with the same moves, where B is the number of bits the verifier sends.

    theorem Cslib.Complexity.IPGame.count_le_two_pow (g : List (IPMove × ℕ)) (f : List Bool → ℕ) (hf : ∀ (t : List Bool), f t ≤ 1) :

    A count of a 0/1-bounded payoff is at most 2 ^ verifierBits g.

    theorem Cslib.Complexity.IPGame.count_append (g h : List (IPMove × ℕ)) (f : List Bool → ℕ) :
    count (g ++ h) f = count g fun (t : List Bool) => count h fun (u : List Bool) => f (t ++ u)

    The count of a concatenation of shapes: the count of the first shape, whose payoff is the count of the second.

    Verifiers with private coins #

    Whether the transcript t of the moves g agrees with the messages of the verifier msg, where j moves with transcript p came before. Before the verifier's move number j it sends msg j p, read as a string of the length of the move.

    The run of a deterministic prover P against the verifier msg, from move j after the transcript p. The prover sees the move number and the transcript so far.

    theorem Cslib.Complexity.IPGame.agrees_verifier_ofFn (msg : ℕ → List Bool → List Bool) (n : ℕ) (g : List (IPMove × ℕ)) (j : ℕ) (p : List Bool) (m : Fin n → Bool) (t : List Bool) :
    agrees msg ((IPMove.verifier, n) :: g) j p (List.ofFn m ++ t) = (decide (m = BitString.ofList n (msg j p)) && agrees msg g (j + 1) (p ++ List.ofFn m) t)

    agrees on a transcript that starts with the message of a verifier move.

    theorem Cslib.Complexity.IPGame.agrees_prover_ofFn (msg : ℕ → List Bool → List Bool) (n : ℕ) (g : List (IPMove × ℕ)) (j : ℕ) (p : List Bool) (y : Fin n → Bool) (t : List Bool) :
    agrees msg ((IPMove.prover, n) :: g) j p (List.ofFn y ++ t) = agrees msg g (j + 1) (p ++ List.ofFn y) t

    agrees on a transcript that starts with the message of a prover move.

    theorem Cslib.Complexity.IPGame.run_congr (msg : ℕ → List Bool → List Bool) {P P' : ℕ → List Bool → List Bool} (g : List (IPMove × ℕ)) (j : ℕ) (p : List Bool) (h : ∀ (i : ℕ) (q : List Bool), j ≤ i → p <+: q → P i q = P' i q) :
    run msg P g j p = run msg P' g j p

    The run depends only on the prover's answers from move j on, after extensions of p.

    theorem Cslib.Complexity.IPGame.card_filter_run_le {C : Type} (msg : C → ℕ → List Bool → List Bool) (P : ℕ → List Bool → List Bool) (g : List (IPMove × ℕ)) (j : ℕ) (p : List Bool) (S : Finset C) (D : C → List Bool → Bool) :
    {c ∈ S | D c (run (msg c) P g j p) = true}.card ≤ count g fun (t : List Bool) => {c ∈ S | (agrees (msg c) g j p t && D c t) = true}.card

    The count bounds every prover, from move j after the transcript p, for the coins in S. The coins in S are those consistent with p, and D c t is the decision on the rest t of the transcript.

    theorem Cslib.Complexity.IPGame.exists_card_filter_run_eq {C : Type} (msg : C → ℕ → List Bool → List Bool) (g : List (IPMove × ℕ)) (j : ℕ) (p : List Bool) (S : Finset C) (D : C → List Bool → Bool) :
    ∃ (P : ℕ → List Bool → List Bool), {c ∈ S | D c (run (msg c) P g j p) = true}.card = count g fun (t : List Bool) => {c ∈ S | (agrees (msg c) g j p t && D c t) = true}.card

    Some prover attains the count, from move j after the transcript p, for the coins in S.

    Accepted coins #

    def Cslib.Complexity.IPGame.acceptedCoins {ρ : ℕ} (msg : BitString ρ → ℕ → List Bool → List Bool) (dec : BitString ρ → List Bool → Bool) (g : List (IPMove × ℕ)) (t : List Bool) :

    The coins that agree with the transcript t of the moves g and accept it.

    def Cslib.Complexity.IPGame.bestCount {ρ : ℕ} (msg : BitString ρ → ℕ → List Bool → List Bool) (dec : BitString ρ → List Bool → Bool) (g : List (IPMove × ℕ)) :

    The number of coins accepted against an optimal prover.

    theorem Cslib.Complexity.IPGame.card_filter_run_le_bestCount {ρ : ℕ} (msg : BitString ρ → ℕ → List Bool → List Bool) (dec : BitString ρ → List Bool → Bool) (g : List (IPMove × ℕ)) (P : ℕ → List Bool → List Bool) :
    {c : BitString ρ | dec c (run (msg c) P g 0 []) = true}.card ≤ bestCount msg dec g

    The count bounds every prover: against every deterministic prover P, at most bestCount msg dec g coins accept.

    theorem Cslib.Complexity.IPGame.exists_card_filter_run_eq_bestCount {ρ : ℕ} (msg : BitString ρ → ℕ → List Bool → List Bool) (dec : BitString ρ → List Bool → Bool) (g : List (IPMove × ℕ)) :
    ∃ (P : ℕ → List Bool → List Bool), {c : BitString ρ | dec c (run (msg c) P g 0 []) = true}.card = bestCount msg dec g

    Some prover attains the count: some deterministic prover makes exactly bestCount msg dec g coins accept.

    Evaluate the move lengths of a polynomial game shape at n.

    def Cslib.Complexity.IPGame.countAt {α : Type} (enc : α ↪ List Bool) (G : List (IPMove × Polynomial ℕ)) (ρ : Polynomial ℕ) (msg : α × List Bool × ℕ × List Bool → List Bool) (dec : α × List Bool × List Bool → Bool) (a : α) :

    The count of a private-coin game verifier on the instance a: the number of coin strings of ρ(n) bits that an optimal prover makes accept, where n is the length of the encoded instance. The verifier sends msg (a, c, j, p) at its move j after the transcript p, with coins c, and finally accepts the transcript t when dec (a, c, t).

    def Cslib.Complexity.IsIPGameVerifier {α : Type} (enc : α ↪ List Bool) (G : List (IPMove × Polynomial ℕ)) (ρ : Polynomial ℕ) (msg : α × List Bool × ℕ × List Bool → List Bool) (dec : α × List Bool × List Bool → Bool) (A : Set α) :

    (msg, dec) is a private-coin game verifier for A with the polynomial shape G and ρ(n) coins: on a member an optimal prover is accepted on at least two thirds of the coin strings, and on a non-member on at most one third of them, whatever the prover does.

    @[reducible, inline]

    The input of a verifier's message function: the instance, the coins, the move number in unary and the transcript so far, nested to the right. The instance is encoded with enc, the coins and the transcript as raw bits.

    @[reducible, inline]

    The input of a verifier's decision: the instance, the coins and the whole transcript, nested to the right. The instance is encoded with enc, the coins and the transcript as raw bits.

    def Cslib.Complexity.IPGameClass {α : Type} (enc : α ↪ List Bool) (π : List IPMove) :
    Set (Set α)

    The problems with polynomial-time private-coin game verifiers whose moves follow the pattern π, with polynomially many coins and polynomially long messages, with respect to the encoding enc of instances Goldwasser and Sipser.

    def Cslib.Complexity.IPk {α : Type} (enc : α ↪ List Bool) (k : ℕ) :
    Set (Set α)

    IP[k]: k alternating moves, the verifier first.

    theorem Cslib.Complexity.isIPGameVerifier_iff_provers {α : Type} {enc : α ↪ List Bool} {G : List (IPMove × Polynomial ℕ)} {ρ : Polynomial ℕ} {msg : α × List Bool × ℕ × List Bool → List Bool} {dec : α × List Bool × List Bool → Bool} {A : Set α} :
    IsIPGameVerifier enc G ρ msg dec A ↔ ∀ (a : α), (a ∈ A → ∃ (P : ℕ → List Bool → List Bool), 2 * 2 ^ Polynomial.eval (enc a).length ρ ≤ 3 * {c : BitString (Polynomial.eval (enc a).length ρ) | dec (a, List.ofFn c, IPGame.run (fun (j : ℕ) (p : List Bool) => msg (a, List.ofFn c, j, p)) P (IPGame.evalShape G (enc a).length) 0 []) = true}.card) ∧ (a ∉ A → ∀ (P : ℕ → List Bool → List Bool), 3 * {c : BitString (Polynomial.eval (enc a).length ρ) | dec (a, List.ofFn c, IPGame.run (fun (j : ℕ) (p : List Bool) => msg (a, List.ofFn c, j, p)) P (IPGame.evalShape G (enc a).length) 0 []) = true}.card ≤ 2 ^ Polynomial.eval (enc a).length ρ)

    Private-coin game verifiers in terms of provers: on a member some deterministic prover is accepted on at least two thirds of the coin strings, and on a non-member every deterministic prover is accepted on at most one third of them.

    Public coins are private coins #

    The number of bits Merlin sends in a public-coin game shape.

    The private-coin shape with the same moves as a public-coin shape.

    @[simp]

    Whether the coins w agree with Arthur's messages in the transcript t of g: at each of Arthur's moves the next bits of w are Arthur's message, and at each of Merlin's moves the next bits of w are skipped.

    theorem Cslib.Complexity.IPGame.agrees_reveal (g : List (AMMove × ℕ)) (j : ℕ) (p w t : List Bool) (ht : t.length = AMGame.transcriptLength g) :
    agrees (fun (x : ℕ) (q : List Bool) => List.drop q.length w) (ofAM g) j p t = matchArthur g (List.drop p.length w) t

    The verifier that sends its coins as Arthur's messages agrees with a transcript exactly when its coins agree with Arthur's messages. The coins used so far are as many as the bits of the transcript so far.

    Exactly 2 ^ merlinBits g coin strings agree with Arthur's messages in a transcript: Arthur's bits are determined, Merlin's are free.

    theorem Cslib.Complexity.IPGame.acceptedCoins_reveal (g : List (AMMove × ℕ)) (V : List Bool → Bool) {K : ℕ} (hK : K = AMGame.transcriptLength g) (t : List Bool) (ht : t.length = AMGame.transcriptLength g) :
    acceptedCoins (fun (c : BitString K) (x : ℕ) (q : List Bool) => List.drop q.length (List.ofFn c)) (fun (x : BitString K) (t : List Bool) => V t) (ofAM g) t = 2 ^ merlinBits g * (V t).toNat

    The coins accepting a transcript of the verifier that sends its coins as Arthur's messages and then runs the public-coin verifier V.

    theorem Cslib.Complexity.IPGame.bestCount_reveal (g : List (AMMove × ℕ)) (V : List Bool → Bool) {K : ℕ} (hK : K = AMGame.transcriptLength g) :
    bestCount (fun (c : BitString K) (x : ℕ) (q : List Bool) => List.drop q.length (List.ofFn c)) (fun (x : BitString K) (t : List Bool) => V t) (ofAM g) = 2 ^ merlinBits g * AMGame.count g V

    The count of the verifier that sends its coins as Arthur's messages is 2 ^ merlinBits g times the count of the public-coin game.

    Public coins are private coins: a public-coin game verifier gives a private-coin game verifier with the same pattern of moves, which sends its coins as Arthur's messages.

    theorem Cslib.Complexity.AMk_subset_IPk {α : Type} {enc : α ↪ List Bool} (k : ℕ) :
    AMk enc k ⊆ IPk enc k

    AM[k] ⊆ IP[k].