LeanMachineLearning

Learning.sumRewards_eq_of_pullCount_eq๐Ÿ”—

Lemma

No docstring.

๐Ÿ”—theorem
Learning.sumRewards_eq_of_pullCount_eq.{u_1, u_2, u_3} {๐“ : Type u_1} {๐“จ : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐“] [AddCommGroup ๐“จ] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {a : ๐“} {ฯ‰ : ฮฉ} {R : โ„• โ†’ ฮฉ โ†’ ๐“จ} {s t : โ„•} (h_eq : pullCount A a s ฯ‰ = pullCount A a t ฯ‰) : sumRewards A R a s ฯ‰ = sumRewards A R a t ฯ‰
Learning.sumRewards_eq_of_pullCount_eq.{u_1, u_2, u_3} {๐“ : Type u_1} {๐“จ : Type u_2} {ฮฉ : Type u_3} [DecidableEq ๐“] [AddCommGroup ๐“จ] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {a : ๐“} {ฯ‰ : ฮฉ} {R : โ„• โ†’ ฮฉ โ†’ ๐“จ} {s t : โ„•} (h_eq : pullCount A a s ฯ‰ = pullCount A a t ฯ‰) : sumRewards A R a s ฯ‰ = sumRewards A R a t ฯ‰

Code

lemma sumRewards_eq_of_pullCount_eq {R : โ„• โ†’ ฮฉ โ†’ ๐“จ} {s t : โ„•}
    (h_eq : pullCount A a s ฯ‰ = pullCount A a t ฯ‰) :
    sumRewards A R a s ฯ‰ = sumRewards A R a t ฯ‰
Proof
by
  wlog hst : s โ‰ค t
  ยท have hts : t โ‰ค s := by lia
    exact (this h_eq.symm hts).symm
  induction t, hst using Nat.le_induction with
  | base => rfl
  | succ t hst' ih =>
    have h_mono' : pullCount A a t ฯ‰ โ‰ค pullCount A a (t + 1) ฯ‰ := pullCount_mono a (Nat.le_succ t) ฯ‰
    have h_eq_t : pullCount A a s ฯ‰ = pullCount A a t ฯ‰ :=
      le_antisymm (pullCount_mono a hst' ฯ‰) (h_eq โ–ธ h_mono')
    have hne : A t ฯ‰ โ‰  a := by
      intro ha
      have h1 := ha โ–ธ pullCount_action_eq_pullCount_add_one (A := A) t ฯ‰
      lia
    rw [sumRewards_add_one, ite_eq_right hne, add_zero, ih h_eq_t]

Actions: Source ยท Open Issue

Meaning last changed in v4.34.0-rc2-14-gf86702d (2026-08-25), the 2th recorded change.

Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file ยท open it in the Lean web editor.

Dependency graph

Audit surface: 2 project declarations, 17 external constants

โœ“ Proved: no sorry anywhere in its closure

This is the tool's own reading of one build's recorded axioms, and it is not robust against an author who wants it to pass. Checking meant to be relied on should go through Comparator, which replays the proof through the kernel from an export against an explicit list of permitted axioms.