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_one_sub_mul_le,Cslib.Probability.CloseTo.of_le_apply: a distribution pointwise dominating(1 - ε) * νisε-close toν.Cslib.Probability.closeTo_pure_iff:CloseTo μ (PMF.pure b) εholds iffμ.toOuterMeasure {b}ᶜ ≤ ε.Cslib.Probability.CloseTo.toReal_apply_le_of_uniformOfFintype: a distributionδ-close toPMF.uniformOfFintype αassigns mass at most1 / Fintype.card α + δto every atom.
μ 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.
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).
Statistical closeness is the positive-part sum ∑' a, (μ a - ν a) (truncated subtraction in
ℝ≥0∞) being at most ε: the event {a | ν a < μ a} is the worst case.
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 ν.
If ν is within statistical distance δ of the uniform distribution on a finite nonempty
type α, every atom of ν has real probability at most 1 / Fintype.card α + δ.