Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 5 (Confidence) — Pr⁡(∀t, μ∈Bt2)≥1−δ\Pr(\forall t,\ \mu\in B^2_t)\ge1-\deltaPr(∀t, μ∈Bt2​)≥1−δ

Proved
StochLinOpt.UpperBound.confidence

by mikedeng1 · Sep 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

banditslinear-banditsp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1probability

Model. As in Lemma 14: a probability space with a filtration (Ft)(\mathcal F_t)(Ft​); a compact decision set D⊆[−1,1]nD\subseteq[-1,1]^nD⊆[−1,1]n containing e1,…,ene_1,\dots,e_ne1​,…,en​; an unknown mean μ\muμ with ∣μ⊤y∣≤1|\mu^\top y|\le1∣μ⊤y∣≤1 on DDD; 0<δ<10<\delta<10<δ<1; Ft\mathcal F_tFt​-measurable decisions xtx_txt​; Ft+1\mathcal F_{t+1}Ft+1​-measurable losses ℓt∈[−1,1]\ell_t\in[-1,1]ℓt​∈[−1,1] with E[ℓt∣Ft]=μ⊤xt\mathbb E[\ell_t\mid\mathcal F_t]=\mu^\top x_tE[ℓt​∣Ft​]=μ⊤xt​ and ∣ℓt−μ⊤xt∣≤1|\ell_t-\mu^\top x_t|\le1∣ℓt​−μ⊤xt​∣≤1; and (xt)(x_t)(xt​) a run of ConfidenceBall₂(D,δ)(D,\delta)(D,δ) on every outcome. Assume in addition n≤β1=(83ln⁡(1/δ))2n\le\beta_1=\big(\tfrac83\ln(1/\delta)\big)^2n≤β1​=(38​ln(1/δ))2. Then

Pr⁡(∀t≥1, μ∈Bt2)≥1−δ.\Pr\big(\forall t\ge1,\ \mu\in B^2_t\big)\ge1-\delta.Pr(∀t≥1, μ∈Bt2​)≥1−δ.

The confidence ellipsoids of ConfidenceBall₂ contain the true mean at all times simultaneously with probability at least 1−δ1-\delta1−δ; this is the probabilistic half of the upper bound.

Formalization Note The paper states "Let δ>0\delta>0δ>0"; δ<1\delta<1δ<1 is added, as Algorithm 3.1 and Lemma 14 assume. The hypothesis n≤β1n\le\beta_1n≤β1​ is added: the proof asserts "Z1≤n<β1Z_1\le n<\beta_1Z1​≤n<β1​ by the definition of β1\beta_1β1​", which fails for δ\deltaδ close to 111, and Z1=∥μ∥2Z_1=\|\mu\|^2Z1​=∥μ∥2 is deterministic. The hypothesis ∣ℓt−μ⊤xt∣≤1|\ell_t-\mu^\top x_t|\le1∣ℓt​−μ⊤xt​∣≤1 is added because the proof uses ∣ητ∣≤1|\eta_\tau|\le1∣ητ​∣≤1 while the model gives only ∣ηt∣≤2|\eta_t|\le2∣ηt​∣≤2. The Section 5 coordinates are without loss of generality. The event is a single event over all t≥1t\ge1t≥1.

Preamble
import Mathlib
import Definitions.Def_StochLinOpt_UpperBound_confidenceBall2
import Definitions.Def_StochLinOpt_UpperBound_analysisQuantities

open Matrix MeasureTheory
Formal statement
namespace StochLinOpt.UpperBound

theorem confidence {n : ℕ} {Ω : Type*} {mΩ : MeasurableSpace Ω}
    (P : Measure Ω) [IsProbabilityMeasure P] (𝓕 : Filtration ℕ mΩ)
    (D : Set (Fin n → ℝ)) (hD_compact : IsCompact D)
    (hD_basis : ∀ i : Fin n, (Pi.single i (1 : ℝ) : Fin n → ℝ) ∈ D)
    (hD_cube : ∀ y ∈ D, ∀ i, |y i| ≤ 1)
    (μ : Fin n → ℝ) (hμD : ∀ y ∈ D, |μ ⬝ᵥ y| ≤ 1)
    (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ < 1)
    (x : ℕ → Ω → Fin n → ℝ) (ℓ : ℕ → Ω → ℝ)
    (hx_meas : ∀ t : ℕ, 1 ≤ t → Measurable[𝓕 t] (x t))
    (hℓ_meas : ∀ t : ℕ, 1 ≤ t → Measurable[𝓕 (t + 1)] (ℓ t))
    (hℓ_bdd : ∀ t : ℕ, 1 ≤ t → ∀ ω, |ℓ t ω| ≤ 1)
    (hη_bdd : ∀ t : ℕ, 1 ≤ t → ∀ ω, |ℓ t ω - μ ⬝ᵥ x t ω| ≤ 1)
    (hmean : ∀ t : ℕ, 1 ≤ t → P[ℓ t | 𝓕 t] =ᵐ[P] fun ω => μ ⬝ᵥ x t ω)
    (hrun : ∀ ω, IsConfidenceBall2Run D δ (fun t => x t ω) (fun t => ℓ t ω))
    (hβ₁ : (n : ℝ) ≤ (8 / 3 * Real.log (1 / δ)) ^ 2) :
    1 - δ ≤ P.real {ω | ∀ t : ℕ, 1 ≤ t →
      μ ∈ confBall δ (fun s => x s ω) (fun s => ℓ s ω) t} := by sorry

end StochLinOpt.UpperBound
Source
Dani, Hayes, Kakade, Stochastic Linear Optimization under Bandit Feedback, COLT 2008, PDF p. 6, Theorem 5 (ConfidenceBall2 bullet); proof PDF p. 10, Section 5.2
Read-back

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

Throughout, ⟨u,v⟩=∑i=1nuivi\langle u, v\rangle = \sum_{i=1}^{n} u_i v_i⟨u,v⟩=∑i=1n​ui​vi​ is the ordinary dot product on Rn\mathbb{R}^nRn, and eie_iei​ is the iii-th standard basis vector. The statement relies on two imported definitions whose code was not provided: IsConfidenceBall2Run (written Run\mathrm{Run}Run below) and confBall (written C\mathcal{C}C below). Their content cannot be expanded here. The statement's meaning depends entirely on them, and they must be checked separately.

Setting. The statement fixes the following:

  • a dimension n∈Nn \in \mathbb{N}n∈N;
  • a measurable space (Ω,M)(\Omega, \mathcal{M})(Ω,M) with a probability measure PPP;
  • a filtration (Ft)t∈N(\mathcal{F}_t)_{t \in \mathbb{N}}(Ft​)t∈N​ of sub-σ-algebras of M\mathcal{M}M;
  • a set D⊆RnD \subseteq \mathbb{R}^nD⊆Rn;
  • a vector μ∈Rn\mu \in \mathbb{R}^nμ∈Rn;
  • a real number δ\deltaδ;
  • for every t∈Nt \in \mathbb{N}t∈N, including t=0t = 0t=0, a vector-valued function xt:Ω→Rnx_t : \Omega \to \mathbb{R}^nxt​:Ω→Rn and a real-valued function ℓt:Ω→R\ell_t : \Omega \to \mathbb{R}ℓt​:Ω→R.

Hypotheses.

  1. DDD is compact.
  2. ei∈De_i \in Dei​∈D for every i∈{1,…,n}i \in \{1,\dots,n\}i∈{1,…,n}.
  3. Every y∈Dy \in Dy∈D satisfies ∣yi∣≤1|y_i| \le 1∣yi​∣≤1 for every coordinate iii.
  4. ∣⟨μ,y⟩∣≤1|\langle \mu, y\rangle| \le 1∣⟨μ,y⟩∣≤1 for every y∈Dy \in Dy∈D. Together with hypothesis 2, this forces ∣μi∣≤1|\mu_i| \le 1∣μi​∣≤1 for every iii.
  5. 0<δ<10 < \delta < 10<δ<1.
  6. For every t≥1t \ge 1t≥1, xtx_txt​ is Ft\mathcal{F}_tFt​-measurable.
  7. For every t≥1t \ge 1t≥1, ℓt\ell_tℓt​ is Ft+1\mathcal{F}_{t+1}Ft+1​-measurable.
  8. For every t≥1t \ge 1t≥1 and every ω\omegaω (not just almost every ω\omegaω), ∣ℓt(ω)∣≤1|\ell_t(\omega)| \le 1∣ℓt​(ω)∣≤1.
  9. For every t≥1t \ge 1t≥1 and every ω\omegaω, ∣ℓt(ω)−⟨μ,xt(ω)⟩∣≤1|\ell_t(\omega) - \langle \mu, x_t(\omega)\rangle| \le 1∣ℓt​(ω)−⟨μ,xt​(ω)⟩∣≤1. This is a separate assumption. The code does not require xt(ω)∈Dx_t(\omega) \in Dxt​(ω)∈D, unless Run\mathrm{Run}Run does.
  10. For every t≥1t \ge 1t≥1, the conditional expectation satisfies
EP[ℓt∣Ft]=⟨μ,xt⟩P-almost surely.\mathbb{E}_P[\ell_t \mid \mathcal{F}_t] = \langle \mu, x_t\rangle \quad P\text{-almost surely}.EP​[ℓt​∣Ft​]=⟨μ,xt​⟩P-almost surely.
  1. For every ω∈Ω\omega \in \Omegaω∈Ω, the pair of deterministic sequences ((xt(ω))t∈N,(ℓt(ω))t∈N)\big((x_t(\omega))_{t\in\mathbb{N}}, (\ell_t(\omega))_{t\in\mathbb{N}}\big)((xt​(ω))t∈N​,(ℓt​(ω))t∈N​) satisfies Run(D,δ,⋅,⋅)\mathrm{Run}(D, \delta, \cdot, \cdot)Run(D,δ,⋅,⋅). This is a pointwise condition on every sample path, whatever Run\mathrm{Run}Run means.
  2. The dimension is bounded in terms of δ\deltaδ:
n≤(83log⁡1δ)2.n \le \Big(\tfrac{8}{3}\log\tfrac{1}{\delta}\Big)^2.n≤(38​logδ1​)2.

When n≥1n \ge 1n≥1, this is equivalent to δ≤e−3n/8\delta \le e^{-3\sqrt{n}/8}δ≤e−3n​/8.

Conclusion. Let

E={ω∈Ω:μ∈C(δ,(xs(ω))s,(ℓs(ω))s,t) for every t≥1}.E = \big\{\omega \in \Omega : \mu \in \mathcal{C}\big(\delta, (x_s(\omega))_s, (\ell_s(\omega))_s, t\big) \text{ for every } t \ge 1\big\}.E={ω∈Ω:μ∈C(δ,(xs​(ω))s​,(ℓs​(ω))s​,t) for every t≥1}.

Then

P(E)≥1−δ.P(E) \ge 1 - \delta.P(E)≥1−δ.

Here P(E)P(E)P(E) is taken as a real number. The event is simultaneous over all times t≥1t \ge 1t≥1, so it is an infinite-horizon, time-uniform statement. The time t=0t = 0t=0 is not included in the event. The code does not assert that EEE is measurable. If EEE is not measurable, the value assigned to it is its outer measure, so the bound is then a lower bound on the outer measure.

Edge cases. All of the hypotheses on xtx_txt​ and ℓt\ell_tℓt​ (measurability, the bounds, the conditional mean) apply only for t≥1t \ge 1t≥1. The values x0x_0x0​ and ℓ0\ell_0ℓ0​ are completely unconstrained, yet they are still passed to Run\mathrm{Run}Run and C\mathcal{C}C as part of the full sequences. The same holds for the value of any xt,ℓtx_t, \ell_txt​,ℓt​ that C\mathcal{C}C at time ttt might read beyond index ttt.

The conditional expectation in hypothesis 10 is not a junk value: ℓt\ell_tℓt​ is bounded and measurable on a probability space, so it is integrable. Ω\OmegaΩ cannot be empty, because PPP is a probability measure. log⁡(1/δ)\log(1/\delta)log(1/δ) is well defined and positive, because 0<δ<10 < \delta < 10<δ<1.

When n=0n = 0n=0:

  • R0\mathbb{R}^0R0 is a single point, and μ\muμ is that point.
  • Every dot product is 000.
  • Hypotheses 2 and 3 are vacuous, and hypothesis 4 holds trivially.
  • DDD is either empty or the single point.
  • Hypothesis 12 holds automatically.
  • Hypothesis 10 then says E[ℓt∣Ft]=0\mathbb{E}[\ell_t \mid \mathcal{F}_t] = 0E[ℓt​∣Ft​]=0 almost surely.

When n≥1n \ge 1n≥1, hypothesis 12 excludes every δ>e−3n/8\delta > e^{-3\sqrt{n}/8}δ>e−3n​/8. In that range the theorem says nothing.

Hypothesis 11 is required for every sample path. Whether it can be satisfied at all, and so whether the theorem is vacuous, depends on the definition of Run\mathrm{Run}Run, which is not visible here. Likewise, how strong the conclusion is depends entirely on the definition of C\mathcal{C}C.

Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 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