Shtarkov NML, Krichevsky–Trofimov Universal Coding & Exact Minimax Redundancy Asymptotics

proved in Lean

One compression scheme can work almost as well as a scheme tuned to the unknown source: the Krichevsky–Trofimov add-one-half estimator wastes only about (k − 1)/2 times log2 n bits over k letters, and this overhead is asymptotically optimal.

Raphail E. Krichevsky and Victor K. Trofimov; Yuri M. Shtarkov; Robert G. Gallager (1981) · Ch. 11 · Method of Types & Statistics · Krichevsky & Trofimov (1981), IEEE Trans. IT; Shtarkov (1987); Cover & Thomas, §13.1–13.2

Statement

For i.i.d. sources over a finite alphabet $\mathcal{X}$ of size $k = |\mathcal{X}| \ge 1$:

  1. Shtarkov's Minimax Pointwise Regret Theorem: The normalized maximum-likelihood (NML) distribution achieves exact uniform worst-case pointwise regret $\log_2 S_n(\mathcal{X})$ (matching the minimax lower bound over all distributions $Q$).
  2. Krichevsky–Trofimov (1981) Universal Mixture: The sequential add-$1/2$ predictor $q_{\mathrm{KT}}(a \mid x^{<t}) = \frac{N_a(x^{<t}) + 1/2}{t + k/2}$ obeys for every $P$ and $x^n$,

$$\log_2 \frac{P^n(x^n)}{q_{\mathrm{KT}}(x^n)} \le \frac{k - 1}{2} \log_2(n + 1) + 2, \qquad D(P^n \| q_{\mathrm{KT}}) \le \frac{k - 1}{2} \log_2(n + 1) + 2,$$ and yields an explicit universal prefix code with expected length $\mathbb{E}_{P^n}[|c(X^n)|] < n H(P) + \frac{k-1}{2}\log_2(n+1) + k$ for all $P$ simultaneously.

  1. Exact Minimax KL Redundancy Asymptotics: Combining the KT upper bound with the Gallager–Haussler capacity–redundancy lower bound on a $\sqrt{n}$-spaced simplex grid gives

$$\lim_{n \to \infty} \frac{R_n^*(\mathcal{X})}{\log_2 n} = \frac{k - 1}{2}.$$

How the proof works

Proves the exchangeable rising-factorial formula ktDist_pmf_eq_prod, an elementary Stirling-free binary ratio bound kt_binary_ratio_le ($\le 2\sqrt{n}$), alphabet induction kt_ml_ratio_le, Kraft prefix-code construction universal_prefix_code_redundancy_le, the Bayes compensation identity bayes_kl_decomposition, and the matching simplex-grid lower bound minimax_kl_redundancy_ge yielding minimax_kl_redundancy_asymptotics.

Lean declarations (8)

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.