Learning.stepsUntil_eq_iff'
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.
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 ω ?_
grindDependency graph
Type dependencies (2)
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
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