Learning.klDiv_compProd_compProd_prodMkLeft_eq_klDiv_comp_compProd
From the authors
The divergence of one step of a policy/reward decomposition, in composition-product form:
the policy π is shared and the reward kernels κ, η (which ignore the history) differ, so
the divergence is the conditional divergence of the reward kernels given the played action,
whose law is π ∘ₘ μ.
-
α : Type u_6mα : MeasurableSpace αA measurable space is a space equipped with a σ-algebra. -
β : Type u_7mβ : MeasurableSpace β -
γ : Type u_8mγ : 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.IsFiniteMeasure μA measureμis called finite ifμ univ < ∞. -
π : 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. -
κ : ProbabilityTheory.Kernel β γProbabilityTheory.IsFiniteKernel κA kernel is finite if every measure in its image is finite, with a uniform bound. -
η : ProbabilityTheory.Kernel β γProbabilityTheory.IsFiniteKernel η
InformationTheory.klDiv (μ.compProd (π.compProd (ProbabilityTheory.Kernel.prodMkLeft α κ)))
(μ.compProd (π.compProd (ProbabilityTheory.Kernel.prodMkLeft α η))) =
InformationTheory.klDiv ((μ.bind ⇑π).compProd κ) ((μ.bind ⇑π).compProd η)MeasurableSpace : Type u_6 → Type u_6A measurable space is a space equipped with a σ-algebra.
MeasureTheory.IsFiniteMeasure : {α : Type u_1} → {m0 : MeasurableSpace α} → MeasureTheory.Measure α → PropA measure `μ` is called finite if `μ univ < ∞`.
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)`.
ProbabilityTheory.IsFiniteKernel : {α : Type u_1} →
{β : Type u_2} → {mα : MeasurableSpace α} → {mβ : MeasurableSpace β} → ProbabilityTheory.Kernel α β → PropA kernel is finite if every measure in its image is finite, with a uniform bound.
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`.InformationTheory.klDiv : {α : Type u_2} → {mα : MeasurableSpace α} → MeasureTheory.Measure α → MeasureTheory.Measure α → ENNRealKullback-Leibler divergence between two measures.
MeasureTheory.Measure.compProd : {α : Type u_1} →
{β : Type u_2} →
{mα : MeasurableSpace α} →
{mβ : MeasurableSpace β} → MeasureTheory.Measure α → ProbabilityTheory.Kernel α β → MeasureTheory.Measure (α × β)The composition-product of a measure and a kernel.
ProbabilityTheory.Kernel.compProd : {α : Type u_4} →
{β : Type u_5} →
{γ : Type u_6} →
{mα : MeasurableSpace α} →
{mβ : MeasurableSpace β} →
{mγ : MeasurableSpace γ} →
ProbabilityTheory.Kernel α β → ProbabilityTheory.Kernel (α × β) γ → ProbabilityTheory.Kernel α (β × γ)Composition-Product of kernels. For s-finite kernels, it satisfies `∫⁻ bc, f bc ∂(compProd κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)` (see `ProbabilityTheory.Kernel.lintegral_compProd`). If either of the kernels is not s-finite, `compProd` is given the junk value 0.
ProbabilityTheory.Kernel.prodMkLeft : {α : Type u_1} →
{β : Type u_2} →
{mα : MeasurableSpace α} →
{mβ : MeasurableSpace β} →
(γ : Type u_5) → [inst : MeasurableSpace γ] → ProbabilityTheory.Kernel α β → ProbabilityTheory.Kernel (γ × α) βDefine a `Kernel (γ × α) β` from a `Kernel α β` by taking the comap of the projection.
MeasureTheory.Measure.bind : {α : Type u_1} →
{β : Type u_2} →
{mα : MeasurableSpace α} →
{mβ : MeasurableSpace β} → MeasureTheory.Measure α → (α → MeasureTheory.Measure β) → MeasureTheory.Measure βMonadic bind on `Measure`, only works in the category of measurable spaces and measurable functions. When the function `f` is not measurable the result is not well defined.
Code
lemma klDiv_compProd_compProd_prodMkLeft_eq_klDiv_comp_compProd (μ : Measure α)
[IsFiniteMeasure μ] (π : Kernel α β) [IsMarkovKernel π] (κ η : Kernel β γ) [IsFiniteKernel κ]
[IsFiniteKernel η] :
klDiv (μ ⊗ₘ (π ⊗ₖ κ.prodMkLeft α)) (μ ⊗ₘ (π ⊗ₖ η.prodMkLeft α)) =
klDiv ((π ∘ₘ μ) ⊗ₘ κ) ((π ∘ₘ μ) ⊗ₘ η)Proof
by
rw [← klDiv_map_measurableEquiv _ _ MeasurableEquiv.prodAssoc.symm, Measure.compProd_assoc,
Measure.compProd_assoc, ← Measure.snd_compProd, Measure.snd]
exact klDiv_compProd_comap _ _ _ measurable_sndMeaning 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
Nothing to draw. Its statement rests on no other declaration in this project, and names nothing from a package left unaudited — so the graph is this declaration alone. That is the answer, not a missing picture.
Audit surface: 0 project declarations, 17 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.