Bandits.indepFun_rewardByCount
From the authors
Two distinct rewards by count are independent.
-
๐ : Type u_1m๐ : MeasurableSpace ๐A measurable space is a space equipped with a ฯ-algebra.DecidableEq ๐MeasurableSingletonClass ๐A typeclass mixin forMeasurableSpaces such that each singleton is measurable.Countable ๐A typeฮฑis countable if there exists an injective mapฮฑ โ โ. -
ฮฉ : Type u_2mฮฉ : MeasurableSpace ฮฉ
-
O : โ โ ฮฉ โ Unit -
A : โ โ ฮฉ โ ๐ -
R : โ โ ฮฉ โ โ -
P : MeasureTheory.Measure ฮฉA measure is defined to be an outer measure that is countably additive on measurable sets, with the additional assumption that the outer measure is the canonical extension of the restricted measure.MeasureTheory.IsProbabilityMeasure PA measureฮผis called a probability measure ifฮผ univ = 1. -
alg : Learning.Algorithm Unit ๐ โA stochastic, sequential algorithm. -
ฮฝ : ProbabilityTheory.Kernel ๐ โA kernel from a measurable spaceฮฑto another measurable spaceฮฒis a measurable functionฮบ : ฮฑ โ Measure ฮฒ.ProbabilityTheory.IsMarkovKernel ฮฝA kernel is a Markov kernel if every measure in its image is a probability measure. -
a : ๐ -
b : ๐ -
m : โ -
n : โ
-
h : Learning.IsAlgEnvSeq O A R alg (Learning.stationaryEnv ฮฝ) PAn algorithm-environment sequence: a sequence of observations, actions and feedbacks generated by an algorithm interacting with an environment. -
hm : m โ 0 -
hn : n โ 0 -
hne : (a, m) โ (b, n)
ProbabilityTheory.IndepFun (Learning.rewardByCount A R a m) (Learning.rewardByCount A R b n) (P.prod (streamMeasure ฮฝ))Two functions are independent if the two measurable space structures they generate are independent.MeasurableSpace : Type u_6 โ Type u_6A measurable space is a space equipped with a ฯ-algebra.
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 : ฮฑ`.
MeasurableSingletonClass : (ฮฑ : Type u_6) โ [MeasurableSpace ฮฑ] โ PropA typeclass mixin for `MeasurableSpace`s such that each singleton is measurable.
Countable : Sort u โ PropA type `ฮฑ` is countable if there exists an injective map `ฮฑ โ โ`.
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.
Real : TypeThe type `โ` of real numbers constructed as equivalence classes of Cauchy sequences of rational numbers.
MeasureTheory.IsProbabilityMeasure : {ฮฑ : Type u_1} โ {m0 : MeasurableSpace ฮฑ} โ MeasureTheory.Measure ฮฑ โ PropA measure `ฮผ` is called a probability measure if `ฮผ univ = 1`.
MeasureTheory.Measure : (ฮฑ : Type u_5) โ [MeasurableSpace ฮฑ] โ Type u_5A measure is defined to be an outer measure that is countably additive on measurable sets, with the additional assumption that the outer measure is the canonical extension of the restricted measure. The measure of a set `s`, denoted `ฮผ s`, is an extended nonnegative real. The real-valued version is written `ฮผ.real s`.
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
ProbabilityTheory.IsMarkovKernel : {ฮฑ : Type u_1} โ
{ฮฒ : Type u_2} โ {mฮฑ : MeasurableSpace ฮฑ} โ {mฮฒ : MeasurableSpace ฮฒ} โ ProbabilityTheory.Kernel ฮฑ ฮฒ โ PropA kernel is a Markov kernel if every measure in its image is a probability measure.
ProbabilityTheory.Kernel : (ฮฑ : Type u_1) โ (ฮฒ : Type u_2) โ [MeasurableSpace ฮฑ] โ [MeasurableSpace ฮฒ] โ Type (max u_1 u_2)A kernel from a measurable space `ฮฑ` to another measurable space `ฮฒ` is a measurable function `ฮบ : ฮฑ โ Measure ฮฒ`. The measurable space structure on `MeasureTheory.Measure ฮฒ` is given by `MeasureTheory.Measure.instMeasurableSpace`. A map `ฮบ : ฮฑ โ MeasureTheory.Measure ฮฒ` is measurable iff `โ s : Set ฮฒ, MeasurableSet s โ Measurable (fun a โฆ ฮบ a s)`.
Learning.IsAlgEnvSeq : {๐ : Type u_1} โ
{๐ : Type u_2} โ
{๐จ : Type u_3} โ
{ฮฉ : Type u_4} โ
{m๐ : MeasurableSpace ๐} โ
{m๐ : MeasurableSpace ๐} โ
{m๐จ : MeasurableSpace ๐จ} โ
{mฮฉ : MeasurableSpace ฮฉ} โ
(โ โ ฮฉ โ ๐) โ
(โ โ ฮฉ โ ๐) โ
(โ โ ฮฉ โ ๐จ) โ
Learning.Algorithm ๐ ๐ ๐จ โโฆAn algorithm-environment sequence: a sequence of observations, actions and feedbacks generated by an algorithm interacting with an environment.Go to its page
Learning.stationaryEnv : {๐ : Type u_2} โ
{๐จ : Type u_3} โ
{m๐ : MeasurableSpace ๐} โ
{m๐จ : MeasurableSpace ๐จ} โ
(ฮฝ : ProbabilityTheory.Kernel ๐ ๐จ) โ [ProbabilityTheory.IsMarkovKernel ฮฝ] โ Learning.Environment Unit ๐ ๐จA stationary environment without observations, in which the distribution of the next feedback depends only on the last action.Go to its page
Ne : {ฮฑ : Sort u} โ ฮฑ โ ฮฑ โ Prop`a โ b`, or `Ne a b` is defined as `ยฌ (a = b)` or `a = b โ False`, and asserts that `a` and `b` are not equal. Conventions for notations in identifiers: * The recommended spelling of `โ ` in identifiers is `ne`.
Prod.mk : {ฮฑ : Type u} โ {ฮฒ : Type v} โ ฮฑ โ ฮฒ โ ฮฑ ร ฮฒConstructs a pair. This is usually written `(x, y)` instead of `Prod.mk x y`. Conventions for notations in identifiers: * The recommended spelling of `(a, b)` in identifiers is `mk`.
ProbabilityTheory.IndepFun : {ฮฉ : Type u_1} โ
{ฮฒ : Type u_6} โ
{ฮณ : Type u_7} โ
{_mฮฉ : MeasurableSpace ฮฉ} โ
[MeasurableSpace ฮฒ] โ
[MeasurableSpace ฮณ] โ
(ฮฉ โ ฮฒ) โ (ฮฉ โ ฮณ) โ autoParam (MeasureTheory.Measure ฮฉ) ProbabilityTheory.IndepFun._auto_1 โ PropTwo functions are independent if the two measurable space structures they generate are independent. For a function `f` with codomain having measurable space structure `m`, the generated measurable space structure is `MeasurableSpace.comap f m`. We use the notation `f โแตข[ฮผ] g` for `IndepFun f g ฮผ` (scoped in `ProbabilityTheory`).
Learning.rewardByCount : {๐ : Type u_2} โ
{R : Type u_3} โ {ฮฉ : Type u_4} โ [DecidableEq ๐] โ (โ โ ฮฉ โ ๐) โ (โ โ ฮฉ โ R) โ ๐ โ โ โ ฮฉ ร (โ โ ๐ โ R) โ RReward obtained when pulling action `a` for the `m`-th time. If it is never pulled `m` times, the reward is given by the second component of `ฯ`, which in applications will be indepedent with same law.Go to its page
MeasureTheory.Measure.prod : {ฮฑ : Type u_4} โ
{ฮฒ : Type u_5} โ
[inst : MeasurableSpace ฮฑ] โ
[inst_1 : MeasurableSpace ฮฒ] โ MeasureTheory.Measure ฮฑ โ MeasureTheory.Measure ฮฒ โ MeasureTheory.Measure (ฮฑ ร ฮฒ)The binary product of measures. They are defined for arbitrary measures, but we basically prove all properties under the assumption that at least one of them is s-finite.
Bandits.streamMeasure : {๐ : Type u_1} โ
{๐ก : Type u_2} โ
{m๐ : MeasurableSpace ๐} โ
{m๐ก : MeasurableSpace ๐ก} โ ProbabilityTheory.Kernel ๐ ๐ก โ MeasureTheory.Measure (โ โ ๐ โ ๐ก)Measure of an infinite stream of rewards from each action.Go to its page
Code
lemma indepFun_rewardByCount (h : IsAlgEnvSeq O A R alg (stationaryEnv ฮฝ) P)
{a b : ๐} {m n : โ} (hm : m โ 0) (hn : n โ 0) (hne : (a, m) โ (b, n)) :
rewardByCount A R a m โแตข[๐] rewardByCount A R b nProof
(iIndepFun_rewardByCount h).indepFun (i := โจ(a, m), hmโฉ) (j := โจ(b, n), hnโฉ)
fun h_eq โฆ hne (congrArg Subtype.val h_eq)Meaning last changed in v4.34.0-rc2-76-g565f652 (2026-09-10), the 3th 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, 70 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.