Lean, informalized

Nielsen & Chuang · Chapter 11, Entropy and information · p. 505

Exercise 11.5 - Subadditivity of the Shannon entropy, with equality exactly for independent variables

Joint entropy never exceeds the sum of the marginal entropies.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The Exercise

Two random variables XX and YY take values in finite sets 𝒳\mathcal{X} and 𝒴\mathcal{Y} and have a joint distribution p(x,y)p(x,y). The joint entropy H(X,Y)H(X,Y) measures the uncertainty in the pair, the entropies H(X)H(X) and H(Y)H(Y) the uncertainty in each variable alone. The exercise is to show that the uncertainty in the pair never exceeds the sum of the two✦, and that it equals the sum exactly when XX and YY are independent.✦

Entropy and Marginals

A joint distribution pp of XX and YY is a real function on 𝒳×𝒴\mathcal{X}\times\mathcal{Y}, nonnegative at every pair and summing to one.

The Shannon entropy H(p)H(p) of a distribution pp on a finite set II is the real number H(p)=−∑i∈Ip(i)log⁡p(i),H(p) = -\sum_{i\in I} p(i)\log p(i),(1)✦ with the natural logarithm, so that entropies are measured in nats.

The first marginal pXp_X of a joint distribution pp of XX and YY is the distribution of XX alone, obtained by summing out YY: pX(x)=∑y∈𝒴p(x,y).p_X(x) = \sum_{y\in\mathcal{Y}} p(x,y).(2)✦ The second marginal pYp_Y of pp is the distribution of YY alone, obtained by summing out XX: pY(y)=∑x∈𝒳p(x,y).p_Y(y) = \sum_{x\in\mathcal{X}} p(x,y).(3)✦

The independent product pX⊗pYp_X\otimes p_Y of a joint distribution pp is the distribution on 𝒳×𝒴\mathcal{X}\times\mathcal{Y} that gives each pair the product of the two marginals, (pX⊗pY)(x,y)=pX(x)pY(y),(p_X\otimes p_Y)(x,y) = p_X(x)\,p_Y(y),(4)✦ the joint distribution that XX and YY would have if they were independent with the same marginals.

The Claim

Theorem 1. Let pp be a joint distribution of XX and YY on 𝒳×𝒴\mathcal{X}\times\mathcal{Y}. Then H(X,Y)≤H(X)+H(Y),H(X,Y) \le H(X) + H(Y),(5)✦ with equality exactly when XX and YY are independent: H(X)+H(Y)=H(X,Y)⇔p=pX⊗pY.H(X) + H(Y) = H(X,Y) \iff p = p_X\otimes p_Y.(6)✦ For every nonnegative function pp on 𝒳×𝒴\mathcal{X}\times\mathcal{Y}, summing to one or not, D(p∥pX⊗pY)=H(pX)+H(pY)−H(p).D(p\,\|\,p_X\otimes p_Y) = H(p_X) + H(p_Y) - H(p).(7)✦

What Is Checked

The claim is stated over the Shannon entropy (1), the two marginals (2) and (3), and the independent product (4) of a real function on the product of two finite sets. What the library proves about these constructions is the identity (7), which ties the independent product to the entropies of pp and of its marginals.