Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 6 — Confidence intervals ∣X‾i,t−μi∣≤ci,t|\overline X_{i,t} - \mu_i| \le c_{i,t}∣Xi,t​−μi​∣≤ci,t​ for all arms and times

Proved
ImprovedLinBandits.UCBDelta.confidence_intervals

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

confidence-intervalsmartingalemulti-armed-banditsp2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1sub-gaussian

Let (Ω,F,P)(\Omega, \mathcal F, P)(Ω,F,P) be a probability space with a filtration (Ft)t≥0(\mathcal F_t)_{t \ge 0}(Ft​)t≥0​. Consider ddd arms with means μ1,…,μd\mu_1, \dots, \mu_dμ1​,…,μd​. In round t≥1t \ge 1t≥1 an arm ItI_tIt​ that is Ft−1\mathcal F_{t-1}Ft−1​-measurable is played, and the reward μIt+ηt\mu_{I_t} + \eta_tμIt​​+ηt​ is received, where the noise ηt\eta_tηt​ is Ft\mathcal F_tFt​-measurable and conditionally 111-sub-Gaussian:

E[eληt∣Ft−1]≤eλ2/2for all λ∈R.\mathbf E\left[e^{\lambda \eta_t} \mid \mathcal F_{t-1}\right] \le e^{\lambda^2/2} \qquad \text{for all } \lambda \in \mathbb R .E[eληt​∣Ft−1​]≤eλ2/2for all λ∈R.

The arms ItI_tIt​ may be chosen by any adapted rule. Let Ni,tN_{i,t}Ni,t​ be the number of plays of arm iii in rounds 1,…,t1, \dots, t1,…,t, X‾i,t\overline X_{i,t}Xi,t​ the average reward of arm iii over those rounds, and

ci,t=1+Ni,tNi,t2(1+2log⁡(d (1+Ni,t)1/2δ)).c_{i,t} = \sqrt{\frac{1 + N_{i,t}}{N_{i,t}^2}\left(1 + 2\log\left(\frac{d\,(1 + N_{i,t})^{1/2}}{\delta}\right)\right)} .ci,t​=Ni,t2​1+Ni,t​​(1+2log(δd(1+Ni,t​)1/2​))​.

Then for every δ>0\delta > 0δ>0, with probability at least 1−δ1 - \delta1−δ,

∣X‾i,t−μi∣≤ci,tfor all arms i and all t≥0 with Ni,t≥1.|\overline X_{i,t} - \mu_i| \le c_{i,t} \qquad \text{for all arms } i \text{ and all } t \ge 0 \text{ with } N_{i,t} \ge 1 .∣Xi,t​−μi​∣≤ci,t​for all arms i and all t≥0 with Ni,t​≥1.

The event is uniform in time: a single event of probability at least 1−δ1-\delta1−δ carries all the intervals simultaneously. This is what allows the UCB(δ\deltaδ) algorithm to use widths that depend neither on the horizon nor on the current time.

Formalization Note The statement bounds the outer probability of the failure event "∣X‾i,t−μi∣>ci,t|\overline X_{i,t} - \mu_i| > c_{i,t}∣Xi,t​−μi​∣>ci,t​ for some iii and some ttt with Ni,t≥1N_{i,t} \ge 1Ni,t​≥1" by δ\deltaδ. For Ni,t=0N_{i,t} = 0Ni,t​=0 the paper's width is +∞+\infty+∞ and the inequality is vacuous; Lean's division by zero would give 000 on both sides, so that case is excluded explicitly. The noise is conditioned on Ft−1\mathcal F_{t-1}Ft−1​, the filtration form of Theorem 1, which is more general than conditioning on I1:t,η1:t−1I_{1:t}, \eta_{1:t-1}I1:t​,η1:t−1​. The hypothesis that Ω\OmegaΩ is a standard Borel space is added so that Mathlib's conditional sub-Gaussianity (through the conditional distribution kernel) is available; it is not in the paper.

Preamble
import Mathlib
import Definitions.Def_ImprovedLinBandits_UCBDelta_armModel

open MeasureTheory ProbabilityTheory
Formal statement
namespace ImprovedLinBandits.UCBDelta

/-- **Lemma 6** (Confidence Intervals; Abbasi-Yadkori, Pál, Szepesvári, NIPS 2011, p. 7). Arms
`Fin d` have means `μ`; round `t + 1` plays the `ℱ_t`-measurable arm `I (t + 1)` and receives
`μ (I (t + 1)) + η (t + 1)`, where `η (t + 1)` is `ℱ_{t+1}`-measurable and conditionally
1-sub-Gaussian given `ℱ_t`. Then for every `δ > 0`, the (outer) probability that
`|X̄_{i,t} - μ_i| > c_{i,t}` for some arm `i` and some `t ≥ 0` is at most `δ`.
The case `N_{i,t} = 0`, where the paper's `c_{i,t} = +∞` makes the claim vacuous, is excluded
explicitly. The arm sequence is arbitrary (not necessarily UCB(δ)). `StandardBorelSpace Ω` is
added so that Mathlib's conditional sub-Gaussianity is available. -/
theorem confidence_intervals
    {Ω : Type} {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω]
    {P : Measure Ω} [IsProbabilityMeasure P]
    {d : ℕ} (ℱ : Filtration ℕ mΩ)
    (μ : Fin d → ℝ) (I : ℕ → Ω → Fin d) (η : ℕ → Ω → ℝ)
    (hI : ∀ t : ℕ, Measurable[ℱ t] (I (t + 1)))
    (hη : ∀ t : ℕ, Measurable[ℱ (t + 1)] (η (t + 1)))
    (hsg : ∀ t : ℕ, HasCondSubgaussianMGF (ℱ t) (ℱ.le t) (η (t + 1)) 1 P)
    {δ : ℝ} (hδ : 0 < δ) :
    P {ω | ∃ (i : Fin d) (t : ℕ), 0 < pullCount I i t ω ∧
        confRadius d δ (pullCount I i t ω) < |empMean μ η I i t ω - μ i|}
      ≤ ENNReal.ofReal δ := by sorry

end ImprovedLinBandits.UCBDelta
Source
Abbasi-Yadkori, Pál, Szepesvári, Improved Algorithms for Linear Stochastic Bandits, NIPS 2011, p. 7, Lemma 6 and eq. (3)
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