Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma D.1 — Hoeffding's lemma

Proved
MohriFoML.OnlineToBatch.hoeffding_lemma

by mikedeng1 · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

concentration-inequalitiesprobability

Let XXX be a real random variable on a probability space with E[X]=0\mathbb{E}[X] = 0E[X]=0 and a≤X≤ba \le X \le ba≤X≤b, where b>ab > ab>a. Then for every t>0t > 0t>0,

E[etX]≤et2(b−a)28.\mathbb{E}\big[e^{tX}\big] \le e^{\frac{t^2 (b - a)^2}{8}} .E[etX]≤e8t2(b−a)2​.

Hoeffding's lemma bounds the moment generating function of a bounded centred variable by that of a Gaussian with variance (b−a)2/4(b-a)^2/4(b−a)2/4. Combined with the Chernoff bounding technique (D.1) it yields Hoeffding's inequality (Theorem D.2), which Section 8.4 applies to a fixed near-optimal hypothesis in the proof of (8.28).

Formalization Note XXX is a measurable function on the probability space and the bounds hold at every point; XXX and etXe^{tX}etX are then integrable, so both expectations are genuine.

Differences from the source: none.

Preamble
import Mathlib
Formal statement
namespace MohriFoML.OnlineToBatch

open MeasureTheory

/-- **Lemma D.1: Hoeffding's lemma.**
Mohri, Rostamizadeh & Talwalkar, Foundations of Machine Learning, 2nd ed., MIT Press 2018,
Appendix D, §D.1, p. 437 (PDF p. 454), Lemma D.1, inequality (D.2).

Let `X` be a random variable with `E[X] = 0` and `a ≤ X ≤ b` with `b > a`. Then for any `t > 0`,
`E[e^{tX}] ≤ e^{t²(b−a)²/8}`.

**Formalization Note.** `X` is a measurable real function on a probability space `(Ω, μ)`, and
`a ≤ X ≤ b` holds at every point; together these make `X` and `e^{tX}` integrable, so both
expectations (written as Bochner integrals) are the genuine ones. -/
theorem hoeffding_lemma {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ]
    (X : Ω → ℝ) (a b : ℝ) (hX : Measurable X)
    (hmean : ∫ ω, X ω ∂μ = 0) (hab : a < b) (hXab : ∀ ω, a ≤ X ω ∧ X ω ≤ b) :
    ∀ t : ℝ, 0 < t →
      ∫ ω, Real.exp (t * X ω) ∂μ ≤ Real.exp (t ^ 2 * (b - a) ^ 2 / 8) := by sorry

end MohriFoML.OnlineToBatch
Source
Mohri, Rostamizadeh & Talwalkar, Foundations of Machine Learning, 2nd ed., MIT Press 2018, p. 437 (PDF p. 454), Appendix D §D.1, Lemma D.1 (Hoeffding's lemma), (D.2)
Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Oct 31, 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