PMF Utilities #
NB: This module is temporary #
Everything here is a general PMF bind/pure lemma with no dependence on
any domain-specific structure. It should be upstreamed to Mathlib
(likely Mathlib.Probability.ProbabilityMassFunction.Monad or a new
Mathlib.Probability.ProbabilityMassFunction.Prod). Once accepted
upstream, this file should be deleted and its consumers should import
the Mathlib module instead.
Main results #
Cslib.Probability.PMF.bind_pair_apply: the "pairing" bind at(a, b)equalsp a * f a bCslib.Probability.PMF.bind_pair_tsum_fst: marginalizing over the first componentCslib.Probability.PMF.uniformOfFintype_map_equiv: a uniform distribution is invariant under equivalenceCslib.Probability.PMF.posteriorDist: the posterior as aPMFCslib.Probability.PMF.posteriorDist_eq_prior_of_outputIndist: if the output distribution does not depend on the input, conditioning does not change the prior
Evaluating the "pairing" bind (do let a ← p; return (a, ← f a)) at (a, b)
gives the product p a * f a b.
The posterior distribution Pr[A = a | B = b] as a PMF,
given a ← p, b ← f a, and that b has positive marginal probability:
the joint distribution's slice at b, normalized.
Equations
Instances For
If the output distribution of a channel does not depend on the input, then conditioning on any output with positive probability leaves the prior unchanged.