LeanMachineLearning exposition

Learning.stepsUntil_pullCount_eq🔗

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.

Minimal Lean file

stepsUntil_pullCount_eq🔗

LemmaLearning.stepsUntil_pullCount_eq

No docstring.

🔗theorem
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) ω) ω = t
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) ω) ω = t

Code

lemma stepsUntil_pullCount_eq (ω : Ω) (t : ℕ) :
    stepsUntil A (A t ω) (pullCount A (A t ω) (t + 1) ω) ω = t
Type uses (2)
Body uses (3)
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 _))

Dependency graph

Type dependencies (2)

stepsUntil🔗

DefinitionLearning.stepsUntil

Number of steps until action a was pulled exactly m times.

🔗def
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🔗

DefinitionLearning.pullCount

Number of times action a was chosen up to time t (excluding t).

🔗def
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))
Used by (146)

Actions: Source · Open Issue