Coupling for probability distributions #
theorem
SPMF.IsCoupling.ext
{α β : Type u}
{c : SPMF (α × β)}
{p : SPMF α}
{q : SPMF β}
{x y : c.IsCoupling p q}
:
theorem
SPMF.IsCoupling.bind
{α₁ α₂ β₁ β₂ : Type u}
{p : SPMF α₁}
{q : SPMF α₂}
{f : α₁ → SPMF β₁}
{g : α₂ → SPMF β₂}
(c : p.Coupling q)
(d : α₁ → α₂ → SPMF (β₁ × β₂))
(h : ∀ (a₁ : α₁) (a₂ : α₂), ↑↑c (some (a₁, a₂)) ≠ 0 → (d a₁ a₂).IsCoupling (f a₁) (g a₂))
:
(do
let p ← ↑c
d p.1 p.2).IsCoupling
(p >>= f) (q >>= g)
Main theorem about coupling and bind operations
theorem
SPMF.IsCoupling.exists_bind
{α₁ α₂ β₁ β₂ : Type u}
{p : SPMF α₁}
{q : SPMF α₂}
{f : α₁ → SPMF β₁}
{g : α₂ → SPMF β₂}
(c : p.Coupling q)
(h : ∀ (a₁ : α₁) (a₂ : α₂), ∃ (d : SPMF (β₁ × β₂)), d.IsCoupling (f a₁) (g a₂))
:
∃ (d : SPMF (β₁ × β₂)), d.IsCoupling (p >>= f) (q >>= g)
Existential version of IsCoupling.bind
Every SPMF has a diagonal self-coupling.
Diagonal self-coupling witness.
Instances For
theorem
SPMF.IsCoupling.prod
{α β : Type u}
{p : SPMF α}
{q : SPMF β}
(hp : p.toPMF none = 0)
(hq : q.toPMF none = 0)
:
(do
let a ← p
let b ← q
pure (a, b)).IsCoupling
p q
Product coupling: when both distributions have no failure mass, their independent product forms a coupling.
This is the core coupling result for reasoning about pairs of computations that never
fail individually (e.g., OracleComp spec α via HasEvalPMF): the product distribution
do let a ← p; let b ← q; pure (a, b) witnesses that the pair has marginals (p, q).