Documentation

CslibFrontier.MachineLearning.PACLearning.SampleComplexityLower.Helpers

Sample Complexity Lower Bound — Helper Lemmas #

Generic reusable lemmas for product measures, sample functions, and combinatorics used in the EHKV lower bound proof.

The lower-bound argument works on the marginal sample space Fin m → α under a probability measure P : Measure α, with concepts viewed as Set α. The translation to the joint sample space LabeledSample α Bool m under a realizable distribution D = P.map (x ↦ (x, c x)) is handled at the top-level theorem (SampleComplexityLower.lean) via pi_map_sampleOf below and the bridge lemma error_map_eq_hypothesisError from PACLearning.Defs.

Main definitions #

Main statements #

The pi-product↔pushforward bridge pi_map_sampleOf, which translates joint-sample-space failure events to the marginal sample space at the top of the EHKV proof, lives in SampleComplexityLower.lean itself, near where it is used.

noncomputable def Cslib.MachineLearning.PACLearning.sampleOf {α : Type u_1} {m : ℕ} (c : Set α) (xs : Fin m → α) :

Construct a labeled sample from a sequence of points xs and a set-valued concept c. Each point is labeled true if it belongs to c, else false.

noncomputable def Cslib.MachineLearning.PACLearning.seenElements {α : Type u_1} (W' : Finset α) {m : ℕ} (xs : Fin m → α) :

The set of elements of a Finset that appear in a sample.

theorem Cslib.MachineLearning.PACLearning.sampleOf_eq_of_agree {α : Type u_1} {m : ℕ} {c₁ c₂ : Set α} {xs : Fin m → α} (h : ∀ (i : Fin m), xs i ∈ c₁ ↔ xs i ∈ c₂) :
sampleOf c₁ xs = sampleOf c₂ xs

Two concepts that agree on all sample points produce the same labeled sample.

theorem Cslib.MachineLearning.PACLearning.hypothesisError_eq_of_inter_eq {α : Type u_1} [MeasurableSpace α] {P : MeasureTheory.Measure α} {W : Set α} (hP_supp : P Wᶜ = 0) {h₀ c₁ c₂ : Set α} (hinter : c₁ ∩ W = c₂ ∩ W) :
hypothesisError P h₀ c₁ = hypothesisError P h₀ c₂

Two concepts with the same intersection with W have the same hypothesis error when the measure P is supported on W.

theorem Cslib.MachineLearning.PACLearning.pi_measure_compl_zero {α : Type u_1} [MeasurableSpace α] {W : Finset α} {P : MeasureTheory.Measure α} [MeasureTheory.SigmaFinite P] (hP_supp : P (↑W)ᶜ = 0) {m : ℕ} :
(MeasureTheory.Measure.pi fun (x : Fin m) => P) {xs : Fin m → α | ∀ (i : Fin m), xs i ∈ ↑W}ᶜ = 0

If a measure P on α gives zero mass to the complement of a finite set W, then the product measure P^m gives zero mass to the complement of W^m.

If a measure P on α gives zero mass to the complement of a finite set W, then every set in the product space is NullMeasurableSet.

theorem Cslib.MachineLearning.PACLearning.setOf_exists_pi_eq_iUnion_preimage {α : Type u_1} {m : ℕ} (w : α) :
{xs : Fin m → α | ∃ (i : Fin m), xs i = w} = ⋃ (i : Fin m), (fun (xs : Fin m → α) => xs i) ⁻¹' {w}

The set of sample vectors in which point w appears equals the union of coordinate preimages {xs | xs i = w}.

The set of sample vectors containing a given point is measurable.

theorem Cslib.MachineLearning.PACLearning.seenElements_card_eq_sum {α : Type u_1} {m : ℕ} (W' : Finset α) :
(fun (xs : Fin m → α) => ↑(seenElements W' xs).card) = fun (xs : Fin m → α) => ∑ w ∈ W', if ∃ (i : Fin m), xs i = w then 1 else 0

The cardinality of seenElements W' xs as an extended non-negative real equals a finset sum of indicator functions over W'.

The function xs ↦ |seenElements W' xs| is measurable with respect to the product σ-algebra.

theorem Cslib.MachineLearning.PACLearning.expected_seenElements_le {α : Type u_1} [MeasurableSpace α] [MeasurableSingletonClass α] {W' : Finset α} {p : ℝ} (hp_nonneg : 0 ≤ p) (hp_le_one : p ≤ 1) {m : ℕ} (P : MeasureTheory.Measure α) [MeasureTheory.IsProbabilityMeasure P] (hP_w : ∀ w ∈ W', P {w} = ENNReal.ofReal p) :
(∫⁻ (xs : Fin m → α), ↑(seenElements W' xs).card ∂MeasureTheory.Measure.pi fun (x : Fin m) => P) ≤ ENNReal.ofReal (↑W'.card * (↑m * p))

Bernoulli integration bound: the expected number of elements of W' seen in a random sample of size m is at most |W'| · m · p, when each element of W' has probability p ≤ 1 under the base measure P.