Documentation

CslibFrontier.Computability.Complexity.Classes.BPP.Derandomization.SeedEnumeration

Derandomization by enumerating the seeds of a generator #

A pseudorandom generator derandomizes a bounded-error verifier V by brute force: on an instance x, run V on x and the string generated from each seed of some length k, and return the strict majority of the answers Arora and Barak, Lemma 16.4, Goldreich, Proposition 8.15. This file gives that decider for an arbitrary seed map gen x : List Bool → List Bool, which may depend on the instance, and its two properties.

Its instances are the Nisan–Wigderson derandomization (Cslib.Complexity.BPP_subset_P_of_isAverageCaseHard), the derandomization from circuit-secure generators of polynomial stretch (Cslib.Complexity.BPP_subset_DTIME_two_pow_rpow_of_polyStretch_circuitSecurePRG) and from generators running in time exponential in the seed (Cslib.Complexity.CanonicalDerandomizer.exists_mem_DTIME_of_mem_BPTIME).

Main definitions #

Main results #

References #

def Cslib.Complexity.seedDecider {α : Type} (V : α × List Bool → Bool) (gen : α → List Bool → List Bool) (seed : α → ℕ) (x : α) :

The decider obtained from a verifier V by enumerating seeds: on an instance x, it runs V on x and the string gen x z for each of the 2 ^ seed x seeds z of seed x bits, and returns the strict majority of the answers.

Correctness #

theorem Cslib.Complexity.seedDecider_eq_true_iff {α : Type} {A : Set α} {V : α × List Bool → Bool} {x : α} {m : ℕ} (hyes : x ∈ A → 2 * 2 ^ m ≤ 3 * acceptCount V x m) (hno : x ∉ A → 3 * acceptCount V x m ≤ 2 ^ m) (gen : α → List Bool → List Bool) (seed : α → ℕ) (hgap : |↑{z : Fin (seed x) → Bool | V (x, gen x (List.ofFn z)) = true}.card / 2 ^ seed x - ↑(acceptCount V x m) / 2 ^ m| < 1 / 6) :
seedDecider V gen seed x = true ↔ x ∈ A

Seed enumeration is correct when the generator fools the verifier on the instance. Let V answer whether x ∈ A with bounded error on random strings of m bits: it accepts at least two thirds of them if x ∈ A, and at most one third otherwise. If the fraction of the seeds z of seed x bits on which V accepts gen x z is within 1 / 6 of the fraction of the random strings of m bits that V accepts, then seedDecider V gen seed answers correctly on x.

theorem Cslib.Complexity.seedDecider_eq_of_boundedError {α : Type} {V : α × List Bool → Bool} {x : α} {m : ℕ} {b : Bool} (htrue : b = true → 2 * 2 ^ m ≤ 3 * acceptCount V x m) (hfalse : b = false → 3 * acceptCount V x m ≤ 2 ^ m) (gen : α → List Bool → List Bool) (seed : α → ℕ) (hgap : |↑{z : Fin (seed x) → Bool | V (x, gen x (List.ofFn z)) = true}.card / 2 ^ seed x - ↑(acceptCount V x m) / 2 ^ m| < 1 / 6) :
seedDecider V gen seed x = b

Seed enumeration gives the expected answer. If V answers b with bounded error on random strings of m bits at x (it accepts at least two thirds of them if b = true, at most one third if b = false), and the seeds are within 1 / 6 of the random strings as in seedDecider_eq_true_iff, then seedDecider V gen seed x = b.

Running time #

Seed enumeration in polynomial time. Let V and the generator be polynomial-time, and the seed length seed x be computable in unary in polynomial time. When 2 ^ seed x is polynomially bounded in the length of the instance, seedDecider V gen seed is polynomial-time.

theorem Cslib.Complexity.exists_computableInO_seedDecider {α : Type} {enc : α ↪ List Bool} {V : α × List Bool → Bool} {gen : α → List Bool → List Bool} {seed : α → ℕ} (gen' : α × ℕ → List Bool → List Bool) (hV : Turing.MultiTapeTM.ComputableInPolyTime V (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hgen : Turing.MultiTapeTM.ComputableInPolyTime (fun (q : (α × ℕ) × List Bool) => gen' q.1 q.2) (Turing.MultiTapeTM.encPair (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encUnary) Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits) (hgen' : ∀ (x : α) (z : List Bool), z.length = seed x → gen' (x, 2 ^ seed x) z = gen x z) (hseed : Turing.MultiTapeTM.ComputableInPolyTime seed enc Turing.MultiTapeTM.encUnary) :
∃ (C : ℕ) (D : ℕ), Turing.MultiTapeTM.ComputableInO (seedDecider V gen seed) enc Turing.MultiTapeTM.encBool (fun (x : α) => C * 2 ^ (D * seed x) * ((enc x).length + 1) ^ D) fun (x : α) => C * 2 ^ (D * seed x) * ((enc x).length + 1) ^ D

Seed enumeration in time 2 ^ O(k). Let V be polynomial-time, and the seed length seed x be computable in unary in polynomial time. Let the generator be polynomial-time on instances padded to (x, N) with N = 2 ^ seed x in unary: gen' is polynomial-time on ((x, N), z) and agrees with gen x on seeds of seed x bits when N = 2 ^ seed x. A generator running in time 2 ^ O(k) on seeds of k bits has such a padded form. Then seedDecider V gen seed is computable within time and space C 2 ^ (D seed x) (|x| + 1) ^ D for some constants C and D: on the padded instance it is polynomial-time.