Documentation

CslibFrontier.Computability.Complexity.Classes.BPP.Derandomization.Generator

Computing the Nisan–Wigderson generator #

The derandomization of BPP with the Nisan–Wigderson generator is uniform: a deterministic machine runs the verifier on the output of the generator for every seed and takes the majority [NW94], Arora and Barak, Chapter 20. This file certifies that computation in polynomial time, Turing.MultiTapeTM.ComputableInPolyTime.

Polynomial time is measured in the length of the instance, while the seeds have logarithmic length ℓ, the hard function is evaluated on words of logarithmic length n, and the hard function is only computable in time T n, exponential in n. The certificates therefore take polynomial bounds on 2 ^ ℓ and on T n as functions of the instance:

On pairs of an instance and a seed, the generator with computed parameters is polynomial-time (Cslib.Complexity.computableInPolyTime_listGenerator_greedyMasks), so the seed-enumeration decider Cslib.Complexity.seedDecider over it runs in polynomial time (Cslib.Complexity.computableInPolyTime_seedDecider). Its correctness is the subject of Cslib.Complexity.BPP_subset_P_of_isAverageCaseHard.

Main results #

References #

Deterministic time classes have deciders within time and space O(t n). A problem decided within time O(t n), by a machine with any space bound, has a Boolean decider computable within time and space O(t n): time bounds space up to a linear factor.

theorem Turing.MultiTapeTM.ComputableInO.computableInPolyTime_take {γ β : Type} {encIn : γ ↪ List Bool} {encOut : β ↪ List Bool} {g : List Bool → β} {T : ℕ → ℕ} (hT : Monotone T) (hg : ComputableInO g encBits encOut (fun (y : List Bool) => T y.length) fun (y : List Bool) => T y.length) {cut : γ → ℕ} (hcut : ComputableInPolyTime cut encIn encUnary) (hbound : PolyBounded (fun (x : γ) => (encIn x).length) fun (x : γ) => T (cut x)) :
ComputableInPolyTime (fun (p : γ × List Bool) => g (List.take (cut p.1) p.2)) (encPair encIn encBits) encOut

Evaluation on short words. Let g be computable within time and space O(T n) on words of length n, for a monotone T. Then cutting a word to a computed length cut x and applying g is polynomial-time in the pair of x and the word, provided T (cut x) is polynomially bounded in the length of x.

The greedy design in polynomial time. With computed seed length seed x, block size block x and overlap bound overlap x, the greedy design is polynomial-time in x when 2 ^ seed x is polynomially bounded: the loop runs over 2 ^ seed x masks and keeps at most as many.

The generator on lists in polynomial time. Let g be computable within time and space O(T n) on words of length n, for a monotone T. With computed block size block x, masks masks x and seed seed x, the generator on lists is polynomial-time in x when T (block x) is polynomially bounded.

The Nisan–Wigderson generator with computed parameters in polynomial time. Let g be computable within time and space O(T n) on words of length n, for a monotone T. On pairs of an instance x and a seed, the generator with blocks of block x positions, the first out x masks of the greedy design with seeds of seed x bits and overlaps at most overlap x, is polynomial-time when the parameters are polynomial-time in unary and 2 ^ seed x and T (block x) are polynomially bounded in the length of the instance. With Cslib.Complexity.computableInPolyTime_seedDecider this runs the Nisan–Wigderson derandomization in polynomial time.