46.04.03 · information-theory / 04-information-statistics

The Method of Types: Large Deviations for Empirical Distributions (IT perspective)

shipped3 tiersLean: none

Anchor (Master): Cover & Thomas 2006 Elements of Information Theory 2e (Wiley) §11.3-11.5; Csiszar 1984 Sanov property, generalized I-projection and conditional limit theorem Ann. Prob. 12(3) 768-793; Dembo & Zeitouni 1998 Large Deviations Techniques and Applications 2e (Springer) §3.1-3.3

Intuition Beginner

You flip a fair coin 1000 times and count the heads. By the law of large numbers, you expect about 500 heads. But suppose you are told that the number of heads was unusually high — say at least 600. Given this surprising event, what was the most likely actual count?

The answer is exactly 600, not 650 or 700. This is the conditional limit theorem: given that the empirical histogram lies in an unusual set, the most likely histogram is the least unusual one in the set — the one closest to the true distribution in the KL divergence sense.

Think of it like this. You are wandering in a landscape of histograms. Your "home" is the true distribution . The "cost" of visiting any histogram is , the KL divergence. When the data forces you into an unusual region , you take the cheapest path — you visit the in that minimises . This cheapest point is the I-projection.

The large deviations perspective says: the probability of landing in region is exponential in the cost of the cheapest point. The conditional limit theorem says: conditioned on landing in , the histogram converges to that cheapest point. These two results together give a complete picture of rare events for empirical distributions.

The I-projection has an elegant geometric interpretation. On the probability simplex (the set of all distributions on outcomes), KL divergence acts like a squared distance — except it is asymmetric and respects the geometry of the simplex. The I-projection is the closest point to in this KL geometry, subject to the constraint that it lies in . When is defined by a linear constraint (like a moment condition), the I-projection has an exponential tilt form, which connects directly to the Gibbs distribution in statistical mechanics.

Visual Beginner

Figure: a contour plot of as a function of on the probability simplex for three outcomes. The contours are concentric around . A shaded region is shown, with the I-projection marked on the boundary of , at the point where the contours first touch .

Scenario True Constraint set I-projection Rate
Fair coin 0.119 bits
Fair die 0.526 bits
Loaded coin 0.511 bits

The I-projection always lies on the boundary of closest to .

Worked example Beginner

A fair die (uniform on ) is rolled many times. You observe that face 1 appears at least 40% of the time. Given this constraint, what is the most likely empirical distribution?

The constraint set is . The I-projection of onto is the distribution in that minimises .

By the method of Lagrange multipliers: minimising subject to and the constraint that all probabilities add up to 1. If (the constraint is active), then the remaining probability 0.6 should be distributed among faces 2-6 proportional to :

.

The Sanov rate is bits.

The probability of this event at is approximately .

Check your understanding Beginner

Formal definition Intermediate+

Definition (I-projection). Let be a probability distribution on and let be a closed convex subset of the probability simplex . The I-projection of onto is

provided the minimum is attained (which it is when is closed and convex).

Theorem (Pythagorean identity). Let be the I-projection of onto a convex set . For any :

Proof. Since minimises over , the directional derivative of at in any feasible direction is non-negative. For and , the point by convexity. The derivative condition gives:

Expanding at gives .

Therefore . Rearranging:

and equality holds iff . Hence with equality at . But requires verifying both directions; the Pythagorean identity in its exact form uses the orthogonality condition , which holds when is a linear constraint set.

Theorem (Conditional limit theorem). Let be i.i.d. on a finite alphabet . Let be a closed convex set of distributions on with . Then, conditioned on the event :

where is the I-projection.

Counterexamples to common slips

  • The conditional limit theorem requires to be convex. Without convexity, the limiting conditional distribution need not exist, or may depend on .

  • The I-projection minimises , not . The order of arguments matters because KL divergence is asymmetric. The I-projection is not the M-projection.

  • The conditional limit theorem is not Bayes' theorem. Bayes updates the prior using likelihood; the conditional limit theorem describes the limiting behaviour of the empirical distribution given a rare event, which is a statement about the data, not about the parameters.

Key theorem with proof Intermediate+

Theorem (Large deviations for types — full IT form). For i.i.d. and a Borel set in the probability simplex:

When is convex and the infimum is attained at an interior point, the lower and upper bounds coincide, giving the exact rate.

Proof sketch. The upper bound was proved in 46.02.06 using the polynomial number of types. For the lower bound, consider any that is an -type. The probability of seeing exactly type is:

Using and :

Taking and the infimum over gives the lower bound.

Bridge. The large deviations framework for types builds toward hypothesis testing in 46.04.01, where Sanov's theorem provides the error exponent for the optimal test, and the I-projection identifies the least favourable distribution under the alternative hypothesis. The foundational reason the conditional limit theorem matters is that it identifies the "typical atypical" distribution — the most likely rare event — and this is exactly the bridge between large deviations and statistics. The central insight is that KL divergence serves simultaneously as the rate function for large deviations and the objective for the I-projection, generalises to conditional types and the Gibbs conditioning principle, and appears again in 46.04.02 as the Chernoff information that governs symmetric hypothesis testing. The bridge is the Pythagorean identity, which decomposes the divergence into the projection cost and the residual, and putting these together gives a complete geometric picture of rare events in information theory.

Exercises Intermediate+

Lean formalization Intermediate+

Mathlib lacks the I-projection, the Pythagorean identity, and the conditional limit theorem. The KL divergence is not defined as a functional on the probability simplex. A Codex.InformationTheory.IProjection module would need to define KL divergence on PMF, prove strict convexity in the first argument, establish existence and uniqueness of the I-projection on convex sets, and derive the Pythagorean identity. The conditional limit theorem is a deeper result requiring large-deviation machinery. This unit ships without formal verification.

Advanced results Master

The Gibbs conditioning principle

The conditional limit theorem has a statistical mechanics interpretation via the Gibbs conditioning principle. When the constraint set is of the form for a function , the I-projection has the exponential tilt form:

where is chosen so that . This is exactly the Gibbs distribution at inverse temperature , and the Sanov rate is:

where is the moment generating function. The Legendre transform of is the Cramer rate function, connecting Sanov's theorem back to Cramer's theorem 37.07.02.

Universal coding and the type class enumeration

The method of types gives a universal source code with the following two-stage encoding:

  1. Encode the type using bits.
  2. Encode the index of within using bits.

The expected per-symbol length is , which converges to as . This code achieves entropy for any source distribution without knowing in advance.

The overhead is the price of universality. For comparison, the Lempel-Ziv algorithm achieves a redundancy of per symbol, which is better for large alphabets but requires sequential processing.

Connection to the EM algorithm

The I-projection is the E-step of the EM (Expectation-Maximisation) algorithm in disguise. In the EM framework, the E-step computes the expected sufficient statistics under the current parameter estimate, which is equivalent to finding the I-projection of the empirical distribution onto a linear constraint set defined by the latent variable model. The M-step updates the parameters by maximising the likelihood, which is equivalent to finding the M-projection (minimising rather than ).

Synthesis. The method of types for large deviations provides a complete probabilistic framework for understanding rare events: Sanov's theorem gives the rate function (KL divergence), the conditional limit theorem identifies the most likely rare distribution (the I-projection), and the Pythagorean identity decomposes the divergence into projection cost and residual. The central insight is that KL divergence serves simultaneously as a large-deviation rate, a divergence measure, and an objective for projection, and this builds toward hypothesis testing in 46.04.01 where the Sanov rate becomes the error exponent. The foundational reason the conditional limit theorem holds is convexity: the constraint set being convex ensures the I-projection is unique and the Pythagorean identity holds. This is exactly the structure that appears again in 46.04.02 as the geometric picture behind Chernoff information, and putting these together the method of types becomes the unifying language for the interface of information theory and statistics.

Full proof set Master

Proposition (Existence of the I-projection). For any closed convex set of distributions with , the I-projection of onto exists and is unique.

Proof. Uniqueness. Suppose both achieve the minimum. Since is convex, . By strict convexity of :

This contradicts the minimality of unless .

Existence. The function is continuous on the probability simplex (in the relative topology) and the level sets are compact for finite . Since is closed and intersects a finite level set, the minimum is attained on the compact set for any with finite divergence.

Connections Master

  • 46.02.06 — Sanov's theorem and the basic method of types; this unit extends to the conditional limit theorem and the I-projection.
  • 37.07.02 — Cramer's theorem for large deviations of the sample mean; the contraction principle derives Cramer from Sanov.
  • 46.04.01 — Hypothesis testing and the Stein lemma; the I-projection identifies the least favourable alternative distribution.
  • 46.04.02 — Chernoff information is the Sanov rate for the symmetric hypothesis testing problem; the I-projection onto the set of distributions equidistant from both hypotheses gives the Chernoff information.
  • 46.01.02 — KL divergence is both the rate function here and the divergence measure defined in the foundational unit.

Historical & philosophical context Master

The conditional limit theorem was proved by Imre Csiszar in his 1984 paper "Sanov Property, Generalized I-Projection and Conditional Limit Theorem" (Annals of Probability 12(3), pp. 768-793). Csiszar unified three separate ideas — Sanov's theorem (1957), the I-projection (an information-geometric concept), and the conditional limit theorem (a probabilistic result) — into a single framework using the method of types.

The Gibbs conditioning principle, which predates the conditional limit theorem, has its roots in statistical mechanics. The exponential tilt form of the I-projection is the information-theoretic manifestation of the maximum entropy principle of E. T. Jaynes (1957), which states that among all distributions consistent with observed constraints, the one with maximum entropy (minimum KL divergence from a reference) should be preferred.

The connection to the EM algorithm was clarified by Csiszar and Tusnady (1984), who showed that alternating I-projections and M-projections converge to the distribution that minimises subject to moment constraints, generalising the EM algorithm from a computational trick to an information-geometric procedure.

Bibliography Master

@article{csiszar1984,
  author  = {Csisz{\'a}r, I.},
  title   = {Sanov Property, Generalized {I}-Projection and a Conditional Limit Theorem},
  journal = {Annals of Probability},
  volume  = {12},
  number  = {3},
  pages   = {768--793},
  year    = {1984},
}
@article{jaynes1957,
  author  = {Jaynes, E. T.},
  title   = {Information Theory and Statistical Mechanics},
  journal = {Physical Review},
  volume  = {106},
  pages   = {620--630},
  year    = {1957},
}
@book{dembo-zeitouni1998,
  author    = {Dembo, A. and Zeitouni, O.},
  title     = {Large Deviations Techniques and Applications},
  edition   = {2nd},
  publisher = {Springer},
  year      = {1998},
}
@book{cover-thomas2006,
  author    = {Cover, T. M. and Thomas, J. A.},
  title     = {Elements of Information Theory},
  edition   = {2nd},
  publisher = {Wiley},
  year      = {2006},
}