Shannon's source coding theorem


In information theory, Shannon's source coding theorem establishes the statistical limits to possible data compression for data whose source is an independent identically-distributed random variable, and the operational meaning of the Shannon entropy.
Named after Claude Shannon, the source coding theorem shows that, in the limit, as the length of a stream of independent and identically-distributed random variable (i.i.d.) data tends to infinity, it is impossible to compress such data such that the code rate is less than the Shannon entropy of the source, without it being virtually certain that information will be lost. However it is possible to get the code rate arbitrarily close to the Shannon entropy, with negligible probability of loss.
The source coding theorem for symbol codes places an upper and a lower bound on the minimal possible expected length of codewords as a function of the entropy of the input word and of the size of the target alphabet.
Note that, for data that exhibits more dependencies, the Kolmogorov complexity, which quantifies the minimal description length of an object, is more suitable to describe the limits of data compression. Shannon entropy takes into account only frequency regularities while Kolmogorov complexity takes into account all algorithmic regularities, so in general the latter is smaller. On the other hand, if an object is generated by a random process in such a way that it has only frequency regularities, entropy is close to complexity with high probability.

Statements

Source coding is a mapping from symbols from an information source to a sequence of alphabet symbols such that the source symbols can be exactly recovered from the alphabet symbols or recovered within some distortion. This is one approach to data compression.

Proof: source coding theorem

Given is an i.i.d. source, its time series is i.i.d. with entropy in the discrete-valued case and differential entropy in the continuous-valued case. The Source coding theorem states that for any, i.e. for any rate larger than the entropy of the source, there is large enough and an encoder that takes i.i.d. repetition of the source,, and maps it to binary bits such that the source symbols are recoverable from the binary bits with probability of at least.
Proof of Achievability. Fix some, and let
The typical set,, is defined as follows:
The asymptotic equipartition property shows that for large enough, the probability that a sequence generated by the source lies in the typical set,, as defined approaches one. In particular, for sufficiently large, can be made arbitrarily close to 1, and specifically, greater than .
The definition of typical sets implies that those sequences that lie in the typical set satisfy:
Since bits are enough to point to any string in this set.
The encoding algorithm: the encoder checks if the input sequence lies within the typical set; if yes, it outputs the index of the input sequence within the typical set; if not, the encoder outputs an arbitrary digit number. As long as the input sequence lies within the typical set, the encoder does not make any error. So, the probability of error of the encoder is bounded above by.
Proof of converse: the converse is proved by showing that any set of size smaller than would cover a set of probability bounded away from.

Extension to non-stationary independent sources

Fixed rate lossless source coding for discrete time non-stationary independent sources

Define typical set as:
Then, for given, for large enough,. Now we just encode the sequences in the typical set, and usual methods in source coding show that the cardinality of this set is smaller than. Thus, on an average, bits suffice for encoding with probability greater than, where and can be made arbitrarily small, by making larger.