3.1.ย SequentialLearning.FiniteActions
Bookkeeping definitions for finite action space sequential learning problems
If the number of actions is finite, it makes sense to define the number of times each action was chosen, the time at which an action was chosen for the nth time, the value of the reward at that time, the sum of rewards obtained for each action, the empirical mean reward for each action, etc.
For each definition that take as arguments a time t : โ, a history h : โ โ ๐ ร R, and possibly
other parameters, we put the time and history at the end in this order, so that the definition can
be seen as a stochastic process indexed by time t on the measurable space โ โ ๐ ร R.
Module LeanMachineLearning.SequentialLearning.FiniteActions contains 103 exposed declarations.
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
pullCount'๐
Learning.pullCount'
Number of pulls of arm a up to (and including) time n.
This is the number of entries in h in which the arm is a.
Learning.pullCount'.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} [DecidableEq ๐] (n : โ) (h : โฅ(Finset.Iic n) โ ๐ ร R) (a : ๐) : โLearning.pullCount'.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} [DecidableEq ๐] (n : โ) (h : โฅ(Finset.Iic n) โ ๐ ร R) (a : ๐) : โ
Code
noncomputable
def pullCount' (n : โ) (h : Iic n โ ๐ ร R) (a : ๐) := #{s | (h s).1 = a}Used by (29)
Actions: Source ยท Open Issue
pullCount_zero๐
Learning.pullCount_zeroNo docstring.
Learning.pullCount_zero.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) : pullCount A a 0 = 0Learning.pullCount_zero.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) : pullCount A a 0 = 0
Code
lemma pullCount_zero (a : ๐) : pullCount A a 0 = 0
Type uses (1)
Used by (15)
Actions: Source ยท Open Issue
Proof
by ext; simp [pullCount]
pullCount_zero_apply๐
Learning.pullCount_zero_applyNo docstring.
Learning.pullCount_zero_apply.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (ฯ : ฮฉ) : pullCount A a 0 ฯ = 0Learning.pullCount_zero_apply.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (ฯ : ฮฉ) : pullCount A a 0 ฯ = 0
Code
lemma pullCount_zero_apply (a : ๐) (ฯ : ฮฉ) : pullCount A a 0 ฯ = 0
Type uses (1)
Body uses (1)
Actions: Source ยท Open Issue
Proof
by simp
pullCount_one๐
Learning.pullCount_oneNo docstring.
Learning.pullCount_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} : pullCount A a 1 ฯ = if A 0 ฯ = a then 1 else 0Learning.pullCount_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} : pullCount A a 1 ฯ = if A 0 ฯ = a then 1 else 0
Code
lemma pullCount_one : pullCount A a 1 ฯ = if A 0 ฯ = a then 1 else 0
Type uses (1)
Used by (3)
Actions: Source ยท Open Issue
Proof
by
simp only [pullCount, range_one]
split_ifs with h
ยท rw [card_eq_one]
refine โจ0, by simp [h]โฉ
ยท simp [h]
monotone_pullCount๐
Learning.monotone_pullCountNo docstring.
Learning.monotone_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (ฯ : ฮฉ) : Monotone fun x => pullCount A a x ฯLearning.monotone_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (ฯ : ฮฉ) : Monotone fun x => pullCount A a x ฯ
Code
lemma monotone_pullCount (a : ๐) (ฯ : ฮฉ) : Monotone (pullCount A a ยท ฯ)
Type uses (1)
Used by (5)
Actions: Source ยท Open Issue
Proof
fun _ _ _ โฆ card_le_card (filter_subset_filter _ (by simpa))
pullCount_mono๐
Learning.pullCount_monoNo docstring.
Learning.pullCount_mono.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) {n m : โ} (hnm : n โค m) (ฯ : ฮฉ) : pullCount A a n ฯ โค pullCount A a m ฯLearning.pullCount_mono.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) {n m : โ} (hnm : n โค m) (ฯ : ฮฉ) : pullCount A a n ฯ โค pullCount A a m ฯ
Code
lemma pullCount_mono (a : ๐) {n m : โ} (hnm : n โค m) (ฯ : ฮฉ) :
pullCount A a n ฯ โค pullCount A a m ฯType uses (1)
Body uses (1)
Used by (6)
Actions: Source ยท Open Issue
Proof
monotone_pullCount a ฯ hnm
pullCount_action_eq_pullCount_add_one๐
Learning.pullCount_action_eq_pullCount_add_oneNo docstring.
Learning.pullCount_action_eq_pullCount_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (t : โ) (ฯ : ฮฉ) : pullCount A (A t ฯ) (t + 1) ฯ = pullCount A (A t ฯ) t ฯ + 1Learning.pullCount_action_eq_pullCount_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (t : โ) (ฯ : ฮฉ) : pullCount A (A t ฯ) (t + 1) ฯ = pullCount A (A t ฯ) t ฯ + 1
Code
lemma pullCount_action_eq_pullCount_add_one (t : โ) (ฯ : ฮฉ) :
pullCount A (A t ฯ) (t + 1) ฯ = pullCount A (A t ฯ) t ฯ + 1Type uses (1)
Used by (7)
Actions: Source ยท Open Issue
Proof
by simp [pullCount, range_add_one, filter_insert]
pullCount_eq_pullCount_of_action_ne๐
Learning.pullCount_eq_pullCount_of_action_neNo docstring.
Learning.pullCount_eq_pullCount_of_action_ne.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {t : โ} {ฯ : ฮฉ} (ha : A t ฯ โ a) : pullCount A a (t + 1) ฯ = pullCount A a t ฯLearning.pullCount_eq_pullCount_of_action_ne.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {t : โ} {ฯ : ฮฉ} (ha : A t ฯ โ a) : pullCount A a (t + 1) ฯ = pullCount A a t ฯ
Code
lemma pullCount_eq_pullCount_of_action_ne (ha : A t ฯ โ a) :
pullCount A a (t + 1) ฯ = pullCount A a t ฯType uses (1)
Used by (5)
Actions: Source ยท Open Issue
Proof
by simp [pullCount, range_add_one, filter_insert, ha]
pullCount_add_one๐
Learning.pullCount_add_oneNo docstring.
Learning.pullCount_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {t : โ} {ฯ : ฮฉ} : pullCount A a (t + 1) ฯ = pullCount A a t ฯ + if A t ฯ = a then 1 else 0Learning.pullCount_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {t : โ} {ฯ : ฮฉ} : pullCount A a (t + 1) ฯ = pullCount A a t ฯ + if A t ฯ = a then 1 else 0
Code
lemma pullCount_add_one :
pullCount A a (t + 1) ฯ = pullCount A a t ฯ + if A t ฯ = a then 1 else 0Type uses (1)
Used by (7)
Actions: Source ยท Open Issue
Proof
by split_ifs with h ยท rw [โ h, pullCount_action_eq_pullCount_add_one] ยท rw [pullCount_eq_pullCount_of_action_ne h, add_zero]
pullCount_eq_sum๐
Learning.pullCount_eq_sumNo docstring.
Learning.pullCount_eq_sum.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (t : โ) (ฯ : ฮฉ) : pullCount A a t ฯ = โ s โ Finset.range t, if A s ฯ = a then 1 else 0Learning.pullCount_eq_sum.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (t : โ) (ฯ : ฮฉ) : pullCount A a t ฯ = โ s โ Finset.range t, if A s ฯ = a then 1 else 0
Code
lemma pullCount_eq_sum (a : ๐) (t : โ) (ฯ : ฮฉ) :
pullCount A a t ฯ = โ s โ range t, if A s ฯ = a then 1 else 0Type uses (1)
Used by (8)
Actions: Source ยท Open Issue
Proof
by simp [pullCount]
pullCount'_eq_sum๐
Learning.pullCount'_eq_sumNo docstring.
Learning.pullCount'_eq_sum.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} [DecidableEq ๐] (n : โ) (h : โฅ(Finset.Iic n) โ ๐ ร R) (a : ๐) : pullCount' n h a = โ s, if Prod.fst (h s) = a then 1 else 0Learning.pullCount'_eq_sum.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} [DecidableEq ๐] (n : โ) (h : โฅ(Finset.Iic n) โ ๐ ร R) (a : ๐) : pullCount' n h a = โ s, if Prod.fst (h s) = a then 1 else 0
Code
lemma pullCount'_eq_sum (n : โ) (h : Iic n โ ๐ ร R) (a : ๐) :
pullCount' n h a = โ s : Iic n, if (h s).1 = a then 1 else 0Type uses (1)
Actions: Source ยท Open Issue
Proof
by simp [pullCount']
pullCount_add_one_eq_pullCount'๐
Learning.pullCount_add_one_eq_pullCount'No docstring.
Learning.pullCount_add_one_eq_pullCount'.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {n : โ} {ฯ : ฮฉ} : pullCount A a (n + 1) ฯ = pullCount' n (fun i => (A (โi) ฯ, R' (โi) ฯ)) aLearning.pullCount_add_one_eq_pullCount'.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {n : โ} {ฯ : ฮฉ} : pullCount A a (n + 1) ฯ = pullCount' n (fun i => (A (โi) ฯ, R' (โi) ฯ)) a
Code
lemma pullCount_add_one_eq_pullCount' {n : โ} {ฯ : ฮฉ} :
pullCount A a (n + 1) ฯ = pullCount' n (fun i โฆ (A i ฯ, R' i ฯ)) aType uses (2)
Body uses (2)
Used by (5)
Actions: Source ยท Open Issue
Proof
by rw [pullCount_eq_sum, pullCount'_eq_sum] rw [Finset.sum_coe_sort (f := fun s โฆ if A s ฯ = a then 1 else 0) (Iic n)] congr with m simp only [mem_range, mem_Iic] grind
pullCount_eq_pullCount'๐
Learning.pullCount_eq_pullCount'No docstring.
Learning.pullCount_eq_pullCount'.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {n : โ} {ฯ : ฮฉ} (hn : n โ 0) : pullCount A a n ฯ = pullCount' (n - 1) (fun i => (A (โi) ฯ, R' (โi) ฯ)) aLearning.pullCount_eq_pullCount'.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {n : โ} {ฯ : ฮฉ} (hn : n โ 0) : pullCount A a n ฯ = pullCount' (n - 1) (fun i => (A (โi) ฯ, R' (โi) ฯ)) a
Code
lemma pullCount_eq_pullCount' {n : โ} {ฯ : ฮฉ} (hn : n โ 0) :
pullCount A a n ฯ = pullCount' (n - 1) (fun i โฆ (A i ฯ, R' i ฯ)) aType uses (2)
Body uses (1)
Used by (4)
Actions: Source ยท Open Issue
Proof
by cases n with | zero => exact absurd rfl hn | succ n => simp [pullCount_add_one_eq_pullCount' (R' := R')]
pullCount'_mono๐
Learning.pullCount'_monoNo docstring.
Learning.pullCount'_mono.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {ฯ : ฮฉ} {n m : โ} (hnm : n โค m) : pullCount' n (fun i => (A (โi) ฯ, R' (โi) ฯ)) a โค pullCount' m (fun i => (A (โi) ฯ, R' (โi) ฯ)) aLearning.pullCount'_mono.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {ฯ : ฮฉ} {n m : โ} (hnm : n โค m) : pullCount' n (fun i => (A (โi) ฯ, R' (โi) ฯ)) a โค pullCount' m (fun i => (A (โi) ฯ, R' (โi) ฯ)) a
Code
lemma pullCount'_mono {n m : โ} (hnm : n โค m) :
pullCount' n (fun i โฆ (A i ฯ, R' i ฯ)) a โค pullCount' m (fun i โฆ (A i ฯ, R' i ฯ)) aType uses (1)
Body uses (3)
Actions: Source ยท Open Issue
Proof
by rw [โ pullCount_add_one_eq_pullCount', โ pullCount_add_one_eq_pullCount'] exact pullCount_mono a (by lia) _
pullCount_le๐
Learning.pullCount_leNo docstring.
Learning.pullCount_le.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (t : โ) (ฯ : ฮฉ) : pullCount A a t ฯ โค tLearning.pullCount_le.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (t : โ) (ฯ : ฮฉ) : pullCount A a t ฯ โค t
Code
lemma pullCount_le (a : ๐) (t : โ) (ฯ : ฮฉ) : pullCount A a t ฯ โค t
Type uses (1)
Used by (4)
Actions: Source ยท Open Issue
Proof
(card_filter_le _ _).trans_eq (by simp)
pullCount_congr๐
Learning.pullCount_congrNo docstring.
Learning.pullCount_congr.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {n : โ} {ฯ ฯ' : ฮฉ} (h_eq : โ i โค n, A i ฯ = A i ฯ') : pullCount A a (n + 1) ฯ = pullCount A a (n + 1) ฯ'Learning.pullCount_congr.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {n : โ} {ฯ ฯ' : ฮฉ} (h_eq : โ i โค n, A i ฯ = A i ฯ') : pullCount A a (n + 1) ฯ = pullCount A a (n + 1) ฯ'
Code
lemma pullCount_congr {ฯ' : ฮฉ} (h_eq : โ i โค n, A i ฯ = A i ฯ') :
pullCount A a (n + 1) ฯ = pullCount A a (n + 1) ฯ'Type uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by unfold pullCount congr 1 with s simp only [mem_filter, mem_range, and_congr_right_iff] intro hs rw [Nat.lt_add_one_iff] at hs rw [h_eq s hs]
pullCount_lt_of_forall_ne๐
Learning.pullCount_lt_of_forall_neNo docstring.
Learning.pullCount_lt_of_forall_ne.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {n t : โ} {ฯ : ฮฉ} (h_lt : โ (s : โ), pullCount A a (s + 1) ฯ โ t) (ht : t โ 0) : pullCount A a n ฯ < tLearning.pullCount_lt_of_forall_ne.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {n t : โ} {ฯ : ฮฉ} (h_lt : โ (s : โ), pullCount A a (s + 1) ฯ โ t) (ht : t โ 0) : pullCount A a n ฯ < t
Code
lemma pullCount_lt_of_forall_ne (h_lt : โ s, pullCount A a (s + 1) ฯ โ t) (ht : t โ 0) :
pullCount A a n ฯ < tType uses (1)
Body uses (2)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
induction n with
| zero => simpa using ht.bot_lt
| succ n hn =>
specialize h_lt n
rw [pullCount_add_one] at h_lt โข
grind
exists_pullCount_eq_of_le๐
Learning.exists_pullCount_eq_of_leNo docstring.
Learning.exists_pullCount_eq_of_le.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {n t : โ} {ฯ : ฮฉ} (hnm : t โค pullCount A a (n + 1) ฯ) (ht : t โ 0) : โ s, pullCount A a (s + 1) ฯ = tLearning.exists_pullCount_eq_of_le.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {n t : โ} {ฯ : ฮฉ} (hnm : t โค pullCount A a (n + 1) ฯ) (ht : t โ 0) : โ s, pullCount A a (s + 1) ฯ = t
Code
lemma exists_pullCount_eq_of_le (hnm : t โค pullCount A a (n + 1) ฯ) (ht : t โ 0) :
โ s, pullCount A a (s + 1) ฯ = tType uses (1)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by by_contra! h_contra refine lt_irrefl (pullCount A a (n + 1) ฯ) ?_ refine lt_of_lt_of_le ?_ hnm exact pullCount_lt_of_forall_ne h_contra ht
pullCount_le_add๐
Learning.pullCount_le_addNo docstring.
Learning.pullCount_le_add.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (n C : โ) (ฯ : ฮฉ) : pullCount A a n ฯ โค C + 1 + โ s โ Finset.range n, Set.indicator {s | A s ฯ = a โง C < pullCount A a s ฯ} 1 sLearning.pullCount_le_add.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (n C : โ) (ฯ : ฮฉ) : pullCount A a n ฯ โค C + 1 + โ s โ Finset.range n, Set.indicator {s | A s ฯ = a โง C < pullCount A a s ฯ} 1 s
Code
lemma pullCount_le_add (a : ๐) (n C : โ) (ฯ : ฮฉ) :
pullCount A a n ฯ โค C + 1 +
โ s โ range n, {s | A s ฯ = a โง C < pullCount A a s ฯ}.indicator 1 sType uses (1)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
rw [pullCount_eq_sum]
calc โ s โ range n, if A s ฯ = a then 1 else 0
_ โค โ s โ range n, ({s | A s ฯ = a โง pullCount A a s ฯ โค C}.indicator 1 s +
{s | A s ฯ = a โง C < pullCount A a s ฯ}.indicator 1 s) := by
gcongr with s hs
simp [Set.indicator_apply]
grind
_ = โ s โ range n, {s | A s ฯ = a โง pullCount A a s ฯ โค C}.indicator 1 s +
โ s โ range n, {s | A s ฯ = a โง C < pullCount A a s ฯ}.indicator 1 s := by
rw [Finset.sum_add_distrib]
_ โค C + 1 + โ s โ range n, {s | A s ฯ = a โง C < pullCount A a s ฯ}.indicator 1 s := by
gcongr
have h_le n : โ s โ range n, {s | A s ฯ = a โง pullCount A a s ฯ โค C}.indicator 1 s โค
pullCount A a n ฯ := by
rw [pullCount_eq_sum]
gcongr with s hs
simp only [Set.indicator_apply, Set.mem_setOf_eq, Pi.one_apply]
grind
induction n with
| zero => simp
| succ n hn =>
rw [Finset.sum_range_succ]
rcases le_or_gt (pullCount A a n ฯ) C with h_pc | h_pc
ยท have hn' : โ s โ range n, {s | A s ฯ = a โง pullCount A a s ฯ โค C}.indicator 1 s โค C :=
(h_le n).trans h_pc
grw [hn']
gcongr
simp only [Set.indicator_apply, Set.mem_setOf_eq, Pi.one_apply]
grind
ยท refine le_trans ?_ hn
simp [h_pc]
measurable_pullCount๐
Learning.measurable_pullCountNo docstring.
Learning.measurable_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (a : ๐) (t : โ) : Measurable fun ฯ => pullCount A a t ฯLearning.measurable_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (a : ๐) (t : โ) : Measurable fun ฯ => pullCount A a t ฯ
Code
lemma measurable_pullCount [MeasurableSingletonClass ๐] (hA : โ n, Measurable (A n))
(a : ๐) (t : โ) :
Measurable (fun ฯ : ฮฉ โฆ pullCount A a t ฯ)Type uses (1)
Body uses (1)
Used by (15)
Actions: Source ยท Open Issue
Proof
by
simp_rw [pullCount_eq_sum]
have h_meas s : Measurable (fun ฯ : ฮฉ โฆ if A s ฯ = a then 1 else 0) := by
refine Measurable.ite ?_ (by fun_prop) (by fun_prop)
exact (measurableSet_singleton _).preimage (by fun_prop)
fun_prop
measurable_uncurry_pullCount๐
Learning.measurable_uncurry_pullCountNo docstring.
Learning.measurable_uncurry_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableEq ๐] (hA : โ (n : โ), Measurable (A n)) (t : โ) : Measurable fun p => pullCount A (Prod.snd p) t (Prod.fst p)Learning.measurable_uncurry_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableEq ๐] (hA : โ (n : โ), Measurable (A n)) (t : โ) : Measurable fun p => pullCount A (Prod.snd p) t (Prod.fst p)
Code
lemma measurable_uncurry_pullCount [MeasurableEq ๐]
(hA : โ n, Measurable (A n)) (t : โ) :
Measurable (fun p : ฮฉ ร ๐ โฆ pullCount A p.2 t p.1)Type uses (1)
Body uses (1)
Used by (5)
Actions: Source ยท Open Issue
Proof
by
simp_rw [pullCount_eq_sum]
have h_meas s : Measurable (fun h : ฮฉ ร ๐ โฆ if A s h.1 = h.2 then 1 else 0) := by
refine Measurable.ite ?_ (by fun_prop) (by fun_prop)
exact measurableSet_eq_fun (by fun_prop) (by fun_prop)
fun_prop
measurable_uncurry_pullCount_comp๐
Learning.measurable_uncurry_pullCount_compNo docstring.
Learning.measurable_uncurry_pullCount_comp.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Countable ๐] [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) {f : ฮฉ โ ๐} (hf : Measurable f) {g : ฮฉ โ โ} (hg : Measurable g) : Measurable fun ฯ => pullCount A (f ฯ) (g ฯ) ฯLearning.measurable_uncurry_pullCount_comp.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Countable ๐] [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) {f : ฮฉ โ ๐} (hf : Measurable f) {g : ฮฉ โ โ} (hg : Measurable g) : Measurable fun ฯ => pullCount A (f ฯ) (g ฯ) ฯ
Code
lemma measurable_uncurry_pullCount_comp [Countable ๐] [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) {f : ฮฉ โ ๐} (hf : Measurable f) {g : ฮฉ โ โ} (hg : Measurable g) :
Measurable (fun ฯ โฆ pullCount A (f ฯ) (g ฯ) ฯ)Type uses (1)
Body uses (1)
Used by (6)
Actions: Source ยท Open Issue
Proof
by change Measurable ((fun aฯ โฆ pullCount A aฯ.1 (g aฯ.2) aฯ.2) โ fun ฯ โฆ (f ฯ, ฯ)) apply Measurable.comp _ (by fun_prop) refine measurable_from_prod_countable_right fun a โฆ ?_ change Measurable ((fun tฯ โฆ pullCount A a tฯ.1 tฯ.2) โ fun ฯ โฆ (g ฯ, ฯ)) apply Measurable.comp _ (by fun_prop) exact measurable_from_prod_countable_right (fun t โฆ measurable_pullCount hA a t)
measurable_pullCount'๐
Learning.measurable_pullCount'No docstring.
Learning.measurable_pullCount'.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} [DecidableEq ๐] [MeasurableSingletonClass ๐] (n : โ) (a : ๐) : Measurable fun h => pullCount' n h aLearning.measurable_pullCount'.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} [DecidableEq ๐] [MeasurableSingletonClass ๐] (n : โ) (a : ๐) : Measurable fun h => pullCount' n h a
Code
lemma measurable_pullCount' [MeasurableSingletonClass ๐] (n : โ) (a : ๐) :
Measurable (fun h : Iic n โ ๐ ร R โฆ pullCount' n h a)Type uses (1)
Body uses (1)
Actions: Source ยท Open Issue
Proof
by
simp_rw [pullCount'_eq_sum]
have h_meas s : Measurable (fun (h : Iic n โ ๐ ร R) โฆ if (h s).1 = a then 1 else 0) := by
refine Measurable.ite ?_ (by fun_prop) (by fun_prop)
exact (measurableSet_singleton _).preimage (by fun_prop)
fun_prop
measurable_uncurry_pullCount'๐
Learning.measurable_uncurry_pullCount'No docstring.
Learning.measurable_uncurry_pullCount'.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} [DecidableEq ๐] [MeasurableEq ๐] (n : โ) : Measurable fun p => pullCount' n (Prod.fst p) (Prod.snd p)Learning.measurable_uncurry_pullCount'.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} [DecidableEq ๐] [MeasurableEq ๐] (n : โ) : Measurable fun p => pullCount' n (Prod.fst p) (Prod.snd p)
Code
lemma measurable_uncurry_pullCount' [MeasurableEq ๐] (n : โ) :
Measurable (fun p : (Iic n โ ๐ ร R) ร ๐ โฆ pullCount' n p.1 p.2)Type uses (1)
Body uses (1)
Used by (3)
Actions: Source ยท Open Issue
Proof
by
simp_rw [pullCount'_eq_sum]
have h_meas s : Measurable (fun h : (Iic n โ ๐ ร R) ร ๐ โฆ if (h.1 s).1 = h.2 then 1 else 0) := by
refine Measurable.ite ?_ (by fun_prop) (by fun_prop)
exact measurableSet_eq_fun (by fun_prop) (by fun_prop)
fun_prop
adapted_pullCount_add_one๐
Learning.adapted_pullCount_add_oneNo docstring.
Learning.adapted_pullCount_add_one.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) : MeasureTheory.Adapted (IsAlgEnvSeq.filtration hA hR') fun n => pullCount A a (n + 1)Learning.adapted_pullCount_add_one.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) : MeasureTheory.Adapted (IsAlgEnvSeq.filtration hA hR') fun n => pullCount A a (n + 1)
Code
lemma adapted_pullCount_add_one [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) :
Adapted (IsAlgEnvSeq.filtration hA hR') (fun n โฆ pullCount A a (n + 1))Type uses (2)
Body uses (5)
Used by (3)
Actions: Source ยท Open Issue
Proof
by
intro n
have : pullCount A a (n + 1) = (fun h : Iic n โ ๐ ร R โฆ pullCount' n h a) โ
(history A R' n) := by
ext
exact pullCount_add_one_eq_pullCount'
rw [measurable_iff_comap_le]
simp_rw [IsAlgEnvSeq.filtration, this]
rw [โ measurable_iff_comap_le]
exact measurable_comp_comap _ (measurable_pullCount' n a)
stronglyAdapted_pullCount_add_one๐
Learning.stronglyAdapted_pullCount_add_oneNo docstring.
Learning.stronglyAdapted_pullCount_add_one.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) : MeasureTheory.StronglyAdapted (IsAlgEnvSeq.filtration hA hR') fun n => pullCount A a (n + 1)Learning.stronglyAdapted_pullCount_add_one.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) : MeasureTheory.StronglyAdapted (IsAlgEnvSeq.filtration hA hR') fun n => pullCount A a (n + 1)
Code
lemma stronglyAdapted_pullCount_add_one [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) :
StronglyAdapted (IsAlgEnvSeq.filtration hA hR') (fun n โฆ pullCount A a (n + 1))Type uses (2)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
(adapted_pullCount_add_one hA hR' a).stronglyAdapted
isPredictable_pullCount๐
Learning.isPredictable_pullCountNo docstring.
Learning.isPredictable_pullCount.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) : MeasureTheory.IsStronglyPredictable (IsAlgEnvSeq.filtration hA hR') (pullCount A a)Learning.isPredictable_pullCount.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) : MeasureTheory.IsStronglyPredictable (IsAlgEnvSeq.filtration hA hR') (pullCount A a)
Code
lemma isPredictable_pullCount [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) :
IsStronglyPredictable (IsAlgEnvSeq.filtration hA hR') (pullCount A a)Type uses (2)
Body uses (2)
Used by (1)
Actions: Source ยท Open Issue
Proof
by rw [IsStronglyPredictable.iff_measurable_add_one] refine โจ?_, stronglyAdapted_pullCount_add_one hA hR' aโฉ simp only [pullCount_zero] fun_prop
integrable_pullCount๐
Learning.integrable_pullCountNo docstring.
Learning.integrable_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (a : ๐) (n : โ) : MeasureTheory.Integrable (fun ฯ => โ(pullCount A a n ฯ)) PLearning.integrable_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (a : ๐) (n : โ) : MeasureTheory.Integrable (fun ฯ => โ(pullCount A a n ฯ)) P
Code
lemma integrable_pullCount [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (a : ๐) (n : โ) :
Integrable (fun ฯ โฆ (pullCount A a n ฯ : โ)) PType uses (1)
Body uses (2)
Actions: Source ยท Open Issue
Proof
by
refine integrable_of_le_of_le (gโ := 0) (gโ := fun _ โฆ n) (by fun_prop)
(ae_of_all _ fun ฯ โฆ by simp) (ae_of_all _ fun ฯ โฆ ?_) (integrable_const _) (integrable_const _)
simp only [Nat.cast_le]
exact pullCount_le a n ฯ
stepsUntil๐
Learning.stepsUntil
Number of steps until action a was pulled exactly m times.
Learning.stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (a : ๐) (m : โ) (ฯ : ฮฉ) : โโLearning.stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (a : ๐) (m : โ) (ฯ : ฮฉ) : โโ
Code
noncomputable
def stepsUntil (A : โ โ ฮฉ โ ๐) (a : ๐) (m : โ) (ฯ : ฮฉ) : โโ :=
sInf ((โ) '' {s | pullCount A a (s + 1) ฯ = m})Body uses (1)
Used by (46)
Actions: Source ยท Open Issue
stepsUntil_eq_top_iff๐
Learning.stepsUntil_eq_top_iffNo docstring.
Learning.stepsUntil_eq_top_iff.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} : stepsUntil A a m ฯ = โค โ โ (s : โ), pullCount A a (s + 1) ฯ โ mLearning.stepsUntil_eq_top_iff.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} : stepsUntil A a m ฯ = โค โ โ (s : โ), pullCount A a (s + 1) ฯ โ m
Code
lemma stepsUntil_eq_top_iff : stepsUntil A a m ฯ = โค โ โ s, pullCount A a (s + 1) ฯ โ m
Type uses (2)
Actions: Source ยท Open Issue
Proof
by simp [stepsUntil, sInf_eq_top]
stepsUntil_ne_top๐
Learning.stepsUntil_ne_topNo docstring.
Learning.stepsUntil_ne_top.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (h_exists : โ s, pullCount A a (s + 1) ฯ = m) : stepsUntil A a m ฯ โ โคLearning.stepsUntil_ne_top.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (h_exists : โ s, pullCount A a (s + 1) ฯ = m) : stepsUntil A a m ฯ โ โค
Code
lemma stepsUntil_ne_top (h_exists : โ s, pullCount A a (s + 1) ฯ = m) : stepsUntil A a m ฯ โ โค
Type uses (2)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by simpa [stepsUntil_eq_top_iff]
exists_pullCount_eq๐
Learning.exists_pullCount_eqNo docstring.
Learning.exists_pullCount_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (h' : stepsUntil A a m ฯ โ โค) : โ s, pullCount A a (s + 1) ฯ = mLearning.exists_pullCount_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (h' : stepsUntil A a m ฯ โ โค) : โ s, pullCount A a (s + 1) ฯ = m
Code
lemma exists_pullCount_eq (h' : stepsUntil A a m ฯ โ โค) :
โ s, pullCount A a (s + 1) ฯ = mType uses (2)
Body uses (1)
Used by (5)
Actions: Source ยท Open Issue
Proof
by by_contra! h_contra rw [โ stepsUntil_eq_top_iff] at h_contra simp [h_contra] at h'
stepsUntil_zero_of_ne๐
Learning.stepsUntil_zero_of_neNo docstring.
Learning.stepsUntil_zero_of_ne.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} (hka : A 0 ฯ โ a) : stepsUntil A a 0 ฯ = 0Learning.stepsUntil_zero_of_ne.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} (hka : A 0 ฯ โ a) : stepsUntil A a 0 ฯ = 0
Code
lemma stepsUntil_zero_of_ne (hka : A 0 ฯ โ a) : stepsUntil A a 0 ฯ = 0
Type uses (1)
Body uses (3)
Actions: Source ยท Open Issue
Proof
by unfold stepsUntil simp_rw [โ bot_eq_zero, sInf_eq_bot, bot_eq_zero] intro n hn refine โจ0, ?_, hnโฉ simp only [Set.mem_image, Set.mem_setOf_eq, Nat.cast_eq_zero, exists_eq_right, zero_add] rw [โ zero_add 1, pullCount_eq_pullCount_of_action_ne hka] simp
stepsUntil_zero_of_eq๐
Learning.stepsUntil_zero_of_eqNo docstring.
Learning.stepsUntil_zero_of_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} (hka : A 0 ฯ = a) : stepsUntil A a 0 ฯ = โคLearning.stepsUntil_zero_of_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} (hka : A 0 ฯ = a) : stepsUntil A a 0 ฯ = โค
Code
lemma stepsUntil_zero_of_eq (hka : A 0 ฯ = a) : stepsUntil A a 0 ฯ = โค
Type uses (1)
Body uses (5)
Actions: Source ยท Open Issue
Proof
by rw [stepsUntil_eq_top_iff] suffices 0 < pullCount A a 1 ฯ from fun _ โฆ (this.trans_le (monotone_pullCount _ _ (by lia))).ne' rw [โ hka, โ zero_add 1, pullCount_action_eq_pullCount_add_one] simp
stepsUntil_eq_dite๐
Learning.stepsUntil_eq_diteNo docstring.
Learning.stepsUntil_eq_dite.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (m : โ) (ฯ : ฮฉ) [Decidable (โ s, pullCount A a (s + 1) ฯ = m)] : stepsUntil A a m ฯ = if h : โ s, pullCount A a (s + 1) ฯ = m then โ(Nat.find h) else โคLearning.stepsUntil_eq_dite.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (m : โ) (ฯ : ฮฉ) [Decidable (โ s, pullCount A a (s + 1) ฯ = m)] : stepsUntil A a m ฯ = if h : โ s, pullCount A a (s + 1) ฯ = m then โ(Nat.find h) else โค
Code
lemma stepsUntil_eq_dite (a : ๐) (m : โ) (ฯ : ฮฉ)
[Decidable (โ s, pullCount A a (s + 1) ฯ = m)] :
stepsUntil A a m ฯ =
if h : โ s, pullCount A a (s + 1) ฯ = m then (Nat.find h : โโ) else โคType uses (2)
Used by (7)
Actions: Source ยท Open Issue
Proof
by
unfold stepsUntil
split_ifs with h'
ยท refine le_antisymm ?_ ?_
ยท refine sInf_le ?_
simpa using Nat.find_spec h'
ยท simp only [le_sInf_iff, Set.mem_image, Set.mem_setOf_eq, forall_exists_index, and_imp,
forall_apply_eq_imp_iffโ, Nat.cast_le, Nat.find_le_iff]
exact fun n hn โฆ โจn, le_rfl, hnโฉ
ยท push Not at h'
suffices {s | pullCount A a (s + 1) ฯ = m} = โ
by simp [this]
ext s
simpa using (h' s)
stepsUntil_eq_leastGE๐
Learning.stepsUntil_eq_leastGENo docstring.
Learning.stepsUntil_eq_leastGE.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {m : โ} (a : ๐) (hm : m โ 0) : stepsUntil A a m = MeasureTheory.leastGE (fun n ฯ => pullCount A a (n + 1) ฯ) mLearning.stepsUntil_eq_leastGE.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {m : โ} (a : ๐) (hm : m โ 0) : stepsUntil A a m = MeasureTheory.leastGE (fun n ฯ => pullCount A a (n + 1) ฯ) m
Code
lemma stepsUntil_eq_leastGE (a : ๐) (hm : m โ 0) :
stepsUntil A a m = leastGE (fun n (ฯ : ฮฉ) โฆ pullCount A a (n + 1) ฯ) mType uses (2)
Body uses (3)
Used by (2)
Actions: Source ยท Open Issue
Proof
by
classical
ext ฯ
rw [stepsUntil_eq_dite]
unfold leastGE hittingAfter
simp only [Nat.bot_eq_zero, zero_le, Set.mem_Ici, true_and, ENat.some_eq_coe]
have h_iff : (โ s, pullCount A a (s + 1) ฯ = m) โ (โ s, m โค pullCount A a (s + 1) ฯ) := by
refine โจfun โจs, hsโฉ โฆ โจs, hs.geโฉ, fun โจs, hsโฉ โฆ ?_โฉ
exact exists_pullCount_eq_of_le hs hm
by_cases h_exists : โ s, m โค pullCount A a (s + 1) ฯ
swap; ยท simp_rw [h_iff]; simp [h_exists]
rw [if_pos h_exists, dif_pos]
swap; ยท rwa [h_iff]
norm_cast
rw [Nat.find_eq_iff]
constructor
ยท apply le_antisymm
ยท by_contra! h_contra
obtain โจs, hsโฉ : โ s, pullCount A a (s + 1) ฯ = m := exists_pullCount_eq_of_le h_contra.le hm
rw [โ hs] at h_contra
refine h_contra.not_ge ?_
gcongr
exact csInf_le (by simp) (by simp)
ยท exact Nat.sInf_mem (s := {j | m โค pullCount A a (j + 1) ฯ}) h_exists
ยท intro n hn h_contra
refine hn.not_ge ?_
exact csInf_le (by simp) (by simp [h_contra])
stepsUntil_mono๐
Learning.stepsUntil_monoNo docstring.
Learning.stepsUntil_mono.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (ฯ : ฮฉ) {n m : โ} (hn : n โ 0) (hnm : n โค m) : stepsUntil A a n ฯ โค stepsUntil A a m ฯLearning.stepsUntil_mono.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (ฯ : ฮฉ) {n m : โ} (hn : n โ 0) (hnm : n โค m) : stepsUntil A a n ฯ โค stepsUntil A a m ฯ
Code
lemma stepsUntil_mono (a : ๐) (ฯ : ฮฉ) {n m : โ} (hn : n โ 0) (hnm : n โค m) :
stepsUntil A a n ฯ โค stepsUntil A a m ฯType uses (1)
Body uses (2)
Actions: Source ยท Open Issue
Proof
by rw [stepsUntil_eq_leastGE a hn, stepsUntil_eq_leastGE a (by lia)] simp_rw [leastGE] exact hittingAfter_anti (fun n ฯ โฆ (pullCount A a (n + 1) ฯ)) 0 (fun x โฆ by grind) ฯ
stepsUntil_pullCount_le๐
Learning.stepsUntil_pullCount_leNo docstring.
Learning.stepsUntil_pullCount_le.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (ฯ : ฮฉ) (a : ๐) (t : โ) : stepsUntil A a (pullCount A a (t + 1) ฯ) ฯ โค โtLearning.stepsUntil_pullCount_le.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (ฯ : ฮฉ) (a : ๐) (t : โ) : stepsUntil A a (pullCount A a (t + 1) ฯ) ฯ โค โt
Code
lemma stepsUntil_pullCount_le (ฯ : ฮฉ) (a : ๐) (t : โ) :
stepsUntil A a (pullCount A a (t + 1) ฯ) ฯ โค tType uses (2)
Used by (2)
Actions: Source ยท Open Issue
Proof
by rw [stepsUntil] exact csInf_le (OrderBot.bddBelow _) โจt, rfl, rflโฉ
stepsUntil_pullCount_eq๐
Learning.stepsUntil_pullCount_eqNo docstring.
Learning.stepsUntil_pullCount_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (ฯ : ฮฉ) (t : โ) : stepsUntil A (A t ฯ) (pullCount A (A t ฯ) (t + 1) ฯ) ฯ = โtLearning.stepsUntil_pullCount_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (ฯ : ฮฉ) (t : โ) : stepsUntil A (A t ฯ) (pullCount A (A t ฯ) (t + 1) ฯ) ฯ = โt
Code
lemma stepsUntil_pullCount_eq (ฯ : ฮฉ) (t : โ) :
stepsUntil A (A t ฯ) (pullCount A (A t ฯ) (t + 1) ฯ) ฯ = tType uses (2)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
apply le_antisymm (stepsUntil_pullCount_le ฯ (A t ฯ) t)
suffices โ t', pullCount A (A t ฯ) (t' + 1) ฯ = pullCount A (A t ฯ) t ฯ + 1 โ t โค t' by
simpa [stepsUntil, pullCount_action_eq_pullCount_add_one]
exact fun t' h' โฆ Nat.le_of_lt_succ ((monotone_pullCount (A t ฯ) ฯ).reflect_lt
(h' โธ lt_add_one _))
stepsUntil_one_of_eq๐
Learning.stepsUntil_one_of_eq
If we pull action a at time 0, the first time at which it is pulled once is 0.
Learning.stepsUntil_one_of_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} (hka : A 0 ฯ = a) : stepsUntil A a 1 ฯ = 0Learning.stepsUntil_one_of_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} (hka : A 0 ฯ = a) : stepsUntil A a 1 ฯ = 0
Code
lemma stepsUntil_one_of_eq (hka : A 0 ฯ = a) : stepsUntil A a 1 ฯ = 0
Type uses (1)
Body uses (3)
Used by (1)
Actions: Source ยท Open Issue
Proof
by classical have h_pull : pullCount A a 1 ฯ = 1 := by simp [pullCount_one, hka] have h_le := stepsUntil_pullCount_le (A := A) ฯ a 0 simpa [h_pull] using h_le
stepsUntil_eq_zero_iff๐
Learning.stepsUntil_eq_zero_iffNo docstring.
Learning.stepsUntil_eq_zero_iff.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} : stepsUntil A a m ฯ = 0 โ m = 0 โง A 0 ฯ โ a โจ m = 1 โง A 0 ฯ = aLearning.stepsUntil_eq_zero_iff.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} : stepsUntil A a m ฯ = 0 โ m = 0 โง A 0 ฯ โ a โจ m = 1 โง A 0 ฯ = a
Code
lemma stepsUntil_eq_zero_iff :
stepsUntil A a m ฯ = 0 โ (m = 0 โง A 0 ฯ โ a) โจ (m = 1 โง A 0 ฯ = a)Type uses (1)
Body uses (6)
Used by (3)
Actions: Source ยท Open Issue
Proof
by
classical
refine โจfun h' โฆ ?_, fun h' โฆ ?_โฉ
ยท have h_exists : โ s, pullCount A a (s + 1) ฯ = m := exists_pullCount_eq (by simp [h'])
simp only [stepsUntil_eq_dite, h_exists, โreduceDIte, Nat.cast_eq_zero, Nat.find_eq_zero,
zero_add] at h'
rw [pullCount_one] at h'
by_cases hka : A 0 ฯ = a <;> simp_all
ยท cases h' with
| inl h =>
rw [h.1, stepsUntil_zero_of_ne h.2]
| inr h =>
rw [h.1]
exact stepsUntil_one_of_eq h.2
action_stepsUntil๐
Learning.action_stepsUntilNo docstring.
Learning.action_stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (hm : m โ 0) (h_exists : โ s, pullCount A a (s + 1) ฯ = m) : A (ENat.toNat (stepsUntil A a m ฯ)) ฯ = aLearning.action_stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (hm : m โ 0) (h_exists : โ s, pullCount A a (s + 1) ฯ = m) : A (ENat.toNat (stepsUntil A a m ฯ)) ฯ = a
Code
lemma action_stepsUntil (hm : m โ 0) (h_exists : โ s, pullCount A a (s + 1) ฯ = m) :
A (stepsUntil A a m ฯ).toNat ฯ = aType uses (2)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
classical
simp only [stepsUntil_eq_dite, h_exists, โreduceDIte, ENat.toNat_coe]
have h_spec := Nat.find_spec h_exists
have h_spec' n := Nat.find_min h_exists (m := n)
by_cases h_zero : Nat.find h_exists = 0
ยท simp only [h_zero, zero_add, not_lt_zero, IsEmpty.forall_iff, implies_true] at *
by_contra h_ne
rw [โ zero_add 1, pullCount_eq_pullCount_of_action_ne h_ne] at h_spec
simp only [pullCount_zero] at h_spec
exact hm h_spec.symm
have h_pos : 0 < Nat.find h_exists := Nat.pos_of_ne_zero h_zero
by_contra h_ne
refine h_spec' (Nat.find h_exists - 1) ?_ ?_
ยท simp [h_pos]
rw [Nat.sub_add_cancel (by omega)]
rwa [โ pullCount_eq_pullCount_of_action_ne]
exact h_ne
action_eq_of_stepsUntil_eq_coe๐
Learning.action_eq_of_stepsUntil_eq_coeNo docstring.
Learning.action_eq_of_stepsUntil_eq_coe.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m n : โ} {ฯ : ฮฉ} (hm : m โ 0) (h : stepsUntil A a m ฯ = โn) : A n ฯ = aLearning.action_eq_of_stepsUntil_eq_coe.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m n : โ} {ฯ : ฮฉ} (hm : m โ 0) (h : stepsUntil A a m ฯ = โn) : A n ฯ = a
Code
lemma action_eq_of_stepsUntil_eq_coe (hm : m โ 0) (h : stepsUntil A a m ฯ = n) :
A n ฯ = aType uses (1)
Body uses (3)
Used by (2)
Actions: Source ยท Open Issue
Proof
by have : n = (stepsUntil A a m ฯ).toNat := by simp [h] rw [this] have h_exists : โ s, pullCount A a (s + 1) ฯ = m := exists_pullCount_eq (by simp [h]) exact action_stepsUntil hm h_exists
pullCount_stepsUntil_add_one๐
Learning.pullCount_stepsUntil_add_oneNo docstring.
Learning.pullCount_stepsUntil_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (h_exists : โ s, pullCount A a (s + 1) ฯ = m) : pullCount A a (ENat.toNat (stepsUntil A a m ฯ + 1)) ฯ = mLearning.pullCount_stepsUntil_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (h_exists : โ s, pullCount A a (s + 1) ฯ = m) : pullCount A a (ENat.toNat (stepsUntil A a m ฯ + 1)) ฯ = m
Code
lemma pullCount_stepsUntil_add_one (h_exists : โ s, pullCount A a (s + 1) ฯ = m) :
pullCount A a (stepsUntil A a m ฯ + 1).toNat ฯ = mType uses (2)
Body uses (1)
Used by (3)
Actions: Source ยท Open Issue
Proof
by classical have h_eq := stepsUntil_eq_dite (A := A) a m ฯ simp only [h_exists, โreduceDIte] at h_eq have h' := Nat.find_spec h_exists rw [h_eq] rw [ENat.toNat_add (by simp) (by simp)] simp only [ENat.toNat_coe, ENat.toNat_one] exact h'
pullCount_stepsUntil๐
Learning.pullCount_stepsUntilNo docstring.
Learning.pullCount_stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (hm : m โ 0) (h_exists : โ s, pullCount A a (s + 1) ฯ = m) : pullCount A a (ENat.toNat (stepsUntil A a m ฯ)) ฯ = m - 1Learning.pullCount_stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (hm : m โ 0) (h_exists : โ s, pullCount A a (s + 1) ฯ = m) : pullCount A a (ENat.toNat (stepsUntil A a m ฯ)) ฯ = m - 1
Code
lemma pullCount_stepsUntil (hm : m โ 0) (h_exists : โ s, pullCount A a (s + 1) ฯ = m) :
pullCount A a (stepsUntil A a m ฯ).toNat ฯ = m - 1Type uses (2)
Body uses (4)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
have h_action := action_eq_of_stepsUntil_eq_coe (A := A) (n := (stepsUntil A a m ฯ).toNat)
(a := a) (ฯ := ฯ) hm ?_
swap; ยท symm; simpa [stepsUntil_eq_top_iff]
have h_add_one := pullCount_stepsUntil_add_one h_exists
nth_rw 1 [โ h_action] at h_add_one
rw [ENat.toNat_add ?_ (by simp), ENat.toNat_one, pullCount_action_eq_pullCount_add_one]
at h_add_one
swap; ยท simpa [stepsUntil_eq_top_iff]
grind
pullCount_lt_of_le_stepsUntil๐
Learning.pullCount_lt_of_le_stepsUntilNo docstring.
Learning.pullCount_lt_of_le_stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) {n m : โ} (ฯ : ฮฉ) (h_exists : โ s, pullCount A a (s + 1) ฯ = m) (hn : โn < stepsUntil A a m ฯ) : pullCount A a (n + 1) ฯ < mLearning.pullCount_lt_of_le_stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) {n m : โ} (ฯ : ฮฉ) (h_exists : โ s, pullCount A a (s + 1) ฯ = m) (hn : โn < stepsUntil A a m ฯ) : pullCount A a (n + 1) ฯ < m
Code
lemma pullCount_lt_of_le_stepsUntil (a : ๐) {n m : โ} (ฯ : ฮฉ)
(h_exists : โ s, pullCount A a (s + 1) ฯ = m) (hn : n < stepsUntil A a m ฯ) :
pullCount A a (n + 1) ฯ < mType uses (2)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
classical
have h_eq := stepsUntil_eq_dite (A := A) a m ฯ
simp only [h_exists, โreduceDIte] at h_eq
rw [โ ENat.coe_toNat (stepsUntil_ne_top h_exists)] at hn
refine lt_of_le_of_ne ?_ ?_
ยท calc pullCount A a (n + 1) ฯ
_ โค pullCount A a (stepsUntil A a m ฯ + 1).toNat ฯ := by
refine monotone_pullCount a ฯ ?_
rw [ENat.toNat_add (stepsUntil_ne_top h_exists) (by simp)]
simp only [ENat.toNat_one, add_le_add_iff_right]
exact mod_cast hn.le
_ = m := pullCount_stepsUntil_add_one h_exists
ยท refine Nat.find_min h_exists (m := n) ?_
suffices n < (stepsUntil A a m ฯ).toNat by
rwa [h_eq, ENat.toNat_coe] at this
exact mod_cast hn
pullCount_eq_of_stepsUntil_eq_coe๐
Learning.pullCount_eq_of_stepsUntil_eq_coeNo docstring.
Learning.pullCount_eq_of_stepsUntil_eq_coe.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m n : โ} {ฯ : ฮฉ} (hm : m โ 0) (h : stepsUntil A a m ฯ = โn) : pullCount A a n ฯ = m - 1Learning.pullCount_eq_of_stepsUntil_eq_coe.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m n : โ} {ฯ : ฮฉ} (hm : m โ 0) (h : stepsUntil A a m ฯ = โn) : pullCount A a n ฯ = m - 1
Code
lemma pullCount_eq_of_stepsUntil_eq_coe {ฯ : ฮฉ} (hm : m โ 0)
(h : stepsUntil A a m ฯ = n) :
pullCount A a n ฯ = m - 1Type uses (2)
Body uses (2)
Actions: Source ยท Open Issue
Proof
by have : n = (stepsUntil A a m ฯ).toNat := by simp [h] rw [this, pullCount_stepsUntil hm] exact exists_pullCount_eq (by simp [h])
pullCount_add_one_eq_of_stepsUntil_eq_coe๐
Learning.pullCount_add_one_eq_of_stepsUntil_eq_coeNo docstring.
Learning.pullCount_add_one_eq_of_stepsUntil_eq_coe.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m n : โ} {ฯ : ฮฉ} (h : stepsUntil A a m ฯ = โn) : pullCount A a (n + 1) ฯ = mLearning.pullCount_add_one_eq_of_stepsUntil_eq_coe.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m n : โ} {ฯ : ฮฉ} (h : stepsUntil A a m ฯ = โn) : pullCount A a (n + 1) ฯ = m
Code
lemma pullCount_add_one_eq_of_stepsUntil_eq_coe {ฯ : ฮฉ}
(h : stepsUntil A a m ฯ = n) :
pullCount A a (n + 1) ฯ = mType uses (2)
Body uses (2)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
have : n + 1 = (stepsUntil A a m ฯ + 1).toNat := by
rw [ENat.toNat_add (by simp [h]) (by simp)]; simp [h]
rw [this, pullCount_stepsUntil_add_one]
exact exists_pullCount_eq (by simp [h])
stepsUntil_eq_iff๐
Learning.stepsUntil_eq_iffNo docstring.
Learning.stepsUntil_eq_iff.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (n : โ) : stepsUntil A a m ฯ = โn โ pullCount A a (n + 1) ฯ = m โง โ k < n, pullCount A a (k + 1) ฯ < mLearning.stepsUntil_eq_iff.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (n : โ) : stepsUntil A a m ฯ = โn โ pullCount A a (n + 1) ฯ = m โง โ k < n, pullCount A a (k + 1) ฯ < m
Code
lemma stepsUntil_eq_iff {ฯ : ฮฉ} (n : โ) :
stepsUntil A a m ฯ = n โ
pullCount A a (n + 1) ฯ = m โง (โ k < n, pullCount A a (k + 1) ฯ < m)Type uses (2)
Body uses (4)
Used by (2)
Actions: Source ยท Open Issue
Proof
by
refine โจfun h โฆ ?_, fun h โฆ ?_โฉ
ยท have h_exists : โ s, pullCount A a (s + 1) ฯ = m := exists_pullCount_eq (by simp [h])
refine โจpullCount_add_one_eq_of_stepsUntil_eq_coe h, fun k hk โฆ ?_โฉ
exact pullCount_lt_of_le_stepsUntil a ฯ h_exists (by rw [h]; exact mod_cast hk)
ยท classical
rw [stepsUntil_eq_dite a m ฯ, dif_pos โจn, h.1โฉ]
simp only [Nat.cast_inj]
rw [Nat.find_eq_iff]
exact โจh.1, fun k hk โฆ (h.2 k hk).neโฉ
stepsUntil_eq_iff'๐
Learning.stepsUntil_eq_iff'No docstring.
Learning.stepsUntil_eq_iff'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (hm : m โ 0) (n : โ) : stepsUntil A a m ฯ = โn โ A n ฯ = a โง pullCount A a n ฯ = m - 1Learning.stepsUntil_eq_iff'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m : โ} {ฯ : ฮฉ} (hm : m โ 0) (n : โ) : stepsUntil A a m ฯ = โn โ A n ฯ = a โง pullCount A a n ฯ = m - 1
Code
lemma stepsUntil_eq_iff' {ฯ : ฮฉ} (hm : m โ 0) (n : โ) :
stepsUntil A a m ฯ = n โ A n ฯ = a โง pullCount A a n ฯ = m - 1Type uses (2)
Body uses (5)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
by_cases hn : n = 0
ยท simp [hn, stepsUntil_eq_zero_iff, hm]
grind
rw [stepsUntil_eq_iff n]
refine โจfun โจh1, h2โฉ โฆ โจ?_, ?_โฉ, fun โจh1, h2โฉ โฆ โจ?_, fun k hk โฆ ?_โฉโฉ
ยท rw [pullCount_add_one] at h1
specialize h2 (n - 1) (by lia)
grind
ยท rw [pullCount_add_one] at h1
specialize h2 (n - 1) (by lia)
grind
ยท rw [pullCount_add_one, h1, h2]
grind
ยท rw [Nat.lt_iff_le_pred (by grind)]
rw [โ h2]
refine monotone_pullCount a ฯ ?_
grind
stepsUntil_eq_congr๐
Learning.stepsUntil_eq_congrNo docstring.
Learning.stepsUntil_eq_congr.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m n : โ} {ฯ ฯ' : ฮฉ} (h_eq : โ i โค n, A i ฯ = A i ฯ') : stepsUntil A a m ฯ = โn โ stepsUntil A a m ฯ' = โnLearning.stepsUntil_eq_congr.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {m n : โ} {ฯ ฯ' : ฮฉ} (h_eq : โ i โค n, A i ฯ = A i ฯ') : stepsUntil A a m ฯ = โn โ stepsUntil A a m ฯ' = โn
Code
lemma stepsUntil_eq_congr {ฯ' : ฮฉ} (h_eq : โ i โค n, A i ฯ = A i ฯ') :
stepsUntil A a m ฯ = n โ stepsUntil A a m ฯ' = nType uses (1)
Body uses (3)
Actions: Source ยท Open Issue
Proof
by
simp_rw [stepsUntil_eq_iff n]
congr! 1
ยท rw [pullCount_congr h_eq]
ยท congr! 3 with k hk
rw [pullCount_congr]
grind
isStoppingTime_stepsUntil๐
Learning.isStoppingTime_stepsUntilNo docstring.
Learning.isStoppingTime_stepsUntil.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {m : โ} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (hm : m โ 0) : MeasureTheory.IsStoppingTime (IsAlgEnvSeq.filtration hA hR') (stepsUntil A a m)Learning.isStoppingTime_stepsUntil.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {m : โ} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (hm : m โ 0) : MeasureTheory.IsStoppingTime (IsAlgEnvSeq.filtration hA hR') (stepsUntil A a m)
Code
lemma isStoppingTime_stepsUntil [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) (hm : m โ 0) :
IsStoppingTime (IsAlgEnvSeq.filtration hA hR') (stepsUntil A a m)Type uses (2)
Body uses (3)
Actions: Source ยท Open Issue
Proof
by
rw [stepsUntil_eq_leastGE _ hm]
refine StronglyAdapted.isStoppingTime_leastGE _ fun n โฆ ?_
suffices StronglyMeasurable[IsAlgEnvSeq.filtration hA hR' n] (pullCount A a (n + 1)) by
fun_prop
refine Measurable.stronglyMeasurable ?_
exact adapted_pullCount_add_one hA hR' a n
measurable_stepsUntil๐
Learning.measurable_stepsUntilNo docstring.
Learning.measurable_stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (a : ๐) (m : โ) : Measurable (stepsUntil A a m)Learning.measurable_stepsUntil.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (a : ๐) (m : โ) : Measurable (stepsUntil A a m)
Code
lemma measurable_stepsUntil [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (a : ๐) (m : โ) :
Measurable (stepsUntil A a m)Type uses (1)
Body uses (4)
Used by (4)
Actions: Source ยท Open Issue
Proof
by
classical
have h_union : {h' : ฮฉ | โ s, pullCount A a (s + 1) h' = m}
= โ s : โ, {h' | pullCount A a (s + 1) h' = m} := by ext; simp
have h_meas_set : MeasurableSet {h' : ฮฉ | โ s, pullCount A a (s + 1) h' = m} := by
rw [h_union]
refine MeasurableSet.iUnion fun s โฆ (measurableSet_singleton _).preimage ?_
exact measurable_pullCount hA a (s + 1)
suffices Measurable fun k โฆ if h : k โ {k' | โ s, pullCount A a (s + 1) k' = m}
then (Nat.find h : โโ) else โค by
convert this with ฯ
rw [stepsUntil_eq_dite a m ฯ]
rfl
refine Measurable.dite (s := {k' : ฮฉ | โ s, pullCount A a (s + 1) k' = m})
(f := fun x โฆ (Nat.find x.2 : โโ)) (g := fun _ โฆ โค) ?_ (by fun_prop) h_meas_set
refine Measurable.coe_nat_enat ?_
refine measurable_find _ fun k โฆ ?_
suffices MeasurableSet {x : ฮฉ | pullCount A a (k + 1) x = m} by
have : Subtype.val '' {x : {k' : ฮฉ |
โ s, pullCount A a (s + 1) k' = m} | pullCount A a (k + 1) (x : ฮฉ) = m}
= {x : ฮฉ | pullCount A a (k + 1) x = m} := by
ext x
simp only [Set.mem_setOf_eq, Set.coe_setOf, Set.mem_image, Subtype.exists, exists_and_left,
exists_prop, exists_eq_right_right, and_iff_left_iff_imp]
exact fun h โฆ โจ_, hโฉ
refine (MeasurableEmbedding.subtype_coe h_meas_set).measurableSet_image.mp ?_
rw [this]
exact (measurableSet_singleton _).preimage (by fun_prop)
exact (measurableSet_singleton _).preimage (by fun_prop)
measurable_stepsUntil'๐
Learning.measurable_stepsUntil'No docstring.
Learning.measurable_stepsUntil'.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (a : ๐) (m : โ) : Measurable fun ฯ => stepsUntil A a m (Prod.fst ฯ)Learning.measurable_stepsUntil'.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (a : ๐) (m : โ) : Measurable fun ฯ => stepsUntil A a m (Prod.fst ฯ)
Code
lemma measurable_stepsUntil' [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (a : ๐) (m : โ) :
Measurable (fun ฯ : ฮฉ ร (โ โ ๐ โ R) โฆ stepsUntil A a m ฯ.1)Type uses (1)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
(measurable_stepsUntil hA a m).comp measurable_fst
measurable_comap_indicator_stepsUntil_eq๐
Learning.measurable_comap_indicator_stepsUntil_eqNo docstring.
Learning.measurable_comap_indicator_stepsUntil_eq.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m n : โ) : Measurable (Set.indicator {ฯ | stepsUntil A a m ฯ = โn} fun x => 1)Learning.measurable_comap_indicator_stepsUntil_eq.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m n : โ) : Measurable (Set.indicator {ฯ | stepsUntil A a m ฯ = โn} fun x => 1)
Code
lemma measurable_comap_indicator_stepsUntil_eq [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) (m n : โ) :
Measurable[MeasurableSpace.comap
(fun ฯ : ฮฉ โฆ (history A R' (n-1) ฯ, A n ฯ)) inferInstance]
({ฯ | stepsUntil A a m ฯ = โn}.indicator fun _ โฆ 1)Type uses (2)
Body uses (8)
Used by (3)
Actions: Source ยท Open Issue
Proof
by
by_cases hm : m = 0
ยท simp only [hm]
by_cases hn : n = 0
ยท subst hn
simp only [CharP.cast_eq_zero, stepsUntil_eq_zero_iff, ne_eq, true_and, zero_ne_one,
false_and, or_false]
refine Measurable.indicator measurable_const ?_
refine (measurableSet_singleton _).compl.preimage ?_
rw [measurable_iff_comap_le, Prod.instMeasurableSpace, MeasurableSpace.comap_prodMk]
exact le_sup_of_le_right le_rfl
ยท have : {ฯ | stepsUntil A a 0 ฯ = n} = โ
:= by
ext ฯ
by_cases ha : A 0 ฯ = a
ยท simp [stepsUntil_zero_of_eq ha]
ยท simp only [Set.mem_setOf_eq, stepsUntil_zero_of_ne ha, Set.mem_empty_iff_false,
iff_false]
norm_cast
exact Ne.symm hn
simp [this]
simp_rw [stepsUntil_eq_iff' hm]
refine Measurable.indicator measurable_const ?_
refine ((measurableSet_singleton _).preimage ?_).inter ((measurableSet_singleton _).preimage ?_)
ยท rw [measurable_iff_comap_le, Prod.instMeasurableSpace, MeasurableSpace.comap_prodMk]
exact le_sup_of_le_right le_rfl
ยท rw [measurable_iff_comap_le, Prod.instMeasurableSpace, MeasurableSpace.comap_prodMk]
refine le_sup_of_le_left ?_
rw [โ measurable_iff_comap_le]
by_cases hn : n = 0
ยท simp only [hn, pullCount_zero]
exact measurable_const
have h_meas := adapted_pullCount_add_one hA hR' a (n - 1)
have : 1 โค n := by grind
convert h_meas using 1
ยท rfl
ยท simp [Nat.sub_add_cancel this]
measurable_indicator_stepsUntil_eq๐
Learning.measurable_indicator_stepsUntil_eqNo docstring.
Learning.measurable_indicator_stepsUntil_eq.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m n : โ) : Measurable (Set.indicator {ฯ | stepsUntil A a m ฯ = โn} fun x => 1)Learning.measurable_indicator_stepsUntil_eq.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m n : โ) : Measurable (Set.indicator {ฯ | stepsUntil A a m ฯ = โn} fun x => 1)
Code
lemma measurable_indicator_stepsUntil_eq [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) (m n : โ) :
Measurable ({ฯ : ฮฉ | stepsUntil A a m ฯ = โn}.indicator fun _ โฆ 1)Type uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by refine (measurable_comap_indicator_stepsUntil_eq hA hR' a m n).mono ?_ le_rfl refine Measurable.comap_le ?_ fun_prop
measurableSet_stepsUntil_eq_zero๐
Learning.measurableSet_stepsUntil_eq_zeroNo docstring.
Learning.measurableSet_stepsUntil_eq_zero.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (a : ๐) (m : โ) : MeasurableSet {ฯ | stepsUntil A a m ฯ = 0}Learning.measurableSet_stepsUntil_eq_zero.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (a : ๐) (m : โ) : MeasurableSet {ฯ | stepsUntil A a m ฯ = 0}
Code
lemma measurableSet_stepsUntil_eq_zero [MeasurableSingletonClass ๐] (a : ๐) (m : โ) :
MeasurableSet[MeasurableSpace.comap (A 0) inferInstance]
{ฯ : ฮฉ | stepsUntil A a m ฯ = 0}Type uses (1)
Body uses (1)
Used by (2)
Actions: Source ยท Open Issue
Proof
by
simp only [stepsUntil_eq_zero_iff (a := a) (m := m), ne_eq]
by_cases hm : m = 0
ยท simp only [hm, true_and, zero_ne_one, false_and, or_false]
refine (measurableSet_singleton _).compl.preimage ?_
rw [measurable_iff_comap_le]
by_cases hm1 : m = 1
swap; ยท simp [hm, hm1]
simp only [hm1, one_ne_zero, false_and, true_and, false_or]
refine (measurableSet_singleton _).preimage ?_
rw [measurable_iff_comap_le]
measurable_comap_indicator_stepsUntil_eq_zero๐
Learning.measurable_comap_indicator_stepsUntil_eq_zeroNo docstring.
Learning.measurable_comap_indicator_stepsUntil_eq_zero.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (a : ๐) (m : โ) : Measurable (Set.indicator {ฯ | stepsUntil A a m ฯ = 0} fun x => 1)Learning.measurable_comap_indicator_stepsUntil_eq_zero.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] (a : ๐) (m : โ) : Measurable (Set.indicator {ฯ | stepsUntil A a m ฯ = 0} fun x => 1)
Code
lemma measurable_comap_indicator_stepsUntil_eq_zero [MeasurableSingletonClass ๐] (a : ๐) (m : โ) :
Measurable[MeasurableSpace.comap (A 0) inferInstance]
({ฯ | stepsUntil A a m ฯ = 0}.indicator fun _ โฆ 1)Type uses (1)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by rw [measurable_indicator_const_iff] exact measurableSet_stepsUntil_eq_zero a m
measurableSet_stepsUntil_eq๐
Learning.measurableSet_stepsUntil_eqNo docstring.
Learning.measurableSet_stepsUntil_eq.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m n : โ) : MeasurableSet {ฯ | stepsUntil A a m ฯ = โn}Learning.measurableSet_stepsUntil_eq.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m n : โ) : MeasurableSet {ฯ | stepsUntil A a m ฯ = โn}
Code
lemma measurableSet_stepsUntil_eq [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) (m n : โ) :
MeasurableSet[MeasurableSpace.comap (fun ฯ : ฮฉ โฆ (history A R' (n-1) ฯ, A n ฯ))
inferInstance]
{ฯ : ฮฉ | stepsUntil A a m ฯ = โn}Type uses (2)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
let mProd := MeasurableSpace.comap
(fun ฯ : ฮฉ โฆ (history A R' (n-1) ฯ, A n ฯ)) inferInstance
suffices Measurable[mProd] ({ฯ | stepsUntil A a m ฯ = โn}.indicator fun x โฆ 1) by
rwa [measurable_indicator_const_iff] at this
exact measurable_comap_indicator_stepsUntil_eq hA hR' a m n
isStoppingTime_stepsUntil_filtrationAction๐
Learning.isStoppingTime_stepsUntil_filtrationAction
stepsUntil a m is a stopping time with respect to the filtration filtrationAction.
Learning.isStoppingTime_stepsUntil_filtrationAction.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m : โ) : MeasureTheory.IsStoppingTime (IsAlgEnvSeq.filtrationAction hA hR') (stepsUntil A a m)Learning.isStoppingTime_stepsUntil_filtrationAction.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m : โ) : MeasureTheory.IsStoppingTime (IsAlgEnvSeq.filtrationAction hA hR') (stepsUntil A a m)
Code
lemma isStoppingTime_stepsUntil_filtrationAction [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) (m : โ) :
IsStoppingTime (IsAlgEnvSeq.filtrationAction hA hR') (stepsUntil A a m)Type uses (2)
Body uses (4)
Actions: Source ยท Open Issue
Proof
by
refine isStoppingTime_of_measurableSet_eq fun n โฆ ?_
by_cases hn : n = 0
ยท subst hn
simp only [WithTop.coe_zero]
exact measurableSet_stepsUntil_eq_zero a m
ยท rw [IsAlgEnvSeq.filtrationAction_eq_comap _ hn]
exact measurableSet_stepsUntil_eq hA hR' a m n
rewardByCount๐
Learning.rewardByCount
Reward obtained when pulling action a for the m-th time.
If it is never pulled m times, the reward is given by the second component of ฯ, which in
applications will be indepedent with same law.
Learning.rewardByCount.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ R) (a : ๐) (m : โ) (ฯ : ฮฉ ร (โ โ ๐ โ R)) : RLearning.rewardByCount.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ R) (a : ๐) (m : โ) (ฯ : ฮฉ ร (โ โ ๐ โ R)) : R
Code
noncomputable def rewardByCount (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ R) (a : ๐) (m : โ) (ฯ : ฮฉ ร (โ โ ๐ โ R)) : R := match (stepsUntil A a m ฯ.1) with | โค => ฯ.2 m a | (n : โ) => R' n ฯ.1
Body uses (1)
Used by (15)
Actions: Source ยท Open Issue
rewardByCount_eq_ite๐
Learning.rewardByCount_eq_iteNo docstring.
Learning.rewardByCount_eq_ite.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} (a : ๐) (m : โ) (ฯ : ฮฉ ร (โ โ ๐ โ R)) : rewardByCount A R' a m ฯ = if stepsUntil A a m (Prod.fst ฯ) = โค then Prod.snd ฯ m a else R' (ENat.toNat (stepsUntil A a m (Prod.fst ฯ))) (Prod.fst ฯ)Learning.rewardByCount_eq_ite.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} (a : ๐) (m : โ) (ฯ : ฮฉ ร (โ โ ๐ โ R)) : rewardByCount A R' a m ฯ = if stepsUntil A a m (Prod.fst ฯ) = โค then Prod.snd ฯ m a else R' (ENat.toNat (stepsUntil A a m (Prod.fst ฯ))) (Prod.fst ฯ)
Code
lemma rewardByCount_eq_ite (a : ๐) (m : โ) (ฯ : ฮฉ ร (โ โ ๐ โ R)) :
rewardByCount A R' a m ฯ =
if (stepsUntil A a m ฯ.1) = โค then ฯ.2 m a else R' (stepsUntil A a m ฯ.1).toNat ฯ.1Type uses (2)
Used by (6)
Actions: Source ยท Open Issue
Proof
by unfold rewardByCount cases stepsUntil A a m ฯ.1 ยท simp; rfl ยท simp
rewardByCount_eq_add๐
Learning.rewardByCount_eq_addNo docstring.
Learning.rewardByCount_eq_add.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [AddMonoid R] (a : ๐) (m : โ) : rewardByCount A R' a m = (Set.indicator {ฯ | stepsUntil A a m (Prod.fst ฯ) โ โค} fun ฯ => R' (ENat.toNat (stepsUntil A a m (Prod.fst ฯ))) (Prod.fst ฯ)) + Set.indicator {ฯ | stepsUntil A a m (Prod.fst ฯ) = โค} fun ฯ => Prod.snd ฯ m aLearning.rewardByCount_eq_add.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [AddMonoid R] (a : ๐) (m : โ) : rewardByCount A R' a m = (Set.indicator {ฯ | stepsUntil A a m (Prod.fst ฯ) โ โค} fun ฯ => R' (ENat.toNat (stepsUntil A a m (Prod.fst ฯ))) (Prod.fst ฯ)) + Set.indicator {ฯ | stepsUntil A a m (Prod.fst ฯ) = โค} fun ฯ => Prod.snd ฯ m a
Code
lemma rewardByCount_eq_add [AddMonoid R] (a : ๐) (m : โ) :
rewardByCount A R' a m =
{ฯ : ฮฉ ร (โ โ ๐ โ R) | stepsUntil A a m ฯ.1 โ โค}.indicator
(fun ฯ โฆ R' (stepsUntil A a m ฯ.1).toNat ฯ.1)
+ {ฯ | stepsUntil A a m ฯ.1 = โค}.indicator (fun ฯ โฆ ฯ.2 m a)Type uses (2)
Body uses (1)
Actions: Source ยท Open Issue
Proof
by
ext ฯ
simp only [rewardByCount_eq_ite, ne_eq, Pi.add_apply, Set.indicator_apply, Set.mem_setOf_eq,
ite_not]
grind
rewardByCount_of_stepsUntil_eq_top๐
Learning.rewardByCount_of_stepsUntil_eq_topNo docstring.
Learning.rewardByCount_of_stepsUntil_eq_top.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {m : โ} {ฯ : ฮฉ ร (โ โ ๐ โ R)} (h : stepsUntil A a m (Prod.fst ฯ) = โค) : rewardByCount A R' a m ฯ = Prod.snd ฯ m aLearning.rewardByCount_of_stepsUntil_eq_top.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {m : โ} {ฯ : ฮฉ ร (โ โ ๐ โ R)} (h : stepsUntil A a m (Prod.fst ฯ) = โค) : rewardByCount A R' a m ฯ = Prod.snd ฯ m a
Code
lemma rewardByCount_of_stepsUntil_eq_top (h : stepsUntil A a m ฯ.1 = โค) :
rewardByCount A R' a m ฯ = ฯ.2 m aType uses (2)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by simp [rewardByCount_eq_ite, h]
rewardByCount_of_stepsUntil_ne_top๐
Learning.rewardByCount_of_stepsUntil_ne_topNo docstring.
Learning.rewardByCount_of_stepsUntil_ne_top.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {m : โ} {ฯ : ฮฉ ร (โ โ ๐ โ R)} (h : stepsUntil A a m (Prod.fst ฯ) โ โค) : rewardByCount A R' a m ฯ = R' (ENat.toNat (stepsUntil A a m (Prod.fst ฯ))) (Prod.fst ฯ)Learning.rewardByCount_of_stepsUntil_ne_top.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {m : โ} {ฯ : ฮฉ ร (โ โ ๐ โ R)} (h : stepsUntil A a m (Prod.fst ฯ) โ โค) : rewardByCount A R' a m ฯ = R' (ENat.toNat (stepsUntil A a m (Prod.fst ฯ))) (Prod.fst ฯ)
Code
lemma rewardByCount_of_stepsUntil_ne_top (h : stepsUntil A a m ฯ.1 โ โค) :
rewardByCount A R' a m ฯ = R' (stepsUntil A a m ฯ.1).toNat ฯ.1Type uses (2)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by simp [rewardByCount_eq_ite, h]
rewardByCount_eq_stoppedValue๐
Learning.rewardByCount_eq_stoppedValueNo docstring.
Learning.rewardByCount_eq_stoppedValue.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {m : โ} {ฯ : ฮฉ ร (โ โ ๐ โ R)} (h : stepsUntil A a m (Prod.fst ฯ) โ โค) : rewardByCount A R' a m ฯ = MeasureTheory.stoppedValue R' (stepsUntil A a m) (Prod.fst ฯ)Learning.rewardByCount_eq_stoppedValue.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {m : โ} {ฯ : ฮฉ ร (โ โ ๐ โ R)} (h : stepsUntil A a m (Prod.fst ฯ) โ โค) : rewardByCount A R' a m ฯ = MeasureTheory.stoppedValue R' (stepsUntil A a m) (Prod.fst ฯ)
Code
lemma rewardByCount_eq_stoppedValue (h : stepsUntil A a m ฯ.1 โ โค) :
rewardByCount A R' a m ฯ = stoppedValue R' (stepsUntil A a m) ฯ.1Type uses (2)
Body uses (1)
Actions: Source ยท Open Issue
Proof
by rw [rewardByCount_of_stepsUntil_ne_top h, stoppedValue] lift stepsUntil A a m ฯ.1 to โ using h with n simp
rewardByCount_of_stepsUntil_eq_coe๐
Learning.rewardByCount_of_stepsUntil_eq_coeNo docstring.
Learning.rewardByCount_of_stepsUntil_eq_coe.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {m n : โ} {ฯ : ฮฉ ร (โ โ ๐ โ R)} (h : stepsUntil A a m (Prod.fst ฯ) = โn) : rewardByCount A R' a m ฯ = R' n (Prod.fst ฯ)Learning.rewardByCount_of_stepsUntil_eq_coe.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} {a : ๐} {m n : โ} {ฯ : ฮฉ ร (โ โ ๐ โ R)} (h : stepsUntil A a m (Prod.fst ฯ) = โn) : rewardByCount A R' a m ฯ = R' n (Prod.fst ฯ)
Code
lemma rewardByCount_of_stepsUntil_eq_coe (h : stepsUntil A a m ฯ.1 = n) :
rewardByCount A R' a m ฯ = R' n ฯ.1Type uses (2)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by simp [rewardByCount_eq_ite, h]
rewardByCount_zero๐
Learning.rewardByCount_zeroThe value at 0 does not matter (it would be the "zeroth" reward). It should be considered a junk value.
Learning.rewardByCount_zero.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} (a : ๐) (ฯ : ฮฉ ร (โ โ ๐ โ R)) : rewardByCount A R' a 0 ฯ = if A 0 (Prod.fst ฯ) = a then Prod.snd ฯ 0 a else R' 0 (Prod.fst ฯ)Learning.rewardByCount_zero.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} (a : ๐) (ฯ : ฮฉ ร (โ โ ๐ โ R)) : rewardByCount A R' a 0 ฯ = if A 0 (Prod.fst ฯ) = a then Prod.snd ฯ 0 a else R' 0 (Prod.fst ฯ)
Code
lemma rewardByCount_zero (a : ๐) (ฯ : ฮฉ ร (โ โ ๐ โ R)) :
rewardByCount A R' a 0 ฯ = if A 0 ฯ.1 = a then ฯ.2 0 a else R' 0 ฯ.1Type uses (1)
Actions: Source ยท Open Issue
Proof
by rw [rewardByCount_eq_ite] by_cases ha : A 0 ฯ.1 = a ยท simp [ha, stepsUntil_zero_of_eq] ยท simp [stepsUntil_zero_of_ne, ha]
rewardByCount_pullCount_add_one_eq_reward๐
Learning.rewardByCount_pullCount_add_one_eq_rewardNo docstring.
Learning.rewardByCount_pullCount_add_one_eq_reward.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} (t : โ) (ฯ : ฮฉ ร (โ โ ๐ โ R)) : rewardByCount A R' (A t (Prod.fst ฯ)) (pullCount A (A t (Prod.fst ฯ)) t (Prod.fst ฯ) + 1) ฯ = R' t (Prod.fst ฯ)Learning.rewardByCount_pullCount_add_one_eq_reward.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} (t : โ) (ฯ : ฮฉ ร (โ โ ๐ โ R)) : rewardByCount A R' (A t (Prod.fst ฯ)) (pullCount A (A t (Prod.fst ฯ)) t (Prod.fst ฯ) + 1) ฯ = R' t (Prod.fst ฯ)
Code
lemma rewardByCount_pullCount_add_one_eq_reward (t : โ) (ฯ : ฮฉ ร (โ โ ๐ โ R)) :
rewardByCount A R' (A t ฯ.1) (pullCount A (A t ฯ.1) t ฯ.1 + 1) ฯ = R' t ฯ.1Type uses (2)
Used by (1)
Actions: Source ยท Open Issue
Proof
by rw [rewardByCount, โ pullCount_action_eq_pullCount_add_one, stepsUntil_pullCount_eq]
measurable_rewardByCount๐
Learning.measurable_rewardByCountNo docstring.
Learning.measurable_rewardByCount.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m : โ) : Measurable fun ฯ => rewardByCount A R' a m ฯLearning.measurable_rewardByCount.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ R} [MeasurableSingletonClass ๐] (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (m : โ) : Measurable fun ฯ => rewardByCount A R' a m ฯ
Code
lemma measurable_rewardByCount [MeasurableSingletonClass ๐]
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) (m : โ) :
Measurable (fun ฯ : ฮฉ ร (โ โ ๐ โ R) โฆ rewardByCount A R' a m ฯ)Type uses (1)
Body uses (4)
Used by (4)
Actions: Source ยท Open Issue
Proof
by
simp_rw [rewardByCount_eq_ite]
refine Measurable.ite ?_ ?_ ?_
ยท exact (measurableSet_singleton _).preimage <| measurable_stepsUntil' hA a m
ยท fun_prop
ยท change Measurable ((fun p : โ ร ฮฉ โฆ R' p.1 p.2)
โ (fun ฯ : ฮฉ ร (โ โ ๐ โ R) โฆ ((stepsUntil A a m ฯ.1).toNat, ฯ.1)))
have : Measurable fun ฯ : ฮฉ ร (โ โ ๐ โ R) โฆ ((stepsUntil A a m ฯ.1).toNat, ฯ.1) :=
(measurable_stepsUntil' hA a m).toNat.prodMk (by fun_prop)
refine Measurable.comp ?_ this
refine measurable_from_prod_countable_right fun n โฆ ?_
simp only
fun_prop
sum_pullCount_mul๐
Learning.sum_pullCount_mulNo docstring.
Learning.sum_pullCount_mul.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Fintype ๐] [Semiring R] (ฯ : ฮฉ) (f : ๐ โ R) (t : โ) : โ a, โ(pullCount A a t ฯ) * f a = โ s โ Finset.range t, f (A s ฯ)Learning.sum_pullCount_mul.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Fintype ๐] [Semiring R] (ฯ : ฮฉ) (f : ๐ โ R) (t : โ) : โ a, โ(pullCount A a t ฯ) * f a = โ s โ Finset.range t, f (A s ฯ)
Code
lemma sum_pullCount_mul [Fintype ๐] [Semiring R] (ฯ : ฮฉ) (f : ๐ โ R) (t : โ) :
โ a, pullCount A a t ฯ * f a = โ s โ range t, f (A s ฯ)Type uses (1)
Used by (2)
Actions: Source ยท Open Issue
Proof
by unfold pullCount classical simp_rw [card_eq_sum_ones] push_cast simp_rw [sum_mul, one_mul] exact sum_fiberwise' (range t) (A ยท ฯ) f
sum_pullCount๐
Learning.sum_pullCountNo docstring.
Learning.sum_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {t : โ} [Fintype ๐] {ฯ : ฮฉ} : โ a, pullCount A a t ฯ = tLearning.sum_pullCount.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {t : โ} [Fintype ๐] {ฯ : ฮฉ} : โ a, pullCount A a t ฯ = t
Code
lemma sum_pullCount [Fintype ๐] {ฯ : ฮฉ} : โ a, pullCount A a t ฯ = tType uses (1)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by suffices โ a, pullCount A a t ฯ * (1 : โ) = t by norm_cast at this; simpa rw [sum_pullCount_mul] simp
sum_comp_pullCount๐
Learning.sum_comp_pullCountNo docstring.
Learning.sum_comp_pullCount.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Fintype ๐] [AddCommMonoid R] (f : โ โ R) (t : โ) (ฯ : ฮฉ) : โ s โ Finset.range t, f (pullCount A (A s ฯ) s ฯ) = โ a, โ j โ Finset.range (pullCount A a t ฯ), f jLearning.sum_comp_pullCount.{u_1, u_2, u_3} {๐ : Type u_1} {R : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Fintype ๐] [AddCommMonoid R] (f : โ โ R) (t : โ) (ฯ : ฮฉ) : โ s โ Finset.range t, f (pullCount A (A s ฯ) s ฯ) = โ a, โ j โ Finset.range (pullCount A a t ฯ), f j
Code
lemma sum_comp_pullCount [Fintype ๐] [AddCommMonoid R] (f : โ โ R) (t : โ) (ฯ : ฮฉ) :
โ s โ range t, f (pullCount A (A s ฯ) s ฯ) = โ a, โ j โ range (pullCount A a t ฯ), f jType uses (1)
Body uses (2)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
induction t with
| zero => simp
| succ n ih =>
have hf : f (pullCount A (A n ฯ) n ฯ) =
โ a, if A n ฯ = a then f (pullCount A a n ฯ) else 0 := by simp
simp_rw [sum_range_succ, ih, hf, โ sum_add_distrib, pullCount_add_one]
congr 1 with a
split_ifs
ยท simp [sum_range_succ]
ยท simp
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
sumRewards'๐
Learning.sumRewards'
Sum of rewards of arm a up to (and including) time n.
Learning.sumRewards'.{u_1} {๐ : Type u_1} [DecidableEq ๐] (n : โ) (h : โฅ(Finset.Iic n) โ ๐ ร โ) (a : ๐) : โLearning.sumRewards'.{u_1} {๐ : Type u_1} [DecidableEq ๐] (n : โ) (h : โฅ(Finset.Iic n) โ ๐ ร โ) (a : ๐) : โ
Code
noncomputable def sumRewards' (n : โ) (h : Iic n โ ๐ ร โ) (a : ๐) := โ s, if (h s).1 = a then (h s).2 else 0
Used by (9)
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
empMean'๐
Learning.empMean'
Empirical mean of arm a at time n.
Learning.empMean'.{u_1} {๐ : Type u_1} [DecidableEq ๐] (n : โ) (h : โฅ(Finset.Iic n) โ ๐ ร โ) (a : ๐) : โLearning.empMean'.{u_1} {๐ : Type u_1} [DecidableEq ๐] (n : โ) (h : โฅ(Finset.Iic n) โ ๐ ร โ) (a : ๐) : โ
Code
noncomputable def empMean' (n : โ) (h : Iic n โ ๐ ร โ) (a : ๐) := (sumRewards' n h a) / (pullCount' n h a)
Body uses (2)
Used by (18)
Actions: Source ยท Open Issue
sumRewards_zero๐
Learning.sumRewards_zeroNo docstring.
Learning.sumRewards_zero.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} : sumRewards A R' a 0 = 0Learning.sumRewards_zero.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} : sumRewards A R' a 0 = 0
Code
lemma sumRewards_zero {R' : โ โ ฮฉ โ โ} : sumRewards A R' a 0 = 0Type uses (1)
Actions: Source ยท Open Issue
Proof
by ext; simp [sumRewards]
sumRewards_add_one๐
Learning.sumRewards_add_oneNo docstring.
Learning.sumRewards_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {t : โ} {ฯ : ฮฉ} {R' : โ โ ฮฉ โ โ} : sumRewards A R' a (t + 1) ฯ = sumRewards A R' a t ฯ + if A t ฯ = a then R' t ฯ else 0Learning.sumRewards_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {t : โ} {ฯ : ฮฉ} {R' : โ โ ฮฉ โ โ} : sumRewards A R' a (t + 1) ฯ = sumRewards A R' a t ฯ + if A t ฯ = a then R' t ฯ else 0
Code
lemma sumRewards_add_one {R' : โ โ ฮฉ โ โ} :
sumRewards A R' a (t + 1) ฯ = sumRewards A R' a t ฯ + if A t ฯ = a then R' t ฯ else 0Type uses (1)
Actions: Source ยท Open Issue
Proof
by unfold sumRewards rw [sum_range_succ]
sumRewards_eq_of_pullCount_eq๐
Learning.sumRewards_eq_of_pullCount_eqNo docstring.
Learning.sumRewards_eq_of_pullCount_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} {R' : โ โ ฮฉ โ โ} {s t : โ} (h_eq : pullCount A a s ฯ = pullCount A a t ฯ) : sumRewards A R' a s ฯ = sumRewards A R' a t ฯLearning.sumRewards_eq_of_pullCount_eq.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {ฯ : ฮฉ} {R' : โ โ ฮฉ โ โ} {s t : โ} (h_eq : pullCount A a s ฯ = pullCount A a t ฯ) : sumRewards A R' a s ฯ = sumRewards A R' a t ฯ
Code
lemma sumRewards_eq_of_pullCount_eq {R' : โ โ ฮฉ โ โ} {s t : โ}
(h_eq : pullCount A a s ฯ = pullCount A a t ฯ) :
sumRewards A R' a s ฯ = sumRewards A R' a t ฯType uses (2)
Actions: Source ยท Open Issue
Proof
by
wlog hst : s โค t
ยท have hts : t โค s := by lia
exact (this h_eq.symm hts).symm
induction t, hst using Nat.le_induction with
| base => rfl
| succ t hst' ih =>
have h_mono' : pullCount A a t ฯ โค pullCount A a (t + 1) ฯ := pullCount_mono a (Nat.le_succ t) ฯ
have h_eq_t : pullCount A a s ฯ = pullCount A a t ฯ :=
le_antisymm (pullCount_mono a hst' ฯ) (h_eq โธ h_mono')
have hne : A t ฯ โ a := by
intro ha
have h1 := ha โธ pullCount_action_eq_pullCount_add_one (A := A) t ฯ
lia
rw [sumRewards_add_one, if_neg hne, add_zero, ih h_eq_t]
sumRewards_eq_pullCount_mul_empMean๐
Learning.sumRewards_eq_pullCount_mul_empMeanNo docstring.
Learning.sumRewards_eq_pullCount_mul_empMean.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {t : โ} {R' : โ โ ฮฉ โ โ} {ฯ : ฮฉ} (h_pull : pullCount A a t ฯ โ 0) : sumRewards A R' a t ฯ = โ(pullCount A a t ฯ) * empMean A R' a t ฯLearning.sumRewards_eq_pullCount_mul_empMean.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {t : โ} {R' : โ โ ฮฉ โ โ} {ฯ : ฮฉ} (h_pull : pullCount A a t ฯ โ 0) : sumRewards A R' a t ฯ = โ(pullCount A a t ฯ) * empMean A R' a t ฯ
Code
lemma sumRewards_eq_pullCount_mul_empMean {R' : โ โ ฮฉ โ โ} {ฯ : ฮฉ}
(h_pull : pullCount A a t ฯ โ 0) :
sumRewards A R' a t ฯ = pullCount A a t ฯ * empMean A R' a t ฯType uses (3)
Used by (1)
Actions: Source ยท Open Issue
Proof
by unfold empMean; field_simp
sum_rewardByCount_eq_sumRewards๐
Learning.sum_rewardByCount_eq_sumRewardsNo docstring.
Learning.sum_rewardByCount_eq_sumRewards.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ โ} (a : ๐) (t : โ) (ฯ : ฮฉ ร (โ โ ๐ โ โ)) : โ m โ Finset.Icc 1 (pullCount A a t (Prod.fst ฯ)), rewardByCount A R' a m ฯ = sumRewards A R' a t (Prod.fst ฯ)Learning.sum_rewardByCount_eq_sumRewards.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {R' : โ โ ฮฉ โ โ} (a : ๐) (t : โ) (ฯ : ฮฉ ร (โ โ ๐ โ โ)) : โ m โ Finset.Icc 1 (pullCount A a t (Prod.fst ฯ)), rewardByCount A R' a m ฯ = sumRewards A R' a t (Prod.fst ฯ)
Code
lemma sum_rewardByCount_eq_sumRewards {R' : โ โ ฮฉ โ โ} (a : ๐) (t : โ) (ฯ : ฮฉ ร (โ โ ๐ โ โ)) :
โ m โ Icc 1 (pullCount A a t ฯ.1), rewardByCount A R' a m ฯ = sumRewards A R' a t ฯ.1Type uses (3)
Body uses (3)
Actions: Source ยท Open Issue
Proof
by
induction t with
| zero => simp [pullCount, sumRewards]
| succ t ht =>
by_cases hta : A t ฯ.1 = a
ยท rw [โ hta] at ht โข
rw [pullCount_action_eq_pullCount_add_one, sum_Icc_succ_top (Nat.le_add_left 1 _), ht]
unfold sumRewards
rw [sum_range_succ, if_pos rfl, rewardByCount_pullCount_add_one_eq_reward]
ยท unfold sumRewards
rwa [pullCount_eq_pullCount_of_action_ne hta, sum_range_succ, if_neg hta, add_zero]
sumRewards_add_one_eq_sumRewards'๐
Learning.sumRewards_add_one_eq_sumRewards'No docstring.
Learning.sumRewards_add_one_eq_sumRewards'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} : sumRewards A R' a (n + 1) ฯ = sumRewards' n (fun i => (A (โi) ฯ, R' (โi) ฯ)) aLearning.sumRewards_add_one_eq_sumRewards'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} : sumRewards A R' a (n + 1) ฯ = sumRewards' n (fun i => (A (โi) ฯ, R' (โi) ฯ)) a
Code
lemma sumRewards_add_one_eq_sumRewards' {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} :
sumRewards A R' a (n + 1) ฯ = sumRewards' n (fun i โฆ (A i ฯ, R' i ฯ)) aType uses (2)
Used by (2)
Actions: Source ยท Open Issue
Proof
by unfold sumRewards sumRewards' rw [Finset.sum_coe_sort (f := fun s โฆ if A s ฯ = a then R' s ฯ else 0) (Iic n)] congr with m simp only [mem_range, mem_Iic] grind
sumRewards_eq_sumRewards'๐
Learning.sumRewards_eq_sumRewards'No docstring.
Learning.sumRewards_eq_sumRewards'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} (hn : n โ 0) : sumRewards A R' a n ฯ = sumRewards' (n - 1) (fun i => (A (โi) ฯ, R' (โi) ฯ)) aLearning.sumRewards_eq_sumRewards'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} (hn : n โ 0) : sumRewards A R' a n ฯ = sumRewards' (n - 1) (fun i => (A (โi) ฯ, R' (โi) ฯ)) a
Code
lemma sumRewards_eq_sumRewards' {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} (hn : n โ 0) :
sumRewards A R' a n ฯ = sumRewards' (n - 1) (fun i โฆ (A i ฯ, R' i ฯ)) aType uses (2)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by cases n with | zero => exact absurd rfl hn | succ n => simp [sumRewards_add_one_eq_sumRewards']
empMean_add_one_eq_empMean'๐
Learning.empMean_add_one_eq_empMean'No docstring.
Learning.empMean_add_one_eq_empMean'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} : empMean A R' a (n + 1) ฯ = empMean' n (fun i => (A (โi) ฯ, R' (โi) ฯ)) aLearning.empMean_add_one_eq_empMean'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} : empMean A R' a (n + 1) ฯ = empMean' n (fun i => (A (โi) ฯ, R' (โi) ฯ)) a
Code
lemma empMean_add_one_eq_empMean' {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} :
empMean A R' a (n + 1) ฯ = empMean' n (fun i โฆ (A i ฯ, R' i ฯ)) aBody uses (6)
Used by (1)
Actions: Source ยท Open Issue
Proof
by unfold empMean empMean' rw [sumRewards_add_one_eq_sumRewards', pullCount_add_one_eq_pullCount']
empMean_eq_empMean'๐
Learning.empMean_eq_empMean'No docstring.
Learning.empMean_eq_empMean'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} (hn : n โ 0) : empMean A R' a n ฯ = empMean' (n - 1) (fun i => (A (โi) ฯ, R' (โi) ฯ)) aLearning.empMean_eq_empMean'.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} (hn : n โ 0) : empMean A R' a n ฯ = empMean' (n - 1) (fun i => (A (โi) ฯ, R' (โi) ฯ)) a
Code
lemma empMean_eq_empMean' {R' : โ โ ฮฉ โ โ} {n : โ} {ฯ : ฮฉ} (hn : n โ 0) :
empMean A R' a n ฯ = empMean' (n - 1) (fun i โฆ (A i ฯ, R' i ฯ)) aBody uses (6)
Actions: Source ยท Open Issue
Proof
by unfold empMean empMean' rw [sumRewards_eq_sumRewards' hn, pullCount_eq_pullCount' hn]
sumRewards_sub_pullCount_mul_eq_sum๐
Learning.sumRewards_sub_pullCount_mul_eq_sumNo docstring.
Learning.sumRewards_sub_pullCount_mul_eq_sum.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {n : โ} {ฯ : ฮฉ} {R' : โ โ ฮฉ โ โ} (c : ๐ โ โ) : sumRewards A R' a (n + 1) ฯ - โ(pullCount A a (n + 1) ฯ) * c a = โ i โ Finset.range (n + 1), if A i ฯ = a then R' i ฯ - c a else 0Learning.sumRewards_sub_pullCount_mul_eq_sum.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} {a : ๐} {n : โ} {ฯ : ฮฉ} {R' : โ โ ฮฉ โ โ} (c : ๐ โ โ) : sumRewards A R' a (n + 1) ฯ - โ(pullCount A a (n + 1) ฯ) * c a = โ i โ Finset.range (n + 1), if A i ฯ = a then R' i ฯ - c a else 0
Code
lemma sumRewards_sub_pullCount_mul_eq_sum {R' : โ โ ฮฉ โ โ} (c : ๐ โ โ) :
sumRewards A R' a (n + 1) ฯ - pullCount A a (n + 1) ฯ * c a =
โ i โ range (n + 1), (if A i ฯ = a then R' i ฯ - c a else 0)Type uses (2)
Body uses (4)
Actions: Source ยท Open Issue
Proof
by
induction n with
| zero =>
simp_rw [sumRewards_add_one, pullCount_add_one]
simp only [sumRewards_zero, Pi.zero_apply, zero_add, pullCount_zero, Nat.cast_ite, Nat.cast_one,
CharP.cast_eq_zero, ite_mul, one_mul, zero_mul, range_one, sum_singleton]
grind
| succ n hn =>
simp_rw [sumRewards_add_one (t := n + 1), pullCount_add_one (t := n + 1)]
split_ifs with ha
ยท conv_rhs => rw [sum_range_succ]
simp only [Nat.cast_add, Nat.cast_one, ha, โreduceIte, add_mul, one_mul]
grind
ยท simp only [add_zero, hn]
conv_rhs => rw [sum_range_succ]
simp [ha]
measurable_sumRewards๐
Learning.measurable_sumRewardsNo docstring.
Learning.measurable_sumRewards.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ} (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (t : โ) : Measurable (sumRewards A R' a t)Learning.measurable_sumRewards.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ} (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (t : โ) : Measurable (sumRewards A R' a t)
Code
lemma measurable_sumRewards [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ}
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) (a : ๐) (t : โ) :
Measurable (sumRewards A R' a t)Type uses (1)
Used by (6)
Actions: Source ยท Open Issue
Proof
by
unfold sumRewards
have h_meas s : Measurable (fun h : ฮฉ โฆ if A s h = a then R' s h else 0) := by
refine Measurable.ite ?_ (by fun_prop) (by fun_prop)
exact (measurableSet_singleton _).preimage (by fun_prop)
fun_prop
measurable_uncurry_sumRewards_comp๐
Learning.measurable_uncurry_sumRewards_compNo docstring.
Learning.measurable_uncurry_sumRewards_comp.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Countable ๐] [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ} (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) {f : ฮฉ โ ๐} (hf : Measurable f) {g : ฮฉ โ โ} (hg : Measurable g) : Measurable fun ฯ => sumRewards A R' (f ฯ) (g ฯ) ฯLearning.measurable_uncurry_sumRewards_comp.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Countable ๐] [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ} (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) {f : ฮฉ โ ๐} (hf : Measurable f) {g : ฮฉ โ โ} (hg : Measurable g) : Measurable fun ฯ => sumRewards A R' (f ฯ) (g ฯ) ฯ
Code
lemma measurable_uncurry_sumRewards_comp [Countable ๐] [MeasurableSingletonClass ๐]
{R' : โ โ ฮฉ โ โ} (hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) {f : ฮฉ โ ๐}
(hf : Measurable f) {g : ฮฉ โ โ} (hg : Measurable g) :
Measurable (fun ฯ โฆ sumRewards A R' (f ฯ) (g ฯ) ฯ)Type uses (1)
Body uses (1)
Actions: Source ยท Open Issue
Proof
by change Measurable ((fun aฯ โฆ sumRewards A R' aฯ.1 (g aฯ.2) aฯ.2) โ fun ฯ โฆ (f ฯ, ฯ)) apply Measurable.comp _ (by fun_prop) refine measurable_from_prod_countable_right fun a โฆ ?_ change Measurable ((fun tฯ โฆ sumRewards A R' a tฯ.1 tฯ.2) โ fun ฯ โฆ (g ฯ, ฯ)) apply Measurable.comp _ (by fun_prop) exact measurable_from_prod_countable_right (fun t โฆ measurable_sumRewards hA hR' a t)
measurable_empMean๐
Learning.measurable_empMeanNo docstring.
Learning.measurable_empMean.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ} (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (n : โ) : Measurable (empMean A R' a n)Learning.measurable_empMean.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ} (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) (a : ๐) (n : โ) : Measurable (empMean A R' a n)
Code
lemma measurable_empMean [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ} (hA : โ n, Measurable (A n))
(hR' : โ n, Measurable (R' n)) (a : ๐) (n : โ) :
Measurable (empMean A R' a n)Type uses (1)
Body uses (4)
Used by (3)
Actions: Source ยท Open Issue
Proof
by unfold empMean fun_prop
measurable_uncurry_empMean_comp๐
Learning.measurable_uncurry_empMean_compNo docstring.
Learning.measurable_uncurry_empMean_comp.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Countable ๐] [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ} (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) {f : ฮฉ โ ๐} (hf : Measurable f) {g : ฮฉ โ โ} (hg : Measurable g) : Measurable fun ฯ => empMean A R' (f ฯ) (g ฯ) ฯLearning.measurable_uncurry_empMean_comp.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} [Countable ๐] [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ} (hA : โ (n : โ), Measurable (A n)) (hR' : โ (n : โ), Measurable (R' n)) {f : ฮฉ โ ๐} (hf : Measurable f) {g : ฮฉ โ โ} (hg : Measurable g) : Measurable fun ฯ => empMean A R' (f ฯ) (g ฯ) ฯ
Code
lemma measurable_uncurry_empMean_comp [Countable ๐] [MeasurableSingletonClass ๐] {R' : โ โ ฮฉ โ โ}
(hA : โ n, Measurable (A n)) (hR' : โ n, Measurable (R' n)) {f : ฮฉ โ ๐} (hf : Measurable f)
{g : ฮฉ โ โ} (hg : Measurable g) :
Measurable (fun ฯ โฆ empMean A R' (f ฯ) (g ฯ) ฯ)Type uses (1)
Body uses (4)
Actions: Source ยท Open Issue
Proof
by unfold empMean fun_prop
measurable_sumRewards'๐
Learning.measurable_sumRewards'No docstring.
Learning.measurable_sumRewards'.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] [MeasurableSingletonClass ๐] (n : โ) (a : ๐) : Measurable fun h => sumRewards' n h aLearning.measurable_sumRewards'.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] [MeasurableSingletonClass ๐] (n : โ) (a : ๐) : Measurable fun h => sumRewards' n h a
Code
lemma measurable_sumRewards' [MeasurableSingletonClass ๐] (n : โ) (a : ๐) :
Measurable (fun h โฆ sumRewards' n h a)Type uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
simp_rw [sumRewards']
have h_meas s : Measurable (fun (h : Iic n โ ๐ ร โ) โฆ if (h s).1 = a then (h s).2 else 0) := by
refine Measurable.ite ?_ (by fun_prop) (by fun_prop)
exact (measurableSet_singleton _).preimage (by fun_prop)
fun_prop
measurable_uncurry_sumRewards'๐
Learning.measurable_uncurry_sumRewards'No docstring.
Learning.measurable_uncurry_sumRewards'.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] [MeasurableEq ๐] (n : โ) : Measurable fun p => sumRewards' n (Prod.fst p) (Prod.snd p)Learning.measurable_uncurry_sumRewards'.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] [MeasurableEq ๐] (n : โ) : Measurable fun p => sumRewards' n (Prod.fst p) (Prod.snd p)
Code
lemma measurable_uncurry_sumRewards' [MeasurableEq ๐] (n : โ) :
Measurable (fun p : (Iic n โ ๐ ร โ) ร ๐ โฆ sumRewards' n p.1 p.2)Type uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
simp_rw [sumRewards']
have h_meas s : Measurable (fun p : (Iic n โ ๐ ร โ) ร ๐ โฆ
if (p.1 s).1 = p.2 then (p.1 s).2 else 0) := by
refine Measurable.ite ?_ (by fun_prop) (by fun_prop)
exact measurableSet_eq_fun (by fun_prop) (by fun_prop)
fun_prop
measurable_empMean'๐
Learning.measurable_empMean'No docstring.
Learning.measurable_empMean'.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] [MeasurableSingletonClass ๐] (n : โ) (a : ๐) : Measurable fun h => empMean' n h aLearning.measurable_empMean'.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] [MeasurableSingletonClass ๐] (n : โ) (a : ๐) : Measurable fun h => empMean' n h a
Code
lemma measurable_empMean' [MeasurableSingletonClass ๐] (n : โ) (a : ๐) :
Measurable (fun h โฆ empMean' n h a)Type uses (1)
Body uses (4)
Used by (2)
Actions: Source ยท Open Issue
Proof
by unfold empMean' fun_prop
measurable_uncurry_empMean'๐
Learning.measurable_uncurry_empMean'No docstring.
Learning.measurable_uncurry_empMean'.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] [MeasurableEq ๐] (n : โ) : Measurable fun p => empMean' n (Prod.fst p) (Prod.snd p)Learning.measurable_uncurry_empMean'.{u_1} {๐ : Type u_1} {m๐ : MeasurableSpace ๐} [DecidableEq ๐] [MeasurableEq ๐] (n : โ) : Measurable fun p => empMean' n (Prod.fst p) (Prod.snd p)
Code
lemma measurable_uncurry_empMean' [MeasurableEq ๐] (n : โ) :
Measurable (fun p : (Iic n โ ๐ ร โ) ร ๐ โฆ empMean' n p.1 p.2)Type uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by unfold empMean' fun_prop
isPredictable_sumRewards๐
Learning.IsAlgEnvSeq.isPredictable_sumRewardsNo docstring.
Learning.IsAlgEnvSeq.isPredictable_sumRewards.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.IsStronglyPredictable (filtration โฏ โฏ) (sumRewards A R' a)Learning.IsAlgEnvSeq.isPredictable_sumRewards.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.IsStronglyPredictable (filtration โฏ โฏ) (sumRewards A R' a)
Code
lemma IsAlgEnvSeq.isPredictable_sumRewards [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ}
{alg : Algorithm ๐ โ} {env : Environment ๐ โ}
(h : IsAlgEnvSeq A R' alg env P) (a : ๐) :
IsStronglyPredictable (IsAlgEnvSeq.filtration h.measurable_action h.measurable_feedback)
(sumRewards A R' a)Type uses (5)
Body uses (3)
Actions: Source ยท Open Issue
Proof
by
rw [IsStronglyPredictable.iff_measurable_add_one]
constructor
ยท simp only [sumRewards_zero]
fun_prop
refine fun n โฆ Measurable.stronglyMeasurable ?_
refine measurable_fun_sum _ fun i hi โฆ Measurable.ite ?_ ?_ (by fun_prop)
ยท refine (measurableSet_singleton a).preimage ?_
have h_meas_i := IsAlgEnvSeq.adapted_action h.measurable_action h.measurable_feedback i
simp only [mem_range] at hi
exact h_meas_i.mono ((IsAlgEnvSeq.filtration h.measurable_action h.measurable_feedback).mono
(by lia)) le_rfl
ยท have h_meas_i := IsAlgEnvSeq.adapted_feedback h.measurable_action h.measurable_feedback i
simp only [mem_range] at hi
exact h_meas_i.mono ((IsAlgEnvSeq.filtration h.measurable_action h.measurable_feedback).mono
(by lia)) le_rfl
stronglyAdapted_sumRewards_add_one๐
Learning.IsAlgEnvSeq.stronglyAdapted_sumRewards_add_oneNo docstring.
Learning.IsAlgEnvSeq.stronglyAdapted_sumRewards_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.StronglyAdapted (filtration โฏ โฏ) fun n => sumRewards A R' a (n + 1)Learning.IsAlgEnvSeq.stronglyAdapted_sumRewards_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.StronglyAdapted (filtration โฏ โฏ) fun n => sumRewards A R' a (n + 1)
Code
lemma IsAlgEnvSeq.stronglyAdapted_sumRewards_add_one [StandardBorelSpace ๐]
{R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ}
(h : IsAlgEnvSeq A R' alg env P) (a : ๐) :
StronglyAdapted (IsAlgEnvSeq.filtration h.measurable_action h.measurable_feedback)
(fun n โฆ sumRewards A R' a (n + 1))Type uses (5)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by have h_predictable := h.isPredictable_sumRewards a rw [IsStronglyPredictable.iff_measurable_add_one] at h_predictable exact h_predictable.2
adapted_sumRewards_add_one๐
Learning.IsAlgEnvSeq.adapted_sumRewards_add_oneNo docstring.
Learning.IsAlgEnvSeq.adapted_sumRewards_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.Adapted (filtration โฏ โฏ) fun n => sumRewards A R' a (n + 1)Learning.IsAlgEnvSeq.adapted_sumRewards_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.Adapted (filtration โฏ โฏ) fun n => sumRewards A R' a (n + 1)
Code
lemma IsAlgEnvSeq.adapted_sumRewards_add_one [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ}
{alg : Algorithm ๐ โ} {env : Environment ๐ โ}
(h : IsAlgEnvSeq A R' alg env P) (a : ๐) :
Adapted (IsAlgEnvSeq.filtration h.measurable_action h.measurable_feedback)
(fun n โฆ sumRewards A R' a (n + 1))Type uses (5)
Body uses (1)
Actions: Source ยท Open Issue
Proof
(h.stronglyAdapted_sumRewards_add_one a).adapted
divโ'๐
MeasureTheory.StronglyMeasurable.divโ'No docstring.
MeasureTheory.StronglyMeasurable.divโ'.{u_4, u_5} {๐ : Type u_4} {ฮฒ : Type u_5} {m๐ : MeasurableSpace ๐} [TopologicalSpace ฮฒ] [GroupWithZero ฮฒ] [ContinuousMul ฮฒ] [ContinuousInvโ ฮฒ] [TopologicalSpace.PseudoMetrizableSpace ฮฒ] [MeasurableSpace ฮฒ] [BorelSpace ฮฒ] [MeasurableSingletonClass ฮฒ] {f g : ๐ โ ฮฒ} (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) : StronglyMeasurable (f / g)MeasureTheory.StronglyMeasurable.divโ'.{u_4, u_5} {๐ : Type u_4} {ฮฒ : Type u_5} {m๐ : MeasurableSpace ๐} [TopologicalSpace ฮฒ] [GroupWithZero ฮฒ] [ContinuousMul ฮฒ] [ContinuousInvโ ฮฒ] [TopologicalSpace.PseudoMetrizableSpace ฮฒ] [MeasurableSpace ฮฒ] [BorelSpace ฮฒ] [MeasurableSingletonClass ฮฒ] {f g : ๐ โ ฮฒ} (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) : StronglyMeasurable (f / g)
Code
lemma _root_.MeasureTheory.StronglyMeasurable.divโ' {๐ ฮฒ : Type*}
{m๐ : MeasurableSpace ๐} [TopologicalSpace ฮฒ]
[GroupWithZero ฮฒ] [ContinuousMul ฮฒ] [ContinuousInvโ ฮฒ]
[TopologicalSpace.PseudoMetrizableSpace ฮฒ]
[MeasurableSpace ฮฒ] [BorelSpace ฮฒ] [MeasurableSingletonClass ฮฒ]
{f g : ๐ โ ฮฒ} (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
StronglyMeasurable (f / g)Used by (1)
Actions: Source ยท Open Issue
Proof
by
refine โจfun n => hf.approx n / (hg.approx n).restrict {x | g x โ 0}, fun x => ?_โฉ
have : MeasurableSet {x | g x โ 0} := ((MeasurableSet.singleton 0).preimage hg.measurable).compl
by_cases h : g x = 0
ยท simp_all only [ne_eq, SimpleFunc.coe_div, SimpleFunc.coe_restrict, Pi.div_apply, mem_setOf_eq,
not_true_eq_false, not_false_eq_true, indicator_of_notMem, _root_.div_zero]
exact tendsto_const_nhds
ยท simp_all only [ne_eq, SimpleFunc.coe_div, SimpleFunc.coe_restrict,
Pi.div_apply, mem_setOf_eq, not_false_eq_true, indicator_of_mem]
exact (hf.tendsto_approx x).div (hg.tendsto_approx x) h
isPredictable_empMean๐
Learning.IsAlgEnvSeq.isPredictable_empMeanNo docstring.
Learning.IsAlgEnvSeq.isPredictable_empMean.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.IsStronglyPredictable (filtration โฏ โฏ) (empMean A R' a)Learning.IsAlgEnvSeq.isPredictable_empMean.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.IsStronglyPredictable (filtration โฏ โฏ) (empMean A R' a)
Code
lemma IsAlgEnvSeq.isPredictable_empMean [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ}
{alg : Algorithm ๐ โ} {env : Environment ๐ โ}
(h : IsAlgEnvSeq A R' alg env P) (a : ๐) :
IsStronglyPredictable (IsAlgEnvSeq.filtration h.measurable_action h.measurable_feedback)
(empMean A R' a)Type uses (5)
Used by (1)
Actions: Source ยท Open Issue
Proof
by
unfold empMean
refine StronglyMeasurable.divโ' ?_ ?_
ยท exact h.isPredictable_sumRewards a
ยท have h_meas := (isPredictable_pullCount h.measurable_action h.measurable_feedback a).measurable
fun_prop
stronglyAdapted_empMean_add_one๐
Learning.IsAlgEnvSeq.stronglyAdapted_empMean_add_oneNo docstring.
Learning.IsAlgEnvSeq.stronglyAdapted_empMean_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.StronglyAdapted (filtration โฏ โฏ) fun n => empMean A R' a (n + 1)Learning.IsAlgEnvSeq.stronglyAdapted_empMean_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.StronglyAdapted (filtration โฏ โฏ) fun n => empMean A R' a (n + 1)
Code
lemma IsAlgEnvSeq.stronglyAdapted_empMean_add_one [StandardBorelSpace ๐]
{R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ}
(h : IsAlgEnvSeq A R' alg env P) (a : ๐) :
StronglyAdapted (IsAlgEnvSeq.filtration h.measurable_action h.measurable_feedback)
(fun n โฆ empMean A R' a (n + 1))Type uses (5)
Body uses (1)
Used by (1)
Actions: Source ยท Open Issue
Proof
by have h_predictable := h.isPredictable_empMean a rw [IsStronglyPredictable.iff_measurable_add_one] at h_predictable exact h_predictable.2
adapted_empMean_add_one๐
Learning.IsAlgEnvSeq.adapted_empMean_add_oneNo docstring.
Learning.IsAlgEnvSeq.adapted_empMean_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.Adapted (filtration โฏ โฏ) fun n => empMean A R' a (n + 1)Learning.IsAlgEnvSeq.adapted_empMean_add_one.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} {m๐ : MeasurableSpace ๐} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ โ ฮฉ โ ๐} [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ} {alg : Algorithm ๐ โ} {env : Environment ๐ โ} (h : IsAlgEnvSeq A R' alg env P) (a : ๐) : MeasureTheory.Adapted (filtration โฏ โฏ) fun n => empMean A R' a (n + 1)
Code
lemma IsAlgEnvSeq.adapted_empMean_add_one [StandardBorelSpace ๐] {R' : โ โ ฮฉ โ โ}
{alg : Algorithm ๐ โ} {env : Environment ๐ โ}
(h : IsAlgEnvSeq A R' alg env P) (a : ๐) :
Adapted (IsAlgEnvSeq.filtration h.measurable_action h.measurable_feedback)
(fun n โฆ empMean A R' a (n + 1))Type uses (5)
Body uses (1)
Actions: Source ยท Open Issue
Proof
(h.stronglyAdapted_empMean_add_one a).adapted
-
Learning.pullCount -
Learning.pullCount' -
Learning.pullCount_zero -
Learning.pullCount_zero_apply -
Learning.pullCount_one -
Learning.monotone_pullCount -
Learning.pullCount_mono -
Learning.pullCount_action_eq_pullCount_add_one -
Learning.pullCount_eq_pullCount_of_action_ne -
Learning.pullCount_add_one -
Learning.pullCount_eq_sum -
Learning.pullCount'_eq_sum -
Learning.pullCount_add_one_eq_pullCount' -
Learning.pullCount_eq_pullCount' -
Learning.pullCount'_mono -
Learning.pullCount_le -
Learning.pullCount_congr -
Learning.pullCount_lt_of_forall_ne -
Learning.exists_pullCount_eq_of_le -
Learning.pullCount_le_add -
Learning.measurable_pullCount -
Learning.measurable_uncurry_pullCount -
Learning.measurable_uncurry_pullCount_comp -
Learning.measurable_pullCount' -
Learning.measurable_uncurry_pullCount' -
Learning.adapted_pullCount_add_one -
Learning.stronglyAdapted_pullCount_add_one -
Learning.isPredictable_pullCount -
Learning.integrable_pullCount -
Learning.stepsUntil -
Learning.stepsUntil_eq_top_iff -
Learning.stepsUntil_ne_top -
Learning.exists_pullCount_eq -
Learning.stepsUntil_zero_of_ne -
Learning.stepsUntil_zero_of_eq -
Learning.stepsUntil_eq_dite -
Learning.stepsUntil_eq_leastGE -
Learning.stepsUntil_mono -
Learning.stepsUntil_pullCount_le -
Learning.stepsUntil_pullCount_eq -
Learning.stepsUntil_one_of_eq -
Learning.stepsUntil_eq_zero_iff -
Learning.action_stepsUntil -
Learning.action_eq_of_stepsUntil_eq_coe -
Learning.pullCount_stepsUntil_add_one -
Learning.pullCount_stepsUntil -
Learning.pullCount_lt_of_le_stepsUntil -
Learning.pullCount_eq_of_stepsUntil_eq_coe -
Learning.pullCount_add_one_eq_of_stepsUntil_eq_coe -
Learning.stepsUntil_eq_iff -
Learning.stepsUntil_eq_iff' -
Learning.stepsUntil_eq_congr -
Learning.isStoppingTime_stepsUntil -
Learning.measurable_stepsUntil -
Learning.measurable_stepsUntil' -
Learning.measurable_comap_indicator_stepsUntil_eq -
Learning.measurable_indicator_stepsUntil_eq -
Learning.measurableSet_stepsUntil_eq_zero -
Learning.measurable_comap_indicator_stepsUntil_eq_zero -
Learning.measurableSet_stepsUntil_eq -
Learning.isStoppingTime_stepsUntil_filtrationAction -
Learning.rewardByCount -
Learning.rewardByCount_eq_ite -
Learning.rewardByCount_eq_add -
Learning.rewardByCount_of_stepsUntil_eq_top -
Learning.rewardByCount_of_stepsUntil_ne_top -
Learning.rewardByCount_eq_stoppedValue -
Learning.rewardByCount_of_stepsUntil_eq_coe -
Learning.rewardByCount_zero -
Learning.rewardByCount_pullCount_add_one_eq_reward -
Learning.measurable_rewardByCount -
Learning.sum_pullCount_mul -
Learning.sum_pullCount -
Learning.sum_comp_pullCount -
Learning.sumRewards -
Learning.sumRewards' -
Learning.empMean -
Learning.empMean' -
Learning.sumRewards_zero -
Learning.sumRewards_add_one -
Learning.sumRewards_eq_of_pullCount_eq -
Learning.sumRewards_eq_pullCount_mul_empMean -
Learning.sum_rewardByCount_eq_sumRewards -
Learning.sumRewards_add_one_eq_sumRewards' -
Learning.sumRewards_eq_sumRewards' -
Learning.empMean_add_one_eq_empMean' -
Learning.empMean_eq_empMean' -
Learning.sumRewards_sub_pullCount_mul_eq_sum -
Learning.measurable_sumRewards -
Learning.measurable_uncurry_sumRewards_comp -
Learning.measurable_empMean -
Learning.measurable_uncurry_empMean_comp -
Learning.measurable_sumRewards' -
Learning.measurable_uncurry_sumRewards' -
Learning.measurable_empMean' -
Learning.measurable_uncurry_empMean' -
Learning.IsAlgEnvSeq.isPredictable_sumRewards -
Learning.IsAlgEnvSeq.stronglyAdapted_sumRewards_add_one -
Learning.IsAlgEnvSeq.adapted_sumRewards_add_one -
MeasureTheory.StronglyMeasurable.divโ' -
Learning.IsAlgEnvSeq.isPredictable_empMean -
Learning.IsAlgEnvSeq.stronglyAdapted_empMean_add_one -
Learning.IsAlgEnvSeq.adapted_empMean_add_one