mathlib documentation

measure_theory.probability_mass_function

def pmf (α : Type u) :
Type u

Probability mass functions, i.e. discrete probability measures

Equations
@[instance]
def pmf.has_coe_to_fun {α : Type u_1} :

Equations
@[ext]
theorem pmf.ext {α : Type u_1} {p q : pmf α} (a : ∀ (a : α), p a = q a) :
p = q

theorem pmf.has_sum_coe_one {α : Type u_1} (p : pmf α) :

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 α

Equations
def pmf.pure {α : Type u_1} (a : α) :
pmf α

Equations
@[simp]
theorem pmf.pure_apply {α : Type u_1} (a a' : α) :
(pmf.pure a) a' = ite (a' = a) 1 0

@[instance]
def pmf.inhabited {α : Type u_1} [inhabited α] :

Equations
theorem pmf.coe_le_one {α : Type u_1} (p : pmf α) (a : α) :
p a 1

theorem pmf.bind.summable {α : Type u_1} {β : Type u_2} (p : pmf α) (f : α → pmf β) (b : β) :
summable (λ (a : α), (p a) * (f a) b)

def pmf.bind {α : Type u_1} {β : Type u_2} (p : pmf α) (f : α → pmf β) :
pmf β

Equations
@[simp]
theorem pmf.bind_apply {α : Type u_1} {β : Type u_2} (p : pmf α) (f : α → pmf β) (b : β) :
(p.bind f) b = ∑' (a : α), (p a) * (f a) b

theorem pmf.coe_bind_apply {α : Type u_1} {β : Type u_2} (p : pmf α) (f : α → pmf β) (b : β) :
((p.bind f) b) = ∑' (a : α), ((p a)) * ((f a) b)

@[simp]
theorem pmf.pure_bind {α : Type u_1} {β : Type u_2} (a : α) (f : α → pmf β) :
(pmf.pure a).bind f = f a

@[simp]
theorem pmf.bind_pure {α : Type u_1} (p : pmf α) :

@[simp]
theorem pmf.bind_bind {α : Type u_1} {β : Type u_2} {γ : Type u_3} (p : pmf α) (f : α → pmf β) (g : β → pmf γ) :
(p.bind f).bind g = p.bind (λ (a : α), (f a).bind g)

theorem pmf.bind_comm {α : Type u_1} {β : Type u_2} {γ : Type u_3} (p : pmf α) (q : pmf β) (f : α → β → pmf γ) :
p.bind (λ (a : α), q.bind (f a)) = q.bind (λ (b : β), p.bind (λ (a : α), f a b))

def pmf.map {α : Type u_1} {β : Type u_2} (f : α → β) (p : pmf α) :
pmf β

Equations
theorem pmf.bind_pure_comp {α : Type u_1} {β : Type u_2} (f : α → β) (p : pmf α) :

theorem pmf.map_id {α : Type u_1} (p : pmf α) :

theorem pmf.map_comp {α : Type u_1} {β : Type u_2} {γ : Type u_3} (p : pmf α) (f : α → β) (g : β → γ) :
pmf.map g (pmf.map f p) = pmf.map (g f) p

theorem pmf.pure_map {α : Type u_1} {β : Type u_2} (a : α) (f : α → β) :

def pmf.seq {α : Type u_1} {β : Type u_2} (f : pmf (α → β)) (p : pmf α) :
pmf β

Equations
def pmf.of_multiset {α : Type u_1} (s : multiset α) (hs : s 0) :
pmf α

Equations
def pmf.of_fintype {α : Type u_1} [fintype α] (f : α → ℝ≥0) (h : ∑ (x : α), f x = 1) :
pmf α

Equations
def pmf.bernoulli (p : ℝ≥0) (h : p 1) :

Equations