Bandits.indepFun_snd_apply_prod_streamMeasure_update
From the authors
Under a product measure μ.prod (streamMeasure ν), the entry (m, a) of the reward array is
independent of the pair formed by the first coordinate and the reward array in which the entry
(m, a) is replaced by a constant x.
-
𝓐 : Type u_1m𝓐 : MeasurableSpace 𝓐A measurable space is a space equipped with a σ-algebra.DecidableEq 𝓐 -
𝓡 : Type u_2m𝓡 : MeasurableSpace 𝓡 -
Ω : Type u_3mΩ : MeasurableSpace Ω
-
μ : 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.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. -
m : ℕ -
a : 𝓐 -
x : 𝓡
ProbabilityTheory.IndepFun (fun ω => ω.2 m a) (fun ω => (ω.1, fun i b => if i = m ∧ b = a then x else ω.2 i b))
(μ.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 : α`.
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.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)`.
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.
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`).
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`.
ite : {α : Sort u} → (c : Prop) → [h : Decidable c] → α → α → α`if c then t else e` is notation for `ite c t e`, "if-then-else", which decides to return `t` or `e` depending on whether `c` is true or false. The explicit argument `c : Prop` does not have any actual computational content, but there is an additional `[Decidable c]` argument synthesized by typeclass inference which actually determines how to evaluate `c` to true or false. Write `if h : c then t else e` instead for a "dependent if-then-else" `dite`, which allows `t`/`e` to use the fact that `c` is true/false. Conventions for notations in identifiers: * The recommended spelling of `if c then t else e` in identifiers is `ite` (use `left` for `t` and `right` for `e`).
Eq : {α : Sort u_1} → α → α → PropThe equality relation. It has one introduction rule, `Eq.refl`.
We use `a = b` as notation for `Eq a b`.
A fundamental property of equality is that it is an equivalence relation.
```
variable (α : Type) (a b c d : α)
variable (hab : a = b) (hcb : c = b) (hcd : c = d)
example : a = d :=
Eq.trans (Eq.trans hab (Eq.symm hcb)) hcd
```
Equality is much more than an equivalence relation, however. It has the important property that every assertion
respects the equivalence, in the sense that we can substitute equal expressions without changing the truth value.
That is, given `h1 : a = b` and `h2 : p a`, we can construct a proof for `p b` using substitution: `Eq.subst h1 h2`.
Example:
```
example (α : Type) (a b : α) (p : α → Prop)
(h1 : a = b) (h2 : p a) : p b :=
Eq.subst h1 h2
example (α : Type) (a b : α) (p : α → Prop)
(h1 : a = b) (h2 : p a) : p b :=
h1 ▸ h2
```
The triangle in the second presentation is a macro built on top of `Eq.subst` and `Eq.symm`, and you can enter it by typing `\t`.
For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
Conventions for notations in identifiers:
* The recommended spelling of `=` in identifiers is `eq`.And : Prop → Prop → Prop`And a b`, or `a ∧ b`, is the conjunction of propositions. It can be constructed and destructed like a pair: if `ha : a` and `hb : b` then `⟨ha, hb⟩ : a ∧ b`, and if `h : a ∧ b` then `h.left : a` and `h.right : b`. Conventions for notations in identifiers: * The recommended spelling of `∧` in identifiers is `and`.
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_snd_apply_prod_streamMeasure_update [DecidableEq 𝓐] {Ω : Type*}
{mΩ : MeasurableSpace Ω} (μ : Measure Ω) [IsProbabilityMeasure μ] (ν : Kernel 𝓐 𝓡)
[IsMarkovKernel ν] (m : ℕ) (a : 𝓐) (x : 𝓡) :
(fun ω : Ω × (ℕ → 𝓐 → 𝓡) ↦ ω.2 m a) ⟂ᵢ[μ.prod (streamMeasure ν)]
(fun ω ↦ (ω.1, fun i b ↦ if i = m ∧ b = a then x else ω.2 i b))Proof
by
let T : (ℕ → 𝓐 → 𝓡) → (ℕ → 𝓐 → 𝓡) := fun z i b ↦ if i = m ∧ b = a then x else z i b
have hT : Measurable[⨆ p ∈ {p : ℕ × 𝓐 | p ≠ (m, a)},
MeasurableSpace.comap (fun z : ℕ → 𝓐 → 𝓡 ↦ z p.1 p.2) inferInstance] T := by
rw [measurable_iff_comap_le, MeasurableSpace.comap_pi]
refine iSup_le fun i ↦ ?_
rw [MeasurableSpace.comap_pi]
refine iSup_le fun b ↦ ?_
by_cases hib : i = m ∧ b = a
· obtain ⟨rfl, rfl⟩ := hib
simp only [T, and_self, ↓reduceIte, MeasurableSpace.comap_const]
exact bot_le
· simp only [T, hib, ↓reduceIte]
refine le_iSup₂_of_le (i, b) ?_ le_rfl
simpa only [Set.mem_ofPred_eq, ne_eq, Prod.mk.injEq] using hib
have hTm : Measurable T :=
hT.mono (iSup₂_le fun p _ ↦ Measurable.comap_le (by fun_prop)) le_rfl
have h := (iIndepFun_eval_streamMeasure ν).indepFun_of_measurable_iSup_comap
(fun _ ↦ by fun_prop) (i := (m, a)) (by simp) hT
exact h.snd_prod (μ := μ) (by fun_prop) hTmMeaning last changed in v4.35.0-rc2-1-g61e506b (2026-09-22), the 2th 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: 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.