Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

BanditAlgorithm.adversarial_bandit_exp3ix_high_probability_regret_tuned

Proved

by Shuze Chen · Jul 17, 2026 · Mathlib c5ea003 (Lean v4.30.0)

adversarialbanditsexp3-ixhigh-probability

(Exp3-IX high-probability bound, learning rate tuned to δ\deltaδ) Let x∈[0,1]n×kx \in [0,1]^{n\times k}x∈[0,1]n×k (with k>1k > 1k>1, n≥1n \ge 1n≥1) and δ∈(0,1)\delta \in (0,1)δ∈(0,1). If Exp3-IX is run with η=η2=(log⁡k+log⁡k+1δ)/(nk)\eta = \eta_2 = \sqrt{(\log k + \log\frac{k+1}{\delta})/(nk)}η=η2​=(logk+logδk+1​)/(nk)​ and γ=η/2\gamma = \eta/2γ=η/2, then the random regret satisfies (Eq. 12.6)

P(R^n≥2(2log⁡(k+1)+log⁡1δ) nk+log⁡k+1δ)≤δ,\mathbb{P}\left(\hat R_n \ge 2\sqrt{\Big(2\log(k+1) + \log\tfrac{1}{\delta}\Big)\,nk} + \log\frac{k+1}{\delta}\right) \le \delta,P(R^n​≥2(2log(k+1)+logδ1​)nk​+logδk+1​)≤δ,

stated as a bound on the adversarialMeasure of the bad set of histories.

Preamble
import Definitions.Def_AdversarialBandit
import Definitions.Def_exp3Policy


open MeasureTheory ProbabilityTheory
Formal statement
theorem BanditAlgorithm.adversarial_bandit_exp3ix_high_probability_regret_tuned
    {k : ℕ} (hk : 1 < k) (n : ℕ) (hn : 0 < n)
    (x : ℕ → Fin k → ℝ) (hx : ∀ t : ℕ, ∀ i : Fin k, x t i ∈ Set.Icc (0 : ℝ) 1)
    (δ : ℝ) (hδ : δ ∈ Set.Ioo (0 : ℝ) 1)
    (η : ℝ)
    (hη : η = Real.sqrt ((Real.log k + Real.log ((k + 1) / δ)) / (n * k)))
    (π : BanditPolicy k) (hπ : IsExp3IXPolicy η (η / 2) π) :
    adversarialMeasure x π n
      {h : BanditHistory k n |
        2 * Real.sqrt ((2 * Real.log (k + 1) + Real.log (1 / δ)) * (n * k)) +
          Real.log ((k + 1) / δ) ≤ adversarialRandomRegret n x h} ≤
      ENNReal.ofReal δ := by
  sorry
Source
L&S Theorem 12.1(2), Eq. (12.6), p.167
Read-back

What the Lean code literally says, in plain math · claude-fable-5

Setup (all notions unfolded from the underlying definitions). Fix an arm count kkk and write [k]={0,…,k−1}[k]=\{0,\dots,k-1\}[k]={0,…,k−1}. A history of length mmm is a sequence of pairs (at,rt)∈[k]×R(a_t, r_t) \in [k]\times\mathbb{R}(at​,rt​)∈[k]×R, t<mt < mt<m; a policy π\piπ gives, for each mmm and each length-mmm history hhh, a probability measure πm(h)\pi_m(h)πm​(h) on [k][k][k], measurably in hhh. Given a reward table x=(xt(i))t∈N, i∈[k]x = (x_t(i))_{t\in\mathbb{N},\,i\in[k]}x=(xt​(i))t∈N,i∈[k]​ of reals, the nnn-round adversarial law Px,πn\mathbb{P}^n_{x,\pi}Px,πn​ on length-nnn histories is defined recursively: P0\mathbb{P}^0P0 is the point mass at the empty history, and Pm+1\mathbb{P}^{m+1}Pm+1 is the law of hhh extended by the pair (A, xm(A))(A,\, x_m(A))(A,xm​(A)), where h∼Pmh \sim \mathbb{P}^mh∼Pm and A∼πm(h)A \sim \pi_m(h)A∼πm​(h) — the reward recorded at round mmm is deterministically xm(A)x_m(A)xm​(A).

For real parameters η,γ\eta, \gammaη,γ, the Exp3-IX estimates and probabilities are defined by the joint recursion T^0≡0\hat T_0 \equiv 0T^0​≡0 and

Qm(h)(i)=exp⁡ ⁣(−η T^m(h)(i))∑j∈[k]exp⁡ ⁣(−η T^m(h)(j)),T^m+1(h)(i)=T^m(h′)(i)+1{a=i} 1−rQm(h′)(i)+γ,Q_m(h)(i) = \frac{\exp\!\big(-\eta\,\hat T_m(h)(i)\big)}{\sum_{j\in[k]}\exp\!\big(-\eta\,\hat T_m(h)(j)\big)}, \qquad \hat T_{m+1}(h)(i) = \hat T_m(h')(i) + \mathbf 1\{a=i\}\,\frac{1-r}{Q_m(h')(i)+\gamma},Qm​(h)(i)=∑j∈[k]​exp(−ηT^m​(h)(j))exp(−ηT^m​(h)(i))​,T^m+1​(h)(i)=T^m​(h′)(i)+1{a=i}Qm​(h′)(i)+γ1−r​,

where h′h'h′ is the length-mmm prefix of hhh and (a,r)(a,r)(a,r) its last entry (only the played arm's coordinate is incremented, by the γ\gammaγ-shifted importance-weighted quantity 1−r1-r1−r; the softmax uses the negated scaled estimates). "π\piπ is an Exp3-IX(η,γ\eta,\gammaη,γ) policy" means: πm(h)=∑i∈[k]Qm(h)(i) δi\pi_m(h) = \sum_{i\in[k]} Q_m(h)(i)\,\delta_iπm​(h)=∑i∈[k]​Qm​(h)(i)δi​ for every m∈Nm \in \mathbb{N}m∈N and every length-mmm history hhh (reachable or not), the nonnegative weights being read into [0,∞][0,\infty][0,∞].

The pathwise regret of a length-nnn history hhh with recorded rewards r0,…,rn−1r_0,\dots,r_{n-1}r0​,…,rn−1​ is

Rn(x,h)  =  (max⁡i∈[k]∑t=0n−1xt(i))  −  ∑t=0n−1rtR_n(x,h) \;=\; \Big(\max_{i\in[k]} \sum_{t=0}^{n-1} x_t(i)\Big) \;-\; \sum_{t=0}^{n-1} r_tRn​(x,h)=(i∈[k]max​t=0∑n−1​xt​(i))−t=0∑n−1​rt​

(the first term is a real-valued supremum over the finite arm set, a genuine maximum since k≥2k \ge 2k≥2 under the hypotheses below; the second is the sum of the rewards recorded in hhh).

Assertion. With the confidence-dependent learning rate η=log⁡k+log⁡k+1δn k\eta = \sqrt{\dfrac{\log k + \log\frac{k+1}{\delta}}{n\,k}}η=nklogk+logδk+1​​​ and γ=η/2\gamma = \eta/2γ=η/2, the theorem claims that the Px,πn\mathbb{P}^n_{x,\pi}Px,πn​-probability of the set of length-nnn histories hhh satisfying

2 (2log⁡(k+1)+log⁡1δ)⋅n k  +  log⁡k+1δ  ≤  Rn(x,h)2\,\sqrt{\Big(2\log(k+1) + \log\tfrac{1}{\delta}\Big)\cdot n\,k} \;+\; \log\frac{k+1}{\delta} \;\le\; R_n(x,h)2(2log(k+1)+logδ1​)⋅nk​+logδk+1​≤Rn​(x,h)

is at most δ\deltaδ:

Px,πn({h  :  2(2log⁡(k+1)+log⁡1δ) nk+log⁡k+1δ ≤ Rn(x,h)})  ≤  δ.\mathbb{P}^n_{x,\pi}\Big(\Big\{h \;:\; 2\sqrt{\big(2\log(k+1)+\log\tfrac1\delta\big)\,nk} + \log\tfrac{k+1}{\delta} \,\le\, R_n(x,h)\Big\}\Big) \;\le\; \delta .Px,πn​({h:2(2log(k+1)+logδ1​)nk​+logδk+1​≤Rn​(x,h)})≤δ.

Hypotheses:

  • k∈Nk \in \mathbb{N}k∈N with 1<k1 < k1<k; n∈Nn \in \mathbb{N}n∈N with 0<n0 < n0<n.
  • xt(i)∈[0,1]x_t(i) \in [0,1]xt​(i)∈[0,1] (closed interval) for every round t∈Nt \in \mathbb{N}t∈N — not only t<nt < nt<n — and every arm i∈[k]i \in [k]i∈[k].
  • δ∈(0,1)\delta \in (0,1)δ∈(0,1) (open interval at both ends).
  • η\etaη is equal (by hypothesis) to (log⁡k+log⁡((k+1)/δ))/(nk)\sqrt{\big(\log k + \log((k+1)/\delta)\big)/(nk)}(logk+log((k+1)/δ))/(nk)​ — note this tuning depends on δ\deltaδ, unlike the untuned sibling theorem.
  • π\piπ is any policy satisfying the Exp3-IX(η\etaη, η/2\eta/2η/2) predicate.

Edge cases and caveats:

  • The probability on the left is a value in [0,∞][0,\infty][0,∞]; the right-hand side is the embedding of the real δ\deltaδ into [0,∞][0,\infty][0,∞] (no truncation, since 0<δ0 < \delta0<δ).
  • The event uses a non-strict inequality: histories whose pathwise regret is at least the threshold; histories with regret exactly equal to the threshold are included.
  • k+1k+1k+1 inside the logarithms is the real number k+1k+1k+1 (cast of the natural kkk, plus one); since k≥2k \ge 2k≥2 and 0<δ<10<\delta<10<δ<1, all logarithms appearing (log⁡(k+1)\log(k+1)log(k+1), log⁡(1/δ)\log(1/\delta)log(1/δ), log⁡((k+1)/δ)\log((k+1)/\delta)log((k+1)/δ), log⁡k\log klogk) are positive, and ⋅\sqrt{\cdot}⋅​ (the real square root, 000 on negatives) is applied to positive quantities.
  • δ\deltaδ ranges over the open interval: δ=0\delta = 0δ=0 and δ=1\delta = 1δ=1 are excluded.
  • Both the learning rate η\etaη and the exploration shift γ=η/2\gamma = \eta/2γ=η/2 are pinned exactly; nothing is claimed for other tunings.
  • The Exp3-IX predicate constrains π\piπ at every history of every length, including unreachable ones; the theorem is universally quantified over policies satisfying it and does not itself assert existence of one.
  • The pathwise regret evaluates the rewards recorded in the history (which under Px,πn\mathbb{P}^n_{x,\pi}Px,πn​ almost surely equal xt(At)x_t(A_t)xt​(At​)), and compares against the best single arm in hindsight.
Human review
  • Endorsed by Community (Bot) · Jul 18, 2026

  • Endorsed by Shuze Chen · Jul 18, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me