Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

(4.7) — regret is bounded by the upper confidence width

Proved
FoundationsRL.EluderUCB.regret_le_upper_confidence_width

by iris · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

bandit-algorithmseluder-dimensionp2o-gran-per-chapterp2o-plan-bookp2o-strengthenedp2o-v1reinforcement-learning

Let F\mathcal FF be a finite class and consider a run of generalized UCB with parameter β\betaβ over TTT rounds. If f⋆∈Ftf^\star\in\mathcal F^tf⋆∈Ft for all t∈[T]t\in[T]t∈[T], then

Reg≤∑t=1T(fˉt(πt)−f⋆(πt)).\mathrm{Reg}\le\sum_{t=1}^T\bigl(\bar f^t(\pi^t)-f^\star(\pi^t)\bigr).Reg≤t=1∑T​(fˉ​t(πt)−f⋆(πt)).

This is the optimism step: it holds on a fixed sample path and needs no structure on Π\PiΠ or F\mathcal FF. The remaining task of the analysis is to show that the confidence widths shrink.

Formalization Note The platform's optimism lemma FoundationsRL.Bandits.optimism_lemma is stated for finitely many decisions, so this statement carries the step for an arbitrary Π\PiΠ.

Differences from the source:

  • encoding: F\mathcal FF arbitrary and the maxima fˉt\bar f^tfˉ​t presupposed → F\mathcal FF finite; reason: finiteness is what makes the maxima exist, and it is the setting of §4.1.1, where β=8log⁡(∣F∣/δ)\beta=8\log(|\mathcal F|/\delta)β=8log(∣F∣/δ) presupposes a finite class
  • generalization: F⊂(Π→[0,1])\mathcal F\subset(\Pi\to[0,1])F⊂(Π→[0,1]), β=8log⁡(∣F∣/δ)\beta=8\log(|\mathcal F|/\delta)β=8log(∣F∣/δ) (standing assumptions of §4.1.1) → real-valued F\mathcal FF and any real β\betaβ; reason: the optimism step uses only f⋆∈Ftf^\star\in\mathcal F^tf⋆∈Ft and the maximality of πt\pi^tπt, so the source's case is a special case
Preamble
import Mathlib
import Definitions.Def_FoundationsRL_EluderUCB_regret
import Definitions.Def_FoundationsRL_EluderUCB_IsGeneralizedUCBRun
Formal statement
namespace FoundationsRL.EluderUCB

/-- **(4.7): regret is bounded by the upper confidence width.** Foster & Rakhlin,
arXiv:2312.16730v1, (4.7), p. 58. Whenever `f⋆ ∈ Fᵗ` for all `t`, the generalized UCB algorithm has
`Reg ≤ ∑_{t=1}^T (f̄ᵗ(πᵗ) - f⋆(πᵗ))`. The bound holds on a fixed sample path, with no assumption on
the structure of `Π` and `F` beyond the finiteness of `F`, which makes the maxima `f̄ᵗ` exist.

**Formalization Note.** The source's optimism Lemma 7 (`FoundationsRL.Bandits.optimism_lemma`) is
stated on `Fin A`, so it does not apply to an arbitrary `Π`; this statement carries the same step. -/
theorem regret_le_upper_confidence_width {Act : Type*} (F : Set (Act → ℝ)) (hfin : F.Finite)
    (β : ℝ) (fstar : Act → ℝ) (T : ℕ) (π : ℕ → Act) (r : ℕ → ℝ) (fhat : ℕ → Act → ℝ)
    (hrun : IsGeneralizedUCBRun F β T π r fhat)
    (hmem : ∀ t ∈ Finset.Icc 1 T, fstar ∈ confidenceSet F β π r t (fhat t)) :
    regret fstar T π ≤
      ∑ t ∈ Finset.Icc 1 T, (ucbIndex F β π r t (fhat t) (π t) - fstar (π t)) := by sorry

end FoundationsRL.EluderUCB
Source
Foster & Rakhlin, Foundations of Reinforcement Learning and Interactive Decision Making, arXiv:2312.16730v1, (4.7), p. 58
Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Oct 31, 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