Lean, informalized

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

Exercise 11.7 - Conditional entropy as a relative entropy, never negative and zero exactly when YY is a function of XX

Conditional entropy as a relative entropy, and its sign.

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}, with joint distribution p(x,y)p(x,y). The conditional entropy H(Y|X)H(Y|X), the joint entropy less the entropy of XX, is the uncertainty left in YY once XX is known. The exercise writes H(Y|X)H(Y|X) as a relative entropy between pp and a second function on the pairs (x,y)(x,y), and asks for its sign: H(Y|X)H(Y|X) is never negative, and it vanishes exactly when YY is a function of XX.

Entropies of a Pair

The Shannon entropy H(p)H(p) of a distribution pp on a finite set 𝒜\mathcal{A} is, with the natural logarithm and so in nats, H(p)=−∑a∈𝒜p(a)log⁡p(a).H(p) = -\sum_{a \in \mathcal{A}} p(a) \log p(a).(1)✦

The first marginal pXp_X of a joint distribution pp of XX and YY on 𝒳×𝒴\mathcal{X} \times \mathcal{Y} 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)✦

Applied to pp, the entropy (1) is the joint entropy H(X,Y)H(X,Y); applied to pXp_X, it is H(X)H(X).

The reference function qq of a joint distribution pp of XX and YY is the function on 𝒳×𝒴\mathcal{X} \times \mathcal{Y} that weights each joint probability p(x,y)p(x,y) by the conditional probability p(x,y)/pX(x)p(x,y)/p_X(x) of yy given xx: q(x,y)=p(x,y)2pX(x).q(x,y) = \frac{p(x,y)^2}{p_X(x)}.(3)✦

The relative entropy of pp to qq is written D(p∥q)D(p\,\|\,q).

Under a joint distribution pp of XX and YY, the variable YY is determined by XX when there is a function ff from 𝒳\mathcal{X} to 𝒴\mathcal{Y} with y=f(x)for every pair (x,y) with p(x,y)≠0.y = f(x) \quad \text{for every pair } (x,y) \text{ with } p(x,y) \neq 0.(4)✦

The Claim

Theorem 1. Let 𝒳\mathcal{X} and 𝒴\mathcal{Y} be finite sets and pp a function on 𝒳×𝒴\mathcal{X} \times \mathcal{Y} with p(x,y)≥0p(x,y) \ge 0 for every pair, with first marginal pXp_X as in (2) and reference function qq as in (3). Then H(p)−H(pX)=D(p∥q)H(p) - H(p_X) = D(p\,\|\,q)(5)✦ and D(p∥q)≥0.D(p\,\|\,q) \ge 0.(6)✦ If moreover 𝒴\mathcal{Y} is not empty, then D(p∥q)=0if and only ifY is determined by X under p.D(p\,\|\,q) = 0 \quad \text{if and only if} \quad Y \text{ is determined by } X \text{ under } p .(7)✦

For a joint distribution pp of XX and YY the left side of (5) is H(Y|X)H(Y|X), and the theorem is the exercise.

What Is Checked

The theorem is stated for every nonnegative function pp on a product of two finite sets, normalized or not, through the Shannon entropy (1), the first marginal (2), the reference function (3) and the relative entropy, with determination (4) in its equality case. About these constructions the library proves the identity (5), the sign (6) and the equality case (7).