The Odd BLR test and Håstad's test #
The Odd BLR test queries a Boolean function f at independent uniformly random strings x
and y and at z = x + y + (b, …, b) for a uniformly random bit b, and accepts when
f(x) + f(y) + f(z) = b (BitString.oddBlrAcceptance). Håstad's test with noise rate δ
first flips each bit of z independently with probability δ / 2
(BitString.hastadAcceptance). Reading f as signs F, the test accepts with probability
1/2 + 1/2 ∑_{|S| odd} (1 - δ) ^ |S| F̂(S)³ (BitString.hastadAcceptance_eq_sum)
O'Donnell, (7.4), and at δ = 0 this is the Odd BLR test
O'Donnell, Proposition 7.46. With b fixed to false the Odd BLR test
corresponds to the Blum–Luby–Rubinfeld test (BitString.blrAcceptance), which every parity passes
with probability one, the constant false and parities on many coordinates included. The noise
rate is a real parameter, so the tests are stated through their acceptance probabilities rather
than as PCP.LocalTests, whose random strings are uniform.
The same noisy 3-bit linear test, run on folded Long Code tables across a Label Cover projection,
is Cslib.PCP.Hastad in CslibFrontier.Computability.PCP.Approximation.Hastad, with its own
Fourier expansion PCP.Hastad.linearCorr_eq_sum Håstad. That two-table setting is
Håstad's NP-hardness proof; this module is the single-function dictator test of O'Donnell's
Section 7.4, and a Foundations module cannot import it.
These tests use only 3-variable linear equations over F₂ as predicates. A parity on an odd
number k of coordinates is accepted with probability 1/2 + 1/2 (1 - δ) ^ k, and one on an
even number with probability 1/2 (BitString.hastadAcceptance_parityOn), so dictators are
accepted with probability 1 - δ / 2 (BitString.hastadAcceptance_dictator).
Soundness concerns functions with values in [-1, 1] as well
O'Donnell, Remark 7.38. On such a g, each query returns an independent random
sign with mean the value of g, and Håstad's test accepts with probability
BitString.hastadValue δ g, which is BitString.hastadAcceptance δ f at the signs of a Boolean
f (BitString.hastadAcceptance_eq_hastadValue); (7.4) holds verbatim
(BitString.hastadValue_eq_sum) O'Donnell, Exercise 7.22. For 0 ≤ ε ≤ δ ≤ 1,
if every (1 - ε)-stable influence of g is at most ε, so that g has no (ε, ε)-notable
coordinates, the test accepts with probability at most 1/2 + 1/2 √ε
(BitString.hastadValue_le_of_stableInfluence_le, and for Boolean functions
BitString.hastadAcceptance_le_of_stableInfluence_le), and for 0 ≤ δ ≤ 2 it accepts with
probability at most one (BitString.hastadValue_le_one, BitString.hastadAcceptance_le_one).
With λ(ε) = 1/2 √ε for ε ≤ δ and λ(ε) = 1/2 otherwise, these are the clauses of a
(1/2, 1 - δ / 2)-Dictator-vs.-No-Notables test O'Donnell, Theorem 7.42. That
definition takes the test as a Max-E3-Lin instance, a finite list of checks, so it is stated at a
rational noise rate in CslibFrontier.Logics.Propositional.CSP.HastadTest
(Logic.PL.CSP.isDictatorVsNoNotables_hastadTest,
Logic.PL.CSP.exists_isDictatorVsNoNotables_e3Lin).
The book's bound 1/2 + 1/2 max_{|S| odd} F̂(S) for the Odd BLR test needs the maximum to be
nonnegative (BitString.oddBlrAcceptance_le_of_fourierCoeff_le).
Usage #
Open Cslib.BitString. The tests take a Boolean function f : (ι → Bool) → Bool on a finite
index type and read it as signs, fun x => signVal (f x), with signVal true = -1, so true is
the book's -1. Each test is its acceptance probability, a real expectation over the cube.
BitString.hastadAcceptance_zero turns a statement about Håstad's test at δ = 0 into one about
the Odd BLR test. To compute an acceptance probability, rewrite with
BitString.hastadAcceptance_eq_sum (or BitString.hastadValue_eq_sum) and the Fourier
coefficients of the function, as BitString.hastadAcceptance_parityOn does for parities. The
soundness bound takes hg : ∀ x, |g x| ≤ 1 and h : ∀ i, stableInfluence (1 - ε) i g ≤ ε, for
0 ≤ ε ≤ δ ≤ 1. Proposition 7.46's bound BitString.oddBlrAcceptance_le_of_fourierCoeff_le
takes any M ≥ 0 above the odd coefficients. The checked clients in
CslibFrontierTests/BooleanAnalysisHastadTest.lean
compute dictators, constants, odd and even parities, (7.4) at a [-1, 1]-valued constant,
soundness for a concrete constant and for a hypothetical f, and the NAND of two bits, which
passes the Odd BLR test with probability 3/8 although its odd coefficients are -1/2, the
counterexample to the bound with a negative maximum.
Main definitions #
Cslib.BitString.oddBlrAcceptance: the acceptance probability of the Odd BLR test.Cslib.BitString.hastadAcceptance: the acceptance probability of Håstad's test.Cslib.BitString.hastadValue: the acceptance probability of Håstad's test on a function with values in[-1, 1].
Main results #
Cslib.BitString.hastadAcceptance_eq_sum,Cslib.BitString.hastadValue_eq_sum: the Fourier formula (7.4), for Boolean and for real functions;Cslib.BitString.hastadAcceptance_eq_hastadValuerelates the two.Cslib.BitString.oddBlrAcceptance_eq_sum,Cslib.BitString.oddBlrAcceptance_le_of_fourierCoeff_le: Proposition 7.46.Cslib.BitString.hastadAcceptance_parityOn: the acceptance probability of parities.Cslib.BitString.hastadAcceptance_dictator,Cslib.BitString.hastadValue_le_of_stableInfluence_le,Cslib.BitString.hastadValue_le_one,Cslib.BitString.hastadAcceptance_le_of_stableInfluence_le,Cslib.BitString.hastadAcceptance_le_one: the completeness and soundness clauses of Theorem 7.42.
References #
The acceptance probability of Håstad's test with noise rate δ on f: over independent
uniformly random strings x and y, a uniformly random bit b, and a string z' that flips each
bit of z = x + y + (b, …, b) independently with probability δ / 2, the probability that
f(x) + f(y) + f(z') = b. It is a probability for 0 ≤ δ ≤ 2.
The defining formula of hastadAcceptance.
The acceptance probability of the Odd BLR test on f: over independent uniformly random
strings x and y and a uniformly random bit b, the probability that
f(x) + f(y) + f(x + y + (b, …, b)) = b.
The defining formula of oddBlrAcceptance.
The acceptance probability of Håstad's test with noise rate δ on a real function g,
for g with values in [-1, 1] O'Donnell, Exercise 7.22: each query of g at w
returns an independent random sign with mean g w, so that the check g(x) g(y) g(z') = b, with
b read as a sign, passes with probability 1/2 + 1/2 b g(x) g(y) g(z'), the multilinear
extension of the check. The strings x, y, the bit b and the noisy z' are drawn as in
hastadAcceptance, which is the case of signs of a Boolean function
(hastadAcceptance_eq_hastadValue).
The defining formula of hastadValue.
On a Boolean function read as signs, the acceptance probability of Håstad's test on real
functions is that of the test on f.
Håstad's test without noise is the Odd BLR test.
The acceptance probability of Håstad's test on real functions
O'Donnell, (7.4) and Exercise 7.22: on a real function g the test accepts with
probability 1/2 + 1/2 ∑_{|S| odd} (1 - δ) ^ |S| ĝ(S)³.
The acceptance probability of Håstad's test O'Donnell, (7.4): reading f
as signs, the test accepts with probability 1/2 + 1/2 ∑_{|S| odd} (1 - δ) ^ |S| F̂(S)³.
The acceptance probability of the Odd BLR test O'Donnell, Proposition 7.46:
reading f as signs, the test accepts with probability 1/2 + 1/2 ∑_{|S| odd} F̂(S)³.
The Odd BLR test accepts with probability at most 1/2 + 1/2 M for any nonnegative bound
M on the odd Fourier coefficients O'Donnell, Proposition 7.46. The book states
this for M = max_{|S| odd} F̂(S), which needs M ≥ 0: for the NAND of two bits both odd
coefficients are -1/2, and the test accepts with probability 3/8.
Håstad's test on parities: a parity on S is accepted with probability
1/2 + 1/2 (1 - δ) ^ |S| if |S| is odd, and 1/2 if |S| is even.
Completeness of Håstad's test O'Donnell, Theorem 7.42: dictators are
accepted with probability 1 - δ / 2.
Soundness of Håstad's test on real functions O'Donnell, Theorem 7.42, (7.6) and
Exercise 7.22: for 0 ≤ ε ≤ δ ≤ 1 and g with values in [-1, 1], if every
(1 - ε)-stable influence of g is at most ε, so that g has no (ε, ε)-notable coordinates,
then the test accepts with probability at most 1/2 + 1/2 √ε. Every odd S contains some
coordinate i, so ((1 - δ) ^ |S| ĝ(S))² ≤ (1 - ε) ^ (|S| - 1) ĝ(S)² is at most
Infᵢ^{(1 - ε)}[g] ≤ ε, and the odd weight of g is at most 𝔼 g² ≤ 1.
Soundness of Håstad's test O'Donnell, Theorem 7.42 and (7.6): for
0 ≤ ε ≤ δ ≤ 1, if every (1 - ε)-stable influence of f, read as signs, is at most ε, so that
f has no (ε, ε)-notable coordinates, then the test accepts with probability at most
1/2 + 1/2 √ε. This is the Boolean case of hastadValue_le_of_stableInfluence_le.
Håstad's test accepts real functions with values in [-1, 1] with probability at most one
for 0 ≤ δ ≤ 2, where the noise is a probability distribution. This gives the soundness clause of
Theorem 7.42 with λ(ε) = 1/2 for ε > δ O'Donnell, Theorem 7.42.
Håstad's test accepts with probability at most one for 0 ≤ δ ≤ 2, where the noise is a
probability distribution. This gives the soundness clause of Theorem 7.42 with λ(ε) = 1/2 for
ε > δ O'Donnell, Theorem 7.42.