Documentation

CslibFrontier.MachineLearning.UniformLearning.LowDegree

Sample-complexity step for the low-degree algorithm #

This module formalizes the sample-complexity (statistical uniform-learning) step on the noncomputable UniformLearning.lowDegreeLearner toward the low-degree algorithm of Linial, Mansour and Nisan [LMN93] and O'Donnell, Section 3.4 (The Low-Degree Algorithm and Theorem 3.29); it is not the cited running-time theorem, whose machine-level poly(n ^ t, 1 / ε) running-time certification (and arbitrary concentrating family ℱ in Theorem 3.29) remains open on #2131.

From m labeled examples (x_j, y_j), UniformLearning.empiricalCoeff averages y_j χ_S(x_j) over ℝ (reading labels as signs) for each set S with #S ≤ t, and UniformLearning.lowDegreeHypothesis / UniformLearning.lowDegreeLearner outputs the sign of the truncated expansion ∑_{#S ≤ t} c̃(S) χ_S. Each c̃(S) is an average of m independent values in [-1, 1] with mean f̂(S), so by Hoeffding's inequality (Probability.PMF.uniform_abs_sum_div_sub_expect_ge_le) it deviates by at least γ with probability at most 2 exp (-m γ² / 2) (UniformLearning.uniform_abs_empiricalCoeff_sub_ge_le, the sample-tail step in the proof of O'Donnell, Proposition 3.30). Let N be the number of sets of at most t coordinates, at most (n + 1) ^ t for n coordinates (BitString.card_filter_card_le_le_pow). By a union bound, all N estimates lie within γ = √(ε / (2 N)) except with probability at most 2 N exp (-m ε / (4 N)) (UniformLearning.uniform_exists_abs_empiricalCoeff_sub_ge_le), and rounding the truncated expansion then misclassifies at most a fraction N γ² + W = ε / 2 + W of inputs, where W is the Fourier weight of f above degree t (BitString.hammingDist_signRound_sum_mul_chi_div_le, from O'Donnell, Proposition 3.31). When W ≤ ε / 2, the hypothesis has error above ε with probability at most 2 N exp (-m ε / (4 N)) (UniformLearning.uniform_lt_uniformError_lowDegreeHypothesis_le), which is at most δ once m ≥ (4 N / ε) log (2 N / δ) (UniformLearning.lowDegreeLearner_learns). This gives the sample-complexity step after O'Donnell, Theorem 3.29 specialized to the sets of at most t coordinates.

Scope and open runtime gap. empiricalCoeff, lowDegreeHypothesis and lowDegreeLearner are noncomputable definitions over ℝ, and Learns bounds only the sample failure probability on uniform random examples; machine-level running-time certification and hypothesis representation stay open on #2131.

Main definitions #

Main results #

References #

The algorithm #

noncomputable def Cslib.MachineLearning.UniformLearning.empiricalCoeff {ι : Type u_1} {m : ℕ} (e : PACLearning.LabeledSample (ι → Bool) Bool m) (S : Finset ι) :

The empirical Fourier coefficient on S of a sample of labelled examples (x_j, y_j): the average of y_j χ_S(x_j) over the examples, reading the labels as signs.

noncomputable def Cslib.MachineLearning.UniformLearning.lowDegreeHypothesis {ι : Type u_1} {m : ℕ} [Fintype ι] (t : ℕ) (e : PACLearning.LabeledSample (ι → Bool) Bool m) :
(ι → Bool) → Bool

The hypothesis of the low-degree algorithm of degree t: the sign of the empirical Fourier expansion ∑_{#S ≤ t} c̃(S) χ_S truncated at degree t.

Noncomputable low-degree learner of degree t from m examples: average the real Fourier characters on sets of at most t coordinates empirically and output the sign of the truncated expansion. Only statistical sample behavior is modeled; machine running-time certification stays open on #2131.

theorem Cslib.MachineLearning.UniformLearning.uniform_abs_empiricalCoeff_sub_ge_le {ι : Type u_1} {m : ℕ} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → Bool) (S : Finset ι) {γ : ℝ} (hγ : 0 ≤ γ) :
(Probability.PMF.uniformOfFintype (Fin m → ι → Bool)).toOuterMeasure {x : Fin m → ι → Bool | γ ≤ |empiricalCoeff (examples f x) S - BitString.fourierCoeff (fun (x : ι → Bool) => BitString.signVal (f x)) S|} ≤ ENNReal.ofReal (2 * Real.exp (-(↑m * γ ^ 2) / 2))

Hoeffding sample-tail step in the proof of O'Donnell, Proposition 3.30 on the noncomputable empiricalCoeff (not Proposition 3.30's poly(n, 1 / γ) log (1 / δ)-time estimator, which stays open on #2131): from m uniform random examples of f, the empirical coefficient on S deviates from f̂(S) by at least γ with probability at most 2 exp (-m γ² / 2).

theorem Cslib.MachineLearning.UniformLearning.uniform_exists_abs_empiricalCoeff_sub_ge_le {ι : Type u_1} {m : ℕ} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → Bool) (T : Finset (Finset ι)) {γ : ℝ} (hγ : 0 ≤ γ) :
(Probability.PMF.uniformOfFintype (Fin m → ι → Bool)).toOuterMeasure {x : Fin m → ι → Bool | ∃ S ∈ T, γ ≤ |empiricalCoeff (examples f x) S - BitString.fourierCoeff (fun (x : ι → Bool) => BitString.signVal (f x)) S|} ≤ ENNReal.ofReal (↑T.card * (2 * Real.exp (-(↑m * γ ^ 2) / 2)))

Union-bound tail estimate across T for the noncomputable empiricalCoeff: from m uniform random examples of f, some empirical coefficient on a set in T deviates by at least γ with probability at most #T · 2 exp (-m γ² / 2).

The low-degree algorithm #

theorem Cslib.MachineLearning.UniformLearning.uniform_lt_uniformError_lowDegreeHypothesis_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → Bool) (t m : ℕ) {ε : ℝ} (hε : 0 ≤ ε) (hf : ∑ S : Finset ι with t < S.card, BitString.fourierCoeff (fun (x : ι → Bool) => BitString.signVal (f x)) S ^ 2 ≤ ε / 2) :
(Probability.PMF.uniformOfFintype (Fin m → ι → Bool)).toOuterMeasure {x : Fin m → ι → Bool | ε < uniformError f (lowDegreeHypothesis t (examples f x))} ≤ ENNReal.ofReal (2 * ↑{S : Finset ι | S.card ≤ t}.card * Real.exp (-(↑m * ε) / (4 * ↑{S : Finset ι | S.card ≤ t}.card)))

Failure-probability bound for the noncomputable lowDegreeHypothesis on uniform random examples (statistical error step, with machine running time open on #2131). If the Fourier weight of f, read as signs, on the sets of more than t coordinates is at most ε / 2, then from m uniform random examples lowDegreeHypothesis of degree t has error above ε with probability at most 2 N exp (-m ε / (4 N)), where N is the number of sets of at most t coordinates.

theorem Cslib.MachineLearning.UniformLearning.lowDegreeLearner_learns {ι : Type u_1} [Fintype ι] [DecidableEq ι] {t m : ℕ} {ε δ : ℝ} (hε : 0 < ε) (hδ : 0 < δ) (hm : 4 * ↑{S : Finset ι | S.card ≤ t}.card / ε * Real.log (2 * ↑{S : Finset ι | S.card ≤ t}.card / δ) ≤ ↑m) {C : PACLearning.ConceptClass (ι → Bool) Bool} (hC : ∀ f ∈ C, ∑ S : Finset ι with t < S.card, BitString.fourierCoeff (fun (x : ι → Bool) => BitString.signVal (f x)) S ^ 2 ≤ ε / 2) :
Learns (lowDegreeLearner ι t m) C ε δ

Sample-complexity (statistical uniform-learning) step on the noncomputable lowDegreeLearner toward the low-degree algorithm of [LMN93] and O'Donnell, Section 3.4 (The Low-Degree Algorithm and Theorem 3.29); the cited poly(n ^ t, 1 / ε) running-time theorem is not proved here and stays open on #2131. Let N be the number of sets of at most t coordinates (at most (n + 1) ^ t, BitString.card_filter_card_le_le_pow). From m ≥ (4 N / ε) log (2 N / δ) uniform random examples, lowDegreeLearner of degree t learns, with error ε and confidence 1 - δ, every class of Boolean functions whose Fourier weight, read as signs, on the sets of more than t coordinates is at most ε / 2; only the number of examples, the error and the confidence are certified.