LeanMachineLearning

Learning.eventually_rewardByCountUntil_eq๐Ÿ”—

Lemma

From the authors

For each entry, rewardByCountUntil A R' t ฯ‰ coincides with rewardByCount for t large enough.

Types
  • ๐“ : Type u_2DecidableEq ๐“
  • R : Type u_3
  • ฮฉ : Type u_4
Given
  • A : โ„• โ†’ ฮฉ โ†’ ๐“
  • R' : โ„• โ†’ ฮฉ โ†’ R
  • ฯ‰ : ฮฉ ร— (โ„• โ†’ ๐“ โ†’ R)
  • p : ๐“ ร— โ„•
Then
โˆ€แถ  (t : โ„•) in Filter.atTop, rewardByCountUntil A R' t ฯ‰ p = rewardByCount A R' p.1 (p.2 + 1) ฯ‰
f.Eventually p or โˆ€แถ  x in f, p x mean that {x | p x} โˆˆ f.
Code
lemma eventually_rewardByCountUntil_eq (ฯ‰ : ฮฉ ร— (โ„• โ†’ ๐“ โ†’ R)) (p : ๐“ ร— โ„•) :
    โˆ€แถ  t in Filter.atTop,
      rewardByCountUntil A R' t ฯ‰ p = rewardByCount A R' p.1 (p.2 + 1) ฯ‰
Proof
by
  obtain โŸจa, mโŸฉ := p
  by_cases h : โˆƒ t, m < pullCount A a t ฯ‰.1
  ยท obtain โŸจt, htโŸฉ := h
    filter_upwards [Filter.eventually_ge_atTop t] with s hs
    exact rewardByCountUntil_apply_of_lt_pullCount (ht.trans_le (pullCount_mono a hs ฯ‰.1))
  ยท push Not at h
    refine Filter.Eventually.of_forall fun t โ†ฆ ?_
    rw [rewardByCountUntil_apply_of_pullCount_le (h t), rewardByCount_of_stepsUntil_eq_top]
    rw [stepsUntil_eq_top_iff]
    exact fun s โ†ฆ ((h (s + 1)).trans_lt (Nat.lt_succ_self m)).ne

Meaning last changed in v4.34.0-rc2-76-g565f652 (2026-09-10).

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: 4 project declarations, 44 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.