Documentation

CslibFrontier.Foundations.BooleanAnalysis.DeterministicEstimation

Deterministic estimation of Fourier coefficients and bucket weights #

A sample space g : σ → ι → Bool lists the points g s of the cube, one for each seed s of a finite type σ; it is δ-biased when the image of the uniform distribution on the seeds is (IsSmallBias δ ((PMF.uniformOfFintype σ).map g)). Averaging f (g s) χ_U(g s) over the seeds estimates the Fourier coefficient f̂(U) (BitString.sampleSpaceCoeff). The estimate reads f only at the points of the sample space (BitString.sampleSpaceCoeff_congr, BitString.sampleSpacePoints), one query per seed (BitString.length_sampleSpacePoints), so it is deterministic. Since ‖(f χ_U)^‖₁ = ‖f̂‖₁, Lemma 6.38 for f χ_U makes it accurate to within ‖f̂‖₁ δ (BitString.abs_sampleSpaceCoeff_sub_fourierCoeff_le) O'Donnell, Proposition 6.40.

The bucket weight W^{S | J̄}[f] = 𝔼_z f_{J|z}^(S)² (BitString.bucketWeight, where f_{J|z} fixes the coordinates outside J to z) is estimated by drawing z from a second sample space h, estimating each coefficient f_{J|z}^(S) from g, and averaging the squares (BitString.sampleSpaceBucketWeight). It reads f only at the points (g s, h t), which take the coordinates in J from g s and the others from h t (BitString.sampleSpaceBucketWeight_congr, BitString.sampleSpaceBucketPoints). For |f| ≤ 1 it is within 2 ‖f̂‖₁ δ₁ + ‖f̂‖₁² δ₂ of the bucket weight when g is δ₁-biased and h is δ₂-biased (BitString.abs_sampleSpaceBucketWeight_sub_bucketWeight_le) O'Donnell, Proposition 6.41: restrictions and the function z ↦ f_{J|z}^(S) have spectral norm at most ‖f̂‖₁ (Exercise 3.7(a), and a consequence of Proposition 3.21, in SpectralNorm), so Proposition 6.40 estimates each coefficient and Corollary 6.39 fools its square.

Some sample space, obtained from the powering construction of Alon, Goldreich, Håstad and Peralta (BitString.exists_isSmallBias_uniformOfFintype_map), bounds the query counts: for n coordinates, spectral norm at most s and error ε, a seed of 2 m bits with 4 ^ m ≤ 4 (n s / ε + 1) ² suffices for the coefficients (BitString.exists_abs_sampleSpaceCoeff_sub_fourierCoeff_le), and the bucket weights of functions with |f| ≤ 1 are read from (4 ^ m) ² points with 4 ^ m ≤ 4 (n (2 s + s²) / ε + 1) ² (BitString.exists_abs_sampleSpaceBucketWeight_sub_bucketWeight_le). These theorems only assert that such a sample space exists. They are the query bounds behind the polynomial running times of Propositions 6.40 and 6.41; the running time itself is not certified by a machine model.

Main definitions #

Main results #

Usage #

Open Cslib.BitString. A sample space is any map g : σ → ι → Bool from a finite seed type, and it is δ-biased when IsSmallBias δ ((PMF.uniformOfFintype σ).map g) holds; functions are real, f : (ι → Bool) → ℝ. Unfold the estimates with sampleSpaceCoeff_def and sampleSpaceBucketWeight_def. As for Kushilevitz–Mansour (CslibFrontier.MachineLearning.UniformLearning.KushilevitzMansour), each estimate comes with an explicit list of points, its length, and a _congr theorem saying that the output depends only on the values of f at those points. Both estimators use the same seeds for every U, J and S. The bucket weight is bucketWeight f J S from CslibFrontier.Foundations.BooleanAnalysis.BucketWeight; the restriction keeps the coordinates in J free. Proposition 6.41 is stated for every f with |f x| ≤ 1, not only for ±1-valued f. The existence theorems take a sample space from the powering construction, itself an existence theorem; their bound on Fintype.card (BitString (2 * m)) makes the coefficient estimate read O(n² s² / ε²) points. The book's statements are about running time: here only the queried points and their number are certified, and no machine model is involved. The checked clients in CslibFrontierTests/BooleanAnalysisDeterministicEstimation.lean show that the whole cube, listed once, gives exact estimates and that a single seed gives values at a point. On a thousand bits, a sample space from the existence theorems estimates a character's coefficient within 1/10, and its estimate of the bucket containing the character is at least 9/10. O'Donnell, Theorems 6.42 and 6.43, the deterministic learners, are not formalized: the Kushilevitz–Mansour error analysis uniformError_kmHypothesis_le is stated for sampled estimates (KMAccurate) and would first have to be generalized to arbitrary estimates.

References #

The coefficient estimate #

noncomputable def Cslib.BitString.sampleSpacePoints {ι : Type u_1} {σ : Type u_2} [Fintype σ] (g : σ → ι → Bool) :
List (ι → Bool)

The points of a sample space g, listed once for each seed.

theorem Cslib.BitString.length_sampleSpacePoints {ι : Type u_1} {σ : Type u_2} [Fintype σ] (g : σ → ι → Bool) :

A sample space lists one point for each seed.

theorem Cslib.BitString.mem_sampleSpacePoints {ι : Type u_1} {σ : Type u_2} [Fintype σ] (g : σ → ι → Bool) (s : σ) :

Every point g s of a sample space is listed.

noncomputable def Cslib.BitString.sampleSpaceCoeff {ι : Type u_1} {σ : Type u_2} [Fintype σ] (g : σ → ι → Bool) (f : (ι → Bool) → ℝ) (U : Finset ι) :

The estimate of the Fourier coefficient f̂(U) from the sample space g: the average over the seeds s of f (g s) χ_U(g s).

theorem Cslib.BitString.sampleSpaceCoeff_def {ι : Type u_1} {σ : Type u_2} [Fintype σ] (g : σ → ι → Bool) (f : (ι → Bool) → ℝ) (U : Finset ι) :
sampleSpaceCoeff g f U = Finset.univ.expect fun (s : σ) => f (g s) * chi ℝ U (g s)

The estimate of a Fourier coefficient, unfolded.

theorem Cslib.BitString.sampleSpaceCoeff_congr {ι : Type u_1} {σ : Type u_2} [Fintype σ] (g : σ → ι → Bool) {f f' : (ι → Bool) → ℝ} (h : ∀ x ∈ sampleSpacePoints g, f x = f' x) (U : Finset ι) :

The coefficient estimate is deterministic: it depends only on the values of f at the points of the sample space.

theorem Cslib.BitString.abs_sampleSpaceCoeff_le_one {ι : Type u_1} {σ : Type u_2} [Fintype σ] (g : σ → ι → Bool) {f : (ι → Bool) → ℝ} (hf : ∀ (x : ι → Bool), |f x| ≤ 1) (U : Finset ι) :

A function bounded by one has coefficient estimates bounded by one.

The bucket-weight estimate #

noncomputable def Cslib.BitString.sampleSpaceBucketPoints {ι : Type u_1} {σ : Type u_2} {τ : Type u_3} [Fintype σ] [Fintype τ] [DecidableEq ι] (g : σ → ι → Bool) (h : τ → ι → Bool) (J : Finset ι) :
List (ι → Bool)

The points queried by the bucket-weight estimate: for each point h t of the second sample space and each point g s of the first, the point taking the coordinates in J from g s and the others from h t.

theorem Cslib.BitString.length_sampleSpaceBucketPoints {ι : Type u_1} {σ : Type u_2} {τ : Type u_3} [Fintype σ] [Fintype τ] [DecidableEq ι] (g : σ → ι → Bool) (h : τ → ι → Bool) (J : Finset ι) :

The bucket-weight estimate queries |τ| |σ| points.

noncomputable def Cslib.BitString.sampleSpaceBucketWeight {ι : Type u_1} {σ : Type u_2} {τ : Type u_3} [Fintype σ] [Fintype τ] [DecidableEq ι] (g : σ → ι → Bool) (h : τ → ι → Bool) (f : (ι → Bool) → ℝ) (J S : Finset ι) :

The estimate of the bucket weight W^{S | J̄}[f] (bucketWeight f J S) from the sample spaces g and h: the average over the seeds t of h of the squared estimate, from g, of the coefficient on S of the restriction fixing the coordinates outside J to h t.

theorem Cslib.BitString.sampleSpaceBucketWeight_def {ι : Type u_1} {σ : Type u_2} {τ : Type u_3} [Fintype σ] [Fintype τ] [DecidableEq ι] (g : σ → ι → Bool) (h : τ → ι → Bool) (f : (ι → Bool) → ℝ) (J S : Finset ι) :
sampleSpaceBucketWeight g h f J S = Finset.univ.expect fun (t : τ) => sampleSpaceCoeff g (fun (x : ι → Bool) => f (J.piecewise x (h t))) S ^ 2

The estimate of a bucket weight, unfolded.

theorem Cslib.BitString.sampleSpaceBucketWeight_congr {ι : Type u_1} {σ : Type u_2} {τ : Type u_3} [Fintype σ] [Fintype τ] [DecidableEq ι] (g : σ → ι → Bool) (h : τ → ι → Bool) {f f' : (ι → Bool) → ℝ} {J : Finset ι} (hf : ∀ x ∈ sampleSpaceBucketPoints g h J, f x = f' x) (S : Finset ι) :

The bucket-weight estimate is deterministic: it depends only on the values of f at the points of sampleSpaceBucketPoints g h J.

Accuracy #

theorem Cslib.BitString.abs_sampleSpaceCoeff_sub_fourierCoeff_le {ι : Type u_1} {σ : Type u_2} [Fintype σ] [DecidableEq ι] [Fintype ι] [Nonempty σ] {δ : ℝ} (hδ : 0 ≤ δ) {g : σ → ι → Bool} (hg : IsSmallBias δ (PMF.map g (Probability.PMF.uniformOfFintype σ))) (f : (ι → Bool) → ℝ) (U : Finset ι) :
|sampleSpaceCoeff g f U - fourierCoeff f U| ≤ (∑ S : Finset ι, |fourierCoeff f S|) * δ

Deterministic estimation of a Fourier coefficient O'Donnell, Proposition 6.40: if the sample space g is δ-biased, with δ ≥ 0, then its estimate of f̂(U) is within ‖f̂‖₁ δ.

theorem Cslib.BitString.exists_abs_sampleSpaceCoeff_sub_fourierCoeff_le (n : ℕ) {s ε : ℝ} (hs : 0 ≤ s) (hε : 0 < ε) :
∃ (m : ℕ) (g : BitString (2 * m) → BitString n), ↑(Fintype.card (BitString (2 * m))) ≤ 4 * (↑n * s / ε + 1) ^ 2 ∧ ∀ (f : BitString n → ℝ), ∑ S : Finset (Fin n), |fourierCoeff f S| ≤ s → ∀ (U : Finset (Fin n)), |sampleSpaceCoeff g f U - fourierCoeff f U| ≤ ε

A deterministic coefficient estimator with few queries O'Donnell, Proposition 6.40: for n coordinates, s ≥ 0 and ε > 0, some sample space on 2 m seed bits with 4 ^ m ≤ 4 (n s / ε + 1) ², obtained from the powering construction (exists_isSmallBias_uniformOfFintype_map), estimates every Fourier coefficient of every f with ‖f̂‖₁ ≤ s to within ε. The estimate reads f at the 4 ^ m points sampleSpacePoints g.

theorem Cslib.BitString.abs_sampleSpaceBucketWeight_sub_bucketWeight_le {ι : Type u_1} {σ : Type u_2} {τ : Type u_3} [Fintype σ] [Fintype τ] [DecidableEq ι] [Fintype ι] [Nonempty σ] [Nonempty τ] {δ₁ δ₂ : ℝ} (hδ₁ : 0 ≤ δ₁) (hδ₂ : 0 ≤ δ₂) {g : σ → ι → Bool} (hg : IsSmallBias δ₁ (PMF.map g (Probability.PMF.uniformOfFintype σ))) {h : τ → ι → Bool} (hh : IsSmallBias δ₂ (PMF.map h (Probability.PMF.uniformOfFintype τ))) {f : (ι → Bool) → ℝ} (hf : ∀ (x : ι → Bool), |f x| ≤ 1) (J S : Finset ι) :
|sampleSpaceBucketWeight g h f J S - bucketWeight f J S| ≤ (2 * ∑ U : Finset ι, |fourierCoeff f U|) * δ₁ + (∑ U : Finset ι, |fourierCoeff f U|) ^ 2 * δ₂

Deterministic estimation of a bucket weight O'Donnell, Proposition 6.41: for |f| ≤ 1, if the sample spaces g and h are δ₁- and δ₂-biased, with δ₁, δ₂ ≥ 0, then their estimate of W^{S | J̄}[f] is within 2 ‖f̂‖₁ δ₁ + ‖f̂‖₁² δ₂.

theorem Cslib.BitString.exists_abs_sampleSpaceBucketWeight_sub_bucketWeight_le (n : ℕ) {s ε : ℝ} (hs : 0 ≤ s) (hε : 0 < ε) :
∃ (m : ℕ) (g : BitString (2 * m) → BitString n), ↑(Fintype.card (BitString (2 * m))) ≤ 4 * (↑n * (2 * s + s ^ 2) / ε + 1) ^ 2 ∧ ∀ (f : BitString n → ℝ), (∀ (x : BitString n), |f x| ≤ 1) → ∑ S : Finset (Fin n), |fourierCoeff f S| ≤ s → ∀ (J S : Finset (Fin n)), |sampleSpaceBucketWeight g g f J S - bucketWeight f J S| ≤ ε

A deterministic bucket-weight estimator with few queries O'Donnell, Proposition 6.41: for n coordinates, s ≥ 0 and ε > 0, some sample space g on 2 m seed bits with 4 ^ m ≤ 4 (n (2 s + s²) / ε + 1) ², obtained from the powering construction (exists_isSmallBias_uniformOfFintype_map) and used for both sample spaces, estimates every bucket weight of every f with |f| ≤ 1 and ‖f̂‖₁ ≤ s to within ε. The estimate reads f at the (4 ^ m) ² points sampleSpaceBucketPoints g g J.