Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 2.1 (Occam's Razor): an (α, β)-Occam algorithm is a PAC learning algorithm, with explicit sample-size conditions

Proved
ComputationalLearning.occam_razor

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

occam-learningpac-learningsample-complexity

Theorem 2.1 (Occam's Razor). Let LLL be an efficient (α,β)(\alpha, \beta)(α,β)-Occam algorithm for CCC using HHH. Let DDD be the target distribution, c∈Cc \in Cc∈C the target concept and 0<ϵ,δ≤10 < \epsilon, \delta \le 10<ϵ,δ≤1. Then there is a constant a>0a > 0a>0 such that if LLL is given a random sample of mmm examples with m≥a((1/ϵ)log⁡(1/δ)+((n⋅size(c))α/ϵ)1/(1−β))m \ge a\big((1/\epsilon)\log(1/\delta) + ((n \cdot \mathrm{size}(c))^\alpha/\epsilon)^{1/(1-\beta)}\big)m≥a((1/ϵ)log(1/δ)+((n⋅size(c))α/ϵ)1/(1−β)), then with probability at least 1−δ1 - \delta1−δ the output hhh of LLL satisfies error(h)≤ϵ\mathrm{error}(h) \le \epsilonerror(h)≤ϵ.

Formally: hypotheses are binary strings with a representation map RRR to measurable concepts; LLL maps samples of size mmm to strings; on every sample labeled by ccc its output represents a consistent hypothesis and has length at most (ns)αmβ(ns)^\alpha m^\beta(ns)αmβ (sss bounding size(c)\mathrm{size}(c)size(c), α≥0\alpha \ge 0α≥0, 0≤β<10 \le \beta < 10≤β<1). If m≥(2/ϵ)ln⁡(1/δ)m \ge (2/\epsilon)\ln(1/\delta)m≥(2/ϵ)ln(1/δ), m≥4ln⁡2/ϵm \ge 4\ln 2/\epsilonm≥4ln2/ϵ and m1−β≥(4ln⁡2/ϵ)(ns)αm^{1-\beta} \ge (4 \ln 2/\epsilon)(ns)^\alpham1−β≥(4ln2/ϵ)(ns)α, then the probability that R(L(S))R(L(S))R(L(S)) has error greater than ϵ\epsilonϵ is at most δ\deltaδ. These explicit conditions instantiate the book's constant aaa; efficiency is not modelled.

Preamble
import Definitions.Def_ComputationalLearning_Occam

open MeasureTheory
Formal statement
namespace ComputationalLearning

/-- **Theorem 2.1 (Occam's Razor)** (p. 34). Let `L` be an `(α, β)`-Occam algorithm for `C`
using `H`: on a sample of `m` examples labeled by `c ∈ Cₙ` it outputs a representation (a binary
string) of a hypothesis consistent with the sample of bit length at most `(n · size(c))^α m^β`,
`α ≥ 0`, `0 ≤ β < 1`. Then there is a constant `a > 0` such that if `L` is given a random sample of
`m ≥ a((1/ε) log(1/δ) + ((n · size(c))^α/ε)^{1/(1−β)})` examples, with probability at least
`1 − δ` its hypothesis has error at most `ε`. Stated with the explicit sufficient conditions
`m ≥ (2/ε) ln(1/δ)`, `m ≥ 4 ln 2/ε` and `m^{1−β} ≥ (4 ln 2/ε)(n s)^α`, where `s` bounds
`size(c)` (they make `2^{K+1}(1 − ε)^m ≤ δ` for `K = (n s)^α m^β`, the number of binary strings
of length at most `K` being less than `2^{K+1}`). -/
theorem occam_razor {X : Type*} [MeasurableSpace X] (c : X → Bool) (hc : Measurable c)
    (D : Measure X) [IsProbabilityMeasure D] (R : List Bool → X → Bool)
    (hR : ∀ r, Measurable (R r)) (n s : ℕ) {α β : ℝ} (hα : 0 ≤ α) (hβ0 : 0 ≤ β) (hβ : β < 1)
    {ε δ : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) (hδ : 0 < δ) (hδ1 : δ < 1) (m : ℕ)
    (L : (Fin m → X × Bool) → List Bool)
    (hcons : ∀ S, IsLabeledBy c S → IsConsistent (R (L S)) S)
    (hsize : ∀ S, IsLabeledBy c S →
      ((L S).length : ℝ) ≤ ((n * s : ℕ) : ℝ) ^ α * (m : ℝ) ^ β)
    (hm1 : 2 / ε * Real.log (1 / δ) ≤ m) (hm2 : 4 * Real.log 2 / ε ≤ m)
    (hm3 : 4 * Real.log 2 / ε * ((n * s : ℕ) : ℝ) ^ α ≤ (m : ℝ) ^ (1 - β)) :
    sampleLaw D c m {S | ε < errorOf D c (R (L S))} ≤ ENNReal.ofReal δ := by sorry

end ComputationalLearning
Source
Kearns and Vazirani, An Introduction to Computational Learning Theory, MIT Press 1994, doi:10.7551/mitpress/3897.001.0001, §2.1 pp. 33-37, Definition 6 and Theorem 2.1 with its proof from Theorem 2.2
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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me