Bandits.hasLaw_rewardByCountUntil_zero
From the authors
The law of the array rewardByCountUntil A R 0, which is a sub-array of the auxiliary array,
is the product measure ⨠(a, m), ν a.
-
š : Type u_1mš : MeasurableSpace šA measurable space is a space equipped with a Ļ-algebra.DecidableEq š -
Ω : Type u_2mΩ : MeasurableSpace Ω
-
A : ā ā Ī© ā š -
R : ā ā Ī© ā ā -
ν : 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. -
μ : 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 μA measureμis called a probability measure ifμ univ = 1.
ProbabilityTheory.HasLaw (Learning.rewardByCountUntil A R 0) (MeasureTheory.Measure.infinitePi fun p => ν p.1)
(μ.prod (streamMeasure ν))The predicate HasLaw X μ P registers the fact that the random variable X has law μ under the measure P, in other words that P.map X = μ.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 : α`.
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.
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)`.
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`.
ProbabilityTheory.HasLaw : {Ī© : Type u_1} ā
{š§ : Type u_2} ā
{mĪ© : MeasurableSpace Ī©} ā
{mš§ : MeasurableSpace š§} ā
(Ī© ā š§) ā MeasureTheory.Measure š§ ā autoParam (MeasureTheory.Measure Ī©) ProbabilityTheory.HasLaw._auto_1 ā PropThe predicate `HasLaw X μ P` registers the fact that the random variable `X` has law `μ` under the measure `P`, in other words that `P.map X = μ`. We also require `X` to be `AEMeasurable`, to allow for nice interactions with operations on the codomain of `X`. See for instance `HasLaw.comp`, `IndepFun.hasLaw_mul` and `IndepFun.hasLaw_add`.
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
MeasureTheory.Measure.infinitePi : {ι : Type u_1} ā
{X : ι ā Type u_2} ā
{mX : (i : ι) ā MeasurableSpace (X i)} ā
((i : ι) ā MeasureTheory.Measure (X i)) ā MeasureTheory.Measure ((i : ι) ā X i)The product measure of an arbitrary family of probability measures. It is defined as the unique extension of the function which gives to cylinders the measure given by the associated product measure. It is defined via an `if ... then ... else` so that it can be manipulated without carrying a proof that the measures are probability measures.
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 hasLaw_rewardByCountUntil_zero (μ : Measure Ω) [IsProbabilityMeasure μ] :
HasLaw (rewardByCountUntil A R 0) (Measure.infinitePi fun p : š Ć ā ⦠ν p.1)
(μ.prod (streamMeasure ν))Proof
have h_indep : iIndepFun (fun (p : š Ć ā) (Ļ : Ī© Ć (ā ā š ā ā)) ⦠Ļ.2 (p.2 + 1) p.1)
(μ.prod (streamMeasure ν)) :=
(iIndepFun_snd_apply_prod_streamMeasure μ ν).precomp (g := fun p : š Ć ā ⦠(p.2 + 1, p.1))
fun p q hpq ⦠Prod.ext (Prod.mk.inj hpq).2 (by have := (Prod.mk.inj hpq).1; omega)
h_indep.hasLaw_infinitePi (fun p ⦠hasLaw_snd_apply_prod_streamMeasure μ ν _ _)
(by fun_prop : Measurable fun (Ļ : Ī© Ć (ā ā š ā ā)) (p : š Ć ā) ā¦
Ļ.2 (p.2 + 1) p.1).aemeasurableMeaning last changed in v4.34.0-rc2-76-g565f652 (2026-09-10).
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: 3 project declarations, 37 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.