Entropy of random variables #
Random variables carry the quantities of a measure through their laws: the entropy H[X ; μ] and
mutual information I[X : Y ; μ], and their expectations over the values of a third variable, the
conditional entropy H[X | Y ; μ] and conditional mutual information I[X : Y | Z ; μ]. On finite
types these obey the chain rule and vanish, for mutual
information, exactly on independent and
conditionally independent variables, so
conditioning leaves entropy unchanged only under independence.
Implementation notes #
[UPSTREAM] candidate: mathlib has no entropy of a random variable and no mutual information,
conditional or not.
References #
- [CT06], chapter 2.
- The PFR project,
PFR/ForMathlib/Entropy/Basic.lean.
The entropy of a random variable is the entropy of its law.
Equations
- InformationTheory.entropy X μ = InformationTheory.measureEntropy (MeasureTheory.Measure.map X μ)
Instances For
The entropy of a random variable is the entropy of its law.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The entropy of a random variable valued in a finite set is a sum over that set.
A random variable with at most one value has no entropy.
A constant random variable has no entropy.
A random variable has zero entropy iff it is almost surely constant.
Entropy is invariant under an injective recoding of the values.
The conditional entropy of X given Y is the expectation, under the law of Y, of the
entropy of X conditioned on Y = y.
Equations
- InformationTheory.condEntropy X Y μ = ∫ (y : T), InformationTheory.entropy X μ[|Y ⁻¹' {y}] ∂MeasureTheory.Measure.map Y μ
Instances For
The conditional entropy of X given Y is the expectation, under the law of Y, of the
entropy of X conditioned on Y = y.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Recoding X injectively leaves its entropy given Y unchanged.
Recoding Y by a measurable embedding leaves the entropy of X given Y unchanged.
Mutual information of two random variables.
Equations
- InformationTheory.mutualInfo X Y μ = InformationTheory.entropy X μ + InformationTheory.entropy Y μ - InformationTheory.entropy (fun (ω : Ω) => (X ω, Y ω)) μ
Instances For
Mutual information of two random variables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The mutual information of two random variables is that of their joint law.
Mutual information is symmetric.
The conditional mutual information of X and Y given Z is the expectation, under the law of
Z, of the mutual information of X and Y conditioned on Z = z.
Equations
- InformationTheory.condMutualInfo X Y Z μ = ∫ (z : U), InformationTheory.mutualInfo X Y μ[|Z ⁻¹' {z}] ∂MeasureTheory.Measure.map Z μ
Instances For
The conditional mutual information of X and Y given Z is the expectation, under the law of
Z, of the mutual information of X and Y conditioned on Z = z.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Chain rule. The entropy of a pair is H[X, Y] = H[Y] + H[X | Y].
Conditioning reduces entropy, H[X | Y] ≤ H[X].
On finite types, mutual information is the expected logarithm of the ratio of the joint mass to the product of the marginal masses.
Mutual information vanishes exactly on independent random variables.
The entropy of a pair of independent random variables is the sum of their entropies.
Conditioning leaves the entropy of X unchanged exactly when Y is independent of X.
Conditioning also on a random variable independent of the pair (X, Y) leaves the entropy
of X given Y unchanged.
Conditional mutual information vanishes exactly when X and Y are independent given each
value of Z.
On finite types, conditional mutual information is the expected logarithm of the ratio of the conditional joint mass to the product of the conditional marginal masses.
Conditioning on a function of Y leaves at least the entropy that conditioning on Y
leaves.
Recoding X injectively, in a way that may depend on Y, leaves the entropy of X given
Y unchanged.
A function of Y has no entropy given Y.
A function of a random variable has at most its entropy.
A random variable has at most the entropy of its sample-space measure.
Conditional entropy is determined by the joint law.
On finite types, conditional entropy vanishes exactly when X is almost surely a function
of Y.
On a joint law, the conditional entropy of the first coordinate given the second is the entropy of the first marginal less the mutual information.
Mutual information is at most the entropy of the second marginal.