Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Corollary 3.19 — VC-dimension generalization bound (goal)

Disproved
FoundationsML.RademacherVC.vc_dimension_generalization_bound

by mikedeng1 · Sep 19, 2026 · Mathlib 0df444a (Lean v4.33.1)

generalization-boundmachine-learningvc-dimension

Statement (Corollary 3.19, p. 42, PDF p. 59). Let HHH be a family of functions taking values in {−1,+1}\{-1,+1\}{−1,+1} with VC-dimension ddd. Then, for any δ>0\delta>0δ>0, with probability at least 1−δ1-\delta1−δ, the following holds for all h∈Hh\in Hh∈H:

R(h)≤R^S(h)+2dlog⁡(em/d)m+log⁡(1/δ)2m.R(h) \le \hat R_S(h) + \sqrt{\frac{2d\log(em/d)}{m}} + \sqrt{\frac{\log(1/\delta)}{2m}}.R(h)≤R^S​(h)+m2dlog(em/d)​​+2mlog(1/δ)​​.

This is the chapter's capstone: it replaces Theorem 2.13's log⁡∣H∣\log|H|log∣H∣ (which requires HHH finite) with the VC-dimension ddd, extending the finite-hypothesis-set learning bound to the infinite hypothesis sets used throughout machine learning, via the chain Theorem 3.3 (Rademacher bound) → Theorem 3.5/Corollary 3.8 (Massart's-lemma-based growth-function bound) → Sauer's lemma → Corollary 3.18's O(md)O(m^d)O(md) growth-function bound.

Formalization Note. H : Set (X → Bool) (possibly infinite, unlike chapter 2's Finset); em/d is Real.exp 1 * m / d; the side condition d ≤ m (hm) is added explicitly — needed for Corollary 3.18's own domain (for all m ≥ d), which this bound's proof composes through, and dropped by neither the book nor this formalization (per BRIEF.md's pitfall note). ∀ h ∈ H, … is placed inside the probability event (uniform convergence), matching "the following holds for all h ∈ H."


Retired. Retired because it allowed the degenerate sample size m = 0, where the bound is false; replaced by FoundationsML.RademacherVC.vc_dimension_generalization_bound_v2.

Preamble
import Mathlib
import Definitions.Def_FoundationsML_RademacherVC_GeneralizationError
import Definitions.Def_FoundationsML_RademacherVC_EmpiricalError
import Definitions.Def_FoundationsML_RademacherVC_HasVCDim

open MeasureTheory
Formal statement
namespace FoundationsML.RademacherVC

/-- Corollary 3.19 (VC-dimension generalization bound; goal; Mohri, Rostamizadeh &
Talwalkar, *Foundations of Machine Learning*, 2nd ed., MIT Press 2018, p. 42, PDF p. 59).
Let `H` be a family of functions taking values in `{−1,+1}` (here: `Bool`) with VC-dimension
`d`. Then, for any `δ > 0`, with probability at least `1 − δ`, the following holds for all
`h ∈ H`:
`R(h) ≤ R̂_S(h) + sqrt(2d log(em/d)/m) + sqrt(log(1/δ)/(2m))`. -/
theorem vc_dimension_generalization_bound
    {X : Type*} [MeasurableSpace X] (D : Measure X) [IsProbabilityMeasure D]
    (H : Set (X → Bool)) (d : ℕ) (hH : HasVCDim H d) (c : X → Bool)
    (m : ℕ) (hm : d ≤ m) (δ : ℝ) (hδ : 0 < δ) :
    (1 - δ) ≤ (Measure.pi (fun _ : Fin m => D)
      {S : Fin m → X | ∀ h ∈ H, GeneralizationError D c h ≤
        EmpiricalError S c h +
          Real.sqrt (2 * d * Real.log (Real.exp 1 * m / d) / m) +
          Real.sqrt (Real.log (1 / δ) / (2 * m))}).toReal := by sorry

end FoundationsML.RademacherVC
Source
Mohri, Rostamizadeh & Talwalkar, Foundations of Machine Learning, 2nd ed., MIT Press 2018, p. 42, Corollary 3.19 (PDF p. 59)
Human review
  • Endorsed by Shuze Chen · Sep 28, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 28, 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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me