The derandomized BLR test #
The derandomized Blum–Luby–Rubinfeld test with a distribution X on the cube queries a
Boolean function f at a uniformly random x, at an independent y ∼ X, and at x + y, and
accepts when (f x ^^ f y) = f (x + y); BitString.derandomizedBLRAcceptance X f is the
probability that it accepts. With X uniform it is the BLR test
(BitString.derandomizedBLRAcceptance_uniformOfFintype). When X is ε-biased and has small
support, it uses far fewer random bits O'Donnell, Section 6.4.
Reading f as the function F x = (-1) ^ f x, the test accepts with probability
1/2 + 1/2 𝔼_{y ∼ X} [F(y) (F ∗ F)(y)]
(BitString.derandomizedBLRAcceptance_eq_sum_mul_convolution). Linear functions, in particular
parities, still pass with probability one (BitString.derandomizedBLRAcceptance_of_map_add).
Conversely, write the acceptance probability as 1/2 + θ/2. By Cauchy–Schwarz under X,
θ² ≤ 𝔼_{y ∼ X} [(F ∗ F)(y)²]; since ‖(F ∗ F)^‖₁ = ∑_S F̂(S)² = 1, an ε-biased X fools
(F ∗ F)² up to ε (BitString.IsSmallBias.fools_sq), and the uniform expectation of
(F ∗ F)² is ∑_S F̂(S)⁴ ≤ max_S F̂(S)². Hence some S has θ² - ε ≤ F̂(S)²
(BitString.exists_two_mul_derandomizedBLRAcceptance_sub_one_sq_sub_le_fourierCoeff_sq), so f
has correlation at least √(θ² - ε) with χ_S or -χ_S, and is within relative distance
1/2 - 1/2 √(θ² - ε) of an affine function b ^^ parityOn S
O'Donnell, Theorem 6.44. The affine function may be a negated parity: those are
rejected with probability one, but a function that is false on the small support of X and
true off it is accepted almost always and is close only to the constant true.
Main definitions #
Cslib.BitString.derandomizedBLRAcceptance: the acceptance probability of the derandomized BLR test.
Main results #
Cslib.BitString.derandomizedBLRAcceptance_eq_sum_mul_convolution: the acceptance probability through the convolution.Cslib.BitString.derandomizedBLRAcceptance_of_map_add: completeness for linear functions.Cslib.BitString.exists_two_mul_derandomizedBLRAcceptance_sub_one_sq_sub_le_fourierCoeff_sq: the spectral form of soundness.Cslib.BitString.exists_le_abs_fourierCoeff_of_le_derandomizedBLRAcceptance,Cslib.BitString.exists_hammingDist_xor_parityOn_le_of_le_derandomizedBLRAcceptance: soundness in correlation and distance form O'Donnell, Theorem 6.44.Cslib.BitString.exists_hammingDist_xor_parityOn_le_of_one_sub_le_derandomizedBLRAcceptance: acceptance1 - δgives distanceδ + ε / (2 (1 - 2δ)), a quantitative form of O'Donnell, Remark 6.45.
Usage #
Open Cslib.BitString. Functions are f : (ι → Bool) → Bool with ^^ and +, as in the BLR
test of CslibFrontier.Foundations.BooleanAnalysis.Linearity, and the Fourier statements read f
as the signs fun x => signVal (f x). The distribution is any X : PMF (ι → Bool); the
soundness theorems assume IsSmallBias ε X (CslibFrontier.Probability.SmallBias) with
0 ≤ ε. Unfold the acceptance probability with derandomizedBLRAcceptance_def. The spectral form
takes θ = 2 * derandomizedBLRAcceptance X f - 1, of either sign. The correlation and distance
forms take any θ with |θ| ≤ |2 * derandomizedBLRAcceptance X f - 1|: the book's exact
acceptance 1/2 + θ/2 of either sign, or acceptance at least 1/2 + θ/2 for 0 ≤ θ;
Real.sqrt is 0 on nonpositive arguments, so they are vacuous, not false, when θ ^ 2 ≤ ε.
The relative Hamming distance is (hammingDist f g : ℝ) / 2 ^ Fintype.card ι. The proof shares
two steps with the affinity test (exists_sum_fourierCoeff_signVal_pow_four_le and
exists_hammingDist_xor_parityOn_le_of_le_abs_fourierCoeff in
CslibFrontier.Foundations.BooleanAnalysis.Affinity) and the BLR acceptance condition in signs,
ite_xor_eq_eq_signVal in Linearity. The checked clients in
CslibFrontierTests/BooleanAnalysisDerandomizedBLR.lean
recover the BLR bounds from the uniform distribution and run the test with the powering
small-bias space on a thousand bits from 40 seed bits (exists_isSmallBias_uniformOfFintype_map),
where parities pass and acceptance 9/10 gives distance below 101/1000. They also show that the
point mass at 0, which is 1-biased, accepts a conjunction with no Fourier coefficient above
1/2, so Theorem 6.44 proves that this point mass is not ε-biased for any ε < 3/4. The test is
an expectation over the cube: it is not packaged as a PCP.LocalTest, its count of
n + O(log(n/ε)) random bits is not stated, and the improvements of
O'Donnell, Exercises 6.32 and 6.33 are not formalized.
References #
The acceptance probability of the derandomized BLR test on f with distribution X: the
probability, over a uniformly random x and an independent y ∼ X, that
(f x ^^ f y) = f (x + y) O'Donnell, Section 6.4.
The acceptance probability of the derandomized BLR test, unfolded.
The acceptance probability of the derandomized BLR test: reading f as signs F, the
test accepts with probability 1/2 + 1/2 𝔼_{y ∼ X} [F(y) (F ∗ F)(y)].
With the uniform distribution, the derandomized BLR test is the BLR test.
Completeness of the derandomized BLR test: a linear function, one with
f (x + y) = (f x ^^ f y), passes with probability one for every distribution X.
Completeness of the derandomized BLR test for parities.
Soundness of the derandomized BLR test, spectral form: if X is ε-biased and the test
accepts f with probability 1/2 + θ/2, then θ² - ε ≤ F̂(S)² for some S, where F reads f
as signs; this is the core of O'Donnell, Theorem 6.44. Here
θ = 2 * derandomizedBLRAcceptance X f - 1, which may be negative: this is the only form that
covers θ < 0, as the book's exact acceptance 1/2 + θ/2 allows.
Soundness of the derandomized BLR test, correlation form
O'Donnell, Theorem 6.44: if X is ε-biased and the test accepts f with
probability 1/2 + θ'/2 where |θ| ≤ |θ'|, then reading f as signs, some Fourier coefficient
has √(θ² - ε) ≤ |F̂(S)|; that is, f has correlation at least √(θ² - ε) with χ_S or -χ_S.
This is the book's headline statement, whose hypothesis is the case θ = θ', of either sign;
acceptance at least 1/2 + θ/2 with θ ≥ 0 is the case 0 ≤ θ ≤ θ'. The bound is vacuous when
θ² ≤ ε, where the square root is zero.
Soundness of the derandomized BLR test, distance form
O'Donnell, Theorem 6.44: if X is ε-biased and the test accepts f with
probability 1/2 + θ'/2 where |θ| ≤ |θ'|, then f differs from some affine function
b ^^ parityOn S on at most a 1/2 - 1/2 √(θ² - ε) fraction of the inputs. This is the book's
"i.e." restatement, the form that Remark 6.45 uses
(exists_hammingDist_xor_parityOn_le_of_one_sub_le_derandomizedBLRAcceptance). The bound is
vacuous when θ² ≤ ε, where the square root is zero.
Acceptance near one gives a nearby affine function, a quantitative form of
O'Donnell, Remark 6.45: if X is ε-biased and the test accepts f with
probability at least 1 - δ, where δ < 1/2, then f differs from some affine function on at
most a δ + ε / (2 (1 - 2δ)) fraction of the inputs. The explicit bound is not in the book; it
follows from Theorem 6.44 with θ = 1 - 2δ and √(a² - ε) ≥ a - ε / a for a > 0. So f is
nearly δ-close to an affine function when ε ≪ δ (1 - 2δ), as the remark says for ε ≪ δ with
δ bounded away from 1/2.