LeanMachineLearning

Bandits.UCB.gap_le_two_mul_ucbWidth🔗

Lemma

From the authors

If the means of the best arm and of arm b lie in their confidence intervals and the UCB index of b is at least that of the best arm, then the gap of b is at most twice its confidence width.

Types
  • Ω : Type u_1
Given
  • K : NeZero K
  • c :
  • ν : ProbabilityTheory.Kernel (Fin K) A kernel from a measurable space α to another measurable space β is a measurable function κ : α → Measure β.
  • A : → Ω → Fin K
  • R : → Ω →
  • n :
  • ω : Ω
  • b : Fin K
Assuming
  • h_best : (x : ), id xν (bestArm ν)Learning.empMean A R (bestArm ν) n ω + ucbWidth A c (bestArm ν) n ω
  • h_arm : Learning.empMean A R b n ω - ucbWidth A c b n ω (x : ), id xν b
  • h_le : Learning.empMean A R (bestArm ν) n ω + ucbWidth A c (bestArm ν) n ωLearning.empMean A R b n ω + ucbWidth A c b n ω
Then
gap ν b2 * ucbWidth A c b n ω
Code
lemma gap_le_two_mul_ucbWidth {b : Fin K}
    (h_best : (ν (bestArm ν))[id] ≤ empMean A R (bestArm ν) n ω + ucbWidth A c (bestArm ν) n ω)
    (h_arm : empMean A R b n ω - ucbWidth A c b n ω ≤ (ν b)[id])
    (h_le : empMean A R (bestArm ν) n ω + ucbWidth A c (bestArm ν) n ω ≤
      empMean A R b n ω + ucbWidth A c b n ω) :
    gap ν b ≤ 2 * ucbWidth A c b n ω
Proof
by
  rw [gap_eq_bestArm_sub, sub_le_iff_le_add']
  calc (ν (bestArm ν))[id]
  _ ≤ empMean A R (bestArm ν) n ω + ucbWidth A c (bestArm ν) n ω := h_best
  _ ≤ empMean A R b n ω + ucbWidth A c b n ω := h_le
  _ ≤ (ν b)[id] + 2 * ucbWidth A c b n ω := by
    rw [two_mul, ← add_assoc]
    gcongr
    rwa [sub_le_iff_le_add] at h_arm

New in v4.34.0-rc2-90-gdde3322 (2026-09-16), and its meaning has not changed since.

Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file · open it in the Lean web editor.

Dependency graph

Audit surface: 6 project declarations, 90 external constants

✓ Proved: no sorry anywhere in its closure

This is the tool's own reading of one build's recorded axioms, and it is not robust against an author who wants it to pass. Checking meant to be relied on should go through Comparator, which replays the proof through the kernel from an export against an explicit list of permitted axioms.