Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Example 8.1, p. 79 — if x₁ = 2 for all p₀ > 0, then x_t = 2 for all t and 𝔼[Regret(T)] = T·(1 − p₀)/4

Proved
TSTutorial.KnownStandard.case_first_action_two

by mikedeng1 · Oct 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

bayesian-regretmulti-armed-banditp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1thompson-sampling

Consider the known-standard problem of Example 8.1: two actions, θ∼Bernoulli(p0)\theta\sim\mathrm{Bernoulli}(p_0)θ∼Bernoulli(p0​), action 111 paying Bernoulli(1/2)\mathrm{Bernoulli}(1/2)Bernoulli(1/2), action 222 paying Bernoulli(3/4)\mathrm{Bernoulli}(3/4)Bernoulli(3/4) if θ=1\theta=1θ=1 and Bernoulli(1/4)\mathrm{Bernoulli}(1/4)Bernoulli(1/4) if θ=0\theta=0θ=0. Let fff be a stationary deterministic strategy, xt=f(pt−1)x_t=f(p_{t-1})xt​=f(pt−1​), where pt−1p_{t-1}pt−1​ is the posterior probability that θ=1\theta=1θ=1 given Ht−1\mathbb H_{t-1}Ht−1​.

Suppose that f(p)=2f(p)=2f(p)=2 for every p∈(0,1]p\in(0,1]p∈(0,1], i.e. the strategy selects x1=2x_1=2x1​=2 for every prior p0>0p_0>0p0​>0. Then for every prior p0∈(0,1]p_0\in(0,1]p0​∈(0,1] and every horizon TTT:

  1. on every history HT\mathbb H_THT​ of positive probability, xt=2x_t=2xt​=2 for every t=1,…,Tt=1,\dots,Tt=1,…,T;
  2. the expected cumulative regret is exactly
E[Regret(T)]=1−p04 T.\mathbb E[\mathrm{Regret}(T)]=\frac{1-p_0}{4}\,T .E[Regret(T)]=41−p0​​T.

The posterior stays in (0,1](0,1](0,1], so the strategy keeps playing action 222, which loses 1/2−1/4=1/41/2-1/4=1/41/2−1/4=1/4 per period when θ=0\theta=0θ=0. This is the second case of the argument of Example 8.1; for p0<1p_0<1p0​<1 the regret grows linearly in TTT.

Formalization Note Paper actions 1,21,21,2 are Lean 0, 1 : Fin 2. "For all p0>0p_0>0p0​>0" is read as for all p0∈(0,1]p_0\in(0,1]p0​∈(0,1], the values a prior probability can take. "A history of positive probability" is ∑θprior(θ) Pθ(HT=h)>0\sum_\theta \mathrm{prior}(\theta)\,\mathbb P_\theta(\mathbb H_T=h)>0∑θ​prior(θ)Pθ​(HT​=h)>0.

Preamble
import Mathlib
import Definitions.Def_TSTutorial_KnownStandard_Setting
Formal statement
namespace TSTutorial.KnownStandard
theorem case_first_action_two (f : Strategy) (hf : ∀ p : ℝ, 0 < p → p ≤ 1 → f p = 1)
    (p₀ : ℝ) (hp₀ : 0 < p₀) (hp₁ : p₀ ≤ 1) (T : ℕ) :
    (∀ h : Hist T, 0 < ∑ θ : Bool, prior p₀ θ * lawGiven f p₀ T θ h →
      ∀ s : Fin T, (h s).1 = 1) ∧
    expRegret f p₀ T = T * ((1 - p₀) / 4) := by sorry
end TSTutorial.KnownStandard
Source
Russo, Van Roy, Kazerouni, Osband, Wen, A Tutorial on Thompson Sampling, Found. Trends Mach. Learn. 11(1) (2018), p. 79, §8.1.3, Example 8.1 (second paragraph, fifth sentence)
Human review
  • Endorsed by Shuze Chen · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 8, 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