LeanMachineLearning exposition

Bandits.gap_eq_bestArm_sub🔗

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.

Minimal Lean file

gap_eq_bestArm_sub🔗

LemmaBandits.gap_eq_bestArm_sub

No docstring.

🔗theorem
Bandits.gap_eq_bestArm_sub.{u_1} {𝓐 : Type u_1} {m𝓐 : MeasurableSpace 𝓐} {ν : ProbabilityTheory.Kernel 𝓐 } {a : 𝓐} [Fintype 𝓐] [Nonempty 𝓐] : gap ν a = (x : ), id x ν (bestArm ν) - (x : ), id x ν a
Bandits.gap_eq_bestArm_sub.{u_1} {𝓐 : Type u_1} {m𝓐 : MeasurableSpace 𝓐} {ν : ProbabilityTheory.Kernel 𝓐 } {a : 𝓐} [Fintype 𝓐] [Nonempty 𝓐] : gap ν a = (x : ), id x ν (bestArm ν) - (x : ), id x ν a

Code

lemma gap_eq_bestArm_sub : gap ν a = (ν (bestArm ν))[id] - (ν a)[id]
Type uses (2)
Body uses (1)
Used by (4)

Actions: Source · Open Issue

Proof
by
  rw [gap]
  congr
  refine le_antisymm ?_ (le_ciSup (f := fun a ↦ (ν a)[id]) (by simp) (bestArm ν))
  exact ciSup_le le_bestArm

Dependency graph

Type dependencies (2)

gap🔗

DefinitionBandits.gap

Gap of an action a: difference between the highest mean of the actions and the mean of a.

🔗def
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

bestArm🔗

DefinitionBandits.bestArm

action with the highest mean.

🔗def
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