From 3fc686b362e586febee6ab6d5b82850b35c7c9dc Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 9 May 2026 11:47:40 +0200 Subject: [PATCH 001/129] start refactor --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 89 +++++++++++++++---- .../MeasureTheory/VectorMeasure/Basic.lean | 2 +- .../MeasureTheory/VectorMeasure/Integral.lean | 35 +++++++- .../VectorMeasure/WithDensityVec.lean | 34 +++++++ 4 files changed, 142 insertions(+), 18 deletions(-) create mode 100644 Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index fb257b16c4850e..d68242175c0bac 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -618,28 +618,34 @@ end L1 section Function -variable [CompleteSpace F] {T T' T'' : Set α → E →L[ℝ] F} {C C' C'' : ℝ} {f g : α → E} +variable {T T' T'' : Set α → E →L[ℝ] F} {C C' C'' : ℝ} {f g : α → E} variable (μ T) open Classical in /-- Extend `T : Set α → E →L[ℝ] F` to `(α → E) → F` (for integrable functions `α → E`). We set it to 0 if the function is not integrable. -/ def setToFun (hT : DominatedFinMeasAdditive μ T C) (f : α → E) : F := - if hf : Integrable f μ then L1.setToL1 hT (hf.toL1 f) else 0 + if _hF : CompleteSpace F then + if hf : Integrable f μ then L1.setToL1 hT (hf.toL1 f) else 0 + else 0 variable {μ T} -theorem setToFun_eq (hT : DominatedFinMeasAdditive μ T C) (hf : Integrable f μ) : - setToFun μ T hT f = L1.setToL1 hT (hf.toL1 f) := - dif_pos hf +theorem setToFun_eq [hF : CompleteSpace F] + (hT : DominatedFinMeasAdditive μ T C) (hf : Integrable f μ) : + setToFun μ T hT f = L1.setToL1 hT (hf.toL1 f) := by + simp [setToFun, hF, hf] -theorem L1.setToFun_eq_setToL1 (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) : +theorem L1.setToFun_eq_setToL1 [CompleteSpace F] + (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) : setToFun μ T hT f = L1.setToL1 hT f := by rw [setToFun_eq hT (L1.integrable_coeFn f), Integrable.toL1_coeFn] theorem setToFun_undef (hT : DominatedFinMeasAdditive μ T C) (hf : ¬Integrable f μ) : - setToFun μ T hT f = 0 := - dif_neg hf + setToFun μ T hT f = 0 := by + by_cases hF : CompleteSpace F + · simp [setToFun, hF, hf] + · simp [setToFun, hF] theorem setToFun_non_aestronglyMeasurable (hT : DominatedFinMeasAdditive μ T C) (hf : ¬AEStronglyMeasurable f μ) : setToFun μ T hT f = 0 := @@ -648,6 +654,8 @@ theorem setToFun_non_aestronglyMeasurable (hT : DominatedFinMeasAdditive μ T C) theorem setToFun_congr_left (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') (h : T = T') (f : α → E) : setToFun μ T hT f = setToFun μ T' hT' f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · simp_rw [setToFun_eq _ hf, L1.setToL1_congr_left T T' hT hT' h] · simp_rw [setToFun_undef _ hf] @@ -655,6 +663,8 @@ theorem setToFun_congr_left (hT : DominatedFinMeasAdditive μ T C) theorem setToFun_congr_left' (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') (h : ∀ s, MeasurableSet s → μ s < ∞ → T s = T' s) (f : α → E) : setToFun μ T hT f = setToFun μ T' hT' f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · simp_rw [setToFun_eq _ hf, L1.setToL1_congr_left' T T' hT hT' h] · simp_rw [setToFun_undef _ hf] @@ -662,6 +672,8 @@ theorem setToFun_congr_left' (hT : DominatedFinMeasAdditive μ T C) theorem setToFun_add_left (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') (f : α → E) : setToFun μ (T + T') (hT.add hT') f = setToFun μ T hT f + setToFun μ T' hT' f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · simp_rw [setToFun_eq _ hf, L1.setToL1_add_left hT hT'] · simp_rw [setToFun_undef _ hf, add_zero] @@ -670,12 +682,16 @@ theorem setToFun_add_left' (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') (hT'' : DominatedFinMeasAdditive μ T'' C'') (h_add : ∀ s, MeasurableSet s → μ s < ∞ → T'' s = T s + T' s) (f : α → E) : setToFun μ T'' hT'' f = setToFun μ T hT f + setToFun μ T' hT' f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · simp_rw [setToFun_eq _ hf, L1.setToL1_add_left' hT hT' hT'' h_add] · simp_rw [setToFun_undef _ hf, add_zero] theorem setToFun_smul_left (hT : DominatedFinMeasAdditive μ T C) (c : ℝ) (f : α → E) : setToFun μ (fun s => c • T s) (hT.smul c) f = c • setToFun μ T hT f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · simp_rw [setToFun_eq _ hf, L1.setToL1_smul_left hT c] · simp_rw [setToFun_undef _ hf, smul_zero] @@ -684,12 +700,16 @@ theorem setToFun_smul_left' (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') (c : ℝ) (h_smul : ∀ s, MeasurableSet s → μ s < ∞ → T' s = c • T s) (f : α → E) : setToFun μ T' hT' f = c • setToFun μ T hT f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · simp_rw [setToFun_eq _ hf, L1.setToL1_smul_left' hT hT' c h_smul] · simp_rw [setToFun_undef _ hf, smul_zero] @[simp] theorem setToFun_zero (hT : DominatedFinMeasAdditive μ T C) : setToFun μ T hT (0 : α → E) = 0 := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] rw [Pi.zero_def, setToFun_eq hT (integrable_zero _ _ _)] simp only [← Pi.zero_def] rw [Integrable.toL1_zero, map_zero] @@ -697,18 +717,24 @@ theorem setToFun_zero (hT : DominatedFinMeasAdditive μ T C) : setToFun μ T hT @[simp] theorem setToFun_zero_left {hT : DominatedFinMeasAdditive μ (0 : Set α → E →L[ℝ] F) C} : setToFun μ 0 hT f = 0 := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · rw [setToFun_eq hT hf]; exact L1.setToL1_zero_left hT _ · exact setToFun_undef hT hf theorem setToFun_zero_left' (hT : DominatedFinMeasAdditive μ T C) (h_zero : ∀ s, MeasurableSet s → μ s < ∞ → T s = 0) : setToFun μ T hT f = 0 := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · rw [setToFun_eq hT hf]; exact L1.setToL1_zero_left' hT h_zero _ · exact setToFun_undef hT hf theorem setToFun_add (hT : DominatedFinMeasAdditive μ T C) (hf : Integrable f μ) (hg : Integrable g μ) : setToFun μ T hT (f + g) = setToFun μ T hT f + setToFun μ T hT g := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] rw [setToFun_eq hT (hf.add hg), setToFun_eq hT hf, setToFun_eq hT hg, Integrable.toL1_add, (L1.setToL1 hT).map_add] @@ -738,6 +764,8 @@ theorem setToFun_finsetSum (hT : DominatedFinMeasAdditive μ T C) {ι} (s : Fins theorem setToFun_neg (hT : DominatedFinMeasAdditive μ T C) (f : α → E) : setToFun μ T hT (-f) = -setToFun μ T hT f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · rw [setToFun_eq hT hf, setToFun_eq hT hf.neg, Integrable.toL1_neg, (L1.setToL1 hT).map_neg] @@ -752,6 +780,8 @@ theorem setToFun_smul [NormedDivisionRing 𝕜] [Module 𝕜 E] [NormSMulClass [Module 𝕜 F] [NormSMulClass 𝕜 F] (hT : DominatedFinMeasAdditive μ T C) (h_smul : ∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x) (c : 𝕜) (f : α → E) : setToFun μ T hT (c • f) = c • setToFun μ T hT f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hf : Integrable f μ · rw [setToFun_eq hT hf, setToFun_eq hT (hf.smul c), Integrable.toL1_smul' f hf, L1.setToL1_smul hT h_smul c] @@ -762,6 +792,8 @@ theorem setToFun_smul [NormedDivisionRing 𝕜] [Module 𝕜 E] [NormSMulClass theorem setToFun_congr_ae (hT : DominatedFinMeasAdditive μ T C) (h : f =ᵐ[μ] g) : setToFun μ T hT f = setToFun μ T hT g := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] by_cases hfi : Integrable f μ · have hgi : Integrable g μ := hfi.congr h rw [setToFun_eq hT hfi, setToFun_eq hT hgi, (Integrable.toL1_eq_toL1_iff f g hfi hgi).2 h] @@ -781,14 +813,15 @@ theorem setToFun_toL1 (hT : DominatedFinMeasAdditive μ T C) (hf : Integrable f setToFun μ T hT (hf.toL1 f) = setToFun μ T hT f := setToFun_congr_ae hT hf.coeFn_toL1 -theorem setToFun_indicator_const (hT : DominatedFinMeasAdditive μ T C) {s : Set α} +theorem setToFun_indicator_const [CompleteSpace F] (hT : DominatedFinMeasAdditive μ T C) {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : E) : setToFun μ T hT (s.indicator fun _ => x) = T s x := by rw [setToFun_congr_ae hT (@indicatorConstLp_coeFn _ _ _ 1 _ _ _ hs hμs x).symm] rw [L1.setToFun_eq_setToL1 hT] exact L1.setToL1_indicatorConstLp hT hs hμs x -theorem setToFun_const [IsFiniteMeasure μ] (hT : DominatedFinMeasAdditive μ T C) (x : E) : +theorem setToFun_const [CompleteSpace F] [IsFiniteMeasure μ] + (hT : DominatedFinMeasAdditive μ T C) (x : E) : (setToFun μ T hT fun _ => x) = T univ x := by have : (fun _ : α => x) = Set.indicator univ fun _ => x := (indicator_univ _).symm rw [this] @@ -798,13 +831,15 @@ section Order variable {G' G'' : Type*} [NormedAddCommGroup G''] [PartialOrder G''] [IsOrderedAddMonoid G''] - [NormedSpace ℝ G''] [CompleteSpace G''] + [NormedSpace ℝ G''] [NormedAddCommGroup G'] [PartialOrder G'] [NormedSpace ℝ G'] theorem setToFun_mono_left' [OrderClosedTopology G''] {T T' : Set α → E →L[ℝ] G''} {C C' : ℝ} (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') (hTT' : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, T s x ≤ T' s x) (f : α → E) : setToFun μ T hT f ≤ setToFun μ T' hT' f := by + by_cases hG'' : CompleteSpace G''; swap + · simp [setToFun, hG''] by_cases hf : Integrable f μ · simp_rw [setToFun_eq _ hf]; exact L1.setToL1_mono_left' hT hT' hTT' _ · simp_rw [setToFun_undef _ hf, le_rfl] @@ -818,6 +853,8 @@ theorem setToFun_nonneg [ClosedIciTopology G''] {T : Set α → G' →L[ℝ] G'' (hT : DominatedFinMeasAdditive μ T C) (hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f : α → G'} (hf : 0 ≤ᵐ[μ] f) : 0 ≤ setToFun μ T hT f := by + by_cases hG'' : CompleteSpace G''; swap + · simp [setToFun, hG''] by_cases hfi : Integrable f μ · simp_rw [setToFun_eq _ hfi] exact L1.setToL1_nonneg hT hT_nonneg hf @@ -838,6 +875,8 @@ end Order @[continuity] theorem continuous_setToFun (hT : DominatedFinMeasAdditive μ T C) : Continuous fun f : α →₁[μ] E => setToFun μ T hT f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF, continuous_const] simp_rw [L1.setToFun_eq_setToL1 hT]; exact ContinuousLinearMap.continuous _ /-- If `F i → f` in `L1`, then `setToFun μ T hT (F i) → setToFun μ T hT f`. -/ @@ -928,6 +967,8 @@ theorem setToFun_congr_measure_of_integrable {μ' : Measure α} (c' : ℝ≥0∞ (hμ'_le : μ' ≤ c' • μ) (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ' T C') (f : α → E) (hfμ : Integrable f μ) : setToFun μ T hT f = setToFun μ' T hT' f := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] -- integrability for `μ` implies integrability for `μ'`. have h_int : ∀ g : α → E, Integrable g μ → Integrable g μ' := fun g hg => Integrable.of_measure_le_smul hc' hμ'_le hg @@ -1002,19 +1043,35 @@ theorem setToFun_congr_smul_measure (c : ℝ≥0∞) (hc_ne_top : c ≠ ∞) theorem norm_setToFun_le_mul_norm (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) (hC : 0 ≤ C) : ‖setToFun μ T hT f‖ ≤ C * ‖f‖ := by - rw [L1.setToFun_eq_setToL1]; exact L1.norm_setToL1_le_mul_norm hT hC f + by_cases hF : CompleteSpace F; swap + · simp only [setToFun, hF, ↓reduceDIte, norm_zero] + positivity + rw [L1.setToFun_eq_setToL1] + exact L1.norm_setToL1_le_mul_norm hT hC f theorem norm_setToFun_le_mul_norm' (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) : ‖setToFun μ T hT f‖ ≤ max C 0 * ‖f‖ := by - rw [L1.setToFun_eq_setToL1]; exact L1.norm_setToL1_le_mul_norm' hT f + by_cases hF : CompleteSpace F; swap + · simp only [setToFun, hF, ↓reduceDIte, norm_zero] + positivity + rw [L1.setToFun_eq_setToL1] + exact L1.norm_setToL1_le_mul_norm' hT f theorem norm_setToFun_le (hT : DominatedFinMeasAdditive μ T C) (hf : Integrable f μ) (hC : 0 ≤ C) : ‖setToFun μ T hT f‖ ≤ C * ‖hf.toL1 f‖ := by - rw [setToFun_eq hT hf]; exact L1.norm_setToL1_le_mul_norm hT hC _ + by_cases hF : CompleteSpace F; swap + · simp only [setToFun, hF, ↓reduceDIte, norm_zero] + positivity + rw [setToFun_eq hT hf] + exact L1.norm_setToL1_le_mul_norm hT hC _ theorem norm_setToFun_le' (hT : DominatedFinMeasAdditive μ T C) (hf : Integrable f μ) : ‖setToFun μ T hT f‖ ≤ max C 0 * ‖hf.toL1 f‖ := by - rw [setToFun_eq hT hf]; exact L1.norm_setToL1_le_mul_norm' hT _ + by_cases hF : CompleteSpace F; swap + · simp only [setToFun, hF, ↓reduceDIte, norm_zero] + positivity + rw [setToFun_eq hT hf] + exact L1.norm_setToL1_le_mul_norm' hT _ /-- Lebesgue dominated convergence theorem provides sufficient conditions under which almost everywhere convergence of a sequence of functions implies the convergence of their image by @@ -1028,6 +1085,8 @@ theorem tendsto_setToFun_of_dominated_convergence (hT : DominatedFinMeasAdditive (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖fs n a‖ ≤ bound a) (h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => fs n a) atTop (𝓝 (f a))) : Tendsto (fun n => setToFun μ T hT (fs n)) atTop (𝓝 <| setToFun μ T hT f) := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] -- `f` is a.e.-measurable, since it is the a.e.-pointwise limit of a.e.-measurable functions. have f_measurable : AEStronglyMeasurable f μ := aestronglyMeasurable_of_tendsto_ae _ fs_measurable h_lim diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index e45965e0dbc9f6..54bd6a6f66b661 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -649,7 +649,7 @@ end open Classical in /-- The restriction of a vector measure on some set. -/ -def restrict (v : VectorMeasure α M) (i : Set α) : VectorMeasure α M := +@[no_expose] def restrict (v : VectorMeasure α M) (i : Set α) : VectorMeasure α M := if hi : MeasurableSet i then { measureOf' := fun s => if MeasurableSet s then v (s ∩ i) else 0 empty' := by simp diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 201814264e89b9..5991432689f5f8 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -128,10 +128,8 @@ open Classical in paring `B : E →L[ℝ] F →L[ℝ] G` . This is set to be `0` if `G` is not complete or if `f` is not integrable with respect to `(μ.transpose B).variation`. -/ noncomputable def integral (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : G := - if _ : CompleteSpace G then setToFun (μ.transpose B).variation (μ.transpose B) (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f - else 0 @[inherit_doc integral] notation3 "∫ᵛ "(...)", "r:60:(scoped f => f)" ∂["B:70"; "μ:70"]" => integral μ r B @@ -140,8 +138,24 @@ notation3 "∫ᵛ "(...)", "r:60:(scoped f => f)" ∂["B:70"; "μ:70"]" => integ `ℝ` on `F` and `f` is real-valued. The resulting integral is `F`-valued.-/ notation3 "∫ᵛ "(...)", "r:60:(scoped f => f)" ∂•"μ:70 => integral μ r (lsmul ℝ ℝ) +@[inherit_doc integral] +notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂["B:70"; "μ:70"]" => + integral (VectorMeasure.restrict μ s) r B + +/-- The special case of the pairing integral in a set where the pairing is just the scalar +multiplication by `ℝ` on `F` and `f` is real-valued. The resulting integral is `F`-valued.-/ +notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂•"μ:70 => + integral (VectorMeasure.restrict μ s) r (lsmul ℝ ℝ) + variable {μ : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} +@[simp] theorem integral_zero {f : X → E} : ∫ᵛ x, f x ∂[B; (0 : VectorMeasure X F)] = 0 := by + by_cases hG : CompleteSpace G + · simp only [integral, hG, ↓reduceDIte] + apply setToFun_zero_left' + simp [VectorMeasure.transpose] + · simp [integral, hG] + theorem integral_fun_add {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := by by_cases hG : CompleteSpace G @@ -190,6 +204,23 @@ variable (μ B) in theorem integral_smul (c : ℝ) (f : X → E) : ∫ᵛ x, (c • f) x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := integral_fun_smul μ B c f +theorem integral_undef {f : X → E} (hf : ¬ μ.Integrable f B) : + ∫ᵛ x, f x ∂[B; μ] = 0 := by + by_cases hG : CompleteSpace G + · simp only [integral, hG, ↓reduceDIte] + exact setToFun_undef _ hf + · simp [integral, hG] + +theorem enorm_integral_le (f : X → E) : + ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x, ‖f x‖ₑ ∂ (μ.transpose B).variation := by + by_cases hG : CompleteSpace G; swap + · simp [integral, hG] + by_cases hf : μ.Integrable f B; swap + · simp [integral_undef hf] + + + + end VectorMeasure end MeasureTheory diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean new file mode 100644 index 00000000000000..37df9b5a1e1082 --- /dev/null +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -0,0 +1,34 @@ +/- +Copyright (c) 2026 Sébastien Gouëzel. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Sébastien Gouëzel +-/ +module + +public import Mathlib.MeasureTheory.VectorMeasure.Integral + +/-! +# Vector measure with density with respect to a vector measure + +-/ + +namespace MeasureTheory.VectorMeasure + + +variable {X E F G : Type*} {mX : MeasurableSpace X} + [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + +open scoped Classical in +noncomputable def withDensity (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : + VectorMeasure X G := + if μ.Integrable f B then + { measureOf' s := ∫ᵛ x in s, f x ∂[B; μ] + empty' := by simp + not_measurable' s hs := by simp [restrict_not_measurable _ hs] + m_iUnion' s s_meas s_disj := by + } + else 0 + +end MeasureTheory.VectorMeasure From 1d05e74eeff36a8f0d1b7e33f3c826a9baec1f9b Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 9 May 2026 14:09:15 +0200 Subject: [PATCH 002/129] better --- .../Function/L1Space/AEEqFun.lean | 4 + .../MeasureTheory/Integral/Bochner/Basic.lean | 130 +++++++----------- Mathlib/MeasureTheory/Integral/SetToL1.lean | 13 ++ .../MeasureTheory/VectorMeasure/Integral.lean | 45 ++---- 4 files changed, 81 insertions(+), 111 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/L1Space/AEEqFun.lean b/Mathlib/MeasureTheory/Function/L1Space/AEEqFun.lean index 533bb84a681d8c..65172a5f506555 100644 --- a/Mathlib/MeasureTheory/Function/L1Space/AEEqFun.lean +++ b/Mathlib/MeasureTheory/Function/L1Space/AEEqFun.lean @@ -213,6 +213,10 @@ theorem norm_toL1_eq_lintegral_norm (f : α → β) (hf : Integrable f μ) : ‖hf.toL1 f‖ = ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) := by rw [norm_toL1, lintegral_norm_eq_lintegral_edist] +theorem norm_toL1_eq_lintegral_enorm (f : α → β) (hf : Integrable f μ) : + ‖hf.toL1 f‖ = (∫⁻ a, ‖f a‖ₑ ∂μ).toReal := by + simp_rw [norm_toL1, edist_zero_right] + @[simp] theorem edist_toL1_toL1 (f g : α → β) (hf : Integrable f μ) (hg : Integrable g μ) : edist (hf.toL1 f) (hg.toL1 g) = ∫⁻ a, edist (f a) (g a) ∂μ := by diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean index 3694203559cb08..98f81e081ec7af 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean @@ -187,23 +187,25 @@ variable {f : α → E} {m : MeasurableSpace α} {μ : Measure α} section Basic -variable [hE : CompleteSpace E] - -theorem integral_eq (f : α → E) (hf : Integrable f μ) : ∫ a, f a ∂μ = L1.integral (hf.toL1 f) := by +theorem integral_eq [hE : CompleteSpace E] (f : α → E) (hf : Integrable f μ) : + ∫ a, f a ∂μ = L1.integral (hf.toL1 f) := by simp [integral, hE, hf] theorem integral_eq_setToFun (f : α → E) : ∫ a, f a ∂μ = setToFun μ (weightedSMul μ) (dominatedFinMeasAdditive_weightedSMul μ) f := by - simp only [integral, hE, L1.integral]; rfl + by_cases hE : CompleteSpace E + · simp only [integral, hE, ↓reduceDIte, L1.integral, setToFun] + rfl + · simp [integral, hE, setToFun] -theorem L1.integral_eq_integral (f : α →₁[μ] E) : L1.integral f = ∫ a, f a ∂μ := by +theorem L1.integral_eq_integral [CompleteSpace E] (f : α →₁[μ] E) : + L1.integral f = ∫ a, f a ∂μ := by simp only [integral, L1.integral, integral_eq_setToFun] exact (L1.setToFun_eq_setToL1 (dominatedFinMeasAdditive_weightedSMul μ) f).symm theorem integral_undef {f : α → G} (h : ¬Integrable f μ) : ∫ a, f a ∂μ = 0 := by - by_cases hG : CompleteSpace G - · simp [integral, hG, h] - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact setToFun_undef (dominatedFinMeasAdditive_weightedSMul μ) h theorem Integrable.of_integral_ne_zero {f : α → G} (h : ∫ a, f a ∂μ ≠ 0) : Integrable f μ := Not.imp_symm integral_undef h @@ -216,10 +218,8 @@ variable (α G) @[simp] theorem integral_zero : ∫ _ : α, (0 : G) ∂μ = 0 := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact setToFun_zero (dominatedFinMeasAdditive_weightedSMul μ) - · simp [integral, hG] + simp only [integral_eq_setToFun] + apply setToFun_zero @[simp] theorem integral_zero' : integral μ (0 : α → G) = 0 := @@ -236,10 +236,8 @@ theorem integrable_of_integral_eq_one {f : α → ℝ} (h : ∫ x, f x ∂μ = 1 theorem integral_add {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) : ∫ a, f a + g a ∂μ = ∫ a, f a ∂μ + ∫ a, g a ∂μ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact setToFun_add (dominatedFinMeasAdditive_weightedSMul μ) hf hg - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact setToFun_add (dominatedFinMeasAdditive_weightedSMul μ) hf hg theorem integral_add' {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) : ∫ a, (f + g) a ∂μ = ∫ a, f a ∂μ + ∫ a, g a ∂μ := @@ -247,29 +245,23 @@ theorem integral_add' {f g : α → G} (hf : Integrable f μ) (hg : Integrable g theorem integral_finsetSum {ι} (s : Finset ι) {f : ι → α → G} (hf : ∀ i ∈ s, Integrable (f i) μ) : ∫ a, ∑ i ∈ s, f i a ∂μ = ∑ i ∈ s, ∫ a, f i a ∂μ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact setToFun_finsetSum (dominatedFinMeasAdditive_weightedSMul _) s hf - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact setToFun_finsetSum (dominatedFinMeasAdditive_weightedSMul _) s hf @[deprecated (since := "2026-04-08")] alias integral_finset_sum := integral_finsetSum @[integral_simps] theorem integral_neg (f : α → G) : ∫ a, -f a ∂μ = -∫ a, f a ∂μ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact setToFun_neg (dominatedFinMeasAdditive_weightedSMul μ) f - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact setToFun_neg (dominatedFinMeasAdditive_weightedSMul μ) f theorem integral_neg' (f : α → G) : ∫ a, (-f) a ∂μ = -∫ a, f a ∂μ := integral_neg f theorem integral_sub {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) : ∫ a, f a - g a ∂μ = ∫ a, f a ∂μ - ∫ a, g a ∂μ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact setToFun_sub (dominatedFinMeasAdditive_weightedSMul μ) hf hg - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact setToFun_sub (dominatedFinMeasAdditive_weightedSMul μ) hf hg theorem integral_sub' {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) : ∫ a, (f - g) a ∂μ = ∫ a, f a ∂μ - ∫ a, g a ∂μ := @@ -282,10 +274,8 @@ statement for more general rings with an *a priori* integrability assumption on @[integral_simps] theorem integral_smul [Module 𝕜 G] [NormSMulClass 𝕜 G] [SMulCommClass ℝ 𝕜 G] (c : 𝕜) (f : α → G) : ∫ a, c • f a ∂μ = c • ∫ a, f a ∂μ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact setToFun_smul (dominatedFinMeasAdditive_weightedSMul μ) weightedSMul_smul c f - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact setToFun_smul (dominatedFinMeasAdditive_weightedSMul μ) weightedSMul_smul c f theorem Integrable.integral_smul {R : Type*} [NormedRing R] [Module R G] [IsBoundedSMul R G] [SMulCommClass ℝ R G] (c : R) @@ -307,10 +297,8 @@ theorem integral_div {L : Type*} [RCLike L] (r : L) (f : α → L) : simpa only [← div_eq_mul_inv] using integral_mul_const r⁻¹ f theorem integral_congr_ae {f g : α → G} (h : f =ᵐ[μ] g) : ∫ a, f a ∂μ = ∫ a, g a ∂μ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact setToFun_congr_ae (dominatedFinMeasAdditive_weightedSMul μ) h - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact setToFun_congr_ae (dominatedFinMeasAdditive_weightedSMul μ) h lemma integral_congr_ae₂ {β : Type*} {_ : MeasurableSpace β} {ν : Measure β} {f g : α → β → G} (h : ∀ᵐ a ∂μ, f a =ᵐ[ν] g a) : @@ -323,10 +311,8 @@ lemma integral_congr_ae₂ {β : Type*} {_ : MeasurableSpace β} {ν : Measure @[simp] theorem L1.integral_of_fun_eq_integral' {f : α → G} (hf : Integrable f μ) : ∫ a, (AEEqFun.mk f hf.aestronglyMeasurable) a ∂μ = ∫ a, f a ∂μ := by - by_cases hG : CompleteSpace G - · simp only [MeasureTheory.integral, hG, L1.integral] - exact setToFun_toL1 (dominatedFinMeasAdditive_weightedSMul μ) hf - · simp [MeasureTheory.integral, hG] + simp only [integral_eq_setToFun] + exact setToFun_toL1 (dominatedFinMeasAdditive_weightedSMul μ) hf theorem L1.integral_of_fun_eq_integral {f : α → G} (hf : Integrable f μ) : ∫ a, (hf.toL1 f) a ∂μ = ∫ a, f a ∂μ := by @@ -334,10 +320,8 @@ theorem L1.integral_of_fun_eq_integral {f : α → G} (hf : Integrable f μ) : @[continuity] theorem continuous_integral : Continuous fun f : α →₁[μ] G => ∫ a, f a ∂μ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact continuous_setToFun (dominatedFinMeasAdditive_weightedSMul μ) - · simp [integral, hG, continuous_const] + simp only [integral_eq_setToFun] + exact continuous_setToFun (dominatedFinMeasAdditive_weightedSMul μ) theorem norm_integral_le_lintegral_norm (f : α → G) : ‖∫ a, f a ∂μ‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) := by @@ -400,10 +384,8 @@ theorem tendsto_integral_of_L1 {ι} (f : α → G) (hfi : Integrable f μ) {F : (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i => ∫⁻ x, ‖F i x - f x‖ₑ ∂μ) l (𝓝 0)) : Tendsto (fun i => ∫ x, F i x ∂μ) l (𝓝 <| ∫ x, f x ∂μ) := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact tendsto_setToFun_of_L1 (dominatedFinMeasAdditive_weightedSMul μ) f hfi hFi hF - · simp [integral, hG, tendsto_const_nhds] + simp only [integral_eq_setToFun] + exact tendsto_setToFun_of_L1 (dominatedFinMeasAdditive_weightedSMul μ) f hfi hFi hF /-- If `F i → f` in `L1`, then `∫ x, F i x ∂μ → ∫ x, f x ∂μ`. -/ lemma tendsto_integral_of_L1' {ι} (f : α → G) (hfi : Integrable f μ) {F : ι → α → G} {l : Filter ι} @@ -442,43 +424,35 @@ theorem continuousWithinAt_of_dominated {F : X → α → G} {x₀ : X} {bound : (h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂μ, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) (h_cont : ∀ᵐ a ∂μ, ContinuousWithinAt (fun x => F x a) s x₀) : ContinuousWithinAt (fun x => ∫ a, F x a ∂μ) s x₀ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact continuousWithinAt_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) - hF_meas h_bound bound_integrable h_cont - · simp [integral, hG, continuousWithinAt_const] + simp only [integral_eq_setToFun] + exact continuousWithinAt_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) + hF_meas h_bound bound_integrable h_cont theorem continuousAt_of_dominated {F : X → α → G} {x₀ : X} {bound : α → ℝ} (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) μ) (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂μ, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) (h_cont : ∀ᵐ a ∂μ, ContinuousAt (fun x => F x a) x₀) : ContinuousAt (fun x => ∫ a, F x a ∂μ) x₀ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact continuousAt_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) - hF_meas h_bound bound_integrable h_cont - · simp [integral, hG, continuousAt_const] + simp only [integral_eq_setToFun] + exact continuousAt_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) + hF_meas h_bound bound_integrable h_cont theorem continuousOn_of_dominated {F : X → α → G} {bound : α → ℝ} {s : Set X} (hF_meas : ∀ x ∈ s, AEStronglyMeasurable (F x) μ) (h_bound : ∀ x ∈ s, ∀ᵐ a ∂μ, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) (h_cont : ∀ᵐ a ∂μ, ContinuousOn (fun x => F x a) s) : ContinuousOn (fun x => ∫ a, F x a ∂μ) s := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact continuousOn_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) - hF_meas h_bound bound_integrable h_cont - · simp [integral, hG, continuousOn_const] + simp only [integral_eq_setToFun] + exact continuousOn_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) + hF_meas h_bound bound_integrable h_cont theorem continuous_of_dominated {F : X → α → G} {bound : α → ℝ} (hF_meas : ∀ x, AEStronglyMeasurable (F x) μ) (h_bound : ∀ x, ∀ᵐ a ∂μ, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) (h_cont : ∀ᵐ a ∂μ, Continuous fun x => F x a) : Continuous fun x => ∫ a, F x a ∂μ := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact continuous_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) - hF_meas h_bound bound_integrable h_cont - · simp [integral, hG, continuous_const] + simp only [integral_eq_setToFun] + exact continuous_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) + hF_meas h_bound bound_integrable h_cont /-- The Bochner integral of a real-valued function `f : α → ℝ` is the difference between the integral of the positive part of `f` and the integral of the negative part of `f`. -/ @@ -544,27 +518,29 @@ theorem ofReal_integral_norm_eq_lintegral_enorm {P : Type*} [NormedAddCommGroup rw [integral_norm_eq_lintegral_enorm hf.aestronglyMeasurable, ENNReal.ofReal_toReal] exact lt_top_iff_ne_top.mp (hasFiniteIntegral_iff_enorm.mpr hf.2) -theorem SimpleFunc.integral_eq_integral (f : α →ₛ E) (hfi : Integrable f μ) : +theorem SimpleFunc.integral_eq_integral [CompleteSpace E] (f : α →ₛ E) (hfi : Integrable f μ) : f.integral μ = ∫ x, f x ∂μ := by rw [MeasureTheory.integral_eq f hfi, ← L1.SimpleFunc.toLp_one_eq_toL1, L1.SimpleFunc.integral_L1_eq_integral, L1.SimpleFunc.integral_eq_integral] exact SimpleFunc.integral_congr hfi (Lp.simpleFunc.toSimpleFunc_toLp _ _).symm -theorem SimpleFunc.integral_eq_sum (f : α →ₛ E) (hfi : Integrable f μ) : +theorem SimpleFunc.integral_eq_sum [CompleteSpace E] (f : α →ₛ E) (hfi : Integrable f μ) : ∫ x, f x ∂μ = ∑ x ∈ f.range, μ.real (f ⁻¹' {x}) • x := by rw [← f.integral_eq_integral hfi, SimpleFunc.integral, ← SimpleFunc.integral_eq]; rfl -theorem tendsto_integral_approxOn_of_measurable [MeasurableSpace E] [BorelSpace E] {f : α → E} +theorem tendsto_integral_approxOn_of_measurable [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] + {f : α → E} {s : Set E} [SeparableSpace s] (hfi : Integrable f μ) (hfm : Measurable f) (hs : ∀ᵐ x ∂μ, f x ∈ closure s) {y₀ : E} (h₀ : y₀ ∈ s) (h₀i : Integrable (fun _ => y₀) μ) : Tendsto (fun n => (SimpleFunc.approxOn f hfm s y₀ h₀ n).integral μ) atTop (𝓝 <| ∫ x, f x ∂μ) := by have hfi' := SimpleFunc.integrable_approxOn hfm hfi h₀ h₀i - simp only [SimpleFunc.integral_eq_integral _ (hfi' _), integral, hE, L1.integral] + simp only [SimpleFunc.integral_eq_integral _ (hfi' _), integral, L1.integral] exact tendsto_setToFun_approxOn_of_measurable (dominatedFinMeasAdditive_weightedSMul μ) hfi hfm hs h₀ h₀i -theorem tendsto_integral_approxOn_of_measurable_of_range_subset [MeasurableSpace E] [BorelSpace E] +theorem tendsto_integral_approxOn_of_measurable_of_range_subset + [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] {f : α → E} (fmeas : Measurable f) (hf : Integrable f μ) (s : Set E) [SeparableSpace s] (hs : range f ∪ {0} ⊆ s) : Tendsto (fun n => (SimpleFunc.approxOn f fmeas s 0 (hs <| by simp) n).integral μ) atTop @@ -971,7 +947,7 @@ theorem norm_integral_le_of_norm_le {f : α → G} {g : α → ℝ} (hg : Integr @[simp] theorem integral_const (c : E) : ∫ _ : α, c ∂μ = μ.real univ • c := by by_cases hμ : IsFiniteMeasure μ - · simp only [integral, hE, L1.integral] + · simp only [integral_eq_setToFun] exact setToFun_const (dominatedFinMeasAdditive_weightedSMul _) _ by_cases hc : c = 0 · simp [hc, integral_zero] @@ -1012,10 +988,8 @@ theorem integral_add_measure {f : α → G} (hμ : Integrable f μ) (hν : Integ @[simp] theorem integral_zero_measure {m : MeasurableSpace α} (f : α → G) : (∫ x, f x ∂(0 : Measure α)) = 0 := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact setToFun_measure_zero (dominatedFinMeasAdditive_weightedSMul _) rfl - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact setToFun_measure_zero (dominatedFinMeasAdditive_weightedSMul _) rfl @[simp] theorem setIntegral_measure_zero (f : α → G) {μ : Measure α} {s : Set α} (hs : μ s = 0) : diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index d68242175c0bac..417e1f1036df04 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -1073,6 +1073,19 @@ theorem norm_setToFun_le' (hT : DominatedFinMeasAdditive μ T C) (hf : Integrabl rw [setToFun_eq hT hf] exact L1.norm_setToL1_le_mul_norm' hT _ +theorem enorm_setToFun_le (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) : + ‖setToFun μ T hT f‖ₑ ≤ NNReal.mk C hC * ∫⁻ x, ‖f x‖ₑ ∂μ := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] + by_cases hf : Integrable f μ; swap + · simp [setToFun_undef _ hf] + apply (ENNReal.toReal_le_toReal (by simp) (ENNReal.mul_ne_top (by simp) hf.hasFiniteIntegral.ne)).1 + simp only [toReal_enorm, toReal_mul, coe_toReal, NNReal.coe_mk] + apply (norm_setToFun_le hT hf hC).trans + gcongr + apply le_of_eq + rw [Integrable.norm_toL1_eq_lintegral_enorm] + /-- Lebesgue dominated convergence theorem provides sufficient conditions under which almost everywhere convergence of a sequence of functions implies the convergence of their image by `setToFun`. diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 5991432689f5f8..5aa23406241be4 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -150,18 +150,12 @@ notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂•"μ:70 => variable {μ : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} @[simp] theorem integral_zero {f : X → E} : ∫ᵛ x, f x ∂[B; (0 : VectorMeasure X F)] = 0 := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, ↓reduceDIte] - apply setToFun_zero_left' - simp [VectorMeasure.transpose] - · simp [integral, hG] + apply setToFun_zero_left' + simp [VectorMeasure.transpose] theorem integral_fun_add {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : - ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG] - exact setToFun_add (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg - · simp [integral, hG] + ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := + setToFun_add (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg theorem integral_add {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, (f + g) x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := integral_fun_add hf hg @@ -169,11 +163,8 @@ theorem integral_add {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrabl variable (μ B) in @[integral_simps] theorem integral_fun_neg (f : X → E) : - ∫ᵛ x, -f x ∂[B; μ]= -∫ᵛ x, f x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, ↓reduceDIte, transpose_eq_cbmApplyMeasure] - exact setToFun_neg (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f - · simp [integral, hG] + ∫ᵛ x, -f x ∂[B; μ]= -∫ᵛ x, f x ∂[B; μ] := + setToFun_neg (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f variable (μ B) in @[integral_simps] @@ -181,11 +172,8 @@ theorem integral_neg (f : X → E) : ∫ᵛ x, (-f) x ∂[B; μ] = -∫ᵛ x, f x ∂[B; μ] := integral_fun_neg μ B f theorem integral_fun_sub {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : - ∫ᵛ x, f x - g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG] - exact setToFun_sub (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg - · simp [integral, hG] + ∫ᵛ x, f x - g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := + setToFun_sub (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg theorem integral_sub {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, (f - g) x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := integral_fun_sub hf hg @@ -193,11 +181,8 @@ theorem integral_sub {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrabl variable (μ B) in @[integral_simps] theorem integral_fun_smul (c : ℝ) (f : X → E) : - ∫ᵛ x, c • f x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG] - exact setToFun_smul (dominatedFinMeasAdditive_cbmApplyMeasure μ B) (by simp) c f - · simp [integral, hG] + ∫ᵛ x, c • f x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := + setToFun_smul (dominatedFinMeasAdditive_cbmApplyMeasure μ B) (by simp) c f variable (μ B) in @[integral_simps] @@ -205,11 +190,8 @@ theorem integral_smul (c : ℝ) (f : X → E) : ∫ᵛ x, (c • f) x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := integral_fun_smul μ B c f theorem integral_undef {f : X → E} (hf : ¬ μ.Integrable f B) : - ∫ᵛ x, f x ∂[B; μ] = 0 := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, ↓reduceDIte] - exact setToFun_undef _ hf - · simp [integral, hG] + ∫ᵛ x, f x ∂[B; μ] = 0 := + setToFun_undef _ hf theorem enorm_integral_le (f : X → E) : ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x, ‖f x‖ₑ ∂ (μ.transpose B).variation := by @@ -218,9 +200,6 @@ theorem enorm_integral_le (f : X → E) : by_cases hf : μ.Integrable f B; swap · simp [integral_undef hf] - - - end VectorMeasure end MeasureTheory From 260517bc90438794a1b9a57878ff9ac9fa89b616 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 9 May 2026 14:39:31 +0200 Subject: [PATCH 003/129] more --- Mathlib/MeasureTheory/Function/AEEqFun.lean | 6 ++++++ .../ConditionalExpectation/CondexpL1.lean | 16 ++++++++++++++-- Mathlib/MeasureTheory/Integral/SetToL1.lean | 3 ++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/AEEqFun.lean b/Mathlib/MeasureTheory/Function/AEEqFun.lean index 506c28877e204b..20dde195673a04 100644 --- a/Mathlib/MeasureTheory/Function/AEEqFun.lean +++ b/Mathlib/MeasureTheory/Function/AEEqFun.lean @@ -658,6 +658,12 @@ theorem coeFn_const_eq [NeZero μ] (b : β) (x : α) : (const α b : α →ₘ[ simp_rw [const, mk_eq_mk, EventuallyEq, ← const_def, eventually_const] at this rw [Function.const, this] +theorem coeFn_const_eq' (b : β) : ∃ b', ((const α b : α →ₘ[μ] β) : α → β) = fun _ ↦ b' := by + simp only [cast] + split_ifs with h + case neg => exact h.elim ⟨b, rfl⟩ + exact ⟨Classical.choose h, by ext; simp⟩ + variable {α} instance instInhabited [Inhabited β] : Inhabited (α →ₘ[μ] β) := diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean index 1766a15fd5def4..899a0f1dbd2029 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean @@ -47,7 +47,7 @@ variable {α F F' G G' 𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 F] -- F' for integrals on a Lp submodule [NormedAddCommGroup F'] - [NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F'] + [NormedSpace 𝕜 F'] [NormedSpace ℝ F'] -- G for a Lp add_subgroup [NormedAddCommGroup G] -- G' for integrals on a Lp add_subgroup @@ -313,6 +313,9 @@ section CondexpL1 variable {m m0 : MeasurableSpace α} {μ : Measure α} {hm : m ≤ m0} [SigmaFinite (μ.trim hm)] {f g : α → F'} {s : Set α} +section CondExpL1CLM + +variable [CompleteSpace F'] variable (F') /-- Conditional expectation of a function as a linear map from `α →₁[μ] F'` to itself. -/ @@ -438,6 +441,8 @@ theorem condExpL1CLM_of_aestronglyMeasurable' (f : α →₁[μ] F') (hfm : AESt condExpL1CLM F' hm μ f = f := condExpL1CLM_lpMeas (⟨f, hfm⟩ : lpMeas F' ℝ m 1 μ) +end CondExpL1CLM + /-- Conditional expectation of a function, in L1. Its value is 0 if the function is not integrable. The function-valued `condExp` should be used instead in most cases. -/ def condExpL1 (hm : m ≤ m0) (μ : Measure α) [SigmaFinite (μ.trim hm)] (f : α → F') : α →₁[μ] F' := @@ -446,7 +451,8 @@ def condExpL1 (hm : m ≤ m0) (μ : Measure α) [SigmaFinite (μ.trim hm)] (f : theorem condExpL1_undef (hf : ¬Integrable f μ) : condExpL1 hm μ f = 0 := setToFun_undef (dominatedFinMeasAdditive_condExpInd F' hm μ) hf -theorem condExpL1_eq (hf : Integrable f μ) : condExpL1 hm μ f = condExpL1CLM F' hm μ (hf.toL1 f) := +theorem condExpL1_eq [CompleteSpace F'] + (hf : Integrable f μ) : condExpL1 hm μ f = condExpL1CLM F' hm μ (hf.toL1 f) := setToFun_eq (dominatedFinMeasAdditive_condExpInd F' hm μ) hf @[simp] @@ -459,6 +465,12 @@ theorem condExpL1_measure_zero (hm : m ≤ m0) : condExpL1 hm (0 : Measure α) f theorem aestronglyMeasurable_condExpL1 {f : α → F'} : AEStronglyMeasurable[m] (condExpL1 hm μ f) μ := by + have A (g : α →ₘ[μ] F') : AEStronglyMeasurable g μ := by + exact AEEqFun.aestronglyMeasurable g + by_cases hF' : CompleteSpace (Lp F' 1 μ); swap + · simp [condExpL1, setToFun, hF'] + apply AEEqFun.aestronglyMeasurable (μ := μ) + by_cases hf : Integrable f μ · rw [condExpL1_eq hf] exact aestronglyMeasurable_condExpL1CLM _ diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 417e1f1036df04..906181d8ea336c 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -1079,7 +1079,8 @@ theorem enorm_setToFun_le (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) · simp [setToFun, hF] by_cases hf : Integrable f μ; swap · simp [setToFun_undef _ hf] - apply (ENNReal.toReal_le_toReal (by simp) (ENNReal.mul_ne_top (by simp) hf.hasFiniteIntegral.ne)).1 + apply (ENNReal.toReal_le_toReal (by simp) + (ENNReal.mul_ne_top (by simp) hf.hasFiniteIntegral.ne)).1 simp only [toReal_enorm, toReal_mul, coe_toReal, NNReal.coe_mk] apply (norm_setToFun_le hT hf hC).trans gcongr From 0f753934765104ca61494370676d35a28ef69560 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 9 May 2026 14:59:45 +0200 Subject: [PATCH 004/129] better --- .../ConditionalExpectation/CondexpL1.lean | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean index 899a0f1dbd2029..8fcf843fc86f28 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean @@ -315,15 +315,16 @@ variable {m m0 : MeasurableSpace α} {μ : Measure α} {hm : m ≤ m0} [SigmaFin section CondExpL1CLM -variable [CompleteSpace F'] variable (F') /-- Conditional expectation of a function as a linear map from `α →₁[μ] F'` to itself. -/ -def condExpL1CLM (hm : m ≤ m0) (μ : Measure α) [SigmaFinite (μ.trim hm)] : +def condExpL1CLM (hm : m ≤ m0) (μ : Measure α) [CompleteSpace ↑(Lp F' 1 μ)] + [SigmaFinite (μ.trim hm)] : (α →₁[μ] F') →L[ℝ] α →₁[μ] F' := L1.setToL1 (dominatedFinMeasAdditive_condExpInd F' hm μ) variable {F'} +variable [CompleteSpace F'] theorem condExpL1CLM_smul (c : 𝕜) (f : α →₁[μ] F') : condExpL1CLM F' hm μ (c • f) = c • condExpL1CLM F' hm μ f := by @@ -463,14 +464,8 @@ theorem condExpL1_zero : condExpL1 hm μ (0 : α → F') = 0 := theorem condExpL1_measure_zero (hm : m ≤ m0) : condExpL1 hm (0 : Measure α) f = 0 := setToFun_measure_zero _ rfl -theorem aestronglyMeasurable_condExpL1 {f : α → F'} : +theorem aestronglyMeasurable_condExpL1 [CompleteSpace F'] {f : α → F'} : AEStronglyMeasurable[m] (condExpL1 hm μ f) μ := by - have A (g : α →ₘ[μ] F') : AEStronglyMeasurable g μ := by - exact AEEqFun.aestronglyMeasurable g - by_cases hF' : CompleteSpace (Lp F' 1 μ); swap - · simp [condExpL1, setToFun, hF'] - apply AEEqFun.aestronglyMeasurable (μ := μ) - by_cases hf : Integrable f μ · rw [condExpL1_eq hf] exact aestronglyMeasurable_condExpL1CLM _ @@ -487,7 +482,7 @@ theorem integrable_condExpL1 (f : α → F') : Integrable (condExpL1 hm μ f) μ /-- The integral of the conditional expectation `condExpL1` over an `m`-measurable set is equal to the integral of `f` on that set. See also `setIntegral_condExp`, the similar statement for `condExp`. -/ -theorem setIntegral_condExpL1 (hf : Integrable f μ) (hs : MeasurableSet[m] s) : +theorem setIntegral_condExpL1 [CompleteSpace F'] (hf : Integrable f μ) (hs : MeasurableSet[m] s) : ∫ x in s, condExpL1 hm μ f x ∂μ = ∫ x in s, f x ∂μ := by simp_rw [condExpL1_eq hf] rw [setIntegral_condExpL1CLM (hf.toL1 f) hs] @@ -508,7 +503,7 @@ theorem condExpL1_sub (hf : Integrable f μ) (hg : Integrable g μ) : condExpL1 hm μ (f - g) = condExpL1 hm μ f - condExpL1 hm μ g := setToFun_sub _ hf hg -theorem condExpL1_of_aestronglyMeasurable' (hfm : AEStronglyMeasurable[m] f μ) +theorem condExpL1_of_aestronglyMeasurable' [CompleteSpace F'] (hfm : AEStronglyMeasurable[m] f μ) (hfi : Integrable f μ) : condExpL1 hm μ f =ᵐ[μ] f := by rw [condExpL1_eq hfi] refine EventuallyEq.trans ?_ (Integrable.coeFn_toL1 hfi) From 1f02eeefab34e5a247a9805c24e332f621a56383 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 10 May 2026 14:48:50 +0200 Subject: [PATCH 005/129] bilinear maps on L^p --- .../ConditionalExpectation/Basic.lean | 4 +- .../ConditionalExpectation/CondexpL1.lean | 88 +++++++++++++++++-- .../MeasureTheory/Function/LpSpace/Basic.lean | 40 ++++++++- .../Integral/DominatedConvergence.lean | 16 ++-- .../MeasureTheory/VectorMeasure/Integral.lean | 7 +- 5 files changed, 130 insertions(+), 25 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index 6b8b980c25c7f5..71364441d5da1a 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -436,7 +436,7 @@ lemma condExp_ofNat (n : ℕ) [n.AtLeastTwo] (f : α → R) : end NormedRing section NormedLatticeAddCommGroup -variable [NormedAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E] +variable [NormedAddCommGroup E] [NormedSpace ℝ E] /-- **Lebesgue dominated convergence theorem**: sufficient conditions under which almost everywhere convergence of a sequence of functions implies the convergence of their image by @@ -449,6 +449,8 @@ theorem tendsto_condExpL1_of_dominated_convergence (hm : m ≤ m₀) [SigmaFinit Tendsto (fun n => condExpL1 hm μ (fs n)) atTop (𝓝 (condExpL1 hm μ f)) := tendsto_setToFun_of_dominated_convergence _ bound_fs hfs_meas h_int_bound_fs hfs_bound hfs +variable [CompleteSpace E] + /-- If two sequences of functions have a.e. equal conditional expectations at each step, converge and verify dominated convergence hypotheses, then the conditional expectations of their limits are a.e. equal. -/ diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean index 8fcf843fc86f28..9ddd6f4bb2b664 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean @@ -464,17 +464,89 @@ theorem condExpL1_zero : condExpL1 hm μ (0 : α → F') = 0 := theorem condExpL1_measure_zero (hm : m ≤ m0) : condExpL1 hm (0 : Measure α) f = 0 := setToFun_measure_zero _ rfl -theorem aestronglyMeasurable_condExpL1 [CompleteSpace F'] {f : α → F'} : +theorem condExpL1_congr_ae (hm : m ≤ m0) (h : f =ᵐ[μ] g) : + condExpL1 hm μ f = condExpL1 hm μ g := + setToFun_congr_ae _ h + +lemma FinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α → F'} + (hf : FinStronglyMeasurable f μ) (h'f : ¬(f =ᵐ[μ] 0)) : + ∃ s, MeasurableSet s ∧ 0 < μ s ∧ μ s < ∞ := by + contrapose! h'f + rcases hf with ⟨fn, hfn, hfn_lim⟩ + have A n : μ (Function.support (fn n)) = 0 := by + by_contra! + have := h'f (Function.support (fn n)) (fn n).measurableSet_support (by positivity) + exact (lt_irrefl _ (this.trans_lt (hfn n))).elim + have B : ∀ᵐ x ∂μ, ∀ n, fn n x = 0 := ae_all_iff.mpr A + filter_upwards [B] with x hx + apply tendsto_nhds_unique (hfn_lim x) + simp [hx] + +lemma AEFinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α → F'} + (hf : AEFinStronglyMeasurable f μ) (h'f : ¬(f =ᵐ[μ] 0)) : + ∃ s, MeasurableSet s ∧ 0 < μ s ∧ μ s < ∞ := by + apply hf.finStronglyMeasurable_mk.exists_measurableSet_measure_pos_lt_top + contrapose! h'f + exact hf.ae_eq_mk.trans h'f + +private lemma completeSpace_of_completeSpace_Lp' + {s : Set α} (hs : μ s ≠ 0) (h's : μ s ≠ ∞) (h''s : MeasurableSet s) + [CompleteSpace (Lp F' 1 μ)] : + CompleteSpace F' := by + let f : F' → Lp F' 1 μ := fun x ↦ indicatorConstLp 1 h''s h's x + have hf : LipschitzWith (NNReal.mk (μ.real s) measureReal_nonneg) f := by + apply lipschitzWith_iff_norm_sub_le.2 (fun x y ↦ ?_) + simp only [indicatorConstLp_sub, f] + rw [norm_indicatorConstLp (by simp) (by simp)] + simp [mul_comm] + apply Metric.complete_of_cauchySeq_tendsto (fun u hu ↦ ?_) + obtain ⟨g, hg⟩ : ∃ g, Tendsto (f ∘ u) atTop (𝓝 g) := + cauchySeq_tendsto_of_complete (hf.cauchySeq_comp hu) + let f' : ℕ → (α → F') := fun n ↦ (f ∘ u) n + obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ + ∀ᵐ x ∂μ, Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) := + (tendstoInMeasure_of_tendsto_Lp hg).exists_seq_tendsto_ae + -- tendsto_nhds_of_cauchySeq_of_subseq + + + + + +#exit + + +lemma completeSpace_of_completeSpace_Lp + {s : Set α} (hs : 0 < μ s) (h's : μ s < ∞) + [CompleteSpace (Lp F' 1 μ)] : + CompleteSpace F' := by + apply completeSpace_of_completeSpace_Lp' (s := toMeasurable μ s) (μ := μ) + · simp [measure_toMeasurable, hs] + · simp [measure_toMeasurable, h's] + · exact measurableSet_toMeasurable μ s + + + + + +#exit + +theorem aestronglyMeasurable_condExpL1 {f : α → F'} : AEStronglyMeasurable[m] (condExpL1 hm μ f) μ := by - by_cases hf : Integrable f μ - · rw [condExpL1_eq hf] - exact aestronglyMeasurable_condExpL1CLM _ + by_cases hF' : CompleteSpace (Lp F' 1 μ); swap + · simp only [condExpL1, setToFun, hF', ↓reduceDIte, ZeroMemClass.coe_zero] + apply stronglyMeasurable_zero.aestronglyMeasurable.congr + exact (coeFn_zero _ 1 _).symm + by_cases hf : Integrable f μ; swap · rw [condExpL1_undef hf] exact stronglyMeasurable_zero.aestronglyMeasurable.congr (coeFn_zero ..).symm - -theorem condExpL1_congr_ae (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (h : f =ᵐ[μ] g) : - condExpL1 hm μ f = condExpL1 hm μ g := - setToFun_congr_ae _ h + by_cases hf' : f =ᵐ[μ] 0 + · apply stronglyMeasurable_zero.aestronglyMeasurable.congr + simp only [condExpL1_congr_ae hm hf', condExpL1_zero, ZeroMemClass.coe_zero] + exact (coeFn_zero _ 1 _).symm + have : CompleteSpace F' := sorry + + rw [condExpL1_eq hf] + exact aestronglyMeasurable_condExpL1CLM _ theorem integrable_condExpL1 (f : α → F') : Integrable (condExpL1 hm μ f) μ := L1.integrable_coeFn _ diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index 147002bccaf105..65253c6256f420 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -5,6 +5,7 @@ Authors: Rémy Degenne, Sébastien Gouëzel -/ module +public import Mathlib.Analysis.Normed.Operator.Bilinear public import Mathlib.Analysis.Normed.Operator.NNNorm public import Mathlib.MeasureTheory.Function.LpSeminorm.ChebyshevMarkov public import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp @@ -774,7 +775,7 @@ theorem norm_compLp_le (L : E →SL[σ] F) (f : Lp E p μ) : ‖L.compLp f‖ variable (μ p) /-- Composing `f : Lp E p μ` with `L : E →L[𝕜] F`, seen as a `𝕜`-linear map on `Lp E p μ`. -/ -def compLpₗ (L : E →SL[σ] F) : Lp E p μ →ₛₗ[σ] Lp F p μ where +@[simps] def compLpₗ (L : E →SL[σ] F) : Lp E p μ →ₛₗ[σ] Lp F p μ where toFun f := L.compLp f map_add' f g := by ext1 @@ -815,6 +816,43 @@ theorem smul_compLpL [Fact (1 ≤ p)] {𝕜''} [NormedRing 𝕜''] [Module 𝕜' theorem norm_compLpL_le [Fact (1 ≤ p)] (L : E →SL[σ] F) : ‖L.compLpL p μ‖ ≤ ‖L‖ := LinearMap.mkContinuous_norm_le _ (norm_nonneg _) _ +section Bilinear + +variable {F G : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] + [NormedAddCommGroup G] [NormedSpace 𝕜 G] + +variable (μ p) in +/-- Given a continuous bilinear map `G → E → F`, construct the associated bilinear map +`G → Lp E p μ → Lp F p μ`. -/ +@[simps] def compLpₗ₂ (B : G →L[𝕜] E →L[𝕜] F) : G →ₗ[𝕜] Lp E p μ →ₗ[𝕜] Lp F p μ where + toFun g := (B g).compLpₗ p μ + map_add' g h := by + ext f + filter_upwards [(B (g + h)).coeFn_compLp f, (B g).coeFn_compLp f, (B h).coeFn_compLp f, + Lp.coeFn_add ((B g).compLp f) ((B h).compLp f)] with x hx hg hh hadd + simp only [compLpₗ_apply, LinearMap.add_apply, hx, hadd] + simp only [map_add, add_apply, Pi.add_apply, hg, hh] + map_smul' c g := by + ext f + filter_upwards [(c • B g).coeFn_compLp f, (B g).coeFn_compLp f, + Lp.coeFn_smul c ((B g).compLp f)] with x hx hg hsmul + simp [hx, hsmul, hg] + +variable (μ p) in +/-- Given a continuous bilinear map `G → E → F`, construct the associated continuous bilinear map +`G → Lp E p μ → Lp F p μ`. -/ +@[simps!] def compLpL₂ [Fact (1 ≤ p)] (B : G →L[𝕜] E →L[𝕜] F) : + G →L[𝕜] Lp E p μ →L[𝕜] Lp F p μ := + (B.compLpₗ₂ p μ).mkContinuous₂ ‖B‖ (fun c f ↦ by + simp only [compLpₗ₂_apply, compLpₗ_apply] + grw [norm_compLp_le, le_opNorm]) + +theorem norm_compLpL₂ [Fact (1 ≤ p)] (B : G →L[𝕜] E →L[𝕜] F) : + ‖B.compLpL₂ p μ‖ ≤ ‖B‖ := + LinearMap.mkContinuous₂_norm_le _ (norm_nonneg _) _ + +end Bilinear + end ContinuousLinearMap namespace MeasureTheory.Lp diff --git a/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean b/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean index 38f24a5fb709d8..7dc57d897ef848 100644 --- a/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean +++ b/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean @@ -59,11 +59,9 @@ theorem tendsto_integral_of_dominated_convergence {F : ℕ → α → G} {f : α (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound a) (h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) atTop (𝓝 (f a))) : Tendsto (fun n => ∫ a, F n a ∂μ) atTop (𝓝 <| ∫ a, f a ∂μ) := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact tendsto_setToFun_of_dominated_convergence (dominatedFinMeasAdditive_weightedSMul μ) - bound F_measurable bound_integrable h_bound h_lim - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact tendsto_setToFun_of_dominated_convergence (dominatedFinMeasAdditive_weightedSMul μ) + bound F_measurable bound_integrable h_bound h_lim /-- Lebesgue dominated convergence theorem for filters with a countable basis -/ theorem tendsto_integral_filter_of_dominated_convergence {ι} {l : Filter ι} [l.IsCountablyGenerated] @@ -71,11 +69,9 @@ theorem tendsto_integral_filter_of_dominated_convergence {ι} {l : Filter ι} [l (h_bound : ∀ᶠ n in l, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound a) (bound_integrable : Integrable bound μ) (h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) l (𝓝 (f a))) : Tendsto (fun n => ∫ a, F n a ∂μ) l (𝓝 <| ∫ a, f a ∂μ) := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, L1.integral] - exact tendsto_setToFun_filter_of_dominated_convergence (dominatedFinMeasAdditive_weightedSMul μ) - bound hF_meas h_bound bound_integrable h_lim - · simp [integral, hG, tendsto_const_nhds] + simp only [integral_eq_setToFun] + exact tendsto_setToFun_filter_of_dominated_convergence (dominatedFinMeasAdditive_weightedSMul μ) + bound hF_meas h_bound bound_integrable h_lim /-- Lebesgue dominated convergence theorem for series. -/ theorem hasSum_integral_of_dominated_convergence {ι} [Countable ι] {F : ι → α → G} {f : α → G} diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 5aa23406241be4..8a1573e87bda41 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -194,11 +194,8 @@ theorem integral_undef {f : X → E} (hf : ¬ μ.Integrable f B) : setToFun_undef _ hf theorem enorm_integral_le (f : X → E) : - ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x, ‖f x‖ₑ ∂ (μ.transpose B).variation := by - by_cases hG : CompleteSpace G; swap - · simp [integral, hG] - by_cases hf : μ.Integrable f B; swap - · simp [integral_undef hf] + ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x, ‖f x‖ₑ ∂ (μ.transpose B).variation := + (enorm_setToFun_le _ (by simp)).trans (by simp) end VectorMeasure From efed1cfbfce91f71167401724777b07ee0d07118 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 10 May 2026 15:54:36 +0200 Subject: [PATCH 006/129] better --- .../ConditionalExpectation/CondexpL1.lean | 33 ++++++++++++------- .../MeasureTheory/Function/LpSpace/Basic.lean | 5 ++- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean index 9ddd6f4bb2b664..87aa8f57fd4400 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean @@ -489,23 +489,32 @@ lemma AEFinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α contrapose! h'f exact hf.ae_eq_mk.trans h'f -private lemma completeSpace_of_completeSpace_Lp' - {s : Set α} (hs : μ s ≠ 0) (h's : μ s ≠ ∞) (h''s : MeasurableSet s) - [CompleteSpace (Lp F' 1 μ)] : +private lemma completeSpace_of_completeSpace_Lp' {p : ℝ≥0∞} [Fact (1 ≤ p)] + [CompleteSpace (Lp F' p μ)] [Nontrivial (Lp ℝ p μ)] : CompleteSpace F' := by - let f : F' → Lp F' 1 μ := fun x ↦ indicatorConstLp 1 h''s h's x - have hf : LipschitzWith (NNReal.mk (μ.real s) measureReal_nonneg) f := by - apply lipschitzWith_iff_norm_sub_le.2 (fun x y ↦ ?_) - simp only [indicatorConstLp_sub, f] - rw [norm_indicatorConstLp (by simp) (by simp)] - simp [mul_comm] + obtain ⟨f, hf⟩ : ∃ f : Lp ℝ p μ, f ≠ 0 := exists_ne 0 + let m : F' →L[ℝ] Lp F' p μ := ((lsmul ℝ ℝ).flip.compLpL₂ p μ).flip f apply Metric.complete_of_cauchySeq_tendsto (fun u hu ↦ ?_) - obtain ⟨g, hg⟩ : ∃ g, Tendsto (f ∘ u) atTop (𝓝 g) := - cauchySeq_tendsto_of_complete (hf.cauchySeq_comp hu) - let f' : ℕ → (α → F') := fun n ↦ (f ∘ u) n + obtain ⟨g, hg⟩ : ∃ g, Tendsto (m ∘ u) atTop (𝓝 g) := + cauchySeq_tendsto_of_complete (m.lipschitz.cauchySeq_comp hu) + let f' : ℕ → (α → F') := fun n ↦ (m ∘ u) n obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ ∀ᵐ x ∂μ, Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) := (tendstoInMeasure_of_tendsto_Lp hg).exists_seq_tendsto_ae + have : (ae (μ.restrict (Function.support ↑↑f))).NeBot := by + apply ae_restrict_neBot.2 + sorry + have A : ∀ᵐ x ∂(μ.restrict (Function.support f)), + Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) := ae_restrict_of_ae nslim + have B : ∀ᵐ x ∂(μ.restrict (Function.support f)), x ∈ Function.support f := + ae_restrict_mem (measurableSet_support (by fun_prop)) + have C : ∀ᵐ x ∂(μ.restrict (Function.support f)), ∀ n, m (u n) x = (f x) • u n := by + apply ae_restrict_of_ae + apply ae_all_iff.2 (fun n ↦ ?_) + simp [m] + obtain ⟨x, xlim, hx⟩ : ∃ x, Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) + ∧ x ∈ Function.support f := (A.and B).exists + simp [f', m] at xlim -- tendsto_nhds_of_cauchySeq_of_subseq diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index 65253c6256f420..d7c81a82069fce 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -841,12 +841,15 @@ variable (μ p) in variable (μ p) in /-- Given a continuous bilinear map `G → E → F`, construct the associated continuous bilinear map `G → Lp E p μ → Lp F p μ`. -/ -@[simps!] def compLpL₂ [Fact (1 ≤ p)] (B : G →L[𝕜] E →L[𝕜] F) : +def compLpL₂ [Fact (1 ≤ p)] (B : G →L[𝕜] E →L[𝕜] F) : G →L[𝕜] Lp E p μ →L[𝕜] Lp F p μ := (B.compLpₗ₂ p μ).mkContinuous₂ ‖B‖ (fun c f ↦ by simp only [compLpₗ₂_apply, compLpₗ_apply] grw [norm_compLp_le, le_opNorm]) +@[simp] theorem compLpL₂_apply_apply [Fact (1 ≤ p)] (B : G →L[𝕜] E →L[𝕜] F) (g : G) (f : Lp E p μ) : + compLpL₂ p μ B g f = (B g).compLp f := rfl + theorem norm_compLpL₂ [Fact (1 ≤ p)] (B : G →L[𝕜] E →L[𝕜] F) : ‖B.compLpL₂ p μ‖ ≤ ‖B‖ := LinearMap.mkContinuous₂_norm_le _ (norm_nonneg _) _ From b6ffad51a3f147b083ca3387f89c0afdfb7749f3 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 10 May 2026 18:06:40 +0200 Subject: [PATCH 007/129] save --- .../ConditionalExpectation/CondexpL1.lean | 71 ------------- .../Function/LpSpace/CompleteOfComplete.lean | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 71 deletions(-) create mode 100644 Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean index 87aa8f57fd4400..3116ebe045df55 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean @@ -468,77 +468,6 @@ theorem condExpL1_congr_ae (hm : m ≤ m0) (h : f =ᵐ[μ] g) : condExpL1 hm μ f = condExpL1 hm μ g := setToFun_congr_ae _ h -lemma FinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α → F'} - (hf : FinStronglyMeasurable f μ) (h'f : ¬(f =ᵐ[μ] 0)) : - ∃ s, MeasurableSet s ∧ 0 < μ s ∧ μ s < ∞ := by - contrapose! h'f - rcases hf with ⟨fn, hfn, hfn_lim⟩ - have A n : μ (Function.support (fn n)) = 0 := by - by_contra! - have := h'f (Function.support (fn n)) (fn n).measurableSet_support (by positivity) - exact (lt_irrefl _ (this.trans_lt (hfn n))).elim - have B : ∀ᵐ x ∂μ, ∀ n, fn n x = 0 := ae_all_iff.mpr A - filter_upwards [B] with x hx - apply tendsto_nhds_unique (hfn_lim x) - simp [hx] - -lemma AEFinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α → F'} - (hf : AEFinStronglyMeasurable f μ) (h'f : ¬(f =ᵐ[μ] 0)) : - ∃ s, MeasurableSet s ∧ 0 < μ s ∧ μ s < ∞ := by - apply hf.finStronglyMeasurable_mk.exists_measurableSet_measure_pos_lt_top - contrapose! h'f - exact hf.ae_eq_mk.trans h'f - -private lemma completeSpace_of_completeSpace_Lp' {p : ℝ≥0∞} [Fact (1 ≤ p)] - [CompleteSpace (Lp F' p μ)] [Nontrivial (Lp ℝ p μ)] : - CompleteSpace F' := by - obtain ⟨f, hf⟩ : ∃ f : Lp ℝ p μ, f ≠ 0 := exists_ne 0 - let m : F' →L[ℝ] Lp F' p μ := ((lsmul ℝ ℝ).flip.compLpL₂ p μ).flip f - apply Metric.complete_of_cauchySeq_tendsto (fun u hu ↦ ?_) - obtain ⟨g, hg⟩ : ∃ g, Tendsto (m ∘ u) atTop (𝓝 g) := - cauchySeq_tendsto_of_complete (m.lipschitz.cauchySeq_comp hu) - let f' : ℕ → (α → F') := fun n ↦ (m ∘ u) n - obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ - ∀ᵐ x ∂μ, Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) := - (tendstoInMeasure_of_tendsto_Lp hg).exists_seq_tendsto_ae - have : (ae (μ.restrict (Function.support ↑↑f))).NeBot := by - apply ae_restrict_neBot.2 - sorry - have A : ∀ᵐ x ∂(μ.restrict (Function.support f)), - Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) := ae_restrict_of_ae nslim - have B : ∀ᵐ x ∂(μ.restrict (Function.support f)), x ∈ Function.support f := - ae_restrict_mem (measurableSet_support (by fun_prop)) - have C : ∀ᵐ x ∂(μ.restrict (Function.support f)), ∀ n, m (u n) x = (f x) • u n := by - apply ae_restrict_of_ae - apply ae_all_iff.2 (fun n ↦ ?_) - simp [m] - obtain ⟨x, xlim, hx⟩ : ∃ x, Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) - ∧ x ∈ Function.support f := (A.and B).exists - simp [f', m] at xlim - -- tendsto_nhds_of_cauchySeq_of_subseq - - - - - -#exit - - -lemma completeSpace_of_completeSpace_Lp - {s : Set α} (hs : 0 < μ s) (h's : μ s < ∞) - [CompleteSpace (Lp F' 1 μ)] : - CompleteSpace F' := by - apply completeSpace_of_completeSpace_Lp' (s := toMeasurable μ s) (μ := μ) - · simp [measure_toMeasurable, hs] - · simp [measure_toMeasurable, h's] - · exact measurableSet_toMeasurable μ s - - - - - -#exit - theorem aestronglyMeasurable_condExpL1 {f : α → F'} : AEStronglyMeasurable[m] (condExpL1 hm μ f) μ := by by_cases hF' : CompleteSpace (Lp F' 1 μ); swap diff --git a/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean b/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean new file mode 100644 index 00000000000000..c53b6e8913569f --- /dev/null +++ b/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean @@ -0,0 +1,99 @@ +/- +Copyright (c) 2026 Sébastien Gouëzel. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Sébastien Gouëzel +-/ +module + +public import Mathlib.Analysis.Normed.Operator.Mul +public import Mathlib.MeasureTheory.Function.ConvergenceInMeasure +public import Mathlib.MeasureTheory.Function.LpSpace.Complete + +/-! +# If an `Lp` space is complete, so is the target space +-/ + +@[expose] public section + +open scoped ENNReal Topology +open MeasureTheory Filter ContinuousLinearMap + +variable {α E : Type*} [NormedAddCommGroup E] [MeasurableSpace α] {μ : Measure α} {p : ℝ≥0∞} + +namespace MeasureTheory + +lemma FinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α → E} + (hf : FinStronglyMeasurable f μ) (h'f : ¬(f =ᵐ[μ] 0)) : + ∃ s, MeasurableSet s ∧ 0 < μ s ∧ μ s < ∞ := by + contrapose! h'f + rcases hf with ⟨fn, hfn, hfn_lim⟩ + have A n : μ (Function.support (fn n)) = 0 := by + by_contra! + have := h'f (Function.support (fn n)) (fn n).measurableSet_support (by positivity) + exact (lt_irrefl _ (this.trans_lt (hfn n))).elim + have B : ∀ᵐ x ∂μ, ∀ n, fn n x = 0 := ae_all_iff.mpr A + filter_upwards [B] with x hx + apply tendsto_nhds_unique (hfn_lim x) + simp [hx] + +lemma AEFinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α → E} + (hf : AEFinStronglyMeasurable f μ) (h'f : ¬(f =ᵐ[μ] 0)) : + ∃ s, MeasurableSet s ∧ 0 < μ s ∧ μ s < ∞ := by + apply hf.finStronglyMeasurable_mk.exists_measurableSet_measure_pos_lt_top + contrapose! h'f + exact hf.ae_eq_mk.trans h'f + +lemma foo [Nontrivial (Lp E p μ)] : Nontrivial (Lp ℝ p μ) := by + + + +variable [NormedSpace ℝ E] + +/-- If an `Lp` space is complete, then the target space is automatically complete unless the +`Lp` space is trivial. -/ +lemma completeSpace_of_completeSpace_Lp [Fact (1 ≤ p)] + [CompleteSpace (Lp E p μ)] [Nontrivial (Lp ℝ p μ)] : + CompleteSpace E := by + /- Consider a nonzero function `f : α → ℝ` in `L^p`. Given a Cauchy sequence `uₙ` in `E`, form + the Cauchy sequence `f • uₙ` in `L^p E`. By completeness, it converges. Consider a subsequence + which converges almost everywhere. As `f` is nonzero, we get some `x` such that `f x • uₙ` + converges along this subsequence and `f x ≠ 0`. Then `uₙ` converges along this subsequence, and + therefore along all indices as it is Cauchy. -/ + obtain ⟨f, hf⟩ : ∃ f : Lp ℝ p μ, f ≠ 0 := exists_ne 0 + let m : E →L[ℝ] Lp E p μ := ((ContinuousLinearMap.lsmul ℝ ℝ).flip.compLpL₂ p μ).flip f + apply Metric.complete_of_cauchySeq_tendsto (fun u hu ↦ ?_) + obtain ⟨g, hg⟩ : ∃ g, Tendsto (m ∘ u) atTop (𝓝 g) := + cauchySeq_tendsto_of_complete (m.lipschitz.cauchySeq_comp hu) + let f' : ℕ → (α → E) := fun n ↦ (m ∘ u) n + obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ + ∀ᵐ x ∂μ, Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) := + (tendstoInMeasure_of_tendsto_Lp hg).exists_seq_tendsto_ae + have : (ae (μ.restrict (Function.support f))).NeBot := by + apply ae_restrict_neBot.2 + have : NeZero μ := by + contrapose! hf + simp [neZero_iff] at hf + ext + simp only [hf, ae_zero, ZeroMemClass.coe_zero] + trivial + contrapose! hf + ext + filter_upwards [compl_mem_ae_iff.2 hf] with y hy + simp at hy + simp [hy] + have A : ∀ᵐ x ∂(μ.restrict (Function.support f)), + Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) := ae_restrict_of_ae nslim + have B : ∀ᵐ x ∂(μ.restrict (Function.support f)), x ∈ Function.support f := + ae_restrict_mem (measurableSet_support (by fun_prop)) + have C : ∀ᵐ x ∂(μ.restrict (Function.support f)), ∀ n, m (u n) x = (f x) • u n := by + apply ae_restrict_of_ae + apply ae_all_iff.2 (fun n ↦ ?_) + filter_upwards [(toSpanSingleton ℝ (u n)).coeFn_compLp f] with x hx using by simp [m, hx] + obtain ⟨x, xlim, hx, hmx⟩ : ∃ x, Tendsto (fun i ↦ f' (ns i) x) atTop (𝓝 (g x)) + ∧ x ∈ Function.support f ∧ ∀ n, m (u n) x = (f x) • u n := (A.and (B.and C)).exists + simp only [Function.comp_apply, hmx, f'] at xlim + refine ⟨(f x)⁻¹ • g x, ?_⟩ + apply tendsto_nhds_of_cauchySeq_of_subseq hu (StrictMono.tendsto_atTop hns) + convert Tendsto.const_smul xlim (f x)⁻¹ with n + rw [smul_smul, inv_mul_cancel₀, one_smul, Function.comp] + exact hx From 4f25a6c7ffc0bde40098c1734db525d75b7c89c3 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Sun, 10 May 2026 18:49:59 +0200 Subject: [PATCH 008/129] progress --- .../Function/LpSpace/CompleteOfComplete.lean | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean b/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean index c53b6e8913569f..ea6b17cc012f69 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean @@ -8,6 +8,7 @@ module public import Mathlib.Analysis.Normed.Operator.Mul public import Mathlib.MeasureTheory.Function.ConvergenceInMeasure public import Mathlib.MeasureTheory.Function.LpSpace.Complete +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp /-! # If an `Lp` space is complete, so is the target space @@ -43,7 +44,30 @@ lemma AEFinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α contrapose! h'f exact hf.ae_eq_mk.trans h'f -lemma foo [Nontrivial (Lp E p μ)] : Nontrivial (Lp ℝ p μ) := by +lemma foo [Nontrivial (Lp E p μ)] (hp : p ≠ 0) : Nontrivial (Lp ℝ p μ) := by + obtain ⟨f, hf⟩ : ∃ f : Lp E p μ, f ≠ 0 := exists_ne 0 + have hfne : ¬ (f =ᵐ[μ] 0) := by + contrapose! hf + ext + grw [hf, (Lp.coeFn_zero E p μ)] + rcases eq_top_or_lt_top p with rfl | h'p + · sorry + · have h'f : AEFinStronglyMeasurable f μ := + MemLp.aefinStronglyMeasurable (Lp.memLp f) hp h'p.ne + obtain ⟨s, s_meas, s_pos, s_top⟩ : ∃ s, MeasurableSet s ∧ 0 < μ s ∧ μ s < ∞ := + h'f.exists_measurableSet_measure_pos_lt_top hfne + apply nontrivial_of_ne (indicatorConstLp p s_meas s_top.ne 1) 0 + intro hzero + have : ‖indicatorConstLp p s_meas s_top.ne (1 : ℝ)‖ = ‖(0 : Lp ℝ p μ)‖ := by rw [hzero] + simp [norm_indicatorConstLp hp h'p.ne] at this + + + + + + + +#exit From 7d6622302e1030c3a4488d3eefeeb08487fc5d85 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 10 May 2026 21:44:08 +0200 Subject: [PATCH 009/129] complete proof --- Mathlib.lean | 1 + ...omplete.lean => CompleteOfCompleteLp.lean} | 49 +++++++++++-------- 2 files changed, 30 insertions(+), 20 deletions(-) rename Mathlib/MeasureTheory/Function/LpSpace/{CompleteOfComplete.lean => CompleteOfCompleteLp.lean} (78%) diff --git a/Mathlib.lean b/Mathlib.lean index 6132e7c7a1166a..8d57a4f1b7e067 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5306,6 +5306,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality public import Mathlib.MeasureTheory.Function.LpSeminorm.Trim public import Mathlib.MeasureTheory.Function.LpSpace.Basic public import Mathlib.MeasureTheory.Function.LpSpace.Complete +public import Mathlib.MeasureTheory.Function.LpSpace.CompleteOfCompleteLp public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreserving public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions public import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic diff --git a/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean b/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfCompleteLp.lean similarity index 78% rename from Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean rename to Mathlib/MeasureTheory/Function/LpSpace/CompleteOfCompleteLp.lean index ea6b17cc012f69..1391c8ce78398c 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfComplete.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfCompleteLp.lean @@ -17,12 +17,12 @@ public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp @[expose] public section open scoped ENNReal Topology -open MeasureTheory Filter ContinuousLinearMap - -variable {α E : Type*} [NormedAddCommGroup E] [MeasurableSpace α] {μ : Measure α} {p : ℝ≥0∞} +open Filter ContinuousLinearMap namespace MeasureTheory +variable {α E : Type*} [NormedAddCommGroup E] [MeasurableSpace α] {p : ℝ≥0∞} {μ : Measure α} + lemma FinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α → E} (hf : FinStronglyMeasurable f μ) (h'f : ¬(f =ᵐ[μ] 0)) : ∃ s, MeasurableSet s ∧ 0 < μ s ∧ μ s < ∞ := by @@ -44,14 +44,27 @@ lemma AEFinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α contrapose! h'f exact hf.ae_eq_mk.trans h'f -lemma foo [Nontrivial (Lp E p μ)] (hp : p ≠ 0) : Nontrivial (Lp ℝ p μ) := by +variable (E p μ) in +lemma nontrivial_Lp_real_of_nontrivial_Lp [Nontrivial (Lp E p μ)] : + Nontrivial (Lp ℝ p μ) := by obtain ⟨f, hf⟩ : ∃ f : Lp E p μ, f ≠ 0 := exists_ne 0 have hfne : ¬ (f =ᵐ[μ] 0) := by contrapose! hf ext grw [hf, (Lp.coeFn_zero E p μ)] rcases eq_top_or_lt_top p with rfl | h'p - · sorry + · apply nontrivial_of_ne ((memLp_top_const (1 : ℝ)).toLp _) 0 + contrapose! hfne + have := Lp.ext_iff.1 hfne + grw [Lp.coeFn_zero, MemLp.coeFn_toLp] at this + filter_upwards [this] with x hx using by simp at hx + rcases eq_or_ne p 0 with rfl | hp + · have : MemLp (fun (_ : α) ↦ (1 : ℝ)) 0 μ := by simpa using aestronglyMeasurable_const + apply nontrivial_of_ne (this.toLp _) 0 + contrapose! hfne + have := Lp.ext_iff.1 hfne + grw [Lp.coeFn_zero, MemLp.coeFn_toLp] at this + filter_upwards [this] with x hx using by simp at hx · have h'f : AEFinStronglyMeasurable f μ := MemLp.aefinStronglyMeasurable (Lp.memLp f) hp h'p.ne obtain ⟨s, s_meas, s_pos, s_top⟩ : ∃ s, MeasurableSet s ∧ 0 < μ s ∧ μ s < ∞ := @@ -59,31 +72,25 @@ lemma foo [Nontrivial (Lp E p μ)] (hp : p ≠ 0) : Nontrivial (Lp ℝ p μ) := apply nontrivial_of_ne (indicatorConstLp p s_meas s_top.ne 1) 0 intro hzero have : ‖indicatorConstLp p s_meas s_top.ne (1 : ℝ)‖ = ‖(0 : Lp ℝ p μ)‖ := by rw [hzero] - simp [norm_indicatorConstLp hp h'p.ne] at this - - - - - - - -#exit - - + simp only [norm_indicatorConstLp hp h'p.ne, norm_one, one_div, one_mul, Lp.norm_zero] at this + rw [Real.rpow_eq_zero (by positivity) (by simp [ENNReal.toReal_eq_zero_iff, hp, h'p.ne]), + measureReal_eq_zero_iff] at this + order variable [NormedSpace ℝ E] /-- If an `Lp` space is complete, then the target space is automatically complete unless the `Lp` space is trivial. -/ -lemma completeSpace_of_completeSpace_Lp [Fact (1 ≤ p)] - [CompleteSpace (Lp E p μ)] [Nontrivial (Lp ℝ p μ)] : - CompleteSpace E := by +lemma completeSpace_of_completeSpace_Lp [hp : Fact (1 ≤ p)] + [CompleteSpace (Lp E p μ)] [Nontrivial (Lp E p μ)] : CompleteSpace E := by /- Consider a nonzero function `f : α → ℝ` in `L^p`. Given a Cauchy sequence `uₙ` in `E`, form the Cauchy sequence `f • uₙ` in `L^p E`. By completeness, it converges. Consider a subsequence which converges almost everywhere. As `f` is nonzero, we get some `x` such that `f x • uₙ` converges along this subsequence and `f x ≠ 0`. Then `uₙ` converges along this subsequence, and therefore along all indices as it is Cauchy. -/ - obtain ⟨f, hf⟩ : ∃ f : Lp ℝ p μ, f ≠ 0 := exists_ne 0 + obtain ⟨f, hf⟩ : ∃ f : Lp ℝ p μ, f ≠ 0 := by + have : Nontrivial (Lp ℝ p μ) := nontrivial_Lp_real_of_nontrivial_Lp E p μ + exact exists_ne 0 let m : E →L[ℝ] Lp E p μ := ((ContinuousLinearMap.lsmul ℝ ℝ).flip.compLpL₂ p μ).flip f apply Metric.complete_of_cauchySeq_tendsto (fun u hu ↦ ?_) obtain ⟨g, hg⟩ : ∃ g, Tendsto (m ∘ u) atTop (𝓝 g) := @@ -121,3 +128,5 @@ lemma completeSpace_of_completeSpace_Lp [Fact (1 ≤ p)] convert Tendsto.const_smul xlim (f x)⁻¹ with n rw [smul_smul, inv_mul_cancel₀, one_smul, Function.comp] exact hx + +end MeasureTheory From 8194fbc9cbd9ca6297865c322914d61fca207a6a Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 10 May 2026 22:04:50 +0200 Subject: [PATCH 010/129] better --- .../Function/ConditionalExpectation/CondexpL1.lean | 11 ++++++++--- .../Function/LpSpace/CompleteOfCompleteLp.lean | 7 +++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean index 3116ebe045df55..a79c7472b39a19 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean @@ -5,6 +5,7 @@ Authors: Rémy Degenne -/ module +public import Mathlib.MeasureTheory.Function.LpSpace.CompleteOfCompleteLp public import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 public import Mathlib.MeasureTheory.Measure.Real @@ -481,8 +482,12 @@ theorem aestronglyMeasurable_condExpL1 {f : α → F'} : · apply stronglyMeasurable_zero.aestronglyMeasurable.congr simp only [condExpL1_congr_ae hm hf', condExpL1_zero, ZeroMemClass.coe_zero] exact (coeFn_zero _ 1 _).symm - have : CompleteSpace F' := sorry - + have : CompleteSpace F' := by + have : Nontrivial (Lp F' 1 μ) := by + apply nontrivial_of_ne (hf.toL1 f) 0 + grw [ne_eq, Lp.ext_iff, Integrable.coeFn_toL1, coeFn_zero] + exact hf' + exact completeSpace_of_completeSpace_Lp F' 1 μ rw [condExpL1_eq hf] exact aestronglyMeasurable_condExpL1CLM _ @@ -522,7 +527,7 @@ theorem condExpL1_of_aestronglyMeasurable' [CompleteSpace F'] (hfm : AEStronglyM theorem condExpL1_mono {E} [NormedAddCommGroup E] [PartialOrder E] [ClosedIciTopology E] [IsOrderedAddMonoid E] - [CompleteSpace E] [NormedSpace ℝ E] [IsOrderedModule ℝ E] {f g : α → E} (hf : Integrable f μ) + [NormedSpace ℝ E] [IsOrderedModule ℝ E] {f g : α → E} (hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) : condExpL1 hm μ f ≤ᵐ[μ] condExpL1 hm μ g := by rw [coeFn_le] diff --git a/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfCompleteLp.lean b/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfCompleteLp.lean index 1391c8ce78398c..247b756ba663d8 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfCompleteLp.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/CompleteOfCompleteLp.lean @@ -45,8 +45,7 @@ lemma AEFinStronglyMeasurable.exists_measurableSet_measure_pos_lt_top {f : α exact hf.ae_eq_mk.trans h'f variable (E p μ) in -lemma nontrivial_Lp_real_of_nontrivial_Lp [Nontrivial (Lp E p μ)] : - Nontrivial (Lp ℝ p μ) := by +lemma nontrivial_Lp_real_of_nontrivial_Lp [Nontrivial (Lp E p μ)] : Nontrivial (Lp ℝ p μ) := by obtain ⟨f, hf⟩ : ∃ f : Lp E p μ, f ≠ 0 := exists_ne 0 have hfne : ¬ (f =ᵐ[μ] 0) := by contrapose! hf @@ -79,8 +78,8 @@ lemma nontrivial_Lp_real_of_nontrivial_Lp [Nontrivial (Lp E p μ)] : variable [NormedSpace ℝ E] -/-- If an `Lp` space is complete, then the target space is automatically complete unless the -`Lp` space is trivial. -/ +variable (E p μ) in +/-- If an `L^p` space is complete and nontrivial, then the target space is complete. -/ lemma completeSpace_of_completeSpace_Lp [hp : Fact (1 ≤ p)] [CompleteSpace (Lp E p μ)] [Nontrivial (Lp E p μ)] : CompleteSpace E := by /- Consider a nonzero function `f : α → ℝ` in `L^p`. Given a Cauchy sequence `uₙ` in `E`, form From 43d8afa2e32b75beff013d2c2076f30ac3132fe2 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 10 May 2026 22:27:18 +0200 Subject: [PATCH 011/129] better --- .../Function/ConditionalExpectation/Basic.lean | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index 71364441d5da1a..fe5c2e6d0b1168 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -82,7 +82,7 @@ variable {α β E 𝕜 : Type*} [RCLike 𝕜] {m m₀ : MeasurableSpace α} {μ {s : Set α} section NormedAddCommGroup -variable [NormedAddCommGroup E] [CompleteSpace E] +variable [NormedAddCommGroup E] section NormedSpace variable [NormedSpace ℝ E] @@ -144,7 +144,8 @@ theorem condExp_const (hm : m ≤ m₀) (c : E) [IsFiniteMeasure μ] : μ[fun _ : α ↦ c | m] = fun _ ↦ c := condExp_of_stronglyMeasurable hm stronglyMeasurable_const (integrable_const c) -theorem condExp_ae_eq_condExpL1 (hm : m ≤ m₀) [hμm : SigmaFinite (μ.trim hm)] (f : α → E) : +theorem condExp_ae_eq_condExpL1 [CompleteSpace E] + (hm : m ≤ m₀) [hμm : SigmaFinite (μ.trim hm)] (f : α → E) : μ[f | m] =ᵐ[μ] condExpL1 hm μ f := by rw [condExp_of_sigmaFinite hm] by_cases hfi : Integrable f μ @@ -157,7 +158,8 @@ theorem condExp_ae_eq_condExpL1 (hm : m ≤ m₀) [hμm : SigmaFinite (μ.trim h rw [if_neg hfi, condExpL1_undef hfi] exact (coeFn_zero _ _ _).symm -theorem condExp_ae_eq_condExpL1CLM (hm : m ≤ m₀) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ) : +theorem condExp_ae_eq_condExpL1CLM [CompleteSpace E] + (hm : m ≤ m₀) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ) : μ[f | m] =ᵐ[μ] condExpL1CLM E hm μ (hf.toL1 f) := by refine (condExp_ae_eq_condExpL1 hm f).trans (Eventually.of_forall fun x => ?_) rw [condExpL1_eq hf] @@ -189,6 +191,8 @@ theorem stronglyMeasurable_condExp : StronglyMeasurable[m] (μ[f | m]) := by · exact aestronglyMeasurable_condExpL1.stronglyMeasurable_mk · exact stronglyMeasurable_zero +variable [CompleteSpace E] + @[gcongr] theorem condExp_congr_ae (h : f =ᵐ[μ] g) : μ[f | m] =ᵐ[μ] μ[g | m] := by by_cases hm : m ≤ m₀ @@ -397,7 +401,7 @@ end RCLike end NormedSpace section Real -variable [InnerProductSpace ℝ E] +variable [InnerProductSpace ℝ E] [CompleteSpace E] -- TODO: Generalize via the conditional Jensen inequality lemma eLpNorm_condExp_le : eLpNorm (μ[f | m]) 2 μ ≤ eLpNorm f 2 μ := by From 0d9c323b6584c3a95ac9d918f719ea1f0c57d192 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 10 May 2026 22:41:30 +0200 Subject: [PATCH 012/129] fix --- Mathlib/Probability/Martingale/Basic.lean | 42 +++++++++++++++-------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/Mathlib/Probability/Martingale/Basic.lean b/Mathlib/Probability/Martingale/Basic.lean index a30e56290b0fcd..f7b8ad3773599f 100644 --- a/Mathlib/Probability/Martingale/Basic.lean +++ b/Mathlib/Probability/Martingale/Basic.lean @@ -46,7 +46,7 @@ open scoped NNReal ENNReal MeasureTheory ProbabilityTheory namespace MeasureTheory variable {Ω E ι : Type*} [Preorder ι] {m0 : MeasurableSpace Ω} {μ : Measure Ω} - [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {f g : ι → Ω → E} {ℱ : Filtration ι m0} + [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : ι → Ω → E} {ℱ : Filtration ι m0} /-- A family of functions `f : ι → Ω → E` is a martingale with respect to a filtration `ℱ` if `f` is strongly adapted with respect to `ℱ` and for all `i ≤ j`, `μ[f j | ℱ i] =ᵐ[μ] f i`. -/ @@ -92,6 +92,8 @@ protected theorem stronglyMeasurable (hf : Martingale f ℱ μ) (i : ι) : theorem condExp_ae_eq (hf : Martingale f ℱ μ) {i j : ι} (hij : i ≤ j) : μ[f j | ℱ i] =ᵐ[μ] f i := hf.2 i j hij +variable [CompleteSpace E] + protected theorem integrable (hf : Martingale f ℱ μ) (i : ι) : Integrable (f i) μ := integrable_condExp.congr (hf.condExp_ae_eq (le_refl i)) @@ -131,12 +133,12 @@ theorem submartingale [Preorder E] (hf : Martingale f ℱ μ) : Submartingale f end Martingale -theorem martingale_iff [PartialOrder E] : +theorem martingale_iff [CompleteSpace E] [PartialOrder E] : Martingale f ℱ μ ↔ Supermartingale f ℱ μ ∧ Submartingale f ℱ μ := ⟨fun hf => ⟨hf.supermartingale, hf.submartingale⟩, fun ⟨hf₁, hf₂⟩ => ⟨hf₁.1, fun i j hij => (hf₁.2.1 i j hij).antisymm (hf₂.2.1 i j hij)⟩⟩ -theorem martingale_condExp (f : Ω → E) (ℱ : Filtration ι m0) (μ : Measure Ω) +theorem martingale_condExp [CompleteSpace E] (f : Ω → E) (ℱ : Filtration ι m0) (μ : Measure Ω) [SigmaFiniteFiltration μ ℱ] : Martingale (fun i => μ[f | ℱ i]) ℱ μ := ⟨fun _ => stronglyMeasurable_condExp, fun _ j hij => condExp_condExp_of_le (ℱ.mono hij) (ℱ.le j)⟩ @@ -156,6 +158,8 @@ theorem condExp_ae_le [LE E] (hf : Supermartingale f ℱ μ) {i j : ι} (hij : i μ[f j | ℱ i] ≤ᵐ[μ] f i := hf.2.1 i j hij +variable [CompleteSpace E] + theorem setIntegral_le [PartialOrder E] [IsOrderedAddMonoid E] [IsOrderedModule ℝ E] [ClosedIciTopology E] [SigmaFiniteFiltration μ ℱ] {f : ι → Ω → E} (hf : Supermartingale f ℱ μ) {i j : ι} (hij : i ≤ j) {s : Set Ω} (hs : MeasurableSet[ℱ i] s) : @@ -208,6 +212,8 @@ theorem ae_le_condExp [LE E] (hf : Submartingale f ℱ μ) {i j : ι} (hij : i f i ≤ᵐ[μ] μ[f j | ℱ i] := hf.2.1 i j hij +variable [CompleteSpace E] + lemma congr [LE E] (hf : Submartingale f ℱ μ) (hg : StronglyAdapted ℱ g) (h_eq : ∀ t, f t =ᵐ[μ] g t) : Submartingale g ℱ μ := by @@ -290,6 +296,8 @@ theorem submartingale_of_setIntegral_le [SigmaFiniteFiltration μ ℱ] integral_sub' integrable_condExp.integrableOn (hint i).integrableOn, sub_nonneg, setIntegral_condExp (ℱ.le i) (hint j) hs] +variable [CompleteSpace E] + theorem submartingale_of_condExp_sub_nonneg [PartialOrder E] [IsOrderedAddMonoid E] [SigmaFiniteFiltration μ ℱ] {f : ι → Ω → E} (hadp : StronglyAdapted ℱ f) (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i j, i ≤ j → 0 ≤ᵐ[μ] μ[f j - f i | ℱ i]) : @@ -319,11 +327,11 @@ end Submartingale namespace Supermartingale -theorem sub_submartingale [Preorder E] [AddLeftMono E] +theorem sub_submartingale [CompleteSpace E] [Preorder E] [AddLeftMono E] (hf : Supermartingale f ℱ μ) (hg : Submartingale g ℱ μ) : Supermartingale (f - g) ℱ μ := by rw [sub_eq_add_neg]; exact hf.add hg.neg -theorem sub_martingale [Preorder E] [AddLeftMono E] +theorem sub_martingale [CompleteSpace E] [Preorder E] [AddLeftMono E] (hf : Supermartingale f ℱ μ) (hg : Martingale g ℱ μ) : Supermartingale (f - g) ℱ μ := hf.sub_submartingale hg.submartingale @@ -398,7 +406,8 @@ end OfSetIntegral section OfSucc -variable [PartialOrder E] [IsOrderedAddMonoid E] [ClosedIciTopology E] [IsOrderedModule ℝ E] +variable [CompleteSpace E] [PartialOrder E] [IsOrderedAddMonoid E] [ClosedIciTopology E] + [IsOrderedModule ℝ E] theorem submartingale_nat [IsFiniteMeasure μ] {f : ℕ → Ω → E} (hadp : StronglyAdapted 𝒢 f) (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i, f i ≤ᵐ[μ] μ[f (i + 1) | 𝒢 i]) : @@ -467,7 +476,8 @@ end Preorder end SubSuper -theorem martingale_nat [IsFiniteMeasure μ] {f : ℕ → Ω → E} (hadp : StronglyAdapted 𝒢 f) +theorem martingale_nat [CompleteSpace E] [IsFiniteMeasure μ] + {f : ℕ → Ω → E} (hadp : StronglyAdapted 𝒢 f) (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i, f i =ᵐ[μ] μ[f (i + 1) | 𝒢 i]) : Martingale f 𝒢 μ := by refine ⟨hadp, fun i j hij ↦ ?_⟩ @@ -480,7 +490,7 @@ theorem martingale_nat [IsFiniteMeasure μ] {f : ℕ → Ω → E} (hadp : Stron with ω hω1 hω2 hω3 rw [← hω1, hω2, hω3] -theorem martingale_of_setIntegral_eq_succ [IsFiniteMeasure μ] {f : ℕ → Ω → E} +theorem martingale_of_setIntegral_eq_succ [CompleteSpace E] [IsFiniteMeasure μ] {f : ℕ → Ω → E} (hadp : StronglyAdapted 𝒢 f) (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i, ∀ s : Set Ω, MeasurableSet[𝒢 i] s → ∫ ω in s, f i ω ∂μ = ∫ ω in s, f (i + 1) ω ∂μ) : Martingale f 𝒢 μ := by @@ -491,7 +501,7 @@ theorem martingale_of_setIntegral_eq_succ [IsFiniteMeasure μ] {f : ℕ → Ω ← setIntegral_trim (𝒢.le n) stronglyMeasurable_condExp ms, setIntegral_condExp (𝒢.le n) (hint (n + 1)) ms, hf n s ms] -theorem martingale_of_condExp_sub_eq_zero_nat [IsFiniteMeasure μ] {f : ℕ → Ω → E} +theorem martingale_of_condExp_sub_eq_zero_nat [CompleteSpace E] [IsFiniteMeasure μ] {f : ℕ → Ω → E} (hadp : StronglyAdapted 𝒢 f) (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i, μ[f (i + 1) - f i | 𝒢 i] =ᵐ[μ] 0) : Martingale f 𝒢 μ := by refine martingale_nat hadp hint fun i ↦ ?_ @@ -500,7 +510,8 @@ theorem martingale_of_condExp_sub_eq_zero_nat [IsFiniteMeasure μ] {f : ℕ → exact EventuallyEq.trans (condExp_sub (hint _) (hint _) _).symm (hf i) /-- A predictable martingale is a.e. equal to its initial state. -/ -theorem Martingale.eq_zero_of_predictable [SigmaFiniteFiltration μ 𝒢] {f : ℕ → Ω → E} +theorem Martingale.eq_zero_of_predictable [CompleteSpace E] [SigmaFiniteFiltration μ 𝒢] + {f : ℕ → Ω → E} (hfmgle : Martingale f 𝒢 μ) (hfadp : StronglyAdapted 𝒢 fun n => f (n + 1)) (n : ℕ) : f n =ᵐ[μ] f 0 := by induction n with @@ -511,7 +522,7 @@ theorem Martingale.eq_zero_of_predictable [SigmaFiniteFiltration μ 𝒢] {f : section IsStronglyPredictable -variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- A predictable submartingale is a.e. greater than or equal to its initial state. -/ theorem Submartingale.zero_le_of_predictable' [Preorder E] [SigmaFiniteFiltration μ 𝒢] @@ -526,7 +537,8 @@ theorem Supermartingale.le_zero_of_predictable' [Preorder E] [SigmaFiniteFiltrat le_zero_of_predictable hfmgle hfadp.measurable_add_one n /-- A predictable martingale is a.e. equal to its initial state. -/ -theorem Martingale.eq_zero_of_predictable' [SigmaFiniteFiltration μ 𝒢] {f : ℕ → Ω → E} +theorem Martingale.eq_zero_of_predictable' [CompleteSpace E] [SigmaFiniteFiltration μ 𝒢] + {f : ℕ → Ω → E} (hfmgle : Martingale f 𝒢 μ) (hfadp : IsStronglyPredictable 𝒢 f) (n : ℕ) : f n =ᵐ[μ] f 0 := eq_zero_of_predictable hfmgle hfadp.measurable_add_one n @@ -543,9 +555,11 @@ end Submartingale section SumSMul -variable [PartialOrder E] [IsOrderedModule ℝ E] [ClosedIciTopology E] [IsOrderedAddMonoid E] +variable [CompleteSpace E] [PartialOrder E] [IsOrderedModule ℝ E] [ClosedIciTopology E] + [IsOrderedAddMonoid E] -theorem Submartingale.sum_smul_sub [IsFiniteMeasure μ] {R : ℝ} {f : ℕ → Ω → E} {ξ : ℕ → Ω → ℝ} +theorem Submartingale.sum_smul_sub [IsFiniteMeasure μ] {R : ℝ} + {f : ℕ → Ω → E} {ξ : ℕ → Ω → ℝ} (hf : Submartingale f 𝒢 μ) (hξ : StronglyAdapted 𝒢 ξ) (hbdd : ∀ n ω, ξ n ω ≤ R) (hnonneg : ∀ n ω, 0 ≤ ξ n ω) : Submartingale (fun n => ∑ k ∈ Finset.range n, ξ k • (f (k + 1) - f k)) 𝒢 μ := by From 6faad6486bb72f7226ecff02a009d9b5bbf0b389 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 11 May 2026 08:46:53 +0200 Subject: [PATCH 013/129] fix --- Mathlib/Probability/Martingale/Centering.lean | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Mathlib/Probability/Martingale/Centering.lean b/Mathlib/Probability/Martingale/Centering.lean index 9ad67533694f11..4fdfd483e7f7a0 100644 --- a/Mathlib/Probability/Martingale/Centering.lean +++ b/Mathlib/Probability/Martingale/Centering.lean @@ -41,7 +41,7 @@ open scoped NNReal ENNReal MeasureTheory ProbabilityTheory namespace MeasureTheory variable {Ω E : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} [NormedAddCommGroup E] - [NormedSpace ℝ E] [CompleteSpace E] {f g : ℕ → Ω → E} {ℱ : Filtration ℕ m0} + [NormedSpace ℝ E] {f g : ℕ → Ω → E} {ℱ : Filtration ℕ m0} /-- Any `ℕ`-indexed stochastic process can be written as the sum of a martingale and a predictable process. This is the predictable process. See `martingalePart` for the martingale. -/ @@ -57,13 +57,13 @@ lemma predictablePart_add_one (n : ℕ) : predictablePart f ℱ μ n + μ[f (n + 1) - f n | ℱ n] := by simp [predictablePart, Finset.sum_range_add] -lemma predictablePart_smul (c : ℝ) (n : ℕ) : +lemma predictablePart_smul [CompleteSpace E] (c : ℝ) (n : ℕ) : predictablePart (c • f) ℱ μ n =ᵐ[μ] c • predictablePart f ℱ μ n := by simp only [predictablePart, Finset.smul_sum] refine eventuallyEq_sum fun i hi => ?_ simp [← smul_sub, condExp_smul] -lemma predictablePart_add (hfint : ∀ n, Integrable (f n) μ) +lemma predictablePart_add [CompleteSpace E] (hfint : ∀ n, Integrable (f n) μ) (hgint : ∀ n, Integrable (g n) μ) (n : ℕ) : predictablePart (f + g) ℱ μ n =ᵐ[μ] predictablePart f ℱ μ n + predictablePart g ℱ μ n := by simp only [predictablePart, ← Finset.sum_add_distrib] @@ -72,7 +72,7 @@ lemma predictablePart_add (hfint : ∀ n, Integrable (f n) μ) _ =ᵐ[μ] μ[(f (i + 1) - f i) + (g (i + 1) - g i) | ℱ i] := by simp; abel_nf; rfl _ =ᵐ[μ] _ := by apply condExp_add ((hfint (i + 1)).sub (hfint i)) ((hgint (i + 1)).sub (hgint i)) -lemma Martingale.predictablePart_eq_zero (hf : Martingale f ℱ μ) (n : ℕ) : +lemma Martingale.predictablePart_eq_zero [CompleteSpace E] (hf : Martingale f ℱ μ) (n : ℕ) : predictablePart f ℱ μ n =ᵐ[μ] 0 := by rw [predictablePart, ← Finset.sum_const_zero (s := Finset.range n)] refine eventuallyEq_sum fun i hi => ?_ @@ -82,7 +82,8 @@ lemma Martingale.predictablePart_eq_zero (hf : Martingale f ℱ μ) (n : ℕ) : _ =ᵐ[μ] f i - f i := (hf.condExp_ae_eq (Nat.le_succ i)).sub (hf.condExp_ae_eq le_rfl) _ =ᵐ[μ] 0 := by simp -lemma Submartingale.monotone_predictablePart [PartialOrder E] [IsOrderedAddMonoid E] +lemma Submartingale.monotone_predictablePart + [CompleteSpace E] [PartialOrder E] [IsOrderedAddMonoid E] (hf : Submartingale f ℱ μ) : ∀ᵐ ω ∂μ, Monotone (predictablePart f ℱ μ · ω) := by have := ae_all_iff.2 <| fun n : ℕ ↦ hf.condExp_sub_nonneg n.le_succ @@ -91,7 +92,8 @@ lemma Submartingale.monotone_predictablePart [PartialOrder E] [IsOrderedAddMonoi refine monotone_nat_of_le_succ fun n ↦ (?_ : _ ≥ _) grw [predictablePart_add_one, Pi.add_apply, h n, add_zero] -lemma Submartingale.predictablePart_nonneg [PartialOrder E] [IsOrderedAddMonoid E] +lemma Submartingale.predictablePart_nonneg + [CompleteSpace E] [PartialOrder E] [IsOrderedAddMonoid E] (hf : Submartingale f ℱ μ) : ∀ᵐ ω ∂μ, ∀ n, 0 ≤ predictablePart f ℱ μ n ω := by filter_upwards [hf.monotone_predictablePart] with ω hω n @@ -129,19 +131,19 @@ noncomputable def martingalePart {m0 : MeasurableSpace Ω} (f : ℕ → Ω → E lemma martingalePart_zero : martingalePart f ℱ μ 0 = f 0 := by simp [martingalePart] -lemma martingalePart_smul (c : ℝ) (n : ℕ) : +lemma martingalePart_smul [CompleteSpace E] (c : ℝ) (n : ℕ) : martingalePart (c • f) ℱ μ n =ᵐ[μ] c • martingalePart f ℱ μ n := by filter_upwards [predictablePart_smul (f := f) c n] with ω hω simpa [martingalePart, smul_sub] -lemma martingalePart_add (hfint : ∀ n, Integrable (f n) μ) +lemma martingalePart_add [CompleteSpace E] (hfint : ∀ n, Integrable (f n) μ) (hgint : ∀ n, Integrable (g n) μ) (n : ℕ) : martingalePart (f + g) ℱ μ n =ᵐ[μ] martingalePart f ℱ μ n + martingalePart g ℱ μ n := by filter_upwards [predictablePart_add (ℱ := ℱ) hfint hgint n] with ω hω simp_all [martingalePart] abel -lemma Martingale.martingalePart_eq (hf : Martingale f ℱ μ) (n : ℕ) : +lemma Martingale.martingalePart_eq [CompleteSpace E] (hf : Martingale f ℱ μ) (n : ℕ) : martingalePart f ℱ μ n =ᵐ[μ] f n := by filter_upwards [hf.predictablePart_eq_zero n] with ω hω simp [martingalePart, hω] @@ -166,12 +168,13 @@ theorem martingalePart_eq_sum : martingalePart f ℱ μ = fun n => theorem stronglyAdapted_martingalePart (hf : StronglyAdapted ℱ f) : StronglyAdapted ℱ (martingalePart f ℱ μ) := hf.sub stronglyAdapted_predictablePart' -theorem integrable_martingalePart (hf_int : ∀ n, Integrable (f n) μ) (n : ℕ) : +theorem integrable_martingalePart [CompleteSpace E] (hf_int : ∀ n, Integrable (f n) μ) (n : ℕ) : Integrable (martingalePart f ℱ μ n) μ := by rw [martingalePart_eq_sum] fun_prop -theorem martingale_martingalePart (hf : StronglyAdapted ℱ f) (hf_int : ∀ n, Integrable (f n) μ) +theorem martingale_martingalePart [CompleteSpace E] + (hf : StronglyAdapted ℱ f) (hf_int : ∀ n, Integrable (f n) μ) [SigmaFiniteFiltration μ ℱ] : Martingale (martingalePart f ℱ μ) ℱ μ := by refine ⟨stronglyAdapted_martingalePart hf, fun i j hij => ?_⟩ -- ⊢ μ[martingalePart f ℱ μ j | ℱ i] =ᵐ[μ] martingalePart f ℱ μ i @@ -212,7 +215,7 @@ theorem martingale_martingalePart (hf : StronglyAdapted ℱ f) (hf_int : ∀ n, rfl -- The following two lemmas demonstrate the essential uniqueness of the decomposition -theorem martingalePart_add_ae_eq [SigmaFiniteFiltration μ ℱ] {f g : ℕ → Ω → E} +theorem martingalePart_add_ae_eq [CompleteSpace E] [SigmaFiniteFiltration μ ℱ] {f g : ℕ → Ω → E} (hf : Martingale f ℱ μ) (hg : StronglyAdapted ℱ fun n => g (n + 1)) (hg0 : g 0 = 0) (hgint : ∀ n, Integrable (g n) μ) (n : ℕ) : martingalePart (f + g) ℱ μ n =ᵐ[μ] f n := by set h := f - martingalePart (f + g) ℱ μ with hhdef @@ -232,7 +235,7 @@ theorem martingalePart_add_ae_eq [SigmaFiniteFiltration μ ℱ] {f g : ℕ → rw [hω, Pi.sub_apply, martingalePart] simp [hg0] -theorem predictablePart_add_ae_eq [SigmaFiniteFiltration μ ℱ] {f g : ℕ → Ω → E} +theorem predictablePart_add_ae_eq [CompleteSpace E] [SigmaFiniteFiltration μ ℱ] {f g : ℕ → Ω → E} (hf : Martingale f ℱ μ) (hg : StronglyAdapted ℱ fun n => g (n + 1)) (hg0 : g 0 = 0) (hgint : ∀ n, Integrable (g n) μ) (n : ℕ) : predictablePart (f + g) ℱ μ n =ᵐ[μ] g n := by filter_upwards [martingalePart_add_ae_eq hf hg hg0 hgint n] with ω hω From eceff3c137a585325b2a47a47a06345574202ef0 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 11 May 2026 10:19:40 +0200 Subject: [PATCH 014/129] more --- .../MeasureTheory/VectorMeasure/Integral.lean | 19 +++++++- .../VectorMeasure/Variation/Basic.lean | 48 ++++++++++++++++++- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 8a1573e87bda41..2f16bb17250963 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -78,6 +78,13 @@ vector measure. -/ noncomputable def VectorMeasure.transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : VectorMeasure X (E →L[ℝ] G) := μ.mapRange B.flip.toAddMonoidHom B.flip.continuous +lemma restrict_transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) (s : Set X) : + (μ.transpose B).restrict s = (μ.restrict s).transpose B := by + by_cases hs : MeasurableSet s + · ext t ht : 1 + simp [VectorMeasure.restrict_apply, hs, ht, transpose] + · simp [restrict_not_measurable _ hs, transpose] + /-- Given a set `s`, return the continuous linear map `fun x : E ↦ B x (μ s)` (actually defined using `transpose` through `mapRange`), where the `B` is a `G`-valued bilinear form on `E × F` and `μ` is an `F`-valued vector measure. The extension of that set function through `setToFun` gives the @@ -149,9 +156,19 @@ notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂•"μ:70 => variable {μ : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} +@[simp] lemma integrable_zero {f : X → E} : (0 : VectorMeasure X F).Integrable f B := by + simp [VectorMeasure.Integrable, transpose] + +lemma Integrable.restrict {f : X → E} (hf : μ.Integrable f B) (s : Set X) : + (μ.restrict s).Integrable f B := by + by_cases hs : MeasurableSet s + · simp only [VectorMeasure.Integrable, ← restrict_transpose, variation_restrict _ hs] + exact MeasureTheory.Integrable.restrict hf + · simp [restrict_not_measurable _ hs] + @[simp] theorem integral_zero {f : X → E} : ∫ᵛ x, f x ∂[B; (0 : VectorMeasure X F)] = 0 := by apply setToFun_zero_left' - simp [VectorMeasure.transpose] + simp [transpose] theorem integral_fun_add {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index e37a6277de2df1..2ee6b96be60892 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -41,7 +41,6 @@ section Basic variable [TopologicalSpace V] [ENormedAddCommMonoid V] [T2Space V] -@[simp] lemma variation_apply (μ : VectorMeasure X V) (s : Set X) : μ.variation s = preVariation (‖μ ·‖ₑ) (isSigmaSubadditiveSetFun_enorm μ) (by simp) s := rfl @@ -84,6 +83,32 @@ theorem enorm_measure_le_variation (μ : VectorMeasure X V) (E : Set X) : ‖μ E‖ₑ = ∑ p ∈ (Finpartition.indiscrete hE').parts, ‖μ p‖ₑ := by simp _ ≤ preVariationFun (‖μ ·‖ₑ) E := by apply preVariation.sum_le +lemma variation_apply_le_of_forall_enorm_le {μ : VectorMeasure X V} {ν : Measure X} {s : Set X} + (hs : MeasurableSet s) (hν : ∀ (t : Set X), MeasurableSet t → t ⊆ s → ‖μ t‖ₑ ≤ ν t) : + μ.variation s ≤ ν s := by + simp only [variation_apply, preVariation_apply, ennrealToMeasure_apply hs, + ennrealPreVariation_apply, preVariationFun, hs, ↓reduceDIte, iSup_le_iff] + intro P + calc ∑ t ∈ P.parts, ‖μ t‖ₑ + _ ≤ ∑ t ∈ P.parts, ν t := by + gcongr with t ht + apply hν _ t.2 (P.le ht) + _ = ν (⋃ t ∈ P.parts, t) := by + rw [measure_biUnion_finset _ (fun i hi ↦ i.2)] + intro i hi j hj hij + simpa [Function.onFun, disjoint_iff, Subtype.ext_iff] using P.disjoint hi hj hij + _ ≤ ν s := by + gcongr + simp only [Set.iUnion_subset_iff] + intro t ht + exact P.le ht + +/-- Characterization of the variation as the minimal measure larger than `‖μ ·‖`. -/ +lemma variation_le_of_forall_enorm_le {μ : VectorMeasure X V} {ν : Measure X} + (hν : ∀ (s : Set X), MeasurableSet s → ‖μ s‖ₑ ≤ ν s) : + μ.variation ≤ ν := + Measure.le_iff.2 (fun _ hs ↦ variation_apply_le_of_forall_enorm_le hs (fun t ht _ ↦ hν t ht)) + @[simp] lemma variation_zero : (0 : VectorMeasure X V).variation = 0 := by simp only [variation, coe_zero, Pi.zero_apply, enorm_zero] @@ -96,6 +121,27 @@ lemma absolutelyContinuous (μ : VectorMeasure X V) : μ ≪ᵥ μ.ennrealVariat grw [enorm_measure_le_variation, ← ennrealVariation_apply _ hsm, hs] · exact μ.not_measurable' hsm +lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) : + (μ.restrict s).variation = μ.variation.restrict s := by + apply le_antisymm + · apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) + simp only [ht, Measure.restrict_apply, VectorMeasure.restrict_apply, hs] + apply enorm_measure_le_variation + · apply Measure.le_iff.2 (fun t ht ↦ ?_) + simp only [ht, Measure.restrict_apply] + calc μ.variation (t ∩ s) + _ ≤ (μ.restrict s).variation (t ∩ s) := by + apply variation_apply_le_of_forall_enorm_le (ht.inter hs) (fun u u_meas hu ↦ ?_) + have : μ u = μ.restrict s u := by + rw [VectorMeasure.restrict_apply _ hs u_meas] + congr + grind + rw [this] + apply enorm_measure_le_variation + _ ≤ (μ.restrict s).variation t := by + gcongr + exact Set.inter_subset_left + end Basic section NormedAddCommGroup From 4128a356fd6afe7a7559682e925f63a84d0bd4fc Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 12 May 2026 15:56:31 +0200 Subject: [PATCH 015/129] fix --- .../VectorMeasure/Variation/Basic.lean | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index cb90fca75b3fde..68cfeb999f83fb 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -95,35 +95,15 @@ lemma absolutelyContinuous (μ : VectorMeasure X V) : μ ≪ᵥ μ.ennrealVariat grw [enorm_measure_le_variation, ← ennrealVariation_apply _ hsm, hs] · exact μ.not_measurable' hsm -lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) : - (μ.restrict s).variation = μ.variation.restrict s := by - apply le_antisymm - · apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) - simp only [ht, Measure.restrict_apply, VectorMeasure.restrict_apply, hs] - apply enorm_measure_le_variation - · apply Measure.le_iff.2 (fun t ht ↦ ?_) - simp only [ht, Measure.restrict_apply] - calc μ.variation (t ∩ s) - _ ≤ (μ.restrict s).variation (t ∩ s) := by - apply variation_apply_le_of_forall_enorm_le (ht.inter hs) (fun u u_meas hu ↦ ?_) - have : μ u = μ.restrict s u := by - rw [VectorMeasure.restrict_apply _ hs u_meas] - congr - grind - rw [this] - apply enorm_measure_le_variation - _ ≤ (μ.restrict s).variation t := by - gcongr - exact Set.inter_subset_left - -lemma variation_apply_le_of_forall_enorm_le {m : Measure X} {s : Set X} +lemma variation_apply_le_of_forall_enorm_le {m : Measure X} {s : Set X} (hs : MeasurableSet s) (h : ∀ E, MeasurableSet E → E ⊆ s → ‖μ E‖ₑ ≤ m E) : μ.variation s ≤ m s := by simp only [variation_apply, preVariation, ennrealToMeasure_apply hs, ennrealPreVariation_apply, preVariationFun, hs, dite_true, iSup_le_iff] intro i calc - ∑ x ∈ i.parts, ‖μ x‖ₑ ≤ ∑ x ∈ i.parts, m x := Finset.sum_le_sum (fun s hs => h s s.property) + ∑ x ∈ i.parts, ‖μ x‖ₑ ≤ ∑ x ∈ i.parts, m x := Finset.sum_le_sum + (fun s hs => h s s.property (i.le hs)) _ = m (i.parts.sup Subtype.val) := by rw [sup_set_eq_biUnion] refine (MeasureTheory.measure_biUnion_finset ?_ fun b _ => b.property).symm @@ -135,7 +115,7 @@ lemma variation_apply_le_of_forall_enorm_le {m : Measure X} {s : Set X} lemma variation_le_of_forall_enorm_le {m : Measure X} (h : ∀ E, MeasurableSet E → ‖μ E‖ₑ ≤ m E) : μ.variation ≤ m := - Measure.le_intro fun s hs _ => variation_apply_le_of_forall_enorm_le (fun E hE _ ↦ h E hE) + Measure.le_intro fun _ hs _ => variation_apply_le_of_forall_enorm_le hs (fun E hE _ ↦ h E hE) lemma variation_add_le [ContinuousAdd V] : variation (μ + ν) ≤ variation μ + variation ν := by refine variation_le_of_forall_enorm_le fun E _ => ?_ @@ -153,6 +133,27 @@ lemma variation_finsetSum_le [ContinuousAdd V] {ι} (s : Finset ι) (μ : ι → simpa [Finset.sum_insert his] using variation_add_le.trans (add_le_add_right ih ((μ i).variation)) +lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) : + (μ.restrict s).variation = μ.variation.restrict s := by + apply le_antisymm + · apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) + simp only [ht, Measure.restrict_apply, VectorMeasure.restrict_apply, hs] + apply enorm_measure_le_variation + · apply Measure.le_iff.2 (fun t ht ↦ ?_) + simp only [ht, Measure.restrict_apply] + calc μ.variation (t ∩ s) + _ ≤ (μ.restrict s).variation (t ∩ s) := by + apply variation_apply_le_of_forall_enorm_le (ht.inter hs) (fun u u_meas hu ↦ ?_) + have : μ u = μ.restrict s u := by + rw [VectorMeasure.restrict_apply _ hs u_meas] + congr + grind + rw [this] + apply enorm_measure_le_variation + _ ≤ (μ.restrict s).variation t := by + gcongr + exact Set.inter_subset_left + end Basic section NormedAddCommGroup From ed9018512b8e9c1457de68328ca459b9f3c57a37 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Wed, 13 May 2026 16:58:27 +0200 Subject: [PATCH 016/129] missing file --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index f66017b6a87260..a11ddd5fbf4bd4 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5545,6 +5545,7 @@ public import Mathlib.MeasureTheory.VectorMeasure.Integral public import Mathlib.MeasureTheory.VectorMeasure.Variation.Basic public import Mathlib.MeasureTheory.VectorMeasure.Variation.Defs public import Mathlib.MeasureTheory.VectorMeasure.WithDensity +public import Mathlib.MeasureTheory.VectorMeasure.WithDensityVec public import Mathlib.ModelTheory.Algebra.Field.Basic public import Mathlib.ModelTheory.Algebra.Field.CharP public import Mathlib.ModelTheory.Algebra.Field.IsAlgClosed From 673c086ec33e3a0d377f9cf0e3a55d61e6d4bc74 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 14 May 2026 12:22:58 +0200 Subject: [PATCH 017/129] missing lemma --- Mathlib/Analysis/Normed/Operator/Basic.lean | 14 ++++++++++- .../MeasureTheory/VectorMeasure/Integral.lean | 23 +++++++++++++------ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/Mathlib/Analysis/Normed/Operator/Basic.lean b/Mathlib/Analysis/Normed/Operator/Basic.lean index ceaa85971adf85..006646401d7636 100644 --- a/Mathlib/Analysis/Normed/Operator/Basic.lean +++ b/Mathlib/Analysis/Normed/Operator/Basic.lean @@ -39,7 +39,7 @@ suppress_compilation open Bornology Metric open Filter hiding map_smul -open scoped NNReal Topology Uniformity +open scoped NNReal Topology Uniformity ENNReal -- the `ₗ` subscript variables are for special cases about linear (as opposed to semilinear) maps variable {𝕜 𝕜₂ 𝕜₃ E F Fₗ G 𝓕 : Type*} @@ -422,6 +422,18 @@ lemma le_opNorm_enorm (x : E) : ‖f x‖ₑ ≤ ‖f‖ₑ * ‖x‖ₑ := by gcongr exact f.le_opNorm x +/-- If one controls the enorm of every `f x`, then one controls the enorm of `f`. -/ +theorem opENorm_le_bound (f : E →SL[σ₁₂] F) {M : ℝ≥0∞} (hM : ∀ x, ‖f x‖ₑ ≤ M * ‖x‖ₑ) : + ‖f‖ₑ ≤ M := by + rcases eq_top_or_lt_top M with rfl | h'M + · simp + lift M to NNReal using h'M.ne + simp only [← ofReal_norm, ENNReal.ofReal_le_coe] + apply opNorm_le_bound _ (by positivity) (fun x ↦ ?_) + specialize hM x + simp only [← ofReal_norm, ← ENNReal.ofReal_coe_nnreal] at hM + rwa [← ENNReal.ofReal_mul (by positivity), ENNReal.ofReal_le_ofReal_iff (by positivity)] at hM + variable {f} in theorem homothety_norm [NontrivialTopology E] (f : E →SL[σ₁₂] F) {a : ℝ} (hf : ∀ x, ‖f x‖ = a * ‖x‖) : ‖f‖ = a := by diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 2f16bb17250963..8150008a1f405b 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -78,13 +78,6 @@ vector measure. -/ noncomputable def VectorMeasure.transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : VectorMeasure X (E →L[ℝ] G) := μ.mapRange B.flip.toAddMonoidHom B.flip.continuous -lemma restrict_transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) (s : Set X) : - (μ.transpose B).restrict s = (μ.restrict s).transpose B := by - by_cases hs : MeasurableSet s - · ext t ht : 1 - simp [VectorMeasure.restrict_apply, hs, ht, transpose] - · simp [restrict_not_measurable _ hs, transpose] - /-- Given a set `s`, return the continuous linear map `fun x : E ↦ B x (μ s)` (actually defined using `transpose` through `mapRange`), where the `B` is a `G`-valued bilinear form on `E × F` and `μ` is an `F`-valued vector measure. The extension of that set function through `setToFun` gives the @@ -125,6 +118,22 @@ end cbmApplyMeasure namespace VectorMeasure + +lemma restrict_transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) (s : Set X) : + (μ.transpose B).restrict s = (μ.restrict s).transpose B := by + by_cases hs : MeasurableSet s + · ext t ht : 1 + simp [VectorMeasure.restrict_apply, hs, ht, transpose] + · simp [restrict_not_measurable _ hs, transpose] + +lemma variation_transpose_le (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : + (μ.transpose B).variation ≤ ‖B‖₊ • μ.variation := by + apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + simp [transpose] + apply opENorm_le_bound + +#exit + /-- `f : X → E` is said to be integrable with respect to `μ` and `B` if it is integrable with respect to `(μ.transpose B).variation`. -/ protected abbrev Integrable (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : Prop := From aa819b1f511acbf22a99c3a01c623bb1972a0139 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 14 May 2026 15:56:54 +0200 Subject: [PATCH 018/129] fix --- .../MeasureTheory/Integral/Bochner/Basic.lean | 13 +- Mathlib/MeasureTheory/Integral/SetToL1.lean | 14 + .../MeasureTheory/VectorMeasure/Integral.lean | 1110 ++++++++++++++++- 3 files changed, 1114 insertions(+), 23 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean index 98f81e081ec7af..004ee15b1ff635 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean @@ -325,17 +325,12 @@ theorem continuous_integral : Continuous fun f : α →₁[μ] G => ∫ a, f a theorem norm_integral_le_lintegral_norm (f : α → G) : ‖∫ a, f a ∂μ‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) := by - by_cases hG : CompleteSpace G - · by_cases hf : Integrable f μ - · rw [integral_eq f hf, ← Integrable.norm_toL1_eq_lintegral_norm f hf] - exact L1.norm_integral_le _ - · rw [integral_undef hf, norm_zero]; exact toReal_nonneg - · simp [integral, hG] + simp only [integral_eq_setToFun] + exact (enorm_setToFun_le_toReal _ (by simp)).trans (by simp) theorem enorm_integral_le_lintegral_enorm (f : α → G) : ‖∫ a, f a ∂μ‖ₑ ≤ ∫⁻ a, ‖f a‖ₑ ∂μ := by - simp_rw [← ofReal_norm_eq_enorm] - apply ENNReal.ofReal_le_of_le_toReal - exact norm_integral_le_lintegral_norm f + simp only [integral_eq_setToFun] + exact (enorm_setToFun_le _ (by simp)).trans (by simp) theorem dist_integral_le_lintegral_edist {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) : diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 906181d8ea336c..2f9c178bb79ed1 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -1087,6 +1087,20 @@ theorem enorm_setToFun_le (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) apply le_of_eq rw [Integrable.norm_toL1_eq_lintegral_enorm] +theorem norm_setToFun_le_toReal (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) : + ‖setToFun μ T hT f‖ ≤ NNReal.mk C hC * ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) := by + by_cases hF : CompleteSpace F; swap + · simp only [setToFun, hF, ↓reduceDIte, norm_zero, NNReal.coe_mk, ofReal_norm] + positivity + by_cases hf : Integrable f μ; swap + · simp only [setToFun_undef _ hf, norm_zero, NNReal.coe_mk, ofReal_norm] + positivity + apply (norm_setToFun_le hT hf hC).trans + gcongr + · simp + rw [Integrable.norm_toL1_eq_lintegral_enorm] + simp + /-- Lebesgue dominated convergence theorem provides sufficient conditions under which almost everywhere convergence of a sequence of functions implies the convergence of their image by `setToFun`. diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 8150008a1f405b..03f9e4dd1925e2 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -18,7 +18,7 @@ We fix a continuous linear pairing `B : E →L[ℝ] F →L[ℝ] G` and an `F`-va on a measurable space `X`. For an integrable function `f : X → E` with respect to the total variation of the vector measure on `X` informally written `μ ∘ B.flip`, we define the `G`-valued integral, which is informally -written `∫ B (f x) ∂μ x`. +written `∫ᵛ B (f x) ∂[B; μ] x`. Such integral is defined through the general setting `setToFun` which sends a set function to the integral of integrable functions, see the file @@ -118,7 +118,6 @@ end cbmApplyMeasure namespace VectorMeasure - lemma restrict_transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) (s : Set X) : (μ.transpose B).restrict s = (μ.restrict s).transpose B := by by_cases hs : MeasurableSet s @@ -129,10 +128,15 @@ lemma restrict_transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G lemma variation_transpose_le (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : (μ.transpose B).variation ≤ ‖B‖₊ • μ.variation := by apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) - simp [transpose] - apply opENorm_le_bound + apply opENorm_le_bound _ (fun x ↦ ?_) + simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe, flip_apply, + Measure.smul_apply, Measure.nnreal_smul_coe_apply] + grw [le_opNorm_enorm, le_opNorm_enorm, enorm_measure_le_variation, ← enorm_eq_nnnorm] + exact le_of_eq (by ring) -#exit +lemma absolutelyContinuous_variation_transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : + (μ.transpose B).variation ≪ μ.variation := + Measure.absolutelyContinuous_of_le_smul (variation_transpose_le μ B) /-- `f : X → E` is said to be integrable with respect to `μ` and `B` if it is integrable with respect to `(μ.transpose B).variation`. -/ @@ -163,27 +167,27 @@ multiplication by `ℝ` on `F` and `f` is real-valued. The resulting integral is notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂•"μ:70 => integral (VectorMeasure.restrict μ s) r (lsmul ℝ ℝ) -variable {μ : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} +variable {μ : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} -@[simp] lemma integrable_zero {f : X → E} : (0 : VectorMeasure X F).Integrable f B := by +@[simp] lemma integrable_zero : (0 : VectorMeasure X F).Integrable f B := by simp [VectorMeasure.Integrable, transpose] -lemma Integrable.restrict {f : X → E} (hf : μ.Integrable f B) (s : Set X) : +lemma Integrable.restrict (hf : μ.Integrable f B) (s : Set X) : (μ.restrict s).Integrable f B := by by_cases hs : MeasurableSet s · simp only [VectorMeasure.Integrable, ← restrict_transpose, variation_restrict _ hs] exact MeasureTheory.Integrable.restrict hf · simp [restrict_not_measurable _ hs] -@[simp] theorem integral_zero {f : X → E} : ∫ᵛ x, f x ∂[B; (0 : VectorMeasure X F)] = 0 := by +@[simp] theorem integral_zero_vectorMeasure : ∫ᵛ x, f x ∂[B; (0 : VectorMeasure X F)] = 0 := by apply setToFun_zero_left' simp [transpose] -theorem integral_fun_add {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem integral_fun_add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := setToFun_add (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg -theorem integral_add {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem integral_add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, (f + g) x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := integral_fun_add hf hg variable (μ B) in @@ -197,11 +201,11 @@ variable (μ B) in theorem integral_neg (f : X → E) : ∫ᵛ x, (-f) x ∂[B; μ] = -∫ᵛ x, f x ∂[B; μ] := integral_fun_neg μ B f -theorem integral_fun_sub {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem integral_fun_sub (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, f x - g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := setToFun_sub (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg -theorem integral_sub {f g : X → E} (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem integral_sub (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, (f - g) x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := integral_fun_sub hf hg variable (μ B) in @@ -215,14 +219,1092 @@ variable (μ B) in theorem integral_smul (c : ℝ) (f : X → E) : ∫ᵛ x, (c • f) x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := integral_fun_smul μ B c f -theorem integral_undef {f : X → E} (hf : ¬ μ.Integrable f B) : +theorem integral_finsetSum {ι} (s : Finset ι) {f : ι → X → E} (hf : ∀ i ∈ s, μ.Integrable (f i) B) : + ∫ᵛ a, ∑ i ∈ s, f i a ∂[B; μ] = ∑ i ∈ s, ∫ᵛ a, f i a ∂[B; μ] := + setToFun_finsetSum _ s hf + +theorem integral_undef (hf : ¬ μ.Integrable f B) : ∫ᵛ x, f x ∂[B; μ] = 0 := setToFun_undef _ hf +theorem Integrable.of_integral_ne_zero (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : μ.Integrable f B := + Not.imp_symm integral_undef h + +theorem integral_non_aestronglyMeasurable {f : X → E} + (h : ¬AEStronglyMeasurable f (μ.transpose B).variation) : + ∫ᵛ a, f a ∂[B; μ] = 0 := + integral_undef <| not_and_of_not_left _ h + +@[simp] +theorem integral_zero : ∫ᵛ _, (0 : E) ∂[B; μ] = (0 : G) := + setToFun_zero _ + +lemma integral_indicator₂ {β : Type*} (f : β → X → E) (s : Set β) (b : β) : + ∫ᵛ y, s.indicator (f · y) b ∂[B; μ] = s.indicator (fun x ↦ ∫ᵛ y, f x y ∂[B; μ]) b := by + by_cases hb : b ∈ s <;> simp [hb] + +theorem integral_congr_ae (h : f =ᵐ[(μ.transpose B).variation] g) : + ∫ᵛ a, f a ∂[B; μ] = ∫ᵛ a, g a ∂[B; μ] := + setToFun_congr_ae _ h + +theorem norm_integral_le_lintegral_norm (f : X → E) : + ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂[B; μ]) := by + by_cases hG : CompleteSpace G + · by_cases hf : Integrable f μ + · rw [integral_eq f hf, ← Integrable.norm_toL1_eq_lintegral_norm f hf] + exact L1.norm_integral_le _ + · rw [integral_undef hf, norm_zero]; exact toReal_nonneg + · simp [integral, hG] + +theorem enorm_integral_le_lintegral_enorm (f : X → E) : ‖∫ᵛ a, f a ∂[B; μ]‖ₑ ≤ ∫⁻ a, ‖f a‖ₑ ∂[B; μ] := by + simp_rw [← ofReal_norm_eq_enorm] + apply ENNReal.ofReal_le_of_le_toReal + exact norm_integral_le_lintegral_norm f + theorem enorm_integral_le (f : X → E) : ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x, ‖f x‖ₑ ∂ (μ.transpose B).variation := (enorm_setToFun_le _ (by simp)).trans (by simp) + +#exit + +theorem dist_integral_le_lintegral_edist + {f g : X → G} (hf : Integrable f μ) (hg : Integrable g μ) : + dist (∫ᵛ a, f a ∂[B; μ]) (∫ᵛ a, g a ∂[B; μ]) ≤ (∫⁻ a, edist (f a) (g a) ∂[B; μ]).toReal := by + grw [dist_eq_norm, ← integral_sub hf hg, norm_integral_le_lintegral_norm] + simp [edist_eq_enorm_sub] + +theorem edist_integral_le_lintegral_edist + {f g : X → G} (hf : Integrable f μ) (hg : Integrable g μ) : + edist (∫ᵛ a, f a ∂[B; μ]) (∫ᵛ a, g a ∂[B; μ]) ≤ ∫⁻ a, edist (f a) (g a) ∂[B; μ] := by + rw [edist_dist] + exact ENNReal.ofReal_le_of_le_toReal (dist_integral_le_lintegral_edist hf hg) + +theorem integral_eq_zero_of_ae {f : X → E} (hf : f =ᵐ[μ] 0) : ∫ᵛ a, f a ∂[B; μ] = 0 := by + simp [integral_congr_ae hf, integral_zero] + +theorem frequently_ae_ne_zero_of_integral_ne_zero {f : X → E} + (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ᶠ a in ae μ, f a ≠ 0 := + fun h' ↦ h (integral_eq_zero_of_ae (h'.mono fun _ ↦ not_not.mp)) + +theorem exists_ne_zero_of_integral_ne_zero {f : X → E} + (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ a, f a ≠ 0 := + (frequently_ae_ne_zero_of_integral_ne_zero h).exists + +/-- If `f` has finite integral, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: it tends +to zero as `μ s` tends to zero. -/ +theorem HasFiniteIntegral.tendsto_setIntegral_nhds_zero {ι} {f : X → E} + (hf : HasFiniteIntegral f μ) {l : Filter ι} {s : ι → Set X} (hs : Tendsto (μ ∘ s) l (𝓝 0)) : + Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) l (𝓝 0) := by + rw [tendsto_zero_iff_norm_tendsto_zero] + simp_rw [← coe_nnnorm, ← NNReal.coe_zero, NNReal.tendsto_coe, ← ENNReal.tendsto_coe, + ENNReal.coe_zero] + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds + (tendsto_setLIntegral_zero (ne_of_lt hf) hs) (fun i => zero_le) + fun i => enorm_integral_le_lintegral_enorm _ + +/-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: it tends +to zero as `μ s` tends to zero. -/ +theorem Integrable.tendsto_setIntegral_nhds_zero {ι} {f : X → E} (hf : Integrable f μ) + {l : Filter ι} {s : ι → Set X} (hs : Tendsto (μ ∘ s) l (𝓝 0)) : + Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) l (𝓝 0) := + hf.2.tendsto_setIntegral_nhds_zero hs + +/-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ +theorem tendsto_integral_of_L1 {ι} (f : X → E) (hfi : Integrable f μ) {F : ι → X → G} {l : Filter ι} + (hFi : ∀ᶠ i in l, Integrable (F i) μ) + (hF : Tendsto (fun i => ∫⁻ x, ‖F i x - f x‖ₑ ∂[B; μ]) l (𝓝 0)) : + Tendsto (fun i => ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := by + simp only [integral_eq_setToFun] + exact tendsto_setToFun_of_L1 (dominatedFinMeasAdditive_weightedSMul μ) f hfi hFi hF + +/-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ +lemma tendsto_integral_of_L1' {ι} (f : X → E) (hfi : Integrable f μ) {F : ι → X → G} {l : Filter ι} + (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0)) : + Tendsto (fun i ↦ ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x, f x ∂[B; μ])) := by + refine tendsto_integral_of_L1 f hfi hFi ?_ + simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF + exact hF + +/-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ +lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) (hfi : Integrable f μ) {F : ι → X → G} + {l : Filter ι} + (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂[B; μ]) l (𝓝 0)) + (s : Set X) : + Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by + refine tendsto_integral_of_L1 f hfi.restrict ?_ ?_ + · filter_upwards [hFi] with i hi using hi.restrict + · simp_rw [← eLpNorm_one_eq_lintegral_enorm] at hF ⊢ + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hF (fun _ ↦ zero_le) + (fun _ ↦ eLpNorm_mono_measure _ Measure.restrict_le_self) + +/-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ +lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) (hfi : Integrable f μ) {F : ι → X → G} + {l : Filter ι} + (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0)) + (s : Set X) : + Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by + refine tendsto_setIntegral_of_L1 f hfi hFi ?_ s + simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF + exact hF + +variable {X : Type*} [TopologicalSpace X] [FirstCountableTopology X] + +theorem continuousWithinAt_of_dominated {F : X → X → G} {x₀ : X} {bound : X → ℝ} {s : Set X} + (hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) μ) + (h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂[B; μ], ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) + (h_cont : ∀ᵐ a ∂[B; μ], ContinuousWithinAt (fun x => F x a) s x₀) : + ContinuousWithinAt (fun x => ∫ᵛ a, F x a ∂[B; μ]) s x₀ := by + simp only [integral_eq_setToFun] + exact continuousWithinAt_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) + hF_meas h_bound bound_integrable h_cont + +theorem continuousAt_of_dominated {F : X → X → G} {x₀ : X} {bound : X → ℝ} + (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) μ) + (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂[B; μ], ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) + (h_cont : ∀ᵐ a ∂[B; μ], ContinuousAt (fun x => F x a) x₀) : + ContinuousAt (fun x => ∫ᵛ a, F x a ∂[B; μ]) x₀ := by + simp only [integral_eq_setToFun] + exact continuousAt_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) + hF_meas h_bound bound_integrable h_cont + +theorem continuousOn_of_dominated {F : X → X → G} {bound : X → ℝ} {s : Set X} + (hF_meas : ∀ x ∈ s, AEStronglyMeasurable (F x) μ) + (h_bound : ∀ x ∈ s, ∀ᵐ a ∂[B; μ], ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) + (h_cont : ∀ᵐ a ∂[B; μ], ContinuousOn (fun x => F x a) s) : + ContinuousOn (fun x => ∫ᵛ a, F x a ∂[B; μ]) s := by + simp only [integral_eq_setToFun] + exact continuousOn_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) + hF_meas h_bound bound_integrable h_cont + +theorem continuous_of_dominated {F : X → X → G} {bound : X → ℝ} + (hF_meas : ∀ x, AEStronglyMeasurable (F x) μ) (h_bound : ∀ x, ∀ᵐ a ∂[B; μ], ‖F x a‖ ≤ bound a) + (bound_integrable : Integrable bound μ) (h_cont : ∀ᵐ a ∂[B; μ], Continuous fun x => F x a) : + Continuous fun x => ∫ᵛ a, F x a ∂[B; μ] := by + simp only [integral_eq_setToFun] + exact continuous_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) + hF_meas h_bound bound_integrable h_cont + +/-- The Bochner integral of a real-valued function `f : X → ℝ` is the difference between the + integral of the positive part of `f` and the integral of the negative part of `f`. -/ +theorem integral_eq_lintegral_pos_part_sub_lintegral_neg_part {f : X → ℝ} (hf : Integrable f μ) : + ∫ᵛ a, f a ∂[B; μ] = + ENNReal.toReal (∫⁻ a, .ofReal (f a) ∂[B; μ]) - ENNReal.toReal (∫⁻ a, .ofReal (-f a) ∂[B; μ]) := by + let f₁ := hf.toL1 f + -- Go to the `L¹` space + have eq₁ : ENNReal.toReal (∫⁻ a, ENNReal.ofReal (f a) ∂[B; μ]) = ‖Lp.posPart f₁‖ := by + rw [L1.norm_def] + congr 1 + apply lintegral_congr_ae + filter_upwards [Lp.coeFn_posPart f₁, hf.coeFn_toL1] with _ h₁ h₂ + rw [h₁, h₂, ENNReal.ofReal] + congr 1 + apply NNReal.eq + rw [Real.nnnorm_of_nonneg (le_max_right _ _)] + rw [Real.coe_toNNReal', NNReal.coe_mk] + -- Go to the `L¹` space + have eq₂ : ENNReal.toReal (∫⁻ a, ENNReal.ofReal (-f a) ∂[B; μ]) = ‖Lp.negPart f₁‖ := by + rw [L1.norm_def] + congr 1 + apply lintegral_congr_ae + filter_upwards [Lp.coeFn_negPart f₁, hf.coeFn_toL1] with _ h₁ h₂ + rw [h₁, h₂, ENNReal.ofReal] + congr 1 + apply NNReal.eq + simp only [Real.coe_toNNReal', coe_nnnorm, nnnorm_neg] + rw [Real.norm_of_nonpos (min_le_right _ _), ← max_neg_neg, neg_zero] + rw [eq₁, eq₂, integral, dif_pos, dif_pos] + exact L1.integral_eq_norm_posPart_sub _ + +theorem integral_eq_lintegral_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ] f) + (hfm : AEStronglyMeasurable f μ) : + ∫ᵛ a, f a ∂[B; μ] = ENNReal.toReal (∫⁻ a, ENNReal.ofReal (f a) ∂[B; μ]) := by + by_cases hfi : Integrable f μ + · rw [integral_eq_lintegral_pos_part_sub_lintegral_neg_part hfi] + have h_min : ∫⁻ a, ENNReal.ofReal (-f a) ∂[B; μ] = 0 := by + rw [lintegral_eq_zero_iff'] + · refine hf.mono ?_ + simp only [Pi.zero_apply] + intro a h + simp only [h, neg_nonpos, ofReal_eq_zero] + · exact measurable_ofReal.comp_aemeasurable hfm.aemeasurable.neg + rw [h_min, toReal_zero, _root_.sub_zero] + · rw [integral_undef hfi] + simp_rw [Integrable, hfm, hasFiniteIntegral_iff_norm, lt_top_iff_ne_top, Ne, true_and, + Classical.not_not] at hfi + have : ∫⁻ a : X, ENNReal.ofReal (f a) ∂[B; μ] = ∫⁻ a, ENNReal.ofReal ‖f a‖ ∂[B; μ] := by + refine lintegral_congr_ae (hf.mono fun a h => ?_) + dsimp only + rw [Real.norm_eq_abs, abs_of_nonneg h] + rw [this, hfi, toReal_top] + +theorem integral_norm_eq_lintegral_enorm {P : Type*} [NormedAddCommGroup P] {f : X → P} + (hf : AEStronglyMeasurable f μ) : ∫ᵛ x, ‖f x‖ ∂[B; μ] = (∫⁻ x, ‖f x‖ₑ ∂[B; μ]).toReal := by + rw [integral_eq_lintegral_of_nonneg_ae _ hf.norm] + · simp_rw [ofReal_norm_eq_enorm] + · filter_upwards; simp_rw [Pi.zero_apply, norm_nonneg, imp_true_iff] + +theorem ofReal_integral_norm_eq_lintegral_enorm {P : Type*} [NormedAddCommGroup P] {f : X → P} + (hf : Integrable f μ) : ENNReal.ofReal (∫ᵛ x, ‖f x‖ ∂[B; μ]) = ∫⁻ x, ‖f x‖ₑ ∂[B; μ] := by + rw [integral_norm_eq_lintegral_enorm hf.aestronglyMeasurable, ENNReal.ofReal_toReal] + exact lt_top_iff_ne_top.mp (hasFiniteIntegral_iff_enorm.mpr hf.2) + +theorem SimpleFunc.integral_eq_integral [CompleteSpace E] (f : X →ₛ E) (hfi : Integrable f μ) : + f.integral μ = ∫ᵛ x, f x ∂[B; μ] := by + rw [MeasureTheory.integral_eq f hfi, ← L1.SimpleFunc.toLp_one_eq_toL1, + L1.SimpleFunc.integral_L1_eq_integral, L1.SimpleFunc.integral_eq_integral] + exact SimpleFunc.integral_congr hfi (Lp.simpleFunc.toSimpleFunc_toLp _ _).symm + +theorem SimpleFunc.integral_eq_sum [CompleteSpace E] (f : X →ₛ E) (hfi : Integrable f μ) : + ∫ᵛ x, f x ∂[B; μ] = ∑ x ∈ f.range, μ.real (f ⁻¹' {x}) • x := by + rw [← f.integral_eq_integral hfi, SimpleFunc.integral, ← SimpleFunc.integral_eq]; rfl + +theorem tendsto_integral_approxOn_of_measurable [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] + {f : X → E} + {s : Set E} [SeparableSpace s] (hfi : Integrable f μ) (hfm : Measurable f) + (hs : ∀ᵐ x ∂[B; μ], f x ∈ closure s) {y₀ : E} (h₀ : y₀ ∈ s) (h₀i : Integrable (fun _ => y₀) μ) : + Tendsto (fun n => (SimpleFunc.approxOn f hfm s y₀ h₀ n).integral μ) + atTop (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := by + have hfi' := SimpleFunc.integrable_approxOn hfm hfi h₀ h₀i + simp only [SimpleFunc.integral_eq_integral _ (hfi' _), integral, L1.integral] + exact tendsto_setToFun_approxOn_of_measurable (dominatedFinMeasAdditive_weightedSMul μ) + hfi hfm hs h₀ h₀i + +theorem tendsto_integral_approxOn_of_measurable_of_range_subset + [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] + {f : X → E} (fmeas : Measurable f) (hf : Integrable f μ) (s : Set E) [SeparableSpace s] + (hs : range f ∪ {0} ⊆ s) : + Tendsto (fun n => (SimpleFunc.approxOn f fmeas s 0 (hs <| by simp) n).integral μ) atTop + (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := by + apply tendsto_integral_approxOn_of_measurable hf fmeas _ _ (integrable_zero _ _ _) + exact Eventually.of_forall fun x => subset_closure (hs (Set.mem_union_left _ (mem_range_self _))) + +-- We redeclare `E` here to temporarily avoid +-- the `[CompleteSpace E]` and `[NormedSpace ℝ E]` instances. +theorem tendsto_integral_norm_approxOn_sub + {E : Type*} [NormedAddCommGroup E] [MeasurableSpace E] [BorelSpace E] {f : X → E} + (fmeas : Measurable f) (hf : Integrable f μ) [SeparableSpace (range f ∪ {0} : Set E)] : + Tendsto (fun n ↦ ∫ᵛ x, ‖SimpleFunc.approxOn f fmeas (range f ∪ {0}) 0 (by simp) n x - f x‖ ∂[B; μ]) + atTop (𝓝 0) := by + convert (tendsto_toReal zero_ne_top).comp (tendsto_approxOn_range_L1_enorm fmeas hf) with n + rw [integral_norm_eq_lintegral_enorm] + · simp + · apply (SimpleFunc.aestronglyMeasurable _).sub + apply (stronglyMeasurable_iff_measurable_separable.2 ⟨fmeas, ?_⟩).aestronglyMeasurable + exact .mono (.of_subtype (range f ∪ {0})) subset_union_left + +theorem integral_eq_integral_pos_part_sub_integral_neg_part {f : X → ℝ} (hf : Integrable f μ) : + ∫ᵛ a, f a ∂[B; μ] = ∫ᵛ a, (Real.toNNReal (f a) : ℝ) ∂[B; μ] - ∫ᵛ a, (Real.toNNReal (-f a) : ℝ) ∂[B; μ] := by + rw [← integral_sub hf.real_toNNReal] + · simp + · exact hf.neg.real_toNNReal + +end Basic + +section Order + +variable [PartialOrder E] [IsOrderedAddMonoid E] [IsOrderedModule ℝ E] + +@[gcongr] +lemma integral_mono_measure [OrderClosedTopology E] {f : X → E} {ν : Measure X} (hle : μ ≤ ν) + (hf : 0 ≤ᵐ[ν] f) (hfi : Integrable f ν) : ∫ᵛ (a : X), f a ∂[B; μ] ≤ ∫ᵛ (a : X), f a ∂ν := by + by_cases hE : CompleteSpace E + swap; · simp [integral, hE] + borelize E + obtain ⟨g, hg, hg_nonneg, hfg⟩ := hfi.1.exists_stronglyMeasurable_range_subset + isClosed_Ici.measurableSet (Set.nonempty_Ici (a := 0)) hf + rw [integrable_congr hfg] at hfi + simp only [integral_congr_ae hfg, integral_congr_ae (ae_mono hle hfg)] + have _ := hg.separableSpace_range_union_singleton (b := 0) + have h₁ := tendsto_integral_approxOn_of_measurable_of_range_subset hg.measurable hfi _ le_rfl + have h₂ := tendsto_integral_approxOn_of_measurable_of_range_subset hg.measurable + (hfi.mono_measure hle) _ le_rfl + apply le_of_tendsto_of_tendsto' h₂ h₁ + exact fun n ↦ SimpleFunc.integral_mono_measure + (Eventually.of_forall <| SimpleFunc.approxOn_range_nonneg hg_nonneg n) hle + (SimpleFunc.integrable_approxOn_range _ hfi n) + +variable [ClosedIciTopology E] + +/-- The integral of a function which is nonnegative almost everywhere is nonnegative. -/ +lemma integral_nonneg_of_ae {f : X → E} (hf : 0 ≤ᵐ[μ] f) : + 0 ≤ ∫ᵛ x, f x ∂[B; μ] := by + by_cases hE : CompleteSpace E + · exact integral_eq_setToFun f ▸ setToFun_nonneg (dominatedFinMeasAdditive_weightedSMul μ) + (fun s _ _ => weightedSMul_nonneg s) hf + · simp [integral, hE] + +lemma integral_nonneg {f : X → E} (hf : 0 ≤ f) : + 0 ≤ ∫ᵛ x, f x ∂[B; μ] := + integral_nonneg_of_ae (ae_of_all _ hf) + +lemma integral_nonpos_of_ae {f : X → E} (hf : f ≤ᵐ[μ] 0) : + ∫ᵛ x, f x ∂[B; μ] ≤ 0 := by + rw [← neg_nonneg, ← integral_neg] + refine integral_nonneg_of_ae ?_ + filter_upwards [hf] with x hx + simpa + +lemma integral_nonpos {f : X → E} (hf : f ≤ 0) : + ∫ᵛ x, f x ∂[B; μ] ≤ 0 := + integral_nonpos_of_ae (ae_of_all _ hf) + +lemma integral_mono_ae {f g : X → E} (hf : Integrable f μ) (hg : Integrable g μ) + (h : f ≤ᵐ[μ] g) : ∫ᵛ x, f x ∂[B; μ] ≤ ∫ᵛ x, g x ∂[B; μ] := by + rw [← sub_nonneg, ← integral_sub hg hf] + refine integral_nonneg_of_ae ?_ + filter_upwards [h] with x hx + simpa + +@[gcongr, mono] +lemma integral_mono {f g : X → E} (hf : Integrable f μ) (hg : Integrable g μ) + (h : f ≤ g) : ∫ᵛ x, f x ∂[B; μ] ≤ ∫ᵛ x, g x ∂[B; μ] := + integral_mono_ae hf hg (ae_of_all _ h) + +lemma integral_mono_of_nonneg {f g : X → E} (hf : 0 ≤ᵐ[μ] f) (hgi : Integrable g μ) + (h : f ≤ᵐ[μ] g) : ∫ᵛ a, f a ∂[B; μ] ≤ ∫ᵛ a, g a ∂[B; μ] := by + by_cases hfi : Integrable f μ + · exact integral_mono_ae hfi hgi h + · exact integral_undef hfi ▸ integral_nonneg_of_ae (hf.trans h) + +lemma integral_monotoneOn_of_integrand_ae {β : Type*} [Preorder β] {f : X → β → E} + {s : Set β} (hf_mono : ∀ᵐ x ∂[B; μ], MonotoneOn (f x) s) + (hf_int : ∀ a ∈ s, Integrable (f · a) μ) : MonotoneOn (fun b => ∫ᵛ x, f x b ∂[B; μ]) s := by + intro a ha b hb hab + refine integral_mono_ae (hf_int a ha) (hf_int b hb) ?_ + filter_upwards [hf_mono] with x hx + exact hx ha hb hab + +lemma integral_antitoneOn_of_integrand_ae {β : Type*} [Preorder β] {f : X → β → E} + {s : Set β} (hf_anti : ∀ᵐ x ∂[B; μ], AntitoneOn (f x) s) + (hf_int : ∀ a ∈ s, Integrable (f · a) μ) : AntitoneOn (fun b => ∫ᵛ x, f x b ∂[B; μ]) s := by + intro a ha b hb hab + refine integral_mono_ae (hf_int b hb) (hf_int a ha) ?_ + filter_upwards [hf_anti] with x hx + exact hx ha hb hab + +lemma integral_convexOn_of_integrand_ae {β : Type*} [AddCommMonoid β] + [Module ℝ β] {f : X → β → E} {s : Set β} (hs : Convex ℝ s) + (hf_conv : ∀ᵐ x ∂[B; μ], ConvexOn ℝ s (f x)) (hf_int : ∀ a ∈ s, Integrable (f · a) μ) : + ConvexOn ℝ s (fun b => ∫ᵛ x, f x b ∂[B; μ]) := by + refine ⟨hs, ?_⟩ + intro a ha b hb p q hp hq hpq + calc ∫ᵛ x, f x (p • a + q • b) ∂[B; μ] ≤ ∫ᵛ x, p • f x a + q • f x b ∂[B; μ] := by + refine integral_mono_ae ?lhs ?rhs ?ae_le + case lhs => + refine hf_int _ ?_ + rw [convex_iff_add_mem] at hs + exact hs ha hb hp hq hpq + case rhs => fun_prop (disch := aesop) + case ae_le => + filter_upwards [hf_conv] with x hx + exact hx.2 ha hb hp hq hpq + _ = ∫ᵛ x, p • f x a ∂[B; μ] + ∫ᵛ x, q • f x b ∂[B; μ] := by + apply integral_add + all_goals fun_prop (disch := aesop) + _ = p • ∫ᵛ x, f x a ∂[B; μ] + q • ∫ᵛ x, f x b ∂[B; μ] := by simp [integral_smul] + +lemma integral_concaveOn_of_integrand_ae {β : Type*} [AddCommMonoid β] + [Module ℝ β] {f : X → β → E} {s : Set β} (hs : Convex ℝ s) + (hf_conc : ∀ᵐ x ∂[B; μ], ConcaveOn ℝ s (f x)) (hf_int : ∀ a ∈ s, Integrable (f · a) μ) : + ConcaveOn ℝ s (fun b => ∫ᵛ x, f x b ∂[B; μ]) := by + simp_rw [← neg_convexOn_iff] at hf_conc ⊢ + simpa only [Pi.neg_apply, integral_neg] using + integral_convexOn_of_integrand_ae hs hf_conc (hf_int · · |>.neg) + +end Order + +variable [hE : CompleteSpace E] + +theorem lintegral_coe_eq_integral (f : X → ℝ≥0) (hfi : Integrable (fun x => (f x : ℝ)) μ) : + ∫⁻ a, f a ∂[B; μ] = ENNReal.ofReal (∫ᵛ a, f a ∂[B; μ]) := by + simp_rw [integral_eq_lintegral_of_nonneg_ae (Eventually.of_forall fun x => (f x).coe_nonneg) + hfi.aestronglyMeasurable, ← ENNReal.coe_nnreal_eq] + rw [ENNReal.ofReal_toReal] + simpa [← lt_top_iff_ne_top, hasFiniteIntegral_iff_enorm, NNReal.enorm_eq] using + hfi.hasFiniteIntegral + +theorem ofReal_integral_eq_lintegral_ofReal {f : X → ℝ} (hfi : Integrable f μ) (f_nn : 0 ≤ᵐ[μ] f) : + ENNReal.ofReal (∫ᵛ x, f x ∂[B; μ]) = ∫⁻ x, ENNReal.ofReal (f x) ∂[B; μ] := by + have : f =ᵐ[μ] (‖f ·‖) := f_nn.mono fun _x hx ↦ (abs_of_nonneg hx).symm + simp_rw [integral_congr_ae this, ofReal_integral_norm_eq_lintegral_enorm hfi, + ← ofReal_norm_eq_enorm] + exact lintegral_congr_ae (this.symm.fun_comp ENNReal.ofReal) + +theorem integral_toReal {f : X → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : ∀ᵐ x ∂[B; μ], f x < ∞) : + ∫ᵛ a, (f a).toReal ∂[B; μ] = (∫⁻ a, f a ∂[B; μ]).toReal := by + rw [integral_eq_lintegral_of_nonneg_ae _ hfm.ennreal_toReal.aestronglyMeasurable, + lintegral_congr_ae (ofReal_toReal_ae_eq hf)] + exact Eventually.of_forall fun x => ENNReal.toReal_nonneg + +theorem lintegral_coe_le_coe_iff_integral_le {f : X → ℝ≥0} (hfi : Integrable (fun x => (f x : ℝ)) μ) + {b : ℝ≥0} : ∫⁻ a, f a ∂[B; μ] ≤ b ↔ ∫ᵛ a, (f a : ℝ) ∂[B; μ] ≤ b := by + rw [lintegral_coe_eq_integral f hfi, ENNReal.ofReal, ENNReal.coe_le_coe, + Real.toNNReal_le_iff_le_coe] + +theorem integral_coe_le_of_lintegral_coe_le {f : X → ℝ≥0} {b : ℝ≥0} (h : ∫⁻ a, f a ∂[B; μ] ≤ b) : + ∫ᵛ a, (f a : ℝ) ∂[B; μ] ≤ b := by + by_cases hf : Integrable (fun a => (f a : ℝ)) μ + · exact (lintegral_coe_le_coe_iff_integral_le hf).1 h + · rw [integral_undef hf]; exact b.2 + +theorem integral_eq_zero_iff_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ] f) (hfi : Integrable f μ) : + ∫ᵛ x, f x ∂[B; μ] = 0 ↔ f =ᵐ[μ] 0 := by + simp_rw [integral_eq_lintegral_of_nonneg_ae hf hfi.1, ENNReal.toReal_eq_zero_iff, + ← ENNReal.not_lt_top, ← hasFiniteIntegral_iff_ofReal hf, hfi.2, not_true_eq_false, or_false] + rw [lintegral_eq_zero_iff'] + · rw [← hf.ge_iff_eq', Filter.EventuallyEq, Filter.EventuallyLE] + simp only [Pi.zero_apply, ofReal_eq_zero] + · exact (ENNReal.measurable_ofReal.comp_aemeasurable hfi.1.aemeasurable) + +theorem integral_eq_zero_iff_of_nonneg {f : X → ℝ} (hf : 0 ≤ f) (hfi : Integrable f μ) : + ∫ᵛ x, f x ∂[B; μ] = 0 ↔ f =ᵐ[μ] 0 := + integral_eq_zero_iff_of_nonneg_ae (Eventually.of_forall hf) hfi + +lemma integral_eq_iff_of_ae_le {f g : X → ℝ} + (hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) : + ∫ᵛ a, f a ∂[B; μ] = ∫ᵛ a, g a ∂[B; μ] ↔ f =ᵐ[μ] g := by + refine ⟨fun h_le ↦ EventuallyEq.symm ?_, fun h ↦ integral_congr_ae h⟩ + rw [← sub_ae_eq_zero, + ← integral_eq_zero_iff_of_nonneg_ae ((sub_nonneg_ae _ _).mpr hfg) (hg.sub hf)] + simpa [Pi.sub_apply, integral_sub hg hf, sub_eq_zero, eq_comm] + +theorem integral_pos_iff_support_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ] f) (hfi : Integrable f μ) : + (0 < ∫ᵛ x, f x ∂[B; μ]) ↔ 0 < μ (Function.support f) := by + simp_rw [(integral_nonneg_of_ae hf).lt_iff_ne, pos_iff_ne_zero, Ne, @eq_comm ℝ 0, + integral_eq_zero_iff_of_nonneg_ae hf hfi, Filter.EventuallyEq, ae_iff, Pi.zero_apply, + Function.support] + +theorem integral_pos_iff_support_of_nonneg {f : X → ℝ} (hf : 0 ≤ f) (hfi : Integrable f μ) : + (0 < ∫ᵛ x, f x ∂[B; μ]) ↔ 0 < μ (Function.support f) := + integral_pos_iff_support_of_nonneg_ae (Eventually.of_forall hf) hfi + +lemma integral_exp_pos {μ : Measure X} {f : X → ℝ} [hμ : NeZero μ] + (hf : Integrable (fun x ↦ Real.exp (f x)) μ) : + 0 < ∫ᵛ x, Real.exp (f x) ∂[B; μ] := by + rw [integral_pos_iff_support_of_nonneg (fun x ↦ (Real.exp_pos _).le) hf] + suffices (Function.support fun x ↦ Real.exp (f x)) = Set.univ by simp [this, hμ.out] + ext1 x + simp only [Function.mem_support, ne_eq, (Real.exp_pos _).ne', not_false_eq_true, Set.mem_univ] + +/-- Monotone convergence theorem for real-valued functions and Bochner integrals -/ +lemma integral_tendsto_of_tendsto_of_monotone {μ : Measure X} {f : ℕ → X → ℝ} {F : X → ℝ} + (hf : ∀ n, Integrable (f n) μ) (hF : Integrable F μ) (h_mono : ∀ᵐ x ∂[B; μ], Monotone fun n ↦ f n x) + (h_tendsto : ∀ᵐ x ∂[B; μ], Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) : + Tendsto (fun n ↦ ∫ᵛ x, f n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, F x ∂[B; μ])) := by + -- switch from the Bochner to the Lebesgue integral + let f' := fun n x ↦ f n x - f 0 x + have hf'_nonneg : ∀ᵐ x ∂[B; μ], ∀ n, 0 ≤ f' n x := by + filter_upwards [h_mono] with a ha n + simp [f', ha zero_le] + have hf'_meas : ∀ n, Integrable (f' n) μ := fun n ↦ (hf n).sub (hf 0) + suffices Tendsto (fun n ↦ ∫ᵛ x, f' n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, (F - f 0) x ∂[B; μ])) by + simp_rw [f', integral_sub (hf _) (hf _), integral_sub' hF (hf 0), + tendsto_sub_const_iff] at this + exact this + have hF_ge : 0 ≤ᵐ[μ] fun x ↦ (F - f 0) x := by + filter_upwards [h_tendsto, h_mono] with x hx_tendsto hx_mono + simp only [Pi.zero_apply, Pi.sub_apply, sub_nonneg] + exact ge_of_tendsto' hx_tendsto (fun n ↦ hx_mono zero_le) + rw [ae_all_iff] at hf'_nonneg + simp_rw [integral_eq_lintegral_of_nonneg_ae (hf'_nonneg _) (hf'_meas _).1] + rw [integral_eq_lintegral_of_nonneg_ae hF_ge (hF.1.sub (hf 0).1)] + have h_cont := ENNReal.continuousAt_toReal (x := ∫⁻ a, ENNReal.ofReal ((F - f 0) a) ∂[B; μ]) ?_ + swap + · rw [← ofReal_integral_eq_lintegral_ofReal (hF.sub (hf 0)) hF_ge] + finiteness + refine h_cont.tendsto.comp ?_ + -- use the result for the Lebesgue integral + refine lintegral_tendsto_of_tendsto_of_monotone ?_ ?_ ?_ + · exact fun n ↦ ((hf n).sub (hf 0)).aemeasurable.ennreal_ofReal + · filter_upwards [h_mono] with x hx n m hnm + refine ENNReal.ofReal_le_ofReal ?_ + simp only [f', tsub_le_iff_right, sub_add_cancel] + exact hx hnm + · filter_upwards [h_tendsto] with x hx + refine (ENNReal.continuous_ofReal.tendsto _).comp ?_ + simp only [Pi.sub_apply] + exact Tendsto.sub hx tendsto_const_nhds + +/-- Monotone convergence theorem for real-valued functions and Bochner integrals -/ +lemma integral_tendsto_of_tendsto_of_antitone {μ : Measure X} {f : ℕ → X → ℝ} {F : X → ℝ} + (hf : ∀ n, Integrable (f n) μ) (hF : Integrable F μ) (h_mono : ∀ᵐ x ∂[B; μ], Antitone fun n ↦ f n x) + (h_tendsto : ∀ᵐ x ∂[B; μ], Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) : + Tendsto (fun n ↦ ∫ᵛ x, f n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, F x ∂[B; μ])) := by + suffices Tendsto (fun n ↦ ∫ᵛ x, -f n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, -F x ∂[B; μ])) by + suffices Tendsto (fun n ↦ ∫ᵛ x, - -f n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, - -F x ∂[B; μ])) by + simpa [neg_neg] using this + convert this.neg <;> rw [integral_neg] + refine integral_tendsto_of_tendsto_of_monotone (fun n ↦ (hf n).neg) hF.neg ?_ ?_ + · filter_upwards [h_mono] with x hx n m hnm using neg_le_neg_iff.mpr <| hx hnm + · filter_upwards [h_tendsto] with x hx using hx.neg + +/-- If a monotone sequence of functions has an upper bound and the sequence of integrals of these +functions tends to the integral of the upper bound, then the sequence of functions converges +almost everywhere to the upper bound. -/ +lemma tendsto_of_integral_tendsto_of_monotone {μ : Measure X} {f : ℕ → X → ℝ} {F : X → ℝ} + (hf_int : ∀ n, Integrable (f n) μ) (hF_int : Integrable F μ) + (hf_tendsto : Tendsto (fun i ↦ ∫ᵛ a, f i a ∂[B; μ]) atTop (𝓝 (∫ᵛ a, F a ∂[B; μ]))) + (hf_mono : ∀ᵐ a ∂[B; μ], Monotone (fun i ↦ f i a)) + (hf_bound : ∀ᵐ a ∂[B; μ], ∀ i, f i a ≤ F a) : + ∀ᵐ a ∂[B; μ], Tendsto (fun i ↦ f i a) atTop (𝓝 (F a)) := by + -- reduce to the `ℝ≥0∞` case + let f' : ℕ → X → ℝ≥0∞ := fun n a ↦ ENNReal.ofReal (f n a - f 0 a) + let F' : X → ℝ≥0∞ := fun a ↦ ENNReal.ofReal (F a - f 0 a) + have hf'_int_eq : ∀ i, ∫⁻ a, f' i a ∂[B; μ] = ENNReal.ofReal (∫ᵛ a, f i a ∂[B; μ] - ∫ᵛ a, f 0 a ∂[B; μ]) := by + intro i + unfold f' + rw [← ofReal_integral_eq_lintegral_ofReal, integral_sub (hf_int i) (hf_int 0)] + · exact (hf_int i).sub (hf_int 0) + · filter_upwards [hf_mono] with a h_mono + simp [h_mono zero_le] + have hF'_int_eq : ∫⁻ a, F' a ∂[B; μ] = ENNReal.ofReal (∫ᵛ a, F a ∂[B; μ] - ∫ᵛ a, f 0 a ∂[B; μ]) := by + unfold F' + rw [← ofReal_integral_eq_lintegral_ofReal, integral_sub hF_int (hf_int 0)] + · exact hF_int.sub (hf_int 0) + · filter_upwards [hf_bound] with a h_bound + simp [h_bound 0] + have h_tendsto : Tendsto (fun i ↦ ∫⁻ a, f' i a ∂[B; μ]) atTop (𝓝 (∫⁻ a, F' a ∂[B; μ])) := by + simp_rw [hf'_int_eq, hF'_int_eq] + refine (ENNReal.continuous_ofReal.tendsto _).comp ?_ + rwa [tendsto_sub_const_iff] + have h_mono : ∀ᵐ a ∂[B; μ], Monotone (fun i ↦ f' i a) := by + filter_upwards [hf_mono] with a ha_mono i j hij + refine ENNReal.ofReal_le_ofReal ?_ + simp [ha_mono hij] + have h_bound : ∀ᵐ a ∂[B; μ], ∀ i, f' i a ≤ F' a := by + filter_upwards [hf_bound] with a ha_bound i + refine ENNReal.ofReal_le_ofReal ?_ + simp only [tsub_le_iff_right, sub_add_cancel, ha_bound i] + -- use the corresponding lemma for `ℝ≥0∞` + have h := tendsto_of_lintegral_tendsto_of_monotone ?_ h_tendsto h_mono h_bound ?_ + rotate_left + · exact (hF_int.1.aemeasurable.sub (hf_int 0).1.aemeasurable).ennreal_ofReal + · exact ((lintegral_ofReal_le_lintegral_enorm _).trans_lt (hF_int.sub (hf_int 0)).2).ne + filter_upwards [h, hf_mono, hf_bound] with a ha ha_mono ha_bound + have h1 : (fun i ↦ f i a) = fun i ↦ (f' i a).toReal + f 0 a := by + unfold f' + ext i + rw [ENNReal.toReal_ofReal] + · abel + · simp [ha_mono zero_le] + have h2 : F a = (F' a).toReal + f 0 a := by + unfold F' + rw [ENNReal.toReal_ofReal] + · abel + · simp [ha_bound 0] + rw [h1, h2] + refine Filter.Tendsto.add ?_ tendsto_const_nhds + exact (ENNReal.continuousAt_toReal (by finiteness)).tendsto.comp ha + +/-- If an antitone sequence of functions has a lower bound and the sequence of integrals of these +functions tends to the integral of the lower bound, then the sequence of functions converges +almost everywhere to the lower bound. -/ +lemma tendsto_of_integral_tendsto_of_antitone {μ : Measure X} {f : ℕ → X → ℝ} {F : X → ℝ} + (hf_int : ∀ n, Integrable (f n) μ) (hF_int : Integrable F μ) + (hf_tendsto : Tendsto (fun i ↦ ∫ᵛ a, f i a ∂[B; μ]) atTop (𝓝 (∫ᵛ a, F a ∂[B; μ]))) + (hf_mono : ∀ᵐ a ∂[B; μ], Antitone (fun i ↦ f i a)) + (hf_bound : ∀ᵐ a ∂[B; μ], ∀ i, F a ≤ f i a) : + ∀ᵐ a ∂[B; μ], Tendsto (fun i ↦ f i a) atTop (𝓝 (F a)) := by + let f' : ℕ → X → ℝ := fun i a ↦ - f i a + let F' : X → ℝ := fun a ↦ - F a + suffices ∀ᵐ a ∂[B; μ], Tendsto (fun i ↦ f' i a) atTop (𝓝 (F' a)) by + filter_upwards [this] with a ha_tendsto + convert ha_tendsto.neg + · simp [f'] + · simp [F'] + refine tendsto_of_integral_tendsto_of_monotone (fun n ↦ (hf_int n).neg) hF_int.neg ?_ ?_ ?_ + · convert hf_tendsto.neg + · rw [integral_neg] + · rw [integral_neg] + · filter_upwards [hf_mono] with a ha i j hij + simp [f', ha hij] + · filter_upwards [hf_bound] with a ha i + simp [f', F', ha i] + +section NormedAddCommGroup + +variable {H : Type*} [NormedAddCommGroup H] + +theorem L1.norm_eq_integral_norm (f : X →₁[μ] H) : ‖f‖ = ∫ᵛ a, ‖f a‖ ∂[B; μ] := by + simp only [eLpNorm, eLpNorm'_eq_lintegral_enorm, ENNReal.toReal_one, ENNReal.rpow_one, + Lp.norm_def, if_false, ENNReal.one_ne_top, one_ne_zero, _root_.div_one] + rw [integral_eq_lintegral_of_nonneg_ae (Eventually.of_forall (by simp [norm_nonneg])) + (Lp.aestronglyMeasurable f).norm] + simp + +theorem L1.dist_eq_integral_dist (f g : X →₁[μ] H) : dist f g = ∫ᵛ a, dist (f a) (g a) ∂[B; μ] := by + simp only [dist_eq_norm, L1.norm_eq_integral_norm] + exact integral_congr_ae <| (Lp.coeFn_sub _ _).fun_comp norm + +theorem L1.norm_of_fun_eq_integral_norm {f : X → H} (hf : Integrable f μ) : + ‖hf.toL1 f‖ = ∫ᵛ a, ‖f a‖ ∂[B; μ] := by + rw [L1.norm_eq_integral_norm] + exact integral_congr_ae <| hf.coeFn_toL1.fun_comp _ + +theorem MemLp.eLpNorm_eq_integral_rpow_norm {f : X → H} {p : ℝ≥0∞} (hp1 : p ≠ 0) (hp2 : p ≠ ∞) + (hf : MemLp f p μ) : + eLpNorm f p μ = ENNReal.ofReal ((∫ᵛ a, ‖f a‖ ^ p.toReal ∂[B; μ]) ^ p.toReal⁻¹) := by + have A : ∫⁻ a : X, ENNReal.ofReal (‖f a‖ ^ p.toReal) ∂[B; μ] = ∫⁻ a : X, ‖f a‖ₑ ^ p.toReal ∂[B; μ] := by + simp_rw [← ofReal_rpow_of_nonneg (norm_nonneg _) toReal_nonneg, ofReal_norm_eq_enorm] + simp only [eLpNorm_eq_lintegral_rpow_enorm_toReal hp1 hp2, one_div] + rw [integral_eq_lintegral_of_nonneg_ae]; rotate_left + · exact ae_of_all _ fun x => by positivity + · exact (hf.aestronglyMeasurable.norm.aemeasurable.pow_const _).aestronglyMeasurable + rw [A, ← ofReal_rpow_of_nonneg toReal_nonneg (inv_nonneg.2 toReal_nonneg), ofReal_toReal] + exact (lintegral_rpow_enorm_lt_top_of_eLpNorm_lt_top hp1 hp2 hf.2).ne + +end NormedAddCommGroup + +theorem norm_integral_le_integral_norm (f : X → E) : ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ∫ᵛ a, ‖f a‖ ∂[B; μ] := by + have le_ae : ∀ᵐ a ∂[B; μ], 0 ≤ ‖f a‖ := Eventually.of_forall fun a => norm_nonneg _ + by_cases h : AEStronglyMeasurable f μ + · calc + ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂[B; μ]) := + norm_integral_le_lintegral_norm _ + _ = ∫ᵛ a, ‖f a‖ ∂[B; μ] := (integral_eq_lintegral_of_nonneg_ae le_ae <| h.norm).symm + · rw [integral_non_aestronglyMeasurable h, norm_zero] + exact integral_nonneg_of_ae le_ae + +lemma abs_integral_le_integral_abs {f : X → ℝ} : |∫ᵛ a, f a ∂[B; μ]| ≤ ∫ᵛ a, |f a| ∂[B; μ] := + norm_integral_le_integral_norm f + +theorem norm_integral_le_of_norm_le {f : X → E} {g : X → ℝ} (hg : Integrable g μ) + (h : ∀ᵐ x ∂[B; μ], ‖f x‖ ≤ g x) : ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ ∫ᵛ x, g x ∂[B; μ] := + calc + ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ ∫ᵛ x, ‖f x‖ ∂[B; μ] := norm_integral_le_integral_norm f + _ ≤ ∫ᵛ x, g x ∂[B; μ] := integral_mono_of_nonneg (Eventually.of_forall fun _ => norm_nonneg _) hg h + +@[simp] +theorem integral_const (c : E) : ∫ᵛ _ : X, c ∂[B; μ] = μ.real univ • c := by + by_cases hμ : IsFiniteMeasure μ + · simp only [integral_eq_setToFun] + exact setToFun_const (dominatedFinMeasAdditive_weightedSMul _) _ + by_cases hc : c = 0 + · simp [hc, integral_zero] + · simp [measureReal_def, (integrable_const_iff_isFiniteMeasure hc).not.2 hμ, + integral_undef, MeasureTheory.not_isFiniteMeasure_iff.mp hμ] + +lemma integral_eq_const [IsProbabilityMeasure μ] {f : X → E} {c : E} (hf : ∀ᵐ x ∂[B; μ], f x = c) : + ∫ᵛ x, f x ∂[B; μ] = c := by simp [integral_congr_ae hf] + +theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure μ] {f : X → E} {C : ℝ} + (h : ∀ᵐ x ∂[B; μ], ‖f x‖ ≤ C) : ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ C * μ.real univ := + calc + ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ ∫ᵛ _, C ∂[B; μ] := norm_integral_le_of_norm_le (integrable_const C) h + _ = C * μ.real univ := by rw [integral_const, smul_eq_mul, mul_comm] + +variable {ν : Measure X} + +theorem integral_add_measure {f : X → E} (hμ : Integrable f μ) (hν : Integrable f ν) : + ∫ᵛ x, f x ∂(μ + ν) = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂ν := by + by_cases hG : CompleteSpace G; swap + · simp [integral, hG] + have hfi := hμ.add_measure hν + simp_rw [integral_eq_setToFun] + have hμ_dfma : DominatedFinMeasAdditive (μ + ν) (weightedSMul μ : Set X → G →L[ℝ] G) 1 := + DominatedFinMeasAdditive.add_measure_right μ ν (dominatedFinMeasAdditive_weightedSMul μ) + zero_le_one + have hν_dfma : DominatedFinMeasAdditive (μ + ν) (weightedSMul ν : Set X → G →L[ℝ] G) 1 := + DominatedFinMeasAdditive.add_measure_left μ ν (dominatedFinMeasAdditive_weightedSMul ν) + zero_le_one + rw [← setToFun_congr_measure_of_add_right hμ_dfma + (dominatedFinMeasAdditive_weightedSMul μ) f hfi, + ← setToFun_congr_measure_of_add_left hν_dfma (dominatedFinMeasAdditive_weightedSMul ν) f hfi] + refine setToFun_add_left' _ _ _ (fun s _ hμνs => ?_) f + rw [Measure.coe_add, Pi.add_apply, add_lt_top] at hμνs + rw [weightedSMul, weightedSMul, weightedSMul, ← add_smul, + measureReal_add_apply hμνs.1.ne hμνs.2.ne] + +@[simp] +theorem integral_zero_measure {m : MeasurableSpace X} (f : X → E) : + (∫ᵛ x, f x ∂(0 : Measure X)) = 0 := by + simp only [integral_eq_setToFun] + exact setToFun_measure_zero (dominatedFinMeasAdditive_weightedSMul _) rfl + +@[simp] +theorem setIntegral_measure_zero (f : X → E) {μ : Measure X} {s : Set X} (hs : μ s = 0) : + ∫ᵛ x in s, f x ∂[B; μ] = 0 := Measure.restrict_eq_zero.mpr hs ▸ integral_zero_measure f + +lemma integral_of_isEmpty [IsEmpty X] {f : X → E} : ∫ᵛ x, f x ∂[B; μ] = 0 := + μ.eq_zero_of_isEmpty ▸ integral_zero_measure _ + +theorem integral_finsetSum_measure {ι} {m : MeasurableSpace X} {f : X → E} {μ : ι → Measure X} + {s : Finset ι} (hf : ∀ i ∈ s, Integrable f (μ i)) : + ∫ᵛ a, f a ∂(∑ i ∈ s, μ i) = ∑ i ∈ s, ∫ᵛ a, f a ∂[B; μ] i := by + induction s using Finset.cons_induction_on with + | empty => simp + | cons _ _ h ih => + rw [Finset.forall_mem_cons] at hf + rw [Finset.sum_cons, Finset.sum_cons, ← ih hf.2] + exact integral_add_measure hf.1 (integrable_finsetSum_measure.2 hf.2) + +@[deprecated (since := "2026-04-08")] +alias integral_finset_sum_measure := integral_finsetSum_measure + +theorem nndist_integral_add_measure_le_lintegral + {f : X → E} (h₁ : Integrable f μ) (h₂ : Integrable f ν) : + (nndist (∫ᵛ x, f x ∂[B; μ]) (∫ᵛ x, f x ∂(μ + ν)) : ℝ≥0∞) ≤ ∫⁻ x, ‖f x‖ₑ ∂ν := by + rw [integral_add_measure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel_left] + exact enorm_integral_le_lintegral_enorm _ + +@[simp] +theorem integral_smul_measure (f : X → E) (c : ℝ≥0∞) : + ∫ᵛ x, f x ∂c • μ = c.toReal • ∫ᵛ x, f x ∂[B; μ] := by + by_cases hG : CompleteSpace G; swap + · simp [integral, hG] + -- First we consider the “degenerate” case `c = ∞` + rcases eq_or_ne c ∞ with (rfl | hc) + · rw [ENNReal.toReal_top, zero_smul, integral_eq_setToFun, setToFun_top_smul_measure] + -- Main case: `c ≠ ∞` + simp_rw [integral_eq_setToFun, ← setToFun_smul_left] + have hdfma : DominatedFinMeasAdditive μ (weightedSMul (c • μ) : Set X → G →L[ℝ] G) c.toReal := + mul_one c.toReal ▸ (dominatedFinMeasAdditive_weightedSMul (c • μ)).of_smul_measure hc + have hdfma_smul := dominatedFinMeasAdditive_weightedSMul (F := G) (c • μ) + rw [← setToFun_congr_smul_measure c hc hdfma hdfma_smul f] + exact setToFun_congr_left' _ _ (fun s _ _ => weightedSMul_smul_measure μ c) f + +@[simp] +theorem integral_smul_nnreal_measure (f : X → E) (c : ℝ≥0) : + ∫ᵛ x, f x ∂(c • μ) = c • ∫ᵛ x, f x ∂[B; μ] := + integral_smul_measure f (c : ℝ≥0∞) + +theorem integral_map_of_stronglyMeasurable {β} [MeasurableSpace β] {φ : X → β} (hφ : Measurable φ) + {f : β → G} (hfm : StronglyMeasurable f) : ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ x, f (φ x) ∂[B; μ] := by + by_cases hG : CompleteSpace G; swap + · simp [integral, hG] + by_cases hfi : Integrable f (Measure.map φ μ); swap + · rw [integral_undef hfi, integral_undef] + exact fun hfφ => hfi ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).2 hfφ) + borelize G + have : SeparableSpace (range f ∪ {0} : Set G) := hfm.separableSpace_range_union_singleton + refine tendsto_nhds_unique + (tendsto_integral_approxOn_of_measurable_of_range_subset hfm.measurable hfi _ Subset.rfl) ?_ + convert tendsto_integral_approxOn_of_measurable_of_range_subset (hfm.measurable.comp hφ) + ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).1 hfi) (range f ∪ {0}) + (union_subset_union_left {0} (range_comp_subset_range φ f)) using 1 + ext1 i + simp only [SimpleFunc.integral_eq, hφ, SimpleFunc.measurableSet_preimage, map_measureReal_apply, + ← preimage_comp] + refine (Finset.sum_subset (SimpleFunc.range_comp_subset_range _ hφ) fun y _ hy => ?_).symm + rw [SimpleFunc.mem_range, ← Set.preimage_singleton_eq_empty, SimpleFunc.coe_comp] at hy + rw [hy] + simp + +theorem integral_map {β} [MeasurableSpace β] {φ : X → β} (hφ : AEMeasurable φ μ) {f : β → G} + (hfm : AEStronglyMeasurable f (Measure.map φ μ)) : + ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ x, f (φ x) ∂[B; μ] := + let g := hfm.mk f + calc + ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ y, g y ∂Measure.map φ μ := integral_congr_ae hfm.ae_eq_mk + _ = ∫ᵛ y, g y ∂Measure.map (hφ.mk φ) μ := by congr 1; exact Measure.map_congr hφ.ae_eq_mk + _ = ∫ᵛ x, g (hφ.mk φ x) ∂[B; μ] := + (integral_map_of_stronglyMeasurable hφ.measurable_mk hfm.stronglyMeasurable_mk) + _ = ∫ᵛ x, g (φ x) ∂[B; μ] := integral_congr_ae (hφ.ae_eq_mk.symm.fun_comp _) + _ = ∫ᵛ x, f (φ x) ∂[B; μ] := integral_congr_ae <| ae_eq_comp hφ hfm.ae_eq_mk.symm + +theorem _root_.MeasurableEmbedding.integral_map {β} {_ : MeasurableSpace β} {f : X → β} + (hf : MeasurableEmbedding f) (g : β → G) : ∫ᵛ y, g y ∂Measure.map f μ = ∫ᵛ x, g (f x) ∂[B; μ] := by + by_cases hgm : AEStronglyMeasurable g (Measure.map f μ) + · exact MeasureTheory.integral_map hf.measurable.aemeasurable hgm + · rw [integral_non_aestronglyMeasurable hgm, integral_non_aestronglyMeasurable] + exact fun hgf => hgm (hf.aestronglyMeasurable_map_iff.2 hgf) + +theorem _root_.Topology.IsClosedEmbedding.integral_map {β} [TopologicalSpace X] [BorelSpace X] + [TopologicalSpace β] [MeasurableSpace β] [BorelSpace β] {φ : X → β} (hφ : IsClosedEmbedding φ) + (f : β → G) : ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ x, f (φ x) ∂[B; μ] := + hφ.measurableEmbedding.integral_map _ + +theorem integral_map_equiv {β} [MeasurableSpace β] (e : X ≃ᵐ β) (f : β → G) : + ∫ᵛ y, f y ∂Measure.map e μ = ∫ᵛ x, f (e x) ∂[B; μ] := + e.measurableEmbedding.integral_map f + +omit hE in +lemma integral_domSMul {G A : Type*} [Group G] [AddCommGroup A] [DistribMulAction G A] + [MeasurableSpace A] [MeasurableConstSMul G A] {μ : Measure A} (g : Gᵈᵐᵃ) (f : A → E) : + ∫ᵛ x, f x ∂g • μ = ∫ᵛ x, f ((DomMulAct.mk.symm g)⁻¹ • x) ∂[B; μ] := + integral_map_equiv (MeasurableEquiv.smul ((DomMulAct.mk.symm g : G)⁻¹)) f + +theorem MeasurePreserving.integral_comp {β} {_ : MeasurableSpace β} {f : X → β} {ν} + (h₁ : MeasurePreserving f μ ν) (h₂ : MeasurableEmbedding f) (g : β → G) : + ∫ᵛ x, g (f x) ∂[B; μ] = ∫ᵛ y, g y ∂ν := + h₁.map_eq ▸ (h₂.integral_map g).symm + +theorem MeasurePreserving.integral_comp' {β} [MeasurableSpace β] {ν} {f : X ≃ᵐ β} + (h : MeasurePreserving f μ ν) (g : β → G) : + ∫ᵛ x, g (f x) ∂[B; μ] = ∫ᵛ y, g y ∂ν := MeasurePreserving.integral_comp h f.measurableEmbedding _ + +theorem integral_subtype_comap {X} [MeasurableSpace X] {μ : Measure X} {s : Set X} + (hs : MeasurableSet s) (f : X → E) : + ∫ᵛ x : s, f (x : X) ∂(Measure.comap Subtype.val μ) = ∫ᵛ x in s, f x ∂[B; μ] := by + rw [← map_comap_subtype_coe hs] + exact ((MeasurableEmbedding.subtype_coe hs).integral_map _).symm + +attribute [local instance] Measure.Subtype.measureSpace in +theorem integral_subtype {X} [MeasureSpace X] {s : Set X} (hs : MeasurableSet s) (f : X → E) : + ∫ᵛ x : s, f x = ∫ᵛ x in s, f x := integral_subtype_comap hs f + +@[simp] +theorem integral_dirac' [MeasurableSpace X] (f : X → E) (a : X) (hfm : StronglyMeasurable f) : + ∫ᵛ x, f x ∂Measure.dirac a = f a := by + borelize E + calc + ∫ᵛ x, f x ∂Measure.dirac a = ∫ᵛ _, f a ∂Measure.dirac a := + integral_congr_ae <| ae_eq_dirac' hfm.measurable + _ = f a := by simp + +@[simp] +theorem integral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] (f : X → E) (a : X) : + ∫ᵛ x, f x ∂Measure.dirac a = f a := + calc + ∫ᵛ x, f x ∂Measure.dirac a = ∫ᵛ _, f a ∂Measure.dirac a := integral_congr_ae <| ae_eq_dirac f + _ = f a := by simp + +theorem setIntegral_dirac' {mX : MeasurableSpace X} {f : X → E} (hf : StronglyMeasurable f) (a : X) + {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : + ∫ᵛ x in s, f x ∂Measure.dirac a = if a ∈ s then f a else 0 := by + rw [restrict_dirac' hs] + split_ifs + · exact integral_dirac' _ _ hf + · exact integral_zero_measure _ + +theorem setIntegral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] (f : X → E) (a : X) + (s : Set X) [Decidable (a ∈ s)] : + ∫ᵛ x in s, f x ∂Measure.dirac a = if a ∈ s then f a else 0 := by + rw [restrict_dirac] + split_ifs + · exact integral_dirac _ _ + · exact integral_zero_measure _ + +/-- **Markov's inequality** also known as **Chebyshev's first inequality**. -/ +theorem mul_meas_ge_le_integral_of_nonneg {f : X → ℝ} (hf_nonneg : 0 ≤ᵐ[μ] f) + (hf_int : Integrable f μ) (ε : ℝ) : ε * μ.real { x | ε ≤ f x } ≤ ∫ᵛ x, f x ∂[B; μ] := by + rcases eq_top_or_lt_top (μ {x | ε ≤ f x}) with hμ | hμ + · simpa [measureReal_def, hμ] using integral_nonneg_of_ae hf_nonneg + · have := Fact.mk hμ + calc + ε * μ.real { x | ε ≤ f x } = ∫ᵛ _ in {x | ε ≤ f x}, ε ∂[B; μ] := by simp [mul_comm] + _ ≤ ∫ᵛ x in {x | ε ≤ f x}, f x ∂[B; μ] := + integral_mono_ae (integrable_const _) (hf_int.mono_measure μ.restrict_le_self) <| + ae_restrict_mem₀ <| hf_int.aemeasurable.nullMeasurable measurableSet_Ici + _ ≤ _ := integral_mono_measure μ.restrict_le_self hf_nonneg hf_int + +/-- Hölder's inequality for the integral of a product of norms. The integral of the product of two +norms of functions is bounded by the product of their `ℒp` and `ℒq` seminorms when `p` and `q` are +conjugate exponents. -/ +theorem integral_mul_norm_le_Lp_mul_Lq {E} [NormedAddCommGroup E] {f g : X → E} {p q : ℝ} + (hpq : p.HolderConjugate q) (hf : MemLp f (ENNReal.ofReal p) μ) + (hg : MemLp g (ENNReal.ofReal q) μ) : + ∫ᵛ a, ‖f a‖ * ‖g a‖ ∂[B; μ] ≤ (∫ᵛ a, ‖f a‖ ^ p ∂[B; μ]) ^ (1 / p) * (∫ᵛ a, ‖g a‖ ^ q ∂[B; μ]) ^ (1 / q) := by + -- translate the Bochner integrals into Lebesgue integrals. + rw [integral_eq_lintegral_of_nonneg_ae, integral_eq_lintegral_of_nonneg_ae, + integral_eq_lintegral_of_nonneg_ae] + rotate_left + · exact Eventually.of_forall fun x ↦ by positivity + · exact (hg.1.norm.aemeasurable.pow aemeasurable_const).aestronglyMeasurable + · exact Eventually.of_forall fun x ↦ by positivity + · exact (hf.1.norm.aemeasurable.pow aemeasurable_const).aestronglyMeasurable + · exact Eventually.of_forall fun x ↦ by positivity + · exact hf.1.norm.mul hg.1.norm + rw [ENNReal.toReal_rpow, ENNReal.toReal_rpow, ← ENNReal.toReal_mul] + -- replace norms by nnnorm + have h_left : ∫⁻ a, ENNReal.ofReal (‖f a‖ * ‖g a‖) ∂[B; μ] = + ∫⁻ a, ((‖f ·‖ₑ) * (‖g ·‖ₑ)) a ∂[B; μ] := by + simp_rw [Pi.mul_apply, ← ofReal_norm_eq_enorm, ENNReal.ofReal_mul (norm_nonneg _)] + have h_right_f : ∫⁻ a, .ofReal (‖f a‖ ^ p) ∂[B; μ] = ∫⁻ a, ‖f a‖ₑ ^ p ∂[B; μ] := by + refine lintegral_congr fun x => ?_ + rw [← ofReal_norm_eq_enorm, ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) hpq.nonneg] + have h_right_g : ∫⁻ a, .ofReal (‖g a‖ ^ q) ∂[B; μ] = ∫⁻ a, ‖g a‖ₑ ^ q ∂[B; μ] := by + refine lintegral_congr fun x => ?_ + rw [← ofReal_norm_eq_enorm, ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) hpq.symm.nonneg] + rw [h_left, h_right_f, h_right_g] + -- we can now apply `ENNReal.lintegral_mul_le_Lp_mul_Lq` (up to the `toReal` application) + refine ENNReal.toReal_mono ?_ ?_ + · refine ENNReal.mul_ne_top ?_ ?_ + · convert hf.eLpNorm_ne_top + rw [eLpNorm_eq_lintegral_rpow_enorm_toReal] + · rw [ENNReal.toReal_ofReal hpq.nonneg] + · rw [Ne, ENNReal.ofReal_eq_zero, not_le] + exact hpq.pos + · finiteness + · convert hg.eLpNorm_ne_top + rw [eLpNorm_eq_lintegral_rpow_enorm_toReal] + · rw [ENNReal.toReal_ofReal hpq.symm.nonneg] + · rw [Ne, ENNReal.ofReal_eq_zero, not_le] + exact hpq.symm.pos + · finiteness + · exact ENNReal.lintegral_mul_le_Lp_mul_Lq μ hpq hf.1.nnnorm.aemeasurable.coe_nnreal_ennreal + hg.1.nnnorm.aemeasurable.coe_nnreal_ennreal + +/-- Hölder's inequality for functions `X → ℝ`. The integral of the product of two nonnegative +functions is bounded by the product of their `ℒp` and `ℒq` seminorms when `p` and `q` are conjugate +exponents. -/ +theorem integral_mul_le_Lp_mul_Lq_of_nonneg {p q : ℝ} (hpq : p.HolderConjugate q) {f g : X → ℝ} + (hf_nonneg : 0 ≤ᵐ[μ] f) (hg_nonneg : 0 ≤ᵐ[μ] g) (hf : MemLp f (ENNReal.ofReal p) μ) + (hg : MemLp g (ENNReal.ofReal q) μ) : + ∫ᵛ a, f a * g a ∂[B; μ] ≤ (∫ᵛ a, f a ^ p ∂[B; μ]) ^ (1 / p) * (∫ᵛ a, g a ^ q ∂[B; μ]) ^ (1 / q) := by + have h_left : ∫ᵛ a, f a * g a ∂[B; μ] = ∫ᵛ a, ‖f a‖ * ‖g a‖ ∂[B; μ] := by + refine integral_congr_ae ?_ + filter_upwards [hf_nonneg, hg_nonneg] with x hxf hxg + rw [Real.norm_of_nonneg hxf, Real.norm_of_nonneg hxg] + have h_right_f : ∫ᵛ a, f a ^ p ∂[B; μ] = ∫ᵛ a, ‖f a‖ ^ p ∂[B; μ] := by + refine integral_congr_ae ?_ + filter_upwards [hf_nonneg] with x hxf + rw [Real.norm_of_nonneg hxf] + have h_right_g : ∫ᵛ a, g a ^ q ∂[B; μ] = ∫ᵛ a, ‖g a‖ ^ q ∂[B; μ] := by + refine integral_congr_ae ?_ + filter_upwards [hg_nonneg] with x hxg + rw [Real.norm_of_nonneg hxg] + rw [h_left, h_right_f, h_right_g] + exact integral_mul_norm_le_Lp_mul_Lq hpq hf hg + +theorem integral_singleton' {μ : Measure X} {f : X → E} (hf : StronglyMeasurable f) (a : X) : + ∫ᵛ a in {a}, f a ∂[B; μ] = μ.real {a} • f a := by + simp only [Measure.restrict_singleton, integral_smul_measure, integral_dirac' f a hf, + measureReal_def] + +theorem integral_singleton [MeasurableSingletonClass X] {μ : Measure X} (f : X → E) (a : X) : + ∫ᵛ a in {a}, f a ∂[B; μ] = μ.real {a} • f a := by + simp only [Measure.restrict_singleton, integral_smul_measure, integral_dirac, measureReal_def] + +theorem integral_unique [Unique X] (f : X → E) : ∫ᵛ x, f x ∂[B; μ] = μ.real univ • f default := + calc + ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ _, f default ∂[B; μ] := by congr with x; congr; exact Unique.uniq _ x + _ = μ.real univ • f default := by rw [integral_const] + +theorem integral_pos_of_integrable_nonneg_nonzero [TopologicalSpace X] [Measure.IsOpenPosMeasure μ] + {f : X → ℝ} {x : X} (f_cont : Continuous f) (f_int : Integrable f μ) (f_nonneg : 0 ≤ f) + (f_x : f x ≠ 0) : 0 < ∫ᵛ x, f x ∂[B; μ] := + (integral_pos_iff_support_of_nonneg f_nonneg f_int).2 + (IsOpen.measure_pos μ f_cont.isOpen_support ⟨x, f_x⟩) + +end Properties + +section IntegralTrim + +variable {β γ : Type*} {m m0 : MeasurableSpace β} {μ : Measure β} + +/-- Simple function seen as simple function of a larger `MeasurableSpace`. -/ +def SimpleFunc.toLargerSpace (hm : m ≤ m0) (f : @SimpleFunc β m γ) : SimpleFunc β γ := + ⟨@SimpleFunc.toFun β m γ f, fun x => hm _ (@SimpleFunc.measurableSet_fiber β γ m f x), + @SimpleFunc.finite_range β γ m f⟩ + +theorem SimpleFunc.coe_toLargerSpace_eq (hm : m ≤ m0) (f : @SimpleFunc β m γ) : + ⇑(f.toLargerSpace hm) = f := rfl + +theorem integral_simpleFunc_larger_space (hm : m ≤ m0) (f : @SimpleFunc β m F) + (hf_int : Integrable f μ) : + ∫ᵛ x, f x ∂[B; μ] = ∑ x ∈ @SimpleFunc.range β F m f, μ.real (f ⁻¹' {x}) • x := by + simp_rw [← f.coe_toLargerSpace_eq hm] + rw [SimpleFunc.integral_eq_sum _ hf_int] + congr 1 + +theorem integral_trim_simpleFunc (hm : m ≤ m0) (f : @SimpleFunc β m F) (hf_int : Integrable f μ) : + ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ].trim hm := by + have hf : StronglyMeasurable[m] f := @SimpleFunc.stronglyMeasurable β F m _ f + have hf_int_m := hf_int.trim hm hf + rw [integral_simpleFunc_larger_space (le_refl m) f hf_int_m, + integral_simpleFunc_larger_space hm f hf_int] + congr with x + simp only [measureReal_def] + congr 2 + exact (trim_measurableSet_eq hm (@SimpleFunc.measurableSet_fiber β F m f x)).symm + +theorem integral_trim (hm : m ≤ m0) {f : β → G} (hf : StronglyMeasurable[m] f) : + ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ].trim hm := by + by_cases hG : CompleteSpace G; swap + · simp [integral, hG] + borelize G + by_cases hf_int : Integrable f μ + swap + · have hf_int_m : ¬Integrable f (μ.trim hm) := fun hf_int_m => + hf_int (integrable_of_integrable_trim hm hf_int_m) + rw [integral_undef hf_int, integral_undef hf_int_m] + haveI : SeparableSpace (range f ∪ {0} : Set G) := hf.separableSpace_range_union_singleton + let f_seq := @SimpleFunc.approxOn G β _ _ _ m _ hf.measurable (range f ∪ {0}) 0 (by simp) _ + have hf_seq_meas : ∀ n, StronglyMeasurable[m] (f_seq n) := fun n => + @SimpleFunc.stronglyMeasurable β G m _ (f_seq n) + have hf_seq_int : ∀ n, Integrable (f_seq n) μ := + SimpleFunc.integrable_approxOn_range (hf.mono hm).measurable hf_int + have hf_seq_int_m : ∀ n, Integrable (f_seq n) (μ.trim hm) := fun n => + (hf_seq_int n).trim hm (hf_seq_meas n) + have hf_seq_eq : ∀ n, ∫ᵛ x, f_seq n x ∂[B; μ] = ∫ᵛ x, f_seq n x ∂[B; μ].trim hm := fun n => + integral_trim_simpleFunc hm (f_seq n) (hf_seq_int n) + have h_lim_1 : atTop.Tendsto (fun n => ∫ᵛ x, f_seq n x ∂[B; μ]) (𝓝 (∫ᵛ x, f x ∂[B; μ])) := by + refine tendsto_integral_of_L1 f hf_int (Eventually.of_forall hf_seq_int) ?_ + exact SimpleFunc.tendsto_approxOn_range_L1_enorm (hf.mono hm).measurable hf_int + have h_lim_2 : atTop.Tendsto (fun n => ∫ᵛ x, f_seq n x ∂[B; μ]) (𝓝 (∫ᵛ x, f x ∂[B; μ].trim hm)) := by + simp_rw [hf_seq_eq] + refine @tendsto_integral_of_L1 β G _ _ m (μ.trim hm) _ f (hf_int.trim hm hf) _ _ + (Eventually.of_forall hf_seq_int_m) ?_ + exact @SimpleFunc.tendsto_approxOn_range_L1_enorm β G m _ _ _ f _ _ hf.measurable + (hf_int.trim hm hf) + exact tendsto_nhds_unique h_lim_1 h_lim_2 + +theorem integral_trim_ae (hm : m ≤ m0) {f : β → G} (hf : AEStronglyMeasurable[m] f (μ.trim hm)) : + ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ].trim hm := by + rw [integral_congr_ae (ae_eq_of_ae_eq_trim hf.ae_eq_mk), integral_congr_ae hf.ae_eq_mk] + exact integral_trim hm hf.stronglyMeasurable_mk + +end IntegralTrim + +section SnormBound + +variable {m0 : MeasurableSpace X} {μ : Measure X} {f : X → ℝ} + +theorem eLpNorm_one_le_of_le {r : ℝ≥0} (hfint : Integrable f μ) (hfint' : 0 ≤ ∫ᵛ x, f x ∂[B; μ]) + (hf : ∀ᵐ ω ∂[B; μ], f ω ≤ r) : eLpNorm f 1 μ ≤ 2 * μ Set.univ * r := by + by_cases hr : r = 0 + · suffices f =ᵐ[μ] 0 by + rw [eLpNorm_congr_ae this, eLpNorm_zero, hr, ENNReal.coe_zero, mul_zero] + rw [hr] at hf + norm_cast at hf + have hnegf : ∫ᵛ x, -f x ∂[B; μ] = 0 := by + rw [integral_neg, neg_eq_zero] + exact le_antisymm (integral_nonpos_of_ae hf) hfint' + have := (integral_eq_zero_iff_of_nonneg_ae ?_ hfint.neg).1 hnegf + · filter_upwards [this] with ω hω + rwa [Pi.neg_apply, Pi.zero_apply, neg_eq_zero] at hω + · filter_upwards [hf] with ω hω + rwa [Pi.zero_apply, Pi.neg_apply, Right.nonneg_neg_iff] + by_cases hμ : IsFiniteMeasure μ + swap + · have : μ Set.univ = ∞ := by + by_contra hμ' + exact hμ (IsFiniteMeasure.mk <| lt_top_iff_ne_top.2 hμ') + rw [this, ENNReal.mul_top', if_neg, ENNReal.top_mul', if_neg] + · exact le_top + · simp [hr] + · simp + haveI := hμ + rw [integral_eq_integral_pos_part_sub_integral_neg_part hfint, sub_nonneg] at hfint' + have hposbdd : ∫ᵛ ω, max (f ω) 0 ∂[B; μ] ≤ μ.real Set.univ • (r : ℝ) := by + rw [← integral_const] + refine integral_mono_ae hfint.real_toNNReal (integrable_const (r : ℝ)) ?_ + filter_upwards [hf] with ω hω using Real.toNNReal_le_iff_le_coe.2 hω + rw [MemLp.eLpNorm_eq_integral_rpow_norm one_ne_zero ENNReal.one_ne_top + (memLp_one_iff_integrable.2 hfint), + ENNReal.ofReal_le_iff_le_toReal (by finiteness)] + simp_rw [ENNReal.toReal_one, _root_.inv_one, Real.rpow_one, Real.norm_eq_abs, ← + max_zero_add_max_neg_zero_eq_abs_self, ← Real.coe_toNNReal'] + rw [integral_add hfint.real_toNNReal] + · simp only [Real.coe_toNNReal', ENNReal.toReal_mul, ENNReal.coe_toReal, + toReal_ofNat] at hfint' ⊢ + grw [hfint'] + rwa [← two_mul, mul_assoc, mul_le_mul_iff_right₀ (two_pos : (0 : ℝ) < 2)] + · exact hfint.neg.sup (integrable_zero _ _ μ) + +theorem eLpNorm_one_le_of_le' {r : ℝ} (hfint : Integrable f μ) (hfint' : 0 ≤ ∫ᵛ x, f x ∂[B; μ]) + (hf : ∀ᵐ ω ∂[B; μ], f ω ≤ r) : eLpNorm f 1 μ ≤ 2 * μ Set.univ * ENNReal.ofReal r := by + refine eLpNorm_one_le_of_le hfint hfint' ?_ + simp only [Real.coe_toNNReal', le_max_iff] + filter_upwards [hf] with ω hω using Or.inl hω + +end SnormBound + +end MeasureTheory + + end VectorMeasure end MeasureTheory From 6df452a43b0fec6fd01cc87af7c46adc8d54e4ea Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 14 May 2026 19:08:44 +0200 Subject: [PATCH 019/129] store --- .../MeasureTheory/Integral/Bochner/Basic.lean | 2 +- .../MeasureTheory/VectorMeasure/Integral.lean | 115 ++++++++---------- .../VectorMeasure/Variation/Basic.lean | 6 + 3 files changed, 61 insertions(+), 62 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean index 004ee15b1ff635..a84856b3b79cb3 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean @@ -326,7 +326,7 @@ theorem continuous_integral : Continuous fun f : α →₁[μ] G => ∫ a, f a theorem norm_integral_le_lintegral_norm (f : α → G) : ‖∫ a, f a ∂μ‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) := by simp only [integral_eq_setToFun] - exact (enorm_setToFun_le_toReal _ (by simp)).trans (by simp) + exact (norm_setToFun_le_toReal _ (by simp)).trans (by simp) theorem enorm_integral_le_lintegral_enorm (f : α → G) : ‖∫ a, f a ∂μ‖ₑ ≤ ∫⁻ a, ‖f a‖ₑ ∂μ := by simp only [integral_eq_setToFun] diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 03f9e4dd1925e2..3394a305c51bd5 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -61,7 +61,7 @@ unconditionally convergent. public section -open Set MeasureTheory VectorMeasure ContinuousLinearMap +open Set MeasureTheory VectorMeasure ContinuousLinearMap Filter Topology variable {X E F G : Type*} {mX : MeasurableSpace X} [NormedAddCommGroup E] [NormedSpace ℝ E] @@ -172,7 +172,7 @@ variable {μ : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E @[simp] lemma integrable_zero : (0 : VectorMeasure X F).Integrable f B := by simp [VectorMeasure.Integrable, transpose] -lemma Integrable.restrict (hf : μ.Integrable f B) (s : Set X) : +lemma Integrable.restrict (hf : μ.Integrable f B) {s : Set X} : (μ.restrict s).Integrable f B := by by_cases hs : MeasurableSet s · simp only [VectorMeasure.Integrable, ← restrict_transpose, variation_restrict _ hs] @@ -248,117 +248,110 @@ theorem integral_congr_ae (h : f =ᵐ[(μ.transpose B).variation] g) : setToFun_congr_ae _ h theorem norm_integral_le_lintegral_norm (f : X → E) : - ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂[B; μ]) := by - by_cases hG : CompleteSpace G - · by_cases hf : Integrable f μ - · rw [integral_eq f hf, ← Integrable.norm_toL1_eq_lintegral_norm f hf] - exact L1.norm_integral_le _ - · rw [integral_undef hf, norm_zero]; exact toReal_nonneg - · simp [integral, hG] - -theorem enorm_integral_le_lintegral_enorm (f : X → E) : ‖∫ᵛ a, f a ∂[B; μ]‖ₑ ≤ ∫⁻ a, ‖f a‖ₑ ∂[B; μ] := by - simp_rw [← ofReal_norm_eq_enorm] - apply ENNReal.ofReal_le_of_le_toReal - exact norm_integral_le_lintegral_norm f + ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation) := + (norm_setToFun_le_toReal _ (by simp)).trans (by simp) -theorem enorm_integral_le (f : X → E) : - ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x, ‖f x‖ₑ ∂ (μ.transpose B).variation := +theorem enorm_integral_le_lintegral_enorm (f : X → E) : + ‖∫ᵛ a, f a ∂[B; μ]‖ₑ ≤ ∫⁻ a, ‖f a‖ₑ ∂(μ.transpose B).variation := (enorm_setToFun_le _ (by simp)).trans (by simp) - -#exit - -theorem dist_integral_le_lintegral_edist - {f g : X → G} (hf : Integrable f μ) (hg : Integrable g μ) : - dist (∫ᵛ a, f a ∂[B; μ]) (∫ᵛ a, g a ∂[B; μ]) ≤ (∫⁻ a, edist (f a) (g a) ∂[B; μ]).toReal := by +theorem dist_integral_le_lintegral_edist (hf : μ.Integrable f B) (hg : μ.Integrable g B) : + dist (∫ᵛ a, f a ∂[B; μ]) (∫ᵛ a, g a ∂[B; μ]) ≤ + (∫⁻ a, edist (f a) (g a) ∂(μ.transpose B).variation).toReal := by grw [dist_eq_norm, ← integral_sub hf hg, norm_integral_le_lintegral_norm] simp [edist_eq_enorm_sub] -theorem edist_integral_le_lintegral_edist - {f g : X → G} (hf : Integrable f μ) (hg : Integrable g μ) : - edist (∫ᵛ a, f a ∂[B; μ]) (∫ᵛ a, g a ∂[B; μ]) ≤ ∫⁻ a, edist (f a) (g a) ∂[B; μ] := by +theorem edist_integral_le_lintegral_edist (hf : μ.Integrable f B) (hg : μ.Integrable g B) : + edist (∫ᵛ a, f a ∂[B; μ]) (∫ᵛ a, g a ∂[B; μ]) ≤ + ∫⁻ a, edist (f a) (g a) ∂(μ.transpose B).variation := by rw [edist_dist] exact ENNReal.ofReal_le_of_le_toReal (dist_integral_le_lintegral_edist hf hg) -theorem integral_eq_zero_of_ae {f : X → E} (hf : f =ᵐ[μ] 0) : ∫ᵛ a, f a ∂[B; μ] = 0 := by +theorem integral_eq_zero_of_ae {f : X → E} (hf : f =ᵐ[(μ.transpose B).variation] 0) : + ∫ᵛ a, f a ∂[B; μ] = 0 := by simp [integral_congr_ae hf, integral_zero] theorem frequently_ae_ne_zero_of_integral_ne_zero {f : X → E} - (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ᶠ a in ae μ, f a ≠ 0 := + (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ᶠ a in ae (μ.transpose B).variation, f a ≠ 0 := fun h' ↦ h (integral_eq_zero_of_ae (h'.mono fun _ ↦ not_not.mp)) theorem exists_ne_zero_of_integral_ne_zero {f : X → E} (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ a, f a ≠ 0 := (frequently_ae_ne_zero_of_integral_ne_zero h).exists -/-- If `f` has finite integral, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: it tends -to zero as `μ s` tends to zero. -/ -theorem HasFiniteIntegral.tendsto_setIntegral_nhds_zero {ι} {f : X → E} - (hf : HasFiniteIntegral f μ) {l : Filter ι} {s : ι → Set X} (hs : Tendsto (μ ∘ s) l (𝓝 0)) : +/-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: +it tends to zero as `(μ.transpose B).variation s` tends to zero. -/ +theorem Integrable.tendsto_setIntegral_nhds_zero {ι} {f : X → E} + (hf : μ.Integrable f B) {l : Filter ι} {s : ι → Set X} + (hs : Tendsto ((μ.transpose B).variation ∘ s) l (𝓝 0)) : Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) l (𝓝 0) := by rw [tendsto_zero_iff_norm_tendsto_zero] simp_rw [← coe_nnnorm, ← NNReal.coe_zero, NNReal.tendsto_coe, ← ENNReal.tendsto_coe, ENNReal.coe_zero] - exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds - (tendsto_setLIntegral_zero (ne_of_lt hf) hs) (fun i => zero_le) - fun i => enorm_integral_le_lintegral_enorm _ - -/-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: it tends -to zero as `μ s` tends to zero. -/ -theorem Integrable.tendsto_setIntegral_nhds_zero {ι} {f : X → E} (hf : Integrable f μ) - {l : Filter ι} {s : ι → Set X} (hs : Tendsto (μ ∘ s) l (𝓝 0)) : - Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) l (𝓝 0) := - hf.2.tendsto_setIntegral_nhds_zero hs + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds + (tendsto_setLIntegral_zero (ne_of_lt hf.2) hs) (fun i => zero_le) + intro i + apply (enorm_integral_le_lintegral_enorm _).trans + apply lintegral_mono' _ le_rfl + rw [← restrict_transpose] + apply variation_restrict_le /-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ -theorem tendsto_integral_of_L1 {ι} (f : X → E) (hfi : Integrable f μ) {F : ι → X → G} {l : Filter ι} - (hFi : ∀ᶠ i in l, Integrable (F i) μ) - (hF : Tendsto (fun i => ∫⁻ x, ‖F i x - f x‖ₑ ∂[B; μ]) l (𝓝 0)) : - Tendsto (fun i => ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := by - simp only [integral_eq_setToFun] - exact tendsto_setToFun_of_L1 (dominatedFinMeasAdditive_weightedSMul μ) f hfi hFi hF +theorem tendsto_integral_of_L1 {ι} (f : X → E) (hfi : μ.Integrable f B) {F : ι → X → E} + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) + (hF : Tendsto (fun i => ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) : + Tendsto (fun i => ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := + tendsto_setToFun_of_L1 _ f hfi hFi hF /-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ -lemma tendsto_integral_of_L1' {ι} (f : X → E) (hfi : Integrable f μ) {F : ι → X → G} {l : Filter ι} - (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0)) : +lemma tendsto_integral_of_L1' {ι} (f : X → E) (hfi : μ.Integrable f B) {F : ι → X → E} + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) + (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 (μ.transpose B).variation) l (𝓝 0)) : Tendsto (fun i ↦ ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x, f x ∂[B; μ])) := by refine tendsto_integral_of_L1 f hfi hFi ?_ simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF exact hF /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ -lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) (hfi : Integrable f μ) {F : ι → X → G} - {l : Filter ι} - (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂[B; μ]) l (𝓝 0)) +lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) (hfi : μ.Integrable f B) {F : ι → X → E} + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) + (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) (s : Set X) : Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by refine tendsto_integral_of_L1 f hfi.restrict ?_ ?_ · filter_upwards [hFi] with i hi using hi.restrict · simp_rw [← eLpNorm_one_eq_lintegral_enorm] at hF ⊢ - exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hF (fun _ ↦ zero_le) - (fun _ ↦ eLpNorm_mono_measure _ Measure.restrict_le_self) + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hF (fun _ ↦ zero_le) + (fun i ↦ ?_) + apply eLpNorm_mono_measure + grw [← restrict_transpose, variation_restrict_le] + apply Measure.restrict_le_self /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ -lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) (hfi : Integrable f μ) {F : ι → X → G} - {l : Filter ι} - (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0)) +lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) (hfi : μ.Integrable f B) {F : ι → X → E} + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) + (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 (μ.transpose B).variation) l (𝓝 0)) (s : Set X) : Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by refine tendsto_setIntegral_of_L1 f hfi hFi ?_ s simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF exact hF -variable {X : Type*} [TopologicalSpace X] [FirstCountableTopology X] -theorem continuousWithinAt_of_dominated {F : X → X → G} {x₀ : X} {bound : X → ℝ} {s : Set X} +variable {Y : Type*} [TopologicalSpace Y] [FirstCountableTopology Y] + +theorem continuousWithinAt_of_dominated {F : Y → Y → E} {x₀ : Y} {bound : Y → ℝ} {s : Set Y} (hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) μ) - (h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂[B; μ], ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) - (h_cont : ∀ᵐ a ∂[B; μ], ContinuousWithinAt (fun x => F x a) s x₀) : + (h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) + (bound_integrable : Integrable bound (μ.transpose B).variation) + (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousWithinAt (fun x => F x a) s x₀) : ContinuousWithinAt (fun x => ∫ᵛ a, F x a ∂[B; μ]) s x₀ := by simp only [integral_eq_setToFun] exact continuousWithinAt_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) hF_meas h_bound bound_integrable h_cont +#exit + theorem continuousAt_of_dominated {F : X → X → G} {x₀ : X} {bound : X → ℝ} (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) μ) (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂[B; μ], ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index 68cfeb999f83fb..96c0b01e3af063 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -154,6 +154,12 @@ lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSe gcongr exact Set.inter_subset_left +lemma variation_restrict_le (μ : VectorMeasure X V) (s : Set X) : + (μ.restrict s).variation ≤ μ.variation.restrict s := by + by_cases hs : MeasurableSet s + · simp [variation_restrict μ hs] + · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] + end Basic section NormedAddCommGroup From f48d1683eb53236f4fbb3572adba1908c3b2456c Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 14 May 2026 21:04:14 +0200 Subject: [PATCH 020/129] weaken assumption --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 49 ++++++++++++--------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 2f9c178bb79ed1..25f4355b229a44 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -881,28 +881,37 @@ theorem continuous_setToFun (hT : DominatedFinMeasAdditive μ T C) : /-- If `F i → f` in `L1`, then `setToFun μ T hT (F i) → setToFun μ T hT f`. -/ theorem tendsto_setToFun_of_L1 (hT : DominatedFinMeasAdditive μ T C) {ι} (f : α → E) - (hfi : Integrable f μ) {fs : ι → α → E} {l : Filter ι} (hfsi : ∀ᶠ i in l, Integrable (fs i) μ) + (hf : AEStronglyMeasurable f μ) {fs : ι → α → E} {l : Filter ι} + (hfsi : ∀ᶠ i in l, Integrable (fs i) μ) (hfs : Tendsto (fun i => ∫⁻ x, ‖fs i x - f x‖ₑ ∂μ) l (𝓝 0)) : Tendsto (fun i => setToFun μ T hT (fs i)) l (𝓝 <| setToFun μ T hT f) := by classical - let f_lp := hfi.toL1 f - let F_lp i := if hFi : Integrable (fs i) μ then hFi.toL1 (fs i) else 0 - have tendsto_L1 : Tendsto F_lp l (𝓝 f_lp) := by - rw [Lp.tendsto_Lp_iff_tendsto_eLpNorm'] - simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] - refine (tendsto_congr' ?_).mp hfs - filter_upwards [hfsi] with i hi - refine lintegral_congr_ae ?_ - filter_upwards [hi.coeFn_toL1, hfi.coeFn_toL1] with x hxi hxf - simp_rw [F_lp, dif_pos hi, hxi, f_lp, hxf] - suffices Tendsto (fun i => setToFun μ T hT (F_lp i)) l (𝓝 (setToFun μ T hT f)) by - refine (tendsto_congr' ?_).mp this - filter_upwards [hfsi] with i hi - suffices h_ae_eq : F_lp i =ᵐ[μ] fs i from setToFun_congr_ae hT h_ae_eq - simp_rw [F_lp, dif_pos hi] - exact hi.coeFn_toL1 - rw [setToFun_congr_ae hT hfi.coeFn_toL1.symm] - exact ((continuous_setToFun hT).tendsto f_lp).comp tendsto_L1 + rcases eq_or_neBot l with rfl | hl + · simp + have hfi : Integrable f μ := by + obtain ⟨i, hi, h'i⟩ : ∃ i, ∫⁻ x, ‖fs i x - f x‖ₑ ∂μ < 1 ∧ Integrable (fs i) μ := + (((tendsto_order.1 hfs).2 _ zero_lt_one).and hfsi).exists + have : Integrable (fs i - f) μ := ⟨h'i.aestronglyMeasurable.sub hf, hi.trans one_lt_top⟩ + convert h'i.sub this + abel + let f_lp := hfi.toL1 f + let F_lp i := if hFi : Integrable (fs i) μ then hFi.toL1 (fs i) else 0 + have tendsto_L1 : Tendsto F_lp l (𝓝 f_lp) := by + rw [Lp.tendsto_Lp_iff_tendsto_eLpNorm'] + simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] + refine (tendsto_congr' ?_).mp hfs + filter_upwards [hfsi] with i hi + refine lintegral_congr_ae ?_ + filter_upwards [hi.coeFn_toL1, hfi.coeFn_toL1] with x hxi hxf + simp_rw [F_lp, dif_pos hi, hxi, f_lp, hxf] + suffices Tendsto (fun i => setToFun μ T hT (F_lp i)) l (𝓝 (setToFun μ T hT f)) by + refine (tendsto_congr' ?_).mp this + filter_upwards [hfsi] with i hi + suffices h_ae_eq : F_lp i =ᵐ[μ] fs i from setToFun_congr_ae hT h_ae_eq + simp_rw [F_lp, dif_pos hi] + exact hi.coeFn_toL1 + rw [setToFun_congr_ae hT hfi.coeFn_toL1.symm] + exact ((continuous_setToFun hT).tendsto f_lp).comp tendsto_L1 theorem tendsto_setToFun_approxOn_of_measurable (hT : DominatedFinMeasAdditive μ T C) [MeasurableSpace E] [BorelSpace E] {f : α → E} {s : Set E} [SeparableSpace s] @@ -910,7 +919,7 @@ theorem tendsto_setToFun_approxOn_of_measurable (hT : DominatedFinMeasAdditive (h₀ : y₀ ∈ s) (h₀i : Integrable (fun _ => y₀) μ) : Tendsto (fun n => setToFun μ T hT (SimpleFunc.approxOn f hfm s y₀ h₀ n)) atTop (𝓝 <| setToFun μ T hT f) := - tendsto_setToFun_of_L1 hT _ hfi + tendsto_setToFun_of_L1 hT _ hfi.aestronglyMeasurable (Eventually.of_forall (SimpleFunc.integrable_approxOn hfm hfi h₀ h₀i)) (SimpleFunc.tendsto_approxOn_L1_enorm hfm _ hs (hfi.sub h₀i).2) From 00d29790114dd9391b0449492223ae07af77c39b Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 14 May 2026 22:26:23 +0200 Subject: [PATCH 021/129] progress --- .../MeasureTheory/Integral/Bochner/Basic.lean | 22 +- .../MeasureTheory/VectorMeasure/Integral.lean | 639 +++--------------- 2 files changed, 91 insertions(+), 570 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean index a84856b3b79cb3..b67f5b4fe43688 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean @@ -375,23 +375,24 @@ theorem Integrable.tendsto_setIntegral_nhds_zero {ι} {f : α → G} (hf : Integ hf.2.tendsto_setIntegral_nhds_zero hs /-- If `F i → f` in `L1`, then `∫ x, F i x ∂μ → ∫ x, f x ∂μ`. -/ -theorem tendsto_integral_of_L1 {ι} (f : α → G) (hfi : Integrable f μ) {F : ι → α → G} {l : Filter ι} - (hFi : ∀ᶠ i in l, Integrable (F i) μ) +theorem tendsto_integral_of_L1 {ι} (f : α → G) (hfi : AEStronglyMeasurable f μ) + {F : ι → α → G} {l : Filter ι} (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i => ∫⁻ x, ‖F i x - f x‖ₑ ∂μ) l (𝓝 0)) : Tendsto (fun i => ∫ x, F i x ∂μ) l (𝓝 <| ∫ x, f x ∂μ) := by simp only [integral_eq_setToFun] exact tendsto_setToFun_of_L1 (dominatedFinMeasAdditive_weightedSMul μ) f hfi hFi hF /-- If `F i → f` in `L1`, then `∫ x, F i x ∂μ → ∫ x, f x ∂μ`. -/ -lemma tendsto_integral_of_L1' {ι} (f : α → G) (hfi : Integrable f μ) {F : ι → α → G} {l : Filter ι} - (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0)) : +lemma tendsto_integral_of_L1' {ι} (f : α → G) (hfi : AEStronglyMeasurable f μ) + {F : ι → α → G} {l : Filter ι} (hFi : ∀ᶠ i in l, Integrable (F i) μ) + (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0)) : Tendsto (fun i ↦ ∫ x, F i x ∂μ) l (𝓝 (∫ x, f x ∂μ)) := by refine tendsto_integral_of_L1 f hfi hFi ?_ simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF exact hF /-- If `F i → f` in `L1`, then `∫ x in s, F i x ∂μ → ∫ x in s, f x ∂μ`. -/ -lemma tendsto_setIntegral_of_L1 {ι} (f : α → G) (hfi : Integrable f μ) {F : ι → α → G} +lemma tendsto_setIntegral_of_L1 {ι} (f : α → G) (hfi : AEStronglyMeasurable f μ) {F : ι → α → G} {l : Filter ι} (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂μ) l (𝓝 0)) (s : Set α) : @@ -403,10 +404,9 @@ lemma tendsto_setIntegral_of_L1 {ι} (f : α → G) (hfi : Integrable f μ) {F : (fun _ ↦ eLpNorm_mono_measure _ Measure.restrict_le_self) /-- If `F i → f` in `L1`, then `∫ x in s, F i x ∂μ → ∫ x in s, f x ∂μ`. -/ -lemma tendsto_setIntegral_of_L1' {ι} (f : α → G) (hfi : Integrable f μ) {F : ι → α → G} - {l : Filter ι} - (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0)) - (s : Set α) : +lemma tendsto_setIntegral_of_L1' {ι} (f : α → G) (hfi : AEStronglyMeasurable f μ) {F : ι → α → G} + {l : Filter ι} (hFi : ∀ᶠ i in l, Integrable (F i) μ) + (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0)) (s : Set α) : Tendsto (fun i ↦ ∫ x in s, F i x ∂μ) l (𝓝 (∫ x in s, f x ∂μ)) := by refine tendsto_setIntegral_of_L1 f hfi hFi ?_ s simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF @@ -1295,11 +1295,11 @@ theorem integral_trim (hm : m ≤ m0) {f : β → G} (hf : StronglyMeasurable[m] have hf_seq_eq : ∀ n, ∫ x, f_seq n x ∂μ = ∫ x, f_seq n x ∂μ.trim hm := fun n => integral_trim_simpleFunc hm (f_seq n) (hf_seq_int n) have h_lim_1 : atTop.Tendsto (fun n => ∫ x, f_seq n x ∂μ) (𝓝 (∫ x, f x ∂μ)) := by - refine tendsto_integral_of_L1 f hf_int (Eventually.of_forall hf_seq_int) ?_ + refine tendsto_integral_of_L1 f hf_int.1 (Eventually.of_forall hf_seq_int) ?_ exact SimpleFunc.tendsto_approxOn_range_L1_enorm (hf.mono hm).measurable hf_int have h_lim_2 : atTop.Tendsto (fun n => ∫ x, f_seq n x ∂μ) (𝓝 (∫ x, f x ∂μ.trim hm)) := by simp_rw [hf_seq_eq] - refine @tendsto_integral_of_L1 β G _ _ m (μ.trim hm) _ f (hf_int.trim hm hf) _ _ + refine @tendsto_integral_of_L1 β G _ _ m (μ.trim hm) _ f (hf_int.trim hm hf).1 _ _ (Eventually.of_forall hf_seq_int_m) ?_ exact @SimpleFunc.tendsto_approxOn_range_L1_enorm β G m _ _ _ f _ _ hf.measurable (hf_int.trim hm hf) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 3394a305c51bd5..a2a77c1cf9ab54 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -138,6 +138,10 @@ lemma absolutelyContinuous_variation_transpose (μ : VectorMeasure X F) (B : E (μ.transpose B).variation ≪ μ.variation := Measure.absolutelyContinuous_of_le_smul (variation_transpose_le μ B) +instance (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) [IsFiniteMeasure μ.variation] : + IsFiniteMeasure (μ.transpose B).variation := + isFiniteMeasure_of_le _ (variation_transpose_le μ B) + /-- `f : X → E` is said to be integrable with respect to `μ` and `B` if it is integrable with respect to `(μ.transpose B).variation`. -/ protected abbrev Integrable (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : Prop := @@ -169,7 +173,7 @@ notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂•"μ:70 => variable {μ : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} -@[simp] lemma integrable_zero : (0 : VectorMeasure X F).Integrable f B := by +@[simp] lemma integrable_zero_vectorMeasure : (0 : VectorMeasure X F).Integrable f B := by simp [VectorMeasure.Integrable, transpose] lemma Integrable.restrict (hf : μ.Integrable f B) {s : Set X} : @@ -267,21 +271,21 @@ theorem edist_integral_le_lintegral_edist (hf : μ.Integrable f B) (hg : μ.Inte rw [edist_dist] exact ENNReal.ofReal_le_of_le_toReal (dist_integral_le_lintegral_edist hf hg) -theorem integral_eq_zero_of_ae {f : X → E} (hf : f =ᵐ[(μ.transpose B).variation] 0) : +theorem integral_eq_zero_of_ae (hf : f =ᵐ[(μ.transpose B).variation] 0) : ∫ᵛ a, f a ∂[B; μ] = 0 := by simp [integral_congr_ae hf, integral_zero] -theorem frequently_ae_ne_zero_of_integral_ne_zero {f : X → E} +theorem frequently_ae_ne_zero_of_integral_ne_zero (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ᶠ a in ae (μ.transpose B).variation, f a ≠ 0 := fun h' ↦ h (integral_eq_zero_of_ae (h'.mono fun _ ↦ not_not.mp)) -theorem exists_ne_zero_of_integral_ne_zero {f : X → E} +theorem exists_ne_zero_of_integral_ne_zero (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ a, f a ≠ 0 := (frequently_ae_ne_zero_of_integral_ne_zero h).exists /-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: it tends to zero as `(μ.transpose B).variation s` tends to zero. -/ -theorem Integrable.tendsto_setIntegral_nhds_zero {ι} {f : X → E} +theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} (hf : μ.Integrable f B) {l : Filter ι} {s : ι → Set X} (hs : Tendsto ((μ.transpose B).variation ∘ s) l (𝓝 0)) : Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) l (𝓝 0) := by @@ -297,14 +301,16 @@ theorem Integrable.tendsto_setIntegral_nhds_zero {ι} {f : X → E} apply variation_restrict_le /-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ -theorem tendsto_integral_of_L1 {ι} (f : X → E) (hfi : μ.Integrable f B) {F : ι → X → E} +theorem tendsto_integral_of_L1 {ι} (f : X → E) + (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) (hF : Tendsto (fun i => ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) : Tendsto (fun i => ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := tendsto_setToFun_of_L1 _ f hfi hFi hF /-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ -lemma tendsto_integral_of_L1' {ι} (f : X → E) (hfi : μ.Integrable f B) {F : ι → X → E} +lemma tendsto_integral_of_L1' {ι} (f : X → E) + (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 (μ.transpose B).variation) l (𝓝 0)) : Tendsto (fun i ↦ ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x, f x ∂[B; μ])) := by @@ -313,12 +319,15 @@ lemma tendsto_integral_of_L1' {ι} (f : X → E) (hfi : μ.Integrable f B) {F : exact hF /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ -lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) (hfi : μ.Integrable f B) {F : ι → X → E} +lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) + (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) (s : Set X) : Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by - refine tendsto_integral_of_L1 f hfi.restrict ?_ ?_ + refine tendsto_integral_of_L1 f ?_ ?_ ?_ + · apply hfi.mono_measure + grw [← restrict_transpose, variation_restrict_le, Measure.restrict_le_self] · filter_upwards [hFi] with i hi using hi.restrict · simp_rw [← eLpNorm_one_eq_lintegral_enorm] at hF ⊢ apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hF (fun _ ↦ zero_le) @@ -328,7 +337,8 @@ lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) (hfi : μ.Integrable f B) {F apply Measure.restrict_le_self /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ -lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) (hfi : μ.Integrable f B) {F : ι → X → E} +lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) + (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 (μ.transpose B).variation) l (𝓝 0)) (s : Set X) : @@ -337,570 +347,79 @@ lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) (hfi : μ.Integrable f B) {F simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF exact hF - variable {Y : Type*} [TopologicalSpace Y] [FirstCountableTopology Y] -theorem continuousWithinAt_of_dominated {F : Y → Y → E} {x₀ : Y} {bound : Y → ℝ} {s : Set Y} - (hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) μ) +theorem continuousWithinAt_of_dominated {F : Y → X → E} {x₀ : Y} {bound : X → ℝ} {s : Set Y} + (hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) (μ.transpose B).variation) (h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound (μ.transpose B).variation) (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousWithinAt (fun x => F x a) s x₀) : - ContinuousWithinAt (fun x => ∫ᵛ a, F x a ∂[B; μ]) s x₀ := by - simp only [integral_eq_setToFun] - exact continuousWithinAt_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) - hF_meas h_bound bound_integrable h_cont + ContinuousWithinAt (fun x => ∫ᵛ a, F x a ∂[B; μ]) s x₀ := + continuousWithinAt_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont -#exit - -theorem continuousAt_of_dominated {F : X → X → G} {x₀ : X} {bound : X → ℝ} - (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) μ) - (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂[B; μ], ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) - (h_cont : ∀ᵐ a ∂[B; μ], ContinuousAt (fun x => F x a) x₀) : - ContinuousAt (fun x => ∫ᵛ a, F x a ∂[B; μ]) x₀ := by - simp only [integral_eq_setToFun] - exact continuousAt_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) - hF_meas h_bound bound_integrable h_cont - -theorem continuousOn_of_dominated {F : X → X → G} {bound : X → ℝ} {s : Set X} - (hF_meas : ∀ x ∈ s, AEStronglyMeasurable (F x) μ) - (h_bound : ∀ x ∈ s, ∀ᵐ a ∂[B; μ], ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ) - (h_cont : ∀ᵐ a ∂[B; μ], ContinuousOn (fun x => F x a) s) : - ContinuousOn (fun x => ∫ᵛ a, F x a ∂[B; μ]) s := by - simp only [integral_eq_setToFun] - exact continuousOn_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) - hF_meas h_bound bound_integrable h_cont +theorem continuousAt_of_dominated {F : Y → X → E} {x₀ : Y} {bound : X → ℝ} + (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) (μ.transpose B).variation) + (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) + (bound_integrable : Integrable bound (μ.transpose B).variation) + (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousAt (fun x => F x a) x₀) : + ContinuousAt (fun x => ∫ᵛ a, F x a ∂[B; μ]) x₀ := + continuousAt_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont -theorem continuous_of_dominated {F : X → X → G} {bound : X → ℝ} - (hF_meas : ∀ x, AEStronglyMeasurable (F x) μ) (h_bound : ∀ x, ∀ᵐ a ∂[B; μ], ‖F x a‖ ≤ bound a) - (bound_integrable : Integrable bound μ) (h_cont : ∀ᵐ a ∂[B; μ], Continuous fun x => F x a) : - Continuous fun x => ∫ᵛ a, F x a ∂[B; μ] := by - simp only [integral_eq_setToFun] - exact continuous_setToFun_of_dominated (dominatedFinMeasAdditive_weightedSMul μ) - hF_meas h_bound bound_integrable h_cont - -/-- The Bochner integral of a real-valued function `f : X → ℝ` is the difference between the - integral of the positive part of `f` and the integral of the negative part of `f`. -/ -theorem integral_eq_lintegral_pos_part_sub_lintegral_neg_part {f : X → ℝ} (hf : Integrable f μ) : - ∫ᵛ a, f a ∂[B; μ] = - ENNReal.toReal (∫⁻ a, .ofReal (f a) ∂[B; μ]) - ENNReal.toReal (∫⁻ a, .ofReal (-f a) ∂[B; μ]) := by - let f₁ := hf.toL1 f - -- Go to the `L¹` space - have eq₁ : ENNReal.toReal (∫⁻ a, ENNReal.ofReal (f a) ∂[B; μ]) = ‖Lp.posPart f₁‖ := by - rw [L1.norm_def] - congr 1 - apply lintegral_congr_ae - filter_upwards [Lp.coeFn_posPart f₁, hf.coeFn_toL1] with _ h₁ h₂ - rw [h₁, h₂, ENNReal.ofReal] - congr 1 - apply NNReal.eq - rw [Real.nnnorm_of_nonneg (le_max_right _ _)] - rw [Real.coe_toNNReal', NNReal.coe_mk] - -- Go to the `L¹` space - have eq₂ : ENNReal.toReal (∫⁻ a, ENNReal.ofReal (-f a) ∂[B; μ]) = ‖Lp.negPart f₁‖ := by - rw [L1.norm_def] - congr 1 - apply lintegral_congr_ae - filter_upwards [Lp.coeFn_negPart f₁, hf.coeFn_toL1] with _ h₁ h₂ - rw [h₁, h₂, ENNReal.ofReal] - congr 1 - apply NNReal.eq - simp only [Real.coe_toNNReal', coe_nnnorm, nnnorm_neg] - rw [Real.norm_of_nonpos (min_le_right _ _), ← max_neg_neg, neg_zero] - rw [eq₁, eq₂, integral, dif_pos, dif_pos] - exact L1.integral_eq_norm_posPart_sub _ - -theorem integral_eq_lintegral_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ] f) - (hfm : AEStronglyMeasurable f μ) : - ∫ᵛ a, f a ∂[B; μ] = ENNReal.toReal (∫⁻ a, ENNReal.ofReal (f a) ∂[B; μ]) := by - by_cases hfi : Integrable f μ - · rw [integral_eq_lintegral_pos_part_sub_lintegral_neg_part hfi] - have h_min : ∫⁻ a, ENNReal.ofReal (-f a) ∂[B; μ] = 0 := by - rw [lintegral_eq_zero_iff'] - · refine hf.mono ?_ - simp only [Pi.zero_apply] - intro a h - simp only [h, neg_nonpos, ofReal_eq_zero] - · exact measurable_ofReal.comp_aemeasurable hfm.aemeasurable.neg - rw [h_min, toReal_zero, _root_.sub_zero] - · rw [integral_undef hfi] - simp_rw [Integrable, hfm, hasFiniteIntegral_iff_norm, lt_top_iff_ne_top, Ne, true_and, - Classical.not_not] at hfi - have : ∫⁻ a : X, ENNReal.ofReal (f a) ∂[B; μ] = ∫⁻ a, ENNReal.ofReal ‖f a‖ ∂[B; μ] := by - refine lintegral_congr_ae (hf.mono fun a h => ?_) - dsimp only - rw [Real.norm_eq_abs, abs_of_nonneg h] - rw [this, hfi, toReal_top] - -theorem integral_norm_eq_lintegral_enorm {P : Type*} [NormedAddCommGroup P] {f : X → P} - (hf : AEStronglyMeasurable f μ) : ∫ᵛ x, ‖f x‖ ∂[B; μ] = (∫⁻ x, ‖f x‖ₑ ∂[B; μ]).toReal := by - rw [integral_eq_lintegral_of_nonneg_ae _ hf.norm] - · simp_rw [ofReal_norm_eq_enorm] - · filter_upwards; simp_rw [Pi.zero_apply, norm_nonneg, imp_true_iff] - -theorem ofReal_integral_norm_eq_lintegral_enorm {P : Type*} [NormedAddCommGroup P] {f : X → P} - (hf : Integrable f μ) : ENNReal.ofReal (∫ᵛ x, ‖f x‖ ∂[B; μ]) = ∫⁻ x, ‖f x‖ₑ ∂[B; μ] := by - rw [integral_norm_eq_lintegral_enorm hf.aestronglyMeasurable, ENNReal.ofReal_toReal] - exact lt_top_iff_ne_top.mp (hasFiniteIntegral_iff_enorm.mpr hf.2) - -theorem SimpleFunc.integral_eq_integral [CompleteSpace E] (f : X →ₛ E) (hfi : Integrable f μ) : - f.integral μ = ∫ᵛ x, f x ∂[B; μ] := by - rw [MeasureTheory.integral_eq f hfi, ← L1.SimpleFunc.toLp_one_eq_toL1, - L1.SimpleFunc.integral_L1_eq_integral, L1.SimpleFunc.integral_eq_integral] - exact SimpleFunc.integral_congr hfi (Lp.simpleFunc.toSimpleFunc_toLp _ _).symm - -theorem SimpleFunc.integral_eq_sum [CompleteSpace E] (f : X →ₛ E) (hfi : Integrable f μ) : - ∫ᵛ x, f x ∂[B; μ] = ∑ x ∈ f.range, μ.real (f ⁻¹' {x}) • x := by - rw [← f.integral_eq_integral hfi, SimpleFunc.integral, ← SimpleFunc.integral_eq]; rfl - -theorem tendsto_integral_approxOn_of_measurable [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] - {f : X → E} - {s : Set E} [SeparableSpace s] (hfi : Integrable f μ) (hfm : Measurable f) - (hs : ∀ᵐ x ∂[B; μ], f x ∈ closure s) {y₀ : E} (h₀ : y₀ ∈ s) (h₀i : Integrable (fun _ => y₀) μ) : - Tendsto (fun n => (SimpleFunc.approxOn f hfm s y₀ h₀ n).integral μ) - atTop (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := by - have hfi' := SimpleFunc.integrable_approxOn hfm hfi h₀ h₀i - simp only [SimpleFunc.integral_eq_integral _ (hfi' _), integral, L1.integral] - exact tendsto_setToFun_approxOn_of_measurable (dominatedFinMeasAdditive_weightedSMul μ) - hfi hfm hs h₀ h₀i - -theorem tendsto_integral_approxOn_of_measurable_of_range_subset - [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] - {f : X → E} (fmeas : Measurable f) (hf : Integrable f μ) (s : Set E) [SeparableSpace s] - (hs : range f ∪ {0} ⊆ s) : - Tendsto (fun n => (SimpleFunc.approxOn f fmeas s 0 (hs <| by simp) n).integral μ) atTop - (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := by - apply tendsto_integral_approxOn_of_measurable hf fmeas _ _ (integrable_zero _ _ _) - exact Eventually.of_forall fun x => subset_closure (hs (Set.mem_union_left _ (mem_range_self _))) - --- We redeclare `E` here to temporarily avoid --- the `[CompleteSpace E]` and `[NormedSpace ℝ E]` instances. -theorem tendsto_integral_norm_approxOn_sub - {E : Type*} [NormedAddCommGroup E] [MeasurableSpace E] [BorelSpace E] {f : X → E} - (fmeas : Measurable f) (hf : Integrable f μ) [SeparableSpace (range f ∪ {0} : Set E)] : - Tendsto (fun n ↦ ∫ᵛ x, ‖SimpleFunc.approxOn f fmeas (range f ∪ {0}) 0 (by simp) n x - f x‖ ∂[B; μ]) - atTop (𝓝 0) := by - convert (tendsto_toReal zero_ne_top).comp (tendsto_approxOn_range_L1_enorm fmeas hf) with n - rw [integral_norm_eq_lintegral_enorm] - · simp - · apply (SimpleFunc.aestronglyMeasurable _).sub - apply (stronglyMeasurable_iff_measurable_separable.2 ⟨fmeas, ?_⟩).aestronglyMeasurable - exact .mono (.of_subtype (range f ∪ {0})) subset_union_left - -theorem integral_eq_integral_pos_part_sub_integral_neg_part {f : X → ℝ} (hf : Integrable f μ) : - ∫ᵛ a, f a ∂[B; μ] = ∫ᵛ a, (Real.toNNReal (f a) : ℝ) ∂[B; μ] - ∫ᵛ a, (Real.toNNReal (-f a) : ℝ) ∂[B; μ] := by - rw [← integral_sub hf.real_toNNReal] - · simp - · exact hf.neg.real_toNNReal - -end Basic - -section Order - -variable [PartialOrder E] [IsOrderedAddMonoid E] [IsOrderedModule ℝ E] - -@[gcongr] -lemma integral_mono_measure [OrderClosedTopology E] {f : X → E} {ν : Measure X} (hle : μ ≤ ν) - (hf : 0 ≤ᵐ[ν] f) (hfi : Integrable f ν) : ∫ᵛ (a : X), f a ∂[B; μ] ≤ ∫ᵛ (a : X), f a ∂ν := by - by_cases hE : CompleteSpace E - swap; · simp [integral, hE] - borelize E - obtain ⟨g, hg, hg_nonneg, hfg⟩ := hfi.1.exists_stronglyMeasurable_range_subset - isClosed_Ici.measurableSet (Set.nonempty_Ici (a := 0)) hf - rw [integrable_congr hfg] at hfi - simp only [integral_congr_ae hfg, integral_congr_ae (ae_mono hle hfg)] - have _ := hg.separableSpace_range_union_singleton (b := 0) - have h₁ := tendsto_integral_approxOn_of_measurable_of_range_subset hg.measurable hfi _ le_rfl - have h₂ := tendsto_integral_approxOn_of_measurable_of_range_subset hg.measurable - (hfi.mono_measure hle) _ le_rfl - apply le_of_tendsto_of_tendsto' h₂ h₁ - exact fun n ↦ SimpleFunc.integral_mono_measure - (Eventually.of_forall <| SimpleFunc.approxOn_range_nonneg hg_nonneg n) hle - (SimpleFunc.integrable_approxOn_range _ hfi n) - -variable [ClosedIciTopology E] - -/-- The integral of a function which is nonnegative almost everywhere is nonnegative. -/ -lemma integral_nonneg_of_ae {f : X → E} (hf : 0 ≤ᵐ[μ] f) : - 0 ≤ ∫ᵛ x, f x ∂[B; μ] := by - by_cases hE : CompleteSpace E - · exact integral_eq_setToFun f ▸ setToFun_nonneg (dominatedFinMeasAdditive_weightedSMul μ) - (fun s _ _ => weightedSMul_nonneg s) hf - · simp [integral, hE] - -lemma integral_nonneg {f : X → E} (hf : 0 ≤ f) : - 0 ≤ ∫ᵛ x, f x ∂[B; μ] := - integral_nonneg_of_ae (ae_of_all _ hf) - -lemma integral_nonpos_of_ae {f : X → E} (hf : f ≤ᵐ[μ] 0) : - ∫ᵛ x, f x ∂[B; μ] ≤ 0 := by - rw [← neg_nonneg, ← integral_neg] - refine integral_nonneg_of_ae ?_ - filter_upwards [hf] with x hx - simpa - -lemma integral_nonpos {f : X → E} (hf : f ≤ 0) : - ∫ᵛ x, f x ∂[B; μ] ≤ 0 := - integral_nonpos_of_ae (ae_of_all _ hf) - -lemma integral_mono_ae {f g : X → E} (hf : Integrable f μ) (hg : Integrable g μ) - (h : f ≤ᵐ[μ] g) : ∫ᵛ x, f x ∂[B; μ] ≤ ∫ᵛ x, g x ∂[B; μ] := by - rw [← sub_nonneg, ← integral_sub hg hf] - refine integral_nonneg_of_ae ?_ - filter_upwards [h] with x hx - simpa - -@[gcongr, mono] -lemma integral_mono {f g : X → E} (hf : Integrable f μ) (hg : Integrable g μ) - (h : f ≤ g) : ∫ᵛ x, f x ∂[B; μ] ≤ ∫ᵛ x, g x ∂[B; μ] := - integral_mono_ae hf hg (ae_of_all _ h) - -lemma integral_mono_of_nonneg {f g : X → E} (hf : 0 ≤ᵐ[μ] f) (hgi : Integrable g μ) - (h : f ≤ᵐ[μ] g) : ∫ᵛ a, f a ∂[B; μ] ≤ ∫ᵛ a, g a ∂[B; μ] := by - by_cases hfi : Integrable f μ - · exact integral_mono_ae hfi hgi h - · exact integral_undef hfi ▸ integral_nonneg_of_ae (hf.trans h) - -lemma integral_monotoneOn_of_integrand_ae {β : Type*} [Preorder β] {f : X → β → E} - {s : Set β} (hf_mono : ∀ᵐ x ∂[B; μ], MonotoneOn (f x) s) - (hf_int : ∀ a ∈ s, Integrable (f · a) μ) : MonotoneOn (fun b => ∫ᵛ x, f x b ∂[B; μ]) s := by - intro a ha b hb hab - refine integral_mono_ae (hf_int a ha) (hf_int b hb) ?_ - filter_upwards [hf_mono] with x hx - exact hx ha hb hab - -lemma integral_antitoneOn_of_integrand_ae {β : Type*} [Preorder β] {f : X → β → E} - {s : Set β} (hf_anti : ∀ᵐ x ∂[B; μ], AntitoneOn (f x) s) - (hf_int : ∀ a ∈ s, Integrable (f · a) μ) : AntitoneOn (fun b => ∫ᵛ x, f x b ∂[B; μ]) s := by - intro a ha b hb hab - refine integral_mono_ae (hf_int b hb) (hf_int a ha) ?_ - filter_upwards [hf_anti] with x hx - exact hx ha hb hab - -lemma integral_convexOn_of_integrand_ae {β : Type*} [AddCommMonoid β] - [Module ℝ β] {f : X → β → E} {s : Set β} (hs : Convex ℝ s) - (hf_conv : ∀ᵐ x ∂[B; μ], ConvexOn ℝ s (f x)) (hf_int : ∀ a ∈ s, Integrable (f · a) μ) : - ConvexOn ℝ s (fun b => ∫ᵛ x, f x b ∂[B; μ]) := by - refine ⟨hs, ?_⟩ - intro a ha b hb p q hp hq hpq - calc ∫ᵛ x, f x (p • a + q • b) ∂[B; μ] ≤ ∫ᵛ x, p • f x a + q • f x b ∂[B; μ] := by - refine integral_mono_ae ?lhs ?rhs ?ae_le - case lhs => - refine hf_int _ ?_ - rw [convex_iff_add_mem] at hs - exact hs ha hb hp hq hpq - case rhs => fun_prop (disch := aesop) - case ae_le => - filter_upwards [hf_conv] with x hx - exact hx.2 ha hb hp hq hpq - _ = ∫ᵛ x, p • f x a ∂[B; μ] + ∫ᵛ x, q • f x b ∂[B; μ] := by - apply integral_add - all_goals fun_prop (disch := aesop) - _ = p • ∫ᵛ x, f x a ∂[B; μ] + q • ∫ᵛ x, f x b ∂[B; μ] := by simp [integral_smul] - -lemma integral_concaveOn_of_integrand_ae {β : Type*} [AddCommMonoid β] - [Module ℝ β] {f : X → β → E} {s : Set β} (hs : Convex ℝ s) - (hf_conc : ∀ᵐ x ∂[B; μ], ConcaveOn ℝ s (f x)) (hf_int : ∀ a ∈ s, Integrable (f · a) μ) : - ConcaveOn ℝ s (fun b => ∫ᵛ x, f x b ∂[B; μ]) := by - simp_rw [← neg_convexOn_iff] at hf_conc ⊢ - simpa only [Pi.neg_apply, integral_neg] using - integral_convexOn_of_integrand_ae hs hf_conc (hf_int · · |>.neg) - -end Order - -variable [hE : CompleteSpace E] - -theorem lintegral_coe_eq_integral (f : X → ℝ≥0) (hfi : Integrable (fun x => (f x : ℝ)) μ) : - ∫⁻ a, f a ∂[B; μ] = ENNReal.ofReal (∫ᵛ a, f a ∂[B; μ]) := by - simp_rw [integral_eq_lintegral_of_nonneg_ae (Eventually.of_forall fun x => (f x).coe_nonneg) - hfi.aestronglyMeasurable, ← ENNReal.coe_nnreal_eq] - rw [ENNReal.ofReal_toReal] - simpa [← lt_top_iff_ne_top, hasFiniteIntegral_iff_enorm, NNReal.enorm_eq] using - hfi.hasFiniteIntegral - -theorem ofReal_integral_eq_lintegral_ofReal {f : X → ℝ} (hfi : Integrable f μ) (f_nn : 0 ≤ᵐ[μ] f) : - ENNReal.ofReal (∫ᵛ x, f x ∂[B; μ]) = ∫⁻ x, ENNReal.ofReal (f x) ∂[B; μ] := by - have : f =ᵐ[μ] (‖f ·‖) := f_nn.mono fun _x hx ↦ (abs_of_nonneg hx).symm - simp_rw [integral_congr_ae this, ofReal_integral_norm_eq_lintegral_enorm hfi, - ← ofReal_norm_eq_enorm] - exact lintegral_congr_ae (this.symm.fun_comp ENNReal.ofReal) - -theorem integral_toReal {f : X → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : ∀ᵐ x ∂[B; μ], f x < ∞) : - ∫ᵛ a, (f a).toReal ∂[B; μ] = (∫⁻ a, f a ∂[B; μ]).toReal := by - rw [integral_eq_lintegral_of_nonneg_ae _ hfm.ennreal_toReal.aestronglyMeasurable, - lintegral_congr_ae (ofReal_toReal_ae_eq hf)] - exact Eventually.of_forall fun x => ENNReal.toReal_nonneg - -theorem lintegral_coe_le_coe_iff_integral_le {f : X → ℝ≥0} (hfi : Integrable (fun x => (f x : ℝ)) μ) - {b : ℝ≥0} : ∫⁻ a, f a ∂[B; μ] ≤ b ↔ ∫ᵛ a, (f a : ℝ) ∂[B; μ] ≤ b := by - rw [lintegral_coe_eq_integral f hfi, ENNReal.ofReal, ENNReal.coe_le_coe, - Real.toNNReal_le_iff_le_coe] - -theorem integral_coe_le_of_lintegral_coe_le {f : X → ℝ≥0} {b : ℝ≥0} (h : ∫⁻ a, f a ∂[B; μ] ≤ b) : - ∫ᵛ a, (f a : ℝ) ∂[B; μ] ≤ b := by - by_cases hf : Integrable (fun a => (f a : ℝ)) μ - · exact (lintegral_coe_le_coe_iff_integral_le hf).1 h - · rw [integral_undef hf]; exact b.2 - -theorem integral_eq_zero_iff_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ] f) (hfi : Integrable f μ) : - ∫ᵛ x, f x ∂[B; μ] = 0 ↔ f =ᵐ[μ] 0 := by - simp_rw [integral_eq_lintegral_of_nonneg_ae hf hfi.1, ENNReal.toReal_eq_zero_iff, - ← ENNReal.not_lt_top, ← hasFiniteIntegral_iff_ofReal hf, hfi.2, not_true_eq_false, or_false] - rw [lintegral_eq_zero_iff'] - · rw [← hf.ge_iff_eq', Filter.EventuallyEq, Filter.EventuallyLE] - simp only [Pi.zero_apply, ofReal_eq_zero] - · exact (ENNReal.measurable_ofReal.comp_aemeasurable hfi.1.aemeasurable) - -theorem integral_eq_zero_iff_of_nonneg {f : X → ℝ} (hf : 0 ≤ f) (hfi : Integrable f μ) : - ∫ᵛ x, f x ∂[B; μ] = 0 ↔ f =ᵐ[μ] 0 := - integral_eq_zero_iff_of_nonneg_ae (Eventually.of_forall hf) hfi - -lemma integral_eq_iff_of_ae_le {f g : X → ℝ} - (hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) : - ∫ᵛ a, f a ∂[B; μ] = ∫ᵛ a, g a ∂[B; μ] ↔ f =ᵐ[μ] g := by - refine ⟨fun h_le ↦ EventuallyEq.symm ?_, fun h ↦ integral_congr_ae h⟩ - rw [← sub_ae_eq_zero, - ← integral_eq_zero_iff_of_nonneg_ae ((sub_nonneg_ae _ _).mpr hfg) (hg.sub hf)] - simpa [Pi.sub_apply, integral_sub hg hf, sub_eq_zero, eq_comm] - -theorem integral_pos_iff_support_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ] f) (hfi : Integrable f μ) : - (0 < ∫ᵛ x, f x ∂[B; μ]) ↔ 0 < μ (Function.support f) := by - simp_rw [(integral_nonneg_of_ae hf).lt_iff_ne, pos_iff_ne_zero, Ne, @eq_comm ℝ 0, - integral_eq_zero_iff_of_nonneg_ae hf hfi, Filter.EventuallyEq, ae_iff, Pi.zero_apply, - Function.support] - -theorem integral_pos_iff_support_of_nonneg {f : X → ℝ} (hf : 0 ≤ f) (hfi : Integrable f μ) : - (0 < ∫ᵛ x, f x ∂[B; μ]) ↔ 0 < μ (Function.support f) := - integral_pos_iff_support_of_nonneg_ae (Eventually.of_forall hf) hfi - -lemma integral_exp_pos {μ : Measure X} {f : X → ℝ} [hμ : NeZero μ] - (hf : Integrable (fun x ↦ Real.exp (f x)) μ) : - 0 < ∫ᵛ x, Real.exp (f x) ∂[B; μ] := by - rw [integral_pos_iff_support_of_nonneg (fun x ↦ (Real.exp_pos _).le) hf] - suffices (Function.support fun x ↦ Real.exp (f x)) = Set.univ by simp [this, hμ.out] - ext1 x - simp only [Function.mem_support, ne_eq, (Real.exp_pos _).ne', not_false_eq_true, Set.mem_univ] - -/-- Monotone convergence theorem for real-valued functions and Bochner integrals -/ -lemma integral_tendsto_of_tendsto_of_monotone {μ : Measure X} {f : ℕ → X → ℝ} {F : X → ℝ} - (hf : ∀ n, Integrable (f n) μ) (hF : Integrable F μ) (h_mono : ∀ᵐ x ∂[B; μ], Monotone fun n ↦ f n x) - (h_tendsto : ∀ᵐ x ∂[B; μ], Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) : - Tendsto (fun n ↦ ∫ᵛ x, f n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, F x ∂[B; μ])) := by - -- switch from the Bochner to the Lebesgue integral - let f' := fun n x ↦ f n x - f 0 x - have hf'_nonneg : ∀ᵐ x ∂[B; μ], ∀ n, 0 ≤ f' n x := by - filter_upwards [h_mono] with a ha n - simp [f', ha zero_le] - have hf'_meas : ∀ n, Integrable (f' n) μ := fun n ↦ (hf n).sub (hf 0) - suffices Tendsto (fun n ↦ ∫ᵛ x, f' n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, (F - f 0) x ∂[B; μ])) by - simp_rw [f', integral_sub (hf _) (hf _), integral_sub' hF (hf 0), - tendsto_sub_const_iff] at this - exact this - have hF_ge : 0 ≤ᵐ[μ] fun x ↦ (F - f 0) x := by - filter_upwards [h_tendsto, h_mono] with x hx_tendsto hx_mono - simp only [Pi.zero_apply, Pi.sub_apply, sub_nonneg] - exact ge_of_tendsto' hx_tendsto (fun n ↦ hx_mono zero_le) - rw [ae_all_iff] at hf'_nonneg - simp_rw [integral_eq_lintegral_of_nonneg_ae (hf'_nonneg _) (hf'_meas _).1] - rw [integral_eq_lintegral_of_nonneg_ae hF_ge (hF.1.sub (hf 0).1)] - have h_cont := ENNReal.continuousAt_toReal (x := ∫⁻ a, ENNReal.ofReal ((F - f 0) a) ∂[B; μ]) ?_ - swap - · rw [← ofReal_integral_eq_lintegral_ofReal (hF.sub (hf 0)) hF_ge] - finiteness - refine h_cont.tendsto.comp ?_ - -- use the result for the Lebesgue integral - refine lintegral_tendsto_of_tendsto_of_monotone ?_ ?_ ?_ - · exact fun n ↦ ((hf n).sub (hf 0)).aemeasurable.ennreal_ofReal - · filter_upwards [h_mono] with x hx n m hnm - refine ENNReal.ofReal_le_ofReal ?_ - simp only [f', tsub_le_iff_right, sub_add_cancel] - exact hx hnm - · filter_upwards [h_tendsto] with x hx - refine (ENNReal.continuous_ofReal.tendsto _).comp ?_ - simp only [Pi.sub_apply] - exact Tendsto.sub hx tendsto_const_nhds - -/-- Monotone convergence theorem for real-valued functions and Bochner integrals -/ -lemma integral_tendsto_of_tendsto_of_antitone {μ : Measure X} {f : ℕ → X → ℝ} {F : X → ℝ} - (hf : ∀ n, Integrable (f n) μ) (hF : Integrable F μ) (h_mono : ∀ᵐ x ∂[B; μ], Antitone fun n ↦ f n x) - (h_tendsto : ∀ᵐ x ∂[B; μ], Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) : - Tendsto (fun n ↦ ∫ᵛ x, f n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, F x ∂[B; μ])) := by - suffices Tendsto (fun n ↦ ∫ᵛ x, -f n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, -F x ∂[B; μ])) by - suffices Tendsto (fun n ↦ ∫ᵛ x, - -f n x ∂[B; μ]) atTop (𝓝 (∫ᵛ x, - -F x ∂[B; μ])) by - simpa [neg_neg] using this - convert this.neg <;> rw [integral_neg] - refine integral_tendsto_of_tendsto_of_monotone (fun n ↦ (hf n).neg) hF.neg ?_ ?_ - · filter_upwards [h_mono] with x hx n m hnm using neg_le_neg_iff.mpr <| hx hnm - · filter_upwards [h_tendsto] with x hx using hx.neg - -/-- If a monotone sequence of functions has an upper bound and the sequence of integrals of these -functions tends to the integral of the upper bound, then the sequence of functions converges -almost everywhere to the upper bound. -/ -lemma tendsto_of_integral_tendsto_of_monotone {μ : Measure X} {f : ℕ → X → ℝ} {F : X → ℝ} - (hf_int : ∀ n, Integrable (f n) μ) (hF_int : Integrable F μ) - (hf_tendsto : Tendsto (fun i ↦ ∫ᵛ a, f i a ∂[B; μ]) atTop (𝓝 (∫ᵛ a, F a ∂[B; μ]))) - (hf_mono : ∀ᵐ a ∂[B; μ], Monotone (fun i ↦ f i a)) - (hf_bound : ∀ᵐ a ∂[B; μ], ∀ i, f i a ≤ F a) : - ∀ᵐ a ∂[B; μ], Tendsto (fun i ↦ f i a) atTop (𝓝 (F a)) := by - -- reduce to the `ℝ≥0∞` case - let f' : ℕ → X → ℝ≥0∞ := fun n a ↦ ENNReal.ofReal (f n a - f 0 a) - let F' : X → ℝ≥0∞ := fun a ↦ ENNReal.ofReal (F a - f 0 a) - have hf'_int_eq : ∀ i, ∫⁻ a, f' i a ∂[B; μ] = ENNReal.ofReal (∫ᵛ a, f i a ∂[B; μ] - ∫ᵛ a, f 0 a ∂[B; μ]) := by - intro i - unfold f' - rw [← ofReal_integral_eq_lintegral_ofReal, integral_sub (hf_int i) (hf_int 0)] - · exact (hf_int i).sub (hf_int 0) - · filter_upwards [hf_mono] with a h_mono - simp [h_mono zero_le] - have hF'_int_eq : ∫⁻ a, F' a ∂[B; μ] = ENNReal.ofReal (∫ᵛ a, F a ∂[B; μ] - ∫ᵛ a, f 0 a ∂[B; μ]) := by - unfold F' - rw [← ofReal_integral_eq_lintegral_ofReal, integral_sub hF_int (hf_int 0)] - · exact hF_int.sub (hf_int 0) - · filter_upwards [hf_bound] with a h_bound - simp [h_bound 0] - have h_tendsto : Tendsto (fun i ↦ ∫⁻ a, f' i a ∂[B; μ]) atTop (𝓝 (∫⁻ a, F' a ∂[B; μ])) := by - simp_rw [hf'_int_eq, hF'_int_eq] - refine (ENNReal.continuous_ofReal.tendsto _).comp ?_ - rwa [tendsto_sub_const_iff] - have h_mono : ∀ᵐ a ∂[B; μ], Monotone (fun i ↦ f' i a) := by - filter_upwards [hf_mono] with a ha_mono i j hij - refine ENNReal.ofReal_le_ofReal ?_ - simp [ha_mono hij] - have h_bound : ∀ᵐ a ∂[B; μ], ∀ i, f' i a ≤ F' a := by - filter_upwards [hf_bound] with a ha_bound i - refine ENNReal.ofReal_le_ofReal ?_ - simp only [tsub_le_iff_right, sub_add_cancel, ha_bound i] - -- use the corresponding lemma for `ℝ≥0∞` - have h := tendsto_of_lintegral_tendsto_of_monotone ?_ h_tendsto h_mono h_bound ?_ - rotate_left - · exact (hF_int.1.aemeasurable.sub (hf_int 0).1.aemeasurable).ennreal_ofReal - · exact ((lintegral_ofReal_le_lintegral_enorm _).trans_lt (hF_int.sub (hf_int 0)).2).ne - filter_upwards [h, hf_mono, hf_bound] with a ha ha_mono ha_bound - have h1 : (fun i ↦ f i a) = fun i ↦ (f' i a).toReal + f 0 a := by - unfold f' - ext i - rw [ENNReal.toReal_ofReal] - · abel - · simp [ha_mono zero_le] - have h2 : F a = (F' a).toReal + f 0 a := by - unfold F' - rw [ENNReal.toReal_ofReal] - · abel - · simp [ha_bound 0] - rw [h1, h2] - refine Filter.Tendsto.add ?_ tendsto_const_nhds - exact (ENNReal.continuousAt_toReal (by finiteness)).tendsto.comp ha - -/-- If an antitone sequence of functions has a lower bound and the sequence of integrals of these -functions tends to the integral of the lower bound, then the sequence of functions converges -almost everywhere to the lower bound. -/ -lemma tendsto_of_integral_tendsto_of_antitone {μ : Measure X} {f : ℕ → X → ℝ} {F : X → ℝ} - (hf_int : ∀ n, Integrable (f n) μ) (hF_int : Integrable F μ) - (hf_tendsto : Tendsto (fun i ↦ ∫ᵛ a, f i a ∂[B; μ]) atTop (𝓝 (∫ᵛ a, F a ∂[B; μ]))) - (hf_mono : ∀ᵐ a ∂[B; μ], Antitone (fun i ↦ f i a)) - (hf_bound : ∀ᵐ a ∂[B; μ], ∀ i, F a ≤ f i a) : - ∀ᵐ a ∂[B; μ], Tendsto (fun i ↦ f i a) atTop (𝓝 (F a)) := by - let f' : ℕ → X → ℝ := fun i a ↦ - f i a - let F' : X → ℝ := fun a ↦ - F a - suffices ∀ᵐ a ∂[B; μ], Tendsto (fun i ↦ f' i a) atTop (𝓝 (F' a)) by - filter_upwards [this] with a ha_tendsto - convert ha_tendsto.neg - · simp [f'] - · simp [F'] - refine tendsto_of_integral_tendsto_of_monotone (fun n ↦ (hf_int n).neg) hF_int.neg ?_ ?_ ?_ - · convert hf_tendsto.neg - · rw [integral_neg] - · rw [integral_neg] - · filter_upwards [hf_mono] with a ha i j hij - simp [f', ha hij] - · filter_upwards [hf_bound] with a ha i - simp [f', F', ha i] - -section NormedAddCommGroup - -variable {H : Type*} [NormedAddCommGroup H] - -theorem L1.norm_eq_integral_norm (f : X →₁[μ] H) : ‖f‖ = ∫ᵛ a, ‖f a‖ ∂[B; μ] := by - simp only [eLpNorm, eLpNorm'_eq_lintegral_enorm, ENNReal.toReal_one, ENNReal.rpow_one, - Lp.norm_def, if_false, ENNReal.one_ne_top, one_ne_zero, _root_.div_one] - rw [integral_eq_lintegral_of_nonneg_ae (Eventually.of_forall (by simp [norm_nonneg])) - (Lp.aestronglyMeasurable f).norm] - simp +theorem continuousOn_of_dominated {F : Y → X → E} {bound : X → ℝ} {s : Set Y} + (hF_meas : ∀ x ∈ s, AEStronglyMeasurable (F x) (μ.transpose B).variation) + (h_bound : ∀ x ∈ s, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) + (bound_integrable : Integrable bound (μ.transpose B).variation) + (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousOn (fun x => F x a) s) : + ContinuousOn (fun x => ∫ᵛ a, F x a ∂[B; μ]) s := + continuousOn_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont -theorem L1.dist_eq_integral_dist (f g : X →₁[μ] H) : dist f g = ∫ᵛ a, dist (f a) (g a) ∂[B; μ] := by - simp only [dist_eq_norm, L1.norm_eq_integral_norm] - exact integral_congr_ae <| (Lp.coeFn_sub _ _).fun_comp norm - -theorem L1.norm_of_fun_eq_integral_norm {f : X → H} (hf : Integrable f μ) : - ‖hf.toL1 f‖ = ∫ᵛ a, ‖f a‖ ∂[B; μ] := by - rw [L1.norm_eq_integral_norm] - exact integral_congr_ae <| hf.coeFn_toL1.fun_comp _ - -theorem MemLp.eLpNorm_eq_integral_rpow_norm {f : X → H} {p : ℝ≥0∞} (hp1 : p ≠ 0) (hp2 : p ≠ ∞) - (hf : MemLp f p μ) : - eLpNorm f p μ = ENNReal.ofReal ((∫ᵛ a, ‖f a‖ ^ p.toReal ∂[B; μ]) ^ p.toReal⁻¹) := by - have A : ∫⁻ a : X, ENNReal.ofReal (‖f a‖ ^ p.toReal) ∂[B; μ] = ∫⁻ a : X, ‖f a‖ₑ ^ p.toReal ∂[B; μ] := by - simp_rw [← ofReal_rpow_of_nonneg (norm_nonneg _) toReal_nonneg, ofReal_norm_eq_enorm] - simp only [eLpNorm_eq_lintegral_rpow_enorm_toReal hp1 hp2, one_div] - rw [integral_eq_lintegral_of_nonneg_ae]; rotate_left - · exact ae_of_all _ fun x => by positivity - · exact (hf.aestronglyMeasurable.norm.aemeasurable.pow_const _).aestronglyMeasurable - rw [A, ← ofReal_rpow_of_nonneg toReal_nonneg (inv_nonneg.2 toReal_nonneg), ofReal_toReal] - exact (lintegral_rpow_enorm_lt_top_of_eLpNorm_lt_top hp1 hp2 hf.2).ne - -end NormedAddCommGroup - -theorem norm_integral_le_integral_norm (f : X → E) : ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ∫ᵛ a, ‖f a‖ ∂[B; μ] := by - have le_ae : ∀ᵐ a ∂[B; μ], 0 ≤ ‖f a‖ := Eventually.of_forall fun a => norm_nonneg _ - by_cases h : AEStronglyMeasurable f μ - · calc - ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂[B; μ]) := - norm_integral_le_lintegral_norm _ - _ = ∫ᵛ a, ‖f a‖ ∂[B; μ] := (integral_eq_lintegral_of_nonneg_ae le_ae <| h.norm).symm - · rw [integral_non_aestronglyMeasurable h, norm_zero] - exact integral_nonneg_of_ae le_ae - -lemma abs_integral_le_integral_abs {f : X → ℝ} : |∫ᵛ a, f a ∂[B; μ]| ≤ ∫ᵛ a, |f a| ∂[B; μ] := - norm_integral_le_integral_norm f - -theorem norm_integral_le_of_norm_le {f : X → E} {g : X → ℝ} (hg : Integrable g μ) - (h : ∀ᵐ x ∂[B; μ], ‖f x‖ ≤ g x) : ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ ∫ᵛ x, g x ∂[B; μ] := - calc - ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ ∫ᵛ x, ‖f x‖ ∂[B; μ] := norm_integral_le_integral_norm f - _ ≤ ∫ᵛ x, g x ∂[B; μ] := integral_mono_of_nonneg (Eventually.of_forall fun _ => norm_nonneg _) hg h +theorem continuous_of_dominated {F : Y → X → E} {bound : X → ℝ} + (hF_meas : ∀ x, AEStronglyMeasurable (F x) (μ.transpose B).variation) + (h_bound : ∀ x, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) + (bound_integrable : Integrable bound (μ.transpose B).variation) + (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, Continuous fun x => F x a) : + Continuous fun x => ∫ᵛ a, F x a ∂[B; μ] := + continuous_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont @[simp] -theorem integral_const (c : E) : ∫ᵛ _ : X, c ∂[B; μ] = μ.real univ • c := by - by_cases hμ : IsFiniteMeasure μ - · simp only [integral_eq_setToFun] - exact setToFun_const (dominatedFinMeasAdditive_weightedSMul _) _ - by_cases hc : c = 0 - · simp [hc, integral_zero] - · simp [measureReal_def, (integrable_const_iff_isFiniteMeasure hc).not.2 hμ, - integral_undef, MeasureTheory.not_isFiniteMeasure_iff.mp hμ] - -lemma integral_eq_const [IsProbabilityMeasure μ] {f : X → E} {c : E} (hf : ∀ᵐ x ∂[B; μ], f x = c) : - ∫ᵛ x, f x ∂[B; μ] = c := by simp [integral_congr_ae hf] - -theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure μ] {f : X → E} {C : ℝ} - (h : ∀ᵐ x ∂[B; μ], ‖f x‖ ≤ C) : ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ C * μ.real univ := - calc - ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ ∫ᵛ _, C ∂[B; μ] := norm_integral_le_of_norm_le (integrable_const C) h - _ = C * μ.real univ := by rw [integral_const, smul_eq_mul, mul_comm] - -variable {ν : Measure X} - -theorem integral_add_measure {f : X → E} (hμ : Integrable f μ) (hν : Integrable f ν) : - ∫ᵛ x, f x ∂(μ + ν) = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂ν := by +theorem integral_const [CompleteSpace G] [IsFiniteMeasure (μ.transpose B).variation] + (c : E) : ∫ᵛ _ : X, c ∂[B; μ] = B c (μ univ) := + setToFun_const _ _ + +theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure (μ.transpose B).variation] + {C : ℝ} (h : ∀ᵐ x ∂(μ.transpose B).variation, ‖f x‖ ≤ C) : + ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ C * (μ.transpose B).variation.real univ := calc + ‖∫ᵛ x, f x ∂[B; μ]‖ + _ ≤ (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation).toReal := + norm_integral_le_lintegral_norm _ + _ ≤ (∫⁻ a, ENNReal.ofReal C ∂(μ.transpose B).variation).toReal := by + apply ENNReal.toReal_mono + · simp only [lintegral_const, ne_eq] + finiteness + · apply lintegral_mono_ae + filter_upwards [h] with x hx using ENNReal.ofReal_mono hx + _ = C * (μ.transpose B).variation.real univ := by + by_cases hμ : (μ.transpose B).variation = 0 + · simp [hμ] + have : (ae (μ.transpose B).variation).NeBot := ae_neBot.mpr hμ + have hC : 0 ≤ C := by + obtain ⟨x, hx⟩ := h.exists + exact (norm_nonneg _).trans hx + simp [ENNReal.toReal_ofReal hC, Measure.real] + +variable {ν : VectorMeasure X F} + +theorem integral_add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : + ∫ᵛ x, f x ∂[B; (μ + ν)] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := by by_cases hG : CompleteSpace G; swap - · simp [integral, hG] + · simp [integral, setToFun, hG] have hfi := hμ.add_measure hν - simp_rw [integral_eq_setToFun] - have hμ_dfma : DominatedFinMeasAdditive (μ + ν) (weightedSMul μ : Set X → G →L[ℝ] G) 1 := +/- have hμ_dfma : DominatedFinMeasAdditive (μ + ν) (weightedSMul μ : Set X → G →L[ℝ] G) 1 := DominatedFinMeasAdditive.add_measure_right μ ν (dominatedFinMeasAdditive_weightedSMul μ) zero_le_one have hν_dfma : DominatedFinMeasAdditive (μ + ν) (weightedSMul ν : Set X → G →L[ℝ] G) 1 := DominatedFinMeasAdditive.add_measure_left μ ν (dominatedFinMeasAdditive_weightedSMul ν) - zero_le_one + zero_le_one-/ rw [← setToFun_congr_measure_of_add_right hμ_dfma (dominatedFinMeasAdditive_weightedSMul μ) f hfi, ← setToFun_congr_measure_of_add_left hν_dfma (dominatedFinMeasAdditive_weightedSMul ν) f hfi] @@ -909,8 +428,10 @@ theorem integral_add_measure {f : X → E} (hμ : Integrable f μ) (hν : Integr rw [weightedSMul, weightedSMul, weightedSMul, ← add_smul, measureReal_add_apply hμνs.1.ne hμνs.2.ne] +#exit + @[simp] -theorem integral_zero_measure {m : MeasurableSpace X} (f : X → E) : +theorem integral_zero_vectorMeasure {m : MeasurableSpace X} (f : X → E) : (∫ᵛ x, f x ∂(0 : Measure X)) = 0 := by simp only [integral_eq_setToFun] exact setToFun_measure_zero (dominatedFinMeasAdditive_weightedSMul _) rfl From 95f2c15aa5909c429c3f198b57df2f40f2432926 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 14 May 2026 22:35:31 +0200 Subject: [PATCH 022/129] fix --- Mathlib/MeasureTheory/Integral/Prod.lean | 2 +- Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean | 4 ++-- Mathlib/Probability/Kernel/Disintegration/Density.lean | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/Prod.lean b/Mathlib/MeasureTheory/Integral/Prod.lean index 7f3f98fb7fd90b..a09314bc3e4ffd 100644 --- a/Mathlib/MeasureTheory/Integral/Prod.lean +++ b/Mathlib/MeasureTheory/Integral/Prod.lean @@ -470,7 +470,7 @@ theorem continuous_integral_integral : Continuous fun f : α × β →₁[μ.prod ν] E => ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by rw [continuous_iff_continuousAt]; intro g refine - tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_prod_left + tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_prod_left.aestronglyMeasurable (Eventually.of_forall fun h => (L1.integrable_coeFn h).integral_prod_left) ?_ simp_rw [← lintegral_fn_integral_sub _ (L1.integrable_coeFn _) (L1.integrable_coeFn g)] apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds _ (fun i => zero_le) _ diff --git a/Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean b/Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean index 6395d12eaccb7b..5bd891a3ef2fa5 100644 --- a/Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean +++ b/Mathlib/Probability/Kernel/Composition/IntegralCompProd.lean @@ -216,7 +216,7 @@ theorem Kernel.continuous_integral_integral : Continuous fun f : β × γ →₁[(κ ⊗ₖ η) a] E => ∫ x, ∫ y, f (x, y) ∂η (a, x) ∂κ a := by rw [continuous_iff_continuousAt]; intro g refine - tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_compProd + tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_compProd.aestronglyMeasurable (Eventually.of_forall fun h => (L1.integrable_coeFn h).integral_compProd) ?_ simp_rw [← lintegral_fn_integral_sub (‖·‖ₑ) (L1.integrable_coeFn _) (L1.integrable_coeFn g)] apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds _ (fun i => zero_le) _ @@ -401,7 +401,7 @@ theorem integral_integral_sub'_comp ⦃f g : γ → E⦄ (hf : Integrable f ((η theorem continuous_integral_integral_comp : Continuous fun f : γ →₁[(η ∘ₖ κ) a] E ↦ ∫ x, ∫ y, f y ∂η x ∂κ a := by refine continuous_iff_continuousAt.2 fun g ↦ ?_ - refine tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_comp + refine tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_comp.aestronglyMeasurable (Eventually.of_forall fun h ↦ (L1.integrable_coeFn h).integral_comp) ?_ simp_rw [← lintegral_fn_integral_sub_comp (‖·‖ₑ) (L1.integrable_coeFn _) (L1.integrable_coeFn g)] refine tendsto_of_tendsto_of_tendsto_of_le_of_le diff --git a/Mathlib/Probability/Kernel/Disintegration/Density.lean b/Mathlib/Probability/Kernel/Disintegration/Density.lean index 2f18ebc7c8f1a6..3fe7eaab0b5954 100644 --- a/Mathlib/Probability/Kernel/Disintegration/Density.lean +++ b/Mathlib/Probability/Kernel/Disintegration/Density.lean @@ -499,7 +499,8 @@ lemma tendsto_setIntegral_densityProcess (hκν : fst κ ≤ ν) Tendsto (fun i ↦ ∫ x in A, densityProcess κ ν i a x s ∂(ν a)) atTop (𝓝 (∫ x in A, density κ ν a x s ∂(ν a))) := by refine tendsto_setIntegral_of_L1' (μ := ν a) (fun x ↦ density κ ν a x s) - (integrable_density hκν a hs) (F := fun i x ↦ densityProcess κ ν i a x s) (l := atTop) + (integrable_density hκν a hs).aestronglyMeasurable + (F := fun i x ↦ densityProcess κ ν i a x s) (l := atTop) (Eventually.of_forall (fun n ↦ integrable_densityProcess hκν _ _ hs)) ?_ A refine (tendsto_congr fun n ↦ ?_).mp (tendsto_eLpNorm_one_densityProcess_limitProcess hκν a hs) refine eLpNorm_congr_ae ?_ From 3951f98bf7156ea537e9895ce653ffaa7bcfe632 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 15 May 2026 19:13:16 +0200 Subject: [PATCH 023/129] more --- .../Algebra/Order/Monoid/Unbundled/Defs.lean | 6 + .../MeasureTheory/Measure/MeasureSpace.lean | 9 ++ .../MeasureTheory/VectorMeasure/Basic.lean | 11 ++ .../MeasureTheory/VectorMeasure/Integral.lean | 149 +++++++++++------- .../VectorMeasure/Variation/Basic.lean | 38 +++++ 5 files changed, 157 insertions(+), 56 deletions(-) diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean index f20efe7851731b..cdd62d9bcc1e07 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean @@ -572,4 +572,10 @@ instance IsRightCancelMul.mulRightReflectLE_of_mulRightReflectLT le_of_mul_le_mul_right' := contravariant_le_iff_contravariant_lt_and_eq N N _ |>.mpr ⟨‹MulRightReflectLT N›.elim, fun _ ↦ mul_right_cancel⟩ _ +instance [Mul M] [LE M] [h : MulLeftMono M] : + CovariantClass M M (· • ·) (· ≤ ·) := h + +instance [Mul M] [LE M] [h : MulRightMono M] : + CovariantClass M M (swap (· • ·)) (· ≤ ·) := h + end Variants diff --git a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean index dfdbb0f4299ba0..c15b18d4e60997 100644 --- a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean +++ b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean @@ -1079,6 +1079,13 @@ protected theorem le_add_left (h : μ ≤ ν) : μ ≤ ν' + ν := fun s => le_a protected theorem le_add_right (h : μ ≤ ν) : μ ≤ ν + ν' := fun s => le_add_right (h s) +instance [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] [CovariantClass R ℝ≥0∞ (· • ·) (· ≤ ·)] : + CovariantClass R (Measure α) (· • ·) (· ≤ ·) := by + constructor + intro c μ ν hμν s + simp only [smul_apply] + gcongr + section sInf variable {m : Set (Measure α)} @@ -1494,3 +1501,5 @@ end end MeasureTheory end + +set_option linter.style.longFile 1700 diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index 54bd6a6f66b661..2f1828f1a2ef57 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -123,6 +123,14 @@ theorem ext_iff (v w : VectorMeasure α M) : v = w ↔ ∀ i : Set α, Measurabl theorem ext {s t : VectorMeasure α M} (h : ∀ i : Set α, MeasurableSet i → s i = t i) : s = t := (ext_iff s t).2 h +@[nontriviality] +lemma apply_eq_zero_of_isEmpty [IsEmpty α] (v : VectorMeasure α M) (s : Set α) : + v s = 0 := by + rw [eq_empty_of_isEmpty s, empty] + +instance instSubsingleton [IsEmpty α] : Subsingleton (VectorMeasure α M) := + ⟨fun μ ν => by ext1 s _; rw [apply_eq_zero_of_isEmpty, apply_eq_zero_of_isEmpty]⟩ + variable [Countable β] {v : VectorMeasure α M} {f : β → Set α} theorem hasSum_of_disjoint_iUnion (hm : ∀ i, MeasurableSet (f i)) (hd : Pairwise (Disjoint on f)) : @@ -287,6 +295,9 @@ theorem coe_zero : ⇑(0 : VectorMeasure α M) = 0 := rfl theorem zero_apply (i : Set α) : (0 : VectorMeasure α M) i = 0 := rfl +theorem eq_zero_of_isEmpty [IsEmpty α] (v : VectorMeasure α M) : v = 0 := + Subsingleton.elim v 0 + variable [ContinuousAdd M] /-- The sum of two vector measure is a vector measure. -/ diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index a2a77c1cf9ab54..c07e89b32c1293 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -62,6 +62,7 @@ unconditionally convergent. public section open Set MeasureTheory VectorMeasure ContinuousLinearMap Filter Topology +open scoped ENNReal variable {X E F G : Type*} {mX : MeasurableSpace X} [NormedAddCommGroup E] [NormedSpace ℝ E] @@ -125,6 +126,10 @@ lemma restrict_transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G simp [VectorMeasure.restrict_apply, hs, ht, transpose] · simp [restrict_not_measurable _ hs, transpose] +lemma transpose_add (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : + (μ + ν).transpose B = μ.transpose B + ν.transpose B := by + simp [transpose] + lemma variation_transpose_le (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : (μ.transpose B).variation ≤ ‖B‖₊ • μ.variation := by apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) @@ -171,11 +176,27 @@ multiplication by `ℝ` on `F` and `f` is real-valued. The resulting integral is notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂•"μ:70 => integral (VectorMeasure.restrict μ s) r (lsmul ℝ ℝ) -variable {μ : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} +variable {μ ν : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} @[simp] lemma integrable_zero_vectorMeasure : (0 : VectorMeasure X F).Integrable f B := by simp [VectorMeasure.Integrable, transpose] +lemma integrable_add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : + (μ + ν).Integrable f B := by + apply Integrable.mono_measure (integrable_add_measure.2 ⟨hμ, hν⟩) + grw [transpose_add, variation_add_le] + +lemma integrable_finsetSum_vectorMeasure {ι : Type*} {μ : ι → VectorMeasure X F} {s : Finset ι} + (h : ∀ i ∈ s, (μ i).Integrable f B) : + (∑ i ∈ s, μ i).Integrable f B := by + classical + induction s using Finset.induction_on with + | empty => simp + | insert a s ha ih => + simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, + Finset.sum_insert] at h ⊢ + exact integrable_add_vectorMeasure h.1 (ih h.2) + lemma Integrable.restrict (hf : μ.Integrable f B) {s : Set X} : (μ.restrict s).Integrable f B := by by_cases hs : MeasurableSet s @@ -407,77 +428,93 @@ theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure (μ.transpose B).vari exact (norm_nonneg _).trans hx simp [ENNReal.toReal_ofReal hC, Measure.real] -variable {ν : VectorMeasure X F} - -theorem integral_add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : +theorem integral_add_vectorMeasure {ν : VectorMeasure X F} + (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : ∫ᵛ x, f x ∂[B; (μ + ν)] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := by by_cases hG : CompleteSpace G; swap · simp [integral, setToFun, hG] + simp only [integral] have hfi := hμ.add_measure hν -/- have hμ_dfma : DominatedFinMeasAdditive (μ + ν) (weightedSMul μ : Set X → G →L[ℝ] G) 1 := - DominatedFinMeasAdditive.add_measure_right μ ν (dominatedFinMeasAdditive_weightedSMul μ) - zero_le_one - have hν_dfma : DominatedFinMeasAdditive (μ + ν) (weightedSMul ν : Set X → G →L[ℝ] G) 1 := - DominatedFinMeasAdditive.add_measure_left μ ν (dominatedFinMeasAdditive_weightedSMul ν) - zero_le_one-/ - rw [← setToFun_congr_measure_of_add_right hμ_dfma - (dominatedFinMeasAdditive_weightedSMul μ) f hfi, - ← setToFun_congr_measure_of_add_left hν_dfma (dominatedFinMeasAdditive_weightedSMul ν) f hfi] - refine setToFun_add_left' _ _ _ (fun s _ hμνs => ?_) f - rw [Measure.coe_add, Pi.add_apply, add_lt_top] at hμνs - rw [weightedSMul, weightedSMul, weightedSMul, ← add_smul, - measureReal_add_apply hμνs.1.ne hμνs.2.ne] - -#exit - -@[simp] -theorem integral_zero_vectorMeasure {m : MeasurableSpace X} (f : X → E) : - (∫ᵛ x, f x ∂(0 : Measure X)) = 0 := by - simp only [integral_eq_setToFun] - exact setToFun_measure_zero (dominatedFinMeasAdditive_weightedSMul _) rfl + have hμ_dfma : DominatedFinMeasAdditive ((μ.transpose B).variation + (ν.transpose B).variation) + (μ.transpose B) 1 := + DominatedFinMeasAdditive.add_measure_right (μ.transpose B).variation (ν.transpose B).variation + (dominatedFinMeasAdditive_cbmApplyMeasure μ B) zero_le_one + have hν_dfma : DominatedFinMeasAdditive ((μ.transpose B).variation + (ν.transpose B).variation) + (ν.transpose B) 1 := + DominatedFinMeasAdditive.add_measure_left (μ.transpose B).variation (ν.transpose B).variation + (dominatedFinMeasAdditive_cbmApplyMeasure ν B) zero_le_one + have hμν_dfma : DominatedFinMeasAdditive ((μ.transpose B).variation + (ν.transpose B).variation) + ((μ + ν).transpose B) 1 := by + apply DominatedFinMeasAdditive.of_measure_le _ + (dominatedFinMeasAdditive_cbmApplyMeasure (μ + ν) B) zero_le_one + grw [transpose_add, variation_add_le] + rw [← setToFun_congr_measure_of_add_right hμ_dfma _ f hfi, + ← setToFun_congr_measure_of_add_left hν_dfma _ f hfi, + ← setToFun_congr_measure_of_integrable 1 ENNReal.one_ne_top ?_ hμν_dfma + (dominatedFinMeasAdditive_cbmApplyMeasure (μ + ν) B) _ hfi] + · refine setToFun_add_left' _ _ _ (fun s hs hμνs => ?_) f + simp [transpose] + · grw [transpose_add, variation_add_le] + simp + +theorem setIntegral_measure_zero (f : X → E) {s : Set X} + (hs : (μ.transpose B).variation s = 0) : + ∫ᵛ x in s, f x ∂[B; μ] = 0 := by + by_cases h's : MeasurableSet s; swap + · simp [restrict_not_measurable μ h's] + have : ((μ.restrict s).transpose B).variation = 0 := by + rw [← restrict_transpose, variation_restrict _ h's] + apply Measure.restrict_eq_zero.2 hs + have : (μ.restrict s).transpose B = 0 := variation_eq_zero.1 this + simp [integral, this] + +lemma integral_of_isEmpty [IsEmpty X] : ∫ᵛ x, f x ∂[B; μ] = 0 := + μ.eq_zero_of_isEmpty ▸ integral_zero_vectorMeasure + +theorem integral_finsetSum_measure {ι : Type*} {μ : ι → VectorMeasure X F} + {s : Finset ι} (hf : ∀ i ∈ s, (μ i).Integrable f B) : + ∫ᵛ a, f a ∂[B; ∑ i ∈ s, μ i] = ∑ i ∈ s, ∫ᵛ a, f a ∂[B; μ i] := by + classical + induction s using Finset.induction_on with + | empty => simp + | insert a s ha ih => + simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, + Finset.sum_insert] at hf ⊢ + rw [integral_add_vectorMeasure hf.1 (integrable_finsetSum_vectorMeasure hf.2), ih hf.2] + +theorem nndist_integral_add_vectorMeasure_le_lintegral + (h₁ : μ.Integrable f B) (h₂ : ν.Integrable f B) : + (nndist (∫ᵛ x, f x ∂[B; μ]) (∫ᵛ x, f x ∂[B; (μ + ν)]) : ℝ≥0∞) ≤ + ∫⁻ x, ‖f x‖ₑ ∂(ν.transpose B).variation := by + rw [integral_add_vectorMeasure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel_left] + exact enorm_integral_le_lintegral_enorm _ -@[simp] -theorem setIntegral_measure_zero (f : X → E) {μ : Measure X} {s : Set X} (hs : μ s = 0) : - ∫ᵛ x in s, f x ∂[B; μ] = 0 := Measure.restrict_eq_zero.mpr hs ▸ integral_zero_measure f +#check setToFun_congr_smul_measure -lemma integral_of_isEmpty [IsEmpty X] {f : X → E} : ∫ᵛ x, f x ∂[B; μ] = 0 := - μ.eq_zero_of_isEmpty ▸ integral_zero_measure _ +instance glou {R : Type*} [Ring R] : SMul R R := by infer_instance -theorem integral_finsetSum_measure {ι} {m : MeasurableSpace X} {f : X → E} {μ : ι → Measure X} - {s : Finset ι} (hf : ∀ i ∈ s, Integrable f (μ i)) : - ∫ᵛ a, f a ∂(∑ i ∈ s, μ i) = ∑ i ∈ s, ∫ᵛ a, f a ∂[B; μ] i := by - induction s using Finset.cons_induction_on with - | empty => simp - | cons _ _ h ih => - rw [Finset.forall_mem_cons] at hf - rw [Finset.sum_cons, Finset.sum_cons, ← ih hf.2] - exact integral_add_measure hf.1 (integrable_finsetSum_measure.2 hf.2) - -@[deprecated (since := "2026-04-08")] -alias integral_finset_sum_measure := integral_finsetSum_measure - -theorem nndist_integral_add_measure_le_lintegral - {f : X → E} (h₁ : Integrable f μ) (h₂ : Integrable f ν) : - (nndist (∫ᵛ x, f x ∂[B; μ]) (∫ᵛ x, f x ∂(μ + ν)) : ℝ≥0∞) ≤ ∫⁻ x, ‖f x‖ₑ ∂ν := by - rw [integral_add_measure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel_left] - exact enorm_integral_le_lintegral_enorm _ +#print instSMulOfMul @[simp] -theorem integral_smul_measure (f : X → E) (c : ℝ≥0∞) : - ∫ᵛ x, f x ∂c • μ = c.toReal • ∫ᵛ x, f x ∂[B; μ] := by +theorem integral_smul_measure (f : X → E) (c : ℝ) : + ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := by by_cases hG : CompleteSpace G; swap - · simp [integral, hG] - -- First we consider the “degenerate” case `c = ∞` - rcases eq_or_ne c ∞ with (rfl | hc) - · rw [ENNReal.toReal_top, zero_smul, integral_eq_setToFun, setToFun_top_smul_measure] - -- Main case: `c ≠ ∞` - simp_rw [integral_eq_setToFun, ← setToFun_smul_left] + · simp [integral, setToFun, hG] + simp_rw [integral, ← setToFun_smul_left] + have : ((c • μ).transpose B).variation = (ENNReal.ofReal |c|) • (μ.transpose B).variation := by + + simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe, Real.norm_eq_abs, + mul_one] + have hdfma : DominatedFinMeasAdditive μ (weightedSMul (c • μ) : Set X → G →L[ℝ] G) c.toReal := mul_one c.toReal ▸ (dominatedFinMeasAdditive_weightedSMul (c • μ)).of_smul_measure hc have hdfma_smul := dominatedFinMeasAdditive_weightedSMul (F := G) (c • μ) rw [← setToFun_congr_smul_measure c hc hdfma hdfma_smul f] exact setToFun_congr_left' _ _ (fun s _ _ => weightedSMul_smul_measure μ c) f +#exit + + @[simp] theorem integral_smul_nnreal_measure (f : X → E) (c : ℝ≥0) : ∫ᵛ x, f x ∂(c • μ) = c • ∫ᵛ x, f x ∂[B; μ] := diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index 96c0b01e3af063..d65726b57b853d 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -6,6 +6,7 @@ Authors: Oliver Butterley, Yoh Tanimoto module public import Mathlib.MeasureTheory.VectorMeasure.Variation.Defs +public import Mathlib.Analysis.Normed.Module.Basic /-! # Properties of variation @@ -160,6 +161,15 @@ lemma variation_restrict_le (μ : VectorMeasure X V) (s : Set X) : · simp [variation_restrict μ hs] · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] +@[simp] lemma variation_eq_zero {μ : VectorMeasure X V} : + μ.variation = 0 ↔ μ = 0 := by + refine ⟨fun h ↦ ?_, fun h ↦ by simp [h]⟩ + ext s hs + apply enorm_eq_zero.1 + apply le_antisymm ?_ (by simp) + grw [enorm_measure_le_variation] + simp [h] + end Basic section NormedAddCommGroup @@ -178,6 +188,34 @@ lemma variation_neg : (-μ).variation = μ.variation := by simp [variation] lemma variation_sub_le : (μ - ν).variation ≤ μ.variation + ν.variation := by grw [sub_eq_add_neg, variation_add_le, variation_neg] +private lemma variation_smul_le {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : 𝕜} : + (c • μ).variation ≤ ‖c‖₊ • μ.variation := by + apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + simp only [coe_smul, Pi.smul_apply, enorm_smul, Measure.smul_apply, Measure.nnreal_smul_coe_apply] + grw [enorm_measure_le_variation] + exact le_rfl + +open scoped NNReal +lemma foo (u v : Measure X) (c : ℝ≥0) (h : u ≤ v) : c • u ≤ c • v := by + apply smul_mono_right + +lemma variation_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : 𝕜} : + (c • μ).variation = ‖c‖₊ • μ.variation := by + apply le_antisymm variation_smul_le ?_ + rcases eq_or_ne c 0 with rfl | hc + · simp + calc ‖c‖₊ • μ.variation + _ = ‖c‖₊ • (c⁻¹ • (c • μ)).variation := by simp [smul_smul, inv_mul_cancel₀ hc] + _ ≤ ‖c‖₊ • ‖c⁻¹‖₊ • (c • μ).variation := by + apply Measure.smul_mono + + + --rw [show μ = c⁻¹ • (c • μ) by simp [smul_smul, inv_mul_cancel₀ hc]] + --calc + +#exit + + end NormedAddCommGroup end MeasureTheory.VectorMeasure From 66fdb5aa9aa66117fbafafbafacd91419f6e83c9 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 15 May 2026 19:39:19 +0200 Subject: [PATCH 024/129] revert --- Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean index cdd62d9bcc1e07..f20efe7851731b 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/Defs.lean @@ -572,10 +572,4 @@ instance IsRightCancelMul.mulRightReflectLE_of_mulRightReflectLT le_of_mul_le_mul_right' := contravariant_le_iff_contravariant_lt_and_eq N N _ |>.mpr ⟨‹MulRightReflectLT N›.elim, fun _ ↦ mul_right_cancel⟩ _ -instance [Mul M] [LE M] [h : MulLeftMono M] : - CovariantClass M M (· • ·) (· ≤ ·) := h - -instance [Mul M] [LE M] [h : MulRightMono M] : - CovariantClass M M (swap (· • ·)) (· ≤ ·) := h - end Variants From 297b4c6daaabda527f8a3e890aeffb54fb3911f8 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 15 May 2026 20:05:56 +0200 Subject: [PATCH 025/129] better --- Mathlib/Data/ENNReal/Action.lean | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Mathlib/Data/ENNReal/Action.lean b/Mathlib/Data/ENNReal/Action.lean index d6ba39d13c1c4c..431d6397d5b04d 100644 --- a/Mathlib/Data/ENNReal/Action.lean +++ b/Mathlib/Data/ENNReal/Action.lean @@ -104,6 +104,12 @@ instance : PosSMulStrictMono ℝ≥0 ℝ≥0∞ where instance : SMulPosMono ℝ≥0 ℝ≥0∞ where smul_le_smul_of_nonneg_right _r _ _a _b hab := _root_.mul_le_mul_left (coe_le_coe.2 hab) _ +instance : CovariantClass ℝ≥0∞ ℝ≥0∞ (· • ·) (· ≤ ·) := + inferInstanceAs <| CovariantClass ℝ≥0∞ ℝ≥0∞ (· * ·) (· ≤ ·) + +instance : CovariantClass ℝ≥0 ℝ≥0∞ (· • ·) (· ≤ ·) := + ⟨fun x x y hxy ↦ by simpa [ENNReal.smul_def] using mul_le_mul_right hxy _⟩ + end Actions end ENNReal From 7332909ae64894b01949d27bbfc64d295e16eb24 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 15 May 2026 20:32:12 +0200 Subject: [PATCH 026/129] better --- .../VectorMeasure/Variation/Basic.lean | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index d65726b57b853d..ab349be0b5110e 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -195,10 +195,6 @@ private lemma variation_smul_le {𝕜 : Type*} [NormedField 𝕜] [NormedSpace grw [enorm_measure_le_variation] exact le_rfl -open scoped NNReal -lemma foo (u v : Measure X) (c : ℝ≥0) (h : u ≤ v) : c • u ≤ c • v := by - apply smul_mono_right - lemma variation_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : 𝕜} : (c • μ).variation = ‖c‖₊ • μ.variation := by apply le_antisymm variation_smul_le ?_ @@ -207,14 +203,10 @@ lemma variation_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : calc ‖c‖₊ • μ.variation _ = ‖c‖₊ • (c⁻¹ • (c • μ)).variation := by simp [smul_smul, inv_mul_cancel₀ hc] _ ≤ ‖c‖₊ • ‖c⁻¹‖₊ • (c • μ).variation := by - apply Measure.smul_mono - - - --rw [show μ = c⁻¹ • (c • μ) by simp [smul_smul, inv_mul_cancel₀ hc]] - --calc - -#exit - + gcongr + exact variation_smul_le + _ = (c • μ).variation := by + simp [smul_smul, mul_inv_cancel₀ (nnnorm_ne_zero_iff.mpr hc)] end NormedAddCommGroup From cc2a0fe596f21d5840d8b21096d1528c1866ad1a Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 15 May 2026 22:20:44 +0200 Subject: [PATCH 027/129] better --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 6 +++ .../MeasureTheory/VectorMeasure/Basic.lean | 14 ++++--- .../MeasureTheory/VectorMeasure/Integral.lean | 38 ++++++++----------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 25f4355b229a44..bcbc8cb260ec31 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -1050,6 +1050,12 @@ theorem setToFun_congr_smul_measure (c : ℝ≥0∞) (hc_ne_top : c ≠ ∞) · simp [hc0] · rw [smul_smul, ENNReal.inv_mul_cancel hc0 hc_ne_top, one_smul] +theorem setToFun_congr_smul_measure' (c : ℝ≥0) + (hT : DominatedFinMeasAdditive μ T C) (hT_smul : DominatedFinMeasAdditive (c • μ) T C') + (f : α → E) : setToFun μ T hT f = setToFun (c • μ) T hT_smul f := by + rw! [ENNReal.smul_def] + apply setToFun_congr_smul_measure _ (by simp) + theorem norm_setToFun_le_mul_norm (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) (hC : 0 ≤ C) : ‖setToFun μ T hT f‖ ≤ C * ‖f‖ := by by_cases hF : CompleteSpace F; swap diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index 2f1828f1a2ef57..7017901b02b264 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -642,17 +642,21 @@ end ContinuousAdd section Module variable {R : Type*} [Semiring R] [Module R M] [Module R N] -variable [ContinuousAdd M] [ContinuousAdd N] [ContinuousConstSMul R M] [ContinuousConstSMul R N] + +variable [ContinuousConstSMul R M] [ContinuousConstSMul R N] + +theorem mapRange_smul {v : VectorMeasure α M} {f : M →ₗ[R] N} (hf : Continuous f) {c : R} : + (c • v).mapRange f.toAddMonoidHom hf = c • (v.mapRange f.toAddMonoidHom hf) := by + ext; simp + +variable [ContinuousAdd M] [ContinuousAdd N] /-- Given a continuous linear map `f : M → N`, `mapRangeₗ` is the linear map mapping the vector measure `v` on `M` to the vector measure `f ∘ v` on `N`. -/ def mapRangeₗ (f : M →ₗ[R] N) (hf : Continuous f) : VectorMeasure α M →ₗ[R] VectorMeasure α N where toFun v := v.mapRange f.toAddMonoidHom hf map_add' _ _ := mapRange_add hf - map_smul' := by - intros - ext - simp + map_smul' _ _ := mapRange_smul hf end Module diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index c07e89b32c1293..ff45450b5a4907 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -62,7 +62,7 @@ unconditionally convergent. public section open Set MeasureTheory VectorMeasure ContinuousLinearMap Filter Topology -open scoped ENNReal +open scoped ENNReal NNReal variable {X E F G : Type*} {mX : MeasurableSpace X} [NormedAddCommGroup E] [NormedSpace ℝ E] @@ -130,6 +130,10 @@ lemma transpose_add (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) (μ + ν).transpose B = μ.transpose B + ν.transpose B := by simp [transpose] +lemma transpose_smul (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) (c : ℝ) : + (c • μ).transpose B = c • μ.transpose B := by + simp [transpose, mapRange_smul] + lemma variation_transpose_le (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : (μ.transpose B).variation ≤ ‖B‖₊ • μ.variation := by apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) @@ -489,36 +493,26 @@ theorem nndist_integral_add_vectorMeasure_le_lintegral rw [integral_add_vectorMeasure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel_left] exact enorm_integral_le_lintegral_enorm _ -#check setToFun_congr_smul_measure - -instance glou {R : Type*} [Ring R] : SMul R R := by infer_instance - -#print instSMulOfMul - @[simp] theorem integral_smul_measure (f : X → E) (c : ℝ) : ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := by by_cases hG : CompleteSpace G; swap · simp [integral, setToFun, hG] simp_rw [integral, ← setToFun_smul_left] - have : ((c • μ).transpose B).variation = (ENNReal.ofReal |c|) • (μ.transpose B).variation := by - - simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe, Real.norm_eq_abs, - mul_one] - - have hdfma : DominatedFinMeasAdditive μ (weightedSMul (c • μ) : Set X → G →L[ℝ] G) c.toReal := - mul_one c.toReal ▸ (dominatedFinMeasAdditive_weightedSMul (c • μ)).of_smul_measure hc - have hdfma_smul := dominatedFinMeasAdditive_weightedSMul (F := G) (c • μ) - rw [← setToFun_congr_smul_measure c hc hdfma hdfma_smul f] - exact setToFun_congr_left' _ _ (fun s _ _ => weightedSMul_smul_measure μ c) f - -#exit - + have : ((c • μ).transpose B).variation = ‖c‖₊ • (μ.transpose B).variation := by + simp [transpose, mapRange_smul, variation_smul] + simp only [this, mul_one] + have : DominatedFinMeasAdditive (μ.transpose B).variation ((c • μ).transpose B) ‖c‖ := by + simp only [transpose_smul, coe_smul, Real.norm_eq_abs] + simpa [← transpose_eq_cbmApplyMeasure] using + (dominatedFinMeasAdditive_cbmApplyMeasure μ B).smul c + rw! [← setToFun_congr_smul_measure' _ this, transpose_smul] + rfl @[simp] theorem integral_smul_nnreal_measure (f : X → E) (c : ℝ≥0) : - ∫ᵛ x, f x ∂(c • μ) = c • ∫ᵛ x, f x ∂[B; μ] := - integral_smul_measure f (c : ℝ≥0∞) + ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := + integral_smul_measure f (c : ℝ) theorem integral_map_of_stronglyMeasurable {β} [MeasurableSpace β] {φ : X → β} (hφ : Measurable φ) {f : β → G} (hfm : StronglyMeasurable f) : ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ x, f (φ x) ∂[B; μ] := by From 5a3c3dc4798e912d0865db7dcb769a3d717670f8 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 18 May 2026 09:53:17 +0200 Subject: [PATCH 028/129] start more --- Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean | 10 ++++++---- Mathlib/MeasureTheory/Integral/SetToL1.lean | 10 ++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean b/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean index b66d004a181cf4..85ca8e554a0206 100644 --- a/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean +++ b/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean @@ -364,6 +364,8 @@ end SimpleFuncProperties end SimpleFunc +open SimpleFunc + /-! Construction of the space of `Lp` simple functions, and its dense embedding into `Lp`. -/ @@ -466,7 +468,7 @@ attribute [local instance] simpleFunc.module simpleFunc.normedSpace simpleFunc.i section ToLp /-- Construct the equivalence class `[f]` of a simple function `f` satisfying `MemLp`. -/ -abbrev toLp (f : α →ₛ E) (hf : MemLp f p μ) : Lp.simpleFunc E p μ := +abbrev _root_.MeasureTheory.SimpleFunc.toLp (f : α →ₛ E) (hf : MemLp f p μ) : Lp.simpleFunc E p μ := ⟨hf.toLp f, ⟨f, rfl⟩⟩ theorem toLp_eq_toLp (f : α →ₛ E) (hf : MemLp f p μ) : (toLp f hf : Lp E p μ) = hf.toLp f := @@ -621,8 +623,8 @@ protected theorem induction (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) {P : Lp.s ∀ hf : MemLp f p μ, ∀ hg : MemLp g p μ, Disjoint (support f) (support g) → - P (Lp.simpleFunc.toLp f hf) → - P (Lp.simpleFunc.toLp g hg) → P (Lp.simpleFunc.toLp f hf + Lp.simpleFunc.toLp g hg)) + P (toLp f hf) → + P (toLp g hg) → P (toLp f hf + toLp g hg)) (f : Lp.simpleFunc E p μ) : P f := by suffices ∀ f : α →ₛ E, ∀ hf : MemLp f p μ, P (toLp f hf) by rw [← toLp_toSimpleFunc f] @@ -908,7 +910,7 @@ section Integrable notation:25 α " →₁ₛ[" μ "] " E => @MeasureTheory.Lp.simpleFunc α E _ _ 1 μ theorem L1.SimpleFunc.toLp_one_eq_toL1 (f : α →ₛ E) (hf : Integrable f μ) : - (Lp.simpleFunc.toLp f (memLp_one_iff_integrable.2 hf) : α →₁[μ] E) = hf.toL1 f := + (toLp f (memLp_one_iff_integrable.2 hf) : α →₁[μ] E) = hf.toL1 f := rfl @[fun_prop] diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index bcbc8cb260ec31..c5d0ef6af1cef2 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -827,6 +827,16 @@ theorem setToFun_const [CompleteSpace F] [IsFiniteMeasure μ] rw [this] exact setToFun_indicator_const hT MeasurableSet.univ (measure_ne_top _ _) x +theorem setToFun_simpleFunc [CompleteSpace F] (hT : DominatedFinMeasAdditive μ T C) + (f : SimpleFunc α E) (hf : Integrable f μ) : + setToFun μ T hT f = ∑ x ∈ f.range, T (f ⁻¹' {x}) x := by + have : MemLp f 1 μ := memLp_one_iff_integrable.mpr hf + let g := Lp.simpleFunc.toLp f this + + + +#exit + section Order variable {G' G'' : Type*} From 2a1c4a94152d383fdcbf76cbc32ca3b9fcb2f0da Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 18 May 2026 14:29:50 +0200 Subject: [PATCH 029/129] progress --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index c5d0ef6af1cef2..70933d7068c2e9 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -830,12 +830,16 @@ theorem setToFun_const [CompleteSpace F] [IsFiniteMeasure μ] theorem setToFun_simpleFunc [CompleteSpace F] (hT : DominatedFinMeasAdditive μ T C) (f : SimpleFunc α E) (hf : Integrable f μ) : setToFun μ T hT f = ∑ x ∈ f.range, T (f ⁻¹' {x}) x := by - have : MemLp f 1 μ := memLp_one_iff_integrable.mpr hf - let g := Lp.simpleFunc.toLp f this + have h'f : MemLp f 1 μ := memLp_one_iff_integrable.mpr hf + let g := f.toLp h'f + have A : f =ᵐ[μ] g := h'f.coeFn_toLp.symm + rw [setToFun_congr_ae hT A, L1.setToFun_eq_setToL1 hT, L1.setToL1_eq_setToL1SCLM] + simp [L1.SimpleFunc.setToL1SCLM, L1.SimpleFunc.setToL1S] + apply (SimpleFunc.setToSimpleFunc_congr T _ _ hf _).symm + sorry -#exit section Order From fc6cc139ba77fd1d916c8d30ae6f0d513638add1 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Mon, 18 May 2026 14:48:01 +0200 Subject: [PATCH 030/129] more --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 70933d7068c2e9..d2e00d2468b59d 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -835,8 +835,12 @@ theorem setToFun_simpleFunc [CompleteSpace F] (hT : DominatedFinMeasAdditive μ have A : f =ᵐ[μ] g := h'f.coeFn_toLp.symm rw [setToFun_congr_ae hT A, L1.setToFun_eq_setToL1 hT, L1.setToL1_eq_setToL1SCLM] simp [L1.SimpleFunc.setToL1SCLM, L1.SimpleFunc.setToL1S] - apply (SimpleFunc.setToSimpleFunc_congr T _ _ hf _).symm - sorry + apply (SimpleFunc.setToSimpleFunc_congr T (fun s ↦ hT.eq_zero_of_measure_zero) hT.1 hf _).symm + grw [A] + symm + + +#exit From e12d65be72e5c5d0dbcc042ed3fcdd09a5f44099 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 18 May 2026 19:06:25 +0200 Subject: [PATCH 031/129] store --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 7 ++++ .../MeasureTheory/VectorMeasure/Integral.lean | 41 ++++++++++++++----- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index bcbc8cb260ec31..b66fc836b0eab0 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -827,6 +827,13 @@ theorem setToFun_const [CompleteSpace F] [IsFiniteMeasure μ] rw [this] exact setToFun_indicator_const hT MeasurableSet.univ (measure_ne_top _ _) x +theorem setToFun_simpleFunc [CompleteSpace F] (hT : DominatedFinMeasAdditive μ T C) + (f : SimpleFunc α E) : + setToFun μ T hT f = ∑ x ∈ f.range, T (f ⁻¹' {x}) x := by + + +#exit + section Order variable {G' G'' : Type*} diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index ff45450b5a4907..9cd04a20c7a341 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -514,19 +514,36 @@ theorem integral_smul_nnreal_measure (f : X → E) (c : ℝ≥0) : ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := integral_smul_measure f (c : ℝ) -theorem integral_map_of_stronglyMeasurable {β} [MeasurableSpace β] {φ : X → β} (hφ : Measurable φ) - {f : β → G} (hfm : StronglyMeasurable f) : ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ x, f (φ x) ∂[B; μ] := by +open TopologicalSpace + +theorem Integrable.map {β : Type*} [MeasurableSpace β] {φ : X → β} (hφ : Measurable φ) + {f : β → E} (hfm : StronglyMeasurable f) (h : μ.Integrable (f ∘ φ) B) : + (μ.map φ).Integrable f B := by + simp_rw [VectorMeasure.Integrable] at h ⊢ + apply ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).2 h).mono_measure + apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe, + Measure.map_apply hφ hs] + apply le_trans ?_ (enorm_measure_le_variation _ _) + simp [VectorMeasure.map_apply _ hφ hs] + +#check SimpleFunc + +theorem integral_map_of_stronglyMeasurable {β : Type*} [MeasurableSpace β] + {φ : X → β} (hφ : Measurable φ) {f : β → E} (hfm : StronglyMeasurable f) + (hfi' : μ.Integrable (f ∘ φ) B) : + ∫ᵛ y, f y ∂[B; μ.map φ] = ∫ᵛ x, f (φ x) ∂[B; μ] := by by_cases hG : CompleteSpace G; swap - · simp [integral, hG] - by_cases hfi : Integrable f (Measure.map φ μ); swap - · rw [integral_undef hfi, integral_undef] - exact fun hfφ => hfi ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).2 hfφ) - borelize G - have : SeparableSpace (range f ∪ {0} : Set G) := hfm.separableSpace_range_union_singleton + · simp [integral, setToFun, hG] + have hfi : (μ.map φ).Integrable f B := hfi'.map hφ hfm + borelize E + have : SeparableSpace (range f ∪ {0} : Set E) := hfm.separableSpace_range_union_singleton refine tendsto_nhds_unique - (tendsto_integral_approxOn_of_measurable_of_range_subset hfm.measurable hfi _ Subset.rfl) ?_ - convert tendsto_integral_approxOn_of_measurable_of_range_subset (hfm.measurable.comp hφ) - ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).1 hfi) (range f ∪ {0}) + (tendsto_setToFun_approxOn_of_measurable_of_range_subset + ((dominatedFinMeasAdditive_cbmApplyMeasure (μ.map φ) B)) hfm.measurable hfi _ Subset.rfl) ?_ + convert tendsto_setToFun_approxOn_of_measurable_of_range_subset + (dominatedFinMeasAdditive_cbmApplyMeasure μ B) + (hfm.measurable.comp hφ) hfi' (range f ∪ {0}) (union_subset_union_left {0} (range_comp_subset_range φ f)) using 1 ext1 i simp only [SimpleFunc.integral_eq, hφ, SimpleFunc.measurableSet_preimage, map_measureReal_apply, @@ -536,6 +553,8 @@ theorem integral_map_of_stronglyMeasurable {β} [MeasurableSpace β] {φ : X → rw [hy] simp +#exit + theorem integral_map {β} [MeasurableSpace β] {φ : X → β} (hφ : AEMeasurable φ μ) {f : β → G} (hfm : AEStronglyMeasurable f (Measure.map φ μ)) : ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ x, f (φ x) ∂[B; μ] := From 664e066d8efdb79ea0bd7a34d6055b972c6eb70b Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 19 May 2026 08:14:49 +0200 Subject: [PATCH 032/129] better --- .../MeasureTheory/VectorMeasure/Integral.lean | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 9cd04a20c7a341..cef99b9feb1a30 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -527,8 +527,6 @@ theorem Integrable.map {β : Type*} [MeasurableSpace β] {φ : X → β} (hφ : apply le_trans ?_ (enorm_measure_le_variation _ _) simp [VectorMeasure.map_apply _ hφ hs] -#check SimpleFunc - theorem integral_map_of_stronglyMeasurable {β : Type*} [MeasurableSpace β] {φ : X → β} (hφ : Measurable φ) {f : β → E} (hfm : StronglyMeasurable f) (hfi' : μ.Integrable (f ∘ φ) B) : @@ -542,12 +540,18 @@ theorem integral_map_of_stronglyMeasurable {β : Type*} [MeasurableSpace β] (tendsto_setToFun_approxOn_of_measurable_of_range_subset ((dominatedFinMeasAdditive_cbmApplyMeasure (μ.map φ) B)) hfm.measurable hfi _ Subset.rfl) ?_ convert tendsto_setToFun_approxOn_of_measurable_of_range_subset - (dominatedFinMeasAdditive_cbmApplyMeasure μ B) - (hfm.measurable.comp hφ) hfi' (range f ∪ {0}) + (dominatedFinMeasAdditive_cbmApplyMeasure μ B) (hfm.measurable.comp hφ) hfi' (range f ∪ {0}) (union_subset_union_left {0} (range_comp_subset_range φ f)) using 1 - ext1 i - simp only [SimpleFunc.integral_eq, hφ, SimpleFunc.measurableSet_preimage, map_measureReal_apply, - ← preimage_comp] + ext i : 1 + rw [setToFun_simpleFunc _ _ (SimpleFunc.integrable_approxOn_range _ hfi _), + setToFun_simpleFunc]; swap + · apply SimpleFunc.integrable_approxOn _ hfi' (by simp) (by simp) + rw [SimpleFunc.approxOn_comp hfm.measurable hφ] + simp [cbmApplyMeasure] + +#exit + + refine (Finset.sum_subset (SimpleFunc.range_comp_subset_range _ hφ) fun y _ hy => ?_).symm rw [SimpleFunc.mem_range, ← Set.preimage_singleton_eq_empty, SimpleFunc.coe_comp] at hy rw [hy] From d8c0095a29fb4f3dd64106c659eb09f1f044cdb6 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 19 May 2026 08:54:41 +0200 Subject: [PATCH 033/129] move --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 756792ced70e21..79fe2ecf4cd49a 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -942,6 +942,37 @@ theorem tendsto_setToFun_approxOn_of_measurable_of_range_subset refine tendsto_setToFun_approxOn_of_measurable hT hf fmeas ?_ _ (integrable_zero _ _ _) exact Eventually.of_forall fun x => subset_closure (hs (Set.mem_union_left _ (mem_range_self _))) + +#where + +theorem setToFun_map (hT : DominatedFinMeasAdditive μ T C) {β : Type*} {_ : MeasurableSpace β} + {μ' : Measure β} {φ : α → β} {T' : Set β → E →L[ℝ] F} (hT' : DominatedFinMeasAdditive μ' T' C') + {f : β → E} (hf : Integrable (f ∘ φ) μ) (hfm : StronglyMeasurable f) (hφ : Measurable φ) + (hμ' : μ' ≤ μ.map φ) + (h : ∀ (s : Set β) (x : E), MeasurableSet s → T' s x = T (φ⁻¹' s) x) : + setToFun μ' T' hT' f = setToFun μ T hT (f ∘ φ) := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] + have : Integrable f μ' := + ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).2 hf).mono_measure hμ' + borelize E + have : SeparableSpace (range f ∪ {0} : Set E) := hfm.separableSpace_range_union_singleton + refine tendsto_nhds_unique + (tendsto_setToFun_approxOn_of_measurable_of_range_subset + hT' hfm.measurable ?_ _ Subset.rfl) ?_ + convert tendsto_setToFun_approxOn_of_measurable_of_range_subset + (dominatedFinMeasAdditive_cbmApplyMeasure μ B) (hfm.measurable.comp hφ) hfi' (range f ∪ {0}) + (union_subset_union_left {0} (range_comp_subset_range φ f)) using 1 + ext i : 1 + rw [setToFun_simpleFunc _ _ (SimpleFunc.integrable_approxOn_range _ hfi _), + setToFun_simpleFunc]; swap + · apply SimpleFunc.integrable_approxOn _ hfi' (by simp) (by simp) + rw [SimpleFunc.approxOn_comp hfm.measurable hφ] + simp [cbmApplyMeasure] + + +#exit + /-- Auxiliary lemma for `setToFun_congr_measure`: the function sending `f : α →₁[μ] G` to `f : α →₁[μ'] G` is continuous when `μ' ≤ c' • μ` for `c' ≠ ∞`. -/ theorem continuous_L1_toL1 {μ' : Measure α} (c' : ℝ≥0∞) (hc' : c' ≠ ∞) (hμ'_le : μ' ≤ c' • μ) : From 7d1992776b8eb616971faaf53eba81538c174239 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 19 May 2026 14:26:18 +0200 Subject: [PATCH 034/129] complete proof --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 29 +++++++++------------ 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 79fe2ecf4cd49a..ba43acd0af1be9 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -942,36 +942,33 @@ theorem tendsto_setToFun_approxOn_of_measurable_of_range_subset refine tendsto_setToFun_approxOn_of_measurable hT hf fmeas ?_ _ (integrable_zero _ _ _) exact Eventually.of_forall fun x => subset_closure (hs (Set.mem_union_left _ (mem_range_self _))) - -#where - -theorem setToFun_map (hT : DominatedFinMeasAdditive μ T C) {β : Type*} {_ : MeasurableSpace β} +theorem setToFun_of_le_map (hT : DominatedFinMeasAdditive μ T C) {β : Type*} {_ : MeasurableSpace β} {μ' : Measure β} {φ : α → β} {T' : Set β → E →L[ℝ] F} (hT' : DominatedFinMeasAdditive μ' T' C') {f : β → E} (hf : Integrable (f ∘ φ) μ) (hfm : StronglyMeasurable f) (hφ : Measurable φ) (hμ' : μ' ≤ μ.map φ) - (h : ∀ (s : Set β) (x : E), MeasurableSet s → T' s x = T (φ⁻¹' s) x) : + (h : ∀ (s : Set β) (x : E), MeasurableSet s → T' s x = T (φ ⁻¹' s) x) : setToFun μ' T' hT' f = setToFun μ T hT (f ∘ φ) := by by_cases hF : CompleteSpace F; swap · simp [setToFun, hF] - have : Integrable f μ' := + have hfi' : Integrable f μ' := ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).2 hf).mono_measure hμ' borelize E have : SeparableSpace (range f ∪ {0} : Set E) := hfm.separableSpace_range_union_singleton refine tendsto_nhds_unique (tendsto_setToFun_approxOn_of_measurable_of_range_subset - hT' hfm.measurable ?_ _ Subset.rfl) ?_ + hT' hfm.measurable hfi' _ Subset.rfl) ?_ convert tendsto_setToFun_approxOn_of_measurable_of_range_subset - (dominatedFinMeasAdditive_cbmApplyMeasure μ B) (hfm.measurable.comp hφ) hfi' (range f ∪ {0}) + hT (hfm.measurable.comp hφ) hf (range f ∪ {0}) (union_subset_union_left {0} (range_comp_subset_range φ f)) using 1 ext i : 1 - rw [setToFun_simpleFunc _ _ (SimpleFunc.integrable_approxOn_range _ hfi _), - setToFun_simpleFunc]; swap - · apply SimpleFunc.integrable_approxOn _ hfi' (by simp) (by simp) - rw [SimpleFunc.approxOn_comp hfm.measurable hφ] - simp [cbmApplyMeasure] - - -#exit + rw [setToFun_simpleFunc _ _ (SimpleFunc.integrable_approxOn_range _ hfi' _), + setToFun_simpleFunc, SimpleFunc.approxOn_comp hfm.measurable hφ]; swap + · apply SimpleFunc.integrable_approxOn _ hf (by simp) (by simp) + simp only [union_singleton, SimpleFunc.measurableSet_preimage, h, ← preimage_comp, + SimpleFunc.coe_comp] + refine (Finset.sum_subset (SimpleFunc.range_comp_subset_range _ hφ) fun y _ hy => ?_).symm + rw [SimpleFunc.mem_range, ← Set.preimage_singleton_eq_empty, SimpleFunc.coe_comp] at hy + simp [hy, hT.1.map_empty_eq_zero] /-- Auxiliary lemma for `setToFun_congr_measure`: the function sending `f : α →₁[μ] G` to `f : α →₁[μ'] G` is continuous when `μ' ≤ c' • μ` for `c' ≠ ∞`. -/ From ebd64b9177566ee57ac1602095cffad54e00f301 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 19 May 2026 16:11:05 +0200 Subject: [PATCH 035/129] try --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 20 ++++- .../MeasureTheory/VectorMeasure/Integral.lean | 78 +++++++------------ 2 files changed, 47 insertions(+), 51 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index ba43acd0af1be9..feea970864dc96 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -942,7 +942,8 @@ theorem tendsto_setToFun_approxOn_of_measurable_of_range_subset refine tendsto_setToFun_approxOn_of_measurable hT hf fmeas ?_ _ (integrable_zero _ _ _) exact Eventually.of_forall fun x => subset_closure (hs (Set.mem_union_left _ (mem_range_self _))) -theorem setToFun_of_le_map (hT : DominatedFinMeasAdditive μ T C) {β : Type*} {_ : MeasurableSpace β} +theorem setToFun_of_le_map_of_stronglyMeasurable + (hT : DominatedFinMeasAdditive μ T C) {β : Type*} {_ : MeasurableSpace β} {μ' : Measure β} {φ : α → β} {T' : Set β → E →L[ℝ] F} (hT' : DominatedFinMeasAdditive μ' T' C') {f : β → E} (hf : Integrable (f ∘ φ) μ) (hfm : StronglyMeasurable f) (hφ : Measurable φ) (hμ' : μ' ≤ μ.map φ) @@ -970,6 +971,23 @@ theorem setToFun_of_le_map (hT : DominatedFinMeasAdditive μ T C) {β : Type*} { rw [SimpleFunc.mem_range, ← Set.preimage_singleton_eq_empty, SimpleFunc.coe_comp] at hy simp [hy, hT.1.map_empty_eq_zero] +theorem setToFun_of_le_map + (hT : DominatedFinMeasAdditive μ T C) {β : Type*} {_ : MeasurableSpace β} + {μ' : Measure β} {φ : α → β} {T' : Set β → E →L[ℝ] F} (hT' : DominatedFinMeasAdditive μ' T' C') + {f : β → E} (hf : Integrable (f ∘ φ) μ) (hfm : AEStronglyMeasurable f (μ.map φ)) + (hφ : Measurable φ) (hμ' : μ' ≤ μ.map φ) + (h : ∀ (s : Set β) (x : E), MeasurableSet s → T' s x = T (φ ⁻¹' s) x) : + setToFun μ' T' hT' f = setToFun μ T hT (f ∘ φ) := by + let g := hfm.mk + have A : setToFun μ' T' hT' f = setToFun μ' T' hT' g := + setToFun_congr_ae _ (ae_mono hμ' hfm.ae_eq_mk) + have B : setToFun μ T hT (f ∘ φ) = setToFun μ T hT (g ∘ φ) := by + apply setToFun_congr_ae + exact ae_of_ae_map hφ.aemeasurable hfm.ae_eq_mk + rw [A, B] + exact setToFun_of_le_map_of_stronglyMeasurable _ _ + (hf.congr (ae_of_ae_map hφ.aemeasurable hfm.ae_eq_mk)) hfm.stronglyMeasurable_mk hφ hμ' h + /-- Auxiliary lemma for `setToFun_congr_measure`: the function sending `f : α →₁[μ] G` to `f : α →₁[μ'] G` is continuous when `μ' ≤ c' • μ` for `c' ≠ ∞`. -/ theorem continuous_L1_toL1 {μ' : Measure α} (c' : ℝ≥0∞) (hc' : c' ≠ ∞) (hμ'_le : μ' ≤ c' • μ) : diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index cef99b9feb1a30..45b12c50a61464 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -516,68 +516,46 @@ theorem integral_smul_nnreal_measure (f : X → E) (c : ℝ≥0) : open TopologicalSpace -theorem Integrable.map {β : Type*} [MeasurableSpace β] {φ : X → β} (hφ : Measurable φ) - {f : β → E} (hfm : StronglyMeasurable f) (h : μ.Integrable (f ∘ φ) B) : - (μ.map φ).Integrable f B := by - simp_rw [VectorMeasure.Integrable] at h ⊢ - apply ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).2 h).mono_measure +lemma variation_transpose_map_le {β : Type*} [MeasurableSpace β] {φ : X → β} : + ((μ.map φ).transpose B).variation ≤ Measure.map φ (μ.transpose B).variation := by + by_cases hφ : Measurable φ; swap + · simp [VectorMeasure.map, hφ, transpose, Measure.zero_le] apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe, Measure.map_apply hφ hs] apply le_trans ?_ (enorm_measure_le_variation _ _) simp [VectorMeasure.map_apply _ hφ hs] -theorem integral_map_of_stronglyMeasurable {β : Type*} [MeasurableSpace β] - {φ : X → β} (hφ : Measurable φ) {f : β → E} (hfm : StronglyMeasurable f) +theorem Integrable.map {β : Type*} [MeasurableSpace β] {φ : X → β} + {f : β → E} (hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ)) + (h : μ.Integrable (f ∘ φ) B) : + (μ.map φ).Integrable f B := by + by_cases hφ : Measurable φ; swap + · simp [VectorMeasure.map, hφ] + simp_rw [VectorMeasure.Integrable] at h ⊢ + apply ((integrable_map_measure hfm hφ.aemeasurable).2 h).mono_measure + apply variation_transpose_map_le + +theorem integral_map {β : Type*} [MeasurableSpace β] + {φ : X → β} (hφ : Measurable φ) {f : β → E} + (hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ)) (hfi' : μ.Integrable (f ∘ φ) B) : ∫ᵛ y, f y ∂[B; μ.map φ] = ∫ᵛ x, f (φ x) ∂[B; μ] := by - by_cases hG : CompleteSpace G; swap - · simp [integral, setToFun, hG] - have hfi : (μ.map φ).Integrable f B := hfi'.map hφ hfm - borelize E - have : SeparableSpace (range f ∪ {0} : Set E) := hfm.separableSpace_range_union_singleton - refine tendsto_nhds_unique - (tendsto_setToFun_approxOn_of_measurable_of_range_subset - ((dominatedFinMeasAdditive_cbmApplyMeasure (μ.map φ) B)) hfm.measurable hfi _ Subset.rfl) ?_ - convert tendsto_setToFun_approxOn_of_measurable_of_range_subset - (dominatedFinMeasAdditive_cbmApplyMeasure μ B) (hfm.measurable.comp hφ) hfi' (range f ∪ {0}) - (union_subset_union_left {0} (range_comp_subset_range φ f)) using 1 - ext i : 1 - rw [setToFun_simpleFunc _ _ (SimpleFunc.integrable_approxOn_range _ hfi _), - setToFun_simpleFunc]; swap - · apply SimpleFunc.integrable_approxOn _ hfi' (by simp) (by simp) - rw [SimpleFunc.approxOn_comp hfm.measurable hφ] - simp [cbmApplyMeasure] - -#exit - - - refine (Finset.sum_subset (SimpleFunc.range_comp_subset_range _ hφ) fun y _ hy => ?_).symm - rw [SimpleFunc.mem_range, ← Set.preimage_singleton_eq_empty, SimpleFunc.coe_comp] at hy - rw [hy] - simp - -#exit + apply setToFun_of_le_map _ _ hfi' hfm hφ variation_transpose_map_le + intro s x hs + simp [hs, VectorMeasure.map, transpose, hφ] -theorem integral_map {β} [MeasurableSpace β] {φ : X → β} (hφ : AEMeasurable φ μ) {f : β → G} - (hfm : AEStronglyMeasurable f (Measure.map φ μ)) : - ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ x, f (φ x) ∂[B; μ] := - let g := hfm.mk f - calc - ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ y, g y ∂Measure.map φ μ := integral_congr_ae hfm.ae_eq_mk - _ = ∫ᵛ y, g y ∂Measure.map (hφ.mk φ) μ := by congr 1; exact Measure.map_congr hφ.ae_eq_mk - _ = ∫ᵛ x, g (hφ.mk φ x) ∂[B; μ] := - (integral_map_of_stronglyMeasurable hφ.measurable_mk hfm.stronglyMeasurable_mk) - _ = ∫ᵛ x, g (φ x) ∂[B; μ] := integral_congr_ae (hφ.ae_eq_mk.symm.fun_comp _) - _ = ∫ᵛ x, f (φ x) ∂[B; μ] := integral_congr_ae <| ae_eq_comp hφ hfm.ae_eq_mk.symm - -theorem _root_.MeasurableEmbedding.integral_map {β} {_ : MeasurableSpace β} {f : X → β} - (hf : MeasurableEmbedding f) (g : β → G) : ∫ᵛ y, g y ∂Measure.map f μ = ∫ᵛ x, g (f x) ∂[B; μ] := by - by_cases hgm : AEStronglyMeasurable g (Measure.map f μ) - · exact MeasureTheory.integral_map hf.measurable.aemeasurable hgm +theorem _root_.MeasurableEmbedding.integral_map_vectorMeasure + {β : Type*} [MeasurableSpace β] {φ : X → β} + (hφ : MeasurableEmbedding φ) (f : β → E) : + ∫ᵛ y, f y ∂[B; μ.map φ] = ∫ᵛ x, f (φ x) ∂[B; μ] := by + by_cases hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ) + · exact integral_map hφ.measurable hfm · rw [integral_non_aestronglyMeasurable hgm, integral_non_aestronglyMeasurable] exact fun hgf => hgm (hf.aestronglyMeasurable_map_iff.2 hgf) +#exit + theorem _root_.Topology.IsClosedEmbedding.integral_map {β} [TopologicalSpace X] [BorelSpace X] [TopologicalSpace β] [MeasurableSpace β] [BorelSpace β] {φ : X → β} (hφ : IsClosedEmbedding φ) (f : β → G) : ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ x, f (φ x) ∂[B; μ] := From f97688078a6b6e830fd6dadcbfcb73066197f288 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Tue, 19 May 2026 18:36:08 +0200 Subject: [PATCH 036/129] fix --- .../MeasureTheory/Integral/Bochner/Basic.lean | 19 +++----- .../MeasureTheory/VectorMeasure/Integral.lean | 43 ++++++++++++++++++- .../VectorMeasure/Variation/Basic.lean | 12 ++++++ 3 files changed, 58 insertions(+), 16 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean index b67f5b4fe43688..f2f362ab791703 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean @@ -1040,20 +1040,11 @@ theorem integral_map_of_stronglyMeasurable {β} [MeasurableSpace β] {φ : α by_cases hfi : Integrable f (Measure.map φ μ); swap · rw [integral_undef hfi, integral_undef] exact fun hfφ => hfi ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).2 hfφ) - borelize G - have : SeparableSpace (range f ∪ {0} : Set G) := hfm.separableSpace_range_union_singleton - refine tendsto_nhds_unique - (tendsto_integral_approxOn_of_measurable_of_range_subset hfm.measurable hfi _ Subset.rfl) ?_ - convert tendsto_integral_approxOn_of_measurable_of_range_subset (hfm.measurable.comp hφ) - ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).1 hfi) (range f ∪ {0}) - (union_subset_union_left {0} (range_comp_subset_range φ f)) using 1 - ext1 i - simp only [SimpleFunc.integral_eq, hφ, SimpleFunc.measurableSet_preimage, map_measureReal_apply, - ← preimage_comp] - refine (Finset.sum_subset (SimpleFunc.range_comp_subset_range _ hφ) fun y _ hy => ?_).symm - rw [SimpleFunc.mem_range, ← Set.preimage_singleton_eq_empty, SimpleFunc.coe_comp] at hy - rw [hy] - simp + simp only [integral_eq_setToFun] + apply setToFun_of_le_map_of_stronglyMeasurable _ _ + ((integrable_map_measure hfm.aestronglyMeasurable hφ.aemeasurable).1 hfi) hfm hφ le_rfl + intro s x hs + simp [weightedSMul_apply, map_measureReal_apply, hs, hφ] theorem integral_map {β} [MeasurableSpace β] {φ : α → β} (hφ : AEMeasurable φ μ) {f : β → G} (hfm : AEStronglyMeasurable f (Measure.map φ μ)) : diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 45b12c50a61464..87f2f43cb7d7e1 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -545,13 +545,52 @@ theorem integral_map {β : Type*} [MeasurableSpace β] intro s x hs simp [hs, VectorMeasure.map, transpose, hφ] +#check MeasurableEmbedding.comap_apply + +theorem _root_.MeasurableEmbedding.integral_map_vectorMeasure + {β : Type*} [MeasurableSpace β] {φ : X → β} + (hφ : MeasurableEmbedding φ) (f : β → E) : + μ.Integrable (f ∘ φ) B ↔ (μ.map φ).Integrable f B := by + simp_rw [VectorMeasure.Integrable, + ← hφ.integrable_map_iff (g := f) (μ := (μ.transpose B).variation)] + congr! + apply le_antisymm ?_ variation_transpose_map_le + apply Measure.le_iff.2 (fun s hs ↦ ?_) + simp only [hφ.measurable, hs, Measure.map_apply] + have : ((μ.map φ).transpose B).variation s = ((μ.map φ).transpose B).variation (s ∩ range φ) := by + nth_rw 1 [← inter_union_diff s (range φ)] + have : ((μ.map φ).transpose B).variation (s \ range φ) = 0 := by + + rw [measure_union (by grind) (hs.diff hφ.measurableSet_range), this, add_zero] + rw [this, ← hφ.comap_preimage] + apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) + simp only [hφ.comap_apply] + apply le_trans ?_ (enorm_measure_le_variation _ _) + simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe] + rw [map_apply _ hφ.measurable (hφ.measurableSet_image.2 ht), preimage_image_eq _ hφ.injective] + + + + + + + + +#exit + theorem _root_.MeasurableEmbedding.integral_map_vectorMeasure {β : Type*} [MeasurableSpace β] {φ : X → β} (hφ : MeasurableEmbedding φ) (f : β → E) : ∫ᵛ y, f y ∂[B; μ.map φ] = ∫ᵛ x, f (φ x) ∂[B; μ] := by by_cases hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ) - · exact integral_map hφ.measurable hfm - · rw [integral_non_aestronglyMeasurable hgm, integral_non_aestronglyMeasurable] + · by_cases h'fm : μ.Integrable (f ∘ φ) B + · apply integral_map hφ.measurable hfm h'fm + · rw [integral_undef, integral_undef] + · exact h'fm + · contrapose! h'fm + + sorry + · rw [integral_non_aestronglyMeasurable hfm, integral_non_aestronglyMeasurable] exact fun hgf => hgm (hf.aestronglyMeasurable_map_iff.2 hgf) #exit diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index ab349be0b5110e..e42b08b918567f 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -161,6 +161,18 @@ lemma variation_restrict_le (μ : VectorMeasure X V) (s : Set X) : · simp [variation_restrict μ hs] · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] +lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : MeasurableSet s) : + μ.variation s = 0 ↔ ∀ t, t ⊆ s → MeasurableSet t → μ t = 0 := by + refine ⟨fun h t hts ht ↦ ?_, fun h ↦ ?_⟩ + · apply enorm_eq_zero.1 + apply le_antisymm ?_ zero_le + rw [← h] + apply (enorm_measure_le_variation _ _).trans (measure_mono hts) + · apply le_antisymm ?_ zero_le + change μ.variation s ≤ (0 : Measure X) s + apply variation_apply_le_of_forall_enorm_le hs (fun t ht hts ↦ ?_) + simp [h t hts ht] + @[simp] lemma variation_eq_zero {μ : VectorMeasure X V} : μ.variation = 0 ↔ μ = 0 := by refine ⟨fun h ↦ ?_, fun h ↦ by simp [h]⟩ From c2595e4a64fb9251e29826f2a8f1270702548434 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Wed, 20 May 2026 08:13:10 +0200 Subject: [PATCH 037/129] more --- .../MeasureTheory/VectorMeasure/Integral.lean | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 87f2f43cb7d7e1..31180af48e46a7 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -516,7 +516,9 @@ theorem integral_smul_nnreal_measure (f : X → E) (c : ℝ≥0) : open TopologicalSpace -lemma variation_transpose_map_le {β : Type*} [MeasurableSpace β] {φ : X → β} : +variable {β : Type*} [MeasurableSpace β] {φ : X → β} + +lemma variation_transpose_map_le : ((μ.map φ).transpose B).variation ≤ Measure.map φ (μ.transpose B).variation := by by_cases hφ : Measurable φ; swap · simp [VectorMeasure.map, hφ, transpose, Measure.zero_le] @@ -545,22 +547,17 @@ theorem integral_map {β : Type*} [MeasurableSpace β] intro s x hs simp [hs, VectorMeasure.map, transpose, hφ] -#check MeasurableEmbedding.comap_apply - -theorem _root_.MeasurableEmbedding.integral_map_vectorMeasure - {β : Type*} [MeasurableSpace β] {φ : X → β} - (hφ : MeasurableEmbedding φ) (f : β → E) : - μ.Integrable (f ∘ φ) B ↔ (μ.map φ).Integrable f B := by - simp_rw [VectorMeasure.Integrable, - ← hφ.integrable_map_iff (g := f) (μ := (μ.transpose B).variation)] - congr! +theorem _root_.MeasurableEmbedding.map_variation (hφ : MeasurableEmbedding φ) : + (μ.transpose B).variation.map φ = ((μ.map φ).transpose B).variation := by apply le_antisymm ?_ variation_transpose_map_le apply Measure.le_iff.2 (fun s hs ↦ ?_) simp only [hφ.measurable, hs, Measure.map_apply] have : ((μ.map φ).transpose B).variation s = ((μ.map φ).transpose B).variation (s ∩ range φ) := by nth_rw 1 [← inter_union_diff s (range φ)] have : ((μ.map φ).transpose B).variation (s \ range φ) = 0 := by - + apply (variation_apply_eq_zero (hs.diff hφ.measurableSet_range)).2 (fun t ht t_meas ↦ ?_) + have : φ ⁻¹' t = ∅ := by grind + simp [transpose, map_apply, t_meas, hφ.measurable, this] rw [measure_union (by grind) (hs.diff hφ.measurableSet_range), this, add_zero] rw [this, ← hφ.comap_preimage] apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) @@ -569,18 +566,13 @@ theorem _root_.MeasurableEmbedding.integral_map_vectorMeasure simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe] rw [map_apply _ hφ.measurable (hφ.measurableSet_image.2 ht), preimage_image_eq _ hφ.injective] - - - - - - - -#exit +theorem _root_.MeasurableEmbedding.integrable_map (hφ : MeasurableEmbedding φ) {f : β → E} : + (μ.map φ).Integrable f B ↔ μ.Integrable (f ∘ φ) B := by + simp_rw [VectorMeasure.Integrable, + ← hφ.integrable_map_iff (g := f) (μ := (μ.transpose B).variation), hφ.map_variation] theorem _root_.MeasurableEmbedding.integral_map_vectorMeasure - {β : Type*} [MeasurableSpace β] {φ : X → β} - (hφ : MeasurableEmbedding φ) (f : β → E) : + (hφ : MeasurableEmbedding φ) {f : β → E} : ∫ᵛ y, f y ∂[B; μ.map φ] = ∫ᵛ x, f (φ x) ∂[B; μ] := by by_cases hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ) · by_cases h'fm : μ.Integrable (f ∘ φ) B From c7d02aea730d1be72fe9c1ec259c8e2654255aa7 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Wed, 20 May 2026 14:48:54 +0200 Subject: [PATCH 038/129] cleanup --- .../MeasureTheory/Integral/Bochner/Basic.lean | 21 +- Mathlib/MeasureTheory/Integral/SetToL1.lean | 25 +- .../MeasureTheory/VectorMeasure/Basic.lean | 18 + .../MeasureTheory/VectorMeasure/Integral.lean | 475 ++++-------------- .../VectorMeasure/Variation/Basic.lean | 90 +++- 5 files changed, 222 insertions(+), 407 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean index f2f362ab791703..d2a867451c8e07 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean @@ -962,23 +962,10 @@ variable {ν : Measure α} theorem integral_add_measure {f : α → G} (hμ : Integrable f μ) (hν : Integrable f ν) : ∫ x, f x ∂(μ + ν) = ∫ x, f x ∂μ + ∫ x, f x ∂ν := by - by_cases hG : CompleteSpace G; swap - · simp [integral, hG] - have hfi := hμ.add_measure hν - simp_rw [integral_eq_setToFun] - have hμ_dfma : DominatedFinMeasAdditive (μ + ν) (weightedSMul μ : Set α → G →L[ℝ] G) 1 := - DominatedFinMeasAdditive.add_measure_right μ ν (dominatedFinMeasAdditive_weightedSMul μ) - zero_le_one - have hν_dfma : DominatedFinMeasAdditive (μ + ν) (weightedSMul ν : Set α → G →L[ℝ] G) 1 := - DominatedFinMeasAdditive.add_measure_left μ ν (dominatedFinMeasAdditive_weightedSMul ν) - zero_le_one - rw [← setToFun_congr_measure_of_add_right hμ_dfma - (dominatedFinMeasAdditive_weightedSMul μ) f hfi, - ← setToFun_congr_measure_of_add_left hν_dfma (dominatedFinMeasAdditive_weightedSMul ν) f hfi] - refine setToFun_add_left' _ _ _ (fun s _ hμνs => ?_) f - rw [Measure.coe_add, Pi.add_apply, add_lt_top] at hμνs - rw [weightedSMul, weightedSMul, weightedSMul, ← add_smul, - measureReal_add_apply hμνs.1.ne hμνs.2.ne] + simp only [integral_eq_setToFun] + apply setToFun_add_left'' (fun s hs h's ↦ ?_) hμ hν le_rfl zero_le_one zero_le_one zero_le_one + simp only [Measure.coe_add, Pi.add_apply, add_lt_top] at h's + simp [weightedSMul, Measure.real, toReal_add, h's.1.ne, h's.2.ne, add_smul] @[simp] theorem integral_zero_measure {m : MeasurableSpace α} (f : α → G) : diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index feea970864dc96..ed00b87b8f3553 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -74,7 +74,7 @@ namespace MeasureTheory variable {α E F F' G 𝕜 : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup F'] [NormedSpace ℝ F'] - [NormedAddCommGroup G] {m : MeasurableSpace α} {μ : Measure α} + [NormedAddCommGroup G] {m : MeasurableSpace α} {μ μ' μ'' : Measure α} namespace L1 @@ -678,6 +678,8 @@ theorem setToFun_add_left (hT : DominatedFinMeasAdditive μ T C) · simp_rw [setToFun_eq _ hf, L1.setToL1_add_left hT hT'] · simp_rw [setToFun_undef _ hf, add_zero] +/-- `setToFun` applied to the sum `T + T'` of two operators is the sum of the corresponding +`setToFun`. See also `setToFun_add_left'` for a version varying the reference measures. -/ theorem setToFun_add_left' (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') (hT'' : DominatedFinMeasAdditive μ T'' C'') (h_add : ∀ s, MeasurableSet s → μ s < ∞ → T'' s = T s + T' s) (f : α → E) : @@ -1112,6 +1114,27 @@ theorem setToFun_congr_smul_measure' (c : ℝ≥0) rw! [ENNReal.smul_def] apply setToFun_congr_smul_measure _ (by simp) +/-- `setToFun` applied to the sum `T + T'` of two operators is the sum of the corresponding +`setToFun`. -/ +theorem setToFun_add_left'' {hT : DominatedFinMeasAdditive μ T C} + {hT' : DominatedFinMeasAdditive μ' T' C'} {hT'' : DominatedFinMeasAdditive μ'' T'' C''} + (h : ∀ s, MeasurableSet s → (μ + μ') s < ∞ → T'' s = T s + T' s) + (hf : Integrable f μ) (hf' : Integrable f μ') (hμ : μ'' ≤ μ + μ') + (hC : 0 ≤ C) (hC' : 0 ≤ C') (hC'' : 0 ≤ C'') : + setToFun μ'' T'' hT'' f = setToFun μ T hT f + setToFun μ' T' hT' f := by + have I : DominatedFinMeasAdditive (μ + μ') T C := .add_measure_right _ _ hT hC + have A : setToFun (μ + μ') T I f = setToFun μ T hT f := + setToFun_congr_measure_of_add_right _ _ _ (hf.add_measure hf') + have I' : DominatedFinMeasAdditive (μ + μ') T' C' := .add_measure_left _ _ hT' hC' + have A' : setToFun (μ + μ') T' I' f = setToFun μ' T' hT' f := + setToFun_congr_measure_of_add_left _ _ _ (hf.add_measure hf') + have I'' : DominatedFinMeasAdditive (μ + μ') T'' C'' := .of_measure_le hμ hT'' hC'' + have A'' : setToFun (μ + μ') T'' I'' f = setToFun μ'' T'' hT'' f := by + apply setToFun_congr_measure_of_integrable (c' := 1) (by simp) (by simpa using hμ) + apply hf.add_measure hf' + rw [← A, ← A', ← A''] + apply setToFun_add_left' _ _ _ h + theorem norm_setToFun_le_mul_norm (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) (hC : 0 ≤ C) : ‖setToFun μ T hT f‖ ≤ C * ‖f‖ := by by_cases hF : CompleteSpace F; swap diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index 7017901b02b264..b6e7f34f44d294 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -419,6 +419,10 @@ def dirac (x : β) (v : M) : VectorMeasure β M where @[simp] lemma dirac_apply_of_notMem (hx : x ∉ s) : dirac x v s = 0 := by simp [dirac, hx] +@[simp] lemma dirac_zero : dirac x (0 : M) = 0 := by + ext s hs + simp [dirac] + end Dirac end VectorMeasure @@ -705,6 +709,20 @@ theorem restrict_zero {i : Set α} : (0 : VectorMeasure α M).restrict i = 0 := rw [restrict_apply 0 hi hj, zero_apply, zero_apply] · exact dif_neg hi +theorem restrict_dirac {s : Set α} {x : α} {m : M} (hs : MeasurableSet s) [Decidable (x ∈ s)] : + (VectorMeasure.dirac x m).restrict s = if x ∈ s then VectorMeasure.dirac x m else 0 := by + classical + ext t ht + simp only [hs, ht, restrict_apply] + split_ifs with has <;> simp [dirac, ht, ht.inter hs, has] + +@[simp] +theorem restrict_singleton {a : α} : v.restrict {a} = VectorMeasure.dirac a (v {a}) := by + by_cases h : MeasurableSet {a} + · ext1 s hs + by_cases ha : a ∈ s <;> simp [*, restrict_apply] + · simp [restrict, h] + section ContinuousAdd variable [ContinuousAdd M] diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 31180af48e46a7..0b21d2d49847b6 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -64,7 +64,7 @@ public section open Set MeasureTheory VectorMeasure ContinuousLinearMap Filter Topology open scoped ENNReal NNReal -variable {X E F G : Type*} {mX : MeasurableSpace X} +variable {X Y E F G : Type*} {mX : MeasurableSpace X} [MeasurableSpace Y] [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] @@ -119,22 +119,38 @@ end cbmApplyMeasure namespace VectorMeasure -lemma restrict_transpose (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) (s : Set X) : - (μ.transpose B).restrict s = (μ.restrict s).transpose B := by +variable (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) {φ : X → Y} + +@[simp] lemma transpose_zero : (0 : VectorMeasure X F).transpose B = 0 := by + simp [transpose] + +lemma transpose_restrict (s : Set X) : + (μ.restrict s).transpose B = (μ.transpose B).restrict s := by by_cases hs : MeasurableSet s · ext t ht : 1 simp [VectorMeasure.restrict_apply, hs, ht, transpose] · simp [restrict_not_measurable _ hs, transpose] -lemma transpose_add (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : +lemma transpose_map : (μ.map φ).transpose B = (μ.transpose B).map φ := by + by_cases hφ : Measurable φ; swap + · simp [map, hφ] + ext s hs + simp [transpose, map_apply, hs, hφ] + +lemma transpose_add : (μ + ν).transpose B = μ.transpose B + ν.transpose B := by simp [transpose] -lemma transpose_smul (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) (c : ℝ) : +lemma transpose_smul (c : ℝ) : (c • μ).transpose B = c • μ.transpose B := by simp [transpose, mapRange_smul] -lemma variation_transpose_le (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : +lemma transpose_dirac (x : X) (v : F) : + (dirac x v).transpose B = dirac x (B.flip v) := by + ext s hs : 1 + by_cases hx : x ∈ s <;> simp [transpose, hx, hs] + +lemma variation_transpose_le : (μ.transpose B).variation ≤ ‖B‖₊ • μ.variation := by apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) apply opENorm_le_bound _ (fun x ↦ ?_) @@ -147,7 +163,7 @@ lemma absolutelyContinuous_variation_transpose (μ : VectorMeasure X F) (B : E (μ.transpose B).variation ≪ μ.variation := Measure.absolutelyContinuous_of_le_smul (variation_transpose_le μ B) -instance (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) [IsFiniteMeasure μ.variation] : +instance [IsFiniteMeasure μ.variation] : IsFiniteMeasure (μ.transpose B).variation := isFiniteMeasure_of_le _ (variation_transpose_le μ B) @@ -204,7 +220,7 @@ lemma integrable_finsetSum_vectorMeasure {ι : Type*} {μ : ι → VectorMeasure lemma Integrable.restrict (hf : μ.Integrable f B) {s : Set X} : (μ.restrict s).Integrable f B := by by_cases hs : MeasurableSet s - · simp only [VectorMeasure.Integrable, ← restrict_transpose, variation_restrict _ hs] + · simp only [VectorMeasure.Integrable, transpose_restrict, variation_restrict _ hs] exact MeasureTheory.Integrable.restrict hf · simp [restrict_not_measurable _ hs] @@ -322,7 +338,7 @@ theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} intro i apply (enorm_integral_le_lintegral_enorm _).trans apply lintegral_mono' _ le_rfl - rw [← restrict_transpose] + rw [transpose_restrict] apply variation_restrict_le /-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ @@ -352,13 +368,13 @@ lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by refine tendsto_integral_of_L1 f ?_ ?_ ?_ · apply hfi.mono_measure - grw [← restrict_transpose, variation_restrict_le, Measure.restrict_le_self] + grw [transpose_restrict, variation_restrict_le, Measure.restrict_le_self] · filter_upwards [hFi] with i hi using hi.restrict · simp_rw [← eLpNorm_one_eq_lintegral_enorm] at hF ⊢ apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hF (fun _ ↦ zero_le) (fun i ↦ ?_) apply eLpNorm_mono_measure - grw [← restrict_transpose, variation_restrict_le] + grw [transpose_restrict, variation_restrict_le] apply Measure.restrict_le_self /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ @@ -407,8 +423,8 @@ theorem continuous_of_dominated {F : Y → X → E} {bound : X → ℝ} continuous_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont @[simp] -theorem integral_const [CompleteSpace G] [IsFiniteMeasure (μ.transpose B).variation] - (c : E) : ∫ᵛ _ : X, c ∂[B; μ] = B c (μ univ) := +theorem integral_const [CompleteSpace G] [IsFiniteMeasure (μ.transpose B).variation] (c : E) : + ∫ᵛ _ : X, c ∂[B; μ] = B c (μ univ) := setToFun_const _ _ theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure (μ.transpose B).variation] @@ -434,40 +450,17 @@ theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure (μ.transpose B).vari theorem integral_add_vectorMeasure {ν : VectorMeasure X F} (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : - ∫ᵛ x, f x ∂[B; (μ + ν)] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := by - by_cases hG : CompleteSpace G; swap - · simp [integral, setToFun, hG] - simp only [integral] - have hfi := hμ.add_measure hν - have hμ_dfma : DominatedFinMeasAdditive ((μ.transpose B).variation + (ν.transpose B).variation) - (μ.transpose B) 1 := - DominatedFinMeasAdditive.add_measure_right (μ.transpose B).variation (ν.transpose B).variation - (dominatedFinMeasAdditive_cbmApplyMeasure μ B) zero_le_one - have hν_dfma : DominatedFinMeasAdditive ((μ.transpose B).variation + (ν.transpose B).variation) - (ν.transpose B) 1 := - DominatedFinMeasAdditive.add_measure_left (μ.transpose B).variation (ν.transpose B).variation - (dominatedFinMeasAdditive_cbmApplyMeasure ν B) zero_le_one - have hμν_dfma : DominatedFinMeasAdditive ((μ.transpose B).variation + (ν.transpose B).variation) - ((μ + ν).transpose B) 1 := by - apply DominatedFinMeasAdditive.of_measure_le _ - (dominatedFinMeasAdditive_cbmApplyMeasure (μ + ν) B) zero_le_one - grw [transpose_add, variation_add_le] - rw [← setToFun_congr_measure_of_add_right hμ_dfma _ f hfi, - ← setToFun_congr_measure_of_add_left hν_dfma _ f hfi, - ← setToFun_congr_measure_of_integrable 1 ENNReal.one_ne_top ?_ hμν_dfma - (dominatedFinMeasAdditive_cbmApplyMeasure (μ + ν) B) _ hfi] - · refine setToFun_add_left' _ _ _ (fun s hs hμνs => ?_) f - simp [transpose] - · grw [transpose_add, variation_add_le] - simp - -theorem setIntegral_measure_zero (f : X → E) {s : Set X} + ∫ᵛ x, f x ∂[B; (μ + ν)] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := + setToFun_add_left'' (by simp [transpose]) hμ hν (by grw [transpose_add, variation_add_le]) + zero_le_one zero_le_one zero_le_one + +theorem setIntegral_vectorMeasure_zero (f : X → E) {s : Set X} (hs : (μ.transpose B).variation s = 0) : ∫ᵛ x in s, f x ∂[B; μ] = 0 := by by_cases h's : MeasurableSet s; swap · simp [restrict_not_measurable μ h's] have : ((μ.restrict s).transpose B).variation = 0 := by - rw [← restrict_transpose, variation_restrict _ h's] + rw [transpose_restrict, variation_restrict _ h's] apply Measure.restrict_eq_zero.2 hs have : (μ.restrict s).transpose B = 0 := variation_eq_zero.1 this simp [integral, this] @@ -475,7 +468,7 @@ theorem setIntegral_measure_zero (f : X → E) {s : Set X} lemma integral_of_isEmpty [IsEmpty X] : ∫ᵛ x, f x ∂[B; μ] = 0 := μ.eq_zero_of_isEmpty ▸ integral_zero_vectorMeasure -theorem integral_finsetSum_measure {ι : Type*} {μ : ι → VectorMeasure X F} +theorem integral_finsetSum_vectorMeasure {ι : Type*} {μ : ι → VectorMeasure X F} {s : Finset ι} (hf : ∀ i ∈ s, (μ i).Integrable f B) : ∫ᵛ a, f a ∂[B; ∑ i ∈ s, μ i] = ∑ i ∈ s, ∫ᵛ a, f a ∂[B; μ i] := by classical @@ -494,7 +487,7 @@ theorem nndist_integral_add_vectorMeasure_le_lintegral exact enorm_integral_le_lintegral_enorm _ @[simp] -theorem integral_smul_measure (f : X → E) (c : ℝ) : +theorem integral_smul_vectorMeasure (f : X → E) (c : ℝ) : ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := by by_cases hG : CompleteSpace G; swap · simp [integral, setToFun, hG] @@ -510,28 +503,19 @@ theorem integral_smul_measure (f : X → E) (c : ℝ) : rfl @[simp] -theorem integral_smul_nnreal_measure (f : X → E) (c : ℝ≥0) : +theorem integral_smul_nnreal_vectorMeasure (f : X → E) (c : ℝ≥0) : ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := - integral_smul_measure f (c : ℝ) - -open TopologicalSpace + integral_smul_vectorMeasure f (c : ℝ) -variable {β : Type*} [MeasurableSpace β] {φ : X → β} +variable {β : Type*} [MeasurableSpace β] {φ : X → β} {a : X} {v : F} lemma variation_transpose_map_le : - ((μ.map φ).transpose B).variation ≤ Measure.map φ (μ.transpose B).variation := by - by_cases hφ : Measurable φ; swap - · simp [VectorMeasure.map, hφ, transpose, Measure.zero_le] - apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) - simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe, - Measure.map_apply hφ hs] - apply le_trans ?_ (enorm_measure_le_variation _ _) - simp [VectorMeasure.map_apply _ hφ hs] + ((μ.map φ).transpose B).variation ≤ Measure.map φ (μ.transpose B).variation := by + grw [transpose_map, variation_map_le] theorem Integrable.map {β : Type*} [MeasurableSpace β] {φ : X → β} {f : β → E} (hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ)) - (h : μ.Integrable (f ∘ φ) B) : - (μ.map φ).Integrable f B := by + (h : μ.Integrable (f ∘ φ) B) : (μ.map φ).Integrable f B := by by_cases hφ : Measurable φ; swap · simp [VectorMeasure.map, hφ] simp_rw [VectorMeasure.Integrable] at h ⊢ @@ -547,29 +531,15 @@ theorem integral_map {β : Type*} [MeasurableSpace β] intro s x hs simp [hs, VectorMeasure.map, transpose, hφ] -theorem _root_.MeasurableEmbedding.map_variation (hφ : MeasurableEmbedding φ) : - (μ.transpose B).variation.map φ = ((μ.map φ).transpose B).variation := by - apply le_antisymm ?_ variation_transpose_map_le - apply Measure.le_iff.2 (fun s hs ↦ ?_) - simp only [hφ.measurable, hs, Measure.map_apply] - have : ((μ.map φ).transpose B).variation s = ((μ.map φ).transpose B).variation (s ∩ range φ) := by - nth_rw 1 [← inter_union_diff s (range φ)] - have : ((μ.map φ).transpose B).variation (s \ range φ) = 0 := by - apply (variation_apply_eq_zero (hs.diff hφ.measurableSet_range)).2 (fun t ht t_meas ↦ ?_) - have : φ ⁻¹' t = ∅ := by grind - simp [transpose, map_apply, t_meas, hφ.measurable, this] - rw [measure_union (by grind) (hs.diff hφ.measurableSet_range), this, add_zero] - rw [this, ← hφ.comap_preimage] - apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) - simp only [hφ.comap_apply] - apply le_trans ?_ (enorm_measure_le_variation _ _) - simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe] - rw [map_apply _ hφ.measurable (hφ.measurableSet_image.2 ht), preimage_image_eq _ hφ.injective] - -theorem _root_.MeasurableEmbedding.integrable_map (hφ : MeasurableEmbedding φ) {f : β → E} : +theorem _root_.MeasurableEmbedding.variation_transpose_map (hφ : MeasurableEmbedding φ) : + ((μ.map φ).transpose B).variation = (μ.transpose B).variation.map φ := by + rw [transpose_map, hφ.variation_map] + +theorem _root_.MeasurableEmbedding.integrable_map_vectorMeasure + (hφ : MeasurableEmbedding φ) {f : β → E} : (μ.map φ).Integrable f B ↔ μ.Integrable (f ∘ φ) B := by simp_rw [VectorMeasure.Integrable, - ← hφ.integrable_map_iff (g := f) (μ := (μ.transpose B).variation), hφ.map_variation] + ← hφ.integrable_map_iff (g := f) (μ := (μ.transpose B).variation), hφ.variation_transpose_map] theorem _root_.MeasurableEmbedding.integral_map_vectorMeasure (hφ : MeasurableEmbedding φ) {f : β → E} : @@ -579,308 +549,79 @@ theorem _root_.MeasurableEmbedding.integral_map_vectorMeasure · apply integral_map hφ.measurable hfm h'fm · rw [integral_undef, integral_undef] · exact h'fm - · contrapose! h'fm - - sorry - · rw [integral_non_aestronglyMeasurable hfm, integral_non_aestronglyMeasurable] - exact fun hgf => hgm (hf.aestronglyMeasurable_map_iff.2 hgf) + · rwa [hφ.integrable_map_vectorMeasure] + · rw [integral_non_aestronglyMeasurable, integral_non_aestronglyMeasurable] + · rwa [hφ.aestronglyMeasurable_map_iff] at hfm + · rwa [hφ.variation_transpose_map] -#exit +theorem _root_.Topology.IsClosedEmbedding.integral_map_vectorMeasure + [TopologicalSpace X] [BorelSpace X] + [TopologicalSpace β] [BorelSpace β] (hφ : IsClosedEmbedding φ) + {f : β → E} : ∫ᵛ y, f y ∂[B; μ.map φ] = ∫ᵛ x, f (φ x) ∂[B; μ] := + hφ.measurableEmbedding.integral_map_vectorMeasure -theorem _root_.Topology.IsClosedEmbedding.integral_map {β} [TopologicalSpace X] [BorelSpace X] - [TopologicalSpace β] [MeasurableSpace β] [BorelSpace β] {φ : X → β} (hφ : IsClosedEmbedding φ) - (f : β → G) : ∫ᵛ y, f y ∂Measure.map φ μ = ∫ᵛ x, f (φ x) ∂[B; μ] := - hφ.measurableEmbedding.integral_map _ - -theorem integral_map_equiv {β} [MeasurableSpace β] (e : X ≃ᵐ β) (f : β → G) : - ∫ᵛ y, f y ∂Measure.map e μ = ∫ᵛ x, f (e x) ∂[B; μ] := - e.measurableEmbedding.integral_map f - -omit hE in -lemma integral_domSMul {G A : Type*} [Group G] [AddCommGroup A] [DistribMulAction G A] - [MeasurableSpace A] [MeasurableConstSMul G A] {μ : Measure A} (g : Gᵈᵐᵃ) (f : A → E) : - ∫ᵛ x, f x ∂g • μ = ∫ᵛ x, f ((DomMulAct.mk.symm g)⁻¹ • x) ∂[B; μ] := - integral_map_equiv (MeasurableEquiv.smul ((DomMulAct.mk.symm g : G)⁻¹)) f - -theorem MeasurePreserving.integral_comp {β} {_ : MeasurableSpace β} {f : X → β} {ν} - (h₁ : MeasurePreserving f μ ν) (h₂ : MeasurableEmbedding f) (g : β → G) : - ∫ᵛ x, g (f x) ∂[B; μ] = ∫ᵛ y, g y ∂ν := - h₁.map_eq ▸ (h₂.integral_map g).symm - -theorem MeasurePreserving.integral_comp' {β} [MeasurableSpace β] {ν} {f : X ≃ᵐ β} - (h : MeasurePreserving f μ ν) (g : β → G) : - ∫ᵛ x, g (f x) ∂[B; μ] = ∫ᵛ y, g y ∂ν := MeasurePreserving.integral_comp h f.measurableEmbedding _ - -theorem integral_subtype_comap {X} [MeasurableSpace X] {μ : Measure X} {s : Set X} - (hs : MeasurableSet s) (f : X → E) : - ∫ᵛ x : s, f (x : X) ∂(Measure.comap Subtype.val μ) = ∫ᵛ x in s, f x ∂[B; μ] := by - rw [← map_comap_subtype_coe hs] - exact ((MeasurableEmbedding.subtype_coe hs).integral_map _).symm - -attribute [local instance] Measure.Subtype.measureSpace in -theorem integral_subtype {X} [MeasureSpace X] {s : Set X} (hs : MeasurableSet s) (f : X → E) : - ∫ᵛ x : s, f x = ∫ᵛ x in s, f x := integral_subtype_comap hs f +theorem integral_map_equiv {β} [MeasurableSpace β] (e : X ≃ᵐ β) (f : β → E) : + ∫ᵛ y, f y ∂[B; μ.map e] = ∫ᵛ x, f (e x) ∂[B; μ] := + e.measurableEmbedding.integral_map_vectorMeasure @[simp] -theorem integral_dirac' [MeasurableSpace X] (f : X → E) (a : X) (hfm : StronglyMeasurable f) : - ∫ᵛ x, f x ∂Measure.dirac a = f a := by +theorem integral_dirac' [MeasurableSpace X] [CompleteSpace G] (hfm : StronglyMeasurable f) : + ∫ᵛ x, f x ∂[B; VectorMeasure.dirac a v] = B (f a) v := by borelize E + have : IsFiniteMeasure ((dirac a v).transpose B).variation := by + have : ‖B.flip v‖ₑ • Measure.dirac a = ‖B.flip v‖₊ • Measure.dirac a := rfl + simp only [transpose_dirac, variation_dirac, this] + infer_instance calc - ∫ᵛ x, f x ∂Measure.dirac a = ∫ᵛ _, f a ∂Measure.dirac a := - integral_congr_ae <| ae_eq_dirac' hfm.measurable - _ = f a := by simp + ∫ᵛ x, f x ∂[B; VectorMeasure.dirac a v] = ∫ᵛ _, f a ∂[B; VectorMeasure.dirac a v] := by + apply integral_congr_ae + simp only [transpose_dirac, variation_dirac] + exact Measure.ae_smul_measure (ae_eq_dirac' hfm.measurable) _ + _ = B (f a) v := by simp @[simp] -theorem integral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] (f : X → E) (a : X) : - ∫ᵛ x, f x ∂Measure.dirac a = f a := +theorem integral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] [CompleteSpace G] : + ∫ᵛ x, f x ∂[B; VectorMeasure.dirac a v] = B (f a) v := by + have : IsFiniteMeasure ((dirac a v).transpose B).variation := by + have : ‖B.flip v‖ₑ • Measure.dirac a = ‖B.flip v‖₊ • Measure.dirac a := rfl + simp only [transpose_dirac, variation_dirac, this] + infer_instance calc - ∫ᵛ x, f x ∂Measure.dirac a = ∫ᵛ _, f a ∂Measure.dirac a := integral_congr_ae <| ae_eq_dirac f - _ = f a := by simp + ∫ᵛ x, f x ∂[B; VectorMeasure.dirac a v] = ∫ᵛ _, f a ∂[B; VectorMeasure.dirac a v] := by + apply integral_congr_ae + simp only [transpose_dirac, variation_dirac] + exact Measure.ae_smul_measure (ae_eq_dirac f) _ + _ = B (f a) v := by simp + +theorem setIntegral_dirac' {mX : MeasurableSpace X} [CompleteSpace G] + (hf : StronglyMeasurable f) {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : + ∫ᵛ x in s, f x ∂[B; VectorMeasure.dirac a v] = if a ∈ s then B (f a) v else 0 := by + rw [restrict_dirac hs] + split_ifs + · exact integral_dirac' hf + · exact integral_zero_vectorMeasure -theorem setIntegral_dirac' {mX : MeasurableSpace X} {f : X → E} (hf : StronglyMeasurable f) (a : X) +theorem setIntegral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] [CompleteSpace G] {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : - ∫ᵛ x in s, f x ∂Measure.dirac a = if a ∈ s then f a else 0 := by - rw [restrict_dirac' hs] + ∫ᵛ x in s, f x ∂[B; VectorMeasure.dirac a v] = if a ∈ s then B (f a) v else 0 := by + rw [restrict_dirac hs] split_ifs - · exact integral_dirac' _ _ hf - · exact integral_zero_measure _ + · exact integral_dirac + · exact integral_zero_vectorMeasure -theorem setIntegral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] (f : X → E) (a : X) - (s : Set X) [Decidable (a ∈ s)] : - ∫ᵛ x in s, f x ∂Measure.dirac a = if a ∈ s then f a else 0 := by - rw [restrict_dirac] - split_ifs - · exact integral_dirac _ _ - · exact integral_zero_measure _ - -/-- **Markov's inequality** also known as **Chebyshev's first inequality**. -/ -theorem mul_meas_ge_le_integral_of_nonneg {f : X → ℝ} (hf_nonneg : 0 ≤ᵐ[μ] f) - (hf_int : Integrable f μ) (ε : ℝ) : ε * μ.real { x | ε ≤ f x } ≤ ∫ᵛ x, f x ∂[B; μ] := by - rcases eq_top_or_lt_top (μ {x | ε ≤ f x}) with hμ | hμ - · simpa [measureReal_def, hμ] using integral_nonneg_of_ae hf_nonneg - · have := Fact.mk hμ - calc - ε * μ.real { x | ε ≤ f x } = ∫ᵛ _ in {x | ε ≤ f x}, ε ∂[B; μ] := by simp [mul_comm] - _ ≤ ∫ᵛ x in {x | ε ≤ f x}, f x ∂[B; μ] := - integral_mono_ae (integrable_const _) (hf_int.mono_measure μ.restrict_le_self) <| - ae_restrict_mem₀ <| hf_int.aemeasurable.nullMeasurable measurableSet_Ici - _ ≤ _ := integral_mono_measure μ.restrict_le_self hf_nonneg hf_int - -/-- Hölder's inequality for the integral of a product of norms. The integral of the product of two -norms of functions is bounded by the product of their `ℒp` and `ℒq` seminorms when `p` and `q` are -conjugate exponents. -/ -theorem integral_mul_norm_le_Lp_mul_Lq {E} [NormedAddCommGroup E] {f g : X → E} {p q : ℝ} - (hpq : p.HolderConjugate q) (hf : MemLp f (ENNReal.ofReal p) μ) - (hg : MemLp g (ENNReal.ofReal q) μ) : - ∫ᵛ a, ‖f a‖ * ‖g a‖ ∂[B; μ] ≤ (∫ᵛ a, ‖f a‖ ^ p ∂[B; μ]) ^ (1 / p) * (∫ᵛ a, ‖g a‖ ^ q ∂[B; μ]) ^ (1 / q) := by - -- translate the Bochner integrals into Lebesgue integrals. - rw [integral_eq_lintegral_of_nonneg_ae, integral_eq_lintegral_of_nonneg_ae, - integral_eq_lintegral_of_nonneg_ae] - rotate_left - · exact Eventually.of_forall fun x ↦ by positivity - · exact (hg.1.norm.aemeasurable.pow aemeasurable_const).aestronglyMeasurable - · exact Eventually.of_forall fun x ↦ by positivity - · exact (hf.1.norm.aemeasurable.pow aemeasurable_const).aestronglyMeasurable - · exact Eventually.of_forall fun x ↦ by positivity - · exact hf.1.norm.mul hg.1.norm - rw [ENNReal.toReal_rpow, ENNReal.toReal_rpow, ← ENNReal.toReal_mul] - -- replace norms by nnnorm - have h_left : ∫⁻ a, ENNReal.ofReal (‖f a‖ * ‖g a‖) ∂[B; μ] = - ∫⁻ a, ((‖f ·‖ₑ) * (‖g ·‖ₑ)) a ∂[B; μ] := by - simp_rw [Pi.mul_apply, ← ofReal_norm_eq_enorm, ENNReal.ofReal_mul (norm_nonneg _)] - have h_right_f : ∫⁻ a, .ofReal (‖f a‖ ^ p) ∂[B; μ] = ∫⁻ a, ‖f a‖ₑ ^ p ∂[B; μ] := by - refine lintegral_congr fun x => ?_ - rw [← ofReal_norm_eq_enorm, ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) hpq.nonneg] - have h_right_g : ∫⁻ a, .ofReal (‖g a‖ ^ q) ∂[B; μ] = ∫⁻ a, ‖g a‖ₑ ^ q ∂[B; μ] := by - refine lintegral_congr fun x => ?_ - rw [← ofReal_norm_eq_enorm, ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) hpq.symm.nonneg] - rw [h_left, h_right_f, h_right_g] - -- we can now apply `ENNReal.lintegral_mul_le_Lp_mul_Lq` (up to the `toReal` application) - refine ENNReal.toReal_mono ?_ ?_ - · refine ENNReal.mul_ne_top ?_ ?_ - · convert hf.eLpNorm_ne_top - rw [eLpNorm_eq_lintegral_rpow_enorm_toReal] - · rw [ENNReal.toReal_ofReal hpq.nonneg] - · rw [Ne, ENNReal.ofReal_eq_zero, not_le] - exact hpq.pos - · finiteness - · convert hg.eLpNorm_ne_top - rw [eLpNorm_eq_lintegral_rpow_enorm_toReal] - · rw [ENNReal.toReal_ofReal hpq.symm.nonneg] - · rw [Ne, ENNReal.ofReal_eq_zero, not_le] - exact hpq.symm.pos - · finiteness - · exact ENNReal.lintegral_mul_le_Lp_mul_Lq μ hpq hf.1.nnnorm.aemeasurable.coe_nnreal_ennreal - hg.1.nnnorm.aemeasurable.coe_nnreal_ennreal - -/-- Hölder's inequality for functions `X → ℝ`. The integral of the product of two nonnegative -functions is bounded by the product of their `ℒp` and `ℒq` seminorms when `p` and `q` are conjugate -exponents. -/ -theorem integral_mul_le_Lp_mul_Lq_of_nonneg {p q : ℝ} (hpq : p.HolderConjugate q) {f g : X → ℝ} - (hf_nonneg : 0 ≤ᵐ[μ] f) (hg_nonneg : 0 ≤ᵐ[μ] g) (hf : MemLp f (ENNReal.ofReal p) μ) - (hg : MemLp g (ENNReal.ofReal q) μ) : - ∫ᵛ a, f a * g a ∂[B; μ] ≤ (∫ᵛ a, f a ^ p ∂[B; μ]) ^ (1 / p) * (∫ᵛ a, g a ^ q ∂[B; μ]) ^ (1 / q) := by - have h_left : ∫ᵛ a, f a * g a ∂[B; μ] = ∫ᵛ a, ‖f a‖ * ‖g a‖ ∂[B; μ] := by - refine integral_congr_ae ?_ - filter_upwards [hf_nonneg, hg_nonneg] with x hxf hxg - rw [Real.norm_of_nonneg hxf, Real.norm_of_nonneg hxg] - have h_right_f : ∫ᵛ a, f a ^ p ∂[B; μ] = ∫ᵛ a, ‖f a‖ ^ p ∂[B; μ] := by - refine integral_congr_ae ?_ - filter_upwards [hf_nonneg] with x hxf - rw [Real.norm_of_nonneg hxf] - have h_right_g : ∫ᵛ a, g a ^ q ∂[B; μ] = ∫ᵛ a, ‖g a‖ ^ q ∂[B; μ] := by - refine integral_congr_ae ?_ - filter_upwards [hg_nonneg] with x hxg - rw [Real.norm_of_nonneg hxg] - rw [h_left, h_right_f, h_right_g] - exact integral_mul_norm_le_Lp_mul_Lq hpq hf hg - -theorem integral_singleton' {μ : Measure X} {f : X → E} (hf : StronglyMeasurable f) (a : X) : - ∫ᵛ a in {a}, f a ∂[B; μ] = μ.real {a} • f a := by - simp only [Measure.restrict_singleton, integral_smul_measure, integral_dirac' f a hf, - measureReal_def] - -theorem integral_singleton [MeasurableSingletonClass X] {μ : Measure X} (f : X → E) (a : X) : - ∫ᵛ a in {a}, f a ∂[B; μ] = μ.real {a} • f a := by - simp only [Measure.restrict_singleton, integral_smul_measure, integral_dirac, measureReal_def] - -theorem integral_unique [Unique X] (f : X → E) : ∫ᵛ x, f x ∂[B; μ] = μ.real univ • f default := - calc - ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ _, f default ∂[B; μ] := by congr with x; congr; exact Unique.uniq _ x - _ = μ.real univ • f default := by rw [integral_const] - -theorem integral_pos_of_integrable_nonneg_nonzero [TopologicalSpace X] [Measure.IsOpenPosMeasure μ] - {f : X → ℝ} {x : X} (f_cont : Continuous f) (f_int : Integrable f μ) (f_nonneg : 0 ≤ f) - (f_x : f x ≠ 0) : 0 < ∫ᵛ x, f x ∂[B; μ] := - (integral_pos_iff_support_of_nonneg f_nonneg f_int).2 - (IsOpen.measure_pos μ f_cont.isOpen_support ⟨x, f_x⟩) - -end Properties - -section IntegralTrim - -variable {β γ : Type*} {m m0 : MeasurableSpace β} {μ : Measure β} - -/-- Simple function seen as simple function of a larger `MeasurableSpace`. -/ -def SimpleFunc.toLargerSpace (hm : m ≤ m0) (f : @SimpleFunc β m γ) : SimpleFunc β γ := - ⟨@SimpleFunc.toFun β m γ f, fun x => hm _ (@SimpleFunc.measurableSet_fiber β γ m f x), - @SimpleFunc.finite_range β γ m f⟩ - -theorem SimpleFunc.coe_toLargerSpace_eq (hm : m ≤ m0) (f : @SimpleFunc β m γ) : - ⇑(f.toLargerSpace hm) = f := rfl - -theorem integral_simpleFunc_larger_space (hm : m ≤ m0) (f : @SimpleFunc β m F) - (hf_int : Integrable f μ) : - ∫ᵛ x, f x ∂[B; μ] = ∑ x ∈ @SimpleFunc.range β F m f, μ.real (f ⁻¹' {x}) • x := by - simp_rw [← f.coe_toLargerSpace_eq hm] - rw [SimpleFunc.integral_eq_sum _ hf_int] - congr 1 - -theorem integral_trim_simpleFunc (hm : m ≤ m0) (f : @SimpleFunc β m F) (hf_int : Integrable f μ) : - ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ].trim hm := by - have hf : StronglyMeasurable[m] f := @SimpleFunc.stronglyMeasurable β F m _ f - have hf_int_m := hf_int.trim hm hf - rw [integral_simpleFunc_larger_space (le_refl m) f hf_int_m, - integral_simpleFunc_larger_space hm f hf_int] - congr with x - simp only [measureReal_def] - congr 2 - exact (trim_measurableSet_eq hm (@SimpleFunc.measurableSet_fiber β F m f x)).symm - -theorem integral_trim (hm : m ≤ m0) {f : β → G} (hf : StronglyMeasurable[m] f) : - ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ].trim hm := by - by_cases hG : CompleteSpace G; swap - · simp [integral, hG] - borelize G - by_cases hf_int : Integrable f μ - swap - · have hf_int_m : ¬Integrable f (μ.trim hm) := fun hf_int_m => - hf_int (integrable_of_integrable_trim hm hf_int_m) - rw [integral_undef hf_int, integral_undef hf_int_m] - haveI : SeparableSpace (range f ∪ {0} : Set G) := hf.separableSpace_range_union_singleton - let f_seq := @SimpleFunc.approxOn G β _ _ _ m _ hf.measurable (range f ∪ {0}) 0 (by simp) _ - have hf_seq_meas : ∀ n, StronglyMeasurable[m] (f_seq n) := fun n => - @SimpleFunc.stronglyMeasurable β G m _ (f_seq n) - have hf_seq_int : ∀ n, Integrable (f_seq n) μ := - SimpleFunc.integrable_approxOn_range (hf.mono hm).measurable hf_int - have hf_seq_int_m : ∀ n, Integrable (f_seq n) (μ.trim hm) := fun n => - (hf_seq_int n).trim hm (hf_seq_meas n) - have hf_seq_eq : ∀ n, ∫ᵛ x, f_seq n x ∂[B; μ] = ∫ᵛ x, f_seq n x ∂[B; μ].trim hm := fun n => - integral_trim_simpleFunc hm (f_seq n) (hf_seq_int n) - have h_lim_1 : atTop.Tendsto (fun n => ∫ᵛ x, f_seq n x ∂[B; μ]) (𝓝 (∫ᵛ x, f x ∂[B; μ])) := by - refine tendsto_integral_of_L1 f hf_int (Eventually.of_forall hf_seq_int) ?_ - exact SimpleFunc.tendsto_approxOn_range_L1_enorm (hf.mono hm).measurable hf_int - have h_lim_2 : atTop.Tendsto (fun n => ∫ᵛ x, f_seq n x ∂[B; μ]) (𝓝 (∫ᵛ x, f x ∂[B; μ].trim hm)) := by - simp_rw [hf_seq_eq] - refine @tendsto_integral_of_L1 β G _ _ m (μ.trim hm) _ f (hf_int.trim hm hf) _ _ - (Eventually.of_forall hf_seq_int_m) ?_ - exact @SimpleFunc.tendsto_approxOn_range_L1_enorm β G m _ _ _ f _ _ hf.measurable - (hf_int.trim hm hf) - exact tendsto_nhds_unique h_lim_1 h_lim_2 - -theorem integral_trim_ae (hm : m ≤ m0) {f : β → G} (hf : AEStronglyMeasurable[m] f (μ.trim hm)) : - ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ].trim hm := by - rw [integral_congr_ae (ae_eq_of_ae_eq_trim hf.ae_eq_mk), integral_congr_ae hf.ae_eq_mk] - exact integral_trim hm hf.stronglyMeasurable_mk - -end IntegralTrim - -section SnormBound - -variable {m0 : MeasurableSpace X} {μ : Measure X} {f : X → ℝ} - -theorem eLpNorm_one_le_of_le {r : ℝ≥0} (hfint : Integrable f μ) (hfint' : 0 ≤ ∫ᵛ x, f x ∂[B; μ]) - (hf : ∀ᵐ ω ∂[B; μ], f ω ≤ r) : eLpNorm f 1 μ ≤ 2 * μ Set.univ * r := by - by_cases hr : r = 0 - · suffices f =ᵐ[μ] 0 by - rw [eLpNorm_congr_ae this, eLpNorm_zero, hr, ENNReal.coe_zero, mul_zero] - rw [hr] at hf - norm_cast at hf - have hnegf : ∫ᵛ x, -f x ∂[B; μ] = 0 := by - rw [integral_neg, neg_eq_zero] - exact le_antisymm (integral_nonpos_of_ae hf) hfint' - have := (integral_eq_zero_iff_of_nonneg_ae ?_ hfint.neg).1 hnegf - · filter_upwards [this] with ω hω - rwa [Pi.neg_apply, Pi.zero_apply, neg_eq_zero] at hω - · filter_upwards [hf] with ω hω - rwa [Pi.zero_apply, Pi.neg_apply, Right.nonneg_neg_iff] - by_cases hμ : IsFiniteMeasure μ - swap - · have : μ Set.univ = ∞ := by - by_contra hμ' - exact hμ (IsFiniteMeasure.mk <| lt_top_iff_ne_top.2 hμ') - rw [this, ENNReal.mul_top', if_neg, ENNReal.top_mul', if_neg] - · exact le_top - · simp [hr] - · simp - haveI := hμ - rw [integral_eq_integral_pos_part_sub_integral_neg_part hfint, sub_nonneg] at hfint' - have hposbdd : ∫ᵛ ω, max (f ω) 0 ∂[B; μ] ≤ μ.real Set.univ • (r : ℝ) := by - rw [← integral_const] - refine integral_mono_ae hfint.real_toNNReal (integrable_const (r : ℝ)) ?_ - filter_upwards [hf] with ω hω using Real.toNNReal_le_iff_le_coe.2 hω - rw [MemLp.eLpNorm_eq_integral_rpow_norm one_ne_zero ENNReal.one_ne_top - (memLp_one_iff_integrable.2 hfint), - ENNReal.ofReal_le_iff_le_toReal (by finiteness)] - simp_rw [ENNReal.toReal_one, _root_.inv_one, Real.rpow_one, Real.norm_eq_abs, ← - max_zero_add_max_neg_zero_eq_abs_self, ← Real.coe_toNNReal'] - rw [integral_add hfint.real_toNNReal] - · simp only [Real.coe_toNNReal', ENNReal.toReal_mul, ENNReal.coe_toReal, - toReal_ofNat] at hfint' ⊢ - grw [hfint'] - rwa [← two_mul, mul_assoc, mul_le_mul_iff_right₀ (two_pos : (0 : ℝ) < 2)] - · exact hfint.neg.sup (integrable_zero _ _ μ) - -theorem eLpNorm_one_le_of_le' {r : ℝ} (hfint : Integrable f μ) (hfint' : 0 ≤ ∫ᵛ x, f x ∂[B; μ]) - (hf : ∀ᵐ ω ∂[B; μ], f ω ≤ r) : eLpNorm f 1 μ ≤ 2 * μ Set.univ * ENNReal.ofReal r := by - refine eLpNorm_one_le_of_le hfint hfint' ?_ - simp only [Real.coe_toNNReal', le_max_iff] - filter_upwards [hf] with ω hω using Or.inl hω - -end SnormBound +theorem integral_singleton' [CompleteSpace G] (hf : StronglyMeasurable f) : + ∫ᵛ a in {a}, f a ∂[B; μ] = B (f a) (μ {a}) := by + simp only [restrict_singleton, integral_dirac' hf] -end MeasureTheory +theorem integral_singleton [MeasurableSingletonClass X] [CompleteSpace G] : + ∫ᵛ a in {a}, f a ∂[B; μ] = B (f a) (μ {a}) := by + simp only [restrict_singleton, integral_dirac] +theorem integral_unique [Unique X] [CompleteSpace G] : + ∫ᵛ x, f x ∂[B; μ] = B (f default) (μ univ) := + calc + ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ _, f default ∂[B; μ] := by congr with x; congr; exact Unique.uniq _ x + _ = B (f default) (μ univ) := by rw [integral_const] end VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index e42b08b918567f..3a2b5e5063a48c 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -5,8 +5,9 @@ Authors: Oliver Butterley, Yoh Tanimoto -/ module -public import Mathlib.MeasureTheory.VectorMeasure.Variation.Defs public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.MeasureTheory.Measure.Dirac +public import Mathlib.MeasureTheory.VectorMeasure.Variation.Defs /-! # Properties of variation @@ -31,7 +32,7 @@ such vector-valued measures. public section -open Finset +open Finset Set open scoped ENNReal namespace MeasureTheory.VectorMeasure @@ -134,6 +135,27 @@ lemma variation_finsetSum_le [ContinuousAdd V] {ι} (s : Finset ι) (μ : ι → simpa [Finset.sum_insert his] using variation_add_le.trans (add_le_add_right ih ((μ i).variation)) +lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : MeasurableSet s) : + μ.variation s = 0 ↔ ∀ t, t ⊆ s → MeasurableSet t → μ t = 0 := by + refine ⟨fun h t hts ht ↦ ?_, fun h ↦ ?_⟩ + · apply enorm_eq_zero.1 + apply le_antisymm ?_ zero_le + rw [← h] + apply (enorm_measure_le_variation _ _).trans (measure_mono hts) + · apply le_antisymm ?_ zero_le + change μ.variation s ≤ (0 : Measure X) s + apply variation_apply_le_of_forall_enorm_le hs (fun t ht hts ↦ ?_) + simp [h t hts ht] + +@[simp] lemma variation_eq_zero {μ : VectorMeasure X V} : + μ.variation = 0 ↔ μ = 0 := by + refine ⟨fun h ↦ ?_, fun h ↦ by simp [h]⟩ + ext s hs + apply enorm_eq_zero.1 + apply le_antisymm ?_ (by simp) + grw [enorm_measure_le_variation] + simp [h] + lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) : (μ.restrict s).variation = μ.variation.restrict s := by apply le_antisymm @@ -161,26 +183,42 @@ lemma variation_restrict_le (μ : VectorMeasure X V) (s : Set X) : · simp [variation_restrict μ hs] · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] -lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : MeasurableSet s) : - μ.variation s = 0 ↔ ∀ t, t ⊆ s → MeasurableSet t → μ t = 0 := by - refine ⟨fun h t hts ht ↦ ?_, fun h ↦ ?_⟩ - · apply enorm_eq_zero.1 - apply le_antisymm ?_ zero_le - rw [← h] - apply (enorm_measure_le_variation _ _).trans (measure_mono hts) - · apply le_antisymm ?_ zero_le - change μ.variation s ≤ (0 : Measure X) s - apply variation_apply_le_of_forall_enorm_le hs (fun t ht hts ↦ ?_) - simp [h t hts ht] - -@[simp] lemma variation_eq_zero {μ : VectorMeasure X V} : - μ.variation = 0 ↔ μ = 0 := by - refine ⟨fun h ↦ ?_, fun h ↦ by simp [h]⟩ - ext s hs - apply enorm_eq_zero.1 - apply le_antisymm ?_ (by simp) - grw [enorm_measure_le_variation] - simp [h] +lemma variation_map_le {Y : Type*} [MeasurableSpace Y] {φ : X → Y} : + (μ.map φ).variation ≤ Measure.map φ μ.variation := by + by_cases hφ : Measurable φ; swap + · simp [VectorMeasure.map, hφ, Measure.zero_le] + apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + simp only [Measure.map_apply hφ hs] + apply le_trans ?_ (enorm_measure_le_variation _ _) + simp [VectorMeasure.map_apply _ hφ hs] + +theorem _root_.MeasurableEmbedding.variation_map {Y : Type*} [MeasurableSpace Y] {φ : X → Y} + (hφ : MeasurableEmbedding φ) : + (μ.map φ).variation = μ.variation.map φ := by + apply le_antisymm variation_map_le ?_ + apply Measure.le_iff.2 (fun s hs ↦ ?_) + simp only [hφ.measurable, hs, Measure.map_apply] + have : (μ.map φ).variation s = (μ.map φ).variation (s ∩ range φ) := by + nth_rw 1 [← inter_union_diff s (range φ)] + have : (μ.map φ).variation (s \ range φ) = 0 := by + apply (variation_apply_eq_zero (hs.diff hφ.measurableSet_range)).2 (fun t ht t_meas ↦ ?_) + have : φ ⁻¹' t = ∅ := by grind + simp [map_apply, t_meas, hφ.measurable, this] + rw [measure_union (by grind) (hs.diff hφ.measurableSet_range), this, add_zero] + rw [this, ← hφ.comap_preimage] + apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) + simp only [hφ.comap_apply] + apply le_trans ?_ (enorm_measure_le_variation _ _) + rw [map_apply _ hφ.measurable (hφ.measurableSet_image.2 ht), preimage_image_eq _ hφ.injective] + +@[simp] lemma variation_dirac (x : X) (v : V) : + (VectorMeasure.dirac x v).variation = ‖v‖ₑ • Measure.dirac x := by + apply le_antisymm + · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + by_cases hx : x ∈ s <;> simp [hs, hx] + · apply Measure.le_iff.2 (fun s hs ↦ ?_) + apply le_trans ?_ (enorm_measure_le_variation _ _) + by_cases hx : x ∈ s <;> simp [hs, hx] end Basic @@ -220,6 +258,14 @@ lemma variation_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : _ = (c • μ).variation := by simp [smul_smul, mul_inv_cancel₀ (nnnorm_ne_zero_iff.mpr hc)] +instance [Finite X] : IsFiniteMeasure μ.variation := by + classical + let : Fintype X := Fintype.ofFinite X + constructor + simp only [variation_apply, preVariation_apply, MeasurableSet.univ, ennrealToMeasure_apply, + ennrealPreVariation_apply, preVariationFun, ↓reduceDIte, ← sup_univ_eq_ciSup] + exact (Finset.sup_lt_iff (by simp)).2 (fun b hb ↦ by simp [ENNReal.sum_lt_top, enorm_lt_top]) + end NormedAddCommGroup end MeasureTheory.VectorMeasure From b2c7702b6e9901d28bf974eeaa40f82af5bfd5b4 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Wed, 20 May 2026 15:59:10 +0200 Subject: [PATCH 039/129] cherry pick --- .../MeasureTheory/VectorMeasure/Basic.lean | 45 +++++- .../VectorMeasure/Variation/Basic.lean | 131 +++++++++++++++++- 2 files changed, 164 insertions(+), 12 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index e45965e0dbc9f6..b6e7f34f44d294 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -123,6 +123,14 @@ theorem ext_iff (v w : VectorMeasure α M) : v = w ↔ ∀ i : Set α, Measurabl theorem ext {s t : VectorMeasure α M} (h : ∀ i : Set α, MeasurableSet i → s i = t i) : s = t := (ext_iff s t).2 h +@[nontriviality] +lemma apply_eq_zero_of_isEmpty [IsEmpty α] (v : VectorMeasure α M) (s : Set α) : + v s = 0 := by + rw [eq_empty_of_isEmpty s, empty] + +instance instSubsingleton [IsEmpty α] : Subsingleton (VectorMeasure α M) := + ⟨fun μ ν => by ext1 s _; rw [apply_eq_zero_of_isEmpty, apply_eq_zero_of_isEmpty]⟩ + variable [Countable β] {v : VectorMeasure α M} {f : β → Set α} theorem hasSum_of_disjoint_iUnion (hm : ∀ i, MeasurableSet (f i)) (hd : Pairwise (Disjoint on f)) : @@ -287,6 +295,9 @@ theorem coe_zero : ⇑(0 : VectorMeasure α M) = 0 := rfl theorem zero_apply (i : Set α) : (0 : VectorMeasure α M) i = 0 := rfl +theorem eq_zero_of_isEmpty [IsEmpty α] (v : VectorMeasure α M) : v = 0 := + Subsingleton.elim v 0 + variable [ContinuousAdd M] /-- The sum of two vector measure is a vector measure. -/ @@ -408,6 +419,10 @@ def dirac (x : β) (v : M) : VectorMeasure β M where @[simp] lemma dirac_apply_of_notMem (hx : x ∉ s) : dirac x v s = 0 := by simp [dirac, hx] +@[simp] lemma dirac_zero : dirac x (0 : M) = 0 := by + ext s hs + simp [dirac] + end Dirac end VectorMeasure @@ -631,17 +646,21 @@ end ContinuousAdd section Module variable {R : Type*} [Semiring R] [Module R M] [Module R N] -variable [ContinuousAdd M] [ContinuousAdd N] [ContinuousConstSMul R M] [ContinuousConstSMul R N] + +variable [ContinuousConstSMul R M] [ContinuousConstSMul R N] + +theorem mapRange_smul {v : VectorMeasure α M} {f : M →ₗ[R] N} (hf : Continuous f) {c : R} : + (c • v).mapRange f.toAddMonoidHom hf = c • (v.mapRange f.toAddMonoidHom hf) := by + ext; simp + +variable [ContinuousAdd M] [ContinuousAdd N] /-- Given a continuous linear map `f : M → N`, `mapRangeₗ` is the linear map mapping the vector measure `v` on `M` to the vector measure `f ∘ v` on `N`. -/ def mapRangeₗ (f : M →ₗ[R] N) (hf : Continuous f) : VectorMeasure α M →ₗ[R] VectorMeasure α N where toFun v := v.mapRange f.toAddMonoidHom hf map_add' _ _ := mapRange_add hf - map_smul' := by - intros - ext - simp + map_smul' _ _ := mapRange_smul hf end Module @@ -649,7 +668,7 @@ end open Classical in /-- The restriction of a vector measure on some set. -/ -def restrict (v : VectorMeasure α M) (i : Set α) : VectorMeasure α M := +@[no_expose] def restrict (v : VectorMeasure α M) (i : Set α) : VectorMeasure α M := if hi : MeasurableSet i then { measureOf' := fun s => if MeasurableSet s then v (s ∩ i) else 0 empty' := by simp @@ -690,6 +709,20 @@ theorem restrict_zero {i : Set α} : (0 : VectorMeasure α M).restrict i = 0 := rw [restrict_apply 0 hi hj, zero_apply, zero_apply] · exact dif_neg hi +theorem restrict_dirac {s : Set α} {x : α} {m : M} (hs : MeasurableSet s) [Decidable (x ∈ s)] : + (VectorMeasure.dirac x m).restrict s = if x ∈ s then VectorMeasure.dirac x m else 0 := by + classical + ext t ht + simp only [hs, ht, restrict_apply] + split_ifs with has <;> simp [dirac, ht, ht.inter hs, has] + +@[simp] +theorem restrict_singleton {a : α} : v.restrict {a} = VectorMeasure.dirac a (v {a}) := by + by_cases h : MeasurableSet {a} + · ext1 s hs + by_cases ha : a ∈ s <;> simp [*, restrict_apply] + · simp [restrict, h] + section ContinuousAdd variable [ContinuousAdd M] diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index 3722e32704c756..3a2b5e5063a48c 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -5,6 +5,8 @@ Authors: Oliver Butterley, Yoh Tanimoto -/ module +public import Mathlib.Analysis.Normed.Module.Basic +public import Mathlib.MeasureTheory.Measure.Dirac public import Mathlib.MeasureTheory.VectorMeasure.Variation.Defs /-! @@ -30,7 +32,7 @@ such vector-valued measures. public section -open Finset +open Finset Set open scoped ENNReal namespace MeasureTheory.VectorMeasure @@ -41,7 +43,6 @@ section Basic variable [TopologicalSpace V] [ENormedAddCommMonoid V] [T2Space V] {μ ν : VectorMeasure X V} -@[simp] lemma variation_apply (μ : VectorMeasure X V) (s : Set X) : μ.variation s = preVariation (‖μ ·‖ₑ) (isSigmaSubadditiveSetFun_enorm μ) (by simp) s := rfl @@ -96,14 +97,15 @@ lemma absolutelyContinuous (μ : VectorMeasure X V) : μ ≪ᵥ μ.ennrealVariat grw [enorm_measure_le_variation, ← ennrealVariation_apply _ hsm, hs] · exact μ.not_measurable' hsm -lemma variation_le_of_forall_enorm_le {m : Measure X} (h : ∀ E, MeasurableSet E → ‖μ E‖ₑ ≤ m E) : - μ.variation ≤ m := by - refine Measure.le_intro fun s hs _ => ?_ +lemma variation_apply_le_of_forall_enorm_le {m : Measure X} {s : Set X} (hs : MeasurableSet s) + (h : ∀ E, MeasurableSet E → E ⊆ s → ‖μ E‖ₑ ≤ m E) : + μ.variation s ≤ m s := by simp only [variation_apply, preVariation, ennrealToMeasure_apply hs, ennrealPreVariation_apply, preVariationFun, hs, dite_true, iSup_le_iff] intro i calc - ∑ x ∈ i.parts, ‖μ x‖ₑ ≤ ∑ x ∈ i.parts, m x := Finset.sum_le_sum (fun s hs => h s s.property) + ∑ x ∈ i.parts, ‖μ x‖ₑ ≤ ∑ x ∈ i.parts, m x := Finset.sum_le_sum + (fun s hs => h s s.property (i.le hs)) _ = m (i.parts.sup Subtype.val) := by rw [sup_set_eq_biUnion] refine (MeasureTheory.measure_biUnion_finset ?_ fun b _ => b.property).symm @@ -113,6 +115,10 @@ lemma variation_le_of_forall_enorm_le {m : Measure X} (h : ∀ E, MeasurableSet rw [sup_set_eq_biUnion] exact measure_mono <| Set.iUnion₂_subset fun _ hp => Subtype.coe_le_coe.mpr (i.le hp) +lemma variation_le_of_forall_enorm_le {m : Measure X} (h : ∀ E, MeasurableSet E → ‖μ E‖ₑ ≤ m E) : + μ.variation ≤ m := + Measure.le_intro fun _ hs _ => variation_apply_le_of_forall_enorm_le hs (fun E hE _ ↦ h E hE) + lemma variation_add_le [ContinuousAdd V] : variation (μ + ν) ≤ variation μ + variation ν := by refine variation_le_of_forall_enorm_le fun E _ => ?_ calc @@ -129,6 +135,91 @@ lemma variation_finsetSum_le [ContinuousAdd V] {ι} (s : Finset ι) (μ : ι → simpa [Finset.sum_insert his] using variation_add_le.trans (add_le_add_right ih ((μ i).variation)) +lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : MeasurableSet s) : + μ.variation s = 0 ↔ ∀ t, t ⊆ s → MeasurableSet t → μ t = 0 := by + refine ⟨fun h t hts ht ↦ ?_, fun h ↦ ?_⟩ + · apply enorm_eq_zero.1 + apply le_antisymm ?_ zero_le + rw [← h] + apply (enorm_measure_le_variation _ _).trans (measure_mono hts) + · apply le_antisymm ?_ zero_le + change μ.variation s ≤ (0 : Measure X) s + apply variation_apply_le_of_forall_enorm_le hs (fun t ht hts ↦ ?_) + simp [h t hts ht] + +@[simp] lemma variation_eq_zero {μ : VectorMeasure X V} : + μ.variation = 0 ↔ μ = 0 := by + refine ⟨fun h ↦ ?_, fun h ↦ by simp [h]⟩ + ext s hs + apply enorm_eq_zero.1 + apply le_antisymm ?_ (by simp) + grw [enorm_measure_le_variation] + simp [h] + +lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) : + (μ.restrict s).variation = μ.variation.restrict s := by + apply le_antisymm + · apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) + simp only [ht, Measure.restrict_apply, VectorMeasure.restrict_apply, hs] + apply enorm_measure_le_variation + · apply Measure.le_iff.2 (fun t ht ↦ ?_) + simp only [ht, Measure.restrict_apply] + calc μ.variation (t ∩ s) + _ ≤ (μ.restrict s).variation (t ∩ s) := by + apply variation_apply_le_of_forall_enorm_le (ht.inter hs) (fun u u_meas hu ↦ ?_) + have : μ u = μ.restrict s u := by + rw [VectorMeasure.restrict_apply _ hs u_meas] + congr + grind + rw [this] + apply enorm_measure_le_variation + _ ≤ (μ.restrict s).variation t := by + gcongr + exact Set.inter_subset_left + +lemma variation_restrict_le (μ : VectorMeasure X V) (s : Set X) : + (μ.restrict s).variation ≤ μ.variation.restrict s := by + by_cases hs : MeasurableSet s + · simp [variation_restrict μ hs] + · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] + +lemma variation_map_le {Y : Type*} [MeasurableSpace Y] {φ : X → Y} : + (μ.map φ).variation ≤ Measure.map φ μ.variation := by + by_cases hφ : Measurable φ; swap + · simp [VectorMeasure.map, hφ, Measure.zero_le] + apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + simp only [Measure.map_apply hφ hs] + apply le_trans ?_ (enorm_measure_le_variation _ _) + simp [VectorMeasure.map_apply _ hφ hs] + +theorem _root_.MeasurableEmbedding.variation_map {Y : Type*} [MeasurableSpace Y] {φ : X → Y} + (hφ : MeasurableEmbedding φ) : + (μ.map φ).variation = μ.variation.map φ := by + apply le_antisymm variation_map_le ?_ + apply Measure.le_iff.2 (fun s hs ↦ ?_) + simp only [hφ.measurable, hs, Measure.map_apply] + have : (μ.map φ).variation s = (μ.map φ).variation (s ∩ range φ) := by + nth_rw 1 [← inter_union_diff s (range φ)] + have : (μ.map φ).variation (s \ range φ) = 0 := by + apply (variation_apply_eq_zero (hs.diff hφ.measurableSet_range)).2 (fun t ht t_meas ↦ ?_) + have : φ ⁻¹' t = ∅ := by grind + simp [map_apply, t_meas, hφ.measurable, this] + rw [measure_union (by grind) (hs.diff hφ.measurableSet_range), this, add_zero] + rw [this, ← hφ.comap_preimage] + apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) + simp only [hφ.comap_apply] + apply le_trans ?_ (enorm_measure_le_variation _ _) + rw [map_apply _ hφ.measurable (hφ.measurableSet_image.2 ht), preimage_image_eq _ hφ.injective] + +@[simp] lemma variation_dirac (x : X) (v : V) : + (VectorMeasure.dirac x v).variation = ‖v‖ₑ • Measure.dirac x := by + apply le_antisymm + · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + by_cases hx : x ∈ s <;> simp [hs, hx] + · apply Measure.le_iff.2 (fun s hs ↦ ?_) + apply le_trans ?_ (enorm_measure_le_variation _ _) + by_cases hx : x ∈ s <;> simp [hs, hx] + end Basic section NormedAddCommGroup @@ -147,6 +238,34 @@ lemma variation_neg : (-μ).variation = μ.variation := by simp [variation] lemma variation_sub_le : (μ - ν).variation ≤ μ.variation + ν.variation := by grw [sub_eq_add_neg, variation_add_le, variation_neg] +private lemma variation_smul_le {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : 𝕜} : + (c • μ).variation ≤ ‖c‖₊ • μ.variation := by + apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + simp only [coe_smul, Pi.smul_apply, enorm_smul, Measure.smul_apply, Measure.nnreal_smul_coe_apply] + grw [enorm_measure_le_variation] + exact le_rfl + +lemma variation_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : 𝕜} : + (c • μ).variation = ‖c‖₊ • μ.variation := by + apply le_antisymm variation_smul_le ?_ + rcases eq_or_ne c 0 with rfl | hc + · simp + calc ‖c‖₊ • μ.variation + _ = ‖c‖₊ • (c⁻¹ • (c • μ)).variation := by simp [smul_smul, inv_mul_cancel₀ hc] + _ ≤ ‖c‖₊ • ‖c⁻¹‖₊ • (c • μ).variation := by + gcongr + exact variation_smul_le + _ = (c • μ).variation := by + simp [smul_smul, mul_inv_cancel₀ (nnnorm_ne_zero_iff.mpr hc)] + +instance [Finite X] : IsFiniteMeasure μ.variation := by + classical + let : Fintype X := Fintype.ofFinite X + constructor + simp only [variation_apply, preVariation_apply, MeasurableSet.univ, ennrealToMeasure_apply, + ennrealPreVariation_apply, preVariationFun, ↓reduceDIte, ← sup_univ_eq_ciSup] + exact (Finset.sup_lt_iff (by simp)).2 (fun b hb ↦ by simp [ENNReal.sum_lt_top, enorm_lt_top]) + end NormedAddCommGroup end MeasureTheory.VectorMeasure From b975b6d444f34320b9d393dcc2c32d140b55145d Mon Sep 17 00:00:00 2001 From: sgouezel Date: Wed, 20 May 2026 16:08:39 +0200 Subject: [PATCH 040/129] missing bits --- Mathlib/Data/ENNReal/Action.lean | 6 ++++++ Mathlib/MeasureTheory/Measure/MeasureSpace.lean | 9 +++++++++ .../VectorMeasure/Variation/Basic.lean | 17 +++++++++-------- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Mathlib/Data/ENNReal/Action.lean b/Mathlib/Data/ENNReal/Action.lean index d6ba39d13c1c4c..431d6397d5b04d 100644 --- a/Mathlib/Data/ENNReal/Action.lean +++ b/Mathlib/Data/ENNReal/Action.lean @@ -104,6 +104,12 @@ instance : PosSMulStrictMono ℝ≥0 ℝ≥0∞ where instance : SMulPosMono ℝ≥0 ℝ≥0∞ where smul_le_smul_of_nonneg_right _r _ _a _b hab := _root_.mul_le_mul_left (coe_le_coe.2 hab) _ +instance : CovariantClass ℝ≥0∞ ℝ≥0∞ (· • ·) (· ≤ ·) := + inferInstanceAs <| CovariantClass ℝ≥0∞ ℝ≥0∞ (· * ·) (· ≤ ·) + +instance : CovariantClass ℝ≥0 ℝ≥0∞ (· • ·) (· ≤ ·) := + ⟨fun x x y hxy ↦ by simpa [ENNReal.smul_def] using mul_le_mul_right hxy _⟩ + end Actions end ENNReal diff --git a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean index dfdbb0f4299ba0..c15b18d4e60997 100644 --- a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean +++ b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean @@ -1079,6 +1079,13 @@ protected theorem le_add_left (h : μ ≤ ν) : μ ≤ ν' + ν := fun s => le_a protected theorem le_add_right (h : μ ≤ ν) : μ ≤ ν + ν' := fun s => le_add_right (h s) +instance [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] [CovariantClass R ℝ≥0∞ (· • ·) (· ≤ ·)] : + CovariantClass R (Measure α) (· • ·) (· ≤ ·) := by + constructor + intro c μ ν hμν s + simp only [smul_apply] + gcongr + section sInf variable {m : Set (Measure α)} @@ -1494,3 +1501,5 @@ end end MeasureTheory end + +set_option linter.style.longFile 1700 diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index 3a2b5e5063a48c..64101ada399576 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -41,7 +41,8 @@ variable {X V : Type*} {mX : MeasurableSpace X} section Basic -variable [TopologicalSpace V] [ENormedAddCommMonoid V] [T2Space V] {μ ν : VectorMeasure X V} +variable [TopologicalSpace V] [ENormedAddCommMonoid V] [T2Space V] + {μ ν : VectorMeasure X V} {s : Set X} lemma variation_apply (μ : VectorMeasure X V) (s : Set X) : μ.variation s = preVariation (‖μ ·‖ₑ) (isSigmaSubadditiveSetFun_enorm μ) (by simp) s := rfl @@ -135,7 +136,7 @@ lemma variation_finsetSum_le [ContinuousAdd V] {ι} (s : Finset ι) (μ : ι → simpa [Finset.sum_insert his] using variation_add_le.trans (add_le_add_right ih ((μ i).variation)) -lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : MeasurableSet s) : +lemma variation_apply_eq_zero (hs : MeasurableSet s) : μ.variation s = 0 ↔ ∀ t, t ⊆ s → MeasurableSet t → μ t = 0 := by refine ⟨fun h t hts ht ↦ ?_, fun h ↦ ?_⟩ · apply enorm_eq_zero.1 @@ -147,7 +148,7 @@ lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : Measura apply variation_apply_le_of_forall_enorm_le hs (fun t ht hts ↦ ?_) simp [h t hts ht] -@[simp] lemma variation_eq_zero {μ : VectorMeasure X V} : +@[simp] lemma variation_eq_zero : μ.variation = 0 ↔ μ = 0 := by refine ⟨fun h ↦ ?_, fun h ↦ by simp [h]⟩ ext s hs @@ -156,7 +157,7 @@ lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : Measura grw [enorm_measure_le_variation] simp [h] -lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) : +lemma variation_restrict (hs : MeasurableSet s) : (μ.restrict s).variation = μ.variation.restrict s := by apply le_antisymm · apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) @@ -177,14 +178,14 @@ lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSe gcongr exact Set.inter_subset_left -lemma variation_restrict_le (μ : VectorMeasure X V) (s : Set X) : +lemma variation_restrict_le : (μ.restrict s).variation ≤ μ.variation.restrict s := by by_cases hs : MeasurableSet s - · simp [variation_restrict μ hs] + · simp [variation_restrict hs] · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] lemma variation_map_le {Y : Type*} [MeasurableSpace Y] {φ : X → Y} : - (μ.map φ).variation ≤ Measure.map φ μ.variation := by + (μ.map φ).variation ≤ Measure.map φ μ.variation := by by_cases hφ : Measurable φ; swap · simp [VectorMeasure.map, hφ, Measure.zero_le] apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) @@ -211,7 +212,7 @@ theorem _root_.MeasurableEmbedding.variation_map {Y : Type*} [MeasurableSpace Y] apply le_trans ?_ (enorm_measure_le_variation _ _) rw [map_apply _ hφ.measurable (hφ.measurableSet_image.2 ht), preimage_image_eq _ hφ.injective] -@[simp] lemma variation_dirac (x : X) (v : V) : +@[simp] lemma variation_dirac {x : X} {v : V} : (VectorMeasure.dirac x v).variation = ‖v‖ₑ • Measure.dirac x := by apply le_antisymm · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) From 9d9db7b00f4537f538ea59b2f692d3f902f9c6e1 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Wed, 20 May 2026 17:02:24 +0200 Subject: [PATCH 041/129] fix --- .../MeasureTheory/VectorMeasure/Integral.lean | 12 +- .../VectorMeasure/SetIntegral.lean | 1179 +++++++++++++++++ 2 files changed, 1189 insertions(+), 2 deletions(-) create mode 100644 Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 0b21d2d49847b6..8f506a5ef74755 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -5,6 +5,7 @@ Authors: Yoh Tanimoto -/ module +public import Mathlib.MeasureTheory.Integral.IntegrableOn public import Mathlib.MeasureTheory.Integral.SetToL1 public import Mathlib.MeasureTheory.VectorMeasure.Variation.Basic @@ -119,7 +120,7 @@ end cbmApplyMeasure namespace VectorMeasure -variable (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) {φ : X → Y} +variable (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) {f g : X → E} {φ : X → Y} @[simp] lemma transpose_zero : (0 : VectorMeasure X F).transpose B = 0 := by simp [transpose] @@ -172,6 +173,13 @@ respect to `(μ.transpose B).variation`. -/ protected abbrev Integrable (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : Prop := MeasureTheory.Integrable f (μ.transpose B).variation +/-- `f : X → E` is said to be integrable with respect to `μ` and `B` on `s` if it is integrable with +respect to the vector measure `μ.restrict s`. When `s` is measurable, this is equivalent to +integrability with respect to `(μ.transpose B).variation.restrict s`. -/ +protected abbrev IntegrableOn + (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) (s : Set X) : Prop := + (μ.restrict s).Integrable f B + open Classical in /-- The `G`-valued integral of `E`-valued function and the `F`-valued vector measure `μ` with linear paring `B : E →L[ℝ] F →L[ℝ] G` . This is set to be `0` if `G` is not complete or if `f` is not @@ -196,7 +204,7 @@ multiplication by `ℝ` on `F` and `f` is real-valued. The resulting integral is notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂•"μ:70 => integral (VectorMeasure.restrict μ s) r (lsmul ℝ ℝ) -variable {μ ν : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} +variable {μ ν B} @[simp] lemma integrable_zero_vectorMeasure : (0 : VectorMeasure X F).Integrable f B := by simp [VectorMeasure.Integrable, transpose] diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean new file mode 100644 index 00000000000000..bd2f345b61baad --- /dev/null +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -0,0 +1,1179 @@ +/- +Copyright (c) 2020 Zhouhang Zhou. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Zhouhang Zhou, Yury Kudryashov +-/ +module + +public import Mathlib.MeasureTheory.VectorMeasure.Integral + +/-! +# Set integral + +In this file we prove some properties of `∫ᵛ x in s, f x ∂[B; μ]`. Recall that this notation +is defined as `∫ᵛ x, f x ∂(μ.restrict s)`. In `integral_indicator` we prove that for a measurable +function `f` and a measurable set `s` this definition coincides with another natural definition: +`∫ᵛ x, indicator s f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ]`, where `indicator s f x` is equal to `f x` for `x ∈ s` +and is zero otherwise. + +Since `∫ᵛ x in s, f x ∂[B; μ]` is a notation, one can rewrite or apply any theorem about `∫ᵛ x, f x ∂[B; μ]` +directly. In this file we prove some theorems about dependence of `∫ᵛ x in s, f x ∂[B; μ]` on `s`, e.g. +`setIntegral_union`, `setIntegral_empty`, `setIntegral_univ`. + +We use the property `IntegrableOn f s μ := Integrable f (μ.restrict s)`, defined in +`MeasureTheory.IntegrableOn`. We also defined in that same file a predicate +`IntegrableAtFilter (f : X → E) (l : Filter X) (μ : Measure X)` saying that `f` is integrable at +some set `s ∈ l`. + +## Notation + +We provide the following notations for expressing the integral of a function on a set : +* `∫ᵛ x in s, f x ∂[B; μ]` is `MeasureTheory.integral (μ.restrict s) f` +* `∫ᵛ x in s, f x` is `∫ᵛ x in s, f x ∂volume` + +Note that the set notations are defined in the file +`Mathlib/MeasureTheory/Integral/Bochner/Basic.lean`, +but we reference them here because all theorems about set integrals are in this file. +-/ + +@[expose] public section + +assert_not_exists InnerProductSpace + +open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology +open scoped ENNReal NNReal Finset + +variable {X E F G : Type*} {mX : MeasurableSpace X} + [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + {μ ν : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} {s t : Set X} + +namespace MeasureTheory.VectorMeasure + +section NormedAddCommGroup + +theorem setIntegral_congr_ae (hs : MeasurableSet s) + (h : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ s → f x = g x) : + ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in s, g x ∂[B; μ] := by + apply integral_congr_ae + rw [transpose_restrict, variation_restrict _ hs] + exact (ae_restrict_iff' hs).2 h + +theorem setIntegral_congr_fun (hs : MeasurableSet s) (h : EqOn f g s) : + ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in s, g x ∂[B; μ] := + setIntegral_congr_ae hs <| Eventually.of_forall h + +theorem setIntegral_union (hst : Disjoint s t) (hs : MeasurableSet s) (ht : MeasurableSet t) + (hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) : + ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in t, f x ∂[B; μ] := by + simp only [Measure.restrict_union₀ hst ht, integral_add_measure hfs hft] + +#exit + +@[deprecated (since := "2026-03-04")] alias integral_union_ae := setIntegral_union₀ + +theorem setIntegral_union (hst : Disjoint s t) (ht : MeasurableSet t) (hfs : IntegrableOn f s μ) + (hft : IntegrableOn f t μ) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in t, f x ∂[B; μ] := + setIntegral_union₀ hst.aedisjoint ht.nullMeasurableSet hfs hft + +theorem setIntegral_diff₀ (ht : NullMeasurableSet t μ) (hfs : IntegrableOn f s μ) (hts : t ⊆ s) : + ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] - ∫ᵛ x in t, f x ∂[B; μ] := by + rw [eq_sub_iff_add_eq, ← setIntegral_union₀, diff_union_of_subset hts] + exacts [disjoint_sdiff_self_left.aedisjoint, ht, hfs.mono_set diff_subset, hfs.mono_set hts] + +theorem setIntegral_diff (ht : MeasurableSet t) (hfs : IntegrableOn f s μ) (hts : t ⊆ s) : + ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] - ∫ᵛ x in t, f x ∂[B; μ] := + setIntegral_diff₀ ht.nullMeasurableSet hfs hts + +@[deprecated (since := "2026-03-04")] alias integral_diff := setIntegral_diff + +theorem integral_inter_add_diff₀ (ht : NullMeasurableSet t μ) (hfs : IntegrableOn f s μ) : + ∫ᵛ x in s ∩ t, f x ∂[B; μ] + ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + rw [← Measure.restrict_inter_add_diff₀ s ht, integral_add_measure] + · exact Integrable.mono_measure hfs (Measure.restrict_mono inter_subset_left le_rfl) + · exact Integrable.mono_measure hfs (Measure.restrict_mono diff_subset le_rfl) + +theorem integral_inter_add_diff (ht : MeasurableSet t) (hfs : IntegrableOn f s μ) : + ∫ᵛ x in s ∩ t, f x ∂[B; μ] + ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := + integral_inter_add_diff₀ ht.nullMeasurableSet hfs + +theorem integral_biUnion_finset {ι : Type*} (t : Finset ι) {s : ι → Set X} + (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s)) + (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) : + ∫ᵛ x in ⋃ i ∈ t, s i, f x ∂[B; μ] = ∑ i ∈ t, ∫ᵛ x in s i, f x ∂[B; μ] := by + classical + induction t using Finset.induction_on with + | empty => simp + | insert _ _ hat IH => + simp only [Finset.coe_insert, Finset.forall_mem_insert, Set.pairwise_insert, + Finset.set_biUnion_insert] at hs hf h's ⊢ + rw [setIntegral_union _ _ hf.1 (integrableOn_finset_iUnion.2 hf.2)] + · rw [Finset.sum_insert hat, IH hs.2 h's.1 hf.2] + · simp only [disjoint_iUnion_right] + exact fun i hi => (h's.2 i hi (ne_of_mem_of_not_mem hi hat).symm).1 + · exact Finset.measurableSet_biUnion _ hs.2 + +theorem integral_iUnion_fintype {ι : Type*} [Fintype ι] {s : ι → Set X} + (hs : ∀ i, MeasurableSet (s i)) (h's : Pairwise (Disjoint on s)) + (hf : ∀ i, IntegrableOn f (s i) μ) : ∫ᵛ x in ⋃ i, s i, f x ∂[B; μ] = ∑ i, ∫ᵛ x in s i, f x ∂[B; μ] := by + convert integral_biUnion_finset Finset.univ (fun i _ => hs i) _ fun i _ => hf i + · simp + · simp [pairwise_univ, h's] + +theorem setIntegral_empty : ∫ᵛ x in ∅, f x ∂[B; μ] = 0 := by + rw [Measure.restrict_empty, integral_zero_measure] + +theorem setIntegral_univ : ∫ᵛ x in univ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by rw [Measure.restrict_univ] + +lemma integral_eq_setIntegral (hs : ∀ᵐ x ∂[B; μ], x ∈ s) (f : X → E) : + ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + rw [← setIntegral_univ, ← setIntegral_congr_set]; rwa [ae_eq_univ] + +theorem integral_add_compl₀ (hs : NullMeasurableSet s μ) (hfi : Integrable f μ) : + ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by + have := setIntegral_union₀ disjoint_compl_right.aedisjoint + hs.compl hfi.integrableOn hfi.integrableOn + rw [← this, union_compl_self, setIntegral_univ] + +theorem integral_add_compl (hs : MeasurableSet s) (hfi : Integrable f μ) : + ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := + integral_add_compl₀ hs.nullMeasurableSet hfi + +theorem setIntegral_compl₀ (hs : NullMeasurableSet s μ) (hfi : Integrable f μ) : + ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ] := by + rw [← integral_add_compl₀ (μ := μ) hs hfi, add_sub_cancel_left] + +theorem setIntegral_compl (hs : MeasurableSet s) (hfi : Integrable f μ) : + ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ] := + setIntegral_compl₀ hs.nullMeasurableSet hfi + +/-- For a function `f` and a measurable set `s`, the integral of `indicator s f` +over the whole space is equal to `∫ᵛ x in s, f x ∂[B; μ]` defined as `∫ᵛ x, f x ∂(μ.restrict s)`. -/ +theorem integral_indicator (hs : MeasurableSet s) : + ∫ᵛ x, indicator s f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + by_cases hfi : IntegrableOn f s μ; swap + · rw [integral_undef hfi, integral_undef] + rwa [integrable_indicator_iff hs] + calc + ∫ᵛ x, indicator s f x ∂[B; μ] = ∫ᵛ x in s, indicator s f x ∂[B; μ] + ∫ᵛ x in sᶜ, indicator s f x ∂[B; μ] := + (integral_add_compl hs (hfi.integrable_indicator hs)).symm + _ = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, 0 ∂[B; μ] := + (congr_arg₂ (· + ·) (integral_congr_ae (indicator_ae_eq_restrict hs)) + (integral_congr_ae (indicator_ae_eq_restrict_compl hs))) + _ = ∫ᵛ x in s, f x ∂[B; μ] := by simp + +theorem integral_indicator₀ (hs : NullMeasurableSet s μ) : + ∫ᵛ x, indicator s f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + rw [← integral_congr_ae (indicator_ae_eq_of_ae_eq_set hs.toMeasurable_ae_eq), + integral_indicator (measurableSet_toMeasurable _ _), + Measure.restrict_congr_set hs.toMeasurable_ae_eq] + +lemma integral_integral_indicator {mY : MeasurableSpace Y} {ν : Measure Y} (f : X → Y → E) + {s : Set X} (hs : MeasurableSet s) : + ∫ᵛ x, ∫ᵛ y, s.indicator (f · y) x ∂ν ∂[B; μ] = ∫ᵛ x in s, ∫ᵛ y, f x y ∂ν ∂[B; μ] := by + simp_rw [← integral_indicator hs, integral_indicator₂] + +theorem setIntegral_indicator (ht : MeasurableSet t) : + ∫ᵛ x in s, t.indicator f x ∂[B; μ] = ∫ᵛ x in s ∩ t, f x ∂[B; μ] := by + rw [integral_indicator ht, Measure.restrict_restrict ht, Set.inter_comm] + +/-- **Inclusion-exclusion principle** for the integral of a function over a union. + +The integral of a function `f` over the union of the `s i` over `i ∈ t` is the alternating sum of +the integrals of `f` over the intersections of the `s i`. -/ +theorem integral_biUnion_eq_sum_powerset {ι : Type*} {t : Finset ι} {s : ι → Set X} + (hs : ∀ i ∈ t, MeasurableSet (s i)) (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) : + ∫ᵛ x in ⋃ i ∈ t, s i, f x ∂[B; μ] = ∑ u ∈ t.powerset with u.Nonempty, + (-1 : ℝ) ^ (#u + 1) • ∫ᵛ x in ⋂ i ∈ u, s i, f x ∂[B; μ] := by + simp_rw [← integral_smul, ← integral_indicator (Finset.measurableSet_biUnion _ hs)] + have A (u) (hu : u ∈ t.powerset.filter (·.Nonempty)) : MeasurableSet (⋂ i ∈ u, s i) := by + refine u.measurableSet_biInter fun i hi ↦ hs i ?_ + grind + have : ∑ x ∈ t.powerset with x.Nonempty, ∫ᵛ (a : X) in ⋂ i ∈ x, s i, (-1 : ℝ) ^ (#x + 1) • f a ∂[B; μ] + = ∑ x ∈ t.powerset with x.Nonempty, ∫ᵛ a, indicator (⋂ i ∈ x, s i) + (fun a ↦ (-1 : ℝ) ^ (#x + 1) • f a) a ∂[B; μ] := by + apply Finset.sum_congr rfl (fun x hx ↦ ?_) + rw [← integral_indicator (A x hx)] + rw [this, ← integral_finsetSum]; swap + · intro u hu + rw [integrable_indicator_iff (A u hu)] + apply Integrable.smul + simp only [Finset.mem_filter, Finset.mem_powerset] at hu + rcases hu.2 with ⟨i, hi⟩ + exact (hf i (hu.1 hi)).mono (biInter_subset_of_mem hi) le_rfl + congr with x + convert Finset.indicator_biUnion_eq_sum_powerset t s f x with u hu + rw [indicator_smul_apply] + norm_cast + +theorem ofReal_setIntegral_one_of_measure_ne_top {X : Type*} {m : MeasurableSpace X} + {μ : Measure X} {s : Set X} (hs : μ s ≠ ∞ := by finiteness) : + ENNReal.ofReal (∫ᵛ _ in s, (1 : ℝ) ∂[B; μ]) = μ s := + calc + ENNReal.ofReal (∫ᵛ _ in s, (1 : ℝ) ∂[B; μ]) = ENNReal.ofReal (∫ᵛ _ in s, ‖(1 : ℝ)‖ ∂[B; μ]) := by + simp only [norm_one] + _ = ∫⁻ _ in s, 1 ∂[B; μ] := by simp [measureReal_def, hs] + _ = μ s := setLIntegral_one _ + +theorem ofReal_setIntegral_one {X : Type*} {_ : MeasurableSpace X} (μ : Measure X) + [IsFiniteMeasure μ] (s : Set X) : ENNReal.ofReal (∫ᵛ _ in s, (1 : ℝ) ∂[B; μ]) = μ s := + ofReal_setIntegral_one_of_measure_ne_top + +theorem setIntegral_one_eq_measureReal {X : Type*} {m : MeasurableSpace X} + {μ : Measure X} {s : Set X} : + ∫ᵛ _ in s, (1 : ℝ) ∂[B; μ] = μ.real s := by simp + +/-- **Inclusion-exclusion principle** for the measure of a union of sets of finite measure. + +The measure of the union of the `s i` over `i ∈ t` is the alternating sum of the measures of the +intersections of the `s i`. -/ +theorem measureReal_biUnion_eq_sum_powerset {ι : Type*} {t : Finset ι} {s : ι → Set X} + (hs : ∀ i ∈ t, MeasurableSet (s i)) (hf : ∀ i ∈ t, μ (s i) ≠ ∞ := by finiteness) : + μ.real (⋃ i ∈ t, s i) = ∑ u ∈ t.powerset with u.Nonempty, + (-1 : ℝ) ^ (#u + 1) * μ.real (⋂ i ∈ u, s i) := by + simp_rw [← setIntegral_one_eq_measureReal] + apply integral_biUnion_eq_sum_powerset hs + intro i hi + simpa using (hf i hi).lt_top + +theorem integral_piecewise [DecidablePred (· ∈ s)] (hs : MeasurableSet s) (hf : IntegrableOn f s μ) + (hg : IntegrableOn g sᶜ μ) : + ∫ᵛ x, s.piecewise f g x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, g x ∂[B; μ] := by + rw [← Set.indicator_add_compl_eq_piecewise, + integral_add' (hf.integrable_indicator hs) (hg.integrable_indicator hs.compl), + integral_indicator hs, integral_indicator hs.compl] + +theorem tendsto_setIntegral_of_monotone₀ + {ι : Type*} [Preorder ι] [(atTop : Filter ι).IsCountablyGenerated] + {s : ι → Set X} (hsm : ∀ i, NullMeasurableSet (s i) μ) (h_mono : Monotone s) + (hfi : IntegrableOn f (⋃ n, s n) μ) : + Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) atTop (𝓝 (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ])) := by + refine .of_neBot_imp fun hne ↦ ?_ + have := (atTop_neBot_iff.mp hne).2 + have hfi' : ∫⁻ x in ⋃ n, s n, ‖f x‖₊ ∂[B; μ] < ∞ := hfi.2 + set S := ⋃ i, s i + have hSm : NullMeasurableSet S μ := MeasurableSet.iUnion_of_monotone h_mono hsm + have hsub {i} : s i ⊆ S := subset_iUnion s i + rw [← withDensity_apply₀ _ hSm] at hfi' + set ν := μ.withDensity (‖f ·‖ₑ) with hν + refine Metric.nhds_basis_closedBall.tendsto_right_iff.2 fun ε ε0 => ?_ + lift ε to ℝ≥0 using ε0.le + have : ∀ᶠ i in atTop, ν (s i) ∈ Icc (ν S - ε) (ν S + ε) := + tendsto_measure_iUnion_atTop h_mono (ENNReal.Icc_mem_nhds hfi'.ne (ENNReal.coe_pos.2 ε0).ne') + filter_upwards [this] with i hi + rw [mem_closedBall_iff_norm', ← setIntegral_diff₀ (hsm i) hfi hsub, ← coe_nnnorm, + NNReal.coe_le_coe, ← ENNReal.coe_le_coe] + refine (enorm_integral_le_lintegral_enorm _).trans ?_ + have hsm' : NullMeasurableSet (s i) ν := (hsm i).mono_ac (withDensity_absolutelyContinuous ..) + rw [← withDensity_apply₀ _ (hSm.diff (hsm _)), ← hν, measure_diff hsub hsm'] + exacts [tsub_le_iff_tsub_le.mp hi.1, + (hi.2.trans_lt <| ENNReal.add_lt_top.2 ⟨hfi', ENNReal.coe_lt_top⟩).ne] + +theorem tendsto_setIntegral_of_monotone + {ι : Type*} [Preorder ι] [(atTop : Filter ι).IsCountablyGenerated] + {s : ι → Set X} (hsm : ∀ i, MeasurableSet (s i)) (h_mono : Monotone s) + (hfi : IntegrableOn f (⋃ n, s n) μ) : + Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) atTop (𝓝 (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ])) := + tendsto_setIntegral_of_monotone₀ (hsm · |>.nullMeasurableSet) h_mono hfi + +theorem tendsto_setIntegral_of_antitone + {ι : Type*} [Preorder ι] [(atTop : Filter ι).IsCountablyGenerated] + {s : ι → Set X} (hsm : ∀ i, MeasurableSet (s i)) (h_anti : Antitone s) + (hfi : ∃ i, IntegrableOn f (s i) μ) : + Tendsto (fun i ↦ ∫ᵛ x in s i, f x ∂[B; μ]) atTop (𝓝 (∫ᵛ x in ⋂ n, s n, f x ∂[B; μ])) := by + refine .of_neBot_imp fun hne ↦ ?_ + have := (atTop_neBot_iff.mp hne).2 + rcases hfi with ⟨i₀, hi₀⟩ + suffices Tendsto (∫ᵛ x in s i₀, f x ∂[B; μ] - ∫ᵛ x in s i₀ \ s ·, f x ∂[B; μ]) atTop + (𝓝 (∫ᵛ x in s i₀, f x ∂[B; μ] - ∫ᵛ x in ⋃ i, s i₀ \ s i, f x ∂[B; μ])) by + convert this.congr' <| (eventually_ge_atTop i₀).mono fun i hi ↦ ?_ + · rw [← diff_iInter, setIntegral_diff _ hi₀ (iInter_subset _ _), sub_sub_cancel] + exact .iInter_of_antitone h_anti hsm + · rw [setIntegral_diff (hsm i) hi₀ (h_anti hi), sub_sub_cancel] + apply tendsto_const_nhds.sub + refine tendsto_setIntegral_of_monotone (by measurability) ?_ ?_ + · exact fun i j h ↦ diff_subset_diff_right (h_anti h) + · rw [← diff_iInter] + exact hi₀.mono_set diff_subset + +theorem hasSum_integral_iUnion_ae {ι : Type*} [Countable ι] {s : ι → Set X} + (hm : ∀ i, NullMeasurableSet (s i) μ) (hd : Pairwise (AEDisjoint μ on s)) + (hfi : IntegrableOn f (⋃ i, s i) μ) : + HasSum (fun n => ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by + simp only [IntegrableOn, Measure.restrict_iUnion_ae hd hm] at hfi ⊢ + exact hasSum_integral_measure hfi + +theorem hasSum_integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} + (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) + (hfi : IntegrableOn f (⋃ i, s i) μ) : + HasSum (fun n => ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := + hasSum_integral_iUnion_ae (fun i => (hm i).nullMeasurableSet) (hd.mono fun _ _ h => h.aedisjoint) + hfi + +theorem integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) + (hd : Pairwise (Disjoint on s)) (hfi : IntegrableOn f (⋃ i, s i) μ) : + ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑' n, ∫ᵛ x in s n, f x ∂[B; μ] := + (HasSum.tsum_eq (hasSum_integral_iUnion hm hd hfi)).symm + +theorem integral_iUnion_ae {ι : Type*} [Countable ι] {s : ι → Set X} + (hm : ∀ i, NullMeasurableSet (s i) μ) (hd : Pairwise (AEDisjoint μ on s)) + (hfi : IntegrableOn f (⋃ i, s i) μ) : ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑' n, ∫ᵛ x in s n, f x ∂[B; μ] := + (HasSum.tsum_eq (hasSum_integral_iUnion_ae hm hd hfi)).symm + +theorem setIntegral_eq_zero_of_ae_eq_zero (ht_eq : ∀ᵐ x ∂[B; μ], x ∈ t → f x = 0) : + ∫ᵛ x in t, f x ∂[B; μ] = 0 := by + by_cases hf : AEStronglyMeasurable f (μ.restrict t); swap + · rw [integral_undef] + contrapose hf + exact hf.1 + have : ∫ᵛ x in t, hf.mk f x ∂[B; μ] = 0 := by + refine integral_eq_zero_of_ae ?_ + rw [EventuallyEq, + ae_restrict_iff (hf.stronglyMeasurable_mk.measurableSet_eq_fun stronglyMeasurable_zero)] + filter_upwards [ae_imp_of_ae_restrict hf.ae_eq_mk, ht_eq] with x hx h'x h''x + rw [← hx h''x] + exact h'x h''x + rw [← this] + exact integral_congr_ae hf.ae_eq_mk + +theorem setIntegral_eq_zero_of_forall_eq_zero (ht_eq : ∀ x ∈ t, f x = 0) : + ∫ᵛ x in t, f x ∂[B; μ] = 0 := + setIntegral_eq_zero_of_ae_eq_zero (Eventually.of_forall ht_eq) + +theorem frequently_ae_ne_zero_of_setIntegral_ne_zero (hU : ∫ᵛ x in t, f x ∂[B; μ] ≠ 0) : + ∃ᶠ x in ae (μ.restrict t), f x ≠ 0 := + frequently_ae_ne_zero_of_integral_ne_zero hU + +theorem exists_ne_zero_of_setIntegral_ne_zero (hU : ∫ᵛ x in t, f x ∂[B; μ] ≠ 0) : + ∃ x, x ∈ t ∧ f x ≠ 0 := by + contrapose! hU; exact setIntegral_eq_zero_of_forall_eq_zero hU + +theorem integral_union_eq_left_of_ae_aux (ht_eq : ∀ᵐ x ∂[B; μ].restrict t, f x = 0) + (haux : StronglyMeasurable f) (H : IntegrableOn f (s ∪ t) μ) : + ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + let k := f ⁻¹' {0} + have hk : MeasurableSet k := by borelize E; exact haux.measurable (measurableSet_singleton _) + have h's : IntegrableOn f s μ := H.mono subset_union_left le_rfl + have A : ∀ u : Set X, ∫ᵛ x in u ∩ k, f x ∂[B; μ] = 0 := fun u => + setIntegral_eq_zero_of_forall_eq_zero fun x hx => hx.2 + rw [← integral_inter_add_diff hk h's, ← integral_inter_add_diff hk H, A, A, zero_add, zero_add, + union_diff_distrib, union_comm] + apply setIntegral_congr_set + rw [union_ae_eq_right] + apply measure_mono_null diff_subset + rw [measure_eq_zero_iff_ae_notMem] + filter_upwards [ae_imp_of_ae_restrict ht_eq] with x hx h'x using h'x.2 (hx h'x.1) + +theorem integral_union_eq_left_of_ae (ht_eq : ∀ᵐ x ∂[B; μ].restrict t, f x = 0) : + ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + have ht : IntegrableOn f t μ := by apply integrableOn_zero.congr_fun_ae; symm; exact ht_eq + by_cases H : IntegrableOn f (s ∪ t) μ; swap + · rw [integral_undef H, integral_undef]; simpa [integrableOn_union, ht] using H + let f' := H.1.mk f + calc + ∫ᵛ x : X in s ∪ t, f x ∂[B; μ] = ∫ᵛ x : X in s ∪ t, f' x ∂[B; μ] := integral_congr_ae H.1.ae_eq_mk + _ = ∫ᵛ x in s, f' x ∂[B; μ] := by + apply + integral_union_eq_left_of_ae_aux _ H.1.stronglyMeasurable_mk (H.congr_fun_ae H.1.ae_eq_mk) + filter_upwards [ht_eq, + ae_mono (Measure.restrict_mono subset_union_right le_rfl) H.1.ae_eq_mk] with x hx h'x + rw [← h'x, hx] + _ = ∫ᵛ x in s, f x ∂[B; μ] := + integral_congr_ae + (ae_mono (Measure.restrict_mono subset_union_left le_rfl) H.1.ae_eq_mk.symm) + +theorem integral_union_eq_left_of_forall₀ {f : X → E} (ht : NullMeasurableSet t μ) + (ht_eq : ∀ x ∈ t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := + integral_union_eq_left_of_ae ((ae_restrict_iff'₀ ht).2 (Eventually.of_forall ht_eq)) + +theorem integral_union_eq_left_of_forall {f : X → E} (ht : MeasurableSet t) + (ht_eq : ∀ x ∈ t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := + integral_union_eq_left_of_forall₀ ht.nullMeasurableSet ht_eq + +theorem setIntegral_eq_of_subset_of_ae_diff_eq_zero_aux (hts : s ⊆ t) + (h't : ∀ᵐ x ∂[B; μ], x ∈ t \ s → f x = 0) (haux : StronglyMeasurable f) + (h'aux : IntegrableOn f t μ) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + let k := f ⁻¹' {0} + have hk : MeasurableSet k := by borelize E; exact haux.measurable (measurableSet_singleton _) + calc + ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in t ∩ k, f x ∂[B; μ] + ∫ᵛ x in t \ k, f x ∂[B; μ] := by + rw [integral_inter_add_diff hk h'aux] + _ = ∫ᵛ x in t \ k, f x ∂[B; μ] := by + rw [setIntegral_eq_zero_of_forall_eq_zero fun x hx => ?_, zero_add]; exact hx.2 + _ = ∫ᵛ x in s \ k, f x ∂[B; μ] := by + apply setIntegral_congr_set + filter_upwards [h't] with x hx + change (x ∈ t \ k) = (x ∈ s \ k) + simp only [eq_iff_iff, and_congr_left_iff, mem_diff] + intro h'x + by_cases xs : x ∈ s + · simp only [xs, hts xs] + · simp only [xs, iff_false] + intro xt + exact h'x (hx ⟨xt, xs⟩) + _ = ∫ᵛ x in s ∩ k, f x ∂[B; μ] + ∫ᵛ x in s \ k, f x ∂[B; μ] := by + have : ∀ x ∈ s ∩ k, f x = 0 := fun x hx => hx.2 + rw [setIntegral_eq_zero_of_forall_eq_zero this, zero_add] + _ = ∫ᵛ x in s, f x ∂[B; μ] := by rw [integral_inter_add_diff hk (h'aux.mono hts le_rfl)] + +/-- If a function vanishes almost everywhere on `t \ s` with `s ⊆ t`, then its integrals on `s` +and `t` coincide if `t` is null-measurable. -/ +theorem setIntegral_eq_of_subset_of_ae_diff_eq_zero (ht : NullMeasurableSet t μ) (hts : s ⊆ t) + (h't : ∀ᵐ x ∂[B; μ], x ∈ t \ s → f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + by_cases h : IntegrableOn f t μ; swap + · have : ¬IntegrableOn f s μ := fun H => h (H.of_ae_diff_eq_zero ht h't) + rw [integral_undef h, integral_undef this] + let f' := h.1.mk f + calc + ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in t, f' x ∂[B; μ] := integral_congr_ae h.1.ae_eq_mk + _ = ∫ᵛ x in s, f' x ∂[B; μ] := by + apply + setIntegral_eq_of_subset_of_ae_diff_eq_zero_aux hts _ h.1.stronglyMeasurable_mk + (h.congr h.1.ae_eq_mk) + filter_upwards [h't, ae_imp_of_ae_restrict h.1.ae_eq_mk] with x hx h'x h''x + rw [← h'x h''x.1, hx h''x] + _ = ∫ᵛ x in s, f x ∂[B; μ] := by + apply integral_congr_ae + apply ae_restrict_of_ae_restrict_of_subset hts + exact h.1.ae_eq_mk.symm + +/-- If a function vanishes on `t \ s` with `s ⊆ t`, then its integrals on `s` +and `t` coincide if `t` is measurable. -/ +theorem setIntegral_eq_of_subset_of_forall_diff_eq_zero (ht : MeasurableSet t) (hts : s ⊆ t) + (h't : ∀ x ∈ t \ s, f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := + setIntegral_eq_of_subset_of_ae_diff_eq_zero ht.nullMeasurableSet hts + (Eventually.of_forall fun x hx => h't x hx) + +/-- If a function vanishes almost everywhere on `sᶜ`, then its integral on `s` +coincides with its integral on the whole space. -/ +theorem setIntegral_eq_integral_of_ae_compl_eq_zero (h : ∀ᵐ x ∂[B; μ], x ∉ s → f x = 0) : + ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by + symm + nth_rw 1 [← setIntegral_univ] + apply setIntegral_eq_of_subset_of_ae_diff_eq_zero nullMeasurableSet_univ (subset_univ _) + filter_upwards [h] with x hx h'x using hx h'x.2 + +/-- If a function vanishes on `sᶜ`, then its integral on `s` coincides with its integral on the +whole space. -/ +theorem setIntegral_eq_integral_of_forall_compl_eq_zero (h : ∀ x, x ∉ s → f x = 0) : + ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := + setIntegral_eq_integral_of_ae_compl_eq_zero (Eventually.of_forall h) + +theorem setIntegral_neg_eq_setIntegral_nonpos [PartialOrder E] {f : X → E} + (hf : AEStronglyMeasurable f μ) : + ∫ᵛ x in {x | f x < 0}, f x ∂[B; μ] = ∫ᵛ x in {x | f x ≤ 0}, f x ∂[B; μ] := by + have h_union : {x | f x ≤ 0} = {x | f x < 0} ∪ {x | f x = 0} := by + simp_rw [le_iff_lt_or_eq, setOf_or] + rw [h_union] + have B : NullMeasurableSet {x | f x = 0} μ := + hf.nullMeasurableSet_eq_fun aestronglyMeasurable_zero + symm + refine integral_union_eq_left_of_ae ?_ + filter_upwards [ae_restrict_mem₀ B] with x hx using hx + +theorem integral_norm_eq_pos_sub_neg {f : X → ℝ} (hfi : Integrable f μ) : + ∫ᵛ x, ‖f x‖ ∂[B; μ] = ∫ᵛ x in {x | 0 ≤ f x}, f x ∂[B; μ] - ∫ᵛ x in {x | f x ≤ 0}, f x ∂[B; μ] := + have h_meas : NullMeasurableSet {x | 0 ≤ f x} μ := + aestronglyMeasurable_const.nullMeasurableSet_le hfi.1 + calc + ∫ᵛ x, ‖f x‖ ∂[B; μ] = ∫ᵛ x in {x | 0 ≤ f x}, ‖f x‖ ∂[B; μ] + ∫ᵛ x in {x | 0 ≤ f x}ᶜ, ‖f x‖ ∂[B; μ] := by + rw [← integral_add_compl₀ h_meas hfi.norm] + _ = ∫ᵛ x in {x | 0 ≤ f x}, f x ∂[B; μ] + ∫ᵛ x in {x | 0 ≤ f x}ᶜ, ‖f x‖ ∂[B; μ] := by + congr 1 + refine setIntegral_congr_fun₀ h_meas fun x hx => ?_ + dsimp only + rw [Real.norm_eq_abs, abs_eq_self.mpr _] + exact hx + _ = ∫ᵛ x in {x | 0 ≤ f x}, f x ∂[B; μ] - ∫ᵛ x in {x | 0 ≤ f x}ᶜ, f x ∂[B; μ] := by + congr 1 + rw [← integral_neg] + refine setIntegral_congr_fun₀ h_meas.compl fun x hx => ?_ + dsimp only + rw [Real.norm_eq_abs, abs_eq_neg_self.mpr _] + rw [Set.mem_compl_iff, Set.notMem_setOf_iff] at hx + linarith + _ = ∫ᵛ x in {x | 0 ≤ f x}, f x ∂[B; μ] - ∫ᵛ x in {x | f x ≤ 0}, f x ∂[B; μ] := by + rw [← setIntegral_neg_eq_setIntegral_nonpos hfi.1, compl_setOf]; simp only [not_le] + +theorem setIntegral_const [CompleteSpace E] (c : E) : ∫ᵛ _ in s, c ∂[B; μ] = μ.real s • c := by + rw [integral_const, measureReal_restrict_apply_univ] + +@[simp] +theorem integral_indicator_const [CompleteSpace E] (e : E) ⦃s : Set X⦄ (s_meas : MeasurableSet s) : + ∫ᵛ x : X, s.indicator (fun _ : X => e) x ∂[B; μ] = μ.real s • e := by + rw [integral_indicator s_meas, ← setIntegral_const] + +@[simp] +theorem integral_indicator_one ⦃s : Set X⦄ (hs : MeasurableSet s) : + ∫ᵛ x, s.indicator 1 x ∂[B; μ] = μ.real s := + (integral_indicator_const 1 hs).trans ((smul_eq_mul ..).trans (mul_one _)) + +theorem setIntegral_indicatorConstLp [CompleteSpace E] + {p : ℝ≥0∞} (hs : MeasurableSet s) (ht : MeasurableSet t) (hμt : μ t ≠ ∞) (e : E) : + ∫ᵛ x in s, indicatorConstLp p ht hμt e x ∂[B; μ] = μ.real (t ∩ s) • e := + calc + ∫ᵛ x in s, indicatorConstLp p ht hμt e x ∂[B; μ] = ∫ᵛ x in s, t.indicator (fun _ => e) x ∂[B; μ] := by + rw [setIntegral_congr_ae hs (indicatorConstLp_coeFn.mono fun x hx _ => hx)] + _ = (μ.real (t ∩ s)) • e := by rw [integral_indicator_const _ ht, measureReal_restrict_apply ht] + +theorem integral_indicatorConstLp [CompleteSpace E] + {p : ℝ≥0∞} (ht : MeasurableSet t) (hμt : μ t ≠ ∞) (e : E) : + ∫ᵛ x, indicatorConstLp p ht hμt e x ∂[B; μ] = μ.real t • e := + calc + ∫ᵛ x, indicatorConstLp p ht hμt e x ∂[B; μ] = ∫ᵛ x in univ, indicatorConstLp p ht hμt e x ∂[B; μ] := by + rw [setIntegral_univ] + _ = μ.real (t ∩ univ) • e := setIntegral_indicatorConstLp MeasurableSet.univ ht hμt e + _ = μ.real t • e := by rw [inter_univ] + +theorem setIntegral_map {Y} [MeasurableSpace Y] {g : X → Y} {f : Y → E} {s : Set Y} + (hs : MeasurableSet s) (hf : AEStronglyMeasurable f (Measure.map g μ)) (hg : AEMeasurable g μ) : + ∫ᵛ y in s, f y ∂Measure.map g μ = ∫ᵛ x in g ⁻¹' s, f (g x) ∂[B; μ] := by + rw [Measure.restrict_map_of_aemeasurable hg hs, + integral_map (hg.mono_measure Measure.restrict_le_self) (hf.mono_measure _)] + exact Measure.map_mono_of_aemeasurable Measure.restrict_le_self hg + +theorem _root_.MeasurableEmbedding.setIntegral_map {Y} {_ : MeasurableSpace Y} {f : X → Y} + (hf : MeasurableEmbedding f) (g : Y → E) (s : Set Y) : + ∫ᵛ y in s, g y ∂Measure.map f μ = ∫ᵛ x in f ⁻¹' s, g (f x) ∂[B; μ] := by + rw [hf.restrict_map, hf.integral_map] + +theorem _root_.Topology.IsClosedEmbedding.setIntegral_map [TopologicalSpace X] [BorelSpace X] {Y} + [MeasurableSpace Y] [TopologicalSpace Y] [BorelSpace Y] {g : X → Y} {f : Y → E} (s : Set Y) + (hg : IsClosedEmbedding g) : ∫ᵛ y in s, f y ∂Measure.map g μ = ∫ᵛ x in g ⁻¹' s, f (g x) ∂[B; μ] := + hg.measurableEmbedding.setIntegral_map _ _ + +theorem MeasurePreserving.setIntegral_preimage_emb {Y} {_ : MeasurableSpace Y} {f : X → Y} {ν} + (h₁ : MeasurePreserving f μ ν) (h₂ : MeasurableEmbedding f) (g : Y → E) (s : Set Y) : + ∫ᵛ x in f ⁻¹' s, g (f x) ∂[B; μ] = ∫ᵛ y in s, g y ∂ν := + (h₁.restrict_preimage_emb h₂ s).integral_comp h₂ _ + +theorem MeasurePreserving.setIntegral_image_emb {Y} {_ : MeasurableSpace Y} {f : X → Y} {ν} + (h₁ : MeasurePreserving f μ ν) (h₂ : MeasurableEmbedding f) (g : Y → E) (s : Set X) : + ∫ᵛ y in f '' s, g y ∂ν = ∫ᵛ x in s, g (f x) ∂[B; μ] := + Eq.symm <| (h₁.restrict_image_emb h₂ s).integral_comp h₂ _ + +theorem setIntegral_map_equiv {Y} [MeasurableSpace Y] (e : X ≃ᵐ Y) (f : Y → E) (s : Set Y) : + ∫ᵛ y in s, f y ∂Measure.map e μ = ∫ᵛ x in e ⁻¹' s, f (e x) ∂[B; μ] := + e.measurableEmbedding.setIntegral_map f s + +theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} (hs : μ s < ∞) + (hC : ∀ᵐ x ∂[B; μ].restrict s, ‖f x‖ ≤ C) : ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.real s := by + rw [← Measure.restrict_apply_univ] at * + haveI : IsFiniteMeasure (μ.restrict s) := ⟨hs⟩ + simpa using norm_integral_le_of_norm_le_const hC + +theorem norm_setIntegral_le_of_norm_le_const_ae' {C : ℝ} (hs : μ s < ∞) + (hC : ∀ᵐ x ∂[B; μ], x ∈ s → ‖f x‖ ≤ C) : ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.real s := by + by_cases hfm : AEStronglyMeasurable f (μ.restrict s) + · apply norm_setIntegral_le_of_norm_le_const_ae hs + have A : ∀ᵐ x : X ∂[B; μ], x ∈ s → ‖AEStronglyMeasurable.mk f hfm x‖ ≤ C := by + filter_upwards [hC, hfm.ae_mem_imp_eq_mk] with _ h1 h2 h3 + rw [← h2 h3] + exact h1 h3 + have B : MeasurableSet {x | ‖hfm.mk f x‖ ≤ C} := + hfm.stronglyMeasurable_mk.norm.measurable measurableSet_Iic + filter_upwards [hfm.ae_eq_mk, (ae_restrict_iff B).2 A] with _ h1 _ + rwa [h1] + · rw [integral_non_aestronglyMeasurable hfm] + have : ∃ᵐ (x : X) ∂[B; μ], x ∈ s := by + apply frequently_ae_mem_iff.mpr + contrapose hfm + simp [Measure.restrict_eq_zero.mpr hfm] + rcases (this.and_eventually hC).exists with ⟨x, hx, h'x⟩ + have : 0 ≤ C := (norm_nonneg _).trans (h'x hx) + simp only [norm_zero, ge_iff_le] + positivity + +theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} (hs : μ s < ∞) (hC : ∀ x ∈ s, ‖f x‖ ≤ C) : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.real s := + norm_setIntegral_le_of_norm_le_const_ae' hs (Eventually.of_forall hC) + +theorem norm_integral_sub_setIntegral_le [IsFiniteMeasure μ] {C : ℝ} + (hf : ∀ᵐ (x : X) ∂[B; μ], ‖f x‖ ≤ C) {s : Set X} (hs : MeasurableSet s) (hf1 : Integrable f μ) : + ‖∫ᵛ (x : X), f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ]‖ ≤ μ.real sᶜ * C := by + have h0 : ∫ᵛ (x : X), f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in sᶜ, f x ∂[B; μ] := by + rw [sub_eq_iff_eq_add, add_comm, integral_add_compl hs hf1] + have h1 : ∫ᵛ x in sᶜ, ‖f x‖ ∂[B; μ] ≤ ∫ᵛ _ in sᶜ, C ∂[B; μ] := + integral_mono_ae hf1.norm.restrict (integrable_const C) (ae_restrict_of_ae hf) + have h2 : ∫ᵛ _ in sᶜ, C ∂[B; μ] = μ.real sᶜ * C := by + rw [setIntegral_const C, smul_eq_mul] + rw [h0, ← h2] + exact le_trans (norm_integral_le_integral_norm f) h1 + +theorem setIntegral_eq_zero_iff_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ.restrict s] f) + (hfi : IntegrableOn f s μ) : ∫ᵛ x in s, f x ∂[B; μ] = 0 ↔ f =ᵐ[μ.restrict s] 0 := + integral_eq_zero_iff_of_nonneg_ae hf hfi + +theorem setIntegral_pos_iff_support_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ.restrict s] f) + (hfi : IntegrableOn f s μ) : (0 < ∫ᵛ x in s, f x ∂[B; μ]) ↔ 0 < μ (support f ∩ s) := by + rw [integral_pos_iff_support_of_nonneg_ae hf hfi, Measure.restrict_apply₀] + rw [support_eq_preimage] + exact hfi.aestronglyMeasurable.aemeasurable.nullMeasurable (measurableSet_singleton 0).compl + +theorem setIntegral_gt_gt {R : ℝ} {f : X → ℝ} (hR : 0 ≤ R) + (hfint : IntegrableOn f {x | ↑R < f x} μ) (hμ : μ {x | ↑R < f x} ≠ 0) : + μ.real {x | ↑R < f x} * R < ∫ᵛ x in {x | ↑R < f x}, f x ∂[B; μ] := by + have : IntegrableOn (fun _ => R) {x | ↑R < f x} μ := by + refine ⟨aestronglyMeasurable_const, lt_of_le_of_lt ?_ hfint.2⟩ + refine setLIntegral_mono_ae hfint.1.enorm <| ae_of_all _ fun x hx => ?_ + simp only [ENNReal.coe_le_coe, Real.nnnorm_of_nonneg hR, enorm_eq_nnnorm, + Real.nnnorm_of_nonneg (hR.trans <| le_of_lt hx)] + exact le_of_lt hx + rw [← sub_pos, ← smul_eq_mul, ← setIntegral_const, ← integral_sub hfint this, + setIntegral_pos_iff_support_of_nonneg_ae] + · rw [← pos_iff_ne_zero] at hμ + rwa [Set.inter_eq_self_of_subset_right] + exact fun x hx => Ne.symm (ne_of_lt <| sub_pos.2 hx) + · rw [Pi.zero_def, EventuallyLE, ae_restrict_iff₀] + · exact Eventually.of_forall fun x hx => sub_nonneg.2 <| le_of_lt hx + · exact nullMeasurableSet_le aemeasurable_zero (hfint.1.aemeasurable.sub aemeasurable_const) + · exact Integrable.sub hfint this + +theorem setIntegral_trim {X} {m m0 : MeasurableSpace X} {μ : Measure X} (hm : m ≤ m0) {f : X → E} + (hf_meas : StronglyMeasurable[m] f) {s : Set X} (hs : MeasurableSet[m] s) : + ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ].trim hm := by + rwa [integral_trim hm hf_meas, restrict_trim hm μ] + +/-! ### Lemmas about adding and removing interval boundaries + +The primed lemmas take explicit arguments about the endpoint having zero measure, while the +unprimed ones use `[NoAtoms μ]`. +-/ + +section PartialOrder + +variable [PartialOrder X] {x y : X} + +theorem integral_Icc_eq_integral_Ioc' (hx : μ {x} = 0) : + ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ioc x y, f t ∂[B; μ] := + setIntegral_congr_set (Ioc_ae_eq_Icc' hx).symm + +theorem integral_Icc_eq_integral_Ico' (hy : μ {y} = 0) : + ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ico x y, f t ∂[B; μ] := + setIntegral_congr_set (Ico_ae_eq_Icc' hy).symm + +theorem integral_Ioc_eq_integral_Ioo' (hy : μ {y} = 0) : + ∫ᵛ t in Ioc x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := + setIntegral_congr_set (Ioo_ae_eq_Ioc' hy).symm + +theorem integral_Ico_eq_integral_Ioo' (hx : μ {x} = 0) : + ∫ᵛ t in Ico x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := + setIntegral_congr_set (Ioo_ae_eq_Ico' hx).symm + +theorem integral_Icc_eq_integral_Ioo' (hx : μ {x} = 0) (hy : μ {y} = 0) : + ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := + setIntegral_congr_set (Ioo_ae_eq_Icc' hx hy).symm + +theorem integral_Iic_eq_integral_Iio' (hx : μ {x} = 0) : + ∫ᵛ t in Iic x, f t ∂[B; μ] = ∫ᵛ t in Iio x, f t ∂[B; μ] := + setIntegral_congr_set (Iio_ae_eq_Iic' hx).symm + +theorem integral_Ici_eq_integral_Ioi' (hx : μ {x} = 0) : + ∫ᵛ t in Ici x, f t ∂[B; μ] = ∫ᵛ t in Ioi x, f t ∂[B; μ] := + setIntegral_congr_set (Ioi_ae_eq_Ici' hx).symm + +variable [NoAtoms μ] + +theorem integral_Icc_eq_integral_Ioc : ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ioc x y, f t ∂[B; μ] := + integral_Icc_eq_integral_Ioc' <| measure_singleton x + +theorem integral_Icc_eq_integral_Ico : ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ico x y, f t ∂[B; μ] := + integral_Icc_eq_integral_Ico' <| measure_singleton y + +theorem integral_Ioc_eq_integral_Ioo : ∫ᵛ t in Ioc x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := + integral_Ioc_eq_integral_Ioo' <| measure_singleton y + +theorem integral_Ico_eq_integral_Ioo : ∫ᵛ t in Ico x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := + integral_Ico_eq_integral_Ioo' <| measure_singleton x + +theorem integral_Ico_eq_integral_Ioc : ∫ᵛ t in Ico x y, f t ∂[B; μ] = ∫ᵛ t in Ioc x y, f t ∂[B; μ] := by + rw [integral_Ico_eq_integral_Ioo, integral_Ioc_eq_integral_Ioo] + +theorem integral_Icc_eq_integral_Ioo : ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := by + rw [integral_Icc_eq_integral_Ico, integral_Ico_eq_integral_Ioo] + +theorem integral_Iic_eq_integral_Iio : ∫ᵛ t in Iic x, f t ∂[B; μ] = ∫ᵛ t in Iio x, f t ∂[B; μ] := + integral_Iic_eq_integral_Iio' <| measure_singleton x + +theorem integral_Ici_eq_integral_Ioi : ∫ᵛ t in Ici x, f t ∂[B; μ] = ∫ᵛ t in Ioi x, f t ∂[B; μ] := + integral_Ici_eq_integral_Ioi' <| measure_singleton x + +end PartialOrder + +end NormedAddCommGroup + +section Mono + +variable [NormedAddCommGroup E] [NormedSpace ℝ E] [PartialOrder E] + [IsOrderedAddMonoid E] [IsOrderedModule ℝ E] + {μ : Measure X} {f g : X → E} {s t : Set X} + +theorem setIntegral_mono_set [OrderClosedTopology E] (hfi : IntegrableOn f t μ) + (hf : 0 ≤ᵐ[μ.restrict t] f) (hst : s ≤ᵐ[μ] t) : + ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in t, f x ∂[B; μ] := + integral_mono_measure (Measure.restrict_mono_ae hst) hf hfi + +theorem setIntegral_le_integral [OrderClosedTopology E] (hfi : Integrable f μ) (hf : 0 ≤ᵐ[μ] f) : + ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x, f x ∂[B; μ] := + integral_mono_measure (Measure.restrict_le_self) hf hfi + +variable [ClosedIciTopology E] + +section +variable (hf : IntegrableOn f s μ) (hg : IntegrableOn g s μ) +include hf hg + +theorem setIntegral_mono_ae_restrict (h : f ≤ᵐ[μ.restrict s] g) : + ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := by + by_cases hE : CompleteSpace E + · exact integral_mono_ae hf hg h + · simp [integral, hE] + +theorem setIntegral_mono_ae (h : f ≤ᵐ[μ] g) : ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := + setIntegral_mono_ae_restrict hf hg (ae_restrict_of_ae h) + +theorem setIntegral_mono_on (hs : MeasurableSet s) (h : ∀ x ∈ s, f x ≤ g x) : + ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := + setIntegral_mono_ae_restrict hf hg + (by simp [hs, EventuallyLE, eventually_inf_principal, ae_of_all _ h]) + +theorem setIntegral_mono_on_ae (hs : MeasurableSet s) (h : ∀ᵐ x ∂[B; μ], x ∈ s → f x ≤ g x) : + ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := by + refine setIntegral_mono_ae_restrict hf hg ?_; rwa [EventuallyLE, ae_restrict_iff' hs] + +lemma setIntegral_mono_on_ae₀ (hs : NullMeasurableSet s μ) (h : ∀ᵐ x ∂[B; μ], x ∈ s → f x ≤ g x) : + ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := by + rw [setIntegral_congr_set hs.toMeasurable_ae_eq.symm, + setIntegral_congr_set hs.toMeasurable_ae_eq.symm] + refine setIntegral_mono_on_ae ?_ ?_ ?_ ?_ + · rwa [integrableOn_congr_set_ae hs.toMeasurable_ae_eq] + · rwa [integrableOn_congr_set_ae hs.toMeasurable_ae_eq] + · exact measurableSet_toMeasurable μ s + · filter_upwards [hs.toMeasurable_ae_eq.mem_iff, h] with x hx h + rwa [hx] + +@[gcongr high] -- higher priority than `integral_mono` +-- this lemma is better because it also gives the `x ∈ s` hypothesis +lemma setIntegral_mono_on₀ (hs : NullMeasurableSet s μ) (h : ∀ x ∈ s, f x ≤ g x) : + ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := + setIntegral_mono_on_ae₀ hf hg hs (Eventually.of_forall h) + +theorem setIntegral_mono (h : f ≤ g) : ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := + integral_mono hf hg h + +end + +theorem setIntegral_ge_of_const_le [CompleteSpace E] {c : E} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) + (hf : ∀ x ∈ s, c ≤ f x) (hfint : IntegrableOn (fun x : X => f x) s μ) : + μ.real s • c ≤ ∫ᵛ x in s, f x ∂[B; μ] := by + rw [← setIntegral_const c] + exact setIntegral_mono_on (integrableOn_const hμs) hfint hs hf + +theorem setIntegral_ge_of_const_le_real {f : X → ℝ} {c : ℝ} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) + (hf : ∀ x ∈ s, c ≤ f x) (hfint : IntegrableOn (fun x : X => f x) s μ) : + c * μ.real s ≤ ∫ᵛ x in s, f x ∂[B; μ] := by + simpa [mul_comm] using setIntegral_ge_of_const_le hs hμs hf hfint + +end Mono + +section Nonneg + +variable {μ : Measure X} {f : X → ℝ} {s : Set X} + +theorem setIntegral_nonneg_of_ae_restrict (hf : 0 ≤ᵐ[μ.restrict s] f) : 0 ≤ ∫ᵛ x in s, f x ∂[B; μ] := + integral_nonneg_of_ae hf + +theorem setIntegral_nonneg_of_ae (hf : 0 ≤ᵐ[μ] f) : 0 ≤ ∫ᵛ x in s, f x ∂[B; μ] := + setIntegral_nonneg_of_ae_restrict (ae_restrict_of_ae hf) + +theorem setIntegral_nonneg (hs : MeasurableSet s) (hf : ∀ x, x ∈ s → 0 ≤ f x) : + 0 ≤ ∫ᵛ x in s, f x ∂[B; μ] := + setIntegral_nonneg_of_ae_restrict ((ae_restrict_iff' hs).mpr (ae_of_all μ hf)) + +theorem setIntegral_nonneg_ae (hs : MeasurableSet s) (hf : ∀ᵐ x ∂[B; μ], x ∈ s → 0 ≤ f x) : + 0 ≤ ∫ᵛ x in s, f x ∂[B; μ] := + setIntegral_nonneg_of_ae_restrict <| by rwa [EventuallyLE, ae_restrict_iff' hs] + +theorem setIntegral_le_nonneg {s : Set X} (hs : MeasurableSet s) (hf : StronglyMeasurable f) + (hfi : Integrable f μ) : ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in {y | 0 ≤ f y}, f x ∂[B; μ] := by + rw [← integral_indicator hs, ← + integral_indicator (stronglyMeasurable_const.measurableSet_le hf)] + exact + integral_mono (hfi.indicator hs) + (hfi.indicator (stronglyMeasurable_const.measurableSet_le hf)) + (indicator_le_indicator_nonneg s f) + +theorem setIntegral_nonpos_of_ae_restrict (hf : f ≤ᵐ[μ.restrict s] 0) : ∫ᵛ x in s, f x ∂[B; μ] ≤ 0 := + integral_nonpos_of_ae hf + +theorem setIntegral_nonpos_of_ae (hf : f ≤ᵐ[μ] 0) : ∫ᵛ x in s, f x ∂[B; μ] ≤ 0 := + setIntegral_nonpos_of_ae_restrict (ae_restrict_of_ae hf) + +theorem setIntegral_nonpos_ae (hs : MeasurableSet s) (hf : ∀ᵐ x ∂[B; μ], x ∈ s → f x ≤ 0) : + ∫ᵛ x in s, f x ∂[B; μ] ≤ 0 := + setIntegral_nonpos_of_ae_restrict <| by rwa [EventuallyLE, ae_restrict_iff' hs] + +theorem setIntegral_nonpos (hs : MeasurableSet s) (hf : ∀ x, x ∈ s → f x ≤ 0) : + ∫ᵛ x in s, f x ∂[B; μ] ≤ 0 := + setIntegral_nonpos_ae hs <| ae_of_all μ hf + +theorem setIntegral_nonpos_le {s : Set X} (hs : MeasurableSet s) (hf : StronglyMeasurable f) + (hfi : Integrable f μ) : ∫ᵛ x in {y | f y ≤ 0}, f x ∂[B; μ] ≤ ∫ᵛ x in s, f x ∂[B; μ] := by + rw [← integral_indicator hs, ← + integral_indicator (hf.measurableSet_le stronglyMeasurable_const)] + exact + integral_mono (hfi.indicator (hf.measurableSet_le stronglyMeasurable_const)) + (hfi.indicator hs) (indicator_nonpos_le_indicator s f) + +lemma Integrable.measure_le_integral {f : X → ℝ} (f_int : Integrable f μ) (f_nonneg : 0 ≤ᵐ[μ] f) + {s : Set X} (hs : ∀ x ∈ s, 1 ≤ f x) : + μ s ≤ ENNReal.ofReal (∫ᵛ x, f x ∂[B; μ]) := by + rw [ofReal_integral_eq_lintegral_ofReal f_int f_nonneg] + apply meas_le_lintegral₀ + · exact ENNReal.continuous_ofReal.measurable.comp_aemeasurable f_int.1.aemeasurable + · intro x hx + simpa using ENNReal.ofReal_le_ofReal (hs x hx) + +lemma integral_le_measure {f : X → ℝ} {s : Set X} + (hs : ∀ x ∈ s, f x ≤ 1) (h's : ∀ x ∈ sᶜ, f x ≤ 0) : + ENNReal.ofReal (∫ᵛ x, f x ∂[B; μ]) ≤ μ s := by + by_cases H : Integrable f μ; swap + · simp [integral_undef H] + let g x := max (f x) 0 + have g_int : Integrable g μ := H.pos_part + have : ENNReal.ofReal (∫ᵛ x, f x ∂[B; μ]) ≤ ENNReal.ofReal (∫ᵛ x, g x ∂[B; μ]) := by + apply ENNReal.ofReal_le_ofReal + exact integral_mono H g_int (fun x ↦ le_max_left _ _) + apply this.trans + rw [ofReal_integral_eq_lintegral_ofReal g_int (Eventually.of_forall (fun x ↦ le_max_right _ _))] + apply lintegral_le_meas + · intro x + apply ENNReal.ofReal_le_of_le_toReal + by_cases H : x ∈ s + · simpa [g] using hs x H + · apply le_trans _ zero_le_one + simpa [g] using h's x H + · intro x hx + simpa [g] using h's x hx + +end Nonneg + +section IntegrableUnion + +variable {ι : Type*} [Countable ι] {μ : Measure X} [NormedAddCommGroup E] + +theorem integrableOn_iUnion_of_summable_integral_norm {f : X → E} {s : ι → Set X} + (hi : ∀ i : ι, IntegrableOn f (s i) μ) + (h : Summable fun i : ι => ∫ᵛ x : X in s i, ‖f x‖ ∂[B; μ]) : IntegrableOn f (iUnion s) μ := by + refine ⟨AEStronglyMeasurable.iUnion fun i => (hi i).1, (lintegral_iUnion_le _ _).trans_lt ?_⟩ + have B := fun i => lintegral_coe_eq_integral (fun x : X => ‖f x‖₊) (hi i).norm + simp_rw [enorm_eq_nnnorm, tsum_congr B] + have S' : Summable fun i : ι => + (NNReal.mk (∫ᵛ x : X in s i, ‖f x‖₊ ∂[B; μ]) (integral_nonneg fun x => NNReal.coe_nonneg _)) := by + rw [← NNReal.summable_coe]; exact h + have S'' := ENNReal.tsum_coe_eq S'.hasSum + simp_rw [ENNReal.coe_nnreal_eq, NNReal.coe_mk, coe_nnnorm] at S'' + convert ENNReal.ofReal_lt_top + +variable [TopologicalSpace X] [BorelSpace X] [T2Space X] [IsLocallyFiniteMeasure μ] + +/-- If `s` is a countable family of compact sets, `f` is a continuous function, and the sequence +`‖f.restrict (s i)‖ * μ (s i)` is summable, then `f` is integrable on the union of the `s i`. -/ +theorem integrableOn_iUnion_of_summable_norm_restrict {f : C(X, E)} {s : ι → Compacts X} + (hf : Summable fun i : ι => ‖f.restrict (s i)‖ * μ.real (s i)) : + IntegrableOn f (⋃ i : ι, s i) μ := by + refine + integrableOn_iUnion_of_summable_integral_norm + (fun i => (map_continuous f).continuousOn.integrableOn_compact (s i).isCompact) + (.of_nonneg_of_le (fun ι => integral_nonneg fun x => norm_nonneg _) (fun i => ?_) hf) + rw [← (Real.norm_of_nonneg (integral_nonneg fun x => norm_nonneg _) : ‖_‖ = ∫ᵛ x in s i, ‖f x‖ ∂[B; μ])] + exact + norm_setIntegral_le_of_norm_le_const (s i).isCompact.measure_lt_top + fun x hx => (norm_norm (f x)).symm ▸ (f.restrict (s i : Set X)).norm_coe_le_norm ⟨x, hx⟩ + +/-- If `s` is a countable family of compact sets covering `X`, `f` is a continuous function, and +the sequence `‖f.restrict (s i)‖ * μ (s i)` is summable, then `f` is integrable. -/ +theorem integrable_of_summable_norm_restrict {f : C(X, E)} {s : ι → Compacts X} + (hf : Summable fun i : ι => ‖f.restrict (s i)‖ * μ.real (s i)) + (hs : ⋃ i : ι, ↑(s i) = (univ : Set X)) : Integrable f μ := by + simpa only [hs, integrableOn_univ] using integrableOn_iUnion_of_summable_norm_restrict hf + +end IntegrableUnion + +/-! ### Continuity of the set integral + +We prove that for any set `s`, the function +`fun f : X →₁[μ] E => ∫ᵛ x in s, f x ∂[B; μ]` is continuous. -/ + +section ContinuousSetIntegral + +variable [NormedAddCommGroup E] + {𝕜 : Type*} [NormedRing 𝕜] [NormedAddCommGroup F] [Module 𝕜 F] [IsBoundedSMul 𝕜 F] + {p : ℝ≥0∞} {μ : Measure X} + +/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by +`(Lp.memLp f).restrict s).toLp f`. This map is additive. -/ +theorem Lp_toLp_restrict_add (f g : Lp E p μ) (s : Set X) : + ((Lp.memLp (f + g)).restrict s).toLp (⇑(f + g)) = + ((Lp.memLp f).restrict s).toLp f + ((Lp.memLp g).restrict s).toLp g := by + ext1 + refine (ae_restrict_of_ae (Lp.coeFn_add f g)).mp ?_ + refine + (Lp.coeFn_add (MemLp.toLp f ((Lp.memLp f).restrict s)) + (MemLp.toLp g ((Lp.memLp g).restrict s))).mp ?_ + refine (MemLp.coeFn_toLp ((Lp.memLp f).restrict s)).mp ?_ + refine (MemLp.coeFn_toLp ((Lp.memLp g).restrict s)).mp ?_ + refine (MemLp.coeFn_toLp ((Lp.memLp (f + g)).restrict s)).mono fun x hx1 hx2 hx3 hx4 hx5 => ?_ + rw [hx4, hx1, Pi.add_apply, hx2, hx3, hx5, Pi.add_apply] + +/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by +`(Lp.memLp f).restrict s).toLp f`. This map commutes with scalar multiplication. -/ +theorem Lp_toLp_restrict_smul (c : 𝕜) (f : Lp F p μ) (s : Set X) : + ((Lp.memLp (c • f)).restrict s).toLp (⇑(c • f)) = c • ((Lp.memLp f).restrict s).toLp f := by + ext1 + refine (ae_restrict_of_ae (Lp.coeFn_smul c f)).mp ?_ + refine (MemLp.coeFn_toLp ((Lp.memLp f).restrict s)).mp ?_ + refine (MemLp.coeFn_toLp ((Lp.memLp (c • f)).restrict s)).mp ?_ + refine + (Lp.coeFn_smul c (MemLp.toLp f ((Lp.memLp f).restrict s))).mono fun x hx1 hx2 hx3 hx4 => ?_ + simp only [hx2, hx1, hx3, hx4, Pi.smul_apply] + +/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by +`(Lp.memLp f).restrict s).toLp f`. This map is non-expansive. -/ +theorem norm_Lp_toLp_restrict_le (s : Set X) (f : Lp E p μ) : + ‖((Lp.memLp f).restrict s).toLp f‖ ≤ ‖f‖ := by + rw [Lp.norm_def, Lp.norm_def, eLpNorm_congr_ae (MemLp.coeFn_toLp _)] + refine ENNReal.toReal_mono (Lp.eLpNorm_ne_top _) ?_ + exact eLpNorm_mono_measure _ Measure.restrict_le_self + +variable (X F 𝕜) in +/-- Continuous linear map sending a function of `Lp F p μ` to the same function in +`Lp F p (μ.restrict s)`. -/ +noncomputable def LpToLpRestrictCLM (μ : Measure X) (p : ℝ≥0∞) [hp : Fact (1 ≤ p)] (s : Set X) : + Lp F p μ →L[𝕜] Lp F p (μ.restrict s) := + @LinearMap.mkContinuous 𝕜 𝕜 (Lp F p μ) (Lp F p (μ.restrict s)) _ _ _ _ _ _ (RingHom.id 𝕜) + ⟨⟨fun f => MemLp.toLp f ((Lp.memLp f).restrict s), fun f g => Lp_toLp_restrict_add f g s⟩, + fun c f => Lp_toLp_restrict_smul c f s⟩ + 1 (by intro f; rw [one_mul]; exact norm_Lp_toLp_restrict_le s f) + +variable (𝕜) in +theorem LpToLpRestrictCLM_coeFn [Fact (1 ≤ p)] (s : Set X) (f : Lp F p μ) : + LpToLpRestrictCLM X F 𝕜 μ p s f =ᵐ[μ.restrict s] f := + MemLp.coeFn_toLp ((Lp.memLp f).restrict s) + +@[continuity] +theorem continuous_setIntegral [NormedSpace ℝ E] (s : Set X) : + Continuous fun f : X →₁[μ] E => ∫ᵛ x in s, f x ∂[B; μ] := by + haveI : Fact ((1 : ℝ≥0∞) ≤ 1) := ⟨le_rfl⟩ + have h_comp : + (fun f : X →₁[μ] E => ∫ᵛ x in s, f x ∂[B; μ]) = + integral (μ.restrict s) ∘ fun f => LpToLpRestrictCLM X E ℝ μ 1 s f := by + ext1 f + rw [Function.comp_apply, integral_congr_ae (LpToLpRestrictCLM_coeFn ℝ s f)] + rw [h_comp] + exact continuous_integral.comp (LpToLpRestrictCLM X E ℝ μ 1 s).continuous + +end ContinuousSetIntegral + +end MeasureTheory + +section OpenPos + +open Measure + +variable [MeasurableSpace X] [TopologicalSpace X] [OpensMeasurableSpace X] + {μ : Measure X} [IsOpenPosMeasure μ] + +theorem Continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero [IsFiniteMeasureOnCompacts μ] + {f : X → ℝ} {x : X} (f_cont : Continuous f) (f_comp : HasCompactSupport f) (f_nonneg : 0 ≤ f) + (f_x : f x ≠ 0) : 0 < ∫ᵛ x, f x ∂[B; μ] := + integral_pos_of_integrable_nonneg_nonzero f_cont (f_cont.integrable_of_hasCompactSupport f_comp) + f_nonneg f_x + +end OpenPos + +section Support + +variable {M : Type*} [NormedAddCommGroup M] [NormedSpace ℝ M] {mX : MeasurableSpace X} + {ν : Measure X} {F : X → M} + +theorem MeasureTheory.setIntegral_support : ∫ᵛ x in support F, F x ∂ν = ∫ᵛ x, F x ∂ν := by + nth_rw 2 [← setIntegral_univ] + rw [setIntegral_eq_of_subset_of_forall_diff_eq_zero MeasurableSet.univ (subset_univ (support F))] + exact fun _ hx => notMem_support.mp <| notMem_of_mem_diff hx + +theorem MeasureTheory.setIntegral_tsupport [TopologicalSpace X] : + ∫ᵛ x in tsupport F, F x ∂ν = ∫ᵛ x, F x ∂ν := by + nth_rw 2 [← setIntegral_univ] + rw [setIntegral_eq_of_subset_of_forall_diff_eq_zero MeasurableSet.univ (subset_univ (tsupport F))] + exact fun _ hx => image_eq_zero_of_notMem_tsupport <| notMem_of_mem_diff hx + +end Support + +section thickenedIndicator + +variable [MeasurableSpace X] [PseudoEMetricSpace X] + +theorem measure_le_lintegral_thickenedIndicatorAux (μ : Measure X) {E : Set X} + (E_mble : MeasurableSet E) (δ : ℝ) : μ E ≤ ∫⁻ x, (thickenedIndicatorAux δ E x : ℝ≥0∞) ∂[B; μ] := by + convert_to lintegral μ (E.indicator fun _ => (1 : ℝ≥0∞)) ≤ lintegral μ (thickenedIndicatorAux δ E) + · rw [lintegral_indicator E_mble] + simp only [lintegral_one, Measure.restrict_apply, MeasurableSet.univ, univ_inter] + · apply lintegral_mono + apply indicator_le_thickenedIndicatorAux + +theorem measure_le_lintegral_thickenedIndicator (μ : Measure X) {E : Set X} + (E_mble : MeasurableSet E) {δ : ℝ} (δ_pos : 0 < δ) : + μ E ≤ ∫⁻ x, (thickenedIndicator δ_pos E x : ℝ≥0∞) ∂[B; μ] := by + convert measure_le_lintegral_thickenedIndicatorAux μ E_mble δ + dsimp + simp only [thickenedIndicatorAux_lt_top.ne, ENNReal.coe_toNNReal, Ne, not_false_iff] + +end thickenedIndicator + +-- We declare a new `{X : Type*}` to discard the instance `[MeasurableSpace X]` +-- which has been in scope for the entire file up to this point. +variable {X : Type*} + +section BilinearMap + +namespace MeasureTheory + +variable {X : Type*} {f : X → ℝ} {m m0 : MeasurableSpace X} {μ : Measure X} + +theorem Integrable.simpleFunc_mul (g : SimpleFunc X ℝ) (hf : Integrable f μ) : + Integrable (⇑g * f) μ := by + refine + SimpleFunc.induction (fun c s hs => ?_) + (fun g₁ g₂ _ h_int₁ h_int₂ => + (h_int₁.add h_int₂).congr (by rw [SimpleFunc.coe_add, add_mul])) + g + simp only [SimpleFunc.const_zero, SimpleFunc.coe_piecewise, SimpleFunc.coe_const, + SimpleFunc.coe_zero, Set.piecewise_eq_indicator] + have : Set.indicator s (Function.const X c) * f = s.indicator (c • f) := by + ext1 x + by_cases hx : x ∈ s + · simp only [hx, Pi.mul_apply, Set.indicator_of_mem, Pi.smul_apply, smul_eq_mul, + ← Function.const_def] + · simp only [hx, Pi.mul_apply, Set.indicator_of_notMem, not_false_iff, zero_mul] + rw [this, integrable_indicator_iff hs] + exact (hf.smul c).integrableOn + +theorem Integrable.simpleFunc_mul' (hm : m ≤ m0) (g : @SimpleFunc X m ℝ) (hf : Integrable f μ) : + Integrable (⇑g * f) μ := by + rw [← SimpleFunc.coe_toLargerSpace_eq hm g]; exact hf.simpleFunc_mul (g.toLargerSpace hm) + +end MeasureTheory + +end BilinearMap + +section ParametricIntegral + +variable {G 𝕜 : Type*} [TopologicalSpace X] + [TopologicalSpace Y] [MeasurableSpace Y] [OpensMeasurableSpace Y] {μ : Measure Y} + [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace 𝕜 F] [NormedAddCommGroup G] [NormedSpace 𝕜 G] + +open Metric ContinuousLinearMap + +/-- The parametric integral over a continuous function on a compact set is continuous, + under mild assumptions on the topologies involved. -/ +theorem continuous_parametric_integral_of_continuous + [FirstCountableTopology X] [LocallyCompactSpace X] + [SecondCountableTopologyEither Y E] [IsLocallyFiniteMeasure μ] + {f : X → Y → E} (hf : Continuous f.uncurry) {s : Set Y} (hs : IsCompact s) : + Continuous (∫ᵛ y in s, f · y ∂[B; μ]) := by + rw [continuous_iff_continuousAt] + intro x₀ + rcases exists_compact_mem_nhds x₀ with ⟨U, U_cpct, U_nhds⟩ + rcases (U_cpct.prod hs).bddAbove_image hf.norm.continuousOn with ⟨M, hM⟩ + apply continuousAt_of_dominated + · filter_upwards with x using Continuous.aestronglyMeasurable (by fun_prop) + · filter_upwards [U_nhds] with x x_in + rw [ae_restrict_iff] + · filter_upwards with t t_in using hM (mem_image_of_mem _ <| mk_mem_prod x_in t_in) + · exact (isClosed_le (by fun_prop) (by fun_prop)).measurableSet + · exact integrableOn_const hs.measure_ne_top + · filter_upwards using (by fun_prop) + +/-- Consider a parameterized integral `x ↦ ∫ᵛ y, L (g y) (f x y)` where `L` is bilinear, +`g` is locally integrable and `f` is continuous and uniformly compactly supported. Then the +integral depends continuously on `x`. -/ +lemma continuousOn_integral_bilinear_of_locally_integrable_of_compact_support + [NormedSpace 𝕜 E] (L : F →L[𝕜] G →L[𝕜] E) + {f : X → Y → G} {s : Set X} {k : Set Y} {g : Y → F} + (hk : IsCompact k) (hf : ContinuousOn f.uncurry (s ×ˢ univ)) + (hfs : ∀ p, ∀ x, p ∈ s → x ∉ k → f p x = 0) (hg : IntegrableOn g k μ) : + ContinuousOn (fun x ↦ ∫ᵛ y, L (g y) (f x y) ∂[B; μ]) s := by + have A : ∀ p ∈ s, Continuous (f p) := fun p hp ↦ by + refine hf.comp_continuous (.prodMk_right _) fun y => ?_ + simpa only [prodMk_mem_set_prod_eq, mem_univ, and_true] using hp + intro q hq + apply Metric.continuousWithinAt_iff'.2 (fun ε εpos ↦ ?_) + obtain ⟨δ, δpos, hδ⟩ : ∃ (δ : ℝ), 0 < δ ∧ ∫ᵛ x in k, ‖L‖ * ‖g x‖ * δ ∂[B; μ] < ε := by + simpa [integral_mul_const] using exists_pos_mul_lt εpos _ + obtain ⟨v, v_mem, hv⟩ : ∃ v ∈ 𝓝[s] q, ∀ p ∈ v, ∀ x ∈ k, dist (f p x) (f q x) < δ := + hk.mem_uniformity_of_prod + (hf.mono (Set.prod_mono_right (subset_univ k))) hq (dist_mem_uniformity δpos) + simp_rw [dist_eq_norm] at hv ⊢ + have I : ∀ p ∈ s, IntegrableOn (fun y ↦ L (g y) (f p y)) k μ := by + intro p hp + obtain ⟨C, hC⟩ : ∃ C, ∀ y, ‖f p y‖ ≤ C := by + have : ContinuousOn (f p) k := by + have : ContinuousOn (fun y ↦ (p, y)) k := by fun_prop + exact hf.comp this (by simp [MapsTo, hp]) + rcases IsCompact.exists_bound_of_continuousOn hk this with ⟨C, hC⟩ + refine ⟨max C 0, fun y ↦ ?_⟩ + by_cases hx : y ∈ k + · exact (hC y hx).trans (le_max_left _ _) + · simp [hfs p y hp hx] + have : IntegrableOn (fun y ↦ ‖L‖ * ‖g y‖ * C) k μ := + (hg.norm.const_mul _).mul_const _ + apply Integrable.mono' this ?_ ?_ + · borelize G + apply L.aestronglyMeasurable_comp₂ hg.aestronglyMeasurable + apply StronglyMeasurable.aestronglyMeasurable + apply Continuous.stronglyMeasurable_of_support_subset_isCompact (A p hp) hk + apply support_subset_iff'.2 (fun y hy ↦ hfs p y hp hy) + · apply Eventually.of_forall (fun y ↦ (le_opNorm₂ L (g y) (f p y)).trans ?_) + gcongr + apply hC + filter_upwards [v_mem, self_mem_nhdsWithin] with p hp h'p + calc + ‖∫ᵛ x, L (g x) (f p x) ∂[B; μ] - ∫ᵛ x, L (g x) (f q x) ∂[B; μ]‖ + = ‖∫ᵛ x in k, L (g x) (f p x) ∂[B; μ] - ∫ᵛ x in k, L (g x) (f q x) ∂[B; μ]‖ := by + congr 2 + · refine (setIntegral_eq_integral_of_forall_compl_eq_zero (fun y hy ↦ ?_)).symm + simp [hfs p y h'p hy] + · refine (setIntegral_eq_integral_of_forall_compl_eq_zero (fun y hy ↦ ?_)).symm + simp [hfs q y hq hy] + _ = ‖∫ᵛ x in k, L (g x) (f p x) - L (g x) (f q x) ∂[B; μ]‖ := by rw [integral_sub (I p h'p) (I q hq)] + _ ≤ ∫ᵛ x in k, ‖L (g x) (f p x) - L (g x) (f q x)‖ ∂[B; μ] := norm_integral_le_integral_norm _ + _ ≤ ∫ᵛ x in k, ‖L‖ * ‖g x‖ * δ ∂[B; μ] := by + apply integral_mono_of_nonneg (Eventually.of_forall (fun y ↦ by positivity)) + · exact (hg.norm.const_mul _).mul_const _ + · filter_upwards with y + by_cases hy : y ∈ k + · dsimp only + specialize hv p hp y hy + calc + ‖L (g y) (f p y) - L (g y) (f q y)‖ + = ‖L (g y) (f p y - f q y)‖ := by simp only [map_sub] + _ ≤ ‖L‖ * ‖g y‖ * ‖f p y - f q y‖ := le_opNorm₂ _ _ _ + _ ≤ ‖L‖ * ‖g y‖ * δ := by gcongr + · simp only [hfs p y h'p hy, hfs q y hq hy, sub_self, norm_zero] + positivity + _ < ε := hδ + +/-- Consider a parameterized integral `x ↦ ∫ᵛ y, f x y` where `f` is continuous and uniformly +compactly supported. Then the integral depends continuously on `x`. -/ +lemma continuousOn_integral_of_compact_support + {f : X → Y → E} {s : Set X} {k : Set Y} [IsFiniteMeasureOnCompacts μ] + (hk : IsCompact k) (hf : ContinuousOn f.uncurry (s ×ˢ univ)) + (hfs : ∀ p, ∀ x, p ∈ s → x ∉ k → f p x = 0) : + ContinuousOn (fun x ↦ ∫ᵛ y, f x y ∂[B; μ]) s := by + simpa using continuousOn_integral_bilinear_of_locally_integrable_of_compact_support (lsmul ℝ ℝ) + hk hf hfs (integrableOn_const hk.measure_ne_top) (g := fun _ ↦ 1) + +end ParametricIntegral From da8e5446c6195709363beecead60a285d7c7a09d Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 21 May 2026 09:27:54 +0200 Subject: [PATCH 042/129] more --- .../VectorMeasure/SetIntegral.lean | 14 ++++++++++++- .../VectorMeasure/Variation/Basic.lean | 20 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index bd2f345b61baad..3946f84fa6fa06 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -51,7 +51,19 @@ variable {X E F G : Type*} {mX : MeasurableSpace X} namespace MeasureTheory.VectorMeasure -section NormedAddCommGroup +theorem IntegrableOn.mono (hs : MeasurableSet s) (hts : t ⊆ s) (h : μ.IntegrableOn f B s) : + μ.IntegrableOn f B t := by + by_cases ht : MeasurableSet t; swap + · simp [VectorMeasure.IntegrableOn, restrict_not_measurable _ ht] + apply Integrable.mono_measure h + simp [transpose_restrict, variation_restrict, hs, ht, Measure.restrict_mono hts le_rfl] + +@[simp] theorem integrableOn_univ : μ.IntegrableOn f B univ ↔ μ.Integrable f B := by + simp [VectorMeasure.IntegrableOn] + +theorem Integrable.IntegrableOn (h : μ.Integrable f B) : μ.IntegrableOn f B s := by + rw [← integrableOn_univ] at h + exact h.mono MeasurableSet.univ (subset_univ _) theorem setIntegral_congr_ae (hs : MeasurableSet s) (h : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ s → f x = g x) : diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index 3a2b5e5063a48c..c990b5c514269a 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -183,6 +183,11 @@ lemma variation_restrict_le (μ : VectorMeasure X V) (s : Set X) : · simp [variation_restrict μ hs] · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] +instance {s : Set X} [IsFiniteMeasure μ.variation] : IsFiniteMeasure (μ.restrict s).variation := by + constructor + grw [variation_restrict_le] + exact IsFiniteMeasure.measure_univ_lt_top + lemma variation_map_le {Y : Type*} [MeasurableSpace Y] {φ : X → Y} : (μ.map φ).variation ≤ Measure.map φ μ.variation := by by_cases hφ : Measurable φ; swap @@ -192,6 +197,12 @@ lemma variation_map_le {Y : Type*} [MeasurableSpace Y] {φ : X → Y} : apply le_trans ?_ (enorm_measure_le_variation _ _) simp [VectorMeasure.map_apply _ hφ hs] +instance {Y : Type*} [MeasurableSpace Y] {φ : X → Y} [IsFiniteMeasure μ.variation] : + IsFiniteMeasure (μ.map φ).variation := by + constructor + grw [variation_map_le] + exact IsFiniteMeasure.measure_univ_lt_top + theorem _root_.MeasurableEmbedding.variation_map {Y : Type*} [MeasurableSpace Y] {φ : X → Y} (hφ : MeasurableEmbedding φ) : (μ.map φ).variation = μ.variation.map φ := by @@ -258,6 +269,11 @@ lemma variation_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : _ = (c • μ).variation := by simp [smul_smul, mul_inv_cancel₀ (nnnorm_ne_zero_iff.mpr hc)] +instance {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : 𝕜} [IsFiniteMeasure μ.variation] : + IsFiniteMeasure (c • μ).variation := by + simp only [variation_smul] + infer_instance + instance [Finite X] : IsFiniteMeasure μ.variation := by classical let : Fintype X := Fintype.ofFinite X @@ -266,6 +282,10 @@ instance [Finite X] : IsFiniteMeasure μ.variation := by ennrealPreVariation_apply, preVariationFun, ↓reduceDIte, ← sup_univ_eq_ciSup] exact (Finset.sup_lt_iff (by simp)).2 (fun b hb ↦ by simp [ENNReal.sum_lt_top, enorm_lt_top]) +instance {x : X} {v : V} : IsFiniteMeasure (VectorMeasure.dirac x v).variation := by + simp only [variation_dirac, enorm_eq_nnnorm, Measure.coe_nnreal_smul] + infer_instance + end NormedAddCommGroup end MeasureTheory.VectorMeasure From 5fb4f8ebe67652bfce54d4e0610cba6bdbf01939 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 21 May 2026 10:47:52 +0200 Subject: [PATCH 043/129] progress --- .../MeasureTheory/VectorMeasure/Basic.lean | 19 +++ .../VectorMeasure/SetIntegral.lean | 130 +++++++++--------- 2 files changed, 84 insertions(+), 65 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index b6e7f34f44d294..56e93b0eec11cc 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -755,6 +755,25 @@ def restrictGm (i : Set α) : VectorMeasure α M →+ VectorMeasure α M where map_zero' := restrict_zero map_add' _ _ := restrict_add _ _ i +variable [T2Space M] {s t : Set α} + +theorem restrict_inter_add_diff (hs : MeasurableSet s) (ht : MeasurableSet t) : + v.restrict (s ∩ t) + v.restrict (s \ t) = v.restrict s := by + ext1 u hu + simp only [add_apply, restrict_apply, hs, hu, hs.inter ht, hs.diff ht] + rw [← of_union (by grind) (hu.inter (hs.inter ht)) (hu.inter (hs.diff ht))] + congr + grind + +theorem restrict_union_add_inter (hs : MeasurableSet s) (ht : MeasurableSet t) : + v.restrict (s ∪ t) + v.restrict (s ∩ t) = v.restrict s + v.restrict t := by + rw [← v.restrict_inter_add_diff (hs.union ht) ht, union_inter_cancel_right, union_diff_right, + ← v.restrict_inter_add_diff hs ht, add_comm, ← add_assoc, add_right_comm] + +theorem restrict_union (h : Disjoint s t) (hs : MeasurableSet s) (ht : MeasurableSet t) : + v.restrict (s ∪ t) = v.restrict s + v.restrict t := by + simp [← v.restrict_union_add_inter hs ht, disjoint_iff_inter_eq_empty.mp h] + end ContinuousAdd section Partition diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 3946f84fa6fa06..dbdae0a64c50b6 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -11,29 +11,7 @@ public import Mathlib.MeasureTheory.VectorMeasure.Integral # Set integral In this file we prove some properties of `∫ᵛ x in s, f x ∂[B; μ]`. Recall that this notation -is defined as `∫ᵛ x, f x ∂(μ.restrict s)`. In `integral_indicator` we prove that for a measurable -function `f` and a measurable set `s` this definition coincides with another natural definition: -`∫ᵛ x, indicator s f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ]`, where `indicator s f x` is equal to `f x` for `x ∈ s` -and is zero otherwise. - -Since `∫ᵛ x in s, f x ∂[B; μ]` is a notation, one can rewrite or apply any theorem about `∫ᵛ x, f x ∂[B; μ]` -directly. In this file we prove some theorems about dependence of `∫ᵛ x in s, f x ∂[B; μ]` on `s`, e.g. -`setIntegral_union`, `setIntegral_empty`, `setIntegral_univ`. - -We use the property `IntegrableOn f s μ := Integrable f (μ.restrict s)`, defined in -`MeasureTheory.IntegrableOn`. We also defined in that same file a predicate -`IntegrableAtFilter (f : X → E) (l : Filter X) (μ : Measure X)` saying that `f` is integrable at -some set `s ∈ l`. - -## Notation - -We provide the following notations for expressing the integral of a function on a set : -* `∫ᵛ x in s, f x ∂[B; μ]` is `MeasureTheory.integral (μ.restrict s) f` -* `∫ᵛ x in s, f x` is `∫ᵛ x in s, f x ∂volume` - -Note that the set notations are defined in the file -`Mathlib/MeasureTheory/Integral/Bochner/Basic.lean`, -but we reference them here because all theorems about set integrals are in this file. +is defined as `∫ᵛ x, f x ∂[B; μ.restrict s]`. -/ @[expose] public section @@ -43,7 +21,7 @@ assert_not_exists InnerProductSpace open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology open scoped ENNReal NNReal Finset -variable {X E F G : Type*} {mX : MeasurableSpace X} +variable {ι X E F G : Type*} {mX : MeasurableSpace X} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] @@ -58,6 +36,38 @@ theorem IntegrableOn.mono (hs : MeasurableSet s) (hts : t ⊆ s) (h : μ.Integra apply Integrable.mono_measure h simp [transpose_restrict, variation_restrict, hs, ht, Measure.restrict_mono hts le_rfl] +theorem IntegrableOn.union (hs : MeasurableSet s) (ht : MeasurableSet t) + (hf : μ.IntegrableOn f B s) (h'f : μ.IntegrableOn f B t) : + μ.IntegrableOn f B (s ∪ t) := by + apply Integrable.mono_measure (hf.add_measure h'f) + grw [transpose_restrict, variation_restrict_le, Measure.restrict_union_le] + simp [transpose_restrict, variation_restrict, hs, ht] + +@[simp] theorem IntegrableOn.empty : μ.IntegrableOn f B ∅ := by + simp [VectorMeasure.IntegrableOn] + +theorem integrableOn_biUnion_finite + {s : Set ι} (hs : s.Finite) {t : ι → Set X} (ht : ∀ i ∈ s, MeasurableSet (t i)) + (h't : ∀ i ∈ s, μ.IntegrableOn f B (t i)) : + μ.IntegrableOn f B (⋃ i ∈ s, t i) := by + induction s, hs using Set.Finite.induction_on with + | empty => simp + | insert _ h's hf => + simp only [mem_insert_iff, forall_eq_or_imp, iUnion_iUnion_eq_or_left] at ht h't ⊢ + exact IntegrableOn.union ht.1 (h's.measurableSet_biUnion ht.2) h't.1 (hf ht.2 h't.2) + +theorem integrableOn_biUnion_finset {s : Finset ι} {t : ι → Set X} + (ht : ∀ i ∈ s, MeasurableSet (t i)) (h't : ∀ i ∈ s, μ.IntegrableOn f B (t i)) : + μ.IntegrableOn f B (⋃ i ∈ s, t i) := + integrableOn_biUnion_finite s.finite_toSet ht h't + +theorem integrableOn_iUnion_finite [Finite ι] {t : ι → Set X} + (ht : ∀ i, MeasurableSet (t i)) (h't : ∀ i, μ.IntegrableOn f B (t i)) : + μ.IntegrableOn f B (⋃ i, t i) := by + cases nonempty_fintype ι + simpa using integrableOn_biUnion_finset (f := f) (μ := μ) (s := Finset.univ) (t := t) + (fun i hi ↦ ht i) (fun i hi ↦ h't i) + @[simp] theorem integrableOn_univ : μ.IntegrableOn f B univ ↔ μ.Integrable f B := by simp [VectorMeasure.IntegrableOn] @@ -65,54 +75,38 @@ theorem Integrable.IntegrableOn (h : μ.Integrable f B) : μ.IntegrableOn f B s rw [← integrableOn_univ] at h exact h.mono MeasurableSet.univ (subset_univ _) -theorem setIntegral_congr_ae (hs : MeasurableSet s) - (h : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ s → f x = g x) : +theorem setIntegral_congr_ae (h : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ s → f x = g x) : ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in s, g x ∂[B; μ] := by + by_cases hs : MeasurableSet s; swap + · simp [restrict_not_measurable _ hs] apply integral_congr_ae rw [transpose_restrict, variation_restrict _ hs] exact (ae_restrict_iff' hs).2 h -theorem setIntegral_congr_fun (hs : MeasurableSet s) (h : EqOn f g s) : +theorem setIntegral_congr_fun (h : EqOn f g s) : ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in s, g x ∂[B; μ] := - setIntegral_congr_ae hs <| Eventually.of_forall h + setIntegral_congr_ae <| Eventually.of_forall h theorem setIntegral_union (hst : Disjoint s t) (hs : MeasurableSet s) (ht : MeasurableSet t) - (hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) : + (hfs : μ.IntegrableOn f B s) (hft : μ.IntegrableOn f B t) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in t, f x ∂[B; μ] := by - simp only [Measure.restrict_union₀ hst ht, integral_add_measure hfs hft] + rw [← integral_add_vectorMeasure hfs hft, μ.restrict_union hst hs ht] -#exit - -@[deprecated (since := "2026-03-04")] alias integral_union_ae := setIntegral_union₀ - -theorem setIntegral_union (hst : Disjoint s t) (ht : MeasurableSet t) (hfs : IntegrableOn f s μ) - (hft : IntegrableOn f t μ) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in t, f x ∂[B; μ] := - setIntegral_union₀ hst.aedisjoint ht.nullMeasurableSet hfs hft - -theorem setIntegral_diff₀ (ht : NullMeasurableSet t μ) (hfs : IntegrableOn f s μ) (hts : t ⊆ s) : +theorem setIntegral_diff (hs : MeasurableSet s) (ht : MeasurableSet t) + (hfs : μ.IntegrableOn f B s) (hts : t ⊆ s) : ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] - ∫ᵛ x in t, f x ∂[B; μ] := by - rw [eq_sub_iff_add_eq, ← setIntegral_union₀, diff_union_of_subset hts] - exacts [disjoint_sdiff_self_left.aedisjoint, ht, hfs.mono_set diff_subset, hfs.mono_set hts] - -theorem setIntegral_diff (ht : MeasurableSet t) (hfs : IntegrableOn f s μ) (hts : t ⊆ s) : - ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] - ∫ᵛ x in t, f x ∂[B; μ] := - setIntegral_diff₀ ht.nullMeasurableSet hfs hts + rw [eq_sub_iff_add_eq, ← setIntegral_union (by grind) (hs.diff ht) ht (hfs.mono hs diff_subset) + (hfs.mono hs hts), diff_union_of_subset hts] -@[deprecated (since := "2026-03-04")] alias integral_diff := setIntegral_diff - -theorem integral_inter_add_diff₀ (ht : NullMeasurableSet t μ) (hfs : IntegrableOn f s μ) : +theorem setIntegral_inter_add_diff (hs : MeasurableSet s) (ht : MeasurableSet t) + (hfs : μ.IntegrableOn f B s) : ∫ᵛ x in s ∩ t, f x ∂[B; μ] + ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - rw [← Measure.restrict_inter_add_diff₀ s ht, integral_add_measure] - · exact Integrable.mono_measure hfs (Measure.restrict_mono inter_subset_left le_rfl) - · exact Integrable.mono_measure hfs (Measure.restrict_mono diff_subset le_rfl) - -theorem integral_inter_add_diff (ht : MeasurableSet t) (hfs : IntegrableOn f s μ) : - ∫ᵛ x in s ∩ t, f x ∂[B; μ] + ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := - integral_inter_add_diff₀ ht.nullMeasurableSet hfs + rw [← μ.restrict_inter_add_diff hs ht, + integral_add_vectorMeasure (hfs.mono hs inter_subset_left) (hfs.mono hs diff_subset)] -theorem integral_biUnion_finset {ι : Type*} (t : Finset ι) {s : ι → Set X} +theorem setIntegral_biUnion_finset {ι : Type*} (t : Finset ι) {s : ι → Set X} (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s)) - (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) : + (hf : ∀ i ∈ t, μ.IntegrableOn f B (s i)) : ∫ᵛ x in ⋃ i ∈ t, s i, f x ∂[B; μ] = ∑ i ∈ t, ∫ᵛ x in s i, f x ∂[B; μ] := by classical induction t using Finset.induction_on with @@ -120,25 +114,28 @@ theorem integral_biUnion_finset {ι : Type*} (t : Finset ι) {s : ι → Set X} | insert _ _ hat IH => simp only [Finset.coe_insert, Finset.forall_mem_insert, Set.pairwise_insert, Finset.set_biUnion_insert] at hs hf h's ⊢ - rw [setIntegral_union _ _ hf.1 (integrableOn_finset_iUnion.2 hf.2)] + rw [setIntegral_union] · rw [Finset.sum_insert hat, IH hs.2 h's.1 hf.2] · simp only [disjoint_iUnion_right] exact fun i hi => (h's.2 i hi (ne_of_mem_of_not_mem hi hat).symm).1 + · exact hs.1 · exact Finset.measurableSet_biUnion _ hs.2 + · exact hf.1 + · apply integrableOn_biUnion_finset hs.2 hf.2 -theorem integral_iUnion_fintype {ι : Type*} [Fintype ι] {s : ι → Set X} +theorem setIntegral_iUnion_fintype {ι : Type*} [Fintype ι] {s : ι → Set X} (hs : ∀ i, MeasurableSet (s i)) (h's : Pairwise (Disjoint on s)) - (hf : ∀ i, IntegrableOn f (s i) μ) : ∫ᵛ x in ⋃ i, s i, f x ∂[B; μ] = ∑ i, ∫ᵛ x in s i, f x ∂[B; μ] := by - convert integral_biUnion_finset Finset.univ (fun i _ => hs i) _ fun i _ => hf i + (hf : ∀ i, μ.IntegrableOn f B (s i)) : + ∫ᵛ x in ⋃ i, s i, f x ∂[B; μ] = ∑ i, ∫ᵛ x in s i, f x ∂[B; μ] := by + convert setIntegral_biUnion_finset Finset.univ (fun i _ => hs i) _ fun i _ => hf i · simp · simp [pairwise_univ, h's] -theorem setIntegral_empty : ∫ᵛ x in ∅, f x ∂[B; μ] = 0 := by - rw [Measure.restrict_empty, integral_zero_measure] +theorem setIntegral_empty : ∫ᵛ x in ∅, f x ∂[B; μ] = 0 := by simp -theorem setIntegral_univ : ∫ᵛ x in univ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by rw [Measure.restrict_univ] +theorem setIntegral_univ : ∫ᵛ x in univ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by simp -lemma integral_eq_setIntegral (hs : ∀ᵐ x ∂[B; μ], x ∈ s) (f : X → E) : +lemma integral_eq_setIntegral (hs : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ s) (f : X → E) : ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by rw [← setIntegral_univ, ← setIntegral_congr_set]; rwa [ae_eq_univ] @@ -160,6 +157,9 @@ theorem setIntegral_compl (hs : MeasurableSet s) (hfi : Integrable f μ) : ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ] := setIntegral_compl₀ hs.nullMeasurableSet hfi + +#exit + /-- For a function `f` and a measurable set `s`, the integral of `indicator s f` over the whole space is equal to `∫ᵛ x in s, f x ∂[B; μ]` defined as `∫ᵛ x, f x ∂(μ.restrict s)`. -/ theorem integral_indicator (hs : MeasurableSet s) : From 2ae7fd6a36067c15b9e0a2b88999ebbb85232250 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 21 May 2026 11:49:59 +0200 Subject: [PATCH 044/129] more --- .../MeasureTheory/VectorMeasure/Basic.lean | 19 ++++++++++ .../VectorMeasure/Variation/Basic.lean | 37 ++++++++++++++----- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index b6e7f34f44d294..56e93b0eec11cc 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -755,6 +755,25 @@ def restrictGm (i : Set α) : VectorMeasure α M →+ VectorMeasure α M where map_zero' := restrict_zero map_add' _ _ := restrict_add _ _ i +variable [T2Space M] {s t : Set α} + +theorem restrict_inter_add_diff (hs : MeasurableSet s) (ht : MeasurableSet t) : + v.restrict (s ∩ t) + v.restrict (s \ t) = v.restrict s := by + ext1 u hu + simp only [add_apply, restrict_apply, hs, hu, hs.inter ht, hs.diff ht] + rw [← of_union (by grind) (hu.inter (hs.inter ht)) (hu.inter (hs.diff ht))] + congr + grind + +theorem restrict_union_add_inter (hs : MeasurableSet s) (ht : MeasurableSet t) : + v.restrict (s ∪ t) + v.restrict (s ∩ t) = v.restrict s + v.restrict t := by + rw [← v.restrict_inter_add_diff (hs.union ht) ht, union_inter_cancel_right, union_diff_right, + ← v.restrict_inter_add_diff hs ht, add_comm, ← add_assoc, add_right_comm] + +theorem restrict_union (h : Disjoint s t) (hs : MeasurableSet s) (ht : MeasurableSet t) : + v.restrict (s ∪ t) = v.restrict s + v.restrict t := by + simp [← v.restrict_union_add_inter hs ht, disjoint_iff_inter_eq_empty.mp h] + end ContinuousAdd section Partition diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index 64101ada399576..c990b5c514269a 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -41,8 +41,7 @@ variable {X V : Type*} {mX : MeasurableSpace X} section Basic -variable [TopologicalSpace V] [ENormedAddCommMonoid V] [T2Space V] - {μ ν : VectorMeasure X V} {s : Set X} +variable [TopologicalSpace V] [ENormedAddCommMonoid V] [T2Space V] {μ ν : VectorMeasure X V} lemma variation_apply (μ : VectorMeasure X V) (s : Set X) : μ.variation s = preVariation (‖μ ·‖ₑ) (isSigmaSubadditiveSetFun_enorm μ) (by simp) s := rfl @@ -136,7 +135,7 @@ lemma variation_finsetSum_le [ContinuousAdd V] {ι} (s : Finset ι) (μ : ι → simpa [Finset.sum_insert his] using variation_add_le.trans (add_le_add_right ih ((μ i).variation)) -lemma variation_apply_eq_zero (hs : MeasurableSet s) : +lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : MeasurableSet s) : μ.variation s = 0 ↔ ∀ t, t ⊆ s → MeasurableSet t → μ t = 0 := by refine ⟨fun h t hts ht ↦ ?_, fun h ↦ ?_⟩ · apply enorm_eq_zero.1 @@ -148,7 +147,7 @@ lemma variation_apply_eq_zero (hs : MeasurableSet s) : apply variation_apply_le_of_forall_enorm_le hs (fun t ht hts ↦ ?_) simp [h t hts ht] -@[simp] lemma variation_eq_zero : +@[simp] lemma variation_eq_zero {μ : VectorMeasure X V} : μ.variation = 0 ↔ μ = 0 := by refine ⟨fun h ↦ ?_, fun h ↦ by simp [h]⟩ ext s hs @@ -157,7 +156,7 @@ lemma variation_apply_eq_zero (hs : MeasurableSet s) : grw [enorm_measure_le_variation] simp [h] -lemma variation_restrict (hs : MeasurableSet s) : +lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) : (μ.restrict s).variation = μ.variation.restrict s := by apply le_antisymm · apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) @@ -178,14 +177,19 @@ lemma variation_restrict (hs : MeasurableSet s) : gcongr exact Set.inter_subset_left -lemma variation_restrict_le : +lemma variation_restrict_le (μ : VectorMeasure X V) (s : Set X) : (μ.restrict s).variation ≤ μ.variation.restrict s := by by_cases hs : MeasurableSet s - · simp [variation_restrict hs] + · simp [variation_restrict μ hs] · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] +instance {s : Set X} [IsFiniteMeasure μ.variation] : IsFiniteMeasure (μ.restrict s).variation := by + constructor + grw [variation_restrict_le] + exact IsFiniteMeasure.measure_univ_lt_top + lemma variation_map_le {Y : Type*} [MeasurableSpace Y] {φ : X → Y} : - (μ.map φ).variation ≤ Measure.map φ μ.variation := by + (μ.map φ).variation ≤ Measure.map φ μ.variation := by by_cases hφ : Measurable φ; swap · simp [VectorMeasure.map, hφ, Measure.zero_le] apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) @@ -193,6 +197,12 @@ lemma variation_map_le {Y : Type*} [MeasurableSpace Y] {φ : X → Y} : apply le_trans ?_ (enorm_measure_le_variation _ _) simp [VectorMeasure.map_apply _ hφ hs] +instance {Y : Type*} [MeasurableSpace Y] {φ : X → Y} [IsFiniteMeasure μ.variation] : + IsFiniteMeasure (μ.map φ).variation := by + constructor + grw [variation_map_le] + exact IsFiniteMeasure.measure_univ_lt_top + theorem _root_.MeasurableEmbedding.variation_map {Y : Type*} [MeasurableSpace Y] {φ : X → Y} (hφ : MeasurableEmbedding φ) : (μ.map φ).variation = μ.variation.map φ := by @@ -212,7 +222,7 @@ theorem _root_.MeasurableEmbedding.variation_map {Y : Type*} [MeasurableSpace Y] apply le_trans ?_ (enorm_measure_le_variation _ _) rw [map_apply _ hφ.measurable (hφ.measurableSet_image.2 ht), preimage_image_eq _ hφ.injective] -@[simp] lemma variation_dirac {x : X} {v : V} : +@[simp] lemma variation_dirac (x : X) (v : V) : (VectorMeasure.dirac x v).variation = ‖v‖ₑ • Measure.dirac x := by apply le_antisymm · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) @@ -259,6 +269,11 @@ lemma variation_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : _ = (c • μ).variation := by simp [smul_smul, mul_inv_cancel₀ (nnnorm_ne_zero_iff.mpr hc)] +instance {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] {c : 𝕜} [IsFiniteMeasure μ.variation] : + IsFiniteMeasure (c • μ).variation := by + simp only [variation_smul] + infer_instance + instance [Finite X] : IsFiniteMeasure μ.variation := by classical let : Fintype X := Fintype.ofFinite X @@ -267,6 +282,10 @@ instance [Finite X] : IsFiniteMeasure μ.variation := by ennrealPreVariation_apply, preVariationFun, ↓reduceDIte, ← sup_univ_eq_ciSup] exact (Finset.sup_lt_iff (by simp)).2 (fun b hb ↦ by simp [ENNReal.sum_lt_top, enorm_lt_top]) +instance {x : X} {v : V} : IsFiniteMeasure (VectorMeasure.dirac x v).variation := by + simp only [variation_dirac, enorm_eq_nnnorm, Measure.coe_nnreal_smul] + infer_instance + end NormedAddCommGroup end MeasureTheory.VectorMeasure From c8374b46d77a88c5933ee2da03895953ee5325e6 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 21 May 2026 11:54:32 +0200 Subject: [PATCH 045/129] oops --- .../VectorMeasure/Variation/Basic.lean | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index c990b5c514269a..97250bbb32c832 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -41,7 +41,8 @@ variable {X V : Type*} {mX : MeasurableSpace X} section Basic -variable [TopologicalSpace V] [ENormedAddCommMonoid V] [T2Space V] {μ ν : VectorMeasure X V} +variable [TopologicalSpace V] [ENormedAddCommMonoid V] [T2Space V] + {μ ν : VectorMeasure X V} {s : Set X} lemma variation_apply (μ : VectorMeasure X V) (s : Set X) : μ.variation s = preVariation (‖μ ·‖ₑ) (isSigmaSubadditiveSetFun_enorm μ) (by simp) s := rfl @@ -135,7 +136,7 @@ lemma variation_finsetSum_le [ContinuousAdd V] {ι} (s : Finset ι) (μ : ι → simpa [Finset.sum_insert his] using variation_add_le.trans (add_le_add_right ih ((μ i).variation)) -lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : MeasurableSet s) : +lemma variation_apply_eq_zero (hs : MeasurableSet s) : μ.variation s = 0 ↔ ∀ t, t ⊆ s → MeasurableSet t → μ t = 0 := by refine ⟨fun h t hts ht ↦ ?_, fun h ↦ ?_⟩ · apply enorm_eq_zero.1 @@ -147,7 +148,7 @@ lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : Measura apply variation_apply_le_of_forall_enorm_le hs (fun t ht hts ↦ ?_) simp [h t hts ht] -@[simp] lemma variation_eq_zero {μ : VectorMeasure X V} : +@[simp] lemma variation_eq_zero : μ.variation = 0 ↔ μ = 0 := by refine ⟨fun h ↦ ?_, fun h ↦ by simp [h]⟩ ext s hs @@ -156,7 +157,7 @@ lemma variation_apply_eq_zero {μ : VectorMeasure X V} {s : Set X} (hs : Measura grw [enorm_measure_le_variation] simp [h] -lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) : +lemma variation_restrict (hs : MeasurableSet s) : (μ.restrict s).variation = μ.variation.restrict s := by apply le_antisymm · apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) @@ -177,19 +178,21 @@ lemma variation_restrict (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSe gcongr exact Set.inter_subset_left -lemma variation_restrict_le (μ : VectorMeasure X V) (s : Set X) : +lemma variation_restrict_le : (μ.restrict s).variation ≤ μ.variation.restrict s := by by_cases hs : MeasurableSet s · simp [variation_restrict μ hs] · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] -instance {s : Set X} [IsFiniteMeasure μ.variation] : IsFiniteMeasure (μ.restrict s).variation := by +instance [IsFiniteMeasure μ.variation] : IsFiniteMeasure (μ.restrict s).variation := by constructor grw [variation_restrict_le] exact IsFiniteMeasure.measure_univ_lt_top -lemma variation_map_le {Y : Type*} [MeasurableSpace Y] {φ : X → Y} : - (μ.map φ).variation ≤ Measure.map φ μ.variation := by +variable {Y : Type*} [MeasurableSpace Y] {φ : X → Y} + +lemma variation_map_le : + (μ.map φ).variation ≤ Measure.map φ μ.variation := by by_cases hφ : Measurable φ; swap · simp [VectorMeasure.map, hφ, Measure.zero_le] apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) @@ -197,14 +200,12 @@ lemma variation_map_le {Y : Type*} [MeasurableSpace Y] {φ : X → Y} : apply le_trans ?_ (enorm_measure_le_variation _ _) simp [VectorMeasure.map_apply _ hφ hs] -instance {Y : Type*} [MeasurableSpace Y] {φ : X → Y} [IsFiniteMeasure μ.variation] : - IsFiniteMeasure (μ.map φ).variation := by +instance [IsFiniteMeasure μ.variation] : IsFiniteMeasure (μ.map φ).variation := by constructor grw [variation_map_le] exact IsFiniteMeasure.measure_univ_lt_top -theorem _root_.MeasurableEmbedding.variation_map {Y : Type*} [MeasurableSpace Y] {φ : X → Y} - (hφ : MeasurableEmbedding φ) : +theorem _root_.MeasurableEmbedding.variation_map (hφ : MeasurableEmbedding φ) : (μ.map φ).variation = μ.variation.map φ := by apply le_antisymm variation_map_le ?_ apply Measure.le_iff.2 (fun s hs ↦ ?_) @@ -222,7 +223,7 @@ theorem _root_.MeasurableEmbedding.variation_map {Y : Type*} [MeasurableSpace Y] apply le_trans ?_ (enorm_measure_le_variation _ _) rw [map_apply _ hφ.measurable (hφ.measurableSet_image.2 ht), preimage_image_eq _ hφ.injective] -@[simp] lemma variation_dirac (x : X) (v : V) : +@[simp] lemma variation_dirac {x : X} {v : V} : (VectorMeasure.dirac x v).variation = ‖v‖ₑ • Measure.dirac x := by apply le_antisymm · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) From 2f2289514e22d26d35dea95aca7a61384307d565 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 21 May 2026 14:07:02 +0200 Subject: [PATCH 046/129] more --- .../ConditionalExpectation/CondexpL1.lean | 3 +- .../MeasureTheory/VectorMeasure/Basic.lean | 37 +++++----- .../MeasureTheory/VectorMeasure/Integral.lean | 4 +- .../VectorMeasure/SetIntegral.lean | 70 ++++++++----------- .../VectorMeasure/Variation/Basic.lean | 10 ++- 5 files changed, 58 insertions(+), 66 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean index c408de23443a01..77976aeb154df0 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean @@ -447,8 +447,7 @@ end CondExpL1CLM /-- Conditional expectation of a function, in L1. Its value is 0 if the function is not integrable. The function-valued `condExp` should be used instead in most cases. -/ -@[nolint unusedArguments] -- TODO: drop the completeness assumption in the definition, and fix -def condExpL1 [CompleteSpace F'] (hm : m ≤ m0) (μ : Measure α) [SigmaFinite (μ.trim hm)] +def condExpL1 (hm : m ≤ m0) (μ : Measure α) [SigmaFinite (μ.trim hm)] (f : α → F') : α →₁[μ] F' := setToFun μ (condExpInd F' hm μ) (dominatedFinMeasAdditive_condExpInd F' hm μ) f diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index 56e93b0eec11cc..b35e41ce32f568 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -723,6 +723,11 @@ theorem restrict_singleton {a : α} : v.restrict {a} = VectorMeasure.dirac a (v by_cases ha : a ∈ s <;> simp [*, restrict_apply] · simp [restrict, h] +theorem restrict_restrict {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t) : + (v.restrict t).restrict s = v.restrict (s ∩ t) := by + ext u hu + simp [restrict_apply, hs, hu, ht, Set.inter_assoc] + section ContinuousAdd variable [ContinuousAdd M] @@ -755,7 +760,21 @@ def restrictGm (i : Set α) : VectorMeasure α M →+ VectorMeasure α M where map_zero' := restrict_zero map_add' _ _ := restrict_add _ _ i -variable [T2Space M] {s t : Set α} +end ContinuousAdd + +section Partition + +variable {M : Type*} [TopologicalSpace M] [AddCommMonoid M] [T2Space M] [ContinuousAdd M] +variable (v : VectorMeasure α M) {i s t : Set α} + +@[simp] +theorem restrict_add_restrict_compl (hi : MeasurableSet i) : + v.restrict i + v.restrict iᶜ = v := by + ext A hA + rw [add_apply, restrict_apply _ hi hA, restrict_apply _ hi.compl hA, + ← of_union _ (hA.inter hi) (hA.inter hi.compl)] + · simp + · exact disjoint_compl_right.inter_right' A |>.inter_left' A theorem restrict_inter_add_diff (hs : MeasurableSet s) (ht : MeasurableSet t) : v.restrict (s ∩ t) + v.restrict (s \ t) = v.restrict s := by @@ -774,22 +793,6 @@ theorem restrict_union (h : Disjoint s t) (hs : MeasurableSet s) (ht : Measurabl v.restrict (s ∪ t) = v.restrict s + v.restrict t := by simp [← v.restrict_union_add_inter hs ht, disjoint_iff_inter_eq_empty.mp h] -end ContinuousAdd - -section Partition - -variable {M : Type*} [TopologicalSpace M] [AddCommMonoid M] [T2Space M] [ContinuousAdd M] -variable (v : VectorMeasure α M) {i : Set α} - -@[simp] -theorem restrict_add_restrict_compl (hi : MeasurableSet i) : - v.restrict i + v.restrict iᶜ = v := by - ext A hA - rw [add_apply, restrict_apply _ hi hA, restrict_apply _ hi.compl hA, - ← of_union _ (hA.inter hi) (hA.inter hi.compl)] - · simp - · exact disjoint_compl_right.inter_right' A |>.inter_left' A - end Partition section Sub diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 8f506a5ef74755..be751a44dfde25 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -228,7 +228,7 @@ lemma integrable_finsetSum_vectorMeasure {ι : Type*} {μ : ι → VectorMeasure lemma Integrable.restrict (hf : μ.Integrable f B) {s : Set X} : (μ.restrict s).Integrable f B := by by_cases hs : MeasurableSet s - · simp only [VectorMeasure.Integrable, transpose_restrict, variation_restrict _ hs] + · simp only [VectorMeasure.Integrable, transpose_restrict, variation_restrict hs] exact MeasureTheory.Integrable.restrict hf · simp [restrict_not_measurable _ hs] @@ -468,7 +468,7 @@ theorem setIntegral_vectorMeasure_zero (f : X → E) {s : Set X} by_cases h's : MeasurableSet s; swap · simp [restrict_not_measurable μ h's] have : ((μ.restrict s).transpose B).variation = 0 := by - rw [transpose_restrict, variation_restrict _ h's] + rw [transpose_restrict, variation_restrict h's] apply Measure.restrict_eq_zero.2 hs have : (μ.restrict s).transpose B = 0 := variation_eq_zero.1 this simp [integral, this] diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index dbdae0a64c50b6..2bc959a70b2ada 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -71,7 +71,7 @@ theorem integrableOn_iUnion_finite [Finite ι] {t : ι → Set X} @[simp] theorem integrableOn_univ : μ.IntegrableOn f B univ ↔ μ.Integrable f B := by simp [VectorMeasure.IntegrableOn] -theorem Integrable.IntegrableOn (h : μ.Integrable f B) : μ.IntegrableOn f B s := by +theorem Integrable.integrableOn (h : μ.Integrable f B) : μ.IntegrableOn f B s := by rw [← integrableOn_univ] at h exact h.mono MeasurableSet.univ (subset_univ _) @@ -80,7 +80,7 @@ theorem setIntegral_congr_ae (h : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ by_cases hs : MeasurableSet s; swap · simp [restrict_not_measurable _ hs] apply integral_congr_ae - rw [transpose_restrict, variation_restrict _ hs] + rw [transpose_restrict, variation_restrict hs] exact (ae_restrict_iff' hs).2 h theorem setIntegral_congr_fun (h : EqOn f g s) : @@ -135,61 +135,53 @@ theorem setIntegral_empty : ∫ᵛ x in ∅, f x ∂[B; μ] = 0 := by simp theorem setIntegral_univ : ∫ᵛ x in univ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by simp -lemma integral_eq_setIntegral (hs : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ s) (f : X → E) : - ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - rw [← setIntegral_univ, ← setIntegral_congr_set]; rwa [ae_eq_univ] - -theorem integral_add_compl₀ (hs : NullMeasurableSet s μ) (hfi : Integrable f μ) : +theorem setIntegral_add_compl (hs : MeasurableSet s) (hfi : μ.Integrable f B) : ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by - have := setIntegral_union₀ disjoint_compl_right.aedisjoint - hs.compl hfi.integrableOn hfi.integrableOn + have := setIntegral_union disjoint_compl_right + hs hs.compl hfi.integrableOn hfi.integrableOn rw [← this, union_compl_self, setIntegral_univ] -theorem integral_add_compl (hs : MeasurableSet s) (hfi : Integrable f μ) : - ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := - integral_add_compl₀ hs.nullMeasurableSet hfi - -theorem setIntegral_compl₀ (hs : NullMeasurableSet s μ) (hfi : Integrable f μ) : +theorem setIntegral_compl (hs : MeasurableSet s) (hfi : μ.Integrable f B) : ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ] := by - rw [← integral_add_compl₀ (μ := μ) hs hfi, add_sub_cancel_left] + rw [← setIntegral_add_compl (μ := μ) hs hfi, add_sub_cancel_left] -theorem setIntegral_compl (hs : MeasurableSet s) (hfi : Integrable f μ) : - ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ] := - setIntegral_compl₀ hs.nullMeasurableSet hfi +theorem integrable_indicator_iff (hs : MeasurableSet s) : + μ.Integrable (indicator s f) B ↔ μ.IntegrableOn f B s := by + simp [VectorMeasure.Integrable, VectorMeasure.IntegrableOn, MeasureTheory.IntegrableOn, + MeasureTheory.integrable_indicator_iff hs, transpose_restrict, variation_restrict hs] - -#exit +theorem IntegrableOn.integrable_indicator (h : μ.IntegrableOn f B s) (hs : MeasurableSet s) : + μ.Integrable (indicator s f) B := + (integrable_indicator_iff hs).2 h /-- For a function `f` and a measurable set `s`, the integral of `indicator s f` -over the whole space is equal to `∫ᵛ x in s, f x ∂[B; μ]` defined as `∫ᵛ x, f x ∂(μ.restrict s)`. -/ +over the whole space is equal to `∫ᵛ x in s, f x ∂[B; μ]` +defined as `∫ᵛ x, f x ∂[B; μ.restrict s]`. -/ theorem integral_indicator (hs : MeasurableSet s) : ∫ᵛ x, indicator s f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - by_cases hfi : IntegrableOn f s μ; swap + by_cases hfi : μ.IntegrableOn f B s; swap · rw [integral_undef hfi, integral_undef] - rwa [integrable_indicator_iff hs] + rw [integrable_indicator_iff hs] + simpa [transpose_restrict, variation_restrict hs] using hfi calc - ∫ᵛ x, indicator s f x ∂[B; μ] = ∫ᵛ x in s, indicator s f x ∂[B; μ] + ∫ᵛ x in sᶜ, indicator s f x ∂[B; μ] := - (integral_add_compl hs (hfi.integrable_indicator hs)).symm - _ = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, 0 ∂[B; μ] := - (congr_arg₂ (· + ·) (integral_congr_ae (indicator_ae_eq_restrict hs)) - (integral_congr_ae (indicator_ae_eq_restrict_compl hs))) + ∫ᵛ x, indicator s f x ∂[B; μ] + _ = ∫ᵛ x in s, indicator s f x ∂[B; μ] + ∫ᵛ x in sᶜ, indicator s f x ∂[B; μ] := + (setIntegral_add_compl hs (hfi.integrable_indicator hs)).symm + _ = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, 0 ∂[B; μ] := by + apply congr_arg₂ (· + ·) (integral_congr_ae ?_) (integral_congr_ae ?_) + · rw [transpose_restrict, variation_restrict hs] + exact indicator_ae_eq_restrict hs + · rw [transpose_restrict, variation_restrict hs.compl] + exact indicator_ae_eq_restrict_compl hs _ = ∫ᵛ x in s, f x ∂[B; μ] := by simp -theorem integral_indicator₀ (hs : NullMeasurableSet s μ) : - ∫ᵛ x, indicator s f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - rw [← integral_congr_ae (indicator_ae_eq_of_ae_eq_set hs.toMeasurable_ae_eq), - integral_indicator (measurableSet_toMeasurable _ _), - Measure.restrict_congr_set hs.toMeasurable_ae_eq] - -lemma integral_integral_indicator {mY : MeasurableSpace Y} {ν : Measure Y} (f : X → Y → E) - {s : Set X} (hs : MeasurableSet s) : - ∫ᵛ x, ∫ᵛ y, s.indicator (f · y) x ∂ν ∂[B; μ] = ∫ᵛ x in s, ∫ᵛ y, f x y ∂ν ∂[B; μ] := by - simp_rw [← integral_indicator hs, integral_indicator₂] - theorem setIntegral_indicator (ht : MeasurableSet t) : ∫ᵛ x in s, t.indicator f x ∂[B; μ] = ∫ᵛ x in s ∩ t, f x ∂[B; μ] := by rw [integral_indicator ht, Measure.restrict_restrict ht, Set.inter_comm] + +#exit + /-- **Inclusion-exclusion principle** for the integral of a function over a union. The integral of a function `f` over the union of the `s i` over `i ∈ t` is the alternating sum of diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index 97250bbb32c832..530d048bdc3c8c 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -98,7 +98,7 @@ lemma absolutelyContinuous (μ : VectorMeasure X V) : μ ≪ᵥ μ.ennrealVariat grw [enorm_measure_le_variation, ← ennrealVariation_apply _ hsm, hs] · exact μ.not_measurable' hsm -lemma variation_apply_le_of_forall_enorm_le {m : Measure X} {s : Set X} (hs : MeasurableSet s) +lemma variation_apply_le_of_forall_enorm_le {m : Measure X} (hs : MeasurableSet s) (h : ∀ E, MeasurableSet E → E ⊆ s → ‖μ E‖ₑ ≤ m E) : μ.variation s ≤ m s := by simp only [variation_apply, preVariation, ennrealToMeasure_apply hs, ennrealPreVariation_apply, @@ -148,8 +148,7 @@ lemma variation_apply_eq_zero (hs : MeasurableSet s) : apply variation_apply_le_of_forall_enorm_le hs (fun t ht hts ↦ ?_) simp [h t hts ht] -@[simp] lemma variation_eq_zero : - μ.variation = 0 ↔ μ = 0 := by +@[simp] lemma variation_eq_zero : μ.variation = 0 ↔ μ = 0 := by refine ⟨fun h ↦ ?_, fun h ↦ by simp [h]⟩ ext s hs apply enorm_eq_zero.1 @@ -178,10 +177,9 @@ lemma variation_restrict (hs : MeasurableSet s) : gcongr exact Set.inter_subset_left -lemma variation_restrict_le : - (μ.restrict s).variation ≤ μ.variation.restrict s := by +lemma variation_restrict_le : (μ.restrict s).variation ≤ μ.variation.restrict s := by by_cases hs : MeasurableSet s - · simp [variation_restrict μ hs] + · simp [variation_restrict hs] · simp only [restrict_not_measurable _ hs, variation_zero, Measure.zero_le] instance [IsFiniteMeasure μ.variation] : IsFiniteMeasure (μ.restrict s).variation := by From 10312d446e449b06e8a367d39effa53c57edf311 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 21 May 2026 15:15:28 +0200 Subject: [PATCH 047/129] progress --- Mathlib.lean | 1 + .../VectorMeasure/SetIntegral.lean | 133 ++---------------- 2 files changed, 11 insertions(+), 123 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index b3a3e898566b06..f80d01dfe64b26 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5564,6 +5564,7 @@ public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.JordanSub public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Lebesgue public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.RadonNikodym public import Mathlib.MeasureTheory.VectorMeasure.Integral +public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral public import Mathlib.MeasureTheory.VectorMeasure.Variation.Basic public import Mathlib.MeasureTheory.VectorMeasure.Variation.Defs public import Mathlib.MeasureTheory.VectorMeasure.WithDensity diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 2bc959a70b2ada..8ec97d06e1e93d 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -175,139 +175,26 @@ theorem integral_indicator (hs : MeasurableSet s) : exact indicator_ae_eq_restrict_compl hs _ = ∫ᵛ x in s, f x ∂[B; μ] := by simp -theorem setIntegral_indicator (ht : MeasurableSet t) : +theorem setIntegral_indicator (hs : MeasurableSet s) (ht : MeasurableSet t) : ∫ᵛ x in s, t.indicator f x ∂[B; μ] = ∫ᵛ x in s ∩ t, f x ∂[B; μ] := by - rw [integral_indicator ht, Measure.restrict_restrict ht, Set.inter_comm] + rw [integral_indicator ht, μ.restrict_restrict ht hs, Set.inter_comm] - -#exit - -/-- **Inclusion-exclusion principle** for the integral of a function over a union. - -The integral of a function `f` over the union of the `s i` over `i ∈ t` is the alternating sum of -the integrals of `f` over the intersections of the `s i`. -/ -theorem integral_biUnion_eq_sum_powerset {ι : Type*} {t : Finset ι} {s : ι → Set X} - (hs : ∀ i ∈ t, MeasurableSet (s i)) (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) : - ∫ᵛ x in ⋃ i ∈ t, s i, f x ∂[B; μ] = ∑ u ∈ t.powerset with u.Nonempty, - (-1 : ℝ) ^ (#u + 1) • ∫ᵛ x in ⋂ i ∈ u, s i, f x ∂[B; μ] := by - simp_rw [← integral_smul, ← integral_indicator (Finset.measurableSet_biUnion _ hs)] - have A (u) (hu : u ∈ t.powerset.filter (·.Nonempty)) : MeasurableSet (⋂ i ∈ u, s i) := by - refine u.measurableSet_biInter fun i hi ↦ hs i ?_ - grind - have : ∑ x ∈ t.powerset with x.Nonempty, ∫ᵛ (a : X) in ⋂ i ∈ x, s i, (-1 : ℝ) ^ (#x + 1) • f a ∂[B; μ] - = ∑ x ∈ t.powerset with x.Nonempty, ∫ᵛ a, indicator (⋂ i ∈ x, s i) - (fun a ↦ (-1 : ℝ) ^ (#x + 1) • f a) a ∂[B; μ] := by - apply Finset.sum_congr rfl (fun x hx ↦ ?_) - rw [← integral_indicator (A x hx)] - rw [this, ← integral_finsetSum]; swap - · intro u hu - rw [integrable_indicator_iff (A u hu)] - apply Integrable.smul - simp only [Finset.mem_filter, Finset.mem_powerset] at hu - rcases hu.2 with ⟨i, hi⟩ - exact (hf i (hu.1 hi)).mono (biInter_subset_of_mem hi) le_rfl - congr with x - convert Finset.indicator_biUnion_eq_sum_powerset t s f x with u hu - rw [indicator_smul_apply] - norm_cast - -theorem ofReal_setIntegral_one_of_measure_ne_top {X : Type*} {m : MeasurableSpace X} - {μ : Measure X} {s : Set X} (hs : μ s ≠ ∞ := by finiteness) : - ENNReal.ofReal (∫ᵛ _ in s, (1 : ℝ) ∂[B; μ]) = μ s := - calc - ENNReal.ofReal (∫ᵛ _ in s, (1 : ℝ) ∂[B; μ]) = ENNReal.ofReal (∫ᵛ _ in s, ‖(1 : ℝ)‖ ∂[B; μ]) := by - simp only [norm_one] - _ = ∫⁻ _ in s, 1 ∂[B; μ] := by simp [measureReal_def, hs] - _ = μ s := setLIntegral_one _ - -theorem ofReal_setIntegral_one {X : Type*} {_ : MeasurableSpace X} (μ : Measure X) - [IsFiniteMeasure μ] (s : Set X) : ENNReal.ofReal (∫ᵛ _ in s, (1 : ℝ) ∂[B; μ]) = μ s := - ofReal_setIntegral_one_of_measure_ne_top - -theorem setIntegral_one_eq_measureReal {X : Type*} {m : MeasurableSpace X} - {μ : Measure X} {s : Set X} : - ∫ᵛ _ in s, (1 : ℝ) ∂[B; μ] = μ.real s := by simp - -/-- **Inclusion-exclusion principle** for the measure of a union of sets of finite measure. - -The measure of the union of the `s i` over `i ∈ t` is the alternating sum of the measures of the -intersections of the `s i`. -/ -theorem measureReal_biUnion_eq_sum_powerset {ι : Type*} {t : Finset ι} {s : ι → Set X} - (hs : ∀ i ∈ t, MeasurableSet (s i)) (hf : ∀ i ∈ t, μ (s i) ≠ ∞ := by finiteness) : - μ.real (⋃ i ∈ t, s i) = ∑ u ∈ t.powerset with u.Nonempty, - (-1 : ℝ) ^ (#u + 1) * μ.real (⋂ i ∈ u, s i) := by - simp_rw [← setIntegral_one_eq_measureReal] - apply integral_biUnion_eq_sum_powerset hs - intro i hi - simpa using (hf i hi).lt_top - -theorem integral_piecewise [DecidablePred (· ∈ s)] (hs : MeasurableSet s) (hf : IntegrableOn f s μ) - (hg : IntegrableOn g sᶜ μ) : +theorem integral_piecewise [DecidablePred (· ∈ s)] + (hs : MeasurableSet s) (hf : μ.IntegrableOn f B s) (hg : μ.IntegrableOn g B sᶜ) : ∫ᵛ x, s.piecewise f g x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, g x ∂[B; μ] := by rw [← Set.indicator_add_compl_eq_piecewise, - integral_add' (hf.integrable_indicator hs) (hg.integrable_indicator hs.compl), + integral_add (hf.integrable_indicator hs) (hg.integrable_indicator hs.compl), integral_indicator hs, integral_indicator hs.compl] -theorem tendsto_setIntegral_of_monotone₀ - {ι : Type*} [Preorder ι] [(atTop : Filter ι).IsCountablyGenerated] - {s : ι → Set X} (hsm : ∀ i, NullMeasurableSet (s i) μ) (h_mono : Monotone s) - (hfi : IntegrableOn f (⋃ n, s n) μ) : - Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) atTop (𝓝 (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ])) := by - refine .of_neBot_imp fun hne ↦ ?_ - have := (atTop_neBot_iff.mp hne).2 - have hfi' : ∫⁻ x in ⋃ n, s n, ‖f x‖₊ ∂[B; μ] < ∞ := hfi.2 - set S := ⋃ i, s i - have hSm : NullMeasurableSet S μ := MeasurableSet.iUnion_of_monotone h_mono hsm - have hsub {i} : s i ⊆ S := subset_iUnion s i - rw [← withDensity_apply₀ _ hSm] at hfi' - set ν := μ.withDensity (‖f ·‖ₑ) with hν - refine Metric.nhds_basis_closedBall.tendsto_right_iff.2 fun ε ε0 => ?_ - lift ε to ℝ≥0 using ε0.le - have : ∀ᶠ i in atTop, ν (s i) ∈ Icc (ν S - ε) (ν S + ε) := - tendsto_measure_iUnion_atTop h_mono (ENNReal.Icc_mem_nhds hfi'.ne (ENNReal.coe_pos.2 ε0).ne') - filter_upwards [this] with i hi - rw [mem_closedBall_iff_norm', ← setIntegral_diff₀ (hsm i) hfi hsub, ← coe_nnnorm, - NNReal.coe_le_coe, ← ENNReal.coe_le_coe] - refine (enorm_integral_le_lintegral_enorm _).trans ?_ - have hsm' : NullMeasurableSet (s i) ν := (hsm i).mono_ac (withDensity_absolutelyContinuous ..) - rw [← withDensity_apply₀ _ (hSm.diff (hsm _)), ← hν, measure_diff hsub hsm'] - exacts [tsub_le_iff_tsub_le.mp hi.1, - (hi.2.trans_lt <| ENNReal.add_lt_top.2 ⟨hfi', ENNReal.coe_lt_top⟩).ne] - -theorem tendsto_setIntegral_of_monotone - {ι : Type*} [Preorder ι] [(atTop : Filter ι).IsCountablyGenerated] - {s : ι → Set X} (hsm : ∀ i, MeasurableSet (s i)) (h_mono : Monotone s) - (hfi : IntegrableOn f (⋃ n, s n) μ) : - Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) atTop (𝓝 (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ])) := - tendsto_setIntegral_of_monotone₀ (hsm · |>.nullMeasurableSet) h_mono hfi - -theorem tendsto_setIntegral_of_antitone - {ι : Type*} [Preorder ι] [(atTop : Filter ι).IsCountablyGenerated] - {s : ι → Set X} (hsm : ∀ i, MeasurableSet (s i)) (h_anti : Antitone s) - (hfi : ∃ i, IntegrableOn f (s i) μ) : - Tendsto (fun i ↦ ∫ᵛ x in s i, f x ∂[B; μ]) atTop (𝓝 (∫ᵛ x in ⋂ n, s n, f x ∂[B; μ])) := by - refine .of_neBot_imp fun hne ↦ ?_ - have := (atTop_neBot_iff.mp hne).2 - rcases hfi with ⟨i₀, hi₀⟩ - suffices Tendsto (∫ᵛ x in s i₀, f x ∂[B; μ] - ∫ᵛ x in s i₀ \ s ·, f x ∂[B; μ]) atTop - (𝓝 (∫ᵛ x in s i₀, f x ∂[B; μ] - ∫ᵛ x in ⋃ i, s i₀ \ s i, f x ∂[B; μ])) by - convert this.congr' <| (eventually_ge_atTop i₀).mono fun i hi ↦ ?_ - · rw [← diff_iInter, setIntegral_diff _ hi₀ (iInter_subset _ _), sub_sub_cancel] - exact .iInter_of_antitone h_anti hsm - · rw [setIntegral_diff (hsm i) hi₀ (h_anti hi), sub_sub_cancel] - apply tendsto_const_nhds.sub - refine tendsto_setIntegral_of_monotone (by measurability) ?_ ?_ - · exact fun i j h ↦ diff_subset_diff_right (h_anti h) - · rw [← diff_iInter] - exact hi₀.mono_set diff_subset - -theorem hasSum_integral_iUnion_ae {ι : Type*} [Countable ι] {s : ι → Set X} - (hm : ∀ i, NullMeasurableSet (s i) μ) (hd : Pairwise (AEDisjoint μ on s)) - (hfi : IntegrableOn f (⋃ i, s i) μ) : +theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} + (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) + (hfi : μ.IntegrableOn f B (⋃ i, s i)) : HasSum (fun n => ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by simp only [IntegrableOn, Measure.restrict_iUnion_ae hd hm] at hfi ⊢ exact hasSum_integral_measure hfi +#exit + theorem hasSum_integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) (hfi : IntegrableOn f (⋃ i, s i) μ) : From d0071e60f6d24eeffa1557f57b21b5f61cc551a8 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 21 May 2026 16:19:57 +0200 Subject: [PATCH 048/129] more --- Mathlib/Analysis/Normed/Group/InfiniteSum.lean | 3 +++ Mathlib/MeasureTheory/VectorMeasure/Integral.lean | 4 ++++ Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean | 8 +++++++- Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Mathlib/Analysis/Normed/Group/InfiniteSum.lean b/Mathlib/Analysis/Normed/Group/InfiniteSum.lean index 8c94cc49287a62..d44bec01e3a7b0 100644 --- a/Mathlib/Analysis/Normed/Group/InfiniteSum.lean +++ b/Mathlib/Analysis/Normed/Group/InfiniteSum.lean @@ -188,3 +188,6 @@ theorem Summable.of_norm {f : ι → E} (hf : Summable fun a => ‖f a‖) : Sum theorem Summable.of_nnnorm {f : ι → E} (hf : Summable fun a => ‖f a‖₊) : Summable f := .of_nnnorm_bounded hf fun _i => le_rfl + +theorem Summable.of_enorm {f : ι → E} (hf : ∑' a, ‖f a‖ₑ ≠ ∞) : Summable f := + Summable.of_nnnorm_bounded (tsum_coe_ne_top_iff_summable.1 hf) fun _i => le_rfl diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index be751a44dfde25..c0387d94eca0c9 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -236,6 +236,10 @@ lemma Integrable.restrict (hf : μ.Integrable f B) {s : Set X} : apply setToFun_zero_left' simp [transpose] +theorem integral_of_not_completeSpace (hG : ¬CompleteSpace G) : + ∫ᵛ x, f x ∂[B; μ] = 0 := by + simp [integral, setToFun, hG] + theorem integral_fun_add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := setToFun_add (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 8ec97d06e1e93d..1bbf3a9fba5b82 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -189,7 +189,13 @@ theorem integral_piecewise [DecidablePred (· ∈ s)] theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) (hfi : μ.IntegrableOn f B (⋃ i, s i)) : - HasSum (fun n => ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by + HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by + by_cases hG : CompleteSpace G; swap + · simp [integral_of_not_completeSpace hG] + have : Summable (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) := by + apply Summable.of_enorm + + simp only [IntegrableOn, Measure.restrict_iUnion_ae hd hm] at hfi ⊢ exact hasSum_integral_measure hfi diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index 37df9b5a1e1082..193fcc2fddd92e 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -5,7 +5,7 @@ Authors: Sébastien Gouëzel -/ module -public import Mathlib.MeasureTheory.VectorMeasure.Integral +public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral /-! # Vector measure with density with respect to a vector measure From d359b1a91c8b199791a42490da6c6133d2dd268d Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 21 May 2026 17:00:40 +0200 Subject: [PATCH 049/129] progress --- .../MeasureTheory/VectorMeasure/SetIntegral.lean | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 1bbf3a9fba5b82..93dadf183c5a28 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -186,6 +186,11 @@ theorem integral_piecewise [DecidablePred (· ∈ s)] integral_add (hf.integrable_indicator hs) (hg.integrable_indicator hs.compl), integral_indicator hs, integral_indicator hs.compl] +theorem enorm_setIntegral_le_lintegral_enorm : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x in s, ‖f x‖ₑ ∂(μ.transpose B).variation := by + grw [enorm_integral_le_lintegral_enorm, transpose_restrict] + exact lintegral_mono' variation_restrict_le le_rfl + theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) (hfi : μ.IntegrableOn f B (⋃ i, s i)) : @@ -194,6 +199,16 @@ theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} · simp [integral_of_not_completeSpace hG] have : Summable (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) := by apply Summable.of_enorm + apply ne_of_lt + calc ∑' i, ‖∫ᵛ x in s i, f x ∂[B; μ]‖ₑ + _ ≤ ∑' i, ∫⁻ x in s i, ‖f x‖ₑ ∂(μ.transpose B).variation := by + gcongr + apply enorm_setIntegral_le_lintegral_enorm + _ = ∫⁻ x in (⋃ i, s i), ‖f x‖ₑ ∂(μ.transpose B).variation := (lintegral_iUnion hm hd _).symm + _ < ∞ := by + simp only [VectorMeasure.IntegrableOn, VectorMeasure.Integrable, transpose_restrict, + variation_restrict (MeasurableSet.iUnion hm)] at hfi + exact hfi.2 simp only [IntegrableOn, Measure.restrict_iUnion_ae hd hm] at hfi ⊢ From 886a133902971930d3f1470fe3348d5ea2d19f3c Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 22 May 2026 12:02:15 +0200 Subject: [PATCH 050/129] progress --- .../VectorMeasure/SetIntegral.lean | 100 ++++++++++++------ 1 file changed, 69 insertions(+), 31 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 93dadf183c5a28..a8a8b70374827b 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -75,10 +75,14 @@ theorem Integrable.integrableOn (h : μ.Integrable f B) : μ.IntegrableOn f B s rw [← integrableOn_univ] at h exact h.mono MeasurableSet.univ (subset_univ _) +theorem setIntegral_eq_zero_of_not_measurableSet (hs : ¬MeasurableSet s) : + ∫ᵛ x in s, f x ∂[B; μ] = 0 := by + simp [restrict_not_measurable _ hs] + theorem setIntegral_congr_ae (h : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ s → f x = g x) : ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in s, g x ∂[B; μ] := by by_cases hs : MeasurableSet s; swap - · simp [restrict_not_measurable _ hs] + · simp [setIntegral_eq_zero_of_not_measurableSet hs] apply integral_congr_ae rw [transpose_restrict, variation_restrict hs] exact (ae_restrict_iff' hs).2 h @@ -191,64 +195,98 @@ theorem enorm_setIntegral_le_lintegral_enorm : grw [enorm_integral_le_lintegral_enorm, transpose_restrict] exact lintegral_mono' variation_restrict_le le_rfl -theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} +private theorem hasSum_setIntegral_iUnion_nat {s : ℕ → Set X} (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) (hfi : μ.IntegrableOn f B (⋃ i, s i)) : HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by by_cases hG : CompleteSpace G; swap · simp [integral_of_not_completeSpace hG] - have : Summable (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) := by - apply Summable.of_enorm - apply ne_of_lt - calc ∑' i, ‖∫ᵛ x in s i, f x ∂[B; μ]‖ₑ - _ ≤ ∑' i, ∫⁻ x in s i, ‖f x‖ₑ ∂(μ.transpose B).variation := by - gcongr - apply enorm_setIntegral_le_lintegral_enorm + have I : ∑' i, ∫⁻ x in s i, ‖f x‖ₑ ∂(μ.transpose B).variation < ∞ := calc _ = ∫⁻ x in (⋃ i, s i), ‖f x‖ₑ ∂(μ.transpose B).variation := (lintegral_iUnion hm hd _).symm _ < ∞ := by simp only [VectorMeasure.IntegrableOn, VectorMeasure.Integrable, transpose_restrict, variation_restrict (MeasurableSet.iUnion hm)] at hfi exact hfi.2 + have : Summable (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) := by + apply Summable.of_enorm (lt_of_le_of_lt _ I).ne + gcongr + exact enorm_setIntegral_le_lintegral_enorm + apply (Summable.hasSum_iff_tendsto_nat this).2 + simp_rw [tendsto_iff_edist_tendsto_0, edist_eq_enorm_sub, enorm_sub_rev] + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds + (ENNReal.tendsto_sum_nat_add _ I.ne) (by positivity) (fun N ↦ ?_) + have : ⋃ n, s n = (⋃ n ∈ Finset.range N, s n) ∪ (⋃ n, s (n + N)) := by + ext x + have : (∃ i, x ∈ s (i + N)) ↔ (∃ i ≥ N, x ∈ s i) := + ⟨fun ⟨i, hi⟩ ↦ ⟨i + N, by grind⟩, fun ⟨i, hi, h'i⟩ ↦ ⟨i - N, by grind⟩⟩ + simp only [mem_iUnion, Finset.mem_range, mem_union, exists_prop, this, ge_iff_le] + grind + rw [this, setIntegral_union]; rotate_left + · simp only [Finset.mem_range, disjoint_iUnion_right, disjoint_iUnion_left] + intro i j hi + apply hd (by grind) + · apply MeasurableSet.biUnion (Finset.countable_toSet _) (fun i hi ↦ hm i) + · apply MeasurableSet.iUnion (fun i ↦ hm _) + · apply hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) + · apply hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) + rw [setIntegral_biUnion_finset]; rotate_left + · exact fun i hi ↦ hm i + · exact fun i hi j hj hij ↦ hd hij + · exact fun i hi ↦ hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) + simp only [add_sub_cancel_left] + apply enorm_setIntegral_le_lintegral_enorm.trans_eq + rw [lintegral_iUnion (fun i ↦ hm _)] + exact fun i j hij ↦ hd (by grind) - - simp only [IntegrableOn, Measure.restrict_iUnion_ae hd hm] at hfi ⊢ - exact hasSum_integral_measure hfi - -#exit - -theorem hasSum_integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} +theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) - (hfi : IntegrableOn f (⋃ i, s i) μ) : - HasSum (fun n => ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := - hasSum_integral_iUnion_ae (fun i => (hm i).nullMeasurableSet) (hd.mono fun _ _ h => h.aedisjoint) - hfi + (hfi : μ.IntegrableOn f B (⋃ i, s i)) : + HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by + classical + rcases finite_or_infinite ι with hι | hι + · letI : Fintype ι := Fintype.ofFinite ι + have : ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑ i, ∫ᵛ x in s i, f x ∂[B; μ] := by + rw [setIntegral_iUnion_fintype hm hd (fun i ↦ ?_)] + exact hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) + rw [this] + apply hasSum_fintype + obtain ⟨e⟩ : Nonempty (ι ≃ ℕ) := nonempty_equiv_of_countable + rw [← e.symm.surjective.iUnion_comp, ← e.symm.hasSum_iff] + apply hasSum_setIntegral_iUnion_nat (fun i ↦ hm _) (fun i j hij ↦ hd (by simp [hij])) + rwa [e.symm.surjective.iUnion_comp] theorem integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) - (hd : Pairwise (Disjoint on s)) (hfi : IntegrableOn f (⋃ i, s i) μ) : + (hd : Pairwise (Disjoint on s)) (hfi : μ.IntegrableOn f B (⋃ i, s i)) : ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑' n, ∫ᵛ x in s n, f x ∂[B; μ] := - (HasSum.tsum_eq (hasSum_integral_iUnion hm hd hfi)).symm - -theorem integral_iUnion_ae {ι : Type*} [Countable ι] {s : ι → Set X} - (hm : ∀ i, NullMeasurableSet (s i) μ) (hd : Pairwise (AEDisjoint μ on s)) - (hfi : IntegrableOn f (⋃ i, s i) μ) : ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑' n, ∫ᵛ x in s n, f x ∂[B; μ] := - (HasSum.tsum_eq (hasSum_integral_iUnion_ae hm hd hfi)).symm + (HasSum.tsum_eq (hasSum_setIntegral_iUnion hm hd hfi)).symm -theorem setIntegral_eq_zero_of_ae_eq_zero (ht_eq : ∀ᵐ x ∂[B; μ], x ∈ t → f x = 0) : +theorem setIntegral_eq_zero_of_ae_eq_zero + (ht_eq : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ t → f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = 0 := by - by_cases hf : AEStronglyMeasurable f (μ.restrict t); swap + by_cases ht : MeasurableSet t; swap + · simp [setIntegral_eq_zero_of_not_measurableSet ht] + by_cases hf : AEStronglyMeasurable f ((μ.restrict t).transpose B).variation; swap · rw [integral_undef] contrapose hf exact hf.1 have : ∫ᵛ x in t, hf.mk f x ∂[B; μ] = 0 := by refine integral_eq_zero_of_ae ?_ - rw [EventuallyEq, - ae_restrict_iff (hf.stronglyMeasurable_mk.measurableSet_eq_fun stronglyMeasurable_zero)] + simp only [transpose_restrict, variation_restrict ht] + sorry + sorry +-- ae_restrict_iff (hf.stronglyMeasurable_mk.measurableSet_eq_fun stronglyMeasurable_zero)] + + +#exit + filter_upwards [ae_imp_of_ae_restrict hf.ae_eq_mk, ht_eq] with x hx h'x h''x rw [← hx h''x] exact h'x h''x rw [← this] exact integral_congr_ae hf.ae_eq_mk +#exit + theorem setIntegral_eq_zero_of_forall_eq_zero (ht_eq : ∀ x ∈ t, f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = 0 := setIntegral_eq_zero_of_ae_eq_zero (Eventually.of_forall ht_eq) From 407077d530f8288f945294df2b6dfc79beb95ee0 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 22 May 2026 15:59:53 +0200 Subject: [PATCH 051/129] progress --- .../MeasureTheory/VectorMeasure/Basic.lean | 5 + .../VectorMeasure/SetIntegral.lean | 237 +++++------------- 2 files changed, 73 insertions(+), 169 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index b35e41ce32f568..bcd8c692b7e92c 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -728,6 +728,11 @@ theorem restrict_restrict {s t : Set α} (hs : MeasurableSet s) (ht : Measurable ext u hu simp [restrict_apply, hs, hu, ht, Set.inter_assoc] +theorem restrict_map {f : α → β} (hf : Measurable f) {s : Set β} (hs : MeasurableSet s) : + (v.map f).restrict s = (v.restrict (f ⁻¹' s)).map f := by + ext t ht + simp [map_apply, hs, hf hs, restrict_apply, ht, hf, hf ht] + section ContinuousAdd variable [ContinuousAdd M] diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index a8a8b70374827b..5ef2bbdca86f30 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -269,220 +269,119 @@ theorem setIntegral_eq_zero_of_ae_eq_zero · rw [integral_undef] contrapose hf exact hf.1 + simp only [transpose_restrict, variation_restrict ht] at hf have : ∫ᵛ x in t, hf.mk f x ∂[B; μ] = 0 := by refine integral_eq_zero_of_ae ?_ simp only [transpose_restrict, variation_restrict ht] - sorry - sorry --- ae_restrict_iff (hf.stronglyMeasurable_mk.measurableSet_eq_fun stronglyMeasurable_zero)] - - -#exit - + apply (ae_restrict_iff' ht).2 filter_upwards [ae_imp_of_ae_restrict hf.ae_eq_mk, ht_eq] with x hx h'x h''x rw [← hx h''x] exact h'x h''x rw [← this] - exact integral_congr_ae hf.ae_eq_mk - -#exit + apply integral_congr_ae + simp only [transpose_restrict, variation_restrict ht] + exact hf.ae_eq_mk theorem setIntegral_eq_zero_of_forall_eq_zero (ht_eq : ∀ x ∈ t, f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = 0 := setIntegral_eq_zero_of_ae_eq_zero (Eventually.of_forall ht_eq) theorem frequently_ae_ne_zero_of_setIntegral_ne_zero (hU : ∫ᵛ x in t, f x ∂[B; μ] ≠ 0) : - ∃ᶠ x in ae (μ.restrict t), f x ≠ 0 := - frequently_ae_ne_zero_of_integral_ne_zero hU + ∃ᶠ x in ae ((μ.transpose B).variation.restrict t), f x ≠ 0 := by + have ht : MeasurableSet t := by + contrapose! hU + simp [setIntegral_eq_zero_of_not_measurableSet hU] + rw [← variation_restrict ht, ← transpose_restrict] + exact frequently_ae_ne_zero_of_integral_ne_zero hU theorem exists_ne_zero_of_setIntegral_ne_zero (hU : ∫ᵛ x in t, f x ∂[B; μ] ≠ 0) : ∃ x, x ∈ t ∧ f x ≠ 0 := by contrapose! hU; exact setIntegral_eq_zero_of_forall_eq_zero hU -theorem integral_union_eq_left_of_ae_aux (ht_eq : ∀ᵐ x ∂[B; μ].restrict t, f x = 0) - (haux : StronglyMeasurable f) (H : IntegrableOn f (s ∪ t) μ) : +theorem integral_union_eq_left_of_ae (hs : MeasurableSet s) (ht : MeasurableSet t) + (ht_eq : ∀ᵐ x ∂(μ.transpose B).variation.restrict t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - let k := f ⁻¹' {0} - have hk : MeasurableSet k := by borelize E; exact haux.measurable (measurableSet_singleton _) - have h's : IntegrableOn f s μ := H.mono subset_union_left le_rfl - have A : ∀ u : Set X, ∫ᵛ x in u ∩ k, f x ∂[B; μ] = 0 := fun u => - setIntegral_eq_zero_of_forall_eq_zero fun x hx => hx.2 - rw [← integral_inter_add_diff hk h's, ← integral_inter_add_diff hk H, A, A, zero_add, zero_add, - union_diff_distrib, union_comm] - apply setIntegral_congr_set - rw [union_ae_eq_right] - apply measure_mono_null diff_subset - rw [measure_eq_zero_iff_ae_notMem] - filter_upwards [ae_imp_of_ae_restrict ht_eq] with x hx h'x using h'x.2 (hx h'x.1) - -theorem integral_union_eq_left_of_ae (ht_eq : ∀ᵐ x ∂[B; μ].restrict t, f x = 0) : - ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - have ht : IntegrableOn f t μ := by apply integrableOn_zero.congr_fun_ae; symm; exact ht_eq - by_cases H : IntegrableOn f (s ∪ t) μ; swap - · rw [integral_undef H, integral_undef]; simpa [integrableOn_union, ht] using H - let f' := H.1.mk f - calc - ∫ᵛ x : X in s ∪ t, f x ∂[B; μ] = ∫ᵛ x : X in s ∪ t, f' x ∂[B; μ] := integral_congr_ae H.1.ae_eq_mk - _ = ∫ᵛ x in s, f' x ∂[B; μ] := by - apply - integral_union_eq_left_of_ae_aux _ H.1.stronglyMeasurable_mk (H.congr_fun_ae H.1.ae_eq_mk) - filter_upwards [ht_eq, - ae_mono (Measure.restrict_mono subset_union_right le_rfl) H.1.ae_eq_mk] with x hx h'x - rw [← h'x, hx] - _ = ∫ᵛ x in s, f x ∂[B; μ] := - integral_congr_ae - (ae_mono (Measure.restrict_mono subset_union_left le_rfl) H.1.ae_eq_mk.symm) - -theorem integral_union_eq_left_of_forall₀ {f : X → E} (ht : NullMeasurableSet t μ) - (ht_eq : ∀ x ∈ t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := - integral_union_eq_left_of_ae ((ae_restrict_iff'₀ ht).2 (Eventually.of_forall ht_eq)) - -theorem integral_union_eq_left_of_forall {f : X → E} (ht : MeasurableSet t) - (ht_eq : ∀ x ∈ t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := - integral_union_eq_left_of_forall₀ ht.nullMeasurableSet ht_eq - -theorem setIntegral_eq_of_subset_of_ae_diff_eq_zero_aux (hts : s ⊆ t) - (h't : ∀ᵐ x ∂[B; μ], x ∈ t \ s → f x = 0) (haux : StronglyMeasurable f) - (h'aux : IntegrableOn f t μ) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - let k := f ⁻¹' {0} - have hk : MeasurableSet k := by borelize E; exact haux.measurable (measurableSet_singleton _) - calc - ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in t ∩ k, f x ∂[B; μ] + ∫ᵛ x in t \ k, f x ∂[B; μ] := by - rw [integral_inter_add_diff hk h'aux] - _ = ∫ᵛ x in t \ k, f x ∂[B; μ] := by - rw [setIntegral_eq_zero_of_forall_eq_zero fun x hx => ?_, zero_add]; exact hx.2 - _ = ∫ᵛ x in s \ k, f x ∂[B; μ] := by - apply setIntegral_congr_set - filter_upwards [h't] with x hx - change (x ∈ t \ k) = (x ∈ s \ k) - simp only [eq_iff_iff, and_congr_left_iff, mem_diff] - intro h'x - by_cases xs : x ∈ s - · simp only [xs, hts xs] - · simp only [xs, iff_false] - intro xt - exact h'x (hx ⟨xt, xs⟩) - _ = ∫ᵛ x in s ∩ k, f x ∂[B; μ] + ∫ᵛ x in s \ k, f x ∂[B; μ] := by - have : ∀ x ∈ s ∩ k, f x = 0 := fun x hx => hx.2 - rw [setIntegral_eq_zero_of_forall_eq_zero this, zero_add] - _ = ∫ᵛ x in s, f x ∂[B; μ] := by rw [integral_inter_add_diff hk (h'aux.mono hts le_rfl)] - -/-- If a function vanishes almost everywhere on `t \ s` with `s ⊆ t`, then its integrals on `s` -and `t` coincide if `t` is null-measurable. -/ -theorem setIntegral_eq_of_subset_of_ae_diff_eq_zero (ht : NullMeasurableSet t μ) (hts : s ⊆ t) - (h't : ∀ᵐ x ∂[B; μ], x ∈ t \ s → f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - by_cases h : IntegrableOn f t μ; swap - · have : ¬IntegrableOn f s μ := fun H => h (H.of_ae_diff_eq_zero ht h't) - rw [integral_undef h, integral_undef this] - let f' := h.1.mk f - calc - ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in t, f' x ∂[B; μ] := integral_congr_ae h.1.ae_eq_mk - _ = ∫ᵛ x in s, f' x ∂[B; μ] := by - apply - setIntegral_eq_of_subset_of_ae_diff_eq_zero_aux hts _ h.1.stronglyMeasurable_mk - (h.congr h.1.ae_eq_mk) - filter_upwards [h't, ae_imp_of_ae_restrict h.1.ae_eq_mk] with x hx h'x h''x - rw [← h'x h''x.1, hx h''x] - _ = ∫ᵛ x in s, f x ∂[B; μ] := by - apply integral_congr_ae - apply ae_restrict_of_ae_restrict_of_subset hts - exact h.1.ae_eq_mk.symm + classical + rw [← integral_indicator hs, ← integral_indicator (hs.union ht)] + apply integral_congr_ae + rw [ae_restrict_iff' ht] at ht_eq + filter_upwards [ht_eq] with x hx + classical + simp only [indicator_apply, mem_union] + grind + +theorem integral_union_eq_left_of_forall (hs : MeasurableSet s) (ht : MeasurableSet t) + (ht_eq : ∀ x ∈ t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + apply integral_union_eq_left_of_ae hs ht + rw [ae_restrict_iff' ht] + filter_upwards with x using ht_eq x + +theorem setIntegral_eq_of_subset_of_ae_diff_eq_zero (hs : MeasurableSet s) (ht : MeasurableSet t) + (hts : s ⊆ t) (h't : ∀ᵐ x ∂(μ.transpose B).variation.restrict (t \ s), f x = 0) : + ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + rwa [← union_diff_cancel hts, integral_union_eq_left_of_ae hs (ht.diff hs)] /-- If a function vanishes on `t \ s` with `s ⊆ t`, then its integrals on `s` -and `t` coincide if `t` is measurable. -/ -theorem setIntegral_eq_of_subset_of_forall_diff_eq_zero (ht : MeasurableSet t) (hts : s ⊆ t) - (h't : ∀ x ∈ t \ s, f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := - setIntegral_eq_of_subset_of_ae_diff_eq_zero ht.nullMeasurableSet hts - (Eventually.of_forall fun x hx => h't x hx) +and `t` coincide. -/ +theorem setIntegral_eq_of_subset_of_forall_diff_eq_zero + (hs : MeasurableSet s) (ht : MeasurableSet t) (hts : s ⊆ t) + (h't : ∀ x ∈ t \ s, f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by + apply setIntegral_eq_of_subset_of_ae_diff_eq_zero hs ht hts + apply (ae_restrict_iff' (ht.diff hs)).2 + filter_upwards with x using h't x /-- If a function vanishes almost everywhere on `sᶜ`, then its integral on `s` coincides with its integral on the whole space. -/ -theorem setIntegral_eq_integral_of_ae_compl_eq_zero (h : ∀ᵐ x ∂[B; μ], x ∉ s → f x = 0) : +theorem setIntegral_eq_integral_of_ae_compl_eq_zero (hs : MeasurableSet s) + (h : ∀ᵐ x ∂(μ.transpose B).variation, x ∉ s → f x = 0) : ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by symm nth_rw 1 [← setIntegral_univ] - apply setIntegral_eq_of_subset_of_ae_diff_eq_zero nullMeasurableSet_univ (subset_univ _) + apply setIntegral_eq_of_subset_of_ae_diff_eq_zero hs MeasurableSet.univ (subset_univ _) + apply (ae_restrict_iff' (MeasurableSet.univ.diff hs)).2 filter_upwards [h] with x hx h'x using hx h'x.2 /-- If a function vanishes on `sᶜ`, then its integral on `s` coincides with its integral on the whole space. -/ -theorem setIntegral_eq_integral_of_forall_compl_eq_zero (h : ∀ x, x ∉ s → f x = 0) : +theorem setIntegral_eq_integral_of_forall_compl_eq_zero (hs : MeasurableSet s) + (h : ∀ x, x ∉ s → f x = 0) : ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := - setIntegral_eq_integral_of_ae_compl_eq_zero (Eventually.of_forall h) - -theorem setIntegral_neg_eq_setIntegral_nonpos [PartialOrder E] {f : X → E} - (hf : AEStronglyMeasurable f μ) : - ∫ᵛ x in {x | f x < 0}, f x ∂[B; μ] = ∫ᵛ x in {x | f x ≤ 0}, f x ∂[B; μ] := by - have h_union : {x | f x ≤ 0} = {x | f x < 0} ∪ {x | f x = 0} := by - simp_rw [le_iff_lt_or_eq, setOf_or] - rw [h_union] - have B : NullMeasurableSet {x | f x = 0} μ := - hf.nullMeasurableSet_eq_fun aestronglyMeasurable_zero - symm - refine integral_union_eq_left_of_ae ?_ - filter_upwards [ae_restrict_mem₀ B] with x hx using hx + setIntegral_eq_integral_of_ae_compl_eq_zero hs (Eventually.of_forall h) -theorem integral_norm_eq_pos_sub_neg {f : X → ℝ} (hfi : Integrable f μ) : - ∫ᵛ x, ‖f x‖ ∂[B; μ] = ∫ᵛ x in {x | 0 ≤ f x}, f x ∂[B; μ] - ∫ᵛ x in {x | f x ≤ 0}, f x ∂[B; μ] := - have h_meas : NullMeasurableSet {x | 0 ≤ f x} μ := - aestronglyMeasurable_const.nullMeasurableSet_le hfi.1 - calc - ∫ᵛ x, ‖f x‖ ∂[B; μ] = ∫ᵛ x in {x | 0 ≤ f x}, ‖f x‖ ∂[B; μ] + ∫ᵛ x in {x | 0 ≤ f x}ᶜ, ‖f x‖ ∂[B; μ] := by - rw [← integral_add_compl₀ h_meas hfi.norm] - _ = ∫ᵛ x in {x | 0 ≤ f x}, f x ∂[B; μ] + ∫ᵛ x in {x | 0 ≤ f x}ᶜ, ‖f x‖ ∂[B; μ] := by - congr 1 - refine setIntegral_congr_fun₀ h_meas fun x hx => ?_ - dsimp only - rw [Real.norm_eq_abs, abs_eq_self.mpr _] - exact hx - _ = ∫ᵛ x in {x | 0 ≤ f x}, f x ∂[B; μ] - ∫ᵛ x in {x | 0 ≤ f x}ᶜ, f x ∂[B; μ] := by - congr 1 - rw [← integral_neg] - refine setIntegral_congr_fun₀ h_meas.compl fun x hx => ?_ - dsimp only - rw [Real.norm_eq_abs, abs_eq_neg_self.mpr _] - rw [Set.mem_compl_iff, Set.notMem_setOf_iff] at hx - linarith - _ = ∫ᵛ x in {x | 0 ≤ f x}, f x ∂[B; μ] - ∫ᵛ x in {x | f x ≤ 0}, f x ∂[B; μ] := by - rw [← setIntegral_neg_eq_setIntegral_nonpos hfi.1, compl_setOf]; simp only [not_le] - -theorem setIntegral_const [CompleteSpace E] (c : E) : ∫ᵛ _ in s, c ∂[B; μ] = μ.real s • c := by - rw [integral_const, measureReal_restrict_apply_univ] +theorem setIntegral_const [CompleteSpace G] [IsFiniteMeasure ((μ.restrict s).transpose B).variation] + (c : E) : ∫ᵛ _ in s, c ∂[B; μ] = B c (μ s) := by + by_cases hs : MeasurableSet s + · rw [integral_const, restrict_apply _ hs MeasurableSet.univ, univ_inter] + · simp [setIntegral_eq_zero_of_not_measurableSet hs, μ.not_measurable' hs] @[simp] -theorem integral_indicator_const [CompleteSpace E] (e : E) ⦃s : Set X⦄ (s_meas : MeasurableSet s) : - ∫ᵛ x : X, s.indicator (fun _ : X => e) x ∂[B; μ] = μ.real s • e := by +theorem integral_indicator_const [CompleteSpace G] + (e : E) ⦃s : Set X⦄ [IsFiniteMeasure ((μ.restrict s).transpose B).variation] + (s_meas : MeasurableSet s) : + ∫ᵛ x, s.indicator (fun _ : X ↦ e) x ∂[B; μ] = B e (μ s) := by rw [integral_indicator s_meas, ← setIntegral_const] -@[simp] -theorem integral_indicator_one ⦃s : Set X⦄ (hs : MeasurableSet s) : - ∫ᵛ x, s.indicator 1 x ∂[B; μ] = μ.real s := - (integral_indicator_const 1 hs).trans ((smul_eq_mul ..).trans (mul_one _)) +#check integral_map -theorem setIntegral_indicatorConstLp [CompleteSpace E] - {p : ℝ≥0∞} (hs : MeasurableSet s) (ht : MeasurableSet t) (hμt : μ t ≠ ∞) (e : E) : - ∫ᵛ x in s, indicatorConstLp p ht hμt e x ∂[B; μ] = μ.real (t ∩ s) • e := - calc - ∫ᵛ x in s, indicatorConstLp p ht hμt e x ∂[B; μ] = ∫ᵛ x in s, t.indicator (fun _ => e) x ∂[B; μ] := by - rw [setIntegral_congr_ae hs (indicatorConstLp_coeFn.mono fun x hx _ => hx)] - _ = (μ.real (t ∩ s)) • e := by rw [integral_indicator_const _ ht, measureReal_restrict_apply ht] +#check Measure.restrict_map -theorem integral_indicatorConstLp [CompleteSpace E] - {p : ℝ≥0∞} (ht : MeasurableSet t) (hμt : μ t ≠ ∞) (e : E) : - ∫ᵛ x, indicatorConstLp p ht hμt e x ∂[B; μ] = μ.real t • e := - calc - ∫ᵛ x, indicatorConstLp p ht hμt e x ∂[B; μ] = ∫ᵛ x in univ, indicatorConstLp p ht hμt e x ∂[B; μ] := by - rw [setIntegral_univ] - _ = μ.real (t ∩ univ) • e := setIntegral_indicatorConstLp MeasurableSet.univ ht hμt e - _ = μ.real t • e := by rw [inter_univ] +theorem setIntegral_map {β : Type*} [MeasurableSpace β] + {φ : X → β} (hφ : Measurable φ) {f : β → E} {s : Set β} (hs : MeasurableSet s) + (hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ)) + (hfi' : μ.Integrable (f ∘ φ) B) : + ∫ᵛ y in s, f y ∂[B; μ.map φ] = ∫ᵛ x in φ ⁻¹' s, f (φ x) ∂[B; μ] := by + rw [map_restrict] + + +#exit -theorem setIntegral_map {Y} [MeasurableSpace Y] {g : X → Y} {f : Y → E} {s : Set Y} - (hs : MeasurableSet s) (hf : AEStronglyMeasurable f (Measure.map g μ)) (hg : AEMeasurable g μ) : ∫ᵛ y in s, f y ∂Measure.map g μ = ∫ᵛ x in g ⁻¹' s, f (g x) ∂[B; μ] := by rw [Measure.restrict_map_of_aemeasurable hg hs, integral_map (hg.mono_measure Measure.restrict_le_self) (hf.mono_measure _)] exact Measure.map_mono_of_aemeasurable Measure.restrict_le_self hg +#exit + theorem _root_.MeasurableEmbedding.setIntegral_map {Y} {_ : MeasurableSpace Y} {f : X → Y} (hf : MeasurableEmbedding f) (g : Y → E) (s : Set Y) : ∫ᵛ y in s, g y ∂Measure.map f μ = ∫ᵛ x in f ⁻¹' s, g (f x) ∂[B; μ] := by From 14186dbbeaf917d42b30b3368e9c19f7a163a03f Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 22 May 2026 17:37:33 +0200 Subject: [PATCH 052/129] more --- .../MeasureTheory/VectorMeasure/Integral.lean | 15 +- .../VectorMeasure/SetIntegral.lean | 473 +----------------- 2 files changed, 26 insertions(+), 462 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index c0387d94eca0c9..a7a167c35c9548 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -304,11 +304,11 @@ theorem integral_congr_ae (h : f =ᵐ[(μ.transpose B).variation] g) : ∫ᵛ a, f a ∂[B; μ] = ∫ᵛ a, g a ∂[B; μ] := setToFun_congr_ae _ h -theorem norm_integral_le_lintegral_norm (f : X → E) : +theorem norm_integral_le_lintegral_norm : ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation) := (norm_setToFun_le_toReal _ (by simp)).trans (by simp) -theorem enorm_integral_le_lintegral_enorm (f : X → E) : +theorem enorm_integral_le_lintegral_enorm : ‖∫ᵛ a, f a ∂[B; μ]‖ₑ ≤ ∫⁻ a, ‖f a‖ₑ ∂(μ.transpose B).variation := (enorm_setToFun_le _ (by simp)).trans (by simp) @@ -348,7 +348,7 @@ theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds (tendsto_setLIntegral_zero (ne_of_lt hf.2) hs) (fun i => zero_le) intro i - apply (enorm_integral_le_lintegral_enorm _).trans + apply enorm_integral_le_lintegral_enorm.trans apply lintegral_mono' _ le_rfl rw [transpose_restrict] apply variation_restrict_le @@ -444,7 +444,7 @@ theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure (μ.transpose B).vari ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ C * (μ.transpose B).variation.real univ := calc ‖∫ᵛ x, f x ∂[B; μ]‖ _ ≤ (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation).toReal := - norm_integral_le_lintegral_norm _ + norm_integral_le_lintegral_norm _ ≤ (∫⁻ a, ENNReal.ofReal C ∂(μ.transpose B).variation).toReal := by apply ENNReal.toReal_mono · simp only [lintegral_const, ne_eq] @@ -460,6 +460,11 @@ theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure (μ.transpose B).vari exact (norm_nonneg _).trans hx simp [ENNReal.toReal_ofReal hC, Measure.real] +theorem enorm_integral_le_of_enorm_le_const + {C : ℝ≥0∞} (h : ∀ᵐ x ∂(μ.transpose B).variation, ‖f x‖ₑ ≤ C) : + ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ C * (μ.transpose B).variation univ := + enorm_integral_le_lintegral_enorm.trans ((lintegral_mono_ae h).trans (by simp)) + theorem integral_add_vectorMeasure {ν : VectorMeasure X F} (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : ∫ᵛ x, f x ∂[B; (μ + ν)] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := @@ -496,7 +501,7 @@ theorem nndist_integral_add_vectorMeasure_le_lintegral (nndist (∫ᵛ x, f x ∂[B; μ]) (∫ᵛ x, f x ∂[B; (μ + ν)]) : ℝ≥0∞) ≤ ∫⁻ x, ‖f x‖ₑ ∂(ν.transpose B).variation := by rw [integral_add_vectorMeasure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel_left] - exact enorm_integral_le_lintegral_enorm _ + exact enorm_integral_le_lintegral_enorm @[simp] theorem integral_smul_vectorMeasure (f : X → E) (c : ℝ) : diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 5ef2bbdca86f30..4be6a3f0064202 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -361,51 +361,32 @@ theorem integral_indicator_const [CompleteSpace G] ∫ᵛ x, s.indicator (fun _ : X ↦ e) x ∂[B; μ] = B e (μ s) := by rw [integral_indicator s_meas, ← setIntegral_const] -#check integral_map - -#check Measure.restrict_map - theorem setIntegral_map {β : Type*} [MeasurableSpace β] {φ : X → β} (hφ : Measurable φ) {f : β → E} {s : Set β} (hs : MeasurableSet s) - (hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ)) + (hfm : AEStronglyMeasurable f (((μ.restrict (φ ⁻¹' s)).transpose B).variation.map φ)) (hfi' : μ.Integrable (f ∘ φ) B) : ∫ᵛ y in s, f y ∂[B; μ.map φ] = ∫ᵛ x in φ ⁻¹' s, f (φ x) ∂[B; μ] := by - rw [map_restrict] + rw [restrict_map μ hφ hs, integral_map hφ hfm hfi'.integrableOn] +theorem _root_.MeasurableEmbedding.setIntegral_map_vectorMeasure {β : Type*} [MeasurableSpace β] + {φ : X → β} {f : β → E} (hφ : MeasurableEmbedding φ) {s : Set β} (hs : MeasurableSet s) : + ∫ᵛ y in s, f y ∂[B; μ.map φ] = ∫ᵛ x in φ ⁻¹' s, f (φ x) ∂[B; μ] := by + rw [restrict_map μ hφ.measurable hs, hφ.integral_map_vectorMeasure] -#exit +theorem _root_.Topology.IsClosedEmbedding.setIntegral_map + [TopologicalSpace X] [BorelSpace X] {β : Type*} + [MeasurableSpace β] [TopologicalSpace β] [BorelSpace β] {φ : X → β} {f : β → E} {s : Set β} + (hs : MeasurableSet s) (hφ : IsClosedEmbedding φ) : + ∫ᵛ y in s, f y ∂[B; μ.map φ] = ∫ᵛ x in φ ⁻¹' s, f (φ x) ∂[B; μ] := + hφ.measurableEmbedding.setIntegral_map_vectorMeasure hs - ∫ᵛ y in s, f y ∂Measure.map g μ = ∫ᵛ x in g ⁻¹' s, f (g x) ∂[B; μ] := by - rw [Measure.restrict_map_of_aemeasurable hg hs, - integral_map (hg.mono_measure Measure.restrict_le_self) (hf.mono_measure _)] - exact Measure.map_mono_of_aemeasurable Measure.restrict_le_self hg +theorem setIntegral_map_equiv {β : Type*} [MeasurableSpace β] {e : X ≃ᵐ β} {f : β → E} {s : Set β} + (hs : MeasurableSet s) : + ∫ᵛ y in s, f y ∂[B; μ.map e] = ∫ᵛ x in e ⁻¹' s, f (e x) ∂[B; μ] := + e.measurableEmbedding.setIntegral_map_vectorMeasure hs #exit -theorem _root_.MeasurableEmbedding.setIntegral_map {Y} {_ : MeasurableSpace Y} {f : X → Y} - (hf : MeasurableEmbedding f) (g : Y → E) (s : Set Y) : - ∫ᵛ y in s, g y ∂Measure.map f μ = ∫ᵛ x in f ⁻¹' s, g (f x) ∂[B; μ] := by - rw [hf.restrict_map, hf.integral_map] - -theorem _root_.Topology.IsClosedEmbedding.setIntegral_map [TopologicalSpace X] [BorelSpace X] {Y} - [MeasurableSpace Y] [TopologicalSpace Y] [BorelSpace Y] {g : X → Y} {f : Y → E} (s : Set Y) - (hg : IsClosedEmbedding g) : ∫ᵛ y in s, f y ∂Measure.map g μ = ∫ᵛ x in g ⁻¹' s, f (g x) ∂[B; μ] := - hg.measurableEmbedding.setIntegral_map _ _ - -theorem MeasurePreserving.setIntegral_preimage_emb {Y} {_ : MeasurableSpace Y} {f : X → Y} {ν} - (h₁ : MeasurePreserving f μ ν) (h₂ : MeasurableEmbedding f) (g : Y → E) (s : Set Y) : - ∫ᵛ x in f ⁻¹' s, g (f x) ∂[B; μ] = ∫ᵛ y in s, g y ∂ν := - (h₁.restrict_preimage_emb h₂ s).integral_comp h₂ _ - -theorem MeasurePreserving.setIntegral_image_emb {Y} {_ : MeasurableSpace Y} {f : X → Y} {ν} - (h₁ : MeasurePreserving f μ ν) (h₂ : MeasurableEmbedding f) (g : Y → E) (s : Set X) : - ∫ᵛ y in f '' s, g y ∂ν = ∫ᵛ x in s, g (f x) ∂[B; μ] := - Eq.symm <| (h₁.restrict_image_emb h₂ s).integral_comp h₂ _ - -theorem setIntegral_map_equiv {Y} [MeasurableSpace Y] (e : X ≃ᵐ Y) (f : Y → E) (s : Set Y) : - ∫ᵛ y in s, f y ∂Measure.map e μ = ∫ᵛ x in e ⁻¹' s, f (e x) ∂[B; μ] := - e.measurableEmbedding.setIntegral_map f s - theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} (hs : μ s < ∞) (hC : ∀ᵐ x ∂[B; μ].restrict s, ‖f x‖ ≤ C) : ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.real s := by rw [← Measure.restrict_apply_univ] at * @@ -450,40 +431,6 @@ theorem norm_integral_sub_setIntegral_le [IsFiniteMeasure μ] {C : ℝ} rw [h0, ← h2] exact le_trans (norm_integral_le_integral_norm f) h1 -theorem setIntegral_eq_zero_iff_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ.restrict s] f) - (hfi : IntegrableOn f s μ) : ∫ᵛ x in s, f x ∂[B; μ] = 0 ↔ f =ᵐ[μ.restrict s] 0 := - integral_eq_zero_iff_of_nonneg_ae hf hfi - -theorem setIntegral_pos_iff_support_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ.restrict s] f) - (hfi : IntegrableOn f s μ) : (0 < ∫ᵛ x in s, f x ∂[B; μ]) ↔ 0 < μ (support f ∩ s) := by - rw [integral_pos_iff_support_of_nonneg_ae hf hfi, Measure.restrict_apply₀] - rw [support_eq_preimage] - exact hfi.aestronglyMeasurable.aemeasurable.nullMeasurable (measurableSet_singleton 0).compl - -theorem setIntegral_gt_gt {R : ℝ} {f : X → ℝ} (hR : 0 ≤ R) - (hfint : IntegrableOn f {x | ↑R < f x} μ) (hμ : μ {x | ↑R < f x} ≠ 0) : - μ.real {x | ↑R < f x} * R < ∫ᵛ x in {x | ↑R < f x}, f x ∂[B; μ] := by - have : IntegrableOn (fun _ => R) {x | ↑R < f x} μ := by - refine ⟨aestronglyMeasurable_const, lt_of_le_of_lt ?_ hfint.2⟩ - refine setLIntegral_mono_ae hfint.1.enorm <| ae_of_all _ fun x hx => ?_ - simp only [ENNReal.coe_le_coe, Real.nnnorm_of_nonneg hR, enorm_eq_nnnorm, - Real.nnnorm_of_nonneg (hR.trans <| le_of_lt hx)] - exact le_of_lt hx - rw [← sub_pos, ← smul_eq_mul, ← setIntegral_const, ← integral_sub hfint this, - setIntegral_pos_iff_support_of_nonneg_ae] - · rw [← pos_iff_ne_zero] at hμ - rwa [Set.inter_eq_self_of_subset_right] - exact fun x hx => Ne.symm (ne_of_lt <| sub_pos.2 hx) - · rw [Pi.zero_def, EventuallyLE, ae_restrict_iff₀] - · exact Eventually.of_forall fun x hx => sub_nonneg.2 <| le_of_lt hx - · exact nullMeasurableSet_le aemeasurable_zero (hfint.1.aemeasurable.sub aemeasurable_const) - · exact Integrable.sub hfint this - -theorem setIntegral_trim {X} {m m0 : MeasurableSpace X} {μ : Measure X} (hm : m ≤ m0) {f : X → E} - (hf_meas : StronglyMeasurable[m] f) {s : Set X} (hs : MeasurableSet[m] s) : - ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ].trim hm := by - rwa [integral_trim hm hf_meas, restrict_trim hm μ] - /-! ### Lemmas about adding and removing interval boundaries The primed lemmas take explicit arguments about the endpoint having zero measure, while the @@ -552,162 +499,6 @@ end PartialOrder end NormedAddCommGroup -section Mono - -variable [NormedAddCommGroup E] [NormedSpace ℝ E] [PartialOrder E] - [IsOrderedAddMonoid E] [IsOrderedModule ℝ E] - {μ : Measure X} {f g : X → E} {s t : Set X} - -theorem setIntegral_mono_set [OrderClosedTopology E] (hfi : IntegrableOn f t μ) - (hf : 0 ≤ᵐ[μ.restrict t] f) (hst : s ≤ᵐ[μ] t) : - ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in t, f x ∂[B; μ] := - integral_mono_measure (Measure.restrict_mono_ae hst) hf hfi - -theorem setIntegral_le_integral [OrderClosedTopology E] (hfi : Integrable f μ) (hf : 0 ≤ᵐ[μ] f) : - ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x, f x ∂[B; μ] := - integral_mono_measure (Measure.restrict_le_self) hf hfi - -variable [ClosedIciTopology E] - -section -variable (hf : IntegrableOn f s μ) (hg : IntegrableOn g s μ) -include hf hg - -theorem setIntegral_mono_ae_restrict (h : f ≤ᵐ[μ.restrict s] g) : - ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := by - by_cases hE : CompleteSpace E - · exact integral_mono_ae hf hg h - · simp [integral, hE] - -theorem setIntegral_mono_ae (h : f ≤ᵐ[μ] g) : ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := - setIntegral_mono_ae_restrict hf hg (ae_restrict_of_ae h) - -theorem setIntegral_mono_on (hs : MeasurableSet s) (h : ∀ x ∈ s, f x ≤ g x) : - ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := - setIntegral_mono_ae_restrict hf hg - (by simp [hs, EventuallyLE, eventually_inf_principal, ae_of_all _ h]) - -theorem setIntegral_mono_on_ae (hs : MeasurableSet s) (h : ∀ᵐ x ∂[B; μ], x ∈ s → f x ≤ g x) : - ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := by - refine setIntegral_mono_ae_restrict hf hg ?_; rwa [EventuallyLE, ae_restrict_iff' hs] - -lemma setIntegral_mono_on_ae₀ (hs : NullMeasurableSet s μ) (h : ∀ᵐ x ∂[B; μ], x ∈ s → f x ≤ g x) : - ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := by - rw [setIntegral_congr_set hs.toMeasurable_ae_eq.symm, - setIntegral_congr_set hs.toMeasurable_ae_eq.symm] - refine setIntegral_mono_on_ae ?_ ?_ ?_ ?_ - · rwa [integrableOn_congr_set_ae hs.toMeasurable_ae_eq] - · rwa [integrableOn_congr_set_ae hs.toMeasurable_ae_eq] - · exact measurableSet_toMeasurable μ s - · filter_upwards [hs.toMeasurable_ae_eq.mem_iff, h] with x hx h - rwa [hx] - -@[gcongr high] -- higher priority than `integral_mono` --- this lemma is better because it also gives the `x ∈ s` hypothesis -lemma setIntegral_mono_on₀ (hs : NullMeasurableSet s μ) (h : ∀ x ∈ s, f x ≤ g x) : - ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := - setIntegral_mono_on_ae₀ hf hg hs (Eventually.of_forall h) - -theorem setIntegral_mono (h : f ≤ g) : ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in s, g x ∂[B; μ] := - integral_mono hf hg h - -end - -theorem setIntegral_ge_of_const_le [CompleteSpace E] {c : E} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) - (hf : ∀ x ∈ s, c ≤ f x) (hfint : IntegrableOn (fun x : X => f x) s μ) : - μ.real s • c ≤ ∫ᵛ x in s, f x ∂[B; μ] := by - rw [← setIntegral_const c] - exact setIntegral_mono_on (integrableOn_const hμs) hfint hs hf - -theorem setIntegral_ge_of_const_le_real {f : X → ℝ} {c : ℝ} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) - (hf : ∀ x ∈ s, c ≤ f x) (hfint : IntegrableOn (fun x : X => f x) s μ) : - c * μ.real s ≤ ∫ᵛ x in s, f x ∂[B; μ] := by - simpa [mul_comm] using setIntegral_ge_of_const_le hs hμs hf hfint - -end Mono - -section Nonneg - -variable {μ : Measure X} {f : X → ℝ} {s : Set X} - -theorem setIntegral_nonneg_of_ae_restrict (hf : 0 ≤ᵐ[μ.restrict s] f) : 0 ≤ ∫ᵛ x in s, f x ∂[B; μ] := - integral_nonneg_of_ae hf - -theorem setIntegral_nonneg_of_ae (hf : 0 ≤ᵐ[μ] f) : 0 ≤ ∫ᵛ x in s, f x ∂[B; μ] := - setIntegral_nonneg_of_ae_restrict (ae_restrict_of_ae hf) - -theorem setIntegral_nonneg (hs : MeasurableSet s) (hf : ∀ x, x ∈ s → 0 ≤ f x) : - 0 ≤ ∫ᵛ x in s, f x ∂[B; μ] := - setIntegral_nonneg_of_ae_restrict ((ae_restrict_iff' hs).mpr (ae_of_all μ hf)) - -theorem setIntegral_nonneg_ae (hs : MeasurableSet s) (hf : ∀ᵐ x ∂[B; μ], x ∈ s → 0 ≤ f x) : - 0 ≤ ∫ᵛ x in s, f x ∂[B; μ] := - setIntegral_nonneg_of_ae_restrict <| by rwa [EventuallyLE, ae_restrict_iff' hs] - -theorem setIntegral_le_nonneg {s : Set X} (hs : MeasurableSet s) (hf : StronglyMeasurable f) - (hfi : Integrable f μ) : ∫ᵛ x in s, f x ∂[B; μ] ≤ ∫ᵛ x in {y | 0 ≤ f y}, f x ∂[B; μ] := by - rw [← integral_indicator hs, ← - integral_indicator (stronglyMeasurable_const.measurableSet_le hf)] - exact - integral_mono (hfi.indicator hs) - (hfi.indicator (stronglyMeasurable_const.measurableSet_le hf)) - (indicator_le_indicator_nonneg s f) - -theorem setIntegral_nonpos_of_ae_restrict (hf : f ≤ᵐ[μ.restrict s] 0) : ∫ᵛ x in s, f x ∂[B; μ] ≤ 0 := - integral_nonpos_of_ae hf - -theorem setIntegral_nonpos_of_ae (hf : f ≤ᵐ[μ] 0) : ∫ᵛ x in s, f x ∂[B; μ] ≤ 0 := - setIntegral_nonpos_of_ae_restrict (ae_restrict_of_ae hf) - -theorem setIntegral_nonpos_ae (hs : MeasurableSet s) (hf : ∀ᵐ x ∂[B; μ], x ∈ s → f x ≤ 0) : - ∫ᵛ x in s, f x ∂[B; μ] ≤ 0 := - setIntegral_nonpos_of_ae_restrict <| by rwa [EventuallyLE, ae_restrict_iff' hs] - -theorem setIntegral_nonpos (hs : MeasurableSet s) (hf : ∀ x, x ∈ s → f x ≤ 0) : - ∫ᵛ x in s, f x ∂[B; μ] ≤ 0 := - setIntegral_nonpos_ae hs <| ae_of_all μ hf - -theorem setIntegral_nonpos_le {s : Set X} (hs : MeasurableSet s) (hf : StronglyMeasurable f) - (hfi : Integrable f μ) : ∫ᵛ x in {y | f y ≤ 0}, f x ∂[B; μ] ≤ ∫ᵛ x in s, f x ∂[B; μ] := by - rw [← integral_indicator hs, ← - integral_indicator (hf.measurableSet_le stronglyMeasurable_const)] - exact - integral_mono (hfi.indicator (hf.measurableSet_le stronglyMeasurable_const)) - (hfi.indicator hs) (indicator_nonpos_le_indicator s f) - -lemma Integrable.measure_le_integral {f : X → ℝ} (f_int : Integrable f μ) (f_nonneg : 0 ≤ᵐ[μ] f) - {s : Set X} (hs : ∀ x ∈ s, 1 ≤ f x) : - μ s ≤ ENNReal.ofReal (∫ᵛ x, f x ∂[B; μ]) := by - rw [ofReal_integral_eq_lintegral_ofReal f_int f_nonneg] - apply meas_le_lintegral₀ - · exact ENNReal.continuous_ofReal.measurable.comp_aemeasurable f_int.1.aemeasurable - · intro x hx - simpa using ENNReal.ofReal_le_ofReal (hs x hx) - -lemma integral_le_measure {f : X → ℝ} {s : Set X} - (hs : ∀ x ∈ s, f x ≤ 1) (h's : ∀ x ∈ sᶜ, f x ≤ 0) : - ENNReal.ofReal (∫ᵛ x, f x ∂[B; μ]) ≤ μ s := by - by_cases H : Integrable f μ; swap - · simp [integral_undef H] - let g x := max (f x) 0 - have g_int : Integrable g μ := H.pos_part - have : ENNReal.ofReal (∫ᵛ x, f x ∂[B; μ]) ≤ ENNReal.ofReal (∫ᵛ x, g x ∂[B; μ]) := by - apply ENNReal.ofReal_le_ofReal - exact integral_mono H g_int (fun x ↦ le_max_left _ _) - apply this.trans - rw [ofReal_integral_eq_lintegral_ofReal g_int (Eventually.of_forall (fun x ↦ le_max_right _ _))] - apply lintegral_le_meas - · intro x - apply ENNReal.ofReal_le_of_le_toReal - by_cases H : x ∈ s - · simpa [g] using hs x H - · apply le_trans _ zero_le_one - simpa [g] using h's x H - · intro x hx - simpa [g] using h's x hx - -end Nonneg - section IntegrableUnion variable {ι : Type*} [Countable ι] {μ : Measure X} [NormedAddCommGroup E] @@ -761,56 +552,6 @@ variable [NormedAddCommGroup E] {𝕜 : Type*} [NormedRing 𝕜] [NormedAddCommGroup F] [Module 𝕜 F] [IsBoundedSMul 𝕜 F] {p : ℝ≥0∞} {μ : Measure X} -/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by -`(Lp.memLp f).restrict s).toLp f`. This map is additive. -/ -theorem Lp_toLp_restrict_add (f g : Lp E p μ) (s : Set X) : - ((Lp.memLp (f + g)).restrict s).toLp (⇑(f + g)) = - ((Lp.memLp f).restrict s).toLp f + ((Lp.memLp g).restrict s).toLp g := by - ext1 - refine (ae_restrict_of_ae (Lp.coeFn_add f g)).mp ?_ - refine - (Lp.coeFn_add (MemLp.toLp f ((Lp.memLp f).restrict s)) - (MemLp.toLp g ((Lp.memLp g).restrict s))).mp ?_ - refine (MemLp.coeFn_toLp ((Lp.memLp f).restrict s)).mp ?_ - refine (MemLp.coeFn_toLp ((Lp.memLp g).restrict s)).mp ?_ - refine (MemLp.coeFn_toLp ((Lp.memLp (f + g)).restrict s)).mono fun x hx1 hx2 hx3 hx4 hx5 => ?_ - rw [hx4, hx1, Pi.add_apply, hx2, hx3, hx5, Pi.add_apply] - -/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by -`(Lp.memLp f).restrict s).toLp f`. This map commutes with scalar multiplication. -/ -theorem Lp_toLp_restrict_smul (c : 𝕜) (f : Lp F p μ) (s : Set X) : - ((Lp.memLp (c • f)).restrict s).toLp (⇑(c • f)) = c • ((Lp.memLp f).restrict s).toLp f := by - ext1 - refine (ae_restrict_of_ae (Lp.coeFn_smul c f)).mp ?_ - refine (MemLp.coeFn_toLp ((Lp.memLp f).restrict s)).mp ?_ - refine (MemLp.coeFn_toLp ((Lp.memLp (c • f)).restrict s)).mp ?_ - refine - (Lp.coeFn_smul c (MemLp.toLp f ((Lp.memLp f).restrict s))).mono fun x hx1 hx2 hx3 hx4 => ?_ - simp only [hx2, hx1, hx3, hx4, Pi.smul_apply] - -/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by -`(Lp.memLp f).restrict s).toLp f`. This map is non-expansive. -/ -theorem norm_Lp_toLp_restrict_le (s : Set X) (f : Lp E p μ) : - ‖((Lp.memLp f).restrict s).toLp f‖ ≤ ‖f‖ := by - rw [Lp.norm_def, Lp.norm_def, eLpNorm_congr_ae (MemLp.coeFn_toLp _)] - refine ENNReal.toReal_mono (Lp.eLpNorm_ne_top _) ?_ - exact eLpNorm_mono_measure _ Measure.restrict_le_self - -variable (X F 𝕜) in -/-- Continuous linear map sending a function of `Lp F p μ` to the same function in -`Lp F p (μ.restrict s)`. -/ -noncomputable def LpToLpRestrictCLM (μ : Measure X) (p : ℝ≥0∞) [hp : Fact (1 ≤ p)] (s : Set X) : - Lp F p μ →L[𝕜] Lp F p (μ.restrict s) := - @LinearMap.mkContinuous 𝕜 𝕜 (Lp F p μ) (Lp F p (μ.restrict s)) _ _ _ _ _ _ (RingHom.id 𝕜) - ⟨⟨fun f => MemLp.toLp f ((Lp.memLp f).restrict s), fun f g => Lp_toLp_restrict_add f g s⟩, - fun c f => Lp_toLp_restrict_smul c f s⟩ - 1 (by intro f; rw [one_mul]; exact norm_Lp_toLp_restrict_le s f) - -variable (𝕜) in -theorem LpToLpRestrictCLM_coeFn [Fact (1 ≤ p)] (s : Set X) (f : Lp F p μ) : - LpToLpRestrictCLM X F 𝕜 μ p s f =ᵐ[μ.restrict s] f := - MemLp.coeFn_toLp ((Lp.memLp f).restrict s) - @[continuity] theorem continuous_setIntegral [NormedSpace ℝ E] (s : Set X) : Continuous fun f : X →₁[μ] E => ∫ᵛ x in s, f x ∂[B; μ] := by @@ -827,21 +568,6 @@ end ContinuousSetIntegral end MeasureTheory -section OpenPos - -open Measure - -variable [MeasurableSpace X] [TopologicalSpace X] [OpensMeasurableSpace X] - {μ : Measure X} [IsOpenPosMeasure μ] - -theorem Continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero [IsFiniteMeasureOnCompacts μ] - {f : X → ℝ} {x : X} (f_cont : Continuous f) (f_comp : HasCompactSupport f) (f_nonneg : 0 ≤ f) - (f_x : f x ≠ 0) : 0 < ∫ᵛ x, f x ∂[B; μ] := - integral_pos_of_integrable_nonneg_nonzero f_cont (f_cont.integrable_of_hasCompactSupport f_comp) - f_nonneg f_x - -end OpenPos - section Support variable {M : Type*} [NormedAddCommGroup M] [NormedSpace ℝ M] {mX : MeasurableSpace X} @@ -859,170 +585,3 @@ theorem MeasureTheory.setIntegral_tsupport [TopologicalSpace X] : exact fun _ hx => image_eq_zero_of_notMem_tsupport <| notMem_of_mem_diff hx end Support - -section thickenedIndicator - -variable [MeasurableSpace X] [PseudoEMetricSpace X] - -theorem measure_le_lintegral_thickenedIndicatorAux (μ : Measure X) {E : Set X} - (E_mble : MeasurableSet E) (δ : ℝ) : μ E ≤ ∫⁻ x, (thickenedIndicatorAux δ E x : ℝ≥0∞) ∂[B; μ] := by - convert_to lintegral μ (E.indicator fun _ => (1 : ℝ≥0∞)) ≤ lintegral μ (thickenedIndicatorAux δ E) - · rw [lintegral_indicator E_mble] - simp only [lintegral_one, Measure.restrict_apply, MeasurableSet.univ, univ_inter] - · apply lintegral_mono - apply indicator_le_thickenedIndicatorAux - -theorem measure_le_lintegral_thickenedIndicator (μ : Measure X) {E : Set X} - (E_mble : MeasurableSet E) {δ : ℝ} (δ_pos : 0 < δ) : - μ E ≤ ∫⁻ x, (thickenedIndicator δ_pos E x : ℝ≥0∞) ∂[B; μ] := by - convert measure_le_lintegral_thickenedIndicatorAux μ E_mble δ - dsimp - simp only [thickenedIndicatorAux_lt_top.ne, ENNReal.coe_toNNReal, Ne, not_false_iff] - -end thickenedIndicator - --- We declare a new `{X : Type*}` to discard the instance `[MeasurableSpace X]` --- which has been in scope for the entire file up to this point. -variable {X : Type*} - -section BilinearMap - -namespace MeasureTheory - -variable {X : Type*} {f : X → ℝ} {m m0 : MeasurableSpace X} {μ : Measure X} - -theorem Integrable.simpleFunc_mul (g : SimpleFunc X ℝ) (hf : Integrable f μ) : - Integrable (⇑g * f) μ := by - refine - SimpleFunc.induction (fun c s hs => ?_) - (fun g₁ g₂ _ h_int₁ h_int₂ => - (h_int₁.add h_int₂).congr (by rw [SimpleFunc.coe_add, add_mul])) - g - simp only [SimpleFunc.const_zero, SimpleFunc.coe_piecewise, SimpleFunc.coe_const, - SimpleFunc.coe_zero, Set.piecewise_eq_indicator] - have : Set.indicator s (Function.const X c) * f = s.indicator (c • f) := by - ext1 x - by_cases hx : x ∈ s - · simp only [hx, Pi.mul_apply, Set.indicator_of_mem, Pi.smul_apply, smul_eq_mul, - ← Function.const_def] - · simp only [hx, Pi.mul_apply, Set.indicator_of_notMem, not_false_iff, zero_mul] - rw [this, integrable_indicator_iff hs] - exact (hf.smul c).integrableOn - -theorem Integrable.simpleFunc_mul' (hm : m ≤ m0) (g : @SimpleFunc X m ℝ) (hf : Integrable f μ) : - Integrable (⇑g * f) μ := by - rw [← SimpleFunc.coe_toLargerSpace_eq hm g]; exact hf.simpleFunc_mul (g.toLargerSpace hm) - -end MeasureTheory - -end BilinearMap - -section ParametricIntegral - -variable {G 𝕜 : Type*} [TopologicalSpace X] - [TopologicalSpace Y] [MeasurableSpace Y] [OpensMeasurableSpace Y] {μ : Measure Y} - [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace ℝ E] - [NormedAddCommGroup F] [NormedSpace 𝕜 F] [NormedAddCommGroup G] [NormedSpace 𝕜 G] - -open Metric ContinuousLinearMap - -/-- The parametric integral over a continuous function on a compact set is continuous, - under mild assumptions on the topologies involved. -/ -theorem continuous_parametric_integral_of_continuous - [FirstCountableTopology X] [LocallyCompactSpace X] - [SecondCountableTopologyEither Y E] [IsLocallyFiniteMeasure μ] - {f : X → Y → E} (hf : Continuous f.uncurry) {s : Set Y} (hs : IsCompact s) : - Continuous (∫ᵛ y in s, f · y ∂[B; μ]) := by - rw [continuous_iff_continuousAt] - intro x₀ - rcases exists_compact_mem_nhds x₀ with ⟨U, U_cpct, U_nhds⟩ - rcases (U_cpct.prod hs).bddAbove_image hf.norm.continuousOn with ⟨M, hM⟩ - apply continuousAt_of_dominated - · filter_upwards with x using Continuous.aestronglyMeasurable (by fun_prop) - · filter_upwards [U_nhds] with x x_in - rw [ae_restrict_iff] - · filter_upwards with t t_in using hM (mem_image_of_mem _ <| mk_mem_prod x_in t_in) - · exact (isClosed_le (by fun_prop) (by fun_prop)).measurableSet - · exact integrableOn_const hs.measure_ne_top - · filter_upwards using (by fun_prop) - -/-- Consider a parameterized integral `x ↦ ∫ᵛ y, L (g y) (f x y)` where `L` is bilinear, -`g` is locally integrable and `f` is continuous and uniformly compactly supported. Then the -integral depends continuously on `x`. -/ -lemma continuousOn_integral_bilinear_of_locally_integrable_of_compact_support - [NormedSpace 𝕜 E] (L : F →L[𝕜] G →L[𝕜] E) - {f : X → Y → G} {s : Set X} {k : Set Y} {g : Y → F} - (hk : IsCompact k) (hf : ContinuousOn f.uncurry (s ×ˢ univ)) - (hfs : ∀ p, ∀ x, p ∈ s → x ∉ k → f p x = 0) (hg : IntegrableOn g k μ) : - ContinuousOn (fun x ↦ ∫ᵛ y, L (g y) (f x y) ∂[B; μ]) s := by - have A : ∀ p ∈ s, Continuous (f p) := fun p hp ↦ by - refine hf.comp_continuous (.prodMk_right _) fun y => ?_ - simpa only [prodMk_mem_set_prod_eq, mem_univ, and_true] using hp - intro q hq - apply Metric.continuousWithinAt_iff'.2 (fun ε εpos ↦ ?_) - obtain ⟨δ, δpos, hδ⟩ : ∃ (δ : ℝ), 0 < δ ∧ ∫ᵛ x in k, ‖L‖ * ‖g x‖ * δ ∂[B; μ] < ε := by - simpa [integral_mul_const] using exists_pos_mul_lt εpos _ - obtain ⟨v, v_mem, hv⟩ : ∃ v ∈ 𝓝[s] q, ∀ p ∈ v, ∀ x ∈ k, dist (f p x) (f q x) < δ := - hk.mem_uniformity_of_prod - (hf.mono (Set.prod_mono_right (subset_univ k))) hq (dist_mem_uniformity δpos) - simp_rw [dist_eq_norm] at hv ⊢ - have I : ∀ p ∈ s, IntegrableOn (fun y ↦ L (g y) (f p y)) k μ := by - intro p hp - obtain ⟨C, hC⟩ : ∃ C, ∀ y, ‖f p y‖ ≤ C := by - have : ContinuousOn (f p) k := by - have : ContinuousOn (fun y ↦ (p, y)) k := by fun_prop - exact hf.comp this (by simp [MapsTo, hp]) - rcases IsCompact.exists_bound_of_continuousOn hk this with ⟨C, hC⟩ - refine ⟨max C 0, fun y ↦ ?_⟩ - by_cases hx : y ∈ k - · exact (hC y hx).trans (le_max_left _ _) - · simp [hfs p y hp hx] - have : IntegrableOn (fun y ↦ ‖L‖ * ‖g y‖ * C) k μ := - (hg.norm.const_mul _).mul_const _ - apply Integrable.mono' this ?_ ?_ - · borelize G - apply L.aestronglyMeasurable_comp₂ hg.aestronglyMeasurable - apply StronglyMeasurable.aestronglyMeasurable - apply Continuous.stronglyMeasurable_of_support_subset_isCompact (A p hp) hk - apply support_subset_iff'.2 (fun y hy ↦ hfs p y hp hy) - · apply Eventually.of_forall (fun y ↦ (le_opNorm₂ L (g y) (f p y)).trans ?_) - gcongr - apply hC - filter_upwards [v_mem, self_mem_nhdsWithin] with p hp h'p - calc - ‖∫ᵛ x, L (g x) (f p x) ∂[B; μ] - ∫ᵛ x, L (g x) (f q x) ∂[B; μ]‖ - = ‖∫ᵛ x in k, L (g x) (f p x) ∂[B; μ] - ∫ᵛ x in k, L (g x) (f q x) ∂[B; μ]‖ := by - congr 2 - · refine (setIntegral_eq_integral_of_forall_compl_eq_zero (fun y hy ↦ ?_)).symm - simp [hfs p y h'p hy] - · refine (setIntegral_eq_integral_of_forall_compl_eq_zero (fun y hy ↦ ?_)).symm - simp [hfs q y hq hy] - _ = ‖∫ᵛ x in k, L (g x) (f p x) - L (g x) (f q x) ∂[B; μ]‖ := by rw [integral_sub (I p h'p) (I q hq)] - _ ≤ ∫ᵛ x in k, ‖L (g x) (f p x) - L (g x) (f q x)‖ ∂[B; μ] := norm_integral_le_integral_norm _ - _ ≤ ∫ᵛ x in k, ‖L‖ * ‖g x‖ * δ ∂[B; μ] := by - apply integral_mono_of_nonneg (Eventually.of_forall (fun y ↦ by positivity)) - · exact (hg.norm.const_mul _).mul_const _ - · filter_upwards with y - by_cases hy : y ∈ k - · dsimp only - specialize hv p hp y hy - calc - ‖L (g y) (f p y) - L (g y) (f q y)‖ - = ‖L (g y) (f p y - f q y)‖ := by simp only [map_sub] - _ ≤ ‖L‖ * ‖g y‖ * ‖f p y - f q y‖ := le_opNorm₂ _ _ _ - _ ≤ ‖L‖ * ‖g y‖ * δ := by gcongr - · simp only [hfs p y h'p hy, hfs q y hq hy, sub_self, norm_zero] - positivity - _ < ε := hδ - -/-- Consider a parameterized integral `x ↦ ∫ᵛ y, f x y` where `f` is continuous and uniformly -compactly supported. Then the integral depends continuously on `x`. -/ -lemma continuousOn_integral_of_compact_support - {f : X → Y → E} {s : Set X} {k : Set Y} [IsFiniteMeasureOnCompacts μ] - (hk : IsCompact k) (hf : ContinuousOn f.uncurry (s ×ˢ univ)) - (hfs : ∀ p, ∀ x, p ∈ s → x ∉ k → f p x = 0) : - ContinuousOn (fun x ↦ ∫ᵛ y, f x y ∂[B; μ]) s := by - simpa using continuousOn_integral_bilinear_of_locally_integrable_of_compact_support (lsmul ℝ ℝ) - hk hf hfs (integrableOn_const hk.measure_ne_top) (g := fun _ ↦ 1) - -end ParametricIntegral From 7eb87c9e74c26d1a6d4185f8fb10113bed8ae09e Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 22 May 2026 22:11:48 +0200 Subject: [PATCH 053/129] fix --- .../VectorMeasure/SetIntegral.lean | 92 ++++++++++--------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 4be6a3f0064202..6c8545df9c72da 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -385,51 +385,53 @@ theorem setIntegral_map_equiv {β : Type*} [MeasurableSpace β] {e : X ≃ᵐ β ∫ᵛ y in s, f y ∂[B; μ.map e] = ∫ᵛ x in e ⁻¹' s, f (e x) ∂[B; μ] := e.measurableEmbedding.setIntegral_map_vectorMeasure hs -#exit - -theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} (hs : μ s < ∞) - (hC : ∀ᵐ x ∂[B; μ].restrict s, ‖f x‖ ≤ C) : ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.real s := by - rw [← Measure.restrict_apply_univ] at * - haveI : IsFiniteMeasure (μ.restrict s) := ⟨hs⟩ - simpa using norm_integral_le_of_norm_le_const hC - -theorem norm_setIntegral_le_of_norm_le_const_ae' {C : ℝ} (hs : μ s < ∞) - (hC : ∀ᵐ x ∂[B; μ], x ∈ s → ‖f x‖ ≤ C) : ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.real s := by - by_cases hfm : AEStronglyMeasurable f (μ.restrict s) - · apply norm_setIntegral_le_of_norm_le_const_ae hs - have A : ∀ᵐ x : X ∂[B; μ], x ∈ s → ‖AEStronglyMeasurable.mk f hfm x‖ ≤ C := by - filter_upwards [hC, hfm.ae_mem_imp_eq_mk] with _ h1 h2 h3 - rw [← h2 h3] - exact h1 h3 - have B : MeasurableSet {x | ‖hfm.mk f x‖ ≤ C} := - hfm.stronglyMeasurable_mk.norm.measurable measurableSet_Iic - filter_upwards [hfm.ae_eq_mk, (ae_restrict_iff B).2 A] with _ h1 _ - rwa [h1] - · rw [integral_non_aestronglyMeasurable hfm] - have : ∃ᵐ (x : X) ∂[B; μ], x ∈ s := by - apply frequently_ae_mem_iff.mpr - contrapose hfm - simp [Measure.restrict_eq_zero.mpr hfm] - rcases (this.and_eventually hC).exists with ⟨x, hx, h'x⟩ - have : 0 ≤ C := (norm_nonneg _).trans (h'x hx) - simp only [norm_zero, ge_iff_le] +theorem enorm_setIntegral_le_of_enorm_le_const_ae {C : ℝ≥0∞} + (hC : ∀ᵐ x ∂(μ.transpose B).variation.restrict s, ‖f x‖ₑ ≤ C) : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * (μ.transpose B).variation s := by + by_cases hs : MeasurableSet s; swap + · simp [setIntegral_eq_zero_of_not_measurableSet hs] + rw [← variation_restrict hs, ← transpose_restrict] at hC + apply (enorm_integral_le_of_enorm_le_const hC).trans + rw [transpose_restrict, variation_restrict hs, Measure.restrict_apply MeasurableSet.univ] + simp + +theorem enorm_setIntegral_le_of_enorm_le_const {C : ℝ≥0∞} + (hC : ∀ x ∈ s, ‖f x‖ₑ ≤ C) : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * (μ.transpose B).variation s := by + by_cases hs : MeasurableSet s; swap + · simp [setIntegral_eq_zero_of_not_measurableSet hs] + apply enorm_setIntegral_le_of_enorm_le_const_ae + apply (ae_restrict_iff' hs).2 + filter_upwards with x using hC x + +theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} + [h : IsFiniteMeasure ((μ.transpose B).variation.restrict s)] + (hC : ∀ᵐ x ∂(μ.transpose B).variation.restrict s, ‖f x‖ ≤ C) : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * (μ.transpose B).variation.real s := by + by_cases hs : MeasurableSet s; swap + · simp only [setIntegral_eq_zero_of_not_measurableSet hs, norm_zero] + by_cases h's : (μ.transpose B).variation s = 0 + · simp [Measure.real, h's] + · have : NeBot (ae ((μ.transpose B).variation.restrict s)) := by simpa using h's + obtain ⟨x, hx⟩ : ∃ x, ‖f x‖ ≤ C := hC.exists + have : 0 ≤ C := le_trans (norm_nonneg _) hx + positivity + rw [← variation_restrict hs, ← transpose_restrict] at hC h + apply (norm_integral_le_of_norm_le_const hC).trans_eq + simp [transpose_restrict, variation_restrict hs] + +theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} + [h : IsFiniteMeasure ((μ.transpose B).variation.restrict s)] + (hC : ∀ x ∈ s, ‖f x‖ ≤ C) : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * (μ.transpose B).variation.real s := by + rcases eq_empty_or_nonempty s with rfl | ⟨x, hx⟩ + · simp + by_cases hs : MeasurableSet s; swap + · simp only [setIntegral_eq_zero_of_not_measurableSet hs, norm_zero] + have : 0 ≤ C := le_trans (norm_nonneg _) (hC x hx) positivity - -theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} (hs : μ s < ∞) (hC : ∀ x ∈ s, ‖f x‖ ≤ C) : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.real s := - norm_setIntegral_le_of_norm_le_const_ae' hs (Eventually.of_forall hC) - -theorem norm_integral_sub_setIntegral_le [IsFiniteMeasure μ] {C : ℝ} - (hf : ∀ᵐ (x : X) ∂[B; μ], ‖f x‖ ≤ C) {s : Set X} (hs : MeasurableSet s) (hf1 : Integrable f μ) : - ‖∫ᵛ (x : X), f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ]‖ ≤ μ.real sᶜ * C := by - have h0 : ∫ᵛ (x : X), f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in sᶜ, f x ∂[B; μ] := by - rw [sub_eq_iff_eq_add, add_comm, integral_add_compl hs hf1] - have h1 : ∫ᵛ x in sᶜ, ‖f x‖ ∂[B; μ] ≤ ∫ᵛ _ in sᶜ, C ∂[B; μ] := - integral_mono_ae hf1.norm.restrict (integrable_const C) (ae_restrict_of_ae hf) - have h2 : ∫ᵛ _ in sᶜ, C ∂[B; μ] = μ.real sᶜ * C := by - rw [setIntegral_const C, smul_eq_mul] - rw [h0, ← h2] - exact le_trans (norm_integral_le_integral_norm f) h1 + apply norm_setIntegral_le_of_norm_le_const_ae + filter_upwards [ae_restrict_mem hs] with x hx using hC x hx /-! ### Lemmas about adding and removing interval boundaries @@ -437,6 +439,8 @@ The primed lemmas take explicit arguments about the endpoint having zero measure unprimed ones use `[NoAtoms μ]`. -/ +#exit + section PartialOrder variable [PartialOrder X] {x y : X} From 554b8bc236a21fa04a99307c80eb026344989185 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 23 May 2026 16:05:51 +0200 Subject: [PATCH 054/129] more --- .../Function/L1Space/HasFiniteIntegral.lean | 4 +- .../Function/L1Space/Integrable.lean | 6 +- .../VectorMeasure/SetIntegral.lean | 167 ++---------------- .../VectorMeasure/WithDensityVec.lean | 43 ++++- 4 files changed, 54 insertions(+), 166 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/L1Space/HasFiniteIntegral.lean b/Mathlib/MeasureTheory/Function/L1Space/HasFiniteIntegral.lean index ec8059a833779b..28fec0c93eac82 100644 --- a/Mathlib/MeasureTheory/Function/L1Space/HasFiniteIntegral.lean +++ b/Mathlib/MeasureTheory/Function/L1Space/HasFiniteIntegral.lean @@ -245,9 +245,9 @@ theorem hasFiniteIntegral_zero_measure {m : MeasurableSpace α} (f : α → ε) simp only [HasFiniteIntegral, lintegral_zero_measure, zero_lt_top] variable (α μ) in -@[fun_prop, simp] +@[to_fun (attr := fun_prop, simp) hasFiniteIntegral_fun_zero] theorem hasFiniteIntegral_zero {ε : Type*} [TopologicalSpace ε] [ESeminormedAddMonoid ε] : - HasFiniteIntegral (fun _ : α => (0 : ε)) μ := by + HasFiniteIntegral (0 : α → ε) μ := by simp [hasFiniteIntegral_iff_enorm] @[fun_prop] diff --git a/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean b/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean index 3dc82d61b0eb64..340275dc502e65 100644 --- a/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean +++ b/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean @@ -405,9 +405,9 @@ section ESeminormedAddMonoid variable {ε' : Type*} [TopologicalSpace ε'] [ESeminormedAddMonoid ε'] variable (α ε') in -@[simp] -theorem integrable_zero (μ : Measure α) : Integrable (fun _ => (0 : ε')) μ := by - simp [Integrable, aestronglyMeasurable_const] +@[to_fun (attr := fun_prop, simp) integrable_fun_zero] +theorem integrable_zero (μ : Measure α) : Integrable (0 : α → ε') μ := by + simp [Integrable, aestronglyMeasurable_zero] theorem Integrable.add' {f g : α → ε'} (hf : Integrable f μ) (hg : Integrable g μ) : HasFiniteIntegral (f + g) μ := diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 6c8545df9c72da..3832f385ae1ba3 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -183,6 +183,16 @@ theorem setIntegral_indicator (hs : MeasurableSet s) (ht : MeasurableSet t) : ∫ᵛ x in s, t.indicator f x ∂[B; μ] = ∫ᵛ x in s ∩ t, f x ∂[B; μ] := by rw [integral_indicator ht, μ.restrict_restrict ht hs, Set.inter_comm] +theorem setIntegral_congr_set + (hs : MeasurableSet s) (ht : MeasurableSet t) (hst : s =ᵐ[(μ.transpose B).variation] t) : + ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in t, f x ∂[B; μ] := by + rw [← integral_indicator hs, ← integral_indicator ht] + apply integral_congr_ae + filter_upwards [hst] with x hx + replace hx : x ∈ s ↔ x ∈ t := by simpa using hx + simp [indicator] + grind + theorem integral_piecewise [DecidablePred (· ∈ s)] (hs : MeasurableSet s) (hf : μ.IntegrableOn f B s) (hg : μ.IntegrableOn g B sᶜ) : ∫ᵛ x, s.piecewise f g x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, g x ∂[B; μ] := by @@ -433,159 +443,4 @@ theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} apply norm_setIntegral_le_of_norm_le_const_ae filter_upwards [ae_restrict_mem hs] with x hx using hC x hx -/-! ### Lemmas about adding and removing interval boundaries - -The primed lemmas take explicit arguments about the endpoint having zero measure, while the -unprimed ones use `[NoAtoms μ]`. --/ - -#exit - -section PartialOrder - -variable [PartialOrder X] {x y : X} - -theorem integral_Icc_eq_integral_Ioc' (hx : μ {x} = 0) : - ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ioc x y, f t ∂[B; μ] := - setIntegral_congr_set (Ioc_ae_eq_Icc' hx).symm - -theorem integral_Icc_eq_integral_Ico' (hy : μ {y} = 0) : - ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ico x y, f t ∂[B; μ] := - setIntegral_congr_set (Ico_ae_eq_Icc' hy).symm - -theorem integral_Ioc_eq_integral_Ioo' (hy : μ {y} = 0) : - ∫ᵛ t in Ioc x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := - setIntegral_congr_set (Ioo_ae_eq_Ioc' hy).symm - -theorem integral_Ico_eq_integral_Ioo' (hx : μ {x} = 0) : - ∫ᵛ t in Ico x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := - setIntegral_congr_set (Ioo_ae_eq_Ico' hx).symm - -theorem integral_Icc_eq_integral_Ioo' (hx : μ {x} = 0) (hy : μ {y} = 0) : - ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := - setIntegral_congr_set (Ioo_ae_eq_Icc' hx hy).symm - -theorem integral_Iic_eq_integral_Iio' (hx : μ {x} = 0) : - ∫ᵛ t in Iic x, f t ∂[B; μ] = ∫ᵛ t in Iio x, f t ∂[B; μ] := - setIntegral_congr_set (Iio_ae_eq_Iic' hx).symm - -theorem integral_Ici_eq_integral_Ioi' (hx : μ {x} = 0) : - ∫ᵛ t in Ici x, f t ∂[B; μ] = ∫ᵛ t in Ioi x, f t ∂[B; μ] := - setIntegral_congr_set (Ioi_ae_eq_Ici' hx).symm - -variable [NoAtoms μ] - -theorem integral_Icc_eq_integral_Ioc : ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ioc x y, f t ∂[B; μ] := - integral_Icc_eq_integral_Ioc' <| measure_singleton x - -theorem integral_Icc_eq_integral_Ico : ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ico x y, f t ∂[B; μ] := - integral_Icc_eq_integral_Ico' <| measure_singleton y - -theorem integral_Ioc_eq_integral_Ioo : ∫ᵛ t in Ioc x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := - integral_Ioc_eq_integral_Ioo' <| measure_singleton y - -theorem integral_Ico_eq_integral_Ioo : ∫ᵛ t in Ico x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := - integral_Ico_eq_integral_Ioo' <| measure_singleton x - -theorem integral_Ico_eq_integral_Ioc : ∫ᵛ t in Ico x y, f t ∂[B; μ] = ∫ᵛ t in Ioc x y, f t ∂[B; μ] := by - rw [integral_Ico_eq_integral_Ioo, integral_Ioc_eq_integral_Ioo] - -theorem integral_Icc_eq_integral_Ioo : ∫ᵛ t in Icc x y, f t ∂[B; μ] = ∫ᵛ t in Ioo x y, f t ∂[B; μ] := by - rw [integral_Icc_eq_integral_Ico, integral_Ico_eq_integral_Ioo] - -theorem integral_Iic_eq_integral_Iio : ∫ᵛ t in Iic x, f t ∂[B; μ] = ∫ᵛ t in Iio x, f t ∂[B; μ] := - integral_Iic_eq_integral_Iio' <| measure_singleton x - -theorem integral_Ici_eq_integral_Ioi : ∫ᵛ t in Ici x, f t ∂[B; μ] = ∫ᵛ t in Ioi x, f t ∂[B; μ] := - integral_Ici_eq_integral_Ioi' <| measure_singleton x - -end PartialOrder - -end NormedAddCommGroup - -section IntegrableUnion - -variable {ι : Type*} [Countable ι] {μ : Measure X} [NormedAddCommGroup E] - -theorem integrableOn_iUnion_of_summable_integral_norm {f : X → E} {s : ι → Set X} - (hi : ∀ i : ι, IntegrableOn f (s i) μ) - (h : Summable fun i : ι => ∫ᵛ x : X in s i, ‖f x‖ ∂[B; μ]) : IntegrableOn f (iUnion s) μ := by - refine ⟨AEStronglyMeasurable.iUnion fun i => (hi i).1, (lintegral_iUnion_le _ _).trans_lt ?_⟩ - have B := fun i => lintegral_coe_eq_integral (fun x : X => ‖f x‖₊) (hi i).norm - simp_rw [enorm_eq_nnnorm, tsum_congr B] - have S' : Summable fun i : ι => - (NNReal.mk (∫ᵛ x : X in s i, ‖f x‖₊ ∂[B; μ]) (integral_nonneg fun x => NNReal.coe_nonneg _)) := by - rw [← NNReal.summable_coe]; exact h - have S'' := ENNReal.tsum_coe_eq S'.hasSum - simp_rw [ENNReal.coe_nnreal_eq, NNReal.coe_mk, coe_nnnorm] at S'' - convert ENNReal.ofReal_lt_top - -variable [TopologicalSpace X] [BorelSpace X] [T2Space X] [IsLocallyFiniteMeasure μ] - -/-- If `s` is a countable family of compact sets, `f` is a continuous function, and the sequence -`‖f.restrict (s i)‖ * μ (s i)` is summable, then `f` is integrable on the union of the `s i`. -/ -theorem integrableOn_iUnion_of_summable_norm_restrict {f : C(X, E)} {s : ι → Compacts X} - (hf : Summable fun i : ι => ‖f.restrict (s i)‖ * μ.real (s i)) : - IntegrableOn f (⋃ i : ι, s i) μ := by - refine - integrableOn_iUnion_of_summable_integral_norm - (fun i => (map_continuous f).continuousOn.integrableOn_compact (s i).isCompact) - (.of_nonneg_of_le (fun ι => integral_nonneg fun x => norm_nonneg _) (fun i => ?_) hf) - rw [← (Real.norm_of_nonneg (integral_nonneg fun x => norm_nonneg _) : ‖_‖ = ∫ᵛ x in s i, ‖f x‖ ∂[B; μ])] - exact - norm_setIntegral_le_of_norm_le_const (s i).isCompact.measure_lt_top - fun x hx => (norm_norm (f x)).symm ▸ (f.restrict (s i : Set X)).norm_coe_le_norm ⟨x, hx⟩ - -/-- If `s` is a countable family of compact sets covering `X`, `f` is a continuous function, and -the sequence `‖f.restrict (s i)‖ * μ (s i)` is summable, then `f` is integrable. -/ -theorem integrable_of_summable_norm_restrict {f : C(X, E)} {s : ι → Compacts X} - (hf : Summable fun i : ι => ‖f.restrict (s i)‖ * μ.real (s i)) - (hs : ⋃ i : ι, ↑(s i) = (univ : Set X)) : Integrable f μ := by - simpa only [hs, integrableOn_univ] using integrableOn_iUnion_of_summable_norm_restrict hf - -end IntegrableUnion - -/-! ### Continuity of the set integral - -We prove that for any set `s`, the function -`fun f : X →₁[μ] E => ∫ᵛ x in s, f x ∂[B; μ]` is continuous. -/ - -section ContinuousSetIntegral - -variable [NormedAddCommGroup E] - {𝕜 : Type*} [NormedRing 𝕜] [NormedAddCommGroup F] [Module 𝕜 F] [IsBoundedSMul 𝕜 F] - {p : ℝ≥0∞} {μ : Measure X} - -@[continuity] -theorem continuous_setIntegral [NormedSpace ℝ E] (s : Set X) : - Continuous fun f : X →₁[μ] E => ∫ᵛ x in s, f x ∂[B; μ] := by - haveI : Fact ((1 : ℝ≥0∞) ≤ 1) := ⟨le_rfl⟩ - have h_comp : - (fun f : X →₁[μ] E => ∫ᵛ x in s, f x ∂[B; μ]) = - integral (μ.restrict s) ∘ fun f => LpToLpRestrictCLM X E ℝ μ 1 s f := by - ext1 f - rw [Function.comp_apply, integral_congr_ae (LpToLpRestrictCLM_coeFn ℝ s f)] - rw [h_comp] - exact continuous_integral.comp (LpToLpRestrictCLM X E ℝ μ 1 s).continuous - -end ContinuousSetIntegral - -end MeasureTheory - -section Support - -variable {M : Type*} [NormedAddCommGroup M] [NormedSpace ℝ M] {mX : MeasurableSpace X} - {ν : Measure X} {F : X → M} - -theorem MeasureTheory.setIntegral_support : ∫ᵛ x in support F, F x ∂ν = ∫ᵛ x, F x ∂ν := by - nth_rw 2 [← setIntegral_univ] - rw [setIntegral_eq_of_subset_of_forall_diff_eq_zero MeasurableSet.univ (subset_univ (support F))] - exact fun _ hx => notMem_support.mp <| notMem_of_mem_diff hx - -theorem MeasureTheory.setIntegral_tsupport [TopologicalSpace X] : - ∫ᵛ x in tsupport F, F x ∂ν = ∫ᵛ x, F x ∂ν := by - nth_rw 2 [← setIntegral_univ] - rw [setIntegral_eq_of_subset_of_forall_diff_eq_zero MeasurableSet.univ (subset_univ (tsupport F))] - exact fun _ hx => image_eq_zero_of_notMem_tsupport <| notMem_of_mem_diff hx - -end Support +end MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index 193fcc2fddd92e..a63adf17ab15be 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -12,23 +12,56 @@ public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral -/ -namespace MeasureTheory.VectorMeasure +open Set +namespace MeasureTheory.VectorMeasure variable {X E F G : Type*} {mX : MeasurableSpace X} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] + {μ : VectorMeasure X F} {f : X → E} {B : E →L[ℝ] F →L[ℝ] G} {s : Set X} open scoped Classical in +/-- The vector measure with density `f` with respect to a vector measure `μ`, associating to a +measurable set the mass `∫ᵛ x in s, f x ∂[B; μ]`. +If `f` is not integrable, we use the junk value `0`. -/ noncomputable def withDensity (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : VectorMeasure X G := - if μ.Integrable f B then + if h : μ.Integrable f B then { measureOf' s := ∫ᵛ x in s, f x ∂[B; μ] empty' := by simp - not_measurable' s hs := by simp [restrict_not_measurable _ hs] - m_iUnion' s s_meas s_disj := by - } + not_measurable' s hs := setIntegral_eq_zero_of_not_measurableSet hs + m_iUnion' s s_meas s_disj := hasSum_setIntegral_iUnion s_meas s_disj h.integrableOn } else 0 +lemma withDensity_apply (hf : μ.Integrable f B) : + μ.withDensity f B s = ∫ᵛ x in s, f x ∂[B; μ] := by + simp [withDensity, hf] + +lemma withDensity_apply_univ : μ.withDensity f B univ = ∫ᵛ x, f x ∂[B; μ] := by + by_cases hf : μ.Integrable f B + · simp [withDensity_apply hf] + · simp [withDensity, hf, integral_undef] + +@[simp] +lemma withDensity_zero_vectorMeasure : (0 : VectorMeasure X F).withDensity f B = 0 := by + ext s hs + simp [withDensity_apply] + +@[simp] +lemma withDensity_zero : μ.withDensity 0 B = 0 := by + ext s hs + have : μ.Integrable 0 B := by + simp [VectorMeasure.Integrable] + apply integrable_zero + simp [withDensity_apply] + + +lemma restrict_withDensity (hf : μ.Integrable f B) : + (μ.withDensity f B).restrict s = (μ.restrict s).withDensity f B := by + by_cases hs : MeasurableSet s; swap + · simp [restrict_not_measurable _ hs] + + end MeasureTheory.VectorMeasure From 3661899f6fc1a00ae43eea24480b788802bbfdea Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 23 May 2026 16:24:54 +0200 Subject: [PATCH 055/129] fix --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index d76247acbc2e38..ee27fdf25dc55d 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -714,9 +714,7 @@ theorem setToFun_smul_left' (hT : DominatedFinMeasAdditive μ T C) theorem setToFun_zero (hT : DominatedFinMeasAdditive μ T C) : setToFun μ T hT (0 : α → E) = 0 := by by_cases hF : CompleteSpace F; swap · simp [setToFun, hF] - rw [Pi.zero_def, setToFun_eq hT (integrable_zero _ _ _)] - simp only [← Pi.zero_def] - rw [Integrable.toL1_zero, map_zero] + rw [setToFun_eq hT (integrable_zero _ _ _), Integrable.toL1_zero, map_zero] @[simp] theorem setToFun_zero_left {hT : DominatedFinMeasAdditive μ (0 : Set α → E →L[ℝ] F) C} : From ea2ceb2422d2c5e4c788d68fa48fa048a16fa472 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 24 May 2026 18:52:11 +0200 Subject: [PATCH 056/129] progress --- .../VectorMeasure/WithDensity.lean | 2 +- .../VectorMeasure/WithDensityVec.lean | 76 ++++++++++++++++++- 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean index 88605419c9f9c4..595c05309b37e4 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean @@ -63,7 +63,7 @@ theorem withDensityᵥ_apply (hf : Integrable f μ) {s : Set α} (hs : Measurabl @[simp] theorem withDensityᵥ_zero : μ.withDensityᵥ (0 : α → E) = 0 := by ext1 s hs - rw [Pi.zero_def, withDensityᵥ_apply (integrable_zero α E μ) hs] + rw [withDensityᵥ_apply (integrable_zero α E μ) hs] simp @[simp] diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index a63adf17ab15be..568cf570223f3f 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -20,7 +20,7 @@ variable {X E F G : Type*} {mX : MeasurableSpace X} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] - {μ : VectorMeasure X F} {f : X → E} {B : E →L[ℝ] F →L[ℝ] G} {s : Set X} + {μ : VectorMeasure X F} {f g : X → E} {B : E →L[ℝ] F →L[ℝ] G} {s : Set X} open scoped Classical in /-- The vector measure with density `f` with respect to a vector measure `μ`, associating to a @@ -52,16 +52,84 @@ lemma withDensity_zero_vectorMeasure : (0 : VectorMeasure X F).withDensity f B = @[simp] lemma withDensity_zero : μ.withDensity 0 B = 0 := by ext s hs - have : μ.Integrable 0 B := by - simp [VectorMeasure.Integrable] - apply integrable_zero simp [withDensity_apply] +lemma withDensity_congr (h : f =ᵐ[(μ.transpose B).variation] g) : + μ.withDensity f B = μ.withDensity g B := by + by_cases hf : μ.Integrable f B + · simp only [withDensity, hf, ↓reduceDIte, Integrable.congr hf h, mk.injEq] + ext s + apply setIntegral_congr_ae + filter_upwards [h] with x hx xs using hx + · have : ¬(μ.Integrable g B) := by simpa [← integrable_congr h] using hf + simp [withDensity, hf, this] lemma restrict_withDensity (hf : μ.Integrable f B) : (μ.withDensity f B).restrict s = (μ.restrict s).withDensity f B := by by_cases hs : MeasurableSet s; swap · simp [restrict_not_measurable _ hs] + · ext t ht + simp only [hs, ht, restrict_apply] + rw [withDensity_apply hf, withDensity_apply hf.restrict, restrict_restrict _ ht hs] + + +#check MemLp.exists_simpleFunc_eLpNorm_sub_lt +local infixr:25 " →ₛ " => SimpleFunc + +#check SimpleFunc.lintegral + +#check SimpleFunc.map + +#check SimpleFunc.map_lintegral + +lemma variation_withDensity (hf : μ.Integrable f B) : + (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by + apply le_antisymm + · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + rw [withDensity_apply hf, MeasureTheory.withDensity_apply _ hs] + apply enorm_setIntegral_le_lintegral_enorm + apply Measure.le_iff.2 (fun s hs ↦ ?_) + rw [MeasureTheory.withDensity_apply _ hs] + apply ENNReal.le_of_forall_pos_le_add + rintro ε εpos - + let δ := ε / 10 + have δpos : 0 < δ := div_pos εpos (by norm_num) + obtain ⟨g, hg, -⟩ : ∃ (g : X →ₛ E), eLpNorm (f - ⇑g) 1 (μ.transpose B).variation < δ + ∧ MemLp (⇑g) 1 (μ.transpose B).variation := + (memLp_one_iff_integrable.2 hf).exists_simpleFunc_eLpNorm_sub_lt (by simp) + (by simpa using δpos.ne') + have A : ∫⁻ a in s, ‖f a‖ₑ ∂(μ.transpose B).variation + ≤ ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + δ := calc + _ ≤ ∫⁻ a in s, ‖f a - g a‖ₑ + ‖g a‖ₑ ∂(μ.transpose B).variation := by + gcongr with a + nth_rw 1 [show f a = (f a - g a) + g a by abel] + exact enorm_add_le (f a - g a) (g a) + _ = ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + + ∫⁻ a in s, ‖f a - g a‖ₑ ∂(μ.transpose B).variation := by + rw [lintegral_add_right, add_comm] + exact g.stronglyMeasurable.enorm + _ ≤ ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + + ∫⁻ a, ‖f a - g a‖ₑ ∂(μ.transpose B).variation := by + gcongr + exact Measure.restrict_le_self + _ ≤ ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + δ := by + rw [eLpNorm_one_eq_lintegral_enorm] at hg + gcongr + exact hg.le + have B : ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation = + ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) := calc + _ = (g.map (‖·‖ₑ)).lintegral ((μ.transpose B).variation.restrict s) := + SimpleFunc.lintegral_eq_lintegral _ _ + _ = ∑ i ∈ g.range, ‖i‖ₑ * (μ.transpose B).variation.restrict s (g ⁻¹' {i}) := + SimpleFunc.map_lintegral _ _ + _ = ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) := by + simp_rw [variation_restrict hs] + + + + + + end MeasureTheory.VectorMeasure From a4f1b6b98bde6605c85ca987e3994d2a406672d0 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 25 May 2026 15:14:28 +0200 Subject: [PATCH 057/129] progress --- .../MeasureTheory/Measure/PreVariation.lean | 12 ++++- .../VectorMeasure/Variation/Basic.lean | 35 +++++++++++++- .../VectorMeasure/WithDensityVec.lean | 47 +++++++++++++------ 3 files changed, 78 insertions(+), 16 deletions(-) diff --git a/Mathlib/MeasureTheory/Measure/PreVariation.lean b/Mathlib/MeasureTheory/Measure/PreVariation.lean index 7e355bc9b38be0..226c44e668a12e 100644 --- a/Mathlib/MeasureTheory/Measure/PreVariation.lean +++ b/Mathlib/MeasureTheory/Measure/PreVariation.lean @@ -123,7 +123,7 @@ lemma exists_Finpartition_sum_gt {s : Set X} (hs : MeasurableSet s) {a : ℝ≥0 simp_all [preVariationFun, lt_iSup_iff] lemma exists_Finpartition_sum_ge {s : Set X} (hs : MeasurableSet s) {ε : ℝ≥0} (hε : 0 < ε) - (h : preVariationFun f s ≠ ⊤) : + (h : preVariationFun f s ≠ ∞) : ∃ P : Finpartition (⟨s, hs⟩ : Subtype MeasurableSet), preVariationFun f s ≤ ∑ p ∈ P.parts, f p + ε := by let ε' := min ε (preVariationFun f s).toNNReal @@ -144,6 +144,16 @@ lemma exists_Finpartition_sum_ge {s : Set X} (hs : MeasurableSet s) {ε : ℝ≥ _ ≤ ∑ p ∈ P.parts, f p + ε := by gcongr · simp [*] +lemma exists_Finpartition_sum_ge' {s : Set X} (hs : MeasurableSet s) {ε : ℝ≥0∞} (hε : 0 < ε) + (h : preVariationFun f s ≠ ∞) : + ∃ P : Finpartition (⟨s, hs⟩ : Subtype MeasurableSet), + preVariationFun f s ≤ ∑ p ∈ P.parts, f p + ε := by + rcases eq_top_or_lt_top ε with rfl | h'ε + · obtain ⟨P⟩ : Nonempty (Finpartition (⟨s, hs⟩ : Subtype MeasurableSet)) := inferInstance + exact ⟨P, by simp⟩ + · lift ε to NNReal using h'ε.ne + exact exists_Finpartition_sum_ge _ hs (by simpa using hε) h + lemma sum_le_preVariationFun_iUnion' {s : ℕ → Set X} (hs : ∀ i, MeasurableSet (s i)) (hs' : Pairwise (Disjoint on s)) (P : ∀ (i : ℕ), Finpartition (⟨s i, hs i⟩ : Subtype MeasurableSet)) (n : ℕ) : diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index 530d048bdc3c8c..ff2e7c9b387cbb 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -33,7 +33,7 @@ such vector-valued measures. public section open Finset Set -open scoped ENNReal +open scoped ENNReal NNReal namespace MeasureTheory.VectorMeasure @@ -75,6 +75,39 @@ lemma le_variation (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) { simp only [sup_set_eq_biUnion, id_eq] exact hs.diff <| .biUnion (Finset.countable_toSet _) (by simp) +/-- Measure version of `preVariation.exists_Finpartition_sum_ge'`. -/ +lemma exists_variation_le_add' (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) + {ε : ℝ≥0∞} (hε : 0 < ε) (hμ : μ.variation s ≠ ∞) : + ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ s) ∧ ((P : Set (Set X)).PairwiseDisjoint id) ∧ + (∀ t ∈ P, MeasurableSet t) ∧ μ.variation s ≤ ∑ p ∈ P, ‖μ p‖ₑ + ε := by + simp only [variation_apply, preVariation, ennrealToMeasure_apply hs, ennrealPreVariation_apply] + at hμ ⊢ + obtain ⟨P, hP⟩ : ∃ P : Finpartition (⟨s, hs⟩ : Subtype MeasurableSet), + preVariationFun (fun x ↦ ‖μ x‖ₑ) s ≤ ∑ p ∈ P.parts, (fun x ↦ ‖μ x‖ₑ) ↑p + ε := + preVariation.exists_Finpartition_sum_ge' (‖μ ·‖ₑ) hs hε hμ + refine ⟨P.parts.map (Function.Embedding.subtype _), ?_, ?_, ?_, ?_⟩ + · simp only [mem_map, Function.Embedding.subtype_apply, Subtype.exists, exists_and_right, + exists_eq_right, forall_exists_index] + intro t ht h't + exact P.le h't + · intro i hi j hj hij + simp only [coe_map, Function.Embedding.subtype_apply, Set.mem_image, SetLike.mem_coe, + Subtype.exists, exists_and_right, exists_eq_right] at hi hj + rcases hi with ⟨h'i, i_mem⟩ + rcases hj with ⟨h'j, j_mem⟩ + exact (disjoint_subtype_iff (fun _ _ hs ht ↦ hs.inter ht) _).1 + (P.disjoint i_mem j_mem (by simpa using hij)) + · simp +contextual + · rw [Finset.sum_map] + exact hP.trans_eq rfl + +/-- Measure version of `preVariation.exists_Finpartition_sum_ge`. -/ +lemma exists_variation_le_add (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) + {ε : ℝ≥0} (hε : 0 < ε) (hμ : μ.variation s ≠ ∞) : + ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ s) ∧ ((P : Set (Set X)).PairwiseDisjoint id) ∧ + (∀ t ∈ P, MeasurableSet t) ∧ μ.variation s ≤ ∑ p ∈ P, ‖μ p‖ₑ + ε := + exists_variation_le_add' μ hs (mod_cast hε) hμ + theorem enorm_measure_le_variation (μ : VectorMeasure X V) (E : Set X) : ‖μ E‖ₑ ≤ variation μ E := by by_cases hE : MeasurableSet E diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index 568cf570223f3f..4b18f13945e8b5 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -12,10 +12,13 @@ public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral -/ -open Set +open Set Filter +open scoped Topology ENNReal namespace MeasureTheory.VectorMeasure +local infixr:25 " →ₛ " => SimpleFunc + variable {X E F G : Type*} {mX : MeasurableSpace X} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] @@ -72,16 +75,6 @@ lemma restrict_withDensity (hf : μ.Integrable f B) : simp only [hs, ht, restrict_apply] rw [withDensity_apply hf, withDensity_apply hf.restrict, restrict_restrict _ ht hs] - -#check MemLp.exists_simpleFunc_eLpNorm_sub_lt -local infixr:25 " →ₛ " => SimpleFunc - -#check SimpleFunc.lintegral - -#check SimpleFunc.map - -#check SimpleFunc.map_lintegral - lemma variation_withDensity (hf : μ.Integrable f B) : (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by apply le_antisymm @@ -94,11 +87,11 @@ lemma variation_withDensity (hf : μ.Integrable f B) : rintro ε εpos - let δ := ε / 10 have δpos : 0 < δ := div_pos εpos (by norm_num) - obtain ⟨g, hg, -⟩ : ∃ (g : X →ₛ E), eLpNorm (f - ⇑g) 1 (μ.transpose B).variation < δ + obtain ⟨g, hg, gmem⟩ : ∃ (g : X →ₛ E), eLpNorm (f - ⇑g) 1 (μ.transpose B).variation < δ ∧ MemLp (⇑g) 1 (μ.transpose B).variation := (memLp_one_iff_integrable.2 hf).exists_simpleFunc_eLpNorm_sub_lt (by simp) (by simpa using δpos.ne') - have A : ∫⁻ a in s, ‖f a‖ₑ ∂(μ.transpose B).variation + have I1 : ∫⁻ a in s, ‖f a‖ₑ ∂(μ.transpose B).variation ≤ ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + δ := calc _ ≤ ∫⁻ a in s, ‖f a - g a‖ₑ + ‖g a‖ₑ ∂(μ.transpose B).variation := by gcongr with a @@ -116,7 +109,7 @@ lemma variation_withDensity (hf : μ.Integrable f B) : rw [eLpNorm_one_eq_lintegral_enorm] at hg gcongr exact hg.le - have B : ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation = + have I2 : ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation = ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) := calc _ = (g.map (‖·‖ₑ)).lintegral ((μ.transpose B).variation.restrict s) := SimpleFunc.lintegral_eq_lintegral _ _ @@ -124,6 +117,32 @@ lemma variation_withDensity (hf : μ.Integrable f B) : SimpleFunc.map_lintegral _ _ _ = ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) := by simp_rw [variation_restrict hs] + obtain ⟨ρ,ρpos, hρ⟩ : ∃ ρ > 0, ∑ i ∈ g.range, ‖i‖ₑ * ρ ≤ δ := by + refine ⟨δ * (∑ i ∈ g.range, ‖i‖ₑ)⁻¹, by simp [δpos], ?_⟩ + grw [← Finset.sum_mul, mul_comm (δ : ℝ≥0∞), ← mul_assoc, ENNReal.mul_inv_le_one, one_mul] + have C i : ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ g ⁻¹' {i}) + ∧ ((P : Set (Set X)).PairwiseDisjoint id) ∧ + (∀ t ∈ P, MeasurableSet t) ∧ + ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) ≤ + ‖i‖ₑ * (∑ p ∈ P, ‖(μ.transpose B).restrict s p‖ₑ + ρ) := by + rcases eq_or_ne i 0 with rfl | hi + · exact ⟨∅, by simp⟩ + suffices ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ g ⁻¹' {i}) + ∧ ((P : Set (Set X)).PairwiseDisjoint id) ∧ (∀ t ∈ P, MeasurableSet t) ∧ + ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) ≤ + (∑ p ∈ P, ‖(μ.transpose B).restrict s p‖ₑ + ρ) by + obtain ⟨P, hP, h'P, h''P, h'''P⟩ := this + exact ⟨P, hP, h'P, h''P, by gcongr⟩ + apply exists_variation_le_add' _ (g.measurableSet_fiber i) ρpos + rw [variation_restrict hs] + exact (g.integrable_iff.1 (memLp_one_iff_integrable.1 gmem).restrict i hi).ne + choose P Pg Pdisj Pmeas hP using C + + + + + + From 484ad1b79edd1d842d5dcb9eda1a1e78ff6ebfd2 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Mon, 25 May 2026 16:02:29 +0200 Subject: [PATCH 058/129] more --- .../VectorMeasure/WithDensityVec.lean | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index 4b18f13945e8b5..00b924d3f6f042 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -75,6 +75,8 @@ lemma restrict_withDensity (hf : μ.Integrable f B) : simp only [hs, ht, restrict_apply] rw [withDensity_apply hf, withDensity_apply hf.restrict, restrict_restrict _ ht hs] +#check Finset.sum_sigma + lemma variation_withDensity (hf : μ.Integrable f B) : (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by apply le_antisymm @@ -137,8 +139,29 @@ lemma variation_withDensity (hf : μ.Integrable f B) : rw [variation_restrict hs] exact (g.integrable_iff.1 (memLp_one_iff_integrable.1 gmem).restrict i hi).ne choose P Pg Pdisj Pmeas hP using C - - + have I3 : ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) ≤ + ∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ + δ := calc + ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) + _ ≤ ∑ i ∈ g.range, ‖i‖ₑ * ((∑ p ∈ P i, ‖(μ.transpose B).restrict s p‖ₑ) + ρ) := by + gcongr 1 with i hi + exact hP i + _ ≤ ∑ i ∈ g.range, ∑ p ∈ P i, ‖i‖ₑ * ‖(μ.transpose B).restrict s p‖ₑ + δ := by + simp_rw [mul_add, Finset.sum_add_distrib, Finset.mul_sum] + gcongr + _ = ∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ + δ := by + rw [Finset.sum_sigma'] + have I4 : ∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ + ≤ ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ + δ := calc + ∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ + _ = ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, i.1 ∂[B; μ.restrict s]‖ₑ := by + congr! with ⟨i, p⟩ hi + rw [setIntegral_const] + + + _ = ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, g x ∂[B; μ.restrict s]‖ₑ := by + congr! with i hi + sorry + _ ≤ _ := sorry From 99ed6716f8ed64ae07d0426911e47432fbf41279 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 25 May 2026 22:24:23 +0200 Subject: [PATCH 059/129] complete proof --- .../VectorMeasure/WithDensityVec.lean | 152 +++++++++++++++--- 1 file changed, 130 insertions(+), 22 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index 00b924d3f6f042..0412b9c0fddfd8 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -75,19 +75,23 @@ lemma restrict_withDensity (hf : μ.Integrable f B) : simp only [hs, ht, restrict_apply] rw [withDensity_apply hf, withDensity_apply hf.restrict, restrict_restrict _ ht hs] -#check Finset.sum_sigma - -lemma variation_withDensity (hf : μ.Integrable f B) : - (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by - apply le_antisymm +lemma variation_WithDensity_le : + (μ.withDensity f B).variation ≤ (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by + by_cases hf : μ.Integrable f B · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) rw [withDensity_apply hf, MeasureTheory.withDensity_apply _ hs] apply enorm_setIntegral_le_lintegral_enorm + · simp [withDensity, hf, Measure.zero_le ] + +lemma variation_withDensity [CompleteSpace G] + (hf : μ.Integrable f B) (hB : ∀ x y, ‖B x y‖₊ = ‖B.flip y‖₊ * ‖x‖₊) : + (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by + apply le_antisymm variation_WithDensity_le apply Measure.le_iff.2 (fun s hs ↦ ?_) rw [MeasureTheory.withDensity_apply _ hs] apply ENNReal.le_of_forall_pos_le_add rintro ε εpos - - let δ := ε / 10 + let δ := ε / 3 have δpos : 0 < δ := div_pos εpos (by norm_num) obtain ⟨g, hg, gmem⟩ : ∃ (g : X →ₛ E), eLpNorm (f - ⇑g) 1 (μ.transpose B).variation < δ ∧ MemLp (⇑g) 1 (μ.transpose B).variation := @@ -155,23 +159,127 @@ lemma variation_withDensity (hf : μ.Integrable f B) : ∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ _ = ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, i.1 ∂[B; μ.restrict s]‖ₑ := by congr! with ⟨i, p⟩ hi - rw [setIntegral_const] - - + rcases eq_or_ne i 0 with rfl | h'i + · simp + simp only [Finset.mem_sigma] at hi + have pmeas : MeasurableSet p := Pmeas i _ hi.2 + have : IsFiniteMeasure (((μ.restrict s).restrict p).transpose B).variation := by + constructor + rw [restrict_restrict _ pmeas hs, transpose_restrict, variation_restrict (pmeas.inter hs), + MeasureTheory.Measure.restrict_apply_univ] + apply lt_of_le_of_lt ?_ (g.integrable_iff.1 (memLp_one_iff_integrable.1 gmem) i h'i) + exact measure_mono (inter_subset_left.trans (Pg i _ hi.2)) + rw [setIntegral_const, restrict_apply _ hs pmeas, restrict_apply _ hs pmeas] + simp [transpose, hB, enorm_eq_nnnorm, mul_comm] _ = ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, g x ∂[B; μ.restrict s]‖ₑ := by + congr! 2 with ⟨i, p⟩ hi + simp only [Finset.mem_sigma] at hi + apply setIntegral_congr_ae + filter_upwards with x hx using (Pg i _ hi.2 hx).symm + _ = ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, (g x - f x) + f x ∂[B; μ.restrict s]‖ₑ := by simp + _ = ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, (g x - f x) ∂[B; μ.restrict s] + + ∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ := by congr! with i hi - sorry - _ ≤ _ := sorry - - - - - - - - - - - + rw [integral_fun_add] + · apply Integrable.restrict + apply Integrable.restrict + apply Integrable.sub (memLp_one_iff_integrable.1 gmem) hf + · apply hf.restrict.restrict + _ ≤ ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, (g x - f x) ∂[B; μ.restrict s]‖ₑ + + ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ := by + rw [← Finset.sum_add_distrib] + gcongr with i hi + apply enorm_add_le + _ ≤ ∑ i ∈ g.range.sigma P, ∫⁻ x in i.2, ‖g x - f x‖ₑ ∂(μ.transpose B).variation + + ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ := by + gcongr with i hi + grw [enorm_setIntegral_le_lintegral_enorm] + apply lintegral_mono' _ le_rfl + apply Measure.restrict_mono le_rfl + rw [transpose_restrict, variation_restrict hs] + apply Measure.restrict_le_self + _ = ∫⁻ x in (⋃ i ∈ g.range.sigma P, i.2), ‖g x - f x‖ₑ ∂(μ.transpose B).variation + + ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ := by + rw [lintegral_biUnion_finset] + · rintro ⟨i, p⟩ hi ⟨j, q⟩ hj hijpq + simp only [Finset.coe_sigma, SimpleFunc.coe_range, mem_sigma_iff, mem_range, + SetLike.mem_coe] at hi hj + rcases eq_or_ne i j with rfl | hij + · simp only [ne_eq, Sigma.mk.injEq, heq_eq_eq, true_and] at hijpq + exact Pdisj i hi.2 hj.2 hijpq + · have : Disjoint (g ⁻¹' {i}) (g ⁻¹' {j}) := by grind + exact this.mono (Pg i p hi.2) (Pg j q hj.2) + · rintro ⟨i, p⟩ hip + simp only [Finset.mem_sigma, SimpleFunc.mem_range, mem_range] at hip + exact Pmeas i p hip.2 + _ ≤ ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ + + ∫⁻ x, ‖g x - f x‖ₑ ∂(μ.transpose B).variation := by + rw [add_comm] + gcongr + apply Measure.restrict_le_self + _ ≤ ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ + δ := by + gcongr + simp_rw [enorm_sub_rev, ← eLpNorm_one_eq_lintegral_enorm] + exact hg.le + have I5 : ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ + ≤ (μ.withDensity f B).variation s := by + let Q : Finset (Set X) := (g.range.sigma P).image (fun p ↦ p.2 ∩ s) + have Qmeas (t : Set X) (ht : t ∈ Q) : MeasurableSet t := by + simp only [Finset.mem_image, Finset.mem_sigma, SimpleFunc.mem_range, mem_range, Sigma.exists, + ↓existsAndEq, true_and, exists_and_right, Q] at ht + rcases ht with ⟨a, ⟨i, hi⟩, rfl⟩ + exact (Pmeas _ _ hi).inter hs + calc ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ + _ = ∑ j ∈ Q, ‖∫ᵛ x in j, f x ∂[B; μ]‖ₑ := by + simp only [Q] + rw [Finset.sum_image_of_pairwise_eq_zero]; swap + · rintro ⟨i, p⟩ hi ⟨j, q⟩ hj hijpq h'ij + simp only [Finset.coe_sigma, SimpleFunc.coe_range, mem_sigma_iff, mem_range, + SetLike.mem_coe] at hi hj + suffices H : Disjoint p q by + have : Disjoint (p ∩ s) (q ∩ s) := H.mono inter_subset_left inter_subset_left + rw [← h'ij, disjoint_self] at this + simp [this] + rcases eq_or_ne i j with rfl | hij + · simp only [ne_eq, Sigma.mk.injEq, heq_eq_eq, true_and] at hijpq + exact Pdisj i hi.2 hj.2 hijpq + · have : Disjoint (g ⁻¹' {i}) (g ⁻¹' {j}) := by grind + exact this.mono (Pg i p hi.2) (Pg j q hj.2) + apply Finset.sum_congr rfl + rintro ⟨i, p⟩ hi + simp only [Finset.mem_sigma, SimpleFunc.mem_range, mem_range] at hi + rw [restrict_restrict _ (Pmeas i p hi.2) hs] + _ = ∑ j ∈ Q, ‖μ.withDensity f B j‖ₑ := + Finset.sum_congr rfl (fun t ht ↦ by rw [withDensity_apply hf]) + _ ≤ (μ.withDensity f B).variation s := by + apply le_variation _ hs + · intro t ht + simp only [Finset.mem_image, Finset.mem_sigma, SimpleFunc.mem_range, mem_range, + Sigma.exists, ↓existsAndEq, true_and, exists_and_right, Q] at ht + rcases ht with ⟨p, -, rfl⟩ + exact inter_subset_right + · intro t ht u hu htu + simp only [Finset.coe_image, Finset.coe_sigma, SimpleFunc.coe_range, mem_image, + mem_sigma_iff, mem_range, SetLike.mem_coe, Sigma.exists, ↓existsAndEq, true_and, + exists_and_right, Q] at ht hu + rcases ht with ⟨p, ⟨i, hi⟩, rfl⟩ + rcases hu with ⟨q, ⟨j, hj⟩, rfl⟩ + have hpq : p ≠ q := by grind only + suffices H : Disjoint p q from H.mono inter_subset_left inter_subset_left + rcases eq_or_ne (g i) (g j) with hij | hij + · rw [← hij] at hj + exact Pdisj (g i) hi hj hpq + · have : Disjoint (g ⁻¹' {g i}) (g ⁻¹' {g j}) := by grind + exact this.mono (Pg (g i) p hi) (Pg (g j) q hj) + calc ∫⁻ (a : X) in s, ‖f a‖ₑ ∂(μ.transpose B).variation + _ ≤ ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + δ := I1 + _ = ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) + δ := by rw [I2] + _ ≤ (∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ + δ) + δ := by gcongr + _ ≤ ((∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ + δ) + δ) + δ := by gcongr + _ = (∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ) + 3 * δ := by ring + _ ≤ (μ.withDensity f B).variation s + 3 * δ := by gcongr + _ ≤ (μ.withDensity f B).variation s + ε := by + simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, ENNReal.coe_div, ENNReal.coe_ofNat, δ] + rw [ENNReal.mul_div_cancel (by simp) (by simp)] end MeasureTheory.VectorMeasure From 7ea80d7b6cf6b6f085acfed10d3bb70c81cc80bc Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 26 May 2026 08:59:12 +0200 Subject: [PATCH 060/129] cleanup --- Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean | 2 +- Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 3832f385ae1ba3..4e1932849a0ef2 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -383,7 +383,7 @@ theorem _root_.MeasurableEmbedding.setIntegral_map_vectorMeasure {β : Type*} [M ∫ᵛ y in s, f y ∂[B; μ.map φ] = ∫ᵛ x in φ ⁻¹' s, f (φ x) ∂[B; μ] := by rw [restrict_map μ hφ.measurable hs, hφ.integral_map_vectorMeasure] -theorem _root_.Topology.IsClosedEmbedding.setIntegral_map +theorem _root_.Topology.IsClosedEmbedding.setIntegral_map_vectorMeasure [TopologicalSpace X] [BorelSpace X] {β : Type*} [MeasurableSpace β] [TopologicalSpace β] [BorelSpace β] {φ : X → β} {f : β → E} {s : Set β} (hs : MeasurableSet s) (hφ : IsClosedEmbedding φ) : diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index 0412b9c0fddfd8..b7098d5713cfbb 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -15,6 +15,8 @@ public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral open Set Filter open scoped Topology ENNReal +@[expose] public section + namespace MeasureTheory.VectorMeasure local infixr:25 " →ₛ " => SimpleFunc From 981d397d56f645c571f25ba2d6d7e30df7d0b20f Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 26 May 2026 11:59:06 +0200 Subject: [PATCH 061/129] missing lemma --- .../AEStronglyMeasurable.lean | 6 +++ .../Function/StronglyMeasurable/Basic.lean | 15 ++++++ .../VectorMeasure/WithDensityVec.lean | 50 +++++++++++++++++-- 3 files changed, 66 insertions(+), 5 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean index 08bbe788dc7299..5cf1b587615271 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean @@ -316,6 +316,12 @@ protected theorem inv [Inv β] [ContinuousInv β] (hf : AEStronglyMeasurable[m] AEStronglyMeasurable[m] f⁻¹ μ := ⟨(hf.mk f)⁻¹, hf.stronglyMeasurable_mk.inv, hf.ae_eq_mk.inv⟩ +@[fun_prop] +theorem inv₀ [GroupWithZero β] [ContinuousInv₀ β] [PseudoMetrizableSpace β] + [MeasurableSpace β] [BorelSpace β] [MeasurableSingletonClass β] + (hf : AEStronglyMeasurable[m] f μ) : AEStronglyMeasurable[m] f⁻¹ μ := + ⟨(hf.mk f)⁻¹, hf.stronglyMeasurable_mk.inv₀, hf.ae_eq_mk.inv⟩ + @[to_additive (attr := fun_prop)] protected theorem div [Group β] [IsTopologicalGroup β] (hf : AEStronglyMeasurable[m] f μ) (hg : AEStronglyMeasurable[m] g μ) : AEStronglyMeasurable[m] (f / g) μ := diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean index 027f07c90e84bf..7617791a6033fd 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean @@ -416,6 +416,21 @@ protected theorem inv [Inv β] [ContinuousInv β] (hf : StronglyMeasurable f) : StronglyMeasurable f⁻¹ := ⟨fun n => (hf.approx n)⁻¹, fun x => (hf.tendsto_approx x).inv⟩ +@[fun_prop] +protected theorem inv₀ [GroupWithZero β] [ContinuousInv₀ β] [PseudoMetrizableSpace β] + [MeasurableSpace β] [BorelSpace β] [MeasurableSingletonClass β] (hf : StronglyMeasurable f) : + StronglyMeasurable f⁻¹ := by + refine ⟨fun n => ((hf.approx n).restrict {x | f x ≠ 0})⁻¹, fun x => ?_⟩ + have : MeasurableSet {x | f x ≠ 0} := ((MeasurableSet.singleton 0).preimage hf.measurable).compl + by_cases h : f x = 0 + · simp_all only [ne_eq, measurableSet_setOf, SimpleFunc.coe_inv, SimpleFunc.coe_restrict, + Pi.inv_apply, mem_setOf_eq, not_true_eq_false, not_false_eq_true, indicator_of_notMem, + _root_.inv_zero] + exact tendsto_const_nhds + · simp_all only [ne_eq, measurableSet_setOf, SimpleFunc.coe_inv, SimpleFunc.coe_restrict, + Pi.inv_apply, mem_setOf_eq, not_false_eq_true, indicator_of_mem] + apply (hf.tendsto_approx x).inv₀ h + @[to_additive (attr := fun_prop) sub] protected theorem div' [Div β] [ContinuousDiv β] (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) : StronglyMeasurable (f / g) := diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index b7098d5713cfbb..1db13689b096c6 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -6,6 +6,7 @@ Authors: Sébastien Gouëzel module public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral +public import Mathlib.MeasureTheory.VectorMeasure.WithDensity /-! # Vector measure with density with respect to a vector measure @@ -85,20 +86,39 @@ lemma variation_WithDensity_le : apply enorm_setIntegral_le_lintegral_enorm · simp [withDensity, hf, Measure.zero_le ] +/-- If `‖B x y‖ = ‖B · y‖ * ‖x‖` for all `x, y`, then the variation of a vector measure with +density `f` wrt `μ` is the measure with density `‖f‖ₑ` with respect to the variation of `μ`. + +The condition on `B` is necessary: for a counterexample without it, let `B` be the scalar +product in `ℝ²` and `f x` everywhere horizontal and `μ s` everywhere vertical. +Then `μ.withDensity f B = 0` so its variation is zero, while the integral of `‖f‖ₑ` is not. +-/ lemma variation_withDensity [CompleteSpace G] (hf : μ.Integrable f B) (hB : ∀ x y, ‖B x y‖₊ = ‖B.flip y‖₊ * ‖x‖₊) : (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by apply le_antisymm variation_WithDensity_le apply Measure.le_iff.2 (fun s hs ↦ ?_) + /- For the nontrivial direction, we have to show that for each measurable set `s`, + `∫⁻ (a : X) in s, ‖f a‖ₑ ∂(μ.transpose B).variation ≤ (μ.withDensity f B).variation s`. + As the variation is a supremum over finite partitions, we need to exhibit a partition. For this, + we approximate `f` by a simple function `g`. Then the left term is approximately + `∑ i, ‖g i‖ₑ * (μ.transpose B).variation (g ⁻¹' {i})`. + By definition, the variation of `g ⁻¹' {i}` is close to a sum `∑ j, ‖(μ.transpose B) Pᵢⱼ‖ₑ` over + a partition `Pᵢⱼ` of `g ⁻¹' {i}`. Putting all these together, one gets the desired + partition of `s`, for which `∫⁻ a in s, ‖f a‖ₑ ∂(μ.transpose B).variation` is close to + `∑ i j, ‖∫ x in Pᵢⱼ, f x ∂[B; μ]‖ₑ`, i.e., `∑ i j, ‖(μ.withDensity f B) Pᵢⱼ‖ₑ`. The latter sum + is bounded by `(μ.withDensity f B).variation s` as desired. -/ rw [MeasureTheory.withDensity_apply _ hs] apply ENNReal.le_of_forall_pos_le_add rintro ε εpos - let δ := ε / 3 have δpos : 0 < δ := div_pos εpos (by norm_num) + -- first step: approximate `f` by a simple function `g`. obtain ⟨g, hg, gmem⟩ : ∃ (g : X →ₛ E), eLpNorm (f - ⇑g) 1 (μ.transpose B).variation < δ ∧ MemLp (⇑g) 1 (μ.transpose B).variation := (memLp_one_iff_integrable.2 hf).exists_simpleFunc_eLpNorm_sub_lt (by simp) (by simpa using δpos.ne') + -- the integral of `‖f‖ₑ` is approximated up to `δ` by that of `‖g‖ₑ`. have I1 : ∫⁻ a in s, ‖f a‖ₑ ∂(μ.transpose B).variation ≤ ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + δ := calc _ ≤ ∫⁻ a in s, ‖f a - g a‖ₑ + ‖g a‖ₑ ∂(μ.transpose B).variation := by @@ -117,6 +137,8 @@ lemma variation_withDensity [CompleteSpace G] rw [eLpNorm_one_eq_lintegral_enorm] at hg gcongr exact hg.le + -- the integral of `‖g‖ₑ` can be rewritten as a weighted sum of measures, as `g` is a simple + -- function. have I2 : ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation = ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) := calc _ = (g.map (‖·‖ₑ)).lintegral ((μ.transpose B).variation.restrict s) := @@ -125,6 +147,8 @@ lemma variation_withDensity [CompleteSpace G] SimpleFunc.map_lintegral _ _ _ = ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) := by simp_rw [variation_restrict hs] + -- For each `i`, choose a partition `P i` of `g ⁻¹' {i}` such that the sum of the enorms + -- of their measures approximates well enough the variation, by definition of the variation. obtain ⟨ρ,ρpos, hρ⟩ : ∃ ρ > 0, ∑ i ∈ g.range, ‖i‖ₑ * ρ ≤ δ := by refine ⟨δ * (∑ i ∈ g.range, ‖i‖ₑ)⁻¹, by simp [δpos], ?_⟩ grw [← Finset.sum_mul, mul_comm (δ : ℝ≥0∞), ← mul_assoc, ENNReal.mul_inv_le_one, one_mul] @@ -145,6 +169,8 @@ lemma variation_withDensity [CompleteSpace G] rw [variation_restrict hs] exact (g.integrable_iff.1 (memLp_one_iff_integrable.1 gmem).restrict i hi).ne choose P Pg Pdisj Pmeas hP using C + -- rewrite everything in terms of the global partition made by putting together the `Pᵢ`, + -- and register that the resulting error is bounded by `δ`. have I3 : ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) ≤ ∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ + δ := calc ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) @@ -156,6 +182,8 @@ lemma variation_withDensity [CompleteSpace G] gcongr _ = ∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ + δ := by rw [Finset.sum_sigma'] + -- in the above sum, replace the values of `g` by `f`, as these two functions are close + -- in `L^1` norm. have I4 : ∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ ≤ ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ + δ := calc ∑ i ∈ g.range.sigma P, ‖i.1‖ₑ * ‖(μ.transpose B).restrict s i.2‖ₑ @@ -223,14 +251,11 @@ lemma variation_withDensity [CompleteSpace G] gcongr simp_rw [enorm_sub_rev, ← eLpNorm_one_eq_lintegral_enorm] exact hg.le + -- register that the sum of the enorms of the integrals of `f` over the pieces `Pᵢⱼ` of the + -- partition is bounded by the variation of `μ.withDensity f B`, by definition of the variation. have I5 : ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ ≤ (μ.withDensity f B).variation s := by let Q : Finset (Set X) := (g.range.sigma P).image (fun p ↦ p.2 ∩ s) - have Qmeas (t : Set X) (ht : t ∈ Q) : MeasurableSet t := by - simp only [Finset.mem_image, Finset.mem_sigma, SimpleFunc.mem_range, mem_range, Sigma.exists, - ↓existsAndEq, true_and, exists_and_right, Q] at ht - rcases ht with ⟨a, ⟨i, hi⟩, rfl⟩ - exact (Pmeas _ _ hi).inter hs calc ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ _ = ∑ j ∈ Q, ‖∫ᵛ x in j, f x ∂[B; μ]‖ₑ := by simp only [Q] @@ -273,6 +298,8 @@ lemma variation_withDensity [CompleteSpace G] exact Pdisj (g i) hi hj hpq · have : Disjoint (g ⁻¹' {g i}) (g ⁻¹' {g j}) := by grind exact this.mono (Pg (g i) p hi) (Pg (g j) q hj) + -- finally, put together the above inequalities, and argue that the overall error `3δ` is + -- bounded by `ε` by design. calc ∫⁻ (a : X) in s, ‖f a‖ₑ ∂(μ.transpose B).variation _ ≤ ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + δ := I1 _ = ∑ i ∈ g.range, ‖i‖ₑ * ((μ.transpose B).restrict s).variation (g ⁻¹' {i}) + δ := by rw [I2] @@ -284,4 +311,17 @@ lemma variation_withDensity [CompleteSpace G] simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, ENNReal.coe_div, ENNReal.coe_ofNat, δ] rw [ENNReal.mul_div_cancel (by simp) (by simp)] +#where + +lemma variation_withDensityᵥ {μ : Measure X} {f : X → E} (hf : Integrable f μ) : + (μ.withDensityᵥ f).variation = μ.withDensity (fun x ↦ ‖f x‖ₑ) := by + have : μ.withDensityᵥ f = (μ.withDensity (‖f ·‖ₑ)).withDensityᵥ (fun x ↦ ‖f x‖⁻¹ • f x) := by + ext s hs + rw [withDensityᵥ_apply hf hs, withDensityᵥ_apply _ hs]; swap + · have : IsFiniteMeasure (μ.withDensity fun x ↦ ‖f x‖ₑ) := ⟨by simpa using hf.2⟩ + apply Integrable.of_bound (C := 1) + · have W := hf.aestronglyMeasurable.norm.inv + + + end MeasureTheory.VectorMeasure From 1e91591731af24c7667c1e3fd363fd9a4aef92bc Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 26 May 2026 14:22:56 +0200 Subject: [PATCH 062/129] more --- .../MeasureTheory/Integral/Bochner/Basic.lean | 4 ++ .../VectorMeasure/WithDensityVec.lean | 39 ++++++++++++++++--- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean index fcdfcdf6476249..e9ca3c6dbaa695 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean @@ -214,6 +214,10 @@ theorem integral_non_aestronglyMeasurable {f : α → G} (h : ¬AEStronglyMeasur ∫ a, f a ∂μ = 0 := integral_undef <| not_and_of_not_left _ h +theorem integral_of_not_completeSpace {f : α → G} (hG : ¬CompleteSpace G) : + ∫ a, f a ∂μ = 0 := by + simp [integral, hG] + variable (α G) @[simp] diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index 1db13689b096c6..c1451eef357c36 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -311,16 +311,45 @@ lemma variation_withDensity [CompleteSpace G] simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, ENNReal.coe_div, ENNReal.coe_ofNat, δ] rw [ENNReal.mul_div_cancel (by simp) (by simp)] -#where +/- TODO: move -/ +@[simp] lemma variation_toSignedMeasure {μ : Measure X} [IsFiniteMeasure μ] : + variation μ.toSignedMeasure = μ := by + apply le_antisymm + · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + simp [Measure.toSignedMeasure_apply, hs, Measure.real, Real.enorm_eq_ofReal] + · apply Measure.le_iff.2 (fun s hs ↦ ?_) + apply le_trans ?_ (enorm_measure_le_variation _ _) + simp [Measure.toSignedMeasure_apply, hs, Measure.real, Real.enorm_eq_ofReal] + +@[simp] lemma foo {μ : Measure X} [IsFiniteMeasure μ] {f : X → G} : + ∫ᵛ x, f x ∂[(ContinuousLinearMap.lsmul ℝ ℝ).flip ; μ.toSignedMeasure] + = ∫ x, f x ∂μ := by + by_cases hG : CompleteSpace G; swap + · simp [integral_of_not_completeSpace, hG] + sorry + + + +#exit + lemma variation_withDensityᵥ {μ : Measure X} {f : X → E} (hf : Integrable f μ) : (μ.withDensityᵥ f).variation = μ.withDensity (fun x ↦ ‖f x‖ₑ) := by - have : μ.withDensityᵥ f = (μ.withDensity (‖f ·‖ₑ)).withDensityᵥ (fun x ↦ ‖f x‖⁻¹ • f x) := by + have : IsFiniteMeasure (μ.withDensity fun x ↦ ‖f x‖ₑ) := ⟨by simpa using hf.2⟩ + have : μ.withDensityᵥ f = (μ.withDensity (‖f ·‖ₑ)).toSignedMeasure.withDensity + (fun x ↦ ‖f x‖⁻¹ • f x) (ContinuousLinearMap.lsmul ℝ ℝ).flip := by ext s hs - rw [withDensityᵥ_apply hf hs, withDensityᵥ_apply _ hs]; swap - · have : IsFiniteMeasure (μ.withDensity fun x ↦ ‖f x‖ₑ) := ⟨by simpa using hf.2⟩ + rw [withDensityᵥ_apply hf hs, withDensity_apply]; swap + · simp only [VectorMeasure.Integrable] + apply Integrable.mono_measure _ (variation_transpose_le _ _) + apply Integrable.smul_measure_nnreal + simp only [variation_toSignedMeasure] apply Integrable.of_bound (C := 1) - · have W := hf.aestronglyMeasurable.norm.inv + · apply AEStronglyMeasurable.mono_ac (withDensity_absolutelyContinuous _ _) + exact hf.aestronglyMeasurable.norm.inv₀.smul hf.aestronglyMeasurable + · filter_upwards with x using by simp [norm_smul, inv_mul_le_one] + + From 1492020f0c4ffd33e545e1f2f7e9dad0e097f4a8 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 26 May 2026 15:27:49 +0200 Subject: [PATCH 063/129] more --- .../MeasureTheory/VectorMeasure/Integral.lean | 41 +++++++++++++++++++ .../VectorMeasure/WithDensityVec.lean | 7 +++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index a7a167c35c9548..a4adf094c722ba 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -168,6 +168,47 @@ instance [IsFiniteMeasure μ.variation] : IsFiniteMeasure (μ.transpose B).variation := isFiniteMeasure_of_le _ (variation_transpose_le μ B) +lemma variation_transpose_eq_smul [Nontrivial E] {C : ℝ≥0} + (hB : ∀ x y, ‖B x y‖₊ = C * ‖x‖₊ * ‖y‖₊) : + (μ.transpose B).variation = C • μ.variation := by + apply le_antisymm + · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + apply opENorm_le_bound _ (fun x ↦ ?_) + simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe, flip_apply, + enorm_eq_nnnorm, hB, ENNReal.coe_mul, Measure.smul_apply, Measure.nnreal_smul_coe_apply] + rw [mul_assoc, mul_comm (‖x‖₊ : ℝ≥0∞), ← mul_assoc] + gcongr + rw [← enorm_eq_nnnorm] + apply enorm_measure_le_variation + · rcases eq_or_ne C 0 with rfl | hC + · simp [Measure.zero_le] + suffices μ.variation ≤ C⁻¹ • (μ.transpose B).variation by + grw [this, smul_smul, mul_inv_cancel₀ hC, one_smul] + apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + have : ‖μ s‖ₑ ≤ C⁻¹ • ‖(μ.transpose B) s‖ₑ := by + simp only [transpose, mapRange_apply, LinearMap.toAddMonoidHom_coe, coe_coe] + obtain ⟨x, hx⟩ : ∃ (x : E), x ≠ 0 := exists_ne 0 + have : ‖B.flip (μ s) x‖₊ ≤ ‖B.flip (μ s)‖₊ * ‖x‖₊ := le_opNNNorm _ _ + simp only [flip_apply, hB] at this + rw [mul_comm C, mul_assoc, mul_comm _ (‖x‖₊), mul_le_mul_iff_right₀ (by simp [hx]), + ← le_div_iff₀' (by positivity), div_eq_inv_mul] at this + exact ENNReal.coe_le_coe_of_le this + grw [this] + simp only [Measure.smul_apply, ge_iff_le] + gcongr + apply enorm_measure_le_variation + +lemma variation_transpose_eq [Nontrivial E] (hB : ∀ x y, ‖B x y‖₊ = ‖x‖₊ * ‖y‖₊) : + (μ.transpose B).variation = μ.variation := by + have : μ.variation = (1 : ℝ≥0) • μ.variation := by simp + rw [this] + apply variation_transpose_eq_smul + simpa using hB + +@[simp] lemma variation_transpose_lsmul : + (μ.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation = μ.variation := + variation_transpose_eq _ _ (by simp [nnnorm_smul]) + /-- `f : X → E` is said to be integrable with respect to `μ` and `B` if it is integrable with respect to `(μ.transpose B).variation`. -/ protected abbrev Integrable (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : Prop := diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index c1451eef357c36..ff71f611d082cf 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -321,13 +321,18 @@ lemma variation_withDensity [CompleteSpace G] apply le_trans ?_ (enorm_measure_le_variation _ _) simp [Measure.toSignedMeasure_apply, hs, Measure.real, Real.enorm_eq_ofReal] +#check variation_transpose_le + @[simp] lemma foo {μ : Measure X} [IsFiniteMeasure μ] {f : X → G} : ∫ᵛ x, f x ∂[(ContinuousLinearMap.lsmul ℝ ℝ).flip ; μ.toSignedMeasure] = ∫ x, f x ∂μ := by by_cases hG : CompleteSpace G; swap · simp [integral_of_not_completeSpace, hG] sorry - + by_cases hf : Integrable f μ; swap + · rw [integral_undef, MeasureTheory.integral_undef hf] + simp [VectorMeasure.Integrable, transpose] + rw [variation_transpose_map_le] #exit From 1f98f5a43f9dbb23b4904e7e81582ad742b8263b Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 26 May 2026 18:24:46 +0200 Subject: [PATCH 064/129] more --- Mathlib/Analysis/Normed/Operator/Mul.lean | 13 +++++ .../MeasureTheory/VectorMeasure/Basic.lean | 7 +++ .../MeasureTheory/VectorMeasure/Integral.lean | 42 ++++++++++++++-- .../VectorMeasure/SetIntegral.lean | 10 +++- .../VectorMeasure/Variation/Basic.lean | 9 ++++ .../VectorMeasure/WithDensityVec.lean | 49 ++++++++----------- 6 files changed, 95 insertions(+), 35 deletions(-) diff --git a/Mathlib/Analysis/Normed/Operator/Mul.lean b/Mathlib/Analysis/Normed/Operator/Mul.lean index faae470656da15..bf67aadb0c46ba 100644 --- a/Mathlib/Analysis/Normed/Operator/Mul.lean +++ b/Mathlib/Analysis/Normed/Operator/Mul.lean @@ -259,6 +259,19 @@ theorem opNorm_lsmul [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Module R E] refine le_of_mul_le_mul_right ?_ (norm_pos_iff.mpr hy) simpa using le_of_opNorm_le _ (h 1) y + +/-- The norm of `lsmul x` equals `‖x‖` in any nontrivial normed group. + +This is `ContinuousLinearMap.opNorm_lsmul_apply_le` as an equality. -/ +@[simp] +theorem opNorm_lsmul_apply [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Module R E] [NormSMulClass R E] + [IsScalarTower 𝕜 R E] [Nontrivial E] {a : R} : ‖(lsmul 𝕜 R a : E →L[𝕜] E)‖ = ‖a‖ := by + refine ContinuousLinearMap.opNorm_eq_of_bounds (norm_nonneg _) (fun x => ?_) fun N _ h => ?_ + · simp [norm_smul] + obtain ⟨y, hy⟩ := exists_ne (0 : E) + refine le_of_mul_le_mul_right ?_ (norm_pos_iff.mpr hy) + simpa [norm_smul] using h y + end ContinuousLinearMap end Normed diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index d9d76b3a7841f6..c1d57d47e68826 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -734,6 +734,13 @@ theorem restrict_map {f : α → β} (hf : Measurable f) {s : Set β} (hs : Meas ext t ht simp [map_apply, hs, hf hs, restrict_apply, ht, hf, hf ht] +theorem restrict_toSignedMeasure {μ : Measure α} [IsFiniteMeasure μ] + {s : Set α} (hs : MeasurableSet s) : + μ.toSignedMeasure.restrict s = (μ.restrict s).toSignedMeasure := by + ext t ht + rw [restrict_apply _ hs ht, Measure.toSignedMeasure_apply_measurable (ht.inter hs), + Measure.toSignedMeasure_apply_measurable ht, measureReal_restrict_apply ht] + section ContinuousAdd variable [ContinuousAdd M] diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index a4adf094c722ba..b751b331b3d054 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -1,10 +1,11 @@ /- Copyright (c) 2025 Yoh Tanimoto. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Yoh Tanimoto +Authors: Yoh Tanimoto, Sébastien Gouëzel -/ module +public import Mathlib.MeasureTheory.Integral.Bochner.Basic public import Mathlib.MeasureTheory.Integral.IntegrableOn public import Mathlib.MeasureTheory.Integral.SetToL1 public import Mathlib.MeasureTheory.VectorMeasure.Variation.Basic @@ -106,7 +107,7 @@ theorem cbmApplyMeasure_union (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ theorem dominatedFinMeasAdditive_cbmApplyMeasure (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : DominatedFinMeasAdditive (μ.transpose B).variation - (cbmApplyMeasure μ B : Set X → E →L[ℝ] G) 1 := by + (μ.transpose B) 1 := by refine ⟨fun s t hs ht _ _ hdisj ↦ cbmApplyMeasure_union μ B hs ht hdisj, fun s hs hsf ↦ ?_⟩ simpa using norm_measure_le_variation hsf.ne @@ -205,9 +206,19 @@ lemma variation_transpose_eq [Nontrivial E] (hB : ∀ x y, ‖B x y‖₊ = ‖x apply variation_transpose_eq_smul simpa using hB +/-- Control of the variation of the vector measure which appears in the integral of scalar functions +with respect to a vector measure. -/ @[simp] lemma variation_transpose_lsmul : - (μ.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation = μ.variation := - variation_transpose_eq _ _ (by simp [nnnorm_smul]) + (μ.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation = μ.variation := by + apply variation_transpose_eq + simp [nnnorm_smul, mul_comm] + +/-- Control of the variation of the vector measure which appears in the integral of a vector +function with respect to a signed measure. -/ +@[simp] lemma variation_transpose_lsmul_flip [Nontrivial E] {μ : SignedMeasure X} : + (μ.transpose (ContinuousLinearMap.lsmul ℝ ℝ (E := E)).flip).variation = μ.variation := by + apply variation_transpose_eq + simp [nnnorm_smul, mul_comm] /-- `f : X → E` is said to be integrable with respect to `μ` and `B` if it is integrable with respect to `(μ.transpose B).variation`. -/ @@ -224,7 +235,13 @@ protected abbrev IntegrableOn open Classical in /-- The `G`-valued integral of `E`-valued function and the `F`-valued vector measure `μ` with linear paring `B : E →L[ℝ] F →L[ℝ] G` . This is set to be `0` if `G` is not complete or if `f` is not -integrable with respect to `(μ.transpose B).variation`. -/ +integrable with respect to `(μ.transpose B).variation`. + +When `μ` is a signed measure, to get the integral in `G` of a `G`-valued function, take +`B = (ContinousLinearMap.lsmul ℝ ℝ).flip`. +When `μ` is `G`-valued, to get the integral in `G` of a real-valued function, take +`B = ContinousLinearMap.lsmul ℝ ℝ`. +-/ noncomputable def integral (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : G := setToFun (μ.transpose B).variation (μ.transpose B) (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f @@ -247,6 +264,9 @@ notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂•"μ:70 => variable {μ ν B} +lemma integral_eq_setToFun : ∫ᵛ x, f x ∂[B; μ] = setToFun (μ.transpose B).variation (μ.transpose B) + (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f := by rfl + @[simp] lemma integrable_zero_vectorMeasure : (0 : VectorMeasure X F).Integrable f B := by simp [VectorMeasure.Integrable, transpose] @@ -377,6 +397,18 @@ theorem exists_ne_zero_of_integral_ne_zero (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ a, f a ≠ 0 := (frequently_ae_ne_zero_of_integral_ne_zero h).exists +@[simp] lemma integral_toSignedMeasure {μ : Measure X} [IsFiniteMeasure μ] {f : X → G} : + ∫ᵛ x, f x ∂[(ContinuousLinearMap.lsmul ℝ ℝ).flip; μ.toSignedMeasure] = ∫ x, f x ∂μ := by + rcases subsingleton_or_nontrivial G with h'G | h'G + · apply Subsingleton.elim + rw [integral_eq_setToFun, MeasureTheory.integral_eq_setToFun] + simp only [variation_transpose_lsmul_flip, variation_toSignedMeasure] + apply setToFun_congr_left' _ _ (fun s hs h's ↦ ?_) + simp only [transpose, ContinuousLinearMap.flip_flip, mapRange_apply, + Measure.toSignedMeasure_apply, hs, ↓reduceIte, LinearMap.toAddMonoidHom_coe, + ContinuousLinearMap.coe_coe, weightedSMul] + rfl + /-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: it tends to zero as `(μ.transpose B).variation s` tends to zero. -/ theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 4e1932849a0ef2..ca9a4bd61bc162 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -1,7 +1,7 @@ /- -Copyright (c) 2020 Zhouhang Zhou. All rights reserved. +Copyright (c) 2026 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Zhouhang Zhou, Yury Kudryashov +Authors: Sébastien Gouëzel -/ module @@ -443,4 +443,10 @@ theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} apply norm_setIntegral_le_of_norm_le_const_ae filter_upwards [ae_restrict_mem hs] with x hx using hC x hx +@[simp] theorem setIntegral_toSignedMeasure {μ : Measure X} [IsFiniteMeasure μ] + {f : X → G} {s : Set X} (hs : MeasurableSet s) : + ∫ᵛ x in s, f x ∂[(ContinuousLinearMap.lsmul ℝ ℝ).flip; μ.toSignedMeasure] + = ∫ x in s, f x ∂μ := by + rw [← integral_toSignedMeasure, restrict_toSignedMeasure hs] + end MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index ff2e7c9b387cbb..d74cb0ce0639f1 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -318,6 +318,15 @@ instance {x : X} {v : V} : IsFiniteMeasure (VectorMeasure.dirac x v).variation : simp only [variation_dirac, enorm_eq_nnnorm, Measure.coe_nnreal_smul] infer_instance +@[simp] lemma variation_toSignedMeasure {μ : Measure X} [IsFiniteMeasure μ] : + variation μ.toSignedMeasure = μ := by + apply le_antisymm + · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + simp [Measure.toSignedMeasure_apply, hs, Measure.real, Real.enorm_eq_ofReal] + · apply Measure.le_iff.2 (fun s hs ↦ ?_) + apply le_trans ?_ (enorm_measure_le_variation _ _) + simp [Measure.toSignedMeasure_apply, hs, Measure.real, Real.enorm_eq_ofReal] + end NormedAddCommGroup end MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index ff71f611d082cf..1cb210c54b18aa 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -311,34 +311,8 @@ lemma variation_withDensity [CompleteSpace G] simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, ENNReal.coe_div, ENNReal.coe_ofNat, δ] rw [ENNReal.mul_div_cancel (by simp) (by simp)] -/- TODO: move -/ -@[simp] lemma variation_toSignedMeasure {μ : Measure X} [IsFiniteMeasure μ] : - variation μ.toSignedMeasure = μ := by - apply le_antisymm - · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) - simp [Measure.toSignedMeasure_apply, hs, Measure.real, Real.enorm_eq_ofReal] - · apply Measure.le_iff.2 (fun s hs ↦ ?_) - apply le_trans ?_ (enorm_measure_le_variation _ _) - simp [Measure.toSignedMeasure_apply, hs, Measure.real, Real.enorm_eq_ofReal] - -#check variation_transpose_le - -@[simp] lemma foo {μ : Measure X} [IsFiniteMeasure μ] {f : X → G} : - ∫ᵛ x, f x ∂[(ContinuousLinearMap.lsmul ℝ ℝ).flip ; μ.toSignedMeasure] - = ∫ x, f x ∂μ := by - by_cases hG : CompleteSpace G; swap - · simp [integral_of_not_completeSpace, hG] - sorry - by_cases hf : Integrable f μ; swap - · rw [integral_undef, MeasureTheory.integral_undef hf] - simp [VectorMeasure.Integrable, transpose] - rw [variation_transpose_map_le] - - -#exit - - -lemma variation_withDensityᵥ {μ : Measure X} {f : X → E} (hf : Integrable f μ) : +lemma variation_withDensityᵥ [CompleteSpace E] + {μ : Measure X} {f : X → E} (hf : Integrable f μ) : (μ.withDensityᵥ f).variation = μ.withDensity (fun x ↦ ‖f x‖ₑ) := by have : IsFiniteMeasure (μ.withDensity fun x ↦ ‖f x‖ₑ) := ⟨by simpa using hf.2⟩ have : μ.withDensityᵥ f = (μ.withDensity (‖f ·‖ₑ)).toSignedMeasure.withDensity @@ -353,6 +327,25 @@ lemma variation_withDensityᵥ {μ : Measure X} {f : X → E} (hf : Integrable f · apply AEStronglyMeasurable.mono_ac (withDensity_absolutelyContinuous _ _) exact hf.aestronglyMeasurable.norm.inv₀.smul hf.aestronglyMeasurable · filter_upwards with x using by simp [norm_smul, inv_mul_le_one] + · rw [setIntegral_toSignedMeasure hs, + setIntegral_withDensity_eq_setIntegral_toReal_smul₀ _ _ _ hs]; rotate_left + · exact hf.aestronglyMeasurable.restrict.enorm + · filter_upwards with x using by simp + congr with x + rcases eq_or_ne (f x) 0 with hx | hx + · simp [hx] + · simp only [toReal_enorm, smul_smul] + rw [mul_inv_cancel₀, one_smul] + simpa using hx + rw [this, variation_withDensity]; rotate_left + · sorry + · simp [norm_smul, ContinuousLinearMap.lsmul] + rw [norm_lsmul] + + + + + From f8ab95569590252a0fc42e36161add03c4ee0c6e Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 26 May 2026 19:10:04 +0200 Subject: [PATCH 065/129] shorten line --- Mathlib/Analysis/Normed/Operator/Mul.lean | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Mathlib/Analysis/Normed/Operator/Mul.lean b/Mathlib/Analysis/Normed/Operator/Mul.lean index bf67aadb0c46ba..aeae6722dfa53d 100644 --- a/Mathlib/Analysis/Normed/Operator/Mul.lean +++ b/Mathlib/Analysis/Normed/Operator/Mul.lean @@ -264,8 +264,9 @@ theorem opNorm_lsmul [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Module R E] This is `ContinuousLinearMap.opNorm_lsmul_apply_le` as an equality. -/ @[simp] -theorem opNorm_lsmul_apply [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Module R E] [NormSMulClass R E] - [IsScalarTower 𝕜 R E] [Nontrivial E] {a : R} : ‖(lsmul 𝕜 R a : E →L[𝕜] E)‖ = ‖a‖ := by +theorem opNorm_lsmul_apply [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Module R E] + [NormSMulClass R E] [IsScalarTower 𝕜 R E] [Nontrivial E] {a : R} : + ‖(lsmul 𝕜 R a : E →L[𝕜] E)‖ = ‖a‖ := by refine ContinuousLinearMap.opNorm_eq_of_bounds (norm_nonneg _) (fun x => ?_) fun N _ h => ?_ · simp [norm_smul] obtain ⟨y, hy⟩ := exists_ne (0 : E) From 2d838022d2cb9eaf23e58fe3a5ebea1626e4204c Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 26 May 2026 21:51:29 +0200 Subject: [PATCH 066/129] fix --- Mathlib/MeasureTheory/VectorMeasure/Basic.lean | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index 5d2279ec41ea00..b80ec09acfbc2d 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -123,14 +123,6 @@ theorem ext_iff (v w : VectorMeasure α M) : v = w ↔ ∀ i : Set α, Measurabl theorem ext {s t : VectorMeasure α M} (h : ∀ i : Set α, MeasurableSet i → s i = t i) : s = t := (ext_iff s t).2 h -@[nontriviality] -lemma apply_eq_zero_of_isEmpty [IsEmpty α] (v : VectorMeasure α M) (s : Set α) : - v s = 0 := by - rw [eq_empty_of_isEmpty s, empty] - -instance instSubsingleton [IsEmpty α] : Subsingleton (VectorMeasure α M) := - ⟨fun μ ν => by ext1 s _; rw [apply_eq_zero_of_isEmpty, apply_eq_zero_of_isEmpty]⟩ - variable [Countable β] {v : VectorMeasure α M} {f : β → Set α} theorem hasSum_of_disjoint_iUnion (hm : ∀ i, MeasurableSet (f i)) (hd : Pairwise (Disjoint on f)) : @@ -307,9 +299,6 @@ theorem coe_zero : ⇑(0 : VectorMeasure α M) = 0 := rfl theorem zero_apply (i : Set α) : (0 : VectorMeasure α M) i = 0 := rfl -theorem eq_zero_of_isEmpty [IsEmpty α] (v : VectorMeasure α M) : v = 0 := - Subsingleton.elim v 0 - variable [ContinuousAdd M] /-- The sum of two vector measure is a vector measure. -/ From ca9e4b7c1ac56843c8e0f808f2a5442f8715e179 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Tue, 26 May 2026 22:44:34 +0200 Subject: [PATCH 067/129] fix --- .../MeasureTheory/VectorMeasure/Integral.lean | 302 ++++++------------ 1 file changed, 102 insertions(+), 200 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 6c0062f1c4b528..4bdf8a73a335ae 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -121,7 +121,8 @@ end cbmApplyMeasure namespace VectorMeasure -variable (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) {f g : X → E} {φ : X → Y} +variable (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) {C : E →L[ℝ] F →L[ℝ] G} + {f g : X → E} {φ : X → Y} @[simp] lemma transpose_zero : (0 : VectorMeasure X F).transpose B = 0 := by simp [transpose] @@ -267,43 +268,10 @@ variable {μ ν B} lemma integral_eq_setToFun : ∫ᵛ x, f x ∂[B; μ] = setToFun (μ.transpose B).variation (μ.transpose B) (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f := by rfl -@[simp] lemma integrable_zero_vectorMeasure : (0 : VectorMeasure X F).Integrable f B := by - simp [VectorMeasure.Integrable, transpose] - -lemma integrable_add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : - (μ + ν).Integrable f B := by - apply Integrable.mono_measure (integrable_add_measure.2 ⟨hμ, hν⟩) - grw [transpose_add, variation_add_le] - -lemma integrable_finsetSum_vectorMeasure {ι : Type*} {μ : ι → VectorMeasure X F} {s : Finset ι} - (h : ∀ i ∈ s, (μ i).Integrable f B) : - (∑ i ∈ s, μ i).Integrable f B := by - classical - induction s using Finset.induction_on with - | empty => simp - | insert a s ha ih => - simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, - Finset.sum_insert] at h ⊢ - exact integrable_add_vectorMeasure h.1 (ih h.2) - -lemma Integrable.restrict (hf : μ.Integrable f B) {s : Set X} : - (μ.restrict s).Integrable f B := by - by_cases hs : MeasurableSet s - · simp only [VectorMeasure.Integrable, transpose_restrict, variation_restrict hs] - exact MeasureTheory.Integrable.restrict hf - · simp [restrict_not_measurable _ hs] - -@[simp] theorem integral_zero_vectorMeasure : ∫ᵛ x, f x ∂[B; (0 : VectorMeasure X F)] = 0 := by - apply setToFun_zero_left' - simp [transpose] - theorem integral_of_not_completeSpace (hG : ¬CompleteSpace G) : ∫ᵛ x, f x ∂[B; μ] = 0 := by simp [integral, setToFun, hG] -theorem integral_fun_add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : - ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := - setToFun_add (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg variable {f g : X → E} {μ ν : VectorMeasure X F} {B C : E →L[ℝ] F →L[ℝ] G} @[simp] @@ -373,71 +341,46 @@ section Function theorem integral_undef (h : ¬ μ.Integrable f B) : ∫ᵛ x, f x ∂[B; μ] = 0 := by - by_cases hG : CompleteSpace G - · simp [integral, setToFun_undef _ h] - · simp [integral, hG] + simp [integral, setToFun_undef _ h] @[simp] -theorem integral_zero : ∫ᵛ _, 0 ∂[B; μ] = 0 := by - by_cases hG : CompleteSpace G - · simp only [integral, hG] - exact setToFun_zero (dominatedFinMeasAdditive_cbmApplyMeasure μ B) - · simp [integral, hG] +theorem integral_zero : ∫ᵛ _, 0 ∂[B; μ] = 0 := + setToFun_zero _ theorem integral_congr_ae (h : f =ᵐ[(μ.transpose B).variation] g) : - ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x, g x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG] - exact setToFun_congr_ae (dominatedFinMeasAdditive_cbmApplyMeasure μ B) h - · simp [integral, hG] + ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x, g x ∂[B; μ] := + setToFun_congr_ae _ h theorem integral_eq_zero_of_ae (hf : f =ᵐ[(μ.transpose B).variation] 0) : ∫ᵛ x, f x ∂[B; μ] = 0 := by simp [integral_congr_ae hf] theorem integral_fun_add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : - ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG] - exact setToFun_add (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg - · simp [integral, hG] + ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := + setToFun_add _ hf hg theorem integral_add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, (f + g) x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := integral_fun_add hf hg theorem integral_finsetSum (s : Finset ι) {f : ι → X → E} (hf : ∀ i ∈ s, μ.Integrable (f i) B) : - ∫ᵛ x, ∑ i ∈ s, f i x ∂[B; μ] = ∑ i ∈ s, ∫ᵛ x, f i x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG] - exact setToFun_finsetSum (dominatedFinMeasAdditive_cbmApplyMeasure μ B) s hf - · simp [integral, hG] + ∫ᵛ x, ∑ i ∈ s, f i x ∂[B; μ] = ∑ i ∈ s, ∫ᵛ x, f i x ∂[B; μ] := + setToFun_finsetSum _ s hf variable (f μ B) in @[integral_simps] theorem integral_fun_neg (f : X → E) : ∫ᵛ x, -f x ∂[B; μ]= -∫ᵛ x, f x ∂[B; μ] := - setToFun_neg (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f -theorem integral_fun_neg : - ∫ᵛ x, -f x ∂[B; μ]= -∫ᵛ x, f x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, ↓reduceDIte, transpose_eq_cbmApplyMeasure] - exact setToFun_neg (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f - · simp [integral, hG] + setToFun_neg _ f variable (f μ B) in @[integral_simps] theorem integral_neg : - ∫ᵛ x, (-f) x ∂[B; μ] = -∫ᵛ x, f x ∂[B; μ] := integral_fun_neg f μ B + ∫ᵛ x, (-f) x ∂[B; μ] = -∫ᵛ x, f x ∂[B; μ] := integral_fun_neg μ B f theorem integral_fun_sub (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, f x - g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := - setToFun_sub (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg - ∫ᵛ x, f x - g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG] - exact setToFun_sub (dominatedFinMeasAdditive_cbmApplyMeasure μ B) hf hg - · simp [integral, hG] + setToFun_sub _ hf hg theorem integral_sub (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, (f - g) x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := integral_fun_sub hf hg @@ -446,80 +389,113 @@ variable (f μ B) in @[integral_simps] theorem integral_fun_smul (c : ℝ) (f : X → E) : ∫ᵛ x, c • f x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := - setToFun_smul (dominatedFinMeasAdditive_cbmApplyMeasure μ B) (by simp) c f -theorem integral_fun_smul (c : ℝ) : - ∫ᵛ x, c • f x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG] - exact setToFun_smul (dominatedFinMeasAdditive_cbmApplyMeasure μ B) (by simp) c f - · simp [integral, hG] + setToFun_smul _ (by simp) c f variable (f μ B) in @[integral_simps] theorem integral_smul (c : ℝ) : - ∫ᵛ x, (c • f) x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := integral_fun_smul f μ B c + ∫ᵛ x, (c • f) x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := integral_fun_smul μ B c f end Function section VectorMeasure -variable (f μ B) in +@[simp] lemma integrable_zero_vectorMeasure : (0 : VectorMeasure X F).Integrable f B := by + simp [VectorMeasure.Integrable, transpose] + +lemma integrable_add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : + (μ + ν).Integrable f B := by + apply Integrable.mono_measure (integrable_add_measure.2 ⟨hμ, hν⟩) + grw [transpose_add, variation_add_le] + +lemma integrable_finsetSum_vectorMeasure {ι : Type*} {μ : ι → VectorMeasure X F} {s : Finset ι} + (h : ∀ i ∈ s, (μ i).Integrable f B) : + (∑ i ∈ s, μ i).Integrable f B := by + classical + induction s using Finset.induction_on with + | empty => simp + | insert a s ha ih => + simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, + Finset.sum_insert] at h ⊢ + exact integrable_add_vectorMeasure h.1 (ih h.2) + +lemma Integrable.restrict (hf : μ.Integrable f B) {s : Set X} : + (μ.restrict s).Integrable f B := by + by_cases hs : MeasurableSet s + · simp only [VectorMeasure.Integrable, transpose_restrict, variation_restrict hs] + exact MeasureTheory.Integrable.restrict hf + · simp [restrict_not_measurable _ hs] + @[simp] theorem integral_zero_vectorMeasure : ∫ᵛ x, f x ∂[B; (0 : VectorMeasure X F)] = 0 := by simp [integral] lemma integral_of_isEmpty [IsEmpty X] : ∫ᵛ x, f x ∂[B; μ] = 0 := by simp [eq_zero_of_isEmpty] +@[simp] +theorem integral_smul_vectorMeasure (f : X → E) (c : ℝ) : + ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := by + by_cases hG : CompleteSpace G; swap + · simp [integral, setToFun, hG] + simp_rw [integral, ← setToFun_smul_left] + have : ((c • μ).transpose B).variation = ‖c‖₊ • (μ.transpose B).variation := by + simp [transpose, mapRange_smul, variation_smul] + simp only [this, mul_one] + have : DominatedFinMeasAdditive (μ.transpose B).variation ((c • μ).transpose B) ‖c‖ := by + simp only [transpose_smul, coe_smul, Real.norm_eq_abs] + simpa [← transpose_eq_cbmApplyMeasure] using + (dominatedFinMeasAdditive_cbmApplyMeasure μ B).smul c + rw! [← setToFun_congr_smul_measure' _ this, transpose_smul] + rfl + theorem integral_add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : - ∫ᵛ x, f x ∂[B; μ + ν] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, ↓reduceDIte, transpose_add_vectorMeasure, coe_add, - transpose_eq_cbmApplyMeasure, ← setToFun_add_measure - (dominatedFinMeasAdditive_cbmApplyMeasure μ B) - (dominatedFinMeasAdditive_cbmApplyMeasure ν B) hμ hν] - refine (setToFun_congr_measure_of_integrable 1 ENNReal.one_ne_top ?_ _ _ f ?_).symm - · simpa using variation_add_le - · exact hμ.add_measure hν - · simp [integral, hG] + ∫ᵛ x, f x ∂[B; μ + ν] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := + setToFun_add_left'' (by simp [transpose]) hμ hν (by grw [transpose_add, variation_add_le]) + zero_le_one zero_le_one zero_le_one theorem integral_finsetSum_vectorMeasure {μ : ι → VectorMeasure X F} {s : Finset ι} (hf : ∀ i ∈ s, (μ i).Integrable f B) : ∫ᵛ x, f x ∂[B; ∑ i ∈ s, μ i] = ∑ i ∈ s, ∫ᵛ x, f x ∂[B; μ i] := by - by_cases hG : CompleteSpace G - · by_cases! hs : s.Nonempty - · simp only [integral, hG, ↓reduceDIte, transpose_finsetSum_vectorMeasure, coe_finsetSum, - transpose_eq_cbmApplyMeasure, ← setToFun_finsetSum_measure hs - (fun i ↦ dominatedFinMeasAdditive_cbmApplyMeasure (μ i) B) hf] - refine (setToFun_congr_measure_of_integrable 1 ENNReal.one_ne_top ?_ _ _ f ?_).symm - · simpa using variation_finsetSum_le s _ - · exact integrable_finsetSum_measure.2 hf - · simp_all - · simp [integral, hG] + classical + induction s using Finset.induction_on with + | empty => simp + | insert a s ha ih => + simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, + Finset.sum_insert] at hf ⊢ + rw [integral_add_vectorMeasure hf.1 (integrable_finsetSum_vectorMeasure hf.2), ih hf.2] -variable (f μ B) in @[integral_simps] theorem integral_neg_vectorMeasure : ∫ᵛ x, f x ∂[B; -μ] = -∫ᵛ x, f x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp [integral, hG, ← setToFun_neg'] - · simp [integral, hG] + simp [integral, ← setToFun_neg'] theorem integral_sub_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : ∫ᵛ x, f x ∂[B; μ - ν] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, f x ∂[B; ν] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, ↓reduceDIte, transpose_sub_vectorMeasure, coe_sub, - transpose_eq_cbmApplyMeasure, ← setToFun_sub_measure - (dominatedFinMeasAdditive_cbmApplyMeasure μ B) - (dominatedFinMeasAdditive_cbmApplyMeasure ν B) hμ hν] - refine (setToFun_congr_measure_of_integrable 1 ENNReal.one_ne_top ?_ _ _ f ?_).symm - · simpa using variation_sub_le - · exact hμ.add_measure hν - · simp [integral, hG] + rw [sub_eq_add_neg, integral_add_vectorMeasure hμ, integral_neg_vectorMeasure, ← sub_eq_add_neg] + simpa [VectorMeasure.Integrable] using hν end VectorMeasure section cbm +@[simp] lemma integrable_zero_cbm : μ.Integrable f (0 : E →L[ℝ] F →L[ℝ] G) := by + simp [VectorMeasure.Integrable] + +lemma integrable_add_cbm (hB : μ.Integrable f B) (hC : μ.Integrable f C) : + μ.Integrable f (B + C) := by + apply Integrable.mono_measure (integrable_add_measure.2 ⟨hB, hC⟩) + grw [transpose_add_cbm, variation_add_le] + +lemma integrable_finsetSum_cbm {ι : Type*} {B : ι → E →L[ℝ] F →L[ℝ] G} {s : Finset ι} + (h : ∀ i ∈ s, μ.Integrable f (B i)) : μ.Integrable f (∑ i ∈ s, B i) := by + classical + induction s using Finset.induction_on with + | empty => simp + | insert a s ha ih => + simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, + Finset.sum_insert] at h ⊢ + exact integrable_add_cbm h.1 (ih h.2) + variable (f μ) in @[simp] theorem integral_zero_cbm : @@ -527,59 +503,33 @@ theorem integral_zero_cbm : simp [integral] theorem integral_add_cbm (hB : μ.Integrable f B) (hC : μ.Integrable f C) : - ∫ᵛ x, f x ∂[B + C; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[C; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, ↓reduceDIte, transpose_add_cbm, coe_add, transpose_eq_cbmApplyMeasure, - ← setToFun_add_measure (dominatedFinMeasAdditive_cbmApplyMeasure μ B) - (dominatedFinMeasAdditive_cbmApplyMeasure μ C) hB hC] - refine (setToFun_congr_measure_of_integrable 1 ENNReal.one_ne_top ?_ _ _ f ?_).symm - · simpa using variation_add_le - · exact hB.add_measure hC - · simp [integral, hG] + ∫ᵛ x, f x ∂[B + C; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[C; μ] := + setToFun_add_left'' (by simp [transpose]) hB hC (by simp [variation_add_le]) + zero_le_one zero_le_one zero_le_one theorem integral_finsetSum_cbm {B : ι → E →L[ℝ] F →L[ℝ] G} {s : Finset ι} (hf : ∀ i ∈ s, μ.Integrable f (B i)) : ∫ᵛ x, f x ∂[∑ i ∈ s, B i; μ] = ∑ i ∈ s, ∫ᵛ x, f x ∂[B i; μ] := by - by_cases hG : CompleteSpace G - · by_cases! hs : s.Nonempty - · simp only [integral, hG, ↓reduceDIte, transpose_finsetSum_cbm, coe_finsetSum, - transpose_eq_cbmApplyMeasure, ← setToFun_finsetSum_measure hs - (fun i ↦ dominatedFinMeasAdditive_cbmApplyMeasure μ (B i)) hf] - refine (setToFun_congr_measure_of_integrable 1 ENNReal.one_ne_top ?_ _ _ f ?_).symm - · simpa using variation_finsetSum_le s _ - · exact integrable_finsetSum_measure.2 hf - · simp_all - · simp [integral, hG] + classical + induction s using Finset.induction_on with + | empty => simp + | insert a s ha ih => + simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, + Finset.sum_insert] at hf ⊢ + rw [integral_add_cbm hf.1 (integrable_finsetSum_cbm hf.2), ih hf.2] @[integral_simps] theorem integral_neg_cbm : ∫ᵛ x, f x ∂[-B; μ] = -∫ᵛ x, f x ∂[B; μ] := by - by_cases hG : CompleteSpace G - · simp [integral, hG, ← setToFun_neg'] - · simp [integral, hG] + simp [integral, ← setToFun_neg'] theorem integral_sub_cbm (hB : μ.Integrable f B) (hC : μ.Integrable f C) : ∫ᵛ x, f x ∂[B - C; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, f x ∂[C; μ] := by - by_cases hG : CompleteSpace G - · simp only [integral, hG, ↓reduceDIte, transpose_sub_cbm, coe_sub, - transpose_eq_cbmApplyMeasure, ← setToFun_sub_measure - (dominatedFinMeasAdditive_cbmApplyMeasure μ B) - (dominatedFinMeasAdditive_cbmApplyMeasure μ C) hB hC] - refine (setToFun_congr_measure_of_integrable 1 ENNReal.one_ne_top ?_ _ _ f ?_).symm - · simpa using variation_sub_le - · exact hB.add_measure hC - · simp [integral, hG] + rw [sub_eq_add_neg, integral_add_cbm hB, integral_neg_cbm, ← sub_eq_add_neg] + simpa [VectorMeasure.Integrable] using hC end cbm -theorem integral_finsetSum {ι} (s : Finset ι) {f : ι → X → E} (hf : ∀ i ∈ s, μ.Integrable (f i) B) : - ∫ᵛ a, ∑ i ∈ s, f i a ∂[B; μ] = ∑ i ∈ s, ∫ᵛ a, f i a ∂[B; μ] := - setToFun_finsetSum _ s hf - -theorem integral_undef (hf : ¬ μ.Integrable f B) : - ∫ᵛ x, f x ∂[B; μ] = 0 := - setToFun_undef _ hf - theorem Integrable.of_integral_ne_zero (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : μ.Integrable f B := Not.imp_symm integral_undef h @@ -588,18 +538,10 @@ theorem integral_non_aestronglyMeasurable {f : X → E} ∫ᵛ a, f a ∂[B; μ] = 0 := integral_undef <| not_and_of_not_left _ h -@[simp] -theorem integral_zero : ∫ᵛ _, (0 : E) ∂[B; μ] = (0 : G) := - setToFun_zero _ - lemma integral_indicator₂ {β : Type*} (f : β → X → E) (s : Set β) (b : β) : ∫ᵛ y, s.indicator (f · y) b ∂[B; μ] = s.indicator (fun x ↦ ∫ᵛ y, f x y ∂[B; μ]) b := by by_cases hb : b ∈ s <;> simp [hb] -theorem integral_congr_ae (h : f =ᵐ[(μ.transpose B).variation] g) : - ∫ᵛ a, f a ∂[B; μ] = ∫ᵛ a, g a ∂[B; μ] := - setToFun_congr_ae _ h - theorem norm_integral_le_lintegral_norm : ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation) := (norm_setToFun_le_toReal _ (by simp)).trans (by simp) @@ -620,10 +562,6 @@ theorem edist_integral_le_lintegral_edist (hf : μ.Integrable f B) (hg : μ.Inte rw [edist_dist] exact ENNReal.ofReal_le_of_le_toReal (dist_integral_le_lintegral_edist hf hg) -theorem integral_eq_zero_of_ae (hf : f =ᵐ[(μ.transpose B).variation] 0) : - ∫ᵛ a, f a ∂[B; μ] = 0 := by - simp [integral_congr_ae hf, integral_zero] - theorem frequently_ae_ne_zero_of_integral_ne_zero (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ᶠ a in ae (μ.transpose B).variation, f a ≠ 0 := fun h' ↦ h (integral_eq_zero_of_ae (h'.mono fun _ ↦ not_not.mp)) @@ -773,12 +711,6 @@ theorem enorm_integral_le_of_enorm_le_const ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ C * (μ.transpose B).variation univ := enorm_integral_le_lintegral_enorm.trans ((lintegral_mono_ae h).trans (by simp)) -theorem integral_add_vectorMeasure {ν : VectorMeasure X F} - (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : - ∫ᵛ x, f x ∂[B; (μ + ν)] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := - setToFun_add_left'' (by simp [transpose]) hμ hν (by grw [transpose_add, variation_add_le]) - zero_le_one zero_le_one zero_le_one - theorem setIntegral_vectorMeasure_zero (f : X → E) {s : Set X} (hs : (μ.transpose B).variation s = 0) : ∫ᵛ x in s, f x ∂[B; μ] = 0 := by @@ -790,20 +722,6 @@ theorem setIntegral_vectorMeasure_zero (f : X → E) {s : Set X} have : (μ.restrict s).transpose B = 0 := variation_eq_zero.1 this simp [integral, this] -lemma integral_of_isEmpty [IsEmpty X] : ∫ᵛ x, f x ∂[B; μ] = 0 := - μ.eq_zero_of_isEmpty ▸ integral_zero_vectorMeasure - -theorem integral_finsetSum_vectorMeasure {ι : Type*} {μ : ι → VectorMeasure X F} - {s : Finset ι} (hf : ∀ i ∈ s, (μ i).Integrable f B) : - ∫ᵛ a, f a ∂[B; ∑ i ∈ s, μ i] = ∑ i ∈ s, ∫ᵛ a, f a ∂[B; μ i] := by - classical - induction s using Finset.induction_on with - | empty => simp - | insert a s ha ih => - simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, - Finset.sum_insert] at hf ⊢ - rw [integral_add_vectorMeasure hf.1 (integrable_finsetSum_vectorMeasure hf.2), ih hf.2] - theorem nndist_integral_add_vectorMeasure_le_lintegral (h₁ : μ.Integrable f B) (h₂ : ν.Integrable f B) : (nndist (∫ᵛ x, f x ∂[B; μ]) (∫ᵛ x, f x ∂[B; (μ + ν)]) : ℝ≥0∞) ≤ @@ -811,22 +729,6 @@ theorem nndist_integral_add_vectorMeasure_le_lintegral rw [integral_add_vectorMeasure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel_left] exact enorm_integral_le_lintegral_enorm -@[simp] -theorem integral_smul_vectorMeasure (f : X → E) (c : ℝ) : - ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := by - by_cases hG : CompleteSpace G; swap - · simp [integral, setToFun, hG] - simp_rw [integral, ← setToFun_smul_left] - have : ((c • μ).transpose B).variation = ‖c‖₊ • (μ.transpose B).variation := by - simp [transpose, mapRange_smul, variation_smul] - simp only [this, mul_one] - have : DominatedFinMeasAdditive (μ.transpose B).variation ((c • μ).transpose B) ‖c‖ := by - simp only [transpose_smul, coe_smul, Real.norm_eq_abs] - simpa [← transpose_eq_cbmApplyMeasure] using - (dominatedFinMeasAdditive_cbmApplyMeasure μ B).smul c - rw! [← setToFun_congr_smul_measure' _ this, transpose_smul] - rfl - @[simp] theorem integral_smul_nnreal_vectorMeasure (f : X → E) (c : ℝ≥0) : ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := From 67bd65f0b45232650b828a5e94bd2b029547d73b Mon Sep 17 00:00:00 2001 From: sgouezel Date: Wed, 27 May 2026 09:52:38 +0200 Subject: [PATCH 068/129] finish proof --- .../VectorMeasure/WithDensityVec.lean | 81 +++++++++++++------ 1 file changed, 56 insertions(+), 25 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index 1cb210c54b18aa..e27fc34264b917 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -55,7 +55,7 @@ lemma withDensity_zero_vectorMeasure : (0 : VectorMeasure X F).withDensity f B = ext s hs simp [withDensity_apply] -@[simp] +@[to_fun (attr := simp) withDensity_fun_zero] lemma withDensity_zero : μ.withDensity 0 B = 0 := by ext s hs simp [withDensity_apply] @@ -92,8 +92,10 @@ density `f` wrt `μ` is the measure with density `‖f‖ₑ` with respect to th The condition on `B` is necessary: for a counterexample without it, let `B` be the scalar product in `ℝ²` and `f x` everywhere horizontal and `μ s` everywhere vertical. Then `μ.withDensity f B = 0` so its variation is zero, while the integral of `‖f‖ₑ` is not. + +See also `variation_withDensity` under the very common condition `‖B x y‖ = ‖x‖ ‖y‖`. -/ -lemma variation_withDensity [CompleteSpace G] +lemma variation_withDensity' [CompleteSpace G] (hf : μ.Integrable f B) (hB : ∀ x y, ‖B x y‖₊ = ‖B.flip y‖₊ * ‖x‖₊) : (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by apply le_antisymm variation_WithDensity_le @@ -311,37 +313,66 @@ lemma variation_withDensity [CompleteSpace G] simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, ENNReal.coe_div, ENNReal.coe_ofNat, δ] rw [ENNReal.mul_div_cancel (by simp) (by simp)] +/-- If `‖B x y‖ = ‖x‖ * ‖y‖` for all `x, y`, then the variation of a vector measure with +density `f` wrt `μ` is the measure with density `‖f‖ₑ` with respect to the variation of `μ`. + +The condition on `B` is necessary: for a counterexample without it, let `B` be the scalar +product in `ℝ²` and `f x` everywhere horizontal and `μ s` everywhere vertical. +Then `μ.withDensity f B = 0` so its variation is zero, while the integral of `‖f‖ₑ` is not. +-/ +lemma variation_withDensity [CompleteSpace G] + (hf : μ.Integrable f B) (hB : ∀ x y, ‖B x y‖₊ = ‖x‖₊ * ‖y‖₊) : + (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by + apply variation_withDensity' hf (fun x y ↦ ?_) + refine le_antisymm (ContinuousLinearMap.le_opNorm (B.flip y) x) ?_ + rw [hB, mul_comm] + gcongr + apply ContinuousLinearMap.opNNNorm_le_bound + simp [hB, mul_comm] + +/-- The variation of a vecture measure with density `f` with respect to a positive measure `μ` +is the measure with density `‖f‖ₑ` with respect to `μ`. -/ lemma variation_withDensityᵥ [CompleteSpace E] {μ : Measure X} {f : X → E} (hf : Integrable f μ) : (μ.withDensityᵥ f).variation = μ.withDensity (fun x ↦ ‖f x‖ₑ) := by + /- We deduce this statement from the statement `variation_withDensity` for vector measures + with density. For this, we write `μ.withDensityᵥ f` as the vector measure with density `f / ‖f‖` + with respect to the measure `μ.withDensity ‖f‖` interpreted as a signed measure. -/ + rcases subsingleton_or_nontrivial E with hE | hE + · simp [show f = 0 from Subsingleton.elim _ _] have : IsFiniteMeasure (μ.withDensity fun x ↦ ‖f x‖ₑ) := ⟨by simpa using hf.2⟩ + have I : (μ.withDensity fun x ↦ ‖f x‖ₑ).toSignedMeasure.Integrable (fun x ↦ ‖f x‖⁻¹ • f x) + (ContinuousLinearMap.lsmul ℝ ℝ).flip := by + apply Integrable.mono_measure _ (variation_transpose_le _ _) + apply Integrable.smul_measure_nnreal + simp only [variation_toSignedMeasure] + apply Integrable.of_bound (C := 1) + · apply AEStronglyMeasurable.mono_ac (withDensity_absolutelyContinuous _ _) + exact hf.aestronglyMeasurable.norm.inv₀.smul hf.aestronglyMeasurable + · filter_upwards with x using by simp [norm_smul, inv_mul_le_one] have : μ.withDensityᵥ f = (μ.withDensity (‖f ·‖ₑ)).toSignedMeasure.withDensity (fun x ↦ ‖f x‖⁻¹ • f x) (ContinuousLinearMap.lsmul ℝ ℝ).flip := by ext s hs - rw [withDensityᵥ_apply hf hs, withDensity_apply]; swap - · simp only [VectorMeasure.Integrable] - apply Integrable.mono_measure _ (variation_transpose_le _ _) - apply Integrable.smul_measure_nnreal - simp only [variation_toSignedMeasure] - apply Integrable.of_bound (C := 1) - · apply AEStronglyMeasurable.mono_ac (withDensity_absolutelyContinuous _ _) - exact hf.aestronglyMeasurable.norm.inv₀.smul hf.aestronglyMeasurable - · filter_upwards with x using by simp [norm_smul, inv_mul_le_one] - · rw [setIntegral_toSignedMeasure hs, + rw [withDensityᵥ_apply hf hs, withDensity_apply I, setIntegral_toSignedMeasure hs, setIntegral_withDensity_eq_setIntegral_toReal_smul₀ _ _ _ hs]; rotate_left - · exact hf.aestronglyMeasurable.restrict.enorm - · filter_upwards with x using by simp - congr with x - rcases eq_or_ne (f x) 0 with hx | hx - · simp [hx] - · simp only [toReal_enorm, smul_smul] - rw [mul_inv_cancel₀, one_smul] - simpa using hx - rw [this, variation_withDensity]; rotate_left - · sorry - · simp [norm_smul, ContinuousLinearMap.lsmul] - rw [norm_lsmul] - + · exact hf.aestronglyMeasurable.restrict.enorm + · filter_upwards with x using by simp + congr with x + rcases eq_or_ne (f x) 0 with hx | hx + · simp [hx] + simp only [toReal_enorm, smul_smul] + rw [mul_inv_cancel₀, one_smul] + simpa using hx + rw [this, variation_withDensity I (by simp [nnnorm_smul, mul_comm]), + variation_transpose_eq _ _ (by simp [nnnorm_smul, mul_comm]), variation_toSignedMeasure, + ← withDensity_mul₀ hf.aestronglyMeasurable.enorm]; swap + · exact (hf.aestronglyMeasurable.norm.inv₀.smul hf.aestronglyMeasurable).enorm + congr with x + rcases eq_or_ne (f x) 0 with hx | hx + · simp [hx] + have h'x : ‖f x‖ ≠ 0 := by simp [hx] + simp only [enorm_smul, Pi.mul_apply, ne_eq, h'x, not_false_eq_true, enorm_inv, enorm_norm] + rw [ENNReal.inv_mul_cancel (by simpa using hx) (by simp), mul_one] From f699647bb41d853a9eb1bddcdee31b1d89215bef Mon Sep 17 00:00:00 2001 From: sgouezel Date: Wed, 27 May 2026 17:06:50 +0200 Subject: [PATCH 069/129] try removing todo --- Mathlib/MeasureTheory/VectorMeasure/AddContent.lean | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index fb2c6c1681039e..8711502ecadbee 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -8,6 +8,7 @@ module public import Mathlib.Analysis.Normed.Group.InfiniteSum public import Mathlib.MeasureTheory.Measure.AddContent public import Mathlib.MeasureTheory.Measure.MeasuredSets +public import Mathlib.MeasureTheory.Measure.Trim public import Mathlib.MeasureTheory.VectorMeasure.Basic /-! @@ -316,4 +317,15 @@ theorem exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom exact ae_le_set_inter Filter.EventuallyLE.rfl (hD s hs) exact ⟨m', h, fun s ↦ (h' s).trans (Measure.restrict_apply_le (⋃₀ D) s)⟩ +#check Measure.trim_le + +theorem exists_extension_of_isSetSemiring_of_le_measure + [IsFiniteMeasure μ] {C : Set (Set α)} {m : AddContent E C} (hC : IsSetSemiring C) + (hm : ∀ s ∈ C, ‖m s‖ₑ ≤ μ s) (h'C : ∀ s ∈ C, MeasurableSet s) : + ∃ m' : VectorMeasure α E, (∀ s ∈ C, m' s = m s) ∧ ∀ s, ‖m' s‖ₑ ≤ μ s := by + let M : MeasurableSpace α := generateFrom C + have : M ≤ hα := generateFrom_le h'C + let μ' := μ.trim this + + end MeasureTheory.VectorMeasure From c785183a359cd1051bd6fc59ac3a832ae2aec675 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 28 May 2026 18:42:33 +0200 Subject: [PATCH 070/129] progress --- .../ConditionalExpectation/Basic.lean | 4 +- Mathlib/MeasureTheory/Integral/SetToL1.lean | 76 +++++++++++ .../VectorMeasure/AddContent.lean | 33 ++++- .../MeasureTheory/VectorMeasure/Integral.lean | 121 ++++++++++++++++++ 4 files changed, 227 insertions(+), 7 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index fe5c2e6d0b1168..e5095a56976eb8 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -12,7 +12,7 @@ public import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1 We build the conditional expectation of an integrable function `f` with value in a Banach space with respect to a measure `μ` (defined on a measurable space structure `m₀`) and a measurable space structure `m` with `hm : m ≤ m₀` (a sub-sigma-algebra). This is an `m`-strongly measurable -function `μ[f|hm]` which is integrable and verifies `∫ x in s, μ[f|hm] x ∂μ = ∫ x in s, f x ∂μ` +function `μ[f | m]` which is integrable and verifies `∫ x in s, μ[f | m] x ∂μ = ∫ x in s, f x ∂μ` for all `m`-measurable sets `s`. It is unique as an element of `L¹`. The construction is done in four steps: @@ -171,7 +171,7 @@ theorem condExp_of_not_integrable (hf : ¬Integrable f μ) : μ[f | m] = 0 := by swap; · rw [condExp_of_not_sigmaFinite hm hμm] rw [condExp_of_sigmaFinite, if_neg hf] -@[simp] +@[to_fun (attr := simp) condExp_fun_zero] theorem condExp_zero : μ[(0 : α → E) | m] = 0 := by by_cases hm : m ≤ m₀ swap; · rw [condExp_of_not_le hm] diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index bafe35421d50af..fd92412be1fc2b 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -5,6 +5,7 @@ Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne -/ module +public import Mathlib.MeasureTheory.Constructions.Polish.StronglyMeasurable public import Mathlib.MeasureTheory.Integral.FinMeasAdditive public import Mathlib.Analysis.Normed.Operator.Extend @@ -1308,6 +1309,81 @@ theorem tendsto_setToFun_filter_of_dominated_convergence (hT : DominatedFinMeasA refine fun a h_lin => @Tendsto.comp _ _ _ (fun n => x (n + k)) (fun n => fs n a) _ _ _ h_lin ?_ rwa [tendsto_add_atTop_iff_nat] +/-- Lebesgue dominated convergence theorem for series. -/ +theorem hasSum_setToFun_of_dominated_convergence (hT : DominatedFinMeasAdditive μ T C) + {ι} [Countable ι] {F : ι → α → E} {f : α → E} + (bound : ι → α → ℝ) (hF_meas : ∀ n, AEStronglyMeasurable (F n) μ) + (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound n a) + (bound_summable : ∀ᵐ a ∂μ, Summable fun n => bound n a) + (bound_integrable : Integrable (fun a => ∑' n, bound n a) μ) + (h_lim : ∀ᵐ a ∂μ, HasSum (fun n => F n a) (f a)) : + HasSum (fun n => setToFun μ T hT (F n)) (setToFun μ T hT f) := by + have hb_nonneg : ∀ᵐ a ∂μ, ∀ n, 0 ≤ bound n a := + eventually_countable_forall.2 fun n => (h_bound n).mono fun a => (norm_nonneg _).trans + have hb_le_tsum : ∀ n, bound n ≤ᵐ[μ] fun a => ∑' n, bound n a := by + intro n + filter_upwards [hb_nonneg, bound_summable] + with _ ha0 ha_sum using ha_sum.le_tsum _ fun i _ => ha0 i + have hF_integrable : ∀ n, Integrable (F n) μ := by + refine fun n => bound_integrable.mono' (hF_meas n) ?_ + exact EventuallyLE.trans (h_bound n) (hb_le_tsum n) + simp only [HasSum, ← setToFun_finsetSum _ _ fun n _ => hF_integrable n] + refine tendsto_setToFun_filter_of_dominated_convergence _ + (fun a => ∑' n, bound n a) ?_ ?_ bound_integrable h_lim + · exact Eventually.of_forall fun s => s.aestronglyMeasurable_fun_sum fun n _ => hF_meas n + · filter_upwards with s + filter_upwards [eventually_countable_forall.2 h_bound, hb_nonneg, bound_summable] + with a hFa ha0 has + calc + ‖∑ n ∈ s, F n a‖ ≤ ∑ n ∈ s, bound n a := norm_sum_le_of_le _ fun n _ => hFa n + _ ≤ ∑' n, bound n a := has.sum_le_tsum _ (fun n _ => ha0 n) + +theorem setToFun_tsum [CompleteSpace E] (hT : DominatedFinMeasAdditive μ T C) + {ι} [Countable ι] {f : ι → α → E} (hf : ∀ i, AEStronglyMeasurable (f i) μ) + (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖ₑ ∂μ ≠ ∞) : + setToFun μ T hT (fun a ↦ ∑' i, f i a) = ∑' i, setToFun μ T hT (f i) := by + by_cases hF : CompleteSpace F; swap + · simp [setToFun, hF] + have hf'' i : AEMeasurable (‖f i ·‖ₑ) μ := (hf i).enorm + have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by + rw [← lintegral_tsum hf''] at hf' + refine (ae_lt_top' (AEMeasurable.tsum hf'') hf').mono ?_ + intro x hx + rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe] + exact hx.ne + convert! + (MeasureTheory.hasSum_setToFun_of_dominated_convergence hT (fun i a => ‖f i a‖₊) hf _ hhh ⟨_, _⟩ + _).tsum_eq.symm + · intro n + filter_upwards with x + rfl + · fun_prop + · dsimp [HasFiniteIntegral] + have : ∫⁻ a, ∑' n, ‖f n a‖ₑ ∂μ < ⊤ := by rwa [lintegral_tsum hf'', lt_top_iff_ne_top] + convert! this using 1 + apply lintegral_congr_ae + simp_rw [← coe_nnnorm, ← NNReal.coe_tsum, enorm_eq_nnnorm, NNReal.nnnorm_eq] + filter_upwards [hhh] with a ha + exact ENNReal.coe_tsum (NNReal.summable_coe.mp ha) + · filter_upwards [hhh] with x hx + exact hx.of_norm.hasSum + +/-- Corollary of the Lebesgue dominated convergence theorem: If a sequence of functions `F n` is +(eventually) uniformly bounded by a constant and converges (eventually) pointwise to a +function `f`, then the integrals of `F n` with respect to a finite measure `μ` converge +to the integral of `f`. -/ +theorem tendsto_integral_filter_of_norm_le_const (hT : DominatedFinMeasAdditive μ T C) + {ι} {l : Filter ι} [l.IsCountablyGenerated] + {F : ι → α → E} [IsFiniteMeasure μ] {f : α → E} + (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ) + (h_bound : ∃ C, ∀ᶠ n in l, (∀ᵐ ω ∂μ, ‖F n ω‖ ≤ C)) + (h_lim : ∀ᵐ ω ∂μ, Tendsto (fun n => F n ω) l (𝓝 (f ω))) : + Tendsto (fun n => setToFun μ T hT (F n)) l (𝓝 (setToFun μ T hT f)) := by + obtain ⟨c, h_boundc⟩ := h_bound + let C : α → ℝ := (fun _ => c) + exact tendsto_setToFun_filter_of_dominated_convergence hT + C h_meas h_boundc (integrable_const c) h_lim + variable {X : Type*} [TopologicalSpace X] [FirstCountableTopology X] theorem continuousWithinAt_setToFun_of_dominated (hT : DominatedFinMeasAdditive μ T C) diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index 8711502ecadbee..677d416f3c80e9 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -5,11 +5,12 @@ Authors: Sébastien Gouëzel -/ module +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic public import Mathlib.Analysis.Normed.Group.InfiniteSum public import Mathlib.MeasureTheory.Measure.AddContent public import Mathlib.MeasureTheory.Measure.MeasuredSets public import Mathlib.MeasureTheory.Measure.Trim -public import Mathlib.MeasureTheory.VectorMeasure.Basic +public import Mathlib.MeasureTheory.VectorMeasure.Integral /-! # Constructing a vector measure from an additive content @@ -17,7 +18,7 @@ public import Mathlib.MeasureTheory.VectorMeasure.Basic Consider a content defined on a semiring of sets. We investigate in this file whether it is possible to extend it to a (countably additive) vector measure on the whole sigma-algebra. We show that this is possible when the content is dominated by a finite -measure, see `exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom`. +measure, see `exists_extension_of_isSetSemiring_of_le_measure`. -/ @[expose] public section @@ -319,13 +320,35 @@ theorem exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom #check Measure.trim_le -theorem exists_extension_of_isSetSemiring_of_le_measure +#check MeasureTheory.condExp + +#check MeasureTheory.condExp_zero + +#check MeasureTheory.integral_tsum_of_summable_integral_norm + +theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] [IsFiniteMeasure μ] {C : Set (Set α)} {m : AddContent E C} (hC : IsSetSemiring C) (hm : ∀ s ∈ C, ‖m s‖ₑ ≤ μ s) (h'C : ∀ s ∈ C, MeasurableSet s) : ∃ m' : VectorMeasure α E, (∀ s ∈ C, m' s = m s) ∧ ∀ s, ‖m' s‖ₑ ≤ μ s := by + classical let M : MeasurableSpace α := generateFrom C - have : M ≤ hα := generateFrom_le h'C - let μ' := μ.trim this + have Mle : M ≤ hα := generateFrom_le h'C + let μ' := μ.trim Mle + obtain ⟨m', m'C, hm'⟩ : + ∃ m' : VectorMeasure α E, (∀ s ∈ C, m' s = m s) ∧ ∀ s, ‖m' s‖ₑ ≤ μ' s := by + apply exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom hC (fun s hs ↦ ?_) rfl + apply (hm s hs).trans_eq + exact (MeasureTheory.trim_measurableSet_eq Mle (measurableSet_generateFrom hs)).symm + let m'' : VectorMeasure α E := + { measureOf' s := if MeasurableSet s then ∫ᵛ x, μ[s.indicator 1 | M] x ∂• m' else 0 + empty' := by simp + not_measurable' s hs := by simp [hs] + m_iUnion' f f_meas hf := by + simp only [f_meas, ↓reduceIte, implies_true, MeasurableSet.iUnion, + indicator_iUnion_of_pairwise_disjoint _ hf] + } + + end MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 4bdf8a73a335ae..768706dcba35be 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -850,6 +850,127 @@ theorem integral_unique [Unique X] [CompleteSpace G] : ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ _, f default ∂[B; μ] := by congr with x; congr; exact Unique.uniq _ x _ = B (f default) (μ univ) := by rw [integral_const] +#where + +/-- **Lebesgue dominated convergence theorem** provides sufficient conditions under which almost + everywhere convergence of a sequence of functions implies the convergence of their integrals. + We could weaken the condition `bound_integrable` to require `HasFiniteIntegral bound μ` instead + (i.e. not requiring that `bound` is measurable), but in all applications proving integrability + is easier. -/ +theorem tendsto_integral_of_dominated_convergence {F : ℕ → X → E} {f : X → E} (bound : X → ℝ) + (F_measurable : ∀ n, AEStronglyMeasurable (F n) (μ.transpose B).variation) + (bound_integrable : Integrable bound (μ.transpose B).variation) + (h_bound : ∀ n, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound a) + (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n => F n a) atTop (𝓝 (f a))) : + Tendsto (fun n => ∫ᵛ a, F n a ∂[B; μ]) atTop (𝓝 <| ∫ᵛ a, f a ∂[B; μ]) := + tendsto_setToFun_of_dominated_convergence _ bound F_measurable bound_integrable h_bound h_lim + +/-- Lebesgue dominated convergence theorem for filters with a countable basis -/ +theorem tendsto_integral_filter_of_dominated_convergence {ι} {l : Filter ι} [l.IsCountablyGenerated] + {F : ι → X → E} {f : X → E} (bound : X → ℝ) + (hF_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) (μ.transpose B).variation) + (h_bound : ∀ᶠ n in l, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound a) + (bound_integrable : Integrable bound (μ.transpose B).variation) + (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n => F n a) l (𝓝 (f a))) : + Tendsto (fun n ↦ ∫ᵛ a, F n a ∂[B; μ]) l (𝓝 <| ∫ᵛ a, f a ∂[B; μ]) := + tendsto_setToFun_filter_of_dominated_convergence _ bound hF_meas h_bound bound_integrable h_lim + +/-- Lebesgue dominated convergence theorem for series. -/ +theorem hasSum_integral_of_dominated_convergence {ι} [Countable ι] {F : ι → X → E} {f : X → E} + (bound : ι → X → ℝ) (hF_meas : ∀ n, AEStronglyMeasurable (F n) μ) + (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound n a) + (bound_summable : ∀ᵐ a ∂μ, Summable fun n => bound n a) + (bound_integrable : Integrable (fun a => ∑' n, bound n a) μ) + (h_lim : ∀ᵐ a ∂μ, HasSum (fun n => F n a) (f a)) : + HasSum (fun n => ∫ a, F n a ∂μ) (∫ a, f a ∂μ) := by + have hb_nonneg : ∀ᵐ a ∂μ, ∀ n, 0 ≤ bound n a := + eventually_countable_forall.2 fun n => (h_bound n).mono fun a => (norm_nonneg _).trans + have hb_le_tsum : ∀ n, bound n ≤ᵐ[μ] fun a => ∑' n, bound n a := by + intro n + filter_upwards [hb_nonneg, bound_summable] + with _ ha0 ha_sum using ha_sum.le_tsum _ fun i _ => ha0 i + have hF_integrable : ∀ n, Integrable (F n) μ := by + refine fun n => bound_integrable.mono' (hF_meas n) ?_ + exact EventuallyLE.trans (h_bound n) (hb_le_tsum n) + simp only [HasSum, ← integral_finsetSum _ fun n _ => hF_integrable n] + refine tendsto_integral_filter_of_dominated_convergence + (fun a => ∑' n, bound n a) ?_ ?_ bound_integrable h_lim + · exact Eventually.of_forall fun s => s.aestronglyMeasurable_fun_sum fun n _ => hF_meas n + · filter_upwards with s + filter_upwards [eventually_countable_forall.2 h_bound, hb_nonneg, bound_summable] + with a hFa ha0 has + calc + ‖∑ n ∈ s, F n a‖ ≤ ∑ n ∈ s, bound n a := norm_sum_le_of_le _ fun n _ => hFa n + _ ≤ ∑' n, bound n a := has.sum_le_tsum _ (fun n _ => ha0 n) + + +#exit + +theorem integral_tsum {ι} [Countable ι] {f : ι → X → E} (hf : ∀ i, AEStronglyMeasurable (f i) μ) + (hf' : ∑' i, ∫⁻ a : X, ‖f i a‖ₑ ∂μ ≠ ∞) : + ∫ a : X, ∑' i, f i a ∂μ = ∑' i, ∫ a : X, f i a ∂μ := by + by_cases hG : CompleteSpace G; swap + · simp [integral, hG] + have hf'' i : AEMeasurable (‖f i ·‖ₑ) μ := (hf i).enorm + have hhh : ∀ᵐ a : X ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by + rw [← lintegral_tsum hf''] at hf' + refine (ae_lt_top' (AEMeasurable.tsum hf'') hf').mono ?_ + intro x hx + rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe] + exact hx.ne + convert! + (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh ⟨_, _⟩ + _).tsum_eq.symm + · intro n + filter_upwards with x + rfl + · fun_prop + · dsimp [HasFiniteIntegral] + have : ∫⁻ a, ∑' n, ‖f n a‖ₑ ∂μ < ⊤ := by rwa [lintegral_tsum hf'', lt_top_iff_ne_top] + convert! this using 1 + apply lintegral_congr_ae + simp_rw [← coe_nnnorm, ← NNReal.coe_tsum, enorm_eq_nnnorm, NNReal.nnnorm_eq] + filter_upwards [hhh] with a ha + exact ENNReal.coe_tsum (NNReal.summable_coe.mp ha) + · filter_upwards [hhh] with x hx + exact hx.of_norm.hasSum + +lemma hasSum_integral_of_summable_integral_norm {ι} [Countable ι] {F : ι → X → E} + (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) : + HasSum (∫ a, F · a ∂μ) (∫ a, (∑' i, F i a) ∂μ) := by + by_cases hE : CompleteSpace E; swap + · simp [integral, hE, hasSum_zero] + rw [integral_tsum (fun i ↦ (hF_int i).1)] + · exact (hF_sum.of_norm_bounded fun i ↦ norm_integral_le_integral_norm _).hasSum + have (i : ι) : ∫⁻ a, ‖F i a‖ₑ ∂μ = ‖∫ a, ‖F i a‖ ∂μ‖ₑ := by + dsimp [enorm] + rw [lintegral_coe_eq_integral _ (hF_int i).norm, coe_nnreal_eq, coe_nnnorm, + Real.norm_of_nonneg (integral_nonneg (fun a ↦ norm_nonneg (F i a)))] + simp only [coe_nnnorm] + rw [funext this] + exact ENNReal.tsum_coe_ne_top_iff_summable.2 <| NNReal.summable_coe.1 hF_sum.abs + +lemma integral_tsum_of_summable_integral_norm {ι} [Countable ι] {F : ι → X → E} + (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) : + ∑' i, (∫ a, F i a ∂μ) = ∫ a, (∑' i, F i a) ∂μ := + (hasSum_integral_of_summable_integral_norm hF_int hF_sum).tsum_eq + +/-- Corollary of the Lebesgue dominated convergence theorem: If a sequence of functions `F n` is +(eventually) uniformly bounded by a constant and converges (eventually) pointwise to a +function `f`, then the integrals of `F n` with respect to a finite measure `μ` converge +to the integral of `f`. -/ +theorem tendsto_integral_filter_of_norm_le_const {ι} {l : Filter ι} [l.IsCountablyGenerated] + {F : ι → X → G} [IsFiniteMeasure μ] {f : X → G} + (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ) + (h_bound : ∃ C, ∀ᶠ n in l, (∀ᵐ ω ∂μ, ‖F n ω‖ ≤ C)) + (h_lim : ∀ᵐ ω ∂μ, Tendsto (fun n => F n ω) l (𝓝 (f ω))) : + Tendsto (fun n => ∫ ω, F n ω ∂μ) l (nhds (∫ ω, f ω ∂μ)) := by + obtain ⟨c, h_boundc⟩ := h_bound + let C : X → ℝ := (fun _ => c) + exact tendsto_integral_filter_of_dominated_convergence + C h_meas h_boundc (integrable_const c) h_lim + + end VectorMeasure end MeasureTheory From d4d69509a4353531b6ba877cc39eafb691befbf1 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Thu, 28 May 2026 21:14:25 +0200 Subject: [PATCH 071/129] progress --- .../Integral/DominatedConvergence.lean | 55 ++------- Mathlib/MeasureTheory/Integral/SetToL1.lean | 4 +- .../MeasureTheory/VectorMeasure/Integral.lean | 115 ++++-------------- 3 files changed, 33 insertions(+), 141 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean b/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean index 2b9131108a61f4..6041c8f059468e 100644 --- a/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean +++ b/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean @@ -82,54 +82,17 @@ theorem hasSum_integral_of_dominated_convergence {ι} [Countable ι] {F : ι → (bound_integrable : Integrable (fun a => ∑' n, bound n a) μ) (h_lim : ∀ᵐ a ∂μ, HasSum (fun n => F n a) (f a)) : HasSum (fun n => ∫ a, F n a ∂μ) (∫ a, f a ∂μ) := by - have hb_nonneg : ∀ᵐ a ∂μ, ∀ n, 0 ≤ bound n a := - eventually_countable_forall.2 fun n => (h_bound n).mono fun a => (norm_nonneg _).trans - have hb_le_tsum : ∀ n, bound n ≤ᵐ[μ] fun a => ∑' n, bound n a := by - intro n - filter_upwards [hb_nonneg, bound_summable] - with _ ha0 ha_sum using ha_sum.le_tsum _ fun i _ => ha0 i - have hF_integrable : ∀ n, Integrable (F n) μ := by - refine fun n => bound_integrable.mono' (hF_meas n) ?_ - exact EventuallyLE.trans (h_bound n) (hb_le_tsum n) - simp only [HasSum, ← integral_finsetSum _ fun n _ => hF_integrable n] - refine tendsto_integral_filter_of_dominated_convergence - (fun a => ∑' n, bound n a) ?_ ?_ bound_integrable h_lim - · exact Eventually.of_forall fun s => s.aestronglyMeasurable_fun_sum fun n _ => hF_meas n - · filter_upwards with s - filter_upwards [eventually_countable_forall.2 h_bound, hb_nonneg, bound_summable] - with a hFa ha0 has - calc - ‖∑ n ∈ s, F n a‖ ≤ ∑ n ∈ s, bound n a := norm_sum_le_of_le _ fun n _ => hFa n - _ ≤ ∑' n, bound n a := has.sum_le_tsum _ (fun n _ => ha0 n) + simp only [integral_eq_setToFun] + exact hasSum_setToFun_of_dominated_convergence _ bound hF_meas h_bound bound_summable + bound_integrable h_lim theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ) (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖ₑ ∂μ ≠ ∞) : - ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by + ∫ a, ∑' i, f i a ∂μ = ∑' i, ∫ a, f i a ∂μ := by by_cases hG : CompleteSpace G; swap · simp [integral, hG] - have hf'' i : AEMeasurable (‖f i ·‖ₑ) μ := (hf i).enorm - have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by - rw [← lintegral_tsum hf''] at hf' - refine (ae_lt_top' (AEMeasurable.tsum hf'') hf').mono ?_ - intro x hx - rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe] - exact hx.ne - convert! - (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh ⟨_, _⟩ - _).tsum_eq.symm - · intro n - filter_upwards with x - rfl - · fun_prop - · dsimp [HasFiniteIntegral] - have : ∫⁻ a, ∑' n, ‖f n a‖ₑ ∂μ < ⊤ := by rwa [lintegral_tsum hf'', lt_top_iff_ne_top] - convert! this using 1 - apply lintegral_congr_ae - simp_rw [← coe_nnnorm, ← NNReal.coe_tsum, enorm_eq_nnnorm, NNReal.nnnorm_eq] - filter_upwards [hhh] with a ha - exact ENNReal.coe_tsum (NNReal.summable_coe.mp ha) - · filter_upwards [hhh] with x hx - exact hx.of_norm.hasSum + simp only [integral_eq_setToFun] + exact setToFun_tsum _ hf hf' lemma hasSum_integral_of_summable_integral_norm {ι} [Countable ι] {F : ι → α → E} (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) : @@ -161,10 +124,8 @@ theorem tendsto_integral_filter_of_norm_le_const {ι} {l : Filter ι} [l.IsCount (h_bound : ∃ C, ∀ᶠ n in l, (∀ᵐ ω ∂μ, ‖F n ω‖ ≤ C)) (h_lim : ∀ᵐ ω ∂μ, Tendsto (fun n => F n ω) l (𝓝 (f ω))) : Tendsto (fun n => ∫ ω, F n ω ∂μ) l (nhds (∫ ω, f ω ∂μ)) := by - obtain ⟨c, h_boundc⟩ := h_bound - let C : α → ℝ := (fun _ => c) - exact tendsto_integral_filter_of_dominated_convergence - C h_meas h_boundc (integrable_const c) h_lim + simp only [integral_eq_setToFun] + exact tendsto_setToFun_filter_of_norm_le_const _ h_meas h_bound h_lim end MeasureTheory diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index fd92412be1fc2b..c6642540b10bbb 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -1372,11 +1372,11 @@ theorem setToFun_tsum [CompleteSpace E] (hT : DominatedFinMeasAdditive μ T C) (eventually) uniformly bounded by a constant and converges (eventually) pointwise to a function `f`, then the integrals of `F n` with respect to a finite measure `μ` converge to the integral of `f`. -/ -theorem tendsto_integral_filter_of_norm_le_const (hT : DominatedFinMeasAdditive μ T C) +theorem tendsto_setToFun_filter_of_norm_le_const (hT : DominatedFinMeasAdditive μ T C) {ι} {l : Filter ι} [l.IsCountablyGenerated] {F : ι → α → E} [IsFiniteMeasure μ] {f : α → E} (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ) - (h_bound : ∃ C, ∀ᶠ n in l, (∀ᵐ ω ∂μ, ‖F n ω‖ ≤ C)) + (h_bound : ∃ C, ∀ᶠ n in l, ∀ᵐ ω ∂μ, ‖F n ω‖ ≤ C) (h_lim : ∀ᵐ ω ∂μ, Tendsto (fun n => F n ω) l (𝓝 (f ω))) : Tendsto (fun n => setToFun μ T hT (F n)) l (𝓝 (setToFun μ T hT f)) := by obtain ⟨c, h_boundc⟩ := h_bound diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 768706dcba35be..1da4e83eb9223b 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -850,8 +850,6 @@ theorem integral_unique [Unique X] [CompleteSpace G] : ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ _, f default ∂[B; μ] := by congr with x; congr; exact Unique.uniq _ x _ = B (f default) (μ univ) := by rw [integral_const] -#where - /-- **Lebesgue dominated convergence theorem** provides sufficient conditions under which almost everywhere convergence of a sequence of functions implies the convergence of their integrals. We could weaken the condition `bound_integrable` to require `HasFiniteIntegral bound μ` instead @@ -866,7 +864,7 @@ theorem tendsto_integral_of_dominated_convergence {F : ℕ → X → E} {f : X tendsto_setToFun_of_dominated_convergence _ bound F_measurable bound_integrable h_bound h_lim /-- Lebesgue dominated convergence theorem for filters with a countable basis -/ -theorem tendsto_integral_filter_of_dominated_convergence {ι} {l : Filter ι} [l.IsCountablyGenerated] +theorem tendsto_integral_filter_of_dominated_convergence {l : Filter ι} [l.IsCountablyGenerated] {F : ι → X → E} {f : X → E} (bound : X → ℝ) (hF_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) (μ.transpose B).variation) (h_bound : ∀ᶠ n in l, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound a) @@ -876,100 +874,33 @@ theorem tendsto_integral_filter_of_dominated_convergence {ι} {l : Filter ι} [l tendsto_setToFun_filter_of_dominated_convergence _ bound hF_meas h_bound bound_integrable h_lim /-- Lebesgue dominated convergence theorem for series. -/ -theorem hasSum_integral_of_dominated_convergence {ι} [Countable ι] {F : ι → X → E} {f : X → E} - (bound : ι → X → ℝ) (hF_meas : ∀ n, AEStronglyMeasurable (F n) μ) - (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound n a) - (bound_summable : ∀ᵐ a ∂μ, Summable fun n => bound n a) - (bound_integrable : Integrable (fun a => ∑' n, bound n a) μ) - (h_lim : ∀ᵐ a ∂μ, HasSum (fun n => F n a) (f a)) : - HasSum (fun n => ∫ a, F n a ∂μ) (∫ a, f a ∂μ) := by - have hb_nonneg : ∀ᵐ a ∂μ, ∀ n, 0 ≤ bound n a := - eventually_countable_forall.2 fun n => (h_bound n).mono fun a => (norm_nonneg _).trans - have hb_le_tsum : ∀ n, bound n ≤ᵐ[μ] fun a => ∑' n, bound n a := by - intro n - filter_upwards [hb_nonneg, bound_summable] - with _ ha0 ha_sum using ha_sum.le_tsum _ fun i _ => ha0 i - have hF_integrable : ∀ n, Integrable (F n) μ := by - refine fun n => bound_integrable.mono' (hF_meas n) ?_ - exact EventuallyLE.trans (h_bound n) (hb_le_tsum n) - simp only [HasSum, ← integral_finsetSum _ fun n _ => hF_integrable n] - refine tendsto_integral_filter_of_dominated_convergence - (fun a => ∑' n, bound n a) ?_ ?_ bound_integrable h_lim - · exact Eventually.of_forall fun s => s.aestronglyMeasurable_fun_sum fun n _ => hF_meas n - · filter_upwards with s - filter_upwards [eventually_countable_forall.2 h_bound, hb_nonneg, bound_summable] - with a hFa ha0 has - calc - ‖∑ n ∈ s, F n a‖ ≤ ∑ n ∈ s, bound n a := norm_sum_le_of_le _ fun n _ => hFa n - _ ≤ ∑' n, bound n a := has.sum_le_tsum _ (fun n _ => ha0 n) - - -#exit - -theorem integral_tsum {ι} [Countable ι] {f : ι → X → E} (hf : ∀ i, AEStronglyMeasurable (f i) μ) - (hf' : ∑' i, ∫⁻ a : X, ‖f i a‖ₑ ∂μ ≠ ∞) : - ∫ a : X, ∑' i, f i a ∂μ = ∑' i, ∫ a : X, f i a ∂μ := by - by_cases hG : CompleteSpace G; swap - · simp [integral, hG] - have hf'' i : AEMeasurable (‖f i ·‖ₑ) μ := (hf i).enorm - have hhh : ∀ᵐ a : X ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by - rw [← lintegral_tsum hf''] at hf' - refine (ae_lt_top' (AEMeasurable.tsum hf'') hf').mono ?_ - intro x hx - rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe] - exact hx.ne - convert! - (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh ⟨_, _⟩ - _).tsum_eq.symm - · intro n - filter_upwards with x - rfl - · fun_prop - · dsimp [HasFiniteIntegral] - have : ∫⁻ a, ∑' n, ‖f n a‖ₑ ∂μ < ⊤ := by rwa [lintegral_tsum hf'', lt_top_iff_ne_top] - convert! this using 1 - apply lintegral_congr_ae - simp_rw [← coe_nnnorm, ← NNReal.coe_tsum, enorm_eq_nnnorm, NNReal.nnnorm_eq] - filter_upwards [hhh] with a ha - exact ENNReal.coe_tsum (NNReal.summable_coe.mp ha) - · filter_upwards [hhh] with x hx - exact hx.of_norm.hasSum - -lemma hasSum_integral_of_summable_integral_norm {ι} [Countable ι] {F : ι → X → E} - (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) : - HasSum (∫ a, F · a ∂μ) (∫ a, (∑' i, F i a) ∂μ) := by - by_cases hE : CompleteSpace E; swap - · simp [integral, hE, hasSum_zero] - rw [integral_tsum (fun i ↦ (hF_int i).1)] - · exact (hF_sum.of_norm_bounded fun i ↦ norm_integral_le_integral_norm _).hasSum - have (i : ι) : ∫⁻ a, ‖F i a‖ₑ ∂μ = ‖∫ a, ‖F i a‖ ∂μ‖ₑ := by - dsimp [enorm] - rw [lintegral_coe_eq_integral _ (hF_int i).norm, coe_nnreal_eq, coe_nnnorm, - Real.norm_of_nonneg (integral_nonneg (fun a ↦ norm_nonneg (F i a)))] - simp only [coe_nnnorm] - rw [funext this] - exact ENNReal.tsum_coe_ne_top_iff_summable.2 <| NNReal.summable_coe.1 hF_sum.abs - -lemma integral_tsum_of_summable_integral_norm {ι} [Countable ι] {F : ι → X → E} - (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) : - ∑' i, (∫ a, F i a ∂μ) = ∫ a, (∑' i, F i a) ∂μ := - (hasSum_integral_of_summable_integral_norm hF_int hF_sum).tsum_eq +theorem hasSum_integral_of_dominated_convergence [Countable ι] {F : ι → X → E} {f : X → E} + (bound : ι → X → ℝ) (hF_meas : ∀ n, AEStronglyMeasurable (F n) (μ.transpose B).variation) + (h_bound : ∀ n, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound n a) + (bound_summable : ∀ᵐ a ∂(μ.transpose B).variation, Summable fun n => bound n a) + (bound_integrable : Integrable (fun a => ∑' n, bound n a) (μ.transpose B).variation) + (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, HasSum (fun n => F n a) (f a)) : + HasSum (fun n => ∫ᵛ a, F n a ∂[B; μ]) (∫ᵛ a, f a ∂[B; μ]) := + hasSum_setToFun_of_dominated_convergence _ bound hF_meas h_bound bound_summable bound_integrable + h_lim + +theorem integral_tsum [CompleteSpace E] [Countable ι] + {f : ι → X → E} (hf : ∀ i, AEStronglyMeasurable (f i) (μ.transpose B).variation) + (hf' : ∑' i, ∫⁻ a : X, ‖f i a‖ₑ ∂(μ.transpose B).variation ≠ ∞) : + ∫ᵛ a, ∑' i, f i a ∂[B; μ] = ∑' i, ∫ᵛ a, f i a ∂[B; μ] := + setToFun_tsum _ hf hf' /-- Corollary of the Lebesgue dominated convergence theorem: If a sequence of functions `F n` is (eventually) uniformly bounded by a constant and converges (eventually) pointwise to a function `f`, then the integrals of `F n` with respect to a finite measure `μ` converge to the integral of `f`. -/ -theorem tendsto_integral_filter_of_norm_le_const {ι} {l : Filter ι} [l.IsCountablyGenerated] - {F : ι → X → G} [IsFiniteMeasure μ] {f : X → G} - (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ) - (h_bound : ∃ C, ∀ᶠ n in l, (∀ᵐ ω ∂μ, ‖F n ω‖ ≤ C)) - (h_lim : ∀ᵐ ω ∂μ, Tendsto (fun n => F n ω) l (𝓝 (f ω))) : - Tendsto (fun n => ∫ ω, F n ω ∂μ) l (nhds (∫ ω, f ω ∂μ)) := by - obtain ⟨c, h_boundc⟩ := h_bound - let C : X → ℝ := (fun _ => c) - exact tendsto_integral_filter_of_dominated_convergence - C h_meas h_boundc (integrable_const c) h_lim - +theorem tendsto_integral_filter_of_norm_le_const {l : Filter ι} [l.IsCountablyGenerated] + {F : ι → X → E} [IsFiniteMeasure (μ.transpose B).variation] {f : X → E} + (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) (μ.transpose B).variation) + (h_bound : ∃ C, ∀ᶠ n in l, ∀ᵐ ω ∂(μ.transpose B).variation, ‖F n ω‖ ≤ C) + (h_lim : ∀ᵐ ω ∂(μ.transpose B).variation, Tendsto (fun n => F n ω) l (𝓝 (f ω))) : + Tendsto (fun n => ∫ᵛ ω, F n ω ∂[B; μ]) l (𝓝 (∫ᵛ ω, f ω ∂[B; μ])) := + tendsto_setToFun_filter_of_norm_le_const _ h_meas h_bound h_lim end VectorMeasure From ca7aab0b64eb025dadf64593541e8a517093a4e4 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 29 May 2026 09:10:02 +0200 Subject: [PATCH 072/129] missing lemmas --- Mathlib/MeasureTheory/Function/AEEqFun.lean | 11 +++ .../ConditionalExpectation/Basic.lean | 76 +++++++++++++++++++ .../MeasureTheory/Function/LpSpace/Basic.lean | 4 + 3 files changed, 91 insertions(+) diff --git a/Mathlib/MeasureTheory/Function/AEEqFun.lean b/Mathlib/MeasureTheory/Function/AEEqFun.lean index 20dde195673a04..e93f1be4dd8305 100644 --- a/Mathlib/MeasureTheory/Function/AEEqFun.lean +++ b/Mathlib/MeasureTheory/Function/AEEqFun.lean @@ -788,6 +788,17 @@ end Monoid instance instCommMonoid [CommMonoid γ] [ContinuousMul γ] : CommMonoid (α →ₘ[μ] γ) := toGerm_injective.commMonoid toGerm one_toGerm mul_toGerm pow_toGerm +@[to_additive] +theorem coeFn_finsetProd [CommMonoid γ] [ContinuousMul γ] + {ι : Type*} (s : Finset ι) (f : ι → α →ₘ[μ] γ) : + ⇑(∏ i ∈ s, f i) =ᵐ[μ] ∏ i ∈ s, ⇑(f i) := by + classical + induction s using Finset.induction with + | empty => simp [coeFn_one] + | insert a s ha ih => + simp only [ha, not_false_eq_true, Finset.prod_insert] + grw [coeFn_mul, ih] + section Group variable [Group γ] [IsTopologicalGroup γ] diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index e5095a56976eb8..e425c7fdeba9b9 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -453,6 +453,82 @@ theorem tendsto_condExpL1_of_dominated_convergence (hm : m ≤ m₀) [SigmaFinit Tendsto (fun n => condExpL1 hm μ (fs n)) atTop (𝓝 (condExpL1 hm μ f)) := tendsto_setToFun_of_dominated_convergence _ bound_fs hfs_meas h_int_bound_fs hfs_bound hfs +#check coeFn_add + +#check lp.coeFn_sum + +open Finset + +theorem hasSum_coeFn_tsum_Lp_one (f : ℕ → Lp E 1 μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) (((∑' n, f n) : α → E) a) := by + have A : ∀ᵐ x ∂μ, (∑' n, ‖f n x‖ₑ) < ∞ := by + apply ae_lt_top (Measurable.tsum (fun i ↦ (Lp.stronglyMeasurable (f i)).enorm)) + rw [lintegral_tsum (fun i ↦ (Lp.aestronglyMeasurable (f i)).enorm)] + convert hf with n + simp [← eLpNorm_one_eq_lintegral_enorm] + have B : ∀ᵐ x ∂μ, ∀ n, (∑ i ∈ range n, f i : α → E) x = ∑ i ∈ range n, (f i x) := by + rw [ae_all_iff] + intro i + apply coeFn_add + + +#exit + +theorem condExp_tsum [CompleteSpace E] + {ι} [Countable ι] {f : ι → α → E} (hf : ∀ i, AEStronglyMeasurable (f i) μ) + (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖ₑ ∂μ ≠ ∞) : + μ[fun a ↦ ∑' i, f i a | m] =ᵐ[μ] fun a ↦ ∑' i, μ[f i | m] a := by + by_cases hm : m ≤ m₀; swap + · simp [condExp_of_not_le hm] + exact ae_eq_rfl + by_cases hμm : SigmaFinite (μ.trim hm); swap + · simp [condExp_of_not_sigmaFinite hm hμm] + exact ae_eq_rfl + grw [condExp_ae_eq_condExpL1 hm, condExpL1] + have : ∀ᵐ a ∂μ, ∀ i, μ[f i | m] a = condExpL1 hm μ (f i) a := + ae_all_iff.2 (fun i ↦ condExp_ae_eq_condExpL1 hm _) + filter_upwards [this] with a ha + simp [ha, condExpL1] + rw [setToFun_tsum] + + +#exit + +lemma hasSum_integral_of_summable_integral_norm {ι} [Countable ι] {F : ι → α → E} + (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) : + HasSum (∫ a, F · a ∂μ) (∫ a, (∑' i, F i a) ∂μ) := by + by_cases hE : CompleteSpace E; swap + · simp [integral, hE, hasSum_zero] + rw [integral_tsum (fun i ↦ (hF_int i).1)] + · exact (hF_sum.of_norm_bounded fun i ↦ norm_integral_le_integral_norm _).hasSum + have (i : ι) : ∫⁻ a, ‖F i a‖ₑ ∂μ = ‖∫ a, ‖F i a‖ ∂μ‖ₑ := by + dsimp [enorm] + rw [lintegral_coe_eq_integral _ (hF_int i).norm, coe_nnreal_eq, coe_nnnorm, + Real.norm_of_nonneg (integral_nonneg (fun a ↦ norm_nonneg (F i a)))] + simp only [coe_nnnorm] + rw [funext this] + exact ENNReal.tsum_coe_ne_top_iff_summable.2 <| NNReal.summable_coe.1 hF_sum.abs + +lemma integral_tsum_of_summable_integral_norm {ι} [Countable ι] {F : ι → α → E} + (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) : + ∑' i, (∫ a, F i a ∂μ) = ∫ a, (∑' i, F i a) ∂μ := + (hasSum_integral_of_summable_integral_norm hF_int hF_sum).tsum_eq + +/-- Corollary of the Lebesgue dominated convergence theorem: If a sequence of functions `F n` is +(eventually) uniformly bounded by a constant and converges (eventually) pointwise to a +function `f`, then the integrals of `F n` with respect to a finite measure `μ` converge +to the integral of `f`. -/ +theorem tendsto_integral_filter_of_norm_le_const {ι} {l : Filter ι} [l.IsCountablyGenerated] + {F : ι → α → G} [IsFiniteMeasure μ] {f : α → G} + (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ) + (h_bound : ∃ C, ∀ᶠ n in l, (∀ᵐ ω ∂μ, ‖F n ω‖ ≤ C)) + (h_lim : ∀ᵐ ω ∂μ, Tendsto (fun n => F n ω) l (𝓝 (f ω))) : + Tendsto (fun n => ∫ ω, F n ω ∂μ) l (nhds (∫ ω, f ω ∂μ)) := by + simp only [integral_eq_setToFun] + exact tendsto_setToFun_filter_of_norm_le_const _ h_meas h_bound h_lim + + + variable [CompleteSpace E] /-- If two sequences of functions have a.e. equal conditional expectations at each step, converge diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index ae90319baf780e..1e8177c51ae2b2 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -199,6 +199,10 @@ theorem coeFn_add (f g : Lp E p μ) : ⇑(f + g) =ᵐ[μ] f + g := theorem coeFn_sub (f g : Lp E p μ) : ⇑(f - g) =ᵐ[μ] f - g := AEEqFun.coeFn_sub _ _ +theorem coeFn_finsetSum {ι : Type*} (s : Finset ι) (f : ι → Lp E p μ) : + ⇑(∑ i ∈ s, f i) =ᵐ[μ] ∑ i ∈ s, ⇑(f i) := + AEEqFun.coeFn_finsetSum _ _ + theorem const_mem_Lp (α) {_ : MeasurableSpace α} (μ : Measure α) (c : E) [IsFiniteMeasure μ] : @AEEqFun.const α _ _ μ _ c ∈ Lp E p μ := (memLp_const c).eLpNorm_mk_lt_top From a08b16a980be86f750f9dc42b29f67b2bf104884 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 29 May 2026 09:31:13 +0200 Subject: [PATCH 073/129] fix --- Mathlib/MeasureTheory/Function/LpSpace/Basic.lean | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index 1e8177c51ae2b2..1ddff61544b080 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -200,8 +200,8 @@ theorem coeFn_sub (f g : Lp E p μ) : ⇑(f - g) =ᵐ[μ] f - g := AEEqFun.coeFn_sub _ _ theorem coeFn_finsetSum {ι : Type*} (s : Finset ι) (f : ι → Lp E p μ) : - ⇑(∑ i ∈ s, f i) =ᵐ[μ] ∑ i ∈ s, ⇑(f i) := - AEEqFun.coeFn_finsetSum _ _ + ⇑(∑ i ∈ s, f i) =ᵐ[μ] ∑ i ∈ s, ⇑(f i) := by + simp [AEEqFun.coeFn_finsetSum] theorem const_mem_Lp (α) {_ : MeasurableSpace α} (μ : Measure α) (c : E) [IsFiniteMeasure μ] : @AEEqFun.const α _ _ μ _ c ∈ Lp E p μ := From 741eb9f1c325dfcec0bdbfb51bbe8da05e5904e0 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 29 May 2026 11:25:12 +0200 Subject: [PATCH 074/129] progress --- Mathlib/MeasureTheory/Function/AEEqFun.lean | 7 +++++++ .../Function/ConditionalExpectation/Basic.lean | 8 ++------ Mathlib/MeasureTheory/Function/LpSpace/Basic.lean | 5 +++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/AEEqFun.lean b/Mathlib/MeasureTheory/Function/AEEqFun.lean index e93f1be4dd8305..f0f68d64200a02 100644 --- a/Mathlib/MeasureTheory/Function/AEEqFun.lean +++ b/Mathlib/MeasureTheory/Function/AEEqFun.lean @@ -799,6 +799,13 @@ theorem coeFn_finsetProd [CommMonoid γ] [ContinuousMul γ] simp only [ha, not_false_eq_true, Finset.prod_insert] grw [coeFn_mul, ih] +@[to_additive] +theorem coeFn_finsetProd_fun [CommMonoid γ] [ContinuousMul γ] + {ι : Type*} (s : Finset ι) (f : ι → α →ₘ[μ] γ) : + ⇑(∏ i ∈ s, f i) =ᵐ[μ] fun x ↦ ∏ i ∈ s, f i x := by + grw [coeFn_finsetProd] + filter_upwards with x using by simp + section Group variable [Group γ] [IsTopologicalGroup γ] diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index e425c7fdeba9b9..a6596bd7f16237 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -453,10 +453,6 @@ theorem tendsto_condExpL1_of_dominated_convergence (hm : m ≤ m₀) [SigmaFinit Tendsto (fun n => condExpL1 hm μ (fs n)) atTop (𝓝 (condExpL1 hm μ f)) := tendsto_setToFun_of_dominated_convergence _ bound_fs hfs_meas h_int_bound_fs hfs_bound hfs -#check coeFn_add - -#check lp.coeFn_sum - open Finset theorem hasSum_coeFn_tsum_Lp_one (f : ℕ → Lp E 1 μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : @@ -466,10 +462,10 @@ theorem hasSum_coeFn_tsum_Lp_one (f : ℕ → Lp E 1 μ) (hf : ∑' n, ‖f n‖ rw [lintegral_tsum (fun i ↦ (Lp.aestronglyMeasurable (f i)).enorm)] convert hf with n simp [← eLpNorm_one_eq_lintegral_enorm] - have B : ∀ᵐ x ∂μ, ∀ n, (∑ i ∈ range n, f i : α → E) x = ∑ i ∈ range n, (f i x) := by + have B : ∀ᵐ x ∂μ, ∀ n, ⇑((∑ i ∈ range n, f i)) x = ∑ i ∈ range n, (f i x) := by rw [ae_all_iff] intro i - apply coeFn_add + apply coeFn_finsetSum_fun #exit diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index 1ddff61544b080..2f7d16c109c77d 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -203,6 +203,11 @@ theorem coeFn_finsetSum {ι : Type*} (s : Finset ι) (f : ι → Lp E p μ) : ⇑(∑ i ∈ s, f i) =ᵐ[μ] ∑ i ∈ s, ⇑(f i) := by simp [AEEqFun.coeFn_finsetSum] +theorem coeFn_finsetSum_fun {ι : Type*} (s : Finset ι) (f : ι → Lp E p μ) : + ⇑(∑ i ∈ s, f i) =ᵐ[μ] fun x ↦ ∑ i ∈ s, f i x:= by + grw [coeFn_finsetSum] + filter_upwards with x using by simp + theorem const_mem_Lp (α) {_ : MeasurableSpace α} (μ : Measure α) (c : E) [IsFiniteMeasure μ] : @AEEqFun.const α _ _ μ _ c ∈ Lp E p μ := (memLp_const c).eLpNorm_mk_lt_top From 159d300f4e3f91af61ec4b7c0ee291ee6dab298f Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 29 May 2026 12:16:01 +0200 Subject: [PATCH 075/129] lotusking --- .../ConditionalExpectation/Basic.lean | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index a6596bd7f16237..efecf2a6313c85 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -455,8 +455,8 @@ theorem tendsto_condExpL1_of_dominated_convergence (hm : m ≤ m₀) [SigmaFinit open Finset -theorem hasSum_coeFn_tsum_Lp_one (f : ℕ → Lp E 1 μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : - ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) (((∑' n, f n) : α → E) a) := by +theorem hasSum_coeFn_tsum_Lp_one [CompleteSpace E] (f : ℕ → Lp E 1 μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) ((∑' n, f n : Lp E 1 μ) a) := by have A : ∀ᵐ x ∂μ, (∑' n, ‖f n x‖ₑ) < ∞ := by apply ae_lt_top (Measurable.tsum (fun i ↦ (Lp.stronglyMeasurable (f i)).enorm)) rw [lintegral_tsum (fun i ↦ (Lp.aestronglyMeasurable (f i)).enorm)] @@ -464,8 +464,23 @@ theorem hasSum_coeFn_tsum_Lp_one (f : ℕ → Lp E 1 μ) (hf : ∑' n, ‖f n‖ simp [← eLpNorm_one_eq_lintegral_enorm] have B : ∀ᵐ x ∂μ, ∀ n, ⇑((∑ i ∈ range n, f i)) x = ∑ i ∈ range n, (f i x) := by rw [ae_all_iff] - intro i - apply coeFn_finsetSum_fun + exact fun i ↦ coeFn_finsetSum_fun _ _ + obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ + ∀ᵐ x ∂μ, Tendsto (fun i ↦ (∑ j ∈ range (ns i), f j : Lp E 1 μ) x) atTop (𝓝 ((∑' n, f n) x)) := by + have : Tendsto (fun i ↦ (∑ j ∈ range i, f j)) atTop (𝓝 (∑' n, f n)) := + Summable.tendsto_sum_tsum_nat (Summable.of_enorm hf) + exact (tendstoInMeasure_of_tendsto_Lp this).exists_seq_tendsto_ae + filter_upwards [A, B, nslim] with x hx h'x h''x + have S : Summable (fun i ↦ ‖f i x‖) := by + + rw [← ENNReal.tsum_coe_ne_top_iff_summable] + apply (hasSum_iff_tendsto_nat_of_summable_norm S).2 + simp only [h'x] at h''x + refine tendsto_nhds_of_cauchySeq_of_subseq ?_ hns.tendsto_atTop h''x + exact (cauchySeq_finset_of_summable_norm S).comp_tendsto tendsto_finset_range + + + #exit From 6c9b15650824ad6cfc82877096fa62baebf21905 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 29 May 2026 13:27:08 +0200 Subject: [PATCH 076/129] beter --- Mathlib/Analysis/Normed/Group/InfiniteSum.lean | 8 ++++++++ .../Function/ConditionalExpectation/Basic.lean | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Mathlib/Analysis/Normed/Group/InfiniteSum.lean b/Mathlib/Analysis/Normed/Group/InfiniteSum.lean index d44bec01e3a7b0..fe1b72c783ec50 100644 --- a/Mathlib/Analysis/Normed/Group/InfiniteSum.lean +++ b/Mathlib/Analysis/Normed/Group/InfiniteSum.lean @@ -165,6 +165,14 @@ space. -/ theorem nnnorm_tsum_le {f : ι → E} (hf : Summable fun i => ‖f i‖₊) : ‖∑' i, f i‖₊ ≤ ∑' i, ‖f i‖₊ := tsum_of_nnnorm_bounded hf.hasSum fun _i => le_rfl +theorem tsum_enorm_ne_top_iff_summable_nnnorm {ι : Type*} {f : ι → E} : + ∑' i, ‖f i‖ₑ ≠ ∞ ↔ Summable (fun i ↦ ‖f i‖₊) := by + simp only [enorm_eq_nnnorm, ENNReal.tsum_coe_ne_top_iff_summable] + +lemma tsum_enorm_ne_top_iff_summable_norm {ι : Type*} {f : ι → E} : + ∑' i, ‖f i‖ₑ ≠ ∞ ↔ Summable (fun i ↦ ‖f i‖) := by + simp only [tsum_enorm_ne_top_iff_summable_nnnorm, ← coe_nnnorm, NNReal.summable_coe] + variable [CompleteSpace E] /-- Variant of the direct comparison test for series: if the norm of `f` is eventually bounded by a diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index efecf2a6313c85..283ceb852c880e 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -455,6 +455,9 @@ theorem tendsto_condExpL1_of_dominated_convergence (hm : m ≤ m₀) [SigmaFinit open Finset + +#check hasSum_of_subseq_of_summable + theorem hasSum_coeFn_tsum_Lp_one [CompleteSpace E] (f : ℕ → Lp E 1 μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) ((∑' n, f n : Lp E 1 μ) a) := by have A : ∀ᵐ x ∂μ, (∑' n, ‖f n x‖ₑ) < ∞ := by @@ -472,8 +475,8 @@ theorem hasSum_coeFn_tsum_Lp_one [CompleteSpace E] (f : ℕ → Lp E 1 μ) (hf : exact (tendstoInMeasure_of_tendsto_Lp this).exists_seq_tendsto_ae filter_upwards [A, B, nslim] with x hx h'x h''x have S : Summable (fun i ↦ ‖f i x‖) := by - - rw [← ENNReal.tsum_coe_ne_top_iff_summable] + rw [← tsum_enorm_ne_top_iff_summable_norm] + exact hx.ne apply (hasSum_iff_tendsto_nat_of_summable_norm S).2 simp only [h'x] at h''x refine tendsto_nhds_of_cauchySeq_of_subseq ?_ hns.tendsto_atTop h''x From 9c3d311294361ee6b6f717b1f78beaf02bceb3b6 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Fri, 29 May 2026 15:14:53 +0200 Subject: [PATCH 077/129] better --- .../ConditionalExpectation/Basic.lean | 82 +++++++++++++++++-- 1 file changed, 73 insertions(+), 9 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index 283ceb852c880e..8c858affc8db99 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -458,30 +458,94 @@ open Finset #check hasSum_of_subseq_of_summable -theorem hasSum_coeFn_tsum_Lp_one [CompleteSpace E] (f : ℕ → Lp E 1 μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : - ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) ((∑' n, f n : Lp E 1 μ) a) := by +#where + +theorem test {f : ℕ → Lp E 1 μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by + suffices H : ∀ᵐ a ∂μ, ∑' n, ‖f n a‖ₑ < ∞ by + filter_upwards [H] with x hx using tsum_enorm_ne_top_iff_summable_norm.1 hx.ne + apply ae_lt_top (Measurable.tsum (fun i ↦ (Lp.stronglyMeasurable (f i)).enorm)) + rw [lintegral_tsum (fun i ↦ (Lp.aestronglyMeasurable (f i)).enorm)] + convert hf with n + simp [← eLpNorm_one_eq_lintegral_enorm] + +#check MeasureTheory.instSigmaFiniteRestrictUnionSet + +theorem Lp.summable_norm_coeFn_of_tsum_enorm_ne_top {p : ℝ≥0∞} (hp : 1 ≤ p) + {f : ℕ → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by + suffices H : ∀ᵐ a ∂μ, ∑' n, ‖f n a‖ₑ < ∞ by + filter_upwards [H] with x hx using tsum_enorm_ne_top_iff_summable_norm.1 hx.ne + rcases eq_top_or_lt_top p with rfl | h'p + · sorry + have : ∃ s, MeasurableSet s ∧ SigmaFinite (μ.restrict s) ∧ ∀ x ∈ sᶜ, ∀ n, f n x = 0 := by + have A n : ∃ s, MeasurableSet s ∧ (∀ x ∈ sᶜ, f n x = 0) ∧ SigmaFinite (μ.restrict s) := by + apply (finStronglyMeasurable_iff_stronglyMeasurable_and_exists_set_sigmaFinite.1 _).2 + exact Lp.finStronglyMeasurable _ (zero_lt_one.trans_le hp).ne' h'p.ne + choose! s s_meas hs h's using A + refine ⟨⋃ n, s n, MeasurableSet.iUnion s_meas, ?_, ?_⟩ + have : SigmaFinite (Measure.sum (fun n ↦ (μ.restrict (s n)))) := inferInstance + + + apply ae_lt_top (Measurable.tsum (fun i ↦ (Lp.stronglyMeasurable (f i)).enorm)) + rw [lintegral_tsum (fun i ↦ (Lp.aestronglyMeasurable (f i)).enorm)] + convert hf with n + simp [← eLpNorm_one_eq_lintegral_enorm] + + +/- have A : ∀ᵐ x ∂μ, (∑' n, ‖f n x‖ₑ) < ∞ := by apply ae_lt_top (Measurable.tsum (fun i ↦ (Lp.stronglyMeasurable (f i)).enorm)) rw [lintegral_tsum (fun i ↦ (Lp.aestronglyMeasurable (f i)).enorm)] convert hf with n simp [← eLpNorm_one_eq_lintegral_enorm] - have B : ∀ᵐ x ∂μ, ∀ n, ⇑((∑ i ∈ range n, f i)) x = ∑ i ∈ range n, (f i x) := by + +-/ + +private theorem Lp.hasSum_coeFn_tsum_nat {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] + [CompleteSpace E] {f : ℕ → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) (⇑(∑' n, f n) a) := by + have A : ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := + summable_norm_coeFn_of_tsum_enorm_ne_top hp.out hf + have B : ∀ᵐ x ∂μ, ∀ n, ⇑((∑ i ∈ range n, f i)) x = ∑ i ∈ range n, f i x := by rw [ae_all_iff] exact fun i ↦ coeFn_finsetSum_fun _ _ - obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ - ∀ᵐ x ∂μ, Tendsto (fun i ↦ (∑ j ∈ range (ns i), f j : Lp E 1 μ) x) atTop (𝓝 ((∑' n, f n) x)) := by + obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ ∀ᵐ x ∂μ, + Tendsto (fun i ↦ (∑ j ∈ range (ns i), f j : Lp E p μ) x) atTop (𝓝 ((∑' n, f n) x)) := by have : Tendsto (fun i ↦ (∑ j ∈ range i, f j)) atTop (𝓝 (∑' n, f n)) := Summable.tendsto_sum_tsum_nat (Summable.of_enorm hf) exact (tendstoInMeasure_of_tendsto_Lp this).exists_seq_tendsto_ae - filter_upwards [A, B, nslim] with x hx h'x h''x - have S : Summable (fun i ↦ ‖f i x‖) := by - rw [← tsum_enorm_ne_top_iff_summable_norm] - exact hx.ne + filter_upwards [A, B, nslim] with x S h'x h''x apply (hasSum_iff_tendsto_nat_of_summable_norm S).2 simp only [h'x] at h''x refine tendsto_nhds_of_cauchySeq_of_subseq ?_ hns.tendsto_atTop h''x exact (cauchySeq_finset_of_summable_norm S).comp_tendsto tendsto_finset_range +theorem Lp.hasSum_coeFn_tsum {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] {ι : Type*} [Countable ι] + [CompleteSpace E] {f : ι → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) (⇑(∑' n, f n) a) := by + classical + rcases finite_or_infinite ι with hι | hι + · let : Fintype ι := Fintype.ofFinite ι + simp only [tsum_fintype] + filter_upwards [coeFn_finsetSum_fun univ f] with x hx + rw [hx] + exact hasSum_fintype _ + · obtain ⟨e⟩ := nonempty_equiv_of_countable (α := ℕ) (β := ι) + have : ∀ᵐ a ∂μ, HasSum (fun n ↦ f (e n) a) (⇑(∑' n, f (e n)) a) := by + apply Lp.hasSum_coeFn_tsum_nat + convert hf + exact e.tsum_eq (fun i ↦ ‖f i‖ₑ) + filter_upwards [this] with x hx + rw [e.tsum_eq] at hx + exact e.hasSum_iff.1 hx + +theorem Lp.coeFn_tsum {ι : Type*} [Countable ι] {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] + [CompleteSpace E] (f : ι → Lp E p μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ⇑(∑' n, f n) =ᵐ[μ] fun x ↦ ∑' n, f n x := by + filter_upwards [Lp.hasSum_coeFn_tsum hf] with x hx + exact hx.tsum_eq.symm + From ca22bbcac01013d24a9889416804e45c8ce5dd32 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 29 May 2026 17:56:11 +0200 Subject: [PATCH 078/129] lotus --- .../ConditionalExpectation/Basic.lean | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index 8c858affc8db99..2a052a84cb3cb4 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -460,6 +460,8 @@ open Finset #where +#check MeasureTheory.memLp_top_of_bound_enorm + theorem test {f : ℕ → Lp E 1 μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by suffices H : ∀ᵐ a ∂μ, ∑' n, ‖f n a‖ₑ < ∞ by @@ -471,20 +473,36 @@ theorem test {f : ℕ → Lp E 1 μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : #check MeasureTheory.instSigmaFiniteRestrictUnionSet +#check MeasureTheory.eLpNorm_le_eLpNorm_mul_rpow_measure_univ + theorem Lp.summable_norm_coeFn_of_tsum_enorm_ne_top {p : ℝ≥0∞} (hp : 1 ≤ p) {f : ℕ → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by suffices H : ∀ᵐ a ∂μ, ∑' n, ‖f n a‖ₑ < ∞ by filter_upwards [H] with x hx using tsum_enorm_ne_top_iff_summable_norm.1 hx.ne rcases eq_top_or_lt_top p with rfl | h'p - · sorry - have : ∃ s, MeasurableSet s ∧ SigmaFinite (μ.restrict s) ∧ ∀ x ∈ sᶜ, ∀ n, f n x = 0 := by - have A n : ∃ s, MeasurableSet s ∧ (∀ x ∈ sᶜ, f n x = 0) ∧ SigmaFinite (μ.restrict s) := by - apply (finStronglyMeasurable_iff_stronglyMeasurable_and_exists_set_sigmaFinite.1 _).2 - exact Lp.finStronglyMeasurable _ (zero_lt_one.trans_le hp).ne' h'p.ne - choose! s s_meas hs h's using A - refine ⟨⋃ n, s n, MeasurableSet.iUnion s_meas, ?_, ?_⟩ - have : SigmaFinite (Measure.sum (fun n ↦ (μ.restrict (s n)))) := inferInstance + · have : ∀ᵐ x ∂μ, ∀ n, ‖f n x‖ₑ ≤ ‖f n‖ₑ := by + rw [ae_all_iff] + intro n + filter_upwards [ae_le_eLpNormEssSup (f := f n)] with x hx + simpa using hx + filter_upwards [this] with x hx + apply lt_of_le_of_lt ?_ hf.lt_top + gcongr with i + exact hx i + have B (s : Set α) (hs : MeasurableSet s) (h's : μ s ≠ ∞) : + ∀ᵐ x ∂μ, x ∈ s → ∑' n, ‖f n x‖ₑ < ∞ := by + have I n : eLpNorm (f n) 1 (μ.restrict s) ≤ eLpNorm (f n) p (μ.restrict s) * + (μ.restrict s) Set.univ ^ (1 / (1 : ℝ≥0∞).toReal - 1 / p.toReal) := by + apply eLpNorm_le_eLpNorm_mul_rpow_measure_univ + let g n := s.indicator (f n) + have I n : eLpNorm (g n) p μ ≤ eLpNorm (f n) p μ := eLpNorm_indicator_le _ + have J n : eLpNorm (g n) 1 (μ.restrict s) ≤ + + have A n : ∃ s, MeasurableSet s ∧ (∀ x ∈ sᶜ, f n x = 0) ∧ SigmaFinite (μ.restrict s) := by + apply (finStronglyMeasurable_iff_stronglyMeasurable_and_exists_set_sigmaFinite.1 _).2 + exact Lp.finStronglyMeasurable _ (zero_lt_one.trans_le hp).ne' h'p.ne + choose! s s_meas hs h's using A apply ae_lt_top (Measurable.tsum (fun i ↦ (Lp.stronglyMeasurable (f i)).enorm)) From 5e05ec4adc2553ade421383ba0caac8eef18da48 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Fri, 29 May 2026 19:05:49 +0200 Subject: [PATCH 079/129] more --- .../ConditionalExpectation/Basic.lean | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index 2a052a84cb3cb4..ba73f796d1bd8b 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -462,12 +462,16 @@ open Finset #check MeasureTheory.memLp_top_of_bound_enorm -theorem test {f : ℕ → Lp E 1 μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : +#where + +theorem summable_norm_coeFn_of_tsum_eLpNorm_one_ne_top + {f : ℕ → α → E} (hf : ∀ n, AEStronglyMeasurable (f n) μ) + (h'f : ∑' n, eLpNorm (f n) 1 μ ≠ ∞) : ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by suffices H : ∀ᵐ a ∂μ, ∑' n, ‖f n a‖ₑ < ∞ by filter_upwards [H] with x hx using tsum_enorm_ne_top_iff_summable_norm.1 hx.ne - apply ae_lt_top (Measurable.tsum (fun i ↦ (Lp.stronglyMeasurable (f i)).enorm)) - rw [lintegral_tsum (fun i ↦ (Lp.aestronglyMeasurable (f i)).enorm)] + apply ae_lt_top' (AEMeasurable.tsum (fun i ↦ (hf i).enorm)) + rw [lintegral_tsum (fun i ↦ (hf i).enorm)] convert hf with n simp [← eLpNorm_one_eq_lintegral_enorm] @@ -475,29 +479,47 @@ theorem test {f : ℕ → Lp E 1 μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : #check MeasureTheory.eLpNorm_le_eLpNorm_mul_rpow_measure_univ -theorem Lp.summable_norm_coeFn_of_tsum_enorm_ne_top {p : ℝ≥0∞} (hp : 1 ≤ p) - {f : ℕ → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + +attribute [gcongr] ENNReal.tsum_le_tsum + +theorem summable_norm_coeFn_of_tsum_eLpNorm_ne_top {p : ℝ≥0∞} (hp : 1 ≤ p) + {f : ℕ → α → E} (hf : ∀ n, AEStronglyMeasurable (f n) μ) + (h'f : ∑' n, eLpNorm (f n) p μ ≠ ∞) : ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by suffices H : ∀ᵐ a ∂μ, ∑' n, ‖f n a‖ₑ < ∞ by filter_upwards [H] with x hx using tsum_enorm_ne_top_iff_summable_norm.1 hx.ne rcases eq_top_or_lt_top p with rfl | h'p - · have : ∀ᵐ x ∂μ, ∀ n, ‖f n x‖ₑ ≤ ‖f n‖ₑ := by + · have : ∀ᵐ x ∂μ, ∀ n, ‖f n x‖ₑ ≤ eLpNorm (f n) ∞ μ := by rw [ae_all_iff] intro n filter_upwards [ae_le_eLpNormEssSup (f := f n)] with x hx simpa using hx filter_upwards [this] with x hx - apply lt_of_le_of_lt ?_ hf.lt_top + apply lt_of_le_of_lt ?_ h'f.lt_top gcongr with i exact hx i have B (s : Set α) (hs : MeasurableSet s) (h's : μ s ≠ ∞) : - ∀ᵐ x ∂μ, x ∈ s → ∑' n, ‖f n x‖ₑ < ∞ := by - have I n : eLpNorm (f n) 1 (μ.restrict s) ≤ eLpNorm (f n) p (μ.restrict s) * - (μ.restrict s) Set.univ ^ (1 / (1 : ℝ≥0∞).toReal - 1 / p.toReal) := by - apply eLpNorm_le_eLpNorm_mul_rpow_measure_univ - let g n := s.indicator (f n) - have I n : eLpNorm (g n) p μ ≤ eLpNorm (f n) p μ := eLpNorm_indicator_le _ - have J n : eLpNorm (g n) 1 (μ.restrict s) ≤ + ∀ᵐ x ∂μ, x ∈ s → Summable (fun n ↦ ‖f n x‖) := by + rw [← ae_restrict_iff' hs] + apply summable_norm_coeFn_of_tsum_eLpNorm_one_ne_top (fun n ↦ (hf n).restrict) + apply ne_of_lt + have : ∑' n, eLpNorm (f n) p (μ.restrict s) * + (μ.restrict s) Set.univ ^ (1 / ENNReal.toReal 1 - 1 / p.toReal) < ∞ := by + rw [ENNReal.tsum_mul_right] + apply ENNReal.mul_lt_top ?_ ?_ + sorry + simp + apply ENNReal.rpow_lt_top_of_nonneg _ h's + simp + apply inv_le_one_of_one_le₀ + rw [← ENNReal.ofReal_le_iff_le_toReal h'p.ne] + simpa using hp + apply lt_of_le_of_lt ?_ this + gcongr with i + apply eLpNorm_le_eLpNorm_mul_rpow_measure_univ hp (hf i).restrict + + +#exit have A n : ∃ s, MeasurableSet s ∧ (∀ x ∈ sᶜ, f n x = 0) ∧ SigmaFinite (μ.restrict s) := by apply (finStronglyMeasurable_iff_stronglyMeasurable_and_exists_set_sigmaFinite.1 _).2 From 99ffebb284df29bfb0367196d8d7d5c54d98e3d3 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 30 May 2026 10:47:03 +0200 Subject: [PATCH 080/129] new file --- Mathlib.lean | 1 + .../ConditionalExpectation/Basic.lean | 139 ---------------- .../Function/LpSpace/InfiniteSum.lean | 152 ++++++++++++++++++ 3 files changed, 153 insertions(+), 139 deletions(-) create mode 100644 Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean diff --git a/Mathlib.lean b/Mathlib.lean index 5c30c0128d544d..f208a97f17cf4d 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5352,6 +5352,7 @@ public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousFunctions public import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic public import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Continuous public import Mathlib.MeasureTheory.Function.LpSpace.Indicator +public import Mathlib.MeasureTheory.Function.LpSpace.InfiniteSum public import Mathlib.MeasureTheory.Function.Piecewise public import Mathlib.MeasureTheory.Function.SimpleFunc public import Mathlib.MeasureTheory.Function.SimpleFuncDense diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index ba73f796d1bd8b..33608b8e84e705 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -453,145 +453,6 @@ theorem tendsto_condExpL1_of_dominated_convergence (hm : m ≤ m₀) [SigmaFinit Tendsto (fun n => condExpL1 hm μ (fs n)) atTop (𝓝 (condExpL1 hm μ f)) := tendsto_setToFun_of_dominated_convergence _ bound_fs hfs_meas h_int_bound_fs hfs_bound hfs -open Finset - - -#check hasSum_of_subseq_of_summable - -#where - -#check MeasureTheory.memLp_top_of_bound_enorm - -#where - -theorem summable_norm_coeFn_of_tsum_eLpNorm_one_ne_top - {f : ℕ → α → E} (hf : ∀ n, AEStronglyMeasurable (f n) μ) - (h'f : ∑' n, eLpNorm (f n) 1 μ ≠ ∞) : - ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by - suffices H : ∀ᵐ a ∂μ, ∑' n, ‖f n a‖ₑ < ∞ by - filter_upwards [H] with x hx using tsum_enorm_ne_top_iff_summable_norm.1 hx.ne - apply ae_lt_top' (AEMeasurable.tsum (fun i ↦ (hf i).enorm)) - rw [lintegral_tsum (fun i ↦ (hf i).enorm)] - convert hf with n - simp [← eLpNorm_one_eq_lintegral_enorm] - -#check MeasureTheory.instSigmaFiniteRestrictUnionSet - -#check MeasureTheory.eLpNorm_le_eLpNorm_mul_rpow_measure_univ - - -attribute [gcongr] ENNReal.tsum_le_tsum - -theorem summable_norm_coeFn_of_tsum_eLpNorm_ne_top {p : ℝ≥0∞} (hp : 1 ≤ p) - {f : ℕ → α → E} (hf : ∀ n, AEStronglyMeasurable (f n) μ) - (h'f : ∑' n, eLpNorm (f n) p μ ≠ ∞) : - ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by - suffices H : ∀ᵐ a ∂μ, ∑' n, ‖f n a‖ₑ < ∞ by - filter_upwards [H] with x hx using tsum_enorm_ne_top_iff_summable_norm.1 hx.ne - rcases eq_top_or_lt_top p with rfl | h'p - · have : ∀ᵐ x ∂μ, ∀ n, ‖f n x‖ₑ ≤ eLpNorm (f n) ∞ μ := by - rw [ae_all_iff] - intro n - filter_upwards [ae_le_eLpNormEssSup (f := f n)] with x hx - simpa using hx - filter_upwards [this] with x hx - apply lt_of_le_of_lt ?_ h'f.lt_top - gcongr with i - exact hx i - have B (s : Set α) (hs : MeasurableSet s) (h's : μ s ≠ ∞) : - ∀ᵐ x ∂μ, x ∈ s → Summable (fun n ↦ ‖f n x‖) := by - rw [← ae_restrict_iff' hs] - apply summable_norm_coeFn_of_tsum_eLpNorm_one_ne_top (fun n ↦ (hf n).restrict) - apply ne_of_lt - have : ∑' n, eLpNorm (f n) p (μ.restrict s) * - (μ.restrict s) Set.univ ^ (1 / ENNReal.toReal 1 - 1 / p.toReal) < ∞ := by - rw [ENNReal.tsum_mul_right] - apply ENNReal.mul_lt_top ?_ ?_ - sorry - simp - apply ENNReal.rpow_lt_top_of_nonneg _ h's - simp - apply inv_le_one_of_one_le₀ - rw [← ENNReal.ofReal_le_iff_le_toReal h'p.ne] - simpa using hp - apply lt_of_le_of_lt ?_ this - gcongr with i - apply eLpNorm_le_eLpNorm_mul_rpow_measure_univ hp (hf i).restrict - - -#exit - - have A n : ∃ s, MeasurableSet s ∧ (∀ x ∈ sᶜ, f n x = 0) ∧ SigmaFinite (μ.restrict s) := by - apply (finStronglyMeasurable_iff_stronglyMeasurable_and_exists_set_sigmaFinite.1 _).2 - exact Lp.finStronglyMeasurable _ (zero_lt_one.trans_le hp).ne' h'p.ne - choose! s s_meas hs h's using A - - - apply ae_lt_top (Measurable.tsum (fun i ↦ (Lp.stronglyMeasurable (f i)).enorm)) - rw [lintegral_tsum (fun i ↦ (Lp.aestronglyMeasurable (f i)).enorm)] - convert hf with n - simp [← eLpNorm_one_eq_lintegral_enorm] - - -/- - have A : ∀ᵐ x ∂μ, (∑' n, ‖f n x‖ₑ) < ∞ := by - apply ae_lt_top (Measurable.tsum (fun i ↦ (Lp.stronglyMeasurable (f i)).enorm)) - rw [lintegral_tsum (fun i ↦ (Lp.aestronglyMeasurable (f i)).enorm)] - convert hf with n - simp [← eLpNorm_one_eq_lintegral_enorm] - --/ - -private theorem Lp.hasSum_coeFn_tsum_nat {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] - [CompleteSpace E] {f : ℕ → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : - ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) (⇑(∑' n, f n) a) := by - have A : ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := - summable_norm_coeFn_of_tsum_enorm_ne_top hp.out hf - have B : ∀ᵐ x ∂μ, ∀ n, ⇑((∑ i ∈ range n, f i)) x = ∑ i ∈ range n, f i x := by - rw [ae_all_iff] - exact fun i ↦ coeFn_finsetSum_fun _ _ - obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ ∀ᵐ x ∂μ, - Tendsto (fun i ↦ (∑ j ∈ range (ns i), f j : Lp E p μ) x) atTop (𝓝 ((∑' n, f n) x)) := by - have : Tendsto (fun i ↦ (∑ j ∈ range i, f j)) atTop (𝓝 (∑' n, f n)) := - Summable.tendsto_sum_tsum_nat (Summable.of_enorm hf) - exact (tendstoInMeasure_of_tendsto_Lp this).exists_seq_tendsto_ae - filter_upwards [A, B, nslim] with x S h'x h''x - apply (hasSum_iff_tendsto_nat_of_summable_norm S).2 - simp only [h'x] at h''x - refine tendsto_nhds_of_cauchySeq_of_subseq ?_ hns.tendsto_atTop h''x - exact (cauchySeq_finset_of_summable_norm S).comp_tendsto tendsto_finset_range - -theorem Lp.hasSum_coeFn_tsum {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] {ι : Type*} [Countable ι] - [CompleteSpace E] {f : ι → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : - ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) (⇑(∑' n, f n) a) := by - classical - rcases finite_or_infinite ι with hι | hι - · let : Fintype ι := Fintype.ofFinite ι - simp only [tsum_fintype] - filter_upwards [coeFn_finsetSum_fun univ f] with x hx - rw [hx] - exact hasSum_fintype _ - · obtain ⟨e⟩ := nonempty_equiv_of_countable (α := ℕ) (β := ι) - have : ∀ᵐ a ∂μ, HasSum (fun n ↦ f (e n) a) (⇑(∑' n, f (e n)) a) := by - apply Lp.hasSum_coeFn_tsum_nat - convert hf - exact e.tsum_eq (fun i ↦ ‖f i‖ₑ) - filter_upwards [this] with x hx - rw [e.tsum_eq] at hx - exact e.hasSum_iff.1 hx - -theorem Lp.coeFn_tsum {ι : Type*} [Countable ι] {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] - [CompleteSpace E] (f : ι → Lp E p μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : - ⇑(∑' n, f n) =ᵐ[μ] fun x ↦ ∑' n, f n x := by - filter_upwards [Lp.hasSum_coeFn_tsum hf] with x hx - exact hx.tsum_eq.symm - - - - - -#exit - theorem condExp_tsum [CompleteSpace E] {ι} [Countable ι] {f : ι → α → E} (hf : ∀ i, AEStronglyMeasurable (f i) μ) (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖ₑ ∂μ ≠ ∞) : diff --git a/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean new file mode 100644 index 00000000000000..0af403bdf5cd2e --- /dev/null +++ b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean @@ -0,0 +1,152 @@ +/- +Copyright (c) 2020 Rémy Degenne. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Rémy Degenne, Sébastien Gouëzel +-/ +module + +public import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp + +/-! +# Pointwise convergence of infinite sums in `Lᵖ`. + +If a series in `Lᵖ` is converging in norm, then the series also converges pointwise +almost everywhere. +-/ + +@[expose] public section + +open Finset Filter +open scoped Topology ENNReal + +namespace MeasureTheory + +variable {α E : Type*} {_ : MeasurableSpace α} {μ : Measure α} [NormedAddCommGroup E] + +/-- If a series of functions has summable `L^p` norms for some `1 ≤ p`, then the norms are ae +pointwise summable. -/ +theorem summable_norm_of_tsum_eLpNorm_ne_top {ι : Type*} [Countable ι] + {p : ℝ≥0∞} (hp : 1 ≤ p) {f : ι → α → E} (hf : ∀ n, AEStronglyMeasurable (f n) μ) + (h'f : ∑' n, eLpNorm (f n) p μ ≠ ∞) : + ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by + suffices H : ∀ᵐ a ∂μ, ∑' n, ‖f n a‖ₑ < ∞ by + filter_upwards [H] with x hx using tsum_enorm_ne_top_iff_summable_norm.1 hx.ne + -- the result is straightforward in `L^∞`. + rcases eq_top_or_lt_top p with rfl | h'p + · have : ∀ᵐ x ∂μ, ∀ n, ‖f n x‖ₑ ≤ eLpNorm (f n) ∞ μ := by + rw [ae_all_iff] + intro n + filter_upwards [ae_le_eLpNormEssSup (f := f n)] with x hx + simpa using hx + filter_upwards [this] with x hx + apply lt_of_le_of_lt ?_ h'f.lt_top + gcongr with i + exact hx i + /- Let us now consider `p < ∞`. In a measurable set `s` of finite measure, the `L^1` norm is + controlled by a multiple of the `L^p` norm, so the `L^1` norms are summable, i.e., + `∫ x ∈ s, ∑ ‖f n x‖ₑ ∂μ < ∞`. This forces the sum to be finite ae. -/ + have A (s : Set α) (hs : MeasurableSet s) (h's : μ s ≠ ∞) : + ∀ᵐ x ∂μ, x ∈ s → ∑' n, ‖f n x‖ₑ < ∞ := by + rw [← ae_restrict_iff' hs] + apply ae_lt_top' (AEMeasurable.tsum (fun i ↦ (hf i).restrict.enorm)) + rw [lintegral_tsum (fun i ↦ (hf i).restrict.enorm)] + apply ne_of_lt + have : ∑' n, eLpNorm (f n) p (μ.restrict s) * + (μ.restrict s) Set.univ ^ (1 / ENNReal.toReal 1 - 1 / p.toReal) < ∞ := by + rw [ENNReal.tsum_mul_right] + apply ENNReal.mul_lt_top ?_ ?_ + · apply lt_of_le_of_lt ?_ h'f.lt_top + gcongr + exact Measure.restrict_le_self + · simp only [MeasurableSet.univ, Measure.restrict_apply, Set.univ_inter, ENNReal.toReal_one, + ne_eq, one_ne_zero, not_false_eq_true, div_self, one_div] + apply ENNReal.rpow_lt_top_of_nonneg _ h's + simp only [sub_nonneg] + apply inv_le_one_of_one_le₀ + rw [← ENNReal.ofReal_le_iff_le_toReal h'p.ne] + simpa using hp + apply lt_of_le_of_lt ?_ this + gcongr with i + rw [← eLpNorm_one_eq_lintegral_enorm] + exact eLpNorm_le_eLpNorm_mul_rpow_measure_univ hp (hf i).restrict + /- We wish now to reduce to finite measure sets to apply the above. The function `f n` in `L^p` + has a sigma-finite support, that we denote by `s n`. -/ + have B n : ∃ s, MeasurableSet s ∧ (f n =ᵐ[μ.restrict sᶜ] 0) ∧ SigmaFinite (μ.restrict s) := by + apply AEFinStronglyMeasurable.exists_set_sigmaFinite + have : MemLp (f n) p μ := by + simpa [MemLp, hf] using lt_of_le_of_lt (ENNReal.le_tsum n) h'f.lt_top + exact this.aefinStronglyMeasurable (zero_lt_one.trans_le hp).ne' h'p.ne + choose! s s_meas hs h's using B + /- Covering `s n` by countably many sets of finite measure, we deduce using the above that + the series of norms is ae finite on `s n`. -/ + have C : ∀ᵐ x ∂μ, ∀ n, x ∈ s n → ∑' n, ‖f n x‖ₑ < ∞ := by + apply ae_all_iff.2 (fun n ↦ ?_) + have : ∀ᵐ x ∂μ, ∀ i, x ∈ s n ∩ spanningSets (μ.restrict (s n)) i → ∑' n, ‖f n x‖ₑ < ∞ := by + apply ae_all_iff.2 (fun i ↦ ?_) + apply A _ ((s_meas n).inter (measurableSet_spanningSets _ _)) + rw [Set.inter_comm, ← Measure.restrict_apply' (s_meas n)] + exact (measure_spanningSets_lt_top _ _).ne + filter_upwards [this] with x hx h'x + obtain ⟨i, hi⟩ : ∃ i, x ∈ spanningSets (μ.restrict (s n)) i := ⟨_, mem_spanningSetsIndex _ _⟩ + exact hx i ⟨h'x, hi⟩ + /- Finally, we get the result in `⋃ n, s n`. Outside of this set, all the functions are ae + zero, so the result is trivial there. -/ + have D : ∀ᵐ x ∂μ, ∀ n, x ∉ s n → f n x = 0 := + ae_all_iff.2 (fun n ↦ (ae_restrict_iff' (s_meas n).compl).1 (hs n)) + filter_upwards [C, D] with x hx h'x + by_cases! h : ∃ n, x ∈ s n + · rcases h with ⟨n, hn⟩ + exact hx n hn + · have E n : f n x = 0 := h'x n (h n) + simp [E] + +namespace Lp + +private theorem hasSum_coeFn_tsum_nat {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] + [CompleteSpace E] {f : ℕ → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) (⇑(∑' n, f n) a) := by + have A : ∀ᵐ a ∂μ, Summable (fun n ↦ ‖f n a‖) := by + apply summable_norm_of_tsum_eLpNorm_ne_top hp.out (fun n ↦ Lp.aestronglyMeasurable (f n)) + convert hf with n + exact (enorm_def (f n)).symm + have B : ∀ᵐ x ∂μ, ∀ n, ⇑((∑ i ∈ range n, f i)) x = ∑ i ∈ range n, f i x := by + rw [ae_all_iff] + exact fun i ↦ coeFn_finsetSum_fun _ _ + obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ ∀ᵐ x ∂μ, + Tendsto (fun i ↦ (∑ j ∈ range (ns i), f j : Lp E p μ) x) atTop (𝓝 ((∑' n, f n) x)) := by + have : Tendsto (fun i ↦ (∑ j ∈ range i, f j)) atTop (𝓝 (∑' n, f n)) := + Summable.tendsto_sum_tsum_nat (Summable.of_enorm hf) + exact (tendstoInMeasure_of_tendsto_Lp this).exists_seq_tendsto_ae + filter_upwards [A, B, nslim] with x S h'x h''x + apply hasSum_of_subseq_of_summable S (tendsto_finset_range.comp hns.tendsto_atTop) + simpa only [h'x] using h''x + +/-- If a series is converging in `L^p`, then it also converges pointwise almost everywhere. -/ +theorem hasSum_coeFn_tsum {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] {ι : Type*} [Countable ι] + [CompleteSpace E] {f : ι → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ∀ᵐ a ∂μ, HasSum (fun n ↦ f n a) (⇑(∑' n, f n) a) := by + classical + rcases finite_or_infinite ι with hι | hι + · let : Fintype ι := Fintype.ofFinite ι + simp only [tsum_fintype] + filter_upwards [coeFn_finsetSum_fun univ f] with x hx + rw [hx] + exact hasSum_fintype _ + · obtain ⟨e⟩ := nonempty_equiv_of_countable (α := ℕ) (β := ι) + have : ∀ᵐ a ∂μ, HasSum (fun n ↦ f (e n) a) (⇑(∑' n, f (e n)) a) := by + apply Lp.hasSum_coeFn_tsum_nat + convert hf + exact e.tsum_eq (fun i ↦ ‖f i‖ₑ) + filter_upwards [this] with x hx + rw [e.tsum_eq] at hx + exact e.hasSum_iff.1 hx + +theorem coeFn_tsum {ι : Type*} [Countable ι] {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] + [CompleteSpace E] (f : ι → Lp E p μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + ⇑(∑' n, f n) =ᵐ[μ] fun x ↦ ∑' n, f n x := by + filter_upwards [Lp.hasSum_coeFn_tsum hf] with x hx + exact hx.tsum_eq.symm + +end Lp + +end MeasureTheory From b979a366196d1c72950ea09f05bd4945dccad02a Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 30 May 2026 12:25:26 +0200 Subject: [PATCH 081/129] better --- Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean index 0af403bdf5cd2e..7681e8052bba8c 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean @@ -33,11 +33,7 @@ theorem summable_norm_of_tsum_eLpNorm_ne_top {ι : Type*} [Countable ι] filter_upwards [H] with x hx using tsum_enorm_ne_top_iff_summable_norm.1 hx.ne -- the result is straightforward in `L^∞`. rcases eq_top_or_lt_top p with rfl | h'p - · have : ∀ᵐ x ∂μ, ∀ n, ‖f n x‖ₑ ≤ eLpNorm (f n) ∞ μ := by - rw [ae_all_iff] - intro n - filter_upwards [ae_le_eLpNormEssSup (f := f n)] with x hx - simpa using hx + · have : ∀ᵐ x ∂μ, ∀ n, ‖f n x‖ₑ ≤ eLpNorm (f n) ∞ μ := ae_all_iff.2 (fun n ↦ ae_le_eLpNormEssSup) filter_upwards [this] with x hx apply lt_of_le_of_lt ?_ h'f.lt_top gcongr with i From 877ace3d2790a199d7362ac5116aa3e064999d70 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 30 May 2026 15:23:08 +0200 Subject: [PATCH 082/129] cleanup --- Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean | 6 +++--- Mathlib/MeasureTheory/VectorMeasure/Integral.lean | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean index 7681e8052bba8c..1af0141c4615c6 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean @@ -1,7 +1,7 @@ /- -Copyright (c) 2020 Rémy Degenne. All rights reserved. +Copyright (c) 2026 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Rémy Degenne, Sébastien Gouëzel +Authors: Sébastien Gouëzel -/ module @@ -115,7 +115,7 @@ private theorem hasSum_coeFn_tsum_nat {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] exact (tendstoInMeasure_of_tendsto_Lp this).exists_seq_tendsto_ae filter_upwards [A, B, nslim] with x S h'x h''x apply hasSum_of_subseq_of_summable S (tendsto_finset_range.comp hns.tendsto_atTop) - simpa only [h'x] using h''x + simpa only [h'x, Function.comp] using h''x /-- If a series is converging in `L^p`, then it also converges pointwise almost everywhere. -/ theorem hasSum_coeFn_tsum {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] {ι : Type*} [Countable ι] diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 79b5209e2c5f7e..1aae44eea2b4b5 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -443,8 +443,7 @@ theorem integral_smul_vectorMeasure (f : X → E) (c : ℝ) : simp only [this, mul_one] have : DominatedFinMeasAdditive (μ.transpose B).variation ((c • μ).transpose B) ‖c‖ := by simp only [transpose_smul, coe_smul, Real.norm_eq_abs] - simpa [← transpose_eq_cbmApplyMeasure] using - (dominatedFinMeasAdditive_cbmApplyMeasure μ B).smul c + simpa using! (dominatedFinMeasAdditive_cbmApplyMeasure μ B).smul c rw! [← setToFun_congr_smul_measure' _ this, transpose_smul] rfl From b2a9c2201cc8a13260bb45a1efc1703f6c40ebc4 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 30 May 2026 15:30:25 +0200 Subject: [PATCH 083/129] fix --- Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index ca9a4bd61bc162..447dc03d3b6fd3 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -189,7 +189,7 @@ theorem setIntegral_congr_set rw [← integral_indicator hs, ← integral_indicator ht] apply integral_congr_ae filter_upwards [hst] with x hx - replace hx : x ∈ s ↔ x ∈ t := by simpa using hx + replace hx : x ∈ s ↔ x ∈ t := by simpa using! hx simp [indicator] grind From c97bde000800a5ca4aed864cbd2c5eaa6d221e7d Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 30 May 2026 16:04:09 +0200 Subject: [PATCH 084/129] condExp_tsum --- .../ConditionalExpectation/Basic.lean | 62 +++++-------------- .../Function/LpSpace/InfiniteSum.lean | 2 +- 2 files changed, 17 insertions(+), 47 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index 161335f9f8f1f4..82ed5a61ac55d8 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -6,6 +6,7 @@ Authors: Rémy Degenne module public import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1 +public import Mathlib.MeasureTheory.Function.LpSpace.InfiniteSum /-! # Conditional expectation @@ -454,59 +455,28 @@ theorem tendsto_condExpL1_of_dominated_convergence (hm : m ≤ m₀) [SigmaFinit tendsto_setToFun_of_dominated_convergence _ bound_fs hfs_meas h_int_bound_fs hfs_bound hfs theorem condExp_tsum [CompleteSpace E] - {ι} [Countable ι] {f : ι → α → E} (hf : ∀ i, AEStronglyMeasurable (f i) μ) - (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖ₑ ∂μ ≠ ∞) : + {ι : Type*} [Countable ι] {f : ι → α → E} (hf : ∀ i, AEStronglyMeasurable (f i) μ) + (hf' : ∑' i, ∫⁻ a, ‖f i a‖ₑ ∂μ ≠ ∞) : μ[fun a ↦ ∑' i, f i a | m] =ᵐ[μ] fun a ↦ ∑' i, μ[f i | m] a := by by_cases hm : m ≤ m₀; swap - · simp [condExp_of_not_le hm] + · simp only [condExp_of_not_le hm, Pi.zero_apply, tsum_zero] exact ae_eq_rfl by_cases hμm : SigmaFinite (μ.trim hm); swap - · simp [condExp_of_not_sigmaFinite hm hμm] + · simp only [condExp_of_not_sigmaFinite hm hμm, Pi.zero_apply, tsum_zero] exact ae_eq_rfl grw [condExp_ae_eq_condExpL1 hm, condExpL1] - have : ∀ᵐ a ∂μ, ∀ i, μ[f i | m] a = condExpL1 hm μ (f i) a := + have A : ∀ᵐ a ∂μ, ∀ i, μ[f i | m] a = condExpL1 hm μ (f i) a := ae_all_iff.2 (fun i ↦ condExp_ae_eq_condExpL1 hm _) - filter_upwards [this] with a ha - simp [ha, condExpL1] - rw [setToFun_tsum] - - -#exit - -lemma hasSum_integral_of_summable_integral_norm {ι} [Countable ι] {F : ι → α → E} - (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) : - HasSum (∫ a, F · a ∂μ) (∫ a, (∑' i, F i a) ∂μ) := by - by_cases hE : CompleteSpace E; swap - · simp [integral, hE, hasSum_zero] - rw [integral_tsum (fun i ↦ (hF_int i).1)] - · exact (hF_sum.of_norm_bounded fun i ↦ norm_integral_le_integral_norm _).hasSum - have (i : ι) : ∫⁻ a, ‖F i a‖ₑ ∂μ = ‖∫ a, ‖F i a‖ ∂μ‖ₑ := by - dsimp [enorm] - rw [lintegral_coe_eq_integral _ (hF_int i).norm, coe_nnreal_eq, coe_nnnorm, - Real.norm_of_nonneg (integral_nonneg (fun a ↦ norm_nonneg (F i a)))] - simp only [coe_nnnorm] - rw [funext this] - exact ENNReal.tsum_coe_ne_top_iff_summable.2 <| NNReal.summable_coe.1 hF_sum.abs - -lemma integral_tsum_of_summable_integral_norm {ι} [Countable ι] {F : ι → α → E} - (hF_int : ∀ i : ι, Integrable (F i) μ) (hF_sum : Summable fun i ↦ ∫ a, ‖F i a‖ ∂μ) : - ∑' i, (∫ a, F i a ∂μ) = ∫ a, (∑' i, F i a) ∂μ := - (hasSum_integral_of_summable_integral_norm hF_int hF_sum).tsum_eq - -/-- Corollary of the Lebesgue dominated convergence theorem: If a sequence of functions `F n` is -(eventually) uniformly bounded by a constant and converges (eventually) pointwise to a -function `f`, then the integrals of `F n` with respect to a finite measure `μ` converge -to the integral of `f`. -/ -theorem tendsto_integral_filter_of_norm_le_const {ι} {l : Filter ι} [l.IsCountablyGenerated] - {F : ι → α → G} [IsFiniteMeasure μ] {f : α → G} - (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ) - (h_bound : ∃ C, ∀ᶠ n in l, (∀ᵐ ω ∂μ, ‖F n ω‖ ≤ C)) - (h_lim : ∀ᵐ ω ∂μ, Tendsto (fun n => F n ω) l (𝓝 (f ω))) : - Tendsto (fun n => ∫ ω, F n ω ∂μ) l (nhds (∫ ω, f ω ∂μ)) := by - simp only [integral_eq_setToFun] - exact tendsto_setToFun_filter_of_norm_le_const _ h_meas h_bound h_lim - - + have B : ∑' (n : ι), ‖setToFun μ (condExpInd E hm μ) + (dominatedFinMeasAdditive_condExpInd E hm μ) (f n)‖ₑ ≠ ∞ := by + apply (lt_of_le_of_lt ?_ hf'.lt_top).ne + gcongr with i + exact (enorm_setToFun_le _ (by simp)).trans_eq (by simp) + have C := coeFn_tsum (f := fun i ↦ setToFun μ (condExpInd E hm μ) + (dominatedFinMeasAdditive_condExpInd E hm μ) (f i)) B + filter_upwards [A, C] with a ha h'a + simp only [ha, condExpL1] + rw [setToFun_tsum _ hf hf', h'a] variable [CompleteSpace E] diff --git a/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean index 1af0141c4615c6..ecedd1db88469f 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean @@ -138,7 +138,7 @@ theorem hasSum_coeFn_tsum {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] {ι : Type*} [C exact e.hasSum_iff.1 hx theorem coeFn_tsum {ι : Type*} [Countable ι] {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] - [CompleteSpace E] (f : ι → Lp E p μ) (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : + [CompleteSpace E] {f : ι → Lp E p μ} (hf : ∑' n, ‖f n‖ₑ ≠ ∞) : ⇑(∑' n, f n) =ᵐ[μ] fun x ↦ ∑' n, f n x := by filter_upwards [Lp.hasSum_coeFn_tsum hf] with x hx exact hx.tsum_eq.symm From cbbf7e767464e94119e26abe0273b817b16e0a89 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 30 May 2026 16:28:47 +0200 Subject: [PATCH 085/129] better --- Mathlib/Analysis/Normed/Operator/Mul.lean | 10 ++++++---- .../VectorMeasure/AddContent.lean | 20 ++++++++++--------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Mathlib/Analysis/Normed/Operator/Mul.lean b/Mathlib/Analysis/Normed/Operator/Mul.lean index b41b4a0247e13f..5a34126234f616 100644 --- a/Mathlib/Analysis/Normed/Operator/Mul.lean +++ b/Mathlib/Analysis/Normed/Operator/Mul.lean @@ -211,10 +211,12 @@ theorem opNorm_lsmul_apply_le (x : R) : ‖(lsmul 𝕜 R x : E →L[𝕜] E)‖ ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg x) fun y => norm_smul_le x y /-- The norm of `lsmul` is at most 1 in any semi-normed group. -/ -theorem opNorm_lsmul_le : ‖(lsmul 𝕜 R : R →L[𝕜] E →L[𝕜] E)‖ ≤ 1 := by - refine ContinuousLinearMap.opNorm_le_bound _ zero_le_one fun x => ?_ - simp_rw [one_mul] - exact opNorm_lsmul_apply_le _ +theorem opNorm_lsmul_le : ‖(lsmul 𝕜 R : R →L[𝕜] E →L[𝕜] E)‖ ≤ 1 := + LinearMap.mkContinuous₂_norm_le _ zero_le_one _ + +theorem opNNNorm_lsmul_le : ‖(lsmul 𝕜 R : R →L[𝕜] E →L[𝕜] E)‖₊ ≤ 1 := by + rw [← NNReal.coe_le_coe] + simpa using opNorm_lsmul_le end SMulLinear diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index 2cb8936fa43798..b85433d802dbe4 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -10,7 +10,7 @@ public import Mathlib.Analysis.Normed.Group.InfiniteSum public import Mathlib.MeasureTheory.Measure.AddContent public import Mathlib.MeasureTheory.Measure.MeasuredSets public import Mathlib.MeasureTheory.Measure.Trim -public import Mathlib.MeasureTheory.VectorMeasure.Integral +public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral /-! # Constructing a vector measure from an additive content @@ -317,14 +317,6 @@ theorem exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom exact ae_le_set_inter Filter.EventuallyLE.rfl (hD s hs) exact ⟨m', h, fun s ↦ (h' s).trans (Measure.restrict_apply_le (⋃₀ D) s)⟩ -#check Measure.trim_le - -#check MeasureTheory.condExp - -#check MeasureTheory.condExp_zero - -#check MeasureTheory.integral_tsum_of_summable_integral_norm - theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] [IsFiniteMeasure μ] {C : Set (Set α)} {m : AddContent E C} (hC : IsSetSemiring C) (hm : ∀ s ∈ C, ‖m s‖ₑ ≤ μ s) (h'C : ∀ s ∈ C, MeasurableSet s) : @@ -343,6 +335,16 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] empty' := by simp not_measurable' s hs := by simp [hs] m_iUnion' f f_meas hf := by + have : ∫ᵛ (x : α), μ[fun x ↦ ∑' (d : ℕ), (f d).indicator 1 x | M] x ∂•m' + = ∫ᵛ (x : α), ∑' d, μ[(f d).indicator 1 | M] x ∂•m' := by + apply VectorMeasure.integral_congr_ae + have : (m'.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation ≤ μ' := by + apply (variation_transpose_le _ _).trans + have : ‖ContinuousLinearMap.lsmul ℝ ℝ (E := E)‖₊ ≤ 1 := by + apply opNNNorm_lsmul_le + + + simp only [f_meas, ↓reduceIte, implies_true, MeasurableSet.iUnion, indicator_iUnion_of_pairwise_disjoint _ hf] } From 27179f85192c34b9cca492290831531af6dbe7b8 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 30 May 2026 18:00:08 +0200 Subject: [PATCH 086/129] better --- Mathlib/Algebra/Order/AddTorsor.lean | 2 +- Mathlib/Data/ENNReal/Action.lean | 13 +++++++++---- Mathlib/MeasureTheory/Measure/MeasureSpace.lean | 9 +++++++++ .../MeasureTheory/VectorMeasure/AddContent.lean | 14 +++++++++++++- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/Mathlib/Algebra/Order/AddTorsor.lean b/Mathlib/Algebra/Order/AddTorsor.lean index 8ae120bc6d9aa6..b52354f9409fbb 100644 --- a/Mathlib/Algebra/Order/AddTorsor.lean +++ b/Mathlib/Algebra/Order/AddTorsor.lean @@ -77,7 +77,7 @@ instance [CommMonoid G] [Preorder G] [IsOrderedMonoid G] : IsOrderedSMul G G whe smul_le_smul_left _ _ := mul_le_mul_right smul_le_smul_right _ _ := mul_le_mul_left -@[to_additive] +@[to_additive (attr := gcongr)] theorem IsOrderedSMul.smul_le_smul [LE G] [Preorder P] [SMul G P] [IsOrderedSMul G P] {a b : G} {c d : P} (hab : a ≤ b) (hcd : c ≤ d) : a • c ≤ b • d := (IsOrderedSMul.smul_le_smul_left _ _ hcd _).trans (IsOrderedSMul.smul_le_smul_right _ _ hab _) diff --git a/Mathlib/Data/ENNReal/Action.lean b/Mathlib/Data/ENNReal/Action.lean index 431d6397d5b04d..1e33eddb4bed6d 100644 --- a/Mathlib/Data/ENNReal/Action.lean +++ b/Mathlib/Data/ENNReal/Action.lean @@ -6,6 +6,7 @@ Authors: Johannes Hölzl, Yury Kudryashov module public import Mathlib.Algebra.Module.Torsion.Field +public import Mathlib.Algebra.Order.AddTorsor public import Mathlib.Data.ENNReal.Operations /-! @@ -104,11 +105,15 @@ instance : PosSMulStrictMono ℝ≥0 ℝ≥0∞ where instance : SMulPosMono ℝ≥0 ℝ≥0∞ where smul_le_smul_of_nonneg_right _r _ _a _b hab := _root_.mul_le_mul_left (coe_le_coe.2 hab) _ -instance : CovariantClass ℝ≥0∞ ℝ≥0∞ (· • ·) (· ≤ ·) := - inferInstanceAs <| CovariantClass ℝ≥0∞ ℝ≥0∞ (· * ·) (· ≤ ·) +instance : IsOrderedModule ℝ≥0 ℝ≥0∞ where -instance : CovariantClass ℝ≥0 ℝ≥0∞ (· • ·) (· ≤ ·) := - ⟨fun x x y hxy ↦ by simpa [ENNReal.smul_def] using mul_le_mul_right hxy _⟩ +example : CovariantClass ℝ≥0∞ ℝ≥0∞ (· • ·) (· ≤ ·) := inferInstance + +instance : IsOrderedSMul ℝ≥0 ℝ≥0∞ where + smul_le_smul_left a b hab c := by gcongr + smul_le_smul_right a b hab c := by gcongr + +example : CovariantClass ℝ≥0 ℝ≥0∞ (· • ·) (· ≤ ·) := inferInstance end Actions diff --git a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean index 97e13f20212aae..d589ceeeeebf20 100644 --- a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean +++ b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean @@ -1087,6 +1087,15 @@ instance [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] [CovariantC simp only [smul_apply] gcongr +instance [SMul R ℝ≥0∞] [LE R] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] [IsOrderedSMul R ℝ≥0∞] : + IsOrderedSMul R (Measure α) where + smul_le_smul_left μ ν hμν a s := by + simp only [smul_apply] + gcongr + smul_le_smul_right a b hab μ s := by + simp only [smul_apply] + gcongr + section sInf variable {m : Set (Measure α)} diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index b85433d802dbe4..3ba8185433d412 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -317,6 +317,17 @@ theorem exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom exact ae_le_set_inter Filter.EventuallyLE.rfl (hD s hs) exact ⟨m', h, fun s ↦ (h' s).trans (Measure.restrict_apply_le (⋃₀ D) s)⟩ +open scoped NNReal + +#check IsOrderedSMul + +lemma foo (a b : ℝ≥0∞) (μ ν : Measure α) (ha : a ≤ b) (hμ : μ ≤ ν) : + a • μ ≤ b • μ := by + exact? + + +#exit + theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] [IsFiniteMeasure μ] {C : Set (Set α)} {m : AddContent E C} (hC : IsSetSemiring C) (hm : ∀ s ∈ C, ‖m s‖ₑ ≤ μ s) (h'C : ∀ s ∈ C, MeasurableSet s) : @@ -340,8 +351,9 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] apply VectorMeasure.integral_congr_ae have : (m'.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation ≤ μ' := by apply (variation_transpose_le _ _).trans + grw [ContinuousLinearMap.opNNNorm_lsmul_le] have : ‖ContinuousLinearMap.lsmul ℝ ℝ (E := E)‖₊ ≤ 1 := by - apply opNNNorm_lsmul_le + apply ContinuousLinearMap.opNNNorm_lsmul_le From 7272f692564a75ce6e0813e3ff1e7a1836a25164 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 31 May 2026 11:38:47 +0200 Subject: [PATCH 087/129] more --- .../VectorMeasure/AddContent.lean | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index 3ba8185433d412..3762e80a115bd1 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -317,17 +317,6 @@ theorem exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom exact ae_le_set_inter Filter.EventuallyLE.rfl (hD s hs) exact ⟨m', h, fun s ↦ (h' s).trans (Measure.restrict_apply_le (⋃₀ D) s)⟩ -open scoped NNReal - -#check IsOrderedSMul - -lemma foo (a b : ℝ≥0∞) (μ ν : Measure α) (ha : a ≤ b) (hμ : μ ≤ ν) : - a • μ ≤ b • μ := by - exact? - - -#exit - theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] [IsFiniteMeasure μ] {C : Set (Set α)} {m : AddContent E C} (hC : IsSetSemiring C) (hm : ∀ s ∈ C, ‖m s‖ₑ ≤ μ s) (h'C : ∀ s ∈ C, MeasurableSet s) : @@ -351,9 +340,13 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] apply VectorMeasure.integral_congr_ae have : (m'.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation ≤ μ' := by apply (variation_transpose_le _ _).trans - grw [ContinuousLinearMap.opNNNorm_lsmul_le] - have : ‖ContinuousLinearMap.lsmul ℝ ℝ (E := E)‖₊ ≤ 1 := by - apply ContinuousLinearMap.opNNNorm_lsmul_le + grw [ContinuousLinearMap.opNNNorm_lsmul_le, one_smul] + exact variation_le_of_forall_enorm_le (fun s hs ↦ hm' _) + apply ae_mono this + apply ae_eq_trim_of_measurable _ (by fun_prop) (by fun_prop) + apply condExp_tsum (fun i ↦ ?_) + · sorry + · sorry From 4b4fa8c4b7e757a6d01515b1a30ec349363caa80 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 31 May 2026 13:31:38 +0200 Subject: [PATCH 088/129] better --- .../Integral/Lebesgue/Basic.lean | 4 ++- .../VectorMeasure/AddContent.lean | 34 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean index d7c476b5600c03..78c54ce1ae3810 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean @@ -545,14 +545,16 @@ theorem setLIntegral_eq_const {f : α → ℝ≥0∞} (hf : Measurable f) (r : · rw [lintegral_const, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter] · exact hf (measurableSet_singleton r) +@[to_fun lintegral_indicator_fun_one_le] theorem lintegral_indicator_one_le (s : Set α) : ∫⁻ a, s.indicator 1 a ∂μ ≤ μ s := (lintegral_indicator_const_le _ _).trans <| (one_mul _).le -@[simp] +@[to_fun (attr := simp) lintegral_indicator_fun_one₀] theorem lintegral_indicator_one₀ {s : Set α} (hs : NullMeasurableSet s μ) : ∫⁻ a, s.indicator 1 a ∂μ = μ s := (lintegral_indicator_const₀ hs _).trans <| one_mul _ +@[to_fun lintegral_indicator_fun_one] theorem lintegral_indicator_one {s : Set α} (hs : MeasurableSet s) : ∫⁻ a, s.indicator 1 a ∂μ = μ s := by simp [hs] diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index 3762e80a115bd1..05831728e83ceb 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -324,12 +324,18 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] classical let M : MeasurableSpace α := generateFrom C have Mle : M ≤ hα := generateFrom_le h'C - let μ' := μ.trim Mle + set μ' := μ.trim Mle with hμ' obtain ⟨m', m'C, hm'⟩ : - ∃ m' : VectorMeasure α E, (∀ s ∈ C, m' s = m s) ∧ ∀ s, ‖m' s‖ₑ ≤ μ' s := by + ∃ m' : @VectorMeasure α M E _ _, (∀ s ∈ C, m' s = m s) ∧ ∀ s, ‖m' s‖ₑ ≤ μ' s := by apply exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom hC (fun s hs ↦ ?_) rfl apply (hm s hs).trans_eq exact (MeasureTheory.trim_measurableSet_eq Mle (measurableSet_generateFrom hs)).symm + have m'_le : (m'.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation ≤ μ' := by + apply (variation_transpose_le _ _).trans + grw [ContinuousLinearMap.opNNNorm_lsmul_le, one_smul] + exact variation_le_of_forall_enorm_le (fun s hs ↦ hm' _) + -- next line is to make sure that the default instance is picked when defining `m''`. + let : MeasurableSpace α := hα let m'' : VectorMeasure α E := { measureOf' s := if MeasurableSet s then ∫ᵛ x, μ[s.indicator 1 | M] x ∂• m' else 0 empty' := by simp @@ -338,20 +344,24 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] have : ∫ᵛ (x : α), μ[fun x ↦ ∑' (d : ℕ), (f d).indicator 1 x | M] x ∂•m' = ∫ᵛ (x : α), ∑' d, μ[(f d).indicator 1 | M] x ∂•m' := by apply VectorMeasure.integral_congr_ae - have : (m'.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation ≤ μ' := by - apply (variation_transpose_le _ _).trans - grw [ContinuousLinearMap.opNNNorm_lsmul_le, one_smul] - exact variation_le_of_forall_enorm_le (fun s hs ↦ hm' _) - apply ae_mono this + apply ae_mono m'_le apply ae_eq_trim_of_measurable _ (by fun_prop) (by fun_prop) apply condExp_tsum (fun i ↦ ?_) - · sorry - · sorry - + · simp only [enorm_indicator_eq_indicator_enorm, Pi.one_apply, enorm_one, f_meas, + lintegral_indicator, lintegral_const, MeasurableSet.univ, Measure.restrict_apply, + Set.univ_inter, one_mul, ne_eq, ← measure_iUnion hf f_meas, measure_ne_top, + not_false_eq_true] + · exact AEStronglyMeasurable.indicator (by fun_prop) (f_meas i) + simp only [f_meas, ↓reduceIte, implies_true, MeasurableSet.iUnion, + indicator_iUnion_of_pairwise_disjoint _ hf, this] + rw [integral_tsum (by fun_prop)]; rotate_left + · apply ne_of_lt + grw [m'_le, hμ'] + have A i : Measurable[M] (fun x ↦ ‖μ[(f i).indicator (1 : α → ℝ) | M] x‖ₑ) := by fun_prop + simp_rw [lintegral_trim Mle (A _)] + rw [lin] - simp only [f_meas, ↓reduceIte, implies_true, MeasurableSet.iUnion, - indicator_iUnion_of_pairwise_disjoint _ hf] } From e0b8f2e849a39d26bbf20ae8bc23a05627acab47 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 31 May 2026 22:27:23 +0200 Subject: [PATCH 089/129] more --- .../LebesgueBochner.lean | 55 +++++++++++++++++++ .../VectorMeasure/AddContent.lean | 48 ++++++++++++++-- .../MeasureTheory/VectorMeasure/Basic.lean | 13 +++-- 3 files changed, 105 insertions(+), 11 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/LebesgueBochner.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/LebesgueBochner.lean index f9abc52d183123..c7b26bcd5a8983 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/LebesgueBochner.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/LebesgueBochner.lean @@ -51,4 +51,59 @@ lemma toReal_condLExp (m : MeasurableSpace 𝓧) {m𝓧 : MeasurableSpace 𝓧} · exact ae_restrict_of_ae (condLExp_lt_top hf) · exact StronglyMeasurable.aestronglyMeasurable (by fun_prop) +/-- The two definitions of the conditional expectation `condExp` and `condLExp` (for Bochner and +Lebesgue integrals respectively) agree almost everywhere. -/ +lemma condLExp_ofReal (m : MeasurableSpace 𝓧) {m𝓧 : MeasurableSpace 𝓧} {μ : Measure 𝓧} + {f : 𝓧 → ℝ} (hf : Integrable f μ) (h'f : 0 ≤ᵐ[μ] f) : + μ⁻[fun x ↦ ENNReal.ofReal (f x) | m] =ᵐ[μ] fun x ↦ ENNReal.ofReal (μ[f | m] x) := by + by_cases hm : m ≤ m𝓧 + swap; · simp [condLExp_of_not_le hm, condExp_of_not_le hm]; rfl + by_cases hμ : SigmaFinite (μ.trim hm) + swap; · simp [condLExp_of_not_sigmaFinite hm hμ, condExp_of_not_sigmaFinite hm hμ]; rfl + have A : μ[fun x ↦ (ENNReal.ofReal (f x)).toReal | m] =ᵐ[μ] μ[f | m] := by + apply condExp_congr_ae + filter_upwards [h'f] with x hx using ENNReal.toReal_ofReal hx + have B : 0 ≤ᵐ[μ] μ[f | m] := condExp_nonneg h'f + let g x := ENNReal.ofReal (f x) + have I : ∫⁻ x, g x ∂μ ≠ ∞ := by + have : ∫⁻ x, g x ∂μ = ∫⁻ x, ‖f x‖ₑ ∂μ := by + apply lintegral_congr_ae + filter_upwards [h'f] with x hx using by simp [g, Real.enorm_eq_ofReal hx] + rw [this] + exact hf.2.ne + have J : ∀ᵐ x ∂μ, μ⁻[g|m] x < ∞ := by + apply ae_lt_top (by fun_prop) + convert I using 1 + exact lintegral_condLExp _ _ _ + filter_upwards [toReal_condLExp m (f := g) (by fun_prop) I, h'f, A, B, J] + with a ha h'a h''a h'''a C + rw [← ENNReal.toReal_eq_toReal_iff' C.ne, ENNReal.toReal_ofReal h'''a, ha, h''a] + simp only [ne_eq, ENNReal.ofReal_ne_top, not_false_eq_true] + +/-- The two definitions of the conditional expectation `condExp` and `condLExp` (for Bochner and +Lebesgue integrals respectively) agree almost everywhere. -/ +lemma condLExp_enorm (m : MeasurableSpace 𝓧) {m𝓧 : MeasurableSpace 𝓧} {μ : Measure 𝓧} + {f : 𝓧 → ℝ} (hf : Integrable f μ) (h'f : 0 ≤ᵐ[μ] f) : + μ⁻[fun x ↦ ‖f x‖ₑ | m] =ᵐ[μ] fun x ↦ ‖μ[f | m] x‖ₑ := by + have A : μ⁻[fun x ↦ ENNReal.ofReal (f x) | m] =ᵐ[μ] μ⁻[fun x ↦ ‖f x‖ₑ | m] := by + apply condLExp_congr_ae + filter_upwards [h'f] with x hx using by simp [Real.enorm_eq_ofReal hx] + grw [← A, condLExp_ofReal m hf h'f] + filter_upwards [condExp_nonneg h'f (m := m)] with x hx using by simp [Real.enorm_eq_ofReal hx] + +lemma lintegral_enorm_condExp_indicator + {m : MeasurableSpace 𝓧} {m𝓧 : MeasurableSpace 𝓧} (hm : m ≤ m𝓧) {μ : Measure 𝓧} + [SigmaFinite (μ.trim hm)] {s : Set 𝓧} (hs : MeasurableSet s) (h's : μ s ≠ ∞) : + ∫⁻ a, ‖μ[s.indicator (1 : 𝓧 → ℝ) | m] a‖ₑ ∂μ = μ s := calc + _ = ∫⁻ a, μ⁻[fun x ↦ ‖s.indicator (1 : 𝓧 → ℝ) x‖ₑ | m] a ∂μ := by + apply lintegral_congr_ae + apply (condLExp_enorm _ _ _).symm + · apply (integrable_indicator_iff hs).2 + apply integrableOn_const h's + · filter_upwards with x + simp only [Pi.zero_apply, Set.indicator, Pi.one_apply] + grind + _ = μ s := by + simp [lintegral_condLExp hm, enorm_indicator_eq_indicator_enorm, lintegral_indicator hs] + end MeasureTheory diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index 05831728e83ceb..4dc981377cfcec 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -5,7 +5,7 @@ Authors: Sébastien Gouëzel -/ module -public import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic +public import Mathlib.MeasureTheory.Function.ConditionalExpectation.LebesgueBochner public import Mathlib.Analysis.Normed.Group.InfiniteSum public import Mathlib.MeasureTheory.Measure.AddContent public import Mathlib.MeasureTheory.Measure.MeasuredSets @@ -321,6 +321,11 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] [IsFiniteMeasure μ] {C : Set (Set α)} {m : AddContent E C} (hC : IsSetSemiring C) (hm : ∀ s ∈ C, ‖m s‖ₑ ≤ μ s) (h'C : ∀ s ∈ C, MeasurableSet s) : ∃ m' : VectorMeasure α E, (∀ s ∈ C, m' s = m s) ∧ ∀ s, ‖m' s‖ₑ ≤ μ s := by + /- On the sigma-algebra `M` generated by `C`, the desired vector measure is provided by + `exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom`. We extend it to the whole + sigma-algebra of measurable sets by integrating the conditional expectation with respect to `M`. + This extension satisfies all the desired properties. + -/ classical let M : MeasurableSpace α := generateFrom C have Mle : M ≤ hα := generateFrom_le h'C @@ -334,7 +339,7 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] apply (variation_transpose_le _ _).trans grw [ContinuousLinearMap.opNNNorm_lsmul_le, one_smul] exact variation_le_of_forall_enorm_le (fun s hs ↦ hm' _) - -- next line is to make sure that the default instance is picked when defining `m''`. + -- next line is to make sure that the default instance is picked below. let : MeasurableSpace α := hα let m'' : VectorMeasure α E := { measureOf' s := if MeasurableSet s then ∫ᵛ x, μ[s.indicator 1 | M] x ∂• m' else 0 @@ -348,21 +353,52 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] apply ae_eq_trim_of_measurable _ (by fun_prop) (by fun_prop) apply condExp_tsum (fun i ↦ ?_) · simp only [enorm_indicator_eq_indicator_enorm, Pi.one_apply, enorm_one, f_meas, - lintegral_indicator, lintegral_const, MeasurableSet.univ, Measure.restrict_apply, + lintegral_indicator, lintegral_const, MeasurableSet.univ, Measure.restrict_apply, Set.univ_inter, one_mul, ne_eq, ← measure_iUnion hf f_meas, measure_ne_top, not_false_eq_true] · exact AEStronglyMeasurable.indicator (by fun_prop) (f_meas i) simp only [f_meas, ↓reduceIte, implies_true, MeasurableSet.iUnion, indicator_iUnion_of_pairwise_disjoint _ hf, this] - rw [integral_tsum (by fun_prop)]; rotate_left + have I : ∑' (i : ℕ), ∫⁻ (a : α), ‖μ[(f i).indicator (1 : α → ℝ) | M] a‖ₑ ∂μ < ∞ := by + simp_rw [lintegral_enorm_condExp_indicator _ (f_meas _), ← measure_iUnion hf f_meas] + exact measure_lt_top _ _ + rw [integral_tsum (by fun_prop)]; swap · apply ne_of_lt grw [m'_le, hμ'] have A i : Measurable[M] (fun x ↦ ‖μ[(f i).indicator (1 : α → ℝ) | M] x‖ₑ) := by fun_prop simp_rw [lintegral_trim Mle (A _)] - rw [lin] + exact I + refine Summable.hasSum (Summable.of_enorm ?_) + apply ne_of_lt (lt_of_le_of_lt ?_ I) + gcongr with i + apply enorm_integral_le_lintegral_enorm.trans + apply (lintegral_mono' m'_le le_rfl).trans_eq + rw [hμ', lintegral_trim _ (by fun_prop)] } + refine ⟨m'', fun s hs ↦ ?_, fun s ↦ ?_⟩ + · simp only [h'C s hs, ↓reduceIte, m''] + have : ∫ᵛ (x : α), μ[s.indicator 1 | M] x ∂•m' = ∫ᵛ (x : α), s.indicator 1 x ∂•m' := by + apply integral_congr_ae + filter_upwards with x + rw [condExp_of_stronglyMeasurable Mle] + · exact StronglyMeasurable.indicator stronglyMeasurable_const + (measurableSet_generateFrom hs) + · apply (integrable_const 1).indicator (h'C s hs) + rw [this, integral_indicator (measurableSet_generateFrom hs)] + simp only [Pi.one_apply] + have : IsFiniteMeasure + ((m'.restrict s).transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation := by + apply isFiniteMeasure_of_le (μ := μ') + grw [transpose_restrict, variation_restrict_le, Measure.restrict_le_self, m'_le] + rw [setIntegral_const] + simp [m'C s hs] + · by_cases hs : MeasurableSet s; swap + · simp [not_measurable _ hs] + simp only [hs, ↓reduceIte, m''] + apply enorm_integral_le_lintegral_enorm.trans + apply (lintegral_mono' m'_le le_rfl).trans_eq + rw [hμ', lintegral_trim _ (by fun_prop), lintegral_enorm_condExp_indicator _ hs] - } diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index 9685c188260ab7..314f87aca47cfb 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -566,7 +566,7 @@ end section -variable [MeasurableSpace α] [MeasurableSpace β] +variable {mα : MeasurableSpace α} [MeasurableSpace β] variable {M : Type*} [AddCommMonoid M] [TopologicalSpace M] variable (v : VectorMeasure α M) @@ -642,7 +642,8 @@ theorem mapRange_add {v w : VectorMeasure α M} {f : M →+ N} (hf : Continuous /-- Given a continuous `AddMonoidHom` `f : M → N`, `mapRangeHom` is the `AddMonoidHom` mapping the vector measure `v` on `M` to the vector measure `f ∘ v` on `N`. -/ -def mapRangeHom (f : M →+ N) (hf : Continuous f) : VectorMeasure α M →+ VectorMeasure α N where +def mapRangeHom {α : Type*} [MeasurableSpace α] (f : M →+ N) (hf : Continuous f) : + VectorMeasure α M →+ VectorMeasure α N where toFun v := v.mapRange f hf map_zero' := mapRange_zero hf map_add' _ _ := mapRange_add hf @@ -664,7 +665,8 @@ variable [ContinuousAdd M] [ContinuousAdd N] /-- Given a continuous linear map `f : M → N`, `mapRangeₗ` is the linear map mapping the vector measure `v` on `M` to the vector measure `f ∘ v` on `N`. -/ -def mapRangeₗ (f : M →ₗ[R] N) (hf : Continuous f) : VectorMeasure α M →ₗ[R] VectorMeasure α N where +def mapRangeₗ {α : Type*} [MeasurableSpace α] (f : M →ₗ[R] N) (hf : Continuous f) : + VectorMeasure α M →ₗ[R] VectorMeasure α N where toFun v := v.mapRange f.toAddMonoidHom hf map_add' _ _ := mapRange_add hf map_smul' _ _ := mapRange_smul hf @@ -774,7 +776,7 @@ theorem map_add (v w : VectorMeasure α M) (f : α → β) : (v + w).map f = v.m /-- `VectorMeasure.map` as an additive monoid homomorphism. -/ @[simps] -def mapGm (f : α → β) : VectorMeasure α M →+ VectorMeasure β M where +def mapGm {α : Type*} [MeasurableSpace α] (f : α → β) : VectorMeasure α M →+ VectorMeasure β M where toFun v := v.map f map_zero' := map_zero f map_add' _ _ := map_add _ _ f @@ -789,7 +791,8 @@ theorem restrict_add (v w : VectorMeasure α M) (i : Set α) : /-- `VectorMeasure.restrict` as an additive monoid homomorphism. -/ @[simps] -def restrictGm (i : Set α) : VectorMeasure α M →+ VectorMeasure α M where +def restrictGm {α : Type*} [MeasurableSpace α] (i : Set α) : + VectorMeasure α M →+ VectorMeasure α M where toFun v := v.restrict i map_zero' := restrict_zero map_add' _ _ := restrict_add _ _ i From a1fed594ecac8e3b01f0564ec5410930646c8813 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 31 May 2026 22:50:43 +0200 Subject: [PATCH 090/129] fix --- .../Function/ConditionalExpectation/LebesgueBochner.lean | 2 +- Mathlib/MeasureTheory/VectorMeasure/AddContent.lean | 4 +++- Mathlib/MeasureTheory/VectorMeasure/Variation/Defs.lean | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/LebesgueBochner.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/LebesgueBochner.lean index c7b26bcd5a8983..18e03b3093de18 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/LebesgueBochner.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/LebesgueBochner.lean @@ -93,7 +93,7 @@ lemma condLExp_enorm (m : MeasurableSpace 𝓧) {m𝓧 : MeasurableSpace 𝓧} { lemma lintegral_enorm_condExp_indicator {m : MeasurableSpace 𝓧} {m𝓧 : MeasurableSpace 𝓧} (hm : m ≤ m𝓧) {μ : Measure 𝓧} - [SigmaFinite (μ.trim hm)] {s : Set 𝓧} (hs : MeasurableSet s) (h's : μ s ≠ ∞) : + [SigmaFinite (μ.trim hm)] {s : Set 𝓧} (hs : MeasurableSet s) (h's : μ s ≠ ∞ := by finiteness) : ∫⁻ a, ‖μ[s.indicator (1 : 𝓧 → ℝ) | m] a‖ₑ ∂μ = μ s := calc _ = ∫⁻ a, μ⁻[fun x ↦ ‖s.indicator (1 : 𝓧 → ℝ) x‖ₑ | m] a ∂μ := by apply lintegral_congr_ae diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index 4dc981377cfcec..3e0f6dae9a7285 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -360,7 +360,9 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] simp only [f_meas, ↓reduceIte, implies_true, MeasurableSet.iUnion, indicator_iUnion_of_pairwise_disjoint _ hf, this] have I : ∑' (i : ℕ), ∫⁻ (a : α), ‖μ[(f i).indicator (1 : α → ℝ) | M] a‖ₑ ∂μ < ∞ := by - simp_rw [lintegral_enorm_condExp_indicator _ (f_meas _), ← measure_iUnion hf f_meas] + have A i : ∫⁻ a, ‖μ[(f i).indicator (1 : α → ℝ) | M] a‖ₑ ∂μ = μ (f i) := + lintegral_enorm_condExp_indicator Mle (f_meas i) + simp_rw [A, ← measure_iUnion hf f_meas] exact measure_lt_top _ _ rw [integral_tsum (by fun_prop)]; swap · apply ne_of_lt diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Defs.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Defs.lean index 4c558c1518bf29..d016a7295db87b 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Defs.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Defs.lean @@ -32,7 +32,7 @@ not less than this function. It turns out that this function is a measure. @[expose] public section -variable {X : Type*} [MeasurableSpace X] +variable {X : Type*} {mX : MeasurableSpace X} open scoped ENNReal From b3d2d93121907771d0410e4c0304a53de3698796 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 31 May 2026 22:59:57 +0200 Subject: [PATCH 091/129] complete proof --- .../VectorMeasure/AddContent.lean | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index 3e0f6dae9a7285..b524aeaa2ab505 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -293,10 +293,6 @@ private lemma exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom_of /-- Consider an additive content `m ` on a semi-ring of sets `C`, which is dominated by a finite measure `μ`. Assume that `C` generates the sigma-algebra. Then `m` extends to a countably additive vector measure which is dominated by `μ`. -/ -/- TODO: weaken the assumption that `C` generates the sigma-algebra to measurability of all -elements of `C`, once integrals wrt vector measures is available (by composing the integral wrt `m'` -on the generated sigma-algebra, with conditional expectation of the indicator function to project -on the generated sigma-algebra). -/ theorem exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom [IsFiniteMeasure μ] {C : Set (Set α)} {m : AddContent E C} (hC : IsSetSemiring C) (hm : ∀ s ∈ C, ‖m s‖ₑ ≤ μ s) (h'C : hα = generateFrom C) : @@ -317,6 +313,9 @@ theorem exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom exact ae_le_set_inter Filter.EventuallyLE.rfl (hD s hs) exact ⟨m', h, fun s ↦ (h' s).trans (Measure.restrict_apply_le (⋃₀ D) s)⟩ +/-- Consider an additive content `m ` on a semi-ring of measurable sets `C`, which is dominated +by a finite measure `μ`. +Then `m` extends to a countably additive vector measure which is dominated by `μ`. -/ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] [IsFiniteMeasure μ] {C : Set (Set α)} {m : AddContent E C} (hC : IsSetSemiring C) (hm : ∀ s ∈ C, ‖m s‖ₑ ≤ μ s) (h'C : ∀ s ∈ C, MeasurableSet s) : @@ -324,8 +323,7 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] /- On the sigma-algebra `M` generated by `C`, the desired vector measure is provided by `exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom`. We extend it to the whole sigma-algebra of measurable sets by integrating the conditional expectation with respect to `M`. - This extension satisfies all the desired properties. - -/ + This extension satisfies all the desired properties. -/ classical let M : MeasurableSpace α := generateFrom C have Mle : M ≤ hα := generateFrom_le h'C @@ -339,7 +337,7 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] apply (variation_transpose_le _ _).trans grw [ContinuousLinearMap.opNNNorm_lsmul_le, one_smul] exact variation_le_of_forall_enorm_le (fun s hs ↦ hm' _) - -- next line is to make sure that the default instance is picked below. + -- next line is to make sure that the default instance is picked below when defininig `m''`. let : MeasurableSpace α := hα let m'' : VectorMeasure α E := { measureOf' s := if MeasurableSet s then ∫ᵛ x, μ[s.indicator 1 | M] x ∂• m' else 0 @@ -384,25 +382,19 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] rw [condExp_of_stronglyMeasurable Mle] · exact StronglyMeasurable.indicator stronglyMeasurable_const (measurableSet_generateFrom hs) - · apply (integrable_const 1).indicator (h'C s hs) + · exact (integrable_const 1).indicator (h'C s hs) rw [this, integral_indicator (measurableSet_generateFrom hs)] - simp only [Pi.one_apply] have : IsFiniteMeasure ((m'.restrict s).transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation := by apply isFiniteMeasure_of_le (μ := μ') grw [transpose_restrict, variation_restrict_le, Measure.restrict_le_self, m'_le] - rw [setIntegral_const] + simp only [Pi.one_apply, setIntegral_const] simp [m'C s hs] · by_cases hs : MeasurableSet s; swap · simp [not_measurable _ hs] simp only [hs, ↓reduceIte, m''] apply enorm_integral_le_lintegral_enorm.trans apply (lintegral_mono' m'_le le_rfl).trans_eq - rw [hμ', lintegral_trim _ (by fun_prop), lintegral_enorm_condExp_indicator _ hs] - - - - - + rw [hμ', lintegral_trim _ (by fun_prop), lintegral_enorm_condExp_indicator Mle hs] end MeasureTheory.VectorMeasure From a7292442bc245d8e3acc7d50a47defd8955d15a7 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 1 Jun 2026 08:23:09 +0200 Subject: [PATCH 092/129] fix --- Mathlib/MeasureTheory/VectorMeasure/Basic.lean | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index 314f87aca47cfb..f775d25691d651 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -665,7 +665,7 @@ variable [ContinuousAdd M] [ContinuousAdd N] /-- Given a continuous linear map `f : M → N`, `mapRangeₗ` is the linear map mapping the vector measure `v` on `M` to the vector measure `f ∘ v` on `N`. -/ -def mapRangeₗ {α : Type*} [MeasurableSpace α] (f : M →ₗ[R] N) (hf : Continuous f) : +def mapRangeₗ {α : Type*} [MeasurableSpace α] (f : M →ₗ[R] N) (hf : Continuous f) : VectorMeasure α M →ₗ[R] VectorMeasure α N where toFun v := v.mapRange f.toAddMonoidHom hf map_add' _ _ := mapRange_add hf @@ -791,7 +791,7 @@ theorem restrict_add (v w : VectorMeasure α M) (i : Set α) : /-- `VectorMeasure.restrict` as an additive monoid homomorphism. -/ @[simps] -def restrictGm {α : Type*} [MeasurableSpace α] (i : Set α) : +def restrictGm {α : Type*} [MeasurableSpace α] (i : Set α) : VectorMeasure α M →+ VectorMeasure α M where toFun v := v.restrict i map_zero' := restrict_zero From a9a0a211a045848ae63e8dc138309138f64604d2 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 1 Jun 2026 08:55:01 +0200 Subject: [PATCH 093/129] fix docstrings --- Mathlib/MeasureTheory/Covering/Besicovitch.lean | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Mathlib/MeasureTheory/Covering/Besicovitch.lean b/Mathlib/MeasureTheory/Covering/Besicovitch.lean index d7ba1ce135966f..c927048c72c2a9 100644 --- a/Mathlib/MeasureTheory/Covering/Besicovitch.lean +++ b/Mathlib/MeasureTheory/Covering/Besicovitch.lean @@ -658,9 +658,10 @@ one is given a set of admissible closed balls centered at `x`, with arbitrarily Then there exists a disjoint covering of almost all `s` by admissible closed balls centered at some points of `s`. This version requires that the underlying measure is finite, and that the space has the Besicovitch -covering property (which is satisfied for instance by normed real vector spaces). It expresses the -conclusion in a slightly awkward form (with a subset of `α × ℝ`) coming from the proof technique. -For a version assuming that the measure is sigma-finite, +covering property (which is satisfied for instance by finite-dimensional normed real vector spaces). +It expresses the conclusion in a slightly awkward form (with a subset of `α × ℝ`) coming from the +proof technique. +For a version assuming that the measure is s-finite, see `exists_disjoint_closedBall_covering_ae_aux`. For a version giving the conclusion in a nicer form, see `exists_disjoint_closedBall_covering_ae`. -/ @@ -802,8 +803,9 @@ Assume that, for any `x` in a set `s`, one is given a set of admissible closed b `x`, with arbitrarily small radii. Then there exists a disjoint covering of almost all `s` by admissible closed balls centered at some points of `s`. -This version requires the underlying measure to be sigma-finite, and the space to have the -Besicovitch covering property (which is satisfied for instance by normed real vector spaces). +This version requires the underlying measure to be s-finite, and the space to have the +Besicovitch covering property (which is satisfied for instance by finite-dimensional +normed real vector spaces). It expresses the conclusion in a slightly awkward form (with a subset of `α × ℝ`) coming from the proof technique. From 0eda9be6ae8514b16a7c103200bab3cfe2eaff58 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 1 Jun 2026 09:35:13 +0200 Subject: [PATCH 094/129] fix --- .../MeasureTheory/VectorMeasure/WithDensityVec.lean | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index e27fc34264b917..05cbad276cc2c6 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -340,7 +340,7 @@ lemma variation_withDensityᵥ [CompleteSpace E] with respect to the measure `μ.withDensity ‖f‖` interpreted as a signed measure. -/ rcases subsingleton_or_nontrivial E with hE | hE · simp [show f = 0 from Subsingleton.elim _ _] - have : IsFiniteMeasure (μ.withDensity fun x ↦ ‖f x‖ₑ) := ⟨by simpa using hf.2⟩ + have : IsFiniteMeasure (μ.withDensity fun x ↦ ‖f x‖ₑ) := ⟨by simpa using! hf.2⟩ have I : (μ.withDensity fun x ↦ ‖f x‖ₑ).toSignedMeasure.Integrable (fun x ↦ ‖f x‖⁻¹ • f x) (ContinuousLinearMap.lsmul ℝ ℝ).flip := by apply Integrable.mono_measure _ (variation_transpose_le _ _) @@ -374,12 +374,4 @@ lemma variation_withDensityᵥ [CompleteSpace E] simp only [enorm_smul, Pi.mul_apply, ne_eq, h'x, not_false_eq_true, enorm_inv, enorm_norm] rw [ENNReal.inv_mul_cancel (by simpa using hx) (by simp), mul_one] - - - - - - - - end MeasureTheory.VectorMeasure From b7622b828f5012c7e598ca71b1a813c35d86c3ca Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 1 Jun 2026 10:09:17 +0200 Subject: [PATCH 095/129] simp --- Mathlib/MeasureTheory/VectorMeasure/Integral.lean | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 1aae44eea2b4b5..b989d3f67ba8c6 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -274,11 +274,6 @@ theorem integral_of_not_completeSpace (hG : ¬CompleteSpace G) : variable {f g : X → E} {μ ν : VectorMeasure X F} {B C : E →L[ℝ] F →L[ℝ] G} -@[simp] -theorem transpose_zero_vectorMeasure (B : E →L[ℝ] F →L[ℝ] G) : - (0 : VectorMeasure X F).transpose B = 0 := by - simp [transpose] - @[simp] theorem transpose_zero_cbm (μ : VectorMeasure X F) : μ.transpose (0 : E →L[ℝ] F →L[ℝ] G) = 0 := by @@ -401,7 +396,7 @@ end Function section VectorMeasure @[simp] lemma integrable_zero_vectorMeasure : (0 : VectorMeasure X F).Integrable f B := by - simp [VectorMeasure.Integrable, transpose] + simp [VectorMeasure.Integrable] lemma integrable_add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : (μ + ν).Integrable f B := by From 6e18cc9fd9b82ba86eb597e800ee045c6294d029 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Mon, 1 Jun 2026 10:55:02 +0200 Subject: [PATCH 096/129] Apply suggestion from @sgouezel --- Mathlib/Analysis/Normed/Operator/Mul.lean | 1 - 1 file changed, 1 deletion(-) diff --git a/Mathlib/Analysis/Normed/Operator/Mul.lean b/Mathlib/Analysis/Normed/Operator/Mul.lean index 5a34126234f616..ca81beac0bcebf 100644 --- a/Mathlib/Analysis/Normed/Operator/Mul.lean +++ b/Mathlib/Analysis/Normed/Operator/Mul.lean @@ -261,7 +261,6 @@ theorem opNorm_lsmul [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Module R E] refine le_of_mul_le_mul_right ?_ (norm_pos_iff.mpr hy) simpa using le_of_opNorm_le _ (h 1) y - /-- The norm of `lsmul x` equals `‖x‖` in any nontrivial normed group. This is `ContinuousLinearMap.opNorm_lsmul_apply_le` as an equality. -/ From bcb590f8b72bcadf8e842b7edc060edb5841e3f0 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Wed, 3 Jun 2026 18:49:00 +0200 Subject: [PATCH 097/129] fix --- Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean index ecedd1db88469f..eb4c1dfefae53a 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/InfiniteSum.lean @@ -107,7 +107,7 @@ private theorem hasSum_coeFn_tsum_nat {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] exact (enorm_def (f n)).symm have B : ∀ᵐ x ∂μ, ∀ n, ⇑((∑ i ∈ range n, f i)) x = ∑ i ∈ range n, f i x := by rw [ae_all_iff] - exact fun i ↦ coeFn_finsetSum_fun _ _ + exact fun i ↦ coeFn_fun_finsetSum _ _ obtain ⟨ns, hns, nslim⟩ : ∃ ns : ℕ → ℕ, StrictMono ns ∧ ∀ᵐ x ∂μ, Tendsto (fun i ↦ (∑ j ∈ range (ns i), f j : Lp E p μ) x) atTop (𝓝 ((∑' n, f n) x)) := by have : Tendsto (fun i ↦ (∑ j ∈ range i, f j)) atTop (𝓝 (∑' n, f n)) := @@ -125,7 +125,7 @@ theorem hasSum_coeFn_tsum {p : ℝ≥0∞} [hp : Fact (1 ≤ p)] {ι : Type*} [C rcases finite_or_infinite ι with hι | hι · let : Fintype ι := Fintype.ofFinite ι simp only [tsum_fintype] - filter_upwards [coeFn_finsetSum_fun univ f] with x hx + filter_upwards [coeFn_fun_finsetSum univ f] with x hx rw [hx] exact hasSum_fintype _ · obtain ⟨e⟩ := nonempty_equiv_of_countable (α := ℕ) (β := ι) From a1ffba5f85f263c5ddb8fd5cc93ab361adebdc06 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Wed, 3 Jun 2026 19:06:33 +0200 Subject: [PATCH 098/129] Apply suggestion from @sgouezel --- Mathlib/MeasureTheory/VectorMeasure/Integral.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index b989d3f67ba8c6..9c2594e4b608e6 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -20,7 +20,7 @@ We fix a continuous linear pairing `B : E →L[ℝ] F →L[ℝ] G` and an `F`-va on a measurable space `X`. For an integrable function `f : X → E` with respect to the total variation of the vector measure on `X` informally written `μ ∘ B.flip`, we define the `G`-valued integral, which is informally -written `∫ᵛ B (f x) ∂[B; μ] x`. +written `∫ B (f x) ∂μ x`. Such integral is defined through the general setting `setToFun` which sends a set function to the integral of integrable functions, see the file From 8ddf000b2c376851ab466a4fd680fb3b674cb3e1 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 6 Jun 2026 09:10:23 +0200 Subject: [PATCH 099/129] more --- Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean | 4 ++-- Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean b/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean index 6cfb1d2441bbdf..ccf6a13c4a6e49 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean @@ -77,7 +77,7 @@ private lemma exists_vectorMeasure_le_measureAux (hf : BoundedVariationOn f univ ∃ m : VectorMeasure α E, (∀ u v, u ≤ v → m (Set.Ioc u v) = f.rightLim v - f.rightLim u) ∧ m botSet = 0 ∧ ∀ s, ‖m s‖ₑ ≤ hf.measureAux s := by /- We will apply the general extension theorem - `VectorMeasure.exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom`. For this, we + `VectorMeasure.exists_extension_of_isSetSemiring_of_le_measure`. For this, we need to check that the additive content is bounded by the measure `measureAux`. -/ rcases isEmpty_or_nonempty α with h'α | h'α · exact ⟨0, by simp⟩ @@ -98,7 +98,7 @@ private lemma exists_vectorMeasure_le_measureAux (hf : BoundedVariationOn f univ borelize α convert! borel_eq_generateFrom_Ioc_le α using 2 grind only - rcases VectorMeasure.exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom + rcases VectorMeasure.exists_extension_of_isSetSemiring_of_le_measure IsSetSemiring.Ioc A B with ⟨m', hm', h'm'⟩ refine ⟨m', fun u v huv ↦ ?_, ?_, h'm'⟩ · rw [hm'] diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 447dc03d3b6fd3..63653d13131390 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -43,6 +43,8 @@ theorem IntegrableOn.union (hs : MeasurableSet s) (ht : MeasurableSet t) grw [transpose_restrict, variation_restrict_le, Measure.restrict_union_le] simp [transpose_restrict, variation_restrict, hs, ht] +/- `simpNF` complains that this lemma can be proved by `simp`, because the `simp`-generated lemma +unfolds the abbrev `VectorMeasure.Integrable`. TODO: fix `simp`. See lean4#13958. -/ @[simp] theorem IntegrableOn.empty : μ.IntegrableOn f B ∅ := by simp [VectorMeasure.IntegrableOn] From 00cef421eddc1790b44f603ef86adef3a2d20005 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 6 Jun 2026 09:19:36 +0200 Subject: [PATCH 100/129] revert --- Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean b/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean index ccf6a13c4a6e49..8853185a9f8afc 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean @@ -98,7 +98,7 @@ private lemma exists_vectorMeasure_le_measureAux (hf : BoundedVariationOn f univ borelize α convert! borel_eq_generateFrom_Ioc_le α using 2 grind only - rcases VectorMeasure.exists_extension_of_isSetSemiring_of_le_measure + rcases VectorMeasure.exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom IsSetSemiring.Ioc A B with ⟨m', hm', h'm'⟩ refine ⟨m', fun u v huv ↦ ?_, ?_, h'm'⟩ · rw [hm'] From e1f84b341ec61b77a362418b8e623b62728544f0 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 6 Jun 2026 09:37:17 +0200 Subject: [PATCH 101/129] cleanup, move to right file --- .../MeasureTheory/VectorMeasure/Integral.lean | 160 ++++++------------ .../VectorMeasure/SetIntegral.lean | 75 ++++++++ 2 files changed, 131 insertions(+), 104 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index ecea614404f831..927543edbd594b 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -363,6 +363,31 @@ theorem integral_eq_zero_of_ae (hf : f =ᵐ[(μ.transpose B).variation] 0) : ∫ᵛ x, f x ∂[B; μ] = 0 := by simp [integral_congr_ae hf] +@[to_fun] lemma Integrable.add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : + μ.Integrable (f + g) B := + MeasureTheory.Integrable.add hf hg + +@[to_fun] lemma Integrable.neg (hf : μ.Integrable f B) : + μ.Integrable (-f) B := + MeasureTheory.Integrable.neg hf + +@[to_fun] lemma Integrable.sub (hf : μ.Integrable f B) (hg : μ.Integrable g B) : + μ.Integrable (f - g) B := + MeasureTheory.Integrable.sub hf hg + +@[to_fun] lemma Integrable.smul {𝕜 : Type*} [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 E] + [IsBoundedSMul 𝕜 E] (c : 𝕜) (hf : μ.Integrable f B) : + μ.Integrable (c • f) B := + MeasureTheory.Integrable.smul c hf + +theorem Integrable.finsetSum {ι : Type*} (s : Finset ι) {f : ι → X → E} + (hf : ∀ i ∈ s, μ.Integrable (f i) B) : μ.Integrable (∑ i ∈ s, f i) B := + integrable_finsetSum' s hf + +theorem Integrable.fun_finsetSum {ι : Type*} (s : Finset ι) {f : ι → X → E} + (hf : ∀ i ∈ s, μ.Integrable (f i) B) : μ.Integrable (fun x ↦ ∑ i ∈ s, f i x) B := + integrable_finsetSum s hf + theorem integral_fun_add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := setToFun_add _ hf hg @@ -404,6 +429,11 @@ variable (f μ B) in theorem integral_smul (c : ℝ) : ∫ᵛ x, (c • f) x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := integral_fun_smul μ B c f +@[simp] +theorem integral_const [CompleteSpace G] [IsFiniteMeasure (μ.transpose B).variation] (c : E) : + ∫ᵛ _ : X, c ∂[B; μ] = B c (μ univ) := + setToFun_const _ _ + end Function section VectorMeasure @@ -472,6 +502,11 @@ theorem integral_smul_vectorMeasure (f : X → E) (c : ℝ) : rw! [← setToFun_congr_smul_measure' _ this, transpose_smul] rfl +@[simp] +theorem integral_smul_nnreal_vectorMeasure (f : X → E) (c : ℝ≥0) : + ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := + integral_smul_vectorMeasure f (c : ℝ) + theorem integral_add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : ∫ᵛ x, f x ∂[B; μ + ν] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := setToFun_add_left'' (by simp [transpose]) hμ hν (by grw [transpose_add, variation_add_le]) @@ -608,7 +643,7 @@ theorem exists_ne_zero_of_integral_ne_zero (frequently_ae_ne_zero_of_integral_ne_zero h).exists @[simp] lemma integral_toSignedMeasure {μ : Measure X} [IsFiniteMeasure μ] {f : X → G} : - ∫ᵛ x, f x ∂[(ContinuousLinearMap.lsmul ℝ ℝ).flip; μ.toSignedMeasure] = ∫ x, f x ∂μ := by + ∫ᵛ x, f x ∂<•μ.toSignedMeasure = ∫ x, f x ∂μ := by rcases subsingleton_or_nontrivial G with h'G | h'G · apply Subsingleton.elim rw [integral_eq_setToFun, MeasureTheory.integral_eq_setToFun] @@ -619,29 +654,12 @@ theorem exists_ne_zero_of_integral_ne_zero ContinuousLinearMap.coe_coe, weightedSMul] rfl -/-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: -it tends to zero as `(μ.transpose B).variation s` tends to zero. -/ -theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} - (hf : μ.Integrable f B) {l : Filter ι} {s : ι → Set X} - (hs : Tendsto ((μ.transpose B).variation ∘ s) l (𝓝 0)) : - Tendsto (fun i => ∫ᵛ x in s i, f x ∂[B; μ]) l (𝓝 0) := by - rw [tendsto_zero_iff_norm_tendsto_zero] - simp_rw [← coe_nnnorm, ← NNReal.coe_zero, NNReal.tendsto_coe, ← ENNReal.tendsto_coe, - ENNReal.coe_zero] - apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds - (tendsto_setLIntegral_zero (ne_of_lt hf.2) hs) (fun i => zero_le) - intro i - apply enorm_integral_le_lintegral_enorm.trans - apply lintegral_mono' _ le_rfl - rw [transpose_restrict] - apply variation_restrict_le - /-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ theorem tendsto_integral_of_L1 {ι} (f : X → E) (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) - (hF : Tendsto (fun i => ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) : - Tendsto (fun i => ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := + (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) : + Tendsto (fun i ↦ ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := tendsto_setToFun_of_L1 _ f hfi hFi hF /-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ @@ -654,74 +672,40 @@ lemma tendsto_integral_of_L1' {ι} (f : X → E) simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF exact hF -/-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ -lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) - (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} - {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) - (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) - (s : Set X) : - Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by - refine tendsto_integral_of_L1 f ?_ ?_ ?_ - · apply hfi.mono_measure - grw [transpose_restrict, variation_restrict_le, Measure.restrict_le_self] - · filter_upwards [hFi] with i hi using hi.restrict - · simp_rw [← eLpNorm_one_eq_lintegral_enorm] at hF ⊢ - apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hF (fun _ ↦ zero_le) - (fun i ↦ ?_) - apply eLpNorm_mono_measure - grw [transpose_restrict, variation_restrict_le] - apply Measure.restrict_le_self - -/-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ -lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) - (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} - {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) - (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 (μ.transpose B).variation) l (𝓝 0)) - (s : Set X) : - Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by - refine tendsto_setIntegral_of_L1 f hfi hFi ?_ s - simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF - exact hF - variable {Y : Type*} [TopologicalSpace Y] [FirstCountableTopology Y] theorem continuousWithinAt_of_dominated {F : Y → X → E} {x₀ : Y} {bound : X → ℝ} {s : Set Y} (hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) (μ.transpose B).variation) (h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousWithinAt (fun x => F x a) s x₀) : - ContinuousWithinAt (fun x => ∫ᵛ a, F x a ∂[B; μ]) s x₀ := + (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousWithinAt (fun x ↦ F x a) s x₀) : + ContinuousWithinAt (fun x ↦ ∫ᵛ a, F x a ∂[B; μ]) s x₀ := continuousWithinAt_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont theorem continuousAt_of_dominated {F : Y → X → E} {x₀ : Y} {bound : X → ℝ} (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) (μ.transpose B).variation) (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousAt (fun x => F x a) x₀) : - ContinuousAt (fun x => ∫ᵛ a, F x a ∂[B; μ]) x₀ := + (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousAt (fun x ↦ F x a) x₀) : + ContinuousAt (fun x ↦ ∫ᵛ a, F x a ∂[B; μ]) x₀ := continuousAt_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont theorem continuousOn_of_dominated {F : Y → X → E} {bound : X → ℝ} {s : Set Y} (hF_meas : ∀ x ∈ s, AEStronglyMeasurable (F x) (μ.transpose B).variation) (h_bound : ∀ x ∈ s, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousOn (fun x => F x a) s) : - ContinuousOn (fun x => ∫ᵛ a, F x a ∂[B; μ]) s := + (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousOn (fun x ↦ F x a) s) : + ContinuousOn (fun x ↦ ∫ᵛ a, F x a ∂[B; μ]) s := continuousOn_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont theorem continuous_of_dominated {F : Y → X → E} {bound : X → ℝ} (hF_meas : ∀ x, AEStronglyMeasurable (F x) (μ.transpose B).variation) (h_bound : ∀ x, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, Continuous fun x => F x a) : - Continuous fun x => ∫ᵛ a, F x a ∂[B; μ] := + (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, Continuous fun x ↦ F x a) : + Continuous fun x ↦ ∫ᵛ a, F x a ∂[B; μ] := continuous_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont -@[simp] -theorem integral_const [CompleteSpace G] [IsFiniteMeasure (μ.transpose B).variation] (c : E) : - ∫ᵛ _ : X, c ∂[B; μ] = B c (μ univ) := - setToFun_const _ _ - theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure (μ.transpose B).variation] {C : ℝ} (h : ∀ᵐ x ∂(μ.transpose B).variation, ‖f x‖ ≤ C) : ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ C * (μ.transpose B).variation.real univ := calc @@ -748,17 +732,6 @@ theorem enorm_integral_le_of_enorm_le_const ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ C * (μ.transpose B).variation univ := enorm_integral_le_lintegral_enorm.trans ((lintegral_mono_ae h).trans (by simp)) -theorem setIntegral_vectorMeasure_zero (f : X → E) {s : Set X} - (hs : (μ.transpose B).variation s = 0) : - ∫ᵛ x in s, f x ∂[B; μ] = 0 := by - by_cases h's : MeasurableSet s; swap - · simp [restrict_not_measurable μ h's] - have : ((μ.restrict s).transpose B).variation = 0 := by - rw [transpose_restrict, variation_restrict h's] - apply Measure.restrict_eq_zero.2 hs - have : (μ.restrict s).transpose B = 0 := variation_eq_zero.1 this - simp [integral, this] - theorem nndist_integral_add_vectorMeasure_le_lintegral (h₁ : μ.Integrable f B) (h₂ : ν.Integrable f B) : (nndist (∫ᵛ x, f x ∂[B; μ]) (∫ᵛ x, f x ∂[B; (μ + ν)]) : ℝ≥0∞) ≤ @@ -766,11 +739,6 @@ theorem nndist_integral_add_vectorMeasure_le_lintegral rw [integral_add_vectorMeasure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel_left] exact enorm_integral_le_lintegral_enorm -@[simp] -theorem integral_smul_nnreal_vectorMeasure (f : X → E) (c : ℝ≥0) : - ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := - integral_smul_vectorMeasure f (c : ℝ) - variable {β : Type*} [MeasurableSpace β] {φ : X → β} {a : X} {v : F} lemma variation_transpose_map_le : @@ -857,22 +825,6 @@ theorem integral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] [Complet exact Measure.ae_smul_measure (ae_eq_dirac f) _ _ = B (f a) v := by simp -theorem setIntegral_dirac' {mX : MeasurableSpace X} [CompleteSpace G] - (hf : StronglyMeasurable f) {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : - ∫ᵛ x in s, f x ∂[B; VectorMeasure.dirac a v] = if a ∈ s then B (f a) v else 0 := by - rw [restrict_dirac hs] - split_ifs - · exact integral_dirac' hf - · exact integral_zero_vectorMeasure - -theorem setIntegral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] [CompleteSpace G] - {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : - ∫ᵛ x in s, f x ∂[B; VectorMeasure.dirac a v] = if a ∈ s then B (f a) v else 0 := by - rw [restrict_dirac hs] - split_ifs - · exact integral_dirac - · exact integral_zero_vectorMeasure - theorem integral_singleton' [CompleteSpace G] (hf : StronglyMeasurable f) : ∫ᵛ a in {a}, f a ∂[B; μ] = B (f a) (μ {a}) := by simp only [restrict_singleton, integral_dirac' hf] @@ -896,8 +848,8 @@ theorem tendsto_integral_of_dominated_convergence {F : ℕ → X → E} {f : X (F_measurable : ∀ n, AEStronglyMeasurable (F n) (μ.transpose B).variation) (bound_integrable : Integrable bound (μ.transpose B).variation) (h_bound : ∀ n, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound a) - (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n => F n a) atTop (𝓝 (f a))) : - Tendsto (fun n => ∫ᵛ a, F n a ∂[B; μ]) atTop (𝓝 <| ∫ᵛ a, f a ∂[B; μ]) := + (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n ↦ F n a) atTop (𝓝 (f a))) : + Tendsto (fun n ↦ ∫ᵛ a, F n a ∂[B; μ]) atTop (𝓝 <| ∫ᵛ a, f a ∂[B; μ]) := tendsto_setToFun_of_dominated_convergence _ bound F_measurable bound_integrable h_bound h_lim /-- Lebesgue dominated convergence theorem for filters with a countable basis -/ @@ -906,7 +858,7 @@ theorem tendsto_integral_filter_of_dominated_convergence {l : Filter ι} [l.IsCo (hF_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) (μ.transpose B).variation) (h_bound : ∀ᶠ n in l, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound a) (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n => F n a) l (𝓝 (f a))) : + (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n ↦ F n a) l (𝓝 (f a))) : Tendsto (fun n ↦ ∫ᵛ a, F n a ∂[B; μ]) l (𝓝 <| ∫ᵛ a, f a ∂[B; μ]) := tendsto_setToFun_filter_of_dominated_convergence _ bound hF_meas h_bound bound_integrable h_lim @@ -914,10 +866,10 @@ theorem tendsto_integral_filter_of_dominated_convergence {l : Filter ι} [l.IsCo theorem hasSum_integral_of_dominated_convergence [Countable ι] {F : ι → X → E} {f : X → E} (bound : ι → X → ℝ) (hF_meas : ∀ n, AEStronglyMeasurable (F n) (μ.transpose B).variation) (h_bound : ∀ n, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound n a) - (bound_summable : ∀ᵐ a ∂(μ.transpose B).variation, Summable fun n => bound n a) - (bound_integrable : Integrable (fun a => ∑' n, bound n a) (μ.transpose B).variation) - (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, HasSum (fun n => F n a) (f a)) : - HasSum (fun n => ∫ᵛ a, F n a ∂[B; μ]) (∫ᵛ a, f a ∂[B; μ]) := + (bound_summable : ∀ᵐ a ∂(μ.transpose B).variation, Summable fun n ↦ bound n a) + (bound_integrable : Integrable (fun a ↦ ∑' n, bound n a) (μ.transpose B).variation) + (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, HasSum (fun n ↦ F n a) (f a)) : + HasSum (fun n ↦ ∫ᵛ a, F n a ∂[B; μ]) (∫ᵛ a, f a ∂[B; μ]) := hasSum_setToFun_of_dominated_convergence _ bound hF_meas h_bound bound_summable bound_integrable h_lim @@ -934,9 +886,9 @@ to the integral of `f`. -/ theorem tendsto_integral_filter_of_norm_le_const {l : Filter ι} [l.IsCountablyGenerated] {F : ι → X → E} [IsFiniteMeasure (μ.transpose B).variation] {f : X → E} (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) (μ.transpose B).variation) - (h_bound : ∃ C, ∀ᶠ n in l, ∀ᵐ ω ∂(μ.transpose B).variation, ‖F n ω‖ ≤ C) - (h_lim : ∀ᵐ ω ∂(μ.transpose B).variation, Tendsto (fun n => F n ω) l (𝓝 (f ω))) : - Tendsto (fun n => ∫ᵛ ω, F n ω ∂[B; μ]) l (𝓝 (∫ᵛ ω, f ω ∂[B; μ])) := + (h_bound : ∃ C, ∀ᶠ n in l, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ C) + (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n ↦ F n a) l (𝓝 (f a))) : + Tendsto (fun n ↦ ∫ᵛ a, F n a ∂[B; μ]) l (𝓝 (∫ᵛ a, f a ∂[B; μ])) := tendsto_setToFun_filter_of_norm_le_const _ h_meas h_bound h_lim end VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 63653d13131390..afaca0a6be7395 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -310,6 +310,33 @@ theorem exists_ne_zero_of_setIntegral_ne_zero (hU : ∫ᵛ x in t, f x ∂[B; μ ∃ x, x ∈ t ∧ f x ≠ 0 := by contrapose! hU; exact setIntegral_eq_zero_of_forall_eq_zero hU +theorem setIntegral_vectorMeasure_zero (f : X → E) {s : Set X} + (hs : (μ.transpose B).variation s = 0) : + ∫ᵛ x in s, f x ∂[B; μ] = 0 := by + by_cases h's : MeasurableSet s; swap + · simp [restrict_not_measurable μ h's] + have : ((μ.restrict s).transpose B).variation = 0 := by + rw [transpose_restrict, variation_restrict h's] + apply Measure.restrict_eq_zero.2 hs + have : (μ.restrict s).transpose B = 0 := variation_eq_zero.1 this + simp [integral, this] + +theorem setIntegral_dirac' {mX : MeasurableSpace X} [CompleteSpace G] + (hf : StronglyMeasurable f) {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : + ∫ᵛ x in s, f x ∂[B; VectorMeasure.dirac a v] = if a ∈ s then B (f a) v else 0 := by + rw [restrict_dirac hs] + split_ifs + · exact integral_dirac' hf + · exact integral_zero_vectorMeasure + +theorem setIntegral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] [CompleteSpace G] + {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : + ∫ᵛ x in s, f x ∂[B; VectorMeasure.dirac a v] = if a ∈ s then B (f a) v else 0 := by + rw [restrict_dirac hs] + split_ifs + · exact integral_dirac + · exact integral_zero_vectorMeasure + theorem integral_union_eq_left_of_ae (hs : MeasurableSet s) (ht : MeasurableSet t) (ht_eq : ∀ᵐ x ∂(μ.transpose B).variation.restrict t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by @@ -451,4 +478,52 @@ theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} = ∫ x in s, f x ∂μ := by rw [← integral_toSignedMeasure, restrict_toSignedMeasure hs] + +/-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: +it tends to zero as `(μ.transpose B).variation s` tends to zero. -/ +theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} + (hf : μ.Integrable f B) {l : Filter ι} {s : ι → Set X} + (hs : Tendsto ((μ.transpose B).variation ∘ s) l (𝓝 0)) : + Tendsto (fun i ↦ ∫ᵛ x in s i, f x ∂[B; μ]) l (𝓝 0) := by + rw [tendsto_zero_iff_norm_tendsto_zero] + simp_rw [← coe_nnnorm, ← NNReal.coe_zero, NNReal.tendsto_coe, ← ENNReal.tendsto_coe, + ENNReal.coe_zero] + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds + (tendsto_setLIntegral_zero (ne_of_lt hf.2) hs) (fun i ↦ zero_le) + intro i + apply enorm_integral_le_lintegral_enorm.trans + apply lintegral_mono' _ le_rfl + rw [transpose_restrict] + apply variation_restrict_le + + +/-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ +lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) + (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) + (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) + (s : Set X) : + Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by + refine tendsto_integral_of_L1 f ?_ ?_ ?_ + · apply hfi.mono_measure + grw [transpose_restrict, variation_restrict_le, Measure.restrict_le_self] + · filter_upwards [hFi] with i hi using hi.restrict + · simp_rw [← eLpNorm_one_eq_lintegral_enorm] at hF ⊢ + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hF (fun _ ↦ zero_le) + (fun i ↦ ?_) + apply eLpNorm_mono_measure + grw [transpose_restrict, variation_restrict_le] + apply Measure.restrict_le_self + +/-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ +lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) + (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) + (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 (μ.transpose B).variation) l (𝓝 0)) + (s : Set X) : + Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by + refine tendsto_setIntegral_of_L1 f hfi hFi ?_ s + simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF + exact hF + end MeasureTheory.VectorMeasure From ca182b714758cf35c36e15f9d3a2d8c026a2cf58 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 6 Jun 2026 10:17:21 +0200 Subject: [PATCH 102/129] cleanup --- .../MeasureTheory/VectorMeasure/Integral.lean | 8 - .../VectorMeasure/SetIntegral.lean | 183 +++++++++--------- 2 files changed, 95 insertions(+), 96 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 927543edbd594b..f3ae55b3f0e9c2 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -825,14 +825,6 @@ theorem integral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] [Complet exact Measure.ae_smul_measure (ae_eq_dirac f) _ _ = B (f a) v := by simp -theorem integral_singleton' [CompleteSpace G] (hf : StronglyMeasurable f) : - ∫ᵛ a in {a}, f a ∂[B; μ] = B (f a) (μ {a}) := by - simp only [restrict_singleton, integral_dirac' hf] - -theorem integral_singleton [MeasurableSingletonClass X] [CompleteSpace G] : - ∫ᵛ a in {a}, f a ∂[B; μ] = B (f a) (μ {a}) := by - simp only [restrict_singleton, integral_dirac] - theorem integral_unique [Unique X] [CompleteSpace G] : ∫ᵛ x, f x ∂[B; μ] = B (f default) (μ univ) := calc diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index afaca0a6be7395..d069eea234c65d 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -10,8 +10,10 @@ public import Mathlib.MeasureTheory.VectorMeasure.Integral /-! # Set integral -In this file we prove some properties of `∫ᵛ x in s, f x ∂[B; μ]`. Recall that this notation +In this file we prove properties of `∫ᵛ x in s, f x ∂[B; μ]`. Recall that this notation is defined as `∫ᵛ x, f x ∂[B; μ.restrict s]`. + +The API in this file is modelled on the API for the Bochner integral. -/ @[expose] public section @@ -48,7 +50,7 @@ unfolds the abbrev `VectorMeasure.Integrable`. TODO: fix `simp`. See lean4#13958 @[simp] theorem IntegrableOn.empty : μ.IntegrableOn f B ∅ := by simp [VectorMeasure.IntegrableOn] -theorem integrableOn_biUnion_finite +theorem IntegrableOn.biUnion_finite {s : Set ι} (hs : s.Finite) {t : ι → Set X} (ht : ∀ i ∈ s, MeasurableSet (t i)) (h't : ∀ i ∈ s, μ.IntegrableOn f B (t i)) : μ.IntegrableOn f B (⋃ i ∈ s, t i) := by @@ -58,16 +60,16 @@ theorem integrableOn_biUnion_finite simp only [mem_insert_iff, forall_eq_or_imp, iUnion_iUnion_eq_or_left] at ht h't ⊢ exact IntegrableOn.union ht.1 (h's.measurableSet_biUnion ht.2) h't.1 (hf ht.2 h't.2) -theorem integrableOn_biUnion_finset {s : Finset ι} {t : ι → Set X} +theorem IntegrableOn.biUnion_finset {s : Finset ι} {t : ι → Set X} (ht : ∀ i ∈ s, MeasurableSet (t i)) (h't : ∀ i ∈ s, μ.IntegrableOn f B (t i)) : μ.IntegrableOn f B (⋃ i ∈ s, t i) := - integrableOn_biUnion_finite s.finite_toSet ht h't + IntegrableOn.biUnion_finite s.finite_toSet ht h't -theorem integrableOn_iUnion_finite [Finite ι] {t : ι → Set X} +theorem IntegrableOn.iUnion_finite [Finite ι] {t : ι → Set X} (ht : ∀ i, MeasurableSet (t i)) (h't : ∀ i, μ.IntegrableOn f B (t i)) : μ.IntegrableOn f B (⋃ i, t i) := by cases nonempty_fintype ι - simpa using integrableOn_biUnion_finset (f := f) (μ := μ) (s := Finset.univ) (t := t) + simpa using IntegrableOn.biUnion_finset (f := f) (μ := μ) (s := Finset.univ) (t := t) (fun i hi ↦ ht i) (fun i hi ↦ h't i) @[simp] theorem integrableOn_univ : μ.IntegrableOn f B univ ↔ μ.Integrable f B := by @@ -127,7 +129,7 @@ theorem setIntegral_biUnion_finset {ι : Type*} (t : Finset ι) {s : ι → Set · exact hs.1 · exact Finset.measurableSet_biUnion _ hs.2 · exact hf.1 - · apply integrableOn_biUnion_finset hs.2 hf.2 + · apply IntegrableOn.biUnion_finset hs.2 hf.2 theorem setIntegral_iUnion_fintype {ι : Type*} [Fintype ι] {s : ι → Set X} (hs : ∀ i, MeasurableSet (s i)) (h's : Pairwise (Disjoint on s)) @@ -202,76 +204,6 @@ theorem integral_piecewise [DecidablePred (· ∈ s)] integral_add (hf.integrable_indicator hs) (hg.integrable_indicator hs.compl), integral_indicator hs, integral_indicator hs.compl] -theorem enorm_setIntegral_le_lintegral_enorm : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x in s, ‖f x‖ₑ ∂(μ.transpose B).variation := by - grw [enorm_integral_le_lintegral_enorm, transpose_restrict] - exact lintegral_mono' variation_restrict_le le_rfl - -private theorem hasSum_setIntegral_iUnion_nat {s : ℕ → Set X} - (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) - (hfi : μ.IntegrableOn f B (⋃ i, s i)) : - HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by - by_cases hG : CompleteSpace G; swap - · simp [integral_of_not_completeSpace hG] - have I : ∑' i, ∫⁻ x in s i, ‖f x‖ₑ ∂(μ.transpose B).variation < ∞ := calc - _ = ∫⁻ x in (⋃ i, s i), ‖f x‖ₑ ∂(μ.transpose B).variation := (lintegral_iUnion hm hd _).symm - _ < ∞ := by - simp only [VectorMeasure.IntegrableOn, VectorMeasure.Integrable, transpose_restrict, - variation_restrict (MeasurableSet.iUnion hm)] at hfi - exact hfi.2 - have : Summable (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) := by - apply Summable.of_enorm (lt_of_le_of_lt _ I).ne - gcongr - exact enorm_setIntegral_le_lintegral_enorm - apply (Summable.hasSum_iff_tendsto_nat this).2 - simp_rw [tendsto_iff_edist_tendsto_0, edist_eq_enorm_sub, enorm_sub_rev] - apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds - (ENNReal.tendsto_sum_nat_add _ I.ne) (by positivity) (fun N ↦ ?_) - have : ⋃ n, s n = (⋃ n ∈ Finset.range N, s n) ∪ (⋃ n, s (n + N)) := by - ext x - have : (∃ i, x ∈ s (i + N)) ↔ (∃ i ≥ N, x ∈ s i) := - ⟨fun ⟨i, hi⟩ ↦ ⟨i + N, by grind⟩, fun ⟨i, hi, h'i⟩ ↦ ⟨i - N, by grind⟩⟩ - simp only [mem_iUnion, Finset.mem_range, mem_union, exists_prop, this, ge_iff_le] - grind - rw [this, setIntegral_union]; rotate_left - · simp only [Finset.mem_range, disjoint_iUnion_right, disjoint_iUnion_left] - intro i j hi - apply hd (by grind) - · apply MeasurableSet.biUnion (Finset.countable_toSet _) (fun i hi ↦ hm i) - · apply MeasurableSet.iUnion (fun i ↦ hm _) - · apply hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) - · apply hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) - rw [setIntegral_biUnion_finset]; rotate_left - · exact fun i hi ↦ hm i - · exact fun i hi j hj hij ↦ hd hij - · exact fun i hi ↦ hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) - simp only [add_sub_cancel_left] - apply enorm_setIntegral_le_lintegral_enorm.trans_eq - rw [lintegral_iUnion (fun i ↦ hm _)] - exact fun i j hij ↦ hd (by grind) - -theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} - (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) - (hfi : μ.IntegrableOn f B (⋃ i, s i)) : - HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by - classical - rcases finite_or_infinite ι with hι | hι - · letI : Fintype ι := Fintype.ofFinite ι - have : ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑ i, ∫ᵛ x in s i, f x ∂[B; μ] := by - rw [setIntegral_iUnion_fintype hm hd (fun i ↦ ?_)] - exact hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) - rw [this] - apply hasSum_fintype - obtain ⟨e⟩ : Nonempty (ι ≃ ℕ) := nonempty_equiv_of_countable - rw [← e.symm.surjective.iUnion_comp, ← e.symm.hasSum_iff] - apply hasSum_setIntegral_iUnion_nat (fun i ↦ hm _) (fun i j hij ↦ hd (by simp [hij])) - rwa [e.symm.surjective.iUnion_comp] - -theorem integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) - (hd : Pairwise (Disjoint on s)) (hfi : μ.IntegrableOn f B (⋃ i, s i)) : - ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑' n, ∫ᵛ x in s n, f x ∂[B; μ] := - (HasSum.tsum_eq (hasSum_setIntegral_iUnion hm hd hfi)).symm - theorem setIntegral_eq_zero_of_ae_eq_zero (ht_eq : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ t → f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = 0 := by @@ -319,9 +251,9 @@ theorem setIntegral_vectorMeasure_zero (f : X → E) {s : Set X} rw [transpose_restrict, variation_restrict h's] apply Measure.restrict_eq_zero.2 hs have : (μ.restrict s).transpose B = 0 := variation_eq_zero.1 this - simp [integral, this] + simp [integral_eq_setToFun, this] -theorem setIntegral_dirac' {mX : MeasurableSpace X} [CompleteSpace G] +theorem setIntegral_dirac' {mX : MeasurableSpace X} [CompleteSpace G] {a : X} {v : F} (hf : StronglyMeasurable f) {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : ∫ᵛ x in s, f x ∂[B; VectorMeasure.dirac a v] = if a ∈ s then B (f a) v else 0 := by rw [restrict_dirac hs] @@ -330,14 +262,22 @@ theorem setIntegral_dirac' {mX : MeasurableSpace X} [CompleteSpace G] · exact integral_zero_vectorMeasure theorem setIntegral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] [CompleteSpace G] - {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : + {a : X} {v : F} {s : Set X} (hs : MeasurableSet s) [Decidable (a ∈ s)] : ∫ᵛ x in s, f x ∂[B; VectorMeasure.dirac a v] = if a ∈ s then B (f a) v else 0 := by rw [restrict_dirac hs] split_ifs · exact integral_dirac · exact integral_zero_vectorMeasure -theorem integral_union_eq_left_of_ae (hs : MeasurableSet s) (ht : MeasurableSet t) +theorem integral_singleton' [CompleteSpace G] {a : X} (hf : StronglyMeasurable f) : + ∫ᵛ a in {a}, f a ∂[B; μ] = B (f a) (μ {a}) := by + simp only [restrict_singleton, integral_dirac' hf] + +theorem integral_singleton [MeasurableSingletonClass X] {a : X} [CompleteSpace G] : + ∫ᵛ a in {a}, f a ∂[B; μ] = B (f a) (μ {a}) := by + simp only [restrict_singleton, integral_dirac] + +theorem setIntegral_union_eq_left_of_ae (hs : MeasurableSet s) (ht : MeasurableSet t) (ht_eq : ∀ᵐ x ∂(μ.transpose B).variation.restrict t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by classical @@ -349,16 +289,16 @@ theorem integral_union_eq_left_of_ae (hs : MeasurableSet s) (ht : MeasurableSet simp only [indicator_apply, mem_union] grind -theorem integral_union_eq_left_of_forall (hs : MeasurableSet s) (ht : MeasurableSet t) +theorem setIntegral_union_eq_left_of_forall (hs : MeasurableSet s) (ht : MeasurableSet t) (ht_eq : ∀ x ∈ t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - apply integral_union_eq_left_of_ae hs ht + apply setIntegral_union_eq_left_of_ae hs ht rw [ae_restrict_iff' ht] filter_upwards with x using ht_eq x theorem setIntegral_eq_of_subset_of_ae_diff_eq_zero (hs : MeasurableSet s) (ht : MeasurableSet t) (hts : s ⊆ t) (h't : ∀ᵐ x ∂(μ.transpose B).variation.restrict (t \ s), f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - rwa [← union_diff_cancel hts, integral_union_eq_left_of_ae hs (ht.diff hs)] + rwa [← union_diff_cancel hts, setIntegral_union_eq_left_of_ae hs (ht.diff hs)] /-- If a function vanishes on `t \ s` with `s ⊆ t`, then its integrals on `s` and `t` coincide. -/ @@ -472,13 +412,81 @@ theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} apply norm_setIntegral_le_of_norm_le_const_ae filter_upwards [ae_restrict_mem hs] with x hx using hC x hx +theorem enorm_setIntegral_le_lintegral_enorm : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x in s, ‖f x‖ₑ ∂(μ.transpose B).variation := by + grw [enorm_integral_le_lintegral_enorm, transpose_restrict] + exact lintegral_mono' variation_restrict_le le_rfl + +private theorem hasSum_setIntegral_iUnion_nat {s : ℕ → Set X} + (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) + (hfi : μ.IntegrableOn f B (⋃ i, s i)) : + HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by + by_cases hG : CompleteSpace G; swap + · simp [integral_of_not_completeSpace hG] + have I : ∑' i, ∫⁻ x in s i, ‖f x‖ₑ ∂(μ.transpose B).variation < ∞ := calc + _ = ∫⁻ x in (⋃ i, s i), ‖f x‖ₑ ∂(μ.transpose B).variation := (lintegral_iUnion hm hd _).symm + _ < ∞ := by + simp only [VectorMeasure.IntegrableOn, VectorMeasure.Integrable, transpose_restrict, + variation_restrict (MeasurableSet.iUnion hm)] at hfi + exact hfi.2 + have : Summable (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) := by + apply Summable.of_enorm (lt_of_le_of_lt _ I).ne + gcongr + exact enorm_setIntegral_le_lintegral_enorm + apply (Summable.hasSum_iff_tendsto_nat this).2 + simp_rw [tendsto_iff_edist_tendsto_0, edist_eq_enorm_sub, enorm_sub_rev] + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds + (ENNReal.tendsto_sum_nat_add _ I.ne) (by positivity) (fun N ↦ ?_) + have : ⋃ n, s n = (⋃ n ∈ Finset.range N, s n) ∪ (⋃ n, s (n + N)) := by + ext x + have : (∃ i, x ∈ s (i + N)) ↔ (∃ i ≥ N, x ∈ s i) := + ⟨fun ⟨i, hi⟩ ↦ ⟨i + N, by grind⟩, fun ⟨i, hi, h'i⟩ ↦ ⟨i - N, by grind⟩⟩ + simp only [mem_iUnion, Finset.mem_range, mem_union, exists_prop, this, ge_iff_le] + grind + rw [this, setIntegral_union]; rotate_left + · simp only [Finset.mem_range, disjoint_iUnion_right, disjoint_iUnion_left] + intro i j hi + apply hd (by grind) + · apply MeasurableSet.biUnion (Finset.countable_toSet _) (fun i hi ↦ hm i) + · apply MeasurableSet.iUnion (fun i ↦ hm _) + · apply hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) + · apply hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) + rw [setIntegral_biUnion_finset]; rotate_left + · exact fun i hi ↦ hm i + · exact fun i hi j hj hij ↦ hd hij + · exact fun i hi ↦ hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) + simp only [add_sub_cancel_left] + apply enorm_setIntegral_le_lintegral_enorm.trans_eq + rw [lintegral_iUnion (fun i ↦ hm _)] + exact fun i j hij ↦ hd (by grind) + +theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} + (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) + (hfi : μ.IntegrableOn f B (⋃ i, s i)) : + HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by + classical + rcases finite_or_infinite ι with hι | hι + · letI : Fintype ι := Fintype.ofFinite ι + have : ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑ i, ∫ᵛ x in s i, f x ∂[B; μ] := by + rw [setIntegral_iUnion_fintype hm hd (fun i ↦ ?_)] + exact hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) + rw [this] + apply hasSum_fintype + obtain ⟨e⟩ : Nonempty (ι ≃ ℕ) := nonempty_equiv_of_countable + rw [← e.symm.surjective.iUnion_comp, ← e.symm.hasSum_iff] + apply hasSum_setIntegral_iUnion_nat (fun i ↦ hm _) (fun i j hij ↦ hd (by simp [hij])) + rwa [e.symm.surjective.iUnion_comp] + +theorem integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) + (hd : Pairwise (Disjoint on s)) (hfi : μ.IntegrableOn f B (⋃ i, s i)) : + ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑' n, ∫ᵛ x in s n, f x ∂[B; μ] := + (HasSum.tsum_eq (hasSum_setIntegral_iUnion hm hd hfi)).symm + @[simp] theorem setIntegral_toSignedMeasure {μ : Measure X} [IsFiniteMeasure μ] {f : X → G} {s : Set X} (hs : MeasurableSet s) : - ∫ᵛ x in s, f x ∂[(ContinuousLinearMap.lsmul ℝ ℝ).flip; μ.toSignedMeasure] - = ∫ x in s, f x ∂μ := by + ∫ᵛ x in s, f x ∂<•μ.toSignedMeasure = ∫ x in s, f x ∂μ := by rw [← integral_toSignedMeasure, restrict_toSignedMeasure hs] - /-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: it tends to zero as `(μ.transpose B).variation s` tends to zero. -/ theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} @@ -496,7 +504,6 @@ theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} rw [transpose_restrict] apply variation_restrict_le - /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} From 932ecc720781b76a0d430467923d340c21a39c0b Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 7 Jun 2026 11:01:06 +0200 Subject: [PATCH 103/129] cleanup --- .../MeasureTheory/Function/ConditionalExpectation/Basic.lean | 1 - Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean | 2 +- Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean index 353977d34adeaa..fda5b38bd6fb45 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -6,7 +6,6 @@ Authors: Rémy Degenne module public import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1 -public import Mathlib.MeasureTheory.Function.LpSpace.InfiniteSum import Mathlib.MeasureTheory.Function.LpSpace.InfiniteSum diff --git a/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean b/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean index 8853185a9f8afc..6cfb1d2441bbdf 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/BoundedVariation.lean @@ -77,7 +77,7 @@ private lemma exists_vectorMeasure_le_measureAux (hf : BoundedVariationOn f univ ∃ m : VectorMeasure α E, (∀ u v, u ≤ v → m (Set.Ioc u v) = f.rightLim v - f.rightLim u) ∧ m botSet = 0 ∧ ∀ s, ‖m s‖ₑ ≤ hf.measureAux s := by /- We will apply the general extension theorem - `VectorMeasure.exists_extension_of_isSetSemiring_of_le_measure`. For this, we + `VectorMeasure.exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom`. For this, we need to check that the additive content is bounded by the measure `measureAux`. -/ rcases isEmpty_or_nonempty α with h'α | h'α · exact ⟨0, by simp⟩ diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index d069eea234c65d..cc217d1eb6b29f 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -47,7 +47,7 @@ theorem IntegrableOn.union (hs : MeasurableSet s) (ht : MeasurableSet t) /- `simpNF` complains that this lemma can be proved by `simp`, because the `simp`-generated lemma unfolds the abbrev `VectorMeasure.Integrable`. TODO: fix `simp`. See lean4#13958. -/ -@[simp] theorem IntegrableOn.empty : μ.IntegrableOn f B ∅ := by +@[simp, nolint simpNF] theorem IntegrableOn.empty : μ.IntegrableOn f B ∅ := by simp [VectorMeasure.IntegrableOn] theorem IntegrableOn.biUnion_finite From e26278862a5d5c04565c7578d85517e2be141123 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 7 Jun 2026 11:50:16 +0200 Subject: [PATCH 104/129] better --- Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index cc217d1eb6b29f..bcd2b802f9aeec 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -242,7 +242,7 @@ theorem exists_ne_zero_of_setIntegral_ne_zero (hU : ∫ᵛ x in t, f x ∂[B; μ ∃ x, x ∈ t ∧ f x ≠ 0 := by contrapose! hU; exact setIntegral_eq_zero_of_forall_eq_zero hU -theorem setIntegral_vectorMeasure_zero (f : X → E) {s : Set X} +theorem setIntegral_of_variation_apply_eq_zero (f : X → E) {s : Set X} (hs : (μ.transpose B).variation s = 0) : ∫ᵛ x in s, f x ∂[B; μ] = 0 := by by_cases h's : MeasurableSet s; swap From 4a5d69aa6ee1133e76ba87581e6193d402e319a9 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 7 Jun 2026 20:58:02 +0200 Subject: [PATCH 105/129] more --- Mathlib.lean | 1 + .../Polish/StronglyMeasurable.lean | 18 ++- Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 117 ++++++++++++++++++ 3 files changed, 132 insertions(+), 4 deletions(-) create mode 100644 Mathlib/MeasureTheory/VectorMeasure/Prod.lean diff --git a/Mathlib.lean b/Mathlib.lean index 329f7ac6a970d2..6b9a2f6dac94eb 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5617,6 +5617,7 @@ public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.JordanSub public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.Lebesgue public import Mathlib.MeasureTheory.VectorMeasure.Decomposition.RadonNikodym public import Mathlib.MeasureTheory.VectorMeasure.Integral +public import Mathlib.MeasureTheory.VectorMeasure.Prod public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral public import Mathlib.MeasureTheory.VectorMeasure.Variation.Basic public import Mathlib.MeasureTheory.VectorMeasure.Variation.Defs diff --git a/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean b/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean index 1676161053d094..2582708a2b5916 100644 --- a/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean +++ b/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean @@ -82,12 +82,22 @@ variable {X E ι : Type*} [MeasurableSpace X] [CommMonoid E] [TopologicalSpace E section -variable [IsCompletelyPseudoMetrizableSpace E] [ContinuousMul E] - [Countable ι] {L : SummationFilter ι} [L.NeBot] [L.filter.IsCountablyGenerated] +variable [ContinuousMul E] {L : SummationFilter ι} [L.NeBot] [L.filter.IsCountablyGenerated] -/-- The product of strongly measurable functions is measurable. -/ +/-- The infinite product of strongly measurable functions is measurable, `HasProd` version. -/ @[to_additive (attr := fun_prop) -/-- The sum of strongly measurable functions is measurable. -/] +/-- The infinite sum of strongly measurable functions is measurable, `HasSum` version. -/] +theorem StronglyMeasurable.hasProd [PseudoMetrizableSpace E] {f : ι → X → E} {g : X → E} + (h : ∀ i : ι, StronglyMeasurable (f i)) (h' : ∀ x, HasProd (fun i ↦ f i x) (g x) L) : + StronglyMeasurable g := by + refine stronglyMeasurable_of_tendsto L.filter ?_ (tendsto_pi_nhds.mpr h') + fun_prop + +variable [IsCompletelyPseudoMetrizableSpace E] [Countable ι] + +/-- The infinite product of strongly measurable functions is measurable. -/ +@[to_additive (attr := fun_prop) +/-- The infinite sum of strongly measurable functions is measurable. -/] theorem StronglyMeasurable.tprod {f : ι → X → E} (h : ∀ i : ι, StronglyMeasurable (f i)) : StronglyMeasurable (fun x => ∏'[L] i : ι, f i x) := by let E := { x | Multipliable (f · x) L } diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean new file mode 100644 index 00000000000000..0f95130dbe2f90 --- /dev/null +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -0,0 +1,117 @@ +/- +Copyright (c) 2026 Sébastien Gouëzel. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Sébastien Gouëzel +-/ +module + +public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral + +/-! +# Product of vector measures +-/ + +open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology +open scoped ENNReal NNReal Finset + +variable {ι X Y E F G : Type*} {mX : MeasurableSpace X} {mY : MeasurableSpace Y} + [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + (μ : VectorMeasure X E) (ν : VectorMeasure Y F) + (B : E →L[ℝ] F →L[ℝ] G) {f g : X → E} {s t : Set X} + +namespace MeasureTheory.VectorMeasure + +omit [NormedSpace ℝ E] in +theorem vectorMeasure_if {x : Y} {t : Set Y} {s : Set X} [Decidable (x ∈ t)] : + μ (if x ∈ t then s else ∅) = indicator t (fun _ => μ s) x := by split_ifs with h <;> simp [h] + +open scoped Classical in +/-- The product of two vector measures `μ` and `ν` with respect to a continuous bilinear map `B`, +giving mass `B (μ s) (ν s)` to a measurable set `s`. +If such a measure does not exist, we use the junk value `0`. -/ +noncomputable def prod (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) : + VectorMeasure (X × Y) G := + if h : ∃ ρ : VectorMeasure (X × Y) G, ∀ (s : Set X) (t : Set Y), + MeasurableSet s →MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t) then h.choose + else 0 + +/-- Two vector measures `μ` and `ν` have a product with respect to `B` if there exists a +measure giving mass `B (μ s) (ν t)` to any measurable product `s × t`. +This is satisfied whenever `μ` or `ν` has finite variation. -/ +class HasProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) where + out : ∃ ρ : VectorMeasure (X × Y) G, ∀ (s : Set X) (t : Set Y), + MeasurableSet s → MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t) + + +/-- If `ν` is a finite measure, and `s ⊆ α × β` is measurable, then `x ↦ ν { y | (x, y) ∈ s }` is + a measurable function. `measurable_measure_prodMk_left` is strictly more general. -/ +theorem measurable_measure_prodMk_left_finite {s : Set (X × Y)} + (hs : MeasurableSet s) : StronglyMeasurable fun x => ν (Prod.mk x ⁻¹' s) := by + induction s, hs + using MeasurableSpace.induction_on_inter generateFrom_prod.symm isPiSystem_prod with + | empty => simp [stronglyMeasurable_const] + | basic s hs => + obtain ⟨s, hs, t, -, rfl⟩ := hs + classical + simpa [mk_preimage_prod_right_eq_if, vectorMeasure_if] using + stronglyMeasurable_const.indicator hs + | compl s hs ihs => + simp_rw [preimage_compl, VectorMeasure.of_compl (measurable_prodMk_left hs)] + exact stronglyMeasurable_const.sub ihs + | iUnion f hfd hfm ihf => + have (a : X) : HasSum (fun i ↦ ν (Prod.mk a ⁻¹' f i)) (ν (Prod.mk a ⁻¹' ⋃ i, f i)) := by + rw [preimage_iUnion] + apply hasSum_of_disjoint_iUnion + exacts [fun i ↦ measurable_prodMk_left (hfm i), hfd.mono fun _ _ ↦ .preimage _] + simpa only [this] using StronglyMeasurable.hasSum ihf + +open scoped Classical in +/-- The naive product of two vector measures, obtained by integrating the measure of the fibers, +as in the definition of the product of positive measures. -/ +noncomputable def naiveProd + (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) + [IsFiniteMeasure (μ.transpose B.flip).variation] : + VectorMeasure (X × Y) G where + measureOf' s := if MeasurableSet s then ∫ᵛ x, ν (Prod.mk x ⁻¹' s) ∂[B.flip; μ] else 0 + empty' := by simp + not_measurable' := by simp +contextual + m_iUnion' f f_meas f_disj := by + obtain ⟨C, hC⟩ : ∃ C, ∀ (t : Set Y), ‖ν t‖ ≤ C := sorry + simp only [f_meas, ↓reduceIte, implies_true, MeasurableSet.iUnion, preimage_iUnion] + simp only [HasSum, SummationFilter.unconditional_filter] + have A (a : Finset ℕ) : ∑ y ∈ a, ∫ᵛ x, ν (Prod.mk x ⁻¹' f y) ∂[B.flip; μ] + = ∫ᵛ x, ∑ y ∈ a, ν (Prod.mk x ⁻¹' f y) ∂[B.flip; μ] := by + rw [integral_finsetSum] + intro i hi + apply Integrable.of_bound (μ := (μ.transpose B.flip).variation) + simp_rw [A] + apply tendsto_integral_filter_of_dominated_convergence (bound := fun x ↦ C) + · apply Eventually.of_forall (fun a ↦ ?_) + apply StronglyMeasurable.aestronglyMeasurable + apply Finset.stronglyMeasurable_fun_sum _ (fun i hi ↦ ?_) + + + · sorry + · sorry + · sorry + · sorry + + +lemma prod_apply {μ : VectorMeasure X E} {ν : VectorMeasure Y F} [h : HasProd μ ν B] {s : Set X} {t : Set Y} : + μ.prod ν B (s ×ˢ t) = B (μ s) (ν t) := by + rcases eq_or_ne s ∅ with rfl | hs + · simp + rcases eq_or_ne t ∅ with rfl | ht + · simp + by_cases h's : MeasurableSet s; swap + · simp only [h's, not_false_eq_true, not_measurable, _root_.map_zero, + ContinuousLinearMap.zero_apply] + rw [not_measurable] + simp [measurableSet_prod, hs, ht, h's] + by_cases h't : MeasurableSet t; swap + · simp only [h't, not_false_eq_true, not_measurable, _root_.map_zero] + rw [not_measurable] + simp [measurableSet_prod, hs, ht, h't] + simpa [prod, h.out] using h.out.choose_spec s t h's h't From 9e40ea704de49af62b98f7e3af87be49704df67e Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 7 Jun 2026 21:56:58 +0200 Subject: [PATCH 106/129] more --- .../MeasureTheory/VectorMeasure/Basic.lean | 30 +++++----- Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 55 ++++++++++++++----- 2 files changed, 55 insertions(+), 30 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index ebece29c80823f..c8f5cc1fcf4f77 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -141,6 +141,20 @@ theorem of_disjoint_iUnion (hm : ∀ i, MeasurableSet (f i)) (hd : Pairwise (Dis v (⋃ i, f i) = ∑' i, v (f i) := (hasSum_of_disjoint_iUnion hm hd).tsum_eq.symm +theorem of_biUnion {ι : Type*} {s : Set ι} {f : ι → Set α} (hs : s.Countable) + (hd : s.Pairwise (Disjoint on f)) (h : ∀ b ∈ s, MeasurableSet (f b)) : + v (⋃ b ∈ s, f b) = ∑' p : s, v (f p) := by + haveI := hs.toEncodable + rw [biUnion_eq_iUnion] + apply of_disjoint_iUnion + · exact fun x ↦ h x x.2 + · exact hd.on_injective Subtype.coe_injective fun x => x.2 + +theorem of_biUnion_finset {ι : Type*} {s : Finset ι} {f : ι → Set α} (hd : PairwiseDisjoint (↑s) f) + (hm : ∀ b ∈ s, MeasurableSet (f b)) : v (⋃ b ∈ s, f b) = ∑ p ∈ s, v (f p) := by + rw [← Finset.sum_attach, Finset.attach_eq_univ, ← tsum_fintype (L := .unconditional s)] + exact of_biUnion s.countable_toSet hd hm + theorem of_union {A B : Set α} (h : Disjoint A B) (hA : MeasurableSet A) (hB : MeasurableSet B) : v (A ∪ B) = v A + v B := by rw [Set.union_eq_iUnion, of_disjoint_iUnion, tsum_fintype, Fintype.sum_bool, cond, cond] @@ -202,22 +216,6 @@ theorem of_nonpos_disjoint_union_eq_zero {s : SignedMeasure α} {A B : Set α} ( rw [of_union h hA₁ hB₁] at hAB linarith -lemma of_biUnion_finset {ι : Type*} {s : Finset ι} {f : ι → Set α} (hd : PairwiseDisjoint (↑s) f) - (hm : ∀ b ∈ s, MeasurableSet (f b)) : v (⋃ b ∈ s, f b) = ∑ p ∈ s, v (f p) := by - classical - induction s using Finset.induction with - | empty => simp - | insert a s has ih => - simp only [Finset.mem_insert, iUnion_iUnion_eq_or_left, has, not_false_eq_true, - Finset.sum_insert] - rw [of_union, ih] - · exact hd.subset (by simp) - · grind - · simp only [disjoint_iUnion_right] - exact fun i hi ↦ hd (by simp) (by simp [hi]) (by grind) - · apply hm _ (by simp) - · apply Finset.measurableSet_biUnion _ (by grind) - theorem tendsto_vectorMeasure_iUnion_atTop_nat {s : ℕ → Set α} (hm : Monotone s) (hs : ∀ i, MeasurableSet (s i)) : Tendsto (fun n ↦ v (s n)) atTop (𝓝 (v (⋃ n, s n))) := by diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 0f95130dbe2f90..11c18cf74a66f3 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -18,8 +18,8 @@ variable {ι X Y E F G : Type*} {mX : MeasurableSpace X} {mY : MeasurableSpace Y [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] - (μ : VectorMeasure X E) (ν : VectorMeasure Y F) - (B : E →L[ℝ] F →L[ℝ] G) {f g : X → E} {s t : Set X} + {μ : VectorMeasure X E} {ν : VectorMeasure Y F} + {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} {s t : Set X} namespace MeasureTheory.VectorMeasure @@ -44,10 +44,10 @@ class HasProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] out : ∃ ρ : VectorMeasure (X × Y) G, ∀ (s : Set X) (t : Set Y), MeasurableSet s → MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t) - -/-- If `ν` is a finite measure, and `s ⊆ α × β` is measurable, then `x ↦ ν { y | (x, y) ∈ s }` is - a measurable function. `measurable_measure_prodMk_left` is strictly more general. -/ -theorem measurable_measure_prodMk_left_finite {s : Set (X × Y)} +omit [NormedSpace ℝ F] in +/-- If `ν` is a vector measure, and `s ⊆ X × Y` is measurable, then `x ↦ ν { y | (x, y) ∈ s }` is +a strongly measurable function. -/ +theorem stronglyMeasurable_vectorMeasure_prodMk_left {s : Set (X × Y)} (hs : MeasurableSet s) : StronglyMeasurable fun x => ν (Prod.mk x ⁻¹' s) := by induction s, hs using MeasurableSpace.induction_on_inter generateFrom_prod.symm isPiSystem_prod with @@ -65,13 +65,12 @@ theorem measurable_measure_prodMk_left_finite {s : Set (X × Y)} rw [preimage_iUnion] apply hasSum_of_disjoint_iUnion exacts [fun i ↦ measurable_prodMk_left (hfm i), hfd.mono fun _ _ ↦ .preimage _] - simpa only [this] using StronglyMeasurable.hasSum ihf + apply StronglyMeasurable.hasSum ihf this open scoped Classical in /-- The naive product of two vector measures, obtained by integrating the measure of the fibers, as in the definition of the product of positive measures. -/ -noncomputable def naiveProd - (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) +noncomputable def naiveProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) [IsFiniteMeasure (μ.transpose B.flip).variation] : VectorMeasure (X × Y) G where measureOf' s := if MeasurableSet s then ∫ᵛ x, ν (Prod.mk x ⁻¹' s) ∂[B.flip; μ] else 0 @@ -85,18 +84,46 @@ noncomputable def naiveProd = ∫ᵛ x, ∑ y ∈ a, ν (Prod.mk x ⁻¹' f y) ∂[B.flip; μ] := by rw [integral_finsetSum] intro i hi - apply Integrable.of_bound (μ := (μ.transpose B.flip).variation) + refine Integrable.of_bound (μ := (μ.transpose B.flip).variation) ?_ C ?_ + · exact (stronglyMeasurable_vectorMeasure_prodMk_left (f_meas i)).aestronglyMeasurable + · exact Eventually.of_forall (fun x ↦ hC _) simp_rw [A] apply tendsto_integral_filter_of_dominated_convergence (bound := fun x ↦ C) · apply Eventually.of_forall (fun a ↦ ?_) apply StronglyMeasurable.aestronglyMeasurable apply Finset.stronglyMeasurable_fun_sum _ (fun i hi ↦ ?_) + apply stronglyMeasurable_vectorMeasure_prodMk_left (f_meas i) + · filter_upwards with a + filter_upwards with x + rw [← VectorMeasure.of_biUnion_finset] + · apply hC + · exact fun i hi j hj hij ↦ (f_disj hij).preimage _ + · exact fun i hi ↦ measurable_prodMk_left (f_meas i) + · apply integrable_const + · filter_upwards with x + apply hasSum_of_disjoint_iUnion + · exact fun i ↦ measurable_prodMk_left (f_meas i) + · exact fun i j hij ↦ (f_disj hij).preimage _ + +instance [IsFiniteMeasure (μ.transpose B.flip).variation] : HasProd μ ν B where + out := by + classical + refine ⟨naiveProd μ ν B, fun s t hs ht ↦ ?_⟩ + simp only [naiveProd, hs.prod ht, ↓reduceIte] + simp_rw [mk_preimage_prod_right_eq_if, vectorMeasure_if, integral_indicator hs] + rw [setIntegral_const] + + + + + +#exit + simp_rw [S, mk_preimage_prod_right_eq_if, measure_if, + lintegral_indicator (measurableSet_toMeasurable _ _), lintegral_const, + restrict_apply_univ, mul_comm] + _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable] - · sorry - · sorry - · sorry - · sorry lemma prod_apply {μ : VectorMeasure X E} {ν : VectorMeasure Y F} [h : HasProd μ ν B] {s : Set X} {t : Set Y} : From 3b1a9fca47fcda1025d89ffbd573da1e0333ade3 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 8 Jun 2026 09:37:29 +0200 Subject: [PATCH 107/129] progress --- Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 62 +++++++++---------- .../VectorMeasure/SetIntegral.lean | 8 ++- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 11c18cf74a66f3..dbf72a0e95753e 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -44,6 +44,29 @@ class HasProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] out : ∃ ρ : VectorMeasure (X × Y) G, ∀ (s : Set X) (t : Set Y), MeasurableSet s → MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t) +@[simp] lemma prod_apply [h : HasProd μ ν B] {s : Set X} {t : Set Y} : + μ.prod ν B (s ×ˢ t) = B (μ s) (ν t) := by + rcases eq_or_ne s ∅ with rfl | hs + · simp + rcases eq_or_ne t ∅ with rfl | ht + · simp + by_cases h's : MeasurableSet s; swap + · simp only [h's, not_false_eq_true, not_measurable, _root_.map_zero, + ContinuousLinearMap.zero_apply] + rw [not_measurable] + simp [measurableSet_prod, hs, ht, h's] + by_cases h't : MeasurableSet t; swap + · simp only [h't, not_false_eq_true, not_measurable, _root_.map_zero] + rw [not_measurable] + simp [measurableSet_prod, hs, ht, h't] + simpa [prod, h.out] using h.out.choose_spec s t h's h't + +lemma HasProd.flip [HasProd μ ν B] : HasProd ν μ B.flip where + out := by + refine ⟨(μ.prod ν B).map Prod.swap, fun s t hs ht ↦ ?_⟩ + rw [map_apply _ (by fun_prop) (hs.prod ht)] + simp + omit [NormedSpace ℝ F] in /-- If `ν` is a vector measure, and `s ⊆ X × Y` is measurable, then `x ↦ ν { y | (x, y) ∈ s }` is a strongly measurable function. -/ @@ -105,40 +128,13 @@ noncomputable def naiveProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B · exact fun i ↦ measurable_prodMk_left (f_meas i) · exact fun i j hij ↦ (f_disj hij).preimage _ -instance [IsFiniteMeasure (μ.transpose B.flip).variation] : HasProd μ ν B where +instance [CompleteSpace G] [IsFiniteMeasure (μ.transpose B.flip).variation] : HasProd μ ν B where out := by classical refine ⟨naiveProd μ ν B, fun s t hs ht ↦ ?_⟩ - simp only [naiveProd, hs.prod ht, ↓reduceIte] - simp_rw [mk_preimage_prod_right_eq_if, vectorMeasure_if, integral_indicator hs] - rw [setIntegral_const] - - - + simp only [naiveProd, hs.prod ht, ↓reduceIte, mk_preimage_prod_right_eq_if, vectorMeasure_if, + integral_indicator hs, setIntegral_const, ContinuousLinearMap.flip_apply] - -#exit - - simp_rw [S, mk_preimage_prod_right_eq_if, measure_if, - lintegral_indicator (measurableSet_toMeasurable _ _), lintegral_const, - restrict_apply_univ, mul_comm] - _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable] - - - -lemma prod_apply {μ : VectorMeasure X E} {ν : VectorMeasure Y F} [h : HasProd μ ν B] {s : Set X} {t : Set Y} : - μ.prod ν B (s ×ˢ t) = B (μ s) (ν t) := by - rcases eq_or_ne s ∅ with rfl | hs - · simp - rcases eq_or_ne t ∅ with rfl | ht - · simp - by_cases h's : MeasurableSet s; swap - · simp only [h's, not_false_eq_true, not_measurable, _root_.map_zero, - ContinuousLinearMap.zero_apply] - rw [not_measurable] - simp [measurableSet_prod, hs, ht, h's] - by_cases h't : MeasurableSet t; swap - · simp only [h't, not_false_eq_true, not_measurable, _root_.map_zero] - rw [not_measurable] - simp [measurableSet_prod, hs, ht, h't] - simpa [prod, h.out] using h.out.choose_spec s t h's h't +instance [CompleteSpace G] [h : IsFiniteMeasure (ν.transpose B).variation] : HasProd μ ν B := by + rw [← B.flip_flip] at h ⊢ + apply HasProd.flip diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index bcd2b802f9aeec..64710f59b67189 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -327,15 +327,17 @@ theorem setIntegral_eq_integral_of_forall_compl_eq_zero (hs : MeasurableSet s) ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := setIntegral_eq_integral_of_ae_compl_eq_zero hs (Eventually.of_forall h) -theorem setIntegral_const [CompleteSpace G] [IsFiniteMeasure ((μ.restrict s).transpose B).variation] +theorem setIntegral_const [CompleteSpace G] [IsFiniteMeasure ((μ.transpose B).variation.restrict s)] (c : E) : ∫ᵛ _ in s, c ∂[B; μ] = B c (μ s) := by by_cases hs : MeasurableSet s - · rw [integral_const, restrict_apply _ hs MeasurableSet.univ, univ_inter] + · have : IsFiniteMeasure ((μ.restrict s).transpose B).variation := by + rwa [transpose_restrict, variation_restrict hs] + rw [integral_const, restrict_apply _ hs MeasurableSet.univ, univ_inter] · simp [setIntegral_eq_zero_of_not_measurableSet hs, μ.not_measurable' hs] @[simp] theorem integral_indicator_const [CompleteSpace G] - (e : E) ⦃s : Set X⦄ [IsFiniteMeasure ((μ.restrict s).transpose B).variation] + (e : E) ⦃s : Set X⦄ [IsFiniteMeasure ((μ.transpose B).variation.restrict s)] (s_meas : MeasurableSet s) : ∫ᵛ x, s.indicator (fun _ : X ↦ e) x ∂[B; μ] = B e (μ s) := by rw [integral_indicator s_meas, ← setIntegral_const] From 367ba6c192bb57028ea0b15668897d804204efc3 Mon Sep 17 00:00:00 2001 From: Sebastien Gouezel Date: Mon, 8 Jun 2026 12:00:27 +0200 Subject: [PATCH 108/129] start on semivariation --- .../Variation/Semivariation.lean | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean new file mode 100644 index 00000000000000..d6d50ab526698b --- /dev/null +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean @@ -0,0 +1,115 @@ +/- +Copyright (c) 2026 Sébastien Gouëzel. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Sébastien Gouëzel +-/ +module + +public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.MeasureTheory.VectorMeasure.Variation.Basic + +import Mathlib.Analysis.Normed.Module.HahnBanach + +/-! +# The semivariation of a vector measure + +-/ + +public section + +open scoped ENNReal + +namespace MeasureTheory.VectorMeasure + +variable {X E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {mX : MeasurableSpace X} + {μ : VectorMeasure X E} {s t : Set X} + +/-- The semivariation of a vector measure, defined as the supremum of the variations +of the images of the vector measures under continuous linear forms of norm at most `1`. -/ +noncomputable def semiVariation (μ : VectorMeasure X E) (s : Set X) : ℝ≥0∞ := + ⨆ ℓ ∈ {ℓ : StrongDual ℝ E | ‖ℓ‖ₑ ≤ 1}, (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation s + +lemma semiVariation_union_le : + μ.semiVariation (s ∪ t) ≤ μ.semiVariation s + μ.semiVariation t := by + simp only [semiVariation, iSup_le_iff] + intro ℓ hℓ + apply (measure_union_le _ _).trans + gcongr <;> apply le_biSup _ hℓ + +lemma semiVariation_mono (hst : s ⊆ t) : μ.semiVariation s ≤ μ.semiVariation t := by + simp only [semiVariation, iSup_le_iff] + intro ℓ hℓ + apply (measure_mono hst).trans + apply le_biSup _ hℓ + +lemma semiVariation_le_variation : μ.semiVariation s ≤ μ.variation s := by + simp only [semiVariation, iSup_le_iff] + intro ℓ hℓ + suffices (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation ≤ μ.variation from this s + apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) + simp only [mapRange_apply, AddMonoidHom.coe_coe] + apply le_trans ?_ (enorm_measure_le_variation _ _) + apply (ContinuousLinearMap.le_opNorm_enorm _ _).trans + exact mul_le_of_le_one_left (by positivity) hℓ + +lemma enorm_measure_le_semiVariation : ‖μ s‖ₑ ≤ μ.semiVariation s := by + by_cases hs : MeasurableSet s; swap + · simp [not_measurable, hs] + obtain ⟨ℓ, ℓ_norm, hℓ⟩ : ∃ ℓ : StrongDual ℝ E, ‖ℓ‖ ≤ 1 ∧ ℓ (μ s) = ‖μ s‖ := + exists_dual_vector'' _ _ + have h'ℓ : ℓ ∈ {ℓ : StrongDual ℝ E | ‖ℓ‖ₑ ≤ 1} := by + simp [enorm_eq_nnnorm, ← NNReal.coe_le_one, ℓ_norm] + calc ‖μ s‖ₑ + _ = ‖(μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous) s‖ₑ := by simp [← ofReal_norm, hℓ] + _ ≤ (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation s := enorm_measure_le_variation _ _ + _ ≤ μ.semiVariation s := by apply le_biSup _ h'ℓ + +lemma enorm_measure_le_semiVariation_of_subset (hst : s ⊆ t) : + ‖μ s‖ₑ ≤ μ.semiVariation t := + enorm_measure_le_semiVariation.trans (semiVariation_mono hst) + +lemma foot (μ : VectorMeasure X ℝ) (hs : MeasurableSet s) + {ε : ℝ≥0∞} (hε : ε ≠ 0) (h's : μ.variation s ≠ ∞) : + ∃ t ⊆ s, MeasurableSet t ∧ μ.variation s - ε ≤ 2 * ‖μ t‖ₑ := by + obtain ⟨P, Ps, P_disj, P_meas, hP⟩ : ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ s) ∧ + ((P : Set (Set X)).PairwiseDisjoint id) ∧ + (∀ t ∈ P, MeasurableSet t) ∧ μ.variation s ≤ ∑ p ∈ P, ‖μ p‖ₑ + ε := + exists_variation_le_add' _ hs hε.bot_lt h's + have A (p) : ∃ (f : ℝ), (f = 1 ∨ f = -1) ∧ ‖μ p‖ = f * μ p := by + rcases le_total (μ p) 0 with h'p | h'p + · exact ⟨-1, by simp [h'p]⟩ + · exact ⟨1, by simp [h'p]⟩ + choose f hf h'f using A + + +#exit + +lemma exists_variation_le_add' (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) + {ε : ℝ≥0∞} (hε : 0 < ε) (hμ : μ.variation s ≠ ∞) : + ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ s) ∧ ((P : Set (Set X)).PairwiseDisjoint id) ∧ + (∀ t ∈ P, MeasurableSet t) ∧ μ.variation s ≤ ∑ p ∈ P, ‖μ p‖ₑ + ε := by + + +lemma exists_semiVariation_le_enorm_measure (ε : ℝ≥0∞) (hε : ε ≠ 0) (htop : μ.semiVariation t ≠ ∞) : + ∃ s ⊆ t, MeasurableSet s ∧ μ.semiVariation t ≤ 2 * ‖μ s‖ₑ + ε := by + rcases eq_zero_or_pos (μ.semiVariation t) with ht | ht + · refine ⟨∅, by simp [ht]⟩ + obtain ⟨ℓ, ℓmem, hℓ⟩ : ∃ ℓ ∈ {ℓ : StrongDual ℝ E| ‖ℓ‖ₑ ≤ 1}, + μ.semiVariation t - ε < (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation t := + lt_biSup_iff.1 (ENNReal.sub_lt_self htop ht.ne' hε) + + + +#exit + +theorem exists_subset_lt_add (H : InnerRegularWRT μ p q) (h0 : p ∅) (hU : q U) (hμU : μ U ≠ ∞) + (hε : ε ≠ 0) : ∃ K, K ⊆ U ∧ p K ∧ μ U < μ K + ε := by + rcases eq_or_ne (μ U) 0 with h₀ | h₀ + · refine ⟨∅, empty_subset _, h0, ?_⟩ + rwa [measure_empty, h₀, zero_add, pos_iff_ne_zero] + · rcases H hU _ (ENNReal.sub_lt_self hμU h₀ hε) with ⟨K, hKU, hKc, hrK⟩ + exact ⟨K, hKU, hKc, ENNReal.lt_add_of_sub_lt_right (Or.inl hμU) hrK⟩ + + + +end MeasureTheory.VectorMeasure From eb21c21ad0a0cd821b5522b84a4b023b24d9c0ff Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 8 Jun 2026 20:19:49 +0200 Subject: [PATCH 109/129] fix --- Mathlib/Analysis/Normed/Group/Continuity.lean | 11 ++ .../VectorMeasure/Variation/Basic.lean | 25 +++ .../Variation/Semivariation.lean | 162 ++++++++++++++---- 3 files changed, 163 insertions(+), 35 deletions(-) diff --git a/Mathlib/Analysis/Normed/Group/Continuity.lean b/Mathlib/Analysis/Normed/Group/Continuity.lean index 609c44b07dde86..bce9c2ecb79818 100644 --- a/Mathlib/Analysis/Normed/Group/Continuity.lean +++ b/Mathlib/Analysis/Normed/Group/Continuity.lean @@ -7,6 +7,7 @@ module public import Mathlib.Analysis.Normed.Group.Basic public import Mathlib.Topology.Algebra.Ring.Real +public import Mathlib.Topology.Instances.ENNReal.Lemmas public import Mathlib.Topology.Metrizable.Uniformity public import Mathlib.Topology.Sequences @@ -68,6 +69,16 @@ theorem tendsto_one_iff_norm_tendsto_zero {f : α → E} {a : Filter α} : Tendsto f a (𝓝 1) ↔ Tendsto (‖f ·‖) a (𝓝 0) := tendsto_iff_norm_inv_mul_tendsto_zero.trans <| by simp +@[to_additive] +theorem tendsto_iff_enorm_inv_mul_tendsto_zero {f : α → E} {a : Filter α} {b : E} : + Tendsto f a (𝓝 b) ↔ Tendsto (fun e => ‖(f e)⁻¹ * b‖ₑ) a (𝓝 0) := by + simp only [← edist_eq_enorm_inv_mul, ← tendsto_iff_edist_tendsto_0] + +@[to_additive] +theorem tendsto_one_iff_enorm_tendsto_zero {f : α → E} {a : Filter α} : + Tendsto f a (𝓝 1) ↔ Tendsto (‖f ·‖ₑ) a (𝓝 0) := + tendsto_iff_enorm_inv_mul_tendsto_zero.trans <| by simp + @[to_additive (attr := simp 1100)] theorem comap_norm_nhds_one : comap norm (𝓝 0) = 𝓝 (1 : E) := by simpa only [dist_one_right] using nhds_comap_dist (1 : E) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index ffd356711fdc8d..c34a88d2463d0e 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -75,6 +75,31 @@ lemma le_variation (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) { simp only [sup_set_eq_biUnion, id_eq] exact hs.diff <| .biUnion (Finset.countable_toSet _) (by simp) +/-- Measure version of `preVariation.exists_Finpartition_sum_gt`. -/ +lemma exists_lt_sum_of_lt_variation (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) + {a : ℝ≥0∞} (ha : a < μ.variation s) : + ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ s) ∧ ((P : Set (Set X)).PairwiseDisjoint id) ∧ + (∀ t ∈ P, MeasurableSet t) ∧ a < ∑ p ∈ P, ‖μ p‖ₑ := by + simp only [variation_apply, preVariation, ennrealToMeasure_apply hs, ennrealPreVariation_apply] + at ha ⊢ + obtain ⟨P, hP⟩ : ∃ P : Finpartition (⟨s, hs⟩ : Subtype MeasurableSet), + a < ∑ p ∈ P.parts, (fun x ↦ ‖μ x‖ₑ) p := + preVariation.exists_Finpartition_sum_gt (‖μ ·‖ₑ) _ ha + refine ⟨P.parts.map (Function.Embedding.subtype _), ?_, ?_, ?_, ?_⟩ + · simp only [mem_map, Function.Embedding.subtype_apply, Subtype.exists, exists_and_right, + exists_eq_right, forall_exists_index] + intro t ht h't + exact P.le h't + · intro i hi j hj hij + simp only [coe_map, Function.Embedding.subtype_apply, Set.mem_image, SetLike.mem_coe, + Subtype.exists, exists_and_right, exists_eq_right] at hi hj + rcases hi with ⟨h'i, i_mem⟩ + rcases hj with ⟨h'j, j_mem⟩ + exact (disjoint_subtype_iff (fun _ _ hs ht ↦ hs.inter ht) _).1 + (P.disjoint i_mem j_mem (by simpa using hij)) + · simp +contextual + · rwa [Finset.sum_map] + /-- Measure version of `preVariation.exists_Finpartition_sum_ge'`. -/ lemma exists_variation_le_add' (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) {ε : ℝ≥0∞} (hε : 0 < ε) (hμ : μ.variation s ≠ ∞) : diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean index d6d50ab526698b..7f21c1de0f1758 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean @@ -17,7 +17,8 @@ import Mathlib.Analysis.Normed.Module.HahnBanach public section -open scoped ENNReal +open scoped ENNReal Function Topology +open Set Filter namespace MeasureTheory.VectorMeasure @@ -49,8 +50,7 @@ lemma semiVariation_le_variation : μ.semiVariation s ≤ μ.variation s := by apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) simp only [mapRange_apply, AddMonoidHom.coe_coe] apply le_trans ?_ (enorm_measure_le_variation _ _) - apply (ContinuousLinearMap.le_opNorm_enorm _ _).trans - exact mul_le_of_le_one_left (by positivity) hℓ + exact (ContinuousLinearMap.le_opNorm_enorm _ _).trans (mul_le_of_le_one_left (by positivity) hℓ) lemma enorm_measure_le_semiVariation : ‖μ s‖ₑ ≤ μ.semiVariation s := by by_cases hs : MeasurableSet s; swap @@ -68,47 +68,139 @@ lemma enorm_measure_le_semiVariation_of_subset (hst : s ⊆ t) : ‖μ s‖ₑ ≤ μ.semiVariation t := enorm_measure_le_semiVariation.trans (semiVariation_mono hst) -lemma foot (μ : VectorMeasure X ℝ) (hs : MeasurableSet s) - {ε : ℝ≥0∞} (hε : ε ≠ 0) (h's : μ.variation s ≠ ∞) : - ∃ t ⊆ s, MeasurableSet t ∧ μ.variation s - ε ≤ 2 * ‖μ t‖ₑ := by +lemma _root_.MeasureTheory.SignedMeasure.exists_subset_lt_enorm_of_lt_variation + (μ : SignedMeasure X) (hs : MeasurableSet s) + {a : ℝ≥0∞} (ha : a < μ.variation s) : + ∃ t ⊆ s, MeasurableSet t ∧ a < 2 * ‖μ t‖ₑ := by + simp_rw [two_mul] obtain ⟨P, Ps, P_disj, P_meas, hP⟩ : ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ s) ∧ - ((P : Set (Set X)).PairwiseDisjoint id) ∧ - (∀ t ∈ P, MeasurableSet t) ∧ μ.variation s ≤ ∑ p ∈ P, ‖μ p‖ₑ + ε := - exists_variation_le_add' _ hs hε.bot_lt h's - have A (p) : ∃ (f : ℝ), (f = 1 ∨ f = -1) ∧ ‖μ p‖ = f * μ p := by - rcases le_total (μ p) 0 with h'p | h'p - · exact ⟨-1, by simp [h'p]⟩ - · exact ⟨1, by simp [h'p]⟩ - choose f hf h'f using A + ((P : Set (Set X)).PairwiseDisjoint id) ∧ + (∀ t ∈ P, MeasurableSet t) ∧ a < ∑ p ∈ P, ‖μ p‖ₑ := exists_lt_sum_of_lt_variation _ hs ha + have I : (∑ p ∈ P.filter (fun p ↦ 0 ≤ μ p), ‖μ p‖ₑ) = + ‖μ (⋃ p ∈ P.filter (fun p ↦ 0 ≤ μ p), p)‖ₑ := by + simp only [Real.norm_eq_abs, enorm_eq_nnnorm, + ← ENNReal.ofNNReal_finsetSum, ENNReal.coe_inj, ← NNReal.coe_inj, + NNReal.coe_sum, coe_nnnorm, Real.norm_eq_abs] + have A : ∑ x ∈ P with 0 ≤ μ x, |μ x| = μ (⋃ x ∈ P.filter (fun x ↦ 0 ≤ μ x), x) := calc + _ = ∑ x ∈ P with 0 ≤ μ x, μ x := by + apply Finset.sum_congr rfl (fun p hp ↦ ?_) + simp only [Finset.mem_filter] at hp + simp [hp] + _ = μ (⋃ x ∈ P.filter (fun x ↦ 0 ≤ μ x), x) := by + rw [of_biUnion_finset] + · apply P_disj.subset (by grind) + · grind + rw [A, abs_of_nonneg] + rw [← A] + exact Finset.sum_nonneg (fun p hp ↦ by positivity) + have J : (∑ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), ‖μ p‖ₑ) = + ‖μ (⋃ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), p)‖ₑ := by + simp only [not_le, enorm_eq_nnnorm, ← ENNReal.ofNNReal_finsetSum, + ENNReal.coe_inj, ← NNReal.coe_inj, NNReal.coe_sum, coe_nnnorm, Real.norm_eq_abs] + have A : ∑ x ∈ P with μ x < 0, |μ x| = - μ (⋃ x ∈ P.filter (fun x ↦ μ x < 0), x) := calc + ∑ x ∈ P with μ x < 0, |μ x| + _ = ∑ x ∈ P with μ x < 0, -μ x := by + refine Finset.sum_congr rfl (fun p hp ↦ ?_) + simp only [Finset.mem_filter] at hp + simp [hp.2.le] + _ = -μ (⋃ x ∈ P.filter (fun x ↦ μ x < 0), x) := by + rw [of_biUnion_finset] + · simp + · apply P_disj.subset (by grind) + · grind + rw [A, abs_of_nonpos] + rw [← neg_nonneg, ← A] + exact Finset.sum_nonneg (fun p hp ↦ by positivity) + rw [← Finset.sum_filter_add_sum_filter_not _ (fun p ↦ 0 ≤ μ p), I, J] at hP + rcases le_total (‖μ (⋃ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), p)‖ₑ) + (‖μ (⋃ p ∈ P.filter (fun p ↦ 0 ≤ μ p), p)‖ₑ) with h | h + · refine ⟨⋃ p ∈ P.filter (fun p ↦ 0 ≤ μ p), p, ?_, ?_, ?_⟩ + · simp; grind + · exact Finset.measurableSet_biUnion _ (by grind) + · exact hP.trans_le (by gcongr) + · refine ⟨⋃ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), p, ?_, ?_, ?_⟩ + · simp; grind + · exact Finset.measurableSet_biUnion _ (by grind) + · exact hP.trans_le (by gcongr) + +lemma exists_subset_lt_enorm_of_lt_semiVariation (hs : MeasurableSet s) + {a : ℝ≥0∞} (ha : a < μ.semiVariation s) : + ∃ t ⊆ s, MeasurableSet t ∧ a < 2 * ‖μ t‖ₑ := by + obtain ⟨ℓ, hℓ, h'ℓ⟩ : ∃ ℓ ∈ {ℓ : StrongDual ℝ E| ‖ℓ‖ₑ ≤ 1}, + a < (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation s := lt_biSup_iff.1 ha + obtain ⟨t, ts, t_meas, ht⟩ : + ∃ t ⊆ s, MeasurableSet t ∧ a < 2 * ‖μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous t‖ₑ := + SignedMeasure.exists_subset_lt_enorm_of_lt_variation _ hs h'ℓ + refine ⟨t, ts, t_meas, ht.trans_le ?_⟩ + gcongr + exact (ContinuousLinearMap.le_opNorm_enorm _ _).trans (mul_le_of_le_one_left (by positivity) hℓ) + +lemma foot (hs : MeasurableSet s) (h's : μ.semiVariation s = ∞) : + ∃ t, MeasurableSet t ∧ t ⊆ s ∧ μ.semiVariation t = ∞ ∧ 1 ≤ ‖μ (s \ t)‖ₑ := by + obtain ⟨t, ts, t_meas, ht⟩ : ∃ t ⊆ s, MeasurableSet t ∧ 2 * ‖μ s‖ₑ + 2 < 2 * ‖μ t‖ₑ := by + apply exists_subset_lt_enorm_of_lt_semiVariation hs + rw [h's] + finiteness + have h't : 1 + ‖μ s‖ₑ ≤ ‖μ t‖ₑ := by + apply (ENNReal.mul_le_mul_iff_right (a := 2) (by simp) (by simp)).1 + rw [mul_add, add_comm, mul_one] + exact ht.le + have I : ∞ ≤ μ.semiVariation t + μ.semiVariation (s \ t) := by + rw [← h's] + apply le_trans (semiVariation_mono (by simp)) semiVariation_union_le + simp only [top_le_iff, ENNReal.add_eq_top] at I + rcases I with hI | hI + · refine ⟨t, t_meas, ts, hI, ?_⟩ + have : 1 + ‖μ s‖ₑ ≤ ‖μ (s \ t)‖ₑ + ‖μ s‖ₑ := by + apply h't.trans + have : μ t = μ s - μ (s \ t) := by rw [← of_add_of_diff t_meas hs ts]; abel + rw [this, add_comm] + exact enorm_sub_le + rwa [ENNReal.add_le_add_iff_right (by simp)] at this + · refine ⟨s \ t, hs.diff t_meas, diff_subset, hI, ?_⟩ + simp only [sdiff_sdiff_right_self, Set.le_eq_subset, ts, inf_of_le_right] + exact le_trans (by simp) h't + +lemma bar : μ.semiVariation univ < ∞ := by + apply Ne.lt_top (fun h ↦ ?_) + have A (s : Set X) (hs : MeasurableSet s) (h's : μ.semiVariation s = ∞) : + ∃ t, MeasurableSet t ∧ t ⊆ s ∧ μ.semiVariation t = ∞ ∧ 1 ≤ ‖μ (s \ t)‖ₑ := foot hs h's + choose! t t_meas t_subs t_var ht using A + let s n := t^[n] univ + have hs n : MeasurableSet (s n) ∧ μ.semiVariation (s n) = ∞ := by + induction n with + | zero => simp [s, h] + | succ n ih => + simp only [Function.iterate_succ', Function.comp_apply, s] + exact ⟨t_meas _ ih.1 ih.2, t_var _ ih.1 ih.2⟩ + let u n := s n \ s (n + 1) + have hu n : 1 ≤ ‖μ (u n)‖ₑ := by + simp only [Function.iterate_succ', Function.comp_apply, u, s] + exact ht _ (hs n).1 (hs n).2 + have s_anti : Antitone s := by + apply antitone_nat_of_succ_le (fun n ↦ ?_) + simp only [Function.iterate_succ', Function.comp_apply, s] + apply t_subs _ (hs n).1 (hs n).2 + have u_disj : Pairwise (Disjoint on u) := by + apply (pairwise_disjoint_on _).2 (fun m n hmn ↦ ?_) + have : Disjoint (u m) (s (m + 1)) := by simp [u, disjoint_sdiff_left] + apply this.mono_right + simp only [sdiff_le_iff, sup_eq_union, le_eq_subset, u] + exact Subset.trans (s_anti (by grind)) subset_union_right + have : HasSum (fun i => μ (u i)) (μ (⋃ i, u i)) := + hasSum_of_disjoint_iUnion (fun n ↦ (hs n).1.diff (hs (n + 1)).1) u_disj + have := this.summable.tendsto_atTop_zero + have := tendsto_zero_iff_enorm -#exit - -lemma exists_variation_le_add' (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) - {ε : ℝ≥0∞} (hε : 0 < ε) (hμ : μ.variation s ≠ ∞) : - ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ s) ∧ ((P : Set (Set X)).PairwiseDisjoint id) ∧ - (∀ t ∈ P, MeasurableSet t) ∧ μ.variation s ≤ ∑ p ∈ P, ‖μ p‖ₑ + ε := by -lemma exists_semiVariation_le_enorm_measure (ε : ℝ≥0∞) (hε : ε ≠ 0) (htop : μ.semiVariation t ≠ ∞) : - ∃ s ⊆ t, MeasurableSet s ∧ μ.semiVariation t ≤ 2 * ‖μ s‖ₑ + ε := by - rcases eq_zero_or_pos (μ.semiVariation t) with ht | ht - · refine ⟨∅, by simp [ht]⟩ - obtain ⟨ℓ, ℓmem, hℓ⟩ : ∃ ℓ ∈ {ℓ : StrongDual ℝ E| ‖ℓ‖ₑ ≤ 1}, - μ.semiVariation t - ε < (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation t := - lt_biSup_iff.1 (ENNReal.sub_lt_self htop ht.ne' hε) +#exit +hasSum_of_disjoint_iUnion (hm : ∀ i, MeasurableSet (f i)) (hd : Pairwise (Disjoint on f)) : -#exit -theorem exists_subset_lt_add (H : InnerRegularWRT μ p q) (h0 : p ∅) (hU : q U) (hμU : μ U ≠ ∞) - (hε : ε ≠ 0) : ∃ K, K ⊆ U ∧ p K ∧ μ U < μ K + ε := by - rcases eq_or_ne (μ U) 0 with h₀ | h₀ - · refine ⟨∅, empty_subset _, h0, ?_⟩ - rwa [measure_empty, h₀, zero_add, pos_iff_ne_zero] - · rcases H hU _ (ENNReal.sub_lt_self hμU h₀ hε) with ⟨K, hKU, hKc, hrK⟩ - exact ⟨K, hKU, hKc, ENNReal.lt_add_of_sub_lt_right (Or.inl hμU) hrK⟩ From 6df6ab6c853a03970b6fea011f87aad74ae642a2 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 8 Jun 2026 21:23:34 +0200 Subject: [PATCH 110/129] complete proof of bound --- Mathlib.lean | 1 + Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 1 + .../VectorMeasure/Variation/Basic.lean | 64 ++++++- .../Variation/Semivariation.lean | 163 ++++++++---------- docs/references.bib | 15 ++ 5 files changed, 151 insertions(+), 93 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index 6b9a2f6dac94eb..8675afa5ac3d75 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5621,6 +5621,7 @@ public import Mathlib.MeasureTheory.VectorMeasure.Prod public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral public import Mathlib.MeasureTheory.VectorMeasure.Variation.Basic public import Mathlib.MeasureTheory.VectorMeasure.Variation.Defs +public import Mathlib.MeasureTheory.VectorMeasure.Variation.Semivariation public import Mathlib.MeasureTheory.VectorMeasure.WithDensity public import Mathlib.MeasureTheory.VectorMeasure.WithDensityVec public import Mathlib.ModelTheory.Algebra.Field.Basic diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index dbf72a0e95753e..e3b28845dc8ed9 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -6,6 +6,7 @@ Authors: Sébastien Gouëzel module public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral +public import Mathlib.MeasureTheory.VectorMeasure.Variation.Semivariation /-! # Product of vector measures diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index c34a88d2463d0e..37842ddaf18c02 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -331,7 +331,8 @@ instance {x : X} {v : V} : IsFiniteMeasure (VectorMeasure.dirac x v).variation : simp only [variation_dirac, enorm_eq_nnnorm, Measure.coe_nnreal_smul] infer_instance -@[simp] lemma variation_toSignedMeasure {μ : Measure X} [IsFiniteMeasure μ] : +@[simp] lemma _root_.MeasureTheory.Measure.variation_toSignedMeasure + {μ : Measure X} [IsFiniteMeasure μ] : μ.toSignedMeasure.variation = μ := by apply le_antisymm · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) @@ -340,6 +341,67 @@ instance {x : X} {v : V} : IsFiniteMeasure (VectorMeasure.dirac x v).variation : apply le_trans ?_ (enorm_measure_le_variation _ _) simp [Measure.toSignedMeasure_apply, hs, Measure.real, Real.enorm_eq_ofReal] +/-- For a signed measure, the variation is realized by the norm of the measure of a single set, up +to a factor of `2` and an arbitrarily small error. -/ +lemma _root_.MeasureTheory.SignedMeasure.exists_subset_lt_enorm_apply_of_lt_variation + (μ : SignedMeasure X) {s : Set X} (hs : MeasurableSet s) + {a : ℝ≥0∞} (ha : a < μ.variation s) : + ∃ t ⊆ s, MeasurableSet t ∧ a < 2 * ‖μ t‖ₑ := by + /- One may almost realize the variation through a partition into finitely many sets. + As their measures are real numbers, we can group together those of positive measure, and + also those of negative measure. This gives two measurable sets. Among these two, the one with the + largest measure in absolute value satisfies the result. -/ + obtain ⟨P, Ps, P_disj, P_meas, hP⟩ : ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ s) ∧ + ((P : Set (Set X)).PairwiseDisjoint id) ∧ + (∀ t ∈ P, MeasurableSet t) ∧ a < ∑ p ∈ P, ‖μ p‖ₑ := exists_lt_sum_of_lt_variation _ hs ha + have I : (∑ p ∈ P.filter (fun p ↦ 0 ≤ μ p), ‖μ p‖ₑ) = + ‖μ (⋃ p ∈ P.filter (fun p ↦ 0 ≤ μ p), p)‖ₑ := by + simp only [Real.norm_eq_abs, enorm_eq_nnnorm, + ← ENNReal.ofNNReal_finsetSum, ENNReal.coe_inj, ← NNReal.coe_inj, + NNReal.coe_sum, coe_nnnorm, Real.norm_eq_abs] + have A : ∑ x ∈ P with 0 ≤ μ x, |μ x| = μ (⋃ x ∈ P.filter (fun x ↦ 0 ≤ μ x), x) := calc + _ = ∑ x ∈ P with 0 ≤ μ x, μ x := by + apply Finset.sum_congr rfl (fun p hp ↦ ?_) + simp only [Finset.mem_filter] at hp + simp [hp] + _ = μ (⋃ x ∈ P.filter (fun x ↦ 0 ≤ μ x), x) := by + rw [of_biUnion_finset] + · apply P_disj.subset (by grind) + · grind + rw [A, abs_of_nonneg] + rw [← A] + exact Finset.sum_nonneg (fun p hp ↦ by positivity) + have J : (∑ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), ‖μ p‖ₑ) = + ‖μ (⋃ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), p)‖ₑ := by + simp only [not_le, enorm_eq_nnnorm, ← ENNReal.ofNNReal_finsetSum, + ENNReal.coe_inj, ← NNReal.coe_inj, NNReal.coe_sum, coe_nnnorm, Real.norm_eq_abs] + have A : ∑ x ∈ P with μ x < 0, |μ x| = - μ (⋃ x ∈ P.filter (fun x ↦ μ x < 0), x) := calc + ∑ x ∈ P with μ x < 0, |μ x| + _ = ∑ x ∈ P with μ x < 0, -μ x := by + refine Finset.sum_congr rfl (fun p hp ↦ ?_) + simp only [Finset.mem_filter] at hp + simp [hp.2.le] + _ = -μ (⋃ x ∈ P.filter (fun x ↦ μ x < 0), x) := by + rw [of_biUnion_finset] + · simp + · apply P_disj.subset (by grind) + · grind + rw [A, abs_of_nonpos] + rw [← neg_nonneg, ← A] + exact Finset.sum_nonneg (fun p hp ↦ by positivity) + simp_rw [two_mul] + rw [← Finset.sum_filter_add_sum_filter_not _ (fun p ↦ 0 ≤ μ p), I, J] at hP + rcases le_total (‖μ (⋃ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), p)‖ₑ) + (‖μ (⋃ p ∈ P.filter (fun p ↦ 0 ≤ μ p), p)‖ₑ) with h | h + · refine ⟨⋃ p ∈ P.filter (fun p ↦ 0 ≤ μ p), p, ?_, ?_, ?_⟩ + · simp; grind + · exact Finset.measurableSet_biUnion _ (by grind) + · exact hP.trans_le (by gcongr) + · refine ⟨⋃ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), p, ?_, ?_, ?_⟩ + · simp; grind + · exact Finset.measurableSet_biUnion _ (by grind) + · exact hP.trans_le (by gcongr) + end NormedAddCommGroup end MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean index 7f21c1de0f1758..e34cfce7c8688f 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean @@ -5,19 +5,43 @@ Authors: Sébastien Gouëzel -/ module -public import Mathlib.Analysis.Normed.Operator.NormedSpace public import Mathlib.MeasureTheory.VectorMeasure.Variation.Basic import Mathlib.Analysis.Normed.Module.HahnBanach +import Mathlib.Analysis.Normed.Operator.NormedSpace /-! # The semivariation of a vector measure +The semivariation of a vector measure is the supremum of the variations of its push-forwards +to `ℝ` through all linear forms of norm at most `1`. The interest of this notion is that, in the +reals, any set has nonnegative or nonnegative measure, so that the variation is realized by +a subset (up to a factor of at most `2`). This property is inherited by the semivariation in +general: one has the inequalities +``` +‖μ s‖ₑ ≤ μ.semivariation s ≤ 2 sup_{t ⊆ s} ‖μ t‖ₑ +``` + +The notion of semivariation can in particular be used to show that any vector measure is bounded: +there exists `C < ∞` such that `‖μ s‖ ≤ C` for all `s`. + +## Main results + +* `μ.semivariation`: the semivariation of the vector measure `μ`. +* `exists_subset_lt_enorm_apply_of_lt_semivariation`: given `s`, there exists `t ⊆ s` such that + `μ.semivariation s ≤ 2 ‖μ t‖ₑ` up to an arbitrarily small error. +* `μ.bound`: the semivariation of `univ`, in `ℝ≥0`. It is finite by definition. +* `enorm_apply_le_bound`: the inequality `‖μ s‖ₑ ≤ μ.bound`, uniformly in `s`. + +## References + +* [J. Diestel and J.J. Uhl, Vector Measures][DiestelUhl1977] + -/ public section -open scoped ENNReal Function Topology +open scoped ENNReal Function Topology NNReal open Set Filter namespace MeasureTheory.VectorMeasure @@ -27,24 +51,24 @@ variable {X E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {mX : Measurab /-- The semivariation of a vector measure, defined as the supremum of the variations of the images of the vector measures under continuous linear forms of norm at most `1`. -/ -noncomputable def semiVariation (μ : VectorMeasure X E) (s : Set X) : ℝ≥0∞ := +noncomputable def semivariation (μ : VectorMeasure X E) (s : Set X) : ℝ≥0∞ := ⨆ ℓ ∈ {ℓ : StrongDual ℝ E | ‖ℓ‖ₑ ≤ 1}, (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation s -lemma semiVariation_union_le : - μ.semiVariation (s ∪ t) ≤ μ.semiVariation s + μ.semiVariation t := by - simp only [semiVariation, iSup_le_iff] +lemma semivariation_union_le : + μ.semivariation (s ∪ t) ≤ μ.semivariation s + μ.semivariation t := by + simp only [semivariation, iSup_le_iff] intro ℓ hℓ apply (measure_union_le _ _).trans gcongr <;> apply le_biSup _ hℓ -lemma semiVariation_mono (hst : s ⊆ t) : μ.semiVariation s ≤ μ.semiVariation t := by - simp only [semiVariation, iSup_le_iff] +lemma semivariation_mono (hst : s ⊆ t) : μ.semivariation s ≤ μ.semivariation t := by + simp only [semivariation, iSup_le_iff] intro ℓ hℓ apply (measure_mono hst).trans apply le_biSup _ hℓ -lemma semiVariation_le_variation : μ.semiVariation s ≤ μ.variation s := by - simp only [semiVariation, iSup_le_iff] +lemma semivariation_le_variation : μ.semivariation s ≤ μ.variation s := by + simp only [semivariation, iSup_le_iff] intro ℓ hℓ suffices (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation ≤ μ.variation from this s apply variation_le_of_forall_enorm_le (fun t ht ↦ ?_) @@ -52,7 +76,7 @@ lemma semiVariation_le_variation : μ.semiVariation s ≤ μ.variation s := by apply le_trans ?_ (enorm_measure_le_variation _ _) exact (ContinuousLinearMap.le_opNorm_enorm _ _).trans (mul_le_of_le_one_left (by positivity) hℓ) -lemma enorm_measure_le_semiVariation : ‖μ s‖ₑ ≤ μ.semiVariation s := by +lemma enorm_apply_le_semivariation : ‖μ s‖ₑ ≤ μ.semivariation s := by by_cases hs : MeasurableSet s; swap · simp [not_measurable, hs] obtain ⟨ℓ, ℓ_norm, hℓ⟩ : ∃ ℓ : StrongDual ℝ E, ‖ℓ‖ ≤ 1 ∧ ℓ (μ s) = ‖μ s‖ := @@ -62,92 +86,38 @@ lemma enorm_measure_le_semiVariation : ‖μ s‖ₑ ≤ μ.semiVariation s := b calc ‖μ s‖ₑ _ = ‖(μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous) s‖ₑ := by simp [← ofReal_norm, hℓ] _ ≤ (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation s := enorm_measure_le_variation _ _ - _ ≤ μ.semiVariation s := by apply le_biSup _ h'ℓ + _ ≤ μ.semivariation s := by apply le_biSup _ h'ℓ -lemma enorm_measure_le_semiVariation_of_subset (hst : s ⊆ t) : - ‖μ s‖ₑ ≤ μ.semiVariation t := - enorm_measure_le_semiVariation.trans (semiVariation_mono hst) +lemma enorm_apply_le_semivariation_of_subset (hst : s ⊆ t) : + ‖μ s‖ₑ ≤ μ.semivariation t := + enorm_apply_le_semivariation.trans (semivariation_mono hst) -lemma _root_.MeasureTheory.SignedMeasure.exists_subset_lt_enorm_of_lt_variation - (μ : SignedMeasure X) (hs : MeasurableSet s) - {a : ℝ≥0∞} (ha : a < μ.variation s) : +lemma exists_subset_lt_enorm_apply_of_lt_semivariation (hs : MeasurableSet s) + {a : ℝ≥0∞} (ha : a < μ.semivariation s) : ∃ t ⊆ s, MeasurableSet t ∧ a < 2 * ‖μ t‖ₑ := by - simp_rw [two_mul] - obtain ⟨P, Ps, P_disj, P_meas, hP⟩ : ∃ (P : Finset (Set X)), (∀ t ∈ P, t ⊆ s) ∧ - ((P : Set (Set X)).PairwiseDisjoint id) ∧ - (∀ t ∈ P, MeasurableSet t) ∧ a < ∑ p ∈ P, ‖μ p‖ₑ := exists_lt_sum_of_lt_variation _ hs ha - have I : (∑ p ∈ P.filter (fun p ↦ 0 ≤ μ p), ‖μ p‖ₑ) = - ‖μ (⋃ p ∈ P.filter (fun p ↦ 0 ≤ μ p), p)‖ₑ := by - simp only [Real.norm_eq_abs, enorm_eq_nnnorm, - ← ENNReal.ofNNReal_finsetSum, ENNReal.coe_inj, ← NNReal.coe_inj, - NNReal.coe_sum, coe_nnnorm, Real.norm_eq_abs] - have A : ∑ x ∈ P with 0 ≤ μ x, |μ x| = μ (⋃ x ∈ P.filter (fun x ↦ 0 ≤ μ x), x) := calc - _ = ∑ x ∈ P with 0 ≤ μ x, μ x := by - apply Finset.sum_congr rfl (fun p hp ↦ ?_) - simp only [Finset.mem_filter] at hp - simp [hp] - _ = μ (⋃ x ∈ P.filter (fun x ↦ 0 ≤ μ x), x) := by - rw [of_biUnion_finset] - · apply P_disj.subset (by grind) - · grind - rw [A, abs_of_nonneg] - rw [← A] - exact Finset.sum_nonneg (fun p hp ↦ by positivity) - have J : (∑ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), ‖μ p‖ₑ) = - ‖μ (⋃ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), p)‖ₑ := by - simp only [not_le, enorm_eq_nnnorm, ← ENNReal.ofNNReal_finsetSum, - ENNReal.coe_inj, ← NNReal.coe_inj, NNReal.coe_sum, coe_nnnorm, Real.norm_eq_abs] - have A : ∑ x ∈ P with μ x < 0, |μ x| = - μ (⋃ x ∈ P.filter (fun x ↦ μ x < 0), x) := calc - ∑ x ∈ P with μ x < 0, |μ x| - _ = ∑ x ∈ P with μ x < 0, -μ x := by - refine Finset.sum_congr rfl (fun p hp ↦ ?_) - simp only [Finset.mem_filter] at hp - simp [hp.2.le] - _ = -μ (⋃ x ∈ P.filter (fun x ↦ μ x < 0), x) := by - rw [of_biUnion_finset] - · simp - · apply P_disj.subset (by grind) - · grind - rw [A, abs_of_nonpos] - rw [← neg_nonneg, ← A] - exact Finset.sum_nonneg (fun p hp ↦ by positivity) - rw [← Finset.sum_filter_add_sum_filter_not _ (fun p ↦ 0 ≤ μ p), I, J] at hP - rcases le_total (‖μ (⋃ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), p)‖ₑ) - (‖μ (⋃ p ∈ P.filter (fun p ↦ 0 ≤ μ p), p)‖ₑ) with h | h - · refine ⟨⋃ p ∈ P.filter (fun p ↦ 0 ≤ μ p), p, ?_, ?_, ?_⟩ - · simp; grind - · exact Finset.measurableSet_biUnion _ (by grind) - · exact hP.trans_le (by gcongr) - · refine ⟨⋃ p ∈ P.filter (fun p ↦ ¬ 0 ≤ μ p), p, ?_, ?_, ?_⟩ - · simp; grind - · exact Finset.measurableSet_biUnion _ (by grind) - · exact hP.trans_le (by gcongr) - -lemma exists_subset_lt_enorm_of_lt_semiVariation (hs : MeasurableSet s) - {a : ℝ≥0∞} (ha : a < μ.semiVariation s) : - ∃ t ⊆ s, MeasurableSet t ∧ a < 2 * ‖μ t‖ₑ := by - obtain ⟨ℓ, hℓ, h'ℓ⟩ : ∃ ℓ ∈ {ℓ : StrongDual ℝ E| ‖ℓ‖ₑ ≤ 1}, + obtain ⟨ℓ, hℓ, h'ℓ⟩ : ∃ ℓ ∈ {ℓ : StrongDual ℝ E | ‖ℓ‖ₑ ≤ 1}, a < (μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous).variation s := lt_biSup_iff.1 ha obtain ⟨t, ts, t_meas, ht⟩ : ∃ t ⊆ s, MeasurableSet t ∧ a < 2 * ‖μ.mapRange (ℓ : E →+ ℝ) ℓ.continuous t‖ₑ := - SignedMeasure.exists_subset_lt_enorm_of_lt_variation _ hs h'ℓ + SignedMeasure.exists_subset_lt_enorm_apply_of_lt_variation _ hs h'ℓ refine ⟨t, ts, t_meas, ht.trans_le ?_⟩ gcongr exact (ContinuousLinearMap.le_opNorm_enorm _ _).trans (mul_le_of_le_one_left (by positivity) hℓ) -lemma foot (hs : MeasurableSet s) (h's : μ.semiVariation s = ∞) : - ∃ t, MeasurableSet t ∧ t ⊆ s ∧ μ.semiVariation t = ∞ ∧ 1 ≤ ‖μ (s \ t)‖ₑ := by +private lemma exists_one_le_enorm_apply_of_semivariation_eq_top + (hs : MeasurableSet s) (h's : μ.semivariation s = ∞) : + ∃ t, MeasurableSet t ∧ t ⊆ s ∧ μ.semivariation t = ∞ ∧ 1 ≤ ‖μ (s \ t)‖ₑ := by obtain ⟨t, ts, t_meas, ht⟩ : ∃ t ⊆ s, MeasurableSet t ∧ 2 * ‖μ s‖ₑ + 2 < 2 * ‖μ t‖ₑ := by - apply exists_subset_lt_enorm_of_lt_semiVariation hs + apply exists_subset_lt_enorm_apply_of_lt_semivariation hs rw [h's] finiteness have h't : 1 + ‖μ s‖ₑ ≤ ‖μ t‖ₑ := by apply (ENNReal.mul_le_mul_iff_right (a := 2) (by simp) (by simp)).1 rw [mul_add, add_comm, mul_one] exact ht.le - have I : ∞ ≤ μ.semiVariation t + μ.semiVariation (s \ t) := by + have I : ∞ ≤ μ.semivariation t + μ.semivariation (s \ t) := by rw [← h's] - apply le_trans (semiVariation_mono (by simp)) semiVariation_union_le + apply le_trans (semivariation_mono (by simp)) semivariation_union_le simp only [top_le_iff, ENNReal.add_eq_top] at I rcases I with hI | hI · refine ⟨t, t_meas, ts, hI, ?_⟩ @@ -161,13 +131,14 @@ lemma foot (hs : MeasurableSet s) (h's : μ.semiVariation s = ∞) : simp only [sdiff_sdiff_right_self, Set.le_eq_subset, ts, inf_of_le_right] exact le_trans (by simp) h't -lemma bar : μ.semiVariation univ < ∞ := by +private lemma semivariation_univ_lt_top : μ.semivariation univ < ∞ := by apply Ne.lt_top (fun h ↦ ?_) - have A (s : Set X) (hs : MeasurableSet s) (h's : μ.semiVariation s = ∞) : - ∃ t, MeasurableSet t ∧ t ⊆ s ∧ μ.semiVariation t = ∞ ∧ 1 ≤ ‖μ (s \ t)‖ₑ := foot hs h's + have A (s : Set X) (hs : MeasurableSet s) (h's : μ.semivariation s = ∞) : + ∃ t, MeasurableSet t ∧ t ⊆ s ∧ μ.semivariation t = ∞ ∧ 1 ≤ ‖μ (s \ t)‖ₑ := + exists_one_le_enorm_apply_of_semivariation_eq_top hs h's choose! t t_meas t_subs t_var ht using A let s n := t^[n] univ - have hs n : MeasurableSet (s n) ∧ μ.semiVariation (s n) = ∞ := by + have hs n : MeasurableSet (s n) ∧ μ.semivariation (s n) = ∞ := by induction n with | zero => simp [s, h] | succ n ih => @@ -189,19 +160,27 @@ lemma bar : μ.semiVariation univ < ∞ := by exact Subset.trans (s_anti (by grind)) subset_union_right have : HasSum (fun i => μ (u i)) (μ (⋃ i, u i)) := hasSum_of_disjoint_iUnion (fun n ↦ (hs n).1.diff (hs (n + 1)).1) u_disj - have := this.summable.tendsto_atTop_zero - have := tendsto_zero_iff_enorm - - - - - -#exit + have : Tendsto (fun x ↦ ‖μ (u x)‖ₑ) atTop (𝓝 0) := + tendsto_zero_iff_enorm_tendsto_zero.1 this.summable.tendsto_atTop_zero + obtain ⟨n, hn⟩ : ∃ n, ‖μ (u n)‖ₑ < 1 := ((tendsto_order.1 this).2 _ zero_lt_one).exists + order [hu n] -hasSum_of_disjoint_iUnion (hm : ∀ i, MeasurableSet (f i)) (hd : Pairwise (Disjoint on f)) : +/-- A constant bounding the norm of `μ s` for any set `s`. -/ +protected noncomputable def bound : ℝ≥0 := (μ.semivariation univ).toNNReal +lemma semivariation_apply_le_bound : μ.semivariation s ≤ μ.bound := by + apply (semivariation_mono (subset_univ _)).trans_eq + simp only [VectorMeasure.bound] + rw [ENNReal.coe_toNNReal semivariation_univ_lt_top.ne] +lemma enorm_apply_le_bound : ‖μ s‖ₑ ≤ μ.bound := + (enorm_apply_le_semivariation).trans semivariation_apply_le_bound +lemma nnnorm_apply_le_bound : ‖μ s‖₊ ≤ μ.bound := by + rw [← ENNReal.coe_le_coe, ← enorm_eq_nnnorm] + exact enorm_apply_le_bound +lemma norm_apply_le_bound : ‖μ s‖ ≤ μ.bound := by + simpa [← coe_nnnorm] using nnnorm_apply_le_bound end MeasureTheory.VectorMeasure diff --git a/docs/references.bib b/docs/references.bib index bf9b2fbb1e98e4..973a234e5a6d3d 100644 --- a/docs/references.bib +++ b/docs/references.bib @@ -1659,6 +1659,21 @@ @Book{ diamondshurman2005 zbl = {1062.11022} } +@book{DiestelUhl1977, + author = {Diestel, J. and Uhl, J. J. jun.}, + title = {Vector measures}, + fseries = {Mathematical Surveys}, + series = {Math. Surv.}, + issn = {0076-5376}, + volume = {15}, + year = {1977}, + publisher = {American Mathematical Society (AMS), Providence, RI}, + language = {English}, + keywords = {46G10,28B05,28A15,28A20,46-02,46B10,46B99,46E15,46E30,46G05,47A65,47B06,47B10,47B99}, + zbMATH = {3576139}, + Zbl = {0369.46039} +} + @Article{ dieudonne1953, author = {Dieudonn\'{e}, Jean}, title = {On semi-simple {L}ie algebras}, From 9e90983419d91241a730c7ee4e0833f6438d8b78 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 8 Jun 2026 21:50:50 +0200 Subject: [PATCH 111/129] start fixing --- .../MeasureTheory/VectorMeasure/Integral.lean | 2 +- Mathlib/Topology/UniformSpace/Dini.lean | 2 +- docs/references.bib | 26 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 227c9783e8f9a8..c0e94e00f2e5c5 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -643,7 +643,7 @@ theorem exists_ne_zero_of_integral_ne_zero rcases subsingleton_or_nontrivial G with h'G | h'G · apply Subsingleton.elim rw [integral_eq_setToFun, MeasureTheory.integral_eq_setToFun] - simp only [variation_transpose_lsmul_flip, variation_toSignedMeasure] + simp only [variation_transpose_lsmul_flip, Measure.variation_toSignedMeasure] apply setToFun_congr_left' _ _ (fun s hs h's ↦ ?_) simp only [transpose, ContinuousLinearMap.flip_flip, mapRange_apply, Measure.toSignedMeasure_apply, hs, ↓reduceIte, LinearMap.toAddMonoidHom_coe, diff --git a/Mathlib/Topology/UniformSpace/Dini.lean b/Mathlib/Topology/UniformSpace/Dini.lean index 34c07a3509d4fb..e9280ee5911be1 100644 --- a/Mathlib/Topology/UniformSpace/Dini.lean +++ b/Mathlib/Topology/UniformSpace/Dini.lean @@ -56,7 +56,7 @@ lemma tendstoLocallyUniformly_of_forall_tendsto refine (atTop : Filter ι).eq_or_neBot.elim (fun h ↦ ?eq_bot) (fun _ ↦ ?_) case eq_bot => simp [h, tendstoLocallyUniformly_iff_forall_tendsto] have F_le_f (x : α) (n : ι) : F n x ≤ f x := by - refine ge_of_tendsto (h_tendsto x) ?_ + refine _root_.ge_of_tendsto (h_tendsto x) ?_ filter_upwards [Ici_mem_atTop n] with m hnm exact hF_mono hnm x simp_rw [Metric.tendstoLocallyUniformly_iff, dist_eq_norm'] diff --git a/docs/references.bib b/docs/references.bib index 0d12bbdf21a027..e94e4d16cf8faf 100644 --- a/docs/references.bib +++ b/docs/references.bib @@ -1659,19 +1659,19 @@ @Book{ diamondshurman2005 zbl = {1062.11022} } -@book{DiestelUhl1977, - author = {Diestel, J. and Uhl, J. J. jun.}, - title = {Vector measures}, - fseries = {Mathematical Surveys}, - series = {Math. Surv.}, - issn = {0076-5376}, - volume = {15}, - year = {1977}, - publisher = {American Mathematical Society (AMS), Providence, RI}, - language = {English}, - keywords = {46G10,28B05,28A15,28A20,46-02,46B10,46B99,46E15,46E30,46G05,47A65,47B06,47B10,47B99}, - zbMATH = {3576139}, - Zbl = {0369.46039} +@Book{ DiestelUhl1977, + author = {Diestel, J. and Uhl, J. J. jun.}, + title = {Vector measures}, + fseries = {Mathematical Surveys}, + series = {Math. Surv.}, + issn = {0076-5376}, + volume = {15}, + year = {1977}, + publisher = {American Mathematical Society (AMS), Providence, RI}, + language = {English}, + keywords = {46G10,28B05,28A15,28A20,46-02,46B10,46B99,46E15,46E30,46G05,47A65,47B06,47B10,47B99}, + zbmath = {3576139}, + zbl = {0369.46039} } @Article{ dieudonne1953, From 671d0e0ce6dbfba44ec03e8ef4abb43e7ee194ac Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 8 Jun 2026 22:13:26 +0200 Subject: [PATCH 112/129] better --- .../VectorMeasure/AddContent.lean | 6 +-- Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 38 ++++++++++--------- .../VectorMeasure/WithDensityVec.lean | 10 ++--- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index b524aeaa2ab505..94b12649f00a6b 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -384,10 +384,8 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] (measurableSet_generateFrom hs) · exact (integrable_const 1).indicator (h'C s hs) rw [this, integral_indicator (measurableSet_generateFrom hs)] - have : IsFiniteMeasure - ((m'.restrict s).transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation := by - apply isFiniteMeasure_of_le (μ := μ') - grw [transpose_restrict, variation_restrict_le, Measure.restrict_le_self, m'_le] + have : IsFiniteMeasure (m'.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation := + isFiniteMeasure_of_le _ m'_le simp only [Pi.one_apply, setIntegral_const] simp [m'C s hs] · by_cases hs : MeasurableSet s; swap diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index e3b28845dc8ed9..6a3d4bef8d88df 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -42,7 +42,7 @@ noncomputable def prod (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E measure giving mass `B (μ s) (ν t)` to any measurable product `s × t`. This is satisfied whenever `μ` or `ν` has finite variation. -/ class HasProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) where - out : ∃ ρ : VectorMeasure (X × Y) G, ∀ (s : Set X) (t : Set Y), + exists_prod : ∃ ρ : VectorMeasure (X × Y) G, ∀ (s : Set X) (t : Set Y), MeasurableSet s → MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t) @[simp] lemma prod_apply [h : HasProd μ ν B] {s : Set X} {t : Set Y} : @@ -60,10 +60,10 @@ class HasProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] · simp only [h't, not_false_eq_true, not_measurable, _root_.map_zero] rw [not_measurable] simp [measurableSet_prod, hs, ht, h't] - simpa [prod, h.out] using h.out.choose_spec s t h's h't + simpa [prod, h.exists_prod] using h.exists_prod.choose_spec s t h's h't lemma HasProd.flip [HasProd μ ν B] : HasProd ν μ B.flip where - out := by + exists_prod := by refine ⟨(μ.prod ν B).map Prod.swap, fun s t hs ht ↦ ?_⟩ rw [map_apply _ (by fun_prop) (hs.prod ht)] simp @@ -92,27 +92,29 @@ theorem stronglyMeasurable_vectorMeasure_prodMk_left {s : Set (X × Y)} apply StronglyMeasurable.hasSum ihf this open scoped Classical in -/-- The naive product of two vector measures, obtained by integrating the measure of the fibers, -as in the definition of the product of positive measures. -/ -noncomputable def naiveProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) +/-- The product of two vector measures when the first one has finite variation, obtained by +integrating the measure of the fibers, as in the definition of the product of positive measures. +*Do not use*: This is only used to instantiate the typeclass `HasProd`. Instead, use `μ.prod ν B`, +which uses the typeclass instance. -/ +noncomputable def prodOfIsFiniteMeasureLeft + (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) [IsFiniteMeasure (μ.transpose B.flip).variation] : VectorMeasure (X × Y) G where measureOf' s := if MeasurableSet s then ∫ᵛ x, ν (Prod.mk x ⁻¹' s) ∂[B.flip; μ] else 0 empty' := by simp not_measurable' := by simp +contextual m_iUnion' f f_meas f_disj := by - obtain ⟨C, hC⟩ : ∃ C, ∀ (t : Set Y), ‖ν t‖ ≤ C := sorry - simp only [f_meas, ↓reduceIte, implies_true, MeasurableSet.iUnion, preimage_iUnion] - simp only [HasSum, SummationFilter.unconditional_filter] + simp only [f_meas, ↓reduceIte, implies_true, MeasurableSet.iUnion, preimage_iUnion, + HasSum, SummationFilter.unconditional_filter] have A (a : Finset ℕ) : ∑ y ∈ a, ∫ᵛ x, ν (Prod.mk x ⁻¹' f y) ∂[B.flip; μ] = ∫ᵛ x, ∑ y ∈ a, ν (Prod.mk x ⁻¹' f y) ∂[B.flip; μ] := by rw [integral_finsetSum] intro i hi - refine Integrable.of_bound (μ := (μ.transpose B.flip).variation) ?_ C ?_ + refine Integrable.of_bound (μ := (μ.transpose B.flip).variation) ?_ ν.bound ?_ · exact (stronglyMeasurable_vectorMeasure_prodMk_left (f_meas i)).aestronglyMeasurable - · exact Eventually.of_forall (fun x ↦ hC _) + · exact Eventually.of_forall (fun x ↦ norm_apply_le_bound) simp_rw [A] - apply tendsto_integral_filter_of_dominated_convergence (bound := fun x ↦ C) + apply tendsto_integral_filter_of_dominated_convergence (bound := fun x ↦ ν.bound) · apply Eventually.of_forall (fun a ↦ ?_) apply StronglyMeasurable.aestronglyMeasurable apply Finset.stronglyMeasurable_fun_sum _ (fun i hi ↦ ?_) @@ -120,7 +122,7 @@ noncomputable def naiveProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B · filter_upwards with a filter_upwards with x rw [← VectorMeasure.of_biUnion_finset] - · apply hC + · apply norm_apply_le_bound · exact fun i hi j hj hij ↦ (f_disj hij).preimage _ · exact fun i hi ↦ measurable_prodMk_left (f_meas i) · apply integrable_const @@ -130,12 +132,14 @@ noncomputable def naiveProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B · exact fun i j hij ↦ (f_disj hij).preimage _ instance [CompleteSpace G] [IsFiniteMeasure (μ.transpose B.flip).variation] : HasProd μ ν B where - out := by + exists_prod := by classical - refine ⟨naiveProd μ ν B, fun s t hs ht ↦ ?_⟩ - simp only [naiveProd, hs.prod ht, ↓reduceIte, mk_preimage_prod_right_eq_if, vectorMeasure_if, - integral_indicator hs, setIntegral_const, ContinuousLinearMap.flip_apply] + refine ⟨prodOfIsFiniteMeasureLeft μ ν B, fun s t hs ht ↦ ?_⟩ + simp only [prodOfIsFiniteMeasureLeft, hs.prod ht, ↓reduceIte, mk_preimage_prod_right_eq_if, + vectorMeasure_if, integral_indicator hs, setIntegral_const, ContinuousLinearMap.flip_apply] instance [CompleteSpace G] [h : IsFiniteMeasure (ν.transpose B).variation] : HasProd μ ν B := by rw [← B.flip_flip] at h ⊢ apply HasProd.flip + +end MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index 05cbad276cc2c6..a563a8e2360f98 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -195,9 +195,9 @@ lemma variation_withDensity' [CompleteSpace G] · simp simp only [Finset.mem_sigma] at hi have pmeas : MeasurableSet p := Pmeas i _ hi.2 - have : IsFiniteMeasure (((μ.restrict s).restrict p).transpose B).variation := by + have : IsFiniteMeasure (((μ.restrict s).transpose B).variation.restrict p) := by constructor - rw [restrict_restrict _ pmeas hs, transpose_restrict, variation_restrict (pmeas.inter hs), + rw [transpose_restrict, variation_restrict hs, Measure.restrict_restrict pmeas, MeasureTheory.Measure.restrict_apply_univ] apply lt_of_le_of_lt ?_ (g.integrable_iff.1 (memLp_one_iff_integrable.1 gmem) i h'i) exact measure_mono (inter_subset_left.trans (Pg i _ hi.2)) @@ -332,7 +332,7 @@ lemma variation_withDensity [CompleteSpace G] /-- The variation of a vecture measure with density `f` with respect to a positive measure `μ` is the measure with density `‖f‖ₑ` with respect to `μ`. -/ -lemma variation_withDensityᵥ [CompleteSpace E] +lemma _root_.MeasureTheory.Measure.variation_withDensityᵥ [CompleteSpace E] {μ : Measure X} {f : X → E} (hf : Integrable f μ) : (μ.withDensityᵥ f).variation = μ.withDensity (fun x ↦ ‖f x‖ₑ) := by /- We deduce this statement from the statement `variation_withDensity` for vector measures @@ -345,7 +345,7 @@ lemma variation_withDensityᵥ [CompleteSpace E] (ContinuousLinearMap.lsmul ℝ ℝ).flip := by apply Integrable.mono_measure _ (variation_transpose_le _ _) apply Integrable.smul_measure_nnreal - simp only [variation_toSignedMeasure] + simp only [Measure.variation_toSignedMeasure] apply Integrable.of_bound (C := 1) · apply AEStronglyMeasurable.mono_ac (withDensity_absolutelyContinuous _ _) exact hf.aestronglyMeasurable.norm.inv₀.smul hf.aestronglyMeasurable @@ -364,7 +364,7 @@ lemma variation_withDensityᵥ [CompleteSpace E] rw [mul_inv_cancel₀, one_smul] simpa using hx rw [this, variation_withDensity I (by simp [nnnorm_smul, mul_comm]), - variation_transpose_eq _ _ (by simp [nnnorm_smul, mul_comm]), variation_toSignedMeasure, + variation_transpose_eq _ _ (by simp [nnnorm_smul, mul_comm]), Measure.variation_toSignedMeasure, ← withDensity_mul₀ hf.aestronglyMeasurable.enorm]; swap · exact (hf.aestronglyMeasurable.norm.inv₀.smul hf.aestronglyMeasurable).enorm congr with x From 83ed76e4da714150f853dad605caf3ddf5127ef4 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Mon, 8 Jun 2026 22:29:44 +0200 Subject: [PATCH 113/129] move --- Mathlib/MeasureTheory/VectorMeasure/Basic.lean | 4 ++++ Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 12 +++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index c8f5cc1fcf4f77..d71b608f2b8ca4 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -135,6 +135,10 @@ theorem hasSum_of_disjoint_iUnion (hm : ∀ i, MeasurableSet (f i)) (hd : Pairwi · simp [Function.apply_extend MeasurableSet, Function.comp_def, hm] · exact hd.disjoint_extend_bot (he.factorsThrough _) +theorem of_if {ι : Type*} {x : ι} {B : Set ι} {A : Set α} [Decidable (x ∈ B)] : + v (if x ∈ B then A else ∅) = indicator B (fun _ => v A) x := by + split_ifs with h <;> simp [h] + variable [T2Space M] theorem of_disjoint_iUnion (hm : ∀ i, MeasurableSet (f i)) (hd : Pairwise (Disjoint on f)) : diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 6a3d4bef8d88df..c92d06263a2fe6 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -12,6 +12,8 @@ public import Mathlib.MeasureTheory.VectorMeasure.Variation.Semivariation # Product of vector measures -/ +public section + open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology open scoped ENNReal NNReal Finset @@ -24,10 +26,6 @@ variable {ι X Y E F G : Type*} {mX : MeasurableSpace X} {mY : MeasurableSpace Y namespace MeasureTheory.VectorMeasure -omit [NormedSpace ℝ E] in -theorem vectorMeasure_if {x : Y} {t : Set Y} {s : Set X} [Decidable (x ∈ t)] : - μ (if x ∈ t then s else ∅) = indicator t (fun _ => μ s) x := by split_ifs with h <;> simp [h] - open scoped Classical in /-- The product of two vector measures `μ` and `ν` with respect to a continuous bilinear map `B`, giving mass `B (μ s) (ν s)` to a measurable set `s`. @@ -35,7 +33,7 @@ If such a measure does not exist, we use the junk value `0`. -/ noncomputable def prod (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) : VectorMeasure (X × Y) G := if h : ∃ ρ : VectorMeasure (X × Y) G, ∀ (s : Set X) (t : Set Y), - MeasurableSet s →MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t) then h.choose + MeasurableSet s → MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t) then h.choose else 0 /-- Two vector measures `μ` and `ν` have a product with respect to `B` if there exists a @@ -79,7 +77,7 @@ theorem stronglyMeasurable_vectorMeasure_prodMk_left {s : Set (X × Y)} | basic s hs => obtain ⟨s, hs, t, -, rfl⟩ := hs classical - simpa [mk_preimage_prod_right_eq_if, vectorMeasure_if] using + simpa [mk_preimage_prod_right_eq_if, of_if] using stronglyMeasurable_const.indicator hs | compl s hs ihs => simp_rw [preimage_compl, VectorMeasure.of_compl (measurable_prodMk_left hs)] @@ -136,7 +134,7 @@ instance [CompleteSpace G] [IsFiniteMeasure (μ.transpose B.flip).variation] : H classical refine ⟨prodOfIsFiniteMeasureLeft μ ν B, fun s t hs ht ↦ ?_⟩ simp only [prodOfIsFiniteMeasureLeft, hs.prod ht, ↓reduceIte, mk_preimage_prod_right_eq_if, - vectorMeasure_if, integral_indicator hs, setIntegral_const, ContinuousLinearMap.flip_apply] + of_if, integral_indicator hs, setIntegral_const, ContinuousLinearMap.flip_apply] instance [CompleteSpace G] [h : IsFiniteMeasure (ν.transpose B).variation] : HasProd μ ν B := by rw [← B.flip_flip] at h ⊢ From 1d31c66d076bf631cb4a57080b9a2dc0b15d4c6d Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 12 Jun 2026 14:43:10 +0200 Subject: [PATCH 114/129] start refactoring --- Mathlib.lean | 1 + .../Integral/FinMeasAdditive.lean | 12 ++ Mathlib/MeasureTheory/Integral/Prod.lean | 13 +- Mathlib/MeasureTheory/Integral/SetToL1.lean | 6 + .../MeasureTheory/Integral/SetToL1Prod.lean | 138 ++++++++++++++++++ Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 122 +++++++++++++++- 6 files changed, 282 insertions(+), 10 deletions(-) create mode 100644 Mathlib/MeasureTheory/Integral/SetToL1Prod.lean diff --git a/Mathlib.lean b/Mathlib.lean index 9b55585e3b6d0f..8cde8f87421aee 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5505,6 +5505,7 @@ public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.NNReal public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real public import Mathlib.MeasureTheory.Integral.SetToL1 +public import Mathlib.MeasureTheory.Integral.SetToL1Prod public import Mathlib.MeasureTheory.Integral.TorusIntegral public import Mathlib.MeasureTheory.MeasurableSpace.Basic public import Mathlib.MeasureTheory.MeasurableSpace.Card diff --git a/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean b/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean index e166b5c4873a81..d175c45f6c8f39 100644 --- a/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean +++ b/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean @@ -323,6 +323,18 @@ theorem setToSimpleFunc_eq_sum_filter [DecidablePred fun x ↦ x ≠ (0 : F)] rw [hx0] exact map_zero _ +/-- The `setToSimpleFunc` is equal to a sum over any set that includes `f.range` (except `0`). -/ +theorem setToSimpleFunc_eq_sum_of_subset [DecidablePred fun x : F => x ≠ 0] + (T : Set α → F →L[ℝ] F') (hT : T ∅ = 0) {f : α →ₛ F} {s : Finset F} + (hs : {x ∈ f.range | x ≠ 0} ⊆ s) : + setToSimpleFunc T f = ∑ x ∈ s, T (f ⁻¹' {x}) x := by + rw [setToSimpleFunc_eq_sum_filter, Finset.sum_subset hs] + rintro x - hx; rw [Finset.mem_filter, not_and_or, Ne, Classical.not_not] at hx + rcases hx.symm with (rfl | hx) + · simp + rw [SimpleFunc.mem_range] at hx + rw [preimage_eq_empty] <;> simp [Set.disjoint_singleton_left, hx, hT] + theorem map_setToSimpleFunc (T : Set α → F →L[ℝ] F') (h_add : FinMeasAdditive μ T) {f : α →ₛ G} (hf : Integrable f μ) {g : G → F} (hg : g 0 = 0) : (f.map g).setToSimpleFunc T = ∑ x ∈ f.range, T (f ⁻¹' {x}) (g x) := by diff --git a/Mathlib/MeasureTheory/Integral/Prod.lean b/Mathlib/MeasureTheory/Integral/Prod.lean index de59485ec6289f..b85a0f3d0d5614 100644 --- a/Mathlib/MeasureTheory/Integral/Prod.lean +++ b/Mathlib/MeasureTheory/Integral/Prod.lean @@ -7,6 +7,7 @@ module public import Mathlib.MeasureTheory.Function.LpSeminorm.Prod public import Mathlib.MeasureTheory.Integral.DominatedConvergence +public import Mathlib.MeasureTheory.Integral.SetToL1Prod public import Mathlib.MeasureTheory.Integral.Bochner.Set public import Mathlib.MeasureTheory.Measure.Prod @@ -60,12 +61,6 @@ functions. We show that if `f` is a binary measurable function, then the functio along one of the variables (using either the Lebesgue or Bochner integral) is measurable. -/ - -theorem measurableSet_integrable [SFinite ν] ⦃f : α → β → E⦄ - (hf : StronglyMeasurable (uncurry f)) : MeasurableSet {x | Integrable (f x) ν} := by - simp_rw [Integrable, hf.of_uncurry_left.aestronglyMeasurable, true_and] - exact measurableSet_lt (Measurable.lintegral_prod_right hf.enorm) measurable_const - section variable [NormedSpace ℝ E] @@ -75,6 +70,12 @@ variable [NormedSpace ℝ E] This version has `f` in curried form. -/ theorem MeasureTheory.StronglyMeasurable.integral_prod_right [SFinite ν] ⦃f : α → β → E⦄ (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x => ∫ y, f x y ∂ν := by + simp only [integral_eq_setToFun] + apply MeasureTheory.StronglyMeasurable.setToFun_prod_right + + +#exit + classical by_cases hE : CompleteSpace E; swap; · simp [integral, hE, stronglyMeasurable_const] borelize E diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 1af06506765fed..2b205d558f46b2 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -844,6 +844,12 @@ theorem setToFun_simpleFunc [CompleteSpace F] (hT : DominatedFinMeasAdditive μ apply (SimpleFunc.setToSimpleFunc_congr T (fun s ↦ hT.eq_zero_of_measure_zero) hT.1 hf _).symm grw [A, Lp.simpleFunc.toSimpleFunc_eq_toFun] +theorem setToFun_simpleFunc_eq_setToSimpleFunc [CompleteSpace F] + (hT : DominatedFinMeasAdditive μ T C) (f : SimpleFunc α E) (hf : Integrable f μ) : + setToFun μ T hT f = f.setToSimpleFunc T := by + rw [setToFun_simpleFunc hT f hf] + rfl + section Order variable {G' G'' : Type*} diff --git a/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean b/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean new file mode 100644 index 00000000000000..0dcf339590c9bd --- /dev/null +++ b/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean @@ -0,0 +1,138 @@ +/- +Copyright (c) 2021 Rémy Degenne. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne +-/ +module + +public import Mathlib.MeasureTheory.Integral.SetToL1 + +/-! +#SetTo1 and products +-/ + +open Function TopologicalSpace Set Filter +open scoped Topology + +namespace MeasureTheory + +variable {X Y E F F' G 𝕜 : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup F'] [NormedSpace ℝ F'] + [NormedAddCommGroup G] {mX : MeasurableSpace X} {μ : Measure X} + {mY : MeasurableSpace Y} {ν : Measure Y} + {T : Set Y → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive ν T C) + +omit [NormedSpace ℝ E] in +theorem measurableSet_integrable [SFinite ν] ⦃f : X → Y → E⦄ + (hf : StronglyMeasurable (uncurry f)) : MeasurableSet {x | Integrable (f x) ν} := by + simp_rw [Integrable, hf.of_uncurry_left.aestronglyMeasurable, true_and] + exact measurableSet_lt (Measurable.lintegral_prod_right hf.enorm) measurable_const + +/- +theorem stronglyMeasurable_prodMk_left (hT : DominatedFinMeasAdditive ν T C) + {s : Set (X × Y)} + (hs : MeasurableSet s) : StronglyMeasurable fun x => T (Prod.mk x ⁻¹' s) := by + induction s, hs + using MeasurableSpace.induction_on_inter generateFrom_prod.symm isPiSystem_prod with + | empty => simp [stronglyMeasurable_const] + | basic s hs => + obtain ⟨s, hs, t, -, rfl⟩ := hs + classical + simp [mk_preimage_prod_right_eq_if] + have : (fun x ↦ T (if x ∈ s then t else ∅)) = fun x ↦ if x ∈ s then T t else T ∅ := by grind + simp_rw [this, hT.1.map_empty_eq_zero] + exact (stronglyMeasurable_const (b := T t)).indicator hs + | compl s hs ihs => + simp_rw [preimage_compl, VectorMeasure.of_compl (measurable_prodMk_left hs)] + exact stronglyMeasurable_const.sub ihs + | iUnion f hfd hfm ihf => + have (a : X) : HasSum (fun i ↦ ν (Prod.mk a ⁻¹' f i)) (ν (Prod.mk a ⁻¹' ⋃ i, f i)) := by + rw [preimage_iUnion] + apply hasSum_of_disjoint_iUnion + exacts [fun i ↦ measurable_prodMk_left (hfm i), hfd.mono fun _ _ ↦ .preimage _] + exact StronglyMeasurable.hasSum ihf this +-/ + +/-- The `setToFun` operation is measurable. This shows that the integrand of (the right-hand-side +of) Fubini's theorem is measurable. This version has `f` in curried form. -/ +theorem StronglyMeasurable.setToFun_prod_right [SFinite ν] + (h'T : ∀ (s : Set (X × Y)), MeasurableSet s → StronglyMeasurable fun x => T (Prod.mk x ⁻¹' s)) + ⦃f : X → Y → E⦄ (hf : StronglyMeasurable (uncurry f)) : + StronglyMeasurable fun x => setToFun ν T hT (f x) := by + classical + by_cases hF : CompleteSpace F; swap; + · simp [setToFun, hF, stronglyMeasurable_const] + borelize E + haveI : SeparableSpace (range (uncurry f) ∪ {0} : Set E) := + hf.separableSpace_range_union_singleton + let s : ℕ → SimpleFunc (X × Y) E := + SimpleFunc.approxOn _ hf.measurable (range (uncurry f) ∪ {0}) 0 (by simp) + let s' : ℕ → X → SimpleFunc Y E := fun n x => (s n).comp (Prod.mk x) measurable_prodMk_left + let f' : ℕ → X → F := fun n => + {x | Integrable (f x) ν}.indicator fun x => (s' n x).setToSimpleFunc T + have hf' n : StronglyMeasurable (f' n) := by + refine StronglyMeasurable.indicator ?_ (measurableSet_integrable hf) + have : ∀ x, ((s' n x).range.filter fun x => x ≠ 0) ⊆ (s n).range := by + intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y + simp_rw [SimpleFunc.mem_range]; rintro ⟨z, rfl⟩; exact ⟨(x, z), rfl⟩ + simp_rw [SimpleFunc.setToSimpleFunc_eq_sum_of_subset T hT.1.map_empty_eq_zero (this _)] + refine Finset.stronglyMeasurable_fun_sum _ fun x _ => ?_ + simp only [s', SimpleFunc.coe_comp, preimage_comp] + apply StronglyMeasurable.apply_continuousLinearMap + apply h'T + exact (s n).measurableSet_fiber x + have h2f' : Tendsto f' atTop (𝓝 fun x : X => setToFun ν T hT (f x)) := by + rw [tendsto_pi_nhds]; intro x + by_cases hfx : Integrable (f x) ν + · have (n : _) : Integrable (s' n x) ν := by + apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable + filter_upwards with y + simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n + simp only [mem_setOf_eq, hfx, indicator_of_mem, this, + ← setToFun_simpleFunc_eq_setToSimpleFunc hT, f'] + refine + tendsto_setToFun_of_dominated_convergence hT (fun y => ‖f x y‖ + ‖f x y‖) + (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_ + · refine fun n => Eventually.of_forall fun y => + SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n + · exact hf.measurable + · simp + · refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_ + · exact hf.measurable.of_uncurry_left + · simp + apply subset_closure + simp [-uncurry_apply_pair] + · simp [f', hfx, setToFun_undef] + exact stronglyMeasurable_of_tendsto _ hf' h2f' + +/-- The `setToFun` operation is measurable. This shows that the integrand of (the right-hand-side +of) Fubini's theorem is measurable. -/ +theorem StronglyMeasurable.setToFun_prod_right' [SFinite ν] + (h'T : ∀ (s : Set (X × Y)), MeasurableSet s → StronglyMeasurable fun x => T (Prod.mk x ⁻¹' s)) + ⦃f : X × Y → E⦄ (hf : StronglyMeasurable f) : + StronglyMeasurable fun x => setToFun ν T hT (fun y ↦ f (x, y)) := by + rw [← uncurry_curry f] at hf + apply hf.setToFun_prod_right hT h'T + +/-- The `setToFun` operation is measurable. This shows that the integrand of (the right-hand-side +of) the symmetric version of Fubini's theorem is measurable. +This version has `f` in curried form. -/ +theorem StronglyMeasurable.setToFun_prod_left [SFinite μ] + {T : Set X → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C) + (h'T : ∀ (s : Set (X × Y)), MeasurableSet s → StronglyMeasurable fun y => T ((·, y) ⁻¹' s)) + ⦃f : X → Y → E⦄ (hf : StronglyMeasurable (uncurry f)) : + StronglyMeasurable fun y => setToFun μ T hT (f · y) := + (hf.comp_measurable measurable_swap).setToFun_prod_right' hT + (fun s hs ↦ h'T (Prod.swap ⁻¹' s) (measurable_swap hs)) + +/-- The `setToFun` operation is measurable. This shows that the integrand of (the right-hand-side +of) the symmetric version of Fubini's theorem is measurable. -/ +theorem StronglyMeasurable.setToFun_prod_left' [SFinite μ] + {T : Set X → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C) + (h'T : ∀ (s : Set (X × Y)), MeasurableSet s → StronglyMeasurable fun y => T ((·, y) ⁻¹' s)) + ⦃f : X × Y → E⦄ (hf : StronglyMeasurable f) : + StronglyMeasurable fun y => setToFun μ T hT (fun x ↦ f (x, y)) := by + rw [← uncurry_curry f] at hf + apply hf.setToFun_prod_left hT h'T + +end MeasureTheory diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index c92d06263a2fe6..9a0228fb57dce4 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -5,6 +5,7 @@ Authors: Sébastien Gouëzel -/ module +public import Mathlib.MeasureTheory.Integral.Prod public import Mathlib.MeasureTheory.VectorMeasure.SetIntegral public import Mathlib.MeasureTheory.VectorMeasure.Variation.Semivariation @@ -17,10 +18,12 @@ public section open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology open scoped ENNReal NNReal Finset -variable {ι X Y E F G : Type*} {mX : MeasurableSpace X} {mY : MeasurableSpace Y} +variable {ι X Y E F G H I : Type*} {mX : MeasurableSpace X} {mY : MeasurableSpace Y} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] + [NormedAddCommGroup H] [NormedSpace ℝ H] + [NormedAddCommGroup I] [NormedSpace ℝ I] {μ : VectorMeasure X E} {ν : VectorMeasure Y F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} {s t : Set X} @@ -77,8 +80,7 @@ theorem stronglyMeasurable_vectorMeasure_prodMk_left {s : Set (X × Y)} | basic s hs => obtain ⟨s, hs, t, -, rfl⟩ := hs classical - simpa [mk_preimage_prod_right_eq_if, of_if] using - stronglyMeasurable_const.indicator hs + simpa [mk_preimage_prod_right_eq_if, of_if] using stronglyMeasurable_const.indicator hs | compl s hs ihs => simp_rw [preimage_compl, VectorMeasure.of_compl (measurable_prodMk_left hs)] exact stronglyMeasurable_const.sub ihs @@ -87,7 +89,7 @@ theorem stronglyMeasurable_vectorMeasure_prodMk_left {s : Set (X × Y)} rw [preimage_iUnion] apply hasSum_of_disjoint_iUnion exacts [fun i ↦ measurable_prodMk_left (hfm i), hfd.mono fun _ _ ↦ .preimage _] - apply StronglyMeasurable.hasSum ihf this + exact StronglyMeasurable.hasSum ihf this open scoped Classical in /-- The product of two vector measures when the first one has finite variation, obtained by @@ -140,4 +142,116 @@ instance [CompleteSpace G] [h : IsFiniteMeasure (ν.transpose B).variation] : Ha rw [← B.flip_flip] at h ⊢ apply HasProd.flip +#where + + +/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) + Fubini's theorem is measurable. + This version has `f` in curried form. -/ +theorem MeasureTheory.StronglyMeasurable.integral_prod_right [SFinite (ν.transpose B).variation] + (B : G →L[ℝ] F →L[ℝ] H) ⦃f : X → Y → G⦄ + (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x => ∫ᵛ y, f x y ∂[B; ν] := by + classical + by_cases hH : CompleteSpace H; swap; + · simp_rw [integral_of_not_completeSpace hH, stronglyMeasurable_const] + borelize H + borelize G + haveI : SeparableSpace (range (uncurry f) ∪ {0} : Set G) := + hf.separableSpace_range_union_singleton + let s : ℕ → SimpleFunc (X × Y) G := + SimpleFunc.approxOn _ hf.measurable (range (uncurry f) ∪ {0}) 0 (by simp) + let s' : ℕ → X → SimpleFunc Y G := fun n x => (s n).comp (Prod.mk x) measurable_prodMk_left + let f' : ℕ → X → G := fun n => {x | ν.Integrable (f x) B}.indicator fun x => (s' n x).integral ν + have hf' n : StronglyMeasurable (f' n) := by + apply StronglyMeasurable.indicator --?_ (measurableSet_integrable hf) + have : ∀ x, ((s' n x).range.filter fun x => x ≠ 0) ⊆ (s n).range := by + intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y + simp_rw [SimpleFunc.mem_range]; rintro ⟨z, rfl⟩; exact ⟨(x, z), rfl⟩ + simp only [SimpleFunc.integral_eq_sum_of_subset (this _)] + refine Finset.stronglyMeasurable_fun_sum _ fun x _ => ?_ + refine (Measurable.ennreal_toReal ?_).stronglyMeasurable.smul_const _ + simp only [s', SimpleFunc.coe_comp, preimage_comp] + apply measurable_measure_prodMk_left + exact (s n).measurableSet_fiber x + have h2f' : Tendsto f' atTop (𝓝 fun x : α => ∫ y : β, f x y ∂ν) := by + rw [tendsto_pi_nhds]; intro x + by_cases hfx : Integrable (f x) ν + · have (n : _) : Integrable (s' n x) ν := by + apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable + filter_upwards with y + simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n + simp only [f', hfx, SimpleFunc.integral_eq_integral _ (this _), indicator_of_mem, + mem_setOf_eq] + refine + tendsto_integral_of_dominated_convergence (fun y => ‖f x y‖ + ‖f x y‖) + (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_ + · refine fun n => Eventually.of_forall fun y => + SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n + · exact hf.measurable + · simp + · refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_ + · exact hf.measurable.of_uncurry_left + · simp + apply subset_closure + simp [-uncurry_apply_pair] + · simp [f', hfx, integral_undef] + exact stronglyMeasurable_of_tendsto _ hf' h2f' + +/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) + Fubini's theorem is measurable. -/ +theorem MeasureTheory.StronglyMeasurable.integral_prod_right' [SFinite ν] ⦃f : α × β → E⦄ + (hf : StronglyMeasurable f) : StronglyMeasurable fun x => ∫ y, f (x, y) ∂ν := by + rw [← uncurry_curry f] at hf; exact hf.integral_prod_right + +/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) + the symmetric version of Fubini's theorem is measurable. + This version has `f` in curried form. -/ +theorem MeasureTheory.StronglyMeasurable.integral_prod_left [SFinite μ] ⦃f : α → β → E⦄ + (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun y => ∫ x, f x y ∂μ := + (hf.comp_measurable measurable_swap).integral_prod_right' + +/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) + the symmetric version of Fubini's theorem is measurable. -/ +theorem MeasureTheory.StronglyMeasurable.integral_prod_left' [SFinite μ] ⦃f : α × β → E⦄ + (hf : StronglyMeasurable f) : StronglyMeasurable fun y => ∫ x, f (x, y) ∂μ := + (hf.comp_measurable measurable_swap).integral_prod_right' + + +theorem Integrable.integral_prod_left (B : G →L[ℝ] F →L[ℝ] H) + [IsFiniteMeasure (ν.transpose B).variation] + {μ : Measure X} ⦃f : X × Y → G⦄ (hf : Integrable f (μ.prod (ν.transpose B).variation)) : + Integrable (fun x => ∫ᵛ y, f (x, y) ∂[B; ν]) μ := by + apply Integrable.mono hf.integral_norm_prod_left + + +#exit + + Integrable.mono hf.integral_norm_prod_left hf.aestronglyMeasurable.integral_prod_right' <| + Eventually.of_forall fun x => + (norm_integral_le_integral_norm _).trans_eq <| + (norm_of_nonneg <| + integral_nonneg_of_ae <| + Eventually.of_forall fun y => (norm_nonneg (f (x, y)) :)).symm + + +/-- The map that sends an L¹-function `f : α × β → E` to `∫∫f` is continuous. -/ +theorem continuous_integral_integral (B : G →L[ℝ] F →L[ℝ] H) (C : H →L[ℝ] E →L[ℝ] I) : + Continuous fun f : X × Y →₁[μ.variation.prod ν.variation] G => + ∫ᵛ x, (∫ᵛ y, f (x, y) ∂[B; ν]) ∂[C; μ] := by + rw [continuous_iff_continuousAt]; intro g + apply tendsto_integral_of_L1 + refine + tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_prod_left.aestronglyMeasurable + (Eventually.of_forall fun h => (L1.integrable_coeFn h).integral_prod_left) ?_ + simp_rw [← lintegral_fn_integral_sub _ (L1.integrable_coeFn _) (L1.integrable_coeFn g)] + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds _ (fun i => zero_le) _ + · exact fun i => ∫⁻ x, ∫⁻ y, ‖i (x, y) - g (x, y)‖ₑ ∂ν ∂μ + swap; · exact fun i => lintegral_mono fun x => enorm_integral_le_lintegral_enorm _ + have this (i : α × β →₁[μ.prod ν] E) : Measurable fun z => ‖i z - g z‖ₑ := + ((Lp.stronglyMeasurable i).sub (Lp.stronglyMeasurable g)).enorm + simp_rw [← lintegral_prod _ (this _).aemeasurable, ← L1.ofReal_norm_sub_eq_lintegral, + ← ofReal_zero] + refine (continuous_ofReal.tendsto 0).comp ?_ + rw [← tendsto_iff_norm_sub_tendsto_zero]; exact tendsto_id + end MeasureTheory.VectorMeasure From 115026ea6a756cbd8989b6217ebe867bea8d9fb8 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 12 Jun 2026 16:59:27 +0200 Subject: [PATCH 115/129] better --- Mathlib/MeasureTheory/Integral/Prod.lean | 64 +------- .../MeasureTheory/Integral/SetToL1Prod.lean | 8 +- Mathlib/MeasureTheory/Measure/Prod.lean | 11 +- .../MeasureTheory/Measure/WithDensity.lean | 14 +- .../MeasureTheory/VectorMeasure/Integral.lean | 13 ++ Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 141 +++++++----------- 6 files changed, 99 insertions(+), 152 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/Prod.lean b/Mathlib/MeasureTheory/Integral/Prod.lean index b85a0f3d0d5614..1417cfcf2dc3ce 100644 --- a/Mathlib/MeasureTheory/Integral/Prod.lean +++ b/Mathlib/MeasureTheory/Integral/Prod.lean @@ -38,7 +38,6 @@ product measure, Fubini's theorem, Fubini-Tonelli theorem public section - noncomputable section open scoped Topology ENNReal MeasureTheory @@ -71,54 +70,9 @@ variable [NormedSpace ℝ E] theorem MeasureTheory.StronglyMeasurable.integral_prod_right [SFinite ν] ⦃f : α → β → E⦄ (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x => ∫ y, f x y ∂ν := by simp only [integral_eq_setToFun] - apply MeasureTheory.StronglyMeasurable.setToFun_prod_right - - -#exit - - classical - by_cases hE : CompleteSpace E; swap; · simp [integral, hE, stronglyMeasurable_const] - borelize E - haveI : SeparableSpace (range (uncurry f) ∪ {0} : Set E) := - hf.separableSpace_range_union_singleton - let s : ℕ → SimpleFunc (α × β) E := - SimpleFunc.approxOn _ hf.measurable (range (uncurry f) ∪ {0}) 0 (by simp) - let s' : ℕ → α → SimpleFunc β E := fun n x => (s n).comp (Prod.mk x) measurable_prodMk_left - let f' : ℕ → α → E := fun n => {x | Integrable (f x) ν}.indicator fun x => (s' n x).integral ν - have hf' : ∀ n, StronglyMeasurable (f' n) := by - intro n; refine StronglyMeasurable.indicator ?_ (measurableSet_integrable hf) - have : ∀ x, ((s' n x).range.filter fun x => x ≠ 0) ⊆ (s n).range := by - intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y - simp_rw [SimpleFunc.mem_range]; rintro ⟨z, rfl⟩; exact ⟨(x, z), rfl⟩ - simp only [SimpleFunc.integral_eq_sum_of_subset (this _)] - refine Finset.stronglyMeasurable_fun_sum _ fun x _ => ?_ - refine (Measurable.ennreal_toReal ?_).stronglyMeasurable.smul_const _ - simp only [s', SimpleFunc.coe_comp, preimage_comp] - apply measurable_measure_prodMk_left - exact (s n).measurableSet_fiber x - have h2f' : Tendsto f' atTop (𝓝 fun x : α => ∫ y : β, f x y ∂ν) := by - rw [tendsto_pi_nhds]; intro x - by_cases hfx : Integrable (f x) ν - · have (n : _) : Integrable (s' n x) ν := by - apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable - filter_upwards with y - simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n - simp only [f', hfx, SimpleFunc.integral_eq_integral _ (this _), indicator_of_mem, - mem_setOf_eq] - refine - tendsto_integral_of_dominated_convergence (fun y => ‖f x y‖ + ‖f x y‖) - (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_ - · refine fun n => Eventually.of_forall fun y => - SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n - · exact hf.measurable - · simp - · refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_ - · exact hf.measurable.of_uncurry_left - · simp - apply subset_closure - simp [-uncurry_apply_pair] - · simp [f', hfx, integral_undef] - exact stronglyMeasurable_of_tendsto _ hf' h2f' + apply StronglyMeasurable.setToFun_prod_right _ (fun s hs ↦ ?_) hf + refine (Measurable.ennreal_toReal ?_).stronglyMeasurable.smul_const _ + exact measurable_measure_prodMk_left hs /-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is measurable. -/ @@ -381,13 +335,11 @@ end variable [NormedSpace ℝ E] theorem Integrable.integral_prod_left ⦃f : α × β → E⦄ (hf : Integrable f (μ.prod ν)) : - Integrable (fun x => ∫ y, f (x, y) ∂ν) μ := - Integrable.mono hf.integral_norm_prod_left hf.aestronglyMeasurable.integral_prod_right' <| - Eventually.of_forall fun x => - (norm_integral_le_integral_norm _).trans_eq <| - (norm_of_nonneg <| - integral_nonneg_of_ae <| - Eventually.of_forall fun y => (norm_nonneg (f (x, y)) :)).symm + Integrable (fun x => ∫ y, f (x, y) ∂ν) μ := by + apply Integrable.mono hf.integral_norm_prod_left hf.aestronglyMeasurable.integral_prod_right' + filter_upwards with x + grw [norm_integral_le_integral_norm] + exact le_abs_self _ theorem Integrable.integral_prod_right [SFinite μ] ⦃f : α × β → E⦄ (hf : Integrable f (μ.prod ν)) : Integrable (fun y => ∫ x, f (x, y) ∂μ) ν := diff --git a/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean b/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean index 0dcf339590c9bd..c5e66213623c0c 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean @@ -1,16 +1,18 @@ /- -Copyright (c) 2021 Rémy Degenne. All rights reserved. +Copyright (c) 2026 Sébastien Gouëzel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Zhouhang Zhou, Yury Kudryashov, Sébastien Gouëzel, Rémy Degenne +Authors: Sébastien Gouëzel -/ module public import Mathlib.MeasureTheory.Integral.SetToL1 /-! -#SetTo1 and products +# SetToL1 and products -/ +public section + open Function TopologicalSpace Set Filter open scoped Topology diff --git a/Mathlib/MeasureTheory/Measure/Prod.lean b/Mathlib/MeasureTheory/Measure/Prod.lean index e9f92b71955eb6..1dbfadd2cc5f2b 100644 --- a/Mathlib/MeasureTheory/Measure/Prod.lean +++ b/Mathlib/MeasureTheory/Measure/Prod.lean @@ -419,6 +419,14 @@ theorem AbsolutelyContinuous.prod [SFinite ν'] (h1 : μ ≪ μ') (h2 : ν ≪ rw [measure_prod_null hs] at h2s exact (h2s.filter_mono h1.ae_le).mono fun _ h => h2 h +omit [SFinite ν] in +@[gcongr] theorem prod_mono [SFinite ν'] (h1 : μ ≤ μ') (h2 : ν ≤ ν') : μ.prod ν ≤ μ'.prod ν' := by + apply Measure.le_iff.2 (fun s hs ↦ ?_) + calc μ.prod ν s + _ ≤ ∫⁻ x, ν (Prod.mk x ⁻¹' s) ∂μ := prod_apply_le hs + _ ≤ ∫⁻ x, ν' (Prod.mk x ⁻¹' s) ∂μ' := by gcongr + _ = (μ'.prod ν') s := (prod_apply hs).symm + /-- Note: the converse is not true. For a counterexample, see Walter Rudin *Real and Complex Analysis*, example (c) in section 8.9. It is true if the set is measurable, see `ae_prod_mem_iff_ae_ae_mem`. -/ @@ -835,7 +843,8 @@ theorem map_prod_map {δ} [MeasurableSpace δ] {f : α → β} {g : γ → δ} ( -- `prod_smul_right` needs an instance to get `SFinite (c • ν)` from `SFinite ν`, -- hence it is placed in the `WithDensity` file, where the instance is defined. -lemma prod_smul_left {μ : Measure α} (c : ℝ≥0∞) : (c • μ).prod ν = c • (μ.prod ν) := by +lemma prod_smul_left {μ : Measure α} {R : Type*} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] + (c : R) : (c • μ).prod ν = c • (μ.prod ν) := by ext s hs rw [prod_apply hs, Measure.smul_apply, prod_apply hs] simp diff --git a/Mathlib/MeasureTheory/Measure/WithDensity.lean b/Mathlib/MeasureTheory/Measure/WithDensity.lean index 404bcf0aa490ea..243df99a8a2eec 100644 --- a/Mathlib/MeasureTheory/Measure/WithDensity.lean +++ b/Mathlib/MeasureTheory/Measure/WithDensity.lean @@ -660,8 +660,10 @@ instance Measure.withDensity.instSFinite [SFinite μ] {f : α → ℝ≥0∞} : rw [key] infer_instance -instance [SFinite μ] (c : ℝ≥0∞) : SFinite (c • μ) := by - rw [← withDensity_const] +instance [SFinite μ] {R : Type*} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] (c : R) : + SFinite (c • μ) := by + have : c • μ = c • ((1 : ℝ≥0∞) • μ) := by simp + rw [this, ← smul_assoc, ← withDensity_const] infer_instance /-- If `μ ≪ ν` and `ν` is s-finite, then `μ` is s-finite. -/ @@ -724,10 +726,12 @@ theorem prod_withDensity {f : α → ℝ≥0∞} {g : β → ℝ≥0∞} (hf : M -- `prod_smul_left` is in the `Prod` file. This lemma is here because this is the file in which -- we prove the instance that gives `SFinite (c • ν)`. -lemma Measure.prod_smul_right (c : ℝ≥0∞) : μ.prod (c • ν) = c • (μ.prod ν) := by +lemma Measure.prod_smul_right {R : Type*} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] (c : R) : + μ.prod (c • ν) = c • (μ.prod ν) := by ext s hs - simp_rw [Measure.prod_apply hs, Measure.smul_apply, Measure.prod_apply hs, smul_eq_mul] - rw [lintegral_const_mul] + have A (s : Set β) : c • ν s = (c • 1) * ν s := by simp + simp_rw [Measure.prod_apply hs, Measure.smul_apply, Measure.prod_apply hs, A] + rw [lintegral_const_mul, smul_one_mul] exact measurable_measure_prodMk_left hs end Prod diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index c0e94e00f2e5c5..957f8c03f1edc0 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -614,6 +614,19 @@ theorem norm_integral_le_lintegral_norm : ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation) := (norm_setToFun_le_toReal _ (by simp)).trans (by simp) +theorem norm_integral_le_integral_norm : + ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ∫ a, ‖f a‖ ∂(μ.transpose B).variation := by + have le_ae : ∀ᵐ a ∂(μ.transpose B).variation, 0 ≤ ‖f a‖ := + Eventually.of_forall fun a => norm_nonneg _ + by_cases h : AEStronglyMeasurable f (μ.transpose B).variation + · calc ‖∫ᵛ a, f a ∂[B; μ]‖ + _ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation) := + norm_integral_le_lintegral_norm + _ = ∫ a, ‖f a‖ ∂(μ.transpose B).variation := + (integral_eq_lintegral_of_nonneg_ae le_ae <| h.norm).symm + · rw [integral_non_aestronglyMeasurable h, norm_zero] + exact integral_nonneg_of_ae le_ae + theorem enorm_integral_le_lintegral_enorm : ‖∫ᵛ a, f a ∂[B; μ]‖ₑ ≤ ∫⁻ a, ‖f a‖ₑ ∂(μ.transpose B).variation := (enorm_setToFun_le _ (by simp)).trans (by simp) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 9a0228fb57dce4..23c4635b08312d 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -142,104 +142,71 @@ instance [CompleteSpace G] [h : IsFiniteMeasure (ν.transpose B).variation] : Ha rw [← B.flip_flip] at h ⊢ apply HasProd.flip -#where - - -/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) - Fubini's theorem is measurable. - This version has `f` in curried form. -/ -theorem MeasureTheory.StronglyMeasurable.integral_prod_right [SFinite (ν.transpose B).variation] - (B : G →L[ℝ] F →L[ℝ] H) ⦃f : X → Y → G⦄ +/-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side +of) Fubini's theorem is measurable. This version has `f` in curried form. -/ +theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_right + {B : G →L[ℝ] F →L[ℝ] H} [SFinite (ν.transpose B).variation] ⦃f : X → Y → G⦄ (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x => ∫ᵛ y, f x y ∂[B; ν] := by - classical - by_cases hH : CompleteSpace H; swap; - · simp_rw [integral_of_not_completeSpace hH, stronglyMeasurable_const] - borelize H - borelize G - haveI : SeparableSpace (range (uncurry f) ∪ {0} : Set G) := - hf.separableSpace_range_union_singleton - let s : ℕ → SimpleFunc (X × Y) G := - SimpleFunc.approxOn _ hf.measurable (range (uncurry f) ∪ {0}) 0 (by simp) - let s' : ℕ → X → SimpleFunc Y G := fun n x => (s n).comp (Prod.mk x) measurable_prodMk_left - let f' : ℕ → X → G := fun n => {x | ν.Integrable (f x) B}.indicator fun x => (s' n x).integral ν - have hf' n : StronglyMeasurable (f' n) := by - apply StronglyMeasurable.indicator --?_ (measurableSet_integrable hf) - have : ∀ x, ((s' n x).range.filter fun x => x ≠ 0) ⊆ (s n).range := by - intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y - simp_rw [SimpleFunc.mem_range]; rintro ⟨z, rfl⟩; exact ⟨(x, z), rfl⟩ - simp only [SimpleFunc.integral_eq_sum_of_subset (this _)] - refine Finset.stronglyMeasurable_fun_sum _ fun x _ => ?_ - refine (Measurable.ennreal_toReal ?_).stronglyMeasurable.smul_const _ - simp only [s', SimpleFunc.coe_comp, preimage_comp] - apply measurable_measure_prodMk_left - exact (s n).measurableSet_fiber x - have h2f' : Tendsto f' atTop (𝓝 fun x : α => ∫ y : β, f x y ∂ν) := by - rw [tendsto_pi_nhds]; intro x - by_cases hfx : Integrable (f x) ν - · have (n : _) : Integrable (s' n x) ν := by - apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable - filter_upwards with y - simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n - simp only [f', hfx, SimpleFunc.integral_eq_integral _ (this _), indicator_of_mem, - mem_setOf_eq] - refine - tendsto_integral_of_dominated_convergence (fun y => ‖f x y‖ + ‖f x y‖) - (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_ - · refine fun n => Eventually.of_forall fun y => - SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n - · exact hf.measurable - · simp - · refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_ - · exact hf.measurable.of_uncurry_left - · simp - apply subset_closure - simp [-uncurry_apply_pair] - · simp [f', hfx, integral_undef] - exact stronglyMeasurable_of_tendsto _ hf' h2f' - -/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) - Fubini's theorem is measurable. -/ -theorem MeasureTheory.StronglyMeasurable.integral_prod_right' [SFinite ν] ⦃f : α × β → E⦄ - (hf : StronglyMeasurable f) : StronglyMeasurable fun x => ∫ y, f (x, y) ∂ν := by - rw [← uncurry_curry f] at hf; exact hf.integral_prod_right - -/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) - the symmetric version of Fubini's theorem is measurable. - This version has `f` in curried form. -/ -theorem MeasureTheory.StronglyMeasurable.integral_prod_left [SFinite μ] ⦃f : α → β → E⦄ - (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun y => ∫ x, f x y ∂μ := - (hf.comp_measurable measurable_swap).integral_prod_right' - -/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) - the symmetric version of Fubini's theorem is measurable. -/ -theorem MeasureTheory.StronglyMeasurable.integral_prod_left' [SFinite μ] ⦃f : α × β → E⦄ - (hf : StronglyMeasurable f) : StronglyMeasurable fun y => ∫ x, f (x, y) ∂μ := - (hf.comp_measurable measurable_swap).integral_prod_right' - - -theorem Integrable.integral_prod_left (B : G →L[ℝ] F →L[ℝ] H) + simp only [integral_eq_setToFun] + apply StronglyMeasurable.setToFun_prod_right _ (fun s hs ↦ ?_) hf + exact stronglyMeasurable_vectorMeasure_prodMk_left hs + +/-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side +of) Fubini's theorem is measurable. -/ +theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_right' + {B : G →L[ℝ] F →L[ℝ] H} [SFinite (ν.transpose B).variation] ⦃f : X × Y → G⦄ + (hf : StronglyMeasurable f) : StronglyMeasurable fun x => ∫ᵛ y, f (x, y) ∂[B; ν] := by + rw [← uncurry_curry f] at hf; exact hf.integral_vectorMeasure_prod_right + +/-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side +of) the symmetric version of Fubini's theorem is measurable. +This version has `f` in curried form. -/ +theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_left + {B : G →L[ℝ] E →L[ℝ] H} [SFinite (μ.transpose B).variation] ⦃f : X → Y → G⦄ + (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun y => ∫ᵛ x, f x y ∂[B; μ] := + (hf.comp_measurable measurable_swap).integral_vectorMeasure_prod_right' + +/-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side +of) the symmetric version of Fubini's theorem is measurable. -/ +theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_left' + {B : G →L[ℝ] E →L[ℝ] H} [SFinite (μ.transpose B).variation] ⦃f : X × Y → G⦄ + (hf : StronglyMeasurable f) : StronglyMeasurable fun y => ∫ᵛ x, f (x, y) ∂[B; μ] := + (hf.comp_measurable measurable_swap).integral_vectorMeasure_prod_right' + +/-- The vector measure integral is a.e.-measurable. +This shows that the integrand of (the right-hand-side of) Fubini's theorem is a.e.-measurable. -/ +theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_vectorMeasure_prod_right' + {B : G →L[ℝ] F →L[ℝ] H} [SFinite (ν.transpose B).variation] {μ : Measure X} + ⦃f : X × Y → G⦄ (hf : AEStronglyMeasurable f (μ.prod (ν.transpose B).variation)) : + AEStronglyMeasurable (fun x => ∫ᵛ y, f (x, y) ∂[B; ν]) μ := + ⟨fun x => ∫ᵛ y, hf.mk f (x, y) ∂[B; ν], + hf.stronglyMeasurable_mk.integral_vectorMeasure_prod_right', + by filter_upwards [Measure.ae_ae_of_ae_prod hf.ae_eq_mk] with _ hx using integral_congr_ae hx⟩ + +theorem Integrable.integral_prod_left {B : G →L[ℝ] F →L[ℝ] H} [IsFiniteMeasure (ν.transpose B).variation] {μ : Measure X} ⦃f : X × Y → G⦄ (hf : Integrable f (μ.prod (ν.transpose B).variation)) : Integrable (fun x => ∫ᵛ y, f (x, y) ∂[B; ν]) μ := by apply Integrable.mono hf.integral_norm_prod_left - - -#exit - - Integrable.mono hf.integral_norm_prod_left hf.aestronglyMeasurable.integral_prod_right' <| - Eventually.of_forall fun x => - (norm_integral_le_integral_norm _).trans_eq <| - (norm_of_nonneg <| - integral_nonneg_of_ae <| - Eventually.of_forall fun y => (norm_nonneg (f (x, y)) :)).symm - + (hf.aestronglyMeasurable.integral_vectorMeasure_prod_right') + filter_upwards with x + grw [norm_integral_le_integral_norm] + exact le_abs_self _ /-- The map that sends an L¹-function `f : α × β → E` to `∫∫f` is continuous. -/ -theorem continuous_integral_integral (B : G →L[ℝ] F →L[ℝ] H) (C : H →L[ℝ] E →L[ℝ] I) : +theorem continuous_integral_integral (B : G →L[ℝ] F →L[ℝ] H) (C : H →L[ℝ] E →L[ℝ] I) + [IsFiniteMeasure (ν.transpose B).variation] : Continuous fun f : X × Y →₁[μ.variation.prod ν.variation] G => ∫ᵛ x, (∫ᵛ y, f (x, y) ∂[B; ν]) ∂[C; μ] := by rw [continuous_iff_continuousAt]; intro g apply tendsto_integral_of_L1 + · apply (Integrable.integral_prod_left _).aestronglyMeasurable + apply (L1.integrable_coeFn g).of_measure_le_smul (c := ‖C‖₊ * ‖B‖₊) + (by simp [ENNReal.mul_eq_top]) + grw [variation_transpose_le, variation_transpose_le, ENNReal.smul_def, ENNReal.smul_def] + simp + + refine tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_prod_left.aestronglyMeasurable (Eventually.of_forall fun h => (L1.integrable_coeFn h).integral_prod_left) ?_ From 1f92db8929b2798e08a77e3867bec2b864293e63 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Fri, 12 Jun 2026 17:47:52 +0200 Subject: [PATCH 116/129] more --- Mathlib/Analysis/Normed/Group/Continuity.lean | 5 ++ Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 64 ++++++++++--------- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/Mathlib/Analysis/Normed/Group/Continuity.lean b/Mathlib/Analysis/Normed/Group/Continuity.lean index bce9c2ecb79818..e4e9048e9eaae7 100644 --- a/Mathlib/Analysis/Normed/Group/Continuity.lean +++ b/Mathlib/Analysis/Normed/Group/Continuity.lean @@ -313,6 +313,11 @@ theorem tendsto_iff_norm_div_tendsto_zero {f : α → E} {a : Filter α} {b : E} Tendsto f a (𝓝 b) ↔ Tendsto (fun e => ‖f e / b‖) a (𝓝 0) := by simp only [← dist_eq_norm_div, ← tendsto_iff_dist_tendsto_zero] +@[to_additive] +theorem tendsto_iff_enorm_div_tendsto_zero {f : α → E} {a : Filter α} {b : E} : + Tendsto f a (𝓝 b) ↔ Tendsto (fun e => ‖f e / b‖ₑ) a (𝓝 0) := by + simp only [← edist_eq_enorm_div, ← tendsto_iff_edist_tendsto_0] + @[to_additive] theorem SeminormedCommGroup.mem_closure_iff {s : Set E} : a ∈ closure s ↔ ∀ ε, 0 < ε → ∃ b ∈ s, ‖a / b‖ < ε := by diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 23c4635b08312d..8f52c5a0f29289 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -73,7 +73,7 @@ omit [NormedSpace ℝ F] in /-- If `ν` is a vector measure, and `s ⊆ X × Y` is measurable, then `x ↦ ν { y | (x, y) ∈ s }` is a strongly measurable function. -/ theorem stronglyMeasurable_vectorMeasure_prodMk_left {s : Set (X × Y)} - (hs : MeasurableSet s) : StronglyMeasurable fun x => ν (Prod.mk x ⁻¹' s) := by + (hs : MeasurableSet s) : StronglyMeasurable fun x ↦ ν (Prod.mk x ⁻¹' s) := by induction s, hs using MeasurableSpace.induction_on_inter generateFrom_prod.symm isPiSystem_prod with | empty => simp [stronglyMeasurable_const] @@ -146,7 +146,7 @@ instance [CompleteSpace G] [h : IsFiniteMeasure (ν.transpose B).variation] : Ha of) Fubini's theorem is measurable. This version has `f` in curried form. -/ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_right {B : G →L[ℝ] F →L[ℝ] H} [SFinite (ν.transpose B).variation] ⦃f : X → Y → G⦄ - (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x => ∫ᵛ y, f x y ∂[B; ν] := by + (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x ↦ ∫ᵛ y, f x y ∂[B; ν] := by simp only [integral_eq_setToFun] apply StronglyMeasurable.setToFun_prod_right _ (fun s hs ↦ ?_) hf exact stronglyMeasurable_vectorMeasure_prodMk_left hs @@ -155,7 +155,7 @@ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_righ of) Fubini's theorem is measurable. -/ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_right' {B : G →L[ℝ] F →L[ℝ] H} [SFinite (ν.transpose B).variation] ⦃f : X × Y → G⦄ - (hf : StronglyMeasurable f) : StronglyMeasurable fun x => ∫ᵛ y, f (x, y) ∂[B; ν] := by + (hf : StronglyMeasurable f) : StronglyMeasurable fun x ↦ ∫ᵛ y, f (x, y) ∂[B; ν] := by rw [← uncurry_curry f] at hf; exact hf.integral_vectorMeasure_prod_right /-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side @@ -163,14 +163,14 @@ of) the symmetric version of Fubini's theorem is measurable. This version has `f` in curried form. -/ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_left {B : G →L[ℝ] E →L[ℝ] H} [SFinite (μ.transpose B).variation] ⦃f : X → Y → G⦄ - (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun y => ∫ᵛ x, f x y ∂[B; μ] := + (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun y ↦ ∫ᵛ x, f x y ∂[B; μ] := (hf.comp_measurable measurable_swap).integral_vectorMeasure_prod_right' /-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side of) the symmetric version of Fubini's theorem is measurable. -/ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_left' {B : G →L[ℝ] E →L[ℝ] H} [SFinite (μ.transpose B).variation] ⦃f : X × Y → G⦄ - (hf : StronglyMeasurable f) : StronglyMeasurable fun y => ∫ᵛ x, f (x, y) ∂[B; μ] := + (hf : StronglyMeasurable f) : StronglyMeasurable fun y ↦ ∫ᵛ x, f (x, y) ∂[B; μ] := (hf.comp_measurable measurable_swap).integral_vectorMeasure_prod_right' /-- The vector measure integral is a.e.-measurable. @@ -178,47 +178,53 @@ This shows that the integrand of (the right-hand-side of) Fubini's theorem is a. theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_vectorMeasure_prod_right' {B : G →L[ℝ] F →L[ℝ] H} [SFinite (ν.transpose B).variation] {μ : Measure X} ⦃f : X × Y → G⦄ (hf : AEStronglyMeasurable f (μ.prod (ν.transpose B).variation)) : - AEStronglyMeasurable (fun x => ∫ᵛ y, f (x, y) ∂[B; ν]) μ := - ⟨fun x => ∫ᵛ y, hf.mk f (x, y) ∂[B; ν], + AEStronglyMeasurable (fun x ↦ ∫ᵛ y, f (x, y) ∂[B; ν]) μ := + ⟨fun x ↦ ∫ᵛ y, hf.mk f (x, y) ∂[B; ν], hf.stronglyMeasurable_mk.integral_vectorMeasure_prod_right', by filter_upwards [Measure.ae_ae_of_ae_prod hf.ae_eq_mk] with _ hx using integral_congr_ae hx⟩ theorem Integrable.integral_prod_left {B : G →L[ℝ] F →L[ℝ] H} - [IsFiniteMeasure (ν.transpose B).variation] + [SFinite (ν.transpose B).variation] {μ : Measure X} ⦃f : X × Y → G⦄ (hf : Integrable f (μ.prod (ν.transpose B).variation)) : - Integrable (fun x => ∫ᵛ y, f (x, y) ∂[B; ν]) μ := by + Integrable (fun x ↦ ∫ᵛ y, f (x, y) ∂[B; ν]) μ := by apply Integrable.mono hf.integral_norm_prod_left (hf.aestronglyMeasurable.integral_vectorMeasure_prod_right') filter_upwards with x grw [norm_integral_le_integral_norm] exact le_abs_self _ +/-- Vector measure integrals commute with subtraction inside a lower Lebesgue integral. -/ +theorem lintegral_fn_integral_sub ⦃f g : X × Y → G⦄ {μ : Measure X} + {B : G →L[ℝ] F →L[ℝ] H} [SFinite μ] [SFinite (ν.transpose B).variation] + (φ : H → ℝ≥0∞) (hf : Integrable f (μ.prod (ν.transpose B).variation)) + (hg : Integrable g (μ.prod (ν.transpose B).variation)) : + (∫⁻ x, φ (∫ᵛ y, f (x, y) - g (x, y) ∂[B; ν]) ∂μ) = + ∫⁻ x, φ ((∫ᵛ y, f (x, y) ∂[B; ν]) - ∫ᵛ y, g (x, y) ∂[B; ν]) ∂μ := by + refine lintegral_congr_ae ?_ + filter_upwards [hf.prod_right_ae, hg.prod_right_ae] with x h2f h2g + simp [integral_fun_sub h2f h2g] + /-- The map that sends an L¹-function `f : α × β → E` to `∫∫f` is continuous. -/ -theorem continuous_integral_integral (B : G →L[ℝ] F →L[ℝ] H) (C : H →L[ℝ] E →L[ℝ] I) - [IsFiniteMeasure (ν.transpose B).variation] : - Continuous fun f : X × Y →₁[μ.variation.prod ν.variation] G => +theorem continuous_integral_integral {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ℝ] I} + [SFinite (ν.transpose B).variation] [SFinite (μ.transpose C).variation] : + Continuous fun f : X × Y →₁[(μ.transpose C).variation.prod (ν.transpose B).variation] G ↦ ∫ᵛ x, (∫ᵛ y, f (x, y) ∂[B; ν]) ∂[C; μ] := by rw [continuous_iff_continuousAt]; intro g apply tendsto_integral_of_L1 - · apply (Integrable.integral_prod_left _).aestronglyMeasurable - apply (L1.integrable_coeFn g).of_measure_le_smul (c := ‖C‖₊ * ‖B‖₊) - (by simp [ENNReal.mul_eq_top]) - grw [variation_transpose_le, variation_transpose_le, ENNReal.smul_def, ENNReal.smul_def] - simp - - - refine - tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_prod_left.aestronglyMeasurable - (Eventually.of_forall fun h => (L1.integrable_coeFn h).integral_prod_left) ?_ + · exact (Integrable.integral_prod_left (L1.integrable_coeFn g)).aestronglyMeasurable + · filter_upwards with h + exact Integrable.integral_prod_left (L1.integrable_coeFn h) simp_rw [← lintegral_fn_integral_sub _ (L1.integrable_coeFn _) (L1.integrable_coeFn g)] - apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds _ (fun i => zero_le) _ - · exact fun i => ∫⁻ x, ∫⁻ y, ‖i (x, y) - g (x, y)‖ₑ ∂ν ∂μ - swap; · exact fun i => lintegral_mono fun x => enorm_integral_le_lintegral_enorm _ - have this (i : α × β →₁[μ.prod ν] E) : Measurable fun z => ‖i z - g z‖ₑ := + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds _ (fun i ↦ zero_le) _ + (h := fun i ↦ ∫⁻ x, ∫⁻ y, + ‖i (x, y) - g (x, y)‖ₑ ∂(ν.transpose B).variation ∂(μ.transpose C).variation); swap + · exact fun i ↦ lintegral_mono fun x ↦ enorm_integral_le_lintegral_enorm + have this (i : X × Y →₁[(μ.transpose C).variation.prod (ν.transpose B).variation] G) : + Measurable fun z ↦ ‖i z - g z‖ₑ := ((Lp.stronglyMeasurable i).sub (Lp.stronglyMeasurable g)).enorm simp_rw [← lintegral_prod _ (this _).aemeasurable, ← L1.ofReal_norm_sub_eq_lintegral, - ← ofReal_zero] - refine (continuous_ofReal.tendsto 0).comp ?_ - rw [← tendsto_iff_norm_sub_tendsto_zero]; exact tendsto_id + ofReal_norm] + rw [← tendsto_iff_enorm_sub_tendsto_zero] + exact tendsto_id end MeasureTheory.VectorMeasure From bcdc2447adee4491cba0b3fd4936a34c6dfcde8b Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 13 Jun 2026 10:13:04 +0200 Subject: [PATCH 117/129] better --- Mathlib/Data/NNReal/Defs.lean | 2 + .../MeasureTheory/VectorMeasure/Integral.lean | 373 +++++++++--------- Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 29 +- .../VectorMeasure/SetIntegral.lean | 241 ++++++----- 4 files changed, 368 insertions(+), 277 deletions(-) diff --git a/Mathlib/Data/NNReal/Defs.lean b/Mathlib/Data/NNReal/Defs.lean index 612791983d60ef..41e15f10ecf1e6 100644 --- a/Mathlib/Data/NNReal/Defs.lean +++ b/Mathlib/Data/NNReal/Defs.lean @@ -127,6 +127,8 @@ noncomputable instance : LinearOrderedCommGroupWithZero ℝ≥0 where example {p q : ℝ≥0} (h1p : 0 < p) (h2p : p ≤ q) : q⁻¹ ≤ p⁻¹ := by with_reducible_and_instances exact inv_anti₀ h1p h2p +@[simp] lemma mk_coe (a : ℝ≥0) (ha : 0 ≤ (a : ℝ)) : NNReal.mk (a : ℝ) ha = a := rfl + -- Simp lemma to put back `n.val` into the normal form given by the coercion. @[simp] theorem val_eq_coe (n : ℝ≥0) : n.val = n := diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 957f8c03f1edc0..281b3d377b3886 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -58,7 +58,7 @@ We often consider integrable functions with respect to the total variation of `μ.transpose B` = `μ.mapRange B.flip.toAddMonoidHom B.flip.continuous`, which is the reference measure for the pairing integral. -When `f` is not integrable with respect to `(μ.transpose B).variation`, the value of +When `f` is not integrable with respect to `μ.variation`, the value of `μ.integral B f` is set to `0`. This is an analogous convention to the Bochner integral. However, there are cases where a natural definition of the integral as an unconditional sum exists, but `f` is not integrable in this sense: Let `μ` be the `L∞(ℕ)`-valued measure on `ℕ` defined by extending @@ -73,10 +73,11 @@ public section open Set MeasureTheory VectorMeasure ContinuousLinearMap Filter Topology open scoped ENNReal NNReal -variable {ι X Y E F G : Type*} {mX : MeasurableSpace X} [MeasurableSpace Y] +variable {ι X Y E F G H : Type*} {mX : MeasurableSpace X} [MeasurableSpace Y] [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] + [NormedAddCommGroup H] [NormedSpace ℝ H] namespace MeasureTheory @@ -112,17 +113,19 @@ theorem cbmApplyMeasure_union (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ ext x simp [of_union hdisj hs ht] -theorem dominatedFinMeasAdditive_cbmApplyMeasure (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : - DominatedFinMeasAdditive (μ.transpose B).variation (μ.transpose B) 1 := by - refine ⟨fun s t hs ht _ _ hdisj ↦ cbmApplyMeasure_union μ B hs ht hdisj, fun s hs hsf ↦ ?_⟩ - simpa using! norm_measure_le_variation hsf.ne - theorem norm_cbmApplyMeasure_le (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) (s : Set X) : ‖cbmApplyMeasure μ B s‖ ≤ ‖B‖ * ‖μ s‖ := by rw [opNorm_le_iff (by positivity)] intro x grw [cbmApplyMeasure_apply, le_opNorm₂, mul_right_comm] +theorem dominatedFinMeasAdditive_cbmApplyMeasure (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : + DominatedFinMeasAdditive μ.variation (μ.transpose B) ‖B‖ := by + refine ⟨fun s t hs ht _ _ hdisj ↦ cbmApplyMeasure_union μ B hs ht hdisj, fun s hs hsf ↦ ?_⟩ + apply (norm_cbmApplyMeasure_le _ _ _).trans + gcongr + exact norm_measure_le_variation hsf.ne + end cbmApplyMeasure namespace VectorMeasure @@ -221,15 +224,15 @@ function with respect to a signed measure. -/ /-- `f : X → E` is said to be integrable with respect to `μ` and `B` if it is integrable with respect to `(μ.transpose B).variation`. -/ -protected abbrev Integrable (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : Prop := - MeasureTheory.Integrable f (μ.transpose B).variation +protected abbrev Integrable (μ : VectorMeasure X F) (f : X → E) : Prop := + MeasureTheory.Integrable f μ.variation /-- `f : X → E` is said to be integrable with respect to `μ` and `B` on `s` if it is integrable with respect to the vector measure `μ.restrict s`. When `s` is measurable, this is equivalent to integrability with respect to `(μ.transpose B).variation.restrict s`. -/ protected abbrev IntegrableOn - (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) (s : Set X) : Prop := - (μ.restrict s).Integrable f B + (μ : VectorMeasure X F) (f : X → E) (s : Set X) : Prop := + (μ.restrict s).Integrable f open Classical in /-- The `G`-valued integral of `E`-valued function and the `F`-valued vector measure `μ` with linear @@ -242,7 +245,7 @@ When `μ` is a signed measure, to get the integral in `G` of a `G`-valued functi `B = (ContinousLinearMap.lsmul ℝ ℝ).flip`. Notation `∫ᵛ x, f x ∂<•μ`. -/ noncomputable def integral (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : G := - setToFun (μ.transpose B).variation (μ.transpose B) + setToFun μ.variation (μ.transpose B) (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f @[inherit_doc integral] @@ -274,7 +277,7 @@ notation3 "∫ᵛ "(...)" in "s", "r:60:(scoped f => f)" ∂<•"μ:70 => variable {μ ν B} -lemma integral_eq_setToFun : ∫ᵛ x, f x ∂[B; μ] = setToFun (μ.transpose B).variation (μ.transpose B) +lemma integral_eq_setToFun : ∫ᵛ x, f x ∂[B; μ] = setToFun μ.variation (μ.transpose B) (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f := by rfl theorem integral_of_not_completeSpace (hG : ¬CompleteSpace G) : @@ -343,7 +346,7 @@ theorem transpose_sub_cbm (μ : VectorMeasure X F) (B C : E →L[ℝ] F →L[ℝ section Function -theorem integral_undef (h : ¬ μ.Integrable f B) : +theorem integral_undef (h : ¬ μ.Integrable f) : ∫ᵛ x, f x ∂[B; μ] = 0 := by simp [integral, setToFun_undef _ h] @@ -351,48 +354,54 @@ theorem integral_undef (h : ¬ μ.Integrable f B) : theorem integral_zero : ∫ᵛ _, 0 ∂[B; μ] = 0 := setToFun_zero _ -theorem integral_congr_ae (h : f =ᵐ[(μ.transpose B).variation] g) : +theorem integral_congr_ae (h : f =ᵐ[μ.variation] g) : ∫ᵛ x, f x ∂[B; μ] = ∫ᵛ x, g x ∂[B; μ] := setToFun_congr_ae _ h -theorem integral_eq_zero_of_ae (hf : f =ᵐ[(μ.transpose B).variation] 0) : +theorem integral_eq_zero_of_ae (hf : f =ᵐ[μ.variation] 0) : ∫ᵛ x, f x ∂[B; μ] = 0 := by simp [integral_congr_ae hf] -@[to_fun] lemma Integrable.add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : - μ.Integrable (f + g) B := +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +@[to_fun] lemma Integrable.add (hf : μ.Integrable f) (hg : μ.Integrable g) : + μ.Integrable (f + g) := MeasureTheory.Integrable.add hf hg -@[to_fun] lemma Integrable.neg (hf : μ.Integrable f B) : - μ.Integrable (-f) B := +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +@[to_fun] lemma Integrable.neg (hf : μ.Integrable f) : + μ.Integrable (-f) := MeasureTheory.Integrable.neg hf -@[to_fun] lemma Integrable.sub (hf : μ.Integrable f B) (hg : μ.Integrable g B) : - μ.Integrable (f - g) B := +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +@[to_fun] lemma Integrable.sub (hf : μ.Integrable f) (hg : μ.Integrable g) : + μ.Integrable (f - g) := MeasureTheory.Integrable.sub hf hg +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in @[to_fun] lemma Integrable.smul {𝕜 : Type*} [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 E] - [IsBoundedSMul 𝕜 E] (c : 𝕜) (hf : μ.Integrable f B) : - μ.Integrable (c • f) B := + [IsBoundedSMul 𝕜 E] (c : 𝕜) (hf : μ.Integrable f) : + μ.Integrable (c • f) := MeasureTheory.Integrable.smul c hf +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in theorem Integrable.finsetSum {ι : Type*} (s : Finset ι) {f : ι → X → E} - (hf : ∀ i ∈ s, μ.Integrable (f i) B) : μ.Integrable (∑ i ∈ s, f i) B := + (hf : ∀ i ∈ s, μ.Integrable (f i)) : μ.Integrable (∑ i ∈ s, f i) := integrable_finsetSum' s hf +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in theorem Integrable.fun_finsetSum {ι : Type*} (s : Finset ι) {f : ι → X → E} - (hf : ∀ i ∈ s, μ.Integrable (f i) B) : μ.Integrable (fun x ↦ ∑ i ∈ s, f i x) B := + (hf : ∀ i ∈ s, μ.Integrable (f i)) : μ.Integrable (fun x ↦ ∑ i ∈ s, f i x) := integrable_finsetSum s hf -theorem integral_fun_add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem integral_fun_add (hf : μ.Integrable f) (hg : μ.Integrable g) : ∫ᵛ x, f x + g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := setToFun_add _ hf hg -theorem integral_add (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem integral_add (hf : μ.Integrable f) (hg : μ.Integrable g) : ∫ᵛ x, (f + g) x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, g x ∂[B; μ] := integral_fun_add hf hg theorem integral_finsetSum (s : Finset ι) {f : ι → X → E} - (hf : ∀ i ∈ s, μ.Integrable (f i) B) : + (hf : ∀ i ∈ s, μ.Integrable (f i)) : ∫ᵛ x, ∑ i ∈ s, f i x ∂[B; μ] = ∑ i ∈ s, ∫ᵛ x, f i x ∂[B; μ] := setToFun_finsetSum _ s hf @@ -407,11 +416,11 @@ variable (f μ B) in theorem integral_neg : ∫ᵛ x, (-f) x ∂[B; μ] = -∫ᵛ x, f x ∂[B; μ] := integral_fun_neg μ B f -theorem integral_fun_sub (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem integral_fun_sub (hf : μ.Integrable f) (hg : μ.Integrable g) : ∫ᵛ x, f x - g x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := setToFun_sub _ hf hg -theorem integral_sub (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem integral_sub (hf : μ.Integrable f) (hg : μ.Integrable g) : ∫ᵛ x, (f - g) x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, g x ∂[B; μ] := integral_fun_sub hf hg variable (f μ B) in @@ -426,7 +435,7 @@ theorem integral_smul (c : ℝ) : ∫ᵛ x, (c • f) x ∂[B; μ] = c • ∫ᵛ x, f x ∂[B; μ] := integral_fun_smul μ B c f @[simp] -theorem integral_const [CompleteSpace G] [IsFiniteMeasure (μ.transpose B).variation] (c : E) : +theorem integral_const [CompleteSpace G] [IsFiniteMeasure μ.variation] (c : E) : ∫ᵛ _ : X, c ∂[B; μ] = B c (μ univ) := setToFun_const _ _ @@ -434,34 +443,40 @@ end Function section VectorMeasure +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in /- `simpNF` complains that this lemma can be proved by `simp`, because the `simp`-generated lemma unfolds the abbrev `VectorMeasure.Integrable`. TODO: fix `simp`. See lean4#13958. -/ @[nolint simpNF, simp] -lemma Integrable.zero_vectorMeasure : (0 : VectorMeasure X F).Integrable f B := by +lemma Integrable.zero_vectorMeasure : (0 : VectorMeasure X F).Integrable f := by simp [VectorMeasure.Integrable] -lemma Integrable.add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : - (μ + ν).Integrable f B := by +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +lemma Integrable.add_vectorMeasure (hμ : μ.Integrable f) (hν : ν.Integrable f) : + (μ + ν).Integrable f := by apply Integrable.mono_measure (integrable_add_measure.2 ⟨hμ, hν⟩) - grw [transpose_add, variation_add_le] + grw [variation_add_le] -lemma Integrable.neg_vectorMeasure (hμ : μ.Integrable f B) : - (-μ).Integrable f B := +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +lemma Integrable.neg_vectorMeasure (hμ : μ.Integrable f) : + (-μ).Integrable f := Integrable.mono_measure hμ (by simp) -lemma Integrable.sub_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : - (μ - ν).Integrable f B := by +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +lemma Integrable.sub_vectorMeasure (hμ : μ.Integrable f) (hν : ν.Integrable f) : + (μ - ν).Integrable f := by convert hμ.add_vectorMeasure hν.neg_vectorMeasure using 1 exact sub_eq_add_neg μ ν -lemma Integrable.smul_vectorMeasure (hμ : μ.Integrable f B) (c : ℝ) : - (c • μ).Integrable f B := by +omit [NormedSpace ℝ E] in +lemma Integrable.smul_vectorMeasure (hμ : μ.Integrable f) (c : ℝ) : + (c • μ).Integrable f := by apply Integrable.mono_measure (Integrable.smul_measure_nnreal hμ (c := ‖c‖₊)) - simp [transpose_smul, variation_smul] + simp [variation_smul] +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in lemma Integrable.finsetSum_vectorMeasure {ι : Type*} {μ : ι → VectorMeasure X F} {s : Finset ι} - (h : ∀ i ∈ s, (μ i).Integrable f B) : - (∑ i ∈ s, μ i).Integrable f B := by + (h : ∀ i ∈ s, (μ i).Integrable f) : + (∑ i ∈ s, μ i).Integrable f := by classical induction s using Finset.induction_on with | empty => simp @@ -470,8 +485,9 @@ lemma Integrable.finsetSum_vectorMeasure {ι : Type*} {μ : ι → VectorMeasure Finset.sum_insert] at h ⊢ exact h.1.add_vectorMeasure (ih h.2) -lemma Integrable.restrict (hf : μ.Integrable f B) {s : Set X} : - (μ.restrict s).Integrable f B := by +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +lemma Integrable.restrict (hf : μ.Integrable f) {s : Set X} : + (μ.restrict s).Integrable f := by by_cases hs : MeasurableSet s · simpa [VectorMeasure.Integrable, transpose_restrict, variation_restrict hs] using MeasureTheory.Integrable.restrict hf @@ -489,12 +505,12 @@ theorem integral_smul_vectorMeasure (f : X → E) (c : ℝ) : by_cases hG : CompleteSpace G; swap · simp [integral, setToFun, hG] simp_rw [integral, ← setToFun_smul_left] - have : ((c • μ).transpose B).variation = ‖c‖₊ • (μ.transpose B).variation := by - simp [transpose, mapRange_smul, variation_smul] - simp only [this, mul_one] - have : DominatedFinMeasAdditive (μ.transpose B).variation ((c • μ).transpose B) ‖c‖ := by - simp only [transpose_smul, coe_smul, Real.norm_eq_abs] - simpa using! (dominatedFinMeasAdditive_cbmApplyMeasure μ B).smul c + have : (c • μ).variation = ‖c‖₊ • μ.variation := by + simp [variation_smul] + simp only [this] + have : DominatedFinMeasAdditive μ.variation ((c • μ).transpose B) (‖c‖ * ‖B‖) := by + simp only [transpose_smul, coe_smul] + exact (dominatedFinMeasAdditive_cbmApplyMeasure μ B).smul c rw! [← setToFun_congr_smul_measure' _ this, transpose_smul] rfl @@ -503,13 +519,13 @@ theorem integral_smul_nnreal_vectorMeasure (f : X → E) (c : ℝ≥0) : ∫ᵛ x, f x ∂[B; c • μ] = c • ∫ᵛ x, f x ∂[B; μ] := integral_smul_vectorMeasure f (c : ℝ) -theorem integral_add_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : +theorem integral_add_vectorMeasure (hμ : μ.Integrable f) (hν : ν.Integrable f) : ∫ᵛ x, f x ∂[B; μ + ν] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[B; ν] := - setToFun_add_left'' (by simp [transpose]) hμ hν (by grw [transpose_add, variation_add_le]) - zero_le_one zero_le_one zero_le_one + setToFun_add_left'' (by simp [transpose]) hμ hν (by grw [variation_add_le]) + (norm_nonneg _) (norm_nonneg _) (norm_nonneg _) theorem integral_finsetSum_vectorMeasure {μ : ι → VectorMeasure X F} - {s : Finset ι} (hf : ∀ i ∈ s, (μ i).Integrable f B) : + {s : Finset ι} (hf : ∀ i ∈ s, (μ i).Integrable f) : ∫ᵛ x, f x ∂[B; ∑ i ∈ s, μ i] = ∑ i ∈ s, ∫ᵛ x, f x ∂[B; μ i] := by classical induction s using Finset.induction_on with @@ -524,7 +540,7 @@ theorem integral_neg_vectorMeasure : ∫ᵛ x, f x ∂[B; -μ] = -∫ᵛ x, f x ∂[B; μ] := by simp [integral, ← setToFun_neg'] -theorem integral_sub_vectorMeasure (hμ : μ.Integrable f B) (hν : ν.Integrable f B) : +theorem integral_sub_vectorMeasure (hμ : μ.Integrable f) (hν : ν.Integrable f) : ∫ᵛ x, f x ∂[B; μ - ν] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, f x ∂[B; ν] := by rw [sub_eq_add_neg, integral_add_vectorMeasure hμ hν.neg_vectorMeasure, integral_neg_vectorMeasure, ← sub_eq_add_neg] @@ -533,76 +549,46 @@ end VectorMeasure section cbm -/- `simpNF` complains that this lemma can be proved by `simp`, because the `simp`-generated lemma -unfolds the abbrev `VectorMeasure.Integrable`. TODO: fix `simp`. See lean4#13958. -/ -@[nolint simpNF, simp] -lemma Integrable.zero_cbm : μ.Integrable f (0 : E →L[ℝ] F →L[ℝ] G) := by - simp [VectorMeasure.Integrable] - -lemma Integrable.add_cbm (hB : μ.Integrable f B) (hC : μ.Integrable f C) : - μ.Integrable f (B + C) := by - apply Integrable.mono_measure (integrable_add_measure.2 ⟨hB, hC⟩) - grw [transpose_add_cbm, variation_add_le] - -lemma Integrable.neg_cbm (hB : μ.Integrable f B) : - μ.Integrable f (-B) := by - apply Integrable.mono_measure hB - simp - -lemma Integrable.sub_cbm (hB : μ.Integrable f B) (hC : μ.Integrable f C) : - μ.Integrable f (B - C) := by - convert hB.add_cbm hC.neg_cbm using 1 - exact sub_eq_add_neg B C - -lemma Integrable.finsetSum_cbm {ι : Type*} {B : ι → E →L[ℝ] F →L[ℝ] G} {s : Finset ι} - (h : ∀ i ∈ s, μ.Integrable f (B i)) : μ.Integrable f (∑ i ∈ s, B i) := by - classical - induction s using Finset.induction_on with - | empty => simp - | insert a s ha ih => - simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, - Finset.sum_insert] at h ⊢ - exact h.1.add_cbm (ih h.2) - variable (f μ) in @[simp] theorem integral_zero_cbm : ∫ᵛ x, f x ∂[(0 : E →L[ℝ] F →L[ℝ] G); μ] = 0 := by simp [integral] -theorem integral_add_cbm (hB : μ.Integrable f B) (hC : μ.Integrable f C) : - ∫ᵛ x, f x ∂[B + C; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[C; μ] := - setToFun_add_left'' (by simp [transpose]) hB hC (by simp [variation_add_le]) - zero_le_one zero_le_one zero_le_one +theorem integral_add_cbm (hB : μ.Integrable f) : + ∫ᵛ x, f x ∂[B + C; μ] = ∫ᵛ x, f x ∂[B; μ] + ∫ᵛ x, f x ∂[C; μ] := by + refine setToFun_add_left'' (by simp [transpose]) hB hB ?_ + (norm_nonneg _) (norm_nonneg _) (norm_nonneg _) + nth_rw 1 [← add_zero μ.variation] + gcongr + exact Measure.zero_le μ.variation theorem integral_finsetSum_cbm {B : ι → E →L[ℝ] F →L[ℝ] G} - {s : Finset ι} (hf : ∀ i ∈ s, μ.Integrable f (B i)) : + {s : Finset ι} (hf : μ.Integrable f) : ∫ᵛ x, f x ∂[∑ i ∈ s, B i; μ] = ∑ i ∈ s, ∫ᵛ x, f x ∂[B i; μ] := by classical induction s using Finset.induction_on with | empty => simp | insert a s ha ih => - simp only [Finset.mem_insert, forall_eq_or_imp, ha, not_false_eq_true, - Finset.sum_insert] at hf ⊢ - rw [integral_add_cbm hf.1 (Integrable.finsetSum_cbm hf.2), ih hf.2] + simp only [ha, not_false_eq_true, Finset.sum_insert] + rw [integral_add_cbm hf, ih] @[integral_simps] theorem integral_neg_cbm : ∫ᵛ x, f x ∂[-B; μ] = -∫ᵛ x, f x ∂[B; μ] := by simp [integral, ← setToFun_neg'] -theorem integral_sub_cbm (hB : μ.Integrable f B) (hC : μ.Integrable f C) : +theorem integral_sub_cbm (hB : μ.Integrable f) : ∫ᵛ x, f x ∂[B - C; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x, f x ∂[C; μ] := by rw [sub_eq_add_neg, integral_add_cbm hB, integral_neg_cbm, ← sub_eq_add_neg] - simpa [VectorMeasure.Integrable] using hC end cbm -theorem Integrable.of_integral_ne_zero (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : μ.Integrable f B := +theorem Integrable.of_integral_ne_zero (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : μ.Integrable f := Not.imp_symm integral_undef h theorem integral_non_aestronglyMeasurable {f : X → E} - (h : ¬AEStronglyMeasurable f (μ.transpose B).variation) : + (h : ¬AEStronglyMeasurable f μ.variation) : ∫ᵛ a, f a ∂[B; μ] = 0 := integral_undef <| not_and_of_not_left _ h @@ -610,41 +596,48 @@ lemma integral_indicator₂ {β : Type*} (f : β → X → E) (s : Set β) (b : ∫ᵛ y, s.indicator (f · y) b ∂[B; μ] = s.indicator (fun x ↦ ∫ᵛ y, f x y ∂[B; μ]) b := by by_cases hb : b ∈ s <;> simp [hb] +theorem continuous_integral : Continuous fun f : X →₁[μ.variation] E => ∫ᵛ a, f a ∂[B; μ] := by + simp only [integral_eq_setToFun] + exact continuous_setToFun _ + theorem norm_integral_le_lintegral_norm : - ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation) := + ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ‖B‖ * ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ.variation) := (norm_setToFun_le_toReal _ (by simp)).trans (by simp) theorem norm_integral_le_integral_norm : - ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ∫ a, ‖f a‖ ∂(μ.transpose B).variation := by - have le_ae : ∀ᵐ a ∂(μ.transpose B).variation, 0 ≤ ‖f a‖ := + ‖∫ᵛ a, f a ∂[B; μ]‖ ≤ ‖B‖ * ∫ a, ‖f a‖ ∂μ.variation := by + have le_ae : ∀ᵐ a ∂μ.variation, 0 ≤ ‖f a‖ := Eventually.of_forall fun a => norm_nonneg _ - by_cases h : AEStronglyMeasurable f (μ.transpose B).variation + by_cases h : AEStronglyMeasurable f μ.variation · calc ‖∫ᵛ a, f a ∂[B; μ]‖ - _ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation) := + _ ≤ ‖B‖ * ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ.variation) := norm_integral_le_lintegral_norm - _ = ∫ a, ‖f a‖ ∂(μ.transpose B).variation := - (integral_eq_lintegral_of_nonneg_ae le_ae <| h.norm).symm + _ = ‖B‖ * ∫ a, ‖f a‖ ∂μ.variation := by + rw [integral_eq_lintegral_of_nonneg_ae le_ae <| h.norm] · rw [integral_non_aestronglyMeasurable h, norm_zero] - exact integral_nonneg_of_ae le_ae + positivity theorem enorm_integral_le_lintegral_enorm : - ‖∫ᵛ a, f a ∂[B; μ]‖ₑ ≤ ∫⁻ a, ‖f a‖ₑ ∂(μ.transpose B).variation := - (enorm_setToFun_le _ (by simp)).trans (by simp) + ‖∫ᵛ a, f a ∂[B; μ]‖ₑ ≤ ‖B‖ₑ * ∫⁻ a, ‖f a‖ₑ ∂μ.variation := by + apply (enorm_setToFun_le _ (by simp)).trans + gcongr + simp [← coe_nnnorm] -theorem dist_integral_le_lintegral_edist (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem dist_integral_le_lintegral_edist (hf : μ.Integrable f) (hg : μ.Integrable g) : dist (∫ᵛ a, f a ∂[B; μ]) (∫ᵛ a, g a ∂[B; μ]) ≤ - (∫⁻ a, edist (f a) (g a) ∂(μ.transpose B).variation).toReal := by + ‖B‖ * (∫⁻ a, edist (f a) (g a) ∂μ.variation).toReal := by grw [dist_eq_norm, ← integral_sub hf hg, norm_integral_le_lintegral_norm] simp [edist_eq_enorm_sub] -theorem edist_integral_le_lintegral_edist (hf : μ.Integrable f B) (hg : μ.Integrable g B) : +theorem edist_integral_le_lintegral_edist (hf : μ.Integrable f) (hg : μ.Integrable g) : edist (∫ᵛ a, f a ∂[B; μ]) (∫ᵛ a, g a ∂[B; μ]) ≤ - ∫⁻ a, edist (f a) (g a) ∂(μ.transpose B).variation := by + ‖B‖ₑ * ∫⁻ a, edist (f a) (g a) ∂μ.variation := by rw [edist_dist] - exact ENNReal.ofReal_le_of_le_toReal (dist_integral_le_lintegral_edist hf hg) + apply ENNReal.ofReal_le_of_le_toReal + grw [dist_integral_le_lintegral_edist hf hg, ENNReal.toReal_mul, toReal_enorm] theorem frequently_ae_ne_zero_of_integral_ne_zero - (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ᶠ a in ae (μ.transpose B).variation, f a ≠ 0 := + (h : ∫ᵛ a, f a ∂[B; μ] ≠ 0) : ∃ᶠ a in ae μ.variation, f a ≠ 0 := fun h' ↦ h (integral_eq_zero_of_ae (h'.mono fun _ ↦ not_not.mp)) theorem exists_ne_zero_of_integral_ne_zero @@ -656,7 +649,7 @@ theorem exists_ne_zero_of_integral_ne_zero rcases subsingleton_or_nontrivial G with h'G | h'G · apply Subsingleton.elim rw [integral_eq_setToFun, MeasureTheory.integral_eq_setToFun] - simp only [variation_transpose_lsmul_flip, Measure.variation_toSignedMeasure] + simp only [Measure.variation_toSignedMeasure] apply setToFun_congr_left' _ _ (fun s hs h's ↦ ?_) simp only [transpose, ContinuousLinearMap.flip_flip, mapRange_apply, Measure.toSignedMeasure_apply, hs, ↓reduceIte, LinearMap.toAddMonoidHom_coe, @@ -675,7 +668,7 @@ theorem integral_dirac' [MeasurableSpace X] [CompleteSpace G] {a : X} {v : F} calc ∫ᵛ x, f x ∂[B; VectorMeasure.dirac a v] = ∫ᵛ _, f a ∂[B; VectorMeasure.dirac a v] := by apply integral_congr_ae - simp only [transpose_dirac, variation_dirac] + simp only [variation_dirac] exact Measure.ae_smul_measure (ae_eq_dirac' hfm.measurable) _ _ = B (f a) v := by simp @@ -690,7 +683,7 @@ theorem integral_dirac [MeasurableSpace X] [MeasurableSingletonClass X] [Complet calc ∫ᵛ x, f x ∂[B; VectorMeasure.dirac a v] = ∫ᵛ _, f a ∂[B; VectorMeasure.dirac a v] := by apply integral_congr_ae - simp only [transpose_dirac, variation_dirac] + simp only [variation_dirac] exact Measure.ae_smul_measure (ae_eq_dirac f) _ _ = B (f a) v := by simp @@ -702,17 +695,17 @@ theorem integral_unique [Unique X] [CompleteSpace G] : /-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ theorem tendsto_integral_of_L1 {ι} (f : X → E) - (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} - {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) - (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) : + (hfi : AEStronglyMeasurable f μ.variation) {F : ι → X → E} + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i)) + (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂μ.variation) l (𝓝 0)) : Tendsto (fun i ↦ ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 <| ∫ᵛ x, f x ∂[B; μ]) := tendsto_setToFun_of_L1 _ f hfi hFi hF /-- If `F i → f` in `L1`, then `∫ᵛ x, F i x ∂[B; μ] → ∫ᵛ x, f x ∂[B; μ]`. -/ lemma tendsto_integral_of_L1' {ι} (f : X → E) - (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} - {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) - (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 (μ.transpose B).variation) l (𝓝 0)) : + (hfi : AEStronglyMeasurable f μ.variation) {F : ι → X → E} + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i)) + (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ.variation) l (𝓝 0)) : Tendsto (fun i ↦ ∫ᵛ x, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x, f x ∂[B; μ])) := by refine tendsto_integral_of_L1 f hfi hFi ?_ simp_rw [eLpNorm_one_eq_lintegral_enorm, Pi.sub_apply] at hF @@ -721,67 +714,72 @@ lemma tendsto_integral_of_L1' {ι} (f : X → E) variable {Y : Type*} [TopologicalSpace Y] [FirstCountableTopology Y] theorem continuousWithinAt_of_dominated {F : Y → X → E} {x₀ : Y} {bound : X → ℝ} {s : Set Y} - (hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) (μ.transpose B).variation) - (h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) - (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousWithinAt (fun x ↦ F x a) s x₀) : + (hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) μ.variation) + (h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂μ.variation, ‖F x a‖ ≤ bound a) + (bound_integrable : Integrable bound μ.variation) + (h_cont : ∀ᵐ a ∂μ.variation, ContinuousWithinAt (fun x ↦ F x a) s x₀) : ContinuousWithinAt (fun x ↦ ∫ᵛ a, F x a ∂[B; μ]) s x₀ := continuousWithinAt_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont theorem continuousAt_of_dominated {F : Y → X → E} {x₀ : Y} {bound : X → ℝ} - (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) (μ.transpose B).variation) - (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) - (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousAt (fun x ↦ F x a) x₀) : + (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) μ.variation) + (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂μ.variation, ‖F x a‖ ≤ bound a) + (bound_integrable : Integrable bound μ.variation) + (h_cont : ∀ᵐ a ∂μ.variation, ContinuousAt (fun x ↦ F x a) x₀) : ContinuousAt (fun x ↦ ∫ᵛ a, F x a ∂[B; μ]) x₀ := continuousAt_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont theorem continuousOn_of_dominated {F : Y → X → E} {bound : X → ℝ} {s : Set Y} - (hF_meas : ∀ x ∈ s, AEStronglyMeasurable (F x) (μ.transpose B).variation) - (h_bound : ∀ x ∈ s, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) - (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, ContinuousOn (fun x ↦ F x a) s) : + (hF_meas : ∀ x ∈ s, AEStronglyMeasurable (F x) μ.variation) + (h_bound : ∀ x ∈ s, ∀ᵐ a ∂μ.variation, ‖F x a‖ ≤ bound a) + (bound_integrable : Integrable bound μ.variation) + (h_cont : ∀ᵐ a ∂μ.variation, ContinuousOn (fun x ↦ F x a) s) : ContinuousOn (fun x ↦ ∫ᵛ a, F x a ∂[B; μ]) s := continuousOn_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont theorem continuous_of_dominated {F : Y → X → E} {bound : X → ℝ} - (hF_meas : ∀ x, AEStronglyMeasurable (F x) (μ.transpose B).variation) - (h_bound : ∀ x, ∀ᵐ a ∂(μ.transpose B).variation, ‖F x a‖ ≤ bound a) - (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_cont : ∀ᵐ a ∂(μ.transpose B).variation, Continuous fun x ↦ F x a) : + (hF_meas : ∀ x, AEStronglyMeasurable (F x) μ.variation) + (h_bound : ∀ x, ∀ᵐ a ∂μ.variation, ‖F x a‖ ≤ bound a) + (bound_integrable : Integrable bound μ.variation) + (h_cont : ∀ᵐ a ∂μ.variation, Continuous fun x ↦ F x a) : Continuous fun x ↦ ∫ᵛ a, F x a ∂[B; μ] := continuous_setToFun_of_dominated _ hF_meas h_bound bound_integrable h_cont -theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure (μ.transpose B).variation] - {C : ℝ} (h : ∀ᵐ x ∂(μ.transpose B).variation, ‖f x‖ ≤ C) : - ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ C * (μ.transpose B).variation.real univ := calc +theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure μ.variation] + {C : ℝ} (h : ∀ᵐ x ∂μ.variation, ‖f x‖ ≤ C) : + ‖∫ᵛ x, f x ∂[B; μ]‖ ≤ C * ‖B‖ * μ.variation.real univ := calc ‖∫ᵛ x, f x ∂[B; μ]‖ - _ ≤ (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂(μ.transpose B).variation).toReal := + _ ≤ ‖B‖ * (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ.variation).toReal := norm_integral_le_lintegral_norm - _ ≤ (∫⁻ a, ENNReal.ofReal C ∂(μ.transpose B).variation).toReal := by + _ ≤ ‖B‖ * (∫⁻ a, ENNReal.ofReal C ∂μ.variation).toReal := by + gcongr 1 apply ENNReal.toReal_mono · simp only [lintegral_const, ne_eq] finiteness · apply lintegral_mono_ae filter_upwards [h] with x hx using ENNReal.ofReal_mono hx - _ = C * (μ.transpose B).variation.real univ := by - by_cases hμ : (μ.transpose B).variation = 0 + _ = ‖B‖ * (C * μ.variation.real univ) := by + by_cases hμ : μ.variation = 0 · simp [hμ] - have : (ae (μ.transpose B).variation).NeBot := ae_neBot.mpr hμ + have : (ae μ.variation).NeBot := ae_neBot.mpr hμ have hC : 0 ≤ C := by obtain ⟨x, hx⟩ := h.exists exact (norm_nonneg _).trans hx simp [ENNReal.toReal_ofReal hC, Measure.real] + _ = C * ‖B‖ * μ.variation.real univ := by ring theorem enorm_integral_le_of_enorm_le_const - {C : ℝ≥0∞} (h : ∀ᵐ x ∂(μ.transpose B).variation, ‖f x‖ₑ ≤ C) : - ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ C * (μ.transpose B).variation univ := - enorm_integral_le_lintegral_enorm.trans ((lintegral_mono_ae h).trans (by simp)) + {C : ℝ≥0∞} (h : ∀ᵐ x ∂μ.variation, ‖f x‖ₑ ≤ C) : + ‖∫ᵛ x, f x ∂[B; μ]‖ₑ ≤ C * ‖B‖ₑ * μ.variation univ := by + apply enorm_integral_le_lintegral_enorm.trans + rw [mul_comm C, mul_assoc] + gcongr + exact (lintegral_mono_ae h).trans (by simp) theorem nndist_integral_add_vectorMeasure_le_lintegral - (h₁ : μ.Integrable f B) (h₂ : ν.Integrable f B) : + (h₁ : μ.Integrable f) (h₂ : ν.Integrable f) : (nndist (∫ᵛ x, f x ∂[B; μ]) (∫ᵛ x, f x ∂[B; (μ + ν)]) : ℝ≥0∞) ≤ - ∫⁻ x, ‖f x‖ₑ ∂(ν.transpose B).variation := by + ‖B‖ₑ * ∫⁻ x, ‖f x‖ₑ ∂ν.variation := by rw [integral_add_vectorMeasure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel_left] exact enorm_integral_le_lintegral_enorm @@ -791,21 +789,22 @@ lemma variation_transpose_map_le : ((μ.map φ).transpose B).variation ≤ Measure.map φ (μ.transpose B).variation := by grw [transpose_map, variation_map_le] +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in theorem Integrable.map {β : Type*} [MeasurableSpace β] {φ : X → β} - {f : β → E} (hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ)) - (h : μ.Integrable (f ∘ φ) B) : (μ.map φ).Integrable f B := by + {f : β → E} (hfm : AEStronglyMeasurable f (μ.variation.map φ)) + (h : μ.Integrable (f ∘ φ)) : (μ.map φ).Integrable f := by by_cases hφ : Measurable φ; swap · simp [VectorMeasure.map, hφ] simp_rw [VectorMeasure.Integrable] at h ⊢ apply ((integrable_map_measure hfm hφ.aemeasurable).2 h).mono_measure - apply variation_transpose_map_le + apply variation_map_le theorem integral_map {β : Type*} [MeasurableSpace β] {φ : X → β} (hφ : Measurable φ) {f : β → E} - (hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ)) - (hfi' : μ.Integrable (f ∘ φ) B) : + (hfm : AEStronglyMeasurable f (μ.variation.map φ)) + (hfi' : μ.Integrable (f ∘ φ)) : ∫ᵛ y, f y ∂[B; μ.map φ] = ∫ᵛ x, f (φ x) ∂[B; μ] := by - apply setToFun_of_le_map _ _ hfi' hfm hφ variation_transpose_map_le + apply setToFun_of_le_map _ _ hfi' hfm hφ variation_map_le intro s x hs simp [hs, VectorMeasure.map, transpose, hφ] @@ -813,24 +812,24 @@ theorem _root_.MeasurableEmbedding.variation_transpose_map (hφ : MeasurableEmbe ((μ.map φ).transpose B).variation = (μ.transpose B).variation.map φ := by rw [transpose_map, hφ.variation_map] +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in theorem _root_.MeasurableEmbedding.integrable_map_vectorMeasure (hφ : MeasurableEmbedding φ) {f : β → E} : - (μ.map φ).Integrable f B ↔ μ.Integrable (f ∘ φ) B := by - simp_rw [VectorMeasure.Integrable, - ← hφ.integrable_map_iff (g := f) (μ := (μ.transpose B).variation), hφ.variation_transpose_map] + (μ.map φ).Integrable f ↔ μ.Integrable (f ∘ φ) := by + simp_rw [VectorMeasure.Integrable, ← hφ.integrable_map_iff, hφ.variation_map] theorem _root_.MeasurableEmbedding.integral_map_vectorMeasure (hφ : MeasurableEmbedding φ) {f : β → E} : ∫ᵛ y, f y ∂[B; μ.map φ] = ∫ᵛ x, f (φ x) ∂[B; μ] := by - by_cases hfm : AEStronglyMeasurable f ((μ.transpose B).variation.map φ) - · by_cases h'fm : μ.Integrable (f ∘ φ) B + by_cases hfm : AEStronglyMeasurable f (μ.variation.map φ) + · by_cases h'fm : μ.Integrable (f ∘ φ) · apply integral_map hφ.measurable hfm h'fm · rw [integral_undef, integral_undef] · exact h'fm · rwa [hφ.integrable_map_vectorMeasure] · rw [integral_non_aestronglyMeasurable, integral_non_aestronglyMeasurable] · rwa [hφ.aestronglyMeasurable_map_iff] at hfm - · rwa [hφ.variation_transpose_map] + · rwa [hφ.variation_map] theorem _root_.Topology.IsClosedEmbedding.integral_map_vectorMeasure [TopologicalSpace X] [BorelSpace X] @@ -845,40 +844,40 @@ theorem integral_map_equiv {β} [MeasurableSpace β] (e : X ≃ᵐ β) (f : β /-- **Lebesgue dominated convergence theorem** provides sufficient conditions under which almost everywhere convergence of a sequence of functions implies the convergence of their integrals. We could weaken the condition `bound_integrable` to require - `HasFiniteIntegral bound (μ.transpose B).variation` instead (i.e. not requiring that `bound` is + `HasFiniteIntegral bound μ.variation` instead (i.e. not requiring that `bound` is measurable), but in all applications proving integrability is easier. -/ theorem tendsto_integral_of_dominated_convergence {F : ℕ → X → E} {f : X → E} (bound : X → ℝ) - (F_measurable : ∀ n, AEStronglyMeasurable (F n) (μ.transpose B).variation) - (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_bound : ∀ n, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound a) - (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n ↦ F n a) atTop (𝓝 (f a))) : + (F_measurable : ∀ n, AEStronglyMeasurable (F n) μ.variation) + (bound_integrable : Integrable bound μ.variation) + (h_bound : ∀ n, ∀ᵐ a ∂μ.variation, ‖F n a‖ ≤ bound a) + (h_lim : ∀ᵐ a ∂μ.variation, Tendsto (fun n ↦ F n a) atTop (𝓝 (f a))) : Tendsto (fun n ↦ ∫ᵛ a, F n a ∂[B; μ]) atTop (𝓝 <| ∫ᵛ a, f a ∂[B; μ]) := tendsto_setToFun_of_dominated_convergence _ bound F_measurable bound_integrable h_bound h_lim /-- Lebesgue dominated convergence theorem for filters with a countable basis -/ theorem tendsto_integral_filter_of_dominated_convergence {l : Filter ι} [l.IsCountablyGenerated] {F : ι → X → E} {f : X → E} (bound : X → ℝ) - (hF_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) (μ.transpose B).variation) - (h_bound : ∀ᶠ n in l, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound a) - (bound_integrable : Integrable bound (μ.transpose B).variation) - (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n ↦ F n a) l (𝓝 (f a))) : + (hF_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ.variation) + (h_bound : ∀ᶠ n in l, ∀ᵐ a ∂μ.variation, ‖F n a‖ ≤ bound a) + (bound_integrable : Integrable bound μ.variation) + (h_lim : ∀ᵐ a ∂μ.variation, Tendsto (fun n ↦ F n a) l (𝓝 (f a))) : Tendsto (fun n ↦ ∫ᵛ a, F n a ∂[B; μ]) l (𝓝 <| ∫ᵛ a, f a ∂[B; μ]) := tendsto_setToFun_filter_of_dominated_convergence _ bound hF_meas h_bound bound_integrable h_lim /-- Lebesgue dominated convergence theorem for series. -/ theorem hasSum_integral_of_dominated_convergence [Countable ι] {F : ι → X → E} {f : X → E} - (bound : ι → X → ℝ) (hF_meas : ∀ n, AEStronglyMeasurable (F n) (μ.transpose B).variation) - (h_bound : ∀ n, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ bound n a) - (bound_summable : ∀ᵐ a ∂(μ.transpose B).variation, Summable fun n ↦ bound n a) - (bound_integrable : Integrable (fun a ↦ ∑' n, bound n a) (μ.transpose B).variation) - (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, HasSum (fun n ↦ F n a) (f a)) : + (bound : ι → X → ℝ) (hF_meas : ∀ n, AEStronglyMeasurable (F n) μ.variation) + (h_bound : ∀ n, ∀ᵐ a ∂μ.variation, ‖F n a‖ ≤ bound n a) + (bound_summable : ∀ᵐ a ∂μ.variation, Summable fun n ↦ bound n a) + (bound_integrable : Integrable (fun a ↦ ∑' n, bound n a) μ.variation) + (h_lim : ∀ᵐ a ∂μ.variation, HasSum (fun n ↦ F n a) (f a)) : HasSum (fun n ↦ ∫ᵛ a, F n a ∂[B; μ]) (∫ᵛ a, f a ∂[B; μ]) := hasSum_setToFun_of_dominated_convergence _ bound hF_meas h_bound bound_summable bound_integrable h_lim theorem integral_tsum [CompleteSpace E] [Countable ι] - {f : ι → X → E} (hf : ∀ i, AEStronglyMeasurable (f i) (μ.transpose B).variation) - (hf' : ∑' i, ∫⁻ a : X, ‖f i a‖ₑ ∂(μ.transpose B).variation ≠ ∞) : + {f : ι → X → E} (hf : ∀ i, AEStronglyMeasurable (f i) μ.variation) + (hf' : ∑' i, ∫⁻ a : X, ‖f i a‖ₑ ∂μ.variation ≠ ∞) : ∫ᵛ a, ∑' i, f i a ∂[B; μ] = ∑' i, ∫ᵛ a, f i a ∂[B; μ] := setToFun_tsum _ hf hf' @@ -887,10 +886,10 @@ theorem integral_tsum [CompleteSpace E] [Countable ι] function `f`, then the integrals of `F n` with respect to a vector measure `μ` with finite variation converge to the integral of `f`. -/ theorem tendsto_integral_filter_of_norm_le_const {l : Filter ι} [l.IsCountablyGenerated] - {F : ι → X → E} [IsFiniteMeasure (μ.transpose B).variation] {f : X → E} - (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) (μ.transpose B).variation) - (h_bound : ∃ C, ∀ᶠ n in l, ∀ᵐ a ∂(μ.transpose B).variation, ‖F n a‖ ≤ C) - (h_lim : ∀ᵐ a ∂(μ.transpose B).variation, Tendsto (fun n ↦ F n a) l (𝓝 (f a))) : + {F : ι → X → E} [IsFiniteMeasure μ.variation] {f : X → E} + (h_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ.variation) + (h_bound : ∃ C, ∀ᶠ n in l, ∀ᵐ a ∂μ.variation, ‖F n a‖ ≤ C) + (h_lim : ∀ᵐ a ∂μ.variation, Tendsto (fun n ↦ F n a) l (𝓝 (f a))) : Tendsto (fun n ↦ ∫ᵛ a, F n a ∂[B; μ]) l (𝓝 (∫ᵛ a, f a ∂[B; μ])) := tendsto_setToFun_filter_of_norm_le_const _ h_meas h_bound h_lim diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 8f52c5a0f29289..13c2a499e8cb7a 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -204,7 +204,7 @@ theorem lintegral_fn_integral_sub ⦃f g : X × Y → G⦄ {μ : Measure X} filter_upwards [hf.prod_right_ae, hg.prod_right_ae] with x h2f h2g simp [integral_fun_sub h2f h2g] -/-- The map that sends an L¹-function `f : α × β → E` to `∫∫f` is continuous. -/ +/-- The map that sends an L¹-function `f : X × Y → G` to `∫∫f` is continuous. -/ theorem continuous_integral_integral {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ℝ] I} [SFinite (ν.transpose B).variation] [SFinite (μ.transpose C).variation] : Continuous fun f : X × Y →₁[(μ.transpose C).variation.prod (ν.transpose B).variation] G ↦ @@ -227,4 +227,31 @@ theorem continuous_integral_integral {B : G →L[ℝ] F →L[ℝ] H} {C : H →L rw [← tendsto_iff_enorm_sub_tendsto_zero] exact tendsto_id + +/-- **Fubini's Theorem**: For integrable functions on `X × Y`, +the vector measure integral of `f` is equal to the iterated vector measure integral. -/ +theorem integral_prod {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ℝ] I} + {A : E →L[ℝ] F →L[ℝ] H} {D : G →L[ℝ] H →L[ℝ] I} [CompleteSpace H] + [IsFiniteMeasure (ν.transpose B).variation] [SFinite (μ.transpose C).variation] + {f : X × Y → G} (hf : Integrable f ((μ.transpose C).variation.prod (ν.transpose B).variation)) : + ∫ᵛ z, f z ∂[D; μ.prod ν A] = ∫ᵛ x, ∫ᵛ y, f (x, y) ∂[B; ν] ∂[C; μ] := by + by_cases hI : CompleteSpace I; swap + · simp only [integral_of_not_completeSpace hI] + revert f + apply Integrable.induction + · intro c s hs h2s + simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp_def, + integral_indicator (measurable_prodMk_left hs), setIntegral_const, integral_smul_const, + measureReal_def, + integral_toReal (measurable_measure_prodMk_left hs).aemeasurable + (ae_measure_lt_top hs h2s.ne)] + rw [Measure.prod_apply hs] + · rintro f g - i_f i_g hf hg + simp_rw [integral_add' i_f i_g, integral_integral_add' i_f i_g, hf, hg] + · exact isClosed_eq continuous_integral continuous_integral_integral + · rintro f g hfg - hf; convert! hf using 1 + · exact integral_congr_ae hfg.symm + · apply integral_congr_ae + filter_upwards [ae_ae_of_ae_prod hfg] with x hfgx using integral_congr_ae (ae_eq_symm hfgx) + end MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 64710f59b67189..d022b45bcb92d0 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -23,37 +23,38 @@ assert_not_exists InnerProductSpace open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology open scoped ENNReal NNReal Finset -variable {ι X E F G : Type*} {mX : MeasurableSpace X} - [NormedAddCommGroup E] [NormedSpace ℝ E] - [NormedAddCommGroup F] [NormedSpace ℝ F] - [NormedAddCommGroup G] [NormedSpace ℝ G] - {μ ν : VectorMeasure X F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} {s t : Set X} +variable {ι X E F G H : Type*} {mX : MeasurableSpace X} + [NormedAddCommGroup E] + [NormedAddCommGroup F] + [NormedAddCommGroup G] + [NormedAddCommGroup H] + {μ ν : VectorMeasure X F} {f g : X → E} {s t : Set X} namespace MeasureTheory.VectorMeasure -theorem IntegrableOn.mono (hs : MeasurableSet s) (hts : t ⊆ s) (h : μ.IntegrableOn f B s) : - μ.IntegrableOn f B t := by +theorem IntegrableOn.mono (hs : MeasurableSet s) (hts : t ⊆ s) (h : μ.IntegrableOn f s) : + μ.IntegrableOn f t := by by_cases ht : MeasurableSet t; swap · simp [VectorMeasure.IntegrableOn, restrict_not_measurable _ ht] apply Integrable.mono_measure h - simp [transpose_restrict, variation_restrict, hs, ht, Measure.restrict_mono hts le_rfl] + simp [variation_restrict, hs, ht, Measure.restrict_mono hts le_rfl] theorem IntegrableOn.union (hs : MeasurableSet s) (ht : MeasurableSet t) - (hf : μ.IntegrableOn f B s) (h'f : μ.IntegrableOn f B t) : - μ.IntegrableOn f B (s ∪ t) := by + (hf : μ.IntegrableOn f s) (h'f : μ.IntegrableOn f t) : + μ.IntegrableOn f (s ∪ t) := by apply Integrable.mono_measure (hf.add_measure h'f) - grw [transpose_restrict, variation_restrict_le, Measure.restrict_union_le] - simp [transpose_restrict, variation_restrict, hs, ht] + grw [variation_restrict_le, Measure.restrict_union_le] + simp [variation_restrict, hs, ht] /- `simpNF` complains that this lemma can be proved by `simp`, because the `simp`-generated lemma unfolds the abbrev `VectorMeasure.Integrable`. TODO: fix `simp`. See lean4#13958. -/ -@[simp, nolint simpNF] theorem IntegrableOn.empty : μ.IntegrableOn f B ∅ := by +@[simp, nolint simpNF] theorem IntegrableOn.empty : μ.IntegrableOn f ∅ := by simp [VectorMeasure.IntegrableOn] theorem IntegrableOn.biUnion_finite {s : Set ι} (hs : s.Finite) {t : ι → Set X} (ht : ∀ i ∈ s, MeasurableSet (t i)) - (h't : ∀ i ∈ s, μ.IntegrableOn f B (t i)) : - μ.IntegrableOn f B (⋃ i ∈ s, t i) := by + (h't : ∀ i ∈ s, μ.IntegrableOn f (t i)) : + μ.IntegrableOn f (⋃ i ∈ s, t i) := by induction s, hs using Set.Finite.induction_on with | empty => simp | insert _ h's hf => @@ -61,34 +62,46 @@ theorem IntegrableOn.biUnion_finite exact IntegrableOn.union ht.1 (h's.measurableSet_biUnion ht.2) h't.1 (hf ht.2 h't.2) theorem IntegrableOn.biUnion_finset {s : Finset ι} {t : ι → Set X} - (ht : ∀ i ∈ s, MeasurableSet (t i)) (h't : ∀ i ∈ s, μ.IntegrableOn f B (t i)) : - μ.IntegrableOn f B (⋃ i ∈ s, t i) := + (ht : ∀ i ∈ s, MeasurableSet (t i)) (h't : ∀ i ∈ s, μ.IntegrableOn f (t i)) : + μ.IntegrableOn f (⋃ i ∈ s, t i) := IntegrableOn.biUnion_finite s.finite_toSet ht h't theorem IntegrableOn.iUnion_finite [Finite ι] {t : ι → Set X} - (ht : ∀ i, MeasurableSet (t i)) (h't : ∀ i, μ.IntegrableOn f B (t i)) : - μ.IntegrableOn f B (⋃ i, t i) := by + (ht : ∀ i, MeasurableSet (t i)) (h't : ∀ i, μ.IntegrableOn f (t i)) : + μ.IntegrableOn f (⋃ i, t i) := by cases nonempty_fintype ι simpa using IntegrableOn.biUnion_finset (f := f) (μ := μ) (s := Finset.univ) (t := t) (fun i hi ↦ ht i) (fun i hi ↦ h't i) -@[simp] theorem integrableOn_univ : μ.IntegrableOn f B univ ↔ μ.Integrable f B := by +@[simp] theorem integrableOn_univ : μ.IntegrableOn f univ ↔ μ.Integrable f := by simp [VectorMeasure.IntegrableOn] -theorem Integrable.integrableOn (h : μ.Integrable f B) : μ.IntegrableOn f B s := by +theorem Integrable.integrableOn (h : μ.Integrable f) : μ.IntegrableOn f s := by rw [← integrableOn_univ] at h exact h.mono MeasurableSet.univ (subset_univ _) +theorem integrable_indicator_iff (hs : MeasurableSet s) : + μ.Integrable (indicator s f) ↔ μ.IntegrableOn f s := by + simp [VectorMeasure.Integrable, VectorMeasure.IntegrableOn, MeasureTheory.IntegrableOn, + MeasureTheory.integrable_indicator_iff hs, variation_restrict hs] + +theorem IntegrableOn.integrable_indicator (h : μ.IntegrableOn f s) (hs : MeasurableSet s) : + μ.Integrable (indicator s f) := + (integrable_indicator_iff hs).2 h + +variable [NormedSpace ℝ E] [NormedSpace ℝ F] [NormedSpace ℝ G] [NormedSpace ℝ H] + {B : E →L[ℝ] F →L[ℝ] G} + theorem setIntegral_eq_zero_of_not_measurableSet (hs : ¬MeasurableSet s) : ∫ᵛ x in s, f x ∂[B; μ] = 0 := by simp [restrict_not_measurable _ hs] -theorem setIntegral_congr_ae (h : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ s → f x = g x) : +theorem setIntegral_congr_ae (h : ∀ᵐ x ∂μ.variation, x ∈ s → f x = g x) : ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in s, g x ∂[B; μ] := by by_cases hs : MeasurableSet s; swap · simp [setIntegral_eq_zero_of_not_measurableSet hs] apply integral_congr_ae - rw [transpose_restrict, variation_restrict hs] + rw [variation_restrict hs] exact (ae_restrict_iff' hs).2 h theorem setIntegral_congr_fun (h : EqOn f g s) : @@ -96,25 +109,25 @@ theorem setIntegral_congr_fun (h : EqOn f g s) : setIntegral_congr_ae <| Eventually.of_forall h theorem setIntegral_union (hst : Disjoint s t) (hs : MeasurableSet s) (ht : MeasurableSet t) - (hfs : μ.IntegrableOn f B s) (hft : μ.IntegrableOn f B t) : + (hfs : μ.IntegrableOn f s) (hft : μ.IntegrableOn f t) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in t, f x ∂[B; μ] := by rw [← integral_add_vectorMeasure hfs hft, μ.restrict_union hst hs ht] theorem setIntegral_diff (hs : MeasurableSet s) (ht : MeasurableSet t) - (hfs : μ.IntegrableOn f B s) (hts : t ⊆ s) : + (hfs : μ.IntegrableOn f s) (hts : t ⊆ s) : ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] - ∫ᵛ x in t, f x ∂[B; μ] := by rw [eq_sub_iff_add_eq, ← setIntegral_union (by grind) (hs.diff ht) ht (hfs.mono hs diff_subset) (hfs.mono hs hts), diff_union_of_subset hts] theorem setIntegral_inter_add_diff (hs : MeasurableSet s) (ht : MeasurableSet t) - (hfs : μ.IntegrableOn f B s) : + (hfs : μ.IntegrableOn f s) : ∫ᵛ x in s ∩ t, f x ∂[B; μ] + ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by rw [← μ.restrict_inter_add_diff hs ht, integral_add_vectorMeasure (hfs.mono hs inter_subset_left) (hfs.mono hs diff_subset)] theorem setIntegral_biUnion_finset {ι : Type*} (t : Finset ι) {s : ι → Set X} (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s)) - (hf : ∀ i ∈ t, μ.IntegrableOn f B (s i)) : + (hf : ∀ i ∈ t, μ.IntegrableOn f (s i)) : ∫ᵛ x in ⋃ i ∈ t, s i, f x ∂[B; μ] = ∑ i ∈ t, ∫ᵛ x in s i, f x ∂[B; μ] := by classical induction t using Finset.induction_on with @@ -133,7 +146,7 @@ theorem setIntegral_biUnion_finset {ι : Type*} (t : Finset ι) {s : ι → Set theorem setIntegral_iUnion_fintype {ι : Type*} [Fintype ι] {s : ι → Set X} (hs : ∀ i, MeasurableSet (s i)) (h's : Pairwise (Disjoint on s)) - (hf : ∀ i, μ.IntegrableOn f B (s i)) : + (hf : ∀ i, μ.IntegrableOn f (s i)) : ∫ᵛ x in ⋃ i, s i, f x ∂[B; μ] = ∑ i, ∫ᵛ x in s i, f x ∂[B; μ] := by convert setIntegral_biUnion_finset Finset.univ (fun i _ => hs i) _ fun i _ => hf i · simp @@ -143,31 +156,21 @@ theorem setIntegral_empty : ∫ᵛ x in ∅, f x ∂[B; μ] = 0 := by simp theorem setIntegral_univ : ∫ᵛ x in univ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by simp -theorem setIntegral_add_compl (hs : MeasurableSet s) (hfi : μ.Integrable f B) : +theorem setIntegral_add_compl (hs : MeasurableSet s) (hfi : μ.Integrable f) : ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by - have := setIntegral_union disjoint_compl_right - hs hs.compl hfi.integrableOn hfi.integrableOn - rw [← this, union_compl_self, setIntegral_univ] + rw [← setIntegral_union disjoint_compl_right + hs hs.compl hfi.integrableOn hfi.integrableOn, union_compl_self, setIntegral_univ] -theorem setIntegral_compl (hs : MeasurableSet s) (hfi : μ.Integrable f B) : +theorem setIntegral_compl (hs : MeasurableSet s) (hfi : μ.Integrable f) : ∫ᵛ x in sᶜ, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] - ∫ᵛ x in s, f x ∂[B; μ] := by rw [← setIntegral_add_compl (μ := μ) hs hfi, add_sub_cancel_left] -theorem integrable_indicator_iff (hs : MeasurableSet s) : - μ.Integrable (indicator s f) B ↔ μ.IntegrableOn f B s := by - simp [VectorMeasure.Integrable, VectorMeasure.IntegrableOn, MeasureTheory.IntegrableOn, - MeasureTheory.integrable_indicator_iff hs, transpose_restrict, variation_restrict hs] - -theorem IntegrableOn.integrable_indicator (h : μ.IntegrableOn f B s) (hs : MeasurableSet s) : - μ.Integrable (indicator s f) B := - (integrable_indicator_iff hs).2 h - /-- For a function `f` and a measurable set `s`, the integral of `indicator s f` over the whole space is equal to `∫ᵛ x in s, f x ∂[B; μ]` defined as `∫ᵛ x, f x ∂[B; μ.restrict s]`. -/ theorem integral_indicator (hs : MeasurableSet s) : ∫ᵛ x, indicator s f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - by_cases hfi : μ.IntegrableOn f B s; swap + by_cases hfi : μ.IntegrableOn f s; swap · rw [integral_undef hfi, integral_undef] rw [integrable_indicator_iff hs] simpa [transpose_restrict, variation_restrict hs] using hfi @@ -177,9 +180,9 @@ theorem integral_indicator (hs : MeasurableSet s) : (setIntegral_add_compl hs (hfi.integrable_indicator hs)).symm _ = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, 0 ∂[B; μ] := by apply congr_arg₂ (· + ·) (integral_congr_ae ?_) (integral_congr_ae ?_) - · rw [transpose_restrict, variation_restrict hs] + · rw [variation_restrict hs] exact indicator_ae_eq_restrict hs - · rw [transpose_restrict, variation_restrict hs.compl] + · rw [variation_restrict hs.compl] exact indicator_ae_eq_restrict_compl hs _ = ∫ᵛ x in s, f x ∂[B; μ] := by simp @@ -188,7 +191,7 @@ theorem setIntegral_indicator (hs : MeasurableSet s) (ht : MeasurableSet t) : rw [integral_indicator ht, μ.restrict_restrict ht hs, Set.inter_comm] theorem setIntegral_congr_set - (hs : MeasurableSet s) (ht : MeasurableSet t) (hst : s =ᵐ[(μ.transpose B).variation] t) : + (hs : MeasurableSet s) (ht : MeasurableSet t) (hst : s =ᵐ[μ.variation] t) : ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x in t, f x ∂[B; μ] := by rw [← integral_indicator hs, ← integral_indicator ht] apply integral_congr_ae @@ -198,32 +201,32 @@ theorem setIntegral_congr_set grind theorem integral_piecewise [DecidablePred (· ∈ s)] - (hs : MeasurableSet s) (hf : μ.IntegrableOn f B s) (hg : μ.IntegrableOn g B sᶜ) : + (hs : MeasurableSet s) (hf : μ.IntegrableOn f s) (hg : μ.IntegrableOn g sᶜ) : ∫ᵛ x, s.piecewise f g x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in sᶜ, g x ∂[B; μ] := by rw [← Set.indicator_add_compl_eq_piecewise, integral_add (hf.integrable_indicator hs) (hg.integrable_indicator hs.compl), integral_indicator hs, integral_indicator hs.compl] theorem setIntegral_eq_zero_of_ae_eq_zero - (ht_eq : ∀ᵐ x ∂(μ.transpose B).variation, x ∈ t → f x = 0) : + (ht_eq : ∀ᵐ x ∂μ.variation, x ∈ t → f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = 0 := by by_cases ht : MeasurableSet t; swap · simp [setIntegral_eq_zero_of_not_measurableSet ht] - by_cases hf : AEStronglyMeasurable f ((μ.restrict t).transpose B).variation; swap + by_cases hf : AEStronglyMeasurable f (μ.restrict t).variation; swap · rw [integral_undef] contrapose hf exact hf.1 - simp only [transpose_restrict, variation_restrict ht] at hf + simp only [variation_restrict ht] at hf have : ∫ᵛ x in t, hf.mk f x ∂[B; μ] = 0 := by refine integral_eq_zero_of_ae ?_ - simp only [transpose_restrict, variation_restrict ht] + simp only [variation_restrict ht] apply (ae_restrict_iff' ht).2 filter_upwards [ae_imp_of_ae_restrict hf.ae_eq_mk, ht_eq] with x hx h'x h''x rw [← hx h''x] exact h'x h''x rw [← this] apply integral_congr_ae - simp only [transpose_restrict, variation_restrict ht] + simp only [variation_restrict ht] exact hf.ae_eq_mk theorem setIntegral_eq_zero_of_forall_eq_zero (ht_eq : ∀ x ∈ t, f x = 0) : @@ -231,11 +234,11 @@ theorem setIntegral_eq_zero_of_forall_eq_zero (ht_eq : ∀ x ∈ t, f x = 0) : setIntegral_eq_zero_of_ae_eq_zero (Eventually.of_forall ht_eq) theorem frequently_ae_ne_zero_of_setIntegral_ne_zero (hU : ∫ᵛ x in t, f x ∂[B; μ] ≠ 0) : - ∃ᶠ x in ae ((μ.transpose B).variation.restrict t), f x ≠ 0 := by + ∃ᶠ x in ae (μ.variation.restrict t), f x ≠ 0 := by have ht : MeasurableSet t := by contrapose! hU simp [setIntegral_eq_zero_of_not_measurableSet hU] - rw [← variation_restrict ht, ← transpose_restrict] + rw [← variation_restrict ht] exact frequently_ae_ne_zero_of_integral_ne_zero hU theorem exists_ne_zero_of_setIntegral_ne_zero (hU : ∫ᵛ x in t, f x ∂[B; μ] ≠ 0) : @@ -243,14 +246,14 @@ theorem exists_ne_zero_of_setIntegral_ne_zero (hU : ∫ᵛ x in t, f x ∂[B; μ contrapose! hU; exact setIntegral_eq_zero_of_forall_eq_zero hU theorem setIntegral_of_variation_apply_eq_zero (f : X → E) {s : Set X} - (hs : (μ.transpose B).variation s = 0) : + (hs : μ.variation s = 0) : ∫ᵛ x in s, f x ∂[B; μ] = 0 := by by_cases h's : MeasurableSet s; swap · simp [restrict_not_measurable μ h's] - have : ((μ.restrict s).transpose B).variation = 0 := by - rw [transpose_restrict, variation_restrict h's] + have : (μ.restrict s).variation = 0 := by + rw [variation_restrict h's] apply Measure.restrict_eq_zero.2 hs - have : (μ.restrict s).transpose B = 0 := variation_eq_zero.1 this + have : μ.restrict s = 0 := variation_eq_zero.1 this simp [integral_eq_setToFun, this] theorem setIntegral_dirac' {mX : MeasurableSpace X} [CompleteSpace G] {a : X} {v : F} @@ -278,7 +281,7 @@ theorem integral_singleton [MeasurableSingletonClass X] {a : X} [CompleteSpace G simp only [restrict_singleton, integral_dirac] theorem setIntegral_union_eq_left_of_ae (hs : MeasurableSet s) (ht : MeasurableSet t) - (ht_eq : ∀ᵐ x ∂(μ.transpose B).variation.restrict t, f x = 0) : + (ht_eq : ∀ᵐ x ∂μ.variation.restrict t, f x = 0) : ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by classical rw [← integral_indicator hs, ← integral_indicator (hs.union ht)] @@ -296,7 +299,7 @@ theorem setIntegral_union_eq_left_of_forall (hs : MeasurableSet s) (ht : Measura filter_upwards with x using ht_eq x theorem setIntegral_eq_of_subset_of_ae_diff_eq_zero (hs : MeasurableSet s) (ht : MeasurableSet t) - (hts : s ⊆ t) (h't : ∀ᵐ x ∂(μ.transpose B).variation.restrict (t \ s), f x = 0) : + (hts : s ⊆ t) (h't : ∀ᵐ x ∂μ.variation.restrict (t \ s), f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by rwa [← union_diff_cancel hts, setIntegral_union_eq_left_of_ae hs (ht.diff hs)] @@ -312,7 +315,7 @@ theorem setIntegral_eq_of_subset_of_forall_diff_eq_zero /-- If a function vanishes almost everywhere on `sᶜ`, then its integral on `s` coincides with its integral on the whole space. -/ theorem setIntegral_eq_integral_of_ae_compl_eq_zero (hs : MeasurableSet s) - (h : ∀ᵐ x ∂(μ.transpose B).variation, x ∉ s → f x = 0) : + (h : ∀ᵐ x ∂μ.variation, x ∉ s → f x = 0) : ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by symm nth_rw 1 [← setIntegral_univ] @@ -327,25 +330,25 @@ theorem setIntegral_eq_integral_of_forall_compl_eq_zero (hs : MeasurableSet s) ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := setIntegral_eq_integral_of_ae_compl_eq_zero hs (Eventually.of_forall h) -theorem setIntegral_const [CompleteSpace G] [IsFiniteMeasure ((μ.transpose B).variation.restrict s)] +theorem setIntegral_const [CompleteSpace G] [IsFiniteMeasure (μ.variation.restrict s)] (c : E) : ∫ᵛ _ in s, c ∂[B; μ] = B c (μ s) := by by_cases hs : MeasurableSet s - · have : IsFiniteMeasure ((μ.restrict s).transpose B).variation := by - rwa [transpose_restrict, variation_restrict hs] + · have : IsFiniteMeasure (μ.restrict s).variation := by + rwa [variation_restrict hs] rw [integral_const, restrict_apply _ hs MeasurableSet.univ, univ_inter] · simp [setIntegral_eq_zero_of_not_measurableSet hs, μ.not_measurable' hs] @[simp] theorem integral_indicator_const [CompleteSpace G] - (e : E) ⦃s : Set X⦄ [IsFiniteMeasure ((μ.transpose B).variation.restrict s)] + (e : E) ⦃s : Set X⦄ [IsFiniteMeasure (μ.variation.restrict s)] (s_meas : MeasurableSet s) : ∫ᵛ x, s.indicator (fun _ : X ↦ e) x ∂[B; μ] = B e (μ s) := by rw [integral_indicator s_meas, ← setIntegral_const] theorem setIntegral_map {β : Type*} [MeasurableSpace β] {φ : X → β} (hφ : Measurable φ) {f : β → E} {s : Set β} (hs : MeasurableSet s) - (hfm : AEStronglyMeasurable f (((μ.restrict (φ ⁻¹' s)).transpose B).variation.map φ)) - (hfi' : μ.Integrable (f ∘ φ) B) : + (hfm : AEStronglyMeasurable f ((μ.restrict (φ ⁻¹' s)).variation.map φ)) + (hfi' : μ.Integrable (f ∘ φ)) : ∫ᵛ y in s, f y ∂[B; μ.map φ] = ∫ᵛ x in φ ⁻¹' s, f (φ x) ∂[B; μ] := by rw [restrict_map μ hφ hs, integral_map hφ hfm hfi'.integrableOn] @@ -366,9 +369,69 @@ theorem setIntegral_map_equiv {β : Type*} [MeasurableSpace β] {e : X ≃ᵐ β ∫ᵛ y in s, f y ∂[B; μ.map e] = ∫ᵛ x in e ⁻¹' s, f (e x) ∂[B; μ] := e.measurableEmbedding.setIntegral_map_vectorMeasure hs + +#check ContinuousLinearMap.bilinearComp_zero_right + +open ContinuousLinearMap + +#check continuous_integral + +theorem foo (C : G →L[ℝ] H) : + ∫ᵛ y, f y ∂[((compL ℝ F G H C) ∘L B); μ] = C (∫ᵛ y, f y ∂[B; μ]) := by + sorry + +theorem bar {f : X → H} (C : H →L[ℝ] E) (hf : Integrable f μ.variation) : + ∫ᵛ y, C (f y) ∂[B; μ] = ∫ᵛ y, f y ∂[B ∘L C; μ] := by + by_cases hG : CompleteSpace G; swap + · simp [integral_of_not_completeSpace hG] + apply hf.induction (P := fun f ↦ ∫ᵛ y, C (f y) ∂[B; μ] = ∫ᵛ y, f y ∂[B ∘L C; μ]) + · intro c s hs hc + have : IsFiniteMeasure (μ.variation.restrict s) := ⟨by simpa⟩ + rw [integral_indicator_const _ hs] + have : (fun y ↦ C (s.indicator (fun x ↦ c) y)) = s.indicator (fun x ↦ C c) := by + ext; simp only [indicator]; grind + simp_rw [this] + rw [integral_indicator_const _ hs] + rfl + · intro f g _ f_int g_int hf hg + simp only [Pi.add_apply, _root_.map_add] + rw [integral_fun_add (C.integrable_comp f_int) (C.integrable_comp g_int), hf, hg, + integral_fun_add f_int g_int] + · apply isClosed_eq + · sorry + · apply continuous_integral + · intro f g hfg _ hf + have : ∀ᵐ x ∂μ.variation, C (f x) = C (g x) := by + filter_upwards [hfg] with x hx using by simp [hx] + rw [← integral_congr_ae hfg, ← integral_congr_ae this, hf] + + + +#exit + + +theorem integral_comp_commSL [CompleteSpace E] (hσ : ∀ (r : ℝ) (x : 𝕜), σ (r • x) = r • σ x) + (L : E →SL[σ] F) {φ : X → E} (φ_int : Integrable φ μ) : ∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ) := by + apply φ_int.induction (P := fun φ => ∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ)) + · intro e s s_meas _ + rw [integral_indicator_const e s_meas, ← @smul_one_smul E ℝ 𝕜 _ _ _ _ _ (μ.real s) e, + map_smulₛₗ, hσ, map_one, smul_assoc, one_smul, + ← integral_indicator_const (L e) s_meas] + congr 1 with a + rw [← Function.comp_def L, Set.indicator_comp_of_zero L.map_zero, Function.comp_apply] + · intro f g _ f_int g_int hf hg + simp [L.map_add, integral_add (μ := μ) f_int g_int, + integral_add (μ := μ) (L.integrable_comp f_int) (L.integrable_comp g_int), hf, hg] + · exact isClosed_eq L.continuous_integral_comp_L1 (L.continuous.comp continuous_integral) + · intro f g hfg _ hf + convert! hf using 1 <;> clear hf + · exact integral_congr_ae (hfg.fun_comp L).symm + · rw [integral_congr_ae hfg.symm] + + theorem enorm_setIntegral_le_of_enorm_le_const_ae {C : ℝ≥0∞} - (hC : ∀ᵐ x ∂(μ.transpose B).variation.restrict s, ‖f x‖ₑ ≤ C) : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * (μ.transpose B).variation s := by + (hC : ∀ᵐ x ∂μ.variation.restrict s, ‖f x‖ₑ ≤ C) : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * μ.variation s := by by_cases hs : MeasurableSet s; swap · simp [setIntegral_eq_zero_of_not_measurableSet hs] rw [← variation_restrict hs, ← transpose_restrict] at hC @@ -378,7 +441,7 @@ theorem enorm_setIntegral_le_of_enorm_le_const_ae {C : ℝ≥0∞} theorem enorm_setIntegral_le_of_enorm_le_const {C : ℝ≥0∞} (hC : ∀ x ∈ s, ‖f x‖ₑ ≤ C) : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * (μ.transpose B).variation s := by + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * μ.variation s := by by_cases hs : MeasurableSet s; swap · simp [setIntegral_eq_zero_of_not_measurableSet hs] apply enorm_setIntegral_le_of_enorm_le_const_ae @@ -386,14 +449,14 @@ theorem enorm_setIntegral_le_of_enorm_le_const {C : ℝ≥0∞} filter_upwards with x using hC x theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} - [h : IsFiniteMeasure ((μ.transpose B).variation.restrict s)] - (hC : ∀ᵐ x ∂(μ.transpose B).variation.restrict s, ‖f x‖ ≤ C) : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * (μ.transpose B).variation.real s := by + [h : IsFiniteMeasure (μ.variation.restrict s)] + (hC : ∀ᵐ x ∂μ.variation.restrict s, ‖f x‖ ≤ C) : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.variation.real s := by by_cases hs : MeasurableSet s; swap · simp only [setIntegral_eq_zero_of_not_measurableSet hs, norm_zero] - by_cases h's : (μ.transpose B).variation s = 0 + by_cases h's : μ.variation s = 0 · simp [Measure.real, h's] - · have : NeBot (ae ((μ.transpose B).variation.restrict s)) := by simpa using h's + · have : NeBot (ae (μ.variation.restrict s)) := by simpa using h's obtain ⟨x, hx⟩ : ∃ x, ‖f x‖ ≤ C := hC.exists have : 0 ≤ C := le_trans (norm_nonneg _) hx positivity @@ -402,9 +465,9 @@ theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} simp [transpose_restrict, variation_restrict hs] theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} - [h : IsFiniteMeasure ((μ.transpose B).variation.restrict s)] + [h : IsFiniteMeasure (μ.variation.restrict s)] (hC : ∀ x ∈ s, ‖f x‖ ≤ C) : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * (μ.transpose B).variation.real s := by + ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.variation.real s := by rcases eq_empty_or_nonempty s with rfl | ⟨x, hx⟩ · simp by_cases hs : MeasurableSet s; swap @@ -415,18 +478,18 @@ theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} filter_upwards [ae_restrict_mem hs] with x hx using hC x hx theorem enorm_setIntegral_le_lintegral_enorm : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x in s, ‖f x‖ₑ ∂(μ.transpose B).variation := by + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x in s, ‖f x‖ₑ ∂μ.variation := by grw [enorm_integral_le_lintegral_enorm, transpose_restrict] exact lintegral_mono' variation_restrict_le le_rfl private theorem hasSum_setIntegral_iUnion_nat {s : ℕ → Set X} (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) - (hfi : μ.IntegrableOn f B (⋃ i, s i)) : + (hfi : μ.IntegrableOn f (⋃ i, s i)) : HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by by_cases hG : CompleteSpace G; swap · simp [integral_of_not_completeSpace hG] - have I : ∑' i, ∫⁻ x in s i, ‖f x‖ₑ ∂(μ.transpose B).variation < ∞ := calc - _ = ∫⁻ x in (⋃ i, s i), ‖f x‖ₑ ∂(μ.transpose B).variation := (lintegral_iUnion hm hd _).symm + have I : ∑' i, ∫⁻ x in s i, ‖f x‖ₑ ∂μ.variation < ∞ := calc + _ = ∫⁻ x in (⋃ i, s i), ‖f x‖ₑ ∂μ.variation := (lintegral_iUnion hm hd _).symm _ < ∞ := by simp only [VectorMeasure.IntegrableOn, VectorMeasure.Integrable, transpose_restrict, variation_restrict (MeasurableSet.iUnion hm)] at hfi @@ -464,7 +527,7 @@ private theorem hasSum_setIntegral_iUnion_nat {s : ℕ → Set X} theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) - (hfi : μ.IntegrableOn f B (⋃ i, s i)) : + (hfi : μ.IntegrableOn f (⋃ i, s i)) : HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by classical rcases finite_or_infinite ι with hι | hι @@ -480,7 +543,7 @@ theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} rwa [e.symm.surjective.iUnion_comp] theorem integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i)) - (hd : Pairwise (Disjoint on s)) (hfi : μ.IntegrableOn f B (⋃ i, s i)) : + (hd : Pairwise (Disjoint on s)) (hfi : μ.IntegrableOn f (⋃ i, s i)) : ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑' n, ∫ᵛ x in s n, f x ∂[B; μ] := (HasSum.tsum_eq (hasSum_setIntegral_iUnion hm hd hfi)).symm @@ -490,10 +553,10 @@ theorem integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ rw [← integral_toSignedMeasure, restrict_toSignedMeasure hs] /-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: -it tends to zero as `(μ.transpose B).variation s` tends to zero. -/ +it tends to zero as `μ.variation s` tends to zero. -/ theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} (hf : μ.Integrable f B) {l : Filter ι} {s : ι → Set X} - (hs : Tendsto ((μ.transpose B).variation ∘ s) l (𝓝 0)) : + (hs : Tendsto (μ.variation ∘ s) l (𝓝 0)) : Tendsto (fun i ↦ ∫ᵛ x in s i, f x ∂[B; μ]) l (𝓝 0) := by rw [tendsto_zero_iff_norm_tendsto_zero] simp_rw [← coe_nnnorm, ← NNReal.coe_zero, NNReal.tendsto_coe, ← ENNReal.tendsto_coe, @@ -508,9 +571,9 @@ theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) - (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} + (hfi : AEStronglyMeasurable f μ.variation) {F : ι → X → E} {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) - (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂(μ.transpose B).variation) l (𝓝 0)) + (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂μ.variation) l (𝓝 0)) (s : Set X) : Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by refine tendsto_integral_of_L1 f ?_ ?_ ?_ @@ -526,9 +589,9 @@ lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) - (hfi : AEStronglyMeasurable f (μ.transpose B).variation) {F : ι → X → E} + (hfi : AEStronglyMeasurable f μ.variation) {F : ι → X → E} {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) - (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 (μ.transpose B).variation) l (𝓝 0)) + (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ.variation) l (𝓝 0)) (s : Set X) : Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by refine tendsto_setIntegral_of_L1 f hfi hFi ?_ s From 4a4d54d734c391921701b6fa1dcd9e87151933a3 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 13 Jun 2026 11:52:32 +0200 Subject: [PATCH 118/129] better --- Mathlib/Analysis/Normed/Operator/Mul.lean | 19 +++ .../VectorMeasure/AddContent.lean | 11 +- .../VectorMeasure/SetIntegral.lean | 122 ++++++++---------- 3 files changed, 79 insertions(+), 73 deletions(-) diff --git a/Mathlib/Analysis/Normed/Operator/Mul.lean b/Mathlib/Analysis/Normed/Operator/Mul.lean index 1ed482a0a80254..3cf11c69837973 100644 --- a/Mathlib/Analysis/Normed/Operator/Mul.lean +++ b/Mathlib/Analysis/Normed/Operator/Mul.lean @@ -221,6 +221,10 @@ theorem opNNNorm_lsmul_le : ‖(lsmul 𝕜 R : R →L[𝕜] E →L[𝕜] E)‖ rw [← NNReal.coe_le_coe] simpa using opNorm_lsmul_le +theorem opENorm_lsmul_le : ‖(lsmul 𝕜 R : R →L[𝕜] E →L[𝕜] E)‖ₑ ≤ 1 := by + rw [enorm_eq_nnnorm] + simpa using opNNNorm_lsmul_le + end SMulLinear end ContinuousLinearMap @@ -247,6 +251,10 @@ theorem opNorm_mul : ‖mul 𝕜 R‖ = 1 := theorem opNNNorm_mul : ‖mul 𝕜 R‖₊ = 1 := Subtype.ext <| opNorm_mul 𝕜 R +@[simp] +theorem opENorm_mul : ‖mul 𝕜 R‖ₑ = 1 := by + simp [enorm_eq_nnnorm] + end /-- The norm of `lsmul` equals 1 in any nontrivial normed group. @@ -268,6 +276,11 @@ theorem opNNNorm_lsmul [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Module R E rw [← NNReal.coe_inj] simp +@[simp] +theorem opENorm_lsmul [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Module R E] [NormSMulClass R E] + [IsScalarTower 𝕜 R E] [Nontrivial E] : ‖(lsmul 𝕜 R : R →L[𝕜] E →L[𝕜] E)‖ₑ = 1 := by + simp [enorm_eq_nnnorm] + /-- The norm of `lsmul x` equals `‖x‖` in any nontrivial normed group. This is `ContinuousLinearMap.opNorm_lsmul_apply_le` as an equality. -/ @@ -288,6 +301,12 @@ theorem opNNNorm_lsmul_apply [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Modu rw [← NNReal.coe_inj] simp +@[simp] +theorem opENorm_lsmul_apply [NormedDivisionRing R] [NormedAlgebra 𝕜 R] [Module R E] + [NormSMulClass R E] [IsScalarTower 𝕜 R E] [Nontrivial E] {a : R} : + ‖(lsmul 𝕜 R a : E →L[𝕜] E)‖ₑ = ‖a‖ₑ := by + simp [enorm_eq_nnnorm] + end ContinuousLinearMap end Normed diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index 94b12649f00a6b..bd5d121c7ea6d9 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -333,9 +333,7 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] apply exists_extension_of_isSetSemiring_of_le_measure_of_generateFrom hC (fun s hs ↦ ?_) rfl apply (hm s hs).trans_eq exact (MeasureTheory.trim_measurableSet_eq Mle (measurableSet_generateFrom hs)).symm - have m'_le : (m'.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation ≤ μ' := by - apply (variation_transpose_le _ _).trans - grw [ContinuousLinearMap.opNNNorm_lsmul_le, one_smul] + have m'_le : m'.variation ≤ μ' := by exact variation_le_of_forall_enorm_le (fun s hs ↦ hm' _) -- next line is to make sure that the default instance is picked below when defininig `m''`. let : MeasurableSpace α := hα @@ -372,8 +370,11 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] apply ne_of_lt (lt_of_le_of_lt ?_ I) gcongr with i apply enorm_integral_le_lintegral_enorm.trans - apply (lintegral_mono' m'_le le_rfl).trans_eq - rw [hμ', lintegral_trim _ (by fun_prop)] } + grw [lintegral_mono' m'_le le_rfl] + rw [hμ', lintegral_trim _ (by fun_prop)] + apply mul_le_of_le_one_left (by positivity) + apply ContinuousLinearMap.opENorm_lsmul_le + } refine ⟨m'', fun s hs ↦ ?_, fun s ↦ ?_⟩ · simp only [h'C s hs, ↓reduceIte, m''] have : ∫ᵛ (x : α), μ[s.indicator 1 | M] x ∂•m' = ∫ᵛ (x : α), s.indicator 1 x ∂•m' := by diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index d022b45bcb92d0..4794aaf5509806 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -20,14 +20,11 @@ The API in this file is modelled on the API for the Bochner integral. assert_not_exists InnerProductSpace -open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology +open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology ContinuousLinearMap open scoped ENNReal NNReal Finset variable {ι X E F G H : Type*} {mX : MeasurableSpace X} - [NormedAddCommGroup E] - [NormedAddCommGroup F] - [NormedAddCommGroup G] - [NormedAddCommGroup H] + [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G] [NormedAddCommGroup H] {μ ν : VectorMeasure X F} {f g : X → E} {s t : Set X} namespace MeasureTheory.VectorMeasure @@ -369,18 +366,25 @@ theorem setIntegral_map_equiv {β : Type*} [MeasurableSpace β] {e : X ≃ᵐ β ∫ᵛ y in s, f y ∂[B; μ.map e] = ∫ᵛ x in e ⁻¹' s, f (e x) ∂[B; μ] := e.measurableEmbedding.setIntegral_map_vectorMeasure hs +theorem continuousLinearMap_apply_integral + [CompleteSpace G] [CompleteSpace H] + {C : G →L[ℝ] H} (hf : Integrable f μ.variation) : + C (∫ᵛ y, f y ∂[B; μ]) = ∫ᵛ y, f y ∂[((compL ℝ F G H C) ∘L B); μ] := by + apply hf.induction (P := fun f ↦ C (∫ᵛ y, f y ∂[B; μ]) = ∫ᵛ y, f y ∂[((compL ℝ F G H C) ∘L B); μ]) + · intro c s hs hc + have : IsFiniteMeasure (μ.variation.restrict s) := ⟨by simpa⟩ + simp [integral_indicator_const _ hs] + · intro f g _ f_int g_int hf hg + simp only [Pi.add_apply] + simp [integral_fun_add, f_int, g_int, hf, hg] + · apply isClosed_eq + · apply C.continuous.comp continuous_integral + · exact continuous_integral + · intro f g hfg _ hf + rw [← integral_congr_ae hfg, ← integral_congr_ae hfg, hf] -#check ContinuousLinearMap.bilinearComp_zero_right - -open ContinuousLinearMap - -#check continuous_integral - -theorem foo (C : G →L[ℝ] H) : - ∫ᵛ y, f y ∂[((compL ℝ F G H C) ∘L B); μ] = C (∫ᵛ y, f y ∂[B; μ]) := by - sorry - -theorem bar {f : X → H} (C : H →L[ℝ] E) (hf : Integrable f μ.variation) : +theorem integral_continuousLinearMap_comp + {f : X → H} {C : H →L[ℝ] E} (hf : Integrable f μ.variation) : ∫ᵛ y, C (f y) ∂[B; μ] = ∫ᵛ y, f y ∂[B ∘L C; μ] := by by_cases hG : CompleteSpace G; swap · simp [integral_of_not_completeSpace hG] @@ -398,50 +402,29 @@ theorem bar {f : X → H} (C : H →L[ℝ] E) (hf : Integrable f μ.variation) : rw [integral_fun_add (C.integrable_comp f_int) (C.integrable_comp g_int), hf, hg, integral_fun_add f_int g_int] · apply isClosed_eq - · sorry - · apply continuous_integral + · have I (f : Lp H 1 μ.variation) : ∫ᵛ x, C (f x) ∂[B; μ] = ∫ᵛ x, (C.compLp f) x ∂[B; μ] := + (integral_congr_ae (coeFn_compLp _ _)).symm + simp_rw [I] + exact continuous_integral.comp (C.compLpL 1 μ.variation).continuous + · exact continuous_integral · intro f g hfg _ hf have : ∀ᵐ x ∂μ.variation, C (f x) = C (g x) := by filter_upwards [hfg] with x hx using by simp [hx] rw [← integral_congr_ae hfg, ← integral_congr_ae this, hf] - - -#exit - - -theorem integral_comp_commSL [CompleteSpace E] (hσ : ∀ (r : ℝ) (x : 𝕜), σ (r • x) = r • σ x) - (L : E →SL[σ] F) {φ : X → E} (φ_int : Integrable φ μ) : ∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ) := by - apply φ_int.induction (P := fun φ => ∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ)) - · intro e s s_meas _ - rw [integral_indicator_const e s_meas, ← @smul_one_smul E ℝ 𝕜 _ _ _ _ _ (μ.real s) e, - map_smulₛₗ, hσ, map_one, smul_assoc, one_smul, - ← integral_indicator_const (L e) s_meas] - congr 1 with a - rw [← Function.comp_def L, Set.indicator_comp_of_zero L.map_zero, Function.comp_apply] - · intro f g _ f_int g_int hf hg - simp [L.map_add, integral_add (μ := μ) f_int g_int, - integral_add (μ := μ) (L.integrable_comp f_int) (L.integrable_comp g_int), hf, hg] - · exact isClosed_eq L.continuous_integral_comp_L1 (L.continuous.comp continuous_integral) - · intro f g hfg _ hf - convert! hf using 1 <;> clear hf - · exact integral_congr_ae (hfg.fun_comp L).symm - · rw [integral_congr_ae hfg.symm] - - theorem enorm_setIntegral_le_of_enorm_le_const_ae {C : ℝ≥0∞} (hC : ∀ᵐ x ∂μ.variation.restrict s, ‖f x‖ₑ ≤ C) : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * μ.variation s := by + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * ‖B‖ₑ * μ.variation s := by by_cases hs : MeasurableSet s; swap · simp [setIntegral_eq_zero_of_not_measurableSet hs] - rw [← variation_restrict hs, ← transpose_restrict] at hC + rw [← variation_restrict hs] at hC apply (enorm_integral_le_of_enorm_le_const hC).trans - rw [transpose_restrict, variation_restrict hs, Measure.restrict_apply MeasurableSet.univ] + rw [variation_restrict hs, Measure.restrict_apply MeasurableSet.univ] simp theorem enorm_setIntegral_le_of_enorm_le_const {C : ℝ≥0∞} (hC : ∀ x ∈ s, ‖f x‖ₑ ≤ C) : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * μ.variation s := by + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ C * ‖B‖ₑ * μ.variation s := by by_cases hs : MeasurableSet s; swap · simp [setIntegral_eq_zero_of_not_measurableSet hs] apply enorm_setIntegral_le_of_enorm_le_const_ae @@ -451,7 +434,7 @@ theorem enorm_setIntegral_le_of_enorm_le_const {C : ℝ≥0∞} theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} [h : IsFiniteMeasure (μ.variation.restrict s)] (hC : ∀ᵐ x ∂μ.variation.restrict s, ‖f x‖ ≤ C) : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.variation.real s := by + ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * ‖B‖ * μ.variation.real s := by by_cases hs : MeasurableSet s; swap · simp only [setIntegral_eq_zero_of_not_measurableSet hs, norm_zero] by_cases h's : μ.variation s = 0 @@ -460,14 +443,14 @@ theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} obtain ⟨x, hx⟩ : ∃ x, ‖f x‖ ≤ C := hC.exists have : 0 ≤ C := le_trans (norm_nonneg _) hx positivity - rw [← variation_restrict hs, ← transpose_restrict] at hC h + rw [← variation_restrict hs] at hC h apply (norm_integral_le_of_norm_le_const hC).trans_eq - simp [transpose_restrict, variation_restrict hs] + simp [variation_restrict hs] theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} [h : IsFiniteMeasure (μ.variation.restrict s)] (hC : ∀ x ∈ s, ‖f x‖ ≤ C) : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * μ.variation.real s := by + ‖∫ᵛ x in s, f x ∂[B; μ]‖ ≤ C * ‖B‖ * μ.variation.real s := by rcases eq_empty_or_nonempty s with rfl | ⟨x, hx⟩ · simp by_cases hs : MeasurableSet s; swap @@ -478,9 +461,8 @@ theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} filter_upwards [ae_restrict_mem hs] with x hx using hC x hx theorem enorm_setIntegral_le_lintegral_enorm : - ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x in s, ‖f x‖ₑ ∂μ.variation := by - grw [enorm_integral_le_lintegral_enorm, transpose_restrict] - exact lintegral_mono' variation_restrict_le le_rfl + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ ‖B‖ₑ * ∫⁻ x in s, ‖f x‖ₑ ∂μ.variation := by + grw [enorm_integral_le_lintegral_enorm, variation_restrict_le] private theorem hasSum_setIntegral_iUnion_nat {s : ℕ → Set X} (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) @@ -488,12 +470,14 @@ private theorem hasSum_setIntegral_iUnion_nat {s : ℕ → Set X} HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by by_cases hG : CompleteSpace G; swap · simp [integral_of_not_completeSpace hG] - have I : ∑' i, ∫⁻ x in s i, ‖f x‖ₑ ∂μ.variation < ∞ := calc - _ = ∫⁻ x in (⋃ i, s i), ‖f x‖ₑ ∂μ.variation := (lintegral_iUnion hm hd _).symm + have I : ∑' i, ‖B‖ₑ * ∫⁻ x in s i, ‖f x‖ₑ ∂μ.variation < ∞ := calc + ∑' i, ‖B‖ₑ * ∫⁻ x in s i, ‖f x‖ₑ ∂μ.variation + _ = ‖B‖ₑ * ∫⁻ x in (⋃ i, s i), ‖f x‖ₑ ∂μ.variation := by + rw [ENNReal.tsum_mul_left, lintegral_iUnion hm hd] _ < ∞ := by - simp only [VectorMeasure.IntegrableOn, VectorMeasure.Integrable, transpose_restrict, + simp only [VectorMeasure.IntegrableOn, VectorMeasure.Integrable, variation_restrict (MeasurableSet.iUnion hm)] at hfi - exact hfi.2 + exact ENNReal.mul_lt_top (by simp) hfi.2 have : Summable (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) := by apply Summable.of_enorm (lt_of_le_of_lt _ I).ne gcongr @@ -522,7 +506,7 @@ private theorem hasSum_setIntegral_iUnion_nat {s : ℕ → Set X} · exact fun i hi ↦ hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) simp only [add_sub_cancel_left] apply enorm_setIntegral_le_lintegral_enorm.trans_eq - rw [lintegral_iUnion (fun i ↦ hm _)] + rw [lintegral_iUnion (fun i ↦ hm _), ENNReal.tsum_mul_left] exact fun i j hij ↦ hd (by grind) theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} @@ -555,42 +539,44 @@ theorem integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ /-- If `f` is integrable, then `∫ᵛ x in s, f x ∂[B; μ]` is absolutely continuous in `s`: it tends to zero as `μ.variation s` tends to zero. -/ theorem Integrable.tendsto_setIntegral_nhds_zero {ι : Type*} - (hf : μ.Integrable f B) {l : Filter ι} {s : ι → Set X} + (hf : μ.Integrable f) {l : Filter ι} {s : ι → Set X} (hs : Tendsto (μ.variation ∘ s) l (𝓝 0)) : Tendsto (fun i ↦ ∫ᵛ x in s i, f x ∂[B; μ]) l (𝓝 0) := by rw [tendsto_zero_iff_norm_tendsto_zero] simp_rw [← coe_nnnorm, ← NNReal.coe_zero, NNReal.tendsto_coe, ← ENNReal.tendsto_coe, ENNReal.coe_zero] - apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds - (tendsto_setLIntegral_zero (ne_of_lt hf.2) hs) (fun i ↦ zero_le) + have : Tendsto (fun i ↦ ‖B‖ₑ * ∫⁻ (x : X) in s i, ‖f x‖ₑ ∂μ.variation) l (𝓝 (‖B‖ₑ * 0)) := + ENNReal.Tendsto.const_mul (tendsto_setLIntegral_zero (ne_of_lt hf.2) hs) (by simp) + rw [mul_zero] at this + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds this (fun i ↦ zero_le) intro i apply enorm_integral_le_lintegral_enorm.trans - apply lintegral_mono' _ le_rfl - rw [transpose_restrict] - apply variation_restrict_le + dsimp + gcongr + exact variation_restrict_le /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ lemma tendsto_setIntegral_of_L1 {ι} (f : X → E) (hfi : AEStronglyMeasurable f μ.variation) {F : ι → X → E} - {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i)) (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖ₑ ∂μ.variation) l (𝓝 0)) (s : Set X) : Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by refine tendsto_integral_of_L1 f ?_ ?_ ?_ · apply hfi.mono_measure - grw [transpose_restrict, variation_restrict_le, Measure.restrict_le_self] + grw [variation_restrict_le, Measure.restrict_le_self] · filter_upwards [hFi] with i hi using hi.restrict · simp_rw [← eLpNorm_one_eq_lintegral_enorm] at hF ⊢ apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hF (fun _ ↦ zero_le) (fun i ↦ ?_) apply eLpNorm_mono_measure - grw [transpose_restrict, variation_restrict_le] + grw [variation_restrict_le] apply Measure.restrict_le_self /-- If `F i → f` in `L1`, then `∫ᵛ x in s, F i x ∂[B; μ] → ∫ᵛ x in s, f x ∂[B; μ]`. -/ lemma tendsto_setIntegral_of_L1' {ι} (f : X → E) (hfi : AEStronglyMeasurable f μ.variation) {F : ι → X → E} - {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i) B) + {l : Filter ι} (hFi : ∀ᶠ i in l, μ.Integrable (F i)) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ.variation) l (𝓝 0)) (s : Set X) : Tendsto (fun i ↦ ∫ᵛ x in s, F i x ∂[B; μ]) l (𝓝 (∫ᵛ x in s, f x ∂[B; μ])) := by From 320876129ac117327809086248a96c867701fbf1 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sat, 13 Jun 2026 22:37:44 +0200 Subject: [PATCH 119/129] better --- .../VectorMeasure/AddContent.lean | 16 +- .../MeasureTheory/VectorMeasure/Basic.lean | 17 ++ .../MeasureTheory/VectorMeasure/Integral.lean | 18 ++ Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 177 +++++++++++++++--- .../VectorMeasure/SetIntegral.lean | 4 + .../VectorMeasure/WithDensityVec.lean | 65 ++++--- 6 files changed, 233 insertions(+), 64 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index bd5d121c7ea6d9..2651403126ba6e 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -369,12 +369,8 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] refine Summable.hasSum (Summable.of_enorm ?_) apply ne_of_lt (lt_of_le_of_lt ?_ I) gcongr with i - apply enorm_integral_le_lintegral_enorm.trans - grw [lintegral_mono' m'_le le_rfl] - rw [hμ', lintegral_trim _ (by fun_prop)] - apply mul_le_of_le_one_left (by positivity) - apply ContinuousLinearMap.opENorm_lsmul_le - } + grw [enorm_integral_le_lintegral_enorm, ContinuousLinearMap.opENorm_lsmul_le, one_mul, + lintegral_mono' m'_le le_rfl, hμ', lintegral_trim _ (by fun_prop)] } refine ⟨m'', fun s hs ↦ ?_, fun s ↦ ?_⟩ · simp only [h'C s hs, ↓reduceIte, m''] have : ∫ᵛ (x : α), μ[s.indicator 1 | M] x ∂•m' = ∫ᵛ (x : α), s.indicator 1 x ∂•m' := by @@ -385,15 +381,15 @@ theorem exists_extension_of_isSetSemiring_of_le_measure [NormedSpace ℝ E] (measurableSet_generateFrom hs) · exact (integrable_const 1).indicator (h'C s hs) rw [this, integral_indicator (measurableSet_generateFrom hs)] - have : IsFiniteMeasure (m'.transpose (ContinuousLinearMap.lsmul ℝ ℝ)).variation := + have : IsFiniteMeasure m'.variation := isFiniteMeasure_of_le _ m'_le simp only [Pi.one_apply, setIntegral_const] simp [m'C s hs] · by_cases hs : MeasurableSet s; swap · simp [not_measurable _ hs] simp only [hs, ↓reduceIte, m''] - apply enorm_integral_le_lintegral_enorm.trans - apply (lintegral_mono' m'_le le_rfl).trans_eq - rw [hμ', lintegral_trim _ (by fun_prop), lintegral_enorm_condExp_indicator Mle hs] + grw [enorm_integral_le_lintegral_enorm, ContinuousLinearMap.opENorm_lsmul_le, one_mul, + lintegral_mono' m'_le le_rfl, hμ', lintegral_trim _ (by fun_prop), + lintegral_enorm_condExp_indicator Mle hs] end MeasureTheory.VectorMeasure diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index d71b608f2b8ca4..ac3b180e970e8b 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -248,6 +248,23 @@ theorem tendsto_vectorMeasure_iInter_atTop_nat exact tendsto_vectorMeasure_iUnion_atTop_nat (fun i j hij ↦ by simpa using hm hij) (fun i ↦ (hs i).compl) +/-- If two vector measures give the same mass to the whole space and coincide on a +generating π-system, then they coincide. -/ +theorem ext_of_generateFrom + {M : Type*} [AddCommGroup M] [TopologicalSpace M] [T2Space M] [ContinuousSub M] + {X : Type*} {mX : MeasurableSpace X} {μ ν : VectorMeasure X M} + (C : Set (Set X)) (hμν : ∀ s ∈ C, μ s = ν s) + (hA : mX = MeasurableSpace.generateFrom C) (hC : IsPiSystem C) + (h_univ : μ Set.univ = ν Set.univ) : μ = ν := by + ext s hs + induction s, hs using MeasurableSpace.induction_on_inter hA hC with + | empty => simp + | basic t ht => exact hμν t ht + | compl t htm iht => + simp [of_compl, iht, htm, h_univ] + | iUnion f hfd hfm ihf => + simp [of_disjoint_iUnion, hfm, hfd, ihf] + end section SMul diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 281b3d377b3886..bca065e9f14d07 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -126,6 +126,12 @@ theorem dominatedFinMeasAdditive_cbmApplyMeasure (μ : VectorMeasure X F) (B : E gcongr exact norm_measure_le_variation hsf.ne +theorem dominatedFinMeasAdditive_transpose_cbmApplyMeasure + (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : + DominatedFinMeasAdditive (μ.transpose B).variation (μ.transpose B) 1 := by + refine ⟨fun s t hs ht _ _ hdisj ↦ cbmApplyMeasure_union μ B hs ht hdisj, fun s hs hsf ↦ ?_⟩ + simpa using! norm_measure_le_variation hsf.ne + end cbmApplyMeasure namespace VectorMeasure @@ -280,6 +286,11 @@ variable {μ ν B} lemma integral_eq_setToFun : ∫ᵛ x, f x ∂[B; μ] = setToFun μ.variation (μ.transpose B) (dominatedFinMeasAdditive_cbmApplyMeasure μ B) f := by rfl +lemma integral_eq_setToFun_transpose (hf : μ.Integrable f) : + ∫ᵛ x, f x ∂[B; μ] = setToFun (μ.transpose B).variation (μ.transpose B) + (dominatedFinMeasAdditive_transpose_cbmApplyMeasure μ B) f := + setToFun_congr_measure_of_integrable _ (by simp) (variation_transpose_le _ _) _ _ _ hf + theorem integral_of_not_completeSpace (hG : ¬CompleteSpace G) : ∫ᵛ x, f x ∂[B; μ] = 0 := by simp [integral, setToFun, hG] @@ -623,6 +634,13 @@ theorem enorm_integral_le_lintegral_enorm : gcongr simp [← coe_nnnorm] +theorem enorm_integral_le_lintegral_enorm_transpose : + ‖∫ᵛ a, f a ∂[B; μ]‖ₑ ≤ ∫⁻ a, ‖f a‖ₑ ∂(μ.transpose B).variation := by + by_cases hf : μ.Integrable f + · rw [integral_eq_setToFun_transpose hf] + apply (enorm_setToFun_le _ (by simp)).trans (by simp) + · simp [integral_undef hf] + theorem dist_integral_le_lintegral_edist (hf : μ.Integrable f) (hg : μ.Integrable g) : dist (∫ᵛ a, f a ∂[B; μ]) (∫ᵛ a, g a ∂[B; μ]) ≤ ‖B‖ * (∫⁻ a, edist (f a) (g a) ∂μ.variation).toReal := by diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 13c2a499e8cb7a..b0679b8a85de5d 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -42,10 +42,14 @@ noncomputable def prod (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E /-- Two vector measures `μ` and `ν` have a product with respect to `B` if there exists a measure giving mass `B (μ s) (ν t)` to any measurable product `s × t`. This is satisfied whenever `μ` or `ν` has finite variation. -/ -class HasProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) where +class HasProd (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) : Prop where exists_prod : ∃ ρ : VectorMeasure (X × Y) G, ∀ (s : Set X) (t : Set Y), MeasurableSet s → MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t) +lemma prod_eq_zero_of_not_hasProd (h : ¬HasProd μ ν B) : + μ.prod ν B = 0 := by + grind [HasProd, prod] + @[simp] lemma prod_apply [h : HasProd μ ν B] {s : Set X} {t : Set Y} : μ.prod ν B (s ×ˢ t) = B (μ s) (ν t) := by rcases eq_or_ne s ∅ with rfl | hs @@ -98,7 +102,7 @@ integrating the measure of the fibers, as in the definition of the product of po which uses the typeclass instance. -/ noncomputable def prodOfIsFiniteMeasureLeft (μ : VectorMeasure X E) (ν : VectorMeasure Y F) (B : E →L[ℝ] F →L[ℝ] G) - [IsFiniteMeasure (μ.transpose B.flip).variation] : + [IsFiniteMeasure μ.variation] : VectorMeasure (X × Y) G where measureOf' s := if MeasurableSet s then ∫ᵛ x, ν (Prod.mk x ⁻¹' s) ∂[B.flip; μ] else 0 empty' := by simp @@ -110,7 +114,7 @@ noncomputable def prodOfIsFiniteMeasureLeft = ∫ᵛ x, ∑ y ∈ a, ν (Prod.mk x ⁻¹' f y) ∂[B.flip; μ] := by rw [integral_finsetSum] intro i hi - refine Integrable.of_bound (μ := (μ.transpose B.flip).variation) ?_ ν.bound ?_ + refine Integrable.of_bound (μ := μ.variation) ?_ ν.bound ?_ · exact (stronglyMeasurable_vectorMeasure_prodMk_left (f_meas i)).aestronglyMeasurable · exact Eventually.of_forall (fun x ↦ norm_apply_le_bound) simp_rw [A] @@ -131,21 +135,129 @@ noncomputable def prodOfIsFiniteMeasureLeft · exact fun i ↦ measurable_prodMk_left (f_meas i) · exact fun i j hij ↦ (f_disj hij).preimage _ -instance [CompleteSpace G] [IsFiniteMeasure (μ.transpose B.flip).variation] : HasProd μ ν B where +instance [CompleteSpace G] [IsFiniteMeasure μ.variation] : HasProd μ ν B where exists_prod := by classical refine ⟨prodOfIsFiniteMeasureLeft μ ν B, fun s t hs ht ↦ ?_⟩ simp only [prodOfIsFiniteMeasureLeft, hs.prod ht, ↓reduceIte, mk_preimage_prod_right_eq_if, of_if, integral_indicator hs, setIntegral_const, ContinuousLinearMap.flip_apply] -instance [CompleteSpace G] [h : IsFiniteMeasure (ν.transpose B).variation] : HasProd μ ν B := by - rw [← B.flip_flip] at h ⊢ +instance [CompleteSpace G] [h : IsFiniteMeasure ν.variation] : HasProd μ ν B := by + rw [← B.flip_flip] apply HasProd.flip +lemma prod_eq {ρ : VectorMeasure (X × Y) G} (hρ : ∀ (s : Set X) (t : Set Y), + MeasurableSet s → MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t)) : + μ.prod ν B = ρ := by + have : HasProd μ ν B := ⟨ρ, hρ⟩ + apply ext_of_generateFrom _ _ generateFrom_prod.symm isPiSystem_prod + · rw [← univ_prod_univ, hρ _ _ MeasurableSet.univ MeasurableSet.univ, prod_apply] + · rintro - ⟨s, hs, t, ht, rfl⟩ + rw [prod_apply, hρ _ _ hs ht] + +lemma prod_apply_eq_integral [CompleteSpace G] [IsFiniteMeasure μ.variation] + {s : Set (X × Y)} (hs : MeasurableSet s) : + μ.prod ν B s = ∫ᵛ x, ν (Prod.mk x ⁻¹' s) ∂[B.flip; μ] := by + have : μ.prod ν B = prodOfIsFiniteMeasureLeft μ ν B := by + classical + apply prod_eq (fun s t hs ht ↦ ?_) + simp only [prodOfIsFiniteMeasureLeft, hs.prod ht, ↓reduceIte, mk_preimage_prod_right_eq_if, + of_if, integral_indicator hs, setIntegral_const, ContinuousLinearMap.flip_apply] + rw [this] + simp [prodOfIsFiniteMeasureLeft, hs] + +lemma compl_prod_eq_union' {α β : Type*} (s : Set α) (t : Set β) : + (s ×ˢ t)ᶜ = (sᶜ ×ˢ tᶜ) ∪ (s ×ˢ tᶜ) ∪ (sᶜ ×ˢ t) := by + grind + +lemma variation_prod_le [SFinite ν.variation] : + (μ.prod ν B).variation ≤ ‖B‖ₑ • μ.variation.prod ν.variation := by + by_cases h : HasProd μ ν B; swap + · simp [prod_eq_zero_of_not_hasProd h, Measure.zero_le] + have A (s : Set X) (t : Set Y) : + ‖(B (μ s)) (ν t)‖ₑ ≤ ‖B‖ₑ * (μ.variation s * ν.variation t) := by + grw [ContinuousLinearMap.le_opENorm, ContinuousLinearMap.le_opENorm, enorm_measure_le_variation, + enorm_measure_le_variation, ← mul_assoc] + apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + suffices ‖(μ.prod ν B) s‖ₑ ≤ (‖B‖ₑ • μ.variation.prod ν.variation) s ∧ + ‖(μ.prod ν B) sᶜ‖ₑ ≤ (‖B‖ₑ • μ.variation.prod ν.variation) sᶜ from this.1 + induction s, hs + using MeasurableSpace.induction_on_inter generateFrom_prod.symm isPiSystem_prod with + | empty => simpa [← univ_prod_univ] using A univ univ + | basic s hs => + obtain ⟨s, hs, t, ht, rfl⟩ := hs + simp only [prod_apply, Measure.smul_apply, Measure.prod_prod, smul_eq_mul, A, true_and] + rw [compl_prod_eq_union', of_union (by grind), of_union (by grind), measure_union (by grind), + measure_union (by grind)]; rotate_left + · exact hs.prod ht.compl + · exact hs.compl.prod ht + · exact hs.compl.prod ht.compl + · exact hs.prod ht.compl + · exact (hs.compl.prod ht.compl).union (hs.prod ht.compl) + · exact hs.compl.prod ht + grw [enorm_add_le, enorm_add_le] + simp only [prod_apply, Measure.prod_prod, mul_add] + grw [A, A, A] + | compl s hs ihs => + simp only [Measure.smul_apply, smul_eq_mul, compl_compl] at ihs ⊢ + grind + | iUnion f hfd hfm ihf => + constructor + · have : Tendsto (fun n ↦ μ.prod ν B (accumulate f n)) atTop + (𝓝 (μ.prod ν B (⋃ n, accumulate f n))) := by + apply tendsto_vectorMeasure_iUnion_atTop_nat monotone_accumulate + exact fun i ↦ MeasurableSet.biUnion (to_countable _) (fun i hi ↦ hfm _) + rw [iUnion_accumulate] at this + apply le_of_tendsto this.enorm + filter_upwards with n + have : accumulate f n = ⋃ i ∈ Finset.Iic n, f i := by ext; simp [accumulate] + rw [this, of_biUnion_finset (fun i hi j hj hij ↦ hfd hij) (fun i hi ↦ hfm i)] + grw [enorm_sum_le, (ihf _).1] + simp only [Measure.smul_apply, smul_eq_mul, ← Finset.mul_sum] + rw [← measure_biUnion_finset (fun i hi j hj hij ↦ hfd hij) (fun i hi ↦ hfm i)] + gcongr 2 + exact iUnion₂_subset_iUnion _ _ + · simp_rw [compl_iUnion] + let g := fun i ↦ (f i)ᶜ + have hgm i : MeasurableSet (g i) := (hfm i).compl + have I : Tendsto (fun n ↦ μ.prod ν B (dissipate g n)) atTop + (𝓝 (μ.prod ν B (⋂ n, dissipate g n))) := by + apply tendsto_vectorMeasure_iInter_atTop_nat antitone_dissipate + exact fun i ↦ MeasurableSet.biInter (to_countable _) (fun i hi ↦ hgm _) + have J : Tendsto (fun n ↦ μ.variation.prod ν.variation (dissipate g n)) atTop + (𝓝 (μ.variation.prod ν.variation (⋂ n, dissipate g n))) := by + apply tendsto_measure_iInter_atTop ?_ antitone_dissipate + + + rw [iInter_dissipate] at this + + apply le_of_tendsto_of_tendsto this.enorm + + + + + + + + + +#exit + + have (a : X) : HasSum (fun i ↦ ν (Prod.mk a ⁻¹' f i)) (ν (Prod.mk a ⁻¹' ⋃ i, f i)) := by + rw [preimage_iUnion] + apply hasSum_of_disjoint_iUnion + exacts [fun i ↦ measurable_prodMk_left (hfm i), hfd.mono fun _ _ ↦ .preimage _] + exact StronglyMeasurable.hasSum ihf this + + + + +#exit + /-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is measurable. This version has `f` in curried form. -/ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_right - {B : G →L[ℝ] F →L[ℝ] H} [SFinite (ν.transpose B).variation] ⦃f : X → Y → G⦄ + {B : G →L[ℝ] F →L[ℝ] H} [SFinite ν.variation] ⦃f : X → Y → G⦄ (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x ↦ ∫ᵛ y, f x y ∂[B; ν] := by simp only [integral_eq_setToFun] apply StronglyMeasurable.setToFun_prod_right _ (fun s hs ↦ ?_) hf @@ -154,7 +266,7 @@ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_righ /-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is measurable. -/ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_right' - {B : G →L[ℝ] F →L[ℝ] H} [SFinite (ν.transpose B).variation] ⦃f : X × Y → G⦄ + {B : G →L[ℝ] F →L[ℝ] H} [SFinite ν.variation] ⦃f : X × Y → G⦄ (hf : StronglyMeasurable f) : StronglyMeasurable fun x ↦ ∫ᵛ y, f (x, y) ∂[B; ν] := by rw [← uncurry_curry f] at hf; exact hf.integral_vectorMeasure_prod_right @@ -162,32 +274,32 @@ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_righ of) the symmetric version of Fubini's theorem is measurable. This version has `f` in curried form. -/ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_left - {B : G →L[ℝ] E →L[ℝ] H} [SFinite (μ.transpose B).variation] ⦃f : X → Y → G⦄ + {B : G →L[ℝ] E →L[ℝ] H} [SFinite μ.variation] ⦃f : X → Y → G⦄ (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun y ↦ ∫ᵛ x, f x y ∂[B; μ] := (hf.comp_measurable measurable_swap).integral_vectorMeasure_prod_right' /-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side of) the symmetric version of Fubini's theorem is measurable. -/ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_left' - {B : G →L[ℝ] E →L[ℝ] H} [SFinite (μ.transpose B).variation] ⦃f : X × Y → G⦄ + {B : G →L[ℝ] E →L[ℝ] H} [SFinite μ.variation] ⦃f : X × Y → G⦄ (hf : StronglyMeasurable f) : StronglyMeasurable fun y ↦ ∫ᵛ x, f (x, y) ∂[B; μ] := (hf.comp_measurable measurable_swap).integral_vectorMeasure_prod_right' /-- The vector measure integral is a.e.-measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is a.e.-measurable. -/ theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_vectorMeasure_prod_right' - {B : G →L[ℝ] F →L[ℝ] H} [SFinite (ν.transpose B).variation] {μ : Measure X} - ⦃f : X × Y → G⦄ (hf : AEStronglyMeasurable f (μ.prod (ν.transpose B).variation)) : + {B : G →L[ℝ] F →L[ℝ] H} [SFinite ν.variation] {μ : Measure X} + ⦃f : X × Y → G⦄ (hf : AEStronglyMeasurable f (μ.prod ν.variation)) : AEStronglyMeasurable (fun x ↦ ∫ᵛ y, f (x, y) ∂[B; ν]) μ := ⟨fun x ↦ ∫ᵛ y, hf.mk f (x, y) ∂[B; ν], hf.stronglyMeasurable_mk.integral_vectorMeasure_prod_right', by filter_upwards [Measure.ae_ae_of_ae_prod hf.ae_eq_mk] with _ hx using integral_congr_ae hx⟩ theorem Integrable.integral_prod_left {B : G →L[ℝ] F →L[ℝ] H} - [SFinite (ν.transpose B).variation] - {μ : Measure X} ⦃f : X × Y → G⦄ (hf : Integrable f (μ.prod (ν.transpose B).variation)) : + [SFinite ν.variation] + {μ : Measure X} ⦃f : X × Y → G⦄ (hf : Integrable f (μ.prod ν.variation)) : Integrable (fun x ↦ ∫ᵛ y, f (x, y) ∂[B; ν]) μ := by - apply Integrable.mono hf.integral_norm_prod_left + apply Integrable.mono (hf.integral_norm_prod_left.const_mul ‖B‖) (hf.aestronglyMeasurable.integral_vectorMeasure_prod_right') filter_upwards with x grw [norm_integral_le_integral_norm] @@ -195,9 +307,9 @@ theorem Integrable.integral_prod_left {B : G →L[ℝ] F →L[ℝ] H} /-- Vector measure integrals commute with subtraction inside a lower Lebesgue integral. -/ theorem lintegral_fn_integral_sub ⦃f g : X × Y → G⦄ {μ : Measure X} - {B : G →L[ℝ] F →L[ℝ] H} [SFinite μ] [SFinite (ν.transpose B).variation] - (φ : H → ℝ≥0∞) (hf : Integrable f (μ.prod (ν.transpose B).variation)) - (hg : Integrable g (μ.prod (ν.transpose B).variation)) : + {B : G →L[ℝ] F →L[ℝ] H} [SFinite μ] [SFinite ν.variation] + (φ : H → ℝ≥0∞) (hf : Integrable f (μ.prod ν.variation)) + (hg : Integrable g (μ.prod ν.variation)) : (∫⁻ x, φ (∫ᵛ y, f (x, y) - g (x, y) ∂[B; ν]) ∂μ) = ∫⁻ x, φ ((∫ᵛ y, f (x, y) ∂[B; ν]) - ∫ᵛ y, g (x, y) ∂[B; ν]) ∂μ := by refine lintegral_congr_ae ?_ @@ -206,8 +318,8 @@ theorem lintegral_fn_integral_sub ⦃f g : X × Y → G⦄ {μ : Measure X} /-- The map that sends an L¹-function `f : X × Y → G` to `∫∫f` is continuous. -/ theorem continuous_integral_integral {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ℝ] I} - [SFinite (ν.transpose B).variation] [SFinite (μ.transpose C).variation] : - Continuous fun f : X × Y →₁[(μ.transpose C).variation.prod (ν.transpose B).variation] G ↦ + [SFinite ν.variation] [SFinite μ.variation] : + Continuous fun f : X × Y →₁[μ.variation.prod ν.variation] G ↦ ∫ᵛ x, (∫ᵛ y, f (x, y) ∂[B; ν]) ∂[C; μ] := by rw [continuous_iff_continuousAt]; intro g apply tendsto_integral_of_L1 @@ -216,24 +328,25 @@ theorem continuous_integral_integral {B : G →L[ℝ] F →L[ℝ] H} {C : H →L exact Integrable.integral_prod_left (L1.integrable_coeFn h) simp_rw [← lintegral_fn_integral_sub _ (L1.integrable_coeFn _) (L1.integrable_coeFn g)] apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds _ (fun i ↦ zero_le) _ - (h := fun i ↦ ∫⁻ x, ∫⁻ y, - ‖i (x, y) - g (x, y)‖ₑ ∂(ν.transpose B).variation ∂(μ.transpose C).variation); swap + (h := fun i ↦ ∫⁻ x, ‖B‖ₑ * ∫⁻ y, + ‖i (x, y) - g (x, y)‖ₑ ∂ν.variation ∂μ.variation); swap · exact fun i ↦ lintegral_mono fun x ↦ enorm_integral_le_lintegral_enorm - have this (i : X × Y →₁[(μ.transpose C).variation.prod (ν.transpose B).variation] G) : - Measurable fun z ↦ ‖i z - g z‖ₑ := + have this (i : X × Y →₁[μ.variation.prod ν.variation] G) : Measurable fun z ↦ ‖i z - g z‖ₑ := ((Lp.stronglyMeasurable i).sub (Lp.stronglyMeasurable g)).enorm + simp_rw [lintegral_const_mul' ‖B‖ₑ _ (by simp)] simp_rw [← lintegral_prod _ (this _).aemeasurable, ← L1.ofReal_norm_sub_eq_lintegral, ofReal_norm] + suffices Tendsto (fun i ↦ ‖B‖ₑ * ‖i - g‖ₑ) (𝓝 g) (𝓝 (‖B‖ₑ * 0)) by simpa + apply ENNReal.Tendsto.const_mul _ (by simp) rw [← tendsto_iff_enorm_sub_tendsto_zero] exact tendsto_id - /-- **Fubini's Theorem**: For integrable functions on `X × Y`, the vector measure integral of `f` is equal to the iterated vector measure integral. -/ theorem integral_prod {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ℝ] I} {A : E →L[ℝ] F →L[ℝ] H} {D : G →L[ℝ] H →L[ℝ] I} [CompleteSpace H] - [IsFiniteMeasure (ν.transpose B).variation] [SFinite (μ.transpose C).variation] - {f : X × Y → G} (hf : Integrable f ((μ.transpose C).variation.prod (ν.transpose B).variation)) : + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + {f : X × Y → G} (hf : Integrable f (μ.variation.prod ν.variation)) : ∫ᵛ z, f z ∂[D; μ.prod ν A] = ∫ᵛ x, ∫ᵛ y, f (x, y) ∂[B; ν] ∂[C; μ] := by by_cases hI : CompleteSpace I; swap · simp only [integral_of_not_completeSpace hI] @@ -241,11 +354,19 @@ theorem integral_prod {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ apply Integrable.induction · intro c s hs h2s simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp_def, - integral_indicator (measurable_prodMk_left hs), setIntegral_const, integral_smul_const, + integral_indicator (measurable_prodMk_left hs), setIntegral_const] + rw [setIntegral_const] + + +#exit + measureReal_def, integral_toReal (measurable_measure_prodMk_left hs).aemeasurable (ae_measure_lt_top hs h2s.ne)] rw [Measure.prod_apply hs] + +#exit + · rintro f g - i_f i_g hf hg simp_rw [integral_add' i_f i_g, integral_integral_add' i_f i_g, hf, hg] · exact isClosed_eq continuous_integral continuous_integral_integral diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 4794aaf5509806..3561cb03b7bfd0 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -464,6 +464,10 @@ theorem enorm_setIntegral_le_lintegral_enorm : ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ ‖B‖ₑ * ∫⁻ x in s, ‖f x‖ₑ ∂μ.variation := by grw [enorm_integral_le_lintegral_enorm, variation_restrict_le] +theorem enorm_setIntegral_le_lintegral_enorm_transpose : + ‖∫ᵛ x in s, f x ∂[B; μ]‖ₑ ≤ ∫⁻ x in s, ‖f x‖ₑ ∂(μ.transpose B).variation := by + grw [enorm_integral_le_lintegral_enorm_transpose, transpose_restrict,variation_restrict_le] + private theorem hasSum_setIntegral_iUnion_nat {s : ℕ → Set X} (hm : ∀ i, MeasurableSet (s i)) (hd : Pairwise (Disjoint on s)) (hfi : μ.IntegrableOn f (⋃ i, s i)) : diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean index a563a8e2360f98..02c52dbb6d66ef 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensityVec.lean @@ -34,19 +34,19 @@ measurable set the mass `∫ᵛ x in s, f x ∂[B; μ]`. If `f` is not integrable, we use the junk value `0`. -/ noncomputable def withDensity (μ : VectorMeasure X F) (f : X → E) (B : E →L[ℝ] F →L[ℝ] G) : VectorMeasure X G := - if h : μ.Integrable f B then + if h : μ.Integrable f then { measureOf' s := ∫ᵛ x in s, f x ∂[B; μ] empty' := by simp not_measurable' s hs := setIntegral_eq_zero_of_not_measurableSet hs m_iUnion' s s_meas s_disj := hasSum_setIntegral_iUnion s_meas s_disj h.integrableOn } else 0 -lemma withDensity_apply (hf : μ.Integrable f B) : +lemma withDensity_apply (hf : μ.Integrable f) : μ.withDensity f B s = ∫ᵛ x in s, f x ∂[B; μ] := by simp [withDensity, hf] lemma withDensity_apply_univ : μ.withDensity f B univ = ∫ᵛ x, f x ∂[B; μ] := by - by_cases hf : μ.Integrable f B + by_cases hf : μ.Integrable f · simp [withDensity_apply hf] · simp [withDensity, hf, integral_undef] @@ -60,17 +60,17 @@ lemma withDensity_zero : μ.withDensity 0 B = 0 := by ext s hs simp [withDensity_apply] -lemma withDensity_congr (h : f =ᵐ[(μ.transpose B).variation] g) : +lemma withDensity_congr (h : f =ᵐ[μ.variation] g) : μ.withDensity f B = μ.withDensity g B := by - by_cases hf : μ.Integrable f B + by_cases hf : μ.Integrable f · simp only [withDensity, hf, ↓reduceDIte, Integrable.congr hf h, mk.injEq] ext s apply setIntegral_congr_ae filter_upwards [h] with x hx xs using hx - · have : ¬(μ.Integrable g B) := by simpa [← integrable_congr h] using hf + · have : ¬(μ.Integrable g) := by simpa [← integrable_congr h] using hf simp [withDensity, hf, this] -lemma restrict_withDensity (hf : μ.Integrable f B) : +lemma restrict_withDensity (hf : μ.Integrable f) : (μ.withDensity f B).restrict s = (μ.restrict s).withDensity f B := by by_cases hs : MeasurableSet s; swap · simp [restrict_not_measurable _ hs] @@ -80,10 +80,10 @@ lemma restrict_withDensity (hf : μ.Integrable f B) : lemma variation_WithDensity_le : (μ.withDensity f B).variation ≤ (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by - by_cases hf : μ.Integrable f B + by_cases hf : μ.Integrable f · apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) rw [withDensity_apply hf, MeasureTheory.withDensity_apply _ hs] - apply enorm_setIntegral_le_lintegral_enorm + apply enorm_setIntegral_le_lintegral_enorm_transpose · simp [withDensity, hf, Measure.zero_le ] /-- If `‖B x y‖ = ‖B · y‖ * ‖x‖` for all `x, y`, then the variation of a vector measure with @@ -96,7 +96,7 @@ Then `μ.withDensity f B = 0` so its variation is zero, while the integral of ` See also `variation_withDensity` under the very common condition `‖B x y‖ = ‖x‖ ‖y‖`. -/ lemma variation_withDensity' [CompleteSpace G] - (hf : μ.Integrable f B) (hB : ∀ x y, ‖B x y‖₊ = ‖B.flip y‖₊ * ‖x‖₊) : + (hf : μ.Integrable f) (hB : ∀ x y, ‖B x y‖₊ = ‖B.flip y‖₊ * ‖x‖₊) : (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by apply le_antisymm variation_WithDensity_le apply Measure.le_iff.2 (fun s hs ↦ ?_) @@ -116,10 +116,24 @@ lemma variation_withDensity' [CompleteSpace G] let δ := ε / 3 have δpos : 0 < δ := div_pos εpos (by norm_num) -- first step: approximate `f` by a simple function `g`. - obtain ⟨g, hg, gmem⟩ : ∃ (g : X →ₛ E), eLpNorm (f - ⇑g) 1 (μ.transpose B).variation < δ - ∧ MemLp (⇑g) 1 (μ.transpose B).variation := - (memLp_one_iff_integrable.2 hf).exists_simpleFunc_eLpNorm_sub_lt (by simp) - (by simpa using δpos.ne') + obtain ⟨g, hg, gmem⟩ : ∃ (g : X →ₛ E), eLpNorm (f - ⇑g) 1 (μ.transpose B).variation ≤ δ + ∧ MemLp (⇑g) 1 μ.variation := by + obtain ⟨ρ, ρpos, hδ⟩ : ∃ ρ > 0, ‖B‖₊ * ρ ≤ δ := by + rcases eq_or_ne (‖B‖₊) 0 with hB | hB + · exact ⟨1, zero_lt_one, by simp [hB]⟩ + · refine ⟨‖B‖₊ ⁻¹ * δ, by positivity, ?_⟩ + rw [← mul_assoc] + apply mul_le_of_le_one_left (by positivity) mul_inv_le_one + obtain ⟨g, h'g, gmem⟩ : ∃ (g : X →ₛ E), eLpNorm (f - ⇑g) 1 μ.variation < ρ + ∧ MemLp (⇑g) 1 μ.variation := + (memLp_one_iff_integrable.2 hf).exists_simpleFunc_eLpNorm_sub_lt (by simp) + (by simpa using ρpos.ne') + refine ⟨g, ?_, gmem⟩ + grw [variation_transpose_le] + rw [eLpNorm_smul_measure_of_ne_top' (by simp)] + grw [h'g.le] + simp only [ENNReal.toReal_one, inv_one, NNReal.rpow_one, ENNReal.smul_def, smul_eq_mul] + exact_mod_cast hδ -- the integral of `‖f‖ₑ` is approximated up to `δ` by that of `‖g‖ₑ`. have I1 : ∫⁻ a in s, ‖f a‖ₑ ∂(μ.transpose B).variation ≤ ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + δ := calc @@ -138,7 +152,7 @@ lemma variation_withDensity' [CompleteSpace G] _ ≤ ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation + δ := by rw [eLpNorm_one_eq_lintegral_enorm] at hg gcongr - exact hg.le + exact hg -- the integral of `‖g‖ₑ` can be rewritten as a weighted sum of measures, as `g` is a simple -- function. have I2 : ∫⁻ a in s, ‖g a‖ₑ ∂(μ.transpose B).variation = @@ -169,7 +183,9 @@ lemma variation_withDensity' [CompleteSpace G] exact ⟨P, hP, h'P, h''P, by gcongr⟩ apply exists_variation_le_add' _ (g.measurableSet_fiber i) ρpos rw [variation_restrict hs] - exact (g.integrable_iff.1 (memLp_one_iff_integrable.1 gmem).restrict i hi).ne + have : MemLp (⇑g) 1 (μ.transpose B).variation := + gmem.of_measure_le_smul (c := ‖B‖₊) (by simp) (variation_transpose_le _ _) + exact (g.integrable_iff.1 (memLp_one_iff_integrable.1 this).restrict i hi).ne choose P Pg Pdisj Pmeas hP using C -- rewrite everything in terms of the global partition made by putting together the `Pᵢ`, -- and register that the resulting error is bounded by `δ`. @@ -195,9 +211,9 @@ lemma variation_withDensity' [CompleteSpace G] · simp simp only [Finset.mem_sigma] at hi have pmeas : MeasurableSet p := Pmeas i _ hi.2 - have : IsFiniteMeasure (((μ.restrict s).transpose B).variation.restrict p) := by + have : IsFiniteMeasure ((μ.restrict s).variation.restrict p) := by constructor - rw [transpose_restrict, variation_restrict hs, Measure.restrict_restrict pmeas, + rw [variation_restrict hs, Measure.restrict_restrict pmeas, MeasureTheory.Measure.restrict_apply_univ] apply lt_of_le_of_lt ?_ (g.integrable_iff.1 (memLp_one_iff_integrable.1 gmem) i h'i) exact measure_mono (inter_subset_left.trans (Pg i _ hi.2)) @@ -225,7 +241,7 @@ lemma variation_withDensity' [CompleteSpace G] _ ≤ ∑ i ∈ g.range.sigma P, ∫⁻ x in i.2, ‖g x - f x‖ₑ ∂(μ.transpose B).variation + ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ := by gcongr with i hi - grw [enorm_setIntegral_le_lintegral_enorm] + grw [enorm_setIntegral_le_lintegral_enorm_transpose] apply lintegral_mono' _ le_rfl apply Measure.restrict_mono le_rfl rw [transpose_restrict, variation_restrict hs] @@ -252,7 +268,7 @@ lemma variation_withDensity' [CompleteSpace G] _ ≤ ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ + δ := by gcongr simp_rw [enorm_sub_rev, ← eLpNorm_one_eq_lintegral_enorm] - exact hg.le + exact hg -- register that the sum of the enorms of the integrals of `f` over the pieces `Pᵢⱼ` of the -- partition is bounded by the variation of `μ.withDensity f B`, by definition of the variation. have I5 : ∑ i ∈ g.range.sigma P, ‖∫ᵛ x in i.2, f x ∂[B; μ.restrict s]‖ₑ @@ -321,7 +337,7 @@ product in `ℝ²` and `f x` everywhere horizontal and `μ s` everywhere vertica Then `μ.withDensity f B = 0` so its variation is zero, while the integral of `‖f‖ₑ` is not. -/ lemma variation_withDensity [CompleteSpace G] - (hf : μ.Integrable f B) (hB : ∀ x y, ‖B x y‖₊ = ‖x‖₊ * ‖y‖₊) : + (hf : μ.Integrable f) (hB : ∀ x y, ‖B x y‖₊ = ‖x‖₊ * ‖y‖₊) : (μ.withDensity f B).variation = (μ.transpose B).variation.withDensity (fun x ↦ ‖f x‖ₑ) := by apply variation_withDensity' hf (fun x y ↦ ?_) refine le_antisymm (ContinuousLinearMap.le_opNorm (B.flip y) x) ?_ @@ -341,11 +357,8 @@ lemma _root_.MeasureTheory.Measure.variation_withDensityᵥ [CompleteSpace E] rcases subsingleton_or_nontrivial E with hE | hE · simp [show f = 0 from Subsingleton.elim _ _] have : IsFiniteMeasure (μ.withDensity fun x ↦ ‖f x‖ₑ) := ⟨by simpa using! hf.2⟩ - have I : (μ.withDensity fun x ↦ ‖f x‖ₑ).toSignedMeasure.Integrable (fun x ↦ ‖f x‖⁻¹ • f x) - (ContinuousLinearMap.lsmul ℝ ℝ).flip := by - apply Integrable.mono_measure _ (variation_transpose_le _ _) - apply Integrable.smul_measure_nnreal - simp only [Measure.variation_toSignedMeasure] + have I : (μ.withDensity fun x ↦ ‖f x‖ₑ).toSignedMeasure.Integrable (fun x ↦ ‖f x‖⁻¹ • f x) := by + simp only [VectorMeasure.Integrable, Measure.variation_toSignedMeasure] apply Integrable.of_bound (C := 1) · apply AEStronglyMeasurable.mono_ac (withDensity_absolutelyContinuous _ _) exact hf.aestronglyMeasurable.norm.inv₀.smul hf.aestronglyMeasurable From 5a51fcb7fb3c8d8408399ff5eca397dcd4f14dd0 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 09:11:06 +0200 Subject: [PATCH 120/129] more --- Mathlib/Analysis/Normed/Operator/Bilinear.lean | 8 ++++++++ Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/Mathlib/Analysis/Normed/Operator/Bilinear.lean b/Mathlib/Analysis/Normed/Operator/Bilinear.lean index ebd617afa71905..d8cf1dbb8fe20b 100644 --- a/Mathlib/Analysis/Normed/Operator/Bilinear.lean +++ b/Mathlib/Analysis/Normed/Operator/Bilinear.lean @@ -165,6 +165,14 @@ theorem flip_flip (f : E →SL[σ₁₃] F →SL[σ₂₃] G) : f.flip.flip = f theorem opNorm_flip (f : E →SL[σ₁₃] F →SL[σ₂₃] G) : ‖f.flip‖ = ‖f‖ := le_antisymm (by simpa only [flip_flip] using le_norm_flip f.flip) (le_norm_flip f) +@[simp] +theorem opNNNorm_flip (f : E →SL[σ₁₃] F →SL[σ₂₃] G) : ‖f.flip‖₊ = ‖f‖₊ := by + simp [← NNReal.coe_inj] + +@[simp] +theorem opENorm_flip (f : E →SL[σ₁₃] F →SL[σ₂₃] G) : ‖f.flip‖ₑ = ‖f‖ₑ := by + simp [enorm_eq_nnnorm] + @[simp] lemma flip_zero : flip (0 : E →SL[σ₁₃] F →SL[σ₂₃] G) = 0 := rfl diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index b0679b8a85de5d..d7606a624d438c 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -166,6 +166,7 @@ lemma prod_apply_eq_integral [CompleteSpace G] [IsFiniteMeasure μ.variation] rw [this] simp [prodOfIsFiniteMeasureLeft, hs] +/- lemma compl_prod_eq_union' {α β : Type*} (s : Set α) (t : Set β) : (s ×ˢ t)ᶜ = (sᶜ ×ˢ tᶜ) ∪ (s ×ˢ tᶜ) ∪ (sᶜ ×ˢ t) := by grind @@ -249,6 +250,16 @@ lemma variation_prod_le [SFinite ν.variation] : exacts [fun i ↦ measurable_prodMk_left (hfm i), hfd.mono fun _ _ ↦ .preimage _] exact StronglyMeasurable.hasSum ihf this +-/ + +lemma variation_prod_le [CompleteSpace G] [IsFiniteMeasure μ.variation] [SFinite ν.variation] : + (μ.prod ν B).variation ≤ ‖B‖ₑ • μ.variation.prod ν.variation := by + apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) + rw [prod_apply_eq_integral hs] + simp only [Measure.smul_apply, smul_eq_mul] + rw [Measure.prod_apply hs] + grw [enorm_integral_le_lintegral_enorm, ContinuousLinearMap.opENorm_flip] + From 70edc79127deacd4cd35c911e62e1b9f58deeda2 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 13:27:22 +0200 Subject: [PATCH 121/129] better --- .../Function/LpSeminorm/Basic.lean | 19 +- .../MeasureTheory/Function/LpSpace/Basic.lean | 1 + Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 216 +++++++++--------- 3 files changed, 123 insertions(+), 113 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean index 96fc1608bff08b..6ff9c1d3559d40 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean @@ -661,6 +661,12 @@ theorem eLpNorm_smul_measure_of_ne_zero {c : ℝ≥0∞} (hc : c ≠ 0) (f : α · simp [*] exact eLpNorm_smul_measure_of_ne_zero_of_ne_top hp0 hp_top c +theorem eLpNorm_smul_measure_le (c : ℝ≥0∞) (f : α → ε) (p : ℝ≥0∞) + (μ : Measure α) : eLpNorm f p (c • μ) ≤ c ^ (1 / p).toReal • eLpNorm f p μ := by + rcases eq_or_ne c 0 with rfl | hc + · simp + · exact (eLpNorm_smul_measure_of_ne_zero hc f p μ ).le + /-- See `eLpNorm_smul_measure_of_ne_zero` for a version with scalar multiplication by `ℝ≥0∞`. -/ lemma eLpNorm_smul_measure_of_ne_zero' {c : ℝ≥0} (hc : c ≠ 0) (f : α → ε) (p : ℝ≥0∞) (μ : Measure α) : eLpNorm f p (c • μ) = c ^ p.toReal⁻¹ • eLpNorm f p μ := @@ -684,15 +690,16 @@ theorem eLpNorm_one_smul_measure {f : α → ε} (c : ℝ≥0∞) : eLpNorm f 1 (c • μ) = c * eLpNorm f 1 μ := by rw [eLpNorm_smul_measure_of_ne_top] <;> simp +theorem eLpNorm_le_of_measure_le_smul {c : ℝ≥0∞} + {μ μ' : Measure α} (h : μ' ≤ c • μ) {f : α → ε} {p : ℝ≥0∞} : + eLpNorm f p μ' ≤ c ^ (1 / p).toReal • eLpNorm f p μ := by + grw [eLpNorm_mono_measure f h, eLpNorm_smul_measure_le] + theorem MemLp.of_measure_le_smul {μ' : Measure α} {c : ℝ≥0∞} (hc : c ≠ ∞) (hμ'_le : μ' ≤ c • μ) {f : α → ε} (hf : MemLp f p μ) : MemLp f p μ' := by refine ⟨hf.1.mono_ac (Measure.absolutelyContinuous_of_le_smul hμ'_le), ?_⟩ - refine (eLpNorm_mono_measure f hμ'_le).trans_lt ?_ - by_cases hc0 : c = 0 - · simp [hc0] - rw [eLpNorm_smul_measure_of_ne_zero hc0, smul_eq_mul] - refine ENNReal.mul_lt_top (Ne.lt_top ?_) hf.2 - simp [hc, hc0] + grw [eLpNorm_le_of_measure_le_smul hμ'_le] + exact ENNReal.mul_lt_top (Ne.lt_top (by simp [hc])) hf.2 theorem MemLp.smul_measure {f : α → ε} {c : ℝ≥0∞} (hf : MemLp f p μ) (hc : c ≠ ∞) : MemLp f p (c • μ) := diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index f66de7c766a34e..d9b1ea430f2dd4 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -245,6 +245,7 @@ theorem nnnorm_toLp (f : α → E) (hf : MemLp f p μ) : ‖hf.toLp f‖₊ = ENNReal.toNNReal (eLpNorm f p μ) := NNReal.eq <| norm_toLp f hf +@[simp] lemma enorm_toLp {f : α → E} (hf : MemLp f p μ) : ‖hf.toLp f‖ₑ = eLpNorm f p μ := by simp_rw [enorm, nnnorm_toLp f hf, ENNReal.coe_toNNReal hf.2.ne] diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index d7606a624d438c..5b5e781e914c87 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -95,6 +95,14 @@ theorem stronglyMeasurable_vectorMeasure_prodMk_left {s : Set (X × Y)} exacts [fun i ↦ measurable_prodMk_left (hfm i), hfd.mono fun _ _ ↦ .preimage _] exact StronglyMeasurable.hasSum ihf this +omit [NormedSpace ℝ E] in +theorem integrable_vectorMeasure_prodMk_left [IsFiniteMeasure μ.variation] + {s : Set (X × Y)} (hs : MeasurableSet s) : + μ.Integrable fun x ↦ ν (Prod.mk x ⁻¹' s) := by + refine Integrable.of_bound (μ := μ.variation) ?_ ν.bound ?_ + · exact (stronglyMeasurable_vectorMeasure_prodMk_left hs).aestronglyMeasurable + · exact Eventually.of_forall (fun x ↦ norm_apply_le_bound) + open scoped Classical in /-- The product of two vector measures when the first one has finite variation, obtained by integrating the measure of the fibers, as in the definition of the product of positive measures. @@ -112,11 +120,7 @@ noncomputable def prodOfIsFiniteMeasureLeft HasSum, SummationFilter.unconditional_filter] have A (a : Finset ℕ) : ∑ y ∈ a, ∫ᵛ x, ν (Prod.mk x ⁻¹' f y) ∂[B.flip; μ] = ∫ᵛ x, ∑ y ∈ a, ν (Prod.mk x ⁻¹' f y) ∂[B.flip; μ] := by - rw [integral_finsetSum] - intro i hi - refine Integrable.of_bound (μ := μ.variation) ?_ ν.bound ?_ - · exact (stronglyMeasurable_vectorMeasure_prodMk_left (f_meas i)).aestronglyMeasurable - · exact Eventually.of_forall (fun x ↦ norm_apply_le_bound) + rw [integral_finsetSum _ (fun i hi ↦ integrable_vectorMeasure_prodMk_left (f_meas i))] simp_rw [A] apply tendsto_integral_filter_of_dominated_convergence (bound := fun x ↦ ν.bound) · apply Eventually.of_forall (fun a ↦ ?_) @@ -146,7 +150,7 @@ instance [CompleteSpace G] [h : IsFiniteMeasure ν.variation] : HasProd μ ν B rw [← B.flip_flip] apply HasProd.flip -lemma prod_eq {ρ : VectorMeasure (X × Y) G} (hρ : ∀ (s : Set X) (t : Set Y), +lemma prod_eq_of_forall_apply_prod {ρ : VectorMeasure (X × Y) G} (hρ : ∀ (s : Set X) (t : Set Y), MeasurableSet s → MeasurableSet t → ρ (s ×ˢ t) = B (μ s) (ν t)) : μ.prod ν B = ρ := by have : HasProd μ ν B := ⟨ρ, hρ⟩ @@ -160,110 +164,38 @@ lemma prod_apply_eq_integral [CompleteSpace G] [IsFiniteMeasure μ.variation] μ.prod ν B s = ∫ᵛ x, ν (Prod.mk x ⁻¹' s) ∂[B.flip; μ] := by have : μ.prod ν B = prodOfIsFiniteMeasureLeft μ ν B := by classical - apply prod_eq (fun s t hs ht ↦ ?_) + apply prod_eq_of_forall_apply_prod (fun s t hs ht ↦ ?_) simp only [prodOfIsFiniteMeasureLeft, hs.prod ht, ↓reduceIte, mk_preimage_prod_right_eq_if, of_if, integral_indicator hs, setIntegral_const, ContinuousLinearMap.flip_apply] rw [this] simp [prodOfIsFiniteMeasureLeft, hs] -/- -lemma compl_prod_eq_union' {α β : Type*} (s : Set α) (t : Set β) : - (s ×ˢ t)ᶜ = (sᶜ ×ˢ tᶜ) ∪ (s ×ˢ tᶜ) ∪ (sᶜ ×ˢ t) := by - grind - -lemma variation_prod_le [SFinite ν.variation] : - (μ.prod ν B).variation ≤ ‖B‖ₑ • μ.variation.prod ν.variation := by - by_cases h : HasProd μ ν B; swap - · simp [prod_eq_zero_of_not_hasProd h, Measure.zero_le] - have A (s : Set X) (t : Set Y) : - ‖(B (μ s)) (ν t)‖ₑ ≤ ‖B‖ₑ * (μ.variation s * ν.variation t) := by - grw [ContinuousLinearMap.le_opENorm, ContinuousLinearMap.le_opENorm, enorm_measure_le_variation, - enorm_measure_le_variation, ← mul_assoc] - apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) - suffices ‖(μ.prod ν B) s‖ₑ ≤ (‖B‖ₑ • μ.variation.prod ν.variation) s ∧ - ‖(μ.prod ν B) sᶜ‖ₑ ≤ (‖B‖ₑ • μ.variation.prod ν.variation) sᶜ from this.1 - induction s, hs - using MeasurableSpace.induction_on_inter generateFrom_prod.symm isPiSystem_prod with - | empty => simpa [← univ_prod_univ] using A univ univ - | basic s hs => - obtain ⟨s, hs, t, ht, rfl⟩ := hs - simp only [prod_apply, Measure.smul_apply, Measure.prod_prod, smul_eq_mul, A, true_and] - rw [compl_prod_eq_union', of_union (by grind), of_union (by grind), measure_union (by grind), - measure_union (by grind)]; rotate_left - · exact hs.prod ht.compl - · exact hs.compl.prod ht - · exact hs.compl.prod ht.compl - · exact hs.prod ht.compl - · exact (hs.compl.prod ht.compl).union (hs.prod ht.compl) - · exact hs.compl.prod ht - grw [enorm_add_le, enorm_add_le] - simp only [prod_apply, Measure.prod_prod, mul_add] - grw [A, A, A] - | compl s hs ihs => - simp only [Measure.smul_apply, smul_eq_mul, compl_compl] at ihs ⊢ - grind - | iUnion f hfd hfm ihf => - constructor - · have : Tendsto (fun n ↦ μ.prod ν B (accumulate f n)) atTop - (𝓝 (μ.prod ν B (⋃ n, accumulate f n))) := by - apply tendsto_vectorMeasure_iUnion_atTop_nat monotone_accumulate - exact fun i ↦ MeasurableSet.biUnion (to_countable _) (fun i hi ↦ hfm _) - rw [iUnion_accumulate] at this - apply le_of_tendsto this.enorm - filter_upwards with n - have : accumulate f n = ⋃ i ∈ Finset.Iic n, f i := by ext; simp [accumulate] - rw [this, of_biUnion_finset (fun i hi j hj hij ↦ hfd hij) (fun i hi ↦ hfm i)] - grw [enorm_sum_le, (ihf _).1] - simp only [Measure.smul_apply, smul_eq_mul, ← Finset.mul_sum] - rw [← measure_biUnion_finset (fun i hi j hj hij ↦ hfd hij) (fun i hi ↦ hfm i)] - gcongr 2 - exact iUnion₂_subset_iUnion _ _ - · simp_rw [compl_iUnion] - let g := fun i ↦ (f i)ᶜ - have hgm i : MeasurableSet (g i) := (hfm i).compl - have I : Tendsto (fun n ↦ μ.prod ν B (dissipate g n)) atTop - (𝓝 (μ.prod ν B (⋂ n, dissipate g n))) := by - apply tendsto_vectorMeasure_iInter_atTop_nat antitone_dissipate - exact fun i ↦ MeasurableSet.biInter (to_countable _) (fun i hi ↦ hgm _) - have J : Tendsto (fun n ↦ μ.variation.prod ν.variation (dissipate g n)) atTop - (𝓝 (μ.variation.prod ν.variation (⋂ n, dissipate g n))) := by - apply tendsto_measure_iInter_atTop ?_ antitone_dissipate - - - rw [iInter_dissipate] at this - - apply le_of_tendsto_of_tendsto this.enorm - - - - - - - - - -#exit - - have (a : X) : HasSum (fun i ↦ ν (Prod.mk a ⁻¹' f i)) (ν (Prod.mk a ⁻¹' ⋃ i, f i)) := by - rw [preimage_iUnion] - apply hasSum_of_disjoint_iUnion - exacts [fun i ↦ measurable_prodMk_left (hfm i), hfd.mono fun _ _ ↦ .preimage _] - exact StronglyMeasurable.hasSum ihf this - --/ +lemma prod_apply_eq_integral' [CompleteSpace G] [IsFiniteMeasure μ.variation] + {B : F →L[ℝ] E →L[ℝ] G} {s : Set (X × Y)} (hs : MeasurableSet s) : + μ.prod ν B.flip s = ∫ᵛ x, ν (Prod.mk x ⁻¹' s) ∂[B; μ] := by + simp [prod_apply_eq_integral hs] lemma variation_prod_le [CompleteSpace G] [IsFiniteMeasure μ.variation] [SFinite ν.variation] : (μ.prod ν B).variation ≤ ‖B‖ₑ • μ.variation.prod ν.variation := by apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) rw [prod_apply_eq_integral hs] - simp only [Measure.smul_apply, smul_eq_mul] - rw [Measure.prod_apply hs] - grw [enorm_integral_le_lintegral_enorm, ContinuousLinearMap.opENorm_flip] - - - - -#exit + simp only [Measure.smul_apply, smul_eq_mul, Measure.prod_apply hs] + grw [enorm_integral_le_lintegral_enorm, ContinuousLinearMap.opENorm_flip, + enorm_measure_le_variation] + +instance [CompleteSpace G] [IsFiniteMeasure μ.variation] [IsFiniteMeasure ν.variation] : + IsFiniteMeasure (μ.prod ν B).variation := by + have : IsFiniteMeasure (‖B‖ₑ • μ.variation.prod ν.variation) := by + simp only [enorm_eq_nnnorm, Measure.coe_nnreal_smul] + infer_instance + exact isFiniteMeasure_of_le _ variation_prod_le + +omit [NormedSpace ℝ H] in +lemma _root_.MeasureTheory.Integrable.prod_vectorMeasure + [CompleteSpace G] [IsFiniteMeasure μ.variation] [IsFiniteMeasure ν.variation] + {f : X × Y → H} (hf : Integrable f (μ.variation.prod ν.variation)) : + (μ.prod ν B).Integrable f := + Integrable.of_measure_le_smul (by simp) variation_prod_le hf /-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is measurable. This version has `f` in curried form. -/ @@ -306,7 +238,7 @@ theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_vectorMeasure_prod_ri hf.stronglyMeasurable_mk.integral_vectorMeasure_prod_right', by filter_upwards [Measure.ae_ae_of_ae_prod hf.ae_eq_mk] with _ hx using integral_congr_ae hx⟩ -theorem Integrable.integral_prod_left {B : G →L[ℝ] F →L[ℝ] H} +theorem _root_.MeasureTheory.Integrable.integral_vectorMeasure_prod_left {B : G →L[ℝ] F →L[ℝ] H} [SFinite ν.variation] {μ : Measure X} ⦃f : X × Y → G⦄ (hf : Integrable f (μ.prod ν.variation)) : Integrable (fun x ↦ ∫ᵛ y, f (x, y) ∂[B; ν]) μ := by @@ -334,9 +266,9 @@ theorem continuous_integral_integral {B : G →L[ℝ] F →L[ℝ] H} {C : H →L ∫ᵛ x, (∫ᵛ y, f (x, y) ∂[B; ν]) ∂[C; μ] := by rw [continuous_iff_continuousAt]; intro g apply tendsto_integral_of_L1 - · exact (Integrable.integral_prod_left (L1.integrable_coeFn g)).aestronglyMeasurable + · exact (Integrable.integral_vectorMeasure_prod_left (L1.integrable_coeFn g)).aestronglyMeasurable · filter_upwards with h - exact Integrable.integral_prod_left (L1.integrable_coeFn h) + exact Integrable.integral_vectorMeasure_prod_left (L1.integrable_coeFn h) simp_rw [← lintegral_fn_integral_sub _ (L1.integrable_coeFn _) (L1.integrable_coeFn g)] apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds _ (fun i ↦ zero_le) _ (h := fun i ↦ ∫⁻ x, ‖B‖ₑ * ∫⁻ y, @@ -352,12 +284,53 @@ theorem continuous_integral_integral {B : G →L[ℝ] F →L[ℝ] H} {C : H →L rw [← tendsto_iff_enorm_sub_tendsto_zero] exact tendsto_id +section + +#check MemLp.of_measure_le_smul + +variable {α : Type*} {m : MeasurableSpace α} {μ ν : Measure α} {c : ℝ≥0∞} {p : ℝ≥0∞} + +noncomputable def foo (hc : c ≠ ∞) (h : μ ≤ c • ν) : Lp E p ν →ₗ[ℝ] Lp E p μ where + toFun f := ((Lp.memLp f).of_measure_le_smul hc h).toLp f + map_add' f g := by + ext + grw [MemLp.coeFn_toLp, Lp.coeFn_add, MemLp.coeFn_toLp, MemLp.coeFn_toLp] + have : μ ≪ ν := Measure.absolutelyContinuous_of_le_smul h + apply Measure.AbsolutelyContinuous.ae_eq this + grw [Lp.coeFn_add] + map_smul' c f := by + ext + grw [MemLp.coeFn_toLp, Lp.coeFn_smul, MemLp.coeFn_toLp] + have : μ ≪ ν := Measure.absolutelyContinuous_of_le_smul h + apply Measure.AbsolutelyContinuous.ae_eq this + grw [Lp.coeFn_smul] + rfl + +lemma coeFn_foo (hc : c ≠ ∞) (h : μ ≤ c • ν) (f : Lp E p ν) : foo hc h f =ᵐ[μ] f := by + simp [foo, MemLp.coeFn_toLp] + +lemma norm_foo + (hc : c ≠ ∞) (h : μ ≤ c • ν) [Fact (1 ≤ p)] {f : Lp E p ν} : + ‖foo hc h f‖ₑ ≤ c * ‖f‖ₑ := by + simp only [Lp.enorm_def] + rw [eLpNorm_congr_ae (coeFn_foo hc h f)] + apply eLpNorm_mono_measure + + + + + +#exit + /-- **Fubini's Theorem**: For integrable functions on `X × Y`, -the vector measure integral of `f` is equal to the iterated vector measure integral. -/ +the vector measure integral of `f` for the product vector measure is equal to the iterated vector +measure integral. We express this with respect to general pairing functions, with a compatibility +condition saying that the compositions coincide up to reordering. -/ theorem integral_prod {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ℝ] I} - {A : E →L[ℝ] F →L[ℝ] H} {D : G →L[ℝ] H →L[ℝ] I} [CompleteSpace H] + {A : E →L[ℝ] F →L[ℝ] H} {D : G →L[ℝ] H →L[ℝ] I} [CompleteSpace G] [CompleteSpace H] [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] - {f : X × Y → G} (hf : Integrable f (μ.variation.prod ν.variation)) : + {f : X × Y → G} (hf : Integrable f (μ.variation.prod ν.variation)) + (h : ∀ x y z, D x (A y z) = C (B x z) y) : ∫ᵛ z, f z ∂[D; μ.prod ν A] = ∫ᵛ x, ∫ᵛ y, f (x, y) ∂[B; ν] ∂[C; μ] := by by_cases hI : CompleteSpace I; swap · simp only [integral_of_not_completeSpace hI] @@ -366,11 +339,40 @@ theorem integral_prod {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ · intro c s hs h2s simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp_def, integral_indicator (measurable_prodMk_left hs), setIntegral_const] - rw [setIntegral_const] + rw [integral_continuousLinearMap_comp, ← prod_apply_eq_integral' hs]; swap + · exact integrable_vectorMeasure_prodMk_left hs + suffices (μ.prod ν A).mapRange (D c) (D c).continuous = μ.prod ν (C ∘SL B c).flip by + simp [← this] + apply (prod_eq_of_forall_apply_prod _).symm + intro s t hs ht + simp [h] + · intro f g hfg fint gint hf hg + rw [integral_add fint.prod_vectorMeasure gint.prod_vectorMeasure, hf, hg, + ← integral_add fint.integral_vectorMeasure_prod_left gint.integral_vectorMeasure_prod_left] + apply integral_congr_ae + filter_upwards [fint.prod_right_ae, gint.prod_right_ae] with x hx h'x + simp only [Pi.add_apply] + rw [integral_fun_add hx h'x] + · apply isClosed_eq + · + sorry + sorry + + + + +Lp ?_ ?_ ?_ →L[?_] Lp ?_ ?_ ?_ + + + #exit +(D c) (↑(μ.prod ν A) s) = ↑(μ.prod ν (C ∘SL B c).flip) s + +(D c) ((A (↑μ s)) (↑ν t)) = (C ((B c) (↑ν t))) (↑μ s) + measureReal_def, integral_toReal (measurable_measure_prodMk_left hs).aemeasurable (ae_measure_lt_top hs h2s.ne)] From 2135c316010eba1942ece232f3c7d80103b63814 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 15:17:36 +0200 Subject: [PATCH 122/129] missing API --- .../MeasureTheory/Function/LpSpace/Basic.lean | 60 ++++++++++ Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 110 ++++++------------ 2 files changed, 93 insertions(+), 77 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index d9b1ea430f2dd4..d5a2b365758e4a 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -870,6 +870,66 @@ end ContinuousLinearMap namespace MeasureTheory.Lp +section LpToLpOfMeasureLeSMul + +variable [NormedSpace ℝ E] {ν : Measure α} {c : ℝ≥0∞} + +/-- The canonical map from `Lᵖ ν` to `Lᵖ μ` when `μ` is bounded by a multiple of `ν`. +This is the linear map version. Use instead the continuous linear map +version `LpToLpOfMeasureLeSMul` -/ +noncomputable def LpToLpOfMeasureLeSMulₗ (hc : c ≠ ∞) (h : μ ≤ c • ν) : + Lp E p ν →ₗ[ℝ] Lp E p μ where + toFun f := ((Lp.memLp f).of_measure_le_smul hc h).toLp f + map_add' f g := by + ext + grw [MemLp.coeFn_toLp, Lp.coeFn_add, MemLp.coeFn_toLp, MemLp.coeFn_toLp] + have : μ ≪ ν := Measure.absolutelyContinuous_of_le_smul h + apply Measure.AbsolutelyContinuous.ae_eq this + grw [Lp.coeFn_add] + map_smul' c f := by + ext + grw [MemLp.coeFn_toLp, Lp.coeFn_smul, MemLp.coeFn_toLp] + have : μ ≪ ν := Measure.absolutelyContinuous_of_le_smul h + apply Measure.AbsolutelyContinuous.ae_eq this + grw [Lp.coeFn_smul] + rfl + +lemma coeFn_LpToLpOfMeasureLeSMulₗ (hc : c ≠ ∞) (h : μ ≤ c • ν) (f : Lp E p ν) : + LpToLpOfMeasureLeSMulₗ hc h f =ᵐ[μ] f := by + simp [LpToLpOfMeasureLeSMulₗ, MemLp.coeFn_toLp] + +lemma enorm_LpToLpOfMeasureLeSMulₗ_apply_le + (hc : c ≠ ∞) (h : μ ≤ c • ν) [Fact (1 ≤ p)] {f : Lp E p ν} : + ‖LpToLpOfMeasureLeSMulₗ hc h f‖ₑ ≤ c ^ (1 / p).toReal * ‖f‖ₑ := by + simp only [Lp.enorm_def] + grw [eLpNorm_congr_ae (coeFn_LpToLpOfMeasureLeSMulₗ hc h f)] + exact eLpNorm_le_of_measure_le_smul h + +lemma norm_LpToLpOfMeasureLeSMulₗ_apply_le + (hc : c ≠ ∞) (h : μ ≤ c • ν) [Fact (1 ≤ p)] {f : Lp E p ν} : + ‖LpToLpOfMeasureLeSMulₗ hc h f‖ ≤ c.toReal ^ (1 / p).toReal * ‖f‖ := by + simp only [← toReal_enorm] + rw [ENNReal.toReal_rpow, ← ENNReal.toReal_mul] + apply (ENNReal.toReal_le_toReal (by simp only [ne_eq, enorm_ne_top, not_false_eq_true]) _).2 + (enorm_LpToLpOfMeasureLeSMulₗ_apply_le hc h) + simp [ENNReal.mul_eq_top, -Lp.enorm_def, hc] + +/-- The canonical map from `Lᵖ ν` to `Lᵖ μ` when `μ` is bounded by a multiple of `ν`. -/ +noncomputable def LpToLpOfMeasureLeSMul [Fact (1 ≤ p)] (hc : c ≠ ∞) (h : μ ≤ c • ν) : + Lp E p ν →L[ℝ] Lp E p μ := + LinearMap.mkContinuous (LpToLpOfMeasureLeSMulₗ hc h) (c.toReal ^ (1 / p).toReal) + (fun _ ↦ norm_LpToLpOfMeasureLeSMulₗ_apply_le hc h) + +lemma coeFn_LpToLpOfMeasureLeSMul [Fact (1 ≤ p)] (hc : c ≠ ∞) (h : μ ≤ c • ν) (f : Lp E p ν) : + LpToLpOfMeasureLeSMul hc h f =ᵐ[μ] f := + coeFn_LpToLpOfMeasureLeSMulₗ hc h f + +lemma norm_LpToLpOfMeasureLeSMul [Fact (1 ≤ p)] (hc : c ≠ ∞) (h : μ ≤ c • ν) : + ‖(LpToLpOfMeasureLeSMul hc h : Lp E p ν →L[ℝ] Lp E p μ)‖ ≤ c.toReal ^ (1 / p).toReal := + LinearMap.mkContinuous_norm_le _ (Real.rpow_nonneg (by simp) _) _ + +end LpToLpOfMeasureLeSMul + section PosPart theorem lipschitzWith_pos_part : LipschitzWith 1 fun x : ℝ => max x 0 := diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 5b5e781e914c87..612f15ae142fbb 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -18,12 +18,13 @@ public section open Filter Function MeasureTheory RCLike Set TopologicalSpace Topology open scoped ENNReal NNReal Finset -variable {ι X Y E F G H I : Type*} {mX : MeasurableSpace X} {mY : MeasurableSpace Y} +variable {ι X Y E F G H I J : Type*} {mX : MeasurableSpace X} {mY : MeasurableSpace Y} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] [NormedAddCommGroup H] [NormedSpace ℝ H] [NormedAddCommGroup I] [NormedSpace ℝ I] + [NormedAddCommGroup J] [NormedSpace ℝ J] {μ : VectorMeasure X E} {ν : VectorMeasure Y F} {B : E →L[ℝ] F →L[ℝ] G} {f g : X → E} {s t : Set X} @@ -170,7 +171,7 @@ lemma prod_apply_eq_integral [CompleteSpace G] [IsFiniteMeasure μ.variation] rw [this] simp [prodOfIsFiniteMeasureLeft, hs] -lemma prod_apply_eq_integral' [CompleteSpace G] [IsFiniteMeasure μ.variation] +lemma prod_flip_apply_eq_integral [CompleteSpace G] [IsFiniteMeasure μ.variation] {B : F →L[ℝ] E →L[ℝ] G} {s : Set (X × Y)} (hs : MeasurableSet s) : μ.prod ν B.flip s = ∫ᵛ x, ν (Prod.mk x ⁻¹' s) ∂[B; μ] := by simp [prod_apply_eq_integral hs] @@ -284,54 +285,17 @@ theorem continuous_integral_integral {B : G →L[ℝ] F →L[ℝ] H} {C : H →L rw [← tendsto_iff_enorm_sub_tendsto_zero] exact tendsto_id -section - -#check MemLp.of_measure_le_smul - -variable {α : Type*} {m : MeasurableSpace α} {μ ν : Measure α} {c : ℝ≥0∞} {p : ℝ≥0∞} - -noncomputable def foo (hc : c ≠ ∞) (h : μ ≤ c • ν) : Lp E p ν →ₗ[ℝ] Lp E p μ where - toFun f := ((Lp.memLp f).of_measure_le_smul hc h).toLp f - map_add' f g := by - ext - grw [MemLp.coeFn_toLp, Lp.coeFn_add, MemLp.coeFn_toLp, MemLp.coeFn_toLp] - have : μ ≪ ν := Measure.absolutelyContinuous_of_le_smul h - apply Measure.AbsolutelyContinuous.ae_eq this - grw [Lp.coeFn_add] - map_smul' c f := by - ext - grw [MemLp.coeFn_toLp, Lp.coeFn_smul, MemLp.coeFn_toLp] - have : μ ≪ ν := Measure.absolutelyContinuous_of_le_smul h - apply Measure.AbsolutelyContinuous.ae_eq this - grw [Lp.coeFn_smul] - rfl - -lemma coeFn_foo (hc : c ≠ ∞) (h : μ ≤ c • ν) (f : Lp E p ν) : foo hc h f =ᵐ[μ] f := by - simp [foo, MemLp.coeFn_toLp] - -lemma norm_foo - (hc : c ≠ ∞) (h : μ ≤ c • ν) [Fact (1 ≤ p)] {f : Lp E p ν} : - ‖foo hc h f‖ₑ ≤ c * ‖f‖ₑ := by - simp only [Lp.enorm_def] - rw [eLpNorm_congr_ae (coeFn_foo hc h f)] - apply eLpNorm_mono_measure - - - - - -#exit - /-- **Fubini's Theorem**: For integrable functions on `X × Y`, the vector measure integral of `f` for the product vector measure is equal to the iterated vector measure integral. We express this with respect to general pairing functions, with a compatibility condition saying that the compositions coincide up to reordering. -/ -theorem integral_prod {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ℝ] I} - {A : E →L[ℝ] F →L[ℝ] H} {D : G →L[ℝ] H →L[ℝ] I} [CompleteSpace G] [CompleteSpace H] +theorem integral_prod {B : G →L[ℝ] F →L[ℝ] J} {C : J →L[ℝ] E →L[ℝ] I} + {A : E →L[ℝ] F →L[ℝ] H} {D : G →L[ℝ] H →L[ℝ] I} + [CompleteSpace H] [CompleteSpace J] [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] {f : X × Y → G} (hf : Integrable f (μ.variation.prod ν.variation)) (h : ∀ x y z, D x (A y z) = C (B x z) y) : - ∫ᵛ z, f z ∂[D; μ.prod ν A] = ∫ᵛ x, ∫ᵛ y, f (x, y) ∂[B; ν] ∂[C; μ] := by + ∫ᵛ z, f z ∂[D; μ.prod ν A] = ∫ᵛ x, (∫ᵛ y, f (x, y) ∂[B; ν]) ∂[C; μ] := by by_cases hI : CompleteSpace I; swap · simp only [integral_of_not_completeSpace hI] revert f @@ -339,8 +303,8 @@ theorem integral_prod {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ · intro c s hs h2s simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp_def, integral_indicator (measurable_prodMk_left hs), setIntegral_const] - rw [integral_continuousLinearMap_comp, ← prod_apply_eq_integral' hs]; swap - · exact integrable_vectorMeasure_prodMk_left hs + rw [integral_continuousLinearMap_comp (integrable_vectorMeasure_prodMk_left hs), + ← prod_flip_apply_eq_integral hs] suffices (μ.prod ν A).mapRange (D c) (D c).continuous = μ.prod ν (C ∘SL B c).flip by simp [← this] apply (prod_eq_of_forall_apply_prod _).symm @@ -353,39 +317,31 @@ theorem integral_prod {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ filter_upwards [fint.prod_right_ae, gint.prod_right_ae] with x hx h'x simp only [Pi.add_apply] rw [integral_fun_add hx h'x] - · apply isClosed_eq - · - sorry - sorry - - - - -Lp ?_ ?_ ?_ →L[?_] Lp ?_ ?_ ?_ - - - - - -#exit - -(D c) (↑(μ.prod ν A) s) = ↑(μ.prod ν (C ∘SL B c).flip) s - -(D c) ((A (↑μ s)) (↑ν t)) = (C ((B c) (↑ν t))) (↑μ s) - - measureReal_def, - integral_toReal (measurable_measure_prodMk_left hs).aemeasurable - (ae_measure_lt_top hs h2s.ne)] - rw [Measure.prod_apply hs] + · apply isClosed_eq ?_ continuous_integral_integral + let P : Lp G 1 (μ.variation.prod ν.variation) →L[ℝ] Lp G 1 (μ.prod ν A).variation := + LpToLpOfMeasureLeSMul (by simp) variation_prod_le + have M (f : Lp G 1 (μ.variation.prod ν.variation)) : + ∫ᵛ z, f z ∂[D; μ.prod ν A] = ∫ᵛ z, (P f) z ∂[D; μ.prod ν A] := by + apply integral_congr_ae + grw [coeFn_LpToLpOfMeasureLeSMul] + simp_rw [M] + exact Continuous.comp continuous_integral P.continuous + · intro f g hfg hf h'f + have ac : (μ.prod ν A).variation ≪ μ.variation.prod ν.variation := + Measure.absolutelyContinuous_of_le_smul variation_prod_le + rw [← integral_congr_ae (ac.ae_eq hfg), h'f] + apply integral_congr_ae + filter_upwards [Measure.ae_ae_of_ae_prod hfg] with x hx + exact integral_congr_ae hx -#exit +/-- **Fubini's Theorem**: For integrable functions on `X × Y`, +the vector measure integral of `f` for the product vector measure is equal to the iterated vector +measure integral. Version where `f` is scalar. -/ +theorem integral_prod_smul [CompleteSpace H] [CompleteSpace F] {B : E →L[ℝ] F →L[ℝ] H} + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + {f : X × Y → ℝ} (hf : Integrable f (μ.variation.prod ν.variation)) : + ∫ᵛ z, f z ∂•(μ.prod ν B) = ∫ᵛ x, (∫ᵛ y, f (x, y) ∂•ν) ∂[B.flip; μ] := + integral_prod hf (fun x y z ↦ by simp) - · rintro f g - i_f i_g hf hg - simp_rw [integral_add' i_f i_g, integral_integral_add' i_f i_g, hf, hg] - · exact isClosed_eq continuous_integral continuous_integral_integral - · rintro f g hfg - hf; convert! hf using 1 - · exact integral_congr_ae hfg.symm - · apply integral_congr_ae - filter_upwards [ae_ae_of_ae_prod hfg] with x hfgx using integral_congr_ae (ae_eq_symm hfgx) end MeasureTheory.VectorMeasure From 8208b8101a7009e2ec728040ac38d559cc836dcd Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 15:43:35 +0200 Subject: [PATCH 123/129] fix --- Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 612f15ae142fbb..60b3e6f1ed4bcf 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -319,11 +319,11 @@ theorem integral_prod {B : G →L[ℝ] F →L[ℝ] J} {C : J →L[ℝ] E →L[ rw [integral_fun_add hx h'x] · apply isClosed_eq ?_ continuous_integral_integral let P : Lp G 1 (μ.variation.prod ν.variation) →L[ℝ] Lp G 1 (μ.prod ν A).variation := - LpToLpOfMeasureLeSMul (by simp) variation_prod_le + Lp.LpToLpOfMeasureLeSMul (by simp) variation_prod_le have M (f : Lp G 1 (μ.variation.prod ν.variation)) : ∫ᵛ z, f z ∂[D; μ.prod ν A] = ∫ᵛ z, (P f) z ∂[D; μ.prod ν A] := by apply integral_congr_ae - grw [coeFn_LpToLpOfMeasureLeSMul] + grw [Lp.coeFn_LpToLpOfMeasureLeSMul] simp_rw [M] exact Continuous.comp continuous_integral P.continuous · intro f g hfg hf h'f @@ -343,5 +343,4 @@ theorem integral_prod_smul [CompleteSpace H] [CompleteSpace F] {B : E →L[ℝ] ∫ᵛ z, f z ∂•(μ.prod ν B) = ∫ᵛ x, (∫ᵛ y, f (x, y) ∂•ν) ∂[B.flip; μ] := integral_prod hf (fun x y z ↦ by simp) - end MeasureTheory.VectorMeasure From 39425de53fa86496381948f4e737daae650436de Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 15:56:47 +0200 Subject: [PATCH 124/129] fix --- Mathlib/MeasureTheory/Function/LpSpace/Basic.lean | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index d5a2b365758e4a..87bc16d4c4b653 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -232,7 +232,6 @@ theorem nnnorm_def (f : Lp E p μ) : ‖f‖₊ = ENNReal.toNNReal (eLpNorm f p protected theorem coe_nnnorm (f : Lp E p μ) : (‖f‖₊ : ℝ) = ‖f‖ := rfl -@[simp] theorem enorm_def (f : Lp E p μ) : ‖f‖ₑ = eLpNorm f p μ := ENNReal.coe_toNNReal <| Lp.eLpNorm_ne_top f @@ -912,7 +911,7 @@ lemma norm_LpToLpOfMeasureLeSMulₗ_apply_le rw [ENNReal.toReal_rpow, ← ENNReal.toReal_mul] apply (ENNReal.toReal_le_toReal (by simp only [ne_eq, enorm_ne_top, not_false_eq_true]) _).2 (enorm_LpToLpOfMeasureLeSMulₗ_apply_le hc h) - simp [ENNReal.mul_eq_top, -Lp.enorm_def, hc] + simp [ENNReal.mul_eq_top, hc] /-- The canonical map from `Lᵖ ν` to `Lᵖ μ` when `μ` is bounded by a multiple of `ν`. -/ noncomputable def LpToLpOfMeasureLeSMul [Fact (1 ≤ p)] (hc : c ≠ ∞) (h : μ ≤ c • ν) : From e75e892ebb48cef1e3dbd8495b78fd88c4da2f6a Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 17:07:36 +0200 Subject: [PATCH 125/129] ok --- Mathlib.lean | 1 - Mathlib/MeasureTheory/Integral/Prod.lean | 2 +- Mathlib/MeasureTheory/Integral/SetToL1.lean | 59 ++++++++ .../MeasureTheory/Integral/SetToL1Prod.lean | 140 ------------------ 4 files changed, 60 insertions(+), 142 deletions(-) delete mode 100644 Mathlib/MeasureTheory/Integral/SetToL1Prod.lean diff --git a/Mathlib.lean b/Mathlib.lean index 8cde8f87421aee..9b55585e3b6d0f 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5505,7 +5505,6 @@ public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.NNReal public import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real public import Mathlib.MeasureTheory.Integral.SetToL1 -public import Mathlib.MeasureTheory.Integral.SetToL1Prod public import Mathlib.MeasureTheory.Integral.TorusIntegral public import Mathlib.MeasureTheory.MeasurableSpace.Basic public import Mathlib.MeasureTheory.MeasurableSpace.Card diff --git a/Mathlib/MeasureTheory/Integral/Prod.lean b/Mathlib/MeasureTheory/Integral/Prod.lean index 1417cfcf2dc3ce..29aa2b79574237 100644 --- a/Mathlib/MeasureTheory/Integral/Prod.lean +++ b/Mathlib/MeasureTheory/Integral/Prod.lean @@ -7,7 +7,7 @@ module public import Mathlib.MeasureTheory.Function.LpSeminorm.Prod public import Mathlib.MeasureTheory.Integral.DominatedConvergence -public import Mathlib.MeasureTheory.Integral.SetToL1Prod +public import Mathlib.MeasureTheory.Integral.SetToL1 public import Mathlib.MeasureTheory.Integral.Bochner.Set public import Mathlib.MeasureTheory.Measure.Prod diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 2b205d558f46b2..0a57e91ef89383 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -1390,6 +1390,65 @@ theorem tendsto_setToFun_filter_of_norm_le_const (hT : DominatedFinMeasAdditive exact tendsto_setToFun_filter_of_dominated_convergence hT C h_meas h_boundc (integrable_const c) h_lim +omit [NormedSpace ℝ E] in +theorem measurableSet_integrable {β : Type*} {mβ : MeasurableSpace β} [SFinite μ] ⦃f : β → α → E⦄ + (hf : StronglyMeasurable (Function.uncurry f)) : MeasurableSet {x | Integrable (f x) μ} := by + simp_rw [Integrable, hf.of_uncurry_left.aestronglyMeasurable, true_and] + exact measurableSet_lt (Measurable.lintegral_prod_right hf.enorm) measurable_const + +/-- The `setToFun` operation is measurable. This shows that the integrand of (the right-hand-side +of) Fubini's theorem is measurable. This version has `f` in curried form. -/ +theorem StronglyMeasurable.setToFun_prod_right {β : Type*} {mβ : MeasurableSpace β} [SFinite μ] + (hT : DominatedFinMeasAdditive μ T C) + (h'T : ∀ (s : Set (β × α)), MeasurableSet s → StronglyMeasurable fun x => T (Prod.mk x ⁻¹' s)) + ⦃f : β → α → E⦄ (hf : StronglyMeasurable (Function.uncurry f)) : + StronglyMeasurable fun x => setToFun μ T hT (f x) := by + classical + by_cases hF : CompleteSpace F; swap; + · simp [setToFun, hF, stronglyMeasurable_const] + borelize E + haveI : SeparableSpace (range (Function.uncurry f) ∪ {0} : Set E) := + hf.separableSpace_range_union_singleton + let s : ℕ → SimpleFunc (β × α) E := + SimpleFunc.approxOn _ hf.measurable (range (Function.uncurry f) ∪ {0}) 0 (by simp) + let s' : ℕ → β → SimpleFunc α E := fun n x => (s n).comp (Prod.mk x) measurable_prodMk_left + let f' : ℕ → β → F := fun n => + {x | Integrable (f x) μ}.indicator fun x => (s' n x).setToSimpleFunc T + have hf' n : StronglyMeasurable (f' n) := by + refine StronglyMeasurable.indicator ?_ (measurableSet_integrable hf) + have : ∀ x, ((s' n x).range.filter fun x => x ≠ 0) ⊆ (s n).range := by + intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y + simp_rw [SimpleFunc.mem_range]; rintro ⟨z, rfl⟩; exact ⟨(x, z), rfl⟩ + simp_rw [SimpleFunc.setToSimpleFunc_eq_sum_of_subset T hT.1.map_empty_eq_zero (this _)] + refine Finset.stronglyMeasurable_fun_sum _ fun x _ => ?_ + simp only [s', SimpleFunc.coe_comp, preimage_comp] + apply StronglyMeasurable.apply_continuousLinearMap + apply h'T + exact (s n).measurableSet_fiber x + have h2f' : Tendsto f' atTop (𝓝 fun x : β => setToFun μ T hT (f x)) := by + apply tendsto_pi_nhds.2 fun x ↦ ?_ + by_cases hfx : Integrable (f x) μ + · have (n : _) : Integrable (s' n x) μ := by + apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable + filter_upwards with y + simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n + simp only [mem_setOf_eq, hfx, indicator_of_mem, this, + ← setToFun_simpleFunc_eq_setToSimpleFunc hT, f'] + refine + tendsto_setToFun_of_dominated_convergence hT (fun y => ‖f x y‖ + ‖f x y‖) + (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_ + · refine fun n => Eventually.of_forall fun y => + SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n + · exact hf.measurable + · simp + · refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_ + · exact hf.measurable.of_uncurry_left + · simp + apply subset_closure + simp [-Function.uncurry_apply_pair] + · simp [f', hfx, setToFun_undef] + exact stronglyMeasurable_of_tendsto _ hf' h2f' + variable {X : Type*} [TopologicalSpace X] [FirstCountableTopology X] theorem continuousWithinAt_setToFun_of_dominated (hT : DominatedFinMeasAdditive μ T C) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean b/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean deleted file mode 100644 index c5e66213623c0c..00000000000000 --- a/Mathlib/MeasureTheory/Integral/SetToL1Prod.lean +++ /dev/null @@ -1,140 +0,0 @@ -/- -Copyright (c) 2026 Sébastien Gouëzel. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Sébastien Gouëzel --/ -module - -public import Mathlib.MeasureTheory.Integral.SetToL1 - -/-! -# SetToL1 and products --/ - -public section - -open Function TopologicalSpace Set Filter -open scoped Topology - -namespace MeasureTheory - -variable {X Y E F F' G 𝕜 : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] - [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup F'] [NormedSpace ℝ F'] - [NormedAddCommGroup G] {mX : MeasurableSpace X} {μ : Measure X} - {mY : MeasurableSpace Y} {ν : Measure Y} - {T : Set Y → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive ν T C) - -omit [NormedSpace ℝ E] in -theorem measurableSet_integrable [SFinite ν] ⦃f : X → Y → E⦄ - (hf : StronglyMeasurable (uncurry f)) : MeasurableSet {x | Integrable (f x) ν} := by - simp_rw [Integrable, hf.of_uncurry_left.aestronglyMeasurable, true_and] - exact measurableSet_lt (Measurable.lintegral_prod_right hf.enorm) measurable_const - -/- -theorem stronglyMeasurable_prodMk_left (hT : DominatedFinMeasAdditive ν T C) - {s : Set (X × Y)} - (hs : MeasurableSet s) : StronglyMeasurable fun x => T (Prod.mk x ⁻¹' s) := by - induction s, hs - using MeasurableSpace.induction_on_inter generateFrom_prod.symm isPiSystem_prod with - | empty => simp [stronglyMeasurable_const] - | basic s hs => - obtain ⟨s, hs, t, -, rfl⟩ := hs - classical - simp [mk_preimage_prod_right_eq_if] - have : (fun x ↦ T (if x ∈ s then t else ∅)) = fun x ↦ if x ∈ s then T t else T ∅ := by grind - simp_rw [this, hT.1.map_empty_eq_zero] - exact (stronglyMeasurable_const (b := T t)).indicator hs - | compl s hs ihs => - simp_rw [preimage_compl, VectorMeasure.of_compl (measurable_prodMk_left hs)] - exact stronglyMeasurable_const.sub ihs - | iUnion f hfd hfm ihf => - have (a : X) : HasSum (fun i ↦ ν (Prod.mk a ⁻¹' f i)) (ν (Prod.mk a ⁻¹' ⋃ i, f i)) := by - rw [preimage_iUnion] - apply hasSum_of_disjoint_iUnion - exacts [fun i ↦ measurable_prodMk_left (hfm i), hfd.mono fun _ _ ↦ .preimage _] - exact StronglyMeasurable.hasSum ihf this --/ - -/-- The `setToFun` operation is measurable. This shows that the integrand of (the right-hand-side -of) Fubini's theorem is measurable. This version has `f` in curried form. -/ -theorem StronglyMeasurable.setToFun_prod_right [SFinite ν] - (h'T : ∀ (s : Set (X × Y)), MeasurableSet s → StronglyMeasurable fun x => T (Prod.mk x ⁻¹' s)) - ⦃f : X → Y → E⦄ (hf : StronglyMeasurable (uncurry f)) : - StronglyMeasurable fun x => setToFun ν T hT (f x) := by - classical - by_cases hF : CompleteSpace F; swap; - · simp [setToFun, hF, stronglyMeasurable_const] - borelize E - haveI : SeparableSpace (range (uncurry f) ∪ {0} : Set E) := - hf.separableSpace_range_union_singleton - let s : ℕ → SimpleFunc (X × Y) E := - SimpleFunc.approxOn _ hf.measurable (range (uncurry f) ∪ {0}) 0 (by simp) - let s' : ℕ → X → SimpleFunc Y E := fun n x => (s n).comp (Prod.mk x) measurable_prodMk_left - let f' : ℕ → X → F := fun n => - {x | Integrable (f x) ν}.indicator fun x => (s' n x).setToSimpleFunc T - have hf' n : StronglyMeasurable (f' n) := by - refine StronglyMeasurable.indicator ?_ (measurableSet_integrable hf) - have : ∀ x, ((s' n x).range.filter fun x => x ≠ 0) ⊆ (s n).range := by - intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y - simp_rw [SimpleFunc.mem_range]; rintro ⟨z, rfl⟩; exact ⟨(x, z), rfl⟩ - simp_rw [SimpleFunc.setToSimpleFunc_eq_sum_of_subset T hT.1.map_empty_eq_zero (this _)] - refine Finset.stronglyMeasurable_fun_sum _ fun x _ => ?_ - simp only [s', SimpleFunc.coe_comp, preimage_comp] - apply StronglyMeasurable.apply_continuousLinearMap - apply h'T - exact (s n).measurableSet_fiber x - have h2f' : Tendsto f' atTop (𝓝 fun x : X => setToFun ν T hT (f x)) := by - rw [tendsto_pi_nhds]; intro x - by_cases hfx : Integrable (f x) ν - · have (n : _) : Integrable (s' n x) ν := by - apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable - filter_upwards with y - simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n - simp only [mem_setOf_eq, hfx, indicator_of_mem, this, - ← setToFun_simpleFunc_eq_setToSimpleFunc hT, f'] - refine - tendsto_setToFun_of_dominated_convergence hT (fun y => ‖f x y‖ + ‖f x y‖) - (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_ - · refine fun n => Eventually.of_forall fun y => - SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n - · exact hf.measurable - · simp - · refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_ - · exact hf.measurable.of_uncurry_left - · simp - apply subset_closure - simp [-uncurry_apply_pair] - · simp [f', hfx, setToFun_undef] - exact stronglyMeasurable_of_tendsto _ hf' h2f' - -/-- The `setToFun` operation is measurable. This shows that the integrand of (the right-hand-side -of) Fubini's theorem is measurable. -/ -theorem StronglyMeasurable.setToFun_prod_right' [SFinite ν] - (h'T : ∀ (s : Set (X × Y)), MeasurableSet s → StronglyMeasurable fun x => T (Prod.mk x ⁻¹' s)) - ⦃f : X × Y → E⦄ (hf : StronglyMeasurable f) : - StronglyMeasurable fun x => setToFun ν T hT (fun y ↦ f (x, y)) := by - rw [← uncurry_curry f] at hf - apply hf.setToFun_prod_right hT h'T - -/-- The `setToFun` operation is measurable. This shows that the integrand of (the right-hand-side -of) the symmetric version of Fubini's theorem is measurable. -This version has `f` in curried form. -/ -theorem StronglyMeasurable.setToFun_prod_left [SFinite μ] - {T : Set X → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C) - (h'T : ∀ (s : Set (X × Y)), MeasurableSet s → StronglyMeasurable fun y => T ((·, y) ⁻¹' s)) - ⦃f : X → Y → E⦄ (hf : StronglyMeasurable (uncurry f)) : - StronglyMeasurable fun y => setToFun μ T hT (f · y) := - (hf.comp_measurable measurable_swap).setToFun_prod_right' hT - (fun s hs ↦ h'T (Prod.swap ⁻¹' s) (measurable_swap hs)) - -/-- The `setToFun` operation is measurable. This shows that the integrand of (the right-hand-side -of) the symmetric version of Fubini's theorem is measurable. -/ -theorem StronglyMeasurable.setToFun_prod_left' [SFinite μ] - {T : Set X → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C) - (h'T : ∀ (s : Set (X × Y)), MeasurableSet s → StronglyMeasurable fun y => T ((·, y) ⁻¹' s)) - ⦃f : X × Y → E⦄ (hf : StronglyMeasurable f) : - StronglyMeasurable fun y => setToFun μ T hT (fun x ↦ f (x, y)) := by - rw [← uncurry_curry f] at hf - apply hf.setToFun_prod_left hT h'T - -end MeasureTheory From 543a4e972aaba65c3a8a23d4b872d10d23c4ebe3 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 17:21:01 +0200 Subject: [PATCH 126/129] namespace --- Mathlib/MeasureTheory/Integral/SetToL1.lean | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 0a57e91ef89383..bd8c0a097c415a 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -1391,8 +1391,9 @@ theorem tendsto_setToFun_filter_of_norm_le_const (hT : DominatedFinMeasAdditive C h_meas h_boundc (integrable_const c) h_lim omit [NormedSpace ℝ E] in -theorem measurableSet_integrable {β : Type*} {mβ : MeasurableSpace β} [SFinite μ] ⦃f : β → α → E⦄ - (hf : StronglyMeasurable (Function.uncurry f)) : MeasurableSet {x | Integrable (f x) μ} := by +theorem _root_.measurableSet_integrable {β : Type*} {mβ : MeasurableSpace β} [SFinite μ] + ⦃f : β → α → E⦄ (hf : StronglyMeasurable (Function.uncurry f)) : + MeasurableSet {x | Integrable (f x) μ} := by simp_rw [Integrable, hf.of_uncurry_left.aestronglyMeasurable, true_and] exact measurableSet_lt (Measurable.lintegral_prod_right hf.enorm) measurable_const From 0ebe8030d561e75157efab4025788e6db4649b19 Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 20:32:09 +0200 Subject: [PATCH 127/129] fix --- Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 60b3e6f1ed4bcf..4a828c740e54c1 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -176,6 +176,15 @@ lemma prod_flip_apply_eq_integral [CompleteSpace G] [IsFiniteMeasure μ.variatio μ.prod ν B.flip s = ∫ᵛ x, ν (Prod.mk x ⁻¹' s) ∂[B; μ] := by simp [prod_apply_eq_integral hs] +lemma hasProd_flip [HasProd μ ν B] : HasProd ν μ B.flip where + exists_prod := by + refine ⟨(μ.prod ν B).map MeasurableEquiv.prodComm, fun s t hs ht ↦ ?_⟩ + rw [map_apply _ MeasurableEquiv.prodComm.measurable (hs.prod ht)] + simp [MeasurableEquiv.prodComm] + +lemma hasProd_flip_iff : HasProd ν μ B.flip ↔ HasProd μ ν B := + ⟨fun h ↦ by simpa using hasProd_flip (μ := ν) (ν := μ) (B := B.flip), fun h ↦ hasProd_flip⟩ + lemma variation_prod_le [CompleteSpace G] [IsFiniteMeasure μ.variation] [SFinite ν.variation] : (μ.prod ν B).variation ≤ ‖B‖ₑ • μ.variation.prod ν.variation := by apply variation_le_of_forall_enorm_le (fun s hs ↦ ?_) @@ -198,6 +207,18 @@ lemma _root_.MeasureTheory.Integrable.prod_vectorMeasure (μ.prod ν B).Integrable f := Integrable.of_measure_le_smul (by simp) variation_prod_le hf +theorem integral_prod_swap (f : X × Y → H) {A : E →L[ℝ] F →L[ℝ] G} {B : H →L[ℝ] G →L[ℝ] I} : + ∫ᵛ z, f z.swap ∂[B; ν.prod μ A.flip] = ∫ᵛ z, f z ∂[B; μ.prod ν A] := by + have I (z : Y × X) : z.swap = MeasurableEquiv.prodComm z := rfl + simp_rw [I, ← integral_map_equiv] + congr + by_cases h : HasProd μ ν A; swap + · simp [prod_eq_zero_of_not_hasProd, h, hasProd_flip_iff] + have : HasProd ν μ A.flip := hasProd_flip + apply (prod_eq_of_forall_apply_prod (fun s t hs ht ↦ ?_)).symm + rw [map_apply _ MeasurableEquiv.prodComm.measurable (hs.prod ht)] + simp [MeasurableEquiv.prodComm] + /-- The vector measure integral is measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is measurable. This version has `f` in curried form. -/ theorem _root_.MeasureTheory.StronglyMeasurable.integral_vectorMeasure_prod_right @@ -343,4 +364,90 @@ theorem integral_prod_smul [CompleteSpace H] [CompleteSpace F] {B : E →L[ℝ] ∫ᵛ z, f z ∂•(μ.prod ν B) = ∫ᵛ x, (∫ᵛ y, f (x, y) ∂•ν) ∂[B.flip; μ] := integral_prod hf (fun x y z ↦ by simp) +/-- Symmetric version of **Fubini's Theorem**: For integrable functions on `X × Y`, +the vector measure integral of `f` for the product vector measure is equal to the iterated vector +measure integral. We express this with respect to general pairing functions, with a compatibility +condition saying that the compositions coincide up to reordering. +This version has the integrals on the right-hand side in the other order. -/ +theorem integral_prod_symm {B : G →L[ℝ] E →L[ℝ] J} {C : J →L[ℝ] F →L[ℝ] I} + {A : E →L[ℝ] F →L[ℝ] H} {D : G →L[ℝ] H →L[ℝ] I} + [CompleteSpace H] [CompleteSpace J] + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + {f : X × Y → G} (hf : Integrable f (μ.variation.prod ν.variation)) + (h : ∀ x y z, (D x) (A z y) = C (B x z) y) : + ∫ᵛ z, f z ∂[D; μ.prod ν A] = ∫ᵛ y, (∫ᵛ x, f (x, y) ∂[B; μ]) ∂[C; ν] := by + rw [← integral_prod_swap f] + exact integral_prod hf.swap h + +/-- **Fubini's Theorem**: For integrable functions on `X × Y`, +the vector measure integral of `f` for the product vector measure is equal to the iterated vector +measure integral. Version where `f` is scalar. +This version has the integrals on the right-hand side in the other order. -/ +theorem integral_prod_smul_symm [CompleteSpace H] [CompleteSpace E] {B : E →L[ℝ] F →L[ℝ] H} + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + {f : X × Y → ℝ} (hf : Integrable f (μ.variation.prod ν.variation)) : + ∫ᵛ z, f z ∂•(μ.prod ν B) = ∫ᵛ y, (∫ᵛ x, f (x, y) ∂•μ) ∂[B; ν] := + integral_prod_symm hf (fun x y z ↦ by simp) + +/-- Reversed version of **Fubini's Theorem**. -/ +theorem integral_integral {B : G →L[ℝ] F →L[ℝ] J} {C : J →L[ℝ] E →L[ℝ] I} + {A : E →L[ℝ] F →L[ℝ] H} {D : G →L[ℝ] H →L[ℝ] I} + [CompleteSpace H] [CompleteSpace J] + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + {f : X → Y → G} (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) + (h : ∀ x y z, D x (A y z) = C (B x z) y) : + ∫ᵛ x, (∫ᵛ y, f x y ∂[B; ν]) ∂[C; μ] = ∫ᵛ z, f z.1 z.2 ∂[D; μ.prod ν A] := + (integral_prod hf h).symm + +/-- Reversed version of **Fubini's Theorem**, version with a scalar function. -/ +theorem integral_integral_smul [CompleteSpace H] [CompleteSpace F] {B : E →L[ℝ] F →L[ℝ] H} + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + {f : X → Y → ℝ} (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) : + ∫ᵛ x, (∫ᵛ y, f x y ∂•ν) ∂[B.flip; μ] = ∫ᵛ z, f z.1 z.2 ∂•(μ.prod ν B) := + (integral_prod_smul hf).symm + +/-- Reversed version of **Fubini's Theorem** (symmetric version). -/ +theorem integral_integral_symm {B : G →L[ℝ] E →L[ℝ] J} {C : J →L[ℝ] F →L[ℝ] I} + {A : E →L[ℝ] F →L[ℝ] H} {D : G →L[ℝ] H →L[ℝ] I} + [CompleteSpace H] [CompleteSpace J] + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + {f : X → Y → G} (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) + (h : ∀ x y z, (D x) (A z y) = C (B x z) y) : + ∫ᵛ y, (∫ᵛ x, f x y ∂[B; μ]) ∂[C; ν] = ∫ᵛ z, f z.1 z.2 ∂[D; μ.prod ν A] := + (integral_prod_symm hf h).symm + +/-- Reversed version of **Fubini's Theorem** (symmetric version), version with a scalar function. -/ +theorem integral_integral_smul_symm [CompleteSpace H] [CompleteSpace E] {B : E →L[ℝ] F →L[ℝ] H} + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + {f : X → Y → ℝ} (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) : + ∫ᵛ y, (∫ᵛ x, f x y ∂•μ) ∂[B; ν] = ∫ᵛ z, f z.1 z.2 ∂•(μ.prod ν B) := + (integral_prod_smul_symm hf).symm + +/-- Change the order of Bochner integration in integrals wrt vector measures. +We express this with respect to general pairing functions, with a compatibility +condition saying that the compositions coincide up to reordering. -/ +theorem integral_integral_swap + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + ⦃f : X → Y → G⦄ [CompleteSpace H] [CompleteSpace I] [CompleteSpace J] + {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ℝ] I} + {A : G →L[ℝ] E →L[ℝ] J} {D : J →L[ℝ] F →L[ℝ] I} + (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) + (h : ∀ x y z, C (B x y) z = D (A x z) y) : + ∫ᵛ x, ∫ᵛ y, f x y ∂[B; ν] ∂[C; μ] = ∫ᵛ y, ∫ᵛ x, f x y ∂[A; μ] ∂[D; ν] := by + let P : (H →L[ℝ] I) →L[ℝ] (G →L[ℝ] H) →L[ℝ] (G →L[ℝ] I) := + ContinuousLinearMap.compL ℝ G H I + let A' := ContinuousLinearMap.bilinearComp P C.flip B.flip + let D' : G →L[ℝ] (G →L[ℝ] I) →L[ℝ] I := ContinuousLinearMap.apply ℝ I + rw [integral_integral (A := A') (D := D') hf (by simp [D', A', P])] + exact (integral_integral_symm hf (by simp [D', A', P, h])).symm + +/-- Change the order of Bochner integration in integrals wrt vector measures. +Case where `f` is scalar. -/ +theorem integral_integral_smul_swap [CompleteSpace E] [CompleteSpace F] [CompleteSpace G] + [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] + ⦃f : X → Y → ℝ⦄ {B : E →L[ℝ] F →L[ℝ] G} + (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) : + ∫ᵛ x, ∫ᵛ y, f x y ∂•ν ∂[B.flip; μ] = ∫ᵛ y, ∫ᵛ x, f x y ∂•μ ∂[B; ν] := + integral_integral_swap hf (by simp) + end MeasureTheory.VectorMeasure From fbf2e53396532fd1301767c93e4668865084b17f Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 22:10:38 +0200 Subject: [PATCH 128/129] fix --- .../VectorMeasure/SetIntegral.lean | 22 +++++++++---------- .../Variation/Semivariation.lean | 6 ++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 3561cb03b7bfd0..f03dcad579c6b2 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -110,17 +110,17 @@ theorem setIntegral_union (hst : Disjoint s t) (hs : MeasurableSet s) (ht : Meas ∫ᵛ x in s ∪ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] + ∫ᵛ x in t, f x ∂[B; μ] := by rw [← integral_add_vectorMeasure hfs hft, μ.restrict_union hst hs ht] -theorem setIntegral_diff (hs : MeasurableSet s) (ht : MeasurableSet t) +theorem setIntegral_sdiff (hs : MeasurableSet s) (ht : MeasurableSet t) (hfs : μ.IntegrableOn f s) (hts : t ⊆ s) : ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] - ∫ᵛ x in t, f x ∂[B; μ] := by - rw [eq_sub_iff_add_eq, ← setIntegral_union (by grind) (hs.diff ht) ht (hfs.mono hs diff_subset) - (hfs.mono hs hts), diff_union_of_subset hts] + rw [eq_sub_iff_add_eq, ← setIntegral_union (by grind) (hs.diff ht) ht (hfs.mono hs sdiff_subset) + (hfs.mono hs hts), sdiff_union_of_subset hts] -theorem setIntegral_inter_add_diff (hs : MeasurableSet s) (ht : MeasurableSet t) +theorem setIntegral_inter_add_sdiff (hs : MeasurableSet s) (ht : MeasurableSet t) (hfs : μ.IntegrableOn f s) : ∫ᵛ x in s ∩ t, f x ∂[B; μ] + ∫ᵛ x in s \ t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - rw [← μ.restrict_inter_add_diff hs ht, - integral_add_vectorMeasure (hfs.mono hs inter_subset_left) (hfs.mono hs diff_subset)] + rw [← μ.restrict_inter_add_sdiff hs ht, + integral_add_vectorMeasure (hfs.mono hs inter_subset_left) (hfs.mono hs sdiff_subset)] theorem setIntegral_biUnion_finset {ι : Type*} (t : Finset ι) {s : ι → Set X} (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s)) @@ -295,17 +295,17 @@ theorem setIntegral_union_eq_left_of_forall (hs : MeasurableSet s) (ht : Measura rw [ae_restrict_iff' ht] filter_upwards with x using ht_eq x -theorem setIntegral_eq_of_subset_of_ae_diff_eq_zero (hs : MeasurableSet s) (ht : MeasurableSet t) +theorem setIntegral_eq_of_subset_of_ae_sdiff_eq_zero (hs : MeasurableSet s) (ht : MeasurableSet t) (hts : s ⊆ t) (h't : ∀ᵐ x ∂μ.variation.restrict (t \ s), f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - rwa [← union_diff_cancel hts, setIntegral_union_eq_left_of_ae hs (ht.diff hs)] + rwa [← union_sdiff_cancel hts, setIntegral_union_eq_left_of_ae hs (ht.diff hs)] /-- If a function vanishes on `t \ s` with `s ⊆ t`, then its integrals on `s` and `t` coincide. -/ -theorem setIntegral_eq_of_subset_of_forall_diff_eq_zero +theorem setIntegral_eq_of_subset_of_forall_sdiff_eq_zero (hs : MeasurableSet s) (ht : MeasurableSet t) (hts : s ⊆ t) (h't : ∀ x ∈ t \ s, f x = 0) : ∫ᵛ x in t, f x ∂[B; μ] = ∫ᵛ x in s, f x ∂[B; μ] := by - apply setIntegral_eq_of_subset_of_ae_diff_eq_zero hs ht hts + apply setIntegral_eq_of_subset_of_ae_sdiff_eq_zero hs ht hts apply (ae_restrict_iff' (ht.diff hs)).2 filter_upwards with x using h't x @@ -316,7 +316,7 @@ theorem setIntegral_eq_integral_of_ae_compl_eq_zero (hs : MeasurableSet s) ∫ᵛ x in s, f x ∂[B; μ] = ∫ᵛ x, f x ∂[B; μ] := by symm nth_rw 1 [← setIntegral_univ] - apply setIntegral_eq_of_subset_of_ae_diff_eq_zero hs MeasurableSet.univ (subset_univ _) + apply setIntegral_eq_of_subset_of_ae_sdiff_eq_zero hs MeasurableSet.univ (subset_univ _) apply (ae_restrict_iff' (MeasurableSet.univ.diff hs)).2 filter_upwards [h] with x hx h'x using hx h'x.2 diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean index e34cfce7c8688f..3fe6060781a2d4 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Semivariation.lean @@ -123,12 +123,12 @@ private lemma exists_one_le_enorm_apply_of_semivariation_eq_top · refine ⟨t, t_meas, ts, hI, ?_⟩ have : 1 + ‖μ s‖ₑ ≤ ‖μ (s \ t)‖ₑ + ‖μ s‖ₑ := by apply h't.trans - have : μ t = μ s - μ (s \ t) := by rw [← of_add_of_diff t_meas hs ts]; abel + have : μ t = μ s - μ (s \ t) := by rw [← of_add_of_sdiff t_meas hs ts]; abel rw [this, add_comm] exact enorm_sub_le rwa [ENNReal.add_le_add_iff_right (by simp)] at this - · refine ⟨s \ t, hs.diff t_meas, diff_subset, hI, ?_⟩ - simp only [sdiff_sdiff_right_self, Set.le_eq_subset, ts, inf_of_le_right] + · refine ⟨s \ t, hs.diff t_meas, sdiff_subset, hI, ?_⟩ + simp only [_root_.sdiff_sdiff_right_self, le_eq_subset, ts, inf_of_le_right] exact le_trans (by simp) h't private lemma semivariation_univ_lt_top : μ.semivariation univ < ∞ := by From fbd3d8ed4a37522b129ff5577d421c4b74d6418b Mon Sep 17 00:00:00 2001 From: sgouezel Date: Sun, 14 Jun 2026 22:24:32 +0200 Subject: [PATCH 129/129] better --- Mathlib/MeasureTheory/VectorMeasure/Prod.lean | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean index 4a828c740e54c1..3b8ffc3487bdef 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Prod.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Prod.lean @@ -58,8 +58,7 @@ lemma prod_eq_zero_of_not_hasProd (h : ¬HasProd μ ν B) : rcases eq_or_ne t ∅ with rfl | ht · simp by_cases h's : MeasurableSet s; swap - · simp only [h's, not_false_eq_true, not_measurable, _root_.map_zero, - ContinuousLinearMap.zero_apply] + · simp only [h's, not_false_eq_true, not_measurable, _root_.map_zero, _root_.zero_apply] rw [not_measurable] simp [measurableSet_prod, hs, ht, h's] by_cases h't : MeasurableSet t; swap @@ -358,11 +357,13 @@ theorem integral_prod {B : G →L[ℝ] F →L[ℝ] J} {C : J →L[ℝ] E →L[ /-- **Fubini's Theorem**: For integrable functions on `X × Y`, the vector measure integral of `f` for the product vector measure is equal to the iterated vector measure integral. Version where `f` is scalar. -/ -theorem integral_prod_smul [CompleteSpace H] [CompleteSpace F] {B : E →L[ℝ] F →L[ℝ] H} +theorem integral_prod_smul [CompleteSpace F] {B : E →L[ℝ] F →L[ℝ] H} [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] {f : X × Y → ℝ} (hf : Integrable f (μ.variation.prod ν.variation)) : - ∫ᵛ z, f z ∂•(μ.prod ν B) = ∫ᵛ x, (∫ᵛ y, f (x, y) ∂•ν) ∂[B.flip; μ] := - integral_prod hf (fun x y z ↦ by simp) + ∫ᵛ z, f z ∂•(μ.prod ν B) = ∫ᵛ x, (∫ᵛ y, f (x, y) ∂•ν) ∂[B.flip; μ] := by + by_cases h : CompleteSpace H + · exact integral_prod hf (fun x y z ↦ by simp) + · simp [integral_of_not_completeSpace, h] /-- Symmetric version of **Fubini's Theorem**: For integrable functions on `X × Y`, the vector measure integral of `f` for the product vector measure is equal to the iterated vector @@ -383,11 +384,13 @@ theorem integral_prod_symm {B : G →L[ℝ] E →L[ℝ] J} {C : J →L[ℝ] F the vector measure integral of `f` for the product vector measure is equal to the iterated vector measure integral. Version where `f` is scalar. This version has the integrals on the right-hand side in the other order. -/ -theorem integral_prod_smul_symm [CompleteSpace H] [CompleteSpace E] {B : E →L[ℝ] F →L[ℝ] H} +theorem integral_prod_smul_symm [CompleteSpace E] {B : E →L[ℝ] F →L[ℝ] H} [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] {f : X × Y → ℝ} (hf : Integrable f (μ.variation.prod ν.variation)) : - ∫ᵛ z, f z ∂•(μ.prod ν B) = ∫ᵛ y, (∫ᵛ x, f (x, y) ∂•μ) ∂[B; ν] := - integral_prod_symm hf (fun x y z ↦ by simp) + ∫ᵛ z, f z ∂•(μ.prod ν B) = ∫ᵛ y, (∫ᵛ x, f (x, y) ∂•μ) ∂[B; ν] := by + by_cases h : CompleteSpace H + · exact integral_prod_symm hf (fun x y z ↦ by simp) + · simp [integral_of_not_completeSpace, h] /-- Reversed version of **Fubini's Theorem**. -/ theorem integral_integral {B : G →L[ℝ] F →L[ℝ] J} {C : J →L[ℝ] E →L[ℝ] I} @@ -400,7 +403,7 @@ theorem integral_integral {B : G →L[ℝ] F →L[ℝ] J} {C : J →L[ℝ] E → (integral_prod hf h).symm /-- Reversed version of **Fubini's Theorem**, version with a scalar function. -/ -theorem integral_integral_smul [CompleteSpace H] [CompleteSpace F] {B : E →L[ℝ] F →L[ℝ] H} +theorem integral_integral_smul [CompleteSpace F] {B : E →L[ℝ] F →L[ℝ] H} [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] {f : X → Y → ℝ} (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) : ∫ᵛ x, (∫ᵛ y, f x y ∂•ν) ∂[B.flip; μ] = ∫ᵛ z, f z.1 z.2 ∂•(μ.prod ν B) := @@ -417,7 +420,7 @@ theorem integral_integral_symm {B : G →L[ℝ] E →L[ℝ] J} {C : J →L[ℝ] (integral_prod_symm hf h).symm /-- Reversed version of **Fubini's Theorem** (symmetric version), version with a scalar function. -/ -theorem integral_integral_smul_symm [CompleteSpace H] [CompleteSpace E] {B : E →L[ℝ] F →L[ℝ] H} +theorem integral_integral_smul_symm [CompleteSpace E] {B : E →L[ℝ] F →L[ℝ] H} [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] {f : X → Y → ℝ} (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) : ∫ᵛ y, (∫ᵛ x, f x y ∂•μ) ∂[B; ν] = ∫ᵛ z, f z.1 z.2 ∂•(μ.prod ν B) := @@ -428,12 +431,14 @@ We express this with respect to general pairing functions, with a compatibility condition saying that the compositions coincide up to reordering. -/ theorem integral_integral_swap [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] - ⦃f : X → Y → G⦄ [CompleteSpace H] [CompleteSpace I] [CompleteSpace J] + ⦃f : X → Y → G⦄ [CompleteSpace H] [CompleteSpace J] {B : G →L[ℝ] F →L[ℝ] H} {C : H →L[ℝ] E →L[ℝ] I} {A : G →L[ℝ] E →L[ℝ] J} {D : J →L[ℝ] F →L[ℝ] I} (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) (h : ∀ x y z, C (B x y) z = D (A x z) y) : ∫ᵛ x, ∫ᵛ y, f x y ∂[B; ν] ∂[C; μ] = ∫ᵛ y, ∫ᵛ x, f x y ∂[A; μ] ∂[D; ν] := by + by_cases hI : CompleteSpace I; swap + · simp [integral_of_not_completeSpace, hI] let P : (H →L[ℝ] I) →L[ℝ] (G →L[ℝ] H) →L[ℝ] (G →L[ℝ] I) := ContinuousLinearMap.compL ℝ G H I let A' := ContinuousLinearMap.bilinearComp P C.flip B.flip @@ -443,7 +448,7 @@ theorem integral_integral_swap /-- Change the order of Bochner integration in integrals wrt vector measures. Case where `f` is scalar. -/ -theorem integral_integral_smul_swap [CompleteSpace E] [CompleteSpace F] [CompleteSpace G] +theorem integral_integral_smul_swap [CompleteSpace E] [CompleteSpace F] [IsFiniteMeasure ν.variation] [IsFiniteMeasure μ.variation] ⦃f : X → Y → ℝ⦄ {B : E →L[ℝ] F →L[ℝ] G} (hf : Integrable (uncurry f) (μ.variation.prod ν.variation)) :