LeanMachineLearning

Learning.rewardByCountUntil_apply_of_pullCount_le🔗

Lemma

From the authors

If action a was pulled at most m times before time t, then the entry (a, m) of rewardByCountUntil A R' t ω is the entry (m + 1, a) of the auxiliary array.

Types
  • 𝓐 : Type u_2DecidableEq 𝓐
  • R : Type u_3
  • Ω : Type u_4
Given
  • A : → Ω → 𝓐
  • R' : → Ω → R
  • a : 𝓐
  • m :
  • t :
  • ω : Ω × ( → 𝓐 → R)
Assuming
  • h : pullCount A a t ω.1m
Then
rewardByCountUntil A R' t ω (a, m) = ω.2 (m + 1) a
Code
lemma rewardByCountUntil_apply_of_pullCount_le (h : pullCount A a t ω.1 ≤ m) :
    rewardByCountUntil A R' t ω (a, m) = ω.2 (m + 1) a
Proof
by
  induction t with
  | zero => rfl
  | succ t ih =>
    rw [rewardByCountUntil_add_one, Function.update_of_ne,
      ih ((pullCount_mono a (Nat.le_succ t) _).trans h)]
    intro hp
    obtain ⟨rfl, hm⟩ := Prod.mk.inj hp
    rw [pullCount_action_eq_pullCount_add_one] at h
    omega

New in v4.34.0-rc2-31-g21d7e67 (2026-09-07), and its meaning has not changed since.

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, 25 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.