Documentation

ShannonInfo.CslibFrontier.Probability.PMF.Filter

Conditioning discrete distributions on events #

PMF.filter p s h conditions p on an event s of positive probability. This file relates conditioning to the other operations on discrete distributions.

Main results #

theorem Cslib.Probability.PMF.filter_eq_self_of_support_subset {α : Type u_1} (p : PMF α) (s : Set α) (h : ∃ a ∈ s, a ∈ p.support) (hs : p.support ⊆ s) :
p.filter s h = p

Conditioning on an event that contains the support changes nothing.

theorem Cslib.Probability.PMF.toOuterMeasure_filter_mul_eq_inter {α : Type u_1} (p : PMF α) (s t : Set α) (h : ∃ a ∈ s, a ∈ p.support) :

The probability of t given s, times the probability of s, is the probability of s ∩ t.

theorem Cslib.Probability.PMF.filter_filter {α : Type u_1} (p : PMF α) (s t : Set α) (hs : ∃ a ∈ s, a ∈ p.support) (ht : ∃ a ∈ t, a ∈ (p.filter s hs).support) (hst : ∃ a ∈ s ∩ t, a ∈ p.support) :
(p.filter s hs).filter t ht = p.filter (s ∩ t) hst

Conditioning on s and then on t is conditioning on s ∩ t.

theorem Cslib.Probability.PMF.filter_map {α : Type u_1} {β : Type u_2} (p : PMF α) (f : α → β) (s : Set β) (h : ∃ b ∈ s, b ∈ (PMF.map f p).support) (h' : ∃ a ∈ f ⁻¹' s, a ∈ p.support) :
(PMF.map f p).filter s h = PMF.map f (p.filter (f ⁻¹' s) h')

Conditioning a relabeled distribution on s is relabeling the distribution conditioned on the preimage of s.

theorem Cslib.Probability.PMF.filter_bind_pair {α : Type u_1} {β : Type u_2} (μ : PMF α) (K : α → PMF β) (s : Set α) (h : ∃ z ∈ Prod.fst ⁻¹' s, z ∈ (μ.bind fun (a : α) => PMF.map (fun (x : β) => (a, x)) (K a)).support) (hs : ∃ a ∈ s, a ∈ μ.support) :
(μ.bind fun (a : α) => PMF.map (fun (x : β) => (a, x)) (K a)).filter (Prod.fst ⁻¹' s) h = (μ.filter s hs).bind fun (a : α) => PMF.map (fun (x : β) => (a, x)) (K a)

Drawing a from μ and then b from K a, and conditioning on an event about a, is drawing a from μ conditioned on that event and then b from K a.

theorem Cslib.Probability.PMF.toOuterMeasure_bind_pair_prod {α : Type u_1} {β : Type u_2} (μ : PMF α) (ν : PMF β) (s : Set α) (t : Set β) :
(μ.bind fun (a : α) => PMF.map (fun (x : β) => (a, x)) ν).toOuterMeasure (s ×ˢ t) = μ.toOuterMeasure s * ν.toOuterMeasure t

Under independent draws, a rectangle has the product of the probabilities of its sides.

theorem Cslib.Probability.PMF.filter_bind_pair_prod {α : Type u_1} {β : Type u_2} (μ : PMF α) (ν : PMF β) (s : Set α) (t : Set β) (h : ∃ z ∈ s ×ˢ t, z ∈ (μ.bind fun (a : α) => PMF.map (fun (x : β) => (a, x)) ν).support) (hs : ∃ a ∈ s, a ∈ μ.support) (ht : ∃ b ∈ t, b ∈ ν.support) :
(μ.bind fun (a : α) => PMF.map (fun (x : β) => (a, x)) ν).filter (s ×ˢ t) h = (μ.filter s hs).bind fun (a : α) => PMF.map (fun (x : β) => (a, x)) (ν.filter t ht)

Under independent draws, conditioning on a rectangle s ×ˢ t conditions the first draw on s and the second on t, and keeps them independent.

theorem Cslib.Probability.PMF.map_snd_filter_bind_pair_prod {α : Type u_1} {β : Type u_2} (μ : PMF α) (ν : PMF β) (s : Set α) (t : Set β) (h : ∃ z ∈ s ×ˢ t, z ∈ (μ.bind fun (a : α) => PMF.map (fun (x : β) => (a, x)) ν).support) (ht : ∃ b ∈ t, b ∈ ν.support) :
PMF.map Prod.snd ((μ.bind fun (a : α) => PMF.map (fun (x : β) => (a, x)) ν).filter (s ×ˢ t) h) = ν.filter t ht

Conditioning on an independent coordinate. Under independent draws, conditioning on s ×ˢ t gives the second draw the law of ν conditioned on t: the condition s on the first draw has no effect on it.