Documentation

CslibFrontier.Foundations.BooleanAnalysis.Regularity

Regular functions #

A real function f on the cube is ε-regular if |f̂(S)| ≤ ε for every nonempty S (BitString.IsFourierRegular) O'Donnell, Definition 6.2. Every Fourier coefficient is at most 𝔼 |f| in absolute value (BitString.abs_fourierCoeff_le_expect_abs) O'Donnell, Exercise 3.9, so every function is ‖f‖₁-regular (BitString.isFourierRegular_expect_abs) O'Donnell, Remark 6.3. A function is 0-regular exactly when it is constant (BitString.isFourierRegular_zero_iff), and a character of a nonempty set is not ε-regular for any ε < 1 (BitString.not_isFourierRegular_chi) O'Donnell, Example 6.4.

Regularity is detected by the fourth moment of the spectrum: an ε-regular f has ∑_S f̂(S) ^ 4 - (𝔼 f) ^ 4 ≤ ε ^ 2 Var[f], while a function that is not ε-regular has ∑_S f̂(S) ^ 4 - (𝔼 f) ^ 4 ≥ ε ^ 4 (BitString.sum_fourierCoeff_pow_four_sub_le_of_isFourierRegular, BitString.pow_four_le_sum_fourierCoeff_pow_four_sub_of_not_isFourierRegular) O'Donnell, Proposition 6.7.

Main definitions #

Main results #

Usage #

Open Cslib.BitString. IsFourierRegular ε f is stated for any real f : (ι → Bool) → ℝ; a Boolean function enters as fun x => signVal (f x). The definition is exposed, so a client proves it by fun S hS => … from a bound on each nonempty coefficient. In isFourierRegular_expect_abs f the regularity parameter is 𝔼 x, |f x|, which is Cslib.lpNorm 1 f by Cslib.lpNorm_one. Proposition 6.7 writes the variance as 𝔼 x, (f x - 𝔼 y, f y) ^ 2, the form of expect_sub_expect_sq_eq_sum_fourierCoeff_sq; its second half needs 0 ≤ ε: for negative ε and nonempty ι no function is ε-regular, and a constant then violates the bound. The checked clients in CslibFrontierTests/BooleanAnalysisRegularity.lean show that constants are 0-regular and that χ_{0} on three bits is not constant, is 1-regular but not 1/2-regular, and satisfies both halves of Proposition 6.7. The other cases of O'Donnell, Example 6.4 (random functions, indicators of affine subspaces, inner product and complete quadratic, majority) and (ε, δ)-regularity are not formalized.

References #

def Cslib.BitString.IsFourierRegular {ι : Type u_1} [Fintype ι] [DecidableEq ι] (ε : ℝ) (f : (ι → Bool) → ℝ) :

A real function on the cube is ε-regular if its Fourier coefficients on the nonempty sets are at most ε in absolute value.

theorem Cslib.BitString.isFourierRegular_expect_abs {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → ℝ) :
IsFourierRegular (Finset.univ.expect fun (x : ι → Bool) => |f x|) f

Every function is ‖f‖₁-regular O'Donnell, Remark 6.3.

theorem Cslib.BitString.isFourierRegular_zero_iff {ι : Type u_1} [Fintype ι] [DecidableEq ι] {f : (ι → Bool) → ℝ} :
IsFourierRegular 0 f ↔ ∃ (c : ℝ), f = fun (x : ι → Bool) => c

The 0-regular functions are the constants O'Donnell, Example 6.4.

theorem Cslib.BitString.not_isFourierRegular_chi {ι : Type u_1} [Fintype ι] [DecidableEq ι] {S : Finset ι} (hS : S.Nonempty) {ε : ℝ} (hε : ε < 1) :

A character is not ε-regular below 1 O'Donnell, Example 6.4: a character of a nonempty set has coefficient 1 on that set, so it is not ε-regular for any ε < 1.

theorem Cslib.BitString.sum_fourierCoeff_pow_four_sub_le_of_isFourierRegular {ι : Type u_1} [Fintype ι] [DecidableEq ι] {ε : ℝ} {f : (ι → Bool) → ℝ} (h : IsFourierRegular ε f) :
∑ S : Finset ι, fourierCoeff f S ^ 4 - (Finset.univ.expect fun (x : ι → Bool) => f x) ^ 4 ≤ ε ^ 2 * Finset.univ.expect fun (x : ι → Bool) => (f x - Finset.univ.expect fun (y : ι → Bool) => f y) ^ 2

Regular functions have small fourth spectral moment O'Donnell, Proposition 6.7: if f is ε-regular, then ∑_S f̂(S) ^ 4 - (𝔼 f) ^ 4 ≤ ε ^ 2 Var[f].

theorem Cslib.BitString.pow_four_le_sum_fourierCoeff_pow_four_sub_of_not_isFourierRegular {ι : Type u_1} [Fintype ι] [DecidableEq ι] {ε : ℝ} (hε : 0 ≤ ε) {f : (ι → Bool) → ℝ} (h : ¬IsFourierRegular ε f) :
ε ^ 4 ≤ ∑ S : Finset ι, fourierCoeff f S ^ 4 - (Finset.univ.expect fun (x : ι → Bool) => f x) ^ 4

Irregular functions have large fourth spectral moment O'Donnell, Proposition 6.7: for ε ≥ 0, if f is not ε-regular, then ∑_S f̂(S) ^ 4 - (𝔼 f) ^ 4 ≥ ε ^ 4.