Skip to main content
KetQat

Appearance

Theorem · intermediate

Source coding theorem (lossless compression)

n independent samples of a source with entropy H can be compressed into about nH bits and recovered with vanishing error, and no scheme using fewer than nR bits with R < H succeeds with non-vanishing probability. Entropy is the optimal compression rate.

Established resultMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

Let X1,X2,…X_1, X_2, \dots be i.i.d. on a finite set X\mathcal{X} with entropy HH. A block code of length nn and rate RR is a pair of maps fn:Xn→{0,1}mf_n : \mathcal{X}^n \to \{0, 1\}^{m} and gn:{0,1}m→Xng_n : \{0, 1\}^{m} \to \mathcal{X}^n with m≤⌈nR⌉m \le \lceil nR \rceil; its error probability is Pr⁡[gn(fn(Xn))≠Xn]\Pr[g_n(f_n(X^n)) \ne X^n].

  1. Achievability. For every R>HR > H there are block codes of rate RR whose error probability tends to 00 as n→∞n \to \infty.
  2. Strong converse. For every R<HR < H and every sequence of block codes with m≤nRm \le nR, the probability of correct decoding tends to 00.

The rate is in bits per source symbol. A related zero-error statement for variable-length codes: the expected length LL of an optimal prefix-free code for one symbol satisfies H≤L<H+1H \le L < H + 1, so coding blocks of nn symbols achieves rate below H+1/nH + 1/n (chapter 5 of Cover and Thomas). The theorem is due to Shannon; the block-coding form with the typical set is chapter 3 of Cover and Thomas. The quantum analogue, Schumacher compression, replaces HH by the von Neumann entropy.

Holds when

  • An i.i.d. source on a finite alphabet with entropy H in bits.
  • Fixed-length block coding with error probability that must vanish as n grows; the variable-length zero-error version is a separate statement quoted below.

Proof

Proof of the source coding theoremDraft

Write T=Tδ(n)T = T_\delta^{(n)} for the typical set of the asymptotic equipartition property.

Achievability. Let R>HR > H and δ=(R−H)/2>0\delta = (R - H)/2 > 0. Then ∣T∣≤2n(H+δ)≤2nR≤2⌈nR⌉\abs{T} \le 2^{n(H + \delta)} \le 2^{nR} \le 2^{\lceil nR \rceil}, so there is an injective map fn:T→{0,1}⌈nR⌉f_n : T \to \{0, 1\}^{\lceil nR \rceil}; extend fnf_n arbitrarily to all of Xn\mathcal{X}^n and let gng_n invert it on fn(T)f_n(T). Every xn∈Tx^n \in T is recovered, so the error probability is at most Pr⁡[Xn∉T]\Pr[X^n \notin T], which tends to 00.

Strong converse. Let R<HR < H and δ=(H−R)/2>0\delta = (H - R)/2 > 0. Any decoder gn:{0,1}m→Xng_n : \{0, 1\}^{m} \to \mathcal{X}^n with m≤nRm \le nR has an image SS of at most 2nR2^{nR} sequences, and decoding is correct only if Xn∈SX^n \in S. Using the upper bound p(xn)≤2−n(H−δ)p(x^n) \le 2^{-n(H - \delta)} on TT,

Pr⁡[Xn∈S]≤Pr⁡[Xn∈S∩T]+Pr⁡[Xn∉T]≤2nR 2−n(H−δ)+Pr⁡[Xn∉T]=2−n(H−R)/2+Pr⁡[Xn∉T],\Pr[X^n \in S] \le \Pr[X^n \in S \cap T] + \Pr[X^n \notin T] \le 2^{nR}\, 2^{-n(H - \delta)} + \Pr[X^n \notin T] = 2^{-n(H - R)/2} + \Pr[X^n \notin T] ,

and both terms tend to 00. This follows chapter 3 of Cover and Thomas.

Mentions
Related

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. C. E. Shannon (1948). A Mathematical Theory of Communication. Bell System Technical Journal 27 (3), 379-423. doi:10.1002/j.1538-7305.1948.tb01338.x
  2. Thomas M. Cover, Joy A. Thomas (2005). Elements of Information Theory. Wiley (2nd edition). doi:10.1002/047174882X

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Achievability for R > H and the strong converse for R < H compared with Polyanskiy and Wu, Information Theory: From Coding to Learning (authors' open PDF) Corollary 11.3 (error probability tends to 0 or 1); the prefix-code bound H <= L < H + 1 compared with Theorem 10.10 there and re-derived (Shannon code lengths ceil(log 1/p)); block rate below H + 1/n re-derived. Cover and Thomas chapters 3 and 5 titles confirmed via Crossref.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e

Current revision d8b829ee286eabaa. Source file knowledge/records/theorem/source-coding-theorem.md in the content repository (readable there once it is public).