Maximum Entropy of Uniform Distributions & Conditioning Reduces Entropy

proved in Lean

Entropy, the average uncertainty of a random variable, is largest for the uniform distribution; mutual information is never negative; and learning another variable can only reduce uncertainty on average. These are the basic sanity laws of information measures.

Claude E. Shannon (1948) · Ch. 2 · Entropy, Divergence & Inequalities · Cover & Thomas, Theorems 2.6.4 & 2.6.5, Eq. 2.28 & 2.90

Statement

For finite discrete random variables $X, Y$: $$0 \le H(X) \le \log_2 |\mathcal{X}|, \qquad H(X) = \log_2 |\mathcal{X}| \iff P_X = \mathrm{Unif}(\mathcal{X}),$$ $$I(X; Y) = D(P_{XY} \| P_X \times P_Y) \ge 0, \qquad I(X; Y) = 0 \iff P_{XY} = P_X \times P_Y,$$ and conditioning reduces entropy: $H(X \mid Y) \le H(X)$.

How the proof works

Derived directly from klDivergence_nonneg and klDivergence_eq_zero_iff via the identities $D(P \| \mathrm{Unif}) = \log_2 |\mathcal{X}| - H(P)$ and $I(X; Y) = D(P_{XY} \| P_X \times P_Y)$.

Lean declarations (7)

The key theorems in the Lean library. Each is compiled with Lean 4, uses only the standard axioms propext, Classical.choice and Quot.sound, and is re-checked by leanchecker. Click a name to see the full proof on GitHub.

Related open problems (3)

Open problems that build on, generalize, or are analogous to this theorem.