Total Variation Distance for SPMFs and Monadic Computations #
This file extends the TV distance from PMF (defined in
ToMathlib.Probability.ProbabilityMassFunction.TotalVariation) to:
SPMF.tvDist— on sub-probability mass functions (viatoPMF)tvDist— on any monad withMonadLiftT m SPMF(viaevalDist)
SPMF.tvDist #
Monadic tvDist #
TV distance bounds #
Total variation distance is bounded by the probability of an event p whenever the two
computations have equal output distribution off p (and equal probability of p).
TV distance for bind (left) #
TV distance for bind with a constant bound #
Total-variation distance is convex over a shared bind: if tvDist (f a) (g a) ≤ c for every
a ∈ support mx, then tvDist (mx >>= f) (mx >>= g) ≤ c. The real-valued root of the const
bound, with ℝ≥0∞ companion ofReal_tvDist_bind_left_le_const.
Unrestricted companion of tvDist_bind_left_le_const: a uniform per-a bound
tvDist (f a) (g a) ≤ c lifts through the shared mx bind.
ℝ≥0∞ form of tvDist_bind_left_le_const, matching the quantitative APIs: a per-a bound
ENNReal.ofReal (tvDist (f a) (g a)) ≤ ε on the support of mx lifts through the shared bind.
Unrestricted companion of ofReal_tvDist_bind_left_le_const.
TV distance for bind with a bad event #
Bound the weighted TV sum from tvDist_bind_left_le by the probability of a bad event
when the two continuations are distributionally equal off that event.
If two continuations are equal off a bad event, binding them over the same base computation changes TV distance by at most the probability of that bad event.
ENNReal form of tvDist_bind_left_event_le, matching the quantitative
identical-until-bad APIs.
Bind/event TV bound with different base computations: the base TV distance plus the bad-event probability controls the whole bind.
ENNReal form of tvDist_bind_event_le.
Bind/event TV bound with different base computations, charging the bad-event
probability under the right base computation. This is the symmetric orientation of
tvDist_bind_event_le, useful when the bad event is introduced by the simulated side.
ENNReal form of tvDist_bind_event_right_le.