Documentation

CslibFrontier.Probability.PMF.BindCompare

Comparing two-stage experiments at one outcome #

These lemmas compare the probabilities that two-stage experiments μ.bind f give one outcome b, using facts about the continuations alone. Pointwise sum identities between continuations carry over to the experiments: a constant offset with bind_apply_add_of_forall, and an exchange of two pairs on the support with bind_apply_add_eq_on_support. Continuations that agree up to ε away from one exceptional first-stage result differ by at most ε plus that result's probability (bind_apply_le_add_of_ne). Stateful experiments whose first stages agree on good states, and whose continuations agree on good states and keep bad states bad, give good outcomes equal probability (bind_apply_eq_of_good). A sampler that keeps the first draw on an event and otherwise resamples from its conditional law has that law (bind_pure_or_resample_eq).

The one-sided bounds, where the continuations need only be compared on the support, are in CslibFrontier.Probability.PMF.Bind.

Main results #

theorem Cslib.Probability.PMF.bind_apply_add_of_forall {α : Type u_1} {β : Type u_2} (μ : PMF α) {f g h : α → PMF β} {b : β} {c : ENNReal} (hfg : ∀ (x : α), (f x) b + (g x) b = (h x) b + c) :
(μ.bind f) b + (μ.bind g) b = (μ.bind h) b + c

If every second stage satisfies f x b + g x b = h x b + c, so does the whole experiment.

theorem Cslib.Probability.PMF.bind_apply_add_eq_on_support {α : Type u_1} {β : Type u_2} {p : PMF α} {f₁ f₂ g₁ g₂ : α → PMF β} {b : β} (h : ∀ a ∈ p.support, (f₁ a) b + (g₂ a) b = (f₂ a) b + (g₁ a) b) :
(p.bind f₁) b + (p.bind g₂) b = (p.bind f₂) b + (p.bind g₁) b

If two pairs of continuations satisfy f₁ a b + g₂ a b = f₂ a b + g₁ a b on the support of p, then (p.bind f₁) b + (p.bind g₂) b = (p.bind f₂) b + (p.bind g₁) b.

theorem Cslib.Probability.PMF.bind_apply_le_add_of_ne {T : Type u_1} {β : Type u_2} (μ : PMF T) (F G : T → PMF β) (b : β) (bad : T) {ε : ENNReal} (h : ∀ (t : T), t ≠ bad → (F t) b ≤ (G t) b + ε) :
(μ.bind F) b ≤ (μ.bind G) b + ε + μ bad

Pointwise bounds away from one exceptional first-stage result bound a two-stage experiment, up to the probability of that result.

theorem Cslib.Probability.PMF.bind_apply_eq_of_good {α : Type u_1} {β : Type u_2} {σ : Type u_3} {bad : σ → Prop} {p₁ p₂ : PMF (α × σ)} {f₁ f₂ : α × σ → PMF (β × σ)} (hp : ∀ (x : α × σ), ¬bad x.2 → p₁ x = p₂ x) (hf : ∀ (x : α × σ), ¬bad x.2 → ∀ (y : β × σ), ¬bad y.2 → (f₁ x) y = (f₂ x) y) (h₁ : ∀ (x : α × σ), bad x.2 → ∀ y ∈ (f₁ x).support, bad y.2) (h₂ : ∀ (x : α × σ), bad x.2 → ∀ y ∈ (f₂ x).support, bad y.2) (y : β × σ) (hy : ¬bad y.2) :
(p₁.bind f₁) y = (p₂.bind f₂) y

Binds whose first stages agree on good states, and whose continuations agree on good inputs and outputs and keep bad states bad, agree on good outputs.

theorem Cslib.Probability.PMF.bind_pure_or_resample_eq {α : Type u_1} {p q : PMF α} (s : Set α) [DecidablePred fun (x : α) => x ∈ s] {c : ENNReal} (h : ∀ (a : α), s.indicator (⇑p) a = c * q a) :
(p.bind fun (a : α) => if a ∈ s then PMF.pure a else q) = q

If the masses of p on s are a common multiple of the masses of q, then drawing from p, keeping a draw in s, and otherwise drawing from q gives exactly q.