# mathlibdocumentation

measure_theory.probability_mass_function.basic

# Probability mass functions #

This file is about probability mass functions or discrete probability measures: a function α → ℝ≥0 such that the values have (infinite) sum 1.

Construction of monadic pure and bind is found in probability_mass_function/monad.lean, other constructions of pmfs are found in probability_mass_function/constructions.lean.

Given p : pmf α, pmf.to_outer_measure constructs an outer_measure on α, by assigning each set the sum of the probabilities of each of its elements. Under this outer measure, every set is Carathéodory-measurable, so we can further extend this to a measure on α, see pmf.to_measure. pmf.to_measure.is_probability_measure shows this associated measure is a probability measure.

## Tags #

probability mass function, discrete probability measure

def pmf (α : Type u) :
Type u

A probability mass function, or discrete probability measures is a function α → ℝ≥0 such that the values have (infinite) sum 1.

Equations
Instances for pmf
@[protected, instance]
def pmf.has_coe_to_fun {α : Type u_1} :
(λ (p : pmf α), α → nnreal)
Equations
@[protected, ext]
theorem pmf.ext {α : Type u_1} {p q : pmf α} :
(∀ (a : α), p a = q a)p = q
theorem pmf.has_sum_coe_one {α : Type u_1} (p : pmf α) :
1
theorem pmf.summable_coe {α : Type u_1} (p : pmf α) :
@[simp]
theorem pmf.tsum_coe {α : Type u_1} (p : pmf α) :
∑' (a : α), p a = 1
def pmf.support {α : Type u_1} (p : pmf α) :
set α

The support of a pmf is the set where it is nonzero.

Equations
@[simp]
theorem pmf.mem_support_iff {α : Type u_1} (p : pmf α) (a : α) :
a p.support p a 0
theorem pmf.apply_eq_zero_iff {α : Type u_1} (p : pmf α) (a : α) :
p a = 0 a p.support
theorem pmf.coe_le_one {α : Type u_1} (p : pmf α) (a : α) :
p a 1
noncomputable def pmf.to_outer_measure {α : Type u_1} (p : pmf α) :

Construct an outer_measure from a pmf, by assigning measure to each set s : set α equal to the sum of p x for for each x ∈ α

Equations
theorem pmf.to_outer_measure_apply {α : Type u_1} (p : pmf α) (s : set α) :
(p.to_outer_measure) s = ∑' (x : α), s.indicator (coe p) x
theorem pmf.to_outer_measure_apply' {α : Type u_1} (p : pmf α) (s : set α) :
(p.to_outer_measure) s = ∑' (x : α), s.indicator p x
@[simp]
theorem pmf.to_outer_measure_apply_finset {α : Type u_1} (p : pmf α) (s : finset α) :
(p.to_outer_measure) s = s.sum (λ (x : α), (p x))
theorem pmf.to_outer_measure_apply_eq_zero_iff {α : Type u_1} (p : pmf α) (s : set α) :
theorem pmf.to_outer_measure_apply_eq_one_iff {α : Type u_1} (p : pmf α) (s : set α) :
@[simp]
theorem pmf.to_outer_measure_apply_inter_support {α : Type u_1} (p : pmf α) (s : set α) :
theorem pmf.to_outer_measure_mono {α : Type u_1} (p : pmf α) {s t : set α} (h : s p.support t) :

Slightly stronger than outer_measure.mono having an intersection with p.support

theorem pmf.to_outer_measure_apply_eq_of_inter_support_eq {α : Type u_1} (p : pmf α) {s t : set α} (h : s p.support = t p.support) :
@[simp]
theorem pmf.to_outer_measure_apply_fintype {α : Type u_1} (p : pmf α) (s : set α) [fintype α] :
(p.to_outer_measure) s = (finset.univ.sum (λ (x : α), s.indicator p x))
@[simp]
theorem pmf.to_outer_measure_caratheodory {α : Type u_1} (p : pmf α) :
noncomputable def pmf.to_measure {α : Type u_1} (p : pmf α) :

Since every set is Carathéodory-measurable under pmf.to_outer_measure, we can further extend this outer_measure to a measure on α

Equations
Instances for pmf.to_measure
theorem pmf.to_outer_measure_apply_le_to_measure_apply {α : Type u_1} (p : pmf α) (s : set α) :
theorem pmf.to_measure_apply_eq_to_outer_measure_apply {α : Type u_1} (p : pmf α) (s : set α) (hs : measurable_set s) :
theorem pmf.to_measure_apply {α : Type u_1} (p : pmf α) (s : set α) (hs : measurable_set s) :
(p.to_measure) s = ∑' (x : α), s.indicator (coe p) x
theorem pmf.to_measure_apply' {α : Type u_1} (p : pmf α) (s : set α) (hs : measurable_set s) :
(p.to_measure) s = ∑' (x : α), s.indicator p x
theorem pmf.to_measure_apply_eq_one_iff {α : Type u_1} (p : pmf α) (s : set α) (hs : measurable_set s) :
@[simp]
theorem pmf.to_measure_apply_inter_support {α : Type u_1} (p : pmf α) (s : set α) (hs : measurable_set s) (hp : measurable_set p.support) :
theorem pmf.to_measure_mono {α : Type u_1} (p : pmf α) {s t : set α} (hs : measurable_set s) (ht : measurable_set t) (h : s p.support t) :
theorem pmf.to_measure_apply_eq_of_inter_support_eq {α : Type u_1} (p : pmf α) {s t : set α} (hs : measurable_set s) (ht : measurable_set t) (h : s p.support = t p.support) :
@[simp]
theorem pmf.to_measure_apply_finset {α : Type u_1} (p : pmf α) (s : finset α) :
(p.to_measure) s = s.sum (λ (x : α), (p x))
theorem pmf.to_measure_apply_of_finite {α : Type u_1} (p : pmf α) (s : set α) (hs : s.finite) :
(p.to_measure) s = ∑' (x : α), s.indicator p x
@[simp]
theorem pmf.to_measure_apply_fintype {α : Type u_1} (p : pmf α) (s : set α) [fintype α] :
(p.to_measure) s = (finset.univ.sum (λ (x : α), s.indicator p x))
@[protected, instance]
def pmf.to_measure.is_probability_measure {α : Type u_1} (p : pmf α) :

The measure associated to a pmf by to_measure is a probability measure