LeanMachineLearning exposition

Bandits.prob_sum_le_sqrt_log๐Ÿ”—

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

prob_sum_le_sqrt_log๐Ÿ”—

LemmaBandits.prob_sum_le_sqrt_log

No docstring.

๐Ÿ”—theorem
Bandits.prob_sum_le_sqrt_log.{u_1} {๐“ : Type u_1} {m๐“ : MeasurableSpace ๐“} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {n : โ„•} {ฯƒ2 : NNReal} (hฮฝ : โˆ€ (a : ๐“), ProbabilityTheory.HasSubgaussianMGF (fun x => x - โˆซ (x : โ„), id x โˆ‚ฮฝ a) ฯƒ2 (ฮฝ a)) (hฯƒ2 : ฯƒ2 โ‰  0) {c : โ„} (hc : 0 โ‰ค c) (a : ๐“) (k : โ„•) (hk : k โ‰  0) : (streamMeasure ฮฝ) {ฯ‰ | โˆ‘ s โˆˆ Finset.range k, (ฯ‰ s a - โˆซ (x : โ„), id x โˆ‚ฮฝ a) โ‰ค -โˆš(2 * c * โ†‘k * โ†‘ฯƒ2 * Real.log (โ†‘n + 1))} โ‰ค 1 / (โ†‘n + 1) ^ c
Bandits.prob_sum_le_sqrt_log.{u_1} {๐“ : Type u_1} {m๐“ : MeasurableSpace ๐“} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {n : โ„•} {ฯƒ2 : NNReal} (hฮฝ : โˆ€ (a : ๐“), ProbabilityTheory.HasSubgaussianMGF (fun x => x - โˆซ (x : โ„), id x โˆ‚ฮฝ a) ฯƒ2 (ฮฝ a)) (hฯƒ2 : ฯƒ2 โ‰  0) {c : โ„} (hc : 0 โ‰ค c) (a : ๐“) (k : โ„•) (hk : k โ‰  0) : (streamMeasure ฮฝ) {ฯ‰ | โˆ‘ s โˆˆ Finset.range k, (ฯ‰ s a - โˆซ (x : โ„), id x โˆ‚ฮฝ a) โ‰ค -โˆš(2 * c * โ†‘k * โ†‘ฯƒ2 * Real.log (โ†‘n + 1))} โ‰ค 1 / (โ†‘n + 1) ^ c

Code

lemma prob_sum_le_sqrt_log {ฯƒ2 : โ„โ‰ฅ0}
    (hฮฝ : โˆ€ a, HasSubgaussianMGF (fun x โ†ฆ x - (ฮฝ a)[id]) ฯƒ2 (ฮฝ a))
    (hฯƒ2 : ฯƒ2 โ‰  0) {c : โ„} (hc : 0 โ‰ค c) (a : ๐“) (k : โ„•) (hk : k โ‰  0) :
    streamMeasure ฮฝ
        {ฯ‰ | (โˆ‘ s โˆˆ range k, (ฯ‰ s a - (ฮฝ a)[id])) โ‰ค - โˆš(2 * c * k * ฯƒ2 * Real.log (n + 1))} โ‰ค
      1 / (n + 1) ^ c
Type uses (1)
Body uses (4)
Used by (1)

Actions: Source ยท Open Issue

Proof
by
  calc
    streamMeasure ฮฝ
      {ฯ‰ | (โˆ‘ s โˆˆ range k, (ฯ‰ s a - (ฮฝ a)[id])) โ‰ค - โˆš(2 * c * k * ฯƒ2 * Real.log (n + 1))}
  _ โ‰ค ENNReal.ofReal (Real.exp (-(โˆš(2 * c * k * ฯƒ2 * Real.log (n + 1))) ^ 2 / (2 * k * ฯƒ2))) := by
    rw [โ† ofReal_measureReal]
    gcongr
    refine (HasSubgaussianMGF.measure_sum_range_le_le_of_iIndepFun (c := ฯƒ2) ?_ ?_ (by positivity))
    ยท exact (iIndepFun_eval_streamMeasure'' ฮฝ a).comp (fun i ฯ‰ โ†ฆ ฯ‰ - (ฮฝ a)[id])
        (fun _ โ†ฆ by fun_prop)
    ยท intro i him
      refine (hฮฝ a).congr_identDistrib ?_
      exact (identDistrib_eval_eval_id_streamMeasure _ _ _).symm.sub_const _
  _ = 1 / (n + 1) ^ c := by
    rw [Real.sq_sqrt]
    swap; ยท exact mul_nonneg (by positivity) (Real.log_nonneg (by simp))
    field_simp
    rw [โ† Real.log_rpow (by positivity), โ† Real.log_inv,
      Real.exp_log (by positivity), one_div, ENNReal.ofReal_inv_of_pos (by positivity),
      โ† ENNReal.ofReal_rpow_of_nonneg (by positivity) (by positivity)]
    norm_cast

Dependency graph

Type dependencies (1)

streamMeasure๐Ÿ”—

DefinitionBandits.streamMeasure

Measure of an infinite stream of rewards from each action.

๐Ÿ”—def
Bandits.streamMeasure.{u_1, u_2} {๐“ : Type u_1} {R : Type u_2} {m๐“ : MeasurableSpace ๐“} {mR : MeasurableSpace R} (ฮฝ : ProbabilityTheory.Kernel ๐“ R) : MeasureTheory.Measure (โ„• โ†’ ๐“ โ†’ R)
Bandits.streamMeasure.{u_1, u_2} {๐“ : Type u_1} {R : Type u_2} {m๐“ : MeasurableSpace ๐“} {mR : MeasurableSpace R} (ฮฝ : ProbabilityTheory.Kernel ๐“ R) : MeasureTheory.Measure (โ„• โ†’ ๐“ โ†’ R)

Code

noncomputable
def streamMeasure (ฮฝ : Kernel ๐“ R) : Measure (โ„• โ†’ ๐“ โ†’ R) :=
  Measure.infinitePi fun _ โ†ฆ Measure.infinitePi ฮฝ
Used by (56)

Actions: Source ยท Open Issue