Documentation

ShannonInfo.CslibFrontier.Probability.StatisticalDistance.TotalVariation

CloseTo, the finite statistical distance and total variation #

Three notions measure the distance between PMFs: the all-event relation CloseTo μ ν ε (error in ℝ≥0∞, any type), the finite-type metric dist μ ν (half the L1 distance, in ℝ), and Mathlib's total variation etvDist/tvDist of the induced measures (the full L1 distance). Each is determined by the positive-part sum ∑' a, (μ a - ν a) of closeTo_iff_tsum_tsub_le, so CloseTo is exactly a bound on either distance, with no slack in the coercions.

Main results #

theorem Cslib.Probability.PMF.ofReal_dist {α : Type u_1} [Fintype α] (μ ν : PMF α) :
ENNReal.ofReal (dist μ ν) = ∑' (a : α), (μ a - ν a)

The finite statistical distance is the positive-part sum ∑' a, (μ a - ν a).

Mathlib's total variation distance of PMF measures is twice the positive-part sum.

Statistical distance is half of Mathlib's total variation distance tvDist of the PMF measures.

theorem Cslib.Probability.closeTo_iff_ofReal_dist_le {α : Type} {μ ν : PMF α} [Fintype α] {ε : ENNReal} :
CloseTo μ ν ε ↔ ENNReal.ofReal (dist μ ν) ≤ ε

On a finite type, CloseTo μ ν ε holds exactly when dist μ ν ≤ ε, for any ε : ℝ≥0∞.

theorem Cslib.Probability.closeTo_coe_iff_dist_le {α : Type} {μ ν : PMF α} [Fintype α] {ε : NNReal} :
CloseTo μ ν ↑ε ↔ dist μ ν ≤ ↑ε

On a finite type, CloseTo with an ℝ≥0 error is the upstream PMF.StatisticallyClose: a bound on the finite statistical distance.

theorem Cslib.Probability.closeTo_ofReal_iff_dist_le {α : Type} {μ ν : PMF α} [Fintype α] {ε : ℝ} (hε : 0 ≤ ε) :
CloseTo μ ν (ENNReal.ofReal ε) ↔ dist μ ν ≤ ε

On a finite type, CloseTo with a nonnegative real error is a bound on the finite statistical distance.

theorem Cslib.Probability.closeTo_of_dist_le {α : Type} {μ ν : PMF α} [Fintype α] {ε : NNReal} (h : dist μ ν ≤ ↑ε) :
CloseTo μ ν ↑ε

Finite-support statistical distance bounds CloseTo on all events.

theorem Cslib.Probability.closeTo_of_dist_le_ofReal {α : Type} {μ ν : PMF α} [Fintype α] {ε : ℝ} (h : dist μ ν ≤ ε) :

Real-valued finite-support statistical distance bounds CloseTo via ENNReal.ofReal, with no separate 0 ≤ ε premise.

On any type with measurable singletons, CloseTo μ ν ε holds exactly when the total variation distance of the induced measures is at most 2 * ε.