AFTD Auto-Formalizing Theoretical Domains

hoeffding_lemma

theoremverifiedimported Lean

Hoeffding's lemma. Let $p \in [0,1]$ and let $h \in \bbr$ be arbitrary. Then \[ \log\!\bigl((1-p) + p\,e^{h}\bigr) \;\le\; p\,h + \frac{h^{2}}{8}. \]

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Real Finset BigOperators in
lemma hoeffding_lemma {p h : ℝ} (hp0 : 0 ≤ p) (hp1 : p ≤ 1) :
    Real.log ((1 - p) + p * Real.exp h) ≤ p * h + h ^ 2 / 8
Source
TCSlib, `hoeffding_lemma`
Lean proof
By Karim Abdel Sadek, Mark Bedaywi, from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Copyright (c) 2026 Karim Abdel Sadek and Mark Bedaywi. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • bernoulli_mgf_boundBernoulli MGF bound (Hoeffding's lemma). Let $L \in [0,1]$ and let $\eta$ be a real number. Then the moment generating function of the…
Used by 1
  • log_potential_step_tightTight per-step logarithmic potential bound for Hedge. Fix $N \ge 1$ experts and a learning rate $\eta > 0$, and let $\ell$ be a valid loss…

Lean source view module on GitHub

set_option relaxedAutoImplicit false inset_option autoImplicit false inopen Real Finset BigOperators in/-- **Hoeffding's lemma**, Bernoulli case: for `p ∈ [0,1]` and any real `h`, `ln((1-p) + p·eʰ) ≤ p·h + h²/8`; that is, the log-moment generating function of a `{0,1}`-valued random variable with mean `p` is at most `p·h + h²/8` [CBL06, Lemma 2.2]; [MRT18, Lemma D.1]. Deviation: only the two-point distribution on `{0,1}` (range length `b - a = 1`) is covered, not a general `[a,b]`-valued variable. Specializes `bernoulli_mgf_bound` from `Hedge.Hoeffding` by substituting `η = -h`. -/lemma hoeffding_lemma {p h : ℝ} (hp0 : 0 ≤ p) (hp1 : p ≤ 1) :    Real.log ((1 - p) + p * Real.exp h) ≤ p * h + h ^ 2 / 8 := by  have hb := bernoulli_mgf_bound p (-h) hp0 hp1  simp only [neg_neg] at hb  linarith [show -p * -h + (-h) ^ 2 / 8 = p * h + h ^ 2 / 8 from by ring]
See it in the graphDiscuss this resultChallenge it