InformationTheory.Shannon.CondKLIntegral
Conditional Kullback-Leibler divergence, integral form #
This file fills the explicit Mathlib TODO of
Mathlib/InformationTheory/KullbackLeibler/ChainRule.lean:
Add a version of the chain rule for the integral form of the conditional KL divergence, i.e.
μ[fun x ↦ klDiv (κ x) (η x)].
The main theorem klDiv_compProd_toReal_integral states that, when the two joint measures
μ ⊗ₘ κ and μ ⊗ₘ η share the same first marginal μ, the toReal Kullback-Leibler
divergence between them equals the μ-average of the fibrewise divergences:
(klDiv (μ ⊗ₘ κ) (μ ⊗ₘ η)).toReal = ∫ z, (klDiv (κ z) (η z)).toReal ∂μ.
The Mathlib chain rule klDiv_compProd_eq_add keeps the conditional KL term in the
composition-product form klDiv (μ ⊗ₘ κ) (μ ⊗ₘ η) precisely to avoid the measurability of
z ↦ klDiv (κ z) (η z). Here we resolve that measurability and the integral identity.
Main statements #
rnDeriv_compProd_eq_kernel_rnDeriv: the slice identity∂(μ ⊗ₘ κ)/∂(μ ⊗ₘ η) (z, y) =ᵐ Kernel.rnDeriv κ η z y.klDiv_compProd_toReal_integral: the conditional KL integral form.
Proof strategy #
The slice identity is the linchpin. We use Measure.compProd_withDensity
(μ ⊗ₘ (η.withDensity f) = (μ ⊗ₘ η).withDensity (fun p ↦ f p.1 p.2)) together with the
kernel Radon-Nikodym facts Kernel.withDensity_rnDeriv_eq (η.withDensity (κ.rnDeriv η) a = κ a
when κ a ≪ η a) and Measure.absolutelyContinuous_compProd_right_iff (μ ⊗ₘ κ ≪ μ ⊗ₘ η ↔ ∀ᵐ a ∂μ, κ a ≪ η a) to rewrite μ ⊗ₘ κ as
(μ ⊗ₘ η).withDensity (fun p ↦ Kernel.rnDeriv κ η p.1 p.2),
whence Measure.rnDeriv_withDensity reads off the joint Radon-Nikodym derivative.
For the integral, toReal_klDiv_eq_integral_klFun expresses both sides through klFun integrated
against the dominating measure (μ ⊗ₘ η on the left, η z per fibre), and
Measure.integral_compProd
opens the joint klFun integral into the outer μ-integral.
InformationTheory.rnDeriv_compProd_eq_kernel_rnDeriv
sourceThe slice identity for the Radon-Nikodym derivative of a composition product.
When the two joint measures share the first marginal μ, the joint Radon-Nikodym derivative
agrees almost everywhere with the pointwise kernel Radon-Nikodym derivative. This is the
statement the RadonNikodym.lean TODO left open.
@audit:ok
Used by
InformationTheory.klDiv_compProd_toReal_integral
sourceThe conditional Kullback-Leibler divergence, integral form (Mathlib ChainRule.lean TODO).
When the two joint measures μ ⊗ₘ κ and μ ⊗ₘ η share the first marginal μ, the toReal
Kullback-Leibler divergence decomposes as the μ-average of the fibrewise divergences.
@audit:ok
Used by
InformationTheory.klDiv_compProd_lintegral
sourceThe conditional KL divergence, lintegral form (Mathlib ChainRule.lean TODO, ℝ≥0∞ form).
ℝ≥0∞ mirror of klDiv_compProd_toReal_integral: when the two joint measures share the first
marginal μ, the (ℝ≥0∞-valued) KL divergence equals the μ-average of the fibrewise divergences,
with no integrability hypothesis (ℝ≥0∞ Tonelli lintegral_compProd is unconditional).
Used by
InformationTheory.klDiv_compProd_const_toReal_integral
sourceThe conditional KL divergence, integral form against a constant kernel.
Specialization of klDiv_compProd_toReal_integral to η := Kernel.const 𝓧 ν, the form used by
the EPI G2 conditional differential-entropy bridge.
@audit:ok