Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Almost-sure prevailing-charge interleaving certificates

Proved
BanditAlgorithm.gittins_ae_discounted_value_interleaving_certificates

by Harry_Xu · Jul 31, 2026 · Mathlib 0df444a (Lean v4.33.1)

banditsgittins-indexinterleavingoptimal-stoppingreward-stack

Consider a discounted rested Markov bandit with finitely many arms, common transition kernel PPP, measurable reward rrr, discount factor 0<α<10<\alpha<10<α<1, and initial state vector xxx. Assume discounted absolute rewards are integrable and that every single-arm Gittins index admits arbitrarily accurate stopping-time calibration. Let π⋆\pi^\starπ⋆ always select an arm of maximal current Gittins index, and let π\piπ be any competing policy.

There is a common probability-space measure carrying the policy-independent Markov state stacks and action interleavings of both policies such that, for every ε>0\varepsilon>0ε>0, one can construct random finite lists XXX and YYY satisfying almost surely

X∼permY,Y1≥Y2≥⋯ ,X\sim_{\mathrm{perm}}Y,\qquad Y_1\ge Y_2\ge\cdots,X∼perm​Y,Y1​≥Y2​≥⋯,

and whose discounted folds obey

Vα(π,x)≤E[Fold⁡α(X)]+ε,E[Fold⁡α(Y)]≤Vα(π⋆,x)+ε.V_\alpha(\pi,x)\le \mathbb E[\operatorname{Fold}_\alpha(X)]+\varepsilon,\qquad \mathbb E[\operatorname{Fold}_\alpha(Y)]\le V_\alpha(\pi^\star,x)+\varepsilon.Vα​(π,x)≤E[Foldα​(X)]+ε,E[Foldα​(Y)]≤Vα​(π⋆,x)+ε.

These are the finite almost-sure certificates in the prevailing-charge proof: XXX is the competing interleaving of decreasing arm stacks, while YYY is the greedy nonincreasing interleaving on the same sample point. The statement isolates the model-specific reward-stack coupling needed by the reusable probabilistic Hardy--Littlewood limit theorem.

Formalization Note The common sample type stores the arm trajectories and two action sequences. The theorem existentially supplies its coupling measure. The folds are integrable real random variables, list permutation is pointwise almost surely, and Pairwise (· ≥ ·) expresses nonincreasing order.

Preamble
import Mathlib.MeasureTheory.Constructions.Polish.Basic
import Definitions.Def_GittinsIndex

open MeasureTheory ProbabilityTheory ENNReal
Formal statement
theorem BanditAlgorithm.gittins_ae_discounted_value_interleaving_certificates
    {k : ℕ} {S : Type*} [MeasurableSpace S]
    [StandardBorelSpace S] (P : Kernel S S) [IsMarkovKernel P]
    {r : S → ℝ} (hr : Measurable r)
    {α : ℝ} (hα0 : 0 < α) (hα1 : α < 1)
    (hint : DiscountedRewardIntegrable P r α)
    (hcal : ∀ (y : S) (ε : ℝ), 0 < ε →
      ∃ τ : (ℕ → S) → ℕ∞,
        IsTrajStoppingTime τ ∧ (∀ ω, 1 ≤ τ ω) ∧
        gittinsIndex P r α y - ε <
          (∫ ω, discountedStoppedSum α r τ ω ∂markovChainMeasure P y) /
            (∫ ω, discountedStoppedSum α (fun _ ↦ 1) τ ω
              ∂markovChainMeasure P y))
    (πstar : MarkovBanditPolicy k S)
    (hπ : IsGittinsIndexPolicy P r α πstar)
    (x : Fin k → S) (π : MarkovBanditPolicy k S) :
    ∃ μ : Measure
        ((Fin k → ℕ → S) × ((ℕ → Fin k) × (ℕ → Fin k))),
      ∀ ε : ℝ, 0 < ε →
        ∃ xs ys :
            ((Fin k → ℕ → S) × ((ℕ → Fin k) × (ℕ → Fin k))) →
              List ℝ,
          (∀ᵐ ω ∂μ, (xs ω).Perm (ys ω) ∧
            (ys ω).Pairwise (· ≥ ·)) ∧
          Integrable
            (fun ω ↦ (xs ω).foldr (fun z acc ↦ z + α * acc) 0) μ ∧
          Integrable
            (fun ω ↦ (ys ω).foldr (fun z acc ↦ z + α * acc) 0) μ ∧
          markovBanditDiscountedValue P r α π x ≤
            (∫ ω, (xs ω).foldr (fun z acc ↦ z + α * acc) 0 ∂μ) + ε ∧
          (∫ ω, (ys ω).foldr (fun z acc ↦ z + α * acc) 0 ∂μ) ≤
            markovBanditDiscountedValue P r α πstar x + ε := by
  sorry
Source
Lattimore and Szepesvári, Bandit Algorithms (CUP 2020), proof of Theorem 35.9, Part 1 and Part 2, printed pp. 451–453 / PDF pp. 460–462; finite interleaving inequality Lemma 35.10 on printed p. 451.

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