LeanMachineLearning exposition

Bandits.sumRewards_eq_comp๐Ÿ”—

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

sumRewards_eq_comp๐Ÿ”—

LemmaBandits.sumRewards_eq_comp

No docstring.

๐Ÿ”—theorem
Bandits.sumRewards_eq_comp.{u_1, u_2} {๐“ : Type u_1} {ฮฉ : Type u_2} [DecidableEq ๐“] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {R : โ„• โ†’ ฮฉ โ†’ โ„} {n : โ„•} {a : ๐“} : Learning.sumRewards A R a n = (fun p => โˆ‘ i โˆˆ Finset.range n, if Prod.fst (p i) = a then Prod.snd (p i) else 0) โˆ˜ Learning.trajectory A R
Bandits.sumRewards_eq_comp.{u_1, u_2} {๐“ : Type u_1} {ฮฉ : Type u_2} [DecidableEq ๐“] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {R : โ„• โ†’ ฮฉ โ†’ โ„} {n : โ„•} {a : ๐“} : Learning.sumRewards A R a n = (fun p => โˆ‘ i โˆˆ Finset.range n, if Prod.fst (p i) = a then Prod.snd (p i) else 0) โˆ˜ Learning.trajectory A R

Code

lemma sumRewards_eq_comp :
    sumRewards A R a n =
     (fun p โ†ฆ โˆ‘ i โˆˆ range n, if (p i).1 = a then (p i).2 else 0) โˆ˜ (trajectory A R)
Type uses (2)
Used by (2)

Actions: Source ยท Open Issue

Proof
by
  ext
  simp [sumRewards, trajectory]

Dependency graph

Type dependencies (2)

sumRewards๐Ÿ”—

DefinitionLearning.sumRewards

Sum of rewards obtained when pulling action a up to time t (exclusive).

๐Ÿ”—def
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

trajectory๐Ÿ”—

DefinitionLearning.trajectory

A random variable that gives the sequence of action-feedback pairs.

๐Ÿ”—def
Learning.trajectory.{u_1, u_2, u_3} {๐“ : Type u_1} {๐“จ : Type u_2} {ฮฉ : Type u_3} (A : โ„• โ†’ ฮฉ โ†’ ๐“) (Y : โ„• โ†’ ฮฉ โ†’ ๐“จ) (ฯ‰ : ฮฉ) : โ„• โ†’ ๐“ ร— ๐“จ
Learning.trajectory.{u_1, u_2, u_3} {๐“ : Type u_1} {๐“จ : Type u_2} {ฮฉ : Type u_3} (A : โ„• โ†’ ฮฉ โ†’ ๐“) (Y : โ„• โ†’ ฮฉ โ†’ ๐“จ) (ฯ‰ : ฮฉ) : โ„• โ†’ ๐“ ร— ๐“จ

Code

def trajectory (A : โ„• โ†’ ฮฉ โ†’ ๐“) (Y : โ„• โ†’ ฮฉ โ†’ ๐“จ) (ฯ‰ : ฮฉ) : โ„• โ†’ ๐“ ร— ๐“จ := fun n โ†ฆ (A n ฯ‰, Y n ฯ‰)
Used by (18)

Actions: Source ยท Open Issue