Documentation

CslibFrontier.Probability.Fooling

Fooling functions on the cube, and k-wise independence #

A distribution X on the cube ι → Bool ε-fools a real function F on the cube (Cslib.BitString.Fools) if the expectation of F under X is within ε of its expectation under the uniform distribution. A distribution is k-wise independent (Cslib.BitString.IsKWiseIndependent) if every k of its coordinates are uniformly distributed; in terms of biases, its bias at every nonempty set of at most k coordinates vanishes, and this is how the abbreviation is defined, as IsKWiseSmallBias k 0. A uniformly seeded k-wise independent family of bit strings, such as one built from Cslib.Probability.polynomialHash, induces a k-wise independent distribution (Cslib.Probability.IsKWiseIndependentHash.isKWiseIndependent_map).

The expectation of F under X is the sum of the Fourier coefficients of F weighted by the biases of X (Cslib.BitString.sum_mul_eq_sum_fourierCoeff_mul_bias). A function of degree at most k has no Fourier weight above level k, so a k-wise independent distribution fools it exactly Braverman, Proposition 6 (Cslib.BitString.IsKWiseIndependent.fools_of_mem_lowDegree). An ε-biased distribution fools every function f up to ‖f̂‖₁ ε (Cslib.BitString.IsSmallBias.fools) O'Donnell, Lemma 6.38. Since ‖(f²)^‖₁ ≤ ‖f̂‖₁², it also fools f² up to ‖f̂‖₁² ε (Cslib.BitString.IsSmallBias.fools_sq) O'Donnell, Corollary 6.39.

A Boolean function is fooled once both it and its negation have one-sided lower bounds (Cslib.BitString.fools_bitVal_of_le), which is how Braverman obtains the two-sided bound of his Main Theorem from the one-sided Lemma 12.

Main definitions #

Main results #

Usage #

For small-bias fooling, open Cslib.BitString and Cslib.Probability. A distribution is X : PMF (ι → Bool); IsSmallBias ε X bounds |bias X S| ≤ ε for every nonempty S (CslibFrontier.Probability.SmallBias), and Fools X ε F says |∑ x, (X x).toReal * F x - 𝔼 x, F x| ≤ ε. For hε : 0 ≤ ε and hX : IsSmallBias ε X, hX.fools hε f fools f up to (∑ S, |fourierCoeff f S|) * ε and hX.fools_sq hε f fools fun x => f x ^ 2 up to (∑ S, |fourierCoeff f S|) ^ 2 * ε; the spectral-norm bounds behind the second, and the norms of characters, products and restrictions, are in CslibFrontier.Foundations.BooleanAnalysis.SpectralNorm. Every 0 ≤ ε hypothesis is needed: with no coordinates the bias condition is vacuous. The uniform distribution is 0-biased (isSmallBias_uniformOfFintype), every distribution is 1-biased (isSmallBias_one), and short seeds give small bias by the powering construction (exists_isSmallBias_uniformOfFintype_map in CslibFrontier.Probability.SmallBias.Powering). For a sample space g : σ → ι → Bool with uniform seeds, Cslib.Probability.PMF.sum_uniformOfFintype_map_mul turns the expectation under (PMF.uniformOfFintype σ).map g into the average 𝔼 s, F (g s). The checked clients in CslibFrontierTests/BooleanAnalysisSpectralNorm.lean show that an ε-biased distribution ε-fools the square of a character, and that a point mass, only 1-biased, 4-fools the square of χ_{0} + χ_{1}. The sharper bounds of O'Donnell, Exercise 6.32 are not formalized.

References #

def Cslib.BitString.Fools {ι : Type u_1} [Fintype ι] [DecidableEq ι] (X : PMF (ι → Bool)) (ε : ℝ) (F : (ι → Bool) → ℝ) :

A distribution X on the cube ε-fools a real function F if the expectation of F under X is within ε of its expectation under the uniform distribution.

theorem Cslib.BitString.sum_uniformOfFintype_mul {ι : Type u_1} [Fintype ι] [DecidableEq ι] (F : (ι → Bool) → ℝ) :
∑ x : ι → Bool, ((Probability.PMF.uniformOfFintype (ι → Bool)) x).toReal * F x = Finset.univ.expect fun (x : ι → Bool) => F x

The expectation under the uniform distribution is the average.

theorem Cslib.BitString.fools_uniformOfFintype {ι : Type u_1} [Fintype ι] [DecidableEq ι] (F : (ι → Bool) → ℝ) :

The uniform distribution fools every function exactly.

theorem Cslib.BitString.Fools.mono {ι : Type u_1} [Fintype ι] [DecidableEq ι] {X : PMF (ι → Bool)} {ε δ : ℝ} {F : (ι → Bool) → ℝ} (h : Fools X ε F) (hεδ : ε ≤ δ) :
Fools X δ F

Fooling with error ε implies fooling with any larger error.

theorem Cslib.BitString.fools_bitVal_of_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] {X : PMF (ι → Bool)} {ε : ℝ} {F : (ι → Bool) → Bool} (h : (Finset.univ.expect fun (x : ι → Bool) => bitVal ℝ (F x)) - ε ≤ ∑ x : ι → Bool, (X x).toReal * bitVal ℝ (F x)) (hn : (Finset.univ.expect fun (x : ι → Bool) => bitVal ℝ !F x) - ε ≤ ∑ x : ι → Bool, (X x).toReal * bitVal ℝ !F x) :
Fools X ε fun (x : ι → Bool) => bitVal ℝ (F x)

Two one-sided bounds fool a Boolean function: if the expectations under X of a Boolean function F and of its negation are each at least their uniform expectation minus ε, then X ε-fools F Braverman, after Lemma 12.

@[reducible, inline]
abbrev Cslib.BitString.IsKWiseIndependent {ι : Type u_1} [Fintype ι] [DecidableEq ι] (k : ℕ) (X : PMF (ι → Bool)) :

A distribution on the cube is k-wise independent if every k of its coordinates are independent and uniform; equivalently, its bias at every nonempty set of at most k coordinates vanishes (IsKWiseSmallBias.dist_map_restrict_le), which is the definition used here.

theorem Cslib.BitString.sum_mul_eq_sum_fourierCoeff_mul_bias {ι : Type u_1} [Fintype ι] [DecidableEq ι] (X : PMF (ι → Bool)) (f : (ι → Bool) → ℝ) :
∑ x : ι → Bool, (X x).toReal * f x = ∑ S : Finset ι, fourierCoeff f S * bias X S

The expectation of f under X is the sum over sets S of the Fourier coefficient of f at S times the bias of X at S.

theorem Cslib.BitString.IsSmallBias.fools {ι : Type u_1} [Fintype ι] [DecidableEq ι] {ε : ℝ} (hε : 0 ≤ ε) {X : PMF (ι → Bool)} (hX : IsSmallBias ε X) (f : (ι → Bool) → ℝ) :
Fools X ((∑ S : Finset ι, |fourierCoeff f S|) * ε) f

Small-bias distributions fool functions of small spectral norm O'Donnell, Lemma 6.38: for ε ≥ 0, an ε-biased distribution X fools f up to ‖f̂‖₁ ε. The expectation of f under X is ∑_S f̂(S) times the bias at S, and the bias at ∅ is 1.

theorem Cslib.BitString.IsSmallBias.fools_sq {ι : Type u_1} [Fintype ι] [DecidableEq ι] {ε : ℝ} (hε : 0 ≤ ε) {X : PMF (ι → Bool)} (hX : IsSmallBias ε X) (f : (ι → Bool) → ℝ) :
Fools X ((∑ S : Finset ι, |fourierCoeff f S|) ^ 2 * ε) fun (x : ι → Bool) => f x ^ 2

Small-bias distributions fool squares O'Donnell, Corollary 6.39: for ε ≥ 0, an ε-biased distribution X fools f² up to ‖f̂‖₁² ε, by Lemma 6.38 for f² and ‖(f²)^‖₁ ≤ ‖f̂‖₁² (sum_abs_fourierCoeff_sq_le_sq).

The uniform distribution is k-wise independent for every k.

theorem Cslib.BitString.IsKWiseIndependent.sum_mul_eq_expect_of_mem_lowDegree {ι : Type u_1} [Fintype ι] [DecidableEq ι] {k : ℕ} {X : PMF (ι → Bool)} {P : (ι → Bool) → ℝ} (hX : IsKWiseIndependent k X) (hP : P ∈ lowDegree ℝ ι k) :
∑ x : ι → Bool, (X x).toReal * P x = Finset.univ.expect fun (x : ι → Bool) => P x

A k-wise independent distribution gives a function of degree at most k its uniform expectation Braverman, Proposition 6.

theorem Cslib.BitString.IsKWiseIndependent.fools_of_mem_lowDegree {ι : Type u_1} [Fintype ι] [DecidableEq ι] {k : ℕ} {X : PMF (ι → Bool)} {P : (ι → Bool) → ℝ} (hX : IsKWiseIndependent k X) (hP : P ∈ lowDegree ℝ ι k) :
Fools X 0 P

k-wise independence fools degree-k functions exactly Braverman, Proposition 6.

Seeded k-wise independent families are k-wise independent distributions: a uniformly random member of a k-wise independent family of bit strings is a k-wise independent distribution on the cube.