Documentation

CslibFrontier.Computability.Complexity.Classes.IP.Games.Emulation

Public coins emulate a count over private coins #

The emulation of private coins by public coins of Goldwasser and Sipser (Arora and Barak, Theorem 8.8), for an arbitrary 0/1 payoff. Let g be a private-coin game shape (Cslib.Complexity.IPMove) and V : List Bool → Bool a payoff on complete transcripts. The count Cslib.Complexity.IPGame.count g V sums over the verifier's messages and maximises over the prover's. A public-coin game of shape Emulation.shape B Z g lets Merlin prove lower bounds on this count to Arthur.

At a verifier move of n bits, Arthur sends the seed of an affine hash to B bits of strings of n + Z bits (Cslib.BitString.LinearHash.hashZero). Merlin answers with a claim, the number b ≤ B of true bits in a block of B bits, a message m of n bits and padding z of Z bits. The claim b says that the continuation after m has count at least 2 ^ b. With the current claim κ, Merlin's answer must hash to zero and the first Z + κ - (b + K) bits of z must be false: when the claim κ is honest, about 2 ^ (κ - b) messages have continuations worth 2 ^ b, each padded in 2 ^ (b + K - κ) ways, so the padded set has about 2 ^ K elements. At a prover move Merlin sends the prover's message. At the end Arthur accepts when the last claim is 0 and V accepts the transcript (Cslib.Complexity.Emulation.check).

With B polynomial and K = B + O(log B) both errors are O(1 / c), while the initial claim can be log₂ of the count up to a factor μ ^ c, polynomial for a constant number of rounds. This is the core of IP[k] ⊆ AM[k + 2] (CslibFrontier.Computability.Complexity.Classes.IP.Games. GoldwasserSipser). The claims are exact numbers of bits, not rounded to powers of two of the counts, which removes the separate normalisation of the set lower bound protocol.

Main definitions #

Main results #

References #

The public-coin game #

The public-coin shape emulating a private-coin shape: a verifier move of n bits becomes Arthur's hash seed of B (n + Z) + B bits followed by Merlin's claim, message and padding of B + (n + Z) bits, and a prover move of n bits becomes a Merlin move of n bits.

The polynomial public-coin shape emulating a polynomial private-coin shape.

def Cslib.Complexity.Emulation.check (B Z K : ℕ) (V : List Bool → Bool) :
List (IPMove × ℕ) → ℕ → List Bool → List Bool → Bool

The public-coin verifier emulating the count of the payoff V on the shape g, with current claim κ and transcript prefix p, on Arthur's and Merlin's messages w. At a verifier move of n bits it reads Arthur's seed r, Merlin's claim b (the number of true bits in a block of B bits), message m and padding z, and checks that m ++ z hashes to zero and that the first Z + κ - (b + K) bits of z are false. At a prover move it reads the prover's message. At the end it accepts when the claim is 0 and V accepts the transcript.

The count of the payoff V on the shape g after the transcript prefix p.

theorem Cslib.Complexity.Emulation.check_nil (B Z K : ℕ) (V : List Bool → Bool) (κ : ℕ) (p w : List Bool) :
check B Z K V [] κ p w = (decide (κ = 0) && V p)
theorem Cslib.Complexity.Emulation.check_prover_ofFn (B Z K : ℕ) (V : List Bool → Bool) (n : ℕ) (g : List (IPMove × ℕ)) (κ : ℕ) (p : List Bool) (y : Fin n → Bool) (t : List Bool) :
check B Z K V ((IPMove.prover, n) :: g) κ p (List.ofFn y ++ t) = check B Z K V g κ (p ++ List.ofFn y) t
theorem Cslib.Complexity.Emulation.check_verifier_ofFn (B Z K : ℕ) (V : List Bool → Bool) (n : ℕ) (g : List (IPMove × ℕ)) (κ : ℕ) (p : List Bool) (r : Fin (B * (n + Z) + B) → Bool) (c : Fin B → Bool) (m : Fin n → Bool) (z : Fin Z → Bool) (t : List Bool) :
check B Z K V ((IPMove.verifier, n) :: g) κ p (List.ofFn r ++ (List.ofFn c ++ (List.ofFn m ++ List.ofFn z) ++ t)) = ((BitString.LinearHash.hashZero B (n + Z) (List.ofFn r) (List.ofFn m ++ List.ofFn z) && !(List.take (Z + κ - (List.count true (List.ofFn c) + K)) (List.ofFn z)).any fun (b : Bool) => b) && check B Z K V g (List.count true (List.ofFn c)) (p ++ List.ofFn m) t)

Soundness #

theorem Cslib.Complexity.Emulation.value_le (B Z K μ : ℕ) (hBK : B ≤ K) (hμ : 0 < μ) (V : List Bool → Bool) (g : List (IPMove × ℕ)) (κ : ℕ) (hκ : κ ≤ K) (p : List Bool) :
(AMGame.value true (shape B Z g) fun (t : List Bool) => ↑(check B Z K V g κ p t).toNat) ≤ ↑(IPGame.verifierMoves g) * ((↑B + 1) * 2 ^ K / (↑μ * 2 ^ B)) + ↑μ ^ IPGame.verifierMoves g * ↑(countFrom g V p) / 2 ^ κ

Soundness of the emulation. With c verifier moves, a count N after the prefix p and the claim κ ≤ K, Merlin wins the public-coin game with probability at most c (B + 1) 2 ^ K / (μ 2 ^ B) + μ ^ c N / 2 ^ κ, for every μ > 0.

Completeness #

theorem Cslib.Complexity.Emulation.one_sub_le_value (B Z K : ℕ) (hBK : B ≤ K) (hZ : B + K ≤ Z) (V : List Bool → Bool) (g : List (IPMove × ℕ)) (hg : IPGame.verifierBits g ≤ B) (κ : ℕ) (hκ : κ ≤ B) (p : List Bool) (hN : 2 ^ κ ≤ countFrom g V p) :
1 - ↑(IPGame.verifierMoves g) * ((↑B + 1) * 2 ^ B / 2 ^ K) ≤ AMGame.value true (shape B Z g) fun (t : List Bool) => ↑(check B Z K V g κ p t).toNat

Completeness of the emulation. With c verifier moves of at most B bits in total, a count at least 2 ^ κ after the prefix p and the claim κ ≤ B, Merlin wins the public-coin game with probability at least 1 - c (B + 1) 2 ^ B / 2 ^ K, when B ≤ K and B + K ≤ Z.

Polynomial time #

The public-coin verifier is polynomial-time on a polynomial shape G evaluated at a polynomial-time length len, with polynomial-time parameters B, Z, K, claim κ, prefix p and messages w, when the payoff V is polynomial-time on polynomial-time transcripts.