Statistical distance (CloseTo) on probability mass functions #
Two probability mass functions μ, ν : PMF α are within statistical distance ε (CloseTo μ ν ε)
if for every event E ⊆ α, μ.toOuterMeasure E ≤ ν.toOuterMeasure E + ε. This definition operates
directly on PMFs with error in ℝ≥0∞ without requiring Fintype α or metric spaces.
Quantifying over all events makes this notion symmetric, and it coincides with total variation distance.
Main definitions #
Cslib.Probability.CloseTo:μandνare within statistical distanceε.
Main results #
Cslib.Probability.closeTo_iff_tsum_tsub_le: closeness is the positive-part sum∑' a, (μ a - ν a)being at mostε.Cslib.Probability.PMF.tsum_tsub_comm: the two positive-part sums of a pair of PMFs agree.Cslib.Probability.PMF.toOuterMeasure_eq_add_tsum_tsub: the positive-part sum is the excess probability of an event separating whereμandνdominate.Cslib.Probability.CloseTo.refl: every distribution is0-close to itself.Cslib.Probability.CloseTo.mono: enlarging the error preserves closeness.Cslib.Probability.CloseTo.symm: statistical closeness is symmetric on any type.Cslib.Probability.CloseTo.map: statistical closeness is preserved by postprocessing.Cslib.Probability.CloseTo.trans: statistical closeness errors add along a chain.Cslib.Probability.CloseTo.bind_left: data processing under a shared continuation.Cslib.Probability.CloseTo.bind_right: pointwise closeness of continuations is preserved acrossPMF.bind.Cslib.Probability.CloseTo.bind: combined first-stage and continuation error addition.Cslib.Probability.CloseTo.abs_toReal_sub_le: closeness bounds the real probability difference on every event byε.Cslib.Probability.CloseTo.of_le_apply: a distribution pointwise dominating(1 - ε) νisε-close toν.
μ is within statistical distance ε of ν: no event is more likely under μ than under
ν by more than ε. Quantifying over all events makes this symmetric, and it is the total
variation distance on any type, finite or not.
Equations
- Cslib.Probability.CloseTo μ ν ε = ∀ (event : Set α), μ.toOuterMeasure event ≤ ν.toOuterMeasure event + ε
Instances For
Every distribution is 0-close to itself.
An event containing every point where μ is larger and none where it is smaller has
μ-probability equal to its ν-probability plus the positive-part sum ∑' a, (μ a - ν a).
Combining CloseTo.bind_left and CloseTo.bind_right adds the first-stage and continuation
errors.
Closeness within a real tolerance ε ≥ 0 bounds the real difference of the probabilities of
every event by ε.
A law dominating (1 - ε) ν pointwise is within statistical distance ε of ν.