Documentation

CslibFrontier.Probability.StatisticalDistance.Coupling

The coupling inequality and approximate couplings #

Two functions of one sample are at statistical distance at most the probability that they differ (Cslib.Probability.PMF.dist_map_map_le). The sample space may be infinite; only the common codomain is finite.

This module also defines Cslib.Probability.PMF.CoupledWithin μ ν ε, stating that two discrete distributions μ, ν : PMF α admit a joint coupling ω : PMF (α × α) whose disagreement probability ω.toOuterMeasure {p | p.1 ≠ p.2} is at most ε. Every pair admits a maximal coupling: its disagreement probability is exactly ∑' a, (μ a - ν a), so CoupledWithin and the all-event relation CloseTo coincide, including on infinite types. The composition combinators (refl, symm, mono, zero_iff, map, map₂, bind_of_eq_on) accompany event, statistical-distance (dist_le, dist_bind_of_good), and total-variation-distance (tvDist_le) bounds.

Main definitions #

Main results #

theorem Cslib.Probability.PMF.dist_bind_of_good {α : Type u} {β : Type v} [Finite α] [Fintype β] (p : PMF α) (f : α → PMF β) (q : PMF β) (good : Set α) {b : ℝ} (hb : 0 ≤ b) (hgood : ∀ a ∈ good, dist (f a) q ≤ b) :
dist (p.bind f) q ≤ (p.toOuterMeasure goodᶜ).toReal + b

Bounding dist (p.bind f) q by splitting p across a good event good : Set α on which dist (f a) q ≤ b (0 ≤ b) and bounding dist (f a) q ≤ 1 outside good.

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

Two discrete distributions μ, ν : PMF α are coupled within ε : ℝ≥0∞ if there exists a joint distribution ω : PMF (α × α) with marginals μ and ν whose disagreement probability ω.toOuterMeasure {p | p.1 ≠ p.2} is at most ε.

theorem Cslib.Probability.PMF.exists_coupling_toOuterMeasure_eq_tsum_tsub {α : Type u} (μ ν : PMF α) :
∃ (ω : PMF (α × α)), PMF.map Prod.fst ω = μ ∧ PMF.map Prod.snd ω = ν ∧ ω.toOuterMeasure {p : α × α | p.1 ≠ p.2} = ∑' (a : α), (μ a - ν a)

Two probability mass functions on an arbitrary type admit a coupling whose disagreement probability is exactly their positive-part mass ∑' a, (μ a - ν a). The coupling puts min (μ a) (ν a) on the diagonal and independently pairs the two residual masses.

theorem Cslib.Probability.PMF.CoupledWithin.toOuterMeasure_le {α : Type u} {μ ν : PMF α} {ε : ENNReal} (h : CoupledWithin μ ν ε) (S : Set α) :

Coupling inequality for events: if CoupledWithin μ ν ε, then for every event S : Set α, μ.toOuterMeasure S ≤ ν.toOuterMeasure S + ε.

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

A coupling with disagreement probability at most ε witnesses all-events statistical closeness with the same error.

theorem Cslib.Probability.PMF.coupledWithin_iff_closeTo {α : Type u} {μ ν : PMF α} {ε : ENNReal} :
CoupledWithin μ ν ε ↔ CloseTo μ ν ε

Approximate coupling and all-events statistical closeness coincide for arbitrary probability mass functions, including distributions with infinite support.

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

All-events statistical closeness supplies a joint coupling with the same disagreement bound.

Every distribution is coupled with itself within 0.

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

Symmetry of CoupledWithin.

theorem Cslib.Probability.PMF.CoupledWithin.mono {α : Type u} {μ ν : PMF α} {ε₁ ε₂ : ENNReal} (h : CoupledWithin μ ν ε₁) (hε : ε₁ ≤ ε₂) :
CoupledWithin μ ν ε₂

Monotonicity of CoupledWithin in the error bound ε.

@[simp]
theorem Cslib.Probability.PMF.CoupledWithin.zero_iff {α : Type u} {μ ν : PMF α} :
CoupledWithin μ ν 0 ↔ μ = ν

CoupledWithin μ ν 0 holds if and only if μ = ν.

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

Deterministic postprocessing preserves CoupledWithin with the same error bound.

theorem Cslib.Probability.PMF.CoupledWithin.map₂ {α : Type u} {β : Type v} {γ : Type w} {μ₁ ν₁ : PMF α} {μ₂ ν₂ : PMF β} {ε₁ ε₂ : ENNReal} (h₁ : CoupledWithin μ₁ ν₁ ε₁) (h₂ : CoupledWithin μ₂ ν₂ ε₂) (g : α → β → γ) :
CoupledWithin (μ₁.bind fun (a : α) => PMF.map (g a) μ₂) (ν₁.bind fun (a : α) => PMF.map (g a) ν₂) (ε₁ + ε₂)

Composing two independent couplings via g : α → β → γ adds their disagreement bounds.

theorem Cslib.Probability.PMF.CoupledWithin.bind_of_eq_on {α : Type u} {β : Type v} {p : PMF α} {f : α → PMF β} {q : PMF β} (good : Set α) (hgood : ∀ a ∈ p.support, a ∈ good → f a = q) :

If a mixture p.bind f agrees with q on every a ∈ p.support belonging to a good event good : Set α, then p.bind f is coupled with q within p.toOuterMeasure goodᶜ.

theorem Cslib.Probability.PMF.CoupledWithin.dist_le {α : Type u} [Fintype α] {μ ν : PMF α} {ε : ENNReal} (h : CoupledWithin μ ν ε) (hε : ε ≠ ⊤) :
dist μ ν ≤ ε.toReal

On a finite type, CoupledWithin μ ν ε (with ε ≠ ⊤) bounds the statistical distance dist μ ν ≤ ε.toReal.

On a measurable singleton space, CoupledWithin μ ν ε (with ε ≠ ⊤) bounds the total variation distance tvDist μ.toMeasure ν.toMeasure ≤ 2 * ε.toReal.

theorem Cslib.Probability.PMF.dist_map_map_le {α : Type u_1} {β : Type u_2} [Fintype β] (p : PMF α) (f g : α → β) :
dist (PMF.map f p) (PMF.map g p) ≤ (p.toOuterMeasure {a : α | f a ≠ g a}).toReal

Coupling inequality. Two functions of the same sample are at statistical distance at most the probability that they differ.