Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 3.7 — Massart's lemma

Proved
FoundationsML.RademacherVC.massart_lemma

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

combinatoricsmachine-learningrademacher-complexity

Statement (Theorem 3.7, p. 35, PDF p. 52). Let A⊆RmA\subseteq\mathbb R^mA⊆Rm be a finite set, with r=max⁡x∈A∥x∥2r=\max_{x\in A}\|x\|_2r=maxx∈A​∥x∥2​. Then

Eσ[1msup⁡x∈A∑i=1mσixi]≤r2log⁡∣A∣m,\mathbb E_\sigma\Big[\frac1m\sup_{x\in A}\sum_{i=1}^m\sigma_i x_i\Big] \le r\sqrt{\frac{2\log|A|}{m}},Eσ​[m1​x∈Asup​i=1∑m​σi​xi​]≤rm2log∣A∣​​,

where σ1,…,σm\sigma_1,\dots,\sigma_mσ1​,…,σm​ are independent uniform {−1,+1}\{-1,+1\}{−1,+1}-valued random variables and x1,…,xmx_1,\dots,x_mx1​,…,xm​ are the components of vector xxx.

This is a purely combinatorial, deterministic bound on the expectation of a maximum of linear functionals over a finite set, the key tool relating Rademacher complexity to the growth function (Corollary 3.8).

Formalization Note. σ ranges over Fin m → Bool as in EmpiricalRademacherComplexity (the exact finite uniform average, no measure theory); A.sup' needs A nonempty (hA), matching the book's own implicit assumption that sup_{x∈A} is meaningful for a finite set. No δ or sample S appears — this is deterministic, not probabilistic, over S (per BRIEF.md's pitfall note).

Preamble
import Mathlib
Formal statement
namespace FoundationsML.RademacherVC

/-- Theorem 3.7 (Massart's lemma; Mohri, Rostamizadeh & Talwalkar, *Foundations of Machine
Learning*, 2nd ed., MIT Press 2018, p. 35, PDF p. 52). Let `A ⊆ ℝ^m` be a finite (nonempty)
set, with `r = max_{x∈A} ‖x‖₂`. Then
`E_σ[(1/m) sup_{x∈A} ∑_{i=1}^m σ_i x_i] ≤ r sqrt(2 log|A|/m)`,
where `σ_1,…,σ_m` are independent uniform `{−1,+1}`-valued random variables and
`x_1,…,x_m` are the components of vector `x`.

**Formalization Note.** As in `EmpiricalRademacherComplexity`, `σ` ranges over `Fin m → Bool`
and the expectation over `σ` is the exact finite uniform average over its `2^m` outcomes;
`A.sup'` needs `A` nonempty, matching the book's own implicit assumption that `sup_{x∈A}` is
meaningful for a finite set `A`. -/
theorem massart_lemma
    {m : ℕ} (A : Finset (Fin m → ℝ)) (hA : A.Nonempty) (r : ℝ)
    (hr : ∀ x ∈ A, Real.sqrt (∑ i, (x i) ^ 2) ≤ r) :
    (1 / (2 : ℝ) ^ m) * ∑ σ : Fin m → Bool,
        (1 / (m : ℝ)) * A.sup' hA (fun x => ∑ i : Fin m, (if σ i then (1 : ℝ) else -1) * x i)
      ≤ r * Real.sqrt (2 * Real.log (A.card : ℝ) / m) := by sorry

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