Documentation

CslibFrontier.MachineLearning.PACLearning.VCLowerBound

The VC lower bound for PAC learning on general domains #

Ehrenfeucht, Haussler, Kearns and Valiant [EHKV1989, §3, Theorem 1] showed that learning a binary class which shatters d + 1 points to accuracy ε ≤ 1/8 with confidence 1 - δ, δ ≤ 1/100, needs at least d / (32 ε) examples, even for randomized learners and even over the distributions the class realizes. The vendored SampleComplexityLower proves the same bound for the wider confidence range δ < 1/14, an adaptation of the source's constants made by the vendored proof, for classes of measurable concepts. This module removes the measurability hypothesis, so that the bound holds for every binary class on every domain with measurable singletons:

W.card ≤ 32 ε m + 1 for every finite set W shattered by C and every randomized (ε, δ)-PAC learner for C from m examples over a family containing the realizable distributions.

The proof restricts the learning problem to the shattered set. Restricting a concept class to a countable subdomain s (restrictDomain C s) preserves PAC learners (IsPACLearnerFor.restrictDomain, IsRPACLearnerFor.restrictDomain): composing a learner for C with the inclusion of s learns the restricted class, because a distribution on s × Bool and its pushforward to α × Bool assign the same errors and the same optimal error. On the finite domain W every concept is measurable, and the vendored bound applies.

Consequently PAC learnability over the realizable distributions, and a fortiori agnostic PAC learnability, forces finite VC dimension on every domain with measurable singletons (IsRPACLearnable.hasFiniteVCDim, IsPACLearnable.hasFiniteVCDim), with evcDim C ≤ ⌊32 ε m + 1⌋ for each learner (evcDim_le_of_isRPACLearnerFor). The measurable-singleton hypothesis matters here. On a domain with the trivial σ-algebra the error of any nonconstant hypothesis is one under every distribution, so majority vote learns the class of all Boolean functions agnostically although it shatters every finite set.

Main definitions #

Main results #

References #

def Cslib.MachineLearning.PACLearning.restrictDomain {α : Type u_1} {β : Type u_2} (C : ConceptClass α β) (s : Set α) :
ConceptClass (↑s) β

The restriction of a concept class C on α to the subdomain s: the concepts of C, each evaluated only at the points of s.

theorem Cslib.MachineLearning.PACLearning.mem_restrictDomain {α : Type u_1} {β : Type u_2} {C : ConceptClass α β} {s : Set α} {c : ↑s → β} :
c ∈ restrictDomain C s ↔ ∃ c' ∈ C, (fun (x : ↑s) => c' ↑x) = c

A class that shatters s restricts to a class that shatters all of s.

Restricting learners to a countable subdomain #

theorem Cslib.MachineLearning.PACLearning.IsPACLearnerFor.restrictDomain {α : Type u_1} [MeasurableSpace α] [MeasurableSingletonClass α] {s : Set α} [Countable ↑s] {m : ℕ} {ε δ : ↑(Set.Ioo 0 1)} {C : ConceptClass α Bool} {𝒟 : Set (MeasureTheory.Measure (α × Bool))} {𝒟' : Set (MeasureTheory.Measure (↑s × Bool))} (h𝒟 : ∀ D ∈ 𝒟', MeasureTheory.Measure.map (Prod.map Subtype.val id) D ∈ 𝒟) (h : IsPACLearnerFor m ε δ C 𝒟) :

PAC learners restrict to countable subdomains. If C has an (ε, δ)-PAC learner from m examples over a family containing the pushforwards of the distributions in 𝒟' along the inclusion of s, then so has its restriction to s over 𝒟': run the learner for C and restrict its hypothesis to s.

theorem Cslib.MachineLearning.PACLearning.IsRPACLearnerFor.restrictDomain {α : Type u_1} [MeasurableSpace α] [MeasurableSingletonClass α] {s : Set α} [Countable ↑s] {m : ℕ} {ε δ : ↑(Set.Ioo 0 1)} {C : ConceptClass α Bool} {𝒟 : Set (MeasureTheory.Measure (α × Bool))} {𝒟' : Set (MeasureTheory.Measure (↑s × Bool))} (h𝒟 : ∀ D ∈ 𝒟', MeasureTheory.Measure.map (Prod.map Subtype.val id) D ∈ 𝒟) (h : IsRPACLearnerFor m ε δ C 𝒟) :

Randomized PAC learners restrict to countable subdomains; see IsPACLearnerFor.restrictDomain.

Pushing a distribution realizable by the restriction of C to s forward along the inclusion gives a distribution realizable by C.

The EHKV lower bound on general domains #

theorem Cslib.MachineLearning.PACLearning.card_le_of_isRPACLearnerFor {α : Type u_1} [MeasurableSpace α] [MeasurableSingletonClass α] {C : ConceptClass α Bool} {W : Finset α} (hW : SetShatters C ↑W) {m : ℕ} {ε δ : ↑(Set.Ioo 0 1)} (hε : ↑↑ε ≤ 1 / 8) (hδ : ↑↑δ < 1 / 14) {𝒟 : Set (MeasureTheory.Measure (α × Bool))} (h𝒟 : realizableDistributions C ⊆ 𝒟) (hlearn : IsRPACLearnerFor m ε δ C 𝒟) :
↑W.card ≤ 32 * ↑↑ε * ↑m + 1

The EHKV lower bound [EHKV1989, §3, Theorem 1] for an arbitrary binary class on a domain with measurable singletons: if C shatters the finite set W, then every randomized (ε, δ)-PAC learner for C with ε ≤ 1/8 and δ < 1/14 over a family containing the distributions C realizes uses m ≥ (W.card - 1) / (32 ε) examples. No measurability of the concepts is assumed. The source states the bound for δ ≤ 1/100; the range δ < 1/14 is the vendored proof's adaptation (see sample_complexity_lower_bound_randomized).

theorem Cslib.MachineLearning.PACLearning.card_le_of_isPACLearnerFor {α : Type u_1} [MeasurableSpace α] [MeasurableSingletonClass α] {C : ConceptClass α Bool} {W : Finset α} (hW : SetShatters C ↑W) {m : ℕ} {ε δ : ↑(Set.Ioo 0 1)} (hε : ↑↑ε ≤ 1 / 8) (hδ : ↑↑δ < 1 / 14) {𝒟 : Set (MeasureTheory.Measure (α × Bool))} (h𝒟 : realizableDistributions C ⊆ 𝒟) (hlearn : IsPACLearnerFor m ε δ C 𝒟) :
↑W.card ≤ 32 * ↑↑ε * ↑m + 1

The EHKV lower bound for deterministic learners; see card_le_of_isRPACLearnerFor.

theorem Cslib.MachineLearning.PACLearning.evcDim_le_of_isRPACLearnerFor {α : Type u_1} [MeasurableSpace α] [MeasurableSingletonClass α] {C : ConceptClass α Bool} {m : ℕ} {ε δ : ↑(Set.Ioo 0 1)} (hε : ↑↑ε ≤ 1 / 8) (hδ : ↑↑δ < 1 / 14) {𝒟 : Set (MeasureTheory.Measure (α × Bool))} (h𝒟 : realizableDistributions C ⊆ 𝒟) (hlearn : IsRPACLearnerFor m ε δ C 𝒟) :
evcDim C ≤ ↑⌊32 * ↑↑ε * ↑m + 1⌋₊

The VC dimension of a class with a randomized (ε, δ)-PAC learner from m examples, ε ≤ 1/8 and δ < 1/14, over a family containing the realizable distributions is at most 32 ε m + 1.

Learnability implies finite VC dimension on every domain with measurable singletons: a class that is randomized PAC learnable over a family containing the distributions it realizes has finite VC dimension.

Learnability implies finite VC dimension on every domain with measurable singletons, for deterministic learners; in particular agnostic PAC learnability (𝒟 = Set.univ) implies finite VC dimension.