Asymptotic Equipartition Property (AEP) and Weak Typicality

proved in Lean

For long sequences from a memoryless source, nearly all the probability sits on a typical set of about 2 to the power nH sequences, each roughly equally likely. This is why the entropy H measures how far data can be compressed.

Claude E. Shannon; Brockway McMillan; Leo Breiman (1948) · Ch. 3–4 · AEP, Typicality & Entropy Rates · Cover & Thomas, Theorems 3.1.1 & 3.1.2

Statement

For an i.i.d. finite source $X^n \sim P^n$ and the weakly typical set $A_\varepsilon^{(n)} = \{x^n : 2^{-n(H(P)+\varepsilon)} \le P^n(x^n) \le 2^{-n(H(P)-\varepsilon)}\}$:

  1. $1 - P^n(A_\varepsilon^{(n)}) \le \frac{V(P)}{n \varepsilon^2} \to 0$ (explicit varentropy Chebyshev bound).
  2. $|A_\varepsilon^{(n)}| \le 2^{n(H(P) + \varepsilon)}$ for all $n$.
  3. $|A_\varepsilon^{(n)}| \ge (1 - \delta) 2^{n(H(P) - \varepsilon)}$ for all sufficiently large $n$.

How the proof works

The idea is the weak law of large numbers: the per-symbol surprisal is an average of independent terms, so Chebyshev's inequality concentrates it around the entropy. Proved completely via finite-sum independence of the centered surprisals $Z_i = -\log_2 P(X_i) - H(P)$ with explicit variance varentropy P.

Lean declarations (4)

The key theorems in the Lean library. Each is compiled with Lean 4, uses only the standard axioms propext, Classical.choice and Quot.sound, and is re-checked by leanchecker. Click a name to see the full proof on GitHub.

Related open problems (3)

Open problems that build on, generalize, or are analogous to this theorem.