Learning.rewardByCountUntil
From the authors
Array of rewards by count, truncated at time t: the entry (a, m) is the reward received at
the (m + 1)-th pull of action a if that pull happened before time t, and the entry
(m + 1, a) of the auxiliary array ฯ.2 otherwise.
This is an auxiliary definition used to prove results about the distribution of rewardByCount.
It is defined recursively: at time t, the
entry (A t, pullCount A (A t) t) is replaced by the reward R' t.
See rewardByCountUntil_apply_of_lt_pullCount and rewardByCountUntil_apply_of_pullCount_le.
Code
noncomputable
def rewardByCountUntil (A : โ โ ฮฉ โ ๐) (R' : โ โ ฮฉ โ R) : โ โ ฮฉ ร (โ โ ๐ โ R) โ ๐ ร โ โ R
| 0, ฯ => fun p โฆ ฯ.2 (p.2 + 1) p.1
| t + 1, ฯ => Function.update (rewardByCountUntil A R' t ฯ)
(A t ฯ.1, pullCount A (A t ฯ.1) t ฯ.1) (R' t ฯ.1)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: 1 project declarations, 23 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.