Bandits.ArrayModel.truncRowPullCount
From the authors
truncRow at the number of pulls of a before time n: the rewards of action a that have
not been observed before time n are replaced. The history before time n is measurable with
respect to this function (see measurable_hist_truncRowPullCount), and on the event
pullCount (action alg) a n = m it coincides with truncRow a m.
-
๐ : Type u_1m๐ : MeasurableSpace ๐A measurable space is a space equipped with a ฯ-algebra.Nonempty ๐StandardBorelSpace ๐A standard Borel space is a measurable space arising as the Borel sets of some Polish topology.DecidableEq ๐ -
๐ก : Type u_2m๐ก : MeasurableSpace ๐ก
-
alg : Learning.Algorithm Unit ๐ ๐กA stochastic, sequential algorithm. -
a : ๐ -
n : โ -
ฯ : probSpace ๐ ๐กProbability space for the array model of stochastic bandits.
probSpace ๐ ๐กtruncRow a (Learning.pullCount (action alg) a n ฯ) ฯMeasurableSpace : Type u_6 โ Type u_6A measurable space is a space equipped with a ฯ-algebra.
Nonempty : Sort u โ Prop`Nonempty ฮฑ` is a typeclass that says that `ฮฑ` is not an empty type, that is, there exists an element in the type. It differs from `Inhabited ฮฑ` in that `Nonempty ฮฑ` is a `Prop`, which means that it does not actually carry an element of `ฮฑ`, only a proof that *there exists* such an element. Given `Nonempty ฮฑ`, you can construct an element of `ฮฑ` *nonconstructively* using `Classical.choice`.
StandardBorelSpace : (ฮฑ : Type u_1) โ [MeasurableSpace ฮฑ] โ PropA standard Borel space is a measurable space arising as the Borel sets of some Polish topology. This is useful in situations where a space has no natural topology or the natural topology in a space is non-Polish. To endow a standard Borel space `ฮฑ` with a compatible Polish topology, use `letI := upgradeStandardBorel ฮฑ`. One can then use `eq_borel_upgradeStandardBorel ฮฑ` to rewrite the `MeasurableSpace ฮฑ` instance to `borel ฮฑ t`, where `t` is the new topology.
DecidableEq : Sort u โ Sort (max 1 u)Propositional equality is `Decidable` for all elements of a type. In other words, an instance of `DecidableEq ฮฑ` is a means of deciding the proposition `a = b` is for all `a b : ฮฑ`.
Learning.Algorithm : (๐ : Type u_5) โ
(๐ : Type u_6) โ
(๐จ : Type u_7) โ [MeasurableSpace ๐] โ [MeasurableSpace ๐] โ [MeasurableSpace ๐จ] โ Type (max (max u_5 u_6) u_7)A stochastic, sequential algorithm. At each round, it sees an observation in `๐`, then takes an action in `๐`, and finally receives feedback in `๐จ`. The action is a random function of the past rounds and the current observation.Go to its page
Unit : TypeThe canonical type with one element. This element is written `()`. `Unit` has a number of uses: * It can be used to model control flow that returns from a function call without providing other information. * Monadic actions that return `Unit` have side effects without computing values. * In polymorphic types, it can be used to indicate that no data is to be stored in a particular field.
Nat : TypeThe natural numbers, starting at zero. This type is special-cased by both the kernel and the compiler, and overridden with an efficient implementation. Both use a fast arbitrary-precision arithmetic library (usually [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
Bandits.ArrayModel.probSpace : Type u_1 โ Type u_2 โ Type (max u_1 u_2)Probability space for the array model of stochastic bandits.Go to its page
Bandits.ArrayModel.truncRow : {๐ : Type u_1} โ
{๐ก : Type u_2} โ [DecidableEq ๐] โ ๐ โ โ โ Bandits.ArrayModel.probSpace ๐ ๐ก โ Bandits.ArrayModel.probSpace ๐ ๐กModification of `ฯ` in which the rewards of action `a` are read only up to index `m - 1`: in row `a` of the reward array, the entry at index `i` is kept if `i < m` and replaced by the entry at index `m + 1 + i` otherwise. The result does not depend on the coordinate `(m, a)` of the array.Go to its page
Learning.pullCount : {๐ : Type u_2} โ {ฮฉ : Type u_4} โ [DecidableEq ๐] โ (โ โ ฮฉ โ ๐) โ ๐ โ โ โ ฮฉ โ โNumber of times action `a` was chosen up to time `t` (excluding `t`).Go to its page
Bandits.ArrayModel.action : {๐ : Type u_1} โ
{๐ก : Type u_2} โ
{m๐ : MeasurableSpace ๐} โ
{m๐ก : MeasurableSpace ๐ก} โ
[Nonempty ๐] โ
[StandardBorelSpace ๐] โ
[DecidableEq ๐] โ Learning.Algorithm Unit ๐ ๐ก โ โ โ Bandits.ArrayModel.probSpace ๐ ๐ก โ ๐Action taken at time `n` in the array model.Go to its page
Code
noncomputable
def truncRowPullCount (alg : Algorithm Unit ๐ ๐ก) (a : ๐) (n : โ) (ฯ : probSpace ๐ ๐ก) :
probSpace ๐ ๐ก :=
truncRow a (pullCount (action alg) a n ฯ) ฯMeaning last changed in v4.35.0-rc2-1-g61e506b (2026-09-22), the 5th 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: 12 project declarations, 65 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.