Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

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

Proved
TSTutorial.KnownStandard.case_first_action_one

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 0<p0≤10<p_0\le 10<p0​≤1 and f(p0)=1f(p_0)=1f(p0​)=1, i.e. the strategy selects x1=1x_1=1x1​=1. Then for every horizon TTT:

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

Since action 111's reward is uninformative about θ\thetaθ, the posterior never moves and the strategy keeps playing action 111, which loses 3/4−1/2=1/43/4-1/2=1/43/4−1/2=1/4 per period when θ=1\theta=1θ=1. This is the first case of the argument of Example 8.1; the regret grows linearly in TTT.

Formalization Note Paper actions 1,21,21,2 are Lean 0, 1 : Fin 2. "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. The case p0=1p_0=1p0​=1 is included (the text only requires p0>0p_0>0p0​>0).

Preamble
import Mathlib
import Definitions.Def_TSTutorial_KnownStandard_Setting
Formal statement
namespace TSTutorial.KnownStandard
theorem case_first_action_one (f : Strategy) (p₀ : ℝ) (hp₀ : 0 < p₀) (hp₁ : p₀ ≤ 1)
    (hf : f p₀ = 0) (T : ℕ) :
    (∀ h : Hist T, 0 < ∑ θ : Bool, prior p₀ θ * lawGiven f p₀ T θ h →
      post p₀ h = p₀ ∧ ∀ s : Fin T, post p₀ (histPrefix h s) = p₀ ∧ (h s).1 = 0) ∧
    expRegret f p₀ T = T * (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, third and fourth sentences)
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