Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 6375f85

Browse files
committed
feat(measure_theory/probability_mass_function): Probability one iff support equals singleton (#15334)
`a` has probability 1 under a `pmf` iff the support is the singleton `{a}`
1 parent 89f46dd commit 6375f85

File tree

1 file changed

+28
-0
lines changed
  • src/probability/probability_mass_function

1 file changed

+28
-0
lines changed

src/probability/probability_mass_function/basic.lean

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ begin
8484
{ exact finset.sum_congr rfl (λ x hx, set.indicator_of_mem hx _) }
8585
end
8686

87+
lemma to_outer_measure_apply_singleton (a : α) : p.to_outer_measure {a} = p a :=
88+
begin
89+
refine (p.to_outer_measure_apply {a}).trans ((tsum_eq_single a $ λ b hb, _).trans _),
90+
{ exact ite_eq_right_iff.2 (λ hb', false.elim $ hb hb') },
91+
{ exact ite_eq_left_iff.2 (λ ha', false.elim $ ha' rfl) }
92+
end
93+
8794
lemma to_outer_measure_apply_eq_zero_iff : p.to_outer_measure s = 0 ↔ disjoint p.support s :=
8895
begin
8996
rw [to_outer_measure_apply', ennreal.coe_eq_zero,
@@ -163,6 +170,16 @@ lemma to_measure_apply (hs : measurable_set s) : p.to_measure s = ∑' x, s.indi
163170
lemma to_measure_apply' (hs : measurable_set s) : p.to_measure s = ↑(∑' x, s.indicator p x) :=
164171
(p.to_measure_apply_eq_to_outer_measure_apply s hs).trans (p.to_outer_measure_apply' s)
165172

173+
lemma to_measure_apply_singleton (a : α) (h : measurable_set ({a} : set α)) :
174+
p.to_measure {a} = p a :=
175+
by simp [to_measure_apply_eq_to_outer_measure_apply p {a} h,
176+
to_outer_measure_apply_singleton]
177+
178+
lemma to_measure_apply_eq_zero_iff (hs : measurable_set s) :
179+
p.to_measure s = 0 ↔ disjoint p.support s :=
180+
by rw [to_measure_apply_eq_to_outer_measure_apply p s hs,
181+
to_outer_measure_apply_eq_zero_iff]
182+
166183
lemma to_measure_apply_eq_one_iff (hs : measurable_set s) : p.to_measure s = 1 ↔ p.support ⊆ s :=
167184
(p.to_measure_apply_eq_to_outer_measure_apply s hs : p.to_measure s = p.to_outer_measure s).symm
168185
▸ (p.to_outer_measure_apply_eq_one_iff s)
@@ -212,4 +229,15 @@ instance to_measure.is_probability_measure (p : pmf α) : is_probability_measure
212229

213230
end measure
214231

232+
lemma apply_eq_one_iff (p : pmf α) (a : α) :
233+
p a = 1 ↔ p.support = {a} :=
234+
begin
235+
refine ⟨λ h, _, λ h, _⟩,
236+
{ have : {a} ⊆ p.support := λ x hx, (p.mem_support_iff x).2 (ne_zero_of_eq_one $ hx.symm ▸ h),
237+
refine antisymm ((p.to_outer_measure_apply_eq_one_iff {a}).1 _) this,
238+
simpa only [to_outer_measure_apply_singleton, ennreal.coe_eq_one] using h },
239+
{ simpa only [← ennreal.coe_eq_one, ← to_outer_measure_apply_singleton,
240+
to_outer_measure_apply_eq_one_iff] using subset_of_eq h }
241+
end
242+
215243
end pmf

0 commit comments

Comments
 (0)