Bandits.prob_sumRewards_sub_pullCount_mul_le_le
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.
prob_sumRewards_sub_pullCount_mul_le_le๐
Bandits.prob_sumRewards_sub_pullCount_mul_le_leNo docstring.
Bandits.prob_sumRewards_sub_pullCount_mul_le_le.{u_1, u_2} {๐ : Type u_1} {ฮฉ : Type u_2} [DecidableEq ๐] {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {alg : Learning.Algorithm ๐ โ} {ฮฝ : ProbabilityTheory.Kernel ๐ โ} [ProbabilityTheory.IsMarkovKernel ฮฝ] {A : โ โ ฮฉ โ ๐} {R : โ โ ฮฉ โ โ} {n : โ} {a : ๐} [Nonempty ๐] [Countable ๐] [MeasurableSingletonClass ๐] {ฯ2 : NNReal} (hฯ2 : 0 < ฯ2) (ha : ProbabilityTheory.HasSubgaussianMGF (fun x => x - โซ (x : โ), id x โฮฝ a) ฯ2 (ฮฝ a)) (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv ฮฝ) P) {ฮด : โ} (hฮด : 0 < ฮด) : P {ฯ | โ t < n, Learning.pullCount A a t ฯ โ 0 โง Learning.sumRewards A R a t ฯ - โ(Learning.pullCount A a t ฯ) * โซ (x : โ), id x โฮฝ a โค -โ(2 * โ(Learning.pullCount A a t ฯ) * โฯ2 * Real.log (1 / ฮด))} โค ENNReal.ofReal ((โn - 1) * ฮด)Bandits.prob_sumRewards_sub_pullCount_mul_le_le.{u_1, u_2} {๐ : Type u_1} {ฮฉ : Type u_2} [DecidableEq ๐] {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {alg : Learning.Algorithm ๐ โ} {ฮฝ : ProbabilityTheory.Kernel ๐ โ} [ProbabilityTheory.IsMarkovKernel ฮฝ] {A : โ โ ฮฉ โ ๐} {R : โ โ ฮฉ โ โ} {n : โ} {a : ๐} [Nonempty ๐] [Countable ๐] [MeasurableSingletonClass ๐] {ฯ2 : NNReal} (hฯ2 : 0 < ฯ2) (ha : ProbabilityTheory.HasSubgaussianMGF (fun x => x - โซ (x : โ), id x โฮฝ a) ฯ2 (ฮฝ a)) (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv ฮฝ) P) {ฮด : โ} (hฮด : 0 < ฮด) : P {ฯ | โ t < n, Learning.pullCount A a t ฯ โ 0 โง Learning.sumRewards A R a t ฯ - โ(Learning.pullCount A a t ฯ) * โซ (x : โ), id x โฮฝ a โค -โ(2 * โ(Learning.pullCount A a t ฯ) * โฯ2 * Real.log (1 / ฮด))} โค ENNReal.ofReal ((โn - 1) * ฮด)
Code
lemma prob_sumRewards_sub_pullCount_mul_le_le [Countable ๐] [MeasurableSingletonClass ๐]
{ฯ2 : โโฅ0} (hฯ2 : 0 < ฯ2) (ha : HasSubgaussianMGF (fun x โฆ x - (ฮฝ a)[id]) ฯ2 (ฮฝ a))
(h : IsAlgEnvSeq A R alg (stationaryEnv ฮฝ) P) {ฮด : โ} (hฮด : 0 < ฮด) :
P {ฯ | โ t < n, pullCount A a t ฯ โ 0 โง
sumRewards A R a t ฯ - pullCount A a t ฯ * (ฮฝ a)[id] โค
-โ(2 * pullCount A a t ฯ * ฯ2 * Real.log (1 / ฮด))} โค ENNReal.ofReal ((n - 1) * ฮด)Type uses (5)
Body uses (4)
Used by (1)
Actions: Source ยท Open Issue
Proof
let B (m : โ) := {x : โ | x - m * (ฮฝ a)[id] โค -โ(2 * m * ฯ2 * Real.log (1 / ฮด))}
calc
_ โค P (โ m โ Icc 1 (n - 1), {ฯ | โ t, t < n โง pullCount A a t ฯ = m โง
sumRewards A R a t ฯ โ B m}) := by
apply measure_mono
intro ฯ โจt, ht, hp, hbโฉ
have hm : pullCount A a t ฯ โ Icc 1 (n - 1) := mem_Icc.mpr โจNat.one_le_iff_ne_zero.mpr hp,
(pullCount_le a t ฯ).trans (Nat.le_sub_one_of_lt ht)โฉ
exact Set.mem_biUnion hm โจt, ht, rfl, hbโฉ
_ โค โ m โ Icc 1 (n - 1), P {ฯ | โ t, t < n โง pullCount A a t ฯ = m โง
sumRewards A R a t ฯ โ B m} :=
measure_biUnion_finset_le _ _
_ โค โ m โ Icc 1 (n - 1), P {ฯ | โ t, pullCount A a t ฯ = m โง sumRewards A R a t ฯ โ B m} :=
sum_le_sum (fun _ _ โฆ measure_mono (fun _ โจt, _, hpsโฉ โฆ โจt, hpsโฉ))
_ โค โ m โ Icc 1 (n - 1), streamMeasure ฮฝ {ฯ | โ i โ range m, ฯ i a โ B m} := by
apply sum_le_sum
exact (fun m _ โฆ prob_exists_pullCount_eq_and_sumRewards_mem_le h a m (by measurability))
_ โค โ m โ Icc 1 (n - 1), ENNReal.ofReal ฮด := by
apply sum_le_sum
intro m hm
exact le_of_eq_of_le (by simp [B])
(StreamMeasure.prob_sum_range_sub_le_le_of_HasSubgaussianMGF' hฯ2 ha hฮด (mem_Icc.mp hm).1)
_ = ENNReal.ofReal ((n - 1) * ฮด) := by
by_cases hn : n = 0
ยท simp [hn, hฮด.le]
ยท rw [sum_const, Nat.card_Icc, add_tsub_cancel_right, โ ENNReal.ofReal_nsmul, nsmul_eq_mul,
Nat.cast_sub (Nat.one_le_iff_ne_zero.mpr hn)]
ring_nfDependency graph
Type dependencies (5)
Algorithm๐
Learning.AlgorithmA stochastic, sequential algorithm.
Learning.Algorithm.{u_4, u_5} (๐ : Type u_4) (๐จ : Type u_5) [MeasurableSpace ๐] [MeasurableSpace ๐จ] : Type (max u_4 u_5)Learning.Algorithm.{u_4, u_5} (๐ : Type u_4) (๐จ : Type u_5) [MeasurableSpace ๐] [MeasurableSpace ๐จ] : Type (max u_4 u_5)
Code
structure Algorithm (๐ ๐จ : Type*) [MeasurableSpace ๐] [MeasurableSpace ๐จ] where /-- Policy or sampling rule: distribution of the next action. -/ policy : (n : โ) โ Kernel (Iic n โ ๐ ร ๐จ) ๐ /-- The policy is a Markov kernel. -/ [h_policy : โ n, IsMarkovKernel (policy n)] /-- Distribution of the first action. -/ p0 : Measure ๐ /-- The first action distribution is a probability measure. -/ [hp0 : IsProbabilityMeasure p0]
Used by (216)
Actions: Source ยท Open Issue
IsAlgEnvSeq๐
Learning.IsAlgEnvSeqAn algorithm-environment sequence: a sequence of actions and feedbacks generated by an algorithm interacting with an environment.
Learning.IsAlgEnvSeq.{u_1, u_2, u_3} {๐ : Type u_1} {๐จ : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {m๐จ : MeasurableSpace ๐จ} {mฮฉ : MeasurableSpace ฮฉ} (A : โ โ ฮฉ โ ๐) (Y : โ โ ฮฉ โ ๐จ) (alg : Algorithm ๐ ๐จ) (env : Environment ๐ ๐จ) (P : MeasureTheory.Measure ฮฉ) [MeasureTheory.IsFiniteMeasure P] : PropLearning.IsAlgEnvSeq.{u_1, u_2, u_3} {๐ : Type u_1} {๐จ : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {m๐จ : MeasurableSpace ๐จ} {mฮฉ : MeasurableSpace ฮฉ} (A : โ โ ฮฉ โ ๐) (Y : โ โ ฮฉ โ ๐จ) (alg : Algorithm ๐ ๐จ) (env : Environment ๐ ๐จ) (P : MeasureTheory.Measure ฮฉ) [MeasureTheory.IsFiniteMeasure P] : Prop
Code
structure IsAlgEnvSeq
(A : โ โ ฮฉ โ ๐) (Y : โ โ ฮฉ โ ๐จ) (alg : Algorithm ๐ ๐จ) (env : Environment ๐ ๐จ)
(P : Measure ฮฉ) [IsFiniteMeasure P] : Prop where
/-- The action sequence is measurable. -/
measurable_action n : Measurable (A n) := by fun_prop
/-- The feedback sequence is measurable. -/
measurable_feedback n : Measurable (Y n) := by fun_prop
/-- The first action has the correct law. -/
hasLaw_action_zero : HasLaw (fun ฯ โฆ (A 0 ฯ)) alg.p0 P
/-- The first feedback has the correct conditional distribution. -/
hasCondDistrib_feedback_zero : HasCondDistrib (Y 0) (A 0) env.ฮฝ0 P
/-- The next action has the correct conditional distribution given the history. -/
hasCondDistrib_action n :
HasCondDistrib (A (n + 1)) (history A Y n) (alg.policy n) P
/-- The next feedback has the correct conditional distribution given the history and
next action. -/
hasCondDistrib_feedback n :
HasCondDistrib (Y (n + 1)) (fun ฯ โฆ (history A Y n ฯ, A (n + 1) ฯ))
(env.feedback n) PType uses (3)
Used by (111)
Actions: Source ยท Open Issue
stationaryEnv๐
Learning.stationaryEnvA stationary environment, in which the distribution of the next feedback depends only on the last action.
Learning.stationaryEnv.{u_1, u_2} {๐ : Type u_1} {๐จ : Type u_2} {m๐ : MeasurableSpace ๐} {m๐จ : MeasurableSpace ๐จ} (ฮฝ : ProbabilityTheory.Kernel ๐ ๐จ) [ProbabilityTheory.IsMarkovKernel ฮฝ] : Environment ๐ ๐จLearning.stationaryEnv.{u_1, u_2} {๐ : Type u_1} {๐จ : Type u_2} {m๐ : MeasurableSpace ๐} {m๐จ : MeasurableSpace ๐จ} (ฮฝ : ProbabilityTheory.Kernel ๐ ๐จ) [ProbabilityTheory.IsMarkovKernel ฮฝ] : Environment ๐ ๐จ
Code
def stationaryEnv (ฮฝ : Kernel ๐ ๐จ) [IsMarkovKernel ฮฝ] : Environment ๐ ๐จ := obliviousEnv fun _ โฆ ฮฝ
Type uses (1)
Body uses (1)
Used by (81)
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
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
All dependencies, transitively (3)
Environment๐
Learning.EnvironmentA stochastic environment.
Learning.Environment.{u_4, u_5} (๐ : Type u_4) (๐จ : Type u_5) [MeasurableSpace ๐] [MeasurableSpace ๐จ] : Type (max u_4 u_5)Learning.Environment.{u_4, u_5} (๐ : Type u_4) (๐จ : Type u_5) [MeasurableSpace ๐] [MeasurableSpace ๐จ] : Type (max u_4 u_5)
Code
structure Environment (๐ ๐จ : Type*) [MeasurableSpace ๐] [MeasurableSpace ๐จ] where /-- Distribution of the next observation as function of the past history. -/ feedback : (n : โ) โ Kernel ((Iic n โ ๐ ร ๐จ) ร ๐) ๐จ /-- The feedback kernels are Markov kernels. -/ [h_feedback : โ n, IsMarkovKernel (feedback n)] /-- Distribution of the first observation given the first action. -/ ฮฝ0 : Kernel ๐ ๐จ /-- The initial observation kernel is a Markov kernel. -/ [hp0 : IsMarkovKernel ฮฝ0]
Actions: Source ยท Open Issue
history๐
Learning.history
History of the algorithm-environment sequence up to time n.
Learning.history.{u_1, u_2, u_3} {๐ : Type u_1} {๐จ : Type u_2} {ฮฉ : Type u_3} (A : โ โ ฮฉ โ ๐) (Y : โ โ ฮฉ โ ๐จ) (n : โ) (ฯ : ฮฉ) : โฅ(Finset.Iic n) โ ๐ ร ๐จLearning.history.{u_1, u_2, u_3} {๐ : Type u_1} {๐จ : Type u_2} {ฮฉ : Type u_3} (A : โ โ ฮฉ โ ๐) (Y : โ โ ฮฉ โ ๐จ) (n : โ) (ฯ : ฮฉ) : โฅ(Finset.Iic n) โ ๐ ร ๐จ
Code
def history (A : โ โ ฮฉ โ ๐) (Y : โ โ ฮฉ โ ๐จ) (n : โ) (ฯ : ฮฉ) : Iic n โ ๐ ร ๐จ := fun i โฆ (A i ฯ, Y i ฯ)
Actions: Source ยท Open Issue
obliviousEnv๐
Learning.obliviousEnvAn oblivious environment, in which the distribution of the next feedback depends only on the last action, but in a possibly time-dependent manner.
Learning.obliviousEnv.{u_1, u_2} {๐ : Type u_1} {๐จ : Type u_2} {m๐ : MeasurableSpace ๐} {m๐จ : MeasurableSpace ๐จ} (ฮฝ : โ โ ProbabilityTheory.Kernel ๐ ๐จ) [โ (n : โ), ProbabilityTheory.IsMarkovKernel (ฮฝ n)] : Environment ๐ ๐จLearning.obliviousEnv.{u_1, u_2} {๐ : Type u_1} {๐จ : Type u_2} {m๐ : MeasurableSpace ๐} {m๐จ : MeasurableSpace ๐จ} (ฮฝ : โ โ ProbabilityTheory.Kernel ๐ ๐จ) [โ (n : โ), ProbabilityTheory.IsMarkovKernel (ฮฝ n)] : Environment ๐ ๐จ
Code
def obliviousEnv (ฮฝ : โ โ Kernel ๐ ๐จ) [โ n, IsMarkovKernel (ฮฝ n)] : Environment ๐ ๐จ where feedback n := (ฮฝ (n + 1)).prodMkLeft _ ฮฝ0 := ฮฝ 0
Type uses (1)
Used by (10)
Actions: Source ยท Open Issue