Documentation

ShannonInfo.CslibFrontier.Probability.StatisticalDistance.CloseTo

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 #

Main results #

def Cslib.Probability.CloseTo {α : Type} (μ ν : PMF α) (ε : ENNReal) :

μ 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
Instances For
    @[simp]
    theorem Cslib.Probability.CloseTo.refl {α : Type} (μ : PMF α) :
    CloseTo μ μ 0

    Every distribution is 0-close to itself.

    theorem Cslib.Probability.CloseTo.mono {α : Type} {μ ν : PMF α} {ε δ : ENNReal} (h : CloseTo μ ν ε) (hle : ε ≤ δ) :
    CloseTo μ ν δ

    Enlarging the error bound preserves statistical closeness.

    theorem Cslib.Probability.PMF.toOuterMeasure_eq_add_tsum_tsub {α : Type u_1} (μ ν : PMF α) {s : Set α} (h₁ : ∀ a ∈ s, ν a ≤ μ a) (h₂ : ∀ a ∉ s, μ a ≤ ν a) :
    μ.toOuterMeasure s = ν.toOuterMeasure s + ∑' (a : α), (μ a - ν a)

    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).

    theorem Cslib.Probability.closeTo_iff_tsum_tsub_le {α : Type} {μ ν : PMF α} {ε : ENNReal} :
    CloseTo μ ν ε ↔ ∑' (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.

    theorem Cslib.Probability.PMF.tsum_tsub_comm {α : Type u_1} (μ ν : PMF α) :
    ∑' (a : α), (μ a - ν a) = ∑' (a : α), (ν a - μ a)

    The two positive-part sums of a pair of PMFs agree.

    theorem Cslib.Probability.CloseTo.symm {α : Type} {μ ν : PMF α} {ε : ENNReal} (h : CloseTo μ ν ε) :
    CloseTo ν μ ε

    Statistical closeness is symmetric, on any type.

    theorem Cslib.Probability.CloseTo.map {α β : Type} {μ ν : PMF α} {ε : ENNReal} (h : CloseTo μ ν ε) (f : α → β) :
    CloseTo (PMF.map f μ) (PMF.map f ν) ε

    Statistical closeness is preserved by postprocessing.

    theorem Cslib.Probability.CloseTo.trans {α : Type} {μ ν ρ : PMF α} {ε δ : ENNReal} (h₁ : CloseTo μ ν ε) (h₂ : CloseTo ν ρ δ) :
    CloseTo μ ρ (ε + δ)

    Statistical closeness errors add along a chain.

    theorem Cslib.Probability.CloseTo.bind_left {α β : Type} {μ ν : PMF α} {ε : ENNReal} (h : CloseTo μ ν ε) (f : α → PMF β) :
    CloseTo (μ.bind f) (ν.bind f) ε

    Data processing in the first stage: replacing μ by an ε-close ν before a common randomized continuation f preserves ε-closeness, without finiteness assumptions.

    theorem Cslib.Probability.CloseTo.bind_right {α β : Type} (μ : PMF α) {f g : α → PMF β} {ε : ENNReal} (h : ∀ a ∈ μ.support, CloseTo (f a) (g a) ε) :
    CloseTo (μ.bind f) (μ.bind g) ε

    Pointwise statistical closeness of continuations on μ.support is preserved across PMF.bind.

    theorem Cslib.Probability.CloseTo.bind {α β : Type} {μ ν : PMF α} {f g : α → PMF β} {ε δ : ENNReal} (h₁ : CloseTo μ ν ε) (h₂ : ∀ a ∈ ν.support, CloseTo (f a) (g a) δ) :
    CloseTo (μ.bind f) (ν.bind g) (ε + δ)

    Combining CloseTo.bind_left and CloseTo.bind_right adds the first-stage and continuation errors.

    theorem Cslib.Probability.CloseTo.abs_toReal_sub_le {β : Type} {μ ν : PMF β} {ε : ℝ} (hε : 0 ≤ ε) (h : CloseTo μ ν (ENNReal.ofReal ε)) (E : Set β) :

    Closeness within a real tolerance ε ≥ 0 bounds the real difference of the probabilities of every event by ε.

    theorem Cslib.Probability.CloseTo.of_le_apply {β : Type} {μ ν : PMF β} {ε : ℝ} (hε : 0 ≤ ε) (h : ∀ (b : β), ENNReal.ofReal (1 - ε) * ν b ≤ μ b) :

    A law dominating (1 - ε) ν pointwise is within statistical distance ε of ν.