The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V20. Probability

Mathlib.Probability.ProbabilityMassFunction.Basic

56 declarations. Mathlib docs · Source

def PMF E3 #

Type u → Type u

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

instance PMF.instFunLike E0 #

{α : Type u_1} → FunLike (PMF α) α ENNReal

theorem PMF.ext_iff E0 #

∀ {α : Type u_1} {p q : PMF α}, p = q ↔ ∀ (x : α), p x = q x

theorem PMF.ext E1 #

∀ {α : Type u_1} {p q : PMF α}, (∀ (x : α), p x = q x) → p = q

theorem PMF.hasSum_coe_one E1 #

∀ {α : Type u_1} (p : PMF α), HasSum (⇑p) 1

theorem PMF.tsum_coe E0 #

∀ {α : Type u_1} (p : PMF α), ∑' (a : α), p a = 1

theorem PMF.tsum_coe_ne_top E1 #

∀ {α : Type u_1} (p : PMF α), ∑' (a : α), p a ≠ ⊤

theorem PMF.tsum_coe_indicator_ne_top E1 #

∀ {α : Type u_1} (p : PMF α) (s : Set α), ∑' (a : α), s.indicator (⇑p) a ≠ ⊤

theorem PMF.coe_ne_zero E0 #

∀ {α : Type u_1} (p : PMF α), ⇑p ≠ 0

def PMF.support E1 #

{α : Type u_1} → PMF α → Set α

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

theorem PMF.mem_support_iff E0 #

∀ {α : Type u_1} (p : PMF α) (a : α), a ∈ p.support ↔ p a ≠ 0

theorem PMF.support_nonempty E0 #

∀ {α : Type u_1} (p : PMF α), p.support.Nonempty

theorem PMF.support_countable E0 #

∀ {α : Type u_1} (p : PMF α), p.support.Countable

theorem PMF.apply_eq_zero_iff E0 #

∀ {α : Type u_1} (p : PMF α) (a : α), p a = 0 ↔ a ∉ p.support

theorem PMF.apply_pos_iff E0 #

∀ {α : Type u_1} (p : PMF α) (a : α), 0 < p a ↔ a ∈ p.support

theorem PMF.apply_eq_one_iff E0 #

∀ {α : Type u_1} (p : PMF α) (a : α), p a = 1 ↔ p.support = {a}

theorem PMF.coe_le_one E0 #

∀ {α : Type u_1} (p : PMF α) (a : α), p a ≤ 1

theorem PMF.apply_ne_top E1 #

∀ {α : Type u_1} (p : PMF α) (a : α), p a ≠ ⊤

theorem PMF.apply_lt_top E1 #

∀ {α : Type u_1} (p : PMF α) (a : α), p a < ⊤

def PMF.toOuterMeasure E1 #

{α : Type u_1} → PMF α → MeasureTheory.OuterMeasure α

Construct an OuterMeasure from a PMF, by assigning measure to each set s : Set α equal to the sum of p x for each x ∈ α.

theorem PMF.toOuterMeasure_apply E0 #

∀ {α : Type u_1} (p : PMF α) (s : Set α), p.toOuterMeasure s = ∑' (x : α), s.indicator (⇑p) x

theorem PMF.toOuterMeasure_caratheodory E0 #

∀ {α : Type u_1} (p : PMF α), p.toOuterMeasure.caratheodory = ⊤

theorem PMF.toOuterMeasure_apply_finset E0 #

∀ {α : Type u_1} (p : PMF α) (s : Finset α), p.toOuterMeasure ↑s = ∑ x ∈ s, p x

theorem PMF.toOuterMeasure_apply_singleton E1 #

∀ {α : Type u_1} (p : PMF α) (a : α), p.toOuterMeasure {a} = p a

theorem PMF.toOuterMeasure_injective E1 #

∀ {α : Type u_1}, Function.Injective PMF.toOuterMeasure

theorem PMF.toOuterMeasure_inj E0 #

∀ {α : Type u_1} {p q : PMF α}, p.toOuterMeasure = q.toOuterMeasure ↔ p = q

theorem PMF.toOuterMeasure_apply_eq_zero_iff E0 #

∀ {α : Type u_1} (p : PMF α) (s : Set α), p.toOuterMeasure s = 0 ↔ Disjoint p.support s

theorem PMF.toOuterMeasure_apply_eq_one_iff E0 #

∀ {α : Type u_1} (p : PMF α) (s : Set α), p.toOuterMeasure s = 1 ↔ p.support ⊆ s

theorem PMF.toOuterMeasure_apply_inter_support E0 #

∀ {α : Type u_1} (p : PMF α) (s : Set α), p.toOuterMeasure (s ∩ p.support) = p.toOuterMeasure s

theorem PMF.toOuterMeasure_mono E1 #

∀ {α : Type u_1} (p : PMF α) {s t : Set α}, s ∩ p.support ⊆ t → p.toOuterMeasure s ≤ p.toOuterMeasure t

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

theorem PMF.toOuterMeasure_apply_eq_of_inter_support_eq E0 #

∀ {α : Type u_1} (p : PMF α) {s t : Set α}, s ∩ p.support = t ∩ p.support → p.toOuterMeasure s = p.toOuterMeasure t

theorem PMF.toOuterMeasure_apply_fintype E0 #

∀ {α : Type u_1} (p : PMF α) (s : Set α) [inst : Fintype α], p.toOuterMeasure s = ∑ x, s.indicator (⇑p) x

def PMF.toMeasure E1 #

{α : Type u_1} → [inst : MeasurableSpace α] → PMF α → MeasureTheory.Measure α

Since every set is Carathéodory-measurable under PMF.toOuterMeasure, we can further extend this OuterMeasure to a Measure on α.

theorem PMF.toOuterMeasure_apply_le_toMeasure_apply E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) (s : Set α), p.toOuterMeasure s ≤ p.toMeasure s

theorem PMF.toMeasure_apply_eq_toOuterMeasure_apply E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) {s : Set α},
  MeasurableSet s → p.toMeasure s = p.toOuterMeasure s

theorem PMF.toMeasure_apply E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) {s : Set α},
  MeasurableSet s → p.toMeasure s = ∑' (x : α), s.indicator (⇑p) x

theorem PMF.toMeasure_apply_singleton E1 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) (a : α), MeasurableSet {a} → p.toMeasure {a} = p a

theorem PMF.toMeasure_apply_eq_zero_iff E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) {s : Set α},
  MeasurableSet s → (p.toMeasure s = 0 ↔ Disjoint p.support s)

theorem PMF.toMeasure_apply_eq_one_iff E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) {s : Set α},
  MeasurableSet s → (p.toMeasure s = 1 ↔ p.support ⊆ s)

theorem PMF.toMeasure_mono E1 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) {s t : Set α},
  MeasurableSet s → s ∩ p.support ⊆ t → p.toMeasure s ≤ p.toMeasure t

theorem PMF.toMeasure_apply_inter_support E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) {s : Set α},
  MeasurableSet s → p.toMeasure (s ∩ p.support) = p.toMeasure s

theorem PMF.restrict_toMeasure_support E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α), p.toMeasure.restrict p.support = p.toMeasure

theorem PMF.toMeasure_apply_eq_of_inter_support_eq E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) {s t : Set α},
  MeasurableSet s → MeasurableSet t → s ∩ p.support = t ∩ p.support → p.toMeasure s = p.toMeasure t

theorem PMF.toMeasure_injective E1 #

∀ {α : Type u_1} [inst : MeasurableSpace α] [MeasurableSingletonClass α], Function.Injective PMF.toMeasure

theorem PMF.toMeasure_inj E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] [MeasurableSingletonClass α] {p q : PMF α},
  p.toMeasure = q.toMeasure ↔ p = q

theorem PMF.toMeasure_apply_eq_toOuterMeasure E1 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) [MeasurableSingletonClass α] (s : Set α),
  p.toMeasure s = p.toOuterMeasure s

theorem PMF.toMeasure_apply_finset E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) [MeasurableSingletonClass α] (s : Finset α),
  p.toMeasure ↑s = ∑ x ∈ s, p x

theorem PMF.toMeasure_apply_eq_tsum E1 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) [MeasurableSingletonClass α] (s : Set α),
  p.toMeasure s = ∑' (x : α), s.indicator (⇑p) x

theorem PMF.toMeasure_apply_fintype E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α) [MeasurableSingletonClass α] (s : Set α) [inst_2 : Fintype α],
  p.toMeasure s = ∑ x, s.indicator (⇑p) x

def MeasureTheory.Measure.toPMF E1 #

{α : Type u_1} →
  [Countable α] →
    [inst : MeasurableSpace α] →
      [MeasurableSingletonClass α] → (μ : MeasureTheory.Measure α) → [h : MeasureTheory.IsProbabilityMeasure μ] → PMF α

Given that α is a countable, measurable space with all singleton sets measurable, we can convert any probability measure into a PMF, where the mass of a point is the measure of the singleton set under the original measure.

theorem MeasureTheory.Measure.toPMF_apply E0 #

∀ {α : Type u_1} [inst : Countable α] [inst_1 : MeasurableSpace α] [inst_2 : MeasurableSingletonClass α]
  (μ : MeasureTheory.Measure α) [inst_3 : MeasureTheory.IsProbabilityMeasure μ] (x : α), μ.toPMF x = μ {x}

theorem MeasureTheory.Measure.toPMF_toMeasure E0 #

∀ {α : Type u_1} [inst : Countable α] [inst_1 : MeasurableSpace α] [inst_2 : MeasurableSingletonClass α]
  (μ : MeasureTheory.Measure α) [inst_3 : MeasureTheory.IsProbabilityMeasure μ], μ.toPMF.toMeasure = μ

instance PMF.toMeasure.isProbabilityMeasure E0 #

∀ {α : Type u_1} [inst : MeasurableSpace α] (p : PMF α), MeasureTheory.IsProbabilityMeasure p.toMeasure

The measure associated to a PMF by toMeasure is a probability measure.

theorem PMF.toMeasure_toPMF E0 #

∀ {α : Type u_1} [inst : Countable α] [inst_1 : MeasurableSpace α] [inst_2 : MeasurableSingletonClass α] (p : PMF α),
  p.toMeasure.toPMF = p

theorem PMF.toMeasure_eq_iff_eq_toPMF E1 #

∀ {α : Type u_1} [inst : Countable α] [inst_1 : MeasurableSpace α] [inst_2 : MeasurableSingletonClass α] (p : PMF α)
  (μ : MeasureTheory.Measure α) [inst_3 : MeasureTheory.IsProbabilityMeasure μ], p.toMeasure = μ ↔ p = μ.toPMF

theorem PMF.toPMF_eq_iff_toMeasure_eq E0 #

∀ {α : Type u_1} [inst : Countable α] [inst_1 : MeasurableSpace α] [inst_2 : MeasurableSingletonClass α] (p : PMF α)
  (μ : MeasureTheory.Measure α) [inst_3 : MeasureTheory.IsProbabilityMeasure μ], μ.toPMF = p ↔ μ = p.toMeasure