InformationTheory.Shannon.MIChainRule
Mutual information chain rule (n-variable) and i.i.d. corollary #
MeasurableEquiv invariance, the n-variable chain rule, additivity under product
distributions, and the entropy-MI bridge identity.
Main statements #
mutualInfo_map_left_measurableEquiv—I(e ∘ X; Y) = I(X; Y).mutualInfo_chain_rule_fin—I(X_0, …, X_{n-1}; Y) = ∑ i, I(X_i; Y | X_0, …, X_{i-1}).mutualInfo_pi_eq_sum—I(X^n; Y^n) = ∑ I(X_i; Y_i)under product joint distribution.mutualInfo_iid_eq_nsmul—I(X^n; Y^n) = n · I(X_0; Y_0)for i.i.d. pairs.mutualInfo_eq_entropy_add_entropy_sub_jointEntropy—I(X; Y) = H(X) + H(Y) − H(X, Y).
mutualInfo invariance under MeasurableEquiv reshape #
InformationTheory.Shannon.mutualInfo_map_left_measurableEquiv
sourceMutual information is invariant under a MeasurableEquiv reshape of the left
random variable: I(e ∘ X; Y) = I(X; Y). Reduces to klDiv_map_measurableEquiv
applied to the product equivalence e × id.
Used by
n-variable chain rule #
InformationTheory.Shannon.mutualInfo_chain_rule_fin
sourcen-variable chain rule for mutual information:
I(X_0, …, X_{n-1}; Y) = ∑ i, I(X_i; Y | (X_0, …, X_{i-1})).
Induction on n. base n=0: LHS = mutualInfo of a constant Fin 0 → α-valued RV,
which is independent of anything ⇒ 0; RHS is the empty sum. step n+1: split via
MeasurableEquiv.piFinSuccAbove (Fin.last n) so that Fin (n+1) → α ≃ᵐ α × (Fin n → α),
then prodComm so we land on (prefix, last), apply mutualInfo_map_left_measurableEquiv,
then the 2-variable mutualInfo_chain_rule with Zc := prefix,
Xs_arg := last, then IH on the Fin n prefix, then Fin.sum_univ_castSucc.
Used by
i.i.d. corollary #
InformationTheory.Shannon.klDiv_prod_eq_add
sourceKL divergence of product measures is additive: if both μ₁, μ₂ are probability
measures on α and ν₁, ν₂ are finite measures on β, then
klDiv (μ₁.prod ν₁) (μ₂.prod ν₂) = klDiv μ₁ μ₂ + klDiv ν₁ ν₂. Derived from
klDiv_compProd_eq_add (Mathlib) with constant kernels + klDiv_prod_const_left.
Used by
InformationTheory.Shannon.klDiv_pi_eq_sum
sourceKL divergence of Measure.pi measures is additive over the index set:
klDiv (Measure.pi μs) (Measure.pi νs) = ∑ i, klDiv (μs i) (νs i).
Proven by induction on n using measurePreserving_piFinSuccAbove (to split
Measure.pi of length n+1 into μ_{last} × Measure.pi prefix) +
klDiv_map_measurableEquiv + klDiv_prod_eq_add + Fin.sum_univ_castSucc.
Used by
InformationTheory.Shannon.mutualInfo_pi_eq_sum
sourceMI additivity under product joint distribution: if the joint
μ.map (fun ω i ↦ (X_i ω, Y_i ω)) factors as the product Measure.pi (i ↦ μ.map (X_i, Y_i))
and the marginals factor similarly, then I(X^n; Y^n) = ∑ I(X_i; Y_i).
Strategy: reshape via MeasurableEquiv.arrowProdEquivProdArrow so that both joint and
product-of-marginals (defining mutualInfo) become Measure.pi-shaped, then apply
klDiv_pi_eq_sum to get the sum.
Used by
InformationTheory.Shannon.mutualInfo_iid_eq_nsmul
sourcei.i.d. corollary: all (X_i, Y_i) jointly i.i.d. with common law implies
I(X^n; Y^n) = n · I(X_0; Y_0).
Used by
Entropy ↔ MI three-term bridge #
For a joint probability measure on a finite-alphabet product space α × β, the standard
identity I(X; Y) = H(X) + H(Y) − H(X, Y) connects the klDiv-based mutualInfo to the
Shannon-entropy entropy. This rewrites the joint-AEP exponent
H(X, Y) − H(X) − H(Y) as −I(p; W).
InformationTheory.Shannon.mutualInfo_eq_entropy_add_entropy_sub_jointEntropy
sourceThe mutual-information ↔ entropy three-term identity (joint-distribution level).
For any probability measure joint on a finite-alphabet product α × β, the
klDiv-based mutual information of its coordinates equals the standard three-term
form H(X) + H(Y) − H(X, Y), where H(X, Y) := entropy joint id is the joint
entropy on α × β.
Strategy: mutualInfo_comm to put Prod.snd first, then Bridge
mutualInfo_eq_entropy_sub_condEntropy to convert MI to entropy minus conditional
entropy; finally entropy_pair_eq_entropy_add_condEntropy applied to the identity
pair (z.1, z.2) = z to expand the joint entropy.