Documentation

CslibFrontier.Foundations.BooleanAnalysis.LinearityRejection

The rejection probability of the BLR test #

If the Blum–Luby–Rubinfeld test accepts f with probability at least 1 - ε, then f is at relative Hamming distance at most ε from some parity (BitString.exists_hammingDist_parityOn_le_of_le_blrAcceptance). Conversely, a function at relative distance δ from a parity is rejected with probability about 3δ when δ is small, and this constant is sharp O'Donnell, Exercise 1.28.

Read f as the signs F x = (-1) ^ f x. If f is at relative distance δ from the parity on S, then F̂(S) = 1 - 2δ, and every other coefficient has absolute value at most 2δ (BitString.abs_fourierCoeff_signVal_le_of_ne), since distinct parities are half the cube apart. Splitting ∑_T F̂(T)³ into the term at S and the rest, bounded with Parseval's identity, the acceptance probability 1/2 + 1/2 ∑_T F̂(T)³ is at most 1 - 3δ + 10δ² - 8δ³ (BitString.blrAcceptance_le_of_hammingDist_parityOn). The bound holds for every parity, not only for the nearest one, and for every δ; it is attained at δ = 0 (parities) and δ = 1 (their negations).

The indicator of a single nonzero point a, x ↦ decide (x = a), shows that 3 cannot be improved. Its coefficients are [S = ∅] - 2 χ_S(a) / 2ⁿ (BitString.fourierCoeff_signVal_decide_eq), so the test accepts it with probability exactly 1 - 3/2ⁿ + 6/4ⁿ (BitString.blrAcceptance_decide_eq). When there are at least two coordinates, its nearest parity is the zero parity, at relative distance δ = 2⁻ⁿ (BitString.hammingDist_decide_eq_parityOn_empty, BitString.one_le_hammingDist_decide_eq_parityOn). Its rejection probability is therefore exactly 3δ - 6δ². Hence, for every c > 3, no bound of the form cδ - Cδ² on the rejection probability holds for all functions at small distance δ from their nearest parity (BitString.not_forall_mul_sub_mul_sq_le_one_sub_blrAcceptance).

Main results #

References #

Small coefficients away from a close parity #

theorem Cslib.BitString.abs_fourierCoeff_signVal_le_of_ne {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → Bool) {S T : Finset ι} (h : S ≠ T) :
|fourierCoeff (fun (x : ι → Bool) => signVal (f x)) S| ≤ 2 * (↑(hammingDist f (parityOn T)) / 2 ^ Fintype.card ι)

Coefficients away from a close parity are small: if f is at relative Hamming distance δ from the parity on T, then, reading f as signs, its coefficient on every other set has absolute value at most 2δ O'Donnell, Exercise 1.28(a).

The rejection probability #

theorem Cslib.BitString.blrAcceptance_le_of_hammingDist_parityOn {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → Bool) {S : Finset ι} {δ : ℝ} (hδ : ↑(hammingDist f (parityOn S)) / 2 ^ Fintype.card ι = δ) :
blrAcceptance f ≤ 1 - 3 * δ + 10 * δ ^ 2 - 8 * δ ^ 3

The BLR test rejects with probability at least 3δ - 10δ² + 8δ³: if f is at relative Hamming distance δ from some parity, then the test accepts f with probability at most 1 - 3δ + 10δ² - 8δ³ O'Donnell, Exercise 1.28(b). The parity need not be the nearest one.

The indicator of a point #

theorem Cslib.BitString.blrAcceptance_decide_eq {ι : Type u_1} [Fintype ι] [DecidableEq ι] {a : ι → Bool} (ha : a ≠ 0) :
(blrAcceptance fun (x : ι → Bool) => decide (x = a)) = 1 - 3 / 2 ^ Fintype.card ι + 6 / (2 ^ Fintype.card ι) ^ 2

The BLR test on the indicator of a point: the test accepts the indicator of a nonzero point with probability exactly 1 - 3/2ⁿ + 6/4ⁿ.

theorem Cslib.BitString.hammingDist_decide_eq_parityOn_empty {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → Bool) :
hammingDist (fun (x : ι → Bool) => decide (x = a)) (parityOn ∅) = 1

The indicator of a point differs from the zero parity at exactly one input.

theorem Cslib.BitString.one_le_hammingDist_decide_eq_parityOn {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → Bool) (hι : 2 ≤ Fintype.card ι) (S : Finset ι) :
1 ≤ hammingDist (fun (x : ι → Bool) => decide (x = a)) (parityOn S)

With at least two coordinates, the indicator of a point is at Hamming distance at least one from every parity, so the zero parity is a nearest parity to it.

Sharpness of the constant three #

theorem Cslib.BitString.not_forall_mul_sub_mul_sq_le_one_sub_blrAcceptance {c : ℝ} (hc : 3 < c) (C : ℝ) {δ₀ : ℝ} (hδ₀ : 0 < δ₀) :
¬∀ (n : ℕ) (f : (Fin n → Bool) → Bool) (S : Finset (Fin n)), (∀ (T : Finset (Fin n)), hammingDist f (parityOn S) ≤ hammingDist f (parityOn T)) → ↑(hammingDist f (parityOn S)) / 2 ^ n ≤ δ₀ → c * (↑(hammingDist f (parityOn S)) / 2 ^ n) - C * (↑(hammingDist f (parityOn S)) / 2 ^ n) ^ 2 ≤ 1 - blrAcceptance f

The constant 3 in the BLR rejection bound is sharp: for every c > 3, every C and every δ₀ > 0, it is not the case that every function f on n bits at relative Hamming distance δ ≤ δ₀ from its nearest parity is rejected with probability at least cδ - Cδ² O'Donnell, Exercise 1.28(c). The indicator of a nonzero point on n ≥ 2 bits, with δ = 2⁻ⁿ, is rejected with probability exactly 3δ - 6δ².