Documentation

CslibFrontier.Computability.Complexity.Classes.BPP.Derandomization.CanonicalDerandomizer

Generators running in time exponential in the seed #

The generators used for derandomization may run longer than the tests they fool. Goldreich's canonical derandomizers Goldreich, Definition 8.14 (draft r4, printed page 338, PDF page 74) run in time poly(2 ^ k ℓ(k)) on seeds of k bits and fool circuits of size ℓ(k) ^ 2 within 1 / 6. Arora and Barak's S(ℓ)-pseudorandom generators Arora and Barak, Definition 16.2 (draft of 2007-01-08, printed pages 283–284, PDF pages 299–300) run in time 2 ^ (c ℓ) and fool circuits of size S(ℓ) ^ 3 within 1 / 10. Enumerating the seeds still takes time polynomial in 2 ^ k and the instance, as for polynomial-time generators (Cslib.Complexity.seedDecider).

Goldreich's Proposition 8.15 and Arora and Barak's Lemma 16.4, for BPTIME(t) with general t, are not proved: under this library's constant-factor conventions their printed proofs leave a gap. Conditional forms under a growth hypothesis are in CslibFrontier.Computability.Complexity.Classes.BPP.Derandomization.GeneralTime. In the polynomial regime of Theorem 8.16, the constant factors are absorbed by a longer seed of O(log n) bits.

Main definitions #

Main results #

References #

Goldreich, Exercise 8.18: a range test distinguishes every generator Goldreich, Exercise 8.18 (draft r4, printed page 374). For every generator G : {0,1} ^ k → {0,1} ^ L, the test for membership in the range of G has De Morgan circuits with at most 2 ^ k (2 L + 2) + 1 = O(2 ^ k L) gates (a disjunction over the seeds of the conjunction of the L output bits), accepts every output of G, and accepts at most 2 ^ k of the 2 ^ L strings. So it distinguishes G with advantage at least 1 - 2 ^ k / 2 ^ L, which is at least 1 / 2 when L > k.

Canonical derandomizers Goldreich, Definition 8.14 (draft r4, printed page 338, PDF page 74). A canonical derandomizer of stretch ℓ is a deterministic algorithm G, computable within time poly(2 ^ k ℓ(k)) on seeds of k bits, with outputs of ℓ(k) bits, such that every De Morgan circuit with at most ℓ(k) ^ 2 gates distinguishes G on a uniform seed of k bits from a uniform string of ℓ(k) bits with advantage below 1 / 6 (Eq. 8.11).

Deviations, each of which only admits more generators: the stretch ℓ is non-decreasing (the source says "monotonically increasing"); the time bound is (2 ^ k (ℓ(k) + 1)) ^ D up to a constant factor, which is poly(2 ^ k ℓ(k)) whenever ℓ(k) ≥ 1; and the space is bounded by the same function, as Turing.MultiTapeTM.ComputableInO requires (a machine visits at most one new cell per step). Circuit size is the number of gates (Cslib.Crypto.PRG.IsCircuitTest). No canonical derandomizer of super-polynomial stretch is known to exist unconditionally; the record is a hypothesis.

theorem Cslib.Complexity.CanonicalDerandomizer.le_two_pow {G : List Bool → List Bool} {ℓ : ℕ → ℕ} (hG : CanonicalDerandomizer G ℓ) (k : ℕ) :
ℓ k ≤ 2 ^ (k + 1) + 1

The stretch of a canonical derandomizer is O(2 ^ k) Goldreich, Section 8.3.1, Footnote 23 and Exercise 8.18. If ℓ(k) > 2 ^ (k + 1) + 1, the range test of Cslib.Crypto.PRG.Generator.exists_complexity_le_advantage_ge has at most ℓ(k) ^ 2 gates and advantage at least 1 / 2, contradicting Eq. 8.11.

theorem Cslib.Complexity.P_eq_BPP_of_canonicalDerandomizer {G : List Bool → List Bool} {ℓ : ℕ → ℕ} (hG : CanonicalDerandomizer G ℓ) (hstretch : ∃ (ε : ℝ), 0 < ε ∧ ∀ᶠ (k : ℕ) in Filter.atTop, 2 ^ (ε * ↑k) ≤ ↑(ℓ k)) {α : Type} (enc : α ↪ List Bool) :
P enc = BPP enc

Goldreich, Theorem 8.16 Goldreich, Theorem 8.16 (draft r4, printed page 339, PDF page 75): if there exists a canonical derandomizer of stretch ℓ(k) = 2 ^ Ω(k), then BPP = P, for every encoding enc of instances. Stretch 2 ^ Ω(k) means that for some ε > 0, ℓ(k) ≥ 2 ^ (ε k) for all large k.

For a verifier reading p(n) random bits whose circuit with the instance hardwired has O(n ^ a) gates, seeds of k = O(log n) bits have ℓ(k) ≥ n ^ a. The generator then fools that circuit within 1 / 6, so the majority over the seeds is correct (Cslib.Complexity.seedDecider_eq_true_iff_of_advantage_lt). The decider runs the generator in time poly(2 ^ k ℓ(k)) = poly(2 ^ k) by the bound ℓ(k) = O(2 ^ k) of Exercise 8.18 (Cslib.Complexity.CanonicalDerandomizer.le_two_pow), polynomial in n.

Arora and Barak's pseudorandom generators #

S(ℓ)-pseudorandom generators Arora and Barak, Definition 16.2 (draft of 2007-01-08, printed pages 283–284, PDF pages 299–300). For a non-decreasing S, the generator G has outputs of S(ℓ) bits on seeds of ℓ bits, is computable within time 2 ^ (c ℓ) for some constant c, and for every ℓ, every De Morgan circuit with at most S(ℓ) ^ 3 gates distinguishes G on a uniform seed of ℓ bits from a uniform string of S(ℓ) bits with advantage below 1 / 10.

Deviations, each of which only admits more generators: the definition also requires S to be polynomial-time computable, which no result here uses, so the record omits it; the time bound is up to a constant factor and also bounds the space, as Turing.MultiTapeTM.ComputableInO requires. No such generator with S super-polynomial is known to exist unconditionally; the record is a hypothesis.

An S(ℓ)-pseudorandom generator is a canonical derandomizer of stretch S. Its time 2 ^ (c ℓ) is at most (2 ^ ℓ (S(ℓ) + 1)) ^ c, circuits with S(ℓ) ^ 2 gates have at most S(ℓ) ^ 3 gates, and 1 / 10 < 1 / 6 Arora and Barak, Definition 16.2, Goldreich, Definition 8.14.

theorem Cslib.Complexity.P_eq_BPP_of_exponentialTimePRG {G : List Bool → List Bool} {S : ℕ → ℕ} (hG : ExponentialTimePRG G S) (hS : ∃ (ε : ℝ), 0 < ε ∧ ∀ᶠ (ℓ : ℕ) in Filter.atTop, 2 ^ (ε * ↑ℓ) ≤ ↑(S ℓ)) {α : Type} (enc : α ↪ List Bool) :
P enc = BPP enc

Arora and Barak, Corollary 16.6 (1) Arora and Barak, Corollary 16.6 (draft of 2007-01-08, printed page 285, PDF page 301): if there exists a 2 ^ (ε ℓ)-pseudorandom generator for some constant ε > 0, then BPP = P, for every encoding enc of instances. The output length S(ℓ) need only be at least 2 ^ (ε ℓ) for all large ℓ, which covers any rounding of 2 ^ (ε ℓ) to a natural number. The corollary follows from Goldreich's Theorem 8.16 (Cslib.Complexity.P_eq_BPP_of_canonicalDerandomizer) through Cslib.Complexity.ExponentialTimePRG.canonicalDerandomizer; the draft derives it from its Lemma 16.4 (Exercise 16.1).