Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4 — Freedman's inequality for martingale differences

Proved
StochLinOpt.UpperBound.freedman

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

concentrationmartingalesp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1probability

Let (Ω,F,P)(\Omega,\mathcal F,\mathbb P)(Ω,F,P) be a probability space with a filtration (Fi)i≥0(\mathcal F_i)_{i\ge0}(Fi​)i≥0​. Let X1,…,XTX_1,\dots,X_TX1​,…,XT​ be real random variables such that for each 1≤i≤T1\le i\le T1≤i≤T:

  1. XiX_iXi​ is Fi+1\mathcal F_{i+1}Fi+1​-measurable, integrable, with E[Xi2]<∞\mathbb E[X_i^2]<\inftyE[Xi2​]<∞;
  2. E[Xi∣Fi]=0\mathbb E[X_i\mid\mathcal F_i]=0E[Xi​∣Fi​]=0 almost surely (a martingale difference sequence);
  3. Xi≤bX_i\le bXi​≤b almost surely.

Let V=∑i=1TE[Xi2∣Fi]V=\sum_{i=1}^{T}\mathbb E[X_i^2\mid\mathcal F_i]V=∑i=1T​E[Xi2​∣Fi​] be the sum of conditional variances. Then for every a>0a>0a>0 and v>0v>0v>0,

P(∑i=1TXi≥a  and  V≤v)≤exp⁡(−a22v+2ab/3).\mathbb P\Big(\sum_{i=1}^{T}X_i\ge a\ \text{ and }\ V\le v\Big)\le\exp\Big(\frac{-a^2}{2v+2ab/3}\Big).P(i=1∑T​Xi​≥a  and  V≤v)≤exp(2v+2ab/3−a2​).

This Bernstein-type martingale inequality lets the step bound be large as long as the conditional variances are small; the paper uses it to prove Lemma 14.

Formalization Note The paper prints the variance sum up to nnn; this is a typo for TTT. The paper conditions on X1,…,Xi−1X_1,\dots,X_{i-1}X1​,…,Xi−1​; the statement uses a general filtration in which XiX_iXi​ is known at time i+1i+1i+1 and conditioned on time iii, which is Freedman's original form (Ann. Probab. 1975) and contains the natural filtration as a special case. Since E[Xi∣Fi]=0\mathbb E[X_i\mid\mathcal F_i]=0E[Xi​∣Fi​]=0, the conditional variance is E[Xi2∣Fi]\mathbb E[X_i^2\mid\mathcal F_i]E[Xi2​∣Fi​]. Square integrability is assumed so that this conditional expectation is not Lean's junk value 000.

Preamble
import Mathlib

open MeasureTheory
Formal statement
namespace StochLinOpt.UpperBound

theorem freedman {Ω : Type*} {mΩ : MeasurableSpace Ω} (P : Measure Ω) [IsProbabilityMeasure P]
    (𝓕 : Filtration ℕ mΩ) (X : ℕ → Ω → ℝ) (T : ℕ) (b : ℝ)
    (hmeas : ∀ i ∈ Finset.Icc 1 T, Measurable[𝓕 (i + 1)] (X i))
    (hint : ∀ i ∈ Finset.Icc 1 T, Integrable (X i) P)
    (hint_sq : ∀ i ∈ Finset.Icc 1 T, Integrable (fun ω => X i ω ^ 2) P)
    (hmds : ∀ i ∈ Finset.Icc 1 T, P[X i | 𝓕 i] =ᵐ[P] 0)
    (hb : ∀ i ∈ Finset.Icc 1 T, ∀ᵐ ω ∂P, X i ω ≤ b)
    (a v : ℝ) (ha : 0 < a) (hv : 0 < v) :
    P.real {ω | a ≤ ∑ i ∈ Finset.Icc 1 T, X i ω ∧
        ∑ i ∈ Finset.Icc 1 T, P[fun ω' => X i ω' ^ 2 | 𝓕 i] ω ≤ v} ≤
      Real.exp (-a ^ 2 / (2 * v + 2 * a * b / 3)) := by sorry

end StochLinOpt.UpperBound
Source
Dani, Hayes, Kakade, Stochastic Linear Optimization under Bandit Feedback, COLT 2008, PDF p. 6, Theorem 4 (Freedman [1975])
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting.

  • (Ω,P)(\Omega, P)(Ω,P) is a probability space.
  • F=(Fk)k∈N\mathcal{F} = (\mathcal{F}_k)_{k\in\mathbb{N}}F=(Fk​)k∈N​ is a filtration of sub-σ-algebras.
  • X0,X1,⋯:Ω→RX_0, X_1, \dots : \Omega\to\mathbb{R}X0​,X1​,⋯:Ω→R are real random variables.
  • T∈NT\in\mathbb{N}T∈N and b∈Rb\in\mathbb{R}b∈R.

Hypotheses (each for every iii with 1≤i≤T1\le i\le T1≤i≤T).

  1. XiX_iXi​ is Fi+1\mathcal{F}_{i+1}Fi+1​-measurable.
  2. XiX_iXi​ and Xi2X_i^2Xi2​ are PPP-integrable.
  3. E[Xi∣Fi]=0\mathbb{E}[X_i\mid\mathcal{F}_i]=0E[Xi​∣Fi​]=0 almost surely.
  4. Xi≤bX_i\le bXi​≤b almost surely.

Further, a>0a>0a>0 and v>0v>0v>0 are reals. Variables XiX_iXi​ with i=0i=0i=0 or i>Ti>Ti>T are unconstrained and unused.

Conclusion.

P(∑i=1TXi≥a  and  ∑i=1TE[Xi2∣Fi]≤v)  ≤  exp⁡ ⁣(−a22v+2ab3).P\Big(\sum_{i=1}^{T}X_i\ge a \ \text{ and } \ \sum_{i=1}^{T}\mathbb{E}[X_i^2\mid\mathcal{F}_i]\le v\Big) \;\le\; \exp\!\Big(\frac{-a^2}{2v+\tfrac{2ab}{3}}\Big).P(i=1∑T​Xi​≥a  and  i=1∑T​E[Xi2​∣Fi​]≤v)≤exp(2v+32ab​−a2​).

In the event, the conditional expectations are evaluated pointwise, using one fixed version of each. PPP of a set is its (outer) probability.

Degenerate cases.

  • T=0T = 0T=0: both sums are 000 and a>0a>0a>0, so the event is empty and its probability is 000. The bound holds whatever bbb is. In particular:
    • if 2v+2ab/3=02v+2ab/3=02v+2ab/3=0, the division by zero gives exponent 000 and the bound is 111;
    • if 2v+2ab/3<02v+2ab/3<02v+2ab/3<0, the bound exceeds 111.
  • T≥1T\ge1T≥1, b<0b<0b<0: hypotheses 3 and 4 contradict each other, so the statement is vacuous.
  • T≥1T\ge1T≥1, b=0b=0b=0: the hypotheses force Xi=0X_i=0Xi​=0 almost surely, and the event has probability 000.
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