Documentation

Linglib.Core.InformationTheory.ChannelCapacity

Channel capacity #

A channel from inputs C to outputs W is a Markov kernel κ : Kernel C W. An input distribution μ induces the joint law μ ⊗ₘ κ and the output marginal κ ∘ₘ μ, and the capacity of the channel is the supremum over input distributions of the mutual information Im[μ ⊗ₘ κ].

Over finite alphabets the mutual information is the input average of the divergence of each row κ c from the output marginal, and averaging the divergence from any other reference measure overshoots it by the divergence of the output marginal from that reference (the compensation identity). An input distribution achieves capacity when no row lies farther from its output marginal than the information it conveys.

Each row's divergence is also the row's expected log posterior of its input less the input's log prior, and the Bayesian decoder maximizes that expected log posterior. Hence, taking a fixed input distribution's expected log posteriors as the exponent, the free energy relative to the uniform distribution of every input distribution is at most its mutual information less log |C|, with equality at the fixed distribution. By the Gibbs variational principle the capacity-achieving input distributions of positive mass everywhere are exactly the fixed points of the Blahut–Arimoto update, which tilts the uniform distribution by that exponent, and at such a fixed point every row lies at divergence exactly the capacity from the output marginal.

Main definitions #

Main results #

References #

noncomputable def InformationTheory.channelCapacity {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] (κ : ProbabilityTheory.Kernel C W) :
ℝ

The capacity of a channel is the supremum over input distributions of the mutual information between its input and output.

Equations
Instances For
    noncomputable def InformationTheory.blahutArimoto {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [MeasurableSingletonClass C] [Nonempty C] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsFiniteKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsFiniteMeasure μ] :
    MeasureTheory.Measure C

    The Blahut–Arimoto update of an input distribution is the uniform distribution tilted by each input's expected log posterior ([Bla72], [Ari72]).

    Equations
    • InformationTheory.blahutArimoto κ μ = (ProbabilityTheory.uniformOn Set.univ).tilted fun (c : C) => ∫ (w : W), Real.log (((ProbabilityTheory.posterior κ μ) w).real {c}) ∂κ c
    Instances For
      theorem InformationTheory.condEntropy_snd_fst_compProd {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] :
      condEntropy Prod.snd Prod.fst (μ.compProd κ) = ∑ c : C, μ.real {c} * measureEntropy (κ c)

      The conditional entropy of a channel's output given its input is the input average of the entropies of the rows.

      theorem InformationTheory.sum_mul_toReal_klDiv {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] (q : MeasureTheory.Measure W) [MeasureTheory.IsProbabilityMeasure q] (hq : ∀ (c : C), μ {c} ≠ 0 → (κ c).AbsolutelyContinuous q) :
      ∑ c : C, μ.real {c} * (klDiv (κ c) q).toReal = measureMutualInfo (μ.compProd κ) + (klDiv (μ.bind ⇑κ) q).toReal

      The compensation identity. Averaging the divergence of the rows of a channel from a reference measure overshoots the mutual information by the divergence of the output marginal from that reference.

      theorem InformationTheory.measureMutualInfo_compProd {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] :
      measureMutualInfo (μ.compProd κ) = ∑ c : C, μ.real {c} * (klDiv (κ c) (μ.bind ⇑κ)).toReal

      Mutual information across a channel is the input average of the divergence of each row from the output marginal.

      theorem InformationTheory.measureMutualInfo_compProd_le_log_card {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] :
      measureMutualInfo (μ.compProd κ) ≤ Real.log ↑(Fintype.card W)

      Mutual information across a channel is at most the log of the number of outputs.

      theorem InformationTheory.channelCapacity_le_log_card {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] :
      channelCapacity κ ≤ Real.log ↑(Fintype.card W)

      The capacity of a channel is at most the log of the number of outputs.

      theorem InformationTheory.channelCapacity_nonneg {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] :
      theorem InformationTheory.measureMutualInfo_compProd_le_channelCapacity {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] :
      measureMutualInfo (μ.compProd κ) ≤ channelCapacity κ
      theorem InformationTheory.measureMutualInfo_compProd_eq_channelCapacity {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] (h : ∀ (c : C), klDiv (κ c) (μ.bind ⇑κ) ≤ ENNReal.ofReal (measureMutualInfo (μ.compProd κ))) :
      measureMutualInfo (μ.compProd κ) = channelCapacity κ

      Sufficiency of the divergence condition. An input distribution achieves capacity when no row of the channel lies farther from the output marginal than the information conveyed.

      theorem InformationTheory.toReal_klDiv_eq_integral_log_sub {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] [Nonempty C] {c : C} (hc : μ {c} ≠ 0) :
      (klDiv (κ c) (μ.bind ⇑κ)).toReal = ∫ (w : W), Real.log (((ProbabilityTheory.posterior κ μ) w).real {c}) ∂κ c - Real.log (μ.real {c})

      The divergence of a row from the output marginal is the row's expected log posterior of its input, less the input's log prior.

      theorem InformationTheory.sum_mul_integral_log_le {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] [Nonempty C] (φ : W → MeasureTheory.Measure C) [∀ (w : W), MeasureTheory.IsZeroOrProbabilityMeasure (φ w)] (hφ : ∀ (w : W), (μ.bind ⇑κ) {w} ≠ 0 → ((ProbabilityTheory.posterior κ μ) w).AbsolutelyContinuous (φ w)) :
      ∑ c : C, μ.real {c} * ∫ (w : W), Real.log ((φ w).real {c}) ∂κ c ≤ ∑ c : C, μ.real {c} * ∫ (w : W), Real.log (((ProbabilityTheory.posterior κ μ) w).real {c}) ∂κ c

      The Bayesian decoder maximizes the expected log score of the input. No decoder that charges every input the posterior charges does better, even one that gives no guess at some outputs.

      The Blahut–Arimoto fixed point #

      instance InformationTheory.instIsProbabilityMeasureBlahutArimoto {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [MeasurableSingletonClass C] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] [Nonempty C] :
      MeasureTheory.IsProbabilityMeasure (blahutArimoto κ μ)
      theorem InformationTheory.eq_blahutArimoto_iff {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] [Nonempty C] :
      (measureMutualInfo (μ.compProd κ) = channelCapacity κ ∧ ∀ (c : C), μ {c} ≠ 0) ↔ μ = blahutArimoto κ μ

      The capacity-achieving priors are the Blahut–Arimoto fixed points. An input distribution achieves capacity with positive mass everywhere exactly when it is the uniform distribution tilted by each input's expected log posterior ([Bla72], [Ari72]).

      theorem InformationTheory.toReal_klDiv_eq_channelCapacity {C : Type u_1} {W : Type u_2} [MeasurableSpace C] [MeasurableSpace W] [Fintype C] [Fintype W] [MeasurableSingletonClass C] [MeasurableSingletonClass W] (κ : ProbabilityTheory.Kernel C W) [ProbabilityTheory.IsMarkovKernel κ] (μ : MeasureTheory.Measure C) [MeasureTheory.IsProbabilityMeasure μ] [Nonempty C] (hμ : ∀ (c : C), μ {c} ≠ 0) (h : measureMutualInfo (μ.compProd κ) = channelCapacity κ) (c : C) :
      (klDiv (κ c) (μ.bind ⇑κ)).toReal = channelCapacity κ

      Necessity of the divergence condition. An input distribution of positive mass everywhere that achieves capacity puts every row of the channel at divergence exactly the capacity from the output marginal.