File: Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean

full_name: MeasureTheory.levyProkhorovEDist
code: /-- The Lévy-Prokhorov edistance between measures:
`d(μ,ν) = inf {r ≥ 0 | ∀ B, μ B ≤ ν Bᵣ + r ∧ ν B ≤ μ Bᵣ + r}`. -/
noncomputable def levyProkhorovEDist (μ ν : Measure Ω) : ℝ≥0∞ 
goal: ℝ≥0∞

full_name: MeasureTheory.meas_le_of_le_of_forall_le_meas_thickening_add
code: lemma meas_le_of_le_of_forall_le_meas_thickening_add {ε₁ ε₂ : ℝ≥0∞} (μ ν : Measure Ω)
    (h_le : ε₁ ≤ ε₂) {B : Set Ω} (hε₁ : μ B ≤ ν (thickening ε₁.toReal B) + ε₁) :
    μ B ≤ ν (thickening ε₂.toReal B) + ε₂ 
goal: μ B ≤ ν (Metric.thickening ε₂.toReal B) + ε₂

full_name: MeasureTheory.left_measure_le_of_levyProkhorovEDist_lt
code: lemma left_measure_le_of_levyProkhorovEDist_lt {μ ν : Measure Ω} {c : ℝ≥0∞}
    (h : levyProkhorovEDist μ ν < c) {B : Set Ω} (B_mble : MeasurableSet B) :
    μ B ≤ ν (thickening c.toReal B) + c 
goal: μ B ≤ ν (Metric.thickening c.toReal B) + c

full_name: MeasureTheory.right_measure_le_of_levyProkhorovEDist_lt
code: lemma right_measure_le_of_levyProkhorovEDist_lt {μ ν : Measure Ω} {c : ℝ≥0∞}
    (h : levyProkhorovEDist μ ν < c) {B : Set Ω} (B_mble : MeasurableSet B) :
    ν B ≤ μ (thickening c.toReal B) + c 
goal: ν B ≤ μ (Metric.thickening c.toReal B) + c

full_name: MeasureTheory.levyProkhorovEDist_le_of_forall_add_pos_le
code: /-- A general sufficient condition for bounding `levyProkhorovEDist` from above. -/
lemma levyProkhorovEDist_le_of_forall_add_pos_le (μ ν : Measure Ω) (δ : ℝ≥0∞)
    (h : ∀ ε B, 0 < ε → ε < ∞ → MeasurableSet B →
      μ B ≤ ν (thickening (δ + ε).toReal B) + δ + ε ∧
      ν B ≤ μ (thickening (δ + ε).toReal B) + δ + ε) :
    levyProkhorovEDist μ ν ≤ δ 
goal: MeasureTheory.levyProkhorovEDist μ ν ≤ δ

full_name: MeasureTheory.levyProkhorovEDist_le_of_forall
code: /-- A simple general sufficient condition for bounding `levyProkhorovEDist` from above. -/
lemma levyProkhorovEDist_le_of_forall (μ ν : Measure Ω) (δ : ℝ≥0∞)
    (h : ∀ ε B, δ < ε → ε < ∞ → MeasurableSet B →
        μ B ≤ ν (thickening ε.toReal B) + ε ∧ ν B ≤ μ (thickening ε.toReal B) + ε) :
    levyProkhorovEDist μ ν ≤ δ 
goal: MeasureTheory.levyProkhorovEDist μ ν ≤ δ

full_name: MeasureTheory.levyProkhorovEDist_le_max_measure_univ
code: lemma levyProkhorovEDist_le_max_measure_univ (μ ν : Measure Ω) :
    levyProkhorovEDist μ ν ≤ max (μ univ) (ν univ) 
goal: MeasureTheory.levyProkhorovEDist μ ν ≤ max (μ Set.univ) (ν Set.univ)

full_name: MeasureTheory.levyProkhorovEDist_lt_top
code: lemma levyProkhorovEDist_lt_top (μ ν : Measure Ω) [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
    levyProkhorovEDist μ ν < ∞ 
goal: MeasureTheory.levyProkhorovEDist μ ν < ⊤

full_name: MeasureTheory.levyProkhorovEDist_ne_top
code: lemma levyProkhorovEDist_ne_top (μ ν : Measure Ω) [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
    levyProkhorovEDist μ ν ≠ ∞ 
goal: MeasureTheory.levyProkhorovEDist μ ν ≠ ⊤

full_name: MeasureTheory.levyProkhorovEDist_self
code: lemma levyProkhorovEDist_self (μ : Measure Ω) :
    levyProkhorovEDist μ μ = 0 
goal: MeasureTheory.levyProkhorovEDist μ μ = 0

full_name: MeasureTheory.levyProkhorovEDist_comm
code: lemma levyProkhorovEDist_comm (μ ν : Measure Ω) :
    levyProkhorovEDist μ ν = levyProkhorovEDist ν μ 
goal: MeasureTheory.levyProkhorovEDist μ ν = MeasureTheory.levyProkhorovEDist ν μ

full_name: MeasureTheory.levyProkhorovEDist_triangle
code: lemma levyProkhorovEDist_triangle [OpensMeasurableSpace Ω] (μ ν κ : Measure Ω) :
    levyProkhorovEDist μ κ ≤ levyProkhorovEDist μ ν + levyProkhorovEDist ν κ 
goal: MeasureTheory.levyProkhorovEDist μ κ ≤ MeasureTheory.levyProkhorovEDist μ ν + MeasureTheory.levyProkhorovEDist ν κ

full_name: MeasureTheory.levyProkhorovDist
code: /-- The Lévy-Prokhorov distance between finite measures:
`d(μ,ν) = inf {r ≥ 0 | ∀ B, μ B ≤ ν Bᵣ + r ∧ ν B ≤ μ Bᵣ + r}`. -/
noncomputable def levyProkhorovDist (μ ν : Measure Ω) : ℝ 
goal: ℝ

full_name: MeasureTheory.levyProkhorovDist_self
code: lemma levyProkhorovDist_self (μ : Measure Ω) :
    levyProkhorovDist μ μ = 0 
goal: MeasureTheory.levyProkhorovDist μ μ = 0

full_name: MeasureTheory.levyProkhorovDist_comm
code: lemma levyProkhorovDist_comm (μ ν : Measure Ω) :
    levyProkhorovDist μ ν = levyProkhorovDist ν μ 
goal: MeasureTheory.levyProkhorovDist μ ν = MeasureTheory.levyProkhorovDist ν μ

full_name: MeasureTheory.levyProkhorovDist_triangle
code: lemma levyProkhorovDist_triangle [OpensMeasurableSpace Ω] (μ ν κ : Measure Ω)
    [IsFiniteMeasure μ] [IsFiniteMeasure ν] [IsFiniteMeasure κ] :
    levyProkhorovDist μ κ ≤ levyProkhorovDist μ ν + levyProkhorovDist ν κ 
goal: MeasureTheory.levyProkhorovDist μ κ ≤ MeasureTheory.levyProkhorovDist μ ν + MeasureTheory.levyProkhorovDist ν κ

full_name: MeasureTheory.LevyProkhorov
code: /-- A type synonym, to be used for `Measure α`, `FiniteMeasure α`, or `ProbabilityMeasure α`,
when they are to be equipped with the Lévy-Prokhorov distance. -/
def LevyProkhorov (α : Type*) 
goal: Type u_3

full_name: MeasureTheory.instPseudoEMetricSpaceLevyProkhorovMeasure
code: /-- The Lévy-Prokhorov distance `levyProkhorovEDist` makes `Measure Ω` a pseudoemetric
space. The instance is recorded on the type synonym `LevyProkhorov (Measure Ω) := Measure Ω`. -/
noncomputable instance : PseudoEMetricSpace (LevyProkhorov (Measure Ω)) 
goal: PseudoEMetricSpace (MeasureTheory.LevyProkhorov (MeasureTheory.Measure Ω))

full_name: MeasureTheory.levyProkhorovDist_pseudoMetricSpace_finiteMeasure
code: /-- The Lévy-Prokhorov distance `levyProkhorovDist` makes `FiniteMeasure Ω` a pseudometric
space. The instance is recorded on the type synonym
`LevyProkhorov (FiniteMeasure Ω) := FiniteMeasure Ω`. -/
noncomputable instance levyProkhorovDist_pseudoMetricSpace_finiteMeasure :
    PseudoMetricSpace (LevyProkhorov (FiniteMeasure Ω)) 
goal: PseudoMetricSpace (MeasureTheory.LevyProkhorov (MeasureTheory.FiniteMeasure Ω))

full_name: MeasureTheory.levyProkhorovDist_pseudoMetricSpace_probabilityMeasure
code: /-- The Lévy-Prokhorov distance `levyProkhorovDist` makes `ProbabilityMeasure Ω` a pseudoemetric
space. The instance is recorded on the type synonym
`LevyProkhorov (ProbabilityMeasure Ω) := ProbabilityMeasure Ω`. -/
noncomputable instance levyProkhorovDist_pseudoMetricSpace_probabilityMeasure :
    PseudoMetricSpace (LevyProkhorov (ProbabilityMeasure Ω)) 
goal: PseudoMetricSpace (MeasureTheory.LevyProkhorov (MeasureTheory.ProbabilityMeasure Ω))

full_name: MeasureTheory.LevyProkhorov.dist_def
code: lemma LevyProkhorov.dist_def (μ ν : LevyProkhorov (ProbabilityMeasure Ω)) :
    dist μ ν = levyProkhorovDist μ.toMeasure ν.toMeasure 
goal: dist μ ν = MeasureTheory.levyProkhorovDist ↑μ ↑ν

full_name: MeasureTheory.levyProkhorovEDist_le_of_forall_le
code: /-- A simple sufficient condition for bounding `levyProkhorovEDist` between probability measures
from above. The condition involves only one of two natural bounds, the other bound is for free. -/
lemma levyProkhorovEDist_le_of_forall_le
    (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (δ : ℝ≥0∞)
    (h : ∀ ε B, δ < ε → ε < ∞ → MeasurableSet B → μ B ≤ ν (thickening ε.toReal B) + ε) :
    levyProkhorovEDist μ ν ≤ δ 
goal: MeasureTheory.levyProkhorovEDist μ ν ≤ δ

full_name: MeasureTheory.levyProkhorovDist_le_of_forall_le
code: /-- A simple sufficient condition for bounding `levyProkhorovDist` between probability measures
from above. The condition involves only one of two natural bounds, the other bound is for free. -/
lemma levyProkhorovDist_le_of_forall_le
    (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] {δ : ℝ} (δ_nn : 0 ≤ δ)
    (h : ∀ ε B, δ < ε → MeasurableSet B → μ B ≤ ν (thickening ε B) + ENNReal.ofReal ε) :
    levyProkhorovDist μ ν ≤ δ 
goal: MeasureTheory.levyProkhorovDist μ ν ≤ δ

full_name: MeasureTheory.LevyProkhorov.toProbabilityMeasure
code: /-- Coercion from the type synonym `LevyProkhorov (ProbabilityMeasure Ω)`
to `ProbabilityMeasure Ω`. -/
def LevyProkhorov.toProbabilityMeasure (μ : LevyProkhorov (ProbabilityMeasure Ω)) :
    ProbabilityMeasure Ω 
goal: MeasureTheory.ProbabilityMeasure Ω

full_name: MeasureTheory.ProbabilityMeasure.toLevyProkhorov
code: /-- Coercion to the type synonym `LevyProkhorov (ProbabilityMeasure Ω)`
from `ProbabilityMeasure Ω`. -/
def ProbabilityMeasure.toLevyProkhorov (μ : ProbabilityMeasure Ω) :
    LevyProkhorov (ProbabilityMeasure Ω) 
goal: MeasureTheory.LevyProkhorov (MeasureTheory.ProbabilityMeasure Ω)

full_name: MeasureTheory.LevyProkhorov.finiteMeasure
code: /-- Coercion from the type synonym `LevyProkhorov (FiniteMeasure Ω)` to `FiniteMeasure Ω`. -/
def LevyProkhorov.finiteMeasure (μ : LevyProkhorov (FiniteMeasure Ω)) :
    FiniteMeasure Ω 
goal: MeasureTheory.FiniteMeasure Ω

full_name: MeasureTheory.BoundedContinuousFunction.integral_eq_integral_meas_le_of_hasFiniteIntegral
code: /-- A version of the layer cake formula for bounded continuous functions which have finite integral:
∫ f dμ = ∫ t in (0, ‖f‖], μ {x | f(x) ≥ t} dt. -/
lemma BoundedContinuousFunction.integral_eq_integral_meas_le_of_hasFiniteIntegral
    {α : Type*} [MeasurableSpace α] [TopologicalSpace α] [OpensMeasurableSpace α]
    (f : α →ᵇ ℝ) (μ : Measure α) (f_nn : 0 ≤ᵐ[μ] f) (hf : HasFiniteIntegral f μ) :
    ∫ ω, f ω ∂μ = ∫ t in Ioc 0 ‖f‖, ENNReal.toReal (μ {a : α | t ≤ f a}) 
goal: ∫ (ω : α), f ω ∂μ = ∫ (t : ℝ) in Set.Ioc 0 ‖f‖, (μ {a | t ≤ f a}).toReal

full_name: MeasureTheory.BoundedContinuousFunction.integral_eq_integral_meas_le
code: /-- A version of the layer cake formula for bounded continuous functions and finite measures:
∫ f dμ = ∫ t in (0, ‖f‖], μ {x | f(x) ≥ t} dt. -/
lemma BoundedContinuousFunction.integral_eq_integral_meas_le
    {α : Type*} [MeasurableSpace α] [TopologicalSpace α] [OpensMeasurableSpace α]
    (f : α →ᵇ ℝ) (μ : Measure α) [IsFiniteMeasure μ] (f_nn : 0 ≤ᵐ[μ] f) :
    ∫ ω, f ω ∂μ = ∫ t in Ioc 0 ‖f‖, ENNReal.toReal (μ {a : α | t ≤ f a}) 
goal: ∫ (ω : α), f ω ∂μ = ∫ (t : ℝ) in Set.Ioc 0 ‖f‖, (μ {a | t ≤ f a}).toReal

full_name: MeasureTheory.BoundedContinuousFunction.integral_le_of_levyProkhorovEDist_lt
code: /-- Assuming `levyProkhorovEDist μ ν < ε`, we can bound `∫ f ∂μ` in terms of
`∫ t in (0, ‖f‖], ν (thickening ε {x | f(x) ≥ t}) dt` and `‖f‖`. -/
lemma BoundedContinuousFunction.integral_le_of_levyProkhorovEDist_lt (μ ν : Measure Ω)
    [IsFiniteMeasure μ] [IsFiniteMeasure ν] {ε : ℝ} (ε_pos : 0 < ε)
    (hμν : levyProkhorovEDist μ ν < ENNReal.ofReal ε) (f : Ω →ᵇ ℝ) (f_nn : 0 ≤ᵐ[μ] f) :
    ∫ ω, f ω ∂μ
      ≤ (∫ t in Ioc 0 ‖f‖, ENNReal.toReal (ν (thickening ε {a | t ≤ f a}))) + ε * ‖f‖ 
goal: ∫ (ω : Ω), f ω ∂μ ≤ (∫ (t : ℝ) in Set.Ioc 0 ‖f‖, (ν (Metric.thickening ε {a | t ≤ f a})).toReal) + ε * ‖f‖

full_name: MeasureTheory.tendsto_integral_meas_thickening_le
code: /-- A monotone decreasing convergence lemma for integrals of measures of thickenings:
`∫ t in (0, ‖f‖], μ (thickening ε {x | f(x) ≥ t}) dt` tends to
`∫ t in (0, ‖f‖], μ {x | f(x) ≥ t} dt` as `ε → 0`. -/
lemma tendsto_integral_meas_thickening_le (f : Ω →ᵇ ℝ)
    {A : Set ℝ} (A_finmeas : volume A ≠ ∞) (μ : ProbabilityMeasure Ω) :
    Tendsto (fun ε ↦ ∫ t in A, ENNReal.toReal (μ (thickening ε {a | t ≤ f a}))) (𝓝[>] (0 : ℝ))
      (𝓝 (∫ t in A, ENNReal.toReal (μ {a | t ≤ f a}))) 
goal: Filter.Tendsto (fun ε => ∫ (t : ℝ) in A, (↑(μ (Metric.thickening ε {a | t ≤ f a}))).toReal) (𝓝[>] 0)
  (𝓝 (∫ (t : ℝ) in A, (↑(μ {a | t ≤ f a})).toReal))

full_name: MeasureTheory.LevyProkhorov.continuous_toProbabilityMeasure
code: /-- The coercion `LevyProkhorov (ProbabilityMeasure Ω) → ProbabilityMeasure Ω` is continuous. -/
lemma LevyProkhorov.continuous_toProbabilityMeasure :
    Continuous (LevyProkhorov.toProbabilityMeasure (Ω := Ω)) 
goal: Continuous MeasureTheory.LevyProkhorov.toProbabilityMeasure

full_name: MeasureTheory.levyProkhorov_le_convergenceInDistribution
code: /-- The topology of the Lévy-Prokhorov metric is at least as fine as the topology of convergence in
distribution. -/
theorem levyProkhorov_le_convergenceInDistribution :
    TopologicalSpace.coinduced (LevyProkhorov.toProbabilityMeasure (Ω := Ω)) inferInstance
      ≤ (inferInstance : TopologicalSpace (ProbabilityMeasure Ω)) 
goal: TopologicalSpace.coinduced MeasureTheory.LevyProkhorov.toProbabilityMeasure inferInstance ≤ inferInstance

full_name: MeasureTheory.SeparableSpace.exists_measurable_partition_diam_le
code: /-- In a separable pseudometric space, for any ε > 0 there exists a countable collection of
disjoint Borel measurable subsets of diameter at most ε that cover the whole space. -/
lemma SeparableSpace.exists_measurable_partition_diam_le {ε : ℝ} (ε_pos : 0 < ε) :
    ∃ (As : ℕ → Set Ω), (∀ n, MeasurableSet (As n)) ∧ (∀ n, Bornology.IsBounded (As n)) ∧
        (∀ n, diam (As n) ≤ ε) ∧ (⋃ n, As n = univ) ∧
        (Pairwise (fun (n m : ℕ) ↦ Disjoint (As n) (As m))) 
goal: ∃ As,
  (∀ (n : ℕ), MeasurableSet (As n)) ∧
    (∀ (n : ℕ), Bornology.IsBounded (As n)) ∧
      (∀ (n : ℕ), Metric.diam (As n) ≤ ε) ∧ ⋃ n, As n = Set.univ ∧ Pairwise fun n m => Disjoint (As n) (As m)

full_name: MeasureTheory.ProbabilityMeasure.toMeasure_add_pos_gt_mem_nhds
code: lemma ProbabilityMeasure.toMeasure_add_pos_gt_mem_nhds (P : ProbabilityMeasure Ω)
    {G : Set Ω} (G_open : IsOpen G) {ε : ℝ≥0∞} (ε_pos : 0 < ε) :
    {Q | P.toMeasure G < Q.toMeasure G + ε} ∈ 𝓝 P 
goal: {Q | ↑P G < ↑Q G + ε} ∈ 𝓝 P

full_name: MeasureTheory.ProbabilityMeasure.continuous_toLevyProkhorov
code: lemma ProbabilityMeasure.continuous_toLevyProkhorov :
    Continuous (ProbabilityMeasure.toLevyProkhorov (Ω := Ω)) 
goal: Continuous MeasureTheory.ProbabilityMeasure.toLevyProkhorov

full_name: MeasureTheory.levyProkhorov_eq_convergenceInDistribution
code: /-- The topology of the Lévy-Prokhorov metric on probability measures on a separable space
coincides with the topology of convergence in distribution. -/
theorem levyProkhorov_eq_convergenceInDistribution :
    (inferInstance : TopologicalSpace (ProbabilityMeasure Ω))
      = TopologicalSpace.coinduced (LevyProkhorov.toProbabilityMeasure (Ω := Ω)) inferInstance 
goal: inferInstance = TopologicalSpace.coinduced MeasureTheory.LevyProkhorov.toProbabilityMeasure inferInstance

full_name: MeasureTheory.homeomorph_probabilityMeasure_levyProkhorov
code: /-- The identity map is a homeomorphism from `ProbabilityMeasure Ω` with the topology of
convergence in distribution to `ProbabilityMeasure Ω` with the Lévy-Prokhorov (pseudo)metric. -/
def homeomorph_probabilityMeasure_levyProkhorov :
    ProbabilityMeasure Ω ≃ₜ LevyProkhorov (ProbabilityMeasure Ω) 
goal: MeasureTheory.ProbabilityMeasure Ω ≃ₜ MeasureTheory.LevyProkhorov (MeasureTheory.ProbabilityMeasure Ω)

full_name: MeasureTheory.instPseudoMetrizableSpaceProbabilityMeasureOfSeparableSpace
code: /-- The topology of convergence in distribution on a separable space is pseudo-metrizable. -/
instance (X : Type*) [TopologicalSpace X] [PseudoMetrizableSpace X] [SeparableSpace X]
    [MeasurableSpace X] [OpensMeasurableSpace X] :
    PseudoMetrizableSpace (ProbabilityMeasure X) 
goal: TopologicalSpace.PseudoMetrizableSpace (MeasureTheory.ProbabilityMeasure X)