Documentation

CslibFrontier.MachineLearning.UniformLearning.ExactLowDegree

Exact learning of low-degree functions #

A Boolean function of degree at most k ≥ 1, read as signs, has Fourier coefficients in 2 ^ (1 - k) ℤ (BitString.exists_fourierCoeff_signVal_eq_intCast_div_two_pow_of_mem_lowDegree). So if every empirical coefficient on the sets of at most k coordinates is within 2 ^ (-k) of the true one, rounding it to the nearest multiple of 2 ^ (1 - k) recovers the coefficient exactly, the rounded expansion is the function itself, and its sign has error 0 (UniformLearning.exactLowDegreeHypothesis_eq). By Hoeffding's inequality and a union bound over the N sets of at most k coordinates (UniformLearning.uniform_exists_abs_empiricalCoeff_sub_ge_le), 2 · 4 ^ k · log (2 N / δ) uniform random examples suffice (UniformLearning.exactLowDegreeLearner_learns). This is the sample-complexity step toward O'Donnell, Theorem 3.36, following the book's Exercise 3.36. Since N ≤ (n + 1) ^ k (BitString.card_filter_card_le_le_pow), it is O(4 ^ k (k log (n + 1) + log (1 / δ))) examples. The learner is noncomputable and its running time is not certified, so Theorem 3.36 itself, learning in time n ^ k · poly(n, 2 ^ k) with a circuit as output, remains open on #2131.

Usage #

Open Cslib.MachineLearning.UniformLearning and Cslib.MachineLearning.PACLearning. For 1 ≤ k, 0 < δ and a number of examples m with 2 * 4 ^ k * Real.log (2 * #{S : Finset ι | #S ≤ k} / δ) ≤ m (for instance its ceiling, Nat.le_ceil _), exactLowDegreeLearner_learns hk hδ hm gives Learns (exactLowDegreeLearner ι k m) {f | (fun x => signVal (f x)) ∈ lowDegree ℝ ι k} 0 δ. A smaller class is learned through Learns.mono; the decision trees of depth at most k are one, by DecisionTree.comp_eval_mem_lowDegree and BitString.lowDegree_mono. To reason about a fixed sample, exactLowDegreeHypothesis_eq turns estimates within 2 ^ (-k) into the function itself. The union bound over the estimates, uniform_exists_abs_empiricalCoeff_sub_ge_le, is in CslibFrontier.MachineLearning.UniformLearning.LowDegree and shared with the low-degree learner. Checked clients bound the union bound for sixteen examples of a parity, recover the one-bit dictator from two examples, and learn the functions of degree two on five bits, and so the decision trees of depth two, with confidence 9 / 10, in CslibFrontierTests/BooleanAnalysisExactLearning.lean.

Main definitions #

Main results #

References #

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

The hypothesis of the exact low-degree algorithm of degree k: the sign of the expansion ∑_{#S ≤ k} c̃(S) χ_S truncated at degree k, with each empirical coefficient c̃(S) rounded to the nearest multiple of 2 ^ (1 - k) (of 1 when k = 0).

The exact low-degree algorithm of degree k from m examples: estimate the Fourier coefficients on the sets of at most k coordinates empirically, round them to the nearest multiples of 2 ^ (1 - k) (of 1 when k = 0), and output the sign of the truncated expansion. It is a deterministic learner.

theorem Cslib.MachineLearning.UniformLearning.exactLowDegreeHypothesis_eq {ι : Type u_1} {m : ℕ} [Fintype ι] [DecidableEq ι] {k : ℕ} (hk : 1 ≤ k) {f : (ι → Bool) → Bool} (hf : (fun (x : ι → Bool) => BitString.signVal (f x)) ∈ BitString.lowDegree ℝ ι k) {e : PACLearning.LabeledSample (ι → Bool) Bool m} (he : ∀ (S : Finset ι), S.card ≤ k → |empiricalCoeff e S - BitString.fourierCoeff (fun (x : ι → Bool) => BitString.signVal (f x)) S| < 1 / 2 ^ k) :

If every empirical coefficient on the sets of at most k ≥ 1 coordinates is within 2 ^ (-k) of the true coefficient of a function of degree at most k, the exact low-degree hypothesis is the function itself.

theorem Cslib.MachineLearning.UniformLearning.exactLowDegreeLearner_learns {ι : Type u_1} [Fintype ι] [DecidableEq ι] {k m : ℕ} (hk : 1 ≤ k) {δ : ℝ} (hδ : 0 < δ) (hm : 2 * 4 ^ k * Real.log (2 * ↑{S : Finset ι | S.card ≤ k}.card / δ) ≤ ↑m) :
Learns (exactLowDegreeLearner ι k m) {f : (ι → Bool) → Bool | (fun (x : ι → Bool) => BitString.signVal (f x)) ∈ BitString.lowDegree ℝ ι k} 0 δ

Sample complexity of exact learning of low-degree functions, a step toward O'Donnell, Theorem 3.36, following Exercise 3.36: let N be the number of sets of at most k ≥ 1 coordinates (at most (n + 1) ^ k for n = Fintype.card ι, BitString.card_filter_card_le_le_pow). From m ≥ 2 · 4 ^ k · log (2 N / δ) uniform random examples, the exact low-degree algorithm of degree k learns the Boolean functions of degree at most k, read as signs, with error 0 and confidence 1 - δ. Only the number of examples is certified: the learner is noncomputable, and the book's running time n ^ k · poly(n, 2 ^ k) and circuit output remain open on #2131.