measure_theory.measure.portmanteauMathlib.MeasureTheory.Measure.Portmanteau

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -344,7 +344,7 @@ theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMea
   by
   have fs_lim' :
     ∀ ω, tendsto (fun n : ℕ => (fs n ω : ℝ≥0)) at_top (𝓝 (indicator E (fun x => (1 : ℝ≥0)) ω)) := by
-    rw [tendsto_pi_nhds] at fs_lim ; exact fun ω => fs_lim ω
+    rw [tendsto_pi_nhds] at fs_lim; exact fun ω => fs_lim ω
   apply
     measure_of_cont_bdd_of_tendsto_filter_indicator μ E_mble fs
       (eventually_of_forall fun n => eventually_of_forall (fs_bdd n)) (eventually_of_forall fs_lim')
@@ -366,7 +366,7 @@ theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [Measurab
     measure_of_cont_bdd_of_tendsto_indicator μ F_closed.measurable_set
       (fun n => thickenedIndicator (δs_pos n) F) fun n ω => thickenedIndicator_le_one (δs_pos n) F ω
   have key := thickenedIndicator_tendsto_indicator_closure δs_pos δs_lim F
-  rwa [F_closed.closure_eq] at key 
+  rwa [F_closed.closure_eq] at key
 #align measure_theory.tendsto_lintegral_thickened_indicator_of_is_closed MeasureTheory.tendsto_lintegral_thickenedIndicator_of_isClosed
 -/
 
@@ -505,7 +505,7 @@ theorem exists_null_frontier_thickening (μ : Measure Ω) [SigmaFinite μ] (s :
   have key := @measure.countable_meas_pos_of_disjoint_Union Ω _ _ μ _ _ mbles disjs
   have aux := @measure_diff_null ℝ _ volume (Ioo a b) _ (Set.Countable.measure_zero key volume)
   have len_pos : 0 < ENNReal.ofReal (b - a) := by simp only [hab, ENNReal.ofReal_pos, sub_pos]
-  rw [← Real.volume_Ioo, ← aux] at len_pos 
+  rw [← Real.volume_Ioo, ← aux] at len_pos
   rcases nonempty_of_measure_ne_zero len_pos.ne.symm with ⟨r, ⟨r_in_Ioo, hr⟩⟩
   refine' ⟨r, r_in_Ioo, _⟩
   simpa only [mem_set_of_eq, not_lt, le_zero_iff] using hr
Diff
@@ -386,7 +386,7 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
   intro ε ε_pos μ_F_finite
   set δs := fun n : ℕ => (1 : ℝ) / (n + 1) with def_δs
   have δs_pos : ∀ n, 0 < δs n := fun n => Nat.one_div_pos_of_nat
-  have δs_lim : tendsto δs at_top (𝓝 0) := tendsto_one_div_add_atTop_nhds_0_nat
+  have δs_lim : tendsto δs at_top (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat
   have key₁ :=
     tendsto_lintegral_thickened_indicator_of_is_closed (μ : Measure Ω) F_closed δs_pos δs_lim
   have room₁ : (μ : Measure Ω) F < (μ : Measure Ω) F + ε / 2 := by
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Kalle Kytölä. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kalle Kytölä
 -/
-import Mathbin.MeasureTheory.Measure.ProbabilityMeasure
-import Mathbin.MeasureTheory.Measure.Lebesgue.Basic
+import MeasureTheory.Measure.ProbabilityMeasure
+import MeasureTheory.Measure.Lebesgue.Basic
 
 #align_import measure_theory.measure.portmanteau from "leanprover-community/mathlib"@"660b3a2db3522fa0db036e569dc995a615c4c848"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Kalle Kytölä. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kalle Kytölä
-
-! This file was ported from Lean 3 source module measure_theory.measure.portmanteau
-! leanprover-community/mathlib commit 660b3a2db3522fa0db036e569dc995a615c4c848
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Measure.ProbabilityMeasure
 import Mathbin.MeasureTheory.Measure.Lebesgue.Basic
 
+#align_import measure_theory.measure.portmanteau from "leanprover-community/mathlib"@"660b3a2db3522fa0db036e569dc995a615c4c848"
+
 /-!
 # Characterizations of weak convergence of finite measures and probability measures
 
Diff
@@ -108,6 +108,7 @@ of measures.
 
 variable {Ω : Type _} [MeasurableSpace Ω]
 
+#print MeasureTheory.le_measure_compl_liminf_of_limsup_measure_le /-
 theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i E) ≤ μ E) :
@@ -133,14 +134,18 @@ theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter 
       (ENNReal.continuous_sub_left ENNReal.one_ne_top).ContinuousAt]
   exact antitone_const_tsub h
 #align measure_theory.le_measure_compl_liminf_of_limsup_measure_le MeasureTheory.le_measure_compl_liminf_of_limsup_measure_le
+-/
 
+#print MeasureTheory.le_measure_liminf_of_limsup_measure_compl_le /-
 theorem le_measure_liminf_of_limsup_measure_compl_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i (Eᶜ)) ≤ μ (Eᶜ)) :
     μ E ≤ L.liminf fun i => μs i E :=
   compl_compl E ▸ le_measure_compl_liminf_of_limsup_measure_le (MeasurableSet.compl E_mble) h
 #align measure_theory.le_measure_liminf_of_limsup_measure_compl_le MeasureTheory.le_measure_liminf_of_limsup_measure_compl_le
+-/
 
+#print MeasureTheory.limsup_measure_compl_le_of_le_liminf_measure /-
 theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ E ≤ L.liminf fun i => μs i E) :
@@ -166,16 +171,20 @@ theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter 
       (ENNReal.continuous_sub_left ENNReal.one_ne_top).ContinuousAt]
   exact antitone_const_tsub h
 #align measure_theory.limsup_measure_compl_le_of_le_liminf_measure MeasureTheory.limsup_measure_compl_le_of_le_liminf_measure
+-/
 
+#print MeasureTheory.limsup_measure_le_of_le_liminf_measure_compl /-
 theorem limsup_measure_le_of_le_liminf_measure_compl {ι : Type _} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ (Eᶜ) ≤ L.liminf fun i => μs i (Eᶜ)) :
     (L.limsup fun i => μs i E) ≤ μ E :=
   compl_compl E ▸ limsup_measure_compl_le_of_le_liminf_measure (MeasurableSet.compl E_mble) h
 #align measure_theory.limsup_measure_le_of_le_liminf_measure_compl MeasureTheory.limsup_measure_le_of_le_liminf_measure_compl
+-/
 
 variable [TopologicalSpace Ω] [OpensMeasurableSpace Ω]
 
+#print MeasureTheory.limsup_measure_closed_le_iff_liminf_measure_open_ge /-
 /-- One pair of implications of the portmanteau theorem:
 For a sequence of Borel probability measures, the following two are equivalent:
 
@@ -201,6 +210,7 @@ theorem limsup_measure_closed_le_iff_liminf_measure_open_ge {ι : Type _} {L : F
       limsup_measure_le_of_le_liminf_measure_compl F_closed.measurable_set
         (h (Fᶜ) (is_open_compl_iff.mpr F_closed))
 #align measure_theory.limsup_measure_closed_le_iff_liminf_measure_open_ge MeasureTheory.limsup_measure_closed_le_iff_liminf_measure_open_ge
+-/
 
 end LimsupClosedLeAndLeLiminfOpen
 
@@ -224,6 +234,7 @@ implies that
 
 variable {Ω : Type _} [MeasurableSpace Ω]
 
+#print MeasureTheory.tendsto_measure_of_le_liminf_measure_of_limsup_measure_le /-
 theorem tendsto_measure_of_le_liminf_measure_of_limsup_measure_le {ι : Type _} {L : Filter ι}
     {μ : Measure Ω} {μs : ι → Measure Ω} {E₀ E E₁ : Set Ω} (E₀_subset : E₀ ⊆ E) (subset_E₁ : E ⊆ E₁)
     (nulldiff : μ (E₁ \ E₀) = 0) (h_E₀ : μ E₀ ≤ L.liminf fun i => μs i E₀)
@@ -249,9 +260,11 @@ theorem tendsto_measure_of_le_liminf_measure_of_limsup_measure_le {ι : Type _}
     · refine' limsup_le_limsup (eventually_of_forall fun _ => measure_mono subset_E₁) _
       infer_param
 #align measure_theory.tendsto_measure_of_le_liminf_measure_of_limsup_measure_le MeasureTheory.tendsto_measure_of_le_liminf_measure_of_limsup_measure_le
+-/
 
 variable [TopologicalSpace Ω] [OpensMeasurableSpace Ω]
 
+#print MeasureTheory.tendsto_measure_of_null_frontier /-
 /-- One implication of the portmanteau theorem:
 For a sequence of Borel probability measures, if the liminf of the measures of any open set is at
 least the measure of the open set under a candidate limit measure, then for any set whose
@@ -267,6 +280,7 @@ theorem tendsto_measure_of_null_frontier {ι : Type _} {L : Filter ι} {μ : Mea
   tendsto_measure_of_le_liminf_measure_of_limsup_measure_le interior_subset subset_closure
     E_nullbdry (h_opens _ isOpen_interior) (h_closeds _ isClosed_closure)
 #align measure_theory.tendsto_measure_of_null_frontier MeasureTheory.tendsto_measure_of_null_frontier
+-/
 
 end TendstoOfNullFrontier
 
@@ -289,6 +303,7 @@ of `E` is the measure of `E` under the limit measure.
 
 variable {Ω : Type _} [MeasurableSpace Ω]
 
+#print MeasureTheory.measure_of_cont_bdd_of_tendsto_filter_indicator /-
 /-- If bounded continuous functions tend to the indicator of a measurable set and are
 uniformly bounded, then their integrals against a finite measure tend to the measure of the set.
 This formulation assumes:
@@ -312,7 +327,9 @@ theorem measure_of_cont_bdd_of_tendsto_filter_indicator {ι : Type _} {L : Filte
   simp_rw [← aux, lintegral_indicator _ E_mble]
   simp only [lintegral_one, measure.restrict_apply, MeasurableSet.univ, univ_inter]
 #align measure_theory.measure_of_cont_bdd_of_tendsto_filter_indicator MeasureTheory.measure_of_cont_bdd_of_tendsto_filter_indicator
+-/
 
+#print MeasureTheory.measure_of_cont_bdd_of_tendsto_indicator /-
 /-- If a sequence of bounded continuous functions tends to the indicator of a measurable set and
 the functions are uniformly bounded, then their integrals against a finite measure tend to the
 measure of the set.
@@ -335,7 +352,9 @@ theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMea
     measure_of_cont_bdd_of_tendsto_filter_indicator μ E_mble fs
       (eventually_of_forall fun n => eventually_of_forall (fs_bdd n)) (eventually_of_forall fs_lim')
 #align measure_theory.measure_of_cont_bdd_of_tendsto_indicator MeasureTheory.measure_of_cont_bdd_of_tendsto_indicator
+-/
 
+#print MeasureTheory.tendsto_lintegral_thickenedIndicator_of_isClosed /-
 /-- The integrals of thickened indicators of a closed set against a finite measure tend to the
 measure of the closed set if the thickening radii tend to zero.
 -/
@@ -352,7 +371,9 @@ theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [Measurab
   have key := thickenedIndicator_tendsto_indicator_closure δs_pos δs_lim F
   rwa [F_closed.closure_eq] at key 
 #align measure_theory.tendsto_lintegral_thickened_indicator_of_is_closed MeasureTheory.tendsto_lintegral_thickenedIndicator_of_isClosed
+-/
 
+#print MeasureTheory.FiniteMeasure.limsup_measure_closed_le_of_tendsto /-
 /-- One implication of the portmanteau theorem:
 Weak convergence of finite measures implies that the limsup of the measures of any closed set is
 at most the measure of the closed set under the limit measure.
@@ -397,7 +418,9 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
   apply le_trans (add_le_add (hM M rfl.le).le (le_refl (ε / 2 : ℝ≥0∞)))
   simp only [add_assoc, ENNReal.add_halves, le_refl]
 #align measure_theory.finite_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.FiniteMeasure.limsup_measure_closed_le_of_tendsto
+-/
 
+#print MeasureTheory.ProbabilityMeasure.limsup_measure_closed_le_of_tendsto /-
 /-- One implication of the portmanteau theorem:
 Weak convergence of probability measures implies that the limsup of the measures of any closed
 set is at most the measure of the closed set under the limit probability measure.
@@ -410,7 +433,9 @@ theorem ProbabilityMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _}
     finite_measure.limsup_measure_closed_le_of_tendsto
       ((probability_measure.tendsto_nhds_iff_to_finite_measures_tendsto_nhds L).mp μs_lim) F_closed
 #align measure_theory.probability_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.ProbabilityMeasure.limsup_measure_closed_le_of_tendsto
+-/
 
+#print MeasureTheory.ProbabilityMeasure.le_liminf_measure_open_of_tendsto /-
 /-- One implication of the portmanteau theorem:
 Weak convergence of probability measures implies that the liminf of the measures of any open set
 is at least the measure of the open set under the limit probability measure.
@@ -425,7 +450,9 @@ theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type _} {L
   le_measure_liminf_of_limsup_measure_compl_le G_open.measurable_set
     (h_closeds _ (is_closed_compl_iff.mpr G_open))
 #align measure_theory.probability_measure.le_liminf_measure_open_of_tendsto MeasureTheory.ProbabilityMeasure.le_liminf_measure_open_of_tendsto
+-/
 
+#print MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' /-
 theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι : Type _}
     {L : Filter ι} [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
     {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
@@ -435,7 +462,9 @@ theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι :
     fun G G_open => probability_measure.le_liminf_measure_open_of_tendsto μs_lim G_open
   tendsto_measure_of_null_frontier h_opens E_nullbdry
 #align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto' MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto'
+-/
 
+#print MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto /-
 /-- One implication of the portmanteau theorem:
 Weak convergence of probability measures implies that if the boundary of a Borel set
 carries no probability mass under the limit measure, then the limit of the measures of the set
@@ -454,6 +483,7 @@ theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι :
   have key := probability_measure.tendsto_measure_of_null_frontier_of_tendsto' μs_lim E_nullbdry'
   exact (ENNReal.tendsto_toNNReal (measure_ne_top (↑μ) E)).comp key
 #align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto
+-/
 
 end ConvergenceImpliesLimsupClosedLe
 
@@ -468,6 +498,7 @@ TODO: The proof of the implication is not yet here. Add it.
 
 variable {Ω : Type _} [PseudoEMetricSpace Ω] [MeasurableSpace Ω] [OpensMeasurableSpace Ω]
 
+#print MeasureTheory.exists_null_frontier_thickening /-
 theorem exists_null_frontier_thickening (μ : Measure Ω) [SigmaFinite μ] (s : Set Ω) {a b : ℝ}
     (hab : a < b) : ∃ r ∈ Ioo a b, μ (frontier (Metric.thickening r s)) = 0 :=
   by
@@ -482,7 +513,9 @@ theorem exists_null_frontier_thickening (μ : Measure Ω) [SigmaFinite μ] (s :
   refine' ⟨r, r_in_Ioo, _⟩
   simpa only [mem_set_of_eq, not_lt, le_zero_iff] using hr
 #align measure_theory.exists_null_frontier_thickening MeasureTheory.exists_null_frontier_thickening
+-/
 
+#print MeasureTheory.exists_null_frontiers_thickening /-
 theorem exists_null_frontiers_thickening (μ : Measure Ω) [SigmaFinite μ] (s : Set Ω) :
     ∃ rs : ℕ → ℝ,
       Tendsto rs atTop (𝓝 0) ∧ ∀ n, 0 < rs n ∧ μ (frontier (Metric.thickening (rs n) s)) = 0 :=
@@ -496,6 +529,7 @@ theorem exists_null_frontiers_thickening (μ : Measure Ω) [SigmaFinite μ] (s :
         (fun n => (obs n).choose_spec.some.1.le) fun n => (obs n).choose_spec.some.2.le
   · exact fun n => ⟨(obs n).choose_spec.some.1, (obs n).choose_spec.choose_spec⟩
 #align measure_theory.exists_null_frontiers_thickening MeasureTheory.exists_null_frontiers_thickening
+-/
 
 end LimitBorelImpliesLimsupClosedLe
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kalle Kytölä
 
 ! This file was ported from Lean 3 source module measure_theory.measure.portmanteau
-! leanprover-community/mathlib commit fd5edc43dc4f10b85abfe544b88f82cf13c5f844
+! leanprover-community/mathlib commit 660b3a2db3522fa0db036e569dc995a615c4c848
 ! 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.Lebesgue.Basic
 /-!
 # Characterizations of weak convergence of finite measures and probability measures
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file will provide portmanteau characterizations of the weak convergence of finite measures
 and of probability measures, i.e., the standard characterizations of convergence in distribution.
 
Diff
@@ -234,7 +234,6 @@ theorem tendsto_measure_of_le_liminf_measure_of_limsup_measure_le {ι : Type _}
       μ E = μ E₀ := measure_congr E₀_ae_eq_E.symm
       _ ≤ L.liminf fun i => μs i E₀ := h_E₀
       _ ≤ L.liminf fun i => μs i E := _
-      
     · refine' liminf_le_liminf (eventually_of_forall fun _ => measure_mono E₀_subset) _
       infer_param
   · have E_ae_eq_E₁ : E =ᵐ[μ] E₁ :=
@@ -244,7 +243,6 @@ theorem tendsto_measure_of_le_liminf_measure_of_limsup_measure_le {ι : Type _}
       (L.limsup fun i => μs i E) ≤ L.limsup fun i => μs i E₁ := _
       _ ≤ μ E₁ := h_E₁
       _ = μ E := measure_congr E_ae_eq_E₁.symm
-      
     · refine' limsup_le_limsup (eventually_of_forall fun _ => measure_mono subset_E₁) _
       infer_param
 #align measure_theory.tendsto_measure_of_le_liminf_measure_of_limsup_measure_le MeasureTheory.tendsto_measure_of_le_liminf_measure_of_limsup_measure_le
Diff
@@ -106,7 +106,7 @@ of measures.
 variable {Ω : Type _} [MeasurableSpace Ω]
 
 theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] {E : Set Ω}
+    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i E) ≤ μ E) :
     μ (Eᶜ) ≤ L.liminf fun i => μs i (Eᶜ) :=
   by
@@ -132,14 +132,14 @@ theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter 
 #align measure_theory.le_measure_compl_liminf_of_limsup_measure_le MeasureTheory.le_measure_compl_liminf_of_limsup_measure_le
 
 theorem le_measure_liminf_of_limsup_measure_compl_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] {E : Set Ω}
+    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i (Eᶜ)) ≤ μ (Eᶜ)) :
     μ E ≤ L.liminf fun i => μs i E :=
   compl_compl E ▸ le_measure_compl_liminf_of_limsup_measure_le (MeasurableSet.compl E_mble) h
 #align measure_theory.le_measure_liminf_of_limsup_measure_compl_le MeasureTheory.le_measure_liminf_of_limsup_measure_compl_le
 
 theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] {E : Set Ω}
+    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ E ≤ L.liminf fun i => μs i E) :
     (L.limsup fun i => μs i (Eᶜ)) ≤ μ (Eᶜ) :=
   by
@@ -165,7 +165,7 @@ theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter 
 #align measure_theory.limsup_measure_compl_le_of_le_liminf_measure MeasureTheory.limsup_measure_compl_le_of_le_liminf_measure
 
 theorem limsup_measure_le_of_le_liminf_measure_compl {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] {E : Set Ω}
+    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ (Eᶜ) ≤ L.liminf fun i => μs i (Eᶜ)) :
     (L.limsup fun i => μs i E) ≤ μ E :=
   compl_compl E ▸ limsup_measure_compl_le_of_le_liminf_measure (MeasurableSet.compl E_mble) h
@@ -183,7 +183,8 @@ under a candidate limit measure.
 under a candidate limit measure.
 -/
 theorem limsup_measure_closed_le_iff_liminf_measure_open_ge {ι : Type _} {L : Filter ι}
-    {μ : Measure Ω} {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] :
+    {μ : Measure Ω} {μs : ι → Measure Ω} [IsProbabilityMeasure μ]
+    [∀ i, IsProbabilityMeasure (μs i)] :
     (∀ F, IsClosed F → (L.limsup fun i => μs i F) ≤ μ F) ↔
       ∀ G, IsOpen G → μ G ≤ L.liminf fun i => μs i G :=
   by
@@ -257,7 +258,7 @@ boundary carries no probability mass under the candidate limit measure, then its
 sequence converge to its measure under the candidate limit measure.
 -/
 theorem tendsto_measure_of_null_frontier {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)]
+    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)]
     (h_opens : ∀ G, IsOpen G → μ G ≤ L.liminf fun i => μs i G) {E : Set Ω}
     (E_nullbdry : μ (frontier E) = 0) : L.Tendsto (fun i => μs i E) (𝓝 (μ E)) :=
   haveI h_closeds : ∀ F, IsClosed F → (L.limsup fun i => μs i F) ≤ μ F :=
@@ -296,7 +297,7 @@ This formulation assumes:
 -/
 theorem measure_of_cont_bdd_of_tendsto_filter_indicator {ι : Type _} {L : Filter ι}
     [L.IsCountablyGenerated] [TopologicalSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω)
-    [FiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E) (fs : ι → Ω →ᵇ ℝ≥0)
+    [IsFiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E) (fs : ι → Ω →ᵇ ℝ≥0)
     (fs_bdd : ∀ᶠ i in L, ∀ᵐ ω : Ω ∂μ, fs i ω ≤ c)
     (fs_lim :
       ∀ᵐ ω : Ω ∂μ,
@@ -319,7 +320,7 @@ A similar result with more general assumptions is
 `measure_theory.measure_of_cont_bdd_of_tendsto_filter_indicator`.
 -/
 theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMeasurableSpace Ω]
-    (μ : Measure Ω) [FiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E)
+    (μ : Measure Ω) [IsFiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E)
     (fs : ℕ → Ω →ᵇ ℝ≥0) (fs_bdd : ∀ n ω, fs n ω ≤ c)
     (fs_lim :
       Tendsto (fun n : ℕ => (coeFn : (Ω →ᵇ ℝ≥0) → Ω → ℝ≥0) (fs n)) atTop
@@ -338,7 +339,7 @@ theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMea
 measure of the closed set if the thickening radii tend to zero.
 -/
 theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [MeasurableSpace Ω]
-    [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω) [FiniteMeasure μ] {F : Set Ω}
+    [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] {F : Set Ω}
     (F_closed : IsClosed F) {δs : ℕ → ℝ} (δs_pos : ∀ n, 0 < δs n)
     (δs_lim : Tendsto δs atTop (𝓝 0)) :
     Tendsto (fun n => lintegral μ fun ω => (thickenedIndicator (δs_pos n) F ω : ℝ≥0∞)) atTop
@@ -355,10 +356,10 @@ theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [Measurab
 Weak convergence of finite measures implies that the limsup of the measures of any closed set is
 at most the measure of the closed set under the limit measure.
 -/
-theorem FiniteMeasureCat.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : FiniteMeasureCat Ω}
-    {μs : ι → FiniteMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω}
-    (F_closed : IsClosed F) : (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F :=
+theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : FiniteMeasure Ω}
+    {μs : ι → FiniteMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω} (F_closed : IsClosed F) :
+    (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F :=
   by
   by_cases L = ⊥
   · simp only [h, limsup, Filter.map_bot, Limsup_bot, ENNReal.bot_eq_zero, zero_le]
@@ -394,46 +395,45 @@ theorem FiniteMeasureCat.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L
   rw [limsup_const]
   apply le_trans (add_le_add (hM M rfl.le).le (le_refl (ε / 2 : ℝ≥0∞)))
   simp only [add_assoc, ENNReal.add_halves, le_refl]
-#align measure_theory.finite_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.FiniteMeasureCat.limsup_measure_closed_le_of_tendsto
+#align measure_theory.finite_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.FiniteMeasure.limsup_measure_closed_le_of_tendsto
 
 /-- One implication of the portmanteau theorem:
 Weak convergence of probability measures implies that the limsup of the measures of any closed
 set is at most the measure of the closed set under the limit probability measure.
 -/
-theorem ProbabilityMeasureCat.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
-    {μ : ProbabilityMeasureCat Ω} {μs : ι → ProbabilityMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ))
-    {F : Set Ω} (F_closed : IsClosed F) :
-    (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
+theorem ProbabilityMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
+    {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω}
+    (F_closed : IsClosed F) : (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
   apply
     finite_measure.limsup_measure_closed_le_of_tendsto
       ((probability_measure.tendsto_nhds_iff_to_finite_measures_tendsto_nhds L).mp μs_lim) F_closed
-#align measure_theory.probability_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.ProbabilityMeasureCat.limsup_measure_closed_le_of_tendsto
+#align measure_theory.probability_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.ProbabilityMeasure.limsup_measure_closed_le_of_tendsto
 
 /-- One implication of the portmanteau theorem:
 Weak convergence of probability measures implies that the liminf of the measures of any open set
 is at least the measure of the open set under the limit probability measure.
 -/
-theorem ProbabilityMeasureCat.le_liminf_measure_open_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
-    {μ : ProbabilityMeasureCat Ω} {μs : ι → ProbabilityMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ))
-    {G : Set Ω} (G_open : IsOpen G) : (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
+theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type _} {L : Filter ι}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
+    {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {G : Set Ω} (G_open : IsOpen G) :
+    (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
   haveI h_closeds :
     ∀ F, IsClosed F → (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F :=
     fun F F_closed => probability_measure.limsup_measure_closed_le_of_tendsto μs_lim F_closed
   le_measure_liminf_of_limsup_measure_compl_le G_open.measurable_set
     (h_closeds _ (is_closed_compl_iff.mpr G_open))
-#align measure_theory.probability_measure.le_liminf_measure_open_of_tendsto MeasureTheory.ProbabilityMeasureCat.le_liminf_measure_open_of_tendsto
+#align measure_theory.probability_measure.le_liminf_measure_open_of_tendsto MeasureTheory.ProbabilityMeasure.le_liminf_measure_open_of_tendsto
 
-theorem ProbabilityMeasureCat.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι : Type _}
+theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι : Type _}
     {L : Filter ι} [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
-    {μ : ProbabilityMeasureCat Ω} {μs : ι → ProbabilityMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ))
+    {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
     {E : Set Ω} (E_nullbdry : (μ : Measure Ω) (frontier E) = 0) :
     Tendsto (fun i => (μs i : Measure Ω) E) L (𝓝 ((μ : Measure Ω) E)) :=
   haveI h_opens : ∀ G, IsOpen G → (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
     fun G G_open => probability_measure.le_liminf_measure_open_of_tendsto μs_lim G_open
   tendsto_measure_of_null_frontier h_opens E_nullbdry
-#align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto' MeasureTheory.ProbabilityMeasureCat.tendsto_measure_of_null_frontier_of_tendsto'
+#align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto' MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto'
 
 /-- One implication of the portmanteau theorem:
 Weak convergence of probability measures implies that if the boundary of a Borel set
@@ -443,16 +443,16 @@ equals the measure of the set under the limit probability measure.
 A version with coercions to ordinary `ℝ≥0∞`-valued measures is
 `measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto'`.
 -/
-theorem ProbabilityMeasureCat.tendsto_measure_of_null_frontier_of_tendsto {Ω ι : Type _}
-    {L : Filter ι} [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
-    {μ : ProbabilityMeasureCat Ω} {μs : ι → ProbabilityMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ))
-    {E : Set Ω} (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E)) :=
+theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι : Type _} {L : Filter ι}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
+    {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {E : Set Ω}
+    (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E)) :=
   by
   have E_nullbdry' : (μ : Measure Ω) (frontier E) = 0 := by
     rw [← probability_measure.ennreal_coe_fn_eq_coe_fn_to_measure, E_nullbdry, ENNReal.coe_zero]
   have key := probability_measure.tendsto_measure_of_null_frontier_of_tendsto' μs_lim E_nullbdry'
   exact (ENNReal.tendsto_toNNReal (measure_ne_top (↑μ) E)).comp key
-#align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto MeasureTheory.ProbabilityMeasureCat.tendsto_measure_of_null_frontier_of_tendsto
+#align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto
 
 end ConvergenceImpliesLimsupClosedLe
 
Diff
@@ -328,7 +328,7 @@ theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMea
   by
   have fs_lim' :
     ∀ ω, tendsto (fun n : ℕ => (fs n ω : ℝ≥0)) at_top (𝓝 (indicator E (fun x => (1 : ℝ≥0)) ω)) := by
-    rw [tendsto_pi_nhds] at fs_lim; exact fun ω => fs_lim ω
+    rw [tendsto_pi_nhds] at fs_lim ; exact fun ω => fs_lim ω
   apply
     measure_of_cont_bdd_of_tendsto_filter_indicator μ E_mble fs
       (eventually_of_forall fun n => eventually_of_forall (fs_bdd n)) (eventually_of_forall fs_lim')
@@ -348,7 +348,7 @@ theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [Measurab
     measure_of_cont_bdd_of_tendsto_indicator μ F_closed.measurable_set
       (fun n => thickenedIndicator (δs_pos n) F) fun n ω => thickenedIndicator_le_one (δs_pos n) F ω
   have key := thickenedIndicator_tendsto_indicator_closure δs_pos δs_lim F
-  rwa [F_closed.closure_eq] at key
+  rwa [F_closed.closure_eq] at key 
 #align measure_theory.tendsto_lintegral_thickened_indicator_of_is_closed MeasureTheory.tendsto_lintegral_thickenedIndicator_of_isClosed
 
 /-- One implication of the portmanteau theorem:
@@ -476,7 +476,7 @@ theorem exists_null_frontier_thickening (μ : Measure Ω) [SigmaFinite μ] (s :
   have key := @measure.countable_meas_pos_of_disjoint_Union Ω _ _ μ _ _ mbles disjs
   have aux := @measure_diff_null ℝ _ volume (Ioo a b) _ (Set.Countable.measure_zero key volume)
   have len_pos : 0 < ENNReal.ofReal (b - a) := by simp only [hab, ENNReal.ofReal_pos, sub_pos]
-  rw [← Real.volume_Ioo, ← aux] at len_pos
+  rw [← Real.volume_Ioo, ← aux] at len_pos 
   rcases nonempty_of_measure_ne_zero len_pos.ne.symm with ⟨r, ⟨r_in_Ioo, hr⟩⟩
   refine' ⟨r, r_in_Ioo, _⟩
   simpa only [mem_set_of_eq, not_lt, le_zero_iff] using hr
Diff
@@ -84,7 +84,7 @@ open Filter
 
 open BoundedContinuousFunction
 
-open Topology ENNReal NNReal BoundedContinuousFunction
+open scoped Topology ENNReal NNReal BoundedContinuousFunction
 
 namespace MeasureTheory
 
Diff
@@ -327,10 +327,8 @@ theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMea
     Tendsto (fun n => lintegral μ fun ω => fs n ω) atTop (𝓝 (μ E)) :=
   by
   have fs_lim' :
-    ∀ ω, tendsto (fun n : ℕ => (fs n ω : ℝ≥0)) at_top (𝓝 (indicator E (fun x => (1 : ℝ≥0)) ω)) :=
-    by
-    rw [tendsto_pi_nhds] at fs_lim
-    exact fun ω => fs_lim ω
+    ∀ ω, tendsto (fun n : ℕ => (fs n ω : ℝ≥0)) at_top (𝓝 (indicator E (fun x => (1 : ℝ≥0)) ω)) := by
+    rw [tendsto_pi_nhds] at fs_lim; exact fun ω => fs_lim ω
   apply
     measure_of_cont_bdd_of_tendsto_filter_indicator μ E_mble fs
       (eventually_of_forall fun n => eventually_of_forall (fs_bdd n)) (eventually_of_forall fs_lim')
Diff
@@ -4,12 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kalle Kytölä
 
 ! This file was ported from Lean 3 source module measure_theory.measure.portmanteau
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit fd5edc43dc4f10b85abfe544b88f82cf13c5f844
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Measure.ProbabilityMeasure
-import Mathbin.MeasureTheory.Measure.Lebesgue
+import Mathbin.MeasureTheory.Measure.Lebesgue.Basic
 
 /-!
 # Characterizations of weak convergence of finite measures and probability measures
Diff
@@ -106,7 +106,7 @@ of measures.
 variable {Ω : Type _} [MeasurableSpace Ω]
 
 theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
+    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i E) ≤ μ E) :
     μ (Eᶜ) ≤ L.liminf fun i => μs i (Eᶜ) :=
   by
@@ -132,14 +132,14 @@ theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter 
 #align measure_theory.le_measure_compl_liminf_of_limsup_measure_le MeasureTheory.le_measure_compl_liminf_of_limsup_measure_le
 
 theorem le_measure_liminf_of_limsup_measure_compl_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
+    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i (Eᶜ)) ≤ μ (Eᶜ)) :
     μ E ≤ L.liminf fun i => μs i E :=
   compl_compl E ▸ le_measure_compl_liminf_of_limsup_measure_le (MeasurableSet.compl E_mble) h
 #align measure_theory.le_measure_liminf_of_limsup_measure_compl_le MeasureTheory.le_measure_liminf_of_limsup_measure_compl_le
 
 theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
+    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ E ≤ L.liminf fun i => μs i E) :
     (L.limsup fun i => μs i (Eᶜ)) ≤ μ (Eᶜ) :=
   by
@@ -165,7 +165,7 @@ theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter 
 #align measure_theory.limsup_measure_compl_le_of_le_liminf_measure MeasureTheory.limsup_measure_compl_le_of_le_liminf_measure
 
 theorem limsup_measure_le_of_le_liminf_measure_compl {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
+    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ (Eᶜ) ≤ L.liminf fun i => μs i (Eᶜ)) :
     (L.limsup fun i => μs i E) ≤ μ E :=
   compl_compl E ▸ limsup_measure_compl_le_of_le_liminf_measure (MeasurableSet.compl E_mble) h
@@ -183,8 +183,7 @@ under a candidate limit measure.
 under a candidate limit measure.
 -/
 theorem limsup_measure_closed_le_iff_liminf_measure_open_ge {ι : Type _} {L : Filter ι}
-    {μ : Measure Ω} {μs : ι → Measure Ω} [IsProbabilityMeasure μ]
-    [∀ i, IsProbabilityMeasure (μs i)] :
+    {μ : Measure Ω} {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)] :
     (∀ F, IsClosed F → (L.limsup fun i => μs i F) ≤ μ F) ↔
       ∀ G, IsOpen G → μ G ≤ L.liminf fun i => μs i G :=
   by
@@ -258,7 +257,7 @@ boundary carries no probability mass under the candidate limit measure, then its
 sequence converge to its measure under the candidate limit measure.
 -/
 theorem tendsto_measure_of_null_frontier {ι : Type _} {L : Filter ι} {μ : Measure Ω}
-    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)]
+    {μs : ι → Measure Ω} [ProbabilityMeasure μ] [∀ i, ProbabilityMeasure (μs i)]
     (h_opens : ∀ G, IsOpen G → μ G ≤ L.liminf fun i => μs i G) {E : Set Ω}
     (E_nullbdry : μ (frontier E) = 0) : L.Tendsto (fun i => μs i E) (𝓝 (μ E)) :=
   haveI h_closeds : ∀ F, IsClosed F → (L.limsup fun i => μs i F) ≤ μ F :=
@@ -297,7 +296,7 @@ This formulation assumes:
 -/
 theorem measure_of_cont_bdd_of_tendsto_filter_indicator {ι : Type _} {L : Filter ι}
     [L.IsCountablyGenerated] [TopologicalSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω)
-    [IsFiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E) (fs : ι → Ω →ᵇ ℝ≥0)
+    [FiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E) (fs : ι → Ω →ᵇ ℝ≥0)
     (fs_bdd : ∀ᶠ i in L, ∀ᵐ ω : Ω ∂μ, fs i ω ≤ c)
     (fs_lim :
       ∀ᵐ ω : Ω ∂μ,
@@ -320,7 +319,7 @@ A similar result with more general assumptions is
 `measure_theory.measure_of_cont_bdd_of_tendsto_filter_indicator`.
 -/
 theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMeasurableSpace Ω]
-    (μ : Measure Ω) [IsFiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E)
+    (μ : Measure Ω) [FiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E)
     (fs : ℕ → Ω →ᵇ ℝ≥0) (fs_bdd : ∀ n ω, fs n ω ≤ c)
     (fs_lim :
       Tendsto (fun n : ℕ => (coeFn : (Ω →ᵇ ℝ≥0) → Ω → ℝ≥0) (fs n)) atTop
@@ -341,7 +340,7 @@ theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMea
 measure of the closed set if the thickening radii tend to zero.
 -/
 theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [MeasurableSpace Ω]
-    [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] {F : Set Ω}
+    [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω) [FiniteMeasure μ] {F : Set Ω}
     (F_closed : IsClosed F) {δs : ℕ → ℝ} (δs_pos : ∀ n, 0 < δs n)
     (δs_lim : Tendsto δs atTop (𝓝 0)) :
     Tendsto (fun n => lintegral μ fun ω => (thickenedIndicator (δs_pos n) F ω : ℝ≥0∞)) atTop
@@ -358,10 +357,10 @@ theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [Measurab
 Weak convergence of finite measures implies that the limsup of the measures of any closed set is
 at most the measure of the closed set under the limit measure.
 -/
-theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : FiniteMeasure Ω}
-    {μs : ι → FiniteMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω} (F_closed : IsClosed F) :
-    (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F :=
+theorem FiniteMeasureCat.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : FiniteMeasureCat Ω}
+    {μs : ι → FiniteMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω}
+    (F_closed : IsClosed F) : (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F :=
   by
   by_cases L = ⊥
   · simp only [h, limsup, Filter.map_bot, Limsup_bot, ENNReal.bot_eq_zero, zero_le]
@@ -397,45 +396,46 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
   rw [limsup_const]
   apply le_trans (add_le_add (hM M rfl.le).le (le_refl (ε / 2 : ℝ≥0∞)))
   simp only [add_assoc, ENNReal.add_halves, le_refl]
-#align measure_theory.finite_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.FiniteMeasure.limsup_measure_closed_le_of_tendsto
+#align measure_theory.finite_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.FiniteMeasureCat.limsup_measure_closed_le_of_tendsto
 
 /-- One implication of the portmanteau theorem:
 Weak convergence of probability measures implies that the limsup of the measures of any closed
 set is at most the measure of the closed set under the limit probability measure.
 -/
-theorem ProbabilityMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
-    {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω}
-    (F_closed : IsClosed F) : (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
+theorem ProbabilityMeasureCat.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
+    {μ : ProbabilityMeasureCat Ω} {μs : ι → ProbabilityMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ))
+    {F : Set Ω} (F_closed : IsClosed F) :
+    (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
   apply
     finite_measure.limsup_measure_closed_le_of_tendsto
       ((probability_measure.tendsto_nhds_iff_to_finite_measures_tendsto_nhds L).mp μs_lim) F_closed
-#align measure_theory.probability_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.ProbabilityMeasure.limsup_measure_closed_le_of_tendsto
+#align measure_theory.probability_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.ProbabilityMeasureCat.limsup_measure_closed_le_of_tendsto
 
 /-- One implication of the portmanteau theorem:
 Weak convergence of probability measures implies that the liminf of the measures of any open set
 is at least the measure of the open set under the limit probability measure.
 -/
-theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
-    {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {G : Set Ω} (G_open : IsOpen G) :
-    (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
+theorem ProbabilityMeasureCat.le_liminf_measure_open_of_tendsto {Ω ι : Type _} {L : Filter ι}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
+    {μ : ProbabilityMeasureCat Ω} {μs : ι → ProbabilityMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ))
+    {G : Set Ω} (G_open : IsOpen G) : (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
   haveI h_closeds :
     ∀ F, IsClosed F → (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F :=
     fun F F_closed => probability_measure.limsup_measure_closed_le_of_tendsto μs_lim F_closed
   le_measure_liminf_of_limsup_measure_compl_le G_open.measurable_set
     (h_closeds _ (is_closed_compl_iff.mpr G_open))
-#align measure_theory.probability_measure.le_liminf_measure_open_of_tendsto MeasureTheory.ProbabilityMeasure.le_liminf_measure_open_of_tendsto
+#align measure_theory.probability_measure.le_liminf_measure_open_of_tendsto MeasureTheory.ProbabilityMeasureCat.le_liminf_measure_open_of_tendsto
 
-theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι : Type _}
+theorem ProbabilityMeasureCat.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι : Type _}
     {L : Filter ι} [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
-    {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
+    {μ : ProbabilityMeasureCat Ω} {μs : ι → ProbabilityMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ))
     {E : Set Ω} (E_nullbdry : (μ : Measure Ω) (frontier E) = 0) :
     Tendsto (fun i => (μs i : Measure Ω) E) L (𝓝 ((μ : Measure Ω) E)) :=
   haveI h_opens : ∀ G, IsOpen G → (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
     fun G G_open => probability_measure.le_liminf_measure_open_of_tendsto μs_lim G_open
   tendsto_measure_of_null_frontier h_opens E_nullbdry
-#align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto' MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto'
+#align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto' MeasureTheory.ProbabilityMeasureCat.tendsto_measure_of_null_frontier_of_tendsto'
 
 /-- One implication of the portmanteau theorem:
 Weak convergence of probability measures implies that if the boundary of a Borel set
@@ -445,16 +445,16 @@ equals the measure of the set under the limit probability measure.
 A version with coercions to ordinary `ℝ≥0∞`-valued measures is
 `measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto'`.
 -/
-theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
-    {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {E : Set Ω}
-    (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E)) :=
+theorem ProbabilityMeasureCat.tendsto_measure_of_null_frontier_of_tendsto {Ω ι : Type _}
+    {L : Filter ι} [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
+    {μ : ProbabilityMeasureCat Ω} {μs : ι → ProbabilityMeasureCat Ω} (μs_lim : Tendsto μs L (𝓝 μ))
+    {E : Set Ω} (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E)) :=
   by
   have E_nullbdry' : (μ : Measure Ω) (frontier E) = 0 := by
     rw [← probability_measure.ennreal_coe_fn_eq_coe_fn_to_measure, E_nullbdry, ENNReal.coe_zero]
   have key := probability_measure.tendsto_measure_of_null_frontier_of_tendsto' μs_lim E_nullbdry'
   exact (ENNReal.tendsto_toNNReal (measure_ne_top (↑μ) E)).comp key
-#align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto
+#align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto MeasureTheory.ProbabilityMeasureCat.tendsto_measure_of_null_frontier_of_tendsto
 
 end ConvergenceImpliesLimsupClosedLe
 
Diff
@@ -341,7 +341,7 @@ theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMea
 measure of the closed set if the thickening radii tend to zero.
 -/
 theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [MeasurableSpace Ω]
-    [PseudoEmetricSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] {F : Set Ω}
+    [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] {F : Set Ω}
     (F_closed : IsClosed F) {δs : ℕ → ℝ} (δs_pos : ∀ n, 0 < δs n)
     (δs_lim : Tendsto δs atTop (𝓝 0)) :
     Tendsto (fun n => lintegral μ fun ω => (thickenedIndicator (δs_pos n) F ω : ℝ≥0∞)) atTop
@@ -359,7 +359,7 @@ Weak convergence of finite measures implies that the limsup of the measures of a
 at most the measure of the closed set under the limit measure.
 -/
 theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEmetricSpace Ω] [OpensMeasurableSpace Ω] {μ : FiniteMeasure Ω}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : FiniteMeasure Ω}
     {μs : ι → FiniteMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω} (F_closed : IsClosed F) :
     (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F :=
   by
@@ -404,7 +404,7 @@ Weak convergence of probability measures implies that the limsup of the measures
 set is at most the measure of the closed set under the limit probability measure.
 -/
 theorem ProbabilityMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEmetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
     {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω}
     (F_closed : IsClosed F) : (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
   apply
@@ -417,7 +417,7 @@ Weak convergence of probability measures implies that the liminf of the measures
 is at least the measure of the open set under the limit probability measure.
 -/
 theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEmetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
     {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {G : Set Ω} (G_open : IsOpen G) :
     (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
   haveI h_closeds :
@@ -428,7 +428,7 @@ theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type _} {L
 #align measure_theory.probability_measure.le_liminf_measure_open_of_tendsto MeasureTheory.ProbabilityMeasure.le_liminf_measure_open_of_tendsto
 
 theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι : Type _}
-    {L : Filter ι} [MeasurableSpace Ω] [PseudoEmetricSpace Ω] [OpensMeasurableSpace Ω]
+    {L : Filter ι} [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
     {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
     {E : Set Ω} (E_nullbdry : (μ : Measure Ω) (frontier E) = 0) :
     Tendsto (fun i => (μs i : Measure Ω) E) L (𝓝 ((μ : Measure Ω) E)) :=
@@ -446,7 +446,7 @@ A version with coercions to ordinary `ℝ≥0∞`-valued measures is
 `measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto'`.
 -/
 theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι : Type _} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEmetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
     {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {E : Set Ω}
     (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E)) :=
   by
@@ -467,7 +467,7 @@ TODO: The proof of the implication is not yet here. Add it.
 -/
 
 
-variable {Ω : Type _} [PseudoEmetricSpace Ω] [MeasurableSpace Ω] [OpensMeasurableSpace Ω]
+variable {Ω : Type _} [PseudoEMetricSpace Ω] [MeasurableSpace Ω] [OpensMeasurableSpace Ω]
 
 theorem exists_null_frontier_thickening (μ : Measure Ω) [SigmaFinite μ] (s : Set Ω) {a b : ℝ}
     (hab : a < b) : ∃ r ∈ Ioo a b, μ (frontier (Metric.thickening r s)) = 0 :=
Diff
@@ -84,7 +84,7 @@ open Filter
 
 open BoundedContinuousFunction
 
-open Topology Ennreal NNReal BoundedContinuousFunction
+open Topology ENNReal NNReal BoundedContinuousFunction
 
 namespace MeasureTheory
 
@@ -127,7 +127,7 @@ theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter 
   rw [obs]
   simp_rw [←
     antitone_const_tsub.map_limsup_of_continuous_at (fun i => μs i E)
-      (Ennreal.continuous_sub_left Ennreal.one_ne_top).ContinuousAt]
+      (ENNReal.continuous_sub_left ENNReal.one_ne_top).ContinuousAt]
   exact antitone_const_tsub h
 #align measure_theory.le_measure_compl_liminf_of_limsup_measure_le MeasureTheory.le_measure_compl_liminf_of_limsup_measure_le
 
@@ -160,7 +160,7 @@ theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter 
   rw [obs]
   simp_rw [←
     antitone_const_tsub.map_liminf_of_continuous_at (fun i => μs i E)
-      (Ennreal.continuous_sub_left Ennreal.one_ne_top).ContinuousAt]
+      (ENNReal.continuous_sub_left ENNReal.one_ne_top).ContinuousAt]
   exact antitone_const_tsub h
 #align measure_theory.limsup_measure_compl_le_of_le_liminf_measure MeasureTheory.limsup_measure_compl_le_of_le_liminf_measure
 
@@ -307,7 +307,7 @@ theorem measure_of_cont_bdd_of_tendsto_filter_indicator {ι : Type _} {L : Filte
   by
   convert finite_measure.tendsto_lintegral_nn_filter_of_le_const μ fs_bdd fs_lim
   have aux : ∀ ω, indicator E (fun ω => (1 : ℝ≥0∞)) ω = ↑(indicator E (fun ω => (1 : ℝ≥0)) ω) :=
-    fun ω => by simp only [Ennreal.coe_indicator, Ennreal.coe_one]
+    fun ω => by simp only [ENNReal.coe_indicator, ENNReal.coe_one]
   simp_rw [← aux, lintegral_indicator _ E_mble]
   simp only [lintegral_one, measure.restrict_apply, MeasurableSet.univ, univ_inter]
 #align measure_theory.measure_of_cont_bdd_of_tendsto_filter_indicator MeasureTheory.measure_of_cont_bdd_of_tendsto_filter_indicator
@@ -364,8 +364,8 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
     (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F :=
   by
   by_cases L = ⊥
-  · simp only [h, limsup, Filter.map_bot, Limsup_bot, Ennreal.bot_eq_zero, zero_le]
-  apply Ennreal.le_of_forall_pos_le_add
+  · simp only [h, limsup, Filter.map_bot, Limsup_bot, ENNReal.bot_eq_zero, zero_le]
+  apply ENNReal.le_of_forall_pos_le_add
   intro ε ε_pos μ_F_finite
   set δs := fun n : ℕ => (1 : ℝ) / (n + 1) with def_δs
   have δs_pos : ∀ n, 0 < δs n := fun n => Nat.one_div_pos_of_nat
@@ -374,8 +374,8 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
     tendsto_lintegral_thickened_indicator_of_is_closed (μ : Measure Ω) F_closed δs_pos δs_lim
   have room₁ : (μ : Measure Ω) F < (μ : Measure Ω) F + ε / 2 := by
     apply
-      Ennreal.lt_add_right (measure_lt_top (μ : Measure Ω) F).Ne
-        (ennreal.div_pos_iff.mpr ⟨(ennreal.coe_pos.mpr ε_pos).Ne.symm, Ennreal.two_ne_top⟩).Ne.symm
+      ENNReal.lt_add_right (measure_lt_top (μ : Measure Ω) F).Ne
+        (ennreal.div_pos_iff.mpr ⟨(ennreal.coe_pos.mpr ε_pos).Ne.symm, ENNReal.two_ne_top⟩).Ne.symm
   rcases eventually_at_top.mp (eventually_lt_of_tendsto_lt room₁ key₁) with ⟨M, hM⟩
   have key₂ :=
     finite_measure.tendsto_iff_forall_lintegral_tendsto.mp μs_lim (thickenedIndicator (δs_pos M) F)
@@ -384,8 +384,8 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
       (lintegral (μ : Measure Ω) fun a => thickenedIndicator (δs_pos M) F a) + ε / 2 :=
     by
     apply
-      Ennreal.lt_add_right (lintegral_lt_top_of_bounded_continuous_to_nnreal (μ : Measure Ω) _).Ne
-        (ennreal.div_pos_iff.mpr ⟨(ennreal.coe_pos.mpr ε_pos).Ne.symm, Ennreal.two_ne_top⟩).Ne.symm
+      ENNReal.lt_add_right (lintegral_lt_top_of_bounded_continuous_to_nnreal (μ : Measure Ω) _).Ne
+        (ennreal.div_pos_iff.mpr ⟨(ennreal.coe_pos.mpr ε_pos).Ne.symm, ENNReal.two_ne_top⟩).Ne.symm
   have ev_near := eventually.mono (eventually_lt_of_tendsto_lt room₂ key₂) fun n => le_of_lt
   have aux := fun n =>
     le_trans
@@ -396,7 +396,7 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
   have : ne_bot L := ⟨h⟩
   rw [limsup_const]
   apply le_trans (add_le_add (hM M rfl.le).le (le_refl (ε / 2 : ℝ≥0∞)))
-  simp only [add_assoc, Ennreal.add_halves, le_refl]
+  simp only [add_assoc, ENNReal.add_halves, le_refl]
 #align measure_theory.finite_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.FiniteMeasure.limsup_measure_closed_le_of_tendsto
 
 /-- One implication of the portmanteau theorem:
@@ -451,9 +451,9 @@ theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι :
     (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E)) :=
   by
   have E_nullbdry' : (μ : Measure Ω) (frontier E) = 0 := by
-    rw [← probability_measure.ennreal_coe_fn_eq_coe_fn_to_measure, E_nullbdry, Ennreal.coe_zero]
+    rw [← probability_measure.ennreal_coe_fn_eq_coe_fn_to_measure, E_nullbdry, ENNReal.coe_zero]
   have key := probability_measure.tendsto_measure_of_null_frontier_of_tendsto' μs_lim E_nullbdry'
-  exact (Ennreal.tendsto_toNnreal (measure_ne_top (↑μ) E)).comp key
+  exact (ENNReal.tendsto_toNNReal (measure_ne_top (↑μ) E)).comp key
 #align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto
 
 end ConvergenceImpliesLimsupClosedLe
@@ -477,7 +477,7 @@ theorem exists_null_frontier_thickening (μ : Measure Ω) [SigmaFinite μ] (s :
   have disjs := Metric.frontier_thickening_disjoint s
   have key := @measure.countable_meas_pos_of_disjoint_Union Ω _ _ μ _ _ mbles disjs
   have aux := @measure_diff_null ℝ _ volume (Ioo a b) _ (Set.Countable.measure_zero key volume)
-  have len_pos : 0 < Ennreal.ofReal (b - a) := by simp only [hab, Ennreal.ofReal_pos, sub_pos]
+  have len_pos : 0 < ENNReal.ofReal (b - a) := by simp only [hab, ENNReal.ofReal_pos, sub_pos]
   rw [← Real.volume_Ioo, ← aux] at len_pos
   rcases nonempty_of_measure_ne_zero len_pos.ne.symm with ⟨r, ⟨r_in_Ioo, hr⟩⟩
   refine' ⟨r, r_in_Ioo, _⟩

Changes in mathlib4

mathlib3
mathlib4
feat: Levy-Prokhorov topology is finer than convergence in distribution (#10406)

This PR establishes an easy topology comparison: the topology given by the Lévy-Prokhorov distance is finer than the topology of convergence in distribution.

Co-authored-by: kkytola <39528102+kkytola@users.noreply.github.com> Co-authored-by: kkytola <“kalle.kytola@aalto.fi”> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -7,7 +7,6 @@ import Mathlib.MeasureTheory.Measure.ProbabilityMeasure
 import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
 import Mathlib.MeasureTheory.Integral.Layercake
 import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction
-import Mathlib.Topology.Order.Bounded
 
 #align_import measure_theory.measure.portmanteau from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
 
@@ -543,32 +542,6 @@ lemma integral_le_liminf_integral_of_forall_isOpen_measure_le_liminf_measure
       congr
       exact (Real.norm_of_nonneg (f_nn x)).symm
 
-lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
-    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
-    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
-    (f : Ω →ᵇ ℝ) :
-    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
-  rcases eq_or_neBot L with rfl|hL
-  · simp only [tendsto_bot]
-  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
-  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
-    isBounded_le_map_of_bounded_range _ obs
-  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
-    isBounded_ge_map_of_bounded_range _ obs
-  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
-  · have key := h _ (f.add_norm_nonneg)
-    simp_rw [f.integral_add_const ‖f‖] at key
-    simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
-    have := liminf_add_const L (fun i ↦ ∫ x, (f x) ∂ (μs i)) ‖f‖ bdd_above bdd_below
-    rwa [this, add_le_add_iff_right] at key
-  · have key := h _ (f.norm_sub_nonneg)
-    simp_rw [f.integral_const_sub ‖f‖] at key
-    simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
-    have := liminf_const_sub L (fun i ↦ ∫ x, (f x) ∂ (μs i)) ‖f‖ bdd_above bdd_below
-    rwa [this, sub_le_sub_iff_left] at key
-  · exact bdd_above
-  · exact bdd_below
-
 /-- One implication of the portmanteau theorem:
 If for all open sets G we have the liminf condition `μ(G) ≤ liminf μsₙ(G)`, then the measures
 μsₙ converge weakly to the measure μ. -/
doc: Mark named theorems (#8749)
Diff
@@ -102,6 +102,7 @@ of measures.
 
 variable {Ω : Type*} [MeasurableSpace Ω]
 
+/-- **Portmanteau theorem** -/
 theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type*} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i E) ≤ μ E) :
feat: uniqueness of weak limits of finite measures (#8498)

This PR adds a type class HasOuterApproxClosed for topological spaces in which indicator functions of closed sets can be approximated from above by sequences of bounded continuous functions. All pseudo-(e)metrizable spaces satisfy this.

In spaces with this property, finite Borel measures are characterized by the integrals of bounded continuous functions. Also weak limits of finite Borel measures are unique. More precisely, the topologies of weak convergence of finite Borel measures and of Borel probability measures are Hausdorff.

Co-authored-by: Peter Pfaffelhuber <p.p@stochastik.uni-freiburg.de>

Co-authored-by: kkytola <39528102+kkytola@users.noreply.github.com> Co-authored-by: kkytola <“kalle.kytola@aalto.fi”>

Diff
@@ -274,98 +274,37 @@ Combining with a earlier proven implications, we get that (T) implies also both
 -/
 
 
-variable {Ω : Type*} [MeasurableSpace Ω]
-
-/-- If bounded continuous functions tend to the indicator of a measurable set and are
-uniformly bounded, then their integrals against a finite measure tend to the measure of the set.
-This formulation assumes:
- * the functions tend to a limit along a countably generated filter;
- * the limit is in the almost everywhere sense;
- * boundedness holds almost everywhere.
--/
-theorem measure_of_cont_bdd_of_tendsto_filter_indicator {ι : Type*} {L : Filter ι}
-    [L.IsCountablyGenerated] [TopologicalSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω)
-    [IsFiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E) (fs : ι → Ω →ᵇ ℝ≥0)
-    (fs_bdd : ∀ᶠ i in L, ∀ᵐ ω : Ω ∂μ, fs i ω ≤ c)
-    (fs_lim : ∀ᵐ ω : Ω ∂μ, Tendsto (fun i : ι => ((⇑) : (Ω →ᵇ ℝ≥0) → Ω → ℝ≥0) (fs i) ω) L
-      (𝓝 (indicator E (fun _ => (1 : ℝ≥0)) ω))) :
-    Tendsto (fun n => lintegral μ fun ω => fs n ω) L (𝓝 (μ E)) := by
-  convert FiniteMeasure.tendsto_lintegral_nn_filter_of_le_const μ fs_bdd fs_lim
-  have aux : ∀ ω, indicator E (fun _ => (1 : ℝ≥0∞)) ω = ↑(indicator E (fun _ => (1 : ℝ≥0)) ω) :=
-    fun ω => by simp only [ENNReal.coe_indicator, ENNReal.coe_one]
-  simp_rw [← aux, lintegral_indicator _ E_mble]
-  simp only [lintegral_one, Measure.restrict_apply, MeasurableSet.univ, univ_inter]
-#align measure_theory.measure_of_cont_bdd_of_tendsto_filter_indicator MeasureTheory.measure_of_cont_bdd_of_tendsto_filter_indicator
-
-/-- If a sequence of bounded continuous functions tends to the indicator of a measurable set and
-the functions are uniformly bounded, then their integrals against a finite measure tend to the
-measure of the set.
-
-A similar result with more general assumptions is
-`MeasureTheory.measure_of_cont_bdd_of_tendsto_filter_indicator`.
--/
-theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMeasurableSpace Ω]
-    (μ : Measure Ω) [IsFiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E)
-    (fs : ℕ → Ω →ᵇ ℝ≥0) (fs_bdd : ∀ n ω, fs n ω ≤ c)
-    (fs_lim : Tendsto (fun n : ℕ => ((⇑) : (Ω →ᵇ ℝ≥0) → Ω → ℝ≥0) (fs n)) atTop
-      (𝓝 (indicator E fun _ => (1 : ℝ≥0)))) :
-    Tendsto (fun n => lintegral μ fun ω => fs n ω) atTop (𝓝 (μ E)) := by
-  have fs_lim' :
-    ∀ ω, Tendsto (fun n : ℕ => (fs n ω : ℝ≥0)) atTop (𝓝 (indicator E (fun _ => (1 : ℝ≥0)) ω)) := by
-    rw [tendsto_pi_nhds] at fs_lim
-    exact fun ω => fs_lim ω
-  apply measure_of_cont_bdd_of_tendsto_filter_indicator μ E_mble fs
-    (eventually_of_forall fun n => eventually_of_forall (fs_bdd n)) (eventually_of_forall fs_lim')
-#align measure_theory.measure_of_cont_bdd_of_tendsto_indicator MeasureTheory.measure_of_cont_bdd_of_tendsto_indicator
-
-/-- The integrals of thickened indicators of a closed set against a finite measure tend to the
-measure of the closed set if the thickening radii tend to zero.
--/
-theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type*} [MeasurableSpace Ω]
-    [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] {F : Set Ω}
-    (F_closed : IsClosed F) {δs : ℕ → ℝ} (δs_pos : ∀ n, 0 < δs n)
-    (δs_lim : Tendsto δs atTop (𝓝 0)) :
-    Tendsto (fun n => lintegral μ fun ω => (thickenedIndicator (δs_pos n) F ω : ℝ≥0∞)) atTop
-      (𝓝 (μ F)) := by
-  apply measure_of_cont_bdd_of_tendsto_indicator μ F_closed.measurableSet
-    (fun n => thickenedIndicator (δs_pos n) F) fun n ω => thickenedIndicator_le_one (δs_pos n) F ω
-  have key := thickenedIndicator_tendsto_indicator_closure δs_pos δs_lim F
-  rwa [F_closed.closure_eq] at key
-#align measure_theory.tendsto_lintegral_thickened_indicator_of_is_closed MeasureTheory.tendsto_lintegral_thickenedIndicator_of_isClosed
-
 /-- One implication of the portmanteau theorem:
 Weak convergence of finite measures implies that the limsup of the measures of any closed set is
 at most the measure of the closed set under the limit measure.
 -/
 theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type*} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : FiniteMeasure Ω}
+    [MeasurableSpace Ω] [TopologicalSpace Ω] [HasOuterApproxClosed Ω]
+    [OpensMeasurableSpace Ω] {μ : FiniteMeasure Ω}
     {μs : ι → FiniteMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω} (F_closed : IsClosed F) :
     (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
   rcases L.eq_or_neBot with rfl | hne
   · simp only [limsup_bot, bot_le]
   apply ENNReal.le_of_forall_pos_le_add
   intro ε ε_pos _
-  let δs := fun n : ℕ => (1 : ℝ) / (n + 1)
-  have δs_pos : ∀ n, 0 < δs n := fun n => Nat.one_div_pos_of_nat
-  have δs_lim : Tendsto δs atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_0_nat
-  have key₁ :=
-    tendsto_lintegral_thickenedIndicator_of_isClosed (μ : Measure Ω) F_closed δs_pos δs_lim
+  let fs := F_closed.apprSeq
+  have key₁ : Tendsto (fun n ↦ ∫⁻  ω, (fs n ω : ℝ≥0∞) ∂μ) atTop (𝓝 ((μ : Measure Ω) F)) :=
+    HasOuterApproxClosed.tendsto_lintegral_apprSeq F_closed (μ : Measure Ω)
   have room₁ : (μ : Measure Ω) F < (μ : Measure Ω) F + ε / 2 := by
     apply
       ENNReal.lt_add_right (measure_lt_top (μ : Measure Ω) F).ne
         (ENNReal.div_pos_iff.mpr ⟨(ENNReal.coe_pos.mpr ε_pos).ne.symm, ENNReal.two_ne_top⟩).ne.symm
   rcases eventually_atTop.mp (eventually_lt_of_tendsto_lt room₁ key₁) with ⟨M, hM⟩
-  have key₂ :=
-    FiniteMeasure.tendsto_iff_forall_lintegral_tendsto.mp μs_lim (thickenedIndicator (δs_pos M) F)
+  have key₂ := FiniteMeasure.tendsto_iff_forall_lintegral_tendsto.mp μs_lim (fs M)
   have room₂ :
-    (lintegral (μ : Measure Ω) fun a => thickenedIndicator (δs_pos M) F a) <
-      (lintegral (μ : Measure Ω) fun a => thickenedIndicator (δs_pos M) F a) + ε / 2 := by
+    (lintegral (μ : Measure Ω) fun a => fs M a) <
+      (lintegral (μ : Measure Ω) fun a => fs M a) + ε / 2 := by
     apply ENNReal.lt_add_right (ne_of_lt ?_)
         (ENNReal.div_pos_iff.mpr ⟨(ENNReal.coe_pos.mpr ε_pos).ne.symm, ENNReal.two_ne_top⟩).ne.symm
     apply BoundedContinuousFunction.lintegral_lt_top_of_nnreal
   have ev_near := Eventually.mono (eventually_lt_of_tendsto_lt room₂ key₂) fun n => le_of_lt
-  have ev_near' := Eventually.mono ev_near fun n => le_trans
-    (measure_le_lintegral_thickenedIndicator (μs n : Measure Ω) F_closed.measurableSet (δs_pos M))
+  have ev_near' := Eventually.mono ev_near
+    (fun n ↦ le_trans (HasOuterApproxClosed.measure_le_lintegral F_closed (μs n) M))
   apply (Filter.limsup_le_limsup ev_near').trans
   rw [limsup_const]
   apply le_trans (add_le_add (hM M rfl.le).le (le_refl (ε / 2 : ℝ≥0∞)))
@@ -377,9 +316,10 @@ Weak convergence of probability measures implies that the limsup of the measures
 set is at most the measure of the closed set under the limit probability measure.
 -/
 theorem ProbabilityMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type*} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
-    {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω}
-    (F_closed : IsClosed F) : (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] [HasOuterApproxClosed Ω]
+    {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
+    {F : Set Ω} (F_closed : IsClosed F) :
+    (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
   apply FiniteMeasure.limsup_measure_closed_le_of_tendsto
     ((ProbabilityMeasure.tendsto_nhds_iff_toFiniteMeasure_tendsto_nhds L).mp μs_lim) F_closed
 #align measure_theory.probability_measure.limsup_measure_closed_le_of_tendsto MeasureTheory.ProbabilityMeasure.limsup_measure_closed_le_of_tendsto
@@ -389,8 +329,9 @@ Weak convergence of probability measures implies that the liminf of the measures
 is at least the measure of the open set under the limit probability measure.
 -/
 theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type*} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
-    {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {G : Set Ω} (G_open : IsOpen G) :
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] [HasOuterApproxClosed Ω]
+    {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
+    {G : Set Ω} (G_open : IsOpen G) :
     (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
   haveI h_closeds : ∀ F, IsClosed F → (L.limsup fun i ↦ (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F :=
     fun _ F_closed => ProbabilityMeasure.limsup_measure_closed_le_of_tendsto μs_lim F_closed
@@ -400,8 +341,8 @@ theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type*} {L
 
 theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι : Type*}
     {L : Filter ι} [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
-    {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
-    {E : Set Ω} (E_nullbdry : (μ : Measure Ω) (frontier E) = 0) :
+    [HasOuterApproxClosed Ω] {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω}
+    (μs_lim : Tendsto μs L (𝓝 μ)) {E : Set Ω} (E_nullbdry : (μ : Measure Ω) (frontier E) = 0) :
     Tendsto (fun i => (μs i : Measure Ω) E) L (𝓝 ((μ : Measure Ω) E)) :=
   haveI h_opens : ∀ G, IsOpen G → (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
     fun _ G_open => ProbabilityMeasure.le_liminf_measure_open_of_tendsto μs_lim G_open
@@ -417,9 +358,9 @@ A version with coercions to ordinary `ℝ≥0∞`-valued measures is
 `MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto'`.
 -/
 theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι : Type*} {L : Filter ι}
-    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
-    {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {E : Set Ω}
-    (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E)) := by
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] [HasOuterApproxClosed Ω]
+    {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
+    {E : Set Ω} (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E)) := by
   have E_nullbdry' : (μ : Measure Ω) (frontier E) = 0 := by
     rw [← ProbabilityMeasure.ennreal_coeFn_eq_coeFn_toMeasure, E_nullbdry, ENNReal.coe_zero]
   have key := ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' μs_lim E_nullbdry'
chore: Fix universe (misprint in Portmanteau.lean). (#8620)

In my earlier PR #8097 there there was a typo variable {Ω : Type} which should have been a universe polymorphic variable {Ω : Type*}. This PR fixes 1 character. Apologies!

Diff
@@ -550,7 +550,7 @@ implies
 
 -/
 
-variable {Ω : Type} [MeasurableSpace Ω] [TopologicalSpace Ω] [OpensMeasurableSpace Ω]
+variable {Ω : Type*} [MeasurableSpace Ω] [TopologicalSpace Ω] [OpensMeasurableSpace Ω]
 
 lemma lintegral_le_liminf_lintegral_of_forall_isOpen_measure_le_liminf_measure
     {μ : Measure Ω} {μs : ℕ → Measure Ω} {f : Ω → ℝ} (f_cont : Continuous f) (f_nn : 0 ≤ f)
feat: add last implication of portmanteau characterizations of weak convergence (#8097)

This PR adds the last missing implication of the general case of portmanteau equivalent characterizations of convergence in distribution: a sufficient condition for convergence in distribution of a sequence of probability measures is that for all open sets the candidate limit measure is at most the liminf of the measures.

Co-authored-by: Kalle <kalle.kytola@aalto.fi> Co-authored-by: kkytola <39528102+kkytola@users.noreply.github.com>

Diff
@@ -5,6 +5,9 @@ Authors: Kalle Kytölä
 -/
 import Mathlib.MeasureTheory.Measure.ProbabilityMeasure
 import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
+import Mathlib.MeasureTheory.Integral.Layercake
+import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction
+import Mathlib.Topology.Order.Bounded
 
 #align_import measure_theory.measure.portmanteau from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
 
@@ -39,9 +42,8 @@ The separate implications are:
  * `MeasureTheory.limsup_measure_closed_le_iff_liminf_measure_open_ge` is the equivalence (C) ↔ (O).
  * `MeasureTheory.tendsto_measure_of_null_frontier` is the implication (O) → (B).
  * `MeasureTheory.limsup_measure_closed_le_of_forall_tendsto_measure` is the implication (B) → (C).
-
-TODO:
- * Prove the remaining implication (O) → (T) to complete the proof of equivalence of the conditions.
+ * `MeasureTheory.tendsto_of_forall_isOpen_le_liminf` gives the implication (O) → (T) for
+    any sequence of Borel probability measures.
 
 ## Implementation notes
 
@@ -77,14 +79,7 @@ probability measure
 
 noncomputable section
 
-open MeasureTheory
-
-open Set
-
-open Filter
-
-open BoundedContinuousFunction
-
+open MeasureTheory Set Filter BoundedContinuousFunction
 open scoped Topology ENNReal NNReal BoundedContinuousFunction
 
 namespace MeasureTheory
@@ -539,4 +534,128 @@ lemma le_liminf_measure_open_of_forall_tendsto_measure
 
 end LimitBorelImpliesLimsupClosedLE --section
 
+section le_liminf_open_implies_convergence
+
+/-! ### Portmanteau implication: liminf condition for open sets implies weak convergence
+
+
+In this section we prove for a sequence (μsₙ)ₙ Borel probability measures that
+
+  (O) For any open set G, the liminf of the measures of G under μsₙ is at least
+      the measure of G under μ, i.e., μ(G) ≤ liminfₙ μsₙ(G).
+
+implies
+
+  (T) The measures μsₙ converge weakly to the measure μ.
+
+-/
+
+variable {Ω : Type} [MeasurableSpace Ω] [TopologicalSpace Ω] [OpensMeasurableSpace Ω]
+
+lemma lintegral_le_liminf_lintegral_of_forall_isOpen_measure_le_liminf_measure
+    {μ : Measure Ω} {μs : ℕ → Measure Ω} {f : Ω → ℝ} (f_cont : Continuous f) (f_nn : 0 ≤ f)
+    (h_opens : ∀ G, IsOpen G → μ G ≤ atTop.liminf (fun i ↦ μs i G)) :
+    ∫⁻ x, ENNReal.ofReal (f x) ∂μ ≤ atTop.liminf (fun i ↦ ∫⁻ x, ENNReal.ofReal (f x) ∂ (μs i)) := by
+  simp_rw [lintegral_eq_lintegral_meas_lt _ (eventually_of_forall f_nn) f_cont.aemeasurable]
+  calc  ∫⁻ (t : ℝ) in Set.Ioi 0, μ {a | t < f a}
+      ≤ ∫⁻ (t : ℝ) in Set.Ioi 0, atTop.liminf (fun i ↦ (μs i) {a | t < f a}) := ?_ -- (i)
+    _ ≤ atTop.liminf (fun i ↦ ∫⁻ (t : ℝ) in Set.Ioi 0, (μs i) {a | t < f a}) := ?_ -- (ii)
+  · -- (i)
+    exact (lintegral_mono (fun t ↦ h_opens _ (continuous_def.mp f_cont _ isOpen_Ioi))).trans
+            (le_refl _)
+  · -- (ii)
+    exact lintegral_liminf_le (fun n ↦ Antitone.measurable (fun s t hst ↦
+            measure_mono (fun ω hω ↦ lt_of_le_of_lt hst hω)))
+
+lemma integral_le_liminf_integral_of_forall_isOpen_measure_le_liminf_measure
+    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ℕ → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
+    {f : Ω →ᵇ ℝ} (f_nn : 0 ≤ f)
+    (h_opens : ∀ G, IsOpen G → μ G ≤ atTop.liminf (fun i ↦ μs i G)) :
+    ∫ x, (f x) ∂μ ≤ atTop.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)) := by
+  have same := lintegral_le_liminf_lintegral_of_forall_isOpen_measure_le_liminf_measure
+                  f.continuous f_nn h_opens
+  rw [@integral_eq_lintegral_of_nonneg_ae Ω _ μ f (eventually_of_forall f_nn)
+        f.continuous.measurable.aestronglyMeasurable]
+  convert (ENNReal.toReal_le_toReal ?_ ?_).mpr same
+  · simp only [fun i ↦ @integral_eq_lintegral_of_nonneg_ae Ω _ (μs i) f (eventually_of_forall f_nn)
+                        f.continuous.measurable.aestronglyMeasurable]
+    let g := BoundedContinuousFunction.comp _ Real.lipschitzWith_toNNReal f
+    have bound : ∀ i, ∫⁻ x, ENNReal.ofReal (f x) ∂(μs i) ≤ nndist 0 g := fun i ↦ by
+      simpa only [coe_nnreal_ennreal_nndist, measure_univ, mul_one, ge_iff_le] using
+            BoundedContinuousFunction.lintegral_le_edist_mul (μ := μs i) g
+    apply ENNReal.liminf_toReal_eq ENNReal.coe_ne_top (eventually_of_forall bound)
+  · exact (f.lintegral_of_real_lt_top μ).ne
+  · apply ne_of_lt
+    have obs := fun (i : ℕ) ↦ @BoundedContinuousFunction.lintegral_nnnorm_le Ω _ _ (μs i) ℝ _ f
+    simp only [measure_univ, mul_one] at obs
+    apply lt_of_le_of_lt _ (show (‖f‖₊ : ℝ≥0∞) < ∞ from ENNReal.coe_lt_top)
+    apply liminf_le_of_le
+    · refine ⟨0, eventually_of_forall (by simp only [ge_iff_le, zero_le, forall_const])⟩
+    · intro x hx
+      obtain ⟨i, hi⟩ := hx.exists
+      apply le_trans hi
+      convert obs i with x
+      have aux := ENNReal.ofReal_eq_coe_nnreal (f_nn x)
+      simp only [ContinuousMap.toFun_eq_coe, BoundedContinuousFunction.coe_to_continuous_fun] at aux
+      rw [aux]
+      congr
+      exact (Real.norm_of_nonneg (f_nn x)).symm
+
+lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
+    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
+    (h : ∀ f : Ω →ᵇ ℝ, 0 ≤ f → ∫ x, (f x) ∂μ ≤ L.liminf (fun i ↦ ∫ x, (f x) ∂ (μs i)))
+    (f : Ω →ᵇ ℝ) :
+    Tendsto (fun i ↦ ∫ x, (f x) ∂ (μs i)) L (𝓝 (∫ x, (f x) ∂μ)) := by
+  rcases eq_or_neBot L with rfl|hL
+  · simp only [tendsto_bot]
+  have obs := BoundedContinuousFunction.isBounded_range_integral μs f
+  have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
+    isBounded_le_map_of_bounded_range _ obs
+  have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ (x : Ω), f x ∂μs i) :=
+    isBounded_ge_map_of_bounded_range _ obs
+  apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, (f x) ∂ (μs i)) (∫ x, (f x) ∂μ)
+  · have key := h _ (f.add_norm_nonneg)
+    simp_rw [f.integral_add_const ‖f‖] at key
+    simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
+    have := liminf_add_const L (fun i ↦ ∫ x, (f x) ∂ (μs i)) ‖f‖ bdd_above bdd_below
+    rwa [this, add_le_add_iff_right] at key
+  · have key := h _ (f.norm_sub_nonneg)
+    simp_rw [f.integral_const_sub ‖f‖] at key
+    simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
+    have := liminf_const_sub L (fun i ↦ ∫ x, (f x) ∂ (μs i)) ‖f‖ bdd_above bdd_below
+    rwa [this, sub_le_sub_iff_left] at key
+  · exact bdd_above
+  · exact bdd_below
+
+/-- One implication of the portmanteau theorem:
+If for all open sets G we have the liminf condition `μ(G) ≤ liminf μsₙ(G)`, then the measures
+μsₙ converge weakly to the measure μ. -/
+theorem tendsto_of_forall_isOpen_le_liminf {μ : ProbabilityMeasure Ω}
+    {μs : ℕ → ProbabilityMeasure Ω}
+    (h_opens : ∀ G, IsOpen G → μ G ≤ atTop.liminf (fun i ↦ μs i G)) :
+    atTop.Tendsto (fun i ↦ μs i) (𝓝 μ) := by
+  refine ProbabilityMeasure.tendsto_iff_forall_integral_tendsto.mpr ?_
+  apply tendsto_integral_of_forall_integral_le_liminf_integral
+  intro f f_nn
+  apply integral_le_liminf_integral_of_forall_isOpen_measure_le_liminf_measure (f := f) f_nn
+  intro G G_open
+  specialize h_opens G G_open
+  simp only at h_opens
+  have aux : ENNReal.ofNNReal (liminf (fun i ↦ ENNReal.toNNReal ((μs i : Measure Ω) G)) atTop) =
+          liminf (ENNReal.ofNNReal ∘ fun i ↦ (ENNReal.toNNReal ((μs i : Measure Ω) G))) atTop := by
+    refine Monotone.map_liminf_of_continuousAt (F := atTop) ENNReal.coe_mono (μs · G) ?_ ?_ ?_
+    · apply ENNReal.continuous_coe.continuousAt
+    · use 1
+      simp only [eventually_map, ProbabilityMeasure.apply_le_one, eventually_atTop, ge_iff_le,
+        implies_true, forall_const, exists_const]
+    · use 0
+      simp only [zero_le, eventually_map, eventually_atTop, ge_iff_le, implies_true, forall_const,
+        exists_const]
+  have obs := ENNReal.coe_mono h_opens
+  simp only [ne_eq, ProbabilityMeasure.ennreal_coeFn_eq_coeFn_toMeasure, aux] at obs
+  convert obs
+  simp only [Function.comp_apply, ne_eq, ProbabilityMeasure.ennreal_coeFn_eq_coeFn_toMeasure]
+
+end le_liminf_open_implies_convergence
+
 end MeasureTheory --namespace
feat: Lemmas about integrals of bounded continuous functions. (#7222)

This PR adds some lemmas about integrals of bounded continuous functions. The lemmas are collected in a separate file.

Co-authored-by: kkytola <39528102+kkytola@users.noreply.github.com>

Diff
@@ -365,9 +365,9 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type*} {L : F
   have room₂ :
     (lintegral (μ : Measure Ω) fun a => thickenedIndicator (δs_pos M) F a) <
       (lintegral (μ : Measure Ω) fun a => thickenedIndicator (δs_pos M) F a) + ε / 2 := by
-    apply
-      ENNReal.lt_add_right (lintegral_lt_top_of_boundedContinuous_to_nnreal (μ : Measure Ω) _).ne
+    apply ENNReal.lt_add_right (ne_of_lt ?_)
         (ENNReal.div_pos_iff.mpr ⟨(ENNReal.coe_pos.mpr ε_pos).ne.symm, ENNReal.two_ne_top⟩).ne.symm
+    apply BoundedContinuousFunction.lintegral_lt_top_of_nnreal
   have ev_near := Eventually.mono (eventually_lt_of_tendsto_lt room₂ key₂) fun n => le_of_lt
   have ev_near' := Eventually.mono ev_near fun n => le_trans
     (measure_le_lintegral_thickenedIndicator (μs n : Measure Ω) F_closed.measurableSet (δs_pos M))
chore: simplify by rfl (#7039)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -120,7 +120,7 @@ theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type*} {L : Filter ι
     simpa only [measure_univ] using measure_compl E_mble (measure_lt_top (μs i) E).ne
   simp_rw [meas_Ec, meas_i_Ec]
   have obs :
-    (L.liminf fun i : ι => 1 - μs i E) = L.liminf ((fun x => 1 - x) ∘ fun i : ι => μs i E) := by rfl
+    (L.liminf fun i : ι => 1 - μs i E) = L.liminf ((fun x => 1 - x) ∘ fun i : ι => μs i E) := rfl
   rw [obs]
   have := antitone_const_tsub.map_limsup_of_continuousAt (F := L)
     (fun i => μs i E) (ENNReal.continuous_sub_left ENNReal.one_ne_top).continuousAt
@@ -148,7 +148,7 @@ theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type*} {L : Filter ι
     simpa only [measure_univ] using measure_compl E_mble (measure_lt_top (μs i) E).ne
   simp_rw [meas_Ec, meas_i_Ec]
   have obs :
-    (L.limsup fun i : ι => 1 - μs i E) = L.limsup ((fun x => 1 - x) ∘ fun i : ι => μs i E) := by rfl
+    (L.limsup fun i : ι => 1 - μs i E) = L.limsup ((fun x => 1 - x) ∘ fun i : ι => μs i E) := rfl
   rw [obs]
   have := antitone_const_tsub.map_liminf_of_continuousAt (F := L)
     (fun i => μs i E) (ENNReal.continuous_sub_left ENNReal.one_ne_top).continuousAt
feat: add the portmanteau implication from Borel set limit condition to closed set limsup condition (#6253)

Add one implication of portmanteau theorem: a Borel set limit condition implies a closed set limsup condition.

Co-authored-by: kkytola <“kalle.kytola@aalto.fi”> Co-authored-by: kkytola <39528102+kkytola@users.noreply.github.com>

Diff
@@ -16,36 +16,40 @@ and of probability measures, i.e., the standard characterizations of convergence
 
 ## Main definitions
 
-This file does not introduce substantial new definitions: the topologies of weak convergence on
-the types of finite measures and probability measures are already defined in their corresponding
-files.
+The topologies of weak convergence on the types of finite measures and probability measures are
+already defined in their corresponding files; no substantial new definitions are introduced here.
 
 ## Main results
 
 The main result will be the portmanteau theorem providing various characterizations of the
-weak convergence of measures. The separate implications are:
- * `MeasureTheory.FiniteMeasure.limsup_measure_closed_le_of_tendsto` proves that weak convergence
-   implies a limsup-condition for closed sets.
- * `MeasureTheory.limsup_measure_closed_le_iff_liminf_measure_open_ge` proves for probability
-   measures the equivalence of the limsup condition for closed sets and the liminf condition for
-   open sets.
- * `MeasureTheory.tendsto_measure_of_null_frontier` proves that the liminf condition for open
-   sets (which is equivalent to the limsup condition for closed sets) implies the convergence of
-   probabilities of sets whose boundary carries no mass under the limit measure.
- * `MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto` is a
-   combination of earlier implications, which shows that weak convergence of probability measures
-   implies the convergence of probabilities of sets whose boundary carries no mass under the
-   limit measure.
+weak convergence of measures (probability measures or finite measures). Given measures μs
+and μ on a topological space Ω, the conditions that will be proven equivalent (under quite
+general hypotheses) are:
+
+  (T) The measures μs tend to the measure μ weakly.
+  (C) For any closed set F, the limsup of the measures of F under μs is at most
+      the measure of F under μ, i.e., limsupᵢ μsᵢ(F) ≤ μ(F).
+  (O) For any open set G, the liminf of the measures of G under μs is at least
+      the measure of G under μ, i.e., μ(G) ≤ liminfᵢ μsᵢ(G).
+  (B) For any Borel set B whose boundary carries no mass under μ, i.e. μ(∂B) = 0,
+      the measures of B under μs tend to the measure of B under μ, i.e., limᵢ μsᵢ(B) = μ(B).
+
+The separate implications are:
+ * `MeasureTheory.FiniteMeasure.limsup_measure_closed_le_of_tendsto` is the implication (T) → (C).
+ * `MeasureTheory.limsup_measure_closed_le_iff_liminf_measure_open_ge` is the equivalence (C) ↔ (O).
+ * `MeasureTheory.tendsto_measure_of_null_frontier` is the implication (O) → (B).
+ * `MeasureTheory.limsup_measure_closed_le_of_forall_tendsto_measure` is the implication (B) → (C).
 
 TODO:
- * Prove the rest of the implications.
+ * Prove the remaining implication (O) → (T) to complete the proof of equivalence of the conditions.
 
 ## Implementation notes
 
 Many of the characterizations of weak convergence hold for finite measures and are proven in that
 generality and then specialized to probability measures. Some implications hold with slightly
-weaker assumptions than usually stated. The full portmanteau theorem, however, is most convenient
-for probability measures on metrizable spaces with their Borel sigmas.
+more general assumptions than in the usual statement of portmanteau theorem. The full portmanteau
+theorem, however, is most convenient for probability measures on pseudo-emetrizable spaces with
+their Borel sigma algebras.
 
 Some specific considerations on the assumptions in the different implications:
  * `MeasureTheory.FiniteMeasure.limsup_measure_closed_le_of_tendsto` assumes
@@ -91,10 +95,12 @@ section LimsupClosedLEAndLELiminfOpen
 
 In this section we prove that for a sequence of Borel probability measures on a topological space
 and its candidate limit measure, the following two conditions are equivalent:
-  (C) For any closed set `F` in `Ω` the limsup of the measures of `F` is at most the limit
-      measure of `F`.
-  (O) For any open set `G` in `Ω` the liminf of the measures of `G` is at least the limit
-      measure of `G`.
+
+  (C) For any closed set F, the limsup of the measures of F under μs is at most
+      the measure of F under μ, i.e., limsupᵢ μsᵢ(F) ≤ μ(F);
+  (O) For any open set G, the liminf of the measures of G under μs is at least
+      the measure of G under μ, i.e., μ(G) ≤ liminfᵢ μsᵢ(G).
+
 Either of these will later be shown to be equivalent to the weak convergence of the sequence
 of measures.
 -/
@@ -182,23 +188,24 @@ theorem limsup_measure_closed_le_iff_liminf_measure_open_ge {ι : Type*} {L : Fi
       F_closed.measurableSet (h Fᶜ (isOpen_compl_iff.mpr F_closed))
 #align measure_theory.limsup_measure_closed_le_iff_liminf_measure_open_ge MeasureTheory.limsup_measure_closed_le_iff_liminf_measure_open_ge
 
-end LimsupClosedLEAndLELiminfOpen
+end LimsupClosedLEAndLELiminfOpen -- section
 
--- section
 section TendstoOfNullFrontier
 
 /-! ### Portmanteau: limit of measures of Borel sets whose boundary carries no mass in the limit
 
 In this section we prove that for a sequence of Borel probability measures on a topological space
 and its candidate limit measure, either of the following equivalent conditions:
-  (C) For any closed set `F` in `Ω` the limsup of the measures of `F` is at most the limit
-      measure of `F`
-  (O) For any open set `G` in `Ω` the liminf of the measures of `G` is at least the limit
-      measure of `G`
+
+  (C) For any closed set F, the limsup of the measures of F under μs is at most
+      the measure of F under μ, i.e., limsupᵢ μsᵢ(F) ≤ μ(F);
+  (O) For any open set G, the liminf of the measures of G under μs is at least
+      the measure of G under μ, i.e., μ(G) ≤ liminfᵢ μsᵢ(G).
+
 implies that
-  (B) For any Borel set `E` in `Ω` whose boundary `∂E` carries no mass under the candidate limit
-      measure, we have that the limit of measures of `E` is the measure of `E` under the
-      candidate limit measure.
+
+  (B) For any Borel set B whose boundary carries no mass under μ, i.e. μ(∂B) = 0,
+      the measures of B under μs tend to the measure of B under μ, i.e., limᵢ μsᵢ(B) = μ(B).
 -/
 
 
@@ -247,22 +254,28 @@ theorem tendsto_measure_of_null_frontier {ι : Type*} {L : Filter ι} {μ : Meas
     E_nullbdry (h_opens _ isOpen_interior) (h_closeds _ isClosed_closure)
 #align measure_theory.tendsto_measure_of_null_frontier MeasureTheory.tendsto_measure_of_null_frontier
 
-end TendstoOfNullFrontier
+end TendstoOfNullFrontier --section
 
---section
 section ConvergenceImpliesLimsupClosedLE
 
 /-! ### Portmanteau implication: weak convergence implies a limsup condition for closed sets
 
 In this section we prove, under the assumption that the underlying topological space `Ω` is
-pseudo-emetrizable, that the weak convergence of measures on `MeasureTheory.FiniteMeasure Ω`
-implies that for any closed set `F` in `Ω` the limsup of the measures of `F` is at most the
-limit measure of `F`. This is one implication of the portmanteau theorem characterizing weak
-convergence of measures.
-
-Combining with an earlier implication we also get that weak convergence implies that for any Borel
-set `E` in `Ω` whose boundary `∂E` carries no mass under the limit measure, the limit of measures
-of `E` is the measure of `E` under the limit measure.
+pseudo-emetrizable, that
+
+  (T) The measures μs tend to the measure μ weakly
+
+implies
+
+  (C) For any closed set F, the limsup of the measures of F under μs is at most
+      the measure of F under μ, i.e., limsupᵢ μsᵢ(F) ≤ μ(F).
+
+Combining with a earlier proven implications, we get that (T) implies also both
+
+  (O) For any open set G, the liminf of the measures of G under μs is at least
+      the measure of G under μ, i.e., μ(G) ≤ liminfᵢ μsᵢ(G);
+  (B) For any Borel set B whose boundary carries no mass under μ, i.e. μ(∂B) = 0,
+      the measures of B under μs tend to the measure of B under μ, i.e., limᵢ μsᵢ(B) = μ(B).
 -/
 
 
@@ -418,16 +431,32 @@ theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι :
   exact (ENNReal.tendsto_toNNReal (measure_ne_top (↑μ) E)).comp key
 #align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto
 
-end ConvergenceImpliesLimsupClosedLE
+end ConvergenceImpliesLimsupClosedLE --section
 
---section
 section LimitBorelImpliesLimsupClosedLE
 
 /-! ### Portmanteau implication: limit condition for Borel sets implies limsup for closed sets
 
-TODO: The proof of the implication is not yet here. Add it.
+
+In this section we prove, under the assumption that the underlying topological space `Ω` is
+pseudo-emetrizable, that
+
+  (B) For any Borel set B whose boundary carries no mass under μ, i.e. μ(∂B) = 0,
+      the measures of B under μs tend to the measure of B under μ, i.e., limᵢ μsᵢ(B) = μ(B)
+
+implies
+
+  (C) For any closed set F, the limsup of the measures of F under μs is at most
+      the measure of F under μ, i.e., limsupᵢ μsᵢ(F) ≤ μ(F).
+
+Combining with a earlier proven implications, we get that (B) implies also
+
+  (O) For any open set G, the liminf of the measures of G under μs is at least
+      the measure of G under μ, i.e., μ(G) ≤ liminfᵢ μsᵢ(G).
+
 -/
 
+open ENNReal
 
 variable {Ω : Type*} [PseudoEMetricSpace Ω] [MeasurableSpace Ω] [OpensMeasurableSpace Ω]
 
@@ -436,8 +465,8 @@ theorem exists_null_frontier_thickening (μ : Measure Ω) [SigmaFinite μ] (s :
   have mbles : ∀ r : ℝ, MeasurableSet (frontier (Metric.thickening r s)) :=
     fun r => isClosed_frontier.measurableSet
   have disjs := Metric.frontier_thickening_disjoint s
-  have key := @Measure.countable_meas_pos_of_disjoint_iUnion Ω _ _ μ _ _ mbles disjs
-  have aux := @measure_diff_null ℝ _ volume (Ioo a b) _ (Set.Countable.measure_zero key volume)
+  have key := Measure.countable_meas_pos_of_disjoint_iUnion (μ := μ) mbles disjs
+  have aux := measure_diff_null (s₁ := Ioo a b) (Set.Countable.measure_zero key volume)
   have len_pos : 0 < ENNReal.ofReal (b - a) := by simp only [hab, ENNReal.ofReal_pos, sub_pos]
   rw [← Real.volume_Ioo, ← aux] at len_pos
   rcases nonempty_of_measure_ne_zero len_pos.ne.symm with ⟨r, ⟨r_in_Ioo, hr⟩⟩
@@ -456,9 +485,58 @@ theorem exists_null_frontiers_thickening (μ : Measure Ω) [SigmaFinite μ] (s :
   · exact fun n => ⟨(obs n).choose_spec.1.1, (obs n).choose_spec.2⟩
 #align measure_theory.exists_null_frontiers_thickening MeasureTheory.exists_null_frontiers_thickening
 
-end LimitBorelImpliesLimsupClosedLE
-
---section
-end MeasureTheory
+/-- One implication of the portmanteau theorem:
+Assuming that for all Borel sets E whose boundary ∂E carries no probability mass under a
+candidate limit probability measure μ we have convergence of the measures μsᵢ(E) to μ(E),
+then for all closed sets F we have the limsup condition limsup μsᵢ(F) ≤ μ(F). -/
+lemma limsup_measure_closed_le_of_forall_tendsto_measure
+    {Ω ι : Type*} {L : Filter ι} [NeBot L]
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
+    {μ : Measure Ω} [IsFiniteMeasure μ] {μs : ι → Measure Ω}
+    (h : ∀ {E : Set Ω}, MeasurableSet E → μ (frontier E) = 0 →
+            Tendsto (fun i ↦ μs i E) L (𝓝 (μ E)))
+    (F : Set Ω) (F_closed : IsClosed F) :
+    L.limsup (fun i ↦ μs i F) ≤ μ F := by
+  have ex := exists_null_frontiers_thickening μ F
+  let rs := Classical.choose ex
+  have rs_lim : Tendsto rs atTop (𝓝 0) := (Classical.choose_spec ex).1
+  have rs_pos : ∀ n, 0 < rs n := fun n ↦ ((Classical.choose_spec ex).2 n).1
+  have rs_null : ∀ n, μ (frontier (Metric.thickening (rs n) F)) = 0 :=
+    fun n ↦ ((Classical.choose_spec ex).2 n).2
+  have Fthicks_open : ∀ n, IsOpen (Metric.thickening (rs n) F) :=
+    fun n ↦ Metric.isOpen_thickening
+  have key := fun (n : ℕ) ↦ h (Fthicks_open n).measurableSet (rs_null n)
+  apply ENNReal.le_of_forall_pos_le_add
+  intros ε ε_pos μF_finite
+  have keyB := tendsto_measure_cthickening_of_isClosed (μ := μ) (s := F)
+                ⟨1, ⟨by simp only [gt_iff_lt, zero_lt_one], measure_ne_top _ _⟩⟩ F_closed
+  have nhd : Iio (μ F + ε) ∈ 𝓝 (μ F) := by
+    apply Iio_mem_nhds
+    exact ENNReal.lt_add_right μF_finite.ne (ENNReal.coe_pos.mpr ε_pos).ne'
+  specialize rs_lim (keyB nhd)
+  simp only [mem_map, mem_atTop_sets, ge_iff_le, mem_preimage, mem_Iio] at rs_lim
+  obtain ⟨m, hm⟩ := rs_lim
+  have aux' := fun i ↦ measure_mono (μ := μs i) (Metric.self_subset_thickening (rs_pos m) F)
+  have aux : (fun i ↦ (μs i F)) ≤ᶠ[L] (fun i ↦ μs i (Metric.thickening (rs m) F)) :=
+    eventually_of_forall aux'
+  refine (limsup_le_limsup aux).trans ?_
+  rw [Tendsto.limsup_eq (key m)]
+  apply (measure_mono (Metric.thickening_subset_cthickening (rs m) F)).trans (hm m rfl.le).le
 
---namespace
+/-- One implication of the portmanteau theorem:
+Assuming that for all Borel sets E whose boundary ∂E carries no probability mass under a
+candidate limit probability measure μ we have convergence of the measures μsᵢ(E) to μ(E),
+then for all open sets G we have the limsup condition μ(G) ≤ liminf μsᵢ(G). -/
+lemma le_liminf_measure_open_of_forall_tendsto_measure
+    {Ω ι : Type*} {L : Filter ι} [NeBot L]
+    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
+    {μ : Measure Ω} [IsProbabilityMeasure μ] {μs : ι → Measure Ω} [∀ i, IsProbabilityMeasure (μs i)]
+    (h : ∀ {E}, MeasurableSet E → μ (frontier E) = 0 → Tendsto (fun i ↦ μs i E) L (𝓝 (μ E)))
+    (G : Set Ω) (G_open : IsOpen G) :
+    μ G ≤ L.liminf (fun i ↦ μs i G) := by
+  apply le_measure_liminf_of_limsup_measure_compl_le G_open.measurableSet
+  exact limsup_measure_closed_le_of_forall_tendsto_measure h _ (isClosed_compl_iff.mpr G_open)
+
+end LimitBorelImpliesLimsupClosedLE --section
+
+end MeasureTheory --namespace
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -99,9 +99,9 @@ Either of these will later be shown to be equivalent to the weak convergence of
 of measures.
 -/
 
-variable {Ω : Type _} [MeasurableSpace Ω]
+variable {Ω : Type*} [MeasurableSpace Ω]
 
-theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
+theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type*} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i E) ≤ μ E) :
     μ Eᶜ ≤ L.liminf fun i => μs i Eᶜ := by
@@ -122,14 +122,14 @@ theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter 
   exact antitone_const_tsub h
 #align measure_theory.le_measure_compl_liminf_of_limsup_measure_le MeasureTheory.le_measure_compl_liminf_of_limsup_measure_le
 
-theorem le_measure_liminf_of_limsup_measure_compl_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
+theorem le_measure_liminf_of_limsup_measure_compl_le {ι : Type*} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i Eᶜ) ≤ μ Eᶜ) :
     μ E ≤ L.liminf fun i => μs i E :=
   compl_compl E ▸ le_measure_compl_liminf_of_limsup_measure_le (MeasurableSet.compl E_mble) h
 #align measure_theory.le_measure_liminf_of_limsup_measure_compl_le MeasureTheory.le_measure_liminf_of_limsup_measure_compl_le
 
-theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter ι} {μ : Measure Ω}
+theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type*} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ E ≤ L.liminf fun i => μs i E) :
     (L.limsup fun i => μs i Eᶜ) ≤ μ Eᶜ := by
@@ -150,7 +150,7 @@ theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter 
   exact antitone_const_tsub h
 #align measure_theory.limsup_measure_compl_le_of_le_liminf_measure MeasureTheory.limsup_measure_compl_le_of_le_liminf_measure
 
-theorem limsup_measure_le_of_le_liminf_measure_compl {ι : Type _} {L : Filter ι} {μ : Measure Ω}
+theorem limsup_measure_le_of_le_liminf_measure_compl {ι : Type*} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ Eᶜ ≤ L.liminf fun i => μs i Eᶜ) :
     (L.limsup fun i => μs i E) ≤ μ E :=
@@ -168,7 +168,7 @@ under a candidate limit measure.
 (O) The liminf of the measures of any open set is at least the measure of the open set
 under a candidate limit measure.
 -/
-theorem limsup_measure_closed_le_iff_liminf_measure_open_ge {ι : Type _} {L : Filter ι}
+theorem limsup_measure_closed_le_iff_liminf_measure_open_ge {ι : Type*} {L : Filter ι}
     {μ : Measure Ω} {μs : ι → Measure Ω} [IsProbabilityMeasure μ]
     [∀ i, IsProbabilityMeasure (μs i)] :
     (∀ F, IsClosed F → (L.limsup fun i => μs i F) ≤ μ F) ↔
@@ -202,9 +202,9 @@ implies that
 -/
 
 
-variable {Ω : Type _} [MeasurableSpace Ω]
+variable {Ω : Type*} [MeasurableSpace Ω]
 
-theorem tendsto_measure_of_le_liminf_measure_of_limsup_measure_le {ι : Type _} {L : Filter ι}
+theorem tendsto_measure_of_le_liminf_measure_of_limsup_measure_le {ι : Type*} {L : Filter ι}
     {μ : Measure Ω} {μs : ι → Measure Ω} {E₀ E E₁ : Set Ω} (E₀_subset : E₀ ⊆ E) (subset_E₁ : E ⊆ E₁)
     (nulldiff : μ (E₁ \ E₀) = 0) (h_E₀ : μ E₀ ≤ L.liminf fun i => μs i E₀)
     (h_E₁ : (L.limsup fun i => μs i E₁) ≤ μ E₁) : L.Tendsto (fun i => μs i E) (𝓝 (μ E)) := by
@@ -237,7 +237,7 @@ least the measure of the open set under a candidate limit measure, then for any
 boundary carries no probability mass under the candidate limit measure, then its measures under the
 sequence converge to its measure under the candidate limit measure.
 -/
-theorem tendsto_measure_of_null_frontier {ι : Type _} {L : Filter ι} {μ : Measure Ω}
+theorem tendsto_measure_of_null_frontier {ι : Type*} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)]
     (h_opens : ∀ G, IsOpen G → μ G ≤ L.liminf fun i => μs i G) {E : Set Ω}
     (E_nullbdry : μ (frontier E) = 0) : L.Tendsto (fun i => μs i E) (𝓝 (μ E)) :=
@@ -266,7 +266,7 @@ of `E` is the measure of `E` under the limit measure.
 -/
 
 
-variable {Ω : Type _} [MeasurableSpace Ω]
+variable {Ω : Type*} [MeasurableSpace Ω]
 
 /-- If bounded continuous functions tend to the indicator of a measurable set and are
 uniformly bounded, then their integrals against a finite measure tend to the measure of the set.
@@ -275,7 +275,7 @@ This formulation assumes:
  * the limit is in the almost everywhere sense;
  * boundedness holds almost everywhere.
 -/
-theorem measure_of_cont_bdd_of_tendsto_filter_indicator {ι : Type _} {L : Filter ι}
+theorem measure_of_cont_bdd_of_tendsto_filter_indicator {ι : Type*} {L : Filter ι}
     [L.IsCountablyGenerated] [TopologicalSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω)
     [IsFiniteMeasure μ] {c : ℝ≥0} {E : Set Ω} (E_mble : MeasurableSet E) (fs : ι → Ω →ᵇ ℝ≥0)
     (fs_bdd : ∀ᶠ i in L, ∀ᵐ ω : Ω ∂μ, fs i ω ≤ c)
@@ -313,7 +313,7 @@ theorem measure_of_cont_bdd_of_tendsto_indicator [TopologicalSpace Ω] [OpensMea
 /-- The integrals of thickened indicators of a closed set against a finite measure tend to the
 measure of the closed set if the thickening radii tend to zero.
 -/
-theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [MeasurableSpace Ω]
+theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type*} [MeasurableSpace Ω]
     [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] {F : Set Ω}
     (F_closed : IsClosed F) {δs : ℕ → ℝ} (δs_pos : ∀ n, 0 < δs n)
     (δs_lim : Tendsto δs atTop (𝓝 0)) :
@@ -329,7 +329,7 @@ theorem tendsto_lintegral_thickenedIndicator_of_isClosed {Ω : Type _} [Measurab
 Weak convergence of finite measures implies that the limsup of the measures of any closed set is
 at most the measure of the closed set under the limit measure.
 -/
-theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
+theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type*} {L : Filter ι}
     [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : FiniteMeasure Ω}
     {μs : ι → FiniteMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω} (F_closed : IsClosed F) :
     (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
@@ -368,7 +368,7 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
 Weak convergence of probability measures implies that the limsup of the measures of any closed
 set is at most the measure of the closed set under the limit probability measure.
 -/
-theorem ProbabilityMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L : Filter ι}
+theorem ProbabilityMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type*} {L : Filter ι}
     [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
     {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω}
     (F_closed : IsClosed F) : (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
@@ -380,7 +380,7 @@ theorem ProbabilityMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _}
 Weak convergence of probability measures implies that the liminf of the measures of any open set
 is at least the measure of the open set under the limit probability measure.
 -/
-theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type _} {L : Filter ι}
+theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type*} {L : Filter ι}
     [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
     {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {G : Set Ω} (G_open : IsOpen G) :
     (μ : Measure Ω) G ≤ L.liminf fun i => (μs i : Measure Ω) G :=
@@ -390,7 +390,7 @@ theorem ProbabilityMeasure.le_liminf_measure_open_of_tendsto {Ω ι : Type _} {L
     (h_closeds _ (isClosed_compl_iff.mpr G_open))
 #align measure_theory.probability_measure.le_liminf_measure_open_of_tendsto MeasureTheory.ProbabilityMeasure.le_liminf_measure_open_of_tendsto
 
-theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι : Type _}
+theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto' {Ω ι : Type*}
     {L : Filter ι} [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω]
     {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
     {E : Set Ω} (E_nullbdry : (μ : Measure Ω) (frontier E) = 0) :
@@ -408,7 +408,7 @@ equals the measure of the set under the limit probability measure.
 A version with coercions to ordinary `ℝ≥0∞`-valued measures is
 `MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto'`.
 -/
-theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι : Type _} {L : Filter ι}
+theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι : Type*} {L : Filter ι}
     [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : ProbabilityMeasure Ω}
     {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {E : Set Ω}
     (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E)) := by
@@ -429,7 +429,7 @@ TODO: The proof of the implication is not yet here. Add it.
 -/
 
 
-variable {Ω : Type _} [PseudoEMetricSpace Ω] [MeasurableSpace Ω] [OpensMeasurableSpace Ω]
+variable {Ω : Type*} [PseudoEMetricSpace Ω] [MeasurableSpace Ω] [OpensMeasurableSpace Ω]
 
 theorem exists_null_frontier_thickening (μ : Measure Ω) [SigmaFinite μ] (s : Set Ω) {a b : ℝ}
     (hab : a < b) : ∃ r ∈ Ioo a b, μ (frontier (Metric.thickening r s)) = 0 := by
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Kalle Kytölä. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kalle Kytölä
-
-! This file was ported from Lean 3 source module measure_theory.measure.portmanteau
-! leanprover-community/mathlib commit fd5edc43dc4f10b85abfe544b88f82cf13c5f844
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.MeasureTheory.Measure.ProbabilityMeasure
 import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
 
+#align_import measure_theory.measure.portmanteau from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
+
 /-!
 # Characterizations of weak convergence of finite measures and probability measures
 
fix: change compl precedence (#5586)

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -107,12 +107,12 @@ variable {Ω : Type _} [MeasurableSpace Ω]
 theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i E) ≤ μ E) :
-    μ (Eᶜ) ≤ L.liminf fun i => μs i (Eᶜ) := by
+    μ Eᶜ ≤ L.liminf fun i => μs i Eᶜ := by
   rcases L.eq_or_neBot with rfl | hne
   · simp only [liminf_bot, le_top]
-  have meas_Ec : μ (Eᶜ) = 1 - μ E := by
+  have meas_Ec : μ Eᶜ = 1 - μ E := by
     simpa only [measure_univ] using measure_compl E_mble (measure_lt_top μ E).ne
-  have meas_i_Ec : ∀ i, μs i (Eᶜ) = 1 - μs i E := by
+  have meas_i_Ec : ∀ i, μs i Eᶜ = 1 - μs i E := by
     intro i
     simpa only [measure_univ] using measure_compl E_mble (measure_lt_top (μs i) E).ne
   simp_rw [meas_Ec, meas_i_Ec]
@@ -127,7 +127,7 @@ theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter 
 
 theorem le_measure_liminf_of_limsup_measure_compl_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
-    (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i (Eᶜ)) ≤ μ (Eᶜ)) :
+    (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i Eᶜ) ≤ μ Eᶜ) :
     μ E ≤ L.liminf fun i => μs i E :=
   compl_compl E ▸ le_measure_compl_liminf_of_limsup_measure_le (MeasurableSet.compl E_mble) h
 #align measure_theory.le_measure_liminf_of_limsup_measure_compl_le MeasureTheory.le_measure_liminf_of_limsup_measure_compl_le
@@ -135,12 +135,12 @@ theorem le_measure_liminf_of_limsup_measure_compl_le {ι : Type _} {L : Filter 
 theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ E ≤ L.liminf fun i => μs i E) :
-    (L.limsup fun i => μs i (Eᶜ)) ≤ μ (Eᶜ) := by
+    (L.limsup fun i => μs i Eᶜ) ≤ μ Eᶜ := by
   rcases L.eq_or_neBot with rfl | hne
   · simp only [limsup_bot, bot_le]
-  have meas_Ec : μ (Eᶜ) = 1 - μ E := by
+  have meas_Ec : μ Eᶜ = 1 - μ E := by
     simpa only [measure_univ] using measure_compl E_mble (measure_lt_top μ E).ne
-  have meas_i_Ec : ∀ i, μs i (Eᶜ) = 1 - μs i E := by
+  have meas_i_Ec : ∀ i, μs i Eᶜ = 1 - μs i E := by
     intro i
     simpa only [measure_univ] using measure_compl E_mble (measure_lt_top (μs i) E).ne
   simp_rw [meas_Ec, meas_i_Ec]
@@ -155,7 +155,7 @@ theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter 
 
 theorem limsup_measure_le_of_le_liminf_measure_compl {ι : Type _} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
-    (E_mble : MeasurableSet E) (h : μ (Eᶜ) ≤ L.liminf fun i => μs i (Eᶜ)) :
+    (E_mble : MeasurableSet E) (h : μ Eᶜ ≤ L.liminf fun i => μs i Eᶜ) :
     (L.limsup fun i => μs i E) ≤ μ E :=
   compl_compl E ▸ limsup_measure_compl_le_of_le_liminf_measure (MeasurableSet.compl E_mble) h
 #align measure_theory.limsup_measure_le_of_le_liminf_measure_compl MeasureTheory.limsup_measure_le_of_le_liminf_measure_compl
@@ -179,10 +179,10 @@ theorem limsup_measure_closed_le_iff_liminf_measure_open_ge {ι : Type _} {L : F
   constructor
   · intro h G G_open
     exact le_measure_liminf_of_limsup_measure_compl_le
-      G_open.measurableSet (h (Gᶜ) (isClosed_compl_iff.mpr G_open))
+      G_open.measurableSet (h Gᶜ (isClosed_compl_iff.mpr G_open))
   · intro h F F_closed
     exact limsup_measure_le_of_le_liminf_measure_compl
-      F_closed.measurableSet (h (Fᶜ) (isOpen_compl_iff.mpr F_closed))
+      F_closed.measurableSet (h Fᶜ (isOpen_compl_iff.mpr F_closed))
 #align measure_theory.limsup_measure_closed_le_iff_liminf_measure_open_ge MeasureTheory.limsup_measure_closed_le_iff_liminf_measure_open_ge
 
 end LimsupClosedLEAndLELiminfOpen
feat: add Filter.eq_or_neBot (#5230)

Also add Filter.limsup_bot, Filter.liminf_bot, and golf some proofs using new lemmas.

Diff
@@ -102,17 +102,14 @@ Either of these will later be shown to be equivalent to the weak convergence of
 of measures.
 -/
 
-
 variable {Ω : Type _} [MeasurableSpace Ω]
 
 theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type _} {L : Filter ι} {μ : Measure Ω}
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i E) ≤ μ E) :
     μ (Eᶜ) ≤ L.liminf fun i => μs i (Eᶜ) := by
-  by_cases L_bot : L = ⊥
-  · simp only [L_bot, le_top,
-      show liminf (fun i => μs i (Eᶜ)) ⊥ = ⊤ by simp only [liminf, Filter.map_bot, limsInf_bot]]
-  have : L.NeBot := { ne' := L_bot }
+  rcases L.eq_or_neBot with rfl | hne
+  · simp only [liminf_bot, le_top]
   have meas_Ec : μ (Eᶜ) = 1 - μ E := by
     simpa only [measure_univ] using measure_compl E_mble (measure_lt_top μ E).ne
   have meas_i_Ec : ∀ i, μs i (Eᶜ) = 1 - μs i E := by
@@ -139,10 +136,8 @@ theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type _} {L : Filter 
     {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
     (E_mble : MeasurableSet E) (h : μ E ≤ L.liminf fun i => μs i E) :
     (L.limsup fun i => μs i (Eᶜ)) ≤ μ (Eᶜ) := by
-  by_cases L_bot : L = ⊥
-  · simp only [L_bot, bot_le,
-      show limsup (fun i => μs i (Eᶜ)) ⊥ = ⊥ by simp only [limsup, Filter.map_bot, limsSup_bot]]
-  have : L.NeBot := { ne' := L_bot }
+  rcases L.eq_or_neBot with rfl | hne
+  · simp only [limsup_bot, bot_le]
   have meas_Ec : μ (Eᶜ) = 1 - μ E := by
     simpa only [measure_univ] using measure_compl E_mble (measure_lt_top μ E).ne
   have meas_i_Ec : ∀ i, μs i (Eᶜ) = 1 - μs i E := by
@@ -341,8 +336,8 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
     [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] {μ : FiniteMeasure Ω}
     {μs : ι → FiniteMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ)) {F : Set Ω} (F_closed : IsClosed F) :
     (L.limsup fun i => (μs i : Measure Ω) F) ≤ (μ : Measure Ω) F := by
-  by_cases L = ⊥
-  · simp only [h, limsup, Filter.map_bot, limsSup_bot, ENNReal.bot_eq_zero, zero_le]
+  rcases L.eq_or_neBot with rfl | hne
+  · simp only [limsup_bot, bot_le]
   apply ENNReal.le_of_forall_pos_le_add
   intro ε ε_pos _
   let δs := fun n : ℕ => (1 : ℝ) / (n + 1)
@@ -367,7 +362,6 @@ theorem FiniteMeasure.limsup_measure_closed_le_of_tendsto {Ω ι : Type _} {L :
   have ev_near' := Eventually.mono ev_near fun n => le_trans
     (measure_le_lintegral_thickenedIndicator (μs n : Measure Ω) F_closed.measurableSet (δs_pos M))
   apply (Filter.limsup_le_limsup ev_near').trans
-  have : NeBot L := ⟨h⟩
   rw [limsup_const]
   apply le_trans (add_le_add (hM M rfl.le).le (le_refl (ε / 2 : ℝ≥0∞)))
   simp only [add_assoc, ENNReal.add_halves, le_refl]
chore: tidy various files (#5482)
Diff
@@ -88,7 +88,7 @@ open scoped Topology ENNReal NNReal BoundedContinuousFunction
 
 namespace MeasureTheory
 
-section LimsupClosedLeAndLeLiminfOpen
+section LimsupClosedLEAndLELiminfOpen
 
 /-! ### Portmanteau: limsup condition for closed sets iff liminf condition for open sets
 
@@ -190,7 +190,7 @@ theorem limsup_measure_closed_le_iff_liminf_measure_open_ge {ι : Type _} {L : F
       F_closed.measurableSet (h (Fᶜ) (isOpen_compl_iff.mpr F_closed))
 #align measure_theory.limsup_measure_closed_le_iff_liminf_measure_open_ge MeasureTheory.limsup_measure_closed_le_iff_liminf_measure_open_ge
 
-end LimsupClosedLeAndLeLiminfOpen
+end LimsupClosedLEAndLELiminfOpen
 
 -- section
 section TendstoOfNullFrontier
@@ -258,7 +258,7 @@ theorem tendsto_measure_of_null_frontier {ι : Type _} {L : Filter ι} {μ : Mea
 end TendstoOfNullFrontier
 
 --section
-section ConvergenceImpliesLimsupClosedLe
+section ConvergenceImpliesLimsupClosedLE
 
 /-! ### Portmanteau implication: weak convergence implies a limsup condition for closed sets
 
@@ -427,10 +427,10 @@ theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι :
   exact (ENNReal.tendsto_toNNReal (measure_ne_top (↑μ) E)).comp key
 #align measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto
 
-end ConvergenceImpliesLimsupClosedLe
+end ConvergenceImpliesLimsupClosedLE
 
 --section
-section LimitBorelImpliesLimsupClosedLe
+section LimitBorelImpliesLimsupClosedLE
 
 /-! ### Portmanteau implication: limit condition for Borel sets implies limsup for closed sets
 
@@ -465,7 +465,7 @@ theorem exists_null_frontiers_thickening (μ : Measure Ω) [SigmaFinite μ] (s :
   · exact fun n => ⟨(obs n).choose_spec.1.1, (obs n).choose_spec.2⟩
 #align measure_theory.exists_null_frontiers_thickening MeasureTheory.exists_null_frontiers_thickening
 
-end LimitBorelImpliesLimsupClosedLe
+end LimitBorelImpliesLimsupClosedLE
 
 --section
 end MeasureTheory
feat: port MeasureTheory.Measure.Portmanteau (#4938)

Dependencies 12 + 998

999 files ported (98.8%)
457429 lines ported (98.8%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file