Sampling the advice of the Nisan–Wigderson reconstruction #
The reconstruction
Cslib.Crypto.PRG.NisanWigderson.exists_half_add_div_le_card_nextBitGuess_eq shows that, for a
deterministic test with advantage ε against the Nisan–Wigderson generator, some choice of a
position i, of the seed bits outside the i-th block, of a candidate bit for bit i and of
padding bits after position i gives a guess that agrees with the hard function f on a
1 / 2 + ε / m fraction of the inputs. Here these choices are sampled instead, as in the
randomized reconstruction of [Hir18]: a trial t collects them, and its agreement
trialAgreement D f test t is the fraction of the inputs on which its guess is correct.
Probabilities are densities (Finset.dens) of sets of trials.
The agreement of a uniformly random trial is on average exactly 1 / 2 + (p₁ - p₀) / m, where
p₁ and p₀ are the probabilities that the test accepts generated and uniform strings
(Cslib.Crypto.PRG.NisanWigderson.expect_trialAgreement): at a fixed position, the average
agreement is the probability that the predictor built from the test guesses that bit
(Cslib.Crypto.PRG.NisanWigderson.toReal_predictionExperiment_eq_expect_trialAgreement), and the
hybrid gaps telescope. Agreements are at most 1, so by reverse averaging
(Fintype.expect_sub_le_dens_filter) a uniformly random trial has agreement at least
1 / 2 + ε / (2 m) with probability at least ε / (2 m)
(Cslib.Crypto.PRG.NisanWigderson.div_two_mul_le_dens_goodTrials). Among k independent trials
one does with probability at least 1 - (1 - ε / (2 m)) ^ k
(Cslib.Crypto.PRG.NisanWigderson.one_sub_pow_le_dens_exists_mem_goodTrials), which is at least
1 / 2 once k ε ≥ 2 m, for instance for k = ⌈2 m / ε⌉
(Cslib.Crypto.PRG.NisanWigderson.half_le_dens_exists_mem_goodTrials).
Main definitions #
Cslib.Crypto.PRG.NisanWigderson.Trial: the random choices of the reconstruction.Cslib.Crypto.PRG.NisanWigderson.trialGuess: the guess of the predictor built from a deterministic test, with its random choices fixed.Cslib.Crypto.PRG.NisanWigderson.trialAgreement: the fraction of inputs on which it is correct.Cslib.Crypto.PRG.NisanWigderson.goodTrials: the trials whose agreement reaches a threshold.
Main results #
Cslib.Crypto.PRG.Generator.toReal_realExperiment_pure,Cslib.Crypto.PRG.Generator.toReal_idealExperiment_pure: the experiments of a deterministic test are densities.Cslib.Crypto.PRG.NisanWigderson.toReal_predictionExperiment_eq_expect_trialAgreement,Cslib.Crypto.PRG.NisanWigderson.expect_trialAgreement: the prediction experiments are averages of agreements.Cslib.Crypto.PRG.NisanWigderson.half_add_div_le_expect_trialAgreement,Cslib.Crypto.PRG.NisanWigderson.exists_half_add_div_le_trialAgreement: a test with advantageεgives average agreement at least1 / 2 + ε / m, so some trial reaches it.Cslib.Crypto.PRG.NisanWigderson.sub_div_le_dens_goodTrials,Cslib.Crypto.PRG.NisanWigderson.div_two_mul_le_dens_goodTrials: a random trial is good with probability at leastε / (2 m).Cslib.Crypto.PRG.NisanWigderson.one_sub_pow_le_dens_exists_mem_goodTrials,Cslib.Crypto.PRG.NisanWigderson.half_le_dens_exists_mem_goodTrials: repeated trials.
References #
A deterministic test accepts the output of a generator on a uniform seed with probability the density of the seeds on which it accepts.
A deterministic test accepts a uniform string with probability the density of the strings it accepts.
A trial of the reconstruction: its random choices. These are a position pos, a seed seed
whose bits outside the pos-th block are kept, a candidate bit bit for the bit at pos, and a
string pad whose bits after position pos pad the input of the test.
- pos : Fin m
The position of the predicted bit.
The seed; its bits outside the
pos-th block are kept.- bit : Bool
The candidate value of the predicted bit.
The padding; its bits after position
poscomplete the input of the test.
Instances For
The guess at the input x of the predictor built from the deterministic test test, with the
random choices t fixed: nextBitGuess test t.pos t.bit t.pad applied to the first t.pos bits
of the output of the generator on the seed D.extend t.pos x t.seed.
Instances For
Averaging over the random choices. For a deterministic test, the probability that the
predictor built from it guesses bit i of the generator is the average agreement of the trials
at position i.
Averaging over the random choices. If 0 < m, the agreement of a uniformly random trial
is on average 1 / 2 + (p₁ - p₀) / m, where the test accepts generated strings with probability
p₁ and uniform strings with probability p₀.
If 0 < m, a deterministic test that accepts generated strings with probability at least ε
more than uniform ones gives an average agreement of at least 1 / 2 + ε / m.
The reconstruction, in the vocabulary of trials: if 0 < m and a deterministic test
accepts generated strings with probability at least ε more than uniform ones, some trial has
agreement at least 1 / 2 + ε / m.
Sampling the advice, exact form. Let 0 < m and let a deterministic test accept generated
strings with probability at least ε more than uniform ones. For every θ < 1, a uniformly random
trial has agreement at least θ with probability at least (1 / 2 + ε / m - θ) / (1 - θ).
Sampling the advice [Hir18]. Let 0 < m, 0 ≤ ε, and let a deterministic test
accept generated strings with probability at least ε more than uniform ones. A uniformly random
trial has agreement at least 1 / 2 + ε / (2 m) with probability at least ε / (2 m).
Repeated sampling. Let 0 < m, 0 ≤ ε, and let a deterministic test accept generated
strings with probability at least ε more than uniform ones. Among k independent uniformly
random trials, one has agreement at least 1 / 2 + ε / (2 m) with probability at least
1 - (1 - ε / (2 m)) ^ k.
Repeated sampling [Hir18]. Let 0 < m, 0 ≤ ε, and let a deterministic test
accept generated strings with probability at least ε more than uniform ones. If 2 m ≤ k ε,
then among k independent uniformly random trials one has agreement at least 1 / 2 + ε / (2 m)
with probability at least 1 / 2.