Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Appendix F and (9)–(12) — estimation events and explicit probability bounds

Definition
MostlyExplorationFree_GreedyBandit_Supplement_Events

by mikedeng1 · Nov 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

contextual-banditgreedy-algorithmleast-squaresp2o-batch-supp500p2o-gran-per-chapterp2o-plan-paperp2o-v1

Put θ1=h/(2xmax⁡)\theta_1=h/(2x_{\max})θ1​=h/(2xmax​). For the greedy run with mmm initial samples per arm define

Hiδ={λmin⁡(Σ^(Si,Km))≥δ},Gi,tχ={∥β^(Si,t)−βi∥2<χ},H_i^\delta=\{\lambda_{\min}(\hat\Sigma(S_{i,Km}))\ge\delta\},\quad G_{i,t}^\chi=\{\|\hat\beta(S_{i,t})-\beta_i\|_2<\chi\},Hiδ​={λmin​(Σ^(Si,Km​))≥δ},Gi,tχ​={∥β^​(Si,t​)−βi​∥2​<χ}, Ji,tλ={λmin⁡(Σ^(Si,t))≥λ(t−m∣Ksub∣)},Success=⋂i⋂t≥KmGi,tθ1.J_{i,t}^\lambda=\{\lambda_{\min}(\hat\Sigma(S_{i,t}))\ge\lambda(t-m|K_{\rm sub}|)\},\quad \mathrm{Success}=\bigcap_i\bigcap_{t\ge Km}G_{i,t}^{\theta_1}.Ji,tλ​={λmin​(Σ^(Si,t​))≥λ(t−m∣Ksub​∣)},Success=i⋂​t≥Km⋂​Gi,tθ1​​.

Let qδq_\deltaqδ​ be the probability that the Gram matrix of mmm independent contexts has minimum eigenvalue at least δ\deltaδ, and put

D1(γ)=λ1[γ+(1−γ)log⁡(1−γ)]xmax⁡2,D2(γ)=λ12h2(1−γ)28dσ2xmax⁡4.D_1(\gamma)=\frac{\lambda_1[\gamma+(1-\gamma)\log(1-\gamma)]}{x_{\max}^2},\quad D_2(\gamma)=\frac{\lambda_1^2h^2(1-\gamma)^2}{8d\sigma^2x_{\max}^4}.D1​(γ)=xmax2​λ1​[γ+(1−γ)log(1−γ)]​,D2​(γ)=8dσ2xmax4​λ12​h2(1−γ)2​.

Then the explicit function in (9) is

L(γ,δ,p)=1−qδK+2Kdqδe−h2δ/(8dσ2xmax⁡2)+∑j=Km+1p−12de−h2δ2/[8d(j−(K−1)m)σ2xmax⁡4]+de−D1(γ)(p−m∣Ksub∣)1−e−D1(γ)+2de−D2(γ)(p−m∣Ksub∣)1−e−D2(γ).\begin{aligned}L(\gamma,\delta,p)={}&1-q_\delta^K+2Kdq_\delta e^{-h^2\delta/(8d\sigma^2x_{\max}^2)}\\&+\sum_{j=Km+1}^{p-1}2d e^{-h^2\delta^2/[8d(j-(K-1)m)\sigma^2x_{\max}^4]}\\&+\frac{d e^{-D_1(\gamma)(p-m|K_{\rm sub}|)}}{1-e^{-D_1(\gamma)}}+\frac{2d e^{-D_2(\gamma)(p-m|K_{\rm sub}|)}}{1-e^{-D_2(\gamma)}}.\end{aligned}L(γ,δ,p)=​1−qδK​+2Kdqδ​e−h2δ/(8dσ2xmax2​)+j=Km+1∑p−1​2de−h2δ2/[8d(j−(K−1)m)σ2xmax4​]+1−e−D1​(γ)de−D1​(γ)(p−m∣Ksub​∣)​+1−e−D2​(γ)2de−D2​(γ)(p−m∣Ksub​∣)​.​

Equation (12) adds (K−1)de−D1(γ)p/(1−e−D1(γ))(K-1)d e^{-D_1(\gamma)p}/(1-e^{-D_1(\gamma)})(K−1)de−D1​(γ)p/(1−e−D1​(γ)) to define L′L'L′. Also write A=128C0Cˉxmax⁡4σ2d(log⁡d)3/2/λ02A=128C_0\bar C x_{\max}^4\sigma^2d(\log d)^{3/2}/\lambda_0^2A=128C0​Cˉxmax4​σ2d(logd)3/2/λ02​ and B=160bmax⁡xmax⁡3d/λ0+2xmax⁡bmax⁡B=160b_{\max}x_{\max}^3d/\lambda_0+2x_{\max}b_{\max}B=160bmax​xmax3​d/λ0​+2xmax​bmax​, and set CGB=A+(A+B)/log⁡3C_{\rm GB}=A+(A+B)/\log3CGB​=A+(A+B)/log3 using the published form of Theorem 1. Finally δ(t0)=2de−t0C1/C1\delta(t_0)=2d e^{-t_0 C_1}/C_1δ(t0​)=2de−t0​C1​/C1​, where C1=λ0/(40xmax⁡2)C_1=\lambda_0/(40x_{\max}^2)C1​=λ0​/(40xmax2​).

These shared definitions keep each probability statement's events and constants identical across the supplement.

Formalization Note The missing parentheses in JJJ on p. 53 are repaired using pp. 20 and 55. Time differences in exponents and denominators are real differences. The first mmm contexts compute qδq_\deltaqδ​; iid sampling gives exactly the random-design law in (9). Bounds use 0<γ<10<\gamma<10<γ<1, δ>0\delta>0δ>0, positive noise proxy, and positive scale constants. The infima in the theorems are stated pointwise; no empty real infimum is evaluated. The base Cbar and C1 definitions are imported unchanged. Cbar is used only with d≥2d\ge2d≥2.

Definition code
import Mathlib
import Definitions.Def_MostlyExplorationFree_GreedyBandit_Model
import Definitions.Def_MostlyExplorationFree_GreedyBandit_Supplement_PositiveDefiniteness
import Definitions.Def_MostlyExplorationFree_GreedyBandit_Supplement_GreedyFirst

namespace MostlyExplorationFree.GreedyBandit.Supplement

open Matrix MeasureTheory

noncomputable def theta1 (h xmax : ℝ) : ℝ := h / (2 * xmax)

def H {Ω : Type*} {d K : ℕ} [NeZero K] (E : Environment Ω d K)
    (m : ℕ) (δ : ℝ) (i : Fin K) : Set Ω :=
  {ω | δ ≤ lambdaMin (gram E m i (K * m) ω)}

/-- Parentheses repaired from p. 20 and the application of Lemma 9 on p. 55.
Subtractions occur in ℝ. -/
def J {Ω : Type*} {d K : ℕ} [NeZero K] (E : Environment Ω d K)
    (m : ℕ) (Ksub : Finset (Fin K)) (lam : ℝ) (i : Fin K) (t : ℕ) : Set Ω :=
  {ω | lam * ((t : ℝ) - (m : ℝ) * Ksub.card) ≤ lambdaMin (gram E m i t ω)}

def G {Ω : Type*} {d K : ℕ} [NeZero K] (E : Environment Ω d K)
    (m : ℕ) (χ : ℝ) (i : Fin K) (t : ℕ) : Set Ω :=
  {ω | l2norm (est E m i t ω - E.β i) < χ}

def AccurateThrough {Ω : Type*} {d K : ℕ} [NeZero K] (E : Environment Ω d K)
    (m : ℕ) (χ : ℝ) (t : ℕ) : Set Ω :=
  {ω | ∀ i j, K * m ≤ j → j < t → ω ∈ G E m χ i j}

def Success {Ω : Type*} {d K : ℕ} [NeZero K] (E : Environment Ω d K)
    (m : ℕ) (h xmax : ℝ) : Set Ω :=
  {ω | ∀ i t, K * m ≤ t → ω ∈ G E m (theta1 h xmax) i t}

/-- Probability of a good Gram matrix from m iid context samples, using the first m contexts. -/
noncomputable def sampleGood {Ω : Type*} [MeasurableSpace Ω] {d K : ℕ}
    (P : Measure Ω) (E : Environment Ω d K) (m : ℕ) (δ : ℝ) : ℝ :=
  P.real {ω | δ ≤ lambdaMin (gramOn E ω (Finset.Icc 1 m))}

noncomputable def D1 (lam1 xmax γ : ℝ) : ℝ :=
  lam1 * (γ + (1 - γ) * Real.log (1 - γ)) / xmax ^ 2

noncomputable def D2 (d : ℕ) (σ xmax h lam1 γ : ℝ) : ℝ :=
  lam1 ^ 2 * h ^ 2 * (1 - γ) ^ 2 / (8 * d * σ ^ 2 * xmax ^ 4)

/-- Exactly (9), including the factor qδ and the two different powers of xmax. -/
noncomputable def L {Ω : Type*} [MeasurableSpace Ω] {d K : ℕ}
    (P : Measure Ω) (E : Environment Ω d K) (m : ℕ) (Ksub : Finset (Fin K))
    (σ xmax h lam1 γ δ : ℝ) (p : ℕ) : ℝ :=
  let qδ := sampleGood P E m δ
  let a := D1 lam1 xmax γ
  let b := D2 d σ xmax h lam1 γ
  let v := (p : ℝ) - (m : ℝ) * Ksub.card
  1 - qδ ^ K + 2 * K * d * qδ * Real.exp (-h ^ 2 * δ / (8 * d * σ ^ 2 * xmax ^ 2))
    + (∑ j ∈ Finset.Icc (K * m + 1) (p - 1),
        2 * d * Real.exp (-h ^ 2 * δ ^ 2 /
          (8 * d * ((j : ℝ) - ((K : ℝ) - 1) * m) * σ ^ 2 * xmax ^ 4)))
    + d * Real.exp (-a * v) / (1 - Real.exp (-a))
    + 2 * d * Real.exp (-b * v) / (1 - Real.exp (-b))

noncomputable def Lprime {Ω : Type*} [MeasurableSpace Ω] {d K : ℕ}
    (P : Measure Ω) (E : Environment Ω d K) (m : ℕ) (Ksub : Finset (Fin K))
    (σ xmax h lam1 γ δ : ℝ) (p : ℕ) : ℝ :=
  L P E m Ksub σ xmax h lam1 γ δ p +
    ((K : ℝ) - 1) * d * Real.exp (-D1 lam1 xmax γ * p) /
      (1 - Real.exp (-D1 lam1 xmax γ))

/-- C_GB obtained from the already-published, proved form of Theorem 1. -/
noncomputable def CGB (d : ℕ) (C0 xmax bmax σ lam0 : ℝ) : ℝ :=
  let A := 128 * C0 * Cbar d * xmax ^ 4 * σ ^ 2 * d * Real.log d ^ (3 / 2 : ℝ) / lam0 ^ 2
  let B := 160 * bmax * xmax ^ 3 * d / lam0 + 2 * xmax * bmax
  A + (A + B) / Real.log 3

noncomputable def switchFailure (d : ℕ) (lam0 xmax : ℝ) (t0 : ℕ) : ℝ :=
  2 * d * Real.exp (-(t0 : ℝ) * C1 lam0 xmax) / C1 lam0 xmax

end MostlyExplorationFree.GreedyBandit.Supplement
Source
Bastani, Bayati & Khosravi, arXiv:1704.09011v8, pp. 19–20, 25, 53, events H, J, G, equations (9)–(12); pp. 12, 23–24, 42, constants

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