probability.probability_mass_function.basic
⟷
Mathlib.Probability.ProbabilityMassFunction.Basic
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -3,7 +3,7 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Devon Tuma
-/
-import Topology.Instances.Ennreal
+import Topology.Instances.ENNReal
import MeasureTheory.Measure.MeasureSpace
#align_import probability.probability_mass_function.basic from "leanprover-community/mathlib"@"a2706b55e8d7f7e9b1f93143f0b88f2e34a11eea"
@@ -262,7 +262,7 @@ theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p
#align pmf.to_outer_measure_apply_eq_zero_iff PMF.toOuterMeasure_apply_eq_zero_iff
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ∉ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (x «expr ∉ » s) -/
#print PMF.toOuterMeasure_apply_eq_one_iff /-
theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -51,12 +51,12 @@ def PMF.{u} (α : Type u) : Type u :=
namespace PMF
-#print PMF.instDFunLike /-
-instance instDFunLike : DFunLike (PMF α) α fun p => ℝ≥0∞
+#print PMF.instFunLike /-
+instance instFunLike : DFunLike (PMF α) α fun p => ℝ≥0∞
where
coe p a := p.1 a
coe_injective' p q h := Subtype.eq h
-#align pmf.fun_like PMF.instDFunLike
+#align pmf.fun_like PMF.instFunLike
-/
#print PMF.ext /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -51,24 +51,24 @@ def PMF.{u} (α : Type u) : Type u :=
namespace PMF
-#print PMF.funLike /-
-instance funLike : FunLike (PMF α) α fun p => ℝ≥0∞
+#print PMF.instDFunLike /-
+instance instDFunLike : DFunLike (PMF α) α fun p => ℝ≥0∞
where
coe p a := p.1 a
coe_injective' p q h := Subtype.eq h
-#align pmf.fun_like PMF.funLike
+#align pmf.fun_like PMF.instDFunLike
-/
#print PMF.ext /-
@[ext]
protected theorem ext {p q : PMF α} (h : ∀ x, p x = q x) : p = q :=
- FunLike.ext p q h
+ DFunLike.ext p q h
#align pmf.ext PMF.ext
-/
#print PMF.ext_iff /-
theorem ext_iff {p q : PMF α} : p = q ↔ ∀ x, p x = q x :=
- FunLike.ext_iff
+ DFunLike.ext_iff
#align pmf.ext_iff PMF.ext_iff
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -41,108 +41,108 @@ variable {α β γ : Type _}
open scoped Classical BigOperators NNReal ENNReal MeasureTheory
-#print Pmf /-
+#print PMF /-
/-- 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 :=
+def PMF.{u} (α : Type u) : Type u :=
{ f : α → ℝ≥0∞ // HasSum f 1 }
-#align pmf Pmf
+#align pmf PMF
-/
-namespace Pmf
+namespace PMF
-#print Pmf.funLike /-
-instance funLike : FunLike (Pmf α) α fun p => ℝ≥0∞
+#print PMF.funLike /-
+instance funLike : FunLike (PMF α) α fun p => ℝ≥0∞
where
coe p a := p.1 a
coe_injective' p q h := Subtype.eq h
-#align pmf.fun_like Pmf.funLike
+#align pmf.fun_like PMF.funLike
-/
-#print Pmf.ext /-
+#print PMF.ext /-
@[ext]
-protected theorem ext {p q : Pmf α} (h : ∀ x, p x = q x) : p = q :=
+protected theorem ext {p q : PMF α} (h : ∀ x, p x = q x) : p = q :=
FunLike.ext p q h
-#align pmf.ext Pmf.ext
+#align pmf.ext PMF.ext
-/
-#print Pmf.ext_iff /-
-theorem ext_iff {p q : Pmf α} : p = q ↔ ∀ x, p x = q x :=
+#print PMF.ext_iff /-
+theorem ext_iff {p q : PMF α} : p = q ↔ ∀ x, p x = q x :=
FunLike.ext_iff
-#align pmf.ext_iff Pmf.ext_iff
+#align pmf.ext_iff PMF.ext_iff
-/
-#print Pmf.hasSum_coe_one /-
-theorem hasSum_coe_one (p : Pmf α) : HasSum p 1 :=
+#print PMF.hasSum_coe_one /-
+theorem hasSum_coe_one (p : PMF α) : HasSum p 1 :=
p.2
-#align pmf.has_sum_coe_one Pmf.hasSum_coe_one
+#align pmf.has_sum_coe_one PMF.hasSum_coe_one
-/
-#print Pmf.tsum_coe /-
+#print PMF.tsum_coe /-
@[simp]
-theorem tsum_coe (p : Pmf α) : ∑' a, p a = 1 :=
+theorem tsum_coe (p : PMF α) : ∑' a, p a = 1 :=
p.hasSum_coe_one.tsum_eq
-#align pmf.tsum_coe Pmf.tsum_coe
+#align pmf.tsum_coe PMF.tsum_coe
-/
-#print Pmf.tsum_coe_ne_top /-
-theorem tsum_coe_ne_top (p : Pmf α) : ∑' a, p a ≠ ∞ :=
+#print PMF.tsum_coe_ne_top /-
+theorem tsum_coe_ne_top (p : PMF α) : ∑' a, p a ≠ ∞ :=
p.tsum_coe.symm ▸ ENNReal.one_ne_top
-#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_top
+#align pmf.tsum_coe_ne_top PMF.tsum_coe_ne_top
-/
-#print Pmf.tsum_coe_indicator_ne_top /-
-theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞ :=
+#print PMF.tsum_coe_indicator_ne_top /-
+theorem tsum_coe_indicator_ne_top (p : PMF α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞ :=
ne_of_lt
(lt_of_le_of_lt
(tsum_le_tsum (fun a => Set.indicator_apply_le fun _ => le_rfl) ENNReal.summable
ENNReal.summable)
(lt_of_le_of_ne le_top p.tsum_coe_ne_top))
-#align pmf.tsum_coe_indicator_ne_top Pmf.tsum_coe_indicator_ne_top
+#align pmf.tsum_coe_indicator_ne_top PMF.tsum_coe_indicator_ne_top
-/
-#print Pmf.coe_ne_zero /-
+#print PMF.coe_ne_zero /-
@[simp]
-theorem coe_ne_zero (p : Pmf α) : ⇑p ≠ 0 := fun hp =>
+theorem coe_ne_zero (p : PMF α) : ⇑p ≠ 0 := fun hp =>
zero_ne_one ((tsum_zero.symm.trans (tsum_congr fun x => symm (congr_fun hp x))).trans p.tsum_coe)
-#align pmf.coe_ne_zero Pmf.coe_ne_zero
+#align pmf.coe_ne_zero PMF.coe_ne_zero
-/
-#print Pmf.support /-
+#print PMF.support /-
/-- The support of a `pmf` is the set where it is nonzero. -/
-def support (p : Pmf α) : Set α :=
+def support (p : PMF α) : Set α :=
Function.support p
-#align pmf.support Pmf.support
+#align pmf.support PMF.support
-/
-#print Pmf.mem_support_iff /-
+#print PMF.mem_support_iff /-
@[simp]
-theorem mem_support_iff (p : Pmf α) (a : α) : a ∈ p.support ↔ p a ≠ 0 :=
+theorem mem_support_iff (p : PMF α) (a : α) : a ∈ p.support ↔ p a ≠ 0 :=
Iff.rfl
-#align pmf.mem_support_iff Pmf.mem_support_iff
+#align pmf.mem_support_iff PMF.mem_support_iff
-/
-#print Pmf.support_nonempty /-
+#print PMF.support_nonempty /-
@[simp]
-theorem support_nonempty (p : Pmf α) : p.support.Nonempty :=
+theorem support_nonempty (p : PMF α) : p.support.Nonempty :=
Function.support_nonempty_iff.2 p.coe_ne_zero
-#align pmf.support_nonempty Pmf.support_nonempty
+#align pmf.support_nonempty PMF.support_nonempty
-/
-#print Pmf.apply_eq_zero_iff /-
-theorem apply_eq_zero_iff (p : Pmf α) (a : α) : p a = 0 ↔ a ∉ p.support := by
+#print PMF.apply_eq_zero_iff /-
+theorem apply_eq_zero_iff (p : PMF α) (a : α) : p a = 0 ↔ a ∉ p.support := by
rw [mem_support_iff, Classical.not_not]
-#align pmf.apply_eq_zero_iff Pmf.apply_eq_zero_iff
+#align pmf.apply_eq_zero_iff PMF.apply_eq_zero_iff
-/
-#print Pmf.apply_pos_iff /-
-theorem apply_pos_iff (p : Pmf α) (a : α) : 0 < p a ↔ a ∈ p.support :=
+#print PMF.apply_pos_iff /-
+theorem apply_pos_iff (p : PMF α) (a : α) : 0 < p a ↔ a ∈ p.support :=
pos_iff_ne_zero.trans (p.mem_support_iff a).symm
-#align pmf.apply_pos_iff Pmf.apply_pos_iff
+#align pmf.apply_pos_iff PMF.apply_pos_iff
-/
-#print Pmf.apply_eq_one_iff /-
-theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
+#print PMF.apply_eq_one_iff /-
+theorem apply_eq_one_iff (p : PMF α) (a : α) : p a = 1 ↔ p.support = {a} :=
by
refine'
⟨fun h =>
@@ -166,49 +166,49 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
exact symm (tsum_eq_single a fun b hb => if_neg hb)
_ = ∑' b, (ite (b = a) (p b) 0 + ite (b = a) 0 (p b)) := ennreal.tsum_add.symm
_ = ∑' b, p b := tsum_congr fun b => by split_ifs <;> simp only [zero_add, add_zero, le_rfl]
-#align pmf.apply_eq_one_iff Pmf.apply_eq_one_iff
+#align pmf.apply_eq_one_iff PMF.apply_eq_one_iff
-/
-#print Pmf.coe_le_one /-
-theorem coe_le_one (p : Pmf α) (a : α) : p a ≤ 1 :=
+#print PMF.coe_le_one /-
+theorem coe_le_one (p : PMF α) (a : α) : p a ≤ 1 :=
hasSum_le (by intro b; split_ifs <;> simp only [h, zero_le', le_rfl]) (hasSum_ite_eq a (p a))
(hasSum_coe_one p)
-#align pmf.coe_le_one Pmf.coe_le_one
+#align pmf.coe_le_one PMF.coe_le_one
-/
-#print Pmf.apply_ne_top /-
-theorem apply_ne_top (p : Pmf α) (a : α) : p a ≠ ∞ :=
+#print PMF.apply_ne_top /-
+theorem apply_ne_top (p : PMF α) (a : α) : p a ≠ ∞ :=
ne_of_lt (lt_of_le_of_lt (p.coe_le_one a) ENNReal.one_lt_top)
-#align pmf.apply_ne_top Pmf.apply_ne_top
+#align pmf.apply_ne_top PMF.apply_ne_top
-/
-#print Pmf.apply_lt_top /-
-theorem apply_lt_top (p : Pmf α) (a : α) : p a < ∞ :=
+#print PMF.apply_lt_top /-
+theorem apply_lt_top (p : PMF α) (a : α) : p a < ∞ :=
lt_of_le_of_ne le_top (p.apply_ne_top a)
-#align pmf.apply_lt_top Pmf.apply_lt_top
+#align pmf.apply_lt_top PMF.apply_lt_top
-/
section OuterMeasure
open MeasureTheory MeasureTheory.OuterMeasure
-#print Pmf.toOuterMeasure /-
+#print PMF.toOuterMeasure /-
/-- 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 ∈ α` -/
-def toOuterMeasure (p : Pmf α) : OuterMeasure α :=
+def toOuterMeasure (p : PMF α) : OuterMeasure α :=
OuterMeasure.sum fun x : α => p x • dirac x
-#align pmf.to_outer_measure Pmf.toOuterMeasure
+#align pmf.to_outer_measure PMF.toOuterMeasure
-/
-variable (p : Pmf α) (s t : Set α)
+variable (p : PMF α) (s t : Set α)
-#print Pmf.toOuterMeasure_apply /-
+#print PMF.toOuterMeasure_apply /-
theorem toOuterMeasure_apply : p.toOuterMeasure s = ∑' x, s.indicator p x :=
tsum_congr fun x => smul_dirac_apply (p x) x s
-#align pmf.to_outer_measure_apply Pmf.toOuterMeasure_apply
+#align pmf.to_outer_measure_apply PMF.toOuterMeasure_apply
-/
-#print Pmf.toOuterMeasure_caratheodory /-
+#print PMF.toOuterMeasure_caratheodory /-
@[simp]
theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
by
@@ -216,54 +216,54 @@ theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
exact
let ⟨y, hy⟩ := hx
((le_of_eq (dirac_caratheodory y).symm).trans (le_smul_caratheodory _ _)).trans (le_of_eq hy)
-#align pmf.to_outer_measure_caratheodory Pmf.toOuterMeasure_caratheodory
+#align pmf.to_outer_measure_caratheodory PMF.toOuterMeasure_caratheodory
-/
-#print Pmf.toOuterMeasure_apply_finset /-
+#print PMF.toOuterMeasure_apply_finset /-
@[simp]
theorem toOuterMeasure_apply_finset (s : Finset α) : p.toOuterMeasure s = ∑ x in s, p x :=
by
refine' (to_outer_measure_apply p s).trans ((@tsum_eq_sum _ _ _ _ _ _ s _).trans _)
· exact fun x hx => Set.indicator_of_not_mem hx _
· exact Finset.sum_congr rfl fun x hx => Set.indicator_of_mem hx _
-#align pmf.to_outer_measure_apply_finset Pmf.toOuterMeasure_apply_finset
+#align pmf.to_outer_measure_apply_finset PMF.toOuterMeasure_apply_finset
-/
-#print Pmf.toOuterMeasure_apply_singleton /-
+#print PMF.toOuterMeasure_apply_singleton /-
theorem toOuterMeasure_apply_singleton (a : α) : p.toOuterMeasure {a} = p a :=
by
refine' (p.to_outer_measure_apply {a}).trans ((tsum_eq_single a fun b hb => _).trans _)
· exact ite_eq_right_iff.2 fun hb' => False.elim <| hb hb'
· exact ite_eq_left_iff.2 fun ha' => False.elim <| ha' rfl
-#align pmf.to_outer_measure_apply_singleton Pmf.toOuterMeasure_apply_singleton
+#align pmf.to_outer_measure_apply_singleton PMF.toOuterMeasure_apply_singleton
-/
-#print Pmf.toOuterMeasure_injective /-
-theorem toOuterMeasure_injective : (toOuterMeasure : Pmf α → OuterMeasure α).Injective :=
+#print PMF.toOuterMeasure_injective /-
+theorem toOuterMeasure_injective : (toOuterMeasure : PMF α → OuterMeasure α).Injective :=
fun p q h =>
- Pmf.ext fun x =>
+ PMF.ext fun x =>
(p.toOuterMeasure_apply_singleton x).symm.trans
((congr_fun (congr_arg _ h) _).trans <| q.toOuterMeasure_apply_singleton x)
-#align pmf.to_outer_measure_injective Pmf.toOuterMeasure_injective
+#align pmf.to_outer_measure_injective PMF.toOuterMeasure_injective
-/
-#print Pmf.toOuterMeasure_inj /-
+#print PMF.toOuterMeasure_inj /-
@[simp]
-theorem toOuterMeasure_inj {p q : Pmf α} : p.toOuterMeasure = q.toOuterMeasure ↔ p = q :=
+theorem toOuterMeasure_inj {p q : PMF α} : p.toOuterMeasure = q.toOuterMeasure ↔ p = q :=
toOuterMeasure_injective.eq_iff
-#align pmf.to_outer_measure_inj Pmf.toOuterMeasure_inj
+#align pmf.to_outer_measure_inj PMF.toOuterMeasure_inj
-/
-#print Pmf.toOuterMeasure_apply_eq_zero_iff /-
+#print PMF.toOuterMeasure_apply_eq_zero_iff /-
theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p.support s :=
by
rw [to_outer_measure_apply, ENNReal.tsum_eq_zero]
exact function.funext_iff.symm.trans Set.indicator_eq_zero'
-#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iff
+#align pmf.to_outer_measure_apply_eq_zero_iff PMF.toOuterMeasure_apply_eq_zero_iff
-/
/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ∉ » s) -/
-#print Pmf.toOuterMeasure_apply_eq_one_iff /-
+#print PMF.toOuterMeasure_apply_eq_one_iff /-
theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s :=
by
refine' (p.to_outer_measure_apply s).symm ▸ ⟨fun h a hap => _, fun h => _⟩
@@ -279,38 +279,38 @@ theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support
(tsum_congr fun a => (Set.indicator_apply s p a).trans (ite_eq_left_iff.2 <| symm ∘ this a))
p.tsum_coe
exact fun a ha => (p.apply_eq_zero_iff a).2 <| Set.not_mem_subset h ha
-#align pmf.to_outer_measure_apply_eq_one_iff Pmf.toOuterMeasure_apply_eq_one_iff
+#align pmf.to_outer_measure_apply_eq_one_iff PMF.toOuterMeasure_apply_eq_one_iff
-/
-#print Pmf.toOuterMeasure_apply_inter_support /-
+#print PMF.toOuterMeasure_apply_inter_support /-
@[simp]
theorem toOuterMeasure_apply_inter_support :
p.toOuterMeasure (s ∩ p.support) = p.toOuterMeasure s := by
- simp only [to_outer_measure_apply, Pmf.support, Set.indicator_inter_support]
-#align pmf.to_outer_measure_apply_inter_support Pmf.toOuterMeasure_apply_inter_support
+ simp only [to_outer_measure_apply, PMF.support, Set.indicator_inter_support]
+#align pmf.to_outer_measure_apply_inter_support PMF.toOuterMeasure_apply_inter_support
-/
-#print Pmf.toOuterMeasure_mono /-
+#print PMF.toOuterMeasure_mono /-
/-- Slightly stronger than `outer_measure.mono` having an intersection with `p.support` -/
theorem toOuterMeasure_mono {s t : Set α} (h : s ∩ p.support ⊆ t) :
p.toOuterMeasure s ≤ p.toOuterMeasure t :=
le_trans (le_of_eq (toOuterMeasure_apply_inter_support p s).symm) (p.toOuterMeasure.mono h)
-#align pmf.to_outer_measure_mono Pmf.toOuterMeasure_mono
+#align pmf.to_outer_measure_mono PMF.toOuterMeasure_mono
-/
-#print Pmf.toOuterMeasure_apply_eq_of_inter_support_eq /-
+#print PMF.toOuterMeasure_apply_eq_of_inter_support_eq /-
theorem toOuterMeasure_apply_eq_of_inter_support_eq {s t : Set α}
(h : s ∩ p.support = t ∩ p.support) : p.toOuterMeasure s = p.toOuterMeasure t :=
le_antisymm (p.toOuterMeasure_mono (h.symm ▸ Set.inter_subset_left t p.support))
(p.toOuterMeasure_mono (h ▸ Set.inter_subset_left s p.support))
-#align pmf.to_outer_measure_apply_eq_of_inter_support_eq Pmf.toOuterMeasure_apply_eq_of_inter_support_eq
+#align pmf.to_outer_measure_apply_eq_of_inter_support_eq PMF.toOuterMeasure_apply_eq_of_inter_support_eq
-/
-#print Pmf.toOuterMeasure_apply_fintype /-
+#print PMF.toOuterMeasure_apply_fintype /-
@[simp]
theorem toOuterMeasure_apply_fintype [Fintype α] : p.toOuterMeasure s = ∑ x, s.indicator p x :=
(p.toOuterMeasure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
-#align pmf.to_outer_measure_apply_fintype Pmf.toOuterMeasure_apply_fintype
+#align pmf.to_outer_measure_apply_fintype PMF.toOuterMeasure_apply_fintype
-/
end OuterMeasure
@@ -319,140 +319,140 @@ section Measure
open MeasureTheory
-#print Pmf.toMeasure /-
+#print PMF.toMeasure /-
/-- Since every set is Carathéodory-measurable under `pmf.to_outer_measure`,
we can further extend this `outer_measure` to a `measure` on `α` -/
-def toMeasure [MeasurableSpace α] (p : Pmf α) : Measure α :=
+def toMeasure [MeasurableSpace α] (p : PMF α) : Measure α :=
p.toOuterMeasure.toMeasure ((toOuterMeasure_caratheodory p).symm ▸ le_top)
-#align pmf.to_measure Pmf.toMeasure
+#align pmf.to_measure PMF.toMeasure
-/
-variable [MeasurableSpace α] (p : Pmf α) (s t : Set α)
+variable [MeasurableSpace α] (p : PMF α) (s t : Set α)
-#print Pmf.toOuterMeasure_apply_le_toMeasure_apply /-
+#print PMF.toOuterMeasure_apply_le_toMeasure_apply /-
theorem toOuterMeasure_apply_le_toMeasure_apply : p.toOuterMeasure s ≤ p.toMeasure s :=
le_toMeasure_apply p.toOuterMeasure _ s
-#align pmf.to_outer_measure_apply_le_to_measure_apply Pmf.toOuterMeasure_apply_le_toMeasure_apply
+#align pmf.to_outer_measure_apply_le_to_measure_apply PMF.toOuterMeasure_apply_le_toMeasure_apply
-/
-#print Pmf.toMeasure_apply_eq_toOuterMeasure_apply /-
+#print PMF.toMeasure_apply_eq_toOuterMeasure_apply /-
theorem toMeasure_apply_eq_toOuterMeasure_apply (hs : MeasurableSet s) :
p.toMeasure s = p.toOuterMeasure s :=
toMeasure_apply p.toOuterMeasure _ hs
-#align pmf.to_measure_apply_eq_to_outer_measure_apply Pmf.toMeasure_apply_eq_toOuterMeasure_apply
+#align pmf.to_measure_apply_eq_to_outer_measure_apply PMF.toMeasure_apply_eq_toOuterMeasure_apply
-/
-#print Pmf.toMeasure_apply /-
+#print PMF.toMeasure_apply /-
theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs).trans (p.toOuterMeasure_apply s)
-#align pmf.to_measure_apply Pmf.toMeasure_apply
+#align pmf.to_measure_apply PMF.toMeasure_apply
-/
-#print Pmf.toMeasure_apply_singleton /-
+#print PMF.toMeasure_apply_singleton /-
theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
p.toMeasure {a} = p a := by
simp [to_measure_apply_eq_to_outer_measure_apply _ _ h, to_outer_measure_apply_singleton]
-#align pmf.to_measure_apply_singleton Pmf.toMeasure_apply_singleton
+#align pmf.to_measure_apply_singleton PMF.toMeasure_apply_singleton
-/
-#print Pmf.toMeasure_apply_eq_zero_iff /-
+#print PMF.toMeasure_apply_eq_zero_iff /-
theorem toMeasure_apply_eq_zero_iff (hs : MeasurableSet s) :
p.toMeasure s = 0 ↔ Disjoint p.support s := by
rw [to_measure_apply_eq_to_outer_measure_apply p s hs, to_outer_measure_apply_eq_zero_iff]
-#align pmf.to_measure_apply_eq_zero_iff Pmf.toMeasure_apply_eq_zero_iff
+#align pmf.to_measure_apply_eq_zero_iff PMF.toMeasure_apply_eq_zero_iff
-/
-#print Pmf.toMeasure_apply_eq_one_iff /-
+#print PMF.toMeasure_apply_eq_one_iff /-
theorem toMeasure_apply_eq_one_iff (hs : MeasurableSet s) : p.toMeasure s = 1 ↔ p.support ⊆ s :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs : p.toMeasure s = p.toOuterMeasure s).symm ▸
p.toOuterMeasure_apply_eq_one_iff s
-#align pmf.to_measure_apply_eq_one_iff Pmf.toMeasure_apply_eq_one_iff
+#align pmf.to_measure_apply_eq_one_iff PMF.toMeasure_apply_eq_one_iff
-/
-#print Pmf.toMeasure_apply_inter_support /-
+#print PMF.toMeasure_apply_inter_support /-
@[simp]
theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet p.support) :
p.toMeasure (s ∩ p.support) = p.toMeasure s := by
simp [p.to_measure_apply_eq_to_outer_measure_apply s hs,
p.to_measure_apply_eq_to_outer_measure_apply _ (hs.inter hp)]
-#align pmf.to_measure_apply_inter_support Pmf.toMeasure_apply_inter_support
+#align pmf.to_measure_apply_inter_support PMF.toMeasure_apply_inter_support
-/
-#print Pmf.toMeasure_mono /-
+#print PMF.toMeasure_mono /-
theorem toMeasure_mono {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
(h : s ∩ p.support ⊆ t) : p.toMeasure s ≤ p.toMeasure t := by
simpa only [p.to_measure_apply_eq_to_outer_measure_apply, hs, ht] using to_outer_measure_mono p h
-#align pmf.to_measure_mono Pmf.toMeasure_mono
+#align pmf.to_measure_mono PMF.toMeasure_mono
-/
-#print Pmf.toMeasure_apply_eq_of_inter_support_eq /-
+#print PMF.toMeasure_apply_eq_of_inter_support_eq /-
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 := by
simpa only [p.to_measure_apply_eq_to_outer_measure_apply, hs, ht] using
to_outer_measure_apply_eq_of_inter_support_eq p h
-#align pmf.to_measure_apply_eq_of_inter_support_eq Pmf.toMeasure_apply_eq_of_inter_support_eq
+#align pmf.to_measure_apply_eq_of_inter_support_eq PMF.toMeasure_apply_eq_of_inter_support_eq
-/
section MeasurableSingletonClass
variable [MeasurableSingletonClass α]
-#print Pmf.toMeasure_injective /-
-theorem toMeasure_injective : (toMeasure : Pmf α → Measure α).Injective := fun p q h =>
- Pmf.ext fun x =>
+#print PMF.toMeasure_injective /-
+theorem toMeasure_injective : (toMeasure : PMF α → Measure α).Injective := fun p q h =>
+ PMF.ext fun x =>
(p.toMeasure_apply_singleton x <| measurableSet_singleton x).symm.trans
((congr_fun (congr_arg _ h) _).trans <|
q.toMeasure_apply_singleton x <| measurableSet_singleton x)
-#align pmf.to_measure_injective Pmf.toMeasure_injective
+#align pmf.to_measure_injective PMF.toMeasure_injective
-/
-#print Pmf.toMeasure_inj /-
+#print PMF.toMeasure_inj /-
@[simp]
-theorem toMeasure_inj {p q : Pmf α} : p.toMeasure = q.toMeasure ↔ p = q :=
+theorem toMeasure_inj {p q : PMF α} : p.toMeasure = q.toMeasure ↔ p = q :=
toMeasure_injective.eq_iff
-#align pmf.to_measure_inj Pmf.toMeasure_inj
+#align pmf.to_measure_inj PMF.toMeasure_inj
-/
-#print Pmf.toMeasure_apply_finset /-
+#print PMF.toMeasure_apply_finset /-
@[simp]
theorem toMeasure_apply_finset (s : Finset α) : p.toMeasure s = ∑ x in s, p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.MeasurableSet).trans
(p.toOuterMeasure_apply_finset s)
-#align pmf.to_measure_apply_finset Pmf.toMeasure_apply_finset
+#align pmf.to_measure_apply_finset PMF.toMeasure_apply_finset
-/
-#print Pmf.toMeasure_apply_of_finite /-
+#print PMF.toMeasure_apply_of_finite /-
theorem toMeasure_apply_of_finite (hs : s.Finite) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs.MeasurableSet).trans (p.toOuterMeasure_apply s)
-#align pmf.to_measure_apply_of_finite Pmf.toMeasure_apply_of_finite
+#align pmf.to_measure_apply_of_finite PMF.toMeasure_apply_of_finite
-/
-#print Pmf.toMeasure_apply_fintype /-
+#print PMF.toMeasure_apply_fintype /-
@[simp]
theorem toMeasure_apply_fintype [Fintype α] : p.toMeasure s = ∑ x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.toFinite.MeasurableSet).trans
(p.toOuterMeasure_apply_fintype s)
-#align pmf.to_measure_apply_fintype Pmf.toMeasure_apply_fintype
+#align pmf.to_measure_apply_fintype PMF.toMeasure_apply_fintype
-/
end MeasurableSingletonClass
end Measure
-end Pmf
+end PMF
namespace MeasureTheory
-open Pmf
+open PMF
namespace Measure
-#print MeasureTheory.Measure.toPmf /-
+#print MeasureTheory.Measure.toPMF /-
/-- 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 α :=
+def toPMF [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
+ [h : IsProbabilityMeasure μ] : PMF α :=
⟨fun x => μ ({x} : Set α),
ENNReal.summable.hasSum_iff.2
(trans
@@ -460,66 +460,66 @@ def toPmf [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ
(tsum_indicator_apply_singleton μ Set.univ MeasurableSet.univ).symm.trans
(tsum_congr fun x => congr_fun (Set.indicator_univ _) x))
h.measure_univ)⟩
-#align measure_theory.measure.to_pmf MeasureTheory.Measure.toPmf
+#align measure_theory.measure.to_pmf MeasureTheory.Measure.toPMF
-/
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
[IsProbabilityMeasure μ]
-#print MeasureTheory.Measure.toPmf_apply /-
-theorem toPmf_apply (x : α) : μ.toPmf x = μ {x} :=
+#print MeasureTheory.Measure.toPMF_apply /-
+theorem toPMF_apply (x : α) : μ.toPMF x = μ {x} :=
rfl
-#align measure_theory.measure.to_pmf_apply MeasureTheory.Measure.toPmf_apply
+#align measure_theory.measure.to_pmf_apply MeasureTheory.Measure.toPMF_apply
-/
-#print MeasureTheory.Measure.toPmf_toMeasure /-
+#print MeasureTheory.Measure.toPMF_toMeasure /-
@[simp]
-theorem toPmf_toMeasure : μ.toPmf.toMeasure = μ :=
+theorem toPMF_toMeasure : μ.toPMF.toMeasure = μ :=
Measure.ext fun s hs => by
simpa only [μ.to_pmf.to_measure_apply s hs, ← μ.tsum_indicator_apply_singleton s hs]
-#align measure_theory.measure.to_pmf_to_measure MeasureTheory.Measure.toPmf_toMeasure
+#align measure_theory.measure.to_pmf_to_measure MeasureTheory.Measure.toPMF_toMeasure
-/
end Measure
end MeasureTheory
-namespace Pmf
+namespace PMF
open MeasureTheory
-#print Pmf.toMeasure.isProbabilityMeasure /-
+#print PMF.toMeasure.isProbabilityMeasure /-
/-- The measure associated to a `pmf` by `to_measure` is a probability measure -/
-instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : Pmf α) :
+instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : PMF α) :
IsProbabilityMeasure p.toMeasure :=
⟨by
simpa only [MeasurableSet.univ, to_measure_apply_eq_to_outer_measure_apply, Set.indicator_univ,
to_outer_measure_apply, ENNReal.coe_eq_one] using tsum_coe p⟩
-#align pmf.to_measure.is_probability_measure Pmf.toMeasure.isProbabilityMeasure
+#align pmf.to_measure.is_probability_measure PMF.toMeasure.isProbabilityMeasure
-/
-variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) (μ : Measure α)
+variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : PMF α) (μ : Measure α)
[IsProbabilityMeasure μ]
-#print Pmf.toMeasure_toPmf /-
+#print PMF.toMeasure_toPMF /-
@[simp]
-theorem toMeasure_toPmf : p.toMeasure.toPmf = p :=
- Pmf.ext fun x => by
+theorem toMeasure_toPMF : p.toMeasure.toPMF = p :=
+ PMF.ext fun x => by
rw [← p.to_measure_apply_singleton x (measurable_set_singleton x), p.to_measure.to_pmf_apply]
-#align pmf.to_measure_to_pmf Pmf.toMeasure_toPmf
+#align pmf.to_measure_to_pmf PMF.toMeasure_toPMF
-/
-#print Pmf.toMeasure_eq_iff_eq_toPmf /-
-theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [IsProbabilityMeasure μ] :
- p.toMeasure = μ ↔ p = μ.toPmf := by rw [← to_measure_inj, measure.to_pmf_to_measure]
-#align pmf.to_measure_eq_iff_eq_to_pmf Pmf.toMeasure_eq_iff_eq_toPmf
+#print PMF.toMeasure_eq_iff_eq_toPMF /-
+theorem toMeasure_eq_iff_eq_toPMF (μ : Measure α) [IsProbabilityMeasure μ] :
+ p.toMeasure = μ ↔ p = μ.toPMF := by rw [← to_measure_inj, measure.to_pmf_to_measure]
+#align pmf.to_measure_eq_iff_eq_to_pmf PMF.toMeasure_eq_iff_eq_toPMF
-/
-#print Pmf.toPmf_eq_iff_toMeasure_eq /-
-theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [IsProbabilityMeasure μ] :
- μ.toPmf = p ↔ μ = p.toMeasure := by rw [← to_measure_inj, measure.to_pmf_to_measure]
-#align pmf.to_pmf_eq_iff_to_measure_eq Pmf.toPmf_eq_iff_toMeasure_eq
+#print PMF.toPMF_eq_iff_toMeasure_eq /-
+theorem toPMF_eq_iff_toMeasure_eq (μ : Measure α) [IsProbabilityMeasure μ] :
+ μ.toPMF = p ↔ μ = p.toMeasure := by rw [← to_measure_inj, measure.to_pmf_to_measure]
+#align pmf.to_pmf_eq_iff_to_measure_eq PMF.toPMF_eq_iff_toMeasure_eq
-/
-end Pmf
+end PMF
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Devon Tuma
-/
-import Mathbin.Topology.Instances.Ennreal
-import Mathbin.MeasureTheory.Measure.MeasureSpace
+import Topology.Instances.Ennreal
+import MeasureTheory.Measure.MeasureSpace
#align_import probability.probability_mass_function.basic from "leanprover-community/mathlib"@"a2706b55e8d7f7e9b1f93143f0b88f2e34a11eea"
@@ -262,7 +262,7 @@ theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p
#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iff
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∉ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ∉ » s) -/
#print Pmf.toOuterMeasure_apply_eq_one_iff /-
theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Devon Tuma
-
-! This file was ported from Lean 3 source module probability.probability_mass_function.basic
-! leanprover-community/mathlib commit a2706b55e8d7f7e9b1f93143f0b88f2e34a11eea
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Topology.Instances.Ennreal
import Mathbin.MeasureTheory.Measure.MeasureSpace
+#align_import probability.probability_mass_function.basic from "leanprover-community/mathlib"@"a2706b55e8d7f7e9b1f93143f0b88f2e34a11eea"
+
/-!
# Probability mass functions
@@ -265,7 +262,7 @@ theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p
#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iff
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ∉ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∉ » s) -/
#print Pmf.toOuterMeasure_apply_eq_one_iff /-
theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -75,19 +75,26 @@ theorem ext_iff {p q : Pmf α} : p = q ↔ ∀ x, p x = q x :=
#align pmf.ext_iff Pmf.ext_iff
-/
+#print Pmf.hasSum_coe_one /-
theorem hasSum_coe_one (p : Pmf α) : HasSum p 1 :=
p.2
#align pmf.has_sum_coe_one Pmf.hasSum_coe_one
+-/
+#print Pmf.tsum_coe /-
@[simp]
theorem tsum_coe (p : Pmf α) : ∑' a, p a = 1 :=
p.hasSum_coe_one.tsum_eq
#align pmf.tsum_coe Pmf.tsum_coe
+-/
+#print Pmf.tsum_coe_ne_top /-
theorem tsum_coe_ne_top (p : Pmf α) : ∑' a, p a ≠ ∞ :=
p.tsum_coe.symm ▸ ENNReal.one_ne_top
#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_top
+-/
+#print Pmf.tsum_coe_indicator_ne_top /-
theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞ :=
ne_of_lt
(lt_of_le_of_lt
@@ -95,11 +102,14 @@ theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : ∑' a, s.indicato
ENNReal.summable)
(lt_of_le_of_ne le_top p.tsum_coe_ne_top))
#align pmf.tsum_coe_indicator_ne_top Pmf.tsum_coe_indicator_ne_top
+-/
+#print Pmf.coe_ne_zero /-
@[simp]
theorem coe_ne_zero (p : Pmf α) : ⇑p ≠ 0 := fun hp =>
zero_ne_one ((tsum_zero.symm.trans (tsum_congr fun x => symm (congr_fun hp x))).trans p.tsum_coe)
#align pmf.coe_ne_zero Pmf.coe_ne_zero
+-/
#print Pmf.support /-
/-- The support of a `pmf` is the set where it is nonzero. -/
@@ -108,10 +118,12 @@ def support (p : Pmf α) : Set α :=
#align pmf.support Pmf.support
-/
+#print Pmf.mem_support_iff /-
@[simp]
theorem mem_support_iff (p : Pmf α) (a : α) : a ∈ p.support ↔ p a ≠ 0 :=
Iff.rfl
#align pmf.mem_support_iff Pmf.mem_support_iff
+-/
#print Pmf.support_nonempty /-
@[simp]
@@ -120,13 +132,17 @@ theorem support_nonempty (p : Pmf α) : p.support.Nonempty :=
#align pmf.support_nonempty Pmf.support_nonempty
-/
+#print Pmf.apply_eq_zero_iff /-
theorem apply_eq_zero_iff (p : Pmf α) (a : α) : p a = 0 ↔ a ∉ p.support := by
rw [mem_support_iff, Classical.not_not]
#align pmf.apply_eq_zero_iff Pmf.apply_eq_zero_iff
+-/
+#print Pmf.apply_pos_iff /-
theorem apply_pos_iff (p : Pmf α) (a : α) : 0 < p a ↔ a ∈ p.support :=
pos_iff_ne_zero.trans (p.mem_support_iff a).symm
#align pmf.apply_pos_iff Pmf.apply_pos_iff
+-/
#print Pmf.apply_eq_one_iff /-
theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
@@ -156,18 +172,24 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
#align pmf.apply_eq_one_iff Pmf.apply_eq_one_iff
-/
+#print Pmf.coe_le_one /-
theorem coe_le_one (p : Pmf α) (a : α) : p a ≤ 1 :=
hasSum_le (by intro b; split_ifs <;> simp only [h, zero_le', le_rfl]) (hasSum_ite_eq a (p a))
(hasSum_coe_one p)
#align pmf.coe_le_one Pmf.coe_le_one
+-/
+#print Pmf.apply_ne_top /-
theorem apply_ne_top (p : Pmf α) (a : α) : p a ≠ ∞ :=
ne_of_lt (lt_of_le_of_lt (p.coe_le_one a) ENNReal.one_lt_top)
#align pmf.apply_ne_top Pmf.apply_ne_top
+-/
+#print Pmf.apply_lt_top /-
theorem apply_lt_top (p : Pmf α) (a : α) : p a < ∞ :=
lt_of_le_of_ne le_top (p.apply_ne_top a)
#align pmf.apply_lt_top Pmf.apply_lt_top
+-/
section OuterMeasure
@@ -183,10 +205,13 @@ def toOuterMeasure (p : Pmf α) : OuterMeasure α :=
variable (p : Pmf α) (s t : Set α)
+#print Pmf.toOuterMeasure_apply /-
theorem toOuterMeasure_apply : p.toOuterMeasure s = ∑' x, s.indicator p x :=
tsum_congr fun x => smul_dirac_apply (p x) x s
#align pmf.to_outer_measure_apply Pmf.toOuterMeasure_apply
+-/
+#print Pmf.toOuterMeasure_caratheodory /-
@[simp]
theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
by
@@ -195,7 +220,9 @@ theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
let ⟨y, hy⟩ := hx
((le_of_eq (dirac_caratheodory y).symm).trans (le_smul_caratheodory _ _)).trans (le_of_eq hy)
#align pmf.to_outer_measure_caratheodory Pmf.toOuterMeasure_caratheodory
+-/
+#print Pmf.toOuterMeasure_apply_finset /-
@[simp]
theorem toOuterMeasure_apply_finset (s : Finset α) : p.toOuterMeasure s = ∑ x in s, p x :=
by
@@ -203,6 +230,7 @@ theorem toOuterMeasure_apply_finset (s : Finset α) : p.toOuterMeasure s = ∑ x
· exact fun x hx => Set.indicator_of_not_mem hx _
· exact Finset.sum_congr rfl fun x hx => Set.indicator_of_mem hx _
#align pmf.to_outer_measure_apply_finset Pmf.toOuterMeasure_apply_finset
+-/
#print Pmf.toOuterMeasure_apply_singleton /-
theorem toOuterMeasure_apply_singleton (a : α) : p.toOuterMeasure {a} = p a :=
@@ -229,11 +257,13 @@ theorem toOuterMeasure_inj {p q : Pmf α} : p.toOuterMeasure = q.toOuterMeasure
#align pmf.to_outer_measure_inj Pmf.toOuterMeasure_inj
-/
+#print Pmf.toOuterMeasure_apply_eq_zero_iff /-
theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p.support s :=
by
rw [to_outer_measure_apply, ENNReal.tsum_eq_zero]
exact function.funext_iff.symm.trans Set.indicator_eq_zero'
#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iff
+-/
/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ∉ » s) -/
#print Pmf.toOuterMeasure_apply_eq_one_iff /-
@@ -255,28 +285,36 @@ theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support
#align pmf.to_outer_measure_apply_eq_one_iff Pmf.toOuterMeasure_apply_eq_one_iff
-/
+#print Pmf.toOuterMeasure_apply_inter_support /-
@[simp]
theorem toOuterMeasure_apply_inter_support :
p.toOuterMeasure (s ∩ p.support) = p.toOuterMeasure s := by
simp only [to_outer_measure_apply, Pmf.support, Set.indicator_inter_support]
#align pmf.to_outer_measure_apply_inter_support Pmf.toOuterMeasure_apply_inter_support
+-/
+#print Pmf.toOuterMeasure_mono /-
/-- Slightly stronger than `outer_measure.mono` having an intersection with `p.support` -/
theorem toOuterMeasure_mono {s t : Set α} (h : s ∩ p.support ⊆ t) :
p.toOuterMeasure s ≤ p.toOuterMeasure t :=
le_trans (le_of_eq (toOuterMeasure_apply_inter_support p s).symm) (p.toOuterMeasure.mono h)
#align pmf.to_outer_measure_mono Pmf.toOuterMeasure_mono
+-/
+#print Pmf.toOuterMeasure_apply_eq_of_inter_support_eq /-
theorem toOuterMeasure_apply_eq_of_inter_support_eq {s t : Set α}
(h : s ∩ p.support = t ∩ p.support) : p.toOuterMeasure s = p.toOuterMeasure t :=
le_antisymm (p.toOuterMeasure_mono (h.symm ▸ Set.inter_subset_left t p.support))
(p.toOuterMeasure_mono (h ▸ Set.inter_subset_left s p.support))
#align pmf.to_outer_measure_apply_eq_of_inter_support_eq Pmf.toOuterMeasure_apply_eq_of_inter_support_eq
+-/
+#print Pmf.toOuterMeasure_apply_fintype /-
@[simp]
theorem toOuterMeasure_apply_fintype [Fintype α] : p.toOuterMeasure s = ∑ x, s.indicator p x :=
(p.toOuterMeasure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
#align pmf.to_outer_measure_apply_fintype Pmf.toOuterMeasure_apply_fintype
+-/
end OuterMeasure
@@ -294,9 +332,11 @@ def toMeasure [MeasurableSpace α] (p : Pmf α) : Measure α :=
variable [MeasurableSpace α] (p : Pmf α) (s t : Set α)
+#print Pmf.toOuterMeasure_apply_le_toMeasure_apply /-
theorem toOuterMeasure_apply_le_toMeasure_apply : p.toOuterMeasure s ≤ p.toMeasure s :=
le_toMeasure_apply p.toOuterMeasure _ s
#align pmf.to_outer_measure_apply_le_to_measure_apply Pmf.toOuterMeasure_apply_le_toMeasure_apply
+-/
#print Pmf.toMeasure_apply_eq_toOuterMeasure_apply /-
theorem toMeasure_apply_eq_toOuterMeasure_apply (hs : MeasurableSet s) :
@@ -305,9 +345,11 @@ theorem toMeasure_apply_eq_toOuterMeasure_apply (hs : MeasurableSet s) :
#align pmf.to_measure_apply_eq_to_outer_measure_apply Pmf.toMeasure_apply_eq_toOuterMeasure_apply
-/
+#print Pmf.toMeasure_apply /-
theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs).trans (p.toOuterMeasure_apply s)
#align pmf.to_measure_apply Pmf.toMeasure_apply
+-/
#print Pmf.toMeasure_apply_singleton /-
theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
@@ -316,10 +358,12 @@ theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
#align pmf.to_measure_apply_singleton Pmf.toMeasure_apply_singleton
-/
+#print Pmf.toMeasure_apply_eq_zero_iff /-
theorem toMeasure_apply_eq_zero_iff (hs : MeasurableSet s) :
p.toMeasure s = 0 ↔ Disjoint p.support s := by
rw [to_measure_apply_eq_to_outer_measure_apply p s hs, to_outer_measure_apply_eq_zero_iff]
#align pmf.to_measure_apply_eq_zero_iff Pmf.toMeasure_apply_eq_zero_iff
+-/
#print Pmf.toMeasure_apply_eq_one_iff /-
theorem toMeasure_apply_eq_one_iff (hs : MeasurableSet s) : p.toMeasure s = 1 ↔ p.support ⊆ s :=
@@ -328,23 +372,29 @@ theorem toMeasure_apply_eq_one_iff (hs : MeasurableSet s) : p.toMeasure s = 1
#align pmf.to_measure_apply_eq_one_iff Pmf.toMeasure_apply_eq_one_iff
-/
+#print Pmf.toMeasure_apply_inter_support /-
@[simp]
theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet p.support) :
p.toMeasure (s ∩ p.support) = p.toMeasure s := by
simp [p.to_measure_apply_eq_to_outer_measure_apply s hs,
p.to_measure_apply_eq_to_outer_measure_apply _ (hs.inter hp)]
#align pmf.to_measure_apply_inter_support Pmf.toMeasure_apply_inter_support
+-/
+#print Pmf.toMeasure_mono /-
theorem toMeasure_mono {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
(h : s ∩ p.support ⊆ t) : p.toMeasure s ≤ p.toMeasure t := by
simpa only [p.to_measure_apply_eq_to_outer_measure_apply, hs, ht] using to_outer_measure_mono p h
#align pmf.to_measure_mono Pmf.toMeasure_mono
+-/
+#print Pmf.toMeasure_apply_eq_of_inter_support_eq /-
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 := by
simpa only [p.to_measure_apply_eq_to_outer_measure_apply, hs, ht] using
to_outer_measure_apply_eq_of_inter_support_eq p h
#align pmf.to_measure_apply_eq_of_inter_support_eq Pmf.toMeasure_apply_eq_of_inter_support_eq
+-/
section MeasurableSingletonClass
@@ -366,21 +416,27 @@ theorem toMeasure_inj {p q : Pmf α} : p.toMeasure = q.toMeasure ↔ p = q :=
#align pmf.to_measure_inj Pmf.toMeasure_inj
-/
+#print Pmf.toMeasure_apply_finset /-
@[simp]
theorem toMeasure_apply_finset (s : Finset α) : p.toMeasure s = ∑ x in s, p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.MeasurableSet).trans
(p.toOuterMeasure_apply_finset s)
#align pmf.to_measure_apply_finset Pmf.toMeasure_apply_finset
+-/
+#print Pmf.toMeasure_apply_of_finite /-
theorem toMeasure_apply_of_finite (hs : s.Finite) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs.MeasurableSet).trans (p.toOuterMeasure_apply s)
#align pmf.to_measure_apply_of_finite Pmf.toMeasure_apply_of_finite
+-/
+#print Pmf.toMeasure_apply_fintype /-
@[simp]
theorem toMeasure_apply_fintype [Fintype α] : p.toMeasure s = ∑ x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.toFinite.MeasurableSet).trans
(p.toOuterMeasure_apply_fintype s)
#align pmf.to_measure_apply_fintype Pmf.toMeasure_apply_fintype
+-/
end MeasurableSingletonClass
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -80,15 +80,15 @@ theorem hasSum_coe_one (p : Pmf α) : HasSum p 1 :=
#align pmf.has_sum_coe_one Pmf.hasSum_coe_one
@[simp]
-theorem tsum_coe (p : Pmf α) : (∑' a, p a) = 1 :=
+theorem tsum_coe (p : Pmf α) : ∑' a, p a = 1 :=
p.hasSum_coe_one.tsum_eq
#align pmf.tsum_coe Pmf.tsum_coe
-theorem tsum_coe_ne_top (p : Pmf α) : (∑' a, p a) ≠ ∞ :=
+theorem tsum_coe_ne_top (p : Pmf α) : ∑' a, p a ≠ ∞ :=
p.tsum_coe.symm ▸ ENNReal.one_ne_top
#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_top
-theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : (∑' a, s.indicator p a) ≠ ∞ :=
+theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞ :=
ne_of_lt
(lt_of_le_of_lt
(tsum_le_tsum (fun a => Set.indicator_apply_le fun _ => le_rfl) ENNReal.summable
@@ -149,9 +149,9 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
_ < p a + ∑' b, ite (b = a) 0 (p b) :=
(ENNReal.add_lt_add_of_le_of_lt ENNReal.one_ne_top (le_of_eq h.symm) this)
_ = ite (a = a) (p a) 0 + ∑' b, ite (b = a) 0 (p b) := by rw [eq_self_iff_true, if_true]
- _ = (∑' b, ite (b = a) (p b) 0) + ∑' b, ite (b = a) 0 (p b) := by congr;
+ _ = ∑' b, ite (b = a) (p b) 0 + ∑' b, ite (b = a) 0 (p b) := by congr;
exact symm (tsum_eq_single a fun b hb => if_neg hb)
- _ = ∑' b, ite (b = a) (p b) 0 + ite (b = a) 0 (p b) := ennreal.tsum_add.symm
+ _ = ∑' b, (ite (b = a) (p b) 0 + ite (b = a) 0 (p b)) := ennreal.tsum_add.symm
_ = ∑' b, p b := tsum_congr fun b => by split_ifs <;> simp only [zero_add, add_zero, le_rfl]
#align pmf.apply_eq_one_iff Pmf.apply_eq_one_iff
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -153,7 +153,6 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
exact symm (tsum_eq_single a fun b hb => if_neg hb)
_ = ∑' b, ite (b = a) (p b) 0 + ite (b = a) 0 (p b) := ennreal.tsum_add.symm
_ = ∑' b, p b := tsum_congr fun b => by split_ifs <;> simp only [zero_add, add_zero, le_rfl]
-
#align pmf.apply_eq_one_iff Pmf.apply_eq_one_iff
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/31c24aa72e7b3e5ed97a8412470e904f82b81004
@@ -236,7 +236,7 @@ theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p
exact function.funext_iff.symm.trans Set.indicator_eq_zero'
#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iff
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∉ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ∉ » s) -/
#print Pmf.toOuterMeasure_apply_eq_one_iff /-
theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -400,7 +400,7 @@ namespace Measure
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 : ProbabilityMeasure μ] : Pmf α :=
+ [h : IsProbabilityMeasure μ] : Pmf α :=
⟨fun x => μ ({x} : Set α),
ENNReal.summable.hasSum_iff.2
(trans
@@ -412,7 +412,7 @@ def toPmf [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ
-/
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
- [ProbabilityMeasure μ]
+ [IsProbabilityMeasure μ]
#print MeasureTheory.Measure.toPmf_apply /-
theorem toPmf_apply (x : α) : μ.toPmf x = μ {x} :=
@@ -436,18 +436,18 @@ namespace Pmf
open MeasureTheory
-#print Pmf.toMeasure.probabilityMeasure /-
+#print Pmf.toMeasure.isProbabilityMeasure /-
/-- The measure associated to a `pmf` by `to_measure` is a probability measure -/
-instance toMeasure.probabilityMeasure [MeasurableSpace α] (p : Pmf α) :
- ProbabilityMeasure p.toMeasure :=
+instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : Pmf α) :
+ IsProbabilityMeasure p.toMeasure :=
⟨by
simpa only [MeasurableSet.univ, to_measure_apply_eq_to_outer_measure_apply, Set.indicator_univ,
to_outer_measure_apply, ENNReal.coe_eq_one] using tsum_coe p⟩
-#align pmf.to_measure.is_probability_measure Pmf.toMeasure.probabilityMeasure
+#align pmf.to_measure.is_probability_measure Pmf.toMeasure.isProbabilityMeasure
-/
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) (μ : Measure α)
- [ProbabilityMeasure μ]
+ [IsProbabilityMeasure μ]
#print Pmf.toMeasure_toPmf /-
@[simp]
@@ -458,13 +458,13 @@ theorem toMeasure_toPmf : p.toMeasure.toPmf = p :=
-/
#print Pmf.toMeasure_eq_iff_eq_toPmf /-
-theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [ProbabilityMeasure μ] :
+theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [IsProbabilityMeasure μ] :
p.toMeasure = μ ↔ p = μ.toPmf := by rw [← to_measure_inj, measure.to_pmf_to_measure]
#align pmf.to_measure_eq_iff_eq_to_pmf Pmf.toMeasure_eq_iff_eq_toPmf
-/
#print Pmf.toPmf_eq_iff_toMeasure_eq /-
-theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [ProbabilityMeasure μ] :
+theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [IsProbabilityMeasure μ] :
μ.toPmf = p ↔ μ = p.toMeasure := by rw [← to_measure_inj, measure.to_pmf_to_measure]
#align pmf.to_pmf_eq_iff_to_measure_eq Pmf.toPmf_eq_iff_toMeasure_eq
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -149,7 +149,7 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
_ < p a + ∑' b, ite (b = a) 0 (p b) :=
(ENNReal.add_lt_add_of_le_of_lt ENNReal.one_ne_top (le_of_eq h.symm) this)
_ = ite (a = a) (p a) 0 + ∑' b, ite (b = a) 0 (p b) := by rw [eq_self_iff_true, if_true]
- _ = (∑' b, ite (b = a) (p b) 0) + ∑' b, ite (b = a) 0 (p b) := by congr ;
+ _ = (∑' b, ite (b = a) (p b) 0) + ∑' b, ite (b = a) 0 (p b) := by congr;
exact symm (tsum_eq_single a fun b hb => if_neg hb)
_ = ∑' b, ite (b = a) (p b) 0 + ite (b = a) 0 (p b) := ennreal.tsum_add.symm
_ = ∑' b, p b := tsum_congr fun b => by split_ifs <;> simp only [zero_add, add_zero, le_rfl]
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -276,7 +276,7 @@ theorem toOuterMeasure_apply_eq_of_inter_support_eq {s t : Set α}
@[simp]
theorem toOuterMeasure_apply_fintype [Fintype α] : p.toOuterMeasure s = ∑ x, s.indicator p x :=
- (p.to_outer_measure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
+ (p.toOuterMeasure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
#align pmf.to_outer_measure_apply_fintype Pmf.toOuterMeasure_apply_fintype
end OuterMeasure
@@ -307,7 +307,7 @@ theorem toMeasure_apply_eq_toOuterMeasure_apply (hs : MeasurableSet s) :
-/
theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indicator p x :=
- (p.toMeasure_apply_eq_toOuterMeasure_apply s hs).trans (p.to_outer_measure_apply s)
+ (p.toMeasure_apply_eq_toOuterMeasure_apply s hs).trans (p.toOuterMeasure_apply s)
#align pmf.to_measure_apply Pmf.toMeasure_apply
#print Pmf.toMeasure_apply_singleton /-
@@ -374,7 +374,7 @@ theorem toMeasure_apply_finset (s : Finset α) : p.toMeasure s = ∑ x in s, p x
#align pmf.to_measure_apply_finset Pmf.toMeasure_apply_finset
theorem toMeasure_apply_of_finite (hs : s.Finite) : p.toMeasure s = ∑' x, s.indicator p x :=
- (p.toMeasure_apply_eq_toOuterMeasure_apply s hs.MeasurableSet).trans (p.to_outer_measure_apply s)
+ (p.toMeasure_apply_eq_toOuterMeasure_apply s hs.MeasurableSet).trans (p.toOuterMeasure_apply s)
#align pmf.to_measure_apply_of_finite Pmf.toMeasure_apply_of_finite
@[simp]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -42,7 +42,7 @@ noncomputable section
variable {α β γ : Type _}
-open Classical BigOperators NNReal ENNReal MeasureTheory
+open scoped Classical BigOperators NNReal ENNReal MeasureTheory
#print Pmf /-
/-- A probability mass function, or discrete probability measures is a function `α → ℝ≥0∞` such
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -75,43 +75,19 @@ theorem ext_iff {p q : Pmf α} : p = q ↔ ∀ x, p x = q x :=
#align pmf.ext_iff Pmf.ext_iff
-/
-/- warning: pmf.has_sum_coe_one -> Pmf.hasSum_coe_one is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α), HasSum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne)))))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α), HasSum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) (OfNat.ofNat.{0} ENNReal 1 (One.toOfNat1.{0} ENNReal (CanonicallyOrderedCommSemiring.toOne.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))
-Case conversion may be inaccurate. Consider using '#align pmf.has_sum_coe_one Pmf.hasSum_coe_oneₓ'. -/
theorem hasSum_coe_one (p : Pmf α) : HasSum p 1 :=
p.2
#align pmf.has_sum_coe_one Pmf.hasSum_coe_one
-/- warning: pmf.tsum_coe -> Pmf.tsum_coe is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α), Eq.{1} ENNReal (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (a : α) => coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a)) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne)))))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α), Eq.{1} ENNReal (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (a : α) => FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a)) (OfNat.ofNat.{0} ENNReal 1 (One.toOfNat1.{0} ENNReal (CanonicallyOrderedCommSemiring.toOne.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))
-Case conversion may be inaccurate. Consider using '#align pmf.tsum_coe Pmf.tsum_coeₓ'. -/
@[simp]
theorem tsum_coe (p : Pmf α) : (∑' a, p a) = 1 :=
p.hasSum_coe_one.tsum_eq
#align pmf.tsum_coe Pmf.tsum_coe
-/- warning: pmf.tsum_coe_ne_top -> Pmf.tsum_coe_ne_top is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α), Ne.{1} ENNReal (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (a : α) => coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a)) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α), Ne.{1} ENNReal (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (a : α) => FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a)) (Top.top.{0} ENNReal (CompleteLattice.toTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal)))
-Case conversion may be inaccurate. Consider using '#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_topₓ'. -/
theorem tsum_coe_ne_top (p : Pmf α) : (∑' a, p a) ≠ ∞ :=
p.tsum_coe.symm ▸ ENNReal.one_ne_top
#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_top
-/- warning: pmf.tsum_coe_indicator_ne_top -> Pmf.tsum_coe_indicator_ne_top is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Ne.{1} ENNReal (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (a : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) a)) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Ne.{1} ENNReal (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (a : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) a)) (Top.top.{0} ENNReal (CompleteLattice.toTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal)))
-Case conversion may be inaccurate. Consider using '#align pmf.tsum_coe_indicator_ne_top Pmf.tsum_coe_indicator_ne_topₓ'. -/
theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : (∑' a, s.indicator p a) ≠ ∞ :=
ne_of_lt
(lt_of_le_of_lt
@@ -120,12 +96,6 @@ theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : (∑' a, s.indicat
(lt_of_le_of_ne le_top p.tsum_coe_ne_top))
#align pmf.tsum_coe_indicator_ne_top Pmf.tsum_coe_indicator_ne_top
-/- warning: pmf.coe_ne_zero -> Pmf.coe_ne_zero is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α), Ne.{succ u1} (α -> ENNReal) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) (OfNat.ofNat.{u1} (α -> ENNReal) 0 (OfNat.mk.{u1} (α -> ENNReal) 0 (Zero.zero.{u1} (α -> ENNReal) (Pi.instZero.{u1, 0} α (fun (a : α) => ENNReal) (fun (i : α) => ENNReal.hasZero)))))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α), Ne.{succ u1} (forall (a : α), (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) (OfNat.ofNat.{u1} (forall (a : α), (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 0 (Zero.toOfNat0.{u1} (forall (a : α), (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Pi.instZero.{u1, 0} α (fun (a : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (fun (i : α) => instENNRealZero))))
-Case conversion may be inaccurate. Consider using '#align pmf.coe_ne_zero Pmf.coe_ne_zeroₓ'. -/
@[simp]
theorem coe_ne_zero (p : Pmf α) : ⇑p ≠ 0 := fun hp =>
zero_ne_one ((tsum_zero.symm.trans (tsum_congr fun x => symm (congr_fun hp x))).trans p.tsum_coe)
@@ -138,12 +108,6 @@ def support (p : Pmf α) : Set α :=
#align pmf.support Pmf.support
-/
-/- warning: pmf.mem_support_iff -> Pmf.mem_support_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a (Pmf.support.{u1} α p)) (Ne.{1} ENNReal (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero))))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a (Pmf.support.{u1} α p)) (Ne.{1} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 0 (Zero.toOfNat0.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) instENNRealZero)))
-Case conversion may be inaccurate. Consider using '#align pmf.mem_support_iff Pmf.mem_support_iffₓ'. -/
@[simp]
theorem mem_support_iff (p : Pmf α) (a : α) : a ∈ p.support ↔ p a ≠ 0 :=
Iff.rfl
@@ -156,22 +120,10 @@ theorem support_nonempty (p : Pmf α) : p.support.Nonempty :=
#align pmf.support_nonempty Pmf.support_nonempty
-/
-/- warning: pmf.apply_eq_zero_iff -> Pmf.apply_eq_zero_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) (Not (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a (Pmf.support.{u1} α p)))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (Eq.{1} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 0 (Zero.toOfNat0.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) instENNRealZero))) (Not (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a (Pmf.support.{u1} α p)))
-Case conversion may be inaccurate. Consider using '#align pmf.apply_eq_zero_iff Pmf.apply_eq_zero_iffₓ'. -/
theorem apply_eq_zero_iff (p : Pmf α) (a : α) : p a = 0 ↔ a ∉ p.support := by
rw [mem_support_iff, Classical.not_not]
#align pmf.apply_eq_zero_iff Pmf.apply_eq_zero_iff
-/- warning: pmf.apply_pos_iff -> Pmf.apply_pos_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (LT.lt.{0} ENNReal (Preorder.toHasLt.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a)) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a (Pmf.support.{u1} α p))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (LT.lt.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLT.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 0 (Zero.toOfNat0.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) instENNRealZero)) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a (Pmf.support.{u1} α p))
-Case conversion may be inaccurate. Consider using '#align pmf.apply_pos_iff Pmf.apply_pos_iffₓ'. -/
theorem apply_pos_iff (p : Pmf α) (a : α) : 0 < p a ↔ a ∈ p.support :=
pos_iff_ne_zero.trans (p.mem_support_iff a).symm
#align pmf.apply_pos_iff Pmf.apply_pos_iff
@@ -205,33 +157,15 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
#align pmf.apply_eq_one_iff Pmf.apply_eq_one_iff
-/
-/- warning: pmf.coe_le_one -> Pmf.coe_le_one is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LE.le.{0} ENNReal (Preorder.toHasLe.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne)))))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LE.le.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLE.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CanonicallyOrderedCommSemiring.toOne.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCanonicallyOrderedCommSemiringENNReal)))
-Case conversion may be inaccurate. Consider using '#align pmf.coe_le_one Pmf.coe_le_oneₓ'. -/
theorem coe_le_one (p : Pmf α) (a : α) : p a ≤ 1 :=
hasSum_le (by intro b; split_ifs <;> simp only [h, zero_le', le_rfl]) (hasSum_ite_eq a (p a))
(hasSum_coe_one p)
#align pmf.coe_le_one Pmf.coe_le_one
-/- warning: pmf.apply_ne_top -> Pmf.apply_ne_top is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Ne.{1} ENNReal (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Ne.{1} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (Top.top.{0} ENNReal (CompleteLattice.toTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal)))
-Case conversion may be inaccurate. Consider using '#align pmf.apply_ne_top Pmf.apply_ne_topₓ'. -/
theorem apply_ne_top (p : Pmf α) (a : α) : p a ≠ ∞ :=
ne_of_lt (lt_of_le_of_lt (p.coe_le_one a) ENNReal.one_lt_top)
#align pmf.apply_ne_top Pmf.apply_ne_top
-/- warning: pmf.apply_lt_top -> Pmf.apply_lt_top is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LT.lt.{0} ENNReal (Preorder.toHasLt.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LT.lt.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLT.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (Top.top.{0} ENNReal (CompleteLattice.toTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal)))
-Case conversion may be inaccurate. Consider using '#align pmf.apply_lt_top Pmf.apply_lt_topₓ'. -/
theorem apply_lt_top (p : Pmf α) (a : α) : p a < ∞ :=
lt_of_le_of_ne le_top (p.apply_ne_top a)
#align pmf.apply_lt_top Pmf.apply_lt_top
@@ -250,22 +184,10 @@ def toOuterMeasure (p : Pmf α) : OuterMeasure α :=
variable (p : Pmf α) (s t : Set α)
-/- warning: pmf.to_outer_measure_apply -> Pmf.toOuterMeasure_apply is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x))
-Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply Pmf.toOuterMeasure_applyₓ'. -/
theorem toOuterMeasure_apply : p.toOuterMeasure s = ∑' x, s.indicator p x :=
tsum_congr fun x => smul_dirac_apply (p x) x s
#align pmf.to_outer_measure_apply Pmf.toOuterMeasure_apply
-/- warning: pmf.to_outer_measure_caratheodory -> Pmf.toOuterMeasure_caratheodory is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α), Eq.{succ u1} (MeasurableSpace.{u1} α) (MeasureTheory.OuterMeasure.caratheodory.{u1} α (Pmf.toOuterMeasure.{u1} α p)) (Top.top.{u1} (MeasurableSpace.{u1} α) (CompleteLattice.toHasTop.{u1} (MeasurableSpace.{u1} α) (MeasurableSpace.completeLattice.{u1} α)))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α), Eq.{succ u1} (MeasurableSpace.{u1} α) (MeasureTheory.OuterMeasure.caratheodory.{u1} α (Pmf.toOuterMeasure.{u1} α p)) (Top.top.{u1} (MeasurableSpace.{u1} α) (CompleteLattice.toTop.{u1} (MeasurableSpace.{u1} α) (MeasurableSpace.instCompleteLatticeMeasurableSpace.{u1} α)))
-Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_caratheodory Pmf.toOuterMeasure_caratheodoryₓ'. -/
@[simp]
theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
by
@@ -275,12 +197,6 @@ theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
((le_of_eq (dirac_caratheodory y).symm).trans (le_smul_caratheodory _ _)).trans (le_of_eq hy)
#align pmf.to_outer_measure_caratheodory Pmf.toOuterMeasure_caratheodory
-/- warning: pmf.to_outer_measure_apply_finset -> Pmf.toOuterMeasure_apply_finset is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Finset.{u1} α), Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s)) (Finset.sum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) s (fun (x : α) => coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p x))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Finset.{u1} α), Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) (Finset.toSet.{u1} α s)) (Finset.sum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) s (fun (x : α) => FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p x))
-Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_finset Pmf.toOuterMeasure_apply_finsetₓ'. -/
@[simp]
theorem toOuterMeasure_apply_finset (s : Finset α) : p.toOuterMeasure s = ∑ x in s, p x :=
by
@@ -314,12 +230,6 @@ theorem toOuterMeasure_inj {p q : Pmf α} : p.toOuterMeasure = q.toOuterMeasure
#align pmf.to_outer_measure_inj Pmf.toOuterMeasure_inj
-/
-/- warning: pmf.to_outer_measure_apply_eq_zero_iff -> Pmf.toOuterMeasure_apply_eq_zero_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Iff (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) (Disjoint.{u1} (Set.{u1} α) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.completeBooleanAlgebra.{u1} α)))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} α) (Set.booleanAlgebra.{u1} α))) (Pmf.support.{u1} α p) s)
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Iff (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))) (Disjoint.{u1} (Set.{u1} α) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} α) (Preorder.toLE.{u1} (Set.{u1} α) (PartialOrder.toPreorder.{u1} (Set.{u1} α) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))) (Pmf.support.{u1} α p) s)
-Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iffₓ'. -/
theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p.support s :=
by
rw [to_outer_measure_apply, ENNReal.tsum_eq_zero]
@@ -346,48 +256,24 @@ theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support
#align pmf.to_outer_measure_apply_eq_one_iff Pmf.toOuterMeasure_apply_eq_one_iff
-/
-/- warning: pmf.to_outer_measure_apply_inter_support -> Pmf.toOuterMeasure_apply_inter_support is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s)
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s)
-Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_inter_support Pmf.toOuterMeasure_apply_inter_supportₓ'. -/
@[simp]
theorem toOuterMeasure_apply_inter_support :
p.toOuterMeasure (s ∩ p.support) = p.toOuterMeasure s := by
simp only [to_outer_measure_apply, Pmf.support, Set.indicator_inter_support]
#align pmf.to_outer_measure_apply_inter_support Pmf.toOuterMeasure_apply_inter_support
-/- warning: pmf.to_outer_measure_mono -> Pmf.toOuterMeasure_mono is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toHasLe.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) t))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.instHasSubsetSet.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (OmegaCompletePartialOrder.toPartialOrder.{0} ENNReal (CompleteLattice.instOmegaCompletePartialOrder.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal))))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) t))
-Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_mono Pmf.toOuterMeasure_monoₓ'. -/
/-- Slightly stronger than `outer_measure.mono` having an intersection with `p.support` -/
theorem toOuterMeasure_mono {s t : Set α} (h : s ∩ p.support ⊆ t) :
p.toOuterMeasure s ≤ p.toOuterMeasure t :=
le_trans (le_of_eq (toOuterMeasure_apply_inter_support p s).symm) (p.toOuterMeasure.mono h)
#align pmf.to_outer_measure_mono Pmf.toOuterMeasure_mono
-/- warning: pmf.to_outer_measure_apply_eq_of_inter_support_eq -> Pmf.toOuterMeasure_apply_eq_of_inter_support_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (Eq.{succ u1} (Set.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) t (Pmf.support.{u1} α p))) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) t))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (Eq.{succ u1} (Set.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) t (Pmf.support.{u1} α p))) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) t))
-Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_eq_of_inter_support_eq Pmf.toOuterMeasure_apply_eq_of_inter_support_eqₓ'. -/
theorem toOuterMeasure_apply_eq_of_inter_support_eq {s t : Set α}
(h : s ∩ p.support = t ∩ p.support) : p.toOuterMeasure s = p.toOuterMeasure t :=
le_antisymm (p.toOuterMeasure_mono (h.symm ▸ Set.inter_subset_left t p.support))
(p.toOuterMeasure_mono (h ▸ Set.inter_subset_left s p.support))
#align pmf.to_outer_measure_apply_eq_of_inter_support_eq Pmf.toOuterMeasure_apply_eq_of_inter_support_eq
-/- warning: pmf.to_outer_measure_apply_fintype -> Pmf.toOuterMeasure_apply_fintype is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_1 : Fintype.{u1} α], Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (Finset.sum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) (Finset.univ.{u1} α _inst_1) (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x))
-but is expected to have type
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_1 : Fintype.{u1} α], Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (Finset.sum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) (Finset.univ.{u1} α _inst_1) (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x))
-Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_fintype Pmf.toOuterMeasure_apply_fintypeₓ'. -/
@[simp]
theorem toOuterMeasure_apply_fintype [Fintype α] : p.toOuterMeasure s = ∑ x, s.indicator p x :=
(p.to_outer_measure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
@@ -409,12 +295,6 @@ def toMeasure [MeasurableSpace α] (p : Pmf α) : Measure α :=
variable [MeasurableSpace α] (p : Pmf α) (s t : Set α)
-/- warning: pmf.to_outer_measure_apply_le_to_measure_apply -> Pmf.toOuterMeasure_apply_le_toMeasure_apply is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), LE.le.{0} ENNReal (Preorder.toHasLe.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (OmegaCompletePartialOrder.toPartialOrder.{0} ENNReal (CompleteLattice.instOmegaCompletePartialOrder.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal))))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s)
-Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_le_to_measure_apply Pmf.toOuterMeasure_apply_le_toMeasure_applyₓ'. -/
theorem toOuterMeasure_apply_le_toMeasure_apply : p.toOuterMeasure s ≤ p.toMeasure s :=
le_toMeasure_apply p.toOuterMeasure _ s
#align pmf.to_outer_measure_apply_le_to_measure_apply Pmf.toOuterMeasure_apply_le_toMeasure_apply
@@ -426,12 +306,6 @@ theorem toMeasure_apply_eq_toOuterMeasure_apply (hs : MeasurableSet s) :
#align pmf.to_measure_apply_eq_to_outer_measure_apply Pmf.toMeasure_apply_eq_toOuterMeasure_apply
-/
-/- warning: pmf.to_measure_apply -> Pmf.toMeasure_apply is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x)))
-Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply Pmf.toMeasure_applyₓ'. -/
theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs).trans (p.to_outer_measure_apply s)
#align pmf.to_measure_apply Pmf.toMeasure_apply
@@ -443,12 +317,6 @@ theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
#align pmf.to_measure_apply_singleton Pmf.toMeasure_apply_singleton
-/
-/- warning: pmf.to_measure_apply_eq_zero_iff -> Pmf.toMeasure_apply_eq_zero_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Iff (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) (Disjoint.{u1} (Set.{u1} α) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.completeBooleanAlgebra.{u1} α)))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} α) (Set.booleanAlgebra.{u1} α))) (Pmf.support.{u1} α p) s))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Iff (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))) (Disjoint.{u1} (Set.{u1} α) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} α) (Preorder.toLE.{u1} (Set.{u1} α) (PartialOrder.toPreorder.{u1} (Set.{u1} α) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))) (Pmf.support.{u1} α p) s))
-Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_eq_zero_iff Pmf.toMeasure_apply_eq_zero_iffₓ'. -/
theorem toMeasure_apply_eq_zero_iff (hs : MeasurableSet s) :
p.toMeasure s = 0 ↔ Disjoint p.support s := by
rw [to_measure_apply_eq_to_outer_measure_apply p s hs, to_outer_measure_apply_eq_zero_iff]
@@ -461,12 +329,6 @@ theorem toMeasure_apply_eq_one_iff (hs : MeasurableSet s) : p.toMeasure s = 1
#align pmf.to_measure_apply_eq_one_iff Pmf.toMeasure_apply_eq_one_iff
-/
-/- warning: pmf.to_measure_apply_inter_support -> Pmf.toMeasure_apply_inter_support is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 (Pmf.support.{u1} α p)) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 (Pmf.support.{u1} α p)) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s))
-Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_inter_support Pmf.toMeasure_apply_inter_supportₓ'. -/
@[simp]
theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet p.support) :
p.toMeasure (s ∩ p.support) = p.toMeasure s := by
@@ -474,23 +336,11 @@ theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet
p.to_measure_apply_eq_to_outer_measure_apply _ (hs.inter hp)]
#align pmf.to_measure_apply_inter_support Pmf.toMeasure_apply_inter_support
-/- warning: pmf.to_measure_mono -> Pmf.toMeasure_mono is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toHasLe.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) t))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (HasSubset.Subset.{u1} (Set.{u1} α) (Set.instHasSubsetSet.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (OmegaCompletePartialOrder.toPartialOrder.{0} ENNReal (CompleteLattice.instOmegaCompletePartialOrder.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal))))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) t))
-Case conversion may be inaccurate. Consider using '#align pmf.to_measure_mono Pmf.toMeasure_monoₓ'. -/
theorem toMeasure_mono {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
(h : s ∩ p.support ⊆ t) : p.toMeasure s ≤ p.toMeasure t := by
simpa only [p.to_measure_apply_eq_to_outer_measure_apply, hs, ht] using to_outer_measure_mono p h
#align pmf.to_measure_mono Pmf.toMeasure_mono
-/- warning: pmf.to_measure_apply_eq_of_inter_support_eq -> Pmf.toMeasure_apply_eq_of_inter_support_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (Eq.{succ u1} (Set.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) t (Pmf.support.{u1} α p))) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) t))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (Eq.{succ u1} (Set.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) t (Pmf.support.{u1} α p))) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) t))
-Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_eq_of_inter_support_eq Pmf.toMeasure_apply_eq_of_inter_support_eqₓ'. -/
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 := by
simpa only [p.to_measure_apply_eq_to_outer_measure_apply, hs, ht] using
@@ -517,34 +367,16 @@ theorem toMeasure_inj {p q : Pmf α} : p.toMeasure = q.toMeasure ↔ p = q :=
#align pmf.to_measure_inj Pmf.toMeasure_inj
-/
-/- warning: pmf.to_measure_apply_finset -> Pmf.toMeasure_apply_finset is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1] (s : Finset.{u1} α), Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s)) (Finset.sum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) s (fun (x : α) => coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p x))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1] (s : Finset.{u1} α), Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) (Finset.toSet.{u1} α s)) (Finset.sum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) s (fun (x : α) => FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p x))
-Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_finset Pmf.toMeasure_apply_finsetₓ'. -/
@[simp]
theorem toMeasure_apply_finset (s : Finset α) : p.toMeasure s = ∑ x in s, p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.MeasurableSet).trans
(p.toOuterMeasure_apply_finset s)
#align pmf.to_measure_apply_finset Pmf.toMeasure_apply_finset
-/- warning: pmf.to_measure_apply_of_finite -> Pmf.toMeasure_apply_of_finite is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1], (Set.Finite.{u1} α s) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1], (Set.Finite.{u1} α s) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x)))
-Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_of_finite Pmf.toMeasure_apply_of_finiteₓ'. -/
theorem toMeasure_apply_of_finite (hs : s.Finite) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs.MeasurableSet).trans (p.to_outer_measure_apply s)
#align pmf.to_measure_apply_of_finite Pmf.toMeasure_apply_of_finite
-/- warning: pmf.to_measure_apply_fintype -> Pmf.toMeasure_apply_fintype is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1] [_inst_3 : Fintype.{u1} α], Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (Finset.sum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) (Finset.univ.{u1} α _inst_3) (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1] [_inst_3 : Fintype.{u1} α], Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (Finset.sum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) (Finset.univ.{u1} α _inst_3) (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x))
-Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_fintype Pmf.toMeasure_apply_fintypeₓ'. -/
@[simp]
theorem toMeasure_apply_fintype [Fintype α] : p.toMeasure s = ∑ x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.toFinite.MeasurableSet).trans
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -197,9 +197,7 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
_ < p a + ∑' b, ite (b = a) 0 (p b) :=
(ENNReal.add_lt_add_of_le_of_lt ENNReal.one_ne_top (le_of_eq h.symm) this)
_ = ite (a = a) (p a) 0 + ∑' b, ite (b = a) 0 (p b) := by rw [eq_self_iff_true, if_true]
- _ = (∑' b, ite (b = a) (p b) 0) + ∑' b, ite (b = a) 0 (p b) :=
- by
- congr
+ _ = (∑' b, ite (b = a) (p b) 0) + ∑' b, ite (b = a) 0 (p b) := by congr ;
exact symm (tsum_eq_single a fun b hb => if_neg hb)
_ = ∑' b, ite (b = a) (p b) 0 + ite (b = a) 0 (p b) := ennreal.tsum_add.symm
_ = ∑' b, p b := tsum_congr fun b => by split_ifs <;> simp only [zero_add, add_zero, le_rfl]
@@ -214,11 +212,8 @@ but is expected to have type
forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LE.le.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLE.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CanonicallyOrderedCommSemiring.toOne.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCanonicallyOrderedCommSemiringENNReal)))
Case conversion may be inaccurate. Consider using '#align pmf.coe_le_one Pmf.coe_le_oneₓ'. -/
theorem coe_le_one (p : Pmf α) (a : α) : p a ≤ 1 :=
- hasSum_le
- (by
- intro b
- split_ifs <;> simp only [h, zero_le', le_rfl])
- (hasSum_ite_eq a (p a)) (hasSum_coe_one p)
+ hasSum_le (by intro b; split_ifs <;> simp only [h, zero_le', le_rfl]) (hasSum_ite_eq a (p a))
+ (hasSum_coe_one p)
#align pmf.coe_le_one Pmf.coe_le_one
/- warning: pmf.apply_ne_top -> Pmf.apply_ne_top is a dubious translation:
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -168,7 +168,7 @@ theorem apply_eq_zero_iff (p : Pmf α) (a : α) : p a = 0 ↔ a ∉ p.support :=
/- warning: pmf.apply_pos_iff -> Pmf.apply_pos_iff is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (LT.lt.{0} ENNReal (Preorder.toLT.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a)) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a (Pmf.support.{u1} α p))
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (LT.lt.{0} ENNReal (Preorder.toHasLt.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a)) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a (Pmf.support.{u1} α p))
but is expected to have type
forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (LT.lt.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLT.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 0 (Zero.toOfNat0.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) instENNRealZero)) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a (Pmf.support.{u1} α p))
Case conversion may be inaccurate. Consider using '#align pmf.apply_pos_iff Pmf.apply_pos_iffₓ'. -/
@@ -209,7 +209,7 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
/- warning: pmf.coe_le_one -> Pmf.coe_le_one is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne)))))
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LE.le.{0} ENNReal (Preorder.toHasLe.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne)))))
but is expected to have type
forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LE.le.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLE.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CanonicallyOrderedCommSemiring.toOne.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCanonicallyOrderedCommSemiringENNReal)))
Case conversion may be inaccurate. Consider using '#align pmf.coe_le_one Pmf.coe_le_oneₓ'. -/
@@ -233,7 +233,7 @@ theorem apply_ne_top (p : Pmf α) (a : α) : p a ≠ ∞ :=
/- warning: pmf.apply_lt_top -> Pmf.apply_lt_top is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LT.lt.{0} ENNReal (Preorder.toLT.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LT.lt.{0} ENNReal (Preorder.toHasLt.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
but is expected to have type
forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LT.lt.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLT.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (Top.top.{0} ENNReal (CompleteLattice.toTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal)))
Case conversion may be inaccurate. Consider using '#align pmf.apply_lt_top Pmf.apply_lt_topₓ'. -/
@@ -365,7 +365,7 @@ theorem toOuterMeasure_apply_inter_support :
/- warning: pmf.to_outer_measure_mono -> Pmf.toOuterMeasure_mono is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) t))
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toHasLe.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) t))
but is expected to have type
forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.instHasSubsetSet.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (OmegaCompletePartialOrder.toPartialOrder.{0} ENNReal (CompleteLattice.instOmegaCompletePartialOrder.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal))))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) t))
Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_mono Pmf.toOuterMeasure_monoₓ'. -/
@@ -416,7 +416,7 @@ variable [MeasurableSpace α] (p : Pmf α) (s t : Set α)
/- warning: pmf.to_outer_measure_apply_le_to_measure_apply -> Pmf.toOuterMeasure_apply_le_toMeasure_apply is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s)
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), LE.le.{0} ENNReal (Preorder.toHasLe.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s)
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (OmegaCompletePartialOrder.toPartialOrder.{0} ENNReal (CompleteLattice.instOmegaCompletePartialOrder.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal))))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s)
Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_le_to_measure_apply Pmf.toOuterMeasure_apply_le_toMeasure_applyₓ'. -/
@@ -481,7 +481,7 @@ theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet
/- warning: pmf.to_measure_mono -> Pmf.toMeasure_mono is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) t))
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toHasLe.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) t))
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (HasSubset.Subset.{u1} (Set.{u1} α) (Set.instHasSubsetSet.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (OmegaCompletePartialOrder.toPartialOrder.{0} ENNReal (CompleteLattice.instOmegaCompletePartialOrder.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal))))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) t))
Case conversion may be inaccurate. Consider using '#align pmf.to_measure_mono Pmf.toMeasure_monoₓ'. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/e3fb84046afd187b710170887195d50bada934ee
@@ -274,7 +274,7 @@ Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_c
@[simp]
theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
by
- refine' eq_top_iff.2 <| le_trans (le_infₛ fun x hx => _) (le_sum_caratheodory _)
+ refine' eq_top_iff.2 <| le_trans (le_sInf fun x hx => _) (le_sum_caratheodory _)
exact
let ⟨y, hy⟩ := hx
((le_of_eq (dirac_caratheodory y).symm).trans (le_smul_caratheodory _ _)).trans (le_of_eq hy)
mathlib commit https://github.com/leanprover-community/mathlib/commit/28b2a92f2996d28e580450863c130955de0ed398
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Devon Tuma
! This file was ported from Lean 3 source module probability.probability_mass_function.basic
-! leanprover-community/mathlib commit 4ac69b290818724c159de091daa3acd31da0ee6d
+! leanprover-community/mathlib commit a2706b55e8d7f7e9b1f93143f0b88f2e34a11eea
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -14,6 +14,9 @@ import Mathbin.MeasureTheory.Measure.MeasureSpace
/-!
# Probability mass functions
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
This file is about probability mass functions or discrete probability measures:
a function `α → ℝ≥0∞` such that the values have (infinite) sum `1`.
mathlib commit https://github.com/leanprover-community/mathlib/commit/d4437c68c8d350fc9d4e95e1e174409db35e30d7
@@ -41,42 +41,74 @@ variable {α β γ : Type _}
open Classical BigOperators NNReal ENNReal MeasureTheory
+#print Pmf /-
/-- 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 :=
{ f : α → ℝ≥0∞ // HasSum f 1 }
#align pmf Pmf
+-/
namespace Pmf
+#print Pmf.funLike /-
instance funLike : FunLike (Pmf α) α fun p => ℝ≥0∞
where
coe p a := p.1 a
coe_injective' p q h := Subtype.eq h
#align pmf.fun_like Pmf.funLike
+-/
+#print Pmf.ext /-
@[ext]
protected theorem ext {p q : Pmf α} (h : ∀ x, p x = q x) : p = q :=
FunLike.ext p q h
#align pmf.ext Pmf.ext
+-/
+#print Pmf.ext_iff /-
theorem ext_iff {p q : Pmf α} : p = q ↔ ∀ x, p x = q x :=
FunLike.ext_iff
#align pmf.ext_iff Pmf.ext_iff
+-/
+/- warning: pmf.has_sum_coe_one -> Pmf.hasSum_coe_one is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), HasSum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne)))))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), HasSum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) (OfNat.ofNat.{0} ENNReal 1 (One.toOfNat1.{0} ENNReal (CanonicallyOrderedCommSemiring.toOne.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))
+Case conversion may be inaccurate. Consider using '#align pmf.has_sum_coe_one Pmf.hasSum_coe_oneₓ'. -/
theorem hasSum_coe_one (p : Pmf α) : HasSum p 1 :=
p.2
#align pmf.has_sum_coe_one Pmf.hasSum_coe_one
+/- warning: pmf.tsum_coe -> Pmf.tsum_coe is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), Eq.{1} ENNReal (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (a : α) => coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a)) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne)))))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), Eq.{1} ENNReal (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (a : α) => FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a)) (OfNat.ofNat.{0} ENNReal 1 (One.toOfNat1.{0} ENNReal (CanonicallyOrderedCommSemiring.toOne.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))
+Case conversion may be inaccurate. Consider using '#align pmf.tsum_coe Pmf.tsum_coeₓ'. -/
@[simp]
theorem tsum_coe (p : Pmf α) : (∑' a, p a) = 1 :=
p.hasSum_coe_one.tsum_eq
#align pmf.tsum_coe Pmf.tsum_coe
+/- warning: pmf.tsum_coe_ne_top -> Pmf.tsum_coe_ne_top is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), Ne.{1} ENNReal (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (a : α) => coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a)) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), Ne.{1} ENNReal (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (a : α) => FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a)) (Top.top.{0} ENNReal (CompleteLattice.toTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal)))
+Case conversion may be inaccurate. Consider using '#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_topₓ'. -/
theorem tsum_coe_ne_top (p : Pmf α) : (∑' a, p a) ≠ ∞ :=
p.tsum_coe.symm ▸ ENNReal.one_ne_top
#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_top
+/- warning: pmf.tsum_coe_indicator_ne_top -> Pmf.tsum_coe_indicator_ne_top is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Ne.{1} ENNReal (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (a : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) a)) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Ne.{1} ENNReal (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (a : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) a)) (Top.top.{0} ENNReal (CompleteLattice.toTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal)))
+Case conversion may be inaccurate. Consider using '#align pmf.tsum_coe_indicator_ne_top Pmf.tsum_coe_indicator_ne_topₓ'. -/
theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : (∑' a, s.indicator p a) ≠ ∞ :=
ne_of_lt
(lt_of_le_of_lt
@@ -85,34 +117,63 @@ theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : (∑' a, s.indicat
(lt_of_le_of_ne le_top p.tsum_coe_ne_top))
#align pmf.tsum_coe_indicator_ne_top Pmf.tsum_coe_indicator_ne_top
+/- warning: pmf.coe_ne_zero -> Pmf.coe_ne_zero is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), Ne.{succ u1} (α -> ENNReal) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) (OfNat.ofNat.{u1} (α -> ENNReal) 0 (OfNat.mk.{u1} (α -> ENNReal) 0 (Zero.zero.{u1} (α -> ENNReal) (Pi.instZero.{u1, 0} α (fun (a : α) => ENNReal) (fun (i : α) => ENNReal.hasZero)))))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), Ne.{succ u1} (forall (a : α), (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) (OfNat.ofNat.{u1} (forall (a : α), (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 0 (Zero.toOfNat0.{u1} (forall (a : α), (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Pi.instZero.{u1, 0} α (fun (a : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (fun (i : α) => instENNRealZero))))
+Case conversion may be inaccurate. Consider using '#align pmf.coe_ne_zero Pmf.coe_ne_zeroₓ'. -/
@[simp]
theorem coe_ne_zero (p : Pmf α) : ⇑p ≠ 0 := fun hp =>
zero_ne_one ((tsum_zero.symm.trans (tsum_congr fun x => symm (congr_fun hp x))).trans p.tsum_coe)
#align pmf.coe_ne_zero Pmf.coe_ne_zero
+#print Pmf.support /-
/-- The support of a `pmf` is the set where it is nonzero. -/
def support (p : Pmf α) : Set α :=
Function.support p
#align pmf.support Pmf.support
+-/
+/- warning: pmf.mem_support_iff -> Pmf.mem_support_iff is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a (Pmf.support.{u1} α p)) (Ne.{1} ENNReal (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero))))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a (Pmf.support.{u1} α p)) (Ne.{1} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 0 (Zero.toOfNat0.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) instENNRealZero)))
+Case conversion may be inaccurate. Consider using '#align pmf.mem_support_iff Pmf.mem_support_iffₓ'. -/
@[simp]
theorem mem_support_iff (p : Pmf α) (a : α) : a ∈ p.support ↔ p a ≠ 0 :=
Iff.rfl
#align pmf.mem_support_iff Pmf.mem_support_iff
+#print Pmf.support_nonempty /-
@[simp]
theorem support_nonempty (p : Pmf α) : p.support.Nonempty :=
Function.support_nonempty_iff.2 p.coe_ne_zero
#align pmf.support_nonempty Pmf.support_nonempty
+-/
+/- warning: pmf.apply_eq_zero_iff -> Pmf.apply_eq_zero_iff is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) (Not (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a (Pmf.support.{u1} α p)))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (Eq.{1} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 0 (Zero.toOfNat0.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) instENNRealZero))) (Not (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a (Pmf.support.{u1} α p)))
+Case conversion may be inaccurate. Consider using '#align pmf.apply_eq_zero_iff Pmf.apply_eq_zero_iffₓ'. -/
theorem apply_eq_zero_iff (p : Pmf α) (a : α) : p a = 0 ↔ a ∉ p.support := by
rw [mem_support_iff, Classical.not_not]
#align pmf.apply_eq_zero_iff Pmf.apply_eq_zero_iff
+/- warning: pmf.apply_pos_iff -> Pmf.apply_pos_iff is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (LT.lt.{0} ENNReal (Preorder.toLT.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a)) (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a (Pmf.support.{u1} α p))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Iff (LT.lt.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLT.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 0 (Zero.toOfNat0.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) instENNRealZero)) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a)) (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a (Pmf.support.{u1} α p))
+Case conversion may be inaccurate. Consider using '#align pmf.apply_pos_iff Pmf.apply_pos_iffₓ'. -/
theorem apply_pos_iff (p : Pmf α) (a : α) : 0 < p a ↔ a ∈ p.support :=
pos_iff_ne_zero.trans (p.mem_support_iff a).symm
#align pmf.apply_pos_iff Pmf.apply_pos_iff
+#print Pmf.apply_eq_one_iff /-
theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
by
refine'
@@ -141,7 +202,14 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
_ = ∑' b, p b := tsum_congr fun b => by split_ifs <;> simp only [zero_add, add_zero, le_rfl]
#align pmf.apply_eq_one_iff Pmf.apply_eq_one_iff
+-/
+/- warning: pmf.coe_le_one -> Pmf.coe_le_one is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne)))))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LE.le.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLE.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CanonicallyOrderedCommSemiring.toOne.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCanonicallyOrderedCommSemiringENNReal)))
+Case conversion may be inaccurate. Consider using '#align pmf.coe_le_one Pmf.coe_le_oneₓ'. -/
theorem coe_le_one (p : Pmf α) (a : α) : p a ≤ 1 :=
hasSum_le
(by
@@ -150,10 +218,22 @@ theorem coe_le_one (p : Pmf α) (a : α) : p a ≤ 1 :=
(hasSum_ite_eq a (p a)) (hasSum_coe_one p)
#align pmf.coe_le_one Pmf.coe_le_one
+/- warning: pmf.apply_ne_top -> Pmf.apply_ne_top is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Ne.{1} ENNReal (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), Ne.{1} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (Top.top.{0} ENNReal (CompleteLattice.toTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal)))
+Case conversion may be inaccurate. Consider using '#align pmf.apply_ne_top Pmf.apply_ne_topₓ'. -/
theorem apply_ne_top (p : Pmf α) (a : α) : p a ≠ ∞ :=
ne_of_lt (lt_of_le_of_lt (p.coe_le_one a) ENNReal.one_lt_top)
#align pmf.apply_ne_top Pmf.apply_ne_top
+/- warning: pmf.apply_lt_top -> Pmf.apply_lt_top is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LT.lt.{0} ENNReal (Preorder.toLT.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p a) (Top.top.{0} ENNReal (CompleteLattice.toHasTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder)))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (a : α), LT.lt.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (Preorder.toLT.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (PartialOrder.toPreorder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (OmegaCompletePartialOrder.toPartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLattice.instOmegaCompletePartialOrder.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) (CompleteLinearOrder.toCompleteLattice.{0} ((fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) a) ENNReal.instCompleteLinearOrderENNReal))))) (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p a) (Top.top.{0} ENNReal (CompleteLattice.toTop.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal)))
+Case conversion may be inaccurate. Consider using '#align pmf.apply_lt_top Pmf.apply_lt_topₓ'. -/
theorem apply_lt_top (p : Pmf α) (a : α) : p a < ∞ :=
lt_of_le_of_ne le_top (p.apply_ne_top a)
#align pmf.apply_lt_top Pmf.apply_lt_top
@@ -162,18 +242,32 @@ section OuterMeasure
open MeasureTheory MeasureTheory.OuterMeasure
+#print Pmf.toOuterMeasure /-
/-- 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 ∈ α` -/
def toOuterMeasure (p : Pmf α) : OuterMeasure α :=
OuterMeasure.sum fun x : α => p x • dirac x
#align pmf.to_outer_measure Pmf.toOuterMeasure
+-/
variable (p : Pmf α) (s t : Set α)
+/- warning: pmf.to_outer_measure_apply -> Pmf.toOuterMeasure_apply is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x))
+Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply Pmf.toOuterMeasure_applyₓ'. -/
theorem toOuterMeasure_apply : p.toOuterMeasure s = ∑' x, s.indicator p x :=
tsum_congr fun x => smul_dirac_apply (p x) x s
#align pmf.to_outer_measure_apply Pmf.toOuterMeasure_apply
+/- warning: pmf.to_outer_measure_caratheodory -> Pmf.toOuterMeasure_caratheodory is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), Eq.{succ u1} (MeasurableSpace.{u1} α) (MeasureTheory.OuterMeasure.caratheodory.{u1} α (Pmf.toOuterMeasure.{u1} α p)) (Top.top.{u1} (MeasurableSpace.{u1} α) (CompleteLattice.toHasTop.{u1} (MeasurableSpace.{u1} α) (MeasurableSpace.completeLattice.{u1} α)))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α), Eq.{succ u1} (MeasurableSpace.{u1} α) (MeasureTheory.OuterMeasure.caratheodory.{u1} α (Pmf.toOuterMeasure.{u1} α p)) (Top.top.{u1} (MeasurableSpace.{u1} α) (CompleteLattice.toTop.{u1} (MeasurableSpace.{u1} α) (MeasurableSpace.instCompleteLatticeMeasurableSpace.{u1} α)))
+Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_caratheodory Pmf.toOuterMeasure_caratheodoryₓ'. -/
@[simp]
theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
by
@@ -183,6 +277,12 @@ theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
((le_of_eq (dirac_caratheodory y).symm).trans (le_smul_caratheodory _ _)).trans (le_of_eq hy)
#align pmf.to_outer_measure_caratheodory Pmf.toOuterMeasure_caratheodory
+/- warning: pmf.to_outer_measure_apply_finset -> Pmf.toOuterMeasure_apply_finset is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Finset.{u1} α), Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s)) (Finset.sum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) s (fun (x : α) => coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p x))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Finset.{u1} α), Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) (Finset.toSet.{u1} α s)) (Finset.sum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) s (fun (x : α) => FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p x))
+Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_finset Pmf.toOuterMeasure_apply_finsetₓ'. -/
@[simp]
theorem toOuterMeasure_apply_finset (s : Finset α) : p.toOuterMeasure s = ∑ x in s, p x :=
by
@@ -191,25 +291,37 @@ theorem toOuterMeasure_apply_finset (s : Finset α) : p.toOuterMeasure s = ∑ x
· exact Finset.sum_congr rfl fun x hx => Set.indicator_of_mem hx _
#align pmf.to_outer_measure_apply_finset Pmf.toOuterMeasure_apply_finset
+#print Pmf.toOuterMeasure_apply_singleton /-
theorem toOuterMeasure_apply_singleton (a : α) : p.toOuterMeasure {a} = p a :=
by
refine' (p.to_outer_measure_apply {a}).trans ((tsum_eq_single a fun b hb => _).trans _)
· exact ite_eq_right_iff.2 fun hb' => False.elim <| hb hb'
· exact ite_eq_left_iff.2 fun ha' => False.elim <| ha' rfl
#align pmf.to_outer_measure_apply_singleton Pmf.toOuterMeasure_apply_singleton
+-/
+#print Pmf.toOuterMeasure_injective /-
theorem toOuterMeasure_injective : (toOuterMeasure : Pmf α → OuterMeasure α).Injective :=
fun p q h =>
Pmf.ext fun x =>
(p.toOuterMeasure_apply_singleton x).symm.trans
((congr_fun (congr_arg _ h) _).trans <| q.toOuterMeasure_apply_singleton x)
#align pmf.to_outer_measure_injective Pmf.toOuterMeasure_injective
+-/
+#print Pmf.toOuterMeasure_inj /-
@[simp]
theorem toOuterMeasure_inj {p q : Pmf α} : p.toOuterMeasure = q.toOuterMeasure ↔ p = q :=
toOuterMeasure_injective.eq_iff
#align pmf.to_outer_measure_inj Pmf.toOuterMeasure_inj
+-/
+/- warning: pmf.to_outer_measure_apply_eq_zero_iff -> Pmf.toOuterMeasure_apply_eq_zero_iff is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Iff (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) (Disjoint.{u1} (Set.{u1} α) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.completeBooleanAlgebra.{u1} α)))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} α) (Set.booleanAlgebra.{u1} α))) (Pmf.support.{u1} α p) s)
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Iff (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))) (Disjoint.{u1} (Set.{u1} α) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} α) (Preorder.toLE.{u1} (Set.{u1} α) (PartialOrder.toPreorder.{u1} (Set.{u1} α) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))) (Pmf.support.{u1} α p) s)
+Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iffₓ'. -/
theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p.support s :=
by
rw [to_outer_measure_apply, ENNReal.tsum_eq_zero]
@@ -217,6 +329,7 @@ theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p
#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iff
/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∉ » s) -/
+#print Pmf.toOuterMeasure_apply_eq_one_iff /-
theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s :=
by
refine' (p.to_outer_measure_apply s).symm ▸ ⟨fun h a hap => _, fun h => _⟩
@@ -233,25 +346,50 @@ theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support
p.tsum_coe
exact fun a ha => (p.apply_eq_zero_iff a).2 <| Set.not_mem_subset h ha
#align pmf.to_outer_measure_apply_eq_one_iff Pmf.toOuterMeasure_apply_eq_one_iff
+-/
+/- warning: pmf.to_outer_measure_apply_inter_support -> Pmf.toOuterMeasure_apply_inter_support is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s)
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α), Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s)
+Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_inter_support Pmf.toOuterMeasure_apply_inter_supportₓ'. -/
@[simp]
theorem toOuterMeasure_apply_inter_support :
p.toOuterMeasure (s ∩ p.support) = p.toOuterMeasure s := by
simp only [to_outer_measure_apply, Pmf.support, Set.indicator_inter_support]
#align pmf.to_outer_measure_apply_inter_support Pmf.toOuterMeasure_apply_inter_support
+/- warning: pmf.to_outer_measure_mono -> Pmf.toOuterMeasure_mono is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) t))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.instHasSubsetSet.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (OmegaCompletePartialOrder.toPartialOrder.{0} ENNReal (CompleteLattice.instOmegaCompletePartialOrder.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal))))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) t))
+Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_mono Pmf.toOuterMeasure_monoₓ'. -/
/-- Slightly stronger than `outer_measure.mono` having an intersection with `p.support` -/
theorem toOuterMeasure_mono {s t : Set α} (h : s ∩ p.support ⊆ t) :
p.toOuterMeasure s ≤ p.toOuterMeasure t :=
le_trans (le_of_eq (toOuterMeasure_apply_inter_support p s).symm) (p.toOuterMeasure.mono h)
#align pmf.to_outer_measure_mono Pmf.toOuterMeasure_mono
+/- warning: pmf.to_outer_measure_apply_eq_of_inter_support_eq -> Pmf.toOuterMeasure_apply_eq_of_inter_support_eq is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (Eq.{succ u1} (Set.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) t (Pmf.support.{u1} α p))) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) t))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (Eq.{succ u1} (Set.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) t (Pmf.support.{u1} α p))) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) t))
+Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_eq_of_inter_support_eq Pmf.toOuterMeasure_apply_eq_of_inter_support_eqₓ'. -/
theorem toOuterMeasure_apply_eq_of_inter_support_eq {s t : Set α}
(h : s ∩ p.support = t ∩ p.support) : p.toOuterMeasure s = p.toOuterMeasure t :=
le_antisymm (p.toOuterMeasure_mono (h.symm ▸ Set.inter_subset_left t p.support))
(p.toOuterMeasure_mono (h ▸ Set.inter_subset_left s p.support))
#align pmf.to_outer_measure_apply_eq_of_inter_support_eq Pmf.toOuterMeasure_apply_eq_of_inter_support_eq
+/- warning: pmf.to_outer_measure_apply_fintype -> Pmf.toOuterMeasure_apply_fintype is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_1 : Fintype.{u1} α], Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (Finset.sum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) (Finset.univ.{u1} α _inst_1) (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x))
+but is expected to have type
+ forall {α : Type.{u1}} (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_1 : Fintype.{u1} α], Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (Finset.sum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) (Finset.univ.{u1} α _inst_1) (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x))
+Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_fintype Pmf.toOuterMeasure_apply_fintypeₓ'. -/
@[simp]
theorem toOuterMeasure_apply_fintype [Fintype α] : p.toOuterMeasure s = ∑ x, s.indicator p x :=
(p.to_outer_measure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
@@ -263,42 +401,74 @@ section Measure
open MeasureTheory
+#print Pmf.toMeasure /-
/-- Since every set is Carathéodory-measurable under `pmf.to_outer_measure`,
we can further extend this `outer_measure` to a `measure` on `α` -/
def toMeasure [MeasurableSpace α] (p : Pmf α) : Measure α :=
p.toOuterMeasure.toMeasure ((toOuterMeasure_caratheodory p).symm ▸ le_top)
#align pmf.to_measure Pmf.toMeasure
+-/
variable [MeasurableSpace α] (p : Pmf α) (s t : Set α)
+/- warning: pmf.to_outer_measure_apply_le_to_measure_apply -> Pmf.toOuterMeasure_apply_le_toMeasure_apply is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.OuterMeasure.{u1} α) (fun (_x : MeasureTheory.OuterMeasure.{u1} α) => (Set.{u1} α) -> ENNReal) (MeasureTheory.OuterMeasure.instCoeFun.{u1} α) (Pmf.toOuterMeasure.{u1} α p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (OmegaCompletePartialOrder.toPartialOrder.{0} ENNReal (CompleteLattice.instOmegaCompletePartialOrder.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal))))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (Pmf.toOuterMeasure.{u1} α p) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s)
+Case conversion may be inaccurate. Consider using '#align pmf.to_outer_measure_apply_le_to_measure_apply Pmf.toOuterMeasure_apply_le_toMeasure_applyₓ'. -/
theorem toOuterMeasure_apply_le_toMeasure_apply : p.toOuterMeasure s ≤ p.toMeasure s :=
le_toMeasure_apply p.toOuterMeasure _ s
#align pmf.to_outer_measure_apply_le_to_measure_apply Pmf.toOuterMeasure_apply_le_toMeasure_apply
+#print Pmf.toMeasure_apply_eq_toOuterMeasure_apply /-
theorem toMeasure_apply_eq_toOuterMeasure_apply (hs : MeasurableSet s) :
p.toMeasure s = p.toOuterMeasure s :=
toMeasure_apply p.toOuterMeasure _ hs
#align pmf.to_measure_apply_eq_to_outer_measure_apply Pmf.toMeasure_apply_eq_toOuterMeasure_apply
+-/
+/- warning: pmf.to_measure_apply -> Pmf.toMeasure_apply is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x)))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x)))
+Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply Pmf.toMeasure_applyₓ'. -/
theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs).trans (p.to_outer_measure_apply s)
#align pmf.to_measure_apply Pmf.toMeasure_apply
+#print Pmf.toMeasure_apply_singleton /-
theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
p.toMeasure {a} = p a := by
simp [to_measure_apply_eq_to_outer_measure_apply _ _ h, to_outer_measure_apply_singleton]
#align pmf.to_measure_apply_singleton Pmf.toMeasure_apply_singleton
+-/
+/- warning: pmf.to_measure_apply_eq_zero_iff -> Pmf.toMeasure_apply_eq_zero_iff is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Iff (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) (Disjoint.{u1} (Set.{u1} α) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.completeBooleanAlgebra.{u1} α)))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} α) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} α) (Set.booleanAlgebra.{u1} α))) (Pmf.support.{u1} α p) s))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Iff (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))) (Disjoint.{u1} (Set.{u1} α) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} α) (Preorder.toLE.{u1} (Set.{u1} α) (PartialOrder.toPreorder.{u1} (Set.{u1} α) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} α) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} α) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} α) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} α) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} α) (Set.instCompleteBooleanAlgebraSet.{u1} α)))))) (Pmf.support.{u1} α p) s))
+Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_eq_zero_iff Pmf.toMeasure_apply_eq_zero_iffₓ'. -/
theorem toMeasure_apply_eq_zero_iff (hs : MeasurableSet s) :
p.toMeasure s = 0 ↔ Disjoint p.support s := by
rw [to_measure_apply_eq_to_outer_measure_apply p s hs, to_outer_measure_apply_eq_zero_iff]
#align pmf.to_measure_apply_eq_zero_iff Pmf.toMeasure_apply_eq_zero_iff
+#print Pmf.toMeasure_apply_eq_one_iff /-
theorem toMeasure_apply_eq_one_iff (hs : MeasurableSet s) : p.toMeasure s = 1 ↔ p.support ⊆ s :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs : p.toMeasure s = p.toOuterMeasure s).symm ▸
p.toOuterMeasure_apply_eq_one_iff s
#align pmf.to_measure_apply_eq_one_iff Pmf.toMeasure_apply_eq_one_iff
+-/
+/- warning: pmf.to_measure_apply_inter_support -> Pmf.toMeasure_apply_inter_support is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 (Pmf.support.{u1} α p)) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 (Pmf.support.{u1} α p)) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s))
+Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_inter_support Pmf.toMeasure_apply_inter_supportₓ'. -/
@[simp]
theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet p.support) :
p.toMeasure (s ∩ p.support) = p.toMeasure s := by
@@ -306,11 +476,23 @@ theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet
p.to_measure_apply_eq_to_outer_measure_apply _ (hs.inter hp)]
#align pmf.to_measure_apply_inter_support Pmf.toMeasure_apply_inter_support
+/- warning: pmf.to_measure_mono -> Pmf.toMeasure_mono is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (CompleteSemilatticeInf.toPartialOrder.{0} ENNReal (CompleteLattice.toCompleteSemilatticeInf.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.completeLinearOrder))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) t))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (HasSubset.Subset.{u1} (Set.{u1} α) (Set.instHasSubsetSet.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) t) -> (LE.le.{0} ENNReal (Preorder.toLE.{0} ENNReal (PartialOrder.toPreorder.{0} ENNReal (OmegaCompletePartialOrder.toPartialOrder.{0} ENNReal (CompleteLattice.instOmegaCompletePartialOrder.{0} ENNReal (CompleteLinearOrder.toCompleteLattice.{0} ENNReal ENNReal.instCompleteLinearOrderENNReal))))) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) t))
+Case conversion may be inaccurate. Consider using '#align pmf.to_measure_mono Pmf.toMeasure_monoₓ'. -/
theorem toMeasure_mono {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
(h : s ∩ p.support ⊆ t) : p.toMeasure s ≤ p.toMeasure t := by
simpa only [p.to_measure_apply_eq_to_outer_measure_apply, hs, ht] using to_outer_measure_mono p h
#align pmf.to_measure_mono Pmf.toMeasure_mono
+/- warning: pmf.to_measure_apply_eq_of_inter_support_eq -> Pmf.toMeasure_apply_eq_of_inter_support_eq is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (Eq.{succ u1} (Set.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s (Pmf.support.{u1} α p)) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) t (Pmf.support.{u1} α p))) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) t))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) {s : Set.{u1} α} {t : Set.{u1} α}, (MeasurableSet.{u1} α _inst_1 s) -> (MeasurableSet.{u1} α _inst_1 t) -> (Eq.{succ u1} (Set.{u1} α) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) s (Pmf.support.{u1} α p)) (Inter.inter.{u1} (Set.{u1} α) (Set.instInterSet.{u1} α) t (Pmf.support.{u1} α p))) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) t))
+Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_eq_of_inter_support_eq Pmf.toMeasure_apply_eq_of_inter_support_eqₓ'. -/
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 := by
simpa only [p.to_measure_apply_eq_to_outer_measure_apply, hs, ht] using
@@ -321,28 +503,50 @@ section MeasurableSingletonClass
variable [MeasurableSingletonClass α]
+#print Pmf.toMeasure_injective /-
theorem toMeasure_injective : (toMeasure : Pmf α → Measure α).Injective := fun p q h =>
Pmf.ext fun x =>
(p.toMeasure_apply_singleton x <| measurableSet_singleton x).symm.trans
((congr_fun (congr_arg _ h) _).trans <|
q.toMeasure_apply_singleton x <| measurableSet_singleton x)
#align pmf.to_measure_injective Pmf.toMeasure_injective
+-/
+#print Pmf.toMeasure_inj /-
@[simp]
theorem toMeasure_inj {p q : Pmf α} : p.toMeasure = q.toMeasure ↔ p = q :=
toMeasure_injective.eq_iff
#align pmf.to_measure_inj Pmf.toMeasure_inj
+-/
+/- warning: pmf.to_measure_apply_finset -> Pmf.toMeasure_apply_finset is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1] (s : Finset.{u1} α), Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s)) (Finset.sum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) s (fun (x : α) => coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p x))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1] (s : Finset.{u1} α), Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) (Finset.toSet.{u1} α s)) (Finset.sum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) s (fun (x : α) => FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p x))
+Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_finset Pmf.toMeasure_apply_finsetₓ'. -/
@[simp]
theorem toMeasure_apply_finset (s : Finset α) : p.toMeasure s = ∑ x in s, p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.MeasurableSet).trans
(p.toOuterMeasure_apply_finset s)
#align pmf.to_measure_apply_finset Pmf.toMeasure_apply_finset
+/- warning: pmf.to_measure_apply_of_finite -> Pmf.toMeasure_apply_of_finite is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1], (Set.Finite.{u1} α s) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (tsum.{0, u1} ENNReal (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) ENNReal.topologicalSpace α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x)))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1], (Set.Finite.{u1} α s) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (tsum.{0, u1} ENNReal (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) ENNReal.instTopologicalSpaceENNReal α (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x)))
+Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_of_finite Pmf.toMeasure_apply_of_finiteₓ'. -/
theorem toMeasure_apply_of_finite (hs : s.Finite) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs.MeasurableSet).trans (p.to_outer_measure_apply s)
#align pmf.to_measure_apply_of_finite Pmf.toMeasure_apply_of_finite
+/- warning: pmf.to_measure_apply_fintype -> Pmf.toMeasure_apply_fintype is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1] [_inst_3 : Fintype.{u1} α], Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (Pmf.toMeasure.{u1} α _inst_1 p) s) (Finset.sum.{0, u1} ENNReal α (OrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (OrderedSemiring.toOrderedAddCommMonoid.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))) (Finset.univ.{u1} α _inst_3) (fun (x : α) => Set.indicator.{u1, 0} α ENNReal ENNReal.hasZero s (coeFn.{succ u1, succ u1} (Pmf.{u1} α) (fun (_x : Pmf.{u1} α) => α -> ENNReal) (FunLike.hasCoeToFun.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (p : α) => ENNReal) (Pmf.funLike.{u1} α)) p) x))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} α] (p : Pmf.{u1} α) (s : Set.{u1} α) [_inst_2 : MeasurableSingletonClass.{u1} α _inst_1] [_inst_3 : Fintype.{u1} α], Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} α (MeasureTheory.Measure.toOuterMeasure.{u1} α _inst_1 (Pmf.toMeasure.{u1} α _inst_1 p)) s) (Finset.sum.{0, u1} ENNReal α (LinearOrderedAddCommMonoid.toAddCommMonoid.{0} ENNReal (LinearOrderedAddCommMonoidWithTop.toLinearOrderedAddCommMonoid.{0} ENNReal ENNReal.instLinearOrderedAddCommMonoidWithTopENNReal)) (Finset.univ.{u1} α _inst_3) (fun (x : α) => Set.indicator.{u1, 0} α ENNReal instENNRealZero s (FunLike.coe.{succ u1, succ u1, 1} (Pmf.{u1} α) α (fun (_x : α) => (fun (x._@.Mathlib.Probability.ProbabilityMassFunction.Basic._hyg.47 : α) => ENNReal) _x) (Pmf.funLike.{u1} α) p) x))
+Case conversion may be inaccurate. Consider using '#align pmf.to_measure_apply_fintype Pmf.toMeasure_apply_fintypeₓ'. -/
@[simp]
theorem toMeasure_apply_fintype [Fintype α] : p.toMeasure s = ∑ x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.toFinite.MeasurableSet).trans
@@ -361,6 +565,7 @@ open Pmf
namespace Measure
+#print MeasureTheory.Measure.toPmf /-
/-- 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. -/
@@ -374,19 +579,24 @@ def toPmf [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ
(tsum_congr fun x => congr_fun (Set.indicator_univ _) x))
h.measure_univ)⟩
#align measure_theory.measure.to_pmf MeasureTheory.Measure.toPmf
+-/
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
[ProbabilityMeasure μ]
+#print MeasureTheory.Measure.toPmf_apply /-
theorem toPmf_apply (x : α) : μ.toPmf x = μ {x} :=
rfl
#align measure_theory.measure.to_pmf_apply MeasureTheory.Measure.toPmf_apply
+-/
+#print MeasureTheory.Measure.toPmf_toMeasure /-
@[simp]
theorem toPmf_toMeasure : μ.toPmf.toMeasure = μ :=
Measure.ext fun s hs => by
simpa only [μ.to_pmf.to_measure_apply s hs, ← μ.tsum_indicator_apply_singleton s hs]
#align measure_theory.measure.to_pmf_to_measure MeasureTheory.Measure.toPmf_toMeasure
+-/
end Measure
@@ -396,6 +606,7 @@ namespace Pmf
open MeasureTheory
+#print Pmf.toMeasure.probabilityMeasure /-
/-- The measure associated to a `pmf` by `to_measure` is a probability measure -/
instance toMeasure.probabilityMeasure [MeasurableSpace α] (p : Pmf α) :
ProbabilityMeasure p.toMeasure :=
@@ -403,23 +614,30 @@ instance toMeasure.probabilityMeasure [MeasurableSpace α] (p : Pmf α) :
simpa only [MeasurableSet.univ, to_measure_apply_eq_to_outer_measure_apply, Set.indicator_univ,
to_outer_measure_apply, ENNReal.coe_eq_one] using tsum_coe p⟩
#align pmf.to_measure.is_probability_measure Pmf.toMeasure.probabilityMeasure
+-/
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) (μ : Measure α)
[ProbabilityMeasure μ]
+#print Pmf.toMeasure_toPmf /-
@[simp]
theorem toMeasure_toPmf : p.toMeasure.toPmf = p :=
Pmf.ext fun x => by
rw [← p.to_measure_apply_singleton x (measurable_set_singleton x), p.to_measure.to_pmf_apply]
#align pmf.to_measure_to_pmf Pmf.toMeasure_toPmf
+-/
+#print Pmf.toMeasure_eq_iff_eq_toPmf /-
theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [ProbabilityMeasure μ] :
p.toMeasure = μ ↔ p = μ.toPmf := by rw [← to_measure_inj, measure.to_pmf_to_measure]
#align pmf.to_measure_eq_iff_eq_to_pmf Pmf.toMeasure_eq_iff_eq_toPmf
+-/
+#print Pmf.toPmf_eq_iff_toMeasure_eq /-
theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [ProbabilityMeasure μ] :
μ.toPmf = p ↔ μ = p.toMeasure := by rw [← to_measure_inj, measure.to_pmf_to_measure]
#align pmf.to_pmf_eq_iff_to_measure_eq Pmf.toPmf_eq_iff_toMeasure_eq
+-/
end Pmf
mathlib commit https://github.com/leanprover-community/mathlib/commit/d4437c68c8d350fc9d4e95e1e174409db35e30d7
@@ -365,7 +365,7 @@ namespace Measure
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 α :=
+ [h : ProbabilityMeasure μ] : Pmf α :=
⟨fun x => μ ({x} : Set α),
ENNReal.summable.hasSum_iff.2
(trans
@@ -376,7 +376,7 @@ def toPmf [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ
#align measure_theory.measure.to_pmf MeasureTheory.Measure.toPmf
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
- [IsProbabilityMeasure μ]
+ [ProbabilityMeasure μ]
theorem toPmf_apply (x : α) : μ.toPmf x = μ {x} :=
rfl
@@ -397,15 +397,15 @@ namespace Pmf
open MeasureTheory
/-- The measure associated to a `pmf` by `to_measure` is a probability measure -/
-instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : Pmf α) :
- IsProbabilityMeasure p.toMeasure :=
+instance toMeasure.probabilityMeasure [MeasurableSpace α] (p : Pmf α) :
+ ProbabilityMeasure p.toMeasure :=
⟨by
simpa only [MeasurableSet.univ, to_measure_apply_eq_to_outer_measure_apply, Set.indicator_univ,
to_outer_measure_apply, ENNReal.coe_eq_one] using tsum_coe p⟩
-#align pmf.to_measure.is_probability_measure Pmf.toMeasure.isProbabilityMeasure
+#align pmf.to_measure.is_probability_measure Pmf.toMeasure.probabilityMeasure
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) (μ : Measure α)
- [IsProbabilityMeasure μ]
+ [ProbabilityMeasure μ]
@[simp]
theorem toMeasure_toPmf : p.toMeasure.toPmf = p :=
@@ -413,11 +413,11 @@ theorem toMeasure_toPmf : p.toMeasure.toPmf = p :=
rw [← p.to_measure_apply_singleton x (measurable_set_singleton x), p.to_measure.to_pmf_apply]
#align pmf.to_measure_to_pmf Pmf.toMeasure_toPmf
-theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [IsProbabilityMeasure μ] :
+theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [ProbabilityMeasure μ] :
p.toMeasure = μ ↔ p = μ.toPmf := by rw [← to_measure_inj, measure.to_pmf_to_measure]
#align pmf.to_measure_eq_iff_eq_to_pmf Pmf.toMeasure_eq_iff_eq_toPmf
-theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [IsProbabilityMeasure μ] :
+theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [ProbabilityMeasure μ] :
μ.toPmf = p ↔ μ = p.toMeasure := by rw [← to_measure_inj, measure.to_pmf_to_measure]
#align pmf.to_pmf_eq_iff_to_measure_eq Pmf.toPmf_eq_iff_toMeasure_eq
mathlib commit https://github.com/leanprover-community/mathlib/commit/92c69b77c5a7dc0f7eeddb552508633305157caa
@@ -254,7 +254,7 @@ theorem toOuterMeasure_apply_eq_of_inter_support_eq {s t : Set α}
@[simp]
theorem toOuterMeasure_apply_fintype [Fintype α] : p.toOuterMeasure s = ∑ x, s.indicator p x :=
- (p.toOuterMeasure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
+ (p.to_outer_measure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
#align pmf.to_outer_measure_apply_fintype Pmf.toOuterMeasure_apply_fintype
end OuterMeasure
@@ -281,7 +281,7 @@ theorem toMeasure_apply_eq_toOuterMeasure_apply (hs : MeasurableSet s) :
#align pmf.to_measure_apply_eq_to_outer_measure_apply Pmf.toMeasure_apply_eq_toOuterMeasure_apply
theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indicator p x :=
- (p.toMeasure_apply_eq_toOuterMeasure_apply s hs).trans (p.toOuterMeasure_apply s)
+ (p.toMeasure_apply_eq_toOuterMeasure_apply s hs).trans (p.to_outer_measure_apply s)
#align pmf.to_measure_apply Pmf.toMeasure_apply
theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
@@ -340,7 +340,7 @@ theorem toMeasure_apply_finset (s : Finset α) : p.toMeasure s = ∑ x in s, p x
#align pmf.to_measure_apply_finset Pmf.toMeasure_apply_finset
theorem toMeasure_apply_of_finite (hs : s.Finite) : p.toMeasure s = ∑' x, s.indicator p x :=
- (p.toMeasure_apply_eq_toOuterMeasure_apply s hs.MeasurableSet).trans (p.toOuterMeasure_apply s)
+ (p.toMeasure_apply_eq_toOuterMeasure_apply s hs.MeasurableSet).trans (p.to_outer_measure_apply s)
#align pmf.to_measure_apply_of_finite Pmf.toMeasure_apply_of_finite
@[simp]
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Devon Tuma
! This file was ported from Lean 3 source module probability.probability_mass_function.basic
-! leanprover-community/mathlib commit 3f5c9d30716c775bda043456728a1a3ee31412e7
+! leanprover-community/mathlib commit 4ac69b290818724c159de091daa3acd31da0ee6d
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -49,14 +49,21 @@ def Pmf.{u} (α : Type u) : Type u :=
namespace Pmf
-instance : CoeFun (Pmf α) fun p => α → ℝ≥0∞ :=
- ⟨fun p a => p.1 a⟩
+instance funLike : FunLike (Pmf α) α fun p => ℝ≥0∞
+ where
+ coe p a := p.1 a
+ coe_injective' p q h := Subtype.eq h
+#align pmf.fun_like Pmf.funLike
@[ext]
-protected theorem ext : ∀ {p q : Pmf α}, (∀ a, p a = q a) → p = q
- | ⟨f, hf⟩, ⟨g, hg⟩, Eq => Subtype.eq <| funext Eq
+protected theorem ext {p q : Pmf α} (h : ∀ x, p x = q x) : p = q :=
+ FunLike.ext p q h
#align pmf.ext Pmf.ext
+theorem ext_iff {p q : Pmf α} : p = q ↔ ∀ x, p x = q x :=
+ FunLike.ext_iff
+#align pmf.ext_iff Pmf.ext_iff
+
theorem hasSum_coe_one (p : Pmf α) : HasSum p 1 :=
p.2
#align pmf.has_sum_coe_one Pmf.hasSum_coe_one
@@ -78,6 +85,11 @@ theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : (∑' a, s.indicat
(lt_of_le_of_ne le_top p.tsum_coe_ne_top))
#align pmf.tsum_coe_indicator_ne_top Pmf.tsum_coe_indicator_ne_top
+@[simp]
+theorem coe_ne_zero (p : Pmf α) : ⇑p ≠ 0 := fun hp =>
+ zero_ne_one ((tsum_zero.symm.trans (tsum_congr fun x => symm (congr_fun hp x))).trans p.tsum_coe)
+#align pmf.coe_ne_zero Pmf.coe_ne_zero
+
/-- The support of a `pmf` is the set where it is nonzero. -/
def support (p : Pmf α) : Set α :=
Function.support p
@@ -88,6 +100,11 @@ theorem mem_support_iff (p : Pmf α) (a : α) : a ∈ p.support ↔ p a ≠ 0 :=
Iff.rfl
#align pmf.mem_support_iff Pmf.mem_support_iff
+@[simp]
+theorem support_nonempty (p : Pmf α) : p.support.Nonempty :=
+ Function.support_nonempty_iff.2 p.coe_ne_zero
+#align pmf.support_nonempty Pmf.support_nonempty
+
theorem apply_eq_zero_iff (p : Pmf α) (a : α) : p a = 0 ↔ a ∉ p.support := by
rw [mem_support_iff, Classical.not_not]
#align pmf.apply_eq_zero_iff Pmf.apply_eq_zero_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/4c586d291f189eecb9d00581aeb3dd998ac34442
@@ -114,7 +114,7 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
calc
1 = 1 + 0 := (add_zero 1).symm
_ < p a + ∑' b, ite (b = a) 0 (p b) :=
- ENNReal.add_lt_add_of_le_of_lt ENNReal.one_ne_top (le_of_eq h.symm) this
+ (ENNReal.add_lt_add_of_le_of_lt ENNReal.one_ne_top (le_of_eq h.symm) this)
_ = ite (a = a) (p a) 0 + ∑' b, ite (b = a) 0 (p b) := by rw [eq_self_iff_true, if_true]
_ = (∑' b, ite (b = a) (p b) 0) + ∑' b, ite (b = a) 0 (p b) :=
by
@@ -199,7 +199,7 @@ theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p
exact function.funext_iff.symm.trans Set.indicator_eq_zero'
#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iff
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (x «expr ∉ » s) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∉ » s) -/
theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s :=
by
refine' (p.to_outer_measure_apply s).symm ▸ ⟨fun h a hap => _, fun h => _⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/eb0cb4511aaef0da2462207b67358a0e1fe1e2ee
@@ -39,7 +39,7 @@ noncomputable section
variable {α β γ : Type _}
-open Classical BigOperators NNReal Ennreal MeasureTheory
+open Classical BigOperators NNReal ENNReal MeasureTheory
/-- A probability mass function, or discrete probability measures is a function `α → ℝ≥0∞` such
that the values have (infinite) sum `1`. -/
@@ -67,14 +67,14 @@ theorem tsum_coe (p : Pmf α) : (∑' a, p a) = 1 :=
#align pmf.tsum_coe Pmf.tsum_coe
theorem tsum_coe_ne_top (p : Pmf α) : (∑' a, p a) ≠ ∞ :=
- p.tsum_coe.symm ▸ Ennreal.one_ne_top
+ p.tsum_coe.symm ▸ ENNReal.one_ne_top
#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_top
theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : (∑' a, s.indicator p a) ≠ ∞ :=
ne_of_lt
(lt_of_le_of_lt
- (tsum_le_tsum (fun a => Set.indicator_apply_le fun _ => le_rfl) Ennreal.summable
- Ennreal.summable)
+ (tsum_le_tsum (fun a => Set.indicator_apply_le fun _ => le_rfl) ENNReal.summable
+ ENNReal.summable)
(lt_of_le_of_ne le_top p.tsum_coe_ne_top))
#align pmf.tsum_coe_indicator_ne_top Pmf.tsum_coe_indicator_ne_top
@@ -109,12 +109,12 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
exact ne_of_lt this p.tsum_coe.symm
have : 0 < ∑' b, ite (b = a) 0 (p b) :=
lt_of_le_of_ne' zero_le'
- ((tsum_ne_zero_iff Ennreal.summable).2
+ ((tsum_ne_zero_iff ENNReal.summable).2
⟨a', ite_ne_left_iff.2 ⟨ha, Ne.symm <| (p.mem_support_iff a').2 ha'⟩⟩)
calc
1 = 1 + 0 := (add_zero 1).symm
_ < p a + ∑' b, ite (b = a) 0 (p b) :=
- Ennreal.add_lt_add_of_le_of_lt Ennreal.one_ne_top (le_of_eq h.symm) this
+ ENNReal.add_lt_add_of_le_of_lt ENNReal.one_ne_top (le_of_eq h.symm) this
_ = ite (a = a) (p a) 0 + ∑' b, ite (b = a) 0 (p b) := by rw [eq_self_iff_true, if_true]
_ = (∑' b, ite (b = a) (p b) 0) + ∑' b, ite (b = a) 0 (p b) :=
by
@@ -134,7 +134,7 @@ theorem coe_le_one (p : Pmf α) (a : α) : p a ≤ 1 :=
#align pmf.coe_le_one Pmf.coe_le_one
theorem apply_ne_top (p : Pmf α) (a : α) : p a ≠ ∞ :=
- ne_of_lt (lt_of_le_of_lt (p.coe_le_one a) Ennreal.one_lt_top)
+ ne_of_lt (lt_of_le_of_lt (p.coe_le_one a) ENNReal.one_lt_top)
#align pmf.apply_ne_top Pmf.apply_ne_top
theorem apply_lt_top (p : Pmf α) (a : α) : p a < ∞ :=
@@ -195,7 +195,7 @@ theorem toOuterMeasure_inj {p q : Pmf α} : p.toOuterMeasure = q.toOuterMeasure
theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p.support s :=
by
- rw [to_outer_measure_apply, Ennreal.tsum_eq_zero]
+ rw [to_outer_measure_apply, ENNReal.tsum_eq_zero]
exact function.funext_iff.symm.trans Set.indicator_eq_zero'
#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iff
@@ -207,7 +207,7 @@ theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support
have hs' : s.indicator p a = 0 := Set.indicator_apply_eq_zero.2 fun hs' => False.elim <| hs hs'
have hsa : s.indicator p a < p a := hs'.symm ▸ (p.apply_pos_iff a).2 hap
exact
- Ennreal.tsum_lt_tsum (p.tsum_coe_indicator_ne_top s)
+ ENNReal.tsum_lt_tsum (p.tsum_coe_indicator_ne_top s)
(fun x => Set.indicator_apply_le fun _ => le_rfl) hsa
· suffices : ∀ (x) (_ : x ∉ s), p x = 0
exact
@@ -350,7 +350,7 @@ is the measure of the singleton set under the original measure. -/
def toPmf [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
[h : IsProbabilityMeasure μ] : Pmf α :=
⟨fun x => μ ({x} : Set α),
- Ennreal.summable.hasSum_iff.2
+ ENNReal.summable.hasSum_iff.2
(trans
(symm <|
(tsum_indicator_apply_singleton μ Set.univ MeasurableSet.univ).symm.trans
@@ -384,7 +384,7 @@ instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : Pmf α) :
IsProbabilityMeasure p.toMeasure :=
⟨by
simpa only [MeasurableSet.univ, to_measure_apply_eq_to_outer_measure_apply, Set.indicator_univ,
- to_outer_measure_apply, Ennreal.coe_eq_one] using tsum_coe p⟩
+ to_outer_measure_apply, ENNReal.coe_eq_one] using tsum_coe p⟩
#align pmf.to_measure.is_probability_measure Pmf.toMeasure.isProbabilityMeasure
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) (μ : Measure α)
mathlib commit https://github.com/leanprover-community/mathlib/commit/c23aca359d4be6975b2a577d5cdb9d77b82c7407
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Devon Tuma
! This file was ported from Lean 3 source module probability.probability_mass_function.basic
-! leanprover-community/mathlib commit e50b8c261b0a000b806ec0e1356b41945eda61f7
+! leanprover-community/mathlib commit 3f5c9d30716c775bda043456728a1a3ee31412e7
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -25,6 +25,9 @@ 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.
+Conversely, given a probability measure `μ` on a measurable space `α` with all singleton sets
+measurable, `μ.to_pmf` constructs a `pmf` on `α`, setting the probability mass of a point `x`
+to be the measure of the singleton set `{x}`.
## Tags
@@ -36,7 +39,7 @@ noncomputable section
variable {α β γ : Type _}
-open Classical BigOperators NNReal Ennreal
+open Classical BigOperators NNReal Ennreal MeasureTheory
/-- A probability mass function, or discrete probability measures is a function `α → ℝ≥0∞` such
that the values have (infinite) sum `1`. -/
@@ -154,6 +157,15 @@ theorem toOuterMeasure_apply : p.toOuterMeasure s = ∑' x, s.indicator p x :=
tsum_congr fun x => smul_dirac_apply (p x) x s
#align pmf.to_outer_measure_apply Pmf.toOuterMeasure_apply
+@[simp]
+theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ :=
+ by
+ refine' eq_top_iff.2 <| le_trans (le_infₛ fun x hx => _) (le_sum_caratheodory _)
+ exact
+ let ⟨y, hy⟩ := hx
+ ((le_of_eq (dirac_caratheodory y).symm).trans (le_smul_caratheodory _ _)).trans (le_of_eq hy)
+#align pmf.to_outer_measure_caratheodory Pmf.toOuterMeasure_caratheodory
+
@[simp]
theorem toOuterMeasure_apply_finset (s : Finset α) : p.toOuterMeasure s = ∑ x in s, p x :=
by
@@ -169,6 +181,18 @@ theorem toOuterMeasure_apply_singleton (a : α) : p.toOuterMeasure {a} = p a :=
· exact ite_eq_left_iff.2 fun ha' => False.elim <| ha' rfl
#align pmf.to_outer_measure_apply_singleton Pmf.toOuterMeasure_apply_singleton
+theorem toOuterMeasure_injective : (toOuterMeasure : Pmf α → OuterMeasure α).Injective :=
+ fun p q h =>
+ Pmf.ext fun x =>
+ (p.toOuterMeasure_apply_singleton x).symm.trans
+ ((congr_fun (congr_arg _ h) _).trans <| q.toOuterMeasure_apply_singleton x)
+#align pmf.to_outer_measure_injective Pmf.toOuterMeasure_injective
+
+@[simp]
+theorem toOuterMeasure_inj {p q : Pmf α} : p.toOuterMeasure = q.toOuterMeasure ↔ p = q :=
+ toOuterMeasure_injective.eq_iff
+#align pmf.to_outer_measure_inj Pmf.toOuterMeasure_inj
+
theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p.support s :=
by
rw [to_outer_measure_apply, Ennreal.tsum_eq_zero]
@@ -216,15 +240,6 @@ theorem toOuterMeasure_apply_fintype [Fintype α] : p.toOuterMeasure s = ∑ x,
(p.toOuterMeasure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
#align pmf.to_outer_measure_apply_fintype Pmf.toOuterMeasure_apply_fintype
-@[simp]
-theorem toOuterMeasure_caratheodory (p : Pmf α) : (toOuterMeasure p).caratheodory = ⊤ :=
- by
- refine' eq_top_iff.2 <| le_trans (le_infₛ fun x hx => _) (le_sum_caratheodory _)
- obtain ⟨y, hy⟩ := hx
- exact
- ((le_of_eq (dirac_caratheodory y).symm).trans (le_smul_caratheodory _ _)).trans (le_of_eq hy)
-#align pmf.to_outer_measure_caratheodory Pmf.toOuterMeasure_caratheodory
-
end OuterMeasure
section Measure
@@ -254,7 +269,7 @@ theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indic
theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
p.toMeasure {a} = p a := by
- simp [to_measure_apply_eq_to_outer_measure_apply p {a} h, to_outer_measure_apply_singleton]
+ simp [to_measure_apply_eq_to_outer_measure_apply _ _ h, to_outer_measure_apply_singleton]
#align pmf.to_measure_apply_singleton Pmf.toMeasure_apply_singleton
theorem toMeasure_apply_eq_zero_iff (hs : MeasurableSet s) :
@@ -289,6 +304,18 @@ section MeasurableSingletonClass
variable [MeasurableSingletonClass α]
+theorem toMeasure_injective : (toMeasure : Pmf α → Measure α).Injective := fun p q h =>
+ Pmf.ext fun x =>
+ (p.toMeasure_apply_singleton x <| measurableSet_singleton x).symm.trans
+ ((congr_fun (congr_arg _ h) _).trans <|
+ q.toMeasure_apply_singleton x <| measurableSet_singleton x)
+#align pmf.to_measure_injective Pmf.toMeasure_injective
+
+@[simp]
+theorem toMeasure_inj {p q : Pmf α} : p.toMeasure = q.toMeasure ↔ p = q :=
+ toMeasure_injective.eq_iff
+#align pmf.to_measure_inj Pmf.toMeasure_inj
+
@[simp]
theorem toMeasure_apply_finset (s : Finset α) : p.toMeasure s = ∑ x in s, p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.MeasurableSet).trans
@@ -307,14 +334,75 @@ theorem toMeasure_apply_fintype [Fintype α] : p.toMeasure s = ∑ x, s.indicato
end MeasurableSingletonClass
+end Measure
+
+end Pmf
+
+namespace MeasureTheory
+
+open Pmf
+
+namespace Measure
+
+/-- 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 α :=
+ ⟨fun x => μ ({x} : Set α),
+ Ennreal.summable.hasSum_iff.2
+ (trans
+ (symm <|
+ (tsum_indicator_apply_singleton μ Set.univ MeasurableSet.univ).symm.trans
+ (tsum_congr fun x => congr_fun (Set.indicator_univ _) x))
+ h.measure_univ)⟩
+#align measure_theory.measure.to_pmf MeasureTheory.Measure.toPmf
+
+variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
+ [IsProbabilityMeasure μ]
+
+theorem toPmf_apply (x : α) : μ.toPmf x = μ {x} :=
+ rfl
+#align measure_theory.measure.to_pmf_apply MeasureTheory.Measure.toPmf_apply
+
+@[simp]
+theorem toPmf_toMeasure : μ.toPmf.toMeasure = μ :=
+ Measure.ext fun s hs => by
+ simpa only [μ.to_pmf.to_measure_apply s hs, ← μ.tsum_indicator_apply_singleton s hs]
+#align measure_theory.measure.to_pmf_to_measure MeasureTheory.Measure.toPmf_toMeasure
+
+end Measure
+
+end MeasureTheory
+
+namespace Pmf
+
+open MeasureTheory
+
/-- The measure associated to a `pmf` by `to_measure` is a probability measure -/
-instance toMeasure.isProbabilityMeasure (p : Pmf α) : IsProbabilityMeasure p.toMeasure :=
+instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : Pmf α) :
+ IsProbabilityMeasure p.toMeasure :=
⟨by
simpa only [MeasurableSet.univ, to_measure_apply_eq_to_outer_measure_apply, Set.indicator_univ,
to_outer_measure_apply, Ennreal.coe_eq_one] using tsum_coe p⟩
#align pmf.to_measure.is_probability_measure Pmf.toMeasure.isProbabilityMeasure
-end Measure
+variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) (μ : Measure α)
+ [IsProbabilityMeasure μ]
+
+@[simp]
+theorem toMeasure_toPmf : p.toMeasure.toPmf = p :=
+ Pmf.ext fun x => by
+ rw [← p.to_measure_apply_singleton x (measurable_set_singleton x), p.to_measure.to_pmf_apply]
+#align pmf.to_measure_to_pmf Pmf.toMeasure_toPmf
+
+theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [IsProbabilityMeasure μ] :
+ p.toMeasure = μ ↔ p = μ.toPmf := by rw [← to_measure_inj, measure.to_pmf_to_measure]
+#align pmf.to_measure_eq_iff_eq_to_pmf Pmf.toMeasure_eq_iff_eq_toPmf
+
+theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [IsProbabilityMeasure μ] :
+ μ.toPmf = p ↔ μ = p.toMeasure := by rw [← to_measure_inj, measure.to_pmf_to_measure]
+#align pmf.to_pmf_eq_iff_to_measure_eq Pmf.toPmf_eq_iff_toMeasure_eq
end Pmf
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
I removed some redundant instance arguments throughout Mathlib. To do this, I used VS Code's regex search. See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/repeating.20instances.20from.20variable.20command I closed the previous PR for this and reopened it.
@@ -283,7 +283,7 @@ theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet
#align pmf.to_measure_apply_inter_support PMF.toMeasure_apply_inter_support
@[simp]
-theorem restrict_toMeasure_support [MeasurableSpace α] [MeasurableSingletonClass α] (p : PMF α) :
+theorem restrict_toMeasure_support [MeasurableSingletonClass α] (p : PMF α) :
Measure.restrict (toMeasure p) (support p) = toMeasure p := by
ext s hs
apply (MeasureTheory.Measure.restrict_apply hs).trans
open Classical
(#11199)
We remove all but one open Classical
s, instead preferring to use open scoped Classical
. The only real side-effect this led to is moving a couple declarations to use Exists.choose
instead of Classical.choose
.
The first few commits are explicitly labelled regex replaces for ease of review.
@@ -36,7 +36,8 @@ noncomputable section
variable {α β γ : Type*}
-open Classical BigOperators NNReal ENNReal MeasureTheory
+open scoped Classical
+open BigOperators NNReal ENNReal MeasureTheory
/-- A probability mass function, or discrete probability measures is a function `α → ℝ≥0∞` such
that the values have (infinite) sum `1`. -/
have
, replace
and suffices
(#10640)
No changes to tactic file, it's just boring fixes throughout the library.
This follows on from #6964.
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -116,8 +116,7 @@ theorem apply_eq_one_iff (p : PMF α) (a : α) : p a = 1 ↔ p.support = {a} :=
fun a' ha' => ha'.symm ▸ (p.mem_support_iff a).2 fun ha => zero_ne_one <| ha.symm.trans h,
fun h => _root_.trans (symm <| tsum_eq_single a
fun a' ha' => (p.apply_eq_zero_iff a').2 (h.symm ▸ ha')) p.tsum_coe⟩
- suffices : 1 < ∑' a, p a
- exact ne_of_lt this p.tsum_coe.symm
+ suffices 1 < ∑' a, p a from ne_of_lt this p.tsum_coe.symm
have : 0 < ∑' b, ite (b = a) 0 (p b) := lt_of_le_of_ne' zero_le'
((tsum_ne_zero_iff ENNReal.summable).2
⟨a', ite_ne_left_iff.2 ⟨ha, Ne.symm <| (p.mem_support_iff a').2 ha'⟩⟩)
@@ -205,9 +204,9 @@ theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support
have hsa : s.indicator p a < p a := hs'.symm ▸ (p.apply_pos_iff a).2 hap
exact ENNReal.tsum_lt_tsum (p.tsum_coe_indicator_ne_top s)
(fun x => Set.indicator_apply_le fun _ => le_rfl) hsa
- · suffices : ∀ (x) (_ : x ∉ s), p x = 0
- exact _root_.trans (tsum_congr
- fun a => (Set.indicator_apply s p a).trans (ite_eq_left_iff.2 <| symm ∘ this a)) p.tsum_coe
+ · suffices ∀ (x) (_ : x ∉ s), p x = 0 from
+ _root_.trans (tsum_congr
+ fun a => (Set.indicator_apply s p a).trans (ite_eq_left_iff.2 <| symm ∘ this a)) p.tsum_coe
exact fun a ha => (p.apply_eq_zero_iff a).2 <| Set.not_mem_subset h ha
#align pmf.to_outer_measure_apply_eq_one_iff PMF.toOuterMeasure_apply_eq_one_iff
FunLike
(#9833)
This follows up from #9785, which renamed FunLike
to DFunLike
, by introducing a new abbreviation FunLike F α β := DFunLike F α (fun _ => β)
, to make the non-dependent use of FunLike
easier.
I searched for the pattern DFunLike.*fun
and DFunLike.*λ
in all files to replace expressions of the form DFunLike F α (fun _ => β)
with FunLike F α β
. I did this everywhere except for extends
clauses for two reasons: it would conflict with #8386, and more importantly extends
must directly refer to a structure with no unfolding of def
s or abbrev
s.
@@ -46,10 +46,10 @@ def PMF.{u} (α : Type u) : Type u :=
namespace PMF
-instance instDFunLike : DFunLike (PMF α) α fun _ => ℝ≥0∞ where
+instance instFunLike : FunLike (PMF α) α ℝ≥0∞ where
coe p a := p.1 a
coe_injective' _ _ h := Subtype.eq h
-#align pmf.fun_like PMF.instDFunLike
+#align pmf.fun_like PMF.instFunLike
@[ext]
protected theorem ext {p q : PMF α} (h : ∀ x, p x = q x) : p = q :=
FunLike
to DFunLike
(#9785)
This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.
This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:
sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@@ -46,18 +46,18 @@ def PMF.{u} (α : Type u) : Type u :=
namespace PMF
-instance funLike : FunLike (PMF α) α fun _ => ℝ≥0∞ where
+instance instDFunLike : DFunLike (PMF α) α fun _ => ℝ≥0∞ where
coe p a := p.1 a
coe_injective' _ _ h := Subtype.eq h
-#align pmf.fun_like PMF.funLike
+#align pmf.fun_like PMF.instDFunLike
@[ext]
protected theorem ext {p q : PMF α} (h : ∀ x, p x = q x) : p = q :=
- FunLike.ext p q h
+ DFunLike.ext p q h
#align pmf.ext PMF.ext
theorem ext_iff {p q : PMF α} : p = q ↔ ∀ x, p x = q x :=
- FunLike.ext_iff
+ DFunLike.ext_iff
#align pmf.ext_iff PMF.ext_iff
theorem hasSum_coe_one (p : PMF α) : HasSum p 1 :=
@@ -15,15 +15,15 @@ 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 `ProbabilityMassFunction/Monad.lean`,
-other constructions of `Pmf`s are found in `ProbabilityMassFunction/Constructions.lean`.
+other constructions of `PMF`s are found in `ProbabilityMassFunction/Constructions.lean`.
-Given `p : Pmf α`, `Pmf.toOuterMeasure` constructs an `OuterMeasure` on `α`,
+Given `p : PMF α`, `PMF.toOuterMeasure` constructs an `OuterMeasure` 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.toMeasure`.
-`Pmf.toMeasure.isProbabilityMeasure` shows this associated measure is a probability measure.
+so we can further extend this to a `Measure` on `α`, see `PMF.toMeasure`.
+`PMF.toMeasure.isProbabilityMeasure` shows this associated measure is a probability measure.
Conversely, given a probability measure `μ` on a measurable space `α` with all singleton sets
-measurable, `μ.toPmf` constructs a `Pmf` on `α`, setting the probability mass of a point `x`
+measurable, `μ.toPMF` constructs a `PMF` on `α`, setting the probability mass of a point `x`
to be the measure of the singleton set `{x}`.
## Tags
@@ -40,78 +40,78 @@ open Classical BigOperators NNReal ENNReal MeasureTheory
/-- 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 :=
+def PMF.{u} (α : Type u) : Type u :=
{ f : α → ℝ≥0∞ // HasSum f 1 }
-#align pmf Pmf
+#align pmf PMF
-namespace Pmf
+namespace PMF
-instance funLike : FunLike (Pmf α) α fun _ => ℝ≥0∞ where
+instance funLike : FunLike (PMF α) α fun _ => ℝ≥0∞ where
coe p a := p.1 a
coe_injective' _ _ h := Subtype.eq h
-#align pmf.fun_like Pmf.funLike
+#align pmf.fun_like PMF.funLike
@[ext]
-protected theorem ext {p q : Pmf α} (h : ∀ x, p x = q x) : p = q :=
+protected theorem ext {p q : PMF α} (h : ∀ x, p x = q x) : p = q :=
FunLike.ext p q h
-#align pmf.ext Pmf.ext
+#align pmf.ext PMF.ext
-theorem ext_iff {p q : Pmf α} : p = q ↔ ∀ x, p x = q x :=
+theorem ext_iff {p q : PMF α} : p = q ↔ ∀ x, p x = q x :=
FunLike.ext_iff
-#align pmf.ext_iff Pmf.ext_iff
+#align pmf.ext_iff PMF.ext_iff
-theorem hasSum_coe_one (p : Pmf α) : HasSum p 1 :=
+theorem hasSum_coe_one (p : PMF α) : HasSum p 1 :=
p.2
-#align pmf.has_sum_coe_one Pmf.hasSum_coe_one
+#align pmf.has_sum_coe_one PMF.hasSum_coe_one
@[simp]
-theorem tsum_coe (p : Pmf α) : ∑' a, p a = 1 :=
+theorem tsum_coe (p : PMF α) : ∑' a, p a = 1 :=
p.hasSum_coe_one.tsum_eq
-#align pmf.tsum_coe Pmf.tsum_coe
+#align pmf.tsum_coe PMF.tsum_coe
-theorem tsum_coe_ne_top (p : Pmf α) : ∑' a, p a ≠ ∞ :=
+theorem tsum_coe_ne_top (p : PMF α) : ∑' a, p a ≠ ∞ :=
p.tsum_coe.symm ▸ ENNReal.one_ne_top
-#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_top
+#align pmf.tsum_coe_ne_top PMF.tsum_coe_ne_top
-theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞ :=
+theorem tsum_coe_indicator_ne_top (p : PMF α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞ :=
ne_of_lt (lt_of_le_of_lt
(tsum_le_tsum (fun _ => Set.indicator_apply_le fun _ => le_rfl) ENNReal.summable
ENNReal.summable)
(lt_of_le_of_ne le_top p.tsum_coe_ne_top))
-#align pmf.tsum_coe_indicator_ne_top Pmf.tsum_coe_indicator_ne_top
+#align pmf.tsum_coe_indicator_ne_top PMF.tsum_coe_indicator_ne_top
@[simp]
-theorem coe_ne_zero (p : Pmf α) : ⇑p ≠ 0 := fun hp =>
+theorem coe_ne_zero (p : PMF α) : ⇑p ≠ 0 := fun hp =>
zero_ne_one ((tsum_zero.symm.trans (tsum_congr fun x => symm (congr_fun hp x))).trans p.tsum_coe)
-#align pmf.coe_ne_zero Pmf.coe_ne_zero
+#align pmf.coe_ne_zero PMF.coe_ne_zero
-/-- The support of a `Pmf` is the set where it is nonzero. -/
-def support (p : Pmf α) : Set α :=
+/-- The support of a `PMF` is the set where it is nonzero. -/
+def support (p : PMF α) : Set α :=
Function.support p
-#align pmf.support Pmf.support
+#align pmf.support PMF.support
@[simp]
-theorem mem_support_iff (p : Pmf α) (a : α) : a ∈ p.support ↔ p a ≠ 0 := Iff.rfl
-#align pmf.mem_support_iff Pmf.mem_support_iff
+theorem mem_support_iff (p : PMF α) (a : α) : a ∈ p.support ↔ p a ≠ 0 := Iff.rfl
+#align pmf.mem_support_iff PMF.mem_support_iff
@[simp]
-theorem support_nonempty (p : Pmf α) : p.support.Nonempty :=
+theorem support_nonempty (p : PMF α) : p.support.Nonempty :=
Function.support_nonempty_iff.2 p.coe_ne_zero
-#align pmf.support_nonempty Pmf.support_nonempty
+#align pmf.support_nonempty PMF.support_nonempty
@[simp]
-theorem support_countable (p : Pmf α) : p.support.Countable :=
+theorem support_countable (p : PMF α) : p.support.Countable :=
Summable.countable_support_ennreal (tsum_coe_ne_top p)
-theorem apply_eq_zero_iff (p : Pmf α) (a : α) : p a = 0 ↔ a ∉ p.support := by
+theorem apply_eq_zero_iff (p : PMF α) (a : α) : p a = 0 ↔ a ∉ p.support := by
rw [mem_support_iff, Classical.not_not]
-#align pmf.apply_eq_zero_iff Pmf.apply_eq_zero_iff
+#align pmf.apply_eq_zero_iff PMF.apply_eq_zero_iff
-theorem apply_pos_iff (p : Pmf α) (a : α) : 0 < p a ↔ a ∈ p.support :=
+theorem apply_pos_iff (p : PMF α) (a : α) : 0 < p a ↔ a ∈ p.support :=
pos_iff_ne_zero.trans (p.mem_support_iff a).symm
-#align pmf.apply_pos_iff Pmf.apply_pos_iff
+#align pmf.apply_pos_iff PMF.apply_pos_iff
-theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} := by
+theorem apply_eq_one_iff (p : PMF α) (a : α) : p a = 1 ↔ p.support = {a} := by
refine' ⟨fun h => Set.Subset.antisymm (fun a' ha' => by_contra fun ha => _)
fun a' ha' => ha'.symm ▸ (p.mem_support_iff a).2 fun ha => zero_ne_one <| ha.symm.trans h,
fun h => _root_.trans (symm <| tsum_eq_single a
@@ -131,36 +131,36 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
exact symm (tsum_eq_single a fun b hb => if_neg hb)
_ = ∑' b, (ite (b = a) (p b) 0 + ite (b = a) 0 (p b)) := ENNReal.tsum_add.symm
_ = ∑' b, p b := tsum_congr fun b => by split_ifs <;> simp only [zero_add, add_zero, le_rfl]
-#align pmf.apply_eq_one_iff Pmf.apply_eq_one_iff
+#align pmf.apply_eq_one_iff PMF.apply_eq_one_iff
-theorem coe_le_one (p : Pmf α) (a : α) : p a ≤ 1 := by
+theorem coe_le_one (p : PMF α) (a : α) : p a ≤ 1 := by
refine' hasSum_le (fun b => _) (hasSum_ite_eq a (p a)) (hasSum_coe_one p)
split_ifs with h <;> simp only [h, zero_le', le_rfl]
-#align pmf.coe_le_one Pmf.coe_le_one
+#align pmf.coe_le_one PMF.coe_le_one
-theorem apply_ne_top (p : Pmf α) (a : α) : p a ≠ ∞ :=
+theorem apply_ne_top (p : PMF α) (a : α) : p a ≠ ∞ :=
ne_of_lt (lt_of_le_of_lt (p.coe_le_one a) ENNReal.one_lt_top)
-#align pmf.apply_ne_top Pmf.apply_ne_top
+#align pmf.apply_ne_top PMF.apply_ne_top
-theorem apply_lt_top (p : Pmf α) (a : α) : p a < ∞ :=
+theorem apply_lt_top (p : PMF α) (a : α) : p a < ∞ :=
lt_of_le_of_ne le_top (p.apply_ne_top a)
-#align pmf.apply_lt_top Pmf.apply_lt_top
+#align pmf.apply_lt_top PMF.apply_lt_top
section OuterMeasure
open MeasureTheory MeasureTheory.OuterMeasure
-/-- Construct an `OuterMeasure` from a `Pmf`, by assigning measure to each set `s : Set α` equal
+/-- 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 α :=
+def toOuterMeasure (p : PMF α) : OuterMeasure α :=
OuterMeasure.sum fun x : α => p x • dirac x
-#align pmf.to_outer_measure Pmf.toOuterMeasure
+#align pmf.to_outer_measure PMF.toOuterMeasure
-variable (p : Pmf α) (s t : Set α)
+variable (p : PMF α) (s t : Set α)
theorem toOuterMeasure_apply : p.toOuterMeasure s = ∑' x, s.indicator p x :=
tsum_congr fun x => smul_dirac_apply (p x) x s
-#align pmf.to_outer_measure_apply Pmf.toOuterMeasure_apply
+#align pmf.to_outer_measure_apply PMF.toOuterMeasure_apply
@[simp]
theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ := by
@@ -168,35 +168,35 @@ theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ := by
have ⟨y, hy⟩ := hx
exact
((le_of_eq (dirac_caratheodory y).symm).trans (le_smul_caratheodory _ _)).trans (le_of_eq hy)
-#align pmf.to_outer_measure_caratheodory Pmf.toOuterMeasure_caratheodory
+#align pmf.to_outer_measure_caratheodory PMF.toOuterMeasure_caratheodory
@[simp]
theorem toOuterMeasure_apply_finset (s : Finset α) : p.toOuterMeasure s = ∑ x in s, p x := by
refine' (toOuterMeasure_apply p s).trans ((tsum_eq_sum (s := s) _).trans _)
· exact fun x hx => Set.indicator_of_not_mem (Finset.mem_coe.not.2 hx) _
· exact Finset.sum_congr rfl fun x hx => Set.indicator_of_mem (Finset.mem_coe.2 hx) _
-#align pmf.to_outer_measure_apply_finset Pmf.toOuterMeasure_apply_finset
+#align pmf.to_outer_measure_apply_finset PMF.toOuterMeasure_apply_finset
theorem toOuterMeasure_apply_singleton (a : α) : p.toOuterMeasure {a} = p a := by
refine' (p.toOuterMeasure_apply {a}).trans ((tsum_eq_single a fun b hb => _).trans _)
· exact ite_eq_right_iff.2 fun hb' => False.elim <| hb hb'
· exact ite_eq_left_iff.2 fun ha' => False.elim <| ha' rfl
-#align pmf.to_outer_measure_apply_singleton Pmf.toOuterMeasure_apply_singleton
+#align pmf.to_outer_measure_apply_singleton PMF.toOuterMeasure_apply_singleton
-theorem toOuterMeasure_injective : (toOuterMeasure : Pmf α → OuterMeasure α).Injective :=
- fun p q h => Pmf.ext fun x => (p.toOuterMeasure_apply_singleton x).symm.trans
+theorem toOuterMeasure_injective : (toOuterMeasure : PMF α → OuterMeasure α).Injective :=
+ fun p q h => PMF.ext fun x => (p.toOuterMeasure_apply_singleton x).symm.trans
((congr_fun (congr_arg _ h) _).trans <| q.toOuterMeasure_apply_singleton x)
-#align pmf.to_outer_measure_injective Pmf.toOuterMeasure_injective
+#align pmf.to_outer_measure_injective PMF.toOuterMeasure_injective
@[simp]
-theorem toOuterMeasure_inj {p q : Pmf α} : p.toOuterMeasure = q.toOuterMeasure ↔ p = q :=
+theorem toOuterMeasure_inj {p q : PMF α} : p.toOuterMeasure = q.toOuterMeasure ↔ p = q :=
toOuterMeasure_injective.eq_iff
-#align pmf.to_outer_measure_inj Pmf.toOuterMeasure_inj
+#align pmf.to_outer_measure_inj PMF.toOuterMeasure_inj
theorem toOuterMeasure_apply_eq_zero_iff : p.toOuterMeasure s = 0 ↔ Disjoint p.support s := by
rw [toOuterMeasure_apply, ENNReal.tsum_eq_zero]
exact Function.funext_iff.symm.trans Set.indicator_eq_zero'
-#align pmf.to_outer_measure_apply_eq_zero_iff Pmf.toOuterMeasure_apply_eq_zero_iff
+#align pmf.to_outer_measure_apply_eq_zero_iff PMF.toOuterMeasure_apply_eq_zero_iff
theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s := by
refine' (p.toOuterMeasure_apply s).symm ▸ ⟨fun h a hap => _, fun h => _⟩
@@ -209,30 +209,30 @@ theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support
exact _root_.trans (tsum_congr
fun a => (Set.indicator_apply s p a).trans (ite_eq_left_iff.2 <| symm ∘ this a)) p.tsum_coe
exact fun a ha => (p.apply_eq_zero_iff a).2 <| Set.not_mem_subset h ha
-#align pmf.to_outer_measure_apply_eq_one_iff Pmf.toOuterMeasure_apply_eq_one_iff
+#align pmf.to_outer_measure_apply_eq_one_iff PMF.toOuterMeasure_apply_eq_one_iff
@[simp]
theorem toOuterMeasure_apply_inter_support :
p.toOuterMeasure (s ∩ p.support) = p.toOuterMeasure s := by
- simp only [toOuterMeasure_apply, Pmf.support, Set.indicator_inter_support]
-#align pmf.to_outer_measure_apply_inter_support Pmf.toOuterMeasure_apply_inter_support
+ simp only [toOuterMeasure_apply, PMF.support, Set.indicator_inter_support]
+#align pmf.to_outer_measure_apply_inter_support PMF.toOuterMeasure_apply_inter_support
/-- 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 :=
le_trans (le_of_eq (toOuterMeasure_apply_inter_support p s).symm) (p.toOuterMeasure.mono h)
-#align pmf.to_outer_measure_mono Pmf.toOuterMeasure_mono
+#align pmf.to_outer_measure_mono PMF.toOuterMeasure_mono
theorem toOuterMeasure_apply_eq_of_inter_support_eq {s t : Set α}
(h : s ∩ p.support = t ∩ p.support) : p.toOuterMeasure s = p.toOuterMeasure t :=
le_antisymm (p.toOuterMeasure_mono (h.symm ▸ Set.inter_subset_left t p.support))
(p.toOuterMeasure_mono (h ▸ Set.inter_subset_left s p.support))
-#align pmf.to_outer_measure_apply_eq_of_inter_support_eq Pmf.toOuterMeasure_apply_eq_of_inter_support_eq
+#align pmf.to_outer_measure_apply_eq_of_inter_support_eq PMF.toOuterMeasure_apply_eq_of_inter_support_eq
@[simp]
theorem toOuterMeasure_apply_fintype [Fintype α] : p.toOuterMeasure s = ∑ x, s.indicator p x :=
(p.toOuterMeasure_apply s).trans (tsum_eq_sum fun x h => absurd (Finset.mem_univ x) h)
-#align pmf.to_outer_measure_apply_fintype Pmf.toOuterMeasure_apply_fintype
+#align pmf.to_outer_measure_apply_fintype PMF.toOuterMeasure_apply_fintype
end OuterMeasure
@@ -240,50 +240,50 @@ section Measure
open MeasureTheory
-/-- Since every set is Carathéodory-measurable under `Pmf.toOuterMeasure`,
+/-- 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 α :=
+def toMeasure [MeasurableSpace α] (p : PMF α) : Measure α :=
p.toOuterMeasure.toMeasure ((toOuterMeasure_caratheodory p).symm ▸ le_top)
-#align pmf.to_measure Pmf.toMeasure
+#align pmf.to_measure PMF.toMeasure
-variable [MeasurableSpace α] (p : Pmf α) (s t : Set α)
+variable [MeasurableSpace α] (p : PMF α) (s t : Set α)
theorem toOuterMeasure_apply_le_toMeasure_apply : p.toOuterMeasure s ≤ p.toMeasure s :=
le_toMeasure_apply p.toOuterMeasure _ s
-#align pmf.to_outer_measure_apply_le_to_measure_apply Pmf.toOuterMeasure_apply_le_toMeasure_apply
+#align pmf.to_outer_measure_apply_le_to_measure_apply PMF.toOuterMeasure_apply_le_toMeasure_apply
theorem toMeasure_apply_eq_toOuterMeasure_apply (hs : MeasurableSet s) :
p.toMeasure s = p.toOuterMeasure s :=
toMeasure_apply p.toOuterMeasure _ hs
-#align pmf.to_measure_apply_eq_to_outer_measure_apply Pmf.toMeasure_apply_eq_toOuterMeasure_apply
+#align pmf.to_measure_apply_eq_to_outer_measure_apply PMF.toMeasure_apply_eq_toOuterMeasure_apply
theorem toMeasure_apply (hs : MeasurableSet s) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs).trans (p.toOuterMeasure_apply s)
-#align pmf.to_measure_apply Pmf.toMeasure_apply
+#align pmf.to_measure_apply PMF.toMeasure_apply
theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
p.toMeasure {a} = p a := by
simp [toMeasure_apply_eq_toOuterMeasure_apply _ _ h, toOuterMeasure_apply_singleton]
-#align pmf.to_measure_apply_singleton Pmf.toMeasure_apply_singleton
+#align pmf.to_measure_apply_singleton PMF.toMeasure_apply_singleton
theorem toMeasure_apply_eq_zero_iff (hs : MeasurableSet s) :
p.toMeasure s = 0 ↔ Disjoint p.support s := by
rw [toMeasure_apply_eq_toOuterMeasure_apply p s hs, toOuterMeasure_apply_eq_zero_iff]
-#align pmf.to_measure_apply_eq_zero_iff Pmf.toMeasure_apply_eq_zero_iff
+#align pmf.to_measure_apply_eq_zero_iff PMF.toMeasure_apply_eq_zero_iff
theorem toMeasure_apply_eq_one_iff (hs : MeasurableSet s) : p.toMeasure s = 1 ↔ p.support ⊆ s :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs).symm ▸ p.toOuterMeasure_apply_eq_one_iff s
-#align pmf.to_measure_apply_eq_one_iff Pmf.toMeasure_apply_eq_one_iff
+#align pmf.to_measure_apply_eq_one_iff PMF.toMeasure_apply_eq_one_iff
@[simp]
theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet p.support) :
p.toMeasure (s ∩ p.support) = p.toMeasure s := by
simp [p.toMeasure_apply_eq_toOuterMeasure_apply s hs,
p.toMeasure_apply_eq_toOuterMeasure_apply _ (hs.inter hp)]
-#align pmf.to_measure_apply_inter_support Pmf.toMeasure_apply_inter_support
+#align pmf.to_measure_apply_inter_support PMF.toMeasure_apply_inter_support
@[simp]
-theorem restrict_toMeasure_support [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) :
+theorem restrict_toMeasure_support [MeasurableSpace α] [MeasurableSingletonClass α] (p : PMF α) :
Measure.restrict (toMeasure p) (support p) = toMeasure p := by
ext s hs
apply (MeasureTheory.Measure.restrict_apply hs).trans
@@ -292,63 +292,63 @@ theorem restrict_toMeasure_support [MeasurableSpace α] [MeasurableSingletonClas
theorem toMeasure_mono {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
(h : s ∩ p.support ⊆ t) : p.toMeasure s ≤ p.toMeasure t := by
simpa only [p.toMeasure_apply_eq_toOuterMeasure_apply, hs, ht] using toOuterMeasure_mono p h
-#align pmf.to_measure_mono Pmf.toMeasure_mono
+#align pmf.to_measure_mono PMF.toMeasure_mono
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 := by
simpa only [p.toMeasure_apply_eq_toOuterMeasure_apply, hs, ht] using
toOuterMeasure_apply_eq_of_inter_support_eq p h
-#align pmf.to_measure_apply_eq_of_inter_support_eq Pmf.toMeasure_apply_eq_of_inter_support_eq
+#align pmf.to_measure_apply_eq_of_inter_support_eq PMF.toMeasure_apply_eq_of_inter_support_eq
section MeasurableSingletonClass
variable [MeasurableSingletonClass α]
-theorem toMeasure_injective : (toMeasure : Pmf α → Measure α).Injective := by
+theorem toMeasure_injective : (toMeasure : PMF α → Measure α).Injective := by
intro p q h
ext x
rw [← p.toMeasure_apply_singleton x <| measurableSet_singleton x,
← q.toMeasure_apply_singleton x <| measurableSet_singleton x, h]
-#align pmf.to_measure_injective Pmf.toMeasure_injective
+#align pmf.to_measure_injective PMF.toMeasure_injective
@[simp]
-theorem toMeasure_inj {p q : Pmf α} : p.toMeasure = q.toMeasure ↔ p = q :=
+theorem toMeasure_inj {p q : PMF α} : p.toMeasure = q.toMeasure ↔ p = q :=
toMeasure_injective.eq_iff
-#align pmf.to_measure_inj Pmf.toMeasure_inj
+#align pmf.to_measure_inj PMF.toMeasure_inj
@[simp]
theorem toMeasure_apply_finset (s : Finset α) : p.toMeasure s = ∑ x in s, p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.measurableSet).trans
(p.toOuterMeasure_apply_finset s)
-#align pmf.to_measure_apply_finset Pmf.toMeasure_apply_finset
+#align pmf.to_measure_apply_finset PMF.toMeasure_apply_finset
theorem toMeasure_apply_of_finite (hs : s.Finite) : p.toMeasure s = ∑' x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s hs.measurableSet).trans (p.toOuterMeasure_apply s)
-#align pmf.to_measure_apply_of_finite Pmf.toMeasure_apply_of_finite
+#align pmf.to_measure_apply_of_finite PMF.toMeasure_apply_of_finite
@[simp]
theorem toMeasure_apply_fintype [Fintype α] : p.toMeasure s = ∑ x, s.indicator p x :=
(p.toMeasure_apply_eq_toOuterMeasure_apply s s.toFinite.measurableSet).trans
(p.toOuterMeasure_apply_fintype s)
-#align pmf.to_measure_apply_fintype Pmf.toMeasure_apply_fintype
+#align pmf.to_measure_apply_fintype PMF.toMeasure_apply_fintype
end MeasurableSingletonClass
end Measure
-end Pmf
+end PMF
namespace MeasureTheory
-open Pmf
+open PMF
namespace Measure
/-- 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
+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 α :=
+def toPMF [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
+ [h : IsProbabilityMeasure μ] : PMF α :=
⟨fun x => μ ({x} : Set α),
ENNReal.summable.hasSum_iff.2
(_root_.trans
@@ -356,52 +356,52 @@ def toPmf [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ
(tsum_indicator_apply_singleton μ Set.univ MeasurableSet.univ).symm.trans
(tsum_congr fun x => congr_fun (Set.indicator_univ _) x))
h.measure_univ)⟩
-#align measure_theory.measure.to_pmf MeasureTheory.Measure.toPmf
+#align measure_theory.measure.to_pmf MeasureTheory.Measure.toPMF
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
[IsProbabilityMeasure μ]
-theorem toPmf_apply (x : α) : μ.toPmf x = μ {x} := rfl
-#align measure_theory.measure.to_pmf_apply MeasureTheory.Measure.toPmf_apply
+theorem toPMF_apply (x : α) : μ.toPMF x = μ {x} := rfl
+#align measure_theory.measure.to_pmf_apply MeasureTheory.Measure.toPMF_apply
@[simp]
-theorem toPmf_toMeasure : μ.toPmf.toMeasure = μ :=
+theorem toPMF_toMeasure : μ.toPMF.toMeasure = μ :=
Measure.ext fun s hs => by
- rw [μ.toPmf.toMeasure_apply s hs, ← μ.tsum_indicator_apply_singleton s hs]
+ rw [μ.toPMF.toMeasure_apply s hs, ← μ.tsum_indicator_apply_singleton s hs]
rfl
-#align measure_theory.measure.to_pmf_to_measure MeasureTheory.Measure.toPmf_toMeasure
+#align measure_theory.measure.to_pmf_to_measure MeasureTheory.Measure.toPMF_toMeasure
end Measure
end MeasureTheory
-namespace Pmf
+namespace PMF
open MeasureTheory
-/-- The measure associated to a `Pmf` by `toMeasure` is a probability measure. -/
-instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : Pmf α) :
+/-- The measure associated to a `PMF` by `toMeasure` is a probability measure. -/
+instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : PMF α) :
IsProbabilityMeasure p.toMeasure :=
⟨by
simpa only [MeasurableSet.univ, toMeasure_apply_eq_toOuterMeasure_apply, Set.indicator_univ,
toOuterMeasure_apply, ENNReal.coe_eq_one] using tsum_coe p⟩
-#align pmf.to_measure.is_probability_measure Pmf.toMeasure.isProbabilityMeasure
+#align pmf.to_measure.is_probability_measure PMF.toMeasure.isProbabilityMeasure
-variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) (μ : Measure α)
+variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : PMF α) (μ : Measure α)
[IsProbabilityMeasure μ]
@[simp]
-theorem toMeasure_toPmf : p.toMeasure.toPmf = p :=
- Pmf.ext fun x => by
- rw [← p.toMeasure_apply_singleton x (measurableSet_singleton x), p.toMeasure.toPmf_apply]
-#align pmf.to_measure_to_pmf Pmf.toMeasure_toPmf
+theorem toMeasure_toPMF : p.toMeasure.toPMF = p :=
+ PMF.ext fun x => by
+ rw [← p.toMeasure_apply_singleton x (measurableSet_singleton x), p.toMeasure.toPMF_apply]
+#align pmf.to_measure_to_pmf PMF.toMeasure_toPMF
-theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [IsProbabilityMeasure μ] :
- p.toMeasure = μ ↔ p = μ.toPmf := by rw [← toMeasure_inj, Measure.toPmf_toMeasure]
-#align pmf.to_measure_eq_iff_eq_to_pmf Pmf.toMeasure_eq_iff_eq_toPmf
+theorem toMeasure_eq_iff_eq_toPMF (μ : Measure α) [IsProbabilityMeasure μ] :
+ p.toMeasure = μ ↔ p = μ.toPMF := by rw [← toMeasure_inj, Measure.toPMF_toMeasure]
+#align pmf.to_measure_eq_iff_eq_to_pmf PMF.toMeasure_eq_iff_eq_toPMF
-theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [IsProbabilityMeasure μ] :
- μ.toPmf = p ↔ μ = p.toMeasure := by rw [← toMeasure_inj, Measure.toPmf_toMeasure]
-#align pmf.to_pmf_eq_iff_to_measure_eq Pmf.toPmf_eq_iff_toMeasure_eq
+theorem toPMF_eq_iff_toMeasure_eq (μ : Measure α) [IsProbabilityMeasure μ] :
+ μ.toPMF = p ↔ μ = p.toMeasure := by rw [← toMeasure_inj, Measure.toPMF_toMeasure]
+#align pmf.to_pmf_eq_iff_to_measure_eq PMF.toPMF_eq_iff_toMeasure_eq
-end Pmf
+end PMF
The main result is that the integral (i.e. the expected value) with regard to a
measure derived from a Pmf
is a sum weighted by the Pmf
.
It also provides the expected value for specific probability mass functions (bernoulli so far).
@@ -99,6 +99,10 @@ theorem support_nonempty (p : Pmf α) : p.support.Nonempty :=
Function.support_nonempty_iff.2 p.coe_ne_zero
#align pmf.support_nonempty Pmf.support_nonempty
+@[simp]
+theorem support_countable (p : Pmf α) : p.support.Countable :=
+ Summable.countable_support_ennreal (tsum_coe_ne_top p)
+
theorem apply_eq_zero_iff (p : Pmf α) (a : α) : p a = 0 ↔ a ∉ p.support := by
rw [mem_support_iff, Classical.not_not]
#align pmf.apply_eq_zero_iff Pmf.apply_eq_zero_iff
@@ -278,6 +282,13 @@ theorem toMeasure_apply_inter_support (hs : MeasurableSet s) (hp : MeasurableSet
p.toMeasure_apply_eq_toOuterMeasure_apply _ (hs.inter hp)]
#align pmf.to_measure_apply_inter_support Pmf.toMeasure_apply_inter_support
+@[simp]
+theorem restrict_toMeasure_support [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) :
+ Measure.restrict (toMeasure p) (support p) = toMeasure p := by
+ ext s hs
+ apply (MeasureTheory.Measure.restrict_apply hs).trans
+ apply toMeasure_apply_inter_support p s hs p.support_countable.measurableSet
+
theorem toMeasure_mono {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
(h : s ∩ p.support ⊆ t) : p.toMeasure s ≤ p.toMeasure t := by
simpa only [p.toMeasure_apply_eq_toOuterMeasure_apply, hs, ht] using toOuterMeasure_mono p h
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -34,7 +34,7 @@ probability mass function, discrete probability measure
noncomputable section
-variable {α β γ : Type _}
+variable {α β γ : Type*}
open Classical BigOperators NNReal ENNReal MeasureTheory
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Devon Tuma
-/
import Mathlib.Topology.Instances.ENNReal
-import Mathlib.MeasureTheory.Measure.MeasureSpace
+import Mathlib.MeasureTheory.Measure.Dirac
#align_import probability.probability_mass_function.basic from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d"
@@ -2,15 +2,12 @@
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Devon Tuma
-
-! This file was ported from Lean 3 source module probability.probability_mass_function.basic
-! leanprover-community/mathlib commit 4ac69b290818724c159de091daa3acd31da0ee6d
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Topology.Instances.ENNReal
import Mathlib.MeasureTheory.Measure.MeasureSpace
+#align_import probability.probability_mass_function.basic from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d"
+
/-!
# Probability mass functions
∑'
precedence (#5615)
∑
, ∏
and variants).([^a-zA-Zα-ωΑ-Ω'𝓝ℳ₀𝕂ₛ)]) \(([∑∏][^()∑∏]*,[^()∑∏:]*)\) ([⊂⊆=<≤])
replaced by $1 $2 $3
@@ -68,15 +68,15 @@ theorem hasSum_coe_one (p : Pmf α) : HasSum p 1 :=
#align pmf.has_sum_coe_one Pmf.hasSum_coe_one
@[simp]
-theorem tsum_coe (p : Pmf α) : (∑' a, p a) = 1 :=
+theorem tsum_coe (p : Pmf α) : ∑' a, p a = 1 :=
p.hasSum_coe_one.tsum_eq
#align pmf.tsum_coe Pmf.tsum_coe
-theorem tsum_coe_ne_top (p : Pmf α) : (∑' a, p a) ≠ ∞ :=
+theorem tsum_coe_ne_top (p : Pmf α) : ∑' a, p a ≠ ∞ :=
p.tsum_coe.symm ▸ ENNReal.one_ne_top
#align pmf.tsum_coe_ne_top Pmf.tsum_coe_ne_top
-theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : (∑' a, s.indicator p a) ≠ ∞ :=
+theorem tsum_coe_indicator_ne_top (p : Pmf α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞ :=
ne_of_lt (lt_of_le_of_lt
(tsum_le_tsum (fun _ => Set.indicator_apply_le fun _ => le_rfl) ENNReal.summable
ENNReal.summable)
@@ -128,7 +128,7 @@ theorem apply_eq_one_iff (p : Pmf α) (a : α) : p a = 1 ↔ p.support = {a} :=
_ = (∑' b, ite (b = a) (p b) 0) + ∑' b, ite (b = a) 0 (p b) := by
congr
exact symm (tsum_eq_single a fun b hb => if_neg hb)
- _ = ∑' b, ite (b = a) (p b) 0 + ite (b = a) 0 (p b) := ENNReal.tsum_add.symm
+ _ = ∑' b, (ite (b = a) (p b) 0 + ite (b = a) 0 (p b)) := ENNReal.tsum_add.symm
_ = ∑' b, p b := tsum_congr fun b => by split_ifs <;> simp only [zero_add, add_zero, le_rfl]
#align pmf.apply_eq_one_iff Pmf.apply_eq_one_iff
Is
of Foo
which is ported from is_foo
(#4639)
I have misported is_foo
to Foo
because I misunderstood the rule for IsLawfulFoo
.
This PR recover Is
of Foo
which is ported from is_foo
.
This PR also renames some misported theorems.
@@ -340,7 +340,7 @@ namespace Measure
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 : ProbabilityMeasure μ] : Pmf α :=
+ [h : IsProbabilityMeasure μ] : Pmf α :=
⟨fun x => μ ({x} : Set α),
ENNReal.summable.hasSum_iff.2
(_root_.trans
@@ -351,7 +351,7 @@ def toPmf [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ
#align measure_theory.measure.to_pmf MeasureTheory.Measure.toPmf
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (μ : Measure α)
- [ProbabilityMeasure μ]
+ [IsProbabilityMeasure μ]
theorem toPmf_apply (x : α) : μ.toPmf x = μ {x} := rfl
#align measure_theory.measure.to_pmf_apply MeasureTheory.Measure.toPmf_apply
@@ -372,15 +372,15 @@ namespace Pmf
open MeasureTheory
/-- The measure associated to a `Pmf` by `toMeasure` is a probability measure. -/
-instance toMeasure.probabilityMeasure [MeasurableSpace α] (p : Pmf α) :
- ProbabilityMeasure p.toMeasure :=
+instance toMeasure.isProbabilityMeasure [MeasurableSpace α] (p : Pmf α) :
+ IsProbabilityMeasure p.toMeasure :=
⟨by
simpa only [MeasurableSet.univ, toMeasure_apply_eq_toOuterMeasure_apply, Set.indicator_univ,
toOuterMeasure_apply, ENNReal.coe_eq_one] using tsum_coe p⟩
-#align pmf.to_measure.is_probability_measure Pmf.toMeasure.probabilityMeasure
+#align pmf.to_measure.is_probability_measure Pmf.toMeasure.isProbabilityMeasure
variable [Countable α] [MeasurableSpace α] [MeasurableSingletonClass α] (p : Pmf α) (μ : Measure α)
- [ProbabilityMeasure μ]
+ [IsProbabilityMeasure μ]
@[simp]
theorem toMeasure_toPmf : p.toMeasure.toPmf = p :=
@@ -388,11 +388,11 @@ theorem toMeasure_toPmf : p.toMeasure.toPmf = p :=
rw [← p.toMeasure_apply_singleton x (measurableSet_singleton x), p.toMeasure.toPmf_apply]
#align pmf.to_measure_to_pmf Pmf.toMeasure_toPmf
-theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [ProbabilityMeasure μ] :
+theorem toMeasure_eq_iff_eq_toPmf (μ : Measure α) [IsProbabilityMeasure μ] :
p.toMeasure = μ ↔ p = μ.toPmf := by rw [← toMeasure_inj, Measure.toPmf_toMeasure]
#align pmf.to_measure_eq_iff_eq_to_pmf Pmf.toMeasure_eq_iff_eq_toPmf
-theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [ProbabilityMeasure μ] :
+theorem toPmf_eq_iff_toMeasure_eq (μ : Measure α) [IsProbabilityMeasure μ] :
μ.toPmf = p ↔ μ = p.toMeasure := by rw [← toMeasure_inj, Measure.toPmf_toMeasure]
#align pmf.to_pmf_eq_iff_to_measure_eq Pmf.toPmf_eq_iff_toMeasure_eq
sSup
/iSup
(#3938)
As discussed on Zulip
supₛ
→ sSup
infₛ
→ sInf
supᵢ
→ iSup
infᵢ
→ iInf
bsupₛ
→ bsSup
binfₛ
→ bsInf
bsupᵢ
→ biSup
binfᵢ
→ biInf
csupₛ
→ csSup
cinfₛ
→ csInf
csupᵢ
→ ciSup
cinfᵢ
→ ciInf
unionₛ
→ sUnion
interₛ
→ sInter
unionᵢ
→ iUnion
interᵢ
→ iInter
bunionₛ
→ bsUnion
binterₛ
→ bsInter
bunionᵢ
→ biUnion
binterᵢ
→ biInter
Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
@@ -163,7 +163,7 @@ theorem toOuterMeasure_apply : p.toOuterMeasure s = ∑' x, s.indicator p x :=
@[simp]
theorem toOuterMeasure_caratheodory : p.toOuterMeasure.caratheodory = ⊤ := by
- refine' eq_top_iff.2 <| le_trans (le_infₛ fun x hx => _) (le_sum_caratheodory _)
+ refine' eq_top_iff.2 <| le_trans (le_sInf fun x hx => _) (le_sum_caratheodory _)
have ⟨y, hy⟩ := hx
exact
((le_of_eq (dirac_caratheodory y).symm).trans (le_smul_caratheodory _ _)).trans (le_of_eq hy)
The unported dependencies are
algebra.order.module
init.core
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
init.data.list.default
algebra.order.monoid.cancel.basic
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file