Shannon.Entropy.Joint #
Joint distributions on product types, marginals, conditional entropy, and the chain rule for Shannon entropy.
These definitions and theorems support the Section 6 properties by providing the infrastructure for multi-variable entropy identities.
Main definitions #
marginalFst,marginalSnd: marginal distributions from a joint distributionprodDist: product (independent) distribution from two marginalsIsIndependent: predicate for independence of a joint distributioncondEntropy: conditional entropyH_X(Y) = -∑ p(x,y) log(p(x,y)/p(x))mutualInfo: mutual informationI(X;Y) = H(X) + H(Y) - H(X,Y)
Main results #
chain_rule:H(X,Y) = H(X) + H_X(Y)entropyNat_prodDist:H(X × Y) = H(X) + H(Y)for independent distributionsmarginalFst_prodDist,marginalSnd_prodDist: marginals of product distributions
Marginals and product distributions #
Independence, conditional entropy, mutual information #
Conditional entropy H_X(Y) = -∑_{x,y} p(x,y) log(p(x,y) / p_X(x)).
This measures the average remaining uncertainty in Y once X is known.
The formula uses Lean's 0 / 0 = 0 and log 0 = 0 conventions: when
p_X(x) = 0 we also have p(x,y) = 0, so the term vanishes.
Equations
- LeanPool.Shannon1948Formalization.condEntropy p = -∑ ab : α × β, ↑p ab * Real.log (↑p ab / ↑(LeanPool.Shannon1948Formalization.marginalFst p) ab.1)
Instances For
Support lemmas #
If a first marginal is zero, every joint probability with that first coordinate is zero (since the marginal is a sum of nonnegative terms).
Marginals of product distributions #
Chain rule #
Product distribution entropy #
Additivity for independent distributions: H(X × Y) = H(X) + H(Y).
The proof uses log(p(a) * q(b)) = log p(a) + log q(b) for each nonzero term,
then separates the double sum using ∑ qᵢ = 1 and ∑ pᵢ = 1.