Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 2, Eqs. (6), (8) and M₁ — staying on heads and switching on tails loses at most 3 − 2^{3/2} per toss in the long run

Proved
RobbinsSeqDesign.StayOrSwitch.stay_or_switch_asymptotic_loss_le

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

bandit-algorithmsp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1sequential-design

Let coins AAA and BBB have head probabilities α,β∈[0,1]\alpha,\beta\in[0,1]α,β∈[0,1], not both 000 and not both 111, put γ=(α+β)/2\gamma = (\alpha+\beta)/2γ=(α+β)/2, δ=∣α−β∣/2\delta = |\alpha-\beta|/2δ=∣α−β∣/2, and let SnS_nSn​ be the total payoff of the first nnn tosses under the rule R1R_1R1​: toss a fairly chosen coin first, then keep the coin after a head and switch to the other coin after a tail. Then

  1. lim⁡n→∞E ⁣(Snn)=γ+δ21−γ\displaystyle\lim_{n\to\infty}\mathrm E\!\left(\frac{S_n}{n}\right) = \gamma+\frac{\delta^2}{1-\gamma}n→∞lim​E(nSn​​)=γ+1−γδ2​;
  2. the loss per toss relative to always tossing the better coin converges to the asymptotic loss
L(A,B,R1)=lim⁡n→∞[max⁡(α,β)−E ⁣(Snn)]=δ[1−δ1−γ];L(A,B,R_1) = \lim_{n\to\infty}\left[\max(\alpha,\beta)-\mathrm E\!\left(\frac{S_n}{n}\right)\right] = \delta\left[1-\frac{\delta}{1-\gamma}\right];L(A,B,R1​)=n→∞lim​[max(α,β)−E(nSn​​)]=δ[1−1−γδ​];
  1. 0≤L(A,B,R1)≤M1=3−23/20 \le L(A,B,R_1) \le M_1 = 3-2^{3/2}0≤L(A,B,R1​)≤M1​=3−23/2;
  2. L(A,B,R1)=M1L(A,B,R_1) = M_1L(A,B,R1​)=M1​ when α=0\alpha = 0α=0, β=2−21/2\beta = 2-2^{1/2}β=2−21/2, and when α=2−21/2\alpha = 2-2^{1/2}α=2−21/2, β=0\beta = 0β=0.

So a person who uses R1R_1R1​ loses in the long run at most 3−23/2≈0.1723-2^{3/2}\approx 0.1723−23/2≈0.172 per toss, whatever the coins, against 1/21/21/2 for a rule that ignores the outcomes.

Formalization Note The asymptotic loss is stated as the limit of max⁡(α,β)−E(Sn/n)\max(\alpha,\beta) - \mathrm E(S_n/n)max(α,β)−E(Sn​/n), not defined by its closed form. 23/22^{3/2}23/2 is written 2 * Real.sqrt 2. The head probabilities are elements of unitInterval; the attainment clause quantifies over the elements of unitInterval with the stated real values (2−2∈[0,1]2-\sqrt2\in[0,1]2−2​∈[0,1], so it is not vacuous).

Preamble
import Mathlib
import Definitions.Def_RobbinsSeqDesign_StayOrSwitch_Rules

open MeasureTheory ProbabilityTheory Filter Topology
Formal statement
namespace RobbinsSeqDesign.StayOrSwitch

/-- Section 2, Eqs. (6), (8) and the maximum `M₁`, p. 531 (goal). For coins with head
probabilities `0 ≤ α, β ≤ 1`, not both `0` and not both `1`, under rule `R₁`:
`lim E(S_n/n) = γ + δ²/(1 − γ)`, the loss per toss `max(α, β) − E(S_n/n)` tends to
`L(A, B, R₁) = δ[1 − δ/(1 − γ)]`, and `0 ≤ L(A, B, R₁) ≤ M₁ = 3 − 2^{3/2}`, with
`L(A, B, R₁) = M₁` at `α = 0, β = 2 − 2^{1/2}` and at `α = 2 − 2^{1/2}, β = 0`. -/
theorem stay_or_switch_asymptotic_loss_le :
    (∀ α β : unitInterval, ¬((α : ℝ) = 0 ∧ (β : ℝ) = 0) → ¬((α : ℝ) = 1 ∧ (β : ℝ) = 1) →
        Tendsto (fun n => expectedAverage ruleR1 α β n) atTop
            (𝓝 (gamma α β + delta α β ^ 2 / (1 - gamma α β))) ∧
          Tendsto (fun n => max (α : ℝ) β - expectedAverage ruleR1 α β n) atTop
            (𝓝 (delta α β * (1 - delta α β / (1 - gamma α β)))) ∧
          0 ≤ delta α β * (1 - delta α β / (1 - gamma α β)) ∧
          delta α β * (1 - delta α β / (1 - gamma α β)) ≤ 3 - 2 * Real.sqrt 2) ∧
      (∀ α β : unitInterval,
        ((α : ℝ) = 0 ∧ (β : ℝ) = 2 - Real.sqrt 2) ∨ ((α : ℝ) = 2 - Real.sqrt 2 ∧ (β : ℝ) = 0) →
          Tendsto (fun n => max (α : ℝ) β - expectedAverage ruleR1 α β n) atTop
            (𝓝 (3 - 2 * Real.sqrt 2))) := by sorry

end RobbinsSeqDesign.StayOrSwitch
Source
Robbins, Some aspects of the sequential design of experiments, Bull. Amer. Math. Soc. 58 (1952), p. 531, Section 2, Eqs. (6), (8) and the maximum M₁
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

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