Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 2.5 — learning bound, finite H, consistent case

Disproved
FoundationsML.PAC.finite_consistent_learning_bound

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

finite-hypothesis-setgeneralization-boundmachine-learningpac-learning

Statement (Theorem 2.5, p. 15, PDF p. 32). Let HHH be a finite set of functions mapping from XXX to YYY. Let AAA be an algorithm that, for any target concept c∈Hc \in Hc∈H and i.i.d. sample SSS, returns a consistent hypothesis hSh_ShS​: R^S(hS)=0\hat R_S(h_S) = 0R^S​(hS​)=0. Then, for any ϵ,δ>0\epsilon,\delta>0ϵ,δ>0, the inequality Pr⁡S∼Dm[R(hS)≤ϵ]≥1−δ\Pr_{S\sim D^m}[R(h_S)\le\epsilon]\ge1-\deltaPrS∼Dm​[R(hS​)≤ϵ]≥1−δ holds if

m≥1ϵ(log⁡∣H∣+log⁡1δ).m \ge \frac1\epsilon\Big(\log|H| + \log\frac1\delta\Big).m≥ϵ1​(log∣H∣+logδ1​).

This is the chapter's first general learning guarantee: whenever a finite hypothesis set admits a consistent algorithm, PAC-learnability follows with a sample complexity only logarithmic in ∣H∣|H|∣H∣.

Formalization Note. A is modeled as ∀ m, (Fin m → X) → (X → Y) together with two hypotheses making precise "returns a consistent hypothesis hS∈Hh_S \in HhS​∈H": A m S ∈ H for every sample, and EmpiricalError S c (A m S) = 0. The sample-complexity condition m ≥ (1/ε)(log|H|+log(1/δ)) is stated in the equivalent multiplied-out form log|H| + log(1/δ) ≤ ε·m to avoid a division by ε on the hypothesis side; no upper bound on δ is imposed, matching the book's own unrestricted "for any ε, δ > 0."


Retired. Retired because Measurable c/Measurable h for an arbitrary σ-algebra on Y leave the error events non-measurable, making the statement false; replaced by FoundationsML.PAC.finite_consistent_learning_bound_v2.

Preamble
import Mathlib
import Definitions.Def_FoundationsML_PAC_GeneralizationError
import Definitions.Def_FoundationsML_PAC_EmpiricalError

open MeasureTheory
Formal statement
namespace FoundationsML.PAC

/-- Theorem 2.5 (Learning bound — finite `H`, consistent case; Mohri, Rostamizadeh &
Talwalkar, *Foundations of Machine Learning*, 2nd ed., MIT Press 2018, p. 15, PDF p. 32).
Let `H` be a finite set of functions mapping from `X` to `Y`. Let `A` be an algorithm that,
for the target concept `c ∈ H`, returns on any i.i.d. sample `S` of size `m` a hypothesis
`A m S ∈ H` consistent with `c` (`R̂_S(A m S) = 0`). Then, for any `ε, δ > 0`, the inequality
`P_{S∼D^m}[R(A m S) ≤ ε] ≥ 1 − δ` holds whenever `m ≥ (1/ε)(log|H| + log(1/δ))`.

**Formalization note.** Carries the book's standing measurability hypothesis (Definition 2.1,
footnote 2, p. 11: "the family of functions `H` and the target concept `c` must be
measurable") on `c` and on every `h ∈ H` — the latter covers `A m S` since `hA_mem` already
places it in `H`. -/
theorem finite_consistent_learning_bound
    {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] (H : Finset (X → Y)) (D : Measure X)
    [IsProbabilityMeasure D] (c : X → Y) (hc : c ∈ H)
    (hc_meas : Measurable c) (hH_meas : ∀ h ∈ H, Measurable h)
    (A : ∀ m : ℕ, (Fin m → X) → (X → Y))
    (hA_mem : ∀ m (S : Fin m → X), A m S ∈ H)
    (hA_consistent : ∀ m (S : Fin m → X), EmpiricalError S c (A m S) = 0)
    (ε δ : ℝ) (hε : 0 < ε) (hδ : 0 < δ)
    (m : ℕ) (hm : Real.log (H.card : ℝ) + Real.log (1 / δ) ≤ ε * m) :
    (1 - δ) ≤ (Measure.pi (fun _ : Fin m => D)
      {S : Fin m → X | GeneralizationError D c (A m S) ≤ ε}).toReal := by sorry

end FoundationsML.PAC
Source
Mohri, Rostamizadeh & Talwalkar, Foundations of Machine Learning, 2nd ed., MIT Press 2018, p. 15, Theorem 2.5 (PDF p. 32)
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