Learning.sum_comp_pullCount
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.
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]
· simpDependency 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