← All solved theorems
Covering Lemma and Shannon's Rate–Distortion Theorem (Converse & Achievability)
proved in Lean
To describe a source to within average distortion D you need at least R(D) bits per symbol, and R(D) bits suffice, where R(D) is a single-letter mutual-information minimization. This is the fundamental limit of lossy compression.
Claude E. Shannon; Toby Berger (1959) · Ch. 10 · Rate–Distortion Theory · Cover & Thomas, Theorem 10.2.1 & Lemma 10.6.1; El Gamal & Kim, Lemma 3.3
Statement
For a finite i.i.d. source $P$ and bounded single-letter distortion $d : \mathcal{X} \times \hat{\mathcal{X}} \to \mathbb{R}_{\ge 0}$:
- For all feasible distortions $D \ge D_{\min}$, $R(D)$ is nonnegative, nonincreasing, convex, and right-continuous in $D$.
- Converse: Every $(n, M)$ block code with expected per-symbol distortion $\le D$ obeys $\frac{1}{n}\log_2 M \ge R(D)$.
- Covering Lemma: $M$ i.i.d. codewords $\sim P_{\hat X}^n$ cover $X^n \sim P_X^n$ in $A_\varepsilon^{(n)}$ with probability $\to 1$ whenever $R > I(X; \hat X) + 3\varepsilon$.
- Operational Equality: For every feasible $D \ge D_{\min}$, the operational rate–distortion function equals the single-letter information rate–distortion function: $R_{\mathrm{op}}(D) = R(D)$.
How the proof works
Proves convexity of $I(X; \hat X)$ in the test channel calculus-free via strong subadditivity, establishes right-continuity of $R(D)$ at every feasible $D$ (including $D = D_{\min}$) via compactness of the feasible joint-distribution simplex, derives the converse via time-sharing mixtures, proves Cover & Thomas Lemma 10.5.3 $(1 - xy)^M \le 1 - x + e^{-My}$ for the Covering Lemma, and combines both halves into the full operational equality shannon_rate_distortion_theorem against InfoTheory.Core.SourceCoding.rateDistortion.
Lean declarations (7)
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.
theorem rateDistortion_convex {P : ProbDist α} {d : Distortion α β} {D₁ D₂ lam : ℝ}
(hfeas₁ : ∃ Q : ProbDist (α × β), Q.fst = P ∧ expectedDist Q d ≤ D₁)
(hfeas₂ : ∃ Q : ProbDist (α × β), Q.fst = P ∧ expectedDist Q d ≤ D₂)
(h0 : 0 ≤ lam) (h1 : lam ≤ 1) :
rateDistortion P d (lam * D₁ + (1 - lam) * D₂) ≤
lam * rateDistortion P d D₁ + (1 - lam) * rateDistortion P d D₂ := by …
theorem rateDistortion_rightContinuous (P : ProbDist α) (d : Distortion α β) {D : ℝ}
(hfeas : ∃ Q : ProbDist (α × β), Q.fst = P ∧ expectedDist Q d ≤ D) :
∀ ε > 0, ∃ δ > 0, rateDistortion P d D - ε ≤ rateDistortion P d (D + δ) := by …
theorem rateDistortion_converse (P : ProbDist α) (d : Distortion α β) {n M : ℕ}
(hn : 0 < n) (hM : 0 < M)
(enc : (Fin n → α) → Fin M) (dec : Fin M → (Fin n → β)) {D : ℝ}
(hdist : ∑ x : Fin n → α, (iidDist P n).pmf x * blockDist d x (dec (enc x)) ≤ D) :
rateDistortion P d D ≤ log2 (M : ℝ) / (n : ℝ) := by …
theorem covering_lemma (P : ProbDist (α × β)) (n M : ℕ) {ε : ℝ} (hε : 0 ≤ ε) :
∑ C : Fin M → Fin n → β, (codebookDist P.snd n M).pmf C *
(∑ x : Fin n → α, (iidDist P.fst n).pmf x *
(if ∀ m : Fin M, (x, C m) ∉ jointTypicalSet P n ε then (1 : ℝ) else 0)) ≤
(1 - ∑ xy ∈ jointTypicalSet P n ε, (jointIidDist P n).pmf xy) +
Real.exp (-((M : ℝ) * (2 : ℝ) ^ (-((n : ℝ) * (mutualInfo P + 3 * ε))))) := …
theorem covering_lemma_tendsto_zero (P : ProbDist (α × β)) {R ε δ : ℝ}
(hε : 0 < ε) (hR : mutualInfo P + 3 * ε < R) (hδ : 0 < δ) :
∃ N : ℕ, ∀ n ≥ N,
let M := Nat.max 1 (Nat.floor ((2 : ℝ) ^ ((n : ℝ) * R)))
∑ C : Fin M → Fin n → β, (codebookDist P.snd n M).pmf C *
(∑ x : Fin n → α, (iidDist P.fst n).pmf x *
(if ∀ m : Fin M, (x, C m) ∉ jointTypicalSet P n ε then (1 : ℝ) else 0)) ≤ δ := by …
theorem rateDistortion_achievability (P : ProbDist α) (d : Distortion α β) {D R δ : ℝ}
(hfeas : ∃ Q : ProbDist (α × β), Q.fst = P ∧ expectedDist Q d ≤ D)
(hR : rateDistortion P d D < R) (hδ : 0 < δ) :
∃ N : ℕ, ∀ n ≥ N,
let M := Nat.max 1 (Nat.floor ((2 : ℝ) ^ ((n : ℝ) * R)))
∃ (enc : (Fin n → α) → Fin M) (dec : Fin M → (Fin n → β)),
∑ x : Fin n → α, (iidDist P n).pmf x * blockDist d x (dec (enc x)) ≤ D + δ := by …
theorem shannon_rate_distortion_theorem (P : ProbDist α) (d : Distortion α β) {D : ℝ}
(hfeas : ∃ Q : ProbDist (α × β), Q.fst = P ∧ expectedDist Q d ≤ D) :
operationalRateDistortion P d D = rateDistortion P d D := by …
Related open problems (8)
Open problems that build on, generalize, or are analogous to this theorem.