Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 9 — Freedman's inequality

Proved
TamingMonster.Regret.freedman_inequality

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

concentrationmartingalesp2o-batch-p200ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let X1,…,XTX_1,\dots,X_TX1​,…,XT​ be real random variables on a probability space. Suppose that for every t∈{1,…,T}t\in\{1,\dots,T\}t∈{1,…,T}, Xt≤RX_t\le RXt​≤R almost surely and E[Xt∣X1,…,Xt−1]=0\mathbb E[X_t\mid X_1,\dots,X_{t-1}]=0E[Xt​∣X1​,…,Xt−1​]=0. Put

S=∑t=1TXt,V=∑t=1TE[Xt2∣X1,…,Xt−1].S=\sum_{t=1}^T X_t,\qquad V=\sum_{t=1}^T\mathbb E[X_t^2\mid X_1,\dots,X_{t-1}].S=t=1∑T​Xt​,V=t=1∑T​E[Xt2​∣X1​,…,Xt−1​].

Then for every δ∈(0,1)\delta\in(0,1)δ∈(0,1) and every λ∈(0,1/R]\lambda\in(0,1/R]λ∈(0,1/R], with probability at least 1−δ1-\delta1−δ,

S≤(e−2)λV+ln⁡(1/δ)λ.S\le (e-2)\lambda V+\frac{\ln(1/\delta)}{\lambda}.S≤(e−2)λV+λln(1/δ)​.

This is the martingale concentration inequality behind the deviation bound for the inverse propensity estimates (Lemma 11); its strength is that it scales with the conditional variance VVV rather than with the range RRR.

Formalization Note The conditioning is on the natural σ-algebra σ(X1,…,Xt−1)\sigma(X_1,\dots,X_{t-1})σ(X1​,…,Xt−1​) (trivial for t=1t=1t=1). The paper allows λ=0\lambda=0λ=0, where the bound is +∞+\infty+∞; Lean's convention x/0=0x/0=0x/0=0 would make that case false, so λ>0\lambda>0λ>0 and R>0R>0R>0 are assumed. The variables are assumed measurable with XtX_tXt​ and Xt2X_t^2Xt2​ integrable (implicit in the paper; otherwise the conditional expectations are not defined). The conclusion is stated as "the failure event has (outer) probability at most δ\deltaδ".

Preamble
import Mathlib
Formal statement
namespace TamingMonster.Regret

open MeasureTheory

/-- Lemma 9 (Freedman's inequality, as quoted from Beygelzimer et al. 2011), p. 14.
`Xs 1, …, Xs T` are real random variables with `X_t ≤ R` and `E[X_t | X_1, …, X_{t−1}] = 0`;
`S = ∑_{t=1}^T X_t` and `V = ∑_{t=1}^T E[X_t² | X_1, …, X_{t−1}]`. For `δ ∈ (0,1)` and
`λ ∈ (0, 1/R]`, the event `S > (e − 2)λV + ln(1/δ)/λ` has probability at most `δ`.
The conditioning σ-algebra for round `t` is `σ(X_1, …, X_{t−1})` (trivial for `t = 1`). -/
theorem freedman_inequality {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω)
    [IsProbabilityMeasure P] (Xs : ℕ → Ω → ℝ) (T : ℕ) (R : ℝ) (hR : 0 < R)
    (hmeas : ∀ t, Measurable (Xs t))
    (hint : ∀ t, Integrable (Xs t) P)
    (hint2 : ∀ t, Integrable (fun ω => Xs t ω ^ 2) P)
    (hle : ∀ t ∈ Finset.Icc 1 T, ∀ᵐ ω ∂P, Xs t ω ≤ R)
    (hmart : ∀ t ∈ Finset.Icc 1 T,
      condExp (⨆ i ∈ Finset.Icc 1 (t - 1), MeasurableSpace.comap (Xs i) inferInstance) P (Xs t)
        =ᵐ[P] 0)
    (δ lam : ℝ) (hδ0 : 0 < δ) (hδ1 : δ < 1) (hlam0 : 0 < lam) (hlam1 : lam ≤ 1 / R) :
    P {ω | (Real.exp 1 - 2) * lam *
            (∑ t ∈ Finset.Icc 1 T,
              condExp (⨆ i ∈ Finset.Icc 1 (t - 1), MeasurableSpace.comap (Xs i) inferInstance) P
                (fun ω' => Xs t ω' ^ 2) ω)
          + Real.log (1 / δ) / lam
        < ∑ t ∈ Finset.Icc 1 T, Xs t ω} ≤ ENNReal.ofReal δ := by sorry

end TamingMonster.Regret
Source
Agarwal, Hsu, Kale, Langford, Li, Schapire, Taming the Monster: A Fast and Simple Algorithm for Contextual Bandits, arXiv:1402.0555v2, p. 14, Lemma 9 (quoted from Beygelzimer et al. 2011)
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 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