Documentation

CslibFrontier.Foundations.Data.Code.PuncturedBallFourier

Fourier estimates for the punctured Hamming ball #

Let B = {x ∈ 𝔽₂ⁿ | 0 < |x| ≤ w} have V elements and let μ̂(y) = charSum B y / V be the normalized Fourier transform of its indicator. Lemma 3.1 of [Sag26] bounds the third moment 𝔼_y |μ̂(y)| ^ 3 = O(1 / (V n ^ 3)) and the tail Pr_y[|μ̂(y)| > 1 / n] ≤ 2 ^ (-n + 2 n (log₂ n / w) log₂ (e w / log₂ n)) for log n ≪ w ≤ (1 / 2 - ε) n. Cslib.Code.PuncturedBallFourierBounds n w C states the two bounds for one n and w with moment constant C; it is the input of the asymptotic code construction in CslibFrontier.Foundations.Data.Code.OddCircuitAsymptotic.

Saglam derives Lemma 3.1 from two results of Kirshner and Samorodnitsky [KirshnerSamorodnitsky2021, Corollary 1.4 and Theorem 1.5] about polynomials f of degree at most w on the cube, in the specializations quoted in [Saglam2027, Appendix A]. Those results are not proved here; they are stated as the hypotheses Cslib.Code.KSThirdMomentBound and Cslib.Code.KSTailBound, in nats:

Here h = Real.binEntropy is the binary entropy in nats. Saglam writes both in bits with base-2 logarithms (2 ^ (n (H₂(ρ)/2 - γ₂(ρ))), 2 ^ (n (H₂(y) - 1))); multiplying the exponents by log 2 gives the forms above. A polynomial of degree at most w is written by its Fourier coefficients a x, which vanish for |x| > w. The hypotheses are only required for 0 < w and 2 w < n, the range in which they are used.

These forms agree with arXiv:1909.11929v1, which states both bounds for every n with no error term. Saglam's γ is H₂(ρ) / 2 - ψ(3, ρ), by Kirshner–Samorodnitsky Proposition 2.6 at p = 3 with t = 1 - 2 δ, which gives Saglam's 1 - 2 u = √(ρ / (2 - 3 ρ)). Saglam's integral is their tail exponent τ on y ≤ 1 / 2 - √(ρ (1 - ρ)) (their §2.1.1–2.1.2).

Everything else in Saglam's Appendix A is proved: μ̂ has degree at most w and 𝔼 μ̂ ^ 2 = 1 / V (Cslib.Code.sum_charSum_sq); γ(ρ) ≥ c ρ for 0 < ρ ≤ 1 / 2 - ε (Cslib.Code.exists_mul_le_ksGamma); T(ρ, y) ≤ h(ρ) - 2 ρ y (Cslib.Code.ksTailExponent_le); exp (n h(w / n)) ≤ (n + 1) V (Cslib.exp_mul_binEntropy_le_succ_mul_choose); and h(y) ≤ y log (e / y). Together they give Cslib.Code.exists_puncturedBallFourierBounds_of_ks: Lemma 3.1 with explicit constants, the moment constant being C = 2.

Saglam proves γ(ρ) = (ρ / 2) log₂ (1 / ρ) + O(ρ). The weaker γ(ρ) ≥ c_ε ρ suffices because w ≥ K log₂ n is assumed with K at our disposal. Here it follows from (1 - ρ) ^ 4 < ρ (2 - 3 ρ) ^ 3 on (3 / 20, 1 / 2), which makes γ strictly decreasing there to γ(1 / 2) = 0, and from elementary logarithm bounds on (0, 3 / 20].

Main definitions #

Main results #

References #

theorem Cslib.Code.sum_charSum_sq {ι : Type u_1} [Fintype ι] [DecidableEq ι] (B : Finset (ι → ZMod 2)) :
∑ y : ι → ZMod 2, charSum B y ^ 2 = 2 ^ Fintype.card ι * ↑B.card

Parseval for charSum: ∑_y charSum B y ^ 2 = 2 ^ n |B|, so 𝔼_y μ̂(y) ^ 2 = 1 / |B| for μ̂ = charSum B / |B|.

theorem Cslib.Code.charSum_div_card_eq {ι : Type u_1} [Fintype ι] [DecidableEq ι] (B : Finset (ι → ZMod 2)) (y : ι → ZMod 2) :
charSum B y / ↑B.card = ∑ x : ι → ZMod 2, (if x ∈ B then (↑B.card)⁻¹ else 0) * (-1) ^ (y ⬝ᵥ x).val

μ̂ = charSum B / |B| is the Fourier expansion with coefficients 1 / |B| on B.

Lemma 3.1 of [Sag26] for one n and w, with moment constant C. Let B = {x ∈ 𝔽₂ⁿ | x ≠ 0, |x| < w + 1} and μ̂ = charSum B / |B|. Then 𝔼_y |μ̂(y)| ^ 3 ≤ C / (|B| n ^ 3) and Pr_y[|μ̂(y)| > 1 / n] ≤ 2 ^ (-n + 2 n (log₂ n / w) log₂ (e w / log₂ n)), with expectations and probabilities over uniform y ∈ 𝔽₂ⁿ. Saglam states the moment bound as O(1 / (V n ^ 3)).

noncomputable def Cslib.Code.ksGamma (ρ : ℝ) :

The exponent γ of the Kirshner–Samorodnitsky third-moment bound as specialized in [Saglam2027, Appendix A], in nats: γ(ρ) = -(ρ / 2) log ρ - 2 (1 - ρ) log (1 - ρ) - log 2 + (1 - 3 ρ / 2) log (2 - 3 ρ). Saglam's γ uses base-2 logarithms and equals this value divided by log 2.

theorem Cslib.Code.ksGamma_half :
ksGamma (1 / 2) = 0

The exponent vanishes at the end of the range: γ(1 / 2) = 0.

γ is strictly decreasing on [3 / 20, 1 / 2], because γ'(ρ) = log ((1 - ρ) ^ 4 / (ρ (2 - 3 ρ) ^ 3)) / 2 is negative there.

theorem Cslib.Code.exists_mul_le_ksGamma {ε : ℝ} (hε : 0 < ε) :
∃ c > 0, ∀ (ρ : ℝ), 0 < ρ → ρ ≤ 1 / 2 - ε → c * ρ ≤ ksGamma ρ

Positivity of the exponent [Saglam2027, Appendix A]: for every ε > 0 there is c > 0 with c ρ ≤ γ(ρ) for 0 < ρ ≤ 1 / 2 - ε.

noncomputable def Cslib.Code.ksTailIntegrand (ρ z : ℝ) :

The integrand log ((1 - 2 ρ + √((1 - 2 ρ) ^ 2 - 4 z (1 - z))) / (2 (1 - z))) of the Kirshner–Samorodnitsky tail exponent [Saglam2027, Appendix A], in nats.

noncomputable def Cslib.Code.ksTailExponent (ρ y : ℝ) :

The Kirshner–Samorodnitsky tail exponent T(ρ, y) = h(ρ) + ∫_0^y ksTailIntegrand ρ z dz [Saglam2027, Appendix A], in nats; Saglam's T is this value divided by log 2.

theorem Cslib.Code.ksTailExponent_le {ρ y : ℝ} (hρ0 : 0 ≤ ρ) (hρ : ρ < 1 / 2) (hy0 : 0 ≤ y) (hy : y ≤ 1 / 2) :

The tail exponent bound [Saglam2027, Appendix A]: the integrand is at most log (1 - 2 ρ) ≤ -2 ρ, so T(ρ, y) ≤ h(ρ) - 2 ρ y for 0 ≤ y ≤ 1 / 2.

theorem Cslib.Code.sq_le_half_sub_sqrt {ε ρ : ℝ} (hε : 0 ≤ ε) (hρ0 : 0 ≤ ρ) (hρ : ρ ≤ 1 / 2 - ε) :
ε ^ 2 ≤ 1 / 2 - √(ρ * (1 - ρ))

ε ^ 2 ≤ 1 / 2 - √(ρ (1 - ρ)) for 0 ≤ ρ ≤ 1 / 2 - ε.

The Kirshner–Samorodnitsky third-moment bound [KirshnerSamorodnitsky2021, Corollary 1.4], in the specialization quoted in [Saglam2027, Appendix A], imported as a hypothesis: for 0 < w, 2 w < n and ρ = w / n, every f(y) = ∑_x a x (-1) ^ (y ⬝ᵥ x) with a x = 0 for |x| > w (a polynomial of degree at most w in the signs (-1) ^ y_i) satisfies 𝔼|f| ^ 3 ≤ (𝔼 f ^ 2) ^ (3 / 2) exp (n (h(ρ) / 2 - γ(ρ))).

The Kirshner–Samorodnitsky tail bound [KirshnerSamorodnitsky2021, Theorem 1.5], in the specialization quoted in [Saglam2027, Appendix A], imported as a hypothesis: for 0 < w, 2 w < n, ρ = w / n and every f of degree at most w as in KSThirdMomentBound, every integer k with k / n ≤ 1 / 2 - √(ρ (1 - ρ)) satisfies Pr[|f| > √(𝔼 f ^ 2) exp (n (T(ρ, k / n) - h(ρ) / 2))] ≤ exp (n (h(k / n) - log 2)). Saglam and Kirshner–Samorodnitsky state the event with ≥. The strict event used here is smaller, so this hypothesis is weaker. The weakening, like the restriction 0 < w, is needed: as printed, Theorem 1.5 fails at degree 0. For f ≡ 1 and k = 0 the threshold is ‖f‖₂ = 1, so the ≥ event has probability 1 > 2 ^ (-n).

theorem Cslib.Code.moment_le_of_ksThirdMomentBound {n w : ℕ} (hKS : KSThirdMomentBound n w) (hw0 : 0 < w) (hwn : 2 * w < n) {c K : ℝ} (hc0 : 0 < c) (hc : c * (↑w / ↑n) ≤ ksGamma (↑w / ↑n)) (hcK : 4 ≤ c * K) (hK : K * Real.logb 2 ↑n ≤ ↑w) :
have B := {x : Fin n → ZMod 2 | x ≠ 0 ∧ hammingNorm x < w + 1}; (∑ y : Fin n → ZMod 2, |charSum B y / ↑B.card| ^ 3) / 2 ^ n ≤ 2 / (↑B.card * ↑n ^ 3)

The moment estimate of Lemma 3.1 [Saglam2027, Appendix A] from the Kirshner–Samorodnitsky third-moment bound: if γ(ρ) ≥ c ρ at ρ = w / n and w ≥ K log₂ n with c K ≥ 4, then 𝔼|μ̂| ^ 3 ≤ 2 / (V n ^ 3).

theorem Cslib.Code.two_rpow_tail_eq (n w : ℝ) :
2 ^ (-n + 2 * n * (Real.logb 2 n / w) * Real.logb 2 (Real.exp 1 * w / Real.logb 2 n)) = Real.exp (n * (2 * (Real.logb 2 n / w) * Real.log (Real.exp 1 / (Real.logb 2 n / w)) - Real.log 2))

The tail bound of Lemma 3.1 in nats: with u = log₂ n / w, 2 ^ (-n + 2 n u log₂ (e w / log₂ n)) = exp (n (2 u log (e / u) - log 2)).

theorem Cslib.Code.tail_le_of_ksTailBound {n w : ℕ} (hKS : KSTailBound n w) (hw0 : 0 < w) {ε K : ℝ} (hε : 0 < ε) (hρ : ↑w ≤ (1 / 2 - ε) * ↑n) (hK : 2 / ε ^ 2 ≤ K) (hnε : 2 / ε ^ 2 ≤ ↑n) (hKw : K * Real.logb 2 ↑n ≤ ↑w) :
have B := {x : Fin n → ZMod 2 | x ≠ 0 ∧ hammingNorm x < w + 1}; ↑{y : Fin n → ZMod 2 | 1 / ↑n < |charSum B y / ↑B.card|}.card / 2 ^ n ≤ 2 ^ (-↑n + 2 * ↑n * (Real.logb 2 ↑n / ↑w) * Real.logb 2 (Real.exp 1 * ↑w / Real.logb 2 ↑n))

The tail estimate of Lemma 3.1 [Saglam2027, Appendix A] from the Kirshner–Samorodnitsky tail bound, with k = ⌈n log₂ n / w⌉ and y = k / n: if ρ = w / n ≤ 1 / 2 - ε, w ≥ K log₂ n with K ≥ 2 / ε ^ 2, and n ≥ 2 / ε ^ 2, then Pr[|μ̂| > 1 / n] ≤ 2 ^ (-n + 2 n (log₂ n / w) log₂ (e w / log₂ n)).

theorem Cslib.Code.exists_puncturedBallFourierBounds_of_ks {ε : ℝ} (hε : 0 < ε) :
∃ (K : ℝ) (N : ℕ), ∀ n ≥ N, ∀ (w : ℕ), K * Real.logb 2 ↑n ≤ ↑w → ↑w ≤ (1 / 2 - ε) * ↑n → KSThirdMomentBound n w → KSTailBound n w → PuncturedBallFourierBounds n w 2

Lemma 3.1 of [Sag26] from the Kirshner–Samorodnitsky bounds. For every ε > 0 there are K and N such that for all n ≥ N and K log₂ n ≤ w ≤ (1 / 2 - ε) n, the Kirshner–Samorodnitsky bounds at n and w imply the moment and tail estimates of Lemma 3.1 with moment constant C = 2.