Solution (source code)

= Solution

If $X\to Y\to Z$ is a <Markov chain>, the two forms of the <data processing inequality for mutual information> are
$$
I(X;Z)\leq I(X;Y),
\qquad
I(X;Z)\leq I(Y;Z).
$$
The <chain rule for mutual information> and the Markov property $I(X;Z\mid Y)=0$ give
$$
I(X;Y,Z)=I(X;Y)+I(X;Z\mid Y)=I(X;Y).
$$
Using the other order,
$$
I(X;Y,Z)=I(X;Z)+I(X;Y\mid Z)\geq I(X;Z),
$$
because <conditional mutual information> is nonnegative. This proves the first inequality. Applying the same result to the reversed Markov chain $Z\to Y\to X$, which has the same conditional-independence statement, proves the second.