Bandits.identDistrib_rewardByCountUntil_add_one
From the authors
The law of rewardByCountUntil A R t under π does not depend on t.
-
π : 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. -
t : β
-
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.
ProbabilityTheory.IdentDistrib (Learning.rewardByCountUntil A R (t + 1)) (Learning.rewardByCountUntil A R t)
(P.prod (streamMeasure Ξ½)) (P.prod (streamMeasure Ξ½))Two functions defined on two (possibly different) measure spaces are identically distributed if their image measures coincide.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
ProbabilityTheory.IdentDistrib : {Ξ± : Type u_1} β
{Ξ² : Type u_2} β
{Ξ³ : Type u_3} β
[inst : MeasurableSpace Ξ±] β
[inst_1 : MeasurableSpace Ξ²] β
[MeasurableSpace Ξ³] β
(Ξ± β Ξ³) β
(Ξ² β Ξ³) β
autoParam (MeasureTheory.Measure Ξ±) ProbabilityTheory.IdentDistrib._auto_1 β
autoParam (MeasureTheory.Measure Ξ²) ProbabilityTheory.IdentDistrib._auto_3 β Proβ¦Two functions defined on two (possibly different) measure spaces are identically distributed if their image measures coincide. This only makes sense when the functions are ae measurable (as otherwise the image measures are not defined), so we require this as well in the definition.
Learning.rewardByCountUntil : {π : Type u_2} β
{R : Type u_3} β {Ξ© : Type u_4} β [DecidableEq π] β (β β Ξ© β π) β (β β Ξ© β R) β β β Ξ© Γ (β β π β R) β π Γ β β RArray 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`.Go to its page
HAdd.hAdd : {Ξ± : Type u} β {Ξ² : Type v} β {Ξ³ : outParam (Type w)} β [self : HAdd Ξ± Ξ² Ξ³] β Ξ± β Ξ² β Ξ³`a + b` computes the sum of `a` and `b`. The meaning of this notation is type-dependent. Conventions for notations in identifiers: * The recommended spelling of `+` in identifiers is `add`.
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 identDistrib_rewardByCountUntil_add_one (h : IsAlgEnvSeq O A R alg (stationaryEnv Ξ½) P)
(t : β) :
IdentDistrib (rewardByCountUntil A R (t + 1)) (rewardByCountUntil A R t) π πProof
by
have hA := h.measurable_action
have hR := h.measurable_feedback
-- condition on the value of `(A t, pullCount A (A t) t)`
refine identDistrib_of_forall_identDistrib_cond
(g := fun Ο : Ξ© Γ (β β π β β) β¦ (A t Ο.1, pullCount A (A t Ο.1) t Ο.1))
(((hA t).comp measurable_fst).prodMk
((measurable_uncurry_pullCount_comp hA (hA t) measurable_const).comp measurable_fst))
(measurable_rewardByCountUntil hA hR _) (measurable_rewardByCountUntil hA hR _) fun p β¦ ?_
have h_eq : (fun Ο : Ξ© Γ (β β π β β) β¦ (A t Ο.1, pullCount A (A t Ο.1) t Ο.1)) β»ΒΉ' {p}
= {x | A t x = p.1 β§ pullCount A p.1 t x = p.2} ΓΛ’ Set.univ := by
ext Ο
simp only [Set.mem_preimage, Set.mem_singleton_iff, Prod.ext_iff, Set.mem_prod,
Set.mem_ofPred_eq, Set.mem_univ, and_true]
constructor
Β· rintro β¨h1, h2β©
exact β¨h1, by rw [β h1]; exact h2β©
Β· rintro β¨h1, h2β©
exact β¨h1, by rw [h1]; exact h2β©
rw [h_eq, cond_prod_univ]
exact identDistrib_rewardByCountUntil_add_one_cond h t p.1 p.2Meaning 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: 11 project declarations, 61 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.