Håstad's test as a Max-E3-Lin instance #
The predicates of Max-E3-Lin are the 3-variable linear equations x₁ + x₂ + x₃ = b over F₂
O'Donnell, Definition 7.22: the parity relations Logic.PL.CSP.paritySem
of CslibFrontier.Logics.Propositional.CSP.Boolean, the relation symbol b holding when the XOR
of the bits is b, at the arity Logic.PL.CSP.e3LinArity three. A check of Håstad's test is
such an equation on the answers to three queries, so the test is a Max-E3-Lin instance on the
strings
O'Donnell, Section 7.3, p. 187. With every sign of a randomized assignment g
of mean g w, an equation g(x) + g(y) + g(z) = b holds with probability
1/2 + 1/2 b g(x) g(y) g(z), b read as a sign (Logic.PL.CSP.satProb_paritySem).
The noise of Håstad's test, flipping each bit with probability δ / 2, is a finite uniform choice
when the flip probability a / q is rational: bit i flips when an independent uniform digit
m i ∈ Fin q is below a (BitString.expect_fin_lt_eq_bernoulliAverage). So for a ≤ q,
Logic.PL.CSP.hastadTest a q n lists one check for each choice of x, y, b and m, and on
every real g its value is Håstad's acceptance probability at noise rate 2 a / q
(Logic.PL.CSP.expectedSatFraction_hastadTest), so that its value at a Boolean f is
BitString.hastadAcceptance (2 a / q) f (Logic.PL.CSP.satFraction_hastadTest). The test realizes
the noise at a rational rate, as the identification of testers with CSP instances requires; the
book ignores irrational rates there O'Donnell, Section 7.3, p. 187.
By (7.4) for functions with values in [-1, 1] O'Donnell, Exercise 7.22, for
0 < a and 2 a < q this is a (1/2, 1 - a / q)-Dictator-vs.-No-Notables test using the
Max-E3-Lin predicates (Logic.PL.CSP.isDictatorVsNoNotables_hastadTest). For every real
0 < δ < 1/2, a rational a / q ≤ δ then gives a (1/2, 1 - δ) test
(Logic.PL.CSP.exists_isDictatorVsNoNotables_e3Lin) O'Donnell, Theorem 7.42.
Through Theorem 7.40, which is not formalized, this gives UG-hardness of
(1/2 + δ, 1 - δ)-approximating Max-E3-Lin O'Donnell, Corollary 7.44. The gap
problem on linear systems over F₂ is Complexity.GapLin in
CslibFrontier.Computability.PCP.Approximation.GapLin, NP-hard for one constant gap
(Complexity.GapLin_npHard).
Usage #
Open Cslib.Logic.PL and Cslib.Logic.PL.CSP. Logic.PL.CSP.hastadTest a q n has
2 ^ (2 n + 1) q ^ n checks, one Logic.PL.CSP.hastadCheck a x y b m for each x, y, b and
m (Logic.PL.CSP.mem_hastadTest); the checks are exposed, so a concrete check can be
evaluated with decide. For its value on a concrete function, rewrite with
Logic.PL.CSP.satFraction_hastadTest or Logic.PL.CSP.expectedSatFraction_hastadTest and use
the lemmas of CslibFrontier.Foundations.BooleanAnalysis.HastadTest. The checked clients in
CslibFrontierTests/BooleanAnalysisHastadTest.lean
check Theorem 7.42 at flip probability 1/4 and at the irrational δ = 1/(2√2), the passing
probability 3/4 of a dictator in hastadTest 1 4 5, membership and evaluation of concrete
checks, and the value 1/2 of the constant 0, each query a fair coin. Run
scripts/build.sh CslibFrontierTests.BooleanAnalysisHastadTest from the repository root to check
them.
Main definitions #
Cslib.Logic.PL.CSP.e3LinArity: the arity of the Max-E3-Lin predicatesparitySem.Cslib.Logic.PL.CSP.hastadCheck,Cslib.Logic.PL.CSP.hastadTest: Håstad's test at a rational flip probability, as a Max-E3-Lin instance.
Main results #
Cslib.Logic.PL.CSP.satProb_paritySem: an equation at a randomized assignment.Cslib.Logic.PL.CSP.mem_hastadTest,Cslib.Logic.PL.CSP.wellFormed_hastadTest: the checks of the test, which are Max-E3-Lin equations.Cslib.Logic.PL.CSP.expectedSatFraction_hastadTest,Cslib.Logic.PL.CSP.satFraction_hastadTest: the value of the test is Håstad's acceptance probability.Cslib.Logic.PL.CSP.isDictatorVsNoNotables_hastadTest,Cslib.Logic.PL.CSP.exists_isDictatorVsNoNotables_e3Lin: Theorem 7.42.
References #
The arity of the Max-E3-Lin predicates O'Donnell, Definition 7.22: three.
With the parity relations paritySem, the relation symbol b at arity three is the equation
x₁ + x₂ + x₃ = b over F₂ (paritySem_three).
An equation at a randomized assignment: with independent signs of means g u, g v and
g w, the equation u + v + w = b holds with probability 1/2 + 1/2 b g(u) g(v) g(w), b read
as a sign.
The check of Håstad's test for the outcome x, y, b, m, at flip probability a / q:
query the strings x, y and z' = x + y + (b, …, b) + P, where the mask P flips bit i
exactly when the digit m i ∈ Fin q is below a, and accept when the three answers sum to b
in F₂.
Håstad's test on n bits at the rational flip probability a / q, as a Max-E3-Lin
instance on the strings: one check hastadCheck a x y b m for each choice of strings x, y, a
bit b and digits m : Fin n → Fin q, so that a uniformly random check is Håstad's test at noise
rate 2 a / q O'Donnell, proof of Theorem 7.42.
The checks of Håstad's test are the checks hastadCheck a x y b m.
The checks of Håstad's test are Max-E3-Lin equations.
Håstad's test is a Dictator-vs.-No-Notables test O'Donnell, Theorem 7.42 and
Exercise 7.22: for 0 < a and 2 a < q, flipping each bit with probability
a / q, it is a (1/2, 1 - a / q)-Dictator-vs.-No-Notables test using the Max-E3-Lin predicates,
with error err(ε) = √ε / 2 for ε ≤ 2 a / q and 1/2 otherwise.
Theorem 7.42 O'Donnell, Theorem 7.42 and Exercise 7.22: for every
0 < δ < 1/2 there is a (1/2, 1 - δ)-Dictator-vs.-No-Notables test using the Max-E3-Lin
predicates, the 3-variable F₂-linear equations. It is Håstad's test flipping each bit with a
probability 1 / q ≤ δ (hastadTest), whose completeness 1 - 1 / q is at least 1 - δ.