Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Prevailing-charge terminal retirement potential

Definition
GittinsTerminalPotential

by Harry_Xu · Aug 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

banditsgittins-indexoptimal-stoppingprobability

Consider a finite-armed rested Markov bandit. After a finite history, the prevailing charge of arm iii is the least Gittins index exposed for that arm so far. If v(y,γ)v(y,\gamma)v(y,γ) is the single-arm retirement value at state yyy and charge γ\gammaγ, define the terminal retirement potential by

Wn=∑i=1kv ⁣(Si(n),g‾i(n)),Unπ=Eπ[Wn].W_n=\sum_{i=1}^k v\!\left(S_i(n),\underline g_i(n)\right), \qquad U_n^\pi=\mathbb E_\pi[W_n].Wn​=i=1∑k​v(Si​(n),g​i​(n)),Unπ​=Eπ​[Wn​].

This module supplies the finite-history truncation, the prevailing charge, and the pathwise and expected terminal potentials used in the finite-horizon accounting step of the Gittins-index proof.

Formalization Note Histories are indexed from zero, and markovBanditExpectedRetirementPotential is the integral of the sum of armwise retirement values under the platform's finite-horizon bandit law.

Definition code
import Definitions.Def_GittinsFiniteRetirementValue
import Definitions.Def_GittinsIndex

open MeasureTheory ProbabilityTheory ENNReal

namespace BanditAlgorithm

/-- Forget the most recently completed bandit round while retaining the state
vector observed at the start of that round. -/
def truncateMarkovBanditHistory
    {k n : ℕ} {S : Type*} :
    MarkovBanditHistory k S (n + 1) → MarkovBanditHistory k S n :=
  fun h ↦ (Fin.init h.1, (h.1 (Fin.last n)).1)

/-- The least Gittins charge exposed for an arm by the end of a finite
history.  This is the prevailing charge in the proof of the index theorem. -/
noncomputable def currentHistoryPrevailingCharge
    {k : ℕ} {S : Type*} (g : S → ℝ) :
    (n : ℕ) → MarkovBanditHistory k S n → Fin k → ℝ
  | 0, h, i => g (h.2 i)
  | n + 1, h, i =>
      min
        (currentHistoryPrevailingCharge g n
          (truncateMarkovBanditHistory h) i)
        (g (h.2 i))

/-- Sum of the single-arm retirement values at the prevailing charges visible
after a finite bandit history. -/
noncomputable def currentGittinsRetirementPotential
    {k n : ℕ} {S : Type*} [MeasurableSpace S]
    (P : Kernel S S) [IsMarkovKernel P]
    (r : S → ℝ) (α : ℝ)
    (h : MarkovBanditHistory k S n) : ℝ :=
  ∑ i : Fin k,
    gittinsRetirementValue P r α
      (currentHistoryPrevailingCharge
        (gittinsIndex P r α) n h i)
      (h.2 i)

/-- Expected terminal retirement potential after `n` rounds under a bandit
policy. -/
noncomputable def markovBanditExpectedRetirementPotential
    {k : ℕ} {S : Type*} [MeasurableSpace S]
    (P : Kernel S S) [IsMarkovKernel P]
    (r : S → ℝ) (α : ℝ)
    (π : MarkovBanditPolicy k S) (x : Fin k → S)
    (n : ℕ) : ℝ :=
  ∫ h, currentGittinsRetirementPotential P r α h
    ∂markovBanditMeasure P π x n

end BanditAlgorithm
Source
Tor Lattimore and Csaba Szepesvári, Bandit Algorithms (free online edition), https://tor-lattimore.com/downloads/book/book.pdf, §35.4, proof of Theorem 35.9, Part 1 “Prevailing Charge”, printed pp. 451–452 / PDF pp. 459–460, especially the definition of the prevailing charge and the retirement-value accounting identity.

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