← All solved theorems
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.
theorem shannonEntropy_nonneg (P : ProbDist α) : 0 ≤ shannonEntropy P := by …
theorem shannonEntropy_le_log2_card [Nonempty α] (P : ProbDist α) :
shannonEntropy P ≤ log2 (Fintype.card α : ℝ) := by …
theorem shannonEntropy_eq_log2_card_iff [Nonempty α] (P : ProbDist α) :
shannonEntropy P = log2 (Fintype.card α : ℝ) ↔ P = ProbDist.uniform := by …
theorem mutualInfo_eq_klDivergence (P : ProbDist (α × β)) :
mutualInfo P = klDivergence P (P.fst.prod P.snd) := by …
theorem mutualInfo_nonneg (P : ProbDist (α × β)) : 0 ≤ mutualInfo P := by …
theorem mutualInfo_eq_zero_iff_indep (P : ProbDist (α × β)) :
mutualInfo P = 0 ↔ P = P.fst.prod P.snd := by …
theorem condEntropy_le_shannonEntropy (P : ProbDist (α × β)) :
condEntropy P ≤ shannonEntropy P.fst := by …
Related open problems (3)
Open problems that build on, generalize, or are analogous to this theorem.