Marginals, conditionals, and products of joint PMFs #
Structural operations on PMF (α × β): the projections fst/snd
(row/column marginals), the conditional cond, and the independent
product (a mathlib gap, [UPSTREAM] candidate). These are
measure-free bookkeeping on finite joints; information-theoretic
consumers live in Entropy.lean, Bayesian ones in JointPosterior.lean.
Main definitions #
PMF.fst,PMF.snd— marginals of a joint PMF viaPMF.map.PMF.cond— conditional distribution given a second-coordinate value.PMF.product— independent product distribution.
Main results #
fst_apply/snd_apply— marginals as row/column sums.snd_mul_cond,toMeasure_cond— chain rule and the bridge toProbabilityTheory.cond.product_apply,toMeasure_product— pointwise and measure-level characterization of the product.
A point of positive joint mass has positive first-marginal mass.
A point of positive joint mass has positive second-marginal mass.
The fiber mass over a second-coordinate value is the second marginal.
A positive second marginal is witnessed on its fiber.
The conditional distribution of the first coordinate of a joint given the
second: the discrete disintegration of a joint PMF (the PMF mirror of
MeasureTheory.Measure.condKernel), via PMF.filter on the fiber. Junk
(an arbitrary point mass) at b of marginal mass zero; lemmas hypothesize
G.snd b ≠ 0.
Equations
Instances For
The measure of the conditional is the conditioned measure's first
marginal, connecting PMF.cond to ProbabilityTheory.cond.
The measure of the first marginal is the first marginal of the measure.
The measure of the second marginal is the second marginal of the measure.
Law of the unconscious statistician for the first marginal: the joint expectation of a function of the first coordinate is its expectation under the marginal.
Law of the unconscious statistician for the second marginal.
Product PMF #
PMF.product P Q is the independent joint distribution: (P.product Q) (a, b) = P a · Q b. Foundation for defining mutualInformation as KL(joint ‖ product).
Mathlib gap. PMF.product is missing from mathlib. Defined here via the
standard monadic bind/map construction.
The independent product distribution of two PMFs.
Equations
- P.product Q = P.bind fun (a : α) => PMF.map (Prod.mk a) Q
Instances For
The measure of the product PMF is the product of the measures.