Documentation

CslibFrontier.Computability.PCP.Approximation.Hastad.LinearTest

Håstad's 3-Bit Linear Test and Spectral Decoding Weights #

This module formalizes Håstad's noisy 3-bit linear test on folded (odd, Cslib.BitString.IsOdd) Long Code tables over a single projection π : β → γ, its exact Walsh–Fourier expansion, and the Cauchy–Schwarz and Parseval soundness bound via low-degree spectral decoding weights [Has01]. The Long Code, folding and the mod-2 projection Cslib.BitString.projectSet live in CslibFrontier.Foundations.BooleanAnalysis.LongCode.

Main definitions #

Main results #

References #

Håstad's 3-bit linear test and its Fourier expansion #

noncomputable def Cslib.PCP.Hastad.linearCorr {β : Type u_2} {γ : Type u_3} [Fintype β] [DecidableEq β] [Fintype γ] [DecidableEq γ] (π : β → γ) (δ : ℝ) (B : (γ → Bool) → Bool) (A : (β → Bool) → Bool) :

The correlation of Håstad's 3-bit linear test on a projection π : β → γ at noise rate δ between tables B : (γ → Bool) → Bool and A : (β → Bool) → Bool Håstad, Section 5: the expected product of the ±1 signs of B f, A g, and A ((f ∘ π) + g + μ) over uniform f : γ → Bool, uniform g : β → Bool, and δ-biased Bernoulli noise μ : β → Bool.

noncomputable def Cslib.PCP.Hastad.linearProb {β : Type u_2} {γ : Type u_3} [Fintype β] [DecidableEq β] [Fintype γ] [DecidableEq γ] (π : β → γ) (δ : ℝ) (B : (γ → Bool) → Bool) (A : (β → Bool) → Bool) :

The acceptance probability of Håstad's 3-bit linear test: the probability that (B f ^^ A g ^^ A ((f ∘ π) + g + μ)) = false under uniform f, g and δ-biased noise μ.

theorem Cslib.PCP.Hastad.linearProb_eq_add_linearCorr {β : Type u_2} {γ : Type u_3} [Fintype β] [DecidableEq β] [Fintype γ] [DecidableEq γ] (π : β → γ) (δ : ℝ) (B : (γ → Bool) → Bool) (A : (β → Bool) → Bool) :
linearProb π δ B A = 1 / 2 + 1 / 2 * linearCorr π δ B A

The acceptance probability of Håstad's 3-bit linear test is 1 / 2 + 1 / 2 * linearCorr π δ B A.

theorem Cslib.PCP.Hastad.linearCorr_longCode {β : Type u_2} {γ : Type u_3} [Fintype β] [DecidableEq β] [Fintype γ] [DecidableEq γ] (π : β → γ) (δ : ℝ) (x : β) :

Completeness of Håstad's 3-bit linear test (correlation): on matching Long Code tables longCode (π x) and longCode x, the correlation is 1 - 2 * δ.

theorem Cslib.PCP.Hastad.linearProb_longCode {β : Type u_2} {γ : Type u_3} [Fintype β] [DecidableEq β] [Fintype γ] [DecidableEq γ] (π : β → γ) (δ : ℝ) (x : β) :

Completeness of Håstad's 3-bit linear test (probability): matching Long Code tables longCode (π x) and longCode x pass the test with probability 1 - δ.

theorem Cslib.PCP.Hastad.linearCorr_eq_sum {β : Type u_2} {γ : Type u_3} [Fintype β] [DecidableEq β] [Fintype γ] [DecidableEq γ] (π : β → γ) (δ : ℝ) (B : (γ → Bool) → Bool) (A : (β → Bool) → Bool) :
linearCorr π δ B A = ∑ T : Finset β, (1 - 2 * δ) ^ T.card * BitString.fourierCoeff (fun (g : β → Bool) => BitString.signVal (A g)) T ^ 2 * BitString.fourierCoeff (fun (f : γ → Bool) => BitString.signVal (B f)) (BitString.projectSet π T)

Walsh–Fourier expansion of Håstad's 3-bit linear test Håstad, proof of Lemma 5.2, Eqs. (9)–(12): the correlation equals ∑ T : Finset β, (1 - 2 * δ) ^ #T * fourierCoeff F_A T ^ 2 * fourierCoeff F_B (projectSet π T).

Spectral decoding weights and Cauchy–Schwarz soundness bound #

noncomputable def Cslib.PCP.Hastad.spectralWeight {α : Type u_1} [Fintype α] [DecidableEq α] (k : ℕ) (A : (α → Bool) → Bool) (x : α) :

The low-degree spectral decoding weight of x : α for table A : (α → Bool) → Bool at degree cutoff k: ∑_{T : #T < k, x ∈ T} fourierCoeff F_A T ^ 2 / #T Håstad, Proof of Lemma 5.2.

theorem Cslib.PCP.Hastad.spectralWeight_nonneg {α : Type u_1} [Fintype α] [DecidableEq α] (k : ℕ) (A : (α → Bool) → Bool) (x : α) :
theorem Cslib.PCP.Hastad.sum_spectralWeight_le_one {α : Type u_1} [Fintype α] [DecidableEq α] (k : ℕ) (A : (α → Bool) → Bool) :
∑ x : α, spectralWeight k A x ≤ 1

By Parseval's identity, the spectral decoding weights form a sub-probability distribution: ∑ x, spectralWeight k A x ≤ 1.

theorem Cslib.PCP.Hastad.linearCorr_sq_le {β : Type u_2} {γ : Type u_3} [Fintype β] [DecidableEq β] [Fintype γ] [DecidableEq γ] (π : β → γ) {δ : ℝ} (hδ0 : 0 ≤ δ) (hδ1 : δ ≤ 1 / 2) (k : ℕ) {B : (γ → Bool) → Bool} (hB : BitString.IsOdd B) (A : (β → Bool) → Bool) :
linearCorr π δ B A ^ 2 ≤ (1 - 2 * δ) ^ (2 * k) + ↑k ^ 2 * ∑ x : β, spectralWeight k A x * spectralWeight k B (π x)

Cauchy–Schwarz and Parseval soundness bound for Håstad's 3-bit linear test Håstad, Lemma 5.2: for any folded (odd) table B, any table A, noise rate 0 ≤ δ ≤ 1 / 2, and degree cutoff k, the squared correlation linearCorr π δ B A ^ 2 is at most (1 - 2 * δ) ^ (2 * k) + k ^ 2 * ∑ x, spectralWeight k A x * spectralWeight k B (π x).

The linearity test and its low-degree cubic weight #

theorem Cslib.PCP.Hastad.linearCorr_id_eq_sum {β : Type u_2} [Fintype β] [DecidableEq β] (δ : ℝ) (A : (β → Bool) → Bool) :
linearCorr id δ A A = ∑ T : Finset β, (1 - 2 * δ) ^ T.card * BitString.fourierCoeff (fun (g : β → Bool) => BitString.signVal (A g)) T ^ 3

The noisy linearity test Arora and Barak, Lemma 19.12: testing one table A against itself along the identity, the correlation is the noise-weighted cubic Fourier sum ∑ T, (1 - 2 δ) ^ #T * F̂(T) ^ 3.

theorem Cslib.PCP.Hastad.two_mul_sub_le_sum_lowDegree_cube_mul {β : Type u_2} [Fintype β] [DecidableEq β] {ρ ε δ : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ ≤ 1 / 2) (hε : 0 < ε) {k : ℕ} (hk : Real.log (1 / ε) / (2 * ρ) ≤ ↑k) (A : (β → Bool) → Bool) (hA : 1 / 2 + δ ≤ linearProb id ρ A A) :
2 * δ - ε ≤ ∑ T : Finset β with T.card ≤ k, BitString.fourierCoeff (fun (g : β → Bool) => BitString.signVal (A g)) T ^ 3 * (1 - 2 * ρ) ^ T.card

Corollary 19.13 of Arora and Barak, corrected: the noise-weighted low-degree cubic sum. If the noisy linearity test with noise rate ρ ∈ (0, 1/2] accepts A with probability at least 1/2 + δ, then for ε > 0 and every degree cutoff k ≥ ln (1/ε) / (2 ρ), ∑_{#T ≤ k} F̂(T) ^ 3 (1 - 2 ρ) ^ #T ≥ 2 δ - ε.

This is not the printed corollary, which claims the bound for the unweighted sum ∑_{#T ≤ k} F̂(T) ^ 3. That statement is false: for the table on three bits that is -1 exactly at 000 and 111, at ρ = ε = 1/4, the test accepts with probability 1/2 + 1/64, but the unweighted sum is 1/8 - 3/8 = -1/4 < 1/32 - 1/4 for every k ≥ 2. The coefficients of degree above k contribute at most (1 - 2 ρ) ^ k ≤ ε in absolute value, by Parseval's identity and |F̂(T)| ≤ 1.

theorem Cslib.PCP.Hastad.two_mul_sub_le_sum_lowDegree_abs_cube {β : Type u_2} [Fintype β] [DecidableEq β] {ρ ε δ : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ ≤ 1 / 2) (hε : 0 < ε) {k : ℕ} (hk : Real.log (1 / ε) / (2 * ρ) ≤ ↑k) (A : (β → Bool) → Bool) (hA : 1 / 2 + δ ≤ linearProb id ρ A A) :
2 * δ - ε ≤ ∑ T : Finset β with T.card ≤ k, |BitString.fourierCoeff (fun (g : β → Bool) => BitString.signVal (A g)) T| ^ 3

Corollary 19.13 of Arora and Barak, corrected: the low-degree absolute cubic sum. Under the hypotheses of two_mul_sub_le_sum_lowDegree_cube_mul, ∑_{#T ≤ k} |F̂(T)| ^ 3 ≥ 2 δ - ε. This is not the printed corollary, which has the signed sum ∑_{#T ≤ k} F̂(T) ^ 3.