46.01.02 · information-theory / information-measures

Mutual Information, KL Divergence, and Variational Characterizations (Donsker-Varadhan)

shipped3 tiersLean: none

Anchor (Master): Cover & Thomas 2006 Elements of Information Theory 2e (Wiley) §2.3-2.7; Csiszár & Körner 2011 Information Theory 2e (Cambridge) §1.1-1.4; Donsker & Varadhan 1975-1983 (variational formula for KL divergence); Dupuis & Ellis 1997 A Weak Convergence Approach to the Theory of Large Deviations §3.1

Intuition Beginner

You have two random variables, say and . Entropy tells you how uncertain each one is on its own. But what if you want to know how much learning one tells you about the other? That is mutual information.

Think of a noisy communication channel. I send you a bit (0 or 1), and noise corrupts it. You receive . If the channel is perfect, then tells you exactly, and the mutual information equals the entropy of — all the uncertainty in is resolved by seeing . If the channel is useless (random noise unrelated to ), then tells you nothing, and the mutual information is zero.

Mutual information sits between zero and the entropy of each variable. It is zero when the variables are independent and equals the entropy when one completely determines the other.

Now flip the perspective. Suppose nature draws from a true distribution , but you model the world with a different distribution . How bad is your model? The KL divergence measures the penalty. It is always non-negative and equals zero only when and are the same distribution. It is not a distance (it is asymmetric: and differ), but it behaves like one in many proofs.

The deep result is that KL divergence has a variational characterisation. Instead of computing it from the log-ratio formula, you can express it as the largest gap between what you expect under and what you would predict under , across all bounded test functions. This is the Donsker-Varadhan formula, and it connects information theory to convex duality and large deviations.

Visual Beginner

Figure: a Venn diagram with two overlapping circles. The left circle represents , the right circle represents , and the overlap is the mutual information . The non-overlapping part of the left circle is , and the non-overlapping part of the right circle is . The union is . Below the diagram, a table of concrete values.

Scenario H(X) H(Y) I(X;Y) H(X|Y) H(Y|X)
X and Y independent fair coins 1.00 1.00 0.00 1.00 1.00
X = Y (same fair coin) 1.00 1.00 1.00 0.00 0.00
X fair coin, Y = X with 10% flip prob 1.00 1.00 0.53 0.47 0.47
X uniform die, Y = X mod 2 2.58 1.00 1.00 1.58 0.00

The pattern: mutual information is the overlap in the Venn diagram. When there is no overlap (independence), . When one circle sits inside the other (one variable determines the other), equals the smaller entropy.

Worked example Beginner

A binary symmetric channel flips each input bit with probability 0.1. The input is a fair coin (0 or 1 with equal probability). The output is .

Step 1. Entropies. bit. By symmetry, is also uniform, so bit.

Step 2. Joint distribution. The channel gives and . So each of the four pairs has probability: , , , .

Step 3. Conditional entropy. Given , the conditional distribution of is: and . So bits.

Step 4. Mutual information. bits. About 53% of the information in survives the noise.

Step 5. KL divergence interpretation. The joint distribution has probabilities . If and were independent, the product would be . The KL divergence is:

bits.

This equals the mutual information, which is always the case: .

Check your understanding Beginner

Formal definition Intermediate+

Let and be discrete random variables with joint pmf and marginals , .

Definition (Mutual information). The mutual information between and is

Equivalently, .

Definition (KL divergence, relative entropy). For two probability mass functions and on the same alphabet (with the convention that and when ), the Kullback-Leibler divergence is

The mutual information is a special case: .

Definition (Conditional mutual information). For random variables , , and :

Counterexamples to common slips

  • KL divergence is not symmetric. In general . Computing both for the distributions and gives bits but bits.

  • KL divergence is not a metric. It satisfies non-negativity and , but not symmetry or the triangle inequality. The symmetrised version is called the Jeffreys divergence.

  • Mutual information can exceed neither nor . Since and , we have . Similarly .

  • is possible. If puts positive probability on an event that assigns zero probability, then . This means is finite only when is absolutely continuous with respect to (the support of is contained in the support of ).

Key theorem with proof Intermediate+

Theorem (Non-negativity of KL divergence — Gibbs' inequality). For any two probability distributions and on the same alphabet:

with equality if and only if for all .

Proof. Apply the inequality (with equality iff ) to :

Therefore . Equality requires for all with , which holds iff , i.e., .

Corollary (Non-negativity of mutual information). , with equality iff and are independent.

Proof. by Gibbs' inequality. Equality holds iff , i.e., independence.

Theorem (Log-sum inequality). For non-negative numbers and :

with the convention , for , and equality iff is constant for all with .

Proof. Let and . Define probability distributions and . Then Gibbs' inequality gives , which rearranges to the log-sum inequality.

Bridge. The non-negativity of KL divergence via Gibbs' inequality builds toward the asymptotic equipartition property in 46.02.01 by supplying the key inequality that underpins the typical-set bound and the source coding theorem. It appears again in the channel coding theorem 46.02.03 as the foundation for Fano's inequality and the converse direction, and in Sanov's theorem 37.07.05 where the KL divergence becomes the large-deviation rate function. The foundational reason mutual information reduces to is that independence is the null hypothesis of no relationship; the log-sum inequality is the computational engine behind every information-theoretic inequality; and the central insight connecting these is that all information measures are special cases of a single asymmetric divergence functional, which generalises to the Donsker-Varadhan variational formula below. The bridge is that convexity and variational duality unify these quantities under one roof.

Exercises Intermediate+

Lean formalization Intermediate+

Mathlib does not define mutual information or KL divergence on discrete distributions. The PMF type exists, but there is no functional on joint PMFs, no on pairs of distributions, and no proof of non-negativity via the log-sum inequality. The chain rule for mutual information, the data processing inequality, and the convexity of KL divergence are all absent. The Donsker-Varadhan variational formula would require connecting convex duality (Fenchel-Legendre transforms, which exist in Mathlib for convex functions on normed spaces) to information-theoretic quantities, a connection that has not been made. A Codex.InformationTheory.MutualInfo module defining and on PMF with Gibbs' inequality and the basic calculus would be the load-bearing first step; this unit ships without it.

Advanced results Master

The Donsker-Varadhan variational formula

The KL divergence has a dual representation as the solution to a convex optimisation problem. This is the Donsker-Varadhan formula.

Theorem (Donsker-Varadhan, 1975-1983). Let and be probability measures on a measurable space with ( is absolutely continuous with respect to ). Then

where the supremum is taken over all bounded measurable functions .

Proof sketch. The direction follows from Jensen's inequality: , and . More precisely, for any bounded measurable :

By the variational characterisation of the cumulant generating function, the right side is bounded by via the Gibbs variational principle. For the reverse inequality, choose for a constant that makes bounded (via truncation and taking limits). Then and , so . Approximation by bounded functions gives the general case.

The key insight: the Donsker-Varadhan formula identifies KL divergence as the Fenchel-Legendre conjugate of the cumulant generating function . Specifically, where is the convex conjugate. This places KL divergence squarely in the framework of convex duality.

The data processing inequality and sufficient statistics

The data processing inequality is the fundamental no-free-lunch theorem of information theory.

Theorem (Data processing inequality). If is a Markov chain (meaning the conditional distribution of given depends only on ), then

Proof. By the chain rule for mutual information:

Since is Markov, and are conditionally independent given , so . Hence .

Also by the chain rule: . Since , we get .

Corollary (Processing cannot increase information). If for some function , then is Markov (since depends only on ), so .

Definition (Sufficient statistic). A function is a sufficient statistic for the parameter in a family of distributions if

Equivalently, is sufficient iff does not depend on . The data processing inequality always gives ; sufficiency is the equality case where no information about is lost by compressing through .

Pinsker's inequality

KL divergence bounds total variation distance.

Theorem (Pinsker's inequality). For any two distributions and on the same measurable space:

The proof uses the inequality for , extended to distributions by a coupling argument. Pinsker's inequality is the bridge between information-theoretic divergences and the classical -type distances used in statistics and probability.

Worked example. Let and . Total variation distance . KL divergence nats. Pinsker gives , which is satisfied since .

Convexity properties

KL divergence has powerful convexity properties that underpin most of its applications.

Theorem (Joint convexity of KL divergence). is jointly convex in : for and distributions :

This follows from the log-sum inequality and is the algebraic engine behind the convexity of mutual information.

Theorem (Convexity of mutual information in ). For a fixed channel , the mutual information is a concave function of the input distribution .

This concavity is the basis for the Arimoto-Blahut algorithm for computing channel capacity, and it guarantees that the maximum of over input distributions exists and is achieved at an extreme point of the simplex.

Theorem (Convexity of mutual information in ). For a fixed input distribution , the mutual information is a convex function of the channel .

This convexity is used in rate-distortion theory, where the distortion-rate function is obtained by minimising mutual information over channels subject to a distortion constraint.

Fano's inequality and the converse direction

Mutual information controls the probability of error in estimation.

Theorem (Fano's inequality). Let be a random variable and an estimator based on observing . If , then

where is the binary entropy. Equivalently, since :

This provides a lower bound on mutual information in terms of the error probability. If the mutual information is small, then the error probability must be large — you cannot reliably decode from if there is not enough mutual information between them.

Synthesis. Mutual information is the unique measure of statistical dependence that respects the chain rule and collapses to zero exactly at independence. The data processing inequality builds toward the channel coding theorem by guaranteeing that no post-processing of can extract more information about than already contains, and it appears again in the characterisation of sufficient statistics where equality is equivalent to conditional independence. The Donsker-Varadhan formula generalises the KL divergence from a sum of log-ratios to a variational supremum over all bounded test functions, the central insight that connects information theory to convex duality and large deviations. Putting these together: entropy measures uncertainty, mutual information measures shared uncertainty, KL divergence measures mismatch, and the variational characterisation reveals that all three are facets of a single convex-analytic object.

Full proof set Master

Proposition (Mutual information chain rule). For random variables and :

Proof. By induction on . The base case is . For the inductive step, apply the two-variable chain rule with and :

The first term decomposes by the induction hypothesis.

Proposition (Donsker-Varadhan lower bound). For any bounded measurable function and distributions with :

Proof. Let be the Radon-Nikodym derivative. By Jensen's inequality applied to the convex function :

Consider the variational problem. For any bounded :

Let , so and . Then:

where the inequality uses (equivalently, by the non-negativity of KL divergence applied to the distributions with densities and with respect to ).

Proposition (KL divergence is convex in the second argument). For fixed and distributions with :

Proof. This is a special case of joint convexity. Alternatively, the function is convex because is concave: by concavity, so . Summing over gives the result.

Connections Master

  • 46.01.01 — Entropy, conditional entropy, and the chain rule are the direct prerequisites; mutual information is defined as using the entropy function from that unit.
  • 37.01.01 — Probability spaces and Kolmogorov's extension theorem provide the measure-theoretic foundation on which joint distributions and conditional distributions are defined.
  • 46.02.01 — The AEP uses the chain rule for mutual information to decompose and identify the mutual information rate for stationary sources.
  • 37.07.05 — Sanov's theorem in large deviations identifies the KL divergence as the rate function for the probability of seeing an empirical distribution when the true distribution is ; the Donsker-Varadhan formula is the dual representation of this rate.
  • 46.02.03 — The channel coding theorem identifies channel capacity as the maximum mutual information over input distributions; the concavity of mutual information in guarantees the maximum is attained.
  • 45.07.01 — PAC learning bounds use the KL divergence and Pinsker's inequality to control the gap between empirical and population risk; mutual information bounds appear in information-theoretic generalisation bounds.

Historical & philosophical context Master

The Kullback-Leibler divergence was introduced by Solomon Kullback and Richard Leibler in 1951 (On information and sufficiency, Annals of Mathematical Statistics 22, 79-86). They extended Shannon's 1948 information-theoretic framework to a general measure of discrepancy between two statistical distributions, motivated by the Neyman-Pearson theory of hypothesis testing. The Neyman-Pearson lemma (1933) had already established that the likelihood ratio is the optimal test statistic; Kullback and Leibler showed that the expected log-likelihood ratio — which is exactly — measures the information for discriminating between hypotheses.

The variational characterisation of KL divergence was developed by Monroe Donsker and Srinivasa Varadhan in a landmark four-part series published between 1933 and 1983 in Communications on Pure and Applied Mathematics (parts I-IV: volumes 28, 29, 36). Their original motivation was the large-deviation theory of Markov processes. The formula appeared as a tool for computing the Legendre transform of the principal eigenvalue of a Markov generator, which governs the large-deviation rate function for occupation measures. The connection to convex duality (specifically, the fact that KL divergence is the Fenchel conjugate of the cumulant generating function) was made explicit by Dupuis and Ellis in their 1997 monograph A Weak Convergence Approach to the Theory of Large Deviations.

Imre Csiszár introduced the -divergence framework in 1963 (Informationstheoretische Ungleichungen, in German) and independently by Ali and Silvey in 1966, showing that KL divergence is a special case of a broader family of divergences for convex . The -divergence framework unified KL divergence, total variation, and the chi-squared divergence under one roof, and it has become central to modern statistics and machine learning.

The data processing inequality was implicit in Shannon's 1948 paper (the degraded channel argument) and was formalised by Kullback and Leibler. The sufficient-statistics characterisation via mutual information was made precise by Kullback in his 1959 textbook Information Theory and Statistics (Wiley), connecting the information-theoretic and the classical Fisher-Neyman factorisation criteria for sufficiency.

Bibliography Master

@article{kullback-leibler1951,
  author  = {Kullback, S. and Leibler, R. A.},
  title   = {On Information and Sufficiency},
  journal = {Annals of Mathematical Statistics},
  volume  = {22},
  pages   = {79--86},
  year    = {1951},
}
@book{cover-thomas2006,
  author    = {Cover, T. M. and Thomas, J. A.},
  title     = {Elements of Information Theory},
  edition   = {2nd},
  publisher = {Wiley},
  year      = {2006},
}
@book{csiszar-korner2011,
  author    = {Csisz{\'a}r, I. and K{\"o}rner, J.},
  title     = {Information Theory: Coding Theorems for Discrete Memoryless Systems},
  edition   = {2nd},
  publisher = {Cambridge University Press},
  year      = {2011},
}
@article{donsker-varadhan1975,
  author  = {Donsker, M. D. and Varadhan, S. R. S.},
  title   = {Asymptotic Evaluation of Certain Markov Process Expectations for Large Time, {I}},
  journal = {Communications on Pure and Applied Mathematics},
  volume  = {28},
  pages   = {1--47},
  year    = {1975},
}
@article{donsker-varadhan1976,
  author  = {Donsker, M. D. and Varadhan, S. R. S.},
  title   = {Asymptotic Evaluation of Certain Markov Process Expectations for Large Time, {II}},
  journal = {Communications on Pure and Applied Mathematics},
  volume  = {29},
  pages   = {389--461},
  year    = {1976},
}
@article{donsker-varadhan1983,
  author  = {Donsker, M. D. and Varadhan, S. R. S.},
  title   = {Asymptotic Evaluation of Certain Markov Process Expectations for Large Time, {III}},
  journal = {Communications on Pure and Applied Mathematics},
  volume  = {36},
  pages   = {183--212},
  year    = {1983},
}
@book{dupuis-ellis1997,
  author    = {Dupuis, P. and Ellis, R. S.},
  title     = {A Weak Convergence Approach to the Theory of Large Deviations},
  publisher = {Wiley},
  year      = {1997},
}
@book{kullback1959,
  author    = {Kullback, S.},
  title     = {Information Theory and Statistics},
  publisher = {Wiley},
  year      = {1959},
}
@article{pinsker1964,
  author  = {Pinsker, M. S.},
  title   = {Information and Information Stability of Random Variables and Processes},
  journal = {Problems of Information Transmission},
  year    = {1964},
  note    = {Originally published in Russian by Nauka, Moscow},
}
@article{csiszar1967,
  author  = {Csisz{\'a}r, I.},
  title   = {Information-Type Measures of Difference of Probability Distributions and Indirect Observations},
  journal = {Studia Scientiarum Mathematicarum Hungarica},
  volume  = {2},
  pages   = {299--318},
  year    = {1967},
}