InformationTheory.Shannon.EntropyRate
Entropy rate of a stationary process #
For a stationary process p : StationaryProcess μ α on a finite alphabet α,
the block entropy is H_n := H(X_0, …, X_{n-1}) and the entropy rate
is H := lim_{n → ∞} H_n / n (Cover–Thomas). Existence of the limit is
the principal content of this file.
The Birkhoff ergodic theorem and the Shannon–McMillan–Breiman theorem build on
entropyRate defined here.
Main definitions #
blockEntropy μ p n := entropy μ (p.blockRV n)— block entropyH(X_0, …, X_{n-1}).entropyRate μ p := Filter.atTop.limUnder (fun n => blockEntropy μ p n / n).conditionalEntropyTail μ p n := condEntropy μ (p.obs n) (p.blockRV n)—H(X_n | X_0, …, X_{n-1}).
Main statements #
blockEntropy_succ_chain_rule—H_{n+1} = H_n + H(X_n | X_{<n})(chain rule).blockEntropy_eq_sum_conditionalEntropyTail— iterated chain rule.blockEntropy_zero—H_0 = 0.conditionalEntropyTail_nonneg—0 ≤ H(X_n | X_{<n}).conditionalEntropyTail_antitone—H(X_n | X_{<n})non-increasing, from stationarity (joint pushforward equality viaMeasurePreserving T)- conditioning monotonicity (
condEntropy_le_condEntropy_of_pair).
- conditioning monotonicity (
entropyRate_exists_of_stationary—blockEntropy / nconverges: the antitone tail converges to someL, and Cesàro on the chain-rule decomposition givesblockEntropy / n → L.entropyRate_eq_lim_condEntropy—H(X_n | X_{<n}) → entropyRate, viaFilter.Tendsto.limUnder_eqon the Cesàro convergence to identifyentropyRate = L = lim tail.
InformationTheory.Shannon.blockEntropy
sourceBlock entropy H(X_0, …, X_{n-1}) of a stationary process.
Equations
Instances For
Used by
InformationTheory.Shannon.conditionalEntropyTail
sourceThe per-step conditional entropy H(X_n | X_0, …, X_{n-1}). Decreasing in
n for a stationary process.
Equations
Instances For
Used by
InformationTheory.Shannon.entropyRate
sourceEntropy rate lim H(X_0, …, X_{n-1}) / n (Cover-Thomas). Existence
proven by entropyRate_exists_of_stationary.
Equations
- InformationTheory.Shannon.entropyRate μ p = Filter.atTop.limUnder fun (n : ℕ) => InformationTheory.Shannon.blockEntropy μ p n / ↑n
Instances For
Used by
InformationTheory.Shannon.entropyRate₂
sourceThe base-2 (bit) entropy rate: the natural-log entropyRate divided by
Real.log 2, i.e. the entropy rate measured in bits/symbol. This is the
target the LZ78 bit-rate lz78GreedyEncodingLength/n converges to (the
LZ78 encoding length uses LZ78Phrase.bitLength = Nat.log 2 …, a base-2 code
length, so its per-symbol rate is in bits, whereas entropyRate is in nats).
Equations
Instances For
Used by
Chain rule #
H_{n+1} = H_n + H(X_n | X_{<n}), the engine of the existence proof.
InformationTheory.Shannon.blockEntropy_succ_chain_rule
sourceChain rule for block entropy: H_{n+1} = H_n + H(X_n | X_{<n}).
Strategy: apply MeasurableEquiv.piFinSuccAbove α (Fin.last n) (forward
direction) to blockRV (n+1) ω = fun i => obs i ω, getting
(obs n ω, fun j : Fin n => obs ((Fin.last n).succAbove j) ω) = (obs n ω, blockRV n ω).
Then use prodComm to swap to (blockRV n ω, obs n ω) and apply
entropy_pair_eq_entropy_add_condEntropy for the chain rule.
Used by
Antitonicity of conditionalEntropyTail #
H(X_{n+1} | X_0, …, X_n) ≤ H(X_n | X_0, …, X_{n-1}). Proof:
- By stationarity (apply shift
T), the joint pushforwardμ.map (X_n, (X_0, …, X_{n-1}))equalsμ.map (X_{n+1}, (X_1, …, X_n)), so the corresponding conditional entropies coincide (viacondDistrib_map). - By conditioning monotonicity (
condEntropy_le_condEntropy_of_pair),H(X_{n+1} | (X_0, (X_1, …, X_n))) ≤ H(X_{n+1} | (X_1, …, X_n)). The conditioner(X_0, (X_1, …, X_n))reshapes toblockRV (n+1)viaMeasurableEquiv.piFinSuccAbove ... 0+prodComm.
InformationTheory.Shannon.condEntropy_eq_pushforward
sourceConditional entropy H(Xs | Yo) depends only on the joint pushforward
μ.map (fun ω => (Xs ω, Yo ω)).
Used by
InformationTheory.Shannon.conditionalEntropyTail_antitone
sourceUsed by
InformationTheory.Shannon.conditionalEntropyTail_nonneg
sourceConditional entropy on a finite alphabet is bounded above by log |α|,
hence the tail is uniformly bounded. We only need 0 ≤ tail for the existence
proof.
Used by
Existence of the entropy rate #
We show Tendsto (blockEntropy μ p n / n) atTop (𝓝 H) for some H, by the
following route:
- The chain rule gives
blockEntropy μ p n = ∑_{i < n} conditionalEntropyTail μ p i. conditionalEntropyTail_antitone+ non-negativity ⇒ tail converges to someL = ⨅ n, tail n.- The Cesàro lemma
Filter.Tendsto.cesaroconvertsTendsto tail → Tendsto avg, and the chain-rule identity rewrites the Cesàro average asblockEntropy / n.
InformationTheory.Shannon.blockEntropy_zero
sourceblockEntropy μ p 0 = 0 (the empty block is constant).
Used by
InformationTheory.Shannon.blockEntropy_eq_sum_conditionalEntropyTail
sourceBlock entropy expanded as a sum of conditional entropy tails (iterated chain rule).
Used by
InformationTheory.Shannon.entropyRate_exists_of_stationary
sourceThe entropy rate exists, i.e. blockEntropy μ p n / n converges.
Strategy: the chain rule + antitonicity say tail n is antitone and nonneg, hence
converges to some L. By Cesàro, (1/n) ∑_{i<n} tail i → L. By the chain rule,
this equals blockEntropy μ p n / n.
Used by
Equality with lim conditionalEntropyTail #
Tendsto (conditionalEntropyTail μ p) atTop (𝓝 (entropyRate μ p)).
Strategy: the chain rule + Cesàro gives blockEntropy / n → L = lim tail. The
entropyRate is the limit of blockEntropy / n (Filter.limUnder of a convergent
sequence equals the limit). The two limits agree by uniqueness.