Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Finite Gaussian posterior-tail bound along realized arm ranks

Proved
BanditAlgorithm.gaussian_ts_exact_rank_tail_sums_bound

by Harry_Xu · Jul 30, 2026 · Mathlib c5ea003 (Lean v4.30.0)

bandit-algorithmsmachine-learningprobabilitythompson-sampling

Consider Gaussian Thompson sampling with unit-variance rewards, an optimal arm i0i_0i0​, and a suboptimal arm iii of gap Δi>0\Delta_i>0Δi​>0. For each interaction history hhh, let Tj(n,h)T_j(n,h)Tj​(n,h) be the number of times arm jjj has actually been pulled by horizon nnn, and let Gj,s(x,h)G_{j,s}(x,h)Gj,s​(x,h) be the posterior probability, after the first sss realized rewards of arm jjj, that its sampled mean is at least xxx. Then there is a universal constant C>0C>0C>0 such that, for every n≥2n\ge 2n≥2,

1+E ⁣[∑s<Ti0(n)(1Gi0,s(μ∗−Δi/2)−1)+]+E ⁣[∑s<Ti(n)1 ⁣{Gi,s(μ∗−Δi/2)>1n}]≤C(1+log⁡nΔi2).1+\mathbb E\!\left[\sum_{s<T_{i_0}(n)}\left(\frac{1}{G_{i_0,s}(\mu_* - \Delta_i/2)}-1\right)_+\right] +\mathbb E\!\left[\sum_{s<T_i(n)}\mathbf 1\!\left\{G_{i,s}(\mu_* - \Delta_i/2)>\frac1n\right\}\right] \le C\left(1+\frac{\log n}{\Delta_i^2}\right).1+E​s<Ti0​​(n)∑​(Gi0​,s​(μ∗​−Δi​/2)1​−1)+​​+E​s<Ti​(n)∑​1{Gi,s​(μ∗​−Δi​/2)>n1​}​≤C(1+Δi2​logn​).

The sums stop at the exact realized pull counts. Consequently every empirical mean appearing in them is formed from an actually observed initial reward segment; no value assigned to a nonexistent future pull enters the estimate. This is the Gaussian tail input needed by the exact-rank Thompson-sampling pull-count decomposition.

Formalization Note The expectations are encoded as lintegrals in R≥0∪{∞}\mathbb R_{\ge0}\cup\{\infty\}R≥0​∪{∞}, and the positive part of the reciprocal-tail term is represented by ENNReal.ofReal.

Preamble
import Definitions.Def_ThompsonSampling
import Definitions.Def_GaussianBandit

open MeasureTheory ProbabilityTheory ENNReal
Formal statement
namespace BanditAlgorithm

/-- Gaussian posterior-tail estimate for the exact realized-rank sums in the
Thompson-sampling pull-count decomposition. -/
theorem gaussian_ts_exact_rank_tail_sums_bound :
    ∃ C : ℝ, 0 < C ∧
      ∀ (k : ℕ) [NeZero k] (μvec : Fin k → ℝ) (π : BanditPolicy k),
        IsGaussianTSPolicy π →
        ∀ (i₀ : Fin k),
          banditArmMean (gaussianBandit μvec) i₀ =
            banditOptimalMean (gaussianBandit μvec) →
        ∀ (i : Fin k), 0 < banditGap (gaussianBandit μvec) i →
        ∀ n : ℕ, 2 ≤ n →
          1 + (∫⁻ h, ∑ s ∈ Finset.range (armPullCount i₀ h),
                ENNReal.ofReal
                  (1 / gaussianTSTailProb i₀ s
                    (banditArmMean (gaussianBandit μvec) i₀ -
                      banditGap (gaussianBandit μvec) i / 2) h - 1)
                ∂banditMeasure (gaussianBandit μvec) π n)
            + ∫⁻ h, ∑ s ∈ Finset.range (armPullCount i h),
                (if 1 / (n : ℝ) <
                    gaussianTSTailProb i s
                      (banditArmMean (gaussianBandit μvec) i₀ -
                        banditGap (gaussianBandit μvec) i / 2) h
                  then (1 : ℝ≥0∞) else 0)
                ∂banditMeasure (gaussianBandit μvec) π n ≤
            ENNReal.ofReal
              (C * (1 + Real.log n /
                banditGap (gaussianBandit μvec) i ^ 2)) := by
  sorry

end BanditAlgorithm
Source
Lattimore and Szepesvári, Bandit Algorithms (2020), Section 36.2, Theorem 36.2 and Eq. (36.3), printed pp. 463–465; Exercise 36.6(a,b), printed p. 475. This theorem is the source-faithful exact-realized-rank version of the two Gaussian tail estimates used in the proof of Theorem 36.3: stopping each sum at the realized pull count only removes nonnegative terms from the reward-stack sums.

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