Bandits.UCB.gap_arm_le_two_mul_ucbWidth
This page has the declaration's own card below, then its dependency graph, then a card for each dependency (type dependencies first, then the rest of the transitive closure). For a theorem, the graph and the dependency cards only follow its statement's dependencies (its proof is replaced by sorry, so what it proves doesn't depend on how); for everything else, both the type and the body/value are followed, since their content is part of what later declarations build on.
gap_arm_le_two_mul_ucbWidth๐
Bandits.UCB.gap_arm_le_two_mul_ucbWidthNo docstring.
Bandits.UCB.gap_arm_le_two_mul_ucbWidth.{u_1} {K : โ} {c : โ} {ฮฝ : ProbabilityTheory.Kernel (Fin K) โ} {ฮฉ : Type u_1} {A : โ โ ฮฉ โ Fin K} {R : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} [Nonempty (Fin K)] (h_best : โซ (x : โ), id x โฮฝ (bestArm ฮฝ) โค Learning.empMean A R (bestArm ฮฝ) n ฯ + ucbWidth A c (bestArm ฮฝ) n ฯ) (h_arm : Learning.empMean A R (A n ฯ) n ฯ - ucbWidth A c (A n ฯ) n ฯ โค โซ (x : โ), id x โฮฝ (A n ฯ)) (h_le : Learning.empMean A R (bestArm ฮฝ) n ฯ + ucbWidth A c (bestArm ฮฝ) n ฯ โค Learning.empMean A R (A n ฯ) n ฯ + ucbWidth A c (A n ฯ) n ฯ) : gap ฮฝ (A n ฯ) โค 2 * ucbWidth A c (A n ฯ) n ฯBandits.UCB.gap_arm_le_two_mul_ucbWidth.{u_1} {K : โ} {c : โ} {ฮฝ : ProbabilityTheory.Kernel (Fin K) โ} {ฮฉ : Type u_1} {A : โ โ ฮฉ โ Fin K} {R : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} [Nonempty (Fin K)] (h_best : โซ (x : โ), id x โฮฝ (bestArm ฮฝ) โค Learning.empMean A R (bestArm ฮฝ) n ฯ + ucbWidth A c (bestArm ฮฝ) n ฯ) (h_arm : Learning.empMean A R (A n ฯ) n ฯ - ucbWidth A c (A n ฯ) n ฯ โค โซ (x : โ), id x โฮฝ (A n ฯ)) (h_le : Learning.empMean A R (bestArm ฮฝ) n ฯ + ucbWidth A c (bestArm ฮฝ) n ฯ โค Learning.empMean A R (A n ฯ) n ฯ + ucbWidth A c (A n ฯ) n ฯ) : gap ฮฝ (A n ฯ) โค 2 * ucbWidth A c (A n ฯ) n ฯ
Code
lemma gap_arm_le_two_mul_ucbWidth [Nonempty (Fin K)]
(h_best : (ฮฝ (bestArm ฮฝ))[id] โค empMean A R (bestArm ฮฝ) n ฯ + ucbWidth A c (bestArm ฮฝ) n ฯ)
(h_arm : empMean A R (A n ฯ) n ฯ - ucbWidth A c (A n ฯ) n ฯ โค (ฮฝ (A n ฯ))[id])
(h_le : empMean A R (bestArm ฮฝ) n ฯ + ucbWidth A c (bestArm ฮฝ) n ฯ โค
empMean A R (A n ฯ) n ฯ + ucbWidth A c (A n ฯ) n ฯ) :
gap ฮฝ (A n ฯ) โค 2 * ucbWidth A c (A n ฯ) n ฯBody uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
rw [gap_eq_bestArm_sub, sub_le_iff_le_add']
calc (ฮฝ (bestArm ฮฝ))[id]
_ โค empMean A R (bestArm ฮฝ) n ฯ + ucbWidth A c (bestArm ฮฝ) n ฯ := h_best
_ โค empMean A R (A n ฯ) n ฯ + ucbWidth A c (A n ฯ) n ฯ := h_le
_ โค (ฮฝ (A n ฯ))[id] + 2 * ucbWidth A c (A n ฯ) n ฯ := by
rw [two_mul, โ add_assoc]
gcongr
rwa [sub_le_iff_le_add] at h_armDependency graph
Type dependencies (4)
bestArm๐
Bandits.bestArmaction with the highest mean.
Bandits.bestArm.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [Fintype ๐] [Nonempty ๐] (ฮฝ : ProbabilityTheory.Kernel ๐ โ) : ๐Bandits.bestArm.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [Fintype ๐] [Nonempty ๐] (ฮฝ : ProbabilityTheory.Kernel ๐ โ) : ๐
Code
noncomputable def bestArm (ฮฝ : Kernel ๐ โ) : ๐ := (exists_max_image univ (fun a โฆ (ฮฝ a)[id]) (univ_nonempty_iff.mpr inferInstance)).choose
Used by (18)
Actions: Source ยท Open Issue
empMean๐
Learning.empMean
Empirical mean reward obtained when pulling action a up to time t (exclusive).
Learning.empMean.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ โ) (a : ๐) (t : โ) (ฯ : ฮฉ) : โLearning.empMean.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ โ) (a : ๐) (t : โ) (ฯ : ฮฉ) : โ
Code
noncomputable def empMean (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ โ) (a : ๐) (t : โ) (ฯ : ฮฉ) : โ := sumRewards A R' a t ฯ / pullCount A a t ฯ
Body uses (2)
Actions: Source ยท Open Issue
ucbWidth๐
Bandits.UCB.ucbWidthThe exploration bonus of the UCB algorithm, which corresponds to the width of a confidence interval.
Bandits.UCB.ucbWidth.{u_1} {K : โ} {ฮฉ : Type u_1} (A : โ โ ฮฉ โ Fin K) (c : โ) (a : Fin K) (n : โ) (ฯ : ฮฉ) : โBandits.UCB.ucbWidth.{u_1} {K : โ} {ฮฉ : Type u_1} (A : โ โ ฮฉ โ Fin K) (c : โ) (a : Fin K) (n : โ) (ฯ : ฮฉ) : โ
Code
noncomputable def ucbWidth (A : โ โ ฮฉ โ Fin K) (c : โ) (a : Fin K) (n : โ) (ฯ : ฮฉ) : โ := โ(2 * c * log (n + 1) / pullCount A a n ฯ)
Body uses (1)
Used by (16)
Actions: Source ยท Open Issue
gap๐
Bandits.gap
Gap of an action a: difference between the highest mean of the actions and the mean of a.
Bandits.gap.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} (ฮฝ : ProbabilityTheory.Kernel ๐ โ) (a : ๐) : โBandits.gap.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} (ฮฝ : ProbabilityTheory.Kernel ๐ โ) (a : ๐) : โ
Code
noncomputable def gap (ฮฝ : Kernel ๐ โ) (a : ๐) : โ := (โจ i, (ฮฝ i)[id]) - (ฮฝ a)[id]
Used by (27)
Actions: Source ยท Open Issue
All dependencies, transitively (2)
sumRewards๐
Learning.sumRewards
Sum of rewards obtained when pulling action a up to time t (exclusive).
Learning.sumRewards.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ โ) (a : ๐) (t : โ) (ฯ : ฮฉ) : โLearning.sumRewards.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ โ) (a : ๐) (t : โ) (ฯ : ฮฉ) : โ
Code
def sumRewards (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ โ) (a : ๐) (t : โ) (ฯ : ฮฉ) : โ := โ s โ range t, if A s ฯ = a then R' s ฯ else 0
Used by (44)
Actions: Source ยท Open Issue
pullCount๐
Learning.pullCount
Number of times action a was chosen up to time t (excluding t).
Learning.pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (a : ๐) (t : โ) (ฯ : ฮฉ) : โLearning.pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (a : ๐) (t : โ) (ฯ : ฮฉ) : โ
Code
noncomputable def pullCount (A : โ โ ฮฉ โ ๐) (a : ๐) (t : โ) (ฯ : ฮฉ) : โ := #(filter (fun s โฆ A s ฯ = a) (range t))
Actions: Source ยท Open Issue