File: Mathlib/Probability/ProbabilityMassFunction/Basic.lean

full_name: PMF
code: /-- A probability mass function, or discrete probability measures is a function `α → ℝ≥0∞` such
  that the values have (infinite) sum `1`. -/
def PMF.{u} (α : Type u) : Type u 
goal: Type u

full_name: PMF.instFunLike
code: instance instFunLike : FunLike (PMF α) α ℝ≥0∞ 
goal: FunLike (PMF α) α ℝ≥0∞

full_name: PMF.ext
code: @[ext]
protected theorem ext {p q : PMF α} (h : ∀ x, p x = q x) : p = q 
goal: p = q

full_name: PMF.ext_iff
code: theorem ext_iff {p q : PMF α} : p = q ↔ ∀ x, p x = q x 
goal: p = q ↔ ∀ (x : α), p x = q x

full_name: PMF.hasSum_coe_one
code: theorem hasSum_coe_one (p : PMF α) : HasSum p 1 
goal: HasSum (⇑p) 1

full_name: PMF.tsum_coe
code: @[simp]
theorem tsum_coe (p : PMF α) : ∑' a, p a = 1 
goal: ∑' (a : α), p a = 1

full_name: PMF.tsum_coe_ne_top
code: theorem tsum_coe_ne_top (p : PMF α) : ∑' a, p a ≠ ∞ 
goal: ∑' (a : α), p a ≠ ⊤

full_name: PMF.tsum_coe_indicator_ne_top
code: theorem tsum_coe_indicator_ne_top (p : PMF α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞ 
goal: ∑' (a : α), s.indicator (⇑p) a ≠ ⊤

full_name: PMF.coe_ne_zero
code: @[simp]
theorem coe_ne_zero (p : PMF α) : ⇑p ≠ 0 
goal: ⇑p ≠ 0

full_name: PMF.support
code: /-- The support of a `PMF` is the set where it is nonzero. -/
def support (p : PMF α) : Set α 
goal: Set α

full_name: PMF.mem_support_iff
code: @[simp]
theorem mem_support_iff (p : PMF α) (a : α) : a ∈ p.support ↔ p a ≠ 0 
goal: a ∈ p.support ↔ p a ≠ 0

full_name: PMF.support_nonempty
code: @[simp]
theorem support_nonempty (p : PMF α) : p.support.Nonempty 
goal: p.support.Nonempty

full_name: PMF.support_countable
code: @[simp]
theorem support_countable (p : PMF α) : p.support.Countable 
goal: p.support.Countable

full_name: PMF.apply_eq_zero_iff
code: theorem apply_eq_zero_iff (p : PMF α) (a : α) : p a = 0 ↔ a ∉ p.support 
goal: p a = 0 ↔ a ∉ p.support

full_name: PMF.apply_pos_iff
code: theorem apply_pos_iff (p : PMF α) (a : α) : 0 < p a ↔ a ∈ p.support 
goal: 0 < p a ↔ a ∈ p.support

full_name: PMF.apply_eq_one_iff
code: theorem apply_eq_one_iff (p : PMF α) (a : α) : p a = 1 ↔ p.support = {a} 
goal: p a = 1 ↔ p.support = {a}

full_name: PMF.coe_le_one
code: theorem coe_le_one (p : PMF α) (a : α) : p a ≤ 1 
goal: p a ≤ 1

full_name: PMF.apply_ne_top
code: theorem apply_ne_top (p : PMF α) (a : α) : p a ≠ ∞ 
goal: p a ≠ ⊤

full_name: PMF.apply_lt_top
code: theorem apply_lt_top (p : PMF α) (a : α) : p a < ∞ 
goal: p a < ⊤

full_name: PMF.toOuterMeasure
code: /-- Construct an `OuterMeasure` from a `PMF`, by assigning measure to each set `s : Set α` equal
  to the sum of `p x` for each `x ∈ α`. -/
def toOuterMeasure (p : PMF α) : OuterMeasure α 
goal: MeasureTheory.OuterMeasure α

full_name: PMF.toOuterMeasure_apply
code: theorem toOuterMeasure_apply : p.toOuterMeasure s = ∑' x, s.indicator p x 
goal: p.toOuterMeasure s = ∑' (x : α), s.indicator (⇑p) x

full_name: PMF.toOuterMeasure_caratheodory
code: @[simp]
theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ 
goal: p.toOuterMeasure.caratheodory = ⊤

full_name: PMF.toOuterMeasure_apply_finset
code: @[simp]
theorem toOuterMeasure_apply_finset (s : Finset α) : p.toOuterMeasure s = ∑ x ∈ s, p x 
goal: p.toOuterMeasure ↑s = ∑ x ∈ s, p x

full_name: PMF.toOuterMeasure_apply_singleton
code: theorem toOuterMeasure_apply_singleton (a : α) : p.toOuterMeasure {a} = p a 
goal: p.toOuterMeasure {a} = p a

full_name: PMF.toOuterMeasure_injective
code: theorem toOuterMeasure_injective : (toOuterMeasure : PMF α → OuterMeasure α).Injective 
goal: Function.Injective PMF.toOuterMeasure

full_name: PMF.toOuterMeasure_inj
code: @[simp]
theorem toOuterMeasure_inj {p q : PMF α} : p.toOuterMeasure = q.toOuterMeasure ↔ p = q 
goal: p.toOuterMeasure = q.toOuterMeasure ↔ p = q

full_name: PMF.toOuterMeasure_apply_eq_zero_iff
code: theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p.support s 
goal: p.toOuterMeasure s = 0 ↔ Disjoint p.support s

full_name: PMF.toOuterMeasure_apply_eq_one_iff
code: theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s 
goal: p.toOuterMeasure s = 1 ↔ p.support ⊆ s

full_name: PMF.toOuterMeasure_apply_inter_support
code: @[simp]
theorem toOuterMeasure_apply_inter_support :
    p.toOuterMeasure (s ∩ p.support) = p.toOuterMeasure s 
goal: p.toOuterMeasure (s ∩ p.support) = p.toOuterMeasure s

full_name: PMF.toOuterMeasure_mono
code: /-- Slightly stronger than `OuterMeasure.mono` having an intersection with `p.support`. -/
theorem toOuterMeasure_mono {s t : Set α} (h : s ∩ p.support ⊆ t) :
    p.toOuterMeasure s ≤ p.toOuterMeasure t 
goal: p.toOuterMeasure s ≤ p.toOuterMeasure t

full_name: PMF.toOuterMeasure_apply_eq_of_inter_support_eq
code: theorem toOuterMeasure_apply_eq_of_inter_support_eq {s t : Set α}
    (h : s ∩ p.support = t ∩ p.support) : p.toOuterMeasure s = p.toOuterMeasure t 
goal: p.toOuterMeasure s = p.toOuterMeasure t

full_name: PMF.toOuterMeasure_apply_fintype
code: @[simp]
theorem toOuterMeasure_apply_fintype [Fintype α] : p.toOuterMeasure s = ∑ x, s.indicator p x 
goal: p.toOuterMeasure s = ∑ x : α, s.indicator (⇑p) x

full_name: PMF.toMeasure
code: /-- Since every set is Carathéodory-measurable under `PMF.toOuterMeasure`,
  we can further extend this `OuterMeasure` to a `Measure` on `α`. -/
def toMeasure [MeasurableSpace α] (p : PMF α) : Measure α 
goal: MeasureTheory.Measure α

full_name: PMF.toOuterMeasure_apply_le_toMeasure_apply
code: theorem toOuterMeasure_apply_le_toMeasure_apply : p.toOuterMeasure s ≤ p.toMeasure s 
goal: p.toOuterMeasure s ≤ p.toMeasure s

full_name: PMF.toMeasure_apply_eq_toOuterMeasure_apply
code: theorem toMeasure_apply_eq_toOuterMeasure_apply (hs : MeasurableSet s) :
    p.toMeasure s = p.toOuterMeasure s 
goal: p.toMeasure s = p.toOuterMeasure s

full_name: PMF.toMeasure_apply
code: theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indicator p x 
goal: p.toMeasure s = ∑' (x : α), s.indicator (⇑p) x

full_name: PMF.toMeasure_apply_singleton
code: theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
    p.toMeasure {a} = p a 
goal: p.toMeasure {a} = p a

full_name: PMF.toMeasure_apply_eq_zero_iff
code: theorem toMeasure_apply_eq_zero_iff (hs : MeasurableSet s) :
    p.toMeasure s = 0 ↔ Disjoint p.support s 
goal: p.toMeasure s = 0 ↔ Disjoint p.support s

full_name: PMF.toMeasure_apply_eq_one_iff
code: theorem toMeasure_apply_eq_one_iff (hs : MeasurableSet s) : p.toMeasure s = 1 ↔ p.support ⊆ s 
goal: p.toMeasure s = 1 ↔ p.support ⊆ s

full_name: PMF.toMeasure_apply_inter_support
code: @[simp]
theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet p.support) :
    p.toMeasure (s ∩ p.support) = p.toMeasure s 
goal: p.toMeasure (s ∩ p.support) = p.toMeasure s

full_name: PMF.restrict_toMeasure_support
code: @[simp]
theorem restrict_toMeasure_support [MeasurableSingletonClass α] (p : PMF α) :
    Measure.restrict (toMeasure p) (support p) = toMeasure p 
goal: p.toMeasure.restrict p.support = p.toMeasure

full_name: PMF.toMeasure_mono
code: theorem toMeasure_mono {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
    (h : s ∩ p.support ⊆ t) : p.toMeasure s ≤ p.toMeasure t 
goal: p.toMeasure s ≤ p.toMeasure t

full_name: PMF.toMeasure_apply_eq_of_inter_support_eq
code: theorem toMeasure_apply_eq_of_inter_support_eq {s t : Set α} (hs : MeasurableSet s)
    (ht : MeasurableSet t) (h : s ∩ p.support = t ∩ p.support) : p.toMeasure s = p.toMeasure t 
goal: p.toMeasure s = p.toMeasure t

full_name: PMF.toMeasure_injective
code: theorem toMeasure_injective : (toMeasure : PMF α → Measure α).Injective 
goal: Function.Injective PMF.toMeasure

full_name: PMF.toMeasure_inj
code: @[simp]
theorem toMeasure_inj {p q : PMF α} : p.toMeasure = q.toMeasure ↔ p = q 
goal: p.toMeasure = q.toMeasure ↔ p = q

full_name: PMF.toMeasure_apply_finset
code: @[simp]
theorem toMeasure_apply_finset (s : Finset α) : p.toMeasure s = ∑ x ∈ s, p x 
goal: p.toMeasure ↑s = ∑ x ∈ s, p x

full_name: PMF.toMeasure_apply_of_finite
code: theorem toMeasure_apply_of_finite (hs : s.Finite) : p.toMeasure s = ∑' x, s.indicator p x 
goal: p.toMeasure s = ∑' (x : α), s.indicator (⇑p) x

full_name: PMF.toMeasure_apply_fintype
code: @[simp]
theorem toMeasure_apply_fintype [Fintype α] : p.toMeasure s = ∑ x, s.indicator p x 
goal: p.toMeasure s = ∑ x : α, s.indicator (⇑p) x

full_name: MeasureTheory.Measure.toPMF
code: /-- 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. -/
def toPMF [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
    [h : IsProbabilityMeasure μ] : PMF α 
goal: PMF α

full_name: MeasureTheory.Measure.toPMF_apply
code: theorem toPMF_apply (x : α) : μ.toPMF x = μ {x} 
goal: μ.toPMF x = μ {x}

full_name: MeasureTheory.Measure.toPMF_toMeasure
code: @[simp]
theorem toPMF_toMeasure : μ.toPMF.toMeasure = μ 
goal: μ.toPMF.toMeasure = μ

full_name: PMF.toMeasure.isProbabilityMeasure
code: /-- The measure associated to a `PMF` by `toMeasure` is a probability measure. -/
instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : PMF α) :
    IsProbabilityMeasure p.toMeasure 
goal: MeasureTheory.IsProbabilityMeasure p.toMeasure

full_name: PMF.toMeasure_toPMF
code: @[simp]
theorem toMeasure_toPMF : p.toMeasure.toPMF = p 
goal: p.toMeasure.toPMF = p

full_name: PMF.toMeasure_eq_iff_eq_toPMF
code: theorem toMeasure_eq_iff_eq_toPMF (μ : Measure α) [IsProbabilityMeasure μ] :
    p.toMeasure = μ ↔ p = μ.toPMF 
goal: p.toMeasure = μ ↔ p = μ.toPMF

full_name: PMF.toPMF_eq_iff_toMeasure_eq
code: theorem toPMF_eq_iff_toMeasure_eq (μ : Measure α) [IsProbabilityMeasure μ] :
    μ.toPMF = p ↔ μ = p.toMeasure 
goal: μ.toPMF = p ↔ μ = p.toMeasure