InformationTheory

InformationTheory.Shannon.CondMutualInfo

source

Conditional mutual information and Markov chains #

Conditional mutual information condMutualInfo and the Markov chain predicate IsMarkovChain, together with the chain rule and the implication Markov ⇒ condMI = 0.

Main definitions #

  • condMutualInfoI(X; Y | Z) := KL(P_Z ⊗ P_{(X,Y)|Z} ‖ P_Z ⊗ (P_{X|Z} × P_{Y|Z})).
  • IsMarkovChain — joint factorization form (γ-form): μ.map (Z, X, Y) equals (μ.map Z) ⊗ₘ (condDistrib X Z μ ×ₖ condDistrib Y Z μ).

Main statements #

Implementation notes #

The γ-form definition of IsMarkovChain (joint measure factorization) is chosen over the β-form (condDistrib equality via prodMkRight) because the β-form requires [StandardBorelSpace Ω] on the ambient space, whereas the γ-form avoids this constraint. The two forms are equivalent under standard Borel hypotheses via Mathlib's condIndepFun_iff_condDistrib_prod_ae_eq_prodMkRight.

noncomputable def

InformationTheory.Shannon.condMutualInfo

source
{Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsFiniteMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Yo : ΩY) (Zc : ΩZ) :

Conditional mutual information via KL divergence (compProd form): I(X; Y | Z) := KL(P_Z ⊗ P_{(X,Y)|Z} ‖ P_Z ⊗ (P_{X|Z} × P_{Y|Z})).

The compProd form is the defining shape because it connects directly to Mathlib's chain rule (klDiv_compProd_eq_add) and makes condMutualInfo = 0 under a Markov hypothesis immediate via klDiv_self.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Used by
      theorem

      InformationTheory.Shannon.condMutualInfo_nonneg

      source
      {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsFiniteMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Yo : ΩY) (Zc : ΩZ) :
      0 condMutualInfo μ Xs Yo Zc

      Conditional mutual information is non-negative (klDiv is ℝ≥0∞-valued).

      Used by
        theorem

        InformationTheory.Shannon.condMutualInfo_congr_measure

        source
        {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] {μ ρ : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure μ] [MeasureTheory.IsFiniteMeasure ρ] (h : μ = ρ) (Xs : ΩX) (Yo : ΩY) (Zc : ΩZ) :
        condMutualInfo μ Xs Yo Zc = condMutualInfo ρ Xs Yo Zc
        Used by
          def

          InformationTheory.Shannon.IsMarkovChain

          source
          {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsFiniteMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Zc : ΩZ) (Yo : ΩY) :

          Markov chain Xs → Zc → Yo (γ-form, joint factorization): the joint distribution factors through Zc as the product of the conditional marginals.

          Chosen over the β-form (condDistrib equality + prodMkRight) to avoid requiring [StandardBorelSpace Ω] on the ambient space. The two forms are equivalent under standard Borel hypotheses.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Used by
              theorem

              InformationTheory.Shannon.mutualInfo_chain_rule

              source
              {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Yo : ΩY) (Zc : ΩZ) (hXs : Measurable Xs) (hYo : Measurable Yo) (hZc : Measurable Zc) :
              mutualInfo μ (fun (ω : Ω) => (Zc ω, Xs ω)) Yo = mutualInfo μ Zc Yo + condMutualInfo μ Xs Yo Zc

              Chain rule: I((Z, X); Y) = I(Z; Y) + I(X; Y | Z).

              Used by
                theorem

                InformationTheory.Shannon.condMutualInfo_comm

                source
                {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Yo : ΩY) (Zc : ΩZ) (hXs : Measurable Xs) (hYo : Measurable Yo) (hZc : Measurable Zc) :
                condMutualInfo μ Xs Yo Zc = condMutualInfo μ Yo Xs Zc

                Symmetry of conditional mutual information: I(X; Y | Z) = I(Y; X | Z).

                Used by
                  theorem

                  InformationTheory.Shannon.condMutualInfo_ne_top

                  source
                  {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] [Fintype X] [MeasurableSingletonClass X] [Fintype Y] [MeasurableSingletonClass Y] [Fintype Z] [MeasurableSingletonClass Z] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Yo : ΩY) (Zc : ΩZ) (hXs : Measurable Xs) (hYo : Measurable Yo) (hZc : Measurable Zc) :
                  condMutualInfo μ Xs Yo Zc

                  Over finite alphabets, conditional mutual information is finite.

                  Used by
                    theorem

                    InformationTheory.Shannon.condMutualInfo_eq_zero_of_markov

                    source
                    {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Zc : ΩZ) (Yo : ΩY) (hXs : Measurable Xs) (_hZc : Measurable Zc) (hYo : Measurable Yo) (hmarkov : IsMarkovChain μ Xs Zc Yo) :
                    condMutualInfo μ Xs Yo Zc = 0

                    Markov chain Xs → Zc → Yo (γ-form) implies I(X; Y | Z) = 0.

                    Used by
                      theorem

                      InformationTheory.Shannon.mutualInfo_le_of_markov

                      source
                      {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Zc : ΩZ) (Yo : ΩY) (hXs : Measurable Xs) (hZc : Measurable Zc) (hYo : Measurable Yo) (hmarkov : IsMarkovChain μ Xs Zc Yo) :
                      mutualInfo μ Xs Yo mutualInfo μ Zc Yo

                      Markov chain Xs → Zc → Yo implies I(Xs; Yo) ≤ I(Zc; Yo).

                      Used by
                        theorem

                        InformationTheory.Shannon.mutualInfo_le_add_condMutualInfo

                        source
                        {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Zc : ΩZ) (Yo : ΩY) (hXs : Measurable Xs) (hZc : Measurable Zc) (hYo : Measurable Yo) :
                        mutualInfo μ Xs Yo mutualInfo μ Xs Zc + condMutualInfo μ Xs Yo Zc
                        Used by

                          MeasurableEquiv invariance of condMutualInfo #

                          For channel coding arguments involving reshaping such as Y^n ↔ Y_i × Y^{≠i}, the following lemmas establish invariance of condMutualInfo under MeasurableEquiv on each argument.

                          theorem

                          InformationTheory.Shannon.condMutualInfo_map_left_measurableEquiv

                          source
                          {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] {X' : Type u_5} [MeasurableSpace X'] [StandardBorelSpace X'] [Nonempty X'] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Yo : ΩY) (Zc : ΩZ) (hXs : Measurable Xs) (hYo : Measurable Yo) (hZc : Measurable Zc) (e : X ≃ᵐ X') :
                          condMutualInfo μ (fun (ω : Ω) => e (Xs ω)) Yo Zc = condMutualInfo μ Xs Yo Zc

                          Reshaping the left argument leaves the CMI fixed: I(e ∘ X; Y | Z) = I(X; Y | Z) for any MeasurableEquiv e : X ≃ᵐ X'.

                          Used by
                            theorem

                            InformationTheory.Shannon.condMutualInfo_map_middle_measurableEquiv

                            source
                            {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] {Y' : Type u_5} [MeasurableSpace Y'] [StandardBorelSpace Y'] [Nonempty Y'] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Yo : ΩY) (Zc : ΩZ) (hXs : Measurable Xs) (hYo : Measurable Yo) (hZc : Measurable Zc) (e : Y ≃ᵐ Y') :
                            condMutualInfo μ Xs (fun (ω : Ω) => e (Yo ω)) Zc = condMutualInfo μ Xs Yo Zc

                            Reshaping the right (middle) argument leaves the CMI fixed: I(X; e ∘ Y | Z) = I(X; Y | Z) for e : Y ≃ᵐ Y'.

                            Follows from condMutualInfo_comm and condMutualInfo_map_left_measurableEquiv.

                            Used by
                              theorem

                              InformationTheory.Shannon.condMutualInfo_map_cond_measurableEquiv

                              source
                              {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] {Z' : Type u_5} [MeasurableSpace Z'] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Yo : ΩY) (Zc : ΩZ) (hXs : Measurable Xs) (hYo : Measurable Yo) (hZc : Measurable Zc) (e : Z ≃ᵐ Z') :
                              (condMutualInfo μ Xs Yo fun (ω : Ω) => e (Zc ω)) = condMutualInfo μ Xs Yo Zc

                              Reshaping the conditioner leaves the CMI fixed: I(X; Y | e ∘ Z) = I(X; Y | Z) for any MeasurableEquiv e : Z ≃ᵐ Z'. The conditioner carries the same information after a measurable-equiv relabel. Companion to condMutualInfo_map_left_measurableEquiv and condMutualInfo_map_middle_measurableEquiv (the third argument slot). @audit:ok

                              Used by

                                Stability of IsMarkovChain under post-processing #

                                theorem

                                InformationTheory.Shannon.isMarkovChain_map_left

                                source
                                {Ω : Type u_1} [MeasurableSpace Ω] {X : Type u_2} [MeasurableSpace X] {Y : Type u_3} [MeasurableSpace Y] {Z : Type u_4} [MeasurableSpace Z] {X' : Type u_5} [MeasurableSpace X'] [StandardBorelSpace X'] [Nonempty X'] (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace X] [Nonempty X] [StandardBorelSpace Y] [Nonempty Y] (Xs : ΩX) (Zc : ΩZ) (Yo : ΩY) (hXs : Measurable Xs) (hZc : Measurable Zc) (hYo : Measurable Yo) {f : XX'} (hf : Measurable f) (hmarkov : IsMarkovChain μ Xs Zc Yo) :
                                IsMarkovChain μ (fun (ω : Ω) => f (Xs ω)) Zc Yo

                                Markov chains are stable under post-processing on the left: if Xs → Zc → Yo is a Markov chain and f : X → X' is measurable, then f ∘ Xs → Zc → Yo is also a Markov chain.

                                Used by