Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorems 3.3-3.4: a consistent hypothesis from a class of VC dimension d is PAC, with failure ≤ 2Φ_d(2m)2^(−εm/2) and explicit m

Proved
ComputationalLearning.vc_sample_bound

by naimengye · Sep 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

epsilon-netspac-learningsample-complexityvc-dimension

Theorem 3.3. Let CCC be any concept class of VC dimension ddd. Let LLL be any algorithm that takes as input a set SSS of mmm labeled examples of a concept in CCC, and produces as output a concept h∈Ch \in Ch∈C that is consistent with SSS. Then LLL is a PAC learning algorithm for CCC provided it is given a random sample of mmm examples from EX(c,D)EX(c, D)EX(c,D), where m≥c0(1ϵlog⁡1δ+dϵlog⁡1ϵ)m \ge c_0\big(\tfrac{1}{\epsilon}\log\tfrac{1}{\delta} + \tfrac{d}{\epsilon}\log\tfrac{1}{\epsilon}\big)m≥c0​(ϵ1​logδ1​+ϵd​logϵ1​) for some constant c0>0c_0 > 0c0​>0. Theorem 3.4 is the same with a hypothesis class HHH of VC dimension ddd in place of CCC.

Formally, for a class HHH of measurable hypotheses with vcDim(H)≤d\mathrm{vcDim}(H) \le dvcDim(H)≤d, a measurable target ccc for which HHH is well-behaved (the double-sample event is null-measurable), a distribution DDD, 0<ϵ<10 < \epsilon < 10<ϵ<1, 0<δ<10 < \delta < 10<δ<1 and m≥8/ϵm \ge 8/\epsilonm≥8/ϵ: (1) the probability that the points of a random sample of mmm examples fail to form an ϵ\epsilonϵ-net for the error regions {c Δ h:h∈H}\{c \,\Delta\, h : h \in H\}{cΔh:h∈H} is at most 2Φd(2m)2−ϵm/22\Phi_d(2m)2^{-\epsilon m/2}2Φd​(2m)2−ϵm/2 (the bound of p. 61: Pr⁡[A]≤2Pr⁡[B]\Pr[A] \le 2\Pr[B]Pr[A]≤2Pr[B], and Pr⁡[B]≤∣ΠΔ(c)(S)∣ 2−ϵm/2\Pr[B] \le |\Pi_{\Delta(c)}(S)|\,2^{-\epsilon m/2}Pr[B]≤∣ΠΔ(c)​(S)∣2−ϵm/2 by the random partition of the double sample); (2) hence every algorithm outputting a hypothesis in HHH consistent with its sample has error greater than ϵ\epsilonϵ with probability at most 2Φd(2m)2−ϵm/22\Phi_d(2m)2^{-\epsilon m/2}2Φd​(2m)2−ϵm/2; (3) if moreover m≥(4/ϵ)log⁡2(2/δ)m \ge (4/\epsilon)\log_2(2/\delta)m≥(4/ϵ)log2​(2/δ) and m≥(8d/ϵ)log⁡2(13/ϵ)m \ge (8d/\epsilon)\log_2(13/\epsilon)m≥(8d/ϵ)log2​(13/ϵ), that probability is at most δ\deltaδ (the explicit constants of Blumer, Ehrenfeucht, Haussler and Warmuth, which instantiate the book's c0c_0c0​); (4) consequently, if HHH is nonempty, every class C⊆HC \subseteq HC⊆H for whose targets HHH is well-behaved is PAC learnable using HHH. For H=∅H = \emptysetH=∅ no algorithm outputs hypotheses in HHH, so (4) needs HHH nonempty; the book's classes always are.

Why well-behavedness. The proof bounds the probability that the sample is not an ϵ\epsilonϵ-net by twice the probability of a double-sample event, and bounds the latter by averaging over the random swaps of the two samples. Both steps integrate over the double sample, so the event must be measurable. Blumer, Ehrenfeucht, Haussler and Warmuth (J. ACM 36, 1989) state the theorem for well-behaved classes for this reason. Without the condition the theorem is false. Take X=ω1X = \omega_1X=ω1​ with the countable–cocountable σ\sigmaσ-algebra and DDD the probability measure that is 111 on co-countable sets and 000 on countable ones. Let HHH be the final segments (α,ω1)(\alpha, \omega_1)(α,ω1​) together with the empty concept; it has VC dimension 111 and consists of measurable concepts. For the target c=∅c = \emptysetc=∅, every finite sample misses (max⁡S,ω1)(\max S, \omega_1)(maxS,ω1​), which has weight 111. So no sample is an ϵ\epsilonϵ-net, and the consistent learner that outputs (max⁡S,ω1)(\max S, \omega_1)(maxS,ω1​) has error 111 with probability 111. The double-sample event fails to be measurable there, because {(x,y):x<y}\{(x, y) : x < y\}{(x,y):x<y} is not measurable for the product σ\sigmaσ-algebra.

Preamble
import Definitions.Def_ComputationalLearning_VC

open MeasureTheory
Formal statement
namespace ComputationalLearning

/-- **Theorems 3.3 and 3.4** (pp. 61–62). Let `H` be a class of VC dimension at most `d` and `L`
any algorithm that outputs a hypothesis `h ∈ H` consistent with its sample of `m` labeled
examples of a target concept `c`. Then `L` is a PAC learning algorithm for `c` using `H` once
`m ≥ c₀((1/ε) log(1/δ) + (d/ε) log(1/ε))`. Stated with the bound of the proof (§3.5.2, p. 61):
for `m ≥ 8/ε`, a random sample fails to be an ε-net for the error regions with probability at
most `2 Φ_d(2m) 2^{−εm/2}`, hence so does a consistent hypothesis fail to have error at most `ε`;
and with the explicit constants `m ≥ (4/ε) log₂(2/δ)` and `m ≥ (8d/ε) log₂(13/ε)` (Blumer,
Ehrenfeucht, Haussler and Warmuth) the failure probability is at most `δ`. Consequently, for
nonempty `H`, every class `C ⊆ H` is PAC learnable using `H` in the sample-complexity sense (for
`H = ∅` no algorithm outputs hypotheses in `H`). `H` is assumed well-behaved
(`IsWellBehaved`), the measurability the double-sample argument needs; without it the statement
is false for some classes of VC dimension `1`. -/
theorem vc_sample_bound {X : Type*} [MeasurableSpace X] (H : Set (X → Bool))
    (hHm : ∀ h ∈ H, Measurable h) (d : ℕ) (hd : vcDim H ≤ d) (c : X → Bool) (hc : Measurable c)
    (hwb : IsWellBehaved H c)
    (D : Measure X) [IsProbabilityMeasure D] {ε δ : ℝ} (hε : 0 < ε) (hε1 : ε < 1) (hδ : 0 < δ)
    (hδ1 : δ < 1) (m : ℕ) (hm : 8 / ε ≤ m) :
    sampleLaw D c m {S | ¬ IsEpsNet H c D ε (samplePoints S)} ≤
      ENNReal.ofReal (2 * Phi d (2 * m) * (2 : ℝ) ^ (-(ε * m / 2))) ∧
    (∀ L : (Fin m → X × Bool) → X → Bool, (∀ S, L S ∈ H) →
      (∀ S, IsLabeledBy c S → IsConsistent (L S) S) →
      sampleLaw D c m {S | ε < errorOf D c (L S)} ≤
        ENNReal.ofReal (2 * Phi d (2 * m) * (2 : ℝ) ^ (-(ε * m / 2)))) ∧
    (4 / ε * Real.logb 2 (2 / δ) ≤ m → 8 * d / ε * Real.logb 2 (13 / ε) ≤ m →
      ∀ L : (Fin m → X × Bool) → X → Bool, (∀ S, L S ∈ H) →
        (∀ S, IsLabeledBy c S → IsConsistent (L S) S) →
        sampleLaw D c m {S | ε < errorOf D c (L S)} ≤ ENNReal.ofReal δ) ∧
    (H.Nonempty → ∀ C : Set (X → Bool), C ⊆ H → (∀ c' ∈ C, IsWellBehaved H c') →
      PACLearnable C H) := by sorry

end ComputationalLearning
Source
Kearns and Vazirani, An Introduction to Computational Learning Theory, MIT Press 1994, doi:10.7551/mitpress/3897.001.0001, §3.5 pp. 57-62, Theorem 3.3 with its proof (ε-nets, the double sample and the random partition) and Theorem 3.4
Human review
  • Endorsed by Shuze Chen · Sep 25, 2026

    Confirmed by the moderator at approval.

  • Endorsed by naimengye · Sep 25, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me