Learning.pullCount_le_add
This page has the declaration's own card below, then its dependency graph, then a card for each dependency (type dependencies first, then the rest of the transitive closure). For a theorem, the graph and the dependency cards only follow its statement's dependencies (its proof is replaced by sorry, so what it proves doesn't depend on how); for everything else, both the type and the body/value are followed, since their content is part of what later declarations build on.
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]Dependency graph
Type dependencies (1)
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