77
88public import Mathlib.MeasureTheory.Measure.ProbabilityMeasure
99public import Mathlib.MeasureTheory.Measure.Tight
10+
1011import Mathlib.MeasureTheory.Integral.Regular
1112import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real
12- import Mathlib.Topology.Separation.CompletelyRegular
13+ import Mathlib.MeasureTheory.Measure.LevyProkhorovMetric
1314
1415/-!
1516# Prokhorov theorem
@@ -26,6 +27,8 @@ notably several versions of Prokhorov theorem on tight sets of probability measu
2627 to the complement of `Kₙ` form a compact set.
2728* `isCompact_closure_of_isTightMeasureSet`: Given a tight set of probability measures, its closure
2829 is compact.
30+ * `isTightMeasureSet_of_isCompact_closure`: In a second countable complete metric space, a set of
31+ probability measures with compact closure is tight.
2932
3033 Versions are also given for finite measures.
3134
@@ -51,9 +54,13 @@ check the condition.
5154
5255public section
5356
54- open scoped ENNReal NNReal CompactlySupported
55- open Filter Function Set Topology TopologicalSpace MeasureTheory BoundedContinuousFunction
56- MeasureTheory.FiniteMeasure
57+ open scoped CompactlySupported
58+ open Metric ENNReal NNReal Filter Set Topology TopologicalSpace MeasureTheory
59+ BoundedContinuousFunction
60+
61+ section Forward
62+
63+ open FiniteMeasure
5764
5865variable {E : Type *} [MeasurableSpace E] [TopologicalSpace E] [T2Space E] [BorelSpace E]
5966
@@ -525,3 +532,151 @@ lemma isCompact_closure_of_isTightMeasureSet {S : Set (ProbabilityMeasure E)}
525532 apply subset_biUnion_of_mem
526533 exact le_rfl (a := n)
527534 _ ≤ u n := by grind
535+
536+ end Forward
537+
538+ section Backward
539+
540+ open ProbabilityMeasure
541+
542+ namespace MeasureTheory
543+
544+ variable {𝓧 : Type *} {m𝓧 : MeasurableSpace 𝓧} {μ : Measure 𝓧} [PseudoMetricSpace 𝓧]
545+ [OpensMeasurableSpace 𝓧] [SecondCountableTopology 𝓧] {S : Set (ProbabilityMeasure 𝓧)}
546+
547+ lemma exists_measure_iUnion_gt_of_isCompact_closure
548+ (U : ℕ → Set 𝓧) (O : ∀ i, IsOpen (U i)) (Cov : ⋃ i, U i = univ) (hcomp : IsCompact (closure S))
549+ (ε : ℝ≥0 ∞) (hε : 0 < ε) (hεbound : ε ≤ 1 ) :
550+ ∃ (k : ℕ), ∀ μ ∈ S, 1 - ε < μ (⋃ i ≤ k, U i) := by
551+ have εfin : ε ≠ ∞ := ne_top_of_le_ne_top (by simp) hεbound
552+ lift ε to ℝ≥0 using εfin
553+ obtain ⟨ε, hε', rfl⟩ : ∃ (ε' : ℝ) (hε' : 0 ≤ ε'), ε = .mk ε' hε' := ⟨↑ε, ε.2 , rfl⟩
554+ simp only [ENNReal.coe_pos, ← NNReal.coe_lt_coe, NNReal.coe_zero, coe_mk, coe_le_one_iff,
555+ ← NNReal.coe_le_coe, NNReal.coe_one] at hε hεbound
556+ by_contra! nh
557+ choose μ hμInS hcontradiction using nh
558+ obtain ⟨μlim, _, sub, hsubmono, hμconverges⟩ :=
559+ hcomp.isSeqCompact (fun n ↦ subset_closure <| hμInS n)
560+ have Measurebound n : (μlim (⋃ (i ≤ n), U i) : ℝ) ≤ 1 - ε := calc
561+ (μlim (⋃ (i ≤ n), U i) : ℝ)
562+ _ ≤ liminf (fun k ↦ (μ (sub k) (⋃ (i ≤ n), U i) : ℝ)) atTop := by
563+ have hopen : IsOpen (⋃ i ≤ n, U i) := isOpen_biUnion fun i a ↦ O i
564+ have := ProbabilityMeasure.le_liminf_measure_open_of_tendsto hμconverges hopen
565+ simp_rw [Function.comp_apply, ← ennreal_coeFn_eq_coeFn_toMeasure] at this
566+ rw [← ofNNReal_liminf] at this
567+ · exact mod_cast this
568+ use 1
569+ simpa [ge_iff_le, eventually_map, eventually_atTop, forall_exists_index] using fun _ x h ↦
570+ (h x (by simp)).trans <| ProbabilityMeasure.apply_le_one (μ (sub x)) (⋃ i ≤ n, U i)
571+ _ ≤ liminf (fun k ↦ (μ (sub k) (⋃ (i ≤ sub k), U i) : ℝ)) atTop := by
572+ apply Filter.liminf_le_liminf
573+ · simp only [NNReal.coe_le_coe, eventually_atTop, ge_iff_le]
574+ use n + 1
575+ intro b hypo
576+ refine (μ (sub b)).apply_mono
577+ <| Set.biUnion_mono (fun i (hi : i ≤ n) ↦ hi.trans ?_) fun _ _ ↦ le_rfl
578+ exact le_trans (Nat.le_add_right n 1 ) (le_trans hypo (StrictMono.le_apply hsubmono))
579+ · use 0 ; simp
580+ · use 1
581+ simpa [ge_iff_le, eventually_map, eventually_atTop, ge_iff_le, forall_exists_index] using
582+ fun _ d hyp ↦ (hyp d (by simp)).trans (by simp)
583+ _ ≤ 1 - ε := by
584+ apply Filter.liminf_le_of_le
585+ · use 0 ; simp
586+ simp only [eventually_atTop, ge_iff_le, forall_exists_index]
587+ intro b c h
588+ apply le_trans (h c le_rfl)
589+ refine (ofReal_le_ofReal_iff (by rw [sub_nonneg]; exact hεbound)).mp ?_
590+ rw [ofReal_coe_nnreal]
591+ apply le_trans (hcontradiction (sub c))
592+ norm_cast
593+ have accumulation : Tendsto (fun n ↦ μlim (⋃ i ≤ n, U i)) atTop (𝓝 (μlim (⋃ i, U i))) := by
594+ simp_rw [← Set.accumulate_def, ProbabilityMeasure.tendsto_measure_iUnion_accumulate]
595+ rw [Cov, coeFn_univ, ← NNReal.tendsto_coe] at accumulation
596+ have exceeds_bound : ∀ᶠ n in atTop, (1 - ε / 2 : ℝ) ≤ μlim (⋃ i ≤ n, U i) :=
597+ Tendsto.eventually_const_le (v := 1 )
598+ (by simp only [sub_lt_self_iff, Nat.ofNat_pos, div_pos_iff_of_pos_right]; positivity)
599+ accumulation
600+ suffices ∀ᶠ n : ℕ in atTop, False from this.exists.choose_spec
601+ filter_upwards [exceeds_bound] with n hn
602+ linarith [hn.trans <| Measurebound n]
603+
604+ variable [CompleteSpace 𝓧]
605+
606+ /-- In a second countable complete metric space, a set of probability measures with compact closure
607+ is tight. -/
608+ theorem isTightMeasureSet_of_isCompact_closure (hcomp : IsCompact (closure S)) :
609+ IsTightMeasureSet {((μ : ProbabilityMeasure 𝓧) : Measure 𝓧) | μ ∈ S} := by
610+ rw [isTightMeasureSet_iff_exists_isCompact_measure_compl_le]
611+ rcases isEmpty_or_nonempty 𝓧 with hempty | hnonempty
612+ · rw [← univ_eq_empty_iff] at hempty
613+ exact fun ε εpos ↦ ⟨∅, isCompact_empty, by simp [hempty]⟩
614+ obtain ⟨D, hD⟩ := exists_dense_seq 𝓧
615+ obtain ⟨u, hu_anti, hu_pos, hu⟩ : ∃ u, StrictAnti u ∧ (∀ n, 0 < u n) ∧ Tendsto u atTop (𝓝 0 ) :=
616+ exists_seq_strictAnti_tendsto (0 : ℝ)
617+ have hcov (m : ℕ) : ⋃ i, ball (D i) (u m) = univ := by
618+ rw [denseRange_iff] at hD
619+ ext p
620+ exact ⟨fun a ↦ trivial, fun _ ↦ mem_iUnion.mpr <| hD p (u m) (hu_pos m)⟩
621+ intro ε εpos
622+ rcases lt_or_ge 1 ε with hεbound | hεbound
623+ · refine ⟨∅, isCompact_empty, fun μ hμ ↦ ?_⟩
624+ simp only [mem_setOf_eq] at hμ
625+ obtain ⟨μ', hμ', rfl⟩ := hμ
626+ rw [compl_empty, measure_univ]
627+ exact le_of_lt hεbound
628+ have byclaim (m : ℕ) : ∃ k, ∀ μ ∈ S, 1 - (ε * 2 ^ (-m : ℤ) : ℝ≥0 ∞) <
629+ μ (⋃ i ≤ k, ball (D i) (u m)) := by
630+ refine exists_measure_iUnion_gt_of_isCompact_closure
631+ (fun i ↦ ball (D i) (u m)) (fun _ ↦ isOpen_ball) (hcov m) hcomp (ε * 2 ^ (-m : ℤ)) ?_ ?_
632+ · simpa using ⟨εpos, (ENNReal.zpow_pos (by simp) (by simp) (-↑m))⟩
633+ · exact Left.mul_le_one hεbound <| zpow_le_one_of_nonpos (by linarith) (by simp)
634+ choose! km hbound using byclaim
635+ -- This is a set we can construct to show tightness
636+ let bigK := ⋂ m, ⋃ (i ≤ km (m + 1 )), closure (ball (D i) (u m))
637+ have bigcalc (μ : ProbabilityMeasure 𝓧) (hs : μ ∈ S) : μ.toMeasure bigKᶜ ≤ ε := calc
638+ μ.toMeasure bigKᶜ
639+ _ = μ.toMeasure (⋃ m, (⋃ (i ≤ km (m + 1 )), closure (ball (D i) (u m)))ᶜ) := by simp [bigK]
640+ _ ≤ ∑' m, μ.toMeasure (⋃ (i ≤ km (m + 1 )), closure (ball (D i) (u m)))ᶜ :=
641+ measure_iUnion_le _
642+ _ = ∑' m, (1 - μ.toMeasure (⋃ (i ≤ km (m + 1 )), closure (ball (D i) (u m)))) := by
643+ congr! with m; rw [measure_compl (by measurability) (by simp)]; simp
644+ _ ≤ (∑' (m : ℕ), (ε : ℝ≥0 ∞) * 2 ^ (-(m + 1 ) : ℤ)) := by
645+ refine ENNReal.tsum_le_tsum fun m ↦ tsub_le_iff_tsub_le.mp ?_
646+ replace hbound := (hbound (m + 1 ) μ hs).le
647+ simp_all only [neg_add_rev, Int.reduceNeg, tsub_le_iff_right, Nat.cast_add, Nat.cast_one,
648+ ← coe_ofNat, ← ProbabilityMeasure.ennreal_coeFn_eq_coeFn_toMeasure]
649+ grw [hbound]
650+ gcongr with i hi
651+ grw [← subset_closure (s := ball (D i) (u m)), ball_subset_ball]
652+ exact hu_anti.antitone (by grind)
653+ _ = ε := by
654+ rw [ENNReal.tsum_mul_left]
655+ nth_rw 2 [← mul_one (a := ε)]
656+ congr
657+ ring_nf
658+ exact tsum_two_zpow_neg_add_one
659+ -- Final proof
660+ refine ⟨bigK, ?_, by simpa⟩
661+ -- Compactness first
662+ refine TotallyBounded.isCompact_of_isClosed ?_ ?_
663+ --Totally bounded
664+ · refine Metric.totallyBounded_iff.mpr fun δ δpos ↦ ?_
665+ have ⟨δ_inv, hδ_inv⟩ : ∃ x, u x < δ := (Tendsto.eventually_lt_const δpos hu).exists
666+ refine ⟨D '' .Iic (km (δ_inv + 1 )), (Set.finite_Iic _).image _, ?_⟩
667+ -- t should be image under D of the set of numbers less than km of δ_inv
668+ simp only [mem_image, iUnion_exists, biUnion_and', iUnion_iUnion_eq_right, bigK]
669+ calc
670+ ⋂ m, ⋃ i ≤ km (m + 1 ), closure (ball (D i) (u m))
671+ _ ⊆ ⋃ i ≤ km (δ_inv + 1 ), closure (ball (D i) (u δ_inv)) := iInter_subset ..
672+ _ ⊆ ⋃ i ≤ km (δ_inv + 1 ), ball (D i) δ := by
673+ gcongr
674+ exact closure_ball_subset_closedBall.trans <| closedBall_subset_ball <| hδ_inv
675+ -- Closedness
676+ · simp_rw [bigK, ← Set.mem_Iic]
677+ exact isClosed_iInter fun n =>
678+ Finite.isClosed_biUnion (finite_Iic _) (fun _ _ ↦ isClosed_closure)
679+
680+ end MeasureTheory -- namespace
681+
682+ end Backward
0 commit comments