Bandits.UCB.pullCount_le_add_three
No docstring.
Bandits.UCB.pullCount_le_add_three.{u_1} {K : ℕ} {c : ℝ} {ν : ProbabilityTheory.Kernel (Fin K) ℝ} {Ω : Type u_1} {A : ℕ → Ω → Fin K} {R : ℕ → Ω → ℝ} [Nonempty (Fin K)] (a : Fin K) (n C : ℕ) (ω : Ω) : Learning.pullCount A a n ω ≤ C + 1 + ∑ s ∈ Finset.range n, Set.indicator {s | A s ω = a ∧ C < Learning.pullCount A a s ω ∧ ∫ (x : ℝ), id x ∂ν (bestArm ν) ≤ Learning.empMean A R (bestArm ν) s ω + ucbWidth A c (bestArm ν) s ω ∧ Learning.empMean A R (A s ω) s ω - ucbWidth A c (A s ω) s ω ≤ ∫ (x : ℝ), id x ∂ν (A s ω)} 1 s + ∑ s ∈ Finset.range n, Set.indicator {s | C < Learning.pullCount A a s ω ∧ Learning.empMean A R (bestArm ν) s ω + ucbWidth A c (bestArm ν) s ω < ∫ (x : ℝ), id x ∂ν (bestArm ν)} 1 s + ∑ s ∈ Finset.range n, Set.indicator {s | C < Learning.pullCount A a s ω ∧ ∫ (x : ℝ), id x ∂ν a < Learning.empMean A R a s ω - ucbWidth A c a s ω} 1 sBandits.UCB.pullCount_le_add_three.{u_1} {K : ℕ} {c : ℝ} {ν : ProbabilityTheory.Kernel (Fin K) ℝ} {Ω : Type u_1} {A : ℕ → Ω → Fin K} {R : ℕ → Ω → ℝ} [Nonempty (Fin K)] (a : Fin K) (n C : ℕ) (ω : Ω) : Learning.pullCount A a n ω ≤ C + 1 + ∑ s ∈ Finset.range n, Set.indicator {s | A s ω = a ∧ C < Learning.pullCount A a s ω ∧ ∫ (x : ℝ), id x ∂ν (bestArm ν) ≤ Learning.empMean A R (bestArm ν) s ω + ucbWidth A c (bestArm ν) s ω ∧ Learning.empMean A R (A s ω) s ω - ucbWidth A c (A s ω) s ω ≤ ∫ (x : ℝ), id x ∂ν (A s ω)} 1 s + ∑ s ∈ Finset.range n, Set.indicator {s | C < Learning.pullCount A a s ω ∧ Learning.empMean A R (bestArm ν) s ω + ucbWidth A c (bestArm ν) s ω < ∫ (x : ℝ), id x ∂ν (bestArm ν)} 1 s + ∑ s ∈ Finset.range n, Set.indicator {s | C < Learning.pullCount A a s ω ∧ ∫ (x : ℝ), id x ∂ν a < Learning.empMean A R a s ω - ucbWidth A c a s ω} 1 s
Code
lemma pullCount_le_add_three [Nonempty (Fin K)] (a : Fin K) (n C : ℕ) (ω : Ω) :
pullCount A a n ω ≤ C + 1 +
∑ s ∈ range n, {s | A s ω = a ∧ C < pullCount A a s ω ∧
(ν (bestArm ν))[id] ≤ empMean A R (bestArm ν) s ω + ucbWidth A c (bestArm ν) s ω ∧
empMean A R (A s ω) s ω - ucbWidth A c (A s ω) s ω ≤ (ν (A s ω))[id]}.indicator 1 s +
∑ s ∈ range n,
{s | C < pullCount A a s ω ∧ empMean A R (bestArm ν) s ω + ucbWidth A c (bestArm ν) s ω <
(ν (bestArm ν))[id]}.indicator 1 s +
∑ s ∈ range n,
{s | C < pullCount A a s ω ∧ (ν a)[id] <
empMean A R a s ω - ucbWidth A c a s ω}.indicator 1 sProof
by
refine (pullCount_le_add a n C ω).trans ?_
simp_rw [add_assoc]
gcongr
simp_rw [← add_assoc]
let A' := {s | A s ω = a ∧ C < pullCount A a s ω}
let B := {s | A s ω = a ∧ C < pullCount A a s ω ∧
(ν (bestArm ν))[id] ≤ empMean A R (bestArm ν) s ω + ucbWidth A c (bestArm ν) s ω ∧
empMean A R (A s ω) s ω - ucbWidth A c (A s ω) s ω ≤ (ν (A s ω))[id]}
let C' := {s | C < pullCount A a s ω ∧
empMean A R (bestArm ν) s ω + ucbWidth A c (bestArm ν) s ω < (ν (bestArm ν))[id]}
let D := {s | C < pullCount A a s ω ∧ (ν a)[id] < empMean A R a s ω - ucbWidth A c a s ω}
change ∑ s ∈ range n, A'.indicator 1 s ≤
∑ s ∈ range n, B.indicator 1 s + ∑ s ∈ range n, C'.indicator 1 s +
∑ s ∈ range n, D.indicator 1 s
have h_union : A' ⊆ B ∪ C' ∪ D := by simp [A', B, C', D]; grind
calc
(∑ s ∈ range n, A'.indicator 1 s)
_ ≤ (∑ s ∈ range n, (B ∪ C' ∪ D).indicator (fun _ ↦ (1 : ℕ)) s) := by
gcongr with n hn
by_cases h : n ∈ A'
· have : n ∈ B ∪ C' ∪ D := h_union h
simp [h, this]
· simp [h]
_ ≤ ∑ s ∈ range n, (B.indicator 1 s + C'.indicator 1 s + D.indicator 1 s) := by
gcongr with s
simp [Set.indicator_apply]
grind
_ = ∑ s ∈ range n, B.indicator 1 s + ∑ s ∈ range n, C'.indicator 1 s +
∑ s ∈ range n, D.indicator 1 s := by
rw [Finset.sum_add_distrib, Finset.sum_add_distrib]Actions: Source · Open Issue
Meaning last changed in v4.34.0-rc2-14-gf86702d (2026-08-25), the 3th recorded change.
Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file · open it in the Lean web editor.
Dependency graph
Audit surface: 5 project declarations, 93 external constants
✓ Proved: no sorry anywhere in its closure
This is the tool's own reading of one build's recorded axioms, and it is not robust against an author who wants it to pass. Checking meant to be relied on should go through Comparator, which replays the proof through the kernel from an export against an explicit list of permitted axioms.