path stringlengths 11 71 | content stringlengths 75 124k |
|---|---|
MeasureTheory\Covering\LiminfLimsup.lean | /-
Copyright (c) 2022 Oliver Nash. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Nash
-/
import Mathlib.MeasureTheory.Covering.DensityTheorem
/-!
# Liminf, limsup, and uniformly locally doubling measures.
This file is a place to collect lemmas about liminf and limsup for subsets of a metric space
carrying a uniformly locally doubling measure.
## Main results:
* `blimsup_cthickening_mul_ae_eq`: the limsup of the closed thickening of a sequence of subsets
of a metric space is unchanged almost everywhere for a uniformly locally doubling measure if the
sequence of distances is multiplied by a positive scale factor. This is a generalisation of a
result of Cassels, appearing as Lemma 9 on page 217 of
[J.W.S. Cassels, *Some metrical theorems in Diophantine approximation. I*](cassels1950).
* `blimsup_thickening_mul_ae_eq`: a variant of `blimsup_cthickening_mul_ae_eq` for thickenings
rather than closed thickenings.
-/
open Set Filter Metric MeasureTheory TopologicalSpace
open scoped NNReal ENNReal Topology
variable {α : Type*} [MetricSpace α] [SecondCountableTopology α] [MeasurableSpace α] [BorelSpace α]
variable (μ : Measure α) [IsLocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure μ]
/-- This is really an auxiliary result en route to `blimsup_cthickening_ae_le_of_eventually_mul_le`
(which is itself an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`).
NB: The `: Set α` type ascription is present because of
https://github.com/leanprover-community/mathlib/issues/16932. -/
theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s : ℕ → Set α}
(hs : ∀ i, IsClosed (s i)) {r₁ r₂ : ℕ → ℝ} (hr : Tendsto r₁ atTop (𝓝[>] 0)) (hrp : 0 ≤ r₁)
{M : ℝ} (hM : 0 < M) (hM' : M < 1) (hMr : ∀ᶠ i in atTop, M * r₁ i ≤ r₂ i) :
(blimsup (fun i => cthickening (r₁ i) (s i)) atTop p : Set α) ≤ᵐ[μ]
(blimsup (fun i => cthickening (r₂ i) (s i)) atTop p : Set α) := by
/- Sketch of proof:
Assume that `p` is identically true for simplicity. Let `Y₁ i = cthickening (r₁ i) (s i)`, define
`Y₂` similarly except using `r₂`, and let `(Z i) = ⋃_{j ≥ i} (Y₂ j)`. Our goal is equivalent to
showing that `μ ((limsup Y₁) \ (Z i)) = 0` for all `i`.
Assume for contradiction that `μ ((limsup Y₁) \ (Z i)) ≠ 0` for some `i` and let
`W = (limsup Y₁) \ (Z i)`. Apply Lebesgue's density theorem to obtain a point `d` in `W` of
density `1`. Since `d ∈ limsup Y₁`, there is a subsequence of `j ↦ Y₁ j`, indexed by
`f 0 < f 1 < ...`, such that `d ∈ Y₁ (f j)` for all `j`. For each `j`, we may thus choose
`w j ∈ s (f j)` such that `d ∈ B j`, where `B j = closedBall (w j) (r₁ (f j))`. Note that
since `d` has density one, `μ (W ∩ (B j)) / μ (B j) → 1`.
We obtain our contradiction by showing that there exists `η < 1` such that
`μ (W ∩ (B j)) / μ (B j) ≤ η` for sufficiently large `j`. In fact we claim that `η = 1 - C⁻¹`
is such a value where `C` is the scaling constant of `M⁻¹` for the uniformly locally doubling
measure `μ`.
To prove the claim, let `b j = closedBall (w j) (M * r₁ (f j))` and for given `j` consider the
sets `b j` and `W ∩ (B j)`. These are both subsets of `B j` and are disjoint for large enough `j`
since `M * r₁ j ≤ r₂ j` and thus `b j ⊆ Z i ⊆ Wᶜ`. We thus have:
`μ (b j) + μ (W ∩ (B j)) ≤ μ (B j)`. Combining this with `μ (B j) ≤ C * μ (b j)` we obtain
the required inequality. -/
set Y₁ : ℕ → Set α := fun i => cthickening (r₁ i) (s i)
set Y₂ : ℕ → Set α := fun i => cthickening (r₂ i) (s i)
let Z : ℕ → Set α := fun i => ⋃ (j) (_ : p j ∧ i ≤ j), Y₂ j
suffices ∀ i, μ (atTop.blimsup Y₁ p \ Z i) = 0 by
rwa [ae_le_set, @blimsup_eq_iInf_biSup_of_nat _ _ _ Y₂, iInf_eq_iInter, diff_iInter,
measure_iUnion_null_iff]
intros i
set W := atTop.blimsup Y₁ p \ Z i
by_contra contra
obtain ⟨d, hd, hd'⟩ : ∃ d, d ∈ W ∧ ∀ {ι : Type _} {l : Filter ι} (w : ι → α) (δ : ι → ℝ),
Tendsto δ l (𝓝[>] 0) → (∀ᶠ j in l, d ∈ closedBall (w j) (2 * δ j)) →
Tendsto (fun j => μ (W ∩ closedBall (w j) (δ j)) / μ (closedBall (w j) (δ j))) l (𝓝 1) :=
Measure.exists_mem_of_measure_ne_zero_of_ae contra
(IsUnifLocDoublingMeasure.ae_tendsto_measure_inter_div μ W 2)
replace hd : d ∈ blimsup Y₁ atTop p := ((mem_diff _).mp hd).1
obtain ⟨f : ℕ → ℕ, hf⟩ := exists_forall_mem_of_hasBasis_mem_blimsup' atTop_basis hd
simp only [forall_and] at hf
obtain ⟨hf₀ : ∀ j, d ∈ cthickening (r₁ (f j)) (s (f j)), hf₁, hf₂ : ∀ j, j ≤ f j⟩ := hf
have hf₃ : Tendsto f atTop atTop :=
tendsto_atTop_atTop.mpr fun j => ⟨f j, fun i hi => (hf₂ j).trans (hi.trans <| hf₂ i)⟩
replace hr : Tendsto (r₁ ∘ f) atTop (𝓝[>] 0) := hr.comp hf₃
replace hMr : ∀ᶠ j in atTop, M * r₁ (f j) ≤ r₂ (f j) := hf₃.eventually hMr
replace hf₀ : ∀ j, ∃ w ∈ s (f j), d ∈ closedBall w (2 * r₁ (f j)) := by
intro j
specialize hrp (f j)
rw [Pi.zero_apply] at hrp
rcases eq_or_lt_of_le hrp with (hr0 | hrp')
· specialize hf₀ j
rw [← hr0, cthickening_zero, (hs (f j)).closure_eq] at hf₀
exact ⟨d, hf₀, by simp [← hr0]⟩
· simpa using mem_iUnion₂.mp (cthickening_subset_iUnion_closedBall_of_lt (s (f j))
(by positivity) (lt_two_mul_self hrp') (hf₀ j))
choose w hw hw' using hf₀
let C := IsUnifLocDoublingMeasure.scalingConstantOf μ M⁻¹
have hC : 0 < C :=
lt_of_lt_of_le zero_lt_one (IsUnifLocDoublingMeasure.one_le_scalingConstantOf μ M⁻¹)
suffices ∃ η < (1 : ℝ≥0),
∀ᶠ j in atTop, μ (W ∩ closedBall (w j) (r₁ (f j))) / μ (closedBall (w j) (r₁ (f j))) ≤ η by
obtain ⟨η, hη, hη'⟩ := this
replace hη' : 1 ≤ η := by
simpa only [ENNReal.one_le_coe_iff] using
le_of_tendsto (hd' w (fun j => r₁ (f j)) hr <| eventually_of_forall hw') hη'
exact (lt_self_iff_false _).mp (lt_of_lt_of_le hη hη')
refine ⟨1 - C⁻¹, tsub_lt_self zero_lt_one (inv_pos.mpr hC), ?_⟩
replace hC : C ≠ 0 := ne_of_gt hC
let b : ℕ → Set α := fun j => closedBall (w j) (M * r₁ (f j))
let B : ℕ → Set α := fun j => closedBall (w j) (r₁ (f j))
have h₁ : ∀ j, b j ⊆ B j := fun j =>
closedBall_subset_closedBall (mul_le_of_le_one_left (hrp (f j)) hM'.le)
have h₂ : ∀ j, W ∩ B j ⊆ B j := fun j => inter_subset_right
have h₃ : ∀ᶠ j in atTop, Disjoint (b j) (W ∩ B j) := by
apply hMr.mp
rw [eventually_atTop]
refine
⟨i, fun j hj hj' => Disjoint.inf_right (B j) <| Disjoint.inf_right' (blimsup Y₁ atTop p) ?_⟩
change Disjoint (b j) (Z i)ᶜ
rw [disjoint_compl_right_iff_subset]
refine (closedBall_subset_cthickening (hw j) (M * r₁ (f j))).trans
((cthickening_mono hj' _).trans fun a ha => ?_)
simp only [Z, mem_iUnion, exists_prop]
exact ⟨f j, ⟨hf₁ j, hj.le.trans (hf₂ j)⟩, ha⟩
have h₄ : ∀ᶠ j in atTop, μ (B j) ≤ C * μ (b j) :=
(hr.eventually (IsUnifLocDoublingMeasure.eventually_measure_le_scaling_constant_mul'
μ M hM)).mono fun j hj => hj (w j)
refine (h₃.and h₄).mono fun j hj₀ => ?_
change μ (W ∩ B j) / μ (B j) ≤ ↑(1 - C⁻¹)
rcases eq_or_ne (μ (B j)) ∞ with (hB | hB); · simp [hB]
apply ENNReal.div_le_of_le_mul
rw [ENNReal.coe_sub, ENNReal.coe_one, ENNReal.sub_mul fun _ _ => hB, one_mul]
replace hB : ↑C⁻¹ * μ (B j) ≠ ∞ := by
refine ENNReal.mul_ne_top ?_ hB
rwa [ENNReal.coe_inv hC, Ne, ENNReal.inv_eq_top, ENNReal.coe_eq_zero]
obtain ⟨hj₁ : Disjoint (b j) (W ∩ B j), hj₂ : μ (B j) ≤ C * μ (b j)⟩ := hj₀
replace hj₂ : ↑C⁻¹ * μ (B j) ≤ μ (b j) := by
rw [ENNReal.coe_inv hC, ← ENNReal.div_eq_inv_mul]
exact ENNReal.div_le_of_le_mul' hj₂
have hj₃ : ↑C⁻¹ * μ (B j) + μ (W ∩ B j) ≤ μ (B j) := by
refine le_trans (add_le_add_right hj₂ _) ?_
rw [← measure_union' hj₁ measurableSet_closedBall]
exact measure_mono (union_subset (h₁ j) (h₂ j))
replace hj₃ := tsub_le_tsub_right hj₃ (↑C⁻¹ * μ (B j))
rwa [ENNReal.add_sub_cancel_left hB] at hj₃
/-- This is really an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`.
NB: The `: Set α` type ascription is present because of
https://github.com/leanprover-community/mathlib/issues/16932. -/
theorem blimsup_cthickening_ae_le_of_eventually_mul_le (p : ℕ → Prop) {s : ℕ → Set α} {M : ℝ}
(hM : 0 < M) {r₁ r₂ : ℕ → ℝ} (hr : Tendsto r₁ atTop (𝓝[>] 0))
(hMr : ∀ᶠ i in atTop, M * r₁ i ≤ r₂ i) :
(blimsup (fun i => cthickening (r₁ i) (s i)) atTop p : Set α) ≤ᵐ[μ]
(blimsup (fun i => cthickening (r₂ i) (s i)) atTop p : Set α) := by
let R₁ i := max 0 (r₁ i)
let R₂ i := max 0 (r₂ i)
have hRp : 0 ≤ R₁ := fun i => le_max_left 0 (r₁ i)
replace hMr : ∀ᶠ i in atTop, M * R₁ i ≤ R₂ i := by
refine hMr.mono fun i hi ↦ ?_
rw [mul_max_of_nonneg _ _ hM.le, mul_zero]
exact max_le_max (le_refl 0) hi
simp_rw [← cthickening_max_zero (r₁ _), ← cthickening_max_zero (r₂ _)]
rcases le_or_lt 1 M with hM' | hM'
· apply HasSubset.Subset.eventuallyLE
change _ ≤ _
refine mono_blimsup' (hMr.mono fun i hi _ => cthickening_mono ?_ (s i))
exact (le_mul_of_one_le_left (hRp i) hM').trans hi
· simp only [← @cthickening_closure _ _ _ (s _)]
have hs : ∀ i, IsClosed (closure (s i)) := fun i => isClosed_closure
exact blimsup_cthickening_ae_le_of_eventually_mul_le_aux μ p hs
(tendsto_nhds_max_right hr) hRp hM hM' hMr
/-- Given a sequence of subsets `sᵢ` of a metric space, together with a sequence of radii `rᵢ`
such that `rᵢ → 0`, the set of points which belong to infinitely many of the closed
`rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a uniformly locally doubling measure if
the `rᵢ` are all scaled by a positive constant.
This lemma is a generalisation of Lemma 9 appearing on page 217 of
[J.W.S. Cassels, *Some metrical theorems in Diophantine approximation. I*](cassels1950).
See also `blimsup_thickening_mul_ae_eq`.
NB: The `: Set α` type ascription is present because of
https://github.com/leanprover-community/mathlib/issues/16932. -/
theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M : ℝ} (hM : 0 < M)
(r : ℕ → ℝ) (hr : Tendsto r atTop (𝓝 0)) :
(blimsup (fun i => cthickening (M * r i) (s i)) atTop p : Set α) =ᵐ[μ]
(blimsup (fun i => cthickening (r i) (s i)) atTop p : Set α) := by
have : ∀ (p : ℕ → Prop) {r : ℕ → ℝ} (_ : Tendsto r atTop (𝓝[>] 0)),
(blimsup (fun i => cthickening (M * r i) (s i)) atTop p : Set α) =ᵐ[μ]
(blimsup (fun i => cthickening (r i) (s i)) atTop p : Set α) := by
clear p hr r; intro p r hr
have hr' : Tendsto (fun i => M * r i) atTop (𝓝[>] 0) := by
convert TendstoNhdsWithinIoi.const_mul hM hr <;> simp only [mul_zero]
refine eventuallyLE_antisymm_iff.mpr ⟨?_, ?_⟩
· exact blimsup_cthickening_ae_le_of_eventually_mul_le μ p (inv_pos.mpr hM) hr'
(eventually_of_forall fun i => by rw [inv_mul_cancel_left₀ hM.ne' (r i)])
· exact blimsup_cthickening_ae_le_of_eventually_mul_le μ p hM hr
(eventually_of_forall fun i => le_refl _)
let r' : ℕ → ℝ := fun i => if 0 < r i then r i else 1 / ((i : ℝ) + 1)
have hr' : Tendsto r' atTop (𝓝[>] 0) := by
refine tendsto_nhdsWithin_iff.mpr
⟨Tendsto.if' hr tendsto_one_div_add_atTop_nhds_zero_nat, eventually_of_forall fun i => ?_⟩
by_cases hi : 0 < r i
· simp [r', hi]
· simp only [r', hi, one_div, mem_Ioi, if_false, inv_pos]; positivity
have h₀ : ∀ i, p i ∧ 0 < r i → cthickening (r i) (s i) = cthickening (r' i) (s i) := by
rintro i ⟨-, hi⟩; congr! 1; change r i = ite (0 < r i) (r i) _; simp [hi]
have h₁ : ∀ i, p i ∧ 0 < r i → cthickening (M * r i) (s i) = cthickening (M * r' i) (s i) := by
rintro i ⟨-, hi⟩; simp only [r', hi, mul_ite, if_true]
have h₂ : ∀ i, p i ∧ r i ≤ 0 → cthickening (M * r i) (s i) = cthickening (r i) (s i) := by
rintro i ⟨-, hi⟩
have hi' : M * r i ≤ 0 := mul_nonpos_of_nonneg_of_nonpos hM.le hi
rw [cthickening_of_nonpos hi, cthickening_of_nonpos hi']
have hp : p = fun i => p i ∧ 0 < r i ∨ p i ∧ r i ≤ 0 := by
ext i; simp [← and_or_left, lt_or_le 0 (r i)]
rw [hp, blimsup_or_eq_sup, blimsup_or_eq_sup]
simp only [sup_eq_union]
rw [blimsup_congr (eventually_of_forall h₀), blimsup_congr (eventually_of_forall h₁),
blimsup_congr (eventually_of_forall h₂)]
exact ae_eq_set_union (this (fun i => p i ∧ 0 < r i) hr') (ae_eq_refl _)
theorem blimsup_cthickening_ae_eq_blimsup_thickening {p : ℕ → Prop} {s : ℕ → Set α} {r : ℕ → ℝ}
(hr : Tendsto r atTop (𝓝 0)) (hr' : ∀ᶠ i in atTop, p i → 0 < r i) :
(blimsup (fun i => cthickening (r i) (s i)) atTop p : Set α) =ᵐ[μ]
(blimsup (fun i => thickening (r i) (s i)) atTop p : Set α) := by
refine eventuallyLE_antisymm_iff.mpr ⟨?_, HasSubset.Subset.eventuallyLE (?_ : _ ≤ _)⟩
· rw [eventuallyLE_congr (blimsup_cthickening_mul_ae_eq μ p s (@one_half_pos ℝ _) r hr).symm
EventuallyEq.rfl]
apply HasSubset.Subset.eventuallyLE
change _ ≤ _
refine mono_blimsup' (hr'.mono fun i hi pi => cthickening_subset_thickening' (hi pi) ?_ (s i))
nlinarith [hi pi]
· exact mono_blimsup fun i _ => thickening_subset_cthickening _ _
/-- An auxiliary result en route to `blimsup_thickening_mul_ae_eq`. -/
theorem blimsup_thickening_mul_ae_eq_aux (p : ℕ → Prop) (s : ℕ → Set α) {M : ℝ} (hM : 0 < M)
(r : ℕ → ℝ) (hr : Tendsto r atTop (𝓝 0)) (hr' : ∀ᶠ i in atTop, p i → 0 < r i) :
(blimsup (fun i => thickening (M * r i) (s i)) atTop p : Set α) =ᵐ[μ]
(blimsup (fun i => thickening (r i) (s i)) atTop p : Set α) := by
have h₁ := blimsup_cthickening_ae_eq_blimsup_thickening (s := s) μ hr hr'
have h₂ := blimsup_cthickening_mul_ae_eq μ p s hM r hr
replace hr : Tendsto (fun i => M * r i) atTop (𝓝 0) := by convert hr.const_mul M; simp
replace hr' : ∀ᶠ i in atTop, p i → 0 < M * r i := hr'.mono fun i hi hip ↦ mul_pos hM (hi hip)
have h₃ := blimsup_cthickening_ae_eq_blimsup_thickening (s := s) μ hr hr'
exact h₃.symm.trans (h₂.trans h₁)
/-- Given a sequence of subsets `sᵢ` of a metric space, together with a sequence of radii `rᵢ`
such that `rᵢ → 0`, the set of points which belong to infinitely many of the
`rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a uniformly locally doubling measure if
the `rᵢ` are all scaled by a positive constant.
This lemma is a generalisation of Lemma 9 appearing on page 217 of
[J.W.S. Cassels, *Some metrical theorems in Diophantine approximation. I*](cassels1950).
See also `blimsup_cthickening_mul_ae_eq`.
NB: The `: Set α` type ascription is present because of
https://github.com/leanprover-community/mathlib/issues/16932. -/
theorem blimsup_thickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M : ℝ} (hM : 0 < M) (r : ℕ → ℝ)
(hr : Tendsto r atTop (𝓝 0)) :
(blimsup (fun i => thickening (M * r i) (s i)) atTop p : Set α) =ᵐ[μ]
(blimsup (fun i => thickening (r i) (s i)) atTop p : Set α) := by
let q : ℕ → Prop := fun i => p i ∧ 0 < r i
have h₁ : blimsup (fun i => thickening (r i) (s i)) atTop p =
blimsup (fun i => thickening (r i) (s i)) atTop q := by
refine blimsup_congr' (eventually_of_forall fun i h => ?_)
replace hi : 0 < r i := by contrapose! h; apply thickening_of_nonpos h
simp only [q, hi, iff_self_and, imp_true_iff]
have h₂ : blimsup (fun i => thickening (M * r i) (s i)) atTop p =
blimsup (fun i => thickening (M * r i) (s i)) atTop q := by
refine blimsup_congr' (eventually_of_forall fun i h ↦ ?_)
replace h : 0 < r i := by
rw [← mul_pos_iff_of_pos_left hM]; contrapose! h; apply thickening_of_nonpos h
simp only [q, h, iff_self_and, imp_true_iff]
rw [h₁, h₂]
exact blimsup_thickening_mul_ae_eq_aux μ q s hM r hr (eventually_of_forall fun i hi => hi.2)
|
MeasureTheory\Covering\OneDim.lean | /-
Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
import Mathlib.MeasureTheory.Covering.DensityTheorem
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
/-!
# Covering theorems for Lebesgue measure in one dimension
We have a general theory of covering theorems for doubling measures, developed notably
in `DensityTheorem.lean`. In this file, we expand the API for this theory in one dimension,
by showing that intervals belong to the relevant Vitali family.
-/
open Set MeasureTheory IsUnifLocDoublingMeasure Filter
open scoped Topology
namespace Real
theorem Icc_mem_vitaliFamily_at_right {x y : ℝ} (hxy : x < y) :
Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt x := by
rw [Icc_eq_closedBall]
refine closedBall_mem_vitaliFamily_of_dist_le_mul _ ?_ (by linarith)
rw [dist_comm, Real.dist_eq, abs_of_nonneg] <;> linarith
theorem tendsto_Icc_vitaliFamily_right (x : ℝ) :
Tendsto (fun y => Icc x y) (𝓝[>] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
refine (VitaliFamily.tendsto_filterAt_iff _).2 ⟨?_, ?_⟩
· filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_right hy
· intro ε εpos
have : x ∈ Ico x (x + ε) := ⟨le_refl _, by linarith⟩
filter_upwards [Icc_mem_nhdsWithin_Ioi this] with y hy
rw [closedBall_eq_Icc]
exact Icc_subset_Icc (by linarith) hy.2
theorem Icc_mem_vitaliFamily_at_left {x y : ℝ} (hxy : x < y) :
Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt y := by
rw [Icc_eq_closedBall]
refine closedBall_mem_vitaliFamily_of_dist_le_mul _ ?_ (by linarith)
rw [Real.dist_eq, abs_of_nonneg] <;> linarith
theorem tendsto_Icc_vitaliFamily_left (x : ℝ) :
Tendsto (fun y => Icc y x) (𝓝[<] x) ((vitaliFamily (volume : Measure ℝ) 1).filterAt x) := by
refine (VitaliFamily.tendsto_filterAt_iff _).2 ⟨?_, ?_⟩
· filter_upwards [self_mem_nhdsWithin] with y hy using Icc_mem_vitaliFamily_at_left hy
· intro ε εpos
have : x ∈ Ioc (x - ε) x := ⟨by linarith, le_refl _⟩
filter_upwards [Icc_mem_nhdsWithin_Iio this] with y hy
rw [closedBall_eq_Icc]
exact Icc_subset_Icc hy.1 (by linarith)
end Real
|
MeasureTheory\Covering\Vitali.lean | /-
Copyright (c) 2021 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic
import Mathlib.MeasureTheory.Covering.VitaliFamily
import Mathlib.Data.Set.Pairwise.Lattice
/-!
# Vitali covering theorems
The topological Vitali covering theorem, in its most classical version, states the following.
Consider a family of balls `(B (x_i, r_i))_{i ∈ I}` in a metric space, with uniformly bounded
radii. Then one can extract a disjoint subfamily indexed by `J ⊆ I`, such that any `B (x_i, r_i)`
is included in a ball `B (x_j, 5 r_j)`.
We prove this theorem in `Vitali.exists_disjoint_subfamily_covering_enlargment_closedBall`.
It is deduced from a more general version, called
`Vitali.exists_disjoint_subfamily_covering_enlargment`, which applies to any family of sets
together with a size function `δ` (think "radius" or "diameter").
We deduce the measurable Vitali covering theorem. Assume one is given a family `t` of closed sets
with nonempty interior, such that each `a ∈ t` is included in a ball `B (x, r)` and covers a
definite proportion of the ball `B (x, 6 r)` for a given measure `μ` (think of the situation
where `μ` is a doubling measure and `t` is a family of balls). Consider a set `s` at which the
family is fine, i.e., every point of `s` belongs to arbitrarily small elements of `t`. Then one
can extract from `t` a disjoint subfamily that covers almost all `s`. It is proved in
`Vitali.exists_disjoint_covering_ae`.
A way to restate this theorem is to say that the set of closed sets `a` with nonempty interior
covering a fixed proportion `1/C` of the ball `closedBall x (3 * diam a)` forms a Vitali family.
This version is given in `Vitali.vitaliFamily`.
-/
variable {α ι : Type*}
open Set Metric MeasureTheory TopologicalSpace Filter
open scoped NNReal ENNReal Topology
namespace Vitali
/-- **Vitali covering theorem**: given a set `t` of subsets of a type, one may extract a disjoint
subfamily `u` such that the `τ`-enlargment of this family covers all elements of `t`, where `τ > 1`
is any fixed number.
When `t` is a family of balls, the `τ`-enlargment of `ball x r` is `ball x ((1+2τ) r)`. In general,
it is expressed in terms of a function `δ` (think "radius" or "diameter"), positive and bounded on
all elements of `t`. The condition is that every element `a` of `t` should intersect an
element `b` of `u` of size larger than that of `a` up to `τ`, i.e., `δ b ≥ δ a / τ`.
We state the lemma slightly more generally, with an indexed family of sets `B a` for `a ∈ t`, for
wider applicability.
-/
theorem exists_disjoint_subfamily_covering_enlargment (B : ι → Set α) (t : Set ι) (δ : ι → ℝ)
(τ : ℝ) (hτ : 1 < τ) (δnonneg : ∀ a ∈ t, 0 ≤ δ a) (R : ℝ) (δle : ∀ a ∈ t, δ a ≤ R)
(hne : ∀ a ∈ t, (B a).Nonempty) :
∃ u ⊆ t,
u.PairwiseDisjoint B ∧ ∀ a ∈ t, ∃ b ∈ u, (B a ∩ B b).Nonempty ∧ δ a ≤ τ * δ b := by
/- The proof could be formulated as a transfinite induction. First pick an element of `t` with `δ`
as large as possible (up to a factor of `τ`). Then among the remaining elements not intersecting
the already chosen one, pick another element with large `δ`. Go on forever (transfinitely) until
there is nothing left.
Instead, we give a direct Zorn-based argument. Consider a maximal family `u` of disjoint sets
with the following property: if an element `a` of `t` intersects some element `b` of `u`, then it
intersects some `b' ∈ u` with `δ b' ≥ δ a / τ`. Such a maximal family exists by Zorn. If this
family did not intersect some element `a ∈ t`, then take an element `a' ∈ t` which does not
intersect any element of `u`, with `δ a'` almost as large as possible. One checks easily
that `u ∪ {a'}` still has this property, contradicting the maximality. Therefore, `u`
intersects all elements of `t`, and by definition it satisfies all the desired properties.
-/
let T : Set (Set ι) := { u | u ⊆ t ∧ u.PairwiseDisjoint B ∧
∀ a ∈ t, ∀ b ∈ u, (B a ∩ B b).Nonempty → ∃ c ∈ u, (B a ∩ B c).Nonempty ∧ δ a ≤ τ * δ c }
-- By Zorn, choose a maximal family in the good set `T` of disjoint families.
obtain ⟨u, uT, hu⟩ : ∃ u ∈ T, ∀ v ∈ T, u ⊆ v → v = u := by
refine zorn_subset _ fun U UT hU => ?_
refine ⟨⋃₀ U, ?_, fun s hs => subset_sUnion_of_mem hs⟩
simp only [T, Set.sUnion_subset_iff, and_imp, exists_prop, forall_exists_index, mem_sUnion,
Set.mem_setOf_eq]
refine
⟨fun u hu => (UT hu).1, (pairwiseDisjoint_sUnion hU.directedOn).2 fun u hu => (UT hu).2.1,
fun a hat b u uU hbu hab => ?_⟩
obtain ⟨c, cu, ac, hc⟩ : ∃ c, c ∈ u ∧ (B a ∩ B c).Nonempty ∧ δ a ≤ τ * δ c :=
(UT uU).2.2 a hat b hbu hab
exact ⟨c, ⟨u, uU, cu⟩, ac, hc⟩
-- The only nontrivial bit is to check that every `a ∈ t` intersects an element `b ∈ u` with
-- comparatively large `δ b`. Assume this is not the case, then we will contradict the maximality.
refine ⟨u, uT.1, uT.2.1, fun a hat => ?_⟩
contrapose! hu
have a_disj : ∀ c ∈ u, Disjoint (B a) (B c) := by
intro c hc
by_contra h
rw [not_disjoint_iff_nonempty_inter] at h
obtain ⟨d, du, ad, hd⟩ : ∃ d, d ∈ u ∧ (B a ∩ B d).Nonempty ∧ δ a ≤ τ * δ d :=
uT.2.2 a hat c hc h
exact lt_irrefl _ ((hu d du ad).trans_le hd)
-- Let `A` be all the elements of `t` which do not intersect the family `u`. It is nonempty as it
-- contains `a`. We will pick an element `a'` of `A` with `δ a'` almost as large as possible.
let A := { a' | a' ∈ t ∧ ∀ c ∈ u, Disjoint (B a') (B c) }
have Anonempty : A.Nonempty := ⟨a, hat, a_disj⟩
let m := sSup (δ '' A)
have bddA : BddAbove (δ '' A) := by
refine ⟨R, fun x xA => ?_⟩
rcases (mem_image _ _ _).1 xA with ⟨a', ha', rfl⟩
exact δle a' ha'.1
obtain ⟨a', a'A, ha'⟩ : ∃ a' ∈ A, m / τ ≤ δ a' := by
have : 0 ≤ m := (δnonneg a hat).trans (le_csSup bddA (mem_image_of_mem _ ⟨hat, a_disj⟩))
rcases eq_or_lt_of_le this with (mzero | mpos)
· refine ⟨a, ⟨hat, a_disj⟩, ?_⟩
simpa only [← mzero, zero_div] using δnonneg a hat
· have I : m / τ < m := by
rw [div_lt_iff (zero_lt_one.trans hτ)]
conv_lhs => rw [← mul_one m]
exact (mul_lt_mul_left mpos).2 hτ
rcases exists_lt_of_lt_csSup (Anonempty.image _) I with ⟨x, xA, hx⟩
rcases (mem_image _ _ _).1 xA with ⟨a', ha', rfl⟩
exact ⟨a', ha', hx.le⟩
clear hat hu a_disj a
have a'_ne_u : a' ∉ u := fun H => (hne _ a'A.1).ne_empty (disjoint_self.1 (a'A.2 _ H))
-- we claim that `u ∪ {a'}` still belongs to `T`, contradicting the maximality of `u`.
refine ⟨insert a' u, ⟨?_, ?_, ?_⟩, subset_insert _ _, (ne_insert_of_not_mem _ a'_ne_u).symm⟩
· -- check that `u ∪ {a'}` is made of elements of `t`.
rw [insert_subset_iff]
exact ⟨a'A.1, uT.1⟩
· -- Check that `u ∪ {a'}` is a disjoint family. This follows from the fact that `a'` does not
-- intersect `u`.
exact uT.2.1.insert fun b bu _ => a'A.2 b bu
· -- check that every element `c` of `t` intersecting `u ∪ {a'}` intersects an element of this
-- family with large `δ`.
intro c ct b ba'u hcb
-- if `c` already intersects an element of `u`, then it intersects an element of `u` with
-- large `δ` by the assumption on `u`, and there is nothing left to do.
by_cases H : ∃ d ∈ u, (B c ∩ B d).Nonempty
· rcases H with ⟨d, du, hd⟩
rcases uT.2.2 c ct d du hd with ⟨d', d'u, hd'⟩
exact ⟨d', mem_insert_of_mem _ d'u, hd'⟩
· -- Otherwise, `c` belongs to `A`. The element of `u ∪ {a'}` that it intersects has to be `a'`.
-- Moreover, `δ c` is smaller than the maximum `m` of `δ` over `A`, which is `≤ δ a' / τ`
-- thanks to the good choice of `a'`. This is the desired inequality.
push_neg at H
simp only [← disjoint_iff_inter_eq_empty] at H
rcases mem_insert_iff.1 ba'u with (rfl | H')
· refine ⟨b, mem_insert _ _, hcb, ?_⟩
calc
δ c ≤ m := le_csSup bddA (mem_image_of_mem _ ⟨ct, H⟩)
_ = τ * (m / τ) := by field_simp [(zero_lt_one.trans hτ).ne']
_ ≤ τ * δ b := by gcongr
· rw [← not_disjoint_iff_nonempty_inter] at hcb
exact (hcb (H _ H')).elim
/-- Vitali covering theorem, closed balls version: given a family `t` of closed balls, one can
extract a disjoint subfamily `u ⊆ t` so that all balls in `t` are covered by the τ-times
dilations of balls in `u`, for some `τ > 3`. -/
theorem exists_disjoint_subfamily_covering_enlargment_closedBall [MetricSpace α] (t : Set ι)
(x : ι → α) (r : ι → ℝ) (R : ℝ) (hr : ∀ a ∈ t, r a ≤ R) (τ : ℝ) (hτ : 3 < τ) :
∃ u ⊆ t,
(u.PairwiseDisjoint fun a => closedBall (x a) (r a)) ∧
∀ a ∈ t, ∃ b ∈ u, closedBall (x a) (r a) ⊆ closedBall (x b) (τ * r b) := by
rcases eq_empty_or_nonempty t with (rfl | _)
· exact ⟨∅, Subset.refl _, pairwiseDisjoint_empty, by simp⟩
by_cases ht : ∀ a ∈ t, r a < 0
· exact ⟨t, Subset.rfl, fun a ha b _ _ => by
#adaptation_note /-- nightly-2024-03-16
Previously `Function.onFun` unfolded in the following `simp only`,
but now needs a separate `rw`.
This may be a bug: a no import minimization may be required. -/
rw [Function.onFun]
simp only [Function.onFun, closedBall_eq_empty.2 (ht a ha), empty_disjoint],
fun a ha => ⟨a, ha, by simp only [closedBall_eq_empty.2 (ht a ha), empty_subset]⟩⟩
push_neg at ht
let t' := { a ∈ t | 0 ≤ r a }
rcases exists_disjoint_subfamily_covering_enlargment (fun a => closedBall (x a) (r a)) t' r
((τ - 1) / 2) (by linarith) (fun a ha => ha.2) R (fun a ha => hr a ha.1) fun a ha =>
⟨x a, mem_closedBall_self ha.2⟩ with
⟨u, ut', u_disj, hu⟩
have A : ∀ a ∈ t', ∃ b ∈ u, closedBall (x a) (r a) ⊆ closedBall (x b) (τ * r b) := by
intro a ha
rcases hu a ha with ⟨b, bu, hb, rb⟩
refine ⟨b, bu, ?_⟩
have : dist (x a) (x b) ≤ r a + r b := dist_le_add_of_nonempty_closedBall_inter_closedBall hb
apply closedBall_subset_closedBall'
linarith
refine ⟨u, ut'.trans fun a ha => ha.1, u_disj, fun a ha => ?_⟩
rcases le_or_lt 0 (r a) with (h'a | h'a)
· exact A a ⟨ha, h'a⟩
· rcases ht with ⟨b, rb⟩
rcases A b ⟨rb.1, rb.2⟩ with ⟨c, cu, _⟩
exact ⟨c, cu, by simp only [closedBall_eq_empty.2 h'a, empty_subset]⟩
/-- The measurable Vitali covering theorem. Assume one is given a family `t` of closed sets with
nonempty interior, such that each `a ∈ t` is included in a ball `B (x, r)` and covers a definite
proportion of the ball `B (x, 3 r)` for a given measure `μ` (think of the situation where `μ` is
a doubling measure and `t` is a family of balls). Consider a (possibly non-measurable) set `s`
at which the family is fine, i.e., every point of `s` belongs to arbitrarily small elements of `t`.
Then one can extract from `t` a disjoint subfamily that covers almost all `s`.
For more flexibility, we give a statement with a parameterized family of sets.
-/
theorem exists_disjoint_covering_ae [MetricSpace α] [MeasurableSpace α] [OpensMeasurableSpace α]
[SecondCountableTopology α] (μ : Measure α) [IsLocallyFiniteMeasure μ] (s : Set α) (t : Set ι)
(C : ℝ≥0) (r : ι → ℝ) (c : ι → α) (B : ι → Set α) (hB : ∀ a ∈ t, B a ⊆ closedBall (c a) (r a))
(μB : ∀ a ∈ t, μ (closedBall (c a) (3 * r a)) ≤ C * μ (B a))
(ht : ∀ a ∈ t, (interior (B a)).Nonempty) (h't : ∀ a ∈ t, IsClosed (B a))
(hf : ∀ x ∈ s, ∀ ε > (0 : ℝ), ∃ a ∈ t, r a ≤ ε ∧ c a = x) :
∃ u ⊆ t, u.Countable ∧ u.PairwiseDisjoint B ∧ μ (s \ ⋃ a ∈ u, B a) = 0 := by
/- The idea of the proof is the following. Assume for simplicity that `μ` is finite. Applying the
abstract Vitali covering theorem with `δ = r` given by `hf`, one obtains a disjoint subfamily `u`,
such that any element of `t` intersects an element of `u` with comparable radius. Fix `ε > 0`.
Since the elements of `u` have summable measure, one can remove finitely elements `w_1, ..., w_n`.
so that the measure of the remaining elements is `< ε`. Consider now a point `z` not
in the `w_i`. There is a small ball around `z` not intersecting the `w_i` (as they are closed),
an element `a ∈ t` contained in this small ball (as the family `t` is fine at `z`) and an element
`b ∈ u` intersecting `a`, with comparable radius (by definition of `u`). Then `z` belongs to the
enlargement of `b`. This shows that `s \ (w_1 ∪ ... ∪ w_n)` is contained in
`⋃ (b ∈ u \ {w_1, ... w_n}) (enlargement of b)`. The measure of the latter set is bounded by
`∑ (b ∈ u \ {w_1, ... w_n}) C * μ b` (by the doubling property of the measure), which is at most
`C ε`. Letting `ε` tend to `0` shows that `s` is almost everywhere covered by the family `u`.
For the real argument, the measure is only locally finite. Therefore, we implement the same
strategy, but locally restricted to balls on which the measure is finite. For this, we do not
use the whole family `t`, but a subfamily `t'` supported on small balls (which is possible since
the family is assumed to be fine at every point of `s`).
-/
classical
-- choose around each `x` a small ball on which the measure is finite
have : ∀ x, ∃ R, 0 < R ∧ R ≤ 1 ∧ μ (closedBall x (20 * R)) < ∞ := fun x ↦ by
refine ((eventually_le_nhds one_pos).and ?_).exists_gt
refine (tendsto_closedBall_smallSets x).comp ?_ (μ.finiteAt_nhds x).eventually
exact Continuous.tendsto' (by fun_prop) _ _ (mul_zero _)
choose R hR0 hR1 hRμ using this
-- we restrict to a subfamily `t'` of `t`, made of elements small enough to ensure that
-- they only see a finite part of the measure, and with a doubling property
let t' := { a ∈ t | r a ≤ R (c a) }
-- extract a disjoint subfamily `u` of `t'` thanks to the abstract Vitali covering theorem.
obtain ⟨u, ut', u_disj, hu⟩ : ∃ u ⊆ t',
u.PairwiseDisjoint B ∧ ∀ a ∈ t', ∃ b ∈ u, (B a ∩ B b).Nonempty ∧ r a ≤ 2 * r b := by
have A : ∀ a ∈ t', r a ≤ 1 := by
intro a ha
apply ha.2.trans (hR1 (c a))
have A' : ∀ a ∈ t', (B a).Nonempty :=
fun a hat' => Set.Nonempty.mono interior_subset (ht a hat'.1)
refine exists_disjoint_subfamily_covering_enlargment B t' r 2 one_lt_two (fun a ha => ?_) 1 A A'
exact nonempty_closedBall.1 ((A' a ha).mono (hB a ha.1))
have ut : u ⊆ t := fun a hau => (ut' hau).1
-- As the space is second countable, the family is countable since all its sets have nonempty
-- interior.
have u_count : u.Countable := u_disj.countable_of_nonempty_interior fun a ha => ht a (ut ha)
-- the family `u` will be the desired family
refine ⟨u, fun a hat' => (ut' hat').1, u_count, u_disj, ?_⟩
-- it suffices to show that it covers almost all `s` locally around each point `x`.
refine measure_null_of_locally_null _ fun x _ => ?_
-- let `v` be the subfamily of `u` made of those sets intersecting the small ball `ball x (r x)`
let v := { a ∈ u | (B a ∩ ball x (R x)).Nonempty }
have vu : v ⊆ u := fun a ha => ha.1
-- they are all contained in a fixed ball of finite measure, thanks to our choice of `t'`
obtain ⟨K, μK, hK⟩ : ∃ K, μ (closedBall x K) < ∞ ∧
∀ a ∈ u, (B a ∩ ball x (R x)).Nonempty → B a ⊆ closedBall x K := by
have Idist_v : ∀ a ∈ v, dist (c a) x ≤ r a + R x := by
intro a hav
apply dist_le_add_of_nonempty_closedBall_inter_closedBall
refine hav.2.mono ?_
apply inter_subset_inter _ ball_subset_closedBall
exact hB a (ut (vu hav))
set R0 := sSup (r '' v) with R0_def
have R0_bdd : BddAbove (r '' v) := by
refine ⟨1, fun r' hr' => ?_⟩
rcases (mem_image _ _ _).1 hr' with ⟨b, hb, rfl⟩
exact le_trans (ut' (vu hb)).2 (hR1 (c b))
rcases le_total R0 (R x) with (H | H)
· refine ⟨20 * R x, hRμ x, fun a au hax => ?_⟩
refine (hB a (ut au)).trans ?_
apply closedBall_subset_closedBall'
have : r a ≤ R0 := le_csSup R0_bdd (mem_image_of_mem _ ⟨au, hax⟩)
linarith [Idist_v a ⟨au, hax⟩, hR0 x]
· have R0pos : 0 < R0 := (hR0 x).trans_le H
have vnonempty : v.Nonempty := by
by_contra h
rw [nonempty_iff_ne_empty, Classical.not_not] at h
rw [h, image_empty, Real.sSup_empty] at R0_def
exact lt_irrefl _ (R0pos.trans_le (le_of_eq R0_def))
obtain ⟨a, hav, R0a⟩ : ∃ a ∈ v, R0 / 2 < r a := by
obtain ⟨r', r'mem, hr'⟩ : ∃ r' ∈ r '' v, R0 / 2 < r' :=
exists_lt_of_lt_csSup (vnonempty.image _) (half_lt_self R0pos)
rcases (mem_image _ _ _).1 r'mem with ⟨a, hav, rfl⟩
exact ⟨a, hav, hr'⟩
refine ⟨8 * R0, ?_, ?_⟩
· apply lt_of_le_of_lt (measure_mono _) (hRμ (c a))
apply closedBall_subset_closedBall'
rw [dist_comm]
linarith [Idist_v a hav, (ut' (vu hav)).2]
· intro b bu hbx
refine (hB b (ut bu)).trans ?_
apply closedBall_subset_closedBall'
have : r b ≤ R0 := le_csSup R0_bdd (mem_image_of_mem _ ⟨bu, hbx⟩)
linarith [Idist_v b ⟨bu, hbx⟩]
-- we will show that, in `ball x (R x)`, almost all `s` is covered by the family `u`.
refine ⟨_ ∩ ball x (R x), inter_mem_nhdsWithin _ (ball_mem_nhds _ (hR0 _)),
nonpos_iff_eq_zero.mp (le_of_forall_le_of_dense fun ε εpos => ?_)⟩
-- the elements of `v` are disjoint and all contained in a finite volume ball, hence the sum
-- of their measures is finite.
have I : (∑' a : v, μ (B a)) < ∞ := by
calc
(∑' a : v, μ (B a)) = μ (⋃ a ∈ v, B a) := by
rw [measure_biUnion (u_count.mono vu) _ fun a ha => (h't _ (vu.trans ut ha)).measurableSet]
exact u_disj.subset vu
_ ≤ μ (closedBall x K) := (measure_mono (iUnion₂_subset fun a ha => hK a (vu ha) ha.2))
_ < ∞ := μK
-- we can obtain a finite subfamily of `v`, such that the measures of the remaining elements
-- add up to an arbitrarily small number, say `ε / C`.
obtain ⟨w, hw⟩ : ∃ w : Finset v, (∑' a : { a // a ∉ w }, μ (B a)) < ε / C :=
haveI : 0 < ε / C := by
simp only [ENNReal.div_pos_iff, εpos.ne', ENNReal.coe_ne_top, Ne, not_false_iff,
and_self_iff]
((tendsto_order.1 (ENNReal.tendsto_tsum_compl_atTop_zero I.ne)).2 _ this).exists
-- main property: the points `z` of `s` which are not covered by `u` are contained in the
-- enlargements of the elements not in `w`.
have M : (s \ ⋃ a ∈ u, B a) ∩
ball x (R x) ⊆ ⋃ a : { a // a ∉ w }, closedBall (c a) (3 * r a) := by
intro z hz
set k := ⋃ (a : v) (_ : a ∈ w), B a
have k_closed : IsClosed k := isClosed_biUnion_finset fun i _ => h't _ (ut (vu i.2))
have z_notmem_k : z ∉ k := by
simp only [k, not_exists, exists_prop, mem_iUnion, mem_sep_iff, forall_exists_index,
SetCoe.exists, not_and, exists_and_right, Subtype.coe_mk]
intro b hbv _ h'z
have : z ∈ (s \ ⋃ a ∈ u, B a) ∩ ⋃ a ∈ u, B a :=
mem_inter (mem_of_mem_inter_left hz) (mem_biUnion (vu hbv) h'z)
simpa only [diff_inter_self]
-- since the elements of `w` are closed and finitely many, one can find a small ball around `z`
-- not intersecting them
have : ball x (R x) \ k ∈ 𝓝 z := by
apply IsOpen.mem_nhds (isOpen_ball.sdiff k_closed) _
exact (mem_diff _).2 ⟨mem_of_mem_inter_right hz, z_notmem_k⟩
obtain ⟨d, dpos, hd⟩ : ∃ d, 0 < d ∧ closedBall z d ⊆ ball x (R x) \ k :=
nhds_basis_closedBall.mem_iff.1 this
-- choose an element `a` of the family `t` contained in this small ball
obtain ⟨a, hat, ad, rfl⟩ : ∃ a ∈ t, r a ≤ min d (R z) ∧ c a = z :=
hf z ((mem_diff _).1 (mem_of_mem_inter_left hz)).1 (min d (R z)) (lt_min dpos (hR0 z))
have ax : B a ⊆ ball x (R x) := by
refine (hB a hat).trans ?_
refine Subset.trans ?_ (hd.trans Set.diff_subset)
exact closedBall_subset_closedBall (ad.trans (min_le_left _ _))
-- it intersects an element `b` of `u` with comparable diameter, by definition of `u`
obtain ⟨b, bu, ab, bdiam⟩ : ∃ b ∈ u, (B a ∩ B b).Nonempty ∧ r a ≤ 2 * r b :=
hu a ⟨hat, ad.trans (min_le_right _ _)⟩
have bv : b ∈ v := by
refine ⟨bu, ab.mono ?_⟩
rw [inter_comm]
exact inter_subset_inter_right _ ax
let b' : v := ⟨b, bv⟩
-- `b` cannot belong to `w`, as the elements of `w` do not intersect `closedBall z d`,
-- contrary to `b`
have b'_notmem_w : b' ∉ w := by
intro b'w
have b'k : B b' ⊆ k := @Finset.subset_set_biUnion_of_mem _ _ _ (fun y : v => B y) _ b'w
have : (ball x (R x) \ k ∩ k).Nonempty := by
apply ab.mono (inter_subset_inter _ b'k)
refine ((hB _ hat).trans ?_).trans hd
exact closedBall_subset_closedBall (ad.trans (min_le_left _ _))
simpa only [diff_inter_self, Set.not_nonempty_empty]
let b'' : { a // a ∉ w } := ⟨b', b'_notmem_w⟩
-- since `a` and `b` have comparable diameters, it follows that `z` belongs to the
-- enlargement of `b`
have zb : c a ∈ closedBall (c b) (3 * r b) := by
rcases ab with ⟨e, ⟨ea, eb⟩⟩
have A : dist (c a) e ≤ r a := mem_closedBall'.1 (hB a hat ea)
have B : dist e (c b) ≤ r b := mem_closedBall.1 (hB b (ut bu) eb)
simp only [mem_closedBall]
linarith only [dist_triangle (c a) e (c b), A, B, bdiam]
suffices H : closedBall (c b'') (3 * r b'')
⊆ ⋃ a : { a // a ∉ w }, closedBall (c a) (3 * r a) from H zb
exact subset_iUnion (fun a : { a // a ∉ w } => closedBall (c a) (3 * r a)) b''
-- now that we have proved our main inclusion, we can use it to estimate the measure of the points
-- in `ball x (r x)` not covered by `u`.
haveI : Countable v := (u_count.mono vu).to_subtype
calc
μ ((s \ ⋃ a ∈ u, B a) ∩ ball x (R x)) ≤ μ (⋃ a : { a // a ∉ w }, closedBall (c a) (3 * r a)) :=
measure_mono M
_ ≤ ∑' a : { a // a ∉ w }, μ (closedBall (c a) (3 * r a)) := measure_iUnion_le _
_ ≤ ∑' a : { a // a ∉ w }, C * μ (B a) := (ENNReal.tsum_le_tsum fun a => μB a (ut (vu a.1.2)))
_ = C * ∑' a : { a // a ∉ w }, μ (B a) := ENNReal.tsum_mul_left
_ ≤ C * (ε / C) := by gcongr
_ ≤ ε := ENNReal.mul_div_le
/-- Assume that around every point there are arbitrarily small scales at which the measure is
doubling. Then the set of closed sets `a` with nonempty interior contained in `closedBall x r` and
covering a fixed proportion `1/C` of the ball `closedBall x (3 * r)` forms a Vitali family.
This is essentially a restatement of the measurable Vitali theorem. -/
protected def vitaliFamily [MetricSpace α] [MeasurableSpace α] [OpensMeasurableSpace α]
[SecondCountableTopology α] (μ : Measure α) [IsLocallyFiniteMeasure μ] (C : ℝ≥0)
(h : ∀ x, ∃ᶠ r in 𝓝[>] 0, μ (closedBall x (3 * r)) ≤ C * μ (closedBall x r)) :
VitaliFamily μ where
setsAt x := { a | IsClosed a ∧ (interior a).Nonempty ∧
∃ r, a ⊆ closedBall x r ∧ μ (closedBall x (3 * r)) ≤ C * μ a }
measurableSet x a ha := ha.1.measurableSet
nonempty_interior x a ha := ha.2.1
nontrivial x ε εpos := by
obtain ⟨r, μr, rpos, rε⟩ :
∃ r, μ (closedBall x (3 * r)) ≤ C * μ (closedBall x r) ∧ r ∈ Ioc (0 : ℝ) ε :=
((h x).and_eventually (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, εpos⟩)).exists
refine
⟨closedBall x r, ⟨isClosed_ball, ?_, ⟨r, Subset.rfl, μr⟩⟩, closedBall_subset_closedBall rε⟩
exact (nonempty_ball.2 rpos).mono ball_subset_interior_closedBall
covering := by
intro s f fsubset ffine
let t : Set (ℝ × α × Set α) :=
{ p | p.2.2 ⊆ closedBall p.2.1 p.1 ∧ μ (closedBall p.2.1 (3 * p.1)) ≤ C * μ p.2.2 ∧
(interior p.2.2).Nonempty ∧ IsClosed p.2.2 ∧ p.2.2 ∈ f p.2.1 ∧ p.2.1 ∈ s }
have A : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ p, p ∈ t ∧ p.1 ≤ ε ∧ p.2.1 = x := by
intro x xs ε εpos
rcases ffine x xs ε εpos with ⟨a, ha, h'a⟩
rcases fsubset x xs ha with ⟨a_closed, a_int, ⟨r, ar, μr⟩⟩
refine ⟨⟨min r ε, x, a⟩, ⟨?_, ?_, a_int, a_closed, ha, xs⟩, min_le_right _ _, rfl⟩
· rcases min_cases r ε with (h' | h') <;> rwa [h'.1]
· apply le_trans ?_ μr
gcongr
apply min_le_left
rcases exists_disjoint_covering_ae μ s t C (fun p => p.1) (fun p => p.2.1) (fun p => p.2.2)
(fun p hp => hp.1) (fun p hp => hp.2.1) (fun p hp => hp.2.2.1) (fun p hp => hp.2.2.2.1) A
with ⟨t', t't, _, t'_disj, μt'⟩
refine ⟨(fun p : ℝ × α × Set α => p.2) '' t', ?_, ?_, ?_, ?_⟩
· rintro - ⟨q, hq, rfl⟩
exact (t't hq).2.2.2.2.2
· rintro p ⟨q, hq, rfl⟩ p' ⟨q', hq', rfl⟩ hqq'
exact t'_disj hq hq' (ne_of_apply_ne _ hqq')
· rintro - ⟨q, hq, rfl⟩
exact (t't hq).2.2.2.2.1
· convert μt' using 3
rw [biUnion_image]
end Vitali
|
MeasureTheory\Covering\VitaliFamily.lean | /-
Copyright (c) 2021 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
import Mathlib.MeasureTheory.Measure.MeasureSpace
/-!
# Vitali families
On a metric space `X` with a measure `μ`, consider for each `x : X` a family of measurable sets with
nonempty interiors, called `setsAt x`. This family is a Vitali family if it satisfies the following
property: consider a (possibly non-measurable) set `s`, and for any `x` in `s` a
subfamily `f x` of `setsAt x` containing sets of arbitrarily small diameter. Then one can extract
a disjoint subfamily covering almost all `s`.
Vitali families are provided by covering theorems such as the Besicovitch covering theorem or the
Vitali covering theorem. They make it possible to formulate general versions of theorems on
differentiations of measure that apply in both contexts.
This file gives the basic definition of Vitali families. More interesting developments of this
notion are deferred to other files:
* constructions of specific Vitali families are provided by the Besicovitch covering theorem, in
`Besicovitch.vitaliFamily`, and by the Vitali covering theorem, in `Vitali.vitaliFamily`.
* The main theorem on differentiation of measures along a Vitali family is proved in
`VitaliFamily.ae_tendsto_rnDeriv`.
## Main definitions
* `VitaliFamily μ` is a structure made, for each `x : X`, of a family of sets around `x`, such that
one can extract an almost everywhere disjoint covering from any subfamily containing sets of
arbitrarily small diameters.
Let `v` be such a Vitali family.
* `v.FineSubfamilyOn` describes the subfamilies of `v` from which one can extract almost
everywhere disjoint coverings. This property, called
`v.FineSubfamilyOn.exists_disjoint_covering_ae`, is essentially a restatement of the definition
of a Vitali family. We also provide an API to use efficiently such a disjoint covering.
* `v.filterAt x` is a filter on sets of `X`, such that convergence with respect to this filter
means convergence when sets in the Vitali family shrink towards `x`.
## References
* [Herbert Federer, Geometric Measure Theory, Chapter 2.8][Federer1996] (Vitali families are called
Vitali relations there)
-/
open MeasureTheory Metric Set Filter TopologicalSpace MeasureTheory.Measure
open scoped Topology
variable {X : Type*} [MetricSpace X]
/-- On a metric space `X` with a measure `μ`, consider for each `x : X` a family of measurable sets
with nonempty interiors, called `setsAt x`. This family is a Vitali family if it satisfies the
following property: consider a (possibly non-measurable) set `s`, and for any `x` in `s` a
subfamily `f x` of `setsAt x` containing sets of arbitrarily small diameter. Then one can extract
a disjoint subfamily covering almost all `s`.
Vitali families are provided by covering theorems such as the Besicovitch covering theorem or the
Vitali covering theorem. They make it possible to formulate general versions of theorems on
differentiations of measure that apply in both contexts.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure VitaliFamily {m : MeasurableSpace X} (μ : Measure X) where
/-- Sets of the family "centered" at a given point. -/
setsAt : X → Set (Set X)
/-- All sets of the family are measurable. -/
measurableSet : ∀ x : X, ∀ s ∈ setsAt x, MeasurableSet s
/-- All sets of the family have nonempty interior. -/
nonempty_interior : ∀ x : X, ∀ s ∈ setsAt x, (interior s).Nonempty
/-- For any closed ball around `x`, there exists a set of the family contained in this ball. -/
nontrivial : ∀ (x : X), ∀ ε > (0 : ℝ), ∃ s ∈ setsAt x, s ⊆ closedBall x ε
/-- Consider a (possibly non-measurable) set `s`,
and for any `x` in `s` a subfamily `f x` of `setsAt x`
containing sets of arbitrarily small diameter.
Then one can extract a disjoint subfamily covering almost all `s`. -/
covering : ∀ (s : Set X) (f : X → Set (Set X)),
(∀ x ∈ s, f x ⊆ setsAt x) → (∀ x ∈ s, ∀ ε > (0 : ℝ), ∃ t ∈ f x, t ⊆ closedBall x ε) →
∃ t : Set (X × Set X), (∀ p ∈ t, p.1 ∈ s) ∧ (t.PairwiseDisjoint fun p ↦ p.2) ∧
(∀ p ∈ t, p.2 ∈ f p.1) ∧ μ (s \ ⋃ p ∈ t, p.2) = 0
namespace VitaliFamily
variable {m0 : MeasurableSpace X} {μ : Measure X}
/-- A Vitali family for a measure `μ` is also a Vitali family for any measure absolutely continuous
with respect to `μ`. -/
def mono (v : VitaliFamily μ) (ν : Measure X) (hν : ν ≪ μ) : VitaliFamily ν where
__ := v
covering s f h h' :=
let ⟨t, ts, disj, mem_f, hμ⟩ := v.covering s f h h'
⟨t, ts, disj, mem_f, hν hμ⟩
/-- Given a Vitali family `v` for a measure `μ`, a family `f` is a fine subfamily on a set `s` if
every point `x` in `s` belongs to arbitrarily small sets in `v.setsAt x ∩ f x`. This is precisely
the subfamilies for which the Vitali family definition ensures that one can extract a disjoint
covering of almost all `s`. -/
def FineSubfamilyOn (v : VitaliFamily μ) (f : X → Set (Set X)) (s : Set X) : Prop :=
∀ x ∈ s, ∀ ε > 0, ∃ t ∈ v.setsAt x ∩ f x, t ⊆ closedBall x ε
namespace FineSubfamilyOn
variable {v : VitaliFamily μ} {f : X → Set (Set X)} {s : Set X} (h : v.FineSubfamilyOn f s)
theorem exists_disjoint_covering_ae :
∃ t : Set (X × Set X),
(∀ p : X × Set X, p ∈ t → p.1 ∈ s) ∧
(t.PairwiseDisjoint fun p => p.2) ∧
(∀ p : X × Set X, p ∈ t → p.2 ∈ v.setsAt p.1 ∩ f p.1) ∧
μ (s \ ⋃ (p : X × Set X) (_ : p ∈ t), p.2) = 0 :=
v.covering s (fun x => v.setsAt x ∩ f x) (fun _ _ => inter_subset_left) h
/-- Given `h : v.FineSubfamilyOn f s`, then `h.index` is a set parametrizing a disjoint
covering of almost every `s`. -/
protected def index : Set (X × Set X) :=
h.exists_disjoint_covering_ae.choose
-- Porting note: Needed to add `(_h : FineSubfamilyOn v f s)`
/-- Given `h : v.FineSubfamilyOn f s`, then `h.covering p` is a set in the family,
for `p ∈ h.index`, such that these sets form a disjoint covering of almost every `s`. -/
@[nolint unusedArguments]
protected def covering (_h : FineSubfamilyOn v f s) : X × Set X → Set X :=
fun p => p.2
theorem index_subset : ∀ p : X × Set X, p ∈ h.index → p.1 ∈ s :=
h.exists_disjoint_covering_ae.choose_spec.1
theorem covering_disjoint : h.index.PairwiseDisjoint h.covering :=
h.exists_disjoint_covering_ae.choose_spec.2.1
theorem covering_disjoint_subtype : Pairwise (Disjoint on fun x : h.index => h.covering x) :=
(pairwise_subtype_iff_pairwise_set _ _).2 h.covering_disjoint
theorem covering_mem {p : X × Set X} (hp : p ∈ h.index) : h.covering p ∈ f p.1 :=
(h.exists_disjoint_covering_ae.choose_spec.2.2.1 p hp).2
theorem covering_mem_family {p : X × Set X} (hp : p ∈ h.index) : h.covering p ∈ v.setsAt p.1 :=
(h.exists_disjoint_covering_ae.choose_spec.2.2.1 p hp).1
theorem measure_diff_biUnion : μ (s \ ⋃ p ∈ h.index, h.covering p) = 0 :=
h.exists_disjoint_covering_ae.choose_spec.2.2.2
theorem index_countable [SecondCountableTopology X] : h.index.Countable :=
h.covering_disjoint.countable_of_nonempty_interior fun _ hx =>
v.nonempty_interior _ _ (h.covering_mem_family hx)
protected theorem measurableSet_u {p : X × Set X} (hp : p ∈ h.index) :
MeasurableSet (h.covering p) :=
v.measurableSet p.1 _ (h.covering_mem_family hp)
theorem measure_le_tsum_of_absolutelyContinuous [SecondCountableTopology X] {ρ : Measure X}
(hρ : ρ ≪ μ) : ρ s ≤ ∑' p : h.index, ρ (h.covering p) :=
calc
ρ s ≤ ρ ((s \ ⋃ p ∈ h.index, h.covering p) ∪ ⋃ p ∈ h.index, h.covering p) :=
measure_mono (by simp only [subset_union_left, diff_union_self])
_ ≤ ρ (s \ ⋃ p ∈ h.index, h.covering p) + ρ (⋃ p ∈ h.index, h.covering p) :=
(measure_union_le _ _)
_ = ∑' p : h.index, ρ (h.covering p) := by
rw [hρ h.measure_diff_biUnion, zero_add,
measure_biUnion h.index_countable h.covering_disjoint fun x hx => h.measurableSet_u hx]
theorem measure_le_tsum [SecondCountableTopology X] : μ s ≤ ∑' x : h.index, μ (h.covering x) :=
h.measure_le_tsum_of_absolutelyContinuous Measure.AbsolutelyContinuous.rfl
end FineSubfamilyOn
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
setsAt x := v.setsAt x ∪ {s | MeasurableSet s ∧ (interior s).Nonempty ∧ ¬s ⊆ closedBall x δ}
measurableSet := by
rintro x s (hs | hs)
exacts [v.measurableSet _ _ hs, hs.1]
nonempty_interior := by
rintro x s (hs | hs)
exacts [v.nonempty_interior _ _ hs, hs.2.1]
nontrivial := by
intro x ε εpos
rcases v.nontrivial x ε εpos with ⟨s, hs, h's⟩
exact ⟨s, mem_union_left _ hs, h's⟩
covering := by
intro s f fset ffine
let g : X → Set (Set X) := fun x => f x ∩ v.setsAt x
have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ t ∈ g x, t ⊆ closedBall x ε := by
intro x hx ε εpos
obtain ⟨t, tf, ht⟩ : ∃ t ∈ f x, t ⊆ closedBall x (min ε δ) :=
ffine x hx (min ε δ) (lt_min εpos δpos)
rcases fset x hx tf with (h't | h't)
· exact ⟨t, ⟨tf, h't⟩, ht.trans (closedBall_subset_closedBall (min_le_left _ _))⟩
· refine False.elim (h't.2.2 ?_)
exact ht.trans (closedBall_subset_closedBall (min_le_right _ _))
rcases v.covering s g (fun x _ => inter_subset_right) this with ⟨t, ts, tdisj, tg, μt⟩
exact ⟨t, ts, tdisj, fun p hp => (tg p hp).1, μt⟩
variable (v : VitaliFamily μ)
/-- Given a vitali family `v`, then `v.filterAt x` is the filter on `Set X` made of those families
that contain all sets of `v.setsAt x` of a sufficiently small diameter. This filter makes it
possible to express limiting behavior when sets in `v.setsAt x` shrink to `x`. -/
def filterAt (x : X) : Filter (Set X) := (𝓝 x).smallSets ⊓ 𝓟 (v.setsAt x)
theorem _root_.Filter.HasBasis.vitaliFamily {ι : Sort*} {p : ι → Prop} {s : ι → Set X} {x : X}
(h : (𝓝 x).HasBasis p s) : (v.filterAt x).HasBasis p (fun i ↦ {t ∈ v.setsAt x | t ⊆ s i}) := by
simpa only [← Set.setOf_inter_eq_sep] using h.smallSets.inf_principal _
theorem filterAt_basis_closedBall (x : X) :
(v.filterAt x).HasBasis (0 < ·) ({t ∈ v.setsAt x | t ⊆ closedBall x ·}) :=
nhds_basis_closedBall.vitaliFamily v
theorem mem_filterAt_iff {x : X} {s : Set (Set X)} :
s ∈ v.filterAt x ↔ ∃ ε > (0 : ℝ), ∀ t ∈ v.setsAt x, t ⊆ closedBall x ε → t ∈ s := by
simp only [(v.filterAt_basis_closedBall x).mem_iff, ← and_imp, subset_def, mem_setOf]
instance filterAt_neBot (x : X) : (v.filterAt x).NeBot :=
(v.filterAt_basis_closedBall x).neBot_iff.2 <| v.nontrivial _ _
theorem eventually_filterAt_iff {x : X} {P : Set X → Prop} :
(∀ᶠ t in v.filterAt x, P t) ↔ ∃ ε > (0 : ℝ), ∀ t ∈ v.setsAt x, t ⊆ closedBall x ε → P t :=
v.mem_filterAt_iff
theorem tendsto_filterAt_iff {ι : Type*} {l : Filter ι} {f : ι → Set X} {x : X} :
Tendsto f l (v.filterAt x) ↔
(∀ᶠ i in l, f i ∈ v.setsAt x) ∧ ∀ ε > (0 : ℝ), ∀ᶠ i in l, f i ⊆ closedBall x ε := by
simp only [filterAt, tendsto_inf, nhds_basis_closedBall.smallSets.tendsto_right_iff,
tendsto_principal, and_comm, mem_powerset_iff]
theorem eventually_filterAt_mem_setsAt (x : X) : ∀ᶠ t in v.filterAt x, t ∈ v.setsAt x :=
(v.tendsto_filterAt_iff.mp tendsto_id).1
theorem eventually_filterAt_subset_closedBall (x : X) {ε : ℝ} (hε : 0 < ε) :
∀ᶠ t : Set X in v.filterAt x, t ⊆ closedBall x ε :=
(v.tendsto_filterAt_iff.mp tendsto_id).2 ε hε
theorem eventually_filterAt_measurableSet (x : X) : ∀ᶠ t in v.filterAt x, MeasurableSet t := by
filter_upwards [v.eventually_filterAt_mem_setsAt x] with _ ha using v.measurableSet _ _ ha
theorem frequently_filterAt_iff {x : X} {P : Set X → Prop} :
(∃ᶠ t in v.filterAt x, P t) ↔ ∀ ε > (0 : ℝ), ∃ t ∈ v.setsAt x, t ⊆ closedBall x ε ∧ P t := by
simp only [(v.filterAt_basis_closedBall x).frequently_iff, ← and_assoc, subset_def, mem_setOf]
theorem eventually_filterAt_subset_of_nhds {x : X} {o : Set X} (hx : o ∈ 𝓝 x) :
∀ᶠ t in v.filterAt x, t ⊆ o :=
(eventually_smallSets_subset.2 hx).filter_mono inf_le_left
theorem fineSubfamilyOn_of_frequently (v : VitaliFamily μ) (f : X → Set (Set X)) (s : Set X)
(h : ∀ x ∈ s, ∃ᶠ t in v.filterAt x, t ∈ f x) : v.FineSubfamilyOn f s := by
intro x hx ε εpos
obtain ⟨t, tv, ht, tf⟩ : ∃ t ∈ v.setsAt x, t ⊆ closedBall x ε ∧ t ∈ f x :=
v.frequently_filterAt_iff.1 (h x hx) ε εpos
exact ⟨t, ⟨tv, tf⟩, ht⟩
end VitaliFamily
|
MeasureTheory\Decomposition\Jordan.lean | /-
Copyright (c) 2021 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying
-/
import Mathlib.MeasureTheory.Decomposition.SignedHahn
import Mathlib.MeasureTheory.Measure.MutuallySingular
/-!
# Jordan decomposition
This file proves the existence and uniqueness of the Jordan decomposition for signed measures.
The Jordan decomposition theorem states that, given a signed measure `s`, there exists a
unique pair of mutually singular measures `μ` and `ν`, such that `s = μ - ν`.
The Jordan decomposition theorem for measures is a corollary of the Hahn decomposition theorem and
is useful for the Lebesgue decomposition theorem.
## Main definitions
* `MeasureTheory.JordanDecomposition`: a Jordan decomposition of a measurable space is a
pair of mutually singular finite measures. We say `j` is a Jordan decomposition of a signed
measure `s` if `s = j.posPart - j.negPart`.
* `MeasureTheory.SignedMeasure.toJordanDecomposition`: the Jordan decomposition of a
signed measure.
* `MeasureTheory.SignedMeasure.toJordanDecompositionEquiv`: is the `Equiv` between
`MeasureTheory.SignedMeasure` and `MeasureTheory.JordanDecomposition` formed by
`MeasureTheory.SignedMeasure.toJordanDecomposition`.
## Main results
* `MeasureTheory.SignedMeasure.toSignedMeasure_toJordanDecomposition` : the Jordan
decomposition theorem.
* `MeasureTheory.JordanDecomposition.toSignedMeasure_injective` : the Jordan decomposition of a
signed measure is unique.
## Tags
Jordan decomposition theorem
-/
noncomputable section
open scoped Classical MeasureTheory ENNReal NNReal
variable {α β : Type*} [MeasurableSpace α]
namespace MeasureTheory
/-- A Jordan decomposition of a measurable space is a pair of mutually singular,
finite measures. -/
@[ext]
structure JordanDecomposition (α : Type*) [MeasurableSpace α] where
(posPart negPart : Measure α)
[posPart_finite : IsFiniteMeasure posPart]
[negPart_finite : IsFiniteMeasure negPart]
mutuallySingular : posPart ⟂ₘ negPart
attribute [instance] JordanDecomposition.posPart_finite
attribute [instance] JordanDecomposition.negPart_finite
namespace JordanDecomposition
open Measure VectorMeasure
variable (j : JordanDecomposition α)
instance instZero : Zero (JordanDecomposition α) where zero := ⟨0, 0, MutuallySingular.zero_right⟩
instance instInhabited : Inhabited (JordanDecomposition α) where default := 0
instance instInvolutiveNeg : InvolutiveNeg (JordanDecomposition α) where
neg j := ⟨j.negPart, j.posPart, j.mutuallySingular.symm⟩
neg_neg _ := JordanDecomposition.ext rfl rfl
instance instSMul : SMul ℝ≥0 (JordanDecomposition α) where
smul r j :=
⟨r • j.posPart, r • j.negPart,
MutuallySingular.smul _ (MutuallySingular.smul _ j.mutuallySingular.symm).symm⟩
instance instSMulReal : SMul ℝ (JordanDecomposition α) where
smul r j := if 0 ≤ r then r.toNNReal • j else -((-r).toNNReal • j)
@[simp]
theorem zero_posPart : (0 : JordanDecomposition α).posPart = 0 :=
rfl
@[simp]
theorem zero_negPart : (0 : JordanDecomposition α).negPart = 0 :=
rfl
@[simp]
theorem neg_posPart : (-j).posPart = j.negPart :=
rfl
@[simp]
theorem neg_negPart : (-j).negPart = j.posPart :=
rfl
@[simp]
theorem smul_posPart (r : ℝ≥0) : (r • j).posPart = r • j.posPart :=
rfl
@[simp]
theorem smul_negPart (r : ℝ≥0) : (r • j).negPart = r • j.negPart :=
rfl
theorem real_smul_def (r : ℝ) (j : JordanDecomposition α) :
r • j = if 0 ≤ r then r.toNNReal • j else -((-r).toNNReal • j) :=
rfl
@[simp]
theorem coe_smul (r : ℝ≥0) : (r : ℝ) • j = r • j := by
-- Porting note: replaced `show`
rw [real_smul_def, if_pos (NNReal.coe_nonneg r), Real.toNNReal_coe]
theorem real_smul_nonneg (r : ℝ) (hr : 0 ≤ r) : r • j = r.toNNReal • j :=
dif_pos hr
theorem real_smul_neg (r : ℝ) (hr : r < 0) : r • j = -((-r).toNNReal • j) :=
dif_neg (not_le.2 hr)
theorem real_smul_posPart_nonneg (r : ℝ) (hr : 0 ≤ r) :
(r • j).posPart = r.toNNReal • j.posPart := by
rw [real_smul_def, ← smul_posPart, if_pos hr]
theorem real_smul_negPart_nonneg (r : ℝ) (hr : 0 ≤ r) :
(r • j).negPart = r.toNNReal • j.negPart := by
rw [real_smul_def, ← smul_negPart, if_pos hr]
theorem real_smul_posPart_neg (r : ℝ) (hr : r < 0) :
(r • j).posPart = (-r).toNNReal • j.negPart := by
rw [real_smul_def, ← smul_negPart, if_neg (not_le.2 hr), neg_posPart]
theorem real_smul_negPart_neg (r : ℝ) (hr : r < 0) :
(r • j).negPart = (-r).toNNReal • j.posPart := by
rw [real_smul_def, ← smul_posPart, if_neg (not_le.2 hr), neg_negPart]
/-- The signed measure associated with a Jordan decomposition. -/
def toSignedMeasure : SignedMeasure α :=
j.posPart.toSignedMeasure - j.negPart.toSignedMeasure
theorem toSignedMeasure_zero : (0 : JordanDecomposition α).toSignedMeasure = 0 := by
ext1 i hi
-- Porting note: replaced `erw` by adding further lemmas
rw [toSignedMeasure, toSignedMeasure_sub_apply hi, zero_posPart, zero_negPart, sub_self,
VectorMeasure.coe_zero, Pi.zero_apply]
theorem toSignedMeasure_neg : (-j).toSignedMeasure = -j.toSignedMeasure := by
ext1 i hi
-- Porting note: removed `rfl` after the `rw` by adding further steps.
rw [neg_apply, toSignedMeasure, toSignedMeasure, toSignedMeasure_sub_apply hi,
toSignedMeasure_sub_apply hi, neg_sub, neg_posPart, neg_negPart]
theorem toSignedMeasure_smul (r : ℝ≥0) : (r • j).toSignedMeasure = r • j.toSignedMeasure := by
ext1 i hi
rw [VectorMeasure.smul_apply, toSignedMeasure, toSignedMeasure,
toSignedMeasure_sub_apply hi, toSignedMeasure_sub_apply hi, smul_sub, smul_posPart,
smul_negPart, ← ENNReal.toReal_smul, ← ENNReal.toReal_smul, Measure.smul_apply,
Measure.smul_apply]
/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
∃ S : Set α,
MeasurableSet S ∧
j.toSignedMeasure ≤[S] 0 ∧
0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0 := by
obtain ⟨S, hS₁, hS₂, hS₃⟩ := j.mutuallySingular
refine ⟨S, hS₁, ?_, ?_, hS₂, hS₃⟩
· refine restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => ?_
rw [toSignedMeasure, toSignedMeasure_sub_apply hA,
show j.posPart A = 0 from nonpos_iff_eq_zero.1 (hS₂ ▸ measure_mono hA₁), ENNReal.zero_toReal,
zero_sub, neg_le, zero_apply, neg_zero]
exact ENNReal.toReal_nonneg
· refine restrict_le_restrict_of_subset_le _ _ fun A hA hA₁ => ?_
rw [toSignedMeasure, toSignedMeasure_sub_apply hA,
show j.negPart A = 0 from nonpos_iff_eq_zero.1 (hS₃ ▸ measure_mono hA₁), ENNReal.zero_toReal,
sub_zero]
exact ENNReal.toReal_nonneg
end JordanDecomposition
namespace SignedMeasure
open scoped Classical
open JordanDecomposition Measure Set VectorMeasure
variable {s : SignedMeasure α} {μ ν : Measure α} [IsFiniteMeasure μ] [IsFiniteMeasure ν]
/-- Given a signed measure `s`, `s.toJordanDecomposition` is the Jordan decomposition `j`,
such that `s = j.toSignedMeasure`. This property is known as the Jordan decomposition
theorem, and is shown by
`MeasureTheory.SignedMeasure.toSignedMeasure_toJordanDecomposition`. -/
def toJordanDecomposition (s : SignedMeasure α) : JordanDecomposition α :=
let i := s.exists_compl_positive_negative.choose
let hi := s.exists_compl_positive_negative.choose_spec
{ posPart := s.toMeasureOfZeroLE i hi.1 hi.2.1
negPart := s.toMeasureOfLEZero iᶜ hi.1.compl hi.2.2
posPart_finite := inferInstance
negPart_finite := inferInstance
mutuallySingular := by
refine ⟨iᶜ, hi.1.compl, ?_, ?_⟩
-- Porting note: added `NNReal.eq_iff`
· rw [toMeasureOfZeroLE_apply _ _ hi.1 hi.1.compl]; simp [NNReal.eq_iff]
· rw [toMeasureOfLEZero_apply _ _ hi.1.compl hi.1.compl.compl]; simp [NNReal.eq_iff] }
theorem toJordanDecomposition_spec (s : SignedMeasure α) :
∃ (i : Set α) (hi₁ : MeasurableSet i) (hi₂ : 0 ≤[i] s) (hi₃ : s ≤[iᶜ] 0),
s.toJordanDecomposition.posPart = s.toMeasureOfZeroLE i hi₁ hi₂ ∧
s.toJordanDecomposition.negPart = s.toMeasureOfLEZero iᶜ hi₁.compl hi₃ := by
set i := s.exists_compl_positive_negative.choose
obtain ⟨hi₁, hi₂, hi₃⟩ := s.exists_compl_positive_negative.choose_spec
exact ⟨i, hi₁, hi₂, hi₃, rfl, rfl⟩
/-- **The Jordan decomposition theorem**: Given a signed measure `s`, there exists a pair of
mutually singular measures `μ` and `ν` such that `s = μ - ν`. In this case, the measures `μ`
and `ν` are given by `s.toJordanDecomposition.posPart` and
`s.toJordanDecomposition.negPart` respectively.
Note that we use `MeasureTheory.JordanDecomposition.toSignedMeasure` to represent the
signed measure corresponding to
`s.toJordanDecomposition.posPart - s.toJordanDecomposition.negPart`. -/
@[simp]
theorem toSignedMeasure_toJordanDecomposition (s : SignedMeasure α) :
s.toJordanDecomposition.toSignedMeasure = s := by
obtain ⟨i, hi₁, hi₂, hi₃, hμ, hν⟩ := s.toJordanDecomposition_spec
simp only [JordanDecomposition.toSignedMeasure, hμ, hν]
ext k hk
rw [toSignedMeasure_sub_apply hk, toMeasureOfZeroLE_apply _ hi₂ hi₁ hk,
toMeasureOfLEZero_apply _ hi₃ hi₁.compl hk]
simp only [ENNReal.coe_toReal, NNReal.coe_mk, ENNReal.some_eq_coe, sub_neg_eq_add]
rw [← of_union _ (MeasurableSet.inter hi₁ hk) (MeasurableSet.inter hi₁.compl hk),
Set.inter_comm i, Set.inter_comm iᶜ, Set.inter_union_compl _ _]
exact (disjoint_compl_right.inf_left _).inf_right _
section
variable {u v w : Set α}
/-- A subset `v` of a null-set `w` has zero measure if `w` is a subset of a positive set `u`. -/
theorem subset_positive_null_set (hu : MeasurableSet u) (hv : MeasurableSet v)
(hw : MeasurableSet w) (hsu : 0 ≤[u] s) (hw₁ : s w = 0) (hw₂ : w ⊆ u) (hwt : v ⊆ w) :
s v = 0 := by
have : s v + s (w \ v) = 0 := by
rw [← hw₁, ← of_union Set.disjoint_sdiff_right hv (hw.diff hv), Set.union_diff_self,
Set.union_eq_self_of_subset_left hwt]
have h₁ := nonneg_of_zero_le_restrict _ (restrict_le_restrict_subset _ _ hu hsu (hwt.trans hw₂))
have h₂ : 0 ≤ s (w \ v) :=
nonneg_of_zero_le_restrict _
(restrict_le_restrict_subset _ _ hu hsu (diff_subset.trans hw₂))
linarith
/-- A subset `v` of a null-set `w` has zero measure if `w` is a subset of a negative set `u`. -/
theorem subset_negative_null_set (hu : MeasurableSet u) (hv : MeasurableSet v)
(hw : MeasurableSet w) (hsu : s ≤[u] 0) (hw₁ : s w = 0) (hw₂ : w ⊆ u) (hwt : v ⊆ w) :
s v = 0 := by
rw [← s.neg_le_neg_iff _ hu, neg_zero] at hsu
have := subset_positive_null_set hu hv hw hsu
simp only [Pi.neg_apply, neg_eq_zero, coe_neg] at this
exact this hw₁ hw₂ hwt
open scoped symmDiff
/-- If the symmetric difference of two positive sets is a null-set, then so are the differences
between the two sets. -/
theorem of_diff_eq_zero_of_symmDiff_eq_zero_positive (hu : MeasurableSet u) (hv : MeasurableSet v)
(hsu : 0 ≤[u] s) (hsv : 0 ≤[v] s) (hs : s (u ∆ v) = 0) : s (u \ v) = 0 ∧ s (v \ u) = 0 := by
rw [restrict_le_restrict_iff] at hsu hsv
on_goal 1 =>
have a := hsu (hu.diff hv) diff_subset
have b := hsv (hv.diff hu) diff_subset
erw [of_union (Set.disjoint_of_subset_left diff_subset disjoint_sdiff_self_right)
(hu.diff hv) (hv.diff hu)] at hs
rw [zero_apply] at a b
constructor
all_goals first | linarith | assumption
/-- If the symmetric difference of two negative sets is a null-set, then so are the differences
between the two sets. -/
theorem of_diff_eq_zero_of_symmDiff_eq_zero_negative (hu : MeasurableSet u) (hv : MeasurableSet v)
(hsu : s ≤[u] 0) (hsv : s ≤[v] 0) (hs : s (u ∆ v) = 0) : s (u \ v) = 0 ∧ s (v \ u) = 0 := by
rw [← s.neg_le_neg_iff _ hu, neg_zero] at hsu
rw [← s.neg_le_neg_iff _ hv, neg_zero] at hsv
have := of_diff_eq_zero_of_symmDiff_eq_zero_positive hu hv hsu hsv
simp only [Pi.neg_apply, neg_eq_zero, coe_neg] at this
exact this hs
theorem of_inter_eq_of_symmDiff_eq_zero_positive (hu : MeasurableSet u) (hv : MeasurableSet v)
(hw : MeasurableSet w) (hsu : 0 ≤[u] s) (hsv : 0 ≤[v] s) (hs : s (u ∆ v) = 0) :
s (w ∩ u) = s (w ∩ v) := by
have hwuv : s ((w ∩ u) ∆ (w ∩ v)) = 0 := by
refine
subset_positive_null_set (hu.union hv) ((hw.inter hu).symmDiff (hw.inter hv))
(hu.symmDiff hv) (restrict_le_restrict_union _ _ hu hsu hv hsv) hs
Set.symmDiff_subset_union ?_
rw [← Set.inter_symmDiff_distrib_left]
exact Set.inter_subset_right
obtain ⟨huv, hvu⟩ :=
of_diff_eq_zero_of_symmDiff_eq_zero_positive (hw.inter hu) (hw.inter hv)
(restrict_le_restrict_subset _ _ hu hsu (w.inter_subset_right))
(restrict_le_restrict_subset _ _ hv hsv (w.inter_subset_right)) hwuv
rw [← of_diff_of_diff_eq_zero (hw.inter hu) (hw.inter hv) hvu, huv, zero_add]
theorem of_inter_eq_of_symmDiff_eq_zero_negative (hu : MeasurableSet u) (hv : MeasurableSet v)
(hw : MeasurableSet w) (hsu : s ≤[u] 0) (hsv : s ≤[v] 0) (hs : s (u ∆ v) = 0) :
s (w ∩ u) = s (w ∩ v) := by
rw [← s.neg_le_neg_iff _ hu, neg_zero] at hsu
rw [← s.neg_le_neg_iff _ hv, neg_zero] at hsv
have := of_inter_eq_of_symmDiff_eq_zero_positive hu hv hw hsu hsv
simp only [Pi.neg_apply, neg_inj, neg_eq_zero, coe_neg] at this
exact this hs
end
end SignedMeasure
namespace JordanDecomposition
open Measure VectorMeasure SignedMeasure Function
private theorem eq_of_posPart_eq_posPart {j₁ j₂ : JordanDecomposition α}
(hj : j₁.posPart = j₂.posPart) (hj' : j₁.toSignedMeasure = j₂.toSignedMeasure) : j₁ = j₂ := by
ext1
· exact hj
· rw [← toSignedMeasure_eq_toSignedMeasure_iff]
-- Porting note: golfed
unfold toSignedMeasure at hj'
simp_rw [hj, sub_right_inj] at hj'
exact hj'
/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _ := by
/- The main idea is that two Jordan decompositions of a signed measure provide two
Hahn decompositions for that measure. Then, from `of_symmDiff_compl_positive_negative`,
the symmetric difference of the two Hahn decompositions has measure zero, thus, allowing us to
show the equality of the underlying measures of the Jordan decompositions. -/
intro j₁ j₂ hj
-- obtain the two Hahn decompositions from the Jordan decompositions
obtain ⟨S, hS₁, hS₂, hS₃, hS₄, hS₅⟩ := j₁.exists_compl_positive_negative
obtain ⟨T, hT₁, hT₂, hT₃, hT₄, hT₅⟩ := j₂.exists_compl_positive_negative
rw [← hj] at hT₂ hT₃
-- the symmetric differences of the two Hahn decompositions have measure zero
obtain ⟨hST₁, -⟩ :=
of_symmDiff_compl_positive_negative hS₁.compl hT₁.compl ⟨hS₃, (compl_compl S).symm ▸ hS₂⟩
⟨hT₃, (compl_compl T).symm ▸ hT₂⟩
-- it suffices to show the Jordan decompositions have the same positive parts
refine eq_of_posPart_eq_posPart ?_ hj
ext1 i hi
-- we see that the positive parts of the two Jordan decompositions are equal to their
-- associated signed measures restricted on their associated Hahn decompositions
have hμ₁ : (j₁.posPart i).toReal = j₁.toSignedMeasure (i ∩ Sᶜ) := by
rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hS₁.compl),
show j₁.negPart (i ∩ Sᶜ) = 0 from
nonpos_iff_eq_zero.1 (hS₅ ▸ measure_mono Set.inter_subset_right),
ENNReal.zero_toReal, sub_zero]
conv_lhs => rw [← Set.inter_union_compl i S]
rw [measure_union,
show j₁.posPart (i ∩ S) = 0 from
nonpos_iff_eq_zero.1 (hS₄ ▸ measure_mono Set.inter_subset_right),
zero_add]
· refine
Set.disjoint_of_subset_left Set.inter_subset_right
(Set.disjoint_of_subset_right Set.inter_subset_right disjoint_compl_right)
· exact hi.inter hS₁.compl
have hμ₂ : (j₂.posPart i).toReal = j₂.toSignedMeasure (i ∩ Tᶜ) := by
rw [toSignedMeasure, toSignedMeasure_sub_apply (hi.inter hT₁.compl),
show j₂.negPart (i ∩ Tᶜ) = 0 from
nonpos_iff_eq_zero.1 (hT₅ ▸ measure_mono Set.inter_subset_right),
ENNReal.zero_toReal, sub_zero]
conv_lhs => rw [← Set.inter_union_compl i T]
rw [measure_union,
show j₂.posPart (i ∩ T) = 0 from
nonpos_iff_eq_zero.1 (hT₄ ▸ measure_mono Set.inter_subset_right),
zero_add]
· exact
Set.disjoint_of_subset_left Set.inter_subset_right
(Set.disjoint_of_subset_right Set.inter_subset_right disjoint_compl_right)
· exact hi.inter hT₁.compl
-- since the two signed measures associated with the Jordan decompositions are the same,
-- and the symmetric difference of the Hahn decompositions have measure zero, the result follows
rw [← ENNReal.toReal_eq_toReal (measure_ne_top _ _) (measure_ne_top _ _), hμ₁, hμ₂, ← hj]
exact of_inter_eq_of_symmDiff_eq_zero_positive hS₁.compl hT₁.compl hi hS₃ hT₃ hST₁
@[simp]
theorem toJordanDecomposition_toSignedMeasure (j : JordanDecomposition α) :
j.toSignedMeasure.toJordanDecomposition = j :=
(@toSignedMeasure_injective _ _ j j.toSignedMeasure.toJordanDecomposition (by simp)).symm
end JordanDecomposition
namespace SignedMeasure
open JordanDecomposition
/-- `MeasureTheory.SignedMeasure.toJordanDecomposition` and
`MeasureTheory.JordanDecomposition.toSignedMeasure` form an `Equiv`. -/
@[simps apply symm_apply]
def toJordanDecompositionEquiv (α : Type*) [MeasurableSpace α] :
SignedMeasure α ≃ JordanDecomposition α where
toFun := toJordanDecomposition
invFun := toSignedMeasure
left_inv := toSignedMeasure_toJordanDecomposition
right_inv := toJordanDecomposition_toSignedMeasure
theorem toJordanDecomposition_zero : (0 : SignedMeasure α).toJordanDecomposition = 0 := by
apply toSignedMeasure_injective
simp [toSignedMeasure_zero]
theorem toJordanDecomposition_neg (s : SignedMeasure α) :
(-s).toJordanDecomposition = -s.toJordanDecomposition := by
apply toSignedMeasure_injective
simp [toSignedMeasure_neg]
theorem toJordanDecomposition_smul (s : SignedMeasure α) (r : ℝ≥0) :
(r • s).toJordanDecomposition = r • s.toJordanDecomposition := by
apply toSignedMeasure_injective
simp [toSignedMeasure_smul]
private theorem toJordanDecomposition_smul_real_nonneg (s : SignedMeasure α) (r : ℝ)
(hr : 0 ≤ r) : (r • s).toJordanDecomposition = r • s.toJordanDecomposition := by
lift r to ℝ≥0 using hr
rw [JordanDecomposition.coe_smul, ← toJordanDecomposition_smul]
rfl
theorem toJordanDecomposition_smul_real (s : SignedMeasure α) (r : ℝ) :
(r • s).toJordanDecomposition = r • s.toJordanDecomposition := by
by_cases hr : 0 ≤ r
· exact toJordanDecomposition_smul_real_nonneg s r hr
· ext1
· rw [real_smul_posPart_neg _ _ (not_le.1 hr),
show r • s = -(-r • s) by rw [neg_smul, neg_neg], toJordanDecomposition_neg, neg_posPart,
toJordanDecomposition_smul_real_nonneg, ← smul_negPart, real_smul_nonneg]
all_goals exact Left.nonneg_neg_iff.2 (le_of_lt (not_le.1 hr))
· rw [real_smul_negPart_neg _ _ (not_le.1 hr),
show r • s = -(-r • s) by rw [neg_smul, neg_neg], toJordanDecomposition_neg, neg_negPart,
toJordanDecomposition_smul_real_nonneg, ← smul_posPart, real_smul_nonneg]
all_goals exact Left.nonneg_neg_iff.2 (le_of_lt (not_le.1 hr))
theorem toJordanDecomposition_eq {s : SignedMeasure α} {j : JordanDecomposition α}
(h : s = j.toSignedMeasure) : s.toJordanDecomposition = j := by
rw [h, toJordanDecomposition_toSignedMeasure]
/-- The total variation of a signed measure. -/
def totalVariation (s : SignedMeasure α) : Measure α :=
s.toJordanDecomposition.posPart + s.toJordanDecomposition.negPart
theorem totalVariation_zero : (0 : SignedMeasure α).totalVariation = 0 := by
simp [totalVariation, toJordanDecomposition_zero]
theorem totalVariation_neg (s : SignedMeasure α) : (-s).totalVariation = s.totalVariation := by
simp [totalVariation, toJordanDecomposition_neg, add_comm]
theorem null_of_totalVariation_zero (s : SignedMeasure α) {i : Set α}
(hs : s.totalVariation i = 0) : s i = 0 := by
rw [totalVariation, Measure.coe_add, Pi.add_apply, add_eq_zero_iff] at hs
rw [← toSignedMeasure_toJordanDecomposition s, toSignedMeasure, VectorMeasure.coe_sub,
Pi.sub_apply, Measure.toSignedMeasure_apply, Measure.toSignedMeasure_apply]
by_cases hi : MeasurableSet i
· rw [if_pos hi, if_pos hi]; simp [hs.1, hs.2]
· simp [if_neg hi]
theorem absolutelyContinuous_ennreal_iff (s : SignedMeasure α) (μ : VectorMeasure α ℝ≥0∞) :
s ≪ᵥ μ ↔ s.totalVariation ≪ μ.ennrealToMeasure := by
constructor <;> intro h
· refine Measure.AbsolutelyContinuous.mk fun S hS₁ hS₂ => ?_
obtain ⟨i, hi₁, hi₂, hi₃, hpos, hneg⟩ := s.toJordanDecomposition_spec
rw [totalVariation, Measure.add_apply, hpos, hneg, toMeasureOfZeroLE_apply _ _ _ hS₁,
toMeasureOfLEZero_apply _ _ _ hS₁]
rw [← VectorMeasure.AbsolutelyContinuous.ennrealToMeasure] at h
-- Porting note: added `NNReal.eq_iff`
simp [h (measure_mono_null (i.inter_subset_right) hS₂),
h (measure_mono_null (iᶜ.inter_subset_right) hS₂), NNReal.eq_iff]
· refine VectorMeasure.AbsolutelyContinuous.mk fun S hS₁ hS₂ => ?_
rw [← VectorMeasure.ennrealToMeasure_apply hS₁] at hS₂
exact null_of_totalVariation_zero s (h hS₂)
theorem totalVariation_absolutelyContinuous_iff (s : SignedMeasure α) (μ : Measure α) :
s.totalVariation ≪ μ ↔
s.toJordanDecomposition.posPart ≪ μ ∧ s.toJordanDecomposition.negPart ≪ μ := by
constructor <;> intro h
· constructor
all_goals
refine Measure.AbsolutelyContinuous.mk fun S _ hS₂ => ?_
have := h hS₂
rw [totalVariation, Measure.add_apply, add_eq_zero_iff] at this
exacts [this.1, this.2]
· refine Measure.AbsolutelyContinuous.mk fun S _ hS₂ => ?_
rw [totalVariation, Measure.add_apply, h.1 hS₂, h.2 hS₂, add_zero]
-- TODO: Generalize to vector measures once total variation on vector measures is defined
theorem mutuallySingular_iff (s t : SignedMeasure α) :
s ⟂ᵥ t ↔ s.totalVariation ⟂ₘ t.totalVariation := by
constructor
· rintro ⟨u, hmeas, hu₁, hu₂⟩
obtain ⟨i, hi₁, hi₂, hi₃, hipos, hineg⟩ := s.toJordanDecomposition_spec
obtain ⟨j, hj₁, hj₂, hj₃, hjpos, hjneg⟩ := t.toJordanDecomposition_spec
refine ⟨u, hmeas, ?_, ?_⟩
· rw [totalVariation, Measure.add_apply, hipos, hineg, toMeasureOfZeroLE_apply _ _ _ hmeas,
toMeasureOfLEZero_apply _ _ _ hmeas]
-- Porting note: added `NNReal.eq_iff`
simp [hu₁ _ Set.inter_subset_right, NNReal.eq_iff]
· rw [totalVariation, Measure.add_apply, hjpos, hjneg,
toMeasureOfZeroLE_apply _ _ _ hmeas.compl,
toMeasureOfLEZero_apply _ _ _ hmeas.compl]
-- Porting note: added `NNReal.eq_iff`
simp [hu₂ _ Set.inter_subset_right, NNReal.eq_iff]
· rintro ⟨u, hmeas, hu₁, hu₂⟩
exact
⟨u, hmeas, fun t htu => null_of_totalVariation_zero _ (measure_mono_null htu hu₁),
fun t htv => null_of_totalVariation_zero _ (measure_mono_null htv hu₂)⟩
theorem mutuallySingular_ennreal_iff (s : SignedMeasure α) (μ : VectorMeasure α ℝ≥0∞) :
s ⟂ᵥ μ ↔ s.totalVariation ⟂ₘ μ.ennrealToMeasure := by
constructor
· rintro ⟨u, hmeas, hu₁, hu₂⟩
obtain ⟨i, hi₁, hi₂, hi₃, hpos, hneg⟩ := s.toJordanDecomposition_spec
refine ⟨u, hmeas, ?_, ?_⟩
· rw [totalVariation, Measure.add_apply, hpos, hneg, toMeasureOfZeroLE_apply _ _ _ hmeas,
toMeasureOfLEZero_apply _ _ _ hmeas]
-- Porting note: added `NNReal.eq_iff`
simp [hu₁ _ Set.inter_subset_right, NNReal.eq_iff]
· rw [VectorMeasure.ennrealToMeasure_apply hmeas.compl]
exact hu₂ _ (Set.Subset.refl _)
· rintro ⟨u, hmeas, hu₁, hu₂⟩
refine
VectorMeasure.MutuallySingular.mk u hmeas
(fun t htu _ => null_of_totalVariation_zero _ (measure_mono_null htu hu₁)) fun t htv hmt =>
?_
rw [← VectorMeasure.ennrealToMeasure_apply hmt]
exact measure_mono_null htv hu₂
theorem totalVariation_mutuallySingular_iff (s : SignedMeasure α) (μ : Measure α) :
s.totalVariation ⟂ₘ μ ↔
s.toJordanDecomposition.posPart ⟂ₘ μ ∧ s.toJordanDecomposition.negPart ⟂ₘ μ :=
Measure.MutuallySingular.add_left_iff
end SignedMeasure
end MeasureTheory
|
MeasureTheory\Decomposition\Lebesgue.lean | /-
Copyright (c) 2021 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying
-/
import Mathlib.MeasureTheory.Measure.Sub
import Mathlib.MeasureTheory.Decomposition.SignedHahn
import Mathlib.MeasureTheory.Function.AEEqOfIntegral
/-!
# Lebesgue decomposition
This file proves the Lebesgue decomposition theorem. The Lebesgue decomposition theorem states that,
given two σ-finite measures `μ` and `ν`, there exists a σ-finite measure `ξ` and a measurable
function `f` such that `μ = ξ + fν` and `ξ` is mutually singular with respect to `ν`.
The Lebesgue decomposition provides the Radon-Nikodym theorem readily.
## Main definitions
* `MeasureTheory.Measure.HaveLebesgueDecomposition` : A pair of measures `μ` and `ν` is said
to `HaveLebesgueDecomposition` if there exist a measure `ξ` and a measurable function `f`,
such that `ξ` is mutually singular with respect to `ν` and `μ = ξ + ν.withDensity f`
* `MeasureTheory.Measure.singularPart` : If a pair of measures `HaveLebesgueDecomposition`,
then `singularPart` chooses the measure from `HaveLebesgueDecomposition`, otherwise it
returns the zero measure.
* `MeasureTheory.Measure.rnDeriv`: If a pair of measures
`HaveLebesgueDecomposition`, then `rnDeriv` chooses the measurable function from
`HaveLebesgueDecomposition`, otherwise it returns the zero function.
## Main results
* `MeasureTheory.Measure.haveLebesgueDecomposition_of_sigmaFinite` :
the Lebesgue decomposition theorem.
* `MeasureTheory.Measure.eq_singularPart` : Given measures `μ` and `ν`, if `s` is a measure
mutually singular to `ν` and `f` is a measurable function such that `μ = s + fν`, then
`s = μ.singularPart ν`.
* `MeasureTheory.Measure.eq_rnDeriv` : Given measures `μ` and `ν`, if `s` is a
measure mutually singular to `ν` and `f` is a measurable function such that `μ = s + fν`,
then `f = μ.rnDeriv ν`.
## Tags
Lebesgue decomposition theorem
-/
open scoped MeasureTheory NNReal ENNReal
open Set
namespace MeasureTheory
namespace Measure
variable {α β : Type*} {m : MeasurableSpace α} {μ ν : Measure α}
/-- A pair of measures `μ` and `ν` is said to `HaveLebesgueDecomposition` if there exists a
measure `ξ` and a measurable function `f`, such that `ξ` is mutually singular with respect to
`ν` and `μ = ξ + ν.withDensity f`. -/
class HaveLebesgueDecomposition (μ ν : Measure α) : Prop where
lebesgue_decomposition :
∃ p : Measure α × (α → ℝ≥0∞), Measurable p.2 ∧ p.1 ⟂ₘ ν ∧ μ = p.1 + ν.withDensity p.2
open Classical in
/-- If a pair of measures `HaveLebesgueDecomposition`, then `singularPart` chooses the
measure from `HaveLebesgueDecomposition`, otherwise it returns the zero measure. For sigma-finite
measures, `μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν)`. -/
noncomputable irreducible_def singularPart (μ ν : Measure α) : Measure α :=
if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).1 else 0
open Classical in
/-- If a pair of measures `HaveLebesgueDecomposition`, then `rnDeriv` chooses the
measurable function from `HaveLebesgueDecomposition`, otherwise it returns the zero function.
For sigma-finite measures, `μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν)`. -/
noncomputable irreducible_def rnDeriv (μ ν : Measure α) : α → ℝ≥0∞ :=
if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).2 else 0
section ByDefinition
theorem haveLebesgueDecomposition_spec (μ ν : Measure α) [h : HaveLebesgueDecomposition μ ν] :
Measurable (μ.rnDeriv ν) ∧
μ.singularPart ν ⟂ₘ ν ∧ μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) := by
rw [singularPart, rnDeriv, dif_pos h, dif_pos h]
exact Classical.choose_spec h.lebesgue_decomposition
lemma rnDeriv_of_not_haveLebesgueDecomposition (h : ¬ HaveLebesgueDecomposition μ ν) :
μ.rnDeriv ν = 0 := by
rw [rnDeriv, dif_neg h]
lemma singularPart_of_not_haveLebesgueDecomposition (h : ¬ HaveLebesgueDecomposition μ ν) :
μ.singularPart ν = 0 := by
rw [singularPart, dif_neg h]
@[measurability, fun_prop]
theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν := by
by_cases h : HaveLebesgueDecomposition μ ν
· exact (haveLebesgueDecomposition_spec μ ν).1
· rw [rnDeriv_of_not_haveLebesgueDecomposition h]
exact measurable_zero
theorem mutuallySingular_singularPart (μ ν : Measure α) : μ.singularPart ν ⟂ₘ ν := by
by_cases h : HaveLebesgueDecomposition μ ν
· exact (haveLebesgueDecomposition_spec μ ν).2.1
· rw [singularPart_of_not_haveLebesgueDecomposition h]
exact MutuallySingular.zero_left
theorem haveLebesgueDecomposition_add (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) :=
(haveLebesgueDecomposition_spec μ ν).2.2
lemma singularPart_add_rnDeriv (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) = μ := (haveLebesgueDecomposition_add μ ν).symm
lemma rnDeriv_add_singularPart (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
ν.withDensity (μ.rnDeriv ν) + μ.singularPart ν = μ := by rw [add_comm, singularPart_add_rnDeriv]
end ByDefinition
section HaveLebesgueDecomposition
instance instHaveLebesgueDecompositionZeroLeft : HaveLebesgueDecomposition 0 ν where
lebesgue_decomposition := ⟨⟨0, 0⟩, measurable_zero, MutuallySingular.zero_left, by simp⟩
instance instHaveLebesgueDecompositionZeroRight : HaveLebesgueDecomposition μ 0 where
lebesgue_decomposition := ⟨⟨μ, 0⟩, measurable_zero, MutuallySingular.zero_right, by simp⟩
instance instHaveLebesgueDecompositionSelf : HaveLebesgueDecomposition μ μ where
lebesgue_decomposition := ⟨⟨0, 1⟩, measurable_const, MutuallySingular.zero_left, by simp⟩
instance HaveLebesgueDecomposition.sum_left {ι : Type*} [Countable ι] (μ : ι → Measure α)
[∀ i, HaveLebesgueDecomposition (μ i) ν] : HaveLebesgueDecomposition (.sum μ) ν :=
⟨(.sum fun i ↦ (μ i).singularPart ν, ∑' i, rnDeriv (μ i) ν),
by dsimp only; fun_prop, by simp [mutuallySingular_singularPart], by
simp [withDensity_tsum, measurable_rnDeriv, Measure.sum_add_sum, singularPart_add_rnDeriv]⟩
instance HaveLebesgueDecomposition.add_left {μ' : Measure α} [HaveLebesgueDecomposition μ ν]
[HaveLebesgueDecomposition μ' ν] : HaveLebesgueDecomposition (μ + μ') ν := by
have : ∀ b, HaveLebesgueDecomposition (cond b μ μ') ν := by simp [*]
simpa using sum_left (cond · μ μ')
instance haveLebesgueDecompositionSMul' (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
(r : ℝ≥0∞) : (r • μ).HaveLebesgueDecomposition ν where
lebesgue_decomposition := by
obtain ⟨hmeas, hsing, hadd⟩ := haveLebesgueDecomposition_spec μ ν
refine ⟨⟨r • μ.singularPart ν, r • μ.rnDeriv ν⟩, hmeas.const_smul _, hsing.smul _, ?_⟩
simp only [ENNReal.smul_def]
rw [withDensity_smul _ hmeas, ← smul_add, ← hadd]
instance haveLebesgueDecompositionSMul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
(r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν := by
rw [ENNReal.smul_def]; infer_instance
instance haveLebesgueDecompositionSMulRight (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
(r : ℝ≥0) :
μ.HaveLebesgueDecomposition (r • ν) where
lebesgue_decomposition := by
obtain ⟨hmeas, hsing, hadd⟩ := haveLebesgueDecomposition_spec μ ν
by_cases hr : r = 0
· exact ⟨⟨μ, 0⟩, measurable_const, by simp [hr], by simp⟩
refine ⟨⟨μ.singularPart ν, r⁻¹ • μ.rnDeriv ν⟩, hmeas.const_smul _,
hsing.mono_ac AbsolutelyContinuous.rfl smul_absolutelyContinuous, ?_⟩
have : r⁻¹ • rnDeriv μ ν = ((r⁻¹ : ℝ≥0) : ℝ≥0∞) • rnDeriv μ ν := by simp [ENNReal.smul_def]
rw [this, withDensity_smul _ hmeas, ENNReal.smul_def r, withDensity_smul_measure,
← smul_assoc, smul_eq_mul, ENNReal.coe_inv hr, ENNReal.inv_mul_cancel, one_smul]
· exact hadd
· simp [hr]
· exact ENNReal.coe_ne_top
theorem haveLebesgueDecomposition_withDensity (μ : Measure α) {f : α → ℝ≥0∞} (hf : Measurable f) :
(μ.withDensity f).HaveLebesgueDecomposition μ := ⟨⟨⟨0, f⟩, hf, .zero_left, (zero_add _).symm⟩⟩
instance haveLebesgueDecompositionRnDeriv (μ ν : Measure α) :
HaveLebesgueDecomposition (ν.withDensity (μ.rnDeriv ν)) ν :=
haveLebesgueDecomposition_withDensity ν (measurable_rnDeriv _ _)
instance instHaveLebesgueDecompositionSingularPart :
HaveLebesgueDecomposition (μ.singularPart ν) ν :=
⟨⟨μ.singularPart ν, 0⟩, measurable_zero, mutuallySingular_singularPart μ ν, by simp⟩
end HaveLebesgueDecomposition
theorem singularPart_le (μ ν : Measure α) : μ.singularPart ν ≤ μ := by
by_cases hl : HaveLebesgueDecomposition μ ν
· conv_rhs => rw [haveLebesgueDecomposition_add μ ν]
exact Measure.le_add_right le_rfl
· rw [singularPart, dif_neg hl]
exact Measure.zero_le μ
theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv ν) ≤ μ := by
by_cases hl : HaveLebesgueDecomposition μ ν
· conv_rhs => rw [haveLebesgueDecomposition_add μ ν]
exact Measure.le_add_left le_rfl
· rw [rnDeriv, dif_neg hl, withDensity_zero]
exact Measure.zero_le μ
lemma _root_.AEMeasurable.singularPart {β : Type*} {_ : MeasurableSpace β} {f : α → β}
(hf : AEMeasurable f μ) (ν : Measure α) :
AEMeasurable f (μ.singularPart ν) :=
AEMeasurable.mono_measure hf (Measure.singularPart_le _ _)
lemma _root_.AEMeasurable.withDensity_rnDeriv {β : Type*} {_ : MeasurableSpace β} {f : α → β}
(hf : AEMeasurable f μ) (ν : Measure α) :
AEMeasurable f (ν.withDensity (μ.rnDeriv ν)) :=
AEMeasurable.mono_measure hf (Measure.withDensity_rnDeriv_le _ _)
lemma MutuallySingular.singularPart (h : μ ⟂ₘ ν) (ν' : Measure α) :
μ.singularPart ν' ⟂ₘ ν :=
h.mono (singularPart_le μ ν') le_rfl
lemma absolutelyContinuous_withDensity_rnDeriv [HaveLebesgueDecomposition ν μ] (hμν : μ ≪ ν) :
μ ≪ μ.withDensity (ν.rnDeriv μ) := by
rw [haveLebesgueDecomposition_add ν μ] at hμν
refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
rw [← inter_union_compl s]
refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
simp only [nonpos_iff_eq_zero, add_eq_zero]
constructor
· refine hμν ?_
simp only [coe_add, Pi.add_apply, add_eq_zero]
constructor
· exact measure_mono_null Set.inter_subset_right ht1
· exact measure_mono_null Set.inter_subset_left hνs
· exact measure_mono_null Set.inter_subset_right ht2
lemma singularPart_eq_zero_of_ac (h : μ ≪ ν) : μ.singularPart ν = 0 := by
rw [← MutuallySingular.self_iff]
exact MutuallySingular.mono_ac (mutuallySingular_singularPart _ _)
AbsolutelyContinuous.rfl ((absolutelyContinuous_of_le (singularPart_le _ _)).trans h)
@[simp]
theorem singularPart_zero (ν : Measure α) : (0 : Measure α).singularPart ν = 0 :=
singularPart_eq_zero_of_ac (AbsolutelyContinuous.zero _)
@[simp]
lemma singularPart_zero_right (μ : Measure α) : μ.singularPart 0 = μ := by
conv_rhs => rw [haveLebesgueDecomposition_add μ 0]
simp
lemma singularPart_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
μ.singularPart ν = 0 ↔ μ ≪ ν := by
have h_dec := haveLebesgueDecomposition_add μ ν
refine ⟨fun h ↦ ?_, singularPart_eq_zero_of_ac⟩
rw [h, zero_add] at h_dec
rw [h_dec]
exact withDensity_absolutelyContinuous ν _
@[simp]
lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
have h_dec := haveLebesgueDecomposition_add μ ν
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· rw [h, add_zero] at h_dec
rw [h_dec]
exact mutuallySingular_singularPart μ ν
· rw [← MutuallySingular.self_iff]
rw [h_dec, MutuallySingular.add_left_iff] at h
refine MutuallySingular.mono_ac h.2 AbsolutelyContinuous.rfl ?_
exact withDensity_absolutelyContinuous _ _
@[simp]
lemma rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
μ.rnDeriv ν =ᵐ[ν] 0 ↔ μ ⟂ₘ ν := by
rw [← withDensity_rnDeriv_eq_zero, withDensity_eq_zero_iff (measurable_rnDeriv _ _).aemeasurable]
lemma rnDeriv_zero (ν : Measure α) : (0 : Measure α).rnDeriv ν =ᵐ[ν] 0 := by
rw [rnDeriv_eq_zero]
exact MutuallySingular.zero_left
lemma MutuallySingular.rnDeriv_ae_eq_zero (hμν : μ ⟂ₘ ν) :
μ.rnDeriv ν =ᵐ[ν] 0 := by
by_cases h : μ.HaveLebesgueDecomposition ν
· rw [rnDeriv_eq_zero]
exact hμν
· rw [rnDeriv_of_not_haveLebesgueDecomposition h]
@[simp]
theorem singularPart_withDensity (ν : Measure α) (f : α → ℝ≥0∞) :
(ν.withDensity f).singularPart ν = 0 :=
singularPart_eq_zero_of_ac (withDensity_absolutelyContinuous _ _)
lemma rnDeriv_singularPart (μ ν : Measure α) :
(μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := by
rw [rnDeriv_eq_zero]
exact mutuallySingular_singularPart μ ν
@[simp]
lemma singularPart_self (μ : Measure α) : μ.singularPart μ = 0 :=
singularPart_eq_zero_of_ac Measure.AbsolutelyContinuous.rfl
lemma rnDeriv_self (μ : Measure α) [SigmaFinite μ] : μ.rnDeriv μ =ᵐ[μ] fun _ ↦ 1 := by
have h := rnDeriv_add_singularPart μ μ
rw [singularPart_self, add_zero] at h
have h_one : μ = μ.withDensity 1 := by simp
conv_rhs at h => rw [h_one]
rwa [withDensity_eq_iff_of_sigmaFinite (measurable_rnDeriv _ _).aemeasurable] at h
exact aemeasurable_const
lemma singularPart_eq_self [μ.HaveLebesgueDecomposition ν] : μ.singularPart ν = μ ↔ μ ⟂ₘ ν := by
have h_dec := haveLebesgueDecomposition_add μ ν
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· rw [← h]
exact mutuallySingular_singularPart _ _
· conv_rhs => rw [h_dec]
rw [(withDensity_rnDeriv_eq_zero _ _).mpr h, add_zero]
@[simp]
lemma singularPart_singularPart (μ ν : Measure α) :
(μ.singularPart ν).singularPart ν = μ.singularPart ν := by
rw [Measure.singularPart_eq_self]
exact Measure.mutuallySingular_singularPart _ _
instance singularPart.instIsFiniteMeasure [IsFiniteMeasure μ] :
IsFiniteMeasure (μ.singularPart ν) :=
isFiniteMeasure_of_le μ <| singularPart_le μ ν
instance singularPart.instSigmaFinite [SigmaFinite μ] : SigmaFinite (μ.singularPart ν) :=
sigmaFinite_of_le μ <| singularPart_le μ ν
instance singularPart.instIsLocallyFiniteMeasure [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
IsLocallyFiniteMeasure (μ.singularPart ν) :=
isLocallyFiniteMeasure_of_le <| singularPart_le μ ν
instance withDensity.instIsFiniteMeasure [IsFiniteMeasure μ] :
IsFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
isFiniteMeasure_of_le μ <| withDensity_rnDeriv_le μ ν
instance withDensity.instSigmaFinite [SigmaFinite μ] :
SigmaFinite (ν.withDensity <| μ.rnDeriv ν) :=
sigmaFinite_of_le μ <| withDensity_rnDeriv_le μ ν
instance withDensity.instIsLocallyFiniteMeasure [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
IsLocallyFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
isLocallyFiniteMeasure_of_le <| withDensity_rnDeriv_le μ ν
section RNDerivFinite
theorem lintegral_rnDeriv_lt_top_of_measure_ne_top (ν : Measure α) {s : Set α} (hs : μ s ≠ ∞) :
∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞ := by
by_cases hl : HaveLebesgueDecomposition μ ν
· suffices (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞ from
lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
rw [← withDensity_apply _ (measurableSet_toMeasurable _ _)]
calc
_ ≤ (singularPart μ ν) (toMeasurable μ s) + _ := le_add_self
_ = μ s := by rw [← Measure.add_apply, ← haveLebesgueDecomposition_add, measure_toMeasurable]
_ < ⊤ := hs.lt_top
· simp only [Measure.rnDeriv, dif_neg hl, Pi.zero_apply, lintegral_zero, ENNReal.zero_lt_top]
theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
∫⁻ x, μ.rnDeriv ν x ∂ν < ∞ := by
rw [← setLIntegral_univ]
exact lintegral_rnDeriv_lt_top_of_measure_ne_top _ (measure_lt_top _ _).ne
lemma integrable_toReal_rnDeriv [IsFiniteMeasure μ] :
Integrable (fun x ↦ (μ.rnDeriv ν x).toReal) ν :=
integrable_toReal_of_lintegral_ne_top (Measure.measurable_rnDeriv _ _).aemeasurable
(Measure.lintegral_rnDeriv_lt_top _ _).ne
/-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
measure `ν` is `ν`-almost everywhere finite. -/
theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ := by
suffices ∀ n, ∀ᵐ x ∂ν, x ∈ spanningSets μ n → μ.rnDeriv ν x < ∞ by
filter_upwards [ae_all_iff.2 this] with _ hx using hx _ (mem_spanningSetsIndex _ _)
intro n
rw [← ae_restrict_iff' (measurable_spanningSets _ _)]
apply ae_lt_top (measurable_rnDeriv _ _)
refine (lintegral_rnDeriv_lt_top_of_measure_ne_top _ ?_).ne
exact (measure_spanningSets_lt_top _ _).ne
lemma rnDeriv_ne_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x ≠ ∞ := by
filter_upwards [Measure.rnDeriv_lt_top μ ν] with x hx using hx.ne
end RNDerivFinite
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.
This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
(hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
have : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
rw [hadd'] at hadd
have hνinter : ν (S ∩ T)ᶜ = 0 := by
rw [compl_inter]
refine nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) ?_)
rw [hT₃, hS₃, add_zero]
have heq : s.restrict (S ∩ T)ᶜ = (μ.singularPart ν).restrict (S ∩ T)ᶜ := by
ext1 A hA
have hf : ν.withDensity f (A ∩ (S ∩ T)ᶜ) = 0 := by
refine withDensity_absolutelyContinuous ν _ ?_
rw [← nonpos_iff_eq_zero]
exact hνinter ▸ measure_mono inter_subset_right
have hrn : ν.withDensity (μ.rnDeriv ν) (A ∩ (S ∩ T)ᶜ) = 0 := by
refine withDensity_absolutelyContinuous ν _ ?_
rw [← nonpos_iff_eq_zero]
exact hνinter ▸ measure_mono inter_subset_right
rw [restrict_apply hA, restrict_apply hA, ← add_zero (s (A ∩ (S ∩ T)ᶜ)), ← hf, ← add_apply, ←
hadd, add_apply, hrn, add_zero]
have heq' : ∀ A : Set α, MeasurableSet A → s A = s.restrict (S ∩ T)ᶜ A := by
intro A hA
have hsinter : s (A ∩ (S ∩ T)) = 0 := by
rw [← nonpos_iff_eq_zero]
exact hS₂ ▸ measure_mono (inter_subset_right.trans inter_subset_left)
rw [restrict_apply hA, ← diff_eq, AEDisjoint.measure_diff_left hsinter]
ext1 A hA
have hμinter : μ.singularPart ν (A ∩ (S ∩ T)) = 0 := by
rw [← nonpos_iff_eq_zero]
exact hT₂ ▸ measure_mono (inter_subset_right.trans inter_subset_right)
rw [heq' A hA, heq, restrict_apply hA, ← diff_eq, AEDisjoint.measure_diff_left hμinter]
theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
(r • μ).singularPart ν = r • μ.singularPart ν := by
by_cases hr : r = 0
· rw [hr, zero_smul, zero_smul, singularPart_zero]
by_cases hl : HaveLebesgueDecomposition μ ν
· refine (eq_singularPart ((measurable_rnDeriv μ ν).const_smul (r : ℝ≥0∞))
(MutuallySingular.smul r (mutuallySingular_singularPart _ _)) ?_).symm
rw [withDensity_smul _ (measurable_rnDeriv _ _), ← smul_add,
← haveLebesgueDecomposition_add μ ν, ENNReal.smul_def]
· rw [singularPart, singularPart, dif_neg hl, dif_neg, smul_zero]
refine fun hl' ↦ hl ?_
rw [← inv_smul_smul₀ hr μ]
infer_instance
theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0) :
μ.singularPart (r • ν) = μ.singularPart ν := by
by_cases hl : HaveLebesgueDecomposition μ ν
· refine (eq_singularPart ((measurable_rnDeriv μ ν).const_smul r⁻¹) ?_ ?_).symm
· exact (mutuallySingular_singularPart μ ν).mono_ac AbsolutelyContinuous.rfl
smul_absolutelyContinuous
· rw [ENNReal.smul_def r, withDensity_smul_measure, ← withDensity_smul]
swap; · exact (measurable_rnDeriv _ _).const_smul _
convert haveLebesgueDecomposition_add μ ν
ext x
simp only [Pi.smul_apply]
rw [← ENNReal.smul_def, smul_inv_smul₀ hr]
· rw [singularPart, singularPart, dif_neg hl, dif_neg]
refine fun hl' ↦ hl ?_
rw [← inv_smul_smul₀ hr ν]
infer_instance
theorem singularPart_add (μ₁ μ₂ ν : Measure α) [HaveLebesgueDecomposition μ₁ ν]
[HaveLebesgueDecomposition μ₂ ν] :
(μ₁ + μ₂).singularPart ν = μ₁.singularPart ν + μ₂.singularPart ν := by
refine (eq_singularPart ((measurable_rnDeriv μ₁ ν).add (measurable_rnDeriv μ₂ ν))
((mutuallySingular_singularPart _ _).add_left (mutuallySingular_singularPart _ _)) ?_).symm
erw [withDensity_add_left (measurable_rnDeriv μ₁ ν)]
conv_rhs => rw [add_assoc, add_comm (μ₂.singularPart ν), ← add_assoc, ← add_assoc]
rw [← haveLebesgueDecomposition_add μ₁ ν, add_assoc, add_comm (ν.withDensity (μ₂.rnDeriv ν)),
← haveLebesgueDecomposition_add μ₂ ν]
lemma singularPart_restrict (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
{s : Set α} (hs : MeasurableSet s) :
(μ.restrict s).singularPart ν = (μ.singularPart ν).restrict s := by
refine (Measure.eq_singularPart (f := s.indicator (μ.rnDeriv ν)) ?_ ?_ ?_).symm
· exact (μ.measurable_rnDeriv ν).indicator hs
· exact (Measure.mutuallySingular_singularPart μ ν).restrict s
· ext t
rw [withDensity_indicator hs, ← restrict_withDensity hs, ← Measure.restrict_add,
← μ.haveLebesgueDecomposition_add ν]
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `f = μ.rnDeriv ν`.
This theorem provides the uniqueness of the `rnDeriv` in the Lebesgue decomposition
theorem, while `MeasureTheory.Measure.eq_singularPart` provides the uniqueness of the
`singularPart`. Here, the uniqueness is given in terms of the measures, while the uniqueness in
terms of the functions is given in `eq_rnDeriv`. -/
theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
(hadd : μ = s + ν.withDensity f) : ν.withDensity f = ν.withDensity (μ.rnDeriv ν) := by
have : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
rw [hadd'] at hadd
have hνinter : ν (S ∩ T)ᶜ = 0 := by
rw [compl_inter]
refine nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) ?_)
rw [hT₃, hS₃, add_zero]
have heq :
(ν.withDensity f).restrict (S ∩ T) = (ν.withDensity (μ.rnDeriv ν)).restrict (S ∩ T) := by
ext1 A hA
have hs : s (A ∩ (S ∩ T)) = 0 := by
rw [← nonpos_iff_eq_zero]
exact hS₂ ▸ measure_mono (inter_subset_right.trans inter_subset_left)
have hsing : μ.singularPart ν (A ∩ (S ∩ T)) = 0 := by
rw [← nonpos_iff_eq_zero]
exact hT₂ ▸ measure_mono (inter_subset_right.trans inter_subset_right)
rw [restrict_apply hA, restrict_apply hA, ← add_zero (ν.withDensity f (A ∩ (S ∩ T))), ← hs, ←
add_apply, add_comm, ← hadd, add_apply, hsing, zero_add]
have heq' :
∀ A : Set α, MeasurableSet A → ν.withDensity f A = (ν.withDensity f).restrict (S ∩ T) A := by
intro A hA
have hνfinter : ν.withDensity f (A ∩ (S ∩ T)ᶜ) = 0 := by
rw [← nonpos_iff_eq_zero]
exact withDensity_absolutelyContinuous ν f hνinter ▸ measure_mono inter_subset_right
rw [restrict_apply hA, ← add_zero (ν.withDensity f (A ∩ (S ∩ T))), ← hνfinter, ← diff_eq,
measure_inter_add_diff _ (hS₁.inter hT₁)]
ext1 A hA
have hνrn : ν.withDensity (μ.rnDeriv ν) (A ∩ (S ∩ T)ᶜ) = 0 := by
rw [← nonpos_iff_eq_zero]
exact
withDensity_absolutelyContinuous ν (μ.rnDeriv ν) hνinter ▸
measure_mono inter_subset_right
rw [heq' A hA, heq, ← add_zero ((ν.withDensity (μ.rnDeriv ν)).restrict (S ∩ T) A), ← hνrn,
restrict_apply hA, ← diff_eq, measure_inter_add_diff _ (hS₁.inter hT₁)]
theorem eq_withDensity_rnDeriv₀ {s : Measure α} {f : α → ℝ≥0∞}
(hf : AEMeasurable f ν) (hs : s ⟂ₘ ν) (hadd : μ = s + ν.withDensity f) :
ν.withDensity f = ν.withDensity (μ.rnDeriv ν) := by
rw [withDensity_congr_ae hf.ae_eq_mk] at hadd ⊢
exact eq_withDensity_rnDeriv hf.measurable_mk hs hadd
theorem eq_rnDeriv₀ [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞}
(hf : AEMeasurable f ν) (hs : s ⟂ₘ ν) (hadd : μ = s + ν.withDensity f) :
f =ᵐ[ν] μ.rnDeriv ν :=
(withDensity_eq_iff_of_sigmaFinite hf (measurable_rnDeriv _ _).aemeasurable).mp
(eq_withDensity_rnDeriv₀ hf hs hadd)
/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `f = μ.rnDeriv ν`.
This theorem provides the uniqueness of the `rnDeriv` in the Lebesgue decomposition
theorem, while `MeasureTheory.Measure.eq_singularPart` provides the uniqueness of the
`singularPart`. Here, the uniqueness is given in terms of the functions, while the uniqueness in
terms of the functions is given in `eq_withDensity_rnDeriv`. -/
theorem eq_rnDeriv [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
(hadd : μ = s + ν.withDensity f) : f =ᵐ[ν] μ.rnDeriv ν :=
eq_rnDeriv₀ hf.aemeasurable hs hadd
/-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
theorem rnDeriv_withDensity₀ (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞}
(hf : AEMeasurable f ν) :
(ν.withDensity f).rnDeriv ν =ᵐ[ν] f :=
have : ν.withDensity f = 0 + ν.withDensity f := by rw [zero_add]
(eq_rnDeriv₀ hf MutuallySingular.zero_left this).symm
/-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞} (hf : Measurable f) :
(ν.withDensity f).rnDeriv ν =ᵐ[ν] f :=
rnDeriv_withDensity₀ ν hf.aemeasurable
lemma rnDeriv_restrict (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] [SigmaFinite ν]
{s : Set α} (hs : MeasurableSet s) :
(μ.restrict s).rnDeriv ν =ᵐ[ν] s.indicator (μ.rnDeriv ν) := by
refine (eq_rnDeriv (s := (μ.restrict s).singularPart ν)
((measurable_rnDeriv _ _).indicator hs) (mutuallySingular_singularPart _ _) ?_).symm
rw [singularPart_restrict _ _ hs, withDensity_indicator hs, ← restrict_withDensity hs,
← Measure.restrict_add, ← μ.haveLebesgueDecomposition_add ν]
/-- The Radon-Nikodym derivative of the restriction of a measure to a measurable set is the
indicator function of this set. -/
theorem rnDeriv_restrict_self (ν : Measure α) [SigmaFinite ν] {s : Set α} (hs : MeasurableSet s) :
(ν.restrict s).rnDeriv ν =ᵐ[ν] s.indicator 1 := by
rw [← withDensity_indicator_one hs]
exact rnDeriv_withDensity _ (measurable_one.indicator hs)
/-- Radon-Nikodym derivative of the scalar multiple of a measure.
See also `rnDeriv_smul_left'`, which requires sigma-finite `ν` and `μ`. -/
theorem rnDeriv_smul_left (ν μ : Measure α) [IsFiniteMeasure ν]
[ν.HaveLebesgueDecomposition μ] (r : ℝ≥0) :
(r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ := by
rw [← withDensity_eq_iff]
· simp_rw [ENNReal.smul_def]
rw [withDensity_smul _ (measurable_rnDeriv _ _)]
suffices (r • ν).singularPart μ + withDensity μ (rnDeriv (r • ν) μ)
= (r • ν).singularPart μ + r • withDensity μ (rnDeriv ν μ) by
rwa [Measure.add_right_inj] at this
rw [← (r • ν).haveLebesgueDecomposition_add μ, singularPart_smul, ← smul_add,
← ν.haveLebesgueDecomposition_add μ]
· exact (measurable_rnDeriv _ _).aemeasurable
· exact (measurable_rnDeriv _ _).aemeasurable.const_smul _
· exact (lintegral_rnDeriv_lt_top (r • ν) μ).ne
/-- Radon-Nikodym derivative of the scalar multiple of a measure.
See also `rnDeriv_smul_left_of_ne_top'`, which requires sigma-finite `ν` and `μ`. -/
theorem rnDeriv_smul_left_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν]
[ν.HaveLebesgueDecomposition μ] {r : ℝ≥0∞} (hr : r ≠ ∞) :
(r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ := by
have h : (r.toNNReal • ν).rnDeriv μ =ᵐ[μ] r.toNNReal • ν.rnDeriv μ :=
rnDeriv_smul_left ν μ r.toNNReal
simpa [ENNReal.smul_def, ENNReal.coe_toNNReal hr] using h
/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
See also `rnDeriv_smul_right'`, which requires sigma-finite `ν` and `μ`. -/
theorem rnDeriv_smul_right (ν μ : Measure α) [IsFiniteMeasure ν]
[ν.HaveLebesgueDecomposition μ] {r : ℝ≥0} (hr : r ≠ 0) :
ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
refine (absolutelyContinuous_smul <| ENNReal.coe_ne_zero.2 hr).ae_le
(?_ : ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ)
rw [← withDensity_eq_iff]
rotate_left
· exact (measurable_rnDeriv _ _).aemeasurable
· exact (measurable_rnDeriv _ _).aemeasurable.const_smul _
· exact (lintegral_rnDeriv_lt_top ν _).ne
· simp_rw [ENNReal.smul_def]
rw [withDensity_smul _ (measurable_rnDeriv _ _)]
suffices ν.singularPart (r • μ) + withDensity (r • μ) (rnDeriv ν (r • μ))
= ν.singularPart (r • μ) + r⁻¹ • withDensity (r • μ) (rnDeriv ν μ) by
rwa [add_right_inj] at this
rw [← ν.haveLebesgueDecomposition_add (r • μ), singularPart_smul_right _ _ _ hr,
ENNReal.smul_def r, withDensity_smul_measure, ← ENNReal.smul_def, ← smul_assoc,
smul_eq_mul, inv_mul_cancel hr, one_smul]
exact ν.haveLebesgueDecomposition_add μ
/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
See also `rnDeriv_smul_right_of_ne_top'`, which requires sigma-finite `ν` and `μ`. -/
theorem rnDeriv_smul_right_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν]
[ν.HaveLebesgueDecomposition μ] {r : ℝ≥0∞} (hr : r ≠ 0) (hr_ne_top : r ≠ ∞) :
ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
have h : ν.rnDeriv (r.toNNReal • μ) =ᵐ[μ] r.toNNReal⁻¹ • ν.rnDeriv μ := by
refine rnDeriv_smul_right ν μ ?_
rw [ne_eq, ENNReal.toNNReal_eq_zero_iff]
simp [hr, hr_ne_top]
have : (r.toNNReal)⁻¹ • rnDeriv ν μ = r⁻¹ • rnDeriv ν μ := by
ext x
simp only [Pi.smul_apply, ENNReal.smul_def, ne_eq, smul_eq_mul]
rw [ENNReal.coe_inv, ENNReal.coe_toNNReal hr_ne_top]
rw [ne_eq, ENNReal.toNNReal_eq_zero_iff]
simp [hr, hr_ne_top]
simp_rw [this, ENNReal.smul_def, ENNReal.coe_toNNReal hr_ne_top] at h
exact h
/-- Radon-Nikodym derivative of a sum of two measures.
See also `rnDeriv_add'`, which requires sigma-finite `ν₁`, `ν₂` and `μ`. -/
lemma rnDeriv_add (ν₁ ν₂ μ : Measure α) [IsFiniteMeasure ν₁] [IsFiniteMeasure ν₂]
[ν₁.HaveLebesgueDecomposition μ] [ν₂.HaveLebesgueDecomposition μ]
[(ν₁ + ν₂).HaveLebesgueDecomposition μ] :
(ν₁ + ν₂).rnDeriv μ =ᵐ[μ] ν₁.rnDeriv μ + ν₂.rnDeriv μ := by
rw [← withDensity_eq_iff]
· suffices (ν₁ + ν₂).singularPart μ + μ.withDensity ((ν₁ + ν₂).rnDeriv μ)
= (ν₁ + ν₂).singularPart μ + μ.withDensity (ν₁.rnDeriv μ + ν₂.rnDeriv μ) by
rwa [add_right_inj] at this
rw [← (ν₁ + ν₂).haveLebesgueDecomposition_add μ, singularPart_add,
withDensity_add_left (measurable_rnDeriv _ _), add_assoc,
add_comm (ν₂.singularPart μ), add_assoc, add_comm _ (ν₂.singularPart μ),
← ν₂.haveLebesgueDecomposition_add μ, ← add_assoc, ← ν₁.haveLebesgueDecomposition_add μ]
· exact (measurable_rnDeriv _ _).aemeasurable
· exact ((measurable_rnDeriv _ _).add (measurable_rnDeriv _ _)).aemeasurable
· exact (lintegral_rnDeriv_lt_top (ν₁ + ν₂) μ).ne
open VectorMeasure SignedMeasure
/-- If two finite measures `μ` and `ν` are not mutually singular, there exists some `ε > 0` and
a measurable set `E`, such that `ν(E) > 0` and `E` is positive with respect to `μ - εν`.
This lemma is useful for the Lebesgue decomposition theorem. -/
theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMeasure μ]
[IsFiniteMeasure ν] (h : ¬μ ⟂ₘ ν) :
∃ ε : ℝ≥0, 0 < ε ∧
∃ E : Set α,
MeasurableSet E ∧ 0 < ν E ∧ 0 ≤[E] μ.toSignedMeasure - (ε • ν).toSignedMeasure := by
-- for all `n : ℕ`, obtain the Hahn decomposition for `μ - (1 / n) ν`
have :
∀ n : ℕ, ∃ i : Set α,
MeasurableSet i ∧
0 ≤[i] μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ∧
μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[iᶜ] 0 := by
intro; exact exists_compl_positive_negative _
choose f hf₁ hf₂ hf₃ using this
-- set `A` to be the intersection of all the negative parts of obtained Hahn decompositions
-- and we show that `μ A = 0`
let A := ⋂ n, (f n)ᶜ
have hAmeas : MeasurableSet A := MeasurableSet.iInter fun n ↦ (hf₁ n).compl
have hA₂ : ∀ n : ℕ, μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[A] 0 := by
intro n; exact restrict_le_restrict_subset _ _ (hf₁ n).compl (hf₃ n) (iInter_subset _ _)
have hA₃ : ∀ n : ℕ, μ A ≤ (1 / (n + 1) : ℝ≥0) * ν A := by
intro n
have := nonpos_of_restrict_le_zero _ (hA₂ n)
rwa [toSignedMeasure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this
exacts [measure_ne_top _ _, measure_ne_top _ _]
have hμ : μ A = 0 := by
lift μ A to ℝ≥0 using measure_ne_top _ _ with μA
lift ν A to ℝ≥0 using measure_ne_top _ _ with νA
rw [ENNReal.coe_eq_zero]
by_cases hb : 0 < νA
· suffices ∀ b, 0 < b → μA ≤ b by
by_contra h
have h' := this (μA / 2) (half_pos (zero_lt_iff.2 h))
rw [← @Classical.not_not (μA ≤ μA / 2)] at h'
exact h' (not_le.2 (NNReal.half_lt_self h))
intro c hc
have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * (νA : ℝ)⁻¹ := by
refine exists_nat_one_div_lt ?_
positivity
rcases this with ⟨n, hn⟩
have hb₁ : (0 : ℝ) < (νA : ℝ)⁻¹ := by rw [_root_.inv_pos]; exact hb
have h' : 1 / (↑n + 1) * νA < c := by
rw [← NNReal.coe_lt_coe, ← mul_lt_mul_right hb₁, NNReal.coe_mul, mul_assoc, ←
NNReal.coe_inv, ← NNReal.coe_mul, _root_.mul_inv_cancel, ← NNReal.coe_mul, mul_one,
NNReal.coe_inv]
· exact hn
· exact hb.ne'
refine le_trans ?_ h'.le
rw [← ENNReal.coe_le_coe, ENNReal.coe_mul]
exact hA₃ n
· rw [not_lt, le_zero_iff] at hb
specialize hA₃ 0
simp? [hb] at hA₃ says
simp only [CharP.cast_eq_zero, zero_add, ne_eq, one_ne_zero, not_false_eq_true, div_self,
ENNReal.coe_one, hb, ENNReal.coe_zero, mul_zero, nonpos_iff_eq_zero,
ENNReal.coe_eq_zero] at hA₃
assumption
-- since `μ` and `ν` are not mutually singular, `μ A = 0` implies `ν Aᶜ > 0`
rw [MutuallySingular] at h; push_neg at h
have := h _ hAmeas hμ
simp_rw [A, compl_iInter, compl_compl] at this
-- as `Aᶜ = ⋃ n, f n`, `ν Aᶜ > 0` implies there exists some `n` such that `ν (f n) > 0`
obtain ⟨n, hn⟩ := exists_measure_pos_of_not_measure_iUnion_null this
-- thus, choosing `f n` as the set `E` suffices
exact ⟨1 / (n + 1), by simp, f n, hf₁ n, hn, hf₂ n⟩
namespace LebesgueDecomposition
/-- Given two measures `μ` and `ν`, `measurableLE μ ν` is the set of measurable
functions `f`, such that, for all measurable sets `A`, `∫⁻ x in A, f x ∂μ ≤ ν A`.
This is useful for the Lebesgue decomposition theorem. -/
def measurableLE (μ ν : Measure α) : Set (α → ℝ≥0∞) :=
{f | Measurable f ∧ ∀ (A : Set α), MeasurableSet A → (∫⁻ x in A, f x ∂μ) ≤ ν A}
theorem zero_mem_measurableLE : (0 : α → ℝ≥0∞) ∈ measurableLE μ ν :=
⟨measurable_zero, fun A _ ↦ by simp⟩
theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
(hg : g ∈ measurableLE μ ν) : (fun a ↦ f a ⊔ g a) ∈ measurableLE μ ν := by
simp_rw [ENNReal.sup_eq_max]
refine ⟨Measurable.max hf.1 hg.1, fun A hA ↦ ?_⟩
have h₁ := hA.inter (measurableSet_le hf.1 hg.1)
have h₂ := hA.inter (measurableSet_lt hg.1 hf.1)
rw [setLIntegral_max hf.1 hg.1]
refine (add_le_add (hg.2 _ h₁) (hf.2 _ h₂)).trans_eq ?_
simp only [← not_le, ← compl_setOf, ← diff_eq]
exact measure_inter_add_diff _ (measurableSet_le hf.1 hg.1)
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
rw [le_antisymm_iff, hc, hd]
constructor
· refine iSup₂_le fun n hn ↦ ?_
rcases Nat.of_le_succ hn with (h | h)
· exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) ↦ f k a) n h)
· exact h ▸ le_sup_left
· refine sup_le ?_ (biSup_mono fun n hn ↦ hn.trans m.le_succ)
exact @le_iSup₂ ℝ≥0∞ ℕ (fun i ↦ i ≤ m + 1) _ _ (m + 1) le_rfl
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
(fun x ↦ ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
induction' n with m hm
· constructor
· simp [(hf 0).1]
· intro A hA; simp [(hf 0).2 A hA]
· have :
(fun a : α ↦ ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a) = fun a ↦
f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a :=
funext fun _ ↦ iSup_succ_eq_sup _ _ _
refine ⟨measurable_iSup fun n ↦ Measurable.iSup_Prop _ (hf n).1, fun A hA ↦ ?_⟩
rw [this]; exact (sup_mem_measurableLE (hf m.succ) hm).2 A hA
theorem iSup_mem_measurableLE' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
(⨆ (k) (_ : k ≤ n), f k) ∈ measurableLE μ ν := by
convert iSup_mem_measurableLE f hf n
simp
section SuprLemmas
--TODO: these statements should be moved elsewhere
theorem iSup_monotone {α : Type*} (f : ℕ → α → ℝ≥0∞) :
Monotone fun n x ↦ ⨆ (k) (_ : k ≤ n), f k x :=
fun _ _ hnm _ ↦ biSup_mono fun _ ↦ ge_trans hnm
theorem iSup_monotone' {α : Type*} (f : ℕ → α → ℝ≥0∞) (x : α) :
Monotone fun n ↦ ⨆ (k) (_ : k ≤ n), f k x := fun _ _ hnm ↦ iSup_monotone f hnm x
theorem iSup_le_le {α : Type*} (f : ℕ → α → ℝ≥0∞) (n k : ℕ) (hk : k ≤ n) :
f k ≤ fun x ↦ ⨆ (k) (_ : k ≤ n), f k x :=
fun x ↦ le_iSup₂ (f := fun k (_ : k ≤ n) ↦ f k x) k hk
end SuprLemmas
/-- `measurableLEEval μ ν` is the set of `∫⁻ x, f x ∂μ` for all `f ∈ measurableLE μ ν`. -/
def measurableLEEval (μ ν : Measure α) : Set ℝ≥0∞ :=
(fun f : α → ℝ≥0∞ ↦ ∫⁻ x, f x ∂μ) '' measurableLE μ ν
end LebesgueDecomposition
open LebesgueDecomposition
/-- Any pair of finite measures `μ` and `ν`, `HaveLebesgueDecomposition`. That is to say,
there exist a measure `ξ` and a measurable function `f`, such that `ξ` is mutually singular
with respect to `ν` and `μ = ξ + ν.withDensity f`.
This is not an instance since this is also shown for the more general σ-finite measures with
`MeasureTheory.Measure.haveLebesgueDecomposition_of_sigmaFinite`. -/
theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
HaveLebesgueDecomposition μ ν :=
⟨by
have h := @exists_seq_tendsto_sSup _ _ _ _ _ (measurableLEEval ν μ)
⟨0, 0, zero_mem_measurableLE, by simp⟩ (OrderTop.bddAbove _)
choose g _ hg₂ f hf₁ hf₂ using h
-- we set `ξ` to be the supremum of an increasing sequence of functions obtained from above
set ξ := ⨆ (n) (k) (_ : k ≤ n), f k with hξ
-- we see that `ξ` has the largest integral among all functions in `measurableLE`
have hξ₁ : sSup (measurableLEEval ν μ) = ∫⁻ a, ξ a ∂ν := by
have :=
@lintegral_tendsto_of_tendsto_of_monotone _ _ ν (fun n ↦ ⨆ (k) (_ : k ≤ n), f k)
(⨆ (n) (k) (_ : k ≤ n), f k) ?_ ?_ ?_
· refine tendsto_nhds_unique ?_ this
refine tendsto_of_tendsto_of_tendsto_of_le_of_le hg₂ tendsto_const_nhds ?_ ?_
· intro n; rw [← hf₂ n]
apply lintegral_mono
convert iSup_le_le f n n le_rfl
simp only [iSup_apply]
· intro n
exact le_sSup ⟨⨆ (k : ℕ) (_ : k ≤ n), f k, iSup_mem_measurableLE' _ hf₁ _, rfl⟩
· intro n
refine Measurable.aemeasurable ?_
convert (iSup_mem_measurableLE _ hf₁ n).1
simp
· refine Filter.eventually_of_forall fun a ↦ ?_
simp [iSup_monotone' f _]
· refine Filter.eventually_of_forall fun a ↦ ?_
simp [tendsto_atTop_iSup (iSup_monotone' f a)]
have hξm : Measurable ξ := by
convert measurable_iSup fun n ↦ (iSup_mem_measurableLE _ hf₁ n).1
simp [hξ]
-- `ξ` is the `f` in the theorem statement and we set `μ₁` to be `μ - ν.withDensity ξ`
-- since we need `μ₁ + ν.withDensity ξ = μ`
set μ₁ := μ - ν.withDensity ξ with hμ₁
have hle : ν.withDensity ξ ≤ μ := by
refine le_iff.2 fun B hB ↦ ?_
rw [hξ, withDensity_apply _ hB]
simp_rw [iSup_apply]
rw [lintegral_iSup (fun i ↦ (iSup_mem_measurableLE _ hf₁ i).1) (iSup_monotone _)]
exact iSup_le fun i ↦ (iSup_mem_measurableLE _ hf₁ i).2 B hB
have : IsFiniteMeasure (ν.withDensity ξ) := by
refine isFiniteMeasure_withDensity ?_
have hle' := hle univ
rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] at hle'
exact ne_top_of_le_ne_top (measure_ne_top _ _) hle'
refine ⟨⟨μ₁, ξ⟩, hξm, ?_, ?_⟩
· by_contra h
-- if they are not mutually singular, then from `exists_positive_of_not_mutuallySingular`,
-- there exists some `ε > 0` and a measurable set `E`, such that `μ(E) > 0` and `E` is
-- positive with respect to `ν - εμ`
obtain ⟨ε, hε₁, E, hE₁, hE₂, hE₃⟩ := exists_positive_of_not_mutuallySingular μ₁ ν h
simp_rw [hμ₁] at hE₃
have hξle : ∀ A, MeasurableSet A → (∫⁻ a in A, ξ a ∂ν) ≤ μ A := by
intro A hA; rw [hξ]
simp_rw [iSup_apply]
rw [lintegral_iSup (fun n ↦ (iSup_mem_measurableLE _ hf₁ n).1) (iSup_monotone _)]
exact iSup_le fun n ↦ (iSup_mem_measurableLE _ hf₁ n).2 A hA
-- since `E` is positive, we have `∫⁻ a in A ∩ E, ε + ξ a ∂ν ≤ μ (A ∩ E)` for all `A`
have hε₂ : ∀ A : Set α, MeasurableSet A → (∫⁻ a in A ∩ E, ε + ξ a ∂ν) ≤ μ (A ∩ E) := by
intro A hA
have := subset_le_of_restrict_le_restrict _ _ hE₁ hE₃ A.inter_subset_right
rwa [zero_apply, toSignedMeasure_sub_apply (hA.inter hE₁),
Measure.sub_apply (hA.inter hE₁) hle,
ENNReal.toReal_sub_of_le _ (measure_ne_top _ _), sub_nonneg, le_sub_iff_add_le,
← ENNReal.toReal_add, ENNReal.toReal_le_toReal, Measure.coe_smul, Pi.smul_apply,
withDensity_apply _ (hA.inter hE₁), show ε • ν (A ∩ E) = (ε : ℝ≥0∞) * ν (A ∩ E) by rfl,
← setLIntegral_const, ← lintegral_add_left measurable_const] at this
· rw [Ne, ENNReal.add_eq_top, not_or]
exact ⟨measure_ne_top _ _, measure_ne_top _ _⟩
· exact measure_ne_top _ _
· exact measure_ne_top _ _
· exact measure_ne_top _ _
· rw [withDensity_apply _ (hA.inter hE₁)]
exact hξle (A ∩ E) (hA.inter hE₁)
-- from this, we can show `ξ + ε * E.indicator` is a function in `measurableLE` with
-- integral greater than `ξ`
have hξε : (ξ + E.indicator fun _ ↦ (ε : ℝ≥0∞)) ∈ measurableLE ν μ := by
refine ⟨Measurable.add hξm (Measurable.indicator measurable_const hE₁), fun A hA ↦ ?_⟩
have :
(∫⁻ a in A, (ξ + E.indicator fun _ ↦ (ε : ℝ≥0∞)) a ∂ν) =
(∫⁻ a in A ∩ E, ε + ξ a ∂ν) + ∫⁻ a in A \ E, ξ a ∂ν := by
simp only [lintegral_add_left measurable_const, lintegral_add_left hξm,
setLIntegral_const, add_assoc, lintegral_inter_add_diff _ _ hE₁, Pi.add_apply,
lintegral_indicator _ hE₁, restrict_apply hE₁]
rw [inter_comm, add_comm]
rw [this, ← measure_inter_add_diff A hE₁]
exact add_le_add (hε₂ A hA) (hξle (A \ E) (hA.diff hE₁))
have : (∫⁻ a, ξ a + E.indicator (fun _ ↦ (ε : ℝ≥0∞)) a ∂ν) ≤ sSup (measurableLEEval ν μ) :=
le_sSup ⟨ξ + E.indicator fun _ ↦ (ε : ℝ≥0∞), hξε, rfl⟩
-- but this contradicts the maximality of `∫⁻ x, ξ x ∂ν`
refine not_lt.2 this ?_
rw [hξ₁, lintegral_add_left hξm, lintegral_indicator _ hE₁, setLIntegral_const]
refine ENNReal.lt_add_right ?_ (ENNReal.mul_pos_iff.2 ⟨ENNReal.coe_pos.2 hε₁, hE₂⟩).ne'
have := measure_ne_top (ν.withDensity ξ) univ
rwa [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] at this
-- since `ν.withDensity ξ ≤ μ`, it is clear that `μ = μ₁ + ν.withDensity ξ`
· rw [hμ₁]; ext1 A hA
rw [Measure.coe_add, Pi.add_apply, Measure.sub_apply hA hle, add_comm,
add_tsub_cancel_of_le (hle A)]⟩
/-- If any finite measure has a Lebesgue decomposition with respect to `ν`,
then the same is true for any s-finite measure. -/
theorem HaveLebesgueDecomposition.sfinite_of_isFiniteMeasure [SFinite μ]
(_h : ∀ (μ : Measure α) [IsFiniteMeasure μ], HaveLebesgueDecomposition μ ν) :
HaveLebesgueDecomposition μ ν :=
sum_sFiniteSeq μ ▸ sum_left _
attribute [local instance] haveLebesgueDecomposition_of_finiteMeasure
-- see Note [lower instance priority]
variable (μ ν) in
/-- **The Lebesgue decomposition theorem**:
Any s-finite measure `μ` has Lebesgue decomposition with respect to any σ-finite measure `ν`.
That is to say, there exist a measure `ξ` and a measurable function `f`,
such that `ξ` is mutually singular with respect to `ν` and `μ = ξ + ν.withDensity f` -/
nonrec instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite
[SFinite μ] [SigmaFinite ν] : HaveLebesgueDecomposition μ ν := by
wlog hμ : IsFiniteMeasure μ generalizing μ
· exact .sfinite_of_isFiniteMeasure fun μ _ ↦ this μ ‹_›
-- Take a disjoint cover that consists of sets of finite measure `ν`.
set s : ℕ → Set α := disjointed (spanningSets ν)
have hsm : ∀ n, MeasurableSet (s n) := .disjointed <| measurable_spanningSets _
have hs : ∀ n, Fact (ν (s n) < ⊤) := fun n ↦
⟨lt_of_le_of_lt (measure_mono <| disjointed_le ..) (measure_spanningSets_lt_top ν n)⟩
-- Note that the restrictions of `μ` and `ν` to `s n` are finite measures.
-- Therefore, as we proved above, these restrictions have a Lebesgue decomposition.
-- Let `ξ n` and `f n` be the singular part and the Radon-Nikodym derivative
-- of these restrictions.
set ξ : ℕ → Measure α := fun n : ℕ ↦ singularPart (.restrict μ (s n)) (.restrict ν (s n))
set f : ℕ → α → ℝ≥0∞ := fun n ↦ (s n).indicator (rnDeriv (.restrict μ (s n)) (.restrict ν (s n)))
have hfm (n : ℕ) : Measurable (f n) := by measurability
-- Each `ξ n` is supported on `s n` and is mutually singular with the restriction of `ν` to `s n`.
-- Therefore, `ξ n` is mutually singular with `ν`, hence their sum is mutually singular with `ν`.
have hξ : .sum ξ ⟂ₘ ν := by
refine MutuallySingular.sum_left.2 fun n ↦ ?_
rw [← ν.restrict_add_restrict_compl (hsm n)]
refine (mutuallySingular_singularPart ..).add_right (.singularPart ?_ _)
refine ⟨(s n)ᶜ, (hsm n).compl, ?_⟩
simp [hsm]
-- Finally, the sum of all `ξ n` and measure `ν` with the density `∑' n, f n`
-- is equal to `μ`, thus `(Measure.sum ξ, ∑' n, f n)` is a Lebesgue decomposition for `μ` and `ν`.
have hadd : .sum ξ + ν.withDensity (∑' n, f n) = μ := calc
.sum ξ + ν.withDensity (∑' n, f n) = .sum fun n ↦ ξ n + ν.withDensity (f n) := by
rw [withDensity_tsum hfm, Measure.sum_add_sum]
_ = .sum fun n ↦ .restrict μ (s n) := by
simp_rw [ξ, f, withDensity_indicator (hsm _), singularPart_add_rnDeriv]
_ = μ := sum_restrict_disjointed_spanningSets ..
exact ⟨⟨(.sum ξ, ∑' n, f n), by measurability, hξ, hadd.symm⟩⟩
section rnDeriv
/-- Radon-Nikodym derivative of the scalar multiple of a measure.
See also `rnDeriv_smul_left`, which has no hypothesis on `μ` but requires finite `ν`. -/
theorem rnDeriv_smul_left' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] (r : ℝ≥0) :
(r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ := by
rw [← withDensity_eq_iff_of_sigmaFinite]
· simp_rw [ENNReal.smul_def]
rw [withDensity_smul _ (measurable_rnDeriv _ _)]
suffices (r • ν).singularPart μ + withDensity μ (rnDeriv (r • ν) μ)
= (r • ν).singularPart μ + r • withDensity μ (rnDeriv ν μ) by
rwa [Measure.add_right_inj] at this
rw [← (r • ν).haveLebesgueDecomposition_add μ, singularPart_smul, ← smul_add,
← ν.haveLebesgueDecomposition_add μ]
· exact (measurable_rnDeriv _ _).aemeasurable
· exact (measurable_rnDeriv _ _).aemeasurable.const_smul _
/-- Radon-Nikodym derivative of the scalar multiple of a measure.
See also `rnDeriv_smul_left_of_ne_top`, which has no hypothesis on `μ` but requires finite `ν`. -/
theorem rnDeriv_smul_left_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
{r : ℝ≥0∞} (hr : r ≠ ∞) :
(r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ := by
have h : (r.toNNReal • ν).rnDeriv μ =ᵐ[μ] r.toNNReal • ν.rnDeriv μ :=
rnDeriv_smul_left' ν μ r.toNNReal
simpa [ENNReal.smul_def, ENNReal.coe_toNNReal hr] using h
/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
See also `rnDeriv_smul_right`, which has no hypothesis on `μ` but requires finite `ν`. -/
theorem rnDeriv_smul_right' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
{r : ℝ≥0} (hr : r ≠ 0) :
ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
refine (absolutelyContinuous_smul <| ENNReal.coe_ne_zero.2 hr).ae_le
(?_ : ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ)
rw [← withDensity_eq_iff_of_sigmaFinite]
· simp_rw [ENNReal.smul_def]
rw [withDensity_smul _ (measurable_rnDeriv _ _)]
suffices ν.singularPart (r • μ) + withDensity (r • μ) (rnDeriv ν (r • μ))
= ν.singularPart (r • μ) + r⁻¹ • withDensity (r • μ) (rnDeriv ν μ) by
rwa [add_right_inj] at this
rw [← ν.haveLebesgueDecomposition_add (r • μ), singularPart_smul_right _ _ _ hr,
ENNReal.smul_def r, withDensity_smul_measure, ← ENNReal.smul_def, ← smul_assoc,
smul_eq_mul, inv_mul_cancel hr, one_smul]
exact ν.haveLebesgueDecomposition_add μ
· exact (measurable_rnDeriv _ _).aemeasurable
· exact (measurable_rnDeriv _ _).aemeasurable.const_smul _
/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
See also `rnDeriv_smul_right_of_ne_top`, which has no hypothesis on `μ` but requires finite `ν`. -/
theorem rnDeriv_smul_right_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
{r : ℝ≥0∞} (hr : r ≠ 0) (hr_ne_top : r ≠ ∞) :
ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
have h : ν.rnDeriv (r.toNNReal • μ) =ᵐ[μ] r.toNNReal⁻¹ • ν.rnDeriv μ := by
refine rnDeriv_smul_right' ν μ ?_
rw [ne_eq, ENNReal.toNNReal_eq_zero_iff]
simp [hr, hr_ne_top]
rwa [ENNReal.smul_def, ENNReal.coe_toNNReal hr_ne_top,
← ENNReal.toNNReal_inv, ENNReal.smul_def, ENNReal.coe_toNNReal (ENNReal.inv_ne_top.mpr hr)] at h
/-- Radon-Nikodym derivative of a sum of two measures.
See also `rnDeriv_add`, which has no hypothesis on `μ` but requires finite `ν₁` and `ν₂`. -/
lemma rnDeriv_add' (ν₁ ν₂ μ : Measure α) [SigmaFinite ν₁] [SigmaFinite ν₂] [SigmaFinite μ] :
(ν₁ + ν₂).rnDeriv μ =ᵐ[μ] ν₁.rnDeriv μ + ν₂.rnDeriv μ := by
rw [← withDensity_eq_iff_of_sigmaFinite]
· suffices (ν₁ + ν₂).singularPart μ + μ.withDensity ((ν₁ + ν₂).rnDeriv μ)
= (ν₁ + ν₂).singularPart μ + μ.withDensity (ν₁.rnDeriv μ + ν₂.rnDeriv μ) by
rwa [add_right_inj] at this
rw [← (ν₁ + ν₂).haveLebesgueDecomposition_add μ, singularPart_add,
withDensity_add_left (measurable_rnDeriv _ _), add_assoc,
add_comm (ν₂.singularPart μ), add_assoc, add_comm _ (ν₂.singularPart μ),
← ν₂.haveLebesgueDecomposition_add μ, ← add_assoc, ← ν₁.haveLebesgueDecomposition_add μ]
· exact (measurable_rnDeriv _ _).aemeasurable
· exact ((measurable_rnDeriv _ _).add (measurable_rnDeriv _ _)).aemeasurable
lemma rnDeriv_add_of_mutuallySingular (ν₁ ν₂ μ : Measure α)
[SigmaFinite ν₁] [SigmaFinite ν₂] [SigmaFinite μ] (h : ν₂ ⟂ₘ μ) :
(ν₁ + ν₂).rnDeriv μ =ᵐ[μ] ν₁.rnDeriv μ := by
filter_upwards [rnDeriv_add' ν₁ ν₂ μ, (rnDeriv_eq_zero ν₂ μ).mpr h] with x hx_add hx_zero
simp [hx_add, hx_zero]
end rnDeriv
end Measure
end MeasureTheory
|
MeasureTheory\Decomposition\RadonNikodym.lean | /-
Copyright (c) 2021 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying, Rémy Degenne
-/
import Mathlib.MeasureTheory.Decomposition.SignedLebesgue
import Mathlib.MeasureTheory.Measure.WithDensityVectorMeasure
/-!
# Radon-Nikodym theorem
This file proves the Radon-Nikodym theorem. The Radon-Nikodym theorem states that, given measures
`μ, ν`, if `HaveLebesgueDecomposition μ ν`, then `μ` is absolutely continuous with respect to
`ν` if and only if there exists a measurable function `f : α → ℝ≥0∞` such that `μ = fν`.
In particular, we have `f = rnDeriv μ ν`.
The Radon-Nikodym theorem will allow us to define many important concepts in probability theory,
most notably probability cumulative functions. It could also be used to define the conditional
expectation of a real function, but we take a different approach (see the file
`MeasureTheory/Function/ConditionalExpectation`).
## Main results
* `MeasureTheory.Measure.absolutelyContinuous_iff_withDensity_rnDeriv_eq` :
the Radon-Nikodym theorem
* `MeasureTheory.SignedMeasure.absolutelyContinuous_iff_withDensityᵥ_rnDeriv_eq` :
the Radon-Nikodym theorem for signed measures
The file also contains properties of `rnDeriv` that use the Radon-Nikodym theorem, notably
* `MeasureTheory.Measure.rnDeriv_withDensity_left`: the Radon-Nikodym derivative of
`μ.withDensity f` with respect to `ν` is `f * μ.rnDeriv ν`.
* `MeasureTheory.Measure.rnDeriv_withDensity_right`: the Radon-Nikodym derivative of
`μ` with respect to `ν.withDensity f` is `f⁻¹ * μ.rnDeriv ν`.
* `MeasureTheory.Measure.inv_rnDeriv`: `(μ.rnDeriv ν)⁻¹ =ᵐ[μ] ν.rnDeriv μ`.
* `MeasureTheory.Measure.setLIntegral_rnDeriv`: `∫⁻ x in s, μ.rnDeriv ν x ∂ν = μ s` if `μ ≪ ν`.
There is also a version of this result for the Bochner integral.
## Tags
Radon-Nikodym theorem
-/
noncomputable section
open scoped Classical MeasureTheory NNReal ENNReal
variable {α β : Type*} {m : MeasurableSpace α}
namespace MeasureTheory
namespace Measure
theorem withDensity_rnDeriv_eq (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] (h : μ ≪ ν) :
ν.withDensity (rnDeriv μ ν) = μ := by
suffices μ.singularPart ν = 0 by
conv_rhs => rw [haveLebesgueDecomposition_add μ ν, this, zero_add]
suffices μ.singularPart ν Set.univ = 0 by simpa using this
have h_sing := mutuallySingular_singularPart μ ν
rw [← measure_add_measure_compl h_sing.measurableSet_nullSet]
simp only [MutuallySingular.measure_nullSet, zero_add]
refine le_antisymm ?_ (zero_le _)
refine (singularPart_le μ ν ?_ ).trans_eq ?_
exact h h_sing.measure_compl_nullSet
variable {μ ν : Measure α}
/-- **The Radon-Nikodym theorem**: Given two measures `μ` and `ν`, if
`HaveLebesgueDecomposition μ ν`, then `μ` is absolutely continuous to `ν` if and only if
`ν.withDensity (rnDeriv μ ν) = μ`. -/
theorem absolutelyContinuous_iff_withDensity_rnDeriv_eq
[HaveLebesgueDecomposition μ ν] : μ ≪ ν ↔ ν.withDensity (rnDeriv μ ν) = μ :=
⟨withDensity_rnDeriv_eq μ ν, fun h => h ▸ withDensity_absolutelyContinuous _ _⟩
lemma rnDeriv_pos [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν) :
∀ᵐ x ∂μ, 0 < μ.rnDeriv ν x := by
rw [← Measure.withDensity_rnDeriv_eq _ _ hμν,
ae_withDensity_iff (Measure.measurable_rnDeriv _ _), Measure.withDensity_rnDeriv_eq _ _ hμν]
exact ae_of_all _ (fun x hx ↦ lt_of_le_of_ne (zero_le _) hx.symm)
lemma rnDeriv_pos' [SigmaFinite μ] [SFinite ν] (hμν : μ ≪ ν) :
∀ᵐ x ∂μ, 0 < ν.rnDeriv μ x := by
refine (absolutelyContinuous_withDensity_rnDeriv hμν).ae_le ?_
filter_upwards [Measure.rnDeriv_pos (withDensity_absolutelyContinuous μ (ν.rnDeriv μ)),
(withDensity_absolutelyContinuous μ (ν.rnDeriv μ)).ae_le
(Measure.rnDeriv_withDensity μ (Measure.measurable_rnDeriv ν μ))] with x hx hx2
rwa [← hx2]
section rnDeriv_withDensity_leftRight
variable {μ ν : Measure α} {f : α → ℝ≥0∞}
/-- Auxiliary lemma for `rnDeriv_withDensity_left`. -/
lemma rnDeriv_withDensity_withDensity_rnDeriv_left (μ ν : Measure α) [SigmaFinite μ] [SigmaFinite ν]
(hf_ne_top : ∀ᵐ x ∂μ, f x ≠ ∞) :
((ν.withDensity (μ.rnDeriv ν)).withDensity f).rnDeriv ν =ᵐ[ν] (μ.withDensity f).rnDeriv ν := by
conv_rhs => rw [μ.haveLebesgueDecomposition_add ν, add_comm, withDensity_add_measure]
have : SigmaFinite ((μ.singularPart ν).withDensity f) :=
SigmaFinite.withDensity_of_ne_top (ae_mono (Measure.singularPart_le _ _) hf_ne_top)
have : SigmaFinite ((ν.withDensity (μ.rnDeriv ν)).withDensity f) :=
SigmaFinite.withDensity_of_ne_top (ae_mono (Measure.withDensity_rnDeriv_le _ _) hf_ne_top)
exact (rnDeriv_add_of_mutuallySingular _ _ _ (mutuallySingular_singularPart μ ν).withDensity).symm
/-- Auxiliary lemma for `rnDeriv_withDensity_right`. -/
lemma rnDeriv_withDensity_withDensity_rnDeriv_right (μ ν : Measure α) [SigmaFinite μ]
[SigmaFinite ν] (hf : AEMeasurable f ν) (hf_ne_zero : ∀ᵐ x ∂ν, f x ≠ 0)
(hf_ne_top : ∀ᵐ x ∂ν, f x ≠ ∞) :
(ν.withDensity (μ.rnDeriv ν)).rnDeriv (ν.withDensity f) =ᵐ[ν] μ.rnDeriv (ν.withDensity f) := by
conv_rhs => rw [μ.haveLebesgueDecomposition_add ν, add_comm]
have hν_ac : ν ≪ ν.withDensity f := withDensity_absolutelyContinuous' hf hf_ne_zero
refine hν_ac.ae_eq ?_
have : SigmaFinite (ν.withDensity f) := SigmaFinite.withDensity_of_ne_top hf_ne_top
refine (rnDeriv_add_of_mutuallySingular _ _ _ ?_).symm
exact ((mutuallySingular_singularPart μ ν).symm.withDensity).symm
lemma rnDeriv_withDensity_left_of_absolutelyContinuous {ν : Measure α} [SigmaFinite μ]
[SigmaFinite ν] (hμν : μ ≪ ν) (hf : AEMeasurable f ν) :
(μ.withDensity f).rnDeriv ν =ᵐ[ν] fun x ↦ f x * μ.rnDeriv ν x := by
refine (Measure.eq_rnDeriv₀ ?_ Measure.MutuallySingular.zero_left ?_).symm
· exact hf.mul (Measure.measurable_rnDeriv _ _).aemeasurable
· ext1 s hs
rw [zero_add, withDensity_apply _ hs, withDensity_apply _ hs]
conv_lhs => rw [← Measure.withDensity_rnDeriv_eq _ _ hμν]
rw [setLIntegral_withDensity_eq_setLIntegral_mul_non_measurable₀ _ _ _ hs]
· congr with x
rw [mul_comm]
simp only [Pi.mul_apply]
· refine ae_restrict_of_ae ?_
exact Measure.rnDeriv_lt_top _ _
· exact (Measure.measurable_rnDeriv _ _).aemeasurable
lemma rnDeriv_withDensity_left {μ ν : Measure α} [SigmaFinite μ] [SigmaFinite ν]
(hfν : AEMeasurable f ν) (hf_ne_top : ∀ᵐ x ∂μ, f x ≠ ∞) :
(μ.withDensity f).rnDeriv ν =ᵐ[ν] fun x ↦ f x * μ.rnDeriv ν x := by
let μ' := ν.withDensity (μ.rnDeriv ν)
have hμ'ν : μ' ≪ ν := withDensity_absolutelyContinuous _ _
have h := rnDeriv_withDensity_left_of_absolutelyContinuous hμ'ν hfν
have h1 : μ'.rnDeriv ν =ᵐ[ν] μ.rnDeriv ν :=
Measure.rnDeriv_withDensity _ (Measure.measurable_rnDeriv _ _)
have h2 : (μ'.withDensity f).rnDeriv ν =ᵐ[ν] (μ.withDensity f).rnDeriv ν := by
exact rnDeriv_withDensity_withDensity_rnDeriv_left μ ν hf_ne_top
filter_upwards [h, h1, h2] with x hx hx1 hx2
rw [← hx2, hx, hx1]
/-- Auxiliary lemma for `rnDeriv_withDensity_right`. -/
lemma rnDeriv_withDensity_right_of_absolutelyContinuous {ν : Measure α} [SigmaFinite μ]
[SigmaFinite ν] (hμν : μ ≪ ν) (hf : AEMeasurable f ν)
(hf_ne_zero : ∀ᵐ x ∂ν, f x ≠ 0) (hf_ne_top : ∀ᵐ x ∂ν, f x ≠ ∞) :
μ.rnDeriv (ν.withDensity f) =ᵐ[ν] fun x ↦ (f x)⁻¹ * μ.rnDeriv ν x := by
have : SigmaFinite (ν.withDensity f) := SigmaFinite.withDensity_of_ne_top hf_ne_top
refine (withDensity_absolutelyContinuous' hf hf_ne_zero).ae_eq ?_
refine (Measure.eq_rnDeriv₀ (ν := ν.withDensity f) ?_ Measure.MutuallySingular.zero_left ?_).symm
· exact (hf.inv.mono_ac (withDensity_absolutelyContinuous _ _)).mul
(Measure.measurable_rnDeriv _ _).aemeasurable
· ext1 s hs
conv_lhs => rw [← Measure.withDensity_rnDeriv_eq _ _ hμν]
rw [zero_add, withDensity_apply _ hs, withDensity_apply _ hs]
rw [setLIntegral_withDensity_eq_setLIntegral_mul_non_measurable₀ _ _ _ hs]
· simp only [Pi.mul_apply]
have : (fun a ↦ f a * ((f a)⁻¹ * μ.rnDeriv ν a)) =ᵐ[ν] μ.rnDeriv ν := by
filter_upwards [hf_ne_zero, hf_ne_top] with x hx1 hx2
simp [← mul_assoc, ENNReal.mul_inv_cancel, hx1, hx2]
rw [lintegral_congr_ae (ae_restrict_of_ae this)]
· refine ae_restrict_of_ae ?_
filter_upwards [hf_ne_top] with x hx using hx.lt_top
· exact hf.restrict
lemma rnDeriv_withDensity_right (μ ν : Measure α) [SigmaFinite μ] [SigmaFinite ν]
(hf : AEMeasurable f ν) (hf_ne_zero : ∀ᵐ x ∂ν, f x ≠ 0) (hf_ne_top : ∀ᵐ x ∂ν, f x ≠ ∞) :
μ.rnDeriv (ν.withDensity f) =ᵐ[ν] fun x ↦ (f x)⁻¹ * μ.rnDeriv ν x := by
let μ' := ν.withDensity (μ.rnDeriv ν)
have h₁ : μ'.rnDeriv (ν.withDensity f) =ᵐ[ν] μ.rnDeriv (ν.withDensity f) :=
rnDeriv_withDensity_withDensity_rnDeriv_right μ ν hf hf_ne_zero hf_ne_top
have h₂ : μ.rnDeriv ν =ᵐ[ν] μ'.rnDeriv ν :=
(Measure.rnDeriv_withDensity _ (Measure.measurable_rnDeriv _ _)).symm
have : SigmaFinite μ' := SigmaFinite.withDensity_of_ne_top (Measure.rnDeriv_ne_top _ _)
have hμ' := rnDeriv_withDensity_right_of_absolutelyContinuous
(withDensity_absolutelyContinuous ν (μ.rnDeriv ν)) hf hf_ne_zero hf_ne_top
filter_upwards [h₁, h₂, hμ'] with x hx₁ hx₂ hx_eq
rw [← hx₁, hx₂, hx_eq]
end rnDeriv_withDensity_leftRight
lemma rnDeriv_eq_zero_of_mutuallySingular [SigmaFinite μ] {ν' : Measure α}
[SigmaFinite ν'] (h : μ ⟂ₘ ν) (hνν' : ν ≪ ν') :
μ.rnDeriv ν' =ᵐ[ν] 0 := by
let t := h.nullSet
have ht : MeasurableSet t := h.measurableSet_nullSet
refine ae_of_ae_restrict_of_ae_restrict_compl t ?_ (by simp [t])
change μ.rnDeriv ν' =ᵐ[ν.restrict t] 0
have : μ.rnDeriv ν' =ᵐ[ν.restrict t] (μ.restrict t).rnDeriv ν' := by
have h : (μ.restrict t).rnDeriv ν' =ᵐ[ν] t.indicator (μ.rnDeriv ν') :=
hνν'.ae_le (rnDeriv_restrict μ ν' ht)
rw [Filter.EventuallyEq, ae_restrict_iff' ht]
filter_upwards [h] with x hx hxt
rw [hx, Set.indicator_of_mem hxt]
refine this.trans ?_
simp only [t, MutuallySingular.restrict_nullSet]
suffices (0 : Measure α).rnDeriv ν' =ᵐ[ν'] 0 by
have h_ac' : ν.restrict t ≪ ν' := restrict_le_self.absolutelyContinuous.trans hνν'
exact h_ac'.ae_le this
exact rnDeriv_zero _
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular {ν' : Measure α}
[SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
(hμν : μ ≪ ν) (hνν' : ν ⟂ₘ ν') :
μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
let t := hνν'.nullSet
have ht : MeasurableSet t := hνν'.measurableSet_nullSet
refine ae_of_ae_restrict_of_ae_restrict_compl t (by simp [t]) ?_
change μ.rnDeriv (ν + ν') =ᵐ[ν.restrict tᶜ] μ.rnDeriv ν
rw [← withDensity_eq_iff_of_sigmaFinite (μ := ν.restrict tᶜ)
(Measure.measurable_rnDeriv _ _).aemeasurable (Measure.measurable_rnDeriv _ _).aemeasurable]
have : (ν.restrict tᶜ).withDensity (μ.rnDeriv (ν + ν'))
= ((ν + ν').restrict tᶜ).withDensity (μ.rnDeriv (ν + ν')) := by simp [t]
rw [this, ← restrict_withDensity ht.compl, ← restrict_withDensity ht.compl,
Measure.withDensity_rnDeriv_eq _ _ (hμν.add_right ν'), Measure.withDensity_rnDeriv_eq _ _ hμν]
/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
[SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
(hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
rw [haveLebesgueDecomposition_add μ ν]
have h₁ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) (ν + ν')
have h₂ := rnDeriv_add' (μ.singularPart ν) (ν.withDensity (μ.rnDeriv ν)) ν
refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
have h₃ := rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular
(withDensity_absolutelyContinuous ν (μ.rnDeriv ν)) hνν'
have h₄ : (μ.singularPart ν).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
refine h_ac.ae_eq ?_
simp only [rnDeriv_eq_zero, MutuallySingular.add_right_iff]
exact ⟨mutuallySingular_singularPart μ ν, hμν'.singularPart ν⟩
have h₅ : (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := rnDeriv_singularPart μ ν
filter_upwards [h₃, h₄, h₅] with x hx₃ hx₄ hx₅
simp only [Pi.add_apply]
rw [hx₃, hx₄, hx₅]
lemma rnDeriv_add_right_of_mutuallySingular {ν' : Measure α}
[SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν'] (hνν' : ν ⟂ₘ ν') :
μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν := by
have h_ac : ν ≪ ν + ν' := Measure.AbsolutelyContinuous.rfl.add_right _
rw [haveLebesgueDecomposition_add μ ν']
have h₁ := rnDeriv_add' (μ.singularPart ν') (ν'.withDensity (μ.rnDeriv ν')) (ν + ν')
have h₂ := rnDeriv_add' (μ.singularPart ν') (ν'.withDensity (μ.rnDeriv ν')) ν
refine (Filter.EventuallyEq.trans (h_ac.ae_le h₁) ?_).trans h₂.symm
have h₃ := rnDeriv_add_right_of_mutuallySingular' (?_ : μ.singularPart ν' ⟂ₘ ν') hνν'
· have h₄ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv (ν + ν') =ᵐ[ν] 0 := by
refine rnDeriv_eq_zero_of_mutuallySingular ?_ h_ac
exact hνν'.symm.withDensity
have h₅ : (ν'.withDensity (rnDeriv μ ν')).rnDeriv ν =ᵐ[ν] 0 := by
rw [rnDeriv_eq_zero]
exact hνν'.symm.withDensity
filter_upwards [h₃, h₄, h₅] with x hx₃ hx₄ hx₅
rw [Pi.add_apply, Pi.add_apply, hx₃, hx₄, hx₅]
exact mutuallySingular_singularPart μ ν'
lemma rnDeriv_withDensity_rnDeriv [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν) :
μ.rnDeriv (μ.withDensity (ν.rnDeriv μ)) =ᵐ[μ] μ.rnDeriv ν := by
conv_rhs => rw [ν.haveLebesgueDecomposition_add μ, add_comm]
refine (absolutelyContinuous_withDensity_rnDeriv hμν).ae_eq ?_
exact (rnDeriv_add_right_of_mutuallySingular
(Measure.mutuallySingular_singularPart ν μ).symm.withDensity).symm
/-- Auxiliary lemma for `inv_rnDeriv`. -/
lemma inv_rnDeriv_aux [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν) (hνμ : ν ≪ μ) :
(μ.rnDeriv ν)⁻¹ =ᵐ[μ] ν.rnDeriv μ := by
suffices μ.withDensity (μ.rnDeriv ν)⁻¹ = μ.withDensity (ν.rnDeriv μ) by
calc (μ.rnDeriv ν)⁻¹ =ᵐ[μ] (μ.withDensity (μ.rnDeriv ν)⁻¹).rnDeriv μ :=
(rnDeriv_withDensity _ (measurable_rnDeriv _ _).inv).symm
_ = (μ.withDensity (ν.rnDeriv μ)).rnDeriv μ := by rw [this]
_ =ᵐ[μ] ν.rnDeriv μ := rnDeriv_withDensity _ (measurable_rnDeriv _ _)
rw [withDensity_rnDeriv_eq _ _ hνμ, ← withDensity_rnDeriv_eq _ _ hμν]
conv in ((ν.withDensity (μ.rnDeriv ν)).rnDeriv ν)⁻¹ => rw [withDensity_rnDeriv_eq _ _ hμν]
change (ν.withDensity (μ.rnDeriv ν)).withDensity (fun x ↦ (μ.rnDeriv ν x)⁻¹) = ν
rw [withDensity_inv_same (measurable_rnDeriv _ _)
(by filter_upwards [hνμ.ae_le (rnDeriv_pos hμν)] with x hx using hx.ne')
(rnDeriv_ne_top _ _)]
lemma inv_rnDeriv [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν) :
(μ.rnDeriv ν)⁻¹ =ᵐ[μ] ν.rnDeriv μ := by
suffices (μ.rnDeriv ν)⁻¹ =ᵐ[μ] (μ.rnDeriv (μ.withDensity (ν.rnDeriv μ)))⁻¹
∧ ν.rnDeriv μ =ᵐ[μ] (μ.withDensity (ν.rnDeriv μ)).rnDeriv μ by
refine (this.1.trans (Filter.EventuallyEq.trans ?_ this.2.symm))
exact Measure.inv_rnDeriv_aux (absolutelyContinuous_withDensity_rnDeriv hμν)
(withDensity_absolutelyContinuous _ _)
constructor
· filter_upwards [rnDeriv_withDensity_rnDeriv hμν] with x hx
simp only [Pi.inv_apply, inv_inj]
exact hx.symm
· exact (Measure.rnDeriv_withDensity μ (Measure.measurable_rnDeriv ν μ)).symm
lemma inv_rnDeriv' [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν) :
(ν.rnDeriv μ)⁻¹ =ᵐ[μ] μ.rnDeriv ν := by
filter_upwards [inv_rnDeriv hμν] with x hx; simp only [Pi.inv_apply, ← hx, inv_inv]
section integral
lemma setLIntegral_rnDeriv_le (s : Set α) :
∫⁻ x in s, μ.rnDeriv ν x ∂ν ≤ μ s :=
(withDensity_apply_le _ _).trans (Measure.le_iff'.1 (withDensity_rnDeriv_le μ ν) s)
@[deprecated (since := "2024-06-29")]
alias set_lintegral_rnDeriv_le := setLIntegral_rnDeriv_le
lemma setLIntegral_rnDeriv' [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν) {s : Set α}
(hs : MeasurableSet s) :
∫⁻ x in s, μ.rnDeriv ν x ∂ν = μ s := by
rw [← withDensity_apply _ hs, Measure.withDensity_rnDeriv_eq _ _ hμν]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_rnDeriv' := setLIntegral_rnDeriv'
lemma setLIntegral_rnDeriv [HaveLebesgueDecomposition μ ν] [SFinite ν]
(hμν : μ ≪ ν) (s : Set α) :
∫⁻ x in s, μ.rnDeriv ν x ∂ν = μ s := by
rw [← withDensity_apply' _ s, Measure.withDensity_rnDeriv_eq _ _ hμν]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_rnDeriv := setLIntegral_rnDeriv
lemma lintegral_rnDeriv [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν) :
∫⁻ x, μ.rnDeriv ν x ∂ν = μ Set.univ := by
rw [← setLIntegral_univ, setLIntegral_rnDeriv' hμν MeasurableSet.univ]
lemma integrableOn_toReal_rnDeriv {s : Set α} (hμs : μ s ≠ ∞) :
IntegrableOn (fun x ↦ (μ.rnDeriv ν x).toReal) s ν := by
refine integrable_toReal_of_lintegral_ne_top (Measure.measurable_rnDeriv _ _).aemeasurable ?_
exact ((setLIntegral_rnDeriv_le _).trans_lt hμs.lt_top).ne
lemma setIntegral_toReal_rnDeriv_eq_withDensity' [SigmaFinite μ]
{s : Set α} (hs : MeasurableSet s) :
∫ x in s, (μ.rnDeriv ν x).toReal ∂ν = (ν.withDensity (μ.rnDeriv ν) s).toReal := by
rw [integral_toReal (Measure.measurable_rnDeriv _ _).aemeasurable]
· rw [ENNReal.toReal_eq_toReal_iff, ← withDensity_apply _ hs]
simp
· exact ae_restrict_of_ae (Measure.rnDeriv_lt_top _ _)
@[deprecated (since := "2024-04-17")]
alias set_integral_toReal_rnDeriv_eq_withDensity' := setIntegral_toReal_rnDeriv_eq_withDensity'
lemma setIntegral_toReal_rnDeriv_eq_withDensity [SigmaFinite μ] [SFinite ν] (s : Set α) :
∫ x in s, (μ.rnDeriv ν x).toReal ∂ν = (ν.withDensity (μ.rnDeriv ν) s).toReal := by
rw [integral_toReal (Measure.measurable_rnDeriv _ _).aemeasurable]
· rw [ENNReal.toReal_eq_toReal_iff, ← withDensity_apply' _ s]
simp
· exact ae_restrict_of_ae (Measure.rnDeriv_lt_top _ _)
@[deprecated (since := "2024-04-17")]
alias set_integral_toReal_rnDeriv_eq_withDensity := setIntegral_toReal_rnDeriv_eq_withDensity
lemma setIntegral_toReal_rnDeriv_le [SigmaFinite μ] {s : Set α} (hμs : μ s ≠ ∞) :
∫ x in s, (μ.rnDeriv ν x).toReal ∂ν ≤ (μ s).toReal := by
set t := toMeasurable μ s with ht
have ht_m : MeasurableSet t := measurableSet_toMeasurable μ s
have hμt : μ t ≠ ∞ := by rwa [ht, measure_toMeasurable s]
calc ∫ x in s, (μ.rnDeriv ν x).toReal ∂ν
≤ ∫ x in t, (μ.rnDeriv ν x).toReal ∂ν := by
refine setIntegral_mono_set ?_ ?_ (HasSubset.Subset.eventuallyLE (subset_toMeasurable _ _))
· exact integrableOn_toReal_rnDeriv hμt
· exact ae_of_all _ (by simp)
_ = (withDensity ν (rnDeriv μ ν) t).toReal := setIntegral_toReal_rnDeriv_eq_withDensity' ht_m
_ ≤ (μ t).toReal := by
gcongr
· exact hμt
· apply withDensity_rnDeriv_le
_ = (μ s).toReal := by rw [measure_toMeasurable s]
@[deprecated (since := "2024-04-17")]
alias set_integral_toReal_rnDeriv_le := setIntegral_toReal_rnDeriv_le
lemma setIntegral_toReal_rnDeriv' [SigmaFinite μ] [HaveLebesgueDecomposition μ ν]
(hμν : μ ≪ ν) {s : Set α} (hs : MeasurableSet s) :
∫ x in s, (μ.rnDeriv ν x).toReal ∂ν = (μ s).toReal := by
rw [setIntegral_toReal_rnDeriv_eq_withDensity' hs, Measure.withDensity_rnDeriv_eq _ _ hμν]
@[deprecated (since := "2024-04-17")]
alias set_integral_toReal_rnDeriv' := setIntegral_toReal_rnDeriv'
lemma setIntegral_toReal_rnDeriv [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν) (s : Set α) :
∫ x in s, (μ.rnDeriv ν x).toReal ∂ν = (μ s).toReal := by
rw [setIntegral_toReal_rnDeriv_eq_withDensity s, Measure.withDensity_rnDeriv_eq _ _ hμν]
@[deprecated (since := "2024-04-17")]
alias set_integral_toReal_rnDeriv := setIntegral_toReal_rnDeriv
lemma integral_toReal_rnDeriv [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν) :
∫ x, (μ.rnDeriv ν x).toReal ∂ν = (μ Set.univ).toReal := by
rw [← integral_univ, setIntegral_toReal_rnDeriv hμν Set.univ]
end integral
lemma rnDeriv_mul_rnDeriv {κ : Measure α} [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite κ]
(hμν : μ ≪ ν) :
μ.rnDeriv ν * ν.rnDeriv κ =ᵐ[κ] μ.rnDeriv κ := by
refine (rnDeriv_withDensity_left ?_ ?_).symm.trans ?_
· exact (Measure.measurable_rnDeriv _ _).aemeasurable
· exact rnDeriv_ne_top _ _
· rw [Measure.withDensity_rnDeriv_eq _ _ hμν]
lemma rnDeriv_le_one_of_le (hμν : μ ≤ ν) [SigmaFinite ν] : μ.rnDeriv ν ≤ᵐ[ν] 1 := by
refine ae_le_of_forall_setLIntegral_le_of_sigmaFinite (μ.measurable_rnDeriv ν) fun s _ _ ↦ ?_
simp only [Pi.one_apply, MeasureTheory.setLIntegral_one]
exact (Measure.setLIntegral_rnDeriv_le s).trans (hμν s)
section MeasurableEmbedding
variable {mβ : MeasurableSpace β} {f : α → β}
lemma _root_.MeasurableEmbedding.rnDeriv_map_aux (hf : MeasurableEmbedding f)
(hμν : μ ≪ ν) [SigmaFinite μ] [SigmaFinite ν] :
(fun x ↦ (μ.map f).rnDeriv (ν.map f) (f x)) =ᵐ[ν] μ.rnDeriv ν := by
refine ae_eq_of_forall_setLIntegral_eq_of_sigmaFinite ?_ ?_ (fun s _ _ ↦ ?_)
· exact (Measure.measurable_rnDeriv _ _).comp hf.measurable
· exact Measure.measurable_rnDeriv _ _
rw [← hf.lintegral_map, Measure.setLIntegral_rnDeriv hμν]
have hs_eq : s = f ⁻¹' (f '' s) := by rw [hf.injective.preimage_image]
have : SigmaFinite (ν.map f) := hf.sigmaFinite_map
rw [hs_eq, ← hf.restrict_map, Measure.setLIntegral_rnDeriv (hf.absolutelyContinuous_map hμν),
hf.map_apply]
lemma _root_.MeasurableEmbedding.rnDeriv_map (hf : MeasurableEmbedding f)
(μ ν : Measure α) [SigmaFinite μ] [SigmaFinite ν] :
(fun x ↦ (μ.map f).rnDeriv (ν.map f) (f x)) =ᵐ[ν] μ.rnDeriv ν := by
rw [μ.haveLebesgueDecomposition_add ν, Measure.map_add _ _ hf.measurable]
have : SigmaFinite (map f ν) := hf.sigmaFinite_map
have : SigmaFinite (map f (μ.singularPart ν)) := hf.sigmaFinite_map
have : SigmaFinite (map f (ν.withDensity (μ.rnDeriv ν))) := hf.sigmaFinite_map
have h_add := Measure.rnDeriv_add' ((μ.singularPart ν).map f)
((ν.withDensity (μ.rnDeriv ν)).map f) (ν.map f)
rw [Filter.EventuallyEq, hf.ae_map_iff, ← Filter.EventuallyEq] at h_add
refine h_add.trans ((Measure.rnDeriv_add' _ _ _).trans ?_).symm
refine Filter.EventuallyEq.add ?_ ?_
· refine (Measure.rnDeriv_singularPart μ ν).trans ?_
symm
suffices (fun x ↦ ((μ.singularPart ν).map f).rnDeriv (ν.map f) x) =ᵐ[ν.map f] 0 by
rw [Filter.EventuallyEq, hf.ae_map_iff] at this
exact this
refine Measure.rnDeriv_eq_zero_of_mutuallySingular ?_ Measure.AbsolutelyContinuous.rfl
exact hf.mutuallySingular_map (μ.mutuallySingular_singularPart ν)
· exact (hf.rnDeriv_map_aux (withDensity_absolutelyContinuous _ _)).symm
lemma _root_.MeasurableEmbedding.map_withDensity_rnDeriv (hf : MeasurableEmbedding f)
(μ ν : Measure α) [SigmaFinite μ] [SigmaFinite ν] :
(ν.withDensity (μ.rnDeriv ν)).map f = (ν.map f).withDensity ((μ.map f).rnDeriv (ν.map f)) := by
ext s hs
rw [hf.map_apply, withDensity_apply _ (hf.measurable hs), withDensity_apply _ hs,
setLIntegral_map hs (Measure.measurable_rnDeriv _ _) hf.measurable]
refine setLIntegral_congr_fun (hf.measurable hs) ?_
filter_upwards [hf.rnDeriv_map μ ν] with a ha _ using ha.symm
lemma _root_.MeasurableEmbedding.singularPart_map (hf : MeasurableEmbedding f)
(μ ν : Measure α) [SigmaFinite μ] [SigmaFinite ν] :
(μ.map f).singularPart (ν.map f) = (μ.singularPart ν).map f := by
have h_add : μ.map f = (μ.singularPart ν).map f
+ (ν.map f).withDensity ((μ.map f).rnDeriv (ν.map f)) := by
conv_lhs => rw [μ.haveLebesgueDecomposition_add ν]
rw [Measure.map_add _ _ hf.measurable, ← hf.map_withDensity_rnDeriv μ ν]
refine (Measure.eq_singularPart (Measure.measurable_rnDeriv _ _) ?_ h_add).symm
exact hf.mutuallySingular_map (μ.mutuallySingular_singularPart ν)
end MeasurableEmbedding
end Measure
namespace SignedMeasure
open Measure VectorMeasure
theorem withDensityᵥ_rnDeriv_eq (s : SignedMeasure α) (μ : Measure α) [SigmaFinite μ]
(h : s ≪ᵥ μ.toENNRealVectorMeasure) : μ.withDensityᵥ (s.rnDeriv μ) = s := by
rw [absolutelyContinuous_ennreal_iff, (_ : μ.toENNRealVectorMeasure.ennrealToMeasure = μ),
totalVariation_absolutelyContinuous_iff] at h
· ext1 i hi
rw [withDensityᵥ_apply (integrable_rnDeriv _ _) hi, rnDeriv_def, integral_sub,
setIntegral_toReal_rnDeriv h.1 i, setIntegral_toReal_rnDeriv h.2 i]
· conv_rhs => rw [← s.toSignedMeasure_toJordanDecomposition]
erw [VectorMeasure.sub_apply]
rw [toSignedMeasure_apply_measurable hi, toSignedMeasure_apply_measurable hi]
all_goals
rw [← integrableOn_univ]
refine IntegrableOn.restrict ?_ MeasurableSet.univ
refine ⟨?_, hasFiniteIntegral_toReal_of_lintegral_ne_top ?_⟩
· apply Measurable.aestronglyMeasurable (by fun_prop)
· rw [setLIntegral_univ]
exact (lintegral_rnDeriv_lt_top _ _).ne
· exact equivMeasure.right_inv μ
/-- The Radon-Nikodym theorem for signed measures. -/
theorem absolutelyContinuous_iff_withDensityᵥ_rnDeriv_eq (s : SignedMeasure α) (μ : Measure α)
[SigmaFinite μ] : s ≪ᵥ μ.toENNRealVectorMeasure ↔ μ.withDensityᵥ (s.rnDeriv μ) = s :=
⟨withDensityᵥ_rnDeriv_eq s μ, fun h => h ▸ withDensityᵥ_absolutelyContinuous _ _⟩
end SignedMeasure
section IntegralRNDerivMul
open Measure
variable {α : Type*} {m : MeasurableSpace α} {μ ν : Measure α}
theorem lintegral_rnDeriv_mul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν) {f : α → ℝ≥0∞}
(hf : AEMeasurable f ν) : ∫⁻ x, μ.rnDeriv ν x * f x ∂ν = ∫⁻ x, f x ∂μ := by
nth_rw 2 [← withDensity_rnDeriv_eq μ ν hμν]
rw [lintegral_withDensity_eq_lintegral_mul₀ (measurable_rnDeriv μ ν).aemeasurable hf]
rfl
lemma setLIntegral_rnDeriv_mul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν) {f : α → ℝ≥0∞}
(hf : AEMeasurable f ν) {s : Set α} (hs : MeasurableSet s) :
∫⁻ x in s, μ.rnDeriv ν x * f x ∂ν = ∫⁻ x in s, f x ∂μ := by
nth_rw 2 [← Measure.withDensity_rnDeriv_eq μ ν hμν]
rw [setLIntegral_withDensity_eq_lintegral_mul₀ (measurable_rnDeriv μ ν).aemeasurable hf hs]
simp only [Pi.mul_apply]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_rnDeriv_mul := setLIntegral_rnDeriv_mul
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
theorem integrable_rnDeriv_smul_iff [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν)
[SigmaFinite μ] {f : α → E} :
Integrable (fun x ↦ (μ.rnDeriv ν x).toReal • f x) ν ↔ Integrable f μ := by
nth_rw 2 [← withDensity_rnDeriv_eq μ ν hμν]
rw [← integrable_withDensity_iff_integrable_smul' (E := E)
(measurable_rnDeriv μ ν) (rnDeriv_lt_top μ ν)]
theorem withDensityᵥ_rnDeriv_smul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν)
[SigmaFinite μ] {f : α → E} (hf : Integrable f μ) :
ν.withDensityᵥ (fun x ↦ (rnDeriv μ ν x).toReal • f x) = μ.withDensityᵥ f := by
rw [withDensityᵥ_smul_eq_withDensityᵥ_withDensity' (measurable_rnDeriv μ ν).aemeasurable
(rnDeriv_lt_top μ ν) ((integrable_rnDeriv_smul_iff hμν).mpr hf), withDensity_rnDeriv_eq μ ν hμν]
theorem integral_rnDeriv_smul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν)
[SigmaFinite μ] {f : α → E} :
∫ x, (μ.rnDeriv ν x).toReal • f x ∂ν = ∫ x, f x ∂μ := by
by_cases hf : Integrable f μ
· rw [← integral_univ, ← withDensityᵥ_apply ((integrable_rnDeriv_smul_iff hμν).mpr hf) .univ,
← integral_univ, ← withDensityᵥ_apply hf .univ, withDensityᵥ_rnDeriv_smul hμν hf]
· rw [integral_undef hf, integral_undef]
contrapose! hf
exact (integrable_rnDeriv_smul_iff hμν).mp hf
end IntegralRNDerivMul
end MeasureTheory
|
MeasureTheory\Decomposition\SignedHahn.lean | /-
Copyright (c) 2021 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying
-/
import Mathlib.MeasureTheory.Measure.VectorMeasure
import Mathlib.Order.SymmDiff
/-!
# Hahn decomposition
This file proves the Hahn decomposition theorem (signed version). The Hahn decomposition theorem
states that, given a signed measure `s`, there exist complementary, measurable sets `i` and `j`,
such that `i` is positive and `j` is negative with respect to `s`; that is, `s` restricted on `i`
is non-negative and `s` restricted on `j` is non-positive.
The Hahn decomposition theorem leads to many other results in measure theory, most notably,
the Jordan decomposition theorem, the Lebesgue decomposition theorem and the Radon-Nikodym theorem.
## Main results
* `MeasureTheory.SignedMeasure.exists_isCompl_positive_negative` : the Hahn decomposition
theorem.
* `MeasureTheory.SignedMeasure.exists_subset_restrict_nonpos` : A measurable set of negative
measure contains a negative subset.
## Notation
We use the notations `0 ≤[i] s` and `s ≤[i] 0` to denote the usual definitions of a set `i`
being positive/negative with respect to the signed measure `s`.
## Tags
Hahn decomposition theorem
-/
noncomputable section
open scoped Classical NNReal ENNReal MeasureTheory
variable {α β : Type*} [MeasurableSpace α]
variable {M : Type*} [AddCommMonoid M] [TopologicalSpace M] [OrderedAddCommMonoid M]
namespace MeasureTheory
namespace SignedMeasure
open Filter VectorMeasure
variable {s : SignedMeasure α} {i j : Set α}
section ExistsSubsetRestrictNonpos
/-! ### exists_subset_restrict_nonpos
In this section we will prove that a set `i` whose measure is negative contains a negative subset
`j` with respect to the signed measure `s` (i.e. `s ≤[j] 0`), whose measure is negative. This lemma
is used to prove the Hahn decomposition theorem.
To prove this lemma, we will construct a sequence of measurable sets $(A_n)_{n \in \mathbb{N}}$,
such that, for all $n$, $s(A_{n + 1})$ is close to maximal among subsets of
$i \setminus \bigcup_{k \le n} A_k$.
This sequence of sets does not necessarily exist. However, if this sequence terminates; that is,
there does not exists any sets satisfying the property, the last $A_n$ will be a negative subset
of negative measure, hence proving our claim.
In the case that the sequence does not terminate, it is easy to see that
$i \setminus \bigcup_{k = 0}^\infty A_k$ is the required negative set.
To implement this in Lean, we define several auxiliary definitions.
- given the sets `i` and the natural number `n`, `ExistsOneDivLT s i n` is the property that
there exists a measurable set `k ⊆ i` such that `1 / (n + 1) < s k`.
- given the sets `i` and that `i` is not negative, `findExistsOneDivLT s i` is the
least natural number `n` such that `ExistsOneDivLT s i n`.
- given the sets `i` and that `i` is not negative, `someExistsOneDivLT` chooses the set
`k` from `ExistsOneDivLT s i (findExistsOneDivLT s i)`.
- lastly, given the set `i`, `restrictNonposSeq s i` is the sequence of sets defined inductively
where
`restrictNonposSeq s i 0 = someExistsOneDivLT s (i \ ∅)` and
`restrictNonposSeq s i (n + 1) = someExistsOneDivLT s (i \ ⋃ k ≤ n, restrictNonposSeq k)`.
This definition represents the sequence $(A_n)$ in the proof as described above.
With these definitions, we are able consider the case where the sequence terminates separately,
allowing us to prove `exists_subset_restrict_nonpos`.
-/
/-- Given the set `i` and the natural number `n`, `ExistsOneDivLT s i j` is the property that
there exists a measurable set `k ⊆ i` such that `1 / (n + 1) < s k`. -/
private def ExistsOneDivLT (s : SignedMeasure α) (i : Set α) (n : ℕ) : Prop :=
∃ k : Set α, k ⊆ i ∧ MeasurableSet k ∧ (1 / (n + 1) : ℝ) < s k
private theorem existsNatOneDivLTMeasure_of_not_negative (hi : ¬s ≤[i] 0) :
∃ n : ℕ, ExistsOneDivLT s i n :=
let ⟨k, hj₁, hj₂, hj⟩ := exists_pos_measure_of_not_restrict_le_zero s hi
let ⟨n, hn⟩ := exists_nat_one_div_lt hj
⟨n, k, hj₂, hj₁, hn⟩
/-- Given the set `i`, if `i` is not negative, `findExistsOneDivLT s i` is the
least natural number `n` such that `ExistsOneDivLT s i n`, otherwise, it returns 0. -/
private def findExistsOneDivLT (s : SignedMeasure α) (i : Set α) : ℕ :=
if hi : ¬s ≤[i] 0 then Nat.find (existsNatOneDivLTMeasure_of_not_negative hi) else 0
private theorem findExistsOneDivLT_spec (hi : ¬s ≤[i] 0) :
ExistsOneDivLT s i (findExistsOneDivLT s i) := by
rw [findExistsOneDivLT, dif_pos hi]
convert Nat.find_spec (existsNatOneDivLTMeasure_of_not_negative hi)
private theorem findExistsOneDivLT_min (hi : ¬s ≤[i] 0) {m : ℕ}
(hm : m < findExistsOneDivLT s i) : ¬ExistsOneDivLT s i m := by
rw [findExistsOneDivLT, dif_pos hi] at hm
exact Nat.find_min _ hm
/-- Given the set `i`, if `i` is not negative, `someExistsOneDivLT` chooses the set
`k` from `ExistsOneDivLT s i (findExistsOneDivLT s i)`, otherwise, it returns the
empty set. -/
private def someExistsOneDivLT (s : SignedMeasure α) (i : Set α) : Set α :=
if hi : ¬s ≤[i] 0 then Classical.choose (findExistsOneDivLT_spec hi) else ∅
private theorem someExistsOneDivLT_spec (hi : ¬s ≤[i] 0) :
someExistsOneDivLT s i ⊆ i ∧
MeasurableSet (someExistsOneDivLT s i) ∧
(1 / (findExistsOneDivLT s i + 1) : ℝ) < s (someExistsOneDivLT s i) := by
rw [someExistsOneDivLT, dif_pos hi]
exact Classical.choose_spec (findExistsOneDivLT_spec hi)
private theorem someExistsOneDivLT_subset : someExistsOneDivLT s i ⊆ i := by
by_cases hi : ¬s ≤[i] 0
· exact
let ⟨h, _⟩ := someExistsOneDivLT_spec hi
h
· rw [someExistsOneDivLT, dif_neg hi]
exact Set.empty_subset _
private theorem someExistsOneDivLT_subset' : someExistsOneDivLT s (i \ j) ⊆ i :=
someExistsOneDivLT_subset.trans Set.diff_subset
private theorem someExistsOneDivLT_measurableSet : MeasurableSet (someExistsOneDivLT s i) := by
by_cases hi : ¬s ≤[i] 0
· exact
let ⟨_, h, _⟩ := someExistsOneDivLT_spec hi
h
· rw [someExistsOneDivLT, dif_neg hi]
exact MeasurableSet.empty
private theorem someExistsOneDivLT_lt (hi : ¬s ≤[i] 0) :
(1 / (findExistsOneDivLT s i + 1) : ℝ) < s (someExistsOneDivLT s i) :=
let ⟨_, _, h⟩ := someExistsOneDivLT_spec hi
h
/-- Given the set `i`, `restrictNonposSeq s i` is the sequence of sets defined inductively where
`restrictNonposSeq s i 0 = someExistsOneDivLT s (i \ ∅)` and
`restrictNonposSeq s i (n + 1) = someExistsOneDivLT s (i \ ⋃ k ≤ n, restrictNonposSeq k)`.
For each `n : ℕ`,`s (restrictNonposSeq s i n)` is close to maximal among all subsets of
`i \ ⋃ k ≤ n, restrictNonposSeq s i k`. -/
private def restrictNonposSeq (s : SignedMeasure α) (i : Set α) : ℕ → Set α
| 0 => someExistsOneDivLT s (i \ ∅) -- I used `i \ ∅` instead of `i` to simplify some proofs
| n + 1 =>
someExistsOneDivLT s
(i \
⋃ (k) (H : k ≤ n),
have : k < n + 1 := Nat.lt_succ_iff.mpr H
restrictNonposSeq s i k)
private theorem restrictNonposSeq_succ (n : ℕ) :
restrictNonposSeq s i n.succ = someExistsOneDivLT s (i \ ⋃ k ≤ n, restrictNonposSeq s i k) := by
rw [restrictNonposSeq]
private theorem restrictNonposSeq_subset (n : ℕ) : restrictNonposSeq s i n ⊆ i := by
cases n <;> · rw [restrictNonposSeq]; exact someExistsOneDivLT_subset'
private theorem restrictNonposSeq_lt (n : ℕ) (hn : ¬s ≤[i \ ⋃ k ≤ n, restrictNonposSeq s i k] 0) :
(1 / (findExistsOneDivLT s (i \ ⋃ k ≤ n, restrictNonposSeq s i k) + 1) : ℝ) <
s (restrictNonposSeq s i n.succ) := by
rw [restrictNonposSeq_succ]
apply someExistsOneDivLT_lt hn
private theorem measure_of_restrictNonposSeq (hi₂ : ¬s ≤[i] 0) (n : ℕ)
(hn : ¬s ≤[i \ ⋃ k < n, restrictNonposSeq s i k] 0) : 0 < s (restrictNonposSeq s i n) := by
cases n with
| zero =>
rw [restrictNonposSeq]; rw [← @Set.diff_empty _ i] at hi₂
rcases someExistsOneDivLT_spec hi₂ with ⟨_, _, h⟩
exact lt_trans Nat.one_div_pos_of_nat h
| succ n =>
rw [restrictNonposSeq_succ]
have h₁ : ¬s ≤[i \ ⋃ (k : ℕ) (_ : k ≤ n), restrictNonposSeq s i k] 0 := by
refine mt (restrict_le_zero_subset _ ?_ (by simp [Nat.lt_succ_iff])) hn
convert measurable_of_not_restrict_le_zero _ hn using 3
exact funext fun x => by rw [Nat.lt_succ_iff]
rcases someExistsOneDivLT_spec h₁ with ⟨_, _, h⟩
exact lt_trans Nat.one_div_pos_of_nat h
private theorem restrictNonposSeq_measurableSet (n : ℕ) :
MeasurableSet (restrictNonposSeq s i n) := by
cases n <;>
· rw [restrictNonposSeq]
exact someExistsOneDivLT_measurableSet
private theorem restrictNonposSeq_disjoint' {n m : ℕ} (h : n < m) :
restrictNonposSeq s i n ∩ restrictNonposSeq s i m = ∅ := by
rw [Set.eq_empty_iff_forall_not_mem]
rintro x ⟨hx₁, hx₂⟩
cases m; · omega
· rw [restrictNonposSeq] at hx₂
exact
(someExistsOneDivLT_subset hx₂).2
(Set.mem_iUnion.2 ⟨n, Set.mem_iUnion.2 ⟨Nat.lt_succ_iff.mp h, hx₁⟩⟩)
private theorem restrictNonposSeq_disjoint : Pairwise (Disjoint on restrictNonposSeq s i) := by
intro n m h
rw [Function.onFun, Set.disjoint_iff_inter_eq_empty]
rcases lt_or_gt_of_ne h with (h | h)
· rw [restrictNonposSeq_disjoint' h]
· rw [Set.inter_comm, restrictNonposSeq_disjoint' h]
private theorem exists_subset_restrict_nonpos' (hi₁ : MeasurableSet i) (hi₂ : s i < 0)
(hn : ¬∀ n : ℕ, ¬s ≤[i \ ⋃ l < n, restrictNonposSeq s i l] 0) :
∃ j : Set α, MeasurableSet j ∧ j ⊆ i ∧ s ≤[j] 0 ∧ s j < 0 := by
by_cases h : s ≤[i] 0
· exact ⟨i, hi₁, Set.Subset.refl _, h, hi₂⟩
push_neg at hn
set k := Nat.find hn
have hk₂ : s ≤[i \ ⋃ l < k, restrictNonposSeq s i l] 0 := Nat.find_spec hn
have hmeas : MeasurableSet (⋃ (l : ℕ) (_ : l < k), restrictNonposSeq s i l) :=
MeasurableSet.iUnion fun _ => MeasurableSet.iUnion fun _ => restrictNonposSeq_measurableSet _
refine ⟨i \ ⋃ l < k, restrictNonposSeq s i l, hi₁.diff hmeas, Set.diff_subset, hk₂, ?_⟩
rw [of_diff hmeas hi₁, s.of_disjoint_iUnion_nat]
· have h₁ : ∀ l < k, 0 ≤ s (restrictNonposSeq s i l) := by
intro l hl
refine le_of_lt (measure_of_restrictNonposSeq h _ ?_)
refine mt (restrict_le_zero_subset _ (hi₁.diff ?_) (Set.Subset.refl _)) (Nat.find_min hn hl)
exact
MeasurableSet.iUnion fun _ =>
MeasurableSet.iUnion fun _ => restrictNonposSeq_measurableSet _
suffices 0 ≤ ∑' l : ℕ, s (⋃ _ : l < k, restrictNonposSeq s i l) by
rw [sub_neg]
exact lt_of_lt_of_le hi₂ this
refine tsum_nonneg ?_
intro l; by_cases h : l < k
· convert h₁ _ h
ext x
rw [Set.mem_iUnion, exists_prop, and_iff_right_iff_imp]
exact fun _ => h
· convert le_of_eq s.empty.symm
ext; simp only [exists_prop, Set.mem_empty_iff_false, Set.mem_iUnion, not_and, iff_false_iff]
exact fun h' => False.elim (h h')
· intro; exact MeasurableSet.iUnion fun _ => restrictNonposSeq_measurableSet _
· intro a b hab
refine Set.disjoint_iUnion_left.mpr fun _ => ?_
refine Set.disjoint_iUnion_right.mpr fun _ => ?_
exact restrictNonposSeq_disjoint hab
· apply Set.iUnion_subset
intro a x
simp only [and_imp, exists_prop, Set.mem_iUnion]
intro _ hx
exact restrictNonposSeq_subset _ hx
/-- A measurable set of negative measure has a negative subset of negative measure. -/
theorem exists_subset_restrict_nonpos (hi : s i < 0) :
∃ j : Set α, MeasurableSet j ∧ j ⊆ i ∧ s ≤[j] 0 ∧ s j < 0 := by
have hi₁ : MeasurableSet i := by_contradiction fun h => ne_of_lt hi <| s.not_measurable h
by_cases h : s ≤[i] 0; · exact ⟨i, hi₁, Set.Subset.refl _, h, hi⟩
by_cases hn : ∀ n : ℕ, ¬s ≤[i \ ⋃ l < n, restrictNonposSeq s i l] 0
swap; · exact exists_subset_restrict_nonpos' hi₁ hi hn
set A := i \ ⋃ l, restrictNonposSeq s i l with hA
set bdd : ℕ → ℕ := fun n => findExistsOneDivLT s (i \ ⋃ k ≤ n, restrictNonposSeq s i k)
have hn' : ∀ n : ℕ, ¬s ≤[i \ ⋃ l ≤ n, restrictNonposSeq s i l] 0 := by
intro n
convert hn (n + 1) using 5 <;>
· ext l
simp only [exists_prop, Set.mem_iUnion, and_congr_left_iff]
exact fun _ => Nat.lt_succ_iff.symm
have h₁ : s i = s A + ∑' l, s (restrictNonposSeq s i l) := by
rw [hA, ← s.of_disjoint_iUnion_nat, add_comm, of_add_of_diff]
· exact MeasurableSet.iUnion fun _ => restrictNonposSeq_measurableSet _
exacts [hi₁, Set.iUnion_subset fun _ => restrictNonposSeq_subset _, fun _ =>
restrictNonposSeq_measurableSet _, restrictNonposSeq_disjoint]
have h₂ : s A ≤ s i := by
rw [h₁]
apply le_add_of_nonneg_right
exact tsum_nonneg fun n => le_of_lt (measure_of_restrictNonposSeq h _ (hn n))
have h₃' : Summable fun n => (1 / (bdd n + 1) : ℝ) := by
have : Summable fun l => s (restrictNonposSeq s i l) :=
HasSum.summable
(s.m_iUnion (fun _ => restrictNonposSeq_measurableSet _) restrictNonposSeq_disjoint)
refine .of_nonneg_of_le (fun n => ?_) (fun n => ?_)
(this.comp_injective Nat.succ_injective)
· exact le_of_lt Nat.one_div_pos_of_nat
· exact le_of_lt (restrictNonposSeq_lt n (hn' n))
have h₃ : Tendsto (fun n => (bdd n : ℝ) + 1) atTop atTop := by
simp only [one_div] at h₃'
exact Summable.tendsto_atTop_of_pos h₃' fun n => Nat.cast_add_one_pos (bdd n)
have h₄ : Tendsto (fun n => (bdd n : ℝ)) atTop atTop := by
convert atTop.tendsto_atTop_add_const_right (-1) h₃; simp
have A_meas : MeasurableSet A :=
hi₁.diff (MeasurableSet.iUnion fun _ => restrictNonposSeq_measurableSet _)
refine ⟨A, A_meas, Set.diff_subset, ?_, h₂.trans_lt hi⟩
by_contra hnn
rw [restrict_le_restrict_iff _ _ A_meas] at hnn; push_neg at hnn
obtain ⟨E, hE₁, hE₂, hE₃⟩ := hnn
have : ∃ k, 1 ≤ bdd k ∧ 1 / (bdd k : ℝ) < s E := by
rw [tendsto_atTop_atTop] at h₄
obtain ⟨k, hk⟩ := h₄ (max (1 / s E + 1) 1)
refine ⟨k, ?_, ?_⟩
· have hle := le_of_max_le_right (hk k le_rfl)
norm_cast at hle
· have : 1 / s E < bdd k := by
linarith only [le_of_max_le_left (hk k le_rfl)]
rw [one_div] at this ⊢
rwa [inv_lt (lt_trans (inv_pos.2 hE₃) this) hE₃]
obtain ⟨k, hk₁, hk₂⟩ := this
have hA' : A ⊆ i \ ⋃ l ≤ k, restrictNonposSeq s i l := by
apply Set.diff_subset_diff_right
intro x; simp only [Set.mem_iUnion]
rintro ⟨n, _, hn₂⟩
exact ⟨n, hn₂⟩
refine
findExistsOneDivLT_min (hn' k) (Nat.sub_lt hk₁ Nat.zero_lt_one)
⟨E, Set.Subset.trans hE₂ hA', hE₁, ?_⟩
convert hk₂; norm_cast
exact tsub_add_cancel_of_le hk₁
end ExistsSubsetRestrictNonpos
/-- The set of measures of the set of measurable negative sets. -/
def measureOfNegatives (s : SignedMeasure α) : Set ℝ :=
s '' { B | MeasurableSet B ∧ s ≤[B] 0 }
theorem zero_mem_measureOfNegatives : (0 : ℝ) ∈ s.measureOfNegatives :=
⟨∅, ⟨MeasurableSet.empty, le_restrict_empty _ _⟩, s.empty⟩
theorem bddBelow_measureOfNegatives : BddBelow s.measureOfNegatives := by
simp_rw [BddBelow, Set.Nonempty, mem_lowerBounds]
by_contra! h
have h' : ∀ n : ℕ, ∃ y : ℝ, y ∈ s.measureOfNegatives ∧ y < -n := fun n => h (-n)
choose f hf using h'
have hf' : ∀ n : ℕ, ∃ B, MeasurableSet B ∧ s ≤[B] 0 ∧ s B < -n := by
intro n
rcases hf n with ⟨⟨B, ⟨hB₁, hBr⟩, hB₂⟩, hlt⟩
exact ⟨B, hB₁, hBr, hB₂.symm ▸ hlt⟩
choose B hmeas hr h_lt using hf'
set A := ⋃ n, B n with hA
have hfalse : ∀ n : ℕ, s A ≤ -n := by
intro n
refine le_trans ?_ (le_of_lt (h_lt _))
rw [hA, ← Set.diff_union_of_subset (Set.subset_iUnion _ n),
of_union Set.disjoint_sdiff_left _ (hmeas n)]
· refine add_le_of_nonpos_left ?_
have : s ≤[A] 0 := restrict_le_restrict_iUnion _ _ hmeas hr
refine nonpos_of_restrict_le_zero _ (restrict_le_zero_subset _ ?_ Set.diff_subset this)
exact MeasurableSet.iUnion hmeas
· exact (MeasurableSet.iUnion hmeas).diff (hmeas n)
rcases exists_nat_gt (-s A) with ⟨n, hn⟩
exact lt_irrefl _ ((neg_lt.1 hn).trans_le (hfalse n))
/-- Alternative formulation of `MeasureTheory.SignedMeasure.exists_isCompl_positive_negative`
(the Hahn decomposition theorem) using set complements. -/
theorem exists_compl_positive_negative (s : SignedMeasure α) :
∃ i : Set α, MeasurableSet i ∧ 0 ≤[i] s ∧ s ≤[iᶜ] 0 := by
obtain ⟨f, _, hf₂, hf₁⟩ :=
exists_seq_tendsto_sInf ⟨0, @zero_mem_measureOfNegatives _ _ s⟩ bddBelow_measureOfNegatives
choose B hB using hf₁
have hB₁ : ∀ n, MeasurableSet (B n) := fun n => (hB n).1.1
have hB₂ : ∀ n, s ≤[B n] 0 := fun n => (hB n).1.2
set A := ⋃ n, B n with hA
have hA₁ : MeasurableSet A := MeasurableSet.iUnion hB₁
have hA₂ : s ≤[A] 0 := restrict_le_restrict_iUnion _ _ hB₁ hB₂
have hA₃ : s A = sInf s.measureOfNegatives := by
apply le_antisymm
· refine le_of_tendsto_of_tendsto tendsto_const_nhds hf₂ (eventually_of_forall fun n => ?_)
rw [← (hB n).2, hA, ← Set.diff_union_of_subset (Set.subset_iUnion _ n),
of_union Set.disjoint_sdiff_left _ (hB₁ n)]
· refine add_le_of_nonpos_left ?_
have : s ≤[A] 0 :=
restrict_le_restrict_iUnion _ _ hB₁ fun m =>
let ⟨_, h⟩ := (hB m).1
h
refine
nonpos_of_restrict_le_zero _ (restrict_le_zero_subset _ ?_ Set.diff_subset this)
exact MeasurableSet.iUnion hB₁
· exact (MeasurableSet.iUnion hB₁).diff (hB₁ n)
· exact csInf_le bddBelow_measureOfNegatives ⟨A, ⟨hA₁, hA₂⟩, rfl⟩
refine ⟨Aᶜ, hA₁.compl, ?_, (compl_compl A).symm ▸ hA₂⟩
rw [restrict_le_restrict_iff _ _ hA₁.compl]
intro C _ hC₁
by_contra! hC₂
rcases exists_subset_restrict_nonpos hC₂ with ⟨D, hD₁, hD, hD₂, hD₃⟩
have : s (A ∪ D) < sInf s.measureOfNegatives := by
rw [← hA₃,
of_union (Set.disjoint_of_subset_right (Set.Subset.trans hD hC₁) disjoint_compl_right) hA₁
hD₁]
linarith
refine not_le.2 this ?_
refine csInf_le bddBelow_measureOfNegatives ⟨A ∪ D, ⟨?_, ?_⟩, rfl⟩
· exact hA₁.union hD₁
· exact restrict_le_restrict_union _ _ hA₁ hA₂ hD₁ hD₂
/-- **The Hahn decomposition theorem**: Given a signed measure `s`, there exist
complement measurable sets `i` and `j` such that `i` is positive, `j` is negative. -/
theorem exists_isCompl_positive_negative (s : SignedMeasure α) :
∃ i j : Set α, MeasurableSet i ∧ 0 ≤[i] s ∧ MeasurableSet j ∧ s ≤[j] 0 ∧ IsCompl i j :=
let ⟨i, hi₁, hi₂, hi₃⟩ := exists_compl_positive_negative s
⟨i, iᶜ, hi₁, hi₂, hi₁.compl, hi₃, isCompl_compl⟩
open scoped symmDiff in
/-- The symmetric difference of two Hahn decompositions has measure zero. -/
theorem of_symmDiff_compl_positive_negative {s : SignedMeasure α} {i j : Set α}
(hi : MeasurableSet i) (hj : MeasurableSet j) (hi' : 0 ≤[i] s ∧ s ≤[iᶜ] 0)
(hj' : 0 ≤[j] s ∧ s ≤[jᶜ] 0) : s (i ∆ j) = 0 ∧ s (iᶜ ∆ jᶜ) = 0 := by
rw [restrict_le_restrict_iff s 0, restrict_le_restrict_iff 0 s] at hi' hj'
constructor
· rw [Set.symmDiff_def, Set.diff_eq_compl_inter, Set.diff_eq_compl_inter, of_union,
le_antisymm (hi'.2 (hi.compl.inter hj) Set.inter_subset_left)
(hj'.1 (hi.compl.inter hj) Set.inter_subset_right),
le_antisymm (hj'.2 (hj.compl.inter hi) Set.inter_subset_left)
(hi'.1 (hj.compl.inter hi) Set.inter_subset_right),
zero_apply, zero_apply, zero_add]
· exact
Set.disjoint_of_subset_left Set.inter_subset_left
(Set.disjoint_of_subset_right Set.inter_subset_right
(disjoint_comm.1 (IsCompl.disjoint isCompl_compl)))
· exact hj.compl.inter hi
· exact hi.compl.inter hj
· rw [Set.symmDiff_def, Set.diff_eq_compl_inter, Set.diff_eq_compl_inter, compl_compl,
compl_compl, of_union,
le_antisymm (hi'.2 (hj.inter hi.compl) Set.inter_subset_right)
(hj'.1 (hj.inter hi.compl) Set.inter_subset_left),
le_antisymm (hj'.2 (hi.inter hj.compl) Set.inter_subset_right)
(hi'.1 (hi.inter hj.compl) Set.inter_subset_left),
zero_apply, zero_apply, zero_add]
· exact
Set.disjoint_of_subset_left Set.inter_subset_left
(Set.disjoint_of_subset_right Set.inter_subset_right
(IsCompl.disjoint isCompl_compl))
· exact hj.inter hi.compl
· exact hi.inter hj.compl
all_goals measurability
end SignedMeasure
end MeasureTheory
|
MeasureTheory\Decomposition\SignedLebesgue.lean | /-
Copyright (c) 2021 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying
-/
import Mathlib.MeasureTheory.Decomposition.Lebesgue
import Mathlib.MeasureTheory.Measure.Complex
import Mathlib.MeasureTheory.Decomposition.Jordan
import Mathlib.MeasureTheory.Measure.WithDensityVectorMeasure
/-!
# Lebesgue decomposition
This file proves the Lebesgue decomposition theorem for signed measures. The Lebesgue decomposition
theorem states that, given two σ-finite measures `μ` and `ν`, there exists a σ-finite measure `ξ`
and a measurable function `f` such that `μ = ξ + fν` and `ξ` is mutually singular with respect
to `ν`.
## Main definitions
* `MeasureTheory.SignedMeasure.HaveLebesgueDecomposition` : A signed measure `s` and a
measure `μ` is said to `HaveLebesgueDecomposition` if both the positive part and negative
part of `s` `HaveLebesgueDecomposition` with respect to `μ`.
* `MeasureTheory.SignedMeasure.singularPart` : The singular part between a signed measure `s`
and a measure `μ` is simply the singular part of the positive part of `s` with respect to `μ`
minus the singular part of the negative part of `s` with respect to `μ`.
* `MeasureTheory.SignedMeasure.rnDeriv` : The Radon-Nikodym derivative of a signed
measure `s` with respect to a measure `μ` is the Radon-Nikodym derivative of the positive part of
`s` with respect to `μ` minus the Radon-Nikodym derivative of the negative part of `s` with
respect to `μ`.
## Main results
* `MeasureTheory.SignedMeasure.singularPart_add_withDensity_rnDeriv_eq` :
the Lebesgue decomposition theorem between a signed measure and a σ-finite positive measure.
## Tags
Lebesgue decomposition theorem
-/
noncomputable section
open scoped Classical MeasureTheory NNReal ENNReal
open Set
variable {α β : Type*} {m : MeasurableSpace α} {μ ν : MeasureTheory.Measure α}
namespace MeasureTheory
namespace SignedMeasure
open Measure
/-- A signed measure `s` is said to `HaveLebesgueDecomposition` with respect to a measure `μ`
if the positive part and the negative part of `s` both `HaveLebesgueDecomposition` with
respect to `μ`. -/
class HaveLebesgueDecomposition (s : SignedMeasure α) (μ : Measure α) : Prop where
posPart : s.toJordanDecomposition.posPart.HaveLebesgueDecomposition μ
negPart : s.toJordanDecomposition.negPart.HaveLebesgueDecomposition μ
attribute [instance] HaveLebesgueDecomposition.posPart
attribute [instance] HaveLebesgueDecomposition.negPart
theorem not_haveLebesgueDecomposition_iff (s : SignedMeasure α) (μ : Measure α) :
¬s.HaveLebesgueDecomposition μ ↔
¬s.toJordanDecomposition.posPart.HaveLebesgueDecomposition μ ∨
¬s.toJordanDecomposition.negPart.HaveLebesgueDecomposition μ :=
⟨fun h => not_or_of_imp fun hp hn => h ⟨hp, hn⟩, fun h hl => (not_and_or.2 h) ⟨hl.1, hl.2⟩⟩
-- `inferInstance` directly does not work
-- see Note [lower instance priority]
instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (s : SignedMeasure α)
(μ : Measure α) [SigmaFinite μ] : s.HaveLebesgueDecomposition μ where
posPart := inferInstance
negPart := inferInstance
instance haveLebesgueDecomposition_neg (s : SignedMeasure α) (μ : Measure α)
[s.HaveLebesgueDecomposition μ] : (-s).HaveLebesgueDecomposition μ where
posPart := by
rw [toJordanDecomposition_neg, JordanDecomposition.neg_posPart]
infer_instance
negPart := by
rw [toJordanDecomposition_neg, JordanDecomposition.neg_negPart]
infer_instance
instance haveLebesgueDecomposition_smul (s : SignedMeasure α) (μ : Measure α)
[s.HaveLebesgueDecomposition μ] (r : ℝ≥0) : (r • s).HaveLebesgueDecomposition μ where
posPart := by
rw [toJordanDecomposition_smul, JordanDecomposition.smul_posPart]
infer_instance
negPart := by
rw [toJordanDecomposition_smul, JordanDecomposition.smul_negPart]
infer_instance
instance haveLebesgueDecomposition_smul_real (s : SignedMeasure α) (μ : Measure α)
[s.HaveLebesgueDecomposition μ] (r : ℝ) : (r • s).HaveLebesgueDecomposition μ := by
by_cases hr : 0 ≤ r
· lift r to ℝ≥0 using hr
exact s.haveLebesgueDecomposition_smul μ _
· rw [not_le] at hr
refine
{ posPart := by
rw [toJordanDecomposition_smul_real, JordanDecomposition.real_smul_posPart_neg _ _ hr]
infer_instance
negPart := by
rw [toJordanDecomposition_smul_real, JordanDecomposition.real_smul_negPart_neg _ _ hr]
infer_instance }
/-- Given a signed measure `s` and a measure `μ`, `s.singularPart μ` is the signed measure
such that `s.singularPart μ + μ.withDensityᵥ (s.rnDeriv μ) = s` and
`s.singularPart μ` is mutually singular with respect to `μ`. -/
def singularPart (s : SignedMeasure α) (μ : Measure α) : SignedMeasure α :=
(s.toJordanDecomposition.posPart.singularPart μ).toSignedMeasure -
(s.toJordanDecomposition.negPart.singularPart μ).toSignedMeasure
section
theorem singularPart_mutuallySingular (s : SignedMeasure α) (μ : Measure α) :
s.toJordanDecomposition.posPart.singularPart μ ⟂ₘ
s.toJordanDecomposition.negPart.singularPart μ := by
by_cases hl : s.HaveLebesgueDecomposition μ
· obtain ⟨i, hi, hpos, hneg⟩ := s.toJordanDecomposition.mutuallySingular
rw [s.toJordanDecomposition.posPart.haveLebesgueDecomposition_add μ] at hpos
rw [s.toJordanDecomposition.negPart.haveLebesgueDecomposition_add μ] at hneg
rw [add_apply, add_eq_zero_iff] at hpos hneg
exact ⟨i, hi, hpos.1, hneg.1⟩
· rw [not_haveLebesgueDecomposition_iff] at hl
cases' hl with hp hn
· rw [Measure.singularPart, dif_neg hp]
exact MutuallySingular.zero_left
· rw [Measure.singularPart, Measure.singularPart, dif_neg hn]
exact MutuallySingular.zero_right
theorem singularPart_totalVariation (s : SignedMeasure α) (μ : Measure α) :
(s.singularPart μ).totalVariation =
s.toJordanDecomposition.posPart.singularPart μ +
s.toJordanDecomposition.negPart.singularPart μ := by
have :
(s.singularPart μ).toJordanDecomposition =
⟨s.toJordanDecomposition.posPart.singularPart μ,
s.toJordanDecomposition.negPart.singularPart μ, singularPart_mutuallySingular s μ⟩ := by
refine JordanDecomposition.toSignedMeasure_injective ?_
rw [toSignedMeasure_toJordanDecomposition, singularPart, JordanDecomposition.toSignedMeasure]
rw [totalVariation, this]
nonrec theorem mutuallySingular_singularPart (s : SignedMeasure α) (μ : Measure α) :
singularPart s μ ⟂ᵥ μ.toENNRealVectorMeasure := by
rw [mutuallySingular_ennreal_iff, singularPart_totalVariation,
VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure]
exact (mutuallySingular_singularPart _ _).add_left (mutuallySingular_singularPart _ _)
end
/-- The Radon-Nikodym derivative between a signed measure and a positive measure.
`rnDeriv s μ` satisfies `μ.withDensityᵥ (s.rnDeriv μ) = s`
if and only if `s` is absolutely continuous with respect to `μ` and this fact is known as
`MeasureTheory.SignedMeasure.absolutelyContinuous_iff_withDensity_rnDeriv_eq`
and can be found in `MeasureTheory.Decomposition.RadonNikodym`. -/
def rnDeriv (s : SignedMeasure α) (μ : Measure α) : α → ℝ := fun x =>
(s.toJordanDecomposition.posPart.rnDeriv μ x).toReal -
(s.toJordanDecomposition.negPart.rnDeriv μ x).toReal
-- The generated equation theorem is the form of `rnDeriv s μ x = ...`.
theorem rnDeriv_def (s : SignedMeasure α) (μ : Measure α) : rnDeriv s μ = fun x =>
(s.toJordanDecomposition.posPart.rnDeriv μ x).toReal -
(s.toJordanDecomposition.negPart.rnDeriv μ x).toReal :=
rfl
variable {s t : SignedMeasure α}
@[measurability]
theorem measurable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Measurable (rnDeriv s μ) := by
rw [rnDeriv_def]
fun_prop
theorem integrable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Integrable (rnDeriv s μ) μ := by
refine Integrable.sub ?_ ?_ <;>
· constructor
· apply Measurable.aestronglyMeasurable
fun_prop
exact hasFiniteIntegral_toReal_of_lintegral_ne_top (lintegral_rnDeriv_lt_top _ μ).ne
variable (s μ)
/-- **The Lebesgue Decomposition theorem between a signed measure and a measure**:
Given a signed measure `s` and a σ-finite measure `μ`, there exist a signed measure `t` and a
measurable and integrable function `f`, such that `t` is mutually singular with respect to `μ`
and `s = t + μ.withDensityᵥ f`. In this case `t = s.singularPart μ` and
`f = s.rnDeriv μ`. -/
theorem singularPart_add_withDensity_rnDeriv_eq [s.HaveLebesgueDecomposition μ] :
s.singularPart μ + μ.withDensityᵥ (s.rnDeriv μ) = s := by
conv_rhs =>
rw [← toSignedMeasure_toJordanDecomposition s, JordanDecomposition.toSignedMeasure]
rw [singularPart, rnDeriv_def,
withDensityᵥ_sub' (integrable_toReal_of_lintegral_ne_top _ _)
(integrable_toReal_of_lintegral_ne_top _ _),
withDensityᵥ_toReal, withDensityᵥ_toReal, sub_eq_add_neg, sub_eq_add_neg,
add_comm (s.toJordanDecomposition.posPart.singularPart μ).toSignedMeasure, ← add_assoc,
add_assoc (-(s.toJordanDecomposition.negPart.singularPart μ).toSignedMeasure),
← toSignedMeasure_add, add_comm, ← add_assoc, ← neg_add, ← toSignedMeasure_add, add_comm,
← sub_eq_add_neg]
· convert rfl
-- `convert rfl` much faster than `congr`
· exact s.toJordanDecomposition.posPart.haveLebesgueDecomposition_add μ
· rw [add_comm]
exact s.toJordanDecomposition.negPart.haveLebesgueDecomposition_add μ
all_goals
first
| exact (lintegral_rnDeriv_lt_top _ _).ne
| measurability
variable {s μ}
theorem jordanDecomposition_add_withDensity_mutuallySingular {f : α → ℝ} (hf : Measurable f)
(htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) :
(t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
t.toJordanDecomposition.negPart + μ.withDensity fun x : α => ENNReal.ofReal (-f x) := by
rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
exact
((JordanDecomposition.mutuallySingular _).add_right
(htμ.1.mono_ac (refl _) (withDensity_absolutelyContinuous _ _))).add_left
((htμ.2.symm.mono_ac (withDensity_absolutelyContinuous _ _) (refl _)).add_right
(withDensity_ofReal_mutuallySingular hf))
theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Measurable f)
(hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
s.toJordanDecomposition =
@JordanDecomposition.mk α _
(t.toJordanDecomposition.posPart + μ.withDensity fun x => ENNReal.ofReal (f x))
(t.toJordanDecomposition.negPart + μ.withDensity fun x => ENNReal.ofReal (-f x))
(by haveI := isFiniteMeasure_withDensity_ofReal hfi.2; infer_instance)
(by haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2; infer_instance)
(jordanDecomposition_add_withDensity_mutuallySingular hf htμ) := by
haveI := isFiniteMeasure_withDensity_ofReal hfi.2
haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2
refine toJordanDecomposition_eq ?_
simp_rw [JordanDecomposition.toSignedMeasure, hadd]
ext i hi
rw [VectorMeasure.sub_apply, toSignedMeasure_apply_measurable hi,
toSignedMeasure_apply_measurable hi, add_apply, add_apply, ENNReal.toReal_add,
ENNReal.toReal_add, add_sub_add_comm, ← toSignedMeasure_apply_measurable hi,
← toSignedMeasure_apply_measurable hi, ← VectorMeasure.sub_apply,
← JordanDecomposition.toSignedMeasure, toSignedMeasure_toJordanDecomposition,
VectorMeasure.add_apply, ← toSignedMeasure_apply_measurable hi,
← toSignedMeasure_apply_measurable hi,
withDensityᵥ_eq_withDensity_pos_part_sub_withDensity_neg_part hfi,
VectorMeasure.sub_apply] <;>
exact (measure_lt_top _ _).ne
private theorem haveLebesgueDecomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
(hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
s.HaveLebesgueDecomposition μ := by
have htμ' := htμ
rw [mutuallySingular_ennreal_iff] at htμ
change _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
rw [VectorMeasure.equivMeasure.right_inv, totalVariation_mutuallySingular_iff] at htμ
refine
{ posPart := by
use ⟨t.toJordanDecomposition.posPart, fun x => ENNReal.ofReal (f x)⟩
refine ⟨hf.ennreal_ofReal, htμ.1, ?_⟩
rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
negPart := by
use ⟨t.toJordanDecomposition.negPart, fun x => ENNReal.ofReal (-f x)⟩
refine ⟨hf.neg.ennreal_ofReal, htμ.2, ?_⟩
rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd] }
theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
(htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
s.HaveLebesgueDecomposition μ := by
by_cases hfi : Integrable f μ
· exact haveLebesgueDecomposition_mk' μ hf hfi htμ hadd
· rw [withDensityᵥ, dif_neg hfi, add_zero] at hadd
refine haveLebesgueDecomposition_mk' μ measurable_zero (integrable_zero _ _ μ) htμ ?_
rwa [withDensityᵥ_zero, add_zero]
private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
(hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
t = s.singularPart μ := by
have htμ' := htμ
rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff,
VectorMeasure.ennrealToMeasure_toENNRealVectorMeasure] at htμ
rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
JordanDecomposition.toSignedMeasure]
congr
-- NB: `measurability` proves this `have`, but is slow.
-- TODO: make `fun_prop` able to handle this
· have hfpos : Measurable fun x => ENNReal.ofReal (f x) := hf.real_toNNReal.coe_nnreal_ennreal
refine eq_singularPart hfpos htμ.1 ?_
rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
· have hfneg : Measurable fun x => ENNReal.ofReal (-f x) :=
-- NB: `measurability` proves this, but is slow.
-- XXX: `fun_prop` doesn't work here yet
(measurable_neg_iff.mpr hf).real_toNNReal.coe_nnreal_ennreal
refine eq_singularPart hfneg htμ.2 ?_
rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
/-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
mutually singular with respect to `μ` and `s = t + μ.withDensityᵥ f`, we have
`t = singularPart s μ`, i.e. `t` is the singular part of the Lebesgue decomposition between
`s` and `μ`. -/
theorem eq_singularPart (t : SignedMeasure α) (f : α → ℝ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure)
(hadd : s = t + μ.withDensityᵥ f) : t = s.singularPart μ := by
by_cases hfi : Integrable f μ
· refine eq_singularPart' t hfi.1.measurable_mk (hfi.congr hfi.1.ae_eq_mk) htμ ?_
convert hadd using 2
exact WithDensityᵥEq.congr_ae hfi.1.ae_eq_mk.symm
· rw [withDensityᵥ, dif_neg hfi, add_zero] at hadd
refine eq_singularPart' t measurable_zero (integrable_zero _ _ μ) htμ ?_
rwa [withDensityᵥ_zero, add_zero]
theorem singularPart_zero (μ : Measure α) : (0 : SignedMeasure α).singularPart μ = 0 := by
refine (eq_singularPart 0 0 VectorMeasure.MutuallySingular.zero_left ?_).symm
rw [zero_add, withDensityᵥ_zero]
theorem singularPart_neg (s : SignedMeasure α) (μ : Measure α) :
(-s).singularPart μ = -s.singularPart μ := by
have h₁ :
((-s).toJordanDecomposition.posPart.singularPart μ).toSignedMeasure =
(s.toJordanDecomposition.negPart.singularPart μ).toSignedMeasure := by
refine toSignedMeasure_congr ?_
rw [toJordanDecomposition_neg, JordanDecomposition.neg_posPart]
have h₂ :
((-s).toJordanDecomposition.negPart.singularPart μ).toSignedMeasure =
(s.toJordanDecomposition.posPart.singularPart μ).toSignedMeasure := by
refine toSignedMeasure_congr ?_
rw [toJordanDecomposition_neg, JordanDecomposition.neg_negPart]
rw [singularPart, singularPart, neg_sub, h₁, h₂]
theorem singularPart_smul_nnreal (s : SignedMeasure α) (μ : Measure α) (r : ℝ≥0) :
(r • s).singularPart μ = r • s.singularPart μ := by
rw [singularPart, singularPart, smul_sub, ← toSignedMeasure_smul, ← toSignedMeasure_smul]
conv_lhs =>
congr
· congr
· rw [toJordanDecomposition_smul, JordanDecomposition.smul_posPart, singularPart_smul]
· congr
rw [toJordanDecomposition_smul, JordanDecomposition.smul_negPart, singularPart_smul]
nonrec theorem singularPart_smul (s : SignedMeasure α) (μ : Measure α) (r : ℝ) :
(r • s).singularPart μ = r • s.singularPart μ := by
cases le_or_lt 0 r with
| inl hr =>
lift r to ℝ≥0 using hr
exact singularPart_smul_nnreal s μ r
| inr hr =>
rw [singularPart, singularPart]
conv_lhs =>
congr
· congr
· rw [toJordanDecomposition_smul_real,
JordanDecomposition.real_smul_posPart_neg _ _ hr, singularPart_smul]
· congr
· rw [toJordanDecomposition_smul_real,
JordanDecomposition.real_smul_negPart_neg _ _ hr, singularPart_smul]
rw [toSignedMeasure_smul, toSignedMeasure_smul, ← neg_sub, ← smul_sub, NNReal.smul_def,
← neg_smul, Real.coe_toNNReal _ (le_of_lt (neg_pos.mpr hr)), neg_neg]
theorem singularPart_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
[t.HaveLebesgueDecomposition μ] :
(s + t).singularPart μ = s.singularPart μ + t.singularPart μ := by
refine
(eq_singularPart _ (s.rnDeriv μ + t.rnDeriv μ)
((mutuallySingular_singularPart s μ).add_left (mutuallySingular_singularPart t μ))
?_).symm
rw [withDensityᵥ_add (integrable_rnDeriv s μ) (integrable_rnDeriv t μ), add_assoc,
add_comm (t.singularPart μ), add_assoc, add_comm _ (t.singularPart μ),
singularPart_add_withDensity_rnDeriv_eq, ← add_assoc,
singularPart_add_withDensity_rnDeriv_eq]
theorem singularPart_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
[t.HaveLebesgueDecomposition μ] :
(s - t).singularPart μ = s.singularPart μ - t.singularPart μ := by
rw [sub_eq_add_neg, sub_eq_add_neg, singularPart_add, singularPart_neg]
/-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
mutually singular with respect to `μ` and `s = t + μ.withDensityᵥ f`, we have
`f = rnDeriv s μ`, i.e. `f` is the Radon-Nikodym derivative of `s` and `μ`. -/
theorem eq_rnDeriv (t : SignedMeasure α) (f : α → ℝ) (hfi : Integrable f μ)
(htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
f =ᵐ[μ] s.rnDeriv μ := by
set f' := hfi.1.mk f
have hadd' : s = t + μ.withDensityᵥ f' := by
convert hadd using 2
exact WithDensityᵥEq.congr_ae hfi.1.ae_eq_mk.symm
have := haveLebesgueDecomposition_mk μ hfi.1.measurable_mk htμ hadd'
refine (Integrable.ae_eq_of_withDensityᵥ_eq (integrable_rnDeriv _ _) hfi ?_).symm
rw [← add_right_inj t, ← hadd, eq_singularPart _ f htμ hadd,
singularPart_add_withDensity_rnDeriv_eq]
theorem rnDeriv_neg (s : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ] :
(-s).rnDeriv μ =ᵐ[μ] -s.rnDeriv μ := by
refine
Integrable.ae_eq_of_withDensityᵥ_eq (integrable_rnDeriv _ _) (integrable_rnDeriv _ _).neg ?_
rw [withDensityᵥ_neg, ← add_right_inj ((-s).singularPart μ),
singularPart_add_withDensity_rnDeriv_eq, singularPart_neg, ← neg_add,
singularPart_add_withDensity_rnDeriv_eq]
theorem rnDeriv_smul (s : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ] (r : ℝ) :
(r • s).rnDeriv μ =ᵐ[μ] r • s.rnDeriv μ := by
refine
Integrable.ae_eq_of_withDensityᵥ_eq (integrable_rnDeriv _ _)
((integrable_rnDeriv _ _).smul r) ?_
rw [withDensityᵥ_smul (rnDeriv s μ) r, ← add_right_inj ((r • s).singularPart μ),
singularPart_add_withDensity_rnDeriv_eq, singularPart_smul, ← smul_add,
singularPart_add_withDensity_rnDeriv_eq]
theorem rnDeriv_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
[t.HaveLebesgueDecomposition μ] [(s + t).HaveLebesgueDecomposition μ] :
(s + t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ + t.rnDeriv μ := by
refine
Integrable.ae_eq_of_withDensityᵥ_eq (integrable_rnDeriv _ _)
((integrable_rnDeriv _ _).add (integrable_rnDeriv _ _)) ?_
rw [← add_right_inj ((s + t).singularPart μ), singularPart_add_withDensity_rnDeriv_eq,
withDensityᵥ_add (integrable_rnDeriv _ _) (integrable_rnDeriv _ _), singularPart_add,
add_assoc, add_comm (t.singularPart μ), add_assoc, add_comm _ (t.singularPart μ),
singularPart_add_withDensity_rnDeriv_eq, ← add_assoc,
singularPart_add_withDensity_rnDeriv_eq]
theorem rnDeriv_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
[t.HaveLebesgueDecomposition μ] [hst : (s - t).HaveLebesgueDecomposition μ] :
(s - t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ - t.rnDeriv μ := by
rw [sub_eq_add_neg] at hst
rw [sub_eq_add_neg, sub_eq_add_neg]
exact ae_eq_trans (rnDeriv_add _ _ _) (Filter.EventuallyEq.add (ae_eq_refl _) (rnDeriv_neg _ _))
end SignedMeasure
namespace ComplexMeasure
/-- A complex measure is said to `HaveLebesgueDecomposition` with respect to a positive measure
if both its real and imaginary part `HaveLebesgueDecomposition` with respect to that measure. -/
class HaveLebesgueDecomposition (c : ComplexMeasure α) (μ : Measure α) : Prop where
rePart : c.re.HaveLebesgueDecomposition μ
imPart : c.im.HaveLebesgueDecomposition μ
attribute [instance] HaveLebesgueDecomposition.rePart
attribute [instance] HaveLebesgueDecomposition.imPart
/-- The singular part between a complex measure `c` and a positive measure `μ` is the complex
measure satisfying `c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c`. This property is given
by `MeasureTheory.ComplexMeasure.singularPart_add_withDensity_rnDeriv_eq`. -/
def singularPart (c : ComplexMeasure α) (μ : Measure α) : ComplexMeasure α :=
(c.re.singularPart μ).toComplexMeasure (c.im.singularPart μ)
/-- The Radon-Nikodym derivative between a complex measure and a positive measure. -/
def rnDeriv (c : ComplexMeasure α) (μ : Measure α) : α → ℂ := fun x =>
⟨c.re.rnDeriv μ x, c.im.rnDeriv μ x⟩
variable {c : ComplexMeasure α}
theorem integrable_rnDeriv (c : ComplexMeasure α) (μ : Measure α) : Integrable (c.rnDeriv μ) μ := by
rw [← memℒp_one_iff_integrable, ← memℒp_re_im_iff]
exact
⟨memℒp_one_iff_integrable.2 (SignedMeasure.integrable_rnDeriv _ _),
memℒp_one_iff_integrable.2 (SignedMeasure.integrable_rnDeriv _ _)⟩
theorem singularPart_add_withDensity_rnDeriv_eq [c.HaveLebesgueDecomposition μ] :
c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c := by
conv_rhs => rw [← c.toComplexMeasure_to_signedMeasure]
ext i hi : 1
rw [VectorMeasure.add_apply, SignedMeasure.toComplexMeasure_apply]
apply Complex.ext
· rw [Complex.add_re, withDensityᵥ_apply (c.integrable_rnDeriv μ) hi, ← RCLike.re_eq_complex_re,
← integral_re (c.integrable_rnDeriv μ).integrableOn, RCLike.re_eq_complex_re,
← withDensityᵥ_apply _ hi]
· change (c.re.singularPart μ + μ.withDensityᵥ (c.re.rnDeriv μ)) i = _
rw [c.re.singularPart_add_withDensity_rnDeriv_eq μ]
· exact SignedMeasure.integrable_rnDeriv _ _
· rw [Complex.add_im, withDensityᵥ_apply (c.integrable_rnDeriv μ) hi, ← RCLike.im_eq_complex_im,
← integral_im (c.integrable_rnDeriv μ).integrableOn, RCLike.im_eq_complex_im,
← withDensityᵥ_apply _ hi]
· change (c.im.singularPart μ + μ.withDensityᵥ (c.im.rnDeriv μ)) i = _
rw [c.im.singularPart_add_withDensity_rnDeriv_eq μ]
· exact SignedMeasure.integrable_rnDeriv _ _
end ComplexMeasure
end MeasureTheory
|
MeasureTheory\Decomposition\UnsignedHahn.lean | /-
Copyright (c) 2019 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.MeasureTheory.Measure.Typeclasses
/-!
# Unsigned Hahn decomposition theorem
This file proves the unsigned version of the Hahn decomposition theorem.
## Main statements
* `hahn_decomposition` : Given two finite measures `μ` and `ν`, there exists a measurable set `s`
such that any measurable set `t` included in `s` satisfies `ν t ≤ μ t`, and any
measurable set `u` included in the complement of `s` satisfies `μ u ≤ ν u`.
## Tags
Hahn decomposition
-/
open Set Filter Topology ENNReal
namespace MeasureTheory
variable {α : Type*} [MeasurableSpace α] {μ ν : Measure α}
/-- **Hahn decomposition theorem** -/
theorem hahn_decomposition [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
∃ s,
MeasurableSet s ∧
(∀ t, MeasurableSet t → t ⊆ s → ν t ≤ μ t) ∧ ∀ t, MeasurableSet t → t ⊆ sᶜ → μ t ≤ ν t := by
let d : Set α → ℝ := fun s => ((μ s).toNNReal : ℝ) - (ν s).toNNReal
let c : Set ℝ := d '' { s | MeasurableSet s }
let γ : ℝ := sSup c
have hμ : ∀ s, μ s ≠ ∞ := measure_ne_top μ
have hν : ∀ s, ν s ≠ ∞ := measure_ne_top ν
have to_nnreal_μ : ∀ s, ((μ s).toNNReal : ℝ≥0∞) = μ s := fun s => ENNReal.coe_toNNReal <| hμ _
have to_nnreal_ν : ∀ s, ((ν s).toNNReal : ℝ≥0∞) = ν s := fun s => ENNReal.coe_toNNReal <| hν _
have d_split s t (ht : MeasurableSet t) : d s = d (s \ t) + d (s ∩ t) := by
dsimp only [d]
rw [← measure_inter_add_diff s ht, ← measure_inter_add_diff s ht,
ENNReal.toNNReal_add (hμ _) (hμ _), ENNReal.toNNReal_add (hν _) (hν _), NNReal.coe_add,
NNReal.coe_add]
simp only [sub_eq_add_neg, neg_add]
abel
have d_Union (s : ℕ → Set α) (hm : Monotone s) :
Tendsto (fun n => d (s n)) atTop (𝓝 (d (⋃ n, s n))) := by
refine Tendsto.sub ?_ ?_ <;>
refine NNReal.tendsto_coe.2 <| (ENNReal.tendsto_toNNReal ?_).comp <| tendsto_measure_iUnion hm
· exact hμ _
· exact hν _
have d_Inter (s : ℕ → Set α) (hs : ∀ n, MeasurableSet (s n)) (hm : ∀ n m, n ≤ m → s m ⊆ s n) :
Tendsto (fun n => d (s n)) atTop (𝓝 (d (⋂ n, s n))) := by
refine Tendsto.sub ?_ ?_ <;>
refine
NNReal.tendsto_coe.2 <|
(ENNReal.tendsto_toNNReal <| ?_).comp <| tendsto_measure_iInter hs hm ?_
exacts [hμ _, ⟨0, hμ _⟩, hν _, ⟨0, hν _⟩]
have bdd_c : BddAbove c := by
use (μ univ).toNNReal
rintro r ⟨s, _hs, rfl⟩
refine le_trans (sub_le_self _ <| NNReal.coe_nonneg _) ?_
rw [NNReal.coe_le_coe, ← ENNReal.coe_le_coe, to_nnreal_μ, to_nnreal_μ]
exact measure_mono (subset_univ _)
have c_nonempty : c.Nonempty := Nonempty.image _ ⟨_, MeasurableSet.empty⟩
have d_le_γ : ∀ s, MeasurableSet s → d s ≤ γ := fun s hs => le_csSup bdd_c ⟨s, hs, rfl⟩
have (n : ℕ) : ∃ s : Set α, MeasurableSet s ∧ γ - (1 / 2) ^ n < d s := by
have : γ - (1 / 2) ^ n < γ := sub_lt_self γ (pow_pos (half_pos zero_lt_one) n)
rcases exists_lt_of_lt_csSup c_nonempty this with ⟨r, ⟨s, hs, rfl⟩, hlt⟩
exact ⟨s, hs, hlt⟩
rcases Classical.axiom_of_choice this with ⟨e, he⟩
change ℕ → Set α at e
have he₁ : ∀ n, MeasurableSet (e n) := fun n => (he n).1
have he₂ : ∀ n, γ - (1 / 2) ^ n < d (e n) := fun n => (he n).2
let f : ℕ → ℕ → Set α := fun n m => (Finset.Ico n (m + 1)).inf e
have hf n m : MeasurableSet (f n m) := by
simp only [f, Finset.inf_eq_iInf]
exact MeasurableSet.biInter (to_countable _) fun i _ => he₁ _
have f_subset_f {a b c d} (hab : a ≤ b) (hcd : c ≤ d) : f a d ⊆ f b c := by
simp_rw [f, Finset.inf_eq_iInf]
exact biInter_subset_biInter_left (Finset.Ico_subset_Ico hab <| Nat.succ_le_succ hcd)
have f_succ n m (hnm : n ≤ m) : f n (m + 1) = f n m ∩ e (m + 1) := by
have : n ≤ m + 1 := le_of_lt (Nat.succ_le_succ hnm)
simp_rw [f, Nat.Ico_succ_right_eq_insert_Ico this, Finset.inf_insert, Set.inter_comm]
rfl
have le_d_f n m (h : m ≤ n) : γ - 2 * (1 / 2) ^ m + (1 / 2) ^ n ≤ d (f m n) := by
refine Nat.le_induction ?_ ?_ n h
· have := he₂ m
simp_rw [f, Nat.Ico_succ_singleton, Finset.inf_singleton]
linarith
· intro n (hmn : m ≤ n) ih
have : γ + (γ - 2 * (1 / 2) ^ m + (1 / 2) ^ (n + 1)) ≤ γ + d (f m (n + 1)) := by
calc
γ + (γ - 2 * (1 / 2) ^ m + (1 / 2) ^ (n + 1)) =
γ + (γ - 2 * (1 / 2) ^ m + ((1 / 2) ^ n - (1 / 2) ^ (n + 1))) := by
rw [pow_succ, mul_one_div, _root_.sub_half]
_ = γ - (1 / 2) ^ (n + 1) + (γ - 2 * (1 / 2) ^ m + (1 / 2) ^ n) := by
simp only [sub_eq_add_neg]; abel
_ ≤ d (e (n + 1)) + d (f m n) := add_le_add (le_of_lt <| he₂ _) ih
_ ≤ d (e (n + 1)) + d (f m n \ e (n + 1)) + d (f m (n + 1)) := by
rw [f_succ _ _ hmn, d_split (f m n) (e (n + 1)) (he₁ _), add_assoc]
_ = d (e (n + 1) ∪ f m n) + d (f m (n + 1)) := by
rw [d_split (e (n + 1) ∪ f m n) (e (n + 1)), union_diff_left, union_inter_cancel_left]
· abel
· exact he₁ _
_ ≤ γ + d (f m (n + 1)) := add_le_add_right (d_le_γ _ <| (he₁ _).union (hf _ _)) _
exact (add_le_add_iff_left γ).1 this
let s := ⋃ m, ⋂ n, f m n
have γ_le_d_s : γ ≤ d s := by
have hγ : Tendsto (fun m : ℕ => γ - 2 * (1 / 2) ^ m) atTop (𝓝 γ) := by
suffices Tendsto (fun m : ℕ => γ - 2 * (1 / 2) ^ m) atTop (𝓝 (γ - 2 * 0)) by
simpa only [mul_zero, tsub_zero]
exact
tendsto_const_nhds.sub <|
tendsto_const_nhds.mul <|
tendsto_pow_atTop_nhds_zero_of_lt_one (le_of_lt <| half_pos <| zero_lt_one)
(half_lt_self zero_lt_one)
have hd : Tendsto (fun m => d (⋂ n, f m n)) atTop (𝓝 (d (⋃ m, ⋂ n, f m n))) := by
refine d_Union _ ?_
exact fun n m hnm =>
subset_iInter fun i => Subset.trans (iInter_subset (f n) i) <| f_subset_f hnm <| le_rfl
refine le_of_tendsto_of_tendsto' hγ hd fun m => ?_
have : Tendsto (fun n => d (f m n)) atTop (𝓝 (d (⋂ n, f m n))) := by
refine d_Inter _ ?_ ?_
· intro n
exact hf _ _
· intro n m hnm
exact f_subset_f le_rfl hnm
refine ge_of_tendsto this (eventually_atTop.2 ⟨m, fun n hmn => ?_⟩)
change γ - 2 * (1 / 2) ^ m ≤ d (f m n)
refine le_trans ?_ (le_d_f _ _ hmn)
exact le_add_of_le_of_nonneg le_rfl (pow_nonneg (le_of_lt <| half_pos <| zero_lt_one) _)
have hs : MeasurableSet s := MeasurableSet.iUnion fun n => MeasurableSet.iInter fun m => hf _ _
refine ⟨s, hs, ?_, ?_⟩
· intro t ht hts
have : 0 ≤ d t :=
(add_le_add_iff_left γ).1 <|
calc
γ + 0 ≤ d s := by rw [add_zero]; exact γ_le_d_s
_ = d (s \ t) + d t := by rw [d_split s _ ht, inter_eq_self_of_subset_right hts]
_ ≤ γ + d t := add_le_add (d_le_γ _ (hs.diff ht)) le_rfl
rw [← to_nnreal_μ, ← to_nnreal_ν, ENNReal.coe_le_coe, ← NNReal.coe_le_coe]
simpa only [d, le_sub_iff_add_le, zero_add] using this
· intro t ht hts
have : d t ≤ 0 :=
(add_le_add_iff_left γ).1 <|
calc
γ + d t ≤ d s + d t := by gcongr
_ = d (s ∪ t) := by
rw [d_split (s ∪ t) _ ht, union_diff_right, union_inter_cancel_right,
(subset_compl_iff_disjoint_left.1 hts).sdiff_eq_left]
_ ≤ γ + 0 := by rw [add_zero]; exact d_le_γ _ (hs.union ht)
rw [← to_nnreal_μ, ← to_nnreal_ν, ENNReal.coe_le_coe, ← NNReal.coe_le_coe]
simpa only [d, sub_le_iff_le_add, zero_add] using this
end MeasureTheory
|
MeasureTheory\Function\AEEqFun.lean | /-
Copyright (c) 2019 Johannes Hölzl, Zhouhang Zhou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Zhouhang Zhou
-/
import Mathlib.MeasureTheory.Integral.Lebesgue
import Mathlib.Order.Filter.Germ.Basic
import Mathlib.Topology.ContinuousFunction.Algebra
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
/-!
# Almost everywhere equal functions
We build a space of equivalence classes of functions, where two functions are treated as identical
if they are almost everywhere equal. We form the set of equivalence classes under the relation of
being almost everywhere equal, which is sometimes known as the `L⁰` space.
To use this space as a basis for the `L^p` spaces and for the Bochner integral, we consider
equivalence classes of strongly measurable functions (or, equivalently, of almost everywhere
strongly measurable functions.)
See `L1Space.lean` for `L¹` space.
## Notation
* `α →ₘ[μ] β` is the type of `L⁰` space, where `α` is a measurable space, `β` is a topological
space, and `μ` is a measure on `α`. `f : α →ₘ β` is a "function" in `L⁰`.
In comments, `[f]` is also used to denote an `L⁰` function.
`ₘ` can be typed as `\_m`. Sometimes it is shown as a box if font is missing.
## Main statements
* The linear structure of `L⁰` :
Addition and scalar multiplication are defined on `L⁰` in the natural way, i.e.,
`[f] + [g] := [f + g]`, `c • [f] := [c • f]`. So defined, `α →ₘ β` inherits the linear structure
of `β`. For example, if `β` is a module, then `α →ₘ β` is a module over the same ring.
See `mk_add_mk`, `neg_mk`, `mk_sub_mk`, `smul_mk`,
`add_toFun`, `neg_toFun`, `sub_toFun`, `smul_toFun`
* The order structure of `L⁰` :
`≤` can be defined in a similar way: `[f] ≤ [g]` if `f a ≤ g a` for almost all `a` in domain.
And `α →ₘ β` inherits the preorder and partial order of `β`.
TODO: Define `sup` and `inf` on `L⁰` so that it forms a lattice. It seems that `β` must be a
linear order, since otherwise `f ⊔ g` may not be a measurable function.
## Implementation notes
* `f.toFun` : To find a representative of `f : α →ₘ β`, use the coercion `(f : α → β)`, which
is implemented as `f.toFun`.
For each operation `op` in `L⁰`, there is a lemma called `coe_fn_op`,
characterizing, say, `(f op g : α → β)`.
* `ae_eq_fun.mk` : To constructs an `L⁰` function `α →ₘ β` from an almost everywhere strongly
measurable function `f : α → β`, use `ae_eq_fun.mk`
* `comp` : Use `comp g f` to get `[g ∘ f]` from `g : β → γ` and `[f] : α →ₘ γ` when `g` is
continuous. Use `comp_measurable` if `g` is only measurable (this requires the
target space to be second countable).
* `comp₂` : Use `comp₂ g f₁ f₂` to get `[fun a ↦ g (f₁ a) (f₂ a)]`.
For example, `[f + g]` is `comp₂ (+)`
## Tags
function space, almost everywhere equal, `L⁰`, ae_eq_fun
-/
noncomputable section
open Topology Set Filter TopologicalSpace ENNReal EMetric MeasureTheory Function
variable {α β γ δ : Type*} [MeasurableSpace α] {μ ν : Measure α}
namespace MeasureTheory
section MeasurableSpace
variable [TopologicalSpace β]
variable (β)
/-- The equivalence relation of being almost everywhere equal for almost everywhere strongly
measurable functions. -/
def Measure.aeEqSetoid (μ : Measure α) : Setoid { f : α → β // AEStronglyMeasurable f μ } :=
⟨fun f g => (f : α → β) =ᵐ[μ] g, fun {f} => ae_eq_refl f.val, fun {_ _} => ae_eq_symm,
fun {_ _ _} => ae_eq_trans⟩
variable (α)
/-- The space of equivalence classes of almost everywhere strongly measurable functions, where two
strongly measurable functions are equivalent if they agree almost everywhere, i.e.,
they differ on a set of measure `0`. -/
def AEEqFun (μ : Measure α) : Type _ :=
Quotient (μ.aeEqSetoid β)
variable {α β}
@[inherit_doc MeasureTheory.AEEqFun]
notation:25 α " →ₘ[" μ "] " β => AEEqFun α β μ
end MeasurableSpace
namespace AEEqFun
variable [TopologicalSpace β] [TopologicalSpace γ] [TopologicalSpace δ]
/-- Construct the equivalence class `[f]` of an almost everywhere measurable function `f`, based
on the equivalence relation of being almost everywhere equal. -/
def mk {β : Type*} [TopologicalSpace β] (f : α → β) (hf : AEStronglyMeasurable f μ) : α →ₘ[μ] β :=
Quotient.mk'' ⟨f, hf⟩
open scoped Classical in
/-- Coercion from a space of equivalence classes of almost everywhere strongly measurable
functions to functions. We ensure that if `f` has a constant representative,
then we choose that one. -/
@[coe]
def cast (f : α →ₘ[μ] β) : α → β :=
if h : ∃ (b : β), f = mk (const α b) aestronglyMeasurable_const then
const α <| Classical.choose h else
AEStronglyMeasurable.mk _ (Quotient.out' f : { f : α → β // AEStronglyMeasurable f μ }).2
/-- A measurable representative of an `AEEqFun` [f] -/
instance instCoeFun : CoeFun (α →ₘ[μ] β) fun _ => α → β := ⟨cast⟩
protected theorem stronglyMeasurable (f : α →ₘ[μ] β) : StronglyMeasurable f := by
simp only [cast]
split_ifs with h
· exact stronglyMeasurable_const
· apply AEStronglyMeasurable.stronglyMeasurable_mk
protected theorem aestronglyMeasurable (f : α →ₘ[μ] β) : AEStronglyMeasurable f μ :=
f.stronglyMeasurable.aestronglyMeasurable
protected theorem measurable [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β]
(f : α →ₘ[μ] β) : Measurable f :=
f.stronglyMeasurable.measurable
protected theorem aemeasurable [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β]
(f : α →ₘ[μ] β) : AEMeasurable f μ :=
f.measurable.aemeasurable
@[simp]
theorem quot_mk_eq_mk (f : α → β) (hf) :
(Quot.mk (@Setoid.r _ <| μ.aeEqSetoid β) ⟨f, hf⟩ : α →ₘ[μ] β) = mk f hf :=
rfl
@[simp]
theorem mk_eq_mk {f g : α → β} {hf hg} : (mk f hf : α →ₘ[μ] β) = mk g hg ↔ f =ᵐ[μ] g :=
Quotient.eq''
@[simp]
theorem mk_coeFn (f : α →ₘ[μ] β) : mk f f.aestronglyMeasurable = f := by
conv_lhs => simp only [cast]
split_ifs with h
· exact Classical.choose_spec h |>.symm
conv_rhs => rw [← Quotient.out_eq' f]
rw [← mk, mk_eq_mk]
exact (AEStronglyMeasurable.ae_eq_mk _).symm
@[ext]
theorem ext {f g : α →ₘ[μ] β} (h : f =ᵐ[μ] g) : f = g := by
rwa [← f.mk_coeFn, ← g.mk_coeFn, mk_eq_mk]
theorem coeFn_mk (f : α → β) (hf) : (mk f hf : α →ₘ[μ] β) =ᵐ[μ] f := by
rw [← mk_eq_mk, mk_coeFn]
@[elab_as_elim]
theorem induction_on (f : α →ₘ[μ] β) {p : (α →ₘ[μ] β) → Prop} (H : ∀ f hf, p (mk f hf)) : p f :=
Quotient.inductionOn' f <| Subtype.forall.2 H
@[elab_as_elim]
theorem induction_on₂ {α' β' : Type*} [MeasurableSpace α'] [TopologicalSpace β'] {μ' : Measure α'}
(f : α →ₘ[μ] β) (f' : α' →ₘ[μ'] β') {p : (α →ₘ[μ] β) → (α' →ₘ[μ'] β') → Prop}
(H : ∀ f hf f' hf', p (mk f hf) (mk f' hf')) : p f f' :=
induction_on f fun f hf => induction_on f' <| H f hf
@[elab_as_elim]
theorem induction_on₃ {α' β' : Type*} [MeasurableSpace α'] [TopologicalSpace β'] {μ' : Measure α'}
{α'' β'' : Type*} [MeasurableSpace α''] [TopologicalSpace β''] {μ'' : Measure α''}
(f : α →ₘ[μ] β) (f' : α' →ₘ[μ'] β') (f'' : α'' →ₘ[μ''] β'')
{p : (α →ₘ[μ] β) → (α' →ₘ[μ'] β') → (α'' →ₘ[μ''] β'') → Prop}
(H : ∀ f hf f' hf' f'' hf'', p (mk f hf) (mk f' hf') (mk f'' hf'')) : p f f' f'' :=
induction_on f fun f hf => induction_on₂ f' f'' <| H f hf
/-!
### Composition of an a.e. equal function with a (quasi) measure preserving function
-/
section compQuasiMeasurePreserving
variable [MeasurableSpace β] {ν : MeasureTheory.Measure β} {f : α → β}
open MeasureTheory.Measure (QuasiMeasurePreserving)
/-- Composition of an almost everywhere equal function and a quasi measure preserving function.
See also `AEEqFun.compMeasurePreserving`. -/
def compQuasiMeasurePreserving (g : β →ₘ[ν] γ) (f : α → β) (hf : QuasiMeasurePreserving f μ ν) :
α →ₘ[μ] γ :=
Quotient.liftOn' g (fun g ↦ mk (g ∘ f) <| g.2.comp_quasiMeasurePreserving hf) fun _ _ h ↦
mk_eq_mk.2 <| h.comp_tendsto hf.tendsto_ae
@[simp]
theorem compQuasiMeasurePreserving_mk {g : β → γ} (hg : AEStronglyMeasurable g ν)
(hf : QuasiMeasurePreserving f μ ν) :
(mk g hg).compQuasiMeasurePreserving f hf = mk (g ∘ f) (hg.comp_quasiMeasurePreserving hf) :=
rfl
theorem compQuasiMeasurePreserving_eq_mk (g : β →ₘ[ν] γ) (hf : QuasiMeasurePreserving f μ ν) :
g.compQuasiMeasurePreserving f hf =
mk (g ∘ f) (g.aestronglyMeasurable.comp_quasiMeasurePreserving hf) := by
rw [← compQuasiMeasurePreserving_mk g.aestronglyMeasurable hf, mk_coeFn]
theorem coeFn_compQuasiMeasurePreserving (g : β →ₘ[ν] γ) (hf : QuasiMeasurePreserving f μ ν) :
g.compQuasiMeasurePreserving f hf =ᵐ[μ] g ∘ f := by
rw [compQuasiMeasurePreserving_eq_mk]
apply coeFn_mk
end compQuasiMeasurePreserving
section compMeasurePreserving
variable [MeasurableSpace β] {ν : MeasureTheory.Measure β} {f : α → β} {g : β → γ}
/-- Composition of an almost everywhere equal function and a quasi measure preserving function.
This is an important special case of `AEEqFun.compQuasiMeasurePreserving`. We use a separate
definition so that lemmas that need `f` to be measure preserving can be `@[simp]` lemmas. -/
def compMeasurePreserving (g : β →ₘ[ν] γ) (f : α → β) (hf : MeasurePreserving f μ ν) : α →ₘ[μ] γ :=
g.compQuasiMeasurePreserving f hf.quasiMeasurePreserving
@[simp]
theorem compMeasurePreserving_mk (hg : AEStronglyMeasurable g ν) (hf : MeasurePreserving f μ ν) :
(mk g hg).compMeasurePreserving f hf =
mk (g ∘ f) (hg.comp_quasiMeasurePreserving hf.quasiMeasurePreserving) :=
rfl
theorem compMeasurePreserving_eq_mk (g : β →ₘ[ν] γ) (hf : MeasurePreserving f μ ν) :
g.compMeasurePreserving f hf =
mk (g ∘ f) (g.aestronglyMeasurable.comp_quasiMeasurePreserving hf.quasiMeasurePreserving) :=
g.compQuasiMeasurePreserving_eq_mk _
theorem coeFn_compMeasurePreserving (g : β →ₘ[ν] γ) (hf : MeasurePreserving f μ ν) :
g.compMeasurePreserving f hf =ᵐ[μ] g ∘ f :=
g.coeFn_compQuasiMeasurePreserving _
end compMeasurePreserving
/-- Given a continuous function `g : β → γ`, and an almost everywhere equal function `[f] : α →ₘ β`,
return the equivalence class of `g ∘ f`, i.e., the almost everywhere equal function
`[g ∘ f] : α →ₘ γ`. -/
def comp (g : β → γ) (hg : Continuous g) (f : α →ₘ[μ] β) : α →ₘ[μ] γ :=
Quotient.liftOn' f (fun f => mk (g ∘ (f : α → β)) (hg.comp_aestronglyMeasurable f.2))
fun _ _ H => mk_eq_mk.2 <| H.fun_comp g
@[simp]
theorem comp_mk (g : β → γ) (hg : Continuous g) (f : α → β) (hf) :
comp g hg (mk f hf : α →ₘ[μ] β) = mk (g ∘ f) (hg.comp_aestronglyMeasurable hf) :=
rfl
theorem comp_eq_mk (g : β → γ) (hg : Continuous g) (f : α →ₘ[μ] β) :
comp g hg f = mk (g ∘ f) (hg.comp_aestronglyMeasurable f.aestronglyMeasurable) := by
rw [← comp_mk g hg f f.aestronglyMeasurable, mk_coeFn]
theorem coeFn_comp (g : β → γ) (hg : Continuous g) (f : α →ₘ[μ] β) : comp g hg f =ᵐ[μ] g ∘ f := by
rw [comp_eq_mk]
apply coeFn_mk
theorem comp_compQuasiMeasurePreserving [MeasurableSpace β] {ν} (g : γ → δ) (hg : Continuous g)
(f : β →ₘ[ν] γ) {φ : α → β} (hφ : Measure.QuasiMeasurePreserving φ μ ν) :
(comp g hg f).compQuasiMeasurePreserving φ hφ =
comp g hg (f.compQuasiMeasurePreserving φ hφ) := by
rcases f; rfl
section CompMeasurable
variable [MeasurableSpace β] [PseudoMetrizableSpace β] [BorelSpace β] [MeasurableSpace γ]
[PseudoMetrizableSpace γ] [OpensMeasurableSpace γ] [SecondCountableTopology γ]
/-- Given a measurable function `g : β → γ`, and an almost everywhere equal function `[f] : α →ₘ β`,
return the equivalence class of `g ∘ f`, i.e., the almost everywhere equal function
`[g ∘ f] : α →ₘ γ`. This requires that `γ` has a second countable topology. -/
def compMeasurable (g : β → γ) (hg : Measurable g) (f : α →ₘ[μ] β) : α →ₘ[μ] γ :=
Quotient.liftOn' f
(fun f' => mk (g ∘ (f' : α → β)) (hg.comp_aemeasurable f'.2.aemeasurable).aestronglyMeasurable)
fun _ _ H => mk_eq_mk.2 <| H.fun_comp g
@[simp]
theorem compMeasurable_mk (g : β → γ) (hg : Measurable g) (f : α → β)
(hf : AEStronglyMeasurable f μ) :
compMeasurable g hg (mk f hf : α →ₘ[μ] β) =
mk (g ∘ f) (hg.comp_aemeasurable hf.aemeasurable).aestronglyMeasurable :=
rfl
theorem compMeasurable_eq_mk (g : β → γ) (hg : Measurable g) (f : α →ₘ[μ] β) :
compMeasurable g hg f =
mk (g ∘ f) (hg.comp_aemeasurable f.aemeasurable).aestronglyMeasurable := by
rw [← compMeasurable_mk g hg f f.aestronglyMeasurable, mk_coeFn]
theorem coeFn_compMeasurable (g : β → γ) (hg : Measurable g) (f : α →ₘ[μ] β) :
compMeasurable g hg f =ᵐ[μ] g ∘ f := by
rw [compMeasurable_eq_mk]
apply coeFn_mk
end CompMeasurable
/-- The class of `x ↦ (f x, g x)`. -/
def pair (f : α →ₘ[μ] β) (g : α →ₘ[μ] γ) : α →ₘ[μ] β × γ :=
Quotient.liftOn₂' f g (fun f g => mk (fun x => (f.1 x, g.1 x)) (f.2.prod_mk g.2))
fun _f _g _f' _g' Hf Hg => mk_eq_mk.2 <| Hf.prod_mk Hg
@[simp]
theorem pair_mk_mk (f : α → β) (hf) (g : α → γ) (hg) :
(mk f hf : α →ₘ[μ] β).pair (mk g hg) = mk (fun x => (f x, g x)) (hf.prod_mk hg) :=
rfl
theorem pair_eq_mk (f : α →ₘ[μ] β) (g : α →ₘ[μ] γ) :
f.pair g =
mk (fun x => (f x, g x)) (f.aestronglyMeasurable.prod_mk g.aestronglyMeasurable) := by
simp only [← pair_mk_mk, mk_coeFn, f.aestronglyMeasurable, g.aestronglyMeasurable]
theorem coeFn_pair (f : α →ₘ[μ] β) (g : α →ₘ[μ] γ) : f.pair g =ᵐ[μ] fun x => (f x, g x) := by
rw [pair_eq_mk]
apply coeFn_mk
/-- Given a continuous function `g : β → γ → δ`, and almost everywhere equal functions
`[f₁] : α →ₘ β` and `[f₂] : α →ₘ γ`, return the equivalence class of the function
`fun a => g (f₁ a) (f₂ a)`, i.e., the almost everywhere equal function
`[fun a => g (f₁ a) (f₂ a)] : α →ₘ γ` -/
def comp₂ (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α →ₘ[μ] β) (f₂ : α →ₘ[μ] γ) :
α →ₘ[μ] δ :=
comp _ hg (f₁.pair f₂)
@[simp]
theorem comp₂_mk_mk (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α → β) (f₂ : α → γ)
(hf₁ hf₂) :
comp₂ g hg (mk f₁ hf₁ : α →ₘ[μ] β) (mk f₂ hf₂) =
mk (fun a => g (f₁ a) (f₂ a)) (hg.comp_aestronglyMeasurable (hf₁.prod_mk hf₂)) :=
rfl
theorem comp₂_eq_pair (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ) : comp₂ g hg f₁ f₂ = comp _ hg (f₁.pair f₂) :=
rfl
theorem comp₂_eq_mk (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ) : comp₂ g hg f₁ f₂ = mk (fun a => g (f₁ a) (f₂ a))
(hg.comp_aestronglyMeasurable (f₁.aestronglyMeasurable.prod_mk f₂.aestronglyMeasurable)) := by
rw [comp₂_eq_pair, pair_eq_mk, comp_mk]; rfl
theorem coeFn_comp₂ (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ) : comp₂ g hg f₁ f₂ =ᵐ[μ] fun a => g (f₁ a) (f₂ a) := by
rw [comp₂_eq_mk]
apply coeFn_mk
section
variable [MeasurableSpace β] [PseudoMetrizableSpace β] [BorelSpace β]
[MeasurableSpace γ] [PseudoMetrizableSpace γ] [BorelSpace γ] [SecondCountableTopologyEither β γ]
[MeasurableSpace δ] [PseudoMetrizableSpace δ] [OpensMeasurableSpace δ] [SecondCountableTopology δ]
/-- Given a measurable function `g : β → γ → δ`, and almost everywhere equal functions
`[f₁] : α →ₘ β` and `[f₂] : α →ₘ γ`, return the equivalence class of the function
`fun a => g (f₁ a) (f₂ a)`, i.e., the almost everywhere equal function
`[fun a => g (f₁ a) (f₂ a)] : α →ₘ γ`. This requires `δ` to have second-countable topology. -/
def comp₂Measurable (g : β → γ → δ) (hg : Measurable (uncurry g)) (f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ) : α →ₘ[μ] δ :=
compMeasurable _ hg (f₁.pair f₂)
@[simp]
theorem comp₂Measurable_mk_mk (g : β → γ → δ) (hg : Measurable (uncurry g)) (f₁ : α → β)
(f₂ : α → γ) (hf₁ hf₂) :
comp₂Measurable g hg (mk f₁ hf₁ : α →ₘ[μ] β) (mk f₂ hf₂) =
mk (fun a => g (f₁ a) (f₂ a))
(hg.comp_aemeasurable (hf₁.aemeasurable.prod_mk hf₂.aemeasurable)).aestronglyMeasurable :=
rfl
theorem comp₂Measurable_eq_pair (g : β → γ → δ) (hg : Measurable (uncurry g)) (f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ) : comp₂Measurable g hg f₁ f₂ = compMeasurable _ hg (f₁.pair f₂) :=
rfl
theorem comp₂Measurable_eq_mk (g : β → γ → δ) (hg : Measurable (uncurry g)) (f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ) :
comp₂Measurable g hg f₁ f₂ =
mk (fun a => g (f₁ a) (f₂ a))
(hg.comp_aemeasurable (f₁.aemeasurable.prod_mk f₂.aemeasurable)).aestronglyMeasurable := by
rw [comp₂Measurable_eq_pair, pair_eq_mk, compMeasurable_mk]; rfl
theorem coeFn_comp₂Measurable (g : β → γ → δ) (hg : Measurable (uncurry g)) (f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ) : comp₂Measurable g hg f₁ f₂ =ᵐ[μ] fun a => g (f₁ a) (f₂ a) := by
rw [comp₂Measurable_eq_mk]
apply coeFn_mk
end
/-- Interpret `f : α →ₘ[μ] β` as a germ at `ae μ` forgetting that `f` is almost everywhere
strongly measurable. -/
def toGerm (f : α →ₘ[μ] β) : Germ (ae μ) β :=
Quotient.liftOn' f (fun f => ((f : α → β) : Germ (ae μ) β)) fun _ _ H => Germ.coe_eq.2 H
@[simp]
theorem mk_toGerm (f : α → β) (hf) : (mk f hf : α →ₘ[μ] β).toGerm = f :=
rfl
theorem toGerm_eq (f : α →ₘ[μ] β) : f.toGerm = (f : α → β) := by rw [← mk_toGerm, mk_coeFn]
theorem toGerm_injective : Injective (toGerm : (α →ₘ[μ] β) → Germ (ae μ) β) := fun f g H =>
ext <| Germ.coe_eq.1 <| by rwa [← toGerm_eq, ← toGerm_eq]
@[simp]
theorem compQuasiMeasurePreserving_toGerm [MeasurableSpace β] {f : α → β} {ν}
(g : β →ₘ[ν] γ) (hf : Measure.QuasiMeasurePreserving f μ ν) :
(g.compQuasiMeasurePreserving f hf).toGerm = g.toGerm.compTendsto f hf.tendsto_ae := by
rcases g; rfl
@[simp]
theorem compMeasurePreserving_toGerm [MeasurableSpace β] {f : α → β} {ν}
(g : β →ₘ[ν] γ) (hf : MeasurePreserving f μ ν) :
(g.compMeasurePreserving f hf).toGerm =
g.toGerm.compTendsto f hf.quasiMeasurePreserving.tendsto_ae :=
compQuasiMeasurePreserving_toGerm _ _
theorem comp_toGerm (g : β → γ) (hg : Continuous g) (f : α →ₘ[μ] β) :
(comp g hg f).toGerm = f.toGerm.map g :=
induction_on f fun f _ => by simp
theorem compMeasurable_toGerm [MeasurableSpace β] [BorelSpace β] [PseudoMetrizableSpace β]
[PseudoMetrizableSpace γ] [SecondCountableTopology γ] [MeasurableSpace γ]
[OpensMeasurableSpace γ] (g : β → γ) (hg : Measurable g) (f : α →ₘ[μ] β) :
(compMeasurable g hg f).toGerm = f.toGerm.map g :=
induction_on f fun f _ => by simp
theorem comp₂_toGerm (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ) : (comp₂ g hg f₁ f₂).toGerm = f₁.toGerm.map₂ g f₂.toGerm :=
induction_on₂ f₁ f₂ fun f₁ _ f₂ _ => by simp
theorem comp₂Measurable_toGerm [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β]
[PseudoMetrizableSpace γ] [SecondCountableTopologyEither β γ]
[MeasurableSpace γ] [BorelSpace γ] [PseudoMetrizableSpace δ] [SecondCountableTopology δ]
[MeasurableSpace δ] [OpensMeasurableSpace δ] (g : β → γ → δ) (hg : Measurable (uncurry g))
(f₁ : α →ₘ[μ] β) (f₂ : α →ₘ[μ] γ) :
(comp₂Measurable g hg f₁ f₂).toGerm = f₁.toGerm.map₂ g f₂.toGerm :=
induction_on₂ f₁ f₂ fun f₁ _ f₂ _ => by simp
/-- Given a predicate `p` and an equivalence class `[f]`, return true if `p` holds of `f a`
for almost all `a` -/
def LiftPred (p : β → Prop) (f : α →ₘ[μ] β) : Prop :=
f.toGerm.LiftPred p
/-- Given a relation `r` and equivalence class `[f]` and `[g]`, return true if `r` holds of
`(f a, g a)` for almost all `a` -/
def LiftRel (r : β → γ → Prop) (f : α →ₘ[μ] β) (g : α →ₘ[μ] γ) : Prop :=
f.toGerm.LiftRel r g.toGerm
theorem liftRel_mk_mk {r : β → γ → Prop} {f : α → β} {g : α → γ} {hf hg} :
LiftRel r (mk f hf : α →ₘ[μ] β) (mk g hg) ↔ ∀ᵐ a ∂μ, r (f a) (g a) :=
Iff.rfl
theorem liftRel_iff_coeFn {r : β → γ → Prop} {f : α →ₘ[μ] β} {g : α →ₘ[μ] γ} :
LiftRel r f g ↔ ∀ᵐ a ∂μ, r (f a) (g a) := by rw [← liftRel_mk_mk, mk_coeFn, mk_coeFn]
section Order
instance instPreorder [Preorder β] : Preorder (α →ₘ[μ] β) :=
Preorder.lift toGerm
@[simp]
theorem mk_le_mk [Preorder β] {f g : α → β} (hf hg) : (mk f hf : α →ₘ[μ] β) ≤ mk g hg ↔ f ≤ᵐ[μ] g :=
Iff.rfl
@[simp, norm_cast]
theorem coeFn_le [Preorder β] {f g : α →ₘ[μ] β} : (f : α → β) ≤ᵐ[μ] g ↔ f ≤ g :=
liftRel_iff_coeFn.symm
instance instPartialOrder [PartialOrder β] : PartialOrder (α →ₘ[μ] β) :=
PartialOrder.lift toGerm toGerm_injective
section Lattice
section Sup
variable [SemilatticeSup β] [ContinuousSup β]
instance instSup : Sup (α →ₘ[μ] β) where sup f g := AEEqFun.comp₂ (· ⊔ ·) continuous_sup f g
theorem coeFn_sup (f g : α →ₘ[μ] β) : ⇑(f ⊔ g) =ᵐ[μ] fun x => f x ⊔ g x :=
coeFn_comp₂ _ _ _ _
protected theorem le_sup_left (f g : α →ₘ[μ] β) : f ≤ f ⊔ g := by
rw [← coeFn_le]
filter_upwards [coeFn_sup f g] with _ ha
rw [ha]
exact le_sup_left
protected theorem le_sup_right (f g : α →ₘ[μ] β) : g ≤ f ⊔ g := by
rw [← coeFn_le]
filter_upwards [coeFn_sup f g] with _ ha
rw [ha]
exact le_sup_right
protected theorem sup_le (f g f' : α →ₘ[μ] β) (hf : f ≤ f') (hg : g ≤ f') : f ⊔ g ≤ f' := by
rw [← coeFn_le] at hf hg ⊢
filter_upwards [hf, hg, coeFn_sup f g] with _ haf hag ha_sup
rw [ha_sup]
exact sup_le haf hag
end Sup
section Inf
variable [SemilatticeInf β] [ContinuousInf β]
instance instInf : Inf (α →ₘ[μ] β) where inf f g := AEEqFun.comp₂ (· ⊓ ·) continuous_inf f g
theorem coeFn_inf (f g : α →ₘ[μ] β) : ⇑(f ⊓ g) =ᵐ[μ] fun x => f x ⊓ g x :=
coeFn_comp₂ _ _ _ _
protected theorem inf_le_left (f g : α →ₘ[μ] β) : f ⊓ g ≤ f := by
rw [← coeFn_le]
filter_upwards [coeFn_inf f g] with _ ha
rw [ha]
exact inf_le_left
protected theorem inf_le_right (f g : α →ₘ[μ] β) : f ⊓ g ≤ g := by
rw [← coeFn_le]
filter_upwards [coeFn_inf f g] with _ ha
rw [ha]
exact inf_le_right
protected theorem le_inf (f' f g : α →ₘ[μ] β) (hf : f' ≤ f) (hg : f' ≤ g) : f' ≤ f ⊓ g := by
rw [← coeFn_le] at hf hg ⊢
filter_upwards [hf, hg, coeFn_inf f g] with _ haf hag ha_inf
rw [ha_inf]
exact le_inf haf hag
end Inf
instance instLattice [Lattice β] [TopologicalLattice β] : Lattice (α →ₘ[μ] β) :=
{ AEEqFun.instPartialOrder with
sup := Sup.sup
le_sup_left := AEEqFun.le_sup_left
le_sup_right := AEEqFun.le_sup_right
sup_le := AEEqFun.sup_le
inf := Inf.inf
inf_le_left := AEEqFun.inf_le_left
inf_le_right := AEEqFun.inf_le_right
le_inf := AEEqFun.le_inf }
end Lattice
end Order
variable (α)
/-- The equivalence class of a constant function: `[fun _ : α => b]`, based on the equivalence
relation of being almost everywhere equal -/
def const (b : β) : α →ₘ[μ] β :=
mk (fun _ : α ↦ b) aestronglyMeasurable_const
theorem coeFn_const (b : β) : (const α b : α →ₘ[μ] β) =ᵐ[μ] Function.const α b :=
coeFn_mk _ _
/-- If the measure is nonzero, we can strengthen `coeFn_const` to get an equality. -/
@[simp]
theorem coeFn_const_eq [NeZero μ] (b : β) (x : α) : (const α b : α →ₘ[μ] β) x = b := by
simp only [cast]
split_ifs with h; swap; exact h.elim ⟨b, rfl⟩
have := Classical.choose_spec h
set b' := Classical.choose h
simp_rw [const, mk_eq_mk, EventuallyEq, ← const_def, eventually_const] at this
rw [Function.const, this]
variable {α}
instance instInhabited [Inhabited β] : Inhabited (α →ₘ[μ] β) :=
⟨const α default⟩
@[to_additive]
instance instOne [One β] : One (α →ₘ[μ] β) :=
⟨const α 1⟩
@[to_additive]
theorem one_def [One β] : (1 : α →ₘ[μ] β) = mk (fun _ : α => 1) aestronglyMeasurable_const :=
rfl
@[to_additive]
theorem coeFn_one [One β] : ⇑(1 : α →ₘ[μ] β) =ᵐ[μ] 1 :=
coeFn_const ..
@[to_additive (attr := simp)]
theorem coeFn_one_eq [NeZero μ] [One β] {x : α} : (1 : α →ₘ[μ] β) x = 1 :=
coeFn_const_eq ..
@[to_additive (attr := simp)]
theorem one_toGerm [One β] : (1 : α →ₘ[μ] β).toGerm = 1 :=
rfl
-- Note we set up the scalar actions before the `Monoid` structures in case we want to
-- try to override the `nsmul` or `zsmul` fields in future.
section SMul
variable {𝕜 𝕜' : Type*}
variable [SMul 𝕜 γ] [ContinuousConstSMul 𝕜 γ]
variable [SMul 𝕜' γ] [ContinuousConstSMul 𝕜' γ]
instance instSMul : SMul 𝕜 (α →ₘ[μ] γ) :=
⟨fun c f => comp (c • ·) (continuous_id.const_smul c) f⟩
@[simp]
theorem smul_mk (c : 𝕜) (f : α → γ) (hf : AEStronglyMeasurable f μ) :
c • (mk f hf : α →ₘ[μ] γ) = mk (c • f) (hf.const_smul _) :=
rfl
theorem coeFn_smul (c : 𝕜) (f : α →ₘ[μ] γ) : ⇑(c • f) =ᵐ[μ] c • ⇑f :=
coeFn_comp _ _ _
theorem smul_toGerm (c : 𝕜) (f : α →ₘ[μ] γ) : (c • f).toGerm = c • f.toGerm :=
comp_toGerm _ _ _
instance instSMulCommClass [SMulCommClass 𝕜 𝕜' γ] : SMulCommClass 𝕜 𝕜' (α →ₘ[μ] γ) :=
⟨fun a b f => induction_on f fun f hf => by simp_rw [smul_mk, smul_comm]⟩
instance instIsScalarTower [SMul 𝕜 𝕜'] [IsScalarTower 𝕜 𝕜' γ] : IsScalarTower 𝕜 𝕜' (α →ₘ[μ] γ) :=
⟨fun a b f => induction_on f fun f hf => by simp_rw [smul_mk, smul_assoc]⟩
instance instIsCentralScalar [SMul 𝕜ᵐᵒᵖ γ] [IsCentralScalar 𝕜 γ] : IsCentralScalar 𝕜 (α →ₘ[μ] γ) :=
⟨fun a f => induction_on f fun f hf => by simp_rw [smul_mk, op_smul_eq_smul]⟩
end SMul
section Mul
variable [Mul γ] [ContinuousMul γ]
@[to_additive]
instance instMul : Mul (α →ₘ[μ] γ) :=
⟨comp₂ (· * ·) continuous_mul⟩
@[to_additive (attr := simp)]
theorem mk_mul_mk (f g : α → γ) (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
(mk f hf : α →ₘ[μ] γ) * mk g hg = mk (f * g) (hf.mul hg) :=
rfl
@[to_additive]
theorem coeFn_mul (f g : α →ₘ[μ] γ) : ⇑(f * g) =ᵐ[μ] f * g :=
coeFn_comp₂ _ _ _ _
@[to_additive (attr := simp)]
theorem mul_toGerm (f g : α →ₘ[μ] γ) : (f * g).toGerm = f.toGerm * g.toGerm :=
comp₂_toGerm _ _ _ _
end Mul
instance instAddMonoid [AddMonoid γ] [ContinuousAdd γ] : AddMonoid (α →ₘ[μ] γ) :=
toGerm_injective.addMonoid toGerm zero_toGerm add_toGerm fun _ _ => smul_toGerm _ _
instance instAddCommMonoid [AddCommMonoid γ] [ContinuousAdd γ] : AddCommMonoid (α →ₘ[μ] γ) :=
toGerm_injective.addCommMonoid toGerm zero_toGerm add_toGerm fun _ _ => smul_toGerm _ _
section Monoid
variable [Monoid γ] [ContinuousMul γ]
instance instPowNat : Pow (α →ₘ[μ] γ) ℕ :=
⟨fun f n => comp _ (continuous_pow n) f⟩
@[simp]
theorem mk_pow (f : α → γ) (hf) (n : ℕ) :
(mk f hf : α →ₘ[μ] γ) ^ n =
mk (f ^ n) ((_root_.continuous_pow n).comp_aestronglyMeasurable hf) :=
rfl
theorem coeFn_pow (f : α →ₘ[μ] γ) (n : ℕ) : ⇑(f ^ n) =ᵐ[μ] (⇑f) ^ n :=
coeFn_comp _ _ _
@[simp]
theorem pow_toGerm (f : α →ₘ[μ] γ) (n : ℕ) : (f ^ n).toGerm = f.toGerm ^ n :=
comp_toGerm _ _ _
@[to_additive existing]
instance instMonoid : Monoid (α →ₘ[μ] γ) :=
toGerm_injective.monoid toGerm one_toGerm mul_toGerm pow_toGerm
/-- `AEEqFun.toGerm` as a `MonoidHom`. -/
@[to_additive (attr := simps) "`AEEqFun.toGerm` as an `AddMonoidHom`."]
def toGermMonoidHom : (α →ₘ[μ] γ) →* (ae μ).Germ γ where
toFun := toGerm
map_one' := one_toGerm
map_mul' := mul_toGerm
end Monoid
@[to_additive existing]
instance instCommMonoid [CommMonoid γ] [ContinuousMul γ] : CommMonoid (α →ₘ[μ] γ) :=
toGerm_injective.commMonoid toGerm one_toGerm mul_toGerm pow_toGerm
section Group
variable [Group γ] [TopologicalGroup γ]
section Inv
@[to_additive]
instance instInv : Inv (α →ₘ[μ] γ) :=
⟨comp Inv.inv continuous_inv⟩
@[to_additive (attr := simp)]
theorem inv_mk (f : α → γ) (hf) : (mk f hf : α →ₘ[μ] γ)⁻¹ = mk f⁻¹ hf.inv :=
rfl
@[to_additive]
theorem coeFn_inv (f : α →ₘ[μ] γ) : ⇑f⁻¹ =ᵐ[μ] f⁻¹ :=
coeFn_comp _ _ _
@[to_additive]
theorem inv_toGerm (f : α →ₘ[μ] γ) : f⁻¹.toGerm = f.toGerm⁻¹ :=
comp_toGerm _ _ _
end Inv
section Div
@[to_additive]
instance instDiv : Div (α →ₘ[μ] γ) :=
⟨comp₂ Div.div continuous_div'⟩
@[to_additive (attr := simp, nolint simpNF)] -- Porting note: LHS does not simplify.
theorem mk_div (f g : α → γ) (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
mk (f / g) (hf.div hg) = (mk f hf : α →ₘ[μ] γ) / mk g hg :=
rfl
@[to_additive]
theorem coeFn_div (f g : α →ₘ[μ] γ) : ⇑(f / g) =ᵐ[μ] f / g :=
coeFn_comp₂ _ _ _ _
@[to_additive]
theorem div_toGerm (f g : α →ₘ[μ] γ) : (f / g).toGerm = f.toGerm / g.toGerm :=
comp₂_toGerm _ _ _ _
end Div
section ZPow
instance instPowInt : Pow (α →ₘ[μ] γ) ℤ :=
⟨fun f n => comp _ (continuous_zpow n) f⟩
@[simp]
theorem mk_zpow (f : α → γ) (hf) (n : ℤ) :
(mk f hf : α →ₘ[μ] γ) ^ n = mk (f ^ n) ((continuous_zpow n).comp_aestronglyMeasurable hf) :=
rfl
theorem coeFn_zpow (f : α →ₘ[μ] γ) (n : ℤ) : ⇑(f ^ n) =ᵐ[μ] (⇑f) ^ n :=
coeFn_comp _ _ _
@[simp]
theorem zpow_toGerm (f : α →ₘ[μ] γ) (n : ℤ) : (f ^ n).toGerm = f.toGerm ^ n :=
comp_toGerm _ _ _
end ZPow
end Group
instance instAddGroup [AddGroup γ] [TopologicalAddGroup γ] : AddGroup (α →ₘ[μ] γ) :=
toGerm_injective.addGroup toGerm zero_toGerm add_toGerm neg_toGerm sub_toGerm
(fun _ _ => smul_toGerm _ _) fun _ _ => smul_toGerm _ _
instance instAddCommGroup [AddCommGroup γ] [TopologicalAddGroup γ] : AddCommGroup (α →ₘ[μ] γ) :=
{ add_comm := add_comm }
@[to_additive existing]
instance instGroup [Group γ] [TopologicalGroup γ] : Group (α →ₘ[μ] γ) :=
toGerm_injective.group _ one_toGerm mul_toGerm inv_toGerm div_toGerm pow_toGerm zpow_toGerm
@[to_additive existing]
instance instCommGroup [CommGroup γ] [TopologicalGroup γ] : CommGroup (α →ₘ[μ] γ) :=
{ mul_comm := mul_comm }
section Module
variable {𝕜 : Type*}
instance instMulAction [Monoid 𝕜] [MulAction 𝕜 γ] [ContinuousConstSMul 𝕜 γ] :
MulAction 𝕜 (α →ₘ[μ] γ) :=
toGerm_injective.mulAction toGerm smul_toGerm
instance instDistribMulAction [Monoid 𝕜] [AddMonoid γ] [ContinuousAdd γ] [DistribMulAction 𝕜 γ]
[ContinuousConstSMul 𝕜 γ] : DistribMulAction 𝕜 (α →ₘ[μ] γ) :=
toGerm_injective.distribMulAction (toGermAddMonoidHom : (α →ₘ[μ] γ) →+ _) fun c : 𝕜 =>
smul_toGerm c
instance instModule [Semiring 𝕜] [AddCommMonoid γ] [ContinuousAdd γ] [Module 𝕜 γ]
[ContinuousConstSMul 𝕜 γ] : Module 𝕜 (α →ₘ[μ] γ) :=
toGerm_injective.module 𝕜 (toGermAddMonoidHom : (α →ₘ[μ] γ) →+ _) smul_toGerm
end Module
open ENNReal
/-- For `f : α → ℝ≥0∞`, define `∫ [f]` to be `∫ f` -/
def lintegral (f : α →ₘ[μ] ℝ≥0∞) : ℝ≥0∞ :=
Quotient.liftOn' f (fun f => ∫⁻ a, (f : α → ℝ≥0∞) a ∂μ) fun _ _ => lintegral_congr_ae
@[simp]
theorem lintegral_mk (f : α → ℝ≥0∞) (hf) : (mk f hf : α →ₘ[μ] ℝ≥0∞).lintegral = ∫⁻ a, f a ∂μ :=
rfl
theorem lintegral_coeFn (f : α →ₘ[μ] ℝ≥0∞) : ∫⁻ a, f a ∂μ = f.lintegral := by
rw [← lintegral_mk, mk_coeFn]
@[simp]
nonrec theorem lintegral_zero : lintegral (0 : α →ₘ[μ] ℝ≥0∞) = 0 :=
lintegral_zero
@[simp]
theorem lintegral_eq_zero_iff {f : α →ₘ[μ] ℝ≥0∞} : lintegral f = 0 ↔ f = 0 :=
induction_on f fun _f hf => (lintegral_eq_zero_iff' hf.aemeasurable).trans mk_eq_mk.symm
theorem lintegral_add (f g : α →ₘ[μ] ℝ≥0∞) : lintegral (f + g) = lintegral f + lintegral g :=
induction_on₂ f g fun f hf g _ => by simp [lintegral_add_left' hf.aemeasurable]
theorem lintegral_mono {f g : α →ₘ[μ] ℝ≥0∞} : f ≤ g → lintegral f ≤ lintegral g :=
induction_on₂ f g fun _f _ _g _ hfg => lintegral_mono_ae hfg
section Abs
theorem coeFn_abs {β} [TopologicalSpace β] [Lattice β] [TopologicalLattice β] [AddGroup β]
[TopologicalAddGroup β] (f : α →ₘ[μ] β) : ⇑|f| =ᵐ[μ] fun x => |f x| := by
simp_rw [abs]
filter_upwards [AEEqFun.coeFn_sup f (-f), AEEqFun.coeFn_neg f] with x hx_sup hx_neg
rw [hx_sup, hx_neg, Pi.neg_apply]
end Abs
section PosPart
variable [LinearOrder γ] [OrderClosedTopology γ] [Zero γ]
/-- Positive part of an `AEEqFun`. -/
def posPart (f : α →ₘ[μ] γ) : α →ₘ[μ] γ :=
comp (fun x => max x 0) (continuous_id.max continuous_const) f
@[simp]
theorem posPart_mk (f : α → γ) (hf) :
posPart (mk f hf : α →ₘ[μ] γ) =
mk (fun x => max (f x) 0)
((continuous_id.max continuous_const).comp_aestronglyMeasurable hf) :=
rfl
theorem coeFn_posPart (f : α →ₘ[μ] γ) : ⇑(posPart f) =ᵐ[μ] fun a => max (f a) 0 :=
coeFn_comp _ _ _
end PosPart
end AEEqFun
end MeasureTheory
namespace ContinuousMap
open MeasureTheory
variable [TopologicalSpace α] [BorelSpace α] (μ)
variable [TopologicalSpace β] [SecondCountableTopologyEither α β] [PseudoMetrizableSpace β]
/-- The equivalence class of `μ`-almost-everywhere measurable functions associated to a continuous
map. -/
def toAEEqFun (f : C(α, β)) : α →ₘ[μ] β :=
AEEqFun.mk f f.continuous.aestronglyMeasurable
theorem coeFn_toAEEqFun (f : C(α, β)) : f.toAEEqFun μ =ᵐ[μ] f :=
AEEqFun.coeFn_mk f _
variable [Group β] [TopologicalGroup β]
/-- The `MulHom` from the group of continuous maps from `α` to `β` to the group of equivalence
classes of `μ`-almost-everywhere measurable functions. -/
@[to_additive "The `AddHom` from the group of continuous maps from `α` to `β` to the group of
equivalence classes of `μ`-almost-everywhere measurable functions."]
def toAEEqFunMulHom : C(α, β) →* α →ₘ[μ] β where
toFun := ContinuousMap.toAEEqFun μ
map_one' := rfl
map_mul' f g :=
AEEqFun.mk_mul_mk _ _ f.continuous.aestronglyMeasurable g.continuous.aestronglyMeasurable
variable {𝕜 : Type*} [Semiring 𝕜]
variable [TopologicalSpace γ] [PseudoMetrizableSpace γ] [AddCommGroup γ] [Module 𝕜 γ]
[TopologicalAddGroup γ] [ContinuousConstSMul 𝕜 γ] [SecondCountableTopologyEither α γ]
/-- The linear map from the group of continuous maps from `α` to `β` to the group of equivalence
classes of `μ`-almost-everywhere measurable functions. -/
def toAEEqFunLinearMap : C(α, γ) →ₗ[𝕜] α →ₘ[μ] γ :=
{ toAEEqFunAddHom μ with
map_smul' := fun c f => AEEqFun.smul_mk c f f.continuous.aestronglyMeasurable }
end ContinuousMap
-- Guard against import creep
assert_not_exists InnerProductSpace
|
MeasureTheory\Function\AEEqOfIntegral.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Analysis.InnerProductSpace.Basic
import Mathlib.Analysis.Normed.Module.Dual
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.Order.Filter.Ring
/-! # From equality of integrals to equality of functions
This file provides various statements of the general form "if two functions have the same integral
on all sets, then they are equal almost everywhere".
The different lemmas use various hypotheses on the class of functions, on the target space or on the
possible finiteness of the measure.
## Main statements
All results listed below apply to two functions `f, g`, together with two main hypotheses,
* `f` and `g` are integrable on all measurable sets with finite measure,
* for all measurable sets `s` with finite measure, `∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ`.
The conclusion is then `f =ᵐ[μ] g`. The main lemmas are:
* `ae_eq_of_forall_setIntegral_eq_of_sigmaFinite`: case of a sigma-finite measure.
* `AEFinStronglyMeasurable.ae_eq_of_forall_setIntegral_eq`: for functions which are
`AEFinStronglyMeasurable`.
* `Lp.ae_eq_of_forall_setIntegral_eq`: for elements of `Lp`, for `0 < p < ∞`.
* `Integrable.ae_eq_of_forall_setIntegral_eq`: for integrable functions.
For each of these results, we also provide a lemma about the equality of one function and 0. For
example, `Lp.ae_eq_zero_of_forall_setIntegral_eq_zero`.
We also register the corresponding lemma for integrals of `ℝ≥0∞`-valued functions, in
`ae_eq_of_forall_setLIntegral_eq_of_sigmaFinite`.
Generally useful lemmas which are not related to integrals:
* `ae_eq_zero_of_forall_inner`: if for all constants `c`, `fun x => inner c (f x) =ᵐ[μ] 0` then
`f =ᵐ[μ] 0`.
* `ae_eq_zero_of_forall_dual`: if for all constants `c` in the dual space,
`fun x => c (f x) =ᵐ[μ] 0` then `f =ᵐ[μ] 0`.
-/
open MeasureTheory TopologicalSpace NormedSpace Filter
open scoped ENNReal NNReal MeasureTheory Topology
namespace MeasureTheory
section AeEqOfForall
variable {α E 𝕜 : Type*} {m : MeasurableSpace α} {μ : Measure α} [RCLike 𝕜]
theorem ae_eq_zero_of_forall_inner [NormedAddCommGroup E] [InnerProductSpace 𝕜 E]
[SecondCountableTopology E] {f : α → E} (hf : ∀ c : E, (fun x => (inner c (f x) : 𝕜)) =ᵐ[μ] 0) :
f =ᵐ[μ] 0 := by
let s := denseSeq E
have hs : DenseRange s := denseRange_denseSeq E
have hf' : ∀ᵐ x ∂μ, ∀ n : ℕ, inner (s n) (f x) = (0 : 𝕜) := ae_all_iff.mpr fun n => hf (s n)
refine hf'.mono fun x hx => ?_
rw [Pi.zero_apply, ← @inner_self_eq_zero 𝕜]
have h_closed : IsClosed {c : E | inner c (f x) = (0 : 𝕜)} :=
isClosed_eq (continuous_id.inner continuous_const) continuous_const
exact @isClosed_property ℕ E _ s (fun c => inner c (f x) = (0 : 𝕜)) hs h_closed (fun n => hx n) _
local notation "⟪" x ", " y "⟫" => y x
variable (𝕜)
theorem ae_eq_zero_of_forall_dual_of_isSeparable [NormedAddCommGroup E] [NormedSpace 𝕜 E]
{t : Set E} (ht : TopologicalSpace.IsSeparable t) {f : α → E}
(hf : ∀ c : Dual 𝕜 E, (fun x => ⟪f x, c⟫) =ᵐ[μ] 0) (h't : ∀ᵐ x ∂μ, f x ∈ t) : f =ᵐ[μ] 0 := by
rcases ht with ⟨d, d_count, hd⟩
haveI : Encodable d := d_count.toEncodable
have : ∀ x : d, ∃ g : E →L[𝕜] 𝕜, ‖g‖ ≤ 1 ∧ g x = ‖(x : E)‖ :=
fun x => exists_dual_vector'' 𝕜 (x : E)
choose s hs using this
have A : ∀ a : E, a ∈ t → (∀ x, ⟪a, s x⟫ = (0 : 𝕜)) → a = 0 := by
intro a hat ha
contrapose! ha
have a_pos : 0 < ‖a‖ := by simp only [ha, norm_pos_iff, Ne, not_false_iff]
have a_mem : a ∈ closure d := hd hat
obtain ⟨x, hx⟩ : ∃ x : d, dist a x < ‖a‖ / 2 := by
rcases Metric.mem_closure_iff.1 a_mem (‖a‖ / 2) (half_pos a_pos) with ⟨x, h'x, hx⟩
exact ⟨⟨x, h'x⟩, hx⟩
use x
have I : ‖a‖ / 2 < ‖(x : E)‖ := by
have : ‖a‖ ≤ ‖(x : E)‖ + ‖a - x‖ := norm_le_insert' _ _
have : ‖a - x‖ < ‖a‖ / 2 := by rwa [dist_eq_norm] at hx
linarith
intro h
apply lt_irrefl ‖s x x‖
calc
‖s x x‖ = ‖s x (x - a)‖ := by simp only [h, sub_zero, ContinuousLinearMap.map_sub]
_ ≤ 1 * ‖(x : E) - a‖ := ContinuousLinearMap.le_of_opNorm_le _ (hs x).1 _
_ < ‖a‖ / 2 := by rw [one_mul]; rwa [dist_eq_norm'] at hx
_ < ‖(x : E)‖ := I
_ = ‖s x x‖ := by rw [(hs x).2, RCLike.norm_coe_norm]
have hfs : ∀ y : d, ∀ᵐ x ∂μ, ⟪f x, s y⟫ = (0 : 𝕜) := fun y => hf (s y)
have hf' : ∀ᵐ x ∂μ, ∀ y : d, ⟪f x, s y⟫ = (0 : 𝕜) := by rwa [ae_all_iff]
filter_upwards [hf', h't] with x hx h'x
exact A (f x) h'x hx
theorem ae_eq_zero_of_forall_dual [NormedAddCommGroup E] [NormedSpace 𝕜 E]
[SecondCountableTopology E] {f : α → E} (hf : ∀ c : Dual 𝕜 E, (fun x => ⟪f x, c⟫) =ᵐ[μ] 0) :
f =ᵐ[μ] 0 :=
ae_eq_zero_of_forall_dual_of_isSeparable 𝕜 (.of_separableSpace Set.univ) hf
(eventually_of_forall fun _ => Set.mem_univ _)
variable {𝕜}
end AeEqOfForall
variable {α E : Type*} {m m0 : MeasurableSpace α} {μ : Measure α} {s t : Set α}
[NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {p : ℝ≥0∞}
section AeEqOfForallSetIntegralEq
theorem ae_const_le_iff_forall_lt_measure_zero {β} [LinearOrder β] [TopologicalSpace β]
[OrderTopology β] [FirstCountableTopology β] (f : α → β) (c : β) :
(∀ᵐ x ∂μ, c ≤ f x) ↔ ∀ b < c, μ {x | f x ≤ b} = 0 := by
rw [ae_iff]
push_neg
constructor
· intro h b hb
exact measure_mono_null (fun y hy => (lt_of_le_of_lt hy hb : _)) h
intro hc
by_cases h : ∀ b, c ≤ b
· have : {a : α | f a < c} = ∅ := by
apply Set.eq_empty_iff_forall_not_mem.2 fun x hx => ?_
exact (lt_irrefl _ (lt_of_lt_of_le hx (h (f x)))).elim
simp [this]
by_cases H : ¬IsLUB (Set.Iio c) c
· have : c ∈ upperBounds (Set.Iio c) := fun y hy => le_of_lt hy
obtain ⟨b, b_up, bc⟩ : ∃ b : β, b ∈ upperBounds (Set.Iio c) ∧ b < c := by
simpa [IsLUB, IsLeast, this, lowerBounds] using H
exact measure_mono_null (fun x hx => b_up hx) (hc b bc)
push_neg at H h
obtain ⟨u, _, u_lt, u_lim, -⟩ :
∃ u : ℕ → β,
StrictMono u ∧ (∀ n : ℕ, u n < c) ∧ Tendsto u atTop (𝓝 c) ∧ ∀ n : ℕ, u n ∈ Set.Iio c :=
H.exists_seq_strictMono_tendsto_of_not_mem (lt_irrefl c) h
have h_Union : {x | f x < c} = ⋃ n : ℕ, {x | f x ≤ u n} := by
ext1 x
simp_rw [Set.mem_iUnion, Set.mem_setOf_eq]
constructor <;> intro h
· obtain ⟨n, hn⟩ := ((tendsto_order.1 u_lim).1 _ h).exists; exact ⟨n, hn.le⟩
· obtain ⟨n, hn⟩ := h; exact hn.trans_lt (u_lt _)
rw [h_Union, measure_iUnion_null_iff]
intro n
exact hc _ (u_lt n)
section ENNReal
open scoped Topology
theorem ae_le_of_forall_setLIntegral_le_of_sigmaFinite₀ [SigmaFinite μ]
{f g : α → ℝ≥0∞} (hf : AEMeasurable f μ)
(h : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in s, g x ∂μ) :
f ≤ᵐ[μ] g := by
have A : ∀ (ε N : ℝ≥0) (p : ℕ), 0 < ε →
μ ({x | g x + ε ≤ f x ∧ g x ≤ N} ∩ spanningSets μ p) = 0 := by
intro ε N p εpos
let s := {x | g x + ε ≤ f x ∧ g x ≤ N} ∩ spanningSets μ p
have s_lt_top : μ s < ∞ :=
(measure_mono (Set.inter_subset_right)).trans_lt (measure_spanningSets_lt_top μ p)
have A : (∫⁻ x in s, g x ∂μ) + ε * μ s ≤ (∫⁻ x in s, g x ∂μ) + 0 :=
calc
(∫⁻ x in s, g x ∂μ) + ε * μ s = (∫⁻ x in s, g x ∂μ) + ∫⁻ _ in s, ε ∂μ := by
simp only [lintegral_const, Set.univ_inter, MeasurableSet.univ, Measure.restrict_apply]
_ = ∫⁻ x in s, g x + ε ∂μ := (lintegral_add_right _ measurable_const).symm
_ ≤ ∫⁻ x in s, f x ∂μ :=
setLIntegral_mono_ae hf.restrict <| ae_of_all _ fun x hx => hx.1.1
_ ≤ (∫⁻ x in s, g x ∂μ) + 0 := by
rw [add_zero, ← Measure.restrict_toMeasurable s_lt_top.ne]
refine h _ (measurableSet_toMeasurable ..) ?_
rwa [measure_toMeasurable]
have B : (∫⁻ x in s, g x ∂μ) ≠ ∞ :=
(setLIntegral_lt_top_of_le_nnreal s_lt_top.ne ⟨N, fun _ h ↦ h.1.2⟩).ne
have : (ε : ℝ≥0∞) * μ s ≤ 0 := ENNReal.le_of_add_le_add_left B A
simpa only [ENNReal.coe_eq_zero, nonpos_iff_eq_zero, mul_eq_zero, εpos.ne', false_or_iff]
obtain ⟨u, _, u_pos, u_lim⟩ :
∃ u : ℕ → ℝ≥0, StrictAnti u ∧ (∀ n, 0 < u n) ∧ Tendsto u atTop (𝓝 0) :=
exists_seq_strictAnti_tendsto (0 : ℝ≥0)
let s := fun n : ℕ => {x | g x + u n ≤ f x ∧ g x ≤ (n : ℝ≥0)} ∩ spanningSets μ n
have μs : ∀ n, μ (s n) = 0 := fun n => A _ _ _ (u_pos n)
have B : {x | f x ≤ g x}ᶜ ⊆ ⋃ n, s n := by
intro x hx
simp only [Set.mem_compl_iff, Set.mem_setOf, not_le] at hx
have L1 : ∀ᶠ n in atTop, g x + u n ≤ f x := by
have : Tendsto (fun n => g x + u n) atTop (𝓝 (g x + (0 : ℝ≥0))) :=
tendsto_const_nhds.add (ENNReal.tendsto_coe.2 u_lim)
simp only [ENNReal.coe_zero, add_zero] at this
exact eventually_le_of_tendsto_lt hx this
have L2 : ∀ᶠ n : ℕ in (atTop : Filter ℕ), g x ≤ (n : ℝ≥0) :=
haveI : Tendsto (fun n : ℕ => ((n : ℝ≥0) : ℝ≥0∞)) atTop (𝓝 ∞) := by
simp only [ENNReal.coe_natCast]
exact ENNReal.tendsto_nat_nhds_top
eventually_ge_of_tendsto_gt (hx.trans_le le_top) this
apply Set.mem_iUnion.2
exact ((L1.and L2).and (eventually_mem_spanningSets μ x)).exists
refine le_antisymm ?_ bot_le
calc
μ {x : α | (fun x : α => f x ≤ g x) x}ᶜ ≤ μ (⋃ n, s n) := measure_mono B
_ ≤ ∑' n, μ (s n) := measure_iUnion_le _
_ = 0 := by simp only [μs, tsum_zero]
@[deprecated (since := "2024-06-29")]
alias ae_le_of_forall_set_lintegral_le_of_sigmaFinite₀ :=
ae_le_of_forall_setLIntegral_le_of_sigmaFinite₀
theorem ae_le_of_forall_setLIntegral_le_of_sigmaFinite [SigmaFinite μ] {f g : α → ℝ≥0∞}
(hf : Measurable f)
(h : ∀ s, MeasurableSet s → μ s < ∞ → (∫⁻ x in s, f x ∂μ) ≤ ∫⁻ x in s, g x ∂μ) : f ≤ᵐ[μ] g :=
ae_le_of_forall_setLIntegral_le_of_sigmaFinite₀ hf.aemeasurable h
@[deprecated (since := "2024-06-29")]
alias ae_le_of_forall_set_lintegral_le_of_sigmaFinite :=
ae_le_of_forall_setLIntegral_le_of_sigmaFinite
theorem ae_eq_of_forall_setLIntegral_eq_of_sigmaFinite₀ [SigmaFinite μ]
{f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
(h : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ = ∫⁻ x in s, g x ∂μ) : f =ᵐ[μ] g := by
have A : f ≤ᵐ[μ] g :=
ae_le_of_forall_setLIntegral_le_of_sigmaFinite₀ hf fun s hs h's => le_of_eq (h s hs h's)
have B : g ≤ᵐ[μ] f :=
ae_le_of_forall_setLIntegral_le_of_sigmaFinite₀ hg fun s hs h's => ge_of_eq (h s hs h's)
filter_upwards [A, B] with x using le_antisymm
@[deprecated (since := "2024-06-29")]
alias ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite₀ :=
ae_eq_of_forall_setLIntegral_eq_of_sigmaFinite₀
theorem ae_eq_of_forall_setLIntegral_eq_of_sigmaFinite [SigmaFinite μ] {f g : α → ℝ≥0∞}
(hf : Measurable f) (hg : Measurable g)
(h : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ = ∫⁻ x in s, g x ∂μ) : f =ᵐ[μ] g :=
ae_eq_of_forall_setLIntegral_eq_of_sigmaFinite₀ hf.aemeasurable hg.aemeasurable h
@[deprecated (since := "2024-06-29")]
alias ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite :=
ae_eq_of_forall_setLIntegral_eq_of_sigmaFinite
end ENNReal
section Real
variable {f : α → ℝ}
theorem ae_nonneg_of_forall_setIntegral_nonneg (hf : Integrable f μ)
(hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) : 0 ≤ᵐ[μ] f := by
simp_rw [EventuallyLE, Pi.zero_apply]
rw [ae_const_le_iff_forall_lt_measure_zero]
intro b hb_neg
let s := {x | f x ≤ b}
have hs : NullMeasurableSet s μ := nullMeasurableSet_le hf.1.aemeasurable aemeasurable_const
have mus : μ s < ∞ := Integrable.measure_le_lt_top hf hb_neg
have h_int_gt : (∫ x in s, f x ∂μ) ≤ b * (μ s).toReal := by
have h_const_le : (∫ x in s, f x ∂μ) ≤ ∫ _ in s, b ∂μ := by
refine setIntegral_mono_ae_restrict hf.integrableOn (integrableOn_const.mpr (Or.inr mus)) ?_
rw [EventuallyLE, ae_restrict_iff₀ (hs.mono μ.restrict_le_self)]
exact eventually_of_forall fun x hxs => hxs
rwa [setIntegral_const, smul_eq_mul, mul_comm] at h_const_le
contrapose! h_int_gt with H
calc
b * (μ s).toReal < 0 := mul_neg_of_neg_of_pos hb_neg <| ENNReal.toReal_pos H mus.ne
_ ≤ ∫ x in s, f x ∂μ := by
rw [← μ.restrict_toMeasurable mus.ne]
exact hf_zero _ (measurableSet_toMeasurable ..) (by rwa [measure_toMeasurable])
@[deprecated (since := "2024-04-17")]
alias ae_nonneg_of_forall_set_integral_nonneg_of_stronglyMeasurable :=
ae_nonneg_of_forall_setIntegral_nonneg
@[deprecated (since := "2024-07-12")]
alias ae_nonneg_of_forall_setIntegral_nonneg_of_stronglyMeasurable :=
ae_nonneg_of_forall_setIntegral_nonneg
@[deprecated (since := "2024-04-17")]
alias ae_nonneg_of_forall_set_integral_nonneg :=
ae_nonneg_of_forall_setIntegral_nonneg
theorem ae_le_of_forall_setIntegral_le {f g : α → ℝ} (hf : Integrable f μ) (hg : Integrable g μ)
(hf_le : ∀ s, MeasurableSet s → μ s < ∞ → (∫ x in s, f x ∂μ) ≤ ∫ x in s, g x ∂μ) :
f ≤ᵐ[μ] g := by
rw [← eventually_sub_nonneg]
refine ae_nonneg_of_forall_setIntegral_nonneg (hg.sub hf) fun s hs => ?_
rw [integral_sub' hg.integrableOn hf.integrableOn, sub_nonneg]
exact hf_le s hs
@[deprecated (since := "2024-04-17")]
alias ae_le_of_forall_set_integral_le := ae_le_of_forall_setIntegral_le
theorem ae_nonneg_restrict_of_forall_setIntegral_nonneg_inter {f : α → ℝ} {t : Set α}
(hf : IntegrableOn f t μ)
(hf_zero : ∀ s, MeasurableSet s → μ (s ∩ t) < ∞ → 0 ≤ ∫ x in s ∩ t, f x ∂μ) :
0 ≤ᵐ[μ.restrict t] f := by
refine ae_nonneg_of_forall_setIntegral_nonneg hf fun s hs h's => ?_
simp_rw [Measure.restrict_restrict hs]
apply hf_zero s hs
rwa [Measure.restrict_apply hs] at h's
@[deprecated (since := "2024-04-17")]
alias ae_nonneg_restrict_of_forall_set_integral_nonneg_inter :=
ae_nonneg_restrict_of_forall_setIntegral_nonneg_inter
theorem ae_nonneg_of_forall_setIntegral_nonneg_of_sigmaFinite [SigmaFinite μ] {f : α → ℝ}
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) : 0 ≤ᵐ[μ] f := by
apply ae_of_forall_measure_lt_top_ae_restrict
intro t t_meas t_lt_top
apply ae_nonneg_restrict_of_forall_setIntegral_nonneg_inter (hf_int_finite t t_meas t_lt_top)
intro s s_meas _
exact
hf_zero _ (s_meas.inter t_meas)
(lt_of_le_of_lt (measure_mono (Set.inter_subset_right)) t_lt_top)
@[deprecated (since := "2024-04-17")]
alias ae_nonneg_of_forall_set_integral_nonneg_of_sigmaFinite :=
ae_nonneg_of_forall_setIntegral_nonneg_of_sigmaFinite
theorem AEFinStronglyMeasurable.ae_nonneg_of_forall_setIntegral_nonneg {f : α → ℝ}
(hf : AEFinStronglyMeasurable f μ)
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) : 0 ≤ᵐ[μ] f := by
let t := hf.sigmaFiniteSet
suffices 0 ≤ᵐ[μ.restrict t] f from
ae_of_ae_restrict_of_ae_restrict_compl _ this hf.ae_eq_zero_compl.symm.le
haveI : SigmaFinite (μ.restrict t) := hf.sigmaFinite_restrict
refine
ae_nonneg_of_forall_setIntegral_nonneg_of_sigmaFinite (fun s hs hμts => ?_) fun s hs hμts => ?_
· rw [IntegrableOn, Measure.restrict_restrict hs]
rw [Measure.restrict_apply hs] at hμts
exact hf_int_finite (s ∩ t) (hs.inter hf.measurableSet) hμts
· rw [Measure.restrict_restrict hs]
rw [Measure.restrict_apply hs] at hμts
exact hf_zero (s ∩ t) (hs.inter hf.measurableSet) hμts
@[deprecated (since := "2024-04-17")]
alias AEFinStronglyMeasurable.ae_nonneg_of_forall_set_integral_nonneg :=
AEFinStronglyMeasurable.ae_nonneg_of_forall_setIntegral_nonneg
theorem ae_nonneg_restrict_of_forall_setIntegral_nonneg {f : α → ℝ}
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) {t : Set α}
(ht : MeasurableSet t) (hμt : μ t ≠ ∞) : 0 ≤ᵐ[μ.restrict t] f := by
refine
ae_nonneg_restrict_of_forall_setIntegral_nonneg_inter
(hf_int_finite t ht (lt_top_iff_ne_top.mpr hμt)) fun s hs _ => ?_
refine hf_zero (s ∩ t) (hs.inter ht) ?_
exact (measure_mono Set.inter_subset_right).trans_lt (lt_top_iff_ne_top.mpr hμt)
@[deprecated (since := "2024-04-17")]
alias ae_nonneg_restrict_of_forall_set_integral_nonneg :=
ae_nonneg_restrict_of_forall_setIntegral_nonneg
theorem ae_eq_zero_restrict_of_forall_setIntegral_eq_zero_real {f : α → ℝ}
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = 0) {t : Set α}
(ht : MeasurableSet t) (hμt : μ t ≠ ∞) : f =ᵐ[μ.restrict t] 0 := by
suffices h_and : f ≤ᵐ[μ.restrict t] 0 ∧ 0 ≤ᵐ[μ.restrict t] f from
h_and.1.mp (h_and.2.mono fun x hx1 hx2 => le_antisymm hx2 hx1)
refine
⟨?_,
ae_nonneg_restrict_of_forall_setIntegral_nonneg hf_int_finite
(fun s hs hμs => (hf_zero s hs hμs).symm.le) ht hμt⟩
suffices h_neg : 0 ≤ᵐ[μ.restrict t] -f by
refine h_neg.mono fun x hx => ?_
rw [Pi.neg_apply] at hx
simpa using hx
refine
ae_nonneg_restrict_of_forall_setIntegral_nonneg (fun s hs hμs => (hf_int_finite s hs hμs).neg)
(fun s hs hμs => ?_) ht hμt
simp_rw [Pi.neg_apply]
rw [integral_neg, neg_nonneg]
exact (hf_zero s hs hμs).le
@[deprecated (since := "2024-04-17")]
alias ae_eq_zero_restrict_of_forall_set_integral_eq_zero_real :=
ae_eq_zero_restrict_of_forall_setIntegral_eq_zero_real
end Real
theorem ae_eq_zero_restrict_of_forall_setIntegral_eq_zero {f : α → E}
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = 0) {t : Set α}
(ht : MeasurableSet t) (hμt : μ t ≠ ∞) : f =ᵐ[μ.restrict t] 0 := by
rcases (hf_int_finite t ht hμt.lt_top).aestronglyMeasurable.isSeparable_ae_range with
⟨u, u_sep, hu⟩
refine ae_eq_zero_of_forall_dual_of_isSeparable ℝ u_sep (fun c => ?_) hu
refine ae_eq_zero_restrict_of_forall_setIntegral_eq_zero_real ?_ ?_ ht hμt
· intro s hs hμs
exact ContinuousLinearMap.integrable_comp c (hf_int_finite s hs hμs)
· intro s hs hμs
rw [ContinuousLinearMap.integral_comp_comm c (hf_int_finite s hs hμs), hf_zero s hs hμs]
exact ContinuousLinearMap.map_zero _
@[deprecated (since := "2024-04-17")]
alias ae_eq_zero_restrict_of_forall_set_integral_eq_zero :=
ae_eq_zero_restrict_of_forall_setIntegral_eq_zero
theorem ae_eq_restrict_of_forall_setIntegral_eq {f g : α → E}
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hg_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn g s μ)
(hfg_zero : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ)
{t : Set α} (ht : MeasurableSet t) (hμt : μ t ≠ ∞) : f =ᵐ[μ.restrict t] g := by
rw [← sub_ae_eq_zero]
have hfg' : ∀ s : Set α, MeasurableSet s → μ s < ∞ → (∫ x in s, (f - g) x ∂μ) = 0 := by
intro s hs hμs
rw [integral_sub' (hf_int_finite s hs hμs) (hg_int_finite s hs hμs)]
exact sub_eq_zero.mpr (hfg_zero s hs hμs)
have hfg_int : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn (f - g) s μ := fun s hs hμs =>
(hf_int_finite s hs hμs).sub (hg_int_finite s hs hμs)
exact ae_eq_zero_restrict_of_forall_setIntegral_eq_zero hfg_int hfg' ht hμt
@[deprecated (since := "2024-04-17")]
alias ae_eq_restrict_of_forall_set_integral_eq :=
ae_eq_restrict_of_forall_setIntegral_eq
theorem ae_eq_zero_of_forall_setIntegral_eq_of_sigmaFinite [SigmaFinite μ] {f : α → E}
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = 0) : f =ᵐ[μ] 0 := by
let S := spanningSets μ
rw [← @Measure.restrict_univ _ _ μ, ← iUnion_spanningSets μ, EventuallyEq, ae_iff,
Measure.restrict_apply' (MeasurableSet.iUnion (measurable_spanningSets μ))]
rw [Set.inter_iUnion, measure_iUnion_null_iff]
intro n
have h_meas_n : MeasurableSet (S n) := measurable_spanningSets μ n
have hμn : μ (S n) < ∞ := measure_spanningSets_lt_top μ n
rw [← Measure.restrict_apply' h_meas_n]
exact ae_eq_zero_restrict_of_forall_setIntegral_eq_zero hf_int_finite hf_zero h_meas_n hμn.ne
@[deprecated (since := "2024-04-17")]
alias ae_eq_zero_of_forall_set_integral_eq_of_sigmaFinite :=
ae_eq_zero_of_forall_setIntegral_eq_of_sigmaFinite
theorem ae_eq_of_forall_setIntegral_eq_of_sigmaFinite [SigmaFinite μ] {f g : α → E}
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hg_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn g s μ)
(hfg_eq : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ) :
f =ᵐ[μ] g := by
rw [← sub_ae_eq_zero]
have hfg : ∀ s : Set α, MeasurableSet s → μ s < ∞ → (∫ x in s, (f - g) x ∂μ) = 0 := by
intro s hs hμs
rw [integral_sub' (hf_int_finite s hs hμs) (hg_int_finite s hs hμs),
sub_eq_zero.mpr (hfg_eq s hs hμs)]
have hfg_int : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn (f - g) s μ := fun s hs hμs =>
(hf_int_finite s hs hμs).sub (hg_int_finite s hs hμs)
exact ae_eq_zero_of_forall_setIntegral_eq_of_sigmaFinite hfg_int hfg
@[deprecated (since := "2024-04-17")]
alias ae_eq_of_forall_set_integral_eq_of_sigmaFinite :=
ae_eq_of_forall_setIntegral_eq_of_sigmaFinite
theorem AEFinStronglyMeasurable.ae_eq_zero_of_forall_setIntegral_eq_zero {f : α → E}
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = 0)
(hf : AEFinStronglyMeasurable f μ) : f =ᵐ[μ] 0 := by
let t := hf.sigmaFiniteSet
suffices f =ᵐ[μ.restrict t] 0 from
ae_of_ae_restrict_of_ae_restrict_compl _ this hf.ae_eq_zero_compl
haveI : SigmaFinite (μ.restrict t) := hf.sigmaFinite_restrict
refine ae_eq_zero_of_forall_setIntegral_eq_of_sigmaFinite ?_ ?_
· intro s hs hμs
rw [IntegrableOn, Measure.restrict_restrict hs]
rw [Measure.restrict_apply hs] at hμs
exact hf_int_finite _ (hs.inter hf.measurableSet) hμs
· intro s hs hμs
rw [Measure.restrict_restrict hs]
rw [Measure.restrict_apply hs] at hμs
exact hf_zero _ (hs.inter hf.measurableSet) hμs
@[deprecated (since := "2024-04-17")]
alias AEFinStronglyMeasurable.ae_eq_zero_of_forall_set_integral_eq_zero :=
AEFinStronglyMeasurable.ae_eq_zero_of_forall_setIntegral_eq_zero
theorem AEFinStronglyMeasurable.ae_eq_of_forall_setIntegral_eq {f g : α → E}
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hg_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn g s μ)
(hfg_eq : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ)
(hf : AEFinStronglyMeasurable f μ) (hg : AEFinStronglyMeasurable g μ) : f =ᵐ[μ] g := by
rw [← sub_ae_eq_zero]
have hfg : ∀ s : Set α, MeasurableSet s → μ s < ∞ → (∫ x in s, (f - g) x ∂μ) = 0 := by
intro s hs hμs
rw [integral_sub' (hf_int_finite s hs hμs) (hg_int_finite s hs hμs),
sub_eq_zero.mpr (hfg_eq s hs hμs)]
have hfg_int : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn (f - g) s μ := fun s hs hμs =>
(hf_int_finite s hs hμs).sub (hg_int_finite s hs hμs)
exact (hf.sub hg).ae_eq_zero_of_forall_setIntegral_eq_zero hfg_int hfg
@[deprecated (since := "2024-04-17")]
alias AEFinStronglyMeasurable.ae_eq_of_forall_set_integral_eq :=
AEFinStronglyMeasurable.ae_eq_of_forall_setIntegral_eq
theorem Lp.ae_eq_zero_of_forall_setIntegral_eq_zero (f : Lp E p μ) (hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ∞) (hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = 0) : f =ᵐ[μ] 0 :=
AEFinStronglyMeasurable.ae_eq_zero_of_forall_setIntegral_eq_zero hf_int_finite hf_zero
(Lp.finStronglyMeasurable _ hp_ne_zero hp_ne_top).aefinStronglyMeasurable
@[deprecated (since := "2024-04-17")]
alias Lp.ae_eq_zero_of_forall_set_integral_eq_zero :=
Lp.ae_eq_zero_of_forall_setIntegral_eq_zero
theorem Lp.ae_eq_of_forall_setIntegral_eq (f g : Lp E p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
(hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
(hg_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn g s μ)
(hfg : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ) :
f =ᵐ[μ] g :=
AEFinStronglyMeasurable.ae_eq_of_forall_setIntegral_eq hf_int_finite hg_int_finite hfg
(Lp.finStronglyMeasurable _ hp_ne_zero hp_ne_top).aefinStronglyMeasurable
(Lp.finStronglyMeasurable _ hp_ne_zero hp_ne_top).aefinStronglyMeasurable
@[deprecated (since := "2024-04-17")]
alias Lp.ae_eq_of_forall_set_integral_eq := Lp.ae_eq_of_forall_setIntegral_eq
theorem ae_eq_zero_of_forall_setIntegral_eq_of_finStronglyMeasurable_trim (hm : m ≤ m0) {f : α → E}
(hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, f x ∂μ = 0)
(hf : FinStronglyMeasurable f (μ.trim hm)) : f =ᵐ[μ] 0 := by
obtain ⟨t, ht_meas, htf_zero, htμ⟩ := hf.exists_set_sigmaFinite
haveI : SigmaFinite ((μ.restrict t).trim hm) := by rwa [restrict_trim hm μ ht_meas] at htμ
have htf_zero : f =ᵐ[μ.restrict tᶜ] 0 := by
rw [EventuallyEq, ae_restrict_iff' (MeasurableSet.compl (hm _ ht_meas))]
exact eventually_of_forall htf_zero
have hf_meas_m : StronglyMeasurable[m] f := hf.stronglyMeasurable
suffices f =ᵐ[μ.restrict t] 0 from
ae_of_ae_restrict_of_ae_restrict_compl _ this htf_zero
refine measure_eq_zero_of_trim_eq_zero hm ?_
refine ae_eq_zero_of_forall_setIntegral_eq_of_sigmaFinite ?_ ?_
· intro s hs hμs
unfold IntegrableOn
rw [restrict_trim hm (μ.restrict t) hs, Measure.restrict_restrict (hm s hs)]
rw [← restrict_trim hm μ ht_meas, Measure.restrict_apply hs,
trim_measurableSet_eq hm (hs.inter ht_meas)] at hμs
refine Integrable.trim hm ?_ hf_meas_m
exact hf_int_finite _ (hs.inter ht_meas) hμs
· intro s hs hμs
rw [restrict_trim hm (μ.restrict t) hs, Measure.restrict_restrict (hm s hs)]
rw [← restrict_trim hm μ ht_meas, Measure.restrict_apply hs,
trim_measurableSet_eq hm (hs.inter ht_meas)] at hμs
rw [← integral_trim hm hf_meas_m]
exact hf_zero _ (hs.inter ht_meas) hμs
@[deprecated (since := "2024-04-17")]
alias ae_eq_zero_of_forall_set_integral_eq_of_finStronglyMeasurable_trim :=
ae_eq_zero_of_forall_setIntegral_eq_of_finStronglyMeasurable_trim
theorem Integrable.ae_eq_zero_of_forall_setIntegral_eq_zero {f : α → E} (hf : Integrable f μ)
(hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = 0) : f =ᵐ[μ] 0 := by
have hf_Lp : Memℒp f 1 μ := memℒp_one_iff_integrable.mpr hf
let f_Lp := hf_Lp.toLp f
have hf_f_Lp : f =ᵐ[μ] f_Lp := (Memℒp.coeFn_toLp hf_Lp).symm
refine hf_f_Lp.trans ?_
refine Lp.ae_eq_zero_of_forall_setIntegral_eq_zero f_Lp one_ne_zero ENNReal.coe_ne_top ?_ ?_
· exact fun s _ _ => Integrable.integrableOn (L1.integrable_coeFn _)
· intro s hs hμs
rw [integral_congr_ae (ae_restrict_of_ae hf_f_Lp.symm)]
exact hf_zero s hs hμs
@[deprecated (since := "2024-04-17")]
alias Integrable.ae_eq_zero_of_forall_set_integral_eq_zero :=
Integrable.ae_eq_zero_of_forall_setIntegral_eq_zero
theorem Integrable.ae_eq_of_forall_setIntegral_eq (f g : α → E) (hf : Integrable f μ)
(hg : Integrable g μ)
(hfg : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ) :
f =ᵐ[μ] g := by
rw [← sub_ae_eq_zero]
have hfg' : ∀ s : Set α, MeasurableSet s → μ s < ∞ → (∫ x in s, (f - g) x ∂μ) = 0 := by
intro s hs hμs
rw [integral_sub' hf.integrableOn hg.integrableOn]
exact sub_eq_zero.mpr (hfg s hs hμs)
exact Integrable.ae_eq_zero_of_forall_setIntegral_eq_zero (hf.sub hg) hfg'
@[deprecated (since := "2024-04-17")]
alias Integrable.ae_eq_of_forall_set_integral_eq :=
Integrable.ae_eq_of_forall_setIntegral_eq
variable {β : Type*} [TopologicalSpace β] [MeasurableSpace β] [BorelSpace β]
/-- If an integrable function has zero integral on all closed sets, then it is zero
almost everwhere. -/
lemma ae_eq_zero_of_forall_setIntegral_isClosed_eq_zero {μ : Measure β} {f : β → E}
(hf : Integrable f μ) (h'f : ∀ (s : Set β), IsClosed s → ∫ x in s, f x ∂μ = 0) :
f =ᵐ[μ] 0 := by
suffices ∀ s, MeasurableSet s → ∫ x in s, f x ∂μ = 0 from
hf.ae_eq_zero_of_forall_setIntegral_eq_zero (fun s hs _ ↦ this s hs)
have A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0
→ ∫ (x : β) in tᶜ, f x ∂μ = 0 := by
intro t t_meas ht
have I : ∫ x, f x ∂μ = 0 := by rw [← integral_univ]; exact h'f _ isClosed_univ
simpa [ht, I] using integral_add_compl t_meas hf
intro s hs
refine MeasurableSet.induction_on_open (fun U hU ↦ ?_) A (fun g g_disj g_meas hg ↦ ?_) hs
· rw [← compl_compl U]
exact A _ hU.measurableSet.compl (h'f _ hU.isClosed_compl)
· rw [integral_iUnion g_meas g_disj hf.integrableOn]
simp [hg]
@[deprecated (since := "2024-04-17")]
alias ae_eq_zero_of_forall_set_integral_isClosed_eq_zero :=
ae_eq_zero_of_forall_setIntegral_isClosed_eq_zero
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_setIntegral_isCompact_eq_zero
[SigmaCompactSpace β] [R1Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
(h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
f =ᵐ[μ] 0 := by
apply ae_eq_zero_of_forall_setIntegral_isClosed_eq_zero hf (fun s hs ↦ ?_)
let t : ℕ → Set β := fun n ↦ closure (compactCovering β n) ∩ s
suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ)) by
have A : ∀ n, ∫ x in t n, f x ∂μ = 0 :=
fun n ↦ h'f _ ((isCompact_compactCovering β n).closure.inter_right hs)
simp_rw [A, tendsto_const_nhds_iff] at H
exact H.symm
have B : s = ⋃ n, t n := by
rw [← Set.iUnion_inter, iUnion_closure_compactCovering, Set.univ_inter]
rw [B]
apply tendsto_setIntegral_of_monotone
· intros n
exact (isClosed_closure.inter hs).measurableSet
· intros m n hmn
simp only [t, Set.le_iff_subset]
gcongr
· exact hf.integrableOn
/-- If a locally integrable function has zero integral on all compact sets in a sigma-compact space,
then it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_setIntegral_isCompact_eq_zero'
[SigmaCompactSpace β] [R1Space β] {μ : Measure β} {f : β → E} (hf : LocallyIntegrable f μ)
(h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
f =ᵐ[μ] 0 := by
rw [← μ.restrict_univ, ← iUnion_closure_compactCovering]
apply (ae_restrict_iUnion_iff _ _).2 (fun n ↦ ?_)
apply ae_eq_zero_of_forall_setIntegral_isCompact_eq_zero
· exact hf.integrableOn_isCompact (isCompact_compactCovering β n).closure
· intro s hs
rw [Measure.restrict_restrict' measurableSet_closure]
exact h'f _ (hs.inter_right isClosed_closure)
end AeEqOfForallSetIntegralEq
section Lintegral
theorem AEMeasurable.ae_eq_of_forall_setLIntegral_eq {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ)
(hg : AEMeasurable g μ) (hfi : ∫⁻ x, f x ∂μ ≠ ∞) (hgi : ∫⁻ x, g x ∂μ ≠ ∞)
(hfg : ∀ ⦃s⦄, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ = ∫⁻ x in s, g x ∂μ) :
f =ᵐ[μ] g := by
refine
ENNReal.eventuallyEq_of_toReal_eventuallyEq (ae_lt_top' hf hfi).ne_of_lt
(ae_lt_top' hg hgi).ne_of_lt
(Integrable.ae_eq_of_forall_setIntegral_eq _ _
(integrable_toReal_of_lintegral_ne_top hf hfi)
(integrable_toReal_of_lintegral_ne_top hg hgi) fun s hs hs' => ?_)
rw [integral_eq_lintegral_of_nonneg_ae, integral_eq_lintegral_of_nonneg_ae]
· congr 1
rw [lintegral_congr_ae (ofReal_toReal_ae_eq _), lintegral_congr_ae (ofReal_toReal_ae_eq _)]
· exact hfg hs hs'
· refine ae_lt_top' hg.restrict (ne_of_lt (lt_of_le_of_lt ?_ hgi.lt_top))
exact @setLIntegral_univ α _ μ g ▸ lintegral_mono_set (Set.subset_univ _)
· refine ae_lt_top' hf.restrict (ne_of_lt (lt_of_le_of_lt ?_ hfi.lt_top))
exact @setLIntegral_univ α _ μ f ▸ lintegral_mono_set (Set.subset_univ _)
-- putting the proofs where they are used is extremely slow
exacts [ae_of_all _ fun x => ENNReal.toReal_nonneg,
hg.ennreal_toReal.restrict.aestronglyMeasurable, ae_of_all _ fun x => ENNReal.toReal_nonneg,
hf.ennreal_toReal.restrict.aestronglyMeasurable]
@[deprecated (since := "2024-06-29")]
alias AEMeasurable.ae_eq_of_forall_set_lintegral_eq := AEMeasurable.ae_eq_of_forall_setLIntegral_eq
end Lintegral
section WithDensity
variable {m : MeasurableSpace α} {μ : Measure α}
theorem withDensity_eq_iff_of_sigmaFinite [SigmaFinite μ] {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ)
(hg : AEMeasurable g μ) : μ.withDensity f = μ.withDensity g ↔ f =ᵐ[μ] g :=
⟨fun hfg ↦ by
refine ae_eq_of_forall_setLIntegral_eq_of_sigmaFinite₀ hf hg fun s hs _ ↦ ?_
rw [← withDensity_apply f hs, ← withDensity_apply g hs, ← hfg], withDensity_congr_ae⟩
theorem withDensity_eq_iff {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ)
(hg : AEMeasurable g μ) (hfi : ∫⁻ x, f x ∂μ ≠ ∞) :
μ.withDensity f = μ.withDensity g ↔ f =ᵐ[μ] g :=
⟨fun hfg ↦ by
refine AEMeasurable.ae_eq_of_forall_setLIntegral_eq hf hg hfi ?_ fun s hs _ ↦ ?_
· rwa [← setLIntegral_univ, ← withDensity_apply g MeasurableSet.univ, ← hfg,
withDensity_apply f MeasurableSet.univ, setLIntegral_univ]
· rw [← withDensity_apply f hs, ← withDensity_apply g hs, ← hfg], withDensity_congr_ae⟩
end WithDensity
end MeasureTheory
|
MeasureTheory\Function\AEMeasurableOrder.lean | /-
Copyright (c) 2021 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order
/-!
# Measurability criterion for ennreal-valued functions
Consider a function `f : α → ℝ≥0∞`. If the level sets `{f < p}` and `{q < f}` have measurable
supersets which are disjoint up to measure zero when `p` and `q` are finite numbers satisfying
`p < q`, then `f` is almost-everywhere measurable. This is proved in
`ENNReal.aemeasurable_of_exist_almost_disjoint_supersets`, and deduced from an analogous statement
for any target space which is a complete linear dense order, called
`MeasureTheory.aemeasurable_of_exist_almost_disjoint_supersets`.
Note that it should be enough to assume that the space is a conditionally complete linear order,
but the proof would be more painful. Since our only use for now is for `ℝ≥0∞`, we keep it as simple
as possible.
-/
open MeasureTheory Set TopologicalSpace
open scoped Classical
open ENNReal NNReal
/-- If a function `f : α → β` is such that the level sets `{f < p}` and `{q < f}` have measurable
supersets which are disjoint up to measure zero when `p < q`, then `f` is almost-everywhere
measurable. It is even enough to have this for `p` and `q` in a countable dense set. -/
theorem MeasureTheory.aemeasurable_of_exist_almost_disjoint_supersets {α : Type*}
{m : MeasurableSpace α} (μ : Measure α) {β : Type*} [CompleteLinearOrder β] [DenselyOrdered β]
[TopologicalSpace β] [OrderTopology β] [SecondCountableTopology β] [MeasurableSpace β]
[BorelSpace β] (s : Set β) (s_count : s.Countable) (s_dense : Dense s) (f : α → β)
(h : ∀ p ∈ s, ∀ q ∈ s, p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧
{ x | f x < p } ⊆ u ∧ { x | q < f x } ⊆ v ∧ μ (u ∩ v) = 0) :
AEMeasurable f μ := by
haveI : Encodable s := s_count.toEncodable
have h' : ∀ p q, ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧
{ x | f x < p } ⊆ u ∧ { x | q < f x } ⊆ v ∧ (p ∈ s → q ∈ s → p < q → μ (u ∩ v) = 0) := by
intro p q
by_cases H : p ∈ s ∧ q ∈ s ∧ p < q
· rcases h p H.1 q H.2.1 H.2.2 with ⟨u, v, hu, hv, h'u, h'v, hμ⟩
exact ⟨u, v, hu, hv, h'u, h'v, fun _ _ _ => hμ⟩
· refine
⟨univ, univ, MeasurableSet.univ, MeasurableSet.univ, subset_univ _, subset_univ _,
fun ps qs pq => ?_⟩
simp only [not_and] at H
exact (H ps qs pq).elim
choose! u v huv using h'
let u' : β → Set α := fun p => ⋂ q ∈ s ∩ Ioi p, u p q
have u'_meas : ∀ i, MeasurableSet (u' i) := by
intro i
exact MeasurableSet.biInter (s_count.mono inter_subset_left) fun b _ => (huv i b).1
let f' : α → β := fun x => ⨅ i : s, piecewise (u' i) (fun _ => (i : β)) (fun _ => (⊤ : β)) x
have f'_meas : Measurable f' := by
apply measurable_iInf
exact fun i => Measurable.piecewise (u'_meas i) measurable_const measurable_const
let t := ⋃ (p : s) (q : ↥(s ∩ Ioi p)), u' p ∩ v p q
have μt : μ t ≤ 0 :=
calc
μ t ≤ ∑' (p : s) (q : ↥(s ∩ Ioi p)), μ (u' p ∩ v p q) := by
refine (measure_iUnion_le _).trans ?_
refine ENNReal.tsum_le_tsum fun p => ?_
haveI := (s_count.mono (s.inter_subset_left (t := Ioi ↑p))).to_subtype
apply measure_iUnion_le
_ ≤ ∑' (p : s) (q : ↥(s ∩ Ioi p)), μ (u p q ∩ v p q) := by
gcongr with p q
exact biInter_subset_of_mem q.2
_ = ∑' (p : s) (_ : ↥(s ∩ Ioi p)), (0 : ℝ≥0∞) := by
congr
ext1 p
congr
ext1 q
exact (huv p q).2.2.2.2 p.2 q.2.1 q.2.2
_ = 0 := by simp only [tsum_zero]
have ff' : ∀ᵐ x ∂μ, f x = f' x := by
have : ∀ᵐ x ∂μ, x ∉ t := by
have : μ t = 0 := le_antisymm μt bot_le
change μ _ = 0
convert this
ext y
simp only [not_exists, exists_prop, mem_setOf_eq, mem_compl_iff, not_not_mem]
filter_upwards [this] with x hx
apply (iInf_eq_of_forall_ge_of_forall_gt_exists_lt _ _).symm
· intro i
by_cases H : x ∈ u' i
swap
· simp only [H, le_top, not_false_iff, piecewise_eq_of_not_mem]
simp only [H, piecewise_eq_of_mem]
contrapose! hx
obtain ⟨r, ⟨xr, rq⟩, rs⟩ : ∃ r, r ∈ Ioo (i : β) (f x) ∩ s :=
dense_iff_inter_open.1 s_dense (Ioo i (f x)) isOpen_Ioo (nonempty_Ioo.2 hx)
have A : x ∈ v i r := (huv i r).2.2.2.1 rq
refine mem_iUnion.2 ⟨i, ?_⟩
refine mem_iUnion.2 ⟨⟨r, ⟨rs, xr⟩⟩, ?_⟩
exact ⟨H, A⟩
· intro q hq
obtain ⟨r, ⟨xr, rq⟩, rs⟩ : ∃ r, r ∈ Ioo (f x) q ∩ s :=
dense_iff_inter_open.1 s_dense (Ioo (f x) q) isOpen_Ioo (nonempty_Ioo.2 hq)
refine ⟨⟨r, rs⟩, ?_⟩
have A : x ∈ u' r := mem_biInter fun i _ => (huv r i).2.2.1 xr
simp only [A, rq, piecewise_eq_of_mem, Subtype.coe_mk]
exact ⟨f', f'_meas, ff'⟩
/-- If a function `f : α → ℝ≥0∞` is such that the level sets `{f < p}` and `{q < f}` have measurable
supersets which are disjoint up to measure zero when `p` and `q` are finite numbers satisfying
`p < q`, then `f` is almost-everywhere measurable. -/
theorem ENNReal.aemeasurable_of_exist_almost_disjoint_supersets {α : Type*} {m : MeasurableSpace α}
(μ : Measure α) (f : α → ℝ≥0∞)
(h : ∀ (p : ℝ≥0) (q : ℝ≥0), p < q →
∃ u v, MeasurableSet u ∧ MeasurableSet v ∧
{ x | f x < p } ⊆ u ∧ { x | (q : ℝ≥0∞) < f x } ⊆ v ∧ μ (u ∩ v) = 0) :
AEMeasurable f μ := by
obtain ⟨s, s_count, s_dense, _, s_top⟩ :
∃ s : Set ℝ≥0∞, s.Countable ∧ Dense s ∧ 0 ∉ s ∧ ∞ ∉ s :=
ENNReal.exists_countable_dense_no_zero_top
have I : ∀ x ∈ s, x ≠ ∞ := fun x xs hx => s_top (hx ▸ xs)
apply MeasureTheory.aemeasurable_of_exist_almost_disjoint_supersets μ s s_count s_dense _
rintro p hp q hq hpq
lift p to ℝ≥0 using I p hp
lift q to ℝ≥0 using I q hq
exact h p q (ENNReal.coe_lt_coe.1 hpq)
|
MeasureTheory\Function\AEMeasurableSequence.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.MeasurableSpace.Basic
import Mathlib.MeasureTheory.Measure.MeasureSpaceDef
/-!
# Sequence of measurable functions associated to a sequence of a.e.-measurable functions
We define here tools to prove statements about limits (infi, supr...) of sequences of
`AEMeasurable` functions.
Given a sequence of a.e.-measurable functions `f : ι → α → β` with hypothesis
`hf : ∀ i, AEMeasurable (f i) μ`, and a pointwise property `p : α → (ι → β) → Prop` such that we
have `hp : ∀ᵐ x ∂μ, p x (fun n ↦ f n x)`, we define a sequence of measurable functions `aeSeq hf p`
and a measurable set `aeSeqSet hf p`, such that
* `μ (aeSeqSet hf p)ᶜ = 0`
* `x ∈ aeSeqSet hf p → ∀ i : ι, aeSeq hf hp i x = f i x`
* `x ∈ aeSeqSet hf p → p x (fun n ↦ f n x)`
-/
open MeasureTheory
variable {ι : Sort*} {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] {f : ι → α → β}
{μ : Measure α} {p : α → (ι → β) → Prop}
/-- If we have the additional hypothesis `∀ᵐ x ∂μ, p x (fun n ↦ f n x)`, this is a measurable set
whose complement has measure 0 such that for all `x ∈ aeSeqSet`, `f i x` is equal to
`(hf i).mk (f i) x` for all `i` and we have the pointwise property `p x (fun n ↦ f n x)`. -/
def aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) (p : α → (ι → β) → Prop) : Set α :=
(toMeasurable μ { x | (∀ i, f i x = (hf i).mk (f i) x) ∧ p x fun n => f n x }ᶜ)ᶜ
open Classical in
/-- A sequence of measurable functions that are equal to `f` and verify property `p` on the
measurable set `aeSeqSet hf p`. -/
noncomputable def aeSeq (hf : ∀ i, AEMeasurable (f i) μ) (p : α → (ι → β) → Prop) : ι → α → β :=
fun i x => ite (x ∈ aeSeqSet hf p) ((hf i).mk (f i) x) (⟨f i x⟩ : Nonempty β).some
namespace aeSeq
section MemAESeqSet
theorem mk_eq_fun_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p)
(i : ι) : (hf i).mk (f i) x = f i x :=
haveI h_ss : aeSeqSet hf p ⊆ { x | ∀ i, f i x = (hf i).mk (f i) x } := by
rw [aeSeqSet, ← compl_compl { x | ∀ i, f i x = (hf i).mk (f i) x }, Set.compl_subset_compl]
refine Set.Subset.trans (Set.compl_subset_compl.mpr fun x h => ?_) (subset_toMeasurable _ _)
exact h.1
(h_ss hx i).symm
theorem aeSeq_eq_mk_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α}
(hx : x ∈ aeSeqSet hf p) (i : ι) : aeSeq hf p i x = (hf i).mk (f i) x := by
simp only [aeSeq, hx, if_true]
theorem aeSeq_eq_fun_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α}
(hx : x ∈ aeSeqSet hf p) (i : ι) : aeSeq hf p i x = f i x := by
simp only [aeSeq_eq_mk_of_mem_aeSeqSet hf hx i, mk_eq_fun_of_mem_aeSeqSet hf hx i]
theorem prop_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) :
p x fun n => aeSeq hf p n x := by
simp only [aeSeq, hx, if_true]
rw [funext fun n => mk_eq_fun_of_mem_aeSeqSet hf hx n]
have h_ss : aeSeqSet hf p ⊆ { x | p x fun n => f n x } := by
rw [← compl_compl { x | p x fun n => f n x }, aeSeqSet, Set.compl_subset_compl]
refine Set.Subset.trans (Set.compl_subset_compl.mpr ?_) (subset_toMeasurable _ _)
exact fun x hx => hx.2
have hx' := Set.mem_of_subset_of_mem h_ss hx
exact hx'
theorem fun_prop_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) :
p x fun n => f n x := by
have h_eq : (fun n => f n x) = fun n => aeSeq hf p n x :=
funext fun n => (aeSeq_eq_fun_of_mem_aeSeqSet hf hx n).symm
rw [h_eq]
exact prop_of_mem_aeSeqSet hf hx
end MemAESeqSet
theorem aeSeqSet_measurableSet {hf : ∀ i, AEMeasurable (f i) μ} : MeasurableSet (aeSeqSet hf p) :=
(measurableSet_toMeasurable _ _).compl
theorem measurable (hf : ∀ i, AEMeasurable (f i) μ) (p : α → (ι → β) → Prop) (i : ι) :
Measurable (aeSeq hf p i) :=
Measurable.ite aeSeqSet_measurableSet (hf i).measurable_mk <| measurable_const' fun _ _ => rfl
theorem measure_compl_aeSeqSet_eq_zero [Countable ι] (hf : ∀ i, AEMeasurable (f i) μ)
(hp : ∀ᵐ x ∂μ, p x fun n => f n x) : μ (aeSeqSet hf p)ᶜ = 0 := by
rw [aeSeqSet, compl_compl, measure_toMeasurable]
have hf_eq := fun i => (hf i).ae_eq_mk
simp_rw [Filter.EventuallyEq, ← ae_all_iff] at hf_eq
exact Filter.Eventually.and hf_eq hp
theorem aeSeq_eq_mk_ae [Countable ι] (hf : ∀ i, AEMeasurable (f i) μ)
(hp : ∀ᵐ x ∂μ, p x fun n => f n x) : ∀ᵐ a : α ∂μ, ∀ i : ι, aeSeq hf p i a = (hf i).mk (f i) a :=
have h_ss : aeSeqSet hf p ⊆ { a : α | ∀ i, aeSeq hf p i a = (hf i).mk (f i) a } := fun x hx i =>
by simp only [aeSeq, hx, if_true]
(ae_iff.2 (measure_compl_aeSeqSet_eq_zero hf hp)).mono h_ss
theorem aeSeq_eq_fun_ae [Countable ι] (hf : ∀ i, AEMeasurable (f i) μ)
(hp : ∀ᵐ x ∂μ, p x fun n => f n x) : ∀ᵐ a : α ∂μ, ∀ i : ι, aeSeq hf p i a = f i a :=
haveI h_ss : { a : α | ¬∀ i : ι, aeSeq hf p i a = f i a } ⊆ (aeSeqSet hf p)ᶜ := fun _ =>
mt fun hx i => aeSeq_eq_fun_of_mem_aeSeqSet hf hx i
measure_mono_null h_ss (measure_compl_aeSeqSet_eq_zero hf hp)
theorem aeSeq_n_eq_fun_n_ae [Countable ι] (hf : ∀ i, AEMeasurable (f i) μ)
(hp : ∀ᵐ x ∂μ, p x fun n => f n x) (n : ι) : aeSeq hf p n =ᵐ[μ] f n :=
ae_all_iff.mp (aeSeq_eq_fun_ae hf hp) n
theorem iSup [CompleteLattice β] [Countable ι] (hf : ∀ i, AEMeasurable (f i) μ)
(hp : ∀ᵐ x ∂μ, p x fun n => f n x) : ⨆ n, aeSeq hf p n =ᵐ[μ] ⨆ n, f n := by
simp_rw [Filter.EventuallyEq, ae_iff, iSup_apply]
have h_ss : aeSeqSet hf p ⊆ { a : α | ⨆ i : ι, aeSeq hf p i a = ⨆ i : ι, f i a } := by
intro x hx
congr
exact funext fun i => aeSeq_eq_fun_of_mem_aeSeqSet hf hx i
exact measure_mono_null (Set.compl_subset_compl.mpr h_ss) (measure_compl_aeSeqSet_eq_zero hf hp)
theorem iInf [CompleteLattice β] [Countable ι] (hf : ∀ i, AEMeasurable (f i) μ)
(hp : ∀ᵐ x ∂μ, p x fun n ↦ f n x) : ⨅ n, aeSeq hf p n =ᵐ[μ] ⨅ n, f n :=
iSup (β := βᵒᵈ) hf hp
end aeSeq
|
MeasureTheory\Function\ContinuousMapDense.lean | /-
Copyright (c) 2021 Heather Macbeth. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Heather Macbeth
-/
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp
import Mathlib.Topology.UrysohnsLemma
import Mathlib.MeasureTheory.Integral.Bochner
/-!
# Approximation in Lᵖ by continuous functions
This file proves that bounded continuous functions are dense in `Lp E p μ`, for `p < ∞`, if the
domain `α` of the functions is a normal topological space and the measure `μ` is weakly regular.
It also proves the same results for approximation by continuous functions with compact support
when the space is locally compact and `μ` is regular.
The result is presented in several versions. First concrete versions giving an approximation
up to `ε` in these various contexts, and then abstract versions stating that the topological
closure of the relevant subgroups of `Lp` are the whole space.
* `MeasureTheory.Memℒp.exists_hasCompactSupport_eLpNorm_sub_le` states that, in a locally compact
space, an `ℒp` function can be approximated by continuous functions with compact support,
in the sense that `eLpNorm (f - g) p μ` is small.
* `MeasureTheory.Memℒp.exists_hasCompactSupport_integral_rpow_sub_le`: same result, but expressed in
terms of `∫ ‖f - g‖^p`.
Versions with `Integrable` instead of `Memℒp` are specialized to the case `p = 1`.
Versions with `boundedContinuous` instead of `HasCompactSupport` drop the locally
compact assumption and give only approximation by a bounded continuous function.
* `MeasureTheory.Lp.boundedContinuousFunction_dense`: The subgroup
`MeasureTheory.Lp.boundedContinuousFunction` of `Lp E p μ`, the additive subgroup of
`Lp E p μ` consisting of equivalence classes containing a continuous representative, is dense in
`Lp E p μ`.
* `BoundedContinuousFunction.toLp_denseRange`: For finite-measure `μ`, the continuous linear
map `BoundedContinuousFunction.toLp p μ 𝕜` from `α →ᵇ E` to `Lp E p μ` has dense range.
* `ContinuousMap.toLp_denseRange`: For compact `α` and finite-measure `μ`, the continuous linear
map `ContinuousMap.toLp p μ 𝕜` from `C(α, E)` to `Lp E p μ` has dense range.
Note that for `p = ∞` this result is not true: the characteristic function of the set `[0, ∞)` in
`ℝ` cannot be continuously approximated in `L∞`.
The proof is in three steps. First, since simple functions are dense in `Lp`, it suffices to prove
the result for a scalar multiple of a characteristic function of a measurable set `s`. Secondly,
since the measure `μ` is weakly regular, the set `s` can be approximated above by an open set and
below by a closed set. Finally, since the domain `α` is normal, we use Urysohn's lemma to find a
continuous function interpolating between these two sets.
## Related results
Are you looking for a result on "directional" approximation (above or below with respect to an
order) of functions whose codomain is `ℝ≥0∞` or `ℝ`, by semicontinuous functions? See the
Vitali-Carathéodory theorem, in the file `Mathlib/MeasureTheory/Integral/VitaliCaratheodory.lean`.
-/
open scoped ENNReal NNReal Topology BoundedContinuousFunction
open MeasureTheory TopologicalSpace ContinuousMap Set Bornology
variable {α : Type*} [TopologicalSpace α] [NormalSpace α] [R1Space α]
[MeasurableSpace α] [BorelSpace α]
variable {E : Type*} [NormedAddCommGroup E] {μ : Measure α} {p : ℝ≥0∞}
namespace MeasureTheory
variable [NormedSpace ℝ E]
/-- A variant of Urysohn's lemma, `ℒ^p` version, for an outer regular measure `μ`:
consider two sets `s ⊆ u` which are respectively closed and open with `μ s < ∞`, and a vector `c`.
Then one may find a continuous function `f` equal to `c` on `s` and to `0` outside of `u`,
bounded by `‖c‖` everywhere, and such that the `ℒ^p` norm of `f - s.indicator (fun y ↦ c)` is
arbitrarily small. Additionally, this function `f` belongs to `ℒ^p`. -/
theorem exists_continuous_eLpNorm_sub_le_of_closed [μ.OuterRegular] (hp : p ≠ ∞) {s u : Set α}
(s_closed : IsClosed s) (u_open : IsOpen u) (hsu : s ⊆ u) (hs : μ s ≠ ∞) (c : E) {ε : ℝ≥0∞}
(hε : ε ≠ 0) :
∃ f : α → E,
Continuous f ∧
eLpNorm (fun x => f x - s.indicator (fun _y => c) x) p μ ≤ ε ∧
(∀ x, ‖f x‖ ≤ ‖c‖) ∧ Function.support f ⊆ u ∧ Memℒp f p μ := by
obtain ⟨η, η_pos, hη⟩ :
∃ η : ℝ≥0, 0 < η ∧ ∀ s : Set α, μ s ≤ η → eLpNorm (s.indicator fun _x => c) p μ ≤ ε :=
exists_eLpNorm_indicator_le hp c hε
have ηpos : (0 : ℝ≥0∞) < η := ENNReal.coe_lt_coe.2 η_pos
obtain ⟨V, sV, V_open, h'V, hV⟩ : ∃ (V : Set α), V ⊇ s ∧ IsOpen V ∧ μ V < ∞ ∧ μ (V \ s) < η :=
s_closed.measurableSet.exists_isOpen_diff_lt hs ηpos.ne'
let v := u ∩ V
have hsv : s ⊆ v := subset_inter hsu sV
have hμv : μ v < ∞ := (measure_mono inter_subset_right).trans_lt h'V
obtain ⟨g, hgv, hgs, hg_range⟩ :=
exists_continuous_zero_one_of_isClosed (u_open.inter V_open).isClosed_compl s_closed
(disjoint_compl_left_iff.2 hsv)
-- Multiply this by `c` to get a continuous approximation to the function `f`; the key point is
-- that this is pointwise bounded by the indicator of the set `v \ s`, which has small measure.
have g_norm : ∀ x, ‖g x‖ = g x := fun x => by rw [Real.norm_eq_abs, abs_of_nonneg (hg_range x).1]
have gc_bd0 : ∀ x, ‖g x • c‖ ≤ ‖c‖ := by
intro x
simp only [norm_smul, g_norm x]
apply mul_le_of_le_one_left (norm_nonneg _)
exact (hg_range x).2
have gc_bd :
∀ x, ‖g x • c - s.indicator (fun _x => c) x‖ ≤ ‖(v \ s).indicator (fun _x => c) x‖ := by
intro x
by_cases hv : x ∈ v
· rw [← Set.diff_union_of_subset hsv] at hv
cases' hv with hsv hs
· simpa only [hsv.2, Set.indicator_of_not_mem, not_false_iff, sub_zero, hsv,
Set.indicator_of_mem] using gc_bd0 x
· simp [hgs hs, hs]
· simp [hgv hv, show x ∉ s from fun h => hv (hsv h)]
have gc_support : (Function.support fun x : α => g x • c) ⊆ v := by
refine Function.support_subset_iff'.2 fun x hx => ?_
simp only [hgv hx, Pi.zero_apply, zero_smul]
have gc_mem : Memℒp (fun x => g x • c) p μ := by
refine Memℒp.smul_of_top_left (memℒp_top_const _) ?_
refine ⟨g.continuous.aestronglyMeasurable, ?_⟩
have : eLpNorm (v.indicator fun _x => (1 : ℝ)) p μ < ⊤ := by
refine (eLpNorm_indicator_const_le _ _).trans_lt ?_
simp only [lt_top_iff_ne_top, hμv.ne, nnnorm_one, ENNReal.coe_one, one_div, one_mul, Ne,
ENNReal.rpow_eq_top_iff, inv_lt_zero, false_and_iff, or_false_iff, not_and, not_lt,
ENNReal.toReal_nonneg, imp_true_iff]
refine (eLpNorm_mono fun x => ?_).trans_lt this
by_cases hx : x ∈ v
· simp only [hx, abs_of_nonneg (hg_range x).1, (hg_range x).2, Real.norm_eq_abs,
indicator_of_mem, CStarRing.norm_one]
· simp only [hgv hx, Pi.zero_apply, Real.norm_eq_abs, abs_zero, abs_nonneg]
refine
⟨fun x => g x • c, g.continuous.smul continuous_const, (eLpNorm_mono gc_bd).trans ?_, gc_bd0,
gc_support.trans inter_subset_left, gc_mem⟩
exact hη _ ((measure_mono (diff_subset_diff inter_subset_right Subset.rfl)).trans hV.le)
@[deprecated (since := "2024-07-27")]
alias exists_continuous_snorm_sub_le_of_closed := exists_continuous_eLpNorm_sub_le_of_closed
/-- In a locally compact space, any function in `ℒp` can be approximated by compactly supported
continuous functions when `p < ∞`, version in terms of `eLpNorm`. -/
theorem Memℒp.exists_hasCompactSupport_eLpNorm_sub_le [WeaklyLocallyCompactSpace α] [μ.Regular]
(hp : p ≠ ∞) {f : α → E} (hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ g : α → E, HasCompactSupport g ∧ eLpNorm (f - g) p μ ≤ ε ∧ Continuous g ∧ Memℒp g p μ := by
suffices H :
∃ g : α → E, eLpNorm (f - g) p μ ≤ ε ∧ Continuous g ∧ Memℒp g p μ ∧ HasCompactSupport g by
rcases H with ⟨g, hg, g_cont, g_mem, g_support⟩
exact ⟨g, g_support, hg, g_cont, g_mem⟩
-- It suffices to check that the set of functions we consider approximates characteristic
-- functions, is stable under addition and consists of ae strongly measurable functions.
-- First check the latter easy facts.
apply hf.induction_dense hp _ _ _ _ hε
rotate_left
-- stability under addition
· rintro f g ⟨f_cont, f_mem, hf⟩ ⟨g_cont, g_mem, hg⟩
exact ⟨f_cont.add g_cont, f_mem.add g_mem, hf.add hg⟩
-- ae strong measurability
· rintro f ⟨_f_cont, f_mem, _hf⟩
exact f_mem.aestronglyMeasurable
-- We are left with approximating characteristic functions.
-- This follows from `exists_continuous_eLpNorm_sub_le_of_closed`.
intro c t ht htμ ε hε
rcases exists_Lp_half E μ p hε with ⟨δ, δpos, hδ⟩
obtain ⟨η, ηpos, hη⟩ :
∃ η : ℝ≥0, 0 < η ∧ ∀ s : Set α, μ s ≤ η → eLpNorm (s.indicator fun _x => c) p μ ≤ δ :=
exists_eLpNorm_indicator_le hp c δpos.ne'
have hη_pos' : (0 : ℝ≥0∞) < η := ENNReal.coe_pos.2 ηpos
obtain ⟨s, st, s_compact, s_closed, μs⟩ :
∃ s, s ⊆ t ∧ IsCompact s ∧ IsClosed s ∧ μ (t \ s) < η :=
ht.exists_isCompact_isClosed_diff_lt htμ.ne hη_pos'.ne'
have hsμ : μ s < ∞ := (measure_mono st).trans_lt htμ
have I1 : eLpNorm ((s.indicator fun _y => c) - t.indicator fun _y => c) p μ ≤ δ := by
rw [← eLpNorm_neg, neg_sub, ← indicator_diff st]
exact hη _ μs.le
obtain ⟨k, k_compact, sk⟩ : ∃ k : Set α, IsCompact k ∧ s ⊆ interior k :=
exists_compact_superset s_compact
rcases exists_continuous_eLpNorm_sub_le_of_closed hp s_closed isOpen_interior sk hsμ.ne c δpos.ne'
with ⟨f, f_cont, I2, _f_bound, f_support, f_mem⟩
have I3 : eLpNorm (f - t.indicator fun _y => c) p μ ≤ ε := by
convert
(hδ _ _
(f_mem.aestronglyMeasurable.sub
(aestronglyMeasurable_const.indicator s_closed.measurableSet))
((aestronglyMeasurable_const.indicator s_closed.measurableSet).sub
(aestronglyMeasurable_const.indicator ht))
I2 I1).le using 2
simp only [sub_add_sub_cancel]
refine ⟨f, I3, f_cont, f_mem, HasCompactSupport.intro k_compact fun x hx => ?_⟩
rw [← Function.nmem_support]
contrapose! hx
exact interior_subset (f_support hx)
@[deprecated (since := "2024-07-27")]
alias Memℒp.exists_hasCompactSupport_snorm_sub_le := Memℒp.exists_hasCompactSupport_eLpNorm_sub_le
/-- In a locally compact space, any function in `ℒp` can be approximated by compactly supported
continuous functions when `0 < p < ∞`, version in terms of `∫`. -/
theorem Memℒp.exists_hasCompactSupport_integral_rpow_sub_le
[WeaklyLocallyCompactSpace α] [μ.Regular]
{p : ℝ} (hp : 0 < p) {f : α → E} (hf : Memℒp f (ENNReal.ofReal p) μ) {ε : ℝ} (hε : 0 < ε) :
∃ g : α → E,
HasCompactSupport g ∧
(∫ x, ‖f x - g x‖ ^ p ∂μ) ≤ ε ∧ Continuous g ∧ Memℒp g (ENNReal.ofReal p) μ := by
have I : 0 < ε ^ (1 / p) := Real.rpow_pos_of_pos hε _
have A : ENNReal.ofReal (ε ^ (1 / p)) ≠ 0 := by
simp only [Ne, ENNReal.ofReal_eq_zero, not_le, I]
have B : ENNReal.ofReal p ≠ 0 := by simpa only [Ne, ENNReal.ofReal_eq_zero, not_le] using hp
rcases hf.exists_hasCompactSupport_eLpNorm_sub_le ENNReal.coe_ne_top A with
⟨g, g_support, hg, g_cont, g_mem⟩
change eLpNorm _ (ENNReal.ofReal p) _ ≤ _ at hg
refine ⟨g, g_support, ?_, g_cont, g_mem⟩
rwa [(hf.sub g_mem).eLpNorm_eq_integral_rpow_norm B ENNReal.coe_ne_top,
ENNReal.ofReal_le_ofReal_iff I.le, one_div, ENNReal.toReal_ofReal hp.le,
Real.rpow_le_rpow_iff _ hε.le (inv_pos.2 hp)] at hg
positivity
/-- In a locally compact space, any integrable function can be approximated by compactly supported
continuous functions, version in terms of `∫⁻`. -/
theorem Integrable.exists_hasCompactSupport_lintegral_sub_le
[WeaklyLocallyCompactSpace α] [μ.Regular]
{f : α → E} (hf : Integrable f μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ g : α → E,
HasCompactSupport g ∧ (∫⁻ x, ‖f x - g x‖₊ ∂μ) ≤ ε ∧ Continuous g ∧ Integrable g μ := by
simp only [← memℒp_one_iff_integrable, ← eLpNorm_one_eq_lintegral_nnnorm] at hf ⊢
exact hf.exists_hasCompactSupport_eLpNorm_sub_le ENNReal.one_ne_top hε
/-- In a locally compact space, any integrable function can be approximated by compactly supported
continuous functions, version in terms of `∫`. -/
theorem Integrable.exists_hasCompactSupport_integral_sub_le
[WeaklyLocallyCompactSpace α] [μ.Regular]
{f : α → E} (hf : Integrable f μ) {ε : ℝ} (hε : 0 < ε) :
∃ g : α → E, HasCompactSupport g ∧ (∫ x, ‖f x - g x‖ ∂μ) ≤ ε ∧
Continuous g ∧ Integrable g μ := by
simp only [← memℒp_one_iff_integrable, ← eLpNorm_one_eq_lintegral_nnnorm, ← ENNReal.ofReal_one]
at hf ⊢
simpa using hf.exists_hasCompactSupport_integral_rpow_sub_le zero_lt_one hε
/-- Any function in `ℒp` can be approximated by bounded continuous functions when `p < ∞`,
version in terms of `eLpNorm`. -/
theorem Memℒp.exists_boundedContinuous_eLpNorm_sub_le [μ.WeaklyRegular] (hp : p ≠ ∞) {f : α → E}
(hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ g : α →ᵇ E, eLpNorm (f - (g : α → E)) p μ ≤ ε ∧ Memℒp g p μ := by
suffices H :
∃ g : α → E, eLpNorm (f - g) p μ ≤ ε ∧ Continuous g ∧ Memℒp g p μ ∧ IsBounded (range g) by
rcases H with ⟨g, hg, g_cont, g_mem, g_bd⟩
exact ⟨⟨⟨g, g_cont⟩, Metric.isBounded_range_iff.1 g_bd⟩, hg, g_mem⟩
-- It suffices to check that the set of functions we consider approximates characteristic
-- functions, is stable under addition and made of ae strongly measurable functions.
-- First check the latter easy facts.
apply hf.induction_dense hp _ _ _ _ hε
rotate_left
-- stability under addition
· rintro f g ⟨f_cont, f_mem, f_bd⟩ ⟨g_cont, g_mem, g_bd⟩
refine ⟨f_cont.add g_cont, f_mem.add g_mem, ?_⟩
let f' : α →ᵇ E := ⟨⟨f, f_cont⟩, Metric.isBounded_range_iff.1 f_bd⟩
let g' : α →ᵇ E := ⟨⟨g, g_cont⟩, Metric.isBounded_range_iff.1 g_bd⟩
exact (f' + g').isBounded_range
-- ae strong measurability
· exact fun f ⟨_, h, _⟩ => h.aestronglyMeasurable
-- We are left with approximating characteristic functions.
-- This follows from `exists_continuous_eLpNorm_sub_le_of_closed`.
intro c t ht htμ ε hε
rcases exists_Lp_half E μ p hε with ⟨δ, δpos, hδ⟩
obtain ⟨η, ηpos, hη⟩ :
∃ η : ℝ≥0, 0 < η ∧ ∀ s : Set α, μ s ≤ η → eLpNorm (s.indicator fun _x => c) p μ ≤ δ :=
exists_eLpNorm_indicator_le hp c δpos.ne'
have hη_pos' : (0 : ℝ≥0∞) < η := ENNReal.coe_pos.2 ηpos
obtain ⟨s, st, s_closed, μs⟩ : ∃ s, s ⊆ t ∧ IsClosed s ∧ μ (t \ s) < η :=
ht.exists_isClosed_diff_lt htμ.ne hη_pos'.ne'
have hsμ : μ s < ∞ := (measure_mono st).trans_lt htμ
have I1 : eLpNorm ((s.indicator fun _y => c) - t.indicator fun _y => c) p μ ≤ δ := by
rw [← eLpNorm_neg, neg_sub, ← indicator_diff st]
exact hη _ μs.le
rcases exists_continuous_eLpNorm_sub_le_of_closed hp s_closed isOpen_univ (subset_univ _) hsμ.ne c
δpos.ne' with
⟨f, f_cont, I2, f_bound, -, f_mem⟩
have I3 : eLpNorm (f - t.indicator fun _y => c) p μ ≤ ε := by
convert
(hδ _ _
(f_mem.aestronglyMeasurable.sub
(aestronglyMeasurable_const.indicator s_closed.measurableSet))
((aestronglyMeasurable_const.indicator s_closed.measurableSet).sub
(aestronglyMeasurable_const.indicator ht))
I2 I1).le using 2
simp only [sub_add_sub_cancel]
refine ⟨f, I3, f_cont, f_mem, ?_⟩
exact (BoundedContinuousFunction.ofNormedAddCommGroup f f_cont _ f_bound).isBounded_range
@[deprecated (since := "2024-07-27")]
alias Memℒp.exists_boundedContinuous_snorm_sub_le := Memℒp.exists_boundedContinuous_eLpNorm_sub_le
/-- Any function in `ℒp` can be approximated by bounded continuous functions when `0 < p < ∞`,
version in terms of `∫`. -/
theorem Memℒp.exists_boundedContinuous_integral_rpow_sub_le [μ.WeaklyRegular] {p : ℝ} (hp : 0 < p)
{f : α → E} (hf : Memℒp f (ENNReal.ofReal p) μ) {ε : ℝ} (hε : 0 < ε) :
∃ g : α →ᵇ E, (∫ x, ‖f x - g x‖ ^ p ∂μ) ≤ ε ∧ Memℒp g (ENNReal.ofReal p) μ := by
have I : 0 < ε ^ (1 / p) := Real.rpow_pos_of_pos hε _
have A : ENNReal.ofReal (ε ^ (1 / p)) ≠ 0 := by
simp only [Ne, ENNReal.ofReal_eq_zero, not_le, I]
have B : ENNReal.ofReal p ≠ 0 := by simpa only [Ne, ENNReal.ofReal_eq_zero, not_le] using hp
rcases hf.exists_boundedContinuous_eLpNorm_sub_le ENNReal.coe_ne_top A with ⟨g, hg, g_mem⟩
change eLpNorm _ (ENNReal.ofReal p) _ ≤ _ at hg
refine ⟨g, ?_, g_mem⟩
rwa [(hf.sub g_mem).eLpNorm_eq_integral_rpow_norm B ENNReal.coe_ne_top,
ENNReal.ofReal_le_ofReal_iff I.le, one_div, ENNReal.toReal_ofReal hp.le,
Real.rpow_le_rpow_iff _ hε.le (inv_pos.2 hp)] at hg
positivity
/-- Any integrable function can be approximated by bounded continuous functions,
version in terms of `∫⁻`. -/
theorem Integrable.exists_boundedContinuous_lintegral_sub_le [μ.WeaklyRegular] {f : α → E}
(hf : Integrable f μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ g : α →ᵇ E, (∫⁻ x, ‖f x - g x‖₊ ∂μ) ≤ ε ∧ Integrable g μ := by
simp only [← memℒp_one_iff_integrable, ← eLpNorm_one_eq_lintegral_nnnorm] at hf ⊢
exact hf.exists_boundedContinuous_eLpNorm_sub_le ENNReal.one_ne_top hε
/-- Any integrable function can be approximated by bounded continuous functions,
version in terms of `∫`. -/
theorem Integrable.exists_boundedContinuous_integral_sub_le [μ.WeaklyRegular] {f : α → E}
(hf : Integrable f μ) {ε : ℝ} (hε : 0 < ε) :
∃ g : α →ᵇ E, (∫ x, ‖f x - g x‖ ∂μ) ≤ ε ∧ Integrable g μ := by
simp only [← memℒp_one_iff_integrable, ← eLpNorm_one_eq_lintegral_nnnorm, ← ENNReal.ofReal_one]
at hf ⊢
simpa using hf.exists_boundedContinuous_integral_rpow_sub_le zero_lt_one hε
namespace Lp
variable (E μ)
/-- A function in `Lp` can be approximated in `Lp` by continuous functions. -/
theorem boundedContinuousFunction_dense [SecondCountableTopologyEither α E] [Fact (1 ≤ p)]
(hp : p ≠ ∞) [μ.WeaklyRegular] :
Dense (boundedContinuousFunction E p μ : Set (Lp E p μ)) := by
intro f
refine (mem_closure_iff_nhds_basis EMetric.nhds_basis_closed_eball).2 fun ε hε ↦ ?_
obtain ⟨g, hg, g_mem⟩ :
∃ g : α →ᵇ E, eLpNorm ((f : α → E) - (g : α → E)) p μ ≤ ε ∧ Memℒp g p μ :=
(Lp.memℒp f).exists_boundedContinuous_eLpNorm_sub_le hp hε.ne'
refine ⟨g_mem.toLp _, ⟨g, rfl⟩, ?_⟩
rwa [EMetric.mem_closedBall', ← Lp.toLp_coeFn f (Lp.memℒp f), Lp.edist_toLp_toLp]
/-- A function in `Lp` can be approximated in `Lp` by continuous functions. -/
theorem boundedContinuousFunction_topologicalClosure [SecondCountableTopologyEither α E]
[Fact (1 ≤ p)] (hp : p ≠ ∞) [μ.WeaklyRegular] :
(boundedContinuousFunction E p μ).topologicalClosure = ⊤ :=
SetLike.ext' <| (boundedContinuousFunction_dense E μ hp).closure_eq
end Lp
end MeasureTheory
variable [SecondCountableTopologyEither α E] [_i : Fact (1 ≤ p)] (hp : p ≠ ∞)
variable (𝕜 : Type*) [NormedField 𝕜] [NormedAlgebra ℝ 𝕜] [NormedSpace 𝕜 E]
variable (E) (μ)
namespace BoundedContinuousFunction
theorem toLp_denseRange [μ.WeaklyRegular] [IsFiniteMeasure μ] :
DenseRange (toLp p μ 𝕜 : (α →ᵇ E) →L[𝕜] Lp E p μ) := by
haveI : NormedSpace ℝ E := RestrictScalars.normedSpace ℝ 𝕜 E
simpa only [← range_toLp p μ (𝕜 := 𝕜)]
using MeasureTheory.Lp.boundedContinuousFunction_dense E μ hp
end BoundedContinuousFunction
namespace ContinuousMap
/-- Continuous functions are dense in `MeasureTheory.Lp`, `1 ≤ p < ∞`. This theorem assumes that
the domain is a compact space because otherwise `ContinuousMap.toLp` is undefined. Use
`BoundedContinuousFunction.toLp_denseRange` if the domain is not a compact space. -/
theorem toLp_denseRange [CompactSpace α] [μ.WeaklyRegular] [IsFiniteMeasure μ] :
DenseRange (toLp p μ 𝕜 : C(α, E) →L[𝕜] Lp E p μ) := by
refine (BoundedContinuousFunction.toLp_denseRange _ _ hp 𝕜).mono ?_
refine range_subset_iff.2 fun f ↦ ?_
exact ⟨f.toContinuousMap, rfl⟩
end ContinuousMap
|
MeasureTheory\Function\ConvergenceInMeasure.lean | /-
Copyright (c) 2022 Rémy Degenne, Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne, Kexing Ying
-/
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.MeasureTheory.Function.Egorov
import Mathlib.MeasureTheory.Function.LpSpace
/-!
# Convergence in measure
We define convergence in measure which is one of the many notions of convergence in probability.
A sequence of functions `f` is said to converge in measure to some function `g`
if for all `ε > 0`, the measure of the set `{x | ε ≤ dist (f i x) (g x)}` tends to 0 as `i`
converges along some given filter `l`.
Convergence in measure is most notably used in the formulation of the weak law of large numbers
and is also useful in theorems such as the Vitali convergence theorem. This file provides some
basic lemmas for working with convergence in measure and establishes some relations between
convergence in measure and other notions of convergence.
## Main definitions
* `MeasureTheory.TendstoInMeasure (μ : Measure α) (f : ι → α → E) (g : α → E)`: `f` converges
in `μ`-measure to `g`.
## Main results
* `MeasureTheory.tendstoInMeasure_of_tendsto_ae`: convergence almost everywhere in a finite
measure space implies convergence in measure.
* `MeasureTheory.TendstoInMeasure.exists_seq_tendsto_ae`: if `f` is a sequence of functions
which converges in measure to `g`, then `f` has a subsequence which convergence almost
everywhere to `g`.
* `MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm`: convergence in Lp implies convergence
in measure.
-/
open TopologicalSpace Filter
open scoped NNReal ENNReal MeasureTheory Topology
namespace MeasureTheory
variable {α ι E : Type*} {m : MeasurableSpace α} {μ : Measure α}
/-- A sequence of functions `f` is said to converge in measure to some function `g` if for all
`ε > 0`, the measure of the set `{x | ε ≤ dist (f i x) (g x)}` tends to 0 as `i` converges along
some given filter `l`. -/
def TendstoInMeasure [Dist E] {_ : MeasurableSpace α} (μ : Measure α) (f : ι → α → E) (l : Filter ι)
(g : α → E) : Prop :=
∀ ε, 0 < ε → Tendsto (fun i => μ { x | ε ≤ dist (f i x) (g x) }) l (𝓝 0)
theorem tendstoInMeasure_iff_norm [SeminormedAddCommGroup E] {l : Filter ι} {f : ι → α → E}
{g : α → E} :
TendstoInMeasure μ f l g ↔
∀ ε, 0 < ε → Tendsto (fun i => μ { x | ε ≤ ‖f i x - g x‖ }) l (𝓝 0) := by
simp_rw [TendstoInMeasure, dist_eq_norm]
namespace TendstoInMeasure
variable [Dist E] {l : Filter ι} {f f' : ι → α → E} {g g' : α → E}
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
(h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
intro ε hε
suffices
(fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
rw [tendsto_congr' this]
exact h_tendsto ε hε
filter_upwards [h_left] with i h_ae_eq
refine measure_congr ?_
filter_upwards [h_ae_eq, h_right] with x hxf hxg
rw [eq_iff_iff]
change ε ≤ dist (f' i x) (g' x) ↔ ε ≤ dist (f i x) (g x)
rw [hxg, hxf]
protected theorem congr (h_left : ∀ i, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
(h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' :=
TendstoInMeasure.congr' (eventually_of_forall h_left) h_right h_tendsto
theorem congr_left (h : ∀ i, f i =ᵐ[μ] f' i) (h_tendsto : TendstoInMeasure μ f l g) :
TendstoInMeasure μ f' l g :=
h_tendsto.congr h EventuallyEq.rfl
theorem congr_right (h : g =ᵐ[μ] g') (h_tendsto : TendstoInMeasure μ f l g) :
TendstoInMeasure μ f l g' :=
h_tendsto.congr (fun _ => EventuallyEq.rfl) h
end TendstoInMeasure
section ExistsSeqTendstoAe
variable [MetricSpace E]
variable {f : ℕ → α → E} {g : α → E}
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
(hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
(hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
refine fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => ?_
by_cases hδi : δ = ∞
· simp only [hδi, imp_true_iff, le_top, exists_const]
lift δ to ℝ≥0 using hδi
rw [gt_iff_lt, ENNReal.coe_pos, ← NNReal.coe_pos] at hδ
obtain ⟨t, _, ht, hunif⟩ := tendstoUniformlyOn_of_ae_tendsto' hf hg hfg hδ
rw [ENNReal.ofReal_coe_nnreal] at ht
rw [Metric.tendstoUniformlyOn_iff] at hunif
obtain ⟨N, hN⟩ := eventually_atTop.1 (hunif ε hε)
refine ⟨N, fun n hn => ?_⟩
suffices { x : α | ε ≤ dist (f n x) (g x) } ⊆ t from (measure_mono this).trans ht
rw [← Set.compl_subset_compl]
intro x hx
rw [Set.mem_compl_iff, Set.nmem_setOf_iff, dist_comm, not_le]
exact hN n hn x hx
/-- Convergence a.e. implies convergence in measure in a finite measure space. -/
theorem tendstoInMeasure_of_tendsto_ae [IsFiniteMeasure μ] (hf : ∀ n, AEStronglyMeasurable (f n) μ)
(hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
have hg : AEStronglyMeasurable g μ := aestronglyMeasurable_of_tendsto_ae _ hf hfg
refine TendstoInMeasure.congr (fun i => (hf i).ae_eq_mk.symm) hg.ae_eq_mk.symm ?_
refine tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable
(fun i => (hf i).stronglyMeasurable_mk) hg.stronglyMeasurable_mk ?_
have hf_eq_ae : ∀ᵐ x ∂μ, ∀ n, (hf n).mk (f n) x = f n x :=
ae_all_iff.mpr fun n => (hf n).ae_eq_mk.symm
filter_upwards [hf_eq_ae, hg.ae_eq_mk, hfg] with x hxf hxg hxfg
rw [← hxg, funext fun n => hxf n]
exact hxfg
namespace ExistsSeqTendstoAe
theorem exists_nat_measure_lt_two_inv (hfg : TendstoInMeasure μ f atTop g) (n : ℕ) :
∃ N, ∀ m ≥ N, μ { x | (2 : ℝ)⁻¹ ^ n ≤ dist (f m x) (g x) } ≤ (2⁻¹ : ℝ≥0∞) ^ n := by
specialize hfg ((2⁻¹ : ℝ) ^ n) (by simp only [Real.rpow_natCast, inv_pos, zero_lt_two, pow_pos])
rw [ENNReal.tendsto_atTop_zero] at hfg
exact hfg ((2 : ℝ≥0∞)⁻¹ ^ n) (pos_iff_ne_zero.mpr fun h_zero => by simpa using pow_eq_zero h_zero)
/-- Given a sequence of functions `f` which converges in measure to `g`,
`seqTendstoAeSeqAux` is a sequence such that
`∀ m ≥ seqTendstoAeSeqAux n, μ {x | 2⁻¹ ^ n ≤ dist (f m x) (g x)} ≤ 2⁻¹ ^ n`. -/
noncomputable def seqTendstoAeSeqAux (hfg : TendstoInMeasure μ f atTop g) (n : ℕ) :=
Classical.choose (exists_nat_measure_lt_two_inv hfg n)
/-- Transformation of `seqTendstoAeSeqAux` to makes sure it is strictly monotone. -/
noncomputable def seqTendstoAeSeq (hfg : TendstoInMeasure μ f atTop g) : ℕ → ℕ
| 0 => seqTendstoAeSeqAux hfg 0
| n + 1 => max (seqTendstoAeSeqAux hfg (n + 1)) (seqTendstoAeSeq hfg n + 1)
theorem seqTendstoAeSeq_succ (hfg : TendstoInMeasure μ f atTop g) {n : ℕ} :
seqTendstoAeSeq hfg (n + 1) =
max (seqTendstoAeSeqAux hfg (n + 1)) (seqTendstoAeSeq hfg n + 1) := by
rw [seqTendstoAeSeq]
theorem seqTendstoAeSeq_spec (hfg : TendstoInMeasure μ f atTop g) (n k : ℕ)
(hn : seqTendstoAeSeq hfg n ≤ k) :
μ { x | (2 : ℝ)⁻¹ ^ n ≤ dist (f k x) (g x) } ≤ (2 : ℝ≥0∞)⁻¹ ^ n := by
cases n
· exact Classical.choose_spec (exists_nat_measure_lt_two_inv hfg 0) k hn
· exact Classical.choose_spec
(exists_nat_measure_lt_two_inv hfg _) _ (le_trans (le_max_left _ _) hn)
theorem seqTendstoAeSeq_strictMono (hfg : TendstoInMeasure μ f atTop g) :
StrictMono (seqTendstoAeSeq hfg) := by
refine strictMono_nat_of_lt_succ fun n => ?_
rw [seqTendstoAeSeq_succ]
exact lt_of_lt_of_le (lt_add_one <| seqTendstoAeSeq hfg n) (le_max_right _ _)
end ExistsSeqTendstoAe
/-- If `f` is a sequence of functions which converges in measure to `g`, then there exists a
subsequence of `f` which converges a.e. to `g`. -/
theorem TendstoInMeasure.exists_seq_tendsto_ae (hfg : TendstoInMeasure μ f atTop g) :
∃ ns : ℕ → ℕ, StrictMono ns ∧ ∀ᵐ x ∂μ, Tendsto (fun i => f (ns i) x) atTop (𝓝 (g x)) := by
/- Since `f` tends to `g` in measure, it has a subsequence `k ↦ f (ns k)` such that
`μ {|f (ns k) - g| ≥ 2⁻ᵏ} ≤ 2⁻ᵏ` for all `k`. Defining
`s := ⋂ k, ⋃ i ≥ k, {|f (ns k) - g| ≥ 2⁻ᵏ}`, we see that `μ s = 0` by the
first Borel-Cantelli lemma.
On the other hand, as `s` is precisely the set for which `f (ns k)`
doesn't converge to `g`, `f (ns k)` converges almost everywhere to `g` as required. -/
have h_lt_ε_real : ∀ (ε : ℝ) (_ : 0 < ε), ∃ k : ℕ, 2 * (2 : ℝ)⁻¹ ^ k < ε := by
intro ε hε
obtain ⟨k, h_k⟩ : ∃ k : ℕ, (2 : ℝ)⁻¹ ^ k < ε := exists_pow_lt_of_lt_one hε (by norm_num)
refine ⟨k + 1, (le_of_eq ?_).trans_lt h_k⟩
rw [pow_add]; ring
set ns := ExistsSeqTendstoAe.seqTendstoAeSeq hfg
use ns
let S := fun k => { x | (2 : ℝ)⁻¹ ^ k ≤ dist (f (ns k) x) (g x) }
have hμS_le : ∀ k, μ (S k) ≤ (2 : ℝ≥0∞)⁻¹ ^ k :=
fun k => ExistsSeqTendstoAe.seqTendstoAeSeq_spec hfg k (ns k) le_rfl
set s := Filter.atTop.limsup S with hs
have hμs : μ s = 0 := by
refine measure_limsup_eq_zero (ne_of_lt <| lt_of_le_of_lt (ENNReal.tsum_le_tsum hμS_le) ?_)
simp only [ENNReal.tsum_geometric, ENNReal.one_sub_inv_two, ENNReal.two_lt_top, inv_inv]
have h_tendsto : ∀ x ∈ sᶜ, Tendsto (fun i => f (ns i) x) atTop (𝓝 (g x)) := by
refine fun x hx => Metric.tendsto_atTop.mpr fun ε hε => ?_
rw [hs, limsup_eq_iInf_iSup_of_nat] at hx
simp only [S, Set.iSup_eq_iUnion, Set.iInf_eq_iInter, Set.compl_iInter, Set.compl_iUnion,
Set.mem_iUnion, Set.mem_iInter, Set.mem_compl_iff, Set.mem_setOf_eq, not_le] at hx
obtain ⟨N, hNx⟩ := hx
obtain ⟨k, hk_lt_ε⟩ := h_lt_ε_real ε hε
refine ⟨max N (k - 1), fun n hn_ge => lt_of_le_of_lt ?_ hk_lt_ε⟩
specialize hNx n ((le_max_left _ _).trans hn_ge)
have h_inv_n_le_k : (2 : ℝ)⁻¹ ^ n ≤ 2 * (2 : ℝ)⁻¹ ^ k := by
rw [mul_comm, ← inv_mul_le_iff' (zero_lt_two' ℝ)]
conv_lhs =>
congr
rw [← pow_one (2 : ℝ)⁻¹]
rw [← pow_add, add_comm]
exact pow_le_pow_of_le_one (one_div (2 : ℝ) ▸ one_half_pos.le) (inv_le_one one_le_two)
((le_tsub_add.trans (add_le_add_right (le_max_right _ _) 1)).trans
(add_le_add_right hn_ge 1))
exact le_trans hNx.le h_inv_n_le_k
rw [ae_iff]
refine ⟨ExistsSeqTendstoAe.seqTendstoAeSeq_strictMono hfg, measure_mono_null (fun x => ?_) hμs⟩
rw [Set.mem_setOf_eq, ← @Classical.not_not (x ∈ s), not_imp_not]
exact h_tendsto x
theorem TendstoInMeasure.exists_seq_tendstoInMeasure_atTop {u : Filter ι} [NeBot u]
[IsCountablyGenerated u] {f : ι → α → E} {g : α → E} (hfg : TendstoInMeasure μ f u g) :
∃ ns : ℕ → ι, TendstoInMeasure μ (fun n => f (ns n)) atTop g := by
obtain ⟨ns, h_tendsto_ns⟩ : ∃ ns : ℕ → ι, Tendsto ns atTop u := exists_seq_tendsto u
exact ⟨ns, fun ε hε => (hfg ε hε).comp h_tendsto_ns⟩
theorem TendstoInMeasure.exists_seq_tendsto_ae' {u : Filter ι} [NeBot u] [IsCountablyGenerated u]
{f : ι → α → E} {g : α → E} (hfg : TendstoInMeasure μ f u g) :
∃ ns : ℕ → ι, ∀ᵐ x ∂μ, Tendsto (fun i => f (ns i) x) atTop (𝓝 (g x)) := by
obtain ⟨ms, hms⟩ := hfg.exists_seq_tendstoInMeasure_atTop
obtain ⟨ns, -, hns⟩ := hms.exists_seq_tendsto_ae
exact ⟨ms ∘ ns, hns⟩
end ExistsSeqTendstoAe
section AEMeasurableOf
variable [MeasurableSpace E] [NormedAddCommGroup E] [BorelSpace E]
theorem TendstoInMeasure.aemeasurable {u : Filter ι} [NeBot u] [IsCountablyGenerated u]
{f : ι → α → E} {g : α → E} (hf : ∀ n, AEMeasurable (f n) μ)
(h_tendsto : TendstoInMeasure μ f u g) : AEMeasurable g μ := by
obtain ⟨ns, hns⟩ := h_tendsto.exists_seq_tendsto_ae'
exact aemeasurable_of_tendsto_metrizable_ae atTop (fun n => hf (ns n)) hns
end AEMeasurableOf
section TendstoInMeasureOf
variable [NormedAddCommGroup E] {p : ℝ≥0∞}
variable {f : ι → α → E} {g : α → E}
/-- This lemma is superceded by `MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm` where we
allow `p = ∞` and only require `AEStronglyMeasurable`. -/
theorem tendstoInMeasure_of_tendsto_eLpNorm_of_stronglyMeasurable (hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ∞) (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
{l : Filter ι} (hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) l (𝓝 0)) :
TendstoInMeasure μ f l g := by
intro ε hε
replace hfg := ENNReal.Tendsto.const_mul
(Tendsto.ennrpow_const p.toReal hfg) (Or.inr <| @ENNReal.ofReal_ne_top (1 / ε ^ p.toReal))
simp only [mul_zero,
ENNReal.zero_rpow_of_pos (ENNReal.toReal_pos hp_ne_zero hp_ne_top)] at hfg
rw [ENNReal.tendsto_nhds_zero] at hfg ⊢
intro δ hδ
refine (hfg δ hδ).mono fun n hn => ?_
refine le_trans ?_ hn
rw [ENNReal.ofReal_div_of_pos (Real.rpow_pos_of_pos hε _), ENNReal.ofReal_one, mul_comm,
mul_one_div, ENNReal.le_div_iff_mul_le _ (Or.inl ENNReal.ofReal_ne_top), mul_comm]
· rw [← ENNReal.ofReal_rpow_of_pos hε]
convert mul_meas_ge_le_pow_eLpNorm' μ hp_ne_zero hp_ne_top ((hf n).sub hg).aestronglyMeasurable
(ENNReal.ofReal ε)
rw [dist_eq_norm, ← ENNReal.ofReal_le_ofReal_iff (norm_nonneg _), ofReal_norm_eq_coe_nnnorm]
exact Iff.rfl
· rw [Ne, ENNReal.ofReal_eq_zero, not_le]
exact Or.inl (Real.rpow_pos_of_pos hε _)
@[deprecated (since := "2024-07-27")]
alias tendstoInMeasure_of_tendsto_snorm_of_stronglyMeasurable :=
tendstoInMeasure_of_tendsto_eLpNorm_of_stronglyMeasurable
/-- This lemma is superceded by `MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm` where we
allow `p = ∞`. -/
theorem tendstoInMeasure_of_tendsto_eLpNorm_of_ne_top (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
(hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : AEStronglyMeasurable g μ) {l : Filter ι}
(hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) l (𝓝 0)) : TendstoInMeasure μ f l g := by
refine TendstoInMeasure.congr (fun i => (hf i).ae_eq_mk.symm) hg.ae_eq_mk.symm ?_
refine tendstoInMeasure_of_tendsto_eLpNorm_of_stronglyMeasurable
hp_ne_zero hp_ne_top (fun i => (hf i).stronglyMeasurable_mk) hg.stronglyMeasurable_mk ?_
have : (fun n => eLpNorm ((hf n).mk (f n) - hg.mk g) p μ) = fun n => eLpNorm (f n - g) p μ := by
ext1 n; refine eLpNorm_congr_ae (EventuallyEq.sub (hf n).ae_eq_mk.symm hg.ae_eq_mk.symm)
rw [this]
exact hfg
@[deprecated (since := "2024-07-27")]
alias tendstoInMeasure_of_tendsto_snorm_of_ne_top := tendstoInMeasure_of_tendsto_eLpNorm_of_ne_top
/-- See also `MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm` which work for general
Lp-convergence for all `p ≠ 0`. -/
theorem tendstoInMeasure_of_tendsto_eLpNorm_top {E} [NormedAddCommGroup E] {f : ι → α → E}
{g : α → E} {l : Filter ι} (hfg : Tendsto (fun n => eLpNorm (f n - g) ∞ μ) l (𝓝 0)) :
TendstoInMeasure μ f l g := by
intro δ hδ
simp only [eLpNorm_exponent_top, eLpNormEssSup] at hfg
rw [ENNReal.tendsto_nhds_zero] at hfg ⊢
intro ε hε
specialize hfg (ENNReal.ofReal δ / 2)
(ENNReal.div_pos_iff.2 ⟨(ENNReal.ofReal_pos.2 hδ).ne.symm, ENNReal.two_ne_top⟩)
refine hfg.mono fun n hn => ?_
simp only [true_and_iff, gt_iff_lt, zero_tsub, zero_le, zero_add, Set.mem_Icc,
Pi.sub_apply] at *
have : essSup (fun x : α => (‖f n x - g x‖₊ : ℝ≥0∞)) μ < ENNReal.ofReal δ :=
lt_of_le_of_lt hn
(ENNReal.half_lt_self (ENNReal.ofReal_pos.2 hδ).ne.symm ENNReal.ofReal_lt_top.ne)
refine ((le_of_eq ?_).trans (ae_lt_of_essSup_lt this).le).trans hε.le
congr with x
simp only [ENNReal.ofReal_le_iff_le_toReal ENNReal.coe_lt_top.ne, ENNReal.coe_toReal, not_lt,
coe_nnnorm, Set.mem_setOf_eq, Set.mem_compl_iff]
rw [← dist_eq_norm (f n x) (g x)]
@[deprecated (since := "2024-07-27")]
alias tendstoInMeasure_of_tendsto_snorm_top := tendstoInMeasure_of_tendsto_eLpNorm_top
/-- Convergence in Lp implies convergence in measure. -/
theorem tendstoInMeasure_of_tendsto_eLpNorm {l : Filter ι} (hp_ne_zero : p ≠ 0)
(hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : AEStronglyMeasurable g μ)
(hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) l (𝓝 0)) : TendstoInMeasure μ f l g := by
by_cases hp_ne_top : p = ∞
· subst hp_ne_top
exact tendstoInMeasure_of_tendsto_eLpNorm_top hfg
· exact tendstoInMeasure_of_tendsto_eLpNorm_of_ne_top hp_ne_zero hp_ne_top hf hg hfg
@[deprecated (since := "2024-07-27")]
alias tendstoInMeasure_of_tendsto_snorm := tendstoInMeasure_of_tendsto_eLpNorm
/-- Convergence in Lp implies convergence in measure. -/
theorem tendstoInMeasure_of_tendsto_Lp [hp : Fact (1 ≤ p)] {f : ι → Lp E p μ} {g : Lp E p μ}
{l : Filter ι} (hfg : Tendsto f l (𝓝 g)) : TendstoInMeasure μ (fun n => f n) l g :=
tendstoInMeasure_of_tendsto_eLpNorm (zero_lt_one.trans_le hp.elim).ne.symm
(fun _ => Lp.aestronglyMeasurable _) (Lp.aestronglyMeasurable _)
((Lp.tendsto_Lp_iff_tendsto_ℒp' _ _).mp hfg)
end TendstoInMeasureOf
end MeasureTheory
|
MeasureTheory\Function\Egorov.lean | /-
Copyright (c) 2022 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying
-/
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
/-!
# Egorov theorem
This file contains the Egorov theorem which states that an almost everywhere convergent
sequence on a finite measure space converges uniformly except on an arbitrarily small set.
This theorem is useful for the Vitali convergence theorem as well as theorems regarding
convergence in measure.
## Main results
* `MeasureTheory.Egorov`: Egorov's theorem which shows that a sequence of almost everywhere
convergent functions converges uniformly except on an arbitrarily small set.
-/
noncomputable section
open scoped Classical
open MeasureTheory NNReal ENNReal Topology
namespace MeasureTheory
open Set Filter TopologicalSpace
variable {α β ι : Type*} {m : MeasurableSpace α} [MetricSpace β] {μ : Measure α}
namespace Egorov
/-- Given a sequence of functions `f` and a function `g`, `notConvergentSeq f g n j` is the
set of elements such that `f k x` and `g x` are separated by at least `1 / (n + 1)` for some
`k ≥ j`.
This definition is useful for Egorov's theorem. -/
def notConvergentSeq [Preorder ι] (f : ι → α → β) (g : α → β) (n : ℕ) (j : ι) : Set α :=
⋃ (k) (_ : j ≤ k), { x | 1 / (n + 1 : ℝ) < dist (f k x) (g x) }
variable {n : ℕ} {i j : ι} {s : Set α} {ε : ℝ} {f : ι → α → β} {g : α → β}
theorem mem_notConvergentSeq_iff [Preorder ι] {x : α} :
x ∈ notConvergentSeq f g n j ↔ ∃ k ≥ j, 1 / (n + 1 : ℝ) < dist (f k x) (g x) := by
simp_rw [notConvergentSeq, Set.mem_iUnion, exists_prop, mem_setOf]
theorem notConvergentSeq_antitone [Preorder ι] : Antitone (notConvergentSeq f g n) :=
fun _ _ hjk => Set.iUnion₂_mono' fun l hl => ⟨l, le_trans hjk hl, Set.Subset.rfl⟩
theorem measure_inter_notConvergentSeq_eq_zero [SemilatticeSup ι] [Nonempty ι]
(hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) (n : ℕ) :
μ (s ∩ ⋂ j, notConvergentSeq f g n j) = 0 := by
simp_rw [Metric.tendsto_atTop, ae_iff] at hfg
rw [← nonpos_iff_eq_zero, ← hfg]
refine measure_mono fun x => ?_
simp only [Set.mem_inter_iff, Set.mem_iInter, mem_notConvergentSeq_iff]
push_neg
rintro ⟨hmem, hx⟩
refine ⟨hmem, 1 / (n + 1 : ℝ), Nat.one_div_pos_of_nat, fun N => ?_⟩
obtain ⟨n, hn₁, hn₂⟩ := hx N
exact ⟨n, hn₁, hn₂.le⟩
theorem notConvergentSeq_measurableSet [Preorder ι] [Countable ι]
(hf : ∀ n, StronglyMeasurable[m] (f n)) (hg : StronglyMeasurable g) :
MeasurableSet (notConvergentSeq f g n j) :=
MeasurableSet.iUnion fun k =>
MeasurableSet.iUnion fun _ =>
StronglyMeasurable.measurableSet_lt stronglyMeasurable_const <| (hf k).dist hg
theorem measure_notConvergentSeq_tendsto_zero [SemilatticeSup ι] [Countable ι]
(hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g) (hsm : MeasurableSet s)
(hs : μ s ≠ ∞) (hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) (n : ℕ) :
Tendsto (fun j => μ (s ∩ notConvergentSeq f g n j)) atTop (𝓝 0) := by
cases' isEmpty_or_nonempty ι with h h
· have : (fun j => μ (s ∩ notConvergentSeq f g n j)) = fun j => 0 := by
simp only [eq_iff_true_of_subsingleton]
rw [this]
exact tendsto_const_nhds
rw [← measure_inter_notConvergentSeq_eq_zero hfg n, Set.inter_iInter]
refine tendsto_measure_iInter (fun n => hsm.inter <| notConvergentSeq_measurableSet hf hg)
(fun k l hkl => Set.inter_subset_inter_right _ <| notConvergentSeq_antitone hkl)
⟨h.some, ne_top_of_le_ne_top hs (measure_mono Set.inter_subset_left)⟩
variable [SemilatticeSup ι] [Nonempty ι] [Countable ι]
theorem exists_notConvergentSeq_lt (hε : 0 < ε) (hf : ∀ n, StronglyMeasurable (f n))
(hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
(hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) (n : ℕ) :
∃ j : ι, μ (s ∩ notConvergentSeq f g n j) ≤ ENNReal.ofReal (ε * 2⁻¹ ^ n) := by
have ⟨N, hN⟩ := (ENNReal.tendsto_atTop ENNReal.zero_ne_top).1
(measure_notConvergentSeq_tendsto_zero hf hg hsm hs hfg n) (ENNReal.ofReal (ε * 2⁻¹ ^ n)) (by
rw [gt_iff_lt, ENNReal.ofReal_pos]
exact mul_pos hε (pow_pos (by norm_num) n))
rw [zero_add] at hN
exact ⟨N, (hN N le_rfl).2⟩
/-- Given some `ε > 0`, `notConvergentSeqLTIndex` provides the index such that
`notConvergentSeq` (intersected with a set of finite measure) has measure less than
`ε * 2⁻¹ ^ n`.
This definition is useful for Egorov's theorem. -/
def notConvergentSeqLTIndex (hε : 0 < ε) (hf : ∀ n, StronglyMeasurable (f n))
(hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
(hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) (n : ℕ) : ι :=
Classical.choose <| exists_notConvergentSeq_lt hε hf hg hsm hs hfg n
theorem notConvergentSeqLTIndex_spec (hε : 0 < ε) (hf : ∀ n, StronglyMeasurable (f n))
(hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
(hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) (n : ℕ) :
μ (s ∩ notConvergentSeq f g n (notConvergentSeqLTIndex hε hf hg hsm hs hfg n)) ≤
ENNReal.ofReal (ε * 2⁻¹ ^ n) :=
Classical.choose_spec <| exists_notConvergentSeq_lt hε hf hg hsm hs hfg n
/-- Given some `ε > 0`, `iUnionNotConvergentSeq` is the union of `notConvergentSeq` with
specific indices such that `iUnionNotConvergentSeq` has measure less equal than `ε`.
This definition is useful for Egorov's theorem. -/
def iUnionNotConvergentSeq (hε : 0 < ε) (hf : ∀ n, StronglyMeasurable (f n))
(hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
(hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) : Set α :=
⋃ n, s ∩ notConvergentSeq f g n (notConvergentSeqLTIndex (half_pos hε) hf hg hsm hs hfg n)
theorem iUnionNotConvergentSeq_measurableSet (hε : 0 < ε) (hf : ∀ n, StronglyMeasurable (f n))
(hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
(hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
MeasurableSet <| iUnionNotConvergentSeq hε hf hg hsm hs hfg :=
MeasurableSet.iUnion fun _ => hsm.inter <| notConvergentSeq_measurableSet hf hg
theorem measure_iUnionNotConvergentSeq (hε : 0 < ε) (hf : ∀ n, StronglyMeasurable (f n))
(hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
(hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
μ (iUnionNotConvergentSeq hε hf hg hsm hs hfg) ≤ ENNReal.ofReal ε := by
refine le_trans (measure_iUnion_le _) (le_trans
(ENNReal.tsum_le_tsum <| notConvergentSeqLTIndex_spec (half_pos hε) hf hg hsm hs hfg) ?_)
simp_rw [ENNReal.ofReal_mul (half_pos hε).le]
rw [ENNReal.tsum_mul_left, ← ENNReal.ofReal_tsum_of_nonneg, inv_eq_one_div, tsum_geometric_two,
← ENNReal.ofReal_mul (half_pos hε).le, div_mul_cancel₀ ε two_ne_zero]
· intro n; positivity
· rw [inv_eq_one_div]
exact summable_geometric_two
theorem iUnionNotConvergentSeq_subset (hε : 0 < ε) (hf : ∀ n, StronglyMeasurable (f n))
(hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
(hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
iUnionNotConvergentSeq hε hf hg hsm hs hfg ⊆ s := by
rw [iUnionNotConvergentSeq, ← Set.inter_iUnion]
exact Set.inter_subset_left
theorem tendstoUniformlyOn_diff_iUnionNotConvergentSeq (hε : 0 < ε)
(hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g) (hsm : MeasurableSet s)
(hs : μ s ≠ ∞) (hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
TendstoUniformlyOn f g atTop (s \ Egorov.iUnionNotConvergentSeq hε hf hg hsm hs hfg) := by
rw [Metric.tendstoUniformlyOn_iff]
intro δ hδ
obtain ⟨N, hN⟩ := exists_nat_one_div_lt hδ
rw [eventually_atTop]
refine ⟨Egorov.notConvergentSeqLTIndex (half_pos hε) hf hg hsm hs hfg N, fun n hn x hx => ?_⟩
simp only [Set.mem_diff, Egorov.iUnionNotConvergentSeq, not_exists, Set.mem_iUnion,
Set.mem_inter_iff, not_and, exists_and_left] at hx
obtain ⟨hxs, hx⟩ := hx
specialize hx hxs N
rw [Egorov.mem_notConvergentSeq_iff] at hx
push_neg at hx
rw [dist_comm]
exact lt_of_le_of_lt (hx n hn) hN
end Egorov
variable [SemilatticeSup ι] [Nonempty ι] [Countable ι] {γ : Type*} [TopologicalSpace γ]
{f : ι → α → β} {g : α → β} {s : Set α}
/-- **Egorov's theorem**: If `f : ι → α → β` is a sequence of strongly measurable functions that
converges to `g : α → β` almost everywhere on a measurable set `s` of finite measure,
then for all `ε > 0`, there exists a subset `t ⊆ s` such that `μ t ≤ ε` and `f` converges to `g`
uniformly on `s \ t`. We require the index type `ι` to be countable, and usually `ι = ℕ`.
In other words, a sequence of almost everywhere convergent functions converges uniformly except on
an arbitrarily small set. -/
theorem tendstoUniformlyOn_of_ae_tendsto (hf : ∀ n, StronglyMeasurable (f n))
(hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
(hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) {ε : ℝ} (hε : 0 < ε) :
∃ t ⊆ s, MeasurableSet t ∧ μ t ≤ ENNReal.ofReal ε ∧ TendstoUniformlyOn f g atTop (s \ t) :=
⟨Egorov.iUnionNotConvergentSeq hε hf hg hsm hs hfg,
Egorov.iUnionNotConvergentSeq_subset hε hf hg hsm hs hfg,
Egorov.iUnionNotConvergentSeq_measurableSet hε hf hg hsm hs hfg,
Egorov.measure_iUnionNotConvergentSeq hε hf hg hsm hs hfg,
Egorov.tendstoUniformlyOn_diff_iUnionNotConvergentSeq hε hf hg hsm hs hfg⟩
/-- Egorov's theorem for finite measure spaces. -/
theorem tendstoUniformlyOn_of_ae_tendsto' [IsFiniteMeasure μ] (hf : ∀ n, StronglyMeasurable (f n))
(hg : StronglyMeasurable g) (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) {ε : ℝ}
(hε : 0 < ε) :
∃ t, MeasurableSet t ∧ μ t ≤ ENNReal.ofReal ε ∧ TendstoUniformlyOn f g atTop tᶜ := by
have ⟨t, _, ht, htendsto⟩ := tendstoUniformlyOn_of_ae_tendsto hf hg MeasurableSet.univ
(measure_ne_top μ Set.univ) (by filter_upwards [hfg] with _ htendsto _ using htendsto) hε
refine ⟨_, ht, ?_⟩
rwa [Set.compl_eq_univ_diff]
end MeasureTheory
|
MeasureTheory\Function\EssSup.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order
import Mathlib.Order.Filter.ENNReal
/-!
# Essential supremum and infimum
We define the essential supremum and infimum of a function `f : α → β` with respect to a measure
`μ` on `α`. The essential supremum is the infimum of the constants `c : β` such that `f x ≤ c`
almost everywhere.
TODO: The essential supremum of functions `α → ℝ≥0∞` is used in particular to define the norm in
the `L∞` space (see `Mathlib.MeasureTheory.Function.LpSpace`).
There is a different quantity which is sometimes also called essential supremum: the least
upper-bound among measurable functions of a family of measurable functions (in an almost-everywhere
sense). We do not define that quantity here, which is simply the supremum of a map with values in
`α →ₘ[μ] β` (see `Mathlib.MeasureTheory.Function.AEEqFun`).
## Main definitions
* `essSup f μ := (ae μ).limsup f`
* `essInf f μ := (ae μ).liminf f`
-/
open MeasureTheory Filter Set TopologicalSpace
open ENNReal MeasureTheory NNReal
variable {α β : Type*} {m : MeasurableSpace α} {μ ν : Measure α}
section ConditionallyCompleteLattice
variable [ConditionallyCompleteLattice β]
/-- Essential supremum of `f` with respect to measure `μ`: the smallest `c : β` such that
`f x ≤ c` a.e. -/
def essSup {_ : MeasurableSpace α} (f : α → β) (μ : Measure α) :=
(ae μ).limsup f
/-- Essential infimum of `f` with respect to measure `μ`: the greatest `c : β` such that
`c ≤ f x` a.e. -/
def essInf {_ : MeasurableSpace α} (f : α → β) (μ : Measure α) :=
(ae μ).liminf f
theorem essSup_congr_ae {f g : α → β} (hfg : f =ᵐ[μ] g) : essSup f μ = essSup g μ :=
limsup_congr hfg
theorem essInf_congr_ae {f g : α → β} (hfg : f =ᵐ[μ] g) : essInf f μ = essInf g μ :=
@essSup_congr_ae α βᵒᵈ _ _ _ _ _ hfg
@[simp]
theorem essSup_const' [NeZero μ] (c : β) : essSup (fun _ : α => c) μ = c :=
limsup_const _
@[simp]
theorem essInf_const' [NeZero μ] (c : β) : essInf (fun _ : α => c) μ = c :=
liminf_const _
theorem essSup_const (c : β) (hμ : μ ≠ 0) : essSup (fun _ : α => c) μ = c :=
have := NeZero.mk hμ; essSup_const' _
theorem essInf_const (c : β) (hμ : μ ≠ 0) : essInf (fun _ : α => c) μ = c :=
have := NeZero.mk hμ; essInf_const' _
end ConditionallyCompleteLattice
section ConditionallyCompleteLinearOrder
variable [ConditionallyCompleteLinearOrder β] {x : β} {f : α → β}
theorem essSup_eq_sInf {m : MeasurableSpace α} (μ : Measure α) (f : α → β) :
essSup f μ = sInf { a | μ { x | a < f x } = 0 } := by
dsimp [essSup, limsup, limsSup]
simp only [eventually_map, ae_iff, not_le]
theorem essInf_eq_sSup {m : MeasurableSpace α} (μ : Measure α) (f : α → β) :
essInf f μ = sSup { a | μ { x | f x < a } = 0 } := by
dsimp [essInf, liminf, limsInf]
simp only [eventually_map, ae_iff, not_le]
theorem ae_lt_of_essSup_lt (hx : essSup f μ < x)
(hf : IsBoundedUnder (· ≤ ·) (ae μ) f := by isBoundedDefault) :
∀ᵐ y ∂μ, f y < x :=
eventually_lt_of_limsup_lt hx hf
theorem ae_lt_of_lt_essInf (hx : x < essInf f μ)
(hf : IsBoundedUnder (· ≥ ·) (ae μ) f := by isBoundedDefault) :
∀ᵐ y ∂μ, x < f y :=
eventually_lt_of_lt_liminf hx hf
variable [TopologicalSpace β] [FirstCountableTopology β] [OrderTopology β]
theorem ae_le_essSup
(hf : IsBoundedUnder (· ≤ ·) (ae μ) f := by isBoundedDefault) :
∀ᵐ y ∂μ, f y ≤ essSup f μ :=
eventually_le_limsup hf
theorem ae_essInf_le
(hf : IsBoundedUnder (· ≥ ·) (ae μ) f := by isBoundedDefault) :
∀ᵐ y ∂μ, essInf f μ ≤ f y :=
eventually_liminf_le hf
theorem meas_essSup_lt
(hf : IsBoundedUnder (· ≤ ·) (ae μ) f := by isBoundedDefault) :
μ { y | essSup f μ < f y } = 0 := by
simp_rw [← not_le]
exact ae_le_essSup hf
theorem meas_lt_essInf
(hf : IsBoundedUnder (· ≥ ·) (ae μ) f := by isBoundedDefault) :
μ { y | f y < essInf f μ } = 0 := by
simp_rw [← not_le]
exact ae_essInf_le hf
end ConditionallyCompleteLinearOrder
section CompleteLattice
variable [CompleteLattice β]
@[simp]
theorem essSup_measure_zero {m : MeasurableSpace α} {f : α → β} : essSup f (0 : Measure α) = ⊥ :=
le_bot_iff.mp (sInf_le (by simp [Set.mem_setOf_eq, EventuallyLE, ae_iff]))
@[simp]
theorem essInf_measure_zero {_ : MeasurableSpace α} {f : α → β} : essInf f (0 : Measure α) = ⊤ :=
@essSup_measure_zero α βᵒᵈ _ _ _
theorem essSup_mono_ae {f g : α → β} (hfg : f ≤ᵐ[μ] g) : essSup f μ ≤ essSup g μ :=
limsup_le_limsup hfg
theorem essInf_mono_ae {f g : α → β} (hfg : f ≤ᵐ[μ] g) : essInf f μ ≤ essInf g μ :=
liminf_le_liminf hfg
theorem essSup_le_of_ae_le {f : α → β} (c : β) (hf : f ≤ᵐ[μ] fun _ => c) : essSup f μ ≤ c :=
limsup_le_of_le (by isBoundedDefault) hf
theorem le_essInf_of_ae_le {f : α → β} (c : β) (hf : (fun _ => c) ≤ᵐ[μ] f) : c ≤ essInf f μ :=
@essSup_le_of_ae_le α βᵒᵈ _ _ _ _ c hf
theorem essSup_const_bot : essSup (fun _ : α => (⊥ : β)) μ = (⊥ : β) :=
limsup_const_bot
theorem essInf_const_top : essInf (fun _ : α => (⊤ : β)) μ = (⊤ : β) :=
liminf_const_top
theorem OrderIso.essSup_apply {m : MeasurableSpace α} {γ} [CompleteLattice γ] (f : α → β)
(μ : Measure α) (g : β ≃o γ) : g (essSup f μ) = essSup (fun x => g (f x)) μ := by
refine OrderIso.limsup_apply g ?_ ?_ ?_ ?_
all_goals isBoundedDefault
theorem OrderIso.essInf_apply {_ : MeasurableSpace α} {γ} [CompleteLattice γ] (f : α → β)
(μ : Measure α) (g : β ≃o γ) : g (essInf f μ) = essInf (fun x => g (f x)) μ :=
@OrderIso.essSup_apply α βᵒᵈ _ _ γᵒᵈ _ _ _ g.dual
theorem essSup_mono_measure {f : α → β} (hμν : ν ≪ μ) : essSup f ν ≤ essSup f μ := by
refine limsup_le_limsup_of_le (Measure.ae_le_iff_absolutelyContinuous.mpr hμν) ?_ ?_
all_goals isBoundedDefault
theorem essSup_mono_measure' {α : Type*} {β : Type*} {_ : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α} [CompleteLattice β] {f : α → β} (hμν : ν ≤ μ) :
essSup f ν ≤ essSup f μ :=
essSup_mono_measure (Measure.absolutelyContinuous_of_le hμν)
theorem essInf_antitone_measure {f : α → β} (hμν : μ ≪ ν) : essInf f ν ≤ essInf f μ := by
refine liminf_le_liminf_of_le (Measure.ae_le_iff_absolutelyContinuous.mpr hμν) ?_ ?_
all_goals isBoundedDefault
theorem essSup_smul_measure {f : α → β} {c : ℝ≥0∞} (hc : c ≠ 0) :
essSup f (c • μ) = essSup f μ := by
simp_rw [essSup, Measure.ae_smul_measure_eq hc]
section TopologicalSpace
variable {γ : Type*} {mγ : MeasurableSpace γ} {f : α → γ} {g : γ → β}
theorem essSup_comp_le_essSup_map_measure (hf : AEMeasurable f μ) :
essSup (g ∘ f) μ ≤ essSup g (Measure.map f μ) := by
refine limsSup_le_limsSup_of_le ?_
rw [← Filter.map_map]
exact Filter.map_mono (Measure.tendsto_ae_map hf)
theorem MeasurableEmbedding.essSup_map_measure (hf : MeasurableEmbedding f) :
essSup g (Measure.map f μ) = essSup (g ∘ f) μ := by
refine le_antisymm ?_ (essSup_comp_le_essSup_map_measure hf.measurable.aemeasurable)
refine limsSup_le_limsSup (by isBoundedDefault) (by isBoundedDefault) (fun c h_le => ?_)
rw [eventually_map] at h_le ⊢
exact hf.ae_map_iff.mpr h_le
variable [MeasurableSpace β] [TopologicalSpace β] [SecondCountableTopology β]
[OrderClosedTopology β] [OpensMeasurableSpace β]
theorem essSup_map_measure_of_measurable (hg : Measurable g) (hf : AEMeasurable f μ) :
essSup g (Measure.map f μ) = essSup (g ∘ f) μ := by
refine le_antisymm ?_ (essSup_comp_le_essSup_map_measure hf)
refine limsSup_le_limsSup (by isBoundedDefault) (by isBoundedDefault) (fun c h_le => ?_)
rw [eventually_map] at h_le ⊢
rw [ae_map_iff hf (measurableSet_le hg measurable_const)]
exact h_le
theorem essSup_map_measure (hg : AEMeasurable g (Measure.map f μ)) (hf : AEMeasurable f μ) :
essSup g (Measure.map f μ) = essSup (g ∘ f) μ := by
rw [essSup_congr_ae hg.ae_eq_mk, essSup_map_measure_of_measurable hg.measurable_mk hf]
refine essSup_congr_ae ?_
have h_eq := ae_of_ae_map hf hg.ae_eq_mk
rw [← EventuallyEq] at h_eq
exact h_eq.symm
end TopologicalSpace
end CompleteLattice
namespace ENNReal
variable {f : α → ℝ≥0∞}
lemma essSup_piecewise {s : Set α} [DecidablePred (· ∈ s)] {g} (hs : MeasurableSet s) :
essSup (s.piecewise f g) μ = max (essSup f (μ.restrict s)) (essSup g (μ.restrict sᶜ)) := by
simp only [essSup, limsup_piecewise, blimsup_eq_limsup, ae_restrict_eq, hs, hs.compl]; rfl
theorem essSup_indicator_eq_essSup_restrict {s : Set α} {f : α → ℝ≥0∞} (hs : MeasurableSet s) :
essSup (s.indicator f) μ = essSup f (μ.restrict s) := by
classical
simp only [← piecewise_eq_indicator, essSup_piecewise hs, max_eq_left_iff]
exact limsup_const_bot.trans_le (zero_le _)
theorem ae_le_essSup (f : α → ℝ≥0∞) : ∀ᵐ y ∂μ, f y ≤ essSup f μ :=
eventually_le_limsup f
@[simp]
theorem essSup_eq_zero_iff : essSup f μ = 0 ↔ f =ᵐ[μ] 0 :=
limsup_eq_zero_iff
theorem essSup_const_mul {a : ℝ≥0∞} : essSup (fun x : α => a * f x) μ = a * essSup f μ :=
limsup_const_mul
theorem essSup_mul_le (f g : α → ℝ≥0∞) : essSup (f * g) μ ≤ essSup f μ * essSup g μ :=
limsup_mul_le f g
theorem essSup_add_le (f g : α → ℝ≥0∞) : essSup (f + g) μ ≤ essSup f μ + essSup g μ :=
limsup_add_le f g
theorem essSup_liminf_le {ι} [Countable ι] [LinearOrder ι] (f : ι → α → ℝ≥0∞) :
essSup (fun x => atTop.liminf fun n => f n x) μ ≤
atTop.liminf fun n => essSup (fun x => f n x) μ := by
simp_rw [essSup]
exact ENNReal.limsup_liminf_le_liminf_limsup fun a b => f b a
theorem coe_essSup {f : α → ℝ≥0} (hf : IsBoundedUnder (· ≤ ·) (ae μ) f) :
((essSup f μ : ℝ≥0) : ℝ≥0∞) = essSup (fun x => (f x : ℝ≥0∞)) μ :=
(ENNReal.coe_sInf <| hf).trans <|
eq_of_forall_le_iff fun r => by
simp [essSup, limsup, limsSup, eventually_map, ENNReal.forall_ennreal]; rfl
lemma essSup_restrict_eq_of_support_subset {s : Set α} {f : α → ℝ≥0∞} (hsf : f.support ⊆ s) :
essSup f (μ.restrict s) = essSup f μ := by
apply le_antisymm (essSup_mono_measure' Measure.restrict_le_self)
apply le_of_forall_lt (fun c hc ↦ ?_)
obtain ⟨d, cd, hd⟩ : ∃ d, c < d ∧ d < essSup f μ := exists_between hc
let t := {x | d < f x}
have A : 0 < (μ.restrict t) t := by
simp only [Measure.restrict_apply_self]
rw [essSup_eq_sInf] at hd
have : d ∉ {a | μ {x | a < f x} = 0} := not_mem_of_lt_csInf hd (OrderBot.bddBelow _)
exact bot_lt_iff_ne_bot.2 this
have B : 0 < (μ.restrict s) t := by
have : μ.restrict t ≤ μ.restrict s := by
apply Measure.restrict_mono _ le_rfl
apply subset_trans _ hsf
intro x (hx : d < f x)
exact (lt_of_le_of_lt bot_le hx).ne'
exact lt_of_lt_of_le A (this _)
apply cd.trans_le
rw [essSup_eq_sInf]
apply le_sInf (fun b hb ↦ ?_)
contrapose! hb
exact ne_of_gt (B.trans_le (measure_mono (fun x hx ↦ hb.trans hx)))
end ENNReal
|
MeasureTheory\Function\Floor.lean | /-
Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury G. Kudryashov
-/
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order
/-!
# Measurability of `⌊x⌋` etc
In this file we prove that `Int.floor`, `Int.ceil`, `Int.fract`, `Nat.floor`, and `Nat.ceil` are
measurable under some assumptions on the (semi)ring.
-/
open Set
section FloorRing
variable {α R : Type*} [MeasurableSpace α] [LinearOrderedRing R] [FloorRing R] [TopologicalSpace R]
[OrderTopology R] [MeasurableSpace R]
theorem Int.measurable_floor [OpensMeasurableSpace R] : Measurable (Int.floor : R → ℤ) :=
measurable_to_countable fun x => by
simpa only [Int.preimage_floor_singleton] using measurableSet_Ico
@[measurability]
theorem Measurable.floor [OpensMeasurableSpace R] {f : α → R} (hf : Measurable f) :
Measurable fun x => ⌊f x⌋ :=
Int.measurable_floor.comp hf
theorem Int.measurable_ceil [OpensMeasurableSpace R] : Measurable (Int.ceil : R → ℤ) :=
measurable_to_countable fun x => by
simpa only [Int.preimage_ceil_singleton] using measurableSet_Ioc
@[measurability]
theorem Measurable.ceil [OpensMeasurableSpace R] {f : α → R} (hf : Measurable f) :
Measurable fun x => ⌈f x⌉ :=
Int.measurable_ceil.comp hf
theorem measurable_fract [BorelSpace R] : Measurable (Int.fract : R → R) := by
intro s hs
rw [Int.preimage_fract]
exact MeasurableSet.iUnion fun z => measurable_id.sub_const _ (hs.inter measurableSet_Ico)
@[measurability]
theorem Measurable.fract [BorelSpace R] {f : α → R} (hf : Measurable f) :
Measurable fun x => Int.fract (f x) :=
measurable_fract.comp hf
theorem MeasurableSet.image_fract [BorelSpace R] {s : Set R} (hs : MeasurableSet s) :
MeasurableSet (Int.fract '' s) := by
simp only [Int.image_fract, sub_eq_add_neg, image_add_right']
exact MeasurableSet.iUnion fun m => (measurable_add_const _ hs).inter measurableSet_Ico
end FloorRing
section FloorSemiring
variable {α R : Type*} [MeasurableSpace α] [LinearOrderedSemiring R] [FloorSemiring R]
[TopologicalSpace R] [OrderTopology R] [MeasurableSpace R] [OpensMeasurableSpace R] {f : α → R}
theorem Nat.measurable_floor : Measurable (Nat.floor : R → ℕ) :=
measurable_to_countable fun n => by
rcases eq_or_ne ⌊n⌋₊ 0 with h | h <;> simp [h, Nat.preimage_floor_of_ne_zero, -floor_eq_zero]
@[measurability]
theorem Measurable.nat_floor (hf : Measurable f) : Measurable fun x => ⌊f x⌋₊ :=
Nat.measurable_floor.comp hf
theorem Nat.measurable_ceil : Measurable (Nat.ceil : R → ℕ) :=
measurable_to_countable fun n => by
rcases eq_or_ne ⌈n⌉₊ 0 with h | h <;> simp_all [h, Nat.preimage_ceil_of_ne_zero, -ceil_eq_zero]
@[measurability]
theorem Measurable.nat_ceil (hf : Measurable f) : Measurable fun x => ⌈f x⌉₊ :=
Nat.measurable_ceil.comp hf
end FloorSemiring
|
MeasureTheory\Function\Intersectivity.lean | /-
Copyright (c) 2023 Yaël Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yaël Dillies
-/
import Mathlib.MeasureTheory.Integral.Average
/-!
# Bergelson's intersectivity lemma
This file proves the Bergelson intersectivity lemma: In a finite measure space, a sequence of events
that have measure at least `r` has an infinite subset whose finite intersections all have positive
volume.
This is in some sense a finitary version of the second Borel-Cantelli lemma.
## References
[Bergelson, *Sets of recurrence of `ℤᵐ`-actions and properties of sets of differences in
`ℤᵐ`][bergelson1985]
## TODO
Restate the theorem using the upper density of a set of naturals, once we have it. This will make
`bergelson'` be actually strong (and please then rename it to `strong_bergelson`).
Use the ergodic theorem to deduce the refinement of the Poincaré recurrence theorem proved by
Bergelson.
-/
open Filter Function MeasureTheory Set
open scoped ENNReal
variable {ι α : Type*} [MeasurableSpace α] {μ : Measure α} [IsFiniteMeasure μ] {r : ℝ≥0∞}
/-- **Bergelson Intersectivity Lemma**: In a finite measure space, a sequence of events that have
measure at least `r` has an infinite subset whose finite intersections all have positive volume.
TODO: The infinity of `t` should be strengthened to `t` having positive natural density. -/
lemma bergelson' {s : ℕ → Set α} (hs : ∀ n, MeasurableSet (s n)) (hr₀ : r ≠ 0)
(hr : ∀ n, r ≤ μ (s n)) :
∃ t : Set ℕ, t.Infinite ∧ ∀ ⦃u⦄, u ⊆ t → u.Finite → 0 < μ (⋂ n ∈ u, s n) := by
-- We let `M f` be the set on which the norm of `f` exceeds its essential supremum, and `N` be the
-- union of `M` of the finite products of the indicators of the `s n`.
let M (f : α → ℝ) : Set α := {x | eLpNormEssSup f μ < ‖f x‖₊}
let N : Set α := ⋃ u : Finset ℕ, M (Set.indicator (⋂ n ∈ u, s n) 1)
-- `N` is a null set since `M f` is a null set for each `f`.
have hN₀ : μ N = 0 := measure_iUnion_null fun u ↦ meas_eLpNormEssSup_lt
-- The important thing about `N` is that if we remove `N` from our space, then finite unions of
-- the `s n` are null iff they are empty.
have hN₁ (u : Finset ℕ) : ((⋂ n ∈ u, s n) \ N).Nonempty → 0 < μ (⋂ n ∈ u, s n) := by
simp_rw [pos_iff_ne_zero]
rintro ⟨x, hx⟩ hu
refine hx.2 (mem_iUnion.2 ⟨u, ?_⟩)
rw [mem_setOf, indicator_of_mem hx.1, eLpNormEssSup_eq_zero_iff.2]
· simp
· rwa [indicator_ae_eq_zero, Function.support_one, inter_univ]
-- Define `f n` to be the average of the first `n + 1` indicators of the `s k`.
let f (n : ℕ) : α → ℝ≥0∞ := (↑(n + 1) : ℝ≥0∞)⁻¹ • ∑ k in Finset.range (n + 1), (s k).indicator 1
-- We gather a few simple properties of `f`.
have hfapp : ∀ n a, f n a = (↑(n + 1))⁻¹ * ∑ k in Finset.range (n + 1), (s k).indicator 1 a := by
simp only [f, Pi.natCast_def, Pi.smul_apply, Pi.inv_apply, Finset.sum_apply, eq_self_iff_true,
forall_const, imp_true_iff, smul_eq_mul]
have hf n : Measurable (f n) := Measurable.mul' (@measurable_const ℝ≥0∞ _ _ _ (↑(n + 1))⁻¹)
(Finset.measurable_sum' _ fun i _ ↦ measurable_one.indicator $ hs i)
have hf₁ n : f n ≤ 1 := by
rintro a
rw [hfapp, ← ENNReal.div_eq_inv_mul]
refine (ENNReal.div_le_iff_le_mul (Or.inl $ Nat.cast_ne_zero.2 n.succ_ne_zero) $
Or.inr one_ne_zero).2 ?_
rw [mul_comm, ← nsmul_eq_mul, ← Finset.card_range n.succ]
exact Finset.sum_le_card_nsmul _ _ _ fun _ _ ↦ indicator_le (fun _ _ ↦ le_rfl) _
-- By assumption, `f n` has integral at least `r`.
have hrf n : r ≤ ∫⁻ a, f n a ∂μ := by
simp_rw [hfapp]
rw [lintegral_const_mul _ (Finset.measurable_sum _ fun _ _ ↦ measurable_one.indicator $ hs _),
lintegral_finset_sum _ fun _ _ ↦ measurable_one.indicator (hs _)]
simp only [lintegral_indicator_one (hs _)]
rw [← ENNReal.div_eq_inv_mul, ENNReal.le_div_iff_mul_le (by simp) (by simp), ← nsmul_eq_mul']
simpa using Finset.card_nsmul_le_sum (Finset.range (n + 1)) _ _ fun _ _ ↦ hr _
-- Collect some basic fact
have hμ : μ ≠ 0 := by rintro rfl; exact hr₀ $ le_bot_iff.1 $ hr 0
have : ∫⁻ x, limsup (f · x) atTop ∂μ ≤ μ univ := by
rw [← lintegral_one]
exact lintegral_mono fun a ↦ limsup_le_of_le ⟨0, fun R _ ↦ bot_le⟩ $
eventually_of_forall fun n ↦ hf₁ _ _
-- By the first moment method, there exists some `x ∉ N` such that `limsup f n x` is at least `r`.
obtain ⟨x, hxN, hx⟩ := exists_not_mem_null_laverage_le hμ
(ne_top_of_le_ne_top (measure_ne_top μ univ) this) hN₀
replace hx : r / μ univ ≤ limsup (f · x) atTop :=
calc
_ ≤ limsup (⨍⁻ x, f · x ∂μ) atTop := le_limsup_of_le ⟨1, eventually_map.2 ?_⟩ fun b hb ↦ ?_
_ ≤ ⨍⁻ x, limsup (f · x) atTop ∂μ := limsup_lintegral_le 1 hf (ae_of_all _ $ hf₁ ·) (by simp)
_ ≤ limsup (f · x) atTop := hx
-- This exactly means that the `s n` containing `x` have all their finite intersection non-null.
· refine ⟨{n | x ∈ s n}, fun hxs ↦ ?_, fun u hux hu ↦ ?_⟩
-- This next block proves that a set of strictly positive natural density is infinite, mixed
-- with the fact that `{n | x ∈ s n}` has strictly positive natural density.
-- TODO: Separate it out to a lemma once we have a natural density API.
· refine ENNReal.div_ne_zero.2 ⟨hr₀, measure_ne_top _ _⟩ $ eq_bot_mono hx $ Tendsto.limsup_eq $
tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds
(h := fun n ↦ (n.succ : ℝ≥0∞)⁻¹ * hxs.toFinset.card) ?_ bot_le fun n ↦ mul_le_mul_left' ?_ _
· simpa using ENNReal.Tendsto.mul_const (ENNReal.tendsto_inv_nat_nhds_zero.comp $
tendsto_add_atTop_nat 1) (.inr $ ENNReal.natCast_ne_top _)
· classical
simpa only [Finset.sum_apply, indicator_apply, Pi.one_apply, Finset.sum_boole, Nat.cast_le]
using Finset.card_le_card fun m hm ↦ hxs.mem_toFinset.2 (Finset.mem_filter.1 hm).2
· simp_rw [← hu.mem_toFinset]
exact hN₁ _ ⟨x, mem_iInter₂.2 fun n hn ↦ hux $ hu.mem_toFinset.1 hn, hxN⟩
· refine eventually_of_forall fun n ↦ ?_
obtain rfl | _ := eq_zero_or_neZero μ
· simp
· rw [← laverage_const μ 1]
exact lintegral_mono (hf₁ _)
· obtain ⟨n, hn⟩ := hb.exists
rw [laverage_eq] at hn
exact (ENNReal.div_le_div_right (hrf _) _).trans hn
/-- **Bergelson Intersectivity Lemma**: In a finite measure space, a sequence of events that have
measure at least `r` has an infinite subset whose finite intersections all have positive volume. -/
lemma bergelson [Infinite ι] {s : ι → Set α} (hs : ∀ i, MeasurableSet (s i)) (hr₀ : r ≠ 0)
(hr : ∀ i, r ≤ μ (s i)) :
∃ t : Set ι, t.Infinite ∧ ∀ ⦃u⦄, u ⊆ t → u.Finite → 0 < μ (⋂ i ∈ u, s i) := by
obtain ⟨t, ht, h⟩ := bergelson' (fun n ↦ hs $ Infinite.natEmbedding _ n) hr₀ (fun n ↦ hr _)
refine ⟨_, ht.image $ (Infinite.natEmbedding _).injective.injOn, fun u hut hu ↦
(h (preimage_subset_of_surjOn (Infinite.natEmbedding _).injective hut) $ hu.preimage
(Embedding.injective _).injOn).trans_le $ measure_mono $ subset_iInter₂ fun i hi ↦ ?_⟩
obtain ⟨n, -, rfl⟩ := hut hi
exact iInter₂_subset n hi
|
MeasureTheory\Function\Jacobian.lean | /-
Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap
import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.MeasureTheory.Constructions.Polish.Basic
import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn
/-!
# Change of variables in higher-dimensional integrals
Let `μ` be a Lebesgue measure on a finite-dimensional real vector space `E`.
Let `f : E → E` be a function which is injective and differentiable on a measurable set `s`,
with derivative `f'`. Then we prove that `f '' s` is measurable, and
its measure is given by the formula `μ (f '' s) = ∫⁻ x in s, |(f' x).det| ∂μ` (where `(f' x).det`
is almost everywhere measurable, but not Borel-measurable in general). This formula is proved in
`lintegral_abs_det_fderiv_eq_addHaar_image`. We deduce the change of variables
formula for the Lebesgue and Bochner integrals, in `lintegral_image_eq_lintegral_abs_det_fderiv_mul`
and `integral_image_eq_integral_abs_det_fderiv_smul` respectively.
## Main results
* `addHaar_image_eq_zero_of_differentiableOn_of_addHaar_eq_zero`: if `f` is differentiable on a
set `s` with zero measure, then `f '' s` also has zero measure.
* `addHaar_image_eq_zero_of_det_fderivWithin_eq_zero`: if `f` is differentiable on a set `s`, and
its derivative is never invertible, then `f '' s` has zero measure (a version of Sard's lemma).
* `aemeasurable_fderivWithin`: if `f` is differentiable on a measurable set `s`, then `f'`
is almost everywhere measurable on `s`.
For the next statements, `s` is a measurable set and `f` is differentiable on `s`
(with a derivative `f'`) and injective on `s`.
* `measurable_image_of_fderivWithin`: the image `f '' s` is measurable.
* `measurableEmbedding_of_fderivWithin`: the function `s.restrict f` is a measurable embedding.
* `lintegral_abs_det_fderiv_eq_addHaar_image`: the image measure is given by
`μ (f '' s) = ∫⁻ x in s, |(f' x).det| ∂μ`.
* `lintegral_image_eq_lintegral_abs_det_fderiv_mul`: for `g : E → ℝ≥0∞`, one has
`∫⁻ x in f '' s, g x ∂μ = ∫⁻ x in s, ENNReal.ofReal |(f' x).det| * g (f x) ∂μ`.
* `integral_image_eq_integral_abs_det_fderiv_smul`: for `g : E → F`, one has
`∫ x in f '' s, g x ∂μ = ∫ x in s, |(f' x).det| • g (f x) ∂μ`.
* `integrableOn_image_iff_integrableOn_abs_det_fderiv_smul`: for `g : E → F`, the function `g` is
integrable on `f '' s` if and only if `|(f' x).det| • g (f x))` is integrable on `s`.
## Implementation
Typical versions of these results in the literature have much stronger assumptions: `s` would
typically be open, and the derivative `f' x` would depend continuously on `x` and be invertible
everywhere, to have the local inverse theorem at our disposal. The proof strategy under our weaker
assumptions is more involved. We follow [Fremlin, *Measure Theory* (volume 2)][fremlin_vol2].
The first remark is that, if `f` is sufficiently well approximated by a linear map `A` on a set
`s`, then `f` expands the volume of `s` by at least `A.det - ε` and at most `A.det + ε`, where
the closeness condition depends on `A` in a non-explicit way (see `addHaar_image_le_mul_of_det_lt`
and `mul_le_addHaar_image_of_lt_det`). This fact holds for balls by a simple inclusion argument,
and follows for general sets using the Besicovitch covering theorem to cover the set by balls with
measures adding up essentially to `μ s`.
When `f` is differentiable on `s`, one may partition `s` into countably many subsets `s ∩ t n`
(where `t n` is measurable), on each of which `f` is well approximated by a linear map, so that the
above results apply. See `exists_partition_approximatesLinearOn_of_hasFDerivWithinAt`, which
follows from the pointwise differentiability (in a non-completely trivial way, as one should ensure
a form of uniformity on the sets of the partition).
Combining the above two results would give the conclusion, except for two difficulties: it is not
obvious why `f '' s` and `f'` should be measurable, which prevents us from using countable
additivity for the measure and the integral. It turns out that `f '' s` is indeed measurable,
and that `f'` is almost everywhere measurable, which is enough to recover countable additivity.
The measurability of `f '' s` follows from the deep Lusin-Souslin theorem ensuring that, in a
Polish space, a continuous injective image of a measurable set is measurable.
The key point to check the almost everywhere measurability of `f'` is that, if `f` is approximated
up to `δ` by a linear map on a set `s`, then `f'` is within `δ` of `A` on a full measure subset
of `s` (namely, its density points). With the above approximation argument, it follows that `f'`
is the almost everywhere limit of a sequence of measurable functions (which are constant on the
pieces of the good discretization), and is therefore almost everywhere measurable.
## Tags
Change of variables in integrals
## References
[Fremlin, *Measure Theory* (volume 2)][fremlin_vol2]
-/
open MeasureTheory MeasureTheory.Measure Metric Filter Set FiniteDimensional Asymptotics
TopologicalSpace
open scoped NNReal ENNReal Topology Pointwise
variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
[NormedAddCommGroup F] [NormedSpace ℝ F] {s : Set E} {f : E → E} {f' : E → E →L[ℝ] E}
/-!
### Decomposition lemmas
We state lemmas ensuring that a differentiable function can be approximated, on countably many
measurable pieces, by linear maps (with a prescribed precision depending on the linear map).
-/
/-- Assume that a function `f` has a derivative at every point of a set `s`. Then one may cover `s`
with countably many closed sets `t n` on which `f` is well approximated by linear maps `A n`. -/
theorem exists_closed_cover_approximatesLinearOn_of_hasFDerivWithinAt [SecondCountableTopology F]
(f : E → F) (s : Set E) (f' : E → E →L[ℝ] F) (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x)
(r : (E →L[ℝ] F) → ℝ≥0) (rpos : ∀ A, r A ≠ 0) :
∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] F),
(∀ n, IsClosed (t n)) ∧
(s ⊆ ⋃ n, t n) ∧
(∀ n, ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
(s.Nonempty → ∀ n, ∃ y ∈ s, A n = f' y) := by
/- Choose countably many linear maps `f' z`. For every such map, if `f` has a derivative at `x`
close enough to `f' z`, then `f y - f x` is well approximated by `f' z (y - x)` for `y` close
enough to `x`, say on a ball of radius `r` (or even `u n` for some `n`, where `u` is a fixed
sequence tending to `0`).
Let `M n z` be the points where this happens. Then this set is relatively closed inside `s`,
and moreover in every closed ball of radius `u n / 3` inside it the map is well approximated by
`f' z`. Using countably many closed balls to split `M n z` into small diameter subsets
`K n z p`, one obtains the desired sets `t q` after reindexing.
-/
-- exclude the trivial case where `s` is empty
rcases eq_empty_or_nonempty s with (rfl | hs)
· refine ⟨fun _ => ∅, fun _ => 0, ?_, ?_, ?_, ?_⟩ <;> simp
-- we will use countably many linear maps. Select these from all the derivatives since the
-- space of linear maps is second-countable
obtain ⟨T, T_count, hT⟩ :
∃ T : Set s,
T.Countable ∧ ⋃ x ∈ T, ball (f' (x : E)) (r (f' x)) = ⋃ x : s, ball (f' x) (r (f' x)) :=
TopologicalSpace.isOpen_iUnion_countable _ fun x => isOpen_ball
-- fix a sequence `u` of positive reals tending to zero.
obtain ⟨u, _, u_pos, u_lim⟩ :
∃ u : ℕ → ℝ, StrictAnti u ∧ (∀ n : ℕ, 0 < u n) ∧ Tendsto u atTop (𝓝 0) :=
exists_seq_strictAnti_tendsto (0 : ℝ)
-- `M n z` is the set of points `x` such that `f y - f x` is close to `f' z (y - x)` for `y`
-- in the ball of radius `u n` around `x`.
let M : ℕ → T → Set E := fun n z =>
{x | x ∈ s ∧ ∀ y ∈ s ∩ ball x (u n), ‖f y - f x - f' z (y - x)‖ ≤ r (f' z) * ‖y - x‖}
-- As `f` is differentiable everywhere on `s`, the sets `M n z` cover `s` by design.
have s_subset : ∀ x ∈ s, ∃ (n : ℕ) (z : T), x ∈ M n z := by
intro x xs
obtain ⟨z, zT, hz⟩ : ∃ z ∈ T, f' x ∈ ball (f' (z : E)) (r (f' z)) := by
have : f' x ∈ ⋃ z ∈ T, ball (f' (z : E)) (r (f' z)) := by
rw [hT]
refine mem_iUnion.2 ⟨⟨x, xs⟩, ?_⟩
simpa only [mem_ball, Subtype.coe_mk, dist_self] using (rpos (f' x)).bot_lt
rwa [mem_iUnion₂, bex_def] at this
obtain ⟨ε, εpos, hε⟩ : ∃ ε : ℝ, 0 < ε ∧ ‖f' x - f' z‖ + ε ≤ r (f' z) := by
refine ⟨r (f' z) - ‖f' x - f' z‖, ?_, le_of_eq (by abel)⟩
simpa only [sub_pos] using mem_ball_iff_norm.mp hz
obtain ⟨δ, δpos, hδ⟩ :
∃ (δ : ℝ), 0 < δ ∧ ball x δ ∩ s ⊆ {y | ‖f y - f x - (f' x) (y - x)‖ ≤ ε * ‖y - x‖} :=
Metric.mem_nhdsWithin_iff.1 ((hf' x xs).isLittleO.def εpos)
obtain ⟨n, hn⟩ : ∃ n, u n < δ := ((tendsto_order.1 u_lim).2 _ δpos).exists
refine ⟨n, ⟨z, zT⟩, ⟨xs, ?_⟩⟩
intro y hy
calc
‖f y - f x - (f' z) (y - x)‖ = ‖f y - f x - (f' x) (y - x) + (f' x - f' z) (y - x)‖ := by
congr 1
simp only [ContinuousLinearMap.coe_sub', map_sub, Pi.sub_apply]
abel
_ ≤ ‖f y - f x - (f' x) (y - x)‖ + ‖(f' x - f' z) (y - x)‖ := norm_add_le _ _
_ ≤ ε * ‖y - x‖ + ‖f' x - f' z‖ * ‖y - x‖ := by
refine add_le_add (hδ ?_) (ContinuousLinearMap.le_opNorm _ _)
rw [inter_comm]
exact inter_subset_inter_right _ (ball_subset_ball hn.le) hy
_ ≤ r (f' z) * ‖y - x‖ := by
rw [← add_mul, add_comm]
gcongr
-- the sets `M n z` are relatively closed in `s`, as all the conditions defining it are clearly
-- closed
have closure_M_subset : ∀ n z, s ∩ closure (M n z) ⊆ M n z := by
rintro n z x ⟨xs, hx⟩
refine ⟨xs, fun y hy => ?_⟩
obtain ⟨a, aM, a_lim⟩ : ∃ a : ℕ → E, (∀ k, a k ∈ M n z) ∧ Tendsto a atTop (𝓝 x) :=
mem_closure_iff_seq_limit.1 hx
have L1 :
Tendsto (fun k : ℕ => ‖f y - f (a k) - (f' z) (y - a k)‖) atTop
(𝓝 ‖f y - f x - (f' z) (y - x)‖) := by
apply Tendsto.norm
have L : Tendsto (fun k => f (a k)) atTop (𝓝 (f x)) := by
apply (hf' x xs).continuousWithinAt.tendsto.comp
apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ a_lim
exact eventually_of_forall fun k => (aM k).1
apply Tendsto.sub (tendsto_const_nhds.sub L)
exact ((f' z).continuous.tendsto _).comp (tendsto_const_nhds.sub a_lim)
have L2 : Tendsto (fun k : ℕ => (r (f' z) : ℝ) * ‖y - a k‖) atTop (𝓝 (r (f' z) * ‖y - x‖)) :=
(tendsto_const_nhds.sub a_lim).norm.const_mul _
have I : ∀ᶠ k in atTop, ‖f y - f (a k) - (f' z) (y - a k)‖ ≤ r (f' z) * ‖y - a k‖ := by
have L : Tendsto (fun k => dist y (a k)) atTop (𝓝 (dist y x)) :=
tendsto_const_nhds.dist a_lim
filter_upwards [(tendsto_order.1 L).2 _ hy.2]
intro k hk
exact (aM k).2 y ⟨hy.1, hk⟩
exact le_of_tendsto_of_tendsto L1 L2 I
-- choose a dense sequence `d p`
rcases TopologicalSpace.exists_dense_seq E with ⟨d, hd⟩
-- split `M n z` into subsets `K n z p` of small diameters by intersecting with the ball
-- `closedBall (d p) (u n / 3)`.
let K : ℕ → T → ℕ → Set E := fun n z p => closure (M n z) ∩ closedBall (d p) (u n / 3)
-- on the sets `K n z p`, the map `f` is well approximated by `f' z` by design.
have K_approx : ∀ (n) (z : T) (p), ApproximatesLinearOn f (f' z) (s ∩ K n z p) (r (f' z)) := by
intro n z p x hx y hy
have yM : y ∈ M n z := closure_M_subset _ _ ⟨hy.1, hy.2.1⟩
refine yM.2 _ ⟨hx.1, ?_⟩
calc
dist x y ≤ dist x (d p) + dist y (d p) := dist_triangle_right _ _ _
_ ≤ u n / 3 + u n / 3 := add_le_add hx.2.2 hy.2.2
_ < u n := by linarith [u_pos n]
-- the sets `K n z p` are also closed, again by design.
have K_closed : ∀ (n) (z : T) (p), IsClosed (K n z p) := fun n z p =>
isClosed_closure.inter isClosed_ball
-- reindex the sets `K n z p`, to let them only depend on an integer parameter `q`.
obtain ⟨F, hF⟩ : ∃ F : ℕ → ℕ × T × ℕ, Function.Surjective F := by
haveI : Encodable T := T_count.toEncodable
have : Nonempty T := by
rcases hs with ⟨x, xs⟩
rcases s_subset x xs with ⟨n, z, _⟩
exact ⟨z⟩
inhabit ↥T
exact ⟨_, Encodable.surjective_decode_iget (ℕ × T × ℕ)⟩
-- these sets `t q = K n z p` will do
refine
⟨fun q => K (F q).1 (F q).2.1 (F q).2.2, fun q => f' (F q).2.1, fun n => K_closed _ _ _,
fun x xs => ?_, fun q => K_approx _ _ _, fun _ q => ⟨(F q).2.1, (F q).2.1.1.2, rfl⟩⟩
-- the only fact that needs further checking is that they cover `s`.
-- we already know that any point `x ∈ s` belongs to a set `M n z`.
obtain ⟨n, z, hnz⟩ : ∃ (n : ℕ) (z : T), x ∈ M n z := s_subset x xs
-- by density, it also belongs to a ball `closedBall (d p) (u n / 3)`.
obtain ⟨p, hp⟩ : ∃ p : ℕ, x ∈ closedBall (d p) (u n / 3) := by
have : Set.Nonempty (ball x (u n / 3)) := by simp only [nonempty_ball]; linarith [u_pos n]
obtain ⟨p, hp⟩ : ∃ p : ℕ, d p ∈ ball x (u n / 3) := hd.exists_mem_open isOpen_ball this
exact ⟨p, (mem_ball'.1 hp).le⟩
-- choose `q` for which `t q = K n z p`.
obtain ⟨q, hq⟩ : ∃ q, F q = (n, z, p) := hF _
-- then `x` belongs to `t q`.
apply mem_iUnion.2 ⟨q, _⟩
simp (config := { zeta := false }) only [K, hq, mem_inter_iff, hp, and_true]
exact subset_closure hnz
variable [MeasurableSpace E] [BorelSpace E] (μ : Measure E) [IsAddHaarMeasure μ]
/-- Assume that a function `f` has a derivative at every point of a set `s`. Then one may
partition `s` into countably many disjoint relatively measurable sets (i.e., intersections
of `s` with measurable sets `t n`) on which `f` is well approximated by linear maps `A n`. -/
theorem exists_partition_approximatesLinearOn_of_hasFDerivWithinAt [SecondCountableTopology F]
(f : E → F) (s : Set E) (f' : E → E →L[ℝ] F) (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x)
(r : (E →L[ℝ] F) → ℝ≥0) (rpos : ∀ A, r A ≠ 0) :
∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] F),
Pairwise (Disjoint on t) ∧
(∀ n, MeasurableSet (t n)) ∧
(s ⊆ ⋃ n, t n) ∧
(∀ n, ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
(s.Nonempty → ∀ n, ∃ y ∈ s, A n = f' y) := by
rcases exists_closed_cover_approximatesLinearOn_of_hasFDerivWithinAt f s f' hf' r rpos with
⟨t, A, t_closed, st, t_approx, ht⟩
refine
⟨disjointed t, A, disjoint_disjointed _,
MeasurableSet.disjointed fun n => (t_closed n).measurableSet, ?_, ?_, ht⟩
· rw [iUnion_disjointed]; exact st
· intro n; exact (t_approx n).mono_set (inter_subset_inter_right _ (disjointed_subset _ _))
namespace MeasureTheory
/-!
### Local lemmas
We check that a function which is well enough approximated by a linear map expands the volume
essentially like this linear map, and that its derivative (if it exists) is almost everywhere close
to the approximating linear map.
-/
/-- Let `f` be a function which is sufficiently close (in the Lipschitz sense) to a given linear
map `A`. Then it expands the volume of any set by at most `m` for any `m > det A`. -/
theorem addHaar_image_le_mul_of_det_lt (A : E →L[ℝ] E) {m : ℝ≥0}
(hm : ENNReal.ofReal |A.det| < m) :
∀ᶠ δ in 𝓝[>] (0 : ℝ≥0),
∀ (s : Set E) (f : E → E), ApproximatesLinearOn f A s δ → μ (f '' s) ≤ m * μ s := by
apply nhdsWithin_le_nhds
let d := ENNReal.ofReal |A.det|
-- construct a small neighborhood of `A '' (closedBall 0 1)` with measure comparable to
-- the determinant of `A`.
obtain ⟨ε, hε, εpos⟩ :
∃ ε : ℝ, μ (closedBall 0 ε + A '' closedBall 0 1) < m * μ (closedBall 0 1) ∧ 0 < ε := by
have HC : IsCompact (A '' closedBall 0 1) :=
(ProperSpace.isCompact_closedBall _ _).image A.continuous
have L0 :
Tendsto (fun ε => μ (cthickening ε (A '' closedBall 0 1))) (𝓝[>] 0)
(𝓝 (μ (A '' closedBall 0 1))) := by
apply Tendsto.mono_left _ nhdsWithin_le_nhds
exact tendsto_measure_cthickening_of_isCompact HC
have L1 :
Tendsto (fun ε => μ (closedBall 0 ε + A '' closedBall 0 1)) (𝓝[>] 0)
(𝓝 (μ (A '' closedBall 0 1))) := by
apply L0.congr' _
filter_upwards [self_mem_nhdsWithin] with r hr
rw [← HC.add_closedBall_zero (le_of_lt hr), add_comm]
have L2 :
Tendsto (fun ε => μ (closedBall 0 ε + A '' closedBall 0 1)) (𝓝[>] 0)
(𝓝 (d * μ (closedBall 0 1))) := by
convert L1
exact (addHaar_image_continuousLinearMap _ _ _).symm
have I : d * μ (closedBall 0 1) < m * μ (closedBall 0 1) :=
(ENNReal.mul_lt_mul_right (measure_closedBall_pos μ _ zero_lt_one).ne'
measure_closedBall_lt_top.ne).2
hm
have H :
∀ᶠ b : ℝ in 𝓝[>] 0, μ (closedBall 0 b + A '' closedBall 0 1) < m * μ (closedBall 0 1) :=
(tendsto_order.1 L2).2 _ I
exact (H.and self_mem_nhdsWithin).exists
have : Iio (⟨ε, εpos.le⟩ : ℝ≥0) ∈ 𝓝 (0 : ℝ≥0) := by apply Iio_mem_nhds; exact εpos
filter_upwards [this]
-- fix a function `f` which is close enough to `A`.
intro δ hδ s f hf
simp only [mem_Iio, ← NNReal.coe_lt_coe, NNReal.coe_mk] at hδ
-- This function expands the volume of any ball by at most `m`
have I : ∀ x r, x ∈ s → 0 ≤ r → μ (f '' (s ∩ closedBall x r)) ≤ m * μ (closedBall x r) := by
intro x r xs r0
have K : f '' (s ∩ closedBall x r) ⊆ A '' closedBall 0 r + closedBall (f x) (ε * r) := by
rintro y ⟨z, ⟨zs, zr⟩, rfl⟩
rw [mem_closedBall_iff_norm] at zr
apply Set.mem_add.2 ⟨A (z - x), _, f z - f x - A (z - x) + f x, _, _⟩
· apply mem_image_of_mem
simpa only [dist_eq_norm, mem_closedBall, mem_closedBall_zero_iff, sub_zero] using zr
· rw [mem_closedBall_iff_norm, add_sub_cancel_right]
calc
‖f z - f x - A (z - x)‖ ≤ δ * ‖z - x‖ := hf _ zs _ xs
_ ≤ ε * r := by gcongr
· simp only [map_sub, Pi.sub_apply]
abel
have :
A '' closedBall 0 r + closedBall (f x) (ε * r) =
{f x} + r • (A '' closedBall 0 1 + closedBall 0 ε) := by
rw [smul_add, ← add_assoc, add_comm {f x}, add_assoc, smul_closedBall _ _ εpos.le, smul_zero,
singleton_add_closedBall_zero, ← image_smul_set ℝ E E A,
_root_.smul_closedBall _ _ zero_le_one, smul_zero, Real.norm_eq_abs, abs_of_nonneg r0,
mul_one, mul_comm]
rw [this] at K
calc
μ (f '' (s ∩ closedBall x r)) ≤ μ ({f x} + r • (A '' closedBall 0 1 + closedBall 0 ε)) :=
measure_mono K
_ = ENNReal.ofReal (r ^ finrank ℝ E) * μ (A '' closedBall 0 1 + closedBall 0 ε) := by
simp only [abs_of_nonneg r0, addHaar_smul, image_add_left, abs_pow, singleton_add,
measure_preimage_add]
_ ≤ ENNReal.ofReal (r ^ finrank ℝ E) * (m * μ (closedBall 0 1)) := by
rw [add_comm]; gcongr
_ = m * μ (closedBall x r) := by simp only [addHaar_closedBall' μ _ r0]; ring
-- covering `s` by closed balls with total measure very close to `μ s`, one deduces that the
-- measure of `f '' s` is at most `m * (μ s + a)` for any positive `a`.
have J : ∀ᶠ a in 𝓝[>] (0 : ℝ≥0∞), μ (f '' s) ≤ m * (μ s + a) := by
filter_upwards [self_mem_nhdsWithin] with a ha
rw [mem_Ioi] at ha
obtain ⟨t, r, t_count, ts, rpos, st, μt⟩ :
∃ (t : Set E) (r : E → ℝ),
t.Countable ∧
t ⊆ s ∧
(∀ x : E, x ∈ t → 0 < r x) ∧
(s ⊆ ⋃ x ∈ t, closedBall x (r x)) ∧
(∑' x : ↥t, μ (closedBall (↑x) (r ↑x))) ≤ μ s + a :=
Besicovitch.exists_closedBall_covering_tsum_measure_le μ ha.ne' (fun _ => Ioi 0) s
fun x _ δ δpos => ⟨δ / 2, by simp [half_pos δpos, δpos]⟩
haveI : Encodable t := t_count.toEncodable
calc
μ (f '' s) ≤ μ (⋃ x : t, f '' (s ∩ closedBall x (r x))) := by
rw [biUnion_eq_iUnion] at st
apply measure_mono
rw [← image_iUnion, ← inter_iUnion]
exact image_subset _ (subset_inter (Subset.refl _) st)
_ ≤ ∑' x : t, μ (f '' (s ∩ closedBall x (r x))) := measure_iUnion_le _
_ ≤ ∑' x : t, m * μ (closedBall x (r x)) :=
(ENNReal.tsum_le_tsum fun x => I x (r x) (ts x.2) (rpos x x.2).le)
_ ≤ m * (μ s + a) := by rw [ENNReal.tsum_mul_left]; gcongr
-- taking the limit in `a`, one obtains the conclusion
have L : Tendsto (fun a => (m : ℝ≥0∞) * (μ s + a)) (𝓝[>] 0) (𝓝 (m * (μ s + 0))) := by
apply Tendsto.mono_left _ nhdsWithin_le_nhds
apply ENNReal.Tendsto.const_mul (tendsto_const_nhds.add tendsto_id)
simp only [ENNReal.coe_ne_top, Ne, or_true_iff, not_false_iff]
rw [add_zero] at L
exact ge_of_tendsto L J
/-- Let `f` be a function which is sufficiently close (in the Lipschitz sense) to a given linear
map `A`. Then it expands the volume of any set by at least `m` for any `m < det A`. -/
theorem mul_le_addHaar_image_of_lt_det (A : E →L[ℝ] E) {m : ℝ≥0}
(hm : (m : ℝ≥0∞) < ENNReal.ofReal |A.det|) :
∀ᶠ δ in 𝓝[>] (0 : ℝ≥0),
∀ (s : Set E) (f : E → E), ApproximatesLinearOn f A s δ → (m : ℝ≥0∞) * μ s ≤ μ (f '' s) := by
apply nhdsWithin_le_nhds
-- The assumption `hm` implies that `A` is invertible. If `f` is close enough to `A`, it is also
-- invertible. One can then pass to the inverses, and deduce the estimate from
-- `addHaar_image_le_mul_of_det_lt` applied to `f⁻¹` and `A⁻¹`.
-- exclude first the trivial case where `m = 0`.
rcases eq_or_lt_of_le (zero_le m) with (rfl | mpos)
· filter_upwards
simp only [forall_const, zero_mul, imp_true_iff, zero_le, ENNReal.coe_zero]
have hA : A.det ≠ 0 := by
intro h; simp only [h, ENNReal.not_lt_zero, ENNReal.ofReal_zero, abs_zero] at hm
-- let `B` be the continuous linear equiv version of `A`.
let B := A.toContinuousLinearEquivOfDetNeZero hA
-- the determinant of `B.symm` is bounded by `m⁻¹`
have I : ENNReal.ofReal |(B.symm : E →L[ℝ] E).det| < (m⁻¹ : ℝ≥0) := by
simp only [ENNReal.ofReal, abs_inv, Real.toNNReal_inv, ContinuousLinearEquiv.det_coe_symm,
ContinuousLinearMap.coe_toContinuousLinearEquivOfDetNeZero, ENNReal.coe_lt_coe] at hm ⊢
exact NNReal.inv_lt_inv mpos.ne' hm
-- therefore, we may apply `addHaar_image_le_mul_of_det_lt` to `B.symm` and `m⁻¹`.
obtain ⟨δ₀, δ₀pos, hδ₀⟩ :
∃ δ : ℝ≥0,
0 < δ ∧
∀ (t : Set E) (g : E → E),
ApproximatesLinearOn g (B.symm : E →L[ℝ] E) t δ → μ (g '' t) ≤ ↑m⁻¹ * μ t := by
have :
∀ᶠ δ : ℝ≥0 in 𝓝[>] 0,
∀ (t : Set E) (g : E → E),
ApproximatesLinearOn g (B.symm : E →L[ℝ] E) t δ → μ (g '' t) ≤ ↑m⁻¹ * μ t :=
addHaar_image_le_mul_of_det_lt μ B.symm I
rcases (this.and self_mem_nhdsWithin).exists with ⟨δ₀, h, h'⟩
exact ⟨δ₀, h', h⟩
-- record smallness conditions for `δ` that will be needed to apply `hδ₀` below.
have L1 : ∀ᶠ δ in 𝓝 (0 : ℝ≥0), Subsingleton E ∨ δ < ‖(B.symm : E →L[ℝ] E)‖₊⁻¹ := by
by_cases h : Subsingleton E
· simp only [h, true_or_iff, eventually_const]
simp only [h, false_or_iff]
apply Iio_mem_nhds
simpa only [h, false_or_iff, inv_pos] using B.subsingleton_or_nnnorm_symm_pos
have L2 :
∀ᶠ δ in 𝓝 (0 : ℝ≥0), ‖(B.symm : E →L[ℝ] E)‖₊ * (‖(B.symm : E →L[ℝ] E)‖₊⁻¹ - δ)⁻¹ * δ < δ₀ := by
have :
Tendsto (fun δ => ‖(B.symm : E →L[ℝ] E)‖₊ * (‖(B.symm : E →L[ℝ] E)‖₊⁻¹ - δ)⁻¹ * δ) (𝓝 0)
(𝓝 (‖(B.symm : E →L[ℝ] E)‖₊ * (‖(B.symm : E →L[ℝ] E)‖₊⁻¹ - 0)⁻¹ * 0)) := by
rcases eq_or_ne ‖(B.symm : E →L[ℝ] E)‖₊ 0 with (H | H)
· simpa only [H, zero_mul] using tendsto_const_nhds
refine Tendsto.mul (tendsto_const_nhds.mul ?_) tendsto_id
refine (Tendsto.sub tendsto_const_nhds tendsto_id).inv₀ ?_
simpa only [tsub_zero, inv_eq_zero, Ne] using H
simp only [mul_zero] at this
exact (tendsto_order.1 this).2 δ₀ δ₀pos
-- let `δ` be small enough, and `f` approximated by `B` up to `δ`.
filter_upwards [L1, L2]
intro δ h1δ h2δ s f hf
have hf' : ApproximatesLinearOn f (B : E →L[ℝ] E) s δ := by convert hf
let F := hf'.toPartialEquiv h1δ
-- the condition to be checked can be reformulated in terms of the inverse maps
suffices H : μ (F.symm '' F.target) ≤ (m⁻¹ : ℝ≥0) * μ F.target by
change (m : ℝ≥0∞) * μ F.source ≤ μ F.target
rwa [← F.symm_image_target_eq_source, mul_comm, ← ENNReal.le_div_iff_mul_le, div_eq_mul_inv,
mul_comm, ← ENNReal.coe_inv mpos.ne']
· apply Or.inl
simpa only [ENNReal.coe_eq_zero, Ne] using mpos.ne'
· simp only [ENNReal.coe_ne_top, true_or_iff, Ne, not_false_iff]
-- as `f⁻¹` is well approximated by `B⁻¹`, the conclusion follows from `hδ₀`
-- and our choice of `δ`.
exact hδ₀ _ _ ((hf'.to_inv h1δ).mono_num h2δ.le)
/-- If a differentiable function `f` is approximated by a linear map `A` on a set `s`, up to `δ`,
then at almost every `x` in `s` one has `‖f' x - A‖ ≤ δ`. -/
theorem _root_.ApproximatesLinearOn.norm_fderiv_sub_le {A : E →L[ℝ] E} {δ : ℝ≥0}
(hf : ApproximatesLinearOn f A s δ) (hs : MeasurableSet s) (f' : E → E →L[ℝ] E)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) : ∀ᵐ x ∂μ.restrict s, ‖f' x - A‖₊ ≤ δ := by
/- The conclusion will hold at the Lebesgue density points of `s` (which have full measure).
At such a point `x`, for any `z` and any `ε > 0` one has for small `r`
that `{x} + r • closedBall z ε` intersects `s`. At a point `y` in the intersection,
`f y - f x` is close both to `f' x (r z)` (by differentiability) and to `A (r z)`
(by linear approximation), so these two quantities are close, i.e., `(f' x - A) z` is small. -/
filter_upwards [Besicovitch.ae_tendsto_measure_inter_div μ s, ae_restrict_mem hs]
-- start from a Lebesgue density point `x`, belonging to `s`.
intro x hx xs
-- consider an arbitrary vector `z`.
apply ContinuousLinearMap.opNorm_le_bound _ δ.2 fun z => ?_
-- to show that `‖(f' x - A) z‖ ≤ δ ‖z‖`, it suffices to do it up to some error that vanishes
-- asymptotically in terms of `ε > 0`.
suffices H : ∀ ε, 0 < ε → ‖(f' x - A) z‖ ≤ (δ + ε) * (‖z‖ + ε) + ‖f' x - A‖ * ε by
have :
Tendsto (fun ε : ℝ => ((δ : ℝ) + ε) * (‖z‖ + ε) + ‖f' x - A‖ * ε) (𝓝[>] 0)
(𝓝 ((δ + 0) * (‖z‖ + 0) + ‖f' x - A‖ * 0)) :=
Tendsto.mono_left (Continuous.tendsto (by fun_prop) 0) nhdsWithin_le_nhds
simp only [add_zero, mul_zero] at this
apply le_of_tendsto_of_tendsto tendsto_const_nhds this
filter_upwards [self_mem_nhdsWithin]
exact H
-- fix a positive `ε`.
intro ε εpos
-- for small enough `r`, the rescaled ball `r • closedBall z ε` intersects `s`, as `x` is a
-- density point
have B₁ : ∀ᶠ r in 𝓝[>] (0 : ℝ), (s ∩ ({x} + r • closedBall z ε)).Nonempty :=
eventually_nonempty_inter_smul_of_density_one μ s x hx _ measurableSet_closedBall
(measure_closedBall_pos μ z εpos).ne'
obtain ⟨ρ, ρpos, hρ⟩ :
∃ ρ > 0, ball x ρ ∩ s ⊆ {y : E | ‖f y - f x - (f' x) (y - x)‖ ≤ ε * ‖y - x‖} :=
mem_nhdsWithin_iff.1 ((hf' x xs).isLittleO.def εpos)
-- for small enough `r`, the rescaled ball `r • closedBall z ε` is included in the set where
-- `f y - f x` is well approximated by `f' x (y - x)`.
have B₂ : ∀ᶠ r in 𝓝[>] (0 : ℝ), {x} + r • closedBall z ε ⊆ ball x ρ := by
apply nhdsWithin_le_nhds
exact eventually_singleton_add_smul_subset isBounded_closedBall (ball_mem_nhds x ρpos)
-- fix a small positive `r` satisfying the above properties, as well as a corresponding `y`.
obtain ⟨r, ⟨y, ⟨ys, hy⟩⟩, rρ, rpos⟩ :
∃ r : ℝ,
(s ∩ ({x} + r • closedBall z ε)).Nonempty ∧ {x} + r • closedBall z ε ⊆ ball x ρ ∧ 0 < r :=
(B₁.and (B₂.and self_mem_nhdsWithin)).exists
-- write `y = x + r a` with `a ∈ closedBall z ε`.
obtain ⟨a, az, ya⟩ : ∃ a, a ∈ closedBall z ε ∧ y = x + r • a := by
simp only [mem_smul_set, image_add_left, mem_preimage, singleton_add] at hy
rcases hy with ⟨a, az, ha⟩
exact ⟨a, az, by simp only [ha, add_neg_cancel_left]⟩
have norm_a : ‖a‖ ≤ ‖z‖ + ε :=
calc
‖a‖ = ‖z + (a - z)‖ := by simp only [_root_.add_sub_cancel]
_ ≤ ‖z‖ + ‖a - z‖ := norm_add_le _ _
_ ≤ ‖z‖ + ε := add_le_add_left (mem_closedBall_iff_norm.1 az) _
-- use the approximation properties to control `(f' x - A) a`, and then `(f' x - A) z` as `z` is
-- close to `a`.
have I : r * ‖(f' x - A) a‖ ≤ r * (δ + ε) * (‖z‖ + ε) :=
calc
r * ‖(f' x - A) a‖ = ‖(f' x - A) (r • a)‖ := by
simp only [ContinuousLinearMap.map_smul, norm_smul, Real.norm_eq_abs, abs_of_nonneg rpos.le]
_ = ‖f y - f x - A (y - x) - (f y - f x - (f' x) (y - x))‖ := by
congr 1
simp only [ya, add_sub_cancel_left, sub_sub_sub_cancel_left, ContinuousLinearMap.coe_sub',
eq_self_iff_true, sub_left_inj, Pi.sub_apply, ContinuousLinearMap.map_smul, smul_sub]
_ ≤ ‖f y - f x - A (y - x)‖ + ‖f y - f x - (f' x) (y - x)‖ := norm_sub_le _ _
_ ≤ δ * ‖y - x‖ + ε * ‖y - x‖ := (add_le_add (hf _ ys _ xs) (hρ ⟨rρ hy, ys⟩))
_ = r * (δ + ε) * ‖a‖ := by
simp only [ya, add_sub_cancel_left, norm_smul, Real.norm_eq_abs, abs_of_nonneg rpos.le]
ring
_ ≤ r * (δ + ε) * (‖z‖ + ε) := by gcongr
calc
‖(f' x - A) z‖ = ‖(f' x - A) a + (f' x - A) (z - a)‖ := by
congr 1
simp only [ContinuousLinearMap.coe_sub', map_sub, Pi.sub_apply]
abel
_ ≤ ‖(f' x - A) a‖ + ‖(f' x - A) (z - a)‖ := norm_add_le _ _
_ ≤ (δ + ε) * (‖z‖ + ε) + ‖f' x - A‖ * ‖z - a‖ := by
apply add_le_add
· rw [mul_assoc] at I; exact (mul_le_mul_left rpos).1 I
· apply ContinuousLinearMap.le_opNorm
_ ≤ (δ + ε) * (‖z‖ + ε) + ‖f' x - A‖ * ε := by
rw [mem_closedBall_iff_norm'] at az
gcongr
/-!
### Measure zero of the image, over non-measurable sets
If a set has measure `0`, then its image under a differentiable map has measure zero. This doesn't
require the set to be measurable. In the same way, if `f` is differentiable on a set `s` with
non-invertible derivative everywhere, then `f '' s` has measure `0`, again without measurability
assumptions.
-/
/-- A differentiable function maps sets of measure zero to sets of measure zero. -/
theorem addHaar_image_eq_zero_of_differentiableOn_of_addHaar_eq_zero (hf : DifferentiableOn ℝ f s)
(hs : μ s = 0) : μ (f '' s) = 0 := by
refine le_antisymm ?_ (zero_le _)
have :
∀ A : E →L[ℝ] E, ∃ δ : ℝ≥0, 0 < δ ∧
∀ (t : Set E), ApproximatesLinearOn f A t δ →
μ (f '' t) ≤ (Real.toNNReal |A.det| + 1 : ℝ≥0) * μ t := by
intro A
let m : ℝ≥0 := Real.toNNReal |A.det| + 1
have I : ENNReal.ofReal |A.det| < m := by
simp only [m, ENNReal.ofReal, lt_add_iff_pos_right, zero_lt_one, ENNReal.coe_lt_coe]
rcases ((addHaar_image_le_mul_of_det_lt μ A I).and self_mem_nhdsWithin).exists with ⟨δ, h, h'⟩
exact ⟨δ, h', fun t ht => h t f ht⟩
choose δ hδ using this
obtain ⟨t, A, _, _, t_cover, ht, -⟩ :
∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] E),
Pairwise (Disjoint on t) ∧
(∀ n : ℕ, MeasurableSet (t n)) ∧
(s ⊆ ⋃ n : ℕ, t n) ∧
(∀ n : ℕ, ApproximatesLinearOn f (A n) (s ∩ t n) (δ (A n))) ∧
(s.Nonempty → ∀ n, ∃ y ∈ s, A n = fderivWithin ℝ f s y) :=
exists_partition_approximatesLinearOn_of_hasFDerivWithinAt f s (fderivWithin ℝ f s)
(fun x xs => (hf x xs).hasFDerivWithinAt) δ fun A => (hδ A).1.ne'
calc
μ (f '' s) ≤ μ (⋃ n, f '' (s ∩ t n)) := by
apply measure_mono
rw [← image_iUnion, ← inter_iUnion]
exact image_subset f (subset_inter Subset.rfl t_cover)
_ ≤ ∑' n, μ (f '' (s ∩ t n)) := measure_iUnion_le _
_ ≤ ∑' n, (Real.toNNReal |(A n).det| + 1 : ℝ≥0) * μ (s ∩ t n) := by
apply ENNReal.tsum_le_tsum fun n => ?_
apply (hδ (A n)).2
exact ht n
_ ≤ ∑' n, ((Real.toNNReal |(A n).det| + 1 : ℝ≥0) : ℝ≥0∞) * 0 := by
refine ENNReal.tsum_le_tsum fun n => mul_le_mul_left' ?_ _
exact le_trans (measure_mono inter_subset_left) (le_of_eq hs)
_ = 0 := by simp only [tsum_zero, mul_zero]
/-- A version of **Sard's lemma** in fixed dimension: given a differentiable function from `E`
to `E` and a set where the differential is not invertible, then the image of this set has
zero measure. Here, we give an auxiliary statement towards this result. -/
theorem addHaar_image_eq_zero_of_det_fderivWithin_eq_zero_aux
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (R : ℝ) (hs : s ⊆ closedBall 0 R) (ε : ℝ≥0)
(εpos : 0 < ε) (h'f' : ∀ x ∈ s, (f' x).det = 0) : μ (f '' s) ≤ ε * μ (closedBall 0 R) := by
rcases eq_empty_or_nonempty s with (rfl | h's); · simp only [measure_empty, zero_le, image_empty]
have :
∀ A : E →L[ℝ] E, ∃ δ : ℝ≥0, 0 < δ ∧
∀ (t : Set E), ApproximatesLinearOn f A t δ →
μ (f '' t) ≤ (Real.toNNReal |A.det| + ε : ℝ≥0) * μ t := by
intro A
let m : ℝ≥0 := Real.toNNReal |A.det| + ε
have I : ENNReal.ofReal |A.det| < m := by
simp only [m, ENNReal.ofReal, lt_add_iff_pos_right, εpos, ENNReal.coe_lt_coe]
rcases ((addHaar_image_le_mul_of_det_lt μ A I).and self_mem_nhdsWithin).exists with ⟨δ, h, h'⟩
exact ⟨δ, h', fun t ht => h t f ht⟩
choose δ hδ using this
obtain ⟨t, A, t_disj, t_meas, t_cover, ht, Af'⟩ :
∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] E),
Pairwise (Disjoint on t) ∧
(∀ n : ℕ, MeasurableSet (t n)) ∧
(s ⊆ ⋃ n : ℕ, t n) ∧
(∀ n : ℕ, ApproximatesLinearOn f (A n) (s ∩ t n) (δ (A n))) ∧
(s.Nonempty → ∀ n, ∃ y ∈ s, A n = f' y) :=
exists_partition_approximatesLinearOn_of_hasFDerivWithinAt f s f' hf' δ fun A => (hδ A).1.ne'
calc
μ (f '' s) ≤ μ (⋃ n, f '' (s ∩ t n)) := by
rw [← image_iUnion, ← inter_iUnion]
gcongr
exact subset_inter Subset.rfl t_cover
_ ≤ ∑' n, μ (f '' (s ∩ t n)) := measure_iUnion_le _
_ ≤ ∑' n, (Real.toNNReal |(A n).det| + ε : ℝ≥0) * μ (s ∩ t n) := by
gcongr
exact (hδ (A _)).2 _ (ht _)
_ = ∑' n, ε * μ (s ∩ t n) := by
congr with n
rcases Af' h's n with ⟨y, ys, hy⟩
simp only [hy, h'f' y ys, Real.toNNReal_zero, abs_zero, zero_add]
_ ≤ ε * ∑' n, μ (closedBall 0 R ∩ t n) := by
rw [ENNReal.tsum_mul_left]
gcongr
_ = ε * μ (⋃ n, closedBall 0 R ∩ t n) := by
rw [measure_iUnion]
· exact pairwise_disjoint_mono t_disj fun n => inter_subset_right
· intro n
exact measurableSet_closedBall.inter (t_meas n)
_ ≤ ε * μ (closedBall 0 R) := by
rw [← inter_iUnion]
exact mul_le_mul_left' (measure_mono inter_subset_left) _
/-- A version of Sard lemma in fixed dimension: given a differentiable function from `E` to `E` and
a set where the differential is not invertible, then the image of this set has zero measure. -/
theorem addHaar_image_eq_zero_of_det_fderivWithin_eq_zero
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (h'f' : ∀ x ∈ s, (f' x).det = 0) :
μ (f '' s) = 0 := by
suffices H : ∀ R, μ (f '' (s ∩ closedBall 0 R)) = 0 by
apply le_antisymm _ (zero_le _)
rw [← iUnion_inter_closedBall_nat s 0]
calc
μ (f '' ⋃ n : ℕ, s ∩ closedBall 0 n) ≤ ∑' n : ℕ, μ (f '' (s ∩ closedBall 0 n)) := by
rw [image_iUnion]; exact measure_iUnion_le _
_ ≤ 0 := by simp only [H, tsum_zero, nonpos_iff_eq_zero]
intro R
have A : ∀ (ε : ℝ≥0), 0 < ε → μ (f '' (s ∩ closedBall 0 R)) ≤ ε * μ (closedBall 0 R) :=
fun ε εpos =>
addHaar_image_eq_zero_of_det_fderivWithin_eq_zero_aux μ
(fun x hx => (hf' x hx.1).mono inter_subset_left) R inter_subset_right ε εpos
fun x hx => h'f' x hx.1
have B : Tendsto (fun ε : ℝ≥0 => (ε : ℝ≥0∞) * μ (closedBall 0 R)) (𝓝[>] 0) (𝓝 0) := by
have :
Tendsto (fun ε : ℝ≥0 => (ε : ℝ≥0∞) * μ (closedBall 0 R)) (𝓝 0)
(𝓝 (((0 : ℝ≥0) : ℝ≥0∞) * μ (closedBall 0 R))) :=
ENNReal.Tendsto.mul_const (ENNReal.tendsto_coe.2 tendsto_id)
(Or.inr measure_closedBall_lt_top.ne)
simp only [zero_mul, ENNReal.coe_zero] at this
exact Tendsto.mono_left this nhdsWithin_le_nhds
apply le_antisymm _ (zero_le _)
apply ge_of_tendsto B
filter_upwards [self_mem_nhdsWithin]
exact A
/-!
### Weak measurability statements
We show that the derivative of a function on a set is almost everywhere measurable, and that the
image `f '' s` is measurable if `f` is injective on `s`. The latter statement follows from the
Lusin-Souslin theorem.
-/
/-- The derivative of a function on a measurable set is almost everywhere measurable on this set
with respect to Lebesgue measure. Note that, in general, it is not genuinely measurable there,
as `f'` is not unique (but only on a set of measure `0`, as the argument shows). -/
theorem aemeasurable_fderivWithin (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) : AEMeasurable f' (μ.restrict s) := by
/- It suffices to show that `f'` can be uniformly approximated by a measurable function.
Fix `ε > 0`. Thanks to `exists_partition_approximatesLinearOn_of_hasFDerivWithinAt`, one
can find a countable measurable partition of `s` into sets `s ∩ t n` on which `f` is well
approximated by linear maps `A n`. On almost all of `s ∩ t n`, it follows from
`ApproximatesLinearOn.norm_fderiv_sub_le` that `f'` is uniformly approximated by `A n`, which
gives the conclusion. -/
-- fix a precision `ε`
refine aemeasurable_of_unif_approx fun ε εpos => ?_
let δ : ℝ≥0 := ⟨ε, le_of_lt εpos⟩
have δpos : 0 < δ := εpos
-- partition `s` into sets `s ∩ t n` on which `f` is approximated by linear maps `A n`.
obtain ⟨t, A, t_disj, t_meas, t_cover, ht, _⟩ :
∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] E),
Pairwise (Disjoint on t) ∧
(∀ n : ℕ, MeasurableSet (t n)) ∧
(s ⊆ ⋃ n : ℕ, t n) ∧
(∀ n : ℕ, ApproximatesLinearOn f (A n) (s ∩ t n) δ) ∧
(s.Nonempty → ∀ n, ∃ y ∈ s, A n = f' y) :=
exists_partition_approximatesLinearOn_of_hasFDerivWithinAt f s f' hf' (fun _ => δ) fun _ =>
δpos.ne'
-- define a measurable function `g` which coincides with `A n` on `t n`.
obtain ⟨g, g_meas, hg⟩ :
∃ g : E → E →L[ℝ] E, Measurable g ∧ ∀ (n : ℕ) (x : E), x ∈ t n → g x = A n :=
exists_measurable_piecewise t t_meas (fun n _ => A n) (fun n => measurable_const) <|
t_disj.mono fun i j h => by simp only [h.inter_eq, eqOn_empty]
refine ⟨g, g_meas.aemeasurable, ?_⟩
-- reduce to checking that `f'` and `g` are close on almost all of `s ∩ t n`, for all `n`.
suffices H : ∀ᵐ x : E ∂sum fun n ↦ μ.restrict (s ∩ t n), dist (g x) (f' x) ≤ ε by
have : μ.restrict s ≤ sum fun n => μ.restrict (s ∩ t n) := by
have : s = ⋃ n, s ∩ t n := by
rw [← inter_iUnion]
exact Subset.antisymm (subset_inter Subset.rfl t_cover) inter_subset_left
conv_lhs => rw [this]
exact restrict_iUnion_le
exact ae_mono this H
-- fix such an `n`.
refine ae_sum_iff.2 fun n => ?_
-- on almost all `s ∩ t n`, `f' x` is close to `A n` thanks to
-- `ApproximatesLinearOn.norm_fderiv_sub_le`.
have E₁ : ∀ᵐ x : E ∂μ.restrict (s ∩ t n), ‖f' x - A n‖₊ ≤ δ :=
(ht n).norm_fderiv_sub_le μ (hs.inter (t_meas n)) f' fun x hx =>
(hf' x hx.1).mono inter_subset_left
-- moreover, `g x` is equal to `A n` there.
have E₂ : ∀ᵐ x : E ∂μ.restrict (s ∩ t n), g x = A n := by
suffices H : ∀ᵐ x : E ∂μ.restrict (t n), g x = A n from
ae_mono (restrict_mono inter_subset_right le_rfl) H
filter_upwards [ae_restrict_mem (t_meas n)]
exact hg n
-- putting these two properties together gives the conclusion.
filter_upwards [E₁, E₂] with x hx1 hx2
rw [← nndist_eq_nnnorm] at hx1
rw [hx2, dist_comm]
exact hx1
theorem aemeasurable_ofReal_abs_det_fderivWithin (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) :
AEMeasurable (fun x => ENNReal.ofReal |(f' x).det|) (μ.restrict s) := by
apply ENNReal.measurable_ofReal.comp_aemeasurable
refine continuous_abs.measurable.comp_aemeasurable ?_
refine ContinuousLinearMap.continuous_det.measurable.comp_aemeasurable ?_
exact aemeasurable_fderivWithin μ hs hf'
theorem aemeasurable_toNNReal_abs_det_fderivWithin (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) :
AEMeasurable (fun x => |(f' x).det|.toNNReal) (μ.restrict s) := by
apply measurable_real_toNNReal.comp_aemeasurable
refine continuous_abs.measurable.comp_aemeasurable ?_
refine ContinuousLinearMap.continuous_det.measurable.comp_aemeasurable ?_
exact aemeasurable_fderivWithin μ hs hf'
/-- If a function is differentiable and injective on a measurable set,
then the image is measurable. -/
theorem measurable_image_of_fderivWithin (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) : MeasurableSet (f '' s) :=
haveI : DifferentiableOn ℝ f s := fun x hx => (hf' x hx).differentiableWithinAt
hs.image_of_continuousOn_injOn (DifferentiableOn.continuousOn this) hf
/-- If a function is differentiable and injective on a measurable set `s`, then its restriction
to `s` is a measurable embedding. -/
theorem measurableEmbedding_of_fderivWithin (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) :
MeasurableEmbedding (s.restrict f) :=
haveI : DifferentiableOn ℝ f s := fun x hx => (hf' x hx).differentiableWithinAt
this.continuousOn.measurableEmbedding hs hf
/-!
### Proving the estimate for the measure of the image
We show the formula `∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ = μ (f '' s)`,
in `lintegral_abs_det_fderiv_eq_addHaar_image`. For this, we show both inequalities in both
directions, first up to controlled errors and then letting these errors tend to `0`.
-/
theorem addHaar_image_le_lintegral_abs_det_fderiv_aux1 (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) {ε : ℝ≥0} (εpos : 0 < ε) :
μ (f '' s) ≤ (∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) + 2 * ε * μ s := by
/- To bound `μ (f '' s)`, we cover `s` by sets where `f` is well-approximated by linear maps
`A n` (and where `f'` is almost everywhere close to `A n`), and then use that `f` expands the
measure of such a set by at most `(A n).det + ε`. -/
have :
∀ A : E →L[ℝ] E,
∃ δ : ℝ≥0,
0 < δ ∧
(∀ B : E →L[ℝ] E, ‖B - A‖ ≤ δ → |B.det - A.det| ≤ ε) ∧
∀ (t : Set E) (g : E → E), ApproximatesLinearOn g A t δ →
μ (g '' t) ≤ (ENNReal.ofReal |A.det| + ε) * μ t := by
intro A
let m : ℝ≥0 := Real.toNNReal |A.det| + ε
have I : ENNReal.ofReal |A.det| < m := by
simp only [m, ENNReal.ofReal, lt_add_iff_pos_right, εpos, ENNReal.coe_lt_coe]
rcases ((addHaar_image_le_mul_of_det_lt μ A I).and self_mem_nhdsWithin).exists with ⟨δ, h, δpos⟩
obtain ⟨δ', δ'pos, hδ'⟩ : ∃ (δ' : ℝ), 0 < δ' ∧ ∀ B, dist B A < δ' → dist B.det A.det < ↑ε :=
continuousAt_iff.1 (ContinuousLinearMap.continuous_det (E := E)).continuousAt ε εpos
let δ'' : ℝ≥0 := ⟨δ' / 2, (half_pos δ'pos).le⟩
refine ⟨min δ δ'', lt_min δpos (half_pos δ'pos), ?_, ?_⟩
· intro B hB
rw [← Real.dist_eq]
apply (hδ' B _).le
rw [dist_eq_norm]
calc
‖B - A‖ ≤ (min δ δ'' : ℝ≥0) := hB
_ ≤ δ'' := by simp only [le_refl, NNReal.coe_min, min_le_iff, or_true_iff]
_ < δ' := half_lt_self δ'pos
· intro t g htg
exact h t g (htg.mono_num (min_le_left _ _))
choose δ hδ using this
obtain ⟨t, A, t_disj, t_meas, t_cover, ht, -⟩ :
∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] E),
Pairwise (Disjoint on t) ∧
(∀ n : ℕ, MeasurableSet (t n)) ∧
(s ⊆ ⋃ n : ℕ, t n) ∧
(∀ n : ℕ, ApproximatesLinearOn f (A n) (s ∩ t n) (δ (A n))) ∧
(s.Nonempty → ∀ n, ∃ y ∈ s, A n = f' y) :=
exists_partition_approximatesLinearOn_of_hasFDerivWithinAt f s f' hf' δ fun A => (hδ A).1.ne'
calc
μ (f '' s) ≤ μ (⋃ n, f '' (s ∩ t n)) := by
apply measure_mono
rw [← image_iUnion, ← inter_iUnion]
exact image_subset f (subset_inter Subset.rfl t_cover)
_ ≤ ∑' n, μ (f '' (s ∩ t n)) := measure_iUnion_le _
_ ≤ ∑' n, (ENNReal.ofReal |(A n).det| + ε) * μ (s ∩ t n) := by
apply ENNReal.tsum_le_tsum fun n => ?_
apply (hδ (A n)).2.2
exact ht n
_ = ∑' n, ∫⁻ _ in s ∩ t n, ENNReal.ofReal |(A n).det| + ε ∂μ := by
simp only [lintegral_const, MeasurableSet.univ, Measure.restrict_apply, univ_inter]
_ ≤ ∑' n, ∫⁻ x in s ∩ t n, ENNReal.ofReal |(f' x).det| + 2 * ε ∂μ := by
apply ENNReal.tsum_le_tsum fun n => ?_
apply lintegral_mono_ae
filter_upwards [(ht n).norm_fderiv_sub_le μ (hs.inter (t_meas n)) f' fun x hx =>
(hf' x hx.1).mono inter_subset_left]
intro x hx
have I : |(A n).det| ≤ |(f' x).det| + ε :=
calc
|(A n).det| = |(f' x).det - ((f' x).det - (A n).det)| := by congr 1; abel
_ ≤ |(f' x).det| + |(f' x).det - (A n).det| := abs_sub _ _
_ ≤ |(f' x).det| + ε := add_le_add le_rfl ((hδ (A n)).2.1 _ hx)
calc
ENNReal.ofReal |(A n).det| + ε ≤ ENNReal.ofReal (|(f' x).det| + ε) + ε := by gcongr
_ = ENNReal.ofReal |(f' x).det| + 2 * ε := by
simp only [ENNReal.ofReal_add, abs_nonneg, two_mul, add_assoc, NNReal.zero_le_coe,
ENNReal.ofReal_coe_nnreal]
_ = ∫⁻ x in ⋃ n, s ∩ t n, ENNReal.ofReal |(f' x).det| + 2 * ε ∂μ := by
have M : ∀ n : ℕ, MeasurableSet (s ∩ t n) := fun n => hs.inter (t_meas n)
rw [lintegral_iUnion M]
exact pairwise_disjoint_mono t_disj fun n => inter_subset_right
_ = ∫⁻ x in s, ENNReal.ofReal |(f' x).det| + 2 * ε ∂μ := by
rw [← inter_iUnion, inter_eq_self_of_subset_left t_cover]
_ = (∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) + 2 * ε * μ s := by
simp only [lintegral_add_right' _ aemeasurable_const, setLIntegral_const]
theorem addHaar_image_le_lintegral_abs_det_fderiv_aux2 (hs : MeasurableSet s) (h's : μ s ≠ ∞)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) :
μ (f '' s) ≤ ∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ := by
-- We just need to let the error tend to `0` in the previous lemma.
have :
Tendsto (fun ε : ℝ≥0 => (∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) + 2 * ε * μ s) (𝓝[>] 0)
(𝓝 ((∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) + 2 * (0 : ℝ≥0) * μ s)) := by
apply Tendsto.mono_left _ nhdsWithin_le_nhds
refine tendsto_const_nhds.add ?_
refine ENNReal.Tendsto.mul_const ?_ (Or.inr h's)
exact ENNReal.Tendsto.const_mul (ENNReal.tendsto_coe.2 tendsto_id) (Or.inr ENNReal.coe_ne_top)
simp only [add_zero, zero_mul, mul_zero, ENNReal.coe_zero] at this
apply ge_of_tendsto this
filter_upwards [self_mem_nhdsWithin]
intro ε εpos
rw [mem_Ioi] at εpos
exact addHaar_image_le_lintegral_abs_det_fderiv_aux1 μ hs hf' εpos
theorem addHaar_image_le_lintegral_abs_det_fderiv (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) :
μ (f '' s) ≤ ∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ := by
/- We already know the result for finite-measure sets. We cover `s` by finite-measure sets using
`spanningSets μ`, and apply the previous result to each of these parts. -/
let u n := disjointed (spanningSets μ) n
have u_meas : ∀ n, MeasurableSet (u n) := by
intro n
apply MeasurableSet.disjointed fun i => ?_
exact measurable_spanningSets μ i
have A : s = ⋃ n, s ∩ u n := by
rw [← inter_iUnion, iUnion_disjointed, iUnion_spanningSets, inter_univ]
calc
μ (f '' s) ≤ ∑' n, μ (f '' (s ∩ u n)) := by
conv_lhs => rw [A, image_iUnion]
exact measure_iUnion_le _
_ ≤ ∑' n, ∫⁻ x in s ∩ u n, ENNReal.ofReal |(f' x).det| ∂μ := by
apply ENNReal.tsum_le_tsum fun n => ?_
apply
addHaar_image_le_lintegral_abs_det_fderiv_aux2 μ (hs.inter (u_meas n)) _ fun x hx =>
(hf' x hx.1).mono inter_subset_left
have : μ (u n) < ∞ :=
lt_of_le_of_lt (measure_mono (disjointed_subset _ _)) (measure_spanningSets_lt_top μ n)
exact ne_of_lt (lt_of_le_of_lt (measure_mono inter_subset_right) this)
_ = ∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ := by
conv_rhs => rw [A]
rw [lintegral_iUnion]
· intro n; exact hs.inter (u_meas n)
· exact pairwise_disjoint_mono (disjoint_disjointed _) fun n => inter_subset_right
theorem lintegral_abs_det_fderiv_le_addHaar_image_aux1 (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) {ε : ℝ≥0} (εpos : 0 < ε) :
(∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) ≤ μ (f '' s) + 2 * ε * μ s := by
/- To bound `∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ`, we cover `s` by sets where `f` is
well-approximated by linear maps `A n` (and where `f'` is almost everywhere close to `A n`),
and then use that `f` expands the measure of such a set by at least `(A n).det - ε`. -/
have :
∀ A : E →L[ℝ] E,
∃ δ : ℝ≥0,
0 < δ ∧
(∀ B : E →L[ℝ] E, ‖B - A‖ ≤ δ → |B.det - A.det| ≤ ε) ∧
∀ (t : Set E) (g : E → E), ApproximatesLinearOn g A t δ →
ENNReal.ofReal |A.det| * μ t ≤ μ (g '' t) + ε * μ t := by
intro A
obtain ⟨δ', δ'pos, hδ'⟩ : ∃ (δ' : ℝ), 0 < δ' ∧ ∀ B, dist B A < δ' → dist B.det A.det < ↑ε :=
continuousAt_iff.1 (ContinuousLinearMap.continuous_det (E := E)).continuousAt ε εpos
let δ'' : ℝ≥0 := ⟨δ' / 2, (half_pos δ'pos).le⟩
have I'' : ∀ B : E →L[ℝ] E, ‖B - A‖ ≤ ↑δ'' → |B.det - A.det| ≤ ↑ε := by
intro B hB
rw [← Real.dist_eq]
apply (hδ' B _).le
rw [dist_eq_norm]
exact hB.trans_lt (half_lt_self δ'pos)
rcases eq_or_ne A.det 0 with (hA | hA)
· refine ⟨δ'', half_pos δ'pos, I'', ?_⟩
simp only [hA, forall_const, zero_mul, ENNReal.ofReal_zero, imp_true_iff,
zero_le, abs_zero]
let m : ℝ≥0 := Real.toNNReal |A.det| - ε
have I : (m : ℝ≥0∞) < ENNReal.ofReal |A.det| := by
simp only [m, ENNReal.ofReal, ENNReal.coe_sub]
apply ENNReal.sub_lt_self ENNReal.coe_ne_top
· simpa only [abs_nonpos_iff, Real.toNNReal_eq_zero, ENNReal.coe_eq_zero, Ne] using hA
· simp only [εpos.ne', ENNReal.coe_eq_zero, Ne, not_false_iff]
rcases ((mul_le_addHaar_image_of_lt_det μ A I).and self_mem_nhdsWithin).exists with ⟨δ, h, δpos⟩
refine ⟨min δ δ'', lt_min δpos (half_pos δ'pos), ?_, ?_⟩
· intro B hB
apply I'' _ (hB.trans _)
simp only [le_refl, NNReal.coe_min, min_le_iff, or_true_iff]
· intro t g htg
rcases eq_or_ne (μ t) ∞ with (ht | ht)
· simp only [ht, εpos.ne', ENNReal.mul_top, ENNReal.coe_eq_zero, le_top, Ne,
not_false_iff, _root_.add_top]
have := h t g (htg.mono_num (min_le_left _ _))
rwa [ENNReal.coe_sub, ENNReal.sub_mul, tsub_le_iff_right] at this
simp only [ht, imp_true_iff, Ne, not_false_iff]
choose δ hδ using this
obtain ⟨t, A, t_disj, t_meas, t_cover, ht, -⟩ :
∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] E),
Pairwise (Disjoint on t) ∧
(∀ n : ℕ, MeasurableSet (t n)) ∧
(s ⊆ ⋃ n : ℕ, t n) ∧
(∀ n : ℕ, ApproximatesLinearOn f (A n) (s ∩ t n) (δ (A n))) ∧
(s.Nonempty → ∀ n, ∃ y ∈ s, A n = f' y) :=
exists_partition_approximatesLinearOn_of_hasFDerivWithinAt f s f' hf' δ fun A => (hδ A).1.ne'
have s_eq : s = ⋃ n, s ∩ t n := by
rw [← inter_iUnion]
exact Subset.antisymm (subset_inter Subset.rfl t_cover) inter_subset_left
calc
(∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) =
∑' n, ∫⁻ x in s ∩ t n, ENNReal.ofReal |(f' x).det| ∂μ := by
conv_lhs => rw [s_eq]
rw [lintegral_iUnion]
· exact fun n => hs.inter (t_meas n)
· exact pairwise_disjoint_mono t_disj fun n => inter_subset_right
_ ≤ ∑' n, ∫⁻ _ in s ∩ t n, ENNReal.ofReal |(A n).det| + ε ∂μ := by
apply ENNReal.tsum_le_tsum fun n => ?_
apply lintegral_mono_ae
filter_upwards [(ht n).norm_fderiv_sub_le μ (hs.inter (t_meas n)) f' fun x hx =>
(hf' x hx.1).mono inter_subset_left]
intro x hx
have I : |(f' x).det| ≤ |(A n).det| + ε :=
calc
|(f' x).det| = |(A n).det + ((f' x).det - (A n).det)| := by congr 1; abel
_ ≤ |(A n).det| + |(f' x).det - (A n).det| := abs_add _ _
_ ≤ |(A n).det| + ε := add_le_add le_rfl ((hδ (A n)).2.1 _ hx)
calc
ENNReal.ofReal |(f' x).det| ≤ ENNReal.ofReal (|(A n).det| + ε) :=
ENNReal.ofReal_le_ofReal I
_ = ENNReal.ofReal |(A n).det| + ε := by
simp only [ENNReal.ofReal_add, abs_nonneg, NNReal.zero_le_coe, ENNReal.ofReal_coe_nnreal]
_ = ∑' n, (ENNReal.ofReal |(A n).det| * μ (s ∩ t n) + ε * μ (s ∩ t n)) := by
simp only [setLIntegral_const, lintegral_add_right _ measurable_const]
_ ≤ ∑' n, (μ (f '' (s ∩ t n)) + ε * μ (s ∩ t n) + ε * μ (s ∩ t n)) := by
gcongr
exact (hδ (A _)).2.2 _ _ (ht _)
_ = μ (f '' s) + 2 * ε * μ s := by
conv_rhs => rw [s_eq]
rw [image_iUnion, measure_iUnion]; rotate_left
· intro i j hij
apply Disjoint.image _ hf inter_subset_left inter_subset_left
exact Disjoint.mono inter_subset_right inter_subset_right (t_disj hij)
· intro i
exact
measurable_image_of_fderivWithin (hs.inter (t_meas i))
(fun x hx => (hf' x hx.1).mono inter_subset_left)
(hf.mono inter_subset_left)
rw [measure_iUnion]; rotate_left
· exact pairwise_disjoint_mono t_disj fun i => inter_subset_right
· exact fun i => hs.inter (t_meas i)
rw [← ENNReal.tsum_mul_left, ← ENNReal.tsum_add]
congr 1
ext1 i
rw [mul_assoc, two_mul, add_assoc]
theorem lintegral_abs_det_fderiv_le_addHaar_image_aux2 (hs : MeasurableSet s) (h's : μ s ≠ ∞)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) :
(∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) ≤ μ (f '' s) := by
-- We just need to let the error tend to `0` in the previous lemma.
have :
Tendsto (fun ε : ℝ≥0 => μ (f '' s) + 2 * ε * μ s) (𝓝[>] 0)
(𝓝 (μ (f '' s) + 2 * (0 : ℝ≥0) * μ s)) := by
apply Tendsto.mono_left _ nhdsWithin_le_nhds
refine tendsto_const_nhds.add ?_
refine ENNReal.Tendsto.mul_const ?_ (Or.inr h's)
exact ENNReal.Tendsto.const_mul (ENNReal.tendsto_coe.2 tendsto_id) (Or.inr ENNReal.coe_ne_top)
simp only [add_zero, zero_mul, mul_zero, ENNReal.coe_zero] at this
apply ge_of_tendsto this
filter_upwards [self_mem_nhdsWithin]
intro ε εpos
rw [mem_Ioi] at εpos
exact lintegral_abs_det_fderiv_le_addHaar_image_aux1 μ hs hf' hf εpos
theorem lintegral_abs_det_fderiv_le_addHaar_image (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) :
(∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) ≤ μ (f '' s) := by
/- We already know the result for finite-measure sets. We cover `s` by finite-measure sets using
`spanningSets μ`, and apply the previous result to each of these parts. -/
let u n := disjointed (spanningSets μ) n
have u_meas : ∀ n, MeasurableSet (u n) := by
intro n
apply MeasurableSet.disjointed fun i => ?_
exact measurable_spanningSets μ i
have A : s = ⋃ n, s ∩ u n := by
rw [← inter_iUnion, iUnion_disjointed, iUnion_spanningSets, inter_univ]
calc
(∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) =
∑' n, ∫⁻ x in s ∩ u n, ENNReal.ofReal |(f' x).det| ∂μ := by
conv_lhs => rw [A]
rw [lintegral_iUnion]
· intro n; exact hs.inter (u_meas n)
· exact pairwise_disjoint_mono (disjoint_disjointed _) fun n => inter_subset_right
_ ≤ ∑' n, μ (f '' (s ∩ u n)) := by
apply ENNReal.tsum_le_tsum fun n => ?_
apply
lintegral_abs_det_fderiv_le_addHaar_image_aux2 μ (hs.inter (u_meas n)) _
(fun x hx => (hf' x hx.1).mono inter_subset_left) (hf.mono inter_subset_left)
have : μ (u n) < ∞ :=
lt_of_le_of_lt (measure_mono (disjointed_subset _ _)) (measure_spanningSets_lt_top μ n)
exact ne_of_lt (lt_of_le_of_lt (measure_mono inter_subset_right) this)
_ = μ (f '' s) := by
conv_rhs => rw [A, image_iUnion]
rw [measure_iUnion]
· intro i j hij
apply Disjoint.image _ hf inter_subset_left inter_subset_left
exact
Disjoint.mono inter_subset_right inter_subset_right
(disjoint_disjointed _ hij)
· intro i
exact
measurable_image_of_fderivWithin (hs.inter (u_meas i))
(fun x hx => (hf' x hx.1).mono inter_subset_left)
(hf.mono inter_subset_left)
/-- Change of variable formula for differentiable functions, set version: if a function `f` is
injective and differentiable on a measurable set `s`, then the measure of `f '' s` is given by the
integral of `|(f' x).det|` on `s`.
Note that the measurability of `f '' s` is given by `measurable_image_of_fderivWithin`. -/
theorem lintegral_abs_det_fderiv_eq_addHaar_image (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) :
(∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) = μ (f '' s) :=
le_antisymm (lintegral_abs_det_fderiv_le_addHaar_image μ hs hf' hf)
(addHaar_image_le_lintegral_abs_det_fderiv μ hs hf')
/-- Change of variable formula for differentiable functions, set version: if a function `f` is
injective and differentiable on a measurable set `s`, then the pushforward of the measure with
density `|(f' x).det|` on `s` is the Lebesgue measure on the image set. This version requires
that `f` is measurable, as otherwise `Measure.map f` is zero per our definitions.
For a version without measurability assumption but dealing with the restricted
function `s.restrict f`, see `restrict_map_withDensity_abs_det_fderiv_eq_addHaar`.
-/
theorem map_withDensity_abs_det_fderiv_eq_addHaar (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) (h'f : Measurable f) :
Measure.map f ((μ.restrict s).withDensity fun x => ENNReal.ofReal |(f' x).det|) =
μ.restrict (f '' s) := by
apply Measure.ext fun t ht => ?_
rw [map_apply h'f ht, withDensity_apply _ (h'f ht), Measure.restrict_apply ht,
restrict_restrict (h'f ht),
lintegral_abs_det_fderiv_eq_addHaar_image μ ((h'f ht).inter hs)
(fun x hx => (hf' x hx.2).mono inter_subset_right) (hf.mono inter_subset_right),
image_preimage_inter]
/-- Change of variable formula for differentiable functions, set version: if a function `f` is
injective and differentiable on a measurable set `s`, then the pushforward of the measure with
density `|(f' x).det|` on `s` is the Lebesgue measure on the image set. This version is expressed
in terms of the restricted function `s.restrict f`.
For a version for the original function, but with a measurability assumption,
see `map_withDensity_abs_det_fderiv_eq_addHaar`.
-/
theorem restrict_map_withDensity_abs_det_fderiv_eq_addHaar (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) :
Measure.map (s.restrict f) (comap (↑) (μ.withDensity fun x => ENNReal.ofReal |(f' x).det|)) =
μ.restrict (f '' s) := by
obtain ⟨u, u_meas, uf⟩ : ∃ u, Measurable u ∧ EqOn u f s := by
classical
refine ⟨piecewise s f 0, ?_, piecewise_eqOn _ _ _⟩
refine ContinuousOn.measurable_piecewise ?_ continuous_zero.continuousOn hs
have : DifferentiableOn ℝ f s := fun x hx => (hf' x hx).differentiableWithinAt
exact this.continuousOn
have u' : ∀ x ∈ s, HasFDerivWithinAt u (f' x) s x := fun x hx =>
(hf' x hx).congr (fun y hy => uf hy) (uf hx)
set F : s → E := u ∘ (↑) with hF
have A :
Measure.map F (comap (↑) (μ.withDensity fun x => ENNReal.ofReal |(f' x).det|)) =
μ.restrict (u '' s) := by
rw [hF, ← Measure.map_map u_meas measurable_subtype_coe, map_comap_subtype_coe hs,
restrict_withDensity hs]
exact map_withDensity_abs_det_fderiv_eq_addHaar μ hs u' (hf.congr uf.symm) u_meas
rw [uf.image_eq] at A
have : F = s.restrict f := by
ext x
exact uf x.2
rwa [this] at A
/-! ### Change of variable formulas in integrals -/
/- Change of variable formula for differentiable functions: if a function `f` is
injective and differentiable on a measurable set `s`, then the Lebesgue integral of a function
`g : E → ℝ≥0∞` on `f '' s` coincides with the integral of `|(f' x).det| * g ∘ f` on `s`.
Note that the measurability of `f '' s` is given by `measurable_image_of_fderivWithin`. -/
theorem lintegral_image_eq_lintegral_abs_det_fderiv_mul (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) (g : E → ℝ≥0∞) :
∫⁻ x in f '' s, g x ∂μ = ∫⁻ x in s, ENNReal.ofReal |(f' x).det| * g (f x) ∂μ := by
rw [← restrict_map_withDensity_abs_det_fderiv_eq_addHaar μ hs hf' hf,
(measurableEmbedding_of_fderivWithin hs hf' hf).lintegral_map]
simp only [Set.restrict_apply, ← Function.comp_apply (f := g)]
rw [← (MeasurableEmbedding.subtype_coe hs).lintegral_map, map_comap_subtype_coe hs,
setLIntegral_withDensity_eq_setLIntegral_mul_non_measurable₀ _ _ _ hs]
· simp only [Pi.mul_apply]
· simp only [eventually_true, ENNReal.ofReal_lt_top]
· exact aemeasurable_ofReal_abs_det_fderivWithin μ hs hf'
/-- Integrability in the change of variable formula for differentiable functions: if a
function `f` is injective and differentiable on a measurable set `s`, then a function
`g : E → F` is integrable on `f '' s` if and only if `|(f' x).det| • g ∘ f` is
integrable on `s`. -/
theorem integrableOn_image_iff_integrableOn_abs_det_fderiv_smul (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) (g : E → F) :
IntegrableOn g (f '' s) μ ↔ IntegrableOn (fun x => |(f' x).det| • g (f x)) s μ := by
rw [IntegrableOn, ← restrict_map_withDensity_abs_det_fderiv_eq_addHaar μ hs hf' hf,
(measurableEmbedding_of_fderivWithin hs hf' hf).integrable_map_iff]
simp only [Set.restrict_eq, ← Function.comp.assoc, ENNReal.ofReal]
rw [← (MeasurableEmbedding.subtype_coe hs).integrable_map_iff, map_comap_subtype_coe hs,
restrict_withDensity hs, integrable_withDensity_iff_integrable_coe_smul₀]
· simp_rw [IntegrableOn, Real.coe_toNNReal _ (abs_nonneg _), Function.comp_apply]
· exact aemeasurable_toNNReal_abs_det_fderivWithin μ hs hf'
/-- Change of variable formula for differentiable functions: if a function `f` is
injective and differentiable on a measurable set `s`, then the Bochner integral of a function
`g : E → F` on `f '' s` coincides with the integral of `|(f' x).det| • g ∘ f` on `s`. -/
theorem integral_image_eq_integral_abs_det_fderiv_smul (hs : MeasurableSet s)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) (g : E → F) :
∫ x in f '' s, g x ∂μ = ∫ x in s, |(f' x).det| • g (f x) ∂μ := by
rw [← restrict_map_withDensity_abs_det_fderiv_eq_addHaar μ hs hf' hf,
(measurableEmbedding_of_fderivWithin hs hf' hf).integral_map]
simp only [Set.restrict_apply, ← Function.comp_apply (f := g), ENNReal.ofReal]
rw [← (MeasurableEmbedding.subtype_coe hs).integral_map, map_comap_subtype_coe hs,
setIntegral_withDensity_eq_setIntegral_smul₀
(aemeasurable_toNNReal_abs_det_fderivWithin μ hs hf') _ hs]
congr with x
rw [NNReal.smul_def, Real.coe_toNNReal _ (abs_nonneg (f' x).det)]
-- Porting note: move this to `Topology.Algebra.Module.Basic` when port is over
theorem det_one_smulRight {𝕜 : Type*} [NormedField 𝕜] (v : 𝕜) :
((1 : 𝕜 →L[𝕜] 𝕜).smulRight v).det = v := by
have : (1 : 𝕜 →L[𝕜] 𝕜).smulRight v = v • (1 : 𝕜 →L[𝕜] 𝕜) := by
ext1
simp only [ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply,
Algebra.id.smul_eq_mul, one_mul, ContinuousLinearMap.coe_smul', Pi.smul_apply, mul_one]
rw [this, ContinuousLinearMap.det, ContinuousLinearMap.coe_smul,
ContinuousLinearMap.one_def, ContinuousLinearMap.coe_id, LinearMap.det_smul,
FiniteDimensional.finrank_self, LinearMap.det_id, pow_one, mul_one]
/-- Integrability in the change of variable formula for differentiable functions (one-variable
version): if a function `f` is injective and differentiable on a measurable set `s ⊆ ℝ`, then a
function `g : ℝ → F` is integrable on `f '' s` if and only if `|(f' x)| • g ∘ f` is integrable on
`s`. -/
theorem integrableOn_image_iff_integrableOn_abs_deriv_smul {s : Set ℝ} {f : ℝ → ℝ} {f' : ℝ → ℝ}
(hs : MeasurableSet s) (hf' : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) (hf : InjOn f s)
(g : ℝ → F) : IntegrableOn g (f '' s) ↔ IntegrableOn (fun x => |f' x| • g (f x)) s := by
simpa only [det_one_smulRight] using
integrableOn_image_iff_integrableOn_abs_det_fderiv_smul volume hs
(fun x hx => (hf' x hx).hasFDerivWithinAt) hf g
/-- Change of variable formula for differentiable functions (one-variable version): if a function
`f` is injective and differentiable on a measurable set `s ⊆ ℝ`, then the Bochner integral of a
function `g : ℝ → F` on `f '' s` coincides with the integral of `|(f' x)| • g ∘ f` on `s`. -/
theorem integral_image_eq_integral_abs_deriv_smul {s : Set ℝ} {f : ℝ → ℝ} {f' : ℝ → ℝ}
(hs : MeasurableSet s) (hf' : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x)
(hf : InjOn f s) (g : ℝ → F) : ∫ x in f '' s, g x = ∫ x in s, |f' x| • g (f x) := by
simpa only [det_one_smulRight] using
integral_image_eq_integral_abs_det_fderiv_smul volume hs
(fun x hx => (hf' x hx).hasFDerivWithinAt) hf g
theorem integral_target_eq_integral_abs_det_fderiv_smul {f : PartialHomeomorph E E}
(hf' : ∀ x ∈ f.source, HasFDerivAt f (f' x) x) (g : E → F) :
∫ x in f.target, g x ∂μ = ∫ x in f.source, |(f' x).det| • g (f x) ∂μ := by
have : f '' f.source = f.target := PartialEquiv.image_source_eq_target f.toPartialEquiv
rw [← this]
apply integral_image_eq_integral_abs_det_fderiv_smul μ f.open_source.measurableSet _ f.injOn
intro x hx
exact (hf' x hx).hasFDerivWithinAt
section withDensity
lemma _root_.MeasurableEmbedding.withDensity_ofReal_comap_apply_eq_integral_abs_det_fderiv_mul
(hs : MeasurableSet s) (hf : MeasurableEmbedding f)
{g : E → ℝ} (hg : ∀ᵐ x ∂μ, x ∈ f '' s → 0 ≤ g x) (hg_int : IntegrableOn g (f '' s) μ)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) :
(μ.withDensity (fun x ↦ ENNReal.ofReal (g x))).comap f s
= ENNReal.ofReal (∫ x in s, |(f' x).det| * g (f x) ∂μ) := by
rw [Measure.comap_apply f hf.injective (fun t ht ↦ hf.measurableSet_image' ht) _ hs,
withDensity_apply _ (hf.measurableSet_image' hs),
← ofReal_integral_eq_lintegral_ofReal hg_int
((ae_restrict_iff' (hf.measurableSet_image' hs)).mpr hg),
integral_image_eq_integral_abs_det_fderiv_smul μ hs hf' hf.injective.injOn]
simp_rw [smul_eq_mul]
lemma _root_.MeasurableEquiv.withDensity_ofReal_map_symm_apply_eq_integral_abs_det_fderiv_mul
(hs : MeasurableSet s) (f : E ≃ᵐ E)
{g : E → ℝ} (hg : ∀ᵐ x ∂μ, x ∈ f '' s → 0 ≤ g x) (hg_int : IntegrableOn g (f '' s) μ)
(hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) :
(μ.withDensity (fun x ↦ ENNReal.ofReal (g x))).map f.symm s
= ENNReal.ofReal (∫ x in s, |(f' x).det| * g (f x) ∂μ) := by
rw [MeasurableEquiv.map_symm,
MeasurableEmbedding.withDensity_ofReal_comap_apply_eq_integral_abs_det_fderiv_mul μ hs
f.measurableEmbedding hg hg_int hf']
lemma _root_.MeasurableEmbedding.withDensity_ofReal_comap_apply_eq_integral_abs_deriv_mul
{f : ℝ → ℝ} (hf : MeasurableEmbedding f) {s : Set ℝ} (hs : MeasurableSet s)
{g : ℝ → ℝ} (hg : ∀ᵐ x, x ∈ f '' s → 0 ≤ g x) (hg_int : IntegrableOn g (f '' s))
{f' : ℝ → ℝ} (hf' : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) :
(volume.withDensity (fun x ↦ ENNReal.ofReal (g x))).comap f s
= ENNReal.ofReal (∫ x in s, |f' x| * g (f x)) := by
rw [hf.withDensity_ofReal_comap_apply_eq_integral_abs_det_fderiv_mul volume hs
hg hg_int hf']
simp only [det_one_smulRight]
lemma _root_.MeasurableEquiv.withDensity_ofReal_map_symm_apply_eq_integral_abs_deriv_mul
(f : ℝ ≃ᵐ ℝ) {s : Set ℝ} (hs : MeasurableSet s)
{g : ℝ → ℝ} (hg : ∀ᵐ x, x ∈ f '' s → 0 ≤ g x) (hg_int : IntegrableOn g (f '' s))
{f' : ℝ → ℝ} (hf' : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) :
(volume.withDensity (fun x ↦ ENNReal.ofReal (g x))).map f.symm s
= ENNReal.ofReal (∫ x in s, |f' x| * g (f x)) := by
rw [MeasurableEquiv.withDensity_ofReal_map_symm_apply_eq_integral_abs_det_fderiv_mul volume hs
f hg hg_int hf']
simp only [det_one_smulRight]
lemma _root_.MeasurableEmbedding.withDensity_ofReal_comap_apply_eq_integral_abs_deriv_mul'
{f : ℝ → ℝ} (hf : MeasurableEmbedding f) {s : Set ℝ} (hs : MeasurableSet s)
{f' : ℝ → ℝ} (hf' : ∀ x, HasDerivAt f (f' x) x)
{g : ℝ → ℝ} (hg : 0 ≤ᵐ[volume] g) (hg_int : Integrable g) :
(volume.withDensity (fun x ↦ ENNReal.ofReal (g x))).comap f s
= ENNReal.ofReal (∫ x in s, |f' x| * g (f x)) :=
hf.withDensity_ofReal_comap_apply_eq_integral_abs_deriv_mul hs
(by filter_upwards [hg] with x hx using fun _ ↦ hx) hg_int.integrableOn
(fun x _ => (hf' x).hasDerivWithinAt)
lemma _root_.MeasurableEquiv.withDensity_ofReal_map_symm_apply_eq_integral_abs_deriv_mul'
(f : ℝ ≃ᵐ ℝ) {s : Set ℝ} (hs : MeasurableSet s)
{f' : ℝ → ℝ} (hf' : ∀ x, HasDerivAt f (f' x) x)
{g : ℝ → ℝ} (hg : 0 ≤ᵐ[volume] g) (hg_int : Integrable g) :
(volume.withDensity (fun x ↦ ENNReal.ofReal (g x))).map f.symm s
= ENNReal.ofReal (∫ x in s, |f' x| * g (f x)) := by
rw [MeasurableEquiv.withDensity_ofReal_map_symm_apply_eq_integral_abs_det_fderiv_mul volume hs
f (by filter_upwards [hg] with x hx using fun _ ↦ hx) hg_int.integrableOn
(fun x _ => (hf' x).hasDerivWithinAt)]
simp only [det_one_smulRight]
end withDensity
end MeasureTheory
|
MeasureTheory\Function\L1Space.lean | /-
Copyright (c) 2019 Zhouhang Zhou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Zhouhang Zhou
-/
import Mathlib.MeasureTheory.Function.LpOrder
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas
/-!
# Integrable functions and `L¹` space
In the first part of this file, the predicate `Integrable` is defined and basic properties of
integrable functions are proved.
Such a predicate is already available under the name `Memℒp 1`. We give a direct definition which
is easier to use, and show that it is equivalent to `Memℒp 1`
In the second part, we establish an API between `Integrable` and the space `L¹` of equivalence
classes of integrable functions, already defined as a special case of `L^p` spaces for `p = 1`.
## Notation
* `α →₁[μ] β` is the type of `L¹` space, where `α` is a `MeasureSpace` and `β` is a
`NormedAddCommGroup` with a `SecondCountableTopology`. `f : α →ₘ β` is a "function" in `L¹`.
In comments, `[f]` is also used to denote an `L¹` function.
`₁` can be typed as `\1`.
## Main definitions
* Let `f : α → β` be a function, where `α` is a `MeasureSpace` and `β` a `NormedAddCommGroup`.
Then `HasFiniteIntegral f` means `(∫⁻ a, ‖f a‖₊) < ∞`.
* If `β` is moreover a `MeasurableSpace` then `f` is called `Integrable` if
`f` is `Measurable` and `HasFiniteIntegral f` holds.
## Implementation notes
To prove something for an arbitrary integrable function, a useful theorem is
`Integrable.induction` in the file `SetIntegral`.
## Tags
integrable, function space, l1
-/
noncomputable section
open scoped Classical
open Topology ENNReal MeasureTheory NNReal
open Set Filter TopologicalSpace ENNReal EMetric MeasureTheory
variable {α β γ δ : Type*} {m : MeasurableSpace α} {μ ν : Measure α} [MeasurableSpace δ]
variable [NormedAddCommGroup β]
variable [NormedAddCommGroup γ]
namespace MeasureTheory
/-! ### Some results about the Lebesgue integral involving a normed group -/
theorem lintegral_nnnorm_eq_lintegral_edist (f : α → β) :
∫⁻ a, ‖f a‖₊ ∂μ = ∫⁻ a, edist (f a) 0 ∂μ := by simp only [edist_eq_coe_nnnorm]
theorem lintegral_norm_eq_lintegral_edist (f : α → β) :
∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ = ∫⁻ a, edist (f a) 0 ∂μ := by
simp only [ofReal_norm_eq_coe_nnnorm, edist_eq_coe_nnnorm]
theorem lintegral_edist_triangle {f g h : α → β} (hf : AEStronglyMeasurable f μ)
(hh : AEStronglyMeasurable h μ) :
(∫⁻ a, edist (f a) (g a) ∂μ) ≤ (∫⁻ a, edist (f a) (h a) ∂μ) + ∫⁻ a, edist (g a) (h a) ∂μ := by
rw [← lintegral_add_left' (hf.edist hh)]
refine lintegral_mono fun a => ?_
apply edist_triangle_right
theorem lintegral_nnnorm_zero : (∫⁻ _ : α, ‖(0 : β)‖₊ ∂μ) = 0 := by simp
theorem lintegral_nnnorm_add_left {f : α → β} (hf : AEStronglyMeasurable f μ) (g : α → γ) :
∫⁻ a, ‖f a‖₊ + ‖g a‖₊ ∂μ = (∫⁻ a, ‖f a‖₊ ∂μ) + ∫⁻ a, ‖g a‖₊ ∂μ :=
lintegral_add_left' hf.ennnorm _
theorem lintegral_nnnorm_add_right (f : α → β) {g : α → γ} (hg : AEStronglyMeasurable g μ) :
∫⁻ a, ‖f a‖₊ + ‖g a‖₊ ∂μ = (∫⁻ a, ‖f a‖₊ ∂μ) + ∫⁻ a, ‖g a‖₊ ∂μ :=
lintegral_add_right' _ hg.ennnorm
theorem lintegral_nnnorm_neg {f : α → β} : (∫⁻ a, ‖(-f) a‖₊ ∂μ) = ∫⁻ a, ‖f a‖₊ ∂μ := by
simp only [Pi.neg_apply, nnnorm_neg]
/-! ### The predicate `HasFiniteIntegral` -/
/-- `HasFiniteIntegral f μ` means that the integral `∫⁻ a, ‖f a‖ ∂μ` is finite.
`HasFiniteIntegral f` means `HasFiniteIntegral f volume`. -/
def HasFiniteIntegral {_ : MeasurableSpace α} (f : α → β) (μ : Measure α := by volume_tac) : Prop :=
(∫⁻ a, ‖f a‖₊ ∂μ) < ∞
theorem hasFiniteIntegral_def {_ : MeasurableSpace α} (f : α → β) (μ : Measure α) :
HasFiniteIntegral f μ ↔ ((∫⁻ a, ‖f a‖₊ ∂μ) < ∞) :=
Iff.rfl
theorem hasFiniteIntegral_iff_norm (f : α → β) :
HasFiniteIntegral f μ ↔ (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) < ∞ := by
simp only [HasFiniteIntegral, ofReal_norm_eq_coe_nnnorm]
theorem hasFiniteIntegral_iff_edist (f : α → β) :
HasFiniteIntegral f μ ↔ (∫⁻ a, edist (f a) 0 ∂μ) < ∞ := by
simp only [hasFiniteIntegral_iff_norm, edist_dist, dist_zero_right]
theorem hasFiniteIntegral_iff_ofReal {f : α → ℝ} (h : 0 ≤ᵐ[μ] f) :
HasFiniteIntegral f μ ↔ (∫⁻ a, ENNReal.ofReal (f a) ∂μ) < ∞ := by
rw [HasFiniteIntegral, lintegral_nnnorm_eq_of_ae_nonneg h]
theorem hasFiniteIntegral_iff_ofNNReal {f : α → ℝ≥0} :
HasFiniteIntegral (fun x => (f x : ℝ)) μ ↔ (∫⁻ a, f a ∂μ) < ∞ := by
simp [hasFiniteIntegral_iff_norm]
theorem HasFiniteIntegral.mono {f : α → β} {g : α → γ} (hg : HasFiniteIntegral g μ)
(h : ∀ᵐ a ∂μ, ‖f a‖ ≤ ‖g a‖) : HasFiniteIntegral f μ := by
simp only [hasFiniteIntegral_iff_norm] at *
calc
(∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) ≤ ∫⁻ a : α, ENNReal.ofReal ‖g a‖ ∂μ :=
lintegral_mono_ae (h.mono fun a h => ofReal_le_ofReal h)
_ < ∞ := hg
theorem HasFiniteIntegral.mono' {f : α → β} {g : α → ℝ} (hg : HasFiniteIntegral g μ)
(h : ∀ᵐ a ∂μ, ‖f a‖ ≤ g a) : HasFiniteIntegral f μ :=
hg.mono <| h.mono fun _x hx => le_trans hx (le_abs_self _)
theorem HasFiniteIntegral.congr' {f : α → β} {g : α → γ} (hf : HasFiniteIntegral f μ)
(h : ∀ᵐ a ∂μ, ‖f a‖ = ‖g a‖) : HasFiniteIntegral g μ :=
hf.mono <| EventuallyEq.le <| EventuallyEq.symm h
theorem hasFiniteIntegral_congr' {f : α → β} {g : α → γ} (h : ∀ᵐ a ∂μ, ‖f a‖ = ‖g a‖) :
HasFiniteIntegral f μ ↔ HasFiniteIntegral g μ :=
⟨fun hf => hf.congr' h, fun hg => hg.congr' <| EventuallyEq.symm h⟩
theorem HasFiniteIntegral.congr {f g : α → β} (hf : HasFiniteIntegral f μ) (h : f =ᵐ[μ] g) :
HasFiniteIntegral g μ :=
hf.congr' <| h.fun_comp norm
theorem hasFiniteIntegral_congr {f g : α → β} (h : f =ᵐ[μ] g) :
HasFiniteIntegral f μ ↔ HasFiniteIntegral g μ :=
hasFiniteIntegral_congr' <| h.fun_comp norm
theorem hasFiniteIntegral_const_iff {c : β} :
HasFiniteIntegral (fun _ : α => c) μ ↔ c = 0 ∨ μ univ < ∞ := by
simp [HasFiniteIntegral, lintegral_const, lt_top_iff_ne_top, ENNReal.mul_eq_top,
or_iff_not_imp_left]
theorem hasFiniteIntegral_const [IsFiniteMeasure μ] (c : β) :
HasFiniteIntegral (fun _ : α => c) μ :=
hasFiniteIntegral_const_iff.2 (Or.inr <| measure_lt_top _ _)
theorem hasFiniteIntegral_of_bounded [IsFiniteMeasure μ] {f : α → β} {C : ℝ}
(hC : ∀ᵐ a ∂μ, ‖f a‖ ≤ C) : HasFiniteIntegral f μ :=
(hasFiniteIntegral_const C).mono' hC
theorem HasFiniteIntegral.of_finite [Finite α] [IsFiniteMeasure μ] {f : α → β} :
HasFiniteIntegral f μ :=
let ⟨_⟩ := nonempty_fintype α
hasFiniteIntegral_of_bounded <| ae_of_all μ <| norm_le_pi_norm f
@[deprecated (since := "2024-02-05")]
alias hasFiniteIntegral_of_fintype := HasFiniteIntegral.of_finite
theorem HasFiniteIntegral.mono_measure {f : α → β} (h : HasFiniteIntegral f ν) (hμ : μ ≤ ν) :
HasFiniteIntegral f μ :=
lt_of_le_of_lt (lintegral_mono' hμ le_rfl) h
theorem HasFiniteIntegral.add_measure {f : α → β} (hμ : HasFiniteIntegral f μ)
(hν : HasFiniteIntegral f ν) : HasFiniteIntegral f (μ + ν) := by
simp only [HasFiniteIntegral, lintegral_add_measure] at *
exact add_lt_top.2 ⟨hμ, hν⟩
theorem HasFiniteIntegral.left_of_add_measure {f : α → β} (h : HasFiniteIntegral f (μ + ν)) :
HasFiniteIntegral f μ :=
h.mono_measure <| Measure.le_add_right <| le_rfl
theorem HasFiniteIntegral.right_of_add_measure {f : α → β} (h : HasFiniteIntegral f (μ + ν)) :
HasFiniteIntegral f ν :=
h.mono_measure <| Measure.le_add_left <| le_rfl
@[simp]
theorem hasFiniteIntegral_add_measure {f : α → β} :
HasFiniteIntegral f (μ + ν) ↔ HasFiniteIntegral f μ ∧ HasFiniteIntegral f ν :=
⟨fun h => ⟨h.left_of_add_measure, h.right_of_add_measure⟩, fun h => h.1.add_measure h.2⟩
theorem HasFiniteIntegral.smul_measure {f : α → β} (h : HasFiniteIntegral f μ) {c : ℝ≥0∞}
(hc : c ≠ ∞) : HasFiniteIntegral f (c • μ) := by
simp only [HasFiniteIntegral, lintegral_smul_measure] at *
exact mul_lt_top hc h.ne
@[simp]
theorem hasFiniteIntegral_zero_measure {m : MeasurableSpace α} (f : α → β) :
HasFiniteIntegral f (0 : Measure α) := by
simp only [HasFiniteIntegral, lintegral_zero_measure, zero_lt_top]
variable (α β μ)
@[simp]
theorem hasFiniteIntegral_zero : HasFiniteIntegral (fun _ : α => (0 : β)) μ := by
simp [HasFiniteIntegral]
variable {α β μ}
theorem HasFiniteIntegral.neg {f : α → β} (hfi : HasFiniteIntegral f μ) :
HasFiniteIntegral (-f) μ := by simpa [HasFiniteIntegral] using hfi
@[simp]
theorem hasFiniteIntegral_neg_iff {f : α → β} : HasFiniteIntegral (-f) μ ↔ HasFiniteIntegral f μ :=
⟨fun h => neg_neg f ▸ h.neg, HasFiniteIntegral.neg⟩
theorem HasFiniteIntegral.norm {f : α → β} (hfi : HasFiniteIntegral f μ) :
HasFiniteIntegral (fun a => ‖f a‖) μ := by
have eq : (fun a => (nnnorm ‖f a‖ : ℝ≥0∞)) = fun a => (‖f a‖₊ : ℝ≥0∞) := by
funext
rw [nnnorm_norm]
rwa [HasFiniteIntegral, eq]
theorem hasFiniteIntegral_norm_iff (f : α → β) :
HasFiniteIntegral (fun a => ‖f a‖) μ ↔ HasFiniteIntegral f μ :=
hasFiniteIntegral_congr' <| eventually_of_forall fun x => norm_norm (f x)
theorem hasFiniteIntegral_toReal_of_lintegral_ne_top {f : α → ℝ≥0∞} (hf : (∫⁻ x, f x ∂μ) ≠ ∞) :
HasFiniteIntegral (fun x => (f x).toReal) μ := by
have :
∀ x, (‖(f x).toReal‖₊ : ℝ≥0∞) = ENNReal.ofNNReal ⟨(f x).toReal, ENNReal.toReal_nonneg⟩ := by
intro x
rw [Real.nnnorm_of_nonneg]
simp_rw [HasFiniteIntegral, this]
refine lt_of_le_of_lt (lintegral_mono fun x => ?_) (lt_top_iff_ne_top.2 hf)
by_cases hfx : f x = ∞
· simp [hfx]
· lift f x to ℝ≥0 using hfx with fx h
simp [← h, ← NNReal.coe_le_coe]
theorem isFiniteMeasure_withDensity_ofReal {f : α → ℝ} (hfi : HasFiniteIntegral f μ) :
IsFiniteMeasure (μ.withDensity fun x => ENNReal.ofReal <| f x) := by
refine isFiniteMeasure_withDensity ((lintegral_mono fun x => ?_).trans_lt hfi).ne
exact Real.ofReal_le_ennnorm (f x)
section DominatedConvergence
variable {F : ℕ → α → β} {f : α → β} {bound : α → ℝ}
theorem all_ae_ofReal_F_le_bound (h : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound a) :
∀ n, ∀ᵐ a ∂μ, ENNReal.ofReal ‖F n a‖ ≤ ENNReal.ofReal (bound a) := fun n =>
(h n).mono fun _ h => ENNReal.ofReal_le_ofReal h
theorem all_ae_tendsto_ofReal_norm (h : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) atTop <| 𝓝 <| f a) :
∀ᵐ a ∂μ, Tendsto (fun n => ENNReal.ofReal ‖F n a‖) atTop <| 𝓝 <| ENNReal.ofReal ‖f a‖ :=
h.mono fun _ h => tendsto_ofReal <| Tendsto.comp (Continuous.tendsto continuous_norm _) h
theorem all_ae_ofReal_f_le_bound (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound a)
(h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) atTop (𝓝 (f a))) :
∀ᵐ a ∂μ, ENNReal.ofReal ‖f a‖ ≤ ENNReal.ofReal (bound a) := by
have F_le_bound := all_ae_ofReal_F_le_bound h_bound
rw [← ae_all_iff] at F_le_bound
apply F_le_bound.mp ((all_ae_tendsto_ofReal_norm h_lim).mono _)
intro a tendsto_norm F_le_bound
exact le_of_tendsto' tendsto_norm F_le_bound
theorem hasFiniteIntegral_of_dominated_convergence {F : ℕ → α → β} {f : α → β} {bound : α → ℝ}
(bound_hasFiniteIntegral : HasFiniteIntegral bound μ)
(h_bound : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound a)
(h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) atTop (𝓝 (f a))) : HasFiniteIntegral f μ := by
/- `‖F n a‖ ≤ bound a` and `‖F n a‖ --> ‖f a‖` implies `‖f a‖ ≤ bound a`,
and so `∫ ‖f‖ ≤ ∫ bound < ∞` since `bound` is has_finite_integral -/
rw [hasFiniteIntegral_iff_norm]
calc
(∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) ≤ ∫⁻ a, ENNReal.ofReal (bound a) ∂μ :=
lintegral_mono_ae <| all_ae_ofReal_f_le_bound h_bound h_lim
_ < ∞ := by
rw [← hasFiniteIntegral_iff_ofReal]
· exact bound_hasFiniteIntegral
exact (h_bound 0).mono fun a h => le_trans (norm_nonneg _) h
theorem tendsto_lintegral_norm_of_dominated_convergence {F : ℕ → α → β} {f : α → β} {bound : α → ℝ}
(F_measurable : ∀ n, AEStronglyMeasurable (F n) μ)
(bound_hasFiniteIntegral : HasFiniteIntegral bound μ)
(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, ENNReal.ofReal ‖F n a - f a‖ ∂μ) atTop (𝓝 0) := by
have f_measurable : AEStronglyMeasurable f μ :=
aestronglyMeasurable_of_tendsto_ae _ F_measurable h_lim
let b a := 2 * ENNReal.ofReal (bound a)
/- `‖F n a‖ ≤ bound a` and `F n a --> f a` implies `‖f a‖ ≤ bound a`, and thus by the
triangle inequality, have `‖F n a - f a‖ ≤ 2 * (bound a)`. -/
have hb : ∀ n, ∀ᵐ a ∂μ, ENNReal.ofReal ‖F n a - f a‖ ≤ b a := by
intro n
filter_upwards [all_ae_ofReal_F_le_bound h_bound n,
all_ae_ofReal_f_le_bound h_bound h_lim] with a h₁ h₂
calc
ENNReal.ofReal ‖F n a - f a‖ ≤ ENNReal.ofReal ‖F n a‖ + ENNReal.ofReal ‖f a‖ := by
rw [← ENNReal.ofReal_add]
· apply ofReal_le_ofReal
apply norm_sub_le
· exact norm_nonneg _
· exact norm_nonneg _
_ ≤ ENNReal.ofReal (bound a) + ENNReal.ofReal (bound a) := add_le_add h₁ h₂
_ = b a := by rw [← two_mul]
-- On the other hand, `F n a --> f a` implies that `‖F n a - f a‖ --> 0`
have h : ∀ᵐ a ∂μ, Tendsto (fun n => ENNReal.ofReal ‖F n a - f a‖) atTop (𝓝 0) := by
rw [← ENNReal.ofReal_zero]
refine h_lim.mono fun a h => (continuous_ofReal.tendsto _).comp ?_
rwa [← tendsto_iff_norm_sub_tendsto_zero]
/- Therefore, by the dominated convergence theorem for nonnegative integration, have
` ∫ ‖f a - F n a‖ --> 0 ` -/
suffices Tendsto (fun n => ∫⁻ a, ENNReal.ofReal ‖F n a - f a‖ ∂μ) atTop (𝓝 (∫⁻ _ : α, 0 ∂μ)) by
rwa [lintegral_zero] at this
-- Using the dominated convergence theorem.
refine tendsto_lintegral_of_dominated_convergence' _ ?_ hb ?_ ?_
-- Show `fun a => ‖f a - F n a‖` is almost everywhere measurable for all `n`
· exact fun n =>
measurable_ofReal.comp_aemeasurable ((F_measurable n).sub f_measurable).norm.aemeasurable
-- Show `2 * bound` `HasFiniteIntegral`
· rw [hasFiniteIntegral_iff_ofReal] at bound_hasFiniteIntegral
· calc
∫⁻ a, b a ∂μ = 2 * ∫⁻ a, ENNReal.ofReal (bound a) ∂μ := by
rw [lintegral_const_mul']
exact coe_ne_top
_ ≠ ∞ := mul_ne_top coe_ne_top bound_hasFiniteIntegral.ne
filter_upwards [h_bound 0] with _ h using le_trans (norm_nonneg _) h
-- Show `‖f a - F n a‖ --> 0`
· exact h
end DominatedConvergence
section PosPart
/-! Lemmas used for defining the positive part of an `L¹` function -/
theorem HasFiniteIntegral.max_zero {f : α → ℝ} (hf : HasFiniteIntegral f μ) :
HasFiniteIntegral (fun a => max (f a) 0) μ :=
hf.mono <| eventually_of_forall fun x => by simp [abs_le, le_abs_self]
theorem HasFiniteIntegral.min_zero {f : α → ℝ} (hf : HasFiniteIntegral f μ) :
HasFiniteIntegral (fun a => min (f a) 0) μ :=
hf.mono <| eventually_of_forall fun x => by simpa [abs_le] using neg_abs_le _
end PosPart
section NormedSpace
variable {𝕜 : Type*}
theorem HasFiniteIntegral.smul [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 β] [BoundedSMul 𝕜 β] (c : 𝕜)
{f : α → β} : HasFiniteIntegral f μ → HasFiniteIntegral (c • f) μ := by
simp only [HasFiniteIntegral]; intro hfi
calc
(∫⁻ a : α, ‖c • f a‖₊ ∂μ) ≤ ∫⁻ a : α, ‖c‖₊ * ‖f a‖₊ ∂μ := by
refine lintegral_mono ?_
intro i
-- After leanprover/lean4#2734, we need to do beta reduction `exact mod_cast`
beta_reduce
exact mod_cast (nnnorm_smul_le c (f i))
_ < ∞ := by
rw [lintegral_const_mul']
exacts [mul_lt_top coe_ne_top hfi.ne, coe_ne_top]
theorem hasFiniteIntegral_smul_iff [NormedRing 𝕜] [MulActionWithZero 𝕜 β] [BoundedSMul 𝕜 β] {c : 𝕜}
(hc : IsUnit c) (f : α → β) : HasFiniteIntegral (c • f) μ ↔ HasFiniteIntegral f μ := by
obtain ⟨c, rfl⟩ := hc
constructor
· intro h
simpa only [smul_smul, Units.inv_mul, one_smul] using h.smul ((c⁻¹ : 𝕜ˣ) : 𝕜)
exact HasFiniteIntegral.smul _
theorem HasFiniteIntegral.const_mul [NormedRing 𝕜] {f : α → 𝕜} (h : HasFiniteIntegral f μ) (c : 𝕜) :
HasFiniteIntegral (fun x => c * f x) μ :=
h.smul c
theorem HasFiniteIntegral.mul_const [NormedRing 𝕜] {f : α → 𝕜} (h : HasFiniteIntegral f μ) (c : 𝕜) :
HasFiniteIntegral (fun x => f x * c) μ :=
h.smul (MulOpposite.op c)
end NormedSpace
/-! ### The predicate `Integrable` -/
-- variable [MeasurableSpace β] [MeasurableSpace γ] [MeasurableSpace δ]
/-- `Integrable f μ` means that `f` is measurable and that the integral `∫⁻ a, ‖f a‖ ∂μ` is finite.
`Integrable f` means `Integrable f volume`. -/
def Integrable {α} {_ : MeasurableSpace α} (f : α → β) (μ : Measure α := by volume_tac) : Prop :=
AEStronglyMeasurable f μ ∧ HasFiniteIntegral f μ
/-- Notation for `Integrable` with respect to a non-standard σ-algebra. -/
scoped notation "Integrable[" mα "]" => @Integrable _ _ _ mα
theorem memℒp_one_iff_integrable {f : α → β} : Memℒp f 1 μ ↔ Integrable f μ := by
simp_rw [Integrable, HasFiniteIntegral, Memℒp, eLpNorm_one_eq_lintegral_nnnorm]
theorem Integrable.aestronglyMeasurable {f : α → β} (hf : Integrable f μ) :
AEStronglyMeasurable f μ :=
hf.1
theorem Integrable.aemeasurable [MeasurableSpace β] [BorelSpace β] {f : α → β}
(hf : Integrable f μ) : AEMeasurable f μ :=
hf.aestronglyMeasurable.aemeasurable
theorem Integrable.hasFiniteIntegral {f : α → β} (hf : Integrable f μ) : HasFiniteIntegral f μ :=
hf.2
theorem Integrable.mono {f : α → β} {g : α → γ} (hg : Integrable g μ)
(hf : AEStronglyMeasurable f μ) (h : ∀ᵐ a ∂μ, ‖f a‖ ≤ ‖g a‖) : Integrable f μ :=
⟨hf, hg.hasFiniteIntegral.mono h⟩
theorem Integrable.mono' {f : α → β} {g : α → ℝ} (hg : Integrable g μ)
(hf : AEStronglyMeasurable f μ) (h : ∀ᵐ a ∂μ, ‖f a‖ ≤ g a) : Integrable f μ :=
⟨hf, hg.hasFiniteIntegral.mono' h⟩
theorem Integrable.congr' {f : α → β} {g : α → γ} (hf : Integrable f μ)
(hg : AEStronglyMeasurable g μ) (h : ∀ᵐ a ∂μ, ‖f a‖ = ‖g a‖) : Integrable g μ :=
⟨hg, hf.hasFiniteIntegral.congr' h⟩
theorem integrable_congr' {f : α → β} {g : α → γ} (hf : AEStronglyMeasurable f μ)
(hg : AEStronglyMeasurable g μ) (h : ∀ᵐ a ∂μ, ‖f a‖ = ‖g a‖) :
Integrable f μ ↔ Integrable g μ :=
⟨fun h2f => h2f.congr' hg h, fun h2g => h2g.congr' hf <| EventuallyEq.symm h⟩
theorem Integrable.congr {f g : α → β} (hf : Integrable f μ) (h : f =ᵐ[μ] g) : Integrable g μ :=
⟨hf.1.congr h, hf.2.congr h⟩
theorem integrable_congr {f g : α → β} (h : f =ᵐ[μ] g) : Integrable f μ ↔ Integrable g μ :=
⟨fun hf => hf.congr h, fun hg => hg.congr h.symm⟩
theorem integrable_const_iff {c : β} : Integrable (fun _ : α => c) μ ↔ c = 0 ∨ μ univ < ∞ := by
have : AEStronglyMeasurable (fun _ : α => c) μ := aestronglyMeasurable_const
rw [Integrable, and_iff_right this, hasFiniteIntegral_const_iff]
@[simp]
theorem integrable_const [IsFiniteMeasure μ] (c : β) : Integrable (fun _ : α => c) μ :=
integrable_const_iff.2 <| Or.inr <| measure_lt_top _ _
@[simp]
theorem Integrable.of_finite [Finite α] [MeasurableSpace α] [MeasurableSingletonClass α]
(μ : Measure α) [IsFiniteMeasure μ] (f : α → β) : Integrable (fun a ↦ f a) μ :=
⟨(StronglyMeasurable.of_finite f).aestronglyMeasurable, .of_finite⟩
@[deprecated (since := "2024-02-05")] alias integrable_of_fintype := Integrable.of_finite
theorem Memℒp.integrable_norm_rpow {f : α → β} {p : ℝ≥0∞} (hf : Memℒp f p μ) (hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ∞) : Integrable (fun x : α => ‖f x‖ ^ p.toReal) μ := by
rw [← memℒp_one_iff_integrable]
exact hf.norm_rpow hp_ne_zero hp_ne_top
theorem Memℒp.integrable_norm_rpow' [IsFiniteMeasure μ] {f : α → β} {p : ℝ≥0∞} (hf : Memℒp f p μ) :
Integrable (fun x : α => ‖f x‖ ^ p.toReal) μ := by
by_cases h_zero : p = 0
· simp [h_zero, integrable_const]
by_cases h_top : p = ∞
· simp [h_top, integrable_const]
exact hf.integrable_norm_rpow h_zero h_top
theorem Integrable.mono_measure {f : α → β} (h : Integrable f ν) (hμ : μ ≤ ν) : Integrable f μ :=
⟨h.aestronglyMeasurable.mono_measure hμ, h.hasFiniteIntegral.mono_measure hμ⟩
theorem Integrable.of_measure_le_smul {μ' : Measure α} (c : ℝ≥0∞) (hc : c ≠ ∞) (hμ'_le : μ' ≤ c • μ)
{f : α → β} (hf : Integrable f μ) : Integrable f μ' := by
rw [← memℒp_one_iff_integrable] at hf ⊢
exact hf.of_measure_le_smul c hc hμ'_le
theorem Integrable.add_measure {f : α → β} (hμ : Integrable f μ) (hν : Integrable f ν) :
Integrable f (μ + ν) := by
simp_rw [← memℒp_one_iff_integrable] at hμ hν ⊢
refine ⟨hμ.aestronglyMeasurable.add_measure hν.aestronglyMeasurable, ?_⟩
rw [eLpNorm_one_add_measure, ENNReal.add_lt_top]
exact ⟨hμ.eLpNorm_lt_top, hν.eLpNorm_lt_top⟩
theorem Integrable.left_of_add_measure {f : α → β} (h : Integrable f (μ + ν)) : Integrable f μ := by
rw [← memℒp_one_iff_integrable] at h ⊢
exact h.left_of_add_measure
theorem Integrable.right_of_add_measure {f : α → β} (h : Integrable f (μ + ν)) :
Integrable f ν := by
rw [← memℒp_one_iff_integrable] at h ⊢
exact h.right_of_add_measure
@[simp]
theorem integrable_add_measure {f : α → β} :
Integrable f (μ + ν) ↔ Integrable f μ ∧ Integrable f ν :=
⟨fun h => ⟨h.left_of_add_measure, h.right_of_add_measure⟩, fun h => h.1.add_measure h.2⟩
@[simp]
theorem integrable_zero_measure {_ : MeasurableSpace α} {f : α → β} :
Integrable f (0 : Measure α) :=
⟨aestronglyMeasurable_zero_measure f, hasFiniteIntegral_zero_measure f⟩
theorem integrable_finset_sum_measure {ι} {m : MeasurableSpace α} {f : α → β} {μ : ι → Measure α}
{s : Finset ι} : Integrable f (∑ i ∈ s, μ i) ↔ ∀ i ∈ s, Integrable f (μ i) := by
induction s using Finset.induction_on <;> simp [*]
theorem Integrable.smul_measure {f : α → β} (h : Integrable f μ) {c : ℝ≥0∞} (hc : c ≠ ∞) :
Integrable f (c • μ) := by
rw [← memℒp_one_iff_integrable] at h ⊢
exact h.smul_measure hc
theorem Integrable.smul_measure_nnreal {f : α → β} (h : Integrable f μ) {c : ℝ≥0} :
Integrable f (c • μ) := by
apply h.smul_measure
simp
theorem integrable_smul_measure {f : α → β} {c : ℝ≥0∞} (h₁ : c ≠ 0) (h₂ : c ≠ ∞) :
Integrable f (c • μ) ↔ Integrable f μ :=
⟨fun h => by
simpa only [smul_smul, ENNReal.inv_mul_cancel h₁ h₂, one_smul] using
h.smul_measure (ENNReal.inv_ne_top.2 h₁),
fun h => h.smul_measure h₂⟩
theorem integrable_inv_smul_measure {f : α → β} {c : ℝ≥0∞} (h₁ : c ≠ 0) (h₂ : c ≠ ∞) :
Integrable f (c⁻¹ • μ) ↔ Integrable f μ :=
integrable_smul_measure (by simpa using h₂) (by simpa using h₁)
theorem Integrable.to_average {f : α → β} (h : Integrable f μ) : Integrable f ((μ univ)⁻¹ • μ) := by
rcases eq_or_ne μ 0 with (rfl | hne)
· rwa [smul_zero]
· apply h.smul_measure
simpa
theorem integrable_average [IsFiniteMeasure μ] {f : α → β} :
Integrable f ((μ univ)⁻¹ • μ) ↔ Integrable f μ :=
(eq_or_ne μ 0).by_cases (fun h => by simp [h]) fun h =>
integrable_smul_measure (ENNReal.inv_ne_zero.2 <| measure_ne_top _ _)
(ENNReal.inv_ne_top.2 <| mt Measure.measure_univ_eq_zero.1 h)
theorem integrable_map_measure {f : α → δ} {g : δ → β}
(hg : AEStronglyMeasurable g (Measure.map f μ)) (hf : AEMeasurable f μ) :
Integrable g (Measure.map f μ) ↔ Integrable (g ∘ f) μ := by
simp_rw [← memℒp_one_iff_integrable]
exact memℒp_map_measure_iff hg hf
theorem Integrable.comp_aemeasurable {f : α → δ} {g : δ → β} (hg : Integrable g (Measure.map f μ))
(hf : AEMeasurable f μ) : Integrable (g ∘ f) μ :=
(integrable_map_measure hg.aestronglyMeasurable hf).mp hg
theorem Integrable.comp_measurable {f : α → δ} {g : δ → β} (hg : Integrable g (Measure.map f μ))
(hf : Measurable f) : Integrable (g ∘ f) μ :=
hg.comp_aemeasurable hf.aemeasurable
theorem _root_.MeasurableEmbedding.integrable_map_iff {f : α → δ} (hf : MeasurableEmbedding f)
{g : δ → β} : Integrable g (Measure.map f μ) ↔ Integrable (g ∘ f) μ := by
simp_rw [← memℒp_one_iff_integrable]
exact hf.memℒp_map_measure_iff
theorem integrable_map_equiv (f : α ≃ᵐ δ) (g : δ → β) :
Integrable g (Measure.map f μ) ↔ Integrable (g ∘ f) μ := by
simp_rw [← memℒp_one_iff_integrable]
exact f.memℒp_map_measure_iff
theorem MeasurePreserving.integrable_comp {ν : Measure δ} {g : δ → β} {f : α → δ}
(hf : MeasurePreserving f μ ν) (hg : AEStronglyMeasurable g ν) :
Integrable (g ∘ f) μ ↔ Integrable g ν := by
rw [← hf.map_eq] at hg ⊢
exact (integrable_map_measure hg hf.measurable.aemeasurable).symm
theorem MeasurePreserving.integrable_comp_emb {f : α → δ} {ν} (h₁ : MeasurePreserving f μ ν)
(h₂ : MeasurableEmbedding f) {g : δ → β} : Integrable (g ∘ f) μ ↔ Integrable g ν :=
h₁.map_eq ▸ Iff.symm h₂.integrable_map_iff
theorem lintegral_edist_lt_top {f g : α → β} (hf : Integrable f μ) (hg : Integrable g μ) :
(∫⁻ a, edist (f a) (g a) ∂μ) < ∞ :=
lt_of_le_of_lt (lintegral_edist_triangle hf.aestronglyMeasurable aestronglyMeasurable_zero)
(ENNReal.add_lt_top.2 <| by
simp_rw [Pi.zero_apply, ← hasFiniteIntegral_iff_edist]
exact ⟨hf.hasFiniteIntegral, hg.hasFiniteIntegral⟩)
variable (α β μ)
@[simp]
theorem integrable_zero : Integrable (fun _ => (0 : β)) μ := by
simp [Integrable, aestronglyMeasurable_const]
variable {α β μ}
theorem Integrable.add' {f g : α → β} (hf : Integrable f μ) (hg : Integrable g μ) :
HasFiniteIntegral (f + g) μ :=
calc
(∫⁻ a, ‖f a + g a‖₊ ∂μ) ≤ ∫⁻ a, ‖f a‖₊ + ‖g a‖₊ ∂μ :=
lintegral_mono fun a => by
-- After leanprover/lean4#2734, we need to do beta reduction before `exact mod_cast`
beta_reduce
exact mod_cast nnnorm_add_le _ _
_ = _ := lintegral_nnnorm_add_left hf.aestronglyMeasurable _
_ < ∞ := add_lt_top.2 ⟨hf.hasFiniteIntegral, hg.hasFiniteIntegral⟩
theorem Integrable.add {f g : α → β} (hf : Integrable f μ) (hg : Integrable g μ) :
Integrable (f + g) μ :=
⟨hf.aestronglyMeasurable.add hg.aestronglyMeasurable, hf.add' hg⟩
theorem integrable_finset_sum' {ι} (s : Finset ι) {f : ι → α → β}
(hf : ∀ i ∈ s, Integrable (f i) μ) : Integrable (∑ i ∈ s, f i) μ :=
Finset.sum_induction f (fun g => Integrable g μ) (fun _ _ => Integrable.add)
(integrable_zero _ _ _) hf
theorem integrable_finset_sum {ι} (s : Finset ι) {f : ι → α → β}
(hf : ∀ i ∈ s, Integrable (f i) μ) : Integrable (fun a => ∑ i ∈ s, f i a) μ := by
simpa only [← Finset.sum_apply] using integrable_finset_sum' s hf
theorem Integrable.neg {f : α → β} (hf : Integrable f μ) : Integrable (-f) μ :=
⟨hf.aestronglyMeasurable.neg, hf.hasFiniteIntegral.neg⟩
@[simp]
theorem integrable_neg_iff {f : α → β} : Integrable (-f) μ ↔ Integrable f μ :=
⟨fun h => neg_neg f ▸ h.neg, Integrable.neg⟩
@[simp]
lemma integrable_add_iff_integrable_right {f g : α → β} (hf : Integrable f μ) :
Integrable (f + g) μ ↔ Integrable g μ :=
⟨fun h ↦ show g = f + g + (-f) by simp only [add_neg_cancel_comm] ▸ h.add hf.neg,
fun h ↦ hf.add h⟩
@[simp]
lemma integrable_add_iff_integrable_left {f g : α → β} (hf : Integrable f μ) :
Integrable (g + f) μ ↔ Integrable g μ := by
rw [add_comm, integrable_add_iff_integrable_right hf]
lemma integrable_left_of_integrable_add_of_nonneg {f g : α → ℝ}
(h_meas : AEStronglyMeasurable f μ) (hf : 0 ≤ᵐ[μ] f) (hg : 0 ≤ᵐ[μ] g)
(h_int : Integrable (f + g) μ) : Integrable f μ := by
refine h_int.mono' h_meas ?_
filter_upwards [hf, hg] with a haf hag
exact (Real.norm_of_nonneg haf).symm ▸ le_add_of_nonneg_right hag
lemma integrable_right_of_integrable_add_of_nonneg {f g : α → ℝ}
(h_meas : AEStronglyMeasurable f μ) (hf : 0 ≤ᵐ[μ] f) (hg : 0 ≤ᵐ[μ] g)
(h_int : Integrable (f + g) μ) : Integrable g μ :=
integrable_left_of_integrable_add_of_nonneg
((AEStronglyMeasurable.add_iff_right h_meas).mp h_int.aestronglyMeasurable)
hg hf (add_comm f g ▸ h_int)
lemma integrable_add_iff_of_nonneg {f g : α → ℝ} (h_meas : AEStronglyMeasurable f μ)
(hf : 0 ≤ᵐ[μ] f) (hg : 0 ≤ᵐ[μ] g) :
Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ :=
⟨fun h ↦ ⟨integrable_left_of_integrable_add_of_nonneg h_meas hf hg h,
integrable_right_of_integrable_add_of_nonneg h_meas hf hg h⟩, fun ⟨hf, hg⟩ ↦ hf.add hg⟩
lemma integrable_add_iff_of_nonpos {f g : α → ℝ} (h_meas : AEStronglyMeasurable f μ)
(hf : f ≤ᵐ[μ] 0) (hg : g ≤ᵐ[μ] 0) :
Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ := by
rw [← integrable_neg_iff, ← integrable_neg_iff (f := f), ← integrable_neg_iff (f := g), neg_add]
exact integrable_add_iff_of_nonneg h_meas.neg (hf.mono (fun _ ↦ neg_nonneg_of_nonpos))
(hg.mono (fun _ ↦ neg_nonneg_of_nonpos))
@[simp]
lemma integrable_add_const_iff [IsFiniteMeasure μ] {f : α → β} {c : β} :
Integrable (fun x ↦ f x + c) μ ↔ Integrable f μ :=
integrable_add_iff_integrable_left (integrable_const _)
@[simp]
lemma integrable_const_add_iff [IsFiniteMeasure μ] {f : α → β} {c : β} :
Integrable (fun x ↦ c + f x) μ ↔ Integrable f μ :=
integrable_add_iff_integrable_right (integrable_const _)
theorem Integrable.sub {f g : α → β} (hf : Integrable f μ) (hg : Integrable g μ) :
Integrable (f - g) μ := by simpa only [sub_eq_add_neg] using hf.add hg.neg
theorem Integrable.norm {f : α → β} (hf : Integrable f μ) : Integrable (fun a => ‖f a‖) μ :=
⟨hf.aestronglyMeasurable.norm, hf.hasFiniteIntegral.norm⟩
theorem Integrable.inf {β} [NormedLatticeAddCommGroup β] {f g : α → β} (hf : Integrable f μ)
(hg : Integrable g μ) : Integrable (f ⊓ g) μ := by
rw [← memℒp_one_iff_integrable] at hf hg ⊢
exact hf.inf hg
theorem Integrable.sup {β} [NormedLatticeAddCommGroup β] {f g : α → β} (hf : Integrable f μ)
(hg : Integrable g μ) : Integrable (f ⊔ g) μ := by
rw [← memℒp_one_iff_integrable] at hf hg ⊢
exact hf.sup hg
theorem Integrable.abs {β} [NormedLatticeAddCommGroup β] {f : α → β} (hf : Integrable f μ) :
Integrable (fun a => |f a|) μ := by
rw [← memℒp_one_iff_integrable] at hf ⊢
exact hf.abs
theorem Integrable.bdd_mul {F : Type*} [NormedDivisionRing F] {f g : α → F} (hint : Integrable g μ)
(hm : AEStronglyMeasurable f μ) (hfbdd : ∃ C, ∀ x, ‖f x‖ ≤ C) :
Integrable (fun x => f x * g x) μ := by
cases' isEmpty_or_nonempty α with hα hα
· rw [μ.eq_zero_of_isEmpty]
exact integrable_zero_measure
· refine ⟨hm.mul hint.1, ?_⟩
obtain ⟨C, hC⟩ := hfbdd
have hCnonneg : 0 ≤ C := le_trans (norm_nonneg _) (hC hα.some)
have : (fun x => ‖f x * g x‖₊) ≤ fun x => ⟨C, hCnonneg⟩ * ‖g x‖₊ := by
intro x
simp only [nnnorm_mul]
exact mul_le_mul_of_nonneg_right (hC x) (zero_le _)
refine lt_of_le_of_lt (lintegral_mono_nnreal this) ?_
simp only [ENNReal.coe_mul]
rw [lintegral_const_mul' _ _ ENNReal.coe_ne_top]
exact ENNReal.mul_lt_top ENNReal.coe_ne_top (ne_of_lt hint.2)
/-- **Hölder's inequality for integrable functions**: the scalar multiplication of an integrable
vector-valued function by a scalar function with finite essential supremum is integrable. -/
theorem Integrable.essSup_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 β] {f : α → β}
(hf : Integrable f μ) {g : α → 𝕜} (g_aestronglyMeasurable : AEStronglyMeasurable g μ)
(ess_sup_g : essSup (fun x => (‖g x‖₊ : ℝ≥0∞)) μ ≠ ∞) :
Integrable (fun x : α => g x • f x) μ := by
rw [← memℒp_one_iff_integrable] at *
refine ⟨g_aestronglyMeasurable.smul hf.1, ?_⟩
have h : (1 : ℝ≥0∞) / 1 = 1 / ∞ + 1 / 1 := by norm_num
have hg' : eLpNorm g ∞ μ ≠ ∞ := by rwa [eLpNorm_exponent_top]
calc
eLpNorm (fun x : α => g x • f x) 1 μ ≤ _ := by
simpa using MeasureTheory.eLpNorm_smul_le_mul_eLpNorm hf.1 g_aestronglyMeasurable h
_ < ∞ := ENNReal.mul_lt_top hg' hf.2.ne
/-- Hölder's inequality for integrable functions: the scalar multiplication of an integrable
scalar-valued function by a vector-value function with finite essential supremum is integrable. -/
theorem Integrable.smul_essSup {𝕜 : Type*} [NormedRing 𝕜] [Module 𝕜 β] [BoundedSMul 𝕜 β]
{f : α → 𝕜} (hf : Integrable f μ) {g : α → β}
(g_aestronglyMeasurable : AEStronglyMeasurable g μ)
(ess_sup_g : essSup (fun x => (‖g x‖₊ : ℝ≥0∞)) μ ≠ ∞) :
Integrable (fun x : α => f x • g x) μ := by
rw [← memℒp_one_iff_integrable] at *
refine ⟨hf.1.smul g_aestronglyMeasurable, ?_⟩
have h : (1 : ℝ≥0∞) / 1 = 1 / 1 + 1 / ∞ := by norm_num
have hg' : eLpNorm g ∞ μ ≠ ∞ := by rwa [eLpNorm_exponent_top]
calc
eLpNorm (fun x : α => f x • g x) 1 μ ≤ _ := by
simpa using MeasureTheory.eLpNorm_smul_le_mul_eLpNorm g_aestronglyMeasurable hf.1 h
_ < ∞ := ENNReal.mul_lt_top hf.2.ne hg'
theorem integrable_norm_iff {f : α → β} (hf : AEStronglyMeasurable f μ) :
Integrable (fun a => ‖f a‖) μ ↔ Integrable f μ := by
simp_rw [Integrable, and_iff_right hf, and_iff_right hf.norm, hasFiniteIntegral_norm_iff]
theorem integrable_of_norm_sub_le {f₀ f₁ : α → β} {g : α → ℝ} (hf₁_m : AEStronglyMeasurable f₁ μ)
(hf₀_i : Integrable f₀ μ) (hg_i : Integrable g μ) (h : ∀ᵐ a ∂μ, ‖f₀ a - f₁ a‖ ≤ g a) :
Integrable f₁ μ :=
haveI : ∀ᵐ a ∂μ, ‖f₁ a‖ ≤ ‖f₀ a‖ + g a := by
apply h.mono
intro a ha
calc
‖f₁ a‖ ≤ ‖f₀ a‖ + ‖f₀ a - f₁ a‖ := norm_le_insert _ _
_ ≤ ‖f₀ a‖ + g a := add_le_add_left ha _
Integrable.mono' (hf₀_i.norm.add hg_i) hf₁_m this
theorem Integrable.prod_mk {f : α → β} {g : α → γ} (hf : Integrable f μ) (hg : Integrable g μ) :
Integrable (fun x => (f x, g x)) μ :=
⟨hf.aestronglyMeasurable.prod_mk hg.aestronglyMeasurable,
(hf.norm.add' hg.norm).mono <|
eventually_of_forall fun x =>
calc
max ‖f x‖ ‖g x‖ ≤ ‖f x‖ + ‖g x‖ := max_le_add_of_nonneg (norm_nonneg _) (norm_nonneg _)
_ ≤ ‖‖f x‖ + ‖g x‖‖ := le_abs_self _⟩
theorem Memℒp.integrable {q : ℝ≥0∞} (hq1 : 1 ≤ q) {f : α → β} [IsFiniteMeasure μ]
(hfq : Memℒp f q μ) : Integrable f μ :=
memℒp_one_iff_integrable.mp (hfq.memℒp_of_exponent_le hq1)
/-- A non-quantitative version of Markov inequality for integrable functions: the measure of points
where `‖f x‖ ≥ ε` is finite for all positive `ε`. -/
theorem Integrable.measure_norm_ge_lt_top {f : α → β} (hf : Integrable f μ) {ε : ℝ} (hε : 0 < ε) :
μ { x | ε ≤ ‖f x‖ } < ∞ := by
rw [show { x | ε ≤ ‖f x‖ } = { x | ENNReal.ofReal ε ≤ ‖f x‖₊ } by
simp only [ENNReal.ofReal, Real.toNNReal_le_iff_le_coe, ENNReal.coe_le_coe, coe_nnnorm]]
refine (meas_ge_le_mul_pow_eLpNorm μ one_ne_zero ENNReal.one_ne_top hf.1 ?_).trans_lt ?_
· simpa only [Ne, ENNReal.ofReal_eq_zero, not_le] using hε
apply ENNReal.mul_lt_top
· simpa only [ENNReal.one_toReal, ENNReal.rpow_one, Ne, ENNReal.inv_eq_top,
ENNReal.ofReal_eq_zero, not_le] using hε
simpa only [ENNReal.one_toReal, ENNReal.rpow_one] using
(memℒp_one_iff_integrable.2 hf).eLpNorm_ne_top
/-- A non-quantitative version of Markov inequality for integrable functions: the measure of points
where `‖f x‖ > ε` is finite for all positive `ε`. -/
lemma Integrable.measure_norm_gt_lt_top {f : α → β} (hf : Integrable f μ) {ε : ℝ} (hε : 0 < ε) :
μ {x | ε < ‖f x‖} < ∞ :=
lt_of_le_of_lt (measure_mono (fun _ h ↦ (Set.mem_setOf_eq ▸ h).le)) (hf.measure_norm_ge_lt_top hε)
/-- If `f` is `ℝ`-valued and integrable, then for any `c > 0` the set `{x | f x ≥ c}` has finite
measure. -/
lemma Integrable.measure_ge_lt_top {f : α → ℝ} (hf : Integrable f μ) {ε : ℝ} (ε_pos : 0 < ε) :
μ {a : α | ε ≤ f a} < ∞ := by
refine lt_of_le_of_lt (measure_mono ?_) (hf.measure_norm_ge_lt_top ε_pos)
intro x hx
simp only [Real.norm_eq_abs, Set.mem_setOf_eq] at hx ⊢
exact hx.trans (le_abs_self _)
/-- If `f` is `ℝ`-valued and integrable, then for any `c < 0` the set `{x | f x ≤ c}` has finite
measure. -/
lemma Integrable.measure_le_lt_top {f : α → ℝ} (hf : Integrable f μ) {c : ℝ} (c_neg : c < 0) :
μ {a : α | f a ≤ c} < ∞ := by
refine lt_of_le_of_lt (measure_mono ?_) (hf.measure_norm_ge_lt_top (show 0 < -c by linarith))
intro x hx
simp only [Real.norm_eq_abs, Set.mem_setOf_eq] at hx ⊢
exact (show -c ≤ - f x by linarith).trans (neg_le_abs _)
/-- If `f` is `ℝ`-valued and integrable, then for any `c > 0` the set `{x | f x > c}` has finite
measure. -/
lemma Integrable.measure_gt_lt_top {f : α → ℝ} (hf : Integrable f μ) {ε : ℝ} (ε_pos : 0 < ε) :
μ {a : α | ε < f a} < ∞ :=
lt_of_le_of_lt (measure_mono (fun _ hx ↦ (Set.mem_setOf_eq ▸ hx).le))
(Integrable.measure_ge_lt_top hf ε_pos)
/-- If `f` is `ℝ`-valued and integrable, then for any `c < 0` the set `{x | f x < c}` has finite
measure. -/
lemma Integrable.measure_lt_lt_top {f : α → ℝ} (hf : Integrable f μ) {c : ℝ} (c_neg : c < 0) :
μ {a : α | f a < c} < ∞ :=
lt_of_le_of_lt (measure_mono (fun _ hx ↦ (Set.mem_setOf_eq ▸ hx).le))
(Integrable.measure_le_lt_top hf c_neg)
theorem LipschitzWith.integrable_comp_iff_of_antilipschitz {K K'} {f : α → β} {g : β → γ}
(hg : LipschitzWith K g) (hg' : AntilipschitzWith K' g) (g0 : g 0 = 0) :
Integrable (g ∘ f) μ ↔ Integrable f μ := by
simp [← memℒp_one_iff_integrable, hg.memℒp_comp_iff_of_antilipschitz hg' g0]
theorem Integrable.real_toNNReal {f : α → ℝ} (hf : Integrable f μ) :
Integrable (fun x => ((f x).toNNReal : ℝ)) μ := by
refine
⟨hf.aestronglyMeasurable.aemeasurable.real_toNNReal.coe_nnreal_real.aestronglyMeasurable, ?_⟩
rw [hasFiniteIntegral_iff_norm]
refine lt_of_le_of_lt ?_ ((hasFiniteIntegral_iff_norm _).1 hf.hasFiniteIntegral)
apply lintegral_mono
intro x
simp [ENNReal.ofReal_le_ofReal, abs_le, le_abs_self]
theorem ofReal_toReal_ae_eq {f : α → ℝ≥0∞} (hf : ∀ᵐ x ∂μ, f x < ∞) :
(fun x => ENNReal.ofReal (f x).toReal) =ᵐ[μ] f := by
filter_upwards [hf]
intro x hx
simp only [hx.ne, ofReal_toReal, Ne, not_false_iff]
theorem coe_toNNReal_ae_eq {f : α → ℝ≥0∞} (hf : ∀ᵐ x ∂μ, f x < ∞) :
(fun x => ((f x).toNNReal : ℝ≥0∞)) =ᵐ[μ] f := by
filter_upwards [hf]
intro x hx
simp only [hx.ne, Ne, not_false_iff, coe_toNNReal]
section count
variable [MeasurableSingletonClass α] {f : α → β}
/-- A function has finite integral for the counting measure iff its norm is summable. -/
lemma hasFiniteIntegral_count_iff :
HasFiniteIntegral f Measure.count ↔ Summable (‖f ·‖) := by
simp only [HasFiniteIntegral, lintegral_count, lt_top_iff_ne_top,
ENNReal.tsum_coe_ne_top_iff_summable, ← NNReal.summable_coe, coe_nnnorm]
/-- A function is integrable for the counting measure iff its norm is summable. -/
lemma integrable_count_iff :
Integrable f Measure.count ↔ Summable (‖f ·‖) := by
-- Note: this proof would be much easier if we assumed `SecondCountableTopology G`. Without
-- this we have to justify the claim that `f` lands a.e. in a separable subset, which is true
-- (because summable functions have countable range) but slightly tedious to check.
rw [Integrable, hasFiniteIntegral_count_iff, and_iff_right_iff_imp]
intro hs
have hs' : (Function.support f).Countable := by
simpa only [Ne, Pi.zero_apply, eq_comm, Function.support, norm_eq_zero]
using hs.countable_support
letI : MeasurableSpace β := borel β
haveI : BorelSpace β := ⟨rfl⟩
refine aestronglyMeasurable_iff_aemeasurable_separable.mpr ⟨?_, ?_⟩
· refine (measurable_zero.measurable_of_countable_ne ?_).aemeasurable
simpa only [Ne, Pi.zero_apply, eq_comm, Function.support] using hs'
· refine ⟨f '' univ, ?_, ae_of_all _ fun a ↦ ⟨a, ⟨mem_univ _, rfl⟩⟩⟩
suffices f '' univ ⊆ (f '' f.support) ∪ {0} from
(((hs'.image f).union (countable_singleton 0)).mono this).isSeparable
intro g hg
rcases eq_or_ne g 0 with rfl | hg'
· exact Or.inr (mem_singleton _)
· obtain ⟨x, -, rfl⟩ := (mem_image ..).mp hg
exact Or.inl ⟨x, hg', rfl⟩
end count
section
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
theorem integrable_withDensity_iff_integrable_coe_smul {f : α → ℝ≥0} (hf : Measurable f)
{g : α → E} :
Integrable g (μ.withDensity fun x => f x) ↔ Integrable (fun x => (f x : ℝ) • g x) μ := by
by_cases H : AEStronglyMeasurable (fun x : α => (f x : ℝ) • g x) μ
· simp only [Integrable, aestronglyMeasurable_withDensity_iff hf, HasFiniteIntegral, H,
true_and_iff]
rw [lintegral_withDensity_eq_lintegral_mul₀' hf.coe_nnreal_ennreal.aemeasurable]
· rw [iff_iff_eq]
congr
ext1 x
simp only [nnnorm_smul, NNReal.nnnorm_eq, coe_mul, Pi.mul_apply]
· rw [aemeasurable_withDensity_ennreal_iff hf]
convert H.ennnorm using 1
ext1 x
simp only [nnnorm_smul, NNReal.nnnorm_eq, coe_mul]
· simp only [Integrable, aestronglyMeasurable_withDensity_iff hf, H, false_and_iff]
theorem integrable_withDensity_iff_integrable_smul {f : α → ℝ≥0} (hf : Measurable f) {g : α → E} :
Integrable g (μ.withDensity fun x => f x) ↔ Integrable (fun x => f x • g x) μ :=
integrable_withDensity_iff_integrable_coe_smul hf
theorem integrable_withDensity_iff_integrable_smul' {f : α → ℝ≥0∞} (hf : Measurable f)
(hflt : ∀ᵐ x ∂μ, f x < ∞) {g : α → E} :
Integrable g (μ.withDensity f) ↔ Integrable (fun x => (f x).toReal • g x) μ := by
rw [← withDensity_congr_ae (coe_toNNReal_ae_eq hflt),
integrable_withDensity_iff_integrable_smul]
· simp_rw [NNReal.smul_def, ENNReal.toReal]
· exact hf.ennreal_toNNReal
theorem integrable_withDensity_iff_integrable_coe_smul₀ {f : α → ℝ≥0} (hf : AEMeasurable f μ)
{g : α → E} :
Integrable g (μ.withDensity fun x => f x) ↔ Integrable (fun x => (f x : ℝ) • g x) μ :=
calc
Integrable g (μ.withDensity fun x => f x) ↔
Integrable g (μ.withDensity fun x => (hf.mk f x : ℝ≥0)) := by
suffices (fun x => (f x : ℝ≥0∞)) =ᵐ[μ] (fun x => (hf.mk f x : ℝ≥0)) by
rw [withDensity_congr_ae this]
filter_upwards [hf.ae_eq_mk] with x hx
simp [hx]
_ ↔ Integrable (fun x => ((hf.mk f x : ℝ≥0) : ℝ) • g x) μ :=
integrable_withDensity_iff_integrable_coe_smul hf.measurable_mk
_ ↔ Integrable (fun x => (f x : ℝ) • g x) μ := by
apply integrable_congr
filter_upwards [hf.ae_eq_mk] with x hx
simp [hx]
theorem integrable_withDensity_iff_integrable_smul₀ {f : α → ℝ≥0} (hf : AEMeasurable f μ)
{g : α → E} : Integrable g (μ.withDensity fun x => f x) ↔ Integrable (fun x => f x • g x) μ :=
integrable_withDensity_iff_integrable_coe_smul₀ hf
end
theorem integrable_withDensity_iff {f : α → ℝ≥0∞} (hf : Measurable f) (hflt : ∀ᵐ x ∂μ, f x < ∞)
{g : α → ℝ} : Integrable g (μ.withDensity f) ↔ Integrable (fun x => g x * (f x).toReal) μ := by
have : (fun x => g x * (f x).toReal) = fun x => (f x).toReal • g x := by simp [mul_comm]
rw [this]
exact integrable_withDensity_iff_integrable_smul' hf hflt
section
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
theorem memℒ1_smul_of_L1_withDensity {f : α → ℝ≥0} (f_meas : Measurable f)
(u : Lp E 1 (μ.withDensity fun x => f x)) : Memℒp (fun x => f x • u x) 1 μ :=
memℒp_one_iff_integrable.2 <|
(integrable_withDensity_iff_integrable_smul f_meas).1 <| memℒp_one_iff_integrable.1 (Lp.memℒp u)
variable (μ)
/-- The map `u ↦ f • u` is an isometry between the `L^1` spaces for `μ.withDensity f` and `μ`. -/
noncomputable def withDensitySMulLI {f : α → ℝ≥0} (f_meas : Measurable f) :
Lp E 1 (μ.withDensity fun x => f x) →ₗᵢ[ℝ] Lp E 1 μ where
toFun u := (memℒ1_smul_of_L1_withDensity f_meas u).toLp _
map_add' := by
intro u v
ext1
filter_upwards [(memℒ1_smul_of_L1_withDensity f_meas u).coeFn_toLp,
(memℒ1_smul_of_L1_withDensity f_meas v).coeFn_toLp,
(memℒ1_smul_of_L1_withDensity f_meas (u + v)).coeFn_toLp,
Lp.coeFn_add ((memℒ1_smul_of_L1_withDensity f_meas u).toLp _)
((memℒ1_smul_of_L1_withDensity f_meas v).toLp _),
(ae_withDensity_iff f_meas.coe_nnreal_ennreal).1 (Lp.coeFn_add u v)]
intro x hu hv huv h' h''
rw [huv, h', Pi.add_apply, hu, hv]
rcases eq_or_ne (f x) 0 with (hx | hx)
· simp only [hx, zero_smul, add_zero]
· rw [h'' _, Pi.add_apply, smul_add]
simpa only [Ne, ENNReal.coe_eq_zero] using hx
map_smul' := by
intro r u
ext1
filter_upwards [(ae_withDensity_iff f_meas.coe_nnreal_ennreal).1 (Lp.coeFn_smul r u),
(memℒ1_smul_of_L1_withDensity f_meas (r • u)).coeFn_toLp,
Lp.coeFn_smul r ((memℒ1_smul_of_L1_withDensity f_meas u).toLp _),
(memℒ1_smul_of_L1_withDensity f_meas u).coeFn_toLp]
intro x h h' h'' h'''
rw [RingHom.id_apply, h', h'', Pi.smul_apply, h''']
rcases eq_or_ne (f x) 0 with (hx | hx)
· simp only [hx, zero_smul, smul_zero]
· rw [h _, smul_comm, Pi.smul_apply]
simpa only [Ne, ENNReal.coe_eq_zero] using hx
norm_map' := by
intro u
-- Porting note: Lean can't infer types of `AddHom.coe_mk`.
simp only [eLpNorm, LinearMap.coe_mk,
AddHom.coe_mk (M := Lp E 1 (μ.withDensity fun x => f x)) (N := Lp E 1 μ), Lp.norm_toLp,
one_ne_zero, ENNReal.one_ne_top, ENNReal.one_toReal, if_false, eLpNorm', ENNReal.rpow_one,
_root_.div_one, Lp.norm_def]
rw [lintegral_withDensity_eq_lintegral_mul_non_measurable _ f_meas.coe_nnreal_ennreal
(Filter.eventually_of_forall fun x => ENNReal.coe_lt_top)]
congr 1
apply lintegral_congr_ae
filter_upwards [(memℒ1_smul_of_L1_withDensity f_meas u).coeFn_toLp] with x hx
rw [hx, Pi.mul_apply]
change (‖(f x : ℝ) • u x‖₊ : ℝ≥0∞) = (f x : ℝ≥0∞) * (‖u x‖₊ : ℝ≥0∞)
simp only [nnnorm_smul, NNReal.nnnorm_eq, ENNReal.coe_mul]
@[simp]
theorem withDensitySMulLI_apply {f : α → ℝ≥0} (f_meas : Measurable f)
(u : Lp E 1 (μ.withDensity fun x => f x)) :
withDensitySMulLI μ (E := E) f_meas u =
(memℒ1_smul_of_L1_withDensity f_meas u).toLp fun x => f x • u x :=
rfl
end
theorem mem_ℒ1_toReal_of_lintegral_ne_top {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ)
(hfi : (∫⁻ x, f x ∂μ) ≠ ∞) : Memℒp (fun x => (f x).toReal) 1 μ := by
rw [Memℒp, eLpNorm_one_eq_lintegral_nnnorm]
exact
⟨(AEMeasurable.ennreal_toReal hfm).aestronglyMeasurable,
hasFiniteIntegral_toReal_of_lintegral_ne_top hfi⟩
theorem integrable_toReal_of_lintegral_ne_top {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ)
(hfi : (∫⁻ x, f x ∂μ) ≠ ∞) : Integrable (fun x => (f x).toReal) μ :=
memℒp_one_iff_integrable.1 <| mem_ℒ1_toReal_of_lintegral_ne_top hfm hfi
section PosPart
/-! ### Lemmas used for defining the positive part of an `L¹` function -/
theorem Integrable.pos_part {f : α → ℝ} (hf : Integrable f μ) :
Integrable (fun a => max (f a) 0) μ :=
⟨(hf.aestronglyMeasurable.aemeasurable.max aemeasurable_const).aestronglyMeasurable,
hf.hasFiniteIntegral.max_zero⟩
theorem Integrable.neg_part {f : α → ℝ} (hf : Integrable f μ) :
Integrable (fun a => max (-f a) 0) μ :=
hf.neg.pos_part
end PosPart
section BoundedSMul
variable {𝕜 : Type*}
theorem Integrable.smul [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 β] [BoundedSMul 𝕜 β] (c : 𝕜)
{f : α → β} (hf : Integrable f μ) : Integrable (c • f) μ :=
⟨hf.aestronglyMeasurable.const_smul c, hf.hasFiniteIntegral.smul c⟩
theorem _root_.IsUnit.integrable_smul_iff [NormedRing 𝕜] [Module 𝕜 β] [BoundedSMul 𝕜 β] {c : 𝕜}
(hc : IsUnit c) (f : α → β) : Integrable (c • f) μ ↔ Integrable f μ :=
and_congr hc.aestronglyMeasurable_const_smul_iff (hasFiniteIntegral_smul_iff hc f)
theorem integrable_smul_iff [NormedDivisionRing 𝕜] [Module 𝕜 β] [BoundedSMul 𝕜 β] {c : 𝕜}
(hc : c ≠ 0) (f : α → β) : Integrable (c • f) μ ↔ Integrable f μ :=
(IsUnit.mk0 _ hc).integrable_smul_iff f
variable [NormedRing 𝕜] [Module 𝕜 β] [BoundedSMul 𝕜 β]
theorem Integrable.smul_of_top_right {f : α → β} {φ : α → 𝕜} (hf : Integrable f μ)
(hφ : Memℒp φ ∞ μ) : Integrable (φ • f) μ := by
rw [← memℒp_one_iff_integrable] at hf ⊢
exact Memℒp.smul_of_top_right hf hφ
theorem Integrable.smul_of_top_left {f : α → β} {φ : α → 𝕜} (hφ : Integrable φ μ)
(hf : Memℒp f ∞ μ) : Integrable (φ • f) μ := by
rw [← memℒp_one_iff_integrable] at hφ ⊢
exact Memℒp.smul_of_top_left hf hφ
theorem Integrable.smul_const {f : α → 𝕜} (hf : Integrable f μ) (c : β) :
Integrable (fun x => f x • c) μ :=
hf.smul_of_top_left (memℒp_top_const c)
end BoundedSMul
section NormedSpaceOverCompleteField
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
theorem integrable_smul_const {f : α → 𝕜} {c : E} (hc : c ≠ 0) :
Integrable (fun x => f x • c) μ ↔ Integrable f μ := by
simp_rw [Integrable, aestronglyMeasurable_smul_const_iff (f := f) hc, and_congr_right_iff,
HasFiniteIntegral, nnnorm_smul, ENNReal.coe_mul]
intro _; rw [lintegral_mul_const' _ _ ENNReal.coe_ne_top, ENNReal.mul_lt_top_iff]
have : ∀ x : ℝ≥0∞, x = 0 → x < ∞ := by simp
simp [hc, or_iff_left_of_imp (this _)]
end NormedSpaceOverCompleteField
section NormedRing
variable {𝕜 : Type*} [NormedRing 𝕜] {f : α → 𝕜}
theorem Integrable.const_mul {f : α → 𝕜} (h : Integrable f μ) (c : 𝕜) :
Integrable (fun x => c * f x) μ :=
h.smul c
theorem Integrable.const_mul' {f : α → 𝕜} (h : Integrable f μ) (c : 𝕜) :
Integrable ((fun _ : α => c) * f) μ :=
Integrable.const_mul h c
theorem Integrable.mul_const {f : α → 𝕜} (h : Integrable f μ) (c : 𝕜) :
Integrable (fun x => f x * c) μ :=
h.smul (MulOpposite.op c)
theorem Integrable.mul_const' {f : α → 𝕜} (h : Integrable f μ) (c : 𝕜) :
Integrable (f * fun _ : α => c) μ :=
Integrable.mul_const h c
theorem integrable_const_mul_iff {c : 𝕜} (hc : IsUnit c) (f : α → 𝕜) :
Integrable (fun x => c * f x) μ ↔ Integrable f μ :=
hc.integrable_smul_iff f
theorem integrable_mul_const_iff {c : 𝕜} (hc : IsUnit c) (f : α → 𝕜) :
Integrable (fun x => f x * c) μ ↔ Integrable f μ :=
hc.op.integrable_smul_iff f
theorem Integrable.bdd_mul' {f g : α → 𝕜} {c : ℝ} (hg : Integrable g μ)
(hf : AEStronglyMeasurable f μ) (hf_bound : ∀ᵐ x ∂μ, ‖f x‖ ≤ c) :
Integrable (fun x => f x * g x) μ := by
refine Integrable.mono' (hg.norm.smul c) (hf.mul hg.1) ?_
filter_upwards [hf_bound] with x hx
rw [Pi.smul_apply, smul_eq_mul]
exact (norm_mul_le _ _).trans (mul_le_mul_of_nonneg_right hx (norm_nonneg _))
end NormedRing
section NormedDivisionRing
variable {𝕜 : Type*} [NormedDivisionRing 𝕜] {f : α → 𝕜}
theorem Integrable.div_const {f : α → 𝕜} (h : Integrable f μ) (c : 𝕜) :
Integrable (fun x => f x / c) μ := by simp_rw [div_eq_mul_inv, h.mul_const]
end NormedDivisionRing
section RCLike
variable {𝕜 : Type*} [RCLike 𝕜] {f : α → 𝕜}
theorem Integrable.ofReal {f : α → ℝ} (hf : Integrable f μ) :
Integrable (fun x => (f x : 𝕜)) μ := by
rw [← memℒp_one_iff_integrable] at hf ⊢
exact hf.ofReal
theorem Integrable.re_im_iff :
Integrable (fun x => RCLike.re (f x)) μ ∧ Integrable (fun x => RCLike.im (f x)) μ ↔
Integrable f μ := by
simp_rw [← memℒp_one_iff_integrable]
exact memℒp_re_im_iff
theorem Integrable.re (hf : Integrable f μ) : Integrable (fun x => RCLike.re (f x)) μ := by
rw [← memℒp_one_iff_integrable] at hf ⊢
exact hf.re
theorem Integrable.im (hf : Integrable f μ) : Integrable (fun x => RCLike.im (f x)) μ := by
rw [← memℒp_one_iff_integrable] at hf ⊢
exact hf.im
end RCLike
section Trim
variable {H : Type*} [NormedAddCommGroup H] {m0 : MeasurableSpace α} {μ' : Measure α} {f : α → H}
theorem Integrable.trim (hm : m ≤ m0) (hf_int : Integrable f μ') (hf : StronglyMeasurable[m] f) :
Integrable f (μ'.trim hm) := by
refine ⟨hf.aestronglyMeasurable, ?_⟩
rw [HasFiniteIntegral, lintegral_trim hm _]
· exact hf_int.2
· exact @StronglyMeasurable.ennnorm _ m _ _ f hf
theorem integrable_of_integrable_trim (hm : m ≤ m0) (hf_int : Integrable f (μ'.trim hm)) :
Integrable f μ' := by
obtain ⟨hf_meas_ae, hf⟩ := hf_int
refine ⟨aestronglyMeasurable_of_aestronglyMeasurable_trim hm hf_meas_ae, ?_⟩
rw [HasFiniteIntegral] at hf ⊢
rwa [lintegral_trim_ae hm _] at hf
exact AEStronglyMeasurable.ennnorm hf_meas_ae
end Trim
section SigmaFinite
variable {E : Type*} {m0 : MeasurableSpace α} [NormedAddCommGroup E]
theorem integrable_of_forall_fin_meas_le' {μ : Measure α} (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
(C : ℝ≥0∞) (hC : C < ∞) {f : α → E} (hf_meas : AEStronglyMeasurable f μ)
(hf : ∀ s, MeasurableSet[m] s → μ s ≠ ∞ → (∫⁻ x in s, ‖f x‖₊ ∂μ) ≤ C) : Integrable f μ :=
⟨hf_meas, (lintegral_le_of_forall_fin_meas_trim_le hm C hf).trans_lt hC⟩
theorem integrable_of_forall_fin_meas_le [SigmaFinite μ] (C : ℝ≥0∞) (hC : C < ∞) {f : α → E}
(hf_meas : AEStronglyMeasurable f μ)
(hf : ∀ s : Set α, MeasurableSet[m] s → μ s ≠ ∞ → (∫⁻ x in s, ‖f x‖₊ ∂μ) ≤ C) :
Integrable f μ :=
@integrable_of_forall_fin_meas_le' _ m _ m _ _ _ (by rwa [@trim_eq_self _ m]) C hC _ hf_meas hf
end SigmaFinite
/-! ### The predicate `Integrable` on measurable functions modulo a.e.-equality -/
namespace AEEqFun
section
/-- A class of almost everywhere equal functions is `Integrable` if its function representative
is integrable. -/
def Integrable (f : α →ₘ[μ] β) : Prop :=
MeasureTheory.Integrable f μ
theorem integrable_mk {f : α → β} (hf : AEStronglyMeasurable f μ) :
Integrable (mk f hf : α →ₘ[μ] β) ↔ MeasureTheory.Integrable f μ := by
simp only [Integrable]
apply integrable_congr
exact coeFn_mk f hf
theorem integrable_coeFn {f : α →ₘ[μ] β} : MeasureTheory.Integrable f μ ↔ Integrable f := by
rw [← integrable_mk, mk_coeFn]
theorem integrable_zero : Integrable (0 : α →ₘ[μ] β) :=
(MeasureTheory.integrable_zero α β μ).congr (coeFn_mk _ _).symm
end
section
theorem Integrable.neg {f : α →ₘ[μ] β} : Integrable f → Integrable (-f) :=
induction_on f fun _f hfm hfi => (integrable_mk _).2 ((integrable_mk hfm).1 hfi).neg
section
theorem integrable_iff_mem_L1 {f : α →ₘ[μ] β} : Integrable f ↔ f ∈ (α →₁[μ] β) := by
rw [← integrable_coeFn, ← memℒp_one_iff_integrable, Lp.mem_Lp_iff_memℒp]
theorem Integrable.add {f g : α →ₘ[μ] β} : Integrable f → Integrable g → Integrable (f + g) := by
refine induction_on₂ f g fun f hf g hg hfi hgi => ?_
simp only [integrable_mk, mk_add_mk] at hfi hgi ⊢
exact hfi.add hgi
theorem Integrable.sub {f g : α →ₘ[μ] β} (hf : Integrable f) (hg : Integrable g) :
Integrable (f - g) :=
(sub_eq_add_neg f g).symm ▸ hf.add hg.neg
end
section BoundedSMul
variable {𝕜 : Type*} [NormedRing 𝕜] [Module 𝕜 β] [BoundedSMul 𝕜 β]
theorem Integrable.smul {c : 𝕜} {f : α →ₘ[μ] β} : Integrable f → Integrable (c • f) :=
induction_on f fun _f hfm hfi => (integrable_mk _).2 <|
by simpa using ((integrable_mk hfm).1 hfi).smul c
end BoundedSMul
end
end AEEqFun
namespace L1
theorem integrable_coeFn (f : α →₁[μ] β) : Integrable f μ := by
rw [← memℒp_one_iff_integrable]
exact Lp.memℒp f
theorem hasFiniteIntegral_coeFn (f : α →₁[μ] β) : HasFiniteIntegral f μ :=
(integrable_coeFn f).hasFiniteIntegral
theorem stronglyMeasurable_coeFn (f : α →₁[μ] β) : StronglyMeasurable f :=
Lp.stronglyMeasurable f
theorem measurable_coeFn [MeasurableSpace β] [BorelSpace β] (f : α →₁[μ] β) : Measurable f :=
(Lp.stronglyMeasurable f).measurable
theorem aestronglyMeasurable_coeFn (f : α →₁[μ] β) : AEStronglyMeasurable f μ :=
Lp.aestronglyMeasurable f
theorem aemeasurable_coeFn [MeasurableSpace β] [BorelSpace β] (f : α →₁[μ] β) : AEMeasurable f μ :=
(Lp.stronglyMeasurable f).measurable.aemeasurable
theorem edist_def (f g : α →₁[μ] β) : edist f g = ∫⁻ a, edist (f a) (g a) ∂μ := by
simp only [Lp.edist_def, eLpNorm, one_ne_zero, eLpNorm', Pi.sub_apply, one_toReal,
ENNReal.rpow_one, ne_eq, not_false_eq_true, div_self, ite_false]
simp [edist_eq_coe_nnnorm_sub]
theorem dist_def (f g : α →₁[μ] β) : dist f g = (∫⁻ a, edist (f a) (g a) ∂μ).toReal := by
simp only [Lp.dist_def, eLpNorm, one_ne_zero, eLpNorm', Pi.sub_apply, one_toReal,
ENNReal.rpow_one, ne_eq, not_false_eq_true, div_self, ite_false]
simp [edist_eq_coe_nnnorm_sub]
theorem norm_def (f : α →₁[μ] β) : ‖f‖ = (∫⁻ a, ‖f a‖₊ ∂μ).toReal := by
simp [Lp.norm_def, eLpNorm, eLpNorm']
/-- Computing the norm of a difference between two L¹-functions. Note that this is not a
special case of `norm_def` since `(f - g) x` and `f x - g x` are not equal
(but only a.e.-equal). -/
theorem norm_sub_eq_lintegral (f g : α →₁[μ] β) :
‖f - g‖ = (∫⁻ x, (‖f x - g x‖₊ : ℝ≥0∞) ∂μ).toReal := by
rw [norm_def]
congr 1
rw [lintegral_congr_ae]
filter_upwards [Lp.coeFn_sub f g] with _ ha
simp only [ha, Pi.sub_apply]
theorem ofReal_norm_eq_lintegral (f : α →₁[μ] β) :
ENNReal.ofReal ‖f‖ = ∫⁻ x, (‖f x‖₊ : ℝ≥0∞) ∂μ := by
rw [norm_def, ENNReal.ofReal_toReal]
exact ne_of_lt (hasFiniteIntegral_coeFn f)
/-- Computing the norm of a difference between two L¹-functions. Note that this is not a
special case of `ofReal_norm_eq_lintegral` since `(f - g) x` and `f x - g x` are not equal
(but only a.e.-equal). -/
theorem ofReal_norm_sub_eq_lintegral (f g : α →₁[μ] β) :
ENNReal.ofReal ‖f - g‖ = ∫⁻ x, (‖f x - g x‖₊ : ℝ≥0∞) ∂μ := by
simp_rw [ofReal_norm_eq_lintegral, ← edist_eq_coe_nnnorm]
apply lintegral_congr_ae
filter_upwards [Lp.coeFn_sub f g] with _ ha
simp only [ha, Pi.sub_apply]
end L1
namespace Integrable
/-- Construct the equivalence class `[f]` of an integrable function `f`, as a member of the
space `L1 β 1 μ`. -/
def toL1 (f : α → β) (hf : Integrable f μ) : α →₁[μ] β :=
(memℒp_one_iff_integrable.2 hf).toLp f
@[simp]
theorem toL1_coeFn (f : α →₁[μ] β) (hf : Integrable f μ) : hf.toL1 f = f := by
simp [Integrable.toL1]
theorem coeFn_toL1 {f : α → β} (hf : Integrable f μ) : hf.toL1 f =ᵐ[μ] f :=
AEEqFun.coeFn_mk _ _
@[simp]
theorem toL1_zero (h : Integrable (0 : α → β) μ) : h.toL1 0 = 0 :=
rfl
@[simp]
theorem toL1_eq_mk (f : α → β) (hf : Integrable f μ) :
(hf.toL1 f : α →ₘ[μ] β) = AEEqFun.mk f hf.aestronglyMeasurable :=
rfl
@[simp]
theorem toL1_eq_toL1_iff (f g : α → β) (hf : Integrable f μ) (hg : Integrable g μ) :
toL1 f hf = toL1 g hg ↔ f =ᵐ[μ] g :=
Memℒp.toLp_eq_toLp_iff _ _
theorem toL1_add (f g : α → β) (hf : Integrable f μ) (hg : Integrable g μ) :
toL1 (f + g) (hf.add hg) = toL1 f hf + toL1 g hg :=
rfl
theorem toL1_neg (f : α → β) (hf : Integrable f μ) : toL1 (-f) (Integrable.neg hf) = -toL1 f hf :=
rfl
theorem toL1_sub (f g : α → β) (hf : Integrable f μ) (hg : Integrable g μ) :
toL1 (f - g) (hf.sub hg) = toL1 f hf - toL1 g hg :=
rfl
theorem norm_toL1 (f : α → β) (hf : Integrable f μ) :
‖hf.toL1 f‖ = ENNReal.toReal (∫⁻ a, edist (f a) 0 ∂μ) := by
simp only [toL1, Lp.norm_toLp, eLpNorm, one_ne_zero, eLpNorm', one_toReal, ENNReal.rpow_one,
ne_eq, not_false_eq_true, div_self, ite_false]
simp [edist_eq_coe_nnnorm]
theorem nnnorm_toL1 {f : α → β} (hf : Integrable f μ) :
(‖hf.toL1 f‖₊ : ℝ≥0∞) = ∫⁻ a, ‖f a‖₊ ∂μ := by
simpa [Integrable.toL1, eLpNorm, eLpNorm'] using ENNReal.coe_toNNReal hf.2.ne
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]
@[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
simp only [toL1, Lp.edist_toLp_toLp, eLpNorm, one_ne_zero, eLpNorm', Pi.sub_apply, one_toReal,
ENNReal.rpow_one, ne_eq, not_false_eq_true, div_self, ite_false]
simp [edist_eq_coe_nnnorm_sub]
@[simp]
theorem edist_toL1_zero (f : α → β) (hf : Integrable f μ) :
edist (hf.toL1 f) 0 = ∫⁻ a, edist (f a) 0 ∂μ := by
simp only [toL1, Lp.edist_toLp_zero, eLpNorm, one_ne_zero, eLpNorm', one_toReal, ENNReal.rpow_one,
ne_eq, not_false_eq_true, div_self, ite_false]
simp [edist_eq_coe_nnnorm]
variable {𝕜 : Type*} [NormedRing 𝕜] [Module 𝕜 β] [BoundedSMul 𝕜 β]
theorem toL1_smul (f : α → β) (hf : Integrable f μ) (k : 𝕜) :
toL1 (fun a => k • f a) (hf.smul k) = k • toL1 f hf :=
rfl
theorem toL1_smul' (f : α → β) (hf : Integrable f μ) (k : 𝕜) :
toL1 (k • f) (hf.smul k) = k • toL1 f hf :=
rfl
end Integrable
section restrict
variable {E : Type*} [NormedAddCommGroup E] {f : α → E}
lemma HasFiniteIntegral.restrict (h : HasFiniteIntegral f μ) {s : Set α} :
HasFiniteIntegral f (μ.restrict s) := by
refine lt_of_le_of_lt ?_ h
convert lintegral_mono_set (μ := μ) (s := s) (t := univ) (f := fun x ↦ ↑‖f x‖₊) (subset_univ s)
exact Measure.restrict_univ.symm
lemma Integrable.restrict (f_intble : Integrable f μ) {s : Set α} :
Integrable f (μ.restrict s) :=
⟨f_intble.aestronglyMeasurable.restrict, f_intble.hasFiniteIntegral.restrict⟩
end restrict
end MeasureTheory
section ContinuousLinearMap
open MeasureTheory
variable {E : Type*} [NormedAddCommGroup E] {𝕜 : Type*} [NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E] {H : Type*} [NormedAddCommGroup H] [NormedSpace 𝕜 H]
theorem ContinuousLinearMap.integrable_comp {φ : α → H} (L : H →L[𝕜] E) (φ_int : Integrable φ μ) :
Integrable (fun a : α => L (φ a)) μ :=
((Integrable.norm φ_int).const_mul ‖L‖).mono'
(L.continuous.comp_aestronglyMeasurable φ_int.aestronglyMeasurable)
(eventually_of_forall fun a => L.le_opNorm (φ a))
@[simp]
theorem ContinuousLinearEquiv.integrable_comp_iff {φ : α → H} (L : H ≃L[𝕜] E) :
Integrable (fun a : α ↦ L (φ a)) μ ↔ Integrable φ μ :=
⟨fun h ↦ by simpa using ContinuousLinearMap.integrable_comp (L.symm : E →L[𝕜] H) h,
fun h ↦ ContinuousLinearMap.integrable_comp (L : H →L[𝕜] E) h⟩
@[simp]
theorem LinearIsometryEquiv.integrable_comp_iff {φ : α → H} (L : H ≃ₗᵢ[𝕜] E) :
Integrable (fun a : α ↦ L (φ a)) μ ↔ Integrable φ μ :=
ContinuousLinearEquiv.integrable_comp_iff (L : H ≃L[𝕜] E)
theorem MeasureTheory.Integrable.apply_continuousLinearMap {φ : α → H →L[𝕜] E}
(φ_int : Integrable φ μ) (v : H) : Integrable (fun a => φ a v) μ :=
(ContinuousLinearMap.apply 𝕜 _ v).integrable_comp φ_int
end ContinuousLinearMap
namespace MeasureTheory
variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[NormedAddCommGroup F] [NormedSpace ℝ F]
lemma Integrable.fst {f : α → E × F} (hf : Integrable f μ) : Integrable (fun x ↦ (f x).1) μ :=
(ContinuousLinearMap.fst ℝ E F).integrable_comp hf
lemma Integrable.snd {f : α → E × F} (hf : Integrable f μ) : Integrable (fun x ↦ (f x).2) μ :=
(ContinuousLinearMap.snd ℝ E F).integrable_comp hf
lemma integrable_prod {f : α → E × F} :
Integrable f μ ↔ Integrable (fun x ↦ (f x).1) μ ∧ Integrable (fun x ↦ (f x).2) μ :=
⟨fun h ↦ ⟨h.fst, h.snd⟩, fun h ↦ h.1.prod_mk h.2⟩
end MeasureTheory
|
MeasureTheory\Function\L2Space.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Analysis.RCLike.Lemmas
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner
import Mathlib.MeasureTheory.Integral.SetIntegral
/-! # `L^2` space
If `E` is an inner product space over `𝕜` (`ℝ` or `ℂ`), then `Lp E 2 μ`
(defined in `Mathlib.MeasureTheory.Function.LpSpace`)
is also an inner product space, with inner product defined as `inner f g = ∫ a, ⟪f a, g a⟫ ∂μ`.
### Main results
* `mem_L1_inner` : for `f` and `g` in `Lp E 2 μ`, the pointwise inner product `fun x ↦ ⟪f x, g x⟫`
belongs to `Lp 𝕜 1 μ`.
* `integrable_inner` : for `f` and `g` in `Lp E 2 μ`, the pointwise inner product
`fun x ↦ ⟪f x, g x⟫` is integrable.
* `L2.innerProductSpace` : `Lp E 2 μ` is an inner product space.
-/
noncomputable section
open TopologicalSpace MeasureTheory MeasureTheory.Lp Filter
open scoped NNReal ENNReal MeasureTheory
namespace MeasureTheory
section
variable {α F : Type*} {m : MeasurableSpace α} {μ : Measure α} [NormedAddCommGroup F]
theorem Memℒp.integrable_sq {f : α → ℝ} (h : Memℒp f 2 μ) : Integrable (fun x => f x ^ 2) μ := by
simpa [← memℒp_one_iff_integrable] using h.norm_rpow two_ne_zero ENNReal.two_ne_top
theorem memℒp_two_iff_integrable_sq_norm {f : α → F} (hf : AEStronglyMeasurable f μ) :
Memℒp f 2 μ ↔ Integrable (fun x => ‖f x‖ ^ 2) μ := by
rw [← memℒp_one_iff_integrable]
convert (memℒp_norm_rpow_iff hf two_ne_zero ENNReal.two_ne_top).symm
· simp
· rw [div_eq_mul_inv, ENNReal.mul_inv_cancel two_ne_zero ENNReal.two_ne_top]
theorem memℒp_two_iff_integrable_sq {f : α → ℝ} (hf : AEStronglyMeasurable f μ) :
Memℒp f 2 μ ↔ Integrable (fun x => f x ^ 2) μ := by
convert memℒp_two_iff_integrable_sq_norm hf using 3
simp
end
section InnerProductSpace
variable {α : Type*} {m : MeasurableSpace α} {p : ℝ≥0∞} {μ : Measure α}
variable {E 𝕜 : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E]
local notation "⟪" x ", " y "⟫" => @inner 𝕜 E _ x y
theorem Memℒp.const_inner (c : E) {f : α → E} (hf : Memℒp f p μ) : Memℒp (fun a => ⟪c, f a⟫) p μ :=
hf.of_le_mul (AEStronglyMeasurable.inner aestronglyMeasurable_const hf.1)
(eventually_of_forall fun _ => norm_inner_le_norm _ _)
theorem Memℒp.inner_const {f : α → E} (hf : Memℒp f p μ) (c : E) : Memℒp (fun a => ⟪f a, c⟫) p μ :=
hf.of_le_mul (AEStronglyMeasurable.inner hf.1 aestronglyMeasurable_const)
(eventually_of_forall fun x => by rw [mul_comm]; exact norm_inner_le_norm _ _)
variable {f : α → E}
theorem Integrable.const_inner (c : E) (hf : Integrable f μ) :
Integrable (fun x => ⟪c, f x⟫) μ := by
rw [← memℒp_one_iff_integrable] at hf ⊢; exact hf.const_inner c
theorem Integrable.inner_const (hf : Integrable f μ) (c : E) :
Integrable (fun x => ⟪f x, c⟫) μ := by
rw [← memℒp_one_iff_integrable] at hf ⊢; exact hf.inner_const c
variable [CompleteSpace E] [NormedSpace ℝ E]
theorem _root_.integral_inner {f : α → E} (hf : Integrable f μ) (c : E) :
∫ x, ⟪c, f x⟫ ∂μ = ⟪c, ∫ x, f x ∂μ⟫ :=
((innerSL 𝕜 c).restrictScalars ℝ).integral_comp_comm hf
variable (𝕜)
-- variable binder update doesn't work for lemmas which refer to `𝕜` only via the notation
-- Porting note: removed because it causes ambiguity in the lemma below
-- local notation "⟪" x ", " y "⟫" => @inner 𝕜 E _ x y
theorem _root_.integral_eq_zero_of_forall_integral_inner_eq_zero (f : α → E) (hf : Integrable f μ)
(hf_int : ∀ c : E, ∫ x, ⟪c, f x⟫ ∂μ = 0) : ∫ x, f x ∂μ = 0 := by
specialize hf_int (∫ x, f x ∂μ); rwa [integral_inner hf, inner_self_eq_zero] at hf_int
end InnerProductSpace
namespace L2
variable {α E F 𝕜 : Type*} [RCLike 𝕜] [MeasurableSpace α] {μ : Measure α} [NormedAddCommGroup E]
[InnerProductSpace 𝕜 E] [NormedAddCommGroup F]
local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y
theorem eLpNorm_rpow_two_norm_lt_top (f : Lp F 2 μ) :
eLpNorm (fun x => ‖f x‖ ^ (2 : ℝ)) 1 μ < ∞ := by
have h_two : ENNReal.ofReal (2 : ℝ) = 2 := by simp [zero_le_one]
rw [eLpNorm_norm_rpow f zero_lt_two, one_mul, h_two]
exact ENNReal.rpow_lt_top_of_nonneg zero_le_two (Lp.eLpNorm_ne_top f)
@[deprecated (since := "2024-07-27")]
alias snorm_rpow_two_norm_lt_top := eLpNorm_rpow_two_norm_lt_top
theorem eLpNorm_inner_lt_top (f g : α →₂[μ] E) : eLpNorm (fun x : α => ⟪f x, g x⟫) 1 μ < ∞ := by
have h : ∀ x, ‖⟪f x, g x⟫‖ ≤ ‖‖f x‖ ^ (2 : ℝ) + ‖g x‖ ^ (2 : ℝ)‖ := by
intro x
rw [← @Nat.cast_two ℝ, Real.rpow_natCast, Real.rpow_natCast]
calc
‖⟪f x, g x⟫‖ ≤ ‖f x‖ * ‖g x‖ := norm_inner_le_norm _ _
_ ≤ 2 * ‖f x‖ * ‖g x‖ :=
(mul_le_mul_of_nonneg_right (le_mul_of_one_le_left (norm_nonneg _) one_le_two)
(norm_nonneg _))
-- TODO(kmill): the type ascription is getting around an elaboration error
_ ≤ ‖(‖f x‖ ^ 2 + ‖g x‖ ^ 2 : ℝ)‖ := (two_mul_le_add_sq _ _).trans (le_abs_self _)
refine (eLpNorm_mono_ae (ae_of_all _ h)).trans_lt ((eLpNorm_add_le ?_ ?_ le_rfl).trans_lt ?_)
· exact ((Lp.aestronglyMeasurable f).norm.aemeasurable.pow_const _).aestronglyMeasurable
· exact ((Lp.aestronglyMeasurable g).norm.aemeasurable.pow_const _).aestronglyMeasurable
rw [ENNReal.add_lt_top]
exact ⟨eLpNorm_rpow_two_norm_lt_top f, eLpNorm_rpow_two_norm_lt_top g⟩
@[deprecated (since := "2024-07-27")]
alias snorm_inner_lt_top := eLpNorm_inner_lt_top
section InnerProductSpace
open scoped ComplexConjugate
instance : Inner 𝕜 (α →₂[μ] E) :=
⟨fun f g => ∫ a, ⟪f a, g a⟫ ∂μ⟩
theorem inner_def (f g : α →₂[μ] E) : ⟪f, g⟫ = ∫ a : α, ⟪f a, g a⟫ ∂μ :=
rfl
theorem integral_inner_eq_sq_eLpNorm (f : α →₂[μ] E) :
∫ a, ⟪f a, f a⟫ ∂μ = ENNReal.toReal (∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ (2 : ℝ) ∂μ) := by
simp_rw [inner_self_eq_norm_sq_to_K]
norm_cast
rw [integral_eq_lintegral_of_nonneg_ae]
rotate_left
· exact Filter.eventually_of_forall fun x => sq_nonneg _
· exact ((Lp.aestronglyMeasurable f).norm.aemeasurable.pow_const _).aestronglyMeasurable
congr
ext1 x
have h_two : (2 : ℝ) = ((2 : ℕ) : ℝ) := by simp
rw [← Real.rpow_natCast _ 2, ← h_two, ←
ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) zero_le_two, ofReal_norm_eq_coe_nnnorm]
norm_cast
@[deprecated (since := "2024-07-27")]
alias integral_inner_eq_sq_snorm := integral_inner_eq_sq_eLpNorm
private theorem norm_sq_eq_inner' (f : α →₂[μ] E) : ‖f‖ ^ 2 = RCLike.re ⟪f, f⟫ := by
have h_two : (2 : ℝ≥0∞).toReal = 2 := by simp
rw [inner_def, integral_inner_eq_sq_eLpNorm, norm_def, ← ENNReal.toReal_pow, RCLike.ofReal_re,
ENNReal.toReal_eq_toReal (ENNReal.pow_ne_top (Lp.eLpNorm_ne_top f)) _]
· rw [← ENNReal.rpow_natCast, eLpNorm_eq_eLpNorm' two_ne_zero ENNReal.two_ne_top, eLpNorm', ←
ENNReal.rpow_mul, one_div, h_two]
simp
· refine (lintegral_rpow_nnnorm_lt_top_of_eLpNorm'_lt_top zero_lt_two ?_).ne
rw [← h_two, ← eLpNorm_eq_eLpNorm' two_ne_zero ENNReal.two_ne_top]
exact Lp.eLpNorm_lt_top f
theorem mem_L1_inner (f g : α →₂[μ] E) :
AEEqFun.mk (fun x => ⟪f x, g x⟫)
((Lp.aestronglyMeasurable f).inner (Lp.aestronglyMeasurable g)) ∈
Lp 𝕜 1 μ := by
simp_rw [mem_Lp_iff_eLpNorm_lt_top, eLpNorm_aeeqFun]; exact eLpNorm_inner_lt_top f g
theorem integrable_inner (f g : α →₂[μ] E) : Integrable (fun x : α => ⟪f x, g x⟫) μ :=
(integrable_congr
(AEEqFun.coeFn_mk (fun x => ⟪f x, g x⟫)
((Lp.aestronglyMeasurable f).inner (Lp.aestronglyMeasurable g)))).mp
(AEEqFun.integrable_iff_mem_L1.mpr (mem_L1_inner f g))
private theorem add_left' (f f' g : α →₂[μ] E) : ⟪f + f', g⟫ = inner f g + inner f' g := by
simp_rw [inner_def, ← integral_add (integrable_inner f g) (integrable_inner f' g), ←
inner_add_left]
refine integral_congr_ae ((coeFn_add f f').mono fun x hx => ?_)
-- Porting note: was
-- congr
-- rwa [Pi.add_apply] at hx
simp only
rw [hx, Pi.add_apply]
private theorem smul_left' (f g : α →₂[μ] E) (r : 𝕜) : ⟪r • f, g⟫ = conj r * inner f g := by
rw [inner_def, inner_def, ← smul_eq_mul, ← integral_smul]
refine integral_congr_ae ((coeFn_smul r f).mono fun x hx => ?_)
simp only
rw [smul_eq_mul, ← inner_smul_left, hx, Pi.smul_apply]
-- Porting note: was
-- rw [smul_eq_mul, ← inner_smul_left]
-- congr
-- rwa [Pi.smul_apply] at hx
instance innerProductSpace : InnerProductSpace 𝕜 (α →₂[μ] E) where
norm_sq_eq_inner := norm_sq_eq_inner'
conj_symm _ _ := by simp_rw [inner_def, ← integral_conj, inner_conj_symm]
add_left := add_left'
smul_left := smul_left'
end InnerProductSpace
section IndicatorConstLp
variable (𝕜) {s : Set α}
/-- The inner product in `L2` of the indicator of a set `indicatorConstLp 2 hs hμs c` and `f` is
equal to the integral of the inner product over `s`: `∫ x in s, ⟪c, f x⟫ ∂μ`. -/
theorem inner_indicatorConstLp_eq_setIntegral_inner (f : Lp E 2 μ) (hs : MeasurableSet s) (c : E)
(hμs : μ s ≠ ∞) : (⟪indicatorConstLp 2 hs hμs c, f⟫ : 𝕜) = ∫ x in s, ⟪c, f x⟫ ∂μ := by
rw [inner_def, ← integral_add_compl hs (L2.integrable_inner _ f)]
have h_left : (∫ x in s, ⟪(indicatorConstLp 2 hs hμs c) x, f x⟫ ∂μ) = ∫ x in s, ⟪c, f x⟫ ∂μ := by
suffices h_ae_eq : ∀ᵐ x ∂μ, x ∈ s → ⟪indicatorConstLp 2 hs hμs c x, f x⟫ = ⟪c, f x⟫ from
setIntegral_congr_ae hs h_ae_eq
have h_indicator : ∀ᵐ x : α ∂μ, x ∈ s → indicatorConstLp 2 hs hμs c x = c :=
indicatorConstLp_coeFn_mem
refine h_indicator.mono fun x hx hxs => ?_
congr
exact hx hxs
have h_right : (∫ x in sᶜ, ⟪(indicatorConstLp 2 hs hμs c) x, f x⟫ ∂μ) = 0 := by
suffices h_ae_eq : ∀ᵐ x ∂μ, x ∉ s → ⟪indicatorConstLp 2 hs hμs c x, f x⟫ = 0 by
simp_rw [← Set.mem_compl_iff] at h_ae_eq
suffices h_int_zero :
(∫ x in sᶜ, inner (indicatorConstLp 2 hs hμs c x) (f x) ∂μ) = ∫ _ in sᶜ, (0 : 𝕜) ∂μ by
rw [h_int_zero]
simp
exact setIntegral_congr_ae hs.compl h_ae_eq
have h_indicator : ∀ᵐ x : α ∂μ, x ∉ s → indicatorConstLp 2 hs hμs c x = 0 :=
indicatorConstLp_coeFn_nmem
refine h_indicator.mono fun x hx hxs => ?_
rw [hx hxs]
exact inner_zero_left _
rw [h_left, h_right, add_zero]
@[deprecated (since := "2024-04-17")]
alias inner_indicatorConstLp_eq_set_integral_inner :=
inner_indicatorConstLp_eq_setIntegral_inner
/-- The inner product in `L2` of the indicator of a set `indicatorConstLp 2 hs hμs c` and `f` is
equal to the inner product of the constant `c` and the integral of `f` over `s`. -/
theorem inner_indicatorConstLp_eq_inner_setIntegral [CompleteSpace E] [NormedSpace ℝ E]
(hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) (f : Lp E 2 μ) :
(⟪indicatorConstLp 2 hs hμs c, f⟫ : 𝕜) = ⟪c, ∫ x in s, f x ∂μ⟫ := by
rw [← integral_inner (integrableOn_Lp_of_measure_ne_top f fact_one_le_two_ennreal.elim hμs),
L2.inner_indicatorConstLp_eq_setIntegral_inner]
@[deprecated (since := "2024-04-17")]
alias inner_indicatorConstLp_eq_inner_set_integral :=
inner_indicatorConstLp_eq_inner_setIntegral
variable {𝕜}
/-- The inner product in `L2` of the indicator of a set `indicatorConstLp 2 hs hμs (1 : 𝕜)` and
a real or complex function `f` is equal to the integral of `f` over `s`. -/
theorem inner_indicatorConstLp_one (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (f : Lp 𝕜 2 μ) :
⟪indicatorConstLp 2 hs hμs (1 : 𝕜), f⟫ = ∫ x in s, f x ∂μ := by
rw [L2.inner_indicatorConstLp_eq_inner_setIntegral 𝕜 hs hμs (1 : 𝕜) f]; simp
end IndicatorConstLp
end L2
section InnerContinuous
variable {α 𝕜 : Type*} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] [RCLike 𝕜]
variable (μ : Measure α) [IsFiniteMeasure μ]
open scoped BoundedContinuousFunction ComplexConjugate
local notation "⟪" x ", " y "⟫" => @inner 𝕜 (α →₂[μ] 𝕜) _ x y
-- Porting note: added `(E := 𝕜)`
/-- For bounded continuous functions `f`, `g` on a finite-measure topological space `α`, the L^2
inner product is the integral of their pointwise inner product. -/
theorem BoundedContinuousFunction.inner_toLp (f g : α →ᵇ 𝕜) :
⟪BoundedContinuousFunction.toLp (E := 𝕜) 2 μ 𝕜 f,
BoundedContinuousFunction.toLp (E := 𝕜) 2 μ 𝕜 g⟫ =
∫ x, conj (f x) * g x ∂μ := by
apply integral_congr_ae
have hf_ae := f.coeFn_toLp 2 μ 𝕜
have hg_ae := g.coeFn_toLp 2 μ 𝕜
filter_upwards [hf_ae, hg_ae] with _ hf hg
rw [hf, hg]
simp
variable [CompactSpace α]
/-- For continuous functions `f`, `g` on a compact, finite-measure topological space `α`, the L^2
inner product is the integral of their pointwise inner product. -/
theorem ContinuousMap.inner_toLp (f g : C(α, 𝕜)) :
⟪ContinuousMap.toLp (E := 𝕜) 2 μ 𝕜 f, ContinuousMap.toLp (E := 𝕜) 2 μ 𝕜 g⟫ =
∫ x, conj (f x) * g x ∂μ := by
apply integral_congr_ae
-- Porting note: added explicitly passed arguments
have hf_ae := f.coeFn_toLp (p := 2) (𝕜 := 𝕜) μ
have hg_ae := g.coeFn_toLp (p := 2) (𝕜 := 𝕜) μ
filter_upwards [hf_ae, hg_ae] with _ hf hg
rw [hf, hg]
simp
end InnerContinuous
end MeasureTheory
|
MeasureTheory\Function\LocallyIntegrable.lean | /-
Copyright (c) 2022 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn
-/
import Mathlib.MeasureTheory.Integral.IntegrableOn
/-!
# Locally integrable functions
A function is called *locally integrable* (`MeasureTheory.LocallyIntegrable`) if it is integrable
on a neighborhood of every point. More generally, it is *locally integrable on `s`* if it is
locally integrable on a neighbourhood within `s` of any point of `s`.
This file contains properties of locally integrable functions, and integrability results
on compact sets.
## Main statements
* `Continuous.locallyIntegrable`: A continuous function is locally integrable.
* `ContinuousOn.locallyIntegrableOn`: A function which is continuous on `s` is locally
integrable on `s`.
-/
open MeasureTheory MeasureTheory.Measure Set Function TopologicalSpace Bornology
open scoped Topology Interval ENNReal
variable {X Y E F R : Type*} [MeasurableSpace X] [TopologicalSpace X]
variable [MeasurableSpace Y] [TopologicalSpace Y]
variable [NormedAddCommGroup E] [NormedAddCommGroup F] {f g : X → E} {μ : Measure X} {s : Set X}
namespace MeasureTheory
section LocallyIntegrableOn
/-- A function `f : X → E` is *locally integrable on s*, for `s ⊆ X`, if for every `x ∈ s` there is
a neighbourhood of `x` within `s` on which `f` is integrable. (Note this is, in general, strictly
weaker than local integrability with respect to `μ.restrict s`.) -/
def LocallyIntegrableOn (f : X → E) (s : Set X) (μ : Measure X := by volume_tac) : Prop :=
∀ x : X, x ∈ s → IntegrableAtFilter f (𝓝[s] x) μ
theorem LocallyIntegrableOn.mono_set (hf : LocallyIntegrableOn f s μ) {t : Set X}
(hst : t ⊆ s) : LocallyIntegrableOn f t μ := fun x hx =>
(hf x <| hst hx).filter_mono (nhdsWithin_mono x hst)
theorem LocallyIntegrableOn.norm (hf : LocallyIntegrableOn f s μ) :
LocallyIntegrableOn (fun x => ‖f x‖) s μ := fun t ht =>
let ⟨U, hU_nhd, hU_int⟩ := hf t ht
⟨U, hU_nhd, hU_int.norm⟩
theorem LocallyIntegrableOn.mono (hf : LocallyIntegrableOn f s μ) {g : X → F}
(hg : AEStronglyMeasurable g μ) (h : ∀ᵐ x ∂μ, ‖g x‖ ≤ ‖f x‖) :
LocallyIntegrableOn g s μ := by
intro x hx
rcases hf x hx with ⟨t, t_mem, ht⟩
exact ⟨t, t_mem, Integrable.mono ht hg.restrict (ae_restrict_of_ae h)⟩
theorem IntegrableOn.locallyIntegrableOn (hf : IntegrableOn f s μ) : LocallyIntegrableOn f s μ :=
fun _ _ => ⟨s, self_mem_nhdsWithin, hf⟩
/-- If a function is locally integrable on a compact set, then it is integrable on that set. -/
theorem LocallyIntegrableOn.integrableOn_isCompact (hf : LocallyIntegrableOn f s μ)
(hs : IsCompact s) : IntegrableOn f s μ :=
IsCompact.induction_on hs integrableOn_empty (fun _u _v huv hv => hv.mono_set huv)
(fun _u _v hu hv => integrableOn_union.mpr ⟨hu, hv⟩) hf
theorem LocallyIntegrableOn.integrableOn_compact_subset (hf : LocallyIntegrableOn f s μ) {t : Set X}
(hst : t ⊆ s) (ht : IsCompact t) : IntegrableOn f t μ :=
(hf.mono_set hst).integrableOn_isCompact ht
/-- If a function `f` is locally integrable on a set `s` in a second countable topological space,
then there exist countably many open sets `u` covering `s` such that `f` is integrable on each
set `u ∩ s`. -/
theorem LocallyIntegrableOn.exists_countable_integrableOn [SecondCountableTopology X]
(hf : LocallyIntegrableOn f s μ) : ∃ T : Set (Set X), T.Countable ∧
(∀ u ∈ T, IsOpen u) ∧ (s ⊆ ⋃ u ∈ T, u) ∧ (∀ u ∈ T, IntegrableOn f (u ∩ s) μ) := by
have : ∀ x : s, ∃ u, IsOpen u ∧ x.1 ∈ u ∧ IntegrableOn f (u ∩ s) μ := by
rintro ⟨x, hx⟩
rcases hf x hx with ⟨t, ht, h't⟩
rcases mem_nhdsWithin.1 ht with ⟨u, u_open, x_mem, u_sub⟩
exact ⟨u, u_open, x_mem, h't.mono_set u_sub⟩
choose u u_open xu hu using this
obtain ⟨T, T_count, hT⟩ : ∃ T : Set s, T.Countable ∧ s ⊆ ⋃ i ∈ T, u i := by
have : s ⊆ ⋃ x : s, u x := fun y hy => mem_iUnion_of_mem ⟨y, hy⟩ (xu ⟨y, hy⟩)
obtain ⟨T, hT_count, hT_un⟩ := isOpen_iUnion_countable u u_open
exact ⟨T, hT_count, by rwa [hT_un]⟩
refine ⟨u '' T, T_count.image _, ?_, by rwa [biUnion_image], ?_⟩
· rintro v ⟨w, -, rfl⟩
exact u_open _
· rintro v ⟨w, -, rfl⟩
exact hu _
/-- If a function `f` is locally integrable on a set `s` in a second countable topological space,
then there exists a sequence of open sets `u n` covering `s` such that `f` is integrable on each
set `u n ∩ s`. -/
theorem LocallyIntegrableOn.exists_nat_integrableOn [SecondCountableTopology X]
(hf : LocallyIntegrableOn f s μ) : ∃ u : ℕ → Set X,
(∀ n, IsOpen (u n)) ∧ (s ⊆ ⋃ n, u n) ∧ (∀ n, IntegrableOn f (u n ∩ s) μ) := by
rcases hf.exists_countable_integrableOn with ⟨T, T_count, T_open, sT, hT⟩
let T' : Set (Set X) := insert ∅ T
have T'_count : T'.Countable := Countable.insert ∅ T_count
have T'_ne : T'.Nonempty := by simp only [T', insert_nonempty]
rcases T'_count.exists_eq_range T'_ne with ⟨u, hu⟩
refine ⟨u, ?_, ?_, ?_⟩
· intro n
have : u n ∈ T' := by rw [hu]; exact mem_range_self n
rcases mem_insert_iff.1 this with h|h
· rw [h]
exact isOpen_empty
· exact T_open _ h
· intro x hx
obtain ⟨v, hv, h'v⟩ : ∃ v, v ∈ T ∧ x ∈ v := by simpa only [mem_iUnion, exists_prop] using sT hx
have : v ∈ range u := by rw [← hu]; exact subset_insert ∅ T hv
obtain ⟨n, rfl⟩ : ∃ n, u n = v := by simpa only [mem_range] using this
exact mem_iUnion_of_mem _ h'v
· intro n
have : u n ∈ T' := by rw [hu]; exact mem_range_self n
rcases mem_insert_iff.1 this with h|h
· simp only [h, empty_inter, integrableOn_empty]
· exact hT _ h
theorem LocallyIntegrableOn.aestronglyMeasurable [SecondCountableTopology X]
(hf : LocallyIntegrableOn f s μ) : AEStronglyMeasurable f (μ.restrict s) := by
rcases hf.exists_nat_integrableOn with ⟨u, -, su, hu⟩
have : s = ⋃ n, u n ∩ s := by rw [← iUnion_inter]; exact (inter_eq_right.mpr su).symm
rw [this, aestronglyMeasurable_iUnion_iff]
exact fun i : ℕ => (hu i).aestronglyMeasurable
/-- If `s` is either open, or closed, then `f` is locally integrable on `s` iff it is integrable on
every compact subset contained in `s`. -/
theorem locallyIntegrableOn_iff [LocallyCompactSpace X] [T2Space X] (hs : IsClosed s ∨ IsOpen s) :
LocallyIntegrableOn f s μ ↔ ∀ (k : Set X), k ⊆ s → (IsCompact k → IntegrableOn f k μ) := by
-- The correct condition is that `s` be *locally closed*, i.e. for every `x ∈ s` there is some
-- `U ∈ 𝓝 x` such that `U ∩ s` is closed. But mathlib doesn't have locally closed sets yet.
refine ⟨fun hf k hk => hf.integrableOn_compact_subset hk, fun hf x hx => ?_⟩
cases hs with
| inl hs =>
exact
let ⟨K, hK, h2K⟩ := exists_compact_mem_nhds x
⟨_, inter_mem_nhdsWithin s h2K,
hf _ inter_subset_left
(hK.of_isClosed_subset (hs.inter hK.isClosed) inter_subset_right)⟩
| inr hs =>
obtain ⟨K, hK, h2K, h3K⟩ := exists_compact_subset hs hx
refine ⟨K, ?_, hf K h3K hK⟩
simpa only [IsOpen.nhdsWithin_eq hs hx, interior_eq_nhds'] using h2K
protected theorem LocallyIntegrableOn.add
(hf : LocallyIntegrableOn f s μ) (hg : LocallyIntegrableOn g s μ) :
LocallyIntegrableOn (f + g) s μ := fun x hx ↦ (hf x hx).add (hg x hx)
protected theorem LocallyIntegrableOn.sub
(hf : LocallyIntegrableOn f s μ) (hg : LocallyIntegrableOn g s μ) :
LocallyIntegrableOn (f - g) s μ := fun x hx ↦ (hf x hx).sub (hg x hx)
protected theorem LocallyIntegrableOn.neg (hf : LocallyIntegrableOn f s μ) :
LocallyIntegrableOn (-f) s μ := fun x hx ↦ (hf x hx).neg
end LocallyIntegrableOn
/-- A function `f : X → E` is *locally integrable* if it is integrable on a neighborhood of every
point. In particular, it is integrable on all compact sets,
see `LocallyIntegrable.integrableOn_isCompact`. -/
def LocallyIntegrable (f : X → E) (μ : Measure X := by volume_tac) : Prop :=
∀ x : X, IntegrableAtFilter f (𝓝 x) μ
theorem locallyIntegrable_comap (hs : MeasurableSet s) :
LocallyIntegrable (fun x : s ↦ f x) (μ.comap Subtype.val) ↔ LocallyIntegrableOn f s μ := by
simp_rw [LocallyIntegrableOn, Subtype.forall', ← map_nhds_subtype_val]
exact forall_congr' fun _ ↦ (MeasurableEmbedding.subtype_coe hs).integrableAtFilter_iff_comap.symm
theorem locallyIntegrableOn_univ : LocallyIntegrableOn f univ μ ↔ LocallyIntegrable f μ := by
simp only [LocallyIntegrableOn, nhdsWithin_univ, mem_univ, true_imp_iff]; rfl
theorem LocallyIntegrable.locallyIntegrableOn (hf : LocallyIntegrable f μ) (s : Set X) :
LocallyIntegrableOn f s μ := fun x _ => (hf x).filter_mono nhdsWithin_le_nhds
theorem Integrable.locallyIntegrable (hf : Integrable f μ) : LocallyIntegrable f μ := fun _ =>
hf.integrableAtFilter _
theorem LocallyIntegrable.mono (hf : LocallyIntegrable f μ) {g : X → F}
(hg : AEStronglyMeasurable g μ) (h : ∀ᵐ x ∂μ, ‖g x‖ ≤ ‖f x‖) :
LocallyIntegrable g μ := by
rw [← locallyIntegrableOn_univ] at hf ⊢
exact hf.mono hg h
/-- If `f` is locally integrable with respect to `μ.restrict s`, it is locally integrable on `s`.
(See `locallyIntegrableOn_iff_locallyIntegrable_restrict` for an iff statement when `s` is
closed.) -/
theorem locallyIntegrableOn_of_locallyIntegrable_restrict [OpensMeasurableSpace X]
(hf : LocallyIntegrable f (μ.restrict s)) : LocallyIntegrableOn f s μ := by
intro x _
obtain ⟨t, ht_mem, ht_int⟩ := hf x
obtain ⟨u, hu_sub, hu_o, hu_mem⟩ := mem_nhds_iff.mp ht_mem
refine ⟨_, inter_mem_nhdsWithin s (hu_o.mem_nhds hu_mem), ?_⟩
simpa only [IntegrableOn, Measure.restrict_restrict hu_o.measurableSet, inter_comm] using
ht_int.mono_set hu_sub
/-- If `s` is closed, being locally integrable on `s` wrt `μ` is equivalent to being locally
integrable with respect to `μ.restrict s`. For the one-way implication without assuming `s` closed,
see `locallyIntegrableOn_of_locallyIntegrable_restrict`. -/
theorem locallyIntegrableOn_iff_locallyIntegrable_restrict [OpensMeasurableSpace X]
(hs : IsClosed s) : LocallyIntegrableOn f s μ ↔ LocallyIntegrable f (μ.restrict s) := by
refine ⟨fun hf x => ?_, locallyIntegrableOn_of_locallyIntegrable_restrict⟩
by_cases h : x ∈ s
· obtain ⟨t, ht_nhds, ht_int⟩ := hf x h
obtain ⟨u, hu_o, hu_x, hu_sub⟩ := mem_nhdsWithin.mp ht_nhds
refine ⟨u, hu_o.mem_nhds hu_x, ?_⟩
rw [IntegrableOn, restrict_restrict hu_o.measurableSet]
exact ht_int.mono_set hu_sub
· rw [← isOpen_compl_iff] at hs
refine ⟨sᶜ, hs.mem_nhds h, ?_⟩
rw [IntegrableOn, restrict_restrict, inter_comm, inter_compl_self, ← IntegrableOn]
exacts [integrableOn_empty, hs.measurableSet]
/-- If a function is locally integrable, then it is integrable on any compact set. -/
theorem LocallyIntegrable.integrableOn_isCompact {k : Set X} (hf : LocallyIntegrable f μ)
(hk : IsCompact k) : IntegrableOn f k μ :=
(hf.locallyIntegrableOn k).integrableOn_isCompact hk
/-- If a function is locally integrable, then it is integrable on an open neighborhood of any
compact set. -/
theorem LocallyIntegrable.integrableOn_nhds_isCompact (hf : LocallyIntegrable f μ) {k : Set X}
(hk : IsCompact k) : ∃ u, IsOpen u ∧ k ⊆ u ∧ IntegrableOn f u μ := by
refine IsCompact.induction_on hk ?_ ?_ ?_ ?_
· refine ⟨∅, isOpen_empty, Subset.rfl, integrableOn_empty⟩
· rintro s t hst ⟨u, u_open, tu, hu⟩
exact ⟨u, u_open, hst.trans tu, hu⟩
· rintro s t ⟨u, u_open, su, hu⟩ ⟨v, v_open, tv, hv⟩
exact ⟨u ∪ v, u_open.union v_open, union_subset_union su tv, hu.union hv⟩
· intro x _
rcases hf x with ⟨u, ux, hu⟩
rcases mem_nhds_iff.1 ux with ⟨v, vu, v_open, xv⟩
exact ⟨v, nhdsWithin_le_nhds (v_open.mem_nhds xv), v, v_open, Subset.rfl, hu.mono_set vu⟩
theorem locallyIntegrable_iff [LocallyCompactSpace X] :
LocallyIntegrable f μ ↔ ∀ k : Set X, IsCompact k → IntegrableOn f k μ :=
⟨fun hf _k hk => hf.integrableOn_isCompact hk, fun hf x =>
let ⟨K, hK, h2K⟩ := exists_compact_mem_nhds x
⟨K, h2K, hf K hK⟩⟩
theorem LocallyIntegrable.aestronglyMeasurable [SecondCountableTopology X]
(hf : LocallyIntegrable f μ) : AEStronglyMeasurable f μ := by
simpa only [restrict_univ] using (locallyIntegrableOn_univ.mpr hf).aestronglyMeasurable
/-- If a function is locally integrable in a second countable topological space,
then there exists a sequence of open sets covering the space on which it is integrable. -/
theorem LocallyIntegrable.exists_nat_integrableOn [SecondCountableTopology X]
(hf : LocallyIntegrable f μ) : ∃ u : ℕ → Set X,
(∀ n, IsOpen (u n)) ∧ ((⋃ n, u n) = univ) ∧ (∀ n, IntegrableOn f (u n) μ) := by
rcases (hf.locallyIntegrableOn univ).exists_nat_integrableOn with ⟨u, u_open, u_union, hu⟩
refine ⟨u, u_open, eq_univ_of_univ_subset u_union, fun n ↦ ?_⟩
simpa only [inter_univ] using hu n
theorem Memℒp.locallyIntegrable [IsLocallyFiniteMeasure μ] {f : X → E} {p : ℝ≥0∞}
(hf : Memℒp f p μ) (hp : 1 ≤ p) : LocallyIntegrable f μ := by
intro x
rcases μ.finiteAt_nhds x with ⟨U, hU, h'U⟩
have : Fact (μ U < ⊤) := ⟨h'U⟩
refine ⟨U, hU, ?_⟩
rw [IntegrableOn, ← memℒp_one_iff_integrable]
apply (hf.restrict U).memℒp_of_exponent_le hp
theorem locallyIntegrable_const [IsLocallyFiniteMeasure μ] (c : E) :
LocallyIntegrable (fun _ => c) μ :=
(memℒp_top_const c).locallyIntegrable le_top
theorem locallyIntegrableOn_const [IsLocallyFiniteMeasure μ] (c : E) :
LocallyIntegrableOn (fun _ => c) s μ :=
(locallyIntegrable_const c).locallyIntegrableOn s
theorem locallyIntegrable_zero : LocallyIntegrable (fun _ ↦ (0 : E)) μ :=
(integrable_zero X E μ).locallyIntegrable
theorem locallyIntegrableOn_zero : LocallyIntegrableOn (fun _ ↦ (0 : E)) s μ :=
locallyIntegrable_zero.locallyIntegrableOn s
theorem LocallyIntegrable.indicator (hf : LocallyIntegrable f μ) {s : Set X}
(hs : MeasurableSet s) : LocallyIntegrable (s.indicator f) μ := by
intro x
rcases hf x with ⟨U, hU, h'U⟩
exact ⟨U, hU, h'U.indicator hs⟩
theorem locallyIntegrable_map_homeomorph [BorelSpace X] [BorelSpace Y] (e : X ≃ₜ Y) {f : Y → E}
{μ : Measure X} : LocallyIntegrable f (Measure.map e μ) ↔ LocallyIntegrable (f ∘ e) μ := by
refine ⟨fun h x => ?_, fun h x => ?_⟩
· rcases h (e x) with ⟨U, hU, h'U⟩
refine ⟨e ⁻¹' U, e.continuous.continuousAt.preimage_mem_nhds hU, ?_⟩
exact (integrableOn_map_equiv e.toMeasurableEquiv).1 h'U
· rcases h (e.symm x) with ⟨U, hU, h'U⟩
refine ⟨e.symm ⁻¹' U, e.symm.continuous.continuousAt.preimage_mem_nhds hU, ?_⟩
apply (integrableOn_map_equiv e.toMeasurableEquiv).2
simp only [Homeomorph.toMeasurableEquiv_coe]
convert h'U
ext x
simp only [mem_preimage, Homeomorph.symm_apply_apply]
protected theorem LocallyIntegrable.add (hf : LocallyIntegrable f μ) (hg : LocallyIntegrable g μ) :
LocallyIntegrable (f + g) μ := fun x ↦ (hf x).add (hg x)
protected theorem LocallyIntegrable.sub (hf : LocallyIntegrable f μ) (hg : LocallyIntegrable g μ) :
LocallyIntegrable (f - g) μ := fun x ↦ (hf x).sub (hg x)
protected theorem LocallyIntegrable.neg (hf : LocallyIntegrable f μ) :
LocallyIntegrable (-f) μ := fun x ↦ (hf x).neg
protected theorem LocallyIntegrable.smul {𝕜 : Type*} [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 E]
[BoundedSMul 𝕜 E] (hf : LocallyIntegrable f μ) (c : 𝕜) :
LocallyIntegrable (c • f) μ := fun x ↦ (hf x).smul c
theorem locallyIntegrable_finset_sum' {ι} (s : Finset ι) {f : ι → X → E}
(hf : ∀ i ∈ s, LocallyIntegrable (f i) μ) : LocallyIntegrable (∑ i ∈ s, f i) μ :=
Finset.sum_induction f (fun g => LocallyIntegrable g μ) (fun _ _ => LocallyIntegrable.add)
locallyIntegrable_zero hf
theorem locallyIntegrable_finset_sum {ι} (s : Finset ι) {f : ι → X → E}
(hf : ∀ i ∈ s, LocallyIntegrable (f i) μ) : LocallyIntegrable (fun a ↦ ∑ i ∈ s, f i a) μ := by
simpa only [← Finset.sum_apply] using locallyIntegrable_finset_sum' s hf
/-- If `f` is locally integrable and `g` is continuous with compact support,
then `g • f` is integrable. -/
theorem LocallyIntegrable.integrable_smul_left_of_hasCompactSupport
[NormedSpace ℝ E] [OpensMeasurableSpace X] [T2Space X]
(hf : LocallyIntegrable f μ) {g : X → ℝ} (hg : Continuous g) (h'g : HasCompactSupport g) :
Integrable (fun x ↦ g x • f x) μ := by
let K := tsupport g
have hK : IsCompact K := h'g
have : K.indicator (fun x ↦ g x • f x) = (fun x ↦ g x • f x) := by
apply indicator_eq_self.2
apply support_subset_iff'.2
intros x hx
simp [image_eq_zero_of_nmem_tsupport hx]
rw [← this, indicator_smul]
apply Integrable.smul_of_top_right
· rw [integrable_indicator_iff hK.measurableSet]
exact hf.integrableOn_isCompact hK
· exact hg.memℒp_top_of_hasCompactSupport h'g μ
/-- If `f` is locally integrable and `g` is continuous with compact support,
then `f • g` is integrable. -/
theorem LocallyIntegrable.integrable_smul_right_of_hasCompactSupport
[NormedSpace ℝ E] [OpensMeasurableSpace X] [T2Space X] {f : X → ℝ} (hf : LocallyIntegrable f μ)
{g : X → E} (hg : Continuous g) (h'g : HasCompactSupport g) :
Integrable (fun x ↦ f x • g x) μ := by
let K := tsupport g
have hK : IsCompact K := h'g
have : K.indicator (fun x ↦ f x • g x) = (fun x ↦ f x • g x) := by
apply indicator_eq_self.2
apply support_subset_iff'.2
intros x hx
simp [image_eq_zero_of_nmem_tsupport hx]
rw [← this, indicator_smul_left]
apply Integrable.smul_of_top_left
· rw [integrable_indicator_iff hK.measurableSet]
exact hf.integrableOn_isCompact hK
· exact hg.memℒp_top_of_hasCompactSupport h'g μ
open Filter
theorem integrable_iff_integrableAtFilter_cocompact :
Integrable f μ ↔ (IntegrableAtFilter f (cocompact X) μ ∧ LocallyIntegrable f μ) := by
refine ⟨fun hf ↦ ⟨hf.integrableAtFilter _, hf.locallyIntegrable⟩, fun ⟨⟨s, hsc, hs⟩, hloc⟩ ↦ ?_⟩
obtain ⟨t, htc, ht⟩ := mem_cocompact'.mp hsc
rewrite [← integrableOn_univ, ← compl_union_self s, integrableOn_union]
exact ⟨(hloc.integrableOn_isCompact htc).mono ht le_rfl, hs⟩
theorem integrable_iff_integrableAtFilter_atBot_atTop [LinearOrder X] [CompactIccSpace X] :
Integrable f μ ↔
(IntegrableAtFilter f atBot μ ∧ IntegrableAtFilter f atTop μ) ∧ LocallyIntegrable f μ := by
constructor
· exact fun hf ↦ ⟨⟨hf.integrableAtFilter _, hf.integrableAtFilter _⟩, hf.locallyIntegrable⟩
· refine fun h ↦ integrable_iff_integrableAtFilter_cocompact.mpr ⟨?_, h.2⟩
exact (IntegrableAtFilter.sup_iff.mpr h.1).filter_mono cocompact_le_atBot_atTop
theorem integrable_iff_integrableAtFilter_atBot [LinearOrder X] [OrderTop X] [CompactIccSpace X] :
Integrable f μ ↔ IntegrableAtFilter f atBot μ ∧ LocallyIntegrable f μ := by
constructor
· exact fun hf ↦ ⟨hf.integrableAtFilter _, hf.locallyIntegrable⟩
· refine fun h ↦ integrable_iff_integrableAtFilter_cocompact.mpr ⟨?_, h.2⟩
exact h.1.filter_mono cocompact_le_atBot
theorem integrable_iff_integrableAtFilter_atTop [LinearOrder X] [OrderBot X] [CompactIccSpace X] :
Integrable f μ ↔ IntegrableAtFilter f atTop μ ∧ LocallyIntegrable f μ :=
integrable_iff_integrableAtFilter_atBot (X := Xᵒᵈ)
variable {a : X}
theorem integrableOn_Iic_iff_integrableAtFilter_atBot [LinearOrder X] [CompactIccSpace X] :
IntegrableOn f (Iic a) μ ↔ IntegrableAtFilter f atBot μ ∧ LocallyIntegrableOn f (Iic a) μ := by
refine ⟨fun h ↦ ⟨⟨Iic a, Iic_mem_atBot a, h⟩, h.locallyIntegrableOn⟩, fun ⟨⟨s, hsl, hs⟩, h⟩ ↦ ?_⟩
haveI : Nonempty X := Nonempty.intro a
obtain ⟨a', ha'⟩ := mem_atBot_sets.mp hsl
refine (integrableOn_union.mpr ⟨hs.mono ha' le_rfl, ?_⟩).mono Iic_subset_Iic_union_Icc le_rfl
exact h.integrableOn_compact_subset Icc_subset_Iic_self isCompact_Icc
theorem integrableOn_Ici_iff_integrableAtFilter_atTop [LinearOrder X] [CompactIccSpace X] :
IntegrableOn f (Ici a) μ ↔ IntegrableAtFilter f atTop μ ∧ LocallyIntegrableOn f (Ici a) μ :=
integrableOn_Iic_iff_integrableAtFilter_atBot (X := Xᵒᵈ)
theorem integrableOn_Iio_iff_integrableAtFilter_atBot_nhdsWithin
[LinearOrder X] [CompactIccSpace X] [NoMinOrder X] [OrderTopology X] :
IntegrableOn f (Iio a) μ ↔ IntegrableAtFilter f atBot μ ∧
IntegrableAtFilter f (𝓝[<] a) μ ∧ LocallyIntegrableOn f (Iio a) μ := by
constructor
· intro h
exact ⟨⟨Iio a, Iio_mem_atBot a, h⟩, ⟨Iio a, self_mem_nhdsWithin, h⟩, h.locallyIntegrableOn⟩
· intro ⟨hbot, ⟨s, hsl, hs⟩, hlocal⟩
obtain ⟨s', ⟨hs'_mono, hs'⟩⟩ := mem_nhdsWithin_Iio_iff_exists_Ioo_subset.mp hsl
refine (integrableOn_union.mpr ⟨?_, hs.mono hs' le_rfl⟩).mono Iio_subset_Iic_union_Ioo le_rfl
exact integrableOn_Iic_iff_integrableAtFilter_atBot.mpr
⟨hbot, hlocal.mono_set (Iic_subset_Iio.mpr hs'_mono)⟩
theorem integrableOn_Ioi_iff_integrableAtFilter_atTop_nhdsWithin
[LinearOrder X] [CompactIccSpace X] [NoMaxOrder X] [OrderTopology X] :
IntegrableOn f (Ioi a) μ ↔ IntegrableAtFilter f atTop μ ∧
IntegrableAtFilter f (𝓝[>] a) μ ∧ LocallyIntegrableOn f (Ioi a) μ :=
integrableOn_Iio_iff_integrableAtFilter_atBot_nhdsWithin (X := Xᵒᵈ)
end MeasureTheory
open MeasureTheory
section borel
variable [OpensMeasurableSpace X]
variable {K : Set X} {a b : X}
/-- A continuous function `f` is locally integrable with respect to any locally finite measure. -/
theorem Continuous.locallyIntegrable [IsLocallyFiniteMeasure μ] [SecondCountableTopologyEither X E]
(hf : Continuous f) : LocallyIntegrable f μ :=
hf.integrableAt_nhds
/-- A function `f` continuous on a set `K` is locally integrable on this set with respect
to any locally finite measure. -/
theorem ContinuousOn.locallyIntegrableOn [IsLocallyFiniteMeasure μ]
[SecondCountableTopologyEither X E] (hf : ContinuousOn f K)
(hK : MeasurableSet K) : LocallyIntegrableOn f K μ := fun _x hx =>
hf.integrableAt_nhdsWithin hK hx
variable [IsFiniteMeasureOnCompacts μ]
/-- A function `f` continuous on a compact set `K` is integrable on this set with respect to any
locally finite measure. -/
theorem ContinuousOn.integrableOn_compact'
(hK : IsCompact K) (h'K : MeasurableSet K) (hf : ContinuousOn f K) :
IntegrableOn f K μ := by
refine ⟨ContinuousOn.aestronglyMeasurable_of_isCompact hf hK h'K, ?_⟩
have : Fact (μ K < ∞) := ⟨hK.measure_lt_top⟩
obtain ⟨C, hC⟩ : ∃ C, ∀ x ∈ f '' K, ‖x‖ ≤ C :=
IsBounded.exists_norm_le (hK.image_of_continuousOn hf).isBounded
apply hasFiniteIntegral_of_bounded (C := C)
filter_upwards [ae_restrict_mem h'K] with x hx using hC _ (mem_image_of_mem f hx)
theorem ContinuousOn.integrableOn_compact [T2Space X]
(hK : IsCompact K) (hf : ContinuousOn f K) : IntegrableOn f K μ :=
hf.integrableOn_compact' hK hK.measurableSet
theorem ContinuousOn.integrableOn_Icc [Preorder X] [CompactIccSpace X] [T2Space X]
(hf : ContinuousOn f (Icc a b)) : IntegrableOn f (Icc a b) μ :=
hf.integrableOn_compact isCompact_Icc
theorem Continuous.integrableOn_Icc [Preorder X] [CompactIccSpace X] [T2Space X]
(hf : Continuous f) : IntegrableOn f (Icc a b) μ :=
hf.continuousOn.integrableOn_Icc
theorem Continuous.integrableOn_Ioc [Preorder X] [CompactIccSpace X] [T2Space X]
(hf : Continuous f) : IntegrableOn f (Ioc a b) μ :=
hf.integrableOn_Icc.mono_set Ioc_subset_Icc_self
theorem ContinuousOn.integrableOn_uIcc [LinearOrder X] [CompactIccSpace X] [T2Space X]
(hf : ContinuousOn f [[a, b]]) : IntegrableOn f [[a, b]] μ :=
hf.integrableOn_Icc
theorem Continuous.integrableOn_uIcc [LinearOrder X] [CompactIccSpace X] [T2Space X]
(hf : Continuous f) : IntegrableOn f [[a, b]] μ :=
hf.integrableOn_Icc
theorem Continuous.integrableOn_uIoc [LinearOrder X] [CompactIccSpace X] [T2Space X]
(hf : Continuous f) : IntegrableOn f (Ι a b) μ :=
hf.integrableOn_Ioc
/-- A continuous function with compact support is integrable on the whole space. -/
theorem Continuous.integrable_of_hasCompactSupport (hf : Continuous f) (hcf : HasCompactSupport f) :
Integrable f μ :=
(integrableOn_iff_integrable_of_support_subset (subset_tsupport f)).mp <|
hf.continuousOn.integrableOn_compact' hcf (isClosed_tsupport _).measurableSet
end borel
open scoped ENNReal
section Monotone
variable [BorelSpace X] [ConditionallyCompleteLinearOrder X] [ConditionallyCompleteLinearOrder E]
[OrderTopology X] [OrderTopology E] [SecondCountableTopology E]
theorem MonotoneOn.integrableOn_of_measure_ne_top (hmono : MonotoneOn f s) {a b : X}
(ha : IsLeast s a) (hb : IsGreatest s b) (hs : μ s ≠ ∞) (h's : MeasurableSet s) :
IntegrableOn f s μ := by
borelize E
obtain rfl | _ := s.eq_empty_or_nonempty
· exact integrableOn_empty
have hbelow : BddBelow (f '' s) := ⟨f a, fun x ⟨y, hy, hyx⟩ => hyx ▸ hmono ha.1 hy (ha.2 hy)⟩
have habove : BddAbove (f '' s) := ⟨f b, fun x ⟨y, hy, hyx⟩ => hyx ▸ hmono hy hb.1 (hb.2 hy)⟩
have : IsBounded (f '' s) := Metric.isBounded_of_bddAbove_of_bddBelow habove hbelow
rcases isBounded_iff_forall_norm_le.mp this with ⟨C, hC⟩
have A : IntegrableOn (fun _ => C) s μ := by
simp only [hs.lt_top, integrableOn_const, or_true_iff]
exact
Integrable.mono' A (aemeasurable_restrict_of_monotoneOn h's hmono).aestronglyMeasurable
((ae_restrict_iff' h's).mpr <| ae_of_all _ fun y hy => hC (f y) (mem_image_of_mem f hy))
theorem MonotoneOn.integrableOn_isCompact [IsFiniteMeasureOnCompacts μ] (hs : IsCompact s)
(hmono : MonotoneOn f s) : IntegrableOn f s μ := by
obtain rfl | h := s.eq_empty_or_nonempty
· exact integrableOn_empty
· exact
hmono.integrableOn_of_measure_ne_top (hs.isLeast_sInf h) (hs.isGreatest_sSup h)
hs.measure_lt_top.ne hs.measurableSet
theorem AntitoneOn.integrableOn_of_measure_ne_top (hanti : AntitoneOn f s) {a b : X}
(ha : IsLeast s a) (hb : IsGreatest s b) (hs : μ s ≠ ∞) (h's : MeasurableSet s) :
IntegrableOn f s μ :=
hanti.dual_right.integrableOn_of_measure_ne_top ha hb hs h's
theorem AntioneOn.integrableOn_isCompact [IsFiniteMeasureOnCompacts μ] (hs : IsCompact s)
(hanti : AntitoneOn f s) : IntegrableOn f s μ :=
hanti.dual_right.integrableOn_isCompact (E := Eᵒᵈ) hs
theorem Monotone.locallyIntegrable [IsLocallyFiniteMeasure μ] (hmono : Monotone f) :
LocallyIntegrable f μ := by
intro x
rcases μ.finiteAt_nhds x with ⟨U, hU, h'U⟩
obtain ⟨a, b, xab, hab, abU⟩ : ∃ a b : X, x ∈ Icc a b ∧ Icc a b ∈ 𝓝 x ∧ Icc a b ⊆ U :=
exists_Icc_mem_subset_of_mem_nhds hU
have ab : a ≤ b := xab.1.trans xab.2
refine ⟨Icc a b, hab, ?_⟩
exact
(hmono.monotoneOn _).integrableOn_of_measure_ne_top (isLeast_Icc ab) (isGreatest_Icc ab)
((measure_mono abU).trans_lt h'U).ne measurableSet_Icc
theorem Antitone.locallyIntegrable [IsLocallyFiniteMeasure μ] (hanti : Antitone f) :
LocallyIntegrable f μ :=
hanti.dual_right.locallyIntegrable
end Monotone
namespace MeasureTheory
variable [OpensMeasurableSpace X] {A K : Set X}
section Mul
variable [NormedRing R] [SecondCountableTopologyEither X R] {g g' : X → R}
theorem IntegrableOn.mul_continuousOn_of_subset (hg : IntegrableOn g A μ) (hg' : ContinuousOn g' K)
(hA : MeasurableSet A) (hK : IsCompact K) (hAK : A ⊆ K) :
IntegrableOn (fun x => g x * g' x) A μ := by
rcases IsCompact.exists_bound_of_continuousOn hK hg' with ⟨C, hC⟩
rw [IntegrableOn, ← memℒp_one_iff_integrable] at hg ⊢
have : ∀ᵐ x ∂μ.restrict A, ‖g x * g' x‖ ≤ C * ‖g x‖ := by
filter_upwards [ae_restrict_mem hA] with x hx
refine (norm_mul_le _ _).trans ?_
rw [mul_comm]
gcongr
exact hC x (hAK hx)
exact
Memℒp.of_le_mul hg (hg.aestronglyMeasurable.mul <| (hg'.mono hAK).aestronglyMeasurable hA) this
theorem IntegrableOn.mul_continuousOn [T2Space X] (hg : IntegrableOn g K μ)
(hg' : ContinuousOn g' K) (hK : IsCompact K) : IntegrableOn (fun x => g x * g' x) K μ :=
hg.mul_continuousOn_of_subset hg' hK.measurableSet hK (Subset.refl _)
theorem IntegrableOn.continuousOn_mul_of_subset (hg : ContinuousOn g K) (hg' : IntegrableOn g' A μ)
(hK : IsCompact K) (hA : MeasurableSet A) (hAK : A ⊆ K) :
IntegrableOn (fun x => g x * g' x) A μ := by
rcases IsCompact.exists_bound_of_continuousOn hK hg with ⟨C, hC⟩
rw [IntegrableOn, ← memℒp_one_iff_integrable] at hg' ⊢
have : ∀ᵐ x ∂μ.restrict A, ‖g x * g' x‖ ≤ C * ‖g' x‖ := by
filter_upwards [ae_restrict_mem hA] with x hx
refine (norm_mul_le _ _).trans ?_
gcongr
exact hC x (hAK hx)
exact
Memℒp.of_le_mul hg' (((hg.mono hAK).aestronglyMeasurable hA).mul hg'.aestronglyMeasurable) this
theorem IntegrableOn.continuousOn_mul [T2Space X] (hg : ContinuousOn g K)
(hg' : IntegrableOn g' K μ) (hK : IsCompact K) : IntegrableOn (fun x => g x * g' x) K μ :=
hg'.continuousOn_mul_of_subset hg hK hK.measurableSet Subset.rfl
end Mul
section SMul
variable {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 E]
theorem IntegrableOn.continuousOn_smul [T2Space X] [SecondCountableTopologyEither X 𝕜] {g : X → E}
(hg : IntegrableOn g K μ) {f : X → 𝕜} (hf : ContinuousOn f K) (hK : IsCompact K) :
IntegrableOn (fun x => f x • g x) K μ := by
rw [IntegrableOn, ← integrable_norm_iff]
· simp_rw [norm_smul]
refine IntegrableOn.continuousOn_mul ?_ hg.norm hK
exact continuous_norm.comp_continuousOn hf
· exact (hf.aestronglyMeasurable hK.measurableSet).smul hg.1
theorem IntegrableOn.smul_continuousOn [T2Space X] [SecondCountableTopologyEither X E] {f : X → 𝕜}
(hf : IntegrableOn f K μ) {g : X → E} (hg : ContinuousOn g K) (hK : IsCompact K) :
IntegrableOn (fun x => f x • g x) K μ := by
rw [IntegrableOn, ← integrable_norm_iff]
· simp_rw [norm_smul]
refine IntegrableOn.mul_continuousOn hf.norm ?_ hK
exact continuous_norm.comp_continuousOn hg
· exact hf.1.smul (hg.aestronglyMeasurable hK.measurableSet)
end SMul
namespace LocallyIntegrableOn
theorem continuousOn_mul [LocallyCompactSpace X] [T2Space X] [NormedRing R]
[SecondCountableTopologyEither X R] {f g : X → R} {s : Set X} (hf : LocallyIntegrableOn f s μ)
(hg : ContinuousOn g s) (hs : IsOpen s) : LocallyIntegrableOn (fun x => g x * f x) s μ := by
rw [MeasureTheory.locallyIntegrableOn_iff (Or.inr hs)] at hf ⊢
exact fun k hk_sub hk_c => (hf k hk_sub hk_c).continuousOn_mul (hg.mono hk_sub) hk_c
theorem mul_continuousOn [LocallyCompactSpace X] [T2Space X] [NormedRing R]
[SecondCountableTopologyEither X R] {f g : X → R} {s : Set X} (hf : LocallyIntegrableOn f s μ)
(hg : ContinuousOn g s) (hs : IsOpen s) : LocallyIntegrableOn (fun x => f x * g x) s μ := by
rw [MeasureTheory.locallyIntegrableOn_iff (Or.inr hs)] at hf ⊢
exact fun k hk_sub hk_c => (hf k hk_sub hk_c).mul_continuousOn (hg.mono hk_sub) hk_c
theorem continuousOn_smul [LocallyCompactSpace X] [T2Space X] {𝕜 : Type*} [NormedField 𝕜]
[SecondCountableTopologyEither X 𝕜] [NormedSpace 𝕜 E] {f : X → E} {g : X → 𝕜} {s : Set X}
(hs : IsOpen s) (hf : LocallyIntegrableOn f s μ) (hg : ContinuousOn g s) :
LocallyIntegrableOn (fun x => g x • f x) s μ := by
rw [MeasureTheory.locallyIntegrableOn_iff (Or.inr hs)] at hf ⊢
exact fun k hk_sub hk_c => (hf k hk_sub hk_c).continuousOn_smul (hg.mono hk_sub) hk_c
theorem smul_continuousOn [LocallyCompactSpace X] [T2Space X] {𝕜 : Type*} [NormedField 𝕜]
[SecondCountableTopologyEither X E] [NormedSpace 𝕜 E] {f : X → 𝕜} {g : X → E} {s : Set X}
(hs : IsOpen s) (hf : LocallyIntegrableOn f s μ) (hg : ContinuousOn g s) :
LocallyIntegrableOn (fun x => f x • g x) s μ := by
rw [MeasureTheory.locallyIntegrableOn_iff (Or.inr hs)] at hf ⊢
exact fun k hk_sub hk_c => (hf k hk_sub hk_c).smul_continuousOn (hg.mono hk_sub) hk_c
end LocallyIntegrableOn
end MeasureTheory
|
MeasureTheory\Function\LpOrder.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Analysis.Normed.Order.Lattice
import Mathlib.MeasureTheory.Function.LpSpace
/-!
# Order related properties of Lp spaces
## Results
- `Lp E p μ` is an `OrderedAddCommGroup` when `E` is a `NormedLatticeAddCommGroup`.
## TODO
- move definitions of `Lp.posPart` and `Lp.negPart` to this file, and define them as
`PosPart.pos` and `NegPart.neg` given by the lattice structure.
-/
open TopologicalSpace MeasureTheory
open scoped ENNReal
variable {α E : Type*} {m : MeasurableSpace α} {μ : Measure α} {p : ℝ≥0∞}
namespace MeasureTheory
namespace Lp
section Order
variable [NormedLatticeAddCommGroup E]
theorem coeFn_le (f g : Lp E p μ) : f ≤ᵐ[μ] g ↔ f ≤ g := by
rw [← Subtype.coe_le_coe, ← AEEqFun.coeFn_le]
theorem coeFn_nonneg (f : Lp E p μ) : 0 ≤ᵐ[μ] f ↔ 0 ≤ f := by
rw [← coeFn_le]
have h0 := Lp.coeFn_zero E p μ
constructor <;> intro h <;> filter_upwards [h, h0] with _ _ h2
· rwa [h2]
· rwa [← h2]
instance instCovariantClassLE : CovariantClass (Lp E p μ) (Lp E p μ) (· + ·) (· ≤ ·) := by
refine ⟨fun f g₁ g₂ hg₁₂ => ?_⟩
rw [← coeFn_le] at hg₁₂ ⊢
filter_upwards [coeFn_add f g₁, coeFn_add f g₂, hg₁₂] with _ h1 h2 h3
rw [h1, h2, Pi.add_apply, Pi.add_apply]
exact add_le_add le_rfl h3
instance instOrderedAddCommGroup : OrderedAddCommGroup (Lp E p μ) :=
{ Subtype.partialOrder _, AddSubgroup.toAddCommGroup _ with
add_le_add_left := fun _ _ => add_le_add_left }
theorem _root_.MeasureTheory.Memℒp.sup {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
Memℒp (f ⊔ g) p μ :=
Memℒp.mono' (hf.norm.add hg.norm) (hf.1.sup hg.1)
(Filter.eventually_of_forall fun x => norm_sup_le_add (f x) (g x))
theorem _root_.MeasureTheory.Memℒp.inf {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
Memℒp (f ⊓ g) p μ :=
Memℒp.mono' (hf.norm.add hg.norm) (hf.1.inf hg.1)
(Filter.eventually_of_forall fun x => norm_inf_le_add (f x) (g x))
theorem _root_.MeasureTheory.Memℒp.abs {f : α → E} (hf : Memℒp f p μ) : Memℒp |f| p μ :=
hf.sup hf.neg
instance instLattice : Lattice (Lp E p μ) :=
Subtype.lattice
(fun f g hf hg => by
rw [mem_Lp_iff_memℒp] at *
exact (memℒp_congr_ae (AEEqFun.coeFn_sup _ _)).mpr (hf.sup hg))
fun f g hf hg => by
rw [mem_Lp_iff_memℒp] at *
exact (memℒp_congr_ae (AEEqFun.coeFn_inf _ _)).mpr (hf.inf hg)
theorem coeFn_sup (f g : Lp E p μ) : ⇑(f ⊔ g) =ᵐ[μ] ⇑f ⊔ ⇑g :=
AEEqFun.coeFn_sup _ _
theorem coeFn_inf (f g : Lp E p μ) : ⇑(f ⊓ g) =ᵐ[μ] ⇑f ⊓ ⇑g :=
AEEqFun.coeFn_inf _ _
theorem coeFn_abs (f : Lp E p μ) : ⇑|f| =ᵐ[μ] fun x => |f x| :=
AEEqFun.coeFn_abs _
noncomputable instance instNormedLatticeAddCommGroup [Fact (1 ≤ p)] :
NormedLatticeAddCommGroup (Lp E p μ) :=
{ Lp.instLattice, Lp.instNormedAddCommGroup with
add_le_add_left := fun f g => add_le_add_left
solid := fun f g hfg => by
rw [← coeFn_le] at hfg
simp_rw [Lp.norm_def, ENNReal.toReal_le_toReal (Lp.eLpNorm_ne_top f) (Lp.eLpNorm_ne_top g)]
refine eLpNorm_mono_ae ?_
filter_upwards [hfg, Lp.coeFn_abs f, Lp.coeFn_abs g] with x hx hxf hxg
rw [hxf, hxg] at hx
exact HasSolidNorm.solid hx }
end Order
end Lp
end MeasureTheory
|
MeasureTheory\Function\LpSpace.lean | /-
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
-/
import Mathlib.Analysis.Normed.Group.Hom
import Mathlib.Analysis.NormedSpace.IndicatorFunction
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity
import Mathlib.Data.Set.Image
import Mathlib.MeasureTheory.Function.LpSeminorm.ChebyshevMarkov
import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp
import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality
import Mathlib.MeasureTheory.Measure.OpenPos
import Mathlib.MeasureTheory.Measure.Typeclasses
import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace
import Mathlib.Topology.ContinuousFunction.Compact
import Mathlib.Order.Filter.IndicatorFunction
/-!
# Lp space
This file provides the space `Lp E p μ` as the subtype of elements of `α →ₘ[μ] E` (see ae_eq_fun)
such that `eLpNorm f p μ` is finite. For `1 ≤ p`, `eLpNorm` defines a norm and `Lp` is a complete
metric space.
## Main definitions
* `Lp E p μ` : elements of `α →ₘ[μ] E` (see ae_eq_fun) such that `eLpNorm f p μ` is finite. Defined
as an `AddSubgroup` of `α →ₘ[μ] E`.
Lipschitz functions vanishing at zero act by composition on `Lp`. We define this action, and prove
that it is continuous. In particular,
* `ContinuousLinearMap.compLp` defines the action on `Lp` of a continuous linear map.
* `Lp.posPart` is the positive part of an `Lp` function.
* `Lp.negPart` is the negative part of an `Lp` function.
When `α` is a topological space equipped with a finite Borel measure, there is a bounded linear map
from the normed space of bounded continuous functions (`α →ᵇ E`) to `Lp E p μ`. We construct this
as `BoundedContinuousFunction.toLp`.
## Notations
* `α →₁[μ] E` : the type `Lp E 1 μ`.
* `α →₂[μ] E` : the type `Lp E 2 μ`.
## Implementation
Since `Lp` is defined as an `AddSubgroup`, dot notation does not work. Use `Lp.Measurable f` to
say that the coercion of `f` to a genuine function is measurable, instead of the non-working
`f.Measurable`.
To prove that two `Lp` elements are equal, it suffices to show that their coercions to functions
coincide almost everywhere (this is registered as an `ext` rule). This can often be done using
`filter_upwards`. For instance, a proof from first principles that `f + (g + h) = (f + g) + h`
could read (in the `Lp` namespace)
```
example (f g h : Lp E p μ) : (f + g) + h = f + (g + h) := by
ext1
filter_upwards [coeFn_add (f + g) h, coeFn_add f g, coeFn_add f (g + h), coeFn_add g h]
with _ ha1 ha2 ha3 ha4
simp only [ha1, ha2, ha3, ha4, add_assoc]
```
The lemma `coeFn_add` states that the coercion of `f + g` coincides almost everywhere with the sum
of the coercions of `f` and `g`. All such lemmas use `coeFn` in their name, to distinguish the
function coercion from the coercion to almost everywhere defined functions.
-/
noncomputable section
open TopologicalSpace MeasureTheory Filter
open scoped NNReal ENNReal Topology MeasureTheory Uniformity symmDiff
variable {α E F G : Type*} {m m0 : MeasurableSpace α} {p : ℝ≥0∞} {q : ℝ} {μ ν : Measure α}
[NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
namespace MeasureTheory
/-!
### Lp space
The space of equivalence classes of measurable functions for which `eLpNorm f p μ < ∞`.
-/
@[simp]
theorem eLpNorm_aeeqFun {α E : Type*} [MeasurableSpace α] {μ : Measure α} [NormedAddCommGroup E]
{p : ℝ≥0∞} {f : α → E} (hf : AEStronglyMeasurable f μ) :
eLpNorm (AEEqFun.mk f hf) p μ = eLpNorm f p μ :=
eLpNorm_congr_ae (AEEqFun.coeFn_mk _ _)
@[deprecated (since := "2024-07-27")]
alias snorm_aeeqFun := eLpNorm_aeeqFun
theorem Memℒp.eLpNorm_mk_lt_top {α E : Type*} [MeasurableSpace α] {μ : Measure α}
[NormedAddCommGroup E] {p : ℝ≥0∞} {f : α → E} (hfp : Memℒp f p μ) :
eLpNorm (AEEqFun.mk f hfp.1) p μ < ∞ := by simp [hfp.2]
@[deprecated (since := "2024-07-27")]
alias Memℒp.snorm_mk_lt_top := Memℒp.eLpNorm_mk_lt_top
/-- Lp space -/
def Lp {α} (E : Type*) {m : MeasurableSpace α} [NormedAddCommGroup E] (p : ℝ≥0∞)
(μ : Measure α := by volume_tac) : AddSubgroup (α →ₘ[μ] E) where
carrier := { f | eLpNorm f p μ < ∞ }
zero_mem' := by simp [eLpNorm_congr_ae AEEqFun.coeFn_zero, eLpNorm_zero]
add_mem' {f g} hf hg := by
simp [eLpNorm_congr_ae (AEEqFun.coeFn_add f g),
eLpNorm_add_lt_top ⟨f.aestronglyMeasurable, hf⟩ ⟨g.aestronglyMeasurable, hg⟩]
neg_mem' {f} hf := by rwa [Set.mem_setOf_eq, eLpNorm_congr_ae (AEEqFun.coeFn_neg f), eLpNorm_neg]
-- Porting note: calling the first argument `α` breaks the `(α := ·)` notation
scoped notation:25 α' " →₁[" μ "] " E => MeasureTheory.Lp (α := α') E 1 μ
scoped notation:25 α' " →₂[" μ "] " E => MeasureTheory.Lp (α := α') E 2 μ
namespace Memℒp
/-- make an element of Lp from a function verifying `Memℒp` -/
def toLp (f : α → E) (h_mem_ℒp : Memℒp f p μ) : Lp E p μ :=
⟨AEEqFun.mk f h_mem_ℒp.1, h_mem_ℒp.eLpNorm_mk_lt_top⟩
theorem toLp_val {f : α → E} (h : Memℒp f p μ) : (toLp f h).1 = AEEqFun.mk f h.1 := rfl
theorem coeFn_toLp {f : α → E} (hf : Memℒp f p μ) : hf.toLp f =ᵐ[μ] f :=
AEEqFun.coeFn_mk _ _
theorem toLp_congr {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) (hfg : f =ᵐ[μ] g) :
hf.toLp f = hg.toLp g := by simp [toLp, hfg]
@[simp]
theorem toLp_eq_toLp_iff {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
hf.toLp f = hg.toLp g ↔ f =ᵐ[μ] g := by simp [toLp]
@[simp]
theorem toLp_zero (h : Memℒp (0 : α → E) p μ) : h.toLp 0 = 0 :=
rfl
theorem toLp_add {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
(hf.add hg).toLp (f + g) = hf.toLp f + hg.toLp g :=
rfl
theorem toLp_neg {f : α → E} (hf : Memℒp f p μ) : hf.neg.toLp (-f) = -hf.toLp f :=
rfl
theorem toLp_sub {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
(hf.sub hg).toLp (f - g) = hf.toLp f - hg.toLp g :=
rfl
end Memℒp
namespace Lp
instance instCoeFun : CoeFun (Lp E p μ) (fun _ => α → E) :=
⟨fun f => ((f : α →ₘ[μ] E) : α → E)⟩
@[ext high]
theorem ext {f g : Lp E p μ} (h : f =ᵐ[μ] g) : f = g := by
cases f
cases g
simp only [Subtype.mk_eq_mk]
exact AEEqFun.ext h
theorem mem_Lp_iff_eLpNorm_lt_top {f : α →ₘ[μ] E} : f ∈ Lp E p μ ↔ eLpNorm f p μ < ∞ := Iff.rfl
@[deprecated (since := "2024-07-27")]
alias mem_Lp_iff_snorm_lt_top := mem_Lp_iff_eLpNorm_lt_top
theorem mem_Lp_iff_memℒp {f : α →ₘ[μ] E} : f ∈ Lp E p μ ↔ Memℒp f p μ := by
simp [mem_Lp_iff_eLpNorm_lt_top, Memℒp, f.stronglyMeasurable.aestronglyMeasurable]
protected theorem antitone [IsFiniteMeasure μ] {p q : ℝ≥0∞} (hpq : p ≤ q) : Lp E q μ ≤ Lp E p μ :=
fun f hf => (Memℒp.memℒp_of_exponent_le ⟨f.aestronglyMeasurable, hf⟩ hpq).2
@[simp]
theorem coeFn_mk {f : α →ₘ[μ] E} (hf : eLpNorm f p μ < ∞) : ((⟨f, hf⟩ : Lp E p μ) : α → E) = f :=
rfl
-- @[simp] -- Porting note (#10685): dsimp can prove this
theorem coe_mk {f : α →ₘ[μ] E} (hf : eLpNorm f p μ < ∞) : ((⟨f, hf⟩ : Lp E p μ) : α →ₘ[μ] E) = f :=
rfl
@[simp]
theorem toLp_coeFn (f : Lp E p μ) (hf : Memℒp f p μ) : hf.toLp f = f := by
cases f
simp [Memℒp.toLp]
theorem eLpNorm_lt_top (f : Lp E p μ) : eLpNorm f p μ < ∞ :=
f.prop
@[deprecated (since := "2024-07-27")]
alias snorm_lt_top := eLpNorm_lt_top
theorem eLpNorm_ne_top (f : Lp E p μ) : eLpNorm f p μ ≠ ∞ :=
(eLpNorm_lt_top f).ne
@[deprecated (since := "2024-07-27")]
alias snorm_ne_top := eLpNorm_ne_top
@[measurability]
protected theorem stronglyMeasurable (f : Lp E p μ) : StronglyMeasurable f :=
f.val.stronglyMeasurable
@[measurability]
protected theorem aestronglyMeasurable (f : Lp E p μ) : AEStronglyMeasurable f μ :=
f.val.aestronglyMeasurable
protected theorem memℒp (f : Lp E p μ) : Memℒp f p μ :=
⟨Lp.aestronglyMeasurable f, f.prop⟩
variable (E p μ)
theorem coeFn_zero : ⇑(0 : Lp E p μ) =ᵐ[μ] 0 :=
AEEqFun.coeFn_zero
variable {E p μ}
theorem coeFn_neg (f : Lp E p μ) : ⇑(-f) =ᵐ[μ] -f :=
AEEqFun.coeFn_neg _
theorem coeFn_add (f g : Lp E p μ) : ⇑(f + g) =ᵐ[μ] f + g :=
AEEqFun.coeFn_add _ _
theorem coeFn_sub (f g : Lp E p μ) : ⇑(f - g) =ᵐ[μ] f - g :=
AEEqFun.coeFn_sub _ _
theorem const_mem_Lp (α) {_ : MeasurableSpace α} (μ : Measure α) (c : E) [IsFiniteMeasure μ] :
@AEEqFun.const α _ _ μ _ c ∈ Lp E p μ :=
(memℒp_const c).eLpNorm_mk_lt_top
instance instNorm : Norm (Lp E p μ) where norm f := ENNReal.toReal (eLpNorm f p μ)
-- note: we need this to be defeq to the instance from `SeminormedAddGroup.toNNNorm`, so
-- can't use `ENNReal.toNNReal (eLpNorm f p μ)`
instance instNNNorm : NNNorm (Lp E p μ) where nnnorm f := ⟨‖f‖, ENNReal.toReal_nonneg⟩
instance instDist : Dist (Lp E p μ) where dist f g := ‖f - g‖
instance instEDist : EDist (Lp E p μ) where edist f g := eLpNorm (⇑f - ⇑g) p μ
theorem norm_def (f : Lp E p μ) : ‖f‖ = ENNReal.toReal (eLpNorm f p μ) :=
rfl
theorem nnnorm_def (f : Lp E p μ) : ‖f‖₊ = ENNReal.toNNReal (eLpNorm f p μ) :=
rfl
@[simp, norm_cast]
protected theorem coe_nnnorm (f : Lp E p μ) : (‖f‖₊ : ℝ) = ‖f‖ :=
rfl
@[simp, norm_cast]
theorem nnnorm_coe_ennreal (f : Lp E p μ) : (‖f‖₊ : ℝ≥0∞) = eLpNorm f p μ :=
ENNReal.coe_toNNReal <| Lp.eLpNorm_ne_top f
@[simp]
lemma norm_toLp (f : α → E) (hf : Memℒp f p μ) : ‖hf.toLp f‖ = ENNReal.toReal (eLpNorm f p μ) := by
erw [norm_def, eLpNorm_congr_ae (Memℒp.coeFn_toLp hf)]
@[simp]
theorem nnnorm_toLp (f : α → E) (hf : Memℒp f p μ) :
‖hf.toLp f‖₊ = ENNReal.toNNReal (eLpNorm f p μ) :=
NNReal.eq <| norm_toLp f hf
theorem coe_nnnorm_toLp {f : α → E} (hf : Memℒp f p μ) : (‖hf.toLp f‖₊ : ℝ≥0∞) = eLpNorm f p μ := by
rw [nnnorm_toLp f hf, ENNReal.coe_toNNReal hf.2.ne]
theorem dist_def (f g : Lp E p μ) : dist f g = (eLpNorm (⇑f - ⇑g) p μ).toReal := by
simp_rw [dist, norm_def]
refine congr_arg _ ?_
apply eLpNorm_congr_ae (coeFn_sub _ _)
theorem edist_def (f g : Lp E p μ) : edist f g = eLpNorm (⇑f - ⇑g) p μ :=
rfl
protected theorem edist_dist (f g : Lp E p μ) : edist f g = .ofReal (dist f g) := by
rw [edist_def, dist_def, ← eLpNorm_congr_ae (coeFn_sub _ _),
ENNReal.ofReal_toReal (eLpNorm_ne_top (f - g))]
protected theorem dist_edist (f g : Lp E p μ) : dist f g = (edist f g).toReal :=
MeasureTheory.Lp.dist_def ..
theorem dist_eq_norm (f g : Lp E p μ) : dist f g = ‖f - g‖ := rfl
@[simp]
theorem edist_toLp_toLp (f g : α → E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
edist (hf.toLp f) (hg.toLp g) = eLpNorm (f - g) p μ := by
rw [edist_def]
exact eLpNorm_congr_ae (hf.coeFn_toLp.sub hg.coeFn_toLp)
@[simp]
theorem edist_toLp_zero (f : α → E) (hf : Memℒp f p μ) : edist (hf.toLp f) 0 = eLpNorm f p μ := by
convert edist_toLp_toLp f 0 hf zero_memℒp
simp
@[simp]
theorem nnnorm_zero : ‖(0 : Lp E p μ)‖₊ = 0 := by
rw [nnnorm_def]
change (eLpNorm (⇑(0 : α →ₘ[μ] E)) p μ).toNNReal = 0
simp [eLpNorm_congr_ae AEEqFun.coeFn_zero, eLpNorm_zero]
@[simp]
theorem norm_zero : ‖(0 : Lp E p μ)‖ = 0 :=
congr_arg ((↑) : ℝ≥0 → ℝ) nnnorm_zero
@[simp]
theorem norm_measure_zero (f : Lp E p (0 : MeasureTheory.Measure α)) : ‖f‖ = 0 := by
simp [norm_def]
@[simp] theorem norm_exponent_zero (f : Lp E 0 μ) : ‖f‖ = 0 := by simp [norm_def]
theorem nnnorm_eq_zero_iff {f : Lp E p μ} (hp : 0 < p) : ‖f‖₊ = 0 ↔ f = 0 := by
refine ⟨fun hf => ?_, fun hf => by simp [hf]⟩
rw [nnnorm_def, ENNReal.toNNReal_eq_zero_iff] at hf
cases hf with
| inl hf =>
rw [eLpNorm_eq_zero_iff (Lp.aestronglyMeasurable f) hp.ne.symm] at hf
exact Subtype.eq (AEEqFun.ext (hf.trans AEEqFun.coeFn_zero.symm))
| inr hf =>
exact absurd hf (eLpNorm_ne_top f)
theorem norm_eq_zero_iff {f : Lp E p μ} (hp : 0 < p) : ‖f‖ = 0 ↔ f = 0 :=
NNReal.coe_eq_zero.trans (nnnorm_eq_zero_iff hp)
theorem eq_zero_iff_ae_eq_zero {f : Lp E p μ} : f = 0 ↔ f =ᵐ[μ] 0 := by
rw [← (Lp.memℒp f).toLp_eq_toLp_iff zero_memℒp, Memℒp.toLp_zero, toLp_coeFn]
@[simp]
theorem nnnorm_neg (f : Lp E p μ) : ‖-f‖₊ = ‖f‖₊ := by
rw [nnnorm_def, nnnorm_def, eLpNorm_congr_ae (coeFn_neg _), eLpNorm_neg]
@[simp]
theorem norm_neg (f : Lp E p μ) : ‖-f‖ = ‖f‖ :=
congr_arg ((↑) : ℝ≥0 → ℝ) (nnnorm_neg f)
theorem nnnorm_le_mul_nnnorm_of_ae_le_mul {c : ℝ≥0} {f : Lp E p μ} {g : Lp F p μ}
(h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊) : ‖f‖₊ ≤ c * ‖g‖₊ := by
simp only [nnnorm_def]
have := eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul h p
rwa [← ENNReal.toNNReal_le_toNNReal, ENNReal.smul_def, smul_eq_mul, ENNReal.toNNReal_mul,
ENNReal.toNNReal_coe] at this
· exact (Lp.memℒp _).eLpNorm_ne_top
· exact ENNReal.mul_ne_top ENNReal.coe_ne_top (Lp.memℒp _).eLpNorm_ne_top
theorem norm_le_mul_norm_of_ae_le_mul {c : ℝ} {f : Lp E p μ} {g : Lp F p μ}
(h : ∀ᵐ x ∂μ, ‖f x‖ ≤ c * ‖g x‖) : ‖f‖ ≤ c * ‖g‖ := by
rcases le_or_lt 0 c with hc | hc
· lift c to ℝ≥0 using hc
exact NNReal.coe_le_coe.mpr (nnnorm_le_mul_nnnorm_of_ae_le_mul h)
· simp only [norm_def]
have := eLpNorm_eq_zero_and_zero_of_ae_le_mul_neg h hc p
simp [this]
theorem norm_le_norm_of_ae_le {f : Lp E p μ} {g : Lp F p μ} (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ ‖g x‖) :
‖f‖ ≤ ‖g‖ := by
rw [norm_def, norm_def, ENNReal.toReal_le_toReal (eLpNorm_ne_top _) (eLpNorm_ne_top _)]
exact eLpNorm_mono_ae h
theorem mem_Lp_of_nnnorm_ae_le_mul {c : ℝ≥0} {f : α →ₘ[μ] E} {g : Lp F p μ}
(h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊) : f ∈ Lp E p μ :=
mem_Lp_iff_memℒp.2 <| Memℒp.of_nnnorm_le_mul (Lp.memℒp g) f.aestronglyMeasurable h
theorem mem_Lp_of_ae_le_mul {c : ℝ} {f : α →ₘ[μ] E} {g : Lp F p μ}
(h : ∀ᵐ x ∂μ, ‖f x‖ ≤ c * ‖g x‖) : f ∈ Lp E p μ :=
mem_Lp_iff_memℒp.2 <| Memℒp.of_le_mul (Lp.memℒp g) f.aestronglyMeasurable h
theorem mem_Lp_of_nnnorm_ae_le {f : α →ₘ[μ] E} {g : Lp F p μ} (h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ ‖g x‖₊) :
f ∈ Lp E p μ :=
mem_Lp_iff_memℒp.2 <| Memℒp.of_le (Lp.memℒp g) f.aestronglyMeasurable h
theorem mem_Lp_of_ae_le {f : α →ₘ[μ] E} {g : Lp F p μ} (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ ‖g x‖) :
f ∈ Lp E p μ :=
mem_Lp_of_nnnorm_ae_le h
theorem mem_Lp_of_ae_nnnorm_bound [IsFiniteMeasure μ] {f : α →ₘ[μ] E} (C : ℝ≥0)
(hfC : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ C) : f ∈ Lp E p μ :=
mem_Lp_iff_memℒp.2 <| Memℒp.of_bound f.aestronglyMeasurable _ hfC
theorem mem_Lp_of_ae_bound [IsFiniteMeasure μ] {f : α →ₘ[μ] E} (C : ℝ) (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) :
f ∈ Lp E p μ :=
mem_Lp_iff_memℒp.2 <| Memℒp.of_bound f.aestronglyMeasurable _ hfC
theorem nnnorm_le_of_ae_bound [IsFiniteMeasure μ] {f : Lp E p μ} {C : ℝ≥0}
(hfC : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ C) : ‖f‖₊ ≤ measureUnivNNReal μ ^ p.toReal⁻¹ * C := by
by_cases hμ : μ = 0
· by_cases hp : p.toReal⁻¹ = 0
· simp [hp, hμ, nnnorm_def]
· simp [hμ, nnnorm_def, Real.zero_rpow hp]
rw [← ENNReal.coe_le_coe, nnnorm_def, ENNReal.coe_toNNReal (eLpNorm_ne_top _)]
refine (eLpNorm_le_of_ae_nnnorm_bound hfC).trans_eq ?_
rw [← coe_measureUnivNNReal μ, ENNReal.coe_rpow_of_ne_zero (measureUnivNNReal_pos hμ).ne',
ENNReal.coe_mul, mul_comm, ENNReal.smul_def, smul_eq_mul]
theorem norm_le_of_ae_bound [IsFiniteMeasure μ] {f : Lp E p μ} {C : ℝ} (hC : 0 ≤ C)
(hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : ‖f‖ ≤ measureUnivNNReal μ ^ p.toReal⁻¹ * C := by
lift C to ℝ≥0 using hC
have := nnnorm_le_of_ae_bound hfC
rwa [← NNReal.coe_le_coe, NNReal.coe_mul, NNReal.coe_rpow] at this
instance instNormedAddCommGroup [hp : Fact (1 ≤ p)] : NormedAddCommGroup (Lp E p μ) :=
{ AddGroupNorm.toNormedAddCommGroup
{ toFun := (norm : Lp E p μ → ℝ)
map_zero' := norm_zero
neg' := by simp
add_le' := fun f g => by
suffices (‖f + g‖₊ : ℝ≥0∞) ≤ ‖f‖₊ + ‖g‖₊ from mod_cast this
simp only [Lp.nnnorm_coe_ennreal]
exact (eLpNorm_congr_ae (AEEqFun.coeFn_add _ _)).trans_le
(eLpNorm_add_le (Lp.aestronglyMeasurable _) (Lp.aestronglyMeasurable _) hp.out)
eq_zero_of_map_eq_zero' := fun f =>
(norm_eq_zero_iff <| zero_lt_one.trans_le hp.1).1 } with
edist := edist
edist_dist := Lp.edist_dist }
-- check no diamond is created
example [Fact (1 ≤ p)] : PseudoEMetricSpace.toEDist = (Lp.instEDist : EDist (Lp E p μ)) := by
with_reducible_and_instances rfl
example [Fact (1 ≤ p)] : SeminormedAddGroup.toNNNorm = (Lp.instNNNorm : NNNorm (Lp E p μ)) := by
with_reducible_and_instances rfl
section BoundedSMul
variable {𝕜 𝕜' : Type*}
variable [NormedRing 𝕜] [NormedRing 𝕜'] [Module 𝕜 E] [Module 𝕜' E]
variable [BoundedSMul 𝕜 E] [BoundedSMul 𝕜' E]
theorem const_smul_mem_Lp (c : 𝕜) (f : Lp E p μ) : c • (f : α →ₘ[μ] E) ∈ Lp E p μ := by
rw [mem_Lp_iff_eLpNorm_lt_top, eLpNorm_congr_ae (AEEqFun.coeFn_smul _ _)]
refine (eLpNorm_const_smul_le _ _).trans_lt ?_
rw [ENNReal.smul_def, smul_eq_mul, ENNReal.mul_lt_top_iff]
exact Or.inl ⟨ENNReal.coe_lt_top, f.prop⟩
variable (E p μ 𝕜)
/-- The `𝕜`-submodule of elements of `α →ₘ[μ] E` whose `Lp` norm is finite. This is `Lp E p μ`,
with extra structure. -/
def LpSubmodule : Submodule 𝕜 (α →ₘ[μ] E) :=
{ Lp E p μ with smul_mem' := fun c f hf => by simpa using const_smul_mem_Lp c ⟨f, hf⟩ }
variable {E p μ 𝕜}
theorem coe_LpSubmodule : (LpSubmodule E p μ 𝕜).toAddSubgroup = Lp E p μ :=
rfl
instance instModule : Module 𝕜 (Lp E p μ) :=
{ (LpSubmodule E p μ 𝕜).module with }
theorem coeFn_smul (c : 𝕜) (f : Lp E p μ) : ⇑(c • f) =ᵐ[μ] c • ⇑f :=
AEEqFun.coeFn_smul _ _
instance instIsCentralScalar [Module 𝕜ᵐᵒᵖ E] [BoundedSMul 𝕜ᵐᵒᵖ E] [IsCentralScalar 𝕜 E] :
IsCentralScalar 𝕜 (Lp E p μ) where
op_smul_eq_smul k f := Subtype.ext <| op_smul_eq_smul k (f : α →ₘ[μ] E)
instance instSMulCommClass [SMulCommClass 𝕜 𝕜' E] : SMulCommClass 𝕜 𝕜' (Lp E p μ) where
smul_comm k k' f := Subtype.ext <| smul_comm k k' (f : α →ₘ[μ] E)
instance instIsScalarTower [SMul 𝕜 𝕜'] [IsScalarTower 𝕜 𝕜' E] : IsScalarTower 𝕜 𝕜' (Lp E p μ) where
smul_assoc k k' f := Subtype.ext <| smul_assoc k k' (f : α →ₘ[μ] E)
instance instBoundedSMul [Fact (1 ≤ p)] : BoundedSMul 𝕜 (Lp E p μ) :=
-- TODO: add `BoundedSMul.of_nnnorm_smul_le`
BoundedSMul.of_norm_smul_le fun r f => by
suffices (‖r • f‖₊ : ℝ≥0∞) ≤ ‖r‖₊ * ‖f‖₊ from mod_cast this
rw [nnnorm_def, nnnorm_def, ENNReal.coe_toNNReal (Lp.eLpNorm_ne_top _),
eLpNorm_congr_ae (coeFn_smul _ _), ENNReal.coe_toNNReal (Lp.eLpNorm_ne_top _)]
exact eLpNorm_const_smul_le r f
end BoundedSMul
section NormedSpace
variable {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 E]
instance instNormedSpace [Fact (1 ≤ p)] : NormedSpace 𝕜 (Lp E p μ) where
norm_smul_le _ _ := norm_smul_le _ _
end NormedSpace
end Lp
namespace Memℒp
variable {𝕜 : Type*} [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
theorem toLp_const_smul {f : α → E} (c : 𝕜) (hf : Memℒp f p μ) :
(hf.const_smul c).toLp (c • f) = c • hf.toLp f :=
rfl
end Memℒp
/-! ### Indicator of a set as an element of Lᵖ
For a set `s` with `(hs : MeasurableSet s)` and `(hμs : μ s < ∞)`, we build
`indicatorConstLp p hs hμs c`, the element of `Lp` corresponding to `s.indicator (fun _ => c)`.
-/
section Indicator
variable {c : E} {f : α → E} {hf : AEStronglyMeasurable f μ} {s : Set α}
theorem eLpNormEssSup_indicator_le (s : Set α) (f : α → G) :
eLpNormEssSup (s.indicator f) μ ≤ eLpNormEssSup f μ := by
refine essSup_mono_ae (eventually_of_forall fun x => ?_)
rw [ENNReal.coe_le_coe, nnnorm_indicator_eq_indicator_nnnorm]
exact Set.indicator_le_self s _ x
@[deprecated (since := "2024-07-27")]
alias snormEssSup_indicator_le := eLpNormEssSup_indicator_le
theorem eLpNormEssSup_indicator_const_le (s : Set α) (c : G) :
eLpNormEssSup (s.indicator fun _ : α => c) μ ≤ ‖c‖₊ := by
by_cases hμ0 : μ = 0
· rw [hμ0, eLpNormEssSup_measure_zero]
exact zero_le _
· exact (eLpNormEssSup_indicator_le s fun _ => c).trans (eLpNormEssSup_const c hμ0).le
@[deprecated (since := "2024-07-27")]
alias snormEssSup_indicator_const_le := eLpNormEssSup_indicator_const_le
theorem eLpNormEssSup_indicator_const_eq (s : Set α) (c : G) (hμs : μ s ≠ 0) :
eLpNormEssSup (s.indicator fun _ : α => c) μ = ‖c‖₊ := by
refine le_antisymm (eLpNormEssSup_indicator_const_le s c) ?_
by_contra! h
have h' := ae_iff.mp (ae_lt_of_essSup_lt h)
push_neg at h'
refine hμs (measure_mono_null (fun x hx_mem => ?_) h')
rw [Set.mem_setOf_eq, Set.indicator_of_mem hx_mem]
@[deprecated (since := "2024-07-27")]
alias snormEssSup_indicator_const_eq := eLpNormEssSup_indicator_const_eq
theorem eLpNorm_indicator_le (f : α → E) : eLpNorm (s.indicator f) p μ ≤ eLpNorm f p μ := by
refine eLpNorm_mono_ae (eventually_of_forall fun x => ?_)
suffices ‖s.indicator f x‖₊ ≤ ‖f x‖₊ by exact NNReal.coe_mono this
rw [nnnorm_indicator_eq_indicator_nnnorm]
exact s.indicator_le_self _ x
@[deprecated (since := "2024-07-27")]
alias snorm_indicator_le := eLpNorm_indicator_le
lemma eLpNorm_indicator_const₀ {c : G} (hs : NullMeasurableSet s μ) (hp : p ≠ 0) (hp_top : p ≠ ∞) :
eLpNorm (s.indicator fun _ => c) p μ = ‖c‖₊ * μ s ^ (1 / p.toReal) :=
have hp_pos : 0 < p.toReal := ENNReal.toReal_pos hp hp_top
calc
eLpNorm (s.indicator fun _ => c) p μ
= (∫⁻ x, ((‖(s.indicator fun _ ↦ c) x‖₊ : ℝ≥0∞) ^ p.toReal) ∂μ) ^ (1 / p.toReal) :=
eLpNorm_eq_lintegral_rpow_nnnorm hp hp_top
_ = (∫⁻ x, (s.indicator fun _ ↦ (‖c‖₊ : ℝ≥0∞) ^ p.toReal) x ∂μ) ^ (1 / p.toReal) := by
congr 2
refine (Set.comp_indicator_const c (fun x : G ↦ (‖x‖₊ : ℝ≥0∞) ^ p.toReal) ?_)
simp [hp_pos]
_ = ‖c‖₊ * μ s ^ (1 / p.toReal) := by
rw [lintegral_indicator_const₀ hs, ENNReal.mul_rpow_of_nonneg, ← ENNReal.rpow_mul,
mul_one_div_cancel hp_pos.ne', ENNReal.rpow_one]
positivity
@[deprecated (since := "2024-07-27")]
alias snorm_indicator_const₀ := eLpNorm_indicator_const₀
theorem eLpNorm_indicator_const {c : G} (hs : MeasurableSet s) (hp : p ≠ 0) (hp_top : p ≠ ∞) :
eLpNorm (s.indicator fun _ => c) p μ = ‖c‖₊ * μ s ^ (1 / p.toReal) :=
eLpNorm_indicator_const₀ hs.nullMeasurableSet hp hp_top
@[deprecated (since := "2024-07-27")]
alias snorm_indicator_const := eLpNorm_indicator_const
theorem eLpNorm_indicator_const' {c : G} (hs : MeasurableSet s) (hμs : μ s ≠ 0) (hp : p ≠ 0) :
eLpNorm (s.indicator fun _ => c) p μ = ‖c‖₊ * μ s ^ (1 / p.toReal) := by
by_cases hp_top : p = ∞
· simp [hp_top, eLpNormEssSup_indicator_const_eq s c hμs]
· exact eLpNorm_indicator_const hs hp hp_top
@[deprecated (since := "2024-07-27")]
alias snorm_indicator_const' := eLpNorm_indicator_const'
theorem eLpNorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
eLpNorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal) := by
rcases eq_or_ne p 0 with (rfl | hp)
· simp only [eLpNorm_exponent_zero, zero_le']
rcases eq_or_ne p ∞ with (rfl | h'p)
· simp only [eLpNorm_exponent_top, ENNReal.top_toReal, _root_.div_zero, ENNReal.rpow_zero,
mul_one]
exact eLpNormEssSup_indicator_const_le _ _
let t := toMeasurable μ s
calc
eLpNorm (s.indicator fun _ => c) p μ ≤ eLpNorm (t.indicator fun _ => c) p μ :=
eLpNorm_mono (norm_indicator_le_of_subset (subset_toMeasurable _ _) _)
_ = ‖c‖₊ * μ t ^ (1 / p.toReal) :=
(eLpNorm_indicator_const (measurableSet_toMeasurable _ _) hp h'p)
_ = ‖c‖₊ * μ s ^ (1 / p.toReal) := by rw [measure_toMeasurable]
@[deprecated (since := "2024-07-27")]
alias snorm_indicator_const_le := eLpNorm_indicator_const_le
theorem Memℒp.indicator (hs : MeasurableSet s) (hf : Memℒp f p μ) : Memℒp (s.indicator f) p μ :=
⟨hf.aestronglyMeasurable.indicator hs, lt_of_le_of_lt (eLpNorm_indicator_le f) hf.eLpNorm_lt_top⟩
theorem eLpNormEssSup_indicator_eq_eLpNormEssSup_restrict {f : α → F} (hs : MeasurableSet s) :
eLpNormEssSup (s.indicator f) μ = eLpNormEssSup f (μ.restrict s) := by
simp_rw [eLpNormEssSup, nnnorm_indicator_eq_indicator_nnnorm, ENNReal.coe_indicator,
ENNReal.essSup_indicator_eq_essSup_restrict hs]
@[deprecated (since := "2024-07-27")]
alias snormEssSup_indicator_eq_snormEssSup_restrict :=
eLpNormEssSup_indicator_eq_eLpNormEssSup_restrict
theorem eLpNorm_indicator_eq_eLpNorm_restrict {f : α → F} (hs : MeasurableSet s) :
eLpNorm (s.indicator f) p μ = eLpNorm f p (μ.restrict s) := by
by_cases hp_zero : p = 0
· simp only [hp_zero, eLpNorm_exponent_zero]
by_cases hp_top : p = ∞
· simp_rw [hp_top, eLpNorm_exponent_top]
exact eLpNormEssSup_indicator_eq_eLpNormEssSup_restrict hs
simp_rw [eLpNorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
suffices (∫⁻ x, (‖s.indicator f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) =
∫⁻ x in s, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ by rw [this]
rw [← lintegral_indicator _ hs]
congr
simp_rw [nnnorm_indicator_eq_indicator_nnnorm, ENNReal.coe_indicator]
have h_zero : (fun x => x ^ p.toReal) (0 : ℝ≥0∞) = 0 := by
simp [ENNReal.toReal_pos hp_zero hp_top]
-- Porting note: The implicit argument should be specified because the elaborator can't deal with
-- `∘` well.
exact (Set.indicator_comp_of_zero (g := fun x : ℝ≥0∞ => x ^ p.toReal) h_zero).symm
@[deprecated (since := "2024-07-27")]
alias snorm_indicator_eq_snorm_restrict := eLpNorm_indicator_eq_eLpNorm_restrict
theorem memℒp_indicator_iff_restrict (hs : MeasurableSet s) :
Memℒp (s.indicator f) p μ ↔ Memℒp f p (μ.restrict s) := by
simp [Memℒp, aestronglyMeasurable_indicator_iff hs, eLpNorm_indicator_eq_eLpNorm_restrict hs]
/-- If a function is supported on a finite-measure set and belongs to `ℒ^p`, then it belongs to
`ℒ^q` for any `q ≤ p`. -/
theorem Memℒp.memℒp_of_exponent_le_of_measure_support_ne_top
{p q : ℝ≥0∞} {f : α → E} (hfq : Memℒp f q μ) {s : Set α} (hf : ∀ x, x ∉ s → f x = 0)
(hs : μ s ≠ ∞) (hpq : p ≤ q) : Memℒp f p μ := by
have : (toMeasurable μ s).indicator f = f := by
apply Set.indicator_eq_self.2
apply Function.support_subset_iff'.2 (fun x hx ↦ hf x ?_)
contrapose! hx
exact subset_toMeasurable μ s hx
rw [← this, memℒp_indicator_iff_restrict (measurableSet_toMeasurable μ s)] at hfq ⊢
have : Fact (μ (toMeasurable μ s) < ∞) := ⟨by simpa [lt_top_iff_ne_top] using hs⟩
exact memℒp_of_exponent_le hfq hpq
theorem memℒp_indicator_const (p : ℝ≥0∞) (hs : MeasurableSet s) (c : E) (hμsc : c = 0 ∨ μ s ≠ ∞) :
Memℒp (s.indicator fun _ => c) p μ := by
rw [memℒp_indicator_iff_restrict hs]
rcases hμsc with rfl | hμ
· exact zero_memℒp
· have := Fact.mk hμ.lt_top
apply memℒp_const
/-- The `ℒ^p` norm of the indicator of a set is uniformly small if the set itself has small measure,
for any `p < ∞`. Given here as an existential `∀ ε > 0, ∃ η > 0, ...` to avoid later
management of `ℝ≥0∞`-arithmetic. -/
theorem exists_eLpNorm_indicator_le (hp : p ≠ ∞) (c : E) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ η : ℝ≥0, 0 < η ∧ ∀ s : Set α, μ s ≤ η → eLpNorm (s.indicator fun _ => c) p μ ≤ ε := by
rcases eq_or_ne p 0 with (rfl | h'p)
· exact ⟨1, zero_lt_one, fun s _ => by simp⟩
have hp₀ : 0 < p := bot_lt_iff_ne_bot.2 h'p
have hp₀' : 0 ≤ 1 / p.toReal := div_nonneg zero_le_one ENNReal.toReal_nonneg
have hp₀'' : 0 < p.toReal := ENNReal.toReal_pos hp₀.ne' hp
obtain ⟨η, hη_pos, hη_le⟩ :
∃ η : ℝ≥0, 0 < η ∧ (‖c‖₊ : ℝ≥0∞) * (η : ℝ≥0∞) ^ (1 / p.toReal) ≤ ε := by
have :
Filter.Tendsto (fun x : ℝ≥0 => ((‖c‖₊ * x ^ (1 / p.toReal) : ℝ≥0) : ℝ≥0∞)) (𝓝 0)
(𝓝 (0 : ℝ≥0)) := by
rw [ENNReal.tendsto_coe]
convert (NNReal.continuousAt_rpow_const (Or.inr hp₀')).tendsto.const_mul _
simp [hp₀''.ne']
have hε' : 0 < ε := hε.bot_lt
obtain ⟨δ, hδ, hδε'⟩ :=
NNReal.nhds_zero_basis.eventually_iff.mp (eventually_le_of_tendsto_lt hε' this)
obtain ⟨η, hη, hηδ⟩ := exists_between hδ
refine ⟨η, hη, ?_⟩
rw [ENNReal.coe_rpow_of_nonneg _ hp₀', ← ENNReal.coe_mul]
exact hδε' hηδ
refine ⟨η, hη_pos, fun s hs => ?_⟩
refine (eLpNorm_indicator_const_le _ _).trans (le_trans ?_ hη_le)
exact mul_le_mul_left' (ENNReal.rpow_le_rpow hs hp₀') _
@[deprecated (since := "2024-07-27")]
alias exists_snorm_indicator_le := exists_eLpNorm_indicator_le
protected lemma Memℒp.piecewise [DecidablePred (· ∈ s)] {g}
(hs : MeasurableSet s) (hf : Memℒp f p (μ.restrict s)) (hg : Memℒp g p (μ.restrict sᶜ)) :
Memℒp (s.piecewise f g) p μ := by
by_cases hp_zero : p = 0
· simp only [hp_zero, memℒp_zero_iff_aestronglyMeasurable]
exact AEStronglyMeasurable.piecewise hs hf.1 hg.1
refine ⟨AEStronglyMeasurable.piecewise hs hf.1 hg.1, ?_⟩
rcases eq_or_ne p ∞ with rfl | hp_top
· rw [eLpNorm_top_piecewise f g hs]
exact max_lt hf.2 hg.2
rw [eLpNorm_lt_top_iff_lintegral_rpow_nnnorm_lt_top hp_zero hp_top, ← lintegral_add_compl _ hs,
ENNReal.add_lt_top]
constructor
· have h : ∀ᵐ (x : α) ∂μ, x ∈ s →
(‖Set.piecewise s f g x‖₊ : ℝ≥0∞) ^ p.toReal = (‖f x‖₊ : ℝ≥0∞) ^ p.toReal := by
filter_upwards with a ha using by simp [ha]
rw [setLIntegral_congr_fun hs h]
exact lintegral_rpow_nnnorm_lt_top_of_eLpNorm_lt_top hp_zero hp_top hf.2
· have h : ∀ᵐ (x : α) ∂μ, x ∈ sᶜ →
(‖Set.piecewise s f g x‖₊ : ℝ≥0∞) ^ p.toReal = (‖g x‖₊ : ℝ≥0∞) ^ p.toReal := by
filter_upwards with a ha
have ha' : a ∉ s := ha
simp [ha']
rw [setLIntegral_congr_fun hs.compl h]
exact lintegral_rpow_nnnorm_lt_top_of_eLpNorm_lt_top hp_zero hp_top hg.2
end Indicator
section Topology
variable {X : Type*} [TopologicalSpace X] [MeasurableSpace X]
{μ : Measure X} [IsFiniteMeasureOnCompacts μ]
/-- A bounded measurable function with compact support is in L^p. -/
theorem _root_.HasCompactSupport.memℒp_of_bound {f : X → E} (hf : HasCompactSupport f)
(h2f : AEStronglyMeasurable f μ) (C : ℝ) (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : Memℒp f p μ := by
have := memℒp_top_of_bound h2f C hfC
exact this.memℒp_of_exponent_le_of_measure_support_ne_top
(fun x ↦ image_eq_zero_of_nmem_tsupport) (hf.measure_lt_top.ne) le_top
/-- A continuous function with compact support is in L^p. -/
theorem _root_.Continuous.memℒp_of_hasCompactSupport [OpensMeasurableSpace X]
{f : X → E} (hf : Continuous f) (h'f : HasCompactSupport f) : Memℒp f p μ := by
have := hf.memℒp_top_of_hasCompactSupport h'f μ
exact this.memℒp_of_exponent_le_of_measure_support_ne_top
(fun x ↦ image_eq_zero_of_nmem_tsupport) (h'f.measure_lt_top.ne) le_top
end Topology
section IndicatorConstLp
open Set Function
variable {s : Set α} {hs : MeasurableSet s} {hμs : μ s ≠ ∞} {c : E}
/-- Indicator of a set as an element of `Lp`. -/
def indicatorConstLp (p : ℝ≥0∞) (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) : Lp E p μ :=
Memℒp.toLp (s.indicator fun _ => c) (memℒp_indicator_const p hs c (Or.inr hμs))
/-- A version of `Set.indicator_add` for `MeasureTheory.indicatorConstLp`.-/
theorem indicatorConstLp_add {c' : E} :
indicatorConstLp p hs hμs c + indicatorConstLp p hs hμs c' =
indicatorConstLp p hs hμs (c + c') := by
simp_rw [indicatorConstLp, ← Memℒp.toLp_add, indicator_add]
rfl
/-- A version of `Set.indicator_sub` for `MeasureTheory.indicatorConstLp`.-/
theorem indicatorConstLp_sub {c' : E} :
indicatorConstLp p hs hμs c - indicatorConstLp p hs hμs c' =
indicatorConstLp p hs hμs (c - c') := by
simp_rw [indicatorConstLp, ← Memℒp.toLp_sub, indicator_sub]
rfl
theorem indicatorConstLp_coeFn : ⇑(indicatorConstLp p hs hμs c) =ᵐ[μ] s.indicator fun _ => c :=
Memℒp.coeFn_toLp (memℒp_indicator_const p hs c (Or.inr hμs))
theorem indicatorConstLp_coeFn_mem : ∀ᵐ x : α ∂μ, x ∈ s → indicatorConstLp p hs hμs c x = c :=
indicatorConstLp_coeFn.mono fun _x hx hxs => hx.trans (Set.indicator_of_mem hxs _)
theorem indicatorConstLp_coeFn_nmem : ∀ᵐ x : α ∂μ, x ∉ s → indicatorConstLp p hs hμs c x = 0 :=
indicatorConstLp_coeFn.mono fun _x hx hxs => hx.trans (Set.indicator_of_not_mem hxs _)
theorem norm_indicatorConstLp (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
‖indicatorConstLp p hs hμs c‖ = ‖c‖ * (μ s).toReal ^ (1 / p.toReal) := by
rw [Lp.norm_def, eLpNorm_congr_ae indicatorConstLp_coeFn,
eLpNorm_indicator_const hs hp_ne_zero hp_ne_top, ENNReal.toReal_mul, ENNReal.toReal_rpow,
ENNReal.coe_toReal, coe_nnnorm]
theorem norm_indicatorConstLp_top (hμs_ne_zero : μ s ≠ 0) :
‖indicatorConstLp ∞ hs hμs c‖ = ‖c‖ := by
rw [Lp.norm_def, eLpNorm_congr_ae indicatorConstLp_coeFn,
eLpNorm_indicator_const' hs hμs_ne_zero ENNReal.top_ne_zero, ENNReal.top_toReal,
_root_.div_zero, ENNReal.rpow_zero, mul_one, ENNReal.coe_toReal, coe_nnnorm]
theorem norm_indicatorConstLp' (hp_pos : p ≠ 0) (hμs_pos : μ s ≠ 0) :
‖indicatorConstLp p hs hμs c‖ = ‖c‖ * (μ s).toReal ^ (1 / p.toReal) := by
by_cases hp_top : p = ∞
· rw [hp_top, ENNReal.top_toReal, _root_.div_zero, Real.rpow_zero, mul_one]
exact norm_indicatorConstLp_top hμs_pos
· exact norm_indicatorConstLp hp_pos hp_top
theorem norm_indicatorConstLp_le :
‖indicatorConstLp p hs hμs c‖ ≤ ‖c‖ * (μ s).toReal ^ (1 / p.toReal) := by
rw [indicatorConstLp, Lp.norm_toLp]
refine ENNReal.toReal_le_of_le_ofReal (by positivity) ?_
refine (eLpNorm_indicator_const_le _ _).trans_eq ?_
rw [← coe_nnnorm, ENNReal.ofReal_mul (NNReal.coe_nonneg _), ENNReal.ofReal_coe_nnreal,
ENNReal.toReal_rpow, ENNReal.ofReal_toReal]
exact ENNReal.rpow_ne_top_of_nonneg (by positivity) hμs
theorem nnnorm_indicatorConstLp_le :
‖indicatorConstLp p hs hμs c‖₊ ≤ ‖c‖₊ * (μ s).toNNReal ^ (1 / p.toReal) :=
norm_indicatorConstLp_le
theorem ennnorm_indicatorConstLp_le :
(‖indicatorConstLp p hs hμs c‖₊ : ℝ≥0∞) ≤ ‖c‖₊ * (μ s) ^ (1 / p.toReal) := by
refine (ENNReal.coe_le_coe.mpr nnnorm_indicatorConstLp_le).trans_eq ?_
simp [← ENNReal.coe_rpow_of_nonneg, ENNReal.coe_toNNReal hμs]
theorem edist_indicatorConstLp_eq_nnnorm {t : Set α} {ht : MeasurableSet t} {hμt : μ t ≠ ∞} :
edist (indicatorConstLp p hs hμs c) (indicatorConstLp p ht hμt c) =
‖indicatorConstLp p (hs.symmDiff ht) (measure_symmDiff_ne_top hμs hμt) c‖₊ := by
unfold indicatorConstLp
rw [Lp.edist_toLp_toLp, eLpNorm_indicator_sub_indicator, Lp.coe_nnnorm_toLp]
theorem dist_indicatorConstLp_eq_norm {t : Set α} {ht : MeasurableSet t} {hμt : μ t ≠ ∞} :
dist (indicatorConstLp p hs hμs c) (indicatorConstLp p ht hμt c) =
‖indicatorConstLp p (hs.symmDiff ht) (measure_symmDiff_ne_top hμs hμt) c‖ := by
rw [Lp.dist_edist, edist_indicatorConstLp_eq_nnnorm, ENNReal.coe_toReal, Lp.coe_nnnorm]
/-- A family of `indicatorConstLp` functions tends to an `indicatorConstLp`,
if the underlying sets tend to the set in the sense of the measure of the symmetric difference. -/
theorem tendsto_indicatorConstLp_set [hp₁ : Fact (1 ≤ p)] {β : Type*} {l : Filter β} {t : β → Set α}
{ht : ∀ b, MeasurableSet (t b)} {hμt : ∀ b, μ (t b) ≠ ∞} (hp : p ≠ ∞)
(h : Tendsto (fun b ↦ μ (t b ∆ s)) l (𝓝 0)) :
Tendsto (fun b ↦ indicatorConstLp p (ht b) (hμt b) c) l (𝓝 (indicatorConstLp p hs hμs c)) := by
rw [tendsto_iff_dist_tendsto_zero]
have hp₀ : p ≠ 0 := (one_pos.trans_le hp₁.out).ne'
simp only [dist_indicatorConstLp_eq_norm, norm_indicatorConstLp hp₀ hp]
convert tendsto_const_nhds.mul
(((ENNReal.tendsto_toReal ENNReal.zero_ne_top).comp h).rpow_const _)
· simp [Real.rpow_eq_zero_iff_of_nonneg, ENNReal.toReal_eq_zero_iff, hp, hp₀]
· simp
/-- A family of `indicatorConstLp` functions is continuous in the parameter,
if `μ (s y ∆ s x)` tends to zero as `y` tends to `x` for all `x`. -/
theorem continuous_indicatorConstLp_set [Fact (1 ≤ p)] {X : Type*} [TopologicalSpace X]
{s : X → Set α} {hs : ∀ x, MeasurableSet (s x)} {hμs : ∀ x, μ (s x) ≠ ∞} (hp : p ≠ ∞)
(h : ∀ x, Tendsto (fun y ↦ μ (s y ∆ s x)) (𝓝 x) (𝓝 0)) :
Continuous fun x ↦ indicatorConstLp p (hs x) (hμs x) c :=
continuous_iff_continuousAt.2 fun x ↦ tendsto_indicatorConstLp_set hp (h x)
@[simp]
theorem indicatorConstLp_empty :
indicatorConstLp p MeasurableSet.empty (by simp : μ ∅ ≠ ∞) c = 0 := by
simp only [indicatorConstLp, Set.indicator_empty', Memℒp.toLp_zero]
theorem indicatorConstLp_inj {s t : Set α} (hs : MeasurableSet s) (hsμ : μ s ≠ ∞)
(ht : MeasurableSet t) (htμ : μ t ≠ ∞) {c : E} (hc : c ≠ 0) :
indicatorConstLp p hs hsμ c = indicatorConstLp p ht htμ c ↔ s =ᵐ[μ] t := by
simp_rw [← indicator_const_eventuallyEq hc, indicatorConstLp, Memℒp.toLp_eq_toLp_iff]
theorem memℒp_add_of_disjoint {f g : α → E} (h : Disjoint (support f) (support g))
(hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
Memℒp (f + g) p μ ↔ Memℒp f p μ ∧ Memℒp g p μ := by
borelize E
refine ⟨fun hfg => ⟨?_, ?_⟩, fun h => h.1.add h.2⟩
· rw [← Set.indicator_add_eq_left h]; exact hfg.indicator (measurableSet_support hf.measurable)
· rw [← Set.indicator_add_eq_right h]; exact hfg.indicator (measurableSet_support hg.measurable)
/-- The indicator of a disjoint union of two sets is the sum of the indicators of the sets. -/
theorem indicatorConstLp_disjoint_union {s t : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
(hμs : μ s ≠ ∞) (hμt : μ t ≠ ∞) (hst : s ∩ t = ∅) (c : E) :
indicatorConstLp p (hs.union ht) (measure_union_ne_top hμs hμt) c =
indicatorConstLp p hs hμs c + indicatorConstLp p ht hμt c := by
ext1
refine indicatorConstLp_coeFn.trans (EventuallyEq.trans ?_ (Lp.coeFn_add _ _).symm)
refine
EventuallyEq.trans ?_
(EventuallyEq.add indicatorConstLp_coeFn.symm indicatorConstLp_coeFn.symm)
rw [Set.indicator_union_of_disjoint (Set.disjoint_iff_inter_eq_empty.mpr hst) _]
end IndicatorConstLp
section const
variable (μ p)
variable [IsFiniteMeasure μ] (c : E)
/-- Constant function as an element of `MeasureTheory.Lp` for a finite measure. -/
protected def Lp.const : E →+ Lp E p μ where
toFun c := ⟨AEEqFun.const α c, const_mem_Lp α μ c⟩
map_zero' := rfl
map_add' _ _ := rfl
lemma Lp.coeFn_const : Lp.const p μ c =ᵐ[μ] Function.const α c :=
AEEqFun.coeFn_const α c
@[simp] lemma Lp.const_val : (Lp.const p μ c).1 = AEEqFun.const α c := rfl
@[simp]
lemma Memℒp.toLp_const : Memℒp.toLp _ (memℒp_const c) = Lp.const p μ c := rfl
@[simp]
lemma indicatorConstLp_univ :
indicatorConstLp p .univ (measure_ne_top μ _) c = Lp.const p μ c := by
rw [← Memℒp.toLp_const, indicatorConstLp]
simp only [Set.indicator_univ, Function.const]
theorem Lp.norm_const [NeZero μ] (hp_zero : p ≠ 0) :
‖Lp.const p μ c‖ = ‖c‖ * (μ Set.univ).toReal ^ (1 / p.toReal) := by
have := NeZero.ne μ
rw [← Memℒp.toLp_const, Lp.norm_toLp, eLpNorm_const] <;> try assumption
rw [ENNReal.toReal_mul, ENNReal.coe_toReal, ← ENNReal.toReal_rpow, coe_nnnorm]
theorem Lp.norm_const' (hp_zero : p ≠ 0) (hp_top : p ≠ ∞) :
‖Lp.const p μ c‖ = ‖c‖ * (μ Set.univ).toReal ^ (1 / p.toReal) := by
rw [← Memℒp.toLp_const, Lp.norm_toLp, eLpNorm_const'] <;> try assumption
rw [ENNReal.toReal_mul, ENNReal.coe_toReal, ← ENNReal.toReal_rpow, coe_nnnorm]
theorem Lp.norm_const_le : ‖Lp.const p μ c‖ ≤ ‖c‖ * (μ Set.univ).toReal ^ (1 / p.toReal) := by
rw [← indicatorConstLp_univ]
exact norm_indicatorConstLp_le
/-- `MeasureTheory.Lp.const` as a `LinearMap`. -/
@[simps] protected def Lp.constₗ (𝕜 : Type*) [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E] :
E →ₗ[𝕜] Lp E p μ where
toFun := Lp.const p μ
map_add' := map_add _
map_smul' _ _ := rfl
@[simps! apply]
protected def Lp.constL (𝕜 : Type*) [NormedField 𝕜] [NormedSpace 𝕜 E] [Fact (1 ≤ p)] :
E →L[𝕜] Lp E p μ :=
(Lp.constₗ p μ 𝕜).mkContinuous ((μ Set.univ).toReal ^ (1 / p.toReal)) fun _ ↦
(Lp.norm_const_le _ _ _).trans_eq (mul_comm _ _)
theorem Lp.norm_constL_le (𝕜 : Type*) [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
[Fact (1 ≤ p)] :
‖(Lp.constL p μ 𝕜 : E →L[𝕜] Lp E p μ)‖ ≤ (μ Set.univ).toReal ^ (1 / p.toReal) :=
LinearMap.mkContinuous_norm_le _ (by positivity) _
end const
theorem Memℒp.norm_rpow_div {f : α → E} (hf : Memℒp f p μ) (q : ℝ≥0∞) :
Memℒp (fun x : α => ‖f x‖ ^ q.toReal) (p / q) μ := by
refine ⟨(hf.1.norm.aemeasurable.pow_const q.toReal).aestronglyMeasurable, ?_⟩
by_cases q_top : q = ∞
· simp [q_top]
by_cases q_zero : q = 0
· simp only [q_zero, ENNReal.zero_toReal, Real.rpow_zero]
by_cases p_zero : p = 0
· simp [p_zero]
rw [ENNReal.div_zero p_zero]
exact (memℒp_top_const (1 : ℝ)).2
rw [eLpNorm_norm_rpow _ (ENNReal.toReal_pos q_zero q_top)]
apply ENNReal.rpow_lt_top_of_nonneg ENNReal.toReal_nonneg
rw [ENNReal.ofReal_toReal q_top, div_eq_mul_inv, mul_assoc, ENNReal.inv_mul_cancel q_zero q_top,
mul_one]
exact hf.2.ne
theorem memℒp_norm_rpow_iff {q : ℝ≥0∞} {f : α → E} (hf : AEStronglyMeasurable f μ) (q_zero : q ≠ 0)
(q_top : q ≠ ∞) : Memℒp (fun x : α => ‖f x‖ ^ q.toReal) (p / q) μ ↔ Memℒp f p μ := by
refine ⟨fun h => ?_, fun h => h.norm_rpow_div q⟩
apply (memℒp_norm_iff hf).1
convert h.norm_rpow_div q⁻¹ using 1
· ext x
rw [Real.norm_eq_abs, Real.abs_rpow_of_nonneg (norm_nonneg _), ← Real.rpow_mul (abs_nonneg _),
ENNReal.toReal_inv, mul_inv_cancel, abs_of_nonneg (norm_nonneg _), Real.rpow_one]
simp [ENNReal.toReal_eq_zero_iff, not_or, q_zero, q_top]
· rw [div_eq_mul_inv, inv_inv, div_eq_mul_inv, mul_assoc, ENNReal.inv_mul_cancel q_zero q_top,
mul_one]
theorem Memℒp.norm_rpow {f : α → E} (hf : Memℒp f p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
Memℒp (fun x : α => ‖f x‖ ^ p.toReal) 1 μ := by
convert hf.norm_rpow_div p
rw [div_eq_mul_inv, ENNReal.mul_inv_cancel hp_ne_zero hp_ne_top]
theorem AEEqFun.compMeasurePreserving_mem_Lp {β : Type*} [MeasurableSpace β]
{μb : MeasureTheory.Measure β} {g : β →ₘ[μb] E} (hg : g ∈ Lp E p μb) {f : α → β}
(hf : MeasurePreserving f μ μb) :
g.compMeasurePreserving f hf ∈ Lp E p μ := by
rw [Lp.mem_Lp_iff_eLpNorm_lt_top] at hg ⊢
rwa [eLpNorm_compMeasurePreserving]
namespace Lp
/-! ### Composition with a measure preserving function -/
variable {β : Type*} [MeasurableSpace β] {μb : MeasureTheory.Measure β} {f : α → β}
/-- Composition of an `L^p` function with a measure preserving function is an `L^p` function. -/
def compMeasurePreserving (f : α → β) (hf : MeasurePreserving f μ μb) :
Lp E p μb →+ Lp E p μ where
toFun g := ⟨g.1.compMeasurePreserving f hf, g.1.compMeasurePreserving_mem_Lp g.2 hf⟩
map_zero' := rfl
map_add' := by rintro ⟨⟨_⟩, _⟩ ⟨⟨_⟩, _⟩; rfl
@[simp]
theorem compMeasurePreserving_val (g : Lp E p μb) (hf : MeasurePreserving f μ μb) :
(compMeasurePreserving f hf g).1 = g.1.compMeasurePreserving f hf :=
rfl
theorem coeFn_compMeasurePreserving (g : Lp E p μb) (hf : MeasurePreserving f μ μb) :
compMeasurePreserving f hf g =ᵐ[μ] g ∘ f :=
g.1.coeFn_compMeasurePreserving hf
@[simp]
theorem norm_compMeasurePreserving (g : Lp E p μb) (hf : MeasurePreserving f μ μb) :
‖compMeasurePreserving f hf g‖ = ‖g‖ :=
congr_arg ENNReal.toReal <| g.1.eLpNorm_compMeasurePreserving hf
theorem isometry_compMeasurePreserving [Fact (1 ≤ p)] (hf : MeasurePreserving f μ μb) :
Isometry (compMeasurePreserving f hf : Lp E p μb → Lp E p μ) :=
AddMonoidHomClass.isometry_of_norm _ (norm_compMeasurePreserving · hf)
theorem toLp_compMeasurePreserving {g : β → E} (hg : Memℒp g p μb) (hf : MeasurePreserving f μ μb) :
compMeasurePreserving f hf (hg.toLp g) = (hg.comp_measurePreserving hf).toLp _ := rfl
theorem indicatorConstLp_compMeasurePreserving {s : Set β} (hs : MeasurableSet s)
(hμs : μb s ≠ ∞) (c : E) (hf : MeasurePreserving f μ μb) :
Lp.compMeasurePreserving f hf (indicatorConstLp p hs hμs c) =
indicatorConstLp p (hs.preimage hf.measurable)
(by rwa [hf.measure_preimage hs.nullMeasurableSet]) c :=
rfl
variable (𝕜 : Type*) [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
/-- `MeasureTheory.Lp.compMeasurePreserving` as a linear map. -/
@[simps]
def compMeasurePreservingₗ (f : α → β) (hf : MeasurePreserving f μ μb) :
Lp E p μb →ₗ[𝕜] Lp E p μ where
__ := compMeasurePreserving f hf
map_smul' c g := by rcases g with ⟨⟨_⟩, _⟩; rfl
/-- `MeasureTheory.Lp.compMeasurePreserving` as a linear isometry. -/
@[simps!]
def compMeasurePreservingₗᵢ [Fact (1 ≤ p)] (f : α → β) (hf : MeasurePreserving f μ μb) :
Lp E p μb →ₗᵢ[𝕜] Lp E p μ where
toLinearMap := compMeasurePreservingₗ 𝕜 f hf
norm_map' := (norm_compMeasurePreserving · hf)
end Lp
end MeasureTheory
open MeasureTheory
/-!
### Composition on `L^p`
We show that Lipschitz functions vanishing at zero act by composition on `L^p`, and specialize
this to the composition with continuous linear maps, and to the definition of the positive
part of an `L^p` function.
-/
section Composition
variable {g : E → F} {c : ℝ≥0}
theorem LipschitzWith.comp_memℒp {α E F} {K} [MeasurableSpace α] {μ : Measure α}
[NormedAddCommGroup E] [NormedAddCommGroup F] {f : α → E} {g : E → F} (hg : LipschitzWith K g)
(g0 : g 0 = 0) (hL : Memℒp f p μ) : Memℒp (g ∘ f) p μ :=
have : ∀ x, ‖g (f x)‖ ≤ K * ‖f x‖ := fun x ↦ by
-- TODO: add `LipschitzWith.nnnorm_sub_le` and `LipschitzWith.nnnorm_le`
simpa [g0] using hg.norm_sub_le (f x) 0
hL.of_le_mul (hg.continuous.comp_aestronglyMeasurable hL.1) (eventually_of_forall this)
theorem MeasureTheory.Memℒp.of_comp_antilipschitzWith {α E F} {K'} [MeasurableSpace α]
{μ : Measure α} [NormedAddCommGroup E] [NormedAddCommGroup F] {f : α → E} {g : E → F}
(hL : Memℒp (g ∘ f) p μ) (hg : UniformContinuous g) (hg' : AntilipschitzWith K' g)
(g0 : g 0 = 0) : Memℒp f p μ := by
have A : ∀ x, ‖f x‖ ≤ K' * ‖g (f x)‖ := by
intro x
-- TODO: add `AntilipschitzWith.le_mul_nnnorm_sub` and `AntilipschitzWith.le_mul_norm`
rw [← dist_zero_right, ← dist_zero_right, ← g0]
apply hg'.le_mul_dist
have B : AEStronglyMeasurable f μ :=
(hg'.uniformEmbedding hg).embedding.aestronglyMeasurable_comp_iff.1 hL.1
exact hL.of_le_mul B (Filter.eventually_of_forall A)
namespace LipschitzWith
theorem memℒp_comp_iff_of_antilipschitz {α E F} {K K'} [MeasurableSpace α] {μ : Measure α}
[NormedAddCommGroup E] [NormedAddCommGroup F] {f : α → E} {g : E → F} (hg : LipschitzWith K g)
(hg' : AntilipschitzWith K' g) (g0 : g 0 = 0) : Memℒp (g ∘ f) p μ ↔ Memℒp f p μ :=
⟨fun h => h.of_comp_antilipschitzWith hg.uniformContinuous hg' g0, fun h => hg.comp_memℒp g0 h⟩
/-- When `g` is a Lipschitz function sending `0` to `0` and `f` is in `Lp`, then `g ∘ f` is well
defined as an element of `Lp`. -/
def compLp (hg : LipschitzWith c g) (g0 : g 0 = 0) (f : Lp E p μ) : Lp F p μ :=
⟨AEEqFun.comp g hg.continuous (f : α →ₘ[μ] E), by
suffices ∀ᵐ x ∂μ, ‖AEEqFun.comp g hg.continuous (f : α →ₘ[μ] E) x‖ ≤ c * ‖f x‖ from
Lp.mem_Lp_of_ae_le_mul this
filter_upwards [AEEqFun.coeFn_comp g hg.continuous (f : α →ₘ[μ] E)] with a ha
simp only [ha]
rw [← dist_zero_right, ← dist_zero_right, ← g0]
exact hg.dist_le_mul (f a) 0⟩
theorem coeFn_compLp (hg : LipschitzWith c g) (g0 : g 0 = 0) (f : Lp E p μ) :
hg.compLp g0 f =ᵐ[μ] g ∘ f :=
AEEqFun.coeFn_comp _ hg.continuous _
@[simp]
theorem compLp_zero (hg : LipschitzWith c g) (g0 : g 0 = 0) : hg.compLp g0 (0 : Lp E p μ) = 0 := by
rw [Lp.eq_zero_iff_ae_eq_zero]
apply (coeFn_compLp _ _ _).trans
filter_upwards [Lp.coeFn_zero E p μ] with _ ha
simp only [ha, g0, Function.comp_apply, Pi.zero_apply]
theorem norm_compLp_sub_le (hg : LipschitzWith c g) (g0 : g 0 = 0) (f f' : Lp E p μ) :
‖hg.compLp g0 f - hg.compLp g0 f'‖ ≤ c * ‖f - f'‖ := by
apply Lp.norm_le_mul_norm_of_ae_le_mul
filter_upwards [hg.coeFn_compLp g0 f, hg.coeFn_compLp g0 f',
Lp.coeFn_sub (hg.compLp g0 f) (hg.compLp g0 f'), Lp.coeFn_sub f f'] with a ha1 ha2 ha3 ha4
simp only [ha1, ha2, ha3, ha4, ← dist_eq_norm, Pi.sub_apply, Function.comp_apply]
exact hg.dist_le_mul (f a) (f' a)
theorem norm_compLp_le (hg : LipschitzWith c g) (g0 : g 0 = 0) (f : Lp E p μ) :
‖hg.compLp g0 f‖ ≤ c * ‖f‖ := by simpa using hg.norm_compLp_sub_le g0 f 0
theorem lipschitzWith_compLp [Fact (1 ≤ p)] (hg : LipschitzWith c g) (g0 : g 0 = 0) :
LipschitzWith c (hg.compLp g0 : Lp E p μ → Lp F p μ) :=
LipschitzWith.of_dist_le_mul fun f g => by simp [dist_eq_norm, norm_compLp_sub_le]
theorem continuous_compLp [Fact (1 ≤ p)] (hg : LipschitzWith c g) (g0 : g 0 = 0) :
Continuous (hg.compLp g0 : Lp E p μ → Lp F p μ) :=
(lipschitzWith_compLp hg g0).continuous
end LipschitzWith
namespace ContinuousLinearMap
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E] [NormedSpace 𝕜 F]
/-- Composing `f : Lp` with `L : E →L[𝕜] F`. -/
def compLp (L : E →L[𝕜] F) (f : Lp E p μ) : Lp F p μ :=
L.lipschitz.compLp (map_zero L) f
theorem coeFn_compLp (L : E →L[𝕜] F) (f : Lp E p μ) : ∀ᵐ a ∂μ, (L.compLp f) a = L (f a) :=
LipschitzWith.coeFn_compLp _ _ _
theorem coeFn_compLp' (L : E →L[𝕜] F) (f : Lp E p μ) : L.compLp f =ᵐ[μ] fun a => L (f a) :=
L.coeFn_compLp f
theorem comp_memℒp (L : E →L[𝕜] F) (f : Lp E p μ) : Memℒp (L ∘ f) p μ :=
(Lp.memℒp (L.compLp f)).ae_eq (L.coeFn_compLp' f)
theorem comp_memℒp' (L : E →L[𝕜] F) {f : α → E} (hf : Memℒp f p μ) : Memℒp (L ∘ f) p μ :=
(L.comp_memℒp (hf.toLp f)).ae_eq (EventuallyEq.fun_comp hf.coeFn_toLp _)
section RCLike
variable {K : Type*} [RCLike K]
theorem _root_.MeasureTheory.Memℒp.ofReal {f : α → ℝ} (hf : Memℒp f p μ) :
Memℒp (fun x => (f x : K)) p μ :=
(@RCLike.ofRealCLM K _).comp_memℒp' hf
theorem _root_.MeasureTheory.memℒp_re_im_iff {f : α → K} :
Memℒp (fun x ↦ RCLike.re (f x)) p μ ∧ Memℒp (fun x ↦ RCLike.im (f x)) p μ ↔
Memℒp f p μ := by
refine ⟨?_, fun hf => ⟨hf.re, hf.im⟩⟩
rintro ⟨hre, him⟩
convert MeasureTheory.Memℒp.add (E := K) hre.ofReal (him.ofReal.const_mul RCLike.I)
ext1 x
rw [Pi.add_apply, mul_comm, RCLike.re_add_im]
end RCLike
theorem add_compLp (L L' : E →L[𝕜] F) (f : Lp E p μ) :
(L + L').compLp f = L.compLp f + L'.compLp f := by
ext1
refine (coeFn_compLp' (L + L') f).trans ?_
refine EventuallyEq.trans ?_ (Lp.coeFn_add _ _).symm
refine
EventuallyEq.trans ?_ (EventuallyEq.add (L.coeFn_compLp' f).symm (L'.coeFn_compLp' f).symm)
filter_upwards with x
rw [coe_add', Pi.add_def]
theorem smul_compLp {𝕜'} [NormedRing 𝕜'] [Module 𝕜' F] [BoundedSMul 𝕜' F] [SMulCommClass 𝕜 𝕜' F]
(c : 𝕜') (L : E →L[𝕜] F) (f : Lp E p μ) : (c • L).compLp f = c • L.compLp f := by
ext1
refine (coeFn_compLp' (c • L) f).trans ?_
refine EventuallyEq.trans ?_ (Lp.coeFn_smul _ _).symm
refine (L.coeFn_compLp' f).mono fun x hx => ?_
rw [Pi.smul_apply, hx, coe_smul', Pi.smul_def]
theorem norm_compLp_le (L : E →L[𝕜] F) (f : Lp E p μ) : ‖L.compLp f‖ ≤ ‖L‖ * ‖f‖ :=
LipschitzWith.norm_compLp_le _ _ _
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 →L[𝕜] F) : Lp E p μ →ₗ[𝕜] Lp F p μ where
toFun f := L.compLp f
map_add' f g := by
ext1
filter_upwards [Lp.coeFn_add f g, coeFn_compLp L (f + g), coeFn_compLp L f,
coeFn_compLp L g, Lp.coeFn_add (L.compLp f) (L.compLp g)]
intro a ha1 ha2 ha3 ha4 ha5
simp only [ha1, ha2, ha3, ha4, ha5, map_add, Pi.add_apply]
map_smul' c f := by
dsimp
ext1
filter_upwards [Lp.coeFn_smul c f, coeFn_compLp L (c • f), Lp.coeFn_smul c (L.compLp f),
coeFn_compLp L f] with _ ha1 ha2 ha3 ha4
simp only [ha1, ha2, ha3, ha4, map_smul, Pi.smul_apply]
/-- Composing `f : Lp E p μ` with `L : E →L[𝕜] F`, seen as a continuous `𝕜`-linear map on
`Lp E p μ`. See also the similar
* `LinearMap.compLeft` for functions,
* `ContinuousLinearMap.compLeftContinuous` for continuous functions,
* `ContinuousLinearMap.compLeftContinuousBounded` for bounded continuous functions,
* `ContinuousLinearMap.compLeftContinuousCompact` for continuous functions on compact spaces.
-/
def compLpL [Fact (1 ≤ p)] (L : E →L[𝕜] F) : Lp E p μ →L[𝕜] Lp F p μ :=
LinearMap.mkContinuous (L.compLpₗ p μ) ‖L‖ L.norm_compLp_le
variable {μ p}
theorem coeFn_compLpL [Fact (1 ≤ p)] (L : E →L[𝕜] F) (f : Lp E p μ) :
L.compLpL p μ f =ᵐ[μ] fun a => L (f a) :=
L.coeFn_compLp f
theorem add_compLpL [Fact (1 ≤ p)] (L L' : E →L[𝕜] F) :
(L + L').compLpL p μ = L.compLpL p μ + L'.compLpL p μ := by ext1 f; exact add_compLp L L' f
theorem smul_compLpL [Fact (1 ≤ p)] {𝕜'} [NormedRing 𝕜'] [Module 𝕜' F] [BoundedSMul 𝕜' F]
[SMulCommClass 𝕜 𝕜' F] (c : 𝕜') (L : E →L[𝕜] F) : (c • L).compLpL p μ = c • L.compLpL p μ := by
ext1 f; exact smul_compLp c L f
theorem norm_compLpL_le [Fact (1 ≤ p)] (L : E →L[𝕜] F) : ‖L.compLpL p μ‖ ≤ ‖L‖ :=
LinearMap.mkContinuous_norm_le _ (norm_nonneg _) _
end ContinuousLinearMap
namespace MeasureTheory
theorem indicatorConstLp_eq_toSpanSingleton_compLp {s : Set α} [NormedSpace ℝ F]
(hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : F) :
indicatorConstLp 2 hs hμs x =
(ContinuousLinearMap.toSpanSingleton ℝ x).compLp (indicatorConstLp 2 hs hμs (1 : ℝ)) := by
ext1
refine indicatorConstLp_coeFn.trans ?_
have h_compLp :=
(ContinuousLinearMap.toSpanSingleton ℝ x).coeFn_compLp (indicatorConstLp 2 hs hμs (1 : ℝ))
rw [← EventuallyEq] at h_compLp
refine EventuallyEq.trans ?_ h_compLp.symm
refine (@indicatorConstLp_coeFn _ _ _ 2 μ _ s hs hμs (1 : ℝ)).mono fun y hy => ?_
dsimp only
rw [hy]
simp_rw [ContinuousLinearMap.toSpanSingleton_apply]
by_cases hy_mem : y ∈ s <;> simp [hy_mem]
namespace Lp
section PosPart
theorem lipschitzWith_pos_part : LipschitzWith 1 fun x : ℝ => max x 0 :=
LipschitzWith.id.max_const _
theorem _root_.MeasureTheory.Memℒp.pos_part {f : α → ℝ} (hf : Memℒp f p μ) :
Memℒp (fun x => max (f x) 0) p μ :=
lipschitzWith_pos_part.comp_memℒp (max_eq_right le_rfl) hf
theorem _root_.MeasureTheory.Memℒp.neg_part {f : α → ℝ} (hf : Memℒp f p μ) :
Memℒp (fun x => max (-f x) 0) p μ :=
lipschitzWith_pos_part.comp_memℒp (max_eq_right le_rfl) hf.neg
/-- Positive part of a function in `L^p`. -/
def posPart (f : Lp ℝ p μ) : Lp ℝ p μ :=
lipschitzWith_pos_part.compLp (max_eq_right le_rfl) f
/-- Negative part of a function in `L^p`. -/
def negPart (f : Lp ℝ p μ) : Lp ℝ p μ :=
posPart (-f)
@[norm_cast]
theorem coe_posPart (f : Lp ℝ p μ) : (posPart f : α →ₘ[μ] ℝ) = (f : α →ₘ[μ] ℝ).posPart :=
rfl
theorem coeFn_posPart (f : Lp ℝ p μ) : ⇑(posPart f) =ᵐ[μ] fun a => max (f a) 0 :=
AEEqFun.coeFn_posPart _
theorem coeFn_negPart_eq_max (f : Lp ℝ p μ) : ∀ᵐ a ∂μ, negPart f a = max (-f a) 0 := by
rw [negPart]
filter_upwards [coeFn_posPart (-f), coeFn_neg f] with _ h₁ h₂
rw [h₁, h₂, Pi.neg_apply]
theorem coeFn_negPart (f : Lp ℝ p μ) : ∀ᵐ a ∂μ, negPart f a = -min (f a) 0 :=
(coeFn_negPart_eq_max f).mono fun a h => by rw [h, ← max_neg_neg, neg_zero]
theorem continuous_posPart [Fact (1 ≤ p)] : Continuous fun f : Lp ℝ p μ => posPart f :=
LipschitzWith.continuous_compLp _ _
theorem continuous_negPart [Fact (1 ≤ p)] : Continuous fun f : Lp ℝ p μ => negPart f := by
unfold negPart
exact continuous_posPart.comp continuous_neg
end PosPart
end Lp
end MeasureTheory
end Composition
/-!
## `L^p` is a complete space
We show that `L^p` is a complete space for `1 ≤ p`.
-/
section CompleteSpace
namespace MeasureTheory
namespace Lp
theorem eLpNorm'_lim_eq_lintegral_liminf {ι} [Nonempty ι] [LinearOrder ι] {f : ι → α → G} {p : ℝ}
(hp_nonneg : 0 ≤ p) {f_lim : α → G}
(h_lim : ∀ᵐ x : α ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))) :
eLpNorm' f_lim p μ = (∫⁻ a, atTop.liminf fun m => (‖f m a‖₊ : ℝ≥0∞) ^ p ∂μ) ^ (1 / p) := by
suffices h_no_pow :
(∫⁻ a, (‖f_lim a‖₊ : ℝ≥0∞) ^ p ∂μ) = ∫⁻ a, atTop.liminf fun m => (‖f m a‖₊ : ℝ≥0∞) ^ p ∂μ by
rw [eLpNorm', h_no_pow]
refine lintegral_congr_ae (h_lim.mono fun a ha => ?_)
dsimp only
rw [Tendsto.liminf_eq]
simp_rw [ENNReal.coe_rpow_of_nonneg _ hp_nonneg, ENNReal.tendsto_coe]
refine ((NNReal.continuous_rpow_const hp_nonneg).tendsto ‖f_lim a‖₊).comp ?_
exact (continuous_nnnorm.tendsto (f_lim a)).comp ha
@[deprecated (since := "2024-07-27")]
alias snorm'_lim_eq_lintegral_liminf := eLpNorm'_lim_eq_lintegral_liminf
theorem eLpNorm'_lim_le_liminf_eLpNorm' {E} [NormedAddCommGroup E] {f : ℕ → α → E} {p : ℝ}
(hp_pos : 0 < p) (hf : ∀ n, AEStronglyMeasurable (f n) μ) {f_lim : α → E}
(h_lim : ∀ᵐ x : α ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))) :
eLpNorm' f_lim p μ ≤ atTop.liminf fun n => eLpNorm' (f n) p μ := by
rw [eLpNorm'_lim_eq_lintegral_liminf hp_pos.le h_lim]
rw [one_div, ← ENNReal.le_rpow_inv_iff (by simp [hp_pos] : 0 < p⁻¹), inv_inv]
refine (lintegral_liminf_le' fun m => (hf m).ennnorm.pow_const _).trans_eq ?_
have h_pow_liminf :
atTop.liminf (fun n ↦ eLpNorm' (f n) p μ) ^ p
= atTop.liminf fun n ↦ eLpNorm' (f n) p μ ^ p := by
have h_rpow_mono := ENNReal.strictMono_rpow_of_pos hp_pos
have h_rpow_surj := (ENNReal.rpow_left_bijective hp_pos.ne.symm).2
refine (h_rpow_mono.orderIsoOfSurjective _ h_rpow_surj).liminf_apply ?_ ?_ ?_ ?_
all_goals isBoundedDefault
rw [h_pow_liminf]
simp_rw [eLpNorm', ← ENNReal.rpow_mul, one_div, inv_mul_cancel hp_pos.ne.symm, ENNReal.rpow_one]
@[deprecated (since := "2024-07-27")]
alias snorm'_lim_le_liminf_snorm' := eLpNorm'_lim_le_liminf_eLpNorm'
theorem eLpNorm_exponent_top_lim_eq_essSup_liminf {ι} [Nonempty ι] [LinearOrder ι] {f : ι → α → G}
{f_lim : α → G} (h_lim : ∀ᵐ x : α ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))) :
eLpNorm f_lim ∞ μ = essSup (fun x => atTop.liminf fun m => (‖f m x‖₊ : ℝ≥0∞)) μ := by
rw [eLpNorm_exponent_top, eLpNormEssSup]
refine essSup_congr_ae (h_lim.mono fun x hx => ?_)
dsimp only
apply (Tendsto.liminf_eq ..).symm
rw [ENNReal.tendsto_coe]
exact (continuous_nnnorm.tendsto (f_lim x)).comp hx
@[deprecated (since := "2024-07-27")]
alias snorm_exponent_top_lim_eq_essSup_liminf := eLpNorm_exponent_top_lim_eq_essSup_liminf
theorem eLpNorm_exponent_top_lim_le_liminf_eLpNorm_exponent_top {ι} [Nonempty ι] [Countable ι]
[LinearOrder ι] {f : ι → α → F} {f_lim : α → F}
(h_lim : ∀ᵐ x : α ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))) :
eLpNorm f_lim ∞ μ ≤ atTop.liminf fun n => eLpNorm (f n) ∞ μ := by
rw [eLpNorm_exponent_top_lim_eq_essSup_liminf h_lim]
simp_rw [eLpNorm_exponent_top, eLpNormEssSup]
exact ENNReal.essSup_liminf_le fun n => fun x => (‖f n x‖₊ : ℝ≥0∞)
@[deprecated (since := "2024-07-27")]
alias snorm_exponent_top_lim_le_liminf_snorm_exponent_top :=
eLpNorm_exponent_top_lim_le_liminf_eLpNorm_exponent_top
theorem eLpNorm_lim_le_liminf_eLpNorm {E} [NormedAddCommGroup E] {f : ℕ → α → E}
(hf : ∀ n, AEStronglyMeasurable (f n) μ) (f_lim : α → E)
(h_lim : ∀ᵐ x : α ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))) :
eLpNorm f_lim p μ ≤ atTop.liminf fun n => eLpNorm (f n) p μ := by
obtain rfl|hp0 := eq_or_ne p 0
· simp
by_cases hp_top : p = ∞
· simp_rw [hp_top]
exact eLpNorm_exponent_top_lim_le_liminf_eLpNorm_exponent_top h_lim
simp_rw [eLpNorm_eq_eLpNorm' hp0 hp_top]
have hp_pos : 0 < p.toReal := ENNReal.toReal_pos hp0 hp_top
exact eLpNorm'_lim_le_liminf_eLpNorm' hp_pos hf h_lim
@[deprecated (since := "2024-07-27")]
alias snorm_lim_le_liminf_snorm := eLpNorm_lim_le_liminf_eLpNorm
/-! ### `Lp` is complete iff Cauchy sequences of `ℒp` have limits in `ℒp` -/
theorem tendsto_Lp_iff_tendsto_ℒp' {ι} {fi : Filter ι} [Fact (1 ≤ p)] (f : ι → Lp E p μ)
(f_lim : Lp E p μ) :
fi.Tendsto f (𝓝 f_lim) ↔ fi.Tendsto (fun n => eLpNorm (⇑(f n) - ⇑f_lim) p μ) (𝓝 0) := by
rw [tendsto_iff_dist_tendsto_zero]
simp_rw [dist_def]
rw [← ENNReal.zero_toReal, ENNReal.tendsto_toReal_iff (fun n => ?_) ENNReal.zero_ne_top]
rw [eLpNorm_congr_ae (Lp.coeFn_sub _ _).symm]
exact Lp.eLpNorm_ne_top _
theorem tendsto_Lp_iff_tendsto_ℒp {ι} {fi : Filter ι} [Fact (1 ≤ p)] (f : ι → Lp E p μ)
(f_lim : α → E) (f_lim_ℒp : Memℒp f_lim p μ) :
fi.Tendsto f (𝓝 (f_lim_ℒp.toLp f_lim)) ↔
fi.Tendsto (fun n => eLpNorm (⇑(f n) - f_lim) p μ) (𝓝 0) := by
rw [tendsto_Lp_iff_tendsto_ℒp']
suffices h_eq :
(fun n => eLpNorm (⇑(f n) - ⇑(Memℒp.toLp f_lim f_lim_ℒp)) p μ) =
(fun n => eLpNorm (⇑(f n) - f_lim) p μ) by
rw [h_eq]
exact funext fun n => eLpNorm_congr_ae (EventuallyEq.rfl.sub (Memℒp.coeFn_toLp f_lim_ℒp))
theorem tendsto_Lp_iff_tendsto_ℒp'' {ι} {fi : Filter ι} [Fact (1 ≤ p)] (f : ι → α → E)
(f_ℒp : ∀ n, Memℒp (f n) p μ) (f_lim : α → E) (f_lim_ℒp : Memℒp f_lim p μ) :
fi.Tendsto (fun n => (f_ℒp n).toLp (f n)) (𝓝 (f_lim_ℒp.toLp f_lim)) ↔
fi.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0) := by
rw [Lp.tendsto_Lp_iff_tendsto_ℒp' (fun n => (f_ℒp n).toLp (f n)) (f_lim_ℒp.toLp f_lim)]
refine Filter.tendsto_congr fun n => ?_
apply eLpNorm_congr_ae
filter_upwards [((f_ℒp n).sub f_lim_ℒp).coeFn_toLp,
Lp.coeFn_sub ((f_ℒp n).toLp (f n)) (f_lim_ℒp.toLp f_lim)] with _ hx₁ hx₂
rw [← hx₂]
exact hx₁
theorem tendsto_Lp_of_tendsto_ℒp {ι} {fi : Filter ι} [Fact (1 ≤ p)] {f : ι → Lp E p μ}
(f_lim : α → E) (f_lim_ℒp : Memℒp f_lim p μ)
(h_tendsto : fi.Tendsto (fun n => eLpNorm (⇑(f n) - f_lim) p μ) (𝓝 0)) :
fi.Tendsto f (𝓝 (f_lim_ℒp.toLp f_lim)) :=
(tendsto_Lp_iff_tendsto_ℒp f f_lim f_lim_ℒp).mpr h_tendsto
theorem cauchySeq_Lp_iff_cauchySeq_ℒp {ι} [Nonempty ι] [SemilatticeSup ι] [hp : Fact (1 ≤ p)]
(f : ι → Lp E p μ) :
CauchySeq f ↔ Tendsto (fun n : ι × ι => eLpNorm (⇑(f n.fst) - ⇑(f n.snd)) p μ) atTop (𝓝 0) := by
simp_rw [cauchySeq_iff_tendsto_dist_atTop_0, dist_def]
rw [← ENNReal.zero_toReal, ENNReal.tendsto_toReal_iff (fun n => ?_) ENNReal.zero_ne_top]
rw [eLpNorm_congr_ae (Lp.coeFn_sub _ _).symm]
exact eLpNorm_ne_top _
theorem completeSpace_lp_of_cauchy_complete_ℒp [hp : Fact (1 ≤ p)]
(H :
∀ (f : ℕ → α → E) (hf : ∀ n, Memℒp (f n) p μ) (B : ℕ → ℝ≥0∞) (hB : ∑' i, B i < ∞)
(h_cau : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm (f n - f m) p μ < B N),
∃ (f_lim : α → E), Memℒp f_lim p μ ∧
atTop.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0)) :
CompleteSpace (Lp E p μ) := by
let B := fun n : ℕ => ((1 : ℝ) / 2) ^ n
have hB_pos : ∀ n, 0 < B n := fun n => pow_pos (div_pos zero_lt_one zero_lt_two) n
refine Metric.complete_of_convergent_controlled_sequences B hB_pos fun f hf => ?_
rsuffices ⟨f_lim, hf_lim_meas, h_tendsto⟩ :
∃ (f_lim : α → E), Memℒp f_lim p μ ∧
atTop.Tendsto (fun n => eLpNorm (⇑(f n) - f_lim) p μ) (𝓝 0)
· exact ⟨hf_lim_meas.toLp f_lim, tendsto_Lp_of_tendsto_ℒp f_lim hf_lim_meas h_tendsto⟩
obtain ⟨M, hB⟩ : Summable B := summable_geometric_two
let B1 n := ENNReal.ofReal (B n)
have hB1_has : HasSum B1 (ENNReal.ofReal M) := by
have h_tsum_B1 : ∑' i, B1 i = ENNReal.ofReal M := by
change (∑' n : ℕ, ENNReal.ofReal (B n)) = ENNReal.ofReal M
rw [← hB.tsum_eq]
exact (ENNReal.ofReal_tsum_of_nonneg (fun n => le_of_lt (hB_pos n)) hB.summable).symm
have h_sum := (@ENNReal.summable _ B1).hasSum
rwa [h_tsum_B1] at h_sum
have hB1 : ∑' i, B1 i < ∞ := by
rw [hB1_has.tsum_eq]
exact ENNReal.ofReal_lt_top
let f1 : ℕ → α → E := fun n => f n
refine H f1 (fun n => Lp.memℒp (f n)) B1 hB1 fun N n m hn hm => ?_
specialize hf N n m hn hm
rw [dist_def] at hf
dsimp only [f1]
rwa [ENNReal.lt_ofReal_iff_toReal_lt]
rw [eLpNorm_congr_ae (Lp.coeFn_sub _ _).symm]
exact Lp.eLpNorm_ne_top _
/-! ### Prove that controlled Cauchy sequences of `ℒp` have limits in `ℒp` -/
private theorem eLpNorm'_sum_norm_sub_le_tsum_of_cauchy_eLpNorm' {f : ℕ → α → E}
(hf : ∀ n, AEStronglyMeasurable (f n) μ) {p : ℝ} (hp1 : 1 ≤ p) {B : ℕ → ℝ≥0∞}
(h_cau : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm' (f n - f m) p μ < B N) (n : ℕ) :
eLpNorm' (fun x => ∑ i ∈ Finset.range (n + 1), ‖f (i + 1) x - f i x‖) p μ ≤ ∑' i, B i := by
let f_norm_diff i x := ‖f (i + 1) x - f i x‖
have hgf_norm_diff :
∀ n,
(fun x => ∑ i ∈ Finset.range (n + 1), ‖f (i + 1) x - f i x‖) =
∑ i ∈ Finset.range (n + 1), f_norm_diff i :=
fun n => funext fun x => by simp
rw [hgf_norm_diff]
refine (eLpNorm'_sum_le (fun i _ => ((hf (i + 1)).sub (hf i)).norm) hp1).trans ?_
simp_rw [eLpNorm'_norm]
refine (Finset.sum_le_sum ?_).trans (sum_le_tsum _ (fun m _ => zero_le _) ENNReal.summable)
exact fun m _ => (h_cau m (m + 1) m (Nat.le_succ m) (le_refl m)).le
@[deprecated (since := "2024-07-27")]
alias snorm'_sum_norm_sub_le_tsum_of_cauchy_snorm' :=
eLpNorm'_sum_norm_sub_le_tsum_of_cauchy_eLpNorm'
private theorem lintegral_rpow_sum_coe_nnnorm_sub_le_rpow_tsum
{f : ℕ → α → E} {p : ℝ} (hp1 : 1 ≤ p) {B : ℕ → ℝ≥0∞} (n : ℕ)
(hn : eLpNorm' (fun x => ∑ i ∈ Finset.range (n + 1), ‖f (i + 1) x - f i x‖) p μ ≤ ∑' i, B i) :
(∫⁻ a, (∑ i ∈ Finset.range (n + 1), ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) ≤
(∑' i, B i) ^ p := by
have hp_pos : 0 < p := zero_lt_one.trans_le hp1
rw [← inv_inv p, @ENNReal.le_rpow_inv_iff _ _ p⁻¹ (by simp [hp_pos]), inv_inv p]
simp_rw [eLpNorm', one_div] at hn
have h_nnnorm_nonneg :
(fun a => (‖∑ i ∈ Finset.range (n + 1), ‖f (i + 1) a - f i a‖‖₊ : ℝ≥0∞) ^ p) = fun a =>
(∑ i ∈ Finset.range (n + 1), (‖f (i + 1) a - f i a‖₊ : ℝ≥0∞)) ^ p := by
ext1 a
congr
simp_rw [← ofReal_norm_eq_coe_nnnorm]
rw [← ENNReal.ofReal_sum_of_nonneg]
· rw [Real.norm_of_nonneg _]
exact Finset.sum_nonneg fun x _ => norm_nonneg _
· exact fun x _ => norm_nonneg _
change
(∫⁻ a, (fun x => ↑‖∑ i ∈ Finset.range (n + 1), ‖f (i + 1) x - f i x‖‖₊ ^ p) a ∂μ) ^ p⁻¹ ≤
∑' i, B i at hn
rwa [h_nnnorm_nonneg] at hn
private theorem lintegral_rpow_tsum_coe_nnnorm_sub_le_tsum {f : ℕ → α → E}
(hf : ∀ n, AEStronglyMeasurable (f n) μ) {p : ℝ} (hp1 : 1 ≤ p) {B : ℕ → ℝ≥0∞}
(h :
∀ n,
(∫⁻ a, (∑ i ∈ Finset.range (n + 1), ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) ≤
(∑' i, B i) ^ p) :
(∫⁻ a, (∑' i, ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) ^ (1 / p) ≤ ∑' i, B i := by
have hp_pos : 0 < p := zero_lt_one.trans_le hp1
suffices h_pow : (∫⁻ a, (∑' i, ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) ≤ (∑' i, B i) ^ p by
rwa [one_div, ← ENNReal.le_rpow_inv_iff (by simp [hp_pos] : 0 < p⁻¹), inv_inv]
have h_tsum_1 :
∀ g : ℕ → ℝ≥0∞, ∑' i, g i = atTop.liminf fun n => ∑ i ∈ Finset.range (n + 1), g i := by
intro g
rw [ENNReal.tsum_eq_liminf_sum_nat, ← liminf_nat_add _ 1]
simp_rw [h_tsum_1 _]
rw [← h_tsum_1]
have h_liminf_pow :
(∫⁻ a, (atTop.liminf
fun n => ∑ i ∈ Finset.range (n + 1), (‖f (i + 1) a - f i a‖₊ : ℝ≥0∞)) ^ p ∂μ) =
∫⁻ a, atTop.liminf
fun n => (∑ i ∈ Finset.range (n + 1), (‖f (i + 1) a - f i a‖₊ : ℝ≥0∞)) ^ p ∂μ := by
refine lintegral_congr fun x => ?_
have h_rpow_mono := ENNReal.strictMono_rpow_of_pos (zero_lt_one.trans_le hp1)
have h_rpow_surj := (ENNReal.rpow_left_bijective hp_pos.ne.symm).2
refine (h_rpow_mono.orderIsoOfSurjective _ h_rpow_surj).liminf_apply ?_ ?_ ?_ ?_
all_goals isBoundedDefault
rw [h_liminf_pow]
refine (lintegral_liminf_le' ?_).trans ?_
· exact fun n =>
(Finset.aemeasurable_sum (Finset.range (n + 1)) fun i _ =>
((hf (i + 1)).sub (hf i)).ennnorm).pow_const
_
· exact liminf_le_of_frequently_le' (frequently_of_forall h)
private theorem tsum_nnnorm_sub_ae_lt_top {f : ℕ → α → E} (hf : ∀ n, AEStronglyMeasurable (f n) μ)
{p : ℝ} (hp1 : 1 ≤ p) {B : ℕ → ℝ≥0∞} (hB : ∑' i, B i ≠ ∞)
(h : (∫⁻ a, (∑' i, ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) ^ (1 / p) ≤ ∑' i, B i) :
∀ᵐ x ∂μ, (∑' i, ‖f (i + 1) x - f i x‖₊ : ℝ≥0∞) < ∞ := by
have hp_pos : 0 < p := zero_lt_one.trans_le hp1
have h_integral : (∫⁻ a, (∑' i, ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) < ∞ := by
have h_tsum_lt_top : (∑' i, B i) ^ p < ∞ := ENNReal.rpow_lt_top_of_nonneg hp_pos.le hB
refine lt_of_le_of_lt ?_ h_tsum_lt_top
rwa [one_div, ← ENNReal.le_rpow_inv_iff (by simp [hp_pos] : 0 < p⁻¹), inv_inv] at h
have rpow_ae_lt_top : ∀ᵐ x ∂μ, (∑' i, ‖f (i + 1) x - f i x‖₊ : ℝ≥0∞) ^ p < ∞ := by
refine ae_lt_top' (AEMeasurable.pow_const ?_ _) h_integral.ne
exact AEMeasurable.ennreal_tsum fun n => ((hf (n + 1)).sub (hf n)).ennnorm
refine rpow_ae_lt_top.mono fun x hx => ?_
rwa [← ENNReal.lt_rpow_inv_iff hp_pos,
ENNReal.top_rpow_of_pos (by simp [hp_pos] : 0 < p⁻¹)] at hx
theorem ae_tendsto_of_cauchy_eLpNorm' [CompleteSpace E] {f : ℕ → α → E} {p : ℝ}
(hf : ∀ n, AEStronglyMeasurable (f n) μ) (hp1 : 1 ≤ p) {B : ℕ → ℝ≥0∞} (hB : ∑' i, B i ≠ ∞)
(h_cau : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm' (f n - f m) p μ < B N) :
∀ᵐ x ∂μ, ∃ l : E, atTop.Tendsto (fun n => f n x) (𝓝 l) := by
have h_summable : ∀ᵐ x ∂μ, Summable fun i : ℕ => f (i + 1) x - f i x := by
have h1 :
∀ n, eLpNorm' (fun x => ∑ i ∈ Finset.range (n + 1), ‖f (i + 1) x - f i x‖) p μ ≤ ∑' i, B i :=
eLpNorm'_sum_norm_sub_le_tsum_of_cauchy_eLpNorm' hf hp1 h_cau
have h2 :
∀ n,
(∫⁻ a, (∑ i ∈ Finset.range (n + 1), ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) ≤
(∑' i, B i) ^ p :=
fun n => lintegral_rpow_sum_coe_nnnorm_sub_le_rpow_tsum hp1 n (h1 n)
have h3 : (∫⁻ a, (∑' i, ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) ^ (1 / p) ≤ ∑' i, B i :=
lintegral_rpow_tsum_coe_nnnorm_sub_le_tsum hf hp1 h2
have h4 : ∀ᵐ x ∂μ, (∑' i, ‖f (i + 1) x - f i x‖₊ : ℝ≥0∞) < ∞ :=
tsum_nnnorm_sub_ae_lt_top hf hp1 hB h3
exact h4.mono fun x hx => .of_nnnorm <| ENNReal.tsum_coe_ne_top_iff_summable.mp hx.ne
have h :
∀ᵐ x ∂μ, ∃ l : E,
atTop.Tendsto (fun n => ∑ i ∈ Finset.range n, (f (i + 1) x - f i x)) (𝓝 l) := by
refine h_summable.mono fun x hx => ?_
let hx_sum := hx.hasSum.tendsto_sum_nat
exact ⟨∑' i, (f (i + 1) x - f i x), hx_sum⟩
refine h.mono fun x hx => ?_
cases' hx with l hx
have h_rw_sum :
(fun n => ∑ i ∈ Finset.range n, (f (i + 1) x - f i x)) = fun n => f n x - f 0 x := by
ext1 n
change
(∑ i ∈ Finset.range n, ((fun m => f m x) (i + 1) - (fun m => f m x) i)) = f n x - f 0 x
rw [Finset.sum_range_sub (fun m => f m x)]
rw [h_rw_sum] at hx
have hf_rw : (fun n => f n x) = fun n => f n x - f 0 x + f 0 x := by
ext1 n
abel
rw [hf_rw]
exact ⟨l + f 0 x, Tendsto.add_const _ hx⟩
@[deprecated (since := "2024-07-27")]
alias ae_tendsto_of_cauchy_snorm' := ae_tendsto_of_cauchy_eLpNorm'
theorem ae_tendsto_of_cauchy_eLpNorm [CompleteSpace E] {f : ℕ → α → E}
(hf : ∀ n, AEStronglyMeasurable (f n) μ) (hp : 1 ≤ p) {B : ℕ → ℝ≥0∞} (hB : ∑' i, B i ≠ ∞)
(h_cau : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm (f n - f m) p μ < B N) :
∀ᵐ x ∂μ, ∃ l : E, atTop.Tendsto (fun n => f n x) (𝓝 l) := by
by_cases hp_top : p = ∞
· simp_rw [hp_top] at *
have h_cau_ae : ∀ᵐ x ∂μ, ∀ N n m, N ≤ n → N ≤ m → (‖(f n - f m) x‖₊ : ℝ≥0∞) < B N := by
simp_rw [ae_all_iff]
exact fun N n m hnN hmN => ae_lt_of_essSup_lt (h_cau N n m hnN hmN)
simp_rw [eLpNorm_exponent_top, eLpNormEssSup] at h_cau
refine h_cau_ae.mono fun x hx => cauchySeq_tendsto_of_complete ?_
refine cauchySeq_of_le_tendsto_0 (fun n => (B n).toReal) ?_ ?_
· intro n m N hnN hmN
specialize hx N n m hnN hmN
rw [_root_.dist_eq_norm, ← ENNReal.toReal_ofReal (norm_nonneg _),
ENNReal.toReal_le_toReal ENNReal.ofReal_ne_top (ENNReal.ne_top_of_tsum_ne_top hB N)]
rw [← ofReal_norm_eq_coe_nnnorm] at hx
exact hx.le
· rw [← ENNReal.zero_toReal]
exact
Tendsto.comp (g := ENNReal.toReal) (ENNReal.tendsto_toReal ENNReal.zero_ne_top)
(ENNReal.tendsto_atTop_zero_of_tsum_ne_top hB)
have hp1 : 1 ≤ p.toReal := by
rw [← ENNReal.ofReal_le_iff_le_toReal hp_top, ENNReal.ofReal_one]
exact hp
have h_cau' : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm' (f n - f m) p.toReal μ < B N := by
intro N n m hn hm
specialize h_cau N n m hn hm
rwa [eLpNorm_eq_eLpNorm' (zero_lt_one.trans_le hp).ne.symm hp_top] at h_cau
exact ae_tendsto_of_cauchy_eLpNorm' hf hp1 hB h_cau'
@[deprecated (since := "2024-07-27")]
alias ae_tendsto_of_cauchy_snorm := ae_tendsto_of_cauchy_eLpNorm
theorem cauchy_tendsto_of_tendsto {f : ℕ → α → E} (hf : ∀ n, AEStronglyMeasurable (f n) μ)
(f_lim : α → E) {B : ℕ → ℝ≥0∞} (hB : ∑' i, B i ≠ ∞)
(h_cau : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm (f n - f m) p μ < B N)
(h_lim : ∀ᵐ x : α ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))) :
atTop.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0) := by
rw [ENNReal.tendsto_atTop_zero]
intro ε hε
have h_B : ∃ N : ℕ, B N ≤ ε := by
suffices h_tendsto_zero : ∃ N : ℕ, ∀ n : ℕ, N ≤ n → B n ≤ ε from
⟨h_tendsto_zero.choose, h_tendsto_zero.choose_spec _ le_rfl⟩
exact (ENNReal.tendsto_atTop_zero.mp (ENNReal.tendsto_atTop_zero_of_tsum_ne_top hB)) ε hε
cases' h_B with N h_B
refine ⟨N, fun n hn => ?_⟩
have h_sub : eLpNorm (f n - f_lim) p μ ≤ atTop.liminf fun m => eLpNorm (f n - f m) p μ := by
refine eLpNorm_lim_le_liminf_eLpNorm (fun m => (hf n).sub (hf m)) (f n - f_lim) ?_
refine h_lim.mono fun x hx => ?_
simp_rw [sub_eq_add_neg]
exact Tendsto.add tendsto_const_nhds (Tendsto.neg hx)
refine h_sub.trans ?_
refine liminf_le_of_frequently_le' (frequently_atTop.mpr ?_)
refine fun N1 => ⟨max N N1, le_max_right _ _, ?_⟩
exact (h_cau N n (max N N1) hn (le_max_left _ _)).le.trans h_B
theorem memℒp_of_cauchy_tendsto (hp : 1 ≤ p) {f : ℕ → α → E} (hf : ∀ n, Memℒp (f n) p μ)
(f_lim : α → E) (h_lim_meas : AEStronglyMeasurable f_lim μ)
(h_tendsto : atTop.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0)) : Memℒp f_lim p μ := by
refine ⟨h_lim_meas, ?_⟩
rw [ENNReal.tendsto_atTop_zero] at h_tendsto
cases' h_tendsto 1 zero_lt_one with N h_tendsto_1
specialize h_tendsto_1 N (le_refl N)
have h_add : f_lim = f_lim - f N + f N := by abel
rw [h_add]
refine lt_of_le_of_lt (eLpNorm_add_le (h_lim_meas.sub (hf N).1) (hf N).1 hp) ?_
rw [ENNReal.add_lt_top]
constructor
· refine lt_of_le_of_lt ?_ ENNReal.one_lt_top
have h_neg : f_lim - f N = -(f N - f_lim) := by simp
rwa [h_neg, eLpNorm_neg]
· exact (hf N).2
theorem cauchy_complete_ℒp [CompleteSpace E] (hp : 1 ≤ p) {f : ℕ → α → E}
(hf : ∀ n, Memℒp (f n) p μ) {B : ℕ → ℝ≥0∞} (hB : ∑' i, B i ≠ ∞)
(h_cau : ∀ N n m : ℕ, N ≤ n → N ≤ m → eLpNorm (f n - f m) p μ < B N) :
∃ (f_lim : α → E), Memℒp f_lim p μ ∧
atTop.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0) := by
obtain ⟨f_lim, h_f_lim_meas, h_lim⟩ :
∃ f_lim : α → E, StronglyMeasurable f_lim ∧
∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x)) :=
exists_stronglyMeasurable_limit_of_tendsto_ae (fun n => (hf n).1)
(ae_tendsto_of_cauchy_eLpNorm (fun n => (hf n).1) hp hB h_cau)
have h_tendsto' : atTop.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0) :=
cauchy_tendsto_of_tendsto (fun m => (hf m).1) f_lim hB h_cau h_lim
have h_ℒp_lim : Memℒp f_lim p μ :=
memℒp_of_cauchy_tendsto hp hf f_lim h_f_lim_meas.aestronglyMeasurable h_tendsto'
exact ⟨f_lim, h_ℒp_lim, h_tendsto'⟩
/-! ### `Lp` is complete for `1 ≤ p` -/
instance instCompleteSpace [CompleteSpace E] [hp : Fact (1 ≤ p)] : CompleteSpace (Lp E p μ) :=
completeSpace_lp_of_cauchy_complete_ℒp fun _f hf _B hB h_cau =>
cauchy_complete_ℒp hp.elim hf hB.ne h_cau
end Lp
end MeasureTheory
end CompleteSpace
/-! ### Continuous functions in `Lp` -/
open scoped BoundedContinuousFunction
open BoundedContinuousFunction
section
variable [TopologicalSpace α] [BorelSpace α] [SecondCountableTopologyEither α E]
variable (E p μ)
/-- An additive subgroup of `Lp E p μ`, consisting of the equivalence classes which contain a
bounded continuous representative. -/
def MeasureTheory.Lp.boundedContinuousFunction : AddSubgroup (Lp E p μ) :=
AddSubgroup.addSubgroupOf
((ContinuousMap.toAEEqFunAddHom μ).comp (toContinuousMapAddHom α E)).range (Lp E p μ)
variable {E p μ}
/-- By definition, the elements of `Lp.boundedContinuousFunction E p μ` are the elements of
`Lp E p μ` which contain a bounded continuous representative. -/
theorem MeasureTheory.Lp.mem_boundedContinuousFunction_iff {f : Lp E p μ} :
f ∈ MeasureTheory.Lp.boundedContinuousFunction E p μ ↔
∃ f₀ : α →ᵇ E, f₀.toContinuousMap.toAEEqFun μ = (f : α →ₘ[μ] E) :=
AddSubgroup.mem_addSubgroupOf
namespace BoundedContinuousFunction
variable [IsFiniteMeasure μ]
/-- A bounded continuous function on a finite-measure space is in `Lp`. -/
theorem mem_Lp (f : α →ᵇ E) : f.toContinuousMap.toAEEqFun μ ∈ Lp E p μ := by
refine Lp.mem_Lp_of_ae_bound ‖f‖ ?_
filter_upwards [f.toContinuousMap.coeFn_toAEEqFun μ] with x _
convert f.norm_coe_le_norm x using 2
/-- The `Lp`-norm of a bounded continuous function is at most a constant (depending on the measure
of the whole space) times its sup-norm. -/
theorem Lp_nnnorm_le (f : α →ᵇ E) :
‖(⟨f.toContinuousMap.toAEEqFun μ, mem_Lp f⟩ : Lp E p μ)‖₊ ≤
measureUnivNNReal μ ^ p.toReal⁻¹ * ‖f‖₊ := by
apply Lp.nnnorm_le_of_ae_bound
refine (f.toContinuousMap.coeFn_toAEEqFun μ).mono ?_
intro x hx
rw [← NNReal.coe_le_coe, coe_nnnorm, coe_nnnorm]
convert f.norm_coe_le_norm x using 2
/-- The `Lp`-norm of a bounded continuous function is at most a constant (depending on the measure
of the whole space) times its sup-norm. -/
theorem Lp_norm_le (f : α →ᵇ E) :
‖(⟨f.toContinuousMap.toAEEqFun μ, mem_Lp f⟩ : Lp E p μ)‖ ≤
measureUnivNNReal μ ^ p.toReal⁻¹ * ‖f‖ :=
Lp_nnnorm_le f
variable (p μ)
/-- The normed group homomorphism of considering a bounded continuous function on a finite-measure
space as an element of `Lp`. -/
def toLpHom [Fact (1 ≤ p)] : NormedAddGroupHom (α →ᵇ E) (Lp E p μ) :=
{ AddMonoidHom.codRestrict ((ContinuousMap.toAEEqFunAddHom μ).comp (toContinuousMapAddHom α E))
(Lp E p μ) mem_Lp with
bound' := ⟨_, Lp_norm_le⟩ }
theorem range_toLpHom [Fact (1 ≤ p)] :
((toLpHom p μ).range : AddSubgroup (Lp E p μ)) =
MeasureTheory.Lp.boundedContinuousFunction E p μ := by
symm
convert AddMonoidHom.addSubgroupOf_range_eq_of_le
((ContinuousMap.toAEEqFunAddHom μ).comp (toContinuousMapAddHom α E))
(by rintro - ⟨f, rfl⟩; exact mem_Lp f : _ ≤ Lp E p μ)
variable (𝕜 : Type*) [Fact (1 ≤ p)]
/-- The bounded linear map of considering a bounded continuous function on a finite-measure space
as an element of `Lp`. -/
def toLp [NormedField 𝕜] [NormedSpace 𝕜 E] : (α →ᵇ E) →L[𝕜] Lp E p μ :=
LinearMap.mkContinuous
(LinearMap.codRestrict (Lp.LpSubmodule E p μ 𝕜)
((ContinuousMap.toAEEqFunLinearMap μ).comp (toContinuousMapLinearMap α E 𝕜)) mem_Lp)
_ Lp_norm_le
theorem coeFn_toLp [NormedField 𝕜] [NormedSpace 𝕜 E] (f : α →ᵇ E) :
toLp (E := E) p μ 𝕜 f =ᵐ[μ] f :=
AEEqFun.coeFn_mk f _
variable {𝕜}
theorem range_toLp [NormedField 𝕜] [NormedSpace 𝕜 E] :
(LinearMap.range (toLp p μ 𝕜 : (α →ᵇ E) →L[𝕜] Lp E p μ)).toAddSubgroup =
MeasureTheory.Lp.boundedContinuousFunction E p μ :=
range_toLpHom p μ
variable {p}
theorem toLp_norm_le [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E] :
‖(toLp p μ 𝕜 : (α →ᵇ E) →L[𝕜] Lp E p μ)‖ ≤ measureUnivNNReal μ ^ p.toReal⁻¹ :=
LinearMap.mkContinuous_norm_le _ (measureUnivNNReal μ ^ p.toReal⁻¹).coe_nonneg _
theorem toLp_inj {f g : α →ᵇ E} [μ.IsOpenPosMeasure] [NormedField 𝕜] [NormedSpace 𝕜 E] :
toLp (E := E) p μ 𝕜 f = toLp (E := E) p μ 𝕜 g ↔ f = g := by
refine ⟨fun h => ?_, by tauto⟩
rw [← DFunLike.coe_fn_eq, ← (map_continuous f).ae_eq_iff_eq μ (map_continuous g)]
refine (coeFn_toLp p μ 𝕜 f).symm.trans (EventuallyEq.trans ?_ <| coeFn_toLp p μ 𝕜 g)
rw [h]
theorem toLp_injective [μ.IsOpenPosMeasure] [NormedField 𝕜] [NormedSpace 𝕜 E] :
Function.Injective (⇑(toLp p μ 𝕜 : (α →ᵇ E) →L[𝕜] Lp E p μ)) :=
fun _f _g hfg => (toLp_inj μ).mp hfg
end BoundedContinuousFunction
namespace ContinuousMap
variable [CompactSpace α] [IsFiniteMeasure μ]
variable (𝕜 : Type*) (p μ) [Fact (1 ≤ p)]
/-- The bounded linear map of considering a continuous function on a compact finite-measure
space `α` as an element of `Lp`. By definition, the norm on `C(α, E)` is the sup-norm, transferred
from the space `α →ᵇ E` of bounded continuous functions, so this construction is just a matter of
transferring the structure from `BoundedContinuousFunction.toLp` along the isometry. -/
def toLp [NormedField 𝕜] [NormedSpace 𝕜 E] : C(α, E) →L[𝕜] Lp E p μ :=
(BoundedContinuousFunction.toLp p μ 𝕜).comp
(linearIsometryBoundedOfCompact α E 𝕜).toLinearIsometry.toContinuousLinearMap
variable {𝕜}
theorem range_toLp [NormedField 𝕜] [NormedSpace 𝕜 E] :
(LinearMap.range (toLp p μ 𝕜 : C(α, E) →L[𝕜] Lp E p μ)).toAddSubgroup =
MeasureTheory.Lp.boundedContinuousFunction E p μ := by
refine SetLike.ext' ?_
have := (linearIsometryBoundedOfCompact α E 𝕜).surjective
convert Function.Surjective.range_comp this (BoundedContinuousFunction.toLp (E := E) p μ 𝕜)
rw [← BoundedContinuousFunction.range_toLp p μ (𝕜 := 𝕜), Submodule.coe_toAddSubgroup,
LinearMap.range_coe]
variable {p}
theorem coeFn_toLp [NormedField 𝕜] [NormedSpace 𝕜 E] (f : C(α, E)) :
toLp (E := E) p μ 𝕜 f =ᵐ[μ] f :=
AEEqFun.coeFn_mk f _
theorem toLp_def [NormedField 𝕜] [NormedSpace 𝕜 E] (f : C(α, E)) :
toLp (E := E) p μ 𝕜 f =
BoundedContinuousFunction.toLp (E := E) p μ 𝕜 (linearIsometryBoundedOfCompact α E 𝕜 f) :=
rfl
@[simp]
theorem toLp_comp_toContinuousMap [NormedField 𝕜] [NormedSpace 𝕜 E] (f : α →ᵇ E) :
toLp (E := E) p μ 𝕜 f.toContinuousMap = BoundedContinuousFunction.toLp (E := E) p μ 𝕜 f :=
rfl
@[simp]
theorem coe_toLp [NormedField 𝕜] [NormedSpace 𝕜 E] (f : C(α, E)) :
(toLp (E := E) p μ 𝕜 f : α →ₘ[μ] E) = f.toAEEqFun μ :=
rfl
theorem toLp_injective [μ.IsOpenPosMeasure] [NormedField 𝕜] [NormedSpace 𝕜 E] :
Function.Injective (⇑(toLp p μ 𝕜 : C(α, E) →L[𝕜] Lp E p μ)) :=
(BoundedContinuousFunction.toLp_injective _).comp (linearIsometryBoundedOfCompact α E 𝕜).injective
theorem toLp_inj {f g : C(α, E)} [μ.IsOpenPosMeasure] [NormedField 𝕜] [NormedSpace 𝕜 E] :
toLp (E := E) p μ 𝕜 f = toLp (E := E) p μ 𝕜 g ↔ f = g :=
(toLp_injective μ).eq_iff
variable {μ}
/-- If a sum of continuous functions `g n` is convergent, and the same sum converges in `Lᵖ` to `h`,
then in fact `g n` converges uniformly to `h`. -/
theorem hasSum_of_hasSum_Lp {β : Type*} [μ.IsOpenPosMeasure] [NormedField 𝕜] [NormedSpace 𝕜 E]
{g : β → C(α, E)} {f : C(α, E)} (hg : Summable g)
(hg2 : HasSum (toLp (E := E) p μ 𝕜 ∘ g) (toLp (E := E) p μ 𝕜 f)) : HasSum g f := by
convert Summable.hasSum hg
exact toLp_injective μ (hg2.unique ((toLp p μ 𝕜).hasSum <| Summable.hasSum hg))
variable (μ) [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
theorem toLp_norm_eq_toLp_norm_coe :
‖(toLp p μ 𝕜 : C(α, E) →L[𝕜] Lp E p μ)‖ =
‖(BoundedContinuousFunction.toLp p μ 𝕜 : (α →ᵇ E) →L[𝕜] Lp E p μ)‖ :=
ContinuousLinearMap.opNorm_comp_linearIsometryEquiv _ _
/-- Bound for the operator norm of `ContinuousMap.toLp`. -/
theorem toLp_norm_le :
‖(toLp p μ 𝕜 : C(α, E) →L[𝕜] Lp E p μ)‖ ≤ measureUnivNNReal μ ^ p.toReal⁻¹ := by
rw [toLp_norm_eq_toLp_norm_coe]
exact BoundedContinuousFunction.toLp_norm_le μ
end ContinuousMap
end
namespace MeasureTheory
namespace Lp
theorem pow_mul_meas_ge_le_norm (f : Lp E p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) (ε : ℝ≥0∞) :
(ε * μ { x | ε ≤ (‖f x‖₊ : ℝ≥0∞) ^ p.toReal }) ^ (1 / p.toReal) ≤ ENNReal.ofReal ‖f‖ :=
(ENNReal.ofReal_toReal (eLpNorm_ne_top f)).symm ▸
pow_mul_meas_ge_le_eLpNorm μ hp_ne_zero hp_ne_top (Lp.aestronglyMeasurable f) ε
theorem mul_meas_ge_le_pow_norm (f : Lp E p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) (ε : ℝ≥0∞) :
ε * μ { x | ε ≤ (‖f x‖₊ : ℝ≥0∞) ^ p.toReal } ≤ ENNReal.ofReal ‖f‖ ^ p.toReal :=
(ENNReal.ofReal_toReal (eLpNorm_ne_top f)).symm ▸
mul_meas_ge_le_pow_eLpNorm μ hp_ne_zero hp_ne_top (Lp.aestronglyMeasurable f) ε
/-- A version of Markov's inequality with elements of Lp. -/
theorem mul_meas_ge_le_pow_norm' (f : Lp E p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
(ε : ℝ≥0∞) : ε ^ p.toReal * μ { x | ε ≤ ‖f x‖₊ } ≤ ENNReal.ofReal ‖f‖ ^ p.toReal :=
(ENNReal.ofReal_toReal (eLpNorm_ne_top f)).symm ▸
mul_meas_ge_le_pow_eLpNorm' μ hp_ne_zero hp_ne_top (Lp.aestronglyMeasurable f) ε
theorem meas_ge_le_mul_pow_norm (f : Lp E p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) {ε : ℝ≥0∞}
(hε : ε ≠ 0) : μ { x | ε ≤ ‖f x‖₊ } ≤ ε⁻¹ ^ p.toReal * ENNReal.ofReal ‖f‖ ^ p.toReal :=
(ENNReal.ofReal_toReal (eLpNorm_ne_top f)).symm ▸
meas_ge_le_mul_pow_eLpNorm μ hp_ne_zero hp_ne_top (Lp.aestronglyMeasurable f) hε
end Lp
end MeasureTheory
|
MeasureTheory\Function\SimpleFunc.lean | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Johannes Hölzl
-/
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order
/-!
# Simple functions
A function `f` from a measurable space to any type is called *simple*, if every preimage `f ⁻¹' {x}`
is measurable, and the range is finite. In this file, we define simple functions and establish their
basic properties; and we construct a sequence of simple functions approximating an arbitrary Borel
measurable function `f : α → ℝ≥0∞`.
The theorem `Measurable.ennreal_induction` shows that in order to prove something for an arbitrary
measurable function into `ℝ≥0∞`, it is sufficient to show that the property holds for (multiples of)
characteristic functions and is closed under addition and supremum of increasing sequences of
functions.
-/
noncomputable section
open Set hiding restrict restrict_apply
open Filter ENNReal
open Function (support)
open scoped Classical
open Topology NNReal ENNReal MeasureTheory
namespace MeasureTheory
variable {α β γ δ : Type*}
/-- A function `f` from a measurable space to any type is called *simple*,
if every preimage `f ⁻¹' {x}` is measurable, and the range is finite. This structure bundles
a function with these properties. -/
structure SimpleFunc.{u, v} (α : Type u) [MeasurableSpace α] (β : Type v) where
toFun : α → β
measurableSet_fiber' : ∀ x, MeasurableSet (toFun ⁻¹' {x})
finite_range' : (Set.range toFun).Finite
local infixr:25 " →ₛ " => SimpleFunc
namespace SimpleFunc
section Measurable
variable [MeasurableSpace α]
instance instFunLike : FunLike (α →ₛ β) α β where
coe := toFun
coe_injective' | ⟨_, _, _⟩, ⟨_, _, _⟩, rfl => rfl
theorem coe_injective ⦃f g : α →ₛ β⦄ (H : (f : α → β) = g) : f = g := DFunLike.ext' H
@[ext]
theorem ext {f g : α →ₛ β} (H : ∀ a, f a = g a) : f = g := DFunLike.ext _ _ H
theorem finite_range (f : α →ₛ β) : (Set.range f).Finite :=
f.finite_range'
theorem measurableSet_fiber (f : α →ₛ β) (x : β) : MeasurableSet (f ⁻¹' {x}) :=
f.measurableSet_fiber' x
@[simp] theorem coe_mk (f : α → β) (h h') : ⇑(mk f h h') = f := rfl
theorem apply_mk (f : α → β) (h h') (x : α) : SimpleFunc.mk f h h' x = f x :=
rfl
/-- Simple function defined on a finite type. -/
def ofFinite [Finite α] [MeasurableSingletonClass α] (f : α → β) : α →ₛ β where
toFun := f
measurableSet_fiber' x := (toFinite (f ⁻¹' {x})).measurableSet
finite_range' := Set.finite_range f
@[deprecated (since := "2024-02-05")] alias ofFintype := ofFinite
/-- Simple function defined on the empty type. -/
def ofIsEmpty [IsEmpty α] : α →ₛ β := ofFinite isEmptyElim
/-- Range of a simple function `α →ₛ β` as a `Finset β`. -/
protected def range (f : α →ₛ β) : Finset β :=
f.finite_range.toFinset
@[simp]
theorem mem_range {f : α →ₛ β} {b} : b ∈ f.range ↔ b ∈ range f :=
Finite.mem_toFinset _
theorem mem_range_self (f : α →ₛ β) (x : α) : f x ∈ f.range :=
mem_range.2 ⟨x, rfl⟩
@[simp]
theorem coe_range (f : α →ₛ β) : (↑f.range : Set β) = Set.range f :=
f.finite_range.coe_toFinset
theorem mem_range_of_measure_ne_zero {f : α →ₛ β} {x : β} {μ : Measure α} (H : μ (f ⁻¹' {x}) ≠ 0) :
x ∈ f.range :=
let ⟨a, ha⟩ := nonempty_of_measure_ne_zero H
mem_range.2 ⟨a, ha⟩
theorem forall_mem_range {f : α →ₛ β} {p : β → Prop} : (∀ y ∈ f.range, p y) ↔ ∀ x, p (f x) := by
simp only [mem_range, Set.forall_mem_range]
theorem exists_range_iff {f : α →ₛ β} {p : β → Prop} : (∃ y ∈ f.range, p y) ↔ ∃ x, p (f x) := by
simpa only [mem_range, exists_prop] using Set.exists_range_iff
theorem preimage_eq_empty_iff (f : α →ₛ β) (b : β) : f ⁻¹' {b} = ∅ ↔ b ∉ f.range :=
preimage_singleton_eq_empty.trans <| not_congr mem_range.symm
theorem exists_forall_le [Nonempty β] [Preorder β] [IsDirected β (· ≤ ·)] (f : α →ₛ β) :
∃ C, ∀ x, f x ≤ C :=
f.range.exists_le.imp fun _ => forall_mem_range.1
/-- Constant function as a `SimpleFunc`. -/
def const (α) {β} [MeasurableSpace α] (b : β) : α →ₛ β :=
⟨fun _ => b, fun _ => MeasurableSet.const _, finite_range_const⟩
instance instInhabited [Inhabited β] : Inhabited (α →ₛ β) :=
⟨const _ default⟩
theorem const_apply (a : α) (b : β) : (const α b) a = b :=
rfl
@[simp]
theorem coe_const (b : β) : ⇑(const α b) = Function.const α b :=
rfl
@[simp]
theorem range_const (α) [MeasurableSpace α] [Nonempty α] (b : β) : (const α b).range = {b} :=
Finset.coe_injective <| by simp (config := { unfoldPartialApp := true }) [Function.const]
theorem range_const_subset (α) [MeasurableSpace α] (b : β) : (const α b).range ⊆ {b} :=
Finset.coe_subset.1 <| by simp
theorem simpleFunc_bot {α} (f : @SimpleFunc α ⊥ β) [Nonempty β] : ∃ c, ∀ x, f x = c := by
have hf_meas := @SimpleFunc.measurableSet_fiber α _ ⊥ f
simp_rw [MeasurableSpace.measurableSet_bot_iff] at hf_meas
exact (exists_eq_const_of_preimage_singleton hf_meas).imp fun c hc ↦ congr_fun hc
theorem simpleFunc_bot' {α} [Nonempty β] (f : @SimpleFunc α ⊥ β) :
∃ c, f = @SimpleFunc.const α _ ⊥ c :=
letI : MeasurableSpace α := ⊥; (simpleFunc_bot f).imp fun _ ↦ ext
theorem measurableSet_cut (r : α → β → Prop) (f : α →ₛ β) (h : ∀ b, MeasurableSet { a | r a b }) :
MeasurableSet { a | r a (f a) } := by
have : { a | r a (f a) } = ⋃ b ∈ range f, { a | r a b } ∩ f ⁻¹' {b} := by
ext a
suffices r a (f a) ↔ ∃ i, r a (f i) ∧ f a = f i by simpa
exact ⟨fun h => ⟨a, ⟨h, rfl⟩⟩, fun ⟨a', ⟨h', e⟩⟩ => e.symm ▸ h'⟩
rw [this]
exact
MeasurableSet.biUnion f.finite_range.countable fun b _ =>
MeasurableSet.inter (h b) (f.measurableSet_fiber _)
@[measurability]
theorem measurableSet_preimage (f : α →ₛ β) (s) : MeasurableSet (f ⁻¹' s) :=
measurableSet_cut (fun _ b => b ∈ s) f fun b => MeasurableSet.const (b ∈ s)
/-- A simple function is measurable -/
@[measurability]
protected theorem measurable [MeasurableSpace β] (f : α →ₛ β) : Measurable f := fun s _ =>
measurableSet_preimage f s
@[measurability]
protected theorem aemeasurable [MeasurableSpace β] {μ : Measure α} (f : α →ₛ β) :
AEMeasurable f μ :=
f.measurable.aemeasurable
protected theorem sum_measure_preimage_singleton (f : α →ₛ β) {μ : Measure α} (s : Finset β) :
(∑ y ∈ s, μ (f ⁻¹' {y})) = μ (f ⁻¹' ↑s) :=
sum_measure_preimage_singleton _ fun _ _ => f.measurableSet_fiber _
theorem sum_range_measure_preimage_singleton (f : α →ₛ β) (μ : Measure α) :
(∑ y ∈ f.range, μ (f ⁻¹' {y})) = μ univ := by
rw [f.sum_measure_preimage_singleton, coe_range, preimage_range]
/-- If-then-else as a `SimpleFunc`. -/
def piecewise (s : Set α) (hs : MeasurableSet s) (f g : α →ₛ β) : α →ₛ β :=
⟨s.piecewise f g, fun _ =>
letI : MeasurableSpace β := ⊤
f.measurable.piecewise hs g.measurable trivial,
(f.finite_range.union g.finite_range).subset range_ite_subset⟩
@[simp]
theorem coe_piecewise {s : Set α} (hs : MeasurableSet s) (f g : α →ₛ β) :
⇑(piecewise s hs f g) = s.piecewise f g :=
rfl
theorem piecewise_apply {s : Set α} (hs : MeasurableSet s) (f g : α →ₛ β) (a) :
piecewise s hs f g a = if a ∈ s then f a else g a :=
rfl
@[simp]
theorem piecewise_compl {s : Set α} (hs : MeasurableSet sᶜ) (f g : α →ₛ β) :
piecewise sᶜ hs f g = piecewise s hs.of_compl g f :=
coe_injective <| by
set_option tactic.skipAssignedInstances false in
simp [hs]; convert Set.piecewise_compl s f g
@[simp]
theorem piecewise_univ (f g : α →ₛ β) : piecewise univ MeasurableSet.univ f g = f :=
coe_injective <| by
set_option tactic.skipAssignedInstances false in
simp; convert Set.piecewise_univ f g
@[simp]
theorem piecewise_empty (f g : α →ₛ β) : piecewise ∅ MeasurableSet.empty f g = g :=
coe_injective <| by
set_option tactic.skipAssignedInstances false in
simp; convert Set.piecewise_empty f g
@[simp]
theorem piecewise_same (f : α →ₛ β) {s : Set α} (hs : MeasurableSet s) :
piecewise s hs f f = f :=
coe_injective <| Set.piecewise_same _ _
theorem support_indicator [Zero β] {s : Set α} (hs : MeasurableSet s) (f : α →ₛ β) :
Function.support (f.piecewise s hs (SimpleFunc.const α 0)) = s ∩ Function.support f :=
Set.support_indicator
theorem range_indicator {s : Set α} (hs : MeasurableSet s) (hs_nonempty : s.Nonempty)
(hs_ne_univ : s ≠ univ) (x y : β) :
(piecewise s hs (const α x) (const α y)).range = {x, y} := by
simp only [← Finset.coe_inj, coe_range, coe_piecewise, range_piecewise, coe_const,
Finset.coe_insert, Finset.coe_singleton, hs_nonempty.image_const,
(nonempty_compl.2 hs_ne_univ).image_const, singleton_union, Function.const]
theorem measurable_bind [MeasurableSpace γ] (f : α →ₛ β) (g : β → α → γ)
(hg : ∀ b, Measurable (g b)) : Measurable fun a => g (f a) a := fun s hs =>
f.measurableSet_cut (fun a b => g b a ∈ s) fun b => hg b hs
/-- If `f : α →ₛ β` is a simple function and `g : β → α →ₛ γ` is a family of simple functions,
then `f.bind g` binds the first argument of `g` to `f`. In other words, `f.bind g a = g (f a) a`. -/
def bind (f : α →ₛ β) (g : β → α →ₛ γ) : α →ₛ γ :=
⟨fun a => g (f a) a, fun c =>
f.measurableSet_cut (fun a b => g b a = c) fun b => (g b).measurableSet_preimage {c},
(f.finite_range.biUnion fun b _ => (g b).finite_range).subset <| by
rintro _ ⟨a, rfl⟩; simp⟩
@[simp]
theorem bind_apply (f : α →ₛ β) (g : β → α →ₛ γ) (a) : f.bind g a = g (f a) a :=
rfl
/-- Given a function `g : β → γ` and a simple function `f : α →ₛ β`, `f.map g` return the simple
function `g ∘ f : α →ₛ γ` -/
def map (g : β → γ) (f : α →ₛ β) : α →ₛ γ :=
bind f (const α ∘ g)
theorem map_apply (g : β → γ) (f : α →ₛ β) (a) : f.map g a = g (f a) :=
rfl
theorem map_map (g : β → γ) (h : γ → δ) (f : α →ₛ β) : (f.map g).map h = f.map (h ∘ g) :=
rfl
@[simp]
theorem coe_map (g : β → γ) (f : α →ₛ β) : (f.map g : α → γ) = g ∘ f :=
rfl
@[simp]
theorem range_map [DecidableEq γ] (g : β → γ) (f : α →ₛ β) : (f.map g).range = f.range.image g :=
Finset.coe_injective <| by simp only [coe_range, coe_map, Finset.coe_image, range_comp]
@[simp]
theorem map_const (g : β → γ) (b : β) : (const α b).map g = const α (g b) :=
rfl
theorem map_preimage (f : α →ₛ β) (g : β → γ) (s : Set γ) :
f.map g ⁻¹' s = f ⁻¹' ↑(f.range.filter fun b => g b ∈ s) := by
simp only [coe_range, sep_mem_eq, coe_map, Finset.coe_filter,
← mem_preimage, inter_comm, preimage_inter_range, ← Finset.mem_coe]
exact preimage_comp
theorem map_preimage_singleton (f : α →ₛ β) (g : β → γ) (c : γ) :
f.map g ⁻¹' {c} = f ⁻¹' ↑(f.range.filter fun b => g b = c) :=
map_preimage _ _ _
/-- Composition of a `SimpleFun` and a measurable function is a `SimpleFunc`. -/
def comp [MeasurableSpace β] (f : β →ₛ γ) (g : α → β) (hgm : Measurable g) : α →ₛ γ where
toFun := f ∘ g
finite_range' := f.finite_range.subset <| Set.range_comp_subset_range _ _
measurableSet_fiber' z := hgm (f.measurableSet_fiber z)
@[simp]
theorem coe_comp [MeasurableSpace β] (f : β →ₛ γ) {g : α → β} (hgm : Measurable g) :
⇑(f.comp g hgm) = f ∘ g :=
rfl
theorem range_comp_subset_range [MeasurableSpace β] (f : β →ₛ γ) {g : α → β} (hgm : Measurable g) :
(f.comp g hgm).range ⊆ f.range :=
Finset.coe_subset.1 <| by simp only [coe_range, coe_comp, Set.range_comp_subset_range]
/-- Extend a `SimpleFunc` along a measurable embedding: `f₁.extend g hg f₂` is the function
`F : β →ₛ γ` such that `F ∘ g = f₁` and `F y = f₂ y` whenever `y ∉ range g`. -/
def extend [MeasurableSpace β] (f₁ : α →ₛ γ) (g : α → β) (hg : MeasurableEmbedding g)
(f₂ : β →ₛ γ) : β →ₛ γ where
toFun := Function.extend g f₁ f₂
finite_range' :=
(f₁.finite_range.union <| f₂.finite_range.subset (image_subset_range _ _)).subset
(range_extend_subset _ _ _)
measurableSet_fiber' := by
letI : MeasurableSpace γ := ⊤; haveI : MeasurableSingletonClass γ := ⟨fun _ => trivial⟩
exact fun x => hg.measurable_extend f₁.measurable f₂.measurable (measurableSet_singleton _)
@[simp]
theorem extend_apply [MeasurableSpace β] (f₁ : α →ₛ γ) {g : α → β} (hg : MeasurableEmbedding g)
(f₂ : β →ₛ γ) (x : α) : (f₁.extend g hg f₂) (g x) = f₁ x :=
hg.injective.extend_apply _ _ _
@[simp]
theorem extend_apply' [MeasurableSpace β] (f₁ : α →ₛ γ) {g : α → β} (hg : MeasurableEmbedding g)
(f₂ : β →ₛ γ) {y : β} (h : ¬∃ x, g x = y) : (f₁.extend g hg f₂) y = f₂ y :=
Function.extend_apply' _ _ _ h
@[simp]
theorem extend_comp_eq' [MeasurableSpace β] (f₁ : α →ₛ γ) {g : α → β} (hg : MeasurableEmbedding g)
(f₂ : β →ₛ γ) : f₁.extend g hg f₂ ∘ g = f₁ :=
funext fun _ => extend_apply _ _ _ _
@[simp]
theorem extend_comp_eq [MeasurableSpace β] (f₁ : α →ₛ γ) {g : α → β} (hg : MeasurableEmbedding g)
(f₂ : β →ₛ γ) : (f₁.extend g hg f₂).comp g hg.measurable = f₁ :=
coe_injective <| extend_comp_eq' _ hg _
/-- If `f` is a simple function taking values in `β → γ` and `g` is another simple function
with the same domain and codomain `β`, then `f.seq g = f a (g a)`. -/
def seq (f : α →ₛ β → γ) (g : α →ₛ β) : α →ₛ γ :=
f.bind fun f => g.map f
@[simp]
theorem seq_apply (f : α →ₛ β → γ) (g : α →ₛ β) (a : α) : f.seq g a = f a (g a) :=
rfl
/-- Combine two simple functions `f : α →ₛ β` and `g : α →ₛ β`
into `fun a => (f a, g a)`. -/
def pair (f : α →ₛ β) (g : α →ₛ γ) : α →ₛ β × γ :=
(f.map Prod.mk).seq g
@[simp]
theorem pair_apply (f : α →ₛ β) (g : α →ₛ γ) (a) : pair f g a = (f a, g a) :=
rfl
theorem pair_preimage (f : α →ₛ β) (g : α →ₛ γ) (s : Set β) (t : Set γ) :
pair f g ⁻¹' s ×ˢ t = f ⁻¹' s ∩ g ⁻¹' t :=
rfl
-- A special form of `pair_preimage`
theorem pair_preimage_singleton (f : α →ₛ β) (g : α →ₛ γ) (b : β) (c : γ) :
pair f g ⁻¹' {(b, c)} = f ⁻¹' {b} ∩ g ⁻¹' {c} := by
rw [← singleton_prod_singleton]
exact pair_preimage _ _ _ _
theorem bind_const (f : α →ₛ β) : f.bind (const α) = f := by ext; simp
@[to_additive]
instance instOne [One β] : One (α →ₛ β) :=
⟨const α 1⟩
@[to_additive]
instance instMul [Mul β] : Mul (α →ₛ β) :=
⟨fun f g => (f.map (· * ·)).seq g⟩
@[to_additive]
instance instDiv [Div β] : Div (α →ₛ β) :=
⟨fun f g => (f.map (· / ·)).seq g⟩
@[to_additive]
instance instInv [Inv β] : Inv (α →ₛ β) :=
⟨fun f => f.map Inv.inv⟩
instance instSup [Sup β] : Sup (α →ₛ β) :=
⟨fun f g => (f.map (· ⊔ ·)).seq g⟩
instance instInf [Inf β] : Inf (α →ₛ β) :=
⟨fun f g => (f.map (· ⊓ ·)).seq g⟩
instance instLE [LE β] : LE (α →ₛ β) :=
⟨fun f g => ∀ a, f a ≤ g a⟩
@[to_additive (attr := simp)]
theorem const_one [One β] : const α (1 : β) = 1 :=
rfl
@[to_additive (attr := simp, norm_cast)]
theorem coe_one [One β] : ⇑(1 : α →ₛ β) = 1 :=
rfl
@[to_additive (attr := simp, norm_cast)]
theorem coe_mul [Mul β] (f g : α →ₛ β) : ⇑(f * g) = ⇑f * ⇑g :=
rfl
@[to_additive (attr := simp, norm_cast)]
theorem coe_inv [Inv β] (f : α →ₛ β) : ⇑(f⁻¹) = (⇑f)⁻¹ :=
rfl
@[to_additive (attr := simp, norm_cast)]
theorem coe_div [Div β] (f g : α →ₛ β) : ⇑(f / g) = ⇑f / ⇑g :=
rfl
@[simp, norm_cast]
theorem coe_le [Preorder β] {f g : α →ₛ β} : (f : α → β) ≤ g ↔ f ≤ g :=
Iff.rfl
@[simp, norm_cast]
theorem coe_sup [Sup β] (f g : α →ₛ β) : ⇑(f ⊔ g) = ⇑f ⊔ ⇑g :=
rfl
@[simp, norm_cast]
theorem coe_inf [Inf β] (f g : α →ₛ β) : ⇑(f ⊓ g) = ⇑f ⊓ ⇑g :=
rfl
@[to_additive]
theorem mul_apply [Mul β] (f g : α →ₛ β) (a : α) : (f * g) a = f a * g a :=
rfl
@[to_additive]
theorem div_apply [Div β] (f g : α →ₛ β) (x : α) : (f / g) x = f x / g x :=
rfl
@[to_additive]
theorem inv_apply [Inv β] (f : α →ₛ β) (x : α) : f⁻¹ x = (f x)⁻¹ :=
rfl
theorem sup_apply [Sup β] (f g : α →ₛ β) (a : α) : (f ⊔ g) a = f a ⊔ g a :=
rfl
theorem inf_apply [Inf β] (f g : α →ₛ β) (a : α) : (f ⊓ g) a = f a ⊓ g a :=
rfl
@[to_additive (attr := simp)]
theorem range_one [Nonempty α] [One β] : (1 : α →ₛ β).range = {1} :=
Finset.ext fun x => by simp [eq_comm]
@[simp]
theorem range_eq_empty_of_isEmpty {β} [hα : IsEmpty α] (f : α →ₛ β) : f.range = ∅ := by
rw [← Finset.not_nonempty_iff_eq_empty]
by_contra h
obtain ⟨y, hy_mem⟩ := h
rw [SimpleFunc.mem_range, Set.mem_range] at hy_mem
obtain ⟨x, hxy⟩ := hy_mem
rw [isEmpty_iff] at hα
exact hα x
theorem eq_zero_of_mem_range_zero [Zero β] : ∀ {y : β}, y ∈ (0 : α →ₛ β).range → y = 0 :=
@(forall_mem_range.2 fun _ => rfl)
@[to_additive]
theorem mul_eq_map₂ [Mul β] (f g : α →ₛ β) : f * g = (pair f g).map fun p : β × β => p.1 * p.2 :=
rfl
theorem sup_eq_map₂ [Sup β] (f g : α →ₛ β) : f ⊔ g = (pair f g).map fun p : β × β => p.1 ⊔ p.2 :=
rfl
@[to_additive]
theorem const_mul_eq_map [Mul β] (f : α →ₛ β) (b : β) : const α b * f = f.map fun a => b * a :=
rfl
@[to_additive]
theorem map_mul [Mul β] [Mul γ] {g : β → γ} (hg : ∀ x y, g (x * y) = g x * g y) (f₁ f₂ : α →ₛ β) :
(f₁ * f₂).map g = f₁.map g * f₂.map g :=
ext fun _ => hg _ _
variable {K : Type*}
@[to_additive]
instance instSMul [SMul K β] : SMul K (α →ₛ β) :=
⟨fun k f => f.map (k • ·)⟩
@[to_additive (attr := simp)]
theorem coe_smul [SMul K β] (c : K) (f : α →ₛ β) : ⇑(c • f) = c • ⇑f :=
rfl
@[to_additive (attr := simp)]
theorem smul_apply [SMul K β] (k : K) (f : α →ₛ β) (a : α) : (k • f) a = k • f a :=
rfl
instance hasNatSMul [AddMonoid β] : SMul ℕ (α →ₛ β) := inferInstance
@[to_additive existing hasNatSMul]
instance hasNatPow [Monoid β] : Pow (α →ₛ β) ℕ :=
⟨fun f n => f.map (· ^ n)⟩
@[simp]
theorem coe_pow [Monoid β] (f : α →ₛ β) (n : ℕ) : ⇑(f ^ n) = (⇑f) ^ n :=
rfl
theorem pow_apply [Monoid β] (n : ℕ) (f : α →ₛ β) (a : α) : (f ^ n) a = f a ^ n :=
rfl
instance hasIntPow [DivInvMonoid β] : Pow (α →ₛ β) ℤ :=
⟨fun f n => f.map (· ^ n)⟩
@[simp]
theorem coe_zpow [DivInvMonoid β] (f : α →ₛ β) (z : ℤ) : ⇑(f ^ z) = (⇑f) ^ z :=
rfl
theorem zpow_apply [DivInvMonoid β] (z : ℤ) (f : α →ₛ β) (a : α) : (f ^ z) a = f a ^ z :=
rfl
-- TODO: work out how to generate these instances with `to_additive`, which gets confused by the
-- argument order swap between `coe_smul` and `coe_pow`.
section Additive
instance instAddMonoid [AddMonoid β] : AddMonoid (α →ₛ β) :=
Function.Injective.addMonoid (fun f => show α → β from f) coe_injective coe_zero coe_add
fun _ _ => coe_smul _ _
instance instAddCommMonoid [AddCommMonoid β] : AddCommMonoid (α →ₛ β) :=
Function.Injective.addCommMonoid (fun f => show α → β from f) coe_injective coe_zero coe_add
fun _ _ => coe_smul _ _
instance instAddGroup [AddGroup β] : AddGroup (α →ₛ β) :=
Function.Injective.addGroup (fun f => show α → β from f) coe_injective coe_zero coe_add coe_neg
coe_sub (fun _ _ => coe_smul _ _) fun _ _ => coe_smul _ _
instance instAddCommGroup [AddCommGroup β] : AddCommGroup (α →ₛ β) :=
Function.Injective.addCommGroup (fun f => show α → β from f) coe_injective coe_zero coe_add
coe_neg coe_sub (fun _ _ => coe_smul _ _) fun _ _ => coe_smul _ _
end Additive
@[to_additive existing]
instance instMonoid [Monoid β] : Monoid (α →ₛ β) :=
Function.Injective.monoid (fun f => show α → β from f) coe_injective coe_one coe_mul coe_pow
@[to_additive existing]
instance instCommMonoid [CommMonoid β] : CommMonoid (α →ₛ β) :=
Function.Injective.commMonoid (fun f => show α → β from f) coe_injective coe_one coe_mul coe_pow
@[to_additive existing]
instance instGroup [Group β] : Group (α →ₛ β) :=
Function.Injective.group (fun f => show α → β from f) coe_injective coe_one coe_mul coe_inv
coe_div coe_pow coe_zpow
@[to_additive existing]
instance instCommGroup [CommGroup β] : CommGroup (α →ₛ β) :=
Function.Injective.commGroup (fun f => show α → β from f) coe_injective coe_one coe_mul coe_inv
coe_div coe_pow coe_zpow
instance instModule [Semiring K] [AddCommMonoid β] [Module K β] : Module K (α →ₛ β) :=
Function.Injective.module K ⟨⟨fun f => show α → β from f, coe_zero⟩, coe_add⟩
coe_injective coe_smul
theorem smul_eq_map [SMul K β] (k : K) (f : α →ₛ β) : k • f = f.map (k • ·) :=
rfl
instance instPreorder [Preorder β] : Preorder (α →ₛ β) :=
{ SimpleFunc.instLE with
le_refl := fun f a => le_rfl
le_trans := fun f g h hfg hgh a => le_trans (hfg _) (hgh a) }
instance instPartialOrder [PartialOrder β] : PartialOrder (α →ₛ β) :=
{ SimpleFunc.instPreorder with
le_antisymm := fun _f _g hfg hgf => ext fun a => le_antisymm (hfg a) (hgf a) }
instance instOrderBot [LE β] [OrderBot β] : OrderBot (α →ₛ β) where
bot := const α ⊥
bot_le _ _ := bot_le
instance instOrderTop [LE β] [OrderTop β] : OrderTop (α →ₛ β) where
top := const α ⊤
le_top _ _ := le_top
instance instSemilatticeInf [SemilatticeInf β] : SemilatticeInf (α →ₛ β) :=
{ SimpleFunc.instPartialOrder with
inf := (· ⊓ ·)
inf_le_left := fun _ _ _ => inf_le_left
inf_le_right := fun _ _ _ => inf_le_right
le_inf := fun _f _g _h hfh hgh a => le_inf (hfh a) (hgh a) }
instance instSemilatticeSup [SemilatticeSup β] : SemilatticeSup (α →ₛ β) :=
{ SimpleFunc.instPartialOrder with
sup := (· ⊔ ·)
le_sup_left := fun _ _ _ => le_sup_left
le_sup_right := fun _ _ _ => le_sup_right
sup_le := fun _f _g _h hfh hgh a => sup_le (hfh a) (hgh a) }
instance instLattice [Lattice β] : Lattice (α →ₛ β) :=
{ SimpleFunc.instSemilatticeSup, SimpleFunc.instSemilatticeInf with }
instance instBoundedOrder [LE β] [BoundedOrder β] : BoundedOrder (α →ₛ β) :=
{ SimpleFunc.instOrderBot, SimpleFunc.instOrderTop with }
theorem finset_sup_apply [SemilatticeSup β] [OrderBot β] {f : γ → α →ₛ β} (s : Finset γ) (a : α) :
s.sup f a = s.sup fun c => f c a := by
refine Finset.induction_on s rfl ?_
intro a s _ ih
rw [Finset.sup_insert, Finset.sup_insert, sup_apply, ih]
section Restrict
variable [Zero β]
/-- Restrict a simple function `f : α →ₛ β` to a set `s`. If `s` is measurable,
then `f.restrict s a = if a ∈ s then f a else 0`, otherwise `f.restrict s = const α 0`. -/
def restrict (f : α →ₛ β) (s : Set α) : α →ₛ β :=
if hs : MeasurableSet s then piecewise s hs f 0 else 0
theorem restrict_of_not_measurable {f : α →ₛ β} {s : Set α} (hs : ¬MeasurableSet s) :
restrict f s = 0 :=
dif_neg hs
@[simp]
theorem coe_restrict (f : α →ₛ β) {s : Set α} (hs : MeasurableSet s) :
⇑(restrict f s) = indicator s f := by
rw [restrict, dif_pos hs, coe_piecewise, coe_zero, piecewise_eq_indicator]
@[simp]
theorem restrict_univ (f : α →ₛ β) : restrict f univ = f := by simp [restrict]
@[simp]
theorem restrict_empty (f : α →ₛ β) : restrict f ∅ = 0 := by simp [restrict]
theorem map_restrict_of_zero [Zero γ] {g : β → γ} (hg : g 0 = 0) (f : α →ₛ β) (s : Set α) :
(f.restrict s).map g = (f.map g).restrict s :=
ext fun x =>
if hs : MeasurableSet s then by simp [hs, Set.indicator_comp_of_zero hg]
else by simp [restrict_of_not_measurable hs, hg]
theorem map_coe_ennreal_restrict (f : α →ₛ ℝ≥0) (s : Set α) :
(f.restrict s).map ((↑) : ℝ≥0 → ℝ≥0∞) = (f.map (↑)).restrict s :=
map_restrict_of_zero ENNReal.coe_zero _ _
theorem map_coe_nnreal_restrict (f : α →ₛ ℝ≥0) (s : Set α) :
(f.restrict s).map ((↑) : ℝ≥0 → ℝ) = (f.map (↑)).restrict s :=
map_restrict_of_zero NNReal.coe_zero _ _
theorem restrict_apply (f : α →ₛ β) {s : Set α} (hs : MeasurableSet s) (a) :
restrict f s a = indicator s f a := by simp only [f.coe_restrict hs]
theorem restrict_preimage (f : α →ₛ β) {s : Set α} (hs : MeasurableSet s) {t : Set β}
(ht : (0 : β) ∉ t) : restrict f s ⁻¹' t = s ∩ f ⁻¹' t := by
simp [hs, indicator_preimage_of_not_mem _ _ ht, inter_comm]
theorem restrict_preimage_singleton (f : α →ₛ β) {s : Set α} (hs : MeasurableSet s) {r : β}
(hr : r ≠ 0) : restrict f s ⁻¹' {r} = s ∩ f ⁻¹' {r} :=
f.restrict_preimage hs hr.symm
theorem mem_restrict_range {r : β} {s : Set α} {f : α →ₛ β} (hs : MeasurableSet s) :
r ∈ (restrict f s).range ↔ r = 0 ∧ s ≠ univ ∨ r ∈ f '' s := by
rw [← Finset.mem_coe, coe_range, coe_restrict _ hs, mem_range_indicator]
theorem mem_image_of_mem_range_restrict {r : β} {s : Set α} {f : α →ₛ β}
(hr : r ∈ (restrict f s).range) (h0 : r ≠ 0) : r ∈ f '' s :=
if hs : MeasurableSet s then by simpa [mem_restrict_range hs, h0, -mem_range] using hr
else by
rw [restrict_of_not_measurable hs] at hr
exact (h0 <| eq_zero_of_mem_range_zero hr).elim
@[mono]
theorem restrict_mono [Preorder β] (s : Set α) {f g : α →ₛ β} (H : f ≤ g) :
f.restrict s ≤ g.restrict s :=
if hs : MeasurableSet s then fun x => by
simp only [coe_restrict _ hs, indicator_le_indicator (H x)]
else by simp only [restrict_of_not_measurable hs, le_refl]
end Restrict
section Approx
section
variable [SemilatticeSup β] [OrderBot β] [Zero β]
/-- Fix a sequence `i : ℕ → β`. Given a function `α → β`, its `n`-th approximation
by simple functions is defined so that in case `β = ℝ≥0∞` it sends each `a` to the supremum
of the set `{i k | k ≤ n ∧ i k ≤ f a}`, see `approx_apply` and `iSup_approx_apply` for details. -/
def approx (i : ℕ → β) (f : α → β) (n : ℕ) : α →ₛ β :=
(Finset.range n).sup fun k => restrict (const α (i k)) { a : α | i k ≤ f a }
theorem approx_apply [TopologicalSpace β] [OrderClosedTopology β] [MeasurableSpace β]
[OpensMeasurableSpace β] {i : ℕ → β} {f : α → β} {n : ℕ} (a : α) (hf : Measurable f) :
(approx i f n : α →ₛ β) a = (Finset.range n).sup fun k => if i k ≤ f a then i k else 0 := by
dsimp only [approx]
rw [finset_sup_apply]
congr
funext k
rw [restrict_apply]
· simp only [coe_const, mem_setOf_eq, indicator_apply, Function.const_apply]
· exact hf measurableSet_Ici
theorem monotone_approx (i : ℕ → β) (f : α → β) : Monotone (approx i f) := fun _ _ h =>
Finset.sup_mono <| Finset.range_subset.2 h
theorem approx_comp [TopologicalSpace β] [OrderClosedTopology β] [MeasurableSpace β]
[OpensMeasurableSpace β] [MeasurableSpace γ] {i : ℕ → β} {f : γ → β} {g : α → γ} {n : ℕ} (a : α)
(hf : Measurable f) (hg : Measurable g) :
(approx i (f ∘ g) n : α →ₛ β) a = (approx i f n : γ →ₛ β) (g a) := by
rw [approx_apply _ hf, approx_apply _ (hf.comp hg), Function.comp_apply]
end
theorem iSup_approx_apply [TopologicalSpace β] [CompleteLattice β] [OrderClosedTopology β] [Zero β]
[MeasurableSpace β] [OpensMeasurableSpace β] (i : ℕ → β) (f : α → β) (a : α) (hf : Measurable f)
(h_zero : (0 : β) = ⊥) : ⨆ n, (approx i f n : α →ₛ β) a = ⨆ (k) (_ : i k ≤ f a), i k := by
refine le_antisymm (iSup_le fun n => ?_) (iSup_le fun k => iSup_le fun hk => ?_)
· rw [approx_apply a hf, h_zero]
refine Finset.sup_le fun k _ => ?_
split_ifs with h
· exact le_iSup_of_le k (le_iSup (fun _ : i k ≤ f a => i k) h)
· exact bot_le
· refine le_iSup_of_le (k + 1) ?_
rw [approx_apply a hf]
have : k ∈ Finset.range (k + 1) := Finset.mem_range.2 (Nat.lt_succ_self _)
refine le_trans (le_of_eq ?_) (Finset.le_sup this)
rw [if_pos hk]
end Approx
section EApprox
/-- A sequence of `ℝ≥0∞`s such that its range is the set of non-negative rational numbers. -/
def ennrealRatEmbed (n : ℕ) : ℝ≥0∞ :=
ENNReal.ofReal ((Encodable.decode (α := ℚ) n).getD (0 : ℚ))
theorem ennrealRatEmbed_encode (q : ℚ) :
ennrealRatEmbed (Encodable.encode q) = Real.toNNReal q := by
rw [ennrealRatEmbed, Encodable.encodek]; rfl
/-- Approximate a function `α → ℝ≥0∞` by a sequence of simple functions. -/
def eapprox : (α → ℝ≥0∞) → ℕ → α →ₛ ℝ≥0∞ :=
approx ennrealRatEmbed
theorem eapprox_lt_top (f : α → ℝ≥0∞) (n : ℕ) (a : α) : eapprox f n a < ∞ := by
simp only [eapprox, approx, finset_sup_apply, Finset.mem_range, ENNReal.bot_eq_zero, restrict]
rw [Finset.sup_lt_iff (α := ℝ≥0∞) WithTop.zero_lt_top]
intro b _
split_ifs
· simp only [coe_zero, coe_piecewise, piecewise_eq_indicator, coe_const]
calc
{ a : α | ennrealRatEmbed b ≤ f a }.indicator (fun _ => ennrealRatEmbed b) a ≤
ennrealRatEmbed b :=
indicator_le_self _ _ a
_ < ⊤ := ENNReal.coe_lt_top
· exact WithTop.zero_lt_top
@[mono]
theorem monotone_eapprox (f : α → ℝ≥0∞) : Monotone (eapprox f) :=
monotone_approx _ f
theorem iSup_eapprox_apply (f : α → ℝ≥0∞) (hf : Measurable f) (a : α) :
⨆ n, (eapprox f n : α →ₛ ℝ≥0∞) a = f a := by
rw [eapprox, iSup_approx_apply ennrealRatEmbed f a hf rfl]
refine le_antisymm (iSup_le fun i => iSup_le fun hi => hi) (le_of_not_gt ?_)
intro h
rcases ENNReal.lt_iff_exists_rat_btwn.1 h with ⟨q, _, lt_q, q_lt⟩
have :
(Real.toNNReal q : ℝ≥0∞) ≤ ⨆ (k : ℕ) (_ : ennrealRatEmbed k ≤ f a), ennrealRatEmbed k := by
refine le_iSup_of_le (Encodable.encode q) ?_
rw [ennrealRatEmbed_encode q]
exact le_iSup_of_le (le_of_lt q_lt) le_rfl
exact lt_irrefl _ (lt_of_le_of_lt this lt_q)
theorem eapprox_comp [MeasurableSpace γ] {f : γ → ℝ≥0∞} {g : α → γ} {n : ℕ} (hf : Measurable f)
(hg : Measurable g) : (eapprox (f ∘ g) n : α → ℝ≥0∞) = (eapprox f n : γ →ₛ ℝ≥0∞) ∘ g :=
funext fun a => approx_comp a hf hg
/-- Approximate a function `α → ℝ≥0∞` by a series of simple functions taking their values
in `ℝ≥0`. -/
def eapproxDiff (f : α → ℝ≥0∞) : ℕ → α →ₛ ℝ≥0
| 0 => (eapprox f 0).map ENNReal.toNNReal
| n + 1 => (eapprox f (n + 1) - eapprox f n).map ENNReal.toNNReal
theorem sum_eapproxDiff (f : α → ℝ≥0∞) (n : ℕ) (a : α) :
(∑ k ∈ Finset.range (n + 1), (eapproxDiff f k a : ℝ≥0∞)) = eapprox f n a := by
induction' n with n IH
· simp only [Nat.zero_eq, Nat.zero_add, Finset.sum_singleton, Finset.range_one]
rfl
· erw [Finset.sum_range_succ, IH, eapproxDiff, coe_map, Function.comp_apply,
coe_sub, Pi.sub_apply, ENNReal.coe_toNNReal,
add_tsub_cancel_of_le (monotone_eapprox f (Nat.le_succ _) _)]
apply (lt_of_le_of_lt _ (eapprox_lt_top f (n + 1) a)).ne
rw [tsub_le_iff_right]
exact le_self_add
theorem tsum_eapproxDiff (f : α → ℝ≥0∞) (hf : Measurable f) (a : α) :
(∑' n, (eapproxDiff f n a : ℝ≥0∞)) = f a := by
simp_rw [ENNReal.tsum_eq_iSup_nat' (tendsto_add_atTop_nat 1), sum_eapproxDiff,
iSup_eapprox_apply f hf a]
end EApprox
end Measurable
section Measure
variable {m : MeasurableSpace α} {μ ν : Measure α}
/-- Integral of a simple function whose codomain is `ℝ≥0∞`. -/
def lintegral {_m : MeasurableSpace α} (f : α →ₛ ℝ≥0∞) (μ : Measure α) : ℝ≥0∞ :=
∑ x ∈ f.range, x * μ (f ⁻¹' {x})
theorem lintegral_eq_of_subset (f : α →ₛ ℝ≥0∞) {s : Finset ℝ≥0∞}
(hs : ∀ x, f x ≠ 0 → μ (f ⁻¹' {f x}) ≠ 0 → f x ∈ s) :
f.lintegral μ = ∑ x ∈ s, x * μ (f ⁻¹' {x}) := by
refine Finset.sum_bij_ne_zero (fun r _ _ => r) ?_ ?_ ?_ ?_
· simpa only [forall_mem_range, mul_ne_zero_iff, and_imp]
· intros
assumption
· intro b _ hb
refine ⟨b, ?_, hb, rfl⟩
rw [mem_range, ← preimage_singleton_nonempty]
exact nonempty_of_measure_ne_zero (mul_ne_zero_iff.1 hb).2
· intros
rfl
theorem lintegral_eq_of_subset' (f : α →ₛ ℝ≥0∞) {s : Finset ℝ≥0∞} (hs : f.range \ {0} ⊆ s) :
f.lintegral μ = ∑ x ∈ s, x * μ (f ⁻¹' {x}) :=
f.lintegral_eq_of_subset fun x hfx _ =>
hs <| Finset.mem_sdiff.2 ⟨f.mem_range_self x, mt Finset.mem_singleton.1 hfx⟩
/-- Calculate the integral of `(g ∘ f)`, where `g : β → ℝ≥0∞` and `f : α →ₛ β`. -/
theorem map_lintegral (g : β → ℝ≥0∞) (f : α →ₛ β) :
(f.map g).lintegral μ = ∑ x ∈ f.range, g x * μ (f ⁻¹' {x}) := by
simp only [lintegral, range_map]
refine Finset.sum_image' _ fun b hb => ?_
rcases mem_range.1 hb with ⟨a, rfl⟩
rw [map_preimage_singleton, ← f.sum_measure_preimage_singleton, Finset.mul_sum]
refine Finset.sum_congr ?_ ?_
· congr
· intro x
simp only [Finset.mem_filter]
rintro ⟨_, h⟩
rw [h]
theorem add_lintegral (f g : α →ₛ ℝ≥0∞) : (f + g).lintegral μ = f.lintegral μ + g.lintegral μ :=
calc
(f + g).lintegral μ =
∑ x ∈ (pair f g).range, (x.1 * μ (pair f g ⁻¹' {x}) + x.2 * μ (pair f g ⁻¹' {x})) := by
rw [add_eq_map₂, map_lintegral]; exact Finset.sum_congr rfl fun a _ => add_mul _ _ _
_ = (∑ x ∈ (pair f g).range, x.1 * μ (pair f g ⁻¹' {x})) +
∑ x ∈ (pair f g).range, x.2 * μ (pair f g ⁻¹' {x}) := by
rw [Finset.sum_add_distrib]
_ = ((pair f g).map Prod.fst).lintegral μ + ((pair f g).map Prod.snd).lintegral μ := by
rw [map_lintegral, map_lintegral]
_ = lintegral f μ + lintegral g μ := rfl
theorem const_mul_lintegral (f : α →ₛ ℝ≥0∞) (x : ℝ≥0∞) :
(const α x * f).lintegral μ = x * f.lintegral μ :=
calc
(f.map fun a => x * a).lintegral μ = ∑ r ∈ f.range, x * r * μ (f ⁻¹' {r}) := map_lintegral _ _
_ = x * ∑ r ∈ f.range, r * μ (f ⁻¹' {r}) := by simp_rw [Finset.mul_sum, mul_assoc]
/-- Integral of a simple function `α →ₛ ℝ≥0∞` as a bilinear map. -/
def lintegralₗ {m : MeasurableSpace α} : (α →ₛ ℝ≥0∞) →ₗ[ℝ≥0∞] Measure α →ₗ[ℝ≥0∞] ℝ≥0∞ where
toFun f :=
{ toFun := lintegral f
map_add' := by simp [lintegral, mul_add, Finset.sum_add_distrib]
map_smul' := fun c μ => by
simp [lintegral, mul_left_comm _ c, Finset.mul_sum, Measure.smul_apply c] }
map_add' f g := LinearMap.ext fun μ => add_lintegral f g
map_smul' c f := LinearMap.ext fun μ => const_mul_lintegral f c
@[simp]
theorem zero_lintegral : (0 : α →ₛ ℝ≥0∞).lintegral μ = 0 :=
LinearMap.ext_iff.1 lintegralₗ.map_zero μ
theorem lintegral_add {ν} (f : α →ₛ ℝ≥0∞) : f.lintegral (μ + ν) = f.lintegral μ + f.lintegral ν :=
(lintegralₗ f).map_add μ ν
theorem lintegral_smul (f : α →ₛ ℝ≥0∞) (c : ℝ≥0∞) : f.lintegral (c • μ) = c • f.lintegral μ :=
(lintegralₗ f).map_smul c μ
@[simp]
theorem lintegral_zero [MeasurableSpace α] (f : α →ₛ ℝ≥0∞) : f.lintegral 0 = 0 :=
(lintegralₗ f).map_zero
theorem lintegral_sum {m : MeasurableSpace α} {ι} (f : α →ₛ ℝ≥0∞) (μ : ι → Measure α) :
f.lintegral (Measure.sum μ) = ∑' i, f.lintegral (μ i) := by
simp only [lintegral, Measure.sum_apply, f.measurableSet_preimage, ← Finset.tsum_subtype, ←
ENNReal.tsum_mul_left]
apply ENNReal.tsum_comm
theorem restrict_lintegral (f : α →ₛ ℝ≥0∞) {s : Set α} (hs : MeasurableSet s) :
(restrict f s).lintegral μ = ∑ r ∈ f.range, r * μ (f ⁻¹' {r} ∩ s) :=
calc
(restrict f s).lintegral μ = ∑ r ∈ f.range, r * μ (restrict f s ⁻¹' {r}) :=
lintegral_eq_of_subset _ fun x hx =>
if hxs : x ∈ s then fun _ => by
simp only [f.restrict_apply hs, indicator_of_mem hxs, mem_range_self]
else False.elim <| hx <| by simp [*]
_ = ∑ r ∈ f.range, r * μ (f ⁻¹' {r} ∩ s) :=
Finset.sum_congr rfl <|
forall_mem_range.2 fun b =>
if hb : f b = 0 then by simp only [hb, zero_mul]
else by rw [restrict_preimage_singleton _ hs hb, inter_comm]
theorem lintegral_restrict {m : MeasurableSpace α} (f : α →ₛ ℝ≥0∞) (s : Set α) (μ : Measure α) :
f.lintegral (μ.restrict s) = ∑ y ∈ f.range, y * μ (f ⁻¹' {y} ∩ s) := by
simp only [lintegral, Measure.restrict_apply, f.measurableSet_preimage]
theorem restrict_lintegral_eq_lintegral_restrict (f : α →ₛ ℝ≥0∞) {s : Set α}
(hs : MeasurableSet s) : (restrict f s).lintegral μ = f.lintegral (μ.restrict s) := by
rw [f.restrict_lintegral hs, lintegral_restrict]
theorem lintegral_restrict_iUnion_of_directed {ι : Type*} [Countable ι]
(f : α →ₛ ℝ≥0∞) {s : ι → Set α} (hd : Directed (· ⊆ ·) s) (μ : Measure α) :
f.lintegral (μ.restrict (⋃ i, s i)) = ⨆ i, f.lintegral (μ.restrict (s i)) := by
simp only [lintegral, Measure.restrict_iUnion_apply_eq_iSup hd (measurableSet_preimage ..),
ENNReal.mul_iSup]
refine finsetSum_iSup fun i j ↦ (hd i j).imp fun k ⟨hik, hjk⟩ ↦ fun a ↦ ?_
-- TODO https://github.com/leanprover-community/mathlib4/pull/14739 make `gcongr` close this goal
constructor <;> · gcongr; refine Measure.restrict_mono ?_ le_rfl _; assumption
theorem const_lintegral (c : ℝ≥0∞) : (const α c).lintegral μ = c * μ univ := by
rw [lintegral]
cases isEmpty_or_nonempty α
· simp [μ.eq_zero_of_isEmpty]
· simp; unfold Function.const; rw [preimage_const_of_mem (mem_singleton c)]
theorem const_lintegral_restrict (c : ℝ≥0∞) (s : Set α) :
(const α c).lintegral (μ.restrict s) = c * μ s := by
rw [const_lintegral, Measure.restrict_apply MeasurableSet.univ, univ_inter]
theorem restrict_const_lintegral (c : ℝ≥0∞) {s : Set α} (hs : MeasurableSet s) :
((const α c).restrict s).lintegral μ = c * μ s := by
rw [restrict_lintegral_eq_lintegral_restrict _ hs, const_lintegral_restrict]
theorem le_sup_lintegral (f g : α →ₛ ℝ≥0∞) : f.lintegral μ ⊔ g.lintegral μ ≤ (f ⊔ g).lintegral μ :=
calc
f.lintegral μ ⊔ g.lintegral μ =
((pair f g).map Prod.fst).lintegral μ ⊔ ((pair f g).map Prod.snd).lintegral μ :=
rfl
_ ≤ ∑ x ∈ (pair f g).range, (x.1 ⊔ x.2) * μ (pair f g ⁻¹' {x}) := by
rw [map_lintegral, map_lintegral]
refine sup_le ?_ ?_ <;> refine Finset.sum_le_sum fun a _ => mul_le_mul_right' ?_ _
· exact le_sup_left
· exact le_sup_right
_ = (f ⊔ g).lintegral μ := by rw [sup_eq_map₂, map_lintegral]
/-- `SimpleFunc.lintegral` is monotone both in function and in measure. -/
@[mono]
theorem lintegral_mono {f g : α →ₛ ℝ≥0∞} (hfg : f ≤ g) (hμν : μ ≤ ν) :
f.lintegral μ ≤ g.lintegral ν :=
calc
f.lintegral μ ≤ f.lintegral μ ⊔ g.lintegral μ := le_sup_left
_ ≤ (f ⊔ g).lintegral μ := le_sup_lintegral _ _
_ = g.lintegral μ := by rw [sup_of_le_right hfg]
_ ≤ g.lintegral ν := Finset.sum_le_sum fun y _ => ENNReal.mul_left_mono <| hμν _
/-- `SimpleFunc.lintegral` depends only on the measures of `f ⁻¹' {y}`. -/
theorem lintegral_eq_of_measure_preimage [MeasurableSpace β] {f : α →ₛ ℝ≥0∞} {g : β →ₛ ℝ≥0∞}
{ν : Measure β} (H : ∀ y, μ (f ⁻¹' {y}) = ν (g ⁻¹' {y})) : f.lintegral μ = g.lintegral ν := by
simp only [lintegral, ← H]
apply lintegral_eq_of_subset
simp only [H]
intros
exact mem_range_of_measure_ne_zero ‹_›
/-- If two simple functions are equal a.e., then their `lintegral`s are equal. -/
theorem lintegral_congr {f g : α →ₛ ℝ≥0∞} (h : f =ᵐ[μ] g) : f.lintegral μ = g.lintegral μ :=
lintegral_eq_of_measure_preimage fun y =>
measure_congr <| Eventually.set_eq <| h.mono fun x hx => by simp [hx]
theorem lintegral_map' {β} [MeasurableSpace β] {μ' : Measure β} (f : α →ₛ ℝ≥0∞) (g : β →ₛ ℝ≥0∞)
(m' : α → β) (eq : ∀ a, f a = g (m' a)) (h : ∀ s, MeasurableSet s → μ' s = μ (m' ⁻¹' s)) :
f.lintegral μ = g.lintegral μ' :=
lintegral_eq_of_measure_preimage fun y => by
simp only [preimage, eq]
exact (h (g ⁻¹' {y}) (g.measurableSet_preimage _)).symm
theorem lintegral_map {β} [MeasurableSpace β] (g : β →ₛ ℝ≥0∞) {f : α → β} (hf : Measurable f) :
g.lintegral (Measure.map f μ) = (g.comp f hf).lintegral μ :=
Eq.symm <| lintegral_map' _ _ f (fun _ => rfl) fun _s hs => Measure.map_apply hf hs
end Measure
section FinMeasSupp
open Finset Function
theorem support_eq [MeasurableSpace α] [Zero β] (f : α →ₛ β) :
support f = ⋃ y ∈ f.range.filter fun y => y ≠ 0, f ⁻¹' {y} :=
Set.ext fun x => by
simp only [mem_support, Set.mem_preimage, mem_filter, mem_range_self, true_and_iff, exists_prop,
mem_iUnion, Set.mem_range, mem_singleton_iff, exists_eq_right']
variable {m : MeasurableSpace α} [Zero β] [Zero γ] {μ : Measure α} {f : α →ₛ β}
theorem measurableSet_support [MeasurableSpace α] (f : α →ₛ β) : MeasurableSet (support f) := by
rw [f.support_eq]
exact Finset.measurableSet_biUnion _ fun y _ => measurableSet_fiber _ _
/-- A `SimpleFunc` has finite measure support if it is equal to `0` outside of a set of finite
measure. -/
protected def FinMeasSupp {_m : MeasurableSpace α} (f : α →ₛ β) (μ : Measure α) : Prop :=
f =ᶠ[μ.cofinite] 0
theorem finMeasSupp_iff_support : f.FinMeasSupp μ ↔ μ (support f) < ∞ :=
Iff.rfl
theorem finMeasSupp_iff : f.FinMeasSupp μ ↔ ∀ y, y ≠ 0 → μ (f ⁻¹' {y}) < ∞ := by
constructor
· refine fun h y hy => lt_of_le_of_lt (measure_mono ?_) h
exact fun x hx (H : f x = 0) => hy <| H ▸ Eq.symm hx
· intro H
rw [finMeasSupp_iff_support, support_eq]
refine lt_of_le_of_lt (measure_biUnion_finset_le _ _) (sum_lt_top ?_)
exact fun y hy => (H y (Finset.mem_filter.1 hy).2).ne
namespace FinMeasSupp
theorem meas_preimage_singleton_ne_zero (h : f.FinMeasSupp μ) {y : β} (hy : y ≠ 0) :
μ (f ⁻¹' {y}) < ∞ :=
finMeasSupp_iff.1 h y hy
protected theorem map {g : β → γ} (hf : f.FinMeasSupp μ) (hg : g 0 = 0) : (f.map g).FinMeasSupp μ :=
flip lt_of_le_of_lt hf (measure_mono <| support_comp_subset hg f)
theorem of_map {g : β → γ} (h : (f.map g).FinMeasSupp μ) (hg : ∀ b, g b = 0 → b = 0) :
f.FinMeasSupp μ :=
flip lt_of_le_of_lt h <| measure_mono <| support_subset_comp @(hg) _
theorem map_iff {g : β → γ} (hg : ∀ {b}, g b = 0 ↔ b = 0) :
(f.map g).FinMeasSupp μ ↔ f.FinMeasSupp μ :=
⟨fun h => h.of_map fun _ => hg.1, fun h => h.map <| hg.2 rfl⟩
protected theorem pair {g : α →ₛ γ} (hf : f.FinMeasSupp μ) (hg : g.FinMeasSupp μ) :
(pair f g).FinMeasSupp μ :=
calc
μ (support <| pair f g) = μ (support f ∪ support g) := congr_arg μ <| support_prod_mk f g
_ ≤ μ (support f) + μ (support g) := measure_union_le _ _
_ < _ := add_lt_top.2 ⟨hf, hg⟩
protected theorem map₂ [Zero δ] (hf : f.FinMeasSupp μ) {g : α →ₛ γ} (hg : g.FinMeasSupp μ)
{op : β → γ → δ} (H : op 0 0 = 0) : ((pair f g).map (Function.uncurry op)).FinMeasSupp μ :=
(hf.pair hg).map H
protected theorem add {β} [AddMonoid β] {f g : α →ₛ β} (hf : f.FinMeasSupp μ)
(hg : g.FinMeasSupp μ) : (f + g).FinMeasSupp μ := by
rw [add_eq_map₂]
exact hf.map₂ hg (zero_add 0)
protected theorem mul {β} [MonoidWithZero β] {f g : α →ₛ β} (hf : f.FinMeasSupp μ)
(hg : g.FinMeasSupp μ) : (f * g).FinMeasSupp μ := by
rw [mul_eq_map₂]
exact hf.map₂ hg (zero_mul 0)
theorem lintegral_lt_top {f : α →ₛ ℝ≥0∞} (hm : f.FinMeasSupp μ) (hf : ∀ᵐ a ∂μ, f a ≠ ∞) :
f.lintegral μ < ∞ := by
refine sum_lt_top fun a ha => ?_
rcases eq_or_ne a ∞ with (rfl | ha)
· simp only [ae_iff, Ne, Classical.not_not] at hf
simp [Set.preimage, hf]
· by_cases ha0 : a = 0
· subst a
rwa [zero_mul]
· exact mul_ne_top ha (finMeasSupp_iff.1 hm _ ha0).ne
theorem of_lintegral_ne_top {f : α →ₛ ℝ≥0∞} (h : f.lintegral μ ≠ ∞) : f.FinMeasSupp μ := by
refine finMeasSupp_iff.2 fun b hb => ?_
rw [f.lintegral_eq_of_subset' (Finset.subset_insert b _)] at h
refine ENNReal.lt_top_of_mul_ne_top_right ?_ hb
exact (lt_top_of_sum_ne_top h (Finset.mem_insert_self _ _)).ne
theorem iff_lintegral_lt_top {f : α →ₛ ℝ≥0∞} (hf : ∀ᵐ a ∂μ, f a ≠ ∞) :
f.FinMeasSupp μ ↔ f.lintegral μ < ∞ :=
⟨fun h => h.lintegral_lt_top hf, fun h => of_lintegral_ne_top h.ne⟩
end FinMeasSupp
end FinMeasSupp
/-- To prove something for an arbitrary simple function, it suffices to show
that the property holds for (multiples of) characteristic functions and is closed under
addition (of functions with disjoint support).
It is possible to make the hypotheses in `h_add` a bit stronger, and such conditions can be added
once we need them (for example it is only necessary to consider the case where `g` is a multiple
of a characteristic function, and that this multiple doesn't appear in the image of `f`) -/
@[elab_as_elim]
protected theorem induction {α γ} [MeasurableSpace α] [AddMonoid γ] {P : SimpleFunc α γ → Prop}
(h_ind :
∀ (c) {s} (hs : MeasurableSet s),
P (SimpleFunc.piecewise s hs (SimpleFunc.const _ c) (SimpleFunc.const _ 0)))
(h_add : ∀ ⦃f g : SimpleFunc α γ⦄, Disjoint (support f) (support g) → P f → P g → P (f + g))
(f : SimpleFunc α γ) : P f := by
generalize h : f.range \ {0} = s
rw [← Finset.coe_inj, Finset.coe_sdiff, Finset.coe_singleton, SimpleFunc.coe_range] at h
induction s using Finset.induction generalizing f with
| empty =>
rw [Finset.coe_empty, diff_eq_empty, range_subset_singleton] at h
convert h_ind 0 MeasurableSet.univ
ext x
simp [h]
| @insert x s hxs ih =>
have mx := f.measurableSet_preimage {x}
let g := SimpleFunc.piecewise (f ⁻¹' {x}) mx 0 f
have Pg : P g := by
apply ih
simp only [g, SimpleFunc.coe_piecewise, range_piecewise]
rw [image_compl_preimage, union_diff_distrib, diff_diff_comm, h, Finset.coe_insert,
insert_diff_self_of_not_mem, diff_eq_empty.mpr, Set.empty_union]
· rw [Set.image_subset_iff]
convert Set.subset_univ _
exact preimage_const_of_mem (mem_singleton _)
· rwa [Finset.mem_coe]
convert h_add _ Pg (h_ind x mx)
· ext1 y
by_cases hy : y ∈ f ⁻¹' {x}
· simpa [g, piecewise_eq_of_mem _ _ _ hy, -piecewise_eq_indicator]
· simp [g, piecewise_eq_of_not_mem _ _ _ hy, -piecewise_eq_indicator]
rw [disjoint_iff_inf_le]
rintro y
by_cases hy : y ∈ f ⁻¹' {x}
· simp [g, piecewise_eq_of_mem _ _ _ hy, -piecewise_eq_indicator]
· simp [piecewise_eq_of_not_mem _ _ _ hy, -piecewise_eq_indicator]
/-- In a topological vector space, the addition of a measurable function and a simple function is
measurable. -/
theorem _root_.Measurable.add_simpleFunc
{E : Type*} {_ : MeasurableSpace α} [MeasurableSpace E] [AddGroup E] [MeasurableAdd E]
{g : α → E} (hg : Measurable g) (f : SimpleFunc α E) :
Measurable (g + (f : α → E)) := by
classical
induction' f using SimpleFunc.induction with c s hs f f' hff' hf hf'
· simp only [SimpleFunc.const_zero, SimpleFunc.coe_piecewise, SimpleFunc.coe_const,
SimpleFunc.coe_zero]
change Measurable (g + s.piecewise (Function.const α c) (0 : α → E))
rw [← s.piecewise_same g, ← piecewise_add]
exact Measurable.piecewise hs (hg.add_const _) (hg.add_const _)
· have : (g + ↑(f + f'))
= (Function.support f).piecewise (g + (f : α → E)) (g + f') := by
ext x
by_cases hx : x ∈ Function.support f
· simpa only [SimpleFunc.coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
Set.piecewise_eq_of_mem _ _ _ hx, _root_.add_right_inj, add_right_eq_self]
using Set.disjoint_left.1 hff' hx
· simpa only [SimpleFunc.coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
Set.piecewise_eq_of_not_mem _ _ _ hx, _root_.add_right_inj, add_left_eq_self] using hx
rw [this]
exact Measurable.piecewise f.measurableSet_support hf hf'
/-- In a topological vector space, the addition of a simple function and a measurable function is
measurable. -/
theorem _root_.Measurable.simpleFunc_add
{E : Type*} {_ : MeasurableSpace α} [MeasurableSpace E] [AddGroup E] [MeasurableAdd E]
{g : α → E} (hg : Measurable g) (f : SimpleFunc α E) :
Measurable ((f : α → E) + g) := by
classical
induction' f using SimpleFunc.induction with c s hs f f' hff' hf hf'
· simp only [SimpleFunc.const_zero, SimpleFunc.coe_piecewise, SimpleFunc.coe_const,
SimpleFunc.coe_zero]
change Measurable (s.piecewise (Function.const α c) (0 : α → E) + g)
rw [← s.piecewise_same g, ← piecewise_add]
exact Measurable.piecewise hs (hg.const_add _) (hg.const_add _)
· have : (↑(f + f') + g)
= (Function.support f).piecewise ((f : α → E) + g) (f' + g) := by
ext x
by_cases hx : x ∈ Function.support f
· simpa only [coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
Set.piecewise_eq_of_mem _ _ _ hx, _root_.add_left_inj, add_right_eq_self]
using Set.disjoint_left.1 hff' hx
· simpa only [SimpleFunc.coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
Set.piecewise_eq_of_not_mem _ _ _ hx, _root_.add_left_inj, add_left_eq_self] using hx
rw [this]
exact Measurable.piecewise f.measurableSet_support hf hf'
end SimpleFunc
end MeasureTheory
open MeasureTheory MeasureTheory.SimpleFunc
/-- To prove something for an arbitrary measurable function into `ℝ≥0∞`, it suffices to show
that the property holds for (multiples of) characteristic functions and is closed under addition
and supremum of increasing sequences of functions.
It is possible to make the hypotheses in the induction steps a bit stronger, and such conditions
can be added once we need them (for example in `h_add` it is only necessary to consider the sum of
a simple function with a multiple of a characteristic function and that the intersection
of their images is a subset of `{0}`. -/
@[elab_as_elim]
theorem Measurable.ennreal_induction {α} [MeasurableSpace α] {P : (α → ℝ≥0∞) → Prop}
(h_ind : ∀ (c : ℝ≥0∞) ⦃s⦄, MeasurableSet s → P (Set.indicator s fun _ => c))
(h_add :
∀ ⦃f g : α → ℝ≥0∞⦄,
Disjoint (support f) (support g) → Measurable f → Measurable g → P f → P g → P (f + g))
(h_iSup :
∀ ⦃f : ℕ → α → ℝ≥0∞⦄, (∀ n, Measurable (f n)) → Monotone f → (∀ n, P (f n)) →
P fun x => ⨆ n, f n x)
⦃f : α → ℝ≥0∞⦄ (hf : Measurable f) : P f := by
convert h_iSup (fun n => (eapprox f n).measurable) (monotone_eapprox f) _ using 1
· ext1 x
rw [iSup_eapprox_apply f hf]
· exact fun n =>
SimpleFunc.induction (fun c s hs => h_ind c hs)
(fun f g hfg hf hg => h_add hfg f.measurable g.measurable hf hg) (eapprox f n)
|
MeasureTheory\Function\SimpleFuncDense.lean | /-
Copyright (c) 2019 Zhouhang Zhou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
-/
import Mathlib.MeasureTheory.Function.SimpleFunc
import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable
/-!
# Density of simple functions
Show that each Borel measurable function can be approximated pointwise
by a sequence of simple functions.
## Main definitions
* `MeasureTheory.SimpleFunc.nearestPt (e : ℕ → α) (N : ℕ) : α →ₛ ℕ`: the `SimpleFunc` sending
each `x : α` to the point `e k` which is the nearest to `x` among `e 0`, ..., `e N`.
* `MeasureTheory.SimpleFunc.approxOn (f : β → α) (hf : Measurable f) (s : Set α) (y₀ : α)
(h₀ : y₀ ∈ s) [SeparableSpace s] (n : ℕ) : β →ₛ α` : a simple function that takes values in `s`
and approximates `f`.
## Main results
* `tendsto_approxOn` (pointwise convergence): If `f x ∈ s`, then the sequence of simple
approximations `MeasureTheory.SimpleFunc.approxOn f hf s y₀ h₀ n`, evaluated at `x`,
tends to `f x` as `n` tends to `∞`.
## Notations
* `α →ₛ β` (local notation): the type of simple functions `α → β`.
-/
open Set Function Filter TopologicalSpace ENNReal EMetric Finset
open scoped Classical
open Topology ENNReal MeasureTheory
variable {α β ι E F 𝕜 : Type*}
noncomputable section
namespace MeasureTheory
local infixr:25 " →ₛ " => SimpleFunc
namespace SimpleFunc
/-! ### Pointwise approximation by simple functions -/
variable [MeasurableSpace α] [PseudoEMetricSpace α] [OpensMeasurableSpace α]
/-- `nearestPtInd e N x` is the index `k` such that `e k` is the nearest point to `x` among the
points `e 0`, ..., `e N`. If more than one point are at the same distance from `x`, then
`nearestPtInd e N x` returns the least of their indexes. -/
noncomputable def nearestPtInd (e : ℕ → α) : ℕ → α →ₛ ℕ
| 0 => const α 0
| N + 1 =>
piecewise (⋂ k ≤ N, { x | edist (e (N + 1)) x < edist (e k) x })
(MeasurableSet.iInter fun _ =>
MeasurableSet.iInter fun _ =>
measurableSet_lt measurable_edist_right measurable_edist_right)
(const α <| N + 1) (nearestPtInd e N)
/-- `nearestPt e N x` is the nearest point to `x` among the points `e 0`, ..., `e N`. If more than
one point are at the same distance from `x`, then `nearestPt e N x` returns the point with the
least possible index. -/
noncomputable def nearestPt (e : ℕ → α) (N : ℕ) : α →ₛ α :=
(nearestPtInd e N).map e
@[simp]
theorem nearestPtInd_zero (e : ℕ → α) : nearestPtInd e 0 = const α 0 :=
rfl
@[simp]
theorem nearestPt_zero (e : ℕ → α) : nearestPt e 0 = const α (e 0) :=
rfl
theorem nearestPtInd_succ (e : ℕ → α) (N : ℕ) (x : α) :
nearestPtInd e (N + 1) x =
if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else nearestPtInd e N x := by
simp only [nearestPtInd, coe_piecewise, Set.piecewise]
congr
simp
theorem nearestPtInd_le (e : ℕ → α) (N : ℕ) (x : α) : nearestPtInd e N x ≤ N := by
induction' N with N ihN; · simp
simp only [nearestPtInd_succ]
split_ifs
exacts [le_rfl, ihN.trans N.le_succ]
theorem edist_nearestPt_le (e : ℕ → α) (x : α) {k N : ℕ} (hk : k ≤ N) :
edist (nearestPt e N x) x ≤ edist (e k) x := by
induction' N with N ihN generalizing k
· simp [nonpos_iff_eq_zero.1 hk, le_refl]
· simp only [nearestPt, nearestPtInd_succ, map_apply]
split_ifs with h
· rcases hk.eq_or_lt with (rfl | hk)
exacts [le_rfl, (h k (Nat.lt_succ_iff.1 hk)).le]
· push_neg at h
rcases h with ⟨l, hlN, hxl⟩
rcases hk.eq_or_lt with (rfl | hk)
exacts [(ihN hlN).trans hxl, ihN (Nat.lt_succ_iff.1 hk)]
theorem tendsto_nearestPt {e : ℕ → α} {x : α} (hx : x ∈ closure (range e)) :
Tendsto (fun N => nearestPt e N x) atTop (𝓝 x) := by
refine (atTop_basis.tendsto_iff nhds_basis_eball).2 fun ε hε => ?_
rcases EMetric.mem_closure_iff.1 hx ε hε with ⟨_, ⟨N, rfl⟩, hN⟩
rw [edist_comm] at hN
exact ⟨N, trivial, fun n hn => (edist_nearestPt_le e x hn).trans_lt hN⟩
variable [MeasurableSpace β] {f : β → α}
/-- Approximate a measurable function by a sequence of simple functions `F n` such that
`F n x ∈ s`. -/
noncomputable def approxOn (f : β → α) (hf : Measurable f) (s : Set α) (y₀ : α) (h₀ : y₀ ∈ s)
[SeparableSpace s] (n : ℕ) : β →ₛ α :=
haveI : Nonempty s := ⟨⟨y₀, h₀⟩⟩
comp (nearestPt (fun k => Nat.casesOn k y₀ ((↑) ∘ denseSeq s) : ℕ → α) n) f hf
@[simp]
theorem approxOn_zero {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s)
[SeparableSpace s] (x : β) : approxOn f hf s y₀ h₀ 0 x = y₀ :=
rfl
theorem approxOn_mem {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s)
[SeparableSpace s] (n : ℕ) (x : β) : approxOn f hf s y₀ h₀ n x ∈ s := by
haveI : Nonempty s := ⟨⟨y₀, h₀⟩⟩
suffices ∀ n, (Nat.casesOn n y₀ ((↑) ∘ denseSeq s) : α) ∈ s by apply this
rintro (_ | n)
exacts [h₀, Subtype.mem _]
@[simp, nolint simpNF] -- Porting note: LHS doesn't simplify.
theorem approxOn_comp {γ : Type*} [MeasurableSpace γ] {f : β → α} (hf : Measurable f) {g : γ → β}
(hg : Measurable g) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s) [SeparableSpace s] (n : ℕ) :
approxOn (f ∘ g) (hf.comp hg) s y₀ h₀ n = (approxOn f hf s y₀ h₀ n).comp g hg :=
rfl
theorem tendsto_approxOn {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s)
[SeparableSpace s] {x : β} (hx : f x ∈ closure s) :
Tendsto (fun n => approxOn f hf s y₀ h₀ n x) atTop (𝓝 <| f x) := by
haveI : Nonempty s := ⟨⟨y₀, h₀⟩⟩
rw [← @Subtype.range_coe _ s, ← image_univ, ← (denseRange_denseSeq s).closure_eq] at hx
simp (config := { iota := false }) only [approxOn, coe_comp]
refine tendsto_nearestPt (closure_minimal ?_ isClosed_closure hx)
simp (config := { iota := false }) only [Nat.range_casesOn, closure_union, range_comp]
exact
Subset.trans (image_closure_subset_closure_image continuous_subtype_val)
subset_union_right
theorem edist_approxOn_mono {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s)
[SeparableSpace s] (x : β) {m n : ℕ} (h : m ≤ n) :
edist (approxOn f hf s y₀ h₀ n x) (f x) ≤ edist (approxOn f hf s y₀ h₀ m x) (f x) := by
dsimp only [approxOn, coe_comp, Function.comp_def]
exact edist_nearestPt_le _ _ ((nearestPtInd_le _ _ _).trans h)
theorem edist_approxOn_le {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s)
[SeparableSpace s] (x : β) (n : ℕ) : edist (approxOn f hf s y₀ h₀ n x) (f x) ≤ edist y₀ (f x) :=
edist_approxOn_mono hf h₀ x (zero_le n)
theorem edist_approxOn_y0_le {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s)
[SeparableSpace s] (x : β) (n : ℕ) :
edist y₀ (approxOn f hf s y₀ h₀ n x) ≤ edist y₀ (f x) + edist y₀ (f x) :=
calc
edist y₀ (approxOn f hf s y₀ h₀ n x) ≤
edist y₀ (f x) + edist (approxOn f hf s y₀ h₀ n x) (f x) :=
edist_triangle_right _ _ _
_ ≤ edist y₀ (f x) + edist y₀ (f x) := add_le_add_left (edist_approxOn_le hf h₀ x n) _
end SimpleFunc
end MeasureTheory
section CompactSupport
variable {X Y α : Type*} [Zero α]
[TopologicalSpace X] [TopologicalSpace Y] [MeasurableSpace X] [MeasurableSpace Y]
[OpensMeasurableSpace X] [OpensMeasurableSpace Y]
/-- A continuous function with compact support on a product space can be uniformly approximated by
simple functions. The subtlety is that we do not assume that the spaces are separable, so the
product of the Borel sigma algebras might not contain all open sets, but still it contains enough
of them to approximate compactly supported continuous functions. -/
lemma HasCompactSupport.exists_simpleFunc_approx_of_prod [PseudoMetricSpace α]
{f : X × Y → α} (hf : Continuous f) (h'f : HasCompactSupport f)
{ε : ℝ} (hε : 0 < ε) :
∃ (g : SimpleFunc (X × Y) α), ∀ x, dist (f x) (g x) < ε := by
have M : ∀ (K : Set (X × Y)), IsCompact K →
∃ (g : SimpleFunc (X × Y) α), ∃ (s : Set (X × Y)), MeasurableSet s ∧ K ⊆ s ∧
∀ x ∈ s, dist (f x) (g x) < ε := by
intro K hK
apply IsCompact.induction_on
(p := fun t ↦ ∃ (g : SimpleFunc (X × Y) α), ∃ (s : Set (X × Y)), MeasurableSet s ∧ t ⊆ s ∧
∀ x ∈ s, dist (f x) (g x) < ε) hK
· exact ⟨0, ∅, by simp⟩
· intro t t' htt' ⟨g, s, s_meas, ts, hg⟩
exact ⟨g, s, s_meas, htt'.trans ts, hg⟩
· intro t t' ⟨g, s, s_meas, ts, hg⟩ ⟨g', s', s'_meas, t's', hg'⟩
refine ⟨g.piecewise s s_meas g', s ∪ s', s_meas.union s'_meas,
union_subset_union ts t's', fun p hp ↦ ?_⟩
by_cases H : p ∈ s
· simpa [H, SimpleFunc.piecewise_apply] using hg p H
· simp only [SimpleFunc.piecewise_apply, H, ite_false]
apply hg'
simpa [H] using (mem_union _ _ _).1 hp
· rintro ⟨x, y⟩ -
obtain ⟨u, v, hu, xu, hv, yv, huv⟩ : ∃ u v, IsOpen u ∧ x ∈ u ∧ IsOpen v ∧ y ∈ v ∧
u ×ˢ v ⊆ {z | dist (f z) (f (x, y)) < ε} :=
mem_nhds_prod_iff'.1 <| Metric.continuousAt_iff'.1 hf.continuousAt ε hε
refine ⟨u ×ˢ v, nhdsWithin_le_nhds <| (hu.prod hv).mem_nhds (mk_mem_prod xu yv), ?_⟩
exact ⟨SimpleFunc.const _ (f (x, y)), u ×ˢ v, hu.measurableSet.prod hv.measurableSet,
Subset.rfl, fun z hz ↦ huv hz⟩
obtain ⟨g, s, s_meas, fs, hg⟩ : ∃ g s, MeasurableSet s ∧ tsupport f ⊆ s ∧
∀ (x : X × Y), x ∈ s → dist (f x) (g x) < ε := M _ h'f
refine ⟨g.piecewise s s_meas 0, fun p ↦ ?_⟩
by_cases H : p ∈ s
· simpa [H, SimpleFunc.piecewise_apply] using hg p H
· have : f p = 0 := by
contrapose! H
rw [← Function.mem_support] at H
exact fs (subset_tsupport _ H)
simp [SimpleFunc.piecewise_apply, H, ite_false, this, hε]
/-- A continuous function with compact support on a product space is measurable for the product
sigma-algebra. The subtlety is that we do not assume that the spaces are separable, so the
product of the Borel sigma algebras might not contain all open sets, but still it contains enough
of them to approximate compactly supported continuous functions. -/
lemma HasCompactSupport.measurable_of_prod
[TopologicalSpace α] [PseudoMetrizableSpace α] [MeasurableSpace α] [BorelSpace α]
{f : X × Y → α} (hf : Continuous f) (h'f : HasCompactSupport f) :
Measurable f := by
letI : PseudoMetricSpace α := TopologicalSpace.pseudoMetrizableSpacePseudoMetric α
obtain ⟨u, -, u_pos, u_lim⟩ : ∃ u, StrictAnti u ∧ (∀ (n : ℕ), 0 < u n) ∧ Tendsto u atTop (𝓝 0) :=
exists_seq_strictAnti_tendsto (0 : ℝ)
have : ∀ n, ∃ (g : SimpleFunc (X × Y) α), ∀ x, dist (f x) (g x) < u n :=
fun n ↦ h'f.exists_simpleFunc_approx_of_prod hf (u_pos n)
choose g hg using this
have A : ∀ x, Tendsto (fun n ↦ g n x) atTop (𝓝 (f x)) := by
intro x
rw [tendsto_iff_dist_tendsto_zero]
apply squeeze_zero (fun n ↦ dist_nonneg) (fun n ↦ ?_) u_lim
rw [dist_comm]
exact (hg n x).le
apply measurable_of_tendsto_metrizable (fun n ↦ (g n).measurable) (tendsto_pi_nhds.2 A)
end CompactSupport
|
MeasureTheory\Function\SimpleFuncDenseLp.lean | /-
Copyright (c) 2022 Zhouhang Zhou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
-/
import Mathlib.MeasureTheory.Function.L1Space
import Mathlib.MeasureTheory.Function.SimpleFuncDense
/-!
# Density of simple functions
Show that each `Lᵖ` Borel measurable function can be approximated in `Lᵖ` norm
by a sequence of simple functions.
## Main definitions
* `MeasureTheory.Lp.simpleFunc`, the type of `Lp` simple functions
* `coeToLp`, the embedding of `Lp.simpleFunc E p μ` into `Lp E p μ`
## Main results
* `tendsto_approxOn_Lp_eLpNorm` (Lᵖ convergence): If `E` is a `NormedAddCommGroup` and `f` is
measurable and `Memℒp` (for `p < ∞`), then the simple functions
`SimpleFunc.approxOn f hf s 0 h₀ n` may be considered as elements of `Lp E p μ`, and they tend
in Lᵖ to `f`.
* `Lp.simpleFunc.denseEmbedding`: the embedding `coeToLp` of the `Lp` simple functions into
`Lp` is dense.
* `Lp.simpleFunc.induction`, `Lp.induction`, `Memℒp.induction`, `Integrable.induction`: to prove
a predicate for all elements of one of these classes of functions, it suffices to check that it
behaves correctly on simple functions.
## TODO
For `E` finite-dimensional, simple functions `α →ₛ E` are dense in L^∞ -- prove this.
## Notations
* `α →ₛ β` (local notation): the type of simple functions `α → β`.
* `α →₁ₛ[μ] E`: the type of `L1` simple functions `α → β`.
-/
noncomputable section
open Set Function Filter TopologicalSpace ENNReal EMetric Finset
open scoped Classical Topology ENNReal MeasureTheory
variable {α β ι E F 𝕜 : Type*}
namespace MeasureTheory
local infixr:25 " →ₛ " => SimpleFunc
namespace SimpleFunc
/-! ### Lp approximation by simple functions -/
section Lp
variable [MeasurableSpace β] [MeasurableSpace E] [NormedAddCommGroup E] [NormedAddCommGroup F]
{q : ℝ} {p : ℝ≥0∞}
theorem nnnorm_approxOn_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
{y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (x : β) (n : ℕ) :
‖approxOn f hf s y₀ h₀ n x - f x‖₊ ≤ ‖f x - y₀‖₊ := by
have := edist_approxOn_le hf h₀ x n
rw [edist_comm y₀] at this
simp only [edist_nndist, nndist_eq_nnnorm] at this
exact mod_cast this
theorem norm_approxOn_y₀_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
{y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (x : β) (n : ℕ) :
‖approxOn f hf s y₀ h₀ n x - y₀‖ ≤ ‖f x - y₀‖ + ‖f x - y₀‖ := by
have := edist_approxOn_y0_le hf h₀ x n
repeat rw [edist_comm y₀, edist_eq_coe_nnnorm_sub] at this
exact mod_cast this
theorem norm_approxOn_zero_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
(h₀ : (0 : E) ∈ s) [SeparableSpace s] (x : β) (n : ℕ) :
‖approxOn f hf s 0 h₀ n x‖ ≤ ‖f x‖ + ‖f x‖ := by
have := edist_approxOn_y0_le hf h₀ x n
simp only [edist_comm (0 : E), edist_eq_coe_nnnorm] at this
exact mod_cast this
theorem tendsto_approxOn_Lp_eLpNorm [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f)
{s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (hp_ne_top : p ≠ ∞) {μ : Measure β}
(hμ : ∀ᵐ x ∂μ, f x ∈ closure s) (hi : eLpNorm (fun x => f x - y₀) p μ < ∞) :
Tendsto (fun n => eLpNorm (⇑(approxOn f hf s y₀ h₀ n) - f) p μ) atTop (𝓝 0) := by
by_cases hp_zero : p = 0
· simpa only [hp_zero, eLpNorm_exponent_zero] using tendsto_const_nhds
have hp : 0 < p.toReal := toReal_pos hp_zero hp_ne_top
suffices
Tendsto (fun n => ∫⁻ x, (‖approxOn f hf s y₀ h₀ n x - f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) atTop
(𝓝 0) by
simp only [eLpNorm_eq_lintegral_rpow_nnnorm hp_zero hp_ne_top]
convert continuous_rpow_const.continuousAt.tendsto.comp this
simp [zero_rpow_of_pos (_root_.inv_pos.mpr hp)]
-- We simply check the conditions of the Dominated Convergence Theorem:
-- (1) The function "`p`-th power of distance between `f` and the approximation" is measurable
have hF_meas :
∀ n, Measurable fun x => (‖approxOn f hf s y₀ h₀ n x - f x‖₊ : ℝ≥0∞) ^ p.toReal := by
simpa only [← edist_eq_coe_nnnorm_sub] using fun n =>
(approxOn f hf s y₀ h₀ n).measurable_bind (fun y x => edist y (f x) ^ p.toReal) fun y =>
(measurable_edist_right.comp hf).pow_const p.toReal
-- (2) The functions "`p`-th power of distance between `f` and the approximation" are uniformly
-- bounded, at any given point, by `fun x => ‖f x - y₀‖ ^ p.toReal`
have h_bound :
∀ n, (fun x => (‖approxOn f hf s y₀ h₀ n x - f x‖₊ : ℝ≥0∞) ^ p.toReal) ≤ᵐ[μ] fun x =>
(‖f x - y₀‖₊ : ℝ≥0∞) ^ p.toReal :=
fun n =>
eventually_of_forall fun x =>
rpow_le_rpow (coe_mono (nnnorm_approxOn_le hf h₀ x n)) toReal_nonneg
-- (3) The bounding function `fun x => ‖f x - y₀‖ ^ p.toReal` has finite integral
have h_fin : (∫⁻ a : β, (‖f a - y₀‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) ≠ ⊤ :=
(lintegral_rpow_nnnorm_lt_top_of_eLpNorm_lt_top hp_zero hp_ne_top hi).ne
-- (4) The functions "`p`-th power of distance between `f` and the approximation" tend pointwise
-- to zero
have h_lim :
∀ᵐ a : β ∂μ,
Tendsto (fun n => (‖approxOn f hf s y₀ h₀ n a - f a‖₊ : ℝ≥0∞) ^ p.toReal) atTop (𝓝 0) := by
filter_upwards [hμ] with a ha
have : Tendsto (fun n => (approxOn f hf s y₀ h₀ n) a - f a) atTop (𝓝 (f a - f a)) :=
(tendsto_approxOn hf h₀ ha).sub tendsto_const_nhds
convert continuous_rpow_const.continuousAt.tendsto.comp (tendsto_coe.mpr this.nnnorm)
simp [zero_rpow_of_pos hp]
-- Then we apply the Dominated Convergence Theorem
simpa using tendsto_lintegral_of_dominated_convergence _ hF_meas h_bound h_fin h_lim
@[deprecated (since := "2024-07-27")]
alias tendsto_approxOn_Lp_snorm := tendsto_approxOn_Lp_eLpNorm
theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
(hf : Memℒp f p μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
(hi₀ : Memℒp (fun _ => y₀) p μ) (n : ℕ) : Memℒp (approxOn f fmeas s y₀ h₀ n) p μ := by
refine ⟨(approxOn f fmeas s y₀ h₀ n).aestronglyMeasurable, ?_⟩
suffices eLpNorm (fun x => approxOn f fmeas s y₀ h₀ n x - y₀) p μ < ⊤ by
have : Memℒp (fun x => approxOn f fmeas s y₀ h₀ n x - y₀) p μ :=
⟨(approxOn f fmeas s y₀ h₀ n - const β y₀).aestronglyMeasurable, this⟩
convert eLpNorm_add_lt_top this hi₀
ext x
simp
have hf' : Memℒp (fun x => ‖f x - y₀‖) p μ := by
have h_meas : Measurable fun x => ‖f x - y₀‖ := by
simp only [← dist_eq_norm]
exact (continuous_id.dist continuous_const).measurable.comp fmeas
refine ⟨h_meas.aemeasurable.aestronglyMeasurable, ?_⟩
rw [eLpNorm_norm]
convert eLpNorm_add_lt_top hf hi₀.neg with x
simp [sub_eq_add_neg]
have : ∀ᵐ x ∂μ, ‖approxOn f fmeas s y₀ h₀ n x - y₀‖ ≤ ‖‖f x - y₀‖ + ‖f x - y₀‖‖ := by
filter_upwards with x
convert norm_approxOn_y₀_le fmeas h₀ x n using 1
rw [Real.norm_eq_abs, abs_of_nonneg]
positivity
calc
eLpNorm (fun x => approxOn f fmeas s y₀ h₀ n x - y₀) p μ ≤
eLpNorm (fun x => ‖f x - y₀‖ + ‖f x - y₀‖) p μ :=
eLpNorm_mono_ae this
_ < ⊤ := eLpNorm_add_lt_top hf' hf'
theorem tendsto_approxOn_range_Lp_eLpNorm [BorelSpace E] {f : β → E} (hp_ne_top : p ≠ ∞)
{μ : Measure β} (fmeas : Measurable f) [SeparableSpace (range f ∪ {0} : Set E)]
(hf : eLpNorm f p μ < ∞) :
Tendsto (fun n => eLpNorm (⇑(approxOn f fmeas (range f ∪ {0}) 0 (by simp) n) - f) p μ)
atTop (𝓝 0) := by
refine tendsto_approxOn_Lp_eLpNorm fmeas _ hp_ne_top ?_ ?_
· filter_upwards with x using subset_closure (by simp)
· simpa using hf
@[deprecated (since := "2024-07-27")]
alias tendsto_approxOn_range_Lp_snorm := tendsto_approxOn_range_Lp_eLpNorm
theorem memℒp_approxOn_range [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
[SeparableSpace (range f ∪ {0} : Set E)] (hf : Memℒp f p μ) (n : ℕ) :
Memℒp (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n) p μ :=
memℒp_approxOn fmeas hf (y₀ := 0) (by simp) zero_memℒp n
theorem tendsto_approxOn_range_Lp [BorelSpace E] {f : β → E} [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞)
{μ : Measure β} (fmeas : Measurable f) [SeparableSpace (range f ∪ {0} : Set E)]
(hf : Memℒp f p μ) :
Tendsto
(fun n =>
(memℒp_approxOn_range fmeas hf n).toLp (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n))
atTop (𝓝 (hf.toLp f)) := by
simpa only [Lp.tendsto_Lp_iff_tendsto_ℒp''] using
tendsto_approxOn_range_Lp_eLpNorm hp_ne_top fmeas hf.2
/-- Any function in `ℒp` can be approximated by a simple function if `p < ∞`. -/
theorem _root_.MeasureTheory.Memℒp.exists_simpleFunc_eLpNorm_sub_lt {E : Type*}
[NormedAddCommGroup E] {f : β → E} {μ : Measure β} (hf : Memℒp f p μ) (hp_ne_top : p ≠ ∞)
{ε : ℝ≥0∞} (hε : ε ≠ 0) : ∃ g : β →ₛ E, eLpNorm (f - ⇑g) p μ < ε ∧ Memℒp g p μ := by
borelize E
let f' := hf.1.mk f
rsuffices ⟨g, hg, g_mem⟩ : ∃ g : β →ₛ E, eLpNorm (f' - ⇑g) p μ < ε ∧ Memℒp g p μ
· refine ⟨g, ?_, g_mem⟩
suffices eLpNorm (f - ⇑g) p μ = eLpNorm (f' - ⇑g) p μ by rwa [this]
apply eLpNorm_congr_ae
filter_upwards [hf.1.ae_eq_mk] with x hx
simpa only [Pi.sub_apply, sub_left_inj] using hx
have hf' : Memℒp f' p μ := hf.ae_eq hf.1.ae_eq_mk
have f'meas : Measurable f' := hf.1.measurable_mk
have : SeparableSpace (range f' ∪ {0} : Set E) :=
StronglyMeasurable.separableSpace_range_union_singleton hf.1.stronglyMeasurable_mk
rcases ((tendsto_approxOn_range_Lp_eLpNorm hp_ne_top f'meas hf'.2).eventually <|
gt_mem_nhds hε.bot_lt).exists with ⟨n, hn⟩
rw [← eLpNorm_neg, neg_sub] at hn
exact ⟨_, hn, memℒp_approxOn_range f'meas hf' _⟩
@[deprecated (since := "2024-07-27")]
alias _root_.MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt :=
_root_.MeasureTheory.Memℒp.exists_simpleFunc_eLpNorm_sub_lt
end Lp
/-! ### L1 approximation by simple functions -/
section Integrable
variable [MeasurableSpace β]
variable [MeasurableSpace E] [NormedAddCommGroup E]
theorem tendsto_approxOn_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f)
{s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] {μ : Measure β}
(hμ : ∀ᵐ x ∂μ, f x ∈ closure s) (hi : HasFiniteIntegral (fun x => f x - y₀) μ) :
Tendsto (fun n => ∫⁻ x, ‖approxOn f hf s y₀ h₀ n x - f x‖₊ ∂μ) atTop (𝓝 0) := by
simpa [eLpNorm_one_eq_lintegral_nnnorm] using
tendsto_approxOn_Lp_eLpNorm hf h₀ one_ne_top hμ
(by simpa [eLpNorm_one_eq_lintegral_nnnorm] using hi)
theorem integrable_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
(hf : Integrable f μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
(hi₀ : Integrable (fun _ => y₀) μ) (n : ℕ) : Integrable (approxOn f fmeas s y₀ h₀ n) μ := by
rw [← memℒp_one_iff_integrable] at hf hi₀ ⊢
exact memℒp_approxOn fmeas hf h₀ hi₀ n
theorem tendsto_approxOn_range_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} {μ : Measure β}
[SeparableSpace (range f ∪ {0} : Set E)] (fmeas : Measurable f) (hf : Integrable f μ) :
Tendsto (fun n => ∫⁻ x, ‖approxOn f fmeas (range f ∪ {0}) 0 (by simp) n x - f x‖₊ ∂μ) atTop
(𝓝 0) := by
apply tendsto_approxOn_L1_nnnorm fmeas
· filter_upwards with x using subset_closure (by simp)
· simpa using hf.2
theorem integrable_approxOn_range [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
[SeparableSpace (range f ∪ {0} : Set E)] (hf : Integrable f μ) (n : ℕ) :
Integrable (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n) μ :=
integrable_approxOn fmeas hf _ (integrable_zero _ _ _) n
end Integrable
section SimpleFuncProperties
variable [MeasurableSpace α]
variable [NormedAddCommGroup E] [NormedAddCommGroup F]
variable {μ : Measure α} {p : ℝ≥0∞}
/-!
### Properties of simple functions in `Lp` spaces
A simple function `f : α →ₛ E` into a normed group `E` verifies, for a measure `μ`:
- `Memℒp f 0 μ` and `Memℒp f ∞ μ`, since `f` is a.e.-measurable and bounded,
- for `0 < p < ∞`,
`Memℒp f p μ ↔ Integrable f μ ↔ f.FinMeasSupp μ ↔ ∀ y, y ≠ 0 → μ (f ⁻¹' {y}) < ∞`.
-/
theorem exists_forall_norm_le (f : α →ₛ F) : ∃ C, ∀ x, ‖f x‖ ≤ C :=
exists_forall_le (f.map fun x => ‖x‖)
theorem memℒp_zero (f : α →ₛ E) (μ : Measure α) : Memℒp f 0 μ :=
memℒp_zero_iff_aestronglyMeasurable.mpr f.aestronglyMeasurable
theorem memℒp_top (f : α →ₛ E) (μ : Measure α) : Memℒp f ∞ μ :=
let ⟨C, hfC⟩ := f.exists_forall_norm_le
memℒp_top_of_bound f.aestronglyMeasurable C <| eventually_of_forall hfC
protected theorem eLpNorm'_eq {p : ℝ} (f : α →ₛ F) (μ : Measure α) :
eLpNorm' f p μ = (∑ y ∈ f.range, (‖y‖₊ : ℝ≥0∞) ^ p * μ (f ⁻¹' {y})) ^ (1 / p) := by
have h_map : (fun a => (‖f a‖₊ : ℝ≥0∞) ^ p) = f.map fun a : F => (‖a‖₊ : ℝ≥0∞) ^ p := by
simp; rfl
rw [eLpNorm', h_map, lintegral_eq_lintegral, map_lintegral]
@[deprecated (since := "2024-07-27")]
protected alias snorm'_eq := SimpleFunc.eLpNorm'_eq
theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) (f : α →ₛ E)
(hf : Memℒp f p μ) (y : E) (hy_ne : y ≠ 0) : μ (f ⁻¹' {y}) < ∞ := by
have hp_pos_real : 0 < p.toReal := ENNReal.toReal_pos hp_pos hp_ne_top
have hf_eLpNorm := Memℒp.eLpNorm_lt_top hf
rw [eLpNorm_eq_eLpNorm' hp_pos hp_ne_top, f.eLpNorm'_eq, one_div,
← @ENNReal.lt_rpow_inv_iff _ _ p.toReal⁻¹ (by simp [hp_pos_real]),
@ENNReal.top_rpow_of_pos p.toReal⁻¹⁻¹ (by simp [hp_pos_real]),
ENNReal.sum_lt_top_iff] at hf_eLpNorm
by_cases hyf : y ∈ f.range
swap
· suffices h_empty : f ⁻¹' {y} = ∅ by
rw [h_empty, measure_empty]; exact ENNReal.coe_lt_top
ext1 x
rw [Set.mem_preimage, Set.mem_singleton_iff, mem_empty_iff_false, iff_false_iff]
refine fun hxy => hyf ?_
rw [mem_range, Set.mem_range]
exact ⟨x, hxy⟩
specialize hf_eLpNorm y hyf
rw [ENNReal.mul_lt_top_iff] at hf_eLpNorm
cases hf_eLpNorm with
| inl hf_eLpNorm => exact hf_eLpNorm.2
| inr hf_eLpNorm =>
cases hf_eLpNorm with
| inl hf_eLpNorm =>
refine absurd ?_ hy_ne
simpa [hp_pos_real] using hf_eLpNorm
| inr hf_eLpNorm => simp [hf_eLpNorm]
theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
(hf : ∀ y, y ≠ 0 → μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ := by
by_cases hp0 : p = 0
· rw [hp0, memℒp_zero_iff_aestronglyMeasurable]; exact f.aestronglyMeasurable
by_cases hp_top : p = ∞
· rw [hp_top]; exact memℒp_top f μ
refine ⟨f.aestronglyMeasurable, ?_⟩
rw [eLpNorm_eq_eLpNorm' hp0 hp_top, f.eLpNorm'_eq]
refine ENNReal.rpow_lt_top_of_nonneg (by simp) (ENNReal.sum_lt_top_iff.mpr fun y _ => ?_).ne
by_cases hy0 : y = 0
· simp [hy0, ENNReal.toReal_pos hp0 hp_top]
· refine ENNReal.mul_lt_top ?_ (hf y hy0).ne
exact (ENNReal.rpow_lt_top_of_nonneg ENNReal.toReal_nonneg ENNReal.coe_ne_top).ne
theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
Memℒp f p μ ↔ ∀ y, y ≠ 0 → μ (f ⁻¹' {y}) < ∞ :=
⟨fun h => measure_preimage_lt_top_of_memℒp hp_pos hp_ne_top f h, fun h =>
memℒp_of_finite_measure_preimage p h⟩
theorem integrable_iff {f : α →ₛ E} : Integrable f μ ↔ ∀ y, y ≠ 0 → μ (f ⁻¹' {y}) < ∞ :=
memℒp_one_iff_integrable.symm.trans <| memℒp_iff one_ne_zero ENNReal.coe_ne_top
theorem memℒp_iff_integrable {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
Memℒp f p μ ↔ Integrable f μ :=
(memℒp_iff hp_pos hp_ne_top).trans integrable_iff.symm
theorem memℒp_iff_finMeasSupp {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
Memℒp f p μ ↔ f.FinMeasSupp μ :=
(memℒp_iff hp_pos hp_ne_top).trans finMeasSupp_iff.symm
theorem integrable_iff_finMeasSupp {f : α →ₛ E} : Integrable f μ ↔ f.FinMeasSupp μ :=
integrable_iff.trans finMeasSupp_iff.symm
theorem FinMeasSupp.integrable {f : α →ₛ E} (h : f.FinMeasSupp μ) : Integrable f μ :=
integrable_iff_finMeasSupp.2 h
theorem integrable_pair {f : α →ₛ E} {g : α →ₛ F} :
Integrable f μ → Integrable g μ → Integrable (pair f g) μ := by
simpa only [integrable_iff_finMeasSupp] using FinMeasSupp.pair
theorem memℒp_of_isFiniteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [IsFiniteMeasure μ] :
Memℒp f p μ :=
let ⟨C, hfC⟩ := f.exists_forall_norm_le
Memℒp.of_bound f.aestronglyMeasurable C <| eventually_of_forall hfC
theorem integrable_of_isFiniteMeasure [IsFiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
memℒp_one_iff_integrable.mp (f.memℒp_of_isFiniteMeasure 1 μ)
theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable f μ) {x : E}
(hx : x ≠ 0) : μ (f ⁻¹' {x}) < ∞ :=
integrable_iff.mp hf x hx
theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ y, y ≠ 0 → μ (f ⁻¹' {y}) < ∞) :
μ (support f) < ∞ := by
rw [support_eq]
refine (measure_biUnion_finset_le _ _).trans_lt (ENNReal.sum_lt_top_iff.mpr fun y hy => ?_)
rw [Finset.mem_filter] at hy
exact hf y hy.2
theorem measure_support_lt_top_of_memℒp (f : α →ₛ E) (hf : Memℒp f p μ) (hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ∞) : μ (support f) < ∞ :=
f.measure_support_lt_top ((memℒp_iff hp_ne_zero hp_ne_top).mp hf)
theorem measure_support_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable f μ) :
μ (support f) < ∞ :=
f.measure_support_lt_top (integrable_iff.mp hf)
theorem measure_lt_top_of_memℒp_indicator (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) {c : E} (hc : c ≠ 0)
{s : Set α} (hs : MeasurableSet s) (hcs : Memℒp ((const α c).piecewise s hs (const α 0)) p μ) :
μ s < ⊤ := by
have : Function.support (const α c) = Set.univ := Function.support_const hc
simpa only [memℒp_iff_finMeasSupp hp_pos hp_ne_top, finMeasSupp_iff_support,
support_indicator, Set.inter_univ, this] using hcs
end SimpleFuncProperties
end SimpleFunc
/-! Construction of the space of `Lp` simple functions, and its dense embedding into `Lp`. -/
namespace Lp
open AEEqFun
variable [MeasurableSpace α] [NormedAddCommGroup E] [NormedAddCommGroup F] (p : ℝ≥0∞)
(μ : Measure α)
variable (E)
-- Porting note: the proofs were rewritten in tactic mode to avoid an
-- "unknown free variable '_uniq.546677'" error.
/-- `Lp.simpleFunc` is a subspace of Lp consisting of equivalence classes of an integrable simple
function. -/
def simpleFunc : AddSubgroup (Lp E p μ) where
carrier := { f : Lp E p μ | ∃ s : α →ₛ E, (AEEqFun.mk s s.aestronglyMeasurable : α →ₘ[μ] E) = f }
zero_mem' := ⟨0, rfl⟩
add_mem' := by
rintro f g ⟨s, hs⟩ ⟨t, ht⟩
use s + t
simp only [← hs, ← ht, AEEqFun.mk_add_mk, AddSubgroup.coe_add, AEEqFun.mk_eq_mk,
SimpleFunc.coe_add]
neg_mem' := by
rintro f ⟨s, hs⟩
use -s
simp only [← hs, AEEqFun.neg_mk, SimpleFunc.coe_neg, AEEqFun.mk_eq_mk, AddSubgroup.coe_neg]
variable {E p μ}
namespace simpleFunc
section Instances
/-! Simple functions in Lp space form a `NormedSpace`. -/
protected theorem eq' {f g : Lp.simpleFunc E p μ} : (f : α →ₘ[μ] E) = (g : α →ₘ[μ] E) → f = g :=
Subtype.eq ∘ Subtype.eq
/-! Implementation note: If `Lp.simpleFunc E p μ` were defined as a `𝕜`-submodule of `Lp E p μ`,
then the next few lemmas, putting a normed `𝕜`-group structure on `Lp.simpleFunc E p μ`, would be
unnecessary. But instead, `Lp.simpleFunc E p μ` is defined as an `AddSubgroup` of `Lp E p μ`,
which does not permit this (but has the advantage of working when `E` itself is a normed group,
i.e. has no scalar action). -/
variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
/-- If `E` is a normed space, `Lp.simpleFunc E p μ` is a `SMul`. Not declared as an
instance as it is (as of writing) used only in the construction of the Bochner integral. -/
protected def smul : SMul 𝕜 (Lp.simpleFunc E p μ) :=
⟨fun k f =>
⟨k • (f : Lp E p μ), by
rcases f with ⟨f, ⟨s, hs⟩⟩
use k • s
apply Eq.trans (AEEqFun.smul_mk k s s.aestronglyMeasurable).symm _
rw [hs]
rfl⟩⟩
attribute [local instance] simpleFunc.smul
@[simp, norm_cast]
theorem coe_smul (c : 𝕜) (f : Lp.simpleFunc E p μ) :
((c • f : Lp.simpleFunc E p μ) : Lp E p μ) = c • (f : Lp E p μ) :=
rfl
/-- If `E` is a normed space, `Lp.simpleFunc E p μ` is a module. Not declared as an
instance as it is (as of writing) used only in the construction of the Bochner integral. -/
protected def module : Module 𝕜 (Lp.simpleFunc E p μ) where
one_smul f := by ext1; exact one_smul _ _
mul_smul x y f := by ext1; exact mul_smul _ _ _
smul_add x f g := by ext1; exact smul_add _ _ _
smul_zero x := by ext1; exact smul_zero _
add_smul x y f := by ext1; exact add_smul _ _ _
zero_smul f := by ext1; exact zero_smul _ _
attribute [local instance] simpleFunc.module
/-- If `E` is a normed space, `Lp.simpleFunc E p μ` is a normed space. Not declared as an
instance as it is (as of writing) used only in the construction of the Bochner integral. -/
protected theorem boundedSMul [Fact (1 ≤ p)] : BoundedSMul 𝕜 (Lp.simpleFunc E p μ) :=
BoundedSMul.of_norm_smul_le fun r f => (norm_smul_le r (f : Lp E p μ) : _)
attribute [local instance] simpleFunc.boundedSMul
/-- If `E` is a normed space, `Lp.simpleFunc E p μ` is a normed space. Not declared as an
instance as it is (as of writing) used only in the construction of the Bochner integral. -/
protected def normedSpace {𝕜} [NormedField 𝕜] [NormedSpace 𝕜 E] [Fact (1 ≤ p)] :
NormedSpace 𝕜 (Lp.simpleFunc E p μ) :=
⟨norm_smul_le (α := 𝕜) (β := Lp.simpleFunc E p μ)⟩
end Instances
attribute [local instance] simpleFunc.module simpleFunc.normedSpace simpleFunc.boundedSMul
section ToLp
/-- Construct the equivalence class `[f]` of a simple function `f` satisfying `Memℒp`. -/
abbrev toLp (f : α →ₛ E) (hf : Memℒp f p μ) : Lp.simpleFunc E p μ :=
⟨hf.toLp f, ⟨f, rfl⟩⟩
theorem toLp_eq_toLp (f : α →ₛ E) (hf : Memℒp f p μ) : (toLp f hf : Lp E p μ) = hf.toLp f :=
rfl
theorem toLp_eq_mk (f : α →ₛ E) (hf : Memℒp f p μ) :
(toLp f hf : α →ₘ[μ] E) = AEEqFun.mk f f.aestronglyMeasurable :=
rfl
theorem toLp_zero : toLp (0 : α →ₛ E) zero_memℒp = (0 : Lp.simpleFunc E p μ) :=
rfl
theorem toLp_add (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
toLp (f + g) (hf.add hg) = toLp f hf + toLp g hg :=
rfl
theorem toLp_neg (f : α →ₛ E) (hf : Memℒp f p μ) : toLp (-f) hf.neg = -toLp f hf :=
rfl
theorem toLp_sub (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
toLp (f - g) (hf.sub hg) = toLp f hf - toLp g hg := by
simp only [sub_eq_add_neg, ← toLp_neg, ← toLp_add]
variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
theorem toLp_smul (f : α →ₛ E) (hf : Memℒp f p μ) (c : 𝕜) :
toLp (c • f) (hf.const_smul c) = c • toLp f hf :=
rfl
nonrec theorem norm_toLp [Fact (1 ≤ p)] (f : α →ₛ E) (hf : Memℒp f p μ) :
‖toLp f hf‖ = ENNReal.toReal (eLpNorm f p μ) :=
norm_toLp f hf
end ToLp
section ToSimpleFunc
/-- Find a representative of a `Lp.simpleFunc`. -/
def toSimpleFunc (f : Lp.simpleFunc E p μ) : α →ₛ E :=
Classical.choose f.2
/-- `(toSimpleFunc f)` is measurable. -/
@[measurability]
protected theorem measurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
Measurable (toSimpleFunc f) :=
(toSimpleFunc f).measurable
protected theorem stronglyMeasurable (f : Lp.simpleFunc E p μ) :
StronglyMeasurable (toSimpleFunc f) :=
(toSimpleFunc f).stronglyMeasurable
@[measurability]
protected theorem aemeasurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
AEMeasurable (toSimpleFunc f) μ :=
(simpleFunc.measurable f).aemeasurable
protected theorem aestronglyMeasurable (f : Lp.simpleFunc E p μ) :
AEStronglyMeasurable (toSimpleFunc f) μ :=
(simpleFunc.stronglyMeasurable f).aestronglyMeasurable
theorem toSimpleFunc_eq_toFun (f : Lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[μ] f :=
show ⇑(toSimpleFunc f) =ᵐ[μ] ⇑(f : α →ₘ[μ] E) by
convert (AEEqFun.coeFn_mk (toSimpleFunc f)
(toSimpleFunc f).aestronglyMeasurable).symm using 2
exact (Classical.choose_spec f.2).symm
/-- `toSimpleFunc f` satisfies the predicate `Memℒp`. -/
protected theorem memℒp (f : Lp.simpleFunc E p μ) : Memℒp (toSimpleFunc f) p μ :=
Memℒp.ae_eq (toSimpleFunc_eq_toFun f).symm <| mem_Lp_iff_memℒp.mp (f : Lp E p μ).2
theorem toLp_toSimpleFunc (f : Lp.simpleFunc E p μ) :
toLp (toSimpleFunc f) (simpleFunc.memℒp f) = f :=
simpleFunc.eq' (Classical.choose_spec f.2)
theorem toSimpleFunc_toLp (f : α →ₛ E) (hfi : Memℒp f p μ) : toSimpleFunc (toLp f hfi) =ᵐ[μ] f := by
rw [← AEEqFun.mk_eq_mk]; exact Classical.choose_spec (toLp f hfi).2
variable (E μ)
theorem zero_toSimpleFunc : toSimpleFunc (0 : Lp.simpleFunc E p μ) =ᵐ[μ] 0 := by
filter_upwards [toSimpleFunc_eq_toFun (0 : Lp.simpleFunc E p μ),
Lp.coeFn_zero E 1 μ] with _ h₁ _
rwa [h₁]
variable {E μ}
theorem add_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
toSimpleFunc (f + g) =ᵐ[μ] toSimpleFunc f + toSimpleFunc g := by
filter_upwards [toSimpleFunc_eq_toFun (f + g), toSimpleFunc_eq_toFun f,
toSimpleFunc_eq_toFun g, Lp.coeFn_add (f : Lp E p μ) g] with _
simp only [AddSubgroup.coe_add, Pi.add_apply]
iterate 4 intro h; rw [h]
theorem neg_toSimpleFunc (f : Lp.simpleFunc E p μ) : toSimpleFunc (-f) =ᵐ[μ] -toSimpleFunc f := by
filter_upwards [toSimpleFunc_eq_toFun (-f), toSimpleFunc_eq_toFun f,
Lp.coeFn_neg (f : Lp E p μ)] with _
simp only [Pi.neg_apply, AddSubgroup.coe_neg]
repeat intro h; rw [h]
theorem sub_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
toSimpleFunc (f - g) =ᵐ[μ] toSimpleFunc f - toSimpleFunc g := by
filter_upwards [toSimpleFunc_eq_toFun (f - g), toSimpleFunc_eq_toFun f,
toSimpleFunc_eq_toFun g, Lp.coeFn_sub (f : Lp E p μ) g] with _
simp only [AddSubgroup.coe_sub, Pi.sub_apply]
repeat' intro h; rw [h]
variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
theorem smul_toSimpleFunc (k : 𝕜) (f : Lp.simpleFunc E p μ) :
toSimpleFunc (k • f) =ᵐ[μ] k • ⇑(toSimpleFunc f) := by
filter_upwards [toSimpleFunc_eq_toFun (k • f), toSimpleFunc_eq_toFun f,
Lp.coeFn_smul k (f : Lp E p μ)] with _
simp only [Pi.smul_apply, coe_smul]
repeat intro h; rw [h]
theorem norm_toSimpleFunc [Fact (1 ≤ p)] (f : Lp.simpleFunc E p μ) :
‖f‖ = ENNReal.toReal (eLpNorm (toSimpleFunc f) p μ) := by
simpa [toLp_toSimpleFunc] using norm_toLp (toSimpleFunc f) (simpleFunc.memℒp f)
end ToSimpleFunc
section Induction
variable (p)
/-- The characteristic function of a finite-measure measurable set `s`, as an `Lp` simple function.
-/
def indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
Lp.simpleFunc E p μ :=
toLp ((SimpleFunc.const _ c).piecewise s hs (SimpleFunc.const _ 0))
(memℒp_indicator_const p hs c (Or.inr hμs))
variable {p}
@[simp]
theorem coe_indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
(↑(indicatorConst p hs hμs c) : Lp E p μ) = indicatorConstLp p hs hμs c :=
rfl
theorem toSimpleFunc_indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
toSimpleFunc (indicatorConst p hs hμs c) =ᵐ[μ]
(SimpleFunc.const _ c).piecewise s hs (SimpleFunc.const _ 0) :=
Lp.simpleFunc.toSimpleFunc_toLp _ _
/-- To prove something for an arbitrary `Lp` simple function, with `0 < p < ∞`, it suffices to show
that the property holds for (multiples of) characteristic functions of finite-measure measurable
sets and is closed under addition (of functions with disjoint support). -/
@[elab_as_elim]
protected theorem induction (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) {P : Lp.simpleFunc E p μ → Prop}
(h_ind :
∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ∞),
P (Lp.simpleFunc.indicatorConst p hs hμs.ne c))
(h_add :
∀ ⦃f g : α →ₛ E⦄,
∀ hf : Memℒp f p μ,
∀ hg : Memℒp 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))
(f : Lp.simpleFunc E p μ) : P f := by
suffices ∀ f : α →ₛ E, ∀ hf : Memℒp f p μ, P (toLp f hf) by
rw [← toLp_toSimpleFunc f]
apply this
clear f
apply SimpleFunc.induction
· intro c s hs hf
by_cases hc : c = 0
· convert h_ind 0 MeasurableSet.empty (by simp) using 1
ext1
simp [hc]
exact h_ind c hs (SimpleFunc.measure_lt_top_of_memℒp_indicator hp_pos hp_ne_top hc hs hf)
· intro f g hfg hf hg hfg'
obtain ⟨hf', hg'⟩ : Memℒp f p μ ∧ Memℒp g p μ :=
(memℒp_add_of_disjoint hfg f.stronglyMeasurable g.stronglyMeasurable).mp hfg'
exact h_add hf' hg' hfg (hf hf') (hg hg')
end Induction
section CoeToLp
variable [Fact (1 ≤ p)]
protected theorem uniformContinuous : UniformContinuous ((↑) : Lp.simpleFunc E p μ → Lp E p μ) :=
uniformContinuous_comap
protected theorem uniformEmbedding : UniformEmbedding ((↑) : Lp.simpleFunc E p μ → Lp E p μ) :=
uniformEmbedding_comap Subtype.val_injective
protected theorem uniformInducing : UniformInducing ((↑) : Lp.simpleFunc E p μ → Lp E p μ) :=
simpleFunc.uniformEmbedding.toUniformInducing
protected theorem denseEmbedding (hp_ne_top : p ≠ ∞) :
DenseEmbedding ((↑) : Lp.simpleFunc E p μ → Lp E p μ) := by
borelize E
apply simpleFunc.uniformEmbedding.denseEmbedding
intro f
rw [mem_closure_iff_seq_limit]
have hfi' : Memℒp f p μ := Lp.memℒp f
haveI : SeparableSpace (range f ∪ {0} : Set E) :=
(Lp.stronglyMeasurable f).separableSpace_range_union_singleton
refine
⟨fun n =>
toLp
(SimpleFunc.approxOn f (Lp.stronglyMeasurable f).measurable (range f ∪ {0}) 0 _ n)
(SimpleFunc.memℒp_approxOn_range (Lp.stronglyMeasurable f).measurable hfi' n),
fun n => mem_range_self _, ?_⟩
convert SimpleFunc.tendsto_approxOn_range_Lp hp_ne_top (Lp.stronglyMeasurable f).measurable hfi'
rw [toLp_coeFn f (Lp.memℒp f)]
protected theorem denseInducing (hp_ne_top : p ≠ ∞) :
DenseInducing ((↑) : Lp.simpleFunc E p μ → Lp E p μ) :=
(simpleFunc.denseEmbedding hp_ne_top).toDenseInducing
protected theorem denseRange (hp_ne_top : p ≠ ∞) :
DenseRange ((↑) : Lp.simpleFunc E p μ → Lp E p μ) :=
(simpleFunc.denseInducing hp_ne_top).dense
protected theorem dense (hp_ne_top : p ≠ ∞) : Dense (Lp.simpleFunc E p μ : Set (Lp E p μ)) := by
simpa only [denseRange_subtype_val] using simpleFunc.denseRange (E := E) (μ := μ) hp_ne_top
variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
variable (α E 𝕜)
/-- The embedding of Lp simple functions into Lp functions, as a continuous linear map. -/
def coeToLp : Lp.simpleFunc E p μ →L[𝕜] Lp E p μ :=
{ AddSubgroup.subtype (Lp.simpleFunc E p μ) with
map_smul' := fun _ _ => rfl
cont := Lp.simpleFunc.uniformContinuous.continuous }
variable {α E 𝕜}
end CoeToLp
section Order
variable {G : Type*} [NormedLatticeAddCommGroup G]
theorem coeFn_le (f g : Lp.simpleFunc G p μ) : (f : α → G) ≤ᵐ[μ] g ↔ f ≤ g := by
rw [← Subtype.coe_le_coe, ← Lp.coeFn_le]
instance instCovariantClassLE :
CovariantClass (Lp.simpleFunc G p μ) (Lp.simpleFunc G p μ) (· + ·) (· ≤ ·) := by
refine ⟨fun f g₁ g₂ hg₁₂ => ?_⟩
rw [← Lp.simpleFunc.coeFn_le] at hg₁₂ ⊢
have h_add_1 : ((f + g₁ : Lp.simpleFunc G p μ) : α → G) =ᵐ[μ] (f : α → G) + g₁ := Lp.coeFn_add _ _
have h_add_2 : ((f + g₂ : Lp.simpleFunc G p μ) : α → G) =ᵐ[μ] (f : α → G) + g₂ := Lp.coeFn_add _ _
filter_upwards [h_add_1, h_add_2, hg₁₂] with _ h1 h2 h3
rw [h1, h2, Pi.add_apply, Pi.add_apply]
exact add_le_add le_rfl h3
variable (p μ G)
theorem coeFn_zero : (0 : Lp.simpleFunc G p μ) =ᵐ[μ] (0 : α → G) :=
Lp.coeFn_zero _ _ _
variable {p μ G}
theorem coeFn_nonneg (f : Lp.simpleFunc G p μ) : (0 : α → G) ≤ᵐ[μ] f ↔ 0 ≤ f := by
rw [← Subtype.coe_le_coe, Lp.coeFn_nonneg, AddSubmonoid.coe_zero]
theorem exists_simpleFunc_nonneg_ae_eq {f : Lp.simpleFunc G p μ} (hf : 0 ≤ f) :
∃ f' : α →ₛ G, 0 ≤ f' ∧ f =ᵐ[μ] f' := by
rcases f with ⟨⟨f, hp⟩, g, (rfl : _ = f)⟩
change 0 ≤ᵐ[μ] g at hf
refine ⟨g ⊔ 0, le_sup_right, (AEEqFun.coeFn_mk _ _).trans ?_⟩
exact hf.mono fun x hx ↦ (sup_of_le_left hx).symm
variable (p μ G)
/-- Coercion from nonnegative simple functions of Lp to nonnegative functions of Lp. -/
def coeSimpleFuncNonnegToLpNonneg :
{ g : Lp.simpleFunc G p μ // 0 ≤ g } → { g : Lp G p μ // 0 ≤ g } := fun g => ⟨g, g.2⟩
theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) :
DenseRange (coeSimpleFuncNonnegToLpNonneg p μ G) := fun g ↦ by
borelize G
rw [mem_closure_iff_seq_limit]
have hg_memℒp : Memℒp (g : α → G) p μ := Lp.memℒp (g : Lp G p μ)
have zero_mem : (0 : G) ∈ (range (g : α → G) ∪ {0} : Set G) ∩ { y | 0 ≤ y } := by
simp only [union_singleton, mem_inter_iff, mem_insert_iff, eq_self_iff_true, true_or_iff,
mem_setOf_eq, le_refl, and_self_iff]
have : SeparableSpace ((range (g : α → G) ∪ {0}) ∩ { y | 0 ≤ y } : Set G) := by
apply IsSeparable.separableSpace
apply IsSeparable.mono _ Set.inter_subset_left
exact
(Lp.stronglyMeasurable (g : Lp G p μ)).isSeparable_range.union
(finite_singleton _).isSeparable
have g_meas : Measurable (g : α → G) := (Lp.stronglyMeasurable (g : Lp G p μ)).measurable
let x n := SimpleFunc.approxOn g g_meas ((range (g : α → G) ∪ {0}) ∩ { y | 0 ≤ y }) 0 zero_mem n
have hx_nonneg : ∀ n, 0 ≤ x n := by
intro n a
change x n a ∈ { y : G | 0 ≤ y }
have A : (range (g : α → G) ∪ {0} : Set G) ∩ { y | 0 ≤ y } ⊆ { y | 0 ≤ y } :=
inter_subset_right
apply A
exact SimpleFunc.approxOn_mem g_meas _ n a
have hx_memℒp : ∀ n, Memℒp (x n) p μ :=
SimpleFunc.memℒp_approxOn _ hg_memℒp _ ⟨aestronglyMeasurable_const, by simp⟩
have h_toLp := fun n => Memℒp.coeFn_toLp (hx_memℒp n)
have hx_nonneg_Lp : ∀ n, 0 ≤ toLp (x n) (hx_memℒp n) := by
intro n
rw [← Lp.simpleFunc.coeFn_le, Lp.simpleFunc.toLp_eq_toLp]
filter_upwards [Lp.simpleFunc.coeFn_zero p μ G, h_toLp n] with a ha0 ha_toLp
rw [ha0, ha_toLp]
exact hx_nonneg n a
have hx_tendsto :
Tendsto (fun n : ℕ => eLpNorm ((x n : α → G) - (g : α → G)) p μ) atTop (𝓝 0) := by
apply SimpleFunc.tendsto_approxOn_Lp_eLpNorm g_meas zero_mem hp_ne_top
· have hg_nonneg : (0 : α → G) ≤ᵐ[μ] g := (Lp.coeFn_nonneg _).mpr g.2
refine hg_nonneg.mono fun a ha => subset_closure ?_
simpa using ha
· simp_rw [sub_zero]; exact hg_memℒp.eLpNorm_lt_top
refine
⟨fun n =>
(coeSimpleFuncNonnegToLpNonneg p μ G) ⟨toLp (x n) (hx_memℒp n), hx_nonneg_Lp n⟩,
fun n => mem_range_self _, ?_⟩
suffices Tendsto (fun n : ℕ => (toLp (x n) (hx_memℒp n) : Lp G p μ)) atTop (𝓝 (g : Lp G p μ)) by
rw [tendsto_iff_dist_tendsto_zero] at this ⊢
simp_rw [Subtype.dist_eq]
exact this
rw [Lp.tendsto_Lp_iff_tendsto_ℒp']
refine Filter.Tendsto.congr (fun n => eLpNorm_congr_ae (EventuallyEq.sub ?_ ?_)) hx_tendsto
· symm
rw [Lp.simpleFunc.toLp_eq_toLp]
exact h_toLp n
· rfl
variable {p μ G}
end Order
end simpleFunc
end Lp
variable [MeasurableSpace α] [NormedAddCommGroup E] {f : α → E} {p : ℝ≥0∞} {μ : Measure α}
/-- To prove something for an arbitrary `Lp` function in a second countable Borel normed group, it
suffices to show that
* the property holds for (multiples of) characteristic functions;
* is closed under addition;
* the set of functions in `Lp` for which the property holds is closed.
-/
@[elab_as_elim]
theorem Lp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : Lp E p μ → Prop)
(h_ind : ∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ∞),
P (Lp.simpleFunc.indicatorConst p hs hμs.ne c))
(h_add : ∀ ⦃f g⦄, ∀ hf : Memℒp f p μ, ∀ hg : Memℒp g p μ, Disjoint (support f) (support g) →
P (hf.toLp f) → P (hg.toLp g) → P (hf.toLp f + hg.toLp g))
(h_closed : IsClosed { f : Lp E p μ | P f }) : ∀ f : Lp E p μ, P f := by
refine fun f => (Lp.simpleFunc.denseRange hp_ne_top).induction_on f h_closed ?_
refine Lp.simpleFunc.induction (α := α) (E := E) (lt_of_lt_of_le zero_lt_one _i.elim).ne'
hp_ne_top ?_ ?_
· exact fun c s => h_ind c
· exact fun f g hf hg => h_add hf hg
/-- To prove something for an arbitrary `Memℒp` function in a second countable
Borel normed group, it suffices to show that
* the property holds for (multiples of) characteristic functions;
* is closed under addition;
* the set of functions in the `Lᵖ` space for which the property holds is closed.
* the property is closed under the almost-everywhere equal relation.
It is possible to make the hypotheses in the induction steps a bit stronger, and such conditions
can be added once we need them (for example in `h_add` it is only necessary to consider the sum of
a simple function with a multiple of a characteristic function and that the intersection
of their images is a subset of `{0}`).
-/
@[elab_as_elim]
theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop)
(h_ind : ∀ (c : E) ⦃s⦄, MeasurableSet s → μ s < ∞ → P (s.indicator fun _ => c))
(h_add : ∀ ⦃f g : α → E⦄, Disjoint (support f) (support g) → Memℒp f p μ → Memℒp g p μ →
P f → P g → P (f + g))
(h_closed : IsClosed { f : Lp E p μ | P f })
(h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Memℒp f p μ → P f → P g) :
∀ ⦃f : α → E⦄, Memℒp f p μ → P f := by
have : ∀ f : SimpleFunc α E, Memℒp f p μ → P f := by
apply SimpleFunc.induction
· intro c s hs h
by_cases hc : c = 0
· subst hc; convert h_ind 0 MeasurableSet.empty (by simp) using 1; ext; simp [const]
have hp_pos : p ≠ 0 := (lt_of_lt_of_le zero_lt_one _i.elim).ne'
exact h_ind c hs (SimpleFunc.measure_lt_top_of_memℒp_indicator hp_pos hp_ne_top hc hs h)
· intro f g hfg hf hg int_fg
rw [SimpleFunc.coe_add,
memℒp_add_of_disjoint hfg f.stronglyMeasurable g.stronglyMeasurable] at int_fg
exact h_add hfg int_fg.1 int_fg.2 (hf int_fg.1) (hg int_fg.2)
have : ∀ f : Lp.simpleFunc E p μ, P f := by
intro f
exact
h_ae (Lp.simpleFunc.toSimpleFunc_eq_toFun f) (Lp.simpleFunc.memℒp f)
(this (Lp.simpleFunc.toSimpleFunc f) (Lp.simpleFunc.memℒp f))
have : ∀ f : Lp E p μ, P f := fun f =>
(Lp.simpleFunc.denseRange hp_ne_top).induction_on f h_closed this
exact fun f hf => h_ae hf.coeFn_toLp (Lp.memℒp _) (this (hf.toLp f))
/-- If a set of ae strongly measurable functions is stable under addition and approximates
characteristic functions in `ℒp`, then it is dense in `ℒp`. -/
theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop)
(h0P :
∀ (c : E) ⦃s : Set α⦄,
MeasurableSet s →
μ s < ∞ →
∀ {ε : ℝ≥0∞}, ε ≠ 0 → ∃ g : α → E, eLpNorm (g - s.indicator fun _ => c) p μ ≤ ε ∧ P g)
(h1P : ∀ f g, P f → P g → P (f + g)) (h2P : ∀ f, P f → AEStronglyMeasurable f μ) {f : α → E}
(hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) : ∃ g : α → E, eLpNorm (f - g) p μ ≤ ε ∧ P g := by
rcases eq_or_ne p 0 with (rfl | hp_pos)
· rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, zero_lt_top])
hε with ⟨g, _, Pg⟩
exact ⟨g, by simp only [eLpNorm_exponent_zero, zero_le'], Pg⟩
suffices H : ∀ (f' : α →ₛ E) (δ : ℝ≥0∞) (hδ : δ ≠ 0), Memℒp f' p μ →
∃ g, eLpNorm (⇑f' - g) p μ ≤ δ ∧ P g by
obtain ⟨η, ηpos, hη⟩ := exists_Lp_half E μ p hε
rcases hf.exists_simpleFunc_eLpNorm_sub_lt hp_ne_top ηpos.ne' with ⟨f', hf', f'_mem⟩
rcases H f' η ηpos.ne' f'_mem with ⟨g, hg, Pg⟩
refine ⟨g, ?_, Pg⟩
convert (hη _ _ (hf.aestronglyMeasurable.sub f'.aestronglyMeasurable)
(f'.aestronglyMeasurable.sub (h2P g Pg)) hf'.le hg).le using 2
simp only [sub_add_sub_cancel]
apply SimpleFunc.induction
· intro c s hs ε εpos Hs
rcases eq_or_ne c 0 with (rfl | hc)
· rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, zero_lt_top])
εpos with ⟨g, hg, Pg⟩
rw [← eLpNorm_neg, neg_sub] at hg
refine ⟨g, ?_, Pg⟩
convert hg
ext x
simp only [SimpleFunc.const_zero, SimpleFunc.coe_piecewise, SimpleFunc.coe_zero,
piecewise_eq_indicator, indicator_zero', Pi.zero_apply, indicator_zero]
· have : μ s < ∞ := SimpleFunc.measure_lt_top_of_memℒp_indicator hp_pos hp_ne_top hc hs Hs
rcases h0P c hs this εpos with ⟨g, hg, Pg⟩
rw [← eLpNorm_neg, neg_sub] at hg
exact ⟨g, hg, Pg⟩
· intro f f' hff' hf hf' δ δpos int_ff'
obtain ⟨η, ηpos, hη⟩ := exists_Lp_half E μ p δpos
rw [SimpleFunc.coe_add,
memℒp_add_of_disjoint hff' f.stronglyMeasurable f'.stronglyMeasurable] at int_ff'
rcases hf η ηpos.ne' int_ff'.1 with ⟨g, hg, Pg⟩
rcases hf' η ηpos.ne' int_ff'.2 with ⟨g', hg', Pg'⟩
refine ⟨g + g', ?_, h1P g g' Pg Pg'⟩
convert (hη _ _ (f.aestronglyMeasurable.sub (h2P g Pg))
(f'.aestronglyMeasurable.sub (h2P g' Pg')) hg hg').le using 2
rw [SimpleFunc.coe_add]
abel
section Integrable
@[inherit_doc MeasureTheory.Lp.simpleFunc]
notation:25 α " →₁ₛ[" μ "] " E => @MeasureTheory.Lp.simpleFunc α E _ _ 1 μ
theorem L1.SimpleFunc.toLp_one_eq_toL1 (f : α →ₛ E) (hf : Integrable f μ) :
(Lp.simpleFunc.toLp f (memℒp_one_iff_integrable.2 hf) : α →₁[μ] E) = hf.toL1 f :=
rfl
protected theorem L1.SimpleFunc.integrable (f : α →₁ₛ[μ] E) :
Integrable (Lp.simpleFunc.toSimpleFunc f) μ := by
rw [← memℒp_one_iff_integrable]; exact Lp.simpleFunc.memℒp f
/-- To prove something for an arbitrary integrable function in a normed group,
it suffices to show that
* the property holds for (multiples of) characteristic functions;
* is closed under addition;
* the set of functions in the `L¹` space for which the property holds is closed.
* the property is closed under the almost-everywhere equal relation.
It is possible to make the hypotheses in the induction steps a bit stronger, and such conditions
can be added once we need them (for example in `h_add` it is only necessary to consider the sum of
a simple function with a multiple of a characteristic function and that the intersection
of their images is a subset of `{0}`).
-/
@[elab_as_elim]
theorem Integrable.induction (P : (α → E) → Prop)
(h_ind : ∀ (c : E) ⦃s⦄, MeasurableSet s → μ s < ∞ → P (s.indicator fun _ => c))
(h_add :
∀ ⦃f g : α → E⦄,
Disjoint (support f) (support g) → Integrable f μ → Integrable g μ → P f → P g → P (f + g))
(h_closed : IsClosed { f : α →₁[μ] E | P f })
(h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Integrable f μ → P f → P g) :
∀ ⦃f : α → E⦄, Integrable f μ → P f := by
simp only [← memℒp_one_iff_integrable] at *
exact Memℒp.induction one_ne_top (P := P) h_ind h_add h_closed h_ae
end Integrable
end MeasureTheory
|
MeasureTheory\Function\UniformIntegrable.lean | /-
Copyright (c) 2022 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying
-/
import Mathlib.MeasureTheory.Function.ConvergenceInMeasure
import Mathlib.MeasureTheory.Function.L1Space
/-!
# Uniform integrability
This file contains the definitions for uniform integrability (both in the measure theory sense
as well as the probability theory sense). This file also contains the Vitali convergence theorem
which establishes a relation between uniform integrability, convergence in measure and
Lp convergence.
Uniform integrability plays a vital role in the theory of martingales most notably is used to
formulate the martingale convergence theorem.
## Main definitions
* `MeasureTheory.UnifIntegrable`: uniform integrability in the measure theory sense.
In particular, a sequence of functions `f` is uniformly integrable if for all `ε > 0`, there
exists some `δ > 0` such that for all sets `s` of smaller measure than `δ`, the Lp-norm of
`f i` restricted `s` is smaller than `ε` for all `i`.
* `MeasureTheory.UniformIntegrable`: uniform integrability in the probability theory sense.
In particular, a sequence of measurable functions `f` is uniformly integrable in the
probability theory sense if it is uniformly integrable in the measure theory sense and
has uniformly bounded Lp-norm.
# Main results
* `MeasureTheory.unifIntegrable_finite`: a finite sequence of Lp functions is uniformly
integrable.
* `MeasureTheory.tendsto_Lp_finite_of_tendsto_ae`: a sequence of Lp functions which is uniformly
integrable converges in Lp if they converge almost everywhere.
* `MeasureTheory.tendstoInMeasure_iff_tendsto_Lp_finite`: Vitali convergence theorem:
a sequence of Lp functions converges in Lp if and only if it is uniformly integrable
and converges in measure.
## Tags
uniform integrable, uniformly absolutely continuous integral, Vitali convergence theorem
-/
noncomputable section
open scoped Classical MeasureTheory NNReal ENNReal Topology
namespace MeasureTheory
open Set Filter TopologicalSpace
variable {α β ι : Type*} {m : MeasurableSpace α} {μ : Measure α} [NormedAddCommGroup β]
/-- Uniform integrability in the measure theory sense.
A sequence of functions `f` is said to be uniformly integrable if for all `ε > 0`, there exists
some `δ > 0` such that for all sets `s` with measure less than `δ`, the Lp-norm of `f i`
restricted on `s` is less than `ε`.
Uniform integrability is also known as uniformly absolutely continuous integrals. -/
def UnifIntegrable {_ : MeasurableSpace α} (f : ι → α → β) (p : ℝ≥0∞) (μ : Measure α) : Prop :=
∀ ⦃ε : ℝ⦄ (_ : 0 < ε), ∃ (δ : ℝ) (_ : 0 < δ), ∀ i s,
MeasurableSet s → μ s ≤ ENNReal.ofReal δ → eLpNorm (s.indicator (f i)) p μ ≤ ENNReal.ofReal ε
/-- In probability theory, a family of measurable functions is uniformly integrable if it is
uniformly integrable in the measure theory sense and is uniformly bounded. -/
def UniformIntegrable {_ : MeasurableSpace α} (f : ι → α → β) (p : ℝ≥0∞) (μ : Measure α) : Prop :=
(∀ i, AEStronglyMeasurable (f i) μ) ∧ UnifIntegrable f p μ ∧ ∃ C : ℝ≥0, ∀ i, eLpNorm (f i) p μ ≤ C
namespace UniformIntegrable
protected theorem aeStronglyMeasurable {f : ι → α → β} {p : ℝ≥0∞} (hf : UniformIntegrable f p μ)
(i : ι) : AEStronglyMeasurable (f i) μ :=
hf.1 i
protected theorem unifIntegrable {f : ι → α → β} {p : ℝ≥0∞} (hf : UniformIntegrable f p μ) :
UnifIntegrable f p μ :=
hf.2.1
protected theorem memℒp {f : ι → α → β} {p : ℝ≥0∞} (hf : UniformIntegrable f p μ) (i : ι) :
Memℒp (f i) p μ :=
⟨hf.1 i,
let ⟨_, _, hC⟩ := hf.2
lt_of_le_of_lt (hC i) ENNReal.coe_lt_top⟩
end UniformIntegrable
section UnifIntegrable
/-! ### `UnifIntegrable`
This section deals with uniform integrability in the measure theory sense. -/
namespace UnifIntegrable
variable {f g : ι → α → β} {p : ℝ≥0∞}
protected theorem add (hf : UnifIntegrable f p μ) (hg : UnifIntegrable g p μ) (hp : 1 ≤ p)
(hf_meas : ∀ i, AEStronglyMeasurable (f i) μ) (hg_meas : ∀ i, AEStronglyMeasurable (g i) μ) :
UnifIntegrable (f + g) p μ := by
intro ε hε
have hε2 : 0 < ε / 2 := half_pos hε
obtain ⟨δ₁, hδ₁_pos, hfδ₁⟩ := hf hε2
obtain ⟨δ₂, hδ₂_pos, hgδ₂⟩ := hg hε2
refine ⟨min δ₁ δ₂, lt_min hδ₁_pos hδ₂_pos, fun i s hs hμs => ?_⟩
simp_rw [Pi.add_apply, Set.indicator_add']
refine (eLpNorm_add_le ((hf_meas i).indicator hs) ((hg_meas i).indicator hs) hp).trans ?_
have hε_halves : ENNReal.ofReal ε = ENNReal.ofReal (ε / 2) + ENNReal.ofReal (ε / 2) := by
rw [← ENNReal.ofReal_add hε2.le hε2.le, add_halves]
rw [hε_halves]
exact add_le_add (hfδ₁ i s hs (hμs.trans (ENNReal.ofReal_le_ofReal (min_le_left _ _))))
(hgδ₂ i s hs (hμs.trans (ENNReal.ofReal_le_ofReal (min_le_right _ _))))
protected theorem neg (hf : UnifIntegrable f p μ) : UnifIntegrable (-f) p μ := by
simp_rw [UnifIntegrable, Pi.neg_apply, Set.indicator_neg', eLpNorm_neg]
exact hf
protected theorem sub (hf : UnifIntegrable f p μ) (hg : UnifIntegrable g p μ) (hp : 1 ≤ p)
(hf_meas : ∀ i, AEStronglyMeasurable (f i) μ) (hg_meas : ∀ i, AEStronglyMeasurable (g i) μ) :
UnifIntegrable (f - g) p μ := by
rw [sub_eq_add_neg]
exact hf.add hg.neg hp hf_meas fun i => (hg_meas i).neg
protected theorem ae_eq (hf : UnifIntegrable f p μ) (hfg : ∀ n, f n =ᵐ[μ] g n) :
UnifIntegrable g p μ := by
intro ε hε
obtain ⟨δ, hδ_pos, hfδ⟩ := hf hε
refine ⟨δ, hδ_pos, fun n s hs hμs => (le_of_eq <| eLpNorm_congr_ae ?_).trans (hfδ n s hs hμs)⟩
filter_upwards [hfg n] with x hx
simp_rw [Set.indicator_apply, hx]
/-- Uniform integrability is preserved by restriction of the functions to a set. -/
protected theorem indicator (hf : UnifIntegrable f p μ) (E : Set α) :
UnifIntegrable (fun i => E.indicator (f i)) p μ := fun ε hε ↦ by
obtain ⟨δ, hδ_pos, hε⟩ := hf hε
refine ⟨δ, hδ_pos, fun i s hs hμs ↦ ?_⟩
calc
eLpNorm (s.indicator (E.indicator (f i))) p μ
= eLpNorm (E.indicator (s.indicator (f i))) p μ := by
simp only [indicator_indicator, inter_comm]
_ ≤ eLpNorm (s.indicator (f i)) p μ := eLpNorm_indicator_le _
_ ≤ ENNReal.ofReal ε := hε _ _ hs hμs
/-- Uniform integrability is preserved by restriction of the measure to a set. -/
protected theorem restrict (hf : UnifIntegrable f p μ) (E : Set α) :
UnifIntegrable f p (μ.restrict E) := fun ε hε ↦ by
obtain ⟨δ, hδ_pos, hδε⟩ := hf hε
refine ⟨δ, hδ_pos, fun i s hs hμs ↦ ?_⟩
rw [μ.restrict_apply hs, ← measure_toMeasurable] at hμs
calc
eLpNorm (indicator s (f i)) p (μ.restrict E) = eLpNorm (f i) p (μ.restrict (s ∩ E)) := by
rw [eLpNorm_indicator_eq_eLpNorm_restrict hs, μ.restrict_restrict hs]
_ ≤ eLpNorm (f i) p (μ.restrict (toMeasurable μ (s ∩ E))) :=
eLpNorm_mono_measure _ <| Measure.restrict_mono (subset_toMeasurable _ _) le_rfl
_ = eLpNorm (indicator (toMeasurable μ (s ∩ E)) (f i)) p μ :=
(eLpNorm_indicator_eq_eLpNorm_restrict (measurableSet_toMeasurable _ _)).symm
_ ≤ ENNReal.ofReal ε := hδε i _ (measurableSet_toMeasurable _ _) hμs
end UnifIntegrable
theorem unifIntegrable_zero_meas [MeasurableSpace α] {p : ℝ≥0∞} {f : ι → α → β} :
UnifIntegrable f p (0 : Measure α) :=
fun ε _ => ⟨1, one_pos, fun i s _ _ => by simp⟩
theorem unifIntegrable_congr_ae {p : ℝ≥0∞} {f g : ι → α → β} (hfg : ∀ n, f n =ᵐ[μ] g n) :
UnifIntegrable f p μ ↔ UnifIntegrable g p μ :=
⟨fun hf => hf.ae_eq hfg, fun hg => hg.ae_eq fun n => (hfg n).symm⟩
theorem tendsto_indicator_ge (f : α → β) (x : α) :
Tendsto (fun M : ℕ => { x | (M : ℝ) ≤ ‖f x‖₊ }.indicator f x) atTop (𝓝 0) := by
refine tendsto_atTop_of_eventually_const (i₀ := Nat.ceil (‖f x‖₊ : ℝ) + 1) fun n hn => ?_
rw [Set.indicator_of_not_mem]
simp only [not_le, Set.mem_setOf_eq]
refine lt_of_le_of_lt (Nat.le_ceil _) ?_
refine lt_of_lt_of_le (lt_add_one _) ?_
norm_cast
variable {p : ℝ≥0∞}
section
variable {f : α → β}
/-- This lemma is weaker than `MeasureTheory.Memℒp.integral_indicator_norm_ge_nonneg_le`
as the latter provides `0 ≤ M` and does not require the measurability of `f`. -/
theorem Memℒp.integral_indicator_norm_ge_le (hf : Memℒp f 1 μ) (hmeas : StronglyMeasurable f)
{ε : ℝ} (hε : 0 < ε) :
∃ M : ℝ, (∫⁻ x, ‖{ x | M ≤ ‖f x‖₊ }.indicator f x‖₊ ∂μ) ≤ ENNReal.ofReal ε := by
have htendsto :
∀ᵐ x ∂μ, Tendsto (fun M : ℕ => { x | (M : ℝ) ≤ ‖f x‖₊ }.indicator f x) atTop (𝓝 0) :=
univ_mem' (id fun x => tendsto_indicator_ge f x)
have hmeas : ∀ M : ℕ, AEStronglyMeasurable ({ x | (M : ℝ) ≤ ‖f x‖₊ }.indicator f) μ := by
intro M
apply hf.1.indicator
apply StronglyMeasurable.measurableSet_le stronglyMeasurable_const
hmeas.nnnorm.measurable.coe_nnreal_real.stronglyMeasurable
have hbound : HasFiniteIntegral (fun x => ‖f x‖) μ := by
rw [memℒp_one_iff_integrable] at hf
exact hf.norm.2
have : Tendsto (fun n : ℕ ↦ ∫⁻ a, ENNReal.ofReal ‖{ x | n ≤ ‖f x‖₊ }.indicator f a - 0‖ ∂μ)
atTop (𝓝 0) := by
refine tendsto_lintegral_norm_of_dominated_convergence hmeas hbound ?_ htendsto
refine fun n => univ_mem' (id fun x => ?_)
by_cases hx : (n : ℝ) ≤ ‖f x‖
· dsimp
rwa [Set.indicator_of_mem]
· dsimp
rw [Set.indicator_of_not_mem, norm_zero]
· exact norm_nonneg _
· assumption
rw [ENNReal.tendsto_atTop_zero] at this
obtain ⟨M, hM⟩ := this (ENNReal.ofReal ε) (ENNReal.ofReal_pos.2 hε)
simp only [true_and_iff, zero_tsub, zero_le, sub_zero, zero_add, coe_nnnorm,
Set.mem_Icc] at hM
refine ⟨M, ?_⟩
convert hM M le_rfl
simp only [coe_nnnorm, ENNReal.ofReal_eq_coe_nnreal (norm_nonneg _)]
rfl
/-- This lemma is superceded by `MeasureTheory.Memℒp.integral_indicator_norm_ge_nonneg_le`
which does not require measurability. -/
theorem Memℒp.integral_indicator_norm_ge_nonneg_le_of_meas (hf : Memℒp f 1 μ)
(hmeas : StronglyMeasurable f) {ε : ℝ} (hε : 0 < ε) :
∃ M : ℝ, 0 ≤ M ∧ (∫⁻ x, ‖{ x | M ≤ ‖f x‖₊ }.indicator f x‖₊ ∂μ) ≤ ENNReal.ofReal ε :=
let ⟨M, hM⟩ := hf.integral_indicator_norm_ge_le hmeas hε
⟨max M 0, le_max_right _ _, by simpa⟩
theorem Memℒp.integral_indicator_norm_ge_nonneg_le (hf : Memℒp f 1 μ) {ε : ℝ} (hε : 0 < ε) :
∃ M : ℝ, 0 ≤ M ∧ (∫⁻ x, ‖{ x | M ≤ ‖f x‖₊ }.indicator f x‖₊ ∂μ) ≤ ENNReal.ofReal ε := by
have hf_mk : Memℒp (hf.1.mk f) 1 μ := (memℒp_congr_ae hf.1.ae_eq_mk).mp hf
obtain ⟨M, hM_pos, hfM⟩ :=
hf_mk.integral_indicator_norm_ge_nonneg_le_of_meas hf.1.stronglyMeasurable_mk hε
refine ⟨M, hM_pos, (le_of_eq ?_).trans hfM⟩
refine lintegral_congr_ae ?_
filter_upwards [hf.1.ae_eq_mk] with x hx
simp only [Set.indicator_apply, coe_nnnorm, Set.mem_setOf_eq, ENNReal.coe_inj, hx.symm]
theorem Memℒp.eLpNormEssSup_indicator_norm_ge_eq_zero (hf : Memℒp f ∞ μ)
(hmeas : StronglyMeasurable f) :
∃ M : ℝ, eLpNormEssSup ({ x | M ≤ ‖f x‖₊ }.indicator f) μ = 0 := by
have hbdd : eLpNormEssSup f μ < ∞ := hf.eLpNorm_lt_top
refine ⟨(eLpNorm f ∞ μ + 1).toReal, ?_⟩
rw [eLpNormEssSup_indicator_eq_eLpNormEssSup_restrict]
· have : μ.restrict { x : α | (eLpNorm f ⊤ μ + 1).toReal ≤ ‖f x‖₊ } = 0 := by
simp only [coe_nnnorm, eLpNorm_exponent_top, Measure.restrict_eq_zero]
have : { x : α | (eLpNormEssSup f μ + 1).toReal ≤ ‖f x‖ } ⊆
{ x : α | eLpNormEssSup f μ < ‖f x‖₊ } := by
intro x hx
rw [Set.mem_setOf_eq, ← ENNReal.toReal_lt_toReal hbdd.ne ENNReal.coe_lt_top.ne,
ENNReal.coe_toReal, coe_nnnorm]
refine lt_of_lt_of_le ?_ hx
rw [ENNReal.toReal_lt_toReal hbdd.ne]
· exact ENNReal.lt_add_right hbdd.ne one_ne_zero
· exact (ENNReal.add_lt_top.2 ⟨hbdd, ENNReal.one_lt_top⟩).ne
rw [← nonpos_iff_eq_zero]
refine (measure_mono this).trans ?_
have hle := coe_nnnorm_ae_le_eLpNormEssSup f μ
simp_rw [ae_iff, not_le] at hle
exact nonpos_iff_eq_zero.2 hle
rw [this, eLpNormEssSup_measure_zero]
exact measurableSet_le measurable_const hmeas.nnnorm.measurable.subtype_coe
@[deprecated (since := "2024-07-27")]
alias Memℒp.snormEssSup_indicator_norm_ge_eq_zero := Memℒp.eLpNormEssSup_indicator_norm_ge_eq_zero
/- This lemma is slightly weaker than `MeasureTheory.Memℒp.eLpNorm_indicator_norm_ge_pos_le` as the
latter provides `0 < M`. -/
theorem Memℒp.eLpNorm_indicator_norm_ge_le (hf : Memℒp f p μ) (hmeas : StronglyMeasurable f) {ε : ℝ}
(hε : 0 < ε) : ∃ M : ℝ, eLpNorm ({ x | M ≤ ‖f x‖₊ }.indicator f) p μ ≤ ENNReal.ofReal ε := by
by_cases hp_ne_zero : p = 0
· refine ⟨1, hp_ne_zero.symm ▸ ?_⟩
simp [eLpNorm_exponent_zero]
by_cases hp_ne_top : p = ∞
· subst hp_ne_top
obtain ⟨M, hM⟩ := hf.eLpNormEssSup_indicator_norm_ge_eq_zero hmeas
refine ⟨M, ?_⟩
simp only [eLpNorm_exponent_top, hM, zero_le]
obtain ⟨M, hM', hM⟩ := Memℒp.integral_indicator_norm_ge_nonneg_le
(μ := μ) (hf.norm_rpow hp_ne_zero hp_ne_top) (Real.rpow_pos_of_pos hε p.toReal)
refine ⟨M ^ (1 / p.toReal), ?_⟩
rw [eLpNorm_eq_lintegral_rpow_nnnorm hp_ne_zero hp_ne_top, ← ENNReal.rpow_one (ENNReal.ofReal ε)]
conv_rhs => rw [← mul_one_div_cancel (ENNReal.toReal_pos hp_ne_zero hp_ne_top).ne.symm]
rw [ENNReal.rpow_mul,
ENNReal.rpow_le_rpow_iff (one_div_pos.2 <| ENNReal.toReal_pos hp_ne_zero hp_ne_top),
ENNReal.ofReal_rpow_of_pos hε]
convert hM
rename_i x
rw [ENNReal.coe_rpow_of_nonneg _ ENNReal.toReal_nonneg, nnnorm_indicator_eq_indicator_nnnorm,
nnnorm_indicator_eq_indicator_nnnorm]
have hiff : M ^ (1 / p.toReal) ≤ ‖f x‖₊ ↔ M ≤ ‖‖f x‖ ^ p.toReal‖₊ := by
rw [coe_nnnorm, coe_nnnorm, Real.norm_rpow_of_nonneg (norm_nonneg _), norm_norm,
← Real.rpow_le_rpow_iff hM' (Real.rpow_nonneg (norm_nonneg _) _)
(one_div_pos.2 <| ENNReal.toReal_pos hp_ne_zero hp_ne_top), ← Real.rpow_mul (norm_nonneg _),
mul_one_div_cancel (ENNReal.toReal_pos hp_ne_zero hp_ne_top).ne.symm, Real.rpow_one]
by_cases hx : x ∈ { x : α | M ^ (1 / p.toReal) ≤ ‖f x‖₊ }
· rw [Set.indicator_of_mem hx, Set.indicator_of_mem, Real.nnnorm_of_nonneg]
· rfl
rw [Set.mem_setOf_eq]
rwa [← hiff]
· rw [Set.indicator_of_not_mem hx, Set.indicator_of_not_mem]
· simp [(ENNReal.toReal_pos hp_ne_zero hp_ne_top).ne.symm]
· rw [Set.mem_setOf_eq]
rwa [← hiff]
@[deprecated (since := "2024-07-27")]
alias Memℒp.snorm_indicator_norm_ge_le := Memℒp.eLpNorm_indicator_norm_ge_le
/-- This lemma implies that a single function is uniformly integrable (in the probability sense). -/
theorem Memℒp.eLpNorm_indicator_norm_ge_pos_le (hf : Memℒp f p μ) (hmeas : StronglyMeasurable f)
{ε : ℝ} (hε : 0 < ε) :
∃ M : ℝ, 0 < M ∧ eLpNorm ({ x | M ≤ ‖f x‖₊ }.indicator f) p μ ≤ ENNReal.ofReal ε := by
obtain ⟨M, hM⟩ := hf.eLpNorm_indicator_norm_ge_le hmeas hε
refine
⟨max M 1, lt_of_lt_of_le zero_lt_one (le_max_right _ _), le_trans (eLpNorm_mono fun x => ?_) hM⟩
rw [norm_indicator_eq_indicator_norm, norm_indicator_eq_indicator_norm]
refine Set.indicator_le_indicator_of_subset (fun x hx => ?_) (fun x => norm_nonneg (f x)) x
rw [Set.mem_setOf_eq] at hx -- removing the `rw` breaks the proof!
exact (max_le_iff.1 hx).1
@[deprecated (since := "2024-07-27")]
alias Memℒp.snorm_indicator_norm_ge_pos_le := Memℒp.eLpNorm_indicator_norm_ge_pos_le
end
theorem eLpNorm_indicator_le_of_bound {f : α → β} (hp_top : p ≠ ∞) {ε : ℝ} (hε : 0 < ε) {M : ℝ}
(hf : ∀ x, ‖f x‖ < M) :
∃ (δ : ℝ) (hδ : 0 < δ), ∀ s, MeasurableSet s →
μ s ≤ ENNReal.ofReal δ → eLpNorm (s.indicator f) p μ ≤ ENNReal.ofReal ε := by
by_cases hM : M ≤ 0
· refine ⟨1, zero_lt_one, fun s _ _ => ?_⟩
rw [(_ : f = 0)]
· simp [hε.le]
· ext x
rw [Pi.zero_apply, ← norm_le_zero_iff]
exact (lt_of_lt_of_le (hf x) hM).le
rw [not_le] at hM
refine ⟨(ε / M) ^ p.toReal, Real.rpow_pos_of_pos (div_pos hε hM) _, fun s hs hμ => ?_⟩
by_cases hp : p = 0
· simp [hp]
rw [eLpNorm_indicator_eq_eLpNorm_restrict hs]
have haebdd : ∀ᵐ x ∂μ.restrict s, ‖f x‖ ≤ M := by
filter_upwards
exact fun x => (hf x).le
refine le_trans (eLpNorm_le_of_ae_bound haebdd) ?_
rw [Measure.restrict_apply MeasurableSet.univ, Set.univ_inter,
← ENNReal.le_div_iff_mul_le (Or.inl _) (Or.inl ENNReal.ofReal_ne_top)]
· rw [ENNReal.rpow_inv_le_iff (ENNReal.toReal_pos hp hp_top)]
refine le_trans hμ ?_
rw [← ENNReal.ofReal_rpow_of_pos (div_pos hε hM),
ENNReal.rpow_le_rpow_iff (ENNReal.toReal_pos hp hp_top), ENNReal.ofReal_div_of_pos hM]
· simpa only [ENNReal.ofReal_eq_zero, not_le, Ne]
@[deprecated (since := "2024-07-27")]
alias snorm_indicator_le_of_bound := eLpNorm_indicator_le_of_bound
section
variable {f : α → β}
/-- Auxiliary lemma for `MeasureTheory.Memℒp.eLpNorm_indicator_le`. -/
theorem Memℒp.eLpNorm_indicator_le' (hp_one : 1 ≤ p) (hp_top : p ≠ ∞) (hf : Memℒp f p μ)
(hmeas : StronglyMeasurable f) {ε : ℝ} (hε : 0 < ε) :
∃ (δ : ℝ) (hδ : 0 < δ), ∀ s, MeasurableSet s → μ s ≤ ENNReal.ofReal δ →
eLpNorm (s.indicator f) p μ ≤ 2 * ENNReal.ofReal ε := by
obtain ⟨M, hMpos, hM⟩ := hf.eLpNorm_indicator_norm_ge_pos_le hmeas hε
obtain ⟨δ, hδpos, hδ⟩ :=
eLpNorm_indicator_le_of_bound (f := { x | ‖f x‖ < M }.indicator f) hp_top hε (by
intro x
rw [norm_indicator_eq_indicator_norm, Set.indicator_apply]
· split_ifs with h
exacts [h, hMpos])
refine ⟨δ, hδpos, fun s hs hμs => ?_⟩
rw [(_ : f = { x : α | M ≤ ‖f x‖₊ }.indicator f + { x : α | ‖f x‖ < M }.indicator f)]
· rw [eLpNorm_indicator_eq_eLpNorm_restrict hs]
refine le_trans (eLpNorm_add_le ?_ ?_ hp_one) ?_
· exact StronglyMeasurable.aestronglyMeasurable
(hmeas.indicator (measurableSet_le measurable_const hmeas.nnnorm.measurable.subtype_coe))
· exact StronglyMeasurable.aestronglyMeasurable
(hmeas.indicator (measurableSet_lt hmeas.nnnorm.measurable.subtype_coe measurable_const))
· rw [two_mul]
refine add_le_add (le_trans (eLpNorm_mono_measure _ Measure.restrict_le_self) hM) ?_
rw [← eLpNorm_indicator_eq_eLpNorm_restrict hs]
exact hδ s hs hμs
· ext x
by_cases hx : M ≤ ‖f x‖
· rw [Pi.add_apply, Set.indicator_of_mem, Set.indicator_of_not_mem, add_zero] <;> simpa
· rw [Pi.add_apply, Set.indicator_of_not_mem, Set.indicator_of_mem, zero_add] <;>
simpa using hx
@[deprecated (since := "2024-07-27")]
alias Memℒp.snorm_indicator_le' := Memℒp.eLpNorm_indicator_le'
/-- This lemma is superceded by `MeasureTheory.Memℒp.eLpNorm_indicator_le` which does not require
measurability on `f`. -/
theorem Memℒp.eLpNorm_indicator_le_of_meas (hp_one : 1 ≤ p) (hp_top : p ≠ ∞) (hf : Memℒp f p μ)
(hmeas : StronglyMeasurable f) {ε : ℝ} (hε : 0 < ε) :
∃ (δ : ℝ) (hδ : 0 < δ), ∀ s, MeasurableSet s → μ s ≤ ENNReal.ofReal δ →
eLpNorm (s.indicator f) p μ ≤ ENNReal.ofReal ε := by
obtain ⟨δ, hδpos, hδ⟩ := hf.eLpNorm_indicator_le' hp_one hp_top hmeas (half_pos hε)
refine ⟨δ, hδpos, fun s hs hμs => le_trans (hδ s hs hμs) ?_⟩
rw [ENNReal.ofReal_div_of_pos zero_lt_two, (by norm_num : ENNReal.ofReal 2 = 2),
ENNReal.mul_div_cancel'] <;>
norm_num
@[deprecated (since := "2024-07-27")]
alias Memℒp.snorm_indicator_le_of_meas := Memℒp.eLpNorm_indicator_le_of_meas
theorem Memℒp.eLpNorm_indicator_le (hp_one : 1 ≤ p) (hp_top : p ≠ ∞) (hf : Memℒp f p μ) {ε : ℝ}
(hε : 0 < ε) :
∃ (δ : ℝ) (hδ : 0 < δ), ∀ s, MeasurableSet s → μ s ≤ ENNReal.ofReal δ →
eLpNorm (s.indicator f) p μ ≤ ENNReal.ofReal ε := by
have hℒp := hf
obtain ⟨⟨f', hf', heq⟩, _⟩ := hf
obtain ⟨δ, hδpos, hδ⟩ := (hℒp.ae_eq heq).eLpNorm_indicator_le_of_meas hp_one hp_top hf' hε
refine ⟨δ, hδpos, fun s hs hμs => ?_⟩
convert hδ s hs hμs using 1
rw [eLpNorm_indicator_eq_eLpNorm_restrict hs, eLpNorm_indicator_eq_eLpNorm_restrict hs]
exact eLpNorm_congr_ae heq.restrict
@[deprecated (since := "2024-07-27")]
alias Memℒp.snorm_indicator_le := Memℒp.eLpNorm_indicator_le
/-- A constant function is uniformly integrable. -/
theorem unifIntegrable_const {g : α → β} (hp : 1 ≤ p) (hp_ne_top : p ≠ ∞) (hg : Memℒp g p μ) :
UnifIntegrable (fun _ : ι => g) p μ := by
intro ε hε
obtain ⟨δ, hδ_pos, hgδ⟩ := hg.eLpNorm_indicator_le hp hp_ne_top hε
exact ⟨δ, hδ_pos, fun _ => hgδ⟩
/-- A single function is uniformly integrable. -/
theorem unifIntegrable_subsingleton [Subsingleton ι] (hp_one : 1 ≤ p) (hp_top : p ≠ ∞)
{f : ι → α → β} (hf : ∀ i, Memℒp (f i) p μ) : UnifIntegrable f p μ := by
intro ε hε
by_cases hι : Nonempty ι
· cases' hι with i
obtain ⟨δ, hδpos, hδ⟩ := (hf i).eLpNorm_indicator_le hp_one hp_top hε
refine ⟨δ, hδpos, fun j s hs hμs => ?_⟩
convert hδ s hs hμs
· exact ⟨1, zero_lt_one, fun i => False.elim <| hι <| Nonempty.intro i⟩
/-- This lemma is less general than `MeasureTheory.unifIntegrable_finite` which applies to
all sequences indexed by a finite type. -/
theorem unifIntegrable_fin (hp_one : 1 ≤ p) (hp_top : p ≠ ∞) {n : ℕ} {f : Fin n → α → β}
(hf : ∀ i, Memℒp (f i) p μ) : UnifIntegrable f p μ := by
revert f
induction' n with n h
· intro f hf
-- Porting note (#10754): added this instance
have : Subsingleton (Fin Nat.zero) := subsingleton_fin_zero
exact unifIntegrable_subsingleton hp_one hp_top hf
intro f hfLp ε hε
let g : Fin n → α → β := fun k => f k
have hgLp : ∀ i, Memℒp (g i) p μ := fun i => hfLp i
obtain ⟨δ₁, hδ₁pos, hδ₁⟩ := h hgLp hε
obtain ⟨δ₂, hδ₂pos, hδ₂⟩ := (hfLp n).eLpNorm_indicator_le hp_one hp_top hε
refine ⟨min δ₁ δ₂, lt_min hδ₁pos hδ₂pos, fun i s hs hμs => ?_⟩
by_cases hi : i.val < n
· rw [(_ : f i = g ⟨i.val, hi⟩)]
· exact hδ₁ _ s hs (le_trans hμs <| ENNReal.ofReal_le_ofReal <| min_le_left _ _)
· simp [g]
· rw [(_ : i = n)]
· exact hδ₂ _ hs (le_trans hμs <| ENNReal.ofReal_le_ofReal <| min_le_right _ _)
· have hi' := Fin.is_lt i
rw [Nat.lt_succ_iff] at hi'
rw [not_lt] at hi
simp [← le_antisymm hi' hi]
/-- A finite sequence of Lp functions is uniformly integrable. -/
theorem unifIntegrable_finite [Finite ι] (hp_one : 1 ≤ p) (hp_top : p ≠ ∞) {f : ι → α → β}
(hf : ∀ i, Memℒp (f i) p μ) : UnifIntegrable f p μ := by
obtain ⟨n, hn⟩ := Finite.exists_equiv_fin ι
intro ε hε
let g : Fin n → α → β := f ∘ hn.some.symm
have hg : ∀ i, Memℒp (g i) p μ := fun _ => hf _
obtain ⟨δ, hδpos, hδ⟩ := unifIntegrable_fin hp_one hp_top hg hε
refine ⟨δ, hδpos, fun i s hs hμs => ?_⟩
specialize hδ (hn.some i) s hs hμs
simp_rw [g, Function.comp_apply, Equiv.symm_apply_apply] at hδ
assumption
end
theorem eLpNorm_sub_le_of_dist_bdd (μ : Measure α)
{p : ℝ≥0∞} (hp' : p ≠ ∞) {s : Set α} (hs : MeasurableSet[m] s)
{f g : α → β} {c : ℝ} (hc : 0 ≤ c) (hf : ∀ x ∈ s, dist (f x) (g x) ≤ c) :
eLpNorm (s.indicator (f - g)) p μ ≤ ENNReal.ofReal c * μ s ^ (1 / p.toReal) := by
by_cases hp : p = 0
· simp [hp]
have : ∀ x, ‖s.indicator (f - g) x‖ ≤ ‖s.indicator (fun _ => c) x‖ := by
intro x
by_cases hx : x ∈ s
· rw [Set.indicator_of_mem hx, Set.indicator_of_mem hx, Pi.sub_apply, ← dist_eq_norm,
Real.norm_eq_abs, abs_of_nonneg hc]
exact hf x hx
· simp [Set.indicator_of_not_mem hx]
refine le_trans (eLpNorm_mono this) ?_
rw [eLpNorm_indicator_const hs hp hp']
refine mul_le_mul_right' (le_of_eq ?_) _
rw [← ofReal_norm_eq_coe_nnnorm, Real.norm_eq_abs, abs_of_nonneg hc]
@[deprecated (since := "2024-07-27")]
alias snorm_sub_le_of_dist_bdd := eLpNorm_sub_le_of_dist_bdd
/-- A sequence of uniformly integrable functions which converges μ-a.e. converges in Lp. -/
theorem tendsto_Lp_finite_of_tendsto_ae_of_meas [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
{f : ℕ → α → β} {g : α → β} (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
(hg' : Memℒp g p μ) (hui : UnifIntegrable f p μ)
(hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0) := by
rw [ENNReal.tendsto_atTop_zero]
intro ε hε
by_cases h : ε < ∞; swap
· rw [not_lt, top_le_iff] at h
exact ⟨0, fun n _ => by simp [h]⟩
by_cases hμ : μ = 0
· exact ⟨0, fun n _ => by simp [hμ]⟩
have hε' : 0 < ε.toReal / 3 :=
div_pos (ENNReal.toReal_pos (gt_iff_lt.1 hε).ne.symm h.ne) (by norm_num)
have hdivp : 0 ≤ 1 / p.toReal := by
refine one_div_nonneg.2 ?_
rw [← ENNReal.zero_toReal, ENNReal.toReal_le_toReal ENNReal.zero_ne_top hp']
exact le_trans (zero_le _) hp
have hpow : 0 < measureUnivNNReal μ ^ (1 / p.toReal) :=
Real.rpow_pos_of_pos (measureUnivNNReal_pos hμ) _
obtain ⟨δ₁, hδ₁, heLpNorm₁⟩ := hui hε'
obtain ⟨δ₂, hδ₂, heLpNorm₂⟩ := hg'.eLpNorm_indicator_le hp hp' hε'
obtain ⟨t, htm, ht₁, ht₂⟩ := tendstoUniformlyOn_of_ae_tendsto' hf hg hfg (lt_min hδ₁ hδ₂)
rw [Metric.tendstoUniformlyOn_iff] at ht₂
specialize ht₂ (ε.toReal / (3 * measureUnivNNReal μ ^ (1 / p.toReal)))
(div_pos (ENNReal.toReal_pos (gt_iff_lt.1 hε).ne.symm h.ne) (mul_pos (by norm_num) hpow))
obtain ⟨N, hN⟩ := eventually_atTop.1 ht₂; clear ht₂
refine ⟨N, fun n hn => ?_⟩
rw [← t.indicator_self_add_compl (f n - g)]
refine le_trans (eLpNorm_add_le (((hf n).sub hg).indicator htm).aestronglyMeasurable
(((hf n).sub hg).indicator htm.compl).aestronglyMeasurable hp) ?_
rw [sub_eq_add_neg, Set.indicator_add' t, Set.indicator_neg']
refine le_trans (add_le_add_right (eLpNorm_add_le ((hf n).indicator htm).aestronglyMeasurable
(hg.indicator htm).neg.aestronglyMeasurable hp) _) ?_
have hnf : eLpNorm (t.indicator (f n)) p μ ≤ ENNReal.ofReal (ε.toReal / 3) := by
refine heLpNorm₁ n t htm (le_trans ht₁ ?_)
rw [ENNReal.ofReal_le_ofReal_iff hδ₁.le]
exact min_le_left _ _
have hng : eLpNorm (t.indicator g) p μ ≤ ENNReal.ofReal (ε.toReal / 3) := by
refine heLpNorm₂ t htm (le_trans ht₁ ?_)
rw [ENNReal.ofReal_le_ofReal_iff hδ₂.le]
exact min_le_right _ _
have hlt : eLpNorm (tᶜ.indicator (f n - g)) p μ ≤ ENNReal.ofReal (ε.toReal / 3) := by
specialize hN n hn
have : 0 ≤ ε.toReal / (3 * measureUnivNNReal μ ^ (1 / p.toReal)) := by positivity
have := eLpNorm_sub_le_of_dist_bdd μ hp' htm.compl this fun x hx =>
(dist_comm (g x) (f n x) ▸ (hN x hx).le :
dist (f n x) (g x) ≤ ε.toReal / (3 * measureUnivNNReal μ ^ (1 / p.toReal)))
refine le_trans this ?_
rw [div_mul_eq_div_mul_one_div, ← ENNReal.ofReal_toReal (measure_lt_top μ tᶜ).ne,
ENNReal.ofReal_rpow_of_nonneg ENNReal.toReal_nonneg hdivp, ← ENNReal.ofReal_mul, mul_assoc]
· refine ENNReal.ofReal_le_ofReal (mul_le_of_le_one_right hε'.le ?_)
rw [mul_comm, mul_one_div, div_le_one]
· refine Real.rpow_le_rpow ENNReal.toReal_nonneg
(ENNReal.toReal_le_of_le_ofReal (measureUnivNNReal_pos hμ).le ?_) hdivp
rw [ENNReal.ofReal_coe_nnreal, coe_measureUnivNNReal]
exact measure_mono (Set.subset_univ _)
· exact Real.rpow_pos_of_pos (measureUnivNNReal_pos hμ) _
· positivity
have : ENNReal.ofReal (ε.toReal / 3) = ε / 3 := by
rw [ENNReal.ofReal_div_of_pos (show (0 : ℝ) < 3 by norm_num), ENNReal.ofReal_toReal h.ne]
simp
rw [this] at hnf hng hlt
rw [eLpNorm_neg, ← ENNReal.add_thirds ε, ← sub_eq_add_neg]
exact add_le_add_three hnf hng hlt
/-- A sequence of uniformly integrable functions which converges μ-a.e. converges in Lp. -/
theorem tendsto_Lp_finite_of_tendsto_ae [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
{f : ℕ → α → β} {g : α → β} (hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : Memℒp g p μ)
(hui : UnifIntegrable f p μ) (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0) := by
have : ∀ n, eLpNorm (f n - g) p μ = eLpNorm ((hf n).mk (f n) - hg.1.mk g) p μ :=
fun n => eLpNorm_congr_ae ((hf n).ae_eq_mk.sub hg.1.ae_eq_mk)
simp_rw [this]
refine tendsto_Lp_finite_of_tendsto_ae_of_meas hp hp' (fun n => (hf n).stronglyMeasurable_mk)
hg.1.stronglyMeasurable_mk (hg.ae_eq hg.1.ae_eq_mk) (hui.ae_eq fun n => (hf n).ae_eq_mk) ?_
have h_ae_forall_eq : ∀ᵐ x ∂μ, ∀ n, f n x = (hf n).mk (f n) x := by
rw [ae_all_iff]
exact fun n => (hf n).ae_eq_mk
filter_upwards [hfg, h_ae_forall_eq, hg.1.ae_eq_mk] with x hx_tendsto hxf_eq hxg_eq
rw [← hxg_eq]
convert hx_tendsto using 1
ext1 n
exact (hxf_eq n).symm
variable {f : ℕ → α → β} {g : α → β}
theorem unifIntegrable_of_tendsto_Lp_zero (hp : 1 ≤ p) (hp' : p ≠ ∞) (hf : ∀ n, Memℒp (f n) p μ)
(hf_tendsto : Tendsto (fun n => eLpNorm (f n) p μ) atTop (𝓝 0)) : UnifIntegrable f p μ := by
intro ε hε
rw [ENNReal.tendsto_atTop_zero] at hf_tendsto
obtain ⟨N, hN⟩ := hf_tendsto (ENNReal.ofReal ε) (by simpa)
let F : Fin N → α → β := fun n => f n
have hF : ∀ n, Memℒp (F n) p μ := fun n => hf n
obtain ⟨δ₁, hδpos₁, hδ₁⟩ := unifIntegrable_fin hp hp' hF hε
refine ⟨δ₁, hδpos₁, fun n s hs hμs => ?_⟩
by_cases hn : n < N
· exact hδ₁ ⟨n, hn⟩ s hs hμs
· exact (eLpNorm_indicator_le _).trans (hN n (not_lt.1 hn))
/-- Convergence in Lp implies uniform integrability. -/
theorem unifIntegrable_of_tendsto_Lp (hp : 1 ≤ p) (hp' : p ≠ ∞) (hf : ∀ n, Memℒp (f n) p μ)
(hg : Memℒp g p μ) (hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0)) :
UnifIntegrable f p μ := by
have : f = (fun _ => g) + fun n => f n - g := by ext1 n; simp
rw [this]
refine UnifIntegrable.add ?_ ?_ hp (fun _ => hg.aestronglyMeasurable)
fun n => (hf n).1.sub hg.aestronglyMeasurable
· exact unifIntegrable_const hp hp' hg
· exact unifIntegrable_of_tendsto_Lp_zero hp hp' (fun n => (hf n).sub hg) hfg
/-- Forward direction of Vitali's convergence theorem: if `f` is a sequence of uniformly integrable
functions that converge in measure to some function `g` in a finite measure space, then `f`
converge in Lp to `g`. -/
theorem tendsto_Lp_finite_of_tendstoInMeasure [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
(hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : Memℒp g p μ) (hui : UnifIntegrable f p μ)
(hfg : TendstoInMeasure μ f atTop g) : Tendsto (fun n ↦ eLpNorm (f n - g) p μ) atTop (𝓝 0) := by
refine tendsto_of_subseq_tendsto fun ns hns => ?_
obtain ⟨ms, _, hms'⟩ := TendstoInMeasure.exists_seq_tendsto_ae fun ε hε => (hfg ε hε).comp hns
exact ⟨ms,
tendsto_Lp_finite_of_tendsto_ae hp hp' (fun _ => hf _) hg (fun ε hε =>
let ⟨δ, hδ, hδ'⟩ := hui hε
⟨δ, hδ, fun i s hs hμs => hδ' _ s hs hμs⟩)
hms'⟩
/-- **Vitali's convergence theorem**: A sequence of functions `f` converges to `g` in Lp if and
only if it is uniformly integrable and converges to `g` in measure. -/
theorem tendstoInMeasure_iff_tendsto_Lp_finite [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
(hf : ∀ n, Memℒp (f n) p μ) (hg : Memℒp g p μ) :
TendstoInMeasure μ f atTop g ∧ UnifIntegrable f p μ ↔
Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0) :=
⟨fun h => tendsto_Lp_finite_of_tendstoInMeasure hp hp' (fun n => (hf n).1) hg h.2 h.1, fun h =>
⟨tendstoInMeasure_of_tendsto_eLpNorm (lt_of_lt_of_le zero_lt_one hp).ne.symm
(fun n => (hf n).aestronglyMeasurable) hg.aestronglyMeasurable h,
unifIntegrable_of_tendsto_Lp hp hp' hf hg h⟩⟩
/-- This lemma is superceded by `unifIntegrable_of` which do not require `C` to be positive. -/
theorem unifIntegrable_of' (hp : 1 ≤ p) (hp' : p ≠ ∞) {f : ι → α → β}
(hf : ∀ i, StronglyMeasurable (f i))
(h : ∀ ε : ℝ, 0 < ε → ∃ C : ℝ≥0, 0 < C ∧
∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε) :
UnifIntegrable f p μ := by
have hpzero := (lt_of_lt_of_le zero_lt_one hp).ne.symm
by_cases hμ : μ Set.univ = 0
· rw [Measure.measure_univ_eq_zero] at hμ
exact hμ.symm ▸ unifIntegrable_zero_meas
intro ε hε
obtain ⟨C, hCpos, hC⟩ := h (ε / 2) (half_pos hε)
refine ⟨(ε / (2 * C)) ^ ENNReal.toReal p,
Real.rpow_pos_of_pos (div_pos hε (mul_pos two_pos (NNReal.coe_pos.2 hCpos))) _,
fun i s hs hμs => ?_⟩
by_cases hμs' : μ s = 0
· rw [(eLpNorm_eq_zero_iff ((hf i).indicator hs).aestronglyMeasurable hpzero).2
(indicator_meas_zero hμs')]
norm_num
calc
eLpNorm (Set.indicator s (f i)) p μ ≤
eLpNorm (Set.indicator (s ∩ { x | C ≤ ‖f i x‖₊ }) (f i)) p μ +
eLpNorm (Set.indicator (s ∩ { x | ‖f i x‖₊ < C }) (f i)) p μ := by
refine le_trans (Eq.le ?_) (eLpNorm_add_le
(StronglyMeasurable.aestronglyMeasurable
((hf i).indicator (hs.inter (stronglyMeasurable_const.measurableSet_le (hf i).nnnorm))))
(StronglyMeasurable.aestronglyMeasurable
((hf i).indicator (hs.inter ((hf i).nnnorm.measurableSet_lt stronglyMeasurable_const))))
hp)
congr
change _ = fun x => (s ∩ { x : α | C ≤ ‖f i x‖₊ }).indicator (f i) x +
(s ∩ { x : α | ‖f i x‖₊ < C }).indicator (f i) x
rw [← Set.indicator_union_of_disjoint]
· rw [← Set.inter_union_distrib_left, (by ext; simp [le_or_lt] :
{ x : α | C ≤ ‖f i x‖₊ } ∪ { x : α | ‖f i x‖₊ < C } = Set.univ),
Set.inter_univ]
· refine (Disjoint.inf_right' _ ?_).inf_left' _
rw [disjoint_iff_inf_le]
rintro x ⟨hx₁, hx₂⟩
rw [Set.mem_setOf_eq] at hx₁ hx₂
exact False.elim (hx₂.ne (eq_of_le_of_not_lt hx₁ (not_lt.2 hx₂.le)).symm)
_ ≤ eLpNorm (Set.indicator { x | C ≤ ‖f i x‖₊ } (f i)) p μ +
(C : ℝ≥0∞) * μ s ^ (1 / ENNReal.toReal p) := by
refine add_le_add
(eLpNorm_mono fun x => norm_indicator_le_of_subset Set.inter_subset_right _ _) ?_
rw [← Set.indicator_indicator]
rw [eLpNorm_indicator_eq_eLpNorm_restrict hs]
have : ∀ᵐ x ∂μ.restrict s, ‖{ x : α | ‖f i x‖₊ < C }.indicator (f i) x‖ ≤ C := by
filter_upwards
simp_rw [norm_indicator_eq_indicator_norm]
exact Set.indicator_le' (fun x (hx : _ < _) => hx.le) fun _ _ => NNReal.coe_nonneg _
refine le_trans (eLpNorm_le_of_ae_bound this) ?_
rw [mul_comm, Measure.restrict_apply' hs, Set.univ_inter, ENNReal.ofReal_coe_nnreal, one_div]
_ ≤ ENNReal.ofReal (ε / 2) + C * ENNReal.ofReal (ε / (2 * C)) := by
refine add_le_add (hC i) (mul_le_mul_left' ?_ _)
rwa [one_div, ENNReal.rpow_inv_le_iff (ENNReal.toReal_pos hpzero hp'),
ENNReal.ofReal_rpow_of_pos (div_pos hε (mul_pos two_pos (NNReal.coe_pos.2 hCpos)))]
_ ≤ ENNReal.ofReal (ε / 2) + ENNReal.ofReal (ε / 2) := by
refine add_le_add_left ?_ _
rw [← ENNReal.ofReal_coe_nnreal, ← ENNReal.ofReal_mul (NNReal.coe_nonneg _), ← div_div,
mul_div_cancel₀ _ (NNReal.coe_pos.2 hCpos).ne.symm]
_ ≤ ENNReal.ofReal ε := by
rw [← ENNReal.ofReal_add (half_pos hε).le (half_pos hε).le, add_halves]
theorem unifIntegrable_of (hp : 1 ≤ p) (hp' : p ≠ ∞) {f : ι → α → β}
(hf : ∀ i, AEStronglyMeasurable (f i) μ)
(h : ∀ ε : ℝ, 0 < ε → ∃ C : ℝ≥0,
∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε) :
UnifIntegrable f p μ := by
set g : ι → α → β := fun i => (hf i).choose
refine
(unifIntegrable_of' hp hp' (fun i => (Exists.choose_spec <| hf i).1) fun ε hε => ?_).ae_eq
fun i => (Exists.choose_spec <| hf i).2.symm
obtain ⟨C, hC⟩ := h ε hε
have hCg : ∀ i, eLpNorm ({ x | C ≤ ‖g i x‖₊ }.indicator (g i)) p μ ≤ ENNReal.ofReal ε := by
intro i
refine le_trans (le_of_eq <| eLpNorm_congr_ae ?_) (hC i)
filter_upwards [(Exists.choose_spec <| hf i).2] with x hx
by_cases hfx : x ∈ { x | C ≤ ‖f i x‖₊ }
· rw [Set.indicator_of_mem hfx, Set.indicator_of_mem, hx]
rwa [Set.mem_setOf, hx] at hfx
· rw [Set.indicator_of_not_mem hfx, Set.indicator_of_not_mem]
rwa [Set.mem_setOf, hx] at hfx
refine ⟨max C 1, lt_max_of_lt_right one_pos, fun i => le_trans (eLpNorm_mono fun x => ?_) (hCg i)⟩
rw [norm_indicator_eq_indicator_norm, norm_indicator_eq_indicator_norm]
exact Set.indicator_le_indicator_of_subset
(fun x hx => Set.mem_setOf_eq ▸ le_trans (le_max_left _ _) hx) (fun _ => norm_nonneg _) _
end UnifIntegrable
section UniformIntegrable
/-! `UniformIntegrable`
In probability theory, uniform integrability normally refers to the condition that a sequence
of function `(fₙ)` satisfies for all `ε > 0`, there exists some `C ≥ 0` such that
`∫ x in {|fₙ| ≥ C}, fₙ x ∂μ ≤ ε` for all `n`.
In this section, we will develop some API for `UniformIntegrable` and prove that
`UniformIntegrable` is equivalent to this definition of uniform integrability.
-/
variable {p : ℝ≥0∞} {f : ι → α → β}
theorem uniformIntegrable_zero_meas [MeasurableSpace α] : UniformIntegrable f p (0 : Measure α) :=
⟨fun _ => aestronglyMeasurable_zero_measure _, unifIntegrable_zero_meas, 0,
fun _ => eLpNorm_measure_zero.le⟩
theorem UniformIntegrable.ae_eq {g : ι → α → β} (hf : UniformIntegrable f p μ)
(hfg : ∀ n, f n =ᵐ[μ] g n) : UniformIntegrable g p μ := by
obtain ⟨hfm, hunif, C, hC⟩ := hf
refine ⟨fun i => (hfm i).congr (hfg i), (unifIntegrable_congr_ae hfg).1 hunif, C, fun i => ?_⟩
rw [← eLpNorm_congr_ae (hfg i)]
exact hC i
theorem uniformIntegrable_congr_ae {g : ι → α → β} (hfg : ∀ n, f n =ᵐ[μ] g n) :
UniformIntegrable f p μ ↔ UniformIntegrable g p μ :=
⟨fun h => h.ae_eq hfg, fun h => h.ae_eq fun i => (hfg i).symm⟩
/-- A finite sequence of Lp functions is uniformly integrable in the probability sense. -/
theorem uniformIntegrable_finite [Finite ι] (hp_one : 1 ≤ p) (hp_top : p ≠ ∞)
(hf : ∀ i, Memℒp (f i) p μ) : UniformIntegrable f p μ := by
cases nonempty_fintype ι
refine ⟨fun n => (hf n).1, unifIntegrable_finite hp_one hp_top hf, ?_⟩
by_cases hι : Nonempty ι
· choose _ hf using hf
set C := (Finset.univ.image fun i : ι => eLpNorm (f i) p μ).max'
⟨eLpNorm (f hι.some) p μ, Finset.mem_image.2 ⟨hι.some, Finset.mem_univ _, rfl⟩⟩
refine ⟨C.toNNReal, fun i => ?_⟩
rw [ENNReal.coe_toNNReal]
· exact Finset.le_max' (α := ℝ≥0∞) _ _ (Finset.mem_image.2 ⟨i, Finset.mem_univ _, rfl⟩)
· refine ne_of_lt ((Finset.max'_lt_iff _ _).2 fun y hy => ?_)
rw [Finset.mem_image] at hy
obtain ⟨i, -, rfl⟩ := hy
exact hf i
· exact ⟨0, fun i => False.elim <| hι <| Nonempty.intro i⟩
/-- A single function is uniformly integrable in the probability sense. -/
theorem uniformIntegrable_subsingleton [Subsingleton ι] (hp_one : 1 ≤ p) (hp_top : p ≠ ∞)
(hf : ∀ i, Memℒp (f i) p μ) : UniformIntegrable f p μ :=
uniformIntegrable_finite hp_one hp_top hf
/-- A constant sequence of functions is uniformly integrable in the probability sense. -/
theorem uniformIntegrable_const {g : α → β} (hp : 1 ≤ p) (hp_ne_top : p ≠ ∞) (hg : Memℒp g p μ) :
UniformIntegrable (fun _ : ι => g) p μ :=
⟨fun _ => hg.1, unifIntegrable_const hp hp_ne_top hg,
⟨(eLpNorm g p μ).toNNReal, fun _ => le_of_eq (ENNReal.coe_toNNReal hg.2.ne).symm⟩⟩
/-- This lemma is superceded by `uniformIntegrable_of` which only requires
`AEStronglyMeasurable`. -/
theorem uniformIntegrable_of' [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
(hf : ∀ i, StronglyMeasurable (f i))
(h : ∀ ε : ℝ, 0 < ε → ∃ C : ℝ≥0,
∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε) :
UniformIntegrable f p μ := by
refine ⟨fun i => (hf i).aestronglyMeasurable,
unifIntegrable_of hp hp' (fun i => (hf i).aestronglyMeasurable) h, ?_⟩
obtain ⟨C, hC⟩ := h 1 one_pos
refine ⟨((C : ℝ≥0∞) * μ Set.univ ^ p.toReal⁻¹ + 1).toNNReal, fun i => ?_⟩
calc
eLpNorm (f i) p μ ≤
eLpNorm ({ x : α | ‖f i x‖₊ < C }.indicator (f i)) p μ +
eLpNorm ({ x : α | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ := by
refine le_trans (eLpNorm_mono fun x => ?_) (eLpNorm_add_le
(StronglyMeasurable.aestronglyMeasurable
((hf i).indicator ((hf i).nnnorm.measurableSet_lt stronglyMeasurable_const)))
(StronglyMeasurable.aestronglyMeasurable
((hf i).indicator (stronglyMeasurable_const.measurableSet_le (hf i).nnnorm))) hp)
rw [Pi.add_apply, Set.indicator_apply]
split_ifs with hx
· rw [Set.indicator_of_not_mem, add_zero]
simpa using hx
· rw [Set.indicator_of_mem, zero_add]
simpa using hx
_ ≤ (C : ℝ≥0∞) * μ Set.univ ^ p.toReal⁻¹ + 1 := by
have : ∀ᵐ x ∂μ, ‖{ x : α | ‖f i x‖₊ < C }.indicator (f i) x‖₊ ≤ C := by
filter_upwards
simp_rw [nnnorm_indicator_eq_indicator_nnnorm]
exact Set.indicator_le fun x (hx : _ < _) => hx.le
refine add_le_add (le_trans (eLpNorm_le_of_ae_bound this) ?_) (ENNReal.ofReal_one ▸ hC i)
simp_rw [NNReal.val_eq_coe, ENNReal.ofReal_coe_nnreal, mul_comm]
exact le_rfl
_ = ((C : ℝ≥0∞) * μ Set.univ ^ p.toReal⁻¹ + 1 : ℝ≥0∞).toNNReal := by
rw [ENNReal.coe_toNNReal]
exact ENNReal.add_ne_top.2
⟨ENNReal.mul_ne_top ENNReal.coe_ne_top (ENNReal.rpow_ne_top_of_nonneg
(inv_nonneg.2 ENNReal.toReal_nonneg) (measure_lt_top _ _).ne),
ENNReal.one_ne_top⟩
/-- A sequence of functions `(fₙ)` is uniformly integrable in the probability sense if for all
`ε > 0`, there exists some `C` such that `∫ x in {|fₙ| ≥ C}, fₙ x ∂μ ≤ ε` for all `n`. -/
theorem uniformIntegrable_of [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
(hf : ∀ i, AEStronglyMeasurable (f i) μ)
(h : ∀ ε : ℝ, 0 < ε → ∃ C : ℝ≥0,
∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε) :
UniformIntegrable f p μ := by
set g : ι → α → β := fun i => (hf i).choose
have hgmeas : ∀ i, StronglyMeasurable (g i) := fun i => (Exists.choose_spec <| hf i).1
have hgeq : ∀ i, g i =ᵐ[μ] f i := fun i => (Exists.choose_spec <| hf i).2.symm
refine (uniformIntegrable_of' hp hp' hgmeas fun ε hε => ?_).ae_eq hgeq
obtain ⟨C, hC⟩ := h ε hε
refine ⟨C, fun i => le_trans (le_of_eq <| eLpNorm_congr_ae ?_) (hC i)⟩
filter_upwards [(Exists.choose_spec <| hf i).2] with x hx
by_cases hfx : x ∈ { x | C ≤ ‖f i x‖₊ }
· rw [Set.indicator_of_mem hfx, Set.indicator_of_mem, hx]
rwa [Set.mem_setOf, hx] at hfx
· rw [Set.indicator_of_not_mem hfx, Set.indicator_of_not_mem]
rwa [Set.mem_setOf, hx] at hfx
/-- This lemma is superceded by `UniformIntegrable.spec` which does not require measurability. -/
theorem UniformIntegrable.spec' (hp : p ≠ 0) (hp' : p ≠ ∞) (hf : ∀ i, StronglyMeasurable (f i))
(hfu : UniformIntegrable f p μ) {ε : ℝ} (hε : 0 < ε) :
∃ C : ℝ≥0, ∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε := by
obtain ⟨-, hfu, M, hM⟩ := hfu
obtain ⟨δ, hδpos, hδ⟩ := hfu hε
obtain ⟨C, hC⟩ : ∃ C : ℝ≥0, ∀ i, μ { x | C ≤ ‖f i x‖₊ } ≤ ENNReal.ofReal δ := by
by_contra hcon; push_neg at hcon
choose ℐ hℐ using hcon
lift δ to ℝ≥0 using hδpos.le
have : ∀ C : ℝ≥0, C • (δ : ℝ≥0∞) ^ (1 / p.toReal) ≤ eLpNorm (f (ℐ C)) p μ := by
intro C
calc
C • (δ : ℝ≥0∞) ^ (1 / p.toReal) ≤ C • μ { x | C ≤ ‖f (ℐ C) x‖₊ } ^ (1 / p.toReal) := by
rw [ENNReal.smul_def, ENNReal.smul_def, smul_eq_mul, smul_eq_mul]
simp_rw [ENNReal.ofReal_coe_nnreal] at hℐ
refine mul_le_mul' le_rfl
(ENNReal.rpow_le_rpow (hℐ C).le (one_div_nonneg.2 ENNReal.toReal_nonneg))
_ ≤ eLpNorm ({ x | C ≤ ‖f (ℐ C) x‖₊ }.indicator (f (ℐ C))) p μ := by
refine le_eLpNorm_of_bddBelow hp hp' _
(measurableSet_le measurable_const (hf _).nnnorm.measurable)
(eventually_of_forall fun x hx => ?_)
rwa [nnnorm_indicator_eq_indicator_nnnorm, Set.indicator_of_mem hx]
_ ≤ eLpNorm (f (ℐ C)) p μ := eLpNorm_indicator_le _
specialize this (2 * max M 1 * δ⁻¹ ^ (1 / p.toReal))
rw [ENNReal.coe_rpow_of_nonneg _ (one_div_nonneg.2 ENNReal.toReal_nonneg), ← ENNReal.coe_smul,
smul_eq_mul, mul_assoc, NNReal.inv_rpow,
inv_mul_cancel (NNReal.rpow_pos (NNReal.coe_pos.1 hδpos)).ne.symm, mul_one, ENNReal.coe_mul,
← NNReal.inv_rpow] at this
refine (lt_of_le_of_lt (le_trans
(hM <| ℐ <| 2 * max M 1 * δ⁻¹ ^ (1 / p.toReal)) (le_max_left (M : ℝ≥0∞) 1))
(lt_of_lt_of_le ?_ this)).ne rfl
rw [← ENNReal.coe_one, ← ENNReal.coe_max, ← ENNReal.coe_mul, ENNReal.coe_lt_coe]
exact lt_two_mul_self (lt_max_of_lt_right one_pos)
exact ⟨C, fun i => hδ i _ (measurableSet_le measurable_const (hf i).nnnorm.measurable) (hC i)⟩
theorem UniformIntegrable.spec (hp : p ≠ 0) (hp' : p ≠ ∞) (hfu : UniformIntegrable f p μ) {ε : ℝ}
(hε : 0 < ε) :
∃ C : ℝ≥0, ∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε := by
set g : ι → α → β := fun i => (hfu.1 i).choose
have hgmeas : ∀ i, StronglyMeasurable (g i) := fun i => (Exists.choose_spec <| hfu.1 i).1
have hgunif : UniformIntegrable g p μ := hfu.ae_eq fun i => (Exists.choose_spec <| hfu.1 i).2
obtain ⟨C, hC⟩ := hgunif.spec' hp hp' hgmeas hε
refine ⟨C, fun i => le_trans (le_of_eq <| eLpNorm_congr_ae ?_) (hC i)⟩
filter_upwards [(Exists.choose_spec <| hfu.1 i).2] with x hx
by_cases hfx : x ∈ { x | C ≤ ‖f i x‖₊ }
· rw [Set.indicator_of_mem hfx, Set.indicator_of_mem, hx]
rwa [Set.mem_setOf, hx] at hfx
· rw [Set.indicator_of_not_mem hfx, Set.indicator_of_not_mem]
rwa [Set.mem_setOf, hx] at hfx
/-- The definition of uniform integrable in mathlib is equivalent to the definition commonly
found in literature. -/
theorem uniformIntegrable_iff [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞) :
UniformIntegrable f p μ ↔
(∀ i, AEStronglyMeasurable (f i) μ) ∧
∀ ε : ℝ, 0 < ε → ∃ C : ℝ≥0,
∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε :=
⟨fun h => ⟨h.1, fun _ => h.spec (lt_of_lt_of_le zero_lt_one hp).ne.symm hp'⟩,
fun h => uniformIntegrable_of hp hp' h.1 h.2⟩
/-- The averaging of a uniformly integrable sequence is also uniformly integrable. -/
theorem uniformIntegrable_average
{E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
(hp : 1 ≤ p) {f : ℕ → α → E} (hf : UniformIntegrable f p μ) :
UniformIntegrable (fun (n : ℕ) => (n : ℝ)⁻¹ • (∑ i ∈ Finset.range n, f i)) p μ := by
obtain ⟨hf₁, hf₂, hf₃⟩ := hf
refine ⟨fun n => ?_, fun ε hε => ?_, ?_⟩
· exact (Finset.aestronglyMeasurable_sum' _ fun i _ => hf₁ i).const_smul _
· obtain ⟨δ, hδ₁, hδ₂⟩ := hf₂ hε
refine ⟨δ, hδ₁, fun n s hs hle => ?_⟩
simp_rw [Finset.smul_sum, Finset.indicator_sum]
refine le_trans (eLpNorm_sum_le (fun i _ => ((hf₁ i).const_smul _).indicator hs) hp) ?_
have : ∀ i, s.indicator ((n : ℝ) ⁻¹ • f i) = (↑n : ℝ)⁻¹ • s.indicator (f i) :=
fun i ↦ indicator_const_smul _ _ _
simp_rw [this, eLpNorm_const_smul, ← Finset.mul_sum, nnnorm_inv, Real.nnnorm_natCast]
by_cases hn : (↑(↑n : ℝ≥0)⁻¹ : ℝ≥0∞) = 0
· simp only [hn, zero_mul, zero_le]
refine le_trans ?_ (?_ : ↑(↑n : ℝ≥0)⁻¹ * n • ENNReal.ofReal ε ≤ ENNReal.ofReal ε)
· refine (ENNReal.mul_le_mul_left hn ENNReal.coe_ne_top).2 ?_
conv_rhs => rw [← Finset.card_range n]
exact Finset.sum_le_card_nsmul _ _ _ fun i _ => hδ₂ _ _ hs hle
· simp only [ENNReal.coe_eq_zero, inv_eq_zero, Nat.cast_eq_zero] at hn
rw [nsmul_eq_mul, ← mul_assoc, ENNReal.coe_inv, ENNReal.coe_natCast,
ENNReal.inv_mul_cancel _ (ENNReal.natCast_ne_top _), one_mul]
all_goals simpa only [Ne, Nat.cast_eq_zero]
· obtain ⟨C, hC⟩ := hf₃
simp_rw [Finset.smul_sum]
refine ⟨C, fun n => (eLpNorm_sum_le (fun i _ => (hf₁ i).const_smul _) hp).trans ?_⟩
simp_rw [eLpNorm_const_smul, ← Finset.mul_sum, nnnorm_inv, Real.nnnorm_natCast]
by_cases hn : (↑(↑n : ℝ≥0)⁻¹ : ℝ≥0∞) = 0
· simp only [hn, zero_mul, zero_le]
refine le_trans ?_ (?_ : ↑(↑n : ℝ≥0)⁻¹ * (n • C : ℝ≥0∞) ≤ C)
· refine (ENNReal.mul_le_mul_left hn ENNReal.coe_ne_top).2 ?_
conv_rhs => rw [← Finset.card_range n]
exact Finset.sum_le_card_nsmul _ _ _ fun i _ => hC i
· simp only [ENNReal.coe_eq_zero, inv_eq_zero, Nat.cast_eq_zero] at hn
rw [nsmul_eq_mul, ← mul_assoc, ENNReal.coe_inv, ENNReal.coe_natCast,
ENNReal.inv_mul_cancel _ (ENNReal.natCast_ne_top _), one_mul]
all_goals simpa only [Ne, Nat.cast_eq_zero]
/-- The averaging of a uniformly integrable real-valued sequence is also uniformly integrable. -/
theorem uniformIntegrable_average_real (hp : 1 ≤ p) {f : ℕ → α → ℝ} (hf : UniformIntegrable f p μ) :
UniformIntegrable (fun n => (∑ i ∈ Finset.range n, f i) / (n : α → ℝ)) p μ := by
convert uniformIntegrable_average hp hf using 2 with n
ext x
simp [div_eq_inv_mul]
end UniformIntegrable
end MeasureTheory
|
MeasureTheory\Function\UnifTight.lean | /-
Copyright (c) 2023 Igor Khavkine. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Igor Khavkine
-/
import Mathlib.MeasureTheory.Function.ConvergenceInMeasure
import Mathlib.MeasureTheory.Function.L1Space
import Mathlib.MeasureTheory.Function.UniformIntegrable
/-!
# Uniform tightness
This file contains the definitions for uniform tightness for a family of Lp functions.
It is used as a hypothesis to the version of Vitali's convergence theorem for Lp spaces
that works also for spaces of infinite measure. This version of Vitali's theorem
is also proved later in the file.
## Main definitions
* `MeasureTheory.UnifTight`:
A sequence of functions `f` is uniformly tight in `L^p` if for all `ε > 0`, there
exists some measurable set `s` with finite measure such that the Lp-norm of
`f i` restricted to `sᶜ` is smaller than `ε` for all `i`.
# Main results
* `MeasureTheory.unifTight_finite`: a finite sequence of Lp functions is uniformly
tight.
* `MeasureTheory.tendsto_Lp_of_tendsto_ae`: a sequence of Lp functions which is uniformly
integrable and uniformly tight converges in Lp if it converges almost everywhere.
* `MeasureTheory.tendstoInMeasure_iff_tendsto_Lp`: Vitali convergence theorem:
a sequence of Lp functions converges in Lp if and only if it is uniformly integrable,
uniformly tight and converges in measure.
## Tags
uniform integrable, uniformly tight, Vitali convergence theorem
-/
namespace MeasureTheory
open Set Filter Topology MeasureTheory NNReal ENNReal
variable {α β ι : Type*} {m : MeasurableSpace α} {μ : Measure α} [NormedAddCommGroup β]
section UnifTight
/- This follows closely the `UnifIntegrable` section
from `Mathlib.MeasureTheory.Functions.UniformIntegrable`.-/
variable {f g : ι → α → β} {p : ℝ≥0∞}
/-- A sequence of functions `f` is uniformly tight in `L^p` if for all `ε > 0`, there
exists some measurable set `s` with finite measure such that the Lp-norm of
`f i` restricted to `sᶜ` is smaller than `ε` for all `i`. -/
def UnifTight {_ : MeasurableSpace α} (f : ι → α → β) (p : ℝ≥0∞) (μ : Measure α) : Prop :=
∀ ⦃ε : ℝ≥0⦄, 0 < ε → ∃ s : Set α, μ s ≠ ∞ ∧ ∀ i, eLpNorm (sᶜ.indicator (f i)) p μ ≤ ε
theorem unifTight_iff_ennreal {_ : MeasurableSpace α} (f : ι → α → β) (p : ℝ≥0∞) (μ : Measure α) :
UnifTight f p μ ↔ ∀ ⦃ε : ℝ≥0∞⦄, 0 < ε → ∃ s : Set α,
μ s ≠ ∞ ∧ ∀ i, eLpNorm (sᶜ.indicator (f i)) p μ ≤ ε := by
simp only [ENNReal.forall_ennreal, ENNReal.coe_pos]
refine (and_iff_left ?_).symm
simp only [zero_lt_top, le_top, implies_true, and_true, true_implies]
use ∅; simpa only [measure_empty] using zero_ne_top
theorem unifTight_iff_real {_ : MeasurableSpace α} (f : ι → α → β) (p : ℝ≥0∞) (μ : Measure α) :
UnifTight f p μ ↔ ∀ ⦃ε : ℝ⦄, 0 < ε → ∃ s : Set α,
μ s ≠ ∞ ∧ ∀ i, eLpNorm (sᶜ.indicator (f i)) p μ ≤ .ofReal ε := by
refine ⟨fun hut rε hrε ↦ hut (Real.toNNReal_pos.mpr hrε), fun hut ε hε ↦ ?_⟩
obtain ⟨s, hμs, hfε⟩ := hut hε
use s, hμs; intro i
exact (hfε i).trans_eq (ofReal_coe_nnreal (p := ε))
namespace UnifTight
theorem eventually_cofinite_indicator (hf : UnifTight f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∀ᶠ s in μ.cofinite.smallSets, ∀ i, eLpNorm (s.indicator (f i)) p μ ≤ ε := by
by_cases hε_top : ε = ∞; subst hε_top; simp
rcases hf (pos_iff_ne_zero.2 (toNNReal_ne_zero.mpr ⟨hε,hε_top⟩)) with ⟨s, hμs, hfs⟩
refine (eventually_smallSets' ?_).2 ⟨sᶜ, ?_, fun i ↦ (coe_toNNReal hε_top) ▸ hfs i⟩
· intro s t hst ht i
exact (eLpNorm_mono <| norm_indicator_le_of_subset hst _).trans (ht i)
· rwa [Measure.compl_mem_cofinite, lt_top_iff_ne_top]
protected theorem exists_measurableSet_indicator (hf : UnifTight f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ s, MeasurableSet s ∧ μ s < ∞ ∧ ∀ i, eLpNorm (sᶜ.indicator (f i)) p μ ≤ ε :=
let ⟨s, hμs, hsm, hfs⟩ := (hf.eventually_cofinite_indicator hε).exists_measurable_mem_of_smallSets
⟨sᶜ, hsm.compl, hμs, by rwa [compl_compl s]⟩
protected theorem add (hf : UnifTight f p μ) (hg : UnifTight g p μ)
(hf_meas : ∀ i, AEStronglyMeasurable (f i) μ) (hg_meas : ∀ i, AEStronglyMeasurable (g i) μ) :
UnifTight (f + g) p μ := fun ε hε ↦ by
rcases exists_Lp_half β μ p (coe_ne_zero.mpr hε.ne') with ⟨η, hη_pos, hη⟩
by_cases hη_top : η = ∞
· replace hη := hη_top ▸ hη
refine ⟨∅, (by measurability), fun i ↦ ?_⟩
simp only [compl_empty, indicator_univ, Pi.add_apply]
exact (hη (f i) (g i) (hf_meas i) (hg_meas i) le_top le_top).le
obtain ⟨s, hμs, hsm, hfs, hgs⟩ :
∃ s ∈ μ.cofinite, MeasurableSet s ∧
(∀ i, eLpNorm (s.indicator (f i)) p μ ≤ η) ∧
(∀ i, eLpNorm (s.indicator (g i)) p μ ≤ η) :=
((hf.eventually_cofinite_indicator hη_pos.ne').and
(hg.eventually_cofinite_indicator hη_pos.ne')).exists_measurable_mem_of_smallSets
refine ⟨sᶜ, ne_of_lt hμs, fun i ↦ ?_⟩
have η_cast : ↑η.toNNReal = η := coe_toNNReal hη_top
calc
eLpNorm (indicator sᶜᶜ (f i + g i)) p μ
= eLpNorm (indicator s (f i) + indicator s (g i)) p μ := by rw [compl_compl, indicator_add']
_ ≤ ε := le_of_lt <|
hη _ _ ((hf_meas i).indicator hsm) ((hg_meas i).indicator hsm)
(η_cast ▸ hfs i) (η_cast ▸ hgs i)
protected theorem neg (hf : UnifTight f p μ) : UnifTight (-f) p μ := by
simp_rw [UnifTight, Pi.neg_apply, Set.indicator_neg', eLpNorm_neg]
exact hf
protected theorem sub (hf : UnifTight f p μ) (hg : UnifTight g p μ)
(hf_meas : ∀ i, AEStronglyMeasurable (f i) μ) (hg_meas : ∀ i, AEStronglyMeasurable (g i) μ) :
UnifTight (f - g) p μ := by
rw [sub_eq_add_neg]
exact hf.add hg.neg hf_meas fun i => (hg_meas i).neg
protected theorem aeeq (hf : UnifTight f p μ) (hfg : ∀ n, f n =ᵐ[μ] g n) :
UnifTight g p μ := by
intro ε hε
obtain ⟨s, hμs, hfε⟩ := hf hε
refine ⟨s, hμs, fun n => (le_of_eq <| eLpNorm_congr_ae ?_).trans (hfε n)⟩
filter_upwards [hfg n] with x hx
simp only [indicator, mem_compl_iff, ite_not, hx]
end UnifTight
/-- If two functions agree a.e., then one is tight iff the other is tight. -/
theorem unifTight_congr_ae {g : ι → α → β} (hfg : ∀ n, f n =ᵐ[μ] g n) :
UnifTight f p μ ↔ UnifTight g p μ :=
⟨fun h => h.aeeq hfg, fun h => h.aeeq fun i => (hfg i).symm⟩
/-- A constant sequence is tight. -/
theorem unifTight_const {g : α → β} (hp_ne_top : p ≠ ∞) (hg : Memℒp g p μ) :
UnifTight (fun _ : ι => g) p μ := by
intro ε hε
by_cases hε_top : ε = ∞
· exact ⟨∅, (by measurability), fun _ => hε_top.symm ▸ le_top⟩
obtain ⟨s, _, hμs, hgε⟩ := hg.exists_eLpNorm_indicator_compl_lt hp_ne_top (coe_ne_zero.mpr hε.ne')
exact ⟨s, ne_of_lt hμs, fun _ => hgε.le⟩
/-- A single function is tight. -/
theorem unifTight_of_subsingleton [Subsingleton ι] (hp_top : p ≠ ∞)
{f : ι → α → β} (hf : ∀ i, Memℒp (f i) p μ) : UnifTight f p μ := fun ε hε ↦ by
by_cases hε_top : ε = ∞
· exact ⟨∅, by measurability, fun _ => hε_top.symm ▸ le_top⟩
by_cases hι : Nonempty ι
case neg => exact ⟨∅, (by measurability), fun i => False.elim <| hι <| Nonempty.intro i⟩
cases' hι with i
obtain ⟨s, _, hμs, hfε⟩ := (hf i).exists_eLpNorm_indicator_compl_lt hp_top (coe_ne_zero.2 hε.ne')
refine ⟨s, ne_of_lt hμs, fun j => ?_⟩
convert hfε.le
/-- This lemma is less general than `MeasureTheory.unifTight_finite` which applies to
all sequences indexed by a finite type. -/
private theorem unifTight_fin (hp_top : p ≠ ∞) {n : ℕ} {f : Fin n → α → β}
(hf : ∀ i, Memℒp (f i) p μ) : UnifTight f p μ := by
revert f
induction' n with n h
· intro f hf
have : Subsingleton (Fin Nat.zero) := subsingleton_fin_zero -- Porting note: Added this instance
exact unifTight_of_subsingleton hp_top hf
intro f hfLp ε hε
by_cases hε_top : ε = ∞
· exact ⟨∅, (by measurability), fun _ => hε_top.symm ▸ le_top⟩
let g : Fin n → α → β := fun k => f k
have hgLp : ∀ i, Memℒp (g i) p μ := fun i => hfLp i
obtain ⟨S, hμS, hFε⟩ := h hgLp hε
obtain ⟨s, _, hμs, hfε⟩ :=
(hfLp n).exists_eLpNorm_indicator_compl_lt hp_top (coe_ne_zero.2 hε.ne')
refine ⟨s ∪ S, (by measurability), fun i => ?_⟩
by_cases hi : i.val < n
· rw [(_ : f i = g ⟨i.val, hi⟩)]
· rw [compl_union, ← indicator_indicator]
apply (eLpNorm_indicator_le _).trans
exact hFε (Fin.castLT i hi)
· simp only [Fin.coe_eq_castSucc, Fin.castSucc_mk, g]
· rw [(_ : i = n)]
· rw [compl_union, inter_comm, ← indicator_indicator]
exact (eLpNorm_indicator_le _).trans hfε.le
· have hi' := Fin.is_lt i
rw [Nat.lt_succ_iff] at hi'
rw [not_lt] at hi
simp [← le_antisymm hi' hi]
/-- A finite sequence of Lp functions is uniformly tight. -/
theorem unifTight_finite [Finite ι] (hp_top : p ≠ ∞) {f : ι → α → β}
(hf : ∀ i, Memℒp (f i) p μ) : UnifTight f p μ := fun ε hε ↦ by
obtain ⟨n, hn⟩ := Finite.exists_equiv_fin ι
set g : Fin n → α → β := f ∘ hn.some.symm
have hg : ∀ i, Memℒp (g i) p μ := fun _ => hf _
obtain ⟨s, hμs, hfε⟩ := unifTight_fin hp_top hg hε
refine ⟨s, hμs, fun i => ?_⟩
simpa only [g, Function.comp_apply, Equiv.symm_apply_apply] using hfε (hn.some i)
end UnifTight
section VitaliConvergence
variable {μ : Measure α} {p : ℝ≥0∞} {f : ℕ → α → β} {g : α → β}
/-! Both directions and an iff version of Vitali's convergence theorem on measure spaces
of not necessarily finite volume. See `Thm III.6.15` of Dunford & Schwartz, Part I (1958). -/
/- We start with the reverse direction. We only need to show that uniform tightness follows
from convergence in Lp. Mathlib already has the analogous `unifIntegrable_of_tendsto_Lp`
and `tendstoInMeasure_of_tendsto_eLpNorm`. -/
/-- Intermediate lemma for `unifTight_of_tendsto_Lp`. -/
private theorem unifTight_of_tendsto_Lp_zero (hp' : p ≠ ∞) (hf : ∀ n, Memℒp (f n) p μ)
(hf_tendsto : Tendsto (fun n ↦ eLpNorm (f n) p μ) atTop (𝓝 0)) : UnifTight f p μ := fun ε hε ↦by
rw [ENNReal.tendsto_atTop_zero] at hf_tendsto
obtain ⟨N, hNε⟩ := hf_tendsto ε (by simpa only [gt_iff_lt, ENNReal.coe_pos])
let F : Fin N → α → β := fun n => f n
have hF : ∀ n, Memℒp (F n) p μ := fun n => hf n
obtain ⟨s, hμs, hFε⟩ := unifTight_fin hp' hF hε
refine ⟨s, hμs, fun n => ?_⟩
by_cases hn : n < N
· exact hFε ⟨n, hn⟩
· exact (eLpNorm_indicator_le _).trans (hNε n (not_lt.mp hn))
/-- Convergence in Lp implies uniform tightness. -/
private theorem unifTight_of_tendsto_Lp (hp' : p ≠ ∞) (hf : ∀ n, Memℒp (f n) p μ)
(hg : Memℒp g p μ) (hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0)) :
UnifTight f p μ := by
have : f = (fun _ => g) + fun n => f n - g := by ext1 n; simp
rw [this]
refine UnifTight.add ?_ ?_ (fun _ => hg.aestronglyMeasurable)
fun n => (hf n).1.sub hg.aestronglyMeasurable
· exact unifTight_const hp' hg
· exact unifTight_of_tendsto_Lp_zero hp' (fun n => (hf n).sub hg) hfg
/- Next we deal with the forward direction. The `Memℒp` and `TendstoInMeasure` hypotheses
are unwrapped and strengthened (by known lemmas) to also have the `StronglyMeasurable`
and a.e. convergence hypotheses. The bulk of the proof is done under these stronger hypotheses.-/
/-- Bulk of the proof under strengthened hypotheses. Invoked from `tendsto_Lp_of_tendsto_ae`. -/
private theorem tendsto_Lp_of_tendsto_ae_of_meas (hp : 1 ≤ p) (hp' : p ≠ ∞)
{f : ℕ → α → β} {g : α → β} (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
(hg' : Memℒp g p μ) (hui : UnifIntegrable f p μ) (hut : UnifTight f p μ)
(hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0) := by
rw [ENNReal.tendsto_atTop_zero]
intro ε hε
by_cases hfinε : ε ≠ ∞; swap
· rw [not_ne_iff.mp hfinε]; exact ⟨0, fun n _ => le_top⟩
by_cases hμ : μ = 0
· rw [hμ]; use 0; intro n _; rw [eLpNorm_measure_zero]; exact zero_le ε
have hε' : 0 < ε / 3 := ENNReal.div_pos hε.ne' (coe_ne_top)
-- use tightness to divide the domain into interior and exterior
obtain ⟨Eg, hmEg, hμEg, hgε⟩ := Memℒp.exists_eLpNorm_indicator_compl_lt hp' hg' hε'.ne' --hrε'
obtain ⟨Ef, hmEf, hμEf, hfε⟩ := hut.exists_measurableSet_indicator hε'.ne'
have hmE := hmEf.union hmEg
have hfmE := (measure_union_le Ef Eg).trans_lt (add_lt_top.mpr ⟨hμEf, hμEg⟩)
set E : Set α := Ef ∪ Eg
-- use uniform integrability to get control on the limit over E
have hgE' := Memℒp.restrict E hg'
have huiE := hui.restrict E
have hfgE : (∀ᵐ x ∂(μ.restrict E), Tendsto (fun n => f n x) atTop (𝓝 (g x))) :=
ae_restrict_of_ae hfg
-- `tendsto_Lp_of_tendsto_ae_of_meas` needs to
-- synthesize an argument `[IsFiniteMeasure (μ.restrict E)]`.
-- It is enough to have in the context a term of `Fact (μ E < ∞)`, which is our `ffmE` below,
-- which is automatically fed into `Restrict.isFiniteInstance`.
have ffmE : Fact _ := { out := hfmE }
have hInner := tendsto_Lp_finite_of_tendsto_ae_of_meas hp hp' hf hg hgE' huiE hfgE
rw [ENNReal.tendsto_atTop_zero] at hInner
-- get a sufficiently large N for given ε, and consider any n ≥ N
obtain ⟨N, hfngε⟩ := hInner (ε / 3) hε'
use N; intro n hn
-- get interior estimates
have hmfngE : AEStronglyMeasurable _ μ := (((hf n).sub hg).indicator hmE).aestronglyMeasurable
have hfngEε := calc
eLpNorm (E.indicator (f n - g)) p μ
= eLpNorm (f n - g) p (μ.restrict E) := eLpNorm_indicator_eq_eLpNorm_restrict hmE
_ ≤ ε / 3 := hfngε n hn
-- get exterior estimates
have hmgEc : AEStronglyMeasurable _ μ := (hg.indicator hmE.compl).aestronglyMeasurable
have hgEcε := calc
eLpNorm (Eᶜ.indicator g) p μ
≤ eLpNorm (Efᶜ.indicator (Egᶜ.indicator g)) p μ := by
unfold_let E; rw [compl_union, ← indicator_indicator]
_ ≤ eLpNorm (Egᶜ.indicator g) p μ := eLpNorm_indicator_le _
_ ≤ ε / 3 := hgε.le
have hmfnEc : AEStronglyMeasurable _ μ := ((hf n).indicator hmE.compl).aestronglyMeasurable
have hfnEcε : eLpNorm (Eᶜ.indicator (f n)) p μ ≤ ε / 3 := calc
eLpNorm (Eᶜ.indicator (f n)) p μ
≤ eLpNorm (Egᶜ.indicator (Efᶜ.indicator (f n))) p μ := by
unfold_let E; rw [compl_union, inter_comm, ← indicator_indicator]
_ ≤ eLpNorm (Efᶜ.indicator (f n)) p μ := eLpNorm_indicator_le _
_ ≤ ε / 3 := hfε n
have hmfngEc : AEStronglyMeasurable _ μ :=
(((hf n).sub hg).indicator hmE.compl).aestronglyMeasurable
have hfngEcε := calc
eLpNorm (Eᶜ.indicator (f n - g)) p μ
= eLpNorm (Eᶜ.indicator (f n) - Eᶜ.indicator g) p μ := by
rw [(Eᶜ.indicator_sub' _ _)]
_ ≤ eLpNorm (Eᶜ.indicator (f n)) p μ + eLpNorm (Eᶜ.indicator g) p μ := by
apply eLpNorm_sub_le (by assumption) (by assumption) hp
_ ≤ ε / 3 + ε / 3 := add_le_add hfnEcε hgEcε
-- finally, combine interior and exterior estimates
calc
eLpNorm (f n - g) p μ
= eLpNorm (Eᶜ.indicator (f n - g) + E.indicator (f n - g)) p μ := by
congr; exact (E.indicator_compl_add_self _).symm
_ ≤ eLpNorm (indicator Eᶜ (f n - g)) p μ + eLpNorm (indicator E (f n - g)) p μ := by
apply eLpNorm_add_le (by assumption) (by assumption) hp
_ ≤ (ε / 3 + ε / 3) + ε / 3 := add_le_add hfngEcε hfngEε
_ = ε := by simp only [ENNReal.add_thirds] --ENNReal.add_thirds ε
/-- Lemma used in `tendsto_Lp_of_tendsto_ae`. -/
private theorem ae_tendsto_ae_congr {f f' : ℕ → α → β} {g g' : α → β}
(hff' : ∀ (n : ℕ), f n =ᵐ[μ] f' n) (hgg' : g =ᵐ[μ] g')
(hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
∀ᵐ x ∂μ, Tendsto (fun n => f' n x) atTop (𝓝 (g' x)) := by
have hff'' := eventually_countable_forall.mpr hff'
filter_upwards [hff'', hgg', hfg] with x hff'x hgg'x hfgx
apply Tendsto.congr hff'x
rw [← hgg'x]; exact hfgx
/-- Forward direction of Vitali's convergnece theorem, with a.e. instead of InMeasure convergence.-/
theorem tendsto_Lp_of_tendsto_ae (hp : 1 ≤ p) (hp' : p ≠ ∞)
{f : ℕ → α → β} {g : α → β} (haef : ∀ n, AEStronglyMeasurable (f n) μ)
(hg' : Memℒp g p μ) (hui : UnifIntegrable f p μ) (hut : UnifTight f p μ)
(hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0) := by
-- come up with an a.e. equal strongly measurable replacement `f` for `g`
have hf := fun n => (haef n).stronglyMeasurable_mk
have hff' := fun n => (haef n).ae_eq_mk (μ := μ)
have hui' := hui.ae_eq hff'
have hut' := hut.aeeq hff'
have hg := hg'.aestronglyMeasurable.stronglyMeasurable_mk
have hgg' := hg'.aestronglyMeasurable.ae_eq_mk (μ := μ)
have hg'' := hg'.ae_eq hgg'
have haefg' := ae_tendsto_ae_congr hff' hgg' hfg
set f' := fun n => (haef n).mk (μ := μ)
set g' := hg'.aestronglyMeasurable.mk (μ := μ)
have haefg (n : ℕ) : f n - g =ᵐ[μ] f' n - g' := (hff' n).sub hgg'
have hsnfg (n : ℕ) := eLpNorm_congr_ae (p := p) (haefg n)
apply Filter.Tendsto.congr (fun n => (hsnfg n).symm)
exact tendsto_Lp_of_tendsto_ae_of_meas hp hp' hf hg hg'' hui' hut' haefg'
/-- Forward direction of Vitali's convergence theorem:
if `f` is a sequence of uniformly integrable, uniformly tight functions that converge in
measure to some function `g` in a finite measure space, then `f` converge in Lp to `g`. -/
theorem tendsto_Lp_of_tendstoInMeasure (hp : 1 ≤ p) (hp' : p ≠ ∞)
(hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : Memℒp g p μ)
(hui : UnifIntegrable f p μ) (hut : UnifTight f p μ)
(hfg : TendstoInMeasure μ f atTop g) : Tendsto (fun n ↦ eLpNorm (f n - g) p μ) atTop (𝓝 0) := by
refine tendsto_of_subseq_tendsto fun ns hns => ?_
obtain ⟨ms, _, hms'⟩ := TendstoInMeasure.exists_seq_tendsto_ae fun ε hε => (hfg ε hε).comp hns
exact ⟨ms,
tendsto_Lp_of_tendsto_ae hp hp' (fun _ => hf _) hg
(fun ε hε => -- `UnifIntegrable` on a subsequence
let ⟨δ, hδ, hδ'⟩ := hui hε
⟨δ, hδ, fun i s hs hμs => hδ' _ s hs hμs⟩)
(fun ε hε => -- `UnifTight` on a subsequence
let ⟨s, hμs, hfε⟩ := hut hε
⟨s, hμs, fun i => hfε _⟩)
hms'⟩
/-- **Vitali's convergence theorem** (non-finite measure version).
A sequence of functions `f` converges to `g` in Lp
if and only if it is uniformly integrable, uniformly tight and converges to `g` in measure. -/
theorem tendstoInMeasure_iff_tendsto_Lp (hp : 1 ≤ p) (hp' : p ≠ ∞)
(hf : ∀ n, Memℒp (f n) p μ) (hg : Memℒp g p μ) :
TendstoInMeasure μ f atTop g ∧ UnifIntegrable f p μ ∧ UnifTight f p μ
↔ Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0) where
mp h := tendsto_Lp_of_tendstoInMeasure hp hp' (fun n => (hf n).1) hg h.2.1 h.2.2 h.1
mpr h := ⟨tendstoInMeasure_of_tendsto_eLpNorm (lt_of_lt_of_le zero_lt_one hp).ne'
(fun n => (hf n).aestronglyMeasurable) hg.aestronglyMeasurable h,
unifIntegrable_of_tendsto_Lp hp hp' hf hg h,
unifTight_of_tendsto_Lp hp' hf hg h⟩
end VitaliConvergence
end MeasureTheory
|
MeasureTheory\Function\AEEqFun\DomAct.lean | /-
Copyright (c) 2023 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.MeasureTheory.Function.AEEqFun
import Mathlib.MeasureTheory.Group.Action
import Mathlib.GroupTheory.GroupAction.DomAct.Basic
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas
/-!
# Action of `DomMulAct` and `DomAddAct` on `α →ₘ[μ] β`
If `M` acts on `α` by measure-preserving transformations, then `Mᵈᵐᵃ` acts on `α →ₘ[μ] β` by sending
each function `f` to `f ∘ (DomMulAct.mk.symm c • ·)`. We define this action and basic instances
about it.
## Implementation notes
In fact, it suffices to require that `(c • ·)` is only quasi measure-preserving but we don't have a
typeclass for quasi measure-preserving actions yet.
## Keywords
-/
open MeasureTheory
namespace DomMulAct
variable {M N α β} [MeasurableSpace M] [MeasurableSpace N] [MeasurableSpace α]
{μ : MeasureTheory.Measure α} [TopologicalSpace β]
section SMul
variable [SMul M α] [MeasurableSMul M α] [SMulInvariantMeasure M α μ]
@[to_additive]
instance : SMul Mᵈᵐᵃ (α →ₘ[μ] β) where
smul c f := f.compMeasurePreserving (mk.symm c • ·) (measurePreserving_smul _ _)
@[to_additive]
theorem smul_aeeqFun_aeeq (c : Mᵈᵐᵃ) (f : α →ₘ[μ] β) :
c • f =ᵐ[μ] (f <| mk.symm c • ·) :=
f.coeFn_compMeasurePreserving _
@[to_additive (attr := simp)]
theorem mk_smul_mk_aeeqFun (c : M) (f : α → β) (hf : AEStronglyMeasurable f μ) :
mk c • AEEqFun.mk f hf = AEEqFun.mk (f <| c • ·)
(hf.comp_measurePreserving (measurePreserving_smul _ _)) :=
rfl
@[to_additive (attr := simp)]
theorem smul_aeeqFun_const (c : Mᵈᵐᵃ) (b : β) :
c • (AEEqFun.const α b : α →ₘ[μ] β) = AEEqFun.const α b :=
rfl
instance [SMul N β] [ContinuousConstSMul N β] : SMulCommClass Mᵈᵐᵃ N (α →ₘ[μ] β) where
smul_comm := by rintro _ _ ⟨_⟩; rfl
instance [SMul N β] [ContinuousConstSMul N β] : SMulCommClass N Mᵈᵐᵃ (α →ₘ[μ] β) :=
.symm _ _ _
@[to_additive]
instance [SMul N α] [MeasurableSMul N α] [SMulInvariantMeasure N α μ] [SMulCommClass M N α] :
SMulCommClass Mᵈᵐᵃ Nᵈᵐᵃ (α →ₘ[μ] β) where
smul_comm := mk.surjective.forall.2 fun c₁ ↦ mk.surjective.forall.2 fun c₂ ↦
(AEEqFun.induction_on · fun f hf ↦ by simp only [mk_smul_mk_aeeqFun, smul_comm])
instance [Zero β] : SMulZeroClass Mᵈᵐᵃ (α →ₘ[μ] β) where
smul_zero _ := rfl
-- TODO: add `AEEqFun.addZeroClass`
instance [AddMonoid β] [ContinuousAdd β] : DistribSMul Mᵈᵐᵃ (α →ₘ[μ] β) where
smul_add := by rintro _ ⟨⟩ ⟨⟩; rfl
end SMul
section MulAction
variable [Monoid M] [MulAction M α] [MeasurableSMul M α] [SMulInvariantMeasure M α μ]
@[to_additive]
instance : MulAction Mᵈᵐᵃ (α →ₘ[μ] β) where
one_smul := (AEEqFun.induction_on · fun _ _ ↦ by
simp only [← mk_one, mk_smul_mk_aeeqFun, one_smul])
mul_smul := mk.surjective.forall.2 fun _ ↦ mk.surjective.forall.2 fun _ ↦
(AEEqFun.induction_on · fun _ _ ↦ by simp only [← mk_mul, mk_smul_mk_aeeqFun, mul_smul])
instance [Monoid β] [ContinuousMul β] : MulDistribMulAction Mᵈᵐᵃ (α →ₘ[μ] β) where
smul_one _ := rfl
smul_mul := by rintro _ ⟨⟩ ⟨⟩; rfl
instance [AddMonoid β] [ContinuousAdd β] : DistribMulAction Mᵈᵐᵃ (α →ₘ[μ] β) where
smul_zero := smul_zero
smul_add := smul_add
end MulAction
end DomMulAct
|
MeasureTheory\Function\ConditionalExpectation\AEMeasurable.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp
import Mathlib.MeasureTheory.Integral.Bochner
import Mathlib.Order.Filter.IndicatorFunction
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner
import Mathlib.MeasureTheory.Function.LpSeminorm.Trim
/-! # Functions a.e. measurable with respect to a sub-σ-algebra
A function `f` verifies `AEStronglyMeasurable' m f μ` if it is `μ`-a.e. equal to
an `m`-strongly measurable function. This is similar to `AEStronglyMeasurable`, but the
`MeasurableSpace` structures used for the measurability statement and for the measure are
different.
We define `lpMeas F 𝕜 m p μ`, the subspace of `Lp F p μ` containing functions `f` verifying
`AEStronglyMeasurable' m f μ`, i.e. functions which are `μ`-a.e. equal to an `m`-strongly
measurable function.
## Main statements
We define an `IsometryEquiv` between `lpMeasSubgroup` and the `Lp` space corresponding to the
measure `μ.trim hm`. As a consequence, the completeness of `Lp` implies completeness of `lpMeas`.
`Lp.induction_stronglyMeasurable` (see also `Memℒp.induction_stronglyMeasurable`):
To prove something for an `Lp` function a.e. strongly measurable with respect to a
sub-σ-algebra `m` in a normed space, it suffices to show that
* the property holds for (multiples of) characteristic functions which are measurable w.r.t. `m`;
* is closed under addition;
* the set of functions in `Lp` strongly measurable w.r.t. `m` for which the property holds is
closed.
-/
open TopologicalSpace Filter
open scoped ENNReal MeasureTheory
namespace MeasureTheory
/-- A function `f` verifies `AEStronglyMeasurable' m f μ` if it is `μ`-a.e. equal to
an `m`-strongly measurable function. This is similar to `AEStronglyMeasurable`, but the
`MeasurableSpace` structures used for the measurability statement and for the measure are
different. -/
def AEStronglyMeasurable' {α β} [TopologicalSpace β] (m : MeasurableSpace α)
{_ : MeasurableSpace α} (f : α → β) (μ : Measure α) : Prop :=
∃ g : α → β, StronglyMeasurable[m] g ∧ f =ᵐ[μ] g
namespace AEStronglyMeasurable'
variable {α β 𝕜 : Type*} {m m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β]
{f g : α → β}
theorem congr (hf : AEStronglyMeasurable' m f μ) (hfg : f =ᵐ[μ] g) :
AEStronglyMeasurable' m g μ := by
obtain ⟨f', hf'_meas, hff'⟩ := hf; exact ⟨f', hf'_meas, hfg.symm.trans hff'⟩
theorem mono {m'} (hf : AEStronglyMeasurable' m f μ) (hm : m ≤ m') :
AEStronglyMeasurable' m' f μ :=
let ⟨f', hf'_meas, hff'⟩ := hf; ⟨f', hf'_meas.mono hm, hff'⟩
theorem add [Add β] [ContinuousAdd β] (hf : AEStronglyMeasurable' m f μ)
(hg : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f + g) μ := by
rcases hf with ⟨f', h_f'_meas, hff'⟩
rcases hg with ⟨g', h_g'_meas, hgg'⟩
exact ⟨f' + g', h_f'_meas.add h_g'_meas, hff'.add hgg'⟩
theorem neg [AddGroup β] [TopologicalAddGroup β] {f : α → β} (hfm : AEStronglyMeasurable' m f μ) :
AEStronglyMeasurable' m (-f) μ := by
rcases hfm with ⟨f', hf'_meas, hf_ae⟩
refine ⟨-f', hf'_meas.neg, hf_ae.mono fun x hx => ?_⟩
simp_rw [Pi.neg_apply]
rw [hx]
theorem sub [AddGroup β] [TopologicalAddGroup β] {f g : α → β} (hfm : AEStronglyMeasurable' m f μ)
(hgm : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f - g) μ := by
rcases hfm with ⟨f', hf'_meas, hf_ae⟩
rcases hgm with ⟨g', hg'_meas, hg_ae⟩
refine ⟨f' - g', hf'_meas.sub hg'_meas, hf_ae.mp (hg_ae.mono fun x hx1 hx2 => ?_)⟩
simp_rw [Pi.sub_apply]
rw [hx1, hx2]
theorem const_smul [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (c : 𝕜) (hf : AEStronglyMeasurable' m f μ) :
AEStronglyMeasurable' m (c • f) μ := by
rcases hf with ⟨f', h_f'_meas, hff'⟩
refine ⟨c • f', h_f'_meas.const_smul c, ?_⟩
exact EventuallyEq.fun_comp hff' fun x => c • x
theorem const_inner {𝕜 β} [RCLike 𝕜] [NormedAddCommGroup β] [InnerProductSpace 𝕜 β] {f : α → β}
(hfm : AEStronglyMeasurable' m f μ) (c : β) :
AEStronglyMeasurable' m (fun x => (inner c (f x) : 𝕜)) μ := by
rcases hfm with ⟨f', hf'_meas, hf_ae⟩
refine
⟨fun x => (inner c (f' x) : 𝕜), (@stronglyMeasurable_const _ _ m _ c).inner hf'_meas,
hf_ae.mono fun x hx => ?_⟩
dsimp only
rw [hx]
/-- An `m`-strongly measurable function almost everywhere equal to `f`. -/
noncomputable def mk (f : α → β) (hfm : AEStronglyMeasurable' m f μ) : α → β :=
hfm.choose
theorem stronglyMeasurable_mk {f : α → β} (hfm : AEStronglyMeasurable' m f μ) :
StronglyMeasurable[m] (hfm.mk f) :=
hfm.choose_spec.1
theorem ae_eq_mk {f : α → β} (hfm : AEStronglyMeasurable' m f μ) : f =ᵐ[μ] hfm.mk f :=
hfm.choose_spec.2
theorem continuous_comp {γ} [TopologicalSpace γ] {f : α → β} {g : β → γ} (hg : Continuous g)
(hf : AEStronglyMeasurable' m f μ) : AEStronglyMeasurable' m (g ∘ f) μ :=
⟨fun x => g (hf.mk _ x),
@Continuous.comp_stronglyMeasurable _ _ _ m _ _ _ _ hg hf.stronglyMeasurable_mk,
hf.ae_eq_mk.mono fun x hx => by rw [Function.comp_apply, hx]⟩
end AEStronglyMeasurable'
theorem aeStronglyMeasurable'_of_aeStronglyMeasurable'_trim {α β} {m m0 m0' : MeasurableSpace α}
[TopologicalSpace β] (hm0 : m0 ≤ m0') {μ : Measure α} {f : α → β}
(hf : AEStronglyMeasurable' m f (μ.trim hm0)) : AEStronglyMeasurable' m f μ := by
obtain ⟨g, hg_meas, hfg⟩ := hf; exact ⟨g, hg_meas, ae_eq_of_ae_eq_trim hfg⟩
theorem StronglyMeasurable.aeStronglyMeasurable' {α β} {m _ : MeasurableSpace α}
[TopologicalSpace β] {μ : Measure α} {f : α → β} (hf : StronglyMeasurable[m] f) :
AEStronglyMeasurable' m f μ :=
⟨f, hf, ae_eq_refl _⟩
theorem ae_eq_trim_iff_of_aeStronglyMeasurable' {α β} [TopologicalSpace β] [MetrizableSpace β]
{m m0 : MeasurableSpace α} {μ : Measure α} {f g : α → β} (hm : m ≤ m0)
(hfm : AEStronglyMeasurable' m f μ) (hgm : AEStronglyMeasurable' m g μ) :
hfm.mk f =ᵐ[μ.trim hm] hgm.mk g ↔ f =ᵐ[μ] g :=
(ae_eq_trim_iff hm hfm.stronglyMeasurable_mk hgm.stronglyMeasurable_mk).trans
⟨fun h => hfm.ae_eq_mk.trans (h.trans hgm.ae_eq_mk.symm), fun h =>
hfm.ae_eq_mk.symm.trans (h.trans hgm.ae_eq_mk)⟩
theorem AEStronglyMeasurable.comp_ae_measurable' {α β γ : Type*} [TopologicalSpace β]
{mα : MeasurableSpace α} {_ : MeasurableSpace γ} {f : α → β} {μ : Measure γ} {g : γ → α}
(hf : AEStronglyMeasurable f (μ.map g)) (hg : AEMeasurable g μ) :
AEStronglyMeasurable' (mα.comap g) (f ∘ g) μ :=
⟨hf.mk f ∘ g, hf.stronglyMeasurable_mk.comp_measurable (measurable_iff_comap_le.mpr le_rfl),
ae_eq_comp hg hf.ae_eq_mk⟩
/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` almost
everywhere supported on `s` is `m`-ae-strongly-measurable, then `f` is also
`m₂`-ae-strongly-measurable. -/
theorem AEStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on {α E}
{m m₂ m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace E] [Zero E] (hm : m ≤ m0)
{s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
(hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
(hf : AEStronglyMeasurable' m f μ) (hf_zero : f =ᵐ[μ.restrict sᶜ] 0) :
AEStronglyMeasurable' m₂ f μ := by
have h_ind_eq : s.indicator (hf.mk f) =ᵐ[μ] f := by
refine Filter.EventuallyEq.trans ?_ <|
indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs_m) hf_zero
filter_upwards [hf.ae_eq_mk] with x hx
by_cases hxs : x ∈ s
· simp [hxs, hx]
· simp [hxs]
suffices StronglyMeasurable[m₂] (s.indicator (hf.mk f)) from
AEStronglyMeasurable'.congr this.aeStronglyMeasurable' h_ind_eq
have hf_ind : StronglyMeasurable[m] (s.indicator (hf.mk f)) :=
hf.stronglyMeasurable_mk.indicator hs_m
exact
hf_ind.stronglyMeasurable_of_measurableSpace_le_on hs_m hs fun x hxs =>
Set.indicator_of_not_mem hxs _
variable {α E' F F' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜]
-- 𝕜 for ℝ or ℂ
-- E' for an inner product space on which we compute integrals
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E'] [CompleteSpace E'] [NormedSpace ℝ E']
-- F for a Lp submodule
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
-- F' for integrals on a Lp submodule
[NormedAddCommGroup F']
[NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F']
section LpMeas
/-! ## The subset `lpMeas` of `Lp` functions a.e. measurable with respect to a sub-sigma-algebra -/
variable (F)
/-- `lpMeasSubgroup F m p μ` is the subspace of `Lp F p μ` containing functions `f` verifying
`AEStronglyMeasurable' m f μ`, i.e. functions which are `μ`-a.e. equal to
an `m`-strongly measurable function. -/
def lpMeasSubgroup (m : MeasurableSpace α) [MeasurableSpace α] (p : ℝ≥0∞) (μ : Measure α) :
AddSubgroup (Lp F p μ) where
carrier := {f : Lp F p μ | AEStronglyMeasurable' m f μ}
zero_mem' := ⟨(0 : α → F), @stronglyMeasurable_zero _ _ m _ _, Lp.coeFn_zero _ _ _⟩
add_mem' {f g} hf hg := (hf.add hg).congr (Lp.coeFn_add f g).symm
neg_mem' {f} hf := AEStronglyMeasurable'.congr hf.neg (Lp.coeFn_neg f).symm
variable (𝕜)
/-- `lpMeas F 𝕜 m p μ` is the subspace of `Lp F p μ` containing functions `f` verifying
`AEStronglyMeasurable' m f μ`, i.e. functions which are `μ`-a.e. equal to
an `m`-strongly measurable function. -/
def lpMeas (m : MeasurableSpace α) [MeasurableSpace α] (p : ℝ≥0∞) (μ : Measure α) :
Submodule 𝕜 (Lp F p μ) where
carrier := {f : Lp F p μ | AEStronglyMeasurable' m f μ}
zero_mem' := ⟨(0 : α → F), @stronglyMeasurable_zero _ _ m _ _, Lp.coeFn_zero _ _ _⟩
add_mem' {f g} hf hg := (hf.add hg).congr (Lp.coeFn_add f g).symm
smul_mem' c f hf := (hf.const_smul c).congr (Lp.coeFn_smul c f).symm
variable {F 𝕜}
theorem mem_lpMeasSubgroup_iff_aeStronglyMeasurable' {m m0 : MeasurableSpace α} {μ : Measure α}
{f : Lp F p μ} : f ∈ lpMeasSubgroup F m p μ ↔ AEStronglyMeasurable' m f μ := by
rw [← AddSubgroup.mem_carrier, lpMeasSubgroup, Set.mem_setOf_eq]
theorem mem_lpMeas_iff_aeStronglyMeasurable' {m m0 : MeasurableSpace α} {μ : Measure α}
{f : Lp F p μ} : f ∈ lpMeas F 𝕜 m p μ ↔ AEStronglyMeasurable' m f μ := by
rw [← SetLike.mem_coe, ← Submodule.mem_carrier, lpMeas, Set.mem_setOf_eq]
theorem lpMeas.aeStronglyMeasurable' {m _ : MeasurableSpace α} {μ : Measure α}
(f : lpMeas F 𝕜 m p μ) : AEStronglyMeasurable' (β := F) m f μ :=
mem_lpMeas_iff_aeStronglyMeasurable'.mp f.mem
theorem mem_lpMeas_self {m0 : MeasurableSpace α} (μ : Measure α) (f : Lp F p μ) :
f ∈ lpMeas F 𝕜 m0 p μ :=
mem_lpMeas_iff_aeStronglyMeasurable'.mpr (Lp.aestronglyMeasurable f)
theorem lpMeasSubgroup_coe {m _ : MeasurableSpace α} {μ : Measure α} {f : lpMeasSubgroup F m p μ} :
(f : _ → _) = (f : Lp F p μ) :=
rfl
theorem lpMeas_coe {m _ : MeasurableSpace α} {μ : Measure α} {f : lpMeas F 𝕜 m p μ} :
(f : _ → _) = (f : Lp F p μ) :=
rfl
theorem mem_lpMeas_indicatorConstLp {m m0 : MeasurableSpace α} (hm : m ≤ m0) {μ : Measure α}
{s : Set α} (hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) {c : F} :
indicatorConstLp p (hm s hs) hμs c ∈ lpMeas F 𝕜 m p μ :=
⟨s.indicator fun _ : α => c, (@stronglyMeasurable_const _ _ m _ _).indicator hs,
indicatorConstLp_coeFn⟩
section CompleteSubspace
/-! ## The subspace `lpMeas` is complete.
We define an `IsometryEquiv` between `lpMeasSubgroup` and the `Lp` space corresponding to the
measure `μ.trim hm`. As a consequence, the completeness of `Lp` implies completeness of
`lpMeasSubgroup` (and `lpMeas`). -/
variable {ι : Type*} {m m0 : MeasurableSpace α} {μ : Measure α}
/-- If `f` belongs to `lpMeasSubgroup F m p μ`, then the measurable function it is almost
everywhere equal to (given by `AEMeasurable.mk`) belongs to `ℒp` for the measure `μ.trim hm`. -/
theorem memℒp_trim_of_mem_lpMeasSubgroup (hm : m ≤ m0) (f : Lp F p μ)
(hf_meas : f ∈ lpMeasSubgroup F m p μ) :
Memℒp (mem_lpMeasSubgroup_iff_aeStronglyMeasurable'.mp hf_meas).choose p (μ.trim hm) := by
have hf : AEStronglyMeasurable' m f μ :=
mem_lpMeasSubgroup_iff_aeStronglyMeasurable'.mp hf_meas
let g := hf.choose
obtain ⟨hg, hfg⟩ := hf.choose_spec
change Memℒp g p (μ.trim hm)
refine ⟨hg.aestronglyMeasurable, ?_⟩
have h_eLpNorm_fg : eLpNorm g p (μ.trim hm) = eLpNorm f p μ := by
rw [eLpNorm_trim hm hg]
exact eLpNorm_congr_ae hfg.symm
rw [h_eLpNorm_fg]
exact Lp.eLpNorm_lt_top f
/-- If `f` belongs to `Lp` for the measure `μ.trim hm`, then it belongs to the subgroup
`lpMeasSubgroup F m p μ`. -/
theorem mem_lpMeasSubgroup_toLp_of_trim (hm : m ≤ m0) (f : Lp F p (μ.trim hm)) :
(memℒp_of_memℒp_trim hm (Lp.memℒp f)).toLp f ∈ lpMeasSubgroup F m p μ := by
let hf_mem_ℒp := memℒp_of_memℒp_trim hm (Lp.memℒp f)
rw [mem_lpMeasSubgroup_iff_aeStronglyMeasurable']
refine AEStronglyMeasurable'.congr ?_ (Memℒp.coeFn_toLp hf_mem_ℒp).symm
refine aeStronglyMeasurable'_of_aeStronglyMeasurable'_trim hm ?_
exact Lp.aestronglyMeasurable f
variable (F p μ)
/-- Map from `lpMeasSubgroup` to `Lp F p (μ.trim hm)`. -/
noncomputable def lpMeasSubgroupToLpTrim (hm : m ≤ m0) (f : lpMeasSubgroup F m p μ) :
Lp F p (μ.trim hm) :=
Memℒp.toLp (mem_lpMeasSubgroup_iff_aeStronglyMeasurable'.mp f.mem).choose
-- Porting note: had to replace `f` with `f.1` here.
(memℒp_trim_of_mem_lpMeasSubgroup hm f.1 f.mem)
variable (𝕜)
/-- Map from `lpMeas` to `Lp F p (μ.trim hm)`. -/
noncomputable def lpMeasToLpTrim (hm : m ≤ m0) (f : lpMeas F 𝕜 m p μ) : Lp F p (μ.trim hm) :=
Memℒp.toLp (mem_lpMeas_iff_aeStronglyMeasurable'.mp f.mem).choose
-- Porting note: had to replace `f` with `f.1` here.
(memℒp_trim_of_mem_lpMeasSubgroup hm f.1 f.mem)
variable {𝕜}
/-- Map from `Lp F p (μ.trim hm)` to `lpMeasSubgroup`, inverse of
`lpMeasSubgroupToLpTrim`. -/
noncomputable def lpTrimToLpMeasSubgroup (hm : m ≤ m0) (f : Lp F p (μ.trim hm)) :
lpMeasSubgroup F m p μ :=
⟨(memℒp_of_memℒp_trim hm (Lp.memℒp f)).toLp f, mem_lpMeasSubgroup_toLp_of_trim hm f⟩
variable (𝕜)
/-- Map from `Lp F p (μ.trim hm)` to `lpMeas`, inverse of `Lp_meas_to_Lp_trim`. -/
noncomputable def lpTrimToLpMeas (hm : m ≤ m0) (f : Lp F p (μ.trim hm)) : lpMeas F 𝕜 m p μ :=
⟨(memℒp_of_memℒp_trim hm (Lp.memℒp f)).toLp f, mem_lpMeasSubgroup_toLp_of_trim hm f⟩
variable {F 𝕜 p μ}
theorem lpMeasSubgroupToLpTrim_ae_eq (hm : m ≤ m0) (f : lpMeasSubgroup F m p μ) :
lpMeasSubgroupToLpTrim F p μ hm f =ᵐ[μ] f :=
-- Porting note: replaced `(↑f)` with `f.1` here.
(ae_eq_of_ae_eq_trim (Memℒp.coeFn_toLp (memℒp_trim_of_mem_lpMeasSubgroup hm f.1 f.mem))).trans
(mem_lpMeasSubgroup_iff_aeStronglyMeasurable'.mp f.mem).choose_spec.2.symm
theorem lpTrimToLpMeasSubgroup_ae_eq (hm : m ≤ m0) (f : Lp F p (μ.trim hm)) :
lpTrimToLpMeasSubgroup F p μ hm f =ᵐ[μ] f :=
-- Porting note: filled in the argument
Memℒp.coeFn_toLp (memℒp_of_memℒp_trim hm (Lp.memℒp f))
theorem lpMeasToLpTrim_ae_eq (hm : m ≤ m0) (f : lpMeas F 𝕜 m p μ) :
lpMeasToLpTrim F 𝕜 p μ hm f =ᵐ[μ] f :=
-- Porting note: replaced `(↑f)` with `f.1` here.
(ae_eq_of_ae_eq_trim (Memℒp.coeFn_toLp (memℒp_trim_of_mem_lpMeasSubgroup hm f.1 f.mem))).trans
(mem_lpMeasSubgroup_iff_aeStronglyMeasurable'.mp f.mem).choose_spec.2.symm
theorem lpTrimToLpMeas_ae_eq (hm : m ≤ m0) (f : Lp F p (μ.trim hm)) :
lpTrimToLpMeas F 𝕜 p μ hm f =ᵐ[μ] f :=
-- Porting note: filled in the argument
Memℒp.coeFn_toLp (memℒp_of_memℒp_trim hm (Lp.memℒp f))
/-- `lpTrimToLpMeasSubgroup` is a right inverse of `lpMeasSubgroupToLpTrim`. -/
theorem lpMeasSubgroupToLpTrim_right_inv (hm : m ≤ m0) :
Function.RightInverse (lpTrimToLpMeasSubgroup F p μ hm) (lpMeasSubgroupToLpTrim F p μ hm) := by
intro f
ext1
refine
ae_eq_trim_of_stronglyMeasurable hm (Lp.stronglyMeasurable _) (Lp.stronglyMeasurable _) ?_
exact (lpMeasSubgroupToLpTrim_ae_eq hm _).trans (lpTrimToLpMeasSubgroup_ae_eq hm _)
/-- `lpTrimToLpMeasSubgroup` is a left inverse of `lpMeasSubgroupToLpTrim`. -/
theorem lpMeasSubgroupToLpTrim_left_inv (hm : m ≤ m0) :
Function.LeftInverse (lpTrimToLpMeasSubgroup F p μ hm) (lpMeasSubgroupToLpTrim F p μ hm) := by
intro f
ext1
ext1
rw [← lpMeasSubgroup_coe]
exact (lpTrimToLpMeasSubgroup_ae_eq hm _).trans (lpMeasSubgroupToLpTrim_ae_eq hm _)
theorem lpMeasSubgroupToLpTrim_add (hm : m ≤ m0) (f g : lpMeasSubgroup F m p μ) :
lpMeasSubgroupToLpTrim F p μ hm (f + g) =
lpMeasSubgroupToLpTrim F p μ hm f + lpMeasSubgroupToLpTrim F p μ hm g := by
ext1
refine EventuallyEq.trans ?_ (Lp.coeFn_add _ _).symm
refine ae_eq_trim_of_stronglyMeasurable hm (Lp.stronglyMeasurable _) ?_ ?_
· exact (Lp.stronglyMeasurable _).add (Lp.stronglyMeasurable _)
refine (lpMeasSubgroupToLpTrim_ae_eq hm _).trans ?_
refine
EventuallyEq.trans ?_
(EventuallyEq.add (lpMeasSubgroupToLpTrim_ae_eq hm f).symm
(lpMeasSubgroupToLpTrim_ae_eq hm g).symm)
refine (Lp.coeFn_add _ _).trans ?_
simp_rw [lpMeasSubgroup_coe]
filter_upwards with x using rfl
theorem lpMeasSubgroupToLpTrim_neg (hm : m ≤ m0) (f : lpMeasSubgroup F m p μ) :
lpMeasSubgroupToLpTrim F p μ hm (-f) = -lpMeasSubgroupToLpTrim F p μ hm f := by
ext1
refine EventuallyEq.trans ?_ (Lp.coeFn_neg _).symm
refine ae_eq_trim_of_stronglyMeasurable hm (Lp.stronglyMeasurable _) ?_ ?_
· exact @StronglyMeasurable.neg _ _ _ m _ _ _ (Lp.stronglyMeasurable _)
refine (lpMeasSubgroupToLpTrim_ae_eq hm _).trans ?_
refine EventuallyEq.trans ?_ (EventuallyEq.neg (lpMeasSubgroupToLpTrim_ae_eq hm f).symm)
refine (Lp.coeFn_neg _).trans ?_
simp_rw [lpMeasSubgroup_coe]
exact eventually_of_forall fun x => by rfl
theorem lpMeasSubgroupToLpTrim_sub (hm : m ≤ m0) (f g : lpMeasSubgroup F m p μ) :
lpMeasSubgroupToLpTrim F p μ hm (f - g) =
lpMeasSubgroupToLpTrim F p μ hm f - lpMeasSubgroupToLpTrim F p μ hm g := by
rw [sub_eq_add_neg, sub_eq_add_neg, lpMeasSubgroupToLpTrim_add,
lpMeasSubgroupToLpTrim_neg]
theorem lpMeasToLpTrim_smul (hm : m ≤ m0) (c : 𝕜) (f : lpMeas F 𝕜 m p μ) :
lpMeasToLpTrim F 𝕜 p μ hm (c • f) = c • lpMeasToLpTrim F 𝕜 p μ hm f := by
ext1
refine EventuallyEq.trans ?_ (Lp.coeFn_smul _ _).symm
refine ae_eq_trim_of_stronglyMeasurable hm (Lp.stronglyMeasurable _) ?_ ?_
· exact (Lp.stronglyMeasurable _).const_smul c
refine (lpMeasToLpTrim_ae_eq hm _).trans ?_
refine (Lp.coeFn_smul _ _).trans ?_
refine (lpMeasToLpTrim_ae_eq hm f).mono fun x hx => ?_
simp only [Pi.smul_apply, hx]
/-- `lpMeasSubgroupToLpTrim` preserves the norm. -/
theorem lpMeasSubgroupToLpTrim_norm_map [hp : Fact (1 ≤ p)] (hm : m ≤ m0)
(f : lpMeasSubgroup F m p μ) : ‖lpMeasSubgroupToLpTrim F p μ hm f‖ = ‖f‖ := by
rw [Lp.norm_def, eLpNorm_trim hm (Lp.stronglyMeasurable _),
eLpNorm_congr_ae (lpMeasSubgroupToLpTrim_ae_eq hm _), lpMeasSubgroup_coe, ← Lp.norm_def]
congr
theorem isometry_lpMeasSubgroupToLpTrim [hp : Fact (1 ≤ p)] (hm : m ≤ m0) :
Isometry (lpMeasSubgroupToLpTrim F p μ hm) :=
Isometry.of_dist_eq fun f g => by
rw [dist_eq_norm, ← lpMeasSubgroupToLpTrim_sub, lpMeasSubgroupToLpTrim_norm_map,
dist_eq_norm]
variable (F p μ)
/-- `lpMeasSubgroup` and `Lp F p (μ.trim hm)` are isometric. -/
noncomputable def lpMeasSubgroupToLpTrimIso [Fact (1 ≤ p)] (hm : m ≤ m0) :
lpMeasSubgroup F m p μ ≃ᵢ Lp F p (μ.trim hm) where
toFun := lpMeasSubgroupToLpTrim F p μ hm
invFun := lpTrimToLpMeasSubgroup F p μ hm
left_inv := lpMeasSubgroupToLpTrim_left_inv hm
right_inv := lpMeasSubgroupToLpTrim_right_inv hm
isometry_toFun := isometry_lpMeasSubgroupToLpTrim hm
variable (𝕜)
/-- `lpMeasSubgroup` and `lpMeas` are isometric. -/
noncomputable def lpMeasSubgroupToLpMeasIso [Fact (1 ≤ p)] :
lpMeasSubgroup F m p μ ≃ᵢ lpMeas F 𝕜 m p μ :=
IsometryEquiv.refl (lpMeasSubgroup F m p μ)
/-- `lpMeas` and `Lp F p (μ.trim hm)` are isometric, with a linear equivalence. -/
noncomputable def lpMeasToLpTrimLie [Fact (1 ≤ p)] (hm : m ≤ m0) :
lpMeas F 𝕜 m p μ ≃ₗᵢ[𝕜] Lp F p (μ.trim hm) where
toFun := lpMeasToLpTrim F 𝕜 p μ hm
invFun := lpTrimToLpMeas F 𝕜 p μ hm
left_inv := lpMeasSubgroupToLpTrim_left_inv hm
right_inv := lpMeasSubgroupToLpTrim_right_inv hm
map_add' := lpMeasSubgroupToLpTrim_add hm
map_smul' := lpMeasToLpTrim_smul hm
norm_map' := lpMeasSubgroupToLpTrim_norm_map hm
variable {F 𝕜 p μ}
instance [hm : Fact (m ≤ m0)] [CompleteSpace F] [hp : Fact (1 ≤ p)] :
CompleteSpace (lpMeasSubgroup F m p μ) := by
rw [(lpMeasSubgroupToLpTrimIso F p μ hm.elim).completeSpace_iff]; infer_instance
-- For now just no-lint this; lean4's tree-based logging will make this easier to debug.
-- One possible change might be to generalize `𝕜` from `RCLike` to `NormedField`, as this
-- result may well hold there.
-- Porting note: removed @[nolint fails_quickly]
instance [hm : Fact (m ≤ m0)] [CompleteSpace F] [hp : Fact (1 ≤ p)] :
CompleteSpace (lpMeas F 𝕜 m p μ) := by
rw [(lpMeasSubgroupToLpMeasIso F 𝕜 p μ).symm.completeSpace_iff]; infer_instance
theorem isComplete_aeStronglyMeasurable' [hp : Fact (1 ≤ p)] [CompleteSpace F] (hm : m ≤ m0) :
IsComplete {f : Lp F p μ | AEStronglyMeasurable' m f μ} := by
rw [← completeSpace_coe_iff_isComplete]
haveI : Fact (m ≤ m0) := ⟨hm⟩
change CompleteSpace (lpMeasSubgroup F m p μ)
infer_instance
theorem isClosed_aeStronglyMeasurable' [Fact (1 ≤ p)] [CompleteSpace F] (hm : m ≤ m0) :
IsClosed {f : Lp F p μ | AEStronglyMeasurable' m f μ} :=
IsComplete.isClosed (isComplete_aeStronglyMeasurable' hm)
end CompleteSubspace
section StronglyMeasurable
variable {m m0 : MeasurableSpace α} {μ : Measure α}
/-- We do not get `ae_fin_strongly_measurable f (μ.trim hm)`, since we don't have
`f =ᵐ[μ.trim hm] Lp_meas_to_Lp_trim F 𝕜 p μ hm f` but only the weaker
`f =ᵐ[μ] Lp_meas_to_Lp_trim F 𝕜 p μ hm f`. -/
theorem lpMeas.ae_fin_strongly_measurable' (hm : m ≤ m0) (f : lpMeas F 𝕜 m p μ) (hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ∞) :
-- Porting note: changed `f` to `f.1` in the next line. Not certain this is okay.
∃ g, FinStronglyMeasurable g (μ.trim hm) ∧ f.1 =ᵐ[μ] g :=
⟨lpMeasSubgroupToLpTrim F p μ hm f, Lp.finStronglyMeasurable _ hp_ne_zero hp_ne_top,
(lpMeasSubgroupToLpTrim_ae_eq hm f).symm⟩
/-- When applying the inverse of `lpMeasToLpTrimLie` (which takes a function in the Lp space of
the sub-sigma algebra and returns its version in the larger Lp space) to an indicator of the
sub-sigma-algebra, we obtain an indicator in the Lp space of the larger sigma-algebra. -/
theorem lpMeasToLpTrimLie_symm_indicator [one_le_p : Fact (1 ≤ p)] [NormedSpace ℝ F] {hm : m ≤ m0}
{s : Set α} {μ : Measure α} (hs : MeasurableSet[m] s) (hμs : μ.trim hm s ≠ ∞) (c : F) :
((lpMeasToLpTrimLie F ℝ p μ hm).symm (indicatorConstLp p hs hμs c) : Lp F p μ) =
indicatorConstLp p (hm s hs) ((le_trim hm).trans_lt hμs.lt_top).ne c := by
ext1
rw [← lpMeas_coe]
change
lpTrimToLpMeas F ℝ p μ hm (indicatorConstLp p hs hμs c) =ᵐ[μ]
(indicatorConstLp p _ _ c : α → F)
refine (lpTrimToLpMeas_ae_eq hm _).trans ?_
exact (ae_eq_of_ae_eq_trim indicatorConstLp_coeFn).trans indicatorConstLp_coeFn.symm
theorem lpMeasToLpTrimLie_symm_toLp [one_le_p : Fact (1 ≤ p)] [NormedSpace ℝ F] (hm : m ≤ m0)
(f : α → F) (hf : Memℒp f p (μ.trim hm)) :
((lpMeasToLpTrimLie F ℝ p μ hm).symm (hf.toLp f) : Lp F p μ) =
(memℒp_of_memℒp_trim hm hf).toLp f := by
ext1
rw [← lpMeas_coe]
refine (lpTrimToLpMeas_ae_eq hm _).trans ?_
exact (ae_eq_of_ae_eq_trim (Memℒp.coeFn_toLp hf)).trans (Memℒp.coeFn_toLp _).symm
end StronglyMeasurable
end LpMeas
section Induction
variable {m m0 : MeasurableSpace α} {μ : Measure α} [Fact (1 ≤ p)] [NormedSpace ℝ F]
/-- Auxiliary lemma for `Lp.induction_stronglyMeasurable`. -/
@[elab_as_elim]
theorem Lp.induction_stronglyMeasurable_aux (hm : m ≤ m0) (hp_ne_top : p ≠ ∞) (P : Lp F p μ → Prop)
(h_ind : ∀ (c : F) {s : Set α} (hs : MeasurableSet[m] s) (hμs : μ s < ∞),
P (Lp.simpleFunc.indicatorConst p (hm s hs) hμs.ne c))
(h_add : ∀ ⦃f g⦄, ∀ hf : Memℒp f p μ, ∀ hg : Memℒp g p μ, AEStronglyMeasurable' m f μ →
AEStronglyMeasurable' m g μ → Disjoint (Function.support f) (Function.support g) →
P (hf.toLp f) → P (hg.toLp g) → P (hf.toLp f + hg.toLp g))
(h_closed : IsClosed {f : lpMeas F ℝ m p μ | P f}) :
∀ f : Lp F p μ, AEStronglyMeasurable' m f μ → P f := by
intro f hf
let f' := (⟨f, hf⟩ : lpMeas F ℝ m p μ)
let g := lpMeasToLpTrimLie F ℝ p μ hm f'
have hfg : f' = (lpMeasToLpTrimLie F ℝ p μ hm).symm g := by
simp only [f', g, LinearIsometryEquiv.symm_apply_apply]
change P ↑f'
rw [hfg]
refine
@Lp.induction α F m _ p (μ.trim hm) _ hp_ne_top
(fun g => P ((lpMeasToLpTrimLie F ℝ p μ hm).symm g)) ?_ ?_ ?_ g
· intro b t ht hμt
-- Porting note: needed to pass `m` to `Lp.simpleFunc.coe_indicatorConst` to avoid
-- synthesized type class instance is not definitionally equal to expression inferred by typing
-- rules, synthesized m0 inferred m
rw [@Lp.simpleFunc.coe_indicatorConst _ _ m, lpMeasToLpTrimLie_symm_indicator ht hμt.ne b]
have hμt' : μ t < ∞ := (le_trim hm).trans_lt hμt
specialize h_ind b ht hμt'
rwa [Lp.simpleFunc.coe_indicatorConst] at h_ind
· intro f g hf hg h_disj hfP hgP
rw [LinearIsometryEquiv.map_add]
push_cast
have h_eq :
∀ (f : α → F) (hf : Memℒp f p (μ.trim hm)),
((lpMeasToLpTrimLie F ℝ p μ hm).symm (Memℒp.toLp f hf) : Lp F p μ) =
(memℒp_of_memℒp_trim hm hf).toLp f :=
lpMeasToLpTrimLie_symm_toLp hm
rw [h_eq f hf] at hfP ⊢
rw [h_eq g hg] at hgP ⊢
exact
h_add (memℒp_of_memℒp_trim hm hf) (memℒp_of_memℒp_trim hm hg)
(aeStronglyMeasurable'_of_aeStronglyMeasurable'_trim hm hf.aestronglyMeasurable)
(aeStronglyMeasurable'_of_aeStronglyMeasurable'_trim hm hg.aestronglyMeasurable)
h_disj hfP hgP
· change IsClosed ((lpMeasToLpTrimLie F ℝ p μ hm).symm ⁻¹' {g : lpMeas F ℝ m p μ | P ↑g})
exact IsClosed.preimage (LinearIsometryEquiv.continuous _) h_closed
/-- To prove something for an `Lp` function a.e. strongly measurable with respect to a
sub-σ-algebra `m` in a normed space, it suffices to show that
* the property holds for (multiples of) characteristic functions which are measurable w.r.t. `m`;
* is closed under addition;
* the set of functions in `Lp` strongly measurable w.r.t. `m` for which the property holds is
closed.
-/
@[elab_as_elim]
theorem Lp.induction_stronglyMeasurable (hm : m ≤ m0) (hp_ne_top : p ≠ ∞) (P : Lp F p μ → Prop)
(h_ind : ∀ (c : F) {s : Set α} (hs : MeasurableSet[m] s) (hμs : μ s < ∞),
P (Lp.simpleFunc.indicatorConst p (hm s hs) hμs.ne c))
(h_add : ∀ ⦃f g⦄, ∀ hf : Memℒp f p μ, ∀ hg : Memℒp g p μ, StronglyMeasurable[m] f →
StronglyMeasurable[m] g → Disjoint (Function.support f) (Function.support g) →
P (hf.toLp f) → P (hg.toLp g) → P (hf.toLp f + hg.toLp g))
(h_closed : IsClosed {f : lpMeas F ℝ m p μ | P f}) :
∀ f : Lp F p μ, AEStronglyMeasurable' m f μ → P f := by
intro f hf
suffices h_add_ae :
∀ ⦃f g⦄, ∀ hf : Memℒp f p μ, ∀ hg : Memℒp g p μ, AEStronglyMeasurable' m f μ →
AEStronglyMeasurable' m g μ → Disjoint (Function.support f) (Function.support g) →
P (hf.toLp f) → P (hg.toLp g) → P (hf.toLp f + hg.toLp g) from
Lp.induction_stronglyMeasurable_aux hm hp_ne_top _ h_ind h_add_ae h_closed f hf
intro f g hf hg hfm hgm h_disj hPf hPg
let s_f : Set α := Function.support (hfm.mk f)
have hs_f : MeasurableSet[m] s_f := hfm.stronglyMeasurable_mk.measurableSet_support
have hs_f_eq : s_f =ᵐ[μ] Function.support f := hfm.ae_eq_mk.symm.support
let s_g : Set α := Function.support (hgm.mk g)
have hs_g : MeasurableSet[m] s_g := hgm.stronglyMeasurable_mk.measurableSet_support
have hs_g_eq : s_g =ᵐ[μ] Function.support g := hgm.ae_eq_mk.symm.support
have h_inter_empty : (s_f ∩ s_g : Set α) =ᵐ[μ] (∅ : Set α) := by
refine (hs_f_eq.inter hs_g_eq).trans ?_
suffices Function.support f ∩ Function.support g = ∅ by rw [this]
exact Set.disjoint_iff_inter_eq_empty.mp h_disj
let f' := (s_f \ s_g).indicator (hfm.mk f)
have hff' : f =ᵐ[μ] f' := by
have : s_f \ s_g =ᵐ[μ] s_f := by
rw [← Set.diff_inter_self_eq_diff, Set.inter_comm]
refine ((ae_eq_refl s_f).diff h_inter_empty).trans ?_
rw [Set.diff_empty]
refine ((indicator_ae_eq_of_ae_eq_set this).trans ?_).symm
rw [Set.indicator_support]
exact hfm.ae_eq_mk.symm
have hf'_meas : StronglyMeasurable[m] f' := hfm.stronglyMeasurable_mk.indicator (hs_f.diff hs_g)
have hf'_Lp : Memℒp f' p μ := hf.ae_eq hff'
let g' := (s_g \ s_f).indicator (hgm.mk g)
have hgg' : g =ᵐ[μ] g' := by
have : s_g \ s_f =ᵐ[μ] s_g := by
rw [← Set.diff_inter_self_eq_diff]
refine ((ae_eq_refl s_g).diff h_inter_empty).trans ?_
rw [Set.diff_empty]
refine ((indicator_ae_eq_of_ae_eq_set this).trans ?_).symm
rw [Set.indicator_support]
exact hgm.ae_eq_mk.symm
have hg'_meas : StronglyMeasurable[m] g' := hgm.stronglyMeasurable_mk.indicator (hs_g.diff hs_f)
have hg'_Lp : Memℒp g' p μ := hg.ae_eq hgg'
have h_disj : Disjoint (Function.support f') (Function.support g') :=
haveI : Disjoint (s_f \ s_g) (s_g \ s_f) := disjoint_sdiff_sdiff
this.mono Set.support_indicator_subset Set.support_indicator_subset
rw [← Memℒp.toLp_congr hf'_Lp hf hff'.symm] at hPf ⊢
rw [← Memℒp.toLp_congr hg'_Lp hg hgg'.symm] at hPg ⊢
exact h_add hf'_Lp hg'_Lp hf'_meas hg'_meas h_disj hPf hPg
/-- To prove something for an arbitrary `Memℒp` function a.e. strongly measurable with respect
to a sub-σ-algebra `m` in a normed space, it suffices to show that
* the property holds for (multiples of) characteristic functions which are measurable w.r.t. `m`;
* is closed under addition;
* the set of functions in the `Lᵖ` space strongly measurable w.r.t. `m` for which the property
holds is closed.
* the property is closed under the almost-everywhere equal relation.
-/
@[elab_as_elim]
theorem Memℒp.induction_stronglyMeasurable (hm : m ≤ m0) (hp_ne_top : p ≠ ∞) (P : (α → F) → Prop)
(h_ind : ∀ (c : F) ⦃s⦄, MeasurableSet[m] s → μ s < ∞ → P (s.indicator fun _ => c))
(h_add : ∀ ⦃f g : α → F⦄, Disjoint (Function.support f) (Function.support g) →
Memℒp f p μ → Memℒp g p μ → StronglyMeasurable[m] f → StronglyMeasurable[m] g →
P f → P g → P (f + g))
(h_closed : IsClosed {f : lpMeas F ℝ m p μ | P f})
(h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Memℒp f p μ → P f → P g) :
∀ ⦃f : α → F⦄, Memℒp f p μ → AEStronglyMeasurable' m f μ → P f := by
intro f hf hfm
let f_Lp := hf.toLp f
have hfm_Lp : AEStronglyMeasurable' m f_Lp μ := hfm.congr hf.coeFn_toLp.symm
refine h_ae hf.coeFn_toLp (Lp.memℒp _) ?_
change P f_Lp
refine Lp.induction_stronglyMeasurable hm hp_ne_top (fun f => P f) ?_ ?_ h_closed f_Lp hfm_Lp
· intro c s hs hμs
rw [Lp.simpleFunc.coe_indicatorConst]
refine h_ae indicatorConstLp_coeFn.symm ?_ (h_ind c hs hμs)
exact memℒp_indicator_const p (hm s hs) c (Or.inr hμs.ne)
· intro f g hf_mem hg_mem hfm hgm h_disj hfP hgP
have hfP' : P f := h_ae hf_mem.coeFn_toLp (Lp.memℒp _) hfP
have hgP' : P g := h_ae hg_mem.coeFn_toLp (Lp.memℒp _) hgP
specialize h_add h_disj hf_mem hg_mem hfm hgm hfP' hgP'
refine h_ae ?_ (hf_mem.add hg_mem) h_add
exact (hf_mem.coeFn_toLp.symm.add hg_mem.coeFn_toLp.symm).trans (Lp.coeFn_add _ _).symm
end Induction
end MeasureTheory
|
MeasureTheory\Function\ConditionalExpectation\Basic.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1
/-! # Conditional expectation
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 `m0`) and a measurable space
structure `m` with `hm : m ≤ m0` (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 ∂μ`
for all `m`-measurable sets `s`. It is unique as an element of `L¹`.
The construction is done in four steps:
* Define the conditional expectation of an `L²` function, as an element of `L²`. This is the
orthogonal projection on the subspace of almost everywhere `m`-measurable functions.
* Show that the conditional expectation of the indicator of a measurable set with finite measure
is integrable and define a map `Set α → (E →L[ℝ] (α →₁[μ] E))` which to a set associates a linear
map. That linear map sends `x ∈ E` to the conditional expectation of the indicator of the set
with value `x`.
* Extend that map to `condexpL1CLM : (α →₁[μ] E) →L[ℝ] (α →₁[μ] E)`. This is done using the same
construction as the Bochner integral (see the file `MeasureTheory/Integral/SetToL1`).
* Define the conditional expectation of a function `f : α → E`, which is an integrable function
`α → E` equal to 0 if `f` is not integrable, and equal to an `m`-measurable representative of
`condexpL1CLM` applied to `[f]`, the equivalence class of `f` in `L¹`.
The first step is done in `MeasureTheory.Function.ConditionalExpectation.CondexpL2`, the two
next steps in `MeasureTheory.Function.ConditionalExpectation.CondexpL1` and the final step is
performed in this file.
## Main results
The conditional expectation and its properties
* `condexp (m : MeasurableSpace α) (μ : Measure α) (f : α → E)`: conditional expectation of `f`
with respect to `m`.
* `integrable_condexp` : `condexp` is integrable.
* `stronglyMeasurable_condexp` : `condexp` is `m`-strongly-measurable.
* `setIntegral_condexp (hf : Integrable f μ) (hs : MeasurableSet[m] s)` : if `m ≤ m0` (the
σ-algebra over which the measure is defined), then the conditional expectation verifies
`∫ x in s, condexp m μ f x ∂μ = ∫ x in s, f x ∂μ` for any `m`-measurable set `s`.
While `condexp` is function-valued, we also define `condexpL1` with value in `L1` and a continuous
linear map `condexpL1CLM` from `L1` to `L1`. `condexp` should be used in most cases.
Uniqueness of the conditional expectation
* `ae_eq_condexp_of_forall_setIntegral_eq`: an a.e. `m`-measurable function which verifies the
equality of integrals is a.e. equal to `condexp`.
## Notations
For a measure `μ` defined on a measurable space structure `m0`, another measurable space structure
`m` with `hm : m ≤ m0` (a sub-σ-algebra) and a function `f`, we define the notation
* `μ[f|m] = condexp m μ f`.
## Tags
conditional expectation, conditional expected value
-/
open TopologicalSpace MeasureTheory.Lp Filter
open scoped ENNReal Topology MeasureTheory
namespace MeasureTheory
variable {α F F' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜]
-- 𝕜 for ℝ or ℂ
-- F for a Lp submodule
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
-- F' for integrals on a Lp submodule
[NormedAddCommGroup F']
[NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F']
open scoped Classical
variable {m m0 : MeasurableSpace α} {μ : Measure α} {f g : α → F'} {s : Set α}
/-- Conditional expectation of a function. It is defined as 0 if any one of the following conditions
is true:
- `m` is not a sub-σ-algebra of `m0`,
- `μ` is not σ-finite with respect to `m`,
- `f` is not integrable. -/
noncomputable irreducible_def condexp (m : MeasurableSpace α) {m0 : MeasurableSpace α}
(μ : Measure α) (f : α → F') : α → F' :=
if hm : m ≤ m0 then
if h : SigmaFinite (μ.trim hm) ∧ Integrable f μ then
if StronglyMeasurable[m] f then f
else (@aestronglyMeasurable'_condexpL1 _ _ _ _ _ m m0 μ hm h.1 _).mk
(@condexpL1 _ _ _ _ _ _ _ hm μ h.1 f)
else 0
else 0
-- We define notation `μ[f|m]` for the conditional expectation of `f` with respect to `m`.
scoped notation μ "[" f "|" m "]" => MeasureTheory.condexp m μ f
theorem condexp_of_not_le (hm_not : ¬m ≤ m0) : μ[f|m] = 0 := by rw [condexp, dif_neg hm_not]
theorem condexp_of_not_sigmaFinite (hm : m ≤ m0) (hμm_not : ¬SigmaFinite (μ.trim hm)) :
μ[f|m] = 0 := by rw [condexp, dif_pos hm, dif_neg]; push_neg; exact fun h => absurd h hμm_not
theorem condexp_of_sigmaFinite (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] :
μ[f|m] =
if Integrable f μ then
if StronglyMeasurable[m] f then f
else aestronglyMeasurable'_condexpL1.mk (condexpL1 hm μ f)
else 0 := by
rw [condexp, dif_pos hm]
simp only [hμm, Ne, true_and_iff]
by_cases hf : Integrable f μ
· rw [dif_pos hf, if_pos hf]
· rw [dif_neg hf, if_neg hf]
theorem condexp_of_stronglyMeasurable (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] {f : α → F'}
(hf : StronglyMeasurable[m] f) (hfi : Integrable f μ) : μ[f|m] = f := by
rw [condexp_of_sigmaFinite hm, if_pos hfi, if_pos hf]
theorem condexp_const (hm : m ≤ m0) (c : F') [IsFiniteMeasure μ] :
μ[fun _ : α => c|m] = fun _ => c :=
condexp_of_stronglyMeasurable hm (@stronglyMeasurable_const _ _ m _ _) (integrable_const c)
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
rw [condexp_of_sigmaFinite hm]
by_cases hfi : Integrable f μ
· rw [if_pos hfi]
by_cases hfm : StronglyMeasurable[m] f
· rw [if_pos hfm]
exact (condexpL1_of_aestronglyMeasurable' (StronglyMeasurable.aeStronglyMeasurable' hfm)
hfi).symm
· rw [if_neg hfm]
exact (AEStronglyMeasurable'.ae_eq_mk aestronglyMeasurable'_condexpL1).symm
rw [if_neg hfi, condexpL1_undef hfi]
exact (coeFn_zero _ _ _).symm
theorem condexp_ae_eq_condexpL1CLM (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ) :
μ[f|m] =ᵐ[μ] condexpL1CLM F' hm μ (hf.toL1 f) := by
refine (condexp_ae_eq_condexpL1 hm f).trans (eventually_of_forall fun x => ?_)
rw [condexpL1_eq hf]
theorem condexp_undef (hf : ¬Integrable f μ) : μ[f|m] = 0 := by
by_cases hm : m ≤ m0
swap; · rw [condexp_of_not_le hm]
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · rw [condexp_of_not_sigmaFinite hm hμm]
haveI : SigmaFinite (μ.trim hm) := hμm
rw [condexp_of_sigmaFinite, if_neg hf]
@[simp]
theorem condexp_zero : μ[(0 : α → F')|m] = 0 := by
by_cases hm : m ≤ m0
swap; · rw [condexp_of_not_le hm]
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · rw [condexp_of_not_sigmaFinite hm hμm]
haveI : SigmaFinite (μ.trim hm) := hμm
exact
condexp_of_stronglyMeasurable hm (@stronglyMeasurable_zero _ _ m _ _) (integrable_zero _ _ _)
theorem stronglyMeasurable_condexp : StronglyMeasurable[m] (μ[f|m]) := by
by_cases hm : m ≤ m0
swap; · rw [condexp_of_not_le hm]; exact stronglyMeasurable_zero
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · rw [condexp_of_not_sigmaFinite hm hμm]; exact stronglyMeasurable_zero
haveI : SigmaFinite (μ.trim hm) := hμm
rw [condexp_of_sigmaFinite hm]
split_ifs with hfi hfm
· exact hfm
· exact AEStronglyMeasurable'.stronglyMeasurable_mk _
· exact stronglyMeasurable_zero
theorem condexp_congr_ae (h : f =ᵐ[μ] g) : μ[f|m] =ᵐ[μ] μ[g|m] := by
by_cases hm : m ≤ m0
swap; · simp_rw [condexp_of_not_le hm]; rfl
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
haveI : SigmaFinite (μ.trim hm) := hμm
exact (condexp_ae_eq_condexpL1 hm f).trans
(Filter.EventuallyEq.trans (by rw [condexpL1_congr_ae hm h])
(condexp_ae_eq_condexpL1 hm g).symm)
theorem condexp_of_aestronglyMeasurable' (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] {f : α → F'}
(hf : AEStronglyMeasurable' m f μ) (hfi : Integrable f μ) : μ[f|m] =ᵐ[μ] f := by
refine ((condexp_congr_ae hf.ae_eq_mk).trans ?_).trans hf.ae_eq_mk.symm
rw [condexp_of_stronglyMeasurable hm hf.stronglyMeasurable_mk
((integrable_congr hf.ae_eq_mk).mp hfi)]
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
by_cases hm : m ≤ m0
swap; · rw [condexp_of_not_le hm]; exact integrable_zero _ _ _
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · rw [condexp_of_not_sigmaFinite hm hμm]; exact integrable_zero _ _ _
haveI : SigmaFinite (μ.trim hm) := hμm
exact (integrable_condexpL1 f).congr (condexp_ae_eq_condexpL1 hm f).symm
/-- The integral of the conditional expectation `μ[f|hm]` over an `m`-measurable set is equal to
the integral of `f` on that set. -/
theorem setIntegral_condexp (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ)
(hs : MeasurableSet[m] s) : ∫ x in s, (μ[f|m]) x ∂μ = ∫ x in s, f x ∂μ := by
rw [setIntegral_congr_ae (hm s hs) ((condexp_ae_eq_condexpL1 hm f).mono fun x hx _ => hx)]
exact setIntegral_condexpL1 hf hs
@[deprecated (since := "2024-04-17")] alias set_integral_condexp := setIntegral_condexp
theorem integral_condexp (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] :
∫ x, (μ[f|m]) x ∂μ = ∫ x, f x ∂μ := by
by_cases hf : Integrable f μ
· suffices ∫ x in Set.univ, (μ[f|m]) x ∂μ = ∫ x in Set.univ, f x ∂μ by
simp_rw [integral_univ] at this; exact this
exact setIntegral_condexp hm hf (@MeasurableSet.univ _ m)
simp only [condexp_undef hf, Pi.zero_apply, integral_zero, integral_undef hf]
/-- Total probability law using `condexp` as conditional probability. -/
theorem integral_condexp_indicator [mF : MeasurableSpace F] {Y : α → F} (hY : Measurable Y)
[SigmaFinite (μ.trim hY.comap_le)] {A : Set α} (hA : MeasurableSet A) :
∫ x, (μ[(A.indicator fun _ ↦ (1 : ℝ)) | mF.comap Y]) x ∂μ = (μ A).toReal := by
rw [integral_condexp, integral_indicator hA, setIntegral_const, smul_eq_mul, mul_one]
/-- **Uniqueness of the conditional expectation**
If a function is a.e. `m`-measurable, verifies an integrability condition and has same integral
as `f` on all `m`-measurable sets, then it is a.e. equal to `μ[f|hm]`. -/
theorem ae_eq_condexp_of_forall_setIntegral_eq (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
{f g : α → F'} (hf : Integrable f μ)
(hg_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn g s μ)
(hg_eq : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, g x ∂μ = ∫ x in s, f x ∂μ)
(hgm : AEStronglyMeasurable' m g μ) : g =ᵐ[μ] μ[f|m] := by
refine ae_eq_of_forall_setIntegral_eq_of_sigmaFinite' hm hg_int_finite
(fun s _ _ => integrable_condexp.integrableOn) (fun s hs hμs => ?_) hgm
(StronglyMeasurable.aeStronglyMeasurable' stronglyMeasurable_condexp)
rw [hg_eq s hs hμs, setIntegral_condexp hm hf hs]
@[deprecated (since := "2024-04-17")]
alias ae_eq_condexp_of_forall_set_integral_eq := ae_eq_condexp_of_forall_setIntegral_eq
theorem condexp_bot' [hμ : NeZero μ] (f : α → F') :
μ[f|⊥] = fun _ => (μ Set.univ).toReal⁻¹ • ∫ x, f x ∂μ := by
by_cases hμ_finite : IsFiniteMeasure μ
swap
· have h : ¬SigmaFinite (μ.trim bot_le) := by rwa [sigmaFinite_trim_bot_iff]
rw [not_isFiniteMeasure_iff] at hμ_finite
rw [condexp_of_not_sigmaFinite bot_le h]
simp only [hμ_finite, ENNReal.top_toReal, inv_zero, zero_smul]
rfl
have h_meas : StronglyMeasurable[⊥] (μ[f|⊥]) := stronglyMeasurable_condexp
obtain ⟨c, h_eq⟩ := stronglyMeasurable_bot_iff.mp h_meas
rw [h_eq]
have h_integral : ∫ x, (μ[f|⊥]) x ∂μ = ∫ x, f x ∂μ := integral_condexp bot_le
simp_rw [h_eq, integral_const] at h_integral
rw [← h_integral, ← smul_assoc, smul_eq_mul, inv_mul_cancel, one_smul]
rw [Ne, ENNReal.toReal_eq_zero_iff, not_or]
exact ⟨NeZero.ne _, measure_ne_top μ Set.univ⟩
theorem condexp_bot_ae_eq (f : α → F') :
μ[f|⊥] =ᵐ[μ] fun _ => (μ Set.univ).toReal⁻¹ • ∫ x, f x ∂μ := by
rcases eq_zero_or_neZero μ with rfl | hμ
· rw [ae_zero]; exact eventually_bot
· exact eventually_of_forall <| congr_fun (condexp_bot' f)
theorem condexp_bot [IsProbabilityMeasure μ] (f : α → F') : μ[f|⊥] = fun _ => ∫ x, f x ∂μ := by
refine (condexp_bot' f).trans ?_; rw [measure_univ, ENNReal.one_toReal, inv_one, one_smul]
theorem condexp_add (hf : Integrable f μ) (hg : Integrable g μ) :
μ[f + g|m] =ᵐ[μ] μ[f|m] + μ[g|m] := by
by_cases hm : m ≤ m0
swap; · simp_rw [condexp_of_not_le hm]; simp
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; simp
haveI : SigmaFinite (μ.trim hm) := hμm
refine (condexp_ae_eq_condexpL1 hm _).trans ?_
rw [condexpL1_add hf hg]
exact (coeFn_add _ _).trans
((condexp_ae_eq_condexpL1 hm _).symm.add (condexp_ae_eq_condexpL1 hm _).symm)
theorem condexp_finset_sum {ι : Type*} {s : Finset ι} {f : ι → α → F'}
(hf : ∀ i ∈ s, Integrable (f i) μ) : μ[∑ i ∈ s, f i|m] =ᵐ[μ] ∑ i ∈ s, μ[f i|m] := by
induction' s using Finset.induction_on with i s his heq hf
· rw [Finset.sum_empty, Finset.sum_empty, condexp_zero]
· rw [Finset.sum_insert his, Finset.sum_insert his]
exact (condexp_add (hf i <| Finset.mem_insert_self i s) <|
integrable_finset_sum' _ fun j hmem => hf j <| Finset.mem_insert_of_mem hmem).trans
((EventuallyEq.refl _ _).add (heq fun j hmem => hf j <| Finset.mem_insert_of_mem hmem))
theorem condexp_smul (c : 𝕜) (f : α → F') : μ[c • f|m] =ᵐ[μ] c • μ[f|m] := by
by_cases hm : m ≤ m0
swap; · simp_rw [condexp_of_not_le hm]; simp
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; simp
haveI : SigmaFinite (μ.trim hm) := hμm
refine (condexp_ae_eq_condexpL1 hm _).trans ?_
rw [condexpL1_smul c f]
refine (@condexp_ae_eq_condexpL1 _ _ _ _ _ m _ _ hm _ f).mp ?_
refine (coeFn_smul c (condexpL1 hm μ f)).mono fun x hx1 hx2 => ?_
simp only [hx1, hx2, Pi.smul_apply]
theorem condexp_neg (f : α → F') : μ[-f|m] =ᵐ[μ] -μ[f|m] := by
letI : Module ℝ (α → F') := @Pi.module α (fun _ => F') ℝ _ _ fun _ => inferInstance
calc
μ[-f|m] = μ[(-1 : ℝ) • f|m] := by rw [neg_one_smul ℝ f]
_ =ᵐ[μ] (-1 : ℝ) • μ[f|m] := condexp_smul (-1) f
_ = -μ[f|m] := neg_one_smul ℝ (μ[f|m])
theorem condexp_sub (hf : Integrable f μ) (hg : Integrable g μ) :
μ[f - g|m] =ᵐ[μ] μ[f|m] - μ[g|m] := by
simp_rw [sub_eq_add_neg]
exact (condexp_add hf hg.neg).trans (EventuallyEq.rfl.add (condexp_neg g))
theorem condexp_condexp_of_le {m₁ m₂ m0 : MeasurableSpace α} {μ : Measure α} (hm₁₂ : m₁ ≤ m₂)
(hm₂ : m₂ ≤ m0) [SigmaFinite (μ.trim hm₂)] : μ[μ[f|m₂]|m₁] =ᵐ[μ] μ[f|m₁] := by
by_cases hμm₁ : SigmaFinite (μ.trim (hm₁₂.trans hm₂))
swap; · simp_rw [condexp_of_not_sigmaFinite (hm₁₂.trans hm₂) hμm₁]; rfl
haveI : SigmaFinite (μ.trim (hm₁₂.trans hm₂)) := hμm₁
by_cases hf : Integrable f μ
swap; · simp_rw [condexp_undef hf, condexp_zero]; rfl
refine ae_eq_of_forall_setIntegral_eq_of_sigmaFinite' (hm₁₂.trans hm₂)
(fun s _ _ => integrable_condexp.integrableOn)
(fun s _ _ => integrable_condexp.integrableOn) ?_
(StronglyMeasurable.aeStronglyMeasurable' stronglyMeasurable_condexp)
(StronglyMeasurable.aeStronglyMeasurable' stronglyMeasurable_condexp)
intro s hs _
rw [setIntegral_condexp (hm₁₂.trans hm₂) integrable_condexp hs]
rw [setIntegral_condexp (hm₁₂.trans hm₂) hf hs, setIntegral_condexp hm₂ hf (hm₁₂ s hs)]
theorem condexp_mono {E} [NormedLatticeAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E]
[OrderedSMul ℝ E] {f g : α → E} (hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) :
μ[f|m] ≤ᵐ[μ] μ[g|m] := by
by_cases hm : m ≤ m0
swap; · simp_rw [condexp_of_not_le hm]; rfl
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
haveI : SigmaFinite (μ.trim hm) := hμm
exact (condexp_ae_eq_condexpL1 hm _).trans_le
((condexpL1_mono hf hg hfg).trans_eq (condexp_ae_eq_condexpL1 hm _).symm)
theorem condexp_nonneg {E} [NormedLatticeAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E]
[OrderedSMul ℝ E] {f : α → E} (hf : 0 ≤ᵐ[μ] f) : 0 ≤ᵐ[μ] μ[f|m] := by
by_cases hfint : Integrable f μ
· rw [(condexp_zero.symm : (0 : α → E) = μ[0|m])]
exact condexp_mono (integrable_zero _ _ _) hfint hf
· rw [condexp_undef hfint]
theorem condexp_nonpos {E} [NormedLatticeAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E]
[OrderedSMul ℝ E] {f : α → E} (hf : f ≤ᵐ[μ] 0) : μ[f|m] ≤ᵐ[μ] 0 := by
by_cases hfint : Integrable f μ
· rw [(condexp_zero.symm : (0 : α → E) = μ[0|m])]
exact condexp_mono hfint (integrable_zero _ _ _) hf
· rw [condexp_undef hfint]
/-- **Lebesgue dominated convergence theorem**: sufficient conditions under which almost
everywhere convergence of a sequence of functions implies the convergence of their image by
`condexpL1`. -/
theorem tendsto_condexpL1_of_dominated_convergence (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
{fs : ℕ → α → F'} {f : α → F'} (bound_fs : α → ℝ)
(hfs_meas : ∀ n, AEStronglyMeasurable (fs n) μ) (h_int_bound_fs : Integrable bound_fs μ)
(hfs_bound : ∀ n, ∀ᵐ x ∂μ, ‖fs n x‖ ≤ bound_fs x)
(hfs : ∀ᵐ x ∂μ, Tendsto (fun n => fs n x) atTop (𝓝 (f x))) :
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
/-- 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. -/
theorem tendsto_condexp_unique (fs gs : ℕ → α → F') (f g : α → F')
(hfs_int : ∀ n, Integrable (fs n) μ) (hgs_int : ∀ n, Integrable (gs n) μ)
(hfs : ∀ᵐ x ∂μ, Tendsto (fun n => fs n x) atTop (𝓝 (f x)))
(hgs : ∀ᵐ x ∂μ, Tendsto (fun n => gs n x) atTop (𝓝 (g x))) (bound_fs : α → ℝ)
(h_int_bound_fs : Integrable bound_fs μ) (bound_gs : α → ℝ)
(h_int_bound_gs : Integrable bound_gs μ) (hfs_bound : ∀ n, ∀ᵐ x ∂μ, ‖fs n x‖ ≤ bound_fs x)
(hgs_bound : ∀ n, ∀ᵐ x ∂μ, ‖gs n x‖ ≤ bound_gs x) (hfg : ∀ n, μ[fs n|m] =ᵐ[μ] μ[gs n|m]) :
μ[f|m] =ᵐ[μ] μ[g|m] := by
by_cases hm : m ≤ m0; swap; · simp_rw [condexp_of_not_le hm]; rfl
by_cases hμm : SigmaFinite (μ.trim hm); swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
haveI : SigmaFinite (μ.trim hm) := hμm
refine (condexp_ae_eq_condexpL1 hm f).trans ((condexp_ae_eq_condexpL1 hm g).trans ?_).symm
rw [← Lp.ext_iff]
have hn_eq : ∀ n, condexpL1 hm μ (gs n) = condexpL1 hm μ (fs n) := by
intro n
ext1
refine (condexp_ae_eq_condexpL1 hm (gs n)).symm.trans ((hfg n).symm.trans ?_)
exact condexp_ae_eq_condexpL1 hm (fs n)
have hcond_fs : Tendsto (fun n => condexpL1 hm μ (fs n)) atTop (𝓝 (condexpL1 hm μ f)) :=
tendsto_condexpL1_of_dominated_convergence hm _ (fun n => (hfs_int n).1) h_int_bound_fs
hfs_bound hfs
have hcond_gs : Tendsto (fun n => condexpL1 hm μ (gs n)) atTop (𝓝 (condexpL1 hm μ g)) :=
tendsto_condexpL1_of_dominated_convergence hm _ (fun n => (hgs_int n).1) h_int_bound_gs
hgs_bound hgs
exact tendsto_nhds_unique_of_eventuallyEq hcond_gs hcond_fs (eventually_of_forall hn_eq)
end MeasureTheory
|
MeasureTheory\Function\ConditionalExpectation\CondexpL1.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2
/-! # Conditional expectation in L1
This file contains two more steps of the construction of the conditional expectation, which is
completed in `MeasureTheory.Function.ConditionalExpectation.Basic`. See that file for a
description of the full process.
The contitional expectation of an `L²` function is defined in
`MeasureTheory.Function.ConditionalExpectation.CondexpL2`. In this file, we perform two steps.
* Show that the conditional expectation of the indicator of a measurable set with finite measure
is integrable and define a map `Set α → (E →L[ℝ] (α →₁[μ] E))` which to a set associates a linear
map. That linear map sends `x ∈ E` to the conditional expectation of the indicator of the set
with value `x`.
* Extend that map to `condexpL1CLM : (α →₁[μ] E) →L[ℝ] (α →₁[μ] E)`. This is done using the same
construction as the Bochner integral (see the file `MeasureTheory/Integral/SetToL1`).
## Main definitions
* `condexpL1`: Conditional expectation of a function as a linear map from `L1` to itself.
-/
noncomputable section
open TopologicalSpace MeasureTheory.Lp Filter ContinuousLinearMap
open scoped NNReal ENNReal Topology MeasureTheory
namespace MeasureTheory
variable {α β F F' G G' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜]
-- 𝕜 for ℝ or ℂ
-- F for a Lp submodule
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
-- F' for integrals on a Lp submodule
[NormedAddCommGroup F']
[NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F']
-- G for a Lp add_subgroup
[NormedAddCommGroup G]
-- G' for integrals on a Lp add_subgroup
[NormedAddCommGroup G']
[NormedSpace ℝ G'] [CompleteSpace G']
section CondexpInd
/-! ## Conditional expectation of an indicator as a continuous linear map.
The goal of this section is to build
`condexpInd (hm : m ≤ m0) (μ : Measure α) (s : Set s) : G →L[ℝ] α →₁[μ] G`, which
takes `x : G` to the conditional expectation of the indicator of the set `s` with value `x`,
seen as an element of `α →₁[μ] G`.
-/
variable {m m0 : MeasurableSpace α} {μ : Measure α} {s t : Set α} [NormedSpace ℝ G]
section CondexpIndL1Fin
/-- Conditional expectation of the indicator of a measurable set with finite measure,
as a function in L1. -/
def condexpIndL1Fin (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
(x : G) : α →₁[μ] G :=
(integrable_condexpIndSMul hm hs hμs x).toL1 _
theorem condexpIndL1Fin_ae_eq_condexpIndSMul (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
condexpIndL1Fin hm hs hμs x =ᵐ[μ] condexpIndSMul hm hs hμs x :=
(integrable_condexpIndSMul hm hs hμs x).coeFn_toL1
variable {hm : m ≤ m0} [SigmaFinite (μ.trim hm)]
-- Porting note: this lemma fills the hole in `refine' (Memℒp.coeFn_toLp _) ...`
-- which is not automatically filled in Lean 4
private theorem q {hs : MeasurableSet s} {hμs : μ s ≠ ∞} {x : G} :
Memℒp (condexpIndSMul hm hs hμs x) 1 μ := by
rw [memℒp_one_iff_integrable]; apply integrable_condexpIndSMul
theorem condexpIndL1Fin_add (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x y : G) :
condexpIndL1Fin hm hs hμs (x + y) =
condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm hs hμs y := by
ext1
refine (Memℒp.coeFn_toLp q).trans ?_
refine EventuallyEq.trans ?_ (Lp.coeFn_add _ _).symm
refine EventuallyEq.trans ?_
(EventuallyEq.add (Memℒp.coeFn_toLp q).symm (Memℒp.coeFn_toLp q).symm)
rw [condexpIndSMul_add]
refine (Lp.coeFn_add _ _).trans (eventually_of_forall fun a => ?_)
rfl
theorem condexpIndL1Fin_smul (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : ℝ) (x : G) :
condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x := by
ext1
refine (Memℒp.coeFn_toLp q).trans ?_
refine EventuallyEq.trans ?_ (Lp.coeFn_smul _ _).symm
rw [condexpIndSMul_smul hs hμs c x]
refine (Lp.coeFn_smul _ _).trans ?_
refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => ?_
simp only [Pi.smul_apply, hy]
theorem condexpIndL1Fin_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (hs : MeasurableSet s)
(hμs : μ s ≠ ∞) (c : 𝕜) (x : F) :
condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x := by
ext1
refine (Memℒp.coeFn_toLp q).trans ?_
refine EventuallyEq.trans ?_ (Lp.coeFn_smul _ _).symm
rw [condexpIndSMul_smul' hs hμs c x]
refine (Lp.coeFn_smul _ _).trans ?_
refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => ?_
simp only [Pi.smul_apply, hy]
theorem norm_condexpIndL1Fin_le (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
‖condexpIndL1Fin hm hs hμs x‖ ≤ (μ s).toReal * ‖x‖ := by
have : 0 ≤ ∫ a : α, ‖condexpIndL1Fin hm hs hμs x a‖ ∂μ := by positivity
rw [L1.norm_eq_integral_norm, ← ENNReal.toReal_ofReal (norm_nonneg x), ← ENNReal.toReal_mul, ←
ENNReal.toReal_ofReal this,
ENNReal.toReal_le_toReal ENNReal.ofReal_ne_top (ENNReal.mul_ne_top hμs ENNReal.ofReal_ne_top),
ofReal_integral_norm_eq_lintegral_nnnorm]
swap; · rw [← memℒp_one_iff_integrable]; exact Lp.memℒp _
have h_eq :
∫⁻ a, ‖condexpIndL1Fin hm hs hμs x a‖₊ ∂μ = ∫⁻ a, ‖condexpIndSMul hm hs hμs x a‖₊ ∂μ := by
refine lintegral_congr_ae ?_
refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun z hz => ?_
dsimp only
rw [hz]
rw [h_eq, ofReal_norm_eq_coe_nnnorm]
exact lintegral_nnnorm_condexpIndSMul_le hm hs hμs x
theorem condexpIndL1Fin_disjoint_union (hs : MeasurableSet s) (ht : MeasurableSet t) (hμs : μ s ≠ ∞)
(hμt : μ t ≠ ∞) (hst : s ∩ t = ∅) (x : G) :
condexpIndL1Fin hm (hs.union ht) ((measure_union_le s t).trans_lt
(lt_top_iff_ne_top.mpr (ENNReal.add_ne_top.mpr ⟨hμs, hμt⟩))).ne x =
condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm ht hμt x := by
ext1
have hμst :=
((measure_union_le s t).trans_lt (lt_top_iff_ne_top.mpr (ENNReal.add_ne_top.mpr ⟨hμs, hμt⟩))).ne
refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm (hs.union ht) hμst x).trans ?_
refine EventuallyEq.trans ?_ (Lp.coeFn_add _ _).symm
have hs_eq := condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x
have ht_eq := condexpIndL1Fin_ae_eq_condexpIndSMul hm ht hμt x
refine EventuallyEq.trans ?_ (EventuallyEq.add hs_eq.symm ht_eq.symm)
rw [condexpIndSMul]
rw [indicatorConstLp_disjoint_union hs ht hμs hμt hst (1 : ℝ)]
rw [(condexpL2 ℝ ℝ hm).map_add]
push_cast
rw [((toSpanSingleton ℝ x).compLpL 2 μ).map_add]
refine (Lp.coeFn_add _ _).trans ?_
filter_upwards with y using rfl
end CondexpIndL1Fin
open scoped Classical
section CondexpIndL1
/-- Conditional expectation of the indicator of a set, as a function in L1. Its value for sets
which are not both measurable and of finite measure is not used: we set it to 0. -/
def condexpIndL1 {m m0 : MeasurableSpace α} (hm : m ≤ m0) (μ : Measure α) (s : Set α)
[SigmaFinite (μ.trim hm)] (x : G) : α →₁[μ] G :=
if hs : MeasurableSet s ∧ μ s ≠ ∞ then condexpIndL1Fin hm hs.1 hs.2 x else 0
variable {hm : m ≤ m0} [SigmaFinite (μ.trim hm)]
theorem condexpIndL1_of_measurableSet_of_measure_ne_top (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
(x : G) : condexpIndL1 hm μ s x = condexpIndL1Fin hm hs hμs x := by
simp only [condexpIndL1, And.intro hs hμs, dif_pos, Ne, not_false_iff, and_self_iff]
theorem condexpIndL1_of_measure_eq_top (hμs : μ s = ∞) (x : G) : condexpIndL1 hm μ s x = 0 := by
simp only [condexpIndL1, hμs, eq_self_iff_true, not_true, Ne, dif_neg, not_false_iff,
and_false_iff]
theorem condexpIndL1_of_not_measurableSet (hs : ¬MeasurableSet s) (x : G) :
condexpIndL1 hm μ s x = 0 := by
simp only [condexpIndL1, hs, dif_neg, not_false_iff, false_and_iff]
theorem condexpIndL1_add (x y : G) :
condexpIndL1 hm μ s (x + y) = condexpIndL1 hm μ s x + condexpIndL1 hm μ s y := by
by_cases hs : MeasurableSet s
swap; · simp_rw [condexpIndL1_of_not_measurableSet hs]; rw [zero_add]
by_cases hμs : μ s = ∞
· simp_rw [condexpIndL1_of_measure_eq_top hμs]; rw [zero_add]
· simp_rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs]
exact condexpIndL1Fin_add hs hμs x y
theorem condexpIndL1_smul (c : ℝ) (x : G) :
condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x := by
by_cases hs : MeasurableSet s
swap; · simp_rw [condexpIndL1_of_not_measurableSet hs]; rw [smul_zero]
by_cases hμs : μ s = ∞
· simp_rw [condexpIndL1_of_measure_eq_top hμs]; rw [smul_zero]
· simp_rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs]
exact condexpIndL1Fin_smul hs hμs c x
theorem condexpIndL1_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (c : 𝕜) (x : F) :
condexpIndL1 hm μ s (c • x) = c • condexpIndL1 hm μ s x := by
by_cases hs : MeasurableSet s
swap; · simp_rw [condexpIndL1_of_not_measurableSet hs]; rw [smul_zero]
by_cases hμs : μ s = ∞
· simp_rw [condexpIndL1_of_measure_eq_top hμs]; rw [smul_zero]
· simp_rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs]
exact condexpIndL1Fin_smul' hs hμs c x
theorem norm_condexpIndL1_le (x : G) : ‖condexpIndL1 hm μ s x‖ ≤ (μ s).toReal * ‖x‖ := by
by_cases hs : MeasurableSet s
swap
· simp_rw [condexpIndL1_of_not_measurableSet hs]; rw [Lp.norm_zero]
exact mul_nonneg ENNReal.toReal_nonneg (norm_nonneg _)
by_cases hμs : μ s = ∞
· rw [condexpIndL1_of_measure_eq_top hμs x, Lp.norm_zero]
exact mul_nonneg ENNReal.toReal_nonneg (norm_nonneg _)
· rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs x]
exact norm_condexpIndL1Fin_le hs hμs x
theorem continuous_condexpIndL1 : Continuous fun x : G => condexpIndL1 hm μ s x :=
continuous_of_linear_of_bound condexpIndL1_add condexpIndL1_smul norm_condexpIndL1_le
theorem condexpIndL1_disjoint_union (hs : MeasurableSet s) (ht : MeasurableSet t) (hμs : μ s ≠ ∞)
(hμt : μ t ≠ ∞) (hst : s ∩ t = ∅) (x : G) :
condexpIndL1 hm μ (s ∪ t) x = condexpIndL1 hm μ s x + condexpIndL1 hm μ t x := by
have hμst : μ (s ∪ t) ≠ ∞ :=
((measure_union_le s t).trans_lt (lt_top_iff_ne_top.mpr (ENNReal.add_ne_top.mpr ⟨hμs, hμt⟩))).ne
rw [condexpIndL1_of_measurableSet_of_measure_ne_top hs hμs x,
condexpIndL1_of_measurableSet_of_measure_ne_top ht hμt x,
condexpIndL1_of_measurableSet_of_measure_ne_top (hs.union ht) hμst x]
exact condexpIndL1Fin_disjoint_union hs ht hμs hμt hst x
end CondexpIndL1
-- Porting note: `G` is not automatically inferred in `condexpInd` in Lean 4;
-- to avoid repeatedly typing `(G := ...)` it is made explicit.
variable (G)
/-- Conditional expectation of the indicator of a set, as a linear map from `G` to L1. -/
def condexpInd {m m0 : MeasurableSpace α} (hm : m ≤ m0) (μ : Measure α) [SigmaFinite (μ.trim hm)]
(s : Set α) : G →L[ℝ] α →₁[μ] G where
toFun := condexpIndL1 hm μ s
map_add' := condexpIndL1_add
map_smul' := condexpIndL1_smul
cont := continuous_condexpIndL1
variable {G}
theorem condexpInd_ae_eq_condexpIndSMul (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
condexpInd G hm μ s x =ᵐ[μ] condexpIndSMul hm hs hμs x := by
refine EventuallyEq.trans ?_ (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x)
simp [condexpInd, condexpIndL1, hs, hμs]
variable {hm : m ≤ m0} [SigmaFinite (μ.trim hm)]
theorem aestronglyMeasurable'_condexpInd (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
AEStronglyMeasurable' m (condexpInd G hm μ s x) μ :=
AEStronglyMeasurable'.congr (aeStronglyMeasurable'_condexpIndSMul hm hs hμs x)
(condexpInd_ae_eq_condexpIndSMul hm hs hμs x).symm
@[simp]
theorem condexpInd_empty : condexpInd G hm μ ∅ = (0 : G →L[ℝ] α →₁[μ] G) := by
ext1 x
ext1
refine (condexpInd_ae_eq_condexpIndSMul hm MeasurableSet.empty (by simp) x).trans ?_
rw [condexpIndSMul_empty]
refine (Lp.coeFn_zero G 2 μ).trans ?_
refine EventuallyEq.trans ?_ (Lp.coeFn_zero G 1 μ).symm
rfl
theorem condexpInd_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (c : 𝕜) (x : F) :
condexpInd F hm μ s (c • x) = c • condexpInd F hm μ s x :=
condexpIndL1_smul' c x
theorem norm_condexpInd_apply_le (x : G) : ‖condexpInd G hm μ s x‖ ≤ (μ s).toReal * ‖x‖ :=
norm_condexpIndL1_le x
theorem norm_condexpInd_le : ‖(condexpInd G hm μ s : G →L[ℝ] α →₁[μ] G)‖ ≤ (μ s).toReal :=
ContinuousLinearMap.opNorm_le_bound _ ENNReal.toReal_nonneg norm_condexpInd_apply_le
theorem condexpInd_disjoint_union_apply (hs : MeasurableSet s) (ht : MeasurableSet t)
(hμs : μ s ≠ ∞) (hμt : μ t ≠ ∞) (hst : s ∩ t = ∅) (x : G) :
condexpInd G hm μ (s ∪ t) x = condexpInd G hm μ s x + condexpInd G hm μ t x :=
condexpIndL1_disjoint_union hs ht hμs hμt hst x
theorem condexpInd_disjoint_union (hs : MeasurableSet s) (ht : MeasurableSet t) (hμs : μ s ≠ ∞)
(hμt : μ t ≠ ∞) (hst : s ∩ t = ∅) : (condexpInd G hm μ (s ∪ t) : G →L[ℝ] α →₁[μ] G) =
condexpInd G hm μ s + condexpInd G hm μ t := by
ext1 x; push_cast; exact condexpInd_disjoint_union_apply hs ht hμs hμt hst x
variable (G)
theorem dominatedFinMeasAdditive_condexpInd (hm : m ≤ m0) (μ : Measure α)
[SigmaFinite (μ.trim hm)] :
DominatedFinMeasAdditive μ (condexpInd G hm μ : Set α → G →L[ℝ] α →₁[μ] G) 1 :=
⟨fun _ _ => condexpInd_disjoint_union, fun _ _ _ => norm_condexpInd_le.trans (one_mul _).symm.le⟩
variable {G}
theorem setIntegral_condexpInd (hs : MeasurableSet[m] s) (ht : MeasurableSet t) (hμs : μ s ≠ ∞)
(hμt : μ t ≠ ∞) (x : G') : ∫ a in s, condexpInd G' hm μ t x a ∂μ = (μ (t ∩ s)).toReal • x :=
calc
∫ a in s, condexpInd G' hm μ t x a ∂μ = ∫ a in s, condexpIndSMul hm ht hμt x a ∂μ :=
setIntegral_congr_ae (hm s hs)
((condexpInd_ae_eq_condexpIndSMul hm ht hμt x).mono fun _ hx _ => hx)
_ = (μ (t ∩ s)).toReal • x := setIntegral_condexpIndSMul hs ht hμs hμt x
@[deprecated (since := "2024-04-17")]
alias set_integral_condexpInd := setIntegral_condexpInd
theorem condexpInd_of_measurable (hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) (c : G) :
condexpInd G hm μ s c = indicatorConstLp 1 (hm s hs) hμs c := by
ext1
refine EventuallyEq.trans ?_ indicatorConstLp_coeFn.symm
refine (condexpInd_ae_eq_condexpIndSMul hm (hm s hs) hμs c).trans ?_
refine (condexpIndSMul_ae_eq_smul hm (hm s hs) hμs c).trans ?_
rw [lpMeas_coe, condexpL2_indicator_of_measurable hm hs hμs (1 : ℝ)]
refine (@indicatorConstLp_coeFn α _ _ 2 μ _ s (hm s hs) hμs (1 : ℝ)).mono fun x hx => ?_
dsimp only
rw [hx]
by_cases hx_mem : x ∈ s <;> simp [hx_mem]
theorem condexpInd_nonneg {E} [NormedLatticeAddCommGroup E] [NormedSpace ℝ E] [OrderedSMul ℝ E]
(hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : E) (hx : 0 ≤ x) : 0 ≤ condexpInd E hm μ s x := by
rw [← coeFn_le]
refine EventuallyLE.trans_eq ?_ (condexpInd_ae_eq_condexpIndSMul hm hs hμs x).symm
exact (coeFn_zero E 1 μ).trans_le (condexpIndSMul_nonneg hs hμs x hx)
end CondexpInd
section CondexpL1
variable {m m0 : MeasurableSpace α} {μ : Measure α} {hm : m ≤ m0} [SigmaFinite (μ.trim hm)]
{f g : α → F'} {s : Set α}
-- Porting note: `F'` is not automatically inferred in `condexpL1CLM` in Lean 4;
-- to avoid repeatedly typing `(F' := ...)` it is made explicit.
variable (F')
/-- Conditional expectation of a function as a linear map from `α →₁[μ] F'` to itself. -/
def condexpL1CLM (hm : m ≤ m0) (μ : Measure α) [SigmaFinite (μ.trim hm)] :
(α →₁[μ] F') →L[ℝ] α →₁[μ] F' :=
L1.setToL1 (dominatedFinMeasAdditive_condexpInd F' hm μ)
variable {F'}
theorem condexpL1CLM_smul (c : 𝕜) (f : α →₁[μ] F') :
condexpL1CLM F' hm μ (c • f) = c • condexpL1CLM F' hm μ f := by
refine L1.setToL1_smul (dominatedFinMeasAdditive_condexpInd F' hm μ) ?_ c f
exact fun c s x => condexpInd_smul' c x
theorem condexpL1CLM_indicatorConstLp (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : F') :
(condexpL1CLM F' hm μ) (indicatorConstLp 1 hs hμs x) = condexpInd F' hm μ s x :=
L1.setToL1_indicatorConstLp (dominatedFinMeasAdditive_condexpInd F' hm μ) hs hμs x
theorem condexpL1CLM_indicatorConst (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : F') :
(condexpL1CLM F' hm μ) ↑(simpleFunc.indicatorConst 1 hs hμs x) = condexpInd F' hm μ s x := by
rw [Lp.simpleFunc.coe_indicatorConst]; exact condexpL1CLM_indicatorConstLp hs hμs x
/-- Auxiliary lemma used in the proof of `setIntegral_condexpL1CLM`. -/
theorem setIntegral_condexpL1CLM_of_measure_ne_top (f : α →₁[μ] F') (hs : MeasurableSet[m] s)
(hμs : μ s ≠ ∞) : ∫ x in s, condexpL1CLM F' hm μ f x ∂μ = ∫ x in s, f x ∂μ := by
refine @Lp.induction _ _ _ _ _ _ _ ENNReal.one_ne_top
(fun f : α →₁[μ] F' => ∫ x in s, condexpL1CLM F' hm μ f x ∂μ = ∫ x in s, f x ∂μ) ?_ ?_
(isClosed_eq ?_ ?_) f
· intro x t ht hμt
simp_rw [condexpL1CLM_indicatorConst ht hμt.ne x]
rw [Lp.simpleFunc.coe_indicatorConst, setIntegral_indicatorConstLp (hm _ hs)]
exact setIntegral_condexpInd hs ht hμs hμt.ne x
· intro f g hf_Lp hg_Lp _ hf hg
simp_rw [(condexpL1CLM F' hm μ).map_add]
rw [setIntegral_congr_ae (hm s hs) ((Lp.coeFn_add (condexpL1CLM F' hm μ (hf_Lp.toLp f))
(condexpL1CLM F' hm μ (hg_Lp.toLp g))).mono fun x hx _ => hx)]
rw [setIntegral_congr_ae (hm s hs)
((Lp.coeFn_add (hf_Lp.toLp f) (hg_Lp.toLp g)).mono fun x hx _ => hx)]
simp_rw [Pi.add_apply]
rw [integral_add (L1.integrable_coeFn _).integrableOn (L1.integrable_coeFn _).integrableOn,
integral_add (L1.integrable_coeFn _).integrableOn (L1.integrable_coeFn _).integrableOn, hf,
hg]
· exact (continuous_setIntegral s).comp (condexpL1CLM F' hm μ).continuous
· exact continuous_setIntegral s
@[deprecated (since := "2024-04-17")]
alias set_integral_condexpL1CLM_of_measure_ne_top :=
setIntegral_condexpL1CLM_of_measure_ne_top
/-- The integral of the conditional expectation `condexpL1CLM` 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_condexpL1CLM (f : α →₁[μ] F') (hs : MeasurableSet[m] s) :
∫ x in s, condexpL1CLM F' hm μ f x ∂μ = ∫ x in s, f x ∂μ := by
let S := spanningSets (μ.trim hm)
have hS_meas : ∀ i, MeasurableSet[m] (S i) := measurable_spanningSets (μ.trim hm)
have hS_meas0 : ∀ i, MeasurableSet (S i) := fun i => hm _ (hS_meas i)
have hs_eq : s = ⋃ i, S i ∩ s := by
simp_rw [Set.inter_comm]
rw [← Set.inter_iUnion, iUnion_spanningSets (μ.trim hm), Set.inter_univ]
have hS_finite : ∀ i, μ (S i ∩ s) < ∞ := by
refine fun i => (measure_mono Set.inter_subset_left).trans_lt ?_
have hS_finite_trim := measure_spanningSets_lt_top (μ.trim hm) i
rwa [trim_measurableSet_eq hm (hS_meas i)] at hS_finite_trim
have h_mono : Monotone fun i => S i ∩ s := by
intro i j hij x
simp_rw [Set.mem_inter_iff]
exact fun h => ⟨monotone_spanningSets (μ.trim hm) hij h.1, h.2⟩
have h_eq_forall :
(fun i => ∫ x in S i ∩ s, condexpL1CLM F' hm μ f x ∂μ) = fun i => ∫ x in S i ∩ s, f x ∂μ :=
funext fun i =>
setIntegral_condexpL1CLM_of_measure_ne_top f (@MeasurableSet.inter α m _ _ (hS_meas i) hs)
(hS_finite i).ne
have h_right : Tendsto (fun i => ∫ x in S i ∩ s, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ)) := by
have h :=
tendsto_setIntegral_of_monotone (fun i => (hS_meas0 i).inter (hm s hs)) h_mono
(L1.integrable_coeFn f).integrableOn
rwa [← hs_eq] at h
have h_left : Tendsto (fun i => ∫ x in S i ∩ s, condexpL1CLM F' hm μ f x ∂μ) atTop
(𝓝 (∫ x in s, condexpL1CLM F' hm μ f x ∂μ)) := by
have h := tendsto_setIntegral_of_monotone (fun i => (hS_meas0 i).inter (hm s hs)) h_mono
(L1.integrable_coeFn (condexpL1CLM F' hm μ f)).integrableOn
rwa [← hs_eq] at h
rw [h_eq_forall] at h_left
exact tendsto_nhds_unique h_left h_right
@[deprecated (since := "2024-04-17")]
alias set_integral_condexpL1CLM := setIntegral_condexpL1CLM
theorem aestronglyMeasurable'_condexpL1CLM (f : α →₁[μ] F') :
AEStronglyMeasurable' m (condexpL1CLM F' hm μ f) μ := by
refine @Lp.induction _ _ _ _ _ _ _ ENNReal.one_ne_top
(fun f : α →₁[μ] F' => AEStronglyMeasurable' m (condexpL1CLM F' hm μ f) μ) ?_ ?_ ?_ f
· intro c s hs hμs
rw [condexpL1CLM_indicatorConst hs hμs.ne c]
exact aestronglyMeasurable'_condexpInd hs hμs.ne c
· intro f g hf hg _ hfm hgm
rw [(condexpL1CLM F' hm μ).map_add]
refine AEStronglyMeasurable'.congr ?_ (coeFn_add _ _).symm
exact AEStronglyMeasurable'.add hfm hgm
· have : {f : Lp F' 1 μ | AEStronglyMeasurable' m (condexpL1CLM F' hm μ f) μ} =
condexpL1CLM F' hm μ ⁻¹' {f | AEStronglyMeasurable' m f μ} := rfl
rw [this]
refine IsClosed.preimage (condexpL1CLM F' hm μ).continuous ?_
exact isClosed_aeStronglyMeasurable' hm
theorem condexpL1CLM_lpMeas (f : lpMeas F' ℝ m 1 μ) :
condexpL1CLM F' hm μ (f : α →₁[μ] F') = ↑f := by
let g := lpMeasToLpTrimLie F' ℝ 1 μ hm f
have hfg : f = (lpMeasToLpTrimLie F' ℝ 1 μ hm).symm g := by
simp only [g, LinearIsometryEquiv.symm_apply_apply]
rw [hfg]
refine @Lp.induction α F' m _ 1 (μ.trim hm) _ ENNReal.coe_ne_top (fun g : α →₁[μ.trim hm] F' =>
condexpL1CLM F' hm μ ((lpMeasToLpTrimLie F' ℝ 1 μ hm).symm g : α →₁[μ] F') =
↑((lpMeasToLpTrimLie F' ℝ 1 μ hm).symm g)) ?_ ?_ ?_ g
· intro c s hs hμs
rw [@Lp.simpleFunc.coe_indicatorConst _ _ m, lpMeasToLpTrimLie_symm_indicator hs hμs.ne c,
condexpL1CLM_indicatorConstLp]
exact condexpInd_of_measurable hs ((le_trim hm).trans_lt hμs).ne c
· intro f g hf hg _ hf_eq hg_eq
rw [LinearIsometryEquiv.map_add]
push_cast
rw [map_add, hf_eq, hg_eq]
· refine isClosed_eq ?_ ?_
· refine (condexpL1CLM F' hm μ).continuous.comp (continuous_induced_dom.comp ?_)
exact LinearIsometryEquiv.continuous _
· refine continuous_induced_dom.comp ?_
exact LinearIsometryEquiv.continuous _
theorem condexpL1CLM_of_aestronglyMeasurable' (f : α →₁[μ] F') (hfm : AEStronglyMeasurable' m f μ) :
condexpL1CLM F' hm μ f = f :=
condexpL1CLM_lpMeas (⟨f, hfm⟩ : lpMeas F' ℝ m 1 μ)
/-- 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' :=
setToFun μ (condexpInd F' hm μ) (dominatedFinMeasAdditive_condexpInd F' 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) :=
setToFun_eq (dominatedFinMeasAdditive_condexpInd F' hm μ) hf
@[simp]
theorem condexpL1_zero : condexpL1 hm μ (0 : α → F') = 0 :=
setToFun_zero _
@[simp]
theorem condexpL1_measure_zero (hm : m ≤ m0) : condexpL1 hm (0 : Measure α) f = 0 :=
setToFun_measure_zero _ rfl
theorem aestronglyMeasurable'_condexpL1 {f : α → F'} :
AEStronglyMeasurable' m (condexpL1 hm μ f) μ := by
by_cases hf : Integrable f μ
· rw [condexpL1_eq hf]
exact aestronglyMeasurable'_condexpL1CLM _
· rw [condexpL1_undef hf]
refine AEStronglyMeasurable'.congr ?_ (coeFn_zero _ _ _).symm
exact StronglyMeasurable.aeStronglyMeasurable' (@stronglyMeasurable_zero _ _ m _ _)
theorem condexpL1_congr_ae (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (h : f =ᵐ[μ] g) :
condexpL1 hm μ f = condexpL1 hm μ g :=
setToFun_congr_ae _ h
theorem integrable_condexpL1 (f : α → F') : Integrable (condexpL1 hm μ f) μ :=
L1.integrable_coeFn _
/-- 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) :
∫ 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]
exact setIntegral_congr_ae (hm s hs) (hf.coeFn_toL1.mono fun x hx _ => hx)
@[deprecated (since := "2024-04-17")]
alias set_integral_condexpL1 := setIntegral_condexpL1
theorem condexpL1_add (hf : Integrable f μ) (hg : Integrable g μ) :
condexpL1 hm μ (f + g) = condexpL1 hm μ f + condexpL1 hm μ g :=
setToFun_add _ hf hg
theorem condexpL1_neg (f : α → F') : condexpL1 hm μ (-f) = -condexpL1 hm μ f :=
setToFun_neg _ f
theorem condexpL1_smul (c : 𝕜) (f : α → F') : condexpL1 hm μ (c • f) = c • condexpL1 hm μ f := by
refine setToFun_smul _ ?_ c f
exact fun c _ x => condexpInd_smul' c x
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 μ)
(hfi : Integrable f μ) : condexpL1 hm μ f =ᵐ[μ] f := by
rw [condexpL1_eq hfi]
refine EventuallyEq.trans ?_ (Integrable.coeFn_toL1 hfi)
rw [condexpL1CLM_of_aestronglyMeasurable']
exact AEStronglyMeasurable'.congr hfm (Integrable.coeFn_toL1 hfi).symm
theorem condexpL1_mono {E} [NormedLatticeAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E]
[OrderedSMul ℝ E] {f g : α → E} (hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) :
condexpL1 hm μ f ≤ᵐ[μ] condexpL1 hm μ g := by
rw [coeFn_le]
have h_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x : E, 0 ≤ x → 0 ≤ condexpInd E hm μ s x :=
fun s hs hμs x hx => condexpInd_nonneg hs hμs.ne x hx
exact setToFun_mono (dominatedFinMeasAdditive_condexpInd E hm μ) h_nonneg hf hg hfg
end CondexpL1
end MeasureTheory
|
MeasureTheory\Function\ConditionalExpectation\CondexpL2.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Analysis.InnerProductSpace.Projection
import Mathlib.MeasureTheory.Function.ConditionalExpectation.Unique
import Mathlib.MeasureTheory.Function.L2Space
/-! # Conditional expectation in L2
This file contains one step of the construction of the conditional expectation, which is completed
in `MeasureTheory.Function.ConditionalExpectation.Basic`. See that file for a description of the
full process.
We build the conditional expectation of an `L²` function, as an element of `L²`. This is the
orthogonal projection on the subspace of almost everywhere `m`-measurable functions.
## Main definitions
* `condexpL2`: Conditional expectation of a function in L2 with respect to a sigma-algebra: it is
the orthogonal projection on the subspace `lpMeas`.
## Implementation notes
Most of the results in this file are valid for a complete real normed space `F`.
However, some lemmas also use `𝕜 : RCLike`:
* `condexpL2` is defined only for an `InnerProductSpace` for now, and we use `𝕜` for its field.
* results about scalar multiplication are stated not only for `ℝ` but also for `𝕜` if we happen to
have `NormedSpace 𝕜 F`.
-/
open TopologicalSpace Filter ContinuousLinearMap
open scoped ENNReal Topology MeasureTheory
namespace MeasureTheory
variable {α E E' F G G' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜]
-- 𝕜 for ℝ or ℂ
-- E for an inner product space
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E] [CompleteSpace E]
-- E' for an inner product space on which we compute integrals
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E'] [CompleteSpace E'] [NormedSpace ℝ E']
-- F for a Lp submodule
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
-- G for a Lp add_subgroup
[NormedAddCommGroup G]
-- G' for integrals on a Lp add_subgroup
[NormedAddCommGroup G']
[NormedSpace ℝ G'] [CompleteSpace G']
variable {m m0 : MeasurableSpace α} {μ : Measure α} {s t : Set α}
local notation "⟪" x ", " y "⟫" => @inner 𝕜 E _ x y
local notation "⟪" x ", " y "⟫₂" => @inner 𝕜 (α →₂[μ] E) _ x y
-- Porting note: the argument `E` of `condexpL2` is not automatically filled in Lean 4.
-- To avoid typing `(E := _)` every time it is made explicit.
variable (E 𝕜)
/-- Conditional expectation of a function in L2 with respect to a sigma-algebra -/
noncomputable def condexpL2 (hm : m ≤ m0) : (α →₂[μ] E) →L[𝕜] lpMeas E 𝕜 m 2 μ :=
@orthogonalProjection 𝕜 (α →₂[μ] E) _ _ _ (lpMeas E 𝕜 m 2 μ)
haveI : Fact (m ≤ m0) := ⟨hm⟩
inferInstance
variable {E 𝕜}
theorem aeStronglyMeasurable'_condexpL2 (hm : m ≤ m0) (f : α →₂[μ] E) :
AEStronglyMeasurable' (β := E) m (condexpL2 E 𝕜 hm f) μ :=
lpMeas.aeStronglyMeasurable' _
theorem integrableOn_condexpL2_of_measure_ne_top (hm : m ≤ m0) (hμs : μ s ≠ ∞) (f : α →₂[μ] E) :
IntegrableOn (E := E) (condexpL2 E 𝕜 hm f) s μ :=
integrableOn_Lp_of_measure_ne_top (condexpL2 E 𝕜 hm f : α →₂[μ] E) fact_one_le_two_ennreal.elim
hμs
theorem integrable_condexpL2_of_isFiniteMeasure (hm : m ≤ m0) [IsFiniteMeasure μ] {f : α →₂[μ] E} :
Integrable (β := E) (condexpL2 E 𝕜 hm f) μ :=
integrableOn_univ.mp <| integrableOn_condexpL2_of_measure_ne_top hm (measure_ne_top _ _) f
theorem norm_condexpL2_le_one (hm : m ≤ m0) : ‖@condexpL2 α E 𝕜 _ _ _ _ _ _ μ hm‖ ≤ 1 :=
haveI : Fact (m ≤ m0) := ⟨hm⟩
orthogonalProjection_norm_le _
theorem norm_condexpL2_le (hm : m ≤ m0) (f : α →₂[μ] E) : ‖condexpL2 E 𝕜 hm f‖ ≤ ‖f‖ :=
((@condexpL2 _ E 𝕜 _ _ _ _ _ _ μ hm).le_opNorm f).trans
(mul_le_of_le_one_left (norm_nonneg _) (norm_condexpL2_le_one hm))
theorem eLpNorm_condexpL2_le (hm : m ≤ m0) (f : α →₂[μ] E) :
eLpNorm (F := E) (condexpL2 E 𝕜 hm f) 2 μ ≤ eLpNorm f 2 μ := by
rw [lpMeas_coe, ← ENNReal.toReal_le_toReal (Lp.eLpNorm_ne_top _) (Lp.eLpNorm_ne_top _), ←
Lp.norm_def, ← Lp.norm_def, Submodule.norm_coe]
exact norm_condexpL2_le hm f
@[deprecated (since := "2024-07-27")]
alias snorm_condexpL2_le := eLpNorm_condexpL2_le
theorem norm_condexpL2_coe_le (hm : m ≤ m0) (f : α →₂[μ] E) :
‖(condexpL2 E 𝕜 hm f : α →₂[μ] E)‖ ≤ ‖f‖ := by
rw [Lp.norm_def, Lp.norm_def, ← lpMeas_coe]
refine (ENNReal.toReal_le_toReal ?_ (Lp.eLpNorm_ne_top _)).mpr (eLpNorm_condexpL2_le hm f)
exact Lp.eLpNorm_ne_top _
theorem inner_condexpL2_left_eq_right (hm : m ≤ m0) {f g : α →₂[μ] E} :
⟪(condexpL2 E 𝕜 hm f : α →₂[μ] E), g⟫₂ = ⟪f, (condexpL2 E 𝕜 hm g : α →₂[μ] E)⟫₂ :=
haveI : Fact (m ≤ m0) := ⟨hm⟩
inner_orthogonalProjection_left_eq_right _ f g
theorem condexpL2_indicator_of_measurable (hm : m ≤ m0) (hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞)
(c : E) :
(condexpL2 E 𝕜 hm (indicatorConstLp 2 (hm s hs) hμs c) : α →₂[μ] E) =
indicatorConstLp 2 (hm s hs) hμs c := by
rw [condexpL2]
haveI : Fact (m ≤ m0) := ⟨hm⟩
have h_mem : indicatorConstLp 2 (hm s hs) hμs c ∈ lpMeas E 𝕜 m 2 μ :=
mem_lpMeas_indicatorConstLp hm hs hμs
let ind := (⟨indicatorConstLp 2 (hm s hs) hμs c, h_mem⟩ : lpMeas E 𝕜 m 2 μ)
have h_coe_ind : (ind : α →₂[μ] E) = indicatorConstLp 2 (hm s hs) hμs c := rfl
have h_orth_mem := orthogonalProjection_mem_subspace_eq_self ind
rw [← h_coe_ind, h_orth_mem]
theorem inner_condexpL2_eq_inner_fun (hm : m ≤ m0) (f g : α →₂[μ] E)
(hg : AEStronglyMeasurable' m g μ) :
⟪(condexpL2 E 𝕜 hm f : α →₂[μ] E), g⟫₂ = ⟪f, g⟫₂ := by
symm
rw [← sub_eq_zero, ← inner_sub_left, condexpL2]
simp only [mem_lpMeas_iff_aeStronglyMeasurable'.mpr hg, orthogonalProjection_inner_eq_zero f g]
section Real
variable {hm : m ≤ m0}
theorem integral_condexpL2_eq_of_fin_meas_real (f : Lp 𝕜 2 μ) (hs : MeasurableSet[m] s)
(hμs : μ s ≠ ∞) : ∫ x in s, (condexpL2 𝕜 𝕜 hm f : α → 𝕜) x ∂μ = ∫ x in s, f x ∂μ := by
rw [← L2.inner_indicatorConstLp_one (𝕜 := 𝕜) (hm s hs) hμs f]
have h_eq_inner : ∫ x in s, (condexpL2 𝕜 𝕜 hm f : α → 𝕜) x ∂μ =
inner (indicatorConstLp 2 (hm s hs) hμs (1 : 𝕜)) (condexpL2 𝕜 𝕜 hm f) := by
rw [L2.inner_indicatorConstLp_one (hm s hs) hμs]
rw [h_eq_inner, ← inner_condexpL2_left_eq_right, condexpL2_indicator_of_measurable hm hs hμs]
theorem lintegral_nnnorm_condexpL2_le (hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) (f : Lp ℝ 2 μ) :
∫⁻ x in s, ‖(condexpL2 ℝ ℝ hm f : α → ℝ) x‖₊ ∂μ ≤ ∫⁻ x in s, ‖f x‖₊ ∂μ := by
let h_meas := lpMeas.aeStronglyMeasurable' (condexpL2 ℝ ℝ hm f)
let g := h_meas.choose
have hg_meas : StronglyMeasurable[m] g := h_meas.choose_spec.1
have hg_eq : g =ᵐ[μ] condexpL2 ℝ ℝ hm f := h_meas.choose_spec.2.symm
have hg_eq_restrict : g =ᵐ[μ.restrict s] condexpL2 ℝ ℝ hm f := ae_restrict_of_ae hg_eq
have hg_nnnorm_eq : (fun x => (‖g x‖₊ : ℝ≥0∞)) =ᵐ[μ.restrict s] fun x =>
(‖(condexpL2 ℝ ℝ hm f : α → ℝ) x‖₊ : ℝ≥0∞) := by
refine hg_eq_restrict.mono fun x hx => ?_
dsimp only
simp_rw [hx]
rw [lintegral_congr_ae hg_nnnorm_eq.symm]
refine lintegral_nnnorm_le_of_forall_fin_meas_integral_eq
hm (Lp.stronglyMeasurable f) ?_ ?_ ?_ ?_ hs hμs
· exact integrableOn_Lp_of_measure_ne_top f fact_one_le_two_ennreal.elim hμs
· exact hg_meas
· rw [IntegrableOn, integrable_congr hg_eq_restrict]
exact integrableOn_condexpL2_of_measure_ne_top hm hμs f
· intro t ht hμt
rw [← integral_condexpL2_eq_of_fin_meas_real f ht hμt.ne]
exact setIntegral_congr_ae (hm t ht) (hg_eq.mono fun x hx _ => hx)
theorem condexpL2_ae_eq_zero_of_ae_eq_zero (hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) {f : Lp ℝ 2 μ}
(hf : f =ᵐ[μ.restrict s] 0) : condexpL2 ℝ ℝ hm f =ᵐ[μ.restrict s] (0 : α → ℝ) := by
suffices h_nnnorm_eq_zero : ∫⁻ x in s, ‖(condexpL2 ℝ ℝ hm f : α → ℝ) x‖₊ ∂μ = 0 by
rw [lintegral_eq_zero_iff] at h_nnnorm_eq_zero
· refine h_nnnorm_eq_zero.mono fun x hx => ?_
dsimp only at hx
rw [Pi.zero_apply] at hx ⊢
· rwa [ENNReal.coe_eq_zero, nnnorm_eq_zero] at hx
· refine Measurable.coe_nnreal_ennreal (Measurable.nnnorm ?_)
rw [lpMeas_coe]
exact (Lp.stronglyMeasurable _).measurable
refine le_antisymm ?_ (zero_le _)
refine (lintegral_nnnorm_condexpL2_le hs hμs f).trans (le_of_eq ?_)
rw [lintegral_eq_zero_iff]
· refine hf.mono fun x hx => ?_
dsimp only
rw [hx]
simp
· exact (Lp.stronglyMeasurable _).ennnorm
theorem lintegral_nnnorm_condexpL2_indicator_le_real (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
(ht : MeasurableSet[m] t) (hμt : μ t ≠ ∞) :
∫⁻ a in t, ‖(condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α → ℝ) a‖₊ ∂μ ≤ μ (s ∩ t) := by
refine (lintegral_nnnorm_condexpL2_le ht hμt _).trans (le_of_eq ?_)
have h_eq :
∫⁻ x in t, ‖(indicatorConstLp 2 hs hμs (1 : ℝ)) x‖₊ ∂μ =
∫⁻ x in t, s.indicator (fun _ => (1 : ℝ≥0∞)) x ∂μ := by
refine lintegral_congr_ae (ae_restrict_of_ae ?_)
refine (@indicatorConstLp_coeFn _ _ _ 2 _ _ _ hs hμs (1 : ℝ)).mono fun x hx => ?_
dsimp only
rw [hx]
classical
simp_rw [Set.indicator_apply]
split_ifs <;> simp
rw [h_eq, lintegral_indicator _ hs, lintegral_const, Measure.restrict_restrict hs]
simp only [one_mul, Set.univ_inter, MeasurableSet.univ, Measure.restrict_apply]
end Real
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
rw [lpMeas_coe]
have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
refine Memℒp.const_inner _ ?_; rw [lpMeas_coe]; exact Lp.memℒp _
have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
h_mem_Lp.coeFn_toLp
refine EventuallyEq.trans ?_ h_eq
refine Lp.ae_eq_of_forall_setIntegral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
(fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) ?_ ?_ ?_ ?_
· intro s _ hμs
rw [IntegrableOn, integrable_congr (ae_restrict_of_ae h_eq)]
exact (integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _).const_inner _
· intro s hs hμs
rw [← lpMeas_coe, integral_condexpL2_eq_of_fin_meas_real _ hs hμs.ne,
integral_congr_ae (ae_restrict_of_ae h_eq), lpMeas_coe, ←
L2.inner_indicatorConstLp_eq_setIntegral_inner 𝕜 (↑(condexpL2 E 𝕜 hm f)) (hm s hs) c hμs.ne,
← inner_condexpL2_left_eq_right, condexpL2_indicator_of_measurable _ hs,
L2.inner_indicatorConstLp_eq_setIntegral_inner 𝕜 f (hm s hs) c hμs.ne,
setIntegral_congr_ae (hm s hs)
((Memℒp.coeFn_toLp ((Lp.memℒp f).const_inner c)).mono fun x hx _ => hx)]
· rw [← lpMeas_coe]; exact lpMeas.aeStronglyMeasurable' _
· refine AEStronglyMeasurable'.congr ?_ h_eq.symm
exact (lpMeas.aeStronglyMeasurable' _).const_inner _
/-- `condexpL2` verifies the equality of integrals defining the conditional expectation. -/
theorem integral_condexpL2_eq (hm : m ≤ m0) (f : Lp E' 2 μ) (hs : MeasurableSet[m] s)
(hμs : μ s ≠ ∞) : ∫ x in s, (condexpL2 E' 𝕜 hm f : α → E') x ∂μ = ∫ x in s, f x ∂μ := by
rw [← sub_eq_zero, lpMeas_coe, ←
integral_sub' (integrableOn_Lp_of_measure_ne_top _ fact_one_le_two_ennreal.elim hμs)
(integrableOn_Lp_of_measure_ne_top _ fact_one_le_two_ennreal.elim hμs)]
refine integral_eq_zero_of_forall_integral_inner_eq_zero 𝕜 _ ?_ ?_
· rw [integrable_congr (ae_restrict_of_ae (Lp.coeFn_sub (↑(condexpL2 E' 𝕜 hm f)) f).symm)]
exact integrableOn_Lp_of_measure_ne_top _ fact_one_le_two_ennreal.elim hμs
intro c
simp_rw [Pi.sub_apply, inner_sub_right]
rw [integral_sub
((integrableOn_Lp_of_measure_ne_top _ fact_one_le_two_ennreal.elim hμs).const_inner c)
((integrableOn_Lp_of_measure_ne_top _ fact_one_le_two_ennreal.elim hμs).const_inner c)]
have h_ae_eq_f := Memℒp.coeFn_toLp (E := 𝕜) ((Lp.memℒp f).const_inner c)
rw [← lpMeas_coe, sub_eq_zero, ←
setIntegral_congr_ae (hm s hs) ((condexpL2_const_inner hm f c).mono fun x hx _ => hx), ←
setIntegral_congr_ae (hm s hs) (h_ae_eq_f.mono fun x hx _ => hx)]
exact integral_condexpL2_eq_of_fin_meas_real _ hs hμs
variable {E'' 𝕜' : Type*} [RCLike 𝕜'] [NormedAddCommGroup E''] [InnerProductSpace 𝕜' E'']
[CompleteSpace E''] [NormedSpace ℝ E'']
variable (𝕜 𝕜')
theorem condexpL2_comp_continuousLinearMap (hm : m ≤ m0) (T : E' →L[ℝ] E'') (f : α →₂[μ] E') :
(condexpL2 E'' 𝕜' hm (T.compLp f) : α →₂[μ] E'') =ᵐ[μ]
T.compLp (condexpL2 E' 𝕜 hm f : α →₂[μ] E') := by
refine Lp.ae_eq_of_forall_setIntegral_eq' 𝕜' hm _ _ two_ne_zero ENNReal.coe_ne_top
(fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) (fun s _ hμs =>
integrableOn_Lp_of_measure_ne_top _ fact_one_le_two_ennreal.elim hμs.ne) ?_ ?_ ?_
· intro s hs hμs
rw [T.setIntegral_compLp _ (hm s hs),
T.integral_comp_comm
(integrableOn_Lp_of_measure_ne_top _ fact_one_le_two_ennreal.elim hμs.ne),
← lpMeas_coe, ← lpMeas_coe, integral_condexpL2_eq hm f hs hμs.ne,
integral_condexpL2_eq hm (T.compLp f) hs hμs.ne, T.setIntegral_compLp _ (hm s hs),
T.integral_comp_comm
(integrableOn_Lp_of_measure_ne_top f fact_one_le_two_ennreal.elim hμs.ne)]
· rw [← lpMeas_coe]; exact lpMeas.aeStronglyMeasurable' _
· have h_coe := T.coeFn_compLp (condexpL2 E' 𝕜 hm f : α →₂[μ] E')
rw [← EventuallyEq] at h_coe
refine AEStronglyMeasurable'.congr ?_ h_coe.symm
exact (lpMeas.aeStronglyMeasurable' (condexpL2 E' 𝕜 hm f)).continuous_comp T.continuous
variable {𝕜 𝕜'}
section CondexpL2Indicator
variable (𝕜)
theorem condexpL2_indicator_ae_eq_smul (hm : m ≤ m0) (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
(x : E') :
condexpL2 E' 𝕜 hm (indicatorConstLp 2 hs hμs x) =ᵐ[μ] fun a =>
(condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs (1 : ℝ)) : α → ℝ) a • x := by
rw [indicatorConstLp_eq_toSpanSingleton_compLp hs hμs x]
have h_comp :=
condexpL2_comp_continuousLinearMap ℝ 𝕜 hm (toSpanSingleton ℝ x)
(indicatorConstLp 2 hs hμs (1 : ℝ))
rw [← lpMeas_coe] at h_comp
refine h_comp.trans ?_
exact (toSpanSingleton ℝ x).coeFn_compLp _
theorem condexpL2_indicator_eq_toSpanSingleton_comp (hm : m ≤ m0) (hs : MeasurableSet s)
(hμs : μ s ≠ ∞) (x : E') : (condexpL2 E' 𝕜 hm (indicatorConstLp 2 hs hμs x) : α →₂[μ] E') =
(toSpanSingleton ℝ x).compLp (condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1)) := by
ext1
rw [← lpMeas_coe]
refine (condexpL2_indicator_ae_eq_smul 𝕜 hm hs hμs x).trans ?_
have h_comp := (toSpanSingleton ℝ x).coeFn_compLp
(condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α →₂[μ] ℝ)
rw [← EventuallyEq] at h_comp
refine EventuallyEq.trans ?_ h_comp.symm
filter_upwards with y using rfl
variable {𝕜}
theorem setLIntegral_nnnorm_condexpL2_indicator_le (hm : m ≤ m0) (hs : MeasurableSet s)
(hμs : μ s ≠ ∞) (x : E') {t : Set α} (ht : MeasurableSet[m] t) (hμt : μ t ≠ ∞) :
∫⁻ a in t, ‖(condexpL2 E' 𝕜 hm (indicatorConstLp 2 hs hμs x) : α → E') a‖₊ ∂μ ≤
μ (s ∩ t) * ‖x‖₊ :=
calc
∫⁻ a in t, ‖(condexpL2 E' 𝕜 hm (indicatorConstLp 2 hs hμs x) : α → E') a‖₊ ∂μ =
∫⁻ a in t, ‖(condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α → ℝ) a • x‖₊ ∂μ :=
setLIntegral_congr_fun (hm t ht)
((condexpL2_indicator_ae_eq_smul 𝕜 hm hs hμs x).mono fun a ha _ => by rw [ha])
_ = (∫⁻ a in t, ‖(condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α → ℝ) a‖₊ ∂μ) * ‖x‖₊ := by
simp_rw [nnnorm_smul, ENNReal.coe_mul]
rw [lintegral_mul_const, lpMeas_coe]
exact (Lp.stronglyMeasurable _).ennnorm
_ ≤ μ (s ∩ t) * ‖x‖₊ :=
mul_le_mul_right' (lintegral_nnnorm_condexpL2_indicator_le_real hs hμs ht hμt) _
@[deprecated (since := "2024-06-29")]
alias set_lintegral_nnnorm_condexpL2_indicator_le := setLIntegral_nnnorm_condexpL2_indicator_le
theorem lintegral_nnnorm_condexpL2_indicator_le (hm : m ≤ m0) (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
(x : E') [SigmaFinite (μ.trim hm)] :
∫⁻ a, ‖(condexpL2 E' 𝕜 hm (indicatorConstLp 2 hs hμs x) : α → E') a‖₊ ∂μ ≤ μ s * ‖x‖₊ := by
refine lintegral_le_of_forall_fin_meas_trim_le hm (μ s * ‖x‖₊) fun t ht hμt => ?_
refine (setLIntegral_nnnorm_condexpL2_indicator_le hm hs hμs x ht hμt).trans ?_
gcongr
apply Set.inter_subset_left
/-- If the measure `μ.trim hm` is sigma-finite, then the conditional expectation of a measurable set
with finite measure is integrable. -/
theorem integrable_condexpL2_indicator (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : E') :
Integrable (β := E') (condexpL2 E' 𝕜 hm (indicatorConstLp 2 hs hμs x)) μ := by
refine integrable_of_forall_fin_meas_le' hm (μ s * ‖x‖₊)
(ENNReal.mul_lt_top hμs ENNReal.coe_ne_top) ?_ ?_
· rw [lpMeas_coe]; exact Lp.aestronglyMeasurable _
· refine fun t ht hμt =>
(setLIntegral_nnnorm_condexpL2_indicator_le hm hs hμs x ht hμt).trans ?_
gcongr
apply Set.inter_subset_left
end CondexpL2Indicator
section CondexpIndSMul
variable [NormedSpace ℝ G] {hm : m ≤ m0}
/-- Conditional expectation of the indicator of a measurable set with finite measure, in L2. -/
noncomputable def condexpIndSMul (hm : m ≤ m0) (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
Lp G 2 μ :=
(toSpanSingleton ℝ x).compLpL 2 μ (condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs (1 : ℝ)))
theorem aeStronglyMeasurable'_condexpIndSMul (hm : m ≤ m0) (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
(x : G) : AEStronglyMeasurable' m (condexpIndSMul hm hs hμs x) μ := by
have h : AEStronglyMeasurable' m (condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α → ℝ) μ :=
aeStronglyMeasurable'_condexpL2 _ _
rw [condexpIndSMul]
suffices AEStronglyMeasurable' m
(toSpanSingleton ℝ x ∘ condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1)) μ by
refine AEStronglyMeasurable'.congr this ?_
refine EventuallyEq.trans ?_ (coeFn_compLpL _ _).symm
rfl
exact AEStronglyMeasurable'.continuous_comp (toSpanSingleton ℝ x).continuous h
theorem condexpIndSMul_add (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x y : G) :
condexpIndSMul hm hs hμs (x + y) = condexpIndSMul hm hs hμs x + condexpIndSMul hm hs hμs y := by
simp_rw [condexpIndSMul]; rw [toSpanSingleton_add, add_compLpL, add_apply]
theorem condexpIndSMul_smul (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : ℝ) (x : G) :
condexpIndSMul hm hs hμs (c • x) = c • condexpIndSMul hm hs hμs x := by
simp_rw [condexpIndSMul]; rw [toSpanSingleton_smul, smul_compLpL, smul_apply]
theorem condexpIndSMul_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (hs : MeasurableSet s)
(hμs : μ s ≠ ∞) (c : 𝕜) (x : F) :
condexpIndSMul hm hs hμs (c • x) = c • condexpIndSMul hm hs hμs x := by
rw [condexpIndSMul, condexpIndSMul, toSpanSingleton_smul',
(toSpanSingleton ℝ x).smul_compLpL c, smul_apply]
theorem condexpIndSMul_ae_eq_smul (hm : m ≤ m0) (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
condexpIndSMul hm hs hμs x =ᵐ[μ] fun a =>
(condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α → ℝ) a • x :=
(toSpanSingleton ℝ x).coeFn_compLpL _
theorem setLIntegral_nnnorm_condexpIndSMul_le (hm : m ≤ m0) (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
(x : G) {t : Set α} (ht : MeasurableSet[m] t) (hμt : μ t ≠ ∞) :
(∫⁻ a in t, ‖condexpIndSMul hm hs hμs x a‖₊ ∂μ) ≤ μ (s ∩ t) * ‖x‖₊ :=
calc
∫⁻ a in t, ‖condexpIndSMul hm hs hμs x a‖₊ ∂μ =
∫⁻ a in t, ‖(condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α → ℝ) a • x‖₊ ∂μ :=
setLIntegral_congr_fun (hm t ht)
((condexpIndSMul_ae_eq_smul hm hs hμs x).mono fun a ha _ => by rw [ha])
_ = (∫⁻ a in t, ‖(condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α → ℝ) a‖₊ ∂μ) * ‖x‖₊ := by
simp_rw [nnnorm_smul, ENNReal.coe_mul]
rw [lintegral_mul_const, lpMeas_coe]
exact (Lp.stronglyMeasurable _).ennnorm
_ ≤ μ (s ∩ t) * ‖x‖₊ :=
mul_le_mul_right' (lintegral_nnnorm_condexpL2_indicator_le_real hs hμs ht hμt) _
@[deprecated (since := "2024-06-29")]
alias set_lintegral_nnnorm_condexpIndSMul_le := setLIntegral_nnnorm_condexpIndSMul_le
theorem lintegral_nnnorm_condexpIndSMul_le (hm : m ≤ m0) (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
(x : G) [SigmaFinite (μ.trim hm)] : ∫⁻ a, ‖condexpIndSMul hm hs hμs x a‖₊ ∂μ ≤ μ s * ‖x‖₊ := by
refine lintegral_le_of_forall_fin_meas_trim_le hm (μ s * ‖x‖₊) fun t ht hμt => ?_
refine (setLIntegral_nnnorm_condexpIndSMul_le hm hs hμs x ht hμt).trans ?_
gcongr
apply Set.inter_subset_left
/-- If the measure `μ.trim hm` is sigma-finite, then the conditional expectation of a measurable set
with finite measure is integrable. -/
theorem integrable_condexpIndSMul (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s)
(hμs : μ s ≠ ∞) (x : G) : Integrable (condexpIndSMul hm hs hμs x) μ := by
refine integrable_of_forall_fin_meas_le' hm (μ s * ‖x‖₊)
(ENNReal.mul_lt_top hμs ENNReal.coe_ne_top) ?_ ?_
· exact Lp.aestronglyMeasurable _
· refine fun t ht hμt => (setLIntegral_nnnorm_condexpIndSMul_le hm hs hμs x ht hμt).trans ?_
gcongr
apply Set.inter_subset_left
theorem condexpIndSMul_empty {x : G} : condexpIndSMul hm MeasurableSet.empty
((measure_empty (μ := μ)).le.trans_lt ENNReal.coe_lt_top).ne x = 0 := by
rw [condexpIndSMul, indicatorConstLp_empty]
simp only [Submodule.coe_zero, ContinuousLinearMap.map_zero]
theorem setIntegral_condexpL2_indicator (hs : MeasurableSet[m] s) (ht : MeasurableSet t)
(hμs : μ s ≠ ∞) (hμt : μ t ≠ ∞) :
∫ x in s, (condexpL2 ℝ ℝ hm (indicatorConstLp 2 ht hμt 1) : α → ℝ) x ∂μ = (μ (t ∩ s)).toReal :=
calc
∫ x in s, (condexpL2 ℝ ℝ hm (indicatorConstLp 2 ht hμt 1) : α → ℝ) x ∂μ =
∫ x in s, indicatorConstLp 2 ht hμt (1 : ℝ) x ∂μ :=
@integral_condexpL2_eq α _ ℝ _ _ _ _ _ _ _ _ _ hm (indicatorConstLp 2 ht hμt (1 : ℝ)) hs hμs
_ = (μ (t ∩ s)).toReal • (1 : ℝ) := setIntegral_indicatorConstLp (hm s hs) ht hμt 1
_ = (μ (t ∩ s)).toReal := by rw [smul_eq_mul, mul_one]
@[deprecated (since := "2024-04-17")]
alias set_integral_condexpL2_indicator := setIntegral_condexpL2_indicator
theorem setIntegral_condexpIndSMul (hs : MeasurableSet[m] s) (ht : MeasurableSet t)
(hμs : μ s ≠ ∞) (hμt : μ t ≠ ∞) (x : G') :
∫ a in s, (condexpIndSMul hm ht hμt x) a ∂μ = (μ (t ∩ s)).toReal • x :=
calc
∫ a in s, (condexpIndSMul hm ht hμt x) a ∂μ =
∫ a in s, (condexpL2 ℝ ℝ hm (indicatorConstLp 2 ht hμt 1) : α → ℝ) a • x ∂μ :=
setIntegral_congr_ae (hm s hs)
((condexpIndSMul_ae_eq_smul hm ht hμt x).mono fun x hx _ => hx)
_ = (∫ a in s, (condexpL2 ℝ ℝ hm (indicatorConstLp 2 ht hμt 1) : α → ℝ) a ∂μ) • x :=
(integral_smul_const _ x)
_ = (μ (t ∩ s)).toReal • x := by rw [setIntegral_condexpL2_indicator hs ht hμs hμt]
@[deprecated (since := "2024-04-17")]
alias set_integral_condexpIndSMul := setIntegral_condexpIndSMul
theorem condexpL2_indicator_nonneg (hm : m ≤ m0) (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
[SigmaFinite (μ.trim hm)] : (0 : α → ℝ) ≤ᵐ[μ]
condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) := by
have h : AEStronglyMeasurable' m (condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α → ℝ) μ :=
aeStronglyMeasurable'_condexpL2 _ _
refine EventuallyLE.trans_eq ?_ h.ae_eq_mk.symm
refine @ae_le_of_ae_le_trim _ _ _ _ _ _ hm (0 : α → ℝ) _ ?_
refine ae_nonneg_of_forall_setIntegral_nonneg_of_sigmaFinite ?_ ?_
· rintro t - -
refine @Integrable.integrableOn _ _ m _ _ _ _ ?_
refine Integrable.trim hm ?_ ?_
· rw [integrable_congr h.ae_eq_mk.symm]
exact integrable_condexpL2_indicator hm hs hμs _
· exact h.stronglyMeasurable_mk
· intro t ht hμt
rw [← setIntegral_trim hm h.stronglyMeasurable_mk ht]
have h_ae :
∀ᵐ x ∂μ, x ∈ t → h.mk _ x = (condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1) : α → ℝ) x := by
filter_upwards [h.ae_eq_mk] with x hx
exact fun _ => hx.symm
rw [setIntegral_congr_ae (hm t ht) h_ae,
setIntegral_condexpL2_indicator ht hs ((le_trim hm).trans_lt hμt).ne hμs]
exact ENNReal.toReal_nonneg
theorem condexpIndSMul_nonneg {E} [NormedLatticeAddCommGroup E] [NormedSpace ℝ E] [OrderedSMul ℝ E]
[SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : E) (hx : 0 ≤ x) :
(0 : α → E) ≤ᵐ[μ] condexpIndSMul hm hs hμs x := by
refine EventuallyLE.trans_eq ?_ (condexpIndSMul_ae_eq_smul hm hs hμs x).symm
filter_upwards [condexpL2_indicator_nonneg hm hs hμs] with a ha
exact smul_nonneg ha hx
end CondexpIndSMul
end MeasureTheory
|
MeasureTheory\Function\ConditionalExpectation\Indicator.lean | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic
/-!
# Conditional expectation of indicator functions
This file proves some results about the conditional expectation of an indicator function and
as a corollary, also proves several results about the behaviour of the conditional expectation on
a restricted measure.
## Main result
* `MeasureTheory.condexp_indicator`: If `s` is an `m`-measurable set, then the conditional
expectation of the indicator function of `s` is almost everywhere equal to the indicator
of `s` of the conditional expectation. Namely, `𝔼[s.indicator f | m] = s.indicator 𝔼[f | m]` a.e.
-/
noncomputable section
open TopologicalSpace MeasureTheory.Lp Filter ContinuousLinearMap
open scoped NNReal ENNReal Topology MeasureTheory
namespace MeasureTheory
variable {α 𝕜 E : Type*} {m m0 : MeasurableSpace α} [NormedAddCommGroup E] [NormedSpace ℝ E]
[CompleteSpace E] {μ : Measure α} {f : α → E} {s : Set α}
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
μ[f|m] =ᵐ[μ.restrict s] 0 := by
by_cases hm : m ≤ m0
swap; · simp_rw [condexp_of_not_le hm]; rfl
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
haveI : SigmaFinite (μ.trim hm) := hμm
have : SigmaFinite ((μ.restrict s).trim hm) := by
rw [← restrict_trim hm _ hs]
exact Restrict.sigmaFinite _ s
by_cases hf_int : Integrable f μ
swap; · rw [condexp_undef hf_int]
refine ae_eq_of_forall_setIntegral_eq_of_sigmaFinite' hm ?_ ?_ ?_ ?_ ?_
· exact fun t _ _ => integrable_condexp.integrableOn.integrableOn
· exact fun t _ _ => (integrable_zero _ _ _).integrableOn
· intro t ht _
rw [Measure.restrict_restrict (hm _ ht), setIntegral_condexp hm hf_int (ht.inter hs), ←
Measure.restrict_restrict (hm _ ht)]
refine setIntegral_congr_ae (hm _ ht) ?_
filter_upwards [hf] with x hx _ using hx
· exact stronglyMeasurable_condexp.aeStronglyMeasurable'
· exact stronglyMeasurable_zero.aeStronglyMeasurable'
/-- Auxiliary lemma for `condexp_indicator`. -/
theorem condexp_indicator_aux (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict sᶜ] 0) :
μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
by_cases hm : m ≤ m0
swap; · simp_rw [condexp_of_not_le hm, Set.indicator_zero']; rfl
have hsf_zero : ∀ g : α → E, g =ᵐ[μ.restrict sᶜ] 0 → s.indicator g =ᵐ[μ] g := fun g =>
indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs)
refine ((hsf_zero (μ[f|m]) (condexp_ae_eq_restrict_zero hs.compl hf)).trans ?_).symm
exact condexp_congr_ae (hsf_zero f hf).symm
/-- The conditional expectation of the indicator of a function over an `m`-measurable set with
respect to the σ-algebra `m` is a.e. equal to the indicator of the conditional expectation. -/
theorem condexp_indicator (hf_int : Integrable f μ) (hs : MeasurableSet[m] s) :
μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
by_cases hm : m ≤ m0
swap; · simp_rw [condexp_of_not_le hm, Set.indicator_zero']; rfl
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm, Set.indicator_zero']; rfl
haveI : SigmaFinite (μ.trim hm) := hμm
-- use `have` to perform what should be the first calc step because of an error I don't
-- understand
have : s.indicator (μ[f|m]) =ᵐ[μ] s.indicator (μ[s.indicator f + sᶜ.indicator f|m]) := by
rw [Set.indicator_self_add_compl s f]
refine (this.trans ?_).symm
calc
s.indicator (μ[s.indicator f + sᶜ.indicator f|m]) =ᵐ[μ]
s.indicator (μ[s.indicator f|m] + μ[sᶜ.indicator f|m]) := by
have : μ[s.indicator f + sᶜ.indicator f|m] =ᵐ[μ] μ[s.indicator f|m] + μ[sᶜ.indicator f|m] :=
condexp_add (hf_int.indicator (hm _ hs)) (hf_int.indicator (hm _ hs.compl))
filter_upwards [this] with x hx
classical rw [Set.indicator_apply, Set.indicator_apply, hx]
_ = s.indicator (μ[s.indicator f|m]) + s.indicator (μ[sᶜ.indicator f|m]) :=
(s.indicator_add' _ _)
_ =ᵐ[μ] s.indicator (μ[s.indicator f|m]) +
s.indicator (sᶜ.indicator (μ[sᶜ.indicator f|m])) := by
refine Filter.EventuallyEq.rfl.add ?_
have : sᶜ.indicator (μ[sᶜ.indicator f|m]) =ᵐ[μ] μ[sᶜ.indicator f|m] := by
refine (condexp_indicator_aux hs.compl ?_).symm.trans ?_
· exact indicator_ae_eq_restrict_compl (hm _ hs.compl)
· rw [Set.indicator_indicator, Set.inter_self]
filter_upwards [this] with x hx
by_cases hxs : x ∈ s
· simp only [hx, hxs, Set.indicator_of_mem]
· simp only [hxs, Set.indicator_of_not_mem, not_false_iff]
_ =ᵐ[μ] s.indicator (μ[s.indicator f|m]) := by
rw [Set.indicator_indicator, Set.inter_compl_self, Set.indicator_empty', add_zero]
_ =ᵐ[μ] μ[s.indicator f|m] := by
refine (condexp_indicator_aux hs ?_).symm.trans ?_
· exact indicator_ae_eq_restrict_compl (hm _ hs)
· rw [Set.indicator_indicator, Set.inter_self]
theorem condexp_restrict_ae_eq_restrict (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
(hs_m : MeasurableSet[m] s) (hf_int : Integrable f μ) :
(μ.restrict s)[f|m] =ᵐ[μ.restrict s] μ[f|m] := by
have : SigmaFinite ((μ.restrict s).trim hm) := by rw [← restrict_trim hm _ hs_m]; infer_instance
rw [ae_eq_restrict_iff_indicator_ae_eq (hm _ hs_m)]
refine EventuallyEq.trans ?_ (condexp_indicator hf_int hs_m)
refine ae_eq_condexp_of_forall_setIntegral_eq hm (hf_int.indicator (hm _ hs_m)) ?_ ?_ ?_
· intro t ht _
rw [← integrable_indicator_iff (hm _ ht), Set.indicator_indicator, Set.inter_comm, ←
Set.indicator_indicator]
suffices h_int_restrict : Integrable (t.indicator ((μ.restrict s)[f|m])) (μ.restrict s) by
rw [integrable_indicator_iff (hm _ hs_m), IntegrableOn]
rw [integrable_indicator_iff (hm _ ht), IntegrableOn] at h_int_restrict ⊢
exact h_int_restrict
exact integrable_condexp.indicator (hm _ ht)
· intro t ht _
calc
∫ x in t, s.indicator ((μ.restrict s)[f|m]) x ∂μ =
∫ x in t, ((μ.restrict s)[f|m]) x ∂μ.restrict s := by
rw [integral_indicator (hm _ hs_m), Measure.restrict_restrict (hm _ hs_m),
Measure.restrict_restrict (hm _ ht), Set.inter_comm]
_ = ∫ x in t, f x ∂μ.restrict s := setIntegral_condexp hm hf_int.integrableOn ht
_ = ∫ x in t, s.indicator f x ∂μ := by
rw [integral_indicator (hm _ hs_m), Measure.restrict_restrict (hm _ hs_m),
Measure.restrict_restrict (hm _ ht), Set.inter_comm]
· exact (stronglyMeasurable_condexp.indicator hs_m).aeStronglyMeasurable'
/-- If the restriction to an `m`-measurable set `s` of a σ-algebra `m` is equal to the restriction
to `s` of another σ-algebra `m₂` (hypothesis `hs`), then `μ[f | m] =ᵐ[μ.restrict s] μ[f | m₂]`. -/
theorem condexp_ae_eq_restrict_of_measurableSpace_eq_on {m m₂ m0 : MeasurableSpace α}
{μ : Measure α} (hm : m ≤ m0) (hm₂ : m₂ ≤ m0) [SigmaFinite (μ.trim hm)]
[SigmaFinite (μ.trim hm₂)] (hs_m : MeasurableSet[m] s)
(hs : ∀ t, MeasurableSet[m] (s ∩ t) ↔ MeasurableSet[m₂] (s ∩ t)) :
μ[f|m] =ᵐ[μ.restrict s] μ[f|m₂] := by
rw [ae_eq_restrict_iff_indicator_ae_eq (hm _ hs_m)]
have hs_m₂ : MeasurableSet[m₂] s := by rwa [← Set.inter_univ s, ← hs Set.univ, Set.inter_univ]
by_cases hf_int : Integrable f μ
swap; · simp_rw [condexp_undef hf_int]; rfl
refine ((condexp_indicator hf_int hs_m).symm.trans ?_).trans (condexp_indicator hf_int hs_m₂)
refine ae_eq_of_forall_setIntegral_eq_of_sigmaFinite' hm₂
(fun s _ _ => integrable_condexp.integrableOn)
(fun s _ _ => integrable_condexp.integrableOn) ?_ ?_
stronglyMeasurable_condexp.aeStronglyMeasurable'
swap
· have : StronglyMeasurable[m] (μ[s.indicator f|m]) := stronglyMeasurable_condexp
refine this.aeStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on hm hs_m
(fun t => (hs t).mp) ?_
exact condexp_ae_eq_restrict_zero hs_m.compl (indicator_ae_eq_restrict_compl (hm _ hs_m))
intro t ht _
have : ∫ x in t, (μ[s.indicator f|m]) x ∂μ = ∫ x in s ∩ t, (μ[s.indicator f|m]) x ∂μ := by
rw [← integral_add_compl (hm _ hs_m) integrable_condexp.integrableOn]
suffices ∫ x in sᶜ, (μ[s.indicator f|m]) x ∂μ.restrict t = 0 by
rw [this, add_zero, Measure.restrict_restrict (hm _ hs_m)]
rw [Measure.restrict_restrict (MeasurableSet.compl (hm _ hs_m))]
suffices μ[s.indicator f|m] =ᵐ[μ.restrict sᶜ] 0 by
rw [Set.inter_comm, ← Measure.restrict_restrict (hm₂ _ ht)]
calc
∫ x : α in t, (μ[s.indicator f|m]) x ∂μ.restrict sᶜ =
∫ x : α in t, 0 ∂μ.restrict sᶜ := by
refine setIntegral_congr_ae (hm₂ _ ht) ?_
filter_upwards [this] with x hx _ using hx
_ = 0 := integral_zero _ _
refine condexp_ae_eq_restrict_zero hs_m.compl ?_
exact indicator_ae_eq_restrict_compl (hm _ hs_m)
have hst_m : MeasurableSet[m] (s ∩ t) := (hs _).mpr (hs_m₂.inter ht)
simp_rw [this, setIntegral_condexp hm₂ (hf_int.indicator (hm _ hs_m)) ht,
setIntegral_condexp hm (hf_int.indicator (hm _ hs_m)) hst_m, integral_indicator (hm _ hs_m),
Measure.restrict_restrict (hm _ hs_m), ← Set.inter_assoc, Set.inter_self]
end MeasureTheory
|
MeasureTheory\Function\ConditionalExpectation\Real.lean | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne, Kexing Ying
-/
import Mathlib.MeasureTheory.Function.ConditionalExpectation.Indicator
import Mathlib.MeasureTheory.Function.UniformIntegrable
import Mathlib.MeasureTheory.Decomposition.RadonNikodym
/-!
# Conditional expectation of real-valued functions
This file proves some results regarding the conditional expectation of real-valued functions.
## Main results
* `MeasureTheory.rnDeriv_ae_eq_condexp`: the conditional expectation `μ[f | m]` is equal to the
Radon-Nikodym derivative of `fμ` restricted on `m` with respect to `μ` restricted on `m`.
* `MeasureTheory.Integrable.uniformIntegrable_condexp`: the conditional expectation of a function
form a uniformly integrable class.
* `MeasureTheory.condexp_stronglyMeasurable_mul`: the pull-out property of the conditional
expectation.
-/
noncomputable section
open TopologicalSpace MeasureTheory.Lp Filter ContinuousLinearMap
open scoped NNReal ENNReal Topology MeasureTheory
namespace MeasureTheory
variable {α : Type*} {m m0 : MeasurableSpace α} {μ : Measure α}
theorem rnDeriv_ae_eq_condexp {hm : m ≤ m0} [hμm : SigmaFinite (μ.trim hm)] {f : α → ℝ}
(hf : Integrable f μ) :
SignedMeasure.rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm) =ᵐ[μ] μ[f|m] := by
refine ae_eq_condexp_of_forall_setIntegral_eq hm hf ?_ ?_ ?_
· exact fun _ _ _ => (integrable_of_integrable_trim hm
(SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm))).integrableOn
· intro s hs _
conv_rhs => rw [← hf.withDensityᵥ_trim_eq_integral hm hs,
← SignedMeasure.withDensityᵥ_rnDeriv_eq ((μ.withDensityᵥ f).trim hm) (μ.trim hm)
(hf.withDensityᵥ_trim_absolutelyContinuous hm)]
rw [withDensityᵥ_apply
(SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm)) hs,
← setIntegral_trim hm _ hs]
exact (SignedMeasure.measurable_rnDeriv _ _).stronglyMeasurable
· exact (SignedMeasure.measurable_rnDeriv _ _).stronglyMeasurable.aeStronglyMeasurable'
-- TODO: the following couple of lemmas should be generalized and proved using Jensen's inequality
-- for the conditional expectation (not in mathlib yet) .
theorem eLpNorm_one_condexp_le_eLpNorm (f : α → ℝ) : eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ := by
by_cases hf : Integrable f μ
swap; · rw [condexp_undef hf, eLpNorm_zero]; exact zero_le _
by_cases hm : m ≤ m0
swap; · rw [condexp_of_not_le hm, eLpNorm_zero]; exact zero_le _
by_cases hsig : SigmaFinite (μ.trim hm)
swap; · rw [condexp_of_not_sigmaFinite hm hsig, eLpNorm_zero]; exact zero_le _
calc
eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm (μ[(|f|)|m]) 1 μ := by
refine eLpNorm_mono_ae ?_
filter_upwards [condexp_mono hf hf.abs
(ae_of_all μ (fun x => le_abs_self (f x) : ∀ x, f x ≤ |f x|)),
EventuallyLE.trans (condexp_neg f).symm.le
(condexp_mono hf.neg hf.abs
(ae_of_all μ (fun x => neg_le_abs (f x) : ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
exact abs_le_abs hx₁ hx₂
_ = eLpNorm f 1 μ := by
rw [eLpNorm_one_eq_lintegral_nnnorm, eLpNorm_one_eq_lintegral_nnnorm, ←
ENNReal.toReal_eq_toReal (ne_of_lt integrable_condexp.2) (ne_of_lt hf.2), ←
integral_norm_eq_lintegral_nnnorm
(stronglyMeasurable_condexp.mono hm).aestronglyMeasurable,
← integral_norm_eq_lintegral_nnnorm hf.1]
simp_rw [Real.norm_eq_abs]
rw (config := {occs := .pos [2]}) [← integral_condexp hm]
refine integral_congr_ae ?_
have : 0 ≤ᵐ[μ] μ[(|f|)|m] := by
rw [← condexp_zero]
exact condexp_mono (integrable_zero _ _ _) hf.abs
(ae_of_all μ (fun x => abs_nonneg (f x) : ∀ x, 0 ≤ |f x|))
filter_upwards [this] with x hx
exact abs_eq_self.2 hx
@[deprecated (since := "2024-07-27")]
alias snorm_one_condexp_le_snorm := eLpNorm_one_condexp_le_eLpNorm
theorem integral_abs_condexp_le (f : α → ℝ) : ∫ x, |(μ[f|m]) x| ∂μ ≤ ∫ x, |f x| ∂μ := by
by_cases hm : m ≤ m0
swap
· simp_rw [condexp_of_not_le hm, Pi.zero_apply, abs_zero, integral_zero]
positivity
by_cases hfint : Integrable f μ
swap
· simp only [condexp_undef hfint, Pi.zero_apply, abs_zero, integral_const, Algebra.id.smul_eq_mul,
mul_zero]
positivity
rw [integral_eq_lintegral_of_nonneg_ae, integral_eq_lintegral_of_nonneg_ae]
· rw [ENNReal.toReal_le_toReal] <;> simp_rw [← Real.norm_eq_abs, ofReal_norm_eq_coe_nnnorm]
· rw [← eLpNorm_one_eq_lintegral_nnnorm, ← eLpNorm_one_eq_lintegral_nnnorm]
exact eLpNorm_one_condexp_le_eLpNorm _
· exact integrable_condexp.2.ne
· exact hfint.2.ne
· filter_upwards with x using abs_nonneg _
· simp_rw [← Real.norm_eq_abs]
exact hfint.1.norm
· filter_upwards with x using abs_nonneg _
· simp_rw [← Real.norm_eq_abs]
exact (stronglyMeasurable_condexp.mono hm).aestronglyMeasurable.norm
theorem setIntegral_abs_condexp_le {s : Set α} (hs : MeasurableSet[m] s) (f : α → ℝ) :
∫ x in s, |(μ[f|m]) x| ∂μ ≤ ∫ x in s, |f x| ∂μ := by
by_cases hnm : m ≤ m0
swap
· simp_rw [condexp_of_not_le hnm, Pi.zero_apply, abs_zero, integral_zero]
positivity
by_cases hfint : Integrable f μ
swap
· simp only [condexp_undef hfint, Pi.zero_apply, abs_zero, integral_const, Algebra.id.smul_eq_mul,
mul_zero]
positivity
have : ∫ x in s, |(μ[f|m]) x| ∂μ = ∫ x, |(μ[s.indicator f|m]) x| ∂μ := by
rw [← integral_indicator (hnm _ hs)]
refine integral_congr_ae ?_
have : (fun x => |(μ[s.indicator f|m]) x|) =ᵐ[μ] fun x => |s.indicator (μ[f|m]) x| :=
(condexp_indicator hfint hs).fun_comp abs
refine EventuallyEq.trans (eventually_of_forall fun x => ?_) this.symm
rw [← Real.norm_eq_abs, norm_indicator_eq_indicator_norm]
simp only [Real.norm_eq_abs]
rw [this, ← integral_indicator (hnm _ hs)]
refine (integral_abs_condexp_le _).trans
(le_of_eq <| integral_congr_ae <| eventually_of_forall fun x => ?_)
simp_rw [← Real.norm_eq_abs, norm_indicator_eq_indicator_norm]
@[deprecated (since := "2024-04-17")]
alias set_integral_abs_condexp_le := setIntegral_abs_condexp_le
/-- If the real valued function `f` is bounded almost everywhere by `R`, then so is its conditional
expectation. -/
theorem ae_bdd_condexp_of_ae_bdd {R : ℝ≥0} {f : α → ℝ} (hbdd : ∀ᵐ x ∂μ, |f x| ≤ R) :
∀ᵐ x ∂μ, |(μ[f|m]) x| ≤ R := by
by_cases hnm : m ≤ m0
swap
· simp_rw [condexp_of_not_le hnm, Pi.zero_apply, abs_zero]
exact eventually_of_forall fun _ => R.coe_nonneg
by_cases hfint : Integrable f μ
swap
· simp_rw [condexp_undef hfint]
filter_upwards [hbdd] with x hx
rw [Pi.zero_apply, abs_zero]
exact (abs_nonneg _).trans hx
by_contra h
change μ _ ≠ 0 at h
simp only [← zero_lt_iff, Set.compl_def, Set.mem_setOf_eq, not_le] at h
suffices (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R < (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R by
exact this.ne rfl
refine lt_of_lt_of_le (setIntegral_gt_gt R.coe_nonneg ?_ h.ne') ?_
· exact integrable_condexp.abs.integrableOn
refine (setIntegral_abs_condexp_le ?_ _).trans ?_
· simp_rw [← Real.norm_eq_abs]
exact @measurableSet_lt _ _ _ _ _ m _ _ _ _ _ measurable_const
stronglyMeasurable_condexp.norm.measurable
simp only [← smul_eq_mul, ← setIntegral_const, NNReal.val_eq_coe, RCLike.ofReal_real_eq_id,
_root_.id]
refine setIntegral_mono_ae hfint.abs.integrableOn ?_ hbdd
refine ⟨aestronglyMeasurable_const, lt_of_le_of_lt ?_
(integrable_condexp.integrableOn : IntegrableOn (μ[f|m]) {x | ↑R < |(μ[f|m]) x|} μ).2⟩
refine setLIntegral_mono
(stronglyMeasurable_condexp.mono hnm).measurable.nnnorm.coe_nnreal_ennreal fun x hx => ?_
rw [ENNReal.coe_le_coe, Real.nnnorm_of_nonneg R.coe_nonneg]
exact Subtype.mk_le_mk.2 (le_of_lt hx)
/-- Given an integrable function `g`, the conditional expectations of `g` with respect to
a sequence of sub-σ-algebras is uniformly integrable. -/
theorem Integrable.uniformIntegrable_condexp {ι : Type*} [IsFiniteMeasure μ] {g : α → ℝ}
(hint : Integrable g μ) {ℱ : ι → MeasurableSpace α} (hℱ : ∀ i, ℱ i ≤ m0) :
UniformIntegrable (fun i => μ[g|ℱ i]) 1 μ := by
let A : MeasurableSpace α := m0
have hmeas : ∀ n, ∀ C, MeasurableSet {x | C ≤ ‖(μ[g|ℱ n]) x‖₊} := fun n C =>
measurableSet_le measurable_const (stronglyMeasurable_condexp.mono (hℱ n)).measurable.nnnorm
have hg : Memℒp g 1 μ := memℒp_one_iff_integrable.2 hint
refine uniformIntegrable_of le_rfl ENNReal.one_ne_top
(fun n => (stronglyMeasurable_condexp.mono (hℱ n)).aestronglyMeasurable) fun ε hε => ?_
by_cases hne : eLpNorm g 1 μ = 0
· rw [eLpNorm_eq_zero_iff hg.1 one_ne_zero] at hne
refine ⟨0, fun n => (le_of_eq <|
(eLpNorm_eq_zero_iff ((stronglyMeasurable_condexp.mono (hℱ n)).aestronglyMeasurable.indicator
(hmeas n 0)) one_ne_zero).2 ?_).trans (zero_le _)⟩
filter_upwards [condexp_congr_ae (m := ℱ n) hne] with x hx
simp only [zero_le', Set.setOf_true, Set.indicator_univ, Pi.zero_apply, hx, condexp_zero]
obtain ⟨δ, hδ, h⟩ := hg.eLpNorm_indicator_le le_rfl ENNReal.one_ne_top hε
set C : ℝ≥0 := ⟨δ, hδ.le⟩⁻¹ * (eLpNorm g 1 μ).toNNReal with hC
have hCpos : 0 < C := mul_pos (inv_pos.2 hδ) (ENNReal.toNNReal_pos hne hg.eLpNorm_lt_top.ne)
have : ∀ n, μ {x : α | C ≤ ‖(μ[g|ℱ n]) x‖₊} ≤ ENNReal.ofReal δ := by
intro n
have := mul_meas_ge_le_pow_eLpNorm' μ one_ne_zero ENNReal.one_ne_top
((stronglyMeasurable_condexp (m := ℱ n) (μ := μ) (f := g)).mono (hℱ n)).aestronglyMeasurable C
rw [ENNReal.one_toReal, ENNReal.rpow_one, ENNReal.rpow_one, mul_comm, ←
ENNReal.le_div_iff_mul_le (Or.inl (ENNReal.coe_ne_zero.2 hCpos.ne'))
(Or.inl ENNReal.coe_lt_top.ne)] at this
simp_rw [ENNReal.coe_le_coe] at this
refine this.trans ?_
rw [ENNReal.div_le_iff_le_mul (Or.inl (ENNReal.coe_ne_zero.2 hCpos.ne'))
(Or.inl ENNReal.coe_lt_top.ne),
hC, Nonneg.inv_mk, ENNReal.coe_mul, ENNReal.coe_toNNReal hg.eLpNorm_lt_top.ne, ← mul_assoc, ←
ENNReal.ofReal_eq_coe_nnreal, ← ENNReal.ofReal_mul hδ.le, mul_inv_cancel hδ.ne',
ENNReal.ofReal_one, one_mul]
exact eLpNorm_one_condexp_le_eLpNorm _
refine ⟨C, fun n => le_trans ?_ (h {x : α | C ≤ ‖(μ[g|ℱ n]) x‖₊} (hmeas n C) (this n))⟩
have hmeasℱ : MeasurableSet[ℱ n] {x : α | C ≤ ‖(μ[g|ℱ n]) x‖₊} :=
@measurableSet_le _ _ _ _ _ (ℱ n) _ _ _ _ _ measurable_const
(@Measurable.nnnorm _ _ _ _ _ (ℱ n) _ stronglyMeasurable_condexp.measurable)
rw [← eLpNorm_congr_ae (condexp_indicator hint hmeasℱ)]
exact eLpNorm_one_condexp_le_eLpNorm _
section PullOut
-- TODO: this section could be generalized beyond multiplication, to any bounded bilinear map.
/-- Auxiliary lemma for `condexp_stronglyMeasurable_mul`. -/
theorem condexp_stronglyMeasurable_simpleFunc_mul (hm : m ≤ m0) (f : @SimpleFunc α m ℝ) {g : α → ℝ}
(hg : Integrable g μ) : μ[(f * g : α → ℝ)|m] =ᵐ[μ] f * μ[g|m] := by
have : ∀ (s c) (f : α → ℝ), Set.indicator s (Function.const α c) * f = s.indicator (c • f) := by
intro s c f
ext1 x
by_cases hx : x ∈ s
· simp only [hx, Pi.mul_apply, Set.indicator_of_mem, Pi.smul_apply, Algebra.id.smul_eq_mul,
Function.const_apply]
· simp only [hx, Pi.mul_apply, Set.indicator_of_not_mem, not_false_iff, zero_mul]
apply @SimpleFunc.induction _ _ m _ (fun f => _)
(fun c s hs => ?_) (fun g₁ g₂ _ h_eq₁ h_eq₂ => ?_) f
· -- Porting note: if not classical, `DecidablePred fun x ↦ x ∈ s` cannot be synthesised
-- for `Set.piecewise_eq_indicator`
classical simp only [@SimpleFunc.const_zero _ _ m, @SimpleFunc.coe_piecewise _ _ m,
@SimpleFunc.coe_const _ _ m, @SimpleFunc.coe_zero _ _ m, Set.piecewise_eq_indicator]
rw [this, this]
refine (condexp_indicator (hg.smul c) hs).trans ?_
filter_upwards [condexp_smul (m := m) (m0 := m0) c g] with x hx
classical simp_rw [Set.indicator_apply, hx]
· have h_add := @SimpleFunc.coe_add _ _ m _ g₁ g₂
calc
μ[⇑(g₁ + g₂) * g|m] =ᵐ[μ] μ[(⇑g₁ + ⇑g₂) * g|m] := by
refine condexp_congr_ae (EventuallyEq.mul ?_ EventuallyEq.rfl); rw [h_add]
_ =ᵐ[μ] μ[⇑g₁ * g|m] + μ[⇑g₂ * g|m] := by
rw [add_mul]; exact condexp_add (hg.simpleFunc_mul' hm _) (hg.simpleFunc_mul' hm _)
_ =ᵐ[μ] ⇑g₁ * μ[g|m] + ⇑g₂ * μ[g|m] := EventuallyEq.add h_eq₁ h_eq₂
_ =ᵐ[μ] ⇑(g₁ + g₂) * μ[g|m] := by rw [h_add, add_mul]
theorem condexp_stronglyMeasurable_mul_of_bound (hm : m ≤ m0) [IsFiniteMeasure μ] {f g : α → ℝ}
(hf : StronglyMeasurable[m] f) (hg : Integrable g μ) (c : ℝ) (hf_bound : ∀ᵐ x ∂μ, ‖f x‖ ≤ c) :
μ[f * g|m] =ᵐ[μ] f * μ[g|m] := by
let fs := hf.approxBounded c
have hfs_tendsto : ∀ᵐ x ∂μ, Tendsto (fs · x) atTop (𝓝 (f x)) :=
hf.tendsto_approxBounded_ae hf_bound
by_cases hμ : μ = 0
· simp only [hμ, ae_zero]; norm_cast
have : (ae μ).NeBot := ae_neBot.2 hμ
have hc : 0 ≤ c := by
rcases hf_bound.exists with ⟨_x, hx⟩
exact (norm_nonneg _).trans hx
have hfs_bound : ∀ n x, ‖fs n x‖ ≤ c := hf.norm_approxBounded_le hc
have : μ[f * μ[g|m]|m] = f * μ[g|m] := by
refine condexp_of_stronglyMeasurable hm (hf.mul stronglyMeasurable_condexp) ?_
exact integrable_condexp.bdd_mul' (hf.mono hm).aestronglyMeasurable hf_bound
rw [← this]
refine tendsto_condexp_unique (fun n x => fs n x * g x) (fun n x => fs n x * (μ[g|m]) x) (f * g)
(f * μ[g|m]) ?_ ?_ ?_ ?_ (c * ‖g ·‖) ?_ (c * ‖(μ[g|m]) ·‖) ?_ ?_ ?_ ?_
· exact fun n => hg.bdd_mul' ((SimpleFunc.stronglyMeasurable (fs n)).mono hm).aestronglyMeasurable
(eventually_of_forall (hfs_bound n))
· exact fun n => integrable_condexp.bdd_mul'
((SimpleFunc.stronglyMeasurable (fs n)).mono hm).aestronglyMeasurable
(eventually_of_forall (hfs_bound n))
· filter_upwards [hfs_tendsto] with x hx
exact hx.mul tendsto_const_nhds
· filter_upwards [hfs_tendsto] with x hx
exact hx.mul tendsto_const_nhds
· exact hg.norm.const_mul c
· exact integrable_condexp.norm.const_mul c
· refine fun n => eventually_of_forall fun x => ?_
exact (norm_mul_le _ _).trans (mul_le_mul_of_nonneg_right (hfs_bound n x) (norm_nonneg _))
· refine fun n => eventually_of_forall fun x => ?_
exact (norm_mul_le _ _).trans (mul_le_mul_of_nonneg_right (hfs_bound n x) (norm_nonneg _))
· intro n
simp_rw [← Pi.mul_apply]
refine (condexp_stronglyMeasurable_simpleFunc_mul hm _ hg).trans ?_
rw [condexp_of_stronglyMeasurable hm
((SimpleFunc.stronglyMeasurable _).mul stronglyMeasurable_condexp) _]
exact integrable_condexp.bdd_mul'
((SimpleFunc.stronglyMeasurable (fs n)).mono hm).aestronglyMeasurable
(eventually_of_forall (hfs_bound n))
theorem condexp_stronglyMeasurable_mul_of_bound₀ (hm : m ≤ m0) [IsFiniteMeasure μ] {f g : α → ℝ}
(hf : AEStronglyMeasurable' m f μ) (hg : Integrable g μ) (c : ℝ)
(hf_bound : ∀ᵐ x ∂μ, ‖f x‖ ≤ c) : μ[f * g|m] =ᵐ[μ] f * μ[g|m] := by
have : μ[f * g|m] =ᵐ[μ] μ[hf.mk f * g|m] :=
condexp_congr_ae (EventuallyEq.mul hf.ae_eq_mk EventuallyEq.rfl)
refine this.trans ?_
have : f * μ[g|m] =ᵐ[μ] hf.mk f * μ[g|m] := EventuallyEq.mul hf.ae_eq_mk EventuallyEq.rfl
refine EventuallyEq.trans ?_ this.symm
refine condexp_stronglyMeasurable_mul_of_bound hm hf.stronglyMeasurable_mk hg c ?_
filter_upwards [hf_bound, hf.ae_eq_mk] with x hxc hx_eq
rwa [← hx_eq]
/-- Pull-out property of the conditional expectation. -/
theorem condexp_stronglyMeasurable_mul {f g : α → ℝ} (hf : StronglyMeasurable[m] f)
(hfg : Integrable (f * g) μ) (hg : Integrable g μ) : μ[f * g|m] =ᵐ[μ] f * μ[g|m] := by
by_cases hm : m ≤ m0; swap; · simp_rw [condexp_of_not_le hm]; rw [mul_zero]
by_cases hμm : SigmaFinite (μ.trim hm)
swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rw [mul_zero]
haveI : SigmaFinite (μ.trim hm) := hμm
obtain ⟨sets, sets_prop, h_univ⟩ := hf.exists_spanning_measurableSet_norm_le hm μ
simp_rw [forall_and] at sets_prop
obtain ⟨h_meas, h_finite, h_norm⟩ := sets_prop
suffices ∀ n, ∀ᵐ x ∂μ, x ∈ sets n → (μ[f * g|m]) x = f x * (μ[g|m]) x by
rw [← ae_all_iff] at this
filter_upwards [this] with x hx
obtain ⟨i, hi⟩ : ∃ i, x ∈ sets i := by
have h_mem : x ∈ ⋃ i, sets i := by rw [h_univ]; exact Set.mem_univ _
simpa using h_mem
exact hx i hi
refine fun n => ae_imp_of_ae_restrict ?_
suffices (μ.restrict (sets n))[f * g|m] =ᵐ[μ.restrict (sets n)] f * (μ.restrict (sets n))[g|m] by
refine (condexp_restrict_ae_eq_restrict hm (h_meas n) hfg).symm.trans ?_
exact this.trans (EventuallyEq.rfl.mul (condexp_restrict_ae_eq_restrict hm (h_meas n) hg))
suffices (μ.restrict (sets n))[(sets n).indicator f * g|m] =ᵐ[μ.restrict (sets n)]
(sets n).indicator f * (μ.restrict (sets n))[g|m] by
refine EventuallyEq.trans ?_ (this.trans ?_)
· exact
condexp_congr_ae ((indicator_ae_eq_restrict <| hm _ <| h_meas n).symm.mul EventuallyEq.rfl)
· exact (indicator_ae_eq_restrict <| hm _ <| h_meas n).mul EventuallyEq.rfl
have : IsFiniteMeasure (μ.restrict (sets n)) := by
constructor
rw [Measure.restrict_apply_univ]
exact h_finite n
refine condexp_stronglyMeasurable_mul_of_bound hm (hf.indicator (h_meas n)) hg.integrableOn n ?_
filter_upwards with x
by_cases hxs : x ∈ sets n
· simpa only [hxs, Set.indicator_of_mem] using h_norm n x hxs
· simp only [hxs, Set.indicator_of_not_mem, not_false_iff, _root_.norm_zero, Nat.cast_nonneg]
/-- Pull-out property of the conditional expectation. -/
theorem condexp_stronglyMeasurable_mul₀ {f g : α → ℝ} (hf : AEStronglyMeasurable' m f μ)
(hfg : Integrable (f * g) μ) (hg : Integrable g μ) : μ[f * g|m] =ᵐ[μ] f * μ[g|m] := by
have : μ[f * g|m] =ᵐ[μ] μ[hf.mk f * g|m] :=
condexp_congr_ae (hf.ae_eq_mk.mul EventuallyEq.rfl)
refine this.trans ?_
have : f * μ[g|m] =ᵐ[μ] hf.mk f * μ[g|m] := hf.ae_eq_mk.mul EventuallyEq.rfl
refine (condexp_stronglyMeasurable_mul hf.stronglyMeasurable_mk ?_ hg).trans this.symm
refine (integrable_congr ?_).mp hfg
exact hf.ae_eq_mk.mul EventuallyEq.rfl
end PullOut
end MeasureTheory
|
MeasureTheory\Function\ConditionalExpectation\Unique.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Function.AEEqOfIntegral
import Mathlib.MeasureTheory.Function.ConditionalExpectation.AEMeasurable
/-!
# Uniqueness of the conditional expectation
Two Lp functions `f, g` which are almost everywhere strongly measurable with respect to a σ-algebra
`m` and verify `∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ` for all `m`-measurable sets `s` are equal
almost everywhere. This proves the uniqueness of the conditional expectation, which is not yet
defined in this file but is introduced in
`Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic`.
## Main statements
* `Lp.ae_eq_of_forall_setIntegral_eq'`: two `Lp` functions verifying the equality of integrals
defining the conditional expectation are equal.
* `ae_eq_of_forall_setIntegral_eq_of_sigma_finite'`: two functions verifying the equality of
integrals defining the conditional expectation are equal almost everywhere.
Requires `[SigmaFinite (μ.trim hm)]`.
-/
open scoped ENNReal MeasureTheory
namespace MeasureTheory
variable {α E' F' 𝕜 : Type*} {p : ℝ≥0∞} {m m0 : MeasurableSpace α} {μ : Measure α} [RCLike 𝕜]
-- 𝕜 for ℝ or ℂ
-- E' for an inner product space on which we compute integrals
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E'] [CompleteSpace E'] [NormedSpace ℝ E']
-- F' for integrals on a Lp submodule
[NormedAddCommGroup F']
[NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F']
section UniquenessOfConditionalExpectation
/-! ## Uniqueness of the conditional expectation -/
theorem lpMeas.ae_eq_zero_of_forall_setIntegral_eq_zero (hm : m ≤ m0) (f : lpMeas E' 𝕜 m p μ)
(hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
-- Porting note: needed to add explicit casts in the next two hypotheses
(hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn (f : Lp E' p μ) s μ)
(hf_zero : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, (f : Lp E' p μ) x ∂μ = 0) :
f =ᵐ[μ] (0 : α → E') := by
obtain ⟨g, hg_sm, hfg⟩ := lpMeas.ae_fin_strongly_measurable' hm f hp_ne_zero hp_ne_top
refine hfg.trans ?_
-- Porting note: added
unfold Filter.EventuallyEq at hfg
refine ae_eq_zero_of_forall_setIntegral_eq_of_finStronglyMeasurable_trim hm ?_ ?_ hg_sm
· intro s hs hμs
have hfg_restrict : f =ᵐ[μ.restrict s] g := ae_restrict_of_ae hfg
rw [IntegrableOn, integrable_congr hfg_restrict.symm]
exact hf_int_finite s hs hμs
· intro s hs hμs
have hfg_restrict : f =ᵐ[μ.restrict s] g := ae_restrict_of_ae hfg
rw [integral_congr_ae hfg_restrict.symm]
exact hf_zero s hs hμs
@[deprecated (since := "2024-04-17")]
alias lpMeas.ae_eq_zero_of_forall_set_integral_eq_zero :=
lpMeas.ae_eq_zero_of_forall_setIntegral_eq_zero
variable (𝕜)
theorem Lp.ae_eq_zero_of_forall_setIntegral_eq_zero' (hm : m ≤ m0) (f : Lp E' p μ)
(hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
(hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
(hf_zero : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, f x ∂μ = 0)
(hf_meas : AEStronglyMeasurable' m f μ) : f =ᵐ[μ] 0 := by
let f_meas : lpMeas E' 𝕜 m p μ := ⟨f, hf_meas⟩
-- Porting note: `simp only` does not call `rfl` to try to close the goal. See https://github.com/leanprover-community/mathlib4/issues/5025
have hf_f_meas : f =ᵐ[μ] f_meas := by simp only [Subtype.coe_mk]; rfl
refine hf_f_meas.trans ?_
refine lpMeas.ae_eq_zero_of_forall_setIntegral_eq_zero hm f_meas hp_ne_zero hp_ne_top ?_ ?_
· intro s hs hμs
have hfg_restrict : f =ᵐ[μ.restrict s] f_meas := ae_restrict_of_ae hf_f_meas
rw [IntegrableOn, integrable_congr hfg_restrict.symm]
exact hf_int_finite s hs hμs
· intro s hs hμs
have hfg_restrict : f =ᵐ[μ.restrict s] f_meas := ae_restrict_of_ae hf_f_meas
rw [integral_congr_ae hfg_restrict.symm]
exact hf_zero s hs hμs
@[deprecated (since := "2024-04-17")]
alias Lp.ae_eq_zero_of_forall_set_integral_eq_zero' :=
Lp.ae_eq_zero_of_forall_setIntegral_eq_zero'
/-- **Uniqueness of the conditional expectation** -/
theorem Lp.ae_eq_of_forall_setIntegral_eq' (hm : m ≤ m0) (f g : Lp E' p μ) (hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ∞) (hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
(hg_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn g s μ)
(hfg : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ)
(hf_meas : AEStronglyMeasurable' m f μ) (hg_meas : AEStronglyMeasurable' m g μ) :
f =ᵐ[μ] g := by
suffices h_sub : ⇑(f - g) =ᵐ[μ] 0 by
rw [← sub_ae_eq_zero]; exact (Lp.coeFn_sub f g).symm.trans h_sub
have hfg' : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → (∫ x in s, (f - g) x ∂μ) = 0 := by
intro s hs hμs
rw [integral_congr_ae (ae_restrict_of_ae (Lp.coeFn_sub f g))]
rw [integral_sub' (hf_int_finite s hs hμs) (hg_int_finite s hs hμs)]
exact sub_eq_zero.mpr (hfg s hs hμs)
have hfg_int : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn (⇑(f - g)) s μ := by
intro s hs hμs
rw [IntegrableOn, integrable_congr (ae_restrict_of_ae (Lp.coeFn_sub f g))]
exact (hf_int_finite s hs hμs).sub (hg_int_finite s hs hμs)
have hfg_meas : AEStronglyMeasurable' m (⇑(f - g)) μ :=
AEStronglyMeasurable'.congr (hf_meas.sub hg_meas) (Lp.coeFn_sub f g).symm
exact
Lp.ae_eq_zero_of_forall_setIntegral_eq_zero' 𝕜 hm (f - g) hp_ne_zero hp_ne_top hfg_int hfg'
hfg_meas
@[deprecated (since := "2024-04-17")]
alias Lp.ae_eq_of_forall_set_integral_eq' := Lp.ae_eq_of_forall_setIntegral_eq'
variable {𝕜}
theorem ae_eq_of_forall_setIntegral_eq_of_sigmaFinite' (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
{f g : α → F'} (hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
(hg_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn g s μ)
(hfg_eq : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ)
(hfm : AEStronglyMeasurable' m f μ) (hgm : AEStronglyMeasurable' m g μ) : f =ᵐ[μ] g := by
rw [← ae_eq_trim_iff_of_aeStronglyMeasurable' hm hfm hgm]
have hf_mk_int_finite :
∀ s, MeasurableSet[m] s → μ.trim hm s < ∞ → @IntegrableOn _ _ m _ (hfm.mk f) s (μ.trim hm) := by
intro s hs hμs
rw [trim_measurableSet_eq hm hs] at hμs
-- Porting note: `rw [IntegrableOn]` fails with
-- synthesized type class instance is not definitionally equal to expression inferred by typing
-- rules, synthesized m0 inferred m
unfold IntegrableOn
rw [restrict_trim hm _ hs]
refine Integrable.trim hm ?_ hfm.stronglyMeasurable_mk
exact Integrable.congr (hf_int_finite s hs hμs) (ae_restrict_of_ae hfm.ae_eq_mk)
have hg_mk_int_finite :
∀ s, MeasurableSet[m] s → μ.trim hm s < ∞ → @IntegrableOn _ _ m _ (hgm.mk g) s (μ.trim hm) := by
intro s hs hμs
rw [trim_measurableSet_eq hm hs] at hμs
-- Porting note: `rw [IntegrableOn]` fails with
-- synthesized type class instance is not definitionally equal to expression inferred by typing
-- rules, synthesized m0 inferred m
unfold IntegrableOn
rw [restrict_trim hm _ hs]
refine Integrable.trim hm ?_ hgm.stronglyMeasurable_mk
exact Integrable.congr (hg_int_finite s hs hμs) (ae_restrict_of_ae hgm.ae_eq_mk)
have hfg_mk_eq :
∀ s : Set α,
MeasurableSet[m] s →
μ.trim hm s < ∞ → ∫ x in s, hfm.mk f x ∂μ.trim hm = ∫ x in s, hgm.mk g x ∂μ.trim hm := by
intro s hs hμs
rw [trim_measurableSet_eq hm hs] at hμs
rw [restrict_trim hm _ hs, ← integral_trim hm hfm.stronglyMeasurable_mk, ←
integral_trim hm hgm.stronglyMeasurable_mk,
integral_congr_ae (ae_restrict_of_ae hfm.ae_eq_mk.symm),
integral_congr_ae (ae_restrict_of_ae hgm.ae_eq_mk.symm)]
exact hfg_eq s hs hμs
exact ae_eq_of_forall_setIntegral_eq_of_sigmaFinite hf_mk_int_finite hg_mk_int_finite hfg_mk_eq
@[deprecated (since := "2024-04-17")]
alias ae_eq_of_forall_set_integral_eq_of_sigmaFinite' :=
ae_eq_of_forall_setIntegral_eq_of_sigmaFinite'
end UniquenessOfConditionalExpectation
section IntegralNormLE
variable {s : Set α}
/-- Let `m` be a sub-σ-algebra of `m0`, `f` an `m0`-measurable function and `g` an `m`-measurable
function, such that their integrals coincide on `m`-measurable sets with finite measure.
Then `∫ x in s, ‖g x‖ ∂μ ≤ ∫ x in s, ‖f x‖ ∂μ` on all `m`-measurable sets with finite measure. -/
theorem integral_norm_le_of_forall_fin_meas_integral_eq (hm : m ≤ m0) {f g : α → ℝ}
(hf : StronglyMeasurable f) (hfi : IntegrableOn f s μ) (hg : StronglyMeasurable[m] g)
(hgi : IntegrableOn g s μ)
(hgf : ∀ t, MeasurableSet[m] t → μ t < ∞ → ∫ x in t, g x ∂μ = ∫ x in t, f x ∂μ)
(hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) : (∫ x in s, ‖g x‖ ∂μ) ≤ ∫ x in s, ‖f x‖ ∂μ := by
rw [integral_norm_eq_pos_sub_neg hgi, integral_norm_eq_pos_sub_neg hfi]
have h_meas_nonneg_g : MeasurableSet[m] {x | 0 ≤ g x} :=
(@stronglyMeasurable_const _ _ m _ _).measurableSet_le hg
have h_meas_nonneg_f : MeasurableSet {x | 0 ≤ f x} :=
stronglyMeasurable_const.measurableSet_le hf
have h_meas_nonpos_g : MeasurableSet[m] {x | g x ≤ 0} :=
hg.measurableSet_le (@stronglyMeasurable_const _ _ m _ _)
have h_meas_nonpos_f : MeasurableSet {x | f x ≤ 0} :=
hf.measurableSet_le stronglyMeasurable_const
refine sub_le_sub ?_ ?_
· rw [Measure.restrict_restrict (hm _ h_meas_nonneg_g), Measure.restrict_restrict h_meas_nonneg_f,
hgf _ (@MeasurableSet.inter α m _ _ h_meas_nonneg_g hs)
((measure_mono Set.inter_subset_right).trans_lt (lt_top_iff_ne_top.mpr hμs)),
← Measure.restrict_restrict (hm _ h_meas_nonneg_g), ←
Measure.restrict_restrict h_meas_nonneg_f]
exact setIntegral_le_nonneg (hm _ h_meas_nonneg_g) hf hfi
· rw [Measure.restrict_restrict (hm _ h_meas_nonpos_g), Measure.restrict_restrict h_meas_nonpos_f,
hgf _ (@MeasurableSet.inter α m _ _ h_meas_nonpos_g hs)
((measure_mono Set.inter_subset_right).trans_lt (lt_top_iff_ne_top.mpr hμs)),
← Measure.restrict_restrict (hm _ h_meas_nonpos_g), ←
Measure.restrict_restrict h_meas_nonpos_f]
exact setIntegral_nonpos_le (hm _ h_meas_nonpos_g) hf hfi
/-- Let `m` be a sub-σ-algebra of `m0`, `f` an `m0`-measurable function and `g` an `m`-measurable
function, such that their integrals coincide on `m`-measurable sets with finite measure.
Then `∫⁻ x in s, ‖g x‖₊ ∂μ ≤ ∫⁻ x in s, ‖f x‖₊ ∂μ` on all `m`-measurable sets with finite
measure. -/
theorem lintegral_nnnorm_le_of_forall_fin_meas_integral_eq (hm : m ≤ m0) {f g : α → ℝ}
(hf : StronglyMeasurable f) (hfi : IntegrableOn f s μ) (hg : StronglyMeasurable[m] g)
(hgi : IntegrableOn g s μ)
(hgf : ∀ t, MeasurableSet[m] t → μ t < ∞ → ∫ x in t, g x ∂μ = ∫ x in t, f x ∂μ)
(hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) : (∫⁻ x in s, ‖g x‖₊ ∂μ) ≤ ∫⁻ x in s, ‖f x‖₊ ∂μ := by
rw [← ofReal_integral_norm_eq_lintegral_nnnorm hfi, ←
ofReal_integral_norm_eq_lintegral_nnnorm hgi, ENNReal.ofReal_le_ofReal_iff]
· exact integral_norm_le_of_forall_fin_meas_integral_eq hm hf hfi hg hgi hgf hs hμs
· positivity
end IntegralNormLE
end MeasureTheory
|
MeasureTheory\Function\LpSeminorm\Basic.lean | /-
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
-/
import Mathlib.Analysis.NormedSpace.IndicatorFunction
import Mathlib.MeasureTheory.Function.EssSup
import Mathlib.MeasureTheory.Function.AEEqFun
import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic
/-!
# ℒp space
This file describes properties of almost everywhere strongly measurable functions with finite
`p`-seminorm, denoted by `eLpNorm f p μ` and defined for `p:ℝ≥0∞` as `0` if `p=0`,
`(∫ ‖f a‖^p ∂μ) ^ (1/p)` for `0 < p < ∞` and `essSup ‖f‖ μ` for `p=∞`.
The Prop-valued `Memℒp f p μ` states that a function `f : α → E` has finite `p`-seminorm
and is almost everywhere strongly measurable.
## Main definitions
* `eLpNorm' f p μ` : `(∫ ‖f a‖^p ∂μ) ^ (1/p)` for `f : α → F` and `p : ℝ`, where `α` is a measurable
space and `F` is a normed group.
* `eLpNormEssSup f μ` : seminorm in `ℒ∞`, equal to the essential supremum `essSup ‖f‖ μ`.
* `eLpNorm f p μ` : for `p : ℝ≥0∞`, seminorm in `ℒp`, equal to `0` for `p=0`, to `eLpNorm' f p μ`
for `0 < p < ∞` and to `eLpNormEssSup f μ` for `p = ∞`.
* `Memℒp f p μ` : property that the function `f` is almost everywhere strongly measurable and has
finite `p`-seminorm for the measure `μ` (`eLpNorm f p μ < ∞`)
-/
noncomputable section
open TopologicalSpace MeasureTheory Filter
open scoped NNReal ENNReal Topology
variable {α E F G : Type*} {m m0 : MeasurableSpace α} {p : ℝ≥0∞} {q : ℝ} {μ ν : Measure α}
[NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
namespace MeasureTheory
section ℒp
/-!
### ℒp seminorm
We define the ℒp seminorm, denoted by `eLpNorm f p μ`. For real `p`, it is given by an integral
formula (for which we use the notation `eLpNorm' f p μ`), and for `p = ∞` it is the essential
supremum (for which we use the notation `eLpNormEssSup f μ`).
We also define a predicate `Memℒp f p μ`, requesting that a function is almost everywhere
measurable and has finite `eLpNorm f p μ`.
This paragraph is devoted to the basic properties of these definitions. It is constructed as
follows: for a given property, we prove it for `eLpNorm'` and `eLpNormEssSup` when it makes sense,
deduce it for `eLpNorm`, and translate it in terms of `Memℒp`.
-/
section ℒpSpaceDefinition
/-- `(∫ ‖f a‖^q ∂μ) ^ (1/q)`, which is a seminorm on the space of measurable functions for which
this quantity is finite -/
def eLpNorm' {_ : MeasurableSpace α} (f : α → F) (q : ℝ) (μ : Measure α) : ℝ≥0∞ :=
(∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ q ∂μ) ^ (1 / q)
/-- seminorm for `ℒ∞`, equal to the essential supremum of `‖f‖`. -/
def eLpNormEssSup {_ : MeasurableSpace α} (f : α → F) (μ : Measure α) :=
essSup (fun x => (‖f x‖₊ : ℝ≥0∞)) μ
/-- `ℒp` seminorm, equal to `0` for `p=0`, to `(∫ ‖f a‖^p ∂μ) ^ (1/p)` for `0 < p < ∞` and to
`essSup ‖f‖ μ` for `p = ∞`. -/
def eLpNorm {_ : MeasurableSpace α} (f : α → F) (p : ℝ≥0∞) (μ : Measure α) : ℝ≥0∞ :=
if p = 0 then 0 else if p = ∞ then eLpNormEssSup f μ else eLpNorm' f (ENNReal.toReal p) μ
@[deprecated (since := "2024-07-26")] noncomputable alias snorm := eLpNorm
theorem eLpNorm_eq_eLpNorm' (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) {f : α → F} :
eLpNorm f p μ = eLpNorm' f (ENNReal.toReal p) μ := by simp [eLpNorm, hp_ne_zero, hp_ne_top]
@[deprecated (since := "2024-07-27")] alias snorm_eq_snorm' := eLpNorm_eq_eLpNorm'
lemma eLpNorm_nnreal_eq_eLpNorm' {f : α → F} {p : ℝ≥0} (hp : p ≠ 0) :
eLpNorm f p μ = eLpNorm' f p μ :=
eLpNorm_eq_eLpNorm' (by exact_mod_cast hp) ENNReal.coe_ne_top
@[deprecated (since := "2024-07-27")] alias snorm_nnreal_eq_snorm' := eLpNorm_nnreal_eq_eLpNorm'
theorem eLpNorm_eq_lintegral_rpow_nnnorm (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) {f : α → F} :
eLpNorm f p μ = (∫⁻ x, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) ^ (1 / p.toReal) := by
rw [eLpNorm_eq_eLpNorm' hp_ne_zero hp_ne_top, eLpNorm']
@[deprecated (since := "2024-07-27")]
alias snorm_eq_lintegral_rpow_nnnorm := eLpNorm_eq_lintegral_rpow_nnnorm
lemma eLpNorm_nnreal_eq_lintegral {f : α → F} {p : ℝ≥0} (hp : p ≠ 0) :
eLpNorm f p μ = (∫⁻ x, ‖f x‖₊ ^ (p : ℝ) ∂μ) ^ (1 / (p : ℝ)) :=
eLpNorm_nnreal_eq_eLpNorm' hp
@[deprecated (since := "2024-07-27")] alias snorm_nnreal_eq_lintegral := eLpNorm_nnreal_eq_lintegral
theorem eLpNorm_one_eq_lintegral_nnnorm {f : α → F} : eLpNorm f 1 μ = ∫⁻ x, ‖f x‖₊ ∂μ := by
simp_rw [eLpNorm_eq_lintegral_rpow_nnnorm one_ne_zero ENNReal.coe_ne_top, ENNReal.one_toReal,
one_div_one, ENNReal.rpow_one]
@[deprecated (since := "2024-07-27")]
alias snorm_one_eq_lintegral_nnnorm := eLpNorm_one_eq_lintegral_nnnorm
@[simp]
theorem eLpNorm_exponent_top {f : α → F} : eLpNorm f ∞ μ = eLpNormEssSup f μ := by simp [eLpNorm]
@[deprecated (since := "2024-07-27")]
alias snorm_exponent_top := eLpNorm_exponent_top
/-- The property that `f:α→E` is ae strongly measurable and `(∫ ‖f a‖^p ∂μ)^(1/p)` is finite
if `p < ∞`, or `essSup f < ∞` if `p = ∞`. -/
def Memℒp {α} {_ : MeasurableSpace α} (f : α → E) (p : ℝ≥0∞)
(μ : Measure α := by volume_tac) : Prop :=
AEStronglyMeasurable f μ ∧ eLpNorm f p μ < ∞
theorem Memℒp.aestronglyMeasurable {f : α → E} {p : ℝ≥0∞} (h : Memℒp f p μ) :
AEStronglyMeasurable f μ :=
h.1
theorem lintegral_rpow_nnnorm_eq_rpow_eLpNorm' {f : α → F} (hq0_lt : 0 < q) :
∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ q ∂μ = eLpNorm' f q μ ^ q := by
rw [eLpNorm', ← ENNReal.rpow_mul, one_div, inv_mul_cancel, ENNReal.rpow_one]
exact (ne_of_lt hq0_lt).symm
@[deprecated (since := "2024-07-27")]
alias lintegral_rpow_nnnorm_eq_rpow_snorm' := lintegral_rpow_nnnorm_eq_rpow_eLpNorm'
lemma eLpNorm_nnreal_pow_eq_lintegral {f : α → F} {p : ℝ≥0} (hp : p ≠ 0) :
eLpNorm f p μ ^ (p : ℝ) = ∫⁻ x, ‖f x‖₊ ^ (p : ℝ) ∂μ := by
simp [eLpNorm_eq_eLpNorm' (by exact_mod_cast hp) ENNReal.coe_ne_top,
lintegral_rpow_nnnorm_eq_rpow_eLpNorm' (show 0 < (p : ℝ) from pos_iff_ne_zero.mpr hp)]
@[deprecated (since := "2024-07-27")]
alias snorm_nnreal_pow_eq_lintegral := eLpNorm_nnreal_pow_eq_lintegral
end ℒpSpaceDefinition
section Top
theorem Memℒp.eLpNorm_lt_top {f : α → E} (hfp : Memℒp f p μ) : eLpNorm f p μ < ∞ :=
hfp.2
@[deprecated (since := "2024-07-27")]
alias Memℒp.snorm_lt_top := Memℒp.eLpNorm_lt_top
theorem Memℒp.eLpNorm_ne_top {f : α → E} (hfp : Memℒp f p μ) : eLpNorm f p μ ≠ ∞ :=
ne_of_lt hfp.2
@[deprecated (since := "2024-07-27")]
alias Memℒp.snorm_ne_top := Memℒp.eLpNorm_ne_top
theorem lintegral_rpow_nnnorm_lt_top_of_eLpNorm'_lt_top {f : α → F} (hq0_lt : 0 < q)
(hfq : eLpNorm' f q μ < ∞) : (∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ q ∂μ) < ∞ := by
rw [lintegral_rpow_nnnorm_eq_rpow_eLpNorm' hq0_lt]
exact ENNReal.rpow_lt_top_of_nonneg (le_of_lt hq0_lt) (ne_of_lt hfq)
@[deprecated (since := "2024-07-27")]
alias lintegral_rpow_nnnorm_lt_top_of_snorm'_lt_top :=
lintegral_rpow_nnnorm_lt_top_of_eLpNorm'_lt_top
theorem lintegral_rpow_nnnorm_lt_top_of_eLpNorm_lt_top {f : α → F} (hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ∞) (hfp : eLpNorm f p μ < ∞) : (∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) < ∞ := by
apply lintegral_rpow_nnnorm_lt_top_of_eLpNorm'_lt_top
· exact ENNReal.toReal_pos hp_ne_zero hp_ne_top
· simpa [eLpNorm_eq_eLpNorm' hp_ne_zero hp_ne_top] using hfp
@[deprecated (since := "2024-07-27")]
alias lintegral_rpow_nnnorm_lt_top_of_snorm_lt_top := lintegral_rpow_nnnorm_lt_top_of_eLpNorm_lt_top
theorem eLpNorm_lt_top_iff_lintegral_rpow_nnnorm_lt_top {f : α → F} (hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ∞) : eLpNorm f p μ < ∞ ↔ (∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) < ∞ :=
⟨lintegral_rpow_nnnorm_lt_top_of_eLpNorm_lt_top hp_ne_zero hp_ne_top, by
intro h
have hp' := ENNReal.toReal_pos hp_ne_zero hp_ne_top
have : 0 < 1 / p.toReal := div_pos zero_lt_one hp'
simpa [eLpNorm_eq_lintegral_rpow_nnnorm hp_ne_zero hp_ne_top] using
ENNReal.rpow_lt_top_of_nonneg (le_of_lt this) (ne_of_lt h)⟩
@[deprecated (since := "2024-07-27")]
alias snorm_lt_top_iff_lintegral_rpow_nnnorm_lt_top :=
eLpNorm_lt_top_iff_lintegral_rpow_nnnorm_lt_top
end Top
section Zero
@[simp]
theorem eLpNorm'_exponent_zero {f : α → F} : eLpNorm' f 0 μ = 1 := by
rw [eLpNorm', div_zero, ENNReal.rpow_zero]
@[deprecated (since := "2024-07-27")]
alias snorm'_exponent_zero := eLpNorm'_exponent_zero
@[simp]
theorem eLpNorm_exponent_zero {f : α → F} : eLpNorm f 0 μ = 0 := by simp [eLpNorm]
@[deprecated (since := "2024-07-27")]
alias snorm_exponent_zero := eLpNorm_exponent_zero
@[simp]
theorem memℒp_zero_iff_aestronglyMeasurable {f : α → E} :
Memℒp f 0 μ ↔ AEStronglyMeasurable f μ := by simp [Memℒp, eLpNorm_exponent_zero]
@[simp]
theorem eLpNorm'_zero (hp0_lt : 0 < q) : eLpNorm' (0 : α → F) q μ = 0 := by simp [eLpNorm', hp0_lt]
@[deprecated (since := "2024-07-27")]
alias snorm'_zero := eLpNorm'_zero
@[simp]
theorem eLpNorm'_zero' (hq0_ne : q ≠ 0) (hμ : μ ≠ 0) : eLpNorm' (0 : α → F) q μ = 0 := by
rcases le_or_lt 0 q with hq0 | hq_neg
· exact eLpNorm'_zero (lt_of_le_of_ne hq0 hq0_ne.symm)
· simp [eLpNorm', ENNReal.rpow_eq_zero_iff, hμ, hq_neg]
@[deprecated (since := "2024-07-27")]
alias snorm'_zero' := eLpNorm'_zero'
@[simp]
theorem eLpNormEssSup_zero : eLpNormEssSup (0 : α → F) μ = 0 := by
simp_rw [eLpNormEssSup, Pi.zero_apply, nnnorm_zero, ENNReal.coe_zero, ← ENNReal.bot_eq_zero]
exact essSup_const_bot
@[deprecated (since := "2024-07-27")]
alias snormEssSup_zero := eLpNormEssSup_zero
@[simp]
theorem eLpNorm_zero : eLpNorm (0 : α → F) p μ = 0 := by
by_cases h0 : p = 0
· simp [h0]
by_cases h_top : p = ∞
· simp only [h_top, eLpNorm_exponent_top, eLpNormEssSup_zero]
rw [← Ne] at h0
simp [eLpNorm_eq_eLpNorm' h0 h_top, ENNReal.toReal_pos h0 h_top]
@[deprecated (since := "2024-07-27")]
alias snorm_zero := eLpNorm_zero
@[simp]
theorem eLpNorm_zero' : eLpNorm (fun _ : α => (0 : F)) p μ = 0 := by convert eLpNorm_zero (F := F)
@[deprecated (since := "2024-07-27")]
alias snorm_zero' := eLpNorm_zero'
theorem zero_memℒp : Memℒp (0 : α → E) p μ :=
⟨aestronglyMeasurable_zero, by
rw [eLpNorm_zero]
exact ENNReal.coe_lt_top⟩
theorem zero_mem_ℒp' : Memℒp (fun _ : α => (0 : E)) p μ := zero_memℒp (E := E)
variable [MeasurableSpace α]
theorem eLpNorm'_measure_zero_of_pos {f : α → F} (hq_pos : 0 < q) :
eLpNorm' f q (0 : Measure α) = 0 := by simp [eLpNorm', hq_pos]
@[deprecated (since := "2024-07-27")]
alias snorm'_measure_zero_of_pos := eLpNorm'_measure_zero_of_pos
theorem eLpNorm'_measure_zero_of_exponent_zero {f : α → F} : eLpNorm' f 0 (0 : Measure α) = 1 := by
simp [eLpNorm']
@[deprecated (since := "2024-07-27")]
alias snorm'_measure_zero_of_exponent_zero := eLpNorm'_measure_zero_of_exponent_zero
theorem eLpNorm'_measure_zero_of_neg {f : α → F} (hq_neg : q < 0) :
eLpNorm' f q (0 : Measure α) = ∞ := by simp [eLpNorm', hq_neg]
@[deprecated (since := "2024-07-27")]
alias snorm'_measure_zero_of_neg := eLpNorm'_measure_zero_of_neg
@[simp]
theorem eLpNormEssSup_measure_zero {f : α → F} : eLpNormEssSup f (0 : Measure α) = 0 := by
simp [eLpNormEssSup]
@[deprecated (since := "2024-07-27")]
alias snormEssSup_measure_zero := eLpNormEssSup_measure_zero
@[simp]
theorem eLpNorm_measure_zero {f : α → F} : eLpNorm f p (0 : Measure α) = 0 := by
by_cases h0 : p = 0
· simp [h0]
by_cases h_top : p = ∞
· simp [h_top]
rw [← Ne] at h0
simp [eLpNorm_eq_eLpNorm' h0 h_top, eLpNorm', ENNReal.toReal_pos h0 h_top]
@[deprecated (since := "2024-07-27")]
alias snorm_measure_zero := eLpNorm_measure_zero
end Zero
section Neg
@[simp]
theorem eLpNorm'_neg {f : α → F} : eLpNorm' (-f) q μ = eLpNorm' f q μ := by simp [eLpNorm']
@[deprecated (since := "2024-07-27")]
alias snorm'_neg := eLpNorm'_neg
@[simp]
theorem eLpNorm_neg {f : α → F} : eLpNorm (-f) p μ = eLpNorm f p μ := by
by_cases h0 : p = 0
· simp [h0]
by_cases h_top : p = ∞
· simp [h_top, eLpNormEssSup]
simp [eLpNorm_eq_eLpNorm' h0 h_top]
@[deprecated (since := "2024-07-27")]
alias snorm_neg := eLpNorm_neg
theorem Memℒp.neg {f : α → E} (hf : Memℒp f p μ) : Memℒp (-f) p μ :=
⟨AEStronglyMeasurable.neg hf.1, by simp [hf.right]⟩
theorem memℒp_neg_iff {f : α → E} : Memℒp (-f) p μ ↔ Memℒp f p μ :=
⟨fun h => neg_neg f ▸ h.neg, Memℒp.neg⟩
end Neg
theorem eLpNorm_indicator_eq_restrict {f : α → E} {s : Set α} (hs : MeasurableSet s) :
eLpNorm (s.indicator f) p μ = eLpNorm f p (μ.restrict s) := by
rcases eq_or_ne p ∞ with rfl | hp
· simp only [eLpNorm_exponent_top, eLpNormEssSup,
← ENNReal.essSup_indicator_eq_essSup_restrict hs, ENNReal.coe_indicator,
nnnorm_indicator_eq_indicator_nnnorm]
· rcases eq_or_ne p 0 with rfl | hp₀; · simp
simp only [eLpNorm_eq_lintegral_rpow_nnnorm hp₀ hp, ← lintegral_indicator _ hs,
ENNReal.coe_indicator, nnnorm_indicator_eq_indicator_nnnorm]
congr with x
by_cases hx : x ∈ s <;> simp [ENNReal.toReal_pos, *]
@[deprecated (since := "2024-07-27")]
alias snorm_indicator_eq_restrict := eLpNorm_indicator_eq_restrict
section Const
theorem eLpNorm'_const (c : F) (hq_pos : 0 < q) :
eLpNorm' (fun _ : α => c) q μ = (‖c‖₊ : ℝ≥0∞) * μ Set.univ ^ (1 / q) := by
rw [eLpNorm', lintegral_const, ENNReal.mul_rpow_of_nonneg _ _ (by simp [hq_pos.le] : 0 ≤ 1 / q)]
congr
rw [← ENNReal.rpow_mul]
suffices hq_cancel : q * (1 / q) = 1 by rw [hq_cancel, ENNReal.rpow_one]
rw [one_div, mul_inv_cancel (ne_of_lt hq_pos).symm]
@[deprecated (since := "2024-07-27")]
alias snorm'_const := eLpNorm'_const
theorem eLpNorm'_const' [IsFiniteMeasure μ] (c : F) (hc_ne_zero : c ≠ 0) (hq_ne_zero : q ≠ 0) :
eLpNorm' (fun _ : α => c) q μ = (‖c‖₊ : ℝ≥0∞) * μ Set.univ ^ (1 / q) := by
rw [eLpNorm', lintegral_const, ENNReal.mul_rpow_of_ne_top _ (measure_ne_top μ Set.univ)]
· congr
rw [← ENNReal.rpow_mul]
suffices hp_cancel : q * (1 / q) = 1 by rw [hp_cancel, ENNReal.rpow_one]
rw [one_div, mul_inv_cancel hq_ne_zero]
· rw [Ne, ENNReal.rpow_eq_top_iff, not_or, not_and_or, not_and_or]
constructor
· left
rwa [ENNReal.coe_eq_zero, nnnorm_eq_zero]
· exact Or.inl ENNReal.coe_ne_top
@[deprecated (since := "2024-07-27")]
alias snorm'_const' := eLpNorm'_const'
theorem eLpNormEssSup_const (c : F) (hμ : μ ≠ 0) :
eLpNormEssSup (fun _ : α => c) μ = (‖c‖₊ : ℝ≥0∞) := by rw [eLpNormEssSup, essSup_const _ hμ]
@[deprecated (since := "2024-07-27")]
alias snormEssSup_const := eLpNormEssSup_const
theorem eLpNorm'_const_of_isProbabilityMeasure (c : F) (hq_pos : 0 < q) [IsProbabilityMeasure μ] :
eLpNorm' (fun _ : α => c) q μ = (‖c‖₊ : ℝ≥0∞) := by simp [eLpNorm'_const c hq_pos, measure_univ]
@[deprecated (since := "2024-07-27")]
alias snorm'_const_of_isProbabilityMeasure := eLpNorm'_const_of_isProbabilityMeasure
theorem eLpNorm_const (c : F) (h0 : p ≠ 0) (hμ : μ ≠ 0) :
eLpNorm (fun _ : α => c) p μ = (‖c‖₊ : ℝ≥0∞) * μ Set.univ ^ (1 / ENNReal.toReal p) := by
by_cases h_top : p = ∞
· simp [h_top, eLpNormEssSup_const c hμ]
simp [eLpNorm_eq_eLpNorm' h0 h_top, eLpNorm'_const, ENNReal.toReal_pos h0 h_top]
@[deprecated (since := "2024-07-27")]
alias snorm_const := eLpNorm_const
theorem eLpNorm_const' (c : F) (h0 : p ≠ 0) (h_top : p ≠ ∞) :
eLpNorm (fun _ : α => c) p μ = (‖c‖₊ : ℝ≥0∞) * μ Set.univ ^ (1 / ENNReal.toReal p) := by
simp [eLpNorm_eq_eLpNorm' h0 h_top, eLpNorm'_const, ENNReal.toReal_pos h0 h_top]
@[deprecated (since := "2024-07-27")]
alias snorm_const' := eLpNorm_const'
theorem eLpNorm_const_lt_top_iff {p : ℝ≥0∞} {c : F} (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
eLpNorm (fun _ : α => c) p μ < ∞ ↔ c = 0 ∨ μ Set.univ < ∞ := by
have hp : 0 < p.toReal := ENNReal.toReal_pos hp_ne_zero hp_ne_top
by_cases hμ : μ = 0
· simp only [hμ, Measure.coe_zero, Pi.zero_apply, or_true_iff, ENNReal.zero_lt_top,
eLpNorm_measure_zero]
by_cases hc : c = 0
· simp only [hc, true_or_iff, eq_self_iff_true, ENNReal.zero_lt_top, eLpNorm_zero']
rw [eLpNorm_const' c hp_ne_zero hp_ne_top]
by_cases hμ_top : μ Set.univ = ∞
· simp [hc, hμ_top, hp]
rw [ENNReal.mul_lt_top_iff]
simp only [true_and_iff, one_div, ENNReal.rpow_eq_zero_iff, hμ, false_or_iff, or_false_iff,
ENNReal.coe_lt_top, nnnorm_eq_zero, ENNReal.coe_eq_zero,
MeasureTheory.Measure.measure_univ_eq_zero, hp, inv_lt_zero, hc, and_false_iff, false_and_iff,
inv_pos, or_self_iff, hμ_top, Ne.lt_top hμ_top, iff_true_iff]
exact ENNReal.rpow_lt_top_of_nonneg (inv_nonneg.mpr hp.le) hμ_top
@[deprecated (since := "2024-07-27")]
alias snorm_const_lt_top_iff := eLpNorm_const_lt_top_iff
theorem memℒp_const (c : E) [IsFiniteMeasure μ] : Memℒp (fun _ : α => c) p μ := by
refine ⟨aestronglyMeasurable_const, ?_⟩
by_cases h0 : p = 0
· simp [h0]
by_cases hμ : μ = 0
· simp [hμ]
rw [eLpNorm_const c h0 hμ]
refine ENNReal.mul_lt_top ENNReal.coe_ne_top ?_
refine (ENNReal.rpow_lt_top_of_nonneg ?_ (measure_ne_top μ Set.univ)).ne
simp
theorem memℒp_top_const (c : E) : Memℒp (fun _ : α => c) ∞ μ := by
refine ⟨aestronglyMeasurable_const, ?_⟩
by_cases h : μ = 0
· simp only [h, eLpNorm_measure_zero, ENNReal.zero_lt_top]
· rw [eLpNorm_const _ ENNReal.top_ne_zero h]
simp only [ENNReal.top_toReal, div_zero, ENNReal.rpow_zero, mul_one, ENNReal.coe_lt_top]
theorem memℒp_const_iff {p : ℝ≥0∞} {c : E} (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
Memℒp (fun _ : α => c) p μ ↔ c = 0 ∨ μ Set.univ < ∞ := by
rw [← eLpNorm_const_lt_top_iff hp_ne_zero hp_ne_top]
exact ⟨fun h => h.2, fun h => ⟨aestronglyMeasurable_const, h⟩⟩
end Const
lemma eLpNorm'_mono_nnnorm_ae {f : α → F} {g : α → G} (hq : 0 ≤ q) (h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ ‖g x‖₊) :
eLpNorm' f q μ ≤ eLpNorm' g q μ := by
simp only [eLpNorm']
gcongr ?_ ^ (1/q)
refine lintegral_mono_ae (h.mono fun x hx => ?_)
gcongr
@[deprecated (since := "2024-07-27")]
alias snorm'_mono_nnnorm_ae := eLpNorm'_mono_nnnorm_ae
theorem eLpNorm'_mono_ae {f : α → F} {g : α → G} (hq : 0 ≤ q) (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ ‖g x‖) :
eLpNorm' f q μ ≤ eLpNorm' g q μ :=
eLpNorm'_mono_nnnorm_ae hq h
@[deprecated (since := "2024-07-27")]
alias snorm'_mono_ae := eLpNorm'_mono_ae
theorem eLpNorm'_congr_nnnorm_ae {f g : α → F} (hfg : ∀ᵐ x ∂μ, ‖f x‖₊ = ‖g x‖₊) :
eLpNorm' f q μ = eLpNorm' g q μ := by
have : (fun x => (‖f x‖₊ : ℝ≥0∞) ^ q) =ᵐ[μ] fun x => (‖g x‖₊ : ℝ≥0∞) ^ q :=
hfg.mono fun x hx => by simp_rw [hx]
simp only [eLpNorm', lintegral_congr_ae this]
@[deprecated (since := "2024-07-27")]
alias snorm'_congr_nnnorm_ae := eLpNorm'_congr_nnnorm_ae
theorem eLpNorm'_congr_norm_ae {f g : α → F} (hfg : ∀ᵐ x ∂μ, ‖f x‖ = ‖g x‖) :
eLpNorm' f q μ = eLpNorm' g q μ :=
eLpNorm'_congr_nnnorm_ae <| hfg.mono fun _x hx => NNReal.eq hx
@[deprecated (since := "2024-07-27")]
alias snorm'_congr_norm_ae := eLpNorm'_congr_norm_ae
theorem eLpNorm'_congr_ae {f g : α → F} (hfg : f =ᵐ[μ] g) : eLpNorm' f q μ = eLpNorm' g q μ :=
eLpNorm'_congr_nnnorm_ae (hfg.fun_comp _)
@[deprecated (since := "2024-07-27")]
alias snorm'_congr_ae := eLpNorm'_congr_ae
theorem eLpNormEssSup_congr_ae {f g : α → F} (hfg : f =ᵐ[μ] g) :
eLpNormEssSup f μ = eLpNormEssSup g μ :=
essSup_congr_ae (hfg.fun_comp (((↑) : ℝ≥0 → ℝ≥0∞) ∘ nnnorm))
@[deprecated (since := "2024-07-27")]
alias snormEssSup_congr_ae := eLpNormEssSup_congr_ae
theorem eLpNormEssSup_mono_nnnorm_ae {f g : α → F} (hfg : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ ‖g x‖₊) :
eLpNormEssSup f μ ≤ eLpNormEssSup g μ :=
essSup_mono_ae <| hfg.mono fun _x hx => ENNReal.coe_le_coe.mpr hx
@[deprecated (since := "2024-07-27")]
alias snormEssSup_mono_nnnorm_ae := eLpNormEssSup_mono_nnnorm_ae
theorem eLpNorm_mono_nnnorm_ae {f : α → F} {g : α → G} (h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ ‖g x‖₊) :
eLpNorm f p μ ≤ eLpNorm g p μ := by
simp only [eLpNorm]
split_ifs
· exact le_rfl
· exact essSup_mono_ae (h.mono fun x hx => ENNReal.coe_le_coe.mpr hx)
· exact eLpNorm'_mono_nnnorm_ae ENNReal.toReal_nonneg h
@[deprecated (since := "2024-07-27")]
alias snorm_mono_nnnorm_ae := eLpNorm_mono_nnnorm_ae
theorem eLpNorm_mono_ae {f : α → F} {g : α → G} (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ ‖g x‖) :
eLpNorm f p μ ≤ eLpNorm g p μ :=
eLpNorm_mono_nnnorm_ae h
@[deprecated (since := "2024-07-27")]
alias snorm_mono_ae := eLpNorm_mono_ae
theorem eLpNorm_mono_ae_real {f : α → F} {g : α → ℝ} (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ g x) :
eLpNorm f p μ ≤ eLpNorm g p μ :=
eLpNorm_mono_ae <| h.mono fun _x hx =>
hx.trans ((le_abs_self _).trans (Real.norm_eq_abs _).symm.le)
@[deprecated (since := "2024-07-27")]
alias snorm_mono_ae_real := eLpNorm_mono_ae_real
theorem eLpNorm_mono_nnnorm {f : α → F} {g : α → G} (h : ∀ x, ‖f x‖₊ ≤ ‖g x‖₊) :
eLpNorm f p μ ≤ eLpNorm g p μ :=
eLpNorm_mono_nnnorm_ae (eventually_of_forall fun x => h x)
@[deprecated (since := "2024-07-27")]
alias snorm_mono_nnnorm := eLpNorm_mono_nnnorm
theorem eLpNorm_mono {f : α → F} {g : α → G} (h : ∀ x, ‖f x‖ ≤ ‖g x‖) :
eLpNorm f p μ ≤ eLpNorm g p μ :=
eLpNorm_mono_ae (eventually_of_forall fun x => h x)
@[deprecated (since := "2024-07-27")]
alias snorm_mono := eLpNorm_mono
theorem eLpNorm_mono_real {f : α → F} {g : α → ℝ} (h : ∀ x, ‖f x‖ ≤ g x) :
eLpNorm f p μ ≤ eLpNorm g p μ :=
eLpNorm_mono_ae_real (eventually_of_forall fun x => h x)
@[deprecated (since := "2024-07-27")]
alias snorm_mono_real := eLpNorm_mono_real
theorem eLpNormEssSup_le_of_ae_nnnorm_bound {f : α → F} {C : ℝ≥0} (hfC : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ C) :
eLpNormEssSup f μ ≤ C :=
essSup_le_of_ae_le (C : ℝ≥0∞) <| hfC.mono fun _x hx => ENNReal.coe_le_coe.mpr hx
@[deprecated (since := "2024-07-27")]
alias snormEssSup_le_of_ae_nnnorm_bound := eLpNormEssSup_le_of_ae_nnnorm_bound
theorem eLpNormEssSup_le_of_ae_bound {f : α → F} {C : ℝ} (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) :
eLpNormEssSup f μ ≤ ENNReal.ofReal C :=
eLpNormEssSup_le_of_ae_nnnorm_bound <| hfC.mono fun _x hx => hx.trans C.le_coe_toNNReal
@[deprecated (since := "2024-07-27")]
alias snormEssSup_le_of_ae_bound := eLpNormEssSup_le_of_ae_bound
theorem eLpNormEssSup_lt_top_of_ae_nnnorm_bound {f : α → F} {C : ℝ≥0} (hfC : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ C) :
eLpNormEssSup f μ < ∞ :=
(eLpNormEssSup_le_of_ae_nnnorm_bound hfC).trans_lt ENNReal.coe_lt_top
@[deprecated (since := "2024-07-27")]
alias snormEssSup_lt_top_of_ae_nnnorm_bound := eLpNormEssSup_lt_top_of_ae_nnnorm_bound
theorem eLpNormEssSup_lt_top_of_ae_bound {f : α → F} {C : ℝ} (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) :
eLpNormEssSup f μ < ∞ :=
(eLpNormEssSup_le_of_ae_bound hfC).trans_lt ENNReal.ofReal_lt_top
@[deprecated (since := "2024-07-27")]
alias snormEssSup_lt_top_of_ae_bound := eLpNormEssSup_lt_top_of_ae_bound
theorem eLpNorm_le_of_ae_nnnorm_bound {f : α → F} {C : ℝ≥0} (hfC : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ C) :
eLpNorm f p μ ≤ C • μ Set.univ ^ p.toReal⁻¹ := by
rcases eq_zero_or_neZero μ with rfl | hμ
· simp
by_cases hp : p = 0
· simp [hp]
have : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ ‖(C : ℝ)‖₊ := hfC.mono fun x hx => hx.trans_eq C.nnnorm_eq.symm
refine (eLpNorm_mono_ae this).trans_eq ?_
rw [eLpNorm_const _ hp (NeZero.ne μ), C.nnnorm_eq, one_div, ENNReal.smul_def, smul_eq_mul]
@[deprecated (since := "2024-07-27")]
alias snorm_le_of_ae_nnnorm_bound := eLpNorm_le_of_ae_nnnorm_bound
theorem eLpNorm_le_of_ae_bound {f : α → F} {C : ℝ} (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) :
eLpNorm f p μ ≤ μ Set.univ ^ p.toReal⁻¹ * ENNReal.ofReal C := by
rw [← mul_comm]
exact eLpNorm_le_of_ae_nnnorm_bound (hfC.mono fun x hx => hx.trans C.le_coe_toNNReal)
@[deprecated (since := "2024-07-27")]
alias snorm_le_of_ae_bound := eLpNorm_le_of_ae_bound
theorem eLpNorm_congr_nnnorm_ae {f : α → F} {g : α → G} (hfg : ∀ᵐ x ∂μ, ‖f x‖₊ = ‖g x‖₊) :
eLpNorm f p μ = eLpNorm g p μ :=
le_antisymm (eLpNorm_mono_nnnorm_ae <| EventuallyEq.le hfg)
(eLpNorm_mono_nnnorm_ae <| (EventuallyEq.symm hfg).le)
@[deprecated (since := "2024-07-27")]
alias snorm_congr_nnnorm_ae := eLpNorm_congr_nnnorm_ae
theorem eLpNorm_congr_norm_ae {f : α → F} {g : α → G} (hfg : ∀ᵐ x ∂μ, ‖f x‖ = ‖g x‖) :
eLpNorm f p μ = eLpNorm g p μ :=
eLpNorm_congr_nnnorm_ae <| hfg.mono fun _x hx => NNReal.eq hx
@[deprecated (since := "2024-07-27")]
alias snorm_congr_norm_ae := eLpNorm_congr_norm_ae
open scoped symmDiff in
theorem eLpNorm_indicator_sub_indicator (s t : Set α) (f : α → E) :
eLpNorm (s.indicator f - t.indicator f) p μ = eLpNorm ((s ∆ t).indicator f) p μ :=
eLpNorm_congr_norm_ae <| ae_of_all _ fun x ↦ by
simp only [Pi.sub_apply, Set.apply_indicator_symmDiff norm_neg]
@[deprecated (since := "2024-07-27")]
alias snorm_indicator_sub_indicator := eLpNorm_indicator_sub_indicator
@[simp]
theorem eLpNorm'_norm {f : α → F} :
eLpNorm' (fun a => ‖f a‖) q μ = eLpNorm' f q μ := by simp [eLpNorm']
@[deprecated (since := "2024-07-27")]
alias snorm'_norm := eLpNorm'_norm
@[simp]
theorem eLpNorm_norm (f : α → F) : eLpNorm (fun x => ‖f x‖) p μ = eLpNorm f p μ :=
eLpNorm_congr_norm_ae <| eventually_of_forall fun _ => norm_norm _
@[deprecated (since := "2024-07-27")]
alias snorm_norm := eLpNorm_norm
theorem eLpNorm'_norm_rpow (f : α → F) (p q : ℝ) (hq_pos : 0 < q) :
eLpNorm' (fun x => ‖f x‖ ^ q) p μ = eLpNorm' f (p * q) μ ^ q := by
simp_rw [eLpNorm']
rw [← ENNReal.rpow_mul, ← one_div_mul_one_div]
simp_rw [one_div]
rw [mul_assoc, inv_mul_cancel hq_pos.ne.symm, mul_one]
congr
ext1 x
simp_rw [← ofReal_norm_eq_coe_nnnorm]
rw [Real.norm_eq_abs, abs_eq_self.mpr (Real.rpow_nonneg (norm_nonneg _) _), mul_comm, ←
ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) hq_pos.le, ENNReal.rpow_mul]
@[deprecated (since := "2024-07-27")]
alias snorm'_norm_rpow := eLpNorm'_norm_rpow
theorem eLpNorm_norm_rpow (f : α → F) (hq_pos : 0 < q) :
eLpNorm (fun x => ‖f x‖ ^ q) p μ = eLpNorm f (p * ENNReal.ofReal q) μ ^ q := by
by_cases h0 : p = 0
· simp [h0, ENNReal.zero_rpow_of_pos hq_pos]
by_cases hp_top : p = ∞
· simp only [hp_top, eLpNorm_exponent_top, ENNReal.top_mul', hq_pos.not_le,
ENNReal.ofReal_eq_zero, if_false, eLpNorm_exponent_top, eLpNormEssSup]
have h_rpow :
essSup (fun x : α => (‖‖f x‖ ^ q‖₊ : ℝ≥0∞)) μ =
essSup (fun x : α => (‖f x‖₊ : ℝ≥0∞) ^ q) μ := by
congr
ext1 x
conv_rhs => rw [← nnnorm_norm]
rw [ENNReal.coe_rpow_of_nonneg _ hq_pos.le, ENNReal.coe_inj]
ext
push_cast
rw [Real.norm_rpow_of_nonneg (norm_nonneg _)]
rw [h_rpow]
have h_rpow_mono := ENNReal.strictMono_rpow_of_pos hq_pos
have h_rpow_surj := (ENNReal.rpow_left_bijective hq_pos.ne.symm).2
let iso := h_rpow_mono.orderIsoOfSurjective _ h_rpow_surj
exact (iso.essSup_apply (fun x => (‖f x‖₊ : ℝ≥0∞)) μ).symm
rw [eLpNorm_eq_eLpNorm' h0 hp_top, eLpNorm_eq_eLpNorm' _ _]
swap
· refine mul_ne_zero h0 ?_
rwa [Ne, ENNReal.ofReal_eq_zero, not_le]
swap; · exact ENNReal.mul_ne_top hp_top ENNReal.ofReal_ne_top
rw [ENNReal.toReal_mul, ENNReal.toReal_ofReal hq_pos.le]
exact eLpNorm'_norm_rpow f p.toReal q hq_pos
@[deprecated (since := "2024-07-27")]
alias snorm_norm_rpow := eLpNorm_norm_rpow
theorem eLpNorm_congr_ae {f g : α → F} (hfg : f =ᵐ[μ] g) : eLpNorm f p μ = eLpNorm g p μ :=
eLpNorm_congr_norm_ae <| hfg.mono fun _x hx => hx ▸ rfl
@[deprecated (since := "2024-07-27")]
alias snorm_congr_ae := eLpNorm_congr_ae
theorem memℒp_congr_ae {f g : α → E} (hfg : f =ᵐ[μ] g) : Memℒp f p μ ↔ Memℒp g p μ := by
simp only [Memℒp, eLpNorm_congr_ae hfg, aestronglyMeasurable_congr hfg]
theorem Memℒp.ae_eq {f g : α → E} (hfg : f =ᵐ[μ] g) (hf_Lp : Memℒp f p μ) : Memℒp g p μ :=
(memℒp_congr_ae hfg).1 hf_Lp
theorem Memℒp.of_le {f : α → E} {g : α → F} (hg : Memℒp g p μ) (hf : AEStronglyMeasurable f μ)
(hfg : ∀ᵐ x ∂μ, ‖f x‖ ≤ ‖g x‖) : Memℒp f p μ :=
⟨hf, (eLpNorm_mono_ae hfg).trans_lt hg.eLpNorm_lt_top⟩
alias Memℒp.mono := Memℒp.of_le
theorem Memℒp.mono' {f : α → E} {g : α → ℝ} (hg : Memℒp g p μ) (hf : AEStronglyMeasurable f μ)
(h : ∀ᵐ a ∂μ, ‖f a‖ ≤ g a) : Memℒp f p μ :=
hg.mono hf <| h.mono fun _x hx => le_trans hx (le_abs_self _)
theorem Memℒp.congr_norm {f : α → E} {g : α → F} (hf : Memℒp f p μ) (hg : AEStronglyMeasurable g μ)
(h : ∀ᵐ a ∂μ, ‖f a‖ = ‖g a‖) : Memℒp g p μ :=
hf.mono hg <| EventuallyEq.le <| EventuallyEq.symm h
theorem memℒp_congr_norm {f : α → E} {g : α → F} (hf : AEStronglyMeasurable f μ)
(hg : AEStronglyMeasurable g μ) (h : ∀ᵐ a ∂μ, ‖f a‖ = ‖g a‖) : Memℒp f p μ ↔ Memℒp g p μ :=
⟨fun h2f => h2f.congr_norm hg h, fun h2g => h2g.congr_norm hf <| EventuallyEq.symm h⟩
theorem memℒp_top_of_bound {f : α → E} (hf : AEStronglyMeasurable f μ) (C : ℝ)
(hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : Memℒp f ∞ μ :=
⟨hf, by
rw [eLpNorm_exponent_top]
exact eLpNormEssSup_lt_top_of_ae_bound hfC⟩
theorem Memℒp.of_bound [IsFiniteMeasure μ] {f : α → E} (hf : AEStronglyMeasurable f μ) (C : ℝ)
(hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : Memℒp f p μ :=
(memℒp_const C).of_le hf (hfC.mono fun _x hx => le_trans hx (le_abs_self _))
@[mono]
theorem eLpNorm'_mono_measure (f : α → F) (hμν : ν ≤ μ) (hq : 0 ≤ q) :
eLpNorm' f q ν ≤ eLpNorm' f q μ := by
simp_rw [eLpNorm']
gcongr
exact lintegral_mono' hμν le_rfl
@[deprecated (since := "2024-07-27")]
alias snorm'_mono_measure := eLpNorm'_mono_measure
@[mono]
theorem eLpNormEssSup_mono_measure (f : α → F) (hμν : ν ≪ μ) :
eLpNormEssSup f ν ≤ eLpNormEssSup f μ := by
simp_rw [eLpNormEssSup]
exact essSup_mono_measure hμν
@[deprecated (since := "2024-07-27")]
alias snormEssSup_mono_measure := eLpNormEssSup_mono_measure
@[mono]
theorem eLpNorm_mono_measure (f : α → F) (hμν : ν ≤ μ) : eLpNorm f p ν ≤ eLpNorm f p μ := by
by_cases hp0 : p = 0
· simp [hp0]
by_cases hp_top : p = ∞
· simp [hp_top, eLpNormEssSup_mono_measure f (Measure.absolutelyContinuous_of_le hμν)]
simp_rw [eLpNorm_eq_eLpNorm' hp0 hp_top]
exact eLpNorm'_mono_measure f hμν ENNReal.toReal_nonneg
@[deprecated (since := "2024-07-27")]
alias snorm_mono_measure := eLpNorm_mono_measure
theorem Memℒp.mono_measure {f : α → E} (hμν : ν ≤ μ) (hf : Memℒp f p μ) : Memℒp f p ν :=
⟨hf.1.mono_measure hμν, (eLpNorm_mono_measure f hμν).trans_lt hf.2⟩
lemma eLpNorm_restrict_le (f : α → F) (p : ℝ≥0∞) (μ : Measure α) (s : Set α) :
eLpNorm f p (μ.restrict s) ≤ eLpNorm f p μ :=
eLpNorm_mono_measure f Measure.restrict_le_self
@[deprecated (since := "2024-07-27")]
alias snorm_restrict_le := eLpNorm_restrict_le
/-- For a function `f` with support in `s`, the Lᵖ norms of `f` with respect to `μ` and
`μ.restrict s` are the same. -/
theorem eLpNorm_restrict_eq_of_support_subset {s : Set α} {f : α → F} (hsf : f.support ⊆ s) :
eLpNorm f p (μ.restrict s) = eLpNorm f p μ := by
by_cases hp0 : p = 0
· simp [hp0]
by_cases hp_top : p = ∞
· simp only [hp_top, eLpNorm_exponent_top, eLpNormEssSup]
apply ENNReal.essSup_restrict_eq_of_support_subset
apply Function.support_subset_iff.2 (fun x hx ↦ ?_)
simp only [ne_eq, ENNReal.coe_eq_zero, nnnorm_eq_zero] at hx
exact Function.support_subset_iff.1 hsf x hx
· simp_rw [eLpNorm_eq_eLpNorm' hp0 hp_top, eLpNorm']
congr 1
apply setLIntegral_eq_of_support_subset
have : ¬(p.toReal ≤ 0) := by simpa only [not_le] using ENNReal.toReal_pos hp0 hp_top
simpa [this] using hsf
@[deprecated (since := "2024-07-27")]
alias snorm_restrict_eq_of_support_subset := eLpNorm_restrict_eq_of_support_subset
theorem Memℒp.restrict (s : Set α) {f : α → E} (hf : Memℒp f p μ) : Memℒp f p (μ.restrict s) :=
hf.mono_measure Measure.restrict_le_self
theorem eLpNorm'_smul_measure {p : ℝ} (hp : 0 ≤ p) {f : α → F} (c : ℝ≥0∞) :
eLpNorm' f p (c • μ) = c ^ (1 / p) * eLpNorm' f p μ := by
rw [eLpNorm', lintegral_smul_measure, ENNReal.mul_rpow_of_nonneg, eLpNorm']
simp [hp]
@[deprecated (since := "2024-07-27")]
alias snorm'_smul_measure := eLpNorm'_smul_measure
theorem eLpNormEssSup_smul_measure {f : α → F} {c : ℝ≥0∞} (hc : c ≠ 0) :
eLpNormEssSup f (c • μ) = eLpNormEssSup f μ := by
simp_rw [eLpNormEssSup]
exact essSup_smul_measure hc
@[deprecated (since := "2024-07-27")]
alias snormEssSup_smul_measure := eLpNormEssSup_smul_measure
/-- Use `eLpNorm_smul_measure_of_ne_top` instead. -/
private theorem eLpNorm_smul_measure_of_ne_zero_of_ne_top {p : ℝ≥0∞} (hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ∞) {f : α → F} (c : ℝ≥0∞) :
eLpNorm f p (c • μ) = c ^ (1 / p).toReal • eLpNorm f p μ := by
simp_rw [eLpNorm_eq_eLpNorm' hp_ne_zero hp_ne_top]
rw [eLpNorm'_smul_measure ENNReal.toReal_nonneg]
congr
simp_rw [one_div]
rw [ENNReal.toReal_inv]
@[deprecated (since := "2024-07-27")]
alias snorm_smul_measure_of_ne_zero_of_ne_top := eLpNorm_smul_measure_of_ne_zero_of_ne_top
theorem eLpNorm_smul_measure_of_ne_zero {p : ℝ≥0∞} {f : α → F} {c : ℝ≥0∞} (hc : c ≠ 0) :
eLpNorm f p (c • μ) = c ^ (1 / p).toReal • eLpNorm f p μ := by
by_cases hp0 : p = 0
· simp [hp0]
by_cases hp_top : p = ∞
· simp [hp_top, eLpNormEssSup_smul_measure hc]
exact eLpNorm_smul_measure_of_ne_zero_of_ne_top hp0 hp_top c
@[deprecated (since := "2024-07-27")]
alias snorm_smul_measure_of_ne_zero := eLpNorm_smul_measure_of_ne_zero
theorem eLpNorm_smul_measure_of_ne_top {p : ℝ≥0∞} (hp_ne_top : p ≠ ∞) {f : α → F} (c : ℝ≥0∞) :
eLpNorm f p (c • μ) = c ^ (1 / p).toReal • eLpNorm f p μ := by
by_cases hp0 : p = 0
· simp [hp0]
· exact eLpNorm_smul_measure_of_ne_zero_of_ne_top hp0 hp_ne_top c
@[deprecated (since := "2024-07-27")]
alias snorm_smul_measure_of_ne_top := eLpNorm_smul_measure_of_ne_top
theorem eLpNorm_one_smul_measure {f : α → F} (c : ℝ≥0∞) :
eLpNorm f 1 (c • μ) = c * eLpNorm f 1 μ := by
rw [@eLpNorm_smul_measure_of_ne_top _ _ _ μ _ 1 (@ENNReal.coe_ne_top 1) f c]
simp
@[deprecated (since := "2024-07-27")]
alias snorm_one_smul_measure := eLpNorm_one_smul_measure
theorem Memℒp.of_measure_le_smul {μ' : Measure α} (c : ℝ≥0∞) (hc : c ≠ ∞) (hμ'_le : μ' ≤ c • μ)
{f : α → E} (hf : Memℒp f p μ) : Memℒp 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 ?_ hf.2.ne
simp [hc, hc0]
theorem Memℒp.smul_measure {f : α → E} {c : ℝ≥0∞} (hf : Memℒp f p μ) (hc : c ≠ ∞) :
Memℒp f p (c • μ) :=
hf.of_measure_le_smul c hc le_rfl
theorem eLpNorm_one_add_measure (f : α → F) (μ ν : Measure α) :
eLpNorm f 1 (μ + ν) = eLpNorm f 1 μ + eLpNorm f 1 ν := by
simp_rw [eLpNorm_one_eq_lintegral_nnnorm]
rw [lintegral_add_measure _ μ ν]
@[deprecated (since := "2024-07-27")]
alias snorm_one_add_measure := eLpNorm_one_add_measure
theorem eLpNorm_le_add_measure_right (f : α → F) (μ ν : Measure α) {p : ℝ≥0∞} :
eLpNorm f p μ ≤ eLpNorm f p (μ + ν) :=
eLpNorm_mono_measure f <| Measure.le_add_right <| le_refl _
@[deprecated (since := "2024-07-27")]
alias snorm_le_add_measure_right := eLpNorm_le_add_measure_right
theorem eLpNorm_le_add_measure_left (f : α → F) (μ ν : Measure α) {p : ℝ≥0∞} :
eLpNorm f p ν ≤ eLpNorm f p (μ + ν) :=
eLpNorm_mono_measure f <| Measure.le_add_left <| le_refl _
@[deprecated (since := "2024-07-27")]
alias snorm_le_add_measure_left := eLpNorm_le_add_measure_left
theorem Memℒp.left_of_add_measure {f : α → E} (h : Memℒp f p (μ + ν)) : Memℒp f p μ :=
h.mono_measure <| Measure.le_add_right <| le_refl _
theorem Memℒp.right_of_add_measure {f : α → E} (h : Memℒp f p (μ + ν)) : Memℒp f p ν :=
h.mono_measure <| Measure.le_add_left <| le_refl _
theorem Memℒp.norm {f : α → E} (h : Memℒp f p μ) : Memℒp (fun x => ‖f x‖) p μ :=
h.of_le h.aestronglyMeasurable.norm (eventually_of_forall fun x => by simp)
theorem memℒp_norm_iff {f : α → E} (hf : AEStronglyMeasurable f μ) :
Memℒp (fun x => ‖f x‖) p μ ↔ Memℒp f p μ :=
⟨fun h => ⟨hf, by rw [← eLpNorm_norm]; exact h.2⟩, fun h => h.norm⟩
theorem eLpNorm'_eq_zero_of_ae_zero {f : α → F} (hq0_lt : 0 < q) (hf_zero : f =ᵐ[μ] 0) :
eLpNorm' f q μ = 0 := by rw [eLpNorm'_congr_ae hf_zero, eLpNorm'_zero hq0_lt]
@[deprecated (since := "2024-07-27")]
alias snorm'_eq_zero_of_ae_zero := eLpNorm'_eq_zero_of_ae_zero
theorem eLpNorm'_eq_zero_of_ae_zero' (hq0_ne : q ≠ 0) (hμ : μ ≠ 0) {f : α → F}
(hf_zero : f =ᵐ[μ] 0) :
eLpNorm' f q μ = 0 := by rw [eLpNorm'_congr_ae hf_zero, eLpNorm'_zero' hq0_ne hμ]
@[deprecated (since := "2024-07-27")]
alias snorm'_eq_zero_of_ae_zero' := eLpNorm'_eq_zero_of_ae_zero'
theorem ae_eq_zero_of_eLpNorm'_eq_zero {f : α → E} (hq0 : 0 ≤ q) (hf : AEStronglyMeasurable f μ)
(h : eLpNorm' f q μ = 0) : f =ᵐ[μ] 0 := by
rw [eLpNorm', ENNReal.rpow_eq_zero_iff] at h
cases h with
| inl h =>
rw [lintegral_eq_zero_iff' (hf.ennnorm.pow_const q)] at h
refine h.left.mono fun x hx => ?_
rw [Pi.zero_apply, ENNReal.rpow_eq_zero_iff] at hx
cases hx with
| inl hx =>
cases' hx with hx _
rwa [← ENNReal.coe_zero, ENNReal.coe_inj, nnnorm_eq_zero] at hx
| inr hx =>
exact absurd hx.left ENNReal.coe_ne_top
| inr h =>
exfalso
rw [one_div, inv_lt_zero] at h
exact hq0.not_lt h.right
@[deprecated (since := "2024-07-27")]
alias ae_eq_zero_of_snorm'_eq_zero := ae_eq_zero_of_eLpNorm'_eq_zero
theorem eLpNorm'_eq_zero_iff (hq0_lt : 0 < q) {f : α → E} (hf : AEStronglyMeasurable f μ) :
eLpNorm' f q μ = 0 ↔ f =ᵐ[μ] 0 :=
⟨ae_eq_zero_of_eLpNorm'_eq_zero (le_of_lt hq0_lt) hf, eLpNorm'_eq_zero_of_ae_zero hq0_lt⟩
@[deprecated (since := "2024-07-27")]
alias snorm'_eq_zero_iff := eLpNorm'_eq_zero_iff
theorem coe_nnnorm_ae_le_eLpNormEssSup {_ : MeasurableSpace α} (f : α → F) (μ : Measure α) :
∀ᵐ x ∂μ, (‖f x‖₊ : ℝ≥0∞) ≤ eLpNormEssSup f μ :=
ENNReal.ae_le_essSup fun x => (‖f x‖₊ : ℝ≥0∞)
@[deprecated (since := "2024-07-27")]
alias coe_nnnorm_ae_le_snormEssSup := coe_nnnorm_ae_le_eLpNormEssSup
@[simp]
theorem eLpNormEssSup_eq_zero_iff {f : α → F} : eLpNormEssSup f μ = 0 ↔ f =ᵐ[μ] 0 := by
simp [EventuallyEq, eLpNormEssSup]
@[deprecated (since := "2024-07-27")]
alias snormEssSup_eq_zero_iff := eLpNormEssSup_eq_zero_iff
theorem eLpNorm_eq_zero_iff {f : α → E} (hf : AEStronglyMeasurable f μ) (h0 : p ≠ 0) :
eLpNorm f p μ = 0 ↔ f =ᵐ[μ] 0 := by
by_cases h_top : p = ∞
· rw [h_top, eLpNorm_exponent_top, eLpNormEssSup_eq_zero_iff]
rw [eLpNorm_eq_eLpNorm' h0 h_top]
exact eLpNorm'_eq_zero_iff (ENNReal.toReal_pos h0 h_top) hf
@[deprecated (since := "2024-07-27")]
alias snorm_eq_zero_iff := eLpNorm_eq_zero_iff
theorem ae_le_eLpNormEssSup {f : α → F} : ∀ᵐ y ∂μ, ‖f y‖₊ ≤ eLpNormEssSup f μ :=
ae_le_essSup
@[deprecated (since := "2024-07-27")]
alias ae_le_snormEssSup := ae_le_eLpNormEssSup
theorem meas_eLpNormEssSup_lt {f : α → F} : μ { y | eLpNormEssSup f μ < ‖f y‖₊ } = 0 :=
meas_essSup_lt
@[deprecated (since := "2024-07-27")]
alias meas_snormEssSup_lt := meas_eLpNormEssSup_lt
lemma eLpNormEssSup_piecewise {s : Set α} (f g : α → E) [DecidablePred (· ∈ s)]
(hs : MeasurableSet s) :
eLpNormEssSup (Set.piecewise s f g) μ
= max (eLpNormEssSup f (μ.restrict s)) (eLpNormEssSup g (μ.restrict sᶜ)) := by
simp only [eLpNormEssSup, ← ENNReal.essSup_piecewise hs]
congr with x
by_cases hx : x ∈ s <;> simp [hx]
@[deprecated (since := "2024-07-27")]
alias snormEssSup_piecewise := eLpNormEssSup_piecewise
lemma eLpNorm_top_piecewise {s : Set α} (f g : α → E) [DecidablePred (· ∈ s)]
(hs : MeasurableSet s) :
eLpNorm (Set.piecewise s f g) ∞ μ
= max (eLpNorm f ∞ (μ.restrict s)) (eLpNorm g ∞ (μ.restrict sᶜ)) :=
eLpNormEssSup_piecewise f g hs
@[deprecated (since := "2024-07-27")]
alias snorm_top_piecewise := eLpNorm_top_piecewise
section MapMeasure
variable {β : Type*} {mβ : MeasurableSpace β} {f : α → β} {g : β → E}
theorem eLpNormEssSup_map_measure (hg : AEStronglyMeasurable g (Measure.map f μ))
(hf : AEMeasurable f μ) : eLpNormEssSup g (Measure.map f μ) = eLpNormEssSup (g ∘ f) μ :=
essSup_map_measure hg.ennnorm hf
@[deprecated (since := "2024-07-27")]
alias snormEssSup_map_measure := eLpNormEssSup_map_measure
theorem eLpNorm_map_measure (hg : AEStronglyMeasurable g (Measure.map f μ))
(hf : AEMeasurable f μ) : eLpNorm g p (Measure.map f μ) = eLpNorm (g ∘ f) p μ := by
by_cases hp_zero : p = 0
· simp only [hp_zero, eLpNorm_exponent_zero]
by_cases hp_top : p = ∞
· simp_rw [hp_top, eLpNorm_exponent_top]
exact eLpNormEssSup_map_measure hg hf
simp_rw [eLpNorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
rw [lintegral_map' (hg.ennnorm.pow_const p.toReal) hf]
rfl
@[deprecated (since := "2024-07-27")]
alias snorm_map_measure := eLpNorm_map_measure
theorem memℒp_map_measure_iff (hg : AEStronglyMeasurable g (Measure.map f μ))
(hf : AEMeasurable f μ) : Memℒp g p (Measure.map f μ) ↔ Memℒp (g ∘ f) p μ := by
simp [Memℒp, eLpNorm_map_measure hg hf, hg.comp_aemeasurable hf, hg]
theorem Memℒp.comp_of_map (hg : Memℒp g p (Measure.map f μ)) (hf : AEMeasurable f μ) :
Memℒp (g ∘ f) p μ :=
(memℒp_map_measure_iff hg.aestronglyMeasurable hf).1 hg
theorem eLpNorm_comp_measurePreserving {ν : MeasureTheory.Measure β} (hg : AEStronglyMeasurable g ν)
(hf : MeasurePreserving f μ ν) : eLpNorm (g ∘ f) p μ = eLpNorm g p ν :=
Eq.symm <| hf.map_eq ▸ eLpNorm_map_measure (hf.map_eq ▸ hg) hf.aemeasurable
@[deprecated (since := "2024-07-27")]
alias snorm_comp_measurePreserving := eLpNorm_comp_measurePreserving
theorem AEEqFun.eLpNorm_compMeasurePreserving {ν : MeasureTheory.Measure β} (g : β →ₘ[ν] E)
(hf : MeasurePreserving f μ ν) :
eLpNorm (g.compMeasurePreserving f hf) p μ = eLpNorm g p ν := by
rw [eLpNorm_congr_ae (g.coeFn_compMeasurePreserving _)]
exact eLpNorm_comp_measurePreserving g.aestronglyMeasurable hf
@[deprecated (since := "2024-07-27")]
alias AEEqFun.snorm_compMeasurePreserving := AEEqFun.eLpNorm_compMeasurePreserving
theorem Memℒp.comp_measurePreserving {ν : MeasureTheory.Measure β} (hg : Memℒp g p ν)
(hf : MeasurePreserving f μ ν) : Memℒp (g ∘ f) p μ :=
.comp_of_map (hf.map_eq.symm ▸ hg) hf.aemeasurable
theorem _root_.MeasurableEmbedding.eLpNormEssSup_map_measure {g : β → F}
(hf : MeasurableEmbedding f) : eLpNormEssSup g (Measure.map f μ) = eLpNormEssSup (g ∘ f) μ :=
hf.essSup_map_measure
@[deprecated (since := "2024-07-27")]
alias _root_.MeasurableEmbedding.snormEssSup_map_measure :=
_root_.MeasurableEmbedding.eLpNormEssSup_map_measure
theorem _root_.MeasurableEmbedding.eLpNorm_map_measure {g : β → F} (hf : MeasurableEmbedding f) :
eLpNorm g p (Measure.map f μ) = eLpNorm (g ∘ f) p μ := by
by_cases hp_zero : p = 0
· simp only [hp_zero, eLpNorm_exponent_zero]
by_cases hp : p = ∞
· simp_rw [hp, eLpNorm_exponent_top]
exact hf.essSup_map_measure
· simp_rw [eLpNorm_eq_lintegral_rpow_nnnorm hp_zero hp]
rw [hf.lintegral_map]
rfl
@[deprecated (since := "2024-07-27")]
alias _root_.MeasurableEmbedding.snorm_map_measure := _root_.MeasurableEmbedding.eLpNorm_map_measure
theorem _root_.MeasurableEmbedding.memℒp_map_measure_iff {g : β → F} (hf : MeasurableEmbedding f) :
Memℒp g p (Measure.map f μ) ↔ Memℒp (g ∘ f) p μ := by
simp_rw [Memℒp, hf.aestronglyMeasurable_map_iff, hf.eLpNorm_map_measure]
theorem _root_.MeasurableEquiv.memℒp_map_measure_iff (f : α ≃ᵐ β) {g : β → F} :
Memℒp g p (Measure.map f μ) ↔ Memℒp (g ∘ f) p μ :=
f.measurableEmbedding.memℒp_map_measure_iff
end MapMeasure
section Monotonicity
theorem eLpNorm'_le_nnreal_smul_eLpNorm'_of_ae_le_mul {f : α → F} {g : α → G} {c : ℝ≥0}
(h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊) {p : ℝ} (hp : 0 < p) :
eLpNorm' f p μ ≤ c • eLpNorm' g p μ := by
simp_rw [eLpNorm']
rw [← ENNReal.rpow_le_rpow_iff hp, ENNReal.smul_def, smul_eq_mul,
ENNReal.mul_rpow_of_nonneg _ _ hp.le]
simp_rw [← ENNReal.rpow_mul, one_div, inv_mul_cancel hp.ne.symm, ENNReal.rpow_one,
ENNReal.coe_rpow_of_nonneg _ hp.le, ← lintegral_const_mul' _ _ ENNReal.coe_ne_top, ←
ENNReal.coe_mul]
apply lintegral_mono_ae
simp_rw [ENNReal.coe_le_coe, ← NNReal.mul_rpow, NNReal.rpow_le_rpow_iff hp]
exact h
@[deprecated (since := "2024-07-27")]
alias snorm'_le_nnreal_smul_snorm'_of_ae_le_mul := eLpNorm'_le_nnreal_smul_eLpNorm'_of_ae_le_mul
theorem eLpNormEssSup_le_nnreal_smul_eLpNormEssSup_of_ae_le_mul {f : α → F} {g : α → G} {c : ℝ≥0}
(h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊) : eLpNormEssSup f μ ≤ c • eLpNormEssSup g μ :=
calc
essSup (fun x => (‖f x‖₊ : ℝ≥0∞)) μ ≤ essSup (fun x => (↑(c * ‖g x‖₊) : ℝ≥0∞)) μ :=
essSup_mono_ae <| h.mono fun x hx => ENNReal.coe_le_coe.mpr hx
_ = essSup (fun x => (c * ‖g x‖₊ : ℝ≥0∞)) μ := by simp_rw [ENNReal.coe_mul]
_ = c • essSup (fun x => (‖g x‖₊ : ℝ≥0∞)) μ := ENNReal.essSup_const_mul
@[deprecated (since := "2024-07-27")]
alias snormEssSup_le_nnreal_smul_snormEssSup_of_ae_le_mul :=
eLpNormEssSup_le_nnreal_smul_eLpNormEssSup_of_ae_le_mul
theorem eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul {f : α → F} {g : α → G} {c : ℝ≥0}
(h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊) (p : ℝ≥0∞) : eLpNorm f p μ ≤ c • eLpNorm g p μ := by
by_cases h0 : p = 0
· simp [h0]
by_cases h_top : p = ∞
· rw [h_top]
exact eLpNormEssSup_le_nnreal_smul_eLpNormEssSup_of_ae_le_mul h
simp_rw [eLpNorm_eq_eLpNorm' h0 h_top]
exact eLpNorm'_le_nnreal_smul_eLpNorm'_of_ae_le_mul h (ENNReal.toReal_pos h0 h_top)
@[deprecated (since := "2024-07-27")]
alias snorm_le_nnreal_smul_snorm_of_ae_le_mul := eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul
-- TODO: add the whole family of lemmas?
private theorem le_mul_iff_eq_zero_of_nonneg_of_neg_of_nonneg {α} [LinearOrderedSemiring α]
{a b c : α} (ha : 0 ≤ a) (hb : b < 0) (hc : 0 ≤ c) : a ≤ b * c ↔ a = 0 ∧ c = 0 := by
constructor
· intro h
exact
⟨(h.trans (mul_nonpos_of_nonpos_of_nonneg hb.le hc)).antisymm ha,
(nonpos_of_mul_nonneg_right (ha.trans h) hb).antisymm hc⟩
· rintro ⟨rfl, rfl⟩
rw [mul_zero]
/-- When `c` is negative, `‖f x‖ ≤ c * ‖g x‖` is nonsense and forces both `f` and `g` to have an
`eLpNorm` of `0`. -/
theorem eLpNorm_eq_zero_and_zero_of_ae_le_mul_neg {f : α → F} {g : α → G} {c : ℝ}
(h : ∀ᵐ x ∂μ, ‖f x‖ ≤ c * ‖g x‖) (hc : c < 0) (p : ℝ≥0∞) :
eLpNorm f p μ = 0 ∧ eLpNorm g p μ = 0 := by
simp_rw [le_mul_iff_eq_zero_of_nonneg_of_neg_of_nonneg (norm_nonneg _) hc (norm_nonneg _),
norm_eq_zero, eventually_and] at h
change f =ᵐ[μ] 0 ∧ g =ᵐ[μ] 0 at h
simp [eLpNorm_congr_ae h.1, eLpNorm_congr_ae h.2]
@[deprecated (since := "2024-07-27")]
alias snorm_eq_zero_and_zero_of_ae_le_mul_neg := eLpNorm_eq_zero_and_zero_of_ae_le_mul_neg
theorem eLpNorm_le_mul_eLpNorm_of_ae_le_mul {f : α → F} {g : α → G} {c : ℝ}
(h : ∀ᵐ x ∂μ, ‖f x‖ ≤ c * ‖g x‖) (p : ℝ≥0∞) :
eLpNorm f p μ ≤ ENNReal.ofReal c * eLpNorm g p μ :=
eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul
(h.mono fun _x hx => hx.trans <| mul_le_mul_of_nonneg_right c.le_coe_toNNReal (norm_nonneg _)) _
@[deprecated (since := "2024-07-27")]
alias snorm_le_mul_snorm_of_ae_le_mul := eLpNorm_le_mul_eLpNorm_of_ae_le_mul
theorem Memℒp.of_nnnorm_le_mul {f : α → E} {g : α → F} {c : ℝ≥0} (hg : Memℒp g p μ)
(hf : AEStronglyMeasurable f μ) (hfg : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊) : Memℒp f p μ :=
⟨hf,
(eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul hfg p).trans_lt <|
ENNReal.mul_lt_top ENNReal.coe_ne_top hg.eLpNorm_ne_top⟩
theorem Memℒp.of_le_mul {f : α → E} {g : α → F} {c : ℝ} (hg : Memℒp g p μ)
(hf : AEStronglyMeasurable f μ) (hfg : ∀ᵐ x ∂μ, ‖f x‖ ≤ c * ‖g x‖) : Memℒp f p μ :=
⟨hf,
(eLpNorm_le_mul_eLpNorm_of_ae_le_mul hfg p).trans_lt <|
ENNReal.mul_lt_top ENNReal.ofReal_ne_top hg.eLpNorm_ne_top⟩
end Monotonicity
/-!
### Bounded actions by normed rings
In this section we show inequalities on the norm.
-/
section BoundedSMul
variable {𝕜 : Type*} [NormedRing 𝕜] [MulActionWithZero 𝕜 E] [MulActionWithZero 𝕜 F]
variable [BoundedSMul 𝕜 E] [BoundedSMul 𝕜 F]
theorem eLpNorm'_const_smul_le (c : 𝕜) (f : α → F) (hq_pos : 0 < q) :
eLpNorm' (c • f) q μ ≤ ‖c‖₊ • eLpNorm' f q μ :=
eLpNorm'_le_nnreal_smul_eLpNorm'_of_ae_le_mul (eventually_of_forall fun _ => nnnorm_smul_le _ _)
hq_pos
@[deprecated (since := "2024-07-27")]
alias snorm'_const_smul_le := eLpNorm'_const_smul_le
theorem eLpNormEssSup_const_smul_le (c : 𝕜) (f : α → F) :
eLpNormEssSup (c • f) μ ≤ ‖c‖₊ • eLpNormEssSup f μ :=
eLpNormEssSup_le_nnreal_smul_eLpNormEssSup_of_ae_le_mul
(eventually_of_forall fun _ => by simp [nnnorm_smul_le])
@[deprecated (since := "2024-07-27")]
alias snormEssSup_const_smul_le := eLpNormEssSup_const_smul_le
theorem eLpNorm_const_smul_le (c : 𝕜) (f : α → F) : eLpNorm (c • f) p μ ≤ ‖c‖₊ • eLpNorm f p μ :=
eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul
(eventually_of_forall fun _ => by simp [nnnorm_smul_le]) _
@[deprecated (since := "2024-07-27")]
alias snorm_const_smul_le := eLpNorm_const_smul_le
theorem Memℒp.const_smul {f : α → E} (hf : Memℒp f p μ) (c : 𝕜) : Memℒp (c • f) p μ :=
⟨AEStronglyMeasurable.const_smul hf.1 c,
(eLpNorm_const_smul_le c f).trans_lt (ENNReal.mul_lt_top ENNReal.coe_ne_top hf.2.ne)⟩
theorem Memℒp.const_mul {R} [NormedRing R] {f : α → R} (hf : Memℒp f p μ) (c : R) :
Memℒp (fun x => c * f x) p μ :=
hf.const_smul c
end BoundedSMul
/-!
### Bounded actions by normed division rings
The inequalities in the previous section are now tight.
-/
section NormedSpace
variable {𝕜 : Type*} [NormedDivisionRing 𝕜] [MulActionWithZero 𝕜 E] [Module 𝕜 F]
variable [BoundedSMul 𝕜 E] [BoundedSMul 𝕜 F]
theorem eLpNorm'_const_smul {f : α → F} (c : 𝕜) (hq_pos : 0 < q) :
eLpNorm' (c • f) q μ = ‖c‖₊ • eLpNorm' f q μ := by
obtain rfl | hc := eq_or_ne c 0
· simp [eLpNorm', hq_pos]
refine le_antisymm (eLpNorm'_const_smul_le _ _ hq_pos) ?_
have : eLpNorm' _ q μ ≤ _ := eLpNorm'_const_smul_le c⁻¹ (c • f) hq_pos
rwa [inv_smul_smul₀ hc, nnnorm_inv, le_inv_smul_iff_of_pos (nnnorm_pos.2 hc)] at this
@[deprecated (since := "2024-07-27")]
alias snorm'_const_smul := eLpNorm'_const_smul
theorem eLpNormEssSup_const_smul (c : 𝕜) (f : α → F) :
eLpNormEssSup (c • f) μ = (‖c‖₊ : ℝ≥0∞) * eLpNormEssSup f μ := by
simp_rw [eLpNormEssSup, Pi.smul_apply, nnnorm_smul, ENNReal.coe_mul, ENNReal.essSup_const_mul]
@[deprecated (since := "2024-07-27")]
alias snormEssSup_const_smul := eLpNormEssSup_const_smul
theorem eLpNorm_const_smul (c : 𝕜) (f : α → F) :
eLpNorm (c • f) p μ = (‖c‖₊ : ℝ≥0∞) * eLpNorm f p μ := by
obtain rfl | hc := eq_or_ne c 0
· simp
refine le_antisymm (eLpNorm_const_smul_le _ _) ?_
have : eLpNorm _ p μ ≤ _ := eLpNorm_const_smul_le c⁻¹ (c • f)
rwa [inv_smul_smul₀ hc, nnnorm_inv, le_inv_smul_iff_of_pos (nnnorm_pos.2 hc)] at this
@[deprecated (since := "2024-07-27")]
alias snorm_const_smul := eLpNorm_const_smul
end NormedSpace
theorem le_eLpNorm_of_bddBelow (hp : p ≠ 0) (hp' : p ≠ ∞) {f : α → F} (C : ℝ≥0) {s : Set α}
(hs : MeasurableSet s) (hf : ∀ᵐ x ∂μ, x ∈ s → C ≤ ‖f x‖₊) :
C • μ s ^ (1 / p.toReal) ≤ eLpNorm f p μ := by
rw [ENNReal.smul_def, smul_eq_mul, eLpNorm_eq_lintegral_rpow_nnnorm hp hp',
one_div, ENNReal.le_rpow_inv_iff (ENNReal.toReal_pos hp hp'),
ENNReal.mul_rpow_of_nonneg _ _ ENNReal.toReal_nonneg, ← ENNReal.rpow_mul,
inv_mul_cancel (ENNReal.toReal_pos hp hp').ne.symm, ENNReal.rpow_one, ← setLIntegral_const,
← lintegral_indicator _ hs]
refine lintegral_mono_ae ?_
filter_upwards [hf] with x hx
by_cases hxs : x ∈ s
· simp only [Set.indicator_of_mem hxs] at hx ⊢
gcongr
exact hx hxs
· simp [Set.indicator_of_not_mem hxs]
@[deprecated (since := "2024-07-27")]
alias le_snorm_of_bddBelow := le_eLpNorm_of_bddBelow
@[deprecated (since := "2024-06-26")]
alias snorm_indicator_ge_of_bdd_below := le_snorm_of_bddBelow
section RCLike
variable {𝕜 : Type*} [RCLike 𝕜] {f : α → 𝕜}
theorem Memℒp.re (hf : Memℒp f p μ) : Memℒp (fun x => RCLike.re (f x)) p μ := by
have : ∀ x, ‖RCLike.re (f x)‖ ≤ 1 * ‖f x‖ := by
intro x
rw [one_mul]
exact RCLike.norm_re_le_norm (f x)
refine hf.of_le_mul ?_ (eventually_of_forall this)
exact RCLike.continuous_re.comp_aestronglyMeasurable hf.1
theorem Memℒp.im (hf : Memℒp f p μ) : Memℒp (fun x => RCLike.im (f x)) p μ := by
have : ∀ x, ‖RCLike.im (f x)‖ ≤ 1 * ‖f x‖ := by
intro x
rw [one_mul]
exact RCLike.norm_im_le_norm (f x)
refine hf.of_le_mul ?_ (eventually_of_forall this)
exact RCLike.continuous_im.comp_aestronglyMeasurable hf.1
end RCLike
section Liminf
variable [MeasurableSpace E] [OpensMeasurableSpace E] {R : ℝ≥0}
theorem ae_bdd_liminf_atTop_rpow_of_eLpNorm_bdd {p : ℝ≥0∞} {f : ℕ → α → E}
(hfmeas : ∀ n, Measurable (f n)) (hbdd : ∀ n, eLpNorm (f n) p μ ≤ R) :
∀ᵐ x ∂μ, liminf (fun n => ((‖f n x‖₊ : ℝ≥0∞) ^ p.toReal : ℝ≥0∞)) atTop < ∞ := by
by_cases hp0 : p.toReal = 0
· simp only [hp0, ENNReal.rpow_zero]
filter_upwards with _
rw [liminf_const (1 : ℝ≥0∞)]
exact ENNReal.one_lt_top
have hp : p ≠ 0 := fun h => by simp [h] at hp0
have hp' : p ≠ ∞ := fun h => by simp [h] at hp0
refine
ae_lt_top (measurable_liminf fun n => (hfmeas n).nnnorm.coe_nnreal_ennreal.pow_const p.toReal)
(lt_of_le_of_lt
(lintegral_liminf_le fun n => (hfmeas n).nnnorm.coe_nnreal_ennreal.pow_const p.toReal)
(lt_of_le_of_lt ?_
(ENNReal.rpow_lt_top_of_nonneg ENNReal.toReal_nonneg ENNReal.coe_ne_top :
(R : ℝ≥0∞) ^ p.toReal < ∞))).ne
simp_rw [eLpNorm_eq_lintegral_rpow_nnnorm hp hp', one_div] at hbdd
simp_rw [liminf_eq, eventually_atTop]
exact
sSup_le fun b ⟨a, ha⟩ =>
(ha a le_rfl).trans ((ENNReal.rpow_inv_le_iff (ENNReal.toReal_pos hp hp')).1 (hbdd _))
@[deprecated (since := "2024-07-27")]
alias ae_bdd_liminf_atTop_rpow_of_snorm_bdd := ae_bdd_liminf_atTop_rpow_of_eLpNorm_bdd
theorem ae_bdd_liminf_atTop_of_eLpNorm_bdd {p : ℝ≥0∞} (hp : p ≠ 0) {f : ℕ → α → E}
(hfmeas : ∀ n, Measurable (f n)) (hbdd : ∀ n, eLpNorm (f n) p μ ≤ R) :
∀ᵐ x ∂μ, liminf (fun n => (‖f n x‖₊ : ℝ≥0∞)) atTop < ∞ := by
by_cases hp' : p = ∞
· subst hp'
simp_rw [eLpNorm_exponent_top] at hbdd
have : ∀ n, ∀ᵐ x ∂μ, (‖f n x‖₊ : ℝ≥0∞) < R + 1 := fun n =>
ae_lt_of_essSup_lt
(lt_of_le_of_lt (hbdd n) <| ENNReal.lt_add_right ENNReal.coe_ne_top one_ne_zero)
rw [← ae_all_iff] at this
filter_upwards [this] with x hx using lt_of_le_of_lt
(liminf_le_of_frequently_le' <| frequently_of_forall fun n => (hx n).le)
(ENNReal.add_lt_top.2 ⟨ENNReal.coe_lt_top, ENNReal.one_lt_top⟩)
filter_upwards [ae_bdd_liminf_atTop_rpow_of_eLpNorm_bdd hfmeas hbdd] with x hx
have hppos : 0 < p.toReal := ENNReal.toReal_pos hp hp'
have :
liminf (fun n => (‖f n x‖₊ : ℝ≥0∞) ^ p.toReal) atTop =
liminf (fun n => (‖f n x‖₊ : ℝ≥0∞)) atTop ^ p.toReal := by
change
liminf (fun n => ENNReal.orderIsoRpow p.toReal hppos (‖f n x‖₊ : ℝ≥0∞)) atTop =
ENNReal.orderIsoRpow p.toReal hppos (liminf (fun n => (‖f n x‖₊ : ℝ≥0∞)) atTop)
refine (OrderIso.liminf_apply (ENNReal.orderIsoRpow p.toReal _) ?_ ?_ ?_ ?_).symm <;>
isBoundedDefault
rw [this] at hx
rw [← ENNReal.rpow_one (liminf (fun n => ‖f n x‖₊) atTop), ← mul_inv_cancel hppos.ne.symm,
ENNReal.rpow_mul]
exact ENNReal.rpow_lt_top_of_nonneg (inv_nonneg.2 hppos.le) hx.ne
@[deprecated (since := "2024-07-27")]
alias ae_bdd_liminf_atTop_of_snorm_bdd := ae_bdd_liminf_atTop_of_eLpNorm_bdd
end Liminf
/-- A continuous function with compact support belongs to `L^∞`.
See `Continuous.memℒp_of_hasCompactSupport` for a version for `L^p`. -/
theorem _root_.Continuous.memℒp_top_of_hasCompactSupport
{X : Type*} [TopologicalSpace X] [MeasurableSpace X] [OpensMeasurableSpace X]
{f : X → E} (hf : Continuous f) (h'f : HasCompactSupport f) (μ : Measure X) : Memℒp f ⊤ μ := by
borelize E
rcases hf.bounded_above_of_compact_support h'f with ⟨C, hC⟩
apply memℒp_top_of_bound ?_ C (Filter.eventually_of_forall hC)
exact (hf.stronglyMeasurable_of_hasCompactSupport h'f).aestronglyMeasurable
section UnifTight
/-- A single function that is `Memℒp f p μ` is tight with respect to `μ`. -/
theorem Memℒp.exists_eLpNorm_indicator_compl_lt {β : Type*} [NormedAddCommGroup β] (hp_top : p ≠ ∞)
{f : α → β} (hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ s : Set α, MeasurableSet s ∧ μ s < ∞ ∧ eLpNorm (sᶜ.indicator f) p μ < ε := by
rcases eq_or_ne p 0 with rfl | hp₀
· use ∅; simp [pos_iff_ne_zero.2 hε] -- first take care of `p = 0`
· obtain ⟨s, hsm, hs, hε⟩ :
∃ s, MeasurableSet s ∧ μ s < ∞ ∧ ∫⁻ a in sᶜ, (‖f a‖₊) ^ p.toReal ∂μ < ε ^ p.toReal := by
apply exists_setLintegral_compl_lt
· exact ((eLpNorm_lt_top_iff_lintegral_rpow_nnnorm_lt_top hp₀ hp_top).1 hf.2).ne
· simp [*]
refine ⟨s, hsm, hs, ?_⟩
rwa [eLpNorm_indicator_eq_restrict hsm.compl, eLpNorm_eq_lintegral_rpow_nnnorm hp₀ hp_top,
one_div, ENNReal.rpow_inv_lt_iff]
simp [ENNReal.toReal_pos, *]
@[deprecated (since := "2024-07-27")]
alias Memℒp.exists_snorm_indicator_compl_lt := Memℒp.exists_eLpNorm_indicator_compl_lt
end UnifTight
end ℒp
end MeasureTheory
|
MeasureTheory\Function\LpSeminorm\ChebyshevMarkov.lean | /-
Copyright (c) 2022 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying
-/
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic
/-!
# Chebyshev-Markov inequality in terms of Lp seminorms
In this file we formulate several versions of the Chebyshev-Markov inequality
in terms of the `MeasureTheory.eLpNorm` seminorm.
-/
open scoped ENNReal
namespace MeasureTheory
variable {α E : Type*} {m0 : MeasurableSpace α} [NormedAddCommGroup E]
{p : ℝ≥0∞} (μ : Measure α) {f : α → E}
theorem pow_mul_meas_ge_le_eLpNorm (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
(hf : AEStronglyMeasurable f μ) (ε : ℝ≥0∞) :
(ε * μ { x | ε ≤ (‖f x‖₊ : ℝ≥0∞) ^ p.toReal }) ^ (1 / p.toReal) ≤ eLpNorm f p μ := by
rw [eLpNorm_eq_lintegral_rpow_nnnorm hp_ne_zero hp_ne_top]
gcongr
exact mul_meas_ge_le_lintegral₀ (hf.ennnorm.pow_const _) ε
@[deprecated (since := "2024-07-27")]
alias pow_mul_meas_ge_le_snorm := pow_mul_meas_ge_le_eLpNorm
theorem mul_meas_ge_le_pow_eLpNorm (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
(hf : AEStronglyMeasurable f μ) (ε : ℝ≥0∞) :
ε * μ { x | ε ≤ (‖f x‖₊ : ℝ≥0∞) ^ p.toReal } ≤ eLpNorm f p μ ^ p.toReal := by
have : 1 / p.toReal * p.toReal = 1 := by
refine one_div_mul_cancel ?_
rw [Ne, ENNReal.toReal_eq_zero_iff]
exact not_or_of_not hp_ne_zero hp_ne_top
rw [← ENNReal.rpow_one (ε * μ { x | ε ≤ (‖f x‖₊ : ℝ≥0∞) ^ p.toReal }), ← this, ENNReal.rpow_mul]
gcongr
exact pow_mul_meas_ge_le_eLpNorm μ hp_ne_zero hp_ne_top hf ε
@[deprecated (since := "2024-07-27")]
alias mul_meas_ge_le_pow_snorm := mul_meas_ge_le_pow_eLpNorm
/-- A version of Chebyshev-Markov's inequality using Lp-norms. -/
theorem mul_meas_ge_le_pow_eLpNorm' (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
(hf : AEStronglyMeasurable f μ) (ε : ℝ≥0∞) :
ε ^ p.toReal * μ { x | ε ≤ ‖f x‖₊ } ≤ eLpNorm f p μ ^ p.toReal := by
convert mul_meas_ge_le_pow_eLpNorm μ hp_ne_zero hp_ne_top hf (ε ^ p.toReal) using 4
ext x
rw [ENNReal.rpow_le_rpow_iff (ENNReal.toReal_pos hp_ne_zero hp_ne_top)]
@[deprecated (since := "2024-07-27")]
alias mul_meas_ge_le_pow_snorm' := mul_meas_ge_le_pow_eLpNorm'
theorem meas_ge_le_mul_pow_eLpNorm (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
(hf : AEStronglyMeasurable f μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
μ { x | ε ≤ ‖f x‖₊ } ≤ ε⁻¹ ^ p.toReal * eLpNorm f p μ ^ p.toReal := by
by_cases h : ε = ∞
· simp [h]
have hεpow : ε ^ p.toReal ≠ 0 := (ENNReal.rpow_pos (pos_iff_ne_zero.2 hε) h).ne.symm
have hεpow' : ε ^ p.toReal ≠ ∞ := ENNReal.rpow_ne_top_of_nonneg ENNReal.toReal_nonneg h
rw [ENNReal.inv_rpow, ← ENNReal.mul_le_mul_left hεpow hεpow', ← mul_assoc,
ENNReal.mul_inv_cancel hεpow hεpow', one_mul]
exact mul_meas_ge_le_pow_eLpNorm' μ hp_ne_zero hp_ne_top hf ε
@[deprecated (since := "2024-07-27")]
alias meas_ge_le_mul_pow_snorm := meas_ge_le_mul_pow_eLpNorm
end MeasureTheory
|
MeasureTheory\Function\LpSeminorm\CompareExp.lean | /-
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, Eric Wieser
-/
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic
import Mathlib.MeasureTheory.Integral.MeanInequalities
/-!
# Compare Lp seminorms for different values of `p`
In this file we compare `MeasureTheory.eLpNorm'` and `MeasureTheory.eLpNorm` for different
exponents.
-/
open Filter
open scoped ENNReal Topology
namespace MeasureTheory
section SameSpace
variable {α E : Type*} {m : MeasurableSpace α} [NormedAddCommGroup E] {μ : Measure α} {f : α → E}
theorem eLpNorm'_le_eLpNorm'_mul_rpow_measure_univ {p q : ℝ} (hp0_lt : 0 < p) (hpq : p ≤ q)
(hf : AEStronglyMeasurable f μ) :
eLpNorm' f p μ ≤ eLpNorm' f q μ * μ Set.univ ^ (1 / p - 1 / q) := by
have hq0_lt : 0 < q := lt_of_lt_of_le hp0_lt hpq
by_cases hpq_eq : p = q
· rw [hpq_eq, sub_self, ENNReal.rpow_zero, mul_one]
have hpq : p < q := lt_of_le_of_ne hpq hpq_eq
let g := fun _ : α => (1 : ℝ≥0∞)
have h_rw : (∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ p ∂μ) = ∫⁻ a, ((‖f a‖₊ : ℝ≥0∞) * g a) ^ p ∂μ :=
lintegral_congr fun a => by simp [g]
repeat' rw [eLpNorm']
rw [h_rw]
let r := p * q / (q - p)
have hpqr : 1 / p = 1 / q + 1 / r := by field_simp [r, hp0_lt.ne', hq0_lt.ne']
calc
(∫⁻ a : α, (↑‖f a‖₊ * g a) ^ p ∂μ) ^ (1 / p) ≤
(∫⁻ a : α, ↑‖f a‖₊ ^ q ∂μ) ^ (1 / q) * (∫⁻ a : α, g a ^ r ∂μ) ^ (1 / r) :=
ENNReal.lintegral_Lp_mul_le_Lq_mul_Lr hp0_lt hpq hpqr μ hf.ennnorm aemeasurable_const
_ = (∫⁻ a : α, ↑‖f a‖₊ ^ q ∂μ) ^ (1 / q) * μ Set.univ ^ (1 / p - 1 / q) := by
rw [hpqr]; simp [r, g]
@[deprecated (since := "2024-07-27")]
alias snorm'_le_snorm'_mul_rpow_measure_univ := eLpNorm'_le_eLpNorm'_mul_rpow_measure_univ
theorem eLpNorm'_le_eLpNormEssSup_mul_rpow_measure_univ {q : ℝ} (hq_pos : 0 < q) :
eLpNorm' f q μ ≤ eLpNormEssSup f μ * μ Set.univ ^ (1 / q) := by
have h_le : (∫⁻ a : α, (‖f a‖₊ : ℝ≥0∞) ^ q ∂μ) ≤ ∫⁻ _ : α, eLpNormEssSup f μ ^ q ∂μ := by
refine lintegral_mono_ae ?_
have h_nnnorm_le_eLpNorm_ess_sup := coe_nnnorm_ae_le_eLpNormEssSup f μ
exact h_nnnorm_le_eLpNorm_ess_sup.mono fun x hx => by gcongr
rw [eLpNorm', ← ENNReal.rpow_one (eLpNormEssSup f μ)]
nth_rw 2 [← mul_inv_cancel (ne_of_lt hq_pos).symm]
rw [ENNReal.rpow_mul, one_div, ← ENNReal.mul_rpow_of_nonneg _ _ (by simp [hq_pos.le] : 0 ≤ q⁻¹)]
gcongr
rwa [lintegral_const] at h_le
@[deprecated (since := "2024-07-27")]
alias snorm'_le_snormEssSup_mul_rpow_measure_univ := eLpNorm'_le_eLpNormEssSup_mul_rpow_measure_univ
theorem eLpNorm_le_eLpNorm_mul_rpow_measure_univ {p q : ℝ≥0∞} (hpq : p ≤ q)
(hf : AEStronglyMeasurable f μ) :
eLpNorm f p μ ≤ eLpNorm f q μ * μ Set.univ ^ (1 / p.toReal - 1 / q.toReal) := by
by_cases hp0 : p = 0
· simp [hp0, zero_le]
rw [← Ne] at hp0
have hp0_lt : 0 < p := lt_of_le_of_ne (zero_le _) hp0.symm
have hq0_lt : 0 < q := lt_of_lt_of_le hp0_lt hpq
by_cases hq_top : q = ∞
· simp only [hq_top, _root_.div_zero, one_div, ENNReal.top_toReal, sub_zero, eLpNorm_exponent_top,
GroupWithZero.inv_zero]
by_cases hp_top : p = ∞
· simp only [hp_top, ENNReal.rpow_zero, mul_one, ENNReal.top_toReal, sub_zero,
GroupWithZero.inv_zero, eLpNorm_exponent_top]
exact le_rfl
rw [eLpNorm_eq_eLpNorm' hp0 hp_top]
have hp_pos : 0 < p.toReal := ENNReal.toReal_pos hp0_lt.ne' hp_top
refine (eLpNorm'_le_eLpNormEssSup_mul_rpow_measure_univ hp_pos).trans (le_of_eq ?_)
congr
exact one_div _
have hp_lt_top : p < ∞ := hpq.trans_lt (lt_top_iff_ne_top.mpr hq_top)
have hp_pos : 0 < p.toReal := ENNReal.toReal_pos hp0_lt.ne' hp_lt_top.ne
rw [eLpNorm_eq_eLpNorm' hp0_lt.ne.symm hp_lt_top.ne, eLpNorm_eq_eLpNorm' hq0_lt.ne.symm hq_top]
have hpq_real : p.toReal ≤ q.toReal := by rwa [ENNReal.toReal_le_toReal hp_lt_top.ne hq_top]
exact eLpNorm'_le_eLpNorm'_mul_rpow_measure_univ hp_pos hpq_real hf
@[deprecated (since := "2024-07-27")]
alias snorm_le_snorm_mul_rpow_measure_univ := eLpNorm_le_eLpNorm_mul_rpow_measure_univ
theorem eLpNorm'_le_eLpNorm'_of_exponent_le {p q : ℝ} (hp0_lt : 0 < p)
(hpq : p ≤ q) (μ : Measure α) [IsProbabilityMeasure μ] (hf : AEStronglyMeasurable f μ) :
eLpNorm' f p μ ≤ eLpNorm' f q μ := by
have h_le_μ := eLpNorm'_le_eLpNorm'_mul_rpow_measure_univ hp0_lt hpq hf
rwa [measure_univ, ENNReal.one_rpow, mul_one] at h_le_μ
@[deprecated (since := "2024-07-27")]
alias snorm'_le_snorm'_of_exponent_le := eLpNorm'_le_eLpNorm'_of_exponent_le
theorem eLpNorm'_le_eLpNormEssSup {q : ℝ} (hq_pos : 0 < q) [IsProbabilityMeasure μ] :
eLpNorm' f q μ ≤ eLpNormEssSup f μ :=
(eLpNorm'_le_eLpNormEssSup_mul_rpow_measure_univ hq_pos).trans_eq (by simp [measure_univ])
@[deprecated (since := "2024-07-27")]
alias snorm'_le_snormEssSup := eLpNorm'_le_eLpNormEssSup
theorem eLpNorm_le_eLpNorm_of_exponent_le {p q : ℝ≥0∞} (hpq : p ≤ q) [IsProbabilityMeasure μ]
(hf : AEStronglyMeasurable f μ) : eLpNorm f p μ ≤ eLpNorm f q μ :=
(eLpNorm_le_eLpNorm_mul_rpow_measure_univ hpq hf).trans (le_of_eq (by simp [measure_univ]))
@[deprecated (since := "2024-07-27")]
alias snorm_le_snorm_of_exponent_le := eLpNorm_le_eLpNorm_of_exponent_le
theorem eLpNorm'_lt_top_of_eLpNorm'_lt_top_of_exponent_le {p q : ℝ} [IsFiniteMeasure μ]
(hf : AEStronglyMeasurable f μ) (hfq_lt_top : eLpNorm' f q μ < ∞) (hp_nonneg : 0 ≤ p)
(hpq : p ≤ q) : eLpNorm' f p μ < ∞ := by
rcases le_or_lt p 0 with hp_nonpos | hp_pos
· rw [le_antisymm hp_nonpos hp_nonneg]
simp
have hq_pos : 0 < q := lt_of_lt_of_le hp_pos hpq
calc
eLpNorm' f p μ ≤ eLpNorm' f q μ * μ Set.univ ^ (1 / p - 1 / q) :=
eLpNorm'_le_eLpNorm'_mul_rpow_measure_univ hp_pos hpq hf
_ < ∞ := by
rw [ENNReal.mul_lt_top_iff]
refine Or.inl ⟨hfq_lt_top, ENNReal.rpow_lt_top_of_nonneg ?_ (measure_ne_top μ Set.univ)⟩
rwa [le_sub_comm, sub_zero, one_div, one_div, inv_le_inv hq_pos hp_pos]
@[deprecated (since := "2024-07-27")]
alias snorm'_lt_top_of_snorm'_lt_top_of_exponent_le :=
eLpNorm'_lt_top_of_eLpNorm'_lt_top_of_exponent_le
theorem Memℒp.memℒp_of_exponent_le {p q : ℝ≥0∞} [IsFiniteMeasure μ] {f : α → E} (hfq : Memℒp f q μ)
(hpq : p ≤ q) : Memℒp f p μ := by
cases' hfq with hfq_m hfq_lt_top
by_cases hp0 : p = 0
· rwa [hp0, memℒp_zero_iff_aestronglyMeasurable]
rw [← Ne] at hp0
refine ⟨hfq_m, ?_⟩
by_cases hp_top : p = ∞
· have hq_top : q = ∞ := by rwa [hp_top, top_le_iff] at hpq
rw [hp_top]
rwa [hq_top] at hfq_lt_top
have hp_pos : 0 < p.toReal := ENNReal.toReal_pos hp0 hp_top
by_cases hq_top : q = ∞
· rw [eLpNorm_eq_eLpNorm' hp0 hp_top]
rw [hq_top, eLpNorm_exponent_top] at hfq_lt_top
refine lt_of_le_of_lt (eLpNorm'_le_eLpNormEssSup_mul_rpow_measure_univ hp_pos) ?_
refine ENNReal.mul_lt_top hfq_lt_top.ne ?_
exact (ENNReal.rpow_lt_top_of_nonneg (by simp [hp_pos.le]) (measure_ne_top μ Set.univ)).ne
have hq0 : q ≠ 0 := by
by_contra hq_eq_zero
have hp_eq_zero : p = 0 := le_antisymm (by rwa [hq_eq_zero] at hpq) (zero_le _)
rw [hp_eq_zero, ENNReal.zero_toReal] at hp_pos
exact (lt_irrefl _) hp_pos
have hpq_real : p.toReal ≤ q.toReal := by rwa [ENNReal.toReal_le_toReal hp_top hq_top]
rw [eLpNorm_eq_eLpNorm' hp0 hp_top]
rw [eLpNorm_eq_eLpNorm' hq0 hq_top] at hfq_lt_top
exact eLpNorm'_lt_top_of_eLpNorm'_lt_top_of_exponent_le hfq_m hfq_lt_top hp_pos.le hpq_real
end SameSpace
section Bilinear
variable {α E F G : Type*} {m : MeasurableSpace α}
[NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G] {μ : Measure α}
{f : α → E} {g : α → F}
theorem eLpNorm_le_eLpNorm_top_mul_eLpNorm (p : ℝ≥0∞) (f : α → E) {g : α → F}
(hg : AEStronglyMeasurable g μ) (b : E → F → G)
(h : ∀ᵐ x ∂μ, ‖b (f x) (g x)‖₊ ≤ ‖f x‖₊ * ‖g x‖₊) :
eLpNorm (fun x => b (f x) (g x)) p μ ≤ eLpNorm f ∞ μ * eLpNorm g p μ := by
by_cases hp_top : p = ∞
· simp_rw [hp_top, eLpNorm_exponent_top]
refine le_trans (essSup_mono_ae <| h.mono fun a ha => ?_) (ENNReal.essSup_mul_le _ _)
simp_rw [Pi.mul_apply, ← ENNReal.coe_mul, ENNReal.coe_le_coe]
exact ha
by_cases hp_zero : p = 0
· simp only [hp_zero, eLpNorm_exponent_zero, mul_zero, le_zero_iff]
simp_rw [eLpNorm_eq_lintegral_rpow_nnnorm hp_zero hp_top, eLpNorm_exponent_top, eLpNormEssSup]
calc
(∫⁻ x, (‖b (f x) (g x)‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) ^ (1 / p.toReal) ≤
(∫⁻ x, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal * (‖g x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) ^ (1 / p.toReal) := by
gcongr ?_ ^ _
refine lintegral_mono_ae (h.mono fun a ha => ?_)
rw [← ENNReal.mul_rpow_of_nonneg _ _ ENNReal.toReal_nonneg]
refine ENNReal.rpow_le_rpow ?_ ENNReal.toReal_nonneg
rw [← ENNReal.coe_mul, ENNReal.coe_le_coe]
exact ha
_ ≤
(∫⁻ x, essSup (fun x => (‖f x‖₊ : ℝ≥0∞)) μ ^ p.toReal * (‖g x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) ^
(1 / p.toReal) := by
gcongr ?_ ^ _
refine lintegral_mono_ae ?_
filter_upwards [@ENNReal.ae_le_essSup _ _ μ fun x => (‖f x‖₊ : ℝ≥0∞)] with x hx
gcongr
_ = essSup (fun x => (‖f x‖₊ : ℝ≥0∞)) μ *
(∫⁻ x, (‖g x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) ^ (1 / p.toReal) := by
rw [lintegral_const_mul'']
swap; · exact hg.nnnorm.aemeasurable.coe_nnreal_ennreal.pow aemeasurable_const
rw [ENNReal.mul_rpow_of_nonneg]
swap
· rw [one_div_nonneg]
exact ENNReal.toReal_nonneg
rw [← ENNReal.rpow_mul, one_div, mul_inv_cancel, ENNReal.rpow_one]
rw [Ne, ENNReal.toReal_eq_zero_iff, not_or]
exact ⟨hp_zero, hp_top⟩
@[deprecated (since := "2024-07-27")]
alias snorm_le_snorm_top_mul_snorm := eLpNorm_le_eLpNorm_top_mul_eLpNorm
theorem eLpNorm_le_eLpNorm_mul_eLpNorm_top (p : ℝ≥0∞) {f : α → E} (hf : AEStronglyMeasurable f μ)
(g : α → F) (b : E → F → G) (h : ∀ᵐ x ∂μ, ‖b (f x) (g x)‖₊ ≤ ‖f x‖₊ * ‖g x‖₊) :
eLpNorm (fun x => b (f x) (g x)) p μ ≤ eLpNorm f p μ * eLpNorm g ∞ μ :=
calc
eLpNorm (fun x ↦ b (f x) (g x)) p μ ≤ eLpNorm g ∞ μ * eLpNorm f p μ :=
eLpNorm_le_eLpNorm_top_mul_eLpNorm p g hf (flip b) <| by simpa only [mul_comm] using h
_ = eLpNorm f p μ * eLpNorm g ∞ μ := mul_comm _ _
@[deprecated (since := "2024-07-27")]
alias snorm_le_snorm_mul_snorm_top := eLpNorm_le_eLpNorm_mul_eLpNorm_top
theorem eLpNorm'_le_eLpNorm'_mul_eLpNorm' {p q r : ℝ} (hf : AEStronglyMeasurable f μ)
(hg : AEStronglyMeasurable g μ) (b : E → F → G)
(h : ∀ᵐ x ∂μ, ‖b (f x) (g x)‖₊ ≤ ‖f x‖₊ * ‖g x‖₊) (hp0_lt : 0 < p) (hpq : p < q)
(hpqr : 1 / p = 1 / q + 1 / r) :
eLpNorm' (fun x => b (f x) (g x)) p μ ≤ eLpNorm' f q μ * eLpNorm' g r μ := by
rw [eLpNorm']
calc
(∫⁻ a : α, ↑‖b (f a) (g a)‖₊ ^ p ∂μ) ^ (1 / p) ≤
(∫⁻ a : α, ↑(‖f a‖₊ * ‖g a‖₊) ^ p ∂μ) ^ (1 / p) :=
(ENNReal.rpow_le_rpow_iff <| one_div_pos.mpr hp0_lt).mpr <|
lintegral_mono_ae <|
h.mono fun a ha => (ENNReal.rpow_le_rpow_iff hp0_lt).mpr <| ENNReal.coe_le_coe.mpr <| ha
_ ≤ _ := ?_
simp_rw [eLpNorm', ENNReal.coe_mul]
exact ENNReal.lintegral_Lp_mul_le_Lq_mul_Lr hp0_lt hpq hpqr μ hf.ennnorm hg.ennnorm
@[deprecated (since := "2024-07-27")]
alias snorm'_le_snorm'_mul_snorm' := eLpNorm'_le_eLpNorm'_mul_eLpNorm'
/-- Hölder's inequality, as an inequality on the `ℒp` seminorm of an elementwise operation
`fun x => b (f x) (g x)`. -/
theorem eLpNorm_le_eLpNorm_mul_eLpNorm_of_nnnorm {p q r : ℝ≥0∞}
(hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) (b : E → F → G)
(h : ∀ᵐ x ∂μ, ‖b (f x) (g x)‖₊ ≤ ‖f x‖₊ * ‖g x‖₊) (hpqr : 1 / p = 1 / q + 1 / r) :
eLpNorm (fun x => b (f x) (g x)) p μ ≤ eLpNorm f q μ * eLpNorm g r μ := by
by_cases hp_zero : p = 0
· simp [hp_zero]
have hq_ne_zero : q ≠ 0 := by
intro hq_zero
simp only [hq_zero, hp_zero, one_div, ENNReal.inv_zero, top_add, ENNReal.inv_eq_top] at hpqr
have hr_ne_zero : r ≠ 0 := by
intro hr_zero
simp only [hr_zero, hp_zero, one_div, ENNReal.inv_zero, add_top, ENNReal.inv_eq_top] at hpqr
by_cases hq_top : q = ∞
· have hpr : p = r := by
simpa only [hq_top, one_div, ENNReal.inv_top, zero_add, inv_inj] using hpqr
rw [← hpr, hq_top]
exact eLpNorm_le_eLpNorm_top_mul_eLpNorm p f hg b h
by_cases hr_top : r = ∞
· have hpq : p = q := by
simpa only [hr_top, one_div, ENNReal.inv_top, add_zero, inv_inj] using hpqr
rw [← hpq, hr_top]
exact eLpNorm_le_eLpNorm_mul_eLpNorm_top p hf g b h
have hpq : p < q := by
suffices 1 / q < 1 / p by rwa [one_div, one_div, ENNReal.inv_lt_inv] at this
rw [hpqr]
refine ENNReal.lt_add_right ?_ ?_
· simp only [hq_ne_zero, one_div, Ne, ENNReal.inv_eq_top, not_false_iff]
· simp only [hr_top, one_div, Ne, ENNReal.inv_eq_zero, not_false_iff]
rw [eLpNorm_eq_eLpNorm' hp_zero (hpq.trans_le le_top).ne, eLpNorm_eq_eLpNorm' hq_ne_zero hq_top,
eLpNorm_eq_eLpNorm' hr_ne_zero hr_top]
refine eLpNorm'_le_eLpNorm'_mul_eLpNorm' hf hg _ h ?_ ?_ ?_
· exact ENNReal.toReal_pos hp_zero (hpq.trans_le le_top).ne
· exact ENNReal.toReal_strict_mono hq_top hpq
rw [← ENNReal.one_toReal, ← ENNReal.toReal_div, ← ENNReal.toReal_div, ← ENNReal.toReal_div, hpqr,
ENNReal.toReal_add]
· simp only [hq_ne_zero, one_div, Ne, ENNReal.inv_eq_top, not_false_iff]
· simp only [hr_ne_zero, one_div, Ne, ENNReal.inv_eq_top, not_false_iff]
@[deprecated (since := "2024-07-27")]
alias snorm_le_snorm_mul_snorm_of_nnnorm := eLpNorm_le_eLpNorm_mul_eLpNorm_of_nnnorm
/-- Hölder's inequality, as an inequality on the `ℒp` seminorm of an elementwise operation
`fun x => b (f x) (g x)`. -/
theorem eLpNorm_le_eLpNorm_mul_eLpNorm'_of_norm {p q r : ℝ≥0∞} (hf : AEStronglyMeasurable f μ)
(hg : AEStronglyMeasurable g μ) (b : E → F → G)
(h : ∀ᵐ x ∂μ, ‖b (f x) (g x)‖ ≤ ‖f x‖ * ‖g x‖) (hpqr : 1 / p = 1 / q + 1 / r) :
eLpNorm (fun x => b (f x) (g x)) p μ ≤ eLpNorm f q μ * eLpNorm g r μ :=
eLpNorm_le_eLpNorm_mul_eLpNorm_of_nnnorm hf hg b h hpqr
@[deprecated (since := "2024-07-27")]
alias snorm_le_snorm_mul_snorm'_of_norm := eLpNorm_le_eLpNorm_mul_eLpNorm'_of_norm
end Bilinear
section BoundedSMul
variable {𝕜 α E F : Type*} {m : MeasurableSpace α} {μ : Measure α} [NormedRing 𝕜]
[NormedAddCommGroup E] [MulActionWithZero 𝕜 E] [BoundedSMul 𝕜 E]
[NormedAddCommGroup F] [MulActionWithZero 𝕜 F] [BoundedSMul 𝕜 F] {f : α → E}
theorem eLpNorm_smul_le_eLpNorm_top_mul_eLpNorm (p : ℝ≥0∞) (hf : AEStronglyMeasurable f μ)
(φ : α → 𝕜) : eLpNorm (φ • f) p μ ≤ eLpNorm φ ∞ μ * eLpNorm f p μ :=
(eLpNorm_le_eLpNorm_top_mul_eLpNorm p φ hf (· • ·)
(eventually_of_forall fun _ => nnnorm_smul_le _ _) : _)
@[deprecated (since := "2024-07-27")]
alias snorm_smul_le_snorm_top_mul_snorm := eLpNorm_smul_le_eLpNorm_top_mul_eLpNorm
theorem eLpNorm_smul_le_eLpNorm_mul_eLpNorm_top (p : ℝ≥0∞) (f : α → E) {φ : α → 𝕜}
(hφ : AEStronglyMeasurable φ μ) : eLpNorm (φ • f) p μ ≤ eLpNorm φ p μ * eLpNorm f ∞ μ :=
(eLpNorm_le_eLpNorm_mul_eLpNorm_top p hφ f (· • ·)
(eventually_of_forall fun _ => nnnorm_smul_le _ _) : _)
@[deprecated (since := "2024-07-27")]
alias snorm_smul_le_snorm_mul_snorm_top := eLpNorm_smul_le_eLpNorm_mul_eLpNorm_top
theorem eLpNorm'_smul_le_mul_eLpNorm' {p q r : ℝ} {f : α → E} (hf : AEStronglyMeasurable f μ)
{φ : α → 𝕜} (hφ : AEStronglyMeasurable φ μ) (hp0_lt : 0 < p) (hpq : p < q)
(hpqr : 1 / p = 1 / q + 1 / r) : eLpNorm' (φ • f) p μ ≤ eLpNorm' φ q μ * eLpNorm' f r μ :=
eLpNorm'_le_eLpNorm'_mul_eLpNorm' hφ hf (· • ·) (eventually_of_forall fun _ => nnnorm_smul_le _ _)
hp0_lt hpq hpqr
@[deprecated (since := "2024-07-27")]
alias snorm'_smul_le_mul_snorm' := eLpNorm'_smul_le_mul_eLpNorm'
/-- Hölder's inequality, as an inequality on the `ℒp` seminorm of a scalar product `φ • f`. -/
theorem eLpNorm_smul_le_mul_eLpNorm {p q r : ℝ≥0∞} {f : α → E} (hf : AEStronglyMeasurable f μ)
{φ : α → 𝕜} (hφ : AEStronglyMeasurable φ μ) (hpqr : 1 / p = 1 / q + 1 / r) :
eLpNorm (φ • f) p μ ≤ eLpNorm φ q μ * eLpNorm f r μ :=
(eLpNorm_le_eLpNorm_mul_eLpNorm_of_nnnorm hφ hf (· • ·)
(eventually_of_forall fun _ => nnnorm_smul_le _ _) hpqr :
_)
@[deprecated (since := "2024-07-27")]
alias snorm_smul_le_mul_snorm := eLpNorm_smul_le_mul_eLpNorm
theorem Memℒp.smul {p q r : ℝ≥0∞} {f : α → E} {φ : α → 𝕜} (hf : Memℒp f r μ) (hφ : Memℒp φ q μ)
(hpqr : 1 / p = 1 / q + 1 / r) : Memℒp (φ • f) p μ :=
⟨hφ.1.smul hf.1,
(eLpNorm_smul_le_mul_eLpNorm hf.1 hφ.1 hpqr).trans_lt
(ENNReal.mul_lt_top hφ.eLpNorm_ne_top hf.eLpNorm_ne_top)⟩
theorem Memℒp.smul_of_top_right {p : ℝ≥0∞} {f : α → E} {φ : α → 𝕜} (hf : Memℒp f p μ)
(hφ : Memℒp φ ∞ μ) : Memℒp (φ • f) p μ := by
apply hf.smul hφ
simp only [ENNReal.div_top, zero_add]
theorem Memℒp.smul_of_top_left {p : ℝ≥0∞} {f : α → E} {φ : α → 𝕜} (hf : Memℒp f ∞ μ)
(hφ : Memℒp φ p μ) : Memℒp (φ • f) p μ := by
apply hf.smul hφ
simp only [ENNReal.div_top, add_zero]
end BoundedSMul
end MeasureTheory
|
MeasureTheory\Function\LpSeminorm\TriangleInequality.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic
import Mathlib.MeasureTheory.Integral.MeanInequalities
/-!
# Triangle inequality for `Lp`-seminorm
In this file we prove several versions of the triangle inequality for the `Lp` seminorm,
as well as simple corollaries.
-/
open Filter
open scoped ENNReal Topology
namespace MeasureTheory
variable {α E : Type*} {m : MeasurableSpace α} [NormedAddCommGroup E]
{p : ℝ≥0∞} {q : ℝ} {μ : Measure α} {f g : α → E}
theorem eLpNorm'_add_le (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ)
(hq1 : 1 ≤ q) : eLpNorm' (f + g) q μ ≤ eLpNorm' f q μ + eLpNorm' g q μ :=
calc
(∫⁻ a, (‖(f + g) a‖₊ : ℝ≥0∞) ^ q ∂μ) ^ (1 / q) ≤
(∫⁻ a, ((fun a => (‖f a‖₊ : ℝ≥0∞)) + fun a => (‖g a‖₊ : ℝ≥0∞)) a ^ q ∂μ) ^ (1 / q) := by
gcongr with a
simp only [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le]
_ ≤ eLpNorm' f q μ + eLpNorm' g q μ := ENNReal.lintegral_Lp_add_le hf.ennnorm hg.ennnorm hq1
@[deprecated (since := "2024-07-27")]
alias snorm'_add_le := eLpNorm'_add_le
theorem eLpNorm'_add_le_of_le_one (hf : AEStronglyMeasurable f μ) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) :
eLpNorm' (f + g) q μ ≤ (2 : ℝ≥0∞) ^ (1 / q - 1) * (eLpNorm' f q μ + eLpNorm' g q μ) :=
calc
(∫⁻ a, (‖(f + g) a‖₊ : ℝ≥0∞) ^ q ∂μ) ^ (1 / q) ≤
(∫⁻ a, ((fun a => (‖f a‖₊ : ℝ≥0∞)) + fun a => (‖g a‖₊ : ℝ≥0∞)) a ^ q ∂μ) ^ (1 / q) := by
gcongr with a
simp only [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le]
_ ≤ (2 : ℝ≥0∞) ^ (1 / q - 1) * (eLpNorm' f q μ + eLpNorm' g q μ) :=
ENNReal.lintegral_Lp_add_le_of_le_one hf.ennnorm hq0 hq1
@[deprecated (since := "2024-07-27")]
alias snorm'_add_le_of_le_one := eLpNorm'_add_le_of_le_one
theorem eLpNormEssSup_add_le {f g : α → E} :
eLpNormEssSup (f + g) μ ≤ eLpNormEssSup f μ + eLpNormEssSup g μ := by
refine le_trans (essSup_mono_ae (eventually_of_forall fun x => ?_)) (ENNReal.essSup_add_le _ _)
simp_rw [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe]
exact nnnorm_add_le _ _
@[deprecated (since := "2024-07-27")]
alias snormEssSup_add_le := eLpNormEssSup_add_le
theorem eLpNorm_add_le {f g : α → E} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ)
(hp1 : 1 ≤ p) : eLpNorm (f + g) p μ ≤ eLpNorm f p μ + eLpNorm g p μ := by
by_cases hp0 : p = 0
· simp [hp0]
by_cases hp_top : p = ∞
· simp [hp_top, eLpNormEssSup_add_le]
have hp1_real : 1 ≤ p.toReal := by
rwa [← ENNReal.one_toReal, ENNReal.toReal_le_toReal ENNReal.one_ne_top hp_top]
repeat rw [eLpNorm_eq_eLpNorm' hp0 hp_top]
exact eLpNorm'_add_le hf hg hp1_real
@[deprecated (since := "2024-07-27")]
alias snorm_add_le := eLpNorm_add_le
/-- A constant for the inequality `‖f + g‖_{L^p} ≤ C * (‖f‖_{L^p} + ‖g‖_{L^p})`. It is equal to `1`
for `p ≥ 1` or `p = 0`, and `2^(1/p-1)` in the more tricky interval `(0, 1)`. -/
noncomputable def LpAddConst (p : ℝ≥0∞) : ℝ≥0∞ :=
if p ∈ Set.Ioo (0 : ℝ≥0∞) 1 then (2 : ℝ≥0∞) ^ (1 / p.toReal - 1) else 1
theorem LpAddConst_of_one_le {p : ℝ≥0∞} (hp : 1 ≤ p) : LpAddConst p = 1 := by
rw [LpAddConst, if_neg]
intro h
exact lt_irrefl _ (h.2.trans_le hp)
theorem LpAddConst_zero : LpAddConst 0 = 1 := by
rw [LpAddConst, if_neg]
intro h
exact lt_irrefl _ h.1
theorem LpAddConst_lt_top (p : ℝ≥0∞) : LpAddConst p < ∞ := by
rw [LpAddConst]
split_ifs with h
· apply ENNReal.rpow_lt_top_of_nonneg _ ENNReal.two_ne_top
simp only [one_div, sub_nonneg]
apply one_le_inv (ENNReal.toReal_pos h.1.ne' (h.2.trans ENNReal.one_lt_top).ne)
simpa using ENNReal.toReal_mono ENNReal.one_ne_top h.2.le
· exact ENNReal.one_lt_top
theorem eLpNorm_add_le' (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ)
(p : ℝ≥0∞) : eLpNorm (f + g) p μ ≤ LpAddConst p * (eLpNorm f p μ + eLpNorm g p μ) := by
rcases eq_or_ne p 0 with (rfl | hp)
· simp only [eLpNorm_exponent_zero, add_zero, mul_zero, le_zero_iff]
rcases lt_or_le p 1 with (h'p | h'p)
· simp only [eLpNorm_eq_eLpNorm' hp (h'p.trans ENNReal.one_lt_top).ne]
convert eLpNorm'_add_le_of_le_one hf ENNReal.toReal_nonneg _
· have : p ∈ Set.Ioo (0 : ℝ≥0∞) 1 := ⟨hp.bot_lt, h'p⟩
simp only [LpAddConst, if_pos this]
· simpa using ENNReal.toReal_mono ENNReal.one_ne_top h'p.le
· simpa [LpAddConst_of_one_le h'p] using eLpNorm_add_le hf hg h'p
@[deprecated (since := "2024-07-27")]
alias snorm_add_le' := eLpNorm_add_le'
variable (μ E)
/-- Technical lemma to control the addition of functions in `L^p` even for `p < 1`: Given `δ > 0`,
there exists `η` such that two functions bounded by `η` in `L^p` have a sum bounded by `δ`. One
could take `η = δ / 2` for `p ≥ 1`, but the point of the lemma is that it works also for `p < 1`.
-/
theorem exists_Lp_half (p : ℝ≥0∞) {δ : ℝ≥0∞} (hδ : δ ≠ 0) :
∃ η : ℝ≥0∞,
0 < η ∧
∀ (f g : α → E), AEStronglyMeasurable f μ → AEStronglyMeasurable g μ →
eLpNorm f p μ ≤ η → eLpNorm g p μ ≤ η → eLpNorm (f + g) p μ < δ := by
have :
Tendsto (fun η : ℝ≥0∞ => LpAddConst p * (η + η)) (𝓝[>] 0) (𝓝 (LpAddConst p * (0 + 0))) :=
(ENNReal.Tendsto.const_mul (tendsto_id.add tendsto_id)
(Or.inr (LpAddConst_lt_top p).ne)).mono_left
nhdsWithin_le_nhds
simp only [add_zero, mul_zero] at this
rcases (((tendsto_order.1 this).2 δ hδ.bot_lt).and self_mem_nhdsWithin).exists with ⟨η, hη, ηpos⟩
refine ⟨η, ηpos, fun f g hf hg Hf Hg => ?_⟩
calc
eLpNorm (f + g) p μ ≤ LpAddConst p * (eLpNorm f p μ + eLpNorm g p μ) := eLpNorm_add_le' hf hg p
_ ≤ LpAddConst p * (η + η) := by gcongr
_ < δ := hη
variable {μ E}
theorem eLpNorm_sub_le' (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ)
(p : ℝ≥0∞) : eLpNorm (f - g) p μ ≤ LpAddConst p * (eLpNorm f p μ + eLpNorm g p μ) := by
simpa only [sub_eq_add_neg, eLpNorm_neg] using eLpNorm_add_le' hf hg.neg p
@[deprecated (since := "2024-07-27")]
alias snorm_sub_le' := eLpNorm_sub_le'
theorem eLpNorm_sub_le {f g : α → E} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ)
(hp : 1 ≤ p) : eLpNorm (f - g) p μ ≤ eLpNorm f p μ + eLpNorm g p μ := by
simpa [LpAddConst_of_one_le hp] using eLpNorm_sub_le' hf hg p
@[deprecated (since := "2024-07-27")]
alias snorm_sub_le := eLpNorm_sub_le
theorem eLpNorm_add_lt_top {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
eLpNorm (f + g) p μ < ∞ :=
calc
eLpNorm (f + g) p μ ≤ LpAddConst p * (eLpNorm f p μ + eLpNorm g p μ) :=
eLpNorm_add_le' hf.aestronglyMeasurable hg.aestronglyMeasurable p
_ < ∞ := by
apply ENNReal.mul_lt_top (LpAddConst_lt_top p).ne
exact (ENNReal.add_lt_top.2 ⟨hf.2, hg.2⟩).ne
@[deprecated (since := "2024-07-27")]
alias snorm_add_lt_top := eLpNorm_add_lt_top
theorem eLpNorm'_sum_le {ι} {f : ι → α → E} {s : Finset ι}
(hfs : ∀ i, i ∈ s → AEStronglyMeasurable (f i) μ) (hq1 : 1 ≤ q) :
eLpNorm' (∑ i ∈ s, f i) q μ ≤ ∑ i ∈ s, eLpNorm' (f i) q μ :=
Finset.le_sum_of_subadditive_on_pred (fun f : α → E => eLpNorm' f q μ)
(fun f => AEStronglyMeasurable f μ) (eLpNorm'_zero (zero_lt_one.trans_le hq1))
(fun _f _g hf hg => eLpNorm'_add_le hf hg hq1) (fun _f _g hf hg => hf.add hg) _ hfs
@[deprecated (since := "2024-07-27")]
alias snorm'_sum_le := eLpNorm'_sum_le
theorem eLpNorm_sum_le {ι} {f : ι → α → E} {s : Finset ι}
(hfs : ∀ i, i ∈ s → AEStronglyMeasurable (f i) μ) (hp1 : 1 ≤ p) :
eLpNorm (∑ i ∈ s, f i) p μ ≤ ∑ i ∈ s, eLpNorm (f i) p μ :=
Finset.le_sum_of_subadditive_on_pred (fun f : α → E => eLpNorm f p μ)
(fun f => AEStronglyMeasurable f μ) eLpNorm_zero (fun _f _g hf hg => eLpNorm_add_le hf hg hp1)
(fun _f _g hf hg => hf.add hg) _ hfs
@[deprecated (since := "2024-07-27")]
alias snorm_sum_le := eLpNorm_sum_le
theorem Memℒp.add {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) : Memℒp (f + g) p μ :=
⟨AEStronglyMeasurable.add hf.1 hg.1, eLpNorm_add_lt_top hf hg⟩
theorem Memℒp.sub {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) : Memℒp (f - g) p μ := by
rw [sub_eq_add_neg]
exact hf.add hg.neg
theorem memℒp_finset_sum {ι} (s : Finset ι) {f : ι → α → E} (hf : ∀ i ∈ s, Memℒp (f i) p μ) :
Memℒp (fun a => ∑ i ∈ s, f i a) p μ := by
haveI : DecidableEq ι := Classical.decEq _
revert hf
refine Finset.induction_on s ?_ ?_
· simp only [zero_mem_ℒp', Finset.sum_empty, imp_true_iff]
· intro i s his ih hf
simp only [his, Finset.sum_insert, not_false_iff]
exact (hf i (s.mem_insert_self i)).add (ih fun j hj => hf j (Finset.mem_insert_of_mem hj))
theorem memℒp_finset_sum' {ι} (s : Finset ι) {f : ι → α → E} (hf : ∀ i ∈ s, Memℒp (f i) p μ) :
Memℒp (∑ i ∈ s, f i) p μ := by
convert memℒp_finset_sum s hf using 1
ext x
simp
end MeasureTheory
|
MeasureTheory\Function\LpSeminorm\Trim.lean | /-
Copyright (c) 2021 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic
/-!
# Lp seminorm with respect to trimmed measure
In this file we prove basic properties of the Lp-seminorm of a function
with respect to the restriction of a measure to a sub-σ-algebra.
-/
namespace MeasureTheory
open Filter
open scoped ENNReal
variable {α E : Type*} {m m0 : MeasurableSpace α} {p : ℝ≥0∞} {q : ℝ} {μ : Measure α}
[NormedAddCommGroup E]
theorem eLpNorm'_trim (hm : m ≤ m0) {f : α → E} (hf : StronglyMeasurable[m] f) :
eLpNorm' f q (μ.trim hm) = eLpNorm' f q μ := by
simp_rw [eLpNorm']
congr 1
refine lintegral_trim hm ?_
refine @Measurable.pow_const _ _ _ _ _ _ _ m _ (@Measurable.coe_nnreal_ennreal _ m _ ?_) q
apply @StronglyMeasurable.measurable
exact @StronglyMeasurable.nnnorm α m _ _ _ hf
@[deprecated (since := "2024-07-27")]
alias snorm'_trim := eLpNorm'_trim
theorem limsup_trim (hm : m ≤ m0) {f : α → ℝ≥0∞} (hf : Measurable[m] f) :
limsup f (ae (μ.trim hm)) = limsup f (ae μ) := by
simp_rw [limsup_eq]
suffices h_set_eq : { a : ℝ≥0∞ | ∀ᵐ n ∂μ.trim hm, f n ≤ a } = { a : ℝ≥0∞ | ∀ᵐ n ∂μ, f n ≤ a } by
rw [h_set_eq]
ext1 a
suffices h_meas_eq : μ { x | ¬f x ≤ a } = μ.trim hm { x | ¬f x ≤ a } by
simp_rw [Set.mem_setOf_eq, ae_iff, h_meas_eq]
refine (trim_measurableSet_eq hm ?_).symm
refine @MeasurableSet.compl _ _ m (@measurableSet_le ℝ≥0∞ _ _ _ _ m _ _ _ _ _ hf ?_)
exact @measurable_const _ _ _ m _
theorem essSup_trim (hm : m ≤ m0) {f : α → ℝ≥0∞} (hf : Measurable[m] f) :
essSup f (μ.trim hm) = essSup f μ := by
simp_rw [essSup]
exact limsup_trim hm hf
theorem eLpNormEssSup_trim (hm : m ≤ m0) {f : α → E} (hf : StronglyMeasurable[m] f) :
eLpNormEssSup f (μ.trim hm) = eLpNormEssSup f μ :=
essSup_trim _ (@StronglyMeasurable.ennnorm _ m _ _ _ hf)
@[deprecated (since := "2024-07-27")]
alias snormEssSup_trim := eLpNormEssSup_trim
theorem eLpNorm_trim (hm : m ≤ m0) {f : α → E} (hf : StronglyMeasurable[m] f) :
eLpNorm f p (μ.trim hm) = eLpNorm f p μ := by
by_cases h0 : p = 0
· simp [h0]
by_cases h_top : p = ∞
· simpa only [h_top, eLpNorm_exponent_top] using eLpNormEssSup_trim hm hf
simpa only [eLpNorm_eq_eLpNorm' h0 h_top] using eLpNorm'_trim hm hf
@[deprecated (since := "2024-07-27")]
alias snorm_trim := eLpNorm_trim
theorem eLpNorm_trim_ae (hm : m ≤ m0) {f : α → E} (hf : AEStronglyMeasurable f (μ.trim hm)) :
eLpNorm f p (μ.trim hm) = eLpNorm f p μ := by
rw [eLpNorm_congr_ae hf.ae_eq_mk, eLpNorm_congr_ae (ae_eq_of_ae_eq_trim hf.ae_eq_mk)]
exact eLpNorm_trim hm hf.stronglyMeasurable_mk
@[deprecated (since := "2024-07-27")]
alias snorm_trim_ae := eLpNorm_trim_ae
theorem memℒp_of_memℒp_trim (hm : m ≤ m0) {f : α → E} (hf : Memℒp f p (μ.trim hm)) : Memℒp f p μ :=
⟨aestronglyMeasurable_of_aestronglyMeasurable_trim hm hf.1,
(le_of_eq (eLpNorm_trim_ae hm hf.1).symm).trans_lt hf.2⟩
end MeasureTheory
|
MeasureTheory\Function\LpSpace\ContinuousCompMeasurePreserving.lean | /-
Copyright (c) 2024 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp
import Mathlib.MeasureTheory.Measure.Regular
/-!
# Continuity of `MeasureTheory.Lp.compMeasurePreserving`
In this file we prove that the composition of an `L^p` function `g`
with a continuous measure-preserving map `f` is continuous in both arguments.
First, we prove it for indicator functions,
in terms of convergence of `μ ((f a ⁻¹' s) ∆ (g ⁻¹' s))` to zero.
Then we prove the continuity of the function of two arguments
defined on `MeasureTheory.Lp E p ν × {f : C(X, Y) // MeasurePreserving f μ ν}`.
Finally, we provide dot notation convenience lemmas.
-/
open Filter Set MeasureTheory
open scoped ENNReal Topology symmDiff
variable {α X Y : Type*}
[TopologicalSpace X] [MeasurableSpace X] [BorelSpace X] [R1Space X]
[TopologicalSpace Y] [MeasurableSpace Y] [BorelSpace Y] [R1Space Y]
{μ : Measure X} {ν : Measure Y} [μ.InnerRegularCompactLTTop] [IsLocallyFiniteMeasure ν]
namespace MeasureTheory
/-- Let `X` and `Y` be R₁ topological spaces
with Borel σ-algebras and measures `μ` and `ν`, respectively.
Suppose that `μ` is inner regular for finite measure sets with respect to compact sets
and `ν` is a locally finite measure.
Let `f : α → C(X, Y)` be a family of continuous maps
that converges to a continuous map `g : C(X, Y)` in the compact-open topology along a filter `l`.
Suppose that `g` is a measure preserving map
and `f a` is a measure preserving map eventually along `l`.
Then for any finite measure measurable set `s`,
the preimages `f a ⁻¹' s` tend to the preimage `g ⁻¹' s` in measure.
More precisely, the measure of the symmetric difference of these two sets tends to zero. -/
theorem tendsto_measure_symmDiff_preimage_nhds_zero
{l : Filter α} {f : α → C(X, Y)} {g : C(X, Y)} {s : Set Y} (hfg : Tendsto f l (𝓝 g))
(hf : ∀ᶠ a in l, MeasurePreserving (f a) μ ν) (hg : MeasurePreserving g μ ν)
(hs : MeasurableSet s) (hνs : ν s ≠ ∞) :
Tendsto (fun a ↦ μ ((f a ⁻¹' s) ∆ (g ⁻¹' s))) l (𝓝 0) := by
have : ν.InnerRegularCompactLTTop := by
rw [← hg.map_eq]
exact .map_of_continuous (map_continuous _)
rw [ENNReal.tendsto_nhds_zero]
intro ε hε
-- Without loss of generality, `s` is an open set.
wlog hso : IsOpen s generalizing s ε
· have H : 0 < ε / 3 := ENNReal.div_pos hε.ne' ENNReal.coe_ne_top
-- Indeed, we can choose an open set `U` such that `ν (U ∆ s) < ε / 3`,
-- apply the lemma to `U`, then use the triangle inequality for `μ (_ ∆ _)`.
rcases hs.exists_isOpen_symmDiff_lt hνs H.ne' with ⟨U, hUo, hU, hUs⟩
have hmU : MeasurableSet U := hUo.measurableSet
replace hUs := hUs.le
filter_upwards [hf, this hmU hU.ne _ H hUo] with a hfa ha
calc
μ ((f a ⁻¹' s) ∆ (g ⁻¹' s))
≤ μ ((f a ⁻¹' s) ∆ (f a ⁻¹' U)) + μ ((f a ⁻¹' U) ∆ (g ⁻¹' U))
+ μ ((g ⁻¹' U) ∆ (g ⁻¹' s)) := by
refine (measure_symmDiff_le _ (g ⁻¹' U) _).trans ?_
gcongr
apply measure_symmDiff_le
_ ≤ ε / 3 + ε / 3 + ε / 3 := by
gcongr
· rwa [← preimage_symmDiff, hfa.measure_preimage (hs.symmDiff hmU).nullMeasurableSet,
symmDiff_comm]
· rwa [← preimage_symmDiff, hg.measure_preimage (hmU.symmDiff hs).nullMeasurableSet]
_ = ε := by simp
-- Take a compact closed subset `K ⊆ g ⁻¹' s` of almost full measure,
-- `μ (g ⁻¹' s \ K) < ε / 2`.
have hνs' : μ (g ⁻¹' s) ≠ ∞ := by rwa [hg.measure_preimage hs.nullMeasurableSet]
obtain ⟨K, hKg, hKco, hKcl, hKμ⟩ :
∃ K, MapsTo g K s ∧ IsCompact K ∧ IsClosed K ∧ μ (g ⁻¹' s \ K) < ε / 2 :=
(hs.preimage hg.measurable).exists_isCompact_isClosed_diff_lt hνs' <| by simp [hε.ne']
have hKm : MeasurableSet K := hKcl.measurableSet
-- Take `a` such that `f a` is measure preserving and maps `K` to `s`.
-- This is possible, because `K` is a compact set and `s` is an open set.
filter_upwards [hf, ContinuousMap.tendsto_nhds_compactOpen.mp hfg K hKco s hso hKg] with a hfa ha
-- Then each of the sets `g ⁻¹' s ∆ K = g ⁻¹' s \ K` and `f a ⁻¹' s ∆ K = f a ⁻¹' s \ K`
-- have measure at most `ε / 2`, thus `f a ⁻¹' s ∆ g ⁻¹' s` has measure at most `ε`.
rw [← ENNReal.add_halves ε]
refine (measure_symmDiff_le _ K _).trans ?_
rw [symmDiff_of_ge ha.subset_preimage, symmDiff_of_le hKg.subset_preimage]
gcongr
have hK' : μ K ≠ ∞ := ne_top_of_le_ne_top hνs' <| measure_mono hKg.subset_preimage
rw [measure_diff_le_iff_le_add hKm ha.subset_preimage hK',
hfa.measure_preimage hs.nullMeasurableSet, ← hg.measure_preimage hs.nullMeasurableSet,
← measure_diff_le_iff_le_add hKm hKg.subset_preimage hK']
exact hKμ.le
namespace Lp
variable (μ ν)
variable (E : Type*) [NormedAddCommGroup E] {p : ℝ≥0∞} [Fact (1 ≤ p)]
/-- Let `X` and `Y` be R₁ topological spaces
with Borel σ-algebras and measures `μ` and `ν`, respectively.
Suppose that `μ` is inner regular for finite measure sets with respect to compact sets
and `ν` is a locally finite measure.
Let `1 ≤ p < ∞` be an extended nonnegative real number.
Then the composition of a function `g : Lp E p ν`
and a measure preserving continuous function `f : C(X, Y)`
is continuous in both variables. -/
theorem compMeasurePreserving_continuous (hp : p ≠ ∞) :
Continuous fun gf : Lp E p ν × {f : C(X, Y) // MeasurePreserving f μ ν} ↦
compMeasurePreserving gf.2.1 gf.2.2 gf.1 := by
have hp₀ : p ≠ 0 := (one_pos.trans_le Fact.out).ne'
refine continuous_prod_of_dense_continuous_lipschitzWith _ 1
(MeasureTheory.Lp.simpleFunc.dense hp) ?_ fun f ↦ (isometry_compMeasurePreserving f.2).lipschitz
intro f hf
lift f to Lp.simpleFunc E p ν using hf
induction f using Lp.simpleFunc.induction hp₀ hp with
| h_add hfp hgp _ ihf ihg => exact ihf.add ihg
| @h_ind c s hs hνs =>
dsimp only [Lp.simpleFunc.coe_indicatorConst, Lp.indicatorConstLp_compMeasurePreserving]
refine continuous_indicatorConstLp_set hp fun f ↦ ?_
apply tendsto_measure_symmDiff_preimage_nhds_zero continuousAt_subtype_val _ f.2 hs hνs.ne
exact eventually_of_forall Subtype.property
end Lp
end MeasureTheory
variable {E : Type*} [NormedAddCommGroup E] {p : ℝ≥0∞} [Fact (1 ≤ p)]
theorem Filter.Tendsto.compMeasurePreservingLp {α : Type*} {l : Filter α}
{f : α → Lp E p ν} {f₀ : Lp E p ν} {g : α → C(X, Y)} {g₀ : C(X, Y)}
(hf : Tendsto f l (𝓝 f₀)) (hg : Tendsto g l (𝓝 g₀))
(hgm : ∀ a, MeasurePreserving (g a) μ ν) (hgm₀ : MeasurePreserving g₀ μ ν) (hp : p ≠ ∞) :
Tendsto (fun a ↦ Lp.compMeasurePreserving (g a) (hgm a) (f a)) l
(𝓝 (Lp.compMeasurePreserving g₀ hgm₀ f₀)) := by
have := (Lp.compMeasurePreserving_continuous μ ν E hp).tendsto ⟨f₀, g₀, hgm₀⟩
replace hg : Tendsto (fun a ↦ ⟨g a, hgm a⟩ : α → {g : C(X, Y) // MeasurePreserving g μ ν})
l (𝓝 ⟨g₀, hgm₀⟩) :=
tendsto_subtype_rng.2 hg
convert this.comp (hf.prod_mk_nhds hg)
variable {Z : Type*} [TopologicalSpace Z] {f : Z → Lp E p ν} {g : Z → C(X, Y)} {s : Set Z} {z : Z}
theorem ContinuousWithinAt.compMeasurePreservingLp (hf : ContinuousWithinAt f s z)
(hg : ContinuousWithinAt g s z) (hgm : ∀ z, MeasurePreserving (g z) μ ν) (hp : p ≠ ∞) :
ContinuousWithinAt (fun z ↦ Lp.compMeasurePreserving (g z) (hgm z) (f z)) s z :=
Tendsto.compMeasurePreservingLp hf hg _ _ hp
theorem ContinuousAt.compMeasurePreservingLp (hf : ContinuousAt f z)
(hg : ContinuousAt g z) (hgm : ∀ z, MeasurePreserving (g z) μ ν) (hp : p ≠ ∞) :
ContinuousAt (fun z ↦ Lp.compMeasurePreserving (g z) (hgm z) (f z)) z :=
Tendsto.compMeasurePreservingLp hf hg _ _ hp
theorem ContinuousOn.compMeasurePreservingLp (hf : ContinuousOn f s)
(hg : ContinuousOn g s) (hgm : ∀ z, MeasurePreserving (g z) μ ν) (hp : p ≠ ∞) :
ContinuousOn (fun z ↦ Lp.compMeasurePreserving (g z) (hgm z) (f z)) s := fun z hz ↦
(hf z hz).compMeasurePreservingLp (hg z hz) hgm hp
theorem Continuous.compMeasurePreservingLp (hf : Continuous f) (hg : Continuous g)
(hgm : ∀ z, MeasurePreserving (g z) μ ν) (hp : p ≠ ∞) :
Continuous (fun z ↦ Lp.compMeasurePreserving (g z) (hgm z) (f z)) :=
continuous_iff_continuousAt.mpr fun _ ↦
hf.continuousAt.compMeasurePreservingLp hg.continuousAt hgm hp
|
MeasureTheory\Function\LpSpace\DomAct\Basic.lean | /-
Copyright (c) 2023 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.MeasureTheory.Function.AEEqFun.DomAct
import Mathlib.MeasureTheory.Function.LpSpace
/-!
# Action of `Mᵈᵐᵃ` on `Lᵖ` spaces
In this file we define action of `Mᵈᵐᵃ` on `MeasureTheory.Lp E p μ`
If `f : α → E` is a function representing an equivalence class in `Lᵖ(α, E)`, `M` acts on `α`,
and `c : M`, then `(.mk c : Mᵈᵐᵃ) • [f]` is represented by the function `a ↦ f (c • a)`.
We also prove basic properties of this action.
-/
open MeasureTheory Filter
open scoped ENNReal
namespace DomMulAct
variable {M N α E : Type*} [MeasurableSpace M] [MeasurableSpace N]
[MeasurableSpace α] [NormedAddCommGroup E] {μ : MeasureTheory.Measure α} {p : ℝ≥0∞}
section SMul
variable [SMul M α] [SMulInvariantMeasure M α μ] [MeasurableSMul M α]
@[to_additive]
instance : SMul Mᵈᵐᵃ (Lp E p μ) where
smul c f := Lp.compMeasurePreserving (mk.symm c • ·) (measurePreserving_smul _ _) f
@[to_additive (attr := simp)]
theorem smul_Lp_val (c : Mᵈᵐᵃ) (f : Lp E p μ) : (c • f).1 = c • f.1 := rfl
@[to_additive]
theorem smul_Lp_ae_eq (c : Mᵈᵐᵃ) (f : Lp E p μ) : c • f =ᵐ[μ] (f <| mk.symm c • ·) :=
Lp.coeFn_compMeasurePreserving _ _
@[to_additive]
theorem mk_smul_toLp (c : M) {f : α → E} (hf : Memℒp f p μ) :
mk c • hf.toLp f =
(hf.comp_measurePreserving <| measurePreserving_smul c μ).toLp (f <| c • ·) :=
rfl
@[to_additive (attr := simp)]
theorem smul_Lp_const [IsFiniteMeasure μ] (c : Mᵈᵐᵃ) (a : E) :
c • Lp.const p μ a = Lp.const p μ a :=
rfl
@[to_additive]
theorem mk_smul_indicatorConstLp (c : M)
{s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (b : E) :
mk c • indicatorConstLp p hs hμs b =
indicatorConstLp p (hs.preimage <| measurable_const_smul c)
(by rwa [SMulInvariantMeasure.measure_preimage_smul c hs]) b :=
rfl
instance [SMul N α] [SMulCommClass M N α] [SMulInvariantMeasure N α μ] [MeasurableSMul N α] :
SMulCommClass Mᵈᵐᵃ Nᵈᵐᵃ (Lp E p μ) :=
Subtype.val_injective.smulCommClass (fun _ _ ↦ rfl) fun _ _ ↦ rfl
instance {𝕜 : Type*} [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E] :
SMulCommClass Mᵈᵐᵃ 𝕜 (Lp E p μ) :=
Subtype.val_injective.smulCommClass (fun _ _ ↦ rfl) fun _ _ ↦ rfl
instance {𝕜 : Type*} [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E] :
SMulCommClass 𝕜 Mᵈᵐᵃ (Lp E p μ) :=
.symm _ _ _
-- We don't have a typeclass for additive versions of the next few lemmas
-- Should we add `AddDistribAddAction` with `to_additive` both from `MulDistribMulAction`
-- and `DistribMulAction`?
@[to_additive]
theorem smul_Lp_add (c : Mᵈᵐᵃ) : ∀ f g : Lp E p μ, c • (f + g) = c • f + c • g := by
rintro ⟨⟨⟩, _⟩ ⟨⟨⟩, _⟩; rfl
attribute [simp] DomAddAct.vadd_Lp_add
@[to_additive (attr := simp 1001)]
theorem smul_Lp_zero (c : Mᵈᵐᵃ) : c • (0 : Lp E p μ) = 0 := rfl
@[to_additive]
theorem smul_Lp_neg (c : Mᵈᵐᵃ) (f : Lp E p μ) : c • (-f) = -(c • f) := by
rcases f with ⟨⟨_⟩, _⟩; rfl
@[to_additive]
theorem smul_Lp_sub (c : Mᵈᵐᵃ) : ∀ f g : Lp E p μ, c • (f - g) = c • f - c • g := by
rintro ⟨⟨⟩, _⟩ ⟨⟨⟩, _⟩; rfl
instance : DistribSMul Mᵈᵐᵃ (Lp E p μ) where
smul_zero _ := rfl
smul_add := by rintro _ ⟨⟨⟩, _⟩ ⟨⟨⟩, _⟩; rfl
-- The next few lemmas follow from the `IsometricSMul` instance if `1 ≤ p`
@[to_additive (attr := simp)]
theorem norm_smul_Lp (c : Mᵈᵐᵃ) (f : Lp E p μ) : ‖c • f‖ = ‖f‖ :=
Lp.norm_compMeasurePreserving _ _
@[to_additive (attr := simp)]
theorem nnnorm_smul_Lp (c : Mᵈᵐᵃ) (f : Lp E p μ) : ‖c • f‖₊ = ‖f‖₊ :=
NNReal.eq <| Lp.norm_compMeasurePreserving _ _
@[to_additive (attr := simp)]
theorem dist_smul_Lp (c : Mᵈᵐᵃ) (f g : Lp E p μ) : dist (c • f) (c • g) = dist f g := by
simp only [dist, ← smul_Lp_sub, norm_smul_Lp]
@[to_additive (attr := simp)]
theorem edist_smul_Lp (c : Mᵈᵐᵃ) (f g : Lp E p μ) : edist (c • f) (c • g) = edist f g := by
simp only [Lp.edist_dist, dist_smul_Lp]
variable [Fact (1 ≤ p)]
@[to_additive]
instance : IsometricSMul Mᵈᵐᵃ (Lp E p μ) := ⟨edist_smul_Lp⟩
end SMul
section MulAction
variable [Monoid M] [MulAction M α] [SMulInvariantMeasure M α μ] [MeasurableSMul M α]
@[to_additive]
instance : MulAction Mᵈᵐᵃ (Lp E p μ) := Subtype.val_injective.mulAction _ fun _ _ ↦ rfl
instance : DistribMulAction Mᵈᵐᵃ (Lp E p μ) :=
Subtype.val_injective.distribMulAction ⟨⟨_, rfl⟩, fun _ _ ↦ rfl⟩ fun _ _ ↦ rfl
end MulAction
end DomMulAct
|
MeasureTheory\Function\SpecialFunctions\Arctan.lean | /-
Copyright (c) 2020 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan
import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic
/-!
# Measurability of arctan
-/
namespace Real
@[measurability]
theorem measurable_arctan : Measurable arctan :=
continuous_arctan.measurable
end Real
section RealComposition
open Real
variable {α : Type*} {m : MeasurableSpace α} {f : α → ℝ} (hf : Measurable f)
@[measurability]
theorem Measurable.arctan : Measurable fun x => arctan (f x) :=
measurable_arctan.comp hf
end RealComposition
|
MeasureTheory\Function\SpecialFunctions\Basic.lean | /-
Copyright (c) 2020 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal
import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex
import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric
/-!
# Measurability of real and complex functions
We show that most standard real and complex functions are measurable, notably `exp`, `cos`, `sin`,
`cosh`, `sinh`, `log`, `pow`, `arcsin`, `arccos`.
See also `MeasureTheory.Function.SpecialFunctions.Arctan` and
`MeasureTheory.Function.SpecialFunctions.Inner`, which have been split off to minimize imports.
-/
noncomputable section
open NNReal ENNReal
namespace Real
@[measurability]
theorem measurable_exp : Measurable exp :=
continuous_exp.measurable
@[measurability]
theorem measurable_log : Measurable log :=
measurable_of_measurable_on_compl_singleton 0 <|
Continuous.measurable <| continuousOn_iff_continuous_restrict.1 continuousOn_log
lemma measurable_of_measurable_exp {α : Type*} {_ : MeasurableSpace α} {f : α → ℝ}
(hf : Measurable (fun x ↦ exp (f x))) :
Measurable f := by
have : f = fun x ↦ log (exp (f x)) := by ext; rw [log_exp]
rw [this]
exact measurable_log.comp hf
lemma aemeasurable_of_aemeasurable_exp {α : Type*} {_ : MeasurableSpace α} {f : α → ℝ}
{μ : MeasureTheory.Measure α} (hf : AEMeasurable (fun x ↦ exp (f x)) μ) :
AEMeasurable f μ := by
have : f = fun x ↦ log (exp (f x)) := by ext; rw [log_exp]
rw [this]
exact measurable_log.comp_aemeasurable hf
@[measurability]
theorem measurable_sin : Measurable sin :=
continuous_sin.measurable
@[measurability]
theorem measurable_cos : Measurable cos :=
continuous_cos.measurable
@[measurability]
theorem measurable_sinh : Measurable sinh :=
continuous_sinh.measurable
@[measurability]
theorem measurable_cosh : Measurable cosh :=
continuous_cosh.measurable
@[measurability]
theorem measurable_arcsin : Measurable arcsin :=
continuous_arcsin.measurable
@[measurability]
theorem measurable_arccos : Measurable arccos :=
continuous_arccos.measurable
end Real
namespace Complex
@[measurability]
theorem measurable_re : Measurable re :=
continuous_re.measurable
@[measurability]
theorem measurable_im : Measurable im :=
continuous_im.measurable
@[measurability]
theorem measurable_ofReal : Measurable ((↑) : ℝ → ℂ) :=
continuous_ofReal.measurable
@[measurability]
theorem measurable_exp : Measurable exp :=
continuous_exp.measurable
@[measurability]
theorem measurable_sin : Measurable sin :=
continuous_sin.measurable
@[measurability]
theorem measurable_cos : Measurable cos :=
continuous_cos.measurable
@[measurability]
theorem measurable_sinh : Measurable sinh :=
continuous_sinh.measurable
@[measurability]
theorem measurable_cosh : Measurable cosh :=
continuous_cosh.measurable
@[measurability]
theorem measurable_arg : Measurable arg :=
have A : Measurable fun x : ℂ => Real.arcsin (x.im / Complex.abs x) :=
Real.measurable_arcsin.comp (measurable_im.div measurable_norm)
have B : Measurable fun x : ℂ => Real.arcsin ((-x).im / Complex.abs x) :=
Real.measurable_arcsin.comp ((measurable_im.comp measurable_neg).div measurable_norm)
Measurable.ite (isClosed_le continuous_const continuous_re).measurableSet A <|
Measurable.ite (isClosed_le continuous_const continuous_im).measurableSet (B.add_const _)
(B.sub_const _)
@[measurability]
theorem measurable_log : Measurable log :=
(measurable_ofReal.comp <| Real.measurable_log.comp measurable_norm).add <|
(measurable_ofReal.comp measurable_arg).mul_const I
end Complex
section RealComposition
open Real
variable {α : Type*} {m : MeasurableSpace α} {f : α → ℝ} (hf : Measurable f)
@[measurability]
theorem Measurable.exp : Measurable fun x => Real.exp (f x) :=
Real.measurable_exp.comp hf
@[measurability]
theorem Measurable.log : Measurable fun x => log (f x) :=
measurable_log.comp hf
@[measurability]
theorem Measurable.cos : Measurable fun x => Real.cos (f x) :=
Real.measurable_cos.comp hf
@[measurability]
theorem Measurable.sin : Measurable fun x => Real.sin (f x) :=
Real.measurable_sin.comp hf
@[measurability]
theorem Measurable.cosh : Measurable fun x => Real.cosh (f x) :=
Real.measurable_cosh.comp hf
@[measurability]
theorem Measurable.sinh : Measurable fun x => Real.sinh (f x) :=
Real.measurable_sinh.comp hf
@[measurability]
theorem Measurable.sqrt : Measurable fun x => √(f x) :=
continuous_sqrt.measurable.comp hf
end RealComposition
section ComplexComposition
open Complex
variable {α : Type*} {m : MeasurableSpace α} {f : α → ℂ} (hf : Measurable f)
@[measurability]
theorem Measurable.cexp : Measurable fun x => Complex.exp (f x) :=
Complex.measurable_exp.comp hf
@[measurability]
theorem Measurable.ccos : Measurable fun x => Complex.cos (f x) :=
Complex.measurable_cos.comp hf
@[measurability]
theorem Measurable.csin : Measurable fun x => Complex.sin (f x) :=
Complex.measurable_sin.comp hf
@[measurability]
theorem Measurable.ccosh : Measurable fun x => Complex.cosh (f x) :=
Complex.measurable_cosh.comp hf
@[measurability]
theorem Measurable.csinh : Measurable fun x => Complex.sinh (f x) :=
Complex.measurable_sinh.comp hf
@[measurability]
theorem Measurable.carg : Measurable fun x => arg (f x) :=
measurable_arg.comp hf
@[measurability]
theorem Measurable.clog : Measurable fun x => Complex.log (f x) :=
measurable_log.comp hf
end ComplexComposition
section PowInstances
instance Complex.hasMeasurablePow : MeasurablePow ℂ ℂ :=
⟨Measurable.ite (measurable_fst (measurableSet_singleton 0))
(Measurable.ite (measurable_snd (measurableSet_singleton 0)) measurable_one measurable_zero)
(measurable_fst.clog.mul measurable_snd).cexp⟩
instance Real.hasMeasurablePow : MeasurablePow ℝ ℝ :=
⟨Complex.measurable_re.comp <|
(Complex.measurable_ofReal.comp measurable_fst).pow
(Complex.measurable_ofReal.comp measurable_snd)⟩
instance NNReal.hasMeasurablePow : MeasurablePow ℝ≥0 ℝ :=
⟨(measurable_fst.coe_nnreal_real.pow measurable_snd).subtype_mk⟩
instance ENNReal.hasMeasurablePow : MeasurablePow ℝ≥0∞ ℝ := by
refine ⟨ENNReal.measurable_of_measurable_nnreal_prod ?_ ?_⟩
· simp_rw [ENNReal.coe_rpow_def]
refine Measurable.ite ?_ measurable_const (measurable_fst.pow measurable_snd).coe_nnreal_ennreal
exact
MeasurableSet.inter (measurable_fst (measurableSet_singleton 0))
(measurable_snd measurableSet_Iio)
· simp_rw [ENNReal.top_rpow_def]
refine Measurable.ite measurableSet_Ioi measurable_const ?_
exact Measurable.ite (measurableSet_singleton 0) measurable_const measurable_const
end PowInstances
-- Guard against import creep:
assert_not_exists InnerProductSpace
assert_not_exists Real.arctan
assert_not_exists FiniteDimensional.proper
|
MeasureTheory\Function\SpecialFunctions\Inner.lean | /-
Copyright (c) 2020 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.Analysis.InnerProductSpace.Basic
import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex
/-!
# Measurability of scalar products
-/
variable {α : Type*} {𝕜 : Type*} {E : Type*}
variable [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E]
local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y
@[aesop safe 20 apply (rule_sets := [Measurable])]
theorem Measurable.inner {_ : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
[SecondCountableTopology E] {f g : α → E} (hf : Measurable f)
(hg : Measurable g) : Measurable fun t => ⟪f t, g t⟫ :=
Continuous.measurable2 continuous_inner hf hg
@[measurability]
theorem Measurable.const_inner {_ : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
[SecondCountableTopology E] {c : E} {f : α → E} (hf : Measurable f) :
Measurable fun t => ⟪c, f t⟫ :=
Measurable.inner measurable_const hf
@[measurability]
theorem Measurable.inner_const {_ : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
[SecondCountableTopology E] {c : E} {f : α → E} (hf : Measurable f) :
Measurable fun t => ⟪f t, c⟫ :=
Measurable.inner hf measurable_const
@[aesop safe 20 apply (rule_sets := [Measurable])]
theorem AEMeasurable.inner {m : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
[SecondCountableTopology E] {μ : MeasureTheory.Measure α} {f g : α → E}
(hf : AEMeasurable f μ) (hg : AEMeasurable g μ) : AEMeasurable (fun x => ⟪f x, g x⟫) μ := by
refine ⟨fun x => ⟪hf.mk f x, hg.mk g x⟫, hf.measurable_mk.inner hg.measurable_mk, ?_⟩
refine hf.ae_eq_mk.mp (hg.ae_eq_mk.mono fun x hxg hxf => ?_)
dsimp only
congr
set_option linter.unusedVariables false in
@[measurability]
theorem AEMeasurable.const_inner {m : MeasurableSpace α} [MeasurableSpace E]
[OpensMeasurableSpace E] [SecondCountableTopology E]
{μ : MeasureTheory.Measure α} {f : α → E} {c : E} (hf : AEMeasurable f μ) :
AEMeasurable (fun x => ⟪c, f x⟫) μ :=
AEMeasurable.inner aemeasurable_const hf
set_option linter.unusedVariables false in
@[measurability]
theorem AEMeasurable.inner_const {m : MeasurableSpace α} [MeasurableSpace E]
[OpensMeasurableSpace E] [SecondCountableTopology E]
{μ : MeasureTheory.Measure α} {f : α → E} {c : E} (hf : AEMeasurable f μ) :
AEMeasurable (fun x => ⟪f x, c⟫) μ :=
AEMeasurable.inner hf aemeasurable_const
|
MeasureTheory\Function\SpecialFunctions\RCLike.lean | /-
Copyright (c) 2020 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.Analysis.RCLike.Lemmas
import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex
/-!
# Measurability of the basic `RCLike` functions
-/
noncomputable section
open NNReal ENNReal
namespace RCLike
variable {𝕜 : Type*} [RCLike 𝕜]
@[measurability]
theorem measurable_re : Measurable (re : 𝕜 → ℝ) :=
continuous_re.measurable
@[measurability]
theorem measurable_im : Measurable (im : 𝕜 → ℝ) :=
continuous_im.measurable
end RCLike
section RCLikeComposition
variable {α 𝕜 : Type*} [RCLike 𝕜] {m : MeasurableSpace α} {f : α → 𝕜}
{μ : MeasureTheory.Measure α}
@[measurability]
theorem Measurable.re (hf : Measurable f) : Measurable fun x => RCLike.re (f x) :=
RCLike.measurable_re.comp hf
@[measurability]
theorem AEMeasurable.re (hf : AEMeasurable f μ) : AEMeasurable (fun x => RCLike.re (f x)) μ :=
RCLike.measurable_re.comp_aemeasurable hf
@[measurability]
theorem Measurable.im (hf : Measurable f) : Measurable fun x => RCLike.im (f x) :=
RCLike.measurable_im.comp hf
@[measurability]
theorem AEMeasurable.im (hf : AEMeasurable f μ) : AEMeasurable (fun x => RCLike.im (f x)) μ :=
RCLike.measurable_im.comp_aemeasurable hf
end RCLikeComposition
section
variable {α 𝕜 : Type*} [RCLike 𝕜] [MeasurableSpace α] {f : α → 𝕜} {μ : MeasureTheory.Measure α}
@[measurability]
theorem RCLike.measurable_ofReal : Measurable ((↑) : ℝ → 𝕜) :=
RCLike.continuous_ofReal.measurable
theorem measurable_of_re_im (hre : Measurable fun x => RCLike.re (f x))
(him : Measurable fun x => RCLike.im (f x)) : Measurable f := by
convert Measurable.add (M := 𝕜) (RCLike.measurable_ofReal.comp hre)
((RCLike.measurable_ofReal.comp him).mul_const RCLike.I)
exact (RCLike.re_add_im _).symm
theorem aemeasurable_of_re_im (hre : AEMeasurable (fun x => RCLike.re (f x)) μ)
(him : AEMeasurable (fun x => RCLike.im (f x)) μ) : AEMeasurable f μ := by
convert AEMeasurable.add (M := 𝕜) (RCLike.measurable_ofReal.comp_aemeasurable hre)
((RCLike.measurable_ofReal.comp_aemeasurable him).mul_const RCLike.I)
exact (RCLike.re_add_im _).symm
end
|
MeasureTheory\Function\StronglyMeasurable\Basic.lean | /-
Copyright (c) 2021 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
-/
import Mathlib.Analysis.Normed.Module.Basic
import Mathlib.MeasureTheory.Function.SimpleFuncDense
/-!
# Strongly measurable and finitely strongly measurable functions
A function `f` is said to be strongly measurable if `f` is the sequential limit of simple functions.
It is said to be finitely strongly measurable with respect to a measure `μ` if the supports
of those simple functions have finite measure. We also provide almost everywhere versions of
these notions.
Almost everywhere strongly measurable functions form the largest class of functions that can be
integrated using the Bochner integral.
If the target space has a second countable topology, strongly measurable and measurable are
equivalent.
If the measure is sigma-finite, strongly measurable and finitely strongly measurable are equivalent.
The main property of finitely strongly measurable functions is
`FinStronglyMeasurable.exists_set_sigmaFinite`: there exists a measurable set `t` such that the
function is supported on `t` and `μ.restrict t` is sigma-finite. As a consequence, we can prove some
results for those functions as if the measure was sigma-finite.
## Main definitions
* `StronglyMeasurable f`: `f : α → β` is the limit of a sequence `fs : ℕ → SimpleFunc α β`.
* `FinStronglyMeasurable f μ`: `f : α → β` is the limit of a sequence `fs : ℕ → SimpleFunc α β`
such that for all `n ∈ ℕ`, the measure of the support of `fs n` is finite.
* `AEStronglyMeasurable f μ`: `f` is almost everywhere equal to a `StronglyMeasurable` function.
* `AEFinStronglyMeasurable f μ`: `f` is almost everywhere equal to a `FinStronglyMeasurable`
function.
* `AEFinStronglyMeasurable.sigmaFiniteSet`: a measurable set `t` such that
`f =ᵐ[μ.restrict tᶜ] 0` and `μ.restrict t` is sigma-finite.
## Main statements
* `AEFinStronglyMeasurable.exists_set_sigmaFinite`: there exists a measurable set `t` such that
`f =ᵐ[μ.restrict tᶜ] 0` and `μ.restrict t` is sigma-finite.
We provide a solid API for strongly measurable functions, and for almost everywhere strongly
measurable functions, as a basis for the Bochner integral.
## References
* Hytönen, Tuomas, Jan Van Neerven, Mark Veraar, and Lutz Weis. Analysis in Banach spaces.
Springer, 2016.
-/
open MeasureTheory Filter TopologicalSpace Function Set MeasureTheory.Measure
open ENNReal Topology MeasureTheory NNReal
variable {α β γ ι : Type*} [Countable ι]
namespace MeasureTheory
local infixr:25 " →ₛ " => SimpleFunc
section Definitions
variable [TopologicalSpace β]
/-- A function is `StronglyMeasurable` if it is the limit of simple functions. -/
def StronglyMeasurable [MeasurableSpace α] (f : α → β) : Prop :=
∃ fs : ℕ → α →ₛ β, ∀ x, Tendsto (fun n => fs n x) atTop (𝓝 (f x))
/-- The notation for StronglyMeasurable giving the measurable space instance explicitly. -/
scoped notation "StronglyMeasurable[" m "]" => @MeasureTheory.StronglyMeasurable _ _ _ m
/-- A function is `FinStronglyMeasurable` with respect to a measure if it is the limit of simple
functions with support with finite measure. -/
def FinStronglyMeasurable [Zero β]
{_ : MeasurableSpace α} (f : α → β) (μ : Measure α := by volume_tac) : Prop :=
∃ fs : ℕ → α →ₛ β, (∀ n, μ (support (fs n)) < ∞) ∧ ∀ x, Tendsto (fun n => fs n x) atTop (𝓝 (f x))
/-- A function is `AEStronglyMeasurable` with respect to a measure `μ` if it is almost everywhere
equal to the limit of a sequence of simple functions. -/
@[fun_prop]
def AEStronglyMeasurable
{_ : MeasurableSpace α} (f : α → β) (μ : Measure α := by volume_tac) : Prop :=
∃ g, StronglyMeasurable g ∧ f =ᵐ[μ] g
/-- A function is `AEFinStronglyMeasurable` with respect to a measure if it is almost everywhere
equal to the limit of a sequence of simple functions with support with finite measure. -/
def AEFinStronglyMeasurable
[Zero β] {_ : MeasurableSpace α} (f : α → β) (μ : Measure α := by volume_tac) : Prop :=
∃ g, FinStronglyMeasurable g μ ∧ f =ᵐ[μ] g
end Definitions
open MeasureTheory
/-! ## Strongly measurable functions -/
@[aesop 30% apply (rule_sets := [Measurable])]
protected theorem StronglyMeasurable.aestronglyMeasurable {α β} {_ : MeasurableSpace α}
[TopologicalSpace β] {f : α → β} {μ : Measure α} (hf : StronglyMeasurable f) :
AEStronglyMeasurable f μ :=
⟨f, hf, EventuallyEq.refl _ _⟩
@[simp]
theorem Subsingleton.stronglyMeasurable {α β} [MeasurableSpace α] [TopologicalSpace β]
[Subsingleton β] (f : α → β) : StronglyMeasurable f := by
let f_sf : α →ₛ β := ⟨f, fun x => ?_, Set.Subsingleton.finite Set.subsingleton_of_subsingleton⟩
· exact ⟨fun _ => f_sf, fun x => tendsto_const_nhds⟩
· have h_univ : f ⁻¹' {x} = Set.univ := by
ext1 y
simp [eq_iff_true_of_subsingleton]
rw [h_univ]
exact MeasurableSet.univ
theorem SimpleFunc.stronglyMeasurable {α β} {_ : MeasurableSpace α} [TopologicalSpace β]
(f : α →ₛ β) : StronglyMeasurable f :=
⟨fun _ => f, fun _ => tendsto_const_nhds⟩
@[nontriviality]
theorem StronglyMeasurable.of_finite [Finite α] {_ : MeasurableSpace α}
[MeasurableSingletonClass α] [TopologicalSpace β]
(f : α → β) : StronglyMeasurable f :=
⟨fun _ => SimpleFunc.ofFinite f, fun _ => tendsto_const_nhds⟩
@[deprecated (since := "2024-02-05")]
alias stronglyMeasurable_of_fintype := StronglyMeasurable.of_finite
@[deprecated StronglyMeasurable.of_finite (since := "2024-02-06")]
theorem stronglyMeasurable_of_isEmpty [IsEmpty α] {_ : MeasurableSpace α} [TopologicalSpace β]
(f : α → β) : StronglyMeasurable f :=
.of_finite f
theorem stronglyMeasurable_const {α β} {_ : MeasurableSpace α} [TopologicalSpace β] {b : β} :
StronglyMeasurable fun _ : α => b :=
⟨fun _ => SimpleFunc.const α b, fun _ => tendsto_const_nhds⟩
@[to_additive]
theorem stronglyMeasurable_one {α β} {_ : MeasurableSpace α} [TopologicalSpace β] [One β] :
StronglyMeasurable (1 : α → β) :=
stronglyMeasurable_const
/-- A version of `stronglyMeasurable_const` that assumes `f x = f y` for all `x, y`.
This version works for functions between empty types. -/
theorem stronglyMeasurable_const' {α β} {m : MeasurableSpace α} [TopologicalSpace β] {f : α → β}
(hf : ∀ x y, f x = f y) : StronglyMeasurable f := by
nontriviality α
inhabit α
convert stronglyMeasurable_const (β := β) using 1
exact funext fun x => hf x default
-- Porting note: changed binding type of `MeasurableSpace α`.
@[simp]
theorem Subsingleton.stronglyMeasurable' {α β} [MeasurableSpace α] [TopologicalSpace β]
[Subsingleton α] (f : α → β) : StronglyMeasurable f :=
stronglyMeasurable_const' fun x y => by rw [Subsingleton.elim x y]
namespace StronglyMeasurable
variable {f g : α → β}
section BasicPropertiesInAnyTopologicalSpace
variable [TopologicalSpace β]
/-- A sequence of simple functions such that
`∀ x, Tendsto (fun n => hf.approx n x) atTop (𝓝 (f x))`.
That property is given by `stronglyMeasurable.tendsto_approx`. -/
protected noncomputable def approx {_ : MeasurableSpace α} (hf : StronglyMeasurable f) :
ℕ → α →ₛ β :=
hf.choose
protected theorem tendsto_approx {_ : MeasurableSpace α} (hf : StronglyMeasurable f) :
∀ x, Tendsto (fun n => hf.approx n x) atTop (𝓝 (f x)) :=
hf.choose_spec
/-- Similar to `stronglyMeasurable.approx`, but enforces that the norm of every function in the
sequence is less than `c` everywhere. If `‖f x‖ ≤ c` this sequence of simple functions verifies
`Tendsto (fun n => hf.approxBounded n x) atTop (𝓝 (f x))`. -/
noncomputable def approxBounded {_ : MeasurableSpace α} [Norm β] [SMul ℝ β]
(hf : StronglyMeasurable f) (c : ℝ) : ℕ → SimpleFunc α β := fun n =>
(hf.approx n).map fun x => min 1 (c / ‖x‖) • x
theorem tendsto_approxBounded_of_norm_le {β} {f : α → β} [NormedAddCommGroup β] [NormedSpace ℝ β]
{m : MeasurableSpace α} (hf : StronglyMeasurable[m] f) {c : ℝ} {x : α} (hfx : ‖f x‖ ≤ c) :
Tendsto (fun n => hf.approxBounded c n x) atTop (𝓝 (f x)) := by
have h_tendsto := hf.tendsto_approx x
simp only [StronglyMeasurable.approxBounded, SimpleFunc.coe_map, Function.comp_apply]
by_cases hfx0 : ‖f x‖ = 0
· rw [norm_eq_zero] at hfx0
rw [hfx0] at h_tendsto ⊢
have h_tendsto_norm : Tendsto (fun n => ‖hf.approx n x‖) atTop (𝓝 0) := by
convert h_tendsto.norm
rw [norm_zero]
refine squeeze_zero_norm (fun n => ?_) h_tendsto_norm
calc
‖min 1 (c / ‖hf.approx n x‖) • hf.approx n x‖ =
‖min 1 (c / ‖hf.approx n x‖)‖ * ‖hf.approx n x‖ :=
norm_smul _ _
_ ≤ ‖(1 : ℝ)‖ * ‖hf.approx n x‖ := by
refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg _)
rw [norm_one, Real.norm_of_nonneg]
· exact min_le_left _ _
· exact le_min zero_le_one (div_nonneg ((norm_nonneg _).trans hfx) (norm_nonneg _))
_ = ‖hf.approx n x‖ := by rw [norm_one, one_mul]
rw [← one_smul ℝ (f x)]
refine Tendsto.smul ?_ h_tendsto
have : min 1 (c / ‖f x‖) = 1 := by
rw [min_eq_left_iff, one_le_div (lt_of_le_of_ne (norm_nonneg _) (Ne.symm hfx0))]
exact hfx
nth_rw 2 [this.symm]
refine Tendsto.min tendsto_const_nhds ?_
exact Tendsto.div tendsto_const_nhds h_tendsto.norm hfx0
theorem tendsto_approxBounded_ae {β} {f : α → β} [NormedAddCommGroup β] [NormedSpace ℝ β]
{m m0 : MeasurableSpace α} {μ : Measure α} (hf : StronglyMeasurable[m] f) {c : ℝ}
(hf_bound : ∀ᵐ x ∂μ, ‖f x‖ ≤ c) :
∀ᵐ x ∂μ, Tendsto (fun n => hf.approxBounded c n x) atTop (𝓝 (f x)) := by
filter_upwards [hf_bound] with x hfx using tendsto_approxBounded_of_norm_le hf hfx
theorem norm_approxBounded_le {β} {f : α → β} [SeminormedAddCommGroup β] [NormedSpace ℝ β]
{m : MeasurableSpace α} {c : ℝ} (hf : StronglyMeasurable[m] f) (hc : 0 ≤ c) (n : ℕ) (x : α) :
‖hf.approxBounded c n x‖ ≤ c := by
simp only [StronglyMeasurable.approxBounded, SimpleFunc.coe_map, Function.comp_apply]
refine (norm_smul_le _ _).trans ?_
by_cases h0 : ‖hf.approx n x‖ = 0
· simp only [h0, _root_.div_zero, min_eq_right, zero_le_one, norm_zero, mul_zero]
exact hc
rcases le_total ‖hf.approx n x‖ c with h | h
· rw [min_eq_left _]
· simpa only [norm_one, one_mul] using h
· rwa [one_le_div (lt_of_le_of_ne (norm_nonneg _) (Ne.symm h0))]
· rw [min_eq_right _]
· rw [norm_div, norm_norm, mul_comm, mul_div, div_eq_mul_inv, mul_comm, ← mul_assoc,
inv_mul_cancel h0, one_mul, Real.norm_of_nonneg hc]
· rwa [div_le_one (lt_of_le_of_ne (norm_nonneg _) (Ne.symm h0))]
theorem _root_.stronglyMeasurable_bot_iff [Nonempty β] [T2Space β] :
StronglyMeasurable[⊥] f ↔ ∃ c, f = fun _ => c := by
cases' isEmpty_or_nonempty α with hα hα
· simp only [@Subsingleton.stronglyMeasurable' _ _ ⊥ _ _ f,
eq_iff_true_of_subsingleton, exists_const]
refine ⟨fun hf => ?_, fun hf_eq => ?_⟩
· refine ⟨f hα.some, ?_⟩
let fs := hf.approx
have h_fs_tendsto : ∀ x, Tendsto (fun n => fs n x) atTop (𝓝 (f x)) := hf.tendsto_approx
have : ∀ n, ∃ c, ∀ x, fs n x = c := fun n => SimpleFunc.simpleFunc_bot (fs n)
let cs n := (this n).choose
have h_cs_eq : ∀ n, ⇑(fs n) = fun _ => cs n := fun n => funext (this n).choose_spec
conv at h_fs_tendsto => enter [x, 1, n]; rw [h_cs_eq]
have h_tendsto : Tendsto cs atTop (𝓝 (f hα.some)) := h_fs_tendsto hα.some
ext1 x
exact tendsto_nhds_unique (h_fs_tendsto x) h_tendsto
· obtain ⟨c, rfl⟩ := hf_eq
exact stronglyMeasurable_const
end BasicPropertiesInAnyTopologicalSpace
theorem finStronglyMeasurable_of_set_sigmaFinite [TopologicalSpace β] [Zero β]
{m : MeasurableSpace α} {μ : Measure α} (hf_meas : StronglyMeasurable f) {t : Set α}
(ht : MeasurableSet t) (hft_zero : ∀ x ∈ tᶜ, f x = 0) (htμ : SigmaFinite (μ.restrict t)) :
FinStronglyMeasurable f μ := by
haveI : SigmaFinite (μ.restrict t) := htμ
let S := spanningSets (μ.restrict t)
have hS_meas : ∀ n, MeasurableSet (S n) := measurable_spanningSets (μ.restrict t)
let f_approx := hf_meas.approx
let fs n := SimpleFunc.restrict (f_approx n) (S n ∩ t)
have h_fs_t_compl : ∀ n, ∀ x, x ∉ t → fs n x = 0 := by
intro n x hxt
rw [SimpleFunc.restrict_apply _ ((hS_meas n).inter ht)]
refine Set.indicator_of_not_mem ?_ _
simp [hxt]
refine ⟨fs, ?_, fun x => ?_⟩
· simp_rw [SimpleFunc.support_eq]
refine fun n => (measure_biUnion_finset_le _ _).trans_lt ?_
refine ENNReal.sum_lt_top_iff.mpr fun y hy => ?_
rw [SimpleFunc.restrict_preimage_singleton _ ((hS_meas n).inter ht)]
swap
· letI : (y : β) → Decidable (y = 0) := fun y => Classical.propDecidable _
rw [Finset.mem_filter] at hy
exact hy.2
refine (measure_mono Set.inter_subset_left).trans_lt ?_
have h_lt_top := measure_spanningSets_lt_top (μ.restrict t) n
rwa [Measure.restrict_apply' ht] at h_lt_top
· by_cases hxt : x ∈ t
swap
· rw [funext fun n => h_fs_t_compl n x hxt, hft_zero x hxt]
exact tendsto_const_nhds
have h : Tendsto (fun n => (f_approx n) x) atTop (𝓝 (f x)) := hf_meas.tendsto_approx x
obtain ⟨n₁, hn₁⟩ : ∃ n, ∀ m, n ≤ m → fs m x = f_approx m x := by
obtain ⟨n, hn⟩ : ∃ n, ∀ m, n ≤ m → x ∈ S m ∩ t := by
rsuffices ⟨n, hn⟩ : ∃ n, ∀ m, n ≤ m → x ∈ S m
· exact ⟨n, fun m hnm => Set.mem_inter (hn m hnm) hxt⟩
rsuffices ⟨n, hn⟩ : ∃ n, x ∈ S n
· exact ⟨n, fun m hnm => monotone_spanningSets (μ.restrict t) hnm hn⟩
rw [← Set.mem_iUnion, iUnion_spanningSets (μ.restrict t)]
trivial
refine ⟨n, fun m hnm => ?_⟩
simp_rw [fs, SimpleFunc.restrict_apply _ ((hS_meas m).inter ht),
Set.indicator_of_mem (hn m hnm)]
rw [tendsto_atTop'] at h ⊢
intro s hs
obtain ⟨n₂, hn₂⟩ := h s hs
refine ⟨max n₁ n₂, fun m hm => ?_⟩
rw [hn₁ m ((le_max_left _ _).trans hm.le)]
exact hn₂ m ((le_max_right _ _).trans hm.le)
/-- If the measure is sigma-finite, all strongly measurable functions are
`FinStronglyMeasurable`. -/
@[aesop 5% apply (rule_sets := [Measurable])]
protected theorem finStronglyMeasurable [TopologicalSpace β] [Zero β] {m0 : MeasurableSpace α}
(hf : StronglyMeasurable f) (μ : Measure α) [SigmaFinite μ] : FinStronglyMeasurable f μ :=
hf.finStronglyMeasurable_of_set_sigmaFinite MeasurableSet.univ (by simp)
(by rwa [Measure.restrict_univ])
/-- A strongly measurable function is measurable. -/
@[aesop 5% apply (rule_sets := [Measurable])]
protected theorem measurable {_ : MeasurableSpace α} [TopologicalSpace β] [PseudoMetrizableSpace β]
[MeasurableSpace β] [BorelSpace β] (hf : StronglyMeasurable f) : Measurable f :=
measurable_of_tendsto_metrizable (fun n => (hf.approx n).measurable)
(tendsto_pi_nhds.mpr hf.tendsto_approx)
/-- A strongly measurable function is almost everywhere measurable. -/
@[aesop 5% apply (rule_sets := [Measurable])]
protected theorem aemeasurable {_ : MeasurableSpace α} [TopologicalSpace β]
[PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β] {μ : Measure α}
(hf : StronglyMeasurable f) : AEMeasurable f μ :=
hf.measurable.aemeasurable
theorem _root_.Continuous.comp_stronglyMeasurable {_ : MeasurableSpace α} [TopologicalSpace β]
[TopologicalSpace γ] {g : β → γ} {f : α → β} (hg : Continuous g) (hf : StronglyMeasurable f) :
StronglyMeasurable fun x => g (f x) :=
⟨fun n => SimpleFunc.map g (hf.approx n), fun x => (hg.tendsto _).comp (hf.tendsto_approx x)⟩
@[to_additive]
nonrec theorem measurableSet_mulSupport {m : MeasurableSpace α} [One β] [TopologicalSpace β]
[MetrizableSpace β] (hf : StronglyMeasurable f) : MeasurableSet (mulSupport f) := by
borelize β
exact measurableSet_mulSupport hf.measurable
protected theorem mono {m m' : MeasurableSpace α} [TopologicalSpace β]
(hf : StronglyMeasurable[m'] f) (h_mono : m' ≤ m) : StronglyMeasurable[m] f := by
let f_approx : ℕ → @SimpleFunc α m β := fun n =>
@SimpleFunc.mk α m β
(hf.approx n)
(fun x => h_mono _ (SimpleFunc.measurableSet_fiber' _ x))
(SimpleFunc.finite_range (hf.approx n))
exact ⟨f_approx, hf.tendsto_approx⟩
protected theorem prod_mk {m : MeasurableSpace α} [TopologicalSpace β] [TopologicalSpace γ]
{f : α → β} {g : α → γ} (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
StronglyMeasurable fun x => (f x, g x) := by
refine ⟨fun n => SimpleFunc.pair (hf.approx n) (hg.approx n), fun x => ?_⟩
rw [nhds_prod_eq]
exact Tendsto.prod_mk (hf.tendsto_approx x) (hg.tendsto_approx x)
theorem comp_measurable [TopologicalSpace β] {_ : MeasurableSpace α} {_ : MeasurableSpace γ}
{f : α → β} {g : γ → α} (hf : StronglyMeasurable f) (hg : Measurable g) :
StronglyMeasurable (f ∘ g) :=
⟨fun n => SimpleFunc.comp (hf.approx n) g hg, fun x => hf.tendsto_approx (g x)⟩
theorem of_uncurry_left [TopologicalSpace β] {_ : MeasurableSpace α} {_ : MeasurableSpace γ}
{f : α → γ → β} (hf : StronglyMeasurable (uncurry f)) {x : α} : StronglyMeasurable (f x) :=
hf.comp_measurable measurable_prod_mk_left
theorem of_uncurry_right [TopologicalSpace β] {_ : MeasurableSpace α} {_ : MeasurableSpace γ}
{f : α → γ → β} (hf : StronglyMeasurable (uncurry f)) {y : γ} :
StronglyMeasurable fun x => f x y :=
hf.comp_measurable measurable_prod_mk_right
section Arithmetic
variable {mα : MeasurableSpace α} [TopologicalSpace β]
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem mul [Mul β] [ContinuousMul β] (hf : StronglyMeasurable f)
(hg : StronglyMeasurable g) : StronglyMeasurable (f * g) :=
⟨fun n => hf.approx n * hg.approx n, fun x => (hf.tendsto_approx x).mul (hg.tendsto_approx x)⟩
@[to_additive (attr := measurability)]
theorem mul_const [Mul β] [ContinuousMul β] (hf : StronglyMeasurable f) (c : β) :
StronglyMeasurable fun x => f x * c :=
hf.mul stronglyMeasurable_const
@[to_additive (attr := measurability)]
theorem const_mul [Mul β] [ContinuousMul β] (hf : StronglyMeasurable f) (c : β) :
StronglyMeasurable fun x => c * f x :=
stronglyMeasurable_const.mul hf
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable])) const_nsmul]
protected theorem pow [Monoid β] [ContinuousMul β] (hf : StronglyMeasurable f) (n : ℕ) :
StronglyMeasurable (f ^ n) :=
⟨fun k => hf.approx k ^ n, fun x => (hf.tendsto_approx x).pow n⟩
@[to_additive (attr := measurability)]
protected theorem inv [Inv β] [ContinuousInv β] (hf : StronglyMeasurable f) :
StronglyMeasurable f⁻¹ :=
⟨fun n => (hf.approx n)⁻¹, fun x => (hf.tendsto_approx x).inv⟩
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem div [Div β] [ContinuousDiv β] (hf : StronglyMeasurable f)
(hg : StronglyMeasurable g) : StronglyMeasurable (f / g) :=
⟨fun n => hf.approx n / hg.approx n, fun x => (hf.tendsto_approx x).div' (hg.tendsto_approx x)⟩
@[to_additive]
theorem mul_iff_right [CommGroup β] [TopologicalGroup β] (hf : StronglyMeasurable f) :
StronglyMeasurable (f * g) ↔ StronglyMeasurable g :=
⟨fun h ↦ show g = f * g * f⁻¹ by simp only [mul_inv_cancel_comm] ▸ h.mul hf.inv,
fun h ↦ hf.mul h⟩
@[to_additive]
theorem mul_iff_left [CommGroup β] [TopologicalGroup β] (hf : StronglyMeasurable f) :
StronglyMeasurable (g * f) ↔ StronglyMeasurable g :=
mul_comm g f ▸ mul_iff_right hf
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem smul {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
{g : α → β} (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
StronglyMeasurable fun x => f x • g x :=
continuous_smul.comp_stronglyMeasurable (hf.prod_mk hg)
@[to_additive (attr := measurability)]
protected theorem const_smul {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (hf : StronglyMeasurable f)
(c : 𝕜) : StronglyMeasurable (c • f) :=
⟨fun n => c • hf.approx n, fun x => (hf.tendsto_approx x).const_smul c⟩
@[to_additive (attr := measurability)]
protected theorem const_smul' {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (hf : StronglyMeasurable f)
(c : 𝕜) : StronglyMeasurable fun x => c • f x :=
hf.const_smul c
@[to_additive (attr := measurability)]
protected theorem smul_const {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
(hf : StronglyMeasurable f) (c : β) : StronglyMeasurable fun x => f x • c :=
continuous_smul.comp_stronglyMeasurable (hf.prod_mk stronglyMeasurable_const)
/-- In a normed vector space, the addition of a measurable function and a strongly measurable
function is measurable. Note that this is not true without further second-countability assumptions
for the addition of two measurable functions. -/
theorem _root_.Measurable.add_stronglyMeasurable
{α E : Type*} {_ : MeasurableSpace α} [AddGroup E] [TopologicalSpace E]
[MeasurableSpace E] [BorelSpace E] [ContinuousAdd E] [PseudoMetrizableSpace E]
{g f : α → E} (hg : Measurable g) (hf : StronglyMeasurable f) :
Measurable (g + f) := by
rcases hf with ⟨φ, hφ⟩
have : Tendsto (fun n x ↦ g x + φ n x) atTop (𝓝 (g + f)) :=
tendsto_pi_nhds.2 (fun x ↦ tendsto_const_nhds.add (hφ x))
apply measurable_of_tendsto_metrizable (fun n ↦ ?_) this
exact hg.add_simpleFunc _
/-- In a normed vector space, the subtraction of a measurable function and a strongly measurable
function is measurable. Note that this is not true without further second-countability assumptions
for the subtraction of two measurable functions. -/
theorem _root_.Measurable.sub_stronglyMeasurable
{α E : Type*} {_ : MeasurableSpace α} [AddCommGroup E] [TopologicalSpace E]
[MeasurableSpace E] [BorelSpace E] [ContinuousAdd E] [ContinuousNeg E] [PseudoMetrizableSpace E]
{g f : α → E} (hg : Measurable g) (hf : StronglyMeasurable f) :
Measurable (g - f) := by
rw [sub_eq_add_neg]
exact hg.add_stronglyMeasurable hf.neg
/-- In a normed vector space, the addition of a strongly measurable function and a measurable
function is measurable. Note that this is not true without further second-countability assumptions
for the addition of two measurable functions. -/
theorem _root_.Measurable.stronglyMeasurable_add
{α E : Type*} {_ : MeasurableSpace α} [AddGroup E] [TopologicalSpace E]
[MeasurableSpace E] [BorelSpace E] [ContinuousAdd E] [PseudoMetrizableSpace E]
{g f : α → E} (hg : Measurable g) (hf : StronglyMeasurable f) :
Measurable (f + g) := by
rcases hf with ⟨φ, hφ⟩
have : Tendsto (fun n x ↦ φ n x + g x) atTop (𝓝 (f + g)) :=
tendsto_pi_nhds.2 (fun x ↦ (hφ x).add tendsto_const_nhds)
apply measurable_of_tendsto_metrizable (fun n ↦ ?_) this
exact hg.simpleFunc_add _
end Arithmetic
section MulAction
variable {M G G₀ : Type*}
variable [TopologicalSpace β]
variable [Monoid M] [MulAction M β] [ContinuousConstSMul M β]
variable [Group G] [MulAction G β] [ContinuousConstSMul G β]
variable [GroupWithZero G₀] [MulAction G₀ β] [ContinuousConstSMul G₀ β]
theorem _root_.stronglyMeasurable_const_smul_iff {m : MeasurableSpace α} (c : G) :
(StronglyMeasurable fun x => c • f x) ↔ StronglyMeasurable f :=
⟨fun h => by simpa only [inv_smul_smul] using h.const_smul' c⁻¹, fun h => h.const_smul c⟩
nonrec theorem _root_.IsUnit.stronglyMeasurable_const_smul_iff {_ : MeasurableSpace α} {c : M}
(hc : IsUnit c) :
(StronglyMeasurable fun x => c • f x) ↔ StronglyMeasurable f :=
let ⟨u, hu⟩ := hc
hu ▸ stronglyMeasurable_const_smul_iff u
theorem _root_.stronglyMeasurable_const_smul_iff₀ {_ : MeasurableSpace α} {c : G₀} (hc : c ≠ 0) :
(StronglyMeasurable fun x => c • f x) ↔ StronglyMeasurable f :=
(IsUnit.mk0 _ hc).stronglyMeasurable_const_smul_iff
end MulAction
section Order
variable [MeasurableSpace α] [TopologicalSpace β]
open Filter
open Filter
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem sup [Sup β] [ContinuousSup β] (hf : StronglyMeasurable f)
(hg : StronglyMeasurable g) : StronglyMeasurable (f ⊔ g) :=
⟨fun n => hf.approx n ⊔ hg.approx n, fun x =>
(hf.tendsto_approx x).sup_nhds (hg.tendsto_approx x)⟩
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem inf [Inf β] [ContinuousInf β] (hf : StronglyMeasurable f)
(hg : StronglyMeasurable g) : StronglyMeasurable (f ⊓ g) :=
⟨fun n => hf.approx n ⊓ hg.approx n, fun x =>
(hf.tendsto_approx x).inf_nhds (hg.tendsto_approx x)⟩
end Order
/-!
### Big operators: `∏` and `∑`
-/
section Monoid
variable {M : Type*} [Monoid M] [TopologicalSpace M] [ContinuousMul M] {m : MeasurableSpace α}
@[to_additive (attr := measurability)]
theorem _root_.List.stronglyMeasurable_prod' (l : List (α → M))
(hl : ∀ f ∈ l, StronglyMeasurable f) : StronglyMeasurable l.prod := by
induction' l with f l ihl; · exact stronglyMeasurable_one
rw [List.forall_mem_cons] at hl
rw [List.prod_cons]
exact hl.1.mul (ihl hl.2)
@[to_additive (attr := measurability)]
theorem _root_.List.stronglyMeasurable_prod (l : List (α → M))
(hl : ∀ f ∈ l, StronglyMeasurable f) :
StronglyMeasurable fun x => (l.map fun f : α → M => f x).prod := by
simpa only [← Pi.list_prod_apply] using l.stronglyMeasurable_prod' hl
end Monoid
section CommMonoid
variable {M : Type*} [CommMonoid M] [TopologicalSpace M] [ContinuousMul M] {m : MeasurableSpace α}
@[to_additive (attr := measurability)]
theorem _root_.Multiset.stronglyMeasurable_prod' (l : Multiset (α → M))
(hl : ∀ f ∈ l, StronglyMeasurable f) : StronglyMeasurable l.prod := by
rcases l with ⟨l⟩
simpa using l.stronglyMeasurable_prod' (by simpa using hl)
@[to_additive (attr := measurability)]
theorem _root_.Multiset.stronglyMeasurable_prod (s : Multiset (α → M))
(hs : ∀ f ∈ s, StronglyMeasurable f) :
StronglyMeasurable fun x => (s.map fun f : α → M => f x).prod := by
simpa only [← Pi.multiset_prod_apply] using s.stronglyMeasurable_prod' hs
@[to_additive (attr := measurability)]
theorem _root_.Finset.stronglyMeasurable_prod' {ι : Type*} {f : ι → α → M} (s : Finset ι)
(hf : ∀ i ∈ s, StronglyMeasurable (f i)) : StronglyMeasurable (∏ i ∈ s, f i) :=
Finset.prod_induction _ _ (fun _a _b ha hb => ha.mul hb) (@stronglyMeasurable_one α M _ _ _) hf
@[to_additive (attr := measurability)]
theorem _root_.Finset.stronglyMeasurable_prod {ι : Type*} {f : ι → α → M} (s : Finset ι)
(hf : ∀ i ∈ s, StronglyMeasurable (f i)) : StronglyMeasurable fun a => ∏ i ∈ s, f i a := by
simpa only [← Finset.prod_apply] using s.stronglyMeasurable_prod' hf
end CommMonoid
/-- The range of a strongly measurable function is separable. -/
protected theorem isSeparable_range {m : MeasurableSpace α} [TopologicalSpace β]
(hf : StronglyMeasurable f) : TopologicalSpace.IsSeparable (range f) := by
have : IsSeparable (closure (⋃ n, range (hf.approx n))) :=
.closure <| .iUnion fun n => (hf.approx n).finite_range.isSeparable
apply this.mono
rintro _ ⟨x, rfl⟩
apply mem_closure_of_tendsto (hf.tendsto_approx x)
filter_upwards with n
apply mem_iUnion_of_mem n
exact mem_range_self _
theorem separableSpace_range_union_singleton {_ : MeasurableSpace α} [TopologicalSpace β]
[PseudoMetrizableSpace β] (hf : StronglyMeasurable f) {b : β} :
SeparableSpace (range f ∪ {b} : Set β) :=
letI := pseudoMetrizableSpacePseudoMetric β
(hf.isSeparable_range.union (finite_singleton _).isSeparable).separableSpace
section SecondCountableStronglyMeasurable
variable {mα : MeasurableSpace α} [MeasurableSpace β]
/-- In a space with second countable topology, measurable implies strongly measurable. -/
@[aesop 90% apply (rule_sets := [Measurable])]
theorem _root_.Measurable.stronglyMeasurable [TopologicalSpace β] [PseudoMetrizableSpace β]
[SecondCountableTopology β] [OpensMeasurableSpace β] (hf : Measurable f) :
StronglyMeasurable f := by
letI := pseudoMetrizableSpacePseudoMetric β
nontriviality β; inhabit β
exact ⟨SimpleFunc.approxOn f hf Set.univ default (Set.mem_univ _), fun x ↦
SimpleFunc.tendsto_approxOn hf (Set.mem_univ _) (by rw [closure_univ]; simp)⟩
/-- In a space with second countable topology, strongly measurable and measurable are equivalent. -/
theorem _root_.stronglyMeasurable_iff_measurable [TopologicalSpace β] [MetrizableSpace β]
[BorelSpace β] [SecondCountableTopology β] : StronglyMeasurable f ↔ Measurable f :=
⟨fun h => h.measurable, fun h => Measurable.stronglyMeasurable h⟩
@[measurability]
theorem _root_.stronglyMeasurable_id [TopologicalSpace α] [PseudoMetrizableSpace α]
[OpensMeasurableSpace α] [SecondCountableTopology α] : StronglyMeasurable (id : α → α) :=
measurable_id.stronglyMeasurable
end SecondCountableStronglyMeasurable
/-- A function is strongly measurable if and only if it is measurable and has separable
range. -/
theorem _root_.stronglyMeasurable_iff_measurable_separable {m : MeasurableSpace α}
[TopologicalSpace β] [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β] :
StronglyMeasurable f ↔ Measurable f ∧ IsSeparable (range f) := by
refine ⟨fun H ↦ ⟨H.measurable, H.isSeparable_range⟩, fun ⟨Hm, Hsep⟩ ↦ ?_⟩
have := Hsep.secondCountableTopology
have Hm' : StronglyMeasurable (rangeFactorization f) := Hm.subtype_mk.stronglyMeasurable
exact continuous_subtype_val.comp_stronglyMeasurable Hm'
/-- A continuous function is strongly measurable when either the source space or the target space
is second-countable. -/
theorem _root_.Continuous.stronglyMeasurable [MeasurableSpace α] [TopologicalSpace α]
[OpensMeasurableSpace α] [TopologicalSpace β] [PseudoMetrizableSpace β]
[h : SecondCountableTopologyEither α β] {f : α → β} (hf : Continuous f) :
StronglyMeasurable f := by
borelize β
cases h.out
· rw [stronglyMeasurable_iff_measurable_separable]
refine ⟨hf.measurable, ?_⟩
exact isSeparable_range hf
· exact hf.measurable.stronglyMeasurable
/-- A continuous function whose support is contained in a compact set is strongly measurable. -/
@[to_additive]
theorem _root_.Continuous.stronglyMeasurable_of_mulSupport_subset_isCompact
[MeasurableSpace α] [TopologicalSpace α] [OpensMeasurableSpace α] [MeasurableSpace β]
[TopologicalSpace β] [PseudoMetrizableSpace β] [BorelSpace β] [One β] {f : α → β}
(hf : Continuous f) {k : Set α} (hk : IsCompact k)
(h'f : mulSupport f ⊆ k) : StronglyMeasurable f := by
letI : PseudoMetricSpace β := pseudoMetrizableSpacePseudoMetric β
rw [stronglyMeasurable_iff_measurable_separable]
exact ⟨hf.measurable, (isCompact_range_of_mulSupport_subset_isCompact hf hk h'f).isSeparable⟩
/-- A continuous function with compact support is strongly measurable. -/
@[to_additive]
theorem _root_.Continuous.stronglyMeasurable_of_hasCompactMulSupport
[MeasurableSpace α] [TopologicalSpace α] [OpensMeasurableSpace α] [MeasurableSpace β]
[TopologicalSpace β] [PseudoMetrizableSpace β] [BorelSpace β] [One β] {f : α → β}
(hf : Continuous f) (h'f : HasCompactMulSupport f) : StronglyMeasurable f :=
hf.stronglyMeasurable_of_mulSupport_subset_isCompact h'f (subset_mulTSupport f)
/-- A continuous function with compact support on a product space is strongly measurable for the
product sigma-algebra. The subtlety is that we do not assume that the spaces are separable, so the
product of the Borel sigma algebras might not contain all open sets, but still it contains enough
of them to approximate compactly supported continuous functions. -/
lemma _root_.HasCompactSupport.stronglyMeasurable_of_prod {X Y : Type*} [Zero α]
[TopologicalSpace X] [TopologicalSpace Y] [MeasurableSpace X] [MeasurableSpace Y]
[OpensMeasurableSpace X] [OpensMeasurableSpace Y] [TopologicalSpace α] [PseudoMetrizableSpace α]
{f : X × Y → α} (hf : Continuous f) (h'f : HasCompactSupport f) :
StronglyMeasurable f := by
borelize α
apply stronglyMeasurable_iff_measurable_separable.2 ⟨h'f.measurable_of_prod hf, ?_⟩
letI : PseudoMetricSpace α := pseudoMetrizableSpacePseudoMetric α
exact IsCompact.isSeparable (s := range f) (h'f.isCompact_range hf)
/-- If `g` is a topological embedding, then `f` is strongly measurable iff `g ∘ f` is. -/
theorem _root_.Embedding.comp_stronglyMeasurable_iff {m : MeasurableSpace α} [TopologicalSpace β]
[PseudoMetrizableSpace β] [TopologicalSpace γ] [PseudoMetrizableSpace γ] {g : β → γ} {f : α → β}
(hg : Embedding g) : (StronglyMeasurable fun x => g (f x)) ↔ StronglyMeasurable f := by
letI := pseudoMetrizableSpacePseudoMetric γ
borelize β γ
refine
⟨fun H => stronglyMeasurable_iff_measurable_separable.2 ⟨?_, ?_⟩, fun H =>
hg.continuous.comp_stronglyMeasurable H⟩
· let G : β → range g := rangeFactorization g
have hG : ClosedEmbedding G :=
{ hg.codRestrict _ _ with
isClosed_range := by
rw [surjective_onto_range.range_eq]
exact isClosed_univ }
have : Measurable (G ∘ f) := Measurable.subtype_mk H.measurable
exact hG.measurableEmbedding.measurable_comp_iff.1 this
· have : IsSeparable (g ⁻¹' range (g ∘ f)) := hg.isSeparable_preimage H.isSeparable_range
rwa [range_comp, hg.inj.preimage_image] at this
/-- A sequential limit of strongly measurable functions is strongly measurable. -/
theorem _root_.stronglyMeasurable_of_tendsto {ι : Type*} {m : MeasurableSpace α}
[TopologicalSpace β] [PseudoMetrizableSpace β] (u : Filter ι) [NeBot u] [IsCountablyGenerated u]
{f : ι → α → β} {g : α → β} (hf : ∀ i, StronglyMeasurable (f i)) (lim : Tendsto f u (𝓝 g)) :
StronglyMeasurable g := by
borelize β
refine stronglyMeasurable_iff_measurable_separable.2 ⟨?_, ?_⟩
· exact measurable_of_tendsto_metrizable' u (fun i => (hf i).measurable) lim
· rcases u.exists_seq_tendsto with ⟨v, hv⟩
have : IsSeparable (closure (⋃ i, range (f (v i)))) :=
.closure <| .iUnion fun i => (hf (v i)).isSeparable_range
apply this.mono
rintro _ ⟨x, rfl⟩
rw [tendsto_pi_nhds] at lim
apply mem_closure_of_tendsto ((lim x).comp hv)
filter_upwards with n
apply mem_iUnion_of_mem n
exact mem_range_self _
protected theorem piecewise {m : MeasurableSpace α} [TopologicalSpace β] {s : Set α}
{_ : DecidablePred (· ∈ s)} (hs : MeasurableSet s) (hf : StronglyMeasurable f)
(hg : StronglyMeasurable g) : StronglyMeasurable (Set.piecewise s f g) := by
refine ⟨fun n => SimpleFunc.piecewise s hs (hf.approx n) (hg.approx n), fun x => ?_⟩
by_cases hx : x ∈ s
· simpa [@Set.piecewise_eq_of_mem _ _ _ _ _ (fun _ => Classical.propDecidable _) _ hx,
hx] using hf.tendsto_approx x
· simpa [@Set.piecewise_eq_of_not_mem _ _ _ _ _ (fun _ => Classical.propDecidable _) _ hx,
hx] using hg.tendsto_approx x
/-- this is slightly different from `StronglyMeasurable.piecewise`. It can be used to show
`StronglyMeasurable (ite (x=0) 0 1)` by
`exact StronglyMeasurable.ite (measurableSet_singleton 0) stronglyMeasurable_const
stronglyMeasurable_const`, but replacing `StronglyMeasurable.ite` by
`StronglyMeasurable.piecewise` in that example proof does not work. -/
protected theorem ite {_ : MeasurableSpace α} [TopologicalSpace β] {p : α → Prop}
{_ : DecidablePred p} (hp : MeasurableSet { a : α | p a }) (hf : StronglyMeasurable f)
(hg : StronglyMeasurable g) : StronglyMeasurable fun x => ite (p x) (f x) (g x) :=
StronglyMeasurable.piecewise hp hf hg
@[measurability]
theorem _root_.MeasurableEmbedding.stronglyMeasurable_extend {f : α → β} {g : α → γ} {g' : γ → β}
{mα : MeasurableSpace α} {mγ : MeasurableSpace γ} [TopologicalSpace β]
(hg : MeasurableEmbedding g) (hf : StronglyMeasurable f) (hg' : StronglyMeasurable g') :
StronglyMeasurable (Function.extend g f g') := by
refine ⟨fun n => SimpleFunc.extend (hf.approx n) g hg (hg'.approx n), ?_⟩
intro x
by_cases hx : ∃ y, g y = x
· rcases hx with ⟨y, rfl⟩
simpa only [SimpleFunc.extend_apply, hg.injective, Injective.extend_apply] using
hf.tendsto_approx y
· simpa only [hx, SimpleFunc.extend_apply', not_false_iff, extend_apply'] using
hg'.tendsto_approx x
theorem _root_.MeasurableEmbedding.exists_stronglyMeasurable_extend {f : α → β} {g : α → γ}
{_ : MeasurableSpace α} {_ : MeasurableSpace γ} [TopologicalSpace β]
(hg : MeasurableEmbedding g) (hf : StronglyMeasurable f) (hne : γ → Nonempty β) :
∃ f' : γ → β, StronglyMeasurable f' ∧ f' ∘ g = f :=
⟨Function.extend g f fun x => Classical.choice (hne x),
hg.stronglyMeasurable_extend hf (stronglyMeasurable_const' fun _ _ => rfl),
funext fun _ => hg.injective.extend_apply _ _ _⟩
theorem _root_.stronglyMeasurable_of_stronglyMeasurable_union_cover {m : MeasurableSpace α}
[TopologicalSpace β] {f : α → β} (s t : Set α) (hs : MeasurableSet s) (ht : MeasurableSet t)
(h : univ ⊆ s ∪ t) (hc : StronglyMeasurable fun a : s => f a)
(hd : StronglyMeasurable fun a : t => f a) : StronglyMeasurable f := by
nontriviality β; inhabit β
suffices Function.extend Subtype.val (fun x : s ↦ f x)
(Function.extend (↑) (fun x : t ↦ f x) fun _ ↦ default) = f from
this ▸ (MeasurableEmbedding.subtype_coe hs).stronglyMeasurable_extend hc <|
(MeasurableEmbedding.subtype_coe ht).stronglyMeasurable_extend hd stronglyMeasurable_const
ext x
by_cases hxs : x ∈ s
· lift x to s using hxs
simp [Subtype.coe_injective.extend_apply]
· lift x to t using (h trivial).resolve_left hxs
rw [extend_apply', Subtype.coe_injective.extend_apply]
exact fun ⟨y, hy⟩ ↦ hxs <| hy ▸ y.2
theorem _root_.stronglyMeasurable_of_restrict_of_restrict_compl {_ : MeasurableSpace α}
[TopologicalSpace β] {f : α → β} {s : Set α} (hs : MeasurableSet s)
(h₁ : StronglyMeasurable (s.restrict f)) (h₂ : StronglyMeasurable (sᶜ.restrict f)) :
StronglyMeasurable f :=
stronglyMeasurable_of_stronglyMeasurable_union_cover s sᶜ hs hs.compl (union_compl_self s).ge h₁
h₂
@[measurability]
protected theorem indicator {_ : MeasurableSpace α} [TopologicalSpace β] [Zero β]
(hf : StronglyMeasurable f) {s : Set α} (hs : MeasurableSet s) :
StronglyMeasurable (s.indicator f) :=
hf.piecewise hs stronglyMeasurable_const
@[aesop safe 20 apply (rule_sets := [Measurable])]
protected theorem dist {_ : MeasurableSpace α} {β : Type*} [PseudoMetricSpace β] {f g : α → β}
(hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
StronglyMeasurable fun x => dist (f x) (g x) :=
continuous_dist.comp_stronglyMeasurable (hf.prod_mk hg)
@[measurability]
protected theorem norm {_ : MeasurableSpace α} {β : Type*} [SeminormedAddCommGroup β] {f : α → β}
(hf : StronglyMeasurable f) : StronglyMeasurable fun x => ‖f x‖ :=
continuous_norm.comp_stronglyMeasurable hf
@[measurability]
protected theorem nnnorm {_ : MeasurableSpace α} {β : Type*} [SeminormedAddCommGroup β] {f : α → β}
(hf : StronglyMeasurable f) : StronglyMeasurable fun x => ‖f x‖₊ :=
continuous_nnnorm.comp_stronglyMeasurable hf
@[measurability]
protected theorem ennnorm {_ : MeasurableSpace α} {β : Type*} [SeminormedAddCommGroup β]
{f : α → β} (hf : StronglyMeasurable f) : Measurable fun a => (‖f a‖₊ : ℝ≥0∞) :=
(ENNReal.continuous_coe.comp_stronglyMeasurable hf.nnnorm).measurable
@[measurability]
protected theorem real_toNNReal {_ : MeasurableSpace α} {f : α → ℝ} (hf : StronglyMeasurable f) :
StronglyMeasurable fun x => (f x).toNNReal :=
continuous_real_toNNReal.comp_stronglyMeasurable hf
theorem measurableSet_eq_fun {m : MeasurableSpace α} {E} [TopologicalSpace E] [MetrizableSpace E]
{f g : α → E} (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
MeasurableSet { x | f x = g x } := by
borelize (E × E)
exact (hf.prod_mk hg).measurable isClosed_diagonal.measurableSet
theorem measurableSet_lt {m : MeasurableSpace α} [TopologicalSpace β] [LinearOrder β]
[OrderClosedTopology β] [PseudoMetrizableSpace β] {f g : α → β} (hf : StronglyMeasurable f)
(hg : StronglyMeasurable g) : MeasurableSet { a | f a < g a } := by
borelize (β × β)
exact (hf.prod_mk hg).measurable isOpen_lt_prod.measurableSet
theorem measurableSet_le {m : MeasurableSpace α} [TopologicalSpace β] [Preorder β]
[OrderClosedTopology β] [PseudoMetrizableSpace β] {f g : α → β} (hf : StronglyMeasurable f)
(hg : StronglyMeasurable g) : MeasurableSet { a | f a ≤ g a } := by
borelize (β × β)
exact (hf.prod_mk hg).measurable isClosed_le_prod.measurableSet
theorem stronglyMeasurable_in_set {m : MeasurableSpace α} [TopologicalSpace β] [Zero β] {s : Set α}
{f : α → β} (hs : MeasurableSet s) (hf : StronglyMeasurable f)
(hf_zero : ∀ x, x ∉ s → f x = 0) :
∃ fs : ℕ → α →ₛ β,
(∀ x, Tendsto (fun n => fs n x) atTop (𝓝 (f x))) ∧ ∀ x ∉ s, ∀ n, fs n x = 0 := by
let g_seq_s : ℕ → @SimpleFunc α m β := fun n => (hf.approx n).restrict s
have hg_eq : ∀ x ∈ s, ∀ n, g_seq_s n x = hf.approx n x := by
intro x hx n
rw [SimpleFunc.coe_restrict _ hs, Set.indicator_of_mem hx]
have hg_zero : ∀ x ∉ s, ∀ n, g_seq_s n x = 0 := by
intro x hx n
rw [SimpleFunc.coe_restrict _ hs, Set.indicator_of_not_mem hx]
refine ⟨g_seq_s, fun x => ?_, hg_zero⟩
by_cases hx : x ∈ s
· simp_rw [hg_eq x hx]
exact hf.tendsto_approx x
· simp_rw [hg_zero x hx, hf_zero x hx]
exact tendsto_const_nhds
/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` supported
on `s` is `m`-strongly-measurable, then `f` is also `m₂`-strongly-measurable. -/
theorem stronglyMeasurable_of_measurableSpace_le_on {α E} {m m₂ : MeasurableSpace α}
[TopologicalSpace E] [Zero E] {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
(hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
(hf : StronglyMeasurable[m] f) (hf_zero : ∀ x ∉ s, f x = 0) :
StronglyMeasurable[m₂] f := by
have hs_m₂ : MeasurableSet[m₂] s := by
rw [← Set.inter_univ s]
refine hs Set.univ ?_
rwa [Set.inter_univ]
obtain ⟨g_seq_s, hg_seq_tendsto, hg_seq_zero⟩ := stronglyMeasurable_in_set hs_m hf hf_zero
let g_seq_s₂ : ℕ → @SimpleFunc α m₂ E := fun n =>
{ toFun := g_seq_s n
measurableSet_fiber' := fun x => by
rw [← Set.inter_univ (g_seq_s n ⁻¹' {x}), ← Set.union_compl_self s,
Set.inter_union_distrib_left, Set.inter_comm (g_seq_s n ⁻¹' {x})]
refine MeasurableSet.union (hs _ (hs_m.inter ?_)) ?_
· exact @SimpleFunc.measurableSet_fiber _ _ m _ _
by_cases hx : x = 0
· suffices g_seq_s n ⁻¹' {x} ∩ sᶜ = sᶜ by
rw [this]
exact hs_m₂.compl
ext1 y
rw [hx, Set.mem_inter_iff, Set.mem_preimage, Set.mem_singleton_iff]
exact ⟨fun h => h.2, fun h => ⟨hg_seq_zero y h n, h⟩⟩
· suffices g_seq_s n ⁻¹' {x} ∩ sᶜ = ∅ by
rw [this]
exact MeasurableSet.empty
ext1 y
simp only [mem_inter_iff, mem_preimage, mem_singleton_iff, mem_compl_iff,
mem_empty_iff_false, iff_false_iff, not_and, not_not_mem]
refine Function.mtr fun hys => ?_
rw [hg_seq_zero y hys n]
exact Ne.symm hx
finite_range' := @SimpleFunc.finite_range _ _ m (g_seq_s n) }
exact ⟨g_seq_s₂, hg_seq_tendsto⟩
/-- If a function `f` is strongly measurable w.r.t. a sub-σ-algebra `m` and the measure is σ-finite
on `m`, then there exists spanning measurable sets with finite measure on which `f` has bounded
norm. In particular, `f` is integrable on each of those sets. -/
theorem exists_spanning_measurableSet_norm_le [SeminormedAddCommGroup β] {m m0 : MeasurableSpace α}
(hm : m ≤ m0) (hf : StronglyMeasurable[m] f) (μ : Measure α) [SigmaFinite (μ.trim hm)] :
∃ s : ℕ → Set α,
(∀ n, MeasurableSet[m] (s n) ∧ μ (s n) < ∞ ∧ ∀ x ∈ s n, ‖f x‖ ≤ n) ∧
⋃ i, s i = Set.univ := by
obtain ⟨s, hs, hs_univ⟩ :=
@exists_spanning_measurableSet_le _ m _ hf.nnnorm.measurable (μ.trim hm) _
refine ⟨s, fun n ↦ ⟨(hs n).1, (le_trim hm).trans_lt (hs n).2.1, fun x hx ↦ ?_⟩, hs_univ⟩
have hx_nnnorm : ‖f x‖₊ ≤ n := (hs n).2.2 x hx
rw [← coe_nnnorm]
norm_cast
end StronglyMeasurable
/-! ## Finitely strongly measurable functions -/
theorem finStronglyMeasurable_zero {α β} {m : MeasurableSpace α} {μ : Measure α} [Zero β]
[TopologicalSpace β] : FinStronglyMeasurable (0 : α → β) μ :=
⟨0, by
simp only [Pi.zero_apply, SimpleFunc.coe_zero, support_zero', measure_empty,
zero_lt_top, forall_const],
fun _ => tendsto_const_nhds⟩
namespace FinStronglyMeasurable
variable {m0 : MeasurableSpace α} {μ : Measure α} {f g : α → β}
theorem aefinStronglyMeasurable [Zero β] [TopologicalSpace β] (hf : FinStronglyMeasurable f μ) :
AEFinStronglyMeasurable f μ :=
⟨f, hf, ae_eq_refl f⟩
section sequence
variable [Zero β] [TopologicalSpace β] (hf : FinStronglyMeasurable f μ)
/-- A sequence of simple functions such that `∀ x, Tendsto (fun n ↦ hf.approx n x) atTop (𝓝 (f x))`
and `∀ n, μ (support (hf.approx n)) < ∞`. These properties are given by
`FinStronglyMeasurable.tendsto_approx` and `FinStronglyMeasurable.fin_support_approx`. -/
protected noncomputable def approx : ℕ → α →ₛ β :=
hf.choose
protected theorem fin_support_approx : ∀ n, μ (support (hf.approx n)) < ∞ :=
hf.choose_spec.1
protected theorem tendsto_approx : ∀ x, Tendsto (fun n => hf.approx n x) atTop (𝓝 (f x)) :=
hf.choose_spec.2
end sequence
/-- A finitely strongly measurable function is strongly measurable. -/
@[aesop 5% apply (rule_sets := [Measurable])]
protected theorem stronglyMeasurable [Zero β] [TopologicalSpace β]
(hf : FinStronglyMeasurable f μ) : StronglyMeasurable f :=
⟨hf.approx, hf.tendsto_approx⟩
theorem exists_set_sigmaFinite [Zero β] [TopologicalSpace β] [T2Space β]
(hf : FinStronglyMeasurable f μ) :
∃ t, MeasurableSet t ∧ (∀ x ∈ tᶜ, f x = 0) ∧ SigmaFinite (μ.restrict t) := by
rcases hf with ⟨fs, hT_lt_top, h_approx⟩
let T n := support (fs n)
have hT_meas : ∀ n, MeasurableSet (T n) := fun n => SimpleFunc.measurableSet_support (fs n)
let t := ⋃ n, T n
refine ⟨t, MeasurableSet.iUnion hT_meas, ?_, ?_⟩
· have h_fs_zero : ∀ n, ∀ x ∈ tᶜ, fs n x = 0 := by
intro n x hxt
rw [Set.mem_compl_iff, Set.mem_iUnion, not_exists] at hxt
simpa [T] using hxt n
refine fun x hxt => tendsto_nhds_unique (h_approx x) ?_
rw [funext fun n => h_fs_zero n x hxt]
exact tendsto_const_nhds
· refine ⟨⟨⟨fun n => tᶜ ∪ T n, fun _ => trivial, fun n => ?_, ?_⟩⟩⟩
· rw [Measure.restrict_apply' (MeasurableSet.iUnion hT_meas), Set.union_inter_distrib_right,
Set.compl_inter_self t, Set.empty_union]
exact (measure_mono Set.inter_subset_left).trans_lt (hT_lt_top n)
· rw [← Set.union_iUnion tᶜ T]
exact Set.compl_union_self _
/-- A finitely strongly measurable function is measurable. -/
protected theorem measurable [Zero β] [TopologicalSpace β] [PseudoMetrizableSpace β]
[MeasurableSpace β] [BorelSpace β] (hf : FinStronglyMeasurable f μ) : Measurable f :=
hf.stronglyMeasurable.measurable
section Arithmetic
variable [TopologicalSpace β]
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem mul [MonoidWithZero β] [ContinuousMul β] (hf : FinStronglyMeasurable f μ)
(hg : FinStronglyMeasurable g μ) : FinStronglyMeasurable (f * g) μ := by
refine
⟨fun n => hf.approx n * hg.approx n, ?_, fun x =>
(hf.tendsto_approx x).mul (hg.tendsto_approx x)⟩
intro n
exact (measure_mono (support_mul_subset_left _ _)).trans_lt (hf.fin_support_approx n)
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem add [AddMonoid β] [ContinuousAdd β] (hf : FinStronglyMeasurable f μ)
(hg : FinStronglyMeasurable g μ) : FinStronglyMeasurable (f + g) μ :=
⟨fun n => hf.approx n + hg.approx n, fun n =>
(measure_mono (Function.support_add _ _)).trans_lt
((measure_union_le _ _).trans_lt
(ENNReal.add_lt_top.mpr ⟨hf.fin_support_approx n, hg.fin_support_approx n⟩)),
fun x => (hf.tendsto_approx x).add (hg.tendsto_approx x)⟩
@[measurability]
protected theorem neg [AddGroup β] [TopologicalAddGroup β] (hf : FinStronglyMeasurable f μ) :
FinStronglyMeasurable (-f) μ := by
refine ⟨fun n => -hf.approx n, fun n => ?_, fun x => (hf.tendsto_approx x).neg⟩
suffices μ (Function.support fun x => -(hf.approx n) x) < ∞ by convert this
rw [Function.support_neg (hf.approx n)]
exact hf.fin_support_approx n
@[measurability]
protected theorem sub [AddGroup β] [ContinuousSub β] (hf : FinStronglyMeasurable f μ)
(hg : FinStronglyMeasurable g μ) : FinStronglyMeasurable (f - g) μ :=
⟨fun n => hf.approx n - hg.approx n, fun n =>
(measure_mono (Function.support_sub _ _)).trans_lt
((measure_union_le _ _).trans_lt
(ENNReal.add_lt_top.mpr ⟨hf.fin_support_approx n, hg.fin_support_approx n⟩)),
fun x => (hf.tendsto_approx x).sub (hg.tendsto_approx x)⟩
@[measurability]
protected theorem const_smul {𝕜} [TopologicalSpace 𝕜] [AddMonoid β] [Monoid 𝕜]
[DistribMulAction 𝕜 β] [ContinuousSMul 𝕜 β] (hf : FinStronglyMeasurable f μ) (c : 𝕜) :
FinStronglyMeasurable (c • f) μ := by
refine ⟨fun n => c • hf.approx n, fun n => ?_, fun x => (hf.tendsto_approx x).const_smul c⟩
rw [SimpleFunc.coe_smul]
exact (measure_mono (support_const_smul_subset c _)).trans_lt (hf.fin_support_approx n)
end Arithmetic
section Order
variable [TopologicalSpace β] [Zero β]
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem sup [SemilatticeSup β] [ContinuousSup β] (hf : FinStronglyMeasurable f μ)
(hg : FinStronglyMeasurable g μ) : FinStronglyMeasurable (f ⊔ g) μ := by
refine
⟨fun n => hf.approx n ⊔ hg.approx n, fun n => ?_, fun x =>
(hf.tendsto_approx x).sup_nhds (hg.tendsto_approx x)⟩
refine (measure_mono (support_sup _ _)).trans_lt ?_
exact measure_union_lt_top_iff.mpr ⟨hf.fin_support_approx n, hg.fin_support_approx n⟩
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem inf [SemilatticeInf β] [ContinuousInf β] (hf : FinStronglyMeasurable f μ)
(hg : FinStronglyMeasurable g μ) : FinStronglyMeasurable (f ⊓ g) μ := by
refine
⟨fun n => hf.approx n ⊓ hg.approx n, fun n => ?_, fun x =>
(hf.tendsto_approx x).inf_nhds (hg.tendsto_approx x)⟩
refine (measure_mono (support_inf _ _)).trans_lt ?_
exact measure_union_lt_top_iff.mpr ⟨hf.fin_support_approx n, hg.fin_support_approx n⟩
end Order
end FinStronglyMeasurable
theorem finStronglyMeasurable_iff_stronglyMeasurable_and_exists_set_sigmaFinite {α β} {f : α → β}
[TopologicalSpace β] [T2Space β] [Zero β] {_ : MeasurableSpace α} {μ : Measure α} :
FinStronglyMeasurable f μ ↔
StronglyMeasurable f ∧
∃ t, MeasurableSet t ∧ (∀ x ∈ tᶜ, f x = 0) ∧ SigmaFinite (μ.restrict t) :=
⟨fun hf => ⟨hf.stronglyMeasurable, hf.exists_set_sigmaFinite⟩, fun hf =>
hf.1.finStronglyMeasurable_of_set_sigmaFinite hf.2.choose_spec.1 hf.2.choose_spec.2.1
hf.2.choose_spec.2.2⟩
theorem aefinStronglyMeasurable_zero {α β} {_ : MeasurableSpace α} (μ : Measure α) [Zero β]
[TopologicalSpace β] : AEFinStronglyMeasurable (0 : α → β) μ :=
⟨0, finStronglyMeasurable_zero, EventuallyEq.rfl⟩
/-! ## Almost everywhere strongly measurable functions -/
@[measurability]
theorem aestronglyMeasurable_const {α β} {_ : MeasurableSpace α} {μ : Measure α}
[TopologicalSpace β] {b : β} : AEStronglyMeasurable (fun _ : α => b) μ :=
stronglyMeasurable_const.aestronglyMeasurable
@[to_additive (attr := measurability)]
theorem aestronglyMeasurable_one {α β} {_ : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β]
[One β] : AEStronglyMeasurable (1 : α → β) μ :=
stronglyMeasurable_one.aestronglyMeasurable
@[simp]
theorem Subsingleton.aestronglyMeasurable {_ : MeasurableSpace α} [TopologicalSpace β]
[Subsingleton β] {μ : Measure α} (f : α → β) : AEStronglyMeasurable f μ :=
(Subsingleton.stronglyMeasurable f).aestronglyMeasurable
@[simp]
theorem Subsingleton.aestronglyMeasurable' {_ : MeasurableSpace α} [TopologicalSpace β]
[Subsingleton α] {μ : Measure α} (f : α → β) : AEStronglyMeasurable f μ :=
(Subsingleton.stronglyMeasurable' f).aestronglyMeasurable
@[simp]
theorem aestronglyMeasurable_zero_measure [MeasurableSpace α] [TopologicalSpace β] (f : α → β) :
AEStronglyMeasurable f (0 : Measure α) := by
nontriviality α
inhabit α
exact ⟨fun _ => f default, stronglyMeasurable_const, rfl⟩
@[measurability]
theorem SimpleFunc.aestronglyMeasurable {_ : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β]
(f : α →ₛ β) : AEStronglyMeasurable f μ :=
f.stronglyMeasurable.aestronglyMeasurable
namespace AEStronglyMeasurable
variable {m : MeasurableSpace α} {μ ν : Measure α} [TopologicalSpace β] [TopologicalSpace γ]
{f g : α → β}
section Mk
/-- A `StronglyMeasurable` function such that `f =ᵐ[μ] hf.mk f`. See lemmas
`stronglyMeasurable_mk` and `ae_eq_mk`. -/
protected noncomputable def mk (f : α → β) (hf : AEStronglyMeasurable f μ) : α → β :=
hf.choose
theorem stronglyMeasurable_mk (hf : AEStronglyMeasurable f μ) : StronglyMeasurable (hf.mk f) :=
hf.choose_spec.1
theorem measurable_mk [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β]
(hf : AEStronglyMeasurable f μ) : Measurable (hf.mk f) :=
hf.stronglyMeasurable_mk.measurable
theorem ae_eq_mk (hf : AEStronglyMeasurable f μ) : f =ᵐ[μ] hf.mk f :=
hf.choose_spec.2
@[aesop 5% apply (rule_sets := [Measurable])]
protected theorem aemeasurable {β} [MeasurableSpace β] [TopologicalSpace β]
[PseudoMetrizableSpace β] [BorelSpace β] {f : α → β} (hf : AEStronglyMeasurable f μ) :
AEMeasurable f μ :=
⟨hf.mk f, hf.stronglyMeasurable_mk.measurable, hf.ae_eq_mk⟩
end Mk
theorem congr (hf : AEStronglyMeasurable f μ) (h : f =ᵐ[μ] g) : AEStronglyMeasurable g μ :=
⟨hf.mk f, hf.stronglyMeasurable_mk, h.symm.trans hf.ae_eq_mk⟩
theorem _root_.aestronglyMeasurable_congr (h : f =ᵐ[μ] g) :
AEStronglyMeasurable f μ ↔ AEStronglyMeasurable g μ :=
⟨fun hf => hf.congr h, fun hg => hg.congr h.symm⟩
theorem mono_measure {ν : Measure α} (hf : AEStronglyMeasurable f μ) (h : ν ≤ μ) :
AEStronglyMeasurable f ν :=
⟨hf.mk f, hf.stronglyMeasurable_mk, Eventually.filter_mono (ae_mono h) hf.ae_eq_mk⟩
protected lemma mono_ac (h : ν ≪ μ) (hμ : AEStronglyMeasurable f μ) : AEStronglyMeasurable f ν :=
let ⟨g, hg, hg'⟩ := hμ; ⟨g, hg, h.ae_eq hg'⟩
@[deprecated (since := "2024-02-15")] protected alias mono' := AEStronglyMeasurable.mono_ac
theorem mono_set {s t} (h : s ⊆ t) (ht : AEStronglyMeasurable f (μ.restrict t)) :
AEStronglyMeasurable f (μ.restrict s) :=
ht.mono_measure (restrict_mono h le_rfl)
protected theorem restrict (hfm : AEStronglyMeasurable f μ) {s} :
AEStronglyMeasurable f (μ.restrict s) :=
hfm.mono_measure Measure.restrict_le_self
theorem ae_mem_imp_eq_mk {s} (h : AEStronglyMeasurable f (μ.restrict s)) :
∀ᵐ x ∂μ, x ∈ s → f x = h.mk f x :=
ae_imp_of_ae_restrict h.ae_eq_mk
/-- The composition of a continuous function and an ae strongly measurable function is ae strongly
measurable. -/
theorem _root_.Continuous.comp_aestronglyMeasurable {g : β → γ} {f : α → β} (hg : Continuous g)
(hf : AEStronglyMeasurable f μ) : AEStronglyMeasurable (fun x => g (f x)) μ :=
⟨_, hg.comp_stronglyMeasurable hf.stronglyMeasurable_mk, EventuallyEq.fun_comp hf.ae_eq_mk g⟩
/-- A continuous function from `α` to `β` is ae strongly measurable when one of the two spaces is
second countable. -/
theorem _root_.Continuous.aestronglyMeasurable [TopologicalSpace α] [OpensMeasurableSpace α]
[PseudoMetrizableSpace β] [SecondCountableTopologyEither α β] (hf : Continuous f) :
AEStronglyMeasurable f μ :=
hf.stronglyMeasurable.aestronglyMeasurable
protected theorem prod_mk {f : α → β} {g : α → γ} (hf : AEStronglyMeasurable f μ)
(hg : AEStronglyMeasurable g μ) : AEStronglyMeasurable (fun x => (f x, g x)) μ :=
⟨fun x => (hf.mk f x, hg.mk g x), hf.stronglyMeasurable_mk.prod_mk hg.stronglyMeasurable_mk,
hf.ae_eq_mk.prod_mk hg.ae_eq_mk⟩
/-- The composition of a continuous function of two variables and two ae strongly measurable
functions is ae strongly measurable. -/
theorem _root_.Continuous.comp_aestronglyMeasurable₂
{β' : Type*} [TopologicalSpace β']
{g : β → β' → γ} {f : α → β} {f' : α → β'} (hg : Continuous g.uncurry)
(hf : AEStronglyMeasurable f μ) (h'f : AEStronglyMeasurable f' μ) :
AEStronglyMeasurable (fun x => g (f x) (f' x)) μ :=
hg.comp_aestronglyMeasurable (hf.prod_mk h'f)
/-- In a space with second countable topology, measurable implies ae strongly measurable. -/
@[fun_prop, aesop unsafe 30% apply (rule_sets := [Measurable])]
theorem _root_.Measurable.aestronglyMeasurable {_ : MeasurableSpace α} {μ : Measure α}
[MeasurableSpace β] [PseudoMetrizableSpace β] [SecondCountableTopology β]
[OpensMeasurableSpace β] (hf : Measurable f) : AEStronglyMeasurable f μ :=
hf.stronglyMeasurable.aestronglyMeasurable
section Arithmetic
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem mul [Mul β] [ContinuousMul β] (hf : AEStronglyMeasurable f μ)
(hg : AEStronglyMeasurable g μ) : AEStronglyMeasurable (f * g) μ :=
⟨hf.mk f * hg.mk g, hf.stronglyMeasurable_mk.mul hg.stronglyMeasurable_mk,
hf.ae_eq_mk.mul hg.ae_eq_mk⟩
@[to_additive (attr := measurability)]
protected theorem mul_const [Mul β] [ContinuousMul β] (hf : AEStronglyMeasurable f μ) (c : β) :
AEStronglyMeasurable (fun x => f x * c) μ :=
hf.mul aestronglyMeasurable_const
@[to_additive (attr := measurability)]
protected theorem const_mul [Mul β] [ContinuousMul β] (hf : AEStronglyMeasurable f μ) (c : β) :
AEStronglyMeasurable (fun x => c * f x) μ :=
aestronglyMeasurable_const.mul hf
@[to_additive (attr := measurability)]
protected theorem inv [Inv β] [ContinuousInv β] (hf : AEStronglyMeasurable f μ) :
AEStronglyMeasurable f⁻¹ μ :=
⟨(hf.mk f)⁻¹, hf.stronglyMeasurable_mk.inv, hf.ae_eq_mk.inv⟩
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem div [Group β] [TopologicalGroup β] (hf : AEStronglyMeasurable f μ)
(hg : AEStronglyMeasurable g μ) : AEStronglyMeasurable (f / g) μ :=
⟨hf.mk f / hg.mk g, hf.stronglyMeasurable_mk.div hg.stronglyMeasurable_mk,
hf.ae_eq_mk.div hg.ae_eq_mk⟩
@[to_additive]
theorem mul_iff_right [CommGroup β] [TopologicalGroup β] (hf : AEStronglyMeasurable f μ) :
AEStronglyMeasurable (f * g) μ ↔ AEStronglyMeasurable g μ :=
⟨fun h ↦ show g = f * g * f⁻¹ by simp only [mul_inv_cancel_comm] ▸ h.mul hf.inv,
fun h ↦ hf.mul h⟩
@[to_additive]
theorem mul_iff_left [CommGroup β] [TopologicalGroup β] (hf : AEStronglyMeasurable f μ) :
AEStronglyMeasurable (g * f) μ ↔ AEStronglyMeasurable g μ :=
mul_comm g f ▸ AEStronglyMeasurable.mul_iff_right hf
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem smul {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
{g : α → β} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
AEStronglyMeasurable (fun x => f x • g x) μ :=
continuous_smul.comp_aestronglyMeasurable (hf.prod_mk hg)
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable])) const_nsmul]
protected theorem pow [Monoid β] [ContinuousMul β] (hf : AEStronglyMeasurable f μ) (n : ℕ) :
AEStronglyMeasurable (f ^ n) μ :=
⟨hf.mk f ^ n, hf.stronglyMeasurable_mk.pow _, hf.ae_eq_mk.pow_const _⟩
@[to_additive (attr := measurability)]
protected theorem const_smul {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β]
(hf : AEStronglyMeasurable f μ) (c : 𝕜) : AEStronglyMeasurable (c • f) μ :=
⟨c • hf.mk f, hf.stronglyMeasurable_mk.const_smul c, hf.ae_eq_mk.const_smul c⟩
@[to_additive (attr := measurability)]
protected theorem const_smul' {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β]
(hf : AEStronglyMeasurable f μ) (c : 𝕜) : AEStronglyMeasurable (fun x => c • f x) μ :=
hf.const_smul c
@[to_additive (attr := measurability)]
protected theorem smul_const {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
(hf : AEStronglyMeasurable f μ) (c : β) : AEStronglyMeasurable (fun x => f x • c) μ :=
continuous_smul.comp_aestronglyMeasurable (hf.prod_mk aestronglyMeasurable_const)
end Arithmetic
section Order
@[aesop safe 20 apply (rule_sets := [Measurable])]
protected theorem sup [SemilatticeSup β] [ContinuousSup β] (hf : AEStronglyMeasurable f μ)
(hg : AEStronglyMeasurable g μ) : AEStronglyMeasurable (f ⊔ g) μ :=
⟨hf.mk f ⊔ hg.mk g, hf.stronglyMeasurable_mk.sup hg.stronglyMeasurable_mk,
hf.ae_eq_mk.sup hg.ae_eq_mk⟩
@[aesop safe 20 apply (rule_sets := [Measurable])]
protected theorem inf [SemilatticeInf β] [ContinuousInf β] (hf : AEStronglyMeasurable f μ)
(hg : AEStronglyMeasurable g μ) : AEStronglyMeasurable (f ⊓ g) μ :=
⟨hf.mk f ⊓ hg.mk g, hf.stronglyMeasurable_mk.inf hg.stronglyMeasurable_mk,
hf.ae_eq_mk.inf hg.ae_eq_mk⟩
end Order
/-!
### Big operators: `∏` and `∑`
-/
section Monoid
variable {M : Type*} [Monoid M] [TopologicalSpace M] [ContinuousMul M]
@[to_additive (attr := measurability)]
theorem _root_.List.aestronglyMeasurable_prod' (l : List (α → M))
(hl : ∀ f ∈ l, AEStronglyMeasurable f μ) : AEStronglyMeasurable l.prod μ := by
induction' l with f l ihl; · exact aestronglyMeasurable_one
rw [List.forall_mem_cons] at hl
rw [List.prod_cons]
exact hl.1.mul (ihl hl.2)
@[to_additive (attr := measurability)]
theorem _root_.List.aestronglyMeasurable_prod
(l : List (α → M)) (hl : ∀ f ∈ l, AEStronglyMeasurable f μ) :
AEStronglyMeasurable (fun x => (l.map fun f : α → M => f x).prod) μ := by
simpa only [← Pi.list_prod_apply] using l.aestronglyMeasurable_prod' hl
end Monoid
section CommMonoid
variable {M : Type*} [CommMonoid M] [TopologicalSpace M] [ContinuousMul M]
@[to_additive (attr := measurability)]
theorem _root_.Multiset.aestronglyMeasurable_prod' (l : Multiset (α → M))
(hl : ∀ f ∈ l, AEStronglyMeasurable f μ) : AEStronglyMeasurable l.prod μ := by
rcases l with ⟨l⟩
simpa using l.aestronglyMeasurable_prod' (by simpa using hl)
@[to_additive (attr := measurability)]
theorem _root_.Multiset.aestronglyMeasurable_prod (s : Multiset (α → M))
(hs : ∀ f ∈ s, AEStronglyMeasurable f μ) :
AEStronglyMeasurable (fun x => (s.map fun f : α → M => f x).prod) μ := by
simpa only [← Pi.multiset_prod_apply] using s.aestronglyMeasurable_prod' hs
@[to_additive (attr := measurability)]
theorem _root_.Finset.aestronglyMeasurable_prod' {ι : Type*} {f : ι → α → M} (s : Finset ι)
(hf : ∀ i ∈ s, AEStronglyMeasurable (f i) μ) : AEStronglyMeasurable (∏ i ∈ s, f i) μ :=
Multiset.aestronglyMeasurable_prod' _ fun _g hg =>
let ⟨_i, hi, hg⟩ := Multiset.mem_map.1 hg
hg ▸ hf _ hi
@[to_additive (attr := measurability)]
theorem _root_.Finset.aestronglyMeasurable_prod {ι : Type*} {f : ι → α → M} (s : Finset ι)
(hf : ∀ i ∈ s, AEStronglyMeasurable (f i) μ) :
AEStronglyMeasurable (fun a => ∏ i ∈ s, f i a) μ := by
simpa only [← Finset.prod_apply] using s.aestronglyMeasurable_prod' hf
end CommMonoid
section SecondCountableAEStronglyMeasurable
variable [MeasurableSpace β]
/-- In a space with second countable topology, measurable implies strongly measurable. -/
@[aesop 90% apply (rule_sets := [Measurable])]
theorem _root_.AEMeasurable.aestronglyMeasurable [PseudoMetrizableSpace β] [OpensMeasurableSpace β]
[SecondCountableTopology β] (hf : AEMeasurable f μ) : AEStronglyMeasurable f μ :=
⟨hf.mk f, hf.measurable_mk.stronglyMeasurable, hf.ae_eq_mk⟩
@[measurability]
theorem _root_.aestronglyMeasurable_id {α : Type*} [TopologicalSpace α] [PseudoMetrizableSpace α]
{_ : MeasurableSpace α} [OpensMeasurableSpace α] [SecondCountableTopology α] {μ : Measure α} :
AEStronglyMeasurable (id : α → α) μ :=
aemeasurable_id.aestronglyMeasurable
/-- In a space with second countable topology, strongly measurable and measurable are equivalent. -/
theorem _root_.aestronglyMeasurable_iff_aemeasurable [PseudoMetrizableSpace β] [BorelSpace β]
[SecondCountableTopology β] : AEStronglyMeasurable f μ ↔ AEMeasurable f μ :=
⟨fun h => h.aemeasurable, fun h => h.aestronglyMeasurable⟩
end SecondCountableAEStronglyMeasurable
@[aesop safe 20 apply (rule_sets := [Measurable])]
protected theorem dist {β : Type*} [PseudoMetricSpace β] {f g : α → β}
(hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
AEStronglyMeasurable (fun x => dist (f x) (g x)) μ :=
continuous_dist.comp_aestronglyMeasurable (hf.prod_mk hg)
@[measurability]
protected theorem norm {β : Type*} [SeminormedAddCommGroup β] {f : α → β}
(hf : AEStronglyMeasurable f μ) : AEStronglyMeasurable (fun x => ‖f x‖) μ :=
continuous_norm.comp_aestronglyMeasurable hf
@[measurability]
protected theorem nnnorm {β : Type*} [SeminormedAddCommGroup β] {f : α → β}
(hf : AEStronglyMeasurable f μ) : AEStronglyMeasurable (fun x => ‖f x‖₊) μ :=
continuous_nnnorm.comp_aestronglyMeasurable hf
@[measurability]
protected theorem ennnorm {β : Type*} [SeminormedAddCommGroup β] {f : α → β}
(hf : AEStronglyMeasurable f μ) : AEMeasurable (fun a => (‖f a‖₊ : ℝ≥0∞)) μ :=
(ENNReal.continuous_coe.comp_aestronglyMeasurable hf.nnnorm).aemeasurable
@[aesop safe 20 apply (rule_sets := [Measurable])]
protected theorem edist {β : Type*} [SeminormedAddCommGroup β] {f g : α → β}
(hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
AEMeasurable (fun a => edist (f a) (g a)) μ :=
(continuous_edist.comp_aestronglyMeasurable (hf.prod_mk hg)).aemeasurable
@[measurability]
protected theorem real_toNNReal {f : α → ℝ} (hf : AEStronglyMeasurable f μ) :
AEStronglyMeasurable (fun x => (f x).toNNReal) μ :=
continuous_real_toNNReal.comp_aestronglyMeasurable hf
theorem _root_.aestronglyMeasurable_indicator_iff [Zero β] {s : Set α} (hs : MeasurableSet s) :
AEStronglyMeasurable (indicator s f) μ ↔ AEStronglyMeasurable f (μ.restrict s) := by
constructor
· intro h
exact (h.mono_measure Measure.restrict_le_self).congr (indicator_ae_eq_restrict hs)
· intro h
refine ⟨indicator s (h.mk f), h.stronglyMeasurable_mk.indicator hs, ?_⟩
have A : s.indicator f =ᵐ[μ.restrict s] s.indicator (h.mk f) :=
(indicator_ae_eq_restrict hs).trans (h.ae_eq_mk.trans <| (indicator_ae_eq_restrict hs).symm)
have B : s.indicator f =ᵐ[μ.restrict sᶜ] s.indicator (h.mk f) :=
(indicator_ae_eq_restrict_compl hs).trans (indicator_ae_eq_restrict_compl hs).symm
exact ae_of_ae_restrict_of_ae_restrict_compl _ A B
@[measurability]
protected theorem indicator [Zero β] (hfm : AEStronglyMeasurable f μ) {s : Set α}
(hs : MeasurableSet s) : AEStronglyMeasurable (s.indicator f) μ :=
(aestronglyMeasurable_indicator_iff hs).mpr hfm.restrict
theorem nullMeasurableSet_eq_fun {E} [TopologicalSpace E] [MetrizableSpace E] {f g : α → E}
(hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
NullMeasurableSet { x | f x = g x } μ := by
apply
(hf.stronglyMeasurable_mk.measurableSet_eq_fun
hg.stronglyMeasurable_mk).nullMeasurableSet.congr
filter_upwards [hf.ae_eq_mk, hg.ae_eq_mk] with x hfx hgx
change (hf.mk f x = hg.mk g x) = (f x = g x)
simp only [hfx, hgx]
@[to_additive]
lemma nullMeasurableSet_mulSupport {E} [TopologicalSpace E] [MetrizableSpace E] [One E] {f : α → E}
(hf : AEStronglyMeasurable f μ) : NullMeasurableSet (mulSupport f) μ :=
(hf.nullMeasurableSet_eq_fun stronglyMeasurable_const.aestronglyMeasurable).compl
theorem nullMeasurableSet_lt [LinearOrder β] [OrderClosedTopology β] [PseudoMetrizableSpace β]
{f g : α → β} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
NullMeasurableSet { a | f a < g a } μ := by
apply
(hf.stronglyMeasurable_mk.measurableSet_lt hg.stronglyMeasurable_mk).nullMeasurableSet.congr
filter_upwards [hf.ae_eq_mk, hg.ae_eq_mk] with x hfx hgx
change (hf.mk f x < hg.mk g x) = (f x < g x)
simp only [hfx, hgx]
theorem nullMeasurableSet_le [Preorder β] [OrderClosedTopology β] [PseudoMetrizableSpace β]
{f g : α → β} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
NullMeasurableSet { a | f a ≤ g a } μ := by
apply
(hf.stronglyMeasurable_mk.measurableSet_le hg.stronglyMeasurable_mk).nullMeasurableSet.congr
filter_upwards [hf.ae_eq_mk, hg.ae_eq_mk] with x hfx hgx
change (hf.mk f x ≤ hg.mk g x) = (f x ≤ g x)
simp only [hfx, hgx]
theorem _root_.aestronglyMeasurable_of_aestronglyMeasurable_trim {α} {m m0 : MeasurableSpace α}
{μ : Measure α} (hm : m ≤ m0) {f : α → β} (hf : AEStronglyMeasurable f (μ.trim hm)) :
AEStronglyMeasurable f μ :=
⟨hf.mk f, StronglyMeasurable.mono hf.stronglyMeasurable_mk hm, ae_eq_of_ae_eq_trim hf.ae_eq_mk⟩
theorem comp_aemeasurable {γ : Type*} {_ : MeasurableSpace γ} {_ : MeasurableSpace α} {f : γ → α}
{μ : Measure γ} (hg : AEStronglyMeasurable g (Measure.map f μ)) (hf : AEMeasurable f μ) :
AEStronglyMeasurable (g ∘ f) μ :=
⟨hg.mk g ∘ hf.mk f, hg.stronglyMeasurable_mk.comp_measurable hf.measurable_mk,
(ae_eq_comp hf hg.ae_eq_mk).trans (hf.ae_eq_mk.fun_comp (hg.mk g))⟩
theorem comp_measurable {γ : Type*} {_ : MeasurableSpace γ} {_ : MeasurableSpace α} {f : γ → α}
{μ : Measure γ} (hg : AEStronglyMeasurable g (Measure.map f μ)) (hf : Measurable f) :
AEStronglyMeasurable (g ∘ f) μ :=
hg.comp_aemeasurable hf.aemeasurable
theorem comp_quasiMeasurePreserving {γ : Type*} {_ : MeasurableSpace γ} {_ : MeasurableSpace α}
{f : γ → α} {μ : Measure γ} {ν : Measure α} (hg : AEStronglyMeasurable g ν)
(hf : QuasiMeasurePreserving f μ ν) : AEStronglyMeasurable (g ∘ f) μ :=
(hg.mono_ac hf.absolutelyContinuous).comp_measurable hf.measurable
theorem isSeparable_ae_range (hf : AEStronglyMeasurable f μ) :
∃ t : Set β, IsSeparable t ∧ ∀ᵐ x ∂μ, f x ∈ t := by
refine ⟨range (hf.mk f), hf.stronglyMeasurable_mk.isSeparable_range, ?_⟩
filter_upwards [hf.ae_eq_mk] with x hx
simp [hx]
/-- A function is almost everywhere strongly measurable if and only if it is almost everywhere
measurable, and up to a zero measure set its range is contained in a separable set. -/
theorem _root_.aestronglyMeasurable_iff_aemeasurable_separable [PseudoMetrizableSpace β]
[MeasurableSpace β] [BorelSpace β] :
AEStronglyMeasurable f μ ↔
AEMeasurable f μ ∧ ∃ t : Set β, IsSeparable t ∧ ∀ᵐ x ∂μ, f x ∈ t := by
refine ⟨fun H => ⟨H.aemeasurable, H.isSeparable_ae_range⟩, ?_⟩
rintro ⟨H, ⟨t, t_sep, ht⟩⟩
rcases eq_empty_or_nonempty t with (rfl | h₀)
· simp only [mem_empty_iff_false, eventually_false_iff_eq_bot, ae_eq_bot] at ht
rw [ht]
exact aestronglyMeasurable_zero_measure f
· obtain ⟨g, g_meas, gt, fg⟩ : ∃ g : α → β, Measurable g ∧ range g ⊆ t ∧ f =ᵐ[μ] g :=
H.exists_ae_eq_range_subset ht h₀
refine ⟨g, ?_, fg⟩
exact stronglyMeasurable_iff_measurable_separable.2 ⟨g_meas, t_sep.mono gt⟩
theorem _root_.aestronglyMeasurable_iff_nullMeasurable_separable [PseudoMetrizableSpace β]
[MeasurableSpace β] [BorelSpace β] :
AEStronglyMeasurable f μ ↔
NullMeasurable f μ ∧ ∃ t : Set β, IsSeparable t ∧ ∀ᵐ x ∂μ, f x ∈ t :=
aestronglyMeasurable_iff_aemeasurable_separable.trans <| and_congr_left fun ⟨_, hsep, h⟩ ↦
have := hsep.secondCountableTopology
⟨AEMeasurable.nullMeasurable, fun hf ↦ hf.aemeasurable_of_aerange h⟩
theorem _root_.MeasurableEmbedding.aestronglyMeasurable_map_iff {γ : Type*}
{mγ : MeasurableSpace γ} {mα : MeasurableSpace α} {f : γ → α} {μ : Measure γ}
(hf : MeasurableEmbedding f) {g : α → β} :
AEStronglyMeasurable g (Measure.map f μ) ↔ AEStronglyMeasurable (g ∘ f) μ := by
refine ⟨fun H => H.comp_measurable hf.measurable, ?_⟩
rintro ⟨g₁, hgm₁, heq⟩
rcases hf.exists_stronglyMeasurable_extend hgm₁ fun x => ⟨g x⟩ with ⟨g₂, hgm₂, rfl⟩
exact ⟨g₂, hgm₂, hf.ae_map_iff.2 heq⟩
theorem _root_.Embedding.aestronglyMeasurable_comp_iff [PseudoMetrizableSpace β]
[PseudoMetrizableSpace γ] {g : β → γ} {f : α → β} (hg : Embedding g) :
AEStronglyMeasurable (fun x => g (f x)) μ ↔ AEStronglyMeasurable f μ := by
letI := pseudoMetrizableSpacePseudoMetric γ
borelize β γ
refine
⟨fun H => aestronglyMeasurable_iff_aemeasurable_separable.2 ⟨?_, ?_⟩, fun H =>
hg.continuous.comp_aestronglyMeasurable H⟩
· let G : β → range g := rangeFactorization g
have hG : ClosedEmbedding G :=
{ hg.codRestrict _ _ with
isClosed_range := by rw [surjective_onto_range.range_eq]; exact isClosed_univ }
have : AEMeasurable (G ∘ f) μ := AEMeasurable.subtype_mk H.aemeasurable
exact hG.measurableEmbedding.aemeasurable_comp_iff.1 this
· rcases (aestronglyMeasurable_iff_aemeasurable_separable.1 H).2 with ⟨t, ht, h't⟩
exact ⟨g ⁻¹' t, hg.isSeparable_preimage ht, h't⟩
/-- An almost everywhere sequential limit of almost everywhere strongly measurable functions is
almost everywhere strongly measurable. -/
theorem _root_.aestronglyMeasurable_of_tendsto_ae {ι : Type*} [PseudoMetrizableSpace β]
(u : Filter ι) [NeBot u] [IsCountablyGenerated u] {f : ι → α → β} {g : α → β}
(hf : ∀ i, AEStronglyMeasurable (f i) μ) (lim : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) u (𝓝 (g x))) :
AEStronglyMeasurable g μ := by
borelize β
refine aestronglyMeasurable_iff_aemeasurable_separable.2 ⟨?_, ?_⟩
· exact aemeasurable_of_tendsto_metrizable_ae _ (fun n => (hf n).aemeasurable) lim
· rcases u.exists_seq_tendsto with ⟨v, hv⟩
have : ∀ n : ℕ, ∃ t : Set β, IsSeparable t ∧ f (v n) ⁻¹' t ∈ ae μ := fun n =>
(aestronglyMeasurable_iff_aemeasurable_separable.1 (hf (v n))).2
choose t t_sep ht using this
refine ⟨closure (⋃ i, t i), .closure <| .iUnion t_sep, ?_⟩
filter_upwards [ae_all_iff.2 ht, lim] with x hx h'x
apply mem_closure_of_tendsto (h'x.comp hv)
filter_upwards with n using mem_iUnion_of_mem n (hx n)
/-- If a sequence of almost everywhere strongly measurable functions converges almost everywhere,
one can select a strongly measurable function as the almost everywhere limit. -/
theorem _root_.exists_stronglyMeasurable_limit_of_tendsto_ae [PseudoMetrizableSpace β]
{f : ℕ → α → β} (hf : ∀ n, AEStronglyMeasurable (f n) μ)
(h_ae_tendsto : ∀ᵐ x ∂μ, ∃ l : β, Tendsto (fun n => f n x) atTop (𝓝 l)) :
∃ f_lim : α → β, StronglyMeasurable f_lim ∧
∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x)) := by
borelize β
obtain ⟨g, _, hg⟩ :
∃ g : α → β, Measurable g ∧ ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x)) :=
measurable_limit_of_tendsto_metrizable_ae (fun n => (hf n).aemeasurable) h_ae_tendsto
have Hg : AEStronglyMeasurable g μ := aestronglyMeasurable_of_tendsto_ae _ hf hg
refine ⟨Hg.mk g, Hg.stronglyMeasurable_mk, ?_⟩
filter_upwards [hg, Hg.ae_eq_mk] with x hx h'x
rwa [h'x] at hx
theorem piecewise {s : Set α} [DecidablePred (· ∈ s)]
(hs : MeasurableSet s) (hf : AEStronglyMeasurable f (μ.restrict s))
(hg : AEStronglyMeasurable g (μ.restrict sᶜ)) :
AEStronglyMeasurable (s.piecewise f g) μ := by
refine ⟨s.piecewise (hf.mk f) (hg.mk g),
StronglyMeasurable.piecewise hs hf.stronglyMeasurable_mk hg.stronglyMeasurable_mk, ?_⟩
refine ae_of_ae_restrict_of_ae_restrict_compl s ?_ ?_
· have h := hf.ae_eq_mk
rw [Filter.EventuallyEq, ae_restrict_iff' hs] at h
rw [ae_restrict_iff' hs]
filter_upwards [h] with x hx
intro hx_mem
simp only [hx_mem, Set.piecewise_eq_of_mem, hx hx_mem]
· have h := hg.ae_eq_mk
rw [Filter.EventuallyEq, ae_restrict_iff' hs.compl] at h
rw [ae_restrict_iff' hs.compl]
filter_upwards [h] with x hx
intro hx_mem
rw [Set.mem_compl_iff] at hx_mem
simp only [hx_mem, not_false_eq_true, Set.piecewise_eq_of_not_mem, hx hx_mem]
theorem sum_measure [PseudoMetrizableSpace β] {m : MeasurableSpace α} {μ : ι → Measure α}
(h : ∀ i, AEStronglyMeasurable f (μ i)) : AEStronglyMeasurable f (Measure.sum μ) := by
borelize β
refine
aestronglyMeasurable_iff_aemeasurable_separable.2
⟨AEMeasurable.sum_measure fun i => (h i).aemeasurable, ?_⟩
have A : ∀ i : ι, ∃ t : Set β, IsSeparable t ∧ f ⁻¹' t ∈ ae (μ i) := fun i =>
(aestronglyMeasurable_iff_aemeasurable_separable.1 (h i)).2
choose t t_sep ht using A
refine ⟨⋃ i, t i, .iUnion t_sep, ?_⟩
simp only [Measure.ae_sum_eq, mem_iUnion, eventually_iSup]
intro i
filter_upwards [ht i] with x hx
exact ⟨i, hx⟩
@[simp]
theorem _root_.aestronglyMeasurable_sum_measure_iff [PseudoMetrizableSpace β]
{_m : MeasurableSpace α} {μ : ι → Measure α} :
AEStronglyMeasurable f (sum μ) ↔ ∀ i, AEStronglyMeasurable f (μ i) :=
⟨fun h _ => h.mono_measure (Measure.le_sum _ _), sum_measure⟩
@[simp]
theorem _root_.aestronglyMeasurable_add_measure_iff [PseudoMetrizableSpace β] {ν : Measure α} :
AEStronglyMeasurable f (μ + ν) ↔ AEStronglyMeasurable f μ ∧ AEStronglyMeasurable f ν := by
rw [← sum_cond, aestronglyMeasurable_sum_measure_iff, Bool.forall_bool, and_comm]
rfl
@[measurability]
theorem add_measure [PseudoMetrizableSpace β] {ν : Measure α} {f : α → β}
(hμ : AEStronglyMeasurable f μ) (hν : AEStronglyMeasurable f ν) :
AEStronglyMeasurable f (μ + ν) :=
aestronglyMeasurable_add_measure_iff.2 ⟨hμ, hν⟩
@[measurability]
protected theorem iUnion [PseudoMetrizableSpace β] {s : ι → Set α}
(h : ∀ i, AEStronglyMeasurable f (μ.restrict (s i))) :
AEStronglyMeasurable f (μ.restrict (⋃ i, s i)) :=
(sum_measure h).mono_measure <| restrict_iUnion_le
@[simp]
theorem _root_.aestronglyMeasurable_iUnion_iff [PseudoMetrizableSpace β] {s : ι → Set α} :
AEStronglyMeasurable f (μ.restrict (⋃ i, s i)) ↔
∀ i, AEStronglyMeasurable f (μ.restrict (s i)) :=
⟨fun h _ => h.mono_measure <| restrict_mono (subset_iUnion _ _) le_rfl,
AEStronglyMeasurable.iUnion⟩
@[simp]
theorem _root_.aestronglyMeasurable_union_iff [PseudoMetrizableSpace β] {s t : Set α} :
AEStronglyMeasurable f (μ.restrict (s ∪ t)) ↔
AEStronglyMeasurable f (μ.restrict s) ∧ AEStronglyMeasurable f (μ.restrict t) := by
simp only [union_eq_iUnion, aestronglyMeasurable_iUnion_iff, Bool.forall_bool, cond, and_comm]
theorem aestronglyMeasurable_uIoc_iff [LinearOrder α] [PseudoMetrizableSpace β] {f : α → β}
{a b : α} :
AEStronglyMeasurable f (μ.restrict <| uIoc a b) ↔
AEStronglyMeasurable f (μ.restrict <| Ioc a b) ∧
AEStronglyMeasurable f (μ.restrict <| Ioc b a) := by
rw [uIoc_eq_union, aestronglyMeasurable_union_iff]
@[measurability]
theorem smul_measure {R : Type*} [Monoid R] [DistribMulAction R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞]
(h : AEStronglyMeasurable f μ) (c : R) : AEStronglyMeasurable f (c • μ) :=
⟨h.mk f, h.stronglyMeasurable_mk, ae_smul_measure h.ae_eq_mk c⟩
section MulAction
variable {M G G₀ : Type*}
variable [Monoid M] [MulAction M β] [ContinuousConstSMul M β]
variable [Group G] [MulAction G β] [ContinuousConstSMul G β]
variable [GroupWithZero G₀] [MulAction G₀ β] [ContinuousConstSMul G₀ β]
theorem _root_.aestronglyMeasurable_const_smul_iff (c : G) :
AEStronglyMeasurable (fun x => c • f x) μ ↔ AEStronglyMeasurable f μ :=
⟨fun h => by simpa only [inv_smul_smul] using h.const_smul' c⁻¹, fun h => h.const_smul c⟩
nonrec theorem _root_.IsUnit.aestronglyMeasurable_const_smul_iff {c : M} (hc : IsUnit c) :
AEStronglyMeasurable (fun x => c • f x) μ ↔ AEStronglyMeasurable f μ :=
let ⟨u, hu⟩ := hc
hu ▸ aestronglyMeasurable_const_smul_iff u
theorem _root_.aestronglyMeasurable_const_smul_iff₀ {c : G₀} (hc : c ≠ 0) :
AEStronglyMeasurable (fun x => c • f x) μ ↔ AEStronglyMeasurable f μ :=
(IsUnit.mk0 _ hc).aestronglyMeasurable_const_smul_iff
end MulAction
end AEStronglyMeasurable
/-! ## Almost everywhere finitely strongly measurable functions -/
namespace AEFinStronglyMeasurable
variable {m : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β] {f g : α → β}
section Mk
variable [Zero β]
/-- A `fin_strongly_measurable` function such that `f =ᵐ[μ] hf.mk f`. See lemmas
`fin_strongly_measurable_mk` and `ae_eq_mk`. -/
protected noncomputable def mk (f : α → β) (hf : AEFinStronglyMeasurable f μ) : α → β :=
hf.choose
theorem finStronglyMeasurable_mk (hf : AEFinStronglyMeasurable f μ) :
FinStronglyMeasurable (hf.mk f) μ :=
hf.choose_spec.1
theorem ae_eq_mk (hf : AEFinStronglyMeasurable f μ) : f =ᵐ[μ] hf.mk f :=
hf.choose_spec.2
@[aesop 10% apply (rule_sets := [Measurable])]
protected theorem aemeasurable {β} [Zero β] [MeasurableSpace β] [TopologicalSpace β]
[PseudoMetrizableSpace β] [BorelSpace β] {f : α → β} (hf : AEFinStronglyMeasurable f μ) :
AEMeasurable f μ :=
⟨hf.mk f, hf.finStronglyMeasurable_mk.measurable, hf.ae_eq_mk⟩
end Mk
section Arithmetic
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem mul [MonoidWithZero β] [ContinuousMul β] (hf : AEFinStronglyMeasurable f μ)
(hg : AEFinStronglyMeasurable g μ) : AEFinStronglyMeasurable (f * g) μ :=
⟨hf.mk f * hg.mk g, hf.finStronglyMeasurable_mk.mul hg.finStronglyMeasurable_mk,
hf.ae_eq_mk.mul hg.ae_eq_mk⟩
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem add [AddMonoid β] [ContinuousAdd β] (hf : AEFinStronglyMeasurable f μ)
(hg : AEFinStronglyMeasurable g μ) : AEFinStronglyMeasurable (f + g) μ :=
⟨hf.mk f + hg.mk g, hf.finStronglyMeasurable_mk.add hg.finStronglyMeasurable_mk,
hf.ae_eq_mk.add hg.ae_eq_mk⟩
@[measurability]
protected theorem neg [AddGroup β] [TopologicalAddGroup β] (hf : AEFinStronglyMeasurable f μ) :
AEFinStronglyMeasurable (-f) μ :=
⟨-hf.mk f, hf.finStronglyMeasurable_mk.neg, hf.ae_eq_mk.neg⟩
@[measurability]
protected theorem sub [AddGroup β] [ContinuousSub β] (hf : AEFinStronglyMeasurable f μ)
(hg : AEFinStronglyMeasurable g μ) : AEFinStronglyMeasurable (f - g) μ :=
⟨hf.mk f - hg.mk g, hf.finStronglyMeasurable_mk.sub hg.finStronglyMeasurable_mk,
hf.ae_eq_mk.sub hg.ae_eq_mk⟩
@[measurability]
protected theorem const_smul {𝕜} [TopologicalSpace 𝕜] [AddMonoid β] [Monoid 𝕜]
[DistribMulAction 𝕜 β] [ContinuousSMul 𝕜 β] (hf : AEFinStronglyMeasurable f μ) (c : 𝕜) :
AEFinStronglyMeasurable (c • f) μ :=
⟨c • hf.mk f, hf.finStronglyMeasurable_mk.const_smul c, hf.ae_eq_mk.const_smul c⟩
end Arithmetic
section Order
variable [Zero β]
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem sup [SemilatticeSup β] [ContinuousSup β] (hf : AEFinStronglyMeasurable f μ)
(hg : AEFinStronglyMeasurable g μ) : AEFinStronglyMeasurable (f ⊔ g) μ :=
⟨hf.mk f ⊔ hg.mk g, hf.finStronglyMeasurable_mk.sup hg.finStronglyMeasurable_mk,
hf.ae_eq_mk.sup hg.ae_eq_mk⟩
@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem inf [SemilatticeInf β] [ContinuousInf β] (hf : AEFinStronglyMeasurable f μ)
(hg : AEFinStronglyMeasurable g μ) : AEFinStronglyMeasurable (f ⊓ g) μ :=
⟨hf.mk f ⊓ hg.mk g, hf.finStronglyMeasurable_mk.inf hg.finStronglyMeasurable_mk,
hf.ae_eq_mk.inf hg.ae_eq_mk⟩
end Order
variable [Zero β] [T2Space β]
theorem exists_set_sigmaFinite (hf : AEFinStronglyMeasurable f μ) :
∃ t, MeasurableSet t ∧ f =ᵐ[μ.restrict tᶜ] 0 ∧ SigmaFinite (μ.restrict t) := by
rcases hf with ⟨g, hg, hfg⟩
obtain ⟨t, ht, hgt_zero, htμ⟩ := hg.exists_set_sigmaFinite
refine ⟨t, ht, ?_, htμ⟩
refine EventuallyEq.trans (ae_restrict_of_ae hfg) ?_
rw [EventuallyEq, ae_restrict_iff' ht.compl]
exact eventually_of_forall hgt_zero
/-- A measurable set `t` such that `f =ᵐ[μ.restrict tᶜ] 0` and `sigma_finite (μ.restrict t)`. -/
def sigmaFiniteSet (hf : AEFinStronglyMeasurable f μ) : Set α :=
hf.exists_set_sigmaFinite.choose
protected theorem measurableSet (hf : AEFinStronglyMeasurable f μ) :
MeasurableSet hf.sigmaFiniteSet :=
hf.exists_set_sigmaFinite.choose_spec.1
theorem ae_eq_zero_compl (hf : AEFinStronglyMeasurable f μ) :
f =ᵐ[μ.restrict hf.sigmaFiniteSetᶜ] 0 :=
hf.exists_set_sigmaFinite.choose_spec.2.1
instance sigmaFinite_restrict (hf : AEFinStronglyMeasurable f μ) :
SigmaFinite (μ.restrict hf.sigmaFiniteSet) :=
hf.exists_set_sigmaFinite.choose_spec.2.2
end AEFinStronglyMeasurable
section SecondCountableTopology
variable {G : Type*} {p : ℝ≥0∞} {m m0 : MeasurableSpace α} {μ : Measure α}
[SeminormedAddCommGroup G] [MeasurableSpace G] [BorelSpace G] [SecondCountableTopology G]
{f : α → G}
/-- In a space with second countable topology and a sigma-finite measure, `FinStronglyMeasurable`
and `Measurable` are equivalent. -/
theorem finStronglyMeasurable_iff_measurable {_m0 : MeasurableSpace α} (μ : Measure α)
[SigmaFinite μ] : FinStronglyMeasurable f μ ↔ Measurable f :=
⟨fun h => h.measurable, fun h => (Measurable.stronglyMeasurable h).finStronglyMeasurable μ⟩
/-- In a space with second countable topology and a sigma-finite measure, a measurable function
is `FinStronglyMeasurable`. -/
@[aesop 90% apply (rule_sets := [Measurable])]
theorem finStronglyMeasurable_of_measurable {_m0 : MeasurableSpace α} (μ : Measure α)
[SigmaFinite μ] (hf : Measurable f) : FinStronglyMeasurable f μ :=
(finStronglyMeasurable_iff_measurable μ).mpr hf
/-- In a space with second countable topology and a sigma-finite measure,
`AEFinStronglyMeasurable` and `AEMeasurable` are equivalent. -/
theorem aefinStronglyMeasurable_iff_aemeasurable {_m0 : MeasurableSpace α} (μ : Measure α)
[SigmaFinite μ] : AEFinStronglyMeasurable f μ ↔ AEMeasurable f μ := by
simp_rw [AEFinStronglyMeasurable, AEMeasurable, finStronglyMeasurable_iff_measurable]
/-- In a space with second countable topology and a sigma-finite measure,
an `AEMeasurable` function is `AEFinStronglyMeasurable`. -/
@[aesop 90% apply (rule_sets := [Measurable])]
theorem aefinStronglyMeasurable_of_aemeasurable {_m0 : MeasurableSpace α} (μ : Measure α)
[SigmaFinite μ] (hf : AEMeasurable f μ) : AEFinStronglyMeasurable f μ :=
(aefinStronglyMeasurable_iff_aemeasurable μ).mpr hf
end SecondCountableTopology
theorem measurable_uncurry_of_continuous_of_measurable {α β ι : Type*} [TopologicalSpace ι]
[MetrizableSpace ι] [MeasurableSpace ι] [SecondCountableTopology ι] [OpensMeasurableSpace ι]
{mβ : MeasurableSpace β} [TopologicalSpace β] [PseudoMetrizableSpace β] [BorelSpace β]
{m : MeasurableSpace α} {u : ι → α → β} (hu_cont : ∀ x, Continuous fun i => u i x)
(h : ∀ i, Measurable (u i)) : Measurable (Function.uncurry u) := by
obtain ⟨t_sf, ht_sf⟩ :
∃ t : ℕ → SimpleFunc ι ι, ∀ j x, Tendsto (fun n => u (t n j) x) atTop (𝓝 <| u j x) := by
have h_str_meas : StronglyMeasurable (id : ι → ι) := stronglyMeasurable_id
refine ⟨h_str_meas.approx, fun j x => ?_⟩
exact ((hu_cont x).tendsto j).comp (h_str_meas.tendsto_approx j)
let U (n : ℕ) (p : ι × α) := u (t_sf n p.fst) p.snd
have h_tendsto : Tendsto U atTop (𝓝 fun p => u p.fst p.snd) := by
rw [tendsto_pi_nhds]
exact fun p => ht_sf p.fst p.snd
refine measurable_of_tendsto_metrizable (fun n => ?_) h_tendsto
have h_meas : Measurable fun p : (t_sf n).range × α => u (↑p.fst) p.snd := by
have :
(fun p : ↥(t_sf n).range × α => u (↑p.fst) p.snd) =
(fun p : α × (t_sf n).range => u (↑p.snd) p.fst) ∘ Prod.swap :=
rfl
rw [this, @measurable_swap_iff α (↥(t_sf n).range) β m]
exact measurable_from_prod_countable fun j => h j
have :
(fun p : ι × α => u (t_sf n p.fst) p.snd) =
(fun p : ↥(t_sf n).range × α => u p.fst p.snd) ∘ fun p : ι × α =>
(⟨t_sf n p.fst, SimpleFunc.mem_range_self _ _⟩, p.snd) :=
rfl
simp_rw [U, this]
refine h_meas.comp (Measurable.prod_mk ?_ measurable_snd)
exact ((t_sf n).measurable.comp measurable_fst).subtype_mk
theorem stronglyMeasurable_uncurry_of_continuous_of_stronglyMeasurable {α β ι : Type*}
[TopologicalSpace ι] [MetrizableSpace ι] [MeasurableSpace ι] [SecondCountableTopology ι]
[OpensMeasurableSpace ι] [TopologicalSpace β] [PseudoMetrizableSpace β] [MeasurableSpace α]
{u : ι → α → β} (hu_cont : ∀ x, Continuous fun i => u i x) (h : ∀ i, StronglyMeasurable (u i)) :
StronglyMeasurable (Function.uncurry u) := by
borelize β
obtain ⟨t_sf, ht_sf⟩ :
∃ t : ℕ → SimpleFunc ι ι, ∀ j x, Tendsto (fun n => u (t n j) x) atTop (𝓝 <| u j x) := by
have h_str_meas : StronglyMeasurable (id : ι → ι) := stronglyMeasurable_id
refine ⟨h_str_meas.approx, fun j x => ?_⟩
exact ((hu_cont x).tendsto j).comp (h_str_meas.tendsto_approx j)
let U (n : ℕ) (p : ι × α) := u (t_sf n p.fst) p.snd
have h_tendsto : Tendsto U atTop (𝓝 fun p => u p.fst p.snd) := by
rw [tendsto_pi_nhds]
exact fun p => ht_sf p.fst p.snd
refine stronglyMeasurable_of_tendsto _ (fun n => ?_) h_tendsto
have h_str_meas : StronglyMeasurable fun p : (t_sf n).range × α => u (↑p.fst) p.snd := by
refine stronglyMeasurable_iff_measurable_separable.2 ⟨?_, ?_⟩
· have :
(fun p : ↥(t_sf n).range × α => u (↑p.fst) p.snd) =
(fun p : α × (t_sf n).range => u (↑p.snd) p.fst) ∘ Prod.swap :=
rfl
rw [this, measurable_swap_iff]
exact measurable_from_prod_countable fun j => (h j).measurable
· have : IsSeparable (⋃ i : (t_sf n).range, range (u i)) :=
.iUnion fun i => (h i).isSeparable_range
apply this.mono
rintro _ ⟨⟨i, x⟩, rfl⟩
simp only [mem_iUnion, mem_range]
exact ⟨i, x, rfl⟩
have :
(fun p : ι × α => u (t_sf n p.fst) p.snd) =
(fun p : ↥(t_sf n).range × α => u p.fst p.snd) ∘ fun p : ι × α =>
(⟨t_sf n p.fst, SimpleFunc.mem_range_self _ _⟩, p.snd) :=
rfl
simp_rw [U, this]
refine h_str_meas.comp_measurable (Measurable.prod_mk ?_ measurable_snd)
exact ((t_sf n).measurable.comp measurable_fst).subtype_mk
end MeasureTheory
-- Guard against import creep
assert_not_exists InnerProductSpace
|
MeasureTheory\Function\StronglyMeasurable\Inner.lean | /-
Copyright (c) 2021 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
-/
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
import Mathlib.Analysis.InnerProductSpace.Basic
/-!
# Inner products of strongly measurable functions are strongly measurable.
-/
variable {α : Type*}
namespace MeasureTheory
/-! ## Strongly measurable functions -/
namespace StronglyMeasurable
protected theorem inner {𝕜 : Type*} {E : Type*} [RCLike 𝕜] [NormedAddCommGroup E]
[InnerProductSpace 𝕜 E] {_ : MeasurableSpace α} {f g : α → E} (hf : StronglyMeasurable f)
(hg : StronglyMeasurable g) : StronglyMeasurable fun t => @inner 𝕜 _ _ (f t) (g t) :=
Continuous.comp_stronglyMeasurable continuous_inner (hf.prod_mk hg)
end StronglyMeasurable
namespace AEStronglyMeasurable
variable {m : MeasurableSpace α} {μ : Measure α} {𝕜 : Type*} {E : Type*} [RCLike 𝕜]
[NormedAddCommGroup E] [InnerProductSpace 𝕜 E]
local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y
protected theorem re {f : α → 𝕜} (hf : AEStronglyMeasurable f μ) :
AEStronglyMeasurable (fun x => RCLike.re (f x)) μ :=
RCLike.continuous_re.comp_aestronglyMeasurable hf
protected theorem im {f : α → 𝕜} (hf : AEStronglyMeasurable f μ) :
AEStronglyMeasurable (fun x => RCLike.im (f x)) μ :=
RCLike.continuous_im.comp_aestronglyMeasurable hf
protected theorem inner {_ : MeasurableSpace α} {μ : Measure α} {f g : α → E}
(hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
AEStronglyMeasurable (fun x => ⟪f x, g x⟫) μ :=
continuous_inner.comp_aestronglyMeasurable (hf.prod_mk hg)
end AEStronglyMeasurable
end MeasureTheory
|
MeasureTheory\Function\StronglyMeasurable\Lemmas.lean | /-
Copyright (c) 2021 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
-/
import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic
import Mathlib.MeasureTheory.Measure.WithDensity
import Mathlib.Topology.Algebra.Module.FiniteDimension
/-!
# Strongly measurable and finitely strongly measurable functions
This file contains some further development of strongly measurable and finitely strongly measurable
functions, started in `Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic`.
## References
* Hytönen, Tuomas, Jan Van Neerven, Mark Veraar, and Lutz Weis. Analysis in Banach spaces.
Springer, 2016.
-/
open MeasureTheory Filter Set ENNReal NNReal
variable {α β γ : Type*} {m : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β]
[TopologicalSpace γ] {f g : α → β}
theorem MeasureTheory.AEStronglyMeasurable.comp_measurePreserving
{γ : Type*} {_ : MeasurableSpace γ} {_ : MeasurableSpace α} {f : γ → α} {μ : Measure γ}
{ν : Measure α} (hg : AEStronglyMeasurable g ν) (hf : MeasurePreserving f μ ν) :
AEStronglyMeasurable (g ∘ f) μ :=
hg.comp_quasiMeasurePreserving hf.quasiMeasurePreserving
theorem MeasureTheory.MeasurePreserving.aestronglyMeasurable_comp_iff {β : Type*}
{f : α → β} {mα : MeasurableSpace α} {μa : Measure α} {mβ : MeasurableSpace β} {μb : Measure β}
(hf : MeasurePreserving f μa μb) (h₂ : MeasurableEmbedding f) {g : β → γ} :
AEStronglyMeasurable (g ∘ f) μa ↔ AEStronglyMeasurable g μb := by
rw [← hf.map_eq, h₂.aestronglyMeasurable_map_iff]
section NormedSpace
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
theorem aestronglyMeasurable_smul_const_iff {f : α → 𝕜} {c : E} (hc : c ≠ 0) :
AEStronglyMeasurable (fun x => f x • c) μ ↔ AEStronglyMeasurable f μ :=
(closedEmbedding_smul_left hc).toEmbedding.aestronglyMeasurable_comp_iff
end NormedSpace
section ContinuousLinearMapNontriviallyNormedField
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G]
theorem StronglyMeasurable.apply_continuousLinearMap
{_m : MeasurableSpace α} {φ : α → F →L[𝕜] E} (hφ : StronglyMeasurable φ) (v : F) :
StronglyMeasurable fun a => φ a v :=
(ContinuousLinearMap.apply 𝕜 E v).continuous.comp_stronglyMeasurable hφ
@[measurability]
theorem MeasureTheory.AEStronglyMeasurable.apply_continuousLinearMap {φ : α → F →L[𝕜] E}
(hφ : AEStronglyMeasurable φ μ) (v : F) :
AEStronglyMeasurable (fun a => φ a v) μ :=
(ContinuousLinearMap.apply 𝕜 E v).continuous.comp_aestronglyMeasurable hφ
theorem ContinuousLinearMap.aestronglyMeasurable_comp₂ (L : E →L[𝕜] F →L[𝕜] G) {f : α → E}
{g : α → F} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
AEStronglyMeasurable (fun x => L (f x) (g x)) μ :=
L.continuous₂.comp_aestronglyMeasurable₂ hf hg
end ContinuousLinearMapNontriviallyNormedField
theorem aestronglyMeasurable_withDensity_iff {E : Type*} [NormedAddCommGroup E]
[NormedSpace ℝ E] {f : α → ℝ≥0} (hf : Measurable f) {g : α → E} :
AEStronglyMeasurable g (μ.withDensity fun x => (f x : ℝ≥0∞)) ↔
AEStronglyMeasurable (fun x => (f x : ℝ) • g x) μ := by
constructor
· rintro ⟨g', g'meas, hg'⟩
have A : MeasurableSet { x : α | f x ≠ 0 } := (hf (measurableSet_singleton 0)).compl
refine ⟨fun x => (f x : ℝ) • g' x, hf.coe_nnreal_real.stronglyMeasurable.smul g'meas, ?_⟩
apply @ae_of_ae_restrict_of_ae_restrict_compl _ _ _ { x | f x ≠ 0 }
· rw [EventuallyEq, ae_withDensity_iff hf.coe_nnreal_ennreal] at hg'
rw [ae_restrict_iff' A]
filter_upwards [hg'] with a ha h'a
have : (f a : ℝ≥0∞) ≠ 0 := by simpa only [Ne, ENNReal.coe_eq_zero] using h'a
rw [ha this]
· filter_upwards [ae_restrict_mem A.compl] with x hx
simp only [Classical.not_not, mem_setOf_eq, mem_compl_iff] at hx
simp [hx]
· rintro ⟨g', g'meas, hg'⟩
refine ⟨fun x => (f x : ℝ)⁻¹ • g' x, hf.coe_nnreal_real.inv.stronglyMeasurable.smul g'meas, ?_⟩
rw [EventuallyEq, ae_withDensity_iff hf.coe_nnreal_ennreal]
filter_upwards [hg'] with x hx h'x
rw [← hx, smul_smul, _root_.inv_mul_cancel, one_smul]
simp only [Ne, ENNReal.coe_eq_zero] at h'x
simpa only [NNReal.coe_eq_zero, Ne] using h'x
|
MeasureTheory\Function\StronglyMeasurable\Lp.lean | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas
/-!
# Finitely strongly measurable functions in `Lp`
Functions in `Lp` for `0 < p < ∞` are finitely strongly measurable.
## Main statements
* `Memℒp.aefinStronglyMeasurable`: if `Memℒp f p μ` with `0 < p < ∞`, then
`AEFinStronglyMeasurable f μ`.
* `Lp.finStronglyMeasurable`: for `0 < p < ∞`, `Lp` functions are finitely strongly measurable.
## References
* Hytönen, Tuomas, Jan Van Neerven, Mark Veraar, and Lutz Weis. Analysis in Banach spaces.
Springer, 2016.
-/
open MeasureTheory Filter TopologicalSpace Function
open scoped ENNReal Topology MeasureTheory
namespace MeasureTheory
local infixr:25 " →ₛ " => SimpleFunc
variable {α G : Type*} {p : ℝ≥0∞} {m m0 : MeasurableSpace α} {μ : Measure α} [NormedAddCommGroup G]
{f : α → G}
theorem Memℒp.finStronglyMeasurable_of_stronglyMeasurable (hf : Memℒp f p μ)
(hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
FinStronglyMeasurable f μ := by
borelize G
haveI : SeparableSpace (Set.range f ∪ {0} : Set G) :=
hf_meas.separableSpace_range_union_singleton
let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp)
refine ⟨fs, ?_, ?_⟩
· have h_fs_Lp : ∀ n, Memℒp (fs n) p μ :=
SimpleFunc.memℒp_approxOn_range hf_meas.measurable hf
exact fun n => (fs n).measure_support_lt_top_of_memℒp (h_fs_Lp n) hp_ne_zero hp_ne_top
· intro x
apply SimpleFunc.tendsto_approxOn
apply subset_closure
simp
theorem Memℒp.aefinStronglyMeasurable (hf : Memℒp f p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
AEFinStronglyMeasurable f μ :=
⟨hf.aestronglyMeasurable.mk f,
((memℒp_congr_ae hf.aestronglyMeasurable.ae_eq_mk).mp
hf).finStronglyMeasurable_of_stronglyMeasurable
hf.aestronglyMeasurable.stronglyMeasurable_mk hp_ne_zero hp_ne_top,
hf.aestronglyMeasurable.ae_eq_mk⟩
theorem Integrable.aefinStronglyMeasurable (hf : Integrable f μ) : AEFinStronglyMeasurable f μ :=
(memℒp_one_iff_integrable.mpr hf).aefinStronglyMeasurable one_ne_zero ENNReal.coe_ne_top
theorem Lp.finStronglyMeasurable (f : Lp G p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
FinStronglyMeasurable f μ :=
(Lp.memℒp f).finStronglyMeasurable_of_stronglyMeasurable (Lp.stronglyMeasurable f) hp_ne_zero
hp_ne_top
end MeasureTheory
|
MeasureTheory\Group\Action.lean | /-
Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury G. Kudryashov
-/
import Mathlib.Dynamics.Ergodic.MeasurePreserving
import Mathlib.Dynamics.Minimal
import Mathlib.GroupTheory.GroupAction.Hom
import Mathlib.MeasureTheory.Group.MeasurableEquiv
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.Order.Filter.EventuallyConst
/-!
# Measures invariant under group actions
A measure `μ : Measure α` is said to be *invariant* under an action of a group `G` if scalar
multiplication by `c : G` is a measure preserving map for all `c`. In this file we define a
typeclass for measures invariant under action of an (additive or multiplicative) group and prove
some basic properties of such measures.
-/
open scoped ENNReal NNReal Pointwise Topology
open MeasureTheory.Measure Set Function Filter
namespace MeasureTheory
universe u v w
variable {G : Type u} {M : Type v} {α : Type w} {s : Set α}
/-- A measure `μ : Measure α` is invariant under an additive action of `M` on `α` if for any
measurable set `s : Set α` and `c : M`, the measure of its preimage under `fun x => c +ᵥ x` is equal
to the measure of `s`. -/
class VAddInvariantMeasure (M α : Type*) [VAdd M α] {_ : MeasurableSpace α} (μ : Measure α) :
Prop where
measure_preimage_vadd : ∀ (c : M) ⦃s : Set α⦄, MeasurableSet s → μ ((fun x => c +ᵥ x) ⁻¹' s) = μ s
/-- A measure `μ : Measure α` is invariant under a multiplicative action of `M` on `α` if for any
measurable set `s : Set α` and `c : M`, the measure of its preimage under `fun x => c • x` is equal
to the measure of `s`. -/
@[to_additive]
class SMulInvariantMeasure (M α : Type*) [SMul M α] {_ : MeasurableSpace α} (μ : Measure α) :
Prop where
measure_preimage_smul : ∀ (c : M) ⦃s : Set α⦄, MeasurableSet s → μ ((fun x => c • x) ⁻¹' s) = μ s
namespace SMulInvariantMeasure
@[to_additive]
instance zero [MeasurableSpace α] [SMul M α] : SMulInvariantMeasure M α (0 : Measure α) :=
⟨fun _ _ _ => rfl⟩
variable [SMul M α] {m : MeasurableSpace α} {μ ν : Measure α}
@[to_additive]
instance add [SMulInvariantMeasure M α μ] [SMulInvariantMeasure M α ν] :
SMulInvariantMeasure M α (μ + ν) :=
⟨fun c _s hs =>
show _ + _ = _ + _ from
congr_arg₂ (· + ·) (measure_preimage_smul c hs) (measure_preimage_smul c hs)⟩
@[to_additive]
instance smul [SMulInvariantMeasure M α μ] (c : ℝ≥0∞) : SMulInvariantMeasure M α (c • μ) :=
⟨fun a _s hs => show c • _ = c • _ from congr_arg (c • ·) (measure_preimage_smul a hs)⟩
@[to_additive]
instance smul_nnreal [SMulInvariantMeasure M α μ] (c : ℝ≥0) : SMulInvariantMeasure M α (c • μ) :=
SMulInvariantMeasure.smul c
end SMulInvariantMeasure
section AE_smul
variable {m : MeasurableSpace α} [MeasurableSpace G] [SMul G α]
(μ : Measure α) [SMulInvariantMeasure G α μ] {s : Set α}
/-- See also `measure_preimage_smul_of_nullMeasurableSet` and `measure_preimage_smul`. -/
@[to_additive "See also `measure_preimage_smul_of_nullMeasurableSet` and `measure_preimage_smul`."]
theorem measure_preimage_smul_le (c : G) (s : Set α) : μ ((c • ·) ⁻¹' s) ≤ μ s :=
(outerMeasure_le_iff (m := .map (c • ·) μ.1)).2
(fun _s hs ↦ (SMulInvariantMeasure.measure_preimage_smul _ hs).le) _
/-- See also `smul_ae`. -/
@[to_additive "See also `vadd_ae`."]
theorem tendsto_smul_ae (c : G) : Filter.Tendsto (c • ·) (ae μ) (ae μ) := fun _s hs ↦
eq_bot_mono (measure_preimage_smul_le μ c _) hs
variable {μ}
@[to_additive]
theorem measure_preimage_smul_null (h : μ s = 0) (c : G) : μ ((c • ·) ⁻¹' s) = 0 :=
eq_bot_mono (measure_preimage_smul_le μ c _) h
@[to_additive]
theorem measure_preimage_smul_of_nullMeasurableSet (hs : NullMeasurableSet s μ) (c : G) :
μ ((c • ·) ⁻¹' s) = μ s := by
rw [← measure_toMeasurable s,
← SMulInvariantMeasure.measure_preimage_smul c (measurableSet_toMeasurable μ s)]
exact measure_congr (tendsto_smul_ae μ c hs.toMeasurable_ae_eq) |>.symm
end AE_smul
section AE
variable {m : MeasurableSpace α} [MeasurableSpace G] [Group G] [MulAction G α]
(μ : Measure α) [SMulInvariantMeasure G α μ]
@[to_additive (attr := simp)]
theorem measure_preimage_smul (c : G) (s : Set α) : μ ((c • ·) ⁻¹' s) = μ s :=
(measure_preimage_smul_le μ c s).antisymm <| by
simpa [preimage_preimage] using measure_preimage_smul_le μ c⁻¹ ((c • ·) ⁻¹' s)
@[to_additive (attr := simp)]
theorem measure_smul (c : G) (s : Set α) : μ (c • s) = μ s := by
simpa only [preimage_smul_inv] using measure_preimage_smul μ c⁻¹ s
variable {μ}
@[to_additive]
theorem measure_smul_eq_zero_iff {s} (c : G) : μ (c • s) = 0 ↔ μ s = 0 := by
rw [measure_smul]
@[to_additive]
theorem measure_smul_null {s} (h : μ s = 0) (c : G) : μ (c • s) = 0 :=
(measure_smul_eq_zero_iff _).2 h
@[to_additive (attr := simp)]
theorem smul_mem_ae (c : G) {s : Set α} : c • s ∈ ae μ ↔ s ∈ ae μ := by
simp only [mem_ae_iff, ← smul_set_compl, measure_smul_eq_zero_iff]
@[to_additive (attr := simp)]
theorem smul_ae (c : G) : c • ae μ = ae μ := by
ext s
simp only [mem_smul_filter, preimage_smul, smul_mem_ae]
@[to_additive (attr := simp)]
theorem eventuallyConst_smul_set_ae (c : G) {s : Set α} :
EventuallyConst (c • s : Set α) (ae μ) ↔ EventuallyConst s (ae μ) := by
rw [← preimage_smul_inv, eventuallyConst_preimage, Filter.map_smul, smul_ae]
@[to_additive (attr := simp)]
theorem smul_set_ae_le (c : G) {s t : Set α} : c • s ≤ᵐ[μ] c • t ↔ s ≤ᵐ[μ] t := by
simp only [ae_le_set, ← smul_set_sdiff, measure_smul_eq_zero_iff]
@[to_additive (attr := simp)]
theorem smul_set_ae_eq (c : G) {s t : Set α} : c • s =ᵐ[μ] c • t ↔ s =ᵐ[μ] t := by
simp only [Filter.eventuallyLE_antisymm_iff, smul_set_ae_le]
end AE
section MeasurableSMul
variable {m : MeasurableSpace α} [MeasurableSpace M] [SMul M α] [MeasurableSMul M α] (c : M)
(μ : Measure α) [SMulInvariantMeasure M α μ]
@[to_additive (attr := simp)]
theorem measurePreserving_smul : MeasurePreserving (c • ·) μ μ :=
{ measurable := measurable_const_smul c
map_eq := by
ext1 s hs
rw [map_apply (measurable_const_smul c) hs]
exact SMulInvariantMeasure.measure_preimage_smul c hs }
@[to_additive (attr := simp)]
theorem map_smul : map (c • ·) μ = μ :=
(measurePreserving_smul c μ).map_eq
end MeasurableSMul
section SMulHomClass
universe uM uN uα uβ
variable {M : Type uM} {N : Type uN} {α : Type uα} {β : Type uβ}
[MeasurableSpace M] [MeasurableSpace N] [MeasurableSpace α] [MeasurableSpace β]
@[to_additive]
theorem smulInvariantMeasure_map [SMul M α] [SMul M β]
[MeasurableSMul M β]
(μ : Measure α) [SMulInvariantMeasure M α μ] (f : α → β)
(hsmul : ∀ (m : M) a, f (m • a) = m • f a) (hf : Measurable f) :
SMulInvariantMeasure M β (map f μ) where
measure_preimage_smul m S hS := calc
map f μ ((m • ·) ⁻¹' S)
_ = μ (f ⁻¹' ((m • ·) ⁻¹' S)) := map_apply hf <| hS.preimage (measurable_const_smul _)
_ = μ ((m • f ·) ⁻¹' S) := by rw [preimage_preimage]
_ = μ ((f <| m • ·) ⁻¹' S) := by simp_rw [hsmul]
_ = μ ((m • ·) ⁻¹' (f ⁻¹' S)) := by rw [← preimage_preimage]
_ = μ (f ⁻¹' S) := by rw [SMulInvariantMeasure.measure_preimage_smul m (hS.preimage hf)]
_ = map f μ S := (map_apply hf hS).symm
@[to_additive]
instance smulInvariantMeasure_map_smul [SMul M α] [SMul N α] [SMulCommClass N M α]
[MeasurableSMul M α] [MeasurableSMul N α]
(μ : Measure α) [SMulInvariantMeasure M α μ] (n : N) :
SMulInvariantMeasure M α (map (n • ·) μ) :=
smulInvariantMeasure_map μ _ (smul_comm n) <| measurable_const_smul _
end SMulHomClass
variable (G) {m : MeasurableSpace α} [Group G] [MulAction G α] [MeasurableSpace G]
[MeasurableSMul G α] (c : G) (μ : Measure α)
/-- Equivalent definitions of a measure invariant under a multiplicative action of a group.
- 0: `SMulInvariantMeasure G α μ`;
- 1: for every `c : G` and a measurable set `s`, the measure of the preimage of `s` under scalar
multiplication by `c` is equal to the measure of `s`;
- 2: for every `c : G` and a measurable set `s`, the measure of the image `c • s` of `s` under
scalar multiplication by `c` is equal to the measure of `s`;
- 3, 4: properties 2, 3 for any set, including non-measurable ones;
- 5: for any `c : G`, scalar multiplication by `c` maps `μ` to `μ`;
- 6: for any `c : G`, scalar multiplication by `c` is a measure preserving map. -/
@[to_additive]
theorem smulInvariantMeasure_tfae :
List.TFAE
[SMulInvariantMeasure G α μ,
∀ (c : G) (s), MeasurableSet s → μ ((c • ·) ⁻¹' s) = μ s,
∀ (c : G) (s), MeasurableSet s → μ (c • s) = μ s,
∀ (c : G) (s), μ ((c • ·) ⁻¹' s) = μ s,
∀ (c : G) (s), μ (c • s) = μ s,
∀ c : G, Measure.map (c • ·) μ = μ,
∀ c : G, MeasurePreserving (c • ·) μ μ] := by
tfae_have 1 ↔ 2
· exact ⟨fun h => h.1, fun h => ⟨h⟩⟩
tfae_have 1 → 6
· intro h c
exact (measurePreserving_smul c μ).map_eq
tfae_have 6 → 7
· exact fun H c => ⟨measurable_const_smul c, H c⟩
tfae_have 7 → 4
· exact fun H c => (H c).measure_preimage_emb (measurableEmbedding_const_smul c)
tfae_have 4 → 5
· exact fun H c s => by
rw [← preimage_smul_inv]
apply H
tfae_have 5 → 3
· exact fun H c s _ => H c s
tfae_have 3 → 2
· intro H c s hs
rw [preimage_smul]
exact H c⁻¹ s hs
tfae_finish
/-- Equivalent definitions of a measure invariant under an additive action of a group.
- 0: `VAddInvariantMeasure G α μ`;
- 1: for every `c : G` and a measurable set `s`, the measure of the preimage of `s` under
vector addition `(c +ᵥ ·)` is equal to the measure of `s`;
- 2: for every `c : G` and a measurable set `s`, the measure of the image `c +ᵥ s` of `s` under
vector addition `(c +ᵥ ·)` is equal to the measure of `s`;
- 3, 4: properties 2, 3 for any set, including non-measurable ones;
- 5: for any `c : G`, vector addition of `c` maps `μ` to `μ`;
- 6: for any `c : G`, vector addition of `c` is a measure preserving map. -/
add_decl_doc vaddInvariantMeasure_tfae
variable {G}
variable [SMulInvariantMeasure G α μ]
variable {μ}
@[to_additive]
theorem NullMeasurableSet.smul {s} (hs : NullMeasurableSet s μ) (c : G) :
NullMeasurableSet (c • s) μ := by
simpa only [← preimage_smul_inv] using
hs.preimage (measurePreserving_smul _ _).quasiMeasurePreserving
section IsMinimal
variable (G)
variable [TopologicalSpace α] [ContinuousConstSMul G α] [MulAction.IsMinimal G α] {K U : Set α}
/-- If measure `μ` is invariant under a group action and is nonzero on a compact set `K`, then it is
positive on any nonempty open set. In case of a regular measure, one can assume `μ ≠ 0` instead of
`μ K ≠ 0`, see `MeasureTheory.measure_isOpen_pos_of_smulInvariant_of_ne_zero`. -/
@[to_additive]
theorem measure_isOpen_pos_of_smulInvariant_of_compact_ne_zero (hK : IsCompact K) (hμK : μ K ≠ 0)
(hU : IsOpen U) (hne : U.Nonempty) : 0 < μ U :=
let ⟨t, ht⟩ := hK.exists_finite_cover_smul G hU hne
pos_iff_ne_zero.2 fun hμU =>
hμK <|
measure_mono_null ht <|
(measure_biUnion_null_iff t.countable_toSet).2 fun _ _ => by rwa [measure_smul]
/-- If measure `μ` is invariant under an additive group action and is nonzero on a compact set `K`,
then it is positive on any nonempty open set. In case of a regular measure, one can assume `μ ≠ 0`
instead of `μ K ≠ 0`, see `MeasureTheory.measure_isOpen_pos_of_vaddInvariant_of_ne_zero`. -/
add_decl_doc measure_isOpen_pos_of_vaddInvariant_of_compact_ne_zero
@[to_additive]
theorem isLocallyFiniteMeasure_of_smulInvariant (hU : IsOpen U) (hne : U.Nonempty) (hμU : μ U ≠ ∞) :
IsLocallyFiniteMeasure μ :=
⟨fun x =>
let ⟨g, hg⟩ := hU.exists_smul_mem G x hne
⟨(g • ·) ⁻¹' U, (hU.preimage (continuous_id.const_smul _)).mem_nhds hg,
Ne.lt_top <| by rwa [measure_preimage_smul]⟩⟩
variable [Measure.Regular μ]
@[to_additive]
theorem measure_isOpen_pos_of_smulInvariant_of_ne_zero (hμ : μ ≠ 0) (hU : IsOpen U)
(hne : U.Nonempty) : 0 < μ U :=
let ⟨_K, hK, hμK⟩ := Regular.exists_compact_not_null.mpr hμ
measure_isOpen_pos_of_smulInvariant_of_compact_ne_zero G hK hμK hU hne
@[to_additive]
theorem measure_pos_iff_nonempty_of_smulInvariant (hμ : μ ≠ 0) (hU : IsOpen U) :
0 < μ U ↔ U.Nonempty :=
⟨fun h => nonempty_of_measure_ne_zero h.ne',
measure_isOpen_pos_of_smulInvariant_of_ne_zero G hμ hU⟩
@[to_additive]
theorem measure_eq_zero_iff_eq_empty_of_smulInvariant (hμ : μ ≠ 0) (hU : IsOpen U) :
μ U = 0 ↔ U = ∅ := by
rw [← not_iff_not, ← Ne, ← pos_iff_ne_zero,
measure_pos_iff_nonempty_of_smulInvariant G hμ hU, nonempty_iff_ne_empty]
end IsMinimal
end MeasureTheory
|
MeasureTheory\Group\AddCircle.lean | /-
Copyright (c) 2022 Oliver Nash. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Nash
-/
import Mathlib.MeasureTheory.Integral.Periodic
import Mathlib.Data.ZMod.Quotient
import Mathlib.MeasureTheory.Group.AEStabilizer
/-!
# Measure-theoretic results about the additive circle
The file is a place to collect measure-theoretic results about the additive circle.
## Main definitions:
* `AddCircle.closedBall_ae_eq_ball`: open and closed balls in the additive circle are almost
equal
* `AddCircle.isAddFundamentalDomain_of_ae_ball`: a ball is a fundamental domain for rational
angle rotation in the additive circle
-/
open Set Function Filter MeasureTheory MeasureTheory.Measure Metric
open scoped MeasureTheory Pointwise Topology ENNReal
namespace AddCircle
variable {T : ℝ} [hT : Fact (0 < T)]
theorem closedBall_ae_eq_ball {x : AddCircle T} {ε : ℝ} : closedBall x ε =ᵐ[volume] ball x ε := by
rcases le_or_lt ε 0 with hε | hε
· rw [ball_eq_empty.mpr hε, ae_eq_empty, volume_closedBall,
min_eq_right (by linarith [hT.out] : 2 * ε ≤ T), ENNReal.ofReal_eq_zero]
exact mul_nonpos_of_nonneg_of_nonpos zero_le_two hε
· suffices volume (closedBall x ε) ≤ volume (ball x ε) by
exact (ae_eq_of_subset_of_measure_ge ball_subset_closedBall this measurableSet_ball
(measure_ne_top _ _)).symm
have : Tendsto (fun δ => volume (closedBall x δ)) (𝓝[<] ε) (𝓝 <| volume (closedBall x ε)) := by
simp_rw [volume_closedBall]
refine ENNReal.tendsto_ofReal (Tendsto.min tendsto_const_nhds <| Tendsto.const_mul _ ?_)
convert (@monotone_id ℝ _).tendsto_nhdsWithin_Iio ε
simp
refine le_of_tendsto this (mem_nhdsWithin_Iio_iff_exists_Ioo_subset.mpr ⟨0, hε, fun r hr => ?_⟩)
exact measure_mono (closedBall_subset_ball hr.2)
/-- Let `G` be the subgroup of `AddCircle T` generated by a point `u` of finite order `n : ℕ`. Then
any set `I` that is almost equal to a ball of radius `T / 2n` is a fundamental domain for the action
of `G` on `AddCircle T` by left addition. -/
theorem isAddFundamentalDomain_of_ae_ball (I : Set <| AddCircle T) (u x : AddCircle T)
(hu : IsOfFinAddOrder u) (hI : I =ᵐ[volume] ball x (T / (2 * addOrderOf u))) :
IsAddFundamentalDomain (AddSubgroup.zmultiples u) I := by
set G := AddSubgroup.zmultiples u
set n := addOrderOf u
set B := ball x (T / (2 * n))
have hn : 1 ≤ (n : ℝ) := by norm_cast; linarith [hu.addOrderOf_pos]
refine IsAddFundamentalDomain.mk_of_measure_univ_le ?_ ?_ ?_ ?_
· -- `NullMeasurableSet I volume`
exact measurableSet_ball.nullMeasurableSet.congr hI.symm
· -- `∀ (g : G), g ≠ 0 → AEDisjoint volume (g +ᵥ I) I`
rintro ⟨g, hg⟩ hg'
replace hg' : g ≠ 0 := by simpa only [Ne, AddSubgroup.mk_eq_zero] using hg'
change AEDisjoint volume (g +ᵥ I) I
refine AEDisjoint.congr (Disjoint.aedisjoint ?_)
((quasiMeasurePreserving_add_left volume (-g)).vadd_ae_eq_of_ae_eq g hI) hI
have hBg : g +ᵥ B = ball (g + x) (T / (2 * n)) := by
rw [add_comm g x, ← singleton_add_ball _ x g, add_ball, thickening_singleton]
rw [hBg]
apply ball_disjoint_ball
rw [dist_eq_norm, add_sub_cancel_right, div_mul_eq_div_div, ← add_div, ← add_div,
add_self_div_two, div_le_iff' (by positivity : 0 < (n : ℝ)), ← nsmul_eq_mul]
refine (le_add_order_smul_norm_of_isOfFinAddOrder (hu.of_mem_zmultiples hg) hg').trans
(nsmul_le_nsmul_left (norm_nonneg g) ?_)
exact Nat.le_of_dvd (addOrderOf_pos_iff.mpr hu) (addOrderOf_dvd_of_mem_zmultiples hg)
· -- `∀ (g : G), QuasiMeasurePreserving (VAdd.vadd g) volume volume`
exact fun g => quasiMeasurePreserving_add_left (G := AddCircle T) volume g
· -- `volume univ ≤ ∑' (g : G), volume (g +ᵥ I)`
replace hI := hI.trans closedBall_ae_eq_ball.symm
haveI : Fintype G := @Fintype.ofFinite _ hu.finite_zmultiples.to_subtype
have hG_card : (Finset.univ : Finset G).card = n := by
show _ = addOrderOf u
rw [← Nat.card_zmultiples, Nat.card_eq_fintype_card]; rfl
simp_rw [measure_vadd]
rw [AddCircle.measure_univ, tsum_fintype, Finset.sum_const, measure_congr hI,
volume_closedBall, ← ENNReal.ofReal_nsmul, mul_div, mul_div_mul_comm,
div_self, one_mul, min_eq_right (div_le_self hT.out.le hn), hG_card,
nsmul_eq_mul, mul_div_cancel₀ T (lt_of_lt_of_le zero_lt_one hn).ne.symm]
exact two_ne_zero
theorem volume_of_add_preimage_eq (s I : Set <| AddCircle T) (u x : AddCircle T)
(hu : IsOfFinAddOrder u) (hs : (u +ᵥ s : Set <| AddCircle T) =ᵐ[volume] s)
(hI : I =ᵐ[volume] ball x (T / (2 * addOrderOf u))) :
volume s = addOrderOf u • volume (s ∩ I) := by
let G := AddSubgroup.zmultiples u
haveI : Fintype G := @Fintype.ofFinite _ hu.finite_zmultiples.to_subtype
have hsG : ∀ g : G, (g +ᵥ s : Set <| AddCircle T) =ᵐ[volume] s := by
rintro ⟨y, hy⟩; exact (vadd_ae_eq_self_of_mem_zmultiples hs hy : _)
rw [(isAddFundamentalDomain_of_ae_ball I u x hu hI).measure_eq_card_smul_of_vadd_ae_eq_self s hsG,
← Nat.card_zmultiples u]
end AddCircle
|
MeasureTheory\Group\AEStabilizer.lean | /-
Copyright (c) 2024 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.MeasureTheory.Group.Action
import Mathlib.Order.Filter.EventuallyConst
/-!
# A.e. stabilizer of a set
In this file we define the a.e. stabilizer of a set under a measure preserving group action.
The a.e. stabilizer `MulAction.aestabilizer G μ s` of a set `s`
is the set of the elements `g : G` such that `s` is a.e.-invariant under `(g • ·)`.
For a measure preserving group action, this set is a subgroup of `G`.
If the set is null or conull, then this subgroup is the whole group.
The converse is true for an ergodic action and a null-measurable set.
## Implementation notes
We define the a.e. stabilizer as a bundled `Subgroup`,
thus we do not deal with monoid actions.
Also, many lemmas in this file are true for a *quasi measure-preserving* action,
but we don't have the corresponding typeclass.
-/
open Filter Set MeasureTheory
open scoped Pointwise
variable (G : Type*) {α : Type*} [Group G] [MulAction G α]
{_ : MeasurableSpace α} (μ : Measure α) [SMulInvariantMeasure G α μ]
namespace MulAction
/-- A.e. stabilizer of a set under a group action. -/
@[to_additive (attr := simps) "A.e. stabilizer of a set under an additive group action."]
def aestabilizer (s : Set α) : Subgroup G where
carrier := {g | g • s =ᵐ[μ] s}
one_mem' := by simp
-- TODO: `calc` would be more readable but fails because of defeq abuse
mul_mem' {g₁ g₂} h₁ h₂ := by simpa only [smul_smul] using ((smul_set_ae_eq g₁).2 h₂).trans h₁
inv_mem' {g} h := by simpa using (smul_set_ae_eq g⁻¹).2 h.out.symm
variable {G μ}
variable {g : G} {s t : Set α}
@[to_additive (attr := simp)]
lemma mem_aestabilizer : g ∈ aestabilizer G μ s ↔ g • s =ᵐ[μ] s := .rfl
@[to_additive]
lemma stabilizer_le_aestabilizer (s : Set α) : stabilizer G s ≤ aestabilizer G μ s := by
intro g hg
simp_all
@[to_additive (attr := simp)]
lemma aestabilizer_empty : aestabilizer G μ ∅ = ⊤ := top_unique fun _ _ ↦ by simp
@[to_additive (attr := simp)]
lemma aestabilizer_univ : aestabilizer G μ univ = ⊤ := top_unique fun _ _ ↦ by simp
@[to_additive]
lemma aestabilizer_congr (h : s =ᵐ[μ] t) : aestabilizer G μ s = aestabilizer G μ t := by
ext g
rw [mem_aestabilizer, mem_aestabilizer, h.congr_right, ((smul_set_ae_eq g).2 h).congr_left]
lemma aestabilizer_of_aeconst (hs : EventuallyConst s (ae μ)) : aestabilizer G μ s = ⊤ := by
refine top_unique fun g _ ↦ ?_
cases eventuallyConst_set'.mp hs with
| inl h => simp [aestabilizer_congr h]
| inr h => simp [aestabilizer_congr h]
end MulAction
variable {G μ}
variable {x y : G} {s : Set α}
namespace MeasureTheory
@[to_additive]
theorem smul_ae_eq_self_of_mem_zpowers (hs : (x • s : Set α) =ᵐ[μ] s)
(hy : y ∈ Subgroup.zpowers x) : (y • s : Set α) =ᵐ[μ] s := by
rw [← MulAction.mem_aestabilizer, ← Subgroup.zpowers_le] at hs
exact hs hy
@[to_additive]
theorem inv_smul_ae_eq_self (hs : (x • s : Set α) =ᵐ[μ] s) : (x⁻¹ • s : Set α) =ᵐ[μ] s :=
inv_mem (s := MulAction.aestabilizer G μ s) hs
end MeasureTheory
|
MeasureTheory\Group\Arithmetic.lean | /-
Copyright (c) 2021 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.MeasureTheory.Measure.AEMeasurable
/-!
# Typeclasses for measurability of operations
In this file we define classes `MeasurableMul` etc and prove dot-style lemmas
(`Measurable.mul`, `AEMeasurable.mul` etc). For binary operations we define two typeclasses:
- `MeasurableMul` says that both left and right multiplication are measurable;
- `MeasurableMul₂` says that `fun p : α × α => p.1 * p.2` is measurable,
and similarly for other binary operations. The reason for introducing these classes is that in case
of topological space `α` equipped with the Borel `σ`-algebra, instances for `MeasurableMul₂`
etc require `α` to have a second countable topology.
We define separate classes for `MeasurableDiv`/`MeasurableSub`
because on some types (e.g., `ℕ`, `ℝ≥0∞`) division and/or subtraction are not defined as `a * b⁻¹` /
`a + (-b)`.
For instances relating, e.g., `ContinuousMul` to `MeasurableMul` see file
`MeasureTheory.BorelSpace`.
## Implementation notes
For the heuristics of `@[to_additive]` it is important that the type with a multiplication
(or another multiplicative operations) is the first (implicit) argument of all declarations.
## Tags
measurable function, arithmetic operator
## TODO
* Uniformize the treatment of `pow` and `smul`.
* Use `@[to_additive]` to send `MeasurablePow` to `MeasurableSMul₂`.
* This might require changing the definition (swapping the arguments in the function that is
in the conclusion of `MeasurableSMul`.)
-/
open MeasureTheory
open scoped Pointwise
universe u v
variable {α : Type*}
/-!
### Binary operations: `(· + ·)`, `(· * ·)`, `(· - ·)`, `(· / ·)`
-/
/-- We say that a type has `MeasurableAdd` if `(· + c)` and `(· + c)` are measurable functions.
For a typeclass assuming measurability of `uncurry (· + ·)` see `MeasurableAdd₂`. -/
class MeasurableAdd (M : Type*) [MeasurableSpace M] [Add M] : Prop where
measurable_const_add : ∀ c : M, Measurable (c + ·)
measurable_add_const : ∀ c : M, Measurable (· + c)
export MeasurableAdd (measurable_const_add measurable_add_const)
/-- We say that a type has `MeasurableAdd₂` if `uncurry (· + ·)` is a measurable functions.
For a typeclass assuming measurability of `(c + ·)` and `(· + c)` see `MeasurableAdd`. -/
class MeasurableAdd₂ (M : Type*) [MeasurableSpace M] [Add M] : Prop where
measurable_add : Measurable fun p : M × M => p.1 + p.2
export MeasurableAdd₂ (measurable_add)
/-- We say that a type has `MeasurableMul` if `(c * ·)` and `(· * c)` are measurable functions.
For a typeclass assuming measurability of `uncurry (*)` see `MeasurableMul₂`. -/
@[to_additive]
class MeasurableMul (M : Type*) [MeasurableSpace M] [Mul M] : Prop where
measurable_const_mul : ∀ c : M, Measurable (c * ·)
measurable_mul_const : ∀ c : M, Measurable (· * c)
export MeasurableMul (measurable_const_mul measurable_mul_const)
/-- We say that a type has `MeasurableMul₂` if `uncurry (· * ·)` is a measurable functions.
For a typeclass assuming measurability of `(c * ·)` and `(· * c)` see `MeasurableMul`. -/
@[to_additive MeasurableAdd₂]
class MeasurableMul₂ (M : Type*) [MeasurableSpace M] [Mul M] : Prop where
measurable_mul : Measurable fun p : M × M => p.1 * p.2
export MeasurableMul₂ (measurable_mul)
section Mul
variable {M α : Type*} [MeasurableSpace M] [Mul M] {m : MeasurableSpace α} {f g : α → M}
{μ : Measure α}
@[to_additive (attr := fun_prop, measurability)]
theorem Measurable.const_mul [MeasurableMul M] (hf : Measurable f) (c : M) :
Measurable fun x => c * f x :=
(measurable_const_mul c).comp hf
@[to_additive (attr := measurability)]
theorem AEMeasurable.const_mul [MeasurableMul M] (hf : AEMeasurable f μ) (c : M) :
AEMeasurable (fun x => c * f x) μ :=
(MeasurableMul.measurable_const_mul c).comp_aemeasurable hf
@[to_additive (attr := measurability)]
theorem Measurable.mul_const [MeasurableMul M] (hf : Measurable f) (c : M) :
Measurable fun x => f x * c :=
(measurable_mul_const c).comp hf
@[to_additive (attr := measurability)]
theorem AEMeasurable.mul_const [MeasurableMul M] (hf : AEMeasurable f μ) (c : M) :
AEMeasurable (fun x => f x * c) μ :=
(measurable_mul_const c).comp_aemeasurable hf
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.mul' [MeasurableMul₂ M] (hf : Measurable f) (hg : Measurable g) :
Measurable (f * g) :=
measurable_mul.comp (hf.prod_mk hg)
@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.mul [MeasurableMul₂ M] (hf : Measurable f) (hg : Measurable g) :
Measurable fun a => f a * g a :=
measurable_mul.comp (hf.prod_mk hg)
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.mul' [MeasurableMul₂ M] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
AEMeasurable (f * g) μ :=
measurable_mul.comp_aemeasurable (hf.prod_mk hg)
@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.mul [MeasurableMul₂ M] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
AEMeasurable (fun a => f a * g a) μ :=
measurable_mul.comp_aemeasurable (hf.prod_mk hg)
@[to_additive]
instance (priority := 100) MeasurableMul₂.toMeasurableMul [MeasurableMul₂ M] :
MeasurableMul M :=
⟨fun _ => measurable_const.mul measurable_id, fun _ => measurable_id.mul measurable_const⟩
@[to_additive]
instance Pi.measurableMul {ι : Type*} {α : ι → Type*} [∀ i, Mul (α i)]
[∀ i, MeasurableSpace (α i)] [∀ i, MeasurableMul (α i)] : MeasurableMul (∀ i, α i) :=
⟨fun _ => measurable_pi_iff.mpr fun i => (measurable_pi_apply i).const_mul _, fun _ =>
measurable_pi_iff.mpr fun i => (measurable_pi_apply i).mul_const _⟩
@[to_additive Pi.measurableAdd₂]
instance Pi.measurableMul₂ {ι : Type*} {α : ι → Type*} [∀ i, Mul (α i)]
[∀ i, MeasurableSpace (α i)] [∀ i, MeasurableMul₂ (α i)] : MeasurableMul₂ (∀ i, α i) :=
⟨measurable_pi_iff.mpr fun _ => measurable_fst.eval.mul measurable_snd.eval⟩
end Mul
/-- A version of `measurable_div_const` that assumes `MeasurableMul` instead of
`MeasurableDiv`. This can be nice to avoid unnecessary type-class assumptions. -/
@[to_additive " A version of `measurable_sub_const` that assumes `MeasurableAdd` instead of
`MeasurableSub`. This can be nice to avoid unnecessary type-class assumptions. "]
theorem measurable_div_const' {G : Type*} [DivInvMonoid G] [MeasurableSpace G] [MeasurableMul G]
(g : G) : Measurable fun h => h / g := by simp_rw [div_eq_mul_inv, measurable_mul_const]
/-- This class assumes that the map `β × γ → β` given by `(x, y) ↦ x ^ y` is measurable. -/
class MeasurablePow (β γ : Type*) [MeasurableSpace β] [MeasurableSpace γ] [Pow β γ] : Prop where
measurable_pow : Measurable fun p : β × γ => p.1 ^ p.2
export MeasurablePow (measurable_pow)
/-- `Monoid.Pow` is measurable. -/
instance Monoid.measurablePow (M : Type*) [Monoid M] [MeasurableSpace M] [MeasurableMul₂ M] :
MeasurablePow M ℕ :=
⟨measurable_from_prod_countable fun n => by
induction' n with n ih
· simp only [Nat.zero_eq, pow_zero, ← Pi.one_def, measurable_one]
· simp only [pow_succ]
exact ih.mul measurable_id⟩
section Pow
variable {β γ α : Type*} [MeasurableSpace β] [MeasurableSpace γ] [Pow β γ] [MeasurablePow β γ]
{m : MeasurableSpace α} {μ : Measure α} {f : α → β} {g : α → γ}
@[aesop safe 20 apply (rule_sets := [Measurable])]
theorem Measurable.pow (hf : Measurable f) (hg : Measurable g) : Measurable fun x => f x ^ g x :=
measurable_pow.comp (hf.prod_mk hg)
@[aesop safe 20 apply (rule_sets := [Measurable])]
theorem AEMeasurable.pow (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
AEMeasurable (fun x => f x ^ g x) μ :=
measurable_pow.comp_aemeasurable (hf.prod_mk hg)
@[fun_prop, measurability]
theorem Measurable.pow_const (hf : Measurable f) (c : γ) : Measurable fun x => f x ^ c :=
hf.pow measurable_const
@[fun_prop, measurability]
theorem AEMeasurable.pow_const (hf : AEMeasurable f μ) (c : γ) :
AEMeasurable (fun x => f x ^ c) μ :=
hf.pow aemeasurable_const
@[measurability]
theorem Measurable.const_pow (hg : Measurable g) (c : β) : Measurable fun x => c ^ g x :=
measurable_const.pow hg
@[measurability]
theorem AEMeasurable.const_pow (hg : AEMeasurable g μ) (c : β) :
AEMeasurable (fun x => c ^ g x) μ :=
aemeasurable_const.pow hg
end Pow
/-- We say that a type has `MeasurableSub` if `(c - ·)` and `(· - c)` are measurable
functions. For a typeclass assuming measurability of `uncurry (-)` see `MeasurableSub₂`. -/
class MeasurableSub (G : Type*) [MeasurableSpace G] [Sub G] : Prop where
measurable_const_sub : ∀ c : G, Measurable (c - ·)
measurable_sub_const : ∀ c : G, Measurable (· - c)
export MeasurableSub (measurable_const_sub measurable_sub_const)
/-- We say that a type has `MeasurableSub₂` if `uncurry (· - ·)` is a measurable functions.
For a typeclass assuming measurability of `(c - ·)` and `(· - c)` see `MeasurableSub`. -/
class MeasurableSub₂ (G : Type*) [MeasurableSpace G] [Sub G] : Prop where
measurable_sub : Measurable fun p : G × G => p.1 - p.2
export MeasurableSub₂ (measurable_sub)
/-- We say that a type has `MeasurableDiv` if `(c / ·)` and `(· / c)` are measurable functions.
For a typeclass assuming measurability of `uncurry (· / ·)` see `MeasurableDiv₂`. -/
@[to_additive]
class MeasurableDiv (G₀ : Type*) [MeasurableSpace G₀] [Div G₀] : Prop where
measurable_const_div : ∀ c : G₀, Measurable (c / ·)
measurable_div_const : ∀ c : G₀, Measurable (· / c)
export MeasurableDiv (measurable_const_div measurable_div_const)
/-- We say that a type has `MeasurableDiv₂` if `uncurry (· / ·)` is a measurable functions.
For a typeclass assuming measurability of `(c / ·)` and `(· / c)` see `MeasurableDiv`. -/
@[to_additive MeasurableSub₂]
class MeasurableDiv₂ (G₀ : Type*) [MeasurableSpace G₀] [Div G₀] : Prop where
measurable_div : Measurable fun p : G₀ × G₀ => p.1 / p.2
export MeasurableDiv₂ (measurable_div)
section Div
variable {G α : Type*} [MeasurableSpace G] [Div G] {m : MeasurableSpace α} {f g : α → G}
{μ : Measure α}
@[to_additive (attr := measurability)]
theorem Measurable.const_div [MeasurableDiv G] (hf : Measurable f) (c : G) :
Measurable fun x => c / f x :=
(MeasurableDiv.measurable_const_div c).comp hf
@[to_additive (attr := measurability)]
theorem AEMeasurable.const_div [MeasurableDiv G] (hf : AEMeasurable f μ) (c : G) :
AEMeasurable (fun x => c / f x) μ :=
(MeasurableDiv.measurable_const_div c).comp_aemeasurable hf
@[to_additive (attr := measurability)]
theorem Measurable.div_const [MeasurableDiv G] (hf : Measurable f) (c : G) :
Measurable fun x => f x / c :=
(MeasurableDiv.measurable_div_const c).comp hf
@[to_additive (attr := measurability)]
theorem AEMeasurable.div_const [MeasurableDiv G] (hf : AEMeasurable f μ) (c : G) :
AEMeasurable (fun x => f x / c) μ :=
(MeasurableDiv.measurable_div_const c).comp_aemeasurable hf
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.div' [MeasurableDiv₂ G] (hf : Measurable f) (hg : Measurable g) :
Measurable (f / g) :=
measurable_div.comp (hf.prod_mk hg)
@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.div [MeasurableDiv₂ G] (hf : Measurable f) (hg : Measurable g) :
Measurable fun a => f a / g a :=
measurable_div.comp (hf.prod_mk hg)
@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.div' [MeasurableDiv₂ G] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
AEMeasurable (f / g) μ :=
measurable_div.comp_aemeasurable (hf.prod_mk hg)
@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.div [MeasurableDiv₂ G] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
AEMeasurable (fun a => f a / g a) μ :=
measurable_div.comp_aemeasurable (hf.prod_mk hg)
@[to_additive]
instance (priority := 100) MeasurableDiv₂.toMeasurableDiv [MeasurableDiv₂ G] :
MeasurableDiv G :=
⟨fun _ => measurable_const.div measurable_id, fun _ => measurable_id.div measurable_const⟩
@[to_additive]
instance Pi.measurableDiv {ι : Type*} {α : ι → Type*} [∀ i, Div (α i)]
[∀ i, MeasurableSpace (α i)] [∀ i, MeasurableDiv (α i)] : MeasurableDiv (∀ i, α i) :=
⟨fun _ => measurable_pi_iff.mpr fun i => (measurable_pi_apply i).const_div _, fun _ =>
measurable_pi_iff.mpr fun i => (measurable_pi_apply i).div_const _⟩
@[to_additive Pi.measurableSub₂]
instance Pi.measurableDiv₂ {ι : Type*} {α : ι → Type*} [∀ i, Div (α i)]
[∀ i, MeasurableSpace (α i)] [∀ i, MeasurableDiv₂ (α i)] : MeasurableDiv₂ (∀ i, α i) :=
⟨measurable_pi_iff.mpr fun _ => measurable_fst.eval.div measurable_snd.eval⟩
@[measurability]
theorem measurableSet_eq_fun {m : MeasurableSpace α} {E} [MeasurableSpace E] [AddGroup E]
[MeasurableSingletonClass E] [MeasurableSub₂ E] {f g : α → E} (hf : Measurable f)
(hg : Measurable g) : MeasurableSet { x | f x = g x } := by
suffices h_set_eq : { x : α | f x = g x } = { x | (f - g) x = (0 : E) } by
rw [h_set_eq]
exact (hf.sub hg) measurableSet_eq
ext
simp_rw [Set.mem_setOf_eq, Pi.sub_apply, sub_eq_zero]
@[measurability]
lemma measurableSet_eq_fun' {β : Type*} [CanonicallyOrderedAddCommMonoid β] [Sub β] [OrderedSub β]
{_ : MeasurableSpace β} [MeasurableSub₂ β] [MeasurableSingletonClass β]
{f g : α → β} (hf : Measurable f) (hg : Measurable g) :
MeasurableSet {x | f x = g x} := by
have : {a | f a = g a} = {a | (f - g) a = 0} ∩ {a | (g - f) a = 0} := by
ext
simp only [Set.mem_setOf_eq, Pi.sub_apply, tsub_eq_zero_iff_le, Set.mem_inter_iff]
exact ⟨fun h ↦ ⟨h.le, h.symm.le⟩, fun h ↦ le_antisymm h.1 h.2⟩
rw [this]
exact ((hf.sub hg) (measurableSet_singleton 0)).inter ((hg.sub hf) (measurableSet_singleton 0))
theorem nullMeasurableSet_eq_fun {E} [MeasurableSpace E] [AddGroup E] [MeasurableSingletonClass E]
[MeasurableSub₂ E] {f g : α → E} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
NullMeasurableSet { x | f x = g x } μ := by
apply (measurableSet_eq_fun hf.measurable_mk hg.measurable_mk).nullMeasurableSet.congr
filter_upwards [hf.ae_eq_mk, hg.ae_eq_mk] with x hfx hgx
change (hf.mk f x = hg.mk g x) = (f x = g x)
simp only [hfx, hgx]
theorem measurableSet_eq_fun_of_countable {m : MeasurableSpace α} {E} [MeasurableSpace E]
[MeasurableSingletonClass E] [Countable E] {f g : α → E} (hf : Measurable f)
(hg : Measurable g) : MeasurableSet { x | f x = g x } := by
have : { x | f x = g x } = ⋃ j, { x | f x = j } ∩ { x | g x = j } := by
ext1 x
simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_inter_iff, exists_eq_right']
rw [this]
refine MeasurableSet.iUnion fun j => MeasurableSet.inter ?_ ?_
· exact hf (measurableSet_singleton j)
· exact hg (measurableSet_singleton j)
theorem ae_eq_trim_of_measurable {α E} {m m0 : MeasurableSpace α} {μ : Measure α}
[MeasurableSpace E] [AddGroup E] [MeasurableSingletonClass E] [MeasurableSub₂ E]
(hm : m ≤ m0) {f g : α → E} (hf : Measurable[m] f) (hg : Measurable[m] g) (hfg : f =ᵐ[μ] g) :
f =ᵐ[μ.trim hm] g := by
rwa [Filter.EventuallyEq, ae_iff, trim_measurableSet_eq hm _]
exact @MeasurableSet.compl α _ m (@measurableSet_eq_fun α m E _ _ _ _ _ _ hf hg)
end Div
/-- We say that a type has `MeasurableNeg` if `x ↦ -x` is a measurable function. -/
class MeasurableNeg (G : Type*) [Neg G] [MeasurableSpace G] : Prop where
measurable_neg : Measurable (Neg.neg : G → G)
/-- We say that a type has `MeasurableInv` if `x ↦ x⁻¹` is a measurable function. -/
@[to_additive]
class MeasurableInv (G : Type*) [Inv G] [MeasurableSpace G] : Prop where
measurable_inv : Measurable (Inv.inv : G → G)
export MeasurableInv (measurable_inv)
export MeasurableNeg (measurable_neg)
@[to_additive]
instance (priority := 100) measurableDiv_of_mul_inv (G : Type*) [MeasurableSpace G]
[DivInvMonoid G] [MeasurableMul G] [MeasurableInv G] : MeasurableDiv G where
measurable_const_div c := by
convert measurable_inv.const_mul c using 1
ext1
apply div_eq_mul_inv
measurable_div_const c := by
convert measurable_id.mul_const c⁻¹ using 1
ext1
apply div_eq_mul_inv
section Inv
variable {G α : Type*} [Inv G] [MeasurableSpace G] [MeasurableInv G] {m : MeasurableSpace α}
{f : α → G} {μ : Measure α}
@[to_additive (attr := fun_prop, measurability)]
theorem Measurable.inv (hf : Measurable f) : Measurable fun x => (f x)⁻¹ :=
measurable_inv.comp hf
@[to_additive (attr := fun_prop, measurability)]
theorem AEMeasurable.inv (hf : AEMeasurable f μ) : AEMeasurable (fun x => (f x)⁻¹) μ :=
measurable_inv.comp_aemeasurable hf
@[to_additive (attr := simp)]
theorem measurable_inv_iff {G : Type*} [Group G] [MeasurableSpace G] [MeasurableInv G]
{f : α → G} : (Measurable fun x => (f x)⁻¹) ↔ Measurable f :=
⟨fun h => by simpa only [inv_inv] using h.inv, fun h => h.inv⟩
@[to_additive (attr := simp)]
theorem aemeasurable_inv_iff {G : Type*} [Group G] [MeasurableSpace G] [MeasurableInv G]
{f : α → G} : AEMeasurable (fun x => (f x)⁻¹) μ ↔ AEMeasurable f μ :=
⟨fun h => by simpa only [inv_inv] using h.inv, fun h => h.inv⟩
@[simp]
theorem measurable_inv_iff₀ {G₀ : Type*} [GroupWithZero G₀] [MeasurableSpace G₀]
[MeasurableInv G₀] {f : α → G₀} : (Measurable fun x => (f x)⁻¹) ↔ Measurable f :=
⟨fun h => by simpa only [inv_inv] using h.inv, fun h => h.inv⟩
@[simp]
theorem aemeasurable_inv_iff₀ {G₀ : Type*} [GroupWithZero G₀] [MeasurableSpace G₀]
[MeasurableInv G₀] {f : α → G₀} : AEMeasurable (fun x => (f x)⁻¹) μ ↔ AEMeasurable f μ :=
⟨fun h => by simpa only [inv_inv] using h.inv, fun h => h.inv⟩
@[to_additive]
instance Pi.measurableInv {ι : Type*} {α : ι → Type*} [∀ i, Inv (α i)]
[∀ i, MeasurableSpace (α i)] [∀ i, MeasurableInv (α i)] : MeasurableInv (∀ i, α i) :=
⟨measurable_pi_iff.mpr fun i => (measurable_pi_apply i).inv⟩
@[to_additive]
theorem MeasurableSet.inv {s : Set G} (hs : MeasurableSet s) : MeasurableSet s⁻¹ :=
measurable_inv hs
@[to_additive]
theorem measurableEmbedding_inv [InvolutiveInv α] [MeasurableInv α] :
MeasurableEmbedding (Inv.inv (α := α)) :=
⟨inv_injective, measurable_inv, fun s hs ↦ s.image_inv ▸ hs.inv⟩
end Inv
@[to_additive]
theorem Measurable.mul_iff_right {G : Type*} [MeasurableSpace G] [MeasurableSpace α] [CommGroup G]
[MeasurableMul₂ G] [MeasurableInv G] {f g : α → G} (hf : Measurable f) :
Measurable (f * g) ↔ Measurable g :=
⟨fun h ↦ show g = f * g * f⁻¹ by simp only [mul_inv_cancel_comm] ▸ h.mul hf.inv,
fun h ↦ hf.mul h⟩
@[to_additive]
theorem AEMeasurable.mul_iff_right {G : Type*} [MeasurableSpace G] [MeasurableSpace α] [CommGroup G]
[MeasurableMul₂ G] [MeasurableInv G] {μ : Measure α} {f g : α → G} (hf : AEMeasurable f μ) :
AEMeasurable (f * g) μ ↔ AEMeasurable g μ :=
⟨fun h ↦ show g = f * g * f⁻¹ by simp only [mul_inv_cancel_comm] ▸ h.mul hf.inv,
fun h ↦ hf.mul h⟩
@[to_additive]
theorem Measurable.mul_iff_left {G : Type*} [MeasurableSpace G] [MeasurableSpace α] [CommGroup G]
[MeasurableMul₂ G] [MeasurableInv G] {f g : α → G} (hf : Measurable f) :
Measurable (g * f) ↔ Measurable g :=
mul_comm g f ▸ Measurable.mul_iff_right hf
@[to_additive]
theorem AEMeasurable.mul_iff_left {G : Type*} [MeasurableSpace G] [MeasurableSpace α] [CommGroup G]
[MeasurableMul₂ G] [MeasurableInv G] {μ : Measure α} {f g : α → G} (hf : AEMeasurable f μ) :
AEMeasurable (g * f) μ ↔ AEMeasurable g μ :=
mul_comm g f ▸ AEMeasurable.mul_iff_right hf
/-- `DivInvMonoid.Pow` is measurable. -/
instance DivInvMonoid.measurableZPow (G : Type u) [DivInvMonoid G] [MeasurableSpace G]
[MeasurableMul₂ G] [MeasurableInv G] : MeasurablePow G ℤ :=
⟨measurable_from_prod_countable fun n => by
cases' n with n n
· simp_rw [Int.ofNat_eq_coe, zpow_natCast]
exact measurable_id.pow_const _
· simp_rw [zpow_negSucc]
exact (measurable_id.pow_const (n + 1)).inv⟩
@[to_additive]
instance (priority := 100) measurableDiv₂_of_mul_inv (G : Type*) [MeasurableSpace G]
[DivInvMonoid G] [MeasurableMul₂ G] [MeasurableInv G] : MeasurableDiv₂ G :=
⟨by
simp only [div_eq_mul_inv]
exact measurable_fst.mul measurable_snd.inv⟩
-- See note [lower instance priority]
instance (priority := 100) MeasurableDiv.toMeasurableInv [MeasurableSpace α] [Group α]
[MeasurableDiv α] : MeasurableInv α where
measurable_inv := by simpa using measurable_const_div (1 : α)
/-- We say that the action of `M` on `α` has `MeasurableVAdd` if for each `c` the map `x ↦ c +ᵥ x`
is a measurable function and for each `x` the map `c ↦ c +ᵥ x` is a measurable function. -/
class MeasurableVAdd (M α : Type*) [VAdd M α] [MeasurableSpace M] [MeasurableSpace α] :
Prop where
measurable_const_vadd : ∀ c : M, Measurable (c +ᵥ · : α → α)
measurable_vadd_const : ∀ x : α, Measurable (· +ᵥ x : M → α)
/-- We say that the action of `M` on `α` has `MeasurableSMul` if for each `c` the map `x ↦ c • x`
is a measurable function and for each `x` the map `c ↦ c • x` is a measurable function. -/
@[to_additive]
class MeasurableSMul (M α : Type*) [SMul M α] [MeasurableSpace M] [MeasurableSpace α] :
Prop where
measurable_const_smul : ∀ c : M, Measurable (c • · : α → α)
measurable_smul_const : ∀ x : α, Measurable (· • x : M → α)
/-- We say that the action of `M` on `α` has `MeasurableVAdd₂` if the map
`(c, x) ↦ c +ᵥ x` is a measurable function. -/
class MeasurableVAdd₂ (M α : Type*) [VAdd M α] [MeasurableSpace M] [MeasurableSpace α] :
Prop where
measurable_vadd : Measurable (Function.uncurry (· +ᵥ ·) : M × α → α)
/-- We say that the action of `M` on `α` has `Measurable_SMul₂` if the map
`(c, x) ↦ c • x` is a measurable function. -/
@[to_additive MeasurableVAdd₂]
class MeasurableSMul₂ (M α : Type*) [SMul M α] [MeasurableSpace M] [MeasurableSpace α] :
Prop where
measurable_smul : Measurable (Function.uncurry (· • ·) : M × α → α)
export MeasurableSMul (measurable_const_smul measurable_smul_const)
export MeasurableSMul₂ (measurable_smul)
export MeasurableVAdd (measurable_const_vadd measurable_vadd_const)
export MeasurableVAdd₂ (measurable_vadd)
@[to_additive]
instance measurableSMul_of_mul (M : Type*) [Mul M] [MeasurableSpace M] [MeasurableMul M] :
MeasurableSMul M M :=
⟨measurable_id.const_mul, measurable_id.mul_const⟩
@[to_additive]
instance measurableSMul₂_of_mul (M : Type*) [Mul M] [MeasurableSpace M] [MeasurableMul₂ M] :
MeasurableSMul₂ M M :=
⟨measurable_mul⟩
@[to_additive]
instance Submonoid.measurableSMul {M α} [MeasurableSpace M] [MeasurableSpace α] [Monoid M]
[MulAction M α] [MeasurableSMul M α] (s : Submonoid M) : MeasurableSMul s α :=
⟨fun c => by simpa only using measurable_const_smul (c : M), fun x =>
(measurable_smul_const x : Measurable fun c : M => c • x).comp measurable_subtype_coe⟩
@[to_additive]
instance Subgroup.measurableSMul {G α} [MeasurableSpace G] [MeasurableSpace α] [Group G]
[MulAction G α] [MeasurableSMul G α] (s : Subgroup G) : MeasurableSMul s α :=
s.toSubmonoid.measurableSMul
section SMul
variable {M β α : Type*} [MeasurableSpace M] [MeasurableSpace β] [_root_.SMul M β]
{m : MeasurableSpace α} {f : α → M} {g : α → β}
@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.smul [MeasurableSMul₂ M β] (hf : Measurable f) (hg : Measurable g) :
Measurable fun x => f x • g x :=
measurable_smul.comp (hf.prod_mk hg)
@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.smul [MeasurableSMul₂ M β] {μ : Measure α} (hf : AEMeasurable f μ)
(hg : AEMeasurable g μ) : AEMeasurable (fun x => f x • g x) μ :=
MeasurableSMul₂.measurable_smul.comp_aemeasurable (hf.prod_mk hg)
@[to_additive]
instance (priority := 100) MeasurableSMul₂.toMeasurableSMul [MeasurableSMul₂ M β] :
MeasurableSMul M β :=
⟨fun _ => measurable_const.smul measurable_id, fun _ => measurable_id.smul measurable_const⟩
variable [MeasurableSMul M β] {μ : Measure α}
@[to_additive (attr := measurability)]
theorem Measurable.smul_const (hf : Measurable f) (y : β) : Measurable fun x => f x • y :=
(MeasurableSMul.measurable_smul_const y).comp hf
@[to_additive (attr := measurability)]
theorem AEMeasurable.smul_const (hf : AEMeasurable f μ) (y : β) :
AEMeasurable (fun x => f x • y) μ :=
(MeasurableSMul.measurable_smul_const y).comp_aemeasurable hf
@[to_additive (attr := measurability)]
theorem Measurable.const_smul' (hg : Measurable g) (c : M) : Measurable fun x => c • g x :=
(MeasurableSMul.measurable_const_smul c).comp hg
@[to_additive (attr := measurability)]
theorem Measurable.const_smul (hg : Measurable g) (c : M) : Measurable (c • g) :=
hg.const_smul' c
@[to_additive (attr := measurability)]
theorem AEMeasurable.const_smul' (hg : AEMeasurable g μ) (c : M) :
AEMeasurable (fun x => c • g x) μ :=
(MeasurableSMul.measurable_const_smul c).comp_aemeasurable hg
@[to_additive (attr := measurability)]
theorem AEMeasurable.const_smul (hf : AEMeasurable g μ) (c : M) : AEMeasurable (c • g) μ :=
hf.const_smul' c
@[to_additive]
instance Pi.measurableSMul {ι : Type*} {α : ι → Type*} [∀ i, SMul M (α i)]
[∀ i, MeasurableSpace (α i)] [∀ i, MeasurableSMul M (α i)] :
MeasurableSMul M (∀ i, α i) :=
⟨fun _ => measurable_pi_iff.mpr fun i => (measurable_pi_apply i).const_smul _, fun _ =>
measurable_pi_iff.mpr fun _ => measurable_smul_const _⟩
/-- `AddMonoid.SMul` is measurable. -/
instance AddMonoid.measurableSMul_nat₂ (M : Type*) [AddMonoid M] [MeasurableSpace M]
[MeasurableAdd₂ M] : MeasurableSMul₂ ℕ M :=
⟨by
suffices Measurable fun p : M × ℕ => p.2 • p.1 by apply this.comp measurable_swap
refine measurable_from_prod_countable fun n => ?_
induction' n with n ih
· simp only [Nat.zero_eq, zero_smul, ← Pi.zero_def, measurable_zero]
· simp only [succ_nsmul]
exact ih.add measurable_id⟩
/-- `SubNegMonoid.SMulInt` is measurable. -/
instance SubNegMonoid.measurableSMul_int₂ (M : Type*) [SubNegMonoid M] [MeasurableSpace M]
[MeasurableAdd₂ M] [MeasurableNeg M] : MeasurableSMul₂ ℤ M :=
⟨by
suffices Measurable fun p : M × ℤ => p.2 • p.1 by apply this.comp measurable_swap
refine measurable_from_prod_countable fun n => ?_
induction' n with n n ih
· simp only [Int.ofNat_eq_coe, natCast_zsmul]
exact measurable_const_smul _
· simp only [negSucc_zsmul]
exact (measurable_const_smul _).neg⟩
end SMul
section MulAction
variable {M β α : Type*} [MeasurableSpace M] [MeasurableSpace β] [Monoid M] [MulAction M β]
[MeasurableSMul M β] [MeasurableSpace α] {f : α → β} {μ : Measure α}
variable {G : Type*} [Group G] [MeasurableSpace G] [MulAction G β] [MeasurableSMul G β]
@[to_additive]
theorem measurable_const_smul_iff (c : G) : (Measurable fun x => c • f x) ↔ Measurable f :=
⟨fun h => by simpa only [inv_smul_smul] using h.const_smul' c⁻¹, fun h => h.const_smul c⟩
@[to_additive]
theorem aemeasurable_const_smul_iff (c : G) :
AEMeasurable (fun x => c • f x) μ ↔ AEMeasurable f μ :=
⟨fun h => by simpa only [inv_smul_smul] using h.const_smul' c⁻¹, fun h => h.const_smul c⟩
@[to_additive]
instance Units.instMeasurableSpace : MeasurableSpace Mˣ := MeasurableSpace.comap ((↑) : Mˣ → M) ‹_›
@[to_additive]
instance Units.measurableSMul : MeasurableSMul Mˣ β where
measurable_const_smul c := (measurable_const_smul (c : M) : _)
measurable_smul_const x :=
(measurable_smul_const x : Measurable fun c : M => c • x).comp MeasurableSpace.le_map_comap
@[to_additive]
nonrec theorem IsUnit.measurable_const_smul_iff {c : M} (hc : IsUnit c) :
(Measurable fun x => c • f x) ↔ Measurable f :=
let ⟨u, hu⟩ := hc
hu ▸ measurable_const_smul_iff u
@[to_additive]
nonrec theorem IsUnit.aemeasurable_const_smul_iff {c : M} (hc : IsUnit c) :
AEMeasurable (fun x => c • f x) μ ↔ AEMeasurable f μ :=
let ⟨u, hu⟩ := hc
hu ▸ aemeasurable_const_smul_iff u
variable {G₀ : Type*} [GroupWithZero G₀] [MeasurableSpace G₀] [MulAction G₀ β]
[MeasurableSMul G₀ β]
theorem measurable_const_smul_iff₀ {c : G₀} (hc : c ≠ 0) :
(Measurable fun x => c • f x) ↔ Measurable f :=
(IsUnit.mk0 c hc).measurable_const_smul_iff
theorem aemeasurable_const_smul_iff₀ {c : G₀} (hc : c ≠ 0) :
AEMeasurable (fun x => c • f x) μ ↔ AEMeasurable f μ :=
(IsUnit.mk0 c hc).aemeasurable_const_smul_iff
end MulAction
/-!
### Opposite monoid
-/
section Opposite
open MulOpposite
@[to_additive]
instance MulOpposite.instMeasurableSpace {α : Type*} [h : MeasurableSpace α] :
MeasurableSpace αᵐᵒᵖ :=
MeasurableSpace.map op h
@[to_additive]
theorem measurable_mul_op {α : Type*} [MeasurableSpace α] : Measurable (op : α → αᵐᵒᵖ) := fun _ =>
id
@[to_additive]
theorem measurable_mul_unop {α : Type*} [MeasurableSpace α] : Measurable (unop : αᵐᵒᵖ → α) :=
fun _ => id
@[to_additive]
instance MulOpposite.instMeasurableMul {M : Type*} [Mul M] [MeasurableSpace M]
[MeasurableMul M] : MeasurableMul Mᵐᵒᵖ :=
⟨fun _ => measurable_mul_op.comp (measurable_mul_unop.mul_const _), fun _ =>
measurable_mul_op.comp (measurable_mul_unop.const_mul _)⟩
@[to_additive]
instance MulOpposite.instMeasurableMul₂ {M : Type*} [Mul M] [MeasurableSpace M]
[MeasurableMul₂ M] : MeasurableMul₂ Mᵐᵒᵖ :=
⟨measurable_mul_op.comp
((measurable_mul_unop.comp measurable_snd).mul (measurable_mul_unop.comp measurable_fst))⟩
/-- If a scalar is central, then its right action is measurable when its left action is. -/
nonrec instance MeasurableSMul.op {M α} [MeasurableSpace M] [MeasurableSpace α] [SMul M α]
[SMul Mᵐᵒᵖ α] [IsCentralScalar M α] [MeasurableSMul M α] : MeasurableSMul Mᵐᵒᵖ α :=
⟨MulOpposite.rec' fun c =>
show Measurable fun x => op c • x by
simpa only [op_smul_eq_smul] using measurable_const_smul c,
fun x =>
show Measurable fun c => op (unop c) • x by
simpa only [op_smul_eq_smul] using (measurable_smul_const x).comp measurable_mul_unop⟩
/-- If a scalar is central, then its right action is measurable when its left action is. -/
nonrec instance MeasurableSMul₂.op {M α} [MeasurableSpace M] [MeasurableSpace α] [SMul M α]
[SMul Mᵐᵒᵖ α] [IsCentralScalar M α] [MeasurableSMul₂ M α] : MeasurableSMul₂ Mᵐᵒᵖ α :=
⟨show Measurable fun x : Mᵐᵒᵖ × α => op (unop x.1) • x.2 by
simp_rw [op_smul_eq_smul]
exact (measurable_mul_unop.comp measurable_fst).smul measurable_snd⟩
@[to_additive]
instance measurableSMul_opposite_of_mul {M : Type*} [Mul M] [MeasurableSpace M]
[MeasurableMul M] : MeasurableSMul Mᵐᵒᵖ M :=
⟨fun c => measurable_mul_const (unop c), fun x => measurable_mul_unop.const_mul x⟩
@[to_additive]
instance measurableSMul₂_opposite_of_mul {M : Type*} [Mul M] [MeasurableSpace M]
[MeasurableMul₂ M] : MeasurableSMul₂ Mᵐᵒᵖ M :=
⟨measurable_snd.mul (measurable_mul_unop.comp measurable_fst)⟩
end Opposite
/-!
### Big operators: `∏` and `∑`
-/
section Monoid
variable {M α : Type*} [Monoid M] [MeasurableSpace M] [MeasurableMul₂ M] {m : MeasurableSpace α}
{μ : Measure α}
@[to_additive (attr := measurability)]
theorem List.measurable_prod' (l : List (α → M)) (hl : ∀ f ∈ l, Measurable f) :
Measurable l.prod := by
induction' l with f l ihl; · exact measurable_one
rw [List.forall_mem_cons] at hl
rw [List.prod_cons]
exact hl.1.mul (ihl hl.2)
@[to_additive (attr := measurability)]
theorem List.aemeasurable_prod' (l : List (α → M)) (hl : ∀ f ∈ l, AEMeasurable f μ) :
AEMeasurable l.prod μ := by
induction' l with f l ihl; · exact aemeasurable_one
rw [List.forall_mem_cons] at hl
rw [List.prod_cons]
exact hl.1.mul (ihl hl.2)
@[to_additive (attr := measurability)]
theorem List.measurable_prod (l : List (α → M)) (hl : ∀ f ∈ l, Measurable f) :
Measurable fun x => (l.map fun f : α → M => f x).prod := by
simpa only [← Pi.list_prod_apply] using l.measurable_prod' hl
@[to_additive (attr := measurability)]
theorem List.aemeasurable_prod (l : List (α → M)) (hl : ∀ f ∈ l, AEMeasurable f μ) :
AEMeasurable (fun x => (l.map fun f : α → M => f x).prod) μ := by
simpa only [← Pi.list_prod_apply] using l.aemeasurable_prod' hl
end Monoid
section CommMonoid
variable {M ι α : Type*} [CommMonoid M] [MeasurableSpace M] [MeasurableMul₂ M]
{m : MeasurableSpace α} {μ : Measure α} {f : ι → α → M}
@[to_additive (attr := measurability)]
theorem Multiset.measurable_prod' (l : Multiset (α → M)) (hl : ∀ f ∈ l, Measurable f) :
Measurable l.prod := by
rcases l with ⟨l⟩
simpa using l.measurable_prod' (by simpa using hl)
@[to_additive (attr := measurability)]
theorem Multiset.aemeasurable_prod' (l : Multiset (α → M)) (hl : ∀ f ∈ l, AEMeasurable f μ) :
AEMeasurable l.prod μ := by
rcases l with ⟨l⟩
simpa using l.aemeasurable_prod' (by simpa using hl)
@[to_additive (attr := measurability)]
theorem Multiset.measurable_prod (s : Multiset (α → M)) (hs : ∀ f ∈ s, Measurable f) :
Measurable fun x => (s.map fun f : α → M => f x).prod := by
simpa only [← Pi.multiset_prod_apply] using s.measurable_prod' hs
@[to_additive (attr := measurability)]
theorem Multiset.aemeasurable_prod (s : Multiset (α → M)) (hs : ∀ f ∈ s, AEMeasurable f μ) :
AEMeasurable (fun x => (s.map fun f : α → M => f x).prod) μ := by
simpa only [← Pi.multiset_prod_apply] using s.aemeasurable_prod' hs
@[to_additive (attr := measurability)]
theorem Finset.measurable_prod' (s : Finset ι) (hf : ∀ i ∈ s, Measurable (f i)) :
Measurable (∏ i ∈ s, f i) :=
Finset.prod_induction _ _ (fun _ _ => Measurable.mul) (@measurable_one M _ _ _ _) hf
@[to_additive (attr := measurability)]
theorem Finset.measurable_prod (s : Finset ι) (hf : ∀ i ∈ s, Measurable (f i)) :
Measurable fun a => ∏ i ∈ s, f i a := by
simpa only [← Finset.prod_apply] using s.measurable_prod' hf
@[to_additive (attr := measurability)]
theorem Finset.aemeasurable_prod' (s : Finset ι) (hf : ∀ i ∈ s, AEMeasurable (f i) μ) :
AEMeasurable (∏ i ∈ s, f i) μ :=
Multiset.aemeasurable_prod' _ fun _g hg =>
let ⟨_i, hi, hg⟩ := Multiset.mem_map.1 hg
hg ▸ hf _ hi
@[to_additive (attr := measurability)]
theorem Finset.aemeasurable_prod (s : Finset ι) (hf : ∀ i ∈ s, AEMeasurable (f i) μ) :
AEMeasurable (fun a => ∏ i ∈ s, f i a) μ := by
simpa only [← Finset.prod_apply] using s.aemeasurable_prod' hf
end CommMonoid
variable [MeasurableSpace α] [Mul α] [Div α] [Inv α]
@[to_additive] -- See note [lower instance priority]
instance (priority := 100) DiscreteMeasurableSpace.toMeasurableMul [DiscreteMeasurableSpace α] :
MeasurableMul α where
measurable_const_mul _ := measurable_discrete _
measurable_mul_const _ := measurable_discrete _
@[to_additive DiscreteMeasurableSpace.toMeasurableAdd₂] -- See note [lower instance priority]
instance (priority := 100) DiscreteMeasurableSpace.toMeasurableMul₂
[DiscreteMeasurableSpace (α × α)] : MeasurableMul₂ α := ⟨measurable_discrete _⟩
@[to_additive] -- See note [lower instance priority]
instance (priority := 100) DiscreteMeasurableSpace.toMeasurableInv [DiscreteMeasurableSpace α] :
MeasurableInv α := ⟨measurable_discrete _⟩
@[to_additive] -- See note [lower instance priority]
instance (priority := 100) DiscreteMeasurableSpace.toMeasurableDiv [DiscreteMeasurableSpace α] :
MeasurableDiv α where
measurable_const_div _ := measurable_discrete _
measurable_div_const _ := measurable_discrete _
@[to_additive DiscreteMeasurableSpace.toMeasurableSub₂] -- See note [lower instance priority]
instance (priority := 100) DiscreteMeasurableSpace.toMeasurableDiv₂
[DiscreteMeasurableSpace (α × α)] : MeasurableDiv₂ α := ⟨measurable_discrete _⟩
|
MeasureTheory\Group\Convolution.lean | /-
Copyright (c) 2023 Josha Dekker. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Josha Dekker
-/
import Mathlib.MeasureTheory.Constructions.Prod.Basic
import Mathlib.MeasureTheory.Measure.MeasureSpace
/-!
# The multiplicative and additive convolution of measures
In this file we define and prove properties about the convolutions of two measures.
## Main definitions
* `MeasureTheory.Measure.mconv`: The multiplicative convolution of two measures: the map of `*`
under the product measure.
* `MeasureTheory.Measure.conv`: The additive convolution of two measures: the map of `+`
under the product measure.
-/
namespace MeasureTheory
namespace Measure
variable {M : Type*} [Monoid M] [MeasurableSpace M]
/-- Multiplicative convolution of measures. -/
@[to_additive conv "Additive convolution of measures."]
noncomputable def mconv (μ : Measure M) (ν : Measure M) :
Measure M := Measure.map (fun x : M × M ↦ x.1 * x.2) (μ.prod ν)
/-- Scoped notation for the multiplicative convolution of measures. -/
scoped[MeasureTheory] infix:80 " ∗ " => MeasureTheory.Measure.mconv
/-- Scoped notation for the additive convolution of measures. -/
scoped[MeasureTheory] infix:80 " ∗ " => MeasureTheory.Measure.conv
/-- Convolution of the dirac measure at 1 with a measure μ returns μ. -/
@[to_additive (attr := simp)]
theorem dirac_one_mconv [MeasurableMul₂ M] (μ : Measure M) [SFinite μ] :
(Measure.dirac 1) ∗ μ = μ := by
unfold mconv
rw [MeasureTheory.Measure.dirac_prod, map_map (by fun_prop)]
· simp only [Function.comp_def, one_mul, map_id']
fun_prop
/-- Convolution of a measure μ with the dirac measure at 1 returns μ. -/
@[to_additive (attr := simp)]
theorem mconv_dirac_one [MeasurableMul₂ M]
(μ : Measure M) [SFinite μ] : μ ∗ (Measure.dirac 1) = μ := by
unfold mconv
rw [MeasureTheory.Measure.prod_dirac, map_map (by fun_prop)]
· simp only [Function.comp_def, mul_one, map_id']
fun_prop
/-- Convolution of the zero measure with a measure μ returns the zero measure. -/
@[to_additive (attr := simp) conv_zero]
theorem mconv_zero (μ : Measure M) : (0 : Measure M) ∗ μ = (0 : Measure M) := by
unfold mconv
simp
/-- Convolution of a measure μ with the zero measure returns the zero measure. -/
@[to_additive (attr := simp) zero_conv]
theorem zero_mconv (μ : Measure M) : μ ∗ (0 : Measure M) = (0 : Measure M) := by
unfold mconv
simp
@[to_additive conv_add]
theorem mconv_add [MeasurableMul₂ M] (μ : Measure M) (ν : Measure M) (ρ : Measure M) [SFinite μ]
[SFinite ν] [SFinite ρ] : μ ∗ (ν + ρ) = μ ∗ ν + μ ∗ ρ := by
unfold mconv
rw [prod_add, map_add]
fun_prop
@[to_additive add_conv]
theorem add_mconv [MeasurableMul₂ M] (μ : Measure M) (ν : Measure M) (ρ : Measure M) [SFinite μ]
[SFinite ν] [SFinite ρ] : (μ + ν) ∗ ρ = μ ∗ ρ + ν ∗ ρ := by
unfold mconv
rw [add_prod, map_add]
fun_prop
/-- To get commutativity, we need the underlying multiplication to be commutative. -/
@[to_additive conv_comm]
theorem mconv_comm {M : Type*} [CommMonoid M] [MeasurableSpace M] [MeasurableMul₂ M] (μ : Measure M)
(ν : Measure M) [SFinite μ] [SFinite ν] : μ ∗ ν = ν ∗ μ := by
unfold mconv
rw [← prod_swap, map_map (by fun_prop)]
· simp [Function.comp_def, mul_comm]
fun_prop
/-- Convolution of SFinite maps is SFinite. -/
@[to_additive sfinite_conv_of_sfinite]
instance sfinite_mconv_of_sfinite (μ : Measure M) (ν : Measure M) [SFinite μ] [SFinite ν] :
SFinite (μ ∗ ν) := inferInstanceAs <| SFinite ((μ.prod ν).map fun (x : M × M) ↦ x.1 * x.2)
@[to_additive finite_of_finite_conv]
instance finite_of_finite_mconv (μ : Measure M) (ν : Measure M) [IsFiniteMeasure μ]
[IsFiniteMeasure ν] : IsFiniteMeasure (μ ∗ ν) := by
have h : (μ ∗ ν) Set.univ < ⊤ := by
unfold mconv
exact IsFiniteMeasure.measure_univ_lt_top
exact {measure_univ_lt_top := h}
@[to_additive probabilitymeasure_of_probabilitymeasures_conv]
instance probabilitymeasure_of_probabilitymeasures_mconv (μ : Measure M) (ν : Measure M)
[MeasurableMul₂ M] [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] :
IsProbabilityMeasure (μ ∗ ν) :=
MeasureTheory.isProbabilityMeasure_map (by fun_prop)
end Measure
end MeasureTheory
|
MeasureTheory\Group\FundamentalDomain.lean | /-
Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury G. Kudryashov, Alex Kontorovich, Heather Macbeth
-/
import Mathlib.MeasureTheory.Group.Action
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.MeasureTheory.Group.Pointwise
/-!
# Fundamental domain of a group action
A set `s` is said to be a *fundamental domain* of an action of a group `G` on a measurable space `α`
with respect to a measure `μ` if
* `s` is a measurable set;
* the sets `g • s` over all `g : G` cover almost all points of the whole space;
* the sets `g • s`, are pairwise a.e. disjoint, i.e., `μ (g₁ • s ∩ g₂ • s) = 0` whenever `g₁ ≠ g₂`;
we require this for `g₂ = 1` in the definition, then deduce it for any two `g₁ ≠ g₂`.
In this file we prove that in case of a countable group `G` and a measure preserving action, any two
fundamental domains have the same measure, and for a `G`-invariant function, its integrals over any
two fundamental domains are equal to each other.
We also generate additive versions of all theorems in this file using the `to_additive` attribute.
* We define the `HasFundamentalDomain` typeclass, in particular to be able to define the `covolume`
of a quotient of `α` by a group `G`, which under reasonable conditions does not depend on the choice
of fundamental domain.
* We define the `QuotientMeasureEqMeasurePreimage` typeclass to describe a situation in which a
measure `μ` on `α ⧸ G` can be computed by taking a measure `ν` on `α` of the intersection of the
pullback with a fundamental domain.
## Main declarations
* `MeasureTheory.IsFundamentalDomain`: Predicate for a set to be a fundamental domain of the
action of a group
* `MeasureTheory.fundamentalFrontier`: Fundamental frontier of a set under the action of a group.
Elements of `s` that belong to some other translate of `s`.
* `MeasureTheory.fundamentalInterior`: Fundamental interior of a set under the action of a group.
Elements of `s` that do not belong to any other translate of `s`.
-/
open scoped ENNReal Pointwise Topology NNReal ENNReal MeasureTheory
open MeasureTheory MeasureTheory.Measure Set Function TopologicalSpace Filter
namespace MeasureTheory
/-- A measurable set `s` is a *fundamental domain* for an additive action of an additive group `G`
on a measurable space `α` with respect to a measure `α` if the sets `g +ᵥ s`, `g : G`, are pairwise
a.e. disjoint and cover the whole space. -/
structure IsAddFundamentalDomain (G : Type*) {α : Type*} [Zero G] [VAdd G α] [MeasurableSpace α]
(s : Set α) (μ : Measure α := by volume_tac) : Prop where
protected nullMeasurableSet : NullMeasurableSet s μ
protected ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g +ᵥ x ∈ s
protected aedisjoint : Pairwise <| (AEDisjoint μ on fun g : G => g +ᵥ s)
/-- A measurable set `s` is a *fundamental domain* for an action of a group `G` on a measurable
space `α` with respect to a measure `α` if the sets `g • s`, `g : G`, are pairwise a.e. disjoint and
cover the whole space. -/
@[to_additive IsAddFundamentalDomain]
structure IsFundamentalDomain (G : Type*) {α : Type*} [One G] [SMul G α] [MeasurableSpace α]
(s : Set α) (μ : Measure α := by volume_tac) : Prop where
protected nullMeasurableSet : NullMeasurableSet s μ
protected ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g • x ∈ s
protected aedisjoint : Pairwise <| (AEDisjoint μ on fun g : G => g • s)
variable {G H α β E : Type*}
namespace IsFundamentalDomain
variable [Group G] [Group H] [MulAction G α] [MeasurableSpace α] [MulAction H β] [MeasurableSpace β]
[NormedAddCommGroup E] {s t : Set α} {μ : Measure α}
/-- If for each `x : α`, exactly one of `g • x`, `g : G`, belongs to a measurable set `s`, then `s`
is a fundamental domain for the action of `G` on `α`. -/
@[to_additive "If for each `x : α`, exactly one of `g +ᵥ x`, `g : G`, belongs to a measurable set
`s`, then `s` is a fundamental domain for the additive action of `G` on `α`."]
theorem mk' (h_meas : NullMeasurableSet s μ) (h_exists : ∀ x : α, ∃! g : G, g • x ∈ s) :
IsFundamentalDomain G s μ where
nullMeasurableSet := h_meas
ae_covers := eventually_of_forall fun x => (h_exists x).exists
aedisjoint a b hab := Disjoint.aedisjoint <| disjoint_left.2 fun x hxa hxb => by
rw [mem_smul_set_iff_inv_smul_mem] at hxa hxb
exact hab (inv_injective <| (h_exists x).unique hxa hxb)
/-- For `s` to be a fundamental domain, it's enough to check
`MeasureTheory.AEDisjoint (g • s) s` for `g ≠ 1`. -/
@[to_additive "For `s` to be a fundamental domain, it's enough to check
`MeasureTheory.AEDisjoint (g +ᵥ s) s` for `g ≠ 0`."]
theorem mk'' (h_meas : NullMeasurableSet s μ) (h_ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g • x ∈ s)
(h_ae_disjoint : ∀ g, g ≠ (1 : G) → AEDisjoint μ (g • s) s)
(h_qmp : ∀ g : G, QuasiMeasurePreserving ((g • ·) : α → α) μ μ) :
IsFundamentalDomain G s μ where
nullMeasurableSet := h_meas
ae_covers := h_ae_covers
aedisjoint := pairwise_aedisjoint_of_aedisjoint_forall_ne_one h_ae_disjoint h_qmp
/-- If a measurable space has a finite measure `μ` and a countable group `G` acts
quasi-measure-preservingly, then to show that a set `s` is a fundamental domain, it is sufficient
to check that its translates `g • s` are (almost) disjoint and that the sum `∑' g, μ (g • s)` is
sufficiently large. -/
@[to_additive
"If a measurable space has a finite measure `μ` and a countable additive group `G` acts
quasi-measure-preservingly, then to show that a set `s` is a fundamental domain, it is sufficient
to check that its translates `g +ᵥ s` are (almost) disjoint and that the sum `∑' g, μ (g +ᵥ s)` is
sufficiently large."]
theorem mk_of_measure_univ_le [IsFiniteMeasure μ] [Countable G] (h_meas : NullMeasurableSet s μ)
(h_ae_disjoint : ∀ g ≠ (1 : G), AEDisjoint μ (g • s) s)
(h_qmp : ∀ g : G, QuasiMeasurePreserving (g • · : α → α) μ μ)
(h_measure_univ_le : μ (univ : Set α) ≤ ∑' g : G, μ (g • s)) : IsFundamentalDomain G s μ :=
have aedisjoint : Pairwise (AEDisjoint μ on fun g : G => g • s) :=
pairwise_aedisjoint_of_aedisjoint_forall_ne_one h_ae_disjoint h_qmp
{ nullMeasurableSet := h_meas
aedisjoint
ae_covers := by
replace h_meas : ∀ g : G, NullMeasurableSet (g • s) μ := fun g => by
rw [← inv_inv g, ← preimage_smul]; exact h_meas.preimage (h_qmp g⁻¹)
have h_meas' : NullMeasurableSet {a | ∃ g : G, g • a ∈ s} μ := by
rw [← iUnion_smul_eq_setOf_exists]; exact .iUnion h_meas
rw [ae_iff_measure_eq h_meas', ← iUnion_smul_eq_setOf_exists]
refine le_antisymm (measure_mono <| subset_univ _) ?_
rw [measure_iUnion₀ aedisjoint h_meas]
exact h_measure_univ_le }
@[to_additive]
theorem iUnion_smul_ae_eq (h : IsFundamentalDomain G s μ) : ⋃ g : G, g • s =ᵐ[μ] univ :=
eventuallyEq_univ.2 <| h.ae_covers.mono fun _ ⟨g, hg⟩ =>
mem_iUnion.2 ⟨g⁻¹, _, hg, inv_smul_smul _ _⟩
@[to_additive]
theorem measure_ne_zero [Countable G] [SMulInvariantMeasure G α μ]
(hμ : μ ≠ 0) (h : IsFundamentalDomain G s μ) : μ s ≠ 0 := by
have hc := measure_univ_pos.mpr hμ
contrapose! hc
rw [← measure_congr h.iUnion_smul_ae_eq]
refine le_trans (measure_iUnion_le _) ?_
simp_rw [measure_smul, hc, tsum_zero, le_refl]
@[to_additive]
theorem mono (h : IsFundamentalDomain G s μ) {ν : Measure α} (hle : ν ≪ μ) :
IsFundamentalDomain G s ν :=
⟨h.1.mono_ac hle, hle h.2, h.aedisjoint.mono fun _ _ h => hle h⟩
@[to_additive]
theorem preimage_of_equiv {ν : Measure β} (h : IsFundamentalDomain G s μ) {f : β → α}
(hf : QuasiMeasurePreserving f ν μ) {e : G → H} (he : Bijective e)
(hef : ∀ g, Semiconj f (e g • ·) (g • ·)) : IsFundamentalDomain H (f ⁻¹' s) ν where
nullMeasurableSet := h.nullMeasurableSet.preimage hf
ae_covers := (hf.ae h.ae_covers).mono fun x ⟨g, hg⟩ => ⟨e g, by rwa [mem_preimage, hef g x]⟩
aedisjoint a b hab := by
lift e to G ≃ H using he
have : (e.symm a⁻¹)⁻¹ ≠ (e.symm b⁻¹)⁻¹ := by simp [hab]
have := (h.aedisjoint this).preimage hf
simp only [Semiconj] at hef
simpa only [onFun, ← preimage_smul_inv, preimage_preimage, ← hef, e.apply_symm_apply, inv_inv]
using this
@[to_additive]
theorem image_of_equiv {ν : Measure β} (h : IsFundamentalDomain G s μ) (f : α ≃ β)
(hf : QuasiMeasurePreserving f.symm ν μ) (e : H ≃ G)
(hef : ∀ g, Semiconj f (e g • ·) (g • ·)) : IsFundamentalDomain H (f '' s) ν := by
rw [f.image_eq_preimage]
refine h.preimage_of_equiv hf e.symm.bijective fun g x => ?_
rcases f.surjective x with ⟨x, rfl⟩
rw [← hef _ _, f.symm_apply_apply, f.symm_apply_apply, e.apply_symm_apply]
@[to_additive]
theorem pairwise_aedisjoint_of_ac {ν} (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) :
Pairwise fun g₁ g₂ : G => AEDisjoint ν (g₁ • s) (g₂ • s) :=
h.aedisjoint.mono fun _ _ H => hν H
@[to_additive]
theorem smul_of_comm {G' : Type*} [Group G'] [MulAction G' α] [MeasurableSpace G']
[MeasurableSMul G' α] [SMulInvariantMeasure G' α μ] [SMulCommClass G' G α]
(h : IsFundamentalDomain G s μ) (g : G') : IsFundamentalDomain G (g • s) μ :=
h.image_of_equiv (MulAction.toPerm g) (measurePreserving_smul _ _).quasiMeasurePreserving
(Equiv.refl _) <| smul_comm g
variable [MeasurableSpace G] [MeasurableSMul G α] [SMulInvariantMeasure G α μ]
@[to_additive]
theorem nullMeasurableSet_smul (h : IsFundamentalDomain G s μ) (g : G) :
NullMeasurableSet (g • s) μ :=
h.nullMeasurableSet.smul g
@[to_additive]
theorem restrict_restrict (h : IsFundamentalDomain G s μ) (g : G) (t : Set α) :
(μ.restrict t).restrict (g • s) = μ.restrict (g • s ∩ t) :=
restrict_restrict₀ ((h.nullMeasurableSet_smul g).mono restrict_le_self)
@[to_additive]
theorem smul (h : IsFundamentalDomain G s μ) (g : G) : IsFundamentalDomain G (g • s) μ :=
h.image_of_equiv (MulAction.toPerm g) (measurePreserving_smul _ _).quasiMeasurePreserving
⟨fun g' => g⁻¹ * g' * g, fun g' => g * g' * g⁻¹, fun g' => by simp [mul_assoc], fun g' => by
simp [mul_assoc]⟩
fun g' x => by simp [smul_smul, mul_assoc]
variable [Countable G] {ν : Measure α}
@[to_additive]
theorem sum_restrict_of_ac (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) :
(sum fun g : G => ν.restrict (g • s)) = ν := by
rw [← restrict_iUnion_ae (h.aedisjoint.mono fun i j h => hν h) fun g =>
(h.nullMeasurableSet_smul g).mono_ac hν,
restrict_congr_set (hν h.iUnion_smul_ae_eq), restrict_univ]
@[to_additive]
theorem lintegral_eq_tsum_of_ac (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) (f : α → ℝ≥0∞) :
∫⁻ x, f x ∂ν = ∑' g : G, ∫⁻ x in g • s, f x ∂ν := by
rw [← lintegral_sum_measure, h.sum_restrict_of_ac hν]
@[to_additive]
theorem sum_restrict (h : IsFundamentalDomain G s μ) : (sum fun g : G => μ.restrict (g • s)) = μ :=
h.sum_restrict_of_ac (refl _)
@[to_additive]
theorem lintegral_eq_tsum (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) :
∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in g • s, f x ∂μ :=
h.lintegral_eq_tsum_of_ac (refl _) f
@[to_additive]
theorem lintegral_eq_tsum' (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) :
∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in s, f (g⁻¹ • x) ∂μ :=
calc
∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in g • s, f x ∂μ := h.lintegral_eq_tsum f
_ = ∑' g : G, ∫⁻ x in g⁻¹ • s, f x ∂μ := ((Equiv.inv G).tsum_eq _).symm
_ = ∑' g : G, ∫⁻ x in s, f (g⁻¹ • x) ∂μ := tsum_congr fun g => Eq.symm <|
(measurePreserving_smul g⁻¹ μ).setLIntegral_comp_emb (measurableEmbedding_const_smul _) _ _
@[to_additive] lemma lintegral_eq_tsum'' (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) :
∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in s, f (g • x) ∂μ :=
(lintegral_eq_tsum' h f).trans ((Equiv.inv G).tsum_eq (fun g ↦ ∫⁻ (x : α) in s, f (g • x) ∂μ))
@[to_additive]
theorem setLIntegral_eq_tsum (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) (t : Set α) :
∫⁻ x in t, f x ∂μ = ∑' g : G, ∫⁻ x in t ∩ g • s, f x ∂μ :=
calc
∫⁻ x in t, f x ∂μ = ∑' g : G, ∫⁻ x in g • s, f x ∂μ.restrict t :=
h.lintegral_eq_tsum_of_ac restrict_le_self.absolutelyContinuous _
_ = ∑' g : G, ∫⁻ x in t ∩ g • s, f x ∂μ := by simp only [h.restrict_restrict, inter_comm]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_eq_tsum := setLIntegral_eq_tsum
@[to_additive]
theorem setLIntegral_eq_tsum' (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) (t : Set α) :
∫⁻ x in t, f x ∂μ = ∑' g : G, ∫⁻ x in g • t ∩ s, f (g⁻¹ • x) ∂μ :=
calc
∫⁻ x in t, f x ∂μ = ∑' g : G, ∫⁻ x in t ∩ g • s, f x ∂μ := h.setLIntegral_eq_tsum f t
_ = ∑' g : G, ∫⁻ x in t ∩ g⁻¹ • s, f x ∂μ := ((Equiv.inv G).tsum_eq _).symm
_ = ∑' g : G, ∫⁻ x in g⁻¹ • (g • t ∩ s), f x ∂μ := by simp only [smul_set_inter, inv_smul_smul]
_ = ∑' g : G, ∫⁻ x in g • t ∩ s, f (g⁻¹ • x) ∂μ := tsum_congr fun g => Eq.symm <|
(measurePreserving_smul g⁻¹ μ).setLIntegral_comp_emb (measurableEmbedding_const_smul _) _ _
@[deprecated (since := "2024-06-29")]
alias set_lintegral_eq_tsum' := setLIntegral_eq_tsum'
@[to_additive]
theorem measure_eq_tsum_of_ac (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) (t : Set α) :
ν t = ∑' g : G, ν (t ∩ g • s) := by
have H : ν.restrict t ≪ μ := Measure.restrict_le_self.absolutelyContinuous.trans hν
simpa only [setLIntegral_one, Pi.one_def,
Measure.restrict_apply₀ ((h.nullMeasurableSet_smul _).mono_ac H), inter_comm] using
h.lintegral_eq_tsum_of_ac H 1
@[to_additive]
theorem measure_eq_tsum' (h : IsFundamentalDomain G s μ) (t : Set α) :
μ t = ∑' g : G, μ (t ∩ g • s) :=
h.measure_eq_tsum_of_ac AbsolutelyContinuous.rfl t
@[to_additive]
theorem measure_eq_tsum (h : IsFundamentalDomain G s μ) (t : Set α) :
μ t = ∑' g : G, μ (g • t ∩ s) := by
simpa only [setLIntegral_one] using h.setLIntegral_eq_tsum' (fun _ => 1) t
@[to_additive]
theorem measure_zero_of_invariant (h : IsFundamentalDomain G s μ) (t : Set α)
(ht : ∀ g : G, g • t = t) (hts : μ (t ∩ s) = 0) : μ t = 0 := by
rw [measure_eq_tsum h]; simp [ht, hts]
/-- Given a measure space with an action of a finite group `G`, the measure of any `G`-invariant set
is determined by the measure of its intersection with a fundamental domain for the action of `G`. -/
@[to_additive measure_eq_card_smul_of_vadd_ae_eq_self "Given a measure space with an action of a
finite additive group `G`, the measure of any `G`-invariant set is determined by the measure of
its intersection with a fundamental domain for the action of `G`."]
theorem measure_eq_card_smul_of_smul_ae_eq_self [Finite G] (h : IsFundamentalDomain G s μ)
(t : Set α) (ht : ∀ g : G, (g • t : Set α) =ᵐ[μ] t) : μ t = Nat.card G • μ (t ∩ s) := by
haveI : Fintype G := Fintype.ofFinite G
rw [h.measure_eq_tsum]
replace ht : ∀ g : G, (g • t ∩ s : Set α) =ᵐ[μ] (t ∩ s : Set α) := fun g =>
ae_eq_set_inter (ht g) (ae_eq_refl s)
simp_rw [measure_congr (ht _), tsum_fintype, Finset.sum_const, Nat.card_eq_fintype_card,
Finset.card_univ]
@[to_additive]
protected theorem setLIntegral_eq (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ)
(f : α → ℝ≥0∞) (hf : ∀ (g : G) (x), f (g • x) = f x) :
∫⁻ x in s, f x ∂μ = ∫⁻ x in t, f x ∂μ :=
calc
∫⁻ x in s, f x ∂μ = ∑' g : G, ∫⁻ x in s ∩ g • t, f x ∂μ := ht.setLIntegral_eq_tsum _ _
_ = ∑' g : G, ∫⁻ x in g • t ∩ s, f (g⁻¹ • x) ∂μ := by simp only [hf, inter_comm]
_ = ∫⁻ x in t, f x ∂μ := (hs.setLIntegral_eq_tsum' _ _).symm
@[deprecated (since := "2024-06-29")]
alias set_lintegral_eq := MeasureTheory.IsFundamentalDomain.setLIntegral_eq
@[to_additive]
theorem measure_set_eq (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ) {A : Set α}
(hA₀ : MeasurableSet A) (hA : ∀ g : G, (fun x => g • x) ⁻¹' A = A) : μ (A ∩ s) = μ (A ∩ t) := by
have : ∫⁻ x in s, A.indicator 1 x ∂μ = ∫⁻ x in t, A.indicator 1 x ∂μ := by
refine hs.setLIntegral_eq ht (Set.indicator A fun _ => 1) fun g x ↦ ?_
convert (Set.indicator_comp_right (g • · : α → α) (g := fun _ ↦ (1 : ℝ≥0∞))).symm
rw [hA g]
simpa [Measure.restrict_apply hA₀, lintegral_indicator _ hA₀] using this
/-- If `s` and `t` are two fundamental domains of the same action, then their measures are equal. -/
@[to_additive "If `s` and `t` are two fundamental domains of the same action, then their measures
are equal."]
protected theorem measure_eq (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ) :
μ s = μ t := by
simpa only [setLIntegral_one] using hs.setLIntegral_eq ht (fun _ => 1) fun _ _ => rfl
@[to_additive]
protected theorem aEStronglyMeasurable_on_iff {β : Type*} [TopologicalSpace β]
[PseudoMetrizableSpace β] (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ)
{f : α → β} (hf : ∀ (g : G) (x), f (g • x) = f x) :
AEStronglyMeasurable f (μ.restrict s) ↔ AEStronglyMeasurable f (μ.restrict t) :=
calc
AEStronglyMeasurable f (μ.restrict s) ↔
AEStronglyMeasurable f (Measure.sum fun g : G => μ.restrict (g • t ∩ s)) := by
simp only [← ht.restrict_restrict,
ht.sum_restrict_of_ac restrict_le_self.absolutelyContinuous]
_ ↔ ∀ g : G, AEStronglyMeasurable f (μ.restrict (g • (g⁻¹ • s ∩ t))) := by
simp only [smul_set_inter, inter_comm, smul_inv_smul, aestronglyMeasurable_sum_measure_iff]
_ ↔ ∀ g : G, AEStronglyMeasurable f (μ.restrict (g⁻¹ • (g⁻¹⁻¹ • s ∩ t))) :=
inv_surjective.forall
_ ↔ ∀ g : G, AEStronglyMeasurable f (μ.restrict (g⁻¹ • (g • s ∩ t))) := by simp only [inv_inv]
_ ↔ ∀ g : G, AEStronglyMeasurable f (μ.restrict (g • s ∩ t)) := by
refine forall_congr' fun g => ?_
have he : MeasurableEmbedding (g⁻¹ • · : α → α) := measurableEmbedding_const_smul _
rw [← image_smul, ← ((measurePreserving_smul g⁻¹ μ).restrict_image_emb he
_).aestronglyMeasurable_comp_iff he]
simp only [(· ∘ ·), hf]
_ ↔ AEStronglyMeasurable f (μ.restrict t) := by
simp only [← aestronglyMeasurable_sum_measure_iff, ← hs.restrict_restrict,
hs.sum_restrict_of_ac restrict_le_self.absolutelyContinuous]
@[to_additive]
protected theorem hasFiniteIntegral_on_iff (hs : IsFundamentalDomain G s μ)
(ht : IsFundamentalDomain G t μ) {f : α → E} (hf : ∀ (g : G) (x), f (g • x) = f x) :
HasFiniteIntegral f (μ.restrict s) ↔ HasFiniteIntegral f (μ.restrict t) := by
dsimp only [HasFiniteIntegral]
rw [hs.setLIntegral_eq ht]
intro g x; rw [hf]
@[to_additive]
protected theorem integrableOn_iff (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ)
{f : α → E} (hf : ∀ (g : G) (x), f (g • x) = f x) : IntegrableOn f s μ ↔ IntegrableOn f t μ :=
and_congr (hs.aEStronglyMeasurable_on_iff ht hf) (hs.hasFiniteIntegral_on_iff ht hf)
variable [NormedSpace ℝ E] [CompleteSpace E]
@[to_additive]
theorem integral_eq_tsum_of_ac (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) (f : α → E)
(hf : Integrable f ν) : ∫ x, f x ∂ν = ∑' g : G, ∫ x in g • s, f x ∂ν := by
rw [← MeasureTheory.integral_sum_measure, h.sum_restrict_of_ac hν]
rw [h.sum_restrict_of_ac hν]
exact hf
@[to_additive]
theorem integral_eq_tsum (h : IsFundamentalDomain G s μ) (f : α → E) (hf : Integrable f μ) :
∫ x, f x ∂μ = ∑' g : G, ∫ x in g • s, f x ∂μ :=
integral_eq_tsum_of_ac h (by rfl) f hf
@[to_additive]
theorem integral_eq_tsum' (h : IsFundamentalDomain G s μ) (f : α → E) (hf : Integrable f μ) :
∫ x, f x ∂μ = ∑' g : G, ∫ x in s, f (g⁻¹ • x) ∂μ :=
calc
∫ x, f x ∂μ = ∑' g : G, ∫ x in g • s, f x ∂μ := h.integral_eq_tsum f hf
_ = ∑' g : G, ∫ x in g⁻¹ • s, f x ∂μ := ((Equiv.inv G).tsum_eq _).symm
_ = ∑' g : G, ∫ x in s, f (g⁻¹ • x) ∂μ := tsum_congr fun g =>
(measurePreserving_smul g⁻¹ μ).setIntegral_image_emb (measurableEmbedding_const_smul _) _ _
@[to_additive] lemma integral_eq_tsum'' (h : IsFundamentalDomain G s μ)
(f : α → E) (hf : Integrable f μ) : ∫ x, f x ∂μ = ∑' g : G, ∫ x in s, f (g • x) ∂μ :=
(integral_eq_tsum' h f hf).trans ((Equiv.inv G).tsum_eq (fun g ↦ ∫ (x : α) in s, f (g • x) ∂μ))
@[to_additive]
theorem setIntegral_eq_tsum (h : IsFundamentalDomain G s μ) {f : α → E} {t : Set α}
(hf : IntegrableOn f t μ) : ∫ x in t, f x ∂μ = ∑' g : G, ∫ x in t ∩ g • s, f x ∂μ :=
calc
∫ x in t, f x ∂μ = ∑' g : G, ∫ x in g • s, f x ∂μ.restrict t :=
h.integral_eq_tsum_of_ac restrict_le_self.absolutelyContinuous f hf
_ = ∑' g : G, ∫ x in t ∩ g • s, f x ∂μ := by
simp only [h.restrict_restrict, measure_smul, inter_comm]
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_tsum := setIntegral_eq_tsum
@[to_additive]
theorem setIntegral_eq_tsum' (h : IsFundamentalDomain G s μ) {f : α → E} {t : Set α}
(hf : IntegrableOn f t μ) : ∫ x in t, f x ∂μ = ∑' g : G, ∫ x in g • t ∩ s, f (g⁻¹ • x) ∂μ :=
calc
∫ x in t, f x ∂μ = ∑' g : G, ∫ x in t ∩ g • s, f x ∂μ := h.setIntegral_eq_tsum hf
_ = ∑' g : G, ∫ x in t ∩ g⁻¹ • s, f x ∂μ := ((Equiv.inv G).tsum_eq _).symm
_ = ∑' g : G, ∫ x in g⁻¹ • (g • t ∩ s), f x ∂μ := by simp only [smul_set_inter, inv_smul_smul]
_ = ∑' g : G, ∫ x in g • t ∩ s, f (g⁻¹ • x) ∂μ :=
tsum_congr fun g =>
(measurePreserving_smul g⁻¹ μ).setIntegral_image_emb (measurableEmbedding_const_smul _) _ _
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_tsum' := setIntegral_eq_tsum'
@[to_additive]
protected theorem setIntegral_eq (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ)
{f : α → E} (hf : ∀ (g : G) (x), f (g • x) = f x) : ∫ x in s, f x ∂μ = ∫ x in t, f x ∂μ := by
by_cases hfs : IntegrableOn f s μ
· have hft : IntegrableOn f t μ := by rwa [ht.integrableOn_iff hs hf]
calc
∫ x in s, f x ∂μ = ∑' g : G, ∫ x in s ∩ g • t, f x ∂μ := ht.setIntegral_eq_tsum hfs
_ = ∑' g : G, ∫ x in g • t ∩ s, f (g⁻¹ • x) ∂μ := by simp only [hf, inter_comm]
_ = ∫ x in t, f x ∂μ := (hs.setIntegral_eq_tsum' hft).symm
· rw [integral_undef hfs, integral_undef]
rwa [hs.integrableOn_iff ht hf] at hfs
@[deprecated (since := "2024-04-17")]
alias set_integral_eq := MeasureTheory.IsFundamentalDomain.setIntegral_eq
/-- If the action of a countable group `G` admits an invariant measure `μ` with a fundamental domain
`s`, then every null-measurable set `t` such that the sets `g • t ∩ s` are pairwise a.e.-disjoint
has measure at most `μ s`. -/
@[to_additive "If the additive action of a countable group `G` admits an invariant measure `μ` with
a fundamental domain `s`, then every null-measurable set `t` such that the sets `g +ᵥ t ∩ s` are
pairwise a.e.-disjoint has measure at most `μ s`."]
theorem measure_le_of_pairwise_disjoint (hs : IsFundamentalDomain G s μ)
(ht : NullMeasurableSet t μ) (hd : Pairwise (AEDisjoint μ on fun g : G => g • t ∩ s)) :
μ t ≤ μ s :=
calc
μ t = ∑' g : G, μ (g • t ∩ s) := hs.measure_eq_tsum t
_ = μ (⋃ g : G, g • t ∩ s) := Eq.symm <| measure_iUnion₀ hd fun _ =>
(ht.smul _).inter hs.nullMeasurableSet
_ ≤ μ s := measure_mono (iUnion_subset fun _ => inter_subset_right)
/-- If the action of a countable group `G` admits an invariant measure `μ` with a fundamental domain
`s`, then every null-measurable set `t` of measure strictly greater than `μ s` contains two
points `x y` such that `g • x = y` for some `g ≠ 1`. -/
@[to_additive "If the additive action of a countable group `G` admits an invariant measure `μ` with
a fundamental domain `s`, then every null-measurable set `t` of measure strictly greater than
`μ s` contains two points `x y` such that `g +ᵥ x = y` for some `g ≠ 0`."]
theorem exists_ne_one_smul_eq (hs : IsFundamentalDomain G s μ) (htm : NullMeasurableSet t μ)
(ht : μ s < μ t) : ∃ x ∈ t, ∃ y ∈ t, ∃ g, g ≠ (1 : G) ∧ g • x = y := by
contrapose! ht
refine hs.measure_le_of_pairwise_disjoint htm (Pairwise.aedisjoint fun g₁ g₂ hne => ?_)
dsimp [Function.onFun]
refine (Disjoint.inf_left _ ?_).inf_right _
rw [Set.disjoint_left]
rintro _ ⟨x, hx, rfl⟩ ⟨y, hy, hxy : g₂ • y = g₁ • x⟩
refine ht x hx y hy (g₂⁻¹ * g₁) (mt inv_mul_eq_one.1 hne.symm) ?_
rw [mul_smul, ← hxy, inv_smul_smul]
/-- If `f` is invariant under the action of a countable group `G`, and `μ` is a `G`-invariant
measure with a fundamental domain `s`, then the `essSup` of `f` restricted to `s` is the same as
that of `f` on all of its domain. -/
@[to_additive "If `f` is invariant under the action of a countable additive group `G`, and `μ` is a
`G`-invariant measure with a fundamental domain `s`, then the `essSup` of `f` restricted to `s`
is the same as that of `f` on all of its domain."]
theorem essSup_measure_restrict (hs : IsFundamentalDomain G s μ) {f : α → ℝ≥0∞}
(hf : ∀ γ : G, ∀ x : α, f (γ • x) = f x) : essSup f (μ.restrict s) = essSup f μ := by
refine le_antisymm (essSup_mono_measure' Measure.restrict_le_self) ?_
rw [essSup_eq_sInf (μ.restrict s) f, essSup_eq_sInf μ f]
refine sInf_le_sInf ?_
rintro a (ha : (μ.restrict s) {x : α | a < f x} = 0)
rw [Measure.restrict_apply₀' hs.nullMeasurableSet] at ha
refine measure_zero_of_invariant hs _ ?_ ha
intro γ
ext x
rw [mem_smul_set_iff_inv_smul_mem]
simp only [mem_setOf_eq, hf γ⁻¹ x]
end IsFundamentalDomain
/-! ### Interior/frontier of a fundamental domain -/
section MeasurableSpace
variable (G) [Group G] [MulAction G α] (s : Set α) {x : α}
/-- The boundary of a fundamental domain, those points of the domain that also lie in a nontrivial
translate. -/
@[to_additive MeasureTheory.addFundamentalFrontier "The boundary of a fundamental domain, those
points of the domain that also lie in a nontrivial translate."]
def fundamentalFrontier : Set α :=
s ∩ ⋃ (g : G) (_ : g ≠ 1), g • s
/-- The interior of a fundamental domain, those points of the domain not lying in any translate. -/
@[to_additive MeasureTheory.addFundamentalInterior "The interior of a fundamental domain, those
points of the domain not lying in any translate."]
def fundamentalInterior : Set α :=
s \ ⋃ (g : G) (_ : g ≠ 1), g • s
variable {G s}
@[to_additive (attr := simp) MeasureTheory.mem_addFundamentalFrontier]
theorem mem_fundamentalFrontier :
x ∈ fundamentalFrontier G s ↔ x ∈ s ∧ ∃ g : G, g ≠ 1 ∧ x ∈ g • s := by
simp [fundamentalFrontier]
@[to_additive (attr := simp) MeasureTheory.mem_addFundamentalInterior]
theorem mem_fundamentalInterior :
x ∈ fundamentalInterior G s ↔ x ∈ s ∧ ∀ g : G, g ≠ 1 → x ∉ g • s := by
simp [fundamentalInterior]
@[to_additive MeasureTheory.addFundamentalFrontier_subset]
theorem fundamentalFrontier_subset : fundamentalFrontier G s ⊆ s :=
inter_subset_left
@[to_additive MeasureTheory.addFundamentalInterior_subset]
theorem fundamentalInterior_subset : fundamentalInterior G s ⊆ s :=
diff_subset
variable (G s)
@[to_additive MeasureTheory.disjoint_addFundamentalInterior_addFundamentalFrontier]
theorem disjoint_fundamentalInterior_fundamentalFrontier :
Disjoint (fundamentalInterior G s) (fundamentalFrontier G s) :=
disjoint_sdiff_self_left.mono_right inf_le_right
@[to_additive (attr := simp) MeasureTheory.addFundamentalInterior_union_addFundamentalFrontier]
theorem fundamentalInterior_union_fundamentalFrontier :
fundamentalInterior G s ∪ fundamentalFrontier G s = s :=
diff_union_inter _ _
@[to_additive (attr := simp) MeasureTheory.addFundamentalFrontier_union_addFundamentalInterior]
theorem fundamentalFrontier_union_fundamentalInterior :
fundamentalFrontier G s ∪ fundamentalInterior G s = s :=
inter_union_diff _ _
-- Porting note: there is a typo in `to_additive` in mathlib3, so there is no additive version
@[to_additive (attr := simp) MeasureTheory.sdiff_addFundamentalInterior]
theorem sdiff_fundamentalInterior : s \ fundamentalInterior G s = fundamentalFrontier G s :=
sdiff_sdiff_right_self
@[to_additive (attr := simp) MeasureTheory.sdiff_addFundamentalFrontier]
theorem sdiff_fundamentalFrontier : s \ fundamentalFrontier G s = fundamentalInterior G s :=
diff_self_inter
@[to_additive (attr := simp) MeasureTheory.addFundamentalFrontier_vadd]
theorem fundamentalFrontier_smul [Group H] [MulAction H α] [SMulCommClass H G α] (g : H) :
fundamentalFrontier G (g • s) = g • fundamentalFrontier G s := by
simp_rw [fundamentalFrontier, smul_set_inter, smul_set_iUnion, smul_comm g (_ : G) (_ : Set α)]
@[to_additive (attr := simp) MeasureTheory.addFundamentalInterior_vadd]
theorem fundamentalInterior_smul [Group H] [MulAction H α] [SMulCommClass H G α] (g : H) :
fundamentalInterior G (g • s) = g • fundamentalInterior G s := by
simp_rw [fundamentalInterior, smul_set_sdiff, smul_set_iUnion, smul_comm g (_ : G) (_ : Set α)]
@[to_additive MeasureTheory.pairwise_disjoint_addFundamentalInterior]
theorem pairwise_disjoint_fundamentalInterior :
Pairwise (Disjoint on fun g : G => g • fundamentalInterior G s) := by
refine fun a b hab => disjoint_left.2 ?_
rintro _ ⟨x, hx, rfl⟩ ⟨y, hy, hxy⟩
rw [mem_fundamentalInterior] at hx hy
refine hx.2 (a⁻¹ * b) ?_ ?_
· rwa [Ne, inv_mul_eq_iff_eq_mul, mul_one, eq_comm]
· simpa [mul_smul, ← hxy, mem_inv_smul_set_iff] using hy.1
variable [Countable G] [MeasurableSpace G] [MeasurableSpace α] [MeasurableSMul G α] {μ : Measure α}
[SMulInvariantMeasure G α μ]
@[to_additive MeasureTheory.NullMeasurableSet.addFundamentalFrontier]
protected theorem NullMeasurableSet.fundamentalFrontier (hs : NullMeasurableSet s μ) :
NullMeasurableSet (fundamentalFrontier G s) μ :=
hs.inter <| .iUnion fun _ => .iUnion fun _ => hs.smul _
@[to_additive MeasureTheory.NullMeasurableSet.addFundamentalInterior]
protected theorem NullMeasurableSet.fundamentalInterior (hs : NullMeasurableSet s μ) :
NullMeasurableSet (fundamentalInterior G s) μ :=
hs.diff <| .iUnion fun _ => .iUnion fun _ => hs.smul _
end MeasurableSpace
namespace IsFundamentalDomain
section Group
variable [Countable G] [Group G] [MulAction G α] [MeasurableSpace α] {μ : Measure α} {s : Set α}
(hs : IsFundamentalDomain G s μ)
@[to_additive MeasureTheory.IsAddFundamentalDomain.measure_addFundamentalFrontier]
theorem measure_fundamentalFrontier : μ (fundamentalFrontier G s) = 0 := by
simpa only [fundamentalFrontier, iUnion₂_inter, one_smul, measure_iUnion_null_iff, inter_comm s,
Function.onFun] using fun g (hg : g ≠ 1) => hs.aedisjoint hg
@[to_additive MeasureTheory.IsAddFundamentalDomain.measure_addFundamentalInterior]
theorem measure_fundamentalInterior : μ (fundamentalInterior G s) = μ s :=
measure_diff_null' hs.measure_fundamentalFrontier
end Group
variable [Countable G] [Group G] [MulAction G α] [MeasurableSpace α] {μ : Measure α} {s : Set α}
(hs : IsFundamentalDomain G s μ) [MeasurableSpace G] [MeasurableSMul G α]
[SMulInvariantMeasure G α μ]
protected theorem fundamentalInterior : IsFundamentalDomain G (fundamentalInterior G s) μ where
nullMeasurableSet := hs.nullMeasurableSet.fundamentalInterior _ _
ae_covers := by
simp_rw [ae_iff, not_exists, ← mem_inv_smul_set_iff, setOf_forall, ← compl_setOf,
setOf_mem_eq, ← compl_iUnion]
have :
((⋃ g : G, g⁻¹ • s) \ ⋃ g : G, g⁻¹ • fundamentalFrontier G s) ⊆
⋃ g : G, g⁻¹ • fundamentalInterior G s := by
simp_rw [diff_subset_iff, ← iUnion_union_distrib, ← smul_set_union (α := G) (β := α),
fundamentalFrontier_union_fundamentalInterior]; rfl
refine eq_bot_mono (μ.mono <| compl_subset_compl.2 this) ?_
simp only [iUnion_inv_smul, compl_sdiff, ENNReal.bot_eq_zero, himp_eq, sup_eq_union,
@iUnion_smul_eq_setOf_exists _ _ _ _ s]
exact measure_union_null
(measure_iUnion_null fun _ => measure_smul_null hs.measure_fundamentalFrontier _) hs.ae_covers
aedisjoint := (pairwise_disjoint_fundamentalInterior _ _).mono fun _ _ => Disjoint.aedisjoint
end IsFundamentalDomain
section FundamentalDomainMeasure
variable (G) [Group G] [MulAction G α] [MeasurableSpace α]
(μ : Measure α)
local notation "α_mod_G" => MulAction.orbitRel G α
local notation "π" => @Quotient.mk _ α_mod_G
variable {G}
@[to_additive addMeasure_map_restrict_apply]
lemma measure_map_restrict_apply (s : Set α) {U : Set (Quotient α_mod_G)}
(meas_U : MeasurableSet U) :
(μ.restrict s).map π U = μ ((π ⁻¹' U) ∩ s) := by
rw [map_apply (f := π) (fun V hV ↦ measurableSet_quotient.mp hV) meas_U,
Measure.restrict_apply (t := (Quotient.mk α_mod_G ⁻¹' U)) (measurableSet_quotient.mp meas_U)]
@[to_additive]
lemma IsFundamentalDomain.quotientMeasure_eq [Countable G] [MeasurableSpace G] {s t : Set α}
[SMulInvariantMeasure G α μ] [MeasurableSMul G α] (fund_dom_s : IsFundamentalDomain G s μ)
(fund_dom_t : IsFundamentalDomain G t μ) :
(μ.restrict s).map π = (μ.restrict t).map π := by
ext U meas_U
rw [measure_map_restrict_apply (meas_U := meas_U), measure_map_restrict_apply (meas_U := meas_U)]
apply MeasureTheory.IsFundamentalDomain.measure_set_eq fund_dom_s fund_dom_t
· exact measurableSet_quotient.mp meas_U
· intro g
ext x
have : Quotient.mk α_mod_G (g • x) = Quotient.mk α_mod_G x := by
apply Quotient.sound
use g
simp only [mem_preimage, this]
end FundamentalDomainMeasure
/-! ## `HasFundamentalDomain` typeclass
We define `HasFundamentalDomain` in order to be able to define the `covolume` of a quotient of `α`
by a group `G`, which under reasonable conditions does not depend on the choice of fundamental
domain. Even though any "sensible" action should have a fundamental domain, this is a rather
delicate question which was recently addressed by Misha Kapovich: https://arxiv.org/abs/2301.05325
TODO: Formalize the existence of a Dirichlet domain as in Kapovich's paper.
-/
section HasFundamentalDomain
/-- We say a quotient of `α` by `G` `HasAddFundamentalDomain` if there is a measurable set
`s` for which `IsAddFundamentalDomain G s` holds. -/
class HasAddFundamentalDomain (G α : Type*) [Zero G] [VAdd G α] [MeasurableSpace α]
(ν : Measure α := by volume_tac) : Prop where
ExistsIsAddFundamentalDomain : ∃ s : Set α, IsAddFundamentalDomain G s ν
/-- We say a quotient of `α` by `G` `HasFundamentalDomain` if there is a measurable set `s` for
which `IsFundamentalDomain G s` holds. -/
class HasFundamentalDomain (G : Type*) (α : Type*) [One G] [SMul G α] [MeasurableSpace α]
(ν : Measure α := by volume_tac) : Prop where
ExistsIsFundamentalDomain : ∃ (s : Set α), IsFundamentalDomain G s ν
attribute [to_additive existing] MeasureTheory.HasFundamentalDomain
open Classical in
/-- The `covolume` of an action of `G` on `α` the volume of some fundamental domain, or `0` if
none exists. -/
@[to_additive addCovolume "The `addCovolume` of an action of `G` on `α` is the volume of some
fundamental domain, or `0` if none exists."]
noncomputable def covolume (G α : Type*) [One G] [SMul G α] [MeasurableSpace α]
(ν : Measure α := by volume_tac) : ℝ≥0∞ :=
if funDom : HasFundamentalDomain G α ν then ν funDom.ExistsIsFundamentalDomain.choose else 0
variable [Group G] [MulAction G α] [MeasurableSpace G] [MeasurableSpace α]
/-- If there is a fundamental domain `s`, then `HasFundamentalDomain` holds. -/
@[to_additive]
lemma IsFundamentalDomain.hasFundamentalDomain (ν : Measure α) {s : Set α}
(fund_dom_s : IsFundamentalDomain G s ν) :
HasFundamentalDomain G α ν := ⟨⟨s, fund_dom_s⟩⟩
/-- The `covolume` can be computed by taking the `volume` of any given fundamental domain `s`. -/
@[to_additive]
lemma IsFundamentalDomain.covolume_eq_volume (ν : Measure α) [Countable G]
[MeasurableSMul G α] [SMulInvariantMeasure G α ν] {s : Set α}
(fund_dom_s : IsFundamentalDomain G s ν) : covolume G α ν = ν s := by
dsimp [covolume]
simp only [(fund_dom_s.hasFundamentalDomain ν), ↓reduceDIte]
rw [fund_dom_s.measure_eq]
exact (fund_dom_s.hasFundamentalDomain ν).ExistsIsFundamentalDomain.choose_spec
end HasFundamentalDomain
/-! ## `QuotientMeasureEqMeasurePreimage` typeclass
This typeclass describes a situation in which a measure `μ` on `α ⧸ G` can be computed by
taking a measure `ν` on `α` of the intersection of the pullback with a fundamental domain.
It's curious that in measure theory, measures can be pushed forward, while in geometry, volumes can
be pulled back. And yet here, we are describing a situation involving measures in a geometric way.
Another viewpoint is that if a set is small enough to fit in a single fundamental domain, then its
`ν` measure in `α` is the same as the `μ` measure of its pushforward in `α ⧸ G`.
-/
section QuotientMeasureEqMeasurePreimage
section additive
variable [AddGroup G] [AddAction G α] [MeasurableSpace α]
local notation "α_mod_G" => AddAction.orbitRel G α
local notation "π" => @Quotient.mk _ α_mod_G
/-- A measure `μ` on the `AddQuotient` of `α` mod `G` satisfies
`AddQuotientMeasureEqMeasurePreimage` if: for any fundamental domain `t`, and any measurable
subset `U` of the quotient, `μ U = volume ((π ⁻¹' U) ∩ t)`. -/
class AddQuotientMeasureEqMeasurePreimage (ν : Measure α := by volume_tac)
(μ : Measure (Quotient α_mod_G)) : Prop where
addProjection_respects_measure' : ∀ (t : Set α) (_ : IsAddFundamentalDomain G t ν),
μ = (ν.restrict t).map π
end additive
variable [Group G] [MulAction G α] [MeasurableSpace α]
local notation "α_mod_G" => MulAction.orbitRel G α
local notation "π" => @Quotient.mk _ α_mod_G
/-- Measures `ν` on `α` and `μ` on the `Quotient` of `α` mod `G` satisfy
`QuotientMeasureEqMeasurePreimage` if: for any fundamental domain `t`, and any measurable subset
`U` of the quotient, `μ U = ν ((π ⁻¹' U) ∩ t)`. -/
class QuotientMeasureEqMeasurePreimage (ν : Measure α := by volume_tac)
(μ : Measure (Quotient α_mod_G)) : Prop where
projection_respects_measure' (t : Set α) : IsFundamentalDomain G t ν → μ = (ν.restrict t).map π
attribute [to_additive]
MeasureTheory.QuotientMeasureEqMeasurePreimage
@[to_additive addProjection_respects_measure]
lemma IsFundamentalDomain.projection_respects_measure {ν : Measure α}
(μ : Measure (Quotient α_mod_G)) [i : QuotientMeasureEqMeasurePreimage ν μ] {t : Set α}
(fund_dom_t : IsFundamentalDomain G t ν) : μ = (ν.restrict t).map π :=
i.projection_respects_measure' t fund_dom_t
@[to_additive addProjection_respects_measure_apply]
lemma IsFundamentalDomain.projection_respects_measure_apply {ν : Measure α}
(μ : Measure (Quotient α_mod_G)) [i : QuotientMeasureEqMeasurePreimage ν μ] {t : Set α}
(fund_dom_t : IsFundamentalDomain G t ν) {U : Set (Quotient α_mod_G)}
(meas_U : MeasurableSet U) : μ U = ν (π ⁻¹' U ∩ t) := by
rw [fund_dom_t.projection_respects_measure (μ := μ), measure_map_restrict_apply ν t meas_U]
variable {ν : Measure α} [Countable G] [MeasurableSpace G]
[SMulInvariantMeasure G α ν] [MeasurableSMul G α]
/-- Given a measure upstairs (i.e., on `α`), and a choice `s` of fundamental domain, there's always
an artificial way to generate a measure downstairs such that the pair satisfies the
`QuotientMeasureEqMeasurePreimage` typeclass. -/
@[to_additive]
lemma IsFundamentalDomain.quotientMeasureEqMeasurePreimage_quotientMeasure
{s : Set α} (fund_dom_s : IsFundamentalDomain G s ν) :
QuotientMeasureEqMeasurePreimage ν ((ν.restrict s).map π) where
projection_respects_measure' t fund_dom_t := by rw [fund_dom_s.quotientMeasure_eq _ fund_dom_t]
/-- One can prove `QuotientMeasureEqMeasurePreimage` by checking behavior with respect to a single
fundamental domain. -/
@[to_additive]
lemma IsFundamentalDomain.quotientMeasureEqMeasurePreimage {μ : Measure (Quotient α_mod_G)}
{s : Set α} (fund_dom_s : IsFundamentalDomain G s ν) (h : μ = (ν.restrict s).map π) :
QuotientMeasureEqMeasurePreimage ν μ := by
simpa [h] using fund_dom_s.quotientMeasureEqMeasurePreimage_quotientMeasure
/-- Any two measures satisfying `QuotientMeasureEqMeasurePreimage` are equal. -/
@[to_additive]
lemma QuotientMeasureEqMeasurePreimage.unique
[hasFun : HasFundamentalDomain G α ν] (μ μ' : Measure (Quotient α_mod_G))
[QuotientMeasureEqMeasurePreimage ν μ] [QuotientMeasureEqMeasurePreimage ν μ'] :
μ = μ' := by
obtain ⟨𝓕, h𝓕⟩ := hasFun.ExistsIsFundamentalDomain
rw [h𝓕.projection_respects_measure (μ := μ), h𝓕.projection_respects_measure (μ := μ')]
/-- The quotient map to `α ⧸ G` is measure-preserving between the restriction of `volume` to a
fundamental domain in `α` and a related measure satisfying `QuotientMeasureEqMeasurePreimage`. -/
@[to_additive IsAddFundamentalDomain.measurePreserving_add_quotient_mk]
theorem IsFundamentalDomain.measurePreserving_quotient_mk
{𝓕 : Set α} (h𝓕 : IsFundamentalDomain G 𝓕 ν)
(μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ] :
MeasurePreserving π (ν.restrict 𝓕) μ where
measurable := measurable_quotient_mk' (s := α_mod_G)
map_eq := by
haveI : HasFundamentalDomain G α ν := ⟨𝓕, h𝓕⟩
rw [h𝓕.projection_respects_measure (μ := μ)]
/-- If a fundamental domain has volume 0, then `QuotientMeasureEqMeasurePreimage` holds. -/
@[to_additive]
theorem IsFundamentalDomain.quotientMeasureEqMeasurePreimage_of_zero
{s : Set α} (fund_dom_s : IsFundamentalDomain G s ν)
(vol_s : ν s = 0) :
QuotientMeasureEqMeasurePreimage ν (0 : Measure (Quotient α_mod_G)) := by
apply fund_dom_s.quotientMeasureEqMeasurePreimage
ext U meas_U
simp only [Measure.coe_zero, Pi.zero_apply]
convert (measure_inter_null_of_null_right (h := vol_s) (Quotient.mk α_mod_G ⁻¹' U)).symm
rw [measure_map_restrict_apply (meas_U := meas_U)]
/-- If a measure `μ` on a quotient satisfies `QuotientMeasureEqMeasurePreimage` with respect to a
sigma-finite measure `ν`, then it is itself `SigmaFinite`. -/
@[to_additive]
lemma QuotientMeasureEqMeasurePreimage.sigmaFiniteQuotient
[i : SigmaFinite ν] [i' : HasFundamentalDomain G α ν]
(μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ] :
SigmaFinite μ := by
rw [sigmaFinite_iff]
obtain ⟨A, hA_meas, hA, hA'⟩ := Measure.toFiniteSpanningSetsIn (h := i)
simp only [mem_setOf_eq] at hA_meas
refine ⟨⟨fun n ↦ π '' (A n), by simp, fun n ↦ ?_, ?_⟩⟩
· obtain ⟨s, fund_dom_s⟩ := i'
have : π ⁻¹' (π '' (A n)) = _ := MulAction.quotient_preimage_image_eq_union_mul (A n) (G := G)
have measπAn : MeasurableSet (π '' A n) := by
let _ : Setoid α := α_mod_G
rw [measurableSet_quotient, Quotient.mk''_eq_mk, this]
apply MeasurableSet.iUnion
exact fun g ↦ MeasurableSet.const_smul (hA_meas n) g
rw [fund_dom_s.projection_respects_measure_apply (μ := μ) measπAn, this, iUnion_inter]
refine lt_of_le_of_lt ?_ (hA n)
rw [fund_dom_s.measure_eq_tsum (A n)]
exact measure_iUnion_le _
· rw [← image_iUnion, hA']
refine image_univ_of_surjective (by convert surjective_quotient_mk' α)
/-- A measure `μ` on `α ⧸ G` satisfying `QuotientMeasureEqMeasurePreimage` and having finite
covolume is a finite measure. -/
@[to_additive]
theorem QuotientMeasureEqMeasurePreimage.isFiniteMeasure_quotient
(μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ]
[hasFun : HasFundamentalDomain G α ν] (h : covolume G α ν ≠ ∞) :
IsFiniteMeasure μ := by
obtain ⟨𝓕, h𝓕⟩ := hasFun.ExistsIsFundamentalDomain
rw [h𝓕.projection_respects_measure (μ := μ)]
have : Fact (ν 𝓕 < ∞) := by
apply Fact.mk
convert Ne.lt_top h
exact (h𝓕.covolume_eq_volume ν).symm
infer_instance
/-- A finite measure `μ` on `α ⧸ G` satisfying `QuotientMeasureEqMeasurePreimage` has finite
covolume. -/
@[to_additive]
theorem QuotientMeasureEqMeasurePreimage.covolume_ne_top
(μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ] [IsFiniteMeasure μ] :
covolume G α ν < ∞ := by
by_cases hasFun : HasFundamentalDomain G α ν
· obtain ⟨𝓕, h𝓕⟩ := hasFun.ExistsIsFundamentalDomain
have H : μ univ < ∞ := IsFiniteMeasure.measure_univ_lt_top
rw [h𝓕.projection_respects_measure_apply (μ := μ) MeasurableSet.univ] at H
simpa [h𝓕.covolume_eq_volume ν] using H
· simp [covolume, hasFun]
end QuotientMeasureEqMeasurePreimage
section QuotientMeasureEqMeasurePreimage
variable [Group G] [MulAction G α] [MeasureSpace α] [Countable G] [MeasurableSpace G]
[SMulInvariantMeasure G α volume] [MeasurableSMul G α]
local notation "α_mod_G" => MulAction.orbitRel G α
local notation "π" => @Quotient.mk _ α_mod_G
/-- If a measure `μ` on a quotient satisfies `QuotientVolumeEqVolumePreimage` with respect to a
sigma-finite measure, then it is itself `SigmaFinite`. -/
@[to_additive MeasureTheory.instSigmaFiniteAddQuotientOrbitRelInstMeasurableSpaceToMeasurableSpace]
instance [SigmaFinite (volume : Measure α)] [HasFundamentalDomain G α]
(μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage volume μ] :
SigmaFinite μ :=
QuotientMeasureEqMeasurePreimage.sigmaFiniteQuotient (ν := (volume : Measure α)) (μ := μ)
end QuotientMeasureEqMeasurePreimage
end MeasureTheory
|
MeasureTheory\Group\GeometryOfNumbers.lean | /-
Copyright (c) 2021 Alex J. Best. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alex J. Best
-/
import Mathlib.Analysis.Convex.Body
import Mathlib.Analysis.Convex.Measure
import Mathlib.MeasureTheory.Group.FundamentalDomain
/-!
# Geometry of numbers
In this file we prove some of the fundamental theorems in the geometry of numbers, as studied by
Hermann Minkowski.
## Main results
* `exists_pair_mem_lattice_not_disjoint_vadd`: Blichfeldt's principle, existence of two distinct
points in a subgroup such that the translates of a set by these two points are not disjoint when
the covolume of the subgroup is larger than the volume of the set.
* `exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure`: Minkowski's theorem, existence of
a non-zero lattice point inside a convex symmetric domain of large enough volume.
## TODO
* Calculate the volume of the fundamental domain of a finite index subgroup
* Voronoi diagrams
* See [Pete L. Clark, *Abstract Geometry of Numbers: Linear Forms* (arXiv)](https://arxiv.org/abs/1405.2119)
for some more ideas.
## References
* [Pete L. Clark, *Geometry of Numbers with Applications to Number Theory*][clark_gon] p.28
-/
namespace MeasureTheory
open ENNReal FiniteDimensional MeasureTheory MeasureTheory.Measure Set Filter
open scoped Pointwise NNReal
variable {E L : Type*} [MeasurableSpace E] {μ : Measure E} {F s : Set E}
/-- **Blichfeldt's Theorem**. If the volume of the set `s` is larger than the covolume of the
countable subgroup `L` of `E`, then there exist two distinct points `x, y ∈ L` such that `(x + s)`
and `(y + s)` are not disjoint. -/
theorem exists_pair_mem_lattice_not_disjoint_vadd [AddCommGroup L] [Countable L] [AddAction L E]
[MeasurableSpace L] [MeasurableVAdd L E] [VAddInvariantMeasure L E μ]
(fund : IsAddFundamentalDomain L F μ) (hS : NullMeasurableSet s μ) (h : μ F < μ s) :
∃ x y : L, x ≠ y ∧ ¬Disjoint (x +ᵥ s) (y +ᵥ s) := by
contrapose! h
exact ((fund.measure_eq_tsum _).trans (measure_iUnion₀
(Pairwise.mono h fun i j hij => (hij.mono inf_le_left inf_le_left).aedisjoint)
fun _ => (hS.vadd _).inter fund.nullMeasurableSet).symm).trans_le
(measure_mono <| Set.iUnion_subset fun _ => Set.inter_subset_right)
/-- The **Minkowski Convex Body Theorem**. If `s` is a convex symmetric domain of `E` whose volume
is large enough compared to the covolume of a lattice `L` of `E`, then it contains a non-zero
lattice point of `L`. -/
theorem exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure [NormedAddCommGroup E]
[NormedSpace ℝ E] [BorelSpace E] [FiniteDimensional ℝ E] [IsAddHaarMeasure μ]
{L : AddSubgroup E} [Countable L] (fund : IsAddFundamentalDomain L F μ)
(h_symm : ∀ x ∈ s, -x ∈ s) (h_conv : Convex ℝ s) (h : μ F * 2 ^ finrank ℝ E < μ s) :
∃ x ≠ 0, ((x : L) : E) ∈ s := by
have h_vol : μ F < μ ((2⁻¹ : ℝ) • s) := by
rw [addHaar_smul_of_nonneg μ (by norm_num : 0 ≤ (2 : ℝ)⁻¹) s, ←
mul_lt_mul_right (pow_ne_zero (finrank ℝ E) (two_ne_zero' _)) (pow_ne_top two_ne_top),
mul_right_comm, ofReal_pow (by norm_num : 0 ≤ (2 : ℝ)⁻¹), ofReal_inv_of_pos zero_lt_two]
norm_num
rwa [← mul_pow, ENNReal.inv_mul_cancel two_ne_zero two_ne_top, one_pow, one_mul]
obtain ⟨x, y, hxy, h⟩ :=
exists_pair_mem_lattice_not_disjoint_vadd fund ((h_conv.smul _).nullMeasurableSet _) h_vol
obtain ⟨_, ⟨v, hv, rfl⟩, w, hw, hvw⟩ := Set.not_disjoint_iff.mp h
refine ⟨x - y, sub_ne_zero.2 hxy, ?_⟩
rw [Set.mem_inv_smul_set_iff₀ (two_ne_zero' ℝ)] at hv hw
simp_rw [AddSubgroup.vadd_def, vadd_eq_add, add_comm _ w, ← sub_eq_sub_iff_add_eq_add, ←
AddSubgroup.coe_sub] at hvw
rw [← hvw, ← inv_smul_smul₀ (two_ne_zero' ℝ) (_ - _), smul_sub, sub_eq_add_neg, smul_add]
refine h_conv hw (h_symm _ hv) ?_ ?_ ?_ <;> norm_num
/-- The **Minkowski Convex Body Theorem for compact domain**. If `s` is a convex compact symmetric
domain of `E` whose volume is large enough compared to the covolume of a lattice `L` of `E`, then it
contains a non-zero lattice point of `L`. Compared to
`exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure`, this version requires in addition
that `s` is compact and `L` is discrete but provides a weaker inequality rather than a strict
inequality. -/
theorem exists_ne_zero_mem_lattice_of_measure_mul_two_pow_le_measure [NormedAddCommGroup E]
[NormedSpace ℝ E] [BorelSpace E] [FiniteDimensional ℝ E] [Nontrivial E] [IsAddHaarMeasure μ]
{L : AddSubgroup E} [Countable L] [DiscreteTopology L] (fund : IsAddFundamentalDomain L F μ)
(h_symm : ∀ x ∈ s, -x ∈ s) (h_conv : Convex ℝ s) (h_cpt : IsCompact s)
(h : μ F * 2 ^ finrank ℝ E ≤ μ s) :
∃ x ≠ 0, ((x : L) : E) ∈ s := by
have h_mes : μ s ≠ 0 := by
intro hμ
suffices μ F = 0 from fund.measure_ne_zero (NeZero.ne μ) this
rw [hμ, le_zero_iff, mul_eq_zero] at h
exact h.resolve_right <| pow_ne_zero _ two_ne_zero
have h_nemp : s.Nonempty := nonempty_of_measure_ne_zero h_mes
let u : ℕ → ℝ≥0 := (exists_seq_strictAnti_tendsto 0).choose
let K : ConvexBody E := ⟨s, h_conv, h_cpt, h_nemp⟩
let S : ℕ → ConvexBody E := fun n => (1 + u n) • K
let Z : ℕ → Set E := fun n => (S n) ∩ (L \ {0})
-- The convex bodies `S n` have volume strictly larger than `μ s` and thus we can apply
-- `exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure` to them and obtain that
-- `S n` contains a nonzero point of `L`. Since the intersection of the `S n` is equal to `s`,
-- it follows that `s` contains a nonzero point of `L`.
have h_zero : 0 ∈ K := K.zero_mem_of_symmetric h_symm
suffices Set.Nonempty (⋂ n, Z n) by
erw [← Set.iInter_inter, K.iInter_smul_eq_self h_zero] at this
· obtain ⟨x, hx⟩ := this
exact ⟨⟨x, by aesop⟩, by aesop⟩
· exact (exists_seq_strictAnti_tendsto (0 : ℝ≥0)).choose_spec.2.2
have h_clos : IsClosed ((L : Set E) \ {0}) := by
rsuffices ⟨U, hU⟩ : ∃ U : Set E, IsOpen U ∧ U ∩ L = {0}
· rw [sdiff_eq_sdiff_iff_inf_eq_inf (z := U).mpr (by simp [Set.inter_comm .. ▸ hU.2, zero_mem])]
exact AddSubgroup.isClosed_of_discrete.sdiff hU.1
exact isOpen_inter_eq_singleton_of_mem_discrete (zero_mem L)
refine IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed Z (fun n => ?_)
(fun n => ?_) ((S 0).isCompact.inter_right h_clos) (fun n => (S n).isClosed.inter h_clos)
· refine Set.inter_subset_inter_left _ (SetLike.coe_subset_coe.mpr ?_)
refine ConvexBody.smul_le_of_le K h_zero ?_
rw [add_le_add_iff_left]
exact le_of_lt <| (exists_seq_strictAnti_tendsto (0 : ℝ≥0)).choose_spec.1 (Nat.lt.base n)
· suffices μ F * 2 ^ finrank ℝ E < μ (S n : Set E) by
have h_symm' : ∀ x ∈ S n, -x ∈ S n := by
rintro _ ⟨y, hy, rfl⟩
exact ⟨-y, h_symm _ hy, by simp⟩
obtain ⟨x, hx_nz, hx_mem⟩ := exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure
fund h_symm' (S n).convex this
exact ⟨x, hx_mem, by aesop⟩
refine lt_of_le_of_lt h ?_
rw [ConvexBody.coe_smul', NNReal.smul_def, addHaar_smul_of_nonneg _ (NNReal.coe_nonneg _)]
rw [show μ s < _ ↔ 1 * μ s < _ by rw [one_mul]]
refine (mul_lt_mul_right h_mes (ne_of_lt h_cpt.measure_lt_top)).mpr ?_
rw [ofReal_pow (NNReal.coe_nonneg _)]
refine one_lt_pow ?_ (ne_of_gt finrank_pos)
simp [(exists_seq_strictAnti_tendsto (0 : ℝ≥0)).choose_spec.2.1 n]
end MeasureTheory
|
MeasureTheory\Group\Integral.lean | /-
Copyright (c) 2022 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn
-/
import Mathlib.MeasureTheory.Integral.Bochner
import Mathlib.MeasureTheory.Group.Measure
/-!
# Bochner Integration on Groups
We develop properties of integrals with a group as domain.
This file contains properties about integrability and Bochner integration.
-/
namespace MeasureTheory
open Measure TopologicalSpace
open scoped ENNReal
variable {𝕜 M α G E F : Type*} [MeasurableSpace G]
variable [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] [NormedAddCommGroup F]
variable {μ : Measure G} {f : G → E} {g : G}
section MeasurableInv
variable [Group G] [MeasurableInv G]
@[to_additive]
theorem Integrable.comp_inv [IsInvInvariant μ] {f : G → F} (hf : Integrable f μ) :
Integrable (fun t => f t⁻¹) μ :=
(hf.mono_measure (map_inv_eq_self μ).le).comp_measurable measurable_inv
@[to_additive]
theorem integral_inv_eq_self (f : G → E) (μ : Measure G) [IsInvInvariant μ] :
∫ x, f x⁻¹ ∂μ = ∫ x, f x ∂μ := by
have h : MeasurableEmbedding fun x : G => x⁻¹ := (MeasurableEquiv.inv G).measurableEmbedding
rw [← h.integral_map, map_inv_eq_self]
end MeasurableInv
section MeasurableMul
variable [Group G] [MeasurableMul G]
/-- Translating a function by left-multiplication does not change its integral with respect to a
left-invariant measure. -/
@[to_additive
"Translating a function by left-addition does not change its integral with respect to a
left-invariant measure."] -- Porting note: was `@[simp]`
theorem integral_mul_left_eq_self [IsMulLeftInvariant μ] (f : G → E) (g : G) :
(∫ x, f (g * x) ∂μ) = ∫ x, f x ∂μ := by
have h_mul : MeasurableEmbedding fun x => g * x := (MeasurableEquiv.mulLeft g).measurableEmbedding
rw [← h_mul.integral_map, map_mul_left_eq_self]
/-- Translating a function by right-multiplication does not change its integral with respect to a
right-invariant measure. -/
@[to_additive
"Translating a function by right-addition does not change its integral with respect to a
right-invariant measure."] -- Porting note: was `@[simp]`
theorem integral_mul_right_eq_self [IsMulRightInvariant μ] (f : G → E) (g : G) :
(∫ x, f (x * g) ∂μ) = ∫ x, f x ∂μ := by
have h_mul : MeasurableEmbedding fun x => x * g :=
(MeasurableEquiv.mulRight g).measurableEmbedding
rw [← h_mul.integral_map, map_mul_right_eq_self]
@[to_additive] -- Porting note: was `@[simp]`
theorem integral_div_right_eq_self [IsMulRightInvariant μ] (f : G → E) (g : G) :
(∫ x, f (x / g) ∂μ) = ∫ x, f x ∂μ := by
simp_rw [div_eq_mul_inv]
-- Porting note: was `simp_rw`
rw [integral_mul_right_eq_self f g⁻¹]
/-- If some left-translate of a function negates it, then the integral of the function with respect
to a left-invariant measure is 0. -/
@[to_additive
"If some left-translate of a function negates it, then the integral of the function with
respect to a left-invariant measure is 0."]
theorem integral_eq_zero_of_mul_left_eq_neg [IsMulLeftInvariant μ] (hf' : ∀ x, f (g * x) = -f x) :
∫ x, f x ∂μ = 0 := by
simp_rw [← self_eq_neg ℝ E, ← integral_neg, ← hf', integral_mul_left_eq_self]
/-- If some right-translate of a function negates it, then the integral of the function with respect
to a right-invariant measure is 0. -/
@[to_additive
"If some right-translate of a function negates it, then the integral of the function with
respect to a right-invariant measure is 0."]
theorem integral_eq_zero_of_mul_right_eq_neg [IsMulRightInvariant μ] (hf' : ∀ x, f (x * g) = -f x) :
∫ x, f x ∂μ = 0 := by
simp_rw [← self_eq_neg ℝ E, ← integral_neg, ← hf', integral_mul_right_eq_self]
@[to_additive]
theorem Integrable.comp_mul_left {f : G → F} [IsMulLeftInvariant μ] (hf : Integrable f μ) (g : G) :
Integrable (fun t => f (g * t)) μ :=
(hf.mono_measure (map_mul_left_eq_self μ g).le).comp_measurable <| measurable_const_mul g
@[to_additive]
theorem Integrable.comp_mul_right {f : G → F} [IsMulRightInvariant μ] (hf : Integrable f μ)
(g : G) : Integrable (fun t => f (t * g)) μ :=
(hf.mono_measure (map_mul_right_eq_self μ g).le).comp_measurable <| measurable_mul_const g
@[to_additive]
theorem Integrable.comp_div_right {f : G → F} [IsMulRightInvariant μ] (hf : Integrable f μ)
(g : G) : Integrable (fun t => f (t / g)) μ := by
simp_rw [div_eq_mul_inv]
exact hf.comp_mul_right g⁻¹
variable [MeasurableInv G]
@[to_additive]
theorem Integrable.comp_div_left {f : G → F} [IsInvInvariant μ] [IsMulLeftInvariant μ]
(hf : Integrable f μ) (g : G) : Integrable (fun t => f (g / t)) μ :=
((measurePreserving_div_left μ g).integrable_comp hf.aestronglyMeasurable).mpr hf
@[to_additive] -- Porting note: was `@[simp]`
theorem integrable_comp_div_left (f : G → F) [IsInvInvariant μ] [IsMulLeftInvariant μ] (g : G) :
Integrable (fun t => f (g / t)) μ ↔ Integrable f μ := by
refine ⟨fun h => ?_, fun h => h.comp_div_left g⟩
convert h.comp_inv.comp_mul_left g⁻¹
simp_rw [div_inv_eq_mul, mul_inv_cancel_left]
@[to_additive] -- Porting note: was `@[simp]`
theorem integral_div_left_eq_self (f : G → E) (μ : Measure G) [IsInvInvariant μ]
[IsMulLeftInvariant μ] (x' : G) : (∫ x, f (x' / x) ∂μ) = ∫ x, f x ∂μ := by
simp_rw [div_eq_mul_inv]
-- Porting note: was `simp_rw`
rw [integral_inv_eq_self (fun x => f (x' * x)) μ, integral_mul_left_eq_self f x']
end MeasurableMul
section SMul
variable [Group G] [MeasurableSpace α] [MulAction G α] [MeasurableSMul G α]
@[to_additive] -- Porting note: was `@[simp]`
theorem integral_smul_eq_self {μ : Measure α} [SMulInvariantMeasure G α μ] (f : α → E) {g : G} :
(∫ x, f (g • x) ∂μ) = ∫ x, f x ∂μ := by
have h : MeasurableEmbedding fun x : α => g • x := (MeasurableEquiv.smul g).measurableEmbedding
rw [← h.integral_map, map_smul]
end SMul
end MeasureTheory
|
MeasureTheory\Group\LIntegral.lean | /-
Copyright (c) 2022 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn
-/
import Mathlib.MeasureTheory.Group.Measure
/-!
# Lebesgue Integration on Groups
We develop properties of integrals with a group as domain.
This file contains properties about Lebesgue integration.
-/
assert_not_exists NormedSpace
namespace MeasureTheory
open Measure TopologicalSpace
open scoped ENNReal
variable {G : Type*} [MeasurableSpace G] {μ : Measure G} {g : G}
section MeasurableMul
variable [Group G] [MeasurableMul G]
/-- Translating a function by left-multiplication does not change its Lebesgue integral
with respect to a left-invariant measure. -/
@[to_additive
"Translating a function by left-addition does not change its Lebesgue integral with
respect to a left-invariant measure."]
theorem lintegral_mul_left_eq_self [IsMulLeftInvariant μ] (f : G → ℝ≥0∞) (g : G) :
(∫⁻ x, f (g * x) ∂μ) = ∫⁻ x, f x ∂μ := by
convert (lintegral_map_equiv f <| MeasurableEquiv.mulLeft g).symm
simp [map_mul_left_eq_self μ g]
/-- Translating a function by right-multiplication does not change its Lebesgue integral
with respect to a right-invariant measure. -/
@[to_additive
"Translating a function by right-addition does not change its Lebesgue integral with
respect to a right-invariant measure."]
theorem lintegral_mul_right_eq_self [IsMulRightInvariant μ] (f : G → ℝ≥0∞) (g : G) :
(∫⁻ x, f (x * g) ∂μ) = ∫⁻ x, f x ∂μ := by
convert (lintegral_map_equiv f <| MeasurableEquiv.mulRight g).symm using 1
simp [map_mul_right_eq_self μ g]
@[to_additive] -- Porting note: was `@[simp]`
theorem lintegral_div_right_eq_self [IsMulRightInvariant μ] (f : G → ℝ≥0∞) (g : G) :
(∫⁻ x, f (x / g) ∂μ) = ∫⁻ x, f x ∂μ := by
simp_rw [div_eq_mul_inv, lintegral_mul_right_eq_self f g⁻¹]
end MeasurableMul
section TopologicalGroup
variable [TopologicalSpace G] [Group G] [TopologicalGroup G] [BorelSpace G] [IsMulLeftInvariant μ]
/-- For nonzero regular left invariant measures, the integral of a continuous nonnegative function
`f` is 0 iff `f` is 0. -/
@[to_additive
"For nonzero regular left invariant measures, the integral of a continuous nonnegative
function `f` is 0 iff `f` is 0."]
theorem lintegral_eq_zero_of_isMulLeftInvariant [Regular μ] [NeZero μ] {f : G → ℝ≥0∞}
(hf : Continuous f) : ∫⁻ x, f x ∂μ = 0 ↔ f = 0 := by
rw [lintegral_eq_zero_iff hf.measurable, hf.ae_eq_iff_eq μ continuous_zero]
end TopologicalGroup
end MeasureTheory
|
MeasureTheory\Group\MeasurableEquiv.lean | /-
Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury G. Kudryashov
-/
import Mathlib.MeasureTheory.Group.Arithmetic
/-!
# (Scalar) multiplication and (vector) addition as measurable equivalences
In this file we define the following measurable equivalences:
* `MeasurableEquiv.smul`: if a group `G` acts on `α` by measurable maps, then each element `c : G`
defines a measurable automorphism of `α`;
* `MeasurableEquiv.vadd`: additive version of `MeasurableEquiv.smul`;
* `MeasurableEquiv.smul₀`: if a group with zero `G` acts on `α` by measurable maps, then each
nonzero element `c : G` defines a measurable automorphism of `α`;
* `MeasurableEquiv.mulLeft`: if `G` is a group with measurable multiplication, then left
multiplication by `g : G` is a measurable automorphism of `G`;
* `MeasurableEquiv.addLeft`: additive version of `MeasurableEquiv.mulLeft`;
* `MeasurableEquiv.mulRight`: if `G` is a group with measurable multiplication, then right
multiplication by `g : G` is a measurable automorphism of `G`;
* `MeasurableEquiv.addRight`: additive version of `MeasurableEquiv.mulRight`;
* `MeasurableEquiv.mulLeft₀`, `MeasurableEquiv.mulRight₀`: versions of
`MeasurableEquiv.mulLeft` and `MeasurableEquiv.mulRight` for groups with zero;
* `MeasurableEquiv.inv`: `Inv.inv` as a measurable automorphism
of a group (or a group with zero);
* `MeasurableEquiv.neg`: negation as a measurable automorphism of an additive group.
We also deduce that the corresponding maps are measurable embeddings.
## Tags
measurable, equivalence, group action
-/
namespace MeasurableEquiv
variable {G G₀ α : Type*} [MeasurableSpace G] [MeasurableSpace G₀] [MeasurableSpace α] [Group G]
[GroupWithZero G₀] [MulAction G α] [MulAction G₀ α] [MeasurableSMul G α] [MeasurableSMul G₀ α]
/-- If a group `G` acts on `α` by measurable maps, then each element `c : G` defines a measurable
automorphism of `α`. -/
@[to_additive (attr := simps! (config := .asFn) toEquiv apply)
"If an additive group `G` acts on `α` by measurable maps, then each element `c : G`
defines a measurable automorphism of `α`." ]
def smul (c : G) : α ≃ᵐ α where
toEquiv := MulAction.toPerm c
measurable_toFun := measurable_const_smul c
measurable_invFun := measurable_const_smul c⁻¹
@[to_additive]
theorem _root_.measurableEmbedding_const_smul (c : G) : MeasurableEmbedding (c • · : α → α) :=
(smul c).measurableEmbedding
@[to_additive (attr := simp)]
theorem symm_smul (c : G) : (smul c : α ≃ᵐ α).symm = smul c⁻¹ :=
ext rfl
/-- If a group with zero `G₀` acts on `α` by measurable maps, then each nonzero element `c : G₀`
defines a measurable automorphism of `α` -/
def smul₀ (c : G₀) (hc : c ≠ 0) : α ≃ᵐ α :=
MeasurableEquiv.smul (Units.mk0 c hc)
@[simp] lemma coe_smul₀ {c : G₀} (hc : c ≠ 0) : ⇑(smul₀ c hc : α ≃ᵐ α) = (c • ·) := rfl
@[simp]
theorem symm_smul₀ {c : G₀} (hc : c ≠ 0) :
(smul₀ c hc : α ≃ᵐ α).symm = smul₀ c⁻¹ (inv_ne_zero hc) :=
ext rfl
theorem _root_.measurableEmbedding_const_smul₀ {c : G₀} (hc : c ≠ 0) :
MeasurableEmbedding (c • · : α → α) :=
(smul₀ c hc).measurableEmbedding
section Mul
variable [MeasurableMul G] [MeasurableMul G₀]
/-- If `G` is a group with measurable multiplication, then left multiplication by `g : G` is a
measurable automorphism of `G`. -/
@[to_additive
"If `G` is an additive group with measurable addition, then addition of `g : G`
on the left is a measurable automorphism of `G`."]
def mulLeft (g : G) : G ≃ᵐ G :=
smul g
@[to_additive (attr := simp)]
theorem coe_mulLeft (g : G) : ⇑(mulLeft g) = (g * ·) :=
rfl
@[to_additive (attr := simp)]
theorem symm_mulLeft (g : G) : (mulLeft g).symm = mulLeft g⁻¹ :=
ext rfl
@[to_additive (attr := simp)]
theorem toEquiv_mulLeft (g : G) : (mulLeft g).toEquiv = Equiv.mulLeft g :=
rfl
@[to_additive]
theorem _root_.measurableEmbedding_mulLeft (g : G) : MeasurableEmbedding (g * ·) :=
(mulLeft g).measurableEmbedding
/-- If `G` is a group with measurable multiplication, then right multiplication by `g : G` is a
measurable automorphism of `G`. -/
@[to_additive
"If `G` is an additive group with measurable addition, then addition of `g : G`
on the right is a measurable automorphism of `G`."]
def mulRight (g : G) : G ≃ᵐ G where
toEquiv := Equiv.mulRight g
measurable_toFun := measurable_mul_const g
measurable_invFun := measurable_mul_const g⁻¹
@[to_additive]
theorem _root_.measurableEmbedding_mulRight (g : G) : MeasurableEmbedding fun x => x * g :=
(mulRight g).measurableEmbedding
@[to_additive (attr := simp)]
theorem coe_mulRight (g : G) : ⇑(mulRight g) = fun x => x * g :=
rfl
@[to_additive (attr := simp)]
theorem symm_mulRight (g : G) : (mulRight g).symm = mulRight g⁻¹ :=
ext rfl
@[to_additive (attr := simp)]
theorem toEquiv_mulRight (g : G) : (mulRight g).toEquiv = Equiv.mulRight g :=
rfl
/-- If `G₀` is a group with zero with measurable multiplication, then left multiplication by a
nonzero element `g : G₀` is a measurable automorphism of `G₀`. -/
def mulLeft₀ (g : G₀) (hg : g ≠ 0) : G₀ ≃ᵐ G₀ :=
smul₀ g hg
theorem _root_.measurableEmbedding_mulLeft₀ {g : G₀} (hg : g ≠ 0) :
MeasurableEmbedding (g * ·) :=
(mulLeft₀ g hg).measurableEmbedding
@[simp] lemma coe_mulLeft₀ {g : G₀} (hg : g ≠ 0) : ⇑(mulLeft₀ g hg) = (g * ·) := rfl
@[simp]
theorem symm_mulLeft₀ {g : G₀} (hg : g ≠ 0) :
(mulLeft₀ g hg).symm = mulLeft₀ g⁻¹ (inv_ne_zero hg) :=
ext rfl
@[simp]
theorem toEquiv_mulLeft₀ {g : G₀} (hg : g ≠ 0) : (mulLeft₀ g hg).toEquiv = Equiv.mulLeft₀ g hg :=
rfl
/-- If `G₀` is a group with zero with measurable multiplication, then right multiplication by a
nonzero element `g : G₀` is a measurable automorphism of `G₀`. -/
def mulRight₀ (g : G₀) (hg : g ≠ 0) : G₀ ≃ᵐ G₀ where
toEquiv := Equiv.mulRight₀ g hg
measurable_toFun := measurable_mul_const g
measurable_invFun := measurable_mul_const g⁻¹
theorem _root_.measurableEmbedding_mulRight₀ {g : G₀} (hg : g ≠ 0) :
MeasurableEmbedding fun x => x * g :=
(mulRight₀ g hg).measurableEmbedding
@[simp]
theorem coe_mulRight₀ {g : G₀} (hg : g ≠ 0) : ⇑(mulRight₀ g hg) = fun x => x * g :=
rfl
@[simp]
theorem symm_mulRight₀ {g : G₀} (hg : g ≠ 0) :
(mulRight₀ g hg).symm = mulRight₀ g⁻¹ (inv_ne_zero hg) :=
ext rfl
@[simp]
theorem toEquiv_mulRight₀ {g : G₀} (hg : g ≠ 0) : (mulRight₀ g hg).toEquiv = Equiv.mulRight₀ g hg :=
rfl
end Mul
/-- Inversion as a measurable automorphism of a group or group with zero. -/
@[to_additive (attr := simps! (config := .asFn) toEquiv apply)
"Negation as a measurable automorphism of an additive group."]
def inv (G) [MeasurableSpace G] [InvolutiveInv G] [MeasurableInv G] : G ≃ᵐ G where
toEquiv := Equiv.inv G
measurable_toFun := measurable_inv
measurable_invFun := measurable_inv
@[to_additive (attr := simp)]
theorem symm_inv {G} [MeasurableSpace G] [InvolutiveInv G] [MeasurableInv G] :
(inv G).symm = inv G :=
rfl
/-- `equiv.divRight` as a `MeasurableEquiv`. -/
@[to_additive " `equiv.subRight` as a `MeasurableEquiv` "]
def divRight [MeasurableMul G] (g : G) : G ≃ᵐ G where
toEquiv := Equiv.divRight g
measurable_toFun := measurable_div_const' g
measurable_invFun := measurable_mul_const g
/-- `equiv.divLeft` as a `MeasurableEquiv` -/
@[to_additive " `equiv.subLeft` as a `MeasurableEquiv` "]
def divLeft [MeasurableMul G] [MeasurableInv G] (g : G) : G ≃ᵐ G where
toEquiv := Equiv.divLeft g
measurable_toFun := measurable_id.const_div g
measurable_invFun := measurable_inv.mul_const g
end MeasurableEquiv
|
MeasureTheory\Group\Measure.lean | /-
Copyright (c) 2020 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn
-/
import Mathlib.Dynamics.Ergodic.MeasurePreserving
import Mathlib.GroupTheory.GroupAction.Hom
import Mathlib.MeasureTheory.Constructions.Prod.Basic
import Mathlib.MeasureTheory.Group.Action
import Mathlib.MeasureTheory.Group.MeasurableEquiv
import Mathlib.MeasureTheory.Measure.OpenPos
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.Topology.ContinuousFunction.CocompactMap
import Mathlib.Topology.Homeomorph
/-!
# Measures on Groups
We develop some properties of measures on (topological) groups
* We define properties on measures: measures that are left or right invariant w.r.t. multiplication.
* We define the measure `μ.inv : A ↦ μ(A⁻¹)` and show that it is right invariant iff
`μ` is left invariant.
* We define a class `IsHaarMeasure μ`, requiring that the measure `μ` is left-invariant, finite
on compact sets, and positive on open sets.
We also give analogues of all these notions in the additive world.
-/
noncomputable section
open scoped NNReal ENNReal Pointwise Topology
open Inv Set Function MeasureTheory.Measure Filter
variable {𝕜 G H : Type*} [MeasurableSpace G] [MeasurableSpace H]
namespace MeasureTheory
namespace Measure
/-- A measure `μ` on a measurable additive group is left invariant
if the measure of left translations of a set are equal to the measure of the set itself. -/
class IsAddLeftInvariant [Add G] (μ : Measure G) : Prop where
map_add_left_eq_self : ∀ g : G, map (g + ·) μ = μ
/-- A measure `μ` on a measurable group is left invariant
if the measure of left translations of a set are equal to the measure of the set itself. -/
@[to_additive existing]
class IsMulLeftInvariant [Mul G] (μ : Measure G) : Prop where
map_mul_left_eq_self : ∀ g : G, map (g * ·) μ = μ
/-- A measure `μ` on a measurable additive group is right invariant
if the measure of right translations of a set are equal to the measure of the set itself. -/
class IsAddRightInvariant [Add G] (μ : Measure G) : Prop where
map_add_right_eq_self : ∀ g : G, map (· + g) μ = μ
/-- A measure `μ` on a measurable group is right invariant
if the measure of right translations of a set are equal to the measure of the set itself. -/
@[to_additive existing]
class IsMulRightInvariant [Mul G] (μ : Measure G) : Prop where
map_mul_right_eq_self : ∀ g : G, map (· * g) μ = μ
end Measure
open Measure
section Mul
variable [Mul G] {μ : Measure G}
@[to_additive]
theorem map_mul_left_eq_self (μ : Measure G) [IsMulLeftInvariant μ] (g : G) :
map (g * ·) μ = μ :=
IsMulLeftInvariant.map_mul_left_eq_self g
@[to_additive]
theorem map_mul_right_eq_self (μ : Measure G) [IsMulRightInvariant μ] (g : G) : map (· * g) μ = μ :=
IsMulRightInvariant.map_mul_right_eq_self g
@[to_additive MeasureTheory.isAddLeftInvariant_smul]
instance isMulLeftInvariant_smul [IsMulLeftInvariant μ] (c : ℝ≥0∞) : IsMulLeftInvariant (c • μ) :=
⟨fun g => by rw [Measure.map_smul, map_mul_left_eq_self]⟩
@[to_additive MeasureTheory.isAddRightInvariant_smul]
instance isMulRightInvariant_smul [IsMulRightInvariant μ] (c : ℝ≥0∞) :
IsMulRightInvariant (c • μ) :=
⟨fun g => by rw [Measure.map_smul, map_mul_right_eq_self]⟩
@[to_additive MeasureTheory.isAddLeftInvariant_smul_nnreal]
instance isMulLeftInvariant_smul_nnreal [IsMulLeftInvariant μ] (c : ℝ≥0) :
IsMulLeftInvariant (c • μ) :=
MeasureTheory.isMulLeftInvariant_smul (c : ℝ≥0∞)
@[to_additive MeasureTheory.isAddRightInvariant_smul_nnreal]
instance isMulRightInvariant_smul_nnreal [IsMulRightInvariant μ] (c : ℝ≥0) :
IsMulRightInvariant (c • μ) :=
MeasureTheory.isMulRightInvariant_smul (c : ℝ≥0∞)
@[to_additive]
instance IsMulLeftInvariant.smulInvariantMeasure [IsMulLeftInvariant μ] :
SMulInvariantMeasure G G μ :=
⟨fun _x _s hs => measure_preimage_of_map_eq_self (map_mul_left_eq_self _ _) hs.nullMeasurableSet⟩
@[to_additive]
instance IsMulRightInvariant.toSMulInvariantMeasure_op [μ.IsMulRightInvariant] :
SMulInvariantMeasure Gᵐᵒᵖ G μ :=
⟨fun _x _s hs => measure_preimage_of_map_eq_self (map_mul_right_eq_self _ _) hs.nullMeasurableSet⟩
section MeasurableMul
variable [MeasurableMul G]
@[to_additive]
theorem measurePreserving_mul_left (μ : Measure G) [IsMulLeftInvariant μ] (g : G) :
MeasurePreserving (g * ·) μ μ :=
⟨measurable_const_mul g, map_mul_left_eq_self μ g⟩
@[to_additive]
theorem MeasurePreserving.mul_left (μ : Measure G) [IsMulLeftInvariant μ] (g : G) {X : Type*}
[MeasurableSpace X] {μ' : Measure X} {f : X → G} (hf : MeasurePreserving f μ' μ) :
MeasurePreserving (fun x => g * f x) μ' μ :=
(measurePreserving_mul_left μ g).comp hf
@[to_additive]
theorem measurePreserving_mul_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) :
MeasurePreserving (· * g) μ μ :=
⟨measurable_mul_const g, map_mul_right_eq_self μ g⟩
@[to_additive]
theorem MeasurePreserving.mul_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) {X : Type*}
[MeasurableSpace X] {μ' : Measure X} {f : X → G} (hf : MeasurePreserving f μ' μ) :
MeasurePreserving (fun x => f x * g) μ' μ :=
(measurePreserving_mul_right μ g).comp hf
@[to_additive]
instance Subgroup.smulInvariantMeasure {G α : Type*} [Group G] [MulAction G α] [MeasurableSpace α]
{μ : Measure α} [SMulInvariantMeasure G α μ] (H : Subgroup G) : SMulInvariantMeasure H α μ :=
⟨fun y s hs => by convert SMulInvariantMeasure.measure_preimage_smul (μ := μ) (y : G) hs⟩
/-- An alternative way to prove that `μ` is left invariant under multiplication. -/
@[to_additive " An alternative way to prove that `μ` is left invariant under addition. "]
theorem forall_measure_preimage_mul_iff (μ : Measure G) :
(∀ (g : G) (A : Set G), MeasurableSet A → μ ((fun h => g * h) ⁻¹' A) = μ A) ↔
IsMulLeftInvariant μ := by
trans ∀ g, map (g * ·) μ = μ
· simp_rw [Measure.ext_iff]
refine forall_congr' fun g => forall_congr' fun A => forall_congr' fun hA => ?_
rw [map_apply (measurable_const_mul g) hA]
exact ⟨fun h => ⟨h⟩, fun h => h.1⟩
/-- An alternative way to prove that `μ` is right invariant under multiplication. -/
@[to_additive " An alternative way to prove that `μ` is right invariant under addition. "]
theorem forall_measure_preimage_mul_right_iff (μ : Measure G) :
(∀ (g : G) (A : Set G), MeasurableSet A → μ ((fun h => h * g) ⁻¹' A) = μ A) ↔
IsMulRightInvariant μ := by
trans ∀ g, map (· * g) μ = μ
· simp_rw [Measure.ext_iff]
refine forall_congr' fun g => forall_congr' fun A => forall_congr' fun hA => ?_
rw [map_apply (measurable_mul_const g) hA]
exact ⟨fun h => ⟨h⟩, fun h => h.1⟩
@[to_additive]
instance Measure.prod.instIsMulLeftInvariant [IsMulLeftInvariant μ] [SFinite μ] {H : Type*}
[Mul H] {mH : MeasurableSpace H} {ν : Measure H} [MeasurableMul H] [IsMulLeftInvariant ν]
[SFinite ν] : IsMulLeftInvariant (μ.prod ν) := by
constructor
rintro ⟨g, h⟩
change map (Prod.map (g * ·) (h * ·)) (μ.prod ν) = μ.prod ν
rw [← map_prod_map _ _ (measurable_const_mul g) (measurable_const_mul h),
map_mul_left_eq_self μ g, map_mul_left_eq_self ν h]
@[to_additive]
instance Measure.prod.instIsMulRightInvariant [IsMulRightInvariant μ] [SFinite μ] {H : Type*}
[Mul H] {mH : MeasurableSpace H} {ν : Measure H} [MeasurableMul H] [IsMulRightInvariant ν]
[SFinite ν] : IsMulRightInvariant (μ.prod ν) := by
constructor
rintro ⟨g, h⟩
change map (Prod.map (· * g) (· * h)) (μ.prod ν) = μ.prod ν
rw [← map_prod_map _ _ (measurable_mul_const g) (measurable_mul_const h),
map_mul_right_eq_self μ g, map_mul_right_eq_self ν h]
@[to_additive]
theorem isMulLeftInvariant_map {H : Type*} [MeasurableSpace H] [Mul H] [MeasurableMul H]
[IsMulLeftInvariant μ] (f : G →ₙ* H) (hf : Measurable f) (h_surj : Surjective f) :
IsMulLeftInvariant (Measure.map f μ) := by
refine ⟨fun h => ?_⟩
rw [map_map (measurable_const_mul _) hf]
obtain ⟨g, rfl⟩ := h_surj h
conv_rhs => rw [← map_mul_left_eq_self μ g]
rw [map_map hf (measurable_const_mul _)]
congr 2
ext y
simp only [comp_apply, map_mul]
end MeasurableMul
end Mul
section Semigroup
variable [Semigroup G] [MeasurableMul G] {μ : Measure G}
/-- The image of a left invariant measure under a left action is left invariant, assuming that
the action preserves multiplication. -/
@[to_additive "The image of a left invariant measure under a left additive action is left invariant,
assuming that the action preserves addition."]
theorem isMulLeftInvariant_map_smul
{α} [SMul α G] [SMulCommClass α G G] [MeasurableSpace α] [MeasurableSMul α G]
[IsMulLeftInvariant μ] (a : α) :
IsMulLeftInvariant (map (a • · : G → G) μ) :=
(forall_measure_preimage_mul_iff _).1 fun x _ hs =>
(smulInvariantMeasure_map_smul μ a).measure_preimage_smul x hs
/-- The image of a right invariant measure under a left action is right invariant, assuming that
the action preserves multiplication. -/
@[to_additive "The image of a right invariant measure under a left additive action is right
invariant, assuming that the action preserves addition."]
theorem isMulRightInvariant_map_smul
{α} [SMul α G] [SMulCommClass α Gᵐᵒᵖ G] [MeasurableSpace α] [MeasurableSMul α G]
[IsMulRightInvariant μ] (a : α) :
IsMulRightInvariant (map (a • · : G → G) μ) :=
(forall_measure_preimage_mul_right_iff _).1 fun x _ hs =>
(smulInvariantMeasure_map_smul μ a).measure_preimage_smul (MulOpposite.op x) hs
/-- The image of a left invariant measure under right multiplication is left invariant. -/
@[to_additive isMulLeftInvariant_map_add_right
"The image of a left invariant measure under right addition is left invariant."]
instance isMulLeftInvariant_map_mul_right [IsMulLeftInvariant μ] (g : G) :
IsMulLeftInvariant (map (· * g) μ) :=
isMulLeftInvariant_map_smul (MulOpposite.op g)
/-- The image of a right invariant measure under left multiplication is right invariant. -/
@[to_additive isMulRightInvariant_map_add_left
"The image of a right invariant measure under left addition is right invariant."]
instance isMulRightInvariant_map_mul_left [IsMulRightInvariant μ] (g : G) :
IsMulRightInvariant (map (g * ·) μ) :=
isMulRightInvariant_map_smul g
end Semigroup
section DivInvMonoid
variable [DivInvMonoid G]
@[to_additive]
theorem map_div_right_eq_self (μ : Measure G) [IsMulRightInvariant μ] (g : G) :
map (· / g) μ = μ := by simp_rw [div_eq_mul_inv, map_mul_right_eq_self μ g⁻¹]
end DivInvMonoid
section Group
variable [Group G] [MeasurableMul G]
@[to_additive]
theorem measurePreserving_div_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) :
MeasurePreserving (· / g) μ μ := by simp_rw [div_eq_mul_inv, measurePreserving_mul_right μ g⁻¹]
/-- We shorten this from `measure_preimage_mul_left`, since left invariant is the preferred option
for measures in this formalization. -/
@[to_additive (attr := simp)
"We shorten this from `measure_preimage_add_left`, since left invariant is the preferred option for
measures in this formalization."]
theorem measure_preimage_mul (μ : Measure G) [IsMulLeftInvariant μ] (g : G) (A : Set G) :
μ ((fun h => g * h) ⁻¹' A) = μ A :=
calc
μ ((fun h => g * h) ⁻¹' A) = map (fun h => g * h) μ A :=
((MeasurableEquiv.mulLeft g).map_apply A).symm
_ = μ A := by rw [map_mul_left_eq_self μ g]
@[to_additive (attr := simp)]
theorem measure_preimage_mul_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) (A : Set G) :
μ ((fun h => h * g) ⁻¹' A) = μ A :=
calc
μ ((fun h => h * g) ⁻¹' A) = map (fun h => h * g) μ A :=
((MeasurableEquiv.mulRight g).map_apply A).symm
_ = μ A := by rw [map_mul_right_eq_self μ g]
@[to_additive]
theorem map_mul_left_ae (μ : Measure G) [IsMulLeftInvariant μ] (x : G) :
Filter.map (fun h => x * h) (ae μ) = ae μ :=
((MeasurableEquiv.mulLeft x).map_ae μ).trans <| congr_arg ae <| map_mul_left_eq_self μ x
@[to_additive]
theorem map_mul_right_ae (μ : Measure G) [IsMulRightInvariant μ] (x : G) :
Filter.map (fun h => h * x) (ae μ) = ae μ :=
((MeasurableEquiv.mulRight x).map_ae μ).trans <| congr_arg ae <| map_mul_right_eq_self μ x
@[to_additive]
theorem map_div_right_ae (μ : Measure G) [IsMulRightInvariant μ] (x : G) :
Filter.map (fun t => t / x) (ae μ) = ae μ :=
((MeasurableEquiv.divRight x).map_ae μ).trans <| congr_arg ae <| map_div_right_eq_self μ x
@[to_additive]
theorem eventually_mul_left_iff (μ : Measure G) [IsMulLeftInvariant μ] (t : G) {p : G → Prop} :
(∀ᵐ x ∂μ, p (t * x)) ↔ ∀ᵐ x ∂μ, p x := by
conv_rhs => rw [Filter.Eventually, ← map_mul_left_ae μ t]
rfl
@[to_additive]
theorem eventually_mul_right_iff (μ : Measure G) [IsMulRightInvariant μ] (t : G) {p : G → Prop} :
(∀ᵐ x ∂μ, p (x * t)) ↔ ∀ᵐ x ∂μ, p x := by
conv_rhs => rw [Filter.Eventually, ← map_mul_right_ae μ t]
rfl
@[to_additive]
theorem eventually_div_right_iff (μ : Measure G) [IsMulRightInvariant μ] (t : G) {p : G → Prop} :
(∀ᵐ x ∂μ, p (x / t)) ↔ ∀ᵐ x ∂μ, p x := by
conv_rhs => rw [Filter.Eventually, ← map_div_right_ae μ t]
rfl
end Group
namespace Measure
-- Porting note: Even in `noncomputable section`, a definition with `to_additive` require
-- `noncomputable` to generate an additive definition.
-- Please refer to leanprover/lean4#2077.
/-- The measure `A ↦ μ (A⁻¹)`, where `A⁻¹` is the pointwise inverse of `A`. -/
@[to_additive "The measure `A ↦ μ (- A)`, where `- A` is the pointwise negation of `A`."]
protected noncomputable def inv [Inv G] (μ : Measure G) : Measure G :=
Measure.map inv μ
/-- A measure is invariant under negation if `- μ = μ`. Equivalently, this means that for all
measurable `A` we have `μ (- A) = μ A`, where `- A` is the pointwise negation of `A`. -/
class IsNegInvariant [Neg G] (μ : Measure G) : Prop where
neg_eq_self : μ.neg = μ
/-- A measure is invariant under inversion if `μ⁻¹ = μ`. Equivalently, this means that for all
measurable `A` we have `μ (A⁻¹) = μ A`, where `A⁻¹` is the pointwise inverse of `A`. -/
@[to_additive existing]
class IsInvInvariant [Inv G] (μ : Measure G) : Prop where
inv_eq_self : μ.inv = μ
section Inv
variable [Inv G]
@[to_additive]
theorem inv_def (μ : Measure G) : μ.inv = Measure.map inv μ := rfl
@[to_additive (attr := simp)]
theorem inv_eq_self (μ : Measure G) [IsInvInvariant μ] : μ.inv = μ :=
IsInvInvariant.inv_eq_self
@[to_additive (attr := simp)]
theorem map_inv_eq_self (μ : Measure G) [IsInvInvariant μ] : map Inv.inv μ = μ :=
IsInvInvariant.inv_eq_self
variable [MeasurableInv G]
@[to_additive]
theorem measurePreserving_inv (μ : Measure G) [IsInvInvariant μ] : MeasurePreserving Inv.inv μ μ :=
⟨measurable_inv, map_inv_eq_self μ⟩
@[to_additive]
instance inv.instSFinite (μ : Measure G) [SFinite μ] : SFinite μ.inv := by
rw [Measure.inv]; infer_instance
end Inv
section InvolutiveInv
variable [InvolutiveInv G] [MeasurableInv G]
@[to_additive (attr := simp)]
theorem inv_apply (μ : Measure G) (s : Set G) : μ.inv s = μ s⁻¹ :=
(MeasurableEquiv.inv G).map_apply s
@[to_additive (attr := simp)]
protected theorem inv_inv (μ : Measure G) : μ.inv.inv = μ :=
(MeasurableEquiv.inv G).map_symm_map
@[to_additive (attr := simp)]
theorem measure_inv (μ : Measure G) [IsInvInvariant μ] (A : Set G) : μ A⁻¹ = μ A := by
rw [← inv_apply, inv_eq_self]
@[to_additive]
theorem measure_preimage_inv (μ : Measure G) [IsInvInvariant μ] (A : Set G) :
μ (Inv.inv ⁻¹' A) = μ A :=
μ.measure_inv A
@[to_additive]
instance inv.instSigmaFinite (μ : Measure G) [SigmaFinite μ] : SigmaFinite μ.inv :=
(MeasurableEquiv.inv G).sigmaFinite_map
end InvolutiveInv
section DivisionMonoid
variable [DivisionMonoid G] [MeasurableMul G] [MeasurableInv G] {μ : Measure G}
@[to_additive]
instance inv.instIsMulRightInvariant [IsMulLeftInvariant μ] : IsMulRightInvariant μ.inv := by
constructor
intro g
conv_rhs => rw [← map_mul_left_eq_self μ g⁻¹]
simp_rw [Measure.inv, map_map (measurable_mul_const g) measurable_inv,
map_map measurable_inv (measurable_const_mul g⁻¹), Function.comp, mul_inv_rev, inv_inv]
@[to_additive]
instance inv.instIsMulLeftInvariant [IsMulRightInvariant μ] : IsMulLeftInvariant μ.inv := by
constructor
intro g
conv_rhs => rw [← map_mul_right_eq_self μ g⁻¹]
simp_rw [Measure.inv, map_map (measurable_const_mul g) measurable_inv,
map_map measurable_inv (measurable_mul_const g⁻¹), Function.comp, mul_inv_rev, inv_inv]
@[to_additive]
theorem measurePreserving_div_left (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ]
(g : G) : MeasurePreserving (fun t => g / t) μ μ := by
simp_rw [div_eq_mul_inv]
exact (measurePreserving_mul_left μ g).comp (measurePreserving_inv μ)
@[to_additive]
theorem map_div_left_eq_self (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ] (g : G) :
map (fun t => g / t) μ = μ :=
(measurePreserving_div_left μ g).map_eq
@[to_additive]
theorem measurePreserving_mul_right_inv (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ]
(g : G) : MeasurePreserving (fun t => (g * t)⁻¹) μ μ :=
(measurePreserving_inv μ).comp <| measurePreserving_mul_left μ g
@[to_additive]
theorem map_mul_right_inv_eq_self (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ]
(g : G) : map (fun t => (g * t)⁻¹) μ = μ :=
(measurePreserving_mul_right_inv μ g).map_eq
end DivisionMonoid
section Group
variable [Group G] [MeasurableMul G] [MeasurableInv G] {μ : Measure G}
@[to_additive]
theorem map_div_left_ae (μ : Measure G) [IsMulLeftInvariant μ] [IsInvInvariant μ] (x : G) :
Filter.map (fun t => x / t) (ae μ) = ae μ :=
((MeasurableEquiv.divLeft x).map_ae μ).trans <| congr_arg ae <| map_div_left_eq_self μ x
end Group
end Measure
section TopologicalGroup
variable [TopologicalSpace G] [BorelSpace G] {μ : Measure G} [Group G]
@[to_additive]
instance Measure.IsFiniteMeasureOnCompacts.inv [ContinuousInv G] [IsFiniteMeasureOnCompacts μ] :
IsFiniteMeasureOnCompacts μ.inv :=
IsFiniteMeasureOnCompacts.map μ (Homeomorph.inv G)
@[to_additive]
instance Measure.IsOpenPosMeasure.inv [ContinuousInv G] [IsOpenPosMeasure μ] :
IsOpenPosMeasure μ.inv :=
(Homeomorph.inv G).continuous.isOpenPosMeasure_map (Homeomorph.inv G).surjective
@[to_additive]
instance Measure.Regular.inv [ContinuousInv G] [Regular μ] : Regular μ.inv :=
Regular.map (Homeomorph.inv G)
@[to_additive]
instance Measure.InnerRegular.inv [ContinuousInv G] [InnerRegular μ] : InnerRegular μ.inv :=
InnerRegular.map (Homeomorph.inv G)
/-- The image of an inner regular measure under map of a left action is again inner regular. -/
@[to_additive
"The image of a inner regular measure under map of a left additive action is again
inner regular"]
instance innerRegular_map_smul {α} [Monoid α] [MulAction α G] [ContinuousConstSMul α G]
[InnerRegular μ] (a : α) : InnerRegular (Measure.map (a • · : G → G) μ) :=
InnerRegular.map_of_continuous (continuous_const_smul a)
/-- The image of an inner regular measure under left multiplication is again inner regular. -/
@[to_additive "The image of an inner regular measure under left addition is again inner regular."]
instance innerRegular_map_mul_left [TopologicalGroup G] [InnerRegular μ] (g : G) :
InnerRegular (Measure.map (g * ·) μ) := InnerRegular.map_of_continuous (continuous_mul_left g)
/-- The image of an inner regular measure under right multiplication is again inner regular. -/
@[to_additive "The image of an inner regular measure under right addition is again inner regular."]
instance innerRegular_map_mul_right [TopologicalGroup G] [InnerRegular μ] (g : G) :
InnerRegular (Measure.map (· * g) μ) := InnerRegular.map_of_continuous (continuous_mul_right g)
variable [TopologicalGroup G]
@[to_additive]
theorem regular_inv_iff : μ.inv.Regular ↔ μ.Regular :=
Regular.map_iff (Homeomorph.inv G)
@[to_additive]
theorem innerRegular_inv_iff : μ.inv.InnerRegular ↔ μ.InnerRegular :=
InnerRegular.map_iff (Homeomorph.inv G)
/-- Continuity of the measure of translates of a compact set: Given a compact set `k` in a
topological group, for `g` close enough to the origin, `μ (g • k \ k)` is arbitrarily small. -/
@[to_additive]
lemma eventually_nhds_one_measure_smul_diff_lt [LocallyCompactSpace G]
[IsFiniteMeasureOnCompacts μ] [InnerRegularCompactLTTop μ] {k : Set G}
(hk : IsCompact k) (h'k : IsClosed k) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
∀ᶠ g in 𝓝 (1 : G), μ (g • k \ k) < ε := by
obtain ⟨U, hUk, hU, hμUk⟩ : ∃ (U : Set G), k ⊆ U ∧ IsOpen U ∧ μ U < μ k + ε :=
hk.exists_isOpen_lt_add hε
obtain ⟨V, hV1, hVkU⟩ : ∃ V ∈ 𝓝 (1 : G), V * k ⊆ U := compact_open_separated_mul_left hk hU hUk
filter_upwards [hV1] with g hg
calc
μ (g • k \ k) ≤ μ (U \ k) := by
gcongr
exact (smul_set_subset_smul hg).trans hVkU
_ < ε := measure_diff_lt_of_lt_add h'k.measurableSet hUk hk.measure_lt_top.ne hμUk
/-- Continuity of the measure of translates of a compact set:
Given a closed compact set `k` in a topological group,
the measure of `g • k \ k` tends to zero as `g` tends to `1`. -/
@[to_additive]
lemma tendsto_measure_smul_diff_isCompact_isClosed [LocallyCompactSpace G]
[IsFiniteMeasureOnCompacts μ] [InnerRegularCompactLTTop μ] {k : Set G}
(hk : IsCompact k) (h'k : IsClosed k) :
Tendsto (fun g : G ↦ μ (g • k \ k)) (𝓝 1) (𝓝 0) :=
ENNReal.nhds_zero_basis.tendsto_right_iff.mpr <| fun _ h ↦
eventually_nhds_one_measure_smul_diff_lt hk h'k h.ne'
section IsMulLeftInvariant
variable [IsMulLeftInvariant μ]
/-- If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set. -/
@[to_additive
"If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set."]
theorem isOpenPosMeasure_of_mulLeftInvariant_of_compact (K : Set G) (hK : IsCompact K)
(h : μ K ≠ 0) : IsOpenPosMeasure μ := by
refine ⟨fun U hU hne => ?_⟩
contrapose! h
rw [← nonpos_iff_eq_zero]
rw [← hU.interior_eq] at hne
obtain ⟨t, hKt⟩ : ∃ t : Finset G, K ⊆ ⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U :=
compact_covered_by_mul_left_translates hK hne
calc
μ K ≤ μ (⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U) := measure_mono hKt
_ ≤ ∑ g ∈ t, μ ((fun h : G => g * h) ⁻¹' U) := measure_biUnion_finset_le _ _
_ = 0 := by simp [measure_preimage_mul, h]
/-- A nonzero left-invariant regular measure gives positive mass to any open set. -/
@[to_additive "A nonzero left-invariant regular measure gives positive mass to any open set."]
instance (priority := 80) isOpenPosMeasure_of_mulLeftInvariant_of_regular [Regular μ] [NeZero μ] :
IsOpenPosMeasure μ :=
let ⟨K, hK, h2K⟩ := Regular.exists_compact_not_null.mpr (NeZero.ne μ)
isOpenPosMeasure_of_mulLeftInvariant_of_compact K hK h2K
/-- A nonzero left-invariant inner regular measure gives positive mass to any open set. -/
@[to_additive "A nonzero left-invariant inner regular measure gives positive mass to any open set."]
instance (priority := 80) isOpenPosMeasure_of_mulLeftInvariant_of_innerRegular
[InnerRegular μ] [NeZero μ] :
IsOpenPosMeasure μ :=
let ⟨K, hK, h2K⟩ := InnerRegular.exists_compact_not_null.mpr (NeZero.ne μ)
isOpenPosMeasure_of_mulLeftInvariant_of_compact K hK h2K
@[to_additive]
theorem null_iff_of_isMulLeftInvariant [Regular μ] {s : Set G} (hs : IsOpen s) :
μ s = 0 ↔ s = ∅ ∨ μ = 0 := by
rcases eq_zero_or_neZero μ with rfl|hμ
· simp
· simp only [or_false_iff, hs.measure_eq_zero_iff μ, NeZero.ne μ]
@[to_additive]
theorem measure_ne_zero_iff_nonempty_of_isMulLeftInvariant [Regular μ] (hμ : μ ≠ 0) {s : Set G}
(hs : IsOpen s) : μ s ≠ 0 ↔ s.Nonempty := by
simpa [null_iff_of_isMulLeftInvariant (μ := μ) hs, hμ] using nonempty_iff_ne_empty.symm
@[to_additive]
theorem measure_pos_iff_nonempty_of_isMulLeftInvariant [Regular μ] (h3μ : μ ≠ 0) {s : Set G}
(hs : IsOpen s) : 0 < μ s ↔ s.Nonempty :=
pos_iff_ne_zero.trans <| measure_ne_zero_iff_nonempty_of_isMulLeftInvariant h3μ hs
/-- If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass
to any compact set. -/
@[to_additive
"If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass to
any compact set."]
theorem measure_lt_top_of_isCompact_of_isMulLeftInvariant (U : Set G) (hU : IsOpen U)
(h'U : U.Nonempty) (h : μ U ≠ ∞) {K : Set G} (hK : IsCompact K) : μ K < ∞ := by
rw [← hU.interior_eq] at h'U
obtain ⟨t, hKt⟩ : ∃ t : Finset G, K ⊆ ⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U :=
compact_covered_by_mul_left_translates hK h'U
calc
μ K ≤ μ (⋃ (g : G) (_ : g ∈ t), (fun h : G => g * h) ⁻¹' U) := measure_mono hKt
_ ≤ ∑ g ∈ t, μ ((fun h : G => g * h) ⁻¹' U) := measure_biUnion_finset_le _ _
_ = Finset.card t * μ U := by simp only [measure_preimage_mul, Finset.sum_const, nsmul_eq_mul]
_ < ∞ := ENNReal.mul_lt_top (ENNReal.natCast_ne_top _) h
/-- If a left-invariant measure gives finite mass to a set with nonempty interior, then
it gives finite mass to any compact set. -/
@[to_additive
"If a left-invariant measure gives finite mass to a set with nonempty interior, then it gives finite
mass to any compact set."]
theorem measure_lt_top_of_isCompact_of_isMulLeftInvariant' {U : Set G}
(hU : (interior U).Nonempty) (h : μ U ≠ ∞) {K : Set G} (hK : IsCompact K) : μ K < ∞ :=
measure_lt_top_of_isCompact_of_isMulLeftInvariant (interior U) isOpen_interior hU
((measure_mono interior_subset).trans_lt (lt_top_iff_ne_top.2 h)).ne hK
/-- In a noncompact locally compact group, a left-invariant measure which is positive
on open sets has infinite mass. -/
@[to_additive (attr := simp)
"In a noncompact locally compact additive group, a left-invariant measure which is positive on open
sets has infinite mass."]
theorem measure_univ_of_isMulLeftInvariant [WeaklyLocallyCompactSpace G] [NoncompactSpace G]
(μ : Measure G) [IsOpenPosMeasure μ] [μ.IsMulLeftInvariant] : μ univ = ∞ := by
/- Consider a closed compact set `K` with nonempty interior. For any compact set `L`, one may
find `g = g (L)` such that `L` is disjoint from `g • K`. Iterating this, one finds
infinitely many translates of `K` which are disjoint from each other. As they all have the
same positive mass, it follows that the space has infinite measure. -/
obtain ⟨K, K1, hK, Kclosed⟩ : ∃ K ∈ 𝓝 (1 : G), IsCompact K ∧ IsClosed K :=
exists_mem_nhds_isCompact_isClosed 1
have K_pos : 0 < μ K := measure_pos_of_mem_nhds μ K1
have A : ∀ L : Set G, IsCompact L → ∃ g : G, Disjoint L (g • K) := fun L hL =>
exists_disjoint_smul_of_isCompact hL hK
choose! g hg using A
set L : ℕ → Set G := fun n => (fun T => T ∪ g T • K)^[n] K
have Lcompact : ∀ n, IsCompact (L n) := by
intro n
induction' n with n IH
· exact hK
· simp_rw [L, iterate_succ']
apply IsCompact.union IH (hK.smul (g (L n)))
have Lclosed : ∀ n, IsClosed (L n) := by
intro n
induction' n with n IH
· exact Kclosed
· simp_rw [L, iterate_succ']
apply IsClosed.union IH (Kclosed.smul (g (L n)))
have M : ∀ n, μ (L n) = (n + 1 : ℕ) * μ K := by
intro n
induction' n with n IH
· simp only [L, one_mul, Nat.cast_one, iterate_zero, id, Nat.zero_eq, Nat.zero_add]
· calc
μ (L (n + 1)) = μ (L n) + μ (g (L n) • K) := by
simp_rw [L, iterate_succ']
exact measure_union' (hg _ (Lcompact _)) (Lclosed _).measurableSet
_ = (n + 1 + 1 : ℕ) * μ K := by
simp only [IH, measure_smul, add_mul, Nat.cast_add, Nat.cast_one, one_mul]
have N : Tendsto (fun n => μ (L n)) atTop (𝓝 (∞ * μ K)) := by
simp_rw [M]
apply ENNReal.Tendsto.mul_const _ (Or.inl ENNReal.top_ne_zero)
exact ENNReal.tendsto_nat_nhds_top.comp (tendsto_add_atTop_nat _)
simp only [ENNReal.top_mul', K_pos.ne', if_false] at N
apply top_le_iff.1
exact le_of_tendsto' N fun n => measure_mono (subset_univ _)
@[to_additive]
lemma _root_.MeasurableSet.mul_closure_one_eq {s : Set G} (hs : MeasurableSet s) :
s * (closure {1} : Set G) = s := by
apply MeasurableSet.induction_on_open (C := fun t ↦ t • (closure {1} : Set G) = t) ?_ ?_ ?_ hs
· intro U hU
exact hU.mul_closure_one_eq
· rintro t - ht
exact compl_mul_closure_one_eq_iff.2 ht
· rintro f - - h''f
simp only [iUnion_smul, h''f]
/-- If a compact set is included in a measurable set, then so is its closure. -/
@[to_additive (attr := deprecated IsCompact.closure_subset_measurableSet (since := "2024-01-28"))]
lemma _root_.IsCompact.closure_subset_of_measurableSet_of_group {k s : Set G}
(hk : IsCompact k) (hs : MeasurableSet s) (h : k ⊆ s) : closure k ⊆ s :=
hk.closure_subset_measurableSet hs h
@[to_additive (attr := simp)]
lemma measure_mul_closure_one (s : Set G) (μ : Measure G) :
μ (s * (closure {1} : Set G)) = μ s := by
apply le_antisymm ?_ (measure_mono (subset_mul_closure_one s))
conv_rhs => rw [measure_eq_iInf]
simp only [le_iInf_iff]
intro t kt t_meas
apply measure_mono
rw [← t_meas.mul_closure_one_eq]
exact smul_subset_smul_right kt
@[to_additive (attr := deprecated IsCompact.measure_closure (since := "2024-01-28"))]
lemma _root_.IsCompact.measure_closure_eq_of_group {k : Set G} (hk : IsCompact k) (μ : Measure G) :
μ (closure k) = μ k :=
hk.measure_closure μ
end IsMulLeftInvariant
@[to_additive]
lemma innerRegularWRT_isCompact_isClosed_measure_ne_top_of_group [h : InnerRegularCompactLTTop μ] :
InnerRegularWRT μ (fun s ↦ IsCompact s ∧ IsClosed s) (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞) := by
intro s ⟨s_meas, μs⟩ r hr
rcases h.innerRegular ⟨s_meas, μs⟩ r hr with ⟨K, Ks, K_comp, hK⟩
refine ⟨closure K, ?_, ⟨K_comp.closure, isClosed_closure⟩, ?_⟩
· exact IsCompact.closure_subset_measurableSet K_comp s_meas Ks
· rwa [K_comp.measure_closure]
end TopologicalGroup
section CommSemigroup
variable [CommSemigroup G]
/-- In an abelian group every left invariant measure is also right-invariant.
We don't declare the converse as an instance, since that would loop type-class inference, and
we use `IsMulLeftInvariant` as the default hypothesis in abelian groups. -/
@[to_additive IsAddLeftInvariant.isAddRightInvariant
"In an abelian additive group every left invariant measure is also right-invariant. We don't declare
the converse as an instance, since that would loop type-class inference, and we use
`IsAddLeftInvariant` as the default hypothesis in abelian groups."]
instance (priority := 100) IsMulLeftInvariant.isMulRightInvariant {μ : Measure G}
[IsMulLeftInvariant μ] : IsMulRightInvariant μ :=
⟨fun g => by simp_rw [mul_comm, map_mul_left_eq_self]⟩
end CommSemigroup
section Haar
namespace Measure
/-- A measure on an additive group is an additive Haar measure if it is left-invariant, and
gives finite mass to compact sets and positive mass to open sets.
Textbooks generally require an additional regularity assumption to ensure nice behavior on
arbitrary locally compact groups. Use `[IsAddHaarMeasure μ] [Regular μ]` or
`[IsAddHaarMeasure μ] [InnerRegular μ]` in these situations. Note that a Haar measure in our
sense is automatically regular and inner regular on second countable locally compact groups, as
checked just below this definition. -/
class IsAddHaarMeasure {G : Type*} [AddGroup G] [TopologicalSpace G] [MeasurableSpace G]
(μ : Measure G) extends IsFiniteMeasureOnCompacts μ, IsAddLeftInvariant μ, IsOpenPosMeasure μ :
Prop
/-- A measure on a group is a Haar measure if it is left-invariant, and gives finite mass to
compact sets and positive mass to open sets.
Textbooks generally require an additional regularity assumption to ensure nice behavior on
arbitrary locally compact groups. Use `[IsHaarMeasure μ] [Regular μ]` or
`[IsHaarMeasure μ] [InnerRegular μ]` in these situations. Note that a Haar measure in our
sense is automatically regular and inner regular on second countable locally compact groups, as
checked just below this definition. -/
@[to_additive existing]
class IsHaarMeasure {G : Type*} [Group G] [TopologicalSpace G] [MeasurableSpace G]
(μ : Measure G) extends IsFiniteMeasureOnCompacts μ, IsMulLeftInvariant μ, IsOpenPosMeasure μ :
Prop
variable [Group G] [TopologicalSpace G] (μ : Measure G) [IsHaarMeasure μ]
@[to_additive (attr := simp)]
theorem haar_singleton [TopologicalGroup G] [BorelSpace G] (g : G) : μ {g} = μ {(1 : G)} := by
convert measure_preimage_mul μ g⁻¹ _
simp only [mul_one, preimage_mul_left_singleton, inv_inv]
@[to_additive IsAddHaarMeasure.smul]
theorem IsHaarMeasure.smul {c : ℝ≥0∞} (cpos : c ≠ 0) (ctop : c ≠ ∞) : IsHaarMeasure (c • μ) :=
{ lt_top_of_isCompact := fun _K hK => ENNReal.mul_lt_top ctop hK.measure_lt_top.ne
toIsOpenPosMeasure := isOpenPosMeasure_smul μ cpos }
/-- If a left-invariant measure gives positive mass to some compact set with nonempty interior, then
it is a Haar measure. -/
@[to_additive
"If a left-invariant measure gives positive mass to some compact set with nonempty interior, then
it is an additive Haar measure."]
theorem isHaarMeasure_of_isCompact_nonempty_interior [TopologicalGroup G] [BorelSpace G]
(μ : Measure G) [IsMulLeftInvariant μ] (K : Set G) (hK : IsCompact K)
(h'K : (interior K).Nonempty) (h : μ K ≠ 0) (h' : μ K ≠ ∞) : IsHaarMeasure μ :=
{ lt_top_of_isCompact := fun _L hL =>
measure_lt_top_of_isCompact_of_isMulLeftInvariant' h'K h' hL
toIsOpenPosMeasure := isOpenPosMeasure_of_mulLeftInvariant_of_compact K hK h }
/-- The image of a Haar measure under a continuous surjective proper group homomorphism is again
a Haar measure. See also `MulEquiv.isHaarMeasure_map`. -/
@[to_additive
"The image of an additive Haar measure under a continuous surjective proper additive group
homomorphism is again an additive Haar measure. See also `AddEquiv.isAddHaarMeasure_map`."]
theorem isHaarMeasure_map [BorelSpace G] [TopologicalGroup G] {H : Type*} [Group H]
[TopologicalSpace H] [MeasurableSpace H] [BorelSpace H] [T2Space H] [TopologicalGroup H]
(f : G →* H) (hf : Continuous f) (h_surj : Surjective f)
(h_prop : Tendsto f (cocompact G) (cocompact H)) : IsHaarMeasure (Measure.map f μ) :=
{ toIsMulLeftInvariant := isMulLeftInvariant_map f.toMulHom hf.measurable h_surj
lt_top_of_isCompact := by
intro K hK
rw [map_apply hf.measurable hK.measurableSet]
exact IsCompact.measure_lt_top ((⟨⟨f, hf⟩, h_prop⟩ : CocompactMap G H).isCompact_preimage hK)
toIsOpenPosMeasure := hf.isOpenPosMeasure_map h_surj }
/-- The image of a finite Haar measure under a continuous surjective group homomorphism is again
a Haar measure. See also `isHaarMeasure_map`. -/
@[to_additive
"The image of a finite additive Haar measure under a continuous surjective additive group
homomorphism is again an additive Haar measure. See also `isAddHaarMeasure_map`."]
theorem isHaarMeasure_map_of_isFiniteMeasure
[BorelSpace G] [TopologicalGroup G] {H : Type*} [Group H]
[TopologicalSpace H] [MeasurableSpace H] [BorelSpace H] [TopologicalGroup H] [IsFiniteMeasure μ]
(f : G →* H) (hf : Continuous f) (h_surj : Surjective f) :
IsHaarMeasure (Measure.map f μ) :=
{ toIsMulLeftInvariant := isMulLeftInvariant_map f.toMulHom hf.measurable h_surj
lt_top_of_isCompact := fun _K hK ↦ hK.measure_lt_top
toIsOpenPosMeasure := hf.isOpenPosMeasure_map h_surj }
/-- The image of a Haar measure under map of a left action is again a Haar measure. -/
@[to_additive
"The image of a Haar measure under map of a left additive action is again a Haar measure"]
instance isHaarMeasure_map_smul {α} [BorelSpace G] [TopologicalGroup G]
[Group α] [MulAction α G] [SMulCommClass α G G] [MeasurableSpace α] [MeasurableSMul α G]
[ContinuousConstSMul α G] (a : α) : IsHaarMeasure (Measure.map (a • · : G → G) μ) where
toIsMulLeftInvariant := isMulLeftInvariant_map_smul _
lt_top_of_isCompact K hK := by
let F := (Homeomorph.smul a (α := G)).toMeasurableEquiv
change map F μ K < ∞
rw [F.map_apply K]
exact IsCompact.measure_lt_top <| (Homeomorph.isCompact_preimage (Homeomorph.smul a)).2 hK
toIsOpenPosMeasure :=
(continuous_const_smul a).isOpenPosMeasure_map (MulAction.surjective a)
/-- The image of a Haar measure under right multiplication is again a Haar measure. -/
@[to_additive isHaarMeasure_map_add_right
"The image of a Haar measure under right addition is again a Haar measure."]
instance isHaarMeasure_map_mul_right [BorelSpace G] [TopologicalGroup G] (g : G) :
IsHaarMeasure (Measure.map (· * g) μ) :=
isHaarMeasure_map_smul μ (MulOpposite.op g)
/-- A convenience wrapper for `MeasureTheory.Measure.isHaarMeasure_map`. -/
@[to_additive "A convenience wrapper for `MeasureTheory.Measure.isAddHaarMeasure_map`."]
nonrec theorem _root_.MulEquiv.isHaarMeasure_map [BorelSpace G] [TopologicalGroup G] {H : Type*}
[Group H] [TopologicalSpace H] [MeasurableSpace H] [BorelSpace H]
[TopologicalGroup H] (e : G ≃* H) (he : Continuous e) (hesymm : Continuous e.symm) :
IsHaarMeasure (Measure.map e μ) :=
{ toIsMulLeftInvariant := isMulLeftInvariant_map e.toMulHom he.measurable e.surjective
lt_top_of_isCompact := by
intro K hK
let F : G ≃ₜ H := {
e.toEquiv with
continuous_toFun := he
continuous_invFun := hesymm }
change map F.toMeasurableEquiv μ K < ∞
rw [F.toMeasurableEquiv.map_apply K]
exact (F.isCompact_preimage.mpr hK).measure_lt_top
toIsOpenPosMeasure := he.isOpenPosMeasure_map e.surjective }
/-- A convenience wrapper for MeasureTheory.Measure.isAddHaarMeasure_map`. -/
theorem _root_.ContinuousLinearEquiv.isAddHaarMeasure_map
{E F R S : Type*} [Semiring R] [Semiring S]
[AddCommGroup E] [Module R E] [AddCommGroup F] [Module S F]
[TopologicalSpace E] [TopologicalAddGroup E] [TopologicalSpace F]
[TopologicalAddGroup F]
{σ : R →+* S} {σ' : S →+* R} [RingHomInvPair σ σ'] [RingHomInvPair σ' σ]
[MeasurableSpace E] [BorelSpace E] [MeasurableSpace F] [BorelSpace F]
(L : E ≃SL[σ] F) (μ : Measure E) [IsAddHaarMeasure μ] :
IsAddHaarMeasure (μ.map L) :=
AddEquiv.isAddHaarMeasure_map _ (L : E ≃+ F) L.continuous L.symm.continuous
/-- A Haar measure on a σ-compact space is σ-finite.
See Note [lower instance priority] -/
@[to_additive
"A Haar measure on a σ-compact space is σ-finite.
See Note [lower instance priority]"]
instance (priority := 100) IsHaarMeasure.sigmaFinite [SigmaCompactSpace G] : SigmaFinite μ :=
⟨⟨{ set := compactCovering G
set_mem := fun _ => mem_univ _
finite := fun n => IsCompact.measure_lt_top <| isCompact_compactCovering G n
spanning := iUnion_compactCovering G }⟩⟩
@[to_additive]
instance prod.instIsHaarMeasure {G : Type*} [Group G] [TopologicalSpace G] {_ : MeasurableSpace G}
{H : Type*} [Group H] [TopologicalSpace H] {_ : MeasurableSpace H} (μ : Measure G)
(ν : Measure H) [IsHaarMeasure μ] [IsHaarMeasure ν] [SFinite μ] [SFinite ν]
[MeasurableMul G] [MeasurableMul H] : IsHaarMeasure (μ.prod ν) where
/-- If the neutral element of a group is not isolated, then a Haar measure on this group has
no atoms.
The additive version of this instance applies in particular to show that an additive Haar
measure on a nontrivial finite-dimensional real vector space has no atom. -/
@[to_additive
"If the zero element of an additive group is not isolated, then an additive Haar measure on this
group has no atoms.
This applies in particular to show that an additive Haar measure on a nontrivial
finite-dimensional real vector space has no atom."]
instance (priority := 100) IsHaarMeasure.noAtoms [TopologicalGroup G] [BorelSpace G] [T1Space G]
[WeaklyLocallyCompactSpace G] [(𝓝[≠] (1 : G)).NeBot] (μ : Measure G) [μ.IsHaarMeasure] :
NoAtoms μ := by
cases eq_or_ne (μ 1) 0 with
| inl h => constructor; simpa
| inr h =>
obtain ⟨K, K_compact, K_nhds⟩ : ∃ K : Set G, IsCompact K ∧ K ∈ 𝓝 1 := exists_compact_mem_nhds 1
have K_inf : Set.Infinite K := infinite_of_mem_nhds (1 : G) K_nhds
exact absurd (K_inf.meas_eq_top ⟨_, h, fun x _ ↦ (haar_singleton _ _).ge⟩)
K_compact.measure_lt_top.ne
end Measure
end Haar
end MeasureTheory
|
MeasureTheory\Group\Pointwise.lean | /-
Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury G. Kudryashov, Alex J. Best
-/
import Mathlib.MeasureTheory.Group.Arithmetic
/-!
# Pointwise set operations on `MeasurableSet`s
In this file we prove several versions of the following fact: if `s` is a measurable set, then so is
`a • s`. Note that the pointwise product of two measurable sets need not be measurable, so there is
no `MeasurableSet.mul` etc.
-/
open Pointwise
open Set
@[to_additive]
theorem MeasurableSet.const_smul {G α : Type*} [Group G] [MulAction G α] [MeasurableSpace G]
[MeasurableSpace α] [MeasurableSMul G α] {s : Set α} (hs : MeasurableSet s) (a : G) :
MeasurableSet (a • s) := by
rw [← preimage_smul_inv]
exact measurable_const_smul _ hs
theorem MeasurableSet.const_smul_of_ne_zero {G₀ α : Type*} [GroupWithZero G₀] [MulAction G₀ α]
[MeasurableSpace G₀] [MeasurableSpace α] [MeasurableSMul G₀ α] {s : Set α}
(hs : MeasurableSet s) {a : G₀} (ha : a ≠ 0) : MeasurableSet (a • s) := by
rw [← preimage_smul_inv₀ ha]
exact measurable_const_smul _ hs
theorem MeasurableSet.const_smul₀ {G₀ α : Type*} [GroupWithZero G₀] [Zero α]
[MulActionWithZero G₀ α] [MeasurableSpace G₀] [MeasurableSpace α] [MeasurableSMul G₀ α]
[MeasurableSingletonClass α] {s : Set α} (hs : MeasurableSet s) (a : G₀) :
MeasurableSet (a • s) := by
rcases eq_or_ne a 0 with (rfl | ha)
exacts [(subsingleton_zero_smul_set s).measurableSet, hs.const_smul_of_ne_zero ha]
|
MeasureTheory\Group\Prod.lean | /-
Copyright (c) 2021 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn
-/
import Mathlib.MeasureTheory.Constructions.Prod.Basic
import Mathlib.MeasureTheory.Group.Measure
/-!
# Measure theory in the product of groups
In this file we show properties about measure theory in products of measurable groups
and properties of iterated integrals in measurable groups.
These lemmas show the uniqueness of left invariant measures on measurable groups, up to
scaling. In this file we follow the proof and refer to the book *Measure Theory* by Paul Halmos.
The idea of the proof is to use the translation invariance of measures to prove `μ(t) = c * μ(s)`
for two sets `s` and `t`, where `c` is a constant that does not depend on `μ`. Let `e` and `f` be
the characteristic functions of `s` and `t`.
Assume that `μ` and `ν` are left-invariant measures. Then the map `(x, y) ↦ (y * x, x⁻¹)`
preserves the measure `μ × ν`, which means that
```
∫ x, ∫ y, h x y ∂ν ∂μ = ∫ x, ∫ y, h (y * x) x⁻¹ ∂ν ∂μ
```
If we apply this to `h x y := e x * f y⁻¹ / ν ((fun h ↦ h * y⁻¹) ⁻¹' s)`, we can rewrite the RHS to
`μ(t)`, and the LHS to `c * μ(s)`, where `c = c(ν)` does not depend on `μ`.
Applying this to `μ` and to `ν` gives `μ (t) / μ (s) = ν (t) / ν (s)`, which is the uniqueness up to
scalar multiplication.
The proof in [Halmos] seems to contain an omission in §60 Th. A, see
`MeasureTheory.measure_lintegral_div_measure`.
Note that this theory only applies in measurable groups, i.e., when multiplication and inversion
are measurable. This is not the case in general in locally compact groups, or even in compact
groups, when the topology is not second-countable. For arguments along the same line, but using
continuous functions instead of measurable sets and working in the general locally compact
setting, see the file `MeasureTheory.Measure.Haar.Unique.lean`.
-/
noncomputable section
open Set hiding prod_eq
open Function MeasureTheory
open Filter hiding map
open scoped ENNReal Pointwise MeasureTheory
variable (G : Type*) [MeasurableSpace G]
variable [Group G] [MeasurableMul₂ G]
variable (μ ν : Measure G) [SFinite ν] [SFinite μ] {s : Set G}
/-- The map `(x, y) ↦ (x, xy)` as a `MeasurableEquiv`. -/
@[to_additive "The map `(x, y) ↦ (x, x + y)` as a `MeasurableEquiv`."]
protected def MeasurableEquiv.shearMulRight [MeasurableInv G] : G × G ≃ᵐ G × G :=
{ Equiv.prodShear (Equiv.refl _) Equiv.mulLeft with
measurable_toFun := measurable_fst.prod_mk measurable_mul
measurable_invFun := measurable_fst.prod_mk <| measurable_fst.inv.mul measurable_snd }
/-- The map `(x, y) ↦ (x, y / x)` as a `MeasurableEquiv` with as inverse `(x, y) ↦ (x, yx)` -/
@[to_additive
"The map `(x, y) ↦ (x, y - x)` as a `MeasurableEquiv` with as inverse `(x, y) ↦ (x, y + x)`."]
protected def MeasurableEquiv.shearDivRight [MeasurableInv G] : G × G ≃ᵐ G × G :=
{ Equiv.prodShear (Equiv.refl _) Equiv.divRight with
measurable_toFun := measurable_fst.prod_mk <| measurable_snd.div measurable_fst
measurable_invFun := measurable_fst.prod_mk <| measurable_snd.mul measurable_fst }
variable {G}
namespace MeasureTheory
open Measure
section LeftInvariant
/-- The multiplicative shear mapping `(x, y) ↦ (x, xy)` preserves the measure `μ × ν`.
This condition is part of the definition of a measurable group in [Halmos, §59].
There, the map in this lemma is called `S`. -/
@[to_additive measurePreserving_prod_add
" The shear mapping `(x, y) ↦ (x, x + y)` preserves the measure `μ × ν`. "]
theorem measurePreserving_prod_mul [IsMulLeftInvariant ν] :
MeasurePreserving (fun z : G × G => (z.1, z.1 * z.2)) (μ.prod ν) (μ.prod ν) :=
(MeasurePreserving.id μ).skew_product measurable_mul <|
Filter.eventually_of_forall <| map_mul_left_eq_self ν
/-- The map `(x, y) ↦ (y, yx)` sends the measure `μ × ν` to `ν × μ`.
This is the map `SR` in [Halmos, §59].
`S` is the map `(x, y) ↦ (x, xy)` and `R` is `Prod.swap`. -/
@[to_additive measurePreserving_prod_add_swap
" The map `(x, y) ↦ (y, y + x)` sends the measure `μ × ν` to `ν × μ`. "]
theorem measurePreserving_prod_mul_swap [IsMulLeftInvariant μ] :
MeasurePreserving (fun z : G × G => (z.2, z.2 * z.1)) (μ.prod ν) (ν.prod μ) :=
(measurePreserving_prod_mul ν μ).comp measurePreserving_swap
@[to_additive]
theorem measurable_measure_mul_right (hs : MeasurableSet s) :
Measurable fun x => μ ((fun y => y * x) ⁻¹' s) := by
suffices
Measurable fun y =>
μ ((fun x => (x, y)) ⁻¹' ((fun z : G × G => ((1 : G), z.1 * z.2)) ⁻¹' univ ×ˢ s))
by convert this using 1; ext1 x; congr 1 with y : 1; simp
apply measurable_measure_prod_mk_right
apply measurable_const.prod_mk measurable_mul (MeasurableSet.univ.prod hs)
infer_instance
variable [MeasurableInv G]
/-- The map `(x, y) ↦ (x, x⁻¹y)` is measure-preserving.
This is the function `S⁻¹` in [Halmos, §59],
where `S` is the map `(x, y) ↦ (x, xy)`. -/
@[to_additive measurePreserving_prod_neg_add
"The map `(x, y) ↦ (x, - x + y)` is measure-preserving."]
theorem measurePreserving_prod_inv_mul [IsMulLeftInvariant ν] :
MeasurePreserving (fun z : G × G => (z.1, z.1⁻¹ * z.2)) (μ.prod ν) (μ.prod ν) :=
(measurePreserving_prod_mul μ ν).symm <| MeasurableEquiv.shearMulRight G
variable [IsMulLeftInvariant μ]
/-- The map `(x, y) ↦ (y, y⁻¹x)` sends `μ × ν` to `ν × μ`.
This is the function `S⁻¹R` in [Halmos, §59],
where `S` is the map `(x, y) ↦ (x, xy)` and `R` is `Prod.swap`. -/
@[to_additive measurePreserving_prod_neg_add_swap
"The map `(x, y) ↦ (y, - y + x)` sends `μ × ν` to `ν × μ`."]
theorem measurePreserving_prod_inv_mul_swap :
MeasurePreserving (fun z : G × G => (z.2, z.2⁻¹ * z.1)) (μ.prod ν) (ν.prod μ) :=
(measurePreserving_prod_inv_mul ν μ).comp measurePreserving_swap
/-- The map `(x, y) ↦ (yx, x⁻¹)` is measure-preserving.
This is the function `S⁻¹RSR` in [Halmos, §59],
where `S` is the map `(x, y) ↦ (x, xy)` and `R` is `Prod.swap`. -/
@[to_additive measurePreserving_add_prod_neg
"The map `(x, y) ↦ (y + x, - x)` is measure-preserving."]
theorem measurePreserving_mul_prod_inv [IsMulLeftInvariant ν] :
MeasurePreserving (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod ν) (μ.prod ν) := by
convert (measurePreserving_prod_inv_mul_swap ν μ).comp (measurePreserving_prod_mul_swap μ ν)
using 1
ext1 ⟨x, y⟩
simp_rw [Function.comp_apply, mul_inv_rev, inv_mul_cancel_right]
@[to_additive]
theorem quasiMeasurePreserving_inv : QuasiMeasurePreserving (Inv.inv : G → G) μ μ := by
refine ⟨measurable_inv, AbsolutelyContinuous.mk fun s hsm hμs => ?_⟩
rw [map_apply measurable_inv hsm, inv_preimage]
have hf : Measurable fun z : G × G => (z.2 * z.1, z.1⁻¹) :=
(measurable_snd.mul measurable_fst).prod_mk measurable_fst.inv
suffices map (fun z : G × G => (z.2 * z.1, z.1⁻¹)) (μ.prod μ) (s⁻¹ ×ˢ s⁻¹) = 0 by
simpa only [(measurePreserving_mul_prod_inv μ μ).map_eq, prod_prod, mul_eq_zero (M₀ := ℝ≥0∞),
or_self_iff] using this
have hsm' : MeasurableSet (s⁻¹ ×ˢ s⁻¹) := hsm.inv.prod hsm.inv
simp_rw [map_apply hf hsm', prod_apply_symm (μ := μ) (ν := μ) (hf hsm'), preimage_preimage,
mk_preimage_prod, inv_preimage, inv_inv, measure_mono_null inter_subset_right hμs,
lintegral_zero]
@[to_additive (attr := simp)]
theorem measure_inv_null : μ s⁻¹ = 0 ↔ μ s = 0 := by
refine ⟨fun hs => ?_, (quasiMeasurePreserving_inv μ).preimage_null⟩
rw [← inv_inv s]
exact (quasiMeasurePreserving_inv μ).preimage_null hs
@[to_additive (attr := simp)]
theorem inv_ae : (ae μ)⁻¹ = ae μ := by
refine le_antisymm (quasiMeasurePreserving_inv μ).tendsto_ae ?_
nth_rewrite 1 [← inv_inv (ae μ)]
exact Filter.map_mono (quasiMeasurePreserving_inv μ).tendsto_ae
@[to_additive (attr := simp)]
theorem eventuallyConst_inv_set_ae :
EventuallyConst (s⁻¹ : Set G) (ae μ) ↔ EventuallyConst s (ae μ) := by
rw [← inv_preimage, eventuallyConst_preimage, Filter.map_inv, inv_ae]
@[to_additive]
theorem inv_absolutelyContinuous : μ.inv ≪ μ :=
(quasiMeasurePreserving_inv μ).absolutelyContinuous
@[to_additive]
theorem absolutelyContinuous_inv : μ ≪ μ.inv := by
refine AbsolutelyContinuous.mk fun s _ => ?_
simp_rw [inv_apply μ s, measure_inv_null, imp_self]
@[to_additive]
theorem lintegral_lintegral_mul_inv [IsMulLeftInvariant ν] (f : G → G → ℝ≥0∞)
(hf : AEMeasurable (uncurry f) (μ.prod ν)) :
(∫⁻ x, ∫⁻ y, f (y * x) x⁻¹ ∂ν ∂μ) = ∫⁻ x, ∫⁻ y, f x y ∂ν ∂μ := by
have h : Measurable fun z : G × G => (z.2 * z.1, z.1⁻¹) :=
(measurable_snd.mul measurable_fst).prod_mk measurable_fst.inv
have h2f : AEMeasurable (uncurry fun x y => f (y * x) x⁻¹) (μ.prod ν) :=
hf.comp_quasiMeasurePreserving (measurePreserving_mul_prod_inv μ ν).quasiMeasurePreserving
simp_rw [lintegral_lintegral h2f, lintegral_lintegral hf]
conv_rhs => rw [← (measurePreserving_mul_prod_inv μ ν).map_eq]
symm
exact
lintegral_map' (hf.mono' (measurePreserving_mul_prod_inv μ ν).map_eq.absolutelyContinuous)
h.aemeasurable
@[to_additive]
theorem measure_mul_right_null (y : G) : μ ((fun x => x * y) ⁻¹' s) = 0 ↔ μ s = 0 :=
calc
μ ((fun x => x * y) ⁻¹' s) = 0 ↔ μ ((fun x => y⁻¹ * x) ⁻¹' s⁻¹)⁻¹ = 0 := by
simp_rw [← inv_preimage, preimage_preimage, mul_inv_rev, inv_inv]
_ ↔ μ s = 0 := by simp only [measure_inv_null μ, measure_preimage_mul]
@[to_additive]
theorem measure_mul_right_ne_zero (h2s : μ s ≠ 0) (y : G) : μ ((fun x => x * y) ⁻¹' s) ≠ 0 :=
(not_congr (measure_mul_right_null μ y)).mpr h2s
@[to_additive]
theorem absolutelyContinuous_map_mul_right (g : G) : μ ≪ map (· * g) μ := by
refine AbsolutelyContinuous.mk fun s hs => ?_
rw [map_apply (measurable_mul_const g) hs, measure_mul_right_null]; exact id
@[to_additive]
theorem absolutelyContinuous_map_div_left (g : G) : μ ≪ map (fun h => g / h) μ := by
simp_rw [div_eq_mul_inv]
erw [← map_map (measurable_const_mul g) measurable_inv]
conv_lhs => rw [← map_mul_left_eq_self μ g]
exact (absolutelyContinuous_inv μ).map (measurable_const_mul g)
/-- This is the computation performed in the proof of [Halmos, §60 Th. A]. -/
@[to_additive "This is the computation performed in the proof of [Halmos, §60 Th. A]."]
theorem measure_mul_lintegral_eq [IsMulLeftInvariant ν] (sm : MeasurableSet s) (f : G → ℝ≥0∞)
(hf : Measurable f) : (μ s * ∫⁻ y, f y ∂ν) = ∫⁻ x, ν ((fun z => z * x) ⁻¹' s) * f x⁻¹ ∂μ := by
rw [← setLIntegral_one, ← lintegral_indicator _ sm,
← lintegral_lintegral_mul (measurable_const.indicator sm).aemeasurable hf.aemeasurable,
← lintegral_lintegral_mul_inv μ ν]
swap
· exact (((measurable_const.indicator sm).comp measurable_fst).mul
(hf.comp measurable_snd)).aemeasurable
have ms :
∀ x : G, Measurable fun y => ((fun z => z * x) ⁻¹' s).indicator (fun _ => (1 : ℝ≥0∞)) y :=
fun x => measurable_const.indicator (measurable_mul_const _ sm)
have : ∀ x y, s.indicator (fun _ : G => (1 : ℝ≥0∞)) (y * x) =
((fun z => z * x) ⁻¹' s).indicator (fun b : G => 1) y := by
intro x y; symm; convert indicator_comp_right (M := ℝ≥0∞) fun y => y * x using 2; ext1; rfl
simp_rw [this, lintegral_mul_const _ (ms _), lintegral_indicator _ (measurable_mul_const _ sm),
setLIntegral_one]
/-- Any two nonzero left-invariant measures are absolutely continuous w.r.t. each other. -/
@[to_additive
" Any two nonzero left-invariant measures are absolutely continuous w.r.t. each other. "]
theorem absolutelyContinuous_of_isMulLeftInvariant [IsMulLeftInvariant ν] (hν : ν ≠ 0) : μ ≪ ν := by
refine AbsolutelyContinuous.mk fun s sm hνs => ?_
have h1 := measure_mul_lintegral_eq μ ν sm 1 measurable_one
simp_rw [Pi.one_apply, lintegral_one, mul_one, (measure_mul_right_null ν _).mpr hνs,
lintegral_zero, mul_eq_zero (M₀ := ℝ≥0∞), measure_univ_eq_zero.not.mpr hν, or_false_iff] at h1
exact h1
section SigmaFinite
variable (μ' ν' : Measure G) [SigmaFinite μ'] [SigmaFinite ν'] [IsMulLeftInvariant μ']
[IsMulLeftInvariant ν']
@[to_additive]
theorem ae_measure_preimage_mul_right_lt_top (hμs : μ' s ≠ ∞) :
∀ᵐ x ∂μ', ν' ((· * x) ⁻¹' s) < ∞ := by
wlog sm : MeasurableSet s generalizing s
· filter_upwards [this ((measure_toMeasurable _).trans_ne hμs) (measurableSet_toMeasurable ..)]
with x hx using lt_of_le_of_lt (by gcongr; apply subset_toMeasurable) hx
refine ae_of_forall_measure_lt_top_ae_restrict' ν'.inv _ ?_
intro A hA _ h3A
simp only [ν'.inv_apply] at h3A
apply ae_lt_top (measurable_measure_mul_right ν' sm)
have h1 := measure_mul_lintegral_eq μ' ν' sm (A⁻¹.indicator 1) (measurable_one.indicator hA.inv)
rw [lintegral_indicator _ hA.inv] at h1
simp_rw [Pi.one_apply, setLIntegral_one, ← image_inv, indicator_image inv_injective, image_inv,
← indicator_mul_right _ fun x => ν' ((fun y => y * x) ⁻¹' s), Function.comp, Pi.one_apply,
mul_one] at h1
rw [← lintegral_indicator _ hA, ← h1]
exact ENNReal.mul_ne_top hμs h3A.ne
@[to_additive]
theorem ae_measure_preimage_mul_right_lt_top_of_ne_zero (h2s : ν' s ≠ 0) (h3s : ν' s ≠ ∞) :
∀ᵐ x ∂μ', ν' ((fun y => y * x) ⁻¹' s) < ∞ := by
refine (ae_measure_preimage_mul_right_lt_top ν' ν' h3s).filter_mono ?_
refine (absolutelyContinuous_of_isMulLeftInvariant μ' ν' ?_).ae_le
refine mt ?_ h2s
intro hν
rw [hν, Measure.coe_zero, Pi.zero_apply]
/-- A technical lemma relating two different measures. This is basically [Halmos, §60 Th. A].
Note that if `f` is the characteristic function of a measurable set `t` this states that
`μ t = c * μ s` for a constant `c` that does not depend on `μ`.
Note: There is a gap in the last step of the proof in [Halmos].
In the last line, the equality `g(x⁻¹)ν(sx⁻¹) = f(x)` holds if we can prove that
`0 < ν(sx⁻¹) < ∞`. The first inequality follows from §59, Th. D, but the second inequality is
not justified. We prove this inequality for almost all `x` in
`MeasureTheory.ae_measure_preimage_mul_right_lt_top_of_ne_zero`. -/
@[to_additive
"A technical lemma relating two different measures. This is basically [Halmos, §60 Th. A]. Note that
if `f` is the characteristic function of a measurable set `t` this states that `μ t = c * μ s` for a
constant `c` that does not depend on `μ`.
Note: There is a gap in the last step of the proof in [Halmos]. In the last line, the equality
`g(-x) + ν(s - x) = f(x)` holds if we can prove that `0 < ν(s - x) < ∞`. The first inequality
follows from §59, Th. D, but the second inequality is not justified. We prove this inequality for
almost all `x` in `MeasureTheory.ae_measure_preimage_add_right_lt_top_of_ne_zero`."]
theorem measure_lintegral_div_measure (sm : MeasurableSet s) (h2s : ν' s ≠ 0) (h3s : ν' s ≠ ∞)
(f : G → ℝ≥0∞) (hf : Measurable f) :
(μ' s * ∫⁻ y, f y⁻¹ / ν' ((· * y⁻¹) ⁻¹' s) ∂ν') = ∫⁻ x, f x ∂μ' := by
set g := fun y => f y⁻¹ / ν' ((fun x => x * y⁻¹) ⁻¹' s)
have hg : Measurable g :=
(hf.comp measurable_inv).div ((measurable_measure_mul_right ν' sm).comp measurable_inv)
simp_rw [measure_mul_lintegral_eq μ' ν' sm g hg, g, inv_inv]
refine lintegral_congr_ae ?_
refine (ae_measure_preimage_mul_right_lt_top_of_ne_zero μ' ν' h2s h3s).mono fun x hx => ?_
simp_rw [ENNReal.mul_div_cancel' (measure_mul_right_ne_zero ν' h2s _) hx.ne]
@[to_additive]
theorem measure_mul_measure_eq (s t : Set G) (h2s : ν' s ≠ 0) (h3s : ν' s ≠ ∞) :
μ' s * ν' t = ν' s * μ' t := by
wlog hs : MeasurableSet s generalizing s
· rcases exists_measurable_superset₂ μ' ν' s with ⟨s', -, hm, hμ, hν⟩
rw [← hμ, ← hν, this s' _ _ hm] <;> rwa [hν]
wlog ht : MeasurableSet t generalizing t
· rcases exists_measurable_superset₂ μ' ν' t with ⟨t', -, hm, hμ, hν⟩
rw [← hμ, ← hν, this _ hm]
have h1 := measure_lintegral_div_measure ν' ν' hs h2s h3s (t.indicator fun _ => 1)
(measurable_const.indicator ht)
have h2 := measure_lintegral_div_measure μ' ν' hs h2s h3s (t.indicator fun _ => 1)
(measurable_const.indicator ht)
rw [lintegral_indicator _ ht, setLIntegral_one] at h1 h2
rw [← h1, mul_left_comm, h2]
/-- Left invariant Borel measures on a measurable group are unique (up to a scalar). -/
@[to_additive
" Left invariant Borel measures on an additive measurable group are unique (up to a scalar). "]
theorem measure_eq_div_smul (h2s : ν' s ≠ 0) (h3s : ν' s ≠ ∞) :
μ' = (μ' s / ν' s) • ν' := by
ext1 t -
rw [smul_apply, smul_eq_mul, mul_comm, ← mul_div_assoc, mul_comm,
measure_mul_measure_eq μ' ν' s t h2s h3s, mul_div_assoc, ENNReal.mul_div_cancel' h2s h3s]
end SigmaFinite
end LeftInvariant
section RightInvariant
@[to_additive measurePreserving_prod_add_right]
theorem measurePreserving_prod_mul_right [IsMulRightInvariant ν] :
MeasurePreserving (fun z : G × G => (z.1, z.2 * z.1)) (μ.prod ν) (μ.prod ν) :=
MeasurePreserving.skew_product (g := fun x y => y * x) (MeasurePreserving.id μ)
(measurable_snd.mul measurable_fst) <| Filter.eventually_of_forall <| map_mul_right_eq_self ν
/-- The map `(x, y) ↦ (y, xy)` sends the measure `μ × ν` to `ν × μ`. -/
@[to_additive measurePreserving_prod_add_swap_right
" The map `(x, y) ↦ (y, x + y)` sends the measure `μ × ν` to `ν × μ`. "]
theorem measurePreserving_prod_mul_swap_right [IsMulRightInvariant μ] :
MeasurePreserving (fun z : G × G => (z.2, z.1 * z.2)) (μ.prod ν) (ν.prod μ) :=
(measurePreserving_prod_mul_right ν μ).comp measurePreserving_swap
/-- The map `(x, y) ↦ (xy, y)` preserves the measure `μ × ν`. -/
@[to_additive measurePreserving_add_prod
" The map `(x, y) ↦ (x + y, y)` preserves the measure `μ × ν`. "]
theorem measurePreserving_mul_prod [IsMulRightInvariant μ] :
MeasurePreserving (fun z : G × G => (z.1 * z.2, z.2)) (μ.prod ν) (μ.prod ν) :=
measurePreserving_swap.comp <| by apply measurePreserving_prod_mul_swap_right μ ν
variable [MeasurableInv G]
/-- The map `(x, y) ↦ (x, y / x)` is measure-preserving. -/
@[to_additive measurePreserving_prod_sub "The map `(x, y) ↦ (x, y - x)` is measure-preserving."]
theorem measurePreserving_prod_div [IsMulRightInvariant ν] :
MeasurePreserving (fun z : G × G => (z.1, z.2 / z.1)) (μ.prod ν) (μ.prod ν) :=
(measurePreserving_prod_mul_right μ ν).symm (MeasurableEquiv.shearDivRight G).symm
/-- The map `(x, y) ↦ (y, x / y)` sends `μ × ν` to `ν × μ`. -/
@[to_additive measurePreserving_prod_sub_swap
"The map `(x, y) ↦ (y, x - y)` sends `μ × ν` to `ν × μ`."]
theorem measurePreserving_prod_div_swap [IsMulRightInvariant μ] :
MeasurePreserving (fun z : G × G => (z.2, z.1 / z.2)) (μ.prod ν) (ν.prod μ) :=
(measurePreserving_prod_div ν μ).comp measurePreserving_swap
/-- The map `(x, y) ↦ (x / y, y)` preserves the measure `μ × ν`. -/
@[to_additive measurePreserving_sub_prod
" The map `(x, y) ↦ (x - y, y)` preserves the measure `μ × ν`. "]
theorem measurePreserving_div_prod [IsMulRightInvariant μ] :
MeasurePreserving (fun z : G × G => (z.1 / z.2, z.2)) (μ.prod ν) (μ.prod ν) :=
measurePreserving_swap.comp <| by apply measurePreserving_prod_div_swap μ ν
/-- The map `(x, y) ↦ (xy, x⁻¹)` is measure-preserving. -/
@[to_additive measurePreserving_add_prod_neg_right
"The map `(x, y) ↦ (x + y, - x)` is measure-preserving."]
theorem measurePreserving_mul_prod_inv_right [IsMulRightInvariant μ] [IsMulRightInvariant ν] :
MeasurePreserving (fun z : G × G => (z.1 * z.2, z.1⁻¹)) (μ.prod ν) (μ.prod ν) := by
convert (measurePreserving_prod_div_swap ν μ).comp (measurePreserving_prod_mul_swap_right μ ν)
using 1
ext1 ⟨x, y⟩
simp_rw [Function.comp_apply, div_mul_eq_div_div_swap, div_self', one_div]
end RightInvariant
section QuasiMeasurePreserving
variable [MeasurableInv G]
@[to_additive]
theorem quasiMeasurePreserving_inv_of_right_invariant [IsMulRightInvariant μ] :
QuasiMeasurePreserving (Inv.inv : G → G) μ μ := by
rw [← μ.inv_inv]
exact
(quasiMeasurePreserving_inv μ.inv).mono (inv_absolutelyContinuous μ.inv)
(absolutelyContinuous_inv μ.inv)
@[to_additive]
theorem quasiMeasurePreserving_div_left [IsMulLeftInvariant μ] (g : G) :
QuasiMeasurePreserving (fun h : G => g / h) μ μ := by
simp_rw [div_eq_mul_inv]
exact
(measurePreserving_mul_left μ g).quasiMeasurePreserving.comp (quasiMeasurePreserving_inv μ)
@[to_additive]
theorem quasiMeasurePreserving_div_left_of_right_invariant [IsMulRightInvariant μ] (g : G) :
QuasiMeasurePreserving (fun h : G => g / h) μ μ := by
rw [← μ.inv_inv]
exact
(quasiMeasurePreserving_div_left μ.inv g).mono (inv_absolutelyContinuous μ.inv)
(absolutelyContinuous_inv μ.inv)
@[to_additive]
theorem quasiMeasurePreserving_div_of_right_invariant [IsMulRightInvariant μ] :
QuasiMeasurePreserving (fun p : G × G => p.1 / p.2) (μ.prod ν) μ := by
refine QuasiMeasurePreserving.prod_of_left measurable_div (eventually_of_forall fun y => ?_)
exact (measurePreserving_div_right μ y).quasiMeasurePreserving
@[to_additive]
theorem quasiMeasurePreserving_div [IsMulLeftInvariant μ] :
QuasiMeasurePreserving (fun p : G × G => p.1 / p.2) (μ.prod ν) μ :=
(quasiMeasurePreserving_div_of_right_invariant μ.inv ν).mono
((absolutelyContinuous_inv μ).prod AbsolutelyContinuous.rfl) (inv_absolutelyContinuous μ)
/-- A *left*-invariant measure is quasi-preserved by *right*-multiplication.
This should not be confused with `(measurePreserving_mul_right μ g).quasiMeasurePreserving`. -/
@[to_additive
"A *left*-invariant measure is quasi-preserved by *right*-addition.
This should not be confused with `(measurePreserving_add_right μ g).quasiMeasurePreserving`. "]
theorem quasiMeasurePreserving_mul_right [IsMulLeftInvariant μ] (g : G) :
QuasiMeasurePreserving (fun h : G => h * g) μ μ := by
refine ⟨measurable_mul_const g, AbsolutelyContinuous.mk fun s hs => ?_⟩
rw [map_apply (measurable_mul_const g) hs, measure_mul_right_null]; exact id
/-- A *right*-invariant measure is quasi-preserved by *left*-multiplication.
This should not be confused with `(measurePreserving_mul_left μ g).quasiMeasurePreserving`. -/
@[to_additive
"A *right*-invariant measure is quasi-preserved by *left*-addition.
This should not be confused with `(measurePreserving_add_left μ g).quasiMeasurePreserving`. "]
theorem quasiMeasurePreserving_mul_left [IsMulRightInvariant μ] (g : G) :
QuasiMeasurePreserving (fun h : G => g * h) μ μ := by
have :=
(quasiMeasurePreserving_mul_right μ.inv g⁻¹).mono (inv_absolutelyContinuous μ.inv)
(absolutelyContinuous_inv μ.inv)
rw [μ.inv_inv] at this
have :=
(quasiMeasurePreserving_inv_of_right_invariant μ).comp
(this.comp (quasiMeasurePreserving_inv_of_right_invariant μ))
simp_rw [Function.comp, mul_inv_rev, inv_inv] at this
exact this
end QuasiMeasurePreserving
end MeasureTheory
|
MeasureTheory\Integral\Asymptotics.lean | /-
Copyright (c) 2024 Lawrence Wu. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Lawrence Wu
-/
import Mathlib.MeasureTheory.Group.Measure
import Mathlib.MeasureTheory.Integral.IntegrableOn
import Mathlib.MeasureTheory.Function.LocallyIntegrable
/-!
# Bounding of integrals by asymptotics
We establish integrability of `f` from `f = O(g)`.
## Main results
* `Asymptotics.IsBigO.integrableAtFilter`: If `f = O[l] g` on measurably generated `l`,
`f` is strongly measurable at `l`, and `g` is integrable at `l`, then `f` is integrable at `l`.
* `MeasureTheory.LocallyIntegrable.integrable_of_isBigO_cocompact`: If `f` is locally integrable,
and `f =O[cocompact] g` for some `g` integrable at `cocompact`, then `f` is integrable.
* `MeasureTheory.LocallyIntegrable.integrable_of_isBigO_atBot_atTop`: If `f` is locally integrable,
and `f =O[atBot] g`, `f =O[atTop] g'` for some `g`, `g'` integrable `atBot` and `atTop`
respectively, then `f` is integrable.
* `MeasureTheory.LocallyIntegrable.integrable_of_isBigO_atTop_of_norm_isNegInvariant`:
If `f` is locally integrable, `‖f(-x)‖ = ‖f(x)‖`, and `f =O[atTop] g` for some
`g` integrable `atTop`, then `f` is integrable.
-/
open Asymptotics MeasureTheory Set Filter
variable {α E F : Type*} [MeasurableSpace α] [NormedAddCommGroup E] [NormedAddCommGroup F]
{f : α → E} {g : α → F} {a b : α} {μ : Measure α} {l : Filter α}
/-- If `f = O[l] g` on measurably generated `l`, `f` is strongly measurable at `l`,
and `g` is integrable at `l`, then `f` is integrable at `l`. -/
theorem _root_.Asymptotics.IsBigO.integrableAtFilter [IsMeasurablyGenerated l]
(hf : f =O[l] g) (hfm : StronglyMeasurableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
IntegrableAtFilter f l μ := by
obtain ⟨C, hC⟩ := hf.bound
obtain ⟨s, hsl, hsm, hfg, hf, hg⟩ :=
(hC.smallSets.and <| hfm.eventually.and hg.eventually).exists_measurable_mem_of_smallSets
refine ⟨s, hsl, (hg.norm.const_mul C).mono hf ?_⟩
refine (ae_restrict_mem hsm).mono fun x hx ↦ ?_
exact (hfg x hx).trans (le_abs_self _)
/-- Variant of `MeasureTheory.Integrable.mono` taking `f =O[⊤] (g)` instead of `‖f(x)‖ ≤ ‖g(x)‖` -/
theorem _root_.Asymptotics.IsBigO.integrable (hfm : AEStronglyMeasurable f μ)
(hf : f =O[⊤] g) (hg : Integrable g μ) : Integrable f μ := by
rewrite [← integrableAtFilter_top] at *
exact hf.integrableAtFilter ⟨univ, univ_mem, hfm.restrict⟩ hg
variable [TopologicalSpace α] [SecondCountableTopology α]
namespace MeasureTheory
/-- If `f` is locally integrable, and `f =O[cocompact] g` for some `g` integrable at `cocompact`,
then `f` is integrable. -/
theorem LocallyIntegrable.integrable_of_isBigO_cocompact [IsMeasurablyGenerated (cocompact α)]
(hf : LocallyIntegrable f μ) (ho : f =O[cocompact α] g)
(hg : IntegrableAtFilter g (cocompact α) μ) : Integrable f μ := by
refine integrable_iff_integrableAtFilter_cocompact.mpr ⟨ho.integrableAtFilter ?_ hg, hf⟩
exact hf.aestronglyMeasurable.stronglyMeasurableAtFilter
section LinearOrder
variable [LinearOrder α] [CompactIccSpace α] {g' : α → F}
/-- If `f` is locally integrable, and `f =O[atBot] g`, `f =O[atTop] g'` for some
`g`, `g'` integrable at `atBot` and `atTop` respectively, then `f` is integrable. -/
theorem LocallyIntegrable.integrable_of_isBigO_atBot_atTop
[IsMeasurablyGenerated (atBot (α := α))] [IsMeasurablyGenerated (atTop (α := α))]
(hf : LocallyIntegrable f μ)
(ho : f =O[atBot] g) (hg : IntegrableAtFilter g atBot μ)
(ho' : f =O[atTop] g') (hg' : IntegrableAtFilter g' atTop μ) : Integrable f μ := by
refine integrable_iff_integrableAtFilter_atBot_atTop.mpr
⟨⟨ho.integrableAtFilter ?_ hg, ho'.integrableAtFilter ?_ hg'⟩, hf⟩
all_goals exact hf.aestronglyMeasurable.stronglyMeasurableAtFilter
/-- If `f` is locally integrable on `(∞, a]`, and `f =O[atBot] g`, for some
`g` integrable at `atBot`, then `f` is integrable on `(∞, a]`. -/
theorem LocallyIntegrableOn.integrableOn_of_isBigO_atBot [IsMeasurablyGenerated (atBot (α := α))]
(hf : LocallyIntegrableOn f (Iic a) μ) (ho : f =O[atBot] g)
(hg : IntegrableAtFilter g atBot μ) : IntegrableOn f (Iic a) μ := by
refine integrableOn_Iic_iff_integrableAtFilter_atBot.mpr ⟨ho.integrableAtFilter ?_ hg, hf⟩
exact ⟨Iic a, Iic_mem_atBot a, hf.aestronglyMeasurable⟩
/-- If `f` is locally integrable on `[a, ∞)`, and `f =O[atTop] g`, for some
`g` integrable at `atTop`, then `f` is integrable on `[a, ∞)`. -/
theorem LocallyIntegrableOn.integrableOn_of_isBigO_atTop [IsMeasurablyGenerated (atTop (α := α))]
(hf : LocallyIntegrableOn f (Ici a) μ) (ho : f =O[atTop] g)
(hg : IntegrableAtFilter g atTop μ) : IntegrableOn f (Ici a) μ := by
refine integrableOn_Ici_iff_integrableAtFilter_atTop.mpr ⟨ho.integrableAtFilter ?_ hg, hf⟩
exact ⟨Ici a, Ici_mem_atTop a, hf.aestronglyMeasurable⟩
/-- If `f` is locally integrable, `f` has a top element, and `f =O[atBot] g`, for some
`g` integrable at `atBot`, then `f` is integrable. -/
theorem LocallyIntegrable.integrable_of_isBigO_atBot [IsMeasurablyGenerated (atBot (α := α))]
[OrderTop α] (hf : LocallyIntegrable f μ) (ho : f =O[atBot] g)
(hg : IntegrableAtFilter g atBot μ) : Integrable f μ := by
refine integrable_iff_integrableAtFilter_atBot.mpr ⟨ho.integrableAtFilter ?_ hg, hf⟩
exact hf.aestronglyMeasurable.stronglyMeasurableAtFilter
/-- If `f` is locally integrable, `f` has a bottom element, and `f =O[atTop] g`, for some
`g` integrable at `atTop`, then `f` is integrable. -/
theorem LocallyIntegrable.integrable_of_isBigO_atTop [IsMeasurablyGenerated (atTop (α := α))]
[OrderBot α] (hf : LocallyIntegrable f μ) (ho : f =O[atTop] g)
(hg : IntegrableAtFilter g atTop μ) : Integrable f μ := by
refine integrable_iff_integrableAtFilter_atTop.mpr ⟨ho.integrableAtFilter ?_ hg, hf⟩
exact hf.aestronglyMeasurable.stronglyMeasurableAtFilter
end LinearOrder
section LinearOrderedAddCommGroup
variable [LinearOrderedAddCommGroup α] [CompactIccSpace α]
/-- If `f` is locally integrable, `‖f(-x)‖ = ‖f(x)‖`, and `f =O[atTop] g`, for some
`g` integrable at `atTop`, then `f` is integrable. -/
theorem LocallyIntegrable.integrable_of_isBigO_atTop_of_norm_isNegInvariant
[IsMeasurablyGenerated (atTop (α := α))] [MeasurableNeg α] [μ.IsNegInvariant]
(hf : LocallyIntegrable f μ) (hsymm : norm ∘ f =ᵐ[μ] norm ∘ f ∘ Neg.neg) (ho : f =O[atTop] g)
(hg : IntegrableAtFilter g atTop μ) : Integrable f μ := by
have h_int := (hf.locallyIntegrableOn (Ici 0)).integrableOn_of_isBigO_atTop ho hg
rw [← integrableOn_univ, ← Iic_union_Ici_of_le le_rfl, integrableOn_union]
refine ⟨?_, h_int⟩
have h_map_neg : (μ.restrict (Ici 0)).map Neg.neg = μ.restrict (Iic 0) := by
conv => rhs; rw [← Measure.map_neg_eq_self μ, measurableEmbedding_neg.restrict_map]
simp
rw [IntegrableOn, ← h_map_neg, measurableEmbedding_neg.integrable_map_iff]
refine h_int.congr' ?_ hsymm.restrict
refine AEStronglyMeasurable.comp_aemeasurable ?_ measurable_neg.aemeasurable
exact h_map_neg ▸ hf.aestronglyMeasurable.restrict
end LinearOrderedAddCommGroup
end MeasureTheory
|
MeasureTheory\Integral\Average.lean | /-
Copyright (c) 2022 Yury G. Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury G. Kudryashov, Yaël Dillies
-/
import Mathlib.MeasureTheory.Integral.SetIntegral
/-!
# Integral average of a function
In this file we define `MeasureTheory.average μ f` (notation: `⨍ x, f x ∂μ`) to be the average
value of `f` with respect to measure `μ`. It is defined as `∫ x, f x ∂((μ univ)⁻¹ • μ)`, so it
is equal to zero if `f` is not integrable or if `μ` is an infinite measure. If `μ` is a probability
measure, then the average of any function is equal to its integral.
For the average on a set, we use `⨍ x in s, f x ∂μ` (notation for `⨍ x, f x ∂(μ.restrict s)`). For
average w.r.t. the volume, one can omit `∂volume`.
Both have a version for the Lebesgue integral rather than Bochner.
We prove several version of the first moment method: An integrable function is below/above its
average on a set of positive measure:
* `measure_le_setLaverage_pos` for the Lebesgue integral
* `measure_le_setAverage_pos` for the Bochner integral
## Implementation notes
The average is defined as an integral over `(μ univ)⁻¹ • μ` so that all theorems about Bochner
integrals work for the average without modifications. For theorems that require integrability of a
function, we provide a convenience lemma `MeasureTheory.Integrable.to_average`.
## Tags
integral, center mass, average value
-/
open ENNReal MeasureTheory MeasureTheory.Measure Metric Set Filter TopologicalSpace Function
open scoped Topology ENNReal Convex
variable {α E F : Type*} {m0 : MeasurableSpace α} [NormedAddCommGroup E] [NormedSpace ℝ E]
[CompleteSpace E] [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] {μ ν : Measure α}
{s t : Set α}
/-!
### Average value of a function w.r.t. a measure
The (Bochner, Lebesgue) average value of a function `f` w.r.t. a measure `μ` (notation:
`⨍ x, f x ∂μ`, `⨍⁻ x, f x ∂μ`) is defined as the (Bochner, Lebesgue) integral divided by the total
measure, so it is equal to zero if `μ` is an infinite measure, and (typically) equal to infinity if
`f` is not integrable. If `μ` is a probability measure, then the average of any function is equal to
its integral.
-/
namespace MeasureTheory
section ENNReal
variable (μ) {f g : α → ℝ≥0∞}
/-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. a measure `μ`, denoted `⨍⁻ x, f x ∂μ`.
It is equal to `(μ univ)⁻¹ * ∫⁻ x, f x ∂μ`, so it takes value zero if `μ` is an infinite measure. If
`μ` is a probability measure, then the average of any function is equal to its integral.
For the average on a set, use `⨍⁻ x in s, f x ∂μ`, defined as `⨍⁻ x, f x ∂(μ.restrict s)`. For the
average w.r.t. the volume, one can omit `∂volume`. -/
noncomputable def laverage (f : α → ℝ≥0∞) := ∫⁻ x, f x ∂(μ univ)⁻¹ • μ
/-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. a measure `μ`.
It is equal to `(μ univ)⁻¹ * ∫⁻ x, f x ∂μ`, so it takes value zero if `μ` is an infinite measure. If
`μ` is a probability measure, then the average of any function is equal to its integral.
For the average on a set, use `⨍⁻ x in s, f x ∂μ`, defined as `⨍⁻ x, f x ∂(μ.restrict s)`. For the
average w.r.t. the volume, one can omit `∂volume`. -/
notation3 "⨍⁻ "(...)", "r:60:(scoped f => f)" ∂"μ:70 => laverage μ r
/-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. to the standard measure.
It is equal to `(volume univ)⁻¹ * ∫⁻ x, f x`, so it takes value zero if the space has infinite
measure. In a probability space, the average of any function is equal to its integral.
For the average on a set, use `⨍⁻ x in s, f x`, defined as `⨍⁻ x, f x ∂(volume.restrict s)`. -/
notation3 "⨍⁻ "(...)", "r:60:(scoped f => laverage volume f) => r
/-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. a measure `μ` on a set `s`.
It is equal to `(μ s)⁻¹ * ∫⁻ x, f x ∂μ`, so it takes value zero if `s` has infinite measure. If `s`
has measure `1`, then the average of any function is equal to its integral.
For the average w.r.t. the volume, one can omit `∂volume`. -/
notation3 "⨍⁻ "(...)" in "s", "r:60:(scoped f => f)" ∂"μ:70 => laverage (Measure.restrict μ s) r
/-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. to the standard measure on a set `s`.
It is equal to `(volume s)⁻¹ * ∫⁻ x, f x`, so it takes value zero if `s` has infinite measure. If
`s` has measure `1`, then the average of any function is equal to its integral. -/
notation3 (prettyPrint := false)
"⨍⁻ "(...)" in "s", "r:60:(scoped f => laverage Measure.restrict volume s f) => r
@[simp]
theorem laverage_zero : ⨍⁻ _x, (0 : ℝ≥0∞) ∂μ = 0 := by rw [laverage, lintegral_zero]
@[simp]
theorem laverage_zero_measure (f : α → ℝ≥0∞) : ⨍⁻ x, f x ∂(0 : Measure α) = 0 := by simp [laverage]
theorem laverage_eq' (f : α → ℝ≥0∞) : ⨍⁻ x, f x ∂μ = ∫⁻ x, f x ∂(μ univ)⁻¹ • μ := rfl
theorem laverage_eq (f : α → ℝ≥0∞) : ⨍⁻ x, f x ∂μ = (∫⁻ x, f x ∂μ) / μ univ := by
rw [laverage_eq', lintegral_smul_measure, ENNReal.div_eq_inv_mul]
theorem laverage_eq_lintegral [IsProbabilityMeasure μ] (f : α → ℝ≥0∞) :
⨍⁻ x, f x ∂μ = ∫⁻ x, f x ∂μ := by rw [laverage, measure_univ, inv_one, one_smul]
@[simp]
theorem measure_mul_laverage [IsFiniteMeasure μ] (f : α → ℝ≥0∞) :
μ univ * ⨍⁻ x, f x ∂μ = ∫⁻ x, f x ∂μ := by
rcases eq_or_ne μ 0 with hμ | hμ
· rw [hμ, lintegral_zero_measure, laverage_zero_measure, mul_zero]
· rw [laverage_eq, ENNReal.mul_div_cancel' (measure_univ_ne_zero.2 hμ) (measure_ne_top _ _)]
theorem setLaverage_eq (f : α → ℝ≥0∞) (s : Set α) :
⨍⁻ x in s, f x ∂μ = (∫⁻ x in s, f x ∂μ) / μ s := by rw [laverage_eq, restrict_apply_univ]
theorem setLaverage_eq' (f : α → ℝ≥0∞) (s : Set α) :
⨍⁻ x in s, f x ∂μ = ∫⁻ x, f x ∂(μ s)⁻¹ • μ.restrict s := by
simp only [laverage_eq', restrict_apply_univ]
variable {μ}
theorem laverage_congr {f g : α → ℝ≥0∞} (h : f =ᵐ[μ] g) : ⨍⁻ x, f x ∂μ = ⨍⁻ x, g x ∂μ := by
simp only [laverage_eq, lintegral_congr_ae h]
theorem setLaverage_congr (h : s =ᵐ[μ] t) : ⨍⁻ x in s, f x ∂μ = ⨍⁻ x in t, f x ∂μ := by
simp only [setLaverage_eq, setLIntegral_congr h, measure_congr h]
theorem setLaverage_congr_fun (hs : MeasurableSet s) (h : ∀ᵐ x ∂μ, x ∈ s → f x = g x) :
⨍⁻ x in s, f x ∂μ = ⨍⁻ x in s, g x ∂μ := by
simp only [laverage_eq, setLIntegral_congr_fun hs h]
theorem laverage_lt_top (hf : ∫⁻ x, f x ∂μ ≠ ∞) : ⨍⁻ x, f x ∂μ < ∞ := by
obtain rfl | hμ := eq_or_ne μ 0
· simp
· rw [laverage_eq]
exact div_lt_top hf (measure_univ_ne_zero.2 hμ)
theorem setLaverage_lt_top : ∫⁻ x in s, f x ∂μ ≠ ∞ → ⨍⁻ x in s, f x ∂μ < ∞ :=
laverage_lt_top
theorem laverage_add_measure :
⨍⁻ x, f x ∂(μ + ν) =
μ univ / (μ univ + ν univ) * ⨍⁻ x, f x ∂μ + ν univ / (μ univ + ν univ) * ⨍⁻ x, f x ∂ν := by
by_cases hμ : IsFiniteMeasure μ; swap
· rw [not_isFiniteMeasure_iff] at hμ
simp [laverage_eq, hμ]
by_cases hν : IsFiniteMeasure ν; swap
· rw [not_isFiniteMeasure_iff] at hν
simp [laverage_eq, hν]
haveI := hμ; haveI := hν
simp only [← ENNReal.mul_div_right_comm, measure_mul_laverage, ← ENNReal.add_div,
← lintegral_add_measure, ← Measure.add_apply, ← laverage_eq]
theorem measure_mul_setLaverage (f : α → ℝ≥0∞) (h : μ s ≠ ∞) :
μ s * ⨍⁻ x in s, f x ∂μ = ∫⁻ x in s, f x ∂μ := by
have := Fact.mk h.lt_top
rw [← measure_mul_laverage, restrict_apply_univ]
theorem laverage_union (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ) :
⨍⁻ x in s ∪ t, f x ∂μ =
μ s / (μ s + μ t) * ⨍⁻ x in s, f x ∂μ + μ t / (μ s + μ t) * ⨍⁻ x in t, f x ∂μ := by
rw [restrict_union₀ hd ht, laverage_add_measure, restrict_apply_univ, restrict_apply_univ]
theorem laverage_union_mem_openSegment (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
(hs₀ : μ s ≠ 0) (ht₀ : μ t ≠ 0) (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) :
⨍⁻ x in s ∪ t, f x ∂μ ∈ openSegment ℝ≥0∞ (⨍⁻ x in s, f x ∂μ) (⨍⁻ x in t, f x ∂μ) := by
refine
⟨μ s / (μ s + μ t), μ t / (μ s + μ t), ENNReal.div_pos hs₀ <| add_ne_top.2 ⟨hsμ, htμ⟩,
ENNReal.div_pos ht₀ <| add_ne_top.2 ⟨hsμ, htμ⟩, ?_, (laverage_union hd ht).symm⟩
rw [← ENNReal.add_div,
ENNReal.div_self (add_eq_zero.not.2 fun h => hs₀ h.1) (add_ne_top.2 ⟨hsμ, htμ⟩)]
theorem laverage_union_mem_segment (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
(hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) :
⨍⁻ x in s ∪ t, f x ∂μ ∈ [⨍⁻ x in s, f x ∂μ -[ℝ≥0∞] ⨍⁻ x in t, f x ∂μ] := by
by_cases hs₀ : μ s = 0
· rw [← ae_eq_empty] at hs₀
rw [restrict_congr_set (hs₀.union EventuallyEq.rfl), empty_union]
exact right_mem_segment _ _ _
· refine
⟨μ s / (μ s + μ t), μ t / (μ s + μ t), zero_le _, zero_le _, ?_, (laverage_union hd ht).symm⟩
rw [← ENNReal.add_div,
ENNReal.div_self (add_eq_zero.not.2 fun h => hs₀ h.1) (add_ne_top.2 ⟨hsμ, htμ⟩)]
theorem laverage_mem_openSegment_compl_self [IsFiniteMeasure μ] (hs : NullMeasurableSet s μ)
(hs₀ : μ s ≠ 0) (hsc₀ : μ sᶜ ≠ 0) :
⨍⁻ x, f x ∂μ ∈ openSegment ℝ≥0∞ (⨍⁻ x in s, f x ∂μ) (⨍⁻ x in sᶜ, f x ∂μ) := by
simpa only [union_compl_self, restrict_univ] using
laverage_union_mem_openSegment aedisjoint_compl_right hs.compl hs₀ hsc₀ (measure_ne_top _ _)
(measure_ne_top _ _)
@[simp]
theorem laverage_const (μ : Measure α) [IsFiniteMeasure μ] [h : NeZero μ] (c : ℝ≥0∞) :
⨍⁻ _x, c ∂μ = c := by
simp only [laverage, lintegral_const, measure_univ, mul_one]
theorem setLaverage_const (hs₀ : μ s ≠ 0) (hs : μ s ≠ ∞) (c : ℝ≥0∞) : ⨍⁻ _x in s, c ∂μ = c := by
simp only [setLaverage_eq, lintegral_const, Measure.restrict_apply, MeasurableSet.univ,
univ_inter, div_eq_mul_inv, mul_assoc, ENNReal.mul_inv_cancel hs₀ hs, mul_one]
theorem laverage_one [IsFiniteMeasure μ] [NeZero μ] : ⨍⁻ _x, (1 : ℝ≥0∞) ∂μ = 1 :=
laverage_const _ _
theorem setLaverage_one (hs₀ : μ s ≠ 0) (hs : μ s ≠ ∞) : ⨍⁻ _x in s, (1 : ℝ≥0∞) ∂μ = 1 :=
setLaverage_const hs₀ hs _
-- Porting note: Dropped `simp` because of `simp` seeing through `1 : α → ℝ≥0∞` and applying
-- `lintegral_const`. This is suboptimal.
theorem lintegral_laverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → ℝ≥0∞) :
∫⁻ _x, ⨍⁻ a, f a ∂μ ∂μ = ∫⁻ x, f x ∂μ := by
obtain rfl | hμ := eq_or_ne μ 0
· simp
· rw [lintegral_const, laverage_eq,
ENNReal.div_mul_cancel (measure_univ_ne_zero.2 hμ) (measure_ne_top _ _)]
theorem setLintegral_setLaverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → ℝ≥0∞) (s : Set α) :
∫⁻ _x in s, ⨍⁻ a in s, f a ∂μ ∂μ = ∫⁻ x in s, f x ∂μ :=
lintegral_laverage _ _
end ENNReal
section NormedAddCommGroup
variable (μ)
variable {f g : α → E}
/-- Average value of a function `f` w.r.t. a measure `μ`, denoted `⨍ x, f x ∂μ`.
It is equal to `(μ univ).toReal⁻¹ • ∫ x, f x ∂μ`, so it takes value zero if `f` is not integrable or
if `μ` is an infinite measure. If `μ` is a probability measure, then the average of any function is
equal to its integral.
For the average on a set, use `⨍ x in s, f x ∂μ`, defined as `⨍ x, f x ∂(μ.restrict s)`. For the
average w.r.t. the volume, one can omit `∂volume`. -/
noncomputable def average (f : α → E) :=
∫ x, f x ∂(μ univ)⁻¹ • μ
/-- Average value of a function `f` w.r.t. a measure `μ`.
It is equal to `(μ univ).toReal⁻¹ • ∫ x, f x ∂μ`, so it takes value zero if `f` is not integrable or
if `μ` is an infinite measure. If `μ` is a probability measure, then the average of any function is
equal to its integral.
For the average on a set, use `⨍ x in s, f x ∂μ`, defined as `⨍ x, f x ∂(μ.restrict s)`. For the
average w.r.t. the volume, one can omit `∂volume`. -/
notation3 "⨍ "(...)", "r:60:(scoped f => f)" ∂"μ:70 => average μ r
/-- Average value of a function `f` w.r.t. to the standard measure.
It is equal to `(volume univ).toReal⁻¹ * ∫ x, f x`, so it takes value zero if `f` is not integrable
or if the space has infinite measure. In a probability space, the average of any function is equal
to its integral.
For the average on a set, use `⨍ x in s, f x`, defined as `⨍ x, f x ∂(volume.restrict s)`. -/
notation3 "⨍ "(...)", "r:60:(scoped f => average volume f) => r
/-- Average value of a function `f` w.r.t. a measure `μ` on a set `s`.
It is equal to `(μ s).toReal⁻¹ * ∫ x, f x ∂μ`, so it takes value zero if `f` is not integrable on
`s` or if `s` has infinite measure. If `s` has measure `1`, then the average of any function is
equal to its integral.
For the average w.r.t. the volume, one can omit `∂volume`. -/
notation3 "⨍ "(...)" in "s", "r:60:(scoped f => f)" ∂"μ:70 => average (Measure.restrict μ s) r
/-- Average value of a function `f` w.r.t. to the standard measure on a set `s`.
It is equal to `(volume s).toReal⁻¹ * ∫ x, f x`, so it takes value zero `f` is not integrable on `s`
or if `s` has infinite measure. If `s` has measure `1`, then the average of any function is equal to
its integral. -/
notation3 "⨍ "(...)" in "s", "r:60:(scoped f => average (Measure.restrict volume s) f) => r
@[simp]
theorem average_zero : ⨍ _, (0 : E) ∂μ = 0 := by rw [average, integral_zero]
@[simp]
theorem average_zero_measure (f : α → E) : ⨍ x, f x ∂(0 : Measure α) = 0 := by
rw [average, smul_zero, integral_zero_measure]
@[simp]
theorem average_neg (f : α → E) : ⨍ x, -f x ∂μ = -⨍ x, f x ∂μ :=
integral_neg f
theorem average_eq' (f : α → E) : ⨍ x, f x ∂μ = ∫ x, f x ∂(μ univ)⁻¹ • μ :=
rfl
theorem average_eq (f : α → E) : ⨍ x, f x ∂μ = (μ univ).toReal⁻¹ • ∫ x, f x ∂μ := by
rw [average_eq', integral_smul_measure, ENNReal.toReal_inv]
theorem average_eq_integral [IsProbabilityMeasure μ] (f : α → E) : ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by
rw [average, measure_univ, inv_one, one_smul]
@[simp]
theorem measure_smul_average [IsFiniteMeasure μ] (f : α → E) :
(μ univ).toReal • ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by
rcases eq_or_ne μ 0 with hμ | hμ
· rw [hμ, integral_zero_measure, average_zero_measure, smul_zero]
· rw [average_eq, smul_inv_smul₀]
refine (ENNReal.toReal_pos ?_ <| measure_ne_top _ _).ne'
rwa [Ne, measure_univ_eq_zero]
theorem setAverage_eq (f : α → E) (s : Set α) :
⨍ x in s, f x ∂μ = (μ s).toReal⁻¹ • ∫ x in s, f x ∂μ := by rw [average_eq, restrict_apply_univ]
theorem setAverage_eq' (f : α → E) (s : Set α) :
⨍ x in s, f x ∂μ = ∫ x, f x ∂(μ s)⁻¹ • μ.restrict s := by
simp only [average_eq', restrict_apply_univ]
variable {μ}
theorem average_congr {f g : α → E} (h : f =ᵐ[μ] g) : ⨍ x, f x ∂μ = ⨍ x, g x ∂μ := by
simp only [average_eq, integral_congr_ae h]
theorem setAverage_congr (h : s =ᵐ[μ] t) : ⨍ x in s, f x ∂μ = ⨍ x in t, f x ∂μ := by
simp only [setAverage_eq, setIntegral_congr_set_ae h, measure_congr h]
theorem setAverage_congr_fun (hs : MeasurableSet s) (h : ∀ᵐ x ∂μ, x ∈ s → f x = g x) :
⨍ x in s, f x ∂μ = ⨍ x in s, g x ∂μ := by simp only [average_eq, setIntegral_congr_ae hs h]
theorem average_add_measure [IsFiniteMeasure μ] {ν : Measure α} [IsFiniteMeasure ν] {f : α → E}
(hμ : Integrable f μ) (hν : Integrable f ν) :
⨍ x, f x ∂(μ + ν) =
((μ univ).toReal / ((μ univ).toReal + (ν univ).toReal)) • ⨍ x, f x ∂μ +
((ν univ).toReal / ((μ univ).toReal + (ν univ).toReal)) • ⨍ x, f x ∂ν := by
simp only [div_eq_inv_mul, mul_smul, measure_smul_average, ← smul_add,
← integral_add_measure hμ hν, ← ENNReal.toReal_add (measure_ne_top μ _) (measure_ne_top ν _)]
rw [average_eq, Measure.add_apply]
theorem average_pair {f : α → E} {g : α → F} (hfi : Integrable f μ) (hgi : Integrable g μ) :
⨍ x, (f x, g x) ∂μ = (⨍ x, f x ∂μ, ⨍ x, g x ∂μ) :=
integral_pair hfi.to_average hgi.to_average
theorem measure_smul_setAverage (f : α → E) {s : Set α} (h : μ s ≠ ∞) :
(μ s).toReal • ⨍ x in s, f x ∂μ = ∫ x in s, f x ∂μ := by
haveI := Fact.mk h.lt_top
rw [← measure_smul_average, restrict_apply_univ]
theorem average_union {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
(hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) (hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) :
⨍ x in s ∪ t, f x ∂μ =
((μ s).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ x in s, f x ∂μ +
((μ t).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ x in t, f x ∂μ := by
haveI := Fact.mk hsμ.lt_top; haveI := Fact.mk htμ.lt_top
rw [restrict_union₀ hd ht, average_add_measure hfs hft, restrict_apply_univ, restrict_apply_univ]
theorem average_union_mem_openSegment {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t)
(ht : NullMeasurableSet t μ) (hs₀ : μ s ≠ 0) (ht₀ : μ t ≠ 0) (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞)
(hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) :
⨍ x in s ∪ t, f x ∂μ ∈ openSegment ℝ (⨍ x in s, f x ∂μ) (⨍ x in t, f x ∂μ) := by
replace hs₀ : 0 < (μ s).toReal := ENNReal.toReal_pos hs₀ hsμ
replace ht₀ : 0 < (μ t).toReal := ENNReal.toReal_pos ht₀ htμ
exact mem_openSegment_iff_div.mpr
⟨(μ s).toReal, (μ t).toReal, hs₀, ht₀, (average_union hd ht hsμ htμ hfs hft).symm⟩
theorem average_union_mem_segment {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t)
(ht : NullMeasurableSet t μ) (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) (hfs : IntegrableOn f s μ)
(hft : IntegrableOn f t μ) :
⨍ x in s ∪ t, f x ∂μ ∈ [⨍ x in s, f x ∂μ -[ℝ] ⨍ x in t, f x ∂μ] := by
by_cases hse : μ s = 0
· rw [← ae_eq_empty] at hse
rw [restrict_congr_set (hse.union EventuallyEq.rfl), empty_union]
exact right_mem_segment _ _ _
· refine
mem_segment_iff_div.mpr
⟨(μ s).toReal, (μ t).toReal, ENNReal.toReal_nonneg, ENNReal.toReal_nonneg, ?_,
(average_union hd ht hsμ htμ hfs hft).symm⟩
calc
0 < (μ s).toReal := ENNReal.toReal_pos hse hsμ
_ ≤ _ := le_add_of_nonneg_right ENNReal.toReal_nonneg
theorem average_mem_openSegment_compl_self [IsFiniteMeasure μ] {f : α → E} {s : Set α}
(hs : NullMeasurableSet s μ) (hs₀ : μ s ≠ 0) (hsc₀ : μ sᶜ ≠ 0) (hfi : Integrable f μ) :
⨍ x, f x ∂μ ∈ openSegment ℝ (⨍ x in s, f x ∂μ) (⨍ x in sᶜ, f x ∂μ) := by
simpa only [union_compl_self, restrict_univ] using
average_union_mem_openSegment aedisjoint_compl_right hs.compl hs₀ hsc₀ (measure_ne_top _ _)
(measure_ne_top _ _) hfi.integrableOn hfi.integrableOn
@[simp]
theorem average_const (μ : Measure α) [IsFiniteMeasure μ] [h : NeZero μ] (c : E) :
⨍ _x, c ∂μ = c := by
rw [average, integral_const, measure_univ, ENNReal.one_toReal, one_smul]
theorem setAverage_const {s : Set α} (hs₀ : μ s ≠ 0) (hs : μ s ≠ ∞) (c : E) :
⨍ _ in s, c ∂μ = c :=
have := NeZero.mk hs₀; have := Fact.mk hs.lt_top; average_const _ _
-- Porting note (#10618): was `@[simp]` but `simp` can prove it
theorem integral_average (μ : Measure α) [IsFiniteMeasure μ] (f : α → E) :
∫ _, ⨍ a, f a ∂μ ∂μ = ∫ x, f x ∂μ := by simp
theorem setIntegral_setAverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → E) (s : Set α) :
∫ _ in s, ⨍ a in s, f a ∂μ ∂μ = ∫ x in s, f x ∂μ :=
integral_average _ _
theorem integral_sub_average (μ : Measure α) [IsFiniteMeasure μ] (f : α → E) :
∫ x, f x - ⨍ a, f a ∂μ ∂μ = 0 := by
by_cases hf : Integrable f μ
· rw [integral_sub hf (integrable_const _), integral_average, sub_self]
refine integral_undef fun h => hf ?_
convert h.add (integrable_const (⨍ a, f a ∂μ))
exact (sub_add_cancel _ _).symm
theorem setAverage_sub_setAverage (hs : μ s ≠ ∞) (f : α → E) :
∫ x in s, f x - ⨍ a in s, f a ∂μ ∂μ = 0 :=
haveI : Fact (μ s < ∞) := ⟨lt_top_iff_ne_top.2 hs⟩
integral_sub_average _ _
theorem integral_average_sub [IsFiniteMeasure μ] (hf : Integrable f μ) :
∫ x, ⨍ a, f a ∂μ - f x ∂μ = 0 := by
rw [integral_sub (integrable_const _) hf, integral_average, sub_self]
theorem setIntegral_setAverage_sub (hs : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
∫ x in s, ⨍ a in s, f a ∂μ - f x ∂μ = 0 :=
haveI : Fact (μ s < ∞) := ⟨lt_top_iff_ne_top.2 hs⟩
integral_average_sub hf
end NormedAddCommGroup
theorem ofReal_average {f : α → ℝ} (hf : Integrable f μ) (hf₀ : 0 ≤ᵐ[μ] f) :
ENNReal.ofReal (⨍ x, f x ∂μ) = (∫⁻ x, ENNReal.ofReal (f x) ∂μ) / μ univ := by
obtain rfl | hμ := eq_or_ne μ 0
· simp
· rw [average_eq, smul_eq_mul, ← toReal_inv, ofReal_mul toReal_nonneg,
ofReal_toReal (inv_ne_top.2 <| measure_univ_ne_zero.2 hμ),
ofReal_integral_eq_lintegral_ofReal hf hf₀, ENNReal.div_eq_inv_mul]
theorem ofReal_setAverage {f : α → ℝ} (hf : IntegrableOn f s μ) (hf₀ : 0 ≤ᵐ[μ.restrict s] f) :
ENNReal.ofReal (⨍ x in s, f x ∂μ) = (∫⁻ x in s, ENNReal.ofReal (f x) ∂μ) / μ s := by
simpa using ofReal_average hf hf₀
theorem toReal_laverage {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hf' : ∀ᵐ x ∂μ, f x ≠ ∞) :
(⨍⁻ x, f x ∂μ).toReal = ⨍ x, (f x).toReal ∂μ := by
rw [average_eq, laverage_eq, smul_eq_mul, toReal_div, div_eq_inv_mul, ←
integral_toReal hf (hf'.mono fun _ => lt_top_iff_ne_top.2)]
theorem toReal_setLaverage {f : α → ℝ≥0∞} (hf : AEMeasurable f (μ.restrict s))
(hf' : ∀ᵐ x ∂μ.restrict s, f x ≠ ∞) :
(⨍⁻ x in s, f x ∂μ).toReal = ⨍ x in s, (f x).toReal ∂μ := by
simpa [laverage_eq] using toReal_laverage hf hf'
/-! ### First moment method -/
section FirstMomentReal
variable {N : Set α} {f : α → ℝ}
/-- **First moment method**. An integrable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_setAverage_pos (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
0 < μ ({x ∈ s | f x ≤ ⨍ a in s, f a ∂μ}) := by
refine pos_iff_ne_zero.2 fun H => ?_
replace H : (μ.restrict s) {x | f x ≤ ⨍ a in s, f a ∂μ} = 0 := by
rwa [restrict_apply₀, inter_comm]
exact AEStronglyMeasurable.nullMeasurableSet_le hf.1 aestronglyMeasurable_const
haveI := Fact.mk hμ₁.lt_top
refine (integral_sub_average (μ.restrict s) f).not_gt ?_
refine (setIntegral_pos_iff_support_of_nonneg_ae ?_ ?_).2 ?_
· refine measure_mono_null (fun x hx ↦ ?_) H
simp only [Pi.zero_apply, sub_nonneg, mem_compl_iff, mem_setOf_eq, not_le] at hx
exact hx.le
· exact hf.sub (integrableOn_const.2 <| Or.inr <| lt_top_iff_ne_top.2 hμ₁)
· rwa [pos_iff_ne_zero, inter_comm, ← diff_compl, ← diff_inter_self_eq_diff, measure_diff_null]
refine measure_mono_null ?_ (measure_inter_eq_zero_of_restrict H)
exact inter_subset_inter_left _ fun a ha => (sub_eq_zero.1 <| of_not_not ha).le
/-- **First moment method**. An integrable function is greater than its mean on a set of positive
measure. -/
theorem measure_setAverage_le_pos (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
0 < μ ({x ∈ s | ⨍ a in s, f a ∂μ ≤ f x}) := by
simpa [integral_neg, neg_div] using measure_le_setAverage_pos hμ hμ₁ hf.neg
/-- **First moment method**. The minimum of an integrable function is smaller than its mean. -/
theorem exists_le_setAverage (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
∃ x ∈ s, f x ≤ ⨍ a in s, f a ∂μ :=
let ⟨x, hx, h⟩ := nonempty_of_measure_ne_zero (measure_le_setAverage_pos hμ hμ₁ hf).ne'
⟨x, hx, h⟩
/-- **First moment method**. The maximum of an integrable function is greater than its mean. -/
theorem exists_setAverage_le (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
∃ x ∈ s, ⨍ a in s, f a ∂μ ≤ f x :=
let ⟨x, hx, h⟩ := nonempty_of_measure_ne_zero (measure_setAverage_le_pos hμ hμ₁ hf).ne'
⟨x, hx, h⟩
section FiniteMeasure
variable [IsFiniteMeasure μ]
/-- **First moment method**. An integrable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_average_pos (hμ : μ ≠ 0) (hf : Integrable f μ) :
0 < μ {x | f x ≤ ⨍ a, f a ∂μ} := by
simpa using measure_le_setAverage_pos (Measure.measure_univ_ne_zero.2 hμ) (measure_ne_top _ _)
hf.integrableOn
/-- **First moment method**. An integrable function is greater than its mean on a set of positive
measure. -/
theorem measure_average_le_pos (hμ : μ ≠ 0) (hf : Integrable f μ) :
0 < μ {x | ⨍ a, f a ∂μ ≤ f x} := by
simpa using measure_setAverage_le_pos (Measure.measure_univ_ne_zero.2 hμ) (measure_ne_top _ _)
hf.integrableOn
/-- **First moment method**. The minimum of an integrable function is smaller than its mean. -/
theorem exists_le_average (hμ : μ ≠ 0) (hf : Integrable f μ) : ∃ x, f x ≤ ⨍ a, f a ∂μ :=
let ⟨x, hx⟩ := nonempty_of_measure_ne_zero (measure_le_average_pos hμ hf).ne'
⟨x, hx⟩
/-- **First moment method**. The maximum of an integrable function is greater than its mean. -/
theorem exists_average_le (hμ : μ ≠ 0) (hf : Integrable f μ) : ∃ x, ⨍ a, f a ∂μ ≤ f x :=
let ⟨x, hx⟩ := nonempty_of_measure_ne_zero (measure_average_le_pos hμ hf).ne'
⟨x, hx⟩
/-- **First moment method**. The minimum of an integrable function is smaller than its mean, while
avoiding a null set. -/
theorem exists_not_mem_null_le_average (hμ : μ ≠ 0) (hf : Integrable f μ) (hN : μ N = 0) :
∃ x, x ∉ N ∧ f x ≤ ⨍ a, f a ∂μ := by
have := measure_le_average_pos hμ hf
rw [← measure_diff_null hN] at this
obtain ⟨x, hx, hxN⟩ := nonempty_of_measure_ne_zero this.ne'
exact ⟨x, hxN, hx⟩
/-- **First moment method**. The maximum of an integrable function is greater than its mean, while
avoiding a null set. -/
theorem exists_not_mem_null_average_le (hμ : μ ≠ 0) (hf : Integrable f μ) (hN : μ N = 0) :
∃ x, x ∉ N ∧ ⨍ a, f a ∂μ ≤ f x := by
simpa [integral_neg, neg_div] using exists_not_mem_null_le_average hμ hf.neg hN
end FiniteMeasure
section ProbabilityMeasure
variable [IsProbabilityMeasure μ]
/-- **First moment method**. An integrable function is smaller than its integral on a set of
positive measure. -/
theorem measure_le_integral_pos (hf : Integrable f μ) : 0 < μ {x | f x ≤ ∫ a, f a ∂μ} := by
simpa only [average_eq_integral] using
measure_le_average_pos (IsProbabilityMeasure.ne_zero μ) hf
/-- **First moment method**. An integrable function is greater than its integral on a set of
positive measure. -/
theorem measure_integral_le_pos (hf : Integrable f μ) : 0 < μ {x | ∫ a, f a ∂μ ≤ f x} := by
simpa only [average_eq_integral] using
measure_average_le_pos (IsProbabilityMeasure.ne_zero μ) hf
/-- **First moment method**. The minimum of an integrable function is smaller than its integral. -/
theorem exists_le_integral (hf : Integrable f μ) : ∃ x, f x ≤ ∫ a, f a ∂μ := by
simpa only [average_eq_integral] using exists_le_average (IsProbabilityMeasure.ne_zero μ) hf
/-- **First moment method**. The maximum of an integrable function is greater than its integral. -/
theorem exists_integral_le (hf : Integrable f μ) : ∃ x, ∫ a, f a ∂μ ≤ f x := by
simpa only [average_eq_integral] using exists_average_le (IsProbabilityMeasure.ne_zero μ) hf
/-- **First moment method**. The minimum of an integrable function is smaller than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_le_integral (hf : Integrable f μ) (hN : μ N = 0) :
∃ x, x ∉ N ∧ f x ≤ ∫ a, f a ∂μ := by
simpa only [average_eq_integral] using
exists_not_mem_null_le_average (IsProbabilityMeasure.ne_zero μ) hf hN
/-- **First moment method**. The maximum of an integrable function is greater than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_integral_le (hf : Integrable f μ) (hN : μ N = 0) :
∃ x, x ∉ N ∧ ∫ a, f a ∂μ ≤ f x := by
simpa only [average_eq_integral] using
exists_not_mem_null_average_le (IsProbabilityMeasure.ne_zero μ) hf hN
end ProbabilityMeasure
end FirstMomentReal
section FirstMomentENNReal
variable {N : Set α} {f : α → ℝ≥0∞}
/-- **First moment method**. A measurable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_setLaverage_pos (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞)
(hf : AEMeasurable f (μ.restrict s)) : 0 < μ {x ∈ s | f x ≤ ⨍⁻ a in s, f a ∂μ} := by
obtain h | h := eq_or_ne (∫⁻ a in s, f a ∂μ) ∞
· simpa [mul_top, hμ₁, laverage, h, top_div_of_ne_top hμ₁, pos_iff_ne_zero] using hμ
have := measure_le_setAverage_pos hμ hμ₁ (integrable_toReal_of_lintegral_ne_top hf h)
rw [← setOf_inter_eq_sep, ← Measure.restrict_apply₀
(hf.aestronglyMeasurable.nullMeasurableSet_le aestronglyMeasurable_const)]
rw [← setOf_inter_eq_sep, ← Measure.restrict_apply₀
(hf.ennreal_toReal.aestronglyMeasurable.nullMeasurableSet_le aestronglyMeasurable_const),
← measure_diff_null (measure_eq_top_of_lintegral_ne_top hf h)] at this
refine this.trans_le (measure_mono ?_)
rintro x ⟨hfx, hx⟩
dsimp at hfx
rwa [← toReal_laverage hf, toReal_le_toReal hx (setLaverage_lt_top h).ne] at hfx
simp_rw [ae_iff, not_ne_iff]
exact measure_eq_top_of_lintegral_ne_top hf h
/-- **First moment method**. A measurable function is greater than its mean on a set of positive
measure. -/
theorem measure_setLaverage_le_pos (hμ : μ s ≠ 0) (hs : NullMeasurableSet s μ)
(hint : ∫⁻ a in s, f a ∂μ ≠ ∞) : 0 < μ {x ∈ s | ⨍⁻ a in s, f a ∂μ ≤ f x} := by
obtain hμ₁ | hμ₁ := eq_or_ne (μ s) ∞
· simp [setLaverage_eq, hμ₁]
obtain ⟨g, hg, hgf, hfg⟩ := exists_measurable_le_lintegral_eq (μ.restrict s) f
have hfg' : ⨍⁻ a in s, f a ∂μ = ⨍⁻ a in s, g a ∂μ := by simp_rw [laverage_eq, hfg]
rw [hfg] at hint
have :=
measure_setAverage_le_pos hμ hμ₁ (integrable_toReal_of_lintegral_ne_top hg.aemeasurable hint)
simp_rw [← setOf_inter_eq_sep, ← Measure.restrict_apply₀' hs, hfg']
rw [← setOf_inter_eq_sep, ← Measure.restrict_apply₀' hs, ←
measure_diff_null (measure_eq_top_of_lintegral_ne_top hg.aemeasurable hint)] at this
refine this.trans_le (measure_mono ?_)
rintro x ⟨hfx, hx⟩
dsimp at hfx
rw [← toReal_laverage hg.aemeasurable, toReal_le_toReal (setLaverage_lt_top hint).ne hx] at hfx
· exact hfx.trans (hgf _)
· simp_rw [ae_iff, not_ne_iff]
exact measure_eq_top_of_lintegral_ne_top hg.aemeasurable hint
/-- **First moment method**. The minimum of a measurable function is smaller than its mean. -/
theorem exists_le_setLaverage (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : AEMeasurable f (μ.restrict s)) :
∃ x ∈ s, f x ≤ ⨍⁻ a in s, f a ∂μ :=
let ⟨x, hx, h⟩ := nonempty_of_measure_ne_zero (measure_le_setLaverage_pos hμ hμ₁ hf).ne'
⟨x, hx, h⟩
/-- **First moment method**. The maximum of a measurable function is greater than its mean. -/
theorem exists_setLaverage_le (hμ : μ s ≠ 0) (hs : NullMeasurableSet s μ)
(hint : ∫⁻ a in s, f a ∂μ ≠ ∞) : ∃ x ∈ s, ⨍⁻ a in s, f a ∂μ ≤ f x :=
let ⟨x, hx, h⟩ := nonempty_of_measure_ne_zero (measure_setLaverage_le_pos hμ hs hint).ne'
⟨x, hx, h⟩
/-- **First moment method**. A measurable function is greater than its mean on a set of positive
measure. -/
theorem measure_laverage_le_pos (hμ : μ ≠ 0) (hint : ∫⁻ a, f a ∂μ ≠ ∞) :
0 < μ {x | ⨍⁻ a, f a ∂μ ≤ f x} := by
simpa [hint] using
@measure_setLaverage_le_pos _ _ _ _ f (measure_univ_ne_zero.2 hμ) nullMeasurableSet_univ
/-- **First moment method**. The maximum of a measurable function is greater than its mean. -/
theorem exists_laverage_le (hμ : μ ≠ 0) (hint : ∫⁻ a, f a ∂μ ≠ ∞) : ∃ x, ⨍⁻ a, f a ∂μ ≤ f x :=
let ⟨x, hx⟩ := nonempty_of_measure_ne_zero (measure_laverage_le_pos hμ hint).ne'
⟨x, hx⟩
/-- **First moment method**. The maximum of a measurable function is greater than its mean, while
avoiding a null set. -/
theorem exists_not_mem_null_laverage_le (hμ : μ ≠ 0) (hint : ∫⁻ a : α, f a ∂μ ≠ ∞) (hN : μ N = 0) :
∃ x, x ∉ N ∧ ⨍⁻ a, f a ∂μ ≤ f x := by
have := measure_laverage_le_pos hμ hint
rw [← measure_diff_null hN] at this
obtain ⟨x, hx, hxN⟩ := nonempty_of_measure_ne_zero this.ne'
exact ⟨x, hxN, hx⟩
section FiniteMeasure
variable [IsFiniteMeasure μ]
/-- **First moment method**. A measurable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_laverage_pos (hμ : μ ≠ 0) (hf : AEMeasurable f μ) :
0 < μ {x | f x ≤ ⨍⁻ a, f a ∂μ} := by
simpa using
measure_le_setLaverage_pos (measure_univ_ne_zero.2 hμ) (measure_ne_top _ _) hf.restrict
/-- **First moment method**. The minimum of a measurable function is smaller than its mean. -/
theorem exists_le_laverage (hμ : μ ≠ 0) (hf : AEMeasurable f μ) : ∃ x, f x ≤ ⨍⁻ a, f a ∂μ :=
let ⟨x, hx⟩ := nonempty_of_measure_ne_zero (measure_le_laverage_pos hμ hf).ne'
⟨x, hx⟩
/-- **First moment method**. The minimum of a measurable function is smaller than its mean, while
avoiding a null set. -/
theorem exists_not_mem_null_le_laverage (hμ : μ ≠ 0) (hf : AEMeasurable f μ) (hN : μ N = 0) :
∃ x, x ∉ N ∧ f x ≤ ⨍⁻ a, f a ∂μ := by
have := measure_le_laverage_pos hμ hf
rw [← measure_diff_null hN] at this
obtain ⟨x, hx, hxN⟩ := nonempty_of_measure_ne_zero this.ne'
exact ⟨x, hxN, hx⟩
end FiniteMeasure
section ProbabilityMeasure
variable [IsProbabilityMeasure μ]
/-- **First moment method**. A measurable function is smaller than its integral on a set f
positive measure. -/
theorem measure_le_lintegral_pos (hf : AEMeasurable f μ) : 0 < μ {x | f x ≤ ∫⁻ a, f a ∂μ} := by
simpa only [laverage_eq_lintegral] using
measure_le_laverage_pos (IsProbabilityMeasure.ne_zero μ) hf
/-- **First moment method**. A measurable function is greater than its integral on a set f
positive measure. -/
theorem measure_lintegral_le_pos (hint : ∫⁻ a, f a ∂μ ≠ ∞) : 0 < μ {x | ∫⁻ a, f a ∂μ ≤ f x} := by
simpa only [laverage_eq_lintegral] using
measure_laverage_le_pos (IsProbabilityMeasure.ne_zero μ) hint
/-- **First moment method**. The minimum of a measurable function is smaller than its integral. -/
theorem exists_le_lintegral (hf : AEMeasurable f μ) : ∃ x, f x ≤ ∫⁻ a, f a ∂μ := by
simpa only [laverage_eq_lintegral] using exists_le_laverage (IsProbabilityMeasure.ne_zero μ) hf
/-- **First moment method**. The maximum of a measurable function is greater than its integral. -/
theorem exists_lintegral_le (hint : ∫⁻ a, f a ∂μ ≠ ∞) : ∃ x, ∫⁻ a, f a ∂μ ≤ f x := by
simpa only [laverage_eq_lintegral] using
exists_laverage_le (IsProbabilityMeasure.ne_zero μ) hint
/-- **First moment method**. The minimum of a measurable function is smaller than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_le_lintegral (hf : AEMeasurable f μ) (hN : μ N = 0) :
∃ x, x ∉ N ∧ f x ≤ ∫⁻ a, f a ∂μ := by
simpa only [laverage_eq_lintegral] using
exists_not_mem_null_le_laverage (IsProbabilityMeasure.ne_zero μ) hf hN
/-- **First moment method**. The maximum of a measurable function is greater than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_lintegral_le (hint : ∫⁻ a, f a ∂μ ≠ ∞) (hN : μ N = 0) :
∃ x, x ∉ N ∧ ∫⁻ a, f a ∂μ ≤ f x := by
simpa only [laverage_eq_lintegral] using
exists_not_mem_null_laverage_le (IsProbabilityMeasure.ne_zero μ) hint hN
end ProbabilityMeasure
end FirstMomentENNReal
/-- If the average of a function `f` along a sequence of sets `aₙ` converges to `c` (more precisely,
we require that `⨍ y in a i, ‖f y - c‖ ∂μ` tends to `0`), then the integral of `gₙ • f` also tends
to `c` if `gₙ` is supported in `aₙ`, has integral converging to one and supremum at most `K / μ aₙ`.
-/
theorem tendsto_integral_smul_of_tendsto_average_norm_sub
{ι : Type*} {a : ι → Set α} {l : Filter ι} {f : α → E} {c : E} {g : ι → α → ℝ} (K : ℝ)
(hf : Tendsto (fun i ↦ ⨍ y in a i, ‖f y - c‖ ∂μ) l (𝓝 0))
(f_int : ∀ᶠ i in l, IntegrableOn f (a i) μ)
(hg : Tendsto (fun i ↦ ∫ y, g i y ∂μ) l (𝓝 1))
(g_supp : ∀ᶠ i in l, Function.support (g i) ⊆ a i)
(g_bound : ∀ᶠ i in l, ∀ x, |g i x| ≤ K / (μ (a i)).toReal) :
Tendsto (fun i ↦ ∫ y, g i y • f y ∂μ) l (𝓝 c) := by
have g_int : ∀ᶠ i in l, Integrable (g i) μ := by
filter_upwards [(tendsto_order.1 hg).1 _ zero_lt_one] with i hi
contrapose hi
simp only [integral_undef hi, lt_self_iff_false, not_false_eq_true]
have I : ∀ᶠ i in l, ∫ y, g i y • (f y - c) ∂μ + (∫ y, g i y ∂μ) • c = ∫ y, g i y • f y ∂μ := by
filter_upwards [f_int, g_int, g_supp, g_bound] with i hif hig hisupp hibound
rw [← integral_smul_const, ← integral_add]
· simp only [smul_sub, sub_add_cancel]
· simp_rw [smul_sub]
apply Integrable.sub _ (hig.smul_const _)
have A : Function.support (fun y ↦ g i y • f y) ⊆ a i := by
apply Subset.trans _ hisupp
exact Function.support_smul_subset_left _ _
rw [← integrableOn_iff_integrable_of_support_subset A]
apply Integrable.smul_of_top_right hif
exact memℒp_top_of_bound hig.aestronglyMeasurable.restrict
(K / (μ (a i)).toReal) (eventually_of_forall hibound)
· exact hig.smul_const _
have L0 : Tendsto (fun i ↦ ∫ y, g i y • (f y - c) ∂μ) l (𝓝 0) := by
have := hf.const_mul K
simp only [mul_zero] at this
refine squeeze_zero_norm' ?_ this
filter_upwards [g_supp, g_bound, f_int, (tendsto_order.1 hg).1 _ zero_lt_one]
with i hi h'i h''i hi_int
have mu_ai : μ (a i) < ∞ := by
rw [lt_top_iff_ne_top]
intro h
simp only [h, ENNReal.top_toReal, _root_.div_zero, abs_nonpos_iff] at h'i
have : ∫ (y : α), g i y ∂μ = ∫ (y : α), 0 ∂μ := by congr; ext y; exact h'i y
simp [this] at hi_int
apply (norm_integral_le_integral_norm _).trans
simp_rw [average_eq, smul_eq_mul, ← integral_mul_left, norm_smul, ← mul_assoc, ← div_eq_mul_inv]
have : ∀ x, x ∉ a i → ‖g i x‖ * ‖(f x - c)‖ = 0 := by
intro x hx
have : g i x = 0 := by rw [← Function.nmem_support]; exact fun h ↦ hx (hi h)
simp [this]
rw [← setIntegral_eq_integral_of_forall_compl_eq_zero this (μ := μ)]
refine integral_mono_of_nonneg (eventually_of_forall (fun x ↦ by positivity)) ?_
(eventually_of_forall (fun x ↦ ?_))
· apply (Integrable.sub h''i _).norm.const_mul
change IntegrableOn (fun _ ↦ c) (a i) μ
simp [integrableOn_const, mu_ai]
· dsimp; gcongr; simpa using h'i x
have := L0.add (hg.smul_const c)
simp only [one_smul, zero_add] at this
exact Tendsto.congr' I this
end MeasureTheory
|
MeasureTheory\Integral\Bochner.lean | /-
Copyright (c) 2019 Zhouhang Zhou. 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
-/
import Mathlib.MeasureTheory.Integral.SetToL1
/-!
# Bochner integral
The Bochner integral extends the definition of the Lebesgue integral to functions that map from a
measure space into a Banach space (complete normed vector space). It is constructed here by
extending the integral on simple functions.
## Main definitions
The Bochner integral is defined through the extension process described in the file `SetToL1`,
which follows these steps:
1. Define the integral of the indicator of a set. This is `weightedSMul μ s x = (μ s).toReal * x`.
`weightedSMul μ` is shown to be linear in the value `x` and `DominatedFinMeasAdditive`
(defined in the file `SetToL1`) with respect to the set `s`.
2. Define the integral on simple functions of the type `SimpleFunc α E` (notation : `α →ₛ E`)
where `E` is a real normed space. (See `SimpleFunc.integral` for details.)
3. Transfer this definition to define the integral on `L1.simpleFunc α E` (notation :
`α →₁ₛ[μ] E`), see `L1.simpleFunc.integral`. Show that this integral is a continuous linear
map from `α →₁ₛ[μ] E` to `E`.
4. Define the Bochner integral on L1 functions by extending the integral on integrable simple
functions `α →₁ₛ[μ] E` using `ContinuousLinearMap.extend` and the fact that the embedding of
`α →₁ₛ[μ] E` into `α →₁[μ] E` is dense.
5. Define the Bochner integral on functions as the Bochner integral of its equivalence class in L1
space, if it is in L1, and 0 otherwise.
The result of that construction is `∫ a, f a ∂μ`, which is definitionally equal to
`setToFun (dominatedFinMeasAdditive_weightedSMul μ) f`. Some basic properties of the integral
(like linearity) are particular cases of the properties of `setToFun` (which are described in the
file `SetToL1`).
## Main statements
1. Basic properties of the Bochner integral on functions of type `α → E`, where `α` is a measure
space and `E` is a real normed space.
* `integral_zero` : `∫ 0 ∂μ = 0`
* `integral_add` : `∫ x, f x + g x ∂μ = ∫ x, f ∂μ + ∫ x, g x ∂μ`
* `integral_neg` : `∫ x, - f x ∂μ = - ∫ x, f x ∂μ`
* `integral_sub` : `∫ x, f x - g x ∂μ = ∫ x, f x ∂μ - ∫ x, g x ∂μ`
* `integral_smul` : `∫ x, r • f x ∂μ = r • ∫ x, f x ∂μ`
* `integral_congr_ae` : `f =ᵐ[μ] g → ∫ x, f x ∂μ = ∫ x, g x ∂μ`
* `norm_integral_le_integral_norm` : `‖∫ x, f x ∂μ‖ ≤ ∫ x, ‖f x‖ ∂μ`
2. Basic properties of the Bochner integral on functions of type `α → ℝ`, where `α` is a measure
space.
* `integral_nonneg_of_ae` : `0 ≤ᵐ[μ] f → 0 ≤ ∫ x, f x ∂μ`
* `integral_nonpos_of_ae` : `f ≤ᵐ[μ] 0 → ∫ x, f x ∂μ ≤ 0`
* `integral_mono_ae` : `f ≤ᵐ[μ] g → ∫ x, f x ∂μ ≤ ∫ x, g x ∂μ`
* `integral_nonneg` : `0 ≤ f → 0 ≤ ∫ x, f x ∂μ`
* `integral_nonpos` : `f ≤ 0 → ∫ x, f x ∂μ ≤ 0`
* `integral_mono` : `f ≤ᵐ[μ] g → ∫ x, f x ∂μ ≤ ∫ x, g x ∂μ`
3. Propositions connecting the Bochner integral with the integral on `ℝ≥0∞`-valued functions,
which is called `lintegral` and has the notation `∫⁻`.
* `integral_eq_lintegral_pos_part_sub_lintegral_neg_part` :
`∫ x, f x ∂μ = ∫⁻ x, f⁺ x ∂μ - ∫⁻ x, f⁻ x ∂μ`,
where `f⁺` is the positive part of `f` and `f⁻` is the negative part of `f`.
* `integral_eq_lintegral_of_nonneg_ae` : `0 ≤ᵐ[μ] f → ∫ x, f x ∂μ = ∫⁻ x, f x ∂μ`
4. (In the file `DominatedConvergence`)
`tendsto_integral_of_dominated_convergence` : the Lebesgue dominated convergence theorem
5. (In the file `SetIntegral`) integration commutes with continuous linear maps.
* `ContinuousLinearMap.integral_comp_comm`
* `LinearIsometry.integral_comp_comm`
## Notes
Some tips on how to prove a proposition if the API for the Bochner integral is not enough so that
you need to unfold the definition of the Bochner integral and go back to simple functions.
One method is to use the theorem `Integrable.induction` in the file `SimpleFuncDenseLp` (or one
of the related results, like `Lp.induction` for functions in `Lp`), which allows you to prove
something for an arbitrary integrable function.
Another method is using the following steps.
See `integral_eq_lintegral_pos_part_sub_lintegral_neg_part` for a complicated example, which proves
that `∫ f = ∫⁻ f⁺ - ∫⁻ f⁻`, with the first integral sign being the Bochner integral of a real-valued
function `f : α → ℝ`, and second and third integral sign being the integral on `ℝ≥0∞`-valued
functions (called `lintegral`). The proof of `integral_eq_lintegral_pos_part_sub_lintegral_neg_part`
is scattered in sections with the name `posPart`.
Here are the usual steps of proving that a property `p`, say `∫ f = ∫⁻ f⁺ - ∫⁻ f⁻`, holds for all
functions :
1. First go to the `L¹` space.
For example, if you see `ENNReal.toReal (∫⁻ a, ENNReal.ofReal <| ‖f a‖)`, that is the norm of
`f` in `L¹` space. Rewrite using `L1.norm_of_fun_eq_lintegral_norm`.
2. Show that the set `{f ∈ L¹ | ∫ f = ∫⁻ f⁺ - ∫⁻ f⁻}` is closed in `L¹` using `isClosed_eq`.
3. Show that the property holds for all simple functions `s` in `L¹` space.
Typically, you need to convert various notions to their `SimpleFunc` counterpart, using lemmas
like `L1.integral_coe_eq_integral`.
4. Since simple functions are dense in `L¹`,
```
univ = closure {s simple}
= closure {s simple | ∫ s = ∫⁻ s⁺ - ∫⁻ s⁻} : the property holds for all simple functions
⊆ closure {f | ∫ f = ∫⁻ f⁺ - ∫⁻ f⁻}
= {f | ∫ f = ∫⁻ f⁺ - ∫⁻ f⁻} : closure of a closed set is itself
```
Use `isClosed_property` or `DenseRange.induction_on` for this argument.
## Notations
* `α →ₛ E` : simple functions (defined in `MeasureTheory/Integration`)
* `α →₁[μ] E` : functions in L1 space, i.e., equivalence classes of integrable functions (defined in
`MeasureTheory/LpSpace`)
* `α →₁ₛ[μ] E` : simple functions in L1 space, i.e., equivalence classes of integrable simple
functions (defined in `MeasureTheory/SimpleFuncDense`)
* `∫ a, f a ∂μ` : integral of `f` with respect to a measure `μ`
* `∫ a, f a` : integral of `f` with respect to `volume`, the default measure on the ambient type
We also define notations for integral on a set, which are described in the file
`MeasureTheory/SetIntegral`.
Note : `ₛ` is typed using `\_s`. Sometimes it shows as a box if the font is missing.
## Tags
Bochner integral, simple function, function space, Lebesgue dominated convergence theorem
-/
assert_not_exists Differentiable
noncomputable section
open scoped Topology NNReal ENNReal MeasureTheory
open Set Filter TopologicalSpace ENNReal EMetric
namespace MeasureTheory
variable {α E F 𝕜 : Type*}
section WeightedSMul
open ContinuousLinearMap
variable [NormedAddCommGroup F] [NormedSpace ℝ F] {m : MeasurableSpace α} {μ : Measure α}
/-- Given a set `s`, return the continuous linear map `fun x => (μ s).toReal • x`. The extension
of that set function through `setToL1` gives the Bochner integral of L1 functions. -/
def weightedSMul {_ : MeasurableSpace α} (μ : Measure α) (s : Set α) : F →L[ℝ] F :=
(μ s).toReal • ContinuousLinearMap.id ℝ F
theorem weightedSMul_apply {m : MeasurableSpace α} (μ : Measure α) (s : Set α) (x : F) :
weightedSMul μ s x = (μ s).toReal • x := by simp [weightedSMul]
@[simp]
theorem weightedSMul_zero_measure {m : MeasurableSpace α} :
weightedSMul (0 : Measure α) = (0 : Set α → F →L[ℝ] F) := by ext1; simp [weightedSMul]
@[simp]
theorem weightedSMul_empty {m : MeasurableSpace α} (μ : Measure α) :
weightedSMul μ ∅ = (0 : F →L[ℝ] F) := by ext1 x; rw [weightedSMul_apply]; simp
theorem weightedSMul_add_measure {m : MeasurableSpace α} (μ ν : Measure α) {s : Set α}
(hμs : μ s ≠ ∞) (hνs : ν s ≠ ∞) :
(weightedSMul (μ + ν) s : F →L[ℝ] F) = weightedSMul μ s + weightedSMul ν s := by
ext1 x
push_cast
simp_rw [Pi.add_apply, weightedSMul_apply]
push_cast
rw [Pi.add_apply, ENNReal.toReal_add hμs hνs, add_smul]
theorem weightedSMul_smul_measure {m : MeasurableSpace α} (μ : Measure α) (c : ℝ≥0∞) {s : Set α} :
(weightedSMul (c • μ) s : F →L[ℝ] F) = c.toReal • weightedSMul μ s := by
ext1 x
push_cast
simp_rw [Pi.smul_apply, weightedSMul_apply]
push_cast
simp_rw [Pi.smul_apply, smul_eq_mul, toReal_mul, smul_smul]
theorem weightedSMul_congr (s t : Set α) (hst : μ s = μ t) :
(weightedSMul μ s : F →L[ℝ] F) = weightedSMul μ t := by
ext1 x; simp_rw [weightedSMul_apply]; congr 2
theorem weightedSMul_null {s : Set α} (h_zero : μ s = 0) : (weightedSMul μ s : F →L[ℝ] F) = 0 := by
ext1 x; rw [weightedSMul_apply, h_zero]; simp
theorem weightedSMul_union' (s t : Set α) (ht : MeasurableSet t) (hs_finite : μ s ≠ ∞)
(ht_finite : μ t ≠ ∞) (h_inter : s ∩ t = ∅) :
(weightedSMul μ (s ∪ t) : F →L[ℝ] F) = weightedSMul μ s + weightedSMul μ t := by
ext1 x
simp_rw [add_apply, weightedSMul_apply,
measure_union (Set.disjoint_iff_inter_eq_empty.mpr h_inter) ht,
ENNReal.toReal_add hs_finite ht_finite, add_smul]
@[nolint unusedArguments]
theorem weightedSMul_union (s t : Set α) (_hs : MeasurableSet s) (ht : MeasurableSet t)
(hs_finite : μ s ≠ ∞) (ht_finite : μ t ≠ ∞) (h_inter : s ∩ t = ∅) :
(weightedSMul μ (s ∪ t) : F →L[ℝ] F) = weightedSMul μ s + weightedSMul μ t :=
weightedSMul_union' s t ht hs_finite ht_finite h_inter
theorem weightedSMul_smul [NormedField 𝕜] [NormedSpace 𝕜 F] [SMulCommClass ℝ 𝕜 F] (c : 𝕜)
(s : Set α) (x : F) : weightedSMul μ s (c • x) = c • weightedSMul μ s x := by
simp_rw [weightedSMul_apply, smul_comm]
theorem norm_weightedSMul_le (s : Set α) : ‖(weightedSMul μ s : F →L[ℝ] F)‖ ≤ (μ s).toReal :=
calc
‖(weightedSMul μ s : F →L[ℝ] F)‖ = ‖(μ s).toReal‖ * ‖ContinuousLinearMap.id ℝ F‖ :=
norm_smul (μ s).toReal (ContinuousLinearMap.id ℝ F)
_ ≤ ‖(μ s).toReal‖ :=
((mul_le_mul_of_nonneg_left norm_id_le (norm_nonneg _)).trans (mul_one _).le)
_ = abs (μ s).toReal := Real.norm_eq_abs _
_ = (μ s).toReal := abs_eq_self.mpr ENNReal.toReal_nonneg
theorem dominatedFinMeasAdditive_weightedSMul {_ : MeasurableSpace α} (μ : Measure α) :
DominatedFinMeasAdditive μ (weightedSMul μ : Set α → F →L[ℝ] F) 1 :=
⟨weightedSMul_union, fun s _ _ => (norm_weightedSMul_le s).trans (one_mul _).symm.le⟩
theorem weightedSMul_nonneg (s : Set α) (x : ℝ) (hx : 0 ≤ x) : 0 ≤ weightedSMul μ s x := by
simp only [weightedSMul, Algebra.id.smul_eq_mul, coe_smul', _root_.id, coe_id', Pi.smul_apply]
exact mul_nonneg toReal_nonneg hx
end WeightedSMul
local infixr:25 " →ₛ " => SimpleFunc
namespace SimpleFunc
section PosPart
variable [LinearOrder E] [Zero E] [MeasurableSpace α]
/-- Positive part of a simple function. -/
def posPart (f : α →ₛ E) : α →ₛ E :=
f.map fun b => max b 0
/-- Negative part of a simple function. -/
def negPart [Neg E] (f : α →ₛ E) : α →ₛ E :=
posPart (-f)
theorem posPart_map_norm (f : α →ₛ ℝ) : (posPart f).map norm = posPart f := by
ext; rw [map_apply, Real.norm_eq_abs, abs_of_nonneg]; exact le_max_right _ _
theorem negPart_map_norm (f : α →ₛ ℝ) : (negPart f).map norm = negPart f := by
rw [negPart]; exact posPart_map_norm _
theorem posPart_sub_negPart (f : α →ₛ ℝ) : f.posPart - f.negPart = f := by
simp only [posPart, negPart]
ext a
rw [coe_sub]
exact max_zero_sub_eq_self (f a)
end PosPart
section Integral
/-!
### The Bochner integral of simple functions
Define the Bochner integral of simple functions of the type `α →ₛ β` where `β` is a normed group,
and prove basic property of this integral.
-/
open Finset
variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedSpace ℝ F] {p : ℝ≥0∞} {G F' : Type*}
[NormedAddCommGroup G] [NormedAddCommGroup F'] [NormedSpace ℝ F'] {m : MeasurableSpace α}
{μ : Measure α}
/-- Bochner integral of simple functions whose codomain is a real `NormedSpace`.
This is equal to `∑ x ∈ f.range, (μ (f ⁻¹' {x})).toReal • x` (see `integral_eq`). -/
def integral {_ : MeasurableSpace α} (μ : Measure α) (f : α →ₛ F) : F :=
f.setToSimpleFunc (weightedSMul μ)
theorem integral_def {_ : MeasurableSpace α} (μ : Measure α) (f : α →ₛ F) :
f.integral μ = f.setToSimpleFunc (weightedSMul μ) := rfl
theorem integral_eq {m : MeasurableSpace α} (μ : Measure α) (f : α →ₛ F) :
f.integral μ = ∑ x ∈ f.range, (μ (f ⁻¹' {x})).toReal • x := by
simp [integral, setToSimpleFunc, weightedSMul_apply]
theorem integral_eq_sum_filter [DecidablePred fun x : F => x ≠ 0] {m : MeasurableSpace α}
(f : α →ₛ F) (μ : Measure α) :
f.integral μ = ∑ x ∈ f.range.filter fun x => x ≠ 0, (μ (f ⁻¹' {x})).toReal • x := by
simp_rw [integral_def, setToSimpleFunc_eq_sum_filter, weightedSMul_apply]
/-- The Bochner integral is equal to a sum over any set that includes `f.range` (except `0`). -/
theorem integral_eq_sum_of_subset [DecidablePred fun x : F => x ≠ 0] {f : α →ₛ F} {s : Finset F}
(hs : (f.range.filter fun x => x ≠ 0) ⊆ s) :
f.integral μ = ∑ x ∈ s, (μ (f ⁻¹' {x})).toReal • x := by
rw [SimpleFunc.integral_eq_sum_filter, Finset.sum_subset hs]
rintro x - hx; rw [Finset.mem_filter, not_and_or, Ne, Classical.not_not] at hx
-- Porting note: reordered for clarity
rcases hx.symm with (rfl | hx)
· simp
rw [SimpleFunc.mem_range] at hx
-- Porting note: added
simp only [Set.mem_range, not_exists] at hx
rw [preimage_eq_empty] <;> simp [Set.disjoint_singleton_left, hx]
@[simp]
theorem integral_const {m : MeasurableSpace α} (μ : Measure α) (y : F) :
(const α y).integral μ = (μ univ).toReal • y := by
classical
calc
(const α y).integral μ = ∑ z ∈ {y}, (μ (const α y ⁻¹' {z})).toReal • z :=
integral_eq_sum_of_subset <| (filter_subset _ _).trans (range_const_subset _ _)
_ = (μ univ).toReal • y := by simp [Set.preimage] -- Porting note: added `Set.preimage`
@[simp]
theorem integral_piecewise_zero {m : MeasurableSpace α} (f : α →ₛ F) (μ : Measure α) {s : Set α}
(hs : MeasurableSet s) : (piecewise s hs f 0).integral μ = f.integral (μ.restrict s) := by
classical
refine (integral_eq_sum_of_subset ?_).trans
((sum_congr rfl fun y hy => ?_).trans (integral_eq_sum_filter _ _).symm)
· intro y hy
simp only [mem_filter, mem_range, coe_piecewise, coe_zero, piecewise_eq_indicator,
mem_range_indicator] at *
rcases hy with ⟨⟨rfl, -⟩ | ⟨x, -, rfl⟩, h₀⟩
exacts [(h₀ rfl).elim, ⟨Set.mem_range_self _, h₀⟩]
· dsimp
rw [Set.piecewise_eq_indicator, indicator_preimage_of_not_mem,
Measure.restrict_apply (f.measurableSet_preimage _)]
exact fun h₀ => (mem_filter.1 hy).2 (Eq.symm h₀)
/-- Calculate the integral of `g ∘ f : α →ₛ F`, where `f` is an integrable function from `α` to `E`
and `g` is a function from `E` to `F`. We require `g 0 = 0` so that `g ∘ f` is integrable. -/
theorem map_integral (f : α →ₛ E) (g : E → F) (hf : Integrable f μ) (hg : g 0 = 0) :
(f.map g).integral μ = ∑ x ∈ f.range, ENNReal.toReal (μ (f ⁻¹' {x})) • g x :=
map_setToSimpleFunc _ weightedSMul_union hf hg
/-- `SimpleFunc.integral` and `SimpleFunc.lintegral` agree when the integrand has type
`α →ₛ ℝ≥0∞`. But since `ℝ≥0∞` is not a `NormedSpace`, we need some form of coercion.
See `integral_eq_lintegral` for a simpler version. -/
theorem integral_eq_lintegral' {f : α →ₛ E} {g : E → ℝ≥0∞} (hf : Integrable f μ) (hg0 : g 0 = 0)
(ht : ∀ b, g b ≠ ∞) :
(f.map (ENNReal.toReal ∘ g)).integral μ = ENNReal.toReal (∫⁻ a, g (f a) ∂μ) := by
have hf' : f.FinMeasSupp μ := integrable_iff_finMeasSupp.1 hf
simp only [← map_apply g f, lintegral_eq_lintegral]
rw [map_integral f _ hf, map_lintegral, ENNReal.toReal_sum]
· refine Finset.sum_congr rfl fun b _ => ?_
-- Porting note: added `Function.comp_apply`
rw [smul_eq_mul, toReal_mul, mul_comm, Function.comp_apply]
· rintro a -
by_cases a0 : a = 0
· rw [a0, hg0, zero_mul]; exact WithTop.zero_ne_top
· apply mul_ne_top (ht a) (hf'.meas_preimage_singleton_ne_zero a0).ne
· simp [hg0]
variable [NormedField 𝕜] [NormedSpace 𝕜 E] [NormedSpace ℝ E] [SMulCommClass ℝ 𝕜 E]
theorem integral_congr {f g : α →ₛ E} (hf : Integrable f μ) (h : f =ᵐ[μ] g) :
f.integral μ = g.integral μ :=
setToSimpleFunc_congr (weightedSMul μ) (fun _ _ => weightedSMul_null) weightedSMul_union hf h
/-- `SimpleFunc.bintegral` and `SimpleFunc.integral` agree when the integrand has type
`α →ₛ ℝ≥0∞`. But since `ℝ≥0∞` is not a `NormedSpace`, we need some form of coercion. -/
theorem integral_eq_lintegral {f : α →ₛ ℝ} (hf : Integrable f μ) (h_pos : 0 ≤ᵐ[μ] f) :
f.integral μ = ENNReal.toReal (∫⁻ a, ENNReal.ofReal (f a) ∂μ) := by
have : f =ᵐ[μ] f.map (ENNReal.toReal ∘ ENNReal.ofReal) :=
h_pos.mono fun a h => (ENNReal.toReal_ofReal h).symm
rw [← integral_eq_lintegral' hf]
exacts [integral_congr hf this, ENNReal.ofReal_zero, fun b => ENNReal.ofReal_ne_top]
theorem integral_add {f g : α →ₛ E} (hf : Integrable f μ) (hg : Integrable g μ) :
integral μ (f + g) = integral μ f + integral μ g :=
setToSimpleFunc_add _ weightedSMul_union hf hg
theorem integral_neg {f : α →ₛ E} (hf : Integrable f μ) : integral μ (-f) = -integral μ f :=
setToSimpleFunc_neg _ weightedSMul_union hf
theorem integral_sub {f g : α →ₛ E} (hf : Integrable f μ) (hg : Integrable g μ) :
integral μ (f - g) = integral μ f - integral μ g :=
setToSimpleFunc_sub _ weightedSMul_union hf hg
theorem integral_smul (c : 𝕜) {f : α →ₛ E} (hf : Integrable f μ) :
integral μ (c • f) = c • integral μ f :=
setToSimpleFunc_smul _ weightedSMul_union weightedSMul_smul c hf
theorem norm_setToSimpleFunc_le_integral_norm (T : Set α → E →L[ℝ] F) {C : ℝ}
(hT_norm : ∀ s, MeasurableSet s → μ s < ∞ → ‖T s‖ ≤ C * (μ s).toReal) {f : α →ₛ E}
(hf : Integrable f μ) : ‖f.setToSimpleFunc T‖ ≤ C * (f.map norm).integral μ :=
calc
‖f.setToSimpleFunc T‖ ≤ C * ∑ x ∈ f.range, ENNReal.toReal (μ (f ⁻¹' {x})) * ‖x‖ :=
norm_setToSimpleFunc_le_sum_mul_norm_of_integrable T hT_norm f hf
_ = C * (f.map norm).integral μ := by
rw [map_integral f norm hf norm_zero]; simp_rw [smul_eq_mul]
theorem norm_integral_le_integral_norm (f : α →ₛ E) (hf : Integrable f μ) :
‖f.integral μ‖ ≤ (f.map norm).integral μ := by
refine (norm_setToSimpleFunc_le_integral_norm _ (fun s _ _ => ?_) hf).trans (one_mul _).le
exact (norm_weightedSMul_le s).trans (one_mul _).symm.le
theorem integral_add_measure {ν} (f : α →ₛ E) (hf : Integrable f (μ + ν)) :
f.integral (μ + ν) = f.integral μ + f.integral ν := by
simp_rw [integral_def]
refine setToSimpleFunc_add_left'
(weightedSMul μ) (weightedSMul ν) (weightedSMul (μ + ν)) (fun s _ hμνs => ?_) hf
rw [lt_top_iff_ne_top, Measure.coe_add, Pi.add_apply, ENNReal.add_ne_top] at hμνs
rw [weightedSMul_add_measure _ _ hμνs.1 hμνs.2]
end Integral
end SimpleFunc
namespace L1
open AEEqFun Lp.simpleFunc Lp
variable [NormedAddCommGroup E] [NormedAddCommGroup F] {m : MeasurableSpace α} {μ : Measure α}
namespace SimpleFunc
theorem norm_eq_integral (f : α →₁ₛ[μ] E) : ‖f‖ = ((toSimpleFunc f).map norm).integral μ := by
rw [norm_eq_sum_mul f, (toSimpleFunc f).map_integral norm (SimpleFunc.integrable f) norm_zero]
simp_rw [smul_eq_mul]
section PosPart
/-- Positive part of a simple function in L1 space. -/
nonrec def posPart (f : α →₁ₛ[μ] ℝ) : α →₁ₛ[μ] ℝ :=
⟨Lp.posPart (f : α →₁[μ] ℝ), by
rcases f with ⟨f, s, hsf⟩
use s.posPart
simp only [Subtype.coe_mk, Lp.coe_posPart, ← hsf, AEEqFun.posPart_mk,
SimpleFunc.coe_map, mk_eq_mk]
-- Porting note: added
simp [SimpleFunc.posPart, Function.comp, EventuallyEq.rfl] ⟩
/-- Negative part of a simple function in L1 space. -/
def negPart (f : α →₁ₛ[μ] ℝ) : α →₁ₛ[μ] ℝ :=
posPart (-f)
@[norm_cast]
theorem coe_posPart (f : α →₁ₛ[μ] ℝ) : (posPart f : α →₁[μ] ℝ) = Lp.posPart (f : α →₁[μ] ℝ) := rfl
@[norm_cast]
theorem coe_negPart (f : α →₁ₛ[μ] ℝ) : (negPart f : α →₁[μ] ℝ) = Lp.negPart (f : α →₁[μ] ℝ) := rfl
end PosPart
section SimpleFuncIntegral
/-!
### The Bochner integral of `L1`
Define the Bochner integral on `α →₁ₛ[μ] E` by extension from the simple functions `α →₁ₛ[μ] E`,
and prove basic properties of this integral. -/
variable [NormedField 𝕜] [NormedSpace 𝕜 E] [NormedSpace ℝ E] [SMulCommClass ℝ 𝕜 E] {F' : Type*}
[NormedAddCommGroup F'] [NormedSpace ℝ F']
attribute [local instance] simpleFunc.normedSpace
/-- The Bochner integral over simple functions in L1 space. -/
def integral (f : α →₁ₛ[μ] E) : E :=
(toSimpleFunc f).integral μ
theorem integral_eq_integral (f : α →₁ₛ[μ] E) : integral f = (toSimpleFunc f).integral μ := rfl
nonrec theorem integral_eq_lintegral {f : α →₁ₛ[μ] ℝ} (h_pos : 0 ≤ᵐ[μ] toSimpleFunc f) :
integral f = ENNReal.toReal (∫⁻ a, ENNReal.ofReal ((toSimpleFunc f) a) ∂μ) := by
rw [integral, SimpleFunc.integral_eq_lintegral (SimpleFunc.integrable f) h_pos]
theorem integral_eq_setToL1S (f : α →₁ₛ[μ] E) : integral f = setToL1S (weightedSMul μ) f := rfl
nonrec theorem integral_congr {f g : α →₁ₛ[μ] E} (h : toSimpleFunc f =ᵐ[μ] toSimpleFunc g) :
integral f = integral g :=
SimpleFunc.integral_congr (SimpleFunc.integrable f) h
theorem integral_add (f g : α →₁ₛ[μ] E) : integral (f + g) = integral f + integral g :=
setToL1S_add _ (fun _ _ => weightedSMul_null) weightedSMul_union _ _
theorem integral_smul (c : 𝕜) (f : α →₁ₛ[μ] E) : integral (c • f) = c • integral f :=
setToL1S_smul _ (fun _ _ => weightedSMul_null) weightedSMul_union weightedSMul_smul c f
theorem norm_integral_le_norm (f : α →₁ₛ[μ] E) : ‖integral f‖ ≤ ‖f‖ := by
rw [integral, norm_eq_integral]
exact (toSimpleFunc f).norm_integral_le_integral_norm (SimpleFunc.integrable f)
variable {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E'] [NormedSpace 𝕜 E']
variable (α E μ 𝕜)
/-- The Bochner integral over simple functions in L1 space as a continuous linear map. -/
def integralCLM' : (α →₁ₛ[μ] E) →L[𝕜] E :=
LinearMap.mkContinuous ⟨⟨integral, integral_add⟩, integral_smul⟩ 1 fun f =>
le_trans (norm_integral_le_norm _) <| by rw [one_mul]
/-- The Bochner integral over simple functions in L1 space as a continuous linear map over ℝ. -/
def integralCLM : (α →₁ₛ[μ] E) →L[ℝ] E :=
integralCLM' α E ℝ μ
variable {α E μ 𝕜}
local notation "Integral" => integralCLM α E μ
open ContinuousLinearMap
theorem norm_Integral_le_one : ‖Integral‖ ≤ 1 :=
-- Porting note: Old proof was `LinearMap.mkContinuous_norm_le _ zero_le_one _`
LinearMap.mkContinuous_norm_le _ zero_le_one (fun f => by
rw [one_mul]
exact norm_integral_le_norm f)
section PosPart
theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart := by
have eq : ∀ a, (toSimpleFunc f).posPart a = max ((toSimpleFunc f) a) 0 := fun a => rfl
have ae_eq : ∀ᵐ a ∂μ, toSimpleFunc (posPart f) a = max ((toSimpleFunc f) a) 0 := by
filter_upwards [toSimpleFunc_eq_toFun (posPart f), Lp.coeFn_posPart (f : α →₁[μ] ℝ),
toSimpleFunc_eq_toFun f] with _ _ h₂ h₃
convert h₂ using 1
-- Porting note: added
rw [h₃]
refine ae_eq.mono fun a h => ?_
rw [h, eq]
theorem negPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
toSimpleFunc (negPart f) =ᵐ[μ] (toSimpleFunc f).negPart := by
rw [SimpleFunc.negPart, MeasureTheory.SimpleFunc.negPart]
filter_upwards [posPart_toSimpleFunc (-f), neg_toSimpleFunc f]
intro a h₁ h₂
rw [h₁]
show max _ _ = max _ _
rw [h₂]
rfl
theorem integral_eq_norm_posPart_sub (f : α →₁ₛ[μ] ℝ) : integral f = ‖posPart f‖ - ‖negPart f‖ := by
-- Convert things in `L¹` to their `SimpleFunc` counterpart
have ae_eq₁ : (toSimpleFunc f).posPart =ᵐ[μ] (toSimpleFunc (posPart f)).map norm := by
filter_upwards [posPart_toSimpleFunc f] with _ h
rw [SimpleFunc.map_apply, h]
conv_lhs => rw [← SimpleFunc.posPart_map_norm, SimpleFunc.map_apply]
-- Convert things in `L¹` to their `SimpleFunc` counterpart
have ae_eq₂ : (toSimpleFunc f).negPart =ᵐ[μ] (toSimpleFunc (negPart f)).map norm := by
filter_upwards [negPart_toSimpleFunc f] with _ h
rw [SimpleFunc.map_apply, h]
conv_lhs => rw [← SimpleFunc.negPart_map_norm, SimpleFunc.map_apply]
rw [integral, norm_eq_integral, norm_eq_integral, ← SimpleFunc.integral_sub]
· show (toSimpleFunc f).integral μ =
((toSimpleFunc (posPart f)).map norm - (toSimpleFunc (negPart f)).map norm).integral μ
apply MeasureTheory.SimpleFunc.integral_congr (SimpleFunc.integrable f)
filter_upwards [ae_eq₁, ae_eq₂] with _ h₁ h₂
rw [SimpleFunc.sub_apply, ← h₁, ← h₂]
exact DFunLike.congr_fun (toSimpleFunc f).posPart_sub_negPart.symm _
· exact (SimpleFunc.integrable f).pos_part.congr ae_eq₁
· exact (SimpleFunc.integrable f).neg_part.congr ae_eq₂
end PosPart
end SimpleFuncIntegral
end SimpleFunc
open SimpleFunc
local notation "Integral" => @integralCLM α E _ _ _ _ _ μ _
variable [NormedSpace ℝ E] [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E] [SMulCommClass ℝ 𝕜 E]
[NormedSpace ℝ F] [CompleteSpace E]
section IntegrationInL1
attribute [local instance] simpleFunc.normedSpace
open ContinuousLinearMap
variable (𝕜)
/-- The Bochner integral in L1 space as a continuous linear map. -/
nonrec def integralCLM' : (α →₁[μ] E) →L[𝕜] E :=
(integralCLM' α E 𝕜 μ).extend (coeToLp α E 𝕜) (simpleFunc.denseRange one_ne_top)
simpleFunc.uniformInducing
variable {𝕜}
/-- The Bochner integral in L1 space as a continuous linear map over ℝ. -/
def integralCLM : (α →₁[μ] E) →L[ℝ] E :=
integralCLM' ℝ
-- Porting note: added `(E := E)` in several places below.
/-- The Bochner integral in L1 space -/
irreducible_def integral : (α →₁[μ] E) → E :=
integralCLM (E := E)
theorem integral_eq (f : α →₁[μ] E) : integral f = integralCLM (E := E) f := by
simp only [integral]
theorem integral_eq_setToL1 (f : α →₁[μ] E) :
integral f = setToL1 (E := E) (dominatedFinMeasAdditive_weightedSMul μ) f := by
simp only [integral]; rfl
@[norm_cast]
theorem SimpleFunc.integral_L1_eq_integral (f : α →₁ₛ[μ] E) :
L1.integral (f : α →₁[μ] E) = SimpleFunc.integral f := by
simp only [integral, L1.integral]
exact setToL1_eq_setToL1SCLM (dominatedFinMeasAdditive_weightedSMul μ) f
variable (α E)
@[simp]
theorem integral_zero : integral (0 : α →₁[μ] E) = 0 := by
simp only [integral]
exact map_zero integralCLM
variable {α E}
@[integral_simps]
theorem integral_add (f g : α →₁[μ] E) : integral (f + g) = integral f + integral g := by
simp only [integral]
exact map_add integralCLM f g
@[integral_simps]
theorem integral_neg (f : α →₁[μ] E) : integral (-f) = -integral f := by
simp only [integral]
exact map_neg integralCLM f
@[integral_simps]
theorem integral_sub (f g : α →₁[μ] E) : integral (f - g) = integral f - integral g := by
simp only [integral]
exact map_sub integralCLM f g
@[integral_simps]
theorem integral_smul (c : 𝕜) (f : α →₁[μ] E) : integral (c • f) = c • integral f := by
simp only [integral]
show (integralCLM' (E := E) 𝕜) (c • f) = c • (integralCLM' (E := E) 𝕜) f
exact map_smul (integralCLM' (E := E) 𝕜) c f
local notation "Integral" => @integralCLM α E _ _ μ _ _
local notation "sIntegral" => @SimpleFunc.integralCLM α E _ _ μ _
theorem norm_Integral_le_one : ‖integralCLM (α := α) (E := E) (μ := μ)‖ ≤ 1 :=
norm_setToL1_le (dominatedFinMeasAdditive_weightedSMul μ) zero_le_one
theorem nnnorm_Integral_le_one : ‖integralCLM (α := α) (E := E) (μ := μ)‖₊ ≤ 1 :=
norm_Integral_le_one
theorem norm_integral_le (f : α →₁[μ] E) : ‖integral f‖ ≤ ‖f‖ :=
calc
‖integral f‖ = ‖integralCLM (E := E) f‖ := by simp only [integral]
_ ≤ ‖integralCLM (α := α) (E := E) (μ := μ)‖ * ‖f‖ := le_opNorm _ _
_ ≤ 1 * ‖f‖ := mul_le_mul_of_nonneg_right norm_Integral_le_one <| norm_nonneg _
_ = ‖f‖ := one_mul _
theorem nnnorm_integral_le (f : α →₁[μ] E) : ‖integral f‖₊ ≤ ‖f‖₊ :=
norm_integral_le f
@[continuity]
theorem continuous_integral : Continuous fun f : α →₁[μ] E => integral f := by
simp only [integral]
exact L1.integralCLM.continuous
section PosPart
theorem integral_eq_norm_posPart_sub (f : α →₁[μ] ℝ) :
integral f = ‖Lp.posPart f‖ - ‖Lp.negPart f‖ := by
-- Use `isClosed_property` and `isClosed_eq`
refine @isClosed_property _ _ _ ((↑) : (α →₁ₛ[μ] ℝ) → α →₁[μ] ℝ)
(fun f : α →₁[μ] ℝ => integral f = ‖Lp.posPart f‖ - ‖Lp.negPart f‖)
(simpleFunc.denseRange one_ne_top) (isClosed_eq ?_ ?_) ?_ f
· simp only [integral]
exact cont _
· refine Continuous.sub (continuous_norm.comp Lp.continuous_posPart)
(continuous_norm.comp Lp.continuous_negPart)
-- Show that the property holds for all simple functions in the `L¹` space.
· intro s
norm_cast
exact SimpleFunc.integral_eq_norm_posPart_sub _
end PosPart
end IntegrationInL1
end L1
/-!
## The Bochner integral on functions
Define the Bochner integral on functions generally to be the `L1` Bochner integral, for integrable
functions, and 0 otherwise; prove its basic properties.
-/
variable [NormedAddCommGroup E] [NormedSpace ℝ E] [hE : CompleteSpace E] [NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E] [SMulCommClass ℝ 𝕜 E] [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F]
{G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G]
open Classical in
/-- The Bochner integral -/
irreducible_def integral {_ : MeasurableSpace α} (μ : Measure α) (f : α → G) : G :=
if _ : CompleteSpace G then
if hf : Integrable f μ then L1.integral (hf.toL1 f) else 0
else 0
/-! In the notation for integrals, an expression like `∫ x, g ‖x‖ ∂μ` will not be parsed correctly,
and needs parentheses. We do not set the binding power of `r` to `0`, because then
`∫ x, f x = 0` will be parsed incorrectly. -/
@[inherit_doc MeasureTheory.integral]
notation3 "∫ "(...)", "r:60:(scoped f => f)" ∂"μ:70 => integral μ r
@[inherit_doc MeasureTheory.integral]
notation3 "∫ "(...)", "r:60:(scoped f => integral volume f) => r
@[inherit_doc MeasureTheory.integral]
notation3 "∫ "(...)" in "s", "r:60:(scoped f => f)" ∂"μ:70 => integral (Measure.restrict μ s) r
@[inherit_doc MeasureTheory.integral]
notation3 "∫ "(...)" in "s", "r:60:(scoped f => integral (Measure.restrict volume s) f) => r
section Properties
open ContinuousLinearMap MeasureTheory.SimpleFunc
variable {f g : α → E} {m : MeasurableSpace α} {μ : Measure α}
theorem integral_eq (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
theorem L1.integral_eq_integral (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]
theorem Integrable.of_integral_ne_zero {f : α → G} (h : ∫ a, f a ∂μ ≠ 0) : Integrable f μ :=
Not.imp_symm integral_undef h
theorem integral_non_aestronglyMeasurable {f : α → G} (h : ¬AEStronglyMeasurable f μ) :
∫ a, f a ∂μ = 0 :=
integral_undef <| not_and_of_not_left _ h
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]
theorem integral_zero' : integral μ (0 : α → G) = 0 :=
integral_zero α G
variable {α G}
theorem integrable_of_integral_eq_one {f : α → ℝ} (h : ∫ x, f x ∂μ = 1) : Integrable f μ :=
.of_integral_ne_zero <| h ▸ one_ne_zero
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]
theorem integral_add' {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) :
∫ a, (f + g) a ∂μ = ∫ a, f a ∂μ + ∫ a, g a ∂μ :=
integral_add hf hg
theorem integral_finset_sum {ι} (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_finset_sum (dominatedFinMeasAdditive_weightedSMul _) s hf
· simp [integral, hG]
@[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]
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]
theorem integral_sub' {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) :
∫ a, (f - g) a ∂μ = ∫ a, f a ∂μ - ∫ a, g a ∂μ :=
integral_sub hf hg
@[integral_simps]
theorem integral_smul [NormedSpace 𝕜 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]
theorem integral_mul_left {L : Type*} [RCLike L] (r : L) (f : α → L) :
∫ a, r * f a ∂μ = r * ∫ a, f a ∂μ :=
integral_smul r f
theorem integral_mul_right {L : Type*} [RCLike L] (r : L) (f : α → L) :
∫ a, f a * r ∂μ = (∫ a, f a ∂μ) * r := by
simp only [mul_comm]; exact integral_mul_left r f
theorem integral_div {L : Type*} [RCLike L] (r : L) (f : α → L) :
∫ a, f a / r ∂μ = (∫ a, f a ∂μ) / r := by
simpa only [← div_eq_mul_inv] using integral_mul_right 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]
-- Porting note: `nolint simpNF` added because simplify fails on left-hand side
@[simp, nolint simpNF]
theorem L1.integral_of_fun_eq_integral {f : α → G} (hf : Integrable f μ) :
∫ a, (hf.toL1 f) 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]
@[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]
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]
theorem ennnorm_integral_le_lintegral_ennnorm (f : α → G) :
(‖∫ a, f a ∂μ‖₊ : ℝ≥0∞) ≤ ∫⁻ a, ‖f a‖₊ ∂μ := by
simp_rw [← ofReal_norm_eq_coe_nnnorm]
apply ENNReal.ofReal_le_of_le_toReal
exact norm_integral_le_lintegral_norm f
theorem integral_eq_zero_of_ae {f : α → G} (hf : f =ᵐ[μ] 0) : ∫ a, f a ∂μ = 0 := by
simp [integral_congr_ae hf, integral_zero]
/-- If `f` has finite integral, then `∫ x in s, f x ∂μ` is absolutely continuous in `s`: it tends
to zero as `μ s` tends to zero. -/
theorem HasFiniteIntegral.tendsto_setIntegral_nhds_zero {ι} {f : α → G}
(hf : HasFiniteIntegral f μ) {l : Filter ι} {s : ι → Set α} (hs : Tendsto (μ ∘ s) l (𝓝 0)) :
Tendsto (fun i => ∫ x in s i, f x ∂μ) 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 => ennnorm_integral_le_lintegral_ennnorm _
@[deprecated (since := "2024-04-17")]
alias HasFiniteIntegral.tendsto_set_integral_nhds_zero :=
HasFiniteIntegral.tendsto_setIntegral_nhds_zero
/-- If `f` is integrable, then `∫ x in s, f x ∂μ` is absolutely continuous in `s`: it tends
to zero as `μ s` tends to zero. -/
theorem Integrable.tendsto_setIntegral_nhds_zero {ι} {f : α → G} (hf : Integrable f μ)
{l : Filter ι} {s : ι → Set α} (hs : Tendsto (μ ∘ s) l (𝓝 0)) :
Tendsto (fun i => ∫ x in s i, f x ∂μ) l (𝓝 0) :=
hf.2.tendsto_setIntegral_nhds_zero hs
@[deprecated (since := "2024-04-17")]
alias Integrable.tendsto_set_integral_nhds_zero :=
Integrable.tendsto_setIntegral_nhds_zero
/-- 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) μ)
(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]
/-- 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)) :
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_nnnorm, 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}
{l : Filter ι}
(hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ ∫⁻ x, ‖F i x - f x‖₊ ∂μ) l (𝓝 0))
(s : Set α) :
Tendsto (fun i ↦ ∫ x in s, F i x ∂μ) l (𝓝 (∫ x in s, f x ∂μ)) := by
refine tendsto_integral_of_L1 f hfi.restrict ?_ ?_
· filter_upwards [hFi] with i hi using hi.restrict
· simp_rw [← eLpNorm_one_eq_lintegral_nnnorm] 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)
@[deprecated (since := "2024-04-17")]
alias tendsto_set_integral_of_L1 := tendsto_setIntegral_of_L1
/-- 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 α) :
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_nnnorm, Pi.sub_apply] at hF
exact hF
@[deprecated (since := "2024-04-17")]
alias tendsto_set_integral_of_L1' := tendsto_setIntegral_of_L1'
variable {X : Type*} [TopologicalSpace X] [FirstCountableTopology X]
theorem continuousWithinAt_of_dominated {F : X → α → G} {x₀ : X} {bound : α → ℝ} {s : Set X}
(hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) μ)
(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]
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]
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]
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]
/-- 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`. -/
theorem integral_eq_lintegral_pos_part_sub_lintegral_neg_part {f : α → ℝ} (hf : Integrable f μ) :
∫ a, f a ∂μ =
ENNReal.toReal (∫⁻ a, .ofReal (f a) ∂μ) - ENNReal.toReal (∫⁻ a, .ofReal (-f a) ∂μ) := by
let f₁ := hf.toL1 f
-- Go to the `L¹` space
have eq₁ : ENNReal.toReal (∫⁻ a, ENNReal.ofReal (f a) ∂μ) = ‖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) ∂μ) = ‖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 : α → ℝ} (hf : 0 ≤ᵐ[μ] f)
(hfm : AEStronglyMeasurable f μ) :
∫ a, f a ∂μ = ENNReal.toReal (∫⁻ a, ENNReal.ofReal (f a) ∂μ) := 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) ∂μ = 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, zero_toReal, _root_.sub_zero]
· rw [integral_undef hfi]
simp_rw [Integrable, hfm, hasFiniteIntegral_iff_norm, lt_top_iff_ne_top, Ne, true_and_iff,
Classical.not_not] at hfi
have : ∫⁻ a : α, ENNReal.ofReal (f a) ∂μ = ∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ := by
refine lintegral_congr_ae (hf.mono fun a h => ?_)
dsimp only
rw [Real.norm_eq_abs, abs_of_nonneg h]
rw [this, hfi]; rfl
theorem integral_norm_eq_lintegral_nnnorm {P : Type*} [NormedAddCommGroup P] {f : α → P}
(hf : AEStronglyMeasurable f μ) : ∫ x, ‖f x‖ ∂μ = ENNReal.toReal (∫⁻ x, ‖f x‖₊ ∂μ) := by
rw [integral_eq_lintegral_of_nonneg_ae _ hf.norm]
· simp_rw [ofReal_norm_eq_coe_nnnorm]
· filter_upwards; simp_rw [Pi.zero_apply, norm_nonneg, imp_true_iff]
theorem ofReal_integral_norm_eq_lintegral_nnnorm {P : Type*} [NormedAddCommGroup P] {f : α → P}
(hf : Integrable f μ) : ENNReal.ofReal (∫ x, ‖f x‖ ∂μ) = ∫⁻ x, ‖f x‖₊ ∂μ := by
rw [integral_norm_eq_lintegral_nnnorm hf.aestronglyMeasurable,
ENNReal.ofReal_toReal (lt_top_iff_ne_top.mp hf.2)]
theorem integral_eq_integral_pos_part_sub_integral_neg_part {f : α → ℝ} (hf : Integrable f μ) :
∫ a, f a ∂μ = ∫ a, (Real.toNNReal (f a) : ℝ) ∂μ - ∫ a, (Real.toNNReal (-f a) : ℝ) ∂μ := by
rw [← integral_sub hf.real_toNNReal]
· simp
· exact hf.neg.real_toNNReal
theorem integral_nonneg_of_ae {f : α → ℝ} (hf : 0 ≤ᵐ[μ] f) : 0 ≤ ∫ a, f a ∂μ := by
have A : CompleteSpace ℝ := by infer_instance
simp only [integral_def, A, L1.integral_def, dite_true]
exact setToFun_nonneg (dominatedFinMeasAdditive_weightedSMul μ)
(fun s _ _ => weightedSMul_nonneg s) hf
theorem lintegral_coe_eq_integral (f : α → ℝ≥0) (hfi : Integrable (fun x => (f x : ℝ)) μ) :
∫⁻ a, f a ∂μ = ENNReal.ofReal (∫ a, f a ∂μ) := 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]
rw [← lt_top_iff_ne_top]
convert hfi.hasFiniteIntegral
-- Porting note: `convert` no longer unfolds `HasFiniteIntegral`
simp_rw [HasFiniteIntegral, NNReal.nnnorm_eq]
theorem ofReal_integral_eq_lintegral_ofReal {f : α → ℝ} (hfi : Integrable f μ) (f_nn : 0 ≤ᵐ[μ] f) :
ENNReal.ofReal (∫ x, f x ∂μ) = ∫⁻ x, ENNReal.ofReal (f x) ∂μ := 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_nnnorm hfi,
← ofReal_norm_eq_coe_nnnorm]
exact lintegral_congr_ae (this.symm.fun_comp ENNReal.ofReal)
theorem integral_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : ∀ᵐ x ∂μ, f x < ∞) :
∫ a, (f a).toReal ∂μ = (∫⁻ a, f a ∂μ).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 : α → ℝ≥0} (hfi : Integrable (fun x => (f x : ℝ)) μ)
{b : ℝ≥0} : ∫⁻ a, f a ∂μ ≤ b ↔ ∫ a, (f a : ℝ) ∂μ ≤ 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 : α → ℝ≥0} {b : ℝ≥0} (h : ∫⁻ a, f a ∂μ ≤ b) :
∫ a, (f a : ℝ) ∂μ ≤ 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_nonneg {f : α → ℝ} (hf : 0 ≤ f) : 0 ≤ ∫ a, f a ∂μ :=
integral_nonneg_of_ae <| eventually_of_forall hf
theorem integral_nonpos_of_ae {f : α → ℝ} (hf : f ≤ᵐ[μ] 0) : ∫ a, f a ∂μ ≤ 0 := by
have hf : 0 ≤ᵐ[μ] -f := hf.mono fun a h => by rwa [Pi.neg_apply, Pi.zero_apply, neg_nonneg]
have : 0 ≤ ∫ a, -f a ∂μ := integral_nonneg_of_ae hf
rwa [integral_neg, neg_nonneg] at this
theorem integral_nonpos {f : α → ℝ} (hf : f ≤ 0) : ∫ a, f a ∂μ ≤ 0 :=
integral_nonpos_of_ae <| eventually_of_forall hf
theorem integral_eq_zero_iff_of_nonneg_ae {f : α → ℝ} (hf : 0 ≤ᵐ[μ] f) (hfi : Integrable f μ) :
∫ x, f x ∂μ = 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_iff]
-- Porting note: split into parts, to make `rw` and `simp` work
rw [lintegral_eq_zero_iff']
· rw [← hf.le_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 : α → ℝ} (hf : 0 ≤ f) (hfi : Integrable f μ) :
∫ x, f x ∂μ = 0 ↔ f =ᵐ[μ] 0 :=
integral_eq_zero_iff_of_nonneg_ae (eventually_of_forall hf) hfi
lemma integral_eq_iff_of_ae_le {f g : α → ℝ}
(hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) :
∫ a, f a ∂μ = ∫ a, g a ∂μ ↔ 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 : α → ℝ} (hf : 0 ≤ᵐ[μ] f) (hfi : Integrable f μ) :
(0 < ∫ x, f x ∂μ) ↔ 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 : α → ℝ} (hf : 0 ≤ f) (hfi : Integrable f μ) :
(0 < ∫ x, f x ∂μ) ↔ 0 < μ (Function.support f) :=
integral_pos_iff_support_of_nonneg_ae (eventually_of_forall hf) hfi
lemma integral_exp_pos {μ : Measure α} {f : α → ℝ} [hμ : NeZero μ]
(hf : Integrable (fun x ↦ Real.exp (f x)) μ) :
0 < ∫ x, Real.exp (f x) ∂μ := 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 α} {f : ℕ → α → ℝ} {F : α → ℝ}
(hf : ∀ n, Integrable (f n) μ) (hF : Integrable F μ) (h_mono : ∀ᵐ x ∂μ, Monotone fun n ↦ f n x)
(h_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) :
Tendsto (fun n ↦ ∫ x, f n x ∂μ) atTop (𝓝 (∫ x, F x ∂μ)) := by
-- switch from the Bochner to the Lebesgue integral
let f' := fun n x ↦ f n x - f 0 x
have hf'_nonneg : ∀ᵐ x ∂μ, ∀ n, 0 ≤ f' n x := by
filter_upwards [h_mono] with a ha n
simp [f', ha (zero_le n)]
have hf'_meas : ∀ n, Integrable (f' n) μ := fun n ↦ (hf n).sub (hf 0)
suffices Tendsto (fun n ↦ ∫ x, f' n x ∂μ) atTop (𝓝 (∫ x, (F - f 0) x ∂μ)) by
simp_rw [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) ∂μ) ?_
swap
· rw [← ofReal_integral_eq_lintegral_ofReal (hF.sub (hf 0)) hF_ge]
exact ENNReal.ofReal_ne_top
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 α} {f : ℕ → α → ℝ} {F : α → ℝ}
(hf : ∀ n, Integrable (f n) μ) (hF : Integrable F μ) (h_mono : ∀ᵐ x ∂μ, Antitone fun n ↦ f n x)
(h_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) :
Tendsto (fun n ↦ ∫ x, f n x ∂μ) atTop (𝓝 (∫ x, F x ∂μ)) := by
suffices Tendsto (fun n ↦ ∫ x, -f n x ∂μ) atTop (𝓝 (∫ x, -F x ∂μ)) by
suffices Tendsto (fun n ↦ ∫ x, - -f n x ∂μ) atTop (𝓝 (∫ x, - -F x ∂μ)) 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 α} {f : ℕ → α → ℝ} {F : α → ℝ}
(hf_int : ∀ n, Integrable (f n) μ) (hF_int : Integrable F μ)
(hf_tendsto : Tendsto (fun i ↦ ∫ a, f i a ∂μ) atTop (𝓝 (∫ a, F a ∂μ)))
(hf_mono : ∀ᵐ a ∂μ, Monotone (fun i ↦ f i a))
(hf_bound : ∀ᵐ a ∂μ, ∀ i, f i a ≤ F a) :
∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F a)) := by
-- reduce to the `ℝ≥0∞` case
let f' : ℕ → α → ℝ≥0∞ := fun n a ↦ ENNReal.ofReal (f n a - f 0 a)
let F' : α → ℝ≥0∞ := fun a ↦ ENNReal.ofReal (F a - f 0 a)
have hf'_int_eq : ∀ i, ∫⁻ a, f' i a ∂μ = ENNReal.ofReal (∫ a, f i a ∂μ - ∫ a, f 0 a ∂μ) := by
intro i
unfold_let 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 i)]
have hF'_int_eq : ∫⁻ a, F' a ∂μ = ENNReal.ofReal (∫ a, F a ∂μ - ∫ a, f 0 a ∂μ) := by
unfold_let 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 ∂μ) atTop (𝓝 (∫⁻ a, F' a ∂μ)) := by
simp_rw [hf'_int_eq, hF'_int_eq]
refine (ENNReal.continuous_ofReal.tendsto _).comp ?_
rwa [tendsto_sub_const_iff]
have h_mono : ∀ᵐ a ∂μ, 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 ∂μ, ∀ 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_nnnorm _).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_let f'
ext i
rw [ENNReal.toReal_ofReal]
· abel
· simp [ha_mono (zero_le i)]
have h2 : F a = (F' a).toReal + f 0 a := by
unfold_let F'
rw [ENNReal.toReal_ofReal]
· abel
· simp [ha_bound 0]
rw [h1, h2]
refine Filter.Tendsto.add ?_ tendsto_const_nhds
exact (ENNReal.continuousAt_toReal ENNReal.ofReal_ne_top).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 α} {f : ℕ → α → ℝ} {F : α → ℝ}
(hf_int : ∀ n, Integrable (f n) μ) (hF_int : Integrable F μ)
(hf_tendsto : Tendsto (fun i ↦ ∫ a, f i a ∂μ) atTop (𝓝 (∫ a, F a ∂μ)))
(hf_mono : ∀ᵐ a ∂μ, Antitone (fun i ↦ f i a))
(hf_bound : ∀ᵐ a ∂μ, ∀ i, F a ≤ f i a) :
∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F a)) := by
let f' : ℕ → α → ℝ := fun i a ↦ - f i a
let F' : α → ℝ := fun a ↦ - F a
suffices ∀ᵐ a ∂μ, 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 : α →₁[μ] H) : ‖f‖ = ∫ a, ‖f a‖ ∂μ := by
simp only [eLpNorm, eLpNorm', ENNReal.one_toReal, 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 [ofReal_norm_eq_coe_nnnorm]
theorem L1.dist_eq_integral_dist (f g : α →₁[μ] H) : dist f g = ∫ a, dist (f a) (g a) ∂μ := 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 : α → H} (hf : Integrable f μ) :
‖hf.toL1 f‖ = ∫ a, ‖f a‖ ∂μ := by
rw [L1.norm_eq_integral_norm]
exact integral_congr_ae <| hf.coeFn_toL1.fun_comp _
theorem Memℒp.eLpNorm_eq_integral_rpow_norm {f : α → H} {p : ℝ≥0∞} (hp1 : p ≠ 0) (hp2 : p ≠ ∞)
(hf : Memℒp f p μ) :
eLpNorm f p μ = ENNReal.ofReal ((∫ a, ‖f a‖ ^ p.toReal ∂μ) ^ p.toReal⁻¹) := by
have A : ∫⁻ a : α, ENNReal.ofReal (‖f a‖ ^ p.toReal) ∂μ = ∫⁻ a : α, ‖f a‖₊ ^ p.toReal ∂μ := by
simp_rw [← ofReal_rpow_of_nonneg (norm_nonneg _) toReal_nonneg, ofReal_norm_eq_coe_nnnorm]
simp only [eLpNorm_eq_lintegral_rpow_nnnorm 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_nnnorm_lt_top_of_eLpNorm_lt_top hp1 hp2 hf.2).ne
@[deprecated (since := "2024-07-27")]
alias Memℒp.snorm_eq_integral_rpow_norm := Memℒp.eLpNorm_eq_integral_rpow_norm
end NormedAddCommGroup
theorem integral_mono_ae {f g : α → ℝ} (hf : Integrable f μ) (hg : Integrable g μ) (h : f ≤ᵐ[μ] g) :
∫ a, f a ∂μ ≤ ∫ a, g a ∂μ := by
have A : CompleteSpace ℝ := by infer_instance
simp only [integral, A, L1.integral]
exact setToFun_mono (dominatedFinMeasAdditive_weightedSMul μ)
(fun s _ _ => weightedSMul_nonneg s) hf hg h
@[mono]
theorem integral_mono {f g : α → ℝ} (hf : Integrable f μ) (hg : Integrable g μ) (h : f ≤ g) :
∫ a, f a ∂μ ≤ ∫ a, g a ∂μ :=
integral_mono_ae hf hg <| eventually_of_forall h
theorem integral_mono_of_nonneg {f g : α → ℝ} (hf : 0 ≤ᵐ[μ] f) (hgi : Integrable g μ)
(h : f ≤ᵐ[μ] g) : ∫ a, f a ∂μ ≤ ∫ a, g a ∂μ := by
by_cases hfm : AEStronglyMeasurable f μ
· refine integral_mono_ae ⟨hfm, ?_⟩ hgi h
refine hgi.hasFiniteIntegral.mono <| h.mp <| hf.mono fun x hf hfg => ?_
simpa [abs_of_nonneg hf, abs_of_nonneg (le_trans hf hfg)]
· rw [integral_non_aestronglyMeasurable hfm]
exact integral_nonneg_of_ae (hf.trans h)
theorem integral_mono_measure {f : α → ℝ} {ν} (hle : μ ≤ ν) (hf : 0 ≤ᵐ[ν] f)
(hfi : Integrable f ν) : ∫ a, f a ∂μ ≤ ∫ a, f a ∂ν := by
have hfi' : Integrable f μ := hfi.mono_measure hle
have hf' : 0 ≤ᵐ[μ] f := hle.absolutelyContinuous hf
rw [integral_eq_lintegral_of_nonneg_ae hf' hfi'.1, integral_eq_lintegral_of_nonneg_ae hf hfi.1,
ENNReal.toReal_le_toReal]
exacts [lintegral_mono' hle le_rfl, ((hasFiniteIntegral_iff_ofReal hf').1 hfi'.2).ne,
((hasFiniteIntegral_iff_ofReal hf).1 hfi.2).ne]
theorem norm_integral_le_integral_norm (f : α → G) : ‖∫ a, f a ∂μ‖ ≤ ∫ a, ‖f a‖ ∂μ := by
have le_ae : ∀ᵐ a ∂μ, 0 ≤ ‖f a‖ := eventually_of_forall fun a => norm_nonneg _
by_cases h : AEStronglyMeasurable f μ
· calc
‖∫ a, f a ∂μ‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ) :=
norm_integral_le_lintegral_norm _
_ = ∫ a, ‖f a‖ ∂μ := (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 norm_integral_le_of_norm_le {f : α → G} {g : α → ℝ} (hg : Integrable g μ)
(h : ∀ᵐ x ∂μ, ‖f x‖ ≤ g x) : ‖∫ x, f x ∂μ‖ ≤ ∫ x, g x ∂μ :=
calc
‖∫ x, f x ∂μ‖ ≤ ∫ x, ‖f x‖ ∂μ := norm_integral_le_integral_norm f
_ ≤ ∫ x, g x ∂μ := integral_mono_of_nonneg (eventually_of_forall fun _ => norm_nonneg _) hg h
theorem SimpleFunc.integral_eq_integral (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 μ) :
∫ x, f x ∂μ = ∑ x ∈ f.range, ENNReal.toReal (μ (f ⁻¹' {x})) • x := by
rw [← f.integral_eq_integral hfi, SimpleFunc.integral, ← SimpleFunc.integral_eq]; rfl
@[simp]
theorem integral_const (c : E) : ∫ _ : α, c ∂μ = (μ univ).toReal • c := by
cases' (@le_top _ _ _ (μ univ)).lt_or_eq with hμ hμ
· haveI : IsFiniteMeasure μ := ⟨hμ⟩
simp only [integral, hE, L1.integral]
exact setToFun_const (dominatedFinMeasAdditive_weightedSMul _) _
· by_cases hc : c = 0
· simp [hc, integral_zero]
· have : ¬Integrable (fun _ : α => c) μ := by
simp only [integrable_const_iff, not_or]
exact ⟨hc, hμ.not_lt⟩
simp [integral_undef, *]
theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure μ] {f : α → G} {C : ℝ}
(h : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : ‖∫ x, f x ∂μ‖ ≤ C * (μ univ).toReal :=
calc
‖∫ x, f x ∂μ‖ ≤ ∫ _, C ∂μ := norm_integral_le_of_norm_le (integrable_const C) h
_ = C * (μ univ).toReal := by rw [integral_const, smul_eq_mul, mul_comm]
theorem tendsto_integral_approxOn_of_measurable [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]
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]
{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
(𝓝 <| ∫ x, f x ∂μ) := 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 _)))
theorem tendsto_integral_norm_approxOn_sub [MeasurableSpace E] [BorelSpace E] {f : α → 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‖ ∂μ)
atTop (𝓝 0) := by
convert (tendsto_toReal zero_ne_top).comp (tendsto_approxOn_range_L1_nnnorm fmeas hf) with n
rw [integral_norm_eq_lintegral_nnnorm]
· simp
· apply (SimpleFunc.aestronglyMeasurable _).sub
apply (stronglyMeasurable_iff_measurable_separable.2 ⟨fmeas, ?_⟩ ).aestronglyMeasurable
exact .mono (.of_subtype (range f ∪ {0})) subset_union_left
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, Measure.coe_add, Pi.add_apply,
toReal_add hμνs.1.ne hμνs.2.ne]
@[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]
theorem integral_finset_sum_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
{s : Finset ι} (hf : ∀ i ∈ s, Integrable f (μ i)) :
∫ a, f a ∂(∑ i ∈ s, μ i) = ∑ i ∈ s, ∫ a, f a ∂μ i := by
induction s using Finset.cons_induction_on with
| h₁ => simp
| h₂ 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_finset_sum_measure.2 hf.2)
theorem nndist_integral_add_measure_le_lintegral
{f : α → G} (h₁ : Integrable f μ) (h₂ : Integrable f ν) :
(nndist (∫ x, f x ∂μ) (∫ x, f x ∂(μ + ν)) : ℝ≥0∞) ≤ ∫⁻ x, ‖f x‖₊ ∂ν := by
rw [integral_add_measure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel_left]
exact ennnorm_integral_le_lintegral_ennnorm _
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
(hf : Integrable f (Measure.sum μ)) :
HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
refine Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => ?_
lift ε to ℝ≥0 using ε0.le
have hf_lt : (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < ∞ := hf.2
have hmem : ∀ᶠ y in 𝓝 (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ), (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < y + ε := by
refine tendsto_id.add tendsto_const_nhds (lt_mem_nhds (α := ℝ≥0∞) <| ENNReal.lt_add_right ?_ ?_)
exacts [hf_lt.ne, ENNReal.coe_ne_zero.2 (NNReal.coe_ne_zero.1 ε0.ne')]
refine ((hasSum_lintegral_measure (fun x => ‖f x‖₊) μ).eventually hmem).mono fun s hs => ?_
obtain ⟨ν, hν⟩ : ∃ ν, (∑ i ∈ s, μ i) + ν = Measure.sum μ := by
refine ⟨Measure.sum fun i : ↥(sᶜ : Set ι) => μ i, ?_⟩
simpa only [← Measure.sum_coe_finset] using Measure.sum_add_sum_compl (s : Set ι) μ
rw [Metric.mem_ball, ← coe_nndist, NNReal.coe_lt_coe, ← ENNReal.coe_lt_coe, ← hν]
rw [← hν, integrable_add_measure] at hf
refine (nndist_integral_add_measure_le_lintegral hf.1 hf.2).trans_lt ?_
rw [← hν, lintegral_add_measure, lintegral_finset_sum_measure] at hs
exact lt_of_add_lt_add_left hs
theorem integral_sum_measure {ι} {_ : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
(hf : Integrable f (Measure.sum μ)) : ∫ a, f a ∂Measure.sum μ = ∑' i, ∫ a, f a ∂μ i :=
(hasSum_integral_measure hf).tsum_eq.symm
@[simp]
theorem integral_smul_measure (f : α → G) (c : ℝ≥0∞) :
∫ x, f x ∂c • μ = c.toReal • ∫ x, f x ∂μ := 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.top_toReal, 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 α → G →L[ℝ] G) c.toReal :=
mul_one c.toReal ▸ (dominatedFinMeasAdditive_weightedSMul (c • μ)).of_smul_measure c 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 : α → G) (c : ℝ≥0) :
∫ x, f x ∂(c • μ) = c • ∫ x, f x ∂μ :=
integral_smul_measure f (c : ℝ≥0∞)
theorem integral_map_of_stronglyMeasurable {β} [MeasurableSpace β] {φ : α → β} (hφ : Measurable φ)
{f : β → G} (hfm : StronglyMeasurable f) : ∫ y, f y ∂Measure.map φ μ = ∫ x, f (φ x) ∂μ := 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})
(by simp [insert_subset_insert, Set.range_comp_subset_range]) using 1
ext1 i
simp only [SimpleFunc.approxOn_comp, SimpleFunc.integral_eq, Measure.map_apply, hφ,
SimpleFunc.measurableSet_preimage, ← 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
rw [hy]
simp
theorem integral_map {β} [MeasurableSpace β] {φ : α → β} (hφ : AEMeasurable φ μ) {f : β → G}
(hfm : AEStronglyMeasurable f (Measure.map φ μ)) :
∫ y, f y ∂Measure.map φ μ = ∫ x, f (φ x) ∂μ :=
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) ∂μ :=
(integral_map_of_stronglyMeasurable hφ.measurable_mk hfm.stronglyMeasurable_mk)
_ = ∫ x, g (φ x) ∂μ := integral_congr_ae (hφ.ae_eq_mk.symm.fun_comp _)
_ = ∫ x, f (φ x) ∂μ := integral_congr_ae <| ae_eq_comp hφ hfm.ae_eq_mk.symm
theorem _root_.MeasurableEmbedding.integral_map {β} {_ : MeasurableSpace β} {f : α → β}
(hf : MeasurableEmbedding f) (g : β → G) : ∫ y, g y ∂Measure.map f μ = ∫ x, g (f x) ∂μ := 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_.ClosedEmbedding.integral_map {β} [TopologicalSpace α] [BorelSpace α]
[TopologicalSpace β] [MeasurableSpace β] [BorelSpace β] {φ : α → β} (hφ : ClosedEmbedding φ)
(f : β → G) : ∫ y, f y ∂Measure.map φ μ = ∫ x, f (φ x) ∂μ :=
hφ.measurableEmbedding.integral_map _
theorem integral_map_equiv {β} [MeasurableSpace β] (e : α ≃ᵐ β) (f : β → G) :
∫ y, f y ∂Measure.map e μ = ∫ x, f (e x) ∂μ :=
e.measurableEmbedding.integral_map f
theorem MeasurePreserving.integral_comp {β} {_ : MeasurableSpace β} {f : α → β} {ν}
(h₁ : MeasurePreserving f μ ν) (h₂ : MeasurableEmbedding f) (g : β → G) :
∫ x, g (f x) ∂μ = ∫ y, g y ∂ν :=
h₁.map_eq ▸ (h₂.integral_map g).symm
theorem MeasurePreserving.integral_comp' {β} [MeasurableSpace β] {ν} {f : α ≃ᵐ β}
(h : MeasurePreserving f μ ν) (g : β → G) :
∫ x, g (f x) ∂μ = ∫ y, g y ∂ν := MeasurePreserving.integral_comp h f.measurableEmbedding _
theorem integral_subtype_comap {α} [MeasurableSpace α] {μ : Measure α} {s : Set α}
(hs : MeasurableSet s) (f : α → G) :
∫ x : s, f (x : α) ∂(Measure.comap Subtype.val μ) = ∫ x in s, f x ∂μ := 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 {α} [MeasureSpace α] {s : Set α} (hs : MeasurableSet s) (f : α → G) :
∫ x : s, f x = ∫ x in s, f x := integral_subtype_comap hs f
@[simp]
theorem integral_dirac' [MeasurableSpace α] (f : α → E) (a : α) (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 [Measure.dirac_apply_of_mem]
@[simp]
theorem integral_dirac [MeasurableSpace α] [MeasurableSingletonClass α] (f : α → E) (a : α) :
∫ 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 [Measure.dirac_apply_of_mem]
theorem setIntegral_dirac' {mα : MeasurableSpace α} {f : α → E} (hf : StronglyMeasurable f) (a : α)
{s : Set α} (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 _
@[deprecated (since := "2024-04-17")]
alias set_integral_dirac' := setIntegral_dirac'
theorem setIntegral_dirac [MeasurableSpace α] [MeasurableSingletonClass α] (f : α → E) (a : α)
(s : Set α) [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 _
@[deprecated (since := "2024-04-17")]
alias set_integral_dirac := setIntegral_dirac
/-- **Markov's inequality** also known as **Chebyshev's first inequality**. -/
theorem mul_meas_ge_le_integral_of_nonneg {f : α → ℝ} (hf_nonneg : 0 ≤ᵐ[μ] f)
(hf_int : Integrable f μ) (ε : ℝ) : ε * (μ { x | ε ≤ f x }).toReal ≤ ∫ x, f x ∂μ := by
cases' eq_top_or_lt_top (μ {x | ε ≤ f x}) with hμ hμ
· simpa [hμ] using integral_nonneg_of_ae hf_nonneg
· have := Fact.mk hμ
calc
ε * (μ { x | ε ≤ f x }).toReal = ∫ _ in {x | ε ≤ f x}, ε ∂μ := by simp [mul_comm]
_ ≤ ∫ x in {x | ε ≤ f x}, f x ∂μ :=
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 : α → E} {p q : ℝ}
(hpq : p.IsConjExponent q) (hf : Memℒp f (ENNReal.ofReal p) μ)
(hg : Memℒp g (ENNReal.ofReal q) μ) :
∫ a, ‖f a‖ * ‖g a‖ ∂μ ≤ (∫ a, ‖f a‖ ^ p ∂μ) ^ (1 / p) * (∫ a, ‖g a‖ ^ q ∂μ) ^ (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 => Real.rpow_nonneg (norm_nonneg _) _
· exact (hg.1.norm.aemeasurable.pow aemeasurable_const).aestronglyMeasurable
· exact eventually_of_forall fun x => Real.rpow_nonneg (norm_nonneg _) _
· exact (hf.1.norm.aemeasurable.pow aemeasurable_const).aestronglyMeasurable
· exact eventually_of_forall fun x => mul_nonneg (norm_nonneg _) (norm_nonneg _)
· 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‖) ∂μ =
∫⁻ a, ((fun x => (‖f x‖₊ : ℝ≥0∞)) * fun x => (‖g x‖₊ : ℝ≥0∞)) a ∂μ := by
simp_rw [Pi.mul_apply, ← ofReal_norm_eq_coe_nnnorm, ENNReal.ofReal_mul (norm_nonneg _)]
have h_right_f : ∫⁻ a, ENNReal.ofReal (‖f a‖ ^ p) ∂μ = ∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ p ∂μ := by
refine lintegral_congr fun x => ?_
rw [← ofReal_norm_eq_coe_nnnorm, ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) hpq.nonneg]
have h_right_g : ∫⁻ a, ENNReal.ofReal (‖g a‖ ^ q) ∂μ = ∫⁻ a, (‖g a‖₊ : ℝ≥0∞) ^ q ∂μ := by
refine lintegral_congr fun x => ?_
rw [← ofReal_norm_eq_coe_nnnorm, 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_nnnorm]
· rw [ENNReal.toReal_ofReal hpq.nonneg]
· rw [Ne, ENNReal.ofReal_eq_zero, not_le]
exact hpq.pos
· exact ENNReal.coe_ne_top
· convert hg.eLpNorm_ne_top
rw [eLpNorm_eq_lintegral_rpow_nnnorm]
· rw [ENNReal.toReal_ofReal hpq.symm.nonneg]
· rw [Ne, ENNReal.ofReal_eq_zero, not_le]
exact hpq.symm.pos
· exact ENNReal.coe_ne_top
· 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 `α → ℝ`. 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.IsConjExponent q) {f g : α → ℝ}
(hf_nonneg : 0 ≤ᵐ[μ] f) (hg_nonneg : 0 ≤ᵐ[μ] g) (hf : Memℒp f (ENNReal.ofReal p) μ)
(hg : Memℒp g (ENNReal.ofReal q) μ) :
∫ a, f a * g a ∂μ ≤ (∫ a, f a ^ p ∂μ) ^ (1 / p) * (∫ a, g a ^ q ∂μ) ^ (1 / q) := by
have h_left : ∫ a, f a * g a ∂μ = ∫ a, ‖f a‖ * ‖g a‖ ∂μ := 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 ∂μ = ∫ a, ‖f a‖ ^ p ∂μ := 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 ∂μ = ∫ a, ‖g a‖ ^ q ∂μ := 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_countable' [Countable α] [MeasurableSingletonClass α] {μ : Measure α}
{f : α → E} (hf : Integrable f μ) :
∫ a, f a ∂μ = ∑' a, (μ {a}).toReal • f a := by
rw [← Measure.sum_smul_dirac μ] at hf
rw [← Measure.sum_smul_dirac μ, integral_sum_measure hf]
congr 1 with a : 1
rw [integral_smul_measure, integral_dirac, Measure.sum_smul_dirac]
theorem integral_singleton' {μ : Measure α} {f : α → E} (hf : StronglyMeasurable f) (a : α) :
∫ a in {a}, f a ∂μ = (μ {a}).toReal • f a := by
simp only [Measure.restrict_singleton, integral_smul_measure, integral_dirac' f a hf, smul_eq_mul,
mul_comm]
theorem integral_singleton [MeasurableSingletonClass α] {μ : Measure α} (f : α → E) (a : α) :
∫ a in {a}, f a ∂μ = (μ {a}).toReal • f a := by
simp only [Measure.restrict_singleton, integral_smul_measure, integral_dirac, smul_eq_mul,
mul_comm]
theorem integral_countable [MeasurableSingletonClass α] (f : α → E) {s : Set α} (hs : s.Countable)
(hf : Integrable f (μ.restrict s)) :
∫ a in s, f a ∂μ = ∑' a : s, (μ {(a : α)}).toReal • f a := by
have hi : Countable { x // x ∈ s } := Iff.mpr countable_coe_iff hs
have hf' : Integrable (fun (x : s) => f x) (Measure.comap Subtype.val μ) := by
rw [← map_comap_subtype_coe, integrable_map_measure] at hf
· apply hf
· exact Integrable.aestronglyMeasurable hf
· exact Measurable.aemeasurable measurable_subtype_coe
· exact Countable.measurableSet hs
rw [← integral_subtype_comap hs.measurableSet, integral_countable' hf']
congr 1 with a : 1
rw [Measure.comap_apply Subtype.val Subtype.coe_injective
(fun s' hs' => MeasurableSet.subtype_image (Countable.measurableSet hs) hs') _
(MeasurableSet.singleton a)]
simp
theorem integral_finset [MeasurableSingletonClass α] (s : Finset α) (f : α → E)
(hf : Integrable f (μ.restrict s)) :
∫ x in s, f x ∂μ = ∑ x ∈ s, (μ {x}).toReal • f x := by
rw [integral_countable _ s.countable_toSet hf, ← Finset.tsum_subtype']
theorem integral_fintype [MeasurableSingletonClass α] [Fintype α] (f : α → E)
(hf : Integrable f μ) :
∫ x, f x ∂μ = ∑ x, (μ {x}).toReal • f x := by
-- NB: Integrable f does not follow from Fintype, because the measure itself could be non-finite
rw [← integral_finset .univ, Finset.coe_univ, Measure.restrict_univ]
simp only [Finset.coe_univ, Measure.restrict_univ, hf]
theorem integral_unique [Unique α] (f : α → E) : ∫ x, f x ∂μ = (μ univ).toReal • f default :=
calc
∫ x, f x ∂μ = ∫ _, f default ∂μ := by congr with x; congr; exact Unique.uniq _ x
_ = (μ univ).toReal • f default := by rw [integral_const]
theorem integral_pos_of_integrable_nonneg_nonzero [TopologicalSpace α] [Measure.IsOpenPosMeasure μ]
{f : α → ℝ} {x : α} (f_cont : Continuous f) (f_int : Integrable f μ) (f_nonneg : 0 ≤ f)
(f_x : f x ≠ 0) : 0 < ∫ x, f x ∂μ :=
(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 {H β γ : Type*} [NormedAddCommGroup H] {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 ∂μ = ∑ x ∈ @SimpleFunc.range β F m f, ENNReal.toReal (μ (f ⁻¹' {x})) • x := by
simp_rw [← f.coe_toLargerSpace_eq hm]
have hf_int : Integrable (f.toLargerSpace hm) μ := by rwa [SimpleFunc.coe_toLargerSpace_eq]
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 ∂μ = ∫ x, f x ∂μ.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
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 ∂μ = ∫ x, f x ∂μ.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 ∂μ = ∫ 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) ?_
exact SimpleFunc.tendsto_approxOn_range_L1_nnnorm (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) _ _
(eventually_of_forall hf_seq_int_m) ?_
exact @SimpleFunc.tendsto_approxOn_range_L1_nnnorm β 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 f (μ.trim hm)) :
∫ x, f x ∂μ = ∫ x, f x ∂μ.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
theorem ae_eq_trim_of_stronglyMeasurable [TopologicalSpace γ] [MetrizableSpace γ] (hm : m ≤ m0)
{f g : β → γ} (hf : StronglyMeasurable[m] f) (hg : StronglyMeasurable[m] g)
(hfg : f =ᵐ[μ] g) : f =ᵐ[μ.trim hm] g := by
rwa [EventuallyEq, ae_iff, trim_measurableSet_eq hm]
exact (hf.measurableSet_eq_fun hg).compl
theorem ae_eq_trim_iff [TopologicalSpace γ] [MetrizableSpace γ] (hm : m ≤ m0) {f g : β → γ}
(hf : StronglyMeasurable[m] f) (hg : StronglyMeasurable[m] g) :
f =ᵐ[μ.trim hm] g ↔ f =ᵐ[μ] g :=
⟨ae_eq_of_ae_eq_trim, ae_eq_trim_of_stronglyMeasurable hm hf hg⟩
theorem ae_le_trim_of_stronglyMeasurable [LinearOrder γ] [TopologicalSpace γ]
[OrderClosedTopology γ] [PseudoMetrizableSpace γ] (hm : m ≤ m0) {f g : β → γ}
(hf : StronglyMeasurable[m] f) (hg : StronglyMeasurable[m] g) (hfg : f ≤ᵐ[μ] g) :
f ≤ᵐ[μ.trim hm] g := by
rwa [EventuallyLE, ae_iff, trim_measurableSet_eq hm]
exact (hf.measurableSet_le hg).compl
theorem ae_le_trim_iff [LinearOrder γ] [TopologicalSpace γ] [OrderClosedTopology γ]
[PseudoMetrizableSpace γ] (hm : m ≤ m0) {f g : β → γ} (hf : StronglyMeasurable[m] f)
(hg : StronglyMeasurable[m] g) : f ≤ᵐ[μ.trim hm] g ↔ f ≤ᵐ[μ] g :=
⟨ae_le_of_ae_le_trim, ae_le_trim_of_stronglyMeasurable hm hf hg⟩
end IntegralTrim
section SnormBound
variable {m0 : MeasurableSpace α} {μ : Measure α} {f : α → ℝ}
theorem eLpNorm_one_le_of_le {r : ℝ≥0} (hfint : Integrable f μ) (hfint' : 0 ≤ ∫ x, f x ∂μ)
(hf : ∀ᵐ ω ∂μ, 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
-- Porting note: two lines above were
--rw [hr, Nonneg.coe_zero] at hf
have hnegf : ∫ x, -f x ∂μ = 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]
· norm_num
haveI := hμ
rw [integral_eq_integral_pos_part_sub_integral_neg_part hfint, sub_nonneg] at hfint'
have hposbdd : ∫ ω, max (f ω) 0 ∂μ ≤ (μ Set.univ).toReal • (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 [Memℒp.eLpNorm_eq_integral_rpow_norm one_ne_zero ENNReal.one_ne_top
(memℒp_one_iff_integrable.2 hfint),
ENNReal.ofReal_le_iff_le_toReal
(ENNReal.mul_ne_top (ENNReal.mul_ne_top ENNReal.two_ne_top <| @measure_ne_top _ _ _ hμ _)
ENNReal.coe_ne_top)]
simp_rw [ENNReal.one_toReal, _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.one_toReal, ENNReal.coe_toReal,
Left.nonneg_neg_iff, Left.neg_nonpos_iff, toReal_ofNat] at hfint' ⊢
refine (add_le_add_left hfint' _).trans ?_
rwa [← two_mul, mul_assoc, mul_le_mul_left (two_pos : (0 : ℝ) < 2)]
· exact hfint.neg.sup (integrable_zero _ _ μ)
@[deprecated (since := "2024-07-27")]
alias snorm_one_le_of_le := eLpNorm_one_le_of_le
theorem eLpNorm_one_le_of_le' {r : ℝ} (hfint : Integrable f μ) (hfint' : 0 ≤ ∫ x, f x ∂μ)
(hf : ∀ᵐ ω ∂μ, 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ω
@[deprecated (since := "2024-07-27")]
alias snorm_one_le_of_le' := eLpNorm_one_le_of_le'
end SnormBound
end MeasureTheory
namespace Mathlib.Meta.Positivity
open Qq Lean Meta MeasureTheory
/-- Positivity extension for integrals.
This extension only proves non-negativity, strict positivity is more delicate for integration and
requires more assumptions. -/
@[positivity MeasureTheory.integral _ _]
def evalIntegral : PositivityExt where eval {u α} zα pα e := do
match u, α, e with
| 0, ~q(ℝ), ~q(@MeasureTheory.integral $i ℝ _ $inst2 _ _ $f) =>
let i : Q($i) ← mkFreshExprMVarQ q($i) .syntheticOpaque
have body : Q(ℝ) := .betaRev f #[i]
let rbody ← core zα pα body
let pbody ← rbody.toNonneg
let pr : Q(∀ x, 0 ≤ $f x) ← mkLambdaFVars #[i] pbody
assertInstancesCommute
return .nonnegative q(integral_nonneg $pr)
| _ => throwError "not MeasureTheory.integral"
end Mathlib.Meta.Positivity
|
MeasureTheory\Integral\BoundedContinuousFunction.lean | /-
Copyright (c) 2023 Kalle Kytölä. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kalle Kytölä
-/
import Mathlib.MeasureTheory.Integral.Bochner
/-!
# Integration of bounded continuous functions
In this file, some results are collected about integrals of bounded continuous functions. They are
mostly specializations of results in general integration theory, but they are used directly in this
specialized form in some other files, in particular in those related to the topology of weak
convergence of probability measures and finite measures.
-/
open MeasureTheory Filter
open scoped ENNReal NNReal BoundedContinuousFunction Topology
namespace BoundedContinuousFunction
section NNRealValued
lemma apply_le_nndist_zero {X : Type*} [TopologicalSpace X] (f : X →ᵇ ℝ≥0) (x : X) :
f x ≤ nndist 0 f := by
convert nndist_coe_le_nndist x
simp only [coe_zero, Pi.zero_apply, NNReal.nndist_zero_eq_val]
variable {X : Type*} [MeasurableSpace X] [TopologicalSpace X] [OpensMeasurableSpace X]
lemma lintegral_le_edist_mul (f : X →ᵇ ℝ≥0) (μ : Measure X) :
(∫⁻ x, f x ∂μ) ≤ edist 0 f * (μ Set.univ) :=
le_trans (lintegral_mono (fun x ↦ ENNReal.coe_le_coe.mpr (f.apply_le_nndist_zero x))) (by simp)
theorem measurable_coe_ennreal_comp (f : X →ᵇ ℝ≥0) :
Measurable fun x ↦ (f x : ℝ≥0∞) :=
measurable_coe_nnreal_ennreal.comp f.continuous.measurable
variable (μ : Measure X) [IsFiniteMeasure μ]
theorem lintegral_lt_top_of_nnreal (f : X →ᵇ ℝ≥0) : ∫⁻ x, f x ∂μ < ∞ := by
apply IsFiniteMeasure.lintegral_lt_top_of_bounded_to_ennreal
refine ⟨nndist f 0, fun x ↦ ?_⟩
have key := BoundedContinuousFunction.NNReal.upper_bound f x
rwa [ENNReal.coe_le_coe]
theorem integrable_of_nnreal (f : X →ᵇ ℝ≥0) : Integrable (((↑) : ℝ≥0 → ℝ) ∘ ⇑f) μ := by
refine ⟨(NNReal.continuous_coe.comp f.continuous).measurable.aestronglyMeasurable, ?_⟩
simp only [HasFiniteIntegral, Function.comp_apply, NNReal.nnnorm_eq]
exact lintegral_lt_top_of_nnreal _ f
theorem integral_eq_integral_nnrealPart_sub (f : X →ᵇ ℝ) :
∫ x, f x ∂μ = (∫ x, (f.nnrealPart x : ℝ) ∂μ) - ∫ x, ((-f).nnrealPart x : ℝ) ∂μ := by
simp only [f.self_eq_nnrealPart_sub_nnrealPart_neg, Pi.sub_apply, integral_sub,
integrable_of_nnreal]
simp only [Function.comp_apply]
theorem lintegral_of_real_lt_top (f : X →ᵇ ℝ) :
∫⁻ x, ENNReal.ofReal (f x) ∂μ < ∞ := lintegral_lt_top_of_nnreal _ f.nnrealPart
theorem toReal_lintegral_coe_eq_integral (f : X →ᵇ ℝ≥0) (μ : Measure X) :
(∫⁻ x, (f x : ℝ≥0∞) ∂μ).toReal = ∫ x, (f x : ℝ) ∂μ := by
rw [integral_eq_lintegral_of_nonneg_ae _ (by simpa [Function.comp_apply] using
(NNReal.continuous_coe.comp f.continuous).measurable.aestronglyMeasurable)]
· simp only [ENNReal.ofReal_coe_nnreal]
· exact eventually_of_forall (by simp only [Pi.zero_apply, NNReal.zero_le_coe, imp_true_iff])
end NNRealValued
section BochnerIntegral
variable {X : Type*} [MeasurableSpace X] [TopologicalSpace X] [OpensMeasurableSpace X]
variable (μ : Measure X)
variable {E : Type*} [NormedAddCommGroup E] [SecondCountableTopology E]
variable [MeasurableSpace E] [BorelSpace E]
lemma lintegral_nnnorm_le (f : X →ᵇ E) :
∫⁻ x, ‖f x‖₊ ∂μ ≤ ‖f‖₊ * (μ Set.univ) := by
calc ∫⁻ x, ‖f x‖₊ ∂μ
_ ≤ ∫⁻ _, ‖f‖₊ ∂μ := by gcongr; apply nnnorm_coe_le_nnnorm
_ = ‖f‖₊ * (μ Set.univ) := by rw [lintegral_const]
lemma integrable [IsFiniteMeasure μ] (f : X →ᵇ E) :
Integrable f μ := by
refine ⟨f.continuous.measurable.aestronglyMeasurable, (hasFiniteIntegral_def _ _).mp ?_⟩
calc ∫⁻ x, ‖f x‖₊ ∂μ
_ ≤ ‖f‖₊ * (μ Set.univ) := f.lintegral_nnnorm_le μ
_ < ∞ := ENNReal.mul_lt_top ENNReal.coe_ne_top (measure_ne_top μ Set.univ)
variable [NormedSpace ℝ E]
lemma norm_integral_le_mul_norm [IsFiniteMeasure μ] (f : X →ᵇ E) :
‖∫ x, f x ∂μ‖ ≤ ENNReal.toReal (μ Set.univ) * ‖f‖ := by
calc ‖∫ x, f x ∂μ‖
_ ≤ ∫ x, ‖f x‖ ∂μ := by exact norm_integral_le_integral_norm _
_ ≤ ∫ _, ‖f‖ ∂μ := ?_
_ = ENNReal.toReal (μ Set.univ) • ‖f‖ := by rw [integral_const]
apply integral_mono _ (integrable_const ‖f‖) (fun x ↦ f.norm_coe_le_norm x) -- NOTE: `gcongr`?
exact (integrable_norm_iff f.continuous.measurable.aestronglyMeasurable).mpr (f.integrable μ)
lemma norm_integral_le_norm [IsProbabilityMeasure μ] (f : X →ᵇ E) :
‖∫ x, f x ∂μ‖ ≤ ‖f‖ := by
convert f.norm_integral_le_mul_norm μ
simp only [measure_univ, ENNReal.one_toReal, one_mul]
lemma isBounded_range_integral
{ι : Type*} (μs : ι → Measure X) [∀ i, IsProbabilityMeasure (μs i)] (f : X →ᵇ E) :
Bornology.IsBounded (Set.range (fun i ↦ ∫ x, f x ∂ (μs i))) := by
apply isBounded_iff_forall_norm_le.mpr ⟨‖f‖, fun v hv ↦ ?_⟩
obtain ⟨i, hi⟩ := hv
rw [← hi]
apply f.norm_integral_le_norm (μs i)
end BochnerIntegral
section RealValued
variable {X : Type*} [TopologicalSpace X]
variable [MeasurableSpace X] [OpensMeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ]
lemma integral_add_const (f : X →ᵇ ℝ) (c : ℝ) :
∫ x, (f + const X c) x ∂μ = ∫ x, f x ∂μ + ENNReal.toReal (μ (Set.univ)) • c := by
simp [integral_add (f.integrable _) (integrable_const c)]
lemma integral_const_sub (f : X →ᵇ ℝ) (c : ℝ) :
∫ x, (const X c - f) x ∂μ = ENNReal.toReal (μ (Set.univ)) • c - ∫ x, f x ∂μ := by
simp [integral_sub (integrable_const c) (f.integrable _)]
end RealValued
section tendsto_integral
variable {X : Type*} [TopologicalSpace X] [MeasurableSpace X] [OpensMeasurableSpace X]
lemma tendsto_integral_of_forall_limsup_integral_le_integral {ι : Type*} {L : Filter ι}
{μ : Measure X} [IsProbabilityMeasure μ] {μs : ι → Measure X} [∀ i, IsProbabilityMeasure (μs i)]
(h : ∀ f : X →ᵇ ℝ, 0 ≤ f → L.limsup (fun i ↦ ∫ x, f x ∂ (μs i)) ≤ ∫ x, f x ∂μ)
(f : X →ᵇ ℝ) :
Tendsto (fun i ↦ ∫ x, f x ∂ (μs i)) L (𝓝 (∫ x, f x ∂μ)) := by
rcases eq_or_neBot L with rfl|hL
· simp only [tendsto_bot]
have obs := BoundedContinuousFunction.isBounded_range_integral μs f
have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ x, f x ∂μs i) := obs.bddAbove.isBoundedUnder
have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ x, f x ∂μs i) := obs.bddBelow.isBoundedUnder
apply tendsto_of_le_liminf_of_limsup_le _ _ bdd_above bdd_below
· have key := h _ (f.norm_sub_nonneg)
simp_rw [f.integral_const_sub ‖f‖] at key
simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
have := limsup_const_sub L (fun i ↦ ∫ x, f x ∂ (μs i)) ‖f‖ bdd_above.isCobounded_ge bdd_below
rwa [this, _root_.sub_le_sub_iff_left ‖f‖] at key
· have key := h _ (f.add_norm_nonneg)
simp_rw [f.integral_add_const ‖f‖] at key
simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
have := limsup_add_const L (fun i ↦ ∫ x, f x ∂ (μs i)) ‖f‖ bdd_above bdd_below.isCobounded_le
rwa [this, add_le_add_iff_right] at key
lemma tendsto_integral_of_forall_integral_le_liminf_integral {ι : Type*} {L : Filter ι}
{μ : Measure X} [IsProbabilityMeasure μ] {μs : ι → Measure X} [∀ i, IsProbabilityMeasure (μs i)]
(h : ∀ f : X →ᵇ ℝ, 0 ≤ f → ∫ x, f x ∂μ ≤ L.liminf (fun i ↦ ∫ x, f x ∂ (μs i)))
(f : X →ᵇ ℝ) :
Tendsto (fun i ↦ ∫ x, f x ∂ (μs i)) L (𝓝 (∫ x, f x ∂μ)) := by
rcases eq_or_neBot L with rfl|hL
· simp only [tendsto_bot]
have obs := BoundedContinuousFunction.isBounded_range_integral μs f
have bdd_above : IsBoundedUnder (· ≤ ·) L (fun i ↦ ∫ x, f x ∂μs i) := obs.bddAbove.isBoundedUnder
have bdd_below : IsBoundedUnder (· ≥ ·) L (fun i ↦ ∫ x, f x ∂μs i) := obs.bddBelow.isBoundedUnder
apply @tendsto_of_le_liminf_of_limsup_le ℝ ι _ _ _ L (fun i ↦ ∫ x, f x ∂ (μs i)) (∫ x, f x ∂μ)
· have key := h _ (f.add_norm_nonneg)
simp_rw [f.integral_add_const ‖f‖] at key
simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
have := liminf_add_const L (fun i ↦ ∫ x, f x ∂ (μs i)) ‖f‖ bdd_above.isCobounded_ge bdd_below
rwa [this, add_le_add_iff_right] at key
· have key := h _ (f.norm_sub_nonneg)
simp_rw [f.integral_const_sub ‖f‖] at key
simp only [measure_univ, ENNReal.one_toReal, smul_eq_mul, one_mul] at key
have := liminf_const_sub L (fun i ↦ ∫ x, f x ∂ (μs i)) ‖f‖ bdd_above bdd_below.isCobounded_le
rwa [this, sub_le_sub_iff_left] at key
· exact bdd_above
· exact bdd_below
end tendsto_integral --section
end BoundedContinuousFunction
|
MeasureTheory\Integral\CircleIntegral.lean | /-
Copyright (c) 2021 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.Analysis.Calculus.Deriv.ZPow
import Mathlib.Analysis.NormedSpace.Pointwise
import Mathlib.Analysis.SpecialFunctions.NonIntegrable
import Mathlib.Analysis.Analytic.Basic
/-!
# Integral over a circle in `ℂ`
In this file we define `∮ z in C(c, R), f z` to be the integral $\oint_{|z-c|=|R|} f(z)\,dz$ and
prove some properties of this integral. We give definition and prove most lemmas for a function
`f : ℂ → E`, where `E` is a complex Banach space. For this reason,
some lemmas use, e.g., `(z - c)⁻¹ • f z` instead of `f z / (z - c)`.
## Main definitions
* `circleMap c R`: the exponential map $θ ↦ c + R e^{θi}$;
* `CircleIntegrable f c R`: a function `f : ℂ → E` is integrable on the circle with center `c` and
radius `R` if `f ∘ circleMap c R` is integrable on `[0, 2π]`;
* `circleIntegral f c R`: the integral $\oint_{|z-c|=|R|} f(z)\,dz$, defined as
$\int_{0}^{2π}(c + Re^{θ i})' f(c+Re^{θ i})\,dθ$;
* `cauchyPowerSeries f c R`: the power series that is equal to
$\sum_{n=0}^{\infty} \oint_{|z-c|=R} \left(\frac{w-c}{z - c}\right)^n \frac{1}{z-c}f(z)\,dz$ at
`w - c`. The coefficients of this power series depend only on `f ∘ circleMap c R`, and the power
series converges to `f w` if `f` is differentiable on the closed ball `Metric.closedBall c R`
and `w` belongs to the corresponding open ball.
## Main statements
* `hasFPowerSeriesOn_cauchy_integral`: for any circle integrable function `f`, the power series
`cauchyPowerSeries f c R`, `R > 0`, converges to the Cauchy integral
`(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z` on the open disc `Metric.ball c R`;
* `circleIntegral.integral_sub_zpow_of_undef`, `circleIntegral.integral_sub_zpow_of_ne`, and
`circleIntegral.integral_sub_inv_of_mem_ball`: formulas for `∮ z in C(c, R), (z - w) ^ n`,
`n : ℤ`. These lemmas cover the following cases:
- `circleIntegral.integral_sub_zpow_of_undef`, `n < 0` and `|w - c| = |R|`: in this case the
function is not integrable, so the integral is equal to its default value (zero);
- `circleIntegral.integral_sub_zpow_of_ne`, `n ≠ -1`: in the cases not covered by the previous
lemma, we have `(z - w) ^ n = ((z - w) ^ (n + 1) / (n + 1))'`, thus the integral equals zero;
- `circleIntegral.integral_sub_inv_of_mem_ball`, `n = -1`, `|w - c| < R`: in this case the
integral is equal to `2πi`.
The case `n = -1`, `|w -c| > R` is not covered by these lemmas. While it is possible to construct
an explicit primitive, it is easier to apply Cauchy theorem, so we postpone the proof till we have
this theorem (see #10000).
## Notation
- `∮ z in C(c, R), f z`: notation for the integral $\oint_{|z-c|=|R|} f(z)\,dz$, defined as
$\int_{0}^{2π}(c + Re^{θ i})' f(c+Re^{θ i})\,dθ$.
## Tags
integral, circle, Cauchy integral
-/
variable {E : Type*} [NormedAddCommGroup E]
noncomputable section
open scoped Real NNReal Interval Pointwise Topology
open Complex MeasureTheory TopologicalSpace Metric Function Set Filter Asymptotics
/-!
### `circleMap`, a parametrization of a circle
-/
/-- The exponential map $θ ↦ c + R e^{θi}$. The range of this map is the circle in `ℂ` with center
`c` and radius `|R|`. -/
def circleMap (c : ℂ) (R : ℝ) : ℝ → ℂ := fun θ => c + R * exp (θ * I)
/-- `circleMap` is `2π`-periodic. -/
theorem periodic_circleMap (c : ℂ) (R : ℝ) : Periodic (circleMap c R) (2 * π) := fun θ => by
simp [circleMap, add_mul, exp_periodic _]
theorem Set.Countable.preimage_circleMap {s : Set ℂ} (hs : s.Countable) (c : ℂ) {R : ℝ}
(hR : R ≠ 0) : (circleMap c R ⁻¹' s).Countable :=
show (((↑) : ℝ → ℂ) ⁻¹' ((· * I) ⁻¹'
(exp ⁻¹' ((R * ·) ⁻¹' ((c + ·) ⁻¹' s))))).Countable from
(((hs.preimage (add_right_injective _)).preimage <|
mul_right_injective₀ <| ofReal_ne_zero.2 hR).preimage_cexp.preimage <|
mul_left_injective₀ I_ne_zero).preimage ofReal_injective
@[simp]
theorem circleMap_sub_center (c : ℂ) (R : ℝ) (θ : ℝ) : circleMap c R θ - c = circleMap 0 R θ := by
simp [circleMap]
theorem circleMap_zero (R θ : ℝ) : circleMap 0 R θ = R * exp (θ * I) :=
zero_add _
@[simp]
theorem abs_circleMap_zero (R : ℝ) (θ : ℝ) : abs (circleMap 0 R θ) = |R| := by simp [circleMap]
theorem circleMap_mem_sphere' (c : ℂ) (R : ℝ) (θ : ℝ) : circleMap c R θ ∈ sphere c |R| := by simp
theorem circleMap_mem_sphere (c : ℂ) {R : ℝ} (hR : 0 ≤ R) (θ : ℝ) :
circleMap c R θ ∈ sphere c R := by
simpa only [_root_.abs_of_nonneg hR] using circleMap_mem_sphere' c R θ
theorem circleMap_mem_closedBall (c : ℂ) {R : ℝ} (hR : 0 ≤ R) (θ : ℝ) :
circleMap c R θ ∈ closedBall c R :=
sphere_subset_closedBall (circleMap_mem_sphere c hR θ)
theorem circleMap_not_mem_ball (c : ℂ) (R : ℝ) (θ : ℝ) : circleMap c R θ ∉ ball c R := by
simp [dist_eq, le_abs_self]
theorem circleMap_ne_mem_ball {c : ℂ} {R : ℝ} {w : ℂ} (hw : w ∈ ball c R) (θ : ℝ) :
circleMap c R θ ≠ w :=
(ne_of_mem_of_not_mem hw (circleMap_not_mem_ball _ _ _)).symm
/-- The range of `circleMap c R` is the circle with center `c` and radius `|R|`. -/
@[simp]
theorem range_circleMap (c : ℂ) (R : ℝ) : range (circleMap c R) = sphere c |R| :=
calc
range (circleMap c R) = c +ᵥ R • range fun θ : ℝ => exp (θ * I) := by
simp (config := { unfoldPartialApp := true }) only [← image_vadd, ← image_smul, ← range_comp,
vadd_eq_add, circleMap, Function.comp_def, real_smul]
_ = sphere c |R| := by
rw [Complex.range_exp_mul_I, smul_sphere R 0 zero_le_one]
simp
/-- The image of `(0, 2π]` under `circleMap c R` is the circle with center `c` and radius `|R|`. -/
@[simp]
theorem image_circleMap_Ioc (c : ℂ) (R : ℝ) : circleMap c R '' Ioc 0 (2 * π) = sphere c |R| := by
rw [← range_circleMap, ← (periodic_circleMap c R).image_Ioc Real.two_pi_pos 0, zero_add]
@[simp]
theorem circleMap_eq_center_iff {c : ℂ} {R : ℝ} {θ : ℝ} : circleMap c R θ = c ↔ R = 0 := by
simp [circleMap, exp_ne_zero]
@[simp]
theorem circleMap_zero_radius (c : ℂ) : circleMap c 0 = const ℝ c :=
funext fun _ => circleMap_eq_center_iff.2 rfl
theorem circleMap_ne_center {c : ℂ} {R : ℝ} (hR : R ≠ 0) {θ : ℝ} : circleMap c R θ ≠ c :=
mt circleMap_eq_center_iff.1 hR
theorem hasDerivAt_circleMap (c : ℂ) (R : ℝ) (θ : ℝ) :
HasDerivAt (circleMap c R) (circleMap 0 R θ * I) θ := by
simpa only [mul_assoc, one_mul, ofRealCLM_apply, circleMap, ofReal_one, zero_add]
using (((ofRealCLM.hasDerivAt (x := θ)).mul_const I).cexp.const_mul (R : ℂ)).const_add c
/- TODO: prove `ContDiff ℝ (circleMap c R)`. This needs a version of `ContDiff.mul`
for multiplication in a normed algebra over the base field. -/
theorem differentiable_circleMap (c : ℂ) (R : ℝ) : Differentiable ℝ (circleMap c R) := fun θ =>
(hasDerivAt_circleMap c R θ).differentiableAt
@[continuity, fun_prop]
theorem continuous_circleMap (c : ℂ) (R : ℝ) : Continuous (circleMap c R) :=
(differentiable_circleMap c R).continuous
@[fun_prop, measurability]
theorem measurable_circleMap (c : ℂ) (R : ℝ) : Measurable (circleMap c R) :=
(continuous_circleMap c R).measurable
@[simp]
theorem deriv_circleMap (c : ℂ) (R : ℝ) (θ : ℝ) : deriv (circleMap c R) θ = circleMap 0 R θ * I :=
(hasDerivAt_circleMap _ _ _).deriv
theorem deriv_circleMap_eq_zero_iff {c : ℂ} {R : ℝ} {θ : ℝ} :
deriv (circleMap c R) θ = 0 ↔ R = 0 := by simp [I_ne_zero]
theorem deriv_circleMap_ne_zero {c : ℂ} {R : ℝ} {θ : ℝ} (hR : R ≠ 0) :
deriv (circleMap c R) θ ≠ 0 :=
mt deriv_circleMap_eq_zero_iff.1 hR
theorem lipschitzWith_circleMap (c : ℂ) (R : ℝ) : LipschitzWith (Real.nnabs R) (circleMap c R) :=
lipschitzWith_of_nnnorm_deriv_le (differentiable_circleMap _ _) fun θ =>
NNReal.coe_le_coe.1 <| by simp
theorem continuous_circleMap_inv {R : ℝ} {z w : ℂ} (hw : w ∈ ball z R) :
Continuous fun θ => (circleMap z R θ - w)⁻¹ := by
have : ∀ θ, circleMap z R θ - w ≠ 0 := by
simp_rw [sub_ne_zero]
exact fun θ => circleMap_ne_mem_ball hw θ
-- Porting note: was `continuity`
exact Continuous.inv₀ (by fun_prop) this
/-!
### Integrability of a function on a circle
-/
/-- We say that a function `f : ℂ → E` is integrable on the circle with center `c` and radius `R` if
the function `f ∘ circleMap c R` is integrable on `[0, 2π]`.
Note that the actual function used in the definition of `circleIntegral` is
`(deriv (circleMap c R) θ) • f (circleMap c R θ)`. Integrability of this function is equivalent
to integrability of `f ∘ circleMap c R` whenever `R ≠ 0`. -/
def CircleIntegrable (f : ℂ → E) (c : ℂ) (R : ℝ) : Prop :=
IntervalIntegrable (fun θ : ℝ => f (circleMap c R θ)) volume 0 (2 * π)
@[simp]
theorem circleIntegrable_const (a : E) (c : ℂ) (R : ℝ) : CircleIntegrable (fun _ => a) c R :=
intervalIntegrable_const
namespace CircleIntegrable
variable {f g : ℂ → E} {c : ℂ} {R : ℝ}
nonrec theorem add (hf : CircleIntegrable f c R) (hg : CircleIntegrable g c R) :
CircleIntegrable (f + g) c R :=
hf.add hg
nonrec theorem neg (hf : CircleIntegrable f c R) : CircleIntegrable (-f) c R :=
hf.neg
/-- The function we actually integrate over `[0, 2π]` in the definition of `circleIntegral` is
integrable. -/
theorem out [NormedSpace ℂ E] (hf : CircleIntegrable f c R) :
IntervalIntegrable (fun θ : ℝ => deriv (circleMap c R) θ • f (circleMap c R θ)) volume 0
(2 * π) := by
simp only [CircleIntegrable, deriv_circleMap, intervalIntegrable_iff] at *
refine (hf.norm.const_mul |R|).mono' ?_ ?_
· exact ((continuous_circleMap _ _).aestronglyMeasurable.mul_const I).smul hf.aestronglyMeasurable
· simp [norm_smul]
end CircleIntegrable
@[simp]
theorem circleIntegrable_zero_radius {f : ℂ → E} {c : ℂ} : CircleIntegrable f c 0 := by
simp [CircleIntegrable]
theorem circleIntegrable_iff [NormedSpace ℂ E] {f : ℂ → E} {c : ℂ} (R : ℝ) :
CircleIntegrable f c R ↔ IntervalIntegrable (fun θ : ℝ =>
deriv (circleMap c R) θ • f (circleMap c R θ)) volume 0 (2 * π) := by
by_cases h₀ : R = 0
· simp (config := { unfoldPartialApp := true }) [h₀, const]
refine ⟨fun h => h.out, fun h => ?_⟩
simp only [CircleIntegrable, intervalIntegrable_iff, deriv_circleMap] at h ⊢
refine (h.norm.const_mul |R|⁻¹).mono' ?_ ?_
· have H : ∀ {θ}, circleMap 0 R θ * I ≠ 0 := fun {θ} => by simp [h₀, I_ne_zero]
simpa only [inv_smul_smul₀ H]
using ((continuous_circleMap 0 R).aestronglyMeasurable.mul_const
I).aemeasurable.inv.aestronglyMeasurable.smul h.aestronglyMeasurable
· simp [norm_smul, h₀]
theorem ContinuousOn.circleIntegrable' {f : ℂ → E} {c : ℂ} {R : ℝ}
(hf : ContinuousOn f (sphere c |R|)) : CircleIntegrable f c R :=
(hf.comp_continuous (continuous_circleMap _ _) (circleMap_mem_sphere' _ _)).intervalIntegrable _ _
theorem ContinuousOn.circleIntegrable {f : ℂ → E} {c : ℂ} {R : ℝ} (hR : 0 ≤ R)
(hf : ContinuousOn f (sphere c R)) : CircleIntegrable f c R :=
ContinuousOn.circleIntegrable' <| (_root_.abs_of_nonneg hR).symm ▸ hf
/-- The function `fun z ↦ (z - w) ^ n`, `n : ℤ`, is circle integrable on the circle with center `c`
and radius `|R|` if and only if `R = 0` or `0 ≤ n`, or `w` does not belong to this circle. -/
@[simp]
theorem circleIntegrable_sub_zpow_iff {c w : ℂ} {R : ℝ} {n : ℤ} :
CircleIntegrable (fun z => (z - w) ^ n) c R ↔ R = 0 ∨ 0 ≤ n ∨ w ∉ sphere c |R| := by
constructor
· intro h; contrapose! h; rcases h with ⟨hR, hn, hw⟩
simp only [circleIntegrable_iff R, deriv_circleMap]
rw [← image_circleMap_Ioc] at hw; rcases hw with ⟨θ, hθ, rfl⟩
replace hθ : θ ∈ [[0, 2 * π]] := Icc_subset_uIcc (Ioc_subset_Icc_self hθ)
refine not_intervalIntegrable_of_sub_inv_isBigO_punctured ?_ Real.two_pi_pos.ne hθ
set f : ℝ → ℂ := fun θ' => circleMap c R θ' - circleMap c R θ
have : ∀ᶠ θ' in 𝓝[≠] θ, f θ' ∈ ball (0 : ℂ) 1 \ {0} := by
suffices ∀ᶠ z in 𝓝[≠] circleMap c R θ, z - circleMap c R θ ∈ ball (0 : ℂ) 1 \ {0} from
((differentiable_circleMap c R θ).hasDerivAt.tendsto_punctured_nhds
(deriv_circleMap_ne_zero hR)).eventually this
filter_upwards [self_mem_nhdsWithin, mem_nhdsWithin_of_mem_nhds (ball_mem_nhds _ zero_lt_one)]
simp_all [dist_eq, sub_eq_zero]
refine (((hasDerivAt_circleMap c R θ).isBigO_sub.mono inf_le_left).inv_rev
(this.mono fun θ' h₁ h₂ => absurd h₂ h₁.2)).trans ?_
refine IsBigO.of_bound |R|⁻¹ (this.mono fun θ' hθ' => ?_)
set x := abs (f θ')
suffices x⁻¹ ≤ x ^ n by
simpa only [inv_mul_cancel_left₀, abs_eq_zero.not.2 hR, norm_eq_abs, map_inv₀,
Algebra.id.smul_eq_mul, map_mul, abs_circleMap_zero, abs_I, mul_one, abs_zpow, Ne,
not_false_iff] using this
have : x ∈ Ioo (0 : ℝ) 1 := by simpa [x, and_comm] using hθ'
rw [← zpow_neg_one]
refine (zpow_strictAnti this.1 this.2).le_iff_le.2 (Int.lt_add_one_iff.1 ?_); exact hn
· rintro (rfl | H)
exacts [circleIntegrable_zero_radius,
((continuousOn_id.sub continuousOn_const).zpow₀ _ fun z hz =>
H.symm.imp_left fun (hw : w ∉ sphere c |R|) =>
sub_ne_zero.2 <| ne_of_mem_of_not_mem hz hw).circleIntegrable']
@[simp]
theorem circleIntegrable_sub_inv_iff {c w : ℂ} {R : ℝ} :
CircleIntegrable (fun z => (z - w)⁻¹) c R ↔ R = 0 ∨ w ∉ sphere c |R| := by
simp only [← zpow_neg_one, circleIntegrable_sub_zpow_iff]; norm_num
variable [NormedSpace ℂ E] [CompleteSpace E]
/-- Definition for $\oint_{|z-c|=R} f(z)\,dz$. -/
def circleIntegral (f : ℂ → E) (c : ℂ) (R : ℝ) : E :=
∫ θ : ℝ in (0)..2 * π, deriv (circleMap c R) θ • f (circleMap c R θ)
notation3 "∮ "(...)" in ""C("c", "R")"", "r:(scoped f => circleIntegral f c R) => r
theorem circleIntegral_def_Icc (f : ℂ → E) (c : ℂ) (R : ℝ) :
(∮ z in C(c, R), f z) = ∫ θ in Icc 0 (2 * π),
deriv (circleMap c R) θ • f (circleMap c R θ) := by
rw [circleIntegral, intervalIntegral.integral_of_le Real.two_pi_pos.le,
Measure.restrict_congr_set Ioc_ae_eq_Icc]
namespace circleIntegral
@[simp]
theorem integral_radius_zero (f : ℂ → E) (c : ℂ) : (∮ z in C(c, 0), f z) = 0 := by
simp (config := { unfoldPartialApp := true }) [circleIntegral, const]
theorem integral_congr {f g : ℂ → E} {c : ℂ} {R : ℝ} (hR : 0 ≤ R) (h : EqOn f g (sphere c R)) :
(∮ z in C(c, R), f z) = ∮ z in C(c, R), g z :=
intervalIntegral.integral_congr fun θ _ => by simp only [h (circleMap_mem_sphere _ hR _)]
theorem integral_sub_inv_smul_sub_smul (f : ℂ → E) (c w : ℂ) (R : ℝ) :
(∮ z in C(c, R), (z - w)⁻¹ • (z - w) • f z) = ∮ z in C(c, R), f z := by
rcases eq_or_ne R 0 with (rfl | hR); · simp only [integral_radius_zero]
have : (circleMap c R ⁻¹' {w}).Countable := (countable_singleton _).preimage_circleMap c hR
refine intervalIntegral.integral_congr_ae ((this.ae_not_mem _).mono fun θ hθ _' => ?_)
change circleMap c R θ ≠ w at hθ
simp only [inv_smul_smul₀ (sub_ne_zero.2 <| hθ)]
theorem integral_undef {f : ℂ → E} {c : ℂ} {R : ℝ} (hf : ¬CircleIntegrable f c R) :
(∮ z in C(c, R), f z) = 0 :=
intervalIntegral.integral_undef (mt (circleIntegrable_iff R).mpr hf)
theorem integral_sub {f g : ℂ → E} {c : ℂ} {R : ℝ} (hf : CircleIntegrable f c R)
(hg : CircleIntegrable g c R) :
(∮ z in C(c, R), f z - g z) = (∮ z in C(c, R), f z) - ∮ z in C(c, R), g z := by
simp only [circleIntegral, smul_sub, intervalIntegral.integral_sub hf.out hg.out]
theorem norm_integral_le_of_norm_le_const' {f : ℂ → E} {c : ℂ} {R C : ℝ}
(hf : ∀ z ∈ sphere c |R|, ‖f z‖ ≤ C) : ‖∮ z in C(c, R), f z‖ ≤ 2 * π * |R| * C :=
calc
‖∮ z in C(c, R), f z‖ ≤ |R| * C * |2 * π - 0| :=
intervalIntegral.norm_integral_le_of_norm_le_const fun θ _ =>
calc
‖deriv (circleMap c R) θ • f (circleMap c R θ)‖ = |R| * ‖f (circleMap c R θ)‖ := by
simp [norm_smul]
_ ≤ |R| * C :=
mul_le_mul_of_nonneg_left (hf _ <| circleMap_mem_sphere' _ _ _) (abs_nonneg _)
_ = 2 * π * |R| * C := by rw [sub_zero, _root_.abs_of_pos Real.two_pi_pos]; ac_rfl
theorem norm_integral_le_of_norm_le_const {f : ℂ → E} {c : ℂ} {R C : ℝ} (hR : 0 ≤ R)
(hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C) : ‖∮ z in C(c, R), f z‖ ≤ 2 * π * R * C :=
have : |R| = R := abs_of_nonneg hR
calc
‖∮ z in C(c, R), f z‖ ≤ 2 * π * |R| * C := norm_integral_le_of_norm_le_const' <| by rwa [this]
_ = 2 * π * R * C := by rw [this]
theorem norm_two_pi_i_inv_smul_integral_le_of_norm_le_const {f : ℂ → E} {c : ℂ} {R C : ℝ}
(hR : 0 ≤ R) (hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C) :
‖(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), f z‖ ≤ R * C := by
have : ‖(2 * π * I : ℂ)⁻¹‖ = (2 * π)⁻¹ := by simp [Real.pi_pos.le]
rw [norm_smul, this, ← div_eq_inv_mul, div_le_iff Real.two_pi_pos, mul_comm (R * C), ← mul_assoc]
exact norm_integral_le_of_norm_le_const hR hf
/-- If `f` is continuous on the circle `|z - c| = R`, `R > 0`, the `‖f z‖` is less than or equal to
`C : ℝ` on this circle, and this norm is strictly less than `C` at some point `z` of the circle,
then `‖∮ z in C(c, R), f z‖ < 2 * π * R * C`. -/
theorem norm_integral_lt_of_norm_le_const_of_lt {f : ℂ → E} {c : ℂ} {R C : ℝ} (hR : 0 < R)
(hc : ContinuousOn f (sphere c R)) (hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C)
(hlt : ∃ z ∈ sphere c R, ‖f z‖ < C) : ‖∮ z in C(c, R), f z‖ < 2 * π * R * C := by
rw [← _root_.abs_of_pos hR, ← image_circleMap_Ioc] at hlt
rcases hlt with ⟨_, ⟨θ₀, hmem, rfl⟩, hlt⟩
calc
‖∮ z in C(c, R), f z‖ ≤ ∫ θ in (0)..2 * π, ‖deriv (circleMap c R) θ • f (circleMap c R θ)‖ :=
intervalIntegral.norm_integral_le_integral_norm Real.two_pi_pos.le
_ < ∫ _ in (0)..2 * π, R * C := by
simp only [norm_smul, deriv_circleMap, norm_eq_abs, map_mul, abs_I, mul_one,
abs_circleMap_zero, abs_of_pos hR]
refine intervalIntegral.integral_lt_integral_of_continuousOn_of_le_of_exists_lt
Real.two_pi_pos ?_ continuousOn_const (fun θ _ => ?_) ⟨θ₀, Ioc_subset_Icc_self hmem, ?_⟩
· exact continuousOn_const.mul (hc.comp (continuous_circleMap _ _).continuousOn fun θ _ =>
circleMap_mem_sphere _ hR.le _).norm
· exact mul_le_mul_of_nonneg_left (hf _ <| circleMap_mem_sphere _ hR.le _) hR.le
· exact (mul_lt_mul_left hR).2 hlt
_ = 2 * π * R * C := by simp [mul_assoc]; ring
@[simp]
theorem integral_smul {𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 E] [SMulCommClass 𝕜 ℂ E] (a : 𝕜)
(f : ℂ → E) (c : ℂ) (R : ℝ) : (∮ z in C(c, R), a • f z) = a • ∮ z in C(c, R), f z := by
simp only [circleIntegral, ← smul_comm a (_ : ℂ) (_ : E), intervalIntegral.integral_smul]
@[simp]
theorem integral_smul_const (f : ℂ → ℂ) (a : E) (c : ℂ) (R : ℝ) :
(∮ z in C(c, R), f z • a) = (∮ z in C(c, R), f z) • a := by
simp only [circleIntegral, intervalIntegral.integral_smul_const, ← smul_assoc]
@[simp]
theorem integral_const_mul (a : ℂ) (f : ℂ → ℂ) (c : ℂ) (R : ℝ) :
(∮ z in C(c, R), a * f z) = a * ∮ z in C(c, R), f z :=
integral_smul a f c R
@[simp]
theorem integral_sub_center_inv (c : ℂ) {R : ℝ} (hR : R ≠ 0) :
(∮ z in C(c, R), (z - c)⁻¹) = 2 * π * I := by
simp [circleIntegral, ← div_eq_mul_inv, mul_div_cancel_left₀ _ (circleMap_ne_center hR),
-- Porting note: `simp` didn't need a hint to apply `integral_const` here
intervalIntegral.integral_const I]
/-- If `f' : ℂ → E` is a derivative of a complex differentiable function on the circle
`Metric.sphere c |R|`, then `∮ z in C(c, R), f' z = 0`. -/
theorem integral_eq_zero_of_hasDerivWithinAt' {f f' : ℂ → E} {c : ℂ} {R : ℝ}
(h : ∀ z ∈ sphere c |R|, HasDerivWithinAt f (f' z) (sphere c |R|) z) :
(∮ z in C(c, R), f' z) = 0 := by
by_cases hi : CircleIntegrable f' c R
· rw [← sub_eq_zero.2 ((periodic_circleMap c R).comp f).eq]
refine intervalIntegral.integral_eq_sub_of_hasDerivAt (fun θ _ => ?_) hi.out
exact (h _ (circleMap_mem_sphere' _ _ _)).scomp_hasDerivAt θ
(differentiable_circleMap _ _ _).hasDerivAt (circleMap_mem_sphere' _ _)
· exact integral_undef hi
/-- If `f' : ℂ → E` is a derivative of a complex differentiable function on the circle
`Metric.sphere c R`, then `∮ z in C(c, R), f' z = 0`. -/
theorem integral_eq_zero_of_hasDerivWithinAt {f f' : ℂ → E} {c : ℂ} {R : ℝ} (hR : 0 ≤ R)
(h : ∀ z ∈ sphere c R, HasDerivWithinAt f (f' z) (sphere c R) z) : (∮ z in C(c, R), f' z) = 0 :=
integral_eq_zero_of_hasDerivWithinAt' <| (_root_.abs_of_nonneg hR).symm ▸ h
/-- If `n < 0` and `|w - c| = |R|`, then `(z - w) ^ n` is not circle integrable on the circle with
center `c` and radius `|R|`, so the integral `∮ z in C(c, R), (z - w) ^ n` is equal to zero. -/
theorem integral_sub_zpow_of_undef {n : ℤ} {c w : ℂ} {R : ℝ} (hn : n < 0)
(hw : w ∈ sphere c |R|) : (∮ z in C(c, R), (z - w) ^ n) = 0 := by
rcases eq_or_ne R 0 with (rfl | h0)
· apply integral_radius_zero
· apply integral_undef
simpa [circleIntegrable_sub_zpow_iff, *, not_or]
/-- If `n ≠ -1` is an integer number, then the integral of `(z - w) ^ n` over the circle equals
zero. -/
theorem integral_sub_zpow_of_ne {n : ℤ} (hn : n ≠ -1) (c w : ℂ) (R : ℝ) :
(∮ z in C(c, R), (z - w) ^ n) = 0 := by
rcases em (w ∈ sphere c |R| ∧ n < -1) with (⟨hw, hn⟩ | H)
· exact integral_sub_zpow_of_undef (hn.trans (by decide)) hw
push_neg at H
have hd : ∀ z, z ≠ w ∨ -1 ≤ n →
HasDerivAt (fun z => (z - w) ^ (n + 1) / (n + 1)) ((z - w) ^ n) z := by
intro z hne
convert ((hasDerivAt_zpow (n + 1) _ (hne.imp _ _)).comp z
((hasDerivAt_id z).sub_const w)).div_const _ using 1
· have hn' : (n + 1 : ℂ) ≠ 0 := by
rwa [Ne, ← eq_neg_iff_add_eq_zero, ← Int.cast_one, ← Int.cast_neg, Int.cast_inj]
simp [mul_assoc, mul_div_cancel_left₀ _ hn']
exacts [sub_ne_zero.2, neg_le_iff_add_nonneg.1]
refine integral_eq_zero_of_hasDerivWithinAt' fun z hz => (hd z ?_).hasDerivWithinAt
exact (ne_or_eq z w).imp_right fun (h : z = w) => H <| h ▸ hz
end circleIntegral
/-- The power series that is equal to
$\frac{1}{2πi}\sum_{n=0}^{\infty}
\oint_{|z-c|=R} \left(\frac{w-c}{z - c}\right)^n \frac{1}{z-c}f(z)\,dz$ at
`w - c`. The coefficients of this power series depend only on `f ∘ circleMap c R`, and the power
series converges to `f w` if `f` is differentiable on the closed ball `Metric.closedBall c R` and
`w` belongs to the corresponding open ball. For any circle integrable function `f`, this power
series converges to the Cauchy integral for `f`. -/
def cauchyPowerSeries (f : ℂ → E) (c : ℂ) (R : ℝ) : FormalMultilinearSeries ℂ ℂ E := fun n =>
ContinuousMultilinearMap.mkPiRing ℂ _ <|
(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - c)⁻¹ ^ n • (z - c)⁻¹ • f z
theorem cauchyPowerSeries_apply (f : ℂ → E) (c : ℂ) (R : ℝ) (n : ℕ) (w : ℂ) :
(cauchyPowerSeries f c R n fun _ => w) =
(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (w / (z - c)) ^ n • (z - c)⁻¹ • f z := by
simp only [cauchyPowerSeries, ContinuousMultilinearMap.mkPiRing_apply, Fin.prod_const,
div_eq_mul_inv, mul_pow, mul_smul, circleIntegral.integral_smul]
rw [← smul_comm (w ^ n)]
theorem norm_cauchyPowerSeries_le (f : ℂ → E) (c : ℂ) (R : ℝ) (n : ℕ) :
‖cauchyPowerSeries f c R n‖ ≤
((2 * π)⁻¹ * ∫ θ : ℝ in (0)..2 * π, ‖f (circleMap c R θ)‖) * |R|⁻¹ ^ n :=
calc ‖cauchyPowerSeries f c R n‖
_ = (2 * π)⁻¹ * ‖∮ z in C(c, R), (z - c)⁻¹ ^ n • (z - c)⁻¹ • f z‖ := by
simp [cauchyPowerSeries, norm_smul, Real.pi_pos.le]
_ ≤ (2 * π)⁻¹ * ∫ θ in (0)..2 * π, ‖deriv (circleMap c R) θ •
(circleMap c R θ - c)⁻¹ ^ n • (circleMap c R θ - c)⁻¹ • f (circleMap c R θ)‖ :=
(mul_le_mul_of_nonneg_left
(intervalIntegral.norm_integral_le_integral_norm Real.two_pi_pos.le)
(by simp [Real.pi_pos.le]))
_ = (2 * π)⁻¹ *
(|R|⁻¹ ^ n * (|R| * (|R|⁻¹ * ∫ x : ℝ in (0)..2 * π, ‖f (circleMap c R x)‖))) := by
simp [norm_smul, mul_left_comm |R|]
_ ≤ ((2 * π)⁻¹ * ∫ θ : ℝ in (0)..2 * π, ‖f (circleMap c R θ)‖) * |R|⁻¹ ^ n := by
rcases eq_or_ne R 0 with (rfl | hR)
· cases n <;> simp [-mul_inv_rev]
rw [← mul_assoc, inv_mul_cancel (Real.two_pi_pos.ne.symm), one_mul]
apply norm_nonneg
· rw [mul_inv_cancel_left₀, mul_assoc, mul_comm (|R|⁻¹ ^ n)]
rwa [Ne, _root_.abs_eq_zero]
theorem le_radius_cauchyPowerSeries (f : ℂ → E) (c : ℂ) (R : ℝ≥0) :
↑R ≤ (cauchyPowerSeries f c R).radius := by
refine
(cauchyPowerSeries f c R).le_radius_of_bound
((2 * π)⁻¹ * ∫ θ : ℝ in (0)..2 * π, ‖f (circleMap c R θ)‖) fun n => ?_
refine (mul_le_mul_of_nonneg_right (norm_cauchyPowerSeries_le _ _ _ _)
(pow_nonneg R.coe_nonneg _)).trans ?_
rw [_root_.abs_of_nonneg R.coe_nonneg]
rcases eq_or_ne (R ^ n : ℝ) 0 with hR | hR
· rw_mod_cast [hR, mul_zero]
exact mul_nonneg (inv_nonneg.2 Real.two_pi_pos.le)
(intervalIntegral.integral_nonneg Real.two_pi_pos.le fun _ _ => norm_nonneg _)
· rw [inv_pow]
have : (R : ℝ) ^ n ≠ 0 := by norm_cast at hR ⊢
rw [inv_mul_cancel_right₀ this]
/-- For any circle integrable function `f`, the power series `cauchyPowerSeries f c R` multiplied
by `2πI` converges to the integral `∮ z in C(c, R), (z - w)⁻¹ • f z` on the open disc
`Metric.ball c R`. -/
theorem hasSum_two_pi_I_cauchyPowerSeries_integral {f : ℂ → E} {c : ℂ} {R : ℝ} {w : ℂ}
(hf : CircleIntegrable f c R) (hw : abs w < R) :
HasSum (fun n : ℕ => ∮ z in C(c, R), (w / (z - c)) ^ n • (z - c)⁻¹ • f z)
(∮ z in C(c, R), (z - (c + w))⁻¹ • f z) := by
have hR : 0 < R := (Complex.abs.nonneg w).trans_lt hw
have hwR : abs w / R ∈ Ico (0 : ℝ) 1 :=
⟨div_nonneg (Complex.abs.nonneg w) hR.le, (div_lt_one hR).2 hw⟩
refine intervalIntegral.hasSum_integral_of_dominated_convergence
(fun n θ => ‖f (circleMap c R θ)‖ * (abs w / R) ^ n) (fun n => ?_) (fun n => ?_) ?_ ?_ ?_
· simp only [deriv_circleMap]
apply_rules [AEStronglyMeasurable.smul, hf.def'.1] <;> apply Measurable.aestronglyMeasurable
· fun_prop
· fun_prop
· fun_prop
· simp [norm_smul, abs_of_pos hR, mul_left_comm R, inv_mul_cancel_left₀ hR.ne', mul_comm ‖_‖]
· exact eventually_of_forall fun _ _ => (summable_geometric_of_lt_one hwR.1 hwR.2).mul_left _
· simpa only [tsum_mul_left, tsum_geometric_of_lt_one hwR.1 hwR.2] using
hf.norm.mul_continuousOn continuousOn_const
· refine eventually_of_forall fun θ _ => HasSum.const_smul _ ?_
simp only [smul_smul]
refine HasSum.smul_const ?_ _
have : ‖w / (circleMap c R θ - c)‖ < 1 := by simpa [abs_of_pos hR] using hwR.2
convert (hasSum_geometric_of_norm_lt_one this).mul_right _ using 1
simp [← sub_sub, ← mul_inv, sub_mul, div_mul_cancel₀ _ (circleMap_ne_center hR.ne')]
/-- For any circle integrable function `f`, the power series `cauchyPowerSeries f c R`, `R > 0`,
converges to the Cauchy integral `(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z` on the open
disc `Metric.ball c R`. -/
theorem hasSum_cauchyPowerSeries_integral {f : ℂ → E} {c : ℂ} {R : ℝ} {w : ℂ}
(hf : CircleIntegrable f c R) (hw : abs w < R) :
HasSum (fun n => cauchyPowerSeries f c R n fun _ => w)
((2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - (c + w))⁻¹ • f z) := by
simp only [cauchyPowerSeries_apply]
exact (hasSum_two_pi_I_cauchyPowerSeries_integral hf hw).const_smul _
/-- For any circle integrable function `f`, the power series `cauchyPowerSeries f c R`, `R > 0`,
converges to the Cauchy integral `(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z` on the open
disc `Metric.ball c R`. -/
theorem sum_cauchyPowerSeries_eq_integral {f : ℂ → E} {c : ℂ} {R : ℝ} {w : ℂ}
(hf : CircleIntegrable f c R) (hw : abs w < R) :
(cauchyPowerSeries f c R).sum w = (2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - (c + w))⁻¹ • f z :=
(hasSum_cauchyPowerSeries_integral hf hw).tsum_eq
/-- For any circle integrable function `f`, the power series `cauchyPowerSeries f c R`, `R > 0`,
converges to the Cauchy integral `(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z` on the open
disc `Metric.ball c R`. -/
theorem hasFPowerSeriesOn_cauchy_integral {f : ℂ → E} {c : ℂ} {R : ℝ≥0}
(hf : CircleIntegrable f c R) (hR : 0 < R) :
HasFPowerSeriesOnBall (fun w => (2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z)
(cauchyPowerSeries f c R) c R :=
{ r_le := le_radius_cauchyPowerSeries _ _ _
r_pos := ENNReal.coe_pos.2 hR
hasSum := fun hy ↦ hasSum_cauchyPowerSeries_integral hf <| by simpa using hy }
namespace circleIntegral
/-- Integral $\oint_{|z-c|=R} \frac{dz}{z-w} = 2πi$ whenever $|w-c| < R$. -/
theorem integral_sub_inv_of_mem_ball {c w : ℂ} {R : ℝ} (hw : w ∈ ball c R) :
(∮ z in C(c, R), (z - w)⁻¹) = 2 * π * I := by
have hR : 0 < R := dist_nonneg.trans_lt hw
suffices H : HasSum (fun n : ℕ => ∮ z in C(c, R), ((w - c) / (z - c)) ^ n * (z - c)⁻¹)
(2 * π * I) by
have A : CircleIntegrable (fun _ => (1 : ℂ)) c R := continuousOn_const.circleIntegrable'
refine (H.unique ?_).symm
simpa only [smul_eq_mul, mul_one, add_sub_cancel] using
hasSum_two_pi_I_cauchyPowerSeries_integral A hw
have H : ∀ n : ℕ, n ≠ 0 → (∮ z in C(c, R), (z - c) ^ (-n - 1 : ℤ)) = 0 := by
refine fun n hn => integral_sub_zpow_of_ne ?_ _ _ _; simpa
have : (∮ z in C(c, R), ((w - c) / (z - c)) ^ 0 * (z - c)⁻¹) = 2 * π * I := by simp [hR.ne']
refine this ▸ hasSum_single _ fun n hn => ?_
simp only [div_eq_mul_inv, mul_pow, integral_const_mul, mul_assoc]
rw [(integral_congr hR.le fun z hz => _).trans (H n hn), mul_zero]
intro z _
rw [← pow_succ, ← zpow_natCast, inv_zpow, ← zpow_neg, Int.ofNat_succ, neg_add,
sub_eq_add_neg _ (1 : ℤ)]
end circleIntegral
|
MeasureTheory\Integral\CircleTransform.lean | /-
Copyright (c) 2022 Chris Birkbeck. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Birkbeck
-/
import Mathlib.Data.Complex.Basic
import Mathlib.MeasureTheory.Integral.CircleIntegral
/-!
# Circle integral transform
In this file we define the circle integral transform of a function `f` with complex domain. This is
defined as $(2πi)^{-1}\frac{f(x)}{x-w}$ where `x` moves along a circle. We then prove some basic
facts about these functions.
These results are useful for proving that the uniform limit of a sequence of holomorphic functions
is holomorphic.
-/
open Set MeasureTheory Metric Filter Function
open scoped Interval Real
noncomputable section
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] (R : ℝ) (z w : ℂ)
namespace Complex
/-- Given a function `f : ℂ → E`, `circleTransform R z w f` is the function mapping `θ` to
`(2 * ↑π * I)⁻¹ • deriv (circleMap z R) θ • ((circleMap z R θ) - w)⁻¹ • f (circleMap z R θ)`.
If `f` is differentiable and `w` is in the interior of the ball, then the integral from `0` to
`2 * π` of this gives the value `f(w)`. -/
def circleTransform (f : ℂ → E) (θ : ℝ) : E :=
(2 * ↑π * I)⁻¹ • deriv (circleMap z R) θ • (circleMap z R θ - w)⁻¹ • f (circleMap z R θ)
/-- The derivative of `circleTransform` w.r.t `w`. -/
def circleTransformDeriv (f : ℂ → E) (θ : ℝ) : E :=
(2 * ↑π * I)⁻¹ • deriv (circleMap z R) θ • ((circleMap z R θ - w) ^ 2)⁻¹ • f (circleMap z R θ)
theorem circleTransformDeriv_periodic (f : ℂ → E) :
Periodic (circleTransformDeriv R z w f) (2 * π) := by
have := periodic_circleMap
simp_rw [Periodic] at *
intro x
simp_rw [circleTransformDeriv, this]
congr 2
simp [this]
theorem circleTransformDeriv_eq (f : ℂ → E) : circleTransformDeriv R z w f =
fun θ => (circleMap z R θ - w)⁻¹ • circleTransform R z w f θ := by
ext
simp_rw [circleTransformDeriv, circleTransform, ← mul_smul, ← mul_assoc]
ring_nf
rw [inv_pow]
congr
ring
theorem integral_circleTransform (f : ℂ → E) :
(∫ θ : ℝ in (0)..2 * π, circleTransform R z w f θ) =
(2 * ↑π * I)⁻¹ • ∮ z in C(z, R), (z - w)⁻¹ • f z := by
simp_rw [circleTransform, circleIntegral, deriv_circleMap, circleMap]
simp
theorem continuous_circleTransform {R : ℝ} (hR : 0 < R) {f : ℂ → E} {z w : ℂ}
(hf : ContinuousOn f <| sphere z R) (hw : w ∈ ball z R) :
Continuous (circleTransform R z w f) := by
apply_rules [Continuous.smul, continuous_const]
· rw [funext <| deriv_circleMap _ _]
apply_rules [Continuous.mul, continuous_circleMap 0 R, continuous_const]
· exact continuous_circleMap_inv hw
· apply ContinuousOn.comp_continuous hf (continuous_circleMap z R)
exact fun _ => (circleMap_mem_sphere _ hR.le) _
theorem continuous_circleTransformDeriv {R : ℝ} (hR : 0 < R) {f : ℂ → E} {z w : ℂ}
(hf : ContinuousOn f (sphere z R)) (hw : w ∈ ball z R) :
Continuous (circleTransformDeriv R z w f) := by
rw [circleTransformDeriv_eq]
exact (continuous_circleMap_inv hw).smul (continuous_circleTransform hR hf hw)
/-- A useful bound for circle integrals (with complex codomain)-/
def circleTransformBoundingFunction (R : ℝ) (z : ℂ) (w : ℂ × ℝ) : ℂ :=
circleTransformDeriv R z w.1 (fun _ => 1) w.2
theorem continuousOn_prod_circle_transform_function {R r : ℝ} (hr : r < R) {z : ℂ} :
ContinuousOn (fun w : ℂ × ℝ => (circleMap z R w.snd - w.fst)⁻¹ ^ 2)
(closedBall z r ×ˢ univ) := by
simp_rw [← one_div]
apply_rules [ContinuousOn.pow, ContinuousOn.div, continuousOn_const]
· exact ((continuous_circleMap z R).comp_continuousOn continuousOn_snd).sub continuousOn_fst
· rintro ⟨a, b⟩ ⟨ha, -⟩
have ha2 : a ∈ ball z R := closedBall_subset_ball hr ha
exact sub_ne_zero.2 (circleMap_ne_mem_ball ha2 b)
theorem continuousOn_abs_circleTransformBoundingFunction {R r : ℝ} (hr : r < R) (z : ℂ) :
ContinuousOn (abs ∘ circleTransformBoundingFunction R z) (closedBall z r ×ˢ univ) := by
have : ContinuousOn (circleTransformBoundingFunction R z) (closedBall z r ×ˢ univ) := by
apply_rules [ContinuousOn.smul, continuousOn_const]
· simp only [deriv_circleMap]
apply_rules [ContinuousOn.mul, (continuous_circleMap 0 R).comp_continuousOn continuousOn_snd,
continuousOn_const]
· simpa only [inv_pow] using continuousOn_prod_circle_transform_function hr
exact this.norm
theorem abs_circleTransformBoundingFunction_le {R r : ℝ} (hr : r < R) (hr' : 0 ≤ r) (z : ℂ) :
∃ x : closedBall z r ×ˢ [[0, 2 * π]], ∀ y : closedBall z r ×ˢ [[0, 2 * π]],
abs (circleTransformBoundingFunction R z y) ≤ abs (circleTransformBoundingFunction R z x) := by
have cts := continuousOn_abs_circleTransformBoundingFunction hr z
have comp : IsCompact (closedBall z r ×ˢ [[0, 2 * π]]) := by
apply_rules [IsCompact.prod, ProperSpace.isCompact_closedBall z r, isCompact_uIcc]
have none : (closedBall z r ×ˢ [[0, 2 * π]]).Nonempty :=
(nonempty_closedBall.2 hr').prod nonempty_uIcc
have := IsCompact.exists_isMaxOn comp none (cts.mono <| prod_mono_right (subset_univ _))
simpa [isMaxOn_iff] using this
/-- The derivative of a `circleTransform` is locally bounded. -/
theorem circleTransformDeriv_bound {R : ℝ} (hR : 0 < R) {z x : ℂ} {f : ℂ → ℂ} (hx : x ∈ ball z R)
(hf : ContinuousOn f (sphere z R)) : ∃ B ε : ℝ, 0 < ε ∧
ball x ε ⊆ ball z R ∧ ∀ (t : ℝ), ∀ y ∈ ball x ε, ‖circleTransformDeriv R z y f t‖ ≤ B := by
obtain ⟨r, hr, hrx⟩ := exists_lt_mem_ball_of_mem_ball hx
obtain ⟨ε', hε', H⟩ := exists_ball_subset_ball hrx
obtain ⟨⟨⟨a, b⟩, ⟨ha, hb⟩⟩, hab⟩ :=
abs_circleTransformBoundingFunction_le hr (pos_of_mem_ball hrx).le z
let V : ℝ → ℂ → ℂ := fun θ w => circleTransformDeriv R z w (fun _ => 1) θ
obtain ⟨X, -, HX2⟩ := (isCompact_sphere z R).exists_isMaxOn
(NormedSpace.sphere_nonempty.2 hR.le) hf.norm
refine ⟨abs (V b a) * abs (f X), ε', hε', H.trans (ball_subset_ball hr.le), fun y v hv ↦ ?_⟩
obtain ⟨y1, hy1, hfun⟩ :=
Periodic.exists_mem_Ico₀ (circleTransformDeriv_periodic R z v f) Real.two_pi_pos y
have hy2 : y1 ∈ [[0, 2 * π]] := Icc_subset_uIcc <| Ico_subset_Icc_self hy1
simp only [isMaxOn_iff, mem_sphere_iff_norm, norm_eq_abs] at HX2
have := mul_le_mul (hab ⟨⟨v, y1⟩, ⟨ball_subset_closedBall (H hv), hy2⟩⟩)
(HX2 (circleMap z R y1) (circleMap_mem_sphere z hR.le y1)) (Complex.abs.nonneg _)
(Complex.abs.nonneg _)
rw [hfun]
simpa [V, circleTransformBoundingFunction, circleTransformDeriv, mul_assoc] using this
end Complex
|
MeasureTheory\Integral\DivergenceTheorem.lean | /-
Copyright (c) 2021 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.Analysis.BoxIntegral.DivergenceTheorem
import Mathlib.Analysis.BoxIntegral.Integrability
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.MeasureTheory.Constructions.Prod.Integral
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.Analysis.Calculus.FDeriv.Equiv
/-!
# Divergence theorem for Bochner integral
In this file we prove the Divergence theorem for Bochner integral on a box in
`ℝⁿ⁺¹ = Fin (n + 1) → ℝ`. More precisely, we prove the following theorem.
Let `E` be a complete normed space. If `f : ℝⁿ⁺¹ → Eⁿ⁺¹` is
continuous on a rectangular box `[a, b] : Set ℝⁿ⁺¹`, `a ≤ b`, differentiable on its interior with
derivative `f' : ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] Eⁿ⁺¹`, and the divergence `fun x ↦ ∑ i, f' x eᵢ i`
is integrable on `[a, b]`, where `eᵢ = Pi.single i 1` is the `i`-th basis vector,
then its integral is equal to the sum of integrals of `f` over the faces of `[a, b]`,
taken with appropriate signs. Moreover, the same
is true if the function is not differentiable at countably many points of the interior of `[a, b]`.
Once we prove the general theorem, we deduce corollaries for functions `ℝ → E` and pairs of
functions `(ℝ × ℝ) → E`.
## Notations
We use the following local notation to make the statement more readable. Note that the documentation
website shows the actual terms, not those abbreviated using local notations.
Porting note (Yury Kudryashov): I disabled some of these notations because I failed to make them
work with Lean 4.
* `ℝⁿ`, `ℝⁿ⁺¹`, `Eⁿ⁺¹`: `Fin n → ℝ`, `Fin (n + 1) → ℝ`, `Fin (n + 1) → E`;
* `face i`: the `i`-th face of the box `[a, b]` as a closed segment in `ℝⁿ`, namely
`[a ∘ Fin.succAbove i, b ∘ Fin.succAbove i]`;
* `e i` : `i`-th basis vector `Pi.single i 1`;
* `frontFace i`, `backFace i`: embeddings `ℝⁿ → ℝⁿ⁺¹` corresponding to the front face
`{x | x i = b i}` and back face `{x | x i = a i}` of the box `[a, b]`, respectively.
They are given by `Fin.insertNth i (b i)` and `Fin.insertNth i (a i)`.
## TODO
* Add a version that assumes existence and integrability of partial derivatives.
* Restore local notations for find another way to make the statements more readable.
## Tags
divergence theorem, Bochner integral
-/
open Set Finset TopologicalSpace Function BoxIntegral MeasureTheory Filter
open scoped Classical Topology Interval
universe u
namespace MeasureTheory
variable {E : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
section
variable {n : ℕ}
local macro:arg t:term:max noWs "ⁿ" : term => `(Fin n → $t)
local macro:arg t:term:max noWs "ⁿ⁺¹" : term => `(Fin (n + 1) → $t)
local notation "e " i => Pi.single i 1
section
/-!
### Divergence theorem for functions on `ℝⁿ⁺¹ = Fin (n + 1) → ℝ`.
In this section we use the divergence theorem for a Henstock-Kurzweil-like integral
`BoxIntegral.hasIntegral_GP_divergence_of_forall_hasDerivWithinAt` to prove the divergence
theorem for Bochner integral. The divergence theorem for Bochner integral
`MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable` assumes that the function
itself is continuous on a closed box, differentiable at all but countably many points of its
interior, and the divergence is integrable on the box.
This statement differs from `BoxIntegral.hasIntegral_GP_divergence_of_forall_hasDerivWithinAt`
in several aspects.
* We use Bochner integral instead of a Henstock-Kurzweil integral. This modification is done in
`MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable_aux₁`. As a side effect
of this change, we need to assume that the divergence is integrable.
* We don't assume differentiability on the boundary of the box. This modification is done in
`MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable_aux₂`. To prove it, we
choose an increasing sequence of smaller boxes that cover the interior of the original box, then
apply the previous lemma to these smaller boxes and take the limit of both sides of the equation.
* We assume `a ≤ b` instead of `∀ i, a i < b i`. This is the last step of the proof, and it is done
in the main theorem `MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable`.
-/
/-- An auxiliary lemma for
`MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable`. This is exactly
`BoxIntegral.hasIntegral_GP_divergence_of_forall_hasDerivWithinAt` reformulated for the
Bochner integral. -/
theorem integral_divergence_of_hasFDerivWithinAt_off_countable_aux₁ (I : Box (Fin (n + 1)))
(f : ℝⁿ⁺¹ → Eⁿ⁺¹)
(f' : ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] Eⁿ⁺¹) (s : Set ℝⁿ⁺¹)
(hs : s.Countable) (Hc : ContinuousOn f (Box.Icc I))
(Hd : ∀ x ∈ (Box.Icc I) \ s, HasFDerivWithinAt f (f' x) (Box.Icc I) x)
(Hi : IntegrableOn (fun x => ∑ i, f' x (e i) i) (Box.Icc I)) :
(∫ x in Box.Icc I, ∑ i, f' x (e i) i) =
∑ i : Fin (n + 1),
((∫ x in Box.Icc (I.face i), f (i.insertNth (I.upper i) x) i) -
∫ x in Box.Icc (I.face i), f (i.insertNth (I.lower i) x) i) := by
simp only [← setIntegral_congr_set_ae (Box.coe_ae_eq_Icc _)]
have A := (Hi.mono_set Box.coe_subset_Icc).hasBoxIntegral ⊥ rfl
have B :=
hasIntegral_GP_divergence_of_forall_hasDerivWithinAt I f f' (s ∩ Box.Icc I)
(hs.mono inter_subset_left) (fun x hx => Hc _ hx.2) fun x hx =>
Hd _ ⟨hx.1, fun h => hx.2 ⟨h, hx.1⟩⟩
rw [continuousOn_pi] at Hc
refine (A.unique B).trans (sum_congr rfl fun i _ => ?_)
refine congr_arg₂ Sub.sub ?_ ?_
· have := Box.continuousOn_face_Icc (Hc i) (Set.right_mem_Icc.2 (I.lower_le_upper i))
have := (this.integrableOn_compact (μ := volume) (Box.isCompact_Icc _)).mono_set
Box.coe_subset_Icc
exact (this.hasBoxIntegral ⊥ rfl).integral_eq
· have := Box.continuousOn_face_Icc (Hc i) (Set.left_mem_Icc.2 (I.lower_le_upper i))
have := (this.integrableOn_compact (μ := volume) (Box.isCompact_Icc _)).mono_set
Box.coe_subset_Icc
exact (this.hasBoxIntegral ⊥ rfl).integral_eq
/-- An auxiliary lemma for
`MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable`. Compared to the previous
lemma, here we drop the assumption of differentiability on the boundary of the box. -/
theorem integral_divergence_of_hasFDerivWithinAt_off_countable_aux₂ (I : Box (Fin (n + 1)))
(f : ℝⁿ⁺¹ → Eⁿ⁺¹)
(f' : ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] Eⁿ⁺¹)
(s : Set ℝⁿ⁺¹) (hs : s.Countable) (Hc : ContinuousOn f (Box.Icc I))
(Hd : ∀ x ∈ Box.Ioo I \ s, HasFDerivAt f (f' x) x)
(Hi : IntegrableOn (∑ i, f' · (e i) i) (Box.Icc I)) :
(∫ x in Box.Icc I, ∑ i, f' x (e i) i) =
∑ i : Fin (n + 1),
((∫ x in Box.Icc (I.face i), f (i.insertNth (I.upper i) x) i) -
∫ x in Box.Icc (I.face i), f (i.insertNth (I.lower i) x) i) := by
/- Choose a monotone sequence `J k` of subboxes that cover the interior of `I` and prove that
these boxes satisfy the assumptions of the previous lemma. -/
rcases I.exists_seq_mono_tendsto with ⟨J, hJ_sub, hJl, hJu⟩
have hJ_sub' : ∀ k, Box.Icc (J k) ⊆ Box.Icc I := fun k => (hJ_sub k).trans I.Ioo_subset_Icc
have hJ_le : ∀ k, J k ≤ I := fun k => Box.le_iff_Icc.2 (hJ_sub' k)
have HcJ : ∀ k, ContinuousOn f (Box.Icc (J k)) := fun k => Hc.mono (hJ_sub' k)
have HdJ : ∀ (k), ∀ x ∈ (Box.Icc (J k)) \ s, HasFDerivWithinAt f (f' x) (Box.Icc (J k)) x :=
fun k x hx => (Hd x ⟨hJ_sub k hx.1, hx.2⟩).hasFDerivWithinAt
have HiJ : ∀ k, IntegrableOn (∑ i, f' · (e i) i) (Box.Icc (J k)) volume := fun k =>
Hi.mono_set (hJ_sub' k)
-- Apply the previous lemma to `J k`.
have HJ_eq := fun k =>
integral_divergence_of_hasFDerivWithinAt_off_countable_aux₁ (J k) f f' s hs (HcJ k) (HdJ k)
(HiJ k)
-- Note that the LHS of `HJ_eq k` tends to the LHS of the goal as `k → ∞`.
have hI_tendsto :
Tendsto (fun k => ∫ x in Box.Icc (J k), ∑ i, f' x (e i) i) atTop
(𝓝 (∫ x in Box.Icc I, ∑ i, f' x (e i) i)) := by
simp only [IntegrableOn, ← Measure.restrict_congr_set (Box.Ioo_ae_eq_Icc _)] at Hi ⊢
rw [← Box.iUnion_Ioo_of_tendsto J.monotone hJl hJu] at Hi ⊢
exact tendsto_setIntegral_of_monotone (fun k => (J k).measurableSet_Ioo)
(Box.Ioo.comp J).monotone Hi
-- Thus it suffices to prove the same about the RHS.
refine tendsto_nhds_unique_of_eventuallyEq hI_tendsto ?_ (eventually_of_forall HJ_eq)
clear hI_tendsto
rw [tendsto_pi_nhds] at hJl hJu
/- We'll need to prove a similar statement about the integrals over the front sides and the
integrals over the back sides. In order to avoid repeating ourselves, we formulate a lemma. -/
suffices ∀ (i : Fin (n + 1)) (c : ℕ → ℝ) (d), (∀ k, c k ∈ Icc (I.lower i) (I.upper i)) →
Tendsto c atTop (𝓝 d) →
Tendsto (fun k => ∫ x in Box.Icc ((J k).face i), f (i.insertNth (c k) x) i) atTop
(𝓝 <| ∫ x in Box.Icc (I.face i), f (i.insertNth d x) i) by
rw [Box.Icc_eq_pi] at hJ_sub'
refine tendsto_finset_sum _ fun i _ => (this _ _ _ ?_ (hJu _)).sub (this _ _ _ ?_ (hJl _))
exacts [fun k => hJ_sub' k (J k).upper_mem_Icc _ trivial, fun k =>
hJ_sub' k (J k).lower_mem_Icc _ trivial]
intro i c d hc hcd
/- First we prove that the integrals of the restriction of `f` to `{x | x i = d}` over increasing
boxes `((J k).face i).Icc` tend to the desired limit. The proof mostly repeats the one above. -/
have hd : d ∈ Icc (I.lower i) (I.upper i) :=
isClosed_Icc.mem_of_tendsto hcd (eventually_of_forall hc)
have Hic : ∀ k, IntegrableOn (fun x => f (i.insertNth (c k) x) i) (Box.Icc (I.face i)) := fun k =>
(Box.continuousOn_face_Icc ((continuous_apply i).comp_continuousOn Hc) (hc k)).integrableOn_Icc
have Hid : IntegrableOn (fun x => f (i.insertNth d x) i) (Box.Icc (I.face i)) :=
(Box.continuousOn_face_Icc ((continuous_apply i).comp_continuousOn Hc) hd).integrableOn_Icc
have H :
Tendsto (fun k => ∫ x in Box.Icc ((J k).face i), f (i.insertNth d x) i) atTop
(𝓝 <| ∫ x in Box.Icc (I.face i), f (i.insertNth d x) i) := by
have hIoo : (⋃ k, Box.Ioo ((J k).face i)) = Box.Ioo (I.face i) :=
Box.iUnion_Ioo_of_tendsto ((Box.monotone_face i).comp J.monotone)
(tendsto_pi_nhds.2 fun _ => hJl _) (tendsto_pi_nhds.2 fun _ => hJu _)
simp only [IntegrableOn, ← Measure.restrict_congr_set (Box.Ioo_ae_eq_Icc _), ← hIoo] at Hid ⊢
exact tendsto_setIntegral_of_monotone (fun k => ((J k).face i).measurableSet_Ioo)
(Box.Ioo.monotone.comp ((Box.monotone_face i).comp J.monotone)) Hid
/- Thus it suffices to show that the distance between the integrals of the restrictions of `f` to
`{x | x i = c k}` and `{x | x i = d}` over `((J k).face i).Icc` tends to zero as `k → ∞`. Choose
`ε > 0`. -/
refine H.congr_dist (Metric.nhds_basis_closedBall.tendsto_right_iff.2 fun ε εpos => ?_)
have hvol_pos : ∀ J : Box (Fin n), 0 < ∏ j, (J.upper j - J.lower j) := fun J =>
prod_pos fun j hj => sub_pos.2 <| J.lower_lt_upper _
/- Choose `δ > 0` such that for any `x y ∈ I.Icc` at distance at most `δ`, the distance between
`f x` and `f y` is at most `ε / volume (I.face i).Icc`, then the distance between the integrals
is at most `(ε / volume (I.face i).Icc) * volume ((J k).face i).Icc ≤ ε`. -/
rcases Metric.uniformContinuousOn_iff_le.1 (I.isCompact_Icc.uniformContinuousOn_of_continuous Hc)
(ε / ∏ j, ((I.face i).upper j - (I.face i).lower j)) (div_pos εpos (hvol_pos (I.face i)))
with ⟨δ, δpos, hδ⟩
refine (hcd.eventually (Metric.ball_mem_nhds _ δpos)).mono fun k hk => ?_
have Hsub : Box.Icc ((J k).face i) ⊆ Box.Icc (I.face i) :=
Box.le_iff_Icc.1 (Box.face_mono (hJ_le _) i)
rw [mem_closedBall_zero_iff, Real.norm_eq_abs, abs_of_nonneg dist_nonneg, dist_eq_norm,
← integral_sub (Hid.mono_set Hsub) ((Hic _).mono_set Hsub)]
calc
‖∫ x in Box.Icc ((J k).face i), f (i.insertNth d x) i - f (i.insertNth (c k) x) i‖ ≤
(ε / ∏ j, ((I.face i).upper j - (I.face i).lower j)) *
(volume (Box.Icc ((J k).face i))).toReal := by
refine norm_setIntegral_le_of_norm_le_const' (((J k).face i).measure_Icc_lt_top _)
((J k).face i).measurableSet_Icc fun x hx => ?_
rw [← dist_eq_norm]
calc
dist (f (i.insertNth d x) i) (f (i.insertNth (c k) x) i) ≤
dist (f (i.insertNth d x)) (f (i.insertNth (c k) x)) :=
dist_le_pi_dist (f (i.insertNth d x)) (f (i.insertNth (c k) x)) i
_ ≤ ε / ∏ j, ((I.face i).upper j - (I.face i).lower j) :=
hδ _ (I.mapsTo_insertNth_face_Icc hd <| Hsub hx) _
(I.mapsTo_insertNth_face_Icc (hc _) <| Hsub hx) ?_
rw [Fin.dist_insertNth_insertNth, dist_self, dist_comm]
exact max_le hk.le δpos.lt.le
_ ≤ ε := by
rw [Box.Icc_def, Real.volume_Icc_pi_toReal ((J k).face i).lower_le_upper,
← le_div_iff (hvol_pos _)]
gcongr
exacts [hvol_pos _, fun _ _ ↦ sub_nonneg.2 (Box.lower_le_upper _ _),
(hJ_sub' _ (J _).upper_mem_Icc).2 _, (hJ_sub' _ (J _).lower_mem_Icc).1 _]
variable (a b : Fin (n + 1) → ℝ)
local notation "face " i => Set.Icc (a ∘ Fin.succAbove i) (b ∘ Fin.succAbove i)
local notation:max "frontFace " i:arg => Fin.insertNth i (b i)
local notation:max "backFace " i:arg => Fin.insertNth i (a i)
/-- **Divergence theorem** for Bochner integral. If `f : ℝⁿ⁺¹ → Eⁿ⁺¹` is continuous on a rectangular
box `[a, b] : Set ℝⁿ⁺¹`, `a ≤ b`, is differentiable on its interior with derivative
`f' : ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] Eⁿ⁺¹` and the divergence `fun x ↦ ∑ i, f' x eᵢ i` is integrable on `[a, b]`,
where `eᵢ = Pi.single i 1` is the `i`-th basis vector, then its integral is equal to the sum of
integrals of `f` over the faces of `[a, b]`, taken with appropriate signs.
Moreover, the same is true if the function is not differentiable at countably many
points of the interior of `[a, b]`.
We represent both faces `x i = a i` and `x i = b i` as the box
`face i = [a ∘ Fin.succAbove i, b ∘ Fin.succAbove i]` in `ℝⁿ`, where
`Fin.succAbove : Fin n ↪o Fin (n + 1)` is the order embedding with range `{i}ᶜ`. The restrictions
of `f : ℝⁿ⁺¹ → Eⁿ⁺¹` to these faces are given by `f ∘ backFace i` and `f ∘ frontFace i`, where
`backFace i = Fin.insertNth i (a i)` and `frontFace i = Fin.insertNth i (b i)` are embeddings
`ℝⁿ → ℝⁿ⁺¹` that take `y : ℝⁿ` and insert `a i` (resp., `b i`) as `i`-th coordinate. -/
theorem integral_divergence_of_hasFDerivWithinAt_off_countable (hle : a ≤ b)
(f : ℝⁿ⁺¹ → Eⁿ⁺¹)
(f' : ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] Eⁿ⁺¹)
(s : Set ℝⁿ⁺¹) (hs : s.Countable) (Hc : ContinuousOn f (Icc a b))
(Hd : ∀ x ∈ (Set.pi univ fun i => Ioo (a i) (b i)) \ s, HasFDerivAt f (f' x) x)
(Hi : IntegrableOn (fun x => ∑ i, f' x (e i) i) (Icc a b)) :
(∫ x in Icc a b, ∑ i, f' x (e i) i) =
∑ i : Fin (n + 1),
((∫ x in face i, f (frontFace i x) i) - ∫ x in face i, f (backFace i x) i) := by
rcases em (∃ i, a i = b i) with (⟨i, hi⟩ | hne)
· -- First we sort out the trivial case `∃ i, a i = b i`.
rw [volume_pi, ← setIntegral_congr_set_ae Measure.univ_pi_Ioc_ae_eq_Icc]
have hi' : Ioc (a i) (b i) = ∅ := Ioc_eq_empty hi.not_lt
have : (pi Set.univ fun j => Ioc (a j) (b j)) = ∅ := univ_pi_eq_empty hi'
rw [this, integral_empty, sum_eq_zero]
rintro j -
rcases eq_or_ne i j with (rfl | hne)
· simp [hi]
· rcases Fin.exists_succAbove_eq hne with ⟨i, rfl⟩
have : Icc (a ∘ j.succAbove) (b ∘ j.succAbove) =ᵐ[volume] (∅ : Set ℝⁿ) := by
rw [ae_eq_empty, Real.volume_Icc_pi, prod_eq_zero (Finset.mem_univ i)]
simp [hi]
rw [setIntegral_congr_set_ae this, setIntegral_congr_set_ae this, integral_empty,
integral_empty, sub_self]
· -- In the non-trivial case `∀ i, a i < b i`, we apply a lemma we proved above.
have hlt : ∀ i, a i < b i := fun i => (hle i).lt_of_ne fun hi => hne ⟨i, hi⟩
exact integral_divergence_of_hasFDerivWithinAt_off_countable_aux₂ ⟨a, b, hlt⟩ f f' s hs Hc
Hd Hi
/-- **Divergence theorem** for a family of functions `f : Fin (n + 1) → ℝⁿ⁺¹ → E`. See also
`MeasureTheory.integral_divergence_of_hasFDerivWithinAt_off_countable'` for a version formulated
in terms of a vector-valued function `f : ℝⁿ⁺¹ → Eⁿ⁺¹`. -/
theorem integral_divergence_of_hasFDerivWithinAt_off_countable' (hle : a ≤ b)
(f : Fin (n + 1) → ℝⁿ⁺¹ → E)
(f' : Fin (n + 1) → ℝⁿ⁺¹ → ℝⁿ⁺¹ →L[ℝ] E) (s : Set ℝⁿ⁺¹)
(hs : s.Countable) (Hc : ∀ i, ContinuousOn (f i) (Icc a b))
(Hd : ∀ x ∈ (pi Set.univ fun i => Ioo (a i) (b i)) \ s, ∀ (i), HasFDerivAt (f i) (f' i x) x)
(Hi : IntegrableOn (fun x => ∑ i, f' i x (e i)) (Icc a b)) :
(∫ x in Icc a b, ∑ i, f' i x (e i)) =
∑ i : Fin (n + 1), ((∫ x in face i, f i (frontFace i x)) -
∫ x in face i, f i (backFace i x)) :=
integral_divergence_of_hasFDerivWithinAt_off_countable a b hle (fun x i => f i x)
(fun x => ContinuousLinearMap.pi fun i => f' i x) s hs (continuousOn_pi.2 Hc)
(fun x hx => hasFDerivAt_pi.2 (Hd x hx)) Hi
end
/-- An auxiliary lemma that is used to specialize the general divergence theorem to spaces that do
not have the form `Fin n → ℝ`. -/
theorem integral_divergence_of_hasFDerivWithinAt_off_countable_of_equiv {F : Type*}
[NormedAddCommGroup F] [NormedSpace ℝ F] [PartialOrder F] [MeasureSpace F] [BorelSpace F]
(eL : F ≃L[ℝ] ℝⁿ⁺¹) (he_ord : ∀ x y, eL x ≤ eL y ↔ x ≤ y)
(he_vol : MeasurePreserving eL volume volume) (f : Fin (n + 1) → F → E)
(f' : Fin (n + 1) → F → F →L[ℝ] E) (s : Set F) (hs : s.Countable) (a b : F) (hle : a ≤ b)
(Hc : ∀ i, ContinuousOn (f i) (Icc a b))
(Hd : ∀ x ∈ interior (Icc a b) \ s, ∀ (i), HasFDerivAt (f i) (f' i x) x) (DF : F → E)
(hDF : ∀ x, DF x = ∑ i, f' i x (eL.symm <| e i)) (Hi : IntegrableOn DF (Icc a b)) :
∫ x in Icc a b, DF x =
∑ i : Fin (n + 1),
((∫ x in Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove),
f i (eL.symm <| i.insertNth (eL b i) x)) -
∫ x in Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove),
f i (eL.symm <| i.insertNth (eL a i) x)) :=
have he_emb : MeasurableEmbedding eL := eL.toHomeomorph.measurableEmbedding
have hIcc : eL ⁻¹' Icc (eL a) (eL b) = Icc a b := by
ext1 x; simp only [Set.mem_preimage, Set.mem_Icc, he_ord]
have hIcc' : Icc (eL a) (eL b) = eL.symm ⁻¹' Icc a b := by rw [← hIcc, eL.symm_preimage_preimage]
calc
∫ x in Icc a b, DF x = ∫ x in Icc a b, ∑ i, f' i x (eL.symm <| e i) := by simp only [hDF]
_ = ∫ x in Icc (eL a) (eL b), ∑ i, f' i (eL.symm x) (eL.symm <| e i) := by
rw [← he_vol.setIntegral_preimage_emb he_emb]
simp only [hIcc, eL.symm_apply_apply]
_ = ∑ i : Fin (n + 1),
((∫ x in Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove),
f i (eL.symm <| i.insertNth (eL b i) x)) -
∫ x in Icc (eL a ∘ i.succAbove) (eL b ∘ i.succAbove),
f i (eL.symm <| i.insertNth (eL a i) x)) := by
refine integral_divergence_of_hasFDerivWithinAt_off_countable' (eL a) (eL b)
((he_ord _ _).2 hle) (fun i x => f i (eL.symm x))
(fun i x => f' i (eL.symm x) ∘L (eL.symm : ℝⁿ⁺¹ →L[ℝ] F)) (eL.symm ⁻¹' s)
(hs.preimage eL.symm.injective) ?_ ?_ ?_
· exact fun i => (Hc i).comp eL.symm.continuousOn hIcc'.subset
· refine fun x hx i => (Hd (eL.symm x) ⟨?_, hx.2⟩ i).comp x eL.symm.hasFDerivAt
rw [← hIcc]
refine preimage_interior_subset_interior_preimage eL.continuous ?_
simpa only [Set.mem_preimage, eL.apply_symm_apply, ← pi_univ_Icc,
interior_pi_set (@finite_univ (Fin _) _), interior_Icc] using hx.1
· rw [← he_vol.integrableOn_comp_preimage he_emb, hIcc]
simp [← hDF, (· ∘ ·), Hi]
end
open scoped Interval
open ContinuousLinearMap (smulRight)
local macro:arg t:term:max noWs "¹" : term => `(Fin 1 → $t)
local macro:arg t:term:max noWs "²" : term => `(Fin 2 → $t)
/-- **Fundamental theorem of calculus, part 2**. This version assumes that `f` is continuous on the
interval and is differentiable off a countable set `s`.
See also
* `intervalIntegral.integral_eq_sub_of_hasDeriv_right_of_le` for a version that only assumes right
differentiability of `f`;
* `MeasureTheory.integral_eq_of_hasDerivWithinAt_off_countable` for a version that works both
for `a ≤ b` and `b ≤ a` at the expense of using unordered intervals instead of `Set.Icc`. -/
theorem integral_eq_of_hasDerivWithinAt_off_countable_of_le (f f' : ℝ → E) {a b : ℝ}
(hle : a ≤ b) {s : Set ℝ} (hs : s.Countable) (Hc : ContinuousOn f (Icc a b))
(Hd : ∀ x ∈ Ioo a b \ s, HasDerivAt f (f' x) x) (Hi : IntervalIntegrable f' volume a b) :
∫ x in a..b, f' x = f b - f a := by
set e : ℝ ≃L[ℝ] ℝ¹ := (ContinuousLinearEquiv.funUnique (Fin 1) ℝ ℝ).symm
have e_symm : ∀ x, e.symm x = x 0 := fun x => rfl
set F' : ℝ → ℝ →L[ℝ] E := fun x => smulRight (1 : ℝ →L[ℝ] ℝ) (f' x)
have hF' : ∀ x y, F' x y = y • f' x := fun x y => rfl
calc
∫ x in a..b, f' x = ∫ x in Icc a b, f' x := by
rw [intervalIntegral.integral_of_le hle, setIntegral_congr_set_ae Ioc_ae_eq_Icc]
_ = ∑ i : Fin 1,
((∫ x in Icc (e a ∘ i.succAbove) (e b ∘ i.succAbove),
f (e.symm <| i.insertNth (e b i) x)) -
∫ x in Icc (e a ∘ i.succAbove) (e b ∘ i.succAbove),
f (e.symm <| i.insertNth (e a i) x)) := by
simp only [← interior_Icc] at Hd
refine
integral_divergence_of_hasFDerivWithinAt_off_countable_of_equiv e ?_ ?_ (fun _ => f)
(fun _ => F') s hs a b hle (fun _ => Hc) (fun x hx _ => Hd x hx) _ ?_ ?_
· exact fun x y => (OrderIso.funUnique (Fin 1) ℝ).symm.le_iff_le
· exact (volume_preserving_funUnique (Fin 1) ℝ).symm _
· intro x; rw [Fin.sum_univ_one, hF', e_symm, Pi.single_eq_same, one_smul]
· rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hle] at Hi
exact Hi.congr_set_ae Ioc_ae_eq_Icc.symm
_ = f b - f a := by
simp only [e, Fin.sum_univ_one, e_symm]
have : ∀ c : ℝ, const (Fin 0) c = isEmptyElim := fun c => Subsingleton.elim _ _
simp [this, volume_pi, Measure.pi_of_empty fun _ : Fin 0 => volume]
/-- **Fundamental theorem of calculus, part 2**. This version assumes that `f` is continuous on the
interval and is differentiable off a countable set `s`.
See also `intervalIntegral.integral_eq_sub_of_hasDeriv_right` for a version that
only assumes right differentiability of `f`.
-/
theorem integral_eq_of_hasDerivWithinAt_off_countable (f f' : ℝ → E) {a b : ℝ} {s : Set ℝ}
(hs : s.Countable) (Hc : ContinuousOn f [[a, b]])
(Hd : ∀ x ∈ Ioo (min a b) (max a b) \ s, HasDerivAt f (f' x) x)
(Hi : IntervalIntegrable f' volume a b) : ∫ x in a..b, f' x = f b - f a := by
rcases le_total a b with hab | hab
· simp only [uIcc_of_le hab, min_eq_left hab, max_eq_right hab] at *
exact integral_eq_of_hasDerivWithinAt_off_countable_of_le f f' hab hs Hc Hd Hi
· simp only [uIcc_of_ge hab, min_eq_right hab, max_eq_left hab] at *
rw [intervalIntegral.integral_symm, neg_eq_iff_eq_neg, neg_sub]
exact integral_eq_of_hasDerivWithinAt_off_countable_of_le f f' hab hs Hc Hd Hi.symm
/-- **Divergence theorem** for functions on the plane along rectangles. It is formulated in terms of
two functions `f g : ℝ × ℝ → E` and an integral over `Icc a b = [a.1, b.1] × [a.2, b.2]`, where
`a b : ℝ × ℝ`, `a ≤ b`. When thinking of `f` and `g` as the two coordinates of a single function
`F : ℝ × ℝ → E × E` and when `E = ℝ`, this is the usual statement that the integral of the
divergence of `F` inside the rectangle equals the integral of the normal derivative of `F` along the
boundary.
See also `MeasureTheory.integral2_divergence_prod_of_hasFDerivWithinAt_off_countable` for a
version that does not assume `a ≤ b` and uses iterated interval integral instead of the integral
over `Icc a b`. -/
theorem integral_divergence_prod_Icc_of_hasFDerivWithinAt_off_countable_of_le (f g : ℝ × ℝ → E)
(f' g' : ℝ × ℝ → ℝ × ℝ →L[ℝ] E) (a b : ℝ × ℝ) (hle : a ≤ b) (s : Set (ℝ × ℝ)) (hs : s.Countable)
(Hcf : ContinuousOn f (Icc a b)) (Hcg : ContinuousOn g (Icc a b))
(Hdf : ∀ x ∈ Ioo a.1 b.1 ×ˢ Ioo a.2 b.2 \ s, HasFDerivAt f (f' x) x)
(Hdg : ∀ x ∈ Ioo a.1 b.1 ×ˢ Ioo a.2 b.2 \ s, HasFDerivAt g (g' x) x)
(Hi : IntegrableOn (fun x => f' x (1, 0) + g' x (0, 1)) (Icc a b)) :
(∫ x in Icc a b, f' x (1, 0) + g' x (0, 1)) =
(((∫ x in a.1..b.1, g (x, b.2)) - ∫ x in a.1..b.1, g (x, a.2)) +
∫ y in a.2..b.2, f (b.1, y)) -
∫ y in a.2..b.2, f (a.1, y) :=
let e : (ℝ × ℝ) ≃L[ℝ] ℝ² := (ContinuousLinearEquiv.finTwoArrow ℝ ℝ).symm
calc
(∫ x in Icc a b, f' x (1, 0) + g' x (0, 1)) =
∑ i : Fin 2,
((∫ x in Icc (e a ∘ i.succAbove) (e b ∘ i.succAbove),
![f, g] i (e.symm <| i.insertNth (e b i) x)) -
∫ x in Icc (e a ∘ i.succAbove) (e b ∘ i.succAbove),
![f, g] i (e.symm <| i.insertNth (e a i) x)) := by
refine integral_divergence_of_hasFDerivWithinAt_off_countable_of_equiv e ?_ ?_ ![f, g]
![f', g'] s hs a b hle ?_ (fun x hx => ?_) _ ?_ Hi
· exact fun x y => (OrderIso.finTwoArrowIso ℝ).symm.le_iff_le
· exact (volume_preserving_finTwoArrow ℝ).symm _
· exact Fin.forall_fin_two.2 ⟨Hcf, Hcg⟩
· rw [Icc_prod_eq, interior_prod_eq, interior_Icc, interior_Icc] at hx
exact Fin.forall_fin_two.2 ⟨Hdf x hx, Hdg x hx⟩
· intro x; rw [Fin.sum_univ_two]; rfl
_ = ((∫ y in Icc a.2 b.2, f (b.1, y)) - ∫ y in Icc a.2 b.2, f (a.1, y)) +
((∫ x in Icc a.1 b.1, g (x, b.2)) - ∫ x in Icc a.1 b.1, g (x, a.2)) := by
have : ∀ (a b : ℝ¹) (f : ℝ¹ → E),
∫ x in Icc a b, f x = ∫ x in Icc (a 0) (b 0), f fun _ => x := fun a b f ↦ by
convert (((volume_preserving_funUnique (Fin 1) ℝ).symm _).setIntegral_preimage_emb
(MeasurableEquiv.measurableEmbedding _) f _).symm
exact ((OrderIso.funUnique (Fin 1) ℝ).symm.preimage_Icc a b).symm
simp only [Fin.sum_univ_two, this]
rfl
_ = (((∫ x in a.1..b.1, g (x, b.2)) - ∫ x in a.1..b.1, g (x, a.2)) +
∫ y in a.2..b.2, f (b.1, y)) - ∫ y in a.2..b.2, f (a.1, y) := by
simp only [intervalIntegral.integral_of_le hle.1, intervalIntegral.integral_of_le hle.2,
setIntegral_congr_set_ae (Ioc_ae_eq_Icc (α := ℝ) (μ := volume))]
abel
/-- **Divergence theorem** for functions on the plane. It is formulated in terms of two functions
`f g : ℝ × ℝ → E` and iterated integral `∫ x in a₁..b₁, ∫ y in a₂..b₂, _`, where
`a₁ a₂ b₁ b₂ : ℝ`. When thinking of `f` and `g` as the two coordinates of a single function
`F : ℝ × ℝ → E × E` and when `E = ℝ`, this is the usual statement that the integral of the
divergence of `F` inside the rectangle with vertices `(aᵢ, bⱼ)`, `i, j =1,2`, equals the integral of
the normal derivative of `F` along the boundary.
See also `MeasureTheory.integral_divergence_prod_Icc_of_hasFDerivWithinAt_off_countable_of_le`
for a version that uses an integral over `Icc a b`, where `a b : ℝ × ℝ`, `a ≤ b`. -/
theorem integral2_divergence_prod_of_hasFDerivWithinAt_off_countable (f g : ℝ × ℝ → E)
(f' g' : ℝ × ℝ → ℝ × ℝ →L[ℝ] E) (a₁ a₂ b₁ b₂ : ℝ) (s : Set (ℝ × ℝ)) (hs : s.Countable)
(Hcf : ContinuousOn f ([[a₁, b₁]] ×ˢ [[a₂, b₂]]))
(Hcg : ContinuousOn g ([[a₁, b₁]] ×ˢ [[a₂, b₂]]))
(Hdf : ∀ x ∈ Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Ioo (min a₂ b₂) (max a₂ b₂) \ s,
HasFDerivAt f (f' x) x)
(Hdg : ∀ x ∈ Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Ioo (min a₂ b₂) (max a₂ b₂) \ s,
HasFDerivAt g (g' x) x)
(Hi : IntegrableOn (fun x => f' x (1, 0) + g' x (0, 1)) ([[a₁, b₁]] ×ˢ [[a₂, b₂]])) :
(∫ x in a₁..b₁, ∫ y in a₂..b₂, f' (x, y) (1, 0) + g' (x, y) (0, 1)) =
(((∫ x in a₁..b₁, g (x, b₂)) - ∫ x in a₁..b₁, g (x, a₂)) + ∫ y in a₂..b₂, f (b₁, y)) -
∫ y in a₂..b₂, f (a₁, y) := by
wlog h₁ : a₁ ≤ b₁ generalizing a₁ b₁
· specialize this b₁ a₁
rw [uIcc_comm b₁ a₁, min_comm b₁ a₁, max_comm b₁ a₁] at this
simp only [intervalIntegral.integral_symm b₁ a₁]
refine (congr_arg Neg.neg (this Hcf Hcg Hdf Hdg Hi (le_of_not_le h₁))).trans ?_; abel
wlog h₂ : a₂ ≤ b₂ generalizing a₂ b₂
· specialize this b₂ a₂
rw [uIcc_comm b₂ a₂, min_comm b₂ a₂, max_comm b₂ a₂] at this
simp only [intervalIntegral.integral_symm b₂ a₂, intervalIntegral.integral_neg]
refine (congr_arg Neg.neg (this Hcf Hcg Hdf Hdg Hi (le_of_not_le h₂))).trans ?_; abel
simp only [uIcc_of_le h₁, uIcc_of_le h₂, min_eq_left, max_eq_right, h₁, h₂] at Hcf Hcg Hdf Hdg Hi
calc
(∫ x in a₁..b₁, ∫ y in a₂..b₂, f' (x, y) (1, 0) + g' (x, y) (0, 1)) =
∫ x in Icc a₁ b₁, ∫ y in Icc a₂ b₂, f' (x, y) (1, 0) + g' (x, y) (0, 1) := by
simp only [intervalIntegral.integral_of_le, h₁, h₂,
setIntegral_congr_set_ae (Ioc_ae_eq_Icc (α := ℝ) (μ := volume))]
_ = ∫ x in Icc a₁ b₁ ×ˢ Icc a₂ b₂, f' x (1, 0) + g' x (0, 1) := (setIntegral_prod _ Hi).symm
_ = (((∫ x in a₁..b₁, g (x, b₂)) - ∫ x in a₁..b₁, g (x, a₂)) + ∫ y in a₂..b₂, f (b₁, y)) -
∫ y in a₂..b₂, f (a₁, y) := by
rw [Icc_prod_Icc] at *
apply integral_divergence_prod_Icc_of_hasFDerivWithinAt_off_countable_of_le f g f' g'
(a₁, a₂) (b₁, b₂) ⟨h₁, h₂⟩ s <;> assumption
end MeasureTheory
|
MeasureTheory\Integral\DominatedConvergence.lean | /-
Copyright (c) 2019 Zhouhang Zhou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Zhouhang Zhou, Yury Kudryashov, Patrick Massot
-/
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.Order.Filter.IndicatorFunction
/-!
# The dominated convergence theorem
This file collects various results related to the Lebesgue dominated convergence theorem
for the Bochner integral.
## Main results
- `MeasureTheory.tendsto_integral_of_dominated_convergence`:
the Lebesgue dominated convergence theorem for the Bochner integral
- `MeasureTheory.hasSum_integral_of_dominated_convergence`:
the Lebesgue dominated convergence theorem for series
- `MeasureTheory.integral_tsum`, `MeasureTheory.integral_tsum_of_summable_integral_norm`:
the integral and `tsum`s commute, if the norms of the functions form a summable series
- `intervalIntegral.hasSum_integral_of_dominated_convergence`: the Lebesgue dominated convergence
theorem for parametric interval integrals
- `intervalIntegral.continuous_of_dominated_interval`: continuity of the interval integral
w.r.t. a parameter
- `intervalIntegral.continuous_primitive` and friends: primitives of interval integrable
measurable functions are continuous
-/
open MeasureTheory Metric
/-!
## The Lebesgue dominated convergence theorem for the Bochner integral
-/
section DominatedConvergenceTheorem
open Set Filter TopologicalSpace ENNReal
open scoped Topology
namespace MeasureTheory
variable {α E G : Type*}
[NormedAddCommGroup E] [NormedSpace ℝ E]
[NormedAddCommGroup G] [NormedSpace ℝ G]
{f g : α → E} {m : MeasurableSpace α} {μ : Measure α}
/-- **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 : ℕ → α → G} {f : α → G} (bound : α → ℝ)
(F_measurable : ∀ n, AEStronglyMeasurable (F n) μ) (bound_integrable : Integrable bound μ)
(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]
/-- Lebesgue dominated convergence theorem for filters with a countable basis -/
theorem tendsto_integral_filter_of_dominated_convergence {ι} {l : Filter ι} [l.IsCountablyGenerated]
{F : ι → α → G} {f : α → G} (bound : α → ℝ) (hF_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) μ)
(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]
/-- Lebesgue dominated convergence theorem for series. -/
theorem hasSum_integral_of_dominated_convergence {ι} [Countable ι] {F : ι → α → G} {f : α → G}
(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 => ∫ 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 le_tsum ha_sum _ 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_finset_sum _ 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_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 := sum_le_tsum _ (fun n _ => ha0 n) has
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
by_cases hG : CompleteSpace G; swap
· simp [integral, hG]
have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
rw [← lintegral_tsum hf''] at hf'
refine (ae_lt_top' (AEMeasurable.ennreal_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
· simp_rw [← NNReal.coe_tsum]
rw [aestronglyMeasurable_iff_aemeasurable]
apply AEMeasurable.coe_nnreal_real
apply AEMeasurable.nnreal_tsum
exact fun i => (hf i).nnnorm.aemeasurable
· 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, 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 : ι → α → 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
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, ← ENNReal.coe_tsum]
· apply coe_ne_top
· simp_rw [← NNReal.summable_coe, coe_nnnorm]
exact 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
end MeasureTheory
section TendstoMono
variable {α E : Type*} [MeasurableSpace α]
{μ : Measure α} [NormedAddCommGroup E] [NormedSpace ℝ E] {s : ℕ → Set α}
{f : α → E}
theorem _root_.Antitone.tendsto_setIntegral (hsm : ∀ i, MeasurableSet (s i)) (h_anti : Antitone s)
(hfi : IntegrableOn f (s 0) μ) :
Tendsto (fun i => ∫ a in s i, f a ∂μ) atTop (𝓝 (∫ a in ⋂ n, s n, f a ∂μ)) := by
let bound : α → ℝ := indicator (s 0) fun a => ‖f a‖
have h_int_eq : (fun i => ∫ a in s i, f a ∂μ) = fun i => ∫ a, (s i).indicator f a ∂μ :=
funext fun i => (integral_indicator (hsm i)).symm
rw [h_int_eq]
rw [← integral_indicator (MeasurableSet.iInter hsm)]
refine tendsto_integral_of_dominated_convergence bound ?_ ?_ ?_ ?_
· intro n
rw [aestronglyMeasurable_indicator_iff (hsm n)]
exact (IntegrableOn.mono_set hfi (h_anti (zero_le n))).1
· rw [integrable_indicator_iff (hsm 0)]
exact hfi.norm
· simp_rw [norm_indicator_eq_indicator_norm]
refine fun n => eventually_of_forall fun x => ?_
exact indicator_le_indicator_of_subset (h_anti (zero_le n)) (fun a => norm_nonneg _) _
· filter_upwards [] with a using le_trans (h_anti.tendsto_indicator _ _ _) (pure_le_nhds _)
@[deprecated (since := "2024-04-17")]
alias _root_.Antitone.tendsto_set_integral := _root_.Antitone.tendsto_setIntegral
end TendstoMono
/-!
## The Lebesgue dominated convergence theorem for interval integrals
As an application, we show continuity of parametric integrals.
-/
namespace intervalIntegral
section DCT
variable {ι 𝕜 E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
{a b : ℝ} {f : ℝ → E} {μ : Measure ℝ}
/-- Lebesgue dominated convergence theorem for filters with a countable basis -/
nonrec theorem tendsto_integral_filter_of_dominated_convergence {ι} {l : Filter ι}
[l.IsCountablyGenerated] {F : ι → ℝ → E} (bound : ℝ → ℝ)
(hF_meas : ∀ᶠ n in l, AEStronglyMeasurable (F n) (μ.restrict (Ι a b)))
(h_bound : ∀ᶠ n in l, ∀ᵐ x ∂μ, x ∈ Ι a b → ‖F n x‖ ≤ bound x)
(bound_integrable : IntervalIntegrable bound μ a b)
(h_lim : ∀ᵐ x ∂μ, x ∈ Ι a b → Tendsto (fun n => F n x) l (𝓝 (f x))) :
Tendsto (fun n => ∫ x in a..b, F n x ∂μ) l (𝓝 <| ∫ x in a..b, f x ∂μ) := by
simp only [intervalIntegrable_iff, intervalIntegral_eq_integral_uIoc,
← ae_restrict_iff' (α := ℝ) (μ := μ) measurableSet_uIoc] at *
exact tendsto_const_nhds.smul <|
tendsto_integral_filter_of_dominated_convergence bound hF_meas h_bound bound_integrable h_lim
/-- Lebesgue dominated convergence theorem for parametric interval integrals. -/
nonrec theorem hasSum_integral_of_dominated_convergence {ι} [Countable ι] {F : ι → ℝ → E}
(bound : ι → ℝ → ℝ) (hF_meas : ∀ n, AEStronglyMeasurable (F n) (μ.restrict (Ι a b)))
(h_bound : ∀ n, ∀ᵐ t ∂μ, t ∈ Ι a b → ‖F n t‖ ≤ bound n t)
(bound_summable : ∀ᵐ t ∂μ, t ∈ Ι a b → Summable fun n => bound n t)
(bound_integrable : IntervalIntegrable (fun t => ∑' n, bound n t) μ a b)
(h_lim : ∀ᵐ t ∂μ, t ∈ Ι a b → HasSum (fun n => F n t) (f t)) :
HasSum (fun n => ∫ t in a..b, F n t ∂μ) (∫ t in a..b, f t ∂μ) := by
simp only [intervalIntegrable_iff, intervalIntegral_eq_integral_uIoc, ←
ae_restrict_iff' (α := ℝ) (μ := μ) measurableSet_uIoc] at *
exact
(hasSum_integral_of_dominated_convergence bound hF_meas h_bound bound_summable bound_integrable
h_lim).const_smul
_
/-- Interval integrals commute with countable sums, when the supremum norms are summable (a
special case of the dominated convergence theorem). -/
theorem hasSum_intervalIntegral_of_summable_norm [Countable ι] {f : ι → C(ℝ, E)}
(hf_sum : Summable fun i : ι => ‖(f i).restrict (⟨uIcc a b, isCompact_uIcc⟩ : Compacts ℝ)‖) :
HasSum (fun i : ι => ∫ x in a..b, f i x) (∫ x in a..b, ∑' i : ι, f i x) := by
by_cases hE : CompleteSpace E; swap
· simp [intervalIntegral, integral, hE, hasSum_zero]
apply hasSum_integral_of_dominated_convergence
(fun i (x : ℝ) => ‖(f i).restrict ↑(⟨uIcc a b, isCompact_uIcc⟩ : Compacts ℝ)‖)
(fun i => (map_continuous <| f i).aestronglyMeasurable)
· intro i; filter_upwards with x hx
apply ContinuousMap.norm_coe_le_norm ((f i).restrict _) ⟨x, _⟩
exact ⟨hx.1.le, hx.2⟩
· exact ae_of_all _ fun x _ => hf_sum
· exact intervalIntegrable_const
· refine ae_of_all _ fun x hx => Summable.hasSum ?_
let x : (⟨uIcc a b, isCompact_uIcc⟩ : Compacts ℝ) := ⟨x, ⟨hx.1.le, hx.2⟩⟩
have := hf_sum.of_norm
simpa only [Compacts.coe_mk, ContinuousMap.restrict_apply]
using ContinuousMap.summable_apply this x
theorem tsum_intervalIntegral_eq_of_summable_norm [Countable ι] {f : ι → C(ℝ, E)}
(hf_sum : Summable fun i : ι => ‖(f i).restrict (⟨uIcc a b, isCompact_uIcc⟩ : Compacts ℝ)‖) :
∑' i : ι, ∫ x in a..b, f i x = ∫ x in a..b, ∑' i : ι, f i x :=
(hasSum_intervalIntegral_of_summable_norm hf_sum).tsum_eq
variable {X : Type*} [TopologicalSpace X] [FirstCountableTopology X]
/-- Continuity of interval integral with respect to a parameter, at a point within a set.
Given `F : X → ℝ → E`, assume `F x` is ae-measurable on `[a, b]` for `x` in a
neighborhood of `x₀` within `s` and at `x₀`, and assume it is bounded by a function integrable
on `[a, b]` independent of `x` in a neighborhood of `x₀` within `s`. If `(fun x ↦ F x t)`
is continuous at `x₀` within `s` for almost every `t` in `[a, b]`
then the same holds for `(fun x ↦ ∫ t in a..b, F x t ∂μ) s x₀`. -/
theorem continuousWithinAt_of_dominated_interval {F : X → ℝ → E} {x₀ : X} {bound : ℝ → ℝ} {a b : ℝ}
{s : Set X} (hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) (μ.restrict <| Ι a b))
(h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ t ∂μ, t ∈ Ι a b → ‖F x t‖ ≤ bound t)
(bound_integrable : IntervalIntegrable bound μ a b)
(h_cont : ∀ᵐ t ∂μ, t ∈ Ι a b → ContinuousWithinAt (fun x => F x t) s x₀) :
ContinuousWithinAt (fun x => ∫ t in a..b, F x t ∂μ) s x₀ :=
tendsto_integral_filter_of_dominated_convergence bound hF_meas h_bound bound_integrable h_cont
/-- Continuity of interval integral with respect to a parameter at a point.
Given `F : X → ℝ → E`, assume `F x` is ae-measurable on `[a, b]` for `x` in a
neighborhood of `x₀`, and assume it is bounded by a function integrable on
`[a, b]` independent of `x` in a neighborhood of `x₀`. If `(fun x ↦ F x t)`
is continuous at `x₀` for almost every `t` in `[a, b]`
then the same holds for `(fun x ↦ ∫ t in a..b, F x t ∂μ) s x₀`. -/
theorem continuousAt_of_dominated_interval {F : X → ℝ → E} {x₀ : X} {bound : ℝ → ℝ} {a b : ℝ}
(hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) (μ.restrict <| Ι a b))
(h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ t ∂μ, t ∈ Ι a b → ‖F x t‖ ≤ bound t)
(bound_integrable : IntervalIntegrable bound μ a b)
(h_cont : ∀ᵐ t ∂μ, t ∈ Ι a b → ContinuousAt (fun x => F x t) x₀) :
ContinuousAt (fun x => ∫ t in a..b, F x t ∂μ) x₀ :=
tendsto_integral_filter_of_dominated_convergence bound hF_meas h_bound bound_integrable h_cont
/-- Continuity of interval integral with respect to a parameter.
Given `F : X → ℝ → E`, assume each `F x` is ae-measurable on `[a, b]`,
and assume it is bounded by a function integrable on `[a, b]` independent of `x`.
If `(fun x ↦ F x t)` is continuous for almost every `t` in `[a, b]`
then the same holds for `(fun x ↦ ∫ t in a..b, F x t ∂μ) s x₀`. -/
theorem continuous_of_dominated_interval {F : X → ℝ → E} {bound : ℝ → ℝ} {a b : ℝ}
(hF_meas : ∀ x, AEStronglyMeasurable (F x) <| μ.restrict <| Ι a b)
(h_bound : ∀ x, ∀ᵐ t ∂μ, t ∈ Ι a b → ‖F x t‖ ≤ bound t)
(bound_integrable : IntervalIntegrable bound μ a b)
(h_cont : ∀ᵐ t ∂μ, t ∈ Ι a b → Continuous fun x => F x t) :
Continuous fun x => ∫ t in a..b, F x t ∂μ :=
continuous_iff_continuousAt.mpr fun _ =>
continuousAt_of_dominated_interval (eventually_of_forall hF_meas) (eventually_of_forall h_bound)
bound_integrable <|
h_cont.mono fun _ himp hx => (himp hx).continuousAt
end DCT
section ContinuousPrimitive
open scoped Interval
variable {E X : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [TopologicalSpace X]
{a b b₀ b₁ b₂ : ℝ} {μ : Measure ℝ} {f : ℝ → E}
theorem continuousWithinAt_primitive (hb₀ : μ {b₀} = 0)
(h_int : IntervalIntegrable f μ (min a b₁) (max a b₂)) :
ContinuousWithinAt (fun b => ∫ x in a..b, f x ∂μ) (Icc b₁ b₂) b₀ := by
by_cases h₀ : b₀ ∈ Icc b₁ b₂
· have h₁₂ : b₁ ≤ b₂ := h₀.1.trans h₀.2
have min₁₂ : min b₁ b₂ = b₁ := min_eq_left h₁₂
have h_int' : ∀ {x}, x ∈ Icc b₁ b₂ → IntervalIntegrable f μ b₁ x := by
rintro x ⟨h₁, h₂⟩
apply h_int.mono_set
apply uIcc_subset_uIcc
· exact ⟨min_le_of_left_le (min_le_right a b₁),
h₁.trans (h₂.trans <| le_max_of_le_right <| le_max_right _ _)⟩
· exact ⟨min_le_of_left_le <| (min_le_right _ _).trans h₁,
le_max_of_le_right <| h₂.trans <| le_max_right _ _⟩
have : ∀ b ∈ Icc b₁ b₂,
∫ x in a..b, f x ∂μ = (∫ x in a..b₁, f x ∂μ) + ∫ x in b₁..b, f x ∂μ := by
rintro b ⟨h₁, h₂⟩
rw [← integral_add_adjacent_intervals _ (h_int' ⟨h₁, h₂⟩)]
apply h_int.mono_set
apply uIcc_subset_uIcc
· exact ⟨min_le_of_left_le (min_le_left a b₁), le_max_of_le_right (le_max_left _ _)⟩
· exact ⟨min_le_of_left_le (min_le_right _ _),
le_max_of_le_right (h₁.trans <| h₂.trans (le_max_right a b₂))⟩
apply ContinuousWithinAt.congr _ this (this _ h₀); clear this
refine continuousWithinAt_const.add ?_
have :
(fun b => ∫ x in b₁..b, f x ∂μ) =ᶠ[𝓝[Icc b₁ b₂] b₀] fun b =>
∫ x in b₁..b₂, indicator {x | x ≤ b} f x ∂μ := by
apply eventuallyEq_of_mem self_mem_nhdsWithin
exact fun b b_in => (integral_indicator b_in).symm
apply ContinuousWithinAt.congr_of_eventuallyEq _ this (integral_indicator h₀).symm
have : IntervalIntegrable (fun x => ‖f x‖) μ b₁ b₂ :=
IntervalIntegrable.norm (h_int' <| right_mem_Icc.mpr h₁₂)
refine continuousWithinAt_of_dominated_interval ?_ ?_ this ?_ <;> clear this
· filter_upwards [self_mem_nhdsWithin]
intro x hx
erw [aestronglyMeasurable_indicator_iff, Measure.restrict_restrict, Iic_inter_Ioc_of_le]
· rw [min₁₂]
exact (h_int' hx).1.aestronglyMeasurable
· exact le_max_of_le_right hx.2
exacts [measurableSet_Iic, measurableSet_Iic]
· filter_upwards with x; filter_upwards with t
dsimp [indicator]
split_ifs <;> simp
· have : ∀ᵐ t ∂μ, t < b₀ ∨ b₀ < t := by
filter_upwards [compl_mem_ae_iff.mpr hb₀] with x hx using Ne.lt_or_lt hx
apply this.mono
rintro x₀ (hx₀ | hx₀) -
· have : ∀ᶠ x in 𝓝[Icc b₁ b₂] b₀, {t : ℝ | t ≤ x}.indicator f x₀ = f x₀ := by
apply mem_nhdsWithin_of_mem_nhds
apply Eventually.mono (Ioi_mem_nhds hx₀)
intro x hx
simp [hx.le]
apply continuousWithinAt_const.congr_of_eventuallyEq this
simp [hx₀.le]
· have : ∀ᶠ x in 𝓝[Icc b₁ b₂] b₀, {t : ℝ | t ≤ x}.indicator f x₀ = 0 := by
apply mem_nhdsWithin_of_mem_nhds
apply Eventually.mono (Iio_mem_nhds hx₀)
intro x hx
simp [hx]
apply continuousWithinAt_const.congr_of_eventuallyEq this
simp [hx₀]
· apply continuousWithinAt_of_not_mem_closure
rwa [closure_Icc]
theorem continuousAt_parametric_primitive_of_dominated [FirstCountableTopology X]
{F : X → ℝ → E} (bound : ℝ → ℝ) (a b : ℝ)
{a₀ b₀ : ℝ} {x₀ : X} (hF_meas : ∀ x, AEStronglyMeasurable (F x) (μ.restrict <| Ι a b))
(h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ t ∂μ.restrict <| Ι a b, ‖F x t‖ ≤ bound t)
(bound_integrable : IntervalIntegrable bound μ a b)
(h_cont : ∀ᵐ t ∂μ.restrict <| Ι a b, ContinuousAt (fun x ↦ F x t) x₀) (ha₀ : a₀ ∈ Ioo a b)
(hb₀ : b₀ ∈ Ioo a b) (hμb₀ : μ {b₀} = 0) :
ContinuousAt (fun p : X × ℝ ↦ ∫ t : ℝ in a₀..p.2, F p.1 t ∂μ) (x₀, b₀) := by
have hsub : ∀ {a₀ b₀}, a₀ ∈ Ioo a b → b₀ ∈ Ioo a b → Ι a₀ b₀ ⊆ Ι a b := fun ha₀ hb₀ ↦
(ordConnected_Ioo.uIoc_subset ha₀ hb₀).trans (Ioo_subset_Ioc_self.trans Ioc_subset_uIoc)
have Ioo_nhds : Ioo a b ∈ 𝓝 b₀ := Ioo_mem_nhds hb₀.1 hb₀.2
have Icc_nhds : Icc a b ∈ 𝓝 b₀ := Icc_mem_nhds hb₀.1 hb₀.2
have hx₀ : ∀ᵐ t : ℝ ∂μ.restrict (Ι a b), ‖F x₀ t‖ ≤ bound t := h_bound.self_of_nhds
have : ∀ᶠ p : X × ℝ in 𝓝 (x₀, b₀),
∫ s in a₀..p.2, F p.1 s ∂μ =
∫ s in a₀..b₀, F p.1 s ∂μ + ∫ s in b₀..p.2, F x₀ s ∂μ +
∫ s in b₀..p.2, F p.1 s - F x₀ s ∂μ := by
rw [nhds_prod_eq]
refine (h_bound.prod_mk Ioo_nhds).mono ?_
rintro ⟨x, t⟩ ⟨hx : ∀ᵐ t : ℝ ∂μ.restrict (Ι a b), ‖F x t‖ ≤ bound t, ht : t ∈ Ioo a b⟩
dsimp
have hiF : ∀ {x a₀ b₀},
(∀ᵐ t : ℝ ∂μ.restrict (Ι a b), ‖F x t‖ ≤ bound t) → a₀ ∈ Ioo a b → b₀ ∈ Ioo a b →
IntervalIntegrable (F x) μ a₀ b₀ := fun {x a₀ b₀} hx ha₀ hb₀ ↦
(bound_integrable.mono_set_ae <| eventually_of_forall <| hsub ha₀ hb₀).mono_fun'
((hF_meas x).mono_set <| hsub ha₀ hb₀)
(ae_restrict_of_ae_restrict_of_subset (hsub ha₀ hb₀) hx)
rw [intervalIntegral.integral_sub, add_assoc, add_sub_cancel,
intervalIntegral.integral_add_adjacent_intervals]
· exact hiF hx ha₀ hb₀
· exact hiF hx hb₀ ht
· exact hiF hx hb₀ ht
· exact hiF hx₀ hb₀ ht
rw [continuousAt_congr this]; clear this
refine (ContinuousAt.add ?_ ?_).add ?_
· exact (intervalIntegral.continuousAt_of_dominated_interval
(eventually_of_forall fun x ↦ (hF_meas x).mono_set <| hsub ha₀ hb₀)
(h_bound.mono fun x hx ↦
ae_imp_of_ae_restrict <| ae_restrict_of_ae_restrict_of_subset (hsub ha₀ hb₀) hx)
(bound_integrable.mono_set_ae <| eventually_of_forall <| hsub ha₀ hb₀) <|
ae_imp_of_ae_restrict <| ae_restrict_of_ae_restrict_of_subset (hsub ha₀ hb₀) h_cont).fst'
· refine (?_ : ContinuousAt (fun t ↦ ∫ s in b₀..t, F x₀ s ∂μ) b₀).snd'
apply ContinuousWithinAt.continuousAt _ (Icc_mem_nhds hb₀.1 hb₀.2)
apply intervalIntegral.continuousWithinAt_primitive hμb₀
rw [min_eq_right hb₀.1.le, max_eq_right hb₀.2.le]
exact bound_integrable.mono_fun' (hF_meas x₀) hx₀
· suffices Tendsto (fun x : X × ℝ ↦ ∫ s in b₀..x.2, F x.1 s - F x₀ s ∂μ) (𝓝 (x₀, b₀)) (𝓝 0) by
simpa [ContinuousAt]
have : ∀ᶠ p : X × ℝ in 𝓝 (x₀, b₀),
‖∫ s in b₀..p.2, F p.1 s - F x₀ s ∂μ‖ ≤ |∫ s in b₀..p.2, 2 * bound s ∂μ| := by
rw [nhds_prod_eq]
refine (h_bound.prod_mk Ioo_nhds).mono ?_
rintro ⟨x, t⟩ ⟨hx : ∀ᵐ t ∂μ.restrict (Ι a b), ‖F x t‖ ≤ bound t, ht : t ∈ Ioo a b⟩
have H : ∀ᵐ t : ℝ ∂μ.restrict (Ι b₀ t), ‖F x t - F x₀ t‖ ≤ 2 * bound t := by
apply (ae_restrict_of_ae_restrict_of_subset (hsub hb₀ ht) (hx.and hx₀)).mono
rintro s ⟨hs₁, hs₂⟩
calc
‖F x s - F x₀ s‖ ≤ ‖F x s‖ + ‖F x₀ s‖ := norm_sub_le _ _
_ ≤ 2 * bound s := by linarith only [hs₁, hs₂]
exact intervalIntegral.norm_integral_le_of_norm_le H
((bound_integrable.mono_set' <| hsub hb₀ ht).const_mul 2)
apply squeeze_zero_norm' this
have : Tendsto (fun t ↦ ∫ s in b₀..t, 2 * bound s ∂μ) (𝓝 b₀) (𝓝 0) := by
suffices ContinuousAt (fun t ↦ ∫ s in b₀..t, 2 * bound s ∂μ) b₀ by
simpa [ContinuousAt] using this
apply ContinuousWithinAt.continuousAt _ Icc_nhds
apply intervalIntegral.continuousWithinAt_primitive hμb₀
apply IntervalIntegrable.const_mul
apply bound_integrable.mono_set'
rw [min_eq_right hb₀.1.le, max_eq_right hb₀.2.le]
rw [nhds_prod_eq]
exact (continuous_abs.tendsto' _ _ abs_zero).comp (this.comp tendsto_snd)
variable [NoAtoms μ]
theorem continuousOn_primitive (h_int : IntegrableOn f (Icc a b) μ) :
ContinuousOn (fun x => ∫ t in Ioc a x, f t ∂μ) (Icc a b) := by
by_cases h : a ≤ b
· have : ∀ x ∈ Icc a b, ∫ t in Ioc a x, f t ∂μ = ∫ t in a..x, f t ∂μ := by
intro x x_in
simp_rw [integral_of_le x_in.1]
rw [continuousOn_congr this]
intro x₀ _
refine continuousWithinAt_primitive (measure_singleton x₀) ?_
simp only [intervalIntegrable_iff_integrableOn_Ioc_of_le, min_eq_left, max_eq_right, h,
min_self]
exact h_int.mono Ioc_subset_Icc_self le_rfl
· rw [Icc_eq_empty h]
exact continuousOn_empty _
theorem continuousOn_primitive_Icc (h_int : IntegrableOn f (Icc a b) μ) :
ContinuousOn (fun x => ∫ t in Icc a x, f t ∂μ) (Icc a b) := by
have aux : (fun x => ∫ t in Icc a x, f t ∂μ) = fun x => ∫ t in Ioc a x, f t ∂μ := by
ext x
exact integral_Icc_eq_integral_Ioc
rw [aux]
exact continuousOn_primitive h_int
/-- Note: this assumes that `f` is `IntervalIntegrable`, in contrast to some other lemmas here. -/
theorem continuousOn_primitive_interval' (h_int : IntervalIntegrable f μ b₁ b₂)
(ha : a ∈ [[b₁, b₂]]) : ContinuousOn (fun b => ∫ x in a..b, f x ∂μ) [[b₁, b₂]] := fun _ _ ↦ by
refine continuousWithinAt_primitive (measure_singleton _) ?_
rw [min_eq_right ha.1, max_eq_right ha.2]
simpa [intervalIntegrable_iff, uIoc] using h_int
theorem continuousOn_primitive_interval (h_int : IntegrableOn f (uIcc a b) μ) :
ContinuousOn (fun x => ∫ t in a..x, f t ∂μ) (uIcc a b) :=
continuousOn_primitive_interval' h_int.intervalIntegrable left_mem_uIcc
theorem continuousOn_primitive_interval_left (h_int : IntegrableOn f (uIcc a b) μ) :
ContinuousOn (fun x => ∫ t in x..b, f t ∂μ) (uIcc a b) := by
rw [uIcc_comm a b] at h_int ⊢
simp only [integral_symm b]
exact (continuousOn_primitive_interval h_int).neg
theorem continuous_primitive (h_int : ∀ a b, IntervalIntegrable f μ a b) (a : ℝ) :
Continuous fun b => ∫ x in a..b, f x ∂μ := by
rw [continuous_iff_continuousAt]
intro b₀
cases' exists_lt b₀ with b₁ hb₁
cases' exists_gt b₀ with b₂ hb₂
apply ContinuousWithinAt.continuousAt _ (Icc_mem_nhds hb₁ hb₂)
exact continuousWithinAt_primitive (measure_singleton b₀) (h_int _ _)
nonrec theorem _root_.MeasureTheory.Integrable.continuous_primitive (h_int : Integrable f μ)
(a : ℝ) : Continuous fun b => ∫ x in a..b, f x ∂μ :=
continuous_primitive (fun _ _ => h_int.intervalIntegrable) a
variable [IsLocallyFiniteMeasure μ] {f : X → ℝ → E}
theorem continuous_parametric_primitive_of_continuous
{a₀ : ℝ} (hf : Continuous f.uncurry) :
Continuous fun p : X × ℝ ↦ ∫ t in a₀..p.2, f p.1 t ∂μ := by
-- We will prove continuity at a point `(q, b₀)`.
rw [continuous_iff_continuousAt]
rintro ⟨q, b₀⟩
apply Metric.continuousAt_iff'.2 (fun ε εpos ↦ ?_)
-- choose `a` and `b` such that `(a, b)` contains both `a₀` and `b₀`. We will use uniform
-- estimates on a neighborhood of the compact set `{q} × [a, b]`.
cases' exists_lt (min a₀ b₀) with a a_lt
cases' exists_gt (max a₀ b₀) with b lt_b
rw [lt_min_iff] at a_lt
rw [max_lt_iff] at lt_b
have : IsCompact ({q} ×ˢ (Icc a b)) := isCompact_singleton.prod isCompact_Icc
-- let `M` be a bound for `f` on the compact set `{q} × [a, b]`.
obtain ⟨M, hM⟩ := this.bddAbove_image hf.norm.continuousOn
-- let `δ` be small enough to satisfy several properties that will show up later.
obtain ⟨δ, δpos, hδ, h'δ, h''δ⟩ : ∃ (δ : ℝ), 0 < δ ∧ δ < 1 ∧ Icc (b₀ - δ) (b₀ + δ) ⊆ Icc a b ∧
(M + 1) * (μ (Icc (b₀ - δ) (b₀ + δ))).toReal + δ * (μ (Icc a b)).toReal < ε := by
have A : ∀ᶠ δ in 𝓝[>] (0 : ℝ), δ ∈ Ioo 0 1 := Ioo_mem_nhdsWithin_Ioi (by simp)
have B : ∀ᶠ δ in 𝓝 0, Icc (b₀ - δ) (b₀ + δ) ⊆ Icc a b := by
have I : Tendsto (fun δ ↦ b₀ - δ) (𝓝 0) (𝓝 (b₀ - 0)) := tendsto_const_nhds.sub tendsto_id
have J : Tendsto (fun δ ↦ b₀ + δ) (𝓝 0) (𝓝 (b₀ + 0)) := tendsto_const_nhds.add tendsto_id
simp only [sub_zero, add_zero] at I J
filter_upwards [(tendsto_order.1 I).1 _ a_lt.2, (tendsto_order.1 J).2 _ lt_b.2] with δ hδ h'δ
exact Icc_subset_Icc hδ.le h'δ.le
have C : ∀ᶠ δ in 𝓝 0,
(M + 1) * (μ (Icc (b₀ - δ) (b₀ + δ))).toReal + δ * (μ (Icc a b)).toReal < ε := by
suffices Tendsto
(fun δ ↦ (M + 1) * (μ (Icc (b₀ - δ) (b₀ + δ))).toReal + δ * (μ (Icc a b)).toReal)
(𝓝 0) (𝓝 ((M + 1) * (0 : ℝ≥0∞).toReal + 0 * (μ (Icc a b)).toReal)) by
simp only [zero_toReal, mul_zero, zero_mul, add_zero] at this
exact (tendsto_order.1 this).2 _ εpos
apply Tendsto.add (Tendsto.mul tendsto_const_nhds _)
(Tendsto.mul tendsto_id tendsto_const_nhds)
exact (tendsto_toReal zero_ne_top).comp (tendsto_measure_Icc _ _)
rcases (A.and ((B.and C).filter_mono nhdsWithin_le_nhds)).exists with ⟨δ, hδ, h'δ, h''δ⟩
exact ⟨δ, hδ.1, hδ.2, h'δ, h''δ⟩
-- By compactness of `[a, b]` and continuity of `f` there, if `p` is close enough to `q`
-- then `f p x` is `δ`-close to `f q x`, uniformly in `x ∈ [a, b]`.
-- (Note in particular that this implies a bound `M + δ ≤ M + 1` for `f p x`).
obtain ⟨v, v_mem, hv⟩ : ∃ v ∈ 𝓝[univ] q, ∀ p ∈ v, ∀ x ∈ Icc a b, dist (f p x) (f q x) < δ :=
IsCompact.mem_uniformity_of_prod isCompact_Icc hf.continuousOn (mem_univ _)
(dist_mem_uniformity δpos)
-- for `p` in this neighborhood and `s` which is `δ`-close to `b₀`, we will show that the
-- integrals are `ε`-close.
have : v ×ˢ (Ioo (b₀ - δ) (b₀ + δ)) ∈ 𝓝 (q, b₀) := by
rw [nhdsWithin_univ] at v_mem
simp only [prod_mem_nhds_iff, v_mem, true_and]
apply Ioo_mem_nhds <;> linarith
filter_upwards [this]
rintro ⟨p, s⟩ ⟨hp : p ∈ v, hs : s ∈ Ioo (b₀ - δ) (b₀ + δ)⟩
simp only [dist_eq_norm] at hv ⊢
have J r u v : IntervalIntegrable (f r) μ u v := (hf.uncurry_left _).intervalIntegrable _ _
/- we compute the difference between the integrals by splitting the contribution of the change
from `b₀` to `s` (which gives a contribution controlled by the measure of `(b₀ - δ, b₀ + δ)`,
small enough thanks to our choice of `δ`) and the change from `q` to `p`, which is small as
`f p x` and `f q x` are uniformly close by design. -/
calc
‖∫ t in a₀..s, f p t ∂μ - ∫ t in a₀..b₀, f q t ∂μ‖
= ‖(∫ t in a₀..s, f p t ∂μ - ∫ t in a₀..b₀, f p t ∂μ)
+ (∫ t in a₀..b₀, f p t ∂μ - ∫ t in a₀..b₀, f q t ∂μ)‖ := by congr 1; abel
_ ≤ ‖∫ t in a₀..s, f p t ∂μ - ∫ t in a₀..b₀, f p t ∂μ‖
+ ‖∫ t in a₀..b₀, f p t ∂μ - ∫ t in a₀..b₀, f q t ∂μ‖ := norm_add_le _ _
_ = ‖∫ t in b₀..s, f p t ∂μ‖ + ‖∫ t in a₀..b₀, (f p t - f q t) ∂μ‖ := by
congr 2
· rw [integral_interval_sub_left (J _ _ _) (J _ _ _)]
· rw [integral_sub (J _ _ _) (J _ _ _)]
_ ≤ ∫ t in Ι b₀ s, ‖f p t‖ ∂μ + ∫ t in Ι a₀ b₀, ‖f p t - f q t‖ ∂μ := by
gcongr
· exact norm_integral_le_integral_norm_Ioc
· exact norm_integral_le_integral_norm_Ioc
_ ≤ ∫ t in Icc (b₀ - δ) (b₀ + δ), ‖f p t‖ ∂μ + ∫ t in Icc a b, ‖f p t - f q t‖ ∂μ := by
gcongr
· apply setIntegral_mono_set
· exact (hf.uncurry_left _).norm.integrableOn_Icc
· exact eventually_of_forall (fun x ↦ norm_nonneg _)
· have : Ι b₀ s ⊆ Icc (b₀ - δ) (b₀ + δ) := by
apply uIoc_subset_uIcc.trans (uIcc_subset_Icc ?_ ⟨hs.1.le, hs.2.le⟩ )
simp [δpos.le]
exact eventually_of_forall this
· apply setIntegral_mono_set
· exact ((hf.uncurry_left _).sub (hf.uncurry_left _)).norm.integrableOn_Icc
· exact eventually_of_forall (fun x ↦ norm_nonneg _)
· have : Ι a₀ b₀ ⊆ Icc a b := uIoc_subset_uIcc.trans
(uIcc_subset_Icc ⟨a_lt.1.le, lt_b.1.le⟩ ⟨a_lt.2.le, lt_b.2.le⟩)
exact eventually_of_forall this
_ ≤ ∫ t in Icc (b₀ - δ) (b₀ + δ), M + 1 ∂μ + ∫ _t in Icc a b, δ ∂μ := by
gcongr
· apply setIntegral_mono_on
· exact (hf.uncurry_left _).norm.integrableOn_Icc
· exact continuous_const.integrableOn_Icc
· exact measurableSet_Icc
· intro x hx
calc ‖f p x‖ = ‖f q x + (f p x - f q x)‖ := by congr; abel
_ ≤ ‖f q x‖ + ‖f p x - f q x‖ := norm_add_le _ _
_ ≤ M + δ := by
gcongr
· apply hM
change (fun x ↦ ‖Function.uncurry f x‖) (q, x) ∈ _
apply mem_image_of_mem
simp only [singleton_prod, mem_image, Prod.mk.injEq, true_and, exists_eq_right]
exact h'δ hx
· exact le_of_lt (hv _ hp _ (h'δ hx))
_ ≤ M + 1 := by linarith
· apply setIntegral_mono_on
· exact ((hf.uncurry_left _).sub (hf.uncurry_left _)).norm.integrableOn_Icc
· exact continuous_const.integrableOn_Icc
· exact measurableSet_Icc
· intro x hx
exact le_of_lt (hv _ hp _ hx)
_ = (M + 1) * (μ (Icc (b₀ - δ) (b₀ + δ))).toReal + δ * (μ (Icc a b)).toReal := by simp [mul_comm]
_ < ε := h''δ
@[fun_prop]
theorem continuous_parametric_intervalIntegral_of_continuous {a₀ : ℝ}
(hf : Continuous f.uncurry) {s : X → ℝ} (hs : Continuous s) :
Continuous fun x ↦ ∫ t in a₀..s x, f x t ∂μ :=
show Continuous ((fun p : X × ℝ ↦ ∫ t in a₀..p.2, f p.1 t ∂μ) ∘ fun x ↦ (x, s x)) from
(continuous_parametric_primitive_of_continuous hf).comp₂ continuous_id hs
theorem continuous_parametric_intervalIntegral_of_continuous'
(hf : Continuous f.uncurry) (a₀ b₀ : ℝ) :
Continuous fun x ↦ ∫ t in a₀..b₀, f x t ∂μ := by fun_prop
end ContinuousPrimitive
end intervalIntegral
end DominatedConvergenceTheorem
|
MeasureTheory\Integral\ExpDecay.lean | /-
Copyright (c) 2022 David Loeffler. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Loeffler
-/
import Mathlib.MeasureTheory.Integral.Asymptotics
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.MeasureTheory.Integral.IntegralEqImproper
/-!
# Integrals with exponential decay at ∞
As easy special cases of general theorems in the library, we prove the following test
for integrability:
* `integrable_of_isBigO_exp_neg`: If `f` is continuous on `[a,∞)`, for some `a ∈ ℝ`, and there
exists `b > 0` such that `f(x) = O(exp(-b x))` as `x → ∞`, then `f` is integrable on `(a, ∞)`.
-/
noncomputable section
open Real intervalIntegral MeasureTheory Set Filter
open scoped Topology
/-- `exp (-b * x)` is integrable on `(a, ∞)`. -/
theorem exp_neg_integrableOn_Ioi (a : ℝ) {b : ℝ} (h : 0 < b) :
IntegrableOn (fun x : ℝ => exp (-b * x)) (Ioi a) := by
have : Tendsto (fun x => -exp (-b * x) / b) atTop (𝓝 (-0 / b)) := by
refine Tendsto.div_const (Tendsto.neg ?_) _
exact tendsto_exp_atBot.comp (tendsto_id.const_mul_atTop_of_neg (neg_neg_iff_pos.2 h))
refine integrableOn_Ioi_deriv_of_nonneg' (fun x _ => ?_) (fun x _ => (exp_pos _).le) this
simpa [h.ne'] using ((hasDerivAt_id x).const_mul b).neg.exp.neg.div_const b
/-- If `f` is continuous on `[a, ∞)`, and is `O (exp (-b * x))` at `∞` for some `b > 0`, then
`f` is integrable on `(a, ∞)`. -/
theorem integrable_of_isBigO_exp_neg {f : ℝ → ℝ} {a b : ℝ} (h0 : 0 < b)
(hf : ContinuousOn f (Ici a)) (ho : f =O[atTop] fun x => exp (-b * x)) :
IntegrableOn f (Ioi a) :=
integrableOn_Ici_iff_integrableOn_Ioi.mp <|
(hf.locallyIntegrableOn measurableSet_Ici).integrableOn_of_isBigO_atTop
ho ⟨Ioi b, Ioi_mem_atTop b, exp_neg_integrableOn_Ioi b h0⟩
|
MeasureTheory\Integral\FundThmCalculus.lean | /-
Copyright (c) 2020 Yury G. Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury G. Kudryashov, Patrick Massot, Sébastien Gouëzel
-/
import Mathlib.Analysis.Calculus.FDeriv.Measurable
import Mathlib.Analysis.Calculus.Deriv.Comp
import Mathlib.Analysis.Calculus.Deriv.Add
import Mathlib.Analysis.Calculus.Deriv.Slope
import Mathlib.Analysis.Calculus.Deriv.Mul
import Mathlib.Analysis.Normed.Module.Dual
import Mathlib.MeasureTheory.Integral.DominatedConvergence
import Mathlib.MeasureTheory.Integral.VitaliCaratheodory
/-!
# Fundamental Theorem of Calculus
We prove various versions of the
[fundamental theorem of calculus](https://en.wikipedia.org/wiki/Fundamental_theorem_of_calculus)
for interval integrals in `ℝ`.
Recall that its first version states that the function `(u, v) ↦ ∫ x in u..v, f x` has derivative
`(δu, δv) ↦ δv • f b - δu • f a` at `(a, b)` provided that `f` is continuous at `a` and `b`,
and its second version states that, if `f` has an integrable derivative on `[a, b]`, then
`∫ x in a..b, f' x = f b - f a`.
## Main statements
### FTC-1 for Lebesgue measure
We prove several versions of FTC-1, all in the `intervalIntegral` namespace. Many of them follow
the naming scheme `integral_has(Strict?)(F?)Deriv(Within?)At(_of_tendsto_ae?)(_right|_left?)`.
They formulate FTC in terms of `Has(Strict?)(F?)Deriv(Within?)At`.
Let us explain the meaning of each part of the name:
* `Strict` means that the theorem is about strict differentiability, see `HasStrictDerivAt` and
`HasStrictFDerivAt`;
* `F` means that the theorem is about differentiability in both endpoints; incompatible with
`_right|_left`;
* `Within` means that the theorem is about one-sided derivatives, see below for details;
* `_of_tendsto_ae` means that instead of continuity the theorem assumes that `f` has a finite limit
almost surely as `x` tends to `a` and/or `b`;
* `_right` or `_left` mean that the theorem is about differentiability in the right (resp., left)
endpoint.
We also reformulate these theorems in terms of `(f?)deriv(Within?)`. These theorems are named
`(f?)deriv(Within?)_integral(_of_tendsto_ae?)(_right|_left?)` with the same meaning of parts of the
name.
### One-sided derivatives
Theorem `intervalIntegral.integral_hasFDerivWithinAt_of_tendsto_ae` states that
`(u, v) ↦ ∫ x in u..v, f x` has a derivative `(δu, δv) ↦ δv • cb - δu • ca` within the set `s × t`
at `(a, b)` provided that `f` tends to `ca` (resp., `cb`) almost surely at `la` (resp., `lb`), where
possible values of `s`, `t`, and corresponding filters `la`, `lb` are given in the following table.
| `s` | `la` | `t` | `lb` |
| ------- | ---- | --- | ---- |
| `Iic a` | `𝓝[≤] a` | `Iic b` | `𝓝[≤] b` |
| `Ici a` | `𝓝[>] a` | `Ici b` | `𝓝[>] b` |
| `{a}` | `⊥` | `{b}` | `⊥` |
| `univ` | `𝓝 a` | `univ` | `𝓝 b` |
We use a typeclass `intervalIntegral.FTCFilter` to make Lean automatically find `la`/`lb` based on
`s`/`t`. This way we can formulate one theorem instead of `16` (or `8` if we leave only non-trivial
ones not covered by `integral_hasDerivWithinAt_of_tendsto_ae_(left|right)` and
`integral_hasFDerivAt_of_tendsto_ae`). Similarly, `integral_hasDerivWithinAt_of_tendsto_ae_right`
works for both one-sided derivatives using the same typeclass to find an appropriate filter.
### FTC for a locally finite measure
Before proving FTC for the Lebesgue measure, we prove a few statements that can be seen as FTC for
any measure. The most general of them,
`measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae`, states the following.
Let `(la, la')` be an `intervalIntegral.FTCFilter` pair of filters around `a` (i.e.,
`intervalIntegral.FTCFilter a la la'`) and let `(lb, lb')` be an `intervalIntegral.FTCFilter` pair
of filters around `b`. If `f` has finite limits `ca` and `cb` almost surely at `la'` and `lb'`,
respectively, then
$$
\int_{va}^{vb} f ∂μ - \int_{ua}^{ub} f ∂μ =
\int_{ub}^{vb} cb ∂μ - \int_{ua}^{va} ca ∂μ + o(‖∫_{ua}^{va} 1 ∂μ‖ + ‖∫_{ub}^{vb} (1:ℝ) ∂μ‖)
$$
as `ua` and `va` tend to `la` while `ub` and `vb` tend to `lb`.
### FTC-2 and corollaries
We use FTC-1 to prove several versions of FTC-2 for the Lebesgue measure, using a similar naming
scheme as for the versions of FTC-1. They include:
* `intervalIntegral.integral_eq_sub_of_hasDeriv_right_of_le` - most general version, for functions
with a right derivative
* `intervalIntegral.integral_eq_sub_of_hasDerivAt` - version for functions with a derivative on
an open set
* `intervalIntegral.integral_deriv_eq_sub'` - version that is easiest to use when computing the
integral of a specific function
We then derive additional integration techniques from FTC-2:
* `intervalIntegral.integral_mul_deriv_eq_deriv_mul` - integration by parts
* `intervalIntegral.integral_comp_mul_deriv''` - integration by substitution
Many applications of these theorems can be found in the file
`Mathlib/Analysis/SpecialFunctions/Integrals.lean`.
Note that the assumptions of FTC-2 are formulated in the form that `f'` is integrable. To use it in
a context with the stronger assumption that `f'` is continuous, one can use
`ContinuousOn.intervalIntegrable` or `ContinuousOn.integrableOn_Icc` or
`ContinuousOn.integrableOn_uIcc`.
### `intervalIntegral.FTCFilter` class
As explained above, many theorems in this file rely on the typeclass
`intervalIntegral.FTCFilter (a : ℝ) (l l' : Filter ℝ)` to avoid code duplication. This typeclass
combines four assumptions:
- `pure a ≤ l`;
- `l' ≤ 𝓝 a`;
- `l'` has a basis of measurable sets;
- if `u n` and `v n` tend to `l`, then for any `s ∈ l'`, `Ioc (u n) (v n)` is eventually included
in `s`.
This typeclass has the following “real” instances: `(a, pure a, ⊥)`, `(a, 𝓝[≥] a, 𝓝[>] a)`,
`(a, 𝓝[≤] a, 𝓝[≤] a)`, `(a, 𝓝 a, 𝓝 a)`.
Furthermore, we have the following instances that are equal to the previously mentioned instances:
`(a, 𝓝[{a}] a, ⊥)` and `(a, 𝓝[univ] a, 𝓝[univ] a)`.
While the difference between `Ici a` and `Ioi a` doesn't matter for theorems about Lebesgue measure,
it becomes important in the versions of FTC about any locally finite measure if this measure has an
atom at one of the endpoints.
### Combining one-sided and two-sided derivatives
There are some `intervalIntegral.FTCFilter` instances where the fact that it is one-sided or
two-sided depends on the point, namely `(x, 𝓝[Set.Icc a b] x, 𝓝[Set.Icc a b] x)` (resp.
`(x, 𝓝[Set.uIcc a b] x, 𝓝[Set.uIcc a b] x)`, with `x ∈ Icc a b` (resp. `x ∈ uIcc a b`). This results
in a two-sided derivatives for `x ∈ Set.Ioo a b` and one-sided derivatives for `x ∈ {a, b}`. Other
instances could be added when needed (in that case, one also needs to add instances for
`Filter.IsMeasurablyGenerated` and `Filter.TendstoIxxClass`).
## Tags
integral, fundamental theorem of calculus, FTC-1, FTC-2, change of variables in integrals
-/
noncomputable section
open scoped Classical
open MeasureTheory Set Filter Function
open scoped Classical Topology Filter ENNReal Interval NNReal
variable {ι 𝕜 E F A : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
namespace intervalIntegral
section FTC1
/-!
### Fundamental theorem of calculus, part 1, for any measure
In this section we prove a few lemmas that can be seen as versions of FTC-1 for interval integrals
w.r.t. any measure. Many theorems are formulated for one or two pairs of filters related by
`intervalIntegral.FTCFilter a l l'`. This typeclass has exactly four “real” instances:
`(a, pure a, ⊥)`, `(a, 𝓝[≥] a, 𝓝[>] a)`, `(a, 𝓝[≤] a, 𝓝[≤] a)`, `(a, 𝓝 a, 𝓝 a)`, and two instances
that are equal to the first and last “real” instances: `(a, 𝓝[{a}] a, ⊥)` and
`(a, 𝓝[univ] a, 𝓝[univ] a)`. We use this approach to avoid repeating arguments in many very similar
cases. Lean can automatically find both `a` and `l'` based on `l`.
The most general theorem `measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae` can be
seen as a generalization of lemma `integral_hasStrictFDerivAt` below which states strict
differentiability of `∫ x in u..v, f x` in `(u, v)` at `(a, b)` for a measurable function `f` that
is integrable on `a..b` and is continuous at `a` and `b`. The lemma is generalized in three
directions: first, `measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae` deals with any
locally finite measure `μ`; second, it works for one-sided limits/derivatives; third, it assumes
only that `f` has finite limits almost surely at `a` and `b`.
Namely, let `f` be a measurable function integrable on `a..b`. Let `(la, la')` be a pair of
`intervalIntegral.FTCFilter`s around `a`; let `(lb, lb')` be a pair of `intervalIntegral.FTCFilter`s
around `b`. Suppose that `f` has finite limits `ca` and `cb` at `la' ⊓ ae μ` and `lb' ⊓ ae μ`,
respectively. Then
`∫ x in va..vb, f x ∂μ - ∫ x in ua..ub, f x ∂μ = ∫ x in ub..vb, cb ∂μ - ∫ x in ua..va, ca ∂μ +
o(‖∫ x in ua..va, (1:ℝ) ∂μ‖ + ‖∫ x in ub..vb, (1:ℝ) ∂μ‖)`
as `ua` and `va` tend to `la` while `ub` and `vb` tend to `lb`.
This theorem is formulated with integral of constants instead of measures in the right hand sides
for two reasons: first, this way we avoid `min`/`max` in the statements; second, often it is
possible to write better `simp` lemmas for these integrals, see `integral_const` and
`integral_const_of_cdf`.
In the next subsection we apply this theorem to prove various theorems about differentiability
of the integral w.r.t. Lebesgue measure. -/
/-- An auxiliary typeclass for the Fundamental theorem of calculus, part 1. It is used to formulate
theorems that work simultaneously for left and right one-sided derivatives of `∫ x in u..v, f x`. -/
class FTCFilter (a : outParam ℝ) (outer : Filter ℝ) (inner : outParam <| Filter ℝ) extends
TendstoIxxClass Ioc outer inner : Prop where
pure_le : pure a ≤ outer
le_nhds : inner ≤ 𝓝 a
[meas_gen : IsMeasurablyGenerated inner]
namespace FTCFilter
instance pure (a : ℝ) : FTCFilter a (pure a) ⊥ where
pure_le := le_rfl
le_nhds := bot_le
instance nhdsWithinSingleton (a : ℝ) : FTCFilter a (𝓝[{a}] a) ⊥ := by
rw [nhdsWithin, principal_singleton, inf_eq_right.2 (pure_le_nhds a)]; infer_instance
theorem finiteAt_inner {a : ℝ} (l : Filter ℝ) {l'} [h : FTCFilter a l l'] {μ : Measure ℝ}
[IsLocallyFiniteMeasure μ] : μ.FiniteAtFilter l' :=
(μ.finiteAt_nhds a).filter_mono h.le_nhds
instance nhds (a : ℝ) : FTCFilter a (𝓝 a) (𝓝 a) where
pure_le := pure_le_nhds a
le_nhds := le_rfl
instance nhdsUniv (a : ℝ) : FTCFilter a (𝓝[univ] a) (𝓝 a) := by rw [nhdsWithin_univ]; infer_instance
instance nhdsLeft (a : ℝ) : FTCFilter a (𝓝[≤] a) (𝓝[≤] a) where
pure_le := pure_le_nhdsWithin right_mem_Iic
le_nhds := inf_le_left
instance nhdsRight (a : ℝ) : FTCFilter a (𝓝[≥] a) (𝓝[>] a) where
pure_le := pure_le_nhdsWithin left_mem_Ici
le_nhds := inf_le_left
instance nhdsIcc {x a b : ℝ} [h : Fact (x ∈ Icc a b)] :
FTCFilter x (𝓝[Icc a b] x) (𝓝[Icc a b] x) where
pure_le := pure_le_nhdsWithin h.out
le_nhds := inf_le_left
instance nhdsUIcc {x a b : ℝ} [h : Fact (x ∈ [[a, b]])] :
FTCFilter x (𝓝[[[a, b]]] x) (𝓝[[[a, b]]] x) :=
.nhdsIcc (h := h)
end FTCFilter
open Asymptotics
section
variable {f : ℝ → E} {a b : ℝ} {c ca cb : E} {l l' la la' lb lb' : Filter ℝ} {lt : Filter ι}
{μ : Measure ℝ} {u v ua va ub vb : ι → ℝ}
/-- **Fundamental theorem of calculus-1**, local version for any measure.
Let filters `l` and `l'` be related by `TendstoIxxClass Ioc`.
If `f` has a finite limit `c` at `l' ⊓ ae μ`, where `μ` is a measure
finite at `l'`, then `∫ x in u..v, f x ∂μ = ∫ x in u..v, c ∂μ + o(∫ x in u..v, 1 ∂μ)` as both
`u` and `v` tend to `l`.
See also `measure_integral_sub_linear_isLittleO_of_tendsto_ae` for a version assuming
`[intervalIntegral.FTCFilter a l l']` and `[MeasureTheory.IsLocallyFiniteMeasure μ]`. If `l` is one
of `𝓝[≥] a`, `𝓝[≤] a`, `𝓝 a`, then it's easier to apply the non-primed version. The primed version
also works, e.g., for `l = l' = atTop`.
We use integrals of constants instead of measures because this way it is easier to formulate
a statement that works in both cases `u ≤ v` and `v ≤ u`. -/
theorem measure_integral_sub_linear_isLittleO_of_tendsto_ae' [IsMeasurablyGenerated l']
[TendstoIxxClass Ioc l l'] (hfm : StronglyMeasurableAtFilter f l' μ)
(hf : Tendsto f (l' ⊓ ae μ) (𝓝 c)) (hl : μ.FiniteAtFilter l') (hu : Tendsto u lt l)
(hv : Tendsto v lt l) :
(fun t => (∫ x in u t..v t, f x ∂μ) - ∫ _ in u t..v t, c ∂μ) =o[lt] fun t =>
∫ _ in u t..v t, (1 : ℝ) ∂μ := by
by_cases hE : CompleteSpace E; swap
· simp [intervalIntegral, integral, hE]
have A := hf.integral_sub_linear_isLittleO_ae hfm hl (hu.Ioc hv)
have B := hf.integral_sub_linear_isLittleO_ae hfm hl (hv.Ioc hu)
simp_rw [integral_const', sub_smul]
refine ((A.trans_le fun t ↦ ?_).sub (B.trans_le fun t ↦ ?_)).congr_left fun t ↦ ?_
· cases le_total (u t) (v t) <;> simp [*]
· cases le_total (u t) (v t) <;> simp [*]
· simp_rw [intervalIntegral]
abel
variable [CompleteSpace E]
/-- **Fundamental theorem of calculus-1**, local version for any measure.
Let filters `l` and `l'` be related by `TendstoIxxClass Ioc`.
If `f` has a finite limit `c` at `l ⊓ ae μ`, where `μ` is a measure
finite at `l`, then `∫ x in u..v, f x ∂μ = μ (Ioc u v) • c + o(μ(Ioc u v))` as both
`u` and `v` tend to `l` so that `u ≤ v`.
See also `measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_le` for a version assuming
`[intervalIntegral.FTCFilter a l l']` and `[MeasureTheory.IsLocallyFiniteMeasure μ]`. If `l` is one
of `𝓝[≥] a`, `𝓝[≤] a`, `𝓝 a`, then it's easier to apply the non-primed version. The primed version
also works, e.g., for `l = l' = Filter.atTop`. -/
theorem measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_le' [IsMeasurablyGenerated l']
[TendstoIxxClass Ioc l l'] (hfm : StronglyMeasurableAtFilter f l' μ)
(hf : Tendsto f (l' ⊓ ae μ) (𝓝 c)) (hl : μ.FiniteAtFilter l') (hu : Tendsto u lt l)
(hv : Tendsto v lt l) (huv : u ≤ᶠ[lt] v) :
(fun t => (∫ x in u t..v t, f x ∂μ) - (μ (Ioc (u t) (v t))).toReal • c) =o[lt] fun t =>
(μ <| Ioc (u t) (v t)).toReal :=
(measure_integral_sub_linear_isLittleO_of_tendsto_ae' hfm hf hl hu hv).congr'
(huv.mono fun x hx => by simp [integral_const', hx])
(huv.mono fun x hx => by simp [integral_const', hx])
/-- **Fundamental theorem of calculus-1**, local version for any measure.
Let filters `l` and `l'` be related by `TendstoIxxClass Ioc`.
If `f` has a finite limit `c` at `l ⊓ ae μ`, where `μ` is a measure
finite at `l`, then `∫ x in u..v, f x ∂μ = -μ (Ioc v u) • c + o(μ(Ioc v u))` as both
`u` and `v` tend to `l` so that `v ≤ u`.
See also `measure_integral_sub_linear_is_o_of_tendsto_ae_of_ge` for a version assuming
`[intervalIntegral.FTCFilter a l l']` and `[MeasureTheory.IsLocallyFiniteMeasure μ]`. If `l` is one
of `𝓝[≥] a`, `𝓝[≤] a`, `𝓝 a`, then it's easier to apply the non-primed version. The primed version
also works, e.g., for `l = l' = Filter.atTop`. -/
theorem measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_ge' [IsMeasurablyGenerated l']
[TendstoIxxClass Ioc l l'] (hfm : StronglyMeasurableAtFilter f l' μ)
(hf : Tendsto f (l' ⊓ ae μ) (𝓝 c)) (hl : μ.FiniteAtFilter l') (hu : Tendsto u lt l)
(hv : Tendsto v lt l) (huv : v ≤ᶠ[lt] u) :
(fun t => (∫ x in u t..v t, f x ∂μ) + (μ (Ioc (v t) (u t))).toReal • c) =o[lt] fun t =>
(μ <| Ioc (v t) (u t)).toReal :=
(measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_le' hfm hf hl hv hu
huv).neg_left.congr_left
fun t => by simp [integral_symm (u t), add_comm]
section
variable [IsLocallyFiniteMeasure μ] [FTCFilter a l l']
/-- **Fundamental theorem of calculus-1**, local version for any measure.
Let filters `l` and `l'` be related by `[intervalIntegral.FTCFilter a l l']`; let `μ` be a locally
finite measure. If `f` has a finite limit `c` at `l' ⊓ ae μ`, then
`∫ x in u..v, f x ∂μ = ∫ x in u..v, c ∂μ + o(∫ x in u..v, 1 ∂μ)` as both `u` and `v` tend to `l`.
See also `measure_integral_sub_linear_isLittleO_of_tendsto_ae'` for a version that also works, e.g.,
for `l = l' = Filter.atTop`.
We use integrals of constants instead of measures because this way it is easier to formulate
a statement that works in both cases `u ≤ v` and `v ≤ u`. -/
theorem measure_integral_sub_linear_isLittleO_of_tendsto_ae
(hfm : StronglyMeasurableAtFilter f l' μ) (hf : Tendsto f (l' ⊓ ae μ) (𝓝 c))
(hu : Tendsto u lt l) (hv : Tendsto v lt l) :
(fun t => (∫ x in u t..v t, f x ∂μ) - ∫ _ in u t..v t, c ∂μ) =o[lt] fun t =>
∫ _ in u t..v t, (1 : ℝ) ∂μ :=
haveI := FTCFilter.meas_gen l
measure_integral_sub_linear_isLittleO_of_tendsto_ae' hfm hf (FTCFilter.finiteAt_inner l) hu hv
/-- **Fundamental theorem of calculus-1**, local version for any measure.
Let filters `l` and `l'` be related by `[intervalIntegral.FTCFilter a l l']`; let `μ` be a locally
finite measure. If `f` has a finite limit `c` at `l' ⊓ ae μ`, then
`∫ x in u..v, f x ∂μ = μ (Ioc u v) • c + o(μ(Ioc u v))` as both `u` and `v` tend to `l`.
See also `measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_le'` for a version that also works,
e.g., for `l = l' = Filter.atTop`. -/
theorem measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_le
(hfm : StronglyMeasurableAtFilter f l' μ) (hf : Tendsto f (l' ⊓ ae μ) (𝓝 c))
(hu : Tendsto u lt l) (hv : Tendsto v lt l) (huv : u ≤ᶠ[lt] v) :
(fun t => (∫ x in u t..v t, f x ∂μ) - (μ (Ioc (u t) (v t))).toReal • c) =o[lt] fun t =>
(μ <| Ioc (u t) (v t)).toReal :=
haveI := FTCFilter.meas_gen l
measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_le' hfm hf (FTCFilter.finiteAt_inner l) hu
hv huv
/-- **Fundamental theorem of calculus-1**, local version for any measure.
Let filters `l` and `l'` be related by `[intervalIntegral.FTCFilter a l l']`; let `μ` be a locally
finite measure. If `f` has a finite limit `c` at `l' ⊓ ae μ`, then
`∫ x in u..v, f x ∂μ = -μ (Set.Ioc v u) • c + o(μ(Set.Ioc v u))` as both `u` and `v` tend to `l`.
See also `measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_ge'` for a version that also works,
e.g., for `l = l' = Filter.atTop`. -/
theorem measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_ge
(hfm : StronglyMeasurableAtFilter f l' μ) (hf : Tendsto f (l' ⊓ ae μ) (𝓝 c))
(hu : Tendsto u lt l) (hv : Tendsto v lt l) (huv : v ≤ᶠ[lt] u) :
(fun t => (∫ x in u t..v t, f x ∂μ) + (μ (Ioc (v t) (u t))).toReal • c) =o[lt] fun t =>
(μ <| Ioc (v t) (u t)).toReal :=
haveI := FTCFilter.meas_gen l
measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_ge' hfm hf (FTCFilter.finiteAt_inner l) hu
hv huv
end
variable [FTCFilter a la la'] [FTCFilter b lb lb'] [IsLocallyFiniteMeasure μ]
/-- **Fundamental theorem of calculus-1**, strict derivative in both limits for a locally finite
measure.
Let `f` be a measurable function integrable on `a..b`. Let `(la, la')` be a pair of
`intervalIntegral.FTCFilter`s around `a`; let `(lb, lb')` be a pair of `intervalIntegral.FTCFilter`s
around `b`. Suppose that `f` has finite limits `ca` and `cb` at `la' ⊓ ae μ` and `lb' ⊓ ae μ`,
respectively.
Then `∫ x in va..vb, f x ∂μ - ∫ x in ua..ub, f x ∂μ =
∫ x in ub..vb, cb ∂μ - ∫ x in ua..va, ca ∂μ +
o(‖∫ x in ua..va, (1:ℝ) ∂μ‖ + ‖∫ x in ub..vb, (1:ℝ) ∂μ‖)`
as `ua` and `va` tend to `la` while `ub` and `vb` tend to `lb`.
-/
theorem measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae
(hab : IntervalIntegrable f μ a b) (hmeas_a : StronglyMeasurableAtFilter f la' μ)
(hmeas_b : StronglyMeasurableAtFilter f lb' μ) (ha_lim : Tendsto f (la' ⊓ ae μ) (𝓝 ca))
(hb_lim : Tendsto f (lb' ⊓ ae μ) (𝓝 cb)) (hua : Tendsto ua lt la) (hva : Tendsto va lt la)
(hub : Tendsto ub lt lb) (hvb : Tendsto vb lt lb) :
(fun t =>
((∫ x in va t..vb t, f x ∂μ) - ∫ x in ua t..ub t, f x ∂μ) -
((∫ _ in ub t..vb t, cb ∂μ) - ∫ _ in ua t..va t, ca ∂μ)) =o[lt]
fun t => ‖∫ _ in ua t..va t, (1 : ℝ) ∂μ‖ + ‖∫ _ in ub t..vb t, (1 : ℝ) ∂μ‖ := by
haveI := FTCFilter.meas_gen la; haveI := FTCFilter.meas_gen lb
refine
((measure_integral_sub_linear_isLittleO_of_tendsto_ae hmeas_a ha_lim hua hva).neg_left.add_add
(measure_integral_sub_linear_isLittleO_of_tendsto_ae hmeas_b hb_lim hub hvb)).congr'
?_ EventuallyEq.rfl
have A : ∀ᶠ t in lt, IntervalIntegrable f μ (ua t) (va t) :=
ha_lim.eventually_intervalIntegrable_ae hmeas_a (FTCFilter.finiteAt_inner la) hua hva
have A' : ∀ᶠ t in lt, IntervalIntegrable f μ a (ua t) :=
ha_lim.eventually_intervalIntegrable_ae hmeas_a (FTCFilter.finiteAt_inner la)
(tendsto_const_pure.mono_right FTCFilter.pure_le) hua
have B : ∀ᶠ t in lt, IntervalIntegrable f μ (ub t) (vb t) :=
hb_lim.eventually_intervalIntegrable_ae hmeas_b (FTCFilter.finiteAt_inner lb) hub hvb
have B' : ∀ᶠ t in lt, IntervalIntegrable f μ b (ub t) :=
hb_lim.eventually_intervalIntegrable_ae hmeas_b (FTCFilter.finiteAt_inner lb)
(tendsto_const_pure.mono_right FTCFilter.pure_le) hub
filter_upwards [A, A', B, B'] with _ ua_va a_ua ub_vb b_ub
rw [← integral_interval_sub_interval_comm']
· abel
exacts [ub_vb, ua_va, b_ub.symm.trans <| hab.symm.trans a_ua]
/-- **Fundamental theorem of calculus-1**, strict derivative in right endpoint for a locally finite
measure.
Let `f` be a measurable function integrable on `a..b`. Let `(lb, lb')` be a pair of
`intervalIntegral.FTCFilter`s around `b`. Suppose that `f` has a finite limit `c` at `lb' ⊓ ae μ`.
Then `∫ x in a..v, f x ∂μ - ∫ x in a..u, f x ∂μ = ∫ x in u..v, c ∂μ + o(∫ x in u..v, (1:ℝ) ∂μ)` as
`u` and `v` tend to `lb`.
-/
theorem measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae_right
(hab : IntervalIntegrable f μ a b) (hmeas : StronglyMeasurableAtFilter f lb' μ)
(hf : Tendsto f (lb' ⊓ ae μ) (𝓝 c)) (hu : Tendsto u lt lb) (hv : Tendsto v lt lb) :
(fun t => ((∫ x in a..v t, f x ∂μ) - ∫ x in a..u t, f x ∂μ) - ∫ _ in u t..v t, c ∂μ) =o[lt]
fun t => ∫ _ in u t..v t, (1 : ℝ) ∂μ := by
simpa using
measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae hab stronglyMeasurableAt_bot
hmeas ((tendsto_bot : Tendsto _ ⊥ (𝓝 (0 : E))).mono_left inf_le_left) hf
(tendsto_const_pure : Tendsto _ _ (pure a)) tendsto_const_pure hu hv
/-- **Fundamental theorem of calculus-1**, strict derivative in left endpoint for a locally finite
measure.
Let `f` be a measurable function integrable on `a..b`. Let `(la, la')` be a pair of
`intervalIntegral.FTCFilter`s around `a`. Suppose that `f` has a finite limit `c` at `la' ⊓ ae μ`.
Then `∫ x in v..b, f x ∂μ - ∫ x in u..b, f x ∂μ = -∫ x in u..v, c ∂μ + o(∫ x in u..v, (1:ℝ) ∂μ)`
as `u` and `v` tend to `la`.
-/
theorem measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae_left
(hab : IntervalIntegrable f μ a b) (hmeas : StronglyMeasurableAtFilter f la' μ)
(hf : Tendsto f (la' ⊓ ae μ) (𝓝 c)) (hu : Tendsto u lt la) (hv : Tendsto v lt la) :
(fun t => ((∫ x in v t..b, f x ∂μ) - ∫ x in u t..b, f x ∂μ) + ∫ _ in u t..v t, c ∂μ) =o[lt]
fun t => ∫ _ in u t..v t, (1 : ℝ) ∂μ := by
simpa using
measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae hab hmeas
stronglyMeasurableAt_bot hf ((tendsto_bot : Tendsto _ ⊥ (𝓝 (0 : E))).mono_left inf_le_left) hu
hv (tendsto_const_pure : Tendsto _ _ (pure b)) tendsto_const_pure
end
/-!
### Fundamental theorem of calculus-1 for Lebesgue measure
In this section we restate theorems from the previous section for Lebesgue measure.
In particular, we prove that `∫ x in u..v, f x` is strictly differentiable in `(u, v)`
at `(a, b)` provided that `f` is integrable on `a..b` and is continuous at `a` and `b`.
-/
variable [CompleteSpace E]
{f : ℝ → E} {c ca cb : E} {l l' la la' lb lb' : Filter ℝ} {lt : Filter ι} {a b z : ℝ}
{u v ua ub va vb : ι → ℝ} [FTCFilter a la la'] [FTCFilter b lb lb']
/-!
#### Auxiliary `Asymptotics.IsLittleO` statements
In this section we prove several lemmas that can be interpreted as strict differentiability of
`(u, v) ↦ ∫ x in u..v, f x ∂μ` in `u` and/or `v` at a filter. The statements use
`Asymptotics.isLittleO` because we have no definition of `HasStrict(F)DerivAtFilter` in the library.
-/
/-- **Fundamental theorem of calculus-1**, local version.
If `f` has a finite limit `c` almost surely at `l'`, where `(l, l')` is an
`intervalIntegral.FTCFilter` pair around `a`, then `∫ x in u..v, f x ∂μ = (v - u) • c + o (v - u)`
as both `u` and `v` tend to `l`. -/
theorem integral_sub_linear_isLittleO_of_tendsto_ae [FTCFilter a l l']
(hfm : StronglyMeasurableAtFilter f l') (hf : Tendsto f (l' ⊓ ae volume) (𝓝 c)) {u v : ι → ℝ}
(hu : Tendsto u lt l) (hv : Tendsto v lt l) :
(fun t => (∫ x in u t..v t, f x) - (v t - u t) • c) =o[lt] (v - u) := by
simpa [integral_const] using measure_integral_sub_linear_isLittleO_of_tendsto_ae hfm hf hu hv
/-- **Fundamental theorem of calculus-1**, strict differentiability at filter in both endpoints.
If `f` is a measurable function integrable on `a..b`, `(la, la')` is an `intervalIntegral.FTCFilter`
pair around `a`, and `(lb, lb')` is an `intervalIntegral.FTCFilter` pair around `b`, and `f` has
finite limits `ca` and `cb` almost surely at `la'` and `lb'`, respectively, then
`(∫ x in va..vb, f x) - ∫ x in ua..ub, f x = (vb - ub) • cb - (va - ua) • ca +
o(‖va - ua‖ + ‖vb - ub‖)` as `ua` and `va` tend to `la` while `ub` and `vb` tend to `lb`.
This lemma could've been formulated using `HasStrictFDerivAtFilter` if we had this
definition. -/
theorem integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae
(hab : IntervalIntegrable f volume a b) (hmeas_a : StronglyMeasurableAtFilter f la')
(hmeas_b : StronglyMeasurableAtFilter f lb') (ha_lim : Tendsto f (la' ⊓ ae volume) (𝓝 ca))
(hb_lim : Tendsto f (lb' ⊓ ae volume) (𝓝 cb)) (hua : Tendsto ua lt la) (hva : Tendsto va lt la)
(hub : Tendsto ub lt lb) (hvb : Tendsto vb lt lb) :
(fun t =>
((∫ x in va t..vb t, f x) - ∫ x in ua t..ub t, f x) -
((vb t - ub t) • cb - (va t - ua t) • ca)) =o[lt]
fun t => ‖va t - ua t‖ + ‖vb t - ub t‖ := by
simpa [integral_const]
using measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae hab hmeas_a hmeas_b
ha_lim hb_lim hua hva hub hvb
/-- **Fundamental theorem of calculus-1**, strict differentiability at filter in both endpoints.
If `f` is a measurable function integrable on `a..b`, `(lb, lb')` is an `intervalIntegral.FTCFilter`
pair around `b`, and `f` has a finite limit `c` almost surely at `lb'`, then
`(∫ x in a..v, f x) - ∫ x in a..u, f x = (v - u) • c + o(‖v - u‖)` as `u` and `v` tend to `lb`.
This lemma could've been formulated using `HasStrictDerivAtFilter` if we had this definition. -/
theorem integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae_right
(hab : IntervalIntegrable f volume a b) (hmeas : StronglyMeasurableAtFilter f lb')
(hf : Tendsto f (lb' ⊓ ae volume) (𝓝 c)) (hu : Tendsto u lt lb) (hv : Tendsto v lt lb) :
(fun t => ((∫ x in a..v t, f x) - ∫ x in a..u t, f x) - (v t - u t) • c) =o[lt] (v - u) := by
simpa only [integral_const, smul_eq_mul, mul_one] using
measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae_right hab hmeas hf hu hv
/-- **Fundamental theorem of calculus-1**, strict differentiability at filter in both endpoints.
If `f` is a measurable function integrable on `a..b`, `(la, la')` is an `intervalIntegral.FTCFilter`
pair around `a`, and `f` has a finite limit `c` almost surely at `la'`, then
`(∫ x in v..b, f x) - ∫ x in u..b, f x = -(v - u) • c + o(‖v - u‖)` as `u` and `v` tend to `la`.
This lemma could've been formulated using `HasStrictDerivAtFilter` if we had this definition. -/
theorem integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae_left
(hab : IntervalIntegrable f volume a b) (hmeas : StronglyMeasurableAtFilter f la')
(hf : Tendsto f (la' ⊓ ae volume) (𝓝 c)) (hu : Tendsto u lt la) (hv : Tendsto v lt la) :
(fun t => ((∫ x in v t..b, f x) - ∫ x in u t..b, f x) + (v t - u t) • c) =o[lt] (v - u) := by
simpa only [integral_const, smul_eq_mul, mul_one] using
measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae_left hab hmeas hf hu hv
open ContinuousLinearMap (fst snd smulRight sub_apply smulRight_apply coe_fst' coe_snd' map_sub)
/-!
#### Strict differentiability
In this section we prove that for a measurable function `f` integrable on `a..b`,
* `integral_hasStrictFDerivAt_of_tendsto_ae`: the function `(u, v) ↦ ∫ x in u..v, f x` has
derivative `(u, v) ↦ v • cb - u • ca` at `(a, b)` in the sense of strict differentiability
provided that `f` tends to `ca` and `cb` almost surely as `x` tendsto to `a` and `b`,
respectively;
* `integral_hasStrictFDerivAt`: the function `(u, v) ↦ ∫ x in u..v, f x` has
derivative `(u, v) ↦ v • f b - u • f a` at `(a, b)` in the sense of strict differentiability
provided that `f` is continuous at `a` and `b`;
* `integral_hasStrictDerivAt_of_tendsto_ae_right`: the function `u ↦ ∫ x in a..u, f x` has
derivative `c` at `b` in the sense of strict differentiability provided that `f` tends to `c`
almost surely as `x` tends to `b`;
* `integral_hasStrictDerivAt_right`: the function `u ↦ ∫ x in a..u, f x` has derivative `f b` at
`b` in the sense of strict differentiability provided that `f` is continuous at `b`;
* `integral_hasStrictDerivAt_of_tendsto_ae_left`: the function `u ↦ ∫ x in u..b, f x` has
derivative `-c` at `a` in the sense of strict differentiability provided that `f` tends to `c`
almost surely as `x` tends to `a`;
* `integral_hasStrictDerivAt_left`: the function `u ↦ ∫ x in u..b, f x` has derivative `-f a` at
`a` in the sense of strict differentiability provided that `f` is continuous at `a`.
-/
/-- **Fundamental theorem of calculus-1**, strict differentiability in both endpoints.
If `f : ℝ → E` is integrable on `a..b` and `f x` has finite limits `ca` and `cb` almost surely as
`x` tends to `a` and `b`, respectively, then
`(u, v) ↦ ∫ x in u..v, f x` has derivative `(u, v) ↦ v • cb - u • ca` at `(a, b)`
in the sense of strict differentiability. -/
theorem integral_hasStrictFDerivAt_of_tendsto_ae (hf : IntervalIntegrable f volume a b)
(hmeas_a : StronglyMeasurableAtFilter f (𝓝 a)) (hmeas_b : StronglyMeasurableAtFilter f (𝓝 b))
(ha : Tendsto f (𝓝 a ⊓ ae volume) (𝓝 ca)) (hb : Tendsto f (𝓝 b ⊓ ae volume) (𝓝 cb)) :
HasStrictFDerivAt (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x)
((snd ℝ ℝ ℝ).smulRight cb - (fst ℝ ℝ ℝ).smulRight ca) (a, b) := by
have :=
integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae hf hmeas_a hmeas_b ha hb
(continuous_snd.fst.tendsto ((a, b), (a, b)))
(continuous_fst.fst.tendsto ((a, b), (a, b)))
(continuous_snd.snd.tendsto ((a, b), (a, b)))
(continuous_fst.snd.tendsto ((a, b), (a, b)))
refine (this.congr_left ?_).trans_isBigO ?_
· intro x; simp [sub_smul]; abel
· exact isBigO_fst_prod.norm_left.add isBigO_snd_prod.norm_left
/-- **Fundamental theorem of calculus-1**, strict differentiability in both endpoints.
If `f : ℝ → E` is integrable on `a..b` and `f` is continuous at `a` and `b`, then
`(u, v) ↦ ∫ x in u..v, f x` has derivative `(u, v) ↦ v • cb - u • ca` at `(a, b)` in the sense of
strict differentiability. -/
theorem integral_hasStrictFDerivAt (hf : IntervalIntegrable f volume a b)
(hmeas_a : StronglyMeasurableAtFilter f (𝓝 a)) (hmeas_b : StronglyMeasurableAtFilter f (𝓝 b))
(ha : ContinuousAt f a) (hb : ContinuousAt f b) :
HasStrictFDerivAt (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x)
((snd ℝ ℝ ℝ).smulRight (f b) - (fst ℝ ℝ ℝ).smulRight (f a)) (a, b) :=
integral_hasStrictFDerivAt_of_tendsto_ae hf hmeas_a hmeas_b (ha.mono_left inf_le_left)
(hb.mono_left inf_le_left)
/-- **Fundamental theorem of calculus-1**, strict differentiability in the right endpoint.
If `f : ℝ → E` is integrable on `a..b` and `f x` has a finite limit `c` almost surely at `b`, then
`u ↦ ∫ x in a..u, f x` has derivative `c` at `b` in the sense of strict differentiability. -/
theorem integral_hasStrictDerivAt_of_tendsto_ae_right (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 b)) (hb : Tendsto f (𝓝 b ⊓ ae volume) (𝓝 c)) :
HasStrictDerivAt (fun u => ∫ x in a..u, f x) c b :=
integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae_right hf hmeas hb continuousAt_snd
continuousAt_fst
/-- **Fundamental theorem of calculus-1**, strict differentiability in the right endpoint.
If `f : ℝ → E` is integrable on `a..b` and `f` is continuous at `b`, then `u ↦ ∫ x in a..u, f x` has
derivative `f b` at `b` in the sense of strict differentiability. -/
theorem integral_hasStrictDerivAt_right (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 b)) (hb : ContinuousAt f b) :
HasStrictDerivAt (fun u => ∫ x in a..u, f x) (f b) b :=
integral_hasStrictDerivAt_of_tendsto_ae_right hf hmeas (hb.mono_left inf_le_left)
/-- **Fundamental theorem of calculus-1**, strict differentiability in the left endpoint.
If `f : ℝ → E` is integrable on `a..b` and `f x` has a finite limit `c` almost surely at `a`, then
`u ↦ ∫ x in u..b, f x` has derivative `-c` at `a` in the sense of strict differentiability. -/
theorem integral_hasStrictDerivAt_of_tendsto_ae_left (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 a)) (ha : Tendsto f (𝓝 a ⊓ ae volume) (𝓝 c)) :
HasStrictDerivAt (fun u => ∫ x in u..b, f x) (-c) a := by
simpa only [← integral_symm] using
(integral_hasStrictDerivAt_of_tendsto_ae_right hf.symm hmeas ha).neg
/-- **Fundamental theorem of calculus-1**, strict differentiability in the left endpoint.
If `f : ℝ → E` is integrable on `a..b` and `f` is continuous at `a`, then `u ↦ ∫ x in u..b, f x` has
derivative `-f a` at `a` in the sense of strict differentiability. -/
theorem integral_hasStrictDerivAt_left (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 a)) (ha : ContinuousAt f a) :
HasStrictDerivAt (fun u => ∫ x in u..b, f x) (-f a) a := by
simpa only [← integral_symm] using (integral_hasStrictDerivAt_right hf.symm hmeas ha).neg
/-- **Fundamental theorem of calculus-1**, strict differentiability in the right endpoint.
If `f : ℝ → E` is continuous, then `u ↦ ∫ x in a..u, f x` has derivative `f b` at `b` in the sense
of strict differentiability. -/
theorem _root_.Continuous.integral_hasStrictDerivAt {f : ℝ → E} (hf : Continuous f) (a b : ℝ) :
HasStrictDerivAt (fun u => ∫ x : ℝ in a..u, f x) (f b) b :=
integral_hasStrictDerivAt_right (hf.intervalIntegrable _ _) (hf.stronglyMeasurableAtFilter _ _)
hf.continuousAt
/-- **Fundamental theorem of calculus-1**, derivative in the right endpoint.
If `f : ℝ → E` is continuous, then the derivative of `u ↦ ∫ x in a..u, f x` at `b` is `f b`. -/
theorem _root_.Continuous.deriv_integral (f : ℝ → E) (hf : Continuous f) (a b : ℝ) :
deriv (fun u => ∫ x : ℝ in a..u, f x) b = f b :=
(hf.integral_hasStrictDerivAt a b).hasDerivAt.deriv
/-!
#### Fréchet differentiability
In this subsection we restate results from the previous subsection in terms of `HasFDerivAt`,
`HasDerivAt`, `fderiv`, and `deriv`.
-/
/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f x` has
finite limits `ca` and `cb` almost surely as `x` tends to `a` and `b`, respectively, then
`(u, v) ↦ ∫ x in u..v, f x` has derivative `(u, v) ↦ v • cb - u • ca` at `(a, b)`. -/
theorem integral_hasFDerivAt_of_tendsto_ae (hf : IntervalIntegrable f volume a b)
(hmeas_a : StronglyMeasurableAtFilter f (𝓝 a)) (hmeas_b : StronglyMeasurableAtFilter f (𝓝 b))
(ha : Tendsto f (𝓝 a ⊓ ae volume) (𝓝 ca)) (hb : Tendsto f (𝓝 b ⊓ ae volume) (𝓝 cb)) :
HasFDerivAt (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x)
((snd ℝ ℝ ℝ).smulRight cb - (fst ℝ ℝ ℝ).smulRight ca) (a, b) :=
(integral_hasStrictFDerivAt_of_tendsto_ae hf hmeas_a hmeas_b ha hb).hasFDerivAt
/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f` is
continuous at `a` and `b`, then `(u, v) ↦ ∫ x in u..v, f x` has derivative `(u, v) ↦ v • cb - u •
ca` at `(a, b)`. -/
theorem integral_hasFDerivAt (hf : IntervalIntegrable f volume a b)
(hmeas_a : StronglyMeasurableAtFilter f (𝓝 a)) (hmeas_b : StronglyMeasurableAtFilter f (𝓝 b))
(ha : ContinuousAt f a) (hb : ContinuousAt f b) :
HasFDerivAt (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x)
((snd ℝ ℝ ℝ).smulRight (f b) - (fst ℝ ℝ ℝ).smulRight (f a)) (a, b) :=
(integral_hasStrictFDerivAt hf hmeas_a hmeas_b ha hb).hasFDerivAt
/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f x` has
finite limits `ca` and `cb` almost surely as `x` tends to `a` and `b`, respectively, then `fderiv`
derivative of `(u, v) ↦ ∫ x in u..v, f x` at `(a, b)` equals `(u, v) ↦ v • cb - u • ca`. -/
theorem fderiv_integral_of_tendsto_ae (hf : IntervalIntegrable f volume a b)
(hmeas_a : StronglyMeasurableAtFilter f (𝓝 a)) (hmeas_b : StronglyMeasurableAtFilter f (𝓝 b))
(ha : Tendsto f (𝓝 a ⊓ ae volume) (𝓝 ca)) (hb : Tendsto f (𝓝 b ⊓ ae volume) (𝓝 cb)) :
fderiv ℝ (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x) (a, b) =
(snd ℝ ℝ ℝ).smulRight cb - (fst ℝ ℝ ℝ).smulRight ca :=
(integral_hasFDerivAt_of_tendsto_ae hf hmeas_a hmeas_b ha hb).fderiv
/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f` is
continuous at `a` and `b`, then `fderiv` derivative of `(u, v) ↦ ∫ x in u..v, f x` at `(a, b)`
equals `(u, v) ↦ v • cb - u • ca`. -/
theorem fderiv_integral (hf : IntervalIntegrable f volume a b)
(hmeas_a : StronglyMeasurableAtFilter f (𝓝 a)) (hmeas_b : StronglyMeasurableAtFilter f (𝓝 b))
(ha : ContinuousAt f a) (hb : ContinuousAt f b) :
fderiv ℝ (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x) (a, b) =
(snd ℝ ℝ ℝ).smulRight (f b) - (fst ℝ ℝ ℝ).smulRight (f a) :=
(integral_hasFDerivAt hf hmeas_a hmeas_b ha hb).fderiv
/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f x` has a
finite limit `c` almost surely at `b`, then `u ↦ ∫ x in a..u, f x` has derivative `c` at `b`. -/
theorem integral_hasDerivAt_of_tendsto_ae_right (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 b)) (hb : Tendsto f (𝓝 b ⊓ ae volume) (𝓝 c)) :
HasDerivAt (fun u => ∫ x in a..u, f x) c b :=
(integral_hasStrictDerivAt_of_tendsto_ae_right hf hmeas hb).hasDerivAt
/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f` is
continuous at `b`, then `u ↦ ∫ x in a..u, f x` has derivative `f b` at `b`. -/
theorem integral_hasDerivAt_right (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 b)) (hb : ContinuousAt f b) :
HasDerivAt (fun u => ∫ x in a..u, f x) (f b) b :=
(integral_hasStrictDerivAt_right hf hmeas hb).hasDerivAt
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f` has a finite
limit `c` almost surely at `b`, then the derivative of `u ↦ ∫ x in a..u, f x` at `b` equals `c`. -/
theorem deriv_integral_of_tendsto_ae_right (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 b)) (hb : Tendsto f (𝓝 b ⊓ ae volume) (𝓝 c)) :
deriv (fun u => ∫ x in a..u, f x) b = c :=
(integral_hasDerivAt_of_tendsto_ae_right hf hmeas hb).deriv
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f` is continuous
at `b`, then the derivative of `u ↦ ∫ x in a..u, f x` at `b` equals `f b`. -/
theorem deriv_integral_right (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 b)) (hb : ContinuousAt f b) :
deriv (fun u => ∫ x in a..u, f x) b = f b :=
(integral_hasDerivAt_right hf hmeas hb).deriv
/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f x` has a
finite limit `c` almost surely at `a`, then `u ↦ ∫ x in u..b, f x` has derivative `-c` at `a`. -/
theorem integral_hasDerivAt_of_tendsto_ae_left (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 a)) (ha : Tendsto f (𝓝 a ⊓ ae volume) (𝓝 c)) :
HasDerivAt (fun u => ∫ x in u..b, f x) (-c) a :=
(integral_hasStrictDerivAt_of_tendsto_ae_left hf hmeas ha).hasDerivAt
/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f` is
continuous at `a`, then `u ↦ ∫ x in u..b, f x` has derivative `-f a` at `a`. -/
theorem integral_hasDerivAt_left (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 a)) (ha : ContinuousAt f a) :
HasDerivAt (fun u => ∫ x in u..b, f x) (-f a) a :=
(integral_hasStrictDerivAt_left hf hmeas ha).hasDerivAt
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f` has a finite
limit `c` almost surely at `a`, then the derivative of `u ↦ ∫ x in u..b, f x` at `a` equals `-c`. -/
theorem deriv_integral_of_tendsto_ae_left (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 a)) (hb : Tendsto f (𝓝 a ⊓ ae volume) (𝓝 c)) :
deriv (fun u => ∫ x in u..b, f x) a = -c :=
(integral_hasDerivAt_of_tendsto_ae_left hf hmeas hb).deriv
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f` is continuous
at `a`, then the derivative of `u ↦ ∫ x in u..b, f x` at `a` equals `-f a`. -/
theorem deriv_integral_left (hf : IntervalIntegrable f volume a b)
(hmeas : StronglyMeasurableAtFilter f (𝓝 a)) (hb : ContinuousAt f a) :
deriv (fun u => ∫ x in u..b, f x) a = -f a :=
(integral_hasDerivAt_left hf hmeas hb).deriv
/-!
#### One-sided derivatives
-/
/-- Let `f` be a measurable function integrable on `a..b`. The function `(u, v) ↦ ∫ x in u..v, f x`
has derivative `(u, v) ↦ v • cb - u • ca` within `s × t` at `(a, b)`, where
`s ∈ {Iic a, {a}, Ici a, univ}` and `t ∈ {Iic b, {b}, Ici b, univ}` provided that `f` tends to `ca`
and `cb` almost surely at the filters `la` and `lb` from the following table.
| `s` | `la` | `t` | `lb` |
| ------- | ---- | --- | ---- |
| `Iic a` | `𝓝[≤] a` | `Iic b` | `𝓝[≤] b` |
| `Ici a` | `𝓝[>] a` | `Ici b` | `𝓝[>] b` |
| `{a}` | `⊥` | `{b}` | `⊥` |
| `univ` | `𝓝 a` | `univ` | `𝓝 b` |
-/
theorem integral_hasFDerivWithinAt_of_tendsto_ae (hf : IntervalIntegrable f volume a b)
{s t : Set ℝ} [FTCFilter a (𝓝[s] a) la] [FTCFilter b (𝓝[t] b) lb]
(hmeas_a : StronglyMeasurableAtFilter f la) (hmeas_b : StronglyMeasurableAtFilter f lb)
(ha : Tendsto f (la ⊓ ae volume) (𝓝 ca)) (hb : Tendsto f (lb ⊓ ae volume) (𝓝 cb)) :
HasFDerivWithinAt (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x)
((snd ℝ ℝ ℝ).smulRight cb - (fst ℝ ℝ ℝ).smulRight ca) (s ×ˢ t) (a, b) := by
rw [HasFDerivWithinAt, nhdsWithin_prod_eq]
have :=
integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae hf hmeas_a hmeas_b ha hb
(tendsto_const_pure.mono_right FTCFilter.pure_le : Tendsto _ _ (𝓝[s] a)) tendsto_fst
(tendsto_const_pure.mono_right FTCFilter.pure_le : Tendsto _ _ (𝓝[t] b)) tendsto_snd
refine .of_isLittleO <| (this.congr_left ?_).trans_isBigO ?_
· intro x; simp [sub_smul]; abel
· exact isBigO_fst_prod.norm_left.add isBigO_snd_prod.norm_left
/-- Let `f` be a measurable function integrable on `a..b`. The function `(u, v) ↦ ∫ x in u..v, f x`
has derivative `(u, v) ↦ v • f b - u • f a` within `s × t` at `(a, b)`, where
`s ∈ {Iic a, {a}, Ici a, univ}` and `t ∈ {Iic b, {b}, Ici b, univ}` provided that `f` tends to
`f a` and `f b` at the filters `la` and `lb` from the following table. In most cases this assumption
is definitionally equal `ContinuousAt f _` or `ContinuousWithinAt f _ _`.
| `s` | `la` | `t` | `lb` |
| ------- | ---- | --- | ---- |
| `Iic a` | `𝓝[≤] a` | `Iic b` | `𝓝[≤] b` |
| `Ici a` | `𝓝[>] a` | `Ici b` | `𝓝[>] b` |
| `{a}` | `⊥` | `{b}` | `⊥` |
| `univ` | `𝓝 a` | `univ` | `𝓝 b` |
-/
theorem integral_hasFDerivWithinAt (hf : IntervalIntegrable f volume a b)
(hmeas_a : StronglyMeasurableAtFilter f la) (hmeas_b : StronglyMeasurableAtFilter f lb)
{s t : Set ℝ} [FTCFilter a (𝓝[s] a) la] [FTCFilter b (𝓝[t] b) lb] (ha : Tendsto f la (𝓝 <| f a))
(hb : Tendsto f lb (𝓝 <| f b)) :
HasFDerivWithinAt (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x)
((snd ℝ ℝ ℝ).smulRight (f b) - (fst ℝ ℝ ℝ).smulRight (f a)) (s ×ˢ t) (a, b) :=
integral_hasFDerivWithinAt_of_tendsto_ae hf hmeas_a hmeas_b (ha.mono_left inf_le_left)
(hb.mono_left inf_le_left)
/-- An auxiliary tactic closing goals `UniqueDiffWithinAt ℝ s a` where
`s ∈ {Iic a, Ici a, univ}`. -/
macro "uniqueDiffWithinAt_Ici_Iic_univ" : tactic =>
`(tactic| (first | exact uniqueDiffOn_Ici _ _ left_mem_Ici |
exact uniqueDiffOn_Iic _ _ right_mem_Iic | exact uniqueDiffWithinAt_univ (𝕜 := ℝ) (E := ℝ)))
/-- Let `f` be a measurable function integrable on `a..b`. Choose `s ∈ {Iic a, Ici a, univ}`
and `t ∈ {Iic b, Ici b, univ}`. Suppose that `f` tends to `ca` and `cb` almost surely at the filters
`la` and `lb` from the table below. Then `fderivWithin ℝ (fun p ↦ ∫ x in p.1..p.2, f x) (s ×ˢ t)`
is equal to `(u, v) ↦ u • cb - v • ca`.
| `s` | `la` | `t` | `lb` |
| ------- | ---- | --- | ---- |
| `Iic a` | `𝓝[≤] a` | `Iic b` | `𝓝[≤] b` |
| `Ici a` | `𝓝[>] a` | `Ici b` | `𝓝[>] b` |
| `{a}` | `⊥` | `{b}` | `⊥` |
| `univ` | `𝓝 a` | `univ` | `𝓝 b` |
-/
theorem fderivWithin_integral_of_tendsto_ae (hf : IntervalIntegrable f volume a b)
(hmeas_a : StronglyMeasurableAtFilter f la) (hmeas_b : StronglyMeasurableAtFilter f lb)
{s t : Set ℝ} [FTCFilter a (𝓝[s] a) la] [FTCFilter b (𝓝[t] b) lb]
(ha : Tendsto f (la ⊓ ae volume) (𝓝 ca)) (hb : Tendsto f (lb ⊓ ae volume) (𝓝 cb))
(hs : UniqueDiffWithinAt ℝ s a := by uniqueDiffWithinAt_Ici_Iic_univ)
(ht : UniqueDiffWithinAt ℝ t b := by uniqueDiffWithinAt_Ici_Iic_univ) :
fderivWithin ℝ (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x) (s ×ˢ t) (a, b) =
(snd ℝ ℝ ℝ).smulRight cb - (fst ℝ ℝ ℝ).smulRight ca :=
(integral_hasFDerivWithinAt_of_tendsto_ae hf hmeas_a hmeas_b ha hb).fderivWithin <| hs.prod ht
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` has a finite
limit `c` almost surely as `x` tends to `b` from the right or from the left,
then `u ↦ ∫ x in a..u, f x` has right (resp., left) derivative `c` at `b`. -/
theorem integral_hasDerivWithinAt_of_tendsto_ae_right (hf : IntervalIntegrable f volume a b)
{s t : Set ℝ} [FTCFilter b (𝓝[s] b) (𝓝[t] b)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] b))
(hb : Tendsto f (𝓝[t] b ⊓ ae volume) (𝓝 c)) :
HasDerivWithinAt (fun u => ∫ x in a..u, f x) c s b :=
.of_isLittleO <| integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae_right hf hmeas hb
(tendsto_const_pure.mono_right FTCFilter.pure_le) tendsto_id
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` is continuous
from the left or from the right at `b`, then `u ↦ ∫ x in a..u, f x` has left (resp., right)
derivative `f b` at `b`. -/
theorem integral_hasDerivWithinAt_right (hf : IntervalIntegrable f volume a b) {s t : Set ℝ}
[FTCFilter b (𝓝[s] b) (𝓝[t] b)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] b))
(hb : ContinuousWithinAt f t b) : HasDerivWithinAt (fun u => ∫ x in a..u, f x) (f b) s b :=
integral_hasDerivWithinAt_of_tendsto_ae_right hf hmeas (hb.mono_left inf_le_left)
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` has a finite
limit `c` almost surely as `x` tends to `b` from the right or from the left, then the right
(resp., left) derivative of `u ↦ ∫ x in a..u, f x` at `b` equals `c`. -/
theorem derivWithin_integral_of_tendsto_ae_right (hf : IntervalIntegrable f volume a b)
{s t : Set ℝ} [FTCFilter b (𝓝[s] b) (𝓝[t] b)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] b))
(hb : Tendsto f (𝓝[t] b ⊓ ae volume) (𝓝 c))
(hs : UniqueDiffWithinAt ℝ s b := by uniqueDiffWithinAt_Ici_Iic_univ) :
derivWithin (fun u => ∫ x in a..u, f x) s b = c :=
(integral_hasDerivWithinAt_of_tendsto_ae_right hf hmeas hb).derivWithin hs
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` is continuous
on the right or on the left at `b`, then the right (resp., left) derivative of
`u ↦ ∫ x in a..u, f x` at `b` equals `f b`. -/
theorem derivWithin_integral_right (hf : IntervalIntegrable f volume a b) {s t : Set ℝ}
[FTCFilter b (𝓝[s] b) (𝓝[t] b)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] b))
(hb : ContinuousWithinAt f t b)
(hs : UniqueDiffWithinAt ℝ s b := by uniqueDiffWithinAt_Ici_Iic_univ) :
derivWithin (fun u => ∫ x in a..u, f x) s b = f b :=
(integral_hasDerivWithinAt_right hf hmeas hb).derivWithin hs
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` has a finite
limit `c` almost surely as `x` tends to `a` from the right or from the left,
then `u ↦ ∫ x in u..b, f x` has right (resp., left) derivative `-c` at `a`. -/
theorem integral_hasDerivWithinAt_of_tendsto_ae_left (hf : IntervalIntegrable f volume a b)
{s t : Set ℝ} [FTCFilter a (𝓝[s] a) (𝓝[t] a)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] a))
(ha : Tendsto f (𝓝[t] a ⊓ ae volume) (𝓝 c)) :
HasDerivWithinAt (fun u => ∫ x in u..b, f x) (-c) s a := by
simp only [integral_symm b]
exact (integral_hasDerivWithinAt_of_tendsto_ae_right hf.symm hmeas ha).neg
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` is continuous
from the left or from the right at `a`, then `u ↦ ∫ x in u..b, f x` has left (resp., right)
derivative `-f a` at `a`. -/
theorem integral_hasDerivWithinAt_left (hf : IntervalIntegrable f volume a b) {s t : Set ℝ}
[FTCFilter a (𝓝[s] a) (𝓝[t] a)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] a))
(ha : ContinuousWithinAt f t a) : HasDerivWithinAt (fun u => ∫ x in u..b, f x) (-f a) s a :=
integral_hasDerivWithinAt_of_tendsto_ae_left hf hmeas (ha.mono_left inf_le_left)
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` has a finite
limit `c` almost surely as `x` tends to `a` from the right or from the left, then the right
(resp., left) derivative of `u ↦ ∫ x in u..b, f x` at `a` equals `-c`. -/
theorem derivWithin_integral_of_tendsto_ae_left (hf : IntervalIntegrable f volume a b) {s t : Set ℝ}
[FTCFilter a (𝓝[s] a) (𝓝[t] a)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] a))
(ha : Tendsto f (𝓝[t] a ⊓ ae volume) (𝓝 c))
(hs : UniqueDiffWithinAt ℝ s a := by uniqueDiffWithinAt_Ici_Iic_univ) :
derivWithin (fun u => ∫ x in u..b, f x) s a = -c :=
(integral_hasDerivWithinAt_of_tendsto_ae_left hf hmeas ha).derivWithin hs
/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` is continuous
on the right or on the left at `a`, then the right (resp., left) derivative of
`u ↦ ∫ x in u..b, f x` at `a` equals `-f a`. -/
theorem derivWithin_integral_left (hf : IntervalIntegrable f volume a b) {s t : Set ℝ}
[FTCFilter a (𝓝[s] a) (𝓝[t] a)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] a))
(ha : ContinuousWithinAt f t a)
(hs : UniqueDiffWithinAt ℝ s a := by uniqueDiffWithinAt_Ici_Iic_univ) :
derivWithin (fun u => ∫ x in u..b, f x) s a = -f a :=
(integral_hasDerivWithinAt_left hf hmeas ha).derivWithin hs
/-- The integral of a continuous function is differentiable on a real set `s`. -/
theorem differentiableOn_integral_of_continuous {s : Set ℝ}
(hintg : ∀ x ∈ s, IntervalIntegrable f volume a x) (hcont : Continuous f) :
DifferentiableOn ℝ (fun u => ∫ x in a..u, f x) s := fun y hy =>
(integral_hasDerivAt_right (hintg y hy) hcont.aestronglyMeasurable.stronglyMeasurableAtFilter
hcont.continuousAt).differentiableAt.differentiableWithinAt
end FTC1
/-!
### Fundamental theorem of calculus, part 2
This section contains theorems pertaining to FTC-2 for interval integrals, i.e., the assertion
that `∫ x in a..b, f' x = f b - f a` under suitable assumptions.
The most classical version of this theorem assumes that `f'` is continuous. However, this is
unnecessarily strong: the result holds if `f'` is just integrable. We prove the strong version,
following [Rudin, *Real and Complex Analysis* (Theorem 7.21)][rudin2006real]. The proof is first
given for real-valued functions, and then deduced for functions with a general target space. For
a real-valued function `g`, it suffices to show that `g b - g a ≤ (∫ x in a..b, g' x) + ε` for all
positive `ε`. To prove this, choose a lower-semicontinuous function `G'` with `g' < G'` and with
integral close to that of `g'` (its existence is guaranteed by the Vitali-Carathéodory theorem).
It satisfies `g t - g a ≤ ∫ x in a..t, G' x` for all `t ∈ [a, b]`: this inequality holds at `a`,
and if it holds at `t` then it holds for `u` close to `t` on its right, as the left hand side
increases by `g u - g t ∼ (u -t) g' t`, while the right hand side increases by
`∫ x in t..u, G' x` which is roughly at least `∫ x in t..u, G' t = (u - t) G' t`, by lower
semicontinuity. As `g' t < G' t`, this gives the conclusion. One can therefore push progressively
this inequality to the right until the point `b`, where it gives the desired conclusion.
-/
variable {f : ℝ → E} {g' g φ : ℝ → ℝ} {a b : ℝ}
/-- Hard part of FTC-2 for integrable derivatives, real-valued functions: one has
`g b - g a ≤ ∫ y in a..b, g' y` when `g'` is integrable.
Auxiliary lemma in the proof of `integral_eq_sub_of_hasDeriv_right_of_le`.
We give the slightly more general version that `g b - g a ≤ ∫ y in a..b, φ y` when `g' ≤ φ` and
`φ` is integrable (even if `g'` is not known to be integrable).
Version assuming that `g` is differentiable on `[a, b)`. -/
theorem sub_le_integral_of_hasDeriv_right_of_le_Ico (hab : a ≤ b)
(hcont : ContinuousOn g (Icc a b)) (hderiv : ∀ x ∈ Ico a b, HasDerivWithinAt g (g' x) (Ioi x) x)
(φint : IntegrableOn φ (Icc a b)) (hφg : ∀ x ∈ Ico a b, g' x ≤ φ x) :
g b - g a ≤ ∫ y in a..b, φ y := by
refine le_of_forall_pos_le_add fun ε εpos => ?_
-- Bound from above `g'` by a lower-semicontinuous function `G'`.
rcases exists_lt_lowerSemicontinuous_integral_lt φ φint εpos with
⟨G', f_lt_G', G'cont, G'int, G'lt_top, hG'⟩
-- we will show by "induction" that `g t - g a ≤ ∫ u in a..t, G' u` for all `t ∈ [a, b]`.
set s := {t | g t - g a ≤ ∫ u in a..t, (G' u).toReal} ∩ Icc a b
-- the set `s` of points where this property holds is closed.
have s_closed : IsClosed s := by
have : ContinuousOn (fun t => (g t - g a, ∫ u in a..t, (G' u).toReal)) (Icc a b) := by
rw [← uIcc_of_le hab] at G'int hcont ⊢
exact (hcont.sub continuousOn_const).prod (continuousOn_primitive_interval G'int)
simp only [s, inter_comm]
exact this.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le'
have main : Icc a b ⊆ {t | g t - g a ≤ ∫ u in a..t, (G' u).toReal} := by
-- to show that the set `s` is all `[a, b]`, it suffices to show that any point `t` in `s`
-- with `t < b` admits another point in `s` slightly to its right
-- (this is a sort of real induction).
refine s_closed.Icc_subset_of_forall_exists_gt
(by simp only [integral_same, mem_setOf_eq, sub_self, le_rfl]) fun t ht v t_lt_v => ?_
obtain ⟨y, g'_lt_y', y_lt_G'⟩ : ∃ y : ℝ, (g' t : EReal) < y ∧ (y : EReal) < G' t :=
EReal.lt_iff_exists_real_btwn.1 ((EReal.coe_le_coe_iff.2 (hφg t ht.2)).trans_lt (f_lt_G' t))
-- bound from below the increase of `∫ x in a..u, G' x` on the right of `t`, using the lower
-- semicontinuity of `G'`.
have I1 : ∀ᶠ u in 𝓝[>] t, (u - t) * y ≤ ∫ w in t..u, (G' w).toReal := by
have B : ∀ᶠ u in 𝓝 t, (y : EReal) < G' u := G'cont.lowerSemicontinuousAt _ _ y_lt_G'
rcases mem_nhds_iff_exists_Ioo_subset.1 B with ⟨m, M, ⟨hm, hM⟩, H⟩
have : Ioo t (min M b) ∈ 𝓝[>] t := Ioo_mem_nhdsWithin_Ioi' (lt_min hM ht.right.right)
filter_upwards [this] with u hu
have I : Icc t u ⊆ Icc a b := Icc_subset_Icc ht.2.1 (hu.2.le.trans (min_le_right _ _))
calc
(u - t) * y = ∫ _ in Icc t u, y := by
simp only [hu.left.le, MeasureTheory.integral_const, Algebra.id.smul_eq_mul, sub_nonneg,
MeasurableSet.univ, Real.volume_Icc, Measure.restrict_apply, univ_inter,
ENNReal.toReal_ofReal]
_ ≤ ∫ w in t..u, (G' w).toReal := by
rw [intervalIntegral.integral_of_le hu.1.le, ← integral_Icc_eq_integral_Ioc]
apply setIntegral_mono_ae_restrict
· simp only [integrableOn_const, Real.volume_Icc, ENNReal.ofReal_lt_top, or_true_iff]
· exact IntegrableOn.mono_set G'int I
· have C1 : ∀ᵐ x : ℝ ∂volume.restrict (Icc t u), G' x < ∞ :=
ae_mono (Measure.restrict_mono I le_rfl) G'lt_top
have C2 : ∀ᵐ x : ℝ ∂volume.restrict (Icc t u), x ∈ Icc t u :=
ae_restrict_mem measurableSet_Icc
filter_upwards [C1, C2] with x G'x hx
apply EReal.coe_le_coe_iff.1
have : x ∈ Ioo m M := by
simp only [hm.trans_le hx.left,
(hx.right.trans_lt hu.right).trans_le (min_le_left M b), mem_Ioo, and_self_iff]
refine (H this).out.le.trans_eq ?_
exact (EReal.coe_toReal G'x.ne (f_lt_G' x).ne_bot).symm
-- bound from above the increase of `g u - g a` on the right of `t`, using the derivative at `t`
have I2 : ∀ᶠ u in 𝓝[>] t, g u - g t ≤ (u - t) * y := by
have g'_lt_y : g' t < y := EReal.coe_lt_coe_iff.1 g'_lt_y'
filter_upwards [(hderiv t ⟨ht.2.1, ht.2.2⟩).limsup_slope_le' (not_mem_Ioi.2 le_rfl) g'_lt_y,
self_mem_nhdsWithin] with u hu t_lt_u
have := mul_le_mul_of_nonneg_left hu.le (sub_pos.2 t_lt_u.out).le
rwa [← smul_eq_mul, sub_smul_slope] at this
-- combine the previous two bounds to show that `g u - g a` increases less quickly than
-- `∫ x in a..u, G' x`.
have I3 : ∀ᶠ u in 𝓝[>] t, g u - g t ≤ ∫ w in t..u, (G' w).toReal := by
filter_upwards [I1, I2] with u hu1 hu2 using hu2.trans hu1
have I4 : ∀ᶠ u in 𝓝[>] t, u ∈ Ioc t (min v b) := by
refine mem_nhdsWithin_Ioi_iff_exists_Ioc_subset.2 ⟨min v b, ?_, Subset.rfl⟩
simp only [lt_min_iff, mem_Ioi]
exact ⟨t_lt_v, ht.2.2⟩
-- choose a point `x` slightly to the right of `t` which satisfies the above bound
rcases (I3.and I4).exists with ⟨x, hx, h'x⟩
-- we check that it belongs to `s`, essentially by construction
refine ⟨x, ?_, Ioc_subset_Ioc le_rfl (min_le_left _ _) h'x⟩
calc
g x - g a = g t - g a + (g x - g t) := by abel
_ ≤ (∫ w in a..t, (G' w).toReal) + ∫ w in t..x, (G' w).toReal := add_le_add ht.1 hx
_ = ∫ w in a..x, (G' w).toReal := by
apply integral_add_adjacent_intervals
· rw [intervalIntegrable_iff_integrableOn_Ioc_of_le ht.2.1]
exact IntegrableOn.mono_set G'int
(Ioc_subset_Icc_self.trans (Icc_subset_Icc le_rfl ht.2.2.le))
· rw [intervalIntegrable_iff_integrableOn_Ioc_of_le h'x.1.le]
apply IntegrableOn.mono_set G'int
exact Ioc_subset_Icc_self.trans (Icc_subset_Icc ht.2.1 (h'x.2.trans (min_le_right _ _)))
-- now that we know that `s` contains `[a, b]`, we get the desired result by applying this to `b`.
calc
g b - g a ≤ ∫ y in a..b, (G' y).toReal := main (right_mem_Icc.2 hab)
_ ≤ (∫ y in a..b, φ y) + ε := by
convert hG'.le <;>
· rw [intervalIntegral.integral_of_le hab]
simp only [integral_Icc_eq_integral_Ioc', Real.volume_singleton]
-- Porting note: Lean was adding `lb`/`lb'` to the arguments of this theorem, so I enclosed FTC-1
-- into a `section`
/-- Hard part of FTC-2 for integrable derivatives, real-valued functions: one has
`g b - g a ≤ ∫ y in a..b, g' y` when `g'` is integrable.
Auxiliary lemma in the proof of `integral_eq_sub_of_hasDeriv_right_of_le`.
We give the slightly more general version that `g b - g a ≤ ∫ y in a..b, φ y` when `g' ≤ φ` and
`φ` is integrable (even if `g'` is not known to be integrable).
Version assuming that `g` is differentiable on `(a, b)`. -/
theorem sub_le_integral_of_hasDeriv_right_of_le (hab : a ≤ b) (hcont : ContinuousOn g (Icc a b))
(hderiv : ∀ x ∈ Ioo a b, HasDerivWithinAt g (g' x) (Ioi x) x) (φint : IntegrableOn φ (Icc a b))
(hφg : ∀ x ∈ Ioo a b, g' x ≤ φ x) : g b - g a ≤ ∫ y in a..b, φ y := by
-- This follows from the version on a closed-open interval (applied to `[t, b)` for `t` close to
-- `a`) and a continuity argument.
obtain rfl | a_lt_b := hab.eq_or_lt
· simp
set s := {t | g b - g t ≤ ∫ u in t..b, φ u} ∩ Icc a b
have s_closed : IsClosed s := by
have : ContinuousOn (fun t => (g b - g t, ∫ u in t..b, φ u)) (Icc a b) := by
rw [← uIcc_of_le hab] at hcont φint ⊢
exact (continuousOn_const.sub hcont).prod (continuousOn_primitive_interval_left φint)
simp only [s, inter_comm]
exact this.preimage_isClosed_of_isClosed isClosed_Icc isClosed_le_prod
have A : closure (Ioc a b) ⊆ s := by
apply s_closed.closure_subset_iff.2
intro t ht
refine ⟨?_, ⟨ht.1.le, ht.2⟩⟩
exact
sub_le_integral_of_hasDeriv_right_of_le_Ico ht.2 (hcont.mono (Icc_subset_Icc ht.1.le le_rfl))
(fun x hx => hderiv x ⟨ht.1.trans_le hx.1, hx.2⟩)
(φint.mono_set (Icc_subset_Icc ht.1.le le_rfl)) fun x hx => hφg x ⟨ht.1.trans_le hx.1, hx.2⟩
rw [closure_Ioc a_lt_b.ne] at A
exact (A (left_mem_Icc.2 hab)).1
/-- Auxiliary lemma in the proof of `integral_eq_sub_of_hasDeriv_right_of_le`. -/
theorem integral_le_sub_of_hasDeriv_right_of_le (hab : a ≤ b) (hcont : ContinuousOn g (Icc a b))
(hderiv : ∀ x ∈ Ioo a b, HasDerivWithinAt g (g' x) (Ioi x) x) (φint : IntegrableOn φ (Icc a b))
(hφg : ∀ x ∈ Ioo a b, φ x ≤ g' x) : (∫ y in a..b, φ y) ≤ g b - g a := by
rw [← neg_le_neg_iff]
convert sub_le_integral_of_hasDeriv_right_of_le hab hcont.neg (fun x hx => (hderiv x hx).neg)
φint.neg fun x hx => neg_le_neg (hφg x hx) using 1
· abel
· simp only [← integral_neg]; rfl
/-- Auxiliary lemma in the proof of `integral_eq_sub_of_hasDeriv_right_of_le`: real version -/
theorem integral_eq_sub_of_hasDeriv_right_of_le_real (hab : a ≤ b)
(hcont : ContinuousOn g (Icc a b)) (hderiv : ∀ x ∈ Ioo a b, HasDerivWithinAt g (g' x) (Ioi x) x)
(g'int : IntegrableOn g' (Icc a b)) : ∫ y in a..b, g' y = g b - g a :=
le_antisymm (integral_le_sub_of_hasDeriv_right_of_le hab hcont hderiv g'int fun _ _ => le_rfl)
(sub_le_integral_of_hasDeriv_right_of_le hab hcont hderiv g'int fun _ _ => le_rfl)
variable [CompleteSpace E] {f f' : ℝ → E}
/-- **Fundamental theorem of calculus-2**: If `f : ℝ → E` is continuous on `[a, b]` (where `a ≤ b`)
and has a right derivative at `f' x` for all `x` in `(a, b)`, and `f'` is integrable on `[a, b]`,
then `∫ y in a..b, f' y` equals `f b - f a`. -/
theorem integral_eq_sub_of_hasDeriv_right_of_le (hab : a ≤ b) (hcont : ContinuousOn f (Icc a b))
(hderiv : ∀ x ∈ Ioo a b, HasDerivWithinAt f (f' x) (Ioi x) x)
(f'int : IntervalIntegrable f' volume a b) : ∫ y in a..b, f' y = f b - f a := by
refine (NormedSpace.eq_iff_forall_dual_eq ℝ).2 fun g => ?_
rw [← g.intervalIntegral_comp_comm f'int, g.map_sub]
exact integral_eq_sub_of_hasDeriv_right_of_le_real hab (g.continuous.comp_continuousOn hcont)
(fun x hx => g.hasFDerivAt.comp_hasDerivWithinAt x (hderiv x hx))
(g.integrable_comp ((intervalIntegrable_iff_integrableOn_Icc_of_le hab).1 f'int))
/-- Fundamental theorem of calculus-2: If `f : ℝ → E` is continuous on `[a, b]` and
has a right derivative at `f' x` for all `x` in `[a, b)`, and `f'` is integrable on `[a, b]` then
`∫ y in a..b, f' y` equals `f b - f a`. -/
theorem integral_eq_sub_of_hasDeriv_right (hcont : ContinuousOn f (uIcc a b))
(hderiv : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
(hint : IntervalIntegrable f' volume a b) : ∫ y in a..b, f' y = f b - f a := by
rcases le_total a b with hab | hab
· simp only [uIcc_of_le, min_eq_left, max_eq_right, hab] at hcont hderiv hint
apply integral_eq_sub_of_hasDeriv_right_of_le hab hcont hderiv hint
· simp only [uIcc_of_ge, min_eq_right, max_eq_left, hab] at hcont hderiv
rw [integral_symm, integral_eq_sub_of_hasDeriv_right_of_le hab hcont hderiv hint.symm, neg_sub]
/-- Fundamental theorem of calculus-2: If `f : ℝ → E` is continuous on `[a, b]` (where `a ≤ b`) and
has a derivative at `f' x` for all `x` in `(a, b)`, and `f'` is integrable on `[a, b]`, then
`∫ y in a..b, f' y` equals `f b - f a`. -/
theorem integral_eq_sub_of_hasDerivAt_of_le (hab : a ≤ b) (hcont : ContinuousOn f (Icc a b))
(hderiv : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x) (hint : IntervalIntegrable f' volume a b) :
∫ y in a..b, f' y = f b - f a :=
integral_eq_sub_of_hasDeriv_right_of_le hab hcont (fun x hx => (hderiv x hx).hasDerivWithinAt)
hint
/-- Fundamental theorem of calculus-2: If `f : ℝ → E` has a derivative at `f' x` for all `x` in
`[a, b]` and `f'` is integrable on `[a, b]`, then `∫ y in a..b, f' y` equals `f b - f a`. -/
theorem integral_eq_sub_of_hasDerivAt (hderiv : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x)
(hint : IntervalIntegrable f' volume a b) : ∫ y in a..b, f' y = f b - f a :=
integral_eq_sub_of_hasDeriv_right (HasDerivAt.continuousOn hderiv)
(fun _x hx => (hderiv _ (mem_Icc_of_Ioo hx)).hasDerivWithinAt) hint
theorem integral_eq_sub_of_hasDerivAt_of_tendsto (hab : a < b) {fa fb}
(hderiv : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x) (hint : IntervalIntegrable f' volume a b)
(ha : Tendsto f (𝓝[>] a) (𝓝 fa)) (hb : Tendsto f (𝓝[<] b) (𝓝 fb)) :
∫ y in a..b, f' y = fb - fa := by
set F : ℝ → E := update (update f a fa) b fb
have Fderiv : ∀ x ∈ Ioo a b, HasDerivAt F (f' x) x := by
refine fun x hx => (hderiv x hx).congr_of_eventuallyEq ?_
filter_upwards [Ioo_mem_nhds hx.1 hx.2] with _ hy
unfold_let F
rw [update_noteq hy.2.ne, update_noteq hy.1.ne']
have hcont : ContinuousOn F (Icc a b) := by
rw [continuousOn_update_iff, continuousOn_update_iff, Icc_diff_right, Ico_diff_left]
refine ⟨⟨fun z hz => (hderiv z hz).continuousAt.continuousWithinAt, ?_⟩, ?_⟩
· exact fun _ => ha.mono_left (nhdsWithin_mono _ Ioo_subset_Ioi_self)
· rintro -
refine (hb.congr' ?_).mono_left (nhdsWithin_mono _ Ico_subset_Iio_self)
filter_upwards [Ioo_mem_nhdsWithin_Iio (right_mem_Ioc.2 hab)] with _ hz using
(update_noteq hz.1.ne' _ _).symm
simpa [F, hab.ne, hab.ne'] using integral_eq_sub_of_hasDerivAt_of_le hab.le hcont Fderiv hint
/-- Fundamental theorem of calculus-2: If `f : ℝ → E` is differentiable at every `x` in `[a, b]` and
its derivative is integrable on `[a, b]`, then `∫ y in a..b, deriv f y` equals `f b - f a`. -/
theorem integral_deriv_eq_sub (hderiv : ∀ x ∈ [[a, b]], DifferentiableAt ℝ f x)
(hint : IntervalIntegrable (deriv f) volume a b) : ∫ y in a..b, deriv f y = f b - f a :=
integral_eq_sub_of_hasDerivAt (fun x hx => (hderiv x hx).hasDerivAt) hint
theorem integral_deriv_eq_sub' (f) (hderiv : deriv f = f')
(hdiff : ∀ x ∈ uIcc a b, DifferentiableAt ℝ f x) (hcont : ContinuousOn f' (uIcc a b)) :
∫ y in a..b, f' y = f b - f a := by
rw [← hderiv, integral_deriv_eq_sub hdiff]
rw [hderiv]
exact hcont.intervalIntegrable
/-- A variant of `intervalIntegral.integral_deriv_eq_sub`, the Fundamental theorem
of calculus, involving integrating over the unit interval. -/
lemma integral_unitInterval_deriv_eq_sub [RCLike 𝕜] [NormedSpace 𝕜 E] [IsScalarTower ℝ 𝕜 E]
{f f' : 𝕜 → E} {z₀ z₁ : 𝕜}
(hcont : ContinuousOn (fun t : ℝ ↦ f' (z₀ + t • z₁)) (Set.Icc 0 1))
(hderiv : ∀ t ∈ Set.Icc (0 : ℝ) 1, HasDerivAt f (f' (z₀ + t • z₁)) (z₀ + t • z₁)) :
z₁ • ∫ t in (0 : ℝ)..1, f' (z₀ + t • z₁) = f (z₀ + z₁) - f z₀ := by
let γ (t : ℝ) : 𝕜 := z₀ + t • z₁
have hint : IntervalIntegrable (z₁ • (f' ∘ γ)) MeasureTheory.volume 0 1 :=
(ContinuousOn.const_smul hcont z₁).intervalIntegrable_of_Icc zero_le_one
have hderiv' : ∀ t ∈ Set.uIcc (0 : ℝ) 1, HasDerivAt (f ∘ γ) (z₁ • (f' ∘ γ) t) t := by
intro t ht
refine (hderiv t <| (Set.uIcc_of_le (α := ℝ) zero_le_one).symm ▸ ht).scomp t ?_
have : HasDerivAt (fun t : ℝ ↦ t • z₁) z₁ t := by
convert (hasDerivAt_id t).smul_const (F := 𝕜) _ using 1
simp only [one_smul]
exact this.const_add z₀
convert (integral_eq_sub_of_hasDerivAt hderiv' hint) using 1
· simp_rw [← integral_smul, Function.comp_apply]
· simp only [γ, Function.comp_apply, one_smul, zero_smul, add_zero]
/-!
### Automatic integrability for nonnegative derivatives
-/
/-- When the right derivative of a function is nonnegative, then it is automatically integrable. -/
theorem integrableOn_deriv_right_of_nonneg (hcont : ContinuousOn g (Icc a b))
(hderiv : ∀ x ∈ Ioo a b, HasDerivWithinAt g (g' x) (Ioi x) x)
(g'pos : ∀ x ∈ Ioo a b, 0 ≤ g' x) : IntegrableOn g' (Ioc a b) := by
by_cases hab : a < b; swap
· simp [Ioc_eq_empty hab]
rw [integrableOn_Ioc_iff_integrableOn_Ioo]
have meas_g' : AEMeasurable g' (volume.restrict (Ioo a b)) := by
apply (aemeasurable_derivWithin_Ioi g _).congr
refine (ae_restrict_mem measurableSet_Ioo).mono fun x hx => ?_
exact (hderiv x hx).derivWithin (uniqueDiffWithinAt_Ioi _)
suffices H : (∫⁻ x in Ioo a b, ‖g' x‖₊) ≤ ENNReal.ofReal (g b - g a) from
⟨meas_g'.aestronglyMeasurable, H.trans_lt ENNReal.ofReal_lt_top⟩
by_contra! H
obtain ⟨f, fle, fint, hf⟩ :
∃ f : SimpleFunc ℝ ℝ≥0,
(∀ x, f x ≤ ‖g' x‖₊) ∧
(∫⁻ x : ℝ in Ioo a b, f x) < ∞ ∧ ENNReal.ofReal (g b - g a) < ∫⁻ x : ℝ in Ioo a b, f x :=
exists_lt_lintegral_simpleFunc_of_lt_lintegral H
let F : ℝ → ℝ := (↑) ∘ f
have intF : IntegrableOn F (Ioo a b) := by
refine ⟨f.measurable.coe_nnreal_real.aestronglyMeasurable, ?_⟩
simpa only [F, HasFiniteIntegral, comp_apply, NNReal.nnnorm_eq] using fint
have A : ∫⁻ x : ℝ in Ioo a b, f x = ENNReal.ofReal (∫ x in Ioo a b, F x) :=
lintegral_coe_eq_integral _ intF
rw [A] at hf
have B : (∫ x : ℝ in Ioo a b, F x) ≤ g b - g a := by
rw [← integral_Ioc_eq_integral_Ioo, ← intervalIntegral.integral_of_le hab.le]
refine integral_le_sub_of_hasDeriv_right_of_le hab.le hcont hderiv ?_ fun x hx => ?_
· rwa [integrableOn_Icc_iff_integrableOn_Ioo]
· convert NNReal.coe_le_coe.2 (fle x)
simp only [Real.norm_of_nonneg (g'pos x hx), coe_nnnorm]
exact lt_irrefl _ (hf.trans_le (ENNReal.ofReal_le_ofReal B))
/-- When the derivative of a function is nonnegative, then it is automatically integrable,
Ioc version. -/
theorem integrableOn_deriv_of_nonneg (hcont : ContinuousOn g (Icc a b))
(hderiv : ∀ x ∈ Ioo a b, HasDerivAt g (g' x) x) (g'pos : ∀ x ∈ Ioo a b, 0 ≤ g' x) :
IntegrableOn g' (Ioc a b) :=
integrableOn_deriv_right_of_nonneg hcont (fun x hx => (hderiv x hx).hasDerivWithinAt) g'pos
/-- When the derivative of a function is nonnegative, then it is automatically integrable,
interval version. -/
theorem intervalIntegrable_deriv_of_nonneg (hcont : ContinuousOn g (uIcc a b))
(hderiv : ∀ x ∈ Ioo (min a b) (max a b), HasDerivAt g (g' x) x)
(hpos : ∀ x ∈ Ioo (min a b) (max a b), 0 ≤ g' x) : IntervalIntegrable g' volume a b := by
rcases le_total a b with hab | hab
· simp only [uIcc_of_le, min_eq_left, max_eq_right, hab, IntervalIntegrable, hab,
Ioc_eq_empty_of_le, integrableOn_empty, and_true_iff] at hcont hderiv hpos ⊢
exact integrableOn_deriv_of_nonneg hcont hderiv hpos
· simp only [uIcc_of_ge, min_eq_right, max_eq_left, hab, IntervalIntegrable, Ioc_eq_empty_of_le,
integrableOn_empty, true_and_iff] at hcont hderiv hpos ⊢
exact integrableOn_deriv_of_nonneg hcont hderiv hpos
/-!
### Integration by parts
-/
section Parts
variable [NormedRing A] [NormedAlgebra ℝ A] [CompleteSpace A]
/-- The integral of the derivative of a product of two maps.
For improper integrals, see `MeasureTheory.integral_deriv_mul_eq_sub`,
`MeasureTheory.integral_Ioi_deriv_mul_eq_sub`, and `MeasureTheory.integral_Iic_deriv_mul_eq_sub`. -/
theorem integral_deriv_mul_eq_sub_of_hasDeriv_right {u v u' v' : ℝ → A}
(hu : ContinuousOn u [[a, b]])
(hv : ContinuousOn v [[a, b]])
(huu' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt u (u' x) (Ioi x) x)
(hvv' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt v (v' x) (Ioi x) x)
(hu' : IntervalIntegrable u' volume a b)
(hv' : IntervalIntegrable v' volume a b) :
∫ x in a..b, u' x * v x + u x * v' x = u b * v b - u a * v a := by
apply integral_eq_sub_of_hasDeriv_right (hu.mul hv) fun x hx ↦ (huu' x hx).mul (hvv' x hx)
exact (hu'.mul_continuousOn hv).add (hv'.continuousOn_mul hu)
/-- The integral of the derivative of a product of two maps.
Special case of `integral_deriv_mul_eq_sub_of_hasDeriv_right` where the functions have a
two-sided derivative in the interior of the interval. -/
theorem integral_deriv_mul_eq_sub_of_hasDerivAt {u v u' v' : ℝ → A}
(hu : ContinuousOn u [[a, b]])
(hv : ContinuousOn v [[a, b]])
(huu' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivAt u (u' x) x)
(hvv' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivAt v (v' x) x)
(hu' : IntervalIntegrable u' volume a b)
(hv' : IntervalIntegrable v' volume a b) :
∫ x in a..b, u' x * v x + u x * v' x = u b * v b - u a * v a :=
integral_deriv_mul_eq_sub_of_hasDeriv_right hu hv
(fun x hx ↦ huu' x hx |>.hasDerivWithinAt) (fun x hx ↦ hvv' x hx |>.hasDerivWithinAt) hu' hv'
/-- The integral of the derivative of a product of two maps.
Special case of `integral_deriv_mul_eq_sub_of_hasDeriv_right` where the functions have a
one-sided derivative at the endpoints. -/
theorem integral_deriv_mul_eq_sub_of_hasDerivWithinAt {u v u' v' : ℝ → A}
(hu : ∀ x ∈ [[a, b]], HasDerivWithinAt u (u' x) [[a, b]] x)
(hv : ∀ x ∈ [[a, b]], HasDerivWithinAt v (v' x) [[a, b]] x)
(hu' : IntervalIntegrable u' volume a b)
(hv' : IntervalIntegrable v' volume a b) :
∫ x in a..b, u' x * v x + u x * v' x = u b * v b - u a * v a :=
integral_deriv_mul_eq_sub_of_hasDerivAt
(fun x hx ↦ (hu x hx).continuousWithinAt)
(fun x hx ↦ (hv x hx).continuousWithinAt)
(fun x hx ↦ hu x (mem_Icc_of_Ioo hx) |>.hasDerivAt (Icc_mem_nhds hx.1 hx.2))
(fun x hx ↦ hv x (mem_Icc_of_Ioo hx) |>.hasDerivAt (Icc_mem_nhds hx.1 hx.2))
hu' hv'
/-- Special case of `integral_deriv_mul_eq_sub_of_hasDeriv_right` where the functions have a
derivative at the endpoints. -/
theorem integral_deriv_mul_eq_sub {u v u' v' : ℝ → A}
(hu : ∀ x ∈ [[a, b]], HasDerivAt u (u' x) x)
(hv : ∀ x ∈ [[a, b]], HasDerivAt v (v' x) x)
(hu' : IntervalIntegrable u' volume a b)
(hv' : IntervalIntegrable v' volume a b) :
∫ x in a..b, u' x * v x + u x * v' x = u b * v b - u a * v a :=
integral_deriv_mul_eq_sub_of_hasDerivWithinAt
(fun x hx ↦ hu x hx |>.hasDerivWithinAt) (fun x hx ↦ hv x hx |>.hasDerivWithinAt) hu' hv'
/-- **Integration by parts**. For improper integrals, see
`MeasureTheory.integral_mul_deriv_eq_deriv_mul`,
`MeasureTheory.integral_Ioi_mul_deriv_eq_deriv_mul`,
and `MeasureTheory.integral_Iic_mul_deriv_eq_deriv_mul`. -/
theorem integral_mul_deriv_eq_deriv_mul_of_hasDeriv_right {u v u' v' : ℝ → A}
(hu : ContinuousOn u [[a, b]])
(hv : ContinuousOn v [[a, b]])
(huu' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt u (u' x) (Ioi x) x)
(hvv' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt v (v' x) (Ioi x) x)
(hu' : IntervalIntegrable u' volume a b)
(hv' : IntervalIntegrable v' volume a b) :
∫ x in a..b, u x * v' x = u b * v b - u a * v a - ∫ x in a..b, u' x * v x := by
rw [← integral_deriv_mul_eq_sub_of_hasDeriv_right hu hv huu' hvv' hu' hv', ← integral_sub]
· simp_rw [add_sub_cancel_left]
· exact (hu'.mul_continuousOn hv).add (hv'.continuousOn_mul hu)
· exact hu'.mul_continuousOn hv
/-- **Integration by parts**. Special case of `integral_mul_deriv_eq_deriv_mul_of_hasDeriv_right`
where the functions have a two-sided derivative in the interior of the interval. -/
theorem integral_mul_deriv_eq_deriv_mul_of_hasDerivAt {u v u' v' : ℝ → A}
(hu : ContinuousOn u [[a, b]])
(hv : ContinuousOn v [[a, b]])
(huu' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivAt u (u' x) x)
(hvv' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivAt v (v' x) x)
(hu' : IntervalIntegrable u' volume a b)
(hv' : IntervalIntegrable v' volume a b) :
∫ x in a..b, u x * v' x = u b * v b - u a * v a - ∫ x in a..b, u' x * v x :=
integral_mul_deriv_eq_deriv_mul_of_hasDeriv_right hu hv
(fun x hx ↦ (huu' x hx).hasDerivWithinAt) (fun x hx ↦ (hvv' x hx).hasDerivWithinAt) hu' hv'
/-- **Integration by parts**. Special case of
`intervalIntegrable.integral_mul_deriv_eq_deriv_mul_of_hasDeriv_right`
where the functions have a one-sided derivative at the endpoints. -/
theorem integral_mul_deriv_eq_deriv_mul_of_hasDerivWithinAt {u v u' v' : ℝ → A}
(hu : ∀ x ∈ [[a, b]], HasDerivWithinAt u (u' x) [[a, b]] x)
(hv : ∀ x ∈ [[a, b]], HasDerivWithinAt v (v' x) [[a, b]] x)
(hu' : IntervalIntegrable u' volume a b)
(hv' : IntervalIntegrable v' volume a b) :
∫ x in a..b, u x * v' x = u b * v b - u a * v a - ∫ x in a..b, u' x * v x :=
integral_mul_deriv_eq_deriv_mul_of_hasDerivAt
(fun x hx ↦ (hu x hx).continuousWithinAt)
(fun x hx ↦ (hv x hx).continuousWithinAt)
(fun x hx ↦ hu x (mem_Icc_of_Ioo hx) |>.hasDerivAt (Icc_mem_nhds hx.1 hx.2))
(fun x hx ↦ hv x (mem_Icc_of_Ioo hx) |>.hasDerivAt (Icc_mem_nhds hx.1 hx.2))
hu' hv'
/-- **Integration by parts**. Special case of
`intervalIntegrable.integral_mul_deriv_eq_deriv_mul_of_hasDeriv_right`
where the functions have a derivative also at the endpoints.
For improper integrals, see
`MeasureTheory.integral_mul_deriv_eq_deriv_mul`,
`MeasureTheory.integral_Ioi_mul_deriv_eq_deriv_mul`,
and `MeasureTheory.integral_Iic_mul_deriv_eq_deriv_mul`. -/
theorem integral_mul_deriv_eq_deriv_mul {u v u' v' : ℝ → A}
(hu : ∀ x ∈ [[a, b]], HasDerivAt u (u' x) x)
(hv : ∀ x ∈ [[a, b]], HasDerivAt v (v' x) x)
(hu' : IntervalIntegrable u' volume a b)
(hv' : IntervalIntegrable v' volume a b) :
∫ x in a..b, u x * v' x = u b * v b - u a * v a - ∫ x in a..b, u' x * v x :=
integral_mul_deriv_eq_deriv_mul_of_hasDerivWithinAt
(fun x hx ↦ (hu x hx).hasDerivWithinAt) (fun x hx ↦ (hv x hx).hasDerivWithinAt) hu' hv'
end Parts
/-!
### Integration by substitution / Change of variables
-/
section SMul
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G]
/-- Change of variables, general form. If `f` is continuous on `[a, b]` and has
right-derivative `f'` in `(a, b)`, `g` is continuous on `f '' (a, b)` and integrable on
`f '' [a, b]`, and `f' x • (g ∘ f) x` is integrable on `[a, b]`,
then we can substitute `u = f x` to get `∫ x in a..b, f' x • (g ∘ f) x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_smul_deriv''' {f f' : ℝ → ℝ} {g : ℝ → G} (hf : ContinuousOn f [[a, b]])
(hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
(hg_cont : ContinuousOn g (f '' Ioo (min a b) (max a b))) (hg1 : IntegrableOn g (f '' [[a, b]]))
(hg2 : IntegrableOn (fun x => f' x • (g ∘ f) x) [[a, b]]) :
(∫ x in a..b, f' x • (g ∘ f) x) = ∫ u in f a..f b, g u := by
by_cases hG : CompleteSpace G; swap
· simp [intervalIntegral, integral, hG]
rw [hf.image_uIcc, ← intervalIntegrable_iff'] at hg1
have h_cont : ContinuousOn (fun u => ∫ t in f a..f u, g t) [[a, b]] := by
refine (continuousOn_primitive_interval' hg1 ?_).comp hf ?_
· rw [← hf.image_uIcc]; exact mem_image_of_mem f left_mem_uIcc
· rw [← hf.image_uIcc]; exact mapsTo_image _ _
have h_der :
∀ x ∈ Ioo (min a b) (max a b),
HasDerivWithinAt (fun u => ∫ t in f a..f u, g t) (f' x • (g ∘ f) x) (Ioi x) x := by
intro x hx
obtain ⟨c, hc⟩ := nonempty_Ioo.mpr hx.1
obtain ⟨d, hd⟩ := nonempty_Ioo.mpr hx.2
have cdsub : [[c, d]] ⊆ Ioo (min a b) (max a b) := by
rw [uIcc_of_le (hc.2.trans hd.1).le]
exact Icc_subset_Ioo hc.1 hd.2
replace hg_cont := hg_cont.mono (image_subset f cdsub)
let J := [[sInf (f '' [[c, d]]), sSup (f '' [[c, d]])]]
have hJ : f '' [[c, d]] = J := (hf.mono (cdsub.trans Ioo_subset_Icc_self)).image_uIcc
rw [hJ] at hg_cont
have h2x : f x ∈ J := by rw [← hJ]; exact mem_image_of_mem _ (mem_uIcc_of_le hc.2.le hd.1.le)
have h2g : IntervalIntegrable g volume (f a) (f x) := by
refine hg1.mono_set ?_
rw [← hf.image_uIcc]
exact hf.surjOn_uIcc left_mem_uIcc (Ioo_subset_Icc_self hx)
have h3g : StronglyMeasurableAtFilter g (𝓝[J] f x) :=
hg_cont.stronglyMeasurableAtFilter_nhdsWithin measurableSet_Icc (f x)
haveI : Fact (f x ∈ J) := ⟨h2x⟩
have : HasDerivWithinAt (fun u => ∫ x in f a..u, g x) (g (f x)) J (f x) :=
intervalIntegral.integral_hasDerivWithinAt_right h2g h3g (hg_cont (f x) h2x)
refine (this.scomp x ((hff' x hx).Ioo_of_Ioi hd.1) ?_).Ioi_of_Ioo hd.1
rw [← hJ]
refine (mapsTo_image _ _).mono ?_ Subset.rfl
exact Ioo_subset_Icc_self.trans ((Icc_subset_Icc_left hc.2.le).trans Icc_subset_uIcc)
rw [← intervalIntegrable_iff'] at hg2
simp_rw [integral_eq_sub_of_hasDeriv_right h_cont h_der hg2, integral_same, sub_zero]
/-- Change of variables for continuous integrands. If `f` is continuous on `[a, b]` and has
continuous right-derivative `f'` in `(a, b)`, and `g` is continuous on `f '' [a, b]` then we can
substitute `u = f x` to get `∫ x in a..b, f' x • (g ∘ f) x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_smul_deriv'' {f f' : ℝ → ℝ} {g : ℝ → G} (hf : ContinuousOn f [[a, b]])
(hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
(hf' : ContinuousOn f' [[a, b]]) (hg : ContinuousOn g (f '' [[a, b]])) :
(∫ x in a..b, f' x • (g ∘ f) x) = ∫ u in f a..f b, g u := by
refine
integral_comp_smul_deriv''' hf hff' (hg.mono <| image_subset _ Ioo_subset_Icc_self) ?_
(hf'.smul (hg.comp hf <| subset_preimage_image f _)).integrableOn_Icc
rw [hf.image_uIcc] at hg ⊢
exact hg.integrableOn_Icc
/-- Change of variables. If `f` has continuous derivative `f'` on `[a, b]`,
and `g` is continuous on `f '' [a, b]`, then we can substitute `u = f x` to get
`∫ x in a..b, f' x • (g ∘ f) x = ∫ u in f a..f b, g u`.
Compared to `intervalIntegral.integral_comp_smul_deriv` we only require that `g` is continuous on
`f '' [a, b]`.
-/
theorem integral_comp_smul_deriv' {f f' : ℝ → ℝ} {g : ℝ → G}
(h : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x) (h' : ContinuousOn f' (uIcc a b))
(hg : ContinuousOn g (f '' [[a, b]])) :
(∫ x in a..b, f' x • (g ∘ f) x) = ∫ x in f a..f b, g x :=
integral_comp_smul_deriv'' (fun x hx => (h x hx).continuousAt.continuousWithinAt)
(fun x hx => (h x <| Ioo_subset_Icc_self hx).hasDerivWithinAt) h' hg
/-- Change of variables, most common version. If `f` has continuous derivative `f'` on `[a, b]`,
and `g` is continuous, then we can substitute `u = f x` to get
`∫ x in a..b, f' x • (g ∘ f) x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_smul_deriv {f f' : ℝ → ℝ} {g : ℝ → G}
(h : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x) (h' : ContinuousOn f' (uIcc a b))
(hg : Continuous g) : (∫ x in a..b, f' x • (g ∘ f) x) = ∫ x in f a..f b, g x :=
integral_comp_smul_deriv' h h' hg.continuousOn
theorem integral_deriv_comp_smul_deriv' {f f' : ℝ → ℝ} {g g' : ℝ → E} (hf : ContinuousOn f [[a, b]])
(hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
(hf' : ContinuousOn f' [[a, b]]) (hg : ContinuousOn g [[f a, f b]])
(hgg' : ∀ x ∈ Ioo (min (f a) (f b)) (max (f a) (f b)), HasDerivWithinAt g (g' x) (Ioi x) x)
(hg' : ContinuousOn g' (f '' [[a, b]])) :
(∫ x in a..b, f' x • (g' ∘ f) x) = (g ∘ f) b - (g ∘ f) a := by
rw [integral_comp_smul_deriv'' hf hff' hf' hg',
integral_eq_sub_of_hasDeriv_right hg hgg' (hg'.mono _).intervalIntegrable]
exacts [rfl, intermediate_value_uIcc hf]
theorem integral_deriv_comp_smul_deriv {f f' : ℝ → ℝ} {g g' : ℝ → E}
(hf : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x)
(hg : ∀ x ∈ uIcc a b, HasDerivAt g (g' (f x)) (f x)) (hf' : ContinuousOn f' (uIcc a b))
(hg' : Continuous g') : (∫ x in a..b, f' x • (g' ∘ f) x) = (g ∘ f) b - (g ∘ f) a :=
integral_eq_sub_of_hasDerivAt (fun x hx => (hg x hx).scomp x <| hf x hx)
(hf'.smul (hg'.comp_continuousOn <| HasDerivAt.continuousOn hf)).intervalIntegrable
end SMul
section Mul
/-- Change of variables, general form for scalar functions. If `f` is continuous on `[a, b]` and has
continuous right-derivative `f'` in `(a, b)`, `g` is continuous on `f '' (a, b)` and integrable on
`f '' [a, b]`, and `(g ∘ f) x * f' x` is integrable on `[a, b]`, then we can substitute `u = f x`
to get `∫ x in a..b, (g ∘ f) x * f' x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_mul_deriv''' {a b : ℝ} {f f' : ℝ → ℝ} {g : ℝ → ℝ}
(hf : ContinuousOn f [[a, b]])
(hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
(hg_cont : ContinuousOn g (f '' Ioo (min a b) (max a b))) (hg1 : IntegrableOn g (f '' [[a, b]]))
(hg2 : IntegrableOn (fun x => (g ∘ f) x * f' x) [[a, b]]) :
(∫ x in a..b, (g ∘ f) x * f' x) = ∫ u in f a..f b, g u := by
have hg2' : IntegrableOn (fun x => f' x • (g ∘ f) x) [[a, b]] := by simpa [mul_comm] using hg2
simpa [mul_comm] using integral_comp_smul_deriv''' hf hff' hg_cont hg1 hg2'
/-- Change of variables for continuous integrands. If `f` is continuous on `[a, b]` and has
continuous right-derivative `f'` in `(a, b)`, and `g` is continuous on `f '' [a, b]` then we can
substitute `u = f x` to get `∫ x in a..b, (g ∘ f) x * f' x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_mul_deriv'' {f f' g : ℝ → ℝ} (hf : ContinuousOn f [[a, b]])
(hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
(hf' : ContinuousOn f' [[a, b]]) (hg : ContinuousOn g (f '' [[a, b]])) :
(∫ x in a..b, (g ∘ f) x * f' x) = ∫ u in f a..f b, g u := by
simpa [mul_comm] using integral_comp_smul_deriv'' hf hff' hf' hg
/-- Change of variables. If `f` has continuous derivative `f'` on `[a, b]`,
and `g` is continuous on `f '' [a, b]`, then we can substitute `u = f x` to get
`∫ x in a..b, (g ∘ f) x * f' x = ∫ u in f a..f b, g u`.
Compared to `intervalIntegral.integral_comp_mul_deriv` we only require that `g` is continuous on
`f '' [a, b]`.
-/
theorem integral_comp_mul_deriv' {f f' g : ℝ → ℝ} (h : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x)
(h' : ContinuousOn f' (uIcc a b)) (hg : ContinuousOn g (f '' [[a, b]])) :
(∫ x in a..b, (g ∘ f) x * f' x) = ∫ x in f a..f b, g x := by
simpa [mul_comm] using integral_comp_smul_deriv' h h' hg
/-- Change of variables, most common version. If `f` has continuous derivative `f'` on `[a, b]`,
and `g` is continuous, then we can substitute `u = f x` to get
`∫ x in a..b, (g ∘ f) x * f' x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_mul_deriv {f f' g : ℝ → ℝ} (h : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x)
(h' : ContinuousOn f' (uIcc a b)) (hg : Continuous g) :
(∫ x in a..b, (g ∘ f) x * f' x) = ∫ x in f a..f b, g x :=
integral_comp_mul_deriv' h h' hg.continuousOn
theorem integral_deriv_comp_mul_deriv' {f f' g g' : ℝ → ℝ} (hf : ContinuousOn f [[a, b]])
(hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
(hf' : ContinuousOn f' [[a, b]]) (hg : ContinuousOn g [[f a, f b]])
(hgg' : ∀ x ∈ Ioo (min (f a) (f b)) (max (f a) (f b)), HasDerivWithinAt g (g' x) (Ioi x) x)
(hg' : ContinuousOn g' (f '' [[a, b]])) :
(∫ x in a..b, (g' ∘ f) x * f' x) = (g ∘ f) b - (g ∘ f) a := by
simpa [mul_comm] using integral_deriv_comp_smul_deriv' hf hff' hf' hg hgg' hg'
theorem integral_deriv_comp_mul_deriv {f f' g g' : ℝ → ℝ}
(hf : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x)
(hg : ∀ x ∈ uIcc a b, HasDerivAt g (g' (f x)) (f x)) (hf' : ContinuousOn f' (uIcc a b))
(hg' : Continuous g') : (∫ x in a..b, (g' ∘ f) x * f' x) = (g ∘ f) b - (g ∘ f) a := by
simpa [mul_comm] using integral_deriv_comp_smul_deriv hf hg hf' hg'
end Mul
end intervalIntegral
|
MeasureTheory\Integral\Gamma.lean | /-
Copyright (c) 2023 Xavier Roblot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Xavier Roblot
-/
import Mathlib.Analysis.SpecialFunctions.PolarCoord
import Mathlib.Analysis.SpecialFunctions.Gamma.Basic
/-!
# Integrals involving the Gamma function
In this file, we collect several integrals over `ℝ` or `ℂ` that evaluate in terms of the
`Real.Gamma` function.
-/
open Real Set MeasureTheory MeasureTheory.Measure
section real
theorem integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 0 < p) (hq : - 1 < q) :
∫ x in Ioi (0 : ℝ), x ^ q * exp (- x ^ p) = (1 / p) * Gamma ((q + 1) / p) := by
calc
_ = ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
refine setIntegral_congr measurableSet_Ioi (fun _ hx => ?_)
rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
_ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
simp_rw [smul_eq_mul, mul_assoc]
refine setIntegral_congr measurableSet_Ioi (fun _ hx => ?_)
rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
ring_nf
_ = (1 / p) * Gamma ((q + 1) / p) := by
rw [Gamma_eq_integral (div_pos (neg_lt_iff_pos_add.mp hq) hp)]
simp_rw [show 1 / p - 1 + q / p = (q + 1) / p - 1 by field_simp; ring, ← integral_mul_left,
← mul_assoc]
theorem integral_rpow_mul_exp_neg_mul_rpow {p q b : ℝ} (hp : 0 < p) (hq : - 1 < q) (hb : 0 < b) :
∫ x in Ioi (0 : ℝ), x ^ q * exp (- b * x ^ p) =
b ^ (-(q + 1) / p) * (1 / p) * Gamma ((q + 1) / p) := by
calc
_ = ∫ x in Ioi (0 : ℝ), b ^ (-p⁻¹ * q) * ((b ^ p⁻¹ * x) ^ q * rexp (-(b ^ p⁻¹ * x) ^ p)) := by
refine setIntegral_congr measurableSet_Ioi (fun _ hx => ?_)
rw [mul_rpow _ (le_of_lt hx), mul_rpow _ (le_of_lt hx), ← rpow_mul, ← rpow_mul,
inv_mul_cancel, rpow_one, mul_assoc, ← mul_assoc, ← rpow_add, neg_mul p⁻¹, add_left_neg,
rpow_zero, one_mul, neg_mul]
all_goals positivity
_ = (b ^ p⁻¹)⁻¹ * ∫ x in Ioi (0 : ℝ), b ^ (-p⁻¹ * q) * (x ^ q * rexp (-x ^ p)) := by
rw [integral_comp_mul_left_Ioi (fun x => b ^ (-p⁻¹ * q) * (x ^ q * exp (- x ^ p))) 0,
mul_zero, smul_eq_mul]
all_goals positivity
_ = b ^ (-(q + 1) / p) * (1 / p) * Gamma ((q + 1) / p) := by
rw [integral_mul_left, integral_rpow_mul_exp_neg_rpow _ hq, mul_assoc, ← mul_assoc,
← rpow_neg_one, ← rpow_mul, ← rpow_add]
· congr; ring
all_goals positivity
theorem integral_exp_neg_rpow {p : ℝ} (hp : 0 < p) :
∫ x in Ioi (0 : ℝ), exp (- x ^ p) = Gamma (1 / p + 1) := by
convert (integral_rpow_mul_exp_neg_rpow hp neg_one_lt_zero) using 1
· simp_rw [rpow_zero, one_mul]
· rw [zero_add, Gamma_add_one (one_div_ne_zero (ne_of_gt hp))]
theorem integral_exp_neg_mul_rpow {p b : ℝ} (hp : 0 < p) (hb : 0 < b) :
∫ x in Ioi (0 : ℝ), exp (- b * x ^ p) = b ^ (- 1 / p) * Gamma (1 / p + 1) := by
convert (integral_rpow_mul_exp_neg_mul_rpow hp neg_one_lt_zero hb) using 1
· simp_rw [rpow_zero, one_mul]
· rw [zero_add, Gamma_add_one (one_div_ne_zero (ne_of_gt hp)), mul_assoc]
end real
section complex
theorem Complex.integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 1 ≤ p) (hq : - 2 < q) :
∫ x : ℂ, ‖x‖ ^ q * rexp (- ‖x‖ ^ p) = (2 * π / p) * Real.Gamma ((q + 2) / p) := by
calc
_ = ∫ x in Ioi (0 : ℝ) ×ˢ Ioo (-π) π, x.1 * (|x.1| ^ q * rexp (-|x.1| ^ p)) := by
rw [← Complex.integral_comp_polarCoord_symm, polarCoord_target]
simp_rw [Complex.norm_eq_abs, Complex.polarCoord_symm_abs, smul_eq_mul]
_ = (∫ x in Ioi (0 : ℝ), x * |x| ^ q * rexp (-|x| ^ p)) * ∫ _ in Ioo (-π) π, 1 := by
rw [← setIntegral_prod_mul, volume_eq_prod]
simp_rw [mul_one]
congr! 2; ring
_ = 2 * π * ∫ x in Ioi (0 : ℝ), x * |x| ^ q * rexp (-|x| ^ p) := by
simp_rw [integral_const, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter,
volume_Ioo, sub_neg_eq_add, ← two_mul, ENNReal.toReal_ofReal (by positivity : 0 ≤ 2 * π),
smul_eq_mul, mul_one, mul_comm]
_ = 2 * π * ∫ x in Ioi (0 : ℝ), x ^ (q + 1) * rexp (-x ^ p) := by
congr 1
refine setIntegral_congr measurableSet_Ioi (fun x hx => ?_)
rw [mem_Ioi] at hx
rw [abs_eq_self.mpr hx.le, rpow_add hx, rpow_one]
ring
_ = (2 * Real.pi / p) * Real.Gamma ((q + 2) / p) := by
rw [_root_.integral_rpow_mul_exp_neg_rpow (by linarith) (by linarith), add_assoc,
one_add_one_eq_two]
ring
theorem Complex.integral_rpow_mul_exp_neg_mul_rpow {p q b : ℝ} (hp : 1 ≤ p) (hq : - 2 < q)
(hb : 0 < b) :
∫ x : ℂ, ‖x‖ ^ q * rexp (- b * ‖x‖ ^ p) = (2 * π / p) *
b ^ (-(q + 2) / p) * Real.Gamma ((q + 2) / p) := by
calc
_ = ∫ x in Ioi (0 : ℝ) ×ˢ Ioo (-π) π, x.1 * (|x.1| ^ q * rexp (- b * |x.1| ^ p)) := by
rw [← Complex.integral_comp_polarCoord_symm, polarCoord_target]
simp_rw [Complex.norm_eq_abs, Complex.polarCoord_symm_abs, smul_eq_mul]
_ = (∫ x in Ioi (0 : ℝ), x * |x| ^ q * rexp (- b * |x| ^ p)) * ∫ _ in Ioo (-π) π, 1 := by
rw [← setIntegral_prod_mul, volume_eq_prod]
simp_rw [mul_one]
congr! 2; ring
_ = 2 * π * ∫ x in Ioi (0 : ℝ), x * |x| ^ q * rexp (- b * |x| ^ p) := by
simp_rw [integral_const, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter,
volume_Ioo, sub_neg_eq_add, ← two_mul, ENNReal.toReal_ofReal (by positivity : 0 ≤ 2 * π),
smul_eq_mul, mul_one, mul_comm]
_ = 2 * π * ∫ x in Ioi (0 : ℝ), x ^ (q + 1) * rexp (-b * x ^ p) := by
congr 1
refine setIntegral_congr measurableSet_Ioi (fun x hx => ?_)
rw [mem_Ioi] at hx
rw [abs_eq_self.mpr hx.le, rpow_add hx, rpow_one]
ring
_ = (2 * π / p) * b ^ (-(q + 2) / p) * Real.Gamma ((q + 2) / p) := by
rw [_root_.integral_rpow_mul_exp_neg_mul_rpow (by linarith) (by linarith) hb, add_assoc,
one_add_one_eq_two]
ring
theorem Complex.integral_exp_neg_rpow {p : ℝ} (hp : 1 ≤ p) :
∫ x : ℂ, rexp (- ‖x‖ ^ p) = π * Real.Gamma (2 / p + 1) := by
convert (integral_rpow_mul_exp_neg_rpow hp (by linarith : (-2 : ℝ) < 0)) using 1
· simp_rw [norm_eq_abs, rpow_zero, one_mul]
· rw [zero_add, Real.Gamma_add_one (div_ne_zero two_ne_zero (by linarith))]
ring
theorem Complex.integral_exp_neg_mul_rpow {p b : ℝ} (hp : 1 ≤ p) (hb : 0 < b) :
∫ x : ℂ, rexp (- b * ‖x‖ ^ p) = π * b ^ (-2 / p) * Real.Gamma (2 / p + 1) := by
convert (integral_rpow_mul_exp_neg_mul_rpow hp (by linarith : (-2 : ℝ) < 0)) hb using 1
· simp_rw [norm_eq_abs, rpow_zero, one_mul]
· rw [zero_add, Real.Gamma_add_one (div_ne_zero two_ne_zero (by linarith))]
ring
end complex
|
MeasureTheory\Integral\Indicator.lean | /-
Copyright (c) 2023 Kalle Kytölä. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kalle Kytölä
-/
import Mathlib.MeasureTheory.Integral.Lebesgue
import Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable
/-!
# Results about indicator functions, their integrals, and measures
This file has a few measure theoretic or integration-related results on indicator functions.
## Implementation notes
This file exists to avoid importing `Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable`
in `Mathlib.MeasureTheory.Integral.Lebesgue`.
## TODO
The result `MeasureTheory.tendsto_measure_of_tendsto_indicator` here could be proved without
integration, if we had convergence of measures results for countably generated filters. Ideally,
the present file would then become unnecessary: lemmas such as
`MeasureTheory.tendsto_measure_of_ae_tendsto_indicator` would not need integration so could be
moved out of `Mathlib.MeasureTheory.Integral.Lebesgue`, and the lemmas in this file could be
moved to, e.g., `Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable`.
-/
namespace MeasureTheory
section TendstoIndicator
open Filter ENNReal Topology
variable {α : Type*} [MeasurableSpace α] {A : Set α}
variable {ι : Type*} (L : Filter ι) [IsCountablyGenerated L] {As : ι → Set α}
/-- If the indicators of measurable sets `Aᵢ` tend pointwise to the indicator of a set `A`
and we eventually have `Aᵢ ⊆ B` for some set `B` of finite measure, then the measures of `Aᵢ`
tend to the measure of `A`. -/
lemma tendsto_measure_of_tendsto_indicator [NeBot L] {μ : Measure α}
(As_mble : ∀ i, MeasurableSet (As i)) {B : Set α} (B_mble : MeasurableSet B)
(B_finmeas : μ B ≠ ∞) (As_le_B : ∀ᶠ i in L, As i ⊆ B)
(h_lim : ∀ x, ∀ᶠ i in L, x ∈ As i ↔ x ∈ A) :
Tendsto (fun i ↦ μ (As i)) L (𝓝 (μ A)) := by
apply tendsto_measure_of_ae_tendsto_indicator L ?_ As_mble B_mble B_finmeas As_le_B
(ae_of_all μ h_lim)
exact measurableSet_of_tendsto_indicator L As_mble h_lim
/-- If `μ` is a finite measure and the indicators of measurable sets `Aᵢ` tend pointwise to
the indicator of a set `A`, then the measures `μ Aᵢ` tend to the measure `μ A`. -/
lemma tendsto_measure_of_tendsto_indicator_of_isFiniteMeasure [NeBot L]
(μ : Measure α) [IsFiniteMeasure μ] (As_mble : ∀ i, MeasurableSet (As i))
(h_lim : ∀ x, ∀ᶠ i in L, x ∈ As i ↔ x ∈ A) :
Tendsto (fun i ↦ μ (As i)) L (𝓝 (μ A)) := by
apply tendsto_measure_of_ae_tendsto_indicator_of_isFiniteMeasure L ?_ As_mble (ae_of_all μ h_lim)
exact measurableSet_of_tendsto_indicator L As_mble h_lim
end TendstoIndicator -- section
end MeasureTheory
|
MeasureTheory\Integral\IntegrableOn.lean | /-
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
-/
import Mathlib.MeasureTheory.Function.L1Space
import Mathlib.Analysis.NormedSpace.IndicatorFunction
/-! # Functions integrable on a set and at a filter
We define `IntegrableOn f s μ := Integrable f (μ.restrict s)` and prove theorems like
`integrableOn_union : IntegrableOn f (s ∪ t) μ ↔ IntegrableOn f s μ ∧ IntegrableOn f t μ`.
Next we define a predicate `IntegrableAtFilter (f : α → E) (l : Filter α) (μ : Measure α)`
saying that `f` is integrable at some set `s ∈ l` and prove that a measurable function is integrable
at `l` with respect to `μ` provided that `f` is bounded above at `l ⊓ ae μ` and `μ` is finite
at `l`.
-/
noncomputable section
open Set Filter TopologicalSpace MeasureTheory Function
open scoped Topology Interval Filter ENNReal MeasureTheory
variable {α β E F : Type*} [MeasurableSpace α]
section
variable [TopologicalSpace β] {l l' : Filter α} {f g : α → β} {μ ν : Measure α}
/-- A function `f` is strongly measurable at a filter `l` w.r.t. a measure `μ` if it is
ae strongly measurable w.r.t. `μ.restrict s` for some `s ∈ l`. -/
def StronglyMeasurableAtFilter (f : α → β) (l : Filter α) (μ : Measure α := by volume_tac) :=
∃ s ∈ l, AEStronglyMeasurable f (μ.restrict s)
@[simp]
theorem stronglyMeasurableAt_bot {f : α → β} : StronglyMeasurableAtFilter f ⊥ μ :=
⟨∅, mem_bot, by simp⟩
protected theorem StronglyMeasurableAtFilter.eventually (h : StronglyMeasurableAtFilter f l μ) :
∀ᶠ s in l.smallSets, AEStronglyMeasurable f (μ.restrict s) :=
(eventually_smallSets' fun _ _ => AEStronglyMeasurable.mono_set).2 h
protected theorem StronglyMeasurableAtFilter.filter_mono (h : StronglyMeasurableAtFilter f l μ)
(h' : l' ≤ l) : StronglyMeasurableAtFilter f l' μ :=
let ⟨s, hsl, hs⟩ := h
⟨s, h' hsl, hs⟩
protected theorem MeasureTheory.AEStronglyMeasurable.stronglyMeasurableAtFilter
(h : AEStronglyMeasurable f μ) : StronglyMeasurableAtFilter f l μ :=
⟨univ, univ_mem, by rwa [Measure.restrict_univ]⟩
theorem AeStronglyMeasurable.stronglyMeasurableAtFilter_of_mem {s}
(h : AEStronglyMeasurable f (μ.restrict s)) (hl : s ∈ l) : StronglyMeasurableAtFilter f l μ :=
⟨s, hl, h⟩
protected theorem MeasureTheory.StronglyMeasurable.stronglyMeasurableAtFilter
(h : StronglyMeasurable f) : StronglyMeasurableAtFilter f l μ :=
h.aestronglyMeasurable.stronglyMeasurableAtFilter
end
namespace MeasureTheory
section NormedAddCommGroup
theorem hasFiniteIntegral_restrict_of_bounded [NormedAddCommGroup E] {f : α → E} {s : Set α}
{μ : Measure α} {C} (hs : μ s < ∞) (hf : ∀ᵐ x ∂μ.restrict s, ‖f x‖ ≤ C) :
HasFiniteIntegral f (μ.restrict s) :=
haveI : IsFiniteMeasure (μ.restrict s) := ⟨by rwa [Measure.restrict_apply_univ]⟩
hasFiniteIntegral_of_bounded hf
variable [NormedAddCommGroup E] {f g : α → E} {s t : Set α} {μ ν : Measure α}
/-- A function is `IntegrableOn` a set `s` if it is almost everywhere strongly measurable on `s`
and if the integral of its pointwise norm over `s` is less than infinity. -/
def IntegrableOn (f : α → E) (s : Set α) (μ : Measure α := by volume_tac) : Prop :=
Integrable f (μ.restrict s)
theorem IntegrableOn.integrable (h : IntegrableOn f s μ) : Integrable f (μ.restrict s) :=
h
@[simp]
theorem integrableOn_empty : IntegrableOn f ∅ μ := by simp [IntegrableOn, integrable_zero_measure]
@[simp]
theorem integrableOn_univ : IntegrableOn f univ μ ↔ Integrable f μ := by
rw [IntegrableOn, Measure.restrict_univ]
theorem integrableOn_zero : IntegrableOn (fun _ => (0 : E)) s μ :=
integrable_zero _ _ _
@[simp]
theorem integrableOn_const {C : E} : IntegrableOn (fun _ => C) s μ ↔ C = 0 ∨ μ s < ∞ :=
integrable_const_iff.trans <| by rw [Measure.restrict_apply_univ]
theorem IntegrableOn.mono (h : IntegrableOn f t ν) (hs : s ⊆ t) (hμ : μ ≤ ν) : IntegrableOn f s μ :=
h.mono_measure <| Measure.restrict_mono hs hμ
theorem IntegrableOn.mono_set (h : IntegrableOn f t μ) (hst : s ⊆ t) : IntegrableOn f s μ :=
h.mono hst le_rfl
theorem IntegrableOn.mono_measure (h : IntegrableOn f s ν) (hμ : μ ≤ ν) : IntegrableOn f s μ :=
h.mono (Subset.refl _) hμ
theorem IntegrableOn.mono_set_ae (h : IntegrableOn f t μ) (hst : s ≤ᵐ[μ] t) : IntegrableOn f s μ :=
h.integrable.mono_measure <| Measure.restrict_mono_ae hst
theorem IntegrableOn.congr_set_ae (h : IntegrableOn f t μ) (hst : s =ᵐ[μ] t) : IntegrableOn f s μ :=
h.mono_set_ae hst.le
theorem IntegrableOn.congr_fun_ae (h : IntegrableOn f s μ) (hst : f =ᵐ[μ.restrict s] g) :
IntegrableOn g s μ :=
Integrable.congr h hst
theorem integrableOn_congr_fun_ae (hst : f =ᵐ[μ.restrict s] g) :
IntegrableOn f s μ ↔ IntegrableOn g s μ :=
⟨fun h => h.congr_fun_ae hst, fun h => h.congr_fun_ae hst.symm⟩
theorem IntegrableOn.congr_fun (h : IntegrableOn f s μ) (hst : EqOn f g s) (hs : MeasurableSet s) :
IntegrableOn g s μ :=
h.congr_fun_ae ((ae_restrict_iff' hs).2 (eventually_of_forall hst))
theorem integrableOn_congr_fun (hst : EqOn f g s) (hs : MeasurableSet s) :
IntegrableOn f s μ ↔ IntegrableOn g s μ :=
⟨fun h => h.congr_fun hst hs, fun h => h.congr_fun hst.symm hs⟩
theorem Integrable.integrableOn (h : Integrable f μ) : IntegrableOn f s μ :=
h.mono_measure <| Measure.restrict_le_self
theorem IntegrableOn.restrict (h : IntegrableOn f s μ) (hs : MeasurableSet s) :
IntegrableOn f s (μ.restrict t) := by
rw [IntegrableOn, Measure.restrict_restrict hs]; exact h.mono_set inter_subset_left
theorem IntegrableOn.inter_of_restrict (h : IntegrableOn f s (μ.restrict t)) :
IntegrableOn f (s ∩ t) μ := by
have := h.mono_set (inter_subset_left (t := t))
rwa [IntegrableOn, μ.restrict_restrict_of_subset inter_subset_right] at this
lemma Integrable.piecewise [DecidablePred (· ∈ s)]
(hs : MeasurableSet s) (hf : IntegrableOn f s μ) (hg : IntegrableOn g sᶜ μ) :
Integrable (s.piecewise f g) μ := by
rw [IntegrableOn] at hf hg
rw [← memℒp_one_iff_integrable] at hf hg ⊢
exact Memℒp.piecewise hs hf hg
theorem IntegrableOn.left_of_union (h : IntegrableOn f (s ∪ t) μ) : IntegrableOn f s μ :=
h.mono_set subset_union_left
theorem IntegrableOn.right_of_union (h : IntegrableOn f (s ∪ t) μ) : IntegrableOn f t μ :=
h.mono_set subset_union_right
theorem IntegrableOn.union (hs : IntegrableOn f s μ) (ht : IntegrableOn f t μ) :
IntegrableOn f (s ∪ t) μ :=
(hs.add_measure ht).mono_measure <| Measure.restrict_union_le _ _
@[simp]
theorem integrableOn_union : IntegrableOn f (s ∪ t) μ ↔ IntegrableOn f s μ ∧ IntegrableOn f t μ :=
⟨fun h => ⟨h.left_of_union, h.right_of_union⟩, fun h => h.1.union h.2⟩
@[simp]
theorem integrableOn_singleton_iff {x : α} [MeasurableSingletonClass α] :
IntegrableOn f {x} μ ↔ f x = 0 ∨ μ {x} < ∞ := by
have : f =ᵐ[μ.restrict {x}] fun _ => f x := by
filter_upwards [ae_restrict_mem (measurableSet_singleton x)] with _ ha
simp only [mem_singleton_iff.1 ha]
rw [IntegrableOn, integrable_congr this, integrable_const_iff]
simp
@[simp]
theorem integrableOn_finite_biUnion {s : Set β} (hs : s.Finite) {t : β → Set α} :
IntegrableOn f (⋃ i ∈ s, t i) μ ↔ ∀ i ∈ s, IntegrableOn f (t i) μ := by
refine hs.induction_on ?_ ?_
· simp
· intro a s _ _ hf; simp [hf, or_imp, forall_and]
@[simp]
theorem integrableOn_finset_iUnion {s : Finset β} {t : β → Set α} :
IntegrableOn f (⋃ i ∈ s, t i) μ ↔ ∀ i ∈ s, IntegrableOn f (t i) μ :=
integrableOn_finite_biUnion s.finite_toSet
@[simp]
theorem integrableOn_finite_iUnion [Finite β] {t : β → Set α} :
IntegrableOn f (⋃ i, t i) μ ↔ ∀ i, IntegrableOn f (t i) μ := by
cases nonempty_fintype β
simpa using @integrableOn_finset_iUnion _ _ _ _ _ f μ Finset.univ t
theorem IntegrableOn.add_measure (hμ : IntegrableOn f s μ) (hν : IntegrableOn f s ν) :
IntegrableOn f s (μ + ν) := by
delta IntegrableOn; rw [Measure.restrict_add]; exact hμ.integrable.add_measure hν
@[simp]
theorem integrableOn_add_measure :
IntegrableOn f s (μ + ν) ↔ IntegrableOn f s μ ∧ IntegrableOn f s ν :=
⟨fun h =>
⟨h.mono_measure (Measure.le_add_right le_rfl), h.mono_measure (Measure.le_add_left le_rfl)⟩,
fun h => h.1.add_measure h.2⟩
theorem _root_.MeasurableEmbedding.integrableOn_map_iff [MeasurableSpace β] {e : α → β}
(he : MeasurableEmbedding e) {f : β → E} {μ : Measure α} {s : Set β} :
IntegrableOn f s (μ.map e) ↔ IntegrableOn (f ∘ e) (e ⁻¹' s) μ := by
simp_rw [IntegrableOn, he.restrict_map, he.integrable_map_iff]
theorem _root_.MeasurableEmbedding.integrableOn_iff_comap [MeasurableSpace β] {e : α → β}
(he : MeasurableEmbedding e) {f : β → E} {μ : Measure β} {s : Set β} (hs : s ⊆ range e) :
IntegrableOn f s μ ↔ IntegrableOn (f ∘ e) (e ⁻¹' s) (μ.comap e) := by
simp_rw [← he.integrableOn_map_iff, he.map_comap, IntegrableOn,
Measure.restrict_restrict_of_subset hs]
theorem integrableOn_map_equiv [MeasurableSpace β] (e : α ≃ᵐ β) {f : β → E} {μ : Measure α}
{s : Set β} : IntegrableOn f s (μ.map e) ↔ IntegrableOn (f ∘ e) (e ⁻¹' s) μ := by
simp only [IntegrableOn, e.restrict_map, integrable_map_equiv e]
theorem MeasurePreserving.integrableOn_comp_preimage [MeasurableSpace β] {e : α → β} {ν}
(h₁ : MeasurePreserving e μ ν) (h₂ : MeasurableEmbedding e) {f : β → E} {s : Set β} :
IntegrableOn (f ∘ e) (e ⁻¹' s) μ ↔ IntegrableOn f s ν :=
(h₁.restrict_preimage_emb h₂ s).integrable_comp_emb h₂
theorem MeasurePreserving.integrableOn_image [MeasurableSpace β] {e : α → β} {ν}
(h₁ : MeasurePreserving e μ ν) (h₂ : MeasurableEmbedding e) {f : β → E} {s : Set α} :
IntegrableOn f (e '' s) ν ↔ IntegrableOn (f ∘ e) s μ :=
((h₁.restrict_image_emb h₂ s).integrable_comp_emb h₂).symm
theorem integrable_indicator_iff (hs : MeasurableSet s) :
Integrable (indicator s f) μ ↔ IntegrableOn f s μ := by
simp [IntegrableOn, Integrable, HasFiniteIntegral, nnnorm_indicator_eq_indicator_nnnorm,
ENNReal.coe_indicator, lintegral_indicator _ hs, aestronglyMeasurable_indicator_iff hs]
theorem IntegrableOn.integrable_indicator (h : IntegrableOn f s μ) (hs : MeasurableSet s) :
Integrable (indicator s f) μ :=
(integrable_indicator_iff hs).2 h
theorem Integrable.indicator (h : Integrable f μ) (hs : MeasurableSet s) :
Integrable (indicator s f) μ :=
h.integrableOn.integrable_indicator hs
theorem IntegrableOn.indicator (h : IntegrableOn f s μ) (ht : MeasurableSet t) :
IntegrableOn (indicator t f) s μ :=
Integrable.indicator h ht
theorem integrable_indicatorConstLp {E} [NormedAddCommGroup E] {p : ℝ≥0∞} {s : Set α}
(hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
Integrable (indicatorConstLp p hs hμs c) μ := by
rw [integrable_congr indicatorConstLp_coeFn, integrable_indicator_iff hs, IntegrableOn,
integrable_const_iff, lt_top_iff_ne_top]
right
simpa only [Set.univ_inter, MeasurableSet.univ, Measure.restrict_apply] using hμs
/-- If a function is integrable on a set `s` and nonzero there, then the measurable hull of `s` is
well behaved: the restriction of the measure to `toMeasurable μ s` coincides with its restriction
to `s`. -/
theorem IntegrableOn.restrict_toMeasurable (hf : IntegrableOn f s μ) (h's : ∀ x ∈ s, f x ≠ 0) :
μ.restrict (toMeasurable μ s) = μ.restrict s := by
rcases exists_seq_strictAnti_tendsto (0 : ℝ) with ⟨u, _, u_pos, u_lim⟩
let v n := toMeasurable (μ.restrict s) { x | u n ≤ ‖f x‖ }
have A : ∀ n, μ (s ∩ v n) ≠ ∞ := by
intro n
rw [inter_comm, ← Measure.restrict_apply (measurableSet_toMeasurable _ _),
measure_toMeasurable]
exact (hf.measure_norm_ge_lt_top (u_pos n)).ne
apply Measure.restrict_toMeasurable_of_cover _ A
intro x hx
have : 0 < ‖f x‖ := by simp only [h's x hx, norm_pos_iff, Ne, not_false_iff]
obtain ⟨n, hn⟩ : ∃ n, u n < ‖f x‖ := ((tendsto_order.1 u_lim).2 _ this).exists
exact mem_iUnion.2 ⟨n, subset_toMeasurable _ _ hn.le⟩
/-- If a function is integrable on a set `s`, and vanishes on `t \ s`, then it is integrable on `t`
if `t` is null-measurable. -/
theorem IntegrableOn.of_ae_diff_eq_zero (hf : IntegrableOn f s μ) (ht : NullMeasurableSet t μ)
(h't : ∀ᵐ x ∂μ, x ∈ t \ s → f x = 0) : IntegrableOn f t μ := by
let u := { x ∈ s | f x ≠ 0 }
have hu : IntegrableOn f u μ := hf.mono_set fun x hx => hx.1
let v := toMeasurable μ u
have A : IntegrableOn f v μ := by
rw [IntegrableOn, hu.restrict_toMeasurable]
· exact hu
· intro x hx; exact hx.2
have B : IntegrableOn f (t \ v) μ := by
apply integrableOn_zero.congr
filter_upwards [ae_restrict_of_ae h't,
ae_restrict_mem₀ (ht.diff (measurableSet_toMeasurable μ u).nullMeasurableSet)] with x hxt hx
by_cases h'x : x ∈ s
· by_contra H
exact hx.2 (subset_toMeasurable μ u ⟨h'x, Ne.symm H⟩)
· exact (hxt ⟨hx.1, h'x⟩).symm
apply (A.union B).mono_set _
rw [union_diff_self]
exact subset_union_right
/-- If a function is integrable on a set `s`, and vanishes on `t \ s`, then it is integrable on `t`
if `t` is measurable. -/
theorem IntegrableOn.of_forall_diff_eq_zero (hf : IntegrableOn f s μ) (ht : MeasurableSet t)
(h't : ∀ x ∈ t \ s, f x = 0) : IntegrableOn f t μ :=
hf.of_ae_diff_eq_zero ht.nullMeasurableSet (eventually_of_forall h't)
/-- If a function is integrable on a set `s` and vanishes almost everywhere on its complement,
then it is integrable. -/
theorem IntegrableOn.integrable_of_ae_not_mem_eq_zero (hf : IntegrableOn f s μ)
(h't : ∀ᵐ x ∂μ, x ∉ s → f x = 0) : Integrable f μ := by
rw [← integrableOn_univ]
apply hf.of_ae_diff_eq_zero nullMeasurableSet_univ
filter_upwards [h't] with x hx h'x using hx h'x.2
/-- If a function is integrable on a set `s` and vanishes everywhere on its complement,
then it is integrable. -/
theorem IntegrableOn.integrable_of_forall_not_mem_eq_zero (hf : IntegrableOn f s μ)
(h't : ∀ x, x ∉ s → f x = 0) : Integrable f μ :=
hf.integrable_of_ae_not_mem_eq_zero (eventually_of_forall fun x hx => h't x hx)
theorem integrableOn_iff_integrable_of_support_subset (h1s : support f ⊆ s) :
IntegrableOn f s μ ↔ Integrable f μ := by
refine ⟨fun h => ?_, fun h => h.integrableOn⟩
refine h.integrable_of_forall_not_mem_eq_zero fun x hx => ?_
contrapose! hx
exact h1s (mem_support.2 hx)
theorem integrableOn_Lp_of_measure_ne_top {E} [NormedAddCommGroup E] {p : ℝ≥0∞} {s : Set α}
(f : Lp E p μ) (hp : 1 ≤ p) (hμs : μ s ≠ ∞) : IntegrableOn f s μ := by
refine memℒp_one_iff_integrable.mp ?_
have hμ_restrict_univ : (μ.restrict s) Set.univ < ∞ := by
simpa only [Set.univ_inter, MeasurableSet.univ, Measure.restrict_apply, lt_top_iff_ne_top]
haveI hμ_finite : IsFiniteMeasure (μ.restrict s) := ⟨hμ_restrict_univ⟩
exact ((Lp.memℒp _).restrict s).memℒp_of_exponent_le hp
theorem Integrable.lintegral_lt_top {f : α → ℝ} (hf : Integrable f μ) :
(∫⁻ x, ENNReal.ofReal (f x) ∂μ) < ∞ :=
calc
(∫⁻ x, ENNReal.ofReal (f x) ∂μ) ≤ ∫⁻ x, ↑‖f x‖₊ ∂μ := lintegral_ofReal_le_lintegral_nnnorm f
_ < ∞ := hf.2
theorem IntegrableOn.setLIntegral_lt_top {f : α → ℝ} {s : Set α} (hf : IntegrableOn f s μ) :
(∫⁻ x in s, ENNReal.ofReal (f x) ∂μ) < ∞ :=
Integrable.lintegral_lt_top hf
@[deprecated (since := "2024-06-29")]
alias IntegrableOn.set_lintegral_lt_top := IntegrableOn.setLIntegral_lt_top
/-- We say that a function `f` is *integrable at filter* `l` if it is integrable on some
set `s ∈ l`. Equivalently, it is eventually integrable on `s` in `l.smallSets`. -/
def IntegrableAtFilter (f : α → E) (l : Filter α) (μ : Measure α := by volume_tac) :=
∃ s ∈ l, IntegrableOn f s μ
variable {l l' : Filter α}
theorem _root_.MeasurableEmbedding.integrableAtFilter_map_iff [MeasurableSpace β] {e : α → β}
(he : MeasurableEmbedding e) {f : β → E} :
IntegrableAtFilter f (l.map e) (μ.map e) ↔ IntegrableAtFilter (f ∘ e) l μ := by
simp_rw [IntegrableAtFilter, he.integrableOn_map_iff]
constructor <;> rintro ⟨s, hs⟩
· exact ⟨_, hs⟩
· exact ⟨e '' s, by rwa [mem_map, he.injective.preimage_image]⟩
theorem _root_.MeasurableEmbedding.integrableAtFilter_iff_comap [MeasurableSpace β] {e : α → β}
(he : MeasurableEmbedding e) {f : β → E} {μ : Measure β} :
IntegrableAtFilter f (l.map e) μ ↔ IntegrableAtFilter (f ∘ e) l (μ.comap e) := by
simp_rw [← he.integrableAtFilter_map_iff, IntegrableAtFilter, he.map_comap]
constructor <;> rintro ⟨s, hs, int⟩
· exact ⟨s, hs, int.mono_measure <| μ.restrict_le_self⟩
· exact ⟨_, inter_mem hs range_mem_map, int.inter_of_restrict⟩
theorem Integrable.integrableAtFilter (h : Integrable f μ) (l : Filter α) :
IntegrableAtFilter f l μ :=
⟨univ, Filter.univ_mem, integrableOn_univ.2 h⟩
protected theorem IntegrableAtFilter.eventually (h : IntegrableAtFilter f l μ) :
∀ᶠ s in l.smallSets, IntegrableOn f s μ :=
Iff.mpr (eventually_smallSets' fun _s _t hst ht => ht.mono_set hst) h
protected theorem IntegrableAtFilter.add {f g : α → E}
(hf : IntegrableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
IntegrableAtFilter (f + g) l μ := by
rcases hf with ⟨s, sl, hs⟩
rcases hg with ⟨t, tl, ht⟩
refine ⟨s ∩ t, inter_mem sl tl, ?_⟩
exact (hs.mono_set inter_subset_left).add (ht.mono_set inter_subset_right)
protected theorem IntegrableAtFilter.neg {f : α → E} (hf : IntegrableAtFilter f l μ) :
IntegrableAtFilter (-f) l μ := by
rcases hf with ⟨s, sl, hs⟩
exact ⟨s, sl, hs.neg⟩
protected theorem IntegrableAtFilter.sub {f g : α → E}
(hf : IntegrableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
IntegrableAtFilter (f - g) l μ := by
rw [sub_eq_add_neg]
exact hf.add hg.neg
protected theorem IntegrableAtFilter.smul {𝕜 : Type*} [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 E]
[BoundedSMul 𝕜 E] {f : α → E} (hf : IntegrableAtFilter f l μ) (c : 𝕜) :
IntegrableAtFilter (c • f) l μ := by
rcases hf with ⟨s, sl, hs⟩
exact ⟨s, sl, hs.smul c⟩
protected theorem IntegrableAtFilter.norm (hf : IntegrableAtFilter f l μ) :
IntegrableAtFilter (fun x => ‖f x‖) l μ :=
Exists.casesOn hf fun s hs ↦ ⟨s, hs.1, hs.2.norm⟩
theorem IntegrableAtFilter.filter_mono (hl : l ≤ l') (hl' : IntegrableAtFilter f l' μ) :
IntegrableAtFilter f l μ :=
let ⟨s, hs, hsf⟩ := hl'
⟨s, hl hs, hsf⟩
theorem IntegrableAtFilter.inf_of_left (hl : IntegrableAtFilter f l μ) :
IntegrableAtFilter f (l ⊓ l') μ :=
hl.filter_mono inf_le_left
theorem IntegrableAtFilter.inf_of_right (hl : IntegrableAtFilter f l μ) :
IntegrableAtFilter f (l' ⊓ l) μ :=
hl.filter_mono inf_le_right
@[simp]
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
IntegrableAtFilter f (l ⊓ ae μ) μ ↔ IntegrableAtFilter f l μ := by
refine ⟨?_, fun h ↦ h.filter_mono inf_le_left⟩
rintro ⟨s, ⟨t, ht, u, hu, rfl⟩, hf⟩
refine ⟨t, ht, hf.congr_set_ae <| eventuallyEq_set.2 ?_⟩
filter_upwards [hu] with x hx using (and_iff_left hx).symm
alias ⟨IntegrableAtFilter.of_inf_ae, _⟩ := IntegrableAtFilter.inf_ae_iff
@[simp]
theorem integrableAtFilter_top : IntegrableAtFilter f ⊤ μ ↔ Integrable f μ := by
refine ⟨fun h ↦ ?_, fun h ↦ h.integrableAtFilter ⊤⟩
obtain ⟨s, hsf, hs⟩ := h
exact (integrableOn_iff_integrable_of_support_subset fun _ _ ↦ hsf _).mp hs
theorem IntegrableAtFilter.sup_iff {l l' : Filter α} :
IntegrableAtFilter f (l ⊔ l') μ ↔ IntegrableAtFilter f l μ ∧ IntegrableAtFilter f l' μ := by
constructor
· exact fun h => ⟨h.filter_mono le_sup_left, h.filter_mono le_sup_right⟩
· exact fun ⟨⟨s, hsl, hs⟩, ⟨t, htl, ht⟩⟩ ↦ ⟨s ∪ t, union_mem_sup hsl htl, hs.union ht⟩
/-- If `μ` is a measure finite at filter `l` and `f` is a function such that its norm is bounded
above at `l`, then `f` is integrable at `l`. -/
theorem Measure.FiniteAtFilter.integrableAtFilter {l : Filter α} [IsMeasurablyGenerated l]
(hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l)
(hf : l.IsBoundedUnder (· ≤ ·) (norm ∘ f)) : IntegrableAtFilter f l μ := by
obtain ⟨C, hC⟩ : ∃ C, ∀ᶠ s in l.smallSets, ∀ x ∈ s, ‖f x‖ ≤ C :=
hf.imp fun C hC => eventually_smallSets.2 ⟨_, hC, fun t => id⟩
rcases (hfm.eventually.and (hμ.eventually.and hC)).exists_measurable_mem_of_smallSets with
⟨s, hsl, hsm, hfm, hμ, hC⟩
refine ⟨s, hsl, ⟨hfm, hasFiniteIntegral_restrict_of_bounded hμ (C := C) ?_⟩⟩
rw [ae_restrict_eq hsm, eventually_inf_principal]
exact eventually_of_forall hC
theorem Measure.FiniteAtFilter.integrableAtFilter_of_tendsto_ae {l : Filter α}
[IsMeasurablyGenerated l] (hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l) {b}
(hf : Tendsto f (l ⊓ ae μ) (𝓝 b)) : IntegrableAtFilter f l μ :=
(hμ.inf_of_left.integrableAtFilter (hfm.filter_mono inf_le_left)
hf.norm.isBoundedUnder_le).of_inf_ae
alias _root_.Filter.Tendsto.integrableAtFilter_ae :=
Measure.FiniteAtFilter.integrableAtFilter_of_tendsto_ae
theorem Measure.FiniteAtFilter.integrableAtFilter_of_tendsto {l : Filter α}
[IsMeasurablyGenerated l] (hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l) {b}
(hf : Tendsto f l (𝓝 b)) : IntegrableAtFilter f l μ :=
hμ.integrableAtFilter hfm hf.norm.isBoundedUnder_le
alias _root_.Filter.Tendsto.integrableAtFilter :=
Measure.FiniteAtFilter.integrableAtFilter_of_tendsto
lemma Measure.integrableOn_of_bounded (s_finite : μ s ≠ ∞) (f_mble : AEStronglyMeasurable f μ)
{M : ℝ} (f_bdd : ∀ᵐ a ∂(μ.restrict s), ‖f a‖ ≤ M) :
IntegrableOn f s μ :=
⟨f_mble.restrict, hasFiniteIntegral_restrict_of_bounded (C := M) s_finite.lt_top f_bdd⟩
theorem integrable_add_of_disjoint {f g : α → E} (h : Disjoint (support f) (support g))
(hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ := by
refine ⟨fun hfg => ⟨?_, ?_⟩, fun h => h.1.add h.2⟩
· rw [← indicator_add_eq_left h]; exact hfg.indicator hf.measurableSet_support
· rw [← indicator_add_eq_right h]; exact hfg.indicator hg.measurableSet_support
/-- If a function converges along a filter to a limit `a`, is integrable along this filter, and
all elements of the filter have infinite measure, then the limit has to vanish. -/
lemma IntegrableAtFilter.eq_zero_of_tendsto
(h : IntegrableAtFilter f l μ) (h' : ∀ s ∈ l, μ s = ∞) {a : E}
(hf : Tendsto f l (𝓝 a)) : a = 0 := by
by_contra H
obtain ⟨ε, εpos, hε⟩ : ∃ (ε : ℝ), 0 < ε ∧ ε < ‖a‖ := exists_between (norm_pos_iff'.mpr H)
rcases h with ⟨u, ul, hu⟩
let v := u ∩ {b | ε < ‖f b‖}
have hv : IntegrableOn f v μ := hu.mono_set inter_subset_left
have vl : v ∈ l := inter_mem ul ((tendsto_order.1 hf.norm).1 _ hε)
have : μ.restrict v v < ∞ := lt_of_le_of_lt (measure_mono inter_subset_right)
(Integrable.measure_gt_lt_top hv.norm εpos)
have : μ v ≠ ∞ := ne_of_lt (by simpa only [Measure.restrict_apply_self])
exact this (h' v vl)
end NormedAddCommGroup
end MeasureTheory
open MeasureTheory
variable [NormedAddCommGroup E]
/-- A function which is continuous on a set `s` is almost everywhere measurable with respect to
`μ.restrict s`. -/
theorem ContinuousOn.aemeasurable [TopologicalSpace α] [OpensMeasurableSpace α] [MeasurableSpace β]
[TopologicalSpace β] [BorelSpace β] {f : α → β} {s : Set α} {μ : Measure α}
(hf : ContinuousOn f s) (hs : MeasurableSet s) : AEMeasurable f (μ.restrict s) := by
classical
nontriviality α; inhabit α
have : (Set.piecewise s f fun _ => f default) =ᵐ[μ.restrict s] f := piecewise_ae_eq_restrict hs
refine ⟨Set.piecewise s f fun _ => f default, ?_, this.symm⟩
apply measurable_of_isOpen
intro t ht
obtain ⟨u, u_open, hu⟩ : ∃ u : Set α, IsOpen u ∧ f ⁻¹' t ∩ s = u ∩ s :=
_root_.continuousOn_iff'.1 hf t ht
rw [piecewise_preimage, Set.ite, hu]
exact (u_open.measurableSet.inter hs).union ((measurable_const ht.measurableSet).diff hs)
/-- A function which is continuous on a separable set `s` is almost everywhere strongly measurable
with respect to `μ.restrict s`. -/
theorem ContinuousOn.aestronglyMeasurable_of_isSeparable [TopologicalSpace α]
[PseudoMetrizableSpace α] [OpensMeasurableSpace α] [TopologicalSpace β]
[PseudoMetrizableSpace β] {f : α → β} {s : Set α} {μ : Measure α} (hf : ContinuousOn f s)
(hs : MeasurableSet s) (h's : TopologicalSpace.IsSeparable s) :
AEStronglyMeasurable f (μ.restrict s) := by
letI := pseudoMetrizableSpacePseudoMetric α
borelize β
rw [aestronglyMeasurable_iff_aemeasurable_separable]
refine ⟨hf.aemeasurable hs, f '' s, hf.isSeparable_image h's, ?_⟩
exact mem_of_superset (self_mem_ae_restrict hs) (subset_preimage_image _ _)
/-- A function which is continuous on a set `s` is almost everywhere strongly measurable with
respect to `μ.restrict s` when either the source space or the target space is second-countable. -/
theorem ContinuousOn.aestronglyMeasurable [TopologicalSpace α] [TopologicalSpace β]
[h : SecondCountableTopologyEither α β] [OpensMeasurableSpace α] [PseudoMetrizableSpace β]
{f : α → β} {s : Set α} {μ : Measure α} (hf : ContinuousOn f s) (hs : MeasurableSet s) :
AEStronglyMeasurable f (μ.restrict s) := by
borelize β
refine
aestronglyMeasurable_iff_aemeasurable_separable.2
⟨hf.aemeasurable hs, f '' s, ?_,
mem_of_superset (self_mem_ae_restrict hs) (subset_preimage_image _ _)⟩
cases h.out
· rw [image_eq_range]
exact isSeparable_range <| continuousOn_iff_continuous_restrict.1 hf
· exact .of_separableSpace _
/-- A function which is continuous on a compact set `s` is almost everywhere strongly measurable
with respect to `μ.restrict s`. -/
theorem ContinuousOn.aestronglyMeasurable_of_isCompact [TopologicalSpace α] [OpensMeasurableSpace α]
[TopologicalSpace β] [PseudoMetrizableSpace β] {f : α → β} {s : Set α} {μ : Measure α}
(hf : ContinuousOn f s) (hs : IsCompact s) (h's : MeasurableSet s) :
AEStronglyMeasurable f (μ.restrict s) := by
letI := pseudoMetrizableSpacePseudoMetric β
borelize β
rw [aestronglyMeasurable_iff_aemeasurable_separable]
refine ⟨hf.aemeasurable h's, f '' s, ?_, ?_⟩
· exact (hs.image_of_continuousOn hf).isSeparable
· exact mem_of_superset (self_mem_ae_restrict h's) (subset_preimage_image _ _)
theorem ContinuousOn.integrableAt_nhdsWithin_of_isSeparable [TopologicalSpace α]
[PseudoMetrizableSpace α] [OpensMeasurableSpace α] {μ : Measure α} [IsLocallyFiniteMeasure μ]
{a : α} {t : Set α} {f : α → E} (hft : ContinuousOn f t) (ht : MeasurableSet t)
(h't : TopologicalSpace.IsSeparable t) (ha : a ∈ t) : IntegrableAtFilter f (𝓝[t] a) μ :=
haveI : (𝓝[t] a).IsMeasurablyGenerated := ht.nhdsWithin_isMeasurablyGenerated _
(hft a ha).integrableAtFilter
⟨_, self_mem_nhdsWithin, hft.aestronglyMeasurable_of_isSeparable ht h't⟩
(μ.finiteAt_nhdsWithin _ _)
theorem ContinuousOn.integrableAt_nhdsWithin [TopologicalSpace α]
[SecondCountableTopologyEither α E] [OpensMeasurableSpace α] {μ : Measure α}
[IsLocallyFiniteMeasure μ] {a : α} {t : Set α} {f : α → E} (hft : ContinuousOn f t)
(ht : MeasurableSet t) (ha : a ∈ t) : IntegrableAtFilter f (𝓝[t] a) μ :=
haveI : (𝓝[t] a).IsMeasurablyGenerated := ht.nhdsWithin_isMeasurablyGenerated _
(hft a ha).integrableAtFilter ⟨_, self_mem_nhdsWithin, hft.aestronglyMeasurable ht⟩
(μ.finiteAt_nhdsWithin _ _)
theorem Continuous.integrableAt_nhds [TopologicalSpace α] [SecondCountableTopologyEither α E]
[OpensMeasurableSpace α] {μ : Measure α} [IsLocallyFiniteMeasure μ] {f : α → E}
(hf : Continuous f) (a : α) : IntegrableAtFilter f (𝓝 a) μ := by
rw [← nhdsWithin_univ]
exact hf.continuousOn.integrableAt_nhdsWithin MeasurableSet.univ (mem_univ a)
/-- If a function is continuous on an open set `s`, then it is strongly measurable at the filter
`𝓝 x` for all `x ∈ s` if either the source space or the target space is second-countable. -/
theorem ContinuousOn.stronglyMeasurableAtFilter [TopologicalSpace α] [OpensMeasurableSpace α]
[TopologicalSpace β] [PseudoMetrizableSpace β] [SecondCountableTopologyEither α β] {f : α → β}
{s : Set α} {μ : Measure α} (hs : IsOpen s) (hf : ContinuousOn f s) :
∀ x ∈ s, StronglyMeasurableAtFilter f (𝓝 x) μ := fun _x hx =>
⟨s, IsOpen.mem_nhds hs hx, hf.aestronglyMeasurable hs.measurableSet⟩
theorem ContinuousAt.stronglyMeasurableAtFilter [TopologicalSpace α] [OpensMeasurableSpace α]
[SecondCountableTopologyEither α E] {f : α → E} {s : Set α} {μ : Measure α} (hs : IsOpen s)
(hf : ∀ x ∈ s, ContinuousAt f x) : ∀ x ∈ s, StronglyMeasurableAtFilter f (𝓝 x) μ :=
ContinuousOn.stronglyMeasurableAtFilter hs <| ContinuousAt.continuousOn hf
theorem Continuous.stronglyMeasurableAtFilter [TopologicalSpace α] [OpensMeasurableSpace α]
[TopologicalSpace β] [PseudoMetrizableSpace β] [SecondCountableTopologyEither α β] {f : α → β}
(hf : Continuous f) (μ : Measure α) (l : Filter α) : StronglyMeasurableAtFilter f l μ :=
hf.stronglyMeasurable.stronglyMeasurableAtFilter
/-- If a function is continuous on a measurable set `s`, then it is measurable at the filter
`𝓝[s] x` for all `x`. -/
theorem ContinuousOn.stronglyMeasurableAtFilter_nhdsWithin {α β : Type*} [MeasurableSpace α]
[TopologicalSpace α] [OpensMeasurableSpace α] [TopologicalSpace β] [PseudoMetrizableSpace β]
[SecondCountableTopologyEither α β] {f : α → β} {s : Set α} {μ : Measure α}
(hf : ContinuousOn f s) (hs : MeasurableSet s) (x : α) :
StronglyMeasurableAtFilter f (𝓝[s] x) μ :=
⟨s, self_mem_nhdsWithin, hf.aestronglyMeasurable hs⟩
/-! ### Lemmas about adding and removing interval boundaries
The primed lemmas take explicit arguments about the measure being finite at the endpoint, while
the unprimed ones use `[NoAtoms μ]`.
-/
section PartialOrder
variable [PartialOrder α] [MeasurableSingletonClass α] {f : α → E} {μ : Measure α} {a b : α}
theorem integrableOn_Icc_iff_integrableOn_Ioc' (ha : μ {a} ≠ ∞) :
IntegrableOn f (Icc a b) μ ↔ IntegrableOn f (Ioc a b) μ := by
by_cases hab : a ≤ b
· rw [← Ioc_union_left hab, integrableOn_union,
eq_true (integrableOn_singleton_iff.mpr <| Or.inr ha.lt_top), and_true_iff]
· rw [Icc_eq_empty hab, Ioc_eq_empty]
contrapose! hab
exact hab.le
theorem integrableOn_Icc_iff_integrableOn_Ico' (hb : μ {b} ≠ ∞) :
IntegrableOn f (Icc a b) μ ↔ IntegrableOn f (Ico a b) μ := by
by_cases hab : a ≤ b
· rw [← Ico_union_right hab, integrableOn_union,
eq_true (integrableOn_singleton_iff.mpr <| Or.inr hb.lt_top), and_true_iff]
· rw [Icc_eq_empty hab, Ico_eq_empty]
contrapose! hab
exact hab.le
theorem integrableOn_Ico_iff_integrableOn_Ioo' (ha : μ {a} ≠ ∞) :
IntegrableOn f (Ico a b) μ ↔ IntegrableOn f (Ioo a b) μ := by
by_cases hab : a < b
· rw [← Ioo_union_left hab, integrableOn_union,
eq_true (integrableOn_singleton_iff.mpr <| Or.inr ha.lt_top), and_true_iff]
· rw [Ioo_eq_empty hab, Ico_eq_empty hab]
theorem integrableOn_Ioc_iff_integrableOn_Ioo' (hb : μ {b} ≠ ∞) :
IntegrableOn f (Ioc a b) μ ↔ IntegrableOn f (Ioo a b) μ := by
by_cases hab : a < b
· rw [← Ioo_union_right hab, integrableOn_union,
eq_true (integrableOn_singleton_iff.mpr <| Or.inr hb.lt_top), and_true_iff]
· rw [Ioo_eq_empty hab, Ioc_eq_empty hab]
theorem integrableOn_Icc_iff_integrableOn_Ioo' (ha : μ {a} ≠ ∞) (hb : μ {b} ≠ ∞) :
IntegrableOn f (Icc a b) μ ↔ IntegrableOn f (Ioo a b) μ := by
rw [integrableOn_Icc_iff_integrableOn_Ioc' ha, integrableOn_Ioc_iff_integrableOn_Ioo' hb]
theorem integrableOn_Ici_iff_integrableOn_Ioi' (hb : μ {b} ≠ ∞) :
IntegrableOn f (Ici b) μ ↔ IntegrableOn f (Ioi b) μ := by
rw [← Ioi_union_left, integrableOn_union,
eq_true (integrableOn_singleton_iff.mpr <| Or.inr hb.lt_top), and_true_iff]
theorem integrableOn_Iic_iff_integrableOn_Iio' (hb : μ {b} ≠ ∞) :
IntegrableOn f (Iic b) μ ↔ IntegrableOn f (Iio b) μ := by
rw [← Iio_union_right, integrableOn_union,
eq_true (integrableOn_singleton_iff.mpr <| Or.inr hb.lt_top), and_true_iff]
variable [NoAtoms μ]
theorem integrableOn_Icc_iff_integrableOn_Ioc :
IntegrableOn f (Icc a b) μ ↔ IntegrableOn f (Ioc a b) μ :=
integrableOn_Icc_iff_integrableOn_Ioc' (by rw [measure_singleton]; exact ENNReal.zero_ne_top)
theorem integrableOn_Icc_iff_integrableOn_Ico :
IntegrableOn f (Icc a b) μ ↔ IntegrableOn f (Ico a b) μ :=
integrableOn_Icc_iff_integrableOn_Ico' (by rw [measure_singleton]; exact ENNReal.zero_ne_top)
theorem integrableOn_Ico_iff_integrableOn_Ioo :
IntegrableOn f (Ico a b) μ ↔ IntegrableOn f (Ioo a b) μ :=
integrableOn_Ico_iff_integrableOn_Ioo' (by rw [measure_singleton]; exact ENNReal.zero_ne_top)
theorem integrableOn_Ioc_iff_integrableOn_Ioo :
IntegrableOn f (Ioc a b) μ ↔ IntegrableOn f (Ioo a b) μ :=
integrableOn_Ioc_iff_integrableOn_Ioo' (by rw [measure_singleton]; exact ENNReal.zero_ne_top)
theorem integrableOn_Icc_iff_integrableOn_Ioo :
IntegrableOn f (Icc a b) μ ↔ IntegrableOn f (Ioo a b) μ := by
rw [integrableOn_Icc_iff_integrableOn_Ioc, integrableOn_Ioc_iff_integrableOn_Ioo]
theorem integrableOn_Ici_iff_integrableOn_Ioi :
IntegrableOn f (Ici b) μ ↔ IntegrableOn f (Ioi b) μ :=
integrableOn_Ici_iff_integrableOn_Ioi' (by rw [measure_singleton]; exact ENNReal.zero_ne_top)
theorem integrableOn_Iic_iff_integrableOn_Iio :
IntegrableOn f (Iic b) μ ↔ IntegrableOn f (Iio b) μ :=
integrableOn_Iic_iff_integrableOn_Iio' (by rw [measure_singleton]; exact ENNReal.zero_ne_top)
end PartialOrder
|
MeasureTheory\Integral\IntegralEqImproper.lean | /-
Copyright (c) 2021 Anatole Dedecker. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anatole Dedecker, Bhavik Mehta
-/
import Mathlib.Analysis.Calculus.Deriv.Support
import Mathlib.Analysis.SpecialFunctions.Pow.Deriv
import Mathlib.MeasureTheory.Integral.FundThmCalculus
import Mathlib.Order.Filter.AtTopBot
import Mathlib.MeasureTheory.Function.Jacobian
import Mathlib.MeasureTheory.Measure.Haar.NormedSpace
import Mathlib.MeasureTheory.Measure.Haar.Unique
/-!
# Links between an integral and its "improper" version
In its current state, mathlib only knows how to talk about definite ("proper") integrals,
in the sense that it treats integrals over `[x, +∞)` the same as it treats integrals over
`[y, z]`. For example, the integral over `[1, +∞)` is **not** defined to be the limit of
the integral over `[1, x]` as `x` tends to `+∞`, which is known as an **improper integral**.
Indeed, the "proper" definition is stronger than the "improper" one. The usual counterexample
is `x ↦ sin(x)/x`, which has an improper integral over `[1, +∞)` but no definite integral.
Although definite integrals have better properties, they are hardly usable when it comes to
computing integrals on unbounded sets, which is much easier using limits. Thus, in this file,
we prove various ways of studying the proper integral by studying the improper one.
## Definitions
The main definition of this file is `MeasureTheory.AECover`. It is a rather technical definition
whose sole purpose is generalizing and factoring proofs. Given an index type `ι`, a countably
generated filter `l` over `ι`, and an `ι`-indexed family `φ` of subsets of a measurable space `α`
equipped with a measure `μ`, one should think of a hypothesis `hφ : MeasureTheory.AECover μ l φ` as
a sufficient condition for being able to interpret `∫ x, f x ∂μ` (if it exists) as the limit of `∫ x
in φ i, f x ∂μ` as `i` tends to `l`.
When using this definition with a measure restricted to a set `s`, which happens fairly often, one
should not try too hard to use a `MeasureTheory.AECover` of subsets of `s`, as it often makes proofs
more complicated than necessary. See for example the proof of
`MeasureTheory.integrableOn_Iic_of_intervalIntegral_norm_tendsto` where we use `(fun x ↦ oi x)` as a
`MeasureTheory.AECover` w.r.t. `μ.restrict (Iic b)`, instead of using `(fun x ↦ Ioc x b)`.
## Main statements
- `MeasureTheory.AECover.lintegral_tendsto_of_countably_generated` : if `φ` is a
`MeasureTheory.AECover μ l`, where `l` is a countably generated filter, and if `f` is a measurable
`ENNReal`-valued function, then `∫⁻ x in φ n, f x ∂μ` tends to `∫⁻ x, f x ∂μ` as `n` tends to `l`
- `MeasureTheory.AECover.integrable_of_integral_norm_tendsto` : if `φ` is a
`MeasureTheory.AECover μ l`, where `l` is a countably generated filter, if `f` is measurable and
integrable on each `φ n`, and if `∫ x in φ n, ‖f x‖ ∂μ` tends to some `I : ℝ` as n tends to `l`,
then `f` is integrable
- `MeasureTheory.AECover.integral_tendsto_of_countably_generated` : if `φ` is a
`MeasureTheory.AECover μ l`, where `l` is a countably generated filter, and if `f` is measurable
and integrable (globally), then `∫ x in φ n, f x ∂μ` tends to `∫ x, f x ∂μ` as `n` tends to `+∞`.
We then specialize these lemmas to various use cases involving intervals, which are frequent
in analysis. In particular,
- `MeasureTheory.integral_Ioi_of_hasDerivAt_of_tendsto` is a version of FTC-2 on the interval
`(a, +∞)`, giving the formula `∫ x in (a, +∞), g' x = l - g a` if `g'` is integrable and
`g` tends to `l` at `+∞`.
- `MeasureTheory.integral_Ioi_of_hasDerivAt_of_nonneg` gives the same result assuming that
`g'` is nonnegative instead of integrable. Its automatic integrability in this context is proved
in `MeasureTheory.integrableOn_Ioi_deriv_of_nonneg`.
- `MeasureTheory.integral_comp_smul_deriv_Ioi` is a version of the change of variables formula
on semi-infinite intervals.
- `MeasureTheory.tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi` shows that a function whose
derivative is integrable on `(a, +∞)` has a limit at `+∞`.
- `MeasureTheory.tendsto_zero_of_hasDerivAt_of_integrableOn_Ioi` shows that an integrable function
whose derivative is integrable on `(a, +∞)` tends to `0` at `+∞`.
Versions of these results are also given on the intervals `(-∞, a]` and `(-∞, +∞)`, as well as
the corresponding versions of integration by parts.
-/
open MeasureTheory Filter Set TopologicalSpace
open scoped ENNReal NNReal Topology
namespace MeasureTheory
section AECover
variable {α ι : Type*} [MeasurableSpace α] (μ : Measure α) (l : Filter ι)
/-- A sequence `φ` of subsets of `α` is a `MeasureTheory.AECover` w.r.t. a measure `μ` and a filter
`l` if almost every point (w.r.t. `μ`) of `α` eventually belongs to `φ n` (w.r.t. `l`), and if
each `φ n` is measurable. This definition is a technical way to avoid duplicating a lot of
proofs. It should be thought of as a sufficient condition for being able to interpret
`∫ x, f x ∂μ` (if it exists) as the limit of `∫ x in φ n, f x ∂μ` as `n` tends to `l`.
See for example `MeasureTheory.AECover.lintegral_tendsto_of_countably_generated`,
`MeasureTheory.AECover.integrable_of_integral_norm_tendsto` and
`MeasureTheory.AECover.integral_tendsto_of_countably_generated`. -/
structure AECover (φ : ι → Set α) : Prop where
ae_eventually_mem : ∀ᵐ x ∂μ, ∀ᶠ i in l, x ∈ φ i
protected measurableSet : ∀ i, MeasurableSet <| φ i
variable {μ} {l}
namespace AECover
/-!
## Operations on `AECover`s
Porting note: this is a new section.
-/
/-- Elementwise intersection of two `AECover`s is an `AECover`. -/
theorem inter {φ ψ : ι → Set α} (hφ : AECover μ l φ) (hψ : AECover μ l ψ) :
AECover μ l (fun i ↦ φ i ∩ ψ i) where
ae_eventually_mem := hψ.1.mp <| hφ.1.mono fun _ ↦ Eventually.and
measurableSet _ := (hφ.2 _).inter (hψ.2 _)
theorem superset {φ ψ : ι → Set α} (hφ : AECover μ l φ) (hsub : ∀ i, φ i ⊆ ψ i)
(hmeas : ∀ i, MeasurableSet (ψ i)) : AECover μ l ψ :=
⟨hφ.1.mono fun _x hx ↦ hx.mono fun i hi ↦ hsub i hi, hmeas⟩
theorem mono_ac {ν : Measure α} {φ : ι → Set α} (hφ : AECover μ l φ) (hle : ν ≪ μ) :
AECover ν l φ := ⟨hle hφ.1, hφ.2⟩
theorem mono {ν : Measure α} {φ : ι → Set α} (hφ : AECover μ l φ) (hle : ν ≤ μ) :
AECover ν l φ := hφ.mono_ac hle.absolutelyContinuous
end AECover
section MetricSpace
variable [PseudoMetricSpace α] [OpensMeasurableSpace α]
theorem aecover_ball {x : α} {r : ι → ℝ} (hr : Tendsto r l atTop) :
AECover μ l (fun i ↦ Metric.ball x (r i)) where
measurableSet _ := Metric.isOpen_ball.measurableSet
ae_eventually_mem := by
filter_upwards with y
filter_upwards [hr (Ioi_mem_atTop (dist x y))] with a ha using by simpa [dist_comm] using ha
theorem aecover_closedBall {x : α} {r : ι → ℝ} (hr : Tendsto r l atTop) :
AECover μ l (fun i ↦ Metric.closedBall x (r i)) where
measurableSet _ := Metric.isClosed_ball.measurableSet
ae_eventually_mem := by
filter_upwards with y
filter_upwards [hr (Ici_mem_atTop (dist x y))] with a ha using by simpa [dist_comm] using ha
end MetricSpace
section Preorderα
variable [Preorder α] [TopologicalSpace α] [OrderClosedTopology α] [OpensMeasurableSpace α]
{a b : ι → α} (ha : Tendsto a l atBot) (hb : Tendsto b l atTop)
theorem aecover_Ici : AECover μ l fun i => Ici (a i) where
ae_eventually_mem := ae_of_all μ ha.eventually_le_atBot
measurableSet _ := measurableSet_Ici
theorem aecover_Iic : AECover μ l fun i => Iic <| b i := aecover_Ici (α := αᵒᵈ) hb
theorem aecover_Icc : AECover μ l fun i => Icc (a i) (b i) :=
(aecover_Ici ha).inter (aecover_Iic hb)
end Preorderα
section LinearOrderα
variable [LinearOrder α] [TopologicalSpace α] [OrderClosedTopology α] [OpensMeasurableSpace α]
{a b : ι → α} (ha : Tendsto a l atBot) (hb : Tendsto b l atTop)
theorem aecover_Ioi [NoMinOrder α] : AECover μ l fun i => Ioi (a i) where
ae_eventually_mem := ae_of_all μ ha.eventually_lt_atBot
measurableSet _ := measurableSet_Ioi
theorem aecover_Iio [NoMaxOrder α] : AECover μ l fun i => Iio (b i) := aecover_Ioi (α := αᵒᵈ) hb
theorem aecover_Ioo [NoMinOrder α] [NoMaxOrder α] : AECover μ l fun i => Ioo (a i) (b i) :=
(aecover_Ioi ha).inter (aecover_Iio hb)
theorem aecover_Ioc [NoMinOrder α] : AECover μ l fun i => Ioc (a i) (b i) :=
(aecover_Ioi ha).inter (aecover_Iic hb)
theorem aecover_Ico [NoMaxOrder α] : AECover μ l fun i => Ico (a i) (b i) :=
(aecover_Ici ha).inter (aecover_Iio hb)
end LinearOrderα
section FiniteIntervals
variable [LinearOrder α] [TopologicalSpace α] [OrderClosedTopology α] [OpensMeasurableSpace α]
{a b : ι → α} {A B : α} (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B))
theorem aecover_Ioi_of_Ioi : AECover (μ.restrict (Ioi A)) l fun i ↦ Ioi (a i) where
ae_eventually_mem := (ae_restrict_mem measurableSet_Ioi).mono fun _x hx ↦ ha.eventually <|
eventually_lt_nhds hx
measurableSet _ := measurableSet_Ioi
theorem aecover_Iio_of_Iio : AECover (μ.restrict (Iio B)) l fun i ↦ Iio (b i) :=
aecover_Ioi_of_Ioi (α := αᵒᵈ) hb
theorem aecover_Ioi_of_Ici : AECover (μ.restrict (Ioi A)) l fun i ↦ Ici (a i) :=
(aecover_Ioi_of_Ioi ha).superset (fun _ ↦ Ioi_subset_Ici_self) fun _ ↦ measurableSet_Ici
theorem aecover_Iio_of_Iic : AECover (μ.restrict (Iio B)) l fun i ↦ Iic (b i) :=
aecover_Ioi_of_Ici (α := αᵒᵈ) hb
theorem aecover_Ioo_of_Ioo : AECover (μ.restrict <| Ioo A B) l fun i => Ioo (a i) (b i) :=
((aecover_Ioi_of_Ioi ha).mono <| Measure.restrict_mono Ioo_subset_Ioi_self le_rfl).inter
((aecover_Iio_of_Iio hb).mono <| Measure.restrict_mono Ioo_subset_Iio_self le_rfl)
theorem aecover_Ioo_of_Icc : AECover (μ.restrict <| Ioo A B) l fun i => Icc (a i) (b i) :=
(aecover_Ioo_of_Ioo ha hb).superset (fun _ ↦ Ioo_subset_Icc_self) fun _ ↦ measurableSet_Icc
theorem aecover_Ioo_of_Ico : AECover (μ.restrict <| Ioo A B) l fun i => Ico (a i) (b i) :=
(aecover_Ioo_of_Ioo ha hb).superset (fun _ ↦ Ioo_subset_Ico_self) fun _ ↦ measurableSet_Ico
theorem aecover_Ioo_of_Ioc : AECover (μ.restrict <| Ioo A B) l fun i => Ioc (a i) (b i) :=
(aecover_Ioo_of_Ioo ha hb).superset (fun _ ↦ Ioo_subset_Ioc_self) fun _ ↦ measurableSet_Ioc
variable [NoAtoms μ]
theorem aecover_Ioc_of_Icc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Ioc A B) l fun i => Icc (a i) (b i) :=
(aecover_Ioo_of_Icc ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Ioc).ge
theorem aecover_Ioc_of_Ico (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Ioc A B) l fun i => Ico (a i) (b i) :=
(aecover_Ioo_of_Ico ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Ioc).ge
theorem aecover_Ioc_of_Ioc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Ioc A B) l fun i => Ioc (a i) (b i) :=
(aecover_Ioo_of_Ioc ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Ioc).ge
theorem aecover_Ioc_of_Ioo (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Ioc A B) l fun i => Ioo (a i) (b i) :=
(aecover_Ioo_of_Ioo ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Ioc).ge
theorem aecover_Ico_of_Icc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Ico A B) l fun i => Icc (a i) (b i) :=
(aecover_Ioo_of_Icc ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Ico).ge
theorem aecover_Ico_of_Ico (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Ico A B) l fun i => Ico (a i) (b i) :=
(aecover_Ioo_of_Ico ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Ico).ge
theorem aecover_Ico_of_Ioc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Ico A B) l fun i => Ioc (a i) (b i) :=
(aecover_Ioo_of_Ioc ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Ico).ge
theorem aecover_Ico_of_Ioo (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Ico A B) l fun i => Ioo (a i) (b i) :=
(aecover_Ioo_of_Ioo ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Ico).ge
theorem aecover_Icc_of_Icc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Icc A B) l fun i => Icc (a i) (b i) :=
(aecover_Ioo_of_Icc ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Icc).ge
theorem aecover_Icc_of_Ico (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Icc A B) l fun i => Ico (a i) (b i) :=
(aecover_Ioo_of_Ico ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Icc).ge
theorem aecover_Icc_of_Ioc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Icc A B) l fun i => Ioc (a i) (b i) :=
(aecover_Ioo_of_Ioc ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Icc).ge
theorem aecover_Icc_of_Ioo (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
AECover (μ.restrict <| Icc A B) l fun i => Ioo (a i) (b i) :=
(aecover_Ioo_of_Ioo ha hb).mono (Measure.restrict_congr_set Ioo_ae_eq_Icc).ge
end FiniteIntervals
protected theorem AECover.restrict {φ : ι → Set α} (hφ : AECover μ l φ) {s : Set α} :
AECover (μ.restrict s) l φ :=
hφ.mono Measure.restrict_le_self
theorem aecover_restrict_of_ae_imp {s : Set α} {φ : ι → Set α} (hs : MeasurableSet s)
(ae_eventually_mem : ∀ᵐ x ∂μ, x ∈ s → ∀ᶠ n in l, x ∈ φ n)
(measurable : ∀ n, MeasurableSet <| φ n) : AECover (μ.restrict s) l φ where
ae_eventually_mem := by rwa [ae_restrict_iff' hs]
measurableSet := measurable
theorem AECover.inter_restrict {φ : ι → Set α} (hφ : AECover μ l φ) {s : Set α}
(hs : MeasurableSet s) : AECover (μ.restrict s) l fun i => φ i ∩ s :=
aecover_restrict_of_ae_imp hs
(hφ.ae_eventually_mem.mono fun _x hx hxs => hx.mono fun _i hi => ⟨hi, hxs⟩) fun i =>
(hφ.measurableSet i).inter hs
theorem AECover.ae_tendsto_indicator {β : Type*} [Zero β] [TopologicalSpace β] (f : α → β)
{φ : ι → Set α} (hφ : AECover μ l φ) :
∀ᵐ x ∂μ, Tendsto (fun i => (φ i).indicator f x) l (𝓝 <| f x) :=
hφ.ae_eventually_mem.mono fun _x hx =>
tendsto_const_nhds.congr' <| hx.mono fun _n hn => (indicator_of_mem hn _).symm
theorem AECover.aemeasurable {β : Type*} [MeasurableSpace β] [l.IsCountablyGenerated] [l.NeBot]
{f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
(hfm : ∀ i, AEMeasurable f (μ.restrict <| φ i)) : AEMeasurable f μ := by
obtain ⟨u, hu⟩ := l.exists_seq_tendsto
have := aemeasurable_iUnion_iff.mpr fun n : ℕ => hfm (u n)
rwa [Measure.restrict_eq_self_of_ae_mem] at this
filter_upwards [hφ.ae_eventually_mem] with x hx using
mem_iUnion.mpr (hu.eventually hx).exists
theorem AECover.aestronglyMeasurable {β : Type*} [TopologicalSpace β] [PseudoMetrizableSpace β]
[l.IsCountablyGenerated] [l.NeBot] {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
(hfm : ∀ i, AEStronglyMeasurable f (μ.restrict <| φ i)) : AEStronglyMeasurable f μ := by
obtain ⟨u, hu⟩ := l.exists_seq_tendsto
have := aestronglyMeasurable_iUnion_iff.mpr fun n : ℕ => hfm (u n)
rwa [Measure.restrict_eq_self_of_ae_mem] at this
filter_upwards [hφ.ae_eventually_mem] with x hx using mem_iUnion.mpr (hu.eventually hx).exists
end AECover
theorem AECover.comp_tendsto {α ι ι' : Type*} [MeasurableSpace α] {μ : Measure α} {l : Filter ι}
{l' : Filter ι'} {φ : ι → Set α} (hφ : AECover μ l φ) {u : ι' → ι} (hu : Tendsto u l' l) :
AECover μ l' (φ ∘ u) where
ae_eventually_mem := hφ.ae_eventually_mem.mono fun _x hx => hu.eventually hx
measurableSet i := hφ.measurableSet (u i)
section AECoverUnionInterCountable
variable {α ι : Type*} [Countable ι] [MeasurableSpace α] {μ : Measure α}
theorem AECover.biUnion_Iic_aecover [Preorder ι] {φ : ι → Set α} (hφ : AECover μ atTop φ) :
AECover μ atTop fun n : ι => ⋃ (k) (_h : k ∈ Iic n), φ k :=
hφ.superset (fun _ ↦ subset_biUnion_of_mem right_mem_Iic) fun _ ↦ .biUnion (to_countable _)
fun _ _ ↦ (hφ.2 _)
-- Porting note: generalized from `[SemilatticeSup ι] [Nonempty ι]` to `[Preorder ι]`
theorem AECover.biInter_Ici_aecover [Preorder ι] {φ : ι → Set α}
(hφ : AECover μ atTop φ) : AECover μ atTop fun n : ι => ⋂ (k) (_h : k ∈ Ici n), φ k where
ae_eventually_mem := hφ.ae_eventually_mem.mono fun x h ↦ by
simpa only [mem_iInter, mem_Ici, eventually_forall_ge_atTop]
measurableSet i := .biInter (to_countable _) fun n _ => hφ.measurableSet n
end AECoverUnionInterCountable
section Lintegral
variable {α ι : Type*} [MeasurableSpace α] {μ : Measure α} {l : Filter ι}
private theorem lintegral_tendsto_of_monotone_of_nat {φ : ℕ → Set α} (hφ : AECover μ atTop φ)
(hmono : Monotone φ) {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) :
Tendsto (fun i => ∫⁻ x in φ i, f x ∂μ) atTop (𝓝 <| ∫⁻ x, f x ∂μ) :=
let F n := (φ n).indicator f
have key₁ : ∀ n, AEMeasurable (F n) μ := fun n => hfm.indicator (hφ.measurableSet n)
have key₂ : ∀ᵐ x : α ∂μ, Monotone fun n => F n x := ae_of_all _ fun x _i _j hij =>
indicator_le_indicator_of_subset (hmono hij) (fun x => zero_le <| f x) x
have key₃ : ∀ᵐ x : α ∂μ, Tendsto (fun n => F n x) atTop (𝓝 (f x)) := hφ.ae_tendsto_indicator f
(lintegral_tendsto_of_tendsto_of_monotone key₁ key₂ key₃).congr fun n =>
lintegral_indicator f (hφ.measurableSet n)
theorem AECover.lintegral_tendsto_of_nat {φ : ℕ → Set α} (hφ : AECover μ atTop φ) {f : α → ℝ≥0∞}
(hfm : AEMeasurable f μ) : Tendsto (∫⁻ x in φ ·, f x ∂μ) atTop (𝓝 <| ∫⁻ x, f x ∂μ) := by
have lim₁ := lintegral_tendsto_of_monotone_of_nat hφ.biInter_Ici_aecover
(fun i j hij => biInter_subset_biInter_left (Ici_subset_Ici.mpr hij)) hfm
have lim₂ := lintegral_tendsto_of_monotone_of_nat hφ.biUnion_Iic_aecover
(fun i j hij => biUnion_subset_biUnion_left (Iic_subset_Iic.mpr hij)) hfm
refine tendsto_of_tendsto_of_tendsto_of_le_of_le lim₁ lim₂ (fun n ↦ ?_) fun n ↦ ?_
exacts [lintegral_mono_set (biInter_subset_of_mem left_mem_Ici),
lintegral_mono_set (subset_biUnion_of_mem right_mem_Iic)]
theorem AECover.lintegral_tendsto_of_countably_generated [l.IsCountablyGenerated] {φ : ι → Set α}
(hφ : AECover μ l φ) {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) :
Tendsto (fun i => ∫⁻ x in φ i, f x ∂μ) l (𝓝 <| ∫⁻ x, f x ∂μ) :=
tendsto_of_seq_tendsto fun _u hu => (hφ.comp_tendsto hu).lintegral_tendsto_of_nat hfm
theorem AECover.lintegral_eq_of_tendsto [l.NeBot] [l.IsCountablyGenerated] {φ : ι → Set α}
(hφ : AECover μ l φ) {f : α → ℝ≥0∞} (I : ℝ≥0∞) (hfm : AEMeasurable f μ)
(htendsto : Tendsto (fun i => ∫⁻ x in φ i, f x ∂μ) l (𝓝 I)) : ∫⁻ x, f x ∂μ = I :=
tendsto_nhds_unique (hφ.lintegral_tendsto_of_countably_generated hfm) htendsto
theorem AECover.iSup_lintegral_eq_of_countably_generated [Nonempty ι] [l.NeBot]
[l.IsCountablyGenerated] {φ : ι → Set α} (hφ : AECover μ l φ) {f : α → ℝ≥0∞}
(hfm : AEMeasurable f μ) : ⨆ i : ι, ∫⁻ x in φ i, f x ∂μ = ∫⁻ x, f x ∂μ := by
have := hφ.lintegral_tendsto_of_countably_generated hfm
refine ciSup_eq_of_forall_le_of_forall_lt_exists_gt
(fun i => lintegral_mono' Measure.restrict_le_self le_rfl) fun w hw => ?_
rcases exists_between hw with ⟨m, hm₁, hm₂⟩
rcases (eventually_ge_of_tendsto_gt hm₂ this).exists with ⟨i, hi⟩
exact ⟨i, lt_of_lt_of_le hm₁ hi⟩
end Lintegral
section Integrable
variable {α ι E : Type*} [MeasurableSpace α] {μ : Measure α} {l : Filter ι} [NormedAddCommGroup E]
theorem AECover.integrable_of_lintegral_nnnorm_bounded [l.NeBot] [l.IsCountablyGenerated]
{φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ) (hfm : AEStronglyMeasurable f μ)
(hbounded : ∀ᶠ i in l, (∫⁻ x in φ i, ‖f x‖₊ ∂μ) ≤ ENNReal.ofReal I) : Integrable f μ := by
refine ⟨hfm, (le_of_tendsto ?_ hbounded).trans_lt ENNReal.ofReal_lt_top⟩
exact hφ.lintegral_tendsto_of_countably_generated hfm.ennnorm
theorem AECover.integrable_of_lintegral_nnnorm_tendsto [l.NeBot] [l.IsCountablyGenerated]
{φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ) (hfm : AEStronglyMeasurable f μ)
(htendsto : Tendsto (fun i => ∫⁻ x in φ i, ‖f x‖₊ ∂μ) l (𝓝 <| ENNReal.ofReal I)) :
Integrable f μ := by
refine hφ.integrable_of_lintegral_nnnorm_bounded (max 1 (I + 1)) hfm ?_
refine htendsto.eventually (ge_mem_nhds ?_)
refine (ENNReal.ofReal_lt_ofReal_iff (lt_max_of_lt_left zero_lt_one)).2 ?_
exact lt_max_of_lt_right (lt_add_one I)
theorem AECover.integrable_of_lintegral_nnnorm_bounded' [l.NeBot] [l.IsCountablyGenerated]
{φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ≥0) (hfm : AEStronglyMeasurable f μ)
(hbounded : ∀ᶠ i in l, (∫⁻ x in φ i, ‖f x‖₊ ∂μ) ≤ I) : Integrable f μ :=
hφ.integrable_of_lintegral_nnnorm_bounded I hfm
(by simpa only [ENNReal.ofReal_coe_nnreal] using hbounded)
theorem AECover.integrable_of_lintegral_nnnorm_tendsto' [l.NeBot] [l.IsCountablyGenerated]
{φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ≥0) (hfm : AEStronglyMeasurable f μ)
(htendsto : Tendsto (fun i => ∫⁻ x in φ i, ‖f x‖₊ ∂μ) l (𝓝 I)) : Integrable f μ :=
hφ.integrable_of_lintegral_nnnorm_tendsto I hfm
(by simpa only [ENNReal.ofReal_coe_nnreal] using htendsto)
theorem AECover.integrable_of_integral_norm_bounded [l.NeBot] [l.IsCountablyGenerated]
{φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ) (hfi : ∀ i, IntegrableOn f (φ i) μ)
(hbounded : ∀ᶠ i in l, (∫ x in φ i, ‖f x‖ ∂μ) ≤ I) : Integrable f μ := by
have hfm : AEStronglyMeasurable f μ :=
hφ.aestronglyMeasurable fun i => (hfi i).aestronglyMeasurable
refine hφ.integrable_of_lintegral_nnnorm_bounded I hfm ?_
conv at hbounded in integral _ _ =>
rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ fun x => @norm_nonneg E _ (f x))
hfm.norm.restrict]
conv at hbounded in ENNReal.ofReal _ =>
rw [← coe_nnnorm]
rw [ENNReal.ofReal_coe_nnreal]
refine hbounded.mono fun i hi => ?_
rw [← ENNReal.ofReal_toReal (ne_top_of_lt (hfi i).2)]
apply ENNReal.ofReal_le_ofReal hi
theorem AECover.integrable_of_integral_norm_tendsto [l.NeBot] [l.IsCountablyGenerated]
{φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ) (hfi : ∀ i, IntegrableOn f (φ i) μ)
(htendsto : Tendsto (fun i => ∫ x in φ i, ‖f x‖ ∂μ) l (𝓝 I)) : Integrable f μ :=
let ⟨I', hI'⟩ := htendsto.isBoundedUnder_le
hφ.integrable_of_integral_norm_bounded I' hfi hI'
theorem AECover.integrable_of_integral_bounded_of_nonneg_ae [l.NeBot] [l.IsCountablyGenerated]
{φ : ι → Set α} (hφ : AECover μ l φ) {f : α → ℝ} (I : ℝ) (hfi : ∀ i, IntegrableOn f (φ i) μ)
(hnng : ∀ᵐ x ∂μ, 0 ≤ f x) (hbounded : ∀ᶠ i in l, (∫ x in φ i, f x ∂μ) ≤ I) : Integrable f μ :=
hφ.integrable_of_integral_norm_bounded I hfi <| hbounded.mono fun _i hi =>
(integral_congr_ae <| ae_restrict_of_ae <| hnng.mono fun _ => Real.norm_of_nonneg).le.trans hi
theorem AECover.integrable_of_integral_tendsto_of_nonneg_ae [l.NeBot] [l.IsCountablyGenerated]
{φ : ι → Set α} (hφ : AECover μ l φ) {f : α → ℝ} (I : ℝ) (hfi : ∀ i, IntegrableOn f (φ i) μ)
(hnng : ∀ᵐ x ∂μ, 0 ≤ f x) (htendsto : Tendsto (fun i => ∫ x in φ i, f x ∂μ) l (𝓝 I)) :
Integrable f μ :=
let ⟨I', hI'⟩ := htendsto.isBoundedUnder_le
hφ.integrable_of_integral_bounded_of_nonneg_ae I' hfi hnng hI'
end Integrable
section Integral
variable {α ι E : Type*} [MeasurableSpace α] {μ : Measure α} {l : Filter ι} [NormedAddCommGroup E]
[NormedSpace ℝ E] [CompleteSpace E]
theorem AECover.integral_tendsto_of_countably_generated [l.IsCountablyGenerated] {φ : ι → Set α}
(hφ : AECover μ l φ) {f : α → E} (hfi : Integrable f μ) :
Tendsto (fun i => ∫ x in φ i, f x ∂μ) l (𝓝 <| ∫ x, f x ∂μ) :=
suffices h : Tendsto (fun i => ∫ x : α, (φ i).indicator f x ∂μ) l (𝓝 (∫ x : α, f x ∂μ)) from by
convert h using 2; rw [integral_indicator (hφ.measurableSet _)]
tendsto_integral_filter_of_dominated_convergence (fun x => ‖f x‖)
(eventually_of_forall fun i => hfi.aestronglyMeasurable.indicator <| hφ.measurableSet i)
(eventually_of_forall fun i => ae_of_all _ fun x => norm_indicator_le_norm_self _ _) hfi.norm
(hφ.ae_tendsto_indicator f)
/-- Slight reformulation of
`MeasureTheory.AECover.integral_tendsto_of_countably_generated`. -/
theorem AECover.integral_eq_of_tendsto [l.NeBot] [l.IsCountablyGenerated] {φ : ι → Set α}
(hφ : AECover μ l φ) {f : α → E} (I : E) (hfi : Integrable f μ)
(h : Tendsto (fun n => ∫ x in φ n, f x ∂μ) l (𝓝 I)) : ∫ x, f x ∂μ = I :=
tendsto_nhds_unique (hφ.integral_tendsto_of_countably_generated hfi) h
theorem AECover.integral_eq_of_tendsto_of_nonneg_ae [l.NeBot] [l.IsCountablyGenerated]
{φ : ι → Set α} (hφ : AECover μ l φ) {f : α → ℝ} (I : ℝ) (hnng : 0 ≤ᵐ[μ] f)
(hfi : ∀ n, IntegrableOn f (φ n) μ) (htendsto : Tendsto (fun n => ∫ x in φ n, f x ∂μ) l (𝓝 I)) :
∫ x, f x ∂μ = I :=
have hfi' : Integrable f μ := hφ.integrable_of_integral_tendsto_of_nonneg_ae I hfi hnng htendsto
hφ.integral_eq_of_tendsto I hfi' htendsto
end Integral
section IntegrableOfIntervalIntegral
variable {ι E : Type*} {μ : Measure ℝ} {l : Filter ι} [Filter.NeBot l] [IsCountablyGenerated l]
[NormedAddCommGroup E] {a b : ι → ℝ} {f : ℝ → E}
theorem integrable_of_intervalIntegral_norm_bounded (I : ℝ)
(hfi : ∀ i, IntegrableOn f (Ioc (a i) (b i)) μ) (ha : Tendsto a l atBot)
(hb : Tendsto b l atTop) (h : ∀ᶠ i in l, (∫ x in a i..b i, ‖f x‖ ∂μ) ≤ I) : Integrable f μ := by
have hφ : AECover μ l _ := aecover_Ioc ha hb
refine hφ.integrable_of_integral_norm_bounded I hfi (h.mp ?_)
filter_upwards [ha.eventually (eventually_le_atBot 0),
hb.eventually (eventually_ge_atTop 0)] with i hai hbi ht
rwa [← intervalIntegral.integral_of_le (hai.trans hbi)]
/-- If `f` is integrable on intervals `Ioc (a i) (b i)`,
where `a i` tends to -∞ and `b i` tends to ∞, and
`∫ x in a i .. b i, ‖f x‖ ∂μ` converges to `I : ℝ` along a filter `l`,
then `f` is integrable on the interval (-∞, ∞) -/
theorem integrable_of_intervalIntegral_norm_tendsto (I : ℝ)
(hfi : ∀ i, IntegrableOn f (Ioc (a i) (b i)) μ) (ha : Tendsto a l atBot)
(hb : Tendsto b l atTop) (h : Tendsto (fun i => ∫ x in a i..b i, ‖f x‖ ∂μ) l (𝓝 I)) :
Integrable f μ :=
let ⟨I', hI'⟩ := h.isBoundedUnder_le
integrable_of_intervalIntegral_norm_bounded I' hfi ha hb hI'
theorem integrableOn_Iic_of_intervalIntegral_norm_bounded (I b : ℝ)
(hfi : ∀ i, IntegrableOn f (Ioc (a i) b) μ) (ha : Tendsto a l atBot)
(h : ∀ᶠ i in l, (∫ x in a i..b, ‖f x‖ ∂μ) ≤ I) : IntegrableOn f (Iic b) μ := by
have hφ : AECover (μ.restrict <| Iic b) l _ := aecover_Ioi ha
have hfi : ∀ i, IntegrableOn f (Ioi (a i)) (μ.restrict <| Iic b) := by
intro i
rw [IntegrableOn, Measure.restrict_restrict (hφ.measurableSet i)]
exact hfi i
refine hφ.integrable_of_integral_norm_bounded I hfi (h.mp ?_)
filter_upwards [ha.eventually (eventually_le_atBot b)] with i hai
rw [intervalIntegral.integral_of_le hai, Measure.restrict_restrict (hφ.measurableSet i)]
exact id
/-- If `f` is integrable on intervals `Ioc (a i) b`,
where `a i` tends to -∞, and
`∫ x in a i .. b, ‖f x‖ ∂μ` converges to `I : ℝ` along a filter `l`,
then `f` is integrable on the interval (-∞, b) -/
theorem integrableOn_Iic_of_intervalIntegral_norm_tendsto (I b : ℝ)
(hfi : ∀ i, IntegrableOn f (Ioc (a i) b) μ) (ha : Tendsto a l atBot)
(h : Tendsto (fun i => ∫ x in a i..b, ‖f x‖ ∂μ) l (𝓝 I)) : IntegrableOn f (Iic b) μ :=
let ⟨I', hI'⟩ := h.isBoundedUnder_le
integrableOn_Iic_of_intervalIntegral_norm_bounded I' b hfi ha hI'
theorem integrableOn_Ioi_of_intervalIntegral_norm_bounded (I a : ℝ)
(hfi : ∀ i, IntegrableOn f (Ioc a (b i)) μ) (hb : Tendsto b l atTop)
(h : ∀ᶠ i in l, (∫ x in a..b i, ‖f x‖ ∂μ) ≤ I) : IntegrableOn f (Ioi a) μ := by
have hφ : AECover (μ.restrict <| Ioi a) l _ := aecover_Iic hb
have hfi : ∀ i, IntegrableOn f (Iic (b i)) (μ.restrict <| Ioi a) := by
intro i
rw [IntegrableOn, Measure.restrict_restrict (hφ.measurableSet i), inter_comm]
exact hfi i
refine hφ.integrable_of_integral_norm_bounded I hfi (h.mp ?_)
filter_upwards [hb.eventually (eventually_ge_atTop a)] with i hbi
rw [intervalIntegral.integral_of_le hbi, Measure.restrict_restrict (hφ.measurableSet i),
inter_comm]
exact id
/-- If `f` is integrable on intervals `Ioc a (b i)`,
where `b i` tends to ∞, and
`∫ x in a .. b i, ‖f x‖ ∂μ` converges to `I : ℝ` along a filter `l`,
then `f` is integrable on the interval (a, ∞) -/
theorem integrableOn_Ioi_of_intervalIntegral_norm_tendsto (I a : ℝ)
(hfi : ∀ i, IntegrableOn f (Ioc a (b i)) μ) (hb : Tendsto b l atTop)
(h : Tendsto (fun i => ∫ x in a..b i, ‖f x‖ ∂μ) l (𝓝 <| I)) : IntegrableOn f (Ioi a) μ :=
let ⟨I', hI'⟩ := h.isBoundedUnder_le
integrableOn_Ioi_of_intervalIntegral_norm_bounded I' a hfi hb hI'
theorem integrableOn_Ioc_of_intervalIntegral_norm_bounded {I a₀ b₀ : ℝ}
(hfi : ∀ i, IntegrableOn f <| Ioc (a i) (b i)) (ha : Tendsto a l <| 𝓝 a₀)
(hb : Tendsto b l <| 𝓝 b₀) (h : ∀ᶠ i in l, (∫ x in Ioc (a i) (b i), ‖f x‖) ≤ I) :
IntegrableOn f (Ioc a₀ b₀) := by
refine (aecover_Ioc_of_Ioc ha hb).integrable_of_integral_norm_bounded I
(fun i => (hfi i).restrict measurableSet_Ioc) (h.mono fun i hi ↦ ?_)
rw [Measure.restrict_restrict measurableSet_Ioc]
refine le_trans (setIntegral_mono_set (hfi i).norm ?_ ?_) hi <;> apply ae_of_all
· simp only [Pi.zero_apply, norm_nonneg, forall_const]
· intro c hc; exact hc.1
theorem integrableOn_Ioc_of_intervalIntegral_norm_bounded_left {I a₀ b : ℝ}
(hfi : ∀ i, IntegrableOn f <| Ioc (a i) b) (ha : Tendsto a l <| 𝓝 a₀)
(h : ∀ᶠ i in l, (∫ x in Ioc (a i) b, ‖f x‖) ≤ I) : IntegrableOn f (Ioc a₀ b) :=
integrableOn_Ioc_of_intervalIntegral_norm_bounded hfi ha tendsto_const_nhds h
theorem integrableOn_Ioc_of_intervalIntegral_norm_bounded_right {I a b₀ : ℝ}
(hfi : ∀ i, IntegrableOn f <| Ioc a (b i)) (hb : Tendsto b l <| 𝓝 b₀)
(h : ∀ᶠ i in l, (∫ x in Ioc a (b i), ‖f x‖) ≤ I) : IntegrableOn f (Ioc a b₀) :=
integrableOn_Ioc_of_intervalIntegral_norm_bounded hfi tendsto_const_nhds hb h
@[deprecated (since := "2024-04-06")]
alias integrableOn_Ioc_of_interval_integral_norm_bounded :=
integrableOn_Ioc_of_intervalIntegral_norm_bounded
@[deprecated (since := "2024-04-06")]
alias integrableOn_Ioc_of_interval_integral_norm_bounded_left :=
integrableOn_Ioc_of_intervalIntegral_norm_bounded_left
@[deprecated (since := "2024-04-06")]
alias integrableOn_Ioc_of_interval_integral_norm_bounded_right :=
integrableOn_Ioc_of_intervalIntegral_norm_bounded_right
end IntegrableOfIntervalIntegral
section IntegralOfIntervalIntegral
variable {ι E : Type*} {μ : Measure ℝ} {l : Filter ι} [IsCountablyGenerated l]
[NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {a b : ι → ℝ} {f : ℝ → E}
theorem intervalIntegral_tendsto_integral (hfi : Integrable f μ) (ha : Tendsto a l atBot)
(hb : Tendsto b l atTop) : Tendsto (fun i => ∫ x in a i..b i, f x ∂μ) l (𝓝 <| ∫ x, f x ∂μ) := by
let φ i := Ioc (a i) (b i)
have hφ : AECover μ l φ := aecover_Ioc ha hb
refine (hφ.integral_tendsto_of_countably_generated hfi).congr' ?_
filter_upwards [ha.eventually (eventually_le_atBot 0),
hb.eventually (eventually_ge_atTop 0)] with i hai hbi
exact (intervalIntegral.integral_of_le (hai.trans hbi)).symm
theorem intervalIntegral_tendsto_integral_Iic (b : ℝ) (hfi : IntegrableOn f (Iic b) μ)
(ha : Tendsto a l atBot) :
Tendsto (fun i => ∫ x in a i..b, f x ∂μ) l (𝓝 <| ∫ x in Iic b, f x ∂μ) := by
let φ i := Ioi (a i)
have hφ : AECover (μ.restrict <| Iic b) l φ := aecover_Ioi ha
refine (hφ.integral_tendsto_of_countably_generated hfi).congr' ?_
filter_upwards [ha.eventually (eventually_le_atBot <| b)] with i hai
rw [intervalIntegral.integral_of_le hai, Measure.restrict_restrict (hφ.measurableSet i)]
rfl
theorem intervalIntegral_tendsto_integral_Ioi (a : ℝ) (hfi : IntegrableOn f (Ioi a) μ)
(hb : Tendsto b l atTop) :
Tendsto (fun i => ∫ x in a..b i, f x ∂μ) l (𝓝 <| ∫ x in Ioi a, f x ∂μ) := by
let φ i := Iic (b i)
have hφ : AECover (μ.restrict <| Ioi a) l φ := aecover_Iic hb
refine (hφ.integral_tendsto_of_countably_generated hfi).congr' ?_
filter_upwards [hb.eventually (eventually_ge_atTop <| a)] with i hbi
rw [intervalIntegral.integral_of_le hbi, Measure.restrict_restrict (hφ.measurableSet i),
inter_comm]
rfl
end IntegralOfIntervalIntegral
open Real
open scoped Interval
section IoiFTC
variable {E : Type*} {f f' : ℝ → E} {g g' : ℝ → ℝ} {a b l : ℝ} {m : E} [NormedAddCommGroup E]
[NormedSpace ℝ E]
/-- If the derivative of a function defined on the real line is integrable close to `+∞`, then
the function has a limit at `+∞`. -/
theorem tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi [CompleteSpace E]
(hderiv : ∀ x ∈ Ioi a, HasDerivAt f (f' x) x) (f'int : IntegrableOn f' (Ioi a)) :
Tendsto f atTop (𝓝 (limUnder atTop f)) := by
suffices ∃ a, Tendsto f atTop (𝓝 a) from tendsto_nhds_limUnder this
suffices CauchySeq f from cauchySeq_tendsto_of_complete this
apply Metric.cauchySeq_iff'.2 (fun ε εpos ↦ ?_)
have A : ∀ᶠ (n : ℕ) in atTop, ∫ (x : ℝ) in Ici ↑n, ‖f' x‖ < ε := by
have L : Tendsto (fun (n : ℕ) ↦ ∫ x in Ici (n : ℝ), ‖f' x‖) atTop
(𝓝 (∫ x in ⋂ (n : ℕ), Ici (n : ℝ), ‖f' x‖)) := by
apply tendsto_setIntegral_of_antitone (fun n ↦ measurableSet_Ici)
· intro m n hmn
exact Ici_subset_Ici.2 (Nat.cast_le.mpr hmn)
· rcases exists_nat_gt a with ⟨n, hn⟩
exact ⟨n, IntegrableOn.mono_set f'int.norm (Ici_subset_Ioi.2 hn)⟩
have B : ⋂ (n : ℕ), Ici (n : ℝ) = ∅ := by
apply eq_empty_of_forall_not_mem (fun x ↦ ?_)
simpa only [mem_iInter, mem_Ici, not_forall, not_le] using exists_nat_gt x
simp only [B, Measure.restrict_empty, integral_zero_measure] at L
exact (tendsto_order.1 L).2 _ εpos
have B : ∀ᶠ (n : ℕ) in atTop, a < n := by
rcases exists_nat_gt a with ⟨n, hn⟩
filter_upwards [Ioi_mem_atTop n] with m (hm : n < m) using hn.trans (Nat.cast_lt.mpr hm)
rcases (A.and B).exists with ⟨N, hN, h'N⟩
refine ⟨N, fun x hx ↦ ?_⟩
calc
dist (f x) (f ↑N)
= ‖f x - f N‖ := dist_eq_norm _ _
_ = ‖∫ t in Ioc ↑N x, f' t‖ := by
rw [← intervalIntegral.integral_of_le hx, intervalIntegral.integral_eq_sub_of_hasDerivAt]
· intro y hy
simp only [hx, uIcc_of_le, mem_Icc] at hy
exact hderiv _ (h'N.trans_le hy.1)
· rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hx]
exact f'int.mono_set (Ioc_subset_Ioi_self.trans (Ioi_subset_Ioi h'N.le))
_ ≤ ∫ t in Ioc ↑N x, ‖f' t‖ := norm_integral_le_integral_norm fun a ↦ f' a
_ ≤ ∫ t in Ici ↑N, ‖f' t‖ := by
apply setIntegral_mono_set
· apply IntegrableOn.mono_set f'int.norm (Ici_subset_Ioi.2 h'N)
· filter_upwards with x using norm_nonneg _
· have : Ioc (↑N) x ⊆ Ici ↑N := Ioc_subset_Ioi_self.trans Ioi_subset_Ici_self
exact this.eventuallyLE
_ < ε := hN
open UniformSpace in
/-- If a function and its derivative are integrable on `(a, +∞)`, then the function tends to zero
at `+∞`. -/
theorem tendsto_zero_of_hasDerivAt_of_integrableOn_Ioi
(hderiv : ∀ x ∈ Ioi a, HasDerivAt f (f' x) x)
(f'int : IntegrableOn f' (Ioi a)) (fint : IntegrableOn f (Ioi a)) :
Tendsto f atTop (𝓝 0) := by
let F : E →L[ℝ] Completion E := Completion.toComplL
have Fderiv : ∀ x ∈ Ioi a, HasDerivAt (F ∘ f) (F (f' x)) x :=
fun x hx ↦ F.hasFDerivAt.comp_hasDerivAt _ (hderiv x hx)
have Fint : IntegrableOn (F ∘ f) (Ioi a) := by apply F.integrable_comp fint
have F'int : IntegrableOn (F ∘ f') (Ioi a) := by apply F.integrable_comp f'int
have A : Tendsto (F ∘ f) atTop (𝓝 (limUnder atTop (F ∘ f))) := by
apply tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi Fderiv F'int
have B : limUnder atTop (F ∘ f) = F 0 := by
have : IntegrableAtFilter (F ∘ f) atTop := by exact ⟨Ioi a, Ioi_mem_atTop _, Fint⟩
apply IntegrableAtFilter.eq_zero_of_tendsto this ?_ A
intro s hs
rcases mem_atTop_sets.1 hs with ⟨b, hb⟩
rw [← top_le_iff, ← volume_Ici (a := b)]
exact measure_mono hb
rwa [B, ← Embedding.tendsto_nhds_iff] at A
exact (Completion.uniformEmbedding_coe E).embedding
variable [CompleteSpace E]
/-- **Fundamental theorem of calculus-2**, on semi-infinite intervals `(a, +∞)`.
When a function has a limit at infinity `m`, and its derivative is integrable, then the
integral of the derivative on `(a, +∞)` is `m - f a`. Version assuming differentiability
on `(a, +∞)` and continuity at `a⁺`.
Note that such a function always has a limit at infinity,
see `tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi`. -/
theorem integral_Ioi_of_hasDerivAt_of_tendsto (hcont : ContinuousWithinAt f (Ici a) a)
(hderiv : ∀ x ∈ Ioi a, HasDerivAt f (f' x) x) (f'int : IntegrableOn f' (Ioi a))
(hf : Tendsto f atTop (𝓝 m)) : ∫ x in Ioi a, f' x = m - f a := by
have hcont : ContinuousOn f (Ici a) := by
intro x hx
rcases hx.out.eq_or_lt with rfl|hx
· exact hcont
· exact (hderiv x hx).continuousAt.continuousWithinAt
refine tendsto_nhds_unique (intervalIntegral_tendsto_integral_Ioi a f'int tendsto_id) ?_
apply Tendsto.congr' _ (hf.sub_const _)
filter_upwards [Ioi_mem_atTop a] with x hx
have h'x : a ≤ id x := le_of_lt hx
symm
apply
intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le h'x (hcont.mono Icc_subset_Ici_self)
fun y hy => hderiv y hy.1
rw [intervalIntegrable_iff_integrableOn_Ioc_of_le h'x]
exact f'int.mono (fun y hy => hy.1) le_rfl
/-- **Fundamental theorem of calculus-2**, on semi-infinite intervals `(a, +∞)`.
When a function has a limit at infinity `m`, and its derivative is integrable, then the
integral of the derivative on `(a, +∞)` is `m - f a`. Version assuming differentiability
on `[a, +∞)`.
Note that such a function always has a limit at infinity,
see `tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi`. -/
theorem integral_Ioi_of_hasDerivAt_of_tendsto' (hderiv : ∀ x ∈ Ici a, HasDerivAt f (f' x) x)
(f'int : IntegrableOn f' (Ioi a)) (hf : Tendsto f atTop (𝓝 m)) :
∫ x in Ioi a, f' x = m - f a := by
refine integral_Ioi_of_hasDerivAt_of_tendsto ?_ (fun x hx => hderiv x hx.out.le)
f'int hf
exact (hderiv a left_mem_Ici).continuousAt.continuousWithinAt
/-- A special case of `integral_Ioi_of_hasDerivAt_of_tendsto` where we assume that `f` is C^1 with
compact support. -/
theorem _root_.HasCompactSupport.integral_Ioi_deriv_eq (hf : ContDiff ℝ 1 f)
(h2f : HasCompactSupport f) (b : ℝ) : ∫ x in Ioi b, deriv f x = - f b := by
have := fun x (_ : x ∈ Ioi b) ↦ hf.differentiable le_rfl x |>.hasDerivAt
rw [integral_Ioi_of_hasDerivAt_of_tendsto hf.continuous.continuousWithinAt this, zero_sub]
· refine hf.continuous_deriv le_rfl |>.integrable_of_hasCompactSupport h2f.deriv |>.integrableOn
rw [hasCompactSupport_iff_eventuallyEq, Filter.coclosedCompact_eq_cocompact] at h2f
exact h2f.filter_mono _root_.atTop_le_cocompact |>.tendsto
/-- When a function has a limit at infinity, and its derivative is nonnegative, then the derivative
is automatically integrable on `(a, +∞)`. Version assuming differentiability
on `(a, +∞)` and continuity at `a⁺`. -/
theorem integrableOn_Ioi_deriv_of_nonneg (hcont : ContinuousWithinAt g (Ici a) a)
(hderiv : ∀ x ∈ Ioi a, HasDerivAt g (g' x) x) (g'pos : ∀ x ∈ Ioi a, 0 ≤ g' x)
(hg : Tendsto g atTop (𝓝 l)) : IntegrableOn g' (Ioi a) := by
have hcont : ContinuousOn g (Ici a) := by
intro x hx
rcases hx.out.eq_or_lt with rfl|hx
· exact hcont
· exact (hderiv x hx).continuousAt.continuousWithinAt
refine integrableOn_Ioi_of_intervalIntegral_norm_tendsto (l - g a) a (fun x => ?_) tendsto_id ?_
· exact intervalIntegral.integrableOn_deriv_of_nonneg (hcont.mono Icc_subset_Ici_self)
(fun y hy => hderiv y hy.1) fun y hy => g'pos y hy.1
apply Tendsto.congr' _ (hg.sub_const _)
filter_upwards [Ioi_mem_atTop a] with x hx
have h'x : a ≤ id x := le_of_lt hx
calc
g x - g a = ∫ y in a..id x, g' y := by
symm
apply intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le h'x
(hcont.mono Icc_subset_Ici_self) fun y hy => hderiv y hy.1
rw [intervalIntegrable_iff_integrableOn_Ioc_of_le h'x]
exact intervalIntegral.integrableOn_deriv_of_nonneg (hcont.mono Icc_subset_Ici_self)
(fun y hy => hderiv y hy.1) fun y hy => g'pos y hy.1
_ = ∫ y in a..id x, ‖g' y‖ := by
simp_rw [intervalIntegral.integral_of_le h'x]
refine setIntegral_congr measurableSet_Ioc fun y hy => ?_
dsimp
rw [abs_of_nonneg]
exact g'pos _ hy.1
/-- When a function has a limit at infinity, and its derivative is nonnegative, then the derivative
is automatically integrable on `(a, +∞)`. Version assuming differentiability
on `[a, +∞)`. -/
theorem integrableOn_Ioi_deriv_of_nonneg' (hderiv : ∀ x ∈ Ici a, HasDerivAt g (g' x) x)
(g'pos : ∀ x ∈ Ioi a, 0 ≤ g' x) (hg : Tendsto g atTop (𝓝 l)) : IntegrableOn g' (Ioi a) := by
refine integrableOn_Ioi_deriv_of_nonneg ?_ (fun x hx => hderiv x hx.out.le) g'pos hg
exact (hderiv a left_mem_Ici).continuousAt.continuousWithinAt
/-- When a function has a limit at infinity `l`, and its derivative is nonnegative, then the
integral of the derivative on `(a, +∞)` is `l - g a` (and the derivative is integrable, see
`integrable_on_Ioi_deriv_of_nonneg`). Version assuming differentiability on `(a, +∞)` and
continuity at `a⁺`. -/
theorem integral_Ioi_of_hasDerivAt_of_nonneg (hcont : ContinuousWithinAt g (Ici a) a)
(hderiv : ∀ x ∈ Ioi a, HasDerivAt g (g' x) x) (g'pos : ∀ x ∈ Ioi a, 0 ≤ g' x)
(hg : Tendsto g atTop (𝓝 l)) : ∫ x in Ioi a, g' x = l - g a :=
integral_Ioi_of_hasDerivAt_of_tendsto hcont hderiv
(integrableOn_Ioi_deriv_of_nonneg hcont hderiv g'pos hg) hg
/-- When a function has a limit at infinity `l`, and its derivative is nonnegative, then the
integral of the derivative on `(a, +∞)` is `l - g a` (and the derivative is integrable, see
`integrable_on_Ioi_deriv_of_nonneg'`). Version assuming differentiability on `[a, +∞)`. -/
theorem integral_Ioi_of_hasDerivAt_of_nonneg' (hderiv : ∀ x ∈ Ici a, HasDerivAt g (g' x) x)
(g'pos : ∀ x ∈ Ioi a, 0 ≤ g' x) (hg : Tendsto g atTop (𝓝 l)) : ∫ x in Ioi a, g' x = l - g a :=
integral_Ioi_of_hasDerivAt_of_tendsto' hderiv (integrableOn_Ioi_deriv_of_nonneg' hderiv g'pos hg)
hg
/-- When a function has a limit at infinity, and its derivative is nonpositive, then the derivative
is automatically integrable on `(a, +∞)`. Version assuming differentiability
on `(a, +∞)` and continuity at `a⁺`. -/
theorem integrableOn_Ioi_deriv_of_nonpos (hcont : ContinuousWithinAt g (Ici a) a)
(hderiv : ∀ x ∈ Ioi a, HasDerivAt g (g' x) x) (g'neg : ∀ x ∈ Ioi a, g' x ≤ 0)
(hg : Tendsto g atTop (𝓝 l)) : IntegrableOn g' (Ioi a) := by
apply integrable_neg_iff.1
exact integrableOn_Ioi_deriv_of_nonneg hcont.neg (fun x hx => (hderiv x hx).neg)
(fun x hx => neg_nonneg_of_nonpos (g'neg x hx)) hg.neg
/-- When a function has a limit at infinity, and its derivative is nonpositive, then the derivative
is automatically integrable on `(a, +∞)`. Version assuming differentiability
on `[a, +∞)`. -/
theorem integrableOn_Ioi_deriv_of_nonpos' (hderiv : ∀ x ∈ Ici a, HasDerivAt g (g' x) x)
(g'neg : ∀ x ∈ Ioi a, g' x ≤ 0) (hg : Tendsto g atTop (𝓝 l)) : IntegrableOn g' (Ioi a) := by
refine integrableOn_Ioi_deriv_of_nonpos ?_ (fun x hx ↦ hderiv x hx.out.le) g'neg hg
exact (hderiv a left_mem_Ici).continuousAt.continuousWithinAt
/-- When a function has a limit at infinity `l`, and its derivative is nonpositive, then the
integral of the derivative on `(a, +∞)` is `l - g a` (and the derivative is integrable, see
`integrable_on_Ioi_deriv_of_nonneg`). Version assuming differentiability on `(a, +∞)` and
continuity at `a⁺`. -/
theorem integral_Ioi_of_hasDerivAt_of_nonpos (hcont : ContinuousWithinAt g (Ici a) a)
(hderiv : ∀ x ∈ Ioi a, HasDerivAt g (g' x) x) (g'neg : ∀ x ∈ Ioi a, g' x ≤ 0)
(hg : Tendsto g atTop (𝓝 l)) : ∫ x in Ioi a, g' x = l - g a :=
integral_Ioi_of_hasDerivAt_of_tendsto hcont hderiv
(integrableOn_Ioi_deriv_of_nonpos hcont hderiv g'neg hg) hg
/-- When a function has a limit at infinity `l`, and its derivative is nonpositive, then the
integral of the derivative on `(a, +∞)` is `l - g a` (and the derivative is integrable, see
`integrable_on_Ioi_deriv_of_nonneg'`). Version assuming differentiability on `[a, +∞)`. -/
theorem integral_Ioi_of_hasDerivAt_of_nonpos' (hderiv : ∀ x ∈ Ici a, HasDerivAt g (g' x) x)
(g'neg : ∀ x ∈ Ioi a, g' x ≤ 0) (hg : Tendsto g atTop (𝓝 l)) : ∫ x in Ioi a, g' x = l - g a :=
integral_Ioi_of_hasDerivAt_of_tendsto' hderiv (integrableOn_Ioi_deriv_of_nonpos' hderiv g'neg hg)
hg
end IoiFTC
section IicFTC
variable {E : Type*} {f f' : ℝ → E} {g g' : ℝ → ℝ} {a b l : ℝ} {m : E} [NormedAddCommGroup E]
[NormedSpace ℝ E]
/-- If the derivative of a function defined on the real line is integrable close to `-∞`, then
the function has a limit at `-∞`. -/
theorem tendsto_limUnder_of_hasDerivAt_of_integrableOn_Iic [CompleteSpace E]
(hderiv : ∀ x ∈ Iic a, HasDerivAt f (f' x) x) (f'int : IntegrableOn f' (Iic a)) :
Tendsto f atBot (𝓝 (limUnder atBot f)) := by
suffices ∃ a, Tendsto f atBot (𝓝 a) from tendsto_nhds_limUnder this
let g := f ∘ (fun x ↦ -x)
have hdg : ∀ x ∈ Ioi (-a), HasDerivAt g (-f' (-x)) x := by
intro x hx
have : -x ∈ Iic a := by simp only [mem_Iic, mem_Ioi, neg_le] at *; exact hx.le
simpa using HasDerivAt.scomp x (hderiv (-x) this) (hasDerivAt_neg' x)
have L : Tendsto g atTop (𝓝 (limUnder atTop g)) := by
apply tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi hdg
exact ((MeasurePreserving.integrableOn_comp_preimage (Measure.measurePreserving_neg _)
(Homeomorph.neg ℝ).measurableEmbedding).2 f'int.neg).mono_set (by simp)
refine ⟨limUnder atTop g, ?_⟩
have : Tendsto (fun x ↦ g (-x)) atBot (𝓝 (limUnder atTop g)) := L.comp tendsto_neg_atBot_atTop
simpa [g] using this
open UniformSpace in
/-- If a function and its derivative are integrable on `(-∞, a]`, then the function tends to zero
at `-∞`. -/
theorem tendsto_zero_of_hasDerivAt_of_integrableOn_Iic
(hderiv : ∀ x ∈ Iic a, HasDerivAt f (f' x) x)
(f'int : IntegrableOn f' (Iic a)) (fint : IntegrableOn f (Iic a)) :
Tendsto f atBot (𝓝 0) := by
let F : E →L[ℝ] Completion E := Completion.toComplL
have Fderiv : ∀ x ∈ Iic a, HasDerivAt (F ∘ f) (F (f' x)) x :=
fun x hx ↦ F.hasFDerivAt.comp_hasDerivAt _ (hderiv x hx)
have Fint : IntegrableOn (F ∘ f) (Iic a) := by apply F.integrable_comp fint
have F'int : IntegrableOn (F ∘ f') (Iic a) := by apply F.integrable_comp f'int
have A : Tendsto (F ∘ f) atBot (𝓝 (limUnder atBot (F ∘ f))) := by
apply tendsto_limUnder_of_hasDerivAt_of_integrableOn_Iic Fderiv F'int
have B : limUnder atBot (F ∘ f) = F 0 := by
have : IntegrableAtFilter (F ∘ f) atBot := by exact ⟨Iic a, Iic_mem_atBot _, Fint⟩
apply IntegrableAtFilter.eq_zero_of_tendsto this ?_ A
intro s hs
rcases mem_atBot_sets.1 hs with ⟨b, hb⟩
apply le_antisymm (le_top)
rw [← volume_Iic (a := b)]
exact measure_mono hb
rwa [B, ← Embedding.tendsto_nhds_iff] at A
exact (Completion.uniformEmbedding_coe E).embedding
variable [CompleteSpace E]
/-- **Fundamental theorem of calculus-2**, on semi-infinite intervals `(-∞, a)`.
When a function has a limit `m` at `-∞`, and its derivative is integrable, then the
integral of the derivative on `(-∞, a)` is `f a - m`. Version assuming differentiability
on `(-∞, a)` and continuity at `a⁻`.
Note that such a function always has a limit at minus infinity,
see `tendsto_limUnder_of_hasDerivAt_of_integrableOn_Iic`. -/
theorem integral_Iic_of_hasDerivAt_of_tendsto (hcont : ContinuousWithinAt f (Iic a) a)
(hderiv : ∀ x ∈ Iio a, HasDerivAt f (f' x) x) (f'int : IntegrableOn f' (Iic a))
(hf : Tendsto f atBot (𝓝 m)) : ∫ x in Iic a, f' x = f a - m := by
have hcont : ContinuousOn f (Iic a) := by
intro x hx
rcases hx.out.eq_or_lt with rfl|hx
· exact hcont
· exact (hderiv x hx).continuousAt.continuousWithinAt
refine tendsto_nhds_unique (intervalIntegral_tendsto_integral_Iic a f'int tendsto_id) ?_
apply Tendsto.congr' _ (hf.const_sub _)
filter_upwards [Iic_mem_atBot a] with x hx
symm
apply intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hx
(hcont.mono Icc_subset_Iic_self) fun y hy => hderiv y hy.2
rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hx]
exact f'int.mono (fun y hy => hy.2) le_rfl
/-- **Fundamental theorem of calculus-2**, on semi-infinite intervals `(-∞, a)`.
When a function has a limit `m` at `-∞`, and its derivative is integrable, then the
integral of the derivative on `(-∞, a)` is `f a - m`. Version assuming differentiability
on `(-∞, a]`.
Note that such a function always has a limit at minus infinity,
see `tendsto_limUnder_of_hasDerivAt_of_integrableOn_Iic`. -/
theorem integral_Iic_of_hasDerivAt_of_tendsto'
(hderiv : ∀ x ∈ Iic a, HasDerivAt f (f' x) x) (f'int : IntegrableOn f' (Iic a))
(hf : Tendsto f atBot (𝓝 m)) : ∫ x in Iic a, f' x = f a - m := by
refine integral_Iic_of_hasDerivAt_of_tendsto ?_ (fun x hx => hderiv x hx.out.le)
f'int hf
exact (hderiv a right_mem_Iic).continuousAt.continuousWithinAt
/-- A special case of `integral_Iic_of_hasDerivAt_of_tendsto` where we assume that `f` is C^1 with
compact support. -/
theorem _root_.HasCompactSupport.integral_Iic_deriv_eq (hf : ContDiff ℝ 1 f)
(h2f : HasCompactSupport f) (b : ℝ) : ∫ x in Iic b, deriv f x = f b := by
have := fun x (_ : x ∈ Iio b) ↦ hf.differentiable le_rfl x |>.hasDerivAt
rw [integral_Iic_of_hasDerivAt_of_tendsto hf.continuous.continuousWithinAt this, sub_zero]
· refine hf.continuous_deriv le_rfl |>.integrable_of_hasCompactSupport h2f.deriv |>.integrableOn
rw [hasCompactSupport_iff_eventuallyEq, Filter.coclosedCompact_eq_cocompact] at h2f
exact h2f.filter_mono _root_.atBot_le_cocompact |>.tendsto
open UniformSpace in
lemma _root_.HasCompactSupport.ennnorm_le_lintegral_Ici_deriv
{F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F]
{f : ℝ → F} (hf : ContDiff ℝ 1 f) (h'f : HasCompactSupport f) (x : ℝ) :
(‖f x‖₊ : ℝ≥0∞) ≤ ∫⁻ y in Iic x, ‖deriv f y‖₊ := by
let I : F →L[ℝ] Completion F := Completion.toComplL
let f' : ℝ → Completion F := I ∘ f
have hf' : ContDiff ℝ 1 f' := hf.continuousLinearMap_comp I
have h'f' : HasCompactSupport f' := h'f.comp_left rfl
have : (‖f' x‖₊ : ℝ≥0∞) ≤ ∫⁻ y in Iic x, ‖deriv f' y‖₊ := by
rw [← HasCompactSupport.integral_Iic_deriv_eq hf' h'f' x]
exact ennnorm_integral_le_lintegral_ennnorm _
convert this with y
· simp [f', I, Completion.nnnorm_coe]
· rw [fderiv.comp_deriv _ I.differentiableAt (hf.differentiable le_rfl _)]
simp only [ContinuousLinearMap.fderiv]
simp [I]
end IicFTC
section UnivFTC
variable {E : Type*} {f f' : ℝ → E} {g g' : ℝ → ℝ} {a b l : ℝ} {m n : E} [NormedAddCommGroup E]
[NormedSpace ℝ E]
/-- **Fundamental theorem of calculus-2**, on the whole real line
When a function has a limit `m` at `-∞` and `n` at `+∞`, and its derivative is integrable, then the
integral of the derivative is `n - m`.
Note that such a function always has a limit at `-∞` and `+∞`,
see `tendsto_limUnder_of_hasDerivAt_of_integrableOn_Iic` and
`tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi`. -/
theorem integral_of_hasDerivAt_of_tendsto [CompleteSpace E]
(hderiv : ∀ x, HasDerivAt f (f' x) x) (hf' : Integrable f')
(hbot : Tendsto f atBot (𝓝 m)) (htop : Tendsto f atTop (𝓝 n)) : ∫ x, f' x = n - m := by
rw [← integral_univ, ← Set.Iic_union_Ioi (a := 0),
integral_union (Iic_disjoint_Ioi le_rfl) measurableSet_Ioi hf'.integrableOn hf'.integrableOn,
integral_Iic_of_hasDerivAt_of_tendsto' (fun x _ ↦ hderiv x) hf'.integrableOn hbot,
integral_Ioi_of_hasDerivAt_of_tendsto' (fun x _ ↦ hderiv x) hf'.integrableOn htop]
abel
/-- If a function and its derivative are integrable on the real line, then the integral of the
derivative is zero. -/
theorem integral_eq_zero_of_hasDerivAt_of_integrable
(hderiv : ∀ x, HasDerivAt f (f' x) x) (hf' : Integrable f') (hf : Integrable f) :
∫ x, f' x = 0 := by
by_cases hE : CompleteSpace E; swap
· simp [integral, hE]
have A : Tendsto f atBot (𝓝 0) :=
tendsto_zero_of_hasDerivAt_of_integrableOn_Iic (a := 0) (fun x _hx ↦ hderiv x)
hf'.integrableOn hf.integrableOn
have B : Tendsto f atTop (𝓝 0) :=
tendsto_zero_of_hasDerivAt_of_integrableOn_Ioi (a := 0) (fun x _hx ↦ hderiv x)
hf'.integrableOn hf.integrableOn
simpa using integral_of_hasDerivAt_of_tendsto hderiv hf' A B
end UnivFTC
section IoiChangeVariables
open Real
open scoped Interval
variable {E : Type*} {f : ℝ → E} [NormedAddCommGroup E] [NormedSpace ℝ E]
/-- Change-of-variables formula for `Ioi` integrals of vector-valued functions, proved by taking
limits from the result for finite intervals. -/
theorem integral_comp_smul_deriv_Ioi {f f' : ℝ → ℝ} {g : ℝ → E} {a : ℝ}
(hf : ContinuousOn f <| Ici a) (hft : Tendsto f atTop atTop)
(hff' : ∀ x ∈ Ioi a, HasDerivWithinAt f (f' x) (Ioi x) x)
(hg_cont : ContinuousOn g <| f '' Ioi a) (hg1 : IntegrableOn g <| f '' Ici a)
(hg2 : IntegrableOn (fun x => f' x • (g ∘ f) x) (Ici a)) :
(∫ x in Ioi a, f' x • (g ∘ f) x) = ∫ u in Ioi (f a), g u := by
have eq : ∀ b : ℝ, a < b → (∫ x in a..b, f' x • (g ∘ f) x) = ∫ u in f a..f b, g u := fun b hb ↦ by
have i1 : Ioo (min a b) (max a b) ⊆ Ioi a := by
rw [min_eq_left hb.le]
exact Ioo_subset_Ioi_self
have i2 : [[a, b]] ⊆ Ici a := by rw [uIcc_of_le hb.le]; exact Icc_subset_Ici_self
refine
intervalIntegral.integral_comp_smul_deriv''' (hf.mono i2)
(fun x hx => hff' x <| mem_of_mem_of_subset hx i1) (hg_cont.mono <| image_subset _ ?_)
(hg1.mono_set <| image_subset _ ?_) (hg2.mono_set i2)
· rw [min_eq_left hb.le]; exact Ioo_subset_Ioi_self
· rw [uIcc_of_le hb.le]; exact Icc_subset_Ici_self
rw [integrableOn_Ici_iff_integrableOn_Ioi] at hg2
have t2 := intervalIntegral_tendsto_integral_Ioi _ hg2 tendsto_id
have : Ioi (f a) ⊆ f '' Ici a :=
Ioi_subset_Ici_self.trans <|
IsPreconnected.intermediate_value_Ici isPreconnected_Ici left_mem_Ici
(le_principal_iff.mpr <| Ici_mem_atTop _) hf hft
have t1 := (intervalIntegral_tendsto_integral_Ioi _ (hg1.mono_set this) tendsto_id).comp hft
exact tendsto_nhds_unique (Tendsto.congr' (eventuallyEq_of_mem (Ioi_mem_atTop a) eq) t2) t1
/-- Change-of-variables formula for `Ioi` integrals of scalar-valued functions -/
theorem integral_comp_mul_deriv_Ioi {f f' : ℝ → ℝ} {g : ℝ → ℝ} {a : ℝ}
(hf : ContinuousOn f <| Ici a) (hft : Tendsto f atTop atTop)
(hff' : ∀ x ∈ Ioi a, HasDerivWithinAt f (f' x) (Ioi x) x)
(hg_cont : ContinuousOn g <| f '' Ioi a) (hg1 : IntegrableOn g <| f '' Ici a)
(hg2 : IntegrableOn (fun x => (g ∘ f) x * f' x) (Ici a)) :
(∫ x in Ioi a, (g ∘ f) x * f' x) = ∫ u in Ioi (f a), g u := by
have hg2' : IntegrableOn (fun x => f' x • (g ∘ f) x) (Ici a) := by simpa [mul_comm] using hg2
simpa [mul_comm] using integral_comp_smul_deriv_Ioi hf hft hff' hg_cont hg1 hg2'
/-- Substitution `y = x ^ p` in integrals over `Ioi 0` -/
theorem integral_comp_rpow_Ioi (g : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
(∫ x in Ioi 0, (|p| * x ^ (p - 1)) • g (x ^ p)) = ∫ y in Ioi 0, g y := by
let S := Ioi (0 : ℝ)
have a1 : ∀ x : ℝ, x ∈ S → HasDerivWithinAt (fun t : ℝ => t ^ p) (p * x ^ (p - 1)) S x :=
fun x hx => (hasDerivAt_rpow_const (Or.inl (mem_Ioi.mp hx).ne')).hasDerivWithinAt
have a2 : InjOn (fun x : ℝ => x ^ p) S := by
rcases lt_or_gt_of_ne hp with (h | h)
· apply StrictAntiOn.injOn
intro x hx y hy hxy
rw [← inv_lt_inv (rpow_pos_of_pos hx p) (rpow_pos_of_pos hy p), ← rpow_neg (le_of_lt hx),
← rpow_neg (le_of_lt hy)]
exact rpow_lt_rpow (le_of_lt hx) hxy (neg_pos.mpr h)
exact StrictMonoOn.injOn fun x hx y _ hxy => rpow_lt_rpow (mem_Ioi.mp hx).le hxy h
have a3 : (fun t : ℝ => t ^ p) '' S = S := by
ext1 x; rw [mem_image]; constructor
· rintro ⟨y, hy, rfl⟩; exact rpow_pos_of_pos hy p
· intro hx; refine ⟨x ^ (1 / p), rpow_pos_of_pos hx _, ?_⟩
rw [← rpow_mul (le_of_lt hx), one_div_mul_cancel hp, rpow_one]
have := integral_image_eq_integral_abs_deriv_smul measurableSet_Ioi a1 a2 g
rw [a3] at this; rw [this]
refine setIntegral_congr measurableSet_Ioi ?_
intro x hx; dsimp only
rw [abs_mul, abs_of_nonneg (rpow_nonneg (le_of_lt hx) _)]
theorem integral_comp_rpow_Ioi_of_pos {g : ℝ → E} {p : ℝ} (hp : 0 < p) :
(∫ x in Ioi 0, (p * x ^ (p - 1)) • g (x ^ p)) = ∫ y in Ioi 0, g y := by
convert integral_comp_rpow_Ioi g hp.ne'
rw [abs_of_nonneg hp.le]
theorem integral_comp_mul_left_Ioi (g : ℝ → E) (a : ℝ) {b : ℝ} (hb : 0 < b) :
(∫ x in Ioi a, g (b * x)) = b⁻¹ • ∫ x in Ioi (b * a), g x := by
have : ∀ c : ℝ, MeasurableSet (Ioi c) := fun c => measurableSet_Ioi
rw [← integral_indicator (this a), ← integral_indicator (this (b * a)),
← abs_of_pos (inv_pos.mpr hb), ← Measure.integral_comp_mul_left]
congr
ext1 x
rw [← indicator_comp_right, preimage_const_mul_Ioi _ hb, mul_div_cancel_left₀ _ hb.ne']
rfl
theorem integral_comp_mul_right_Ioi (g : ℝ → E) (a : ℝ) {b : ℝ} (hb : 0 < b) :
(∫ x in Ioi a, g (x * b)) = b⁻¹ • ∫ x in Ioi (a * b), g x := by
simpa only [mul_comm] using integral_comp_mul_left_Ioi g a hb
end IoiChangeVariables
section IoiIntegrability
open Real
open scoped Interval
variable {E : Type*} [NormedAddCommGroup E]
/-- The substitution `y = x ^ p` in integrals over `Ioi 0` preserves integrability. -/
theorem integrableOn_Ioi_comp_rpow_iff [NormedSpace ℝ E] (f : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
IntegrableOn (fun x => (|p| * x ^ (p - 1)) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0) := by
let S := Ioi (0 : ℝ)
have a1 : ∀ x : ℝ, x ∈ S → HasDerivWithinAt (fun t : ℝ => t ^ p) (p * x ^ (p - 1)) S x :=
fun x hx => (hasDerivAt_rpow_const (Or.inl (mem_Ioi.mp hx).ne')).hasDerivWithinAt
have a2 : InjOn (fun x : ℝ => x ^ p) S := by
rcases lt_or_gt_of_ne hp with (h | h)
· apply StrictAntiOn.injOn
intro x hx y hy hxy
rw [← inv_lt_inv (rpow_pos_of_pos hx p) (rpow_pos_of_pos hy p), ← rpow_neg (le_of_lt hx), ←
rpow_neg (le_of_lt hy)]
exact rpow_lt_rpow (le_of_lt hx) hxy (neg_pos.mpr h)
exact StrictMonoOn.injOn fun x hx y _hy hxy => rpow_lt_rpow (mem_Ioi.mp hx).le hxy h
have a3 : (fun t : ℝ => t ^ p) '' S = S := by
ext1 x; rw [mem_image]; constructor
· rintro ⟨y, hy, rfl⟩; exact rpow_pos_of_pos hy p
· intro hx; refine ⟨x ^ (1 / p), rpow_pos_of_pos hx _, ?_⟩
rw [← rpow_mul (le_of_lt hx), one_div_mul_cancel hp, rpow_one]
have := integrableOn_image_iff_integrableOn_abs_deriv_smul measurableSet_Ioi a1 a2 f
rw [a3] at this
rw [this]
refine integrableOn_congr_fun (fun x hx => ?_) measurableSet_Ioi
simp_rw [abs_mul, abs_of_nonneg (rpow_nonneg (le_of_lt hx) _)]
/-- The substitution `y = x ^ p` in integrals over `Ioi 0` preserves integrability (version
without `|p|` factor) -/
theorem integrableOn_Ioi_comp_rpow_iff' [NormedSpace ℝ E] (f : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
IntegrableOn (fun x => x ^ (p - 1) • f (x ^ p)) (Ioi 0) ↔ IntegrableOn f (Ioi 0) := by
simpa only [← integrableOn_Ioi_comp_rpow_iff f hp, mul_smul] using
(integrable_smul_iff (abs_pos.mpr hp).ne' _).symm
theorem integrableOn_Ioi_comp_mul_left_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
IntegrableOn (fun x => f (a * x)) (Ioi c) ↔ IntegrableOn f (Ioi <| a * c) := by
rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi c)]
rw [← integrable_indicator_iff (measurableSet_Ioi : MeasurableSet <| Ioi <| a * c)]
convert integrable_comp_mul_left_iff ((Ioi (a * c)).indicator f) ha.ne' using 2
ext1 x
rw [← indicator_comp_right, preimage_const_mul_Ioi _ ha, mul_comm a c,
mul_div_cancel_right₀ _ ha.ne']
rfl
theorem integrableOn_Ioi_comp_mul_right_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
IntegrableOn (fun x => f (x * a)) (Ioi c) ↔ IntegrableOn f (Ioi <| c * a) := by
simpa only [mul_comm, mul_zero] using integrableOn_Ioi_comp_mul_left_iff f c ha
end IoiIntegrability
/-!
## Integration by parts
-/
section IntegrationByPartsBilinear
variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G]
{L : E →L[ℝ] F →L[ℝ] G} {u : ℝ → E} {v : ℝ → F} {u' : ℝ → E} {v' : ℝ → F}
{m n : G}
theorem integral_bilinear_hasDerivAt_eq_sub [CompleteSpace G]
(hu : ∀ x, HasDerivAt u (u' x) x) (hv : ∀ x, HasDerivAt v (v' x) x)
(huv : Integrable (fun x ↦ L (u x) (v' x) + L (u' x) (v x)))
(h_bot : Tendsto (fun x ↦ L (u x) (v x)) atBot (𝓝 m))
(h_top : Tendsto (fun x ↦ L (u x) (v x)) atTop (𝓝 n)) :
∫ (x : ℝ), L (u x) (v' x) + L (u' x) (v x) = n - m :=
integral_of_hasDerivAt_of_tendsto (fun x ↦ L.hasDerivAt_of_bilinear (hu x) (hv x))
huv h_bot h_top
/-- **Integration by parts on (-∞, ∞).**
With respect to a general bilinear form. For the specific case of multiplication, see
`integral_mul_deriv_eq_deriv_mul`. -/
theorem integral_bilinear_hasDerivAt_right_eq_sub [CompleteSpace G]
(hu : ∀ x, HasDerivAt u (u' x) x) (hv : ∀ x, HasDerivAt v (v' x) x)
(huv' : Integrable (fun x ↦ L (u x) (v' x))) (hu'v : Integrable (fun x ↦ L (u' x) (v x)))
(h_bot : Tendsto (fun x ↦ L (u x) (v x)) atBot (𝓝 m))
(h_top : Tendsto (fun x ↦ L (u x) (v x)) atTop (𝓝 n)) :
∫ (x : ℝ), L (u x) (v' x) = n - m - ∫ (x : ℝ), L (u' x) (v x) := by
rw [eq_sub_iff_add_eq, ← integral_add huv' hu'v]
exact integral_bilinear_hasDerivAt_eq_sub hu hv (huv'.add hu'v) h_bot h_top
/-- **Integration by parts on (-∞, ∞).**
With respect to a general bilinear form, assuming moreover that the total function is integrable.
-/
theorem integral_bilinear_hasDerivAt_right_eq_neg_left_of_integrable
(hu : ∀ x, HasDerivAt u (u' x) x) (hv : ∀ x, HasDerivAt v (v' x) x)
(huv' : Integrable (fun x ↦ L (u x) (v' x))) (hu'v : Integrable (fun x ↦ L (u' x) (v x)))
(huv : Integrable (fun x ↦ L (u x) (v x))) :
∫ (x : ℝ), L (u x) (v' x) = - ∫ (x : ℝ), L (u' x) (v x) := by
by_cases hG : CompleteSpace G; swap
· simp [integral, hG]
have I : Tendsto (fun x ↦ L (u x) (v x)) atBot (𝓝 0) :=
tendsto_zero_of_hasDerivAt_of_integrableOn_Iic (a := 0)
(fun x _hx ↦ L.hasDerivAt_of_bilinear (hu x) (hv x))
(huv'.add hu'v).integrableOn huv.integrableOn
have J : Tendsto (fun x ↦ L (u x) (v x)) atTop (𝓝 0) :=
tendsto_zero_of_hasDerivAt_of_integrableOn_Ioi (a := 0)
(fun x _hx ↦ L.hasDerivAt_of_bilinear (hu x) (hv x))
(huv'.add hu'v).integrableOn huv.integrableOn
simp [integral_bilinear_hasDerivAt_right_eq_sub hu hv huv' hu'v I J]
end IntegrationByPartsBilinear
section IntegrationByPartsAlgebra
variable {A : Type*} [NormedRing A] [NormedAlgebra ℝ A]
{a b : ℝ} {a' b' : A} {u : ℝ → A} {v : ℝ → A} {u' : ℝ → A} {v' : ℝ → A}
/-- For finite intervals, see: `intervalIntegral.integral_deriv_mul_eq_sub`. -/
theorem integral_deriv_mul_eq_sub [CompleteSpace A]
(hu : ∀ x, HasDerivAt u (u' x) x) (hv : ∀ x, HasDerivAt v (v' x) x)
(huv : Integrable (u' * v + u * v'))
(h_bot : Tendsto (u * v) atBot (𝓝 a')) (h_top : Tendsto (u * v) atTop (𝓝 b')) :
∫ (x : ℝ), u' x * v x + u x * v' x = b' - a' :=
integral_of_hasDerivAt_of_tendsto (fun x ↦ (hu x).mul (hv x)) huv h_bot h_top
/-- **Integration by parts on (-∞, ∞).**
For finite intervals, see: `intervalIntegral.integral_mul_deriv_eq_deriv_mul`. -/
theorem integral_mul_deriv_eq_deriv_mul [CompleteSpace A]
(hu : ∀ x, HasDerivAt u (u' x) x) (hv : ∀ x, HasDerivAt v (v' x) x)
(huv' : Integrable (u * v')) (hu'v : Integrable (u' * v))
(h_bot : Tendsto (u * v) atBot (𝓝 a')) (h_top : Tendsto (u * v) atTop (𝓝 b')) :
∫ (x : ℝ), u x * v' x = b' - a' - ∫ (x : ℝ), u' x * v x :=
integral_bilinear_hasDerivAt_right_eq_sub (L := ContinuousLinearMap.mul ℝ A)
hu hv huv' hu'v h_bot h_top
/-- **Integration by parts on (-∞, ∞).**
Version assuming that the total function is integrable -/
theorem integral_mul_deriv_eq_deriv_mul_of_integrable
(hu : ∀ x, HasDerivAt u (u' x) x) (hv : ∀ x, HasDerivAt v (v' x) x)
(huv' : Integrable (u * v')) (hu'v : Integrable (u' * v)) (huv : Integrable (u * v)) :
∫ (x : ℝ), u x * v' x = - ∫ (x : ℝ), u' x * v x :=
integral_bilinear_hasDerivAt_right_eq_neg_left_of_integrable (L := ContinuousLinearMap.mul ℝ A)
hu hv huv' hu'v huv
variable [CompleteSpace A]
-- TODO: also apply `Tendsto _ (𝓝[>] a) (𝓝 a')` generalization to
-- `integral_Ioi_of_hasDerivAt_of_tendsto` and `integral_Iic_of_hasDerivAt_of_tendsto`
/-- For finite intervals, see: `intervalIntegral.integral_deriv_mul_eq_sub`. -/
theorem integral_Ioi_deriv_mul_eq_sub
(hu : ∀ x ∈ Ioi a, HasDerivAt u (u' x) x) (hv : ∀ x ∈ Ioi a, HasDerivAt v (v' x) x)
(huv : IntegrableOn (u' * v + u * v') (Ioi a))
(h_zero : Tendsto (u * v) (𝓝[>] a) (𝓝 a')) (h_infty : Tendsto (u * v) atTop (𝓝 b')) :
∫ (x : ℝ) in Ioi a, u' x * v x + u x * v' x = b' - a' := by
rw [← Ici_diff_left] at h_zero
let f := Function.update (u * v) a a'
have hderiv : ∀ x ∈ Ioi a, HasDerivAt f (u' x * v x + u x * v' x) x := by
intro x (hx : a < x)
apply ((hu x hx).mul (hv x hx)).congr_of_eventuallyEq
filter_upwards [eventually_ne_nhds hx.ne.symm] with y hy
exact Function.update_noteq hy a' (u * v)
have htendsto : Tendsto f atTop (𝓝 b') := by
apply h_infty.congr'
filter_upwards [eventually_ne_atTop a] with x hx
exact (Function.update_noteq hx a' (u * v)).symm
simpa using integral_Ioi_of_hasDerivAt_of_tendsto
(continuousWithinAt_update_same.mpr h_zero) hderiv huv htendsto
/-- **Integration by parts on (a, ∞).**
For finite intervals, see: `intervalIntegral.integral_mul_deriv_eq_deriv_mul`. -/
theorem integral_Ioi_mul_deriv_eq_deriv_mul
(hu : ∀ x ∈ Ioi a, HasDerivAt u (u' x) x) (hv : ∀ x ∈ Ioi a, HasDerivAt v (v' x) x)
(huv' : IntegrableOn (u * v') (Ioi a)) (hu'v : IntegrableOn (u' * v) (Ioi a))
(h_zero : Tendsto (u * v) (𝓝[>] a) (𝓝 a')) (h_infty : Tendsto (u * v) atTop (𝓝 b')) :
∫ (x : ℝ) in Ioi a, u x * v' x = b' - a' - ∫ (x : ℝ) in Ioi a, u' x * v x := by
rw [Pi.mul_def] at huv' hu'v
rw [eq_sub_iff_add_eq, ← integral_add huv' hu'v]
simpa only [add_comm] using integral_Ioi_deriv_mul_eq_sub hu hv (hu'v.add huv') h_zero h_infty
/-- For finite intervals, see: `intervalIntegral.integral_deriv_mul_eq_sub`. -/
theorem integral_Iic_deriv_mul_eq_sub
(hu : ∀ x ∈ Iio a, HasDerivAt u (u' x) x) (hv : ∀ x ∈ Iio a, HasDerivAt v (v' x) x)
(huv : IntegrableOn (u' * v + u * v') (Iic a))
(h_zero : Tendsto (u * v) (𝓝[<] a) (𝓝 a')) (h_infty : Tendsto (u * v) atBot (𝓝 b')) :
∫ (x : ℝ) in Iic a, u' x * v x + u x * v' x = a' - b' := by
rw [← Iic_diff_right] at h_zero
let f := Function.update (u * v) a a'
have hderiv : ∀ x ∈ Iio a, HasDerivAt f (u' x * v x + u x * v' x) x := by
intro x hx
apply ((hu x hx).mul (hv x hx)).congr_of_eventuallyEq
filter_upwards [Iio_mem_nhds hx] with x (hx : x < a)
exact Function.update_noteq (ne_of_lt hx) a' (u * v)
have htendsto : Tendsto f atBot (𝓝 b') := by
apply h_infty.congr'
filter_upwards [Iio_mem_atBot a] with x (hx : x < a)
exact (Function.update_noteq (ne_of_lt hx) a' (u * v)).symm
simpa using integral_Iic_of_hasDerivAt_of_tendsto
(continuousWithinAt_update_same.mpr h_zero) hderiv huv htendsto
/-- **Integration by parts on (∞, a].**
For finite intervals, see: `intervalIntegral.integral_mul_deriv_eq_deriv_mul`. -/
theorem integral_Iic_mul_deriv_eq_deriv_mul
(hu : ∀ x ∈ Iio a, HasDerivAt u (u' x) x) (hv : ∀ x ∈ Iio a, HasDerivAt v (v' x) x)
(huv' : IntegrableOn (u * v') (Iic a)) (hu'v : IntegrableOn (u' * v) (Iic a))
(h_zero : Tendsto (u * v) (𝓝[<] a) (𝓝 a')) (h_infty : Tendsto (u * v) atBot (𝓝 b')) :
∫ (x : ℝ) in Iic a, u x * v' x = a' - b' - ∫ (x : ℝ) in Iic a, u' x * v x := by
rw [Pi.mul_def] at huv' hu'v
rw [eq_sub_iff_add_eq, ← integral_add huv' hu'v]
simpa only [add_comm] using integral_Iic_deriv_mul_eq_sub hu hv (hu'v.add huv') h_zero h_infty
end IntegrationByPartsAlgebra
end MeasureTheory
|
MeasureTheory\Integral\IntervalAverage.lean | /-
Copyright (c) 2022 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.MeasureTheory.Integral.Average
/-!
# Integral average over an interval
In this file we introduce notation `⨍ x in a..b, f x` for the average `⨍ x in Ι a b, f x` of `f`
over the interval `Ι a b = Set.Ioc (min a b) (max a b)` w.r.t. the Lebesgue measure, then prove
formulas for this average:
* `interval_average_eq`: `⨍ x in a..b, f x = (b - a)⁻¹ • ∫ x in a..b, f x`;
* `interval_average_eq_div`: `⨍ x in a..b, f x = (∫ x in a..b, f x) / (b - a)`.
We also prove that `⨍ x in a..b, f x = ⨍ x in b..a, f x`, see `interval_average_symm`.
## Notation
`⨍ x in a..b, f x`: average of `f` over the interval `Ι a b` w.r.t. the Lebesgue measure.
-/
open MeasureTheory Set TopologicalSpace
open scoped Interval
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
notation3 "⨍ "(...)" in "a".."b",
"r:60:(scoped f => average (Measure.restrict volume (uIoc a b)) f) => r
theorem interval_average_symm (f : ℝ → E) (a b : ℝ) : (⨍ x in a..b, f x) = ⨍ x in b..a, f x := by
rw [setAverage_eq, setAverage_eq, uIoc_comm]
theorem interval_average_eq (f : ℝ → E) (a b : ℝ) :
(⨍ x in a..b, f x) = (b - a)⁻¹ • ∫ x in a..b, f x := by
rcases le_or_lt a b with h | h
· rw [setAverage_eq, uIoc_of_le h, Real.volume_Ioc, intervalIntegral.integral_of_le h,
ENNReal.toReal_ofReal (sub_nonneg.2 h)]
· rw [setAverage_eq, uIoc_of_ge h.le, Real.volume_Ioc, intervalIntegral.integral_of_ge h.le,
ENNReal.toReal_ofReal (sub_nonneg.2 h.le), smul_neg, ← neg_smul, ← inv_neg, neg_sub]
theorem interval_average_eq_div (f : ℝ → ℝ) (a b : ℝ) :
(⨍ x in a..b, f x) = (∫ x in a..b, f x) / (b - a) := by
rw [interval_average_eq, smul_eq_mul, div_eq_inv_mul]
|
MeasureTheory\Integral\IntervalIntegral.lean | /-
Copyright (c) 2020 Yury G. Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury G. Kudryashov, Patrick Massot, Sébastien Gouëzel
-/
import Mathlib.Order.Interval.Set.Disjoint
import Mathlib.MeasureTheory.Integral.SetIntegral
import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
/-!
# Integral over an interval
In this file we define `∫ x in a..b, f x ∂μ` to be `∫ x in Ioc a b, f x ∂μ` if `a ≤ b` and
`-∫ x in Ioc b a, f x ∂μ` if `b ≤ a`.
## Implementation notes
### Avoiding `if`, `min`, and `max`
In order to avoid `if`s in the definition, we define `IntervalIntegrable f μ a b` as
`IntegrableOn f (Ioc a b) μ ∧ IntegrableOn f (Ioc b a) μ`. For any `a`, `b` one of these
intervals is empty and the other coincides with `Set.uIoc a b = Set.Ioc (min a b) (max a b)`.
Similarly, we define `∫ x in a..b, f x ∂μ` to be `∫ x in Ioc a b, f x ∂μ - ∫ x in Ioc b a, f x ∂μ`.
Again, for any `a`, `b` one of these integrals is zero, and the other gives the expected result.
This way some properties can be translated from integrals over sets without dealing with
the cases `a ≤ b` and `b ≤ a` separately.
### Choice of the interval
We use integral over `Set.uIoc a b = Set.Ioc (min a b) (max a b)` instead of one of the other
three possible intervals with the same endpoints for two reasons:
* this way `∫ x in a..b, f x ∂μ + ∫ x in b..c, f x ∂μ = ∫ x in a..c, f x ∂μ` holds whenever
`f` is integrable on each interval; in particular, it works even if the measure `μ` has an atom
at `b`; this rules out `Set.Ioo` and `Set.Icc` intervals;
* with this definition for a probability measure `μ`, the integral `∫ x in a..b, 1 ∂μ` equals
the difference $F_μ(b)-F_μ(a)$, where $F_μ(a)=μ(-∞, a]$ is the
[cumulative distribution function](https://en.wikipedia.org/wiki/Cumulative_distribution_function)
of `μ`.
## Tags
integral
-/
noncomputable section
open scoped Classical
open MeasureTheory Set Filter Function
open scoped Classical Topology Filter ENNReal Interval NNReal
variable {ι 𝕜 E F A : Type*} [NormedAddCommGroup E]
/-!
### Integrability on an interval
-/
/-- A function `f` is called *interval integrable* with respect to a measure `μ` on an unordered
interval `a..b` if it is integrable on both intervals `(a, b]` and `(b, a]`. One of these
intervals is always empty, so this property is equivalent to `f` being integrable on
`(min a b, max a b]`. -/
def IntervalIntegrable (f : ℝ → E) (μ : Measure ℝ) (a b : ℝ) : Prop :=
IntegrableOn f (Ioc a b) μ ∧ IntegrableOn f (Ioc b a) μ
/-!
## Basic iff's for `IntervalIntegrable`
-/
section
variable {f : ℝ → E} {a b : ℝ} {μ : Measure ℝ}
/-- A function is interval integrable with respect to a given measure `μ` on `a..b` if and
only if it is integrable on `uIoc a b` with respect to `μ`. This is an equivalent
definition of `IntervalIntegrable`. -/
theorem intervalIntegrable_iff : IntervalIntegrable f μ a b ↔ IntegrableOn f (Ι a b) μ := by
rw [uIoc_eq_union, integrableOn_union, IntervalIntegrable]
/-- If a function is interval integrable with respect to a given measure `μ` on `a..b` then
it is integrable on `uIoc a b` with respect to `μ`. -/
theorem IntervalIntegrable.def' (h : IntervalIntegrable f μ a b) : IntegrableOn f (Ι a b) μ :=
intervalIntegrable_iff.mp h
theorem intervalIntegrable_iff_integrableOn_Ioc_of_le (hab : a ≤ b) :
IntervalIntegrable f μ a b ↔ IntegrableOn f (Ioc a b) μ := by
rw [intervalIntegrable_iff, uIoc_of_le hab]
theorem intervalIntegrable_iff' [NoAtoms μ] :
IntervalIntegrable f μ a b ↔ IntegrableOn f (uIcc a b) μ := by
rw [intervalIntegrable_iff, ← Icc_min_max, uIoc, integrableOn_Icc_iff_integrableOn_Ioc]
theorem intervalIntegrable_iff_integrableOn_Icc_of_le {f : ℝ → E} {a b : ℝ} (hab : a ≤ b)
{μ : Measure ℝ} [NoAtoms μ] : IntervalIntegrable f μ a b ↔ IntegrableOn f (Icc a b) μ := by
rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hab, integrableOn_Icc_iff_integrableOn_Ioc]
theorem intervalIntegrable_iff_integrableOn_Ico_of_le [NoAtoms μ] (hab : a ≤ b) :
IntervalIntegrable f μ a b ↔ IntegrableOn f (Ico a b) μ := by
rw [intervalIntegrable_iff_integrableOn_Icc_of_le hab, integrableOn_Icc_iff_integrableOn_Ico]
theorem intervalIntegrable_iff_integrableOn_Ioo_of_le [NoAtoms μ] (hab : a ≤ b) :
IntervalIntegrable f μ a b ↔ IntegrableOn f (Ioo a b) μ := by
rw [intervalIntegrable_iff_integrableOn_Icc_of_le hab, integrableOn_Icc_iff_integrableOn_Ioo]
/-- If a function is integrable with respect to a given measure `μ` then it is interval integrable
with respect to `μ` on `uIcc a b`. -/
theorem MeasureTheory.Integrable.intervalIntegrable (hf : Integrable f μ) :
IntervalIntegrable f μ a b :=
⟨hf.integrableOn, hf.integrableOn⟩
theorem MeasureTheory.IntegrableOn.intervalIntegrable (hf : IntegrableOn f [[a, b]] μ) :
IntervalIntegrable f μ a b :=
⟨MeasureTheory.IntegrableOn.mono_set hf (Ioc_subset_Icc_self.trans Icc_subset_uIcc),
MeasureTheory.IntegrableOn.mono_set hf (Ioc_subset_Icc_self.trans Icc_subset_uIcc')⟩
theorem intervalIntegrable_const_iff {c : E} :
IntervalIntegrable (fun _ => c) μ a b ↔ c = 0 ∨ μ (Ι a b) < ∞ := by
simp only [intervalIntegrable_iff, integrableOn_const]
@[simp] -- Porting note (#10618): simp can prove this
theorem intervalIntegrable_const [IsLocallyFiniteMeasure μ] {c : E} :
IntervalIntegrable (fun _ => c) μ a b :=
intervalIntegrable_const_iff.2 <| Or.inr measure_Ioc_lt_top
end
/-!
## Basic properties of interval integrability
- interval integrability is symmetric, reflexive, transitive
- monotonicity and strong measurability of the interval integral
- if `f` is interval integrable, so are its absolute value and norm
- arithmetic properties
-/
namespace IntervalIntegrable
section
variable {f : ℝ → E} {a b c d : ℝ} {μ ν : Measure ℝ}
@[symm]
nonrec theorem symm (h : IntervalIntegrable f μ a b) : IntervalIntegrable f μ b a :=
h.symm
@[refl, simp] -- Porting note: added `simp`
theorem refl : IntervalIntegrable f μ a a := by constructor <;> simp
@[trans]
theorem trans {a b c : ℝ} (hab : IntervalIntegrable f μ a b) (hbc : IntervalIntegrable f μ b c) :
IntervalIntegrable f μ a c :=
⟨(hab.1.union hbc.1).mono_set Ioc_subset_Ioc_union_Ioc,
(hbc.2.union hab.2).mono_set Ioc_subset_Ioc_union_Ioc⟩
theorem trans_iterate_Ico {a : ℕ → ℝ} {m n : ℕ} (hmn : m ≤ n)
(hint : ∀ k ∈ Ico m n, IntervalIntegrable f μ (a k) (a <| k + 1)) :
IntervalIntegrable f μ (a m) (a n) := by
revert hint
refine Nat.le_induction ?_ ?_ n hmn
· simp
· intro p hp IH h
exact (IH fun k hk => h k (Ico_subset_Ico_right p.le_succ hk)).trans (h p (by simp [hp]))
theorem trans_iterate {a : ℕ → ℝ} {n : ℕ}
(hint : ∀ k < n, IntervalIntegrable f μ (a k) (a <| k + 1)) :
IntervalIntegrable f μ (a 0) (a n) :=
trans_iterate_Ico bot_le fun k hk => hint k hk.2
theorem neg (h : IntervalIntegrable f μ a b) : IntervalIntegrable (-f) μ a b :=
⟨h.1.neg, h.2.neg⟩
theorem norm (h : IntervalIntegrable f μ a b) : IntervalIntegrable (fun x => ‖f x‖) μ a b :=
⟨h.1.norm, h.2.norm⟩
theorem intervalIntegrable_norm_iff {f : ℝ → E} {μ : Measure ℝ} {a b : ℝ}
(hf : AEStronglyMeasurable f (μ.restrict (Ι a b))) :
IntervalIntegrable (fun t => ‖f t‖) μ a b ↔ IntervalIntegrable f μ a b := by
simp_rw [intervalIntegrable_iff, IntegrableOn]; exact integrable_norm_iff hf
theorem abs {f : ℝ → ℝ} (h : IntervalIntegrable f μ a b) :
IntervalIntegrable (fun x => |f x|) μ a b :=
h.norm
theorem mono (hf : IntervalIntegrable f ν a b) (h1 : [[c, d]] ⊆ [[a, b]]) (h2 : μ ≤ ν) :
IntervalIntegrable f μ c d :=
intervalIntegrable_iff.mpr <| hf.def'.mono (uIoc_subset_uIoc_of_uIcc_subset_uIcc h1) h2
theorem mono_measure (hf : IntervalIntegrable f ν a b) (h : μ ≤ ν) : IntervalIntegrable f μ a b :=
hf.mono Subset.rfl h
theorem mono_set (hf : IntervalIntegrable f μ a b) (h : [[c, d]] ⊆ [[a, b]]) :
IntervalIntegrable f μ c d :=
hf.mono h le_rfl
theorem mono_set_ae (hf : IntervalIntegrable f μ a b) (h : Ι c d ≤ᵐ[μ] Ι a b) :
IntervalIntegrable f μ c d :=
intervalIntegrable_iff.mpr <| hf.def'.mono_set_ae h
theorem mono_set' (hf : IntervalIntegrable f μ a b) (hsub : Ι c d ⊆ Ι a b) :
IntervalIntegrable f μ c d :=
hf.mono_set_ae <| eventually_of_forall hsub
theorem mono_fun [NormedAddCommGroup F] {g : ℝ → F} (hf : IntervalIntegrable f μ a b)
(hgm : AEStronglyMeasurable g (μ.restrict (Ι a b)))
(hle : (fun x => ‖g x‖) ≤ᵐ[μ.restrict (Ι a b)] fun x => ‖f x‖) : IntervalIntegrable g μ a b :=
intervalIntegrable_iff.2 <| hf.def'.integrable.mono hgm hle
theorem mono_fun' {g : ℝ → ℝ} (hg : IntervalIntegrable g μ a b)
(hfm : AEStronglyMeasurable f (μ.restrict (Ι a b)))
(hle : (fun x => ‖f x‖) ≤ᵐ[μ.restrict (Ι a b)] g) : IntervalIntegrable f μ a b :=
intervalIntegrable_iff.2 <| hg.def'.integrable.mono' hfm hle
protected theorem aestronglyMeasurable (h : IntervalIntegrable f μ a b) :
AEStronglyMeasurable f (μ.restrict (Ioc a b)) :=
h.1.aestronglyMeasurable
protected theorem aestronglyMeasurable' (h : IntervalIntegrable f μ a b) :
AEStronglyMeasurable f (μ.restrict (Ioc b a)) :=
h.2.aestronglyMeasurable
end
variable [NormedRing A] {f g : ℝ → E} {a b : ℝ} {μ : Measure ℝ}
theorem smul [NormedField 𝕜] [NormedSpace 𝕜 E] {f : ℝ → E} {a b : ℝ} {μ : Measure ℝ}
(h : IntervalIntegrable f μ a b) (r : 𝕜) : IntervalIntegrable (r • f) μ a b :=
⟨h.1.smul r, h.2.smul r⟩
@[simp]
theorem add (hf : IntervalIntegrable f μ a b) (hg : IntervalIntegrable g μ a b) :
IntervalIntegrable (fun x => f x + g x) μ a b :=
⟨hf.1.add hg.1, hf.2.add hg.2⟩
@[simp]
theorem sub (hf : IntervalIntegrable f μ a b) (hg : IntervalIntegrable g μ a b) :
IntervalIntegrable (fun x => f x - g x) μ a b :=
⟨hf.1.sub hg.1, hf.2.sub hg.2⟩
theorem sum (s : Finset ι) {f : ι → ℝ → E} (h : ∀ i ∈ s, IntervalIntegrable (f i) μ a b) :
IntervalIntegrable (∑ i ∈ s, f i) μ a b :=
⟨integrable_finset_sum' s fun i hi => (h i hi).1, integrable_finset_sum' s fun i hi => (h i hi).2⟩
theorem mul_continuousOn {f g : ℝ → A} (hf : IntervalIntegrable f μ a b)
(hg : ContinuousOn g [[a, b]]) : IntervalIntegrable (fun x => f x * g x) μ a b := by
rw [intervalIntegrable_iff] at hf ⊢
exact hf.mul_continuousOn_of_subset hg measurableSet_Ioc isCompact_uIcc Ioc_subset_Icc_self
theorem continuousOn_mul {f g : ℝ → A} (hf : IntervalIntegrable f μ a b)
(hg : ContinuousOn g [[a, b]]) : IntervalIntegrable (fun x => g x * f x) μ a b := by
rw [intervalIntegrable_iff] at hf ⊢
exact hf.continuousOn_mul_of_subset hg isCompact_uIcc measurableSet_Ioc Ioc_subset_Icc_self
@[simp]
theorem const_mul {f : ℝ → A} (hf : IntervalIntegrable f μ a b) (c : A) :
IntervalIntegrable (fun x => c * f x) μ a b :=
hf.continuousOn_mul continuousOn_const
@[simp]
theorem mul_const {f : ℝ → A} (hf : IntervalIntegrable f μ a b) (c : A) :
IntervalIntegrable (fun x => f x * c) μ a b :=
hf.mul_continuousOn continuousOn_const
@[simp]
theorem div_const {𝕜 : Type*} {f : ℝ → 𝕜} [NormedField 𝕜] (h : IntervalIntegrable f μ a b)
(c : 𝕜) : IntervalIntegrable (fun x => f x / c) μ a b := by
simpa only [div_eq_mul_inv] using mul_const h c⁻¹
theorem comp_mul_left (hf : IntervalIntegrable f volume a b) (c : ℝ) :
IntervalIntegrable (fun x => f (c * x)) volume (a / c) (b / c) := by
rcases eq_or_ne c 0 with (hc | hc); · rw [hc]; simp
rw [intervalIntegrable_iff'] at hf ⊢
have A : MeasurableEmbedding fun x => x * c⁻¹ :=
(Homeomorph.mulRight₀ _ (inv_ne_zero hc)).closedEmbedding.measurableEmbedding
rw [← Real.smul_map_volume_mul_right (inv_ne_zero hc), IntegrableOn, Measure.restrict_smul,
integrable_smul_measure (by simpa : ENNReal.ofReal |c⁻¹| ≠ 0) ENNReal.ofReal_ne_top,
← IntegrableOn, MeasurableEmbedding.integrableOn_map_iff A]
convert hf using 1
· ext; simp only [comp_apply]; congr 1; field_simp
· rw [preimage_mul_const_uIcc (inv_ne_zero hc)]; field_simp [hc]
theorem comp_mul_left_iff {c : ℝ} (hc : c ≠ 0) :
IntervalIntegrable (fun x ↦ f (c * x)) volume (a / c) (b / c) ↔
IntervalIntegrable f volume a b :=
⟨fun h ↦ by simpa [hc] using h.comp_mul_left c⁻¹, (comp_mul_left · c)⟩
theorem comp_mul_right (hf : IntervalIntegrable f volume a b) (c : ℝ) :
IntervalIntegrable (fun x => f (x * c)) volume (a / c) (b / c) := by
simpa only [mul_comm] using comp_mul_left hf c
theorem comp_add_right (hf : IntervalIntegrable f volume a b) (c : ℝ) :
IntervalIntegrable (fun x => f (x + c)) volume (a - c) (b - c) := by
wlog h : a ≤ b generalizing a b
· exact IntervalIntegrable.symm (this hf.symm (le_of_not_le h))
rw [intervalIntegrable_iff'] at hf ⊢
have A : MeasurableEmbedding fun x => x + c :=
(Homeomorph.addRight c).closedEmbedding.measurableEmbedding
rw [← map_add_right_eq_self volume c] at hf
convert (MeasurableEmbedding.integrableOn_map_iff A).mp hf using 1
rw [preimage_add_const_uIcc]
theorem comp_add_left (hf : IntervalIntegrable f volume a b) (c : ℝ) :
IntervalIntegrable (fun x => f (c + x)) volume (a - c) (b - c) := by
simpa only [add_comm] using IntervalIntegrable.comp_add_right hf c
theorem comp_sub_right (hf : IntervalIntegrable f volume a b) (c : ℝ) :
IntervalIntegrable (fun x => f (x - c)) volume (a + c) (b + c) := by
simpa only [sub_neg_eq_add] using IntervalIntegrable.comp_add_right hf (-c)
theorem iff_comp_neg :
IntervalIntegrable f volume a b ↔ IntervalIntegrable (fun x => f (-x)) volume (-a) (-b) := by
rw [← comp_mul_left_iff (neg_ne_zero.2 one_ne_zero)]; simp [div_neg]
theorem comp_sub_left (hf : IntervalIntegrable f volume a b) (c : ℝ) :
IntervalIntegrable (fun x => f (c - x)) volume (c - a) (c - b) := by
simpa only [neg_sub, ← sub_eq_add_neg] using iff_comp_neg.mp (hf.comp_add_left c)
end IntervalIntegrable
/-!
## Continuous functions are interval integrable
-/
section
variable {μ : Measure ℝ} [IsLocallyFiniteMeasure μ]
theorem ContinuousOn.intervalIntegrable {u : ℝ → E} {a b : ℝ} (hu : ContinuousOn u (uIcc a b)) :
IntervalIntegrable u μ a b :=
(ContinuousOn.integrableOn_Icc hu).intervalIntegrable
theorem ContinuousOn.intervalIntegrable_of_Icc {u : ℝ → E} {a b : ℝ} (h : a ≤ b)
(hu : ContinuousOn u (Icc a b)) : IntervalIntegrable u μ a b :=
ContinuousOn.intervalIntegrable ((uIcc_of_le h).symm ▸ hu)
/-- A continuous function on `ℝ` is `IntervalIntegrable` with respect to any locally finite measure
`ν` on ℝ. -/
theorem Continuous.intervalIntegrable {u : ℝ → E} (hu : Continuous u) (a b : ℝ) :
IntervalIntegrable u μ a b :=
hu.continuousOn.intervalIntegrable
end
/-!
## Monotone and antitone functions are integral integrable
-/
section
variable {μ : Measure ℝ} [IsLocallyFiniteMeasure μ] [ConditionallyCompleteLinearOrder E]
[OrderTopology E] [SecondCountableTopology E]
theorem MonotoneOn.intervalIntegrable {u : ℝ → E} {a b : ℝ} (hu : MonotoneOn u (uIcc a b)) :
IntervalIntegrable u μ a b := by
rw [intervalIntegrable_iff]
exact (hu.integrableOn_isCompact isCompact_uIcc).mono_set Ioc_subset_Icc_self
theorem AntitoneOn.intervalIntegrable {u : ℝ → E} {a b : ℝ} (hu : AntitoneOn u (uIcc a b)) :
IntervalIntegrable u μ a b :=
hu.dual_right.intervalIntegrable
theorem Monotone.intervalIntegrable {u : ℝ → E} {a b : ℝ} (hu : Monotone u) :
IntervalIntegrable u μ a b :=
(hu.monotoneOn _).intervalIntegrable
theorem Antitone.intervalIntegrable {u : ℝ → E} {a b : ℝ} (hu : Antitone u) :
IntervalIntegrable u μ a b :=
(hu.antitoneOn _).intervalIntegrable
end
/-- Let `l'` be a measurably generated filter; let `l` be a of filter such that each `s ∈ l'`
eventually includes `Ioc u v` as both `u` and `v` tend to `l`. Let `μ` be a measure finite at `l'`.
Suppose that `f : ℝ → E` has a finite limit at `l' ⊓ ae μ`. Then `f` is interval integrable on
`u..v` provided that both `u` and `v` tend to `l`.
Typeclass instances allow Lean to find `l'` based on `l` but not vice versa, so
`apply Tendsto.eventually_intervalIntegrable_ae` will generate goals `Filter ℝ` and
`TendstoIxxClass Ioc ?m_1 l'`. -/
theorem Filter.Tendsto.eventually_intervalIntegrable_ae {f : ℝ → E} {μ : Measure ℝ}
{l l' : Filter ℝ} (hfm : StronglyMeasurableAtFilter f l' μ) [TendstoIxxClass Ioc l l']
[IsMeasurablyGenerated l'] (hμ : μ.FiniteAtFilter l') {c : E} (hf : Tendsto f (l' ⊓ ae μ) (𝓝 c))
{u v : ι → ℝ} {lt : Filter ι} (hu : Tendsto u lt l) (hv : Tendsto v lt l) :
∀ᶠ t in lt, IntervalIntegrable f μ (u t) (v t) :=
have := (hf.integrableAtFilter_ae hfm hμ).eventually
((hu.Ioc hv).eventually this).and <| (hv.Ioc hu).eventually this
/-- Let `l'` be a measurably generated filter; let `l` be a of filter such that each `s ∈ l'`
eventually includes `Ioc u v` as both `u` and `v` tend to `l`. Let `μ` be a measure finite at `l'`.
Suppose that `f : ℝ → E` has a finite limit at `l`. Then `f` is interval integrable on `u..v`
provided that both `u` and `v` tend to `l`.
Typeclass instances allow Lean to find `l'` based on `l` but not vice versa, so
`apply Tendsto.eventually_intervalIntegrable` will generate goals `Filter ℝ` and
`TendstoIxxClass Ioc ?m_1 l'`. -/
theorem Filter.Tendsto.eventually_intervalIntegrable {f : ℝ → E} {μ : Measure ℝ} {l l' : Filter ℝ}
(hfm : StronglyMeasurableAtFilter f l' μ) [TendstoIxxClass Ioc l l'] [IsMeasurablyGenerated l']
(hμ : μ.FiniteAtFilter l') {c : E} (hf : Tendsto f l' (𝓝 c)) {u v : ι → ℝ} {lt : Filter ι}
(hu : Tendsto u lt l) (hv : Tendsto v lt l) : ∀ᶠ t in lt, IntervalIntegrable f μ (u t) (v t) :=
(hf.mono_left inf_le_left).eventually_intervalIntegrable_ae hfm hμ hu hv
/-!
### Interval integral: definition and basic properties
In this section we define `∫ x in a..b, f x ∂μ` as `∫ x in Ioc a b, f x ∂μ - ∫ x in Ioc b a, f x ∂μ`
and prove some basic properties.
-/
variable [CompleteSpace E] [NormedSpace ℝ E]
/-- The interval integral `∫ x in a..b, f x ∂μ` is defined
as `∫ x in Ioc a b, f x ∂μ - ∫ x in Ioc b a, f x ∂μ`. If `a ≤ b`, then it equals
`∫ x in Ioc a b, f x ∂μ`, otherwise it equals `-∫ x in Ioc b a, f x ∂μ`. -/
def intervalIntegral (f : ℝ → E) (a b : ℝ) (μ : Measure ℝ) : E :=
(∫ x in Ioc a b, f x ∂μ) - ∫ x in Ioc b a, f x ∂μ
notation3"∫ "(...)" in "a".."b", "r:60:(scoped f => f)" ∂"μ:70 => intervalIntegral r a b μ
notation3"∫ "(...)" in "a".."b", "r:60:(scoped f => intervalIntegral f a b volume) => r
namespace intervalIntegral
section Basic
variable {a b : ℝ} {f g : ℝ → E} {μ : Measure ℝ}
@[simp]
theorem integral_zero : (∫ _ in a..b, (0 : E) ∂μ) = 0 := by simp [intervalIntegral]
theorem integral_of_le (h : a ≤ b) : ∫ x in a..b, f x ∂μ = ∫ x in Ioc a b, f x ∂μ := by
simp [intervalIntegral, h]
@[simp]
theorem integral_same : ∫ x in a..a, f x ∂μ = 0 :=
sub_self _
theorem integral_symm (a b) : ∫ x in b..a, f x ∂μ = -∫ x in a..b, f x ∂μ := by
simp only [intervalIntegral, neg_sub]
theorem integral_of_ge (h : b ≤ a) : ∫ x in a..b, f x ∂μ = -∫ x in Ioc b a, f x ∂μ := by
simp only [integral_symm b, integral_of_le h]
theorem intervalIntegral_eq_integral_uIoc (f : ℝ → E) (a b : ℝ) (μ : Measure ℝ) :
∫ x in a..b, f x ∂μ = (if a ≤ b then 1 else -1 : ℝ) • ∫ x in Ι a b, f x ∂μ := by
split_ifs with h
· simp only [integral_of_le h, uIoc_of_le h, one_smul]
· simp only [integral_of_ge (not_le.1 h).le, uIoc_of_ge (not_le.1 h).le, neg_one_smul]
theorem norm_intervalIntegral_eq (f : ℝ → E) (a b : ℝ) (μ : Measure ℝ) :
‖∫ x in a..b, f x ∂μ‖ = ‖∫ x in Ι a b, f x ∂μ‖ := by
simp_rw [intervalIntegral_eq_integral_uIoc, norm_smul]
split_ifs <;> simp only [norm_neg, norm_one, one_mul]
theorem abs_intervalIntegral_eq (f : ℝ → ℝ) (a b : ℝ) (μ : Measure ℝ) :
|∫ x in a..b, f x ∂μ| = |∫ x in Ι a b, f x ∂μ| :=
norm_intervalIntegral_eq f a b μ
theorem integral_cases (f : ℝ → E) (a b) :
(∫ x in a..b, f x ∂μ) ∈ ({∫ x in Ι a b, f x ∂μ, -∫ x in Ι a b, f x ∂μ} : Set E) := by
rw [intervalIntegral_eq_integral_uIoc]; split_ifs <;> simp
nonrec theorem integral_undef (h : ¬IntervalIntegrable f μ a b) : ∫ x in a..b, f x ∂μ = 0 := by
rw [intervalIntegrable_iff] at h
rw [intervalIntegral_eq_integral_uIoc, integral_undef h, smul_zero]
theorem intervalIntegrable_of_integral_ne_zero {a b : ℝ} {f : ℝ → E} {μ : Measure ℝ}
(h : (∫ x in a..b, f x ∂μ) ≠ 0) : IntervalIntegrable f μ a b :=
not_imp_comm.1 integral_undef h
nonrec theorem integral_non_aestronglyMeasurable
(hf : ¬AEStronglyMeasurable f (μ.restrict (Ι a b))) :
∫ x in a..b, f x ∂μ = 0 := by
rw [intervalIntegral_eq_integral_uIoc, integral_non_aestronglyMeasurable hf, smul_zero]
theorem integral_non_aestronglyMeasurable_of_le (h : a ≤ b)
(hf : ¬AEStronglyMeasurable f (μ.restrict (Ioc a b))) : ∫ x in a..b, f x ∂μ = 0 :=
integral_non_aestronglyMeasurable <| by rwa [uIoc_of_le h]
theorem norm_integral_min_max (f : ℝ → E) :
‖∫ x in min a b..max a b, f x ∂μ‖ = ‖∫ x in a..b, f x ∂μ‖ := by
cases le_total a b <;> simp [*, integral_symm a b]
theorem norm_integral_eq_norm_integral_Ioc (f : ℝ → E) :
‖∫ x in a..b, f x ∂μ‖ = ‖∫ x in Ι a b, f x ∂μ‖ := by
rw [← norm_integral_min_max, integral_of_le min_le_max, uIoc]
theorem abs_integral_eq_abs_integral_uIoc (f : ℝ → ℝ) :
|∫ x in a..b, f x ∂μ| = |∫ x in Ι a b, f x ∂μ| :=
norm_integral_eq_norm_integral_Ioc f
theorem norm_integral_le_integral_norm_Ioc : ‖∫ x in a..b, f x ∂μ‖ ≤ ∫ x in Ι a b, ‖f x‖ ∂μ :=
calc
‖∫ x in a..b, f x ∂μ‖ = ‖∫ x in Ι a b, f x ∂μ‖ := norm_integral_eq_norm_integral_Ioc f
_ ≤ ∫ x in Ι a b, ‖f x‖ ∂μ := norm_integral_le_integral_norm f
theorem norm_integral_le_abs_integral_norm : ‖∫ x in a..b, f x ∂μ‖ ≤ |∫ x in a..b, ‖f x‖ ∂μ| := by
simp only [← Real.norm_eq_abs, norm_integral_eq_norm_integral_Ioc]
exact le_trans (norm_integral_le_integral_norm _) (le_abs_self _)
theorem norm_integral_le_integral_norm (h : a ≤ b) :
‖∫ x in a..b, f x ∂μ‖ ≤ ∫ x in a..b, ‖f x‖ ∂μ :=
norm_integral_le_integral_norm_Ioc.trans_eq <| by rw [uIoc_of_le h, integral_of_le h]
nonrec theorem norm_integral_le_of_norm_le {g : ℝ → ℝ} (h : ∀ᵐ t ∂μ.restrict <| Ι a b, ‖f t‖ ≤ g t)
(hbound : IntervalIntegrable g μ a b) : ‖∫ t in a..b, f t ∂μ‖ ≤ |∫ t in a..b, g t ∂μ| := by
simp_rw [norm_intervalIntegral_eq, abs_intervalIntegral_eq,
abs_eq_self.mpr (integral_nonneg_of_ae <| h.mono fun _t ht => (norm_nonneg _).trans ht),
norm_integral_le_of_norm_le hbound.def' h]
theorem norm_integral_le_of_norm_le_const_ae {a b C : ℝ} {f : ℝ → E}
(h : ∀ᵐ x, x ∈ Ι a b → ‖f x‖ ≤ C) : ‖∫ x in a..b, f x‖ ≤ C * |b - a| := by
rw [norm_integral_eq_norm_integral_Ioc]
convert norm_setIntegral_le_of_norm_le_const_ae'' _ measurableSet_Ioc h using 1
· rw [Real.volume_Ioc, max_sub_min_eq_abs, ENNReal.toReal_ofReal (abs_nonneg _)]
· simp only [Real.volume_Ioc, ENNReal.ofReal_lt_top]
theorem norm_integral_le_of_norm_le_const {a b C : ℝ} {f : ℝ → E} (h : ∀ x ∈ Ι a b, ‖f x‖ ≤ C) :
‖∫ x in a..b, f x‖ ≤ C * |b - a| :=
norm_integral_le_of_norm_le_const_ae <| eventually_of_forall h
@[simp]
nonrec theorem integral_add (hf : IntervalIntegrable f μ a b) (hg : IntervalIntegrable g μ a b) :
∫ x in a..b, f x + g x ∂μ = (∫ x in a..b, f x ∂μ) + ∫ x in a..b, g x ∂μ := by
simp only [intervalIntegral_eq_integral_uIoc, integral_add hf.def' hg.def', smul_add]
nonrec theorem integral_finset_sum {ι} {s : Finset ι} {f : ι → ℝ → E}
(h : ∀ i ∈ s, IntervalIntegrable (f i) μ a b) :
∫ x in a..b, ∑ i ∈ s, f i x ∂μ = ∑ i ∈ s, ∫ x in a..b, f i x ∂μ := by
simp only [intervalIntegral_eq_integral_uIoc, integral_finset_sum s fun i hi => (h i hi).def',
Finset.smul_sum]
@[simp]
nonrec theorem integral_neg : ∫ x in a..b, -f x ∂μ = -∫ x in a..b, f x ∂μ := by
simp only [intervalIntegral, integral_neg]; abel
@[simp]
theorem integral_sub (hf : IntervalIntegrable f μ a b) (hg : IntervalIntegrable g μ a b) :
∫ x in a..b, f x - g x ∂μ = (∫ x in a..b, f x ∂μ) - ∫ x in a..b, g x ∂μ := by
simpa only [sub_eq_add_neg] using (integral_add hf hg.neg).trans (congr_arg _ integral_neg)
@[simp]
nonrec theorem integral_smul {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
[SMulCommClass ℝ 𝕜 E] (r : 𝕜) (f : ℝ → E) :
∫ x in a..b, r • f x ∂μ = r • ∫ x in a..b, f x ∂μ := by
simp only [intervalIntegral, integral_smul, smul_sub]
@[simp]
nonrec theorem integral_smul_const {𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 E] (f : ℝ → 𝕜) (c : E) :
∫ x in a..b, f x • c ∂μ = (∫ x in a..b, f x ∂μ) • c := by
simp only [intervalIntegral_eq_integral_uIoc, integral_smul_const, smul_assoc]
@[simp]
theorem integral_const_mul {𝕜 : Type*} [RCLike 𝕜] (r : 𝕜) (f : ℝ → 𝕜) :
∫ x in a..b, r * f x ∂μ = r * ∫ x in a..b, f x ∂μ :=
integral_smul r f
@[simp]
theorem integral_mul_const {𝕜 : Type*} [RCLike 𝕜] (r : 𝕜) (f : ℝ → 𝕜) :
∫ x in a..b, f x * r ∂μ = (∫ x in a..b, f x ∂μ) * r := by
simpa only [mul_comm r] using integral_const_mul r f
@[simp]
theorem integral_div {𝕜 : Type*} [RCLike 𝕜] (r : 𝕜) (f : ℝ → 𝕜) :
∫ x in a..b, f x / r ∂μ = (∫ x in a..b, f x ∂μ) / r := by
simpa only [div_eq_mul_inv] using integral_mul_const r⁻¹ f
theorem integral_const' (c : E) :
∫ _ in a..b, c ∂μ = ((μ <| Ioc a b).toReal - (μ <| Ioc b a).toReal) • c := by
simp only [intervalIntegral, setIntegral_const, sub_smul]
@[simp]
theorem integral_const (c : E) : ∫ _ in a..b, c = (b - a) • c := by
simp only [integral_const', Real.volume_Ioc, ENNReal.toReal_ofReal', ← neg_sub b,
max_zero_sub_eq_self]
nonrec theorem integral_smul_measure (c : ℝ≥0∞) :
∫ x in a..b, f x ∂c • μ = c.toReal • ∫ x in a..b, f x ∂μ := by
simp only [intervalIntegral, Measure.restrict_smul, integral_smul_measure, smul_sub]
end Basic
-- Porting note (#11215): TODO: add `Complex.ofReal` version of `_root_.integral_ofReal`
nonrec theorem _root_.RCLike.intervalIntegral_ofReal {𝕜 : Type*} [RCLike 𝕜] {a b : ℝ}
{μ : Measure ℝ} {f : ℝ → ℝ} : (∫ x in a..b, (f x : 𝕜) ∂μ) = ↑(∫ x in a..b, f x ∂μ) := by
simp only [intervalIntegral, integral_ofReal, RCLike.ofReal_sub]
@[deprecated (since := "2024-04-06")]
alias RCLike.interval_integral_ofReal := RCLike.intervalIntegral_ofReal
nonrec theorem integral_ofReal {a b : ℝ} {μ : Measure ℝ} {f : ℝ → ℝ} :
(∫ x in a..b, (f x : ℂ) ∂μ) = ↑(∫ x in a..b, f x ∂μ) :=
RCLike.intervalIntegral_ofReal
section ContinuousLinearMap
variable {a b : ℝ} {μ : Measure ℝ} {f : ℝ → E}
variable [RCLike 𝕜] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F]
open ContinuousLinearMap
theorem _root_.ContinuousLinearMap.intervalIntegral_apply {a b : ℝ} {φ : ℝ → F →L[𝕜] E}
(hφ : IntervalIntegrable φ μ a b) (v : F) :
(∫ x in a..b, φ x ∂μ) v = ∫ x in a..b, φ x v ∂μ := by
simp_rw [intervalIntegral_eq_integral_uIoc, ← integral_apply hφ.def' v, coe_smul', Pi.smul_apply]
variable [NormedSpace ℝ F] [CompleteSpace F]
theorem _root_.ContinuousLinearMap.intervalIntegral_comp_comm (L : E →L[𝕜] F)
(hf : IntervalIntegrable f μ a b) : (∫ x in a..b, L (f x) ∂μ) = L (∫ x in a..b, f x ∂μ) := by
simp_rw [intervalIntegral, L.integral_comp_comm hf.1, L.integral_comp_comm hf.2, L.map_sub]
end ContinuousLinearMap
/-!
## Basic arithmetic
Includes addition, scalar multiplication and affine transformations.
-/
section Comp
variable {a b c d : ℝ} (f : ℝ → E)
/-!
Porting note: some `@[simp]` attributes in this section were removed to make the `simpNF` linter
happy. TODO: find out if these lemmas are actually good or bad `simp` lemmas.
-/
@[simp] -- Porting note (#10618): was @[simp]
theorem integral_comp_mul_right (hc : c ≠ 0) :
(∫ x in a..b, f (x * c)) = c⁻¹ • ∫ x in a * c..b * c, f x := by
have A : MeasurableEmbedding fun x => x * c :=
(Homeomorph.mulRight₀ c hc).closedEmbedding.measurableEmbedding
conv_rhs => rw [← Real.smul_map_volume_mul_right hc]
simp_rw [integral_smul_measure, intervalIntegral, A.setIntegral_map,
ENNReal.toReal_ofReal (abs_nonneg c)]
cases' hc.lt_or_lt with h h
· simp [h, mul_div_cancel_right₀, hc, abs_of_neg,
Measure.restrict_congr_set (α := ℝ) (μ := volume) Ico_ae_eq_Ioc]
· simp [h, mul_div_cancel_right₀, hc, abs_of_pos]
@[simp] -- Porting note (#10618): was @[simp]
theorem smul_integral_comp_mul_right (c) :
(c • ∫ x in a..b, f (x * c)) = ∫ x in a * c..b * c, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_mul_right]
@[simp] -- Porting note (#10618): was @[simp]
theorem integral_comp_mul_left (hc : c ≠ 0) :
(∫ x in a..b, f (c * x)) = c⁻¹ • ∫ x in c * a..c * b, f x := by
simpa only [mul_comm c] using integral_comp_mul_right f hc
@[simp] -- Porting note (#10618): was @[simp]
theorem smul_integral_comp_mul_left (c) :
(c • ∫ x in a..b, f (c * x)) = ∫ x in c * a..c * b, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_mul_left]
@[simp] -- Porting note (#10618): was @[simp]
theorem integral_comp_div (hc : c ≠ 0) :
(∫ x in a..b, f (x / c)) = c • ∫ x in a / c..b / c, f x := by
simpa only [inv_inv] using integral_comp_mul_right f (inv_ne_zero hc)
@[simp] -- Porting note (#10618): was @[simp]
theorem inv_smul_integral_comp_div (c) :
(c⁻¹ • ∫ x in a..b, f (x / c)) = ∫ x in a / c..b / c, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_div]
@[simp] -- Porting note (#10618): was @[simp]
theorem integral_comp_add_right (d) : (∫ x in a..b, f (x + d)) = ∫ x in a + d..b + d, f x :=
have A : MeasurableEmbedding fun x => x + d :=
(Homeomorph.addRight d).closedEmbedding.measurableEmbedding
calc
(∫ x in a..b, f (x + d)) = ∫ x in a + d..b + d, f x ∂Measure.map (fun x => x + d) volume := by
simp [intervalIntegral, A.setIntegral_map]
_ = ∫ x in a + d..b + d, f x := by rw [map_add_right_eq_self]
@[simp] -- Porting note (#10618): was @[simp]
nonrec theorem integral_comp_add_left (d) :
(∫ x in a..b, f (d + x)) = ∫ x in d + a..d + b, f x := by
simpa only [add_comm d] using integral_comp_add_right f d
@[simp] -- Porting note (#10618): was @[simp]
theorem integral_comp_mul_add (hc : c ≠ 0) (d) :
(∫ x in a..b, f (c * x + d)) = c⁻¹ • ∫ x in c * a + d..c * b + d, f x := by
rw [← integral_comp_add_right, ← integral_comp_mul_left _ hc]
@[simp] -- Porting note (#10618): was @[simp]
theorem smul_integral_comp_mul_add (c d) :
(c • ∫ x in a..b, f (c * x + d)) = ∫ x in c * a + d..c * b + d, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_mul_add]
@[simp] -- Porting note (#10618): was @[simp]
theorem integral_comp_add_mul (hc : c ≠ 0) (d) :
(∫ x in a..b, f (d + c * x)) = c⁻¹ • ∫ x in d + c * a..d + c * b, f x := by
rw [← integral_comp_add_left, ← integral_comp_mul_left _ hc]
-- Porting note (#10618): was @[simp]
theorem smul_integral_comp_add_mul (c d) :
(c • ∫ x in a..b, f (d + c * x)) = ∫ x in d + c * a..d + c * b, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_add_mul]
-- Porting note (#10618): was @[simp]
theorem integral_comp_div_add (hc : c ≠ 0) (d) :
(∫ x in a..b, f (x / c + d)) = c • ∫ x in a / c + d..b / c + d, f x := by
simpa only [div_eq_inv_mul, inv_inv] using integral_comp_mul_add f (inv_ne_zero hc) d
-- Porting note (#10618): was @[simp]
theorem inv_smul_integral_comp_div_add (c d) :
(c⁻¹ • ∫ x in a..b, f (x / c + d)) = ∫ x in a / c + d..b / c + d, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_div_add]
-- Porting note (#10618): was @[simp]
theorem integral_comp_add_div (hc : c ≠ 0) (d) :
(∫ x in a..b, f (d + x / c)) = c • ∫ x in d + a / c..d + b / c, f x := by
simpa only [div_eq_inv_mul, inv_inv] using integral_comp_add_mul f (inv_ne_zero hc) d
-- Porting note (#10618): was @[simp]
theorem inv_smul_integral_comp_add_div (c d) :
(c⁻¹ • ∫ x in a..b, f (d + x / c)) = ∫ x in d + a / c..d + b / c, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_add_div]
-- Porting note (#10618): was @[simp]
theorem integral_comp_mul_sub (hc : c ≠ 0) (d) :
(∫ x in a..b, f (c * x - d)) = c⁻¹ • ∫ x in c * a - d..c * b - d, f x := by
simpa only [sub_eq_add_neg] using integral_comp_mul_add f hc (-d)
-- Porting note (#10618): was @[simp]
theorem smul_integral_comp_mul_sub (c d) :
(c • ∫ x in a..b, f (c * x - d)) = ∫ x in c * a - d..c * b - d, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_mul_sub]
-- Porting note (#10618): was @[simp]
theorem integral_comp_sub_mul (hc : c ≠ 0) (d) :
(∫ x in a..b, f (d - c * x)) = c⁻¹ • ∫ x in d - c * b..d - c * a, f x := by
simp only [sub_eq_add_neg, neg_mul_eq_neg_mul]
rw [integral_comp_add_mul f (neg_ne_zero.mpr hc) d, integral_symm]
simp only [inv_neg, smul_neg, neg_neg, neg_smul]
-- Porting note (#10618): was @[simp]
theorem smul_integral_comp_sub_mul (c d) :
(c • ∫ x in a..b, f (d - c * x)) = ∫ x in d - c * b..d - c * a, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_sub_mul]
-- Porting note (#10618): was @[simp]
theorem integral_comp_div_sub (hc : c ≠ 0) (d) :
(∫ x in a..b, f (x / c - d)) = c • ∫ x in a / c - d..b / c - d, f x := by
simpa only [div_eq_inv_mul, inv_inv] using integral_comp_mul_sub f (inv_ne_zero hc) d
-- Porting note (#10618): was @[simp]
theorem inv_smul_integral_comp_div_sub (c d) :
(c⁻¹ • ∫ x in a..b, f (x / c - d)) = ∫ x in a / c - d..b / c - d, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_div_sub]
-- Porting note (#10618): was @[simp]
theorem integral_comp_sub_div (hc : c ≠ 0) (d) :
(∫ x in a..b, f (d - x / c)) = c • ∫ x in d - b / c..d - a / c, f x := by
simpa only [div_eq_inv_mul, inv_inv] using integral_comp_sub_mul f (inv_ne_zero hc) d
-- Porting note (#10618): was @[simp]
theorem inv_smul_integral_comp_sub_div (c d) :
(c⁻¹ • ∫ x in a..b, f (d - x / c)) = ∫ x in d - b / c..d - a / c, f x := by
by_cases hc : c = 0 <;> simp [hc, integral_comp_sub_div]
-- Porting note (#10618): was @[simp]
theorem integral_comp_sub_right (d) : (∫ x in a..b, f (x - d)) = ∫ x in a - d..b - d, f x := by
simpa only [sub_eq_add_neg] using integral_comp_add_right f (-d)
-- Porting note (#10618): was @[simp]
theorem integral_comp_sub_left (d) : (∫ x in a..b, f (d - x)) = ∫ x in d - b..d - a, f x := by
simpa only [one_mul, one_smul, inv_one] using integral_comp_sub_mul f one_ne_zero d
-- Porting note (#10618): was @[simp]
theorem integral_comp_neg : (∫ x in a..b, f (-x)) = ∫ x in -b..-a, f x := by
simpa only [zero_sub] using integral_comp_sub_left f 0
end Comp
/-!
### Integral is an additive function of the interval
In this section we prove that `∫ x in a..b, f x ∂μ + ∫ x in b..c, f x ∂μ = ∫ x in a..c, f x ∂μ`
as well as a few other identities trivially equivalent to this one. We also prove that
`∫ x in a..b, f x ∂μ = ∫ x, f x ∂μ` provided that `support f ⊆ Ioc a b`.
-/
section OrderClosedTopology
variable {a b c d : ℝ} {f g : ℝ → E} {μ : Measure ℝ}
/-- If two functions are equal in the relevant interval, their interval integrals are also equal. -/
theorem integral_congr {a b : ℝ} (h : EqOn f g [[a, b]]) :
∫ x in a..b, f x ∂μ = ∫ x in a..b, g x ∂μ := by
rcases le_total a b with hab | hab <;>
simpa [hab, integral_of_le, integral_of_ge] using
setIntegral_congr measurableSet_Ioc (h.mono Ioc_subset_Icc_self)
theorem integral_add_adjacent_intervals_cancel (hab : IntervalIntegrable f μ a b)
(hbc : IntervalIntegrable f μ b c) :
(((∫ x in a..b, f x ∂μ) + ∫ x in b..c, f x ∂μ) + ∫ x in c..a, f x ∂μ) = 0 := by
have hac := hab.trans hbc
simp only [intervalIntegral, sub_add_sub_comm, sub_eq_zero]
iterate 4 rw [← integral_union]
· suffices Ioc a b ∪ Ioc b c ∪ Ioc c a = Ioc b a ∪ Ioc c b ∪ Ioc a c by rw [this]
rw [Ioc_union_Ioc_union_Ioc_cycle, union_right_comm, Ioc_union_Ioc_union_Ioc_cycle,
min_left_comm, max_left_comm]
all_goals
simp [*, MeasurableSet.union, measurableSet_Ioc, Ioc_disjoint_Ioc_same,
Ioc_disjoint_Ioc_same.symm, hab.1, hab.2, hbc.1, hbc.2, hac.1, hac.2]
theorem integral_add_adjacent_intervals (hab : IntervalIntegrable f μ a b)
(hbc : IntervalIntegrable f μ b c) :
((∫ x in a..b, f x ∂μ) + ∫ x in b..c, f x ∂μ) = ∫ x in a..c, f x ∂μ := by
rw [← add_neg_eq_zero, ← integral_symm, integral_add_adjacent_intervals_cancel hab hbc]
theorem sum_integral_adjacent_intervals_Ico {a : ℕ → ℝ} {m n : ℕ} (hmn : m ≤ n)
(hint : ∀ k ∈ Ico m n, IntervalIntegrable f μ (a k) (a <| k + 1)) :
∑ k ∈ Finset.Ico m n, ∫ x in a k..a <| k + 1, f x ∂μ = ∫ x in a m..a n, f x ∂μ := by
revert hint
refine Nat.le_induction ?_ ?_ n hmn
· simp
· intro p hmp IH h
rw [Finset.sum_Ico_succ_top hmp, IH, integral_add_adjacent_intervals]
· refine IntervalIntegrable.trans_iterate_Ico hmp fun k hk => h k ?_
exact (Ico_subset_Ico le_rfl (Nat.le_succ _)) hk
· apply h
simp [hmp]
· intro k hk
exact h _ (Ico_subset_Ico_right p.le_succ hk)
theorem sum_integral_adjacent_intervals {a : ℕ → ℝ} {n : ℕ}
(hint : ∀ k < n, IntervalIntegrable f μ (a k) (a <| k + 1)) :
∑ k ∈ Finset.range n, ∫ x in a k..a <| k + 1, f x ∂μ = ∫ x in (a 0)..(a n), f x ∂μ := by
rw [← Nat.Ico_zero_eq_range]
exact sum_integral_adjacent_intervals_Ico (zero_le n) fun k hk => hint k hk.2
theorem integral_interval_sub_left (hab : IntervalIntegrable f μ a b)
(hac : IntervalIntegrable f μ a c) :
((∫ x in a..b, f x ∂μ) - ∫ x in a..c, f x ∂μ) = ∫ x in c..b, f x ∂μ :=
sub_eq_of_eq_add' <| Eq.symm <| integral_add_adjacent_intervals hac (hac.symm.trans hab)
theorem integral_interval_add_interval_comm (hab : IntervalIntegrable f μ a b)
(hcd : IntervalIntegrable f μ c d) (hac : IntervalIntegrable f μ a c) :
((∫ x in a..b, f x ∂μ) + ∫ x in c..d, f x ∂μ) =
(∫ x in a..d, f x ∂μ) + ∫ x in c..b, f x ∂μ := by
rw [← integral_add_adjacent_intervals hac hcd, add_assoc, add_left_comm,
integral_add_adjacent_intervals hac (hac.symm.trans hab), add_comm]
theorem integral_interval_sub_interval_comm (hab : IntervalIntegrable f μ a b)
(hcd : IntervalIntegrable f μ c d) (hac : IntervalIntegrable f μ a c) :
((∫ x in a..b, f x ∂μ) - ∫ x in c..d, f x ∂μ) =
(∫ x in a..c, f x ∂μ) - ∫ x in b..d, f x ∂μ := by
simp only [sub_eq_add_neg, ← integral_symm,
integral_interval_add_interval_comm hab hcd.symm (hac.trans hcd)]
theorem integral_interval_sub_interval_comm' (hab : IntervalIntegrable f μ a b)
(hcd : IntervalIntegrable f μ c d) (hac : IntervalIntegrable f μ a c) :
((∫ x in a..b, f x ∂μ) - ∫ x in c..d, f x ∂μ) =
(∫ x in d..b, f x ∂μ) - ∫ x in c..a, f x ∂μ := by
rw [integral_interval_sub_interval_comm hab hcd hac, integral_symm b d, integral_symm a c,
sub_neg_eq_add, sub_eq_neg_add]
theorem integral_Iic_sub_Iic (ha : IntegrableOn f (Iic a) μ) (hb : IntegrableOn f (Iic b) μ) :
((∫ x in Iic b, f x ∂μ) - ∫ x in Iic a, f x ∂μ) = ∫ x in a..b, f x ∂μ := by
wlog hab : a ≤ b generalizing a b
· rw [integral_symm, ← this hb ha (le_of_not_le hab), neg_sub]
rw [sub_eq_iff_eq_add', integral_of_le hab, ← integral_union (Iic_disjoint_Ioc le_rfl),
Iic_union_Ioc_eq_Iic hab]
exacts [measurableSet_Ioc, ha, hb.mono_set fun _ => And.right]
theorem integral_Iic_add_Ioi (h_left : IntegrableOn f (Iic b) μ)
(h_right : IntegrableOn f (Ioi b) μ) :
(∫ x in Iic b, f x ∂μ) + (∫ x in Ioi b, f x ∂μ) = ∫ (x : ℝ), f x ∂μ := by
convert (integral_union (Iic_disjoint_Ioi <| Eq.le rfl) measurableSet_Ioi h_left h_right).symm
rw [Iic_union_Ioi, Measure.restrict_univ]
theorem integral_Iio_add_Ici (h_left : IntegrableOn f (Iio b) μ)
(h_right : IntegrableOn f (Ici b) μ) :
(∫ x in Iio b, f x ∂μ) + (∫ x in Ici b, f x ∂μ) = ∫ (x : ℝ), f x ∂μ := by
convert (integral_union (Iio_disjoint_Ici <| Eq.le rfl) measurableSet_Ici h_left h_right).symm
rw [Iio_union_Ici, Measure.restrict_univ]
/-- If `μ` is a finite measure then `∫ x in a..b, c ∂μ = (μ (Iic b) - μ (Iic a)) • c`. -/
theorem integral_const_of_cdf [IsFiniteMeasure μ] (c : E) :
∫ _ in a..b, c ∂μ = ((μ (Iic b)).toReal - (μ (Iic a)).toReal) • c := by
simp only [sub_smul, ← setIntegral_const]
refine (integral_Iic_sub_Iic ?_ ?_).symm <;>
simp only [integrableOn_const, measure_lt_top, or_true_iff]
theorem integral_eq_integral_of_support_subset {a b} (h : support f ⊆ Ioc a b) :
∫ x in a..b, f x ∂μ = ∫ x, f x ∂μ := by
rcases le_total a b with hab | hab
· rw [integral_of_le hab, ← integral_indicator measurableSet_Ioc, indicator_eq_self.2 h]
· rw [Ioc_eq_empty hab.not_lt, subset_empty_iff, support_eq_empty_iff] at h
simp [h]
theorem integral_congr_ae' (h : ∀ᵐ x ∂μ, x ∈ Ioc a b → f x = g x)
(h' : ∀ᵐ x ∂μ, x ∈ Ioc b a → f x = g x) : ∫ x in a..b, f x ∂μ = ∫ x in a..b, g x ∂μ := by
simp only [intervalIntegral, setIntegral_congr_ae measurableSet_Ioc h,
setIntegral_congr_ae measurableSet_Ioc h']
theorem integral_congr_ae (h : ∀ᵐ x ∂μ, x ∈ Ι a b → f x = g x) :
∫ x in a..b, f x ∂μ = ∫ x in a..b, g x ∂μ :=
integral_congr_ae' (ae_uIoc_iff.mp h).1 (ae_uIoc_iff.mp h).2
theorem integral_zero_ae (h : ∀ᵐ x ∂μ, x ∈ Ι a b → f x = 0) : ∫ x in a..b, f x ∂μ = 0 :=
calc
∫ x in a..b, f x ∂μ = ∫ _ in a..b, 0 ∂μ := integral_congr_ae h
_ = 0 := integral_zero
nonrec theorem integral_indicator {a₁ a₂ a₃ : ℝ} (h : a₂ ∈ Icc a₁ a₃) :
∫ x in a₁..a₃, indicator {x | x ≤ a₂} f x ∂μ = ∫ x in a₁..a₂, f x ∂μ := by
have : {x | x ≤ a₂} ∩ Ioc a₁ a₃ = Ioc a₁ a₂ := Iic_inter_Ioc_of_le h.2
rw [integral_of_le h.1, integral_of_le (h.1.trans h.2), integral_indicator,
Measure.restrict_restrict, this]
· exact measurableSet_Iic
all_goals apply measurableSet_Iic
end OrderClosedTopology
section
variable {f g : ℝ → ℝ} {a b : ℝ} {μ : Measure ℝ}
theorem integral_eq_zero_iff_of_le_of_nonneg_ae (hab : a ≤ b) (hf : 0 ≤ᵐ[μ.restrict (Ioc a b)] f)
(hfi : IntervalIntegrable f μ a b) :
∫ x in a..b, f x ∂μ = 0 ↔ f =ᵐ[μ.restrict (Ioc a b)] 0 := by
rw [integral_of_le hab, integral_eq_zero_iff_of_nonneg_ae hf hfi.1]
theorem integral_eq_zero_iff_of_nonneg_ae (hf : 0 ≤ᵐ[μ.restrict (Ioc a b ∪ Ioc b a)] f)
(hfi : IntervalIntegrable f μ a b) :
∫ x in a..b, f x ∂μ = 0 ↔ f =ᵐ[μ.restrict (Ioc a b ∪ Ioc b a)] 0 := by
rcases le_total a b with hab | hab <;>
simp only [Ioc_eq_empty hab.not_lt, empty_union, union_empty] at hf ⊢
· exact integral_eq_zero_iff_of_le_of_nonneg_ae hab hf hfi
· rw [integral_symm, neg_eq_zero, integral_eq_zero_iff_of_le_of_nonneg_ae hab hf hfi.symm]
/-- If `f` is nonnegative and integrable on the unordered interval `Set.uIoc a b`, then its
integral over `a..b` is positive if and only if `a < b` and the measure of
`Function.support f ∩ Set.Ioc a b` is positive. -/
theorem integral_pos_iff_support_of_nonneg_ae' (hf : 0 ≤ᵐ[μ.restrict (Ι a b)] f)
(hfi : IntervalIntegrable f μ a b) :
(0 < ∫ x in a..b, f x ∂μ) ↔ a < b ∧ 0 < μ (support f ∩ Ioc a b) := by
cases' lt_or_le a b with hab hba
· rw [uIoc_of_le hab.le] at hf
simp only [hab, true_and_iff, integral_of_le hab.le,
setIntegral_pos_iff_support_of_nonneg_ae hf hfi.1]
· suffices (∫ x in a..b, f x ∂μ) ≤ 0 by simp only [this.not_lt, hba.not_lt, false_and_iff]
rw [integral_of_ge hba, neg_nonpos]
rw [uIoc_comm, uIoc_of_le hba] at hf
exact integral_nonneg_of_ae hf
/-- If `f` is nonnegative a.e.-everywhere and it is integrable on the unordered interval
`Set.uIoc a b`, then its integral over `a..b` is positive if and only if `a < b` and the
measure of `Function.support f ∩ Set.Ioc a b` is positive. -/
theorem integral_pos_iff_support_of_nonneg_ae (hf : 0 ≤ᵐ[μ] f) (hfi : IntervalIntegrable f μ a b) :
(0 < ∫ x in a..b, f x ∂μ) ↔ a < b ∧ 0 < μ (support f ∩ Ioc a b) :=
integral_pos_iff_support_of_nonneg_ae' (ae_mono Measure.restrict_le_self hf) hfi
/-- If `f : ℝ → ℝ` is integrable on `(a, b]` for real numbers `a < b`, and positive on the interior
of the interval, then its integral over `a..b` is strictly positive. -/
theorem intervalIntegral_pos_of_pos_on {f : ℝ → ℝ} {a b : ℝ} (hfi : IntervalIntegrable f volume a b)
(hpos : ∀ x : ℝ, x ∈ Ioo a b → 0 < f x) (hab : a < b) : 0 < ∫ x : ℝ in a..b, f x := by
have hsupp : Ioo a b ⊆ support f ∩ Ioc a b := fun x hx =>
⟨mem_support.mpr (hpos x hx).ne', Ioo_subset_Ioc_self hx⟩
have h₀ : 0 ≤ᵐ[volume.restrict (uIoc a b)] f := by
rw [EventuallyLE, uIoc_of_le hab.le]
refine ae_restrict_of_ae_eq_of_ae_restrict Ioo_ae_eq_Ioc ?_
rw [ae_restrict_iff' measurableSet_Ioo]
filter_upwards with x hx using (hpos x hx).le
rw [integral_pos_iff_support_of_nonneg_ae' h₀ hfi]
exact ⟨hab, ((Measure.measure_Ioo_pos _).mpr hab).trans_le (measure_mono hsupp)⟩
/-- If `f : ℝ → ℝ` is strictly positive everywhere, and integrable on `(a, b]` for real numbers
`a < b`, then its integral over `a..b` is strictly positive. (See `intervalIntegral_pos_of_pos_on`
for a version only assuming positivity of `f` on `(a, b)` rather than everywhere.) -/
theorem intervalIntegral_pos_of_pos {f : ℝ → ℝ} {a b : ℝ}
(hfi : IntervalIntegrable f MeasureSpace.volume a b) (hpos : ∀ x, 0 < f x) (hab : a < b) :
0 < ∫ x in a..b, f x :=
intervalIntegral_pos_of_pos_on hfi (fun x _ => hpos x) hab
/-- If `f` and `g` are two functions that are interval integrable on `a..b`, `a ≤ b`,
`f x ≤ g x` for a.e. `x ∈ Set.Ioc a b`, and `f x < g x` on a subset of `Set.Ioc a b`
of nonzero measure, then `∫ x in a..b, f x ∂μ < ∫ x in a..b, g x ∂μ`. -/
theorem integral_lt_integral_of_ae_le_of_measure_setOf_lt_ne_zero (hab : a ≤ b)
(hfi : IntervalIntegrable f μ a b) (hgi : IntervalIntegrable g μ a b)
(hle : f ≤ᵐ[μ.restrict (Ioc a b)] g) (hlt : μ.restrict (Ioc a b) {x | f x < g x} ≠ 0) :
(∫ x in a..b, f x ∂μ) < ∫ x in a..b, g x ∂μ := by
rw [← sub_pos, ← integral_sub hgi hfi, integral_of_le hab,
MeasureTheory.integral_pos_iff_support_of_nonneg_ae]
· refine pos_iff_ne_zero.2 (mt (measure_mono_null ?_) hlt)
exact fun x hx => (sub_pos.2 hx.out).ne'
exacts [hle.mono fun x => sub_nonneg.2, hgi.1.sub hfi.1]
/-- If `f` and `g` are continuous on `[a, b]`, `a < b`, `f x ≤ g x` on this interval, and
`f c < g c` at some point `c ∈ [a, b]`, then `∫ x in a..b, f x < ∫ x in a..b, g x`. -/
theorem integral_lt_integral_of_continuousOn_of_le_of_exists_lt {f g : ℝ → ℝ} {a b : ℝ}
(hab : a < b) (hfc : ContinuousOn f (Icc a b)) (hgc : ContinuousOn g (Icc a b))
(hle : ∀ x ∈ Ioc a b, f x ≤ g x) (hlt : ∃ c ∈ Icc a b, f c < g c) :
(∫ x in a..b, f x) < ∫ x in a..b, g x := by
apply integral_lt_integral_of_ae_le_of_measure_setOf_lt_ne_zero hab.le
(hfc.intervalIntegrable_of_Icc hab.le) (hgc.intervalIntegrable_of_Icc hab.le)
· simpa only [measurableSet_Ioc, ae_restrict_eq]
using (ae_restrict_mem measurableSet_Ioc).mono hle
contrapose! hlt
have h_eq : f =ᵐ[volume.restrict (Ioc a b)] g := by
simp only [← not_le, ← ae_iff] at hlt
exact EventuallyLE.antisymm ((ae_restrict_iff' measurableSet_Ioc).2 <|
eventually_of_forall hle) hlt
rw [Measure.restrict_congr_set Ioc_ae_eq_Icc] at h_eq
exact fun c hc ↦ (Measure.eqOn_Icc_of_ae_eq volume hab.ne h_eq hfc hgc hc).ge
theorem integral_nonneg_of_ae_restrict (hab : a ≤ b) (hf : 0 ≤ᵐ[μ.restrict (Icc a b)] f) :
0 ≤ ∫ u in a..b, f u ∂μ := by
let H := ae_restrict_of_ae_restrict_of_subset Ioc_subset_Icc_self hf
simpa only [integral_of_le hab] using setIntegral_nonneg_of_ae_restrict H
theorem integral_nonneg_of_ae (hab : a ≤ b) (hf : 0 ≤ᵐ[μ] f) : 0 ≤ ∫ u in a..b, f u ∂μ :=
integral_nonneg_of_ae_restrict hab <| ae_restrict_of_ae hf
theorem integral_nonneg_of_forall (hab : a ≤ b) (hf : ∀ u, 0 ≤ f u) : 0 ≤ ∫ u in a..b, f u ∂μ :=
integral_nonneg_of_ae hab <| eventually_of_forall hf
theorem integral_nonneg (hab : a ≤ b) (hf : ∀ u, u ∈ Icc a b → 0 ≤ f u) : 0 ≤ ∫ u in a..b, f u ∂μ :=
integral_nonneg_of_ae_restrict hab <| (ae_restrict_iff' measurableSet_Icc).mpr <| ae_of_all μ hf
theorem abs_integral_le_integral_abs (hab : a ≤ b) :
|∫ x in a..b, f x ∂μ| ≤ ∫ x in a..b, |f x| ∂μ := by
simpa only [← Real.norm_eq_abs] using norm_integral_le_integral_norm hab
section Mono
variable (hab : a ≤ b) (hf : IntervalIntegrable f μ a b) (hg : IntervalIntegrable g μ a b)
theorem integral_mono_ae_restrict (h : f ≤ᵐ[μ.restrict (Icc a b)] g) :
(∫ u in a..b, f u ∂μ) ≤ ∫ u in a..b, g u ∂μ := by
let H := h.filter_mono <| ae_mono <| Measure.restrict_mono Ioc_subset_Icc_self <| le_refl μ
simpa only [integral_of_le hab] using setIntegral_mono_ae_restrict hf.1 hg.1 H
theorem integral_mono_ae (h : f ≤ᵐ[μ] g) : (∫ u in a..b, f u ∂μ) ≤ ∫ u in a..b, g u ∂μ := by
simpa only [integral_of_le hab] using setIntegral_mono_ae hf.1 hg.1 h
theorem integral_mono_on (h : ∀ x ∈ Icc a b, f x ≤ g x) :
(∫ u in a..b, f u ∂μ) ≤ ∫ u in a..b, g u ∂μ := by
let H x hx := h x <| Ioc_subset_Icc_self hx
simpa only [integral_of_le hab] using setIntegral_mono_on hf.1 hg.1 measurableSet_Ioc H
theorem integral_mono (h : f ≤ g) : (∫ u in a..b, f u ∂μ) ≤ ∫ u in a..b, g u ∂μ :=
integral_mono_ae hab hf hg <| ae_of_all _ h
theorem integral_mono_interval {c d} (hca : c ≤ a) (hab : a ≤ b) (hbd : b ≤ d)
(hf : 0 ≤ᵐ[μ.restrict (Ioc c d)] f) (hfi : IntervalIntegrable f μ c d) :
(∫ x in a..b, f x ∂μ) ≤ ∫ x in c..d, f x ∂μ := by
rw [integral_of_le hab, integral_of_le (hca.trans (hab.trans hbd))]
exact setIntegral_mono_set hfi.1 hf (Ioc_subset_Ioc hca hbd).eventuallyLE
theorem abs_integral_mono_interval {c d} (h : Ι a b ⊆ Ι c d) (hf : 0 ≤ᵐ[μ.restrict (Ι c d)] f)
(hfi : IntervalIntegrable f μ c d) : |∫ x in a..b, f x ∂μ| ≤ |∫ x in c..d, f x ∂μ| :=
have hf' : 0 ≤ᵐ[μ.restrict (Ι a b)] f := ae_mono (Measure.restrict_mono h le_rfl) hf
calc
|∫ x in a..b, f x ∂μ| = |∫ x in Ι a b, f x ∂μ| := abs_integral_eq_abs_integral_uIoc f
_ = ∫ x in Ι a b, f x ∂μ := abs_of_nonneg (MeasureTheory.integral_nonneg_of_ae hf')
_ ≤ ∫ x in Ι c d, f x ∂μ := setIntegral_mono_set hfi.def' hf h.eventuallyLE
_ ≤ |∫ x in Ι c d, f x ∂μ| := le_abs_self _
_ = |∫ x in c..d, f x ∂μ| := (abs_integral_eq_abs_integral_uIoc f).symm
end Mono
end
section HasSum
variable {μ : Measure ℝ} {f : ℝ → E}
theorem _root_.MeasureTheory.Integrable.hasSum_intervalIntegral (hfi : Integrable f μ) (y : ℝ) :
HasSum (fun n : ℤ => ∫ x in y + n..y + n + 1, f x ∂μ) (∫ x, f x ∂μ) := by
simp_rw [integral_of_le (le_add_of_nonneg_right zero_le_one)]
rw [← integral_univ, ← iUnion_Ioc_add_intCast y]
exact
hasSum_integral_iUnion (fun i => measurableSet_Ioc) (pairwise_disjoint_Ioc_add_intCast y)
hfi.integrableOn
theorem _root_.MeasureTheory.Integrable.hasSum_intervalIntegral_comp_add_int (hfi : Integrable f) :
HasSum (fun n : ℤ => ∫ x in (0 : ℝ)..(1 : ℝ), f (x + n)) (∫ x, f x) := by
simpa only [integral_comp_add_right, zero_add, add_comm (1 : ℝ)] using
hfi.hasSum_intervalIntegral 0
end HasSum
end intervalIntegral
|
MeasureTheory\Integral\Layercake.lean | /-
Copyright (c) 2022 Kalle Kytölä. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kalle Kytölä
-/
import Mathlib.MeasureTheory.Integral.IntervalIntegral
/-!
# The layer cake formula / Cavalieri's principle / tail probability formula
In this file we prove the following layer cake formula.
Consider a non-negative measurable function `f` on a measure space. Apply pointwise
to it an increasing absolutely continuous function `G : ℝ≥0 → ℝ≥0` vanishing at the origin, with
derivative `G' = g` on the positive real line (in other words, `G` a primitive of a non-negative
locally integrable function `g` on the positive real line). Then the integral of the result,
`∫ G ∘ f`, can be written as the integral over the positive real line of the "tail measures" of `f`
(i.e., a function giving the measures of the sets on which `f` exceeds different positive real
values) weighted by `g`. In probability theory contexts, the "tail measures" could be referred to
as "tail probabilities" of the random variable `f`, or as values of the "complementary cumulative
distribution function" of the random variable `f`. The terminology "tail probability formula" is
therefore occasionally used for the layer cake formula (or a standard application of it).
The essence of the (mathematical) proof is Fubini's theorem.
We also give the most common application of the layer cake formula -
a representation of the integral of a nonnegative function f:
∫ f(ω) ∂μ(ω) = ∫ μ {ω | f(ω) ≥ t} dt
Variants of the formulas with measures of sets of the form {ω | f(ω) > t} instead of {ω | f(ω) ≥ t}
are also included.
## Main results
* `MeasureTheory.lintegral_comp_eq_lintegral_meas_le_mul`
and `MeasureTheory.lintegral_comp_eq_lintegral_meas_lt_mul`:
The general layer cake formulas with Lebesgue integrals, written in terms of measures of
sets of the forms {ω | t ≤ f(ω)} and {ω | t < f(ω)}, respectively.
* `MeasureTheory.lintegral_eq_lintegral_meas_le` and
`MeasureTheory.lintegral_eq_lintegral_meas_lt`:
The most common special cases of the layer cake formulas, stating that for a nonnegative
function f we have ∫ f(ω) ∂μ(ω) = ∫ μ {ω | f(ω) ≥ t} dt and
∫ f(ω) ∂μ(ω) = ∫ μ {ω | f(ω) > t} dt, respectively.
* `Integrable.integral_eq_integral_meas_lt`:
A Bochner integral version of the most common special case of the layer cake formulas, stating
that for an integrable and a.e.-nonnegative function f we have
∫ f(ω) ∂μ(ω) = ∫ μ {ω | f(ω) > t} dt.
## See also
Another common application, a representation of the integral of a real power of a nonnegative
function, is given in `Mathlib.Analysis.SpecialFunctions.Pow.Integral`.
## Tags
layer cake representation, Cavalieri's principle, tail probability formula
-/
noncomputable section
open scoped ENNReal MeasureTheory Topology
open Set MeasureTheory Filter Measure
namespace MeasureTheory
section
variable {α R : Type*} [MeasurableSpace α] (μ : Measure α) [LinearOrder R]
theorem countable_meas_le_ne_meas_lt (g : α → R) :
{t : R | μ {a : α | t ≤ g a} ≠ μ {a : α | t < g a}}.Countable := by
-- the target set is contained in the set of points where the function `t ↦ μ {a : α | t ≤ g a}`
-- jumps down on the right of `t`. This jump set is countable for any function.
let F : R → ℝ≥0∞ := fun t ↦ μ {a : α | t ≤ g a}
apply (countable_image_gt_image_Ioi F).mono
intro t ht
have : μ {a | t < g a} < μ {a | t ≤ g a} :=
lt_of_le_of_ne (measure_mono (fun a ha ↦ le_of_lt ha)) (Ne.symm ht)
exact ⟨μ {a | t < g a}, this, fun s hs ↦ measure_mono (fun a ha ↦ hs.trans_le ha)⟩
theorem meas_le_ae_eq_meas_lt {R : Type*} [LinearOrder R] [MeasurableSpace R]
(ν : Measure R) [NoAtoms ν] (g : α → R) :
(fun t => μ {a : α | t ≤ g a}) =ᵐ[ν] fun t => μ {a : α | t < g a} :=
Set.Countable.measure_zero (countable_meas_le_ne_meas_lt μ g) _
end
/-! ### Layercake formula -/
section Layercake
variable {α : Type*} [MeasurableSpace α] {f : α → ℝ} {g : ℝ → ℝ} {s : Set α}
/-- An auxiliary version of the layer cake formula (Cavalieri's principle, tail probability
formula), with a measurability assumption that would also essentially follow from the
integrability assumptions, and a sigma-finiteness assumption.
See `MeasureTheory.lintegral_comp_eq_lintegral_meas_le_mul` and
`MeasureTheory.lintegral_comp_eq_lintegral_meas_lt_mul` for the main formulations of the layer
cake formula. -/
theorem lintegral_comp_eq_lintegral_meas_le_mul_of_measurable_of_sigmaFinite
(μ : Measure α) [SFinite μ]
(f_nn : 0 ≤ f) (f_mble : Measurable f)
(g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t) (g_mble : Measurable g)
(g_nn : ∀ t > 0, 0 ≤ g t) :
∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ =
∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) := by
have g_intble' : ∀ t : ℝ, 0 ≤ t → IntervalIntegrable g volume 0 t := by
intro t ht
cases' eq_or_lt_of_le ht with h h
· simp [← h]
· exact g_intble t h
have integrand_eq : ∀ ω,
ENNReal.ofReal (∫ t in (0)..f ω, g t) = ∫⁻ t in Ioc 0 (f ω), ENNReal.ofReal (g t) := by
intro ω
have g_ae_nn : 0 ≤ᵐ[volume.restrict (Ioc 0 (f ω))] g := by
filter_upwards [self_mem_ae_restrict (measurableSet_Ioc : MeasurableSet (Ioc 0 (f ω)))]
with x hx using g_nn x hx.1
rw [← ofReal_integral_eq_lintegral_ofReal (g_intble' (f ω) (f_nn ω)).1 g_ae_nn]
congr
exact intervalIntegral.integral_of_le (f_nn ω)
rw [lintegral_congr integrand_eq]
simp_rw [← lintegral_indicator (fun t => ENNReal.ofReal (g t)) measurableSet_Ioc]
-- Porting note: was part of `simp_rw` on the previous line, but didn't trigger.
rw [← lintegral_indicator _ measurableSet_Ioi, lintegral_lintegral_swap]
· apply congr_arg
funext s
have aux₁ :
(fun x => (Ioc 0 (f x)).indicator (fun t : ℝ => ENNReal.ofReal (g t)) s) = fun x =>
ENNReal.ofReal (g s) * (Ioi (0 : ℝ)).indicator (fun _ => 1) s *
(Ici s).indicator (fun _ : ℝ => (1 : ℝ≥0∞)) (f x) := by
funext a
by_cases h : s ∈ Ioc (0 : ℝ) (f a)
· simp only [h, show s ∈ Ioi (0 : ℝ) from h.1, show f a ∈ Ici s from h.2, indicator_of_mem,
mul_one]
· have h_copy := h
simp only [mem_Ioc, not_and, not_le] at h
by_cases h' : 0 < s
· simp only [h_copy, h h', indicator_of_not_mem, not_false_iff, mem_Ici, not_le, mul_zero]
· have : s ∉ Ioi (0 : ℝ) := h'
simp only [this, h', indicator_of_not_mem, not_false_iff, mul_zero,
zero_mul, mem_Ioc, false_and_iff]
simp_rw [aux₁]
rw [lintegral_const_mul']
swap
· apply ENNReal.mul_ne_top ENNReal.ofReal_ne_top
by_cases h : (0 : ℝ) < s <;> · simp [h]
simp_rw [show
(fun a => (Ici s).indicator (fun _ : ℝ => (1 : ℝ≥0∞)) (f a)) = fun a =>
{a : α | s ≤ f a}.indicator (fun _ => 1) a
by funext a; by_cases h : s ≤ f a <;> simp [h]]
rw [lintegral_indicator₀]
swap; · exact f_mble.nullMeasurable measurableSet_Ici
rw [lintegral_one, Measure.restrict_apply MeasurableSet.univ, univ_inter, indicator_mul_left,
mul_assoc,
show
(Ioi 0).indicator (fun _x : ℝ => (1 : ℝ≥0∞)) s * μ {a : α | s ≤ f a} =
(Ioi 0).indicator (fun _x : ℝ => 1 * μ {a : α | s ≤ f a}) s
by by_cases h : 0 < s <;> simp [h]]
simp_rw [mul_comm _ (ENNReal.ofReal _), one_mul]
rfl
have aux₂ :
(Function.uncurry fun (x : α) (y : ℝ) =>
(Ioc 0 (f x)).indicator (fun t : ℝ => ENNReal.ofReal (g t)) y) =
{p : α × ℝ | p.2 ∈ Ioc 0 (f p.1)}.indicator fun p => ENNReal.ofReal (g p.2) := by
funext p
cases p with | mk p_fst p_snd => ?_
rw [Function.uncurry_apply_pair]
by_cases h : p_snd ∈ Ioc 0 (f p_fst)
· have h' : (p_fst, p_snd) ∈ {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := h
rw [Set.indicator_of_mem h', Set.indicator_of_mem h]
· have h' : (p_fst, p_snd) ∉ {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := h
rw [Set.indicator_of_not_mem h', Set.indicator_of_not_mem h]
rw [aux₂]
have mble₀ : MeasurableSet {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := by
simpa only [mem_univ, Pi.zero_apply, true_and] using
measurableSet_region_between_oc measurable_zero f_mble MeasurableSet.univ
exact (ENNReal.measurable_ofReal.comp (g_mble.comp measurable_snd)).aemeasurable.indicator₀
mble₀.nullMeasurableSet
/-- An auxiliary version of the layer cake formula (Cavalieri's principle, tail probability
formula), with a measurability assumption that would also essentially follow from the
integrability assumptions.
Compared to `lintegral_comp_eq_lintegral_meas_le_mul_of_measurable_of_sigmaFinite`, we remove
the sigma-finite assumption.
See `MeasureTheory.lintegral_comp_eq_lintegral_meas_le_mul` and
`MeasureTheory.lintegral_comp_eq_lintegral_meas_lt_mul` for the main formulations of the layer
cake formula. -/
theorem lintegral_comp_eq_lintegral_meas_le_mul_of_measurable (μ : Measure α)
(f_nn : 0 ≤ f) (f_mble : Measurable f)
(g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t) (g_mble : Measurable g)
(g_nn : ∀ t > 0, 0 ≤ g t) :
∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ =
∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) := by
/- We will reduce to the sigma-finite case, after excluding two easy cases where the result
is more or less obvious. -/
have f_nonneg : ∀ ω, 0 ≤ f ω := fun ω ↦ f_nn ω
-- trivial case where `g` is ae zero. Then both integrals vanish.
by_cases H1 : g =ᵐ[volume.restrict (Ioi (0 : ℝ))] 0
· have A : ∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ = 0 := by
have : ∀ ω, ∫ t in (0)..f ω, g t = ∫ t in (0)..f ω, 0 := by
intro ω
simp_rw [intervalIntegral.integral_of_le (f_nonneg ω)]
apply integral_congr_ae
exact ae_restrict_of_ae_restrict_of_subset Ioc_subset_Ioi_self H1
simp [this]
have B : ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) = 0 := by
have : (fun t ↦ μ {a : α | t ≤ f a} * ENNReal.ofReal (g t))
=ᵐ[volume.restrict (Ioi (0 : ℝ))] 0 := by
filter_upwards [H1] with t ht using by simp [ht]
simp [lintegral_congr_ae this]
rw [A, B]
-- easy case where both sides are obviously infinite: for some `s`, one has
-- `μ {a : α | s < f a} = ∞` and moreover `g` is not ae zero on `[0, s]`.
by_cases H2 : ∃ s > 0, 0 < ∫ t in (0)..s, g t ∧ μ {a : α | s < f a} = ∞
· rcases H2 with ⟨s, s_pos, hs, h's⟩
rw [intervalIntegral.integral_of_le s_pos.le] at hs
/- The first integral is infinite, as for `t ∈ [0, s]` one has `μ {a : α | t ≤ f a} = ∞`,
and moreover the additional integral `g` is not uniformly zero. -/
have A : ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) = ∞ := by
rw [eq_top_iff]
calc
∞ = ∫⁻ t in Ioc 0 s, ∞ * ENNReal.ofReal (g t) := by
have I_pos : ∫⁻ (a : ℝ) in Ioc 0 s, ENNReal.ofReal (g a) ≠ 0 := by
rw [← ofReal_integral_eq_lintegral_ofReal (g_intble s s_pos).1]
· simpa only [not_lt, ne_eq, ENNReal.ofReal_eq_zero, not_le] using hs
· filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht using g_nn _ ht.1
rw [lintegral_const_mul, ENNReal.top_mul I_pos]
exact ENNReal.measurable_ofReal.comp g_mble
_ ≤ ∫⁻ t in Ioc 0 s, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) := by
apply setLIntegral_mono' measurableSet_Ioc (fun x hx ↦ ?_)
rw [← h's]
gcongr
exact fun a ha ↦ hx.2.trans (le_of_lt ha)
_ ≤ ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) :=
lintegral_mono_set Ioc_subset_Ioi_self
/- The second integral is infinite, as one integrates amont other things on those `ω` where
`f ω > s`: this is an infinite measure set, and on it the integrand is bounded below
by `∫ t in 0..s, g t` which is positive. -/
have B : ∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ = ∞ := by
rw [eq_top_iff]
calc
∞ = ∫⁻ _ in {a | s < f a}, ENNReal.ofReal (∫ t in (0)..s, g t) ∂μ := by
simp only [lintegral_const, MeasurableSet.univ, Measure.restrict_apply, univ_inter,
h's, ne_eq, ENNReal.ofReal_eq_zero, not_le]
rw [ENNReal.mul_top]
simpa [intervalIntegral.integral_of_le s_pos.le] using hs
_ ≤ ∫⁻ ω in {a | s < f a}, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ := by
apply setLIntegral_mono' (measurableSet_lt measurable_const f_mble) (fun a ha ↦ ?_)
apply ENNReal.ofReal_le_ofReal
apply intervalIntegral.integral_mono_interval le_rfl s_pos.le (le_of_lt ha)
· filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht using g_nn _ ht.1
· exact g_intble _ (s_pos.trans ha)
_ ≤ ∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ := setLIntegral_le_lintegral _ _
rw [A, B]
/- It remains to handle the interesting case, where `g` is not zero, but both integrals are
not obviously infinite. Let `M` be the largest number such that `g = 0` on `[0, M]`. Then we
may restrict `μ` to the points where `f ω > M` (as the other ones do not contribute to the
integral). The restricted measure `ν` is sigma-finite, as `μ` gives finite measure to
`{ω | f ω > a}` for any `a > M` (otherwise, we would be in the easy case above), so that
one can write (a full measure subset of) the space as the countable union of the finite measure
sets `{ω | f ω > uₙ}` for `uₙ` a sequence decreasing to `M`. Therefore,
this case follows from the case where the measure is sigma-finite, applied to `ν`. -/
push_neg at H2
have M_bdd : BddAbove {s : ℝ | g =ᵐ[volume.restrict (Ioc (0 : ℝ) s)] 0} := by
contrapose! H1
have : ∀ (n : ℕ), g =ᵐ[volume.restrict (Ioc (0 : ℝ) n)] 0 := by
intro n
rcases not_bddAbove_iff.1 H1 n with ⟨s, hs, ns⟩
exact ae_restrict_of_ae_restrict_of_subset (Ioc_subset_Ioc_right ns.le) hs
have Hg : g =ᵐ[volume.restrict (⋃ (n : ℕ), (Ioc (0 : ℝ) n))] 0 :=
(ae_restrict_iUnion_iff _ _).2 this
have : (⋃ (n : ℕ), (Ioc (0 : ℝ) n)) = Ioi 0 :=
iUnion_Ioc_eq_Ioi_self_iff.2 (fun x _ ↦ exists_nat_ge x)
rwa [this] at Hg
-- let `M` be the largest number such that `g` vanishes ae on `(0, M]`.
let M : ℝ := sSup {s : ℝ | g =ᵐ[volume.restrict (Ioc (0 : ℝ) s)] 0}
have zero_mem : 0 ∈ {s : ℝ | g =ᵐ[volume.restrict (Ioc (0 : ℝ) s)] 0} := by simpa using trivial
have M_nonneg : 0 ≤ M := le_csSup M_bdd zero_mem
-- Then the function `g` indeed vanishes ae on `(0, M]`.
have hgM : g =ᵐ[volume.restrict (Ioc (0 : ℝ) M)] 0 := by
rw [← restrict_Ioo_eq_restrict_Ioc]
obtain ⟨u, -, uM, ulim⟩ : ∃ u, StrictMono u ∧ (∀ (n : ℕ), u n < M) ∧ Tendsto u atTop (𝓝 M) :=
exists_seq_strictMono_tendsto M
have I : ∀ n, g =ᵐ[volume.restrict (Ioc (0 : ℝ) (u n))] 0 := by
intro n
obtain ⟨s, hs, uns⟩ : ∃ s, g =ᶠ[ae (Measure.restrict volume (Ioc 0 s))] 0 ∧ u n < s :=
exists_lt_of_lt_csSup (Set.nonempty_of_mem zero_mem) (uM n)
exact ae_restrict_of_ae_restrict_of_subset (Ioc_subset_Ioc_right uns.le) hs
have : g =ᵐ[volume.restrict (⋃ n, Ioc (0 : ℝ) (u n))] 0 := (ae_restrict_iUnion_iff _ _).2 I
apply ae_restrict_of_ae_restrict_of_subset _ this
rintro x ⟨x_pos, xM⟩
obtain ⟨n, hn⟩ : ∃ n, x < u n := ((tendsto_order.1 ulim).1 _ xM).exists
exact mem_iUnion.2 ⟨n, ⟨x_pos, hn.le⟩⟩
-- Let `ν` be the restriction of `μ` to those points where `f a > M`.
let ν := μ.restrict {a : α | M < f a}
-- This measure is sigma-finite (this is the whole point of the argument).
have : SigmaFinite ν := by
obtain ⟨u, -, uM, ulim⟩ : ∃ u, StrictAnti u ∧ (∀ (n : ℕ), M < u n) ∧ Tendsto u atTop (𝓝 M) :=
exists_seq_strictAnti_tendsto M
let s : ν.FiniteSpanningSetsIn univ :=
{ set := fun n ↦ {a | f a ≤ M} ∪ {a | u n < f a}
set_mem := fun _ ↦ trivial
finite := by
intro n
have I : ν {a | f a ≤ M} = 0 := by
rw [Measure.restrict_apply (measurableSet_le f_mble measurable_const)]
convert measure_empty (μ := μ)
rw [← disjoint_iff_inter_eq_empty]
exact disjoint_left.mpr (fun a ha ↦ by simpa using ha)
have J : μ {a | u n < f a} < ∞ := by
rw [lt_top_iff_ne_top]
apply H2 _ (M_nonneg.trans_lt (uM n))
by_contra H3
rw [not_lt, intervalIntegral.integral_of_le (M_nonneg.trans (uM n).le)] at H3
have g_nn_ae : ∀ᵐ t ∂(volume.restrict (Ioc 0 (u n))), 0 ≤ g t := by
filter_upwards [ae_restrict_mem measurableSet_Ioc] with s hs using g_nn _ hs.1
have Ig : ∫ (t : ℝ) in Ioc 0 (u n), g t = 0 :=
le_antisymm H3 (integral_nonneg_of_ae g_nn_ae)
have J : ∀ᵐ t ∂(volume.restrict (Ioc 0 (u n))), g t = 0 :=
(integral_eq_zero_iff_of_nonneg_ae g_nn_ae
(g_intble (u n) (M_nonneg.trans_lt (uM n))).1).1 Ig
have : u n ≤ M := le_csSup M_bdd J
exact lt_irrefl _ (this.trans_lt (uM n))
refine lt_of_le_of_lt (measure_union_le _ _) ?_
rw [I, zero_add]
apply lt_of_le_of_lt _ J
exact restrict_le_self _
spanning := by
apply eq_univ_iff_forall.2 (fun a ↦ ?_)
rcases le_or_lt (f a) M with ha|ha
· exact mem_iUnion.2 ⟨0, Or.inl ha⟩
· obtain ⟨n, hn⟩ : ∃ n, u n < f a := ((tendsto_order.1 ulim).2 _ ha).exists
exact mem_iUnion.2 ⟨n, Or.inr hn⟩ }
exact ⟨⟨s⟩⟩
-- the first integrals with respect to `μ` and to `ν` coincide, as points with `f a ≤ M` are
-- weighted by zero as `g` vanishes there.
have A : ∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ
= ∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂ν := by
have meas : MeasurableSet {a | M < f a} := measurableSet_lt measurable_const f_mble
have I : ∫⁻ ω in {a | M < f a}ᶜ, ENNReal.ofReal (∫ t in (0).. f ω, g t) ∂μ
= ∫⁻ _ in {a | M < f a}ᶜ, 0 ∂μ := by
apply setLIntegral_congr_fun meas.compl (eventually_of_forall (fun s hs ↦ ?_))
have : ∫ (t : ℝ) in (0)..f s, g t = ∫ (t : ℝ) in (0)..f s, 0 := by
simp_rw [intervalIntegral.integral_of_le (f_nonneg s)]
apply integral_congr_ae
apply ae_mono (restrict_mono ?_ le_rfl) hgM
apply Ioc_subset_Ioc_right
simpa using hs
simp [this]
simp only [lintegral_const, zero_mul] at I
rw [← lintegral_add_compl _ meas, I, add_zero]
-- the second integrals with respect to `μ` and to `ν` coincide, as points with `f a ≤ M` do not
-- contribute to either integral since the weight `g` vanishes.
have B : ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t)
= ∫⁻ t in Ioi 0, ν {a : α | t ≤ f a} * ENNReal.ofReal (g t) := by
have B1 : ∫⁻ t in Ioc 0 M, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t)
= ∫⁻ t in Ioc 0 M, ν {a : α | t ≤ f a} * ENNReal.ofReal (g t) := by
apply lintegral_congr_ae
filter_upwards [hgM] with t ht
simp [ht]
have B2 : ∫⁻ t in Ioi M, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t)
= ∫⁻ t in Ioi M, ν {a : α | t ≤ f a} * ENNReal.ofReal (g t) := by
apply setLIntegral_congr_fun measurableSet_Ioi (eventually_of_forall (fun t ht ↦ ?_))
rw [Measure.restrict_apply (measurableSet_le measurable_const f_mble)]
congr 3
exact (inter_eq_left.2 (fun a ha ↦ (mem_Ioi.1 ht).trans_le ha)).symm
have I : Ioi (0 : ℝ) = Ioc (0 : ℝ) M ∪ Ioi M := (Ioc_union_Ioi_eq_Ioi M_nonneg).symm
have J : Disjoint (Ioc 0 M) (Ioi M) := Ioc_disjoint_Ioi le_rfl
rw [I, lintegral_union measurableSet_Ioi J, lintegral_union measurableSet_Ioi J, B1, B2]
-- therefore, we may replace the integrals wrt `μ` with integrals wrt `ν`, and apply the
-- result for sigma-finite measures.
rw [A, B]
exact lintegral_comp_eq_lintegral_meas_le_mul_of_measurable_of_sigmaFinite
ν f_nn f_mble g_intble g_mble g_nn
/-- The layer cake formula / **Cavalieri's principle** / tail probability formula:
Let `f` be a non-negative measurable function on a measure space. Let `G` be an
increasing absolutely continuous function on the positive real line, vanishing at the origin,
with derivative `G' = g`. Then the integral of the composition `G ∘ f` can be written as
the integral over the positive real line of the "tail measures" `μ {ω | f(ω) ≥ t}` of `f`
weighted by `g`.
Roughly speaking, the statement is: `∫⁻ (G ∘ f) ∂μ = ∫⁻ t in 0..∞, g(t) * μ {ω | f(ω) ≥ t}`.
See `MeasureTheory.lintegral_comp_eq_lintegral_meas_lt_mul` for a version with sets of the form
`{ω | f(ω) > t}` instead. -/
theorem lintegral_comp_eq_lintegral_meas_le_mul (μ : Measure α) (f_nn : 0 ≤ᵐ[μ] f)
(f_mble : AEMeasurable f μ) (g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t)
(g_nn : ∀ᵐ t ∂volume.restrict (Ioi 0), 0 ≤ g t) :
∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ =
∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) := by
obtain ⟨G, G_mble, G_nn, g_eq_G⟩ : ∃ G : ℝ → ℝ, Measurable G ∧ 0 ≤ G
∧ g =ᵐ[volume.restrict (Ioi 0)] G := by
refine AEMeasurable.exists_measurable_nonneg ?_ g_nn
exact aemeasurable_Ioi_of_forall_Ioc fun t ht => (g_intble t ht).1.1.aemeasurable
have g_eq_G_on : ∀ t, g =ᵐ[volume.restrict (Ioc 0 t)] G := fun t =>
ae_mono (Measure.restrict_mono Ioc_subset_Ioi_self le_rfl) g_eq_G
have G_intble : ∀ t > 0, IntervalIntegrable G volume 0 t := by
refine fun t t_pos => ⟨(g_intble t t_pos).1.congr_fun_ae (g_eq_G_on t), ?_⟩
rw [Ioc_eq_empty_of_le t_pos.lt.le]
exact integrableOn_empty
obtain ⟨F, F_mble, F_nn, f_eq_F⟩ : ∃ F : α → ℝ, Measurable F ∧ 0 ≤ F ∧ f =ᵐ[μ] F := by
refine ⟨fun ω ↦ max (f_mble.mk f ω) 0, f_mble.measurable_mk.max measurable_const,
fun ω ↦ le_max_right _ _, ?_⟩
filter_upwards [f_mble.ae_eq_mk, f_nn] with ω hω h'ω
rw [← hω]
exact (max_eq_left h'ω).symm
have eq₁ :
∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) =
∫⁻ t in Ioi 0, μ {a : α | t ≤ F a} * ENNReal.ofReal (G t) := by
apply lintegral_congr_ae
filter_upwards [g_eq_G] with t ht
rw [ht]
congr 1
apply measure_congr
filter_upwards [f_eq_F] with a ha using by simp [setOf, ha]
have eq₂ : ∀ᵐ ω ∂μ,
ENNReal.ofReal (∫ t in (0)..f ω, g t) = ENNReal.ofReal (∫ t in (0)..F ω, G t) := by
filter_upwards [f_eq_F] with ω fω_nn
rw [fω_nn]
congr 1
refine intervalIntegral.integral_congr_ae ?_
have fω_nn : 0 ≤ F ω := F_nn ω
rw [uIoc_of_le fω_nn, ←
ae_restrict_iff' (measurableSet_Ioc : MeasurableSet (Ioc (0 : ℝ) (F ω)))]
exact g_eq_G_on (F ω)
simp_rw [lintegral_congr_ae eq₂, eq₁]
exact lintegral_comp_eq_lintegral_meas_le_mul_of_measurable μ F_nn F_mble
G_intble G_mble (fun t _ => G_nn t)
/-- The standard case of the layer cake formula / Cavalieri's principle / tail probability formula:
For a nonnegative function `f` on a measure space, the Lebesgue integral of `f` can
be written (roughly speaking) as: `∫⁻ f ∂μ = ∫⁻ t in 0..∞, μ {ω | f(ω) ≥ t}`.
See `MeasureTheory.lintegral_eq_lintegral_meas_lt` for a version with sets of the form
`{ω | f(ω) > t}` instead. -/
theorem lintegral_eq_lintegral_meas_le (μ : Measure α) (f_nn : 0 ≤ᵐ[μ] f)
(f_mble : AEMeasurable f μ) :
∫⁻ ω, ENNReal.ofReal (f ω) ∂μ = ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} := by
set cst := fun _ : ℝ => (1 : ℝ)
have cst_intble : ∀ t > 0, IntervalIntegrable cst volume 0 t := fun _ _ =>
intervalIntegrable_const
have key :=
lintegral_comp_eq_lintegral_meas_le_mul μ f_nn f_mble cst_intble
(eventually_of_forall fun _ => zero_le_one)
simp_rw [cst, ENNReal.ofReal_one, mul_one] at key
rw [← key]
congr with ω
simp only [intervalIntegral.integral_const, sub_zero, Algebra.id.smul_eq_mul, mul_one]
end Layercake
section LayercakeLT
variable {α : Type*} [MeasurableSpace α] (μ : Measure α)
variable {β : Type*} [MeasurableSpace β] [MeasurableSingletonClass β]
variable {f : α → ℝ} {g : ℝ → ℝ} {s : Set α}
/-- The layer cake formula / Cavalieri's principle / tail probability formula:
Let `f` be a non-negative measurable function on a measure space. Let `G` be an
increasing absolutely continuous function on the positive real line, vanishing at the origin,
with derivative `G' = g`. Then the integral of the composition `G ∘ f` can be written as
the integral over the positive real line of the "tail measures" `μ {ω | f(ω) > t}` of `f`
weighted by `g`.
Roughly speaking, the statement is: `∫⁻ (G ∘ f) ∂μ = ∫⁻ t in 0..∞, g(t) * μ {ω | f(ω) > t}`.
See `lintegral_comp_eq_lintegral_meas_le_mul` for a version with sets of the form `{ω | f(ω) ≥ t}`
instead. -/
theorem lintegral_comp_eq_lintegral_meas_lt_mul (μ : Measure α) (f_nn : 0 ≤ᵐ[μ] f)
(f_mble : AEMeasurable f μ) (g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t)
(g_nn : ∀ᵐ t ∂volume.restrict (Ioi 0), 0 ≤ g t) :
∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ =
∫⁻ t in Ioi 0, μ {a : α | t < f a} * ENNReal.ofReal (g t) := by
rw [lintegral_comp_eq_lintegral_meas_le_mul μ f_nn f_mble g_intble g_nn]
apply lintegral_congr_ae
filter_upwards [meas_le_ae_eq_meas_lt μ (volume.restrict (Ioi 0)) f]
with t ht
rw [ht]
/-- The standard case of the layer cake formula / Cavalieri's principle / tail probability formula:
For a nonnegative function `f` on a measure space, the Lebesgue integral of `f` can
be written (roughly speaking) as: `∫⁻ f ∂μ = ∫⁻ t in 0..∞, μ {ω | f(ω) > t}`.
See `lintegral_eq_lintegral_meas_le` for a version with sets of the form `{ω | f(ω) ≥ t}`
instead. -/
theorem lintegral_eq_lintegral_meas_lt (μ : Measure α)
(f_nn : 0 ≤ᵐ[μ] f) (f_mble : AEMeasurable f μ) :
∫⁻ ω, ENNReal.ofReal (f ω) ∂μ = ∫⁻ t in Ioi 0, μ {a : α | t < f a} := by
rw [lintegral_eq_lintegral_meas_le μ f_nn f_mble]
apply lintegral_congr_ae
filter_upwards [meas_le_ae_eq_meas_lt μ (volume.restrict (Ioi 0)) f]
with t ht
rw [ht]
end LayercakeLT
section LayercakeIntegral
variable {α : Type*} [MeasurableSpace α] {μ : Measure α} {f : α → ℝ}
/-- The standard case of the layer cake formula / Cavalieri's principle / tail probability formula:
For an integrable a.e.-nonnegative real-valued function `f`, the Bochner integral of `f` can be
written (roughly speaking) as: `∫ f ∂μ = ∫ t in 0..∞, μ {ω | f(ω) > t}`.
See `MeasureTheory.lintegral_eq_lintegral_meas_lt` for a version with Lebesgue integral `∫⁻`
instead. -/
theorem Integrable.integral_eq_integral_meas_lt
(f_intble : Integrable f μ) (f_nn : 0 ≤ᵐ[μ] f) :
∫ ω, f ω ∂μ = ∫ t in Set.Ioi 0, ENNReal.toReal (μ {a : α | t < f a}) := by
have key := lintegral_eq_lintegral_meas_lt μ f_nn f_intble.aemeasurable
have lhs_finite : ∫⁻ (ω : α), ENNReal.ofReal (f ω) ∂μ < ∞ := Integrable.lintegral_lt_top f_intble
have rhs_finite : ∫⁻ (t : ℝ) in Set.Ioi 0, μ {a | t < f a} < ∞ := by simp only [← key, lhs_finite]
have rhs_integrand_finite : ∀ (t : ℝ), t > 0 → μ {a | t < f a} < ∞ :=
fun t ht ↦ measure_gt_lt_top f_intble ht
convert (ENNReal.toReal_eq_toReal lhs_finite.ne rhs_finite.ne).mpr key
· exact integral_eq_lintegral_of_nonneg_ae f_nn f_intble.aestronglyMeasurable
· have aux := @integral_eq_lintegral_of_nonneg_ae _ _ ((volume : Measure ℝ).restrict (Set.Ioi 0))
(fun t ↦ ENNReal.toReal (μ {a : α | t < f a})) ?_ ?_
· rw [aux]
congr 1
apply setLIntegral_congr_fun measurableSet_Ioi (eventually_of_forall _)
exact fun t t_pos ↦ ENNReal.ofReal_toReal (rhs_integrand_finite t t_pos).ne
· exact eventually_of_forall (fun x ↦ by simp only [Pi.zero_apply, ENNReal.toReal_nonneg])
· apply Measurable.aestronglyMeasurable
refine Measurable.ennreal_toReal ?_
exact Antitone.measurable (fun _ _ hst ↦ measure_mono (fun _ h ↦ lt_of_le_of_lt hst h))
theorem Integrable.integral_eq_integral_meas_le
(f_intble : Integrable f μ) (f_nn : 0 ≤ᵐ[μ] f) :
∫ ω, f ω ∂μ = ∫ t in Set.Ioi 0, ENNReal.toReal (μ {a : α | t ≤ f a}) := by
rw [Integrable.integral_eq_integral_meas_lt f_intble f_nn]
apply integral_congr_ae
filter_upwards [meas_le_ae_eq_meas_lt μ (volume.restrict (Ioi 0)) f] with t ht
exact congrArg ENNReal.toReal ht.symm
lemma Integrable.integral_eq_integral_Ioc_meas_le {f : α → ℝ} {M : ℝ}
(f_intble : Integrable f μ) (f_nn : 0 ≤ᵐ[μ] f) (f_bdd : f ≤ᵐ[μ] (fun _ ↦ M)) :
∫ ω, f ω ∂μ = ∫ t in Ioc 0 M, ENNReal.toReal (μ {a : α | t ≤ f a}) := by
rw [f_intble.integral_eq_integral_meas_le f_nn]
rw [setIntegral_eq_of_subset_of_ae_diff_eq_zero
measurableSet_Ioi.nullMeasurableSet Ioc_subset_Ioi_self ?_]
apply eventually_of_forall (fun t ht ↦ ?_)
have htM : M < t := by simp_all only [mem_diff, mem_Ioi, mem_Ioc, not_and, not_le]
have obs : μ {a | M < f a} = 0 := by
rw [measure_zero_iff_ae_nmem]
filter_upwards [f_bdd] with a ha using not_lt.mpr ha
rw [ENNReal.toReal_eq_zero_iff]
exact Or.inl <| measure_mono_null (fun a ha ↦ lt_of_lt_of_le htM ha) obs
end LayercakeIntegral
end MeasureTheory
|
MeasureTheory\Integral\Lebesgue.lean | /-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Johannes Hölzl
-/
import Mathlib.Analysis.Normed.Group.Basic
import Mathlib.Dynamics.Ergodic.MeasurePreserving
import Mathlib.MeasureTheory.Function.SimpleFunc
import Mathlib.MeasureTheory.Measure.MutuallySingular
import Mathlib.MeasureTheory.Measure.Count
import Mathlib.Topology.IndicatorConstPointwise
import Mathlib.MeasureTheory.Constructions.BorelSpace.Real
/-!
# Lower Lebesgue integral for `ℝ≥0∞`-valued functions
We define the lower Lebesgue integral of an `ℝ≥0∞`-valued function.
## Notation
We introduce the following notation for the lower Lebesgue integral of a function `f : α → ℝ≥0∞`.
* `∫⁻ x, f x ∂μ`: integral of a function `f : α → ℝ≥0∞` with respect to a measure `μ`;
* `∫⁻ x, f x`: integral of a function `f : α → ℝ≥0∞` with respect to the canonical measure
`volume` on `α`;
* `∫⁻ x in s, f x ∂μ`: integral of a function `f : α → ℝ≥0∞` over a set `s` with respect
to a measure `μ`, defined as `∫⁻ x, f x ∂(μ.restrict s)`;
* `∫⁻ x in s, f x`: integral of a function `f : α → ℝ≥0∞` over a set `s` with respect
to the canonical measure `volume`, defined as `∫⁻ x, f x ∂(volume.restrict s)`.
-/
assert_not_exists NormedSpace
noncomputable section
open Set hiding restrict restrict_apply
open Filter ENNReal Topology NNReal MeasureTheory
open Function (support)
namespace MeasureTheory
local infixr:25 " →ₛ " => SimpleFunc
variable {α β γ δ : Type*}
section Lintegral
open SimpleFunc
variable {m : MeasurableSpace α} {μ ν : Measure α}
/-- The **lower Lebesgue integral** of a function `f` with respect to a measure `μ`. -/
irreducible_def lintegral {_ : MeasurableSpace α} (μ : Measure α) (f : α → ℝ≥0∞) : ℝ≥0∞ :=
⨆ (g : α →ₛ ℝ≥0∞) (_ : ⇑g ≤ f), g.lintegral μ
/-! In the notation for integrals, an expression like `∫⁻ x, g ‖x‖ ∂μ` will not be parsed correctly,
and needs parentheses. We do not set the binding power of `r` to `0`, because then
`∫⁻ x, f x = 0` will be parsed incorrectly. -/
@[inherit_doc MeasureTheory.lintegral]
notation3 "∫⁻ "(...)", "r:60:(scoped f => f)" ∂"μ:70 => lintegral μ r
@[inherit_doc MeasureTheory.lintegral]
notation3 "∫⁻ "(...)", "r:60:(scoped f => lintegral volume f) => r
@[inherit_doc MeasureTheory.lintegral]
notation3"∫⁻ "(...)" in "s", "r:60:(scoped f => f)" ∂"μ:70 => lintegral (Measure.restrict μ s) r
@[inherit_doc MeasureTheory.lintegral]
notation3"∫⁻ "(...)" in "s", "r:60:(scoped f => lintegral (Measure.restrict volume s) f) => r
theorem SimpleFunc.lintegral_eq_lintegral {m : MeasurableSpace α} (f : α →ₛ ℝ≥0∞) (μ : Measure α) :
∫⁻ a, f a ∂μ = f.lintegral μ := by
rw [MeasureTheory.lintegral]
exact le_antisymm (iSup₂_le fun g hg => lintegral_mono hg <| le_rfl)
(le_iSup₂_of_le f le_rfl le_rfl)
@[mono]
theorem lintegral_mono' {m : MeasurableSpace α} ⦃μ ν : Measure α⦄ (hμν : μ ≤ ν) ⦃f g : α → ℝ≥0∞⦄
(hfg : f ≤ g) : ∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂ν := by
rw [lintegral, lintegral]
exact iSup_mono fun φ => iSup_mono' fun hφ => ⟨le_trans hφ hfg, lintegral_mono (le_refl φ) hμν⟩
-- version where `hfg` is an explicit forall, so that `@[gcongr]` can recognize it
@[gcongr] theorem lintegral_mono_fn' ⦃f g : α → ℝ≥0∞⦄ (hfg : ∀ x, f x ≤ g x) (h2 : μ ≤ ν) :
∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂ν :=
lintegral_mono' h2 hfg
theorem lintegral_mono ⦃f g : α → ℝ≥0∞⦄ (hfg : f ≤ g) : ∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂μ :=
lintegral_mono' (le_refl μ) hfg
-- version where `hfg` is an explicit forall, so that `@[gcongr]` can recognize it
@[gcongr] theorem lintegral_mono_fn ⦃f g : α → ℝ≥0∞⦄ (hfg : ∀ x, f x ≤ g x) :
∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂μ :=
lintegral_mono hfg
theorem lintegral_mono_nnreal {f g : α → ℝ≥0} (h : f ≤ g) : ∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂μ :=
lintegral_mono fun a => ENNReal.coe_le_coe.2 (h a)
theorem iSup_lintegral_measurable_le_eq_lintegral (f : α → ℝ≥0∞) :
⨆ (g : α → ℝ≥0∞) (_ : Measurable g) (_ : g ≤ f), ∫⁻ a, g a ∂μ = ∫⁻ a, f a ∂μ := by
apply le_antisymm
· exact iSup_le fun i => iSup_le fun _ => iSup_le fun h'i => lintegral_mono h'i
· rw [lintegral]
refine iSup₂_le fun i hi => le_iSup₂_of_le i i.measurable <| le_iSup_of_le hi ?_
exact le_of_eq (i.lintegral_eq_lintegral _).symm
theorem lintegral_mono_set {_ : MeasurableSpace α} ⦃μ : Measure α⦄ {s t : Set α} {f : α → ℝ≥0∞}
(hst : s ⊆ t) : ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in t, f x ∂μ :=
lintegral_mono' (Measure.restrict_mono hst (le_refl μ)) (le_refl f)
theorem lintegral_mono_set' {_ : MeasurableSpace α} ⦃μ : Measure α⦄ {s t : Set α} {f : α → ℝ≥0∞}
(hst : s ≤ᵐ[μ] t) : ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in t, f x ∂μ :=
lintegral_mono' (Measure.restrict_mono' hst (le_refl μ)) (le_refl f)
theorem monotone_lintegral {_ : MeasurableSpace α} (μ : Measure α) : Monotone (lintegral μ) :=
lintegral_mono
@[simp]
theorem lintegral_const (c : ℝ≥0∞) : ∫⁻ _, c ∂μ = c * μ univ := by
rw [← SimpleFunc.const_lintegral, ← SimpleFunc.lintegral_eq_lintegral, SimpleFunc.coe_const]
rfl
theorem lintegral_zero : ∫⁻ _ : α, 0 ∂μ = 0 := by simp
theorem lintegral_zero_fun : lintegral μ (0 : α → ℝ≥0∞) = 0 :=
lintegral_zero
-- @[simp] -- Porting note (#10618): simp can prove this
theorem lintegral_one : ∫⁻ _, (1 : ℝ≥0∞) ∂μ = μ univ := by rw [lintegral_const, one_mul]
theorem setLIntegral_const (s : Set α) (c : ℝ≥0∞) : ∫⁻ _ in s, c ∂μ = c * μ s := by
rw [lintegral_const, Measure.restrict_apply_univ]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_const := setLIntegral_const
theorem setLIntegral_one (s) : ∫⁻ _ in s, 1 ∂μ = μ s := by rw [setLIntegral_const, one_mul]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_one := setLIntegral_one
theorem setLIntegral_const_lt_top [IsFiniteMeasure μ] (s : Set α) {c : ℝ≥0∞} (hc : c ≠ ∞) :
∫⁻ _ in s, c ∂μ < ∞ := by
rw [lintegral_const]
exact ENNReal.mul_lt_top hc (measure_ne_top (μ.restrict s) univ)
@[deprecated (since := "2024-06-29")]
alias set_lintegral_const_lt_top := setLIntegral_const_lt_top
theorem lintegral_const_lt_top [IsFiniteMeasure μ] {c : ℝ≥0∞} (hc : c ≠ ∞) : ∫⁻ _, c ∂μ < ∞ := by
simpa only [Measure.restrict_univ] using setLIntegral_const_lt_top (univ : Set α) hc
section
variable (μ)
/-- For any function `f : α → ℝ≥0∞`, there exists a measurable function `g ≤ f` with the same
integral. -/
theorem exists_measurable_le_lintegral_eq (f : α → ℝ≥0∞) :
∃ g : α → ℝ≥0∞, Measurable g ∧ g ≤ f ∧ ∫⁻ a, f a ∂μ = ∫⁻ a, g a ∂μ := by
rcases eq_or_ne (∫⁻ a, f a ∂μ) 0 with h₀ | h₀
· exact ⟨0, measurable_zero, zero_le f, h₀.trans lintegral_zero.symm⟩
rcases exists_seq_strictMono_tendsto' h₀.bot_lt with ⟨L, _, hLf, hL_tendsto⟩
have : ∀ n, ∃ g : α → ℝ≥0∞, Measurable g ∧ g ≤ f ∧ L n < ∫⁻ a, g a ∂μ := by
intro n
simpa only [← iSup_lintegral_measurable_le_eq_lintegral f, lt_iSup_iff, exists_prop] using
(hLf n).2
choose g hgm hgf hLg using this
refine
⟨fun x => ⨆ n, g n x, measurable_iSup hgm, fun x => iSup_le fun n => hgf n x, le_antisymm ?_ ?_⟩
· refine le_of_tendsto' hL_tendsto fun n => (hLg n).le.trans <| lintegral_mono fun x => ?_
exact le_iSup (fun n => g n x) n
· exact lintegral_mono fun x => iSup_le fun n => hgf n x
end
/-- `∫⁻ a in s, f a ∂μ` is defined as the supremum of integrals of simple functions
`φ : α →ₛ ℝ≥0∞` such that `φ ≤ f`. This lemma says that it suffices to take
functions `φ : α →ₛ ℝ≥0`. -/
theorem lintegral_eq_nnreal {m : MeasurableSpace α} (f : α → ℝ≥0∞) (μ : Measure α) :
∫⁻ a, f a ∂μ =
⨆ (φ : α →ₛ ℝ≥0) (_ : ∀ x, ↑(φ x) ≤ f x), (φ.map ((↑) : ℝ≥0 → ℝ≥0∞)).lintegral μ := by
rw [lintegral]
refine
le_antisymm (iSup₂_le fun φ hφ ↦ ?_) (iSup_mono' fun φ ↦ ⟨φ.map ((↑) : ℝ≥0 → ℝ≥0∞), le_rfl⟩)
by_cases h : ∀ᵐ a ∂μ, φ a ≠ ∞
· let ψ := φ.map ENNReal.toNNReal
replace h : ψ.map ((↑) : ℝ≥0 → ℝ≥0∞) =ᵐ[μ] φ := h.mono fun a => ENNReal.coe_toNNReal
have : ∀ x, ↑(ψ x) ≤ f x := fun x => le_trans ENNReal.coe_toNNReal_le_self (hφ x)
exact le_iSup₂_of_le (φ.map ENNReal.toNNReal) this (ge_of_eq <| lintegral_congr h)
· have h_meas : μ (φ ⁻¹' {∞}) ≠ 0 := mt measure_zero_iff_ae_nmem.1 h
refine le_trans le_top (ge_of_eq <| (iSup_eq_top _).2 fun b hb => ?_)
obtain ⟨n, hn⟩ : ∃ n : ℕ, b < n * μ (φ ⁻¹' {∞}) := exists_nat_mul_gt h_meas (ne_of_lt hb)
use (const α (n : ℝ≥0)).restrict (φ ⁻¹' {∞})
simp only [lt_iSup_iff, exists_prop, coe_restrict, φ.measurableSet_preimage, coe_const,
ENNReal.coe_indicator, map_coe_ennreal_restrict, SimpleFunc.map_const, ENNReal.coe_natCast,
restrict_const_lintegral]
refine ⟨indicator_le fun x hx => le_trans ?_ (hφ _), hn⟩
simp only [mem_preimage, mem_singleton_iff] at hx
simp only [hx, le_top]
theorem exists_simpleFunc_forall_lintegral_sub_lt_of_pos {f : α → ℝ≥0∞} (h : ∫⁻ x, f x ∂μ ≠ ∞)
{ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ φ : α →ₛ ℝ≥0,
(∀ x, ↑(φ x) ≤ f x) ∧
∀ ψ : α →ₛ ℝ≥0, (∀ x, ↑(ψ x) ≤ f x) → (map (↑) (ψ - φ)).lintegral μ < ε := by
rw [lintegral_eq_nnreal] at h
have := ENNReal.lt_add_right h hε
erw [ENNReal.biSup_add] at this <;> [skip; exact ⟨0, fun x => zero_le _⟩]
simp_rw [lt_iSup_iff, iSup_lt_iff, iSup_le_iff] at this
rcases this with ⟨φ, hle : ∀ x, ↑(φ x) ≤ f x, b, hbφ, hb⟩
refine ⟨φ, hle, fun ψ hψ => ?_⟩
have : (map (↑) φ).lintegral μ ≠ ∞ := ne_top_of_le_ne_top h (by exact le_iSup₂ (α := ℝ≥0∞) φ hle)
rw [← ENNReal.add_lt_add_iff_left this, ← add_lintegral, ← SimpleFunc.map_add @ENNReal.coe_add]
refine (hb _ fun x => le_trans ?_ (max_le (hle x) (hψ x))).trans_lt hbφ
norm_cast
simp only [add_apply, sub_apply, add_tsub_eq_max]
rfl
theorem iSup_lintegral_le {ι : Sort*} (f : ι → α → ℝ≥0∞) :
⨆ i, ∫⁻ a, f i a ∂μ ≤ ∫⁻ a, ⨆ i, f i a ∂μ := by
simp only [← iSup_apply]
exact (monotone_lintegral μ).le_map_iSup
theorem iSup₂_lintegral_le {ι : Sort*} {ι' : ι → Sort*} (f : ∀ i, ι' i → α → ℝ≥0∞) :
⨆ (i) (j), ∫⁻ a, f i j a ∂μ ≤ ∫⁻ a, ⨆ (i) (j), f i j a ∂μ := by
convert (monotone_lintegral μ).le_map_iSup₂ f with a
simp only [iSup_apply]
theorem le_iInf_lintegral {ι : Sort*} (f : ι → α → ℝ≥0∞) :
∫⁻ a, ⨅ i, f i a ∂μ ≤ ⨅ i, ∫⁻ a, f i a ∂μ := by
simp only [← iInf_apply]
exact (monotone_lintegral μ).map_iInf_le
theorem le_iInf₂_lintegral {ι : Sort*} {ι' : ι → Sort*} (f : ∀ i, ι' i → α → ℝ≥0∞) :
∫⁻ a, ⨅ (i) (h : ι' i), f i h a ∂μ ≤ ⨅ (i) (h : ι' i), ∫⁻ a, f i h a ∂μ := by
convert (monotone_lintegral μ).map_iInf₂_le f with a
simp only [iInf_apply]
theorem lintegral_mono_ae {f g : α → ℝ≥0∞} (h : ∀ᵐ a ∂μ, f a ≤ g a) :
∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂μ := by
rcases exists_measurable_superset_of_null h with ⟨t, hts, ht, ht0⟩
have : ∀ᵐ x ∂μ, x ∉ t := measure_zero_iff_ae_nmem.1 ht0
rw [lintegral, lintegral]
refine iSup_le fun s => iSup_le fun hfs => le_iSup_of_le (s.restrict tᶜ) <| le_iSup_of_le ?_ ?_
· intro a
by_cases h : a ∈ t <;>
simp only [restrict_apply s ht.compl, mem_compl_iff, h, not_true, not_false_eq_true,
indicator_of_not_mem, zero_le, not_false_eq_true, indicator_of_mem]
exact le_trans (hfs a) (_root_.by_contradiction fun hnfg => h (hts hnfg))
· refine le_of_eq (SimpleFunc.lintegral_congr <| this.mono fun a hnt => ?_)
by_cases hat : a ∈ t <;> simp only [restrict_apply s ht.compl, mem_compl_iff, hat, not_true,
not_false_eq_true, indicator_of_not_mem, not_false_eq_true, indicator_of_mem]
exact (hnt hat).elim
/-- Lebesgue integral over a set is monotone in function.
This version assumes that the upper estimate is an a.e. measurable function
and the estimate holds a.e. on the set.
See also `setLIntegral_mono_ae'` for a version that assumes measurability of the set
but assumes no regularity of either function. -/
theorem setLIntegral_mono_ae {s : Set α} {f g : α → ℝ≥0∞} (hg : AEMeasurable g (μ.restrict s))
(hfg : ∀ᵐ x ∂μ, x ∈ s → f x ≤ g x) : ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in s, g x ∂μ := by
rcases exists_measurable_le_lintegral_eq (μ.restrict s) f with ⟨f', hf'm, hle, hf'⟩
rw [hf']
apply lintegral_mono_ae
rw [ae_restrict_iff₀]
· exact hfg.mono fun x hx hxs ↦ (hle x).trans (hx hxs)
· exact nullMeasurableSet_le hf'm.aemeasurable hg
@[deprecated (since := "2024-06-29")]
alias set_lintegral_mono_ae := setLIntegral_mono_ae
theorem setLIntegral_mono {s : Set α} {f g : α → ℝ≥0∞} (hg : Measurable g)
(hfg : ∀ x ∈ s, f x ≤ g x) : ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in s, g x ∂μ :=
setLIntegral_mono_ae hg.aemeasurable (ae_of_all _ hfg)
@[deprecated (since := "2024-06-29")]
alias set_lintegral_mono := setLIntegral_mono
theorem setLIntegral_mono_ae' {s : Set α} {f g : α → ℝ≥0∞} (hs : MeasurableSet s)
(hfg : ∀ᵐ x ∂μ, x ∈ s → f x ≤ g x) : ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in s, g x ∂μ :=
lintegral_mono_ae <| (ae_restrict_iff' hs).2 hfg
@[deprecated (since := "2024-06-29")]
alias set_lintegral_mono_ae' := setLIntegral_mono_ae'
theorem setLIntegral_mono' {s : Set α} {f g : α → ℝ≥0∞} (hs : MeasurableSet s)
(hfg : ∀ x ∈ s, f x ≤ g x) : ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in s, g x ∂μ :=
setLIntegral_mono_ae' hs (ae_of_all _ hfg)
@[deprecated (since := "2024-06-29")]
alias set_lintegral_mono' := setLIntegral_mono'
theorem setLIntegral_le_lintegral (s : Set α) (f : α → ℝ≥0∞) :
∫⁻ x in s, f x ∂μ ≤ ∫⁻ x, f x ∂μ :=
lintegral_mono' Measure.restrict_le_self le_rfl
@[deprecated (since := "2024-06-29")]
alias set_lintegral_le_lintegral := setLIntegral_le_lintegral
theorem lintegral_congr_ae {f g : α → ℝ≥0∞} (h : f =ᵐ[μ] g) : ∫⁻ a, f a ∂μ = ∫⁻ a, g a ∂μ :=
le_antisymm (lintegral_mono_ae <| h.le) (lintegral_mono_ae <| h.symm.le)
theorem lintegral_congr {f g : α → ℝ≥0∞} (h : ∀ a, f a = g a) : ∫⁻ a, f a ∂μ = ∫⁻ a, g a ∂μ := by
simp only [h]
theorem setLIntegral_congr {f : α → ℝ≥0∞} {s t : Set α} (h : s =ᵐ[μ] t) :
∫⁻ x in s, f x ∂μ = ∫⁻ x in t, f x ∂μ := by rw [Measure.restrict_congr_set h]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_congr := setLIntegral_congr
theorem setLIntegral_congr_fun {f g : α → ℝ≥0∞} {s : Set α} (hs : MeasurableSet s)
(hfg : ∀ᵐ x ∂μ, x ∈ s → f x = g x) : ∫⁻ x in s, f x ∂μ = ∫⁻ x in s, g x ∂μ := by
rw [lintegral_congr_ae]
rw [EventuallyEq]
rwa [ae_restrict_iff' hs]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_congr_fun := setLIntegral_congr_fun
theorem lintegral_ofReal_le_lintegral_nnnorm (f : α → ℝ) :
∫⁻ x, ENNReal.ofReal (f x) ∂μ ≤ ∫⁻ x, ‖f x‖₊ ∂μ := by
simp_rw [← ofReal_norm_eq_coe_nnnorm]
refine lintegral_mono fun x => ENNReal.ofReal_le_ofReal ?_
rw [Real.norm_eq_abs]
exact le_abs_self (f x)
theorem lintegral_nnnorm_eq_of_ae_nonneg {f : α → ℝ} (h_nonneg : 0 ≤ᵐ[μ] f) :
∫⁻ x, ‖f x‖₊ ∂μ = ∫⁻ x, ENNReal.ofReal (f x) ∂μ := by
apply lintegral_congr_ae
filter_upwards [h_nonneg] with x hx
rw [Real.nnnorm_of_nonneg hx, ENNReal.ofReal_eq_coe_nnreal hx]
theorem lintegral_nnnorm_eq_of_nonneg {f : α → ℝ} (h_nonneg : 0 ≤ f) :
∫⁻ x, ‖f x‖₊ ∂μ = ∫⁻ x, ENNReal.ofReal (f x) ∂μ :=
lintegral_nnnorm_eq_of_ae_nonneg (Filter.eventually_of_forall h_nonneg)
/-- **Monotone convergence theorem** -- sometimes called **Beppo-Levi convergence**.
See `lintegral_iSup_directed` for a more general form. -/
theorem lintegral_iSup {f : ℕ → α → ℝ≥0∞} (hf : ∀ n, Measurable (f n)) (h_mono : Monotone f) :
∫⁻ a, ⨆ n, f n a ∂μ = ⨆ n, ∫⁻ a, f n a ∂μ := by
set c : ℝ≥0 → ℝ≥0∞ := (↑)
set F := fun a : α => ⨆ n, f n a
refine le_antisymm ?_ (iSup_lintegral_le _)
rw [lintegral_eq_nnreal]
refine iSup_le fun s => iSup_le fun hsf => ?_
refine ENNReal.le_of_forall_lt_one_mul_le fun a ha => ?_
rcases ENNReal.lt_iff_exists_coe.1 ha with ⟨r, rfl, _⟩
have ha : r < 1 := ENNReal.coe_lt_coe.1 ha
let rs := s.map fun a => r * a
have eq_rs : rs.map c = (const α r : α →ₛ ℝ≥0∞) * map c s := rfl
have eq : ∀ p, rs.map c ⁻¹' {p} = ⋃ n, rs.map c ⁻¹' {p} ∩ { a | p ≤ f n a } := by
intro p
rw [← inter_iUnion]; nth_rw 1 [← inter_univ (map c rs ⁻¹' {p})]
refine Set.ext fun x => and_congr_right fun hx => true_iff_iff.2 ?_
by_cases p_eq : p = 0
· simp [p_eq]
simp only [coe_map, mem_preimage, Function.comp_apply, mem_singleton_iff] at hx
subst hx
have : r * s x ≠ 0 := by rwa [Ne, ← ENNReal.coe_eq_zero]
have : s x ≠ 0 := right_ne_zero_of_mul this
have : (rs.map c) x < ⨆ n : ℕ, f n x := by
refine lt_of_lt_of_le (ENNReal.coe_lt_coe.2 ?_) (hsf x)
suffices r * s x < 1 * s x by simpa
exact mul_lt_mul_of_pos_right ha (pos_iff_ne_zero.2 this)
rcases lt_iSup_iff.1 this with ⟨i, hi⟩
exact mem_iUnion.2 ⟨i, le_of_lt hi⟩
have mono : ∀ r : ℝ≥0∞, Monotone fun n => rs.map c ⁻¹' {r} ∩ { a | r ≤ f n a } := by
intro r i j h
refine inter_subset_inter_right _ ?_
simp_rw [subset_def, mem_setOf]
intro x hx
exact le_trans hx (h_mono h x)
have h_meas : ∀ n, MeasurableSet {a : α | map c rs a ≤ f n a} := fun n =>
measurableSet_le (SimpleFunc.measurable _) (hf n)
calc
(r : ℝ≥0∞) * (s.map c).lintegral μ = ∑ r ∈ (rs.map c).range, r * μ (rs.map c ⁻¹' {r}) := by
rw [← const_mul_lintegral, eq_rs, SimpleFunc.lintegral]
_ = ∑ r ∈ (rs.map c).range, r * μ (⋃ n, rs.map c ⁻¹' {r} ∩ { a | r ≤ f n a }) := by
simp only [(eq _).symm]
_ = ∑ r ∈ (rs.map c).range, ⨆ n, r * μ (rs.map c ⁻¹' {r} ∩ { a | r ≤ f n a }) :=
(Finset.sum_congr rfl fun x _ => by
rw [measure_iUnion_eq_iSup (mono x).directed_le, ENNReal.mul_iSup])
_ = ⨆ n, ∑ r ∈ (rs.map c).range, r * μ (rs.map c ⁻¹' {r} ∩ { a | r ≤ f n a }) := by
refine ENNReal.finsetSum_iSup_of_monotone fun p i j h ↦ ?_
gcongr _ * μ ?_
exact mono p h
_ ≤ ⨆ n : ℕ, ((rs.map c).restrict { a | (rs.map c) a ≤ f n a }).lintegral μ := by
gcongr with n
rw [restrict_lintegral _ (h_meas n)]
refine le_of_eq (Finset.sum_congr rfl fun r _ => ?_)
congr 2 with a
refine and_congr_right ?_
simp (config := { contextual := true })
_ ≤ ⨆ n, ∫⁻ a, f n a ∂μ := by
simp only [← SimpleFunc.lintegral_eq_lintegral]
gcongr with n a
simp only [map_apply] at h_meas
simp only [coe_map, restrict_apply _ (h_meas _), (· ∘ ·)]
exact indicator_apply_le id
/-- Monotone convergence theorem -- sometimes called Beppo-Levi convergence. Version with
ae_measurable functions. -/
theorem lintegral_iSup' {f : ℕ → α → ℝ≥0∞} (hf : ∀ n, AEMeasurable (f n) μ)
(h_mono : ∀ᵐ x ∂μ, Monotone fun n => f n x) : ∫⁻ a, ⨆ n, f n a ∂μ = ⨆ n, ∫⁻ a, f n a ∂μ := by
simp_rw [← iSup_apply]
let p : α → (ℕ → ℝ≥0∞) → Prop := fun _ f' => Monotone f'
have hp : ∀ᵐ x ∂μ, p x fun i => f i x := h_mono
have h_ae_seq_mono : Monotone (aeSeq hf p) := by
intro n m hnm x
by_cases hx : x ∈ aeSeqSet hf p
· exact aeSeq.prop_of_mem_aeSeqSet hf hx hnm
· simp only [aeSeq, hx, if_false, le_rfl]
rw [lintegral_congr_ae (aeSeq.iSup hf hp).symm]
simp_rw [iSup_apply]
rw [lintegral_iSup (aeSeq.measurable hf p) h_ae_seq_mono]
congr with n
exact lintegral_congr_ae (aeSeq.aeSeq_n_eq_fun_n_ae hf hp n)
/-- Monotone convergence theorem expressed with limits -/
theorem lintegral_tendsto_of_tendsto_of_monotone {f : ℕ → α → ℝ≥0∞} {F : α → ℝ≥0∞}
(hf : ∀ n, AEMeasurable (f n) μ) (h_mono : ∀ᵐ x ∂μ, Monotone fun n => f n x)
(h_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 <| F x)) :
Tendsto (fun n => ∫⁻ x, f n x ∂μ) atTop (𝓝 <| ∫⁻ x, F x ∂μ) := by
have : Monotone fun n => ∫⁻ x, f n x ∂μ := fun i j hij =>
lintegral_mono_ae (h_mono.mono fun x hx => hx hij)
suffices key : ∫⁻ x, F x ∂μ = ⨆ n, ∫⁻ x, f n x ∂μ by
rw [key]
exact tendsto_atTop_iSup this
rw [← lintegral_iSup' hf h_mono]
refine lintegral_congr_ae ?_
filter_upwards [h_mono, h_tendsto] with _ hx_mono hx_tendsto using
tendsto_nhds_unique hx_tendsto (tendsto_atTop_iSup hx_mono)
theorem lintegral_eq_iSup_eapprox_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) :
∫⁻ a, f a ∂μ = ⨆ n, (eapprox f n).lintegral μ :=
calc
∫⁻ a, f a ∂μ = ∫⁻ a, ⨆ n, (eapprox f n : α → ℝ≥0∞) a ∂μ := by
congr; ext a; rw [iSup_eapprox_apply f hf]
_ = ⨆ n, ∫⁻ a, (eapprox f n : α → ℝ≥0∞) a ∂μ := by
apply lintegral_iSup
· measurability
· intro i j h
exact monotone_eapprox f h
_ = ⨆ n, (eapprox f n).lintegral μ := by
congr; ext n; rw [(eapprox f n).lintegral_eq_lintegral]
/-- If `f` has finite integral, then `∫⁻ x in s, f x ∂μ` is absolutely continuous in `s`: it tends
to zero as `μ s` tends to zero. This lemma states this fact in terms of `ε` and `δ`. -/
theorem exists_pos_setLIntegral_lt_of_measure_lt {f : α → ℝ≥0∞} (h : ∫⁻ x, f x ∂μ ≠ ∞) {ε : ℝ≥0∞}
(hε : ε ≠ 0) : ∃ δ > 0, ∀ s, μ s < δ → ∫⁻ x in s, f x ∂μ < ε := by
rcases exists_between (pos_iff_ne_zero.mpr hε) with ⟨ε₂, hε₂0, hε₂ε⟩
rcases exists_between hε₂0 with ⟨ε₁, hε₁0, hε₁₂⟩
rcases exists_simpleFunc_forall_lintegral_sub_lt_of_pos h hε₁0.ne' with ⟨φ, _, hφ⟩
rcases φ.exists_forall_le with ⟨C, hC⟩
use (ε₂ - ε₁) / C, ENNReal.div_pos_iff.2 ⟨(tsub_pos_iff_lt.2 hε₁₂).ne', ENNReal.coe_ne_top⟩
refine fun s hs => lt_of_le_of_lt ?_ hε₂ε
simp only [lintegral_eq_nnreal, iSup_le_iff]
intro ψ hψ
calc
(map (↑) ψ).lintegral (μ.restrict s) ≤
(map (↑) φ).lintegral (μ.restrict s) + (map (↑) (ψ - φ)).lintegral (μ.restrict s) := by
rw [← SimpleFunc.add_lintegral, ← SimpleFunc.map_add @ENNReal.coe_add]
refine SimpleFunc.lintegral_mono (fun x => ?_) le_rfl
simp only [add_tsub_eq_max, le_max_right, coe_map, Function.comp_apply, SimpleFunc.coe_add,
SimpleFunc.coe_sub, Pi.add_apply, Pi.sub_apply, ENNReal.coe_max (φ x) (ψ x)]
_ ≤ (map (↑) φ).lintegral (μ.restrict s) + ε₁ := by
gcongr
refine le_trans ?_ (hφ _ hψ).le
exact SimpleFunc.lintegral_mono le_rfl Measure.restrict_le_self
_ ≤ (SimpleFunc.const α (C : ℝ≥0∞)).lintegral (μ.restrict s) + ε₁ := by
gcongr
exact SimpleFunc.lintegral_mono (fun x ↦ ENNReal.coe_le_coe.2 (hC x)) le_rfl
_ = C * μ s + ε₁ := by
simp only [← SimpleFunc.lintegral_eq_lintegral, coe_const, lintegral_const,
Measure.restrict_apply, MeasurableSet.univ, univ_inter, Function.const]
_ ≤ C * ((ε₂ - ε₁) / C) + ε₁ := by gcongr
_ ≤ ε₂ - ε₁ + ε₁ := by gcongr; apply mul_div_le
_ = ε₂ := tsub_add_cancel_of_le hε₁₂.le
@[deprecated (since := "2024-06-29")]
alias exists_pos_set_lintegral_lt_of_measure_lt := exists_pos_setLIntegral_lt_of_measure_lt
/-- If `f` has finite integral, then `∫⁻ x in s, f x ∂μ` is absolutely continuous in `s`: it tends
to zero as `μ s` tends to zero. -/
theorem tendsto_setLIntegral_zero {ι} {f : α → ℝ≥0∞} (h : ∫⁻ x, f x ∂μ ≠ ∞) {l : Filter ι}
{s : ι → Set α} (hl : Tendsto (μ ∘ s) l (𝓝 0)) :
Tendsto (fun i => ∫⁻ x in s i, f x ∂μ) l (𝓝 0) := by
simp only [ENNReal.nhds_zero, tendsto_iInf, tendsto_principal, mem_Iio,
← pos_iff_ne_zero] at hl ⊢
intro ε ε0
rcases exists_pos_setLIntegral_lt_of_measure_lt h ε0.ne' with ⟨δ, δ0, hδ⟩
exact (hl δ δ0).mono fun i => hδ _
@[deprecated (since := "2024-06-29")]
alias tendsto_set_lintegral_zero := tendsto_setLIntegral_zero
/-- The sum of the lower Lebesgue integrals of two functions is less than or equal to the integral
of their sum. The other inequality needs one of these functions to be (a.e.-)measurable. -/
theorem le_lintegral_add (f g : α → ℝ≥0∞) :
∫⁻ a, f a ∂μ + ∫⁻ a, g a ∂μ ≤ ∫⁻ a, f a + g a ∂μ := by
simp only [lintegral]
refine ENNReal.biSup_add_biSup_le' (p := fun h : α →ₛ ℝ≥0∞ => h ≤ f)
(q := fun h : α →ₛ ℝ≥0∞ => h ≤ g) ⟨0, zero_le f⟩ ⟨0, zero_le g⟩ fun f' hf' g' hg' => ?_
exact le_iSup₂_of_le (f' + g') (add_le_add hf' hg') (add_lintegral _ _).ge
-- Use stronger lemmas `lintegral_add_left`/`lintegral_add_right` instead
theorem lintegral_add_aux {f g : α → ℝ≥0∞} (hf : Measurable f) (hg : Measurable g) :
∫⁻ a, f a + g a ∂μ = ∫⁻ a, f a ∂μ + ∫⁻ a, g a ∂μ :=
calc
∫⁻ a, f a + g a ∂μ =
∫⁻ a, (⨆ n, (eapprox f n : α → ℝ≥0∞) a) + ⨆ n, (eapprox g n : α → ℝ≥0∞) a ∂μ := by
simp only [iSup_eapprox_apply, hf, hg]
_ = ∫⁻ a, ⨆ n, (eapprox f n + eapprox g n : α → ℝ≥0∞) a ∂μ := by
congr; funext a
rw [ENNReal.iSup_add_iSup_of_monotone]
· simp only [Pi.add_apply]
· intro i j h
exact monotone_eapprox _ h a
· intro i j h
exact monotone_eapprox _ h a
_ = ⨆ n, (eapprox f n).lintegral μ + (eapprox g n).lintegral μ := by
rw [lintegral_iSup]
· congr
funext n
rw [← SimpleFunc.add_lintegral, ← SimpleFunc.lintegral_eq_lintegral]
simp only [Pi.add_apply, SimpleFunc.coe_add]
· measurability
· intro i j h a
dsimp
gcongr <;> exact monotone_eapprox _ h _
_ = (⨆ n, (eapprox f n).lintegral μ) + ⨆ n, (eapprox g n).lintegral μ := by
refine (ENNReal.iSup_add_iSup_of_monotone ?_ ?_).symm <;>
· intro i j h
exact SimpleFunc.lintegral_mono (monotone_eapprox _ h) le_rfl
_ = ∫⁻ a, f a ∂μ + ∫⁻ a, g a ∂μ := by
rw [lintegral_eq_iSup_eapprox_lintegral hf, lintegral_eq_iSup_eapprox_lintegral hg]
/-- If `f g : α → ℝ≥0∞` are two functions and one of them is (a.e.) measurable, then the Lebesgue
integral of `f + g` equals the sum of integrals. This lemma assumes that `f` is integrable, see also
`MeasureTheory.lintegral_add_right` and primed versions of these lemmas. -/
@[simp]
theorem lintegral_add_left {f : α → ℝ≥0∞} (hf : Measurable f) (g : α → ℝ≥0∞) :
∫⁻ a, f a + g a ∂μ = ∫⁻ a, f a ∂μ + ∫⁻ a, g a ∂μ := by
refine le_antisymm ?_ (le_lintegral_add _ _)
rcases exists_measurable_le_lintegral_eq μ fun a => f a + g a with ⟨φ, hφm, hφ_le, hφ_eq⟩
calc
∫⁻ a, f a + g a ∂μ = ∫⁻ a, φ a ∂μ := hφ_eq
_ ≤ ∫⁻ a, f a + (φ a - f a) ∂μ := lintegral_mono fun a => le_add_tsub
_ = ∫⁻ a, f a ∂μ + ∫⁻ a, φ a - f a ∂μ := lintegral_add_aux hf (hφm.sub hf)
_ ≤ ∫⁻ a, f a ∂μ + ∫⁻ a, g a ∂μ :=
add_le_add_left (lintegral_mono fun a => tsub_le_iff_left.2 <| hφ_le a) _
theorem lintegral_add_left' {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) (g : α → ℝ≥0∞) :
∫⁻ a, f a + g a ∂μ = ∫⁻ a, f a ∂μ + ∫⁻ a, g a ∂μ := by
rw [lintegral_congr_ae hf.ae_eq_mk, ← lintegral_add_left hf.measurable_mk,
lintegral_congr_ae (hf.ae_eq_mk.add (ae_eq_refl g))]
theorem lintegral_add_right' (f : α → ℝ≥0∞) {g : α → ℝ≥0∞} (hg : AEMeasurable g μ) :
∫⁻ a, f a + g a ∂μ = ∫⁻ a, f a ∂μ + ∫⁻ a, g a ∂μ := by
simpa only [add_comm] using lintegral_add_left' hg f
/-- If `f g : α → ℝ≥0∞` are two functions and one of them is (a.e.) measurable, then the Lebesgue
integral of `f + g` equals the sum of integrals. This lemma assumes that `g` is integrable, see also
`MeasureTheory.lintegral_add_left` and primed versions of these lemmas. -/
@[simp]
theorem lintegral_add_right (f : α → ℝ≥0∞) {g : α → ℝ≥0∞} (hg : Measurable g) :
∫⁻ a, f a + g a ∂μ = ∫⁻ a, f a ∂μ + ∫⁻ a, g a ∂μ :=
lintegral_add_right' f hg.aemeasurable
@[simp]
theorem lintegral_smul_measure (c : ℝ≥0∞) (f : α → ℝ≥0∞) : ∫⁻ a, f a ∂c • μ = c * ∫⁻ a, f a ∂μ := by
simp only [lintegral, iSup_subtype', SimpleFunc.lintegral_smul, ENNReal.mul_iSup, smul_eq_mul]
lemma setLIntegral_smul_measure (c : ℝ≥0∞) (f : α → ℝ≥0∞) (s : Set α) :
∫⁻ a in s, f a ∂(c • μ) = c * ∫⁻ a in s, f a ∂μ := by
rw [Measure.restrict_smul, lintegral_smul_measure]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_smul_measure := setLIntegral_smul_measure
@[simp]
theorem lintegral_sum_measure {m : MeasurableSpace α} {ι} (f : α → ℝ≥0∞) (μ : ι → Measure α) :
∫⁻ a, f a ∂Measure.sum μ = ∑' i, ∫⁻ a, f a ∂μ i := by
classical
simp only [lintegral, iSup_subtype', SimpleFunc.lintegral_sum, ENNReal.tsum_eq_iSup_sum]
rw [iSup_comm]
congr; funext s
induction' s using Finset.induction_on with i s hi hs
· simp
simp only [Finset.sum_insert hi, ← hs]
refine (ENNReal.iSup_add_iSup ?_).symm
intro φ ψ
exact
⟨⟨φ ⊔ ψ, fun x => sup_le (φ.2 x) (ψ.2 x)⟩,
add_le_add (SimpleFunc.lintegral_mono le_sup_left le_rfl)
(Finset.sum_le_sum fun j _ => SimpleFunc.lintegral_mono le_sup_right le_rfl)⟩
theorem hasSum_lintegral_measure {ι} {_ : MeasurableSpace α} (f : α → ℝ≥0∞) (μ : ι → Measure α) :
HasSum (fun i => ∫⁻ a, f a ∂μ i) (∫⁻ a, f a ∂Measure.sum μ) :=
(lintegral_sum_measure f μ).symm ▸ ENNReal.summable.hasSum
@[simp]
theorem lintegral_add_measure {m : MeasurableSpace α} (f : α → ℝ≥0∞) (μ ν : Measure α) :
∫⁻ a, f a ∂(μ + ν) = ∫⁻ a, f a ∂μ + ∫⁻ a, f a ∂ν := by
simpa [tsum_fintype] using lintegral_sum_measure f fun b => cond b μ ν
@[simp]
theorem lintegral_finset_sum_measure {ι} {m : MeasurableSpace α} (s : Finset ι) (f : α → ℝ≥0∞)
(μ : ι → Measure α) : ∫⁻ a, f a ∂(∑ i ∈ s, μ i) = ∑ i ∈ s, ∫⁻ a, f a ∂μ i := by
rw [← Measure.sum_coe_finset, lintegral_sum_measure, ← Finset.tsum_subtype']
simp only [Finset.coe_sort_coe]
@[simp]
theorem lintegral_zero_measure {m : MeasurableSpace α} (f : α → ℝ≥0∞) :
∫⁻ a, f a ∂(0 : Measure α) = 0 := by
simp [lintegral]
@[simp]
theorem lintegral_of_isEmpty {α} [MeasurableSpace α] [IsEmpty α] (μ : Measure α) (f : α → ℝ≥0∞) :
∫⁻ x, f x ∂μ = 0 := by
have : Subsingleton (Measure α) := inferInstance
convert lintegral_zero_measure f
theorem setLIntegral_empty (f : α → ℝ≥0∞) : ∫⁻ x in ∅, f x ∂μ = 0 := by
rw [Measure.restrict_empty, lintegral_zero_measure]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_empty := setLIntegral_empty
theorem setLIntegral_univ (f : α → ℝ≥0∞) : ∫⁻ x in univ, f x ∂μ = ∫⁻ x, f x ∂μ := by
rw [Measure.restrict_univ]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_univ := setLIntegral_univ
theorem setLIntegral_measure_zero (s : Set α) (f : α → ℝ≥0∞) (hs' : μ s = 0) :
∫⁻ x in s, f x ∂μ = 0 := by
convert lintegral_zero_measure _
exact Measure.restrict_eq_zero.2 hs'
@[deprecated (since := "2024-06-29")]
alias set_lintegral_measure_zero := setLIntegral_measure_zero
theorem lintegral_finset_sum' (s : Finset β) {f : β → α → ℝ≥0∞}
(hf : ∀ b ∈ s, AEMeasurable (f b) μ) :
∫⁻ a, ∑ b ∈ s, f b a ∂μ = ∑ b ∈ s, ∫⁻ a, f b a ∂μ := by
classical
induction' s using Finset.induction_on with a s has ih
· simp
· simp only [Finset.sum_insert has]
rw [Finset.forall_mem_insert] at hf
rw [lintegral_add_left' hf.1, ih hf.2]
theorem lintegral_finset_sum (s : Finset β) {f : β → α → ℝ≥0∞} (hf : ∀ b ∈ s, Measurable (f b)) :
∫⁻ a, ∑ b ∈ s, f b a ∂μ = ∑ b ∈ s, ∫⁻ a, f b a ∂μ :=
lintegral_finset_sum' s fun b hb => (hf b hb).aemeasurable
@[simp]
theorem lintegral_const_mul (r : ℝ≥0∞) {f : α → ℝ≥0∞} (hf : Measurable f) :
∫⁻ a, r * f a ∂μ = r * ∫⁻ a, f a ∂μ :=
calc
∫⁻ a, r * f a ∂μ = ∫⁻ a, ⨆ n, (const α r * eapprox f n) a ∂μ := by
congr
funext a
rw [← iSup_eapprox_apply f hf, ENNReal.mul_iSup]
simp
_ = ⨆ n, r * (eapprox f n).lintegral μ := by
rw [lintegral_iSup]
· congr
funext n
rw [← SimpleFunc.const_mul_lintegral, ← SimpleFunc.lintegral_eq_lintegral]
· intro n
exact SimpleFunc.measurable _
· intro i j h a
exact mul_le_mul_left' (monotone_eapprox _ h _) _
_ = r * ∫⁻ a, f a ∂μ := by rw [← ENNReal.mul_iSup, lintegral_eq_iSup_eapprox_lintegral hf]
theorem lintegral_const_mul'' (r : ℝ≥0∞) {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) :
∫⁻ a, r * f a ∂μ = r * ∫⁻ a, f a ∂μ := by
have A : ∫⁻ a, f a ∂μ = ∫⁻ a, hf.mk f a ∂μ := lintegral_congr_ae hf.ae_eq_mk
have B : ∫⁻ a, r * f a ∂μ = ∫⁻ a, r * hf.mk f a ∂μ :=
lintegral_congr_ae (EventuallyEq.fun_comp hf.ae_eq_mk _)
rw [A, B, lintegral_const_mul _ hf.measurable_mk]
theorem lintegral_const_mul_le (r : ℝ≥0∞) (f : α → ℝ≥0∞) :
r * ∫⁻ a, f a ∂μ ≤ ∫⁻ a, r * f a ∂μ := by
rw [lintegral, ENNReal.mul_iSup]
refine iSup_le fun s => ?_
rw [ENNReal.mul_iSup, iSup_le_iff]
intro hs
rw [← SimpleFunc.const_mul_lintegral, lintegral]
refine le_iSup_of_le (const α r * s) (le_iSup_of_le (fun x => ?_) le_rfl)
exact mul_le_mul_left' (hs x) _
theorem lintegral_const_mul' (r : ℝ≥0∞) (f : α → ℝ≥0∞) (hr : r ≠ ∞) :
∫⁻ a, r * f a ∂μ = r * ∫⁻ a, f a ∂μ := by
by_cases h : r = 0
· simp [h]
apply le_antisymm _ (lintegral_const_mul_le r f)
have rinv : r * r⁻¹ = 1 := ENNReal.mul_inv_cancel h hr
have rinv' : r⁻¹ * r = 1 := by
rw [mul_comm]
exact rinv
have := lintegral_const_mul_le (μ := μ) r⁻¹ fun x => r * f x
simp? [(mul_assoc _ _ _).symm, rinv'] at this says
simp only [(mul_assoc _ _ _).symm, rinv', one_mul] at this
simpa [(mul_assoc _ _ _).symm, rinv] using mul_le_mul_left' this r
theorem lintegral_mul_const (r : ℝ≥0∞) {f : α → ℝ≥0∞} (hf : Measurable f) :
∫⁻ a, f a * r ∂μ = (∫⁻ a, f a ∂μ) * r := by simp_rw [mul_comm, lintegral_const_mul r hf]
theorem lintegral_mul_const'' (r : ℝ≥0∞) {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) :
∫⁻ a, f a * r ∂μ = (∫⁻ a, f a ∂μ) * r := by simp_rw [mul_comm, lintegral_const_mul'' r hf]
theorem lintegral_mul_const_le (r : ℝ≥0∞) (f : α → ℝ≥0∞) :
(∫⁻ a, f a ∂μ) * r ≤ ∫⁻ a, f a * r ∂μ := by
simp_rw [mul_comm, lintegral_const_mul_le r f]
theorem lintegral_mul_const' (r : ℝ≥0∞) (f : α → ℝ≥0∞) (hr : r ≠ ∞) :
∫⁻ a, f a * r ∂μ = (∫⁻ a, f a ∂μ) * r := by simp_rw [mul_comm, lintegral_const_mul' r f hr]
/- A double integral of a product where each factor contains only one variable
is a product of integrals -/
theorem lintegral_lintegral_mul {β} [MeasurableSpace β] {ν : Measure β} {f : α → ℝ≥0∞}
{g : β → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g ν) :
∫⁻ x, ∫⁻ y, f x * g y ∂ν ∂μ = (∫⁻ x, f x ∂μ) * ∫⁻ y, g y ∂ν := by
simp [lintegral_const_mul'' _ hg, lintegral_mul_const'' _ hf]
-- TODO: Need a better way of rewriting inside of an integral
theorem lintegral_rw₁ {f f' : α → β} (h : f =ᵐ[μ] f') (g : β → ℝ≥0∞) :
∫⁻ a, g (f a) ∂μ = ∫⁻ a, g (f' a) ∂μ :=
lintegral_congr_ae <| h.mono fun a h => by dsimp only; rw [h]
-- TODO: Need a better way of rewriting inside of an integral
theorem lintegral_rw₂ {f₁ f₁' : α → β} {f₂ f₂' : α → γ} (h₁ : f₁ =ᵐ[μ] f₁') (h₂ : f₂ =ᵐ[μ] f₂')
(g : β → γ → ℝ≥0∞) : ∫⁻ a, g (f₁ a) (f₂ a) ∂μ = ∫⁻ a, g (f₁' a) (f₂' a) ∂μ :=
lintegral_congr_ae <| h₁.mp <| h₂.mono fun _ h₂ h₁ => by dsimp only; rw [h₁, h₂]
theorem lintegral_indicator_le (f : α → ℝ≥0∞) (s : Set α) :
∫⁻ a, s.indicator f a ∂μ ≤ ∫⁻ a in s, f a ∂μ := by
simp only [lintegral]
apply iSup_le (fun g ↦ (iSup_le (fun hg ↦ ?_)))
have : g ≤ f := hg.trans (indicator_le_self s f)
refine le_iSup_of_le g (le_iSup_of_le this (le_of_eq ?_))
rw [lintegral_restrict, SimpleFunc.lintegral]
congr with t
by_cases H : t = 0
· simp [H]
congr with x
simp only [mem_preimage, mem_singleton_iff, mem_inter_iff, iff_self_and]
rintro rfl
contrapose! H
simpa [H] using hg x
@[simp]
theorem lintegral_indicator (f : α → ℝ≥0∞) {s : Set α} (hs : MeasurableSet s) :
∫⁻ a, s.indicator f a ∂μ = ∫⁻ a in s, f a ∂μ := by
apply le_antisymm (lintegral_indicator_le f s)
simp only [lintegral, ← restrict_lintegral_eq_lintegral_restrict _ hs, iSup_subtype']
refine iSup_mono' (Subtype.forall.2 fun φ hφ => ?_)
refine ⟨⟨φ.restrict s, fun x => ?_⟩, le_rfl⟩
simp [hφ x, hs, indicator_le_indicator]
theorem lintegral_indicator₀ (f : α → ℝ≥0∞) {s : Set α} (hs : NullMeasurableSet s μ) :
∫⁻ a, s.indicator f a ∂μ = ∫⁻ a in s, f a ∂μ := by
rw [← lintegral_congr_ae (indicator_ae_eq_of_ae_eq_set hs.toMeasurable_ae_eq),
lintegral_indicator _ (measurableSet_toMeasurable _ _),
Measure.restrict_congr_set hs.toMeasurable_ae_eq]
theorem lintegral_indicator_const_le (s : Set α) (c : ℝ≥0∞) :
∫⁻ a, s.indicator (fun _ => c) a ∂μ ≤ c * μ s :=
(lintegral_indicator_le _ _).trans (setLIntegral_const s c).le
theorem lintegral_indicator_const₀ {s : Set α} (hs : NullMeasurableSet s μ) (c : ℝ≥0∞) :
∫⁻ a, s.indicator (fun _ => c) a ∂μ = c * μ s := by
rw [lintegral_indicator₀ _ hs, setLIntegral_const]
theorem lintegral_indicator_const {s : Set α} (hs : MeasurableSet s) (c : ℝ≥0∞) :
∫⁻ a, s.indicator (fun _ => c) a ∂μ = c * μ s :=
lintegral_indicator_const₀ hs.nullMeasurableSet c
lemma setLIntegral_eq_of_support_subset {s : Set α} {f : α → ℝ≥0∞} (hsf : f.support ⊆ s) :
∫⁻ x in s, f x ∂μ = ∫⁻ x, f x ∂μ := by
apply le_antisymm (setLIntegral_le_lintegral s fun x ↦ f x)
apply le_trans (le_of_eq _) (lintegral_indicator_le _ _)
congr with x
simp only [indicator]
split_ifs with h
· rfl
· exact Function.support_subset_iff'.1 hsf x h
theorem setLIntegral_eq_const {f : α → ℝ≥0∞} (hf : Measurable f) (r : ℝ≥0∞) :
∫⁻ x in { x | f x = r }, f x ∂μ = r * μ { x | f x = r } := by
have : ∀ᵐ x ∂μ, x ∈ { x | f x = r } → f x = r := ae_of_all μ fun _ hx => hx
rw [setLIntegral_congr_fun _ this]
· rw [lintegral_const, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter]
· exact hf (measurableSet_singleton r)
@[deprecated (since := "2024-06-29")]
alias set_lintegral_eq_const := setLIntegral_eq_const
theorem lintegral_indicator_one_le (s : Set α) : ∫⁻ a, s.indicator 1 a ∂μ ≤ μ s :=
(lintegral_indicator_const_le _ _).trans <| (one_mul _).le
@[simp]
theorem lintegral_indicator_one₀ {s : Set α} (hs : NullMeasurableSet s μ) :
∫⁻ a, s.indicator 1 a ∂μ = μ s :=
(lintegral_indicator_const₀ hs _).trans <| one_mul _
@[simp]
theorem lintegral_indicator_one {s : Set α} (hs : MeasurableSet s) :
∫⁻ a, s.indicator 1 a ∂μ = μ s :=
(lintegral_indicator_const hs _).trans <| one_mul _
/-- A version of **Markov's inequality** for two functions. It doesn't follow from the standard
Markov's inequality because we only assume measurability of `g`, not `f`. -/
theorem lintegral_add_mul_meas_add_le_le_lintegral {f g : α → ℝ≥0∞} (hle : f ≤ᵐ[μ] g)
(hg : AEMeasurable g μ) (ε : ℝ≥0∞) :
∫⁻ a, f a ∂μ + ε * μ { x | f x + ε ≤ g x } ≤ ∫⁻ a, g a ∂μ := by
rcases exists_measurable_le_lintegral_eq μ f with ⟨φ, hφm, hφ_le, hφ_eq⟩
calc
∫⁻ x, f x ∂μ + ε * μ { x | f x + ε ≤ g x } = ∫⁻ x, φ x ∂μ + ε * μ { x | f x + ε ≤ g x } := by
rw [hφ_eq]
_ ≤ ∫⁻ x, φ x ∂μ + ε * μ { x | φ x + ε ≤ g x } := by
gcongr
exact fun x => (add_le_add_right (hφ_le _) _).trans
_ = ∫⁻ x, φ x + indicator { x | φ x + ε ≤ g x } (fun _ => ε) x ∂μ := by
rw [lintegral_add_left hφm, lintegral_indicator₀, setLIntegral_const]
exact measurableSet_le (hφm.nullMeasurable.measurable'.add_const _) hg.nullMeasurable
_ ≤ ∫⁻ x, g x ∂μ := lintegral_mono_ae (hle.mono fun x hx₁ => ?_)
simp only [indicator_apply]; split_ifs with hx₂
exacts [hx₂, (add_zero _).trans_le <| (hφ_le x).trans hx₁]
/-- **Markov's inequality** also known as **Chebyshev's first inequality**. -/
theorem mul_meas_ge_le_lintegral₀ {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) (ε : ℝ≥0∞) :
ε * μ { x | ε ≤ f x } ≤ ∫⁻ a, f a ∂μ := by
simpa only [lintegral_zero, zero_add] using
lintegral_add_mul_meas_add_le_le_lintegral (ae_of_all _ fun x => zero_le (f x)) hf ε
/-- **Markov's inequality** also known as **Chebyshev's first inequality**. For a version assuming
`AEMeasurable`, see `mul_meas_ge_le_lintegral₀`. -/
theorem mul_meas_ge_le_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) (ε : ℝ≥0∞) :
ε * μ { x | ε ≤ f x } ≤ ∫⁻ a, f a ∂μ :=
mul_meas_ge_le_lintegral₀ hf.aemeasurable ε
lemma meas_le_lintegral₀ {f : α → ℝ≥0∞} (hf : AEMeasurable f μ)
{s : Set α} (hs : ∀ x ∈ s, 1 ≤ f x) : μ s ≤ ∫⁻ a, f a ∂μ := by
apply le_trans _ (mul_meas_ge_le_lintegral₀ hf 1)
rw [one_mul]
exact measure_mono hs
lemma lintegral_le_meas {s : Set α} {f : α → ℝ≥0∞} (hf : ∀ a, f a ≤ 1) (h'f : ∀ a ∈ sᶜ, f a = 0) :
∫⁻ a, f a ∂μ ≤ μ s := by
apply (lintegral_mono (fun x ↦ ?_)).trans (lintegral_indicator_one_le s)
by_cases hx : x ∈ s
· simpa [hx] using hf x
· simpa [hx] using h'f x hx
theorem lintegral_eq_top_of_measure_eq_top_ne_zero {f : α → ℝ≥0∞} (hf : AEMeasurable f μ)
(hμf : μ {x | f x = ∞} ≠ 0) : ∫⁻ x, f x ∂μ = ∞ :=
eq_top_iff.mpr <|
calc
∞ = ∞ * μ { x | ∞ ≤ f x } := by simp [mul_eq_top, hμf]
_ ≤ ∫⁻ x, f x ∂μ := mul_meas_ge_le_lintegral₀ hf ∞
theorem setLintegral_eq_top_of_measure_eq_top_ne_zero {f : α → ℝ≥0∞} {s : Set α}
(hf : AEMeasurable f (μ.restrict s)) (hμf : μ ({x ∈ s | f x = ∞}) ≠ 0) :
∫⁻ x in s, f x ∂μ = ∞ :=
lintegral_eq_top_of_measure_eq_top_ne_zero hf <|
mt (eq_bot_mono <| by rw [← setOf_inter_eq_sep]; exact Measure.le_restrict_apply _ _) hμf
theorem measure_eq_top_of_lintegral_ne_top {f : α → ℝ≥0∞}
(hf : AEMeasurable f μ) (hμf : ∫⁻ x, f x ∂μ ≠ ∞) : μ {x | f x = ∞} = 0 :=
of_not_not fun h => hμf <| lintegral_eq_top_of_measure_eq_top_ne_zero hf h
theorem measure_eq_top_of_setLintegral_ne_top {f : α → ℝ≥0∞} {s : Set α}
(hf : AEMeasurable f (μ.restrict s)) (hμf : ∫⁻ x in s, f x ∂μ ≠ ∞) :
μ ({x ∈ s | f x = ∞}) = 0 :=
of_not_not fun h => hμf <| setLintegral_eq_top_of_measure_eq_top_ne_zero hf h
/-- **Markov's inequality**, also known as **Chebyshev's first inequality**. -/
theorem meas_ge_le_lintegral_div {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) {ε : ℝ≥0∞} (hε : ε ≠ 0)
(hε' : ε ≠ ∞) : μ { x | ε ≤ f x } ≤ (∫⁻ a, f a ∂μ) / ε :=
(ENNReal.le_div_iff_mul_le (Or.inl hε) (Or.inl hε')).2 <| by
rw [mul_comm]
exact mul_meas_ge_le_lintegral₀ hf ε
theorem ae_eq_of_ae_le_of_lintegral_le {f g : α → ℝ≥0∞} (hfg : f ≤ᵐ[μ] g) (hf : ∫⁻ x, f x ∂μ ≠ ∞)
(hg : AEMeasurable g μ) (hgf : ∫⁻ x, g x ∂μ ≤ ∫⁻ x, f x ∂μ) : f =ᵐ[μ] g := by
have : ∀ n : ℕ, ∀ᵐ x ∂μ, g x < f x + (n : ℝ≥0∞)⁻¹ := by
intro n
simp only [ae_iff, not_lt]
have : ∫⁻ x, f x ∂μ + (↑n)⁻¹ * μ { x : α | f x + (n : ℝ≥0∞)⁻¹ ≤ g x } ≤ ∫⁻ x, f x ∂μ :=
(lintegral_add_mul_meas_add_le_le_lintegral hfg hg n⁻¹).trans hgf
rw [(ENNReal.cancel_of_ne hf).add_le_iff_nonpos_right, nonpos_iff_eq_zero, mul_eq_zero] at this
exact this.resolve_left (ENNReal.inv_ne_zero.2 (ENNReal.natCast_ne_top _))
refine hfg.mp ((ae_all_iff.2 this).mono fun x hlt hle => hle.antisymm ?_)
suffices Tendsto (fun n : ℕ => f x + (n : ℝ≥0∞)⁻¹) atTop (𝓝 (f x)) from
ge_of_tendsto' this fun i => (hlt i).le
simpa only [inv_top, add_zero] using
tendsto_const_nhds.add (ENNReal.tendsto_inv_iff.2 ENNReal.tendsto_nat_nhds_top)
@[simp]
theorem lintegral_eq_zero_iff' {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) :
∫⁻ a, f a ∂μ = 0 ↔ f =ᵐ[μ] 0 :=
have : ∫⁻ _ : α, 0 ∂μ ≠ ∞ := by simp [lintegral_zero, zero_ne_top]
⟨fun h =>
(ae_eq_of_ae_le_of_lintegral_le (ae_of_all _ <| zero_le f) this hf
(h.trans lintegral_zero.symm).le).symm,
fun h => (lintegral_congr_ae h).trans lintegral_zero⟩
@[simp]
theorem lintegral_eq_zero_iff {f : α → ℝ≥0∞} (hf : Measurable f) : ∫⁻ a, f a ∂μ = 0 ↔ f =ᵐ[μ] 0 :=
lintegral_eq_zero_iff' hf.aemeasurable
theorem lintegral_pos_iff_support {f : α → ℝ≥0∞} (hf : Measurable f) :
(0 < ∫⁻ a, f a ∂μ) ↔ 0 < μ (Function.support f) := by
simp [pos_iff_ne_zero, hf, Filter.EventuallyEq, ae_iff, Function.support]
theorem setLintegral_pos_iff {f : α → ℝ≥0∞} (hf : Measurable f) {s : Set α} :
0 < ∫⁻ a in s, f a ∂μ ↔ 0 < μ (Function.support f ∩ s) := by
rw [lintegral_pos_iff_support hf, Measure.restrict_apply (measurableSet_support hf)]
/-- Weaker version of the monotone convergence theorem-/
theorem lintegral_iSup_ae {f : ℕ → α → ℝ≥0∞} (hf : ∀ n, Measurable (f n))
(h_mono : ∀ n, ∀ᵐ a ∂μ, f n a ≤ f n.succ a) : ∫⁻ a, ⨆ n, f n a ∂μ = ⨆ n, ∫⁻ a, f n a ∂μ := by
classical
let ⟨s, hs⟩ := exists_measurable_superset_of_null (ae_iff.1 (ae_all_iff.2 h_mono))
let g n a := if a ∈ s then 0 else f n a
have g_eq_f : ∀ᵐ a ∂μ, ∀ n, g n a = f n a :=
(measure_zero_iff_ae_nmem.1 hs.2.2).mono fun a ha n => if_neg ha
calc
∫⁻ a, ⨆ n, f n a ∂μ = ∫⁻ a, ⨆ n, g n a ∂μ :=
lintegral_congr_ae <| g_eq_f.mono fun a ha => by simp only [ha]
_ = ⨆ n, ∫⁻ a, g n a ∂μ :=
(lintegral_iSup (fun n => measurable_const.piecewise hs.2.1 (hf n))
(monotone_nat_of_le_succ fun n a => ?_))
_ = ⨆ n, ∫⁻ a, f n a ∂μ := by simp only [lintegral_congr_ae (g_eq_f.mono fun _a ha => ha _)]
simp only [g]
split_ifs with h
· rfl
· have := Set.not_mem_subset hs.1 h
simp only [not_forall, not_le, mem_setOf_eq, not_exists, not_lt] at this
exact this n
theorem lintegral_sub' {f g : α → ℝ≥0∞} (hg : AEMeasurable g μ) (hg_fin : ∫⁻ a, g a ∂μ ≠ ∞)
(h_le : g ≤ᵐ[μ] f) : ∫⁻ a, f a - g a ∂μ = ∫⁻ a, f a ∂μ - ∫⁻ a, g a ∂μ := by
refine ENNReal.eq_sub_of_add_eq hg_fin ?_
rw [← lintegral_add_right' _ hg]
exact lintegral_congr_ae (h_le.mono fun x hx => tsub_add_cancel_of_le hx)
theorem lintegral_sub {f g : α → ℝ≥0∞} (hg : Measurable g) (hg_fin : ∫⁻ a, g a ∂μ ≠ ∞)
(h_le : g ≤ᵐ[μ] f) : ∫⁻ a, f a - g a ∂μ = ∫⁻ a, f a ∂μ - ∫⁻ a, g a ∂μ :=
lintegral_sub' hg.aemeasurable hg_fin h_le
theorem lintegral_sub_le' (f g : α → ℝ≥0∞) (hf : AEMeasurable f μ) :
∫⁻ x, g x ∂μ - ∫⁻ x, f x ∂μ ≤ ∫⁻ x, g x - f x ∂μ := by
rw [tsub_le_iff_right]
by_cases hfi : ∫⁻ x, f x ∂μ = ∞
· rw [hfi, add_top]
exact le_top
· rw [← lintegral_add_right' _ hf]
gcongr
exact le_tsub_add
theorem lintegral_sub_le (f g : α → ℝ≥0∞) (hf : Measurable f) :
∫⁻ x, g x ∂μ - ∫⁻ x, f x ∂μ ≤ ∫⁻ x, g x - f x ∂μ :=
lintegral_sub_le' f g hf.aemeasurable
theorem lintegral_strict_mono_of_ae_le_of_frequently_ae_lt {f g : α → ℝ≥0∞} (hg : AEMeasurable g μ)
(hfi : ∫⁻ x, f x ∂μ ≠ ∞) (h_le : f ≤ᵐ[μ] g) (h : ∃ᵐ x ∂μ, f x ≠ g x) :
∫⁻ x, f x ∂μ < ∫⁻ x, g x ∂μ := by
contrapose! h
simp only [not_frequently, Ne, Classical.not_not]
exact ae_eq_of_ae_le_of_lintegral_le h_le hfi hg h
theorem lintegral_strict_mono_of_ae_le_of_ae_lt_on {f g : α → ℝ≥0∞} (hg : AEMeasurable g μ)
(hfi : ∫⁻ x, f x ∂μ ≠ ∞) (h_le : f ≤ᵐ[μ] g) {s : Set α} (hμs : μ s ≠ 0)
(h : ∀ᵐ x ∂μ, x ∈ s → f x < g x) : ∫⁻ x, f x ∂μ < ∫⁻ x, g x ∂μ :=
lintegral_strict_mono_of_ae_le_of_frequently_ae_lt hg hfi h_le <|
((frequently_ae_mem_iff.2 hμs).and_eventually h).mono fun _x hx => (hx.2 hx.1).ne
theorem lintegral_strict_mono {f g : α → ℝ≥0∞} (hμ : μ ≠ 0) (hg : AEMeasurable g μ)
(hfi : ∫⁻ x, f x ∂μ ≠ ∞) (h : ∀ᵐ x ∂μ, f x < g x) : ∫⁻ x, f x ∂μ < ∫⁻ x, g x ∂μ := by
rw [Ne, ← Measure.measure_univ_eq_zero] at hμ
refine lintegral_strict_mono_of_ae_le_of_ae_lt_on hg hfi (ae_le_of_ae_lt h) hμ ?_
simpa using h
theorem setLIntegral_strict_mono {f g : α → ℝ≥0∞} {s : Set α} (hsm : MeasurableSet s)
(hs : μ s ≠ 0) (hg : Measurable g) (hfi : ∫⁻ x in s, f x ∂μ ≠ ∞)
(h : ∀ᵐ x ∂μ, x ∈ s → f x < g x) : ∫⁻ x in s, f x ∂μ < ∫⁻ x in s, g x ∂μ :=
lintegral_strict_mono (by simp [hs]) hg.aemeasurable hfi ((ae_restrict_iff' hsm).mpr h)
@[deprecated (since := "2024-06-29")]
alias set_lintegral_strict_mono := setLIntegral_strict_mono
/-- Monotone convergence theorem for nonincreasing sequences of functions -/
theorem lintegral_iInf_ae {f : ℕ → α → ℝ≥0∞} (h_meas : ∀ n, Measurable (f n))
(h_mono : ∀ n : ℕ, f n.succ ≤ᵐ[μ] f n) (h_fin : ∫⁻ a, f 0 a ∂μ ≠ ∞) :
∫⁻ a, ⨅ n, f n a ∂μ = ⨅ n, ∫⁻ a, f n a ∂μ :=
have fn_le_f0 : ∫⁻ a, ⨅ n, f n a ∂μ ≤ ∫⁻ a, f 0 a ∂μ :=
lintegral_mono fun a => iInf_le_of_le 0 le_rfl
have fn_le_f0' : ⨅ n, ∫⁻ a, f n a ∂μ ≤ ∫⁻ a, f 0 a ∂μ := iInf_le_of_le 0 le_rfl
(ENNReal.sub_right_inj h_fin fn_le_f0 fn_le_f0').1 <|
show ∫⁻ a, f 0 a ∂μ - ∫⁻ a, ⨅ n, f n a ∂μ = ∫⁻ a, f 0 a ∂μ - ⨅ n, ∫⁻ a, f n a ∂μ from
calc
∫⁻ a, f 0 a ∂μ - ∫⁻ a, ⨅ n, f n a ∂μ = ∫⁻ a, f 0 a - ⨅ n, f n a ∂μ :=
(lintegral_sub (measurable_iInf h_meas)
(ne_top_of_le_ne_top h_fin <| lintegral_mono fun a => iInf_le _ _)
(ae_of_all _ fun a => iInf_le _ _)).symm
_ = ∫⁻ a, ⨆ n, f 0 a - f n a ∂μ := congr rfl (funext fun a => ENNReal.sub_iInf)
_ = ⨆ n, ∫⁻ a, f 0 a - f n a ∂μ :=
(lintegral_iSup_ae (fun n => (h_meas 0).sub (h_meas n)) fun n =>
(h_mono n).mono fun a ha => tsub_le_tsub le_rfl ha)
_ = ⨆ n, ∫⁻ a, f 0 a ∂μ - ∫⁻ a, f n a ∂μ :=
(have h_mono : ∀ᵐ a ∂μ, ∀ n : ℕ, f n.succ a ≤ f n a := ae_all_iff.2 h_mono
have h_mono : ∀ n, ∀ᵐ a ∂μ, f n a ≤ f 0 a := fun n =>
h_mono.mono fun a h => by
induction' n with n ih
· exact le_rfl
· exact le_trans (h n) ih
congr_arg iSup <|
funext fun n =>
lintegral_sub (h_meas _) (ne_top_of_le_ne_top h_fin <| lintegral_mono_ae <| h_mono n)
(h_mono n))
_ = ∫⁻ a, f 0 a ∂μ - ⨅ n, ∫⁻ a, f n a ∂μ := ENNReal.sub_iInf.symm
/-- Monotone convergence theorem for nonincreasing sequences of functions -/
theorem lintegral_iInf {f : ℕ → α → ℝ≥0∞} (h_meas : ∀ n, Measurable (f n)) (h_anti : Antitone f)
(h_fin : ∫⁻ a, f 0 a ∂μ ≠ ∞) : ∫⁻ a, ⨅ n, f n a ∂μ = ⨅ n, ∫⁻ a, f n a ∂μ :=
lintegral_iInf_ae h_meas (fun n => ae_of_all _ <| h_anti n.le_succ) h_fin
theorem lintegral_iInf' {f : ℕ → α → ℝ≥0∞} (h_meas : ∀ n, AEMeasurable (f n) μ)
(h_anti : ∀ᵐ a ∂μ, Antitone (fun i ↦ f i a)) (h_fin : ∫⁻ a, f 0 a ∂μ ≠ ∞) :
∫⁻ a, ⨅ n, f n a ∂μ = ⨅ n, ∫⁻ a, f n a ∂μ := by
simp_rw [← iInf_apply]
let p : α → (ℕ → ℝ≥0∞) → Prop := fun _ f' => Antitone f'
have hp : ∀ᵐ x ∂μ, p x fun i => f i x := h_anti
have h_ae_seq_mono : Antitone (aeSeq h_meas p) := by
intro n m hnm x
by_cases hx : x ∈ aeSeqSet h_meas p
· exact aeSeq.prop_of_mem_aeSeqSet h_meas hx hnm
· simp only [aeSeq, hx, if_false]
exact le_rfl
rw [lintegral_congr_ae (aeSeq.iInf h_meas hp).symm]
simp_rw [iInf_apply]
rw [lintegral_iInf (aeSeq.measurable h_meas p) h_ae_seq_mono]
· congr
exact funext fun n ↦ lintegral_congr_ae (aeSeq.aeSeq_n_eq_fun_n_ae h_meas hp n)
· rwa [lintegral_congr_ae (aeSeq.aeSeq_n_eq_fun_n_ae h_meas hp 0)]
/-- Monotone convergence for an infimum over a directed family and indexed by a countable type -/
theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Countable β]
{f : β → α → ℝ≥0∞} {μ : Measure α} (hμ : μ ≠ 0) (hf : ∀ b, Measurable (f b))
(hf_int : ∀ b, ∫⁻ a, f b a ∂μ ≠ ∞) (h_directed : Directed (· ≥ ·) f) :
∫⁻ a, ⨅ b, f b a ∂μ = ⨅ b, ∫⁻ a, f b a ∂μ := by
cases nonempty_encodable β
cases isEmpty_or_nonempty β
· simp only [iInf_of_empty, lintegral_const,
ENNReal.top_mul (Measure.measure_univ_ne_zero.mpr hμ)]
inhabit β
have : ∀ a, ⨅ b, f b a = ⨅ n, f (h_directed.sequence f n) a := by
refine fun a =>
le_antisymm (le_iInf fun n => iInf_le _ _)
(le_iInf fun b => iInf_le_of_le (Encodable.encode b + 1) ?_)
exact h_directed.sequence_le b a
-- Porting note: used `∘` below to deal with its reduced reducibility
calc
∫⁻ a, ⨅ b, f b a ∂μ
_ = ∫⁻ a, ⨅ n, (f ∘ h_directed.sequence f) n a ∂μ := by simp only [this, Function.comp_apply]
_ = ⨅ n, ∫⁻ a, (f ∘ h_directed.sequence f) n a ∂μ := by
rw [lintegral_iInf ?_ h_directed.sequence_anti]
· exact hf_int _
· exact fun n => hf _
_ = ⨅ b, ∫⁻ a, f b a ∂μ := by
refine le_antisymm (le_iInf fun b => ?_) (le_iInf fun n => ?_)
· exact iInf_le_of_le (Encodable.encode b + 1) (lintegral_mono <| h_directed.sequence_le b)
· exact iInf_le (fun b => ∫⁻ a, f b a ∂μ) _
/-- Known as Fatou's lemma, version with `AEMeasurable` functions -/
theorem lintegral_liminf_le' {f : ℕ → α → ℝ≥0∞} (h_meas : ∀ n, AEMeasurable (f n) μ) :
∫⁻ a, liminf (fun n => f n a) atTop ∂μ ≤ liminf (fun n => ∫⁻ a, f n a ∂μ) atTop :=
calc
∫⁻ a, liminf (fun n => f n a) atTop ∂μ = ∫⁻ a, ⨆ n : ℕ, ⨅ i ≥ n, f i a ∂μ := by
simp only [liminf_eq_iSup_iInf_of_nat]
_ = ⨆ n : ℕ, ∫⁻ a, ⨅ i ≥ n, f i a ∂μ :=
(lintegral_iSup' (fun n => aemeasurable_biInf _ (to_countable _) (fun i _ ↦ h_meas i))
(ae_of_all μ fun a n m hnm => iInf_le_iInf_of_subset fun i hi => le_trans hnm hi))
_ ≤ ⨆ n : ℕ, ⨅ i ≥ n, ∫⁻ a, f i a ∂μ := iSup_mono fun n => le_iInf₂_lintegral _
_ = atTop.liminf fun n => ∫⁻ a, f n a ∂μ := Filter.liminf_eq_iSup_iInf_of_nat.symm
/-- Known as Fatou's lemma -/
theorem lintegral_liminf_le {f : ℕ → α → ℝ≥0∞} (h_meas : ∀ n, Measurable (f n)) :
∫⁻ a, liminf (fun n => f n a) atTop ∂μ ≤ liminf (fun n => ∫⁻ a, f n a ∂μ) atTop :=
lintegral_liminf_le' fun n => (h_meas n).aemeasurable
theorem limsup_lintegral_le {f : ℕ → α → ℝ≥0∞} (g : α → ℝ≥0∞) (hf_meas : ∀ n, Measurable (f n))
(h_bound : ∀ n, f n ≤ᵐ[μ] g) (h_fin : ∫⁻ a, g a ∂μ ≠ ∞) :
limsup (fun n => ∫⁻ a, f n a ∂μ) atTop ≤ ∫⁻ a, limsup (fun n => f n a) atTop ∂μ :=
calc
limsup (fun n => ∫⁻ a, f n a ∂μ) atTop = ⨅ n : ℕ, ⨆ i ≥ n, ∫⁻ a, f i a ∂μ :=
limsup_eq_iInf_iSup_of_nat
_ ≤ ⨅ n : ℕ, ∫⁻ a, ⨆ i ≥ n, f i a ∂μ := iInf_mono fun n => iSup₂_lintegral_le _
_ = ∫⁻ a, ⨅ n : ℕ, ⨆ i ≥ n, f i a ∂μ := by
refine (lintegral_iInf ?_ ?_ ?_).symm
· intro n
exact measurable_biSup _ (to_countable _) (fun i _ ↦ hf_meas i)
· intro n m hnm a
exact iSup_le_iSup_of_subset fun i hi => le_trans hnm hi
· refine ne_top_of_le_ne_top h_fin (lintegral_mono_ae ?_)
refine (ae_all_iff.2 h_bound).mono fun n hn => ?_
exact iSup_le fun i => iSup_le fun _ => hn i
_ = ∫⁻ a, limsup (fun n => f n a) atTop ∂μ := by simp only [limsup_eq_iInf_iSup_of_nat]
/-- Dominated convergence theorem for nonnegative functions -/
theorem tendsto_lintegral_of_dominated_convergence {F : ℕ → α → ℝ≥0∞} {f : α → ℝ≥0∞}
(bound : α → ℝ≥0∞) (hF_meas : ∀ n, Measurable (F n)) (h_bound : ∀ n, F n ≤ᵐ[μ] bound)
(h_fin : ∫⁻ 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 ∂μ)) :=
tendsto_of_le_liminf_of_limsup_le
(calc
∫⁻ a, f a ∂μ = ∫⁻ a, liminf (fun n : ℕ => F n a) atTop ∂μ :=
lintegral_congr_ae <| h_lim.mono fun a h => h.liminf_eq.symm
_ ≤ liminf (fun n => ∫⁻ a, F n a ∂μ) atTop := lintegral_liminf_le hF_meas
)
(calc
limsup (fun n : ℕ => ∫⁻ a, F n a ∂μ) atTop ≤ ∫⁻ a, limsup (fun n => F n a) atTop ∂μ :=
limsup_lintegral_le _ hF_meas h_bound h_fin
_ = ∫⁻ a, f a ∂μ := lintegral_congr_ae <| h_lim.mono fun a h => h.limsup_eq
)
/-- Dominated convergence theorem for nonnegative functions which are just almost everywhere
measurable. -/
theorem tendsto_lintegral_of_dominated_convergence' {F : ℕ → α → ℝ≥0∞} {f : α → ℝ≥0∞}
(bound : α → ℝ≥0∞) (hF_meas : ∀ n, AEMeasurable (F n) μ) (h_bound : ∀ n, F n ≤ᵐ[μ] bound)
(h_fin : ∫⁻ 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
have : ∀ n, ∫⁻ a, F n a ∂μ = ∫⁻ a, (hF_meas n).mk (F n) a ∂μ := fun n =>
lintegral_congr_ae (hF_meas n).ae_eq_mk
simp_rw [this]
apply
tendsto_lintegral_of_dominated_convergence bound (fun n => (hF_meas n).measurable_mk) _ h_fin
· have : ∀ n, ∀ᵐ a ∂μ, (hF_meas n).mk (F n) a = F n a := fun n => (hF_meas n).ae_eq_mk.symm
have : ∀ᵐ a ∂μ, ∀ n, (hF_meas n).mk (F n) a = F n a := ae_all_iff.mpr this
filter_upwards [this, h_lim] with a H H'
simp_rw [H]
exact H'
· intro n
filter_upwards [h_bound n, (hF_meas n).ae_eq_mk] with a H H'
rwa [H'] at H
/-- Dominated convergence theorem for filters with a countable basis -/
theorem tendsto_lintegral_filter_of_dominated_convergence {ι} {l : Filter ι}
[l.IsCountablyGenerated] {F : ι → α → ℝ≥0∞} {f : α → ℝ≥0∞} (bound : α → ℝ≥0∞)
(hF_meas : ∀ᶠ n in l, Measurable (F n)) (h_bound : ∀ᶠ n in l, ∀ᵐ a ∂μ, F n a ≤ bound a)
(h_fin : ∫⁻ a, bound a ∂μ ≠ ∞) (h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) l (𝓝 (f a))) :
Tendsto (fun n => ∫⁻ a, F n a ∂μ) l (𝓝 <| ∫⁻ a, f a ∂μ) := by
rw [tendsto_iff_seq_tendsto]
intro x xl
have hxl := by
rw [tendsto_atTop'] at xl
exact xl
have h := inter_mem hF_meas h_bound
replace h := hxl _ h
rcases h with ⟨k, h⟩
rw [← tendsto_add_atTop_iff_nat k]
refine tendsto_lintegral_of_dominated_convergence ?_ ?_ ?_ ?_ ?_
· exact bound
· intro
refine (h _ ?_).1
exact Nat.le_add_left _ _
· intro
refine (h _ ?_).2
exact Nat.le_add_left _ _
· assumption
· refine h_lim.mono fun a h_lim => ?_
apply @Tendsto.comp _ _ _ (fun n => x (n + k)) fun n => F n a
· assumption
rw [tendsto_add_atTop_iff_nat]
assumption
theorem lintegral_tendsto_of_tendsto_of_antitone {f : ℕ → α → ℝ≥0∞} {F : α → ℝ≥0∞}
(hf : ∀ n, AEMeasurable (f n) μ) (h_anti : ∀ᵐ x ∂μ, Antitone fun n ↦ f n x)
(h0 : ∫⁻ a, f 0 a ∂μ ≠ ∞)
(h_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) :
Tendsto (fun n ↦ ∫⁻ x, f n x ∂μ) atTop (𝓝 (∫⁻ x, F x ∂μ)) := by
have : Antitone fun n ↦ ∫⁻ x, f n x ∂μ := fun i j hij ↦
lintegral_mono_ae (h_anti.mono fun x hx ↦ hx hij)
suffices key : ∫⁻ x, F x ∂μ = ⨅ n, ∫⁻ x, f n x ∂μ by
rw [key]
exact tendsto_atTop_iInf this
rw [← lintegral_iInf' hf h_anti h0]
refine lintegral_congr_ae ?_
filter_upwards [h_anti, h_tendsto] with _ hx_anti hx_tendsto
using tendsto_nhds_unique hx_tendsto (tendsto_atTop_iInf hx_anti)
section
open Encodable
/-- Monotone convergence for a supremum over a directed family and indexed by a countable type -/
theorem lintegral_iSup_directed_of_measurable [Countable β] {f : β → α → ℝ≥0∞}
(hf : ∀ b, Measurable (f b)) (h_directed : Directed (· ≤ ·) f) :
∫⁻ a, ⨆ b, f b a ∂μ = ⨆ b, ∫⁻ a, f b a ∂μ := by
cases nonempty_encodable β
cases isEmpty_or_nonempty β
· simp [iSup_of_empty]
inhabit β
have : ∀ a, ⨆ b, f b a = ⨆ n, f (h_directed.sequence f n) a := by
intro a
refine le_antisymm (iSup_le fun b => ?_) (iSup_le fun n => le_iSup (fun n => f n a) _)
exact le_iSup_of_le (encode b + 1) (h_directed.le_sequence b a)
calc
∫⁻ a, ⨆ b, f b a ∂μ = ∫⁻ a, ⨆ n, f (h_directed.sequence f n) a ∂μ := by simp only [this]
_ = ⨆ n, ∫⁻ a, f (h_directed.sequence f n) a ∂μ :=
(lintegral_iSup (fun n => hf _) h_directed.sequence_mono)
_ = ⨆ b, ∫⁻ a, f b a ∂μ := by
refine le_antisymm (iSup_le fun n => ?_) (iSup_le fun b => ?_)
· exact le_iSup (fun b => ∫⁻ a, f b a ∂μ) _
· exact le_iSup_of_le (encode b + 1) (lintegral_mono <| h_directed.le_sequence b)
/-- Monotone convergence for a supremum over a directed family and indexed by a countable type. -/
theorem lintegral_iSup_directed [Countable β] {f : β → α → ℝ≥0∞} (hf : ∀ b, AEMeasurable (f b) μ)
(h_directed : Directed (· ≤ ·) f) : ∫⁻ a, ⨆ b, f b a ∂μ = ⨆ b, ∫⁻ a, f b a ∂μ := by
simp_rw [← iSup_apply]
let p : α → (β → ENNReal) → Prop := fun x f' => Directed LE.le f'
have hp : ∀ᵐ x ∂μ, p x fun i => f i x := by
filter_upwards [] with x i j
obtain ⟨z, hz₁, hz₂⟩ := h_directed i j
exact ⟨z, hz₁ x, hz₂ x⟩
have h_ae_seq_directed : Directed LE.le (aeSeq hf p) := by
intro b₁ b₂
obtain ⟨z, hz₁, hz₂⟩ := h_directed b₁ b₂
refine ⟨z, ?_, ?_⟩ <;>
· intro x
by_cases hx : x ∈ aeSeqSet hf p
· repeat rw [aeSeq.aeSeq_eq_fun_of_mem_aeSeqSet hf hx]
apply_rules [hz₁, hz₂]
· simp only [aeSeq, hx, if_false]
exact le_rfl
convert lintegral_iSup_directed_of_measurable (aeSeq.measurable hf p) h_ae_seq_directed using 1
· simp_rw [← iSup_apply]
rw [lintegral_congr_ae (aeSeq.iSup hf hp).symm]
· congr 1
ext1 b
rw [lintegral_congr_ae]
apply EventuallyEq.symm
exact aeSeq.aeSeq_n_eq_fun_n_ae hf hp _
end
theorem lintegral_tsum [Countable β] {f : β → α → ℝ≥0∞} (hf : ∀ i, AEMeasurable (f i) μ) :
∫⁻ a, ∑' i, f i a ∂μ = ∑' i, ∫⁻ a, f i a ∂μ := by
classical
simp only [ENNReal.tsum_eq_iSup_sum]
rw [lintegral_iSup_directed]
· simp [lintegral_finset_sum' _ fun i _ => hf i]
· intro b
exact Finset.aemeasurable_sum _ fun i _ => hf i
· intro s t
use s ∪ t
constructor
· exact fun a => Finset.sum_le_sum_of_subset Finset.subset_union_left
· exact fun a => Finset.sum_le_sum_of_subset Finset.subset_union_right
open Measure
theorem lintegral_iUnion₀ [Countable β] {s : β → Set α} (hm : ∀ i, NullMeasurableSet (s i) μ)
(hd : Pairwise (AEDisjoint μ on s)) (f : α → ℝ≥0∞) :
∫⁻ a in ⋃ i, s i, f a ∂μ = ∑' i, ∫⁻ a in s i, f a ∂μ := by
simp only [Measure.restrict_iUnion_ae hd hm, lintegral_sum_measure]
theorem lintegral_iUnion [Countable β] {s : β → Set α} (hm : ∀ i, MeasurableSet (s i))
(hd : Pairwise (Disjoint on s)) (f : α → ℝ≥0∞) :
∫⁻ a in ⋃ i, s i, f a ∂μ = ∑' i, ∫⁻ a in s i, f a ∂μ :=
lintegral_iUnion₀ (fun i => (hm i).nullMeasurableSet) hd.aedisjoint f
theorem lintegral_biUnion₀ {t : Set β} {s : β → Set α} (ht : t.Countable)
(hm : ∀ i ∈ t, NullMeasurableSet (s i) μ) (hd : t.Pairwise (AEDisjoint μ on s)) (f : α → ℝ≥0∞) :
∫⁻ a in ⋃ i ∈ t, s i, f a ∂μ = ∑' i : t, ∫⁻ a in s i, f a ∂μ := by
haveI := ht.toEncodable
rw [biUnion_eq_iUnion, lintegral_iUnion₀ (SetCoe.forall'.1 hm) (hd.subtype _ _)]
theorem lintegral_biUnion {t : Set β} {s : β → Set α} (ht : t.Countable)
(hm : ∀ i ∈ t, MeasurableSet (s i)) (hd : t.PairwiseDisjoint s) (f : α → ℝ≥0∞) :
∫⁻ a in ⋃ i ∈ t, s i, f a ∂μ = ∑' i : t, ∫⁻ a in s i, f a ∂μ :=
lintegral_biUnion₀ ht (fun i hi => (hm i hi).nullMeasurableSet) hd.aedisjoint f
theorem lintegral_biUnion_finset₀ {s : Finset β} {t : β → Set α}
(hd : Set.Pairwise (↑s) (AEDisjoint μ on t)) (hm : ∀ b ∈ s, NullMeasurableSet (t b) μ)
(f : α → ℝ≥0∞) : ∫⁻ a in ⋃ b ∈ s, t b, f a ∂μ = ∑ b ∈ s, ∫⁻ a in t b, f a ∂μ := by
simp only [← Finset.mem_coe, lintegral_biUnion₀ s.countable_toSet hm hd, ← Finset.tsum_subtype']
theorem lintegral_biUnion_finset {s : Finset β} {t : β → Set α} (hd : Set.PairwiseDisjoint (↑s) t)
(hm : ∀ b ∈ s, MeasurableSet (t b)) (f : α → ℝ≥0∞) :
∫⁻ a in ⋃ b ∈ s, t b, f a ∂μ = ∑ b ∈ s, ∫⁻ a in t b, f a ∂μ :=
lintegral_biUnion_finset₀ hd.aedisjoint (fun b hb => (hm b hb).nullMeasurableSet) f
theorem lintegral_iUnion_le [Countable β] (s : β → Set α) (f : α → ℝ≥0∞) :
∫⁻ a in ⋃ i, s i, f a ∂μ ≤ ∑' i, ∫⁻ a in s i, f a ∂μ := by
rw [← lintegral_sum_measure]
exact lintegral_mono' restrict_iUnion_le le_rfl
theorem lintegral_union {f : α → ℝ≥0∞} {A B : Set α} (hB : MeasurableSet B) (hAB : Disjoint A B) :
∫⁻ a in A ∪ B, f a ∂μ = ∫⁻ a in A, f a ∂μ + ∫⁻ a in B, f a ∂μ := by
rw [restrict_union hAB hB, lintegral_add_measure]
theorem lintegral_union_le (f : α → ℝ≥0∞) (s t : Set α) :
∫⁻ a in s ∪ t, f a ∂μ ≤ ∫⁻ a in s, f a ∂μ + ∫⁻ a in t, f a ∂μ := by
rw [← lintegral_add_measure]
exact lintegral_mono' (restrict_union_le _ _) le_rfl
theorem lintegral_inter_add_diff {B : Set α} (f : α → ℝ≥0∞) (A : Set α) (hB : MeasurableSet B) :
∫⁻ x in A ∩ B, f x ∂μ + ∫⁻ x in A \ B, f x ∂μ = ∫⁻ x in A, f x ∂μ := by
rw [← lintegral_add_measure, restrict_inter_add_diff _ hB]
theorem lintegral_add_compl (f : α → ℝ≥0∞) {A : Set α} (hA : MeasurableSet A) :
∫⁻ x in A, f x ∂μ + ∫⁻ x in Aᶜ, f x ∂μ = ∫⁻ x, f x ∂μ := by
rw [← lintegral_add_measure, Measure.restrict_add_restrict_compl hA]
theorem setLintegral_compl {f : α → ℝ≥0∞} {s : Set α} (hsm : MeasurableSet s)
(hfs : ∫⁻ x in s, f x ∂μ ≠ ∞) :
∫⁻ x in sᶜ, f x ∂μ = ∫⁻ x, f x ∂μ - ∫⁻ x in s, f x ∂μ := by
rw [← lintegral_add_compl (μ := μ) f hsm, ENNReal.add_sub_cancel_left hfs]
theorem setLIntegral_iUnion_of_directed {ι : Type*} [Countable ι]
(f : α → ℝ≥0∞) {s : ι → Set α} (hd : Directed (· ⊆ ·) s) :
∫⁻ x in ⋃ i, s i, f x ∂μ = ⨆ i, ∫⁻ x in s i, f x ∂μ := by
simp only [lintegral_def, iSup_comm (ι := ι),
SimpleFunc.lintegral_restrict_iUnion_of_directed _ hd]
theorem lintegral_max {f g : α → ℝ≥0∞} (hf : Measurable f) (hg : Measurable g) :
∫⁻ x, max (f x) (g x) ∂μ =
∫⁻ x in { x | f x ≤ g x }, g x ∂μ + ∫⁻ x in { x | g x < f x }, f x ∂μ := by
have hm : MeasurableSet { x | f x ≤ g x } := measurableSet_le hf hg
rw [← lintegral_add_compl (fun x => max (f x) (g x)) hm]
simp only [← compl_setOf, ← not_le]
refine congr_arg₂ (· + ·) (setLIntegral_congr_fun hm ?_) (setLIntegral_congr_fun hm.compl ?_)
exacts [ae_of_all _ fun x => max_eq_right (a := f x) (b := g x),
ae_of_all _ fun x (hx : ¬ f x ≤ g x) => max_eq_left (not_le.1 hx).le]
theorem setLIntegral_max {f g : α → ℝ≥0∞} (hf : Measurable f) (hg : Measurable g) (s : Set α) :
∫⁻ x in s, max (f x) (g x) ∂μ =
∫⁻ x in s ∩ { x | f x ≤ g x }, g x ∂μ + ∫⁻ x in s ∩ { x | g x < f x }, f x ∂μ := by
rw [lintegral_max hf hg, restrict_restrict, restrict_restrict, inter_comm s, inter_comm s]
exacts [measurableSet_lt hg hf, measurableSet_le hf hg]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_max := setLIntegral_max
theorem lintegral_map {mβ : MeasurableSpace β} {f : β → ℝ≥0∞} {g : α → β} (hf : Measurable f)
(hg : Measurable g) : ∫⁻ a, f a ∂map g μ = ∫⁻ a, f (g a) ∂μ := by
erw [lintegral_eq_iSup_eapprox_lintegral hf, lintegral_eq_iSup_eapprox_lintegral (hf.comp hg)]
congr with n : 1
convert SimpleFunc.lintegral_map _ hg
ext1 x; simp only [eapprox_comp hf hg, coe_comp]
theorem lintegral_map' {mβ : MeasurableSpace β} {f : β → ℝ≥0∞} {g : α → β}
(hf : AEMeasurable f (Measure.map g μ)) (hg : AEMeasurable g μ) :
∫⁻ a, f a ∂Measure.map g μ = ∫⁻ a, f (g a) ∂μ :=
calc
∫⁻ a, f a ∂Measure.map g μ = ∫⁻ a, hf.mk f a ∂Measure.map g μ :=
lintegral_congr_ae hf.ae_eq_mk
_ = ∫⁻ a, hf.mk f a ∂Measure.map (hg.mk g) μ := by
congr 1
exact Measure.map_congr hg.ae_eq_mk
_ = ∫⁻ a, hf.mk f (hg.mk g a) ∂μ := lintegral_map hf.measurable_mk hg.measurable_mk
_ = ∫⁻ a, hf.mk f (g a) ∂μ := lintegral_congr_ae <| hg.ae_eq_mk.symm.fun_comp _
_ = ∫⁻ a, f (g a) ∂μ := lintegral_congr_ae (ae_eq_comp hg hf.ae_eq_mk.symm)
theorem lintegral_map_le {mβ : MeasurableSpace β} (f : β → ℝ≥0∞) {g : α → β} (hg : Measurable g) :
∫⁻ a, f a ∂Measure.map g μ ≤ ∫⁻ a, f (g a) ∂μ := by
rw [← iSup_lintegral_measurable_le_eq_lintegral, ← iSup_lintegral_measurable_le_eq_lintegral]
refine iSup₂_le fun i hi => iSup_le fun h'i => ?_
refine le_iSup₂_of_le (i ∘ g) (hi.comp hg) ?_
exact le_iSup_of_le (fun x => h'i (g x)) (le_of_eq (lintegral_map hi hg))
theorem lintegral_comp [MeasurableSpace β] {f : β → ℝ≥0∞} {g : α → β} (hf : Measurable f)
(hg : Measurable g) : lintegral μ (f ∘ g) = ∫⁻ a, f a ∂map g μ :=
(lintegral_map hf hg).symm
theorem setLIntegral_map [MeasurableSpace β] {f : β → ℝ≥0∞} {g : α → β} {s : Set β}
(hs : MeasurableSet s) (hf : Measurable f) (hg : Measurable g) :
∫⁻ y in s, f y ∂map g μ = ∫⁻ x in g ⁻¹' s, f (g x) ∂μ := by
rw [restrict_map hg hs, lintegral_map hf hg]
@[deprecated (since := "2024-06-29")]
alias set_lintegral_map := setLIntegral_map
theorem lintegral_indicator_const_comp {mβ : MeasurableSpace β} {f : α → β} {s : Set β}
(hf : Measurable f) (hs : MeasurableSet s) (c : ℝ≥0∞) :
∫⁻ a, s.indicator (fun _ => c) (f a) ∂μ = c * μ (f ⁻¹' s) := by
erw [lintegral_comp (measurable_const.indicator hs) hf, lintegral_indicator_const hs,
Measure.map_apply hf hs]
/-- If `g : α → β` is a measurable embedding and `f : β → ℝ≥0∞` is any function (not necessarily
measurable), then `∫⁻ a, f a ∂(map g μ) = ∫⁻ a, f (g a) ∂μ`. Compare with `lintegral_map` which
applies to any measurable `g : α → β` but requires that `f` is measurable as well. -/
theorem _root_.MeasurableEmbedding.lintegral_map [MeasurableSpace β] {g : α → β}
(hg : MeasurableEmbedding g) (f : β → ℝ≥0∞) : ∫⁻ a, f a ∂map g μ = ∫⁻ a, f (g a) ∂μ := by
rw [lintegral, lintegral]
refine le_antisymm (iSup₂_le fun f₀ hf₀ => ?_) (iSup₂_le fun f₀ hf₀ => ?_)
· rw [SimpleFunc.lintegral_map _ hg.measurable]
have : (f₀.comp g hg.measurable : α → ℝ≥0∞) ≤ f ∘ g := fun x => hf₀ (g x)
exact le_iSup_of_le (comp f₀ g hg.measurable) (by exact le_iSup (α := ℝ≥0∞) _ this)
· rw [← f₀.extend_comp_eq hg (const _ 0), ← SimpleFunc.lintegral_map, ←
SimpleFunc.lintegral_eq_lintegral, ← lintegral]
refine lintegral_mono_ae (hg.ae_map_iff.2 <| eventually_of_forall fun x => ?_)
exact (extend_apply _ _ _ _).trans_le (hf₀ _)
/-- The `lintegral` transforms appropriately under a measurable equivalence `g : α ≃ᵐ β`.
(Compare `lintegral_map`, which applies to a wider class of functions `g : α → β`, but requires
measurability of the function being integrated.) -/
theorem lintegral_map_equiv [MeasurableSpace β] (f : β → ℝ≥0∞) (g : α ≃ᵐ β) :
∫⁻ a, f a ∂map g μ = ∫⁻ a, f (g a) ∂μ :=
g.measurableEmbedding.lintegral_map f
protected theorem MeasurePreserving.lintegral_map_equiv [MeasurableSpace β] {ν : Measure β}
(f : β → ℝ≥0∞) (g : α ≃ᵐ β) (hg : MeasurePreserving g μ ν) :
∫⁻ a, f a ∂ν = ∫⁻ a, f (g a) ∂μ := by
rw [← MeasureTheory.lintegral_map_equiv f g, hg.map_eq]
theorem MeasurePreserving.lintegral_comp {mb : MeasurableSpace β} {ν : Measure β} {g : α → β}
(hg : MeasurePreserving g μ ν) {f : β → ℝ≥0∞} (hf : Measurable f) :
∫⁻ a, f (g a) ∂μ = ∫⁻ b, f b ∂ν := by rw [← hg.map_eq, lintegral_map hf hg.measurable]
theorem MeasurePreserving.lintegral_comp_emb {mb : MeasurableSpace β} {ν : Measure β} {g : α → β}
(hg : MeasurePreserving g μ ν) (hge : MeasurableEmbedding g) (f : β → ℝ≥0∞) :
∫⁻ a, f (g a) ∂μ = ∫⁻ b, f b ∂ν := by rw [← hg.map_eq, hge.lintegral_map]
theorem MeasurePreserving.setLIntegral_comp_preimage {mb : MeasurableSpace β} {ν : Measure β}
{g : α → β} (hg : MeasurePreserving g μ ν) {s : Set β} (hs : MeasurableSet s) {f : β → ℝ≥0∞}
(hf : Measurable f) : ∫⁻ a in g ⁻¹' s, f (g a) ∂μ = ∫⁻ b in s, f b ∂ν := by
rw [← hg.map_eq, setLIntegral_map hs hf hg.measurable]
@[deprecated (since := "2024-06-29")]
alias MeasurePreserving.set_lintegral_comp_preimage := MeasurePreserving.setLIntegral_comp_preimage
theorem MeasurePreserving.setLIntegral_comp_preimage_emb {mb : MeasurableSpace β} {ν : Measure β}
{g : α → β} (hg : MeasurePreserving g μ ν) (hge : MeasurableEmbedding g) (f : β → ℝ≥0∞)
(s : Set β) : ∫⁻ a in g ⁻¹' s, f (g a) ∂μ = ∫⁻ b in s, f b ∂ν := by
rw [← hg.map_eq, hge.restrict_map, hge.lintegral_map]
@[deprecated (since := "2024-06-29")]
alias MeasurePreserving.set_lintegral_comp_preimage_emb :=
MeasurePreserving.setLIntegral_comp_preimage_emb
theorem MeasurePreserving.setLIntegral_comp_emb {mb : MeasurableSpace β} {ν : Measure β}
{g : α → β} (hg : MeasurePreserving g μ ν) (hge : MeasurableEmbedding g) (f : β → ℝ≥0∞)
(s : Set α) : ∫⁻ a in s, f (g a) ∂μ = ∫⁻ b in g '' s, f b ∂ν := by
rw [← hg.setLIntegral_comp_preimage_emb hge, preimage_image_eq _ hge.injective]
@[deprecated (since := "2024-06-29")]
alias MeasurePreserving.set_lintegral_comp_emb := MeasurePreserving.setLIntegral_comp_emb
theorem lintegral_subtype_comap {s : Set α} (hs : MeasurableSet s) (f : α → ℝ≥0∞) :
∫⁻ x : s, f x ∂(μ.comap (↑)) = ∫⁻ x in s, f x ∂μ := by
rw [← (MeasurableEmbedding.subtype_coe hs).lintegral_map, map_comap_subtype_coe hs]
theorem setLIntegral_subtype {s : Set α} (hs : MeasurableSet s) (t : Set s) (f : α → ℝ≥0∞) :
∫⁻ x in t, f x ∂(μ.comap (↑)) = ∫⁻ x in (↑) '' t, f x ∂μ := by
rw [(MeasurableEmbedding.subtype_coe hs).restrict_comap, lintegral_subtype_comap hs,
restrict_restrict hs, inter_eq_right.2 (Subtype.coe_image_subset _ _)]
section UnifTight
/-- If `f : α → ℝ≥0∞` has finite integral, then there exists a measurable set `s` of finite measure
such that the integral of `f` over `sᶜ` is less than a given positive number.
Also used to prove an `Lᵖ`-norm version in
`MeasureTheory.Memℒp.exists_eLpNorm_indicator_compl_le`. -/
theorem exists_setLintegral_compl_lt {f : α → ℝ≥0∞} (hf : ∫⁻ a, f a ∂μ ≠ ∞)
{ε : ℝ≥0∞} (hε : ε ≠ 0) :
∃ s : Set α, MeasurableSet s ∧ μ s < ∞ ∧ ∫⁻ a in sᶜ, f a ∂μ < ε := by
by_cases hf₀ : ∫⁻ a, f a ∂μ = 0
· exact ⟨∅, .empty, by simp, by simpa [hf₀, pos_iff_ne_zero]⟩
obtain ⟨g, hgf, hg_meas, hgsupp, hgε⟩ :
∃ g ≤ f, Measurable g ∧ μ (support g) < ∞ ∧ ∫⁻ a, f a ∂μ - ε < ∫⁻ a, g a ∂μ := by
obtain ⟨g, hgf, hgε⟩ : ∃ (g : α →ₛ ℝ≥0∞) (_ : g ≤ f), ∫⁻ a, f a ∂μ - ε < g.lintegral μ := by
simpa only [← lt_iSup_iff, ← lintegral_def] using ENNReal.sub_lt_self hf hf₀ hε
refine ⟨g, hgf, g.measurable, ?_, by rwa [g.lintegral_eq_lintegral]⟩
exact SimpleFunc.FinMeasSupp.of_lintegral_ne_top <| ne_top_of_le_ne_top hf <|
g.lintegral_eq_lintegral μ ▸ lintegral_mono hgf
refine ⟨_, measurableSet_support hg_meas, hgsupp, ?_⟩
calc
∫⁻ a in (support g)ᶜ, f a ∂μ
= ∫⁻ a in (support g)ᶜ, f a - g a ∂μ := setLIntegral_congr_fun
(measurableSet_support hg_meas).compl <| ae_of_all _ <| by intro; simp_all
_ ≤ ∫⁻ a, f a - g a ∂μ := setLIntegral_le_lintegral _ _
_ = ∫⁻ a, f a ∂μ - ∫⁻ a, g a ∂μ :=
lintegral_sub hg_meas (ne_top_of_le_ne_top hf <| lintegral_mono hgf) (ae_of_all _ hgf)
_ < ε := ENNReal.sub_lt_of_lt_add (lintegral_mono hgf) <|
ENNReal.lt_add_of_sub_lt_left (.inl hf) hgε
/-- For any function `f : α → ℝ≥0∞`, there exists a measurable function `g ≤ f` with the same
integral over any measurable set. -/
theorem exists_measurable_le_setLintegral_eq_of_integrable {f : α → ℝ≥0∞} (hf : ∫⁻ a, f a ∂μ ≠ ∞) :
∃ (g : α → ℝ≥0∞), Measurable g ∧ g ≤ f ∧ ∀ s : Set α, MeasurableSet s →
∫⁻ a in s, f a ∂μ = ∫⁻ a in s, g a ∂μ := by
obtain ⟨g, hmg, hgf, hifg⟩ := exists_measurable_le_lintegral_eq (μ := μ) f
use g, hmg, hgf
refine fun s hms ↦ le_antisymm ?_ (lintegral_mono hgf)
rw [← compl_compl s, setLintegral_compl hms.compl, setLintegral_compl hms.compl, hifg]
· gcongr; apply hgf
· rw [hifg] at hf
exact ne_top_of_le_ne_top hf (setLIntegral_le_lintegral _ _)
· exact ne_top_of_le_ne_top hf (setLIntegral_le_lintegral _ _)
end UnifTight
@[deprecated (since := "2024-06-29")]
alias set_lintegral_subtype := setLIntegral_subtype
section DiracAndCount
variable [MeasurableSpace α]
theorem lintegral_dirac' (a : α) {f : α → ℝ≥0∞} (hf : Measurable f) : ∫⁻ a, f a ∂dirac a = f a := by
simp [lintegral_congr_ae (ae_eq_dirac' hf)]
theorem lintegral_dirac [MeasurableSingletonClass α] (a : α) (f : α → ℝ≥0∞) :
∫⁻ a, f a ∂dirac a = f a := by simp [lintegral_congr_ae (ae_eq_dirac f)]
theorem setLIntegral_dirac' {a : α} {f : α → ℝ≥0∞} (hf : Measurable f) {s : Set α}
(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 lintegral_dirac' _ hf
· exact lintegral_zero_measure _
@[deprecated (since := "2024-06-29")]
alias set_lintegral_dirac' := setLIntegral_dirac'
theorem setLIntegral_dirac {a : α} (f : α → ℝ≥0∞) (s : Set α) [MeasurableSingletonClass α]
[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 lintegral_dirac _ _
· exact lintegral_zero_measure _
@[deprecated (since := "2024-06-29")]
alias set_lintegral_dirac := setLIntegral_dirac
theorem lintegral_count' {f : α → ℝ≥0∞} (hf : Measurable f) : ∫⁻ a, f a ∂count = ∑' a, f a := by
rw [count, lintegral_sum_measure]
congr
exact funext fun a => lintegral_dirac' a hf
theorem lintegral_count [MeasurableSingletonClass α] (f : α → ℝ≥0∞) :
∫⁻ a, f a ∂count = ∑' a, f a := by
rw [count, lintegral_sum_measure]
congr
exact funext fun a => lintegral_dirac a f
theorem _root_.ENNReal.tsum_const_eq [MeasurableSingletonClass α] (c : ℝ≥0∞) :
∑' _ : α, c = c * Measure.count (univ : Set α) := by rw [← lintegral_count, lintegral_const]
/-- Markov's inequality for the counting measure with hypothesis using `tsum` in `ℝ≥0∞`. -/
theorem _root_.ENNReal.count_const_le_le_of_tsum_le [MeasurableSingletonClass α] {a : α → ℝ≥0∞}
(a_mble : Measurable a) {c : ℝ≥0∞} (tsum_le_c : ∑' i, a i ≤ c) {ε : ℝ≥0∞} (ε_ne_zero : ε ≠ 0)
(ε_ne_top : ε ≠ ∞) : Measure.count { i : α | ε ≤ a i } ≤ c / ε := by
rw [← lintegral_count] at tsum_le_c
apply (MeasureTheory.meas_ge_le_lintegral_div a_mble.aemeasurable ε_ne_zero ε_ne_top).trans
exact ENNReal.div_le_div tsum_le_c rfl.le
/-- Markov's inequality for counting measure with hypothesis using `tsum` in `ℝ≥0`. -/
theorem _root_.NNReal.count_const_le_le_of_tsum_le [MeasurableSingletonClass α] {a : α → ℝ≥0}
(a_mble : Measurable a) (a_summable : Summable a) {c : ℝ≥0} (tsum_le_c : ∑' i, a i ≤ c)
{ε : ℝ≥0} (ε_ne_zero : ε ≠ 0) : Measure.count { i : α | ε ≤ a i } ≤ c / ε := by
rw [show (fun i => ε ≤ a i) = fun i => (ε : ℝ≥0∞) ≤ ((↑) ∘ a) i by
funext i
simp only [ENNReal.coe_le_coe, Function.comp]]
apply
ENNReal.count_const_le_le_of_tsum_le (measurable_coe_nnreal_ennreal.comp a_mble) _
(mod_cast ε_ne_zero) (@ENNReal.coe_ne_top ε)
convert ENNReal.coe_le_coe.mpr tsum_le_c
simp_rw [Function.comp_apply]
rw [ENNReal.tsum_coe_eq a_summable.hasSum]
end DiracAndCount
section Countable
/-!
### Lebesgue integral over finite and countable types and sets
-/
theorem lintegral_countable' [Countable α] [MeasurableSingletonClass α] (f : α → ℝ≥0∞) :
∫⁻ a, f a ∂μ = ∑' a, f a * μ {a} := by
conv_lhs => rw [← sum_smul_dirac μ, lintegral_sum_measure]
congr 1 with a : 1
rw [lintegral_smul_measure, lintegral_dirac, mul_comm]
theorem lintegral_singleton' {f : α → ℝ≥0∞} (hf : Measurable f) (a : α) :
∫⁻ x in {a}, f x ∂μ = f a * μ {a} := by
simp only [restrict_singleton, lintegral_smul_measure, lintegral_dirac' _ hf, mul_comm]
theorem lintegral_singleton [MeasurableSingletonClass α] (f : α → ℝ≥0∞) (a : α) :
∫⁻ x in {a}, f x ∂μ = f a * μ {a} := by
simp only [restrict_singleton, lintegral_smul_measure, lintegral_dirac, mul_comm]
theorem lintegral_countable [MeasurableSingletonClass α] (f : α → ℝ≥0∞) {s : Set α}
(hs : s.Countable) : ∫⁻ a in s, f a ∂μ = ∑' a : s, f a * μ {(a : α)} :=
calc
∫⁻ a in s, f a ∂μ = ∫⁻ a in ⋃ x ∈ s, {x}, f a ∂μ := by rw [biUnion_of_singleton]
_ = ∑' a : s, ∫⁻ x in {(a : α)}, f x ∂μ :=
(lintegral_biUnion hs (fun _ _ => measurableSet_singleton _) (pairwiseDisjoint_fiber id s) _)
_ = ∑' a : s, f a * μ {(a : α)} := by simp only [lintegral_singleton]
theorem lintegral_insert [MeasurableSingletonClass α] {a : α} {s : Set α} (h : a ∉ s)
(f : α → ℝ≥0∞) : ∫⁻ x in insert a s, f x ∂μ = f a * μ {a} + ∫⁻ x in s, f x ∂μ := by
rw [← union_singleton, lintegral_union (measurableSet_singleton a), lintegral_singleton,
add_comm]
rwa [disjoint_singleton_right]
theorem lintegral_finset [MeasurableSingletonClass α] (s : Finset α) (f : α → ℝ≥0∞) :
∫⁻ x in s, f x ∂μ = ∑ x ∈ s, f x * μ {x} := by
simp only [lintegral_countable _ s.countable_toSet, ← Finset.tsum_subtype']
theorem lintegral_fintype [MeasurableSingletonClass α] [Fintype α] (f : α → ℝ≥0∞) :
∫⁻ x, f x ∂μ = ∑ x, f x * μ {x} := by
rw [← lintegral_finset, Finset.coe_univ, Measure.restrict_univ]
theorem lintegral_unique [Unique α] (f : α → ℝ≥0∞) : ∫⁻ x, f x ∂μ = f default * μ univ :=
calc
∫⁻ x, f x ∂μ = ∫⁻ _, f default ∂μ := lintegral_congr <| Unique.forall_iff.2 rfl
_ = f default * μ univ := lintegral_const _
end Countable
theorem ae_lt_top' {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) (h2f : ∫⁻ x, f x ∂μ ≠ ∞) :
∀ᵐ x ∂μ, f x < ∞ := by
simp_rw [ae_iff, ENNReal.not_lt_top]
exact measure_eq_top_of_lintegral_ne_top hf h2f
theorem ae_lt_top {f : α → ℝ≥0∞} (hf : Measurable f) (h2f : ∫⁻ x, f x ∂μ ≠ ∞) :
∀ᵐ x ∂μ, f x < ∞ :=
ae_lt_top' hf.aemeasurable h2f
/-- Lebesgue integral of a bounded function over a set of finite measure is finite.
Note that this lemma assumes no regularity of either `f` or `s`. -/
theorem setLIntegral_lt_top_of_le_nnreal {s : Set α} (hs : μ s ≠ ∞) {f : α → ℝ≥0∞}
(hbdd : ∃ y : ℝ≥0, ∀ x ∈ s, f x ≤ y) : ∫⁻ x in s, f x ∂μ < ∞ := by
obtain ⟨M, hM⟩ := hbdd
refine lt_of_le_of_lt (setLIntegral_mono measurable_const hM) ?_
simp [ENNReal.mul_lt_top, hs]
/-- Lebesgue integral of a bounded function over a set of finite measure is finite.
Note that this lemma assumes no regularity of either `f` or `s`. -/
theorem setLIntegral_lt_top_of_bddAbove {s : Set α} (hs : μ s ≠ ∞) {f : α → ℝ≥0}
(hbdd : BddAbove (f '' s)) : ∫⁻ x in s, f x ∂μ < ∞ :=
setLIntegral_lt_top_of_le_nnreal hs <| hbdd.imp fun _M hM _x hx ↦
ENNReal.coe_le_coe.2 <| hM (mem_image_of_mem f hx)
@[deprecated (since := "2024-06-29")]
alias set_lintegral_lt_top_of_bddAbove := setLIntegral_lt_top_of_bddAbove
theorem setLIntegral_lt_top_of_isCompact [TopologicalSpace α] {s : Set α}
(hs : μ s ≠ ∞) (hsc : IsCompact s) {f : α → ℝ≥0} (hf : Continuous f) :
∫⁻ x in s, f x ∂μ < ∞ :=
setLIntegral_lt_top_of_bddAbove hs (hsc.image hf).bddAbove
@[deprecated (since := "2024-06-29")]
alias set_lintegral_lt_top_of_isCompact := setLIntegral_lt_top_of_isCompact
theorem _root_.IsFiniteMeasure.lintegral_lt_top_of_bounded_to_ennreal {α : Type*}
[MeasurableSpace α] (μ : Measure α) [μ_fin : IsFiniteMeasure μ] {f : α → ℝ≥0∞}
(f_bdd : ∃ c : ℝ≥0, ∀ x, f x ≤ c) : ∫⁻ x, f x ∂μ < ∞ := by
rw [← μ.restrict_univ]
refine setLIntegral_lt_top_of_le_nnreal (measure_ne_top _ _) ?_
simpa using f_bdd
/-- 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. Auxiliary version assuming moreover that the
functions in the sequence are ae measurable. -/
lemma tendsto_of_lintegral_tendsto_of_monotone_aux {α : Type*} {mα : MeasurableSpace α}
{f : ℕ → α → ℝ≥0∞} {F : α → ℝ≥0∞} {μ : Measure α}
(hf_meas : ∀ n, AEMeasurable (f n) μ) (hF_meas : AEMeasurable F μ)
(hf_tendsto : Tendsto (fun i ↦ ∫⁻ a, f i a ∂μ) atTop (𝓝 (∫⁻ a, F a ∂μ)))
(hf_mono : ∀ᵐ a ∂μ, Monotone (fun i ↦ f i a))
(h_bound : ∀ᵐ a ∂μ, ∀ i, f i a ≤ F a) (h_int_finite : ∫⁻ a, F a ∂μ ≠ ∞) :
∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F a)) := by
have h_bound_finite : ∀ᵐ a ∂μ, F a ≠ ∞ := by
filter_upwards [ae_lt_top' hF_meas h_int_finite] with a ha using ha.ne
have h_exists : ∀ᵐ a ∂μ, ∃ l, Tendsto (fun i ↦ f i a) atTop (𝓝 l) := by
filter_upwards [h_bound, h_bound_finite, hf_mono] with a h_le h_fin h_mono
have h_tendsto : Tendsto (fun i ↦ f i a) atTop atTop ∨
∃ l, Tendsto (fun i ↦ f i a) atTop (𝓝 l) := tendsto_of_monotone h_mono
cases' h_tendsto with h_absurd h_tendsto
· rw [tendsto_atTop_atTop_iff_of_monotone h_mono] at h_absurd
obtain ⟨i, hi⟩ := h_absurd (F a + 1)
refine absurd (hi.trans (h_le _)) (not_le.mpr ?_)
exact ENNReal.lt_add_right h_fin one_ne_zero
· exact h_tendsto
classical
let F' : α → ℝ≥0∞ := fun a ↦ if h : ∃ l, Tendsto (fun i ↦ f i a) atTop (𝓝 l)
then h.choose else ∞
have hF'_tendsto : ∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F' a)) := by
filter_upwards [h_exists] with a ha
simp_rw [F', dif_pos ha]
exact ha.choose_spec
suffices F' =ᵐ[μ] F by
filter_upwards [this, hF'_tendsto] with a h_eq h_tendsto using h_eq ▸ h_tendsto
have hF'_le : F' ≤ᵐ[μ] F := by
filter_upwards [h_bound, hF'_tendsto] with a h_le h_tendsto
exact le_of_tendsto' h_tendsto (fun m ↦ h_le _)
suffices ∫⁻ a, F' a ∂μ = ∫⁻ a, F a ∂μ from
ae_eq_of_ae_le_of_lintegral_le hF'_le (this ▸ h_int_finite) hF_meas this.symm.le
refine tendsto_nhds_unique ?_ hf_tendsto
exact lintegral_tendsto_of_tendsto_of_monotone hf_meas hf_mono hF'_tendsto
/-- 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_lintegral_tendsto_of_monotone {α : Type*} {mα : MeasurableSpace α}
{f : ℕ → α → ℝ≥0∞} {F : α → ℝ≥0∞} {μ : Measure α}
(hF_meas : AEMeasurable F μ)
(hf_tendsto : Tendsto (fun i ↦ ∫⁻ a, f i a ∂μ) atTop (𝓝 (∫⁻ a, F a ∂μ)))
(hf_mono : ∀ᵐ a ∂μ, Monotone (fun i ↦ f i a))
(h_bound : ∀ᵐ a ∂μ, ∀ i, f i a ≤ F a) (h_int_finite : ∫⁻ a, F a ∂μ ≠ ∞) :
∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F a)) := by
have : ∀ n, ∃ g : α → ℝ≥0∞, Measurable g ∧ g ≤ f n ∧ ∫⁻ a, f n a ∂μ = ∫⁻ a, g a ∂μ :=
fun n ↦ exists_measurable_le_lintegral_eq _ _
choose g gmeas gf hg using this
let g' : ℕ → α → ℝ≥0∞ := Nat.rec (g 0) (fun n I x ↦ max (g (n+1) x) (I x))
have M n : Measurable (g' n) := by
induction n with
| zero => simp [g', gmeas 0]
| succ n ih => exact Measurable.max (gmeas (n+1)) ih
have I : ∀ n x, g n x ≤ g' n x := by
intro n x
cases n with | zero | succ => simp [g']
have I' : ∀ᵐ x ∂μ, ∀ n, g' n x ≤ f n x := by
filter_upwards [hf_mono] with x hx n
induction n with
| zero => simpa [g'] using gf 0 x
| succ n ih => exact max_le (gf (n+1) x) (ih.trans (hx (Nat.le_succ n)))
have Int_eq n : ∫⁻ x, g' n x ∂μ = ∫⁻ x, f n x ∂μ := by
apply le_antisymm
· apply lintegral_mono_ae
filter_upwards [I'] with x hx using hx n
· rw [hg n]
exact lintegral_mono (I n)
have : ∀ᵐ a ∂μ, Tendsto (fun i ↦ g' i a) atTop (𝓝 (F a)) := by
apply tendsto_of_lintegral_tendsto_of_monotone_aux _ hF_meas _ _ _ h_int_finite
· exact fun n ↦ (M n).aemeasurable
· simp_rw [Int_eq]
exact hf_tendsto
· exact eventually_of_forall (fun x ↦ monotone_nat_of_le_succ (fun n ↦ le_max_right _ _))
· filter_upwards [h_bound, I'] with x h'x hx n using (hx n).trans (h'x n)
filter_upwards [this, I', h_bound] with x hx h'x h''x
exact tendsto_of_tendsto_of_tendsto_of_le_of_le hx tendsto_const_nhds h'x h''x
/-- 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_lintegral_tendsto_of_antitone {α : Type*} {mα : MeasurableSpace α}
{f : ℕ → α → ℝ≥0∞} {F : α → ℝ≥0∞} {μ : Measure α}
(hf_meas : ∀ n, AEMeasurable (f n) μ)
(hf_tendsto : Tendsto (fun i ↦ ∫⁻ a, f i a ∂μ) atTop (𝓝 (∫⁻ a, F a ∂μ)))
(hf_mono : ∀ᵐ a ∂μ, Antitone (fun i ↦ f i a))
(h_bound : ∀ᵐ a ∂μ, ∀ i, F a ≤ f i a) (h0 : ∫⁻ a, f 0 a ∂μ ≠ ∞) :
∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F a)) := by
have h_int_finite : ∫⁻ a, F a ∂μ ≠ ∞ := by
refine ((lintegral_mono_ae ?_).trans_lt h0.lt_top).ne
filter_upwards [h_bound] with a ha using ha 0
have h_exists : ∀ᵐ a ∂μ, ∃ l, Tendsto (fun i ↦ f i a) atTop (𝓝 l) := by
filter_upwards [hf_mono] with a h_mono
rcases _root_.tendsto_of_antitone h_mono with h | h
· refine ⟨0, h.mono_right ?_⟩
rw [OrderBot.atBot_eq]
exact pure_le_nhds _
· exact h
classical
let F' : α → ℝ≥0∞ := fun a ↦ if h : ∃ l, Tendsto (fun i ↦ f i a) atTop (𝓝 l)
then h.choose else ∞
have hF'_tendsto : ∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F' a)) := by
filter_upwards [h_exists] with a ha
simp_rw [F', dif_pos ha]
exact ha.choose_spec
suffices F' =ᵐ[μ] F by
filter_upwards [this, hF'_tendsto] with a h_eq h_tendsto using h_eq ▸ h_tendsto
have hF'_le : F ≤ᵐ[μ] F' := by
filter_upwards [h_bound, hF'_tendsto] with a h_le h_tendsto
exact ge_of_tendsto' h_tendsto (fun m ↦ h_le _)
suffices ∫⁻ a, F' a ∂μ = ∫⁻ a, F a ∂μ by
refine (ae_eq_of_ae_le_of_lintegral_le hF'_le h_int_finite ?_ this.le).symm
exact ENNReal.aemeasurable_of_tendsto hf_meas hF'_tendsto
refine tendsto_nhds_unique ?_ hf_tendsto
exact lintegral_tendsto_of_tendsto_of_antitone hf_meas hf_mono h0 hF'_tendsto
variable (μ) in
/-- If `μ` is an s-finite measure, then for any function `f`
there exists a measurable function `g ≤ f`
that has the same Lebesgue integral over every set.
For the integral over the whole space, the statement is true without extra assumptions,
see `exists_measurable_le_lintegral_eq`.
See also `MeasureTheory.Measure.restrict_toMeasurable_of_sFinite` for a similar result. -/
theorem exists_measurable_le_forall_setLIntegral_eq [SFinite μ] (f : α → ℝ≥0∞) :
∃ g : α → ℝ≥0∞, Measurable g ∧ g ≤ f ∧ ∀ s, ∫⁻ a in s, f a ∂μ = ∫⁻ a in s, g a ∂μ := by
-- We only need to prove the `≤` inequality for the integrals, the other one follows from `g ≤ f`.
rsuffices ⟨g, hgm, hgle, hleg⟩ :
∃ g : α → ℝ≥0∞, Measurable g ∧ g ≤ f ∧ ∀ s, ∫⁻ a in s, f a ∂μ ≤ ∫⁻ a in s, g a ∂μ
· exact ⟨g, hgm, hgle, fun s ↦ (hleg s).antisymm (lintegral_mono hgle)⟩
-- Without loss of generality, `μ` is a finite measure.
wlog h : IsFiniteMeasure μ generalizing μ
· choose g hgm hgle hgint using fun n ↦ @this (sFiniteSeq μ n) _ inferInstance
refine ⟨fun x ↦ ⨆ n, g n x, measurable_iSup hgm, fun x ↦ iSup_le (hgle · x), fun s ↦ ?_⟩
rw [← sum_sFiniteSeq μ, Measure.restrict_sum_of_countable,
lintegral_sum_measure, lintegral_sum_measure]
exact ENNReal.tsum_le_tsum fun n ↦ (hgint n s).trans (lintegral_mono fun x ↦ le_iSup (g · x) _)
-- According to `exists_measurable_le_lintegral_eq`, for any natural `n`
-- we can choose a measurable function $g_{n}$
-- such that $g_{n}(x) ≤ \min (f(x), n)$ for all $x$
-- and both sides have the same integral over the whole space w.r.t. $μ$.
have (n : ℕ): ∃ g : α → ℝ≥0∞, Measurable g ∧ g ≤ f ∧ g ≤ n ∧
∫⁻ a, min (f a) n ∂μ = ∫⁻ a, g a ∂μ := by
simpa [and_assoc] using exists_measurable_le_lintegral_eq μ (f ⊓ n)
choose g hgm hgf hgle hgint using this
-- Let `φ` be the pointwise supremum of the functions $g_{n}$.
-- Clearly, `φ` is a measurable function and `φ ≤ f`.
set φ : α → ℝ≥0∞ := fun x ↦ ⨆ n, g n x
have hφm : Measurable φ := by measurability
have hφle : φ ≤ f := fun x ↦ iSup_le (hgf · x)
refine ⟨φ, hφm, hφle, fun s ↦ ?_⟩
-- Now we show the inequality between set integrals.
-- Choose a simple function `ψ ≤ f` with values in `ℝ≥0` and prove for `ψ`.
rw [lintegral_eq_nnreal]
refine iSup₂_le fun ψ hψ ↦ ?_
-- Choose `n` such that `ψ x ≤ n` for all `x`.
obtain ⟨n, hn⟩ : ∃ n : ℕ, ∀ x, ψ x ≤ n := by
rcases ψ.range.bddAbove with ⟨C, hC⟩
exact ⟨⌈C⌉₊, fun x ↦ (hC <| ψ.mem_range_self x).trans (Nat.le_ceil _)⟩
calc
(ψ.map (↑)).lintegral (μ.restrict s) = ∫⁻ a in s, ψ a ∂μ :=
SimpleFunc.lintegral_eq_lintegral .. |>.symm
_ ≤ ∫⁻ a in s, min (f a) n ∂μ :=
lintegral_mono fun a ↦ le_min (hψ _) (ENNReal.coe_le_coe.2 (hn a))
_ ≤ ∫⁻ a in s, g n a ∂μ := by
have : ∫⁻ a in (toMeasurable μ s)ᶜ, min (f a) n ∂μ ≠ ∞ :=
IsFiniteMeasure.lintegral_lt_top_of_bounded_to_ennreal _ ⟨n, fun _ ↦ min_le_right ..⟩ |>.ne
have hsm : MeasurableSet (toMeasurable μ s) := measurableSet_toMeasurable ..
apply ENNReal.le_of_add_le_add_right this
rw [← μ.restrict_toMeasurable_of_sFinite, lintegral_add_compl _ hsm, hgint,
← lintegral_add_compl _ hsm]
gcongr with x
exact le_min (hgf n x) (hgle n x)
_ ≤ _ := lintegral_mono fun x ↦ le_iSup (g · x) n
end Lintegral
open MeasureTheory.SimpleFunc
variable {m m0 : MeasurableSpace α}
/-- In a sigma-finite measure space, there exists an integrable function which is
positive everywhere (and with an arbitrarily small integral). -/
theorem exists_pos_lintegral_lt_of_sigmaFinite (μ : Measure α) [SigmaFinite μ] {ε : ℝ≥0∞}
(ε0 : ε ≠ 0) : ∃ g : α → ℝ≥0, (∀ x, 0 < g x) ∧ Measurable g ∧ ∫⁻ x, g x ∂μ < ε := by
/- Let `s` be a covering of `α` by pairwise disjoint measurable sets of finite measure. Let
`δ : ℕ → ℝ≥0` be a positive function such that `∑' i, μ (s i) * δ i < ε`. Then the function that
is equal to `δ n` on `s n` is a positive function with integral less than `ε`. -/
set s : ℕ → Set α := disjointed (spanningSets μ)
have : ∀ n, μ (s n) < ∞ := fun n =>
(measure_mono <| disjointed_subset _ _).trans_lt (measure_spanningSets_lt_top μ n)
obtain ⟨δ, δpos, δsum⟩ : ∃ δ : ℕ → ℝ≥0, (∀ i, 0 < δ i) ∧ (∑' i, μ (s i) * δ i) < ε :=
ENNReal.exists_pos_tsum_mul_lt_of_countable ε0 _ fun n => (this n).ne
set N : α → ℕ := spanningSetsIndex μ
have hN_meas : Measurable N := measurable_spanningSetsIndex μ
have hNs : ∀ n, N ⁻¹' {n} = s n := preimage_spanningSetsIndex_singleton μ
refine ⟨δ ∘ N, fun x => δpos _, measurable_from_nat.comp hN_meas, ?_⟩
erw [lintegral_comp measurable_from_nat.coe_nnreal_ennreal hN_meas]
simpa [N, hNs, lintegral_countable', measurable_spanningSetsIndex, mul_comm] using δsum
theorem lintegral_trim {μ : Measure α} (hm : m ≤ m0) {f : α → ℝ≥0∞} (hf : Measurable[m] f) :
∫⁻ a, f a ∂μ.trim hm = ∫⁻ a, f a ∂μ := by
refine
@Measurable.ennreal_induction α m (fun f => ∫⁻ a, f a ∂μ.trim hm = ∫⁻ a, f a ∂μ) ?_ ?_ ?_ f hf
· intro c s hs
rw [lintegral_indicator _ hs, lintegral_indicator _ (hm s hs), setLIntegral_const,
setLIntegral_const]
suffices h_trim_s : μ.trim hm s = μ s by rw [h_trim_s]
exact trim_measurableSet_eq hm hs
· intro f g _ hf _ hf_prop hg_prop
have h_m := lintegral_add_left (μ := Measure.trim μ hm) hf g
have h_m0 := lintegral_add_left (μ := μ) (Measurable.mono hf hm le_rfl) g
rwa [hf_prop, hg_prop, ← h_m0] at h_m
· intro f hf hf_mono hf_prop
rw [lintegral_iSup hf hf_mono]
rw [lintegral_iSup (fun n => Measurable.mono (hf n) hm le_rfl) hf_mono]
congr with n
exact hf_prop n
theorem lintegral_trim_ae {μ : Measure α} (hm : m ≤ m0) {f : α → ℝ≥0∞}
(hf : AEMeasurable f (μ.trim hm)) : ∫⁻ a, f a ∂μ.trim hm = ∫⁻ a, f a ∂μ := by
rw [lintegral_congr_ae (ae_eq_of_ae_eq_trim hf.ae_eq_mk), lintegral_congr_ae hf.ae_eq_mk,
lintegral_trim hm hf.measurable_mk]
section SigmaFinite
variable {E : Type*} [NormedAddCommGroup E] [MeasurableSpace E] [OpensMeasurableSpace E]
theorem univ_le_of_forall_fin_meas_le {μ : Measure α} (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
(C : ℝ≥0∞) {f : Set α → ℝ≥0∞} (hf : ∀ s, MeasurableSet[m] s → μ s ≠ ∞ → f s ≤ C)
(h_F_lim :
∀ S : ℕ → Set α, (∀ n, MeasurableSet[m] (S n)) → Monotone S → f (⋃ n, S n) ≤ ⨆ n, f (S n)) :
f univ ≤ C := by
let S := @spanningSets _ m (μ.trim hm) _
have hS_mono : Monotone S := @monotone_spanningSets _ m (μ.trim hm) _
have hS_meas : ∀ n, MeasurableSet[m] (S n) := @measurable_spanningSets _ m (μ.trim hm) _
rw [← @iUnion_spanningSets _ m (μ.trim hm)]
refine (h_F_lim S hS_meas hS_mono).trans ?_
refine iSup_le fun n => hf (S n) (hS_meas n) ?_
exact ((le_trim hm).trans_lt (@measure_spanningSets_lt_top _ m (μ.trim hm) _ n)).ne
/-- If the Lebesgue integral of a function is bounded by some constant on all sets with finite
measure in a sub-σ-algebra and the measure is σ-finite on that sub-σ-algebra, then the integral
over the whole space is bounded by that same constant. -/
theorem lintegral_le_of_forall_fin_meas_trim_le {μ : Measure α} (hm : m ≤ m0)
[SigmaFinite (μ.trim hm)] (C : ℝ≥0∞) {f : α → ℝ≥0∞}
(hf : ∀ s, MeasurableSet[m] s → μ s ≠ ∞ → ∫⁻ x in s, f x ∂μ ≤ C) : ∫⁻ x, f x ∂μ ≤ C := by
have : ∫⁻ x in univ, f x ∂μ = ∫⁻ x, f x ∂μ := by simp only [Measure.restrict_univ]
rw [← this]
refine univ_le_of_forall_fin_meas_le hm C hf fun S _ hS_mono => ?_
rw [setLIntegral_iUnion_of_directed]
exact directed_of_isDirected_le hS_mono
@[deprecated lintegral_le_of_forall_fin_meas_trim_le (since := "2024-07-14")]
alias lintegral_le_of_forall_fin_meas_le' := lintegral_le_of_forall_fin_meas_trim_le
alias lintegral_le_of_forall_fin_meas_le_of_measurable := lintegral_le_of_forall_fin_meas_trim_le
/-- If the Lebesgue integral of a function is bounded by some constant on all sets with finite
measure and the measure is σ-finite, then the integral over the whole space is bounded by that same
constant. -/
theorem lintegral_le_of_forall_fin_meas_le [MeasurableSpace α] {μ : Measure α} [SigmaFinite μ]
(C : ℝ≥0∞) {f : α → ℝ≥0∞}
(hf : ∀ s, MeasurableSet s → μ s ≠ ∞ → ∫⁻ x in s, f x ∂μ ≤ C) : ∫⁻ x, f x ∂μ ≤ C :=
@lintegral_le_of_forall_fin_meas_trim_le _ _ _ _ _ (by rwa [trim_eq_self]) C _ hf
theorem SimpleFunc.exists_lt_lintegral_simpleFunc_of_lt_lintegral {m : MeasurableSpace α}
{μ : Measure α} [SigmaFinite μ] {f : α →ₛ ℝ≥0} {L : ℝ≥0∞} (hL : L < ∫⁻ x, f x ∂μ) :
∃ g : α →ₛ ℝ≥0, (∀ x, g x ≤ f x) ∧ ∫⁻ x, g x ∂μ < ∞ ∧ L < ∫⁻ x, g x ∂μ := by
induction' f using MeasureTheory.SimpleFunc.induction with c s hs f₁ f₂ _ h₁ h₂ generalizing L
· simp only [hs, const_zero, coe_piecewise, coe_const, SimpleFunc.coe_zero, univ_inter,
piecewise_eq_indicator, lintegral_indicator, lintegral_const, Measure.restrict_apply',
ENNReal.coe_indicator, Function.const_apply] at hL
have c_ne_zero : c ≠ 0 := by
intro hc
simp only [hc, ENNReal.coe_zero, zero_mul, not_lt_zero] at hL
have : L / c < μ s := by
rwa [ENNReal.div_lt_iff, mul_comm]
· simp only [c_ne_zero, Ne, ENNReal.coe_eq_zero, not_false_iff, true_or_iff]
· simp only [Ne, coe_ne_top, not_false_iff, true_or_iff]
obtain ⟨t, ht, ts, mlt, t_top⟩ :
∃ t : Set α, MeasurableSet t ∧ t ⊆ s ∧ L / ↑c < μ t ∧ μ t < ∞ :=
Measure.exists_subset_measure_lt_top hs this
refine ⟨piecewise t ht (const α c) (const α 0), fun x => ?_, ?_, ?_⟩
· refine indicator_le_indicator_of_subset ts (fun x => ?_) x
exact zero_le _
· simp only [ht, const_zero, coe_piecewise, coe_const, SimpleFunc.coe_zero, univ_inter,
piecewise_eq_indicator, ENNReal.coe_indicator, Function.const_apply, lintegral_indicator,
lintegral_const, Measure.restrict_apply', ENNReal.mul_lt_top ENNReal.coe_ne_top t_top.ne]
· simp only [ht, const_zero, coe_piecewise, coe_const, SimpleFunc.coe_zero,
piecewise_eq_indicator, ENNReal.coe_indicator, Function.const_apply, lintegral_indicator,
lintegral_const, Measure.restrict_apply', univ_inter]
rwa [mul_comm, ← ENNReal.div_lt_iff]
· simp only [c_ne_zero, Ne, ENNReal.coe_eq_zero, not_false_iff, true_or_iff]
· simp only [Ne, coe_ne_top, not_false_iff, true_or_iff]
· replace hL : L < ∫⁻ x, f₁ x ∂μ + ∫⁻ x, f₂ x ∂μ := by
rwa [← lintegral_add_left f₁.measurable.coe_nnreal_ennreal]
by_cases hf₁ : ∫⁻ x, f₁ x ∂μ = 0
· simp only [hf₁, zero_add] at hL
rcases h₂ hL with ⟨g, g_le, g_top, gL⟩
refine ⟨g, fun x => (g_le x).trans ?_, g_top, gL⟩
simp only [SimpleFunc.coe_add, Pi.add_apply, le_add_iff_nonneg_left, zero_le']
by_cases hf₂ : ∫⁻ x, f₂ x ∂μ = 0
· simp only [hf₂, add_zero] at hL
rcases h₁ hL with ⟨g, g_le, g_top, gL⟩
refine ⟨g, fun x => (g_le x).trans ?_, g_top, gL⟩
simp only [SimpleFunc.coe_add, Pi.add_apply, le_add_iff_nonneg_right, zero_le']
obtain ⟨L₁, L₂, hL₁, hL₂, hL⟩ :
∃ L₁ L₂ : ℝ≥0∞, (L₁ < ∫⁻ x, f₁ x ∂μ) ∧ (L₂ < ∫⁻ x, f₂ x ∂μ) ∧ L < L₁ + L₂ :=
ENNReal.exists_lt_add_of_lt_add hL hf₁ hf₂
rcases h₁ hL₁ with ⟨g₁, g₁_le, g₁_top, hg₁⟩
rcases h₂ hL₂ with ⟨g₂, g₂_le, g₂_top, hg₂⟩
refine ⟨g₁ + g₂, fun x => add_le_add (g₁_le x) (g₂_le x), ?_, ?_⟩
· apply lt_of_le_of_lt _ (add_lt_top.2 ⟨g₁_top, g₂_top⟩)
rw [← lintegral_add_left g₁.measurable.coe_nnreal_ennreal]
exact le_rfl
· apply hL.trans ((ENNReal.add_lt_add hg₁ hg₂).trans_le _)
rw [← lintegral_add_left g₁.measurable.coe_nnreal_ennreal]
simp only [coe_add, Pi.add_apply, ENNReal.coe_add, le_rfl]
theorem exists_lt_lintegral_simpleFunc_of_lt_lintegral {m : MeasurableSpace α} {μ : Measure α}
[SigmaFinite μ] {f : α → ℝ≥0} {L : ℝ≥0∞} (hL : L < ∫⁻ x, f x ∂μ) :
∃ g : α →ₛ ℝ≥0, (∀ x, g x ≤ f x) ∧ ∫⁻ x, g x ∂μ < ∞ ∧ L < ∫⁻ x, g x ∂μ := by
simp_rw [lintegral_eq_nnreal, lt_iSup_iff] at hL
rcases hL with ⟨g₀, hg₀, g₀L⟩
have h'L : L < ∫⁻ x, g₀ x ∂μ := by
convert g₀L
rw [← SimpleFunc.lintegral_eq_lintegral, coe_map]
simp only [Function.comp_apply]
rcases SimpleFunc.exists_lt_lintegral_simpleFunc_of_lt_lintegral h'L with ⟨g, hg, gL, gtop⟩
exact ⟨g, fun x => (hg x).trans (coe_le_coe.1 (hg₀ x)), gL, gtop⟩
end SigmaFinite
section TendstoIndicator
variable {α : Type*} [MeasurableSpace α] {A : Set α}
variable {ι : Type*} (L : Filter ι) [IsCountablyGenerated L] {As : ι → Set α}
/-- If the indicators of measurable sets `Aᵢ` tend pointwise almost everywhere to the indicator
of a measurable set `A` and we eventually have `Aᵢ ⊆ B` for some set `B` of finite measure, then
the measures of `Aᵢ` tend to the measure of `A`. -/
lemma tendsto_measure_of_ae_tendsto_indicator {μ : Measure α} (A_mble : MeasurableSet A)
(As_mble : ∀ i, MeasurableSet (As i)) {B : Set α} (B_mble : MeasurableSet B)
(B_finmeas : μ B ≠ ∞) (As_le_B : ∀ᶠ i in L, As i ⊆ B)
(h_lim : ∀ᵐ x ∂μ, ∀ᶠ i in L, x ∈ As i ↔ x ∈ A) :
Tendsto (fun i ↦ μ (As i)) L (𝓝 (μ A)) := by
simp_rw [← MeasureTheory.lintegral_indicator_one A_mble,
← MeasureTheory.lintegral_indicator_one (As_mble _)]
refine tendsto_lintegral_filter_of_dominated_convergence (B.indicator (1 : α → ℝ≥0∞))
(eventually_of_forall ?_) ?_ ?_ ?_
· exact fun i ↦ Measurable.indicator measurable_const (As_mble i)
· filter_upwards [As_le_B] with i hi
exact eventually_of_forall (fun x ↦ indicator_le_indicator_of_subset hi (by simp) x)
· rwa [← lintegral_indicator_one B_mble] at B_finmeas
· simpa only [Pi.one_def, tendsto_indicator_const_apply_iff_eventually] using h_lim
/-- If `μ` is a finite measure and the indicators of measurable sets `Aᵢ` tend pointwise
almost everywhere to the indicator of a measurable set `A`, then the measures `μ Aᵢ` tend to
the measure `μ A`. -/
lemma tendsto_measure_of_ae_tendsto_indicator_of_isFiniteMeasure [IsCountablyGenerated L]
{μ : Measure α} [IsFiniteMeasure μ] (A_mble : MeasurableSet A)
(As_mble : ∀ i, MeasurableSet (As i)) (h_lim : ∀ᵐ x ∂μ, ∀ᶠ i in L, x ∈ As i ↔ x ∈ A) :
Tendsto (fun i ↦ μ (As i)) L (𝓝 (μ A)) :=
tendsto_measure_of_ae_tendsto_indicator L A_mble As_mble MeasurableSet.univ
(measure_ne_top μ univ) (eventually_of_forall (fun i ↦ subset_univ (As i))) h_lim
end TendstoIndicator -- section
end MeasureTheory
|
MeasureTheory\Integral\LebesgueNormedSpace.lean | /-
Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
import Mathlib.MeasureTheory.Measure.WithDensity
import Mathlib.Analysis.Normed.Module.Basic
/-! # A lemma about measurability with density under scalar multiplication in normed spaces -/
open MeasureTheory Filter ENNReal Set
open NNReal ENNReal
variable {α β γ δ : Type*} {m : MeasurableSpace α} {μ : MeasureTheory.Measure α}
theorem aemeasurable_withDensity_iff {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
[SecondCountableTopology E] [MeasurableSpace E] [BorelSpace E] {f : α → ℝ≥0}
(hf : Measurable f) {g : α → E} :
AEMeasurable g (μ.withDensity fun x => (f x : ℝ≥0∞)) ↔
AEMeasurable (fun x => (f x : ℝ) • g x) μ := by
constructor
· rintro ⟨g', g'meas, hg'⟩
have A : MeasurableSet { x : α | f x ≠ 0 } := (hf (measurableSet_singleton 0)).compl
refine ⟨fun x => (f x : ℝ) • g' x, hf.coe_nnreal_real.smul g'meas, ?_⟩
apply @ae_of_ae_restrict_of_ae_restrict_compl _ _ _ { x | f x ≠ 0 }
· rw [EventuallyEq, ae_withDensity_iff hf.coe_nnreal_ennreal] at hg'
rw [ae_restrict_iff' A]
filter_upwards [hg']
intro a ha h'a
have : (f a : ℝ≥0∞) ≠ 0 := by simpa only [Ne, ENNReal.coe_eq_zero] using h'a
rw [ha this]
· filter_upwards [ae_restrict_mem A.compl]
intro x hx
simp only [Classical.not_not, mem_setOf_eq, mem_compl_iff] at hx
simp [hx]
· rintro ⟨g', g'meas, hg'⟩
refine ⟨fun x => (f x : ℝ)⁻¹ • g' x, hf.coe_nnreal_real.inv.smul g'meas, ?_⟩
rw [EventuallyEq, ae_withDensity_iff hf.coe_nnreal_ennreal]
filter_upwards [hg']
intro x hx h'x
rw [← hx, smul_smul, _root_.inv_mul_cancel, one_smul]
simp only [Ne, ENNReal.coe_eq_zero] at h'x
simpa only [NNReal.coe_eq_zero, Ne] using h'x
|
MeasureTheory\Integral\Marginal.lean | /-
Copyright (c) 2023 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn, Heather Macbeth
-/
import Mathlib.MeasureTheory.Constructions.Pi
import Mathlib.MeasureTheory.Integral.Lebesgue
/-!
# Marginals of multivariate functions
In this file, we define a convenient way to compute integrals of multivariate functions, especially
if you want to write expressions where you integrate only over some of the variables that the
function depends on. This is common in induction arguments involving integrals of multivariate
functions.
This constructions allows working with iterated integrals and applying Tonelli's theorem
and Fubini's theorem, without using measurable equivalences by changing the representation of your
space (e.g. `((ι ⊕ ι') → ℝ) ≃ (ι → ℝ) × (ι' → ℝ)`).
## Main Definitions
* Assume that `∀ i : ι, π i` is a product of measurable spaces with measures `μ i` on `π i`,
`f : (∀ i, π i) → ℝ≥0∞` is a function and `s : Finset ι`.
Then `lmarginal μ s f` or `∫⋯∫⁻_s, f ∂μ` is the function that integrates `f`
over all variables in `s`. It returns a function that still takes the same variables as `f`,
but is constant in the variables in `s`. Mathematically, if `s = {i₁, ..., iₖ}`,
then `lmarginal μ s f` is the expression
$$
\vec{x}\mapsto \int\!\!\cdots\!\!\int f(\vec{x}[\vec{y}])dy_{i_1}\cdots dy_{i_k}.
$$
where $\vec{x}[\vec{y}]$ is the vector $\vec{x}$ with $x_{i_j}$ replaced by $y_{i_j}$ for all
$1 \le j \le k$.
If `f` is the distribution of a random variable, this is the marginal distribution of all
variables not in `s` (but not the most general notion, since we only consider product measures
here).
Note that the notation `∫⋯∫⁻_s, f ∂μ` is not a binder, and returns a function.
## Main Results
* `lmarginal_union` is the analogue of Tonelli's theorem for iterated integrals. It states that
for measurable functions `f` and disjoint finsets `s` and `t` we have
`∫⋯∫⁻_s ∪ t, f ∂μ = ∫⋯∫⁻_s, ∫⋯∫⁻_t, f ∂μ ∂μ`.
## Implementation notes
The function `f` can have an arbitrary product as its domain (even infinite products), but the
set `s` of integration variables is a `Finset`. We are assuming that the function `f` is measurable
for most of this file. Note that asking whether it is `AEMeasurable` is not even well-posed,
since there is no well-behaved measure on the domain of `f`.
## TODO
* Define the marginal function for functions taking values in a Banach space.
-/
open scoped ENNReal
open Set Function Equiv Finset
noncomputable section
namespace MeasureTheory
section LMarginal
variable {δ δ' : Type*} {π : δ → Type*} [∀ x, MeasurableSpace (π x)]
variable {μ : ∀ i, Measure (π i)} [DecidableEq δ]
variable {s t : Finset δ} {f g : (∀ i, π i) → ℝ≥0∞} {x y : ∀ i, π i} {i : δ}
/-- Integrate `f(x₁,…,xₙ)` over all variables `xᵢ` where `i ∈ s`. Return a function in the
remaining variables (it will be constant in the `xᵢ` for `i ∈ s`).
This is the marginal distribution of all variables not in `s` when the considered measure
is the product measure. -/
def lmarginal (μ : ∀ i, Measure (π i)) (s : Finset δ) (f : (∀ i, π i) → ℝ≥0∞)
(x : ∀ i, π i) : ℝ≥0∞ :=
∫⁻ y : ∀ i : s, π i, f (updateFinset x s y) ∂Measure.pi fun i : s => μ i
-- Note: this notation is not a binder. This is more convenient since it returns a function.
@[inherit_doc]
notation "∫⋯∫⁻_" s ", " f " ∂" μ:70 => lmarginal μ s f
@[inherit_doc]
notation "∫⋯∫⁻_" s ", " f => lmarginal (fun _ ↦ volume) s f
variable (μ)
theorem _root_.Measurable.lmarginal [∀ i, SigmaFinite (μ i)] (hf : Measurable f) :
Measurable (∫⋯∫⁻_s, f ∂μ) := by
refine Measurable.lintegral_prod_right ?_
refine hf.comp ?_
rw [measurable_pi_iff]; intro i
by_cases hi : i ∈ s
· simpa [hi, updateFinset] using measurable_pi_iff.1 measurable_snd _
· simpa [hi, updateFinset] using measurable_pi_iff.1 measurable_fst _
@[simp] theorem lmarginal_empty (f : (∀ i, π i) → ℝ≥0∞) : ∫⋯∫⁻_∅, f ∂μ = f := by
ext1 x
simp_rw [lmarginal, Measure.pi_of_empty fun i : (∅ : Finset δ) => μ i]
apply lintegral_dirac'
exact Subsingleton.measurable
/-- The marginal distribution is independent of the variables in `s`. -/
theorem lmarginal_congr {x y : ∀ i, π i} (f : (∀ i, π i) → ℝ≥0∞)
(h : ∀ i ∉ s, x i = y i) :
(∫⋯∫⁻_s, f ∂μ) x = (∫⋯∫⁻_s, f ∂μ) y := by
dsimp [lmarginal, updateFinset_def]; rcongr; exact h _ ‹_›
theorem lmarginal_update_of_mem {i : δ} (hi : i ∈ s)
(f : (∀ i, π i) → ℝ≥0∞) (x : ∀ i, π i) (y : π i) :
(∫⋯∫⁻_s, f ∂μ) (Function.update x i y) = (∫⋯∫⁻_s, f ∂μ) x := by
apply lmarginal_congr
intro j hj
have : j ≠ i := by rintro rfl; exact hj hi
apply update_noteq this
variable {μ} in
theorem lmarginal_singleton (f : (∀ i, π i) → ℝ≥0∞) (i : δ) :
∫⋯∫⁻_{i}, f ∂μ = fun x => ∫⁻ xᵢ, f (Function.update x i xᵢ) ∂μ i := by
let α : Type _ := ({i} : Finset δ)
let e := (MeasurableEquiv.piUnique fun j : α ↦ π j).symm
ext1 x
calc (∫⋯∫⁻_{i}, f ∂μ) x
= ∫⁻ (y : π (default : α)), f (updateFinset x {i} (e y)) ∂μ (default : α) := by
simp_rw [lmarginal, measurePreserving_piUnique (fun j : ({i} : Finset δ) ↦ μ j) |>.symm _
|>.lintegral_map_equiv]
_ = ∫⁻ xᵢ, f (Function.update x i xᵢ) ∂μ i := by simp [update_eq_updateFinset]; rfl
variable {μ} in
@[gcongr]
theorem lmarginal_mono {f g : (∀ i, π i) → ℝ≥0∞} (hfg : f ≤ g) : ∫⋯∫⁻_s, f ∂μ ≤ ∫⋯∫⁻_s, g ∂μ :=
fun _ => lintegral_mono fun _ => hfg _
variable [∀ i, SigmaFinite (μ i)]
theorem lmarginal_union (f : (∀ i, π i) → ℝ≥0∞) (hf : Measurable f)
(hst : Disjoint s t) : ∫⋯∫⁻_s ∪ t, f ∂μ = ∫⋯∫⁻_s, ∫⋯∫⁻_t, f ∂μ ∂μ := by
ext1 x
let e := MeasurableEquiv.piFinsetUnion π hst
calc (∫⋯∫⁻_s ∪ t, f ∂μ) x
= ∫⁻ (y : (i : ↥(s ∪ t)) → π i), f (updateFinset x (s ∪ t) y)
∂.pi fun i' : ↥(s ∪ t) ↦ μ i' := rfl
_ = ∫⁻ (y : ((i : s) → π i) × ((j : t) → π j)), f (updateFinset x (s ∪ t) _)
∂(Measure.pi fun i : s ↦ μ i).prod (.pi fun j : t ↦ μ j) := by
rw [measurePreserving_piFinsetUnion hst μ |>.lintegral_map_equiv]
_ = ∫⁻ (y : (i : s) → π i), ∫⁻ (z : (j : t) → π j), f (updateFinset x (s ∪ t) (e (y, z)))
∂.pi fun j : t ↦ μ j ∂.pi fun i : s ↦ μ i := by
apply lintegral_prod
apply Measurable.aemeasurable
exact hf.comp <| measurable_updateFinset.comp e.measurable
_ = (∫⋯∫⁻_s, ∫⋯∫⁻_t, f ∂μ ∂μ) x := by
simp_rw [lmarginal, updateFinset_updateFinset hst]
rfl
theorem lmarginal_union' (f : (∀ i, π i) → ℝ≥0∞) (hf : Measurable f) {s t : Finset δ}
(hst : Disjoint s t) : ∫⋯∫⁻_s ∪ t, f ∂μ = ∫⋯∫⁻_t, ∫⋯∫⁻_s, f ∂μ ∂μ := by
rw [Finset.union_comm, lmarginal_union μ f hf hst.symm]
variable {μ}
/-- Peel off a single integral from a `lmarginal` integral at the beginning (compare with
`lmarginal_insert'`, which peels off an integral at the end). -/
theorem lmarginal_insert (f : (∀ i, π i) → ℝ≥0∞) (hf : Measurable f) {i : δ}
(hi : i ∉ s) (x : ∀ i, π i) :
(∫⋯∫⁻_insert i s, f ∂μ) x = ∫⁻ xᵢ, (∫⋯∫⁻_s, f ∂μ) (Function.update x i xᵢ) ∂μ i := by
rw [Finset.insert_eq, lmarginal_union μ f hf (Finset.disjoint_singleton_left.mpr hi),
lmarginal_singleton]
/-- Peel off a single integral from a `lmarginal` integral at the beginning (compare with
`lmarginal_erase'`, which peels off an integral at the end). -/
theorem lmarginal_erase (f : (∀ i, π i) → ℝ≥0∞) (hf : Measurable f) {i : δ}
(hi : i ∈ s) (x : ∀ i, π i) :
(∫⋯∫⁻_s, f ∂μ) x = ∫⁻ xᵢ, (∫⋯∫⁻_(erase s i), f ∂μ) (Function.update x i xᵢ) ∂μ i := by
simpa [insert_erase hi] using lmarginal_insert _ hf (not_mem_erase i s) x
/-- Peel off a single integral from a `lmarginal` integral at the end (compare with
`lmarginal_insert`, which peels off an integral at the beginning). -/
theorem lmarginal_insert' (f : (∀ i, π i) → ℝ≥0∞) (hf : Measurable f) {i : δ}
(hi : i ∉ s) :
∫⋯∫⁻_insert i s, f ∂μ = ∫⋯∫⁻_s, (fun x ↦ ∫⁻ xᵢ, f (Function.update x i xᵢ) ∂μ i) ∂μ := by
rw [Finset.insert_eq, Finset.union_comm,
lmarginal_union (s := s) μ f hf (Finset.disjoint_singleton_right.mpr hi), lmarginal_singleton]
/-- Peel off a single integral from a `lmarginal` integral at the end (compare with
`lmarginal_erase`, which peels off an integral at the beginning). -/
theorem lmarginal_erase' (f : (∀ i, π i) → ℝ≥0∞) (hf : Measurable f) {i : δ}
(hi : i ∈ s) :
∫⋯∫⁻_s, f ∂μ = ∫⋯∫⁻_(erase s i), (fun x ↦ ∫⁻ xᵢ, f (Function.update x i xᵢ) ∂μ i) ∂μ := by
simpa [insert_erase hi] using lmarginal_insert' _ hf (not_mem_erase i s)
@[simp] theorem lmarginal_univ [Fintype δ] {f : (∀ i, π i) → ℝ≥0∞} :
∫⋯∫⁻_univ, f ∂μ = fun _ => ∫⁻ x, f x ∂Measure.pi μ := by
let e : { j // j ∈ Finset.univ } ≃ δ := Equiv.subtypeUnivEquiv mem_univ
ext1 x
simp_rw [lmarginal, measurePreserving_piCongrLeft μ e |>.lintegral_map_equiv, updateFinset_def]
simp
rfl
theorem lintegral_eq_lmarginal_univ [Fintype δ] {f : (∀ i, π i) → ℝ≥0∞} (x : ∀ i, π i) :
∫⁻ x, f x ∂Measure.pi μ = (∫⋯∫⁻_univ, f ∂μ) x := by simp
theorem lmarginal_image [DecidableEq δ'] {e : δ' → δ} (he : Injective e) (s : Finset δ')
{f : (∀ i, π (e i)) → ℝ≥0∞} (hf : Measurable f) (x : ∀ i, π i) :
(∫⋯∫⁻_s.image e, f ∘ (· ∘' e) ∂μ) x = (∫⋯∫⁻_s, f ∂μ ∘' e) (x ∘' e) := by
have h : Measurable ((· ∘' e) : (∀ i, π i) → _) :=
measurable_pi_iff.mpr <| fun i ↦ measurable_pi_apply (e i)
induction s using Finset.induction generalizing x with
| empty => simp
| insert hi ih =>
rw [image_insert, lmarginal_insert _ (hf.comp h) (he.mem_finset_image.not.mpr hi),
lmarginal_insert _ hf hi]
simp_rw [ih, ← update_comp_eq_of_injective' x he]
theorem lmarginal_update_of_not_mem {i : δ}
{f : (∀ i, π i) → ℝ≥0∞} (hf : Measurable f) (hi : i ∉ s) (x : ∀ i, π i) (y : π i) :
(∫⋯∫⁻_s, f ∂μ) (Function.update x i y) = (∫⋯∫⁻_s, f ∘ (Function.update · i y) ∂μ) x := by
induction s using Finset.induction generalizing x with
| empty => simp
| @insert i' s hi' ih =>
rw [lmarginal_insert _ hf hi', lmarginal_insert _ (hf.comp measurable_update_left) hi']
have hii' : i ≠ i' := mt (by rintro rfl; exact mem_insert_self i s) hi
simp_rw [update_comm hii', ih (mt Finset.mem_insert_of_mem hi)]
theorem lmarginal_eq_of_subset {f g : (∀ i, π i) → ℝ≥0∞} (hst : s ⊆ t)
(hf : Measurable f) (hg : Measurable g) (hfg : ∫⋯∫⁻_s, f ∂μ = ∫⋯∫⁻_s, g ∂μ) :
∫⋯∫⁻_t, f ∂μ = ∫⋯∫⁻_t, g ∂μ := by
rw [← union_sdiff_of_subset hst, lmarginal_union' μ f hf disjoint_sdiff,
lmarginal_union' μ g hg disjoint_sdiff, hfg]
theorem lmarginal_le_of_subset {f g : (∀ i, π i) → ℝ≥0∞} (hst : s ⊆ t)
(hf : Measurable f) (hg : Measurable g) (hfg : ∫⋯∫⁻_s, f ∂μ ≤ ∫⋯∫⁻_s, g ∂μ) :
∫⋯∫⁻_t, f ∂μ ≤ ∫⋯∫⁻_t, g ∂μ := by
rw [← union_sdiff_of_subset hst, lmarginal_union' μ f hf disjoint_sdiff,
lmarginal_union' μ g hg disjoint_sdiff]
exact lmarginal_mono hfg
theorem lintegral_eq_of_lmarginal_eq [Fintype δ] (s : Finset δ) {f g : (∀ i, π i) → ℝ≥0∞}
(hf : Measurable f) (hg : Measurable g) (hfg : ∫⋯∫⁻_s, f ∂μ = ∫⋯∫⁻_s, g ∂μ) :
∫⁻ x, f x ∂Measure.pi μ = ∫⁻ x, g x ∂Measure.pi μ := by
rcases isEmpty_or_nonempty (∀ i, π i) with h|⟨⟨x⟩⟩
· simp_rw [lintegral_of_isEmpty]
simp_rw [lintegral_eq_lmarginal_univ x, lmarginal_eq_of_subset (Finset.subset_univ s) hf hg hfg]
theorem lintegral_le_of_lmarginal_le [Fintype δ] (s : Finset δ) {f g : (∀ i, π i) → ℝ≥0∞}
(hf : Measurable f) (hg : Measurable g) (hfg : ∫⋯∫⁻_s, f ∂μ ≤ ∫⋯∫⁻_s, g ∂μ) :
∫⁻ x, f x ∂Measure.pi μ ≤ ∫⁻ x, g x ∂Measure.pi μ := by
rcases isEmpty_or_nonempty (∀ i, π i) with h|⟨⟨x⟩⟩
· simp_rw [lintegral_of_isEmpty, le_rfl]
simp_rw [lintegral_eq_lmarginal_univ x, lmarginal_le_of_subset (Finset.subset_univ s) hf hg hfg x]
end LMarginal
end MeasureTheory
|
MeasureTheory\Integral\MeanInequalities.lean | /-
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
-/
import Mathlib.MeasureTheory.Integral.Lebesgue
import Mathlib.Analysis.MeanInequalities
import Mathlib.Analysis.MeanInequalitiesPow
import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic
/-!
# Mean value inequalities for integrals
In this file we prove several inequalities on integrals, notably the Hölder inequality and
the Minkowski inequality. The versions for finite sums are in `Analysis.MeanInequalities`.
## Main results
Hölder's inequality for the Lebesgue integral of `ℝ≥0∞` and `ℝ≥0` functions: we prove
`∫ (f * g) ∂μ ≤ (∫ f^p ∂μ) ^ (1/p) * (∫ g^q ∂μ) ^ (1/q)` for `p`, `q` conjugate real exponents
and `α → (E)NNReal` functions in two cases,
* `ENNReal.lintegral_mul_le_Lp_mul_Lq` : ℝ≥0∞ functions,
* `NNReal.lintegral_mul_le_Lp_mul_Lq` : ℝ≥0 functions.
`ENNReal.lintegral_mul_norm_pow_le` is a variant where the exponents are not reciprocals:
`∫ (f ^ p * g ^ q) ∂μ ≤ (∫ f ∂μ) ^ p * (∫ g ∂μ) ^ q` where `p, q ≥ 0` and `p + q = 1`.
`ENNReal.lintegral_prod_norm_pow_le` generalizes this to a finite family of functions:
`∫ (∏ i, f i ^ p i) ∂μ ≤ ∏ i, (∫ f i ∂μ) ^ p i` when the `p` is a collection
of nonnegative weights with sum 1.
Minkowski's inequality for the Lebesgue integral of measurable functions with `ℝ≥0∞` values:
we prove `(∫ (f + g)^p ∂μ) ^ (1/p) ≤ (∫ f^p ∂μ) ^ (1/p) + (∫ g^p ∂μ) ^ (1/p)` for `1 ≤ p`.
-/
section LIntegral
/-!
### Hölder's inequality for the Lebesgue integral of ℝ≥0∞ and ℝ≥0 functions
We prove `∫ (f * g) ∂μ ≤ (∫ f^p ∂μ) ^ (1/p) * (∫ g^q ∂μ) ^ (1/q)` for `p`, `q`
conjugate real exponents and `α → (E)NNReal` functions in several cases, the first two being useful
only to prove the more general results:
* `ENNReal.lintegral_mul_le_one_of_lintegral_rpow_eq_one` : ℝ≥0∞ functions for which the
integrals on the right are equal to 1,
* `ENNReal.lintegral_mul_le_Lp_mul_Lq_of_ne_zero_of_ne_top` : ℝ≥0∞ functions for which the
integrals on the right are neither ⊤ nor 0,
* `ENNReal.lintegral_mul_le_Lp_mul_Lq` : ℝ≥0∞ functions,
* `NNReal.lintegral_mul_le_Lp_mul_Lq` : ℝ≥0 functions.
-/
noncomputable section
open NNReal ENNReal MeasureTheory Finset
variable {α : Type*} [MeasurableSpace α] {μ : Measure α}
namespace ENNReal
theorem lintegral_mul_le_one_of_lintegral_rpow_eq_one {p q : ℝ} (hpq : p.IsConjExponent q)
{f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hf_norm : ∫⁻ a, f a ^ p ∂μ = 1)
(hg_norm : ∫⁻ a, g a ^ q ∂μ = 1) : (∫⁻ a, (f * g) a ∂μ) ≤ 1 := by
calc
(∫⁻ a : α, (f * g) a ∂μ) ≤
∫⁻ a : α, f a ^ p / ENNReal.ofReal p + g a ^ q / ENNReal.ofReal q ∂μ :=
lintegral_mono fun a => young_inequality (f a) (g a) hpq
_ = 1 := by
simp only [div_eq_mul_inv]
rw [lintegral_add_left']
· rw [lintegral_mul_const'' _ (hf.pow_const p), lintegral_mul_const', hf_norm, hg_norm,
one_mul, one_mul, hpq.inv_add_inv_conj_ennreal]
simp [hpq.symm.pos]
· exact (hf.pow_const _).mul_const _
/-- Function multiplied by the inverse of its p-seminorm `(∫⁻ f^p ∂μ) ^ 1/p`-/
def funMulInvSnorm (f : α → ℝ≥0∞) (p : ℝ) (μ : Measure α) : α → ℝ≥0∞ := fun a =>
f a * ((∫⁻ c, f c ^ p ∂μ) ^ (1 / p))⁻¹
theorem fun_eq_funMulInvSnorm_mul_eLpNorm {p : ℝ} (f : α → ℝ≥0∞)
(hf_nonzero : (∫⁻ a, f a ^ p ∂μ) ≠ 0) (hf_top : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤) {a : α} :
f a = funMulInvSnorm f p μ a * (∫⁻ c, f c ^ p ∂μ) ^ (1 / p) := by
simp [funMulInvSnorm, mul_assoc, ENNReal.inv_mul_cancel, hf_nonzero, hf_top]
@[deprecated (since := "2024-07-27")]
alias fun_eq_funMulInvSnorm_mul_snorm := fun_eq_funMulInvSnorm_mul_eLpNorm
theorem funMulInvSnorm_rpow {p : ℝ} (hp0 : 0 < p) {f : α → ℝ≥0∞} {a : α} :
funMulInvSnorm f p μ a ^ p = f a ^ p * (∫⁻ c, f c ^ p ∂μ)⁻¹ := by
rw [funMulInvSnorm, mul_rpow_of_nonneg _ _ (le_of_lt hp0)]
suffices h_inv_rpow : ((∫⁻ c : α, f c ^ p ∂μ) ^ (1 / p))⁻¹ ^ p = (∫⁻ c : α, f c ^ p ∂μ)⁻¹ by
rw [h_inv_rpow]
rw [inv_rpow, ← rpow_mul, one_div_mul_cancel hp0.ne', rpow_one]
theorem lintegral_rpow_funMulInvSnorm_eq_one {p : ℝ} (hp0_lt : 0 < p) {f : α → ℝ≥0∞}
(hf_nonzero : (∫⁻ a, f a ^ p ∂μ) ≠ 0) (hf_top : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤) :
∫⁻ c, funMulInvSnorm f p μ c ^ p ∂μ = 1 := by
simp_rw [funMulInvSnorm_rpow hp0_lt]
rw [lintegral_mul_const', ENNReal.mul_inv_cancel hf_nonzero hf_top]
rwa [inv_ne_top]
/-- Hölder's inequality in case of finite non-zero integrals -/
theorem lintegral_mul_le_Lp_mul_Lq_of_ne_zero_of_ne_top {p q : ℝ} (hpq : p.IsConjExponent q)
{f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hf_nontop : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤)
(hg_nontop : (∫⁻ a, g a ^ q ∂μ) ≠ ⊤) (hf_nonzero : (∫⁻ a, f a ^ p ∂μ) ≠ 0)
(hg_nonzero : (∫⁻ a, g a ^ q ∂μ) ≠ 0) :
(∫⁻ a, (f * g) a ∂μ) ≤ (∫⁻ a, f a ^ p ∂μ) ^ (1 / p) * (∫⁻ a, g a ^ q ∂μ) ^ (1 / q) := by
let npf := (∫⁻ c : α, f c ^ p ∂μ) ^ (1 / p)
let nqg := (∫⁻ c : α, g c ^ q ∂μ) ^ (1 / q)
calc
(∫⁻ a : α, (f * g) a ∂μ) =
∫⁻ a : α, (funMulInvSnorm f p μ * funMulInvSnorm g q μ) a * (npf * nqg) ∂μ := by
refine lintegral_congr fun a => ?_
rw [Pi.mul_apply, fun_eq_funMulInvSnorm_mul_eLpNorm f hf_nonzero hf_nontop,
fun_eq_funMulInvSnorm_mul_eLpNorm g hg_nonzero hg_nontop, Pi.mul_apply]
ring
_ ≤ npf * nqg := by
rw [lintegral_mul_const' (npf * nqg) _
(by simp [npf, nqg, hf_nontop, hg_nontop, hf_nonzero, hg_nonzero, ENNReal.mul_eq_top])]
refine mul_le_of_le_one_left' ?_
have hf1 := lintegral_rpow_funMulInvSnorm_eq_one hpq.pos hf_nonzero hf_nontop
have hg1 := lintegral_rpow_funMulInvSnorm_eq_one hpq.symm.pos hg_nonzero hg_nontop
exact lintegral_mul_le_one_of_lintegral_rpow_eq_one hpq (hf.mul_const _) hf1 hg1
theorem ae_eq_zero_of_lintegral_rpow_eq_zero {p : ℝ} (hp0 : 0 ≤ p) {f : α → ℝ≥0∞}
(hf : AEMeasurable f μ) (hf_zero : ∫⁻ a, f a ^ p ∂μ = 0) : f =ᵐ[μ] 0 := by
rw [lintegral_eq_zero_iff' (hf.pow_const p)] at hf_zero
filter_upwards [hf_zero] with x
rw [Pi.zero_apply, ← not_imp_not]
exact fun hx => (rpow_pos_of_nonneg (pos_iff_ne_zero.2 hx) hp0).ne'
theorem lintegral_mul_eq_zero_of_lintegral_rpow_eq_zero {p : ℝ} (hp0 : 0 ≤ p) {f g : α → ℝ≥0∞}
(hf : AEMeasurable f μ) (hf_zero : ∫⁻ a, f a ^ p ∂μ = 0) : (∫⁻ a, (f * g) a ∂μ) = 0 := by
rw [← @lintegral_zero_fun α _ μ]
refine lintegral_congr_ae ?_
suffices h_mul_zero : f * g =ᵐ[μ] 0 * g by rwa [zero_mul] at h_mul_zero
have hf_eq_zero : f =ᵐ[μ] 0 := ae_eq_zero_of_lintegral_rpow_eq_zero hp0 hf hf_zero
exact hf_eq_zero.mul (ae_eq_refl g)
theorem lintegral_mul_le_Lp_mul_Lq_of_ne_zero_of_eq_top {p q : ℝ} (hp0_lt : 0 < p) (hq0 : 0 ≤ q)
{f g : α → ℝ≥0∞} (hf_top : ∫⁻ a, f a ^ p ∂μ = ⊤) (hg_nonzero : (∫⁻ a, g a ^ q ∂μ) ≠ 0) :
(∫⁻ a, (f * g) a ∂μ) ≤ (∫⁻ a, f a ^ p ∂μ) ^ (1 / p) * (∫⁻ a, g a ^ q ∂μ) ^ (1 / q) := by
refine le_trans le_top (le_of_eq ?_)
have hp0_inv_lt : 0 < 1 / p := by simp [hp0_lt]
rw [hf_top, ENNReal.top_rpow_of_pos hp0_inv_lt]
simp [hq0, hg_nonzero]
/-- Hölder's inequality for functions `α → ℝ≥0∞`. The integral of the product of two functions
is bounded by the product of their `ℒp` and `ℒq` seminorms when `p` and `q` are conjugate
exponents. -/
theorem lintegral_mul_le_Lp_mul_Lq (μ : Measure α) {p q : ℝ} (hpq : p.IsConjExponent q)
{f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
(∫⁻ a, (f * g) a ∂μ) ≤ (∫⁻ a, f a ^ p ∂μ) ^ (1 / p) * (∫⁻ a, g a ^ q ∂μ) ^ (1 / q) := by
by_cases hf_zero : ∫⁻ a, f a ^ p ∂μ = 0
· refine Eq.trans_le ?_ (zero_le _)
exact lintegral_mul_eq_zero_of_lintegral_rpow_eq_zero hpq.nonneg hf hf_zero
by_cases hg_zero : ∫⁻ a, g a ^ q ∂μ = 0
· refine Eq.trans_le ?_ (zero_le _)
rw [mul_comm]
exact lintegral_mul_eq_zero_of_lintegral_rpow_eq_zero hpq.symm.nonneg hg hg_zero
by_cases hf_top : ∫⁻ a, f a ^ p ∂μ = ⊤
· exact lintegral_mul_le_Lp_mul_Lq_of_ne_zero_of_eq_top hpq.pos hpq.symm.nonneg hf_top hg_zero
by_cases hg_top : ∫⁻ a, g a ^ q ∂μ = ⊤
· rw [mul_comm, mul_comm ((∫⁻ a : α, f a ^ p ∂μ) ^ (1 / p))]
exact lintegral_mul_le_Lp_mul_Lq_of_ne_zero_of_eq_top hpq.symm.pos hpq.nonneg hg_top hf_zero
-- non-⊤ non-zero case
exact ENNReal.lintegral_mul_le_Lp_mul_Lq_of_ne_zero_of_ne_top hpq hf hf_top hg_top hf_zero hg_zero
/-- A different formulation of Hölder's inequality for two functions, with two exponents that sum to
1, instead of reciprocals of -/
theorem lintegral_mul_norm_pow_le {α} [MeasurableSpace α] {μ : Measure α}
{f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
{p q : ℝ} (hp : 0 ≤ p) (hq : 0 ≤ q) (hpq : p + q = 1) :
∫⁻ a, f a ^ p * g a ^ q ∂μ ≤ (∫⁻ a, f a ∂μ) ^ p * (∫⁻ a, g a ∂μ) ^ q := by
rcases hp.eq_or_lt with rfl|hp
· rw [zero_add] at hpq
simp [hpq]
rcases hq.eq_or_lt with rfl|hq
· rw [add_zero] at hpq
simp [hpq]
have h2p : 1 < 1 / p := by
rw [one_div]
apply one_lt_inv hp
linarith
have h2pq : (1 / p)⁻¹ + (1 / q)⁻¹ = 1 := by simp [hp.ne', hq.ne', hpq]
have := ENNReal.lintegral_mul_le_Lp_mul_Lq μ ⟨h2p, h2pq⟩ (hf.pow_const p) (hg.pow_const q)
simpa [← ENNReal.rpow_mul, hp.ne', hq.ne'] using this
/-- A version of Hölder with multiple arguments -/
theorem lintegral_prod_norm_pow_le {α ι : Type*} [MeasurableSpace α] {μ : Measure α}
(s : Finset ι) {f : ι → α → ℝ≥0∞} (hf : ∀ i ∈ s, AEMeasurable (f i) μ)
{p : ι → ℝ} (hp : ∑ i ∈ s, p i = 1) (h2p : ∀ i ∈ s, 0 ≤ p i) :
∫⁻ a, ∏ i ∈ s, f i a ^ p i ∂μ ≤ ∏ i ∈ s, (∫⁻ a, f i a ∂μ) ^ p i := by
classical
induction s using Finset.induction generalizing p with
| empty =>
simp at hp
| @insert i₀ s hi₀ ih =>
rcases eq_or_ne (p i₀) 1 with h2i₀|h2i₀
· simp only [hi₀, not_false_eq_true, prod_insert]
have h2p : ∀ i ∈ s, p i = 0 := by
simpa [hi₀, h2i₀, sum_eq_zero_iff_of_nonneg (fun i hi ↦ h2p i <| mem_insert_of_mem hi)]
using hp
calc ∫⁻ a, f i₀ a ^ p i₀ * ∏ i ∈ s, f i a ^ p i ∂μ
= ∫⁻ a, f i₀ a ^ p i₀ * ∏ i ∈ s, 1 ∂μ := by
congr! 3 with x
apply prod_congr rfl fun i hi ↦ by rw [h2p i hi, ENNReal.rpow_zero]
_ ≤ (∫⁻ a, f i₀ a ∂μ) ^ p i₀ * ∏ i ∈ s, 1 := by simp [h2i₀]
_ = (∫⁻ a, f i₀ a ∂μ) ^ p i₀ * ∏ i ∈ s, (∫⁻ a, f i a ∂μ) ^ p i := by
congr 1
apply prod_congr rfl fun i hi ↦ by rw [h2p i hi, ENNReal.rpow_zero]
· have hpi₀ : 0 ≤ 1 - p i₀ := by
simp_rw [sub_nonneg, ← hp, single_le_sum h2p (mem_insert_self ..)]
have h2pi₀ : 1 - p i₀ ≠ 0 := by
rwa [sub_ne_zero, ne_comm]
let q := fun i ↦ p i / (1 - p i₀)
have hq : ∑ i ∈ s, q i = 1 := by
rw [← Finset.sum_div, ← sum_insert_sub hi₀, hp, div_self h2pi₀]
have h2q : ∀ i ∈ s, 0 ≤ q i :=
fun i hi ↦ div_nonneg (h2p i <| mem_insert_of_mem hi) hpi₀
calc ∫⁻ a, ∏ i ∈ insert i₀ s, f i a ^ p i ∂μ
= ∫⁻ a, f i₀ a ^ p i₀ * ∏ i ∈ s, f i a ^ p i ∂μ := by simp [hi₀]
_ = ∫⁻ a, f i₀ a ^ p i₀ * (∏ i ∈ s, f i a ^ q i) ^ (1 - p i₀) ∂μ := by
simp [← ENNReal.prod_rpow_of_nonneg hpi₀, ← ENNReal.rpow_mul,
div_mul_cancel₀ (h := h2pi₀)]
_ ≤ (∫⁻ a, f i₀ a ∂μ) ^ p i₀ * (∫⁻ a, ∏ i ∈ s, f i a ^ q i ∂μ) ^ (1 - p i₀) := by
apply ENNReal.lintegral_mul_norm_pow_le
· exact hf i₀ <| mem_insert_self ..
· exact s.aemeasurable_prod fun i hi ↦ (hf i <| mem_insert_of_mem hi).pow_const _
· exact h2p i₀ <| mem_insert_self ..
· exact hpi₀
· apply add_sub_cancel
_ ≤ (∫⁻ a, f i₀ a ∂μ) ^ p i₀ * (∏ i ∈ s, (∫⁻ a, f i a ∂μ) ^ q i) ^ (1 - p i₀) := by
gcongr -- behavior of gcongr is heartbeat-dependent, which makes code really fragile...
exact ih (fun i hi ↦ hf i <| mem_insert_of_mem hi) hq h2q
_ = (∫⁻ a, f i₀ a ∂μ) ^ p i₀ * ∏ i ∈ s, (∫⁻ a, f i a ∂μ) ^ p i := by
simp [← ENNReal.prod_rpow_of_nonneg hpi₀, ← ENNReal.rpow_mul,
div_mul_cancel₀ (h := h2pi₀)]
_ = ∏ i ∈ insert i₀ s, (∫⁻ a, f i a ∂μ) ^ p i := by simp [hi₀]
/-- A version of Hölder with multiple arguments, one of which plays a distinguished role. -/
theorem lintegral_mul_prod_norm_pow_le {α ι : Type*} [MeasurableSpace α] {μ : Measure α}
(s : Finset ι) {g : α → ℝ≥0∞} {f : ι → α → ℝ≥0∞} (hg : AEMeasurable g μ)
(hf : ∀ i ∈ s, AEMeasurable (f i) μ) (q : ℝ) {p : ι → ℝ} (hpq : q + ∑ i ∈ s, p i = 1)
(hq : 0 ≤ q) (hp : ∀ i ∈ s, 0 ≤ p i) :
∫⁻ a, g a ^ q * ∏ i ∈ s, f i a ^ p i ∂μ ≤
(∫⁻ a, g a ∂μ) ^ q * ∏ i ∈ s, (∫⁻ a, f i a ∂μ) ^ p i := by
suffices
∫⁻ t, ∏ j ∈ insertNone s, Option.elim j (g t) (fun j ↦ f j t) ^ Option.elim j q p ∂μ
≤ ∏ j ∈ insertNone s, (∫⁻ t, Option.elim j (g t) (fun j ↦ f j t) ∂μ) ^ Option.elim j q p by
simpa using this
refine ENNReal.lintegral_prod_norm_pow_le _ ?_ ?_ ?_
· rintro (_|i) hi
· exact hg
· refine hf i ?_
simpa using hi
· simp_rw [sum_insertNone, Option.elim]
exact hpq
· rintro (_|i) hi
· exact hq
· refine hp i ?_
simpa using hi
theorem lintegral_rpow_add_lt_top_of_lintegral_rpow_lt_top {p : ℝ} {f g : α → ℝ≥0∞}
(hf : AEMeasurable f μ) (hf_top : (∫⁻ a, f a ^ p ∂μ) < ⊤) (hg_top : (∫⁻ a, g a ^ p ∂μ) < ⊤)
(hp1 : 1 ≤ p) : (∫⁻ a, (f + g) a ^ p ∂μ) < ⊤ := by
have hp0_lt : 0 < p := lt_of_lt_of_le zero_lt_one hp1
have hp0 : 0 ≤ p := le_of_lt hp0_lt
calc
(∫⁻ a : α, (f a + g a) ^ p ∂μ) ≤
∫⁻ a, (2 : ℝ≥0∞) ^ (p - 1) * f a ^ p + (2 : ℝ≥0∞) ^ (p - 1) * g a ^ p ∂μ := by
refine lintegral_mono fun a => ?_
dsimp only
have h_zero_lt_half_rpow : (0 : ℝ≥0∞) < (1 / 2 : ℝ≥0∞) ^ p := by
rw [← ENNReal.zero_rpow_of_pos hp0_lt]
exact ENNReal.rpow_lt_rpow (by simp [zero_lt_one]) hp0_lt
have h_rw : (1 / 2 : ℝ≥0∞) ^ p * (2 : ℝ≥0∞) ^ (p - 1) = 1 / 2 := by
rw [sub_eq_add_neg, ENNReal.rpow_add _ _ two_ne_zero ENNReal.coe_ne_top, ← mul_assoc, ←
ENNReal.mul_rpow_of_nonneg _ _ hp0, one_div,
ENNReal.inv_mul_cancel two_ne_zero ENNReal.coe_ne_top, ENNReal.one_rpow, one_mul,
ENNReal.rpow_neg_one]
rw [← ENNReal.mul_le_mul_left (ne_of_lt h_zero_lt_half_rpow).symm _]
· rw [mul_add, ← mul_assoc, ← mul_assoc, h_rw, ← ENNReal.mul_rpow_of_nonneg _ _ hp0, mul_add]
refine
ENNReal.rpow_arith_mean_le_arith_mean2_rpow (1 / 2 : ℝ≥0∞) (1 / 2 : ℝ≥0∞) (f a) (g a) ?_
hp1
rw [ENNReal.div_add_div_same, one_add_one_eq_two,
ENNReal.div_self two_ne_zero ENNReal.coe_ne_top]
· rw [← lt_top_iff_ne_top]
refine ENNReal.rpow_lt_top_of_nonneg hp0 ?_
rw [one_div, ENNReal.inv_ne_top]
exact two_ne_zero
_ < ⊤ := by
have h_two : (2 : ℝ≥0∞) ^ (p - 1) ≠ ⊤ :=
ENNReal.rpow_ne_top_of_nonneg (by simp [hp1]) ENNReal.coe_ne_top
rw [lintegral_add_left', lintegral_const_mul'' _ (hf.pow_const p),
lintegral_const_mul' _ _ h_two, ENNReal.add_lt_top]
· exact ⟨ENNReal.mul_lt_top h_two hf_top.ne, ENNReal.mul_lt_top h_two hg_top.ne⟩
· exact (hf.pow_const p).const_mul _
theorem lintegral_Lp_mul_le_Lq_mul_Lr {α} [MeasurableSpace α] {p q r : ℝ} (hp0_lt : 0 < p)
(hpq : p < q) (hpqr : 1 / p = 1 / q + 1 / r) (μ : Measure α) {f g : α → ℝ≥0∞}
(hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
(∫⁻ a, (f * g) a ^ p ∂μ) ^ (1 / p) ≤
(∫⁻ a, f a ^ q ∂μ) ^ (1 / q) * (∫⁻ a, g a ^ r ∂μ) ^ (1 / r) := by
have hp0_ne : p ≠ 0 := (ne_of_lt hp0_lt).symm
have hp0 : 0 ≤ p := le_of_lt hp0_lt
have hq0_lt : 0 < q := lt_of_le_of_lt hp0 hpq
have hq0_ne : q ≠ 0 := (ne_of_lt hq0_lt).symm
have h_one_div_r : 1 / r = 1 / p - 1 / q := by rw [hpqr]; simp
let p2 := q / p
let q2 := p2.conjExponent
have hp2q2 : p2.IsConjExponent q2 :=
.conjExponent (by simp [p2, q2, _root_.lt_div_iff, hpq, hp0_lt])
calc
(∫⁻ a : α, (f * g) a ^ p ∂μ) ^ (1 / p) = (∫⁻ a : α, f a ^ p * g a ^ p ∂μ) ^ (1 / p) := by
simp_rw [Pi.mul_apply, ENNReal.mul_rpow_of_nonneg _ _ hp0]
_ ≤ ((∫⁻ a, f a ^ (p * p2) ∂μ) ^ (1 / p2) *
(∫⁻ a, g a ^ (p * q2) ∂μ) ^ (1 / q2)) ^ (1 / p) := by
gcongr
simp_rw [ENNReal.rpow_mul]
exact ENNReal.lintegral_mul_le_Lp_mul_Lq μ hp2q2 (hf.pow_const _) (hg.pow_const _)
_ = (∫⁻ a : α, f a ^ q ∂μ) ^ (1 / q) * (∫⁻ a : α, g a ^ r ∂μ) ^ (1 / r) := by
rw [@ENNReal.mul_rpow_of_nonneg _ _ (1 / p) (by simp [hp0]), ← ENNReal.rpow_mul, ←
ENNReal.rpow_mul]
have hpp2 : p * p2 = q := by
symm
rw [mul_comm, ← div_eq_iff hp0_ne]
have hpq2 : p * q2 = r := by
rw [← inv_inv r, ← one_div, ← one_div, h_one_div_r]
field_simp [p2, q2, Real.conjExponent, hp0_ne, hq0_ne]
simp_rw [div_mul_div_comm, mul_one, mul_comm p2, mul_comm q2, hpp2, hpq2]
theorem lintegral_mul_rpow_le_lintegral_rpow_mul_lintegral_rpow {p q : ℝ}
(hpq : p.IsConjExponent q) {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
(hf_top : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤) :
(∫⁻ a, f a * g a ^ (p - 1) ∂μ) ≤
(∫⁻ a, f a ^ p ∂μ) ^ (1 / p) * (∫⁻ a, g a ^ p ∂μ) ^ (1 / q) := by
refine le_trans (ENNReal.lintegral_mul_le_Lp_mul_Lq μ hpq hf (hg.pow_const _)) ?_
by_cases hf_zero_rpow : (∫⁻ a : α, f a ^ p ∂μ) ^ (1 / p) = 0
· rw [hf_zero_rpow, zero_mul]
exact zero_le _
have hf_top_rpow : (∫⁻ a : α, f a ^ p ∂μ) ^ (1 / p) ≠ ⊤ := by
by_contra h
refine hf_top ?_
have hp_not_neg : ¬p < 0 := by simp [hpq.nonneg]
simpa [hpq.pos, hp_not_neg] using h
refine (ENNReal.mul_le_mul_left hf_zero_rpow hf_top_rpow).mpr (le_of_eq ?_)
congr
ext1 a
rw [← ENNReal.rpow_mul, hpq.sub_one_mul_conj]
theorem lintegral_rpow_add_le_add_eLpNorm_mul_lintegral_rpow_add {p q : ℝ}
(hpq : p.IsConjExponent q) {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ)
(hf_top : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤) (hg : AEMeasurable g μ) (hg_top : (∫⁻ a, g a ^ p ∂μ) ≠ ⊤) :
(∫⁻ a, (f + g) a ^ p ∂μ) ≤
((∫⁻ a, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a, g a ^ p ∂μ) ^ (1 / p)) *
(∫⁻ a, (f a + g a) ^ p ∂μ) ^ (1 / q) := by
calc
(∫⁻ a, (f + g) a ^ p ∂μ) ≤ ∫⁻ a, (f + g) a * (f + g) a ^ (p - 1) ∂μ := by
gcongr with a
by_cases h_zero : (f + g) a = 0
· rw [h_zero, ENNReal.zero_rpow_of_pos hpq.pos]
exact zero_le _
by_cases h_top : (f + g) a = ⊤
· rw [h_top, ENNReal.top_rpow_of_pos hpq.sub_one_pos, ENNReal.top_mul_top]
exact le_top
refine le_of_eq ?_
nth_rw 2 [← ENNReal.rpow_one ((f + g) a)]
rw [← ENNReal.rpow_add _ _ h_zero h_top, add_sub_cancel]
_ = (∫⁻ a : α, f a * (f + g) a ^ (p - 1) ∂μ) + ∫⁻ a : α, g a * (f + g) a ^ (p - 1) ∂μ := by
have h_add_m : AEMeasurable (fun a : α => (f + g) a ^ (p - 1 : ℝ)) μ :=
(hf.add hg).pow_const _
have h_add_apply :
(∫⁻ a : α, (f + g) a * (f + g) a ^ (p - 1) ∂μ) =
∫⁻ a : α, (f a + g a) * (f + g) a ^ (p - 1) ∂μ :=
rfl
simp_rw [h_add_apply, add_mul]
rw [lintegral_add_left' (hf.mul h_add_m)]
_ ≤
((∫⁻ a, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a, g a ^ p ∂μ) ^ (1 / p)) *
(∫⁻ a, (f a + g a) ^ p ∂μ) ^ (1 / q) := by
rw [add_mul]
gcongr
· exact lintegral_mul_rpow_le_lintegral_rpow_mul_lintegral_rpow hpq hf (hf.add hg) hf_top
· exact lintegral_mul_rpow_le_lintegral_rpow_mul_lintegral_rpow hpq hg (hf.add hg) hg_top
@[deprecated (since := "2024-07-27")]
alias lintegral_rpow_add_le_add_snorm_mul_lintegral_rpow_add :=
lintegral_rpow_add_le_add_eLpNorm_mul_lintegral_rpow_add
private theorem lintegral_Lp_add_le_aux {p q : ℝ} (hpq : p.IsConjExponent q) {f g : α → ℝ≥0∞}
(hf : AEMeasurable f μ) (hf_top : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤) (hg : AEMeasurable g μ)
(hg_top : (∫⁻ a, g a ^ p ∂μ) ≠ ⊤) (h_add_zero : (∫⁻ a, (f + g) a ^ p ∂μ) ≠ 0)
(h_add_top : (∫⁻ a, (f + g) a ^ p ∂μ) ≠ ⊤) :
(∫⁻ a, (f + g) a ^ p ∂μ) ^ (1 / p) ≤
(∫⁻ a, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a, g a ^ p ∂μ) ^ (1 / p) := by
have hp_not_nonpos : ¬p ≤ 0 := by simp [hpq.pos]
have htop_rpow : (∫⁻ a, (f + g) a ^ p ∂μ) ^ (1 / p) ≠ ⊤ := by
by_contra h
exact h_add_top (@ENNReal.rpow_eq_top_of_nonneg _ (1 / p) (by simp [hpq.nonneg]) h)
have h0_rpow : (∫⁻ a, (f + g) a ^ p ∂μ) ^ (1 / p) ≠ 0 := by
simp [h_add_zero, h_add_top, hpq.nonneg, hp_not_nonpos, -Pi.add_apply]
suffices h :
1 ≤
(∫⁻ a : α, (f + g) a ^ p ∂μ) ^ (-(1 / p)) *
((∫⁻ a : α, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a : α, g a ^ p ∂μ) ^ (1 / p)) by
rwa [← mul_le_mul_left h0_rpow htop_rpow, ← mul_assoc, ← rpow_add _ _ h_add_zero h_add_top, ←
sub_eq_add_neg, _root_.sub_self, rpow_zero, one_mul, mul_one] at h
have h :
(∫⁻ a : α, (f + g) a ^ p ∂μ) ≤
((∫⁻ a : α, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a : α, g a ^ p ∂μ) ^ (1 / p)) *
(∫⁻ a : α, (f + g) a ^ p ∂μ) ^ (1 / q) :=
lintegral_rpow_add_le_add_eLpNorm_mul_lintegral_rpow_add hpq hf hf_top hg hg_top
have h_one_div_q : 1 / q = 1 - 1 / p := by
nth_rw 2 [← hpq.inv_add_inv_conj]
ring
simp_rw [h_one_div_q, sub_eq_add_neg 1 (1 / p), ENNReal.rpow_add _ _ h_add_zero h_add_top,
rpow_one] at h
conv_rhs at h => enter [2]; rw [mul_comm]
conv_lhs at h => rw [← one_mul (∫⁻ a : α, (f + g) a ^ p ∂μ)]
rwa [← mul_assoc, ENNReal.mul_le_mul_right h_add_zero h_add_top, mul_comm] at h
/-- **Minkowski's inequality for functions** `α → ℝ≥0∞`: the `ℒp` seminorm of the sum of two
functions is bounded by the sum of their `ℒp` seminorms. -/
theorem lintegral_Lp_add_le {p : ℝ} {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
(hp1 : 1 ≤ p) :
(∫⁻ a, (f + g) a ^ p ∂μ) ^ (1 / p) ≤
(∫⁻ a, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a, g a ^ p ∂μ) ^ (1 / p) := by
have hp_pos : 0 < p := lt_of_lt_of_le zero_lt_one hp1
by_cases hf_top : ∫⁻ a, f a ^ p ∂μ = ⊤
· simp [hf_top, hp_pos]
by_cases hg_top : ∫⁻ a, g a ^ p ∂μ = ⊤
· simp [hg_top, hp_pos]
by_cases h1 : p = 1
· refine le_of_eq ?_
simp_rw [h1, one_div_one, ENNReal.rpow_one]
exact lintegral_add_left' hf _
have hp1_lt : 1 < p := by
refine lt_of_le_of_ne hp1 ?_
symm
exact h1
have hpq := Real.IsConjExponent.conjExponent hp1_lt
by_cases h0 : (∫⁻ a, (f + g) a ^ p ∂μ) = 0
· rw [h0, @ENNReal.zero_rpow_of_pos (1 / p) (by simp [lt_of_lt_of_le zero_lt_one hp1])]
exact zero_le _
have htop : (∫⁻ a, (f + g) a ^ p ∂μ) ≠ ⊤ := by
rw [← Ne] at hf_top hg_top
rw [← lt_top_iff_ne_top] at hf_top hg_top ⊢
exact lintegral_rpow_add_lt_top_of_lintegral_rpow_lt_top hf hf_top hg_top hp1
exact lintegral_Lp_add_le_aux hpq hf hf_top hg hg_top h0 htop
/-- Variant of Minkowski's inequality for functions `α → ℝ≥0∞` in `ℒp` with `p ≤ 1`: the `ℒp`
seminorm of the sum of two functions is bounded by a constant multiple of the sum
of their `ℒp` seminorms. -/
theorem lintegral_Lp_add_le_of_le_one {p : ℝ} {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hp0 : 0 ≤ p)
(hp1 : p ≤ 1) :
(∫⁻ a, (f + g) a ^ p ∂μ) ^ (1 / p) ≤
(2 : ℝ≥0∞) ^ (1 / p - 1) * ((∫⁻ a, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a, g a ^ p ∂μ) ^ (1 / p)) := by
rcases eq_or_lt_of_le hp0 with (rfl | hp)
· simp only [Pi.add_apply, rpow_zero, lintegral_one, _root_.div_zero, zero_sub]
norm_num
rw [rpow_neg, rpow_one, ENNReal.inv_mul_cancel two_ne_zero two_ne_top]
calc
(∫⁻ a, (f + g) a ^ p ∂μ) ^ (1 / p) ≤ ((∫⁻ a, f a ^ p ∂μ) + ∫⁻ a, g a ^ p ∂μ) ^ (1 / p) := by
rw [← lintegral_add_left' (hf.pow_const p)]
gcongr with a
exact rpow_add_le_add_rpow _ _ hp0 hp1
_ ≤ (2 : ℝ≥0∞) ^ (1 / p - 1) * ((∫⁻ a, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a, g a ^ p ∂μ) ^ (1 / p)) :=
rpow_add_le_mul_rpow_add_rpow _ _ ((one_le_div hp).2 hp1)
end ENNReal
/-- Hölder's inequality for functions `α → ℝ≥0`. The integral of the product of two functions
is bounded by the product of their `ℒp` and `ℒq` seminorms when `p` and `q` are conjugate
exponents. -/
theorem NNReal.lintegral_mul_le_Lp_mul_Lq {p q : ℝ} (hpq : p.IsConjExponent q) {f g : α → ℝ≥0}
(hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
(∫⁻ a, (f * g) a ∂μ) ≤
(∫⁻ a, (f a : ℝ≥0∞) ^ p ∂μ) ^ (1 / p) * (∫⁻ a, (g a : ℝ≥0∞) ^ q ∂μ) ^ (1 / q) := by
simp_rw [Pi.mul_apply, ENNReal.coe_mul]
exact ENNReal.lintegral_mul_le_Lp_mul_Lq μ hpq hf.coe_nnreal_ennreal hg.coe_nnreal_ennreal
end
end LIntegral
|
MeasureTheory\Integral\PeakFunction.lean | /-
Copyright (c) 2023 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
import Mathlib.MeasureTheory.Integral.IntegralEqImproper
/-!
# Integrals against peak functions
A sequence of peak functions is a sequence of functions with average one concentrating around
a point `x₀`. Given such a sequence `φₙ`, then `∫ φₙ g` tends to `g x₀` in many situations, with
a whole zoo of possible assumptions on `φₙ` and `g`. This file is devoted to such results. Such
functions are also called approximations of unity, or approximations of identity.
## Main results
* `tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto`: If a sequence of peak
functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
`g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `g x₀`.
* `tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`:
If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀`
if `g` is continuous on `s`.
* `tendsto_integral_comp_smul_smul_of_integrable`:
If a nonnegative function `φ` has integral one and decays quickly enough at infinity,
then its renormalizations `x ↦ c ^ d * φ (c • x)` form a sequence of peak functions as `c → ∞`.
Therefore, `∫ (c ^ d * φ (c • x)) • g x` converges to `g 0` as `c → ∞` if `g` is continuous
at `0` and integrable.
Note that there are related results about convolution with respect to peak functions in the file
`Analysis.Convolution`, such as `MeasureTheory.convolution_tendsto_right` there.
-/
open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace Metric
open scoped Topology ENNReal
/-!
### General convergent result for integrals against a sequence of peak functions
-/
open Set
variable {α E ι : Type*} {hm : MeasurableSpace α} {μ : Measure α} [TopologicalSpace α]
[BorelSpace α] [NormedAddCommGroup E] [NormedSpace ℝ E] {g : α → E} {l : Filter ι} {x₀ : α}
{s t : Set α} {φ : ι → α → ℝ} {a : E}
/-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
`g` is integrable and has a limit at `x₀`, then `φᵢ • g` is eventually integrable. -/
theorem integrableOn_peak_smul_of_integrableOn_of_tendsto
(hs : MeasurableSet s) (h'st : t ∈ 𝓝[s] x₀)
(hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
(hiφ : Tendsto (fun i ↦ ∫ x in t, φ i x ∂μ) l (𝓝 1))
(h'iφ : ∀ᶠ i in l, AEStronglyMeasurable (φ i) (μ.restrict s))
(hmg : IntegrableOn g s μ) (hcg : Tendsto g (𝓝[s] x₀) (𝓝 a)) :
∀ᶠ i in l, IntegrableOn (fun x => φ i x • g x) s μ := by
obtain ⟨u, u_open, x₀u, ut, hu⟩ :
∃ u, IsOpen u ∧ x₀ ∈ u ∧ s ∩ u ⊆ t ∧ ∀ x ∈ u ∩ s, g x ∈ ball a 1 := by
rcases mem_nhdsWithin.1 (Filter.inter_mem h'st (hcg (ball_mem_nhds _ zero_lt_one)))
with ⟨u, u_open, x₀u, hu⟩
refine ⟨u, u_open, x₀u, ?_, hu.trans inter_subset_right⟩
rw [inter_comm]
exact hu.trans inter_subset_left
rw [tendsto_iff_norm_sub_tendsto_zero] at hiφ
filter_upwards [tendstoUniformlyOn_iff.1 (hlφ u u_open x₀u) 1 zero_lt_one,
(tendsto_order.1 hiφ).2 1 zero_lt_one, h'iφ] with i hi h'i h''i
have I : IntegrableOn (φ i) t μ := .of_integral_ne_zero (fun h ↦ by simp [h] at h'i)
have A : IntegrableOn (fun x => φ i x • g x) (s \ u) μ := by
refine Integrable.smul_of_top_right (hmg.mono diff_subset le_rfl) ?_
apply memℒp_top_of_bound (h''i.mono_set diff_subset) 1
filter_upwards [self_mem_ae_restrict (hs.diff u_open.measurableSet)] with x hx
simpa only [Pi.zero_apply, dist_zero_left] using (hi x hx).le
have B : IntegrableOn (fun x => φ i x • g x) (s ∩ u) μ := by
apply Integrable.smul_of_top_left
· exact IntegrableOn.mono_set I ut
· apply
memℒp_top_of_bound (hmg.mono_set inter_subset_left).aestronglyMeasurable (‖a‖ + 1)
filter_upwards [self_mem_ae_restrict (hs.inter u_open.measurableSet)] with x hx
rw [inter_comm] at hx
exact (norm_lt_of_mem_ball (hu x hx)).le
convert A.union B
simp only [diff_union_inter]
@[deprecated (since := "2024-02-20")]
alias integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt :=
integrableOn_peak_smul_of_integrableOn_of_tendsto
variable [CompleteSpace E]
/-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀` and its
integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
has a limit `a` at `x₀`, then `∫ φᵢ • g` converges to `a`.
Auxiliary lemma where one assumes additionally `a = 0`. -/
theorem tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux
(hs : MeasurableSet s) (ht : MeasurableSet t) (hts : t ⊆ s) (h'ts : t ∈ 𝓝[s] x₀)
(hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
(hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
(hiφ : Tendsto (fun i ↦ ∫ x in t, φ i x ∂μ) l (𝓝 1))
(h'iφ : ∀ᶠ i in l, AEStronglyMeasurable (φ i) (μ.restrict s))
(hmg : IntegrableOn g s μ) (hcg : Tendsto g (𝓝[s] x₀) (𝓝 0)) :
Tendsto (fun i : ι => ∫ x in s, φ i x • g x ∂μ) l (𝓝 0) := by
refine Metric.tendsto_nhds.2 fun ε εpos => ?_
obtain ⟨δ, hδ, δpos, δone⟩ : ∃ δ, (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ < ε ∧ 0 < δ ∧ δ < 1 := by
have A :
Tendsto (fun δ => (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ) (𝓝[>] 0)
(𝓝 ((0 * ∫ x in s, ‖g x‖ ∂μ) + 2 * 0)) := by
apply Tendsto.mono_left _ nhdsWithin_le_nhds
exact (tendsto_id.mul tendsto_const_nhds).add (tendsto_id.const_mul _)
rw [zero_mul, zero_add, mul_zero] at A
have : Ioo (0 : ℝ) 1 ∈ 𝓝[>] 0 := Ioo_mem_nhdsWithin_Ioi ⟨le_rfl, zero_lt_one⟩
rcases (((tendsto_order.1 A).2 ε εpos).and this).exists with ⟨δ, hδ, h'δ⟩
exact ⟨δ, hδ, h'δ.1, h'δ.2⟩
suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ by
filter_upwards [this] with i hi
simp only [dist_zero_right]
exact hi.trans_lt hδ
obtain ⟨u, u_open, x₀u, ut, hu⟩ :
∃ u, IsOpen u ∧ x₀ ∈ u ∧ s ∩ u ⊆ t ∧ ∀ x ∈ u ∩ s, g x ∈ ball 0 δ := by
rcases mem_nhdsWithin.1 (Filter.inter_mem h'ts (hcg (ball_mem_nhds _ δpos)))
with ⟨u, u_open, x₀u, hu⟩
refine ⟨u, u_open, x₀u, ?_, hu.trans inter_subset_right⟩
rw [inter_comm]
exact hu.trans inter_subset_left
filter_upwards [tendstoUniformlyOn_iff.1 (hlφ u u_open x₀u) δ δpos,
(tendsto_order.1 (tendsto_iff_norm_sub_tendsto_zero.1 hiφ)).2 δ δpos, hnφ,
integrableOn_peak_smul_of_integrableOn_of_tendsto hs h'ts hlφ hiφ h'iφ hmg hcg]
with i hi h'i hφpos h''i
have I : IntegrableOn (φ i) t μ := by
apply Integrable.of_integral_ne_zero (fun h ↦ ?_)
simp [h] at h'i
linarith
have B : ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ 2 * δ :=
calc
‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ ∫ x in s ∩ u, ‖φ i x • g x‖ ∂μ :=
norm_integral_le_integral_norm _
_ ≤ ∫ x in s ∩ u, ‖φ i x‖ * δ ∂μ := by
refine setIntegral_mono_on ?_ ?_ (hs.inter u_open.measurableSet) fun x hx => ?_
· exact IntegrableOn.mono_set h''i.norm inter_subset_left
· exact IntegrableOn.mono_set (I.norm.mul_const _) ut
rw [norm_smul]
apply mul_le_mul_of_nonneg_left _ (norm_nonneg _)
rw [inter_comm] at hu
exact (mem_ball_zero_iff.1 (hu x hx)).le
_ ≤ ∫ x in t, ‖φ i x‖ * δ ∂μ := by
apply setIntegral_mono_set
· exact I.norm.mul_const _
· exact eventually_of_forall fun x => mul_nonneg (norm_nonneg _) δpos.le
· exact eventually_of_forall ut
_ = ∫ x in t, φ i x * δ ∂μ := by
apply setIntegral_congr ht fun x hx => ?_
rw [Real.norm_of_nonneg (hφpos _ (hts hx))]
_ = (∫ x in t, φ i x ∂μ) * δ := by rw [integral_mul_right]
_ ≤ 2 * δ := by gcongr; linarith [(le_abs_self _).trans h'i.le]
have C : ‖∫ x in s \ u, φ i x • g x ∂μ‖ ≤ δ * ∫ x in s, ‖g x‖ ∂μ :=
calc
‖∫ x in s \ u, φ i x • g x ∂μ‖ ≤ ∫ x in s \ u, ‖φ i x • g x‖ ∂μ :=
norm_integral_le_integral_norm _
_ ≤ ∫ x in s \ u, δ * ‖g x‖ ∂μ := by
refine setIntegral_mono_on ?_ ?_ (hs.diff u_open.measurableSet) fun x hx => ?_
· exact IntegrableOn.mono_set h''i.norm diff_subset
· exact IntegrableOn.mono_set (hmg.norm.const_mul _) diff_subset
rw [norm_smul]
apply mul_le_mul_of_nonneg_right _ (norm_nonneg _)
simpa only [Pi.zero_apply, dist_zero_left] using (hi x hx).le
_ ≤ δ * ∫ x in s, ‖g x‖ ∂μ := by
rw [integral_mul_left]
apply mul_le_mul_of_nonneg_left (setIntegral_mono_set hmg.norm _ _) δpos.le
· filter_upwards with x using norm_nonneg _
· filter_upwards using diff_subset (s := s) (t := u)
calc
‖∫ x in s, φ i x • g x ∂μ‖ =
‖(∫ x in s \ u, φ i x • g x ∂μ) + ∫ x in s ∩ u, φ i x • g x ∂μ‖ := by
conv_lhs => rw [← diff_union_inter s u]
rw [integral_union disjoint_sdiff_inter (hs.inter u_open.measurableSet)
(h''i.mono_set diff_subset) (h''i.mono_set inter_subset_left)]
_ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := norm_add_le _ _
_ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ := add_le_add C B
@[deprecated (since := "2024-02-20")]
alias tendsto_setIntegral_peak_smul_of_integrableOn_of_continuousWithinAt_aux :=
tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux
/-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀` and its
integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
has a limit `a` at `x₀`, then `∫ φᵢ • g` converges to `a`. Version localized to a subset. -/
theorem tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto
(hs : MeasurableSet s) {t : Set α} (ht : MeasurableSet t) (hts : t ⊆ s) (h'ts : t ∈ 𝓝[s] x₀)
(h't : μ t ≠ ∞) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
(hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
(hiφ : Tendsto (fun i ↦ ∫ x in t, φ i x ∂μ) l (𝓝 1))
(h'iφ : ∀ᶠ i in l, AEStronglyMeasurable (φ i) (μ.restrict s))
(hmg : IntegrableOn g s μ) (hcg : Tendsto g (𝓝[s] x₀) (𝓝 a)) :
Tendsto (fun i : ι ↦ ∫ x in s, φ i x • g x ∂μ) l (𝓝 a) := by
let h := g - t.indicator (fun _ ↦ a)
have A : Tendsto (fun i : ι => (∫ x in s, φ i x • h x ∂μ) + (∫ x in t, φ i x ∂μ) • a) l
(𝓝 (0 + (1 : ℝ) • a)) := by
refine Tendsto.add ?_ (Tendsto.smul hiφ tendsto_const_nhds)
apply tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux hs ht hts h'ts
hnφ hlφ hiφ h'iφ
· apply hmg.sub
simp only [integrable_indicator_iff ht, integrableOn_const, ht, Measure.restrict_apply]
right
exact lt_of_le_of_lt (measure_mono inter_subset_left) (h't.lt_top)
· rw [← sub_self a]
apply Tendsto.sub hcg
apply tendsto_const_nhds.congr'
filter_upwards [h'ts] with x hx using by simp [hx]
simp only [one_smul, zero_add] at A
refine Tendsto.congr' ?_ A
filter_upwards [integrableOn_peak_smul_of_integrableOn_of_tendsto hs h'ts
hlφ hiφ h'iφ hmg hcg,
(tendsto_order.1 (tendsto_iff_norm_sub_tendsto_zero.1 hiφ)).2 1 zero_lt_one] with i hi h'i
simp only [h, Pi.sub_apply, smul_sub, ← indicator_smul_apply]
rw [integral_sub hi, setIntegral_indicator ht, inter_eq_right.mpr hts,
integral_smul_const, sub_add_cancel]
rw [integrable_indicator_iff ht]
apply Integrable.smul_const
rw [restrict_restrict ht, inter_eq_left.mpr hts]
exact .of_integral_ne_zero (fun h ↦ by simp [h] at h'i)
@[deprecated (since := "2024-02-20")]
alias tendsto_setIntegral_peak_smul_of_integrableOn_of_continuousWithinAt :=
tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto
/-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀` and its
integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
has a limit `a` at `x₀`, then `∫ φᵢ • g` converges to `a`. -/
theorem tendsto_integral_peak_smul_of_integrable_of_tendsto
{t : Set α} (ht : MeasurableSet t) (h'ts : t ∈ 𝓝 x₀)
(h't : μ t ≠ ∞) (hnφ : ∀ᶠ i in l, ∀ x, 0 ≤ φ i x)
(hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l uᶜ)
(hiφ : Tendsto (fun i ↦ ∫ x in t, φ i x ∂μ) l (𝓝 1))
(h'iφ : ∀ᶠ i in l, AEStronglyMeasurable (φ i) μ)
(hmg : Integrable g μ) (hcg : Tendsto g (𝓝 x₀) (𝓝 a)) :
Tendsto (fun i : ι ↦ ∫ x, φ i x • g x ∂μ) l (𝓝 a) := by
suffices Tendsto (fun i : ι ↦ ∫ x in univ, φ i x • g x ∂μ) l (𝓝 a) by simpa
exact tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto MeasurableSet.univ ht (x₀ := x₀)
(subset_univ _) (by simpa [nhdsWithin_univ]) h't (by simpa)
(by simpa [← compl_eq_univ_diff] using hlφ) hiφ
(by simpa) (by simpa) (by simpa [nhdsWithin_univ])
/-!
### Peak functions of the form `x ↦ (c x) ^ n / ∫ (c y) ^ n`
-/
/-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
integrable on `s` and continuous at `x₀`.
Version assuming that `μ` gives positive mass to all neighborhoods of `x₀` within `s`.
For a less precise but more usable version, see
`tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`.
-/
theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
[MetrizableSpace α] [IsLocallyFiniteMeasure μ] (hs : IsCompact s)
(hμ : ∀ u, IsOpen u → x₀ ∈ u → 0 < μ (u ∩ s)) {c : α → ℝ} (hc : ContinuousOn c s)
(h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ s)
(hmg : IntegrableOn g s μ) (hcg : ContinuousWithinAt g s x₀) :
Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ)
atTop (𝓝 (g x₀)) := by
/- We apply the general result
`tendsto_setIntegral_peak_smul_of_integrableOn_of_continuousWithinAt` to the sequence of
peak functions `φₙ = (c x) ^ n / ∫ (c x) ^ n`. The only nontrivial bit is to check that this
sequence converges uniformly to zero on any set `s \ u` away from `x₀`. By compactness, the
function `c` is bounded by `t < c x₀` there. Consider `t' ∈ (t, c x₀)`, and a neighborhood `v`
of `x₀` where `c x ≥ t'`, by continuity. Then `∫ (c x) ^ n` is bounded below by `t' ^ n μ v`.
It follows that, on `s \ u`, then `φₙ x ≤ t ^ n / (t' ^ n μ v)`,
which tends (exponentially fast) to zero with `n`. -/
let φ : ℕ → α → ℝ := fun n x => (∫ x in s, c x ^ n ∂μ)⁻¹ * c x ^ n
have hnφ : ∀ n, ∀ x ∈ s, 0 ≤ φ n x := by
intro n x hx
apply mul_nonneg (inv_nonneg.2 _) (pow_nonneg (hnc x hx) _)
exact setIntegral_nonneg hs.measurableSet fun x hx => pow_nonneg (hnc x hx) _
have I : ∀ n, IntegrableOn (fun x => c x ^ n) s μ := fun n =>
ContinuousOn.integrableOn_compact hs (hc.pow n)
have J : ∀ n, 0 ≤ᵐ[μ.restrict s] fun x : α => c x ^ n := by
intro n
filter_upwards [ae_restrict_mem hs.measurableSet] with x hx
exact pow_nonneg (hnc x hx) n
have P : ∀ n, (0 : ℝ) < ∫ x in s, c x ^ n ∂μ := by
intro n
refine (setIntegral_pos_iff_support_of_nonneg_ae (J n) (I n)).2 ?_
obtain ⟨u, u_open, x₀_u, hu⟩ : ∃ u : Set α, IsOpen u ∧ x₀ ∈ u ∧ u ∩ s ⊆ c ⁻¹' Ioi 0 :=
_root_.continuousOn_iff.1 hc x₀ h₀ (Ioi (0 : ℝ)) isOpen_Ioi hnc₀
apply (hμ u u_open x₀_u).trans_le
exact measure_mono fun x hx => ⟨ne_of_gt (pow_pos (a := c x) (hu hx) _), hx.2⟩
have hiφ : ∀ n, ∫ x in s, φ n x ∂μ = 1 := fun n => by
rw [integral_mul_left, inv_mul_cancel (P n).ne']
have A : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 atTop (s \ u) := by
intro u u_open x₀u
obtain ⟨t, t_pos, tx₀, ht⟩ : ∃ t, 0 ≤ t ∧ t < c x₀ ∧ ∀ x ∈ s \ u, c x ≤ t := by
rcases eq_empty_or_nonempty (s \ u) with (h | h)
· exact
⟨0, le_rfl, hnc₀, by simp only [h, mem_empty_iff_false, IsEmpty.forall_iff, imp_true_iff]⟩
obtain ⟨x, hx, h'x⟩ : ∃ x ∈ s \ u, ∀ y ∈ s \ u, c y ≤ c x :=
IsCompact.exists_isMaxOn (hs.diff u_open) h (hc.mono diff_subset)
refine ⟨c x, hnc x hx.1, h'c x hx.1 ?_, h'x⟩
rintro rfl
exact hx.2 x₀u
obtain ⟨t', tt', t'x₀⟩ : ∃ t', t < t' ∧ t' < c x₀ := exists_between tx₀
have t'_pos : 0 < t' := t_pos.trans_lt tt'
obtain ⟨v, v_open, x₀_v, hv⟩ : ∃ v : Set α, IsOpen v ∧ x₀ ∈ v ∧ v ∩ s ⊆ c ⁻¹' Ioi t' :=
_root_.continuousOn_iff.1 hc x₀ h₀ (Ioi t') isOpen_Ioi t'x₀
have M : ∀ n, ∀ x ∈ s \ u, φ n x ≤ (μ (v ∩ s)).toReal⁻¹ * (t / t') ^ n := by
intro n x hx
have B : t' ^ n * (μ (v ∩ s)).toReal ≤ ∫ y in s, c y ^ n ∂μ :=
calc
t' ^ n * (μ (v ∩ s)).toReal = ∫ _ in v ∩ s, t' ^ n ∂μ := by
simp only [integral_const, Measure.restrict_apply, MeasurableSet.univ, univ_inter,
Algebra.id.smul_eq_mul, mul_comm]
_ ≤ ∫ y in v ∩ s, c y ^ n ∂μ := by
apply setIntegral_mono_on _ _ (v_open.measurableSet.inter hs.measurableSet) _
· apply integrableOn_const.2 (Or.inr _)
exact lt_of_le_of_lt (measure_mono inter_subset_right) hs.measure_lt_top
· exact (I n).mono inter_subset_right le_rfl
· intro x hx
exact pow_le_pow_left t'_pos.le (le_of_lt (hv hx)) _
_ ≤ ∫ y in s, c y ^ n ∂μ :=
setIntegral_mono_set (I n) (J n) (eventually_of_forall inter_subset_right)
simp_rw [φ, ← div_eq_inv_mul, div_pow, div_div]
apply div_le_div (pow_nonneg t_pos n) _ _ B
· exact pow_le_pow_left (hnc _ hx.1) (ht x hx) _
· apply mul_pos (pow_pos (t_pos.trans_lt tt') _) (ENNReal.toReal_pos (hμ v v_open x₀_v).ne' _)
have : μ (v ∩ s) ≤ μ s := measure_mono inter_subset_right
exact ne_of_lt (lt_of_le_of_lt this hs.measure_lt_top)
have N :
Tendsto (fun n => (μ (v ∩ s)).toReal⁻¹ * (t / t') ^ n) atTop
(𝓝 ((μ (v ∩ s)).toReal⁻¹ * 0)) := by
apply Tendsto.mul tendsto_const_nhds _
apply tendsto_pow_atTop_nhds_zero_of_lt_one (div_nonneg t_pos t'_pos.le)
exact (div_lt_one t'_pos).2 tt'
rw [mul_zero] at N
refine tendstoUniformlyOn_iff.2 fun ε εpos => ?_
filter_upwards [(tendsto_order.1 N).2 ε εpos] with n hn x hx
simp only [Pi.zero_apply, dist_zero_left, Real.norm_of_nonneg (hnφ n x hx.1)]
exact (M n x hx).trans_lt hn
have : Tendsto (fun i : ℕ => ∫ x : α in s, φ i x • g x ∂μ) atTop (𝓝 (g x₀)) := by
have B : Tendsto (fun i ↦ ∫ (x : α) in s, φ i x ∂μ) atTop (𝓝 1) :=
tendsto_const_nhds.congr (fun n ↦ (hiφ n).symm)
have C : ∀ᶠ (i : ℕ) in atTop, AEStronglyMeasurable (fun x ↦ φ i x) (μ.restrict s) := by
apply eventually_of_forall (fun n ↦ ((I n).const_mul _).aestronglyMeasurable)
exact tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto hs.measurableSet
hs.measurableSet (Subset.rfl) (self_mem_nhdsWithin)
hs.measure_lt_top.ne (eventually_of_forall hnφ) A B C hmg hcg
convert this
simp_rw [φ, ← smul_smul, integral_smul]
/-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
integrable on `s` and continuous at `x₀`.
Version assuming that `μ` gives positive mass to all open sets.
For a less precise but more usable version, see
`tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`.
-/
theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
[MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
{c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
(hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
(hmg : IntegrableOn g s μ) (hcg : ContinuousWithinAt g s x₀) :
Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop
(𝓝 (g x₀)) := by
have : x₀ ∈ s := by rw [← hs.isClosed.closure_eq]; exact closure_mono interior_subset h₀
apply
tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos hs _ hc
h'c hnc hnc₀ this hmg hcg
intro u u_open x₀_u
calc
0 < μ (u ∩ interior s) :=
(u_open.inter isOpen_interior).measure_pos μ (_root_.mem_closure_iff.1 h₀ u u_open x₀_u)
_ ≤ μ (u ∩ s) := by gcongr; apply interior_subset
/-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
continuous on `s`. -/
theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
[MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
{c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
(hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
(hmg : ContinuousOn g s) :
Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
haveI : x₀ ∈ s := by rw [← hs.isClosed.closure_eq]; exact closure_mono interior_subset h₀
tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn hs hc h'c hnc hnc₀ h₀
(hmg.integrableOn_compact hs) (hmg x₀ this)
/-!
### Peak functions of the form `x ↦ c ^ dim * φ (c x)`
-/
open FiniteDimensional Bornology
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F]
[MeasurableSpace F] [BorelSpace F] {μ : Measure F} [IsAddHaarMeasure μ]
/-- Consider a nonnegative function `φ` with integral one, decaying quickly enough at infinity.
Then suitable renormalizations of `φ` form a sequence of peak functions around the origin:
`∫ (c ^ d * φ (c • x)) • g x` converges to `g 0` as `c → ∞` if `g` is continuous at `0`
and integrable. -/
theorem tendsto_integral_comp_smul_smul_of_integrable
{φ : F → ℝ} (hφ : ∀ x, 0 ≤ φ x) (h'φ : ∫ x, φ x ∂μ = 1)
(h : Tendsto (fun x ↦ ‖x‖ ^ finrank ℝ F * φ x) (cobounded F) (𝓝 0))
{g : F → E} (hg : Integrable g μ) (h'g : ContinuousAt g 0) :
Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • x)) • g x ∂μ) atTop (𝓝 (g 0)) := by
have I : Integrable φ μ := integrable_of_integral_eq_one h'φ
apply tendsto_integral_peak_smul_of_integrable_of_tendsto (t := closedBall 0 1) (x₀ := 0)
· exact isClosed_ball.measurableSet
· exact closedBall_mem_nhds _ zero_lt_one
· exact (isCompact_closedBall 0 1).measure_ne_top
· filter_upwards [Ici_mem_atTop 0] with c (hc : 0 ≤ c) x using mul_nonneg (by positivity) (hφ _)
· intro u u_open hu
apply tendstoUniformlyOn_iff.2 (fun ε εpos ↦ ?_)
obtain ⟨δ, δpos, h'u⟩ : ∃ δ > 0, ball 0 δ ⊆ u := Metric.isOpen_iff.1 u_open _ hu
obtain ⟨M, Mpos, hM⟩ : ∃ M > 0, ∀ ⦃x : F⦄, x ∈ (closedBall 0 M)ᶜ →
‖x‖ ^ finrank ℝ F * φ x < δ ^ finrank ℝ F * ε := by
rcases (hasBasis_cobounded_compl_closedBall (0 : F)).eventually_iff.1
((tendsto_order.1 h).2 (δ ^ finrank ℝ F * ε) (by positivity)) with ⟨M, -, hM⟩
refine ⟨max M 1, zero_lt_one.trans_le (le_max_right _ _), fun x hx ↦ hM ?_⟩
simp only [mem_compl_iff, mem_closedBall, dist_zero_right, le_max_iff, not_or, not_le] at hx
simpa using hx.1
filter_upwards [Ioi_mem_atTop (M / δ)] with c (hc : M / δ < c) x hx
have cpos : 0 < c := lt_trans (by positivity) hc
suffices c ^ finrank ℝ F * φ (c • x) < ε by simpa [abs_of_nonneg (hφ _), abs_of_nonneg cpos.le]
have hδx : δ ≤ ‖x‖ := by
have : x ∈ (ball 0 δ)ᶜ := fun h ↦ hx (h'u h)
simpa only [mem_compl_iff, mem_ball, dist_zero_right, not_lt]
suffices δ ^ finrank ℝ F * (c ^ finrank ℝ F * φ (c • x)) < δ ^ finrank ℝ F * ε by
rwa [mul_lt_mul_iff_of_pos_left (by positivity)] at this
calc
δ ^ finrank ℝ F * (c ^ finrank ℝ F * φ (c • x))
_ ≤ ‖x‖ ^ finrank ℝ F * (c ^ finrank ℝ F * φ (c • x)) := by
gcongr; exact mul_nonneg (by positivity) (hφ _)
_ = ‖c • x‖ ^ finrank ℝ F * φ (c • x) := by
simp [norm_smul, abs_of_pos cpos, mul_pow]; ring
_ < δ ^ finrank ℝ F * ε := by
apply hM
rw [div_lt_iff δpos] at hc
simp only [mem_compl_iff, mem_closedBall, dist_zero_right, norm_smul, Real.norm_eq_abs,
abs_of_nonneg cpos.le, not_le, gt_iff_lt]
exact hc.trans_le (by gcongr)
· have : Tendsto (fun c ↦ ∫ (x : F) in closedBall 0 c, φ x ∂μ) atTop (𝓝 1) := by
rw [← h'φ]
exact (aecover_closedBall tendsto_id).integral_tendsto_of_countably_generated I
apply this.congr'
filter_upwards [Ioi_mem_atTop 0] with c (hc : 0 < c)
rw [integral_mul_left, setIntegral_comp_smul_of_pos _ _ _ hc, smul_eq_mul, ← mul_assoc,
mul_inv_cancel (by positivity), _root_.smul_closedBall _ _ zero_le_one]
simp [abs_of_nonneg hc.le]
· filter_upwards [Ioi_mem_atTop 0] with c (hc : 0 < c)
exact (I.comp_smul hc.ne').aestronglyMeasurable.const_mul _
· exact hg
· exact h'g
/-- Consider a nonnegative function `φ` with integral one, decaying quickly enough at infinity.
Then suitable renormalizations of `φ` form a sequence of peak functions around any point:
`∫ (c ^ d * φ (c • (x₀ - x)) • g x` converges to `g x₀` as `c → ∞` if `g` is continuous at `x₀`
and integrable. -/
theorem tendsto_integral_comp_smul_smul_of_integrable'
{φ : F → ℝ} (hφ : ∀ x, 0 ≤ φ x) (h'φ : ∫ x, φ x ∂μ = 1)
(h : Tendsto (fun x ↦ ‖x‖ ^ finrank ℝ F * φ x) (cobounded F) (𝓝 0))
{g : F → E} {x₀ : F} (hg : Integrable g μ) (h'g : ContinuousAt g x₀) :
Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • (x₀ - x))) • g x ∂μ)
atTop (𝓝 (g x₀)) := by
let f := fun x ↦ g (x₀ - x)
have If : Integrable f μ := by simpa [f, sub_eq_add_neg] using (hg.comp_add_left x₀).comp_neg
have : Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • x)) • f x ∂μ)
atTop (𝓝 (f 0)) := by
apply tendsto_integral_comp_smul_smul_of_integrable hφ h'φ h If
have A : ContinuousAt g (x₀ - 0) := by simpa using h'g
exact A.comp <| by fun_prop
simp only [f, sub_zero] at this
convert this using 2 with c
conv_rhs => rw [← integral_add_left_eq_self x₀ (μ := μ)
(f := fun x ↦ (c ^ finrank ℝ F * φ (c • x)) • g (x₀ - x)), ← integral_neg_eq_self]
simp [smul_sub, sub_eq_add_neg]
|
MeasureTheory\Integral\Periodic.lean | /-
Copyright (c) 2021 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov, Alex Kontorovich, Heather Macbeth
-/
import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
import Mathlib.MeasureTheory.Measure.Haar.Quotient
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.Topology.Algebra.Order.Floor
/-!
# Integrals of periodic functions
In this file we prove that the half-open interval `Ioc t (t + T)` in `ℝ` is a fundamental domain of
the action of the subgroup `ℤ ∙ T` on `ℝ`.
A consequence is `AddCircle.measurePreserving_mk`: the covering map from `ℝ` to the "additive
circle" `ℝ ⧸ (ℤ ∙ T)` is measure-preserving, with respect to the restriction of Lebesgue measure to
`Ioc t (t + T)` (upstairs) and with respect to Haar measure (downstairs).
Another consequence (`Function.Periodic.intervalIntegral_add_eq` and related declarations) is that
`∫ x in t..t + T, f x = ∫ x in s..s + T, f x` for any (not necessarily measurable) function with
period `T`.
-/
open Set Function MeasureTheory MeasureTheory.Measure TopologicalSpace AddSubgroup intervalIntegral
open scoped MeasureTheory NNReal ENNReal
@[measurability]
protected theorem AddCircle.measurable_mk' {a : ℝ} :
Measurable (β := AddCircle a) ((↑) : ℝ → AddCircle a) :=
Continuous.measurable <| AddCircle.continuous_mk' a
theorem isAddFundamentalDomain_Ioc {T : ℝ} (hT : 0 < T) (t : ℝ)
(μ : Measure ℝ := by volume_tac) :
IsAddFundamentalDomain (AddSubgroup.zmultiples T) (Ioc t (t + T)) μ := by
refine IsAddFundamentalDomain.mk' measurableSet_Ioc.nullMeasurableSet fun x => ?_
have : Bijective (codRestrict (fun n : ℤ => n • T) (AddSubgroup.zmultiples T) _) :=
(Equiv.ofInjective (fun n : ℤ => n • T) (zsmul_strictMono_left hT).injective).bijective
refine this.existsUnique_iff.2 ?_
simpa only [add_comm x] using existsUnique_add_zsmul_mem_Ioc hT x t
theorem isAddFundamentalDomain_Ioc' {T : ℝ} (hT : 0 < T) (t : ℝ) (μ : Measure ℝ := by volume_tac) :
IsAddFundamentalDomain (AddSubgroup.op <| .zmultiples T) (Ioc t (t + T)) μ := by
refine IsAddFundamentalDomain.mk' measurableSet_Ioc.nullMeasurableSet fun x => ?_
have : Bijective (codRestrict (fun n : ℤ => n • T) (AddSubgroup.zmultiples T) _) :=
(Equiv.ofInjective (fun n : ℤ => n • T) (zsmul_strictMono_left hT).injective).bijective
refine (AddSubgroup.equivOp _).bijective.comp this |>.existsUnique_iff.2 ?_
simpa using existsUnique_add_zsmul_mem_Ioc hT x t
namespace AddCircle
variable (T : ℝ) [hT : Fact (0 < T)]
/-- Equip the "additive circle" `ℝ ⧸ (ℤ ∙ T)` with, as a standard measure, the Haar measure of total
mass `T` -/
noncomputable instance measureSpace : MeasureSpace (AddCircle T) :=
{ QuotientAddGroup.measurableSpace _ with volume := ENNReal.ofReal T • addHaarMeasure ⊤ }
@[simp]
protected theorem measure_univ : volume (Set.univ : Set (AddCircle T)) = ENNReal.ofReal T := by
dsimp [volume]
rw [← PositiveCompacts.coe_top]
simp [addHaarMeasure_self (G := AddCircle T), -PositiveCompacts.coe_top]
instance : IsAddHaarMeasure (volume : Measure (AddCircle T)) :=
IsAddHaarMeasure.smul _ (by simp [hT.out]) ENNReal.ofReal_ne_top
instance isFiniteMeasure : IsFiniteMeasure (volume : Measure (AddCircle T)) where
measure_univ_lt_top := by simp
instance : HasAddFundamentalDomain (AddSubgroup.op <| .zmultiples T) ℝ where
ExistsIsAddFundamentalDomain := ⟨Ioc 0 (0 + T), isAddFundamentalDomain_Ioc' Fact.out 0⟩
instance : AddQuotientMeasureEqMeasurePreimage volume (volume : Measure (AddCircle T)) := by
apply MeasureTheory.leftInvariantIsAddQuotientMeasureEqMeasurePreimage
simp [(isAddFundamentalDomain_Ioc' hT.out 0).covolume_eq_volume, AddCircle.measure_univ]
/-- The covering map from `ℝ` to the "additive circle" `ℝ ⧸ (ℤ ∙ T)` is measure-preserving,
considered with respect to the standard measure (defined to be the Haar measure of total mass `T`)
on the additive circle, and with respect to the restriction of Lebsegue measure on `ℝ` to an
interval (t, t + T]. -/
protected theorem measurePreserving_mk (t : ℝ) :
MeasurePreserving (β := AddCircle T) ((↑) : ℝ → AddCircle T)
(volume.restrict (Ioc t (t + T))) :=
measurePreserving_quotientAddGroup_mk_of_AddQuotientMeasureEqMeasurePreimage
volume (𝓕 := Ioc t (t+T)) (isAddFundamentalDomain_Ioc' hT.out _) _
lemma add_projection_respects_measure (t : ℝ) {U : Set (AddCircle T)} (meas_U : MeasurableSet U) :
volume U = volume (QuotientAddGroup.mk ⁻¹' U ∩ (Ioc t (t + T))) :=
(isAddFundamentalDomain_Ioc' hT.out _).addProjection_respects_measure_apply
(volume : Measure (AddCircle T)) meas_U
theorem volume_closedBall {x : AddCircle T} (ε : ℝ) :
volume (Metric.closedBall x ε) = ENNReal.ofReal (min T (2 * ε)) := by
have hT' : |T| = T := abs_eq_self.mpr hT.out.le
let I := Ioc (-(T / 2)) (T / 2)
have h₁ : ε < T / 2 → Metric.closedBall (0 : ℝ) ε ∩ I = Metric.closedBall (0 : ℝ) ε := by
intro hε
rw [inter_eq_left, Real.closedBall_eq_Icc, zero_sub, zero_add]
rintro y ⟨hy₁, hy₂⟩; constructor <;> linarith
have h₂ : (↑) ⁻¹' Metric.closedBall (0 : AddCircle T) ε ∩ I =
if ε < T / 2 then Metric.closedBall (0 : ℝ) ε else I := by
conv_rhs => rw [← if_ctx_congr (Iff.rfl : ε < T / 2 ↔ ε < T / 2) h₁ fun _ => rfl, ← hT']
apply coe_real_preimage_closedBall_inter_eq
simpa only [hT', Real.closedBall_eq_Icc, zero_add, zero_sub] using Ioc_subset_Icc_self
rw [addHaar_closedBall_center, add_projection_respects_measure T (-(T/2))
measurableSet_closedBall, (by linarith : -(T / 2) + T = T / 2), h₂]
by_cases hε : ε < T / 2
· simp [hε, min_eq_right (by linarith : 2 * ε ≤ T)]
· simp [I, hε, min_eq_left (by linarith : T ≤ 2 * ε)]
instance : IsUnifLocDoublingMeasure (volume : Measure (AddCircle T)) := by
refine ⟨⟨Real.toNNReal 2, Filter.eventually_of_forall fun ε x => ?_⟩⟩
simp only [volume_closedBall]
erw [← ENNReal.ofReal_mul zero_le_two]
apply ENNReal.ofReal_le_ofReal
rw [mul_min_of_nonneg _ _ (zero_le_two : (0 : ℝ) ≤ 2)]
exact min_le_min (by linarith [hT.out]) (le_refl _)
/-- The isomorphism `AddCircle T ≃ Ioc a (a + T)` whose inverse is the natural quotient map,
as an equivalence of measurable spaces. -/
noncomputable def measurableEquivIoc (a : ℝ) : AddCircle T ≃ᵐ Ioc a (a + T) where
toEquiv := equivIoc T a
measurable_toFun := measurable_of_measurable_on_compl_singleton _
(continuousOn_iff_continuous_restrict.mp <| ContinuousAt.continuousOn fun _x hx =>
continuousAt_equivIoc T a hx).measurable
measurable_invFun := AddCircle.measurable_mk'.comp measurable_subtype_coe
/-- The isomorphism `AddCircle T ≃ Ico a (a + T)` whose inverse is the natural quotient map,
as an equivalence of measurable spaces. -/
noncomputable def measurableEquivIco (a : ℝ) : AddCircle T ≃ᵐ Ico a (a + T) where
toEquiv := equivIco T a
measurable_toFun := measurable_of_measurable_on_compl_singleton _
(continuousOn_iff_continuous_restrict.mp <| ContinuousAt.continuousOn fun _x hx =>
continuousAt_equivIco T a hx).measurable
measurable_invFun := AddCircle.measurable_mk'.comp measurable_subtype_coe
attribute [local instance] Subtype.measureSpace in
/-- The lower integral of a function over `AddCircle T` is equal to the lower integral over an
interval (t, t + T] in `ℝ` of its lift to `ℝ`. -/
protected theorem lintegral_preimage (t : ℝ) (f : AddCircle T → ℝ≥0∞) :
(∫⁻ a in Ioc t (t + T), f a) = ∫⁻ b : AddCircle T, f b := by
have m : MeasurableSet (Ioc t (t + T)) := measurableSet_Ioc
have := lintegral_map_equiv (μ := volume) f (measurableEquivIoc T t).symm
simp only [measurableEquivIoc, equivIoc, QuotientAddGroup.equivIocMod, MeasurableEquiv.symm_mk,
MeasurableEquiv.coe_mk, Equiv.coe_fn_symm_mk] at this
rw [← (AddCircle.measurePreserving_mk T t).map_eq]
convert this.symm using 1
· rw [← map_comap_subtype_coe m _]
exact MeasurableEmbedding.lintegral_map (MeasurableEmbedding.subtype_coe m) _
· congr 1
have : ((↑) : Ioc t (t + T) → AddCircle T) = ((↑) : ℝ → AddCircle T) ∘ ((↑) : _ → ℝ) := by
ext1 x; rfl
simp_rw [this]
rw [← map_map AddCircle.measurable_mk' measurable_subtype_coe, ← map_comap_subtype_coe m]
rfl
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
attribute [local instance] Subtype.measureSpace in
/-- The integral of an almost-everywhere strongly measurable function over `AddCircle T` is equal
to the integral over an interval (t, t + T] in `ℝ` of its lift to `ℝ`. -/
protected theorem integral_preimage (t : ℝ) (f : AddCircle T → E) :
(∫ a in Ioc t (t + T), f a) = ∫ b : AddCircle T, f b := by
have m : MeasurableSet (Ioc t (t + T)) := measurableSet_Ioc
have := integral_map_equiv (μ := volume) (measurableEquivIoc T t).symm f
simp only [measurableEquivIoc, equivIoc, QuotientAddGroup.equivIocMod, MeasurableEquiv.symm_mk,
MeasurableEquiv.coe_mk, Equiv.coe_fn_symm_mk] at this
rw [← (AddCircle.measurePreserving_mk T t).map_eq, ← integral_subtype m, ← this]
have : ((↑) : Ioc t (t + T) → AddCircle T) = ((↑) : ℝ → AddCircle T) ∘ ((↑) : _ → ℝ) := by
ext1 x; rfl
simp_rw [this]
rw [← map_map AddCircle.measurable_mk' measurable_subtype_coe, ← map_comap_subtype_coe m]
rfl
/-- The integral of an almost-everywhere strongly measurable function over `AddCircle T` is equal
to the integral over an interval (t, t + T] in `ℝ` of its lift to `ℝ`. -/
protected theorem intervalIntegral_preimage (t : ℝ) (f : AddCircle T → E) :
∫ a in t..t + T, f a = ∫ b : AddCircle T, f b := by
rw [integral_of_le, AddCircle.integral_preimage T t f]
linarith [hT.out]
end AddCircle
namespace UnitAddCircle
attribute [local instance] Real.fact_zero_lt_one
protected theorem measure_univ : volume (Set.univ : Set UnitAddCircle) = 1 := by simp
/-- The covering map from `ℝ` to the "unit additive circle" `ℝ ⧸ ℤ` is measure-preserving,
considered with respect to the standard measure (defined to be the Haar measure of total mass 1)
on the additive circle, and with respect to the restriction of Lebsegue measure on `ℝ` to an
interval (t, t + 1]. -/
protected theorem measurePreserving_mk (t : ℝ) :
MeasurePreserving (β := UnitAddCircle) ((↑) : ℝ → UnitAddCircle)
(volume.restrict (Ioc t (t + 1))) :=
AddCircle.measurePreserving_mk 1 t
/-- The integral of a measurable function over `UnitAddCircle` is equal to the integral over an
interval (t, t + 1] in `ℝ` of its lift to `ℝ`. -/
protected theorem lintegral_preimage (t : ℝ) (f : UnitAddCircle → ℝ≥0∞) :
(∫⁻ a in Ioc t (t + 1), f a) = ∫⁻ b : UnitAddCircle, f b :=
AddCircle.lintegral_preimage 1 t f
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
/-- The integral of an almost-everywhere strongly measurable function over `UnitAddCircle` is
equal to the integral over an interval (t, t + 1] in `ℝ` of its lift to `ℝ`. -/
protected theorem integral_preimage (t : ℝ) (f : UnitAddCircle → E) :
(∫ a in Ioc t (t + 1), f a) = ∫ b : UnitAddCircle, f b :=
AddCircle.integral_preimage 1 t f
/-- The integral of an almost-everywhere strongly measurable function over `UnitAddCircle` is
equal to the integral over an interval (t, t + 1] in `ℝ` of its lift to `ℝ`. -/
protected theorem intervalIntegral_preimage (t : ℝ) (f : UnitAddCircle → E) :
∫ a in t..t + 1, f a = ∫ b : UnitAddCircle, f b :=
AddCircle.intervalIntegral_preimage 1 t f
end UnitAddCircle
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
namespace Function
namespace Periodic
variable {f : ℝ → E} {T : ℝ}
/-- An auxiliary lemma for a more general `Function.Periodic.intervalIntegral_add_eq`. -/
theorem intervalIntegral_add_eq_of_pos (hf : Periodic f T) (hT : 0 < T) (t s : ℝ) :
∫ x in t..t + T, f x = ∫ x in s..s + T, f x := by
simp only [integral_of_le, hT.le, le_add_iff_nonneg_right]
haveI : VAddInvariantMeasure (AddSubgroup.zmultiples T) ℝ volume :=
⟨fun c s _ => measure_preimage_add _ _ _⟩
apply IsAddFundamentalDomain.setIntegral_eq (G := AddSubgroup.zmultiples T)
exacts [isAddFundamentalDomain_Ioc hT t, isAddFundamentalDomain_Ioc hT s, hf.map_vadd_zmultiples]
/-- If `f` is a periodic function with period `T`, then its integral over `[t, t + T]` does not
depend on `t`. -/
theorem intervalIntegral_add_eq (hf : Periodic f T) (t s : ℝ) :
∫ x in t..t + T, f x = ∫ x in s..s + T, f x := by
rcases lt_trichotomy (0 : ℝ) T with (hT | rfl | hT)
· exact hf.intervalIntegral_add_eq_of_pos hT t s
· simp
· rw [← neg_inj, ← integral_symm, ← integral_symm]
simpa only [← sub_eq_add_neg, add_sub_cancel_right] using
hf.neg.intervalIntegral_add_eq_of_pos (neg_pos.2 hT) (t + T) (s + T)
/-- If `f` is an integrable periodic function with period `T`, then its integral over `[t, s + T]`
is the sum of its integrals over the intervals `[t, s]` and `[t, t + T]`. -/
theorem intervalIntegral_add_eq_add (hf : Periodic f T) (t s : ℝ)
(h_int : ∀ t₁ t₂, IntervalIntegrable f MeasureSpace.volume t₁ t₂) :
∫ x in t..s + T, f x = (∫ x in t..s, f x) + ∫ x in t..t + T, f x := by
rw [hf.intervalIntegral_add_eq t s, integral_add_adjacent_intervals (h_int t s) (h_int s _)]
/-- If `f` is an integrable periodic function with period `T`, and `n` is an integer, then its
integral over `[t, t + n • T]` is `n` times its integral over `[t, t + T]`. -/
theorem intervalIntegral_add_zsmul_eq (hf : Periodic f T) (n : ℤ) (t : ℝ)
(h_int : ∀ t₁ t₂, IntervalIntegrable f MeasureSpace.volume t₁ t₂) :
∫ x in t..t + n • T, f x = n • ∫ x in t..t + T, f x := by
-- Reduce to the case `b = 0`
suffices (∫ x in (0)..(n • T), f x) = n • ∫ x in (0)..T, f x by
simp only [hf.intervalIntegral_add_eq t 0, (hf.zsmul n).intervalIntegral_add_eq t 0, zero_add,
this]
-- First prove it for natural numbers
have : ∀ m : ℕ, (∫ x in (0)..m • T, f x) = m • ∫ x in (0)..T, f x := fun m ↦ by
induction' m with m ih
· simp
· simp only [succ_nsmul, hf.intervalIntegral_add_eq_add 0 (m • T) h_int, ih, zero_add]
-- Then prove it for all integers
cases' n with n n
· simp [← this n]
· conv_rhs => rw [negSucc_zsmul]
have h₀ : Int.negSucc n • T + (n + 1) • T = 0 := by simp; linarith
rw [integral_symm, ← (hf.nsmul (n + 1)).funext, neg_inj]
simp_rw [integral_comp_add_right, h₀, zero_add, this (n + 1), add_comm T,
hf.intervalIntegral_add_eq ((n + 1) • T) 0, zero_add]
section RealValued
open Filter
variable {g : ℝ → ℝ}
variable (hg : Periodic g T) (h_int : ∀ t₁ t₂, IntervalIntegrable g MeasureSpace.volume t₁ t₂)
/-- If `g : ℝ → ℝ` is periodic with period `T > 0`, then for any `t : ℝ`, the function
`t ↦ ∫ x in 0..t, g x` is bounded below by `t ↦ X + ⌊t/T⌋ • Y` for appropriate constants `X` and
`Y`. -/
theorem sInf_add_zsmul_le_integral_of_pos (hT : 0 < T) (t : ℝ) :
(sInf ((fun t => ∫ x in (0)..t, g x) '' Icc 0 T) + ⌊t / T⌋ • ∫ x in (0)..T, g x) ≤
∫ x in (0)..t, g x := by
let ε := Int.fract (t / T) * T
conv_rhs =>
rw [← Int.fract_div_mul_self_add_zsmul_eq T t (by linarith), ←
integral_add_adjacent_intervals (h_int 0 ε) (h_int _ _)]
rw [hg.intervalIntegral_add_zsmul_eq ⌊t / T⌋ ε h_int, hg.intervalIntegral_add_eq ε 0, zero_add,
add_le_add_iff_right]
exact (continuous_primitive h_int 0).continuousOn.sInf_image_Icc_le <|
mem_Icc_of_Ico (Int.fract_div_mul_self_mem_Ico T t hT)
/-- If `g : ℝ → ℝ` is periodic with period `T > 0`, then for any `t : ℝ`, the function
`t ↦ ∫ x in 0..t, g x` is bounded above by `t ↦ X + ⌊t/T⌋ • Y` for appropriate constants `X` and
`Y`. -/
theorem integral_le_sSup_add_zsmul_of_pos (hT : 0 < T) (t : ℝ) :
(∫ x in (0)..t, g x) ≤
sSup ((fun t => ∫ x in (0)..t, g x) '' Icc 0 T) + ⌊t / T⌋ • ∫ x in (0)..T, g x := by
let ε := Int.fract (t / T) * T
conv_lhs =>
rw [← Int.fract_div_mul_self_add_zsmul_eq T t (by linarith), ←
integral_add_adjacent_intervals (h_int 0 ε) (h_int _ _)]
rw [hg.intervalIntegral_add_zsmul_eq ⌊t / T⌋ ε h_int, hg.intervalIntegral_add_eq ε 0, zero_add,
add_le_add_iff_right]
exact (continuous_primitive h_int 0).continuousOn.le_sSup_image_Icc
(mem_Icc_of_Ico (Int.fract_div_mul_self_mem_Ico T t hT))
/-- If `g : ℝ → ℝ` is periodic with period `T > 0` and `0 < ∫ x in 0..T, g x`, then
`t ↦ ∫ x in 0..t, g x` tends to `∞` as `t` tends to `∞`. -/
theorem tendsto_atTop_intervalIntegral_of_pos (h₀ : 0 < ∫ x in (0)..T, g x) (hT : 0 < T) :
Tendsto (fun t => ∫ x in (0)..t, g x) atTop atTop := by
apply tendsto_atTop_mono (hg.sInf_add_zsmul_le_integral_of_pos h_int hT)
apply atTop.tendsto_atTop_add_const_left (sInf <| (fun t => ∫ x in (0)..t, g x) '' Icc 0 T)
apply Tendsto.atTop_zsmul_const h₀
exact tendsto_floor_atTop.comp (tendsto_id.atTop_mul_const (inv_pos.mpr hT))
/-- If `g : ℝ → ℝ` is periodic with period `T > 0` and `0 < ∫ x in 0..T, g x`, then
`t ↦ ∫ x in 0..t, g x` tends to `-∞` as `t` tends to `-∞`. -/
theorem tendsto_atBot_intervalIntegral_of_pos (h₀ : 0 < ∫ x in (0)..T, g x) (hT : 0 < T) :
Tendsto (fun t => ∫ x in (0)..t, g x) atBot atBot := by
apply tendsto_atBot_mono (hg.integral_le_sSup_add_zsmul_of_pos h_int hT)
apply atBot.tendsto_atBot_add_const_left (sSup <| (fun t => ∫ x in (0)..t, g x) '' Icc 0 T)
apply Tendsto.atBot_zsmul_const h₀
exact tendsto_floor_atBot.comp (tendsto_id.atBot_mul_const (inv_pos.mpr hT))
/-- If `g : ℝ → ℝ` is periodic with period `T > 0` and `∀ x, 0 < g x`, then `t ↦ ∫ x in 0..t, g x`
tends to `∞` as `t` tends to `∞`. -/
theorem tendsto_atTop_intervalIntegral_of_pos' (h₀ : ∀ x, 0 < g x) (hT : 0 < T) :
Tendsto (fun t => ∫ x in (0)..t, g x) atTop atTop :=
hg.tendsto_atTop_intervalIntegral_of_pos h_int (intervalIntegral_pos_of_pos (h_int 0 T) h₀ hT) hT
/-- If `g : ℝ → ℝ` is periodic with period `T > 0` and `∀ x, 0 < g x`, then `t ↦ ∫ x in 0..t, g x`
tends to `-∞` as `t` tends to `-∞`. -/
theorem tendsto_atBot_intervalIntegral_of_pos' (h₀ : ∀ x, 0 < g x) (hT : 0 < T) :
Tendsto (fun t => ∫ x in (0)..t, g x) atBot atBot :=
hg.tendsto_atBot_intervalIntegral_of_pos h_int (intervalIntegral_pos_of_pos (h_int 0 T) h₀ hT) hT
end RealValued
end Periodic
end Function
|
MeasureTheory\Integral\Pi.lean | /-
Copyright (c) 2023 Xavier Roblot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Xavier Roblot
-/
import Mathlib.MeasureTheory.Constructions.Pi
import Mathlib.MeasureTheory.Constructions.Prod.Integral
/-!
# Integration with respect to a finite product of measures
On a finite product of measure spaces, we show that a product of integrable functions each
depending on a single coordinate is integrable, in `MeasureTheory.integrable_fintype_prod`, and
that its integral is the product of the individual integrals,
in `MeasureTheory.integral_fintype_prod_eq_prod`.
-/
open Fintype MeasureTheory MeasureTheory.Measure
variable {𝕜 : Type*} [RCLike 𝕜]
namespace MeasureTheory
/-- On a finite product space in `n` variables, for a natural number `n`, a product of integrable
functions depending on each coordinate is integrable. -/
theorem Integrable.fin_nat_prod {n : ℕ} {E : Fin n → Type*}
[∀ i, MeasureSpace (E i)] [∀ i, SigmaFinite (volume : Measure (E i))]
{f : (i : Fin n) → E i → 𝕜} (hf : ∀ i, Integrable (f i)) :
Integrable (fun (x : (i : Fin n) → E i) ↦ ∏ i, f i (x i)) := by
induction n with
| zero => simp only [Nat.zero_eq, Finset.univ_eq_empty, Finset.prod_empty, volume_pi,
integrable_const_iff, one_ne_zero, pi_empty_univ, ENNReal.one_lt_top, or_true]
| succ n n_ih =>
have := ((measurePreserving_piFinSuccAbove (fun i => (volume : Measure (E i))) 0).symm)
rw [volume_pi, ← this.integrable_comp_emb (MeasurableEquiv.measurableEmbedding _)]
simp_rw [MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.prod_univ_succ, Fin.insertNth_zero]
simp only [Fin.zero_succAbove, cast_eq, Function.comp_def, Fin.cons_zero, Fin.cons_succ]
have : Integrable (fun (x : (j : Fin n) → E (Fin.succ j)) ↦ ∏ j, f (Fin.succ j) (x j)) :=
n_ih (fun i ↦ hf _)
exact Integrable.prod_mul (hf 0) this
/-- On a finite product space, a product of integrable functions depending on each coordinate is
integrable. Version with dependent target. -/
theorem Integrable.fintype_prod_dep {ι : Type*} [Fintype ι] {E : ι → Type*}
{f : (i : ι) → E i → 𝕜} [∀ i, MeasureSpace (E i)] [∀ i, SigmaFinite (volume : Measure (E i))]
(hf : ∀ i, Integrable (f i)) :
Integrable (fun (x : (i : ι) → E i) ↦ ∏ i, f i (x i)) := by
let e := (equivFin ι).symm
simp_rw [← (volume_measurePreserving_piCongrLeft _ e).integrable_comp_emb
(MeasurableEquiv.measurableEmbedding _),
← e.prod_comp, MeasurableEquiv.coe_piCongrLeft, Function.comp_def,
Equiv.piCongrLeft_apply_apply]
exact .fin_nat_prod (fun i ↦ hf _)
/-- On a finite product space, a product of integrable functions depending on each coordinate is
integrable. -/
theorem Integrable.fintype_prod {ι : Type*} [Fintype ι] {E : Type*}
{f : ι → E → 𝕜} [MeasureSpace E] [SigmaFinite (volume : Measure E)]
(hf : ∀ i, Integrable (f i)) :
Integrable (fun (x : ι → E) ↦ ∏ i, f i (x i)) :=
Integrable.fintype_prod_dep hf
/-- A version of **Fubini's theorem** in `n` variables, for a natural number `n`. -/
theorem integral_fin_nat_prod_eq_prod {n : ℕ} {E : Fin n → Type*}
[∀ i, MeasureSpace (E i)] [∀ i, SigmaFinite (volume : Measure (E i))]
(f : (i : Fin n) → E i → 𝕜) :
∫ x : (i : Fin n) → E i, ∏ i, f i (x i) = ∏ i, ∫ x, f i x := by
induction n with
| zero =>
simp only [Nat.zero_eq, volume_pi, Finset.univ_eq_empty, Finset.prod_empty, integral_const,
pi_empty_univ, ENNReal.one_toReal, smul_eq_mul, mul_one, pow_zero, one_smul]
| succ n n_ih =>
calc
_ = ∫ x : E 0 × ((i : Fin n) → E (Fin.succ i)),
f 0 x.1 * ∏ i : Fin n, f (Fin.succ i) (x.2 i) := by
rw [volume_pi, ← ((measurePreserving_piFinSuccAbove
(fun i => (volume : Measure (E i))) 0).symm).integral_comp']
simp_rw [MeasurableEquiv.piFinSuccAbove_symm_apply,
Fin.prod_univ_succ, Fin.insertNth_zero, Fin.cons_succ, volume_eq_prod, volume_pi,
Fin.zero_succAbove, cast_eq, Fin.cons_zero]
_ = (∫ x, f 0 x) * ∏ i : Fin n, ∫ (x : E (Fin.succ i)), f (Fin.succ i) x := by
rw [← n_ih, ← integral_prod_mul, volume_eq_prod]
_ = ∏ i, ∫ x, f i x := by rw [Fin.prod_univ_succ]
/-- A version of **Fubini's theorem** with the variables indexed by a general finite type. -/
theorem integral_fintype_prod_eq_prod (ι : Type*) [Fintype ι] {E : ι → Type*}
(f : (i : ι) → E i → 𝕜) [∀ i, MeasureSpace (E i)] [∀ i, SigmaFinite (volume : Measure (E i))] :
∫ x : (i : ι) → E i, ∏ i, f i (x i) = ∏ i, ∫ x, f i x := by
let e := (equivFin ι).symm
rw [← (volume_measurePreserving_piCongrLeft _ e).integral_comp']
simp_rw [← e.prod_comp, MeasurableEquiv.coe_piCongrLeft, Equiv.piCongrLeft_apply_apply,
MeasureTheory.integral_fin_nat_prod_eq_prod]
theorem integral_fintype_prod_eq_pow {E : Type*} (ι : Type*) [Fintype ι] (f : E → 𝕜)
[MeasureSpace E] [SigmaFinite (volume : Measure E)] :
∫ x : ι → E, ∏ i, f (x i) = (∫ x, f x) ^ (card ι) := by
rw [integral_fintype_prod_eq_prod, Finset.prod_const, card]
end MeasureTheory
|
MeasureTheory\Integral\RieszMarkovKakutani.lean | /-
Copyright (c) 2022 Jesse Reimann. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jesse Reimann, Kalle Kytölä
-/
import Mathlib.Topology.ContinuousFunction.Bounded
import Mathlib.Topology.Sets.Compacts
/-!
# Riesz–Markov–Kakutani representation theorem
This file will prove different versions of the Riesz-Markov-Kakutani representation theorem.
The theorem is first proven for compact spaces, from which the statements about linear functionals
on bounded continuous functions or compactly supported functions on locally compact spaces follow.
To make use of the existing API, the measure is constructed from a content `λ` on the
compact subsets of the space X, rather than the usual construction of open sets in the literature.
## References
* [Walter Rudin, Real and Complex Analysis.][Rud87]
-/
noncomputable section
open BoundedContinuousFunction NNReal ENNReal
open Set Function TopologicalSpace
variable {X : Type*} [TopologicalSpace X]
variable (Λ : (X →ᵇ ℝ≥0) →ₗ[ℝ≥0] ℝ≥0)
/-! ### Construction of the content: -/
/-- Given a positive linear functional Λ on X, for `K ⊆ X` compact define
`λ(K) = inf {Λf | 1≤f on K}`. When X is a compact Hausdorff space, this will be shown to be a
content, and will be shown to agree with the Riesz measure on the compact subsets `K ⊆ X`. -/
def rieszContentAux : Compacts X → ℝ≥0 := fun K =>
sInf (Λ '' { f : X →ᵇ ℝ≥0 | ∀ x ∈ K, (1 : ℝ≥0) ≤ f x })
section RieszMonotone
/-- For any compact subset `K ⊆ X`, there exist some bounded continuous nonnegative
functions f on X such that `f ≥ 1` on K. -/
theorem rieszContentAux_image_nonempty (K : Compacts X) :
(Λ '' { f : X →ᵇ ℝ≥0 | ∀ x ∈ K, (1 : ℝ≥0) ≤ f x }).Nonempty := by
rw [image_nonempty]
use (1 : X →ᵇ ℝ≥0)
intro x _
simp only [BoundedContinuousFunction.coe_one, Pi.one_apply]; rfl
/-- Riesz content λ (associated with a positive linear functional Λ) is
monotone: if `K₁ ⊆ K₂` are compact subsets in X, then `λ(K₁) ≤ λ(K₂)`. -/
theorem rieszContentAux_mono {K₁ K₂ : Compacts X} (h : K₁ ≤ K₂) :
rieszContentAux Λ K₁ ≤ rieszContentAux Λ K₂ :=
csInf_le_csInf (OrderBot.bddBelow _) (rieszContentAux_image_nonempty Λ K₂)
(image_subset Λ (setOf_subset_setOf.mpr fun _ f_hyp x x_in_K₁ => f_hyp x (h x_in_K₁)))
end RieszMonotone
section RieszSubadditive
/-- Any bounded continuous nonnegative f such that `f ≥ 1` on K gives an upper bound on the
content of K; namely `λ(K) ≤ Λ f`. -/
theorem rieszContentAux_le {K : Compacts X} {f : X →ᵇ ℝ≥0} (h : ∀ x ∈ K, (1 : ℝ≥0) ≤ f x) :
rieszContentAux Λ K ≤ Λ f :=
csInf_le (OrderBot.bddBelow _) ⟨f, ⟨h, rfl⟩⟩
/-- The Riesz content can be approximated arbitrarily well by evaluating the positive linear
functional on test functions: for any `ε > 0`, there exists a bounded continuous nonnegative
function f on X such that `f ≥ 1` on K and such that `λ(K) ≤ Λ f < λ(K) + ε`. -/
theorem exists_lt_rieszContentAux_add_pos (K : Compacts X) {ε : ℝ≥0} (εpos : 0 < ε) :
∃ f : X →ᵇ ℝ≥0, (∀ x ∈ K, (1 : ℝ≥0) ≤ f x) ∧ Λ f < rieszContentAux Λ K + ε := by
--choose a test function `f` s.t. `Λf = α < λ(K) + ε`
obtain ⟨α, ⟨⟨f, f_hyp⟩, α_hyp⟩⟩ :=
exists_lt_of_csInf_lt (rieszContentAux_image_nonempty Λ K)
(lt_add_of_pos_right (rieszContentAux Λ K) εpos)
refine ⟨f, f_hyp.left, ?_⟩
rw [f_hyp.right]
exact α_hyp
/-- The Riesz content λ associated to a given positive linear functional Λ is
finitely subadditive: `λ(K₁ ∪ K₂) ≤ λ(K₁) + λ(K₂)` for any compact subsets `K₁, K₂ ⊆ X`. -/
theorem rieszContentAux_sup_le (K1 K2 : Compacts X) :
rieszContentAux Λ (K1 ⊔ K2) ≤ rieszContentAux Λ K1 + rieszContentAux Λ K2 := by
apply NNReal.le_of_forall_pos_le_add
intro ε εpos
--get test functions s.t. `λ(Ki) ≤ Λfi ≤ λ(Ki) + ε/2, i=1,2`
obtain ⟨f1, f_test_function_K1⟩ := exists_lt_rieszContentAux_add_pos Λ K1 (half_pos εpos)
obtain ⟨f2, f_test_function_K2⟩ := exists_lt_rieszContentAux_add_pos Λ K2 (half_pos εpos)
--let `f := f1 + f2` test function for the content of `K`
have f_test_function_union : ∀ x ∈ K1 ⊔ K2, (1 : ℝ≥0) ≤ (f1 + f2) x := by
rintro x (x_in_K1 | x_in_K2)
· exact le_add_right (f_test_function_K1.left x x_in_K1)
· exact le_add_left (f_test_function_K2.left x x_in_K2)
--use that `Λf` is an upper bound for `λ(K1⊔K2)`
apply (rieszContentAux_le Λ f_test_function_union).trans (le_of_lt _)
rw [map_add]
--use that `Λfi` are lower bounds for `λ(Ki) + ε/2`
apply lt_of_lt_of_le (_root_.add_lt_add f_test_function_K1.right f_test_function_K2.right)
(le_of_eq _)
rw [add_assoc, add_comm (ε / 2), add_assoc, add_halves ε, add_assoc]
end RieszSubadditive
|
MeasureTheory\Integral\SetIntegral.lean | /-
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
-/
import Mathlib.MeasureTheory.Integral.IntegrableOn
import Mathlib.MeasureTheory.Integral.Bochner
import Mathlib.MeasureTheory.Function.LocallyIntegrable
import Mathlib.Topology.MetricSpace.ThickenedIndicator
import Mathlib.Topology.ContinuousFunction.Compact
import Mathlib.Analysis.NormedSpace.HahnBanach.SeparatingDual
/-!
# Set integral
In this file we prove some properties of `∫ x in s, f x ∂μ`. 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 ∂μ = ∫ x in s, f x ∂μ`, where `indicator s f x` is equal to `f x` for `x ∈ s`
and is zero otherwise.
Since `∫ x in s, f x ∂μ` is a notation, one can rewrite or apply any theorem about `∫ x, f x ∂μ`
directly. In this file we prove some theorems about dependence of `∫ x in s, f x ∂μ` on `s`, e.g.
`integral_union`, `integral_empty`, `integral_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`.
Finally, we prove a version of the
[Fundamental theorem of calculus](https://en.wikipedia.org/wiki/Fundamental_theorem_of_calculus)
for set integral, see `Filter.Tendsto.integral_sub_linear_isLittleO_ae` and its corollaries.
Namely, consider a measurably generated filter `l`, a measure `μ` finite at this filter, and
a function `f` that has a finite limit `c` at `l ⊓ ae μ`. Then `∫ x in s, f x ∂μ = μ s • c + o(μ s)`
as `s` tends to `l.smallSets`, i.e. for any `ε>0` there exists `t ∈ l` such that
`‖∫ x in s, f x ∂μ - μ s • c‖ ≤ ε * μ s` whenever `s ⊆ t`. We also formulate a version of this
theorem for a locally finite measure `μ` and a function `f` continuous at a point `a`.
## Notation
We provide the following notations for expressing the integral of a function on a set :
* `∫ x in s, f x ∂μ` 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.lean`,
but we reference them here because all theorems about set integrals are in this file.
-/
assert_not_exists InnerProductSpace
noncomputable section
open Set Filter TopologicalSpace MeasureTheory Function RCLike
open scoped Classical Topology ENNReal NNReal
variable {X Y E F : Type*}
namespace MeasureTheory
variable [MeasurableSpace X]
section NormedAddCommGroup
variable [NormedAddCommGroup E] [NormedSpace ℝ E]
{f g : X → E} {s t : Set X} {μ ν : Measure X} {l l' : Filter X}
theorem setIntegral_congr_ae₀ (hs : NullMeasurableSet s μ) (h : ∀ᵐ x ∂μ, x ∈ s → f x = g x) :
∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ :=
integral_congr_ae ((ae_restrict_iff'₀ hs).2 h)
@[deprecated (since := "2024-04-17")]
alias set_integral_congr_ae₀ := setIntegral_congr_ae₀
theorem setIntegral_congr_ae (hs : MeasurableSet s) (h : ∀ᵐ x ∂μ, x ∈ s → f x = g x) :
∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ :=
integral_congr_ae ((ae_restrict_iff' hs).2 h)
@[deprecated (since := "2024-04-17")]
alias set_integral_congr_ae := setIntegral_congr_ae
theorem setIntegral_congr₀ (hs : NullMeasurableSet s μ) (h : EqOn f g s) :
∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ :=
setIntegral_congr_ae₀ hs <| eventually_of_forall h
@[deprecated (since := "2024-04-17")]
alias set_integral_congr₀ := setIntegral_congr₀
theorem setIntegral_congr (hs : MeasurableSet s) (h : EqOn f g s) :
∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ :=
setIntegral_congr_ae hs <| eventually_of_forall h
@[deprecated (since := "2024-04-17")]
alias set_integral_congr := setIntegral_congr
theorem setIntegral_congr_set_ae (hst : s =ᵐ[μ] t) : ∫ x in s, f x ∂μ = ∫ x in t, f x ∂μ := by
rw [Measure.restrict_congr_set hst]
@[deprecated (since := "2024-04-17")]
alias set_integral_congr_set_ae := setIntegral_congr_set_ae
theorem integral_union_ae (hst : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
(hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) :
∫ x in s ∪ t, f x ∂μ = ∫ x in s, f x ∂μ + ∫ x in t, f x ∂μ := by
simp only [IntegrableOn, Measure.restrict_union₀ hst ht, integral_add_measure hfs hft]
theorem integral_union (hst : Disjoint s t) (ht : MeasurableSet t) (hfs : IntegrableOn f s μ)
(hft : IntegrableOn f t μ) : ∫ x in s ∪ t, f x ∂μ = ∫ x in s, f x ∂μ + ∫ x in t, f x ∂μ :=
integral_union_ae hst.aedisjoint ht.nullMeasurableSet hfs hft
theorem integral_diff (ht : MeasurableSet t) (hfs : IntegrableOn f s μ) (hts : t ⊆ s) :
∫ x in s \ t, f x ∂μ = ∫ x in s, f x ∂μ - ∫ x in t, f x ∂μ := by
rw [eq_sub_iff_add_eq, ← integral_union, diff_union_of_subset hts]
exacts [disjoint_sdiff_self_left, ht, hfs.mono_set diff_subset, hfs.mono_set hts]
theorem integral_inter_add_diff₀ (ht : NullMeasurableSet t μ) (hfs : IntegrableOn f s μ) :
∫ x in s ∩ t, f x ∂μ + ∫ x in s \ t, f x ∂μ = ∫ x in s, f x ∂μ := 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 ∂μ + ∫ x in s \ t, f x ∂μ = ∫ x in s, f x ∂μ :=
integral_inter_add_diff₀ ht.nullMeasurableSet hfs
theorem integral_finset_biUnion {ι : 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 ∂μ = ∑ i ∈ t, ∫ x in s i, f x ∂μ := by
induction' t using Finset.induction_on with a t hat IH hs h's
· simp
· simp only [Finset.coe_insert, Finset.forall_mem_insert, Set.pairwise_insert,
Finset.set_biUnion_insert] at hs hf h's ⊢
rw [integral_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_fintype_iUnion {ι : 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 ∂μ = ∑ i, ∫ x in s i, f x ∂μ := by
convert integral_finset_biUnion Finset.univ (fun i _ => hs i) _ fun i _ => hf i
· simp
· simp [pairwise_univ, h's]
theorem integral_empty : ∫ x in ∅, f x ∂μ = 0 := by
rw [Measure.restrict_empty, integral_zero_measure]
theorem integral_univ : ∫ x in univ, f x ∂μ = ∫ x, f x ∂μ := by rw [Measure.restrict_univ]
theorem integral_add_compl₀ (hs : NullMeasurableSet s μ) (hfi : Integrable f μ) :
∫ x in s, f x ∂μ + ∫ x in sᶜ, f x ∂μ = ∫ x, f x ∂μ := by
rw [
← integral_union_ae disjoint_compl_right.aedisjoint hs.compl hfi.integrableOn hfi.integrableOn,
union_compl_self, integral_univ]
theorem integral_add_compl (hs : MeasurableSet s) (hfi : Integrable f μ) :
∫ x in s, f x ∂μ + ∫ x in sᶜ, f x ∂μ = ∫ x, f x ∂μ :=
integral_add_compl₀ hs.nullMeasurableSet hfi
theorem setIntegral_compl (hs : MeasurableSet s) (hfi : Integrable f μ) :
∫ x in sᶜ, f x ∂μ = ∫ x, f x ∂μ - ∫ x in s, f x ∂μ := by
rw [← integral_add_compl (μ := μ) hs hfi, add_sub_cancel_left]
/-- 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 ∂μ` defined as `∫ x, f x ∂(μ.restrict s)`. -/
theorem integral_indicator (hs : MeasurableSet s) :
∫ x, indicator s f x ∂μ = ∫ x in s, f x ∂μ := 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 ∂μ = ∫ x in s, indicator s f x ∂μ + ∫ x in sᶜ, indicator s f x ∂μ :=
(integral_add_compl hs (hfi.integrable_indicator hs)).symm
_ = ∫ x in s, f x ∂μ + ∫ x in sᶜ, 0 ∂μ :=
(congr_arg₂ (· + ·) (integral_congr_ae (indicator_ae_eq_restrict hs))
(integral_congr_ae (indicator_ae_eq_restrict_compl hs)))
_ = ∫ x in s, f x ∂μ := by simp
theorem setIntegral_indicator (ht : MeasurableSet t) :
∫ x in s, t.indicator f x ∂μ = ∫ x in s ∩ t, f x ∂μ := by
rw [integral_indicator ht, Measure.restrict_restrict ht, Set.inter_comm]
@[deprecated (since := "2024-04-17")]
alias set_integral_indicator := setIntegral_indicator
theorem ofReal_setIntegral_one_of_measure_ne_top {X : Type*} {m : MeasurableSpace X}
{μ : Measure X} {s : Set X} (hs : μ s ≠ ∞) : ENNReal.ofReal (∫ _ in s, (1 : ℝ) ∂μ) = μ s :=
calc
ENNReal.ofReal (∫ _ in s, (1 : ℝ) ∂μ) = ENNReal.ofReal (∫ _ in s, ‖(1 : ℝ)‖ ∂μ) := by
simp only [norm_one]
_ = ∫⁻ _ in s, 1 ∂μ := by
rw [ofReal_integral_norm_eq_lintegral_nnnorm (integrableOn_const.2 (Or.inr hs.lt_top))]
simp only [nnnorm_one, ENNReal.coe_one]
_ = μ s := setLIntegral_one _
@[deprecated (since := "2024-04-17")]
alias ofReal_set_integral_one_of_measure_ne_top := ofReal_setIntegral_one_of_measure_ne_top
theorem ofReal_setIntegral_one {X : Type*} {_ : MeasurableSpace X} (μ : Measure X)
[IsFiniteMeasure μ] (s : Set X) : ENNReal.ofReal (∫ _ in s, (1 : ℝ) ∂μ) = μ s :=
ofReal_setIntegral_one_of_measure_ne_top (measure_ne_top μ s)
@[deprecated (since := "2024-04-17")]
alias ofReal_set_integral_one := ofReal_setIntegral_one
theorem integral_piecewise [DecidablePred (· ∈ s)] (hs : MeasurableSet s) (hf : IntegrableOn f s μ)
(hg : IntegrableOn g sᶜ μ) :
∫ x, s.piecewise f g x ∂μ = ∫ x in s, f x ∂μ + ∫ x in sᶜ, g x ∂μ := 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*} [Countable ι] [SemilatticeSup ι]
{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 ∂μ) atTop (𝓝 (∫ x in ⋃ n, s n, f x ∂μ)) := by
have hfi' : ∫⁻ x in ⋃ n, s n, ‖f x‖₊ ∂μ < ∞ := hfi.2
set S := ⋃ i, s i
have hSm : MeasurableSet S := MeasurableSet.iUnion hsm
have hsub : ∀ {i}, s i ⊆ S := @(subset_iUnion s)
rw [← withDensity_apply _ hSm] at hfi'
set ν := μ.withDensity fun x => ‖f x‖₊ 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 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', ← integral_diff (hsm i) hfi hsub, ← coe_nnnorm, NNReal.coe_le_coe, ←
ENNReal.coe_le_coe]
refine (ennnorm_integral_le_lintegral_ennnorm _).trans ?_
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]
@[deprecated (since := "2024-04-17")]
alias tendsto_set_integral_of_monotone := tendsto_setIntegral_of_monotone
theorem tendsto_setIntegral_of_antitone {ι : Type*} [Countable ι] [SemilatticeSup ι]
{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 ∂μ) atTop (𝓝 (∫ x in ⋂ n, s n, f x ∂μ)) := by
set S := ⋂ i, s i
have hSm : MeasurableSet S := MeasurableSet.iInter hsm
have hsub i : S ⊆ s i := iInter_subset _ _
set ν := μ.withDensity fun x => ‖f x‖₊ with hν
refine Metric.nhds_basis_closedBall.tendsto_right_iff.2 fun ε ε0 => ?_
lift ε to ℝ≥0 using ε0.le
rcases hfi with ⟨i₀, hi₀⟩
have νi₀ : ν (s i₀) ≠ ∞ := by
simpa [hsm i₀, ν, ENNReal.ofReal, norm_toNNReal] using hi₀.norm.lintegral_lt_top.ne
have νS : ν S ≠ ∞ := ((measure_mono (hsub i₀)).trans_lt νi₀.lt_top).ne
have : ∀ᶠ i in atTop, ν (s i) ∈ Icc (ν S - ε) (ν S + ε) := by
apply tendsto_measure_iInter hsm h_anti ⟨i₀, νi₀⟩
apply ENNReal.Icc_mem_nhds νS (ENNReal.coe_pos.2 ε0).ne'
filter_upwards [this, Ici_mem_atTop i₀] with i hi h'i
rw [mem_closedBall_iff_norm, ← integral_diff hSm (hi₀.mono_set (h_anti h'i)) (hsub i),
← coe_nnnorm, NNReal.coe_le_coe, ← ENNReal.coe_le_coe]
refine (ennnorm_integral_le_lintegral_ennnorm _).trans ?_
rw [← withDensity_apply _ ((hsm _).diff hSm), ← hν, measure_diff (hsub i) hSm νS]
exact tsub_le_iff_left.2 hi.2
@[deprecated (since := "2024-04-17")]
alias tendsto_set_integral_of_antitone := tendsto_setIntegral_of_antitone
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 ∂μ) (∫ x in ⋃ n, s n, f x ∂μ) := 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 ∂μ) (∫ x in ⋃ n, s n, f x ∂μ) :=
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 ∂μ = ∑' n, ∫ x in s n, f x ∂μ :=
(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 ∂μ = ∑' n, ∫ x in s n, f x ∂μ :=
(HasSum.tsum_eq (hasSum_integral_iUnion_ae hm hd hfi)).symm
theorem setIntegral_eq_zero_of_ae_eq_zero (ht_eq : ∀ᵐ x ∂μ, x ∈ t → f x = 0) :
∫ x in t, f x ∂μ = 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 ∂μ = 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
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_zero_of_ae_eq_zero := setIntegral_eq_zero_of_ae_eq_zero
theorem setIntegral_eq_zero_of_forall_eq_zero (ht_eq : ∀ x ∈ t, f x = 0) :
∫ x in t, f x ∂μ = 0 :=
setIntegral_eq_zero_of_ae_eq_zero (eventually_of_forall ht_eq)
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_zero_of_forall_eq_zero := setIntegral_eq_zero_of_forall_eq_zero
theorem integral_union_eq_left_of_ae_aux (ht_eq : ∀ᵐ x ∂μ.restrict t, f x = 0)
(haux : StronglyMeasurable f) (H : IntegrableOn f (s ∪ t) μ) :
∫ x in s ∪ t, f x ∂μ = ∫ x in s, f x ∂μ := 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 ∂μ = 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_ae
rw [union_ae_eq_right]
apply measure_mono_null diff_subset
rw [measure_zero_iff_ae_nmem]
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 ∂μ.restrict t, f x = 0) :
∫ x in s ∪ t, f x ∂μ = ∫ x in s, f x ∂μ := 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 ∂μ = ∫ x : X in s ∪ t, f' x ∂μ := integral_congr_ae H.1.ae_eq_mk
_ = ∫ x in s, f' x ∂μ := 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 ∂μ :=
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 ∂μ = ∫ x in s, f x ∂μ :=
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 ∂μ = ∫ x in s, f x ∂μ :=
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 ∂μ, x ∈ t \ s → f x = 0) (haux : StronglyMeasurable f)
(h'aux : IntegrableOn f t μ) : ∫ x in t, f x ∂μ = ∫ x in s, f x ∂μ := by
let k := f ⁻¹' {0}
have hk : MeasurableSet k := by borelize E; exact haux.measurable (measurableSet_singleton _)
calc
∫ x in t, f x ∂μ = ∫ x in t ∩ k, f x ∂μ + ∫ x in t \ k, f x ∂μ := by
rw [integral_inter_add_diff hk h'aux]
_ = ∫ x in t \ k, f x ∂μ := by
rw [setIntegral_eq_zero_of_forall_eq_zero fun x hx => ?_, zero_add]; exact hx.2
_ = ∫ x in s \ k, f x ∂μ := by
apply setIntegral_congr_set_ae
filter_upwards [h't] with x hx
change (x ∈ t \ k) = (x ∈ s \ k)
simp only [mem_preimage, mem_singleton_iff, 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_iff]
intro xt
exact h'x (hx ⟨xt, xs⟩)
_ = ∫ x in s ∩ k, f x ∂μ + ∫ x in s \ k, f x ∂μ := 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 ∂μ := by rw [integral_inter_add_diff hk (h'aux.mono hts le_rfl)]
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_of_subset_of_ae_diff_eq_zero_aux :=
setIntegral_eq_of_subset_of_ae_diff_eq_zero_aux
/-- 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 ∂μ, x ∈ t \ s → f x = 0) : ∫ x in t, f x ∂μ = ∫ x in s, f x ∂μ := 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 ∂μ = ∫ x in t, f' x ∂μ := integral_congr_ae h.1.ae_eq_mk
_ = ∫ x in s, f' x ∂μ := 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 ∂μ := by
apply integral_congr_ae
apply ae_restrict_of_ae_restrict_of_subset hts
exact h.1.ae_eq_mk.symm
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_of_subset_of_ae_diff_eq_zero := setIntegral_eq_of_subset_of_ae_diff_eq_zero
/-- 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 ∂μ = ∫ x in s, f x ∂μ :=
setIntegral_eq_of_subset_of_ae_diff_eq_zero ht.nullMeasurableSet hts
(eventually_of_forall fun x hx => h't x hx)
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_of_subset_of_forall_diff_eq_zero :=
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 (h : ∀ᵐ x ∂μ, x ∉ s → f x = 0) :
∫ x in s, f x ∂μ = ∫ x, f x ∂μ := by
symm
nth_rw 1 [← integral_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
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_integral_of_ae_compl_eq_zero := setIntegral_eq_integral_of_ae_compl_eq_zero
/-- 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 ∂μ = ∫ x, f x ∂μ :=
setIntegral_eq_integral_of_ae_compl_eq_zero (eventually_of_forall h)
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_integral_of_forall_compl_eq_zero :=
setIntegral_eq_integral_of_forall_compl_eq_zero
theorem setIntegral_neg_eq_setIntegral_nonpos [LinearOrder E] {f : X → E}
(hf : AEStronglyMeasurable f μ) :
∫ x in {x | f x < 0}, f x ∂μ = ∫ x in {x | f x ≤ 0}, f x ∂μ := 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
@[deprecated (since := "2024-04-17")]
alias set_integral_neg_eq_set_integral_nonpos := setIntegral_neg_eq_setIntegral_nonpos
theorem integral_norm_eq_pos_sub_neg {f : X → ℝ} (hfi : Integrable f μ) :
∫ x, ‖f x‖ ∂μ = ∫ x in {x | 0 ≤ f x}, f x ∂μ - ∫ x in {x | f x ≤ 0}, f x ∂μ :=
have h_meas : NullMeasurableSet {x | 0 ≤ f x} μ :=
aestronglyMeasurable_const.nullMeasurableSet_le hfi.1
calc
∫ x, ‖f x‖ ∂μ = ∫ x in {x | 0 ≤ f x}, ‖f x‖ ∂μ + ∫ x in {x | 0 ≤ f x}ᶜ, ‖f x‖ ∂μ := by
rw [← integral_add_compl₀ h_meas hfi.norm]
_ = ∫ x in {x | 0 ≤ f x}, f x ∂μ + ∫ x in {x | 0 ≤ f x}ᶜ, ‖f x‖ ∂μ := by
congr 1
refine setIntegral_congr₀ 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 ∂μ - ∫ x in {x | 0 ≤ f x}ᶜ, f x ∂μ := by
congr 1
rw [← integral_neg]
refine setIntegral_congr₀ h_meas.compl fun x hx => ?_
dsimp only
rw [Real.norm_eq_abs, abs_eq_neg_self.mpr _]
rw [Set.mem_compl_iff, Set.nmem_setOf_iff] at hx
linarith
_ = ∫ x in {x | 0 ≤ f x}, f x ∂μ - ∫ x in {x | f x ≤ 0}, f x ∂μ := 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 ∂μ = (μ s).toReal • c := by
rw [integral_const, Measure.restrict_apply_univ]
@[deprecated (since := "2024-04-17")]
alias set_integral_const := setIntegral_const
@[simp]
theorem integral_indicator_const [CompleteSpace E] (e : E) ⦃s : Set X⦄ (s_meas : MeasurableSet s) :
∫ x : X, s.indicator (fun _ : X => e) x ∂μ = (μ s).toReal • 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 ∂μ = (μ s).toReal :=
(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 ∂μ = (μ (t ∩ s)).toReal • e :=
calc
∫ x in s, indicatorConstLp p ht hμt e x ∂μ = ∫ x in s, t.indicator (fun _ => e) x ∂μ := by
rw [setIntegral_congr_ae hs (indicatorConstLp_coeFn.mono fun x hx _ => hx)]
_ = (μ (t ∩ s)).toReal • e := by rw [integral_indicator_const _ ht, Measure.restrict_apply ht]
@[deprecated (since := "2024-04-17")]
alias set_integral_indicatorConstLp := setIntegral_indicatorConstLp
theorem integral_indicatorConstLp [CompleteSpace E]
{p : ℝ≥0∞} (ht : MeasurableSet t) (hμt : μ t ≠ ∞) (e : E) :
∫ x, indicatorConstLp p ht hμt e x ∂μ = (μ t).toReal • e :=
calc
∫ x, indicatorConstLp p ht hμt e x ∂μ = ∫ x in univ, indicatorConstLp p ht hμt e x ∂μ := by
rw [integral_univ]
_ = (μ (t ∩ univ)).toReal • e := setIntegral_indicatorConstLp MeasurableSet.univ ht hμt e
_ = (μ t).toReal • 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) ∂μ := 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
@[deprecated (since := "2024-04-17")]
alias set_integral_map := setIntegral_map
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) ∂μ := by
rw [hf.restrict_map, hf.integral_map]
@[deprecated (since := "2024-04-17")]
alias _root_.MeasurableEmbedding.set_integral_map := _root_.MeasurableEmbedding.setIntegral_map
theorem _root_.ClosedEmbedding.setIntegral_map [TopologicalSpace X] [BorelSpace X] {Y}
[MeasurableSpace Y] [TopologicalSpace Y] [BorelSpace Y] {g : X → Y} {f : Y → E} (s : Set Y)
(hg : ClosedEmbedding g) : ∫ y in s, f y ∂Measure.map g μ = ∫ x in g ⁻¹' s, f (g x) ∂μ :=
hg.measurableEmbedding.setIntegral_map _ _
@[deprecated (since := "2024-04-17")]
alias _root_.ClosedEmbedding.set_integral_map := _root_.ClosedEmbedding.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) ∂μ = ∫ y in s, g y ∂ν :=
(h₁.restrict_preimage_emb h₂ s).integral_comp h₂ _
@[deprecated (since := "2024-04-17")]
alias MeasurePreserving.set_integral_preimage_emb := MeasurePreserving.setIntegral_preimage_emb
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) ∂μ :=
Eq.symm <| (h₁.restrict_image_emb h₂ s).integral_comp h₂ _
@[deprecated (since := "2024-04-17")]
alias MeasurePreserving.set_integral_image_emb := MeasurePreserving.setIntegral_image_emb
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) ∂μ :=
e.measurableEmbedding.setIntegral_map f s
@[deprecated (since := "2024-04-17")]
alias set_integral_map_equiv := setIntegral_map_equiv
theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} (hs : μ s < ∞)
(hC : ∀ᵐ x ∂μ.restrict s, ‖f x‖ ≤ C) : ‖∫ x in s, f x ∂μ‖ ≤ C * (μ s).toReal := by
rw [← Measure.restrict_apply_univ] at *
haveI : IsFiniteMeasure (μ.restrict s) := ⟨hs⟩
exact norm_integral_le_of_norm_le_const hC
@[deprecated (since := "2024-04-17")]
alias norm_set_integral_le_of_norm_le_const_ae := norm_setIntegral_le_of_norm_le_const_ae
theorem norm_setIntegral_le_of_norm_le_const_ae' {C : ℝ} (hs : μ s < ∞)
(hC : ∀ᵐ x ∂μ, x ∈ s → ‖f x‖ ≤ C) (hfm : AEStronglyMeasurable f (μ.restrict s)) :
‖∫ x in s, f x ∂μ‖ ≤ C * (μ s).toReal := by
apply norm_setIntegral_le_of_norm_le_const_ae hs
have A : ∀ᵐ x : X ∂μ, 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]
@[deprecated (since := "2024-04-17")]
alias norm_set_integral_le_of_norm_le_const_ae' := norm_setIntegral_le_of_norm_le_const_ae'
theorem norm_setIntegral_le_of_norm_le_const_ae'' {C : ℝ} (hs : μ s < ∞) (hsm : MeasurableSet s)
(hC : ∀ᵐ x ∂μ, x ∈ s → ‖f x‖ ≤ C) : ‖∫ x in s, f x ∂μ‖ ≤ C * (μ s).toReal :=
norm_setIntegral_le_of_norm_le_const_ae hs <| by
rwa [ae_restrict_eq hsm, eventually_inf_principal]
@[deprecated (since := "2024-04-17")]
alias norm_set_integral_le_of_norm_le_const_ae'' := norm_setIntegral_le_of_norm_le_const_ae''
theorem norm_setIntegral_le_of_norm_le_const {C : ℝ} (hs : μ s < ∞) (hC : ∀ x ∈ s, ‖f x‖ ≤ C)
(hfm : AEStronglyMeasurable f (μ.restrict s)) : ‖∫ x in s, f x ∂μ‖ ≤ C * (μ s).toReal :=
norm_setIntegral_le_of_norm_le_const_ae' hs (eventually_of_forall hC) hfm
@[deprecated (since := "2024-04-17")]
alias norm_set_integral_le_of_norm_le_const := norm_setIntegral_le_of_norm_le_const
theorem norm_setIntegral_le_of_norm_le_const' {C : ℝ} (hs : μ s < ∞) (hsm : MeasurableSet s)
(hC : ∀ x ∈ s, ‖f x‖ ≤ C) : ‖∫ x in s, f x ∂μ‖ ≤ C * (μ s).toReal :=
norm_setIntegral_le_of_norm_le_const_ae'' hs hsm <| eventually_of_forall hC
@[deprecated (since := "2024-04-17")]
alias norm_set_integral_le_of_norm_le_const' := norm_setIntegral_le_of_norm_le_const'
theorem setIntegral_eq_zero_iff_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ.restrict s] f)
(hfi : IntegrableOn f s μ) : ∫ x in s, f x ∂μ = 0 ↔ f =ᵐ[μ.restrict s] 0 :=
integral_eq_zero_iff_of_nonneg_ae hf hfi
@[deprecated (since := "2024-04-17")]
alias set_integral_eq_zero_iff_of_nonneg_ae := setIntegral_eq_zero_iff_of_nonneg_ae
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 ∂μ) ↔ 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
@[deprecated (since := "2024-04-17")]
alias set_integral_pos_iff_support_of_nonneg_ae := setIntegral_pos_iff_support_of_nonneg_ae
theorem setIntegral_gt_gt {R : ℝ} {f : X → ℝ} (hR : 0 ≤ R)
(hfint : IntegrableOn f {x | ↑R < f x} μ) (hμ : μ {x | ↑R < f x} ≠ 0) :
(μ {x | ↑R < f x}).toReal * R < ∫ x in {x | ↑R < f x}, f x ∂μ := 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.ennnorm <| ae_of_all _ fun x hx => ?_
simp only [ENNReal.coe_le_coe, Real.nnnorm_of_nonneg hR,
Real.nnnorm_of_nonneg (hR.trans <| le_of_lt hx), Subtype.mk_le_mk]
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 [← zero_lt_iff] 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
@[deprecated (since := "2024-04-17")]
alias set_integral_gt_gt := setIntegral_gt_gt
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 ∂μ = ∫ x in s, f x ∂μ.trim hm := by
rwa [integral_trim hm hf_meas, restrict_trim hm μ]
@[deprecated (since := "2024-04-17")]
alias set_integral_trim := setIntegral_trim
/-! ### 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 ∂μ = ∫ t in Ioc x y, f t ∂μ :=
setIntegral_congr_set_ae (Ioc_ae_eq_Icc' hx).symm
theorem integral_Icc_eq_integral_Ico' (hy : μ {y} = 0) :
∫ t in Icc x y, f t ∂μ = ∫ t in Ico x y, f t ∂μ :=
setIntegral_congr_set_ae (Ico_ae_eq_Icc' hy).symm
theorem integral_Ioc_eq_integral_Ioo' (hy : μ {y} = 0) :
∫ t in Ioc x y, f t ∂μ = ∫ t in Ioo x y, f t ∂μ :=
setIntegral_congr_set_ae (Ioo_ae_eq_Ioc' hy).symm
theorem integral_Ico_eq_integral_Ioo' (hx : μ {x} = 0) :
∫ t in Ico x y, f t ∂μ = ∫ t in Ioo x y, f t ∂μ :=
setIntegral_congr_set_ae (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 ∂μ = ∫ t in Ioo x y, f t ∂μ :=
setIntegral_congr_set_ae (Ioo_ae_eq_Icc' hx hy).symm
theorem integral_Iic_eq_integral_Iio' (hx : μ {x} = 0) :
∫ t in Iic x, f t ∂μ = ∫ t in Iio x, f t ∂μ :=
setIntegral_congr_set_ae (Iio_ae_eq_Iic' hx).symm
theorem integral_Ici_eq_integral_Ioi' (hx : μ {x} = 0) :
∫ t in Ici x, f t ∂μ = ∫ t in Ioi x, f t ∂μ :=
setIntegral_congr_set_ae (Ioi_ae_eq_Ici' hx).symm
variable [NoAtoms μ]
theorem integral_Icc_eq_integral_Ioc : ∫ t in Icc x y, f t ∂μ = ∫ t in Ioc x y, f t ∂μ :=
integral_Icc_eq_integral_Ioc' <| measure_singleton x
theorem integral_Icc_eq_integral_Ico : ∫ t in Icc x y, f t ∂μ = ∫ t in Ico x y, f t ∂μ :=
integral_Icc_eq_integral_Ico' <| measure_singleton y
theorem integral_Ioc_eq_integral_Ioo : ∫ t in Ioc x y, f t ∂μ = ∫ t in Ioo x y, f t ∂μ :=
integral_Ioc_eq_integral_Ioo' <| measure_singleton y
theorem integral_Ico_eq_integral_Ioo : ∫ t in Ico x y, f t ∂μ = ∫ t in Ioo x y, f t ∂μ :=
integral_Ico_eq_integral_Ioo' <| measure_singleton x
theorem integral_Icc_eq_integral_Ioo : ∫ t in Icc x y, f t ∂μ = ∫ t in Ioo x y, f t ∂μ := by
rw [integral_Icc_eq_integral_Ico, integral_Ico_eq_integral_Ioo]
theorem integral_Iic_eq_integral_Iio : ∫ t in Iic x, f t ∂μ = ∫ t in Iio x, f t ∂μ :=
integral_Iic_eq_integral_Iio' <| measure_singleton x
theorem integral_Ici_eq_integral_Ioi : ∫ t in Ici x, f t ∂μ = ∫ t in Ioi x, f t ∂μ :=
integral_Ici_eq_integral_Ioi' <| measure_singleton x
end PartialOrder
end NormedAddCommGroup
section Mono
variable {μ : Measure X} {f g : X → ℝ} {s t : Set X} (hf : IntegrableOn f s μ)
(hg : IntegrableOn g s μ)
theorem setIntegral_mono_ae_restrict (h : f ≤ᵐ[μ.restrict s] g) :
∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ :=
integral_mono_ae hf hg h
@[deprecated (since := "2024-04-17")]
alias set_integral_mono_ae_restrict := setIntegral_mono_ae_restrict
theorem setIntegral_mono_ae (h : f ≤ᵐ[μ] g) : ∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ :=
setIntegral_mono_ae_restrict hf hg (ae_restrict_of_ae h)
@[deprecated (since := "2024-04-17")]
alias set_integral_mono_ae := setIntegral_mono_ae
theorem setIntegral_mono_on (hs : MeasurableSet s) (h : ∀ x ∈ s, f x ≤ g x) :
∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ :=
setIntegral_mono_ae_restrict hf hg
(by simp [hs, EventuallyLE, eventually_inf_principal, ae_of_all _ h])
@[deprecated (since := "2024-04-17")]
alias set_integral_mono_on := setIntegral_mono_on
theorem setIntegral_mono_on_ae (hs : MeasurableSet s) (h : ∀ᵐ x ∂μ, x ∈ s → f x ≤ g x) :
∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ := by
refine setIntegral_mono_ae_restrict hf hg ?_; rwa [EventuallyLE, ae_restrict_iff' hs]
@[deprecated (since := "2024-04-17")]
alias set_integral_mono_on_ae := setIntegral_mono_on_ae
theorem setIntegral_mono (h : f ≤ g) : ∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ :=
integral_mono hf hg h
@[deprecated (since := "2024-04-17")]
alias set_integral_mono := setIntegral_mono
theorem setIntegral_mono_set (hfi : IntegrableOn f t μ) (hf : 0 ≤ᵐ[μ.restrict t] f)
(hst : s ≤ᵐ[μ] t) : ∫ x in s, f x ∂μ ≤ ∫ x in t, f x ∂μ :=
integral_mono_measure (Measure.restrict_mono_ae hst) hf hfi
@[deprecated (since := "2024-04-17")]
alias set_integral_mono_set := setIntegral_mono_set
theorem setIntegral_le_integral (hfi : Integrable f μ) (hf : 0 ≤ᵐ[μ] f) :
∫ x in s, f x ∂μ ≤ ∫ x, f x ∂μ :=
integral_mono_measure (Measure.restrict_le_self) hf hfi
@[deprecated (since := "2024-04-17")]
alias set_integral_le_integral := setIntegral_le_integral
theorem setIntegral_ge_of_const_le {c : ℝ} (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
(hf : ∀ x ∈ s, c ≤ f x) (hfint : IntegrableOn (fun x : X => f x) s μ) :
c * (μ s).toReal ≤ ∫ x in s, f x ∂μ := by
rw [mul_comm, ← smul_eq_mul, ← setIntegral_const c]
exact setIntegral_mono_on (integrableOn_const.2 (Or.inr hμs.lt_top)) hfint hs hf
@[deprecated (since := "2024-04-17")]
alias set_integral_ge_of_const_le := setIntegral_ge_of_const_le
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 ∂μ :=
integral_nonneg_of_ae hf
@[deprecated (since := "2024-04-17")]
alias set_integral_nonneg_of_ae_restrict := setIntegral_nonneg_of_ae_restrict
theorem setIntegral_nonneg_of_ae (hf : 0 ≤ᵐ[μ] f) : 0 ≤ ∫ x in s, f x ∂μ :=
setIntegral_nonneg_of_ae_restrict (ae_restrict_of_ae hf)
@[deprecated (since := "2024-04-17")]
alias set_integral_nonneg_of_ae := setIntegral_nonneg_of_ae
theorem setIntegral_nonneg (hs : MeasurableSet s) (hf : ∀ x, x ∈ s → 0 ≤ f x) :
0 ≤ ∫ x in s, f x ∂μ :=
setIntegral_nonneg_of_ae_restrict ((ae_restrict_iff' hs).mpr (ae_of_all μ hf))
@[deprecated (since := "2024-04-17")]
alias set_integral_nonneg := setIntegral_nonneg
theorem setIntegral_nonneg_ae (hs : MeasurableSet s) (hf : ∀ᵐ x ∂μ, x ∈ s → 0 ≤ f x) :
0 ≤ ∫ x in s, f x ∂μ :=
setIntegral_nonneg_of_ae_restrict <| by rwa [EventuallyLE, ae_restrict_iff' hs]
@[deprecated (since := "2024-04-17")]
alias set_integral_nonneg_ae := setIntegral_nonneg_ae
theorem setIntegral_le_nonneg {s : Set X} (hs : MeasurableSet s) (hf : StronglyMeasurable f)
(hfi : Integrable f μ) : ∫ x in s, f x ∂μ ≤ ∫ x in {y | 0 ≤ f y}, f x ∂μ := 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)
@[deprecated (since := "2024-04-17")]
alias set_integral_le_nonneg := setIntegral_le_nonneg
theorem setIntegral_nonpos_of_ae_restrict (hf : f ≤ᵐ[μ.restrict s] 0) : ∫ x in s, f x ∂μ ≤ 0 :=
integral_nonpos_of_ae hf
@[deprecated (since := "2024-04-17")]
alias set_integral_nonpos_of_ae_restrict := setIntegral_nonpos_of_ae_restrict
theorem setIntegral_nonpos_of_ae (hf : f ≤ᵐ[μ] 0) : ∫ x in s, f x ∂μ ≤ 0 :=
setIntegral_nonpos_of_ae_restrict (ae_restrict_of_ae hf)
@[deprecated (since := "2024-04-17")]
alias set_integral_nonpos_of_ae := setIntegral_nonpos_of_ae
theorem setIntegral_nonpos_ae (hs : MeasurableSet s) (hf : ∀ᵐ x ∂μ, x ∈ s → f x ≤ 0) :
∫ x in s, f x ∂μ ≤ 0 :=
setIntegral_nonpos_of_ae_restrict <| by rwa [EventuallyLE, ae_restrict_iff' hs]
@[deprecated (since := "2024-04-17")]
alias set_integral_nonpos_ae := setIntegral_nonpos_ae
theorem setIntegral_nonpos (hs : MeasurableSet s) (hf : ∀ x, x ∈ s → f x ≤ 0) :
∫ x in s, f x ∂μ ≤ 0 :=
setIntegral_nonpos_ae hs <| ae_of_all μ hf
@[deprecated (since := "2024-04-17")]
alias set_integral_nonpos := setIntegral_nonpos
theorem setIntegral_nonpos_le {s : Set X} (hs : MeasurableSet s) (hf : StronglyMeasurable f)
(hfi : Integrable f μ) : ∫ x in {y | f y ≤ 0}, f x ∂μ ≤ ∫ x in s, f x ∂μ := 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)
@[deprecated (since := "2024-04-17")]
alias set_integral_nonpos_le := setIntegral_nonpos_le
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 ∂μ) := 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 ∂μ) ≤ μ 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 ∂μ) ≤ ENNReal.ofReal (∫ x, g x ∂μ) := 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}
(hs : ∀ i : ι, MeasurableSet (s i)) (hi : ∀ i : ι, IntegrableOn f (s i) μ)
(h : Summable fun i : ι => ∫ x : X in s i, ‖f x‖ ∂μ) : 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
rw [tsum_congr B]
have S' :
Summable fun i : ι =>
(⟨∫ x : X in s i, ‖f x‖₊ ∂μ, setIntegral_nonneg (hs i) fun x _ => NNReal.coe_nonneg _⟩ :
NNReal) := 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] [MetrizableSpace 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)‖ * ENNReal.toReal (μ <| s i)) :
IntegrableOn f (⋃ i : ι, s i) μ := by
refine
integrableOn_iUnion_of_summable_integral_norm (fun i => (s i).isCompact.isClosed.measurableSet)
(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‖ ∂μ)]
exact
norm_setIntegral_le_of_norm_le_const' (s i).isCompact.measure_lt_top
(s i).isCompact.isClosed.measurableSet 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)‖ * ENNReal.toReal (μ <| 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 ∂μ` is continuous. -/
section ContinuousSetIntegral
variable [NormedAddCommGroup E]
{𝕜 : Type*} [NormedField 𝕜] [NormedAddCommGroup F] [NormedSpace 𝕜 F] {p : ℝ≥0∞} {μ : Measure X}
/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by
`(Lp.memℒp f).restrict s).toLp f`. This map is additive. -/
theorem Lp_toLp_restrict_add (f g : Lp E p μ) (s : Set X) :
((Lp.memℒp (f + g)).restrict s).toLp (⇑(f + g)) =
((Lp.memℒp f).restrict s).toLp f + ((Lp.memℒp g).restrict s).toLp g := by
ext1
refine (ae_restrict_of_ae (Lp.coeFn_add f g)).mp ?_
refine
(Lp.coeFn_add (Memℒp.toLp f ((Lp.memℒp f).restrict s))
(Memℒp.toLp g ((Lp.memℒp g).restrict s))).mp ?_
refine (Memℒp.coeFn_toLp ((Lp.memℒp f).restrict s)).mp ?_
refine (Memℒp.coeFn_toLp ((Lp.memℒp g).restrict s)).mp ?_
refine (Memℒp.coeFn_toLp ((Lp.memℒp (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.memℒp 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.memℒp (c • f)).restrict s).toLp (⇑(c • f)) = c • ((Lp.memℒp f).restrict s).toLp f := by
ext1
refine (ae_restrict_of_ae (Lp.coeFn_smul c f)).mp ?_
refine (Memℒp.coeFn_toLp ((Lp.memℒp f).restrict s)).mp ?_
refine (Memℒp.coeFn_toLp ((Lp.memℒp (c • f)).restrict s)).mp ?_
refine
(Lp.coeFn_smul c (Memℒp.toLp f ((Lp.memℒp 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.memℒp f).restrict s).toLp f`. This map is non-expansive. -/
theorem norm_Lp_toLp_restrict_le (s : Set X) (f : Lp E p μ) :
‖((Lp.memℒp f).restrict s).toLp f‖ ≤ ‖f‖ := by
rw [Lp.norm_def, Lp.norm_def, ENNReal.toReal_le_toReal (Lp.eLpNorm_ne_top _)
(Lp.eLpNorm_ne_top _)]
apply (le_of_eq _).trans (eLpNorm_mono_measure _ (Measure.restrict_le_self (s := s)))
exact eLpNorm_congr_ae (Memℒp.coeFn_toLp _)
variable (X F 𝕜) in
/-- Continuous linear map sending a function of `Lp F p μ` to the same function in
`Lp F p (μ.restrict s)`. -/
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 => Memℒp.toLp f ((Lp.memℒp 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 :=
Memℒp.coeFn_toLp ((Lp.memℒp f).restrict s)
@[continuity]
theorem continuous_setIntegral [NormedSpace ℝ E] (s : Set X) :
Continuous fun f : X →₁[μ] E => ∫ x in s, f x ∂μ := by
haveI : Fact ((1 : ℝ≥0∞) ≤ 1) := ⟨le_rfl⟩
have h_comp :
(fun f : X →₁[μ] E => ∫ x in s, f x ∂μ) =
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
@[deprecated (since := "2024-04-17")]
alias continuous_set_integral := continuous_setIntegral
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 ∂μ :=
integral_pos_of_integrable_nonneg_nonzero f_cont (f_cont.integrable_of_hasCompactSupport f_comp)
f_nonneg f_x
end OpenPos
/-! Fundamental theorem of calculus for set integrals -/
section FTC
open MeasureTheory Asymptotics Metric
variable [MeasurableSpace X] {ι : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
/-- Fundamental theorem of calculus for set integrals:
if `μ` is a measure that is finite at a filter `l` and
`f` is a measurable function that has a finite limit `b` at `l ⊓ ae μ`, then
`∫ x in s i, f x ∂μ = μ (s i) • b + o(μ (s i))` at a filter `li` provided that
`s i` tends to `l.smallSets` along `li`.
Since `μ (s i)` is an `ℝ≥0∞` number, we use `(μ (s i)).toReal` in the actual statement.
Often there is a good formula for `(μ (s i)).toReal`, so the formalization can take an optional
argument `m` with this formula and a proof of `(fun i => (μ (s i)).toReal) =ᶠ[li] m`. Without these
arguments, `m i = (μ (s i)).toReal` is used in the output. -/
theorem Filter.Tendsto.integral_sub_linear_isLittleO_ae
{μ : Measure X} {l : Filter X} [l.IsMeasurablyGenerated] {f : X → E} {b : E}
(h : Tendsto f (l ⊓ ae μ) (𝓝 b)) (hfm : StronglyMeasurableAtFilter f l μ)
(hμ : μ.FiniteAtFilter l) {s : ι → Set X} {li : Filter ι} (hs : Tendsto s li l.smallSets)
(m : ι → ℝ := fun i => (μ (s i)).toReal)
(hsμ : (fun i => (μ (s i)).toReal) =ᶠ[li] m := by rfl) :
(fun i => (∫ x in s i, f x ∂μ) - m i • b) =o[li] m := by
suffices
(fun s => (∫ x in s, f x ∂μ) - (μ s).toReal • b) =o[l.smallSets] fun s => (μ s).toReal from
(this.comp_tendsto hs).congr'
(hsμ.mono fun a ha => by dsimp only [Function.comp_apply] at ha ⊢; rw [ha]) hsμ
refine isLittleO_iff.2 fun ε ε₀ => ?_
have : ∀ᶠ s in l.smallSets, ∀ᵐ x ∂μ, x ∈ s → f x ∈ closedBall b ε :=
eventually_smallSets_eventually.2 (h.eventually <| closedBall_mem_nhds _ ε₀)
filter_upwards [hμ.eventually, (hμ.integrableAtFilter_of_tendsto_ae hfm h).eventually,
hfm.eventually, this]
simp only [mem_closedBall, dist_eq_norm]
intro s hμs h_integrable hfm h_norm
rw [← setIntegral_const, ← integral_sub h_integrable (integrableOn_const.2 <| Or.inr hμs),
Real.norm_eq_abs, abs_of_nonneg ENNReal.toReal_nonneg]
exact norm_setIntegral_le_of_norm_le_const_ae' hμs h_norm (hfm.sub aestronglyMeasurable_const)
/-- Fundamental theorem of calculus for set integrals, `nhdsWithin` version: if `μ` is a locally
finite measure and `f` is an almost everywhere measurable function that is continuous at a point `a`
within a measurable set `t`, then `∫ x in s i, f x ∂μ = μ (s i) • f a + o(μ (s i))` at a filter `li`
provided that `s i` tends to `(𝓝[t] a).smallSets` along `li`. Since `μ (s i)` is an `ℝ≥0∞`
number, we use `(μ (s i)).toReal` in the actual statement.
Often there is a good formula for `(μ (s i)).toReal`, so the formalization can take an optional
argument `m` with this formula and a proof of `(fun i => (μ (s i)).toReal) =ᶠ[li] m`. Without these
arguments, `m i = (μ (s i)).toReal` is used in the output. -/
theorem ContinuousWithinAt.integral_sub_linear_isLittleO_ae [TopologicalSpace X]
[OpensMeasurableSpace X] {μ : Measure X}
[IsLocallyFiniteMeasure μ] {x : X} {t : Set X} {f : X → E} (hx : ContinuousWithinAt f t x)
(ht : MeasurableSet t) (hfm : StronglyMeasurableAtFilter f (𝓝[t] x) μ) {s : ι → Set X}
{li : Filter ι} (hs : Tendsto s li (𝓝[t] x).smallSets) (m : ι → ℝ := fun i => (μ (s i)).toReal)
(hsμ : (fun i => (μ (s i)).toReal) =ᶠ[li] m := by rfl) :
(fun i => (∫ x in s i, f x ∂μ) - m i • f x) =o[li] m :=
haveI : (𝓝[t] x).IsMeasurablyGenerated := ht.nhdsWithin_isMeasurablyGenerated _
(hx.mono_left inf_le_left).integral_sub_linear_isLittleO_ae hfm (μ.finiteAt_nhdsWithin x t) hs m
hsμ
/-- Fundamental theorem of calculus for set integrals, `nhds` version: if `μ` is a locally finite
measure and `f` is an almost everywhere measurable function that is continuous at a point `a`, then
`∫ x in s i, f x ∂μ = μ (s i) • f a + o(μ (s i))` at `li` provided that `s` tends to
`(𝓝 a).smallSets` along `li`. Since `μ (s i)` is an `ℝ≥0∞` number, we use `(μ (s i)).toReal` in
the actual statement.
Often there is a good formula for `(μ (s i)).toReal`, so the formalization can take an optional
argument `m` with this formula and a proof of `(fun i => (μ (s i)).toReal) =ᶠ[li] m`. Without these
arguments, `m i = (μ (s i)).toReal` is used in the output. -/
theorem ContinuousAt.integral_sub_linear_isLittleO_ae [TopologicalSpace X] [OpensMeasurableSpace X]
{μ : Measure X} [IsLocallyFiniteMeasure μ] {x : X}
{f : X → E} (hx : ContinuousAt f x) (hfm : StronglyMeasurableAtFilter f (𝓝 x) μ) {s : ι → Set X}
{li : Filter ι} (hs : Tendsto s li (𝓝 x).smallSets) (m : ι → ℝ := fun i => (μ (s i)).toReal)
(hsμ : (fun i => (μ (s i)).toReal) =ᶠ[li] m := by rfl) :
(fun i => (∫ x in s i, f x ∂μ) - m i • f x) =o[li] m :=
(hx.mono_left inf_le_left).integral_sub_linear_isLittleO_ae hfm (μ.finiteAt_nhds x) hs m hsμ
/-- Fundamental theorem of calculus for set integrals, `nhdsWithin` version: if `μ` is a locally
finite measure, `f` is continuous on a measurable set `t`, and `a ∈ t`, then `∫ x in (s i), f x ∂μ =
μ (s i) • f a + o(μ (s i))` at `li` provided that `s i` tends to `(𝓝[t] a).smallSets` along `li`.
Since `μ (s i)` is an `ℝ≥0∞` number, we use `(μ (s i)).toReal` in the actual statement.
Often there is a good formula for `(μ (s i)).toReal`, so the formalization can take an optional
argument `m` with this formula and a proof of `(fun i => (μ (s i)).toReal) =ᶠ[li] m`. Without these
arguments, `m i = (μ (s i)).toReal` is used in the output. -/
theorem ContinuousOn.integral_sub_linear_isLittleO_ae [TopologicalSpace X] [OpensMeasurableSpace X]
[SecondCountableTopologyEither X E] {μ : Measure X}
[IsLocallyFiniteMeasure μ] {x : X} {t : Set X} {f : X → E} (hft : ContinuousOn f t) (hx : x ∈ t)
(ht : MeasurableSet t) {s : ι → Set X} {li : Filter ι} (hs : Tendsto s li (𝓝[t] x).smallSets)
(m : ι → ℝ := fun i => (μ (s i)).toReal)
(hsμ : (fun i => (μ (s i)).toReal) =ᶠ[li] m := by rfl) :
(fun i => (∫ x in s i, f x ∂μ) - m i • f x) =o[li] m :=
(hft x hx).integral_sub_linear_isLittleO_ae ht
⟨t, self_mem_nhdsWithin, hft.aestronglyMeasurable ht⟩ hs m hsμ
end FTC
section
variable [MeasurableSpace X]
/-! ### Continuous linear maps composed with integration
The goal of this section is to prove that integration commutes with continuous linear maps.
This holds for simple functions. The general result follows from the continuity of all involved
operations on the space `L¹`. Note that composition by a continuous linear map on `L¹` is not just
the composition, as we are dealing with classes of functions, but it has already been defined
as `ContinuousLinearMap.compLp`. We take advantage of this construction here.
-/
open scoped ComplexConjugate
variable {μ : Measure X} {𝕜 : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E]
[NormedAddCommGroup F] [NormedSpace 𝕜 F] {p : ENNReal}
namespace ContinuousLinearMap
variable [NormedSpace ℝ F]
theorem integral_compLp (L : E →L[𝕜] F) (φ : Lp E p μ) :
∫ x, (L.compLp φ) x ∂μ = ∫ x, L (φ x) ∂μ :=
integral_congr_ae <| coeFn_compLp _ _
theorem setIntegral_compLp (L : E →L[𝕜] F) (φ : Lp E p μ) {s : Set X} (hs : MeasurableSet s) :
∫ x in s, (L.compLp φ) x ∂μ = ∫ x in s, L (φ x) ∂μ :=
setIntegral_congr_ae hs ((L.coeFn_compLp φ).mono fun _x hx _ => hx)
@[deprecated (since := "2024-04-17")]
alias set_integral_compLp := setIntegral_compLp
theorem continuous_integral_comp_L1 (L : E →L[𝕜] F) :
Continuous fun φ : X →₁[μ] E => ∫ x : X, L (φ x) ∂μ := by
rw [← funext L.integral_compLp]; exact continuous_integral.comp (L.compLpL 1 μ).continuous
variable [CompleteSpace F] [NormedSpace ℝ E]
theorem integral_comp_comm [CompleteSpace E] (L : E →L[𝕜] 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 ℝ 𝕜 _ _ _ _ _ (μ s).toReal e,
ContinuousLinearMap.map_smul, @smul_one_smul F ℝ 𝕜 _ _ _ _ _ (μ s).toReal (L e), ←
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 integral_apply {H : Type*} [NormedAddCommGroup H] [NormedSpace 𝕜 H] {φ : X → H →L[𝕜] E}
(φ_int : Integrable φ μ) (v : H) : (∫ x, φ x ∂μ) v = ∫ x, φ x v ∂μ := by
by_cases hE : CompleteSpace E
· exact ((ContinuousLinearMap.apply 𝕜 E v).integral_comp_comm φ_int).symm
· rcases subsingleton_or_nontrivial H with hH|hH
· simp [Subsingleton.eq_zero v]
· have : ¬(CompleteSpace (H →L[𝕜] E)) := by
rwa [SeparatingDual.completeSpace_continuousLinearMap_iff]
simp [integral, hE, this]
theorem _root_.ContinuousMultilinearMap.integral_apply {ι : Type*} [Fintype ι] {M : ι → Type*}
[∀ i, NormedAddCommGroup (M i)] [∀ i, NormedSpace 𝕜 (M i)]
{φ : X → ContinuousMultilinearMap 𝕜 M E} (φ_int : Integrable φ μ) (m : ∀ i, M i) :
(∫ x, φ x ∂μ) m = ∫ x, φ x m ∂μ := by
by_cases hE : CompleteSpace E
· exact ((ContinuousMultilinearMap.apply 𝕜 M E m).integral_comp_comm φ_int).symm
· by_cases hm : ∀ i, m i ≠ 0
· have : ¬ CompleteSpace (ContinuousMultilinearMap 𝕜 M E) := by
rwa [SeparatingDual.completeSpace_continuousMultilinearMap_iff _ _ hm]
simp [integral, hE, this]
· push_neg at hm
rcases hm with ⟨i, hi⟩
simp [ContinuousMultilinearMap.map_coord_zero _ i hi]
variable [CompleteSpace E]
theorem integral_comp_comm' (L : E →L[𝕜] F) {K} (hL : AntilipschitzWith K L) (φ : X → E) :
∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ) := by
by_cases h : Integrable φ μ
· exact integral_comp_comm L h
have : ¬Integrable (fun x => L (φ x)) μ := by
rwa [← Function.comp_def,
LipschitzWith.integrable_comp_iff_of_antilipschitz L.lipschitz hL L.map_zero]
simp [integral_undef, h, this]
theorem integral_comp_L1_comm (L : E →L[𝕜] F) (φ : X →₁[μ] E) :
∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ) :=
L.integral_comp_comm (L1.integrable_coeFn φ)
end ContinuousLinearMap
namespace LinearIsometry
variable [CompleteSpace F] [NormedSpace ℝ F] [CompleteSpace E] [NormedSpace ℝ E]
theorem integral_comp_comm (L : E →ₗᵢ[𝕜] F) (φ : X → E) : ∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ) :=
L.toContinuousLinearMap.integral_comp_comm' L.antilipschitz _
end LinearIsometry
namespace ContinuousLinearEquiv
variable [NormedSpace ℝ F] [NormedSpace ℝ E]
theorem integral_comp_comm (L : E ≃L[𝕜] F) (φ : X → E) : ∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ) := by
have : CompleteSpace E ↔ CompleteSpace F :=
completeSpace_congr (e := L.toEquiv) L.uniformEmbedding
obtain ⟨_, _⟩|⟨_, _⟩ := iff_iff_and_or_not_and_not.mp this
· exact L.toContinuousLinearMap.integral_comp_comm' L.antilipschitz _
· simp [integral, *]
end ContinuousLinearEquiv
@[norm_cast]
theorem integral_ofReal {f : X → ℝ} : ∫ x, (f x : 𝕜) ∂μ = ↑(∫ x, f x ∂μ) :=
(@RCLike.ofRealLI 𝕜 _).integral_comp_comm f
theorem integral_re {f : X → 𝕜} (hf : Integrable f μ) :
∫ x, RCLike.re (f x) ∂μ = RCLike.re (∫ x, f x ∂μ) :=
(@RCLike.reCLM 𝕜 _).integral_comp_comm hf
theorem integral_im {f : X → 𝕜} (hf : Integrable f μ) :
∫ x, RCLike.im (f x) ∂μ = RCLike.im (∫ x, f x ∂μ) :=
(@RCLike.imCLM 𝕜 _).integral_comp_comm hf
theorem integral_conj {f : X → 𝕜} : ∫ x, conj (f x) ∂μ = conj (∫ x, f x ∂μ) :=
(@RCLike.conjLIE 𝕜 _).toLinearIsometry.integral_comp_comm f
theorem integral_coe_re_add_coe_im {f : X → 𝕜} (hf : Integrable f μ) :
∫ x, (re (f x) : 𝕜) ∂μ + (∫ x, (im (f x) : 𝕜) ∂μ) * RCLike.I = ∫ x, f x ∂μ := by
rw [mul_comm, ← smul_eq_mul, ← integral_smul, ← integral_add]
· congr
ext1 x
rw [smul_eq_mul, mul_comm, RCLike.re_add_im]
· exact hf.re.ofReal
· exact hf.im.ofReal.smul (𝕜 := 𝕜) (β := 𝕜) RCLike.I
theorem integral_re_add_im {f : X → 𝕜} (hf : Integrable f μ) :
((∫ x, RCLike.re (f x) ∂μ : ℝ) : 𝕜) + (∫ x, RCLike.im (f x) ∂μ : ℝ) * RCLike.I =
∫ x, f x ∂μ := by
rw [← integral_ofReal, ← integral_ofReal, integral_coe_re_add_coe_im hf]
theorem setIntegral_re_add_im {f : X → 𝕜} {i : Set X} (hf : IntegrableOn f i μ) :
((∫ x in i, RCLike.re (f x) ∂μ : ℝ) : 𝕜) + (∫ x in i, RCLike.im (f x) ∂μ : ℝ) * RCLike.I =
∫ x in i, f x ∂μ :=
integral_re_add_im hf
@[deprecated (since := "2024-04-17")]
alias set_integral_re_add_im := setIntegral_re_add_im
variable [NormedSpace ℝ E] [NormedSpace ℝ F]
lemma swap_integral (f : X → E × F) : (∫ x, f x ∂μ).swap = ∫ x, (f x).swap ∂μ :=
.symm <| (ContinuousLinearEquiv.prodComm ℝ E F).integral_comp_comm f
theorem fst_integral [CompleteSpace F] {f : X → E × F} (hf : Integrable f μ) :
(∫ x, f x ∂μ).1 = ∫ x, (f x).1 ∂μ := by
by_cases hE : CompleteSpace E
· exact ((ContinuousLinearMap.fst ℝ E F).integral_comp_comm hf).symm
· have : ¬(CompleteSpace (E × F)) := fun h ↦ hE <| .fst_of_prod (β := F)
simp [integral, *]
theorem snd_integral [CompleteSpace E] {f : X → E × F} (hf : Integrable f μ) :
(∫ x, f x ∂μ).2 = ∫ x, (f x).2 ∂μ := by
rw [← Prod.fst_swap, swap_integral]
exact fst_integral <| hf.snd.prod_mk hf.fst
theorem integral_pair [CompleteSpace E] [CompleteSpace F] {f : X → E} {g : X → F}
(hf : Integrable f μ) (hg : Integrable g μ) :
∫ x, (f x, g x) ∂μ = (∫ x, f x ∂μ, ∫ x, g x ∂μ) :=
have := hf.prod_mk hg
Prod.ext (fst_integral this) (snd_integral this)
theorem integral_smul_const {𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 E] [CompleteSpace E]
(f : X → 𝕜) (c : E) :
∫ x, f x • c ∂μ = (∫ x, f x ∂μ) • c := by
by_cases hf : Integrable f μ
· exact ((1 : 𝕜 →L[𝕜] 𝕜).smulRight c).integral_comp_comm hf
· by_cases hc : c = 0
· simp [hc, integral_zero, smul_zero]
rw [integral_undef hf, integral_undef, zero_smul]
rw [integrable_smul_const hc]
simp_rw [hf, not_false_eq_true]
theorem integral_withDensity_eq_integral_smul {f : X → ℝ≥0} (f_meas : Measurable f) (g : X → E) :
∫ x, g x ∂μ.withDensity (fun x => f x) = ∫ x, f x • g x ∂μ := by
by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
· rw [integral_undef hg, integral_undef]
rwa [← integrable_withDensity_iff_integrable_smul f_meas]
refine Integrable.induction
(P := fun g => ∫ x, g x ∂μ.withDensity (fun x => f x) = ∫ x, f x • g x ∂μ) ?_ ?_ ?_ ?_ hg
· intro c s s_meas hs
rw [integral_indicator s_meas]
simp_rw [← indicator_smul_apply, integral_indicator s_meas]
simp only [s_meas, integral_const, Measure.restrict_apply', univ_inter, withDensity_apply]
rw [lintegral_coe_eq_integral, ENNReal.toReal_ofReal, ← integral_smul_const]
· rfl
· exact integral_nonneg fun x => NNReal.coe_nonneg _
· refine ⟨f_meas.coe_nnreal_real.aemeasurable.aestronglyMeasurable, ?_⟩
rw [withDensity_apply _ s_meas] at hs
rw [HasFiniteIntegral]
convert hs with x
simp only [NNReal.nnnorm_eq]
· intro u u' _ u_int u'_int h h'
change
(∫ x : X, u x + u' x ∂μ.withDensity fun x : X => ↑(f x)) = ∫ x : X, f x • (u x + u' x) ∂μ
simp_rw [smul_add]
rw [integral_add u_int u'_int, h, h', integral_add]
· exact (integrable_withDensity_iff_integrable_smul f_meas).1 u_int
· exact (integrable_withDensity_iff_integrable_smul f_meas).1 u'_int
· have C1 :
Continuous fun u : Lp E 1 (μ.withDensity fun x => f x) =>
∫ x, u x ∂μ.withDensity fun x => f x :=
continuous_integral
have C2 : Continuous fun u : Lp E 1 (μ.withDensity fun x => f x) => ∫ x, f x • u x ∂μ := by
have : Continuous ((fun u : Lp E 1 μ => ∫ x, u x ∂μ) ∘ withDensitySMulLI (E := E) μ f_meas) :=
continuous_integral.comp (withDensitySMulLI (E := E) μ f_meas).continuous
convert this with u
simp only [Function.comp_apply, withDensitySMulLI_apply]
exact integral_congr_ae (memℒ1_smul_of_L1_withDensity f_meas u).coeFn_toLp.symm
exact isClosed_eq C1 C2
· intro u v huv _ hu
rw [← integral_congr_ae huv, hu]
apply integral_congr_ae
filter_upwards [(ae_withDensity_iff f_meas.coe_nnreal_ennreal).1 huv] with x hx
rcases eq_or_ne (f x) 0 with (h'x | h'x)
· simp only [h'x, zero_smul]
· rw [hx _]
simpa only [Ne, ENNReal.coe_eq_zero] using h'x
theorem integral_withDensity_eq_integral_smul₀ {f : X → ℝ≥0} (hf : AEMeasurable f μ) (g : X → E) :
∫ x, g x ∂μ.withDensity (fun x => f x) = ∫ x, f x • g x ∂μ := by
let f' := hf.mk _
calc
∫ x, g x ∂μ.withDensity (fun x => f x) = ∫ x, g x ∂μ.withDensity fun x => f' x := by
congr 1
apply withDensity_congr_ae
filter_upwards [hf.ae_eq_mk] with x hx
rw [hx]
_ = ∫ x, f' x • g x ∂μ := integral_withDensity_eq_integral_smul hf.measurable_mk _
_ = ∫ x, f x • g x ∂μ := by
apply integral_congr_ae
filter_upwards [hf.ae_eq_mk] with x hx
rw [hx]
theorem setIntegral_withDensity_eq_setIntegral_smul {f : X → ℝ≥0} (f_meas : Measurable f)
(g : X → E) {s : Set X} (hs : MeasurableSet s) :
∫ x in s, g x ∂μ.withDensity (fun x => f x) = ∫ x in s, f x • g x ∂μ := by
rw [restrict_withDensity hs, integral_withDensity_eq_integral_smul f_meas]
@[deprecated (since := "2024-04-17")]
alias set_integral_withDensity_eq_set_integral_smul := setIntegral_withDensity_eq_setIntegral_smul
theorem setIntegral_withDensity_eq_setIntegral_smul₀ {f : X → ℝ≥0} {s : Set X}
(hf : AEMeasurable f (μ.restrict s)) (g : X → E) (hs : MeasurableSet s) :
∫ x in s, g x ∂μ.withDensity (fun x => f x) = ∫ x in s, f x • g x ∂μ := by
rw [restrict_withDensity hs, integral_withDensity_eq_integral_smul₀ hf]
@[deprecated (since := "2024-04-17")]
alias set_integral_withDensity_eq_set_integral_smul₀ := setIntegral_withDensity_eq_setIntegral_smul₀
theorem setIntegral_withDensity_eq_setIntegral_smul₀' [SFinite μ] {f : X → ℝ≥0} (s : Set X)
(hf : AEMeasurable f (μ.restrict s)) (g : X → E) :
∫ x in s, g x ∂μ.withDensity (fun x => f x) = ∫ x in s, f x • g x ∂μ := by
rw [restrict_withDensity' s, integral_withDensity_eq_integral_smul₀ hf]
@[deprecated (since := "2024-04-17")]
alias set_integral_withDensity_eq_set_integral_smul₀' :=
setIntegral_withDensity_eq_setIntegral_smul₀'
end
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∞) ∂μ := 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∞) ∂μ := by
convert measure_le_lintegral_thickenedIndicatorAux μ E_mble δ
dsimp
simp only [thickenedIndicatorAux_lt_top.ne, ENNReal.coe_toNNReal, Ne, not_false_iff]
end thickenedIndicator
section BilinearMap
namespace MeasureTheory
variable {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, Algebra.id.smul_eq_mul,
← Function.const_def]
· simp only [hx, Pi.mul_apply, Set.indicator_of_not_mem, 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]
[OpensMeasurableSpace Y] [SecondCountableTopologyEither Y E] [IsLocallyFiniteMeasure μ]
{f : X → Y → E} (hf : Continuous f.uncurry) {s : Set Y} (hs : IsCompact s) :
Continuous (∫ y in s, f · y ∂μ) := 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.mpr (Or.inr hs.measure_lt_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) ∂μ) s := by
have A : ∀ p ∈ s, Continuous (f p) := fun p hp ↦ by
refine hf.comp_continuous (continuous_const.prod_mk continuous_id') fun y => ?_
simpa only [prod_mk_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‖ * δ ∂μ < ε := by
simpa [integral_mul_right] 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) ∂μ - ∫ x, L (g x) (f q x) ∂μ‖
= ‖∫ x in k, L (g x) (f p x) ∂μ - ∫ x in k, L (g x) (f q x) ∂μ‖ := 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) ∂μ‖ := 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)‖ ∂μ := norm_integral_le_integral_norm _
_ ≤ ∫ x in k, ‖L‖ * ‖g x‖ * δ ∂μ := 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, mul_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 ∂μ) s := by
simpa using continuousOn_integral_bilinear_of_locally_integrable_of_compact_support (lsmul ℝ ℝ)
hk hf hfs (integrableOn_const.2 (Or.inr hk.measure_lt_top)) (μ := μ) (g := fun _ ↦ 1)
end ParametricIntegral
|
MeasureTheory\Integral\SetToL1.lean | /-
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
-/
import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp
/-!
# Extension of a linear function from indicators to L1
Let `T : Set α → E →L[ℝ] F` be additive for measurable sets with finite measure, in the sense that
for `s, t` two such sets, `s ∩ t = ∅ → T (s ∪ t) = T s + T t`. `T` is akin to a bilinear map on
`Set α × E`, or a linear map on indicator functions.
This file constructs an extension of `T` to integrable simple functions, which are finite sums of
indicators of measurable sets with finite measure, then to integrable functions, which are limits of
integrable simple functions.
The main result is a continuous linear map `(α →₁[μ] E) →L[ℝ] F`. This extension process is used to
define the Bochner integral in the `MeasureTheory.Integral.Bochner` file and the conditional
expectation of an integrable function in `MeasureTheory.Function.ConditionalExpectation`.
## Main Definitions
- `FinMeasAdditive μ T`: the property that `T` is additive on measurable sets with finite measure.
For two such sets, `s ∩ t = ∅ → T (s ∪ t) = T s + T t`.
- `DominatedFinMeasAdditive μ T C`: `FinMeasAdditive μ T ∧ ∀ s, ‖T s‖ ≤ C * (μ s).toReal`.
This is the property needed to perform the extension from indicators to L1.
- `setToL1 (hT : DominatedFinMeasAdditive μ T C) : (α →₁[μ] E) →L[ℝ] F`: the extension of `T`
from indicators to L1.
- `setToFun μ T (hT : DominatedFinMeasAdditive μ T C) (f : α → E) : F`: a version of the
extension which applies to functions (with value 0 if the function is not integrable).
## Properties
For most properties of `setToFun`, we provide two lemmas. One version uses hypotheses valid on
all sets, like `T = T'`, and a second version which uses a primed name uses hypotheses on
measurable sets with finite measure, like `∀ s, MeasurableSet s → μ s < ∞ → T s = T' s`.
The lemmas listed here don't show all hypotheses. Refer to the actual lemmas for details.
Linearity:
- `setToFun_zero_left : setToFun μ 0 hT f = 0`
- `setToFun_add_left : setToFun μ (T + T') _ f = setToFun μ T hT f + setToFun μ T' hT' f`
- `setToFun_smul_left : setToFun μ (fun s ↦ c • (T s)) (hT.smul c) f = c • setToFun μ T hT f`
- `setToFun_zero : setToFun μ T hT (0 : α → E) = 0`
- `setToFun_neg : setToFun μ T hT (-f) = - setToFun μ T hT f`
If `f` and `g` are integrable:
- `setToFun_add : setToFun μ T hT (f + g) = setToFun μ T hT f + setToFun μ T hT g`
- `setToFun_sub : setToFun μ T hT (f - g) = setToFun μ T hT f - setToFun μ T hT g`
If `T` is verifies `∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x`:
- `setToFun_smul : setToFun μ T hT (c • f) = c • setToFun μ T hT f`
Other:
- `setToFun_congr_ae (h : f =ᵐ[μ] g) : setToFun μ T hT f = setToFun μ T hT g`
- `setToFun_measure_zero (h : μ = 0) : setToFun μ T hT f = 0`
If the space is a `NormedLatticeAddCommGroup` and `T` is such that `0 ≤ T s x` for `0 ≤ x`, we
also prove order-related properties:
- `setToFun_mono_left (h : ∀ s x, T s x ≤ T' s x) : setToFun μ T hT f ≤ setToFun μ T' hT' f`
- `setToFun_nonneg (hf : 0 ≤ᵐ[μ] f) : 0 ≤ setToFun μ T hT f`
- `setToFun_mono (hfg : f ≤ᵐ[μ] g) : setToFun μ T hT f ≤ setToFun μ T hT g`
## Implementation notes
The starting object `T : Set α → E →L[ℝ] F` matters only through its restriction on measurable sets
with finite measure. Its value on other sets is ignored.
-/
noncomputable section
open scoped Topology NNReal ENNReal MeasureTheory Pointwise
open Set Filter TopologicalSpace ENNReal EMetric
namespace MeasureTheory
variable {α E F F' G 𝕜 : Type*} {p : ℝ≥0∞} [NormedAddCommGroup E] [NormedSpace ℝ E]
[NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup F'] [NormedSpace ℝ F']
[NormedAddCommGroup G] {m : MeasurableSpace α} {μ : Measure α}
local infixr:25 " →ₛ " => SimpleFunc
open Finset
section FinMeasAdditive
/-- A set function is `FinMeasAdditive` if its value on the union of two disjoint measurable
sets with finite measure is the sum of its values on each set. -/
def FinMeasAdditive {β} [AddMonoid β] {_ : MeasurableSpace α} (μ : Measure α) (T : Set α → β) :
Prop :=
∀ s t, MeasurableSet s → MeasurableSet t → μ s ≠ ∞ → μ t ≠ ∞ → s ∩ t = ∅ → T (s ∪ t) = T s + T t
namespace FinMeasAdditive
variable {β : Type*} [AddCommMonoid β] {T T' : Set α → β}
theorem zero : FinMeasAdditive μ (0 : Set α → β) := fun s t _ _ _ _ _ => by simp
theorem add (hT : FinMeasAdditive μ T) (hT' : FinMeasAdditive μ T') :
FinMeasAdditive μ (T + T') := by
intro s t hs ht hμs hμt hst
simp only [hT s t hs ht hμs hμt hst, hT' s t hs ht hμs hμt hst, Pi.add_apply]
abel
theorem smul [Monoid 𝕜] [DistribMulAction 𝕜 β] (hT : FinMeasAdditive μ T) (c : 𝕜) :
FinMeasAdditive μ fun s => c • T s := fun s t hs ht hμs hμt hst => by
simp [hT s t hs ht hμs hμt hst]
theorem of_eq_top_imp_eq_top {μ' : Measure α} (h : ∀ s, MeasurableSet s → μ s = ∞ → μ' s = ∞)
(hT : FinMeasAdditive μ T) : FinMeasAdditive μ' T := fun s t hs ht hμ's hμ't hst =>
hT s t hs ht (mt (h s hs) hμ's) (mt (h t ht) hμ't) hst
theorem of_smul_measure (c : ℝ≥0∞) (hc_ne_top : c ≠ ∞) (hT : FinMeasAdditive (c • μ) T) :
FinMeasAdditive μ T := by
refine of_eq_top_imp_eq_top (fun s _ hμs => ?_) hT
rw [Measure.smul_apply, smul_eq_mul, ENNReal.mul_eq_top] at hμs
simp only [hc_ne_top, or_false_iff, Ne, false_and_iff] at hμs
exact hμs.2
theorem smul_measure (c : ℝ≥0∞) (hc_ne_zero : c ≠ 0) (hT : FinMeasAdditive μ T) :
FinMeasAdditive (c • μ) T := by
refine of_eq_top_imp_eq_top (fun s _ hμs => ?_) hT
rw [Measure.smul_apply, smul_eq_mul, ENNReal.mul_eq_top]
simp only [hc_ne_zero, true_and_iff, Ne, not_false_iff]
exact Or.inl hμs
theorem smul_measure_iff (c : ℝ≥0∞) (hc_ne_zero : c ≠ 0) (hc_ne_top : c ≠ ∞) :
FinMeasAdditive (c • μ) T ↔ FinMeasAdditive μ T :=
⟨fun hT => of_smul_measure c hc_ne_top hT, fun hT => smul_measure c hc_ne_zero hT⟩
theorem map_empty_eq_zero {β} [AddCancelMonoid β] {T : Set α → β} (hT : FinMeasAdditive μ T) :
T ∅ = 0 := by
have h_empty : μ ∅ ≠ ∞ := (measure_empty.le.trans_lt ENNReal.coe_lt_top).ne
specialize hT ∅ ∅ MeasurableSet.empty MeasurableSet.empty h_empty h_empty (Set.inter_empty ∅)
rw [Set.union_empty] at hT
nth_rw 1 [← add_zero (T ∅)] at hT
exact (add_left_cancel hT).symm
theorem map_iUnion_fin_meas_set_eq_sum (T : Set α → β) (T_empty : T ∅ = 0)
(h_add : FinMeasAdditive μ T) {ι} (S : ι → Set α) (sι : Finset ι)
(hS_meas : ∀ i, MeasurableSet (S i)) (hSp : ∀ i ∈ sι, μ (S i) ≠ ∞)
(h_disj : ∀ᵉ (i ∈ sι) (j ∈ sι), i ≠ j → Disjoint (S i) (S j)) :
T (⋃ i ∈ sι, S i) = ∑ i ∈ sι, T (S i) := by
classical
revert hSp h_disj
refine Finset.induction_on sι ?_ ?_
· simp only [Finset.not_mem_empty, IsEmpty.forall_iff, iUnion_false, iUnion_empty, sum_empty,
forall₂_true_iff, imp_true_iff, forall_true_left, not_false_iff, T_empty]
intro a s has h hps h_disj
rw [Finset.sum_insert has, ← h]
swap; · exact fun i hi => hps i (Finset.mem_insert_of_mem hi)
swap
· exact fun i hi j hj hij =>
h_disj i (Finset.mem_insert_of_mem hi) j (Finset.mem_insert_of_mem hj) hij
rw [←
h_add (S a) (⋃ i ∈ s, S i) (hS_meas a) (measurableSet_biUnion _ fun i _ => hS_meas i)
(hps a (Finset.mem_insert_self a s))]
· congr; convert Finset.iSup_insert a s S
· exact
((measure_biUnion_finset_le _ _).trans_lt <|
ENNReal.sum_lt_top fun i hi => hps i <| Finset.mem_insert_of_mem hi).ne
· simp_rw [Set.inter_iUnion]
refine iUnion_eq_empty.mpr fun i => iUnion_eq_empty.mpr fun hi => ?_
rw [← Set.disjoint_iff_inter_eq_empty]
refine h_disj a (Finset.mem_insert_self a s) i (Finset.mem_insert_of_mem hi) fun hai => ?_
rw [← hai] at hi
exact has hi
end FinMeasAdditive
/-- A `FinMeasAdditive` set function whose norm on every set is less than the measure of the
set (up to a multiplicative constant). -/
def DominatedFinMeasAdditive {β} [SeminormedAddCommGroup β] {_ : MeasurableSpace α} (μ : Measure α)
(T : Set α → β) (C : ℝ) : Prop :=
FinMeasAdditive μ T ∧ ∀ s, MeasurableSet s → μ s < ∞ → ‖T s‖ ≤ C * (μ s).toReal
namespace DominatedFinMeasAdditive
variable {β : Type*} [SeminormedAddCommGroup β] {T T' : Set α → β} {C C' : ℝ}
theorem zero {m : MeasurableSpace α} (μ : Measure α) (hC : 0 ≤ C) :
DominatedFinMeasAdditive μ (0 : Set α → β) C := by
refine ⟨FinMeasAdditive.zero, fun s _ _ => ?_⟩
rw [Pi.zero_apply, norm_zero]
exact mul_nonneg hC toReal_nonneg
theorem eq_zero_of_measure_zero {β : Type*} [NormedAddCommGroup β] {T : Set α → β} {C : ℝ}
(hT : DominatedFinMeasAdditive μ T C) {s : Set α} (hs : MeasurableSet s) (hs_zero : μ s = 0) :
T s = 0 := by
refine norm_eq_zero.mp ?_
refine ((hT.2 s hs (by simp [hs_zero])).trans (le_of_eq ?_)).antisymm (norm_nonneg _)
rw [hs_zero, ENNReal.zero_toReal, mul_zero]
theorem eq_zero {β : Type*} [NormedAddCommGroup β] {T : Set α → β} {C : ℝ} {m : MeasurableSpace α}
(hT : DominatedFinMeasAdditive (0 : Measure α) T C) {s : Set α} (hs : MeasurableSet s) :
T s = 0 :=
eq_zero_of_measure_zero hT hs (by simp only [Measure.coe_zero, Pi.zero_apply])
theorem add (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') :
DominatedFinMeasAdditive μ (T + T') (C + C') := by
refine ⟨hT.1.add hT'.1, fun s hs hμs => ?_⟩
rw [Pi.add_apply, add_mul]
exact (norm_add_le _ _).trans (add_le_add (hT.2 s hs hμs) (hT'.2 s hs hμs))
theorem smul [NormedField 𝕜] [NormedSpace 𝕜 β] (hT : DominatedFinMeasAdditive μ T C) (c : 𝕜) :
DominatedFinMeasAdditive μ (fun s => c • T s) (‖c‖ * C) := by
refine ⟨hT.1.smul c, fun s hs hμs => ?_⟩
dsimp only
rw [norm_smul, mul_assoc]
exact mul_le_mul le_rfl (hT.2 s hs hμs) (norm_nonneg _) (norm_nonneg _)
theorem of_measure_le {μ' : Measure α} (h : μ ≤ μ') (hT : DominatedFinMeasAdditive μ T C)
(hC : 0 ≤ C) : DominatedFinMeasAdditive μ' T C := by
have h' : ∀ s, μ s = ∞ → μ' s = ∞ := fun s hs ↦ top_unique <| hs.symm.trans_le (h _)
refine ⟨hT.1.of_eq_top_imp_eq_top fun s _ ↦ h' s, fun s hs hμ's ↦ ?_⟩
have hμs : μ s < ∞ := (h s).trans_lt hμ's
calc
‖T s‖ ≤ C * (μ s).toReal := hT.2 s hs hμs
_ ≤ C * (μ' s).toReal := by gcongr; exacts [hμ's.ne, h _]
theorem add_measure_right {_ : MeasurableSpace α} (μ ν : Measure α)
(hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) : DominatedFinMeasAdditive (μ + ν) T C :=
of_measure_le (Measure.le_add_right le_rfl) hT hC
theorem add_measure_left {_ : MeasurableSpace α} (μ ν : Measure α)
(hT : DominatedFinMeasAdditive ν T C) (hC : 0 ≤ C) : DominatedFinMeasAdditive (μ + ν) T C :=
of_measure_le (Measure.le_add_left le_rfl) hT hC
theorem of_smul_measure (c : ℝ≥0∞) (hc_ne_top : c ≠ ∞) (hT : DominatedFinMeasAdditive (c • μ) T C) :
DominatedFinMeasAdditive μ T (c.toReal * C) := by
have h : ∀ s, MeasurableSet s → c • μ s = ∞ → μ s = ∞ := by
intro s _ hcμs
simp only [hc_ne_top, Algebra.id.smul_eq_mul, ENNReal.mul_eq_top, or_false_iff, Ne,
false_and_iff] at hcμs
exact hcμs.2
refine ⟨hT.1.of_eq_top_imp_eq_top (μ := c • μ) h, fun s hs hμs => ?_⟩
have hcμs : c • μ s ≠ ∞ := mt (h s hs) hμs.ne
rw [smul_eq_mul] at hcμs
simp_rw [DominatedFinMeasAdditive, Measure.smul_apply, smul_eq_mul, toReal_mul] at hT
refine (hT.2 s hs hcμs.lt_top).trans (le_of_eq ?_)
ring
theorem of_measure_le_smul {μ' : Measure α} (c : ℝ≥0∞) (hc : c ≠ ∞) (h : μ ≤ c • μ')
(hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) :
DominatedFinMeasAdditive μ' T (c.toReal * C) :=
(hT.of_measure_le h hC).of_smul_measure c hc
end DominatedFinMeasAdditive
end FinMeasAdditive
namespace SimpleFunc
/-- Extend `Set α → (F →L[ℝ] F')` to `(α →ₛ F) → F'`. -/
def setToSimpleFunc {_ : MeasurableSpace α} (T : Set α → F →L[ℝ] F') (f : α →ₛ F) : F' :=
∑ x ∈ f.range, T (f ⁻¹' {x}) x
@[simp]
theorem setToSimpleFunc_zero {m : MeasurableSpace α} (f : α →ₛ F) :
setToSimpleFunc (0 : Set α → F →L[ℝ] F') f = 0 := by simp [setToSimpleFunc]
theorem setToSimpleFunc_zero' {T : Set α → E →L[ℝ] F'}
(h_zero : ∀ s, MeasurableSet s → μ s < ∞ → T s = 0) (f : α →ₛ E) (hf : Integrable f μ) :
setToSimpleFunc T f = 0 := by
simp_rw [setToSimpleFunc]
refine sum_eq_zero fun x _ => ?_
by_cases hx0 : x = 0
· simp [hx0]
rw [h_zero (f ⁻¹' ({x} : Set E)) (measurableSet_fiber _ _)
(measure_preimage_lt_top_of_integrable f hf hx0),
ContinuousLinearMap.zero_apply]
@[simp]
theorem setToSimpleFunc_zero_apply {m : MeasurableSpace α} (T : Set α → F →L[ℝ] F') :
setToSimpleFunc T (0 : α →ₛ F) = 0 := by
cases isEmpty_or_nonempty α <;> simp [setToSimpleFunc]
theorem setToSimpleFunc_eq_sum_filter [DecidablePred fun x ↦ x ≠ (0 : F)]
{m : MeasurableSpace α} (T : Set α → F →L[ℝ] F')
(f : α →ₛ F) :
setToSimpleFunc T f = ∑ x ∈ f.range.filter fun x => x ≠ 0, (T (f ⁻¹' {x})) x := by
symm
refine sum_filter_of_ne fun x _ => mt fun hx0 => ?_
rw [hx0]
exact ContinuousLinearMap.map_zero _
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
classical
have T_empty : T ∅ = 0 := h_add.map_empty_eq_zero
have hfp : ∀ x ∈ f.range, x ≠ 0 → μ (f ⁻¹' {x}) ≠ ∞ := fun x _ hx0 =>
(measure_preimage_lt_top_of_integrable f hf hx0).ne
simp only [setToSimpleFunc, range_map]
refine Finset.sum_image' _ fun b hb => ?_
rcases mem_range.1 hb with ⟨a, rfl⟩
by_cases h0 : g (f a) = 0
· simp_rw [h0]
rw [ContinuousLinearMap.map_zero, Finset.sum_eq_zero fun x hx => ?_]
rw [mem_filter] at hx
rw [hx.2, ContinuousLinearMap.map_zero]
have h_left_eq :
T (map g f ⁻¹' {g (f a)}) (g (f a)) =
T (f ⁻¹' (f.range.filter fun b => g b = g (f a))) (g (f a)) := by
congr; rw [map_preimage_singleton]
rw [h_left_eq]
have h_left_eq' :
T (f ⁻¹' (filter (fun b : G => g b = g (f a)) f.range)) (g (f a)) =
T (⋃ y ∈ filter (fun b : G => g b = g (f a)) f.range, f ⁻¹' {y}) (g (f a)) := by
congr; rw [← Finset.set_biUnion_preimage_singleton]
rw [h_left_eq']
rw [h_add.map_iUnion_fin_meas_set_eq_sum T T_empty]
· simp only [sum_apply, ContinuousLinearMap.coe_sum']
refine Finset.sum_congr rfl fun x hx => ?_
rw [mem_filter] at hx
rw [hx.2]
· exact fun i => measurableSet_fiber _ _
· intro i hi
rw [mem_filter] at hi
refine hfp i hi.1 fun hi0 => ?_
rw [hi0, hg] at hi
exact h0 hi.2.symm
· intro i _j hi _ hij
rw [Set.disjoint_iff]
intro x hx
rw [Set.mem_inter_iff, Set.mem_preimage, Set.mem_preimage, Set.mem_singleton_iff,
Set.mem_singleton_iff] at hx
rw [← hx.1, ← hx.2] at hij
exact absurd rfl hij
theorem setToSimpleFunc_congr' (T : Set α → E →L[ℝ] F) (h_add : FinMeasAdditive μ T) {f g : α →ₛ E}
(hf : Integrable f μ) (hg : Integrable g μ)
(h : Pairwise fun x y => T (f ⁻¹' {x} ∩ g ⁻¹' {y}) = 0) :
f.setToSimpleFunc T = g.setToSimpleFunc T :=
show ((pair f g).map Prod.fst).setToSimpleFunc T = ((pair f g).map Prod.snd).setToSimpleFunc T by
have h_pair : Integrable (f.pair g) μ := integrable_pair hf hg
rw [map_setToSimpleFunc T h_add h_pair Prod.fst_zero]
rw [map_setToSimpleFunc T h_add h_pair Prod.snd_zero]
refine Finset.sum_congr rfl fun p hp => ?_
rcases mem_range.1 hp with ⟨a, rfl⟩
by_cases eq : f a = g a
· dsimp only [pair_apply]; rw [eq]
· have : T (pair f g ⁻¹' {(f a, g a)}) = 0 := by
have h_eq : T ((⇑(f.pair g)) ⁻¹' {(f a, g a)}) = T (f ⁻¹' {f a} ∩ g ⁻¹' {g a}) := by
congr; rw [pair_preimage_singleton f g]
rw [h_eq]
exact h eq
simp only [this, ContinuousLinearMap.zero_apply, pair_apply]
theorem setToSimpleFunc_congr (T : Set α → E →L[ℝ] F)
(h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0) (h_add : FinMeasAdditive μ T) {f g : α →ₛ E}
(hf : Integrable f μ) (h : f =ᵐ[μ] g) : f.setToSimpleFunc T = g.setToSimpleFunc T := by
refine setToSimpleFunc_congr' T h_add hf ((integrable_congr h).mp hf) ?_
refine fun x y hxy => h_zero _ ((measurableSet_fiber f x).inter (measurableSet_fiber g y)) ?_
rw [EventuallyEq, ae_iff] at h
refine measure_mono_null (fun z => ?_) h
simp_rw [Set.mem_inter_iff, Set.mem_setOf_eq, Set.mem_preimage, Set.mem_singleton_iff]
intro h
rwa [h.1, h.2]
theorem setToSimpleFunc_congr_left (T T' : Set α → E →L[ℝ] F)
(h : ∀ s, MeasurableSet s → μ s < ∞ → T s = T' s) (f : α →ₛ E) (hf : Integrable f μ) :
setToSimpleFunc T f = setToSimpleFunc T' f := by
simp_rw [setToSimpleFunc]
refine sum_congr rfl fun x _ => ?_
by_cases hx0 : x = 0
· simp [hx0]
· rw [h (f ⁻¹' {x}) (SimpleFunc.measurableSet_fiber _ _)
(SimpleFunc.measure_preimage_lt_top_of_integrable _ hf hx0)]
theorem setToSimpleFunc_add_left {m : MeasurableSpace α} (T T' : Set α → F →L[ℝ] F') {f : α →ₛ F} :
setToSimpleFunc (T + T') f = setToSimpleFunc T f + setToSimpleFunc T' f := by
simp_rw [setToSimpleFunc, Pi.add_apply]
push_cast
simp_rw [Pi.add_apply, sum_add_distrib]
theorem setToSimpleFunc_add_left' (T T' T'' : Set α → E →L[ℝ] F)
(h_add : ∀ s, MeasurableSet s → μ s < ∞ → T'' s = T s + T' s) {f : α →ₛ E}
(hf : Integrable f μ) : setToSimpleFunc T'' f = setToSimpleFunc T f + setToSimpleFunc T' f := by
classical
simp_rw [setToSimpleFunc_eq_sum_filter]
suffices
∀ x ∈ filter (fun x : E => x ≠ 0) f.range, T'' (f ⁻¹' {x}) = T (f ⁻¹' {x}) + T' (f ⁻¹' {x}) by
rw [← sum_add_distrib]
refine Finset.sum_congr rfl fun x hx => ?_
rw [this x hx]
push_cast
rw [Pi.add_apply]
intro x hx
refine
h_add (f ⁻¹' {x}) (measurableSet_preimage _ _) (measure_preimage_lt_top_of_integrable _ hf ?_)
rw [mem_filter] at hx
exact hx.2
theorem setToSimpleFunc_smul_left {m : MeasurableSpace α} (T : Set α → F →L[ℝ] F') (c : ℝ)
(f : α →ₛ F) : setToSimpleFunc (fun s => c • T s) f = c • setToSimpleFunc T f := by
simp_rw [setToSimpleFunc, ContinuousLinearMap.smul_apply, smul_sum]
theorem setToSimpleFunc_smul_left' (T T' : Set α → E →L[ℝ] F') (c : ℝ)
(h_smul : ∀ s, MeasurableSet s → μ s < ∞ → T' s = c • T s) {f : α →ₛ E} (hf : Integrable f μ) :
setToSimpleFunc T' f = c • setToSimpleFunc T f := by
classical
simp_rw [setToSimpleFunc_eq_sum_filter]
suffices ∀ x ∈ filter (fun x : E => x ≠ 0) f.range, T' (f ⁻¹' {x}) = c • T (f ⁻¹' {x}) by
rw [smul_sum]
refine Finset.sum_congr rfl fun x hx => ?_
rw [this x hx]
rfl
intro x hx
refine
h_smul (f ⁻¹' {x}) (measurableSet_preimage _ _) (measure_preimage_lt_top_of_integrable _ hf ?_)
rw [mem_filter] at hx
exact hx.2
theorem setToSimpleFunc_add (T : Set α → E →L[ℝ] F) (h_add : FinMeasAdditive μ T) {f g : α →ₛ E}
(hf : Integrable f μ) (hg : Integrable g μ) :
setToSimpleFunc T (f + g) = setToSimpleFunc T f + setToSimpleFunc T g :=
have hp_pair : Integrable (f.pair g) μ := integrable_pair hf hg
calc
setToSimpleFunc T (f + g) = ∑ x ∈ (pair f g).range, T (pair f g ⁻¹' {x}) (x.fst + x.snd) := by
rw [add_eq_map₂, map_setToSimpleFunc T h_add hp_pair]; simp
_ = ∑ x ∈ (pair f g).range, (T (pair f g ⁻¹' {x}) x.fst + T (pair f g ⁻¹' {x}) x.snd) :=
(Finset.sum_congr rfl fun a _ => ContinuousLinearMap.map_add _ _ _)
_ = (∑ x ∈ (pair f g).range, T (pair f g ⁻¹' {x}) x.fst) +
∑ x ∈ (pair f g).range, T (pair f g ⁻¹' {x}) x.snd := by
rw [Finset.sum_add_distrib]
_ = ((pair f g).map Prod.fst).setToSimpleFunc T +
((pair f g).map Prod.snd).setToSimpleFunc T := by
rw [map_setToSimpleFunc T h_add hp_pair Prod.snd_zero,
map_setToSimpleFunc T h_add hp_pair Prod.fst_zero]
theorem setToSimpleFunc_neg (T : Set α → E →L[ℝ] F) (h_add : FinMeasAdditive μ T) {f : α →ₛ E}
(hf : Integrable f μ) : setToSimpleFunc T (-f) = -setToSimpleFunc T f :=
calc
setToSimpleFunc T (-f) = setToSimpleFunc T (f.map Neg.neg) := rfl
_ = -setToSimpleFunc T f := by
rw [map_setToSimpleFunc T h_add hf neg_zero, setToSimpleFunc, ← sum_neg_distrib]
exact Finset.sum_congr rfl fun x _ => ContinuousLinearMap.map_neg _ _
theorem setToSimpleFunc_sub (T : Set α → E →L[ℝ] F) (h_add : FinMeasAdditive μ T) {f g : α →ₛ E}
(hf : Integrable f μ) (hg : Integrable g μ) :
setToSimpleFunc T (f - g) = setToSimpleFunc T f - setToSimpleFunc T g := by
rw [sub_eq_add_neg, setToSimpleFunc_add T h_add hf, setToSimpleFunc_neg T h_add hg,
sub_eq_add_neg]
rw [integrable_iff] at hg ⊢
intro x hx_ne
change μ (Neg.neg ∘ g ⁻¹' {x}) < ∞
rw [preimage_comp, neg_preimage, Set.neg_singleton]
refine hg (-x) ?_
simp [hx_ne]
theorem setToSimpleFunc_smul_real (T : Set α → E →L[ℝ] F) (h_add : FinMeasAdditive μ T) (c : ℝ)
{f : α →ₛ E} (hf : Integrable f μ) : setToSimpleFunc T (c • f) = c • setToSimpleFunc T f :=
calc
setToSimpleFunc T (c • f) = ∑ x ∈ f.range, T (f ⁻¹' {x}) (c • x) := by
rw [smul_eq_map c f, map_setToSimpleFunc T h_add hf]; dsimp only; rw [smul_zero]
_ = ∑ x ∈ f.range, c • T (f ⁻¹' {x}) x :=
(Finset.sum_congr rfl fun b _ => by rw [ContinuousLinearMap.map_smul (T (f ⁻¹' {b})) c b])
_ = c • setToSimpleFunc T f := by simp only [setToSimpleFunc, smul_sum, smul_smul, mul_comm]
theorem setToSimpleFunc_smul {E} [NormedAddCommGroup E] [NormedField 𝕜] [NormedSpace 𝕜 E]
[NormedSpace ℝ E] [NormedSpace 𝕜 F] (T : Set α → E →L[ℝ] F) (h_add : FinMeasAdditive μ T)
(h_smul : ∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x) (c : 𝕜) {f : α →ₛ E} (hf : Integrable f μ) :
setToSimpleFunc T (c • f) = c • setToSimpleFunc T f :=
calc
setToSimpleFunc T (c • f) = ∑ x ∈ f.range, T (f ⁻¹' {x}) (c • x) := by
rw [smul_eq_map c f, map_setToSimpleFunc T h_add hf]; dsimp only; rw [smul_zero]
_ = ∑ x ∈ f.range, c • T (f ⁻¹' {x}) x := Finset.sum_congr rfl fun b _ => by rw [h_smul]
_ = c • setToSimpleFunc T f := by simp only [setToSimpleFunc, smul_sum, smul_smul, mul_comm]
section Order
variable {G' G'' : Type*} [NormedLatticeAddCommGroup G''] [NormedSpace ℝ G'']
[NormedLatticeAddCommGroup G'] [NormedSpace ℝ G']
theorem setToSimpleFunc_mono_left {m : MeasurableSpace α} (T T' : Set α → F →L[ℝ] G'')
(hTT' : ∀ s x, T s x ≤ T' s x) (f : α →ₛ F) : setToSimpleFunc T f ≤ setToSimpleFunc T' f := by
simp_rw [setToSimpleFunc]; exact sum_le_sum fun i _ => hTT' _ i
theorem setToSimpleFunc_mono_left' (T T' : Set α → E →L[ℝ] G'')
(hTT' : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, T s x ≤ T' s x) (f : α →ₛ E)
(hf : Integrable f μ) : setToSimpleFunc T f ≤ setToSimpleFunc T' f := by
refine sum_le_sum fun i _ => ?_
by_cases h0 : i = 0
· simp [h0]
· exact hTT' _ (measurableSet_fiber _ _) (measure_preimage_lt_top_of_integrable _ hf h0) i
theorem setToSimpleFunc_nonneg {m : MeasurableSpace α} (T : Set α → G' →L[ℝ] G'')
(hT_nonneg : ∀ s x, 0 ≤ x → 0 ≤ T s x) (f : α →ₛ G') (hf : 0 ≤ f) :
0 ≤ setToSimpleFunc T f := by
refine sum_nonneg fun i hi => hT_nonneg _ i ?_
rw [mem_range] at hi
obtain ⟨y, hy⟩ := Set.mem_range.mp hi
rw [← hy]
refine le_trans ?_ (hf y)
simp
theorem setToSimpleFunc_nonneg' (T : Set α → G' →L[ℝ] G'')
(hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) (f : α →ₛ G') (hf : 0 ≤ f)
(hfi : Integrable f μ) : 0 ≤ setToSimpleFunc T f := by
refine sum_nonneg fun i hi => ?_
by_cases h0 : i = 0
· simp [h0]
refine
hT_nonneg _ (measurableSet_fiber _ _) (measure_preimage_lt_top_of_integrable _ hfi h0) i ?_
rw [mem_range] at hi
obtain ⟨y, hy⟩ := Set.mem_range.mp hi
rw [← hy]
convert hf y
theorem setToSimpleFunc_mono {T : Set α → G' →L[ℝ] G''} (h_add : FinMeasAdditive μ T)
(hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f g : α →ₛ G'}
(hfi : Integrable f μ) (hgi : Integrable g μ) (hfg : f ≤ g) :
setToSimpleFunc T f ≤ setToSimpleFunc T g := by
rw [← sub_nonneg, ← setToSimpleFunc_sub T h_add hgi hfi]
refine setToSimpleFunc_nonneg' T hT_nonneg _ ?_ (hgi.sub hfi)
intro x
simp only [coe_sub, sub_nonneg, coe_zero, Pi.zero_apply, Pi.sub_apply]
exact hfg x
end Order
theorem norm_setToSimpleFunc_le_sum_opNorm {m : MeasurableSpace α} (T : Set α → F' →L[ℝ] F)
(f : α →ₛ F') : ‖f.setToSimpleFunc T‖ ≤ ∑ x ∈ f.range, ‖T (f ⁻¹' {x})‖ * ‖x‖ :=
calc
‖∑ x ∈ f.range, T (f ⁻¹' {x}) x‖ ≤ ∑ x ∈ f.range, ‖T (f ⁻¹' {x}) x‖ := norm_sum_le _ _
_ ≤ ∑ x ∈ f.range, ‖T (f ⁻¹' {x})‖ * ‖x‖ := by
refine Finset.sum_le_sum fun b _ => ?_; simp_rw [ContinuousLinearMap.le_opNorm]
@[deprecated (since := "2024-02-02")]
alias norm_setToSimpleFunc_le_sum_op_norm := norm_setToSimpleFunc_le_sum_opNorm
theorem norm_setToSimpleFunc_le_sum_mul_norm (T : Set α → F →L[ℝ] F') {C : ℝ}
(hT_norm : ∀ s, MeasurableSet s → ‖T s‖ ≤ C * (μ s).toReal) (f : α →ₛ F) :
‖f.setToSimpleFunc T‖ ≤ C * ∑ x ∈ f.range, (μ (f ⁻¹' {x})).toReal * ‖x‖ :=
calc
‖f.setToSimpleFunc T‖ ≤ ∑ x ∈ f.range, ‖T (f ⁻¹' {x})‖ * ‖x‖ :=
norm_setToSimpleFunc_le_sum_opNorm T f
_ ≤ ∑ x ∈ f.range, C * (μ (f ⁻¹' {x})).toReal * ‖x‖ := by
gcongr
exact hT_norm _ <| SimpleFunc.measurableSet_fiber _ _
_ ≤ C * ∑ x ∈ f.range, (μ (f ⁻¹' {x})).toReal * ‖x‖ := by simp_rw [mul_sum, ← mul_assoc]; rfl
theorem norm_setToSimpleFunc_le_sum_mul_norm_of_integrable (T : Set α → E →L[ℝ] F') {C : ℝ}
(hT_norm : ∀ s, MeasurableSet s → μ s < ∞ → ‖T s‖ ≤ C * (μ s).toReal) (f : α →ₛ E)
(hf : Integrable f μ) :
‖f.setToSimpleFunc T‖ ≤ C * ∑ x ∈ f.range, (μ (f ⁻¹' {x})).toReal * ‖x‖ :=
calc
‖f.setToSimpleFunc T‖ ≤ ∑ x ∈ f.range, ‖T (f ⁻¹' {x})‖ * ‖x‖ :=
norm_setToSimpleFunc_le_sum_opNorm T f
_ ≤ ∑ x ∈ f.range, C * (μ (f ⁻¹' {x})).toReal * ‖x‖ := by
refine Finset.sum_le_sum fun b hb => ?_
obtain rfl | hb := eq_or_ne b 0
· simp
gcongr
exact hT_norm _ (SimpleFunc.measurableSet_fiber _ _) <|
SimpleFunc.measure_preimage_lt_top_of_integrable _ hf hb
_ ≤ C * ∑ x ∈ f.range, (μ (f ⁻¹' {x})).toReal * ‖x‖ := by simp_rw [mul_sum, ← mul_assoc]; rfl
theorem setToSimpleFunc_indicator (T : Set α → F →L[ℝ] F') (hT_empty : T ∅ = 0)
{m : MeasurableSpace α} {s : Set α} (hs : MeasurableSet s) (x : F) :
SimpleFunc.setToSimpleFunc T
(SimpleFunc.piecewise s hs (SimpleFunc.const α x) (SimpleFunc.const α 0)) =
T s x := by
classical
obtain rfl | hs_empty := s.eq_empty_or_nonempty
· simp only [hT_empty, ContinuousLinearMap.zero_apply, piecewise_empty, const_zero,
setToSimpleFunc_zero_apply]
simp_rw [setToSimpleFunc]
obtain rfl | hs_univ := eq_or_ne s univ
· haveI hα := hs_empty.to_type
simp [← Function.const_def]
rw [range_indicator hs hs_empty hs_univ]
by_cases hx0 : x = 0
· simp_rw [hx0]; simp
rw [sum_insert]
swap; · rw [Finset.mem_singleton]; exact hx0
rw [sum_singleton, (T _).map_zero, add_zero]
congr
simp only [coe_piecewise, piecewise_eq_indicator, coe_const, Function.const_zero,
piecewise_eq_indicator]
rw [indicator_preimage, ← Function.const_def, preimage_const_of_mem]
swap; · exact Set.mem_singleton x
rw [← Function.const_zero, ← Function.const_def, preimage_const_of_not_mem]
swap; · rw [Set.mem_singleton_iff]; exact Ne.symm hx0
simp
theorem setToSimpleFunc_const' [Nonempty α] (T : Set α → F →L[ℝ] F') (x : F)
{m : MeasurableSpace α} : SimpleFunc.setToSimpleFunc T (SimpleFunc.const α x) = T univ x := by
simp only [setToSimpleFunc, range_const, Set.mem_singleton, preimage_const_of_mem,
sum_singleton, ← Function.const_def, coe_const]
theorem setToSimpleFunc_const (T : Set α → F →L[ℝ] F') (hT_empty : T ∅ = 0) (x : F)
{m : MeasurableSpace α} : SimpleFunc.setToSimpleFunc T (SimpleFunc.const α x) = T univ x := by
cases isEmpty_or_nonempty α
· have h_univ_empty : (univ : Set α) = ∅ := Subsingleton.elim _ _
rw [h_univ_empty, hT_empty]
simp only [setToSimpleFunc, ContinuousLinearMap.zero_apply, sum_empty,
range_eq_empty_of_isEmpty]
· exact setToSimpleFunc_const' T x
end SimpleFunc
namespace L1
open AEEqFun Lp.simpleFunc Lp
namespace SimpleFunc
theorem norm_eq_sum_mul (f : α →₁ₛ[μ] G) :
‖f‖ = ∑ x ∈ (toSimpleFunc f).range, (μ (toSimpleFunc f ⁻¹' {x})).toReal * ‖x‖ := by
rw [norm_toSimpleFunc, eLpNorm_one_eq_lintegral_nnnorm]
have h_eq := SimpleFunc.map_apply (fun x => (‖x‖₊ : ℝ≥0∞)) (toSimpleFunc f)
simp_rw [← h_eq]
rw [SimpleFunc.lintegral_eq_lintegral, SimpleFunc.map_lintegral, ENNReal.toReal_sum]
· congr
ext1 x
rw [ENNReal.toReal_mul, mul_comm, ← ofReal_norm_eq_coe_nnnorm,
ENNReal.toReal_ofReal (norm_nonneg _)]
· intro x _
by_cases hx0 : x = 0
· rw [hx0]; simp
· exact
ENNReal.mul_ne_top ENNReal.coe_ne_top
(SimpleFunc.measure_preimage_lt_top_of_integrable _ (SimpleFunc.integrable f) hx0).ne
section SetToL1S
variable [NormedField 𝕜] [NormedSpace 𝕜 E]
attribute [local instance] Lp.simpleFunc.module
attribute [local instance] Lp.simpleFunc.normedSpace
/-- Extend `Set α → (E →L[ℝ] F')` to `(α →₁ₛ[μ] E) → F'`. -/
def setToL1S (T : Set α → E →L[ℝ] F) (f : α →₁ₛ[μ] E) : F :=
(toSimpleFunc f).setToSimpleFunc T
theorem setToL1S_eq_setToSimpleFunc (T : Set α → E →L[ℝ] F) (f : α →₁ₛ[μ] E) :
setToL1S T f = (toSimpleFunc f).setToSimpleFunc T :=
rfl
@[simp]
theorem setToL1S_zero_left (f : α →₁ₛ[μ] E) : setToL1S (0 : Set α → E →L[ℝ] F) f = 0 :=
SimpleFunc.setToSimpleFunc_zero _
theorem setToL1S_zero_left' {T : Set α → E →L[ℝ] F}
(h_zero : ∀ s, MeasurableSet s → μ s < ∞ → T s = 0) (f : α →₁ₛ[μ] E) : setToL1S T f = 0 :=
SimpleFunc.setToSimpleFunc_zero' h_zero _ (SimpleFunc.integrable f)
theorem setToL1S_congr (T : Set α → E →L[ℝ] F) (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
(h_add : FinMeasAdditive μ T) {f g : α →₁ₛ[μ] E} (h : toSimpleFunc f =ᵐ[μ] toSimpleFunc g) :
setToL1S T f = setToL1S T g :=
SimpleFunc.setToSimpleFunc_congr T h_zero h_add (SimpleFunc.integrable f) h
theorem setToL1S_congr_left (T T' : Set α → E →L[ℝ] F)
(h : ∀ s, MeasurableSet s → μ s < ∞ → T s = T' s) (f : α →₁ₛ[μ] E) :
setToL1S T f = setToL1S T' f :=
SimpleFunc.setToSimpleFunc_congr_left T T' h (simpleFunc.toSimpleFunc f) (SimpleFunc.integrable f)
/-- `setToL1S` does not change if we replace the measure `μ` by `μ'` with `μ ≪ μ'`. The statement
uses two functions `f` and `f'` because they have to belong to different types, but morally these
are the same function (we have `f =ᵐ[μ] f'`). -/
theorem setToL1S_congr_measure {μ' : Measure α} (T : Set α → E →L[ℝ] F)
(h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0) (h_add : FinMeasAdditive μ T) (hμ : μ ≪ μ')
(f : α →₁ₛ[μ] E) (f' : α →₁ₛ[μ'] E) (h : (f : α → E) =ᵐ[μ] f') :
setToL1S T f = setToL1S T f' := by
refine SimpleFunc.setToSimpleFunc_congr T h_zero h_add (SimpleFunc.integrable f) ?_
refine (toSimpleFunc_eq_toFun f).trans ?_
suffices (f' : α → E) =ᵐ[μ] simpleFunc.toSimpleFunc f' from h.trans this
have goal' : (f' : α → E) =ᵐ[μ'] simpleFunc.toSimpleFunc f' := (toSimpleFunc_eq_toFun f').symm
exact hμ.ae_eq goal'
theorem setToL1S_add_left (T T' : Set α → E →L[ℝ] F) (f : α →₁ₛ[μ] E) :
setToL1S (T + T') f = setToL1S T f + setToL1S T' f :=
SimpleFunc.setToSimpleFunc_add_left T T'
theorem setToL1S_add_left' (T T' T'' : Set α → E →L[ℝ] F)
(h_add : ∀ s, MeasurableSet s → μ s < ∞ → T'' s = T s + T' s) (f : α →₁ₛ[μ] E) :
setToL1S T'' f = setToL1S T f + setToL1S T' f :=
SimpleFunc.setToSimpleFunc_add_left' T T' T'' h_add (SimpleFunc.integrable f)
theorem setToL1S_smul_left (T : Set α → E →L[ℝ] F) (c : ℝ) (f : α →₁ₛ[μ] E) :
setToL1S (fun s => c • T s) f = c • setToL1S T f :=
SimpleFunc.setToSimpleFunc_smul_left T c _
theorem setToL1S_smul_left' (T T' : Set α → E →L[ℝ] F) (c : ℝ)
(h_smul : ∀ s, MeasurableSet s → μ s < ∞ → T' s = c • T s) (f : α →₁ₛ[μ] E) :
setToL1S T' f = c • setToL1S T f :=
SimpleFunc.setToSimpleFunc_smul_left' T T' c h_smul (SimpleFunc.integrable f)
theorem setToL1S_add (T : Set α → E →L[ℝ] F) (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
(h_add : FinMeasAdditive μ T) (f g : α →₁ₛ[μ] E) :
setToL1S T (f + g) = setToL1S T f + setToL1S T g := by
simp_rw [setToL1S]
rw [← SimpleFunc.setToSimpleFunc_add T h_add (SimpleFunc.integrable f)
(SimpleFunc.integrable g)]
exact
SimpleFunc.setToSimpleFunc_congr T h_zero h_add (SimpleFunc.integrable _)
(add_toSimpleFunc f g)
theorem setToL1S_neg {T : Set α → E →L[ℝ] F} (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
(h_add : FinMeasAdditive μ T) (f : α →₁ₛ[μ] E) : setToL1S T (-f) = -setToL1S T f := by
simp_rw [setToL1S]
have : simpleFunc.toSimpleFunc (-f) =ᵐ[μ] ⇑(-simpleFunc.toSimpleFunc f) :=
neg_toSimpleFunc f
rw [SimpleFunc.setToSimpleFunc_congr T h_zero h_add (SimpleFunc.integrable _) this]
exact SimpleFunc.setToSimpleFunc_neg T h_add (SimpleFunc.integrable f)
theorem setToL1S_sub {T : Set α → E →L[ℝ] F} (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
(h_add : FinMeasAdditive μ T) (f g : α →₁ₛ[μ] E) :
setToL1S T (f - g) = setToL1S T f - setToL1S T g := by
rw [sub_eq_add_neg, setToL1S_add T h_zero h_add, setToL1S_neg h_zero h_add, sub_eq_add_neg]
theorem setToL1S_smul_real (T : Set α → E →L[ℝ] F)
(h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0) (h_add : FinMeasAdditive μ T) (c : ℝ)
(f : α →₁ₛ[μ] E) : setToL1S T (c • f) = c • setToL1S T f := by
simp_rw [setToL1S]
rw [← SimpleFunc.setToSimpleFunc_smul_real T h_add c (SimpleFunc.integrable f)]
refine SimpleFunc.setToSimpleFunc_congr T h_zero h_add (SimpleFunc.integrable _) ?_
exact smul_toSimpleFunc c f
theorem setToL1S_smul {E} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedSpace 𝕜 E]
[NormedSpace 𝕜 F] (T : Set α → E →L[ℝ] F) (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
(h_add : FinMeasAdditive μ T) (h_smul : ∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x) (c : 𝕜)
(f : α →₁ₛ[μ] E) : setToL1S T (c • f) = c • setToL1S T f := by
simp_rw [setToL1S]
rw [← SimpleFunc.setToSimpleFunc_smul T h_add h_smul c (SimpleFunc.integrable f)]
refine SimpleFunc.setToSimpleFunc_congr T h_zero h_add (SimpleFunc.integrable _) ?_
exact smul_toSimpleFunc c f
theorem norm_setToL1S_le (T : Set α → E →L[ℝ] F) {C : ℝ}
(hT_norm : ∀ s, MeasurableSet s → μ s < ∞ → ‖T s‖ ≤ C * (μ s).toReal) (f : α →₁ₛ[μ] E) :
‖setToL1S T f‖ ≤ C * ‖f‖ := by
rw [setToL1S, norm_eq_sum_mul f]
exact
SimpleFunc.norm_setToSimpleFunc_le_sum_mul_norm_of_integrable T hT_norm _
(SimpleFunc.integrable f)
theorem setToL1S_indicatorConst {T : Set α → E →L[ℝ] F} {s : Set α}
(h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0) (h_add : FinMeasAdditive μ T)
(hs : MeasurableSet s) (hμs : μ s < ∞) (x : E) :
setToL1S T (simpleFunc.indicatorConst 1 hs hμs.ne x) = T s x := by
have h_empty : T ∅ = 0 := h_zero _ MeasurableSet.empty measure_empty
rw [setToL1S_eq_setToSimpleFunc]
refine Eq.trans ?_ (SimpleFunc.setToSimpleFunc_indicator T h_empty hs x)
refine SimpleFunc.setToSimpleFunc_congr T h_zero h_add (SimpleFunc.integrable _) ?_
exact toSimpleFunc_indicatorConst hs hμs.ne x
theorem setToL1S_const [IsFiniteMeasure μ] {T : Set α → E →L[ℝ] F}
(h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0) (h_add : FinMeasAdditive μ T) (x : E) :
setToL1S T (simpleFunc.indicatorConst 1 MeasurableSet.univ (measure_ne_top μ _) x) = T univ x :=
setToL1S_indicatorConst h_zero h_add MeasurableSet.univ (measure_lt_top _ _) x
section Order
variable {G'' G' : Type*} [NormedLatticeAddCommGroup G'] [NormedSpace ℝ G']
[NormedLatticeAddCommGroup G''] [NormedSpace ℝ G''] {T : Set α → G'' →L[ℝ] G'}
theorem setToL1S_mono_left {T T' : Set α → E →L[ℝ] G''} (hTT' : ∀ s x, T s x ≤ T' s x)
(f : α →₁ₛ[μ] E) : setToL1S T f ≤ setToL1S T' f :=
SimpleFunc.setToSimpleFunc_mono_left T T' hTT' _
theorem setToL1S_mono_left' {T T' : Set α → E →L[ℝ] G''}
(hTT' : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, T s x ≤ T' s x) (f : α →₁ₛ[μ] E) :
setToL1S T f ≤ setToL1S T' f :=
SimpleFunc.setToSimpleFunc_mono_left' T T' hTT' _ (SimpleFunc.integrable f)
theorem setToL1S_nonneg (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
(h_add : FinMeasAdditive μ T)
(hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f : α →₁ₛ[μ] G''}
(hf : 0 ≤ f) : 0 ≤ setToL1S T f := by
simp_rw [setToL1S]
obtain ⟨f', hf', hff'⟩ : ∃ f' : α →ₛ G'', 0 ≤ f' ∧ simpleFunc.toSimpleFunc f =ᵐ[μ] f' := by
obtain ⟨f'', hf'', hff''⟩ := exists_simpleFunc_nonneg_ae_eq hf
exact ⟨f'', hf'', (Lp.simpleFunc.toSimpleFunc_eq_toFun f).trans hff''⟩
rw [SimpleFunc.setToSimpleFunc_congr _ h_zero h_add (SimpleFunc.integrable _) hff']
exact
SimpleFunc.setToSimpleFunc_nonneg' T hT_nonneg _ hf' ((SimpleFunc.integrable f).congr hff')
theorem setToL1S_mono (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
(h_add : FinMeasAdditive μ T)
(hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f g : α →₁ₛ[μ] G''}
(hfg : f ≤ g) : setToL1S T f ≤ setToL1S T g := by
rw [← sub_nonneg] at hfg ⊢
rw [← setToL1S_sub h_zero h_add]
exact setToL1S_nonneg h_zero h_add hT_nonneg hfg
end Order
variable [NormedSpace 𝕜 F]
variable (α E μ 𝕜)
/-- Extend `Set α → E →L[ℝ] F` to `(α →₁ₛ[μ] E) →L[𝕜] F`. -/
def setToL1SCLM' {T : Set α → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
(h_smul : ∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x) : (α →₁ₛ[μ] E) →L[𝕜] F :=
LinearMap.mkContinuous
⟨⟨setToL1S T, setToL1S_add T (fun _ => hT.eq_zero_of_measure_zero) hT.1⟩,
setToL1S_smul T (fun _ => hT.eq_zero_of_measure_zero) hT.1 h_smul⟩
C fun f => norm_setToL1S_le T hT.2 f
/-- Extend `Set α → E →L[ℝ] F` to `(α →₁ₛ[μ] E) →L[ℝ] F`. -/
def setToL1SCLM {T : Set α → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C) :
(α →₁ₛ[μ] E) →L[ℝ] F :=
LinearMap.mkContinuous
⟨⟨setToL1S T, setToL1S_add T (fun _ => hT.eq_zero_of_measure_zero) hT.1⟩,
setToL1S_smul_real T (fun _ => hT.eq_zero_of_measure_zero) hT.1⟩
C fun f => norm_setToL1S_le T hT.2 f
variable {α E μ 𝕜}
variable {T T' T'' : Set α → E →L[ℝ] F} {C C' C'' : ℝ}
@[simp]
theorem setToL1SCLM_zero_left (hT : DominatedFinMeasAdditive μ (0 : Set α → E →L[ℝ] F) C)
(f : α →₁ₛ[μ] E) : setToL1SCLM α E μ hT f = 0 :=
setToL1S_zero_left _
theorem setToL1SCLM_zero_left' (hT : DominatedFinMeasAdditive μ T C)
(h_zero : ∀ s, MeasurableSet s → μ s < ∞ → T s = 0) (f : α →₁ₛ[μ] E) :
setToL1SCLM α E μ hT f = 0 :=
setToL1S_zero_left' h_zero f
theorem setToL1SCLM_congr_left (hT : DominatedFinMeasAdditive μ T C)
(hT' : DominatedFinMeasAdditive μ T' C') (h : T = T') (f : α →₁ₛ[μ] E) :
setToL1SCLM α E μ hT f = setToL1SCLM α E μ hT' f :=
setToL1S_congr_left T T' (fun _ _ _ => by rw [h]) f
theorem setToL1SCLM_congr_left' (hT : DominatedFinMeasAdditive μ T C)
(hT' : DominatedFinMeasAdditive μ T' C') (h : ∀ s, MeasurableSet s → μ s < ∞ → T s = T' s)
(f : α →₁ₛ[μ] E) : setToL1SCLM α E μ hT f = setToL1SCLM α E μ hT' f :=
setToL1S_congr_left T T' h f
theorem setToL1SCLM_congr_measure {μ' : Measure α} (hT : DominatedFinMeasAdditive μ T C)
(hT' : DominatedFinMeasAdditive μ' T C') (hμ : μ ≪ μ') (f : α →₁ₛ[μ] E) (f' : α →₁ₛ[μ'] E)
(h : (f : α → E) =ᵐ[μ] f') : setToL1SCLM α E μ hT f = setToL1SCLM α E μ' hT' f' :=
setToL1S_congr_measure T (fun _ => hT.eq_zero_of_measure_zero) hT.1 hμ _ _ h
theorem setToL1SCLM_add_left (hT : DominatedFinMeasAdditive μ T C)
(hT' : DominatedFinMeasAdditive μ T' C') (f : α →₁ₛ[μ] E) :
setToL1SCLM α E μ (hT.add hT') f = setToL1SCLM α E μ hT f + setToL1SCLM α E μ hT' f :=
setToL1S_add_left T T' f
theorem setToL1SCLM_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) :
setToL1SCLM α E μ hT'' f = setToL1SCLM α E μ hT f + setToL1SCLM α E μ hT' f :=
setToL1S_add_left' T T' T'' h_add f
theorem setToL1SCLM_smul_left (c : ℝ) (hT : DominatedFinMeasAdditive μ T C) (f : α →₁ₛ[μ] E) :
setToL1SCLM α E μ (hT.smul c) f = c • setToL1SCLM α E μ hT f :=
setToL1S_smul_left T c f
theorem setToL1SCLM_smul_left' (c : ℝ) (hT : DominatedFinMeasAdditive μ T C)
(hT' : DominatedFinMeasAdditive μ T' C')
(h_smul : ∀ s, MeasurableSet s → μ s < ∞ → T' s = c • T s) (f : α →₁ₛ[μ] E) :
setToL1SCLM α E μ hT' f = c • setToL1SCLM α E μ hT f :=
setToL1S_smul_left' T T' c h_smul f
theorem norm_setToL1SCLM_le {T : Set α → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
(hC : 0 ≤ C) : ‖setToL1SCLM α E μ hT‖ ≤ C :=
LinearMap.mkContinuous_norm_le _ hC _
theorem norm_setToL1SCLM_le' {T : Set α → E →L[ℝ] F} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C) :
‖setToL1SCLM α E μ hT‖ ≤ max C 0 :=
LinearMap.mkContinuous_norm_le' _ _
theorem setToL1SCLM_const [IsFiniteMeasure μ] {T : Set α → E →L[ℝ] F} {C : ℝ}
(hT : DominatedFinMeasAdditive μ T C) (x : E) :
setToL1SCLM α E μ hT (simpleFunc.indicatorConst 1 MeasurableSet.univ (measure_ne_top μ _) x) =
T univ x :=
setToL1S_const (fun _ => hT.eq_zero_of_measure_zero) hT.1 x
section Order
variable {G' G'' : Type*} [NormedLatticeAddCommGroup G''] [NormedSpace ℝ G'']
[NormedLatticeAddCommGroup G'] [NormedSpace ℝ G']
theorem setToL1SCLM_mono_left {T T' : Set α → E →L[ℝ] G''} {C C' : ℝ}
(hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C')
(hTT' : ∀ s x, T s x ≤ T' s x) (f : α →₁ₛ[μ] E) :
setToL1SCLM α E μ hT f ≤ setToL1SCLM α E μ hT' f :=
SimpleFunc.setToSimpleFunc_mono_left T T' hTT' _
theorem setToL1SCLM_mono_left' {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) :
setToL1SCLM α E μ hT f ≤ setToL1SCLM α E μ hT' f :=
SimpleFunc.setToSimpleFunc_mono_left' T T' hTT' _ (SimpleFunc.integrable f)
theorem setToL1SCLM_nonneg {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
(hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f : α →₁ₛ[μ] G'}
(hf : 0 ≤ f) : 0 ≤ setToL1SCLM α G' μ hT f :=
setToL1S_nonneg (fun _ => hT.eq_zero_of_measure_zero) hT.1 hT_nonneg hf
theorem setToL1SCLM_mono {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
(hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f g : α →₁ₛ[μ] G'}
(hfg : f ≤ g) : setToL1SCLM α G' μ hT f ≤ setToL1SCLM α G' μ hT g :=
setToL1S_mono (fun _ => hT.eq_zero_of_measure_zero) hT.1 hT_nonneg hfg
end Order
end SetToL1S
end SimpleFunc
open SimpleFunc
section SetToL1
attribute [local instance] Lp.simpleFunc.module
attribute [local instance] Lp.simpleFunc.normedSpace
variable (𝕜) [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E] [NormedSpace 𝕜 F] [CompleteSpace F]
{T T' T'' : Set α → E →L[ℝ] F} {C C' C'' : ℝ}
/-- Extend `set α → (E →L[ℝ] F)` to `(α →₁[μ] E) →L[𝕜] F`. -/
def setToL1' (hT : DominatedFinMeasAdditive μ T C)
(h_smul : ∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x) : (α →₁[μ] E) →L[𝕜] F :=
(setToL1SCLM' α E 𝕜 μ hT h_smul).extend (coeToLp α E 𝕜) (simpleFunc.denseRange one_ne_top)
simpleFunc.uniformInducing
variable {𝕜}
/-- Extend `Set α → E →L[ℝ] F` to `(α →₁[μ] E) →L[ℝ] F`. -/
def setToL1 (hT : DominatedFinMeasAdditive μ T C) : (α →₁[μ] E) →L[ℝ] F :=
(setToL1SCLM α E μ hT).extend (coeToLp α E ℝ) (simpleFunc.denseRange one_ne_top)
simpleFunc.uniformInducing
theorem setToL1_eq_setToL1SCLM (hT : DominatedFinMeasAdditive μ T C) (f : α →₁ₛ[μ] E) :
setToL1 hT f = setToL1SCLM α E μ hT f :=
uniformly_extend_of_ind simpleFunc.uniformInducing (simpleFunc.denseRange one_ne_top)
(setToL1SCLM α E μ hT).uniformContinuous _
theorem setToL1_eq_setToL1' (hT : DominatedFinMeasAdditive μ T C)
(h_smul : ∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x) (f : α →₁[μ] E) :
setToL1 hT f = setToL1' 𝕜 hT h_smul f :=
rfl
@[simp]
theorem setToL1_zero_left (hT : DominatedFinMeasAdditive μ (0 : Set α → E →L[ℝ] F) C)
(f : α →₁[μ] E) : setToL1 hT f = 0 := by
suffices setToL1 hT = 0 by rw [this]; simp
refine ContinuousLinearMap.extend_unique (setToL1SCLM α E μ hT) _ _ _ _ ?_
ext1 f
rw [setToL1SCLM_zero_left hT f, ContinuousLinearMap.zero_comp, ContinuousLinearMap.zero_apply]
theorem setToL1_zero_left' (hT : DominatedFinMeasAdditive μ T C)
(h_zero : ∀ s, MeasurableSet s → μ s < ∞ → T s = 0) (f : α →₁[μ] E) : setToL1 hT f = 0 := by
suffices setToL1 hT = 0 by rw [this]; simp
refine ContinuousLinearMap.extend_unique (setToL1SCLM α E μ hT) _ _ _ _ ?_
ext1 f
rw [setToL1SCLM_zero_left' hT h_zero f, ContinuousLinearMap.zero_comp,
ContinuousLinearMap.zero_apply]
theorem setToL1_congr_left (T T' : Set α → E →L[ℝ] F) {C C' : ℝ}
(hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') (h : T = T')
(f : α →₁[μ] E) : setToL1 hT f = setToL1 hT' f := by
suffices setToL1 hT = setToL1 hT' by rw [this]
refine ContinuousLinearMap.extend_unique (setToL1SCLM α E μ hT) _ _ _ _ ?_
ext1 f
suffices setToL1 hT' f = setToL1SCLM α E μ hT f by rw [← this]; rfl
rw [setToL1_eq_setToL1SCLM]
exact setToL1SCLM_congr_left hT' hT h.symm f
theorem setToL1_congr_left' (T T' : Set α → E →L[ℝ] F) {C C' : ℝ}
(hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C')
(h : ∀ s, MeasurableSet s → μ s < ∞ → T s = T' s) (f : α →₁[μ] E) :
setToL1 hT f = setToL1 hT' f := by
suffices setToL1 hT = setToL1 hT' by rw [this]
refine ContinuousLinearMap.extend_unique (setToL1SCLM α E μ hT) _ _ _ _ ?_
ext1 f
suffices setToL1 hT' f = setToL1SCLM α E μ hT f by rw [← this]; rfl
rw [setToL1_eq_setToL1SCLM]
exact (setToL1SCLM_congr_left' hT hT' h f).symm
theorem setToL1_add_left (hT : DominatedFinMeasAdditive μ T C)
(hT' : DominatedFinMeasAdditive μ T' C') (f : α →₁[μ] E) :
setToL1 (hT.add hT') f = setToL1 hT f + setToL1 hT' f := by
suffices setToL1 (hT.add hT') = setToL1 hT + setToL1 hT' by
rw [this, ContinuousLinearMap.add_apply]
refine ContinuousLinearMap.extend_unique (setToL1SCLM α E μ (hT.add hT')) _ _ _ _ ?_
ext1 f
suffices setToL1 hT f + setToL1 hT' f = setToL1SCLM α E μ (hT.add hT') f by
rw [← this]; rfl
rw [setToL1_eq_setToL1SCLM, setToL1_eq_setToL1SCLM, setToL1SCLM_add_left hT hT']
theorem setToL1_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) :
setToL1 hT'' f = setToL1 hT f + setToL1 hT' f := by
suffices setToL1 hT'' = setToL1 hT + setToL1 hT' by rw [this, ContinuousLinearMap.add_apply]
refine ContinuousLinearMap.extend_unique (setToL1SCLM α E μ hT'') _ _ _ _ ?_
ext1 f
suffices setToL1 hT f + setToL1 hT' f = setToL1SCLM α E μ hT'' f by rw [← this]; congr
rw [setToL1_eq_setToL1SCLM, setToL1_eq_setToL1SCLM,
setToL1SCLM_add_left' hT hT' hT'' h_add]
theorem setToL1_smul_left (hT : DominatedFinMeasAdditive μ T C) (c : ℝ) (f : α →₁[μ] E) :
setToL1 (hT.smul c) f = c • setToL1 hT f := by
suffices setToL1 (hT.smul c) = c • setToL1 hT by rw [this, ContinuousLinearMap.smul_apply]
refine ContinuousLinearMap.extend_unique (setToL1SCLM α E μ (hT.smul c)) _ _ _ _ ?_
ext1 f
suffices c • setToL1 hT f = setToL1SCLM α E μ (hT.smul c) f by rw [← this]; congr
rw [setToL1_eq_setToL1SCLM, setToL1SCLM_smul_left c hT]
theorem setToL1_smul_left' (hT : DominatedFinMeasAdditive μ T C)
(hT' : DominatedFinMeasAdditive μ T' C') (c : ℝ)
(h_smul : ∀ s, MeasurableSet s → μ s < ∞ → T' s = c • T s) (f : α →₁[μ] E) :
setToL1 hT' f = c • setToL1 hT f := by
suffices setToL1 hT' = c • setToL1 hT by rw [this, ContinuousLinearMap.smul_apply]
refine ContinuousLinearMap.extend_unique (setToL1SCLM α E μ hT') _ _ _ _ ?_
ext1 f
suffices c • setToL1 hT f = setToL1SCLM α E μ hT' f by rw [← this]; congr
rw [setToL1_eq_setToL1SCLM, setToL1SCLM_smul_left' c hT hT' h_smul]
theorem setToL1_smul (hT : DominatedFinMeasAdditive μ T C)
(h_smul : ∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x) (c : 𝕜) (f : α →₁[μ] E) :
setToL1 hT (c • f) = c • setToL1 hT f := by
rw [setToL1_eq_setToL1' hT h_smul, setToL1_eq_setToL1' hT h_smul]
exact ContinuousLinearMap.map_smul _ _ _
theorem setToL1_simpleFunc_indicatorConst (hT : DominatedFinMeasAdditive μ T C) {s : Set α}
(hs : MeasurableSet s) (hμs : μ s < ∞) (x : E) :
setToL1 hT (simpleFunc.indicatorConst 1 hs hμs.ne x) = T s x := by
rw [setToL1_eq_setToL1SCLM]
exact setToL1S_indicatorConst (fun s => hT.eq_zero_of_measure_zero) hT.1 hs hμs x
theorem setToL1_indicatorConstLp (hT : DominatedFinMeasAdditive μ T C) {s : Set α}
(hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : E) :
setToL1 hT (indicatorConstLp 1 hs hμs x) = T s x := by
rw [← Lp.simpleFunc.coe_indicatorConst hs hμs x]
exact setToL1_simpleFunc_indicatorConst hT hs hμs.lt_top x
theorem setToL1_const [IsFiniteMeasure μ] (hT : DominatedFinMeasAdditive μ T C) (x : E) :
setToL1 hT (indicatorConstLp 1 MeasurableSet.univ (measure_ne_top _ _) x) = T univ x :=
setToL1_indicatorConstLp hT MeasurableSet.univ (measure_ne_top _ _) x
section Order
variable {G' G'' : Type*} [NormedLatticeAddCommGroup G''] [NormedSpace ℝ G''] [CompleteSpace G'']
[NormedLatticeAddCommGroup G'] [NormedSpace ℝ G']
theorem setToL1_mono_left' {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) :
setToL1 hT f ≤ setToL1 hT' f := by
induction f using Lp.induction (hp_ne_top := one_ne_top) with
| @h_ind c s hs hμs =>
rw [setToL1_simpleFunc_indicatorConst hT hs hμs, setToL1_simpleFunc_indicatorConst hT' hs hμs]
exact hTT' s hs hμs c
| @h_add f g hf hg _ hf_le hg_le =>
rw [(setToL1 hT).map_add, (setToL1 hT').map_add]
exact add_le_add hf_le hg_le
| h_closed => exact isClosed_le (setToL1 hT).continuous (setToL1 hT').continuous
theorem setToL1_mono_left {T T' : Set α → E →L[ℝ] G''} {C C' : ℝ}
(hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C')
(hTT' : ∀ s x, T s x ≤ T' s x) (f : α →₁[μ] E) : setToL1 hT f ≤ setToL1 hT' f :=
setToL1_mono_left' hT hT' (fun s _ _ x => hTT' s x) f
theorem setToL1_nonneg {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
(hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f : α →₁[μ] G'}
(hf : 0 ≤ f) : 0 ≤ setToL1 hT f := by
suffices ∀ f : { g : α →₁[μ] G' // 0 ≤ g }, 0 ≤ setToL1 hT f from
this (⟨f, hf⟩ : { g : α →₁[μ] G' // 0 ≤ g })
refine fun g =>
@isClosed_property { g : α →₁ₛ[μ] G' // 0 ≤ g } { g : α →₁[μ] G' // 0 ≤ g } _ _
(fun g => 0 ≤ setToL1 hT g)
(denseRange_coeSimpleFuncNonnegToLpNonneg 1 μ G' one_ne_top) ?_ ?_ g
· exact isClosed_le continuous_zero ((setToL1 hT).continuous.comp continuous_induced_dom)
· intro g
have : (coeSimpleFuncNonnegToLpNonneg 1 μ G' g : α →₁[μ] G') = (g : α →₁ₛ[μ] G') := rfl
rw [this, setToL1_eq_setToL1SCLM]
exact setToL1S_nonneg (fun s => hT.eq_zero_of_measure_zero) hT.1 hT_nonneg g.2
theorem setToL1_mono {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
(hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f g : α →₁[μ] G'}
(hfg : f ≤ g) : setToL1 hT f ≤ setToL1 hT g := by
rw [← sub_nonneg] at hfg ⊢
rw [← (setToL1 hT).map_sub]
exact setToL1_nonneg hT hT_nonneg hfg
end Order
theorem norm_setToL1_le_norm_setToL1SCLM (hT : DominatedFinMeasAdditive μ T C) :
‖setToL1 hT‖ ≤ ‖setToL1SCLM α E μ hT‖ :=
calc
‖setToL1 hT‖ ≤ (1 : ℝ≥0) * ‖setToL1SCLM α E μ hT‖ := by
refine
ContinuousLinearMap.opNorm_extend_le (setToL1SCLM α E μ hT) (coeToLp α E ℝ)
(simpleFunc.denseRange one_ne_top) fun x => le_of_eq ?_
rw [NNReal.coe_one, one_mul]
rfl
_ = ‖setToL1SCLM α E μ hT‖ := by rw [NNReal.coe_one, one_mul]
theorem norm_setToL1_le_mul_norm (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C)
(f : α →₁[μ] E) : ‖setToL1 hT f‖ ≤ C * ‖f‖ :=
calc
‖setToL1 hT f‖ ≤ ‖setToL1SCLM α E μ hT‖ * ‖f‖ :=
ContinuousLinearMap.le_of_opNorm_le _ (norm_setToL1_le_norm_setToL1SCLM hT) _
_ ≤ C * ‖f‖ := mul_le_mul (norm_setToL1SCLM_le hT hC) le_rfl (norm_nonneg _) hC
theorem norm_setToL1_le_mul_norm' (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) :
‖setToL1 hT f‖ ≤ max C 0 * ‖f‖ :=
calc
‖setToL1 hT f‖ ≤ ‖setToL1SCLM α E μ hT‖ * ‖f‖ :=
ContinuousLinearMap.le_of_opNorm_le _ (norm_setToL1_le_norm_setToL1SCLM hT) _
_ ≤ max C 0 * ‖f‖ :=
mul_le_mul (norm_setToL1SCLM_le' hT) le_rfl (norm_nonneg _) (le_max_right _ _)
theorem norm_setToL1_le (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) : ‖setToL1 hT‖ ≤ C :=
ContinuousLinearMap.opNorm_le_bound _ hC (norm_setToL1_le_mul_norm hT hC)
theorem norm_setToL1_le' (hT : DominatedFinMeasAdditive μ T C) : ‖setToL1 hT‖ ≤ max C 0 :=
ContinuousLinearMap.opNorm_le_bound _ (le_max_right _ _) (norm_setToL1_le_mul_norm' hT)
theorem setToL1_lipschitz (hT : DominatedFinMeasAdditive μ T C) :
LipschitzWith (Real.toNNReal C) (setToL1 hT) :=
(setToL1 hT).lipschitz.weaken (norm_setToL1_le' hT)
/-- If `fs i → f` in `L1`, then `setToL1 hT (fs i) → setToL1 hT f`. -/
theorem tendsto_setToL1 (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) {ι}
(fs : ι → α →₁[μ] E) {l : Filter ι} (hfs : Tendsto fs l (𝓝 f)) :
Tendsto (fun i => setToL1 hT (fs i)) l (𝓝 <| setToL1 hT f) :=
((setToL1 hT).continuous.tendsto _).comp hfs
end SetToL1
end L1
section Function
variable [CompleteSpace F] {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
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 L1.setToFun_eq_setToL1 (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
theorem setToFun_non_aEStronglyMeasurable (hT : DominatedFinMeasAdditive μ T C)
(hf : ¬AEStronglyMeasurable f μ) : setToFun μ T hT f = 0 :=
setToFun_undef hT (not_and_of_not_left _ hf)
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 : Integrable f μ
· simp_rw [setToFun_eq _ hf, L1.setToL1_congr_left T T' hT hT' h]
· simp_rw [setToFun_undef _ hf]
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 : Integrable f μ
· simp_rw [setToFun_eq _ hf, L1.setToL1_congr_left' T T' hT hT' h]
· simp_rw [setToFun_undef _ hf]
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 : Integrable f μ
· simp_rw [setToFun_eq _ hf, L1.setToL1_add_left hT hT']
· simp_rw [setToFun_undef _ hf, add_zero]
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 : 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 : Integrable f μ
· simp_rw [setToFun_eq _ hf, L1.setToL1_smul_left hT c]
· simp_rw [setToFun_undef _ hf, smul_zero]
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 : 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
erw [setToFun_eq hT (integrable_zero _ _ _), Integrable.toL1_zero, ContinuousLinearMap.map_zero]
@[simp]
theorem setToFun_zero_left {hT : DominatedFinMeasAdditive μ (0 : Set α → E →L[ℝ] F) C} :
setToFun μ 0 hT f = 0 := by
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 : 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
rw [setToFun_eq hT (hf.add hg), setToFun_eq hT hf, setToFun_eq hT hg, Integrable.toL1_add,
(L1.setToL1 hT).map_add]
theorem setToFun_finset_sum' (hT : DominatedFinMeasAdditive μ T C) {ι} (s : Finset ι)
{f : ι → α → E} (hf : ∀ i ∈ s, Integrable (f i) μ) :
setToFun μ T hT (∑ i ∈ s, f i) = ∑ i ∈ s, setToFun μ T hT (f i) := by
classical
revert hf
refine Finset.induction_on s ?_ ?_
· intro _
simp only [setToFun_zero, Finset.sum_empty]
· intro i s his ih hf
simp only [his, Finset.sum_insert, not_false_iff]
rw [setToFun_add hT (hf i (Finset.mem_insert_self i s)) _]
· rw [ih fun i hi => hf i (Finset.mem_insert_of_mem hi)]
· convert integrable_finset_sum s fun i hi => hf i (Finset.mem_insert_of_mem hi) with x
simp
theorem setToFun_finset_sum (hT : DominatedFinMeasAdditive μ T C) {ι} (s : Finset ι) {f : ι → α → E}
(hf : ∀ i ∈ s, Integrable (f i) μ) :
(setToFun μ T hT fun a => ∑ i ∈ s, f i a) = ∑ i ∈ s, setToFun μ T hT (f i) := by
convert setToFun_finset_sum' hT s hf with a; simp
theorem setToFun_neg (hT : DominatedFinMeasAdditive μ T C) (f : α → E) :
setToFun μ T hT (-f) = -setToFun μ T hT f := by
by_cases hf : Integrable f μ
· rw [setToFun_eq hT hf, setToFun_eq hT hf.neg, Integrable.toL1_neg,
(L1.setToL1 hT).map_neg]
· rw [setToFun_undef hT hf, setToFun_undef hT, neg_zero]
rwa [← integrable_neg_iff] at hf
theorem setToFun_sub (hT : DominatedFinMeasAdditive μ T C) (hf : Integrable f μ)
(hg : Integrable g μ) : setToFun μ T hT (f - g) = setToFun μ T hT f - setToFun μ T hT g := by
rw [sub_eq_add_neg, sub_eq_add_neg, setToFun_add hT hf hg.neg, setToFun_neg hT g]
theorem setToFun_smul [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E] [NormedSpace 𝕜 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 : Integrable f μ
· rw [setToFun_eq hT hf, setToFun_eq hT, Integrable.toL1_smul',
L1.setToL1_smul hT h_smul c _]
· by_cases hr : c = 0
· rw [hr]; simp
· have hf' : ¬Integrable (c • f) μ := by rwa [integrable_smul_iff hr f]
rw [setToFun_undef hT hf, setToFun_undef hT hf', smul_zero]
theorem setToFun_congr_ae (hT : DominatedFinMeasAdditive μ T C) (h : f =ᵐ[μ] g) :
setToFun μ T hT f = setToFun μ T hT g := by
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]
· have hgi : ¬Integrable g μ := by rw [integrable_congr h] at hfi; exact hfi
rw [setToFun_undef hT hfi, setToFun_undef hT hgi]
theorem setToFun_measure_zero (hT : DominatedFinMeasAdditive μ T C) (h : μ = 0) :
setToFun μ T hT f = 0 := by
have : f =ᵐ[μ] 0 := by simp [h, EventuallyEq]
rw [setToFun_congr_ae hT this, setToFun_zero]
theorem setToFun_measure_zero' (hT : DominatedFinMeasAdditive μ T C)
(h : ∀ s, MeasurableSet s → μ s < ∞ → μ s = 0) : setToFun μ T hT f = 0 :=
setToFun_zero_left' hT fun s hs hμs => hT.eq_zero_of_measure_zero hs (h s hs hμs)
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 α}
(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) :
(setToFun μ T hT fun _ => x) = T univ x := by
have : (fun _ : α => x) = Set.indicator univ fun _ => x := (indicator_univ _).symm
rw [this]
exact setToFun_indicator_const hT MeasurableSet.univ (measure_ne_top _ _) x
section Order
variable {G' G'' : Type*} [NormedLatticeAddCommGroup G''] [NormedSpace ℝ G''] [CompleteSpace G'']
[NormedLatticeAddCommGroup G'] [NormedSpace ℝ G']
theorem setToFun_mono_left' {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 hf : Integrable f μ
· simp_rw [setToFun_eq _ hf]; exact L1.setToL1_mono_left' hT hT' hTT' _
· simp_rw [setToFun_undef _ hf]; rfl
theorem setToFun_mono_left {T T' : Set α → E →L[ℝ] G''} {C C' : ℝ}
(hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C')
(hTT' : ∀ s x, T s x ≤ T' s x) (f : α →₁[μ] E) : setToFun μ T hT f ≤ setToFun μ T' hT' f :=
setToFun_mono_left' hT hT' (fun s _ _ x => hTT' s x) f
theorem setToFun_nonneg {T : Set α → G' →L[ℝ] G''} {C : ℝ} (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 hfi : Integrable f μ
· simp_rw [setToFun_eq _ hfi]
refine L1.setToL1_nonneg hT hT_nonneg ?_
rw [← Lp.coeFn_le]
have h0 := Lp.coeFn_zero G' 1 μ
have h := Integrable.coeFn_toL1 hfi
filter_upwards [h0, h, hf] with _ h0a ha hfa
rw [h0a, ha]
exact hfa
· simp_rw [setToFun_undef _ hfi]; rfl
theorem setToFun_mono {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
(hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f g : α → G'}
(hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) :
setToFun μ T hT f ≤ setToFun μ T hT g := by
rw [← sub_nonneg, ← setToFun_sub hT hg hf]
refine setToFun_nonneg hT hT_nonneg (hfg.mono fun a ha => ?_)
rw [Pi.sub_apply, Pi.zero_apply, sub_nonneg]
exact ha
end Order
@[continuity]
theorem continuous_setToFun (hT : DominatedFinMeasAdditive μ T C) :
Continuous fun f : α →₁[μ] E => setToFun μ T hT f := by
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`. -/
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) μ)
(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_ℒp']
simp_rw [eLpNorm_one_eq_lintegral_nnnorm, 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, 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]
(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 => setToFun μ T hT (SimpleFunc.approxOn f hfm s y₀ h₀ n)) atTop
(𝓝 <| setToFun μ T hT f) :=
tendsto_setToFun_of_L1 hT _ hfi
(eventually_of_forall (SimpleFunc.integrable_approxOn hfm hfi h₀ h₀i))
(SimpleFunc.tendsto_approxOn_L1_nnnorm hfm _ hs (hfi.sub h₀i).2)
theorem tendsto_setToFun_approxOn_of_measurable_of_range_subset
(hT : DominatedFinMeasAdditive μ T C) [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 => setToFun μ T hT (SimpleFunc.approxOn f fmeas s 0 (hs <| by simp) n)) atTop
(𝓝 <| setToFun μ T hT f) := by
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 _)))
/-- 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' • μ) :
Continuous fun f : α →₁[μ] G =>
(Integrable.of_measure_le_smul c' hc' hμ'_le (L1.integrable_coeFn f)).toL1 f := by
by_cases hc'0 : c' = 0
· have hμ'0 : μ' = 0 := by rw [← Measure.nonpos_iff_eq_zero']; refine hμ'_le.trans ?_; simp [hc'0]
have h_im_zero :
(fun f : α →₁[μ] G =>
(Integrable.of_measure_le_smul c' hc' hμ'_le (L1.integrable_coeFn f)).toL1 f) =
0 := by
ext1 f; ext1; simp_rw [hμ'0]; simp only [ae_zero, EventuallyEq, eventually_bot]
rw [h_im_zero]
exact continuous_zero
rw [Metric.continuous_iff]
intro f ε hε_pos
use ε / 2 / c'.toReal
refine ⟨div_pos (half_pos hε_pos) (toReal_pos hc'0 hc'), ?_⟩
intro g hfg
rw [Lp.dist_def] at hfg ⊢
let h_int := fun f' : α →₁[μ] G => (L1.integrable_coeFn f').of_measure_le_smul c' hc' hμ'_le
have :
eLpNorm (⇑(Integrable.toL1 g (h_int g)) - ⇑(Integrable.toL1 f (h_int f))) 1 μ' =
eLpNorm (⇑g - ⇑f) 1 μ' :=
eLpNorm_congr_ae ((Integrable.coeFn_toL1 _).sub (Integrable.coeFn_toL1 _))
rw [this]
have h_eLpNorm_ne_top : eLpNorm (⇑g - ⇑f) 1 μ ≠ ∞ := by
rw [← eLpNorm_congr_ae (Lp.coeFn_sub _ _)]; exact Lp.eLpNorm_ne_top _
have h_eLpNorm_ne_top' : eLpNorm (⇑g - ⇑f) 1 μ' ≠ ∞ := by
refine ((eLpNorm_mono_measure _ hμ'_le).trans_lt ?_).ne
rw [eLpNorm_smul_measure_of_ne_zero hc'0, smul_eq_mul]
refine ENNReal.mul_lt_top ?_ h_eLpNorm_ne_top
simp [hc', hc'0]
calc
(eLpNorm (⇑g - ⇑f) 1 μ').toReal ≤ (c' * eLpNorm (⇑g - ⇑f) 1 μ).toReal := by
rw [toReal_le_toReal h_eLpNorm_ne_top' (ENNReal.mul_ne_top hc' h_eLpNorm_ne_top)]
refine (eLpNorm_mono_measure (⇑g - ⇑f) hμ'_le).trans ?_
rw [eLpNorm_smul_measure_of_ne_zero hc'0, smul_eq_mul]
simp
_ = c'.toReal * (eLpNorm (⇑g - ⇑f) 1 μ).toReal := toReal_mul
_ ≤ c'.toReal * (ε / 2 / c'.toReal) :=
(mul_le_mul le_rfl hfg.le toReal_nonneg toReal_nonneg)
_ = ε / 2 := by
refine mul_div_cancel₀ (ε / 2) ?_; rw [Ne, toReal_eq_zero_iff]; simp [hc', hc'0]
_ < ε := half_lt_self hε_pos
theorem setToFun_congr_measure_of_integrable {μ' : Measure α} (c' : ℝ≥0∞) (hc' : c' ≠ ∞)
(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
-- integrability for `μ` implies integrability for `μ'`.
have h_int : ∀ g : α → E, Integrable g μ → Integrable g μ' := fun g hg =>
Integrable.of_measure_le_smul c' hc' hμ'_le hg
-- We use `Integrable.induction`
apply hfμ.induction (P := fun f => setToFun μ T hT f = setToFun μ' T hT' f)
· intro c s hs hμs
have hμ's : μ' s ≠ ∞ := by
refine ((hμ'_le s).trans_lt ?_).ne
rw [Measure.smul_apply, smul_eq_mul]
exact ENNReal.mul_lt_top hc' hμs.ne
rw [setToFun_indicator_const hT hs hμs.ne, setToFun_indicator_const hT' hs hμ's]
· intro f₂ g₂ _ hf₂ hg₂ h_eq_f h_eq_g
rw [setToFun_add hT hf₂ hg₂, setToFun_add hT' (h_int f₂ hf₂) (h_int g₂ hg₂), h_eq_f, h_eq_g]
· refine isClosed_eq (continuous_setToFun hT) ?_
have :
(fun f : α →₁[μ] E => setToFun μ' T hT' f) = fun f : α →₁[μ] E =>
setToFun μ' T hT' ((h_int f (L1.integrable_coeFn f)).toL1 f) := by
ext1 f; exact setToFun_congr_ae hT' (Integrable.coeFn_toL1 _).symm
rw [this]
exact (continuous_setToFun hT').comp (continuous_L1_toL1 c' hc' hμ'_le)
· intro f₂ g₂ hfg _ hf_eq
have hfg' : f₂ =ᵐ[μ'] g₂ := (Measure.absolutelyContinuous_of_le_smul hμ'_le).ae_eq hfg
rw [← setToFun_congr_ae hT hfg, hf_eq, setToFun_congr_ae hT' hfg']
theorem setToFun_congr_measure {μ' : Measure α} (c c' : ℝ≥0∞) (hc : c ≠ ∞) (hc' : c' ≠ ∞)
(hμ_le : μ ≤ c • μ') (hμ'_le : μ' ≤ c' • μ) (hT : DominatedFinMeasAdditive μ T C)
(hT' : DominatedFinMeasAdditive μ' T C') (f : α → E) :
setToFun μ T hT f = setToFun μ' T hT' f := by
by_cases hf : Integrable f μ
· exact setToFun_congr_measure_of_integrable c' hc' hμ'_le hT hT' f hf
· -- if `f` is not integrable, both `setToFun` are 0.
have h_int : ∀ g : α → E, ¬Integrable g μ → ¬Integrable g μ' := fun g =>
mt fun h => h.of_measure_le_smul _ hc hμ_le
simp_rw [setToFun_undef _ hf, setToFun_undef _ (h_int f hf)]
theorem setToFun_congr_measure_of_add_right {μ' : Measure α}
(hT_add : DominatedFinMeasAdditive (μ + μ') T C') (hT : DominatedFinMeasAdditive μ T C)
(f : α → E) (hf : Integrable f (μ + μ')) :
setToFun (μ + μ') T hT_add f = setToFun μ T hT f := by
refine setToFun_congr_measure_of_integrable 1 one_ne_top ?_ hT_add hT f hf
rw [one_smul]
nth_rw 1 [← add_zero μ]
exact add_le_add le_rfl bot_le
theorem setToFun_congr_measure_of_add_left {μ' : Measure α}
(hT_add : DominatedFinMeasAdditive (μ + μ') T C') (hT : DominatedFinMeasAdditive μ' T C)
(f : α → E) (hf : Integrable f (μ + μ')) :
setToFun (μ + μ') T hT_add f = setToFun μ' T hT f := by
refine setToFun_congr_measure_of_integrable 1 one_ne_top ?_ hT_add hT f hf
rw [one_smul]
nth_rw 1 [← zero_add μ']
exact add_le_add bot_le le_rfl
theorem setToFun_top_smul_measure (hT : DominatedFinMeasAdditive (∞ • μ) T C) (f : α → E) :
setToFun (∞ • μ) T hT f = 0 := by
refine setToFun_measure_zero' hT fun s _ hμs => ?_
rw [lt_top_iff_ne_top] at hμs
simp only [true_and_iff, Measure.smul_apply, ENNReal.mul_eq_top, eq_self_iff_true,
top_ne_zero, Ne, not_false_iff, not_or, Classical.not_not, smul_eq_mul] at hμs
simp only [hμs.right, Measure.smul_apply, mul_zero, smul_eq_mul]
theorem setToFun_congr_smul_measure (c : ℝ≥0∞) (hc_ne_top : c ≠ ∞)
(hT : DominatedFinMeasAdditive μ T C) (hT_smul : DominatedFinMeasAdditive (c • μ) T C')
(f : α → E) : setToFun μ T hT f = setToFun (c • μ) T hT_smul f := by
by_cases hc0 : c = 0
· simp [hc0] at hT_smul
have h : ∀ s, MeasurableSet s → μ s < ∞ → T s = 0 := fun s hs _ => hT_smul.eq_zero hs
rw [setToFun_zero_left' _ h, setToFun_measure_zero]
simp [hc0]
refine setToFun_congr_measure c⁻¹ c ?_ hc_ne_top (le_of_eq ?_) le_rfl hT hT_smul f
· simp [hc0]
· rw [smul_smul, ENNReal.inv_mul_cancel hc0 hc_ne_top, one_smul]
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
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
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 _
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 _
/-- 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`.
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_setToFun_of_dominated_convergence (hT : DominatedFinMeasAdditive μ T C)
{fs : ℕ → α → E} {f : α → E} (bound : α → ℝ)
(fs_measurable : ∀ n, AEStronglyMeasurable (fs n) μ) (bound_integrable : Integrable bound μ)
(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
-- `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
-- all functions we consider are integrable
have fs_int : ∀ n, Integrable (fs n) μ := fun n =>
bound_integrable.mono' (fs_measurable n) (h_bound _)
have f_int : Integrable f μ :=
⟨f_measurable,
hasFiniteIntegral_of_dominated_convergence bound_integrable.hasFiniteIntegral h_bound
h_lim⟩
-- it suffices to prove the result for the corresponding L1 functions
suffices
Tendsto (fun n => L1.setToL1 hT ((fs_int n).toL1 (fs n))) atTop
(𝓝 (L1.setToL1 hT (f_int.toL1 f))) by
convert this with n
· exact setToFun_eq hT (fs_int n)
· exact setToFun_eq hT f_int
-- the convergence of setToL1 follows from the convergence of the L1 functions
refine L1.tendsto_setToL1 hT _ _ ?_
-- up to some rewriting, what we need to prove is `h_lim`
rw [tendsto_iff_norm_sub_tendsto_zero]
have lintegral_norm_tendsto_zero :
Tendsto (fun n => ENNReal.toReal <| ∫⁻ a, ENNReal.ofReal ‖fs n a - f a‖ ∂μ) atTop (𝓝 0) :=
(tendsto_toReal zero_ne_top).comp
(tendsto_lintegral_norm_of_dominated_convergence fs_measurable
bound_integrable.hasFiniteIntegral h_bound h_lim)
convert lintegral_norm_tendsto_zero with n
rw [L1.norm_def]
congr 1
refine lintegral_congr_ae ?_
rw [← Integrable.toL1_sub]
refine ((fs_int n).sub f_int).coeFn_toL1.mono fun x hx => ?_
dsimp only
rw [hx, ofReal_norm_eq_coe_nnnorm, Pi.sub_apply]
/-- Lebesgue dominated convergence theorem for filters with a countable basis -/
theorem tendsto_setToFun_filter_of_dominated_convergence (hT : DominatedFinMeasAdditive μ T C) {ι}
{l : Filter ι} [l.IsCountablyGenerated] {fs : ι → α → E} {f : α → E} (bound : α → ℝ)
(hfs_meas : ∀ᶠ n in l, AEStronglyMeasurable (fs n) μ)
(h_bound : ∀ᶠ n in l, ∀ᵐ a ∂μ, ‖fs n a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
(h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => fs n a) l (𝓝 (f a))) :
Tendsto (fun n => setToFun μ T hT (fs n)) l (𝓝 <| setToFun μ T hT f) := by
rw [tendsto_iff_seq_tendsto]
intro x xl
have hxl : ∀ s ∈ l, ∃ a, ∀ b ≥ a, x b ∈ s := by rwa [tendsto_atTop'] at xl
have h :
{ x : ι | (fun n => AEStronglyMeasurable (fs n) μ) x } ∩
{ x : ι | (fun n => ∀ᵐ a ∂μ, ‖fs n a‖ ≤ bound a) x } ∈ l :=
inter_mem hfs_meas h_bound
obtain ⟨k, h⟩ := hxl _ h
rw [← tendsto_add_atTop_iff_nat k]
refine tendsto_setToFun_of_dominated_convergence hT bound ?_ bound_integrable ?_ ?_
· exact fun n => (h _ (self_le_add_left _ _)).1
· exact fun n => (h _ (self_le_add_left _ _)).2
· filter_upwards [h_lim]
refine fun a h_lin => @Tendsto.comp _ _ _ (fun n => x (n + k)) (fun n => fs n a) _ _ _ h_lin ?_
rw [tendsto_add_atTop_iff_nat]
assumption
variable {X : Type*} [TopologicalSpace X] [FirstCountableTopology X]
theorem continuousWithinAt_setToFun_of_dominated (hT : DominatedFinMeasAdditive μ T C)
{fs : X → α → E} {x₀ : X} {bound : α → ℝ} {s : Set X}
(hfs_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (fs x) μ)
(h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂μ, ‖fs x a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
(h_cont : ∀ᵐ a ∂μ, ContinuousWithinAt (fun x => fs x a) s x₀) :
ContinuousWithinAt (fun x => setToFun μ T hT (fs x)) s x₀ :=
tendsto_setToFun_filter_of_dominated_convergence hT bound ‹_› ‹_› ‹_› ‹_›
theorem continuousAt_setToFun_of_dominated (hT : DominatedFinMeasAdditive μ T C) {fs : X → α → E}
{x₀ : X} {bound : α → ℝ} (hfs_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (fs x) μ)
(h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂μ, ‖fs x a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
(h_cont : ∀ᵐ a ∂μ, ContinuousAt (fun x => fs x a) x₀) :
ContinuousAt (fun x => setToFun μ T hT (fs x)) x₀ :=
tendsto_setToFun_filter_of_dominated_convergence hT bound ‹_› ‹_› ‹_› ‹_›
theorem continuousOn_setToFun_of_dominated (hT : DominatedFinMeasAdditive μ T C) {fs : X → α → E}
{bound : α → ℝ} {s : Set X} (hfs_meas : ∀ x ∈ s, AEStronglyMeasurable (fs x) μ)
(h_bound : ∀ x ∈ s, ∀ᵐ a ∂μ, ‖fs x a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
(h_cont : ∀ᵐ a ∂μ, ContinuousOn (fun x => fs x a) s) :
ContinuousOn (fun x => setToFun μ T hT (fs x)) s := by
intro x hx
refine continuousWithinAt_setToFun_of_dominated hT ?_ ?_ bound_integrable ?_
· filter_upwards [self_mem_nhdsWithin] with x hx using hfs_meas x hx
· filter_upwards [self_mem_nhdsWithin] with x hx using h_bound x hx
· filter_upwards [h_cont] with a ha using ha x hx
theorem continuous_setToFun_of_dominated (hT : DominatedFinMeasAdditive μ T C) {fs : X → α → E}
{bound : α → ℝ} (hfs_meas : ∀ x, AEStronglyMeasurable (fs x) μ)
(h_bound : ∀ x, ∀ᵐ a ∂μ, ‖fs x a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
(h_cont : ∀ᵐ a ∂μ, Continuous fun x => fs x a) : Continuous fun x => setToFun μ T hT (fs x) :=
continuous_iff_continuousAt.mpr fun x₀ =>
continuousAt_setToFun_of_dominated hT (eventually_of_forall hfs_meas)
(eventually_of_forall h_bound) ‹_› <|
h_cont.mono fun _ => Continuous.continuousAt
end Function
end MeasureTheory
|
MeasureTheory\Integral\TorusIntegral.lean | /-
Copyright (c) 2022 Cuma Kökmen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Cuma Kökmen, Yury Kudryashov
-/
import Mathlib.MeasureTheory.Constructions.Prod.Integral
import Mathlib.MeasureTheory.Integral.CircleIntegral
import Mathlib.Order.Fin.Tuple
/-!
# Integral over a torus in `ℂⁿ`
In this file we define the integral of a function `f : ℂⁿ → E` over a torus
`{z : ℂⁿ | ∀ i, z i ∈ Metric.sphere (c i) (R i)}`. In order to do this, we define
`torusMap (c : ℂⁿ) (R θ : ℝⁿ)` to be the point in `ℂⁿ` given by $z_k=c_k+R_ke^{θ_ki}$,
where $i$ is the imaginary unit, then define `torusIntegral f c R` as the integral over
the cube $[0, (fun _ ↦ 2π)] = \{θ\|∀ k, 0 ≤ θ_k ≤ 2π\}$ of the Jacobian of the
`torusMap` multiplied by `f (torusMap c R θ)`.
We also define a predicate saying that `f ∘ torusMap c R` is integrable on the cube
`[0, (fun _ ↦ 2π)]`.
## Main definitions
* `torusMap c R`: the generalized multidimensional exponential map from `ℝⁿ` to `ℂⁿ` that sends
$θ=(θ_0,…,θ_{n-1})$ to $z=(z_0,…,z_{n-1})$, where $z_k= c_k + R_ke^{θ_k i}$;
* `TorusIntegrable f c R`: a function `f : ℂⁿ → E` is integrable over the generalized torus
with center `c : ℂⁿ` and radius `R : ℝⁿ` if `f ∘ torusMap c R` is integrable on the
closed cube `Icc (0 : ℝⁿ) (fun _ ↦ 2 * π)`;
* `torusIntegral f c R`: the integral of a function `f : ℂⁿ → E` over a torus with
center `c ∈ ℂⁿ` and radius `R ∈ ℝⁿ` defined as
$\iiint_{[0, 2 * π]} (∏_{k = 1}^{n} i R_k e^{θ_k * i}) • f (c + Re^{θ_k i})\,dθ_0…dθ_{k-1}$.
## Main statements
* `torusIntegral_dim0`, `torusIntegral_dim1`, `torusIntegral_succ`: formulas for `torusIntegral`
in cases of dimension `0`, `1`, and `n + 1`.
## Notations
- `ℝ⁰`, `ℝ¹`, `ℝⁿ`, `ℝⁿ⁺¹`: local notation for `Fin 0 → ℝ`, `Fin 1 → ℝ`, `Fin n → ℝ`, and
`Fin (n + 1) → ℝ`, respectively;
- `ℂ⁰`, `ℂ¹`, `ℂⁿ`, `ℂⁿ⁺¹`: local notation for `Fin 0 → ℂ`, `Fin 1 → ℂ`, `Fin n → ℂ`, and
`Fin (n + 1) → ℂ`, respectively;
- `∯ z in T(c, R), f z`: notation for `torusIntegral f c R`;
- `∮ z in C(c, R), f z`: notation for `circleIntegral f c R`, defined elsewhere;
- `∏ k, f k`: notation for `Finset.prod`, defined elsewhere;
- `π`: notation for `Real.pi`, defined elsewhere.
## Tags
integral, torus
-/
variable {n : ℕ}
variable {E : Type*} [NormedAddCommGroup E]
noncomputable section
open Complex Set MeasureTheory Function Filter TopologicalSpace
open scoped Real
-- Porting note: notation copied from `./DivergenceTheorem`
local macro:arg t:term:max noWs "ⁿ⁺¹" : term => `(Fin (n + 1) → $t)
local macro:arg t:term:max noWs "ⁿ" : term => `(Fin n → $t)
local macro:arg t:term:max noWs "⁰" : term => `(Fin 0 → $t)
local macro:arg t:term:max noWs "¹" : term => `(Fin 1 → $t)
/-!
### `torusMap`, a parametrization of a torus
-/
/-- The n dimensional exponential map $θ_i ↦ c + R e^{θ_i*I}, θ ∈ ℝⁿ$ representing
a torus in `ℂⁿ` with center `c ∈ ℂⁿ` and generalized radius `R ∈ ℝⁿ`, so we can adjust
it to every n axis. -/
def torusMap (c : ℂⁿ) (R : ℝⁿ) : ℝⁿ → ℂⁿ := fun θ i => c i + R i * exp (θ i * I)
theorem torusMap_sub_center (c : ℂⁿ) (R : ℝⁿ) (θ : ℝⁿ) : torusMap c R θ - c = torusMap 0 R θ := by
ext1 i; simp [torusMap]
theorem torusMap_eq_center_iff {c : ℂⁿ} {R : ℝⁿ} {θ : ℝⁿ} : torusMap c R θ = c ↔ R = 0 := by
simp [funext_iff, torusMap, exp_ne_zero]
@[simp]
theorem torusMap_zero_radius (c : ℂⁿ) : torusMap c 0 = const ℝⁿ c :=
funext fun _ ↦ torusMap_eq_center_iff.2 rfl
/-!
### Integrability of a function on a generalized torus
-/
/-- A function `f : ℂⁿ → E` is integrable on the generalized torus if the function
`f ∘ torusMap c R θ` is integrable on `Icc (0 : ℝⁿ) (fun _ ↦ 2 * π)`. -/
def TorusIntegrable (f : ℂⁿ → E) (c : ℂⁿ) (R : ℝⁿ) : Prop :=
IntegrableOn (fun θ : ℝⁿ => f (torusMap c R θ)) (Icc (0 : ℝⁿ) fun _ => 2 * π) volume
namespace TorusIntegrable
-- Porting note (#11215): TODO: restore notation; `neg`, `add` etc fail if I use notation here
variable {f g : (Fin n → ℂ) → E} {c : Fin n → ℂ} {R : Fin n → ℝ}
/-- Constant functions are torus integrable -/
theorem torusIntegrable_const (a : E) (c : ℂⁿ) (R : ℝⁿ) : TorusIntegrable (fun _ => a) c R := by
simp [TorusIntegrable, measure_Icc_lt_top]
/-- If `f` is torus integrable then `-f` is torus integrable. -/
protected nonrec theorem neg (hf : TorusIntegrable f c R) : TorusIntegrable (-f) c R := hf.neg
/-- If `f` and `g` are two torus integrable functions, then so is `f + g`. -/
protected nonrec theorem add (hf : TorusIntegrable f c R) (hg : TorusIntegrable g c R) :
TorusIntegrable (f + g) c R :=
hf.add hg
/-- If `f` and `g` are two torus integrable functions, then so is `f - g`. -/
protected nonrec theorem sub (hf : TorusIntegrable f c R) (hg : TorusIntegrable g c R) :
TorusIntegrable (f - g) c R :=
hf.sub hg
theorem torusIntegrable_zero_radius {f : ℂⁿ → E} {c : ℂⁿ} : TorusIntegrable f c 0 := by
rw [TorusIntegrable, torusMap_zero_radius]
apply torusIntegrable_const (f c) c 0
/-- The function given in the definition of `torusIntegral` is integrable. -/
theorem function_integrable [NormedSpace ℂ E] (hf : TorusIntegrable f c R) :
IntegrableOn (fun θ : ℝⁿ => (∏ i, R i * exp (θ i * I) * I : ℂ) • f (torusMap c R θ))
(Icc (0 : ℝⁿ) fun _ => 2 * π) volume := by
refine (hf.norm.const_mul (∏ i, |R i|)).mono' ?_ ?_
· refine (Continuous.aestronglyMeasurable ?_).smul hf.1; fun_prop
simp [norm_smul, map_prod]
end TorusIntegrable
variable [NormedSpace ℂ E] [CompleteSpace E] {f g : (Fin n → ℂ) → E} {c : Fin n → ℂ} {R : Fin n → ℝ}
/-- The integral over a generalized torus with center `c ∈ ℂⁿ` and radius `R ∈ ℝⁿ`, defined
as the `•`-product of the derivative of `torusMap` and `f (torusMap c R θ)`-/
def torusIntegral (f : ℂⁿ → E) (c : ℂⁿ) (R : ℝⁿ) :=
∫ θ : ℝⁿ in Icc (0 : ℝⁿ) fun _ => 2 * π, (∏ i, R i * exp (θ i * I) * I : ℂ) • f (torusMap c R θ)
@[inherit_doc torusIntegral]
notation3"∯ "(...)" in ""T("c", "R")"", "r:(scoped f => torusIntegral f c R) => r
theorem torusIntegral_radius_zero (hn : n ≠ 0) (f : ℂⁿ → E) (c : ℂⁿ) :
(∯ x in T(c, 0), f x) = 0 := by
simp only [torusIntegral, Pi.zero_apply, ofReal_zero, mul_zero, zero_mul, Fin.prod_const,
zero_pow hn, zero_smul, integral_zero]
theorem torusIntegral_neg (f : ℂⁿ → E) (c : ℂⁿ) (R : ℝⁿ) :
(∯ x in T(c, R), -f x) = -∯ x in T(c, R), f x := by simp [torusIntegral, integral_neg]
theorem torusIntegral_add (hf : TorusIntegrable f c R) (hg : TorusIntegrable g c R) :
(∯ x in T(c, R), f x + g x) = (∯ x in T(c, R), f x) + ∯ x in T(c, R), g x := by
simpa only [torusIntegral, smul_add, Pi.add_apply] using
integral_add hf.function_integrable hg.function_integrable
theorem torusIntegral_sub (hf : TorusIntegrable f c R) (hg : TorusIntegrable g c R) :
(∯ x in T(c, R), f x - g x) = (∯ x in T(c, R), f x) - ∯ x in T(c, R), g x := by
simpa only [sub_eq_add_neg, ← torusIntegral_neg] using torusIntegral_add hf hg.neg
theorem torusIntegral_smul {𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 E] [SMulCommClass 𝕜 ℂ E] (a : 𝕜)
(f : ℂⁿ → E) (c : ℂⁿ) (R : ℝⁿ) : (∯ x in T(c, R), a • f x) = a • ∯ x in T(c, R), f x := by
simp only [torusIntegral, integral_smul, ← smul_comm a (_ : ℂ) (_ : E)]
theorem torusIntegral_const_mul (a : ℂ) (f : ℂⁿ → ℂ) (c : ℂⁿ) (R : ℝⁿ) :
(∯ x in T(c, R), a * f x) = a * ∯ x in T(c, R), f x :=
torusIntegral_smul a f c R
/-- If for all `θ : ℝⁿ`, `‖f (torusMap c R θ)‖` is less than or equal to a constant `C : ℝ`, then
`‖∯ x in T(c, R), f x‖` is less than or equal to `(2 * π)^n * (∏ i, |R i|) * C`-/
theorem norm_torusIntegral_le_of_norm_le_const {C : ℝ} (hf : ∀ θ, ‖f (torusMap c R θ)‖ ≤ C) :
‖∯ x in T(c, R), f x‖ ≤ ((2 * π) ^ (n : ℕ) * ∏ i, |R i|) * C :=
calc
‖∯ x in T(c, R), f x‖ ≤ (∏ i, |R i|) * C * (volume (Icc (0 : ℝⁿ) fun _ => 2 * π)).toReal :=
norm_setIntegral_le_of_norm_le_const' measure_Icc_lt_top measurableSet_Icc fun θ _ =>
calc
‖(∏ i : Fin n, R i * exp (θ i * I) * I : ℂ) • f (torusMap c R θ)‖ =
(∏ i : Fin n, |R i|) * ‖f (torusMap c R θ)‖ := by simp [norm_smul]
_ ≤ (∏ i : Fin n, |R i|) * C := mul_le_mul_of_nonneg_left (hf _) <| by positivity
_ = ((2 * π) ^ (n : ℕ) * ∏ i, |R i|) * C := by
simp only [Pi.zero_def, Real.volume_Icc_pi_toReal fun _ => Real.two_pi_pos.le, sub_zero,
Fin.prod_const, mul_assoc, mul_comm ((2 * π) ^ (n : ℕ))]
@[simp]
theorem torusIntegral_dim0 (f : ℂ⁰ → E) (c : ℂ⁰) (R : ℝ⁰) : (∯ x in T(c, R), f x) = f c := by
simp only [torusIntegral, Fin.prod_univ_zero, one_smul,
Subsingleton.elim (fun _ : Fin 0 => 2 * π) 0, Icc_self, Measure.restrict_singleton, volume_pi,
integral_smul_measure, integral_dirac, Measure.pi_of_empty (fun _ : Fin 0 ↦ volume) 0,
Measure.dirac_apply_of_mem (mem_singleton _), Subsingleton.elim (torusMap c R 0) c]
/-- In dimension one, `torusIntegral` is the same as `circleIntegral`
(up to the natural equivalence between `ℂ` and `Fin 1 → ℂ`). -/
theorem torusIntegral_dim1 (f : ℂ¹ → E) (c : ℂ¹) (R : ℝ¹) :
(∯ x in T(c, R), f x) = ∮ z in C(c 0, R 0), f fun _ => z := by
have H₁ : (((MeasurableEquiv.funUnique _ _).symm) ⁻¹' Icc 0 fun _ => 2 * π) = Icc 0 (2 * π) :=
(OrderIso.funUnique (Fin 1) ℝ).symm.preimage_Icc _ _
have H₂ : torusMap c R = fun θ _ ↦ circleMap (c 0) (R 0) (θ 0) := by
ext θ i : 2
rw [Subsingleton.elim i 0]; rfl
rw [torusIntegral, circleIntegral, intervalIntegral.integral_of_le Real.two_pi_pos.le,
Measure.restrict_congr_set Ioc_ae_eq_Icc,
← ((volume_preserving_funUnique (Fin 1) ℝ).symm _).setIntegral_preimage_emb
(MeasurableEquiv.measurableEmbedding _), H₁, H₂]
simp [circleMap_zero]
/-- Recurrent formula for `torusIntegral`, see also `torusIntegral_succ`. -/
theorem torusIntegral_succAbove {f : ℂⁿ⁺¹ → E} {c : ℂⁿ⁺¹} {R : ℝⁿ⁺¹} (hf : TorusIntegrable f c R)
(i : Fin (n + 1)) :
(∯ x in T(c, R), f x) =
∮ x in C(c i, R i), ∯ y in T(c ∘ i.succAbove, R ∘ i.succAbove), f (i.insertNth x y) := by
set e : ℝ × ℝⁿ ≃ᵐ ℝⁿ⁺¹ := (MeasurableEquiv.piFinSuccAbove (fun _ => ℝ) i).symm
have hem : MeasurePreserving e :=
(volume_preserving_piFinSuccAbove (fun _ : Fin (n + 1) => ℝ) i).symm _
have heπ : (e ⁻¹' Icc 0 fun _ => 2 * π) = Icc 0 (2 * π) ×ˢ Icc (0 : ℝⁿ) fun _ => 2 * π :=
((OrderIso.piFinSuccAboveIso (fun _ => ℝ) i).symm.preimage_Icc _ _).trans (Icc_prod_eq _ _)
rw [torusIntegral, ← hem.map_eq, setIntegral_map_equiv, heπ, Measure.volume_eq_prod,
setIntegral_prod, circleIntegral_def_Icc]
· refine setIntegral_congr measurableSet_Icc fun θ _ => ?_
simp (config := { unfoldPartialApp := true }) only [e, torusIntegral, ← integral_smul,
deriv_circleMap, i.prod_univ_succAbove _, smul_smul, torusMap, circleMap_zero]
refine setIntegral_congr measurableSet_Icc fun Θ _ => ?_
simp only [MeasurableEquiv.piFinSuccAbove_symm_apply, i.insertNth_apply_same,
i.insertNth_apply_succAbove, (· ∘ ·)]
congr 2
simp only [funext_iff, i.forall_iff_succAbove, circleMap, Fin.insertNth_apply_same,
eq_self_iff_true, Fin.insertNth_apply_succAbove, imp_true_iff, and_self_iff]
· have := hf.function_integrable
rwa [← hem.integrableOn_comp_preimage e.measurableEmbedding, heπ] at this
/-- Recurrent formula for `torusIntegral`, see also `torusIntegral_succAbove`. -/
theorem torusIntegral_succ {f : ℂⁿ⁺¹ → E} {c : ℂⁿ⁺¹} {R : ℝⁿ⁺¹} (hf : TorusIntegrable f c R) :
(∯ x in T(c, R), f x) =
∮ x in C(c 0, R 0), ∯ y in T(c ∘ Fin.succ, R ∘ Fin.succ), f (Fin.cons x y) := by
simpa using torusIntegral_succAbove hf 0
|
MeasureTheory\Integral\VitaliCaratheodory.lean | /-
Copyright (c) 2021 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
import Mathlib.MeasureTheory.Measure.Regular
import Mathlib.Topology.Semicontinuous
import Mathlib.MeasureTheory.Integral.Bochner
import Mathlib.Topology.Instances.EReal
/-!
# Vitali-Carathéodory theorem
Vitali-Carathéodory theorem asserts the following. Consider an integrable function `f : α → ℝ` on
a space with a regular measure. Then there exists a function `g : α → EReal` such that `f x < g x`
everywhere, `g` is lower semicontinuous, and the integral of `g` is arbitrarily close to that of
`f`. This theorem is proved in this file, as `exists_lt_lower_semicontinuous_integral_lt`.
Symmetrically, there exists `g < f` which is upper semicontinuous, with integral arbitrarily close
to that of `f`. It follows from the previous statement applied to `-f`. It is formalized under
the name `exists_upper_semicontinuous_lt_integral_gt`.
The most classical version of Vitali-Carathéodory theorem only ensures a large inequality
`f x ≤ g x`. For applications to the fundamental theorem of calculus, though, the strict inequality
`f x < g x` is important. Therefore, we prove the stronger version with strict inequalities in this
file. There is a price to pay: we require that the measure is `σ`-finite, which is not necessary for
the classical Vitali-Carathéodory theorem. Since this is satisfied in all applications, this is
not a real problem.
## Sketch of proof
Decomposing `f` as the difference of its positive and negative parts, it suffices to show that a
positive function can be bounded from above by a lower semicontinuous function, and from below
by an upper semicontinuous function, with integrals close to that of `f`.
For the bound from above, write `f` as a series `∑' n, cₙ * indicator (sₙ)` of simple functions.
Then, approximate `sₙ` by a larger open set `uₙ` with measure very close to that of `sₙ` (this is
possible by regularity of the measure), and set `g = ∑' n, cₙ * indicator (uₙ)`. It is
lower semicontinuous as a series of lower semicontinuous functions, and its integral is arbitrarily
close to that of `f`.
For the bound from below, use finitely many terms in the series, and approximate `sₙ` from inside by
a closed set `Fₙ`. Then `∑ n < N, cₙ * indicator (Fₙ)` is bounded from above by `f`, it is
upper semicontinuous as a finite sum of upper semicontinuous functions, and its integral is
arbitrarily close to that of `f`.
The main pain point in the implementation is that one needs to jump between the spaces `ℝ`, `ℝ≥0`,
`ℝ≥0∞` and `EReal` (and be careful that addition is not well behaved on `EReal`), and between
`lintegral` and `integral`.
We first show the bound from above for simple functions and the nonnegative integral
(this is the main nontrivial mathematical point), then deduce it for general nonnegative functions,
first for the nonnegative integral and then for the Bochner integral.
Then we follow the same steps for the lower bound.
Finally, we glue them together to obtain the main statement
`exists_lt_lower_semicontinuous_integral_lt`.
## Related results
Are you looking for a result on approximation by continuous functions (not just semicontinuous)?
See result `MeasureTheory.Lp.boundedContinuousFunction_dense`, in the file
`Mathlib/MeasureTheory/Function/ContinuousMapDense.lean`.
## References
[Rudin, *Real and Complex Analysis* (Theorem 2.24)][rudin2006real]
-/
open scoped ENNReal NNReal
open MeasureTheory MeasureTheory.Measure
variable {α : Type*} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] (μ : Measure α)
[WeaklyRegular μ]
namespace MeasureTheory
local infixr:25 " →ₛ " => SimpleFunc
/-! ### Lower semicontinuous upper bound for nonnegative functions -/
/-- Given a simple function `f` with values in `ℝ≥0`, there exists a lower semicontinuous
function `g ≥ f` with integral arbitrarily close to that of `f`. Formulation in terms of
`lintegral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem SimpleFunc.exists_le_lowerSemicontinuous_lintegral_ge (f : α →ₛ ℝ≥0) {ε : ℝ≥0∞}
(ε0 : ε ≠ 0) :
∃ g : α → ℝ≥0, (∀ x, f x ≤ g x) ∧ LowerSemicontinuous g ∧
(∫⁻ x, g x ∂μ) ≤ (∫⁻ x, f x ∂μ) + ε := by
induction' f using MeasureTheory.SimpleFunc.induction with c s hs f₁ f₂ _ h₁ h₂ generalizing ε
· let f := SimpleFunc.piecewise s hs (SimpleFunc.const α c) (SimpleFunc.const α 0)
by_cases h : ∫⁻ x, f x ∂μ = ⊤
· refine
⟨fun _ => c, fun x => ?_, lowerSemicontinuous_const, by
simp only [_root_.top_add, le_top, h]⟩
simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise]
exact Set.indicator_le_self _ _ _
by_cases hc : c = 0
· refine ⟨fun _ => 0, ?_, lowerSemicontinuous_const, ?_⟩
· classical
simp only [hc, Set.indicator_zero', Pi.zero_apply, SimpleFunc.const_zero, imp_true_iff,
eq_self_iff_true, SimpleFunc.coe_zero, Set.piecewise_eq_indicator,
SimpleFunc.coe_piecewise, le_zero_iff]
· simp only [lintegral_const, zero_mul, zero_le, ENNReal.coe_zero]
have ne_top : μ s ≠ ⊤ := by
classical
simpa [f, hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const,
Function.const_apply, lintegral_const, ENNReal.coe_indicator, Set.univ_inter,
ENNReal.coe_ne_top, MeasurableSet.univ, ENNReal.mul_eq_top, SimpleFunc.const_zero,
or_false_iff, lintegral_indicator, ENNReal.coe_eq_zero, Ne, not_false_iff,
SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, false_and_iff,
restrict_apply] using h
have : μ s < μ s + ε / c := by
have : (0 : ℝ≥0∞) < ε / c := ENNReal.div_pos_iff.2 ⟨ε0, ENNReal.coe_ne_top⟩
simpa using ENNReal.add_lt_add_left ne_top this
obtain ⟨u, su, u_open, μu⟩ : ∃ (u : _), u ⊇ s ∧ IsOpen u ∧ μ u < μ s + ε / c :=
s.exists_isOpen_lt_of_lt _ this
refine ⟨Set.indicator u fun _ => c,
fun x => ?_, u_open.lowerSemicontinuous_indicator (zero_le _), ?_⟩
· simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise]
exact Set.indicator_le_indicator_of_subset su (fun x => zero_le _) _
· suffices (c : ℝ≥0∞) * μ u ≤ c * μ s + ε by
classical
simpa only [ENNReal.coe_indicator, u_open.measurableSet, lintegral_indicator,
lintegral_const, MeasurableSet.univ, Measure.restrict_apply, Set.univ_inter, const_zero,
coe_piecewise, coe_const, coe_zero, Set.piecewise_eq_indicator, Function.const_apply, hs]
calc
(c : ℝ≥0∞) * μ u ≤ c * (μ s + ε / c) := mul_le_mul_left' μu.le _
_ = c * μ s + ε := by
simp_rw [mul_add]
rw [ENNReal.mul_div_cancel' _ ENNReal.coe_ne_top]
simpa using hc
· rcases h₁ (ENNReal.half_pos ε0).ne' with ⟨g₁, f₁_le_g₁, g₁cont, g₁int⟩
rcases h₂ (ENNReal.half_pos ε0).ne' with ⟨g₂, f₂_le_g₂, g₂cont, g₂int⟩
refine
⟨fun x => g₁ x + g₂ x, fun x => add_le_add (f₁_le_g₁ x) (f₂_le_g₂ x), g₁cont.add g₂cont, ?_⟩
simp only [SimpleFunc.coe_add, ENNReal.coe_add, Pi.add_apply]
rw [lintegral_add_left f₁.measurable.coe_nnreal_ennreal,
lintegral_add_left g₁cont.measurable.coe_nnreal_ennreal]
convert add_le_add g₁int g₂int using 1
conv_lhs => rw [← ENNReal.add_halves ε]
abel
-- Porting note: errors with
-- `ambiguous identifier 'eapproxDiff', possible interpretations:`
-- `[SimpleFunc.eapproxDiff, SimpleFunc.eapproxDiff]`
-- open SimpleFunc (eapproxDiff tsum_eapproxDiff)
/-- Given a measurable function `f` with values in `ℝ≥0`, there exists a lower semicontinuous
function `g ≥ f` with integral arbitrarily close to that of `f`. Formulation in terms of
`lintegral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem exists_le_lowerSemicontinuous_lintegral_ge (f : α → ℝ≥0∞) (hf : Measurable f) {ε : ℝ≥0∞}
(εpos : ε ≠ 0) :
∃ g : α → ℝ≥0∞,
(∀ x, f x ≤ g x) ∧ LowerSemicontinuous g ∧ (∫⁻ x, g x ∂μ) ≤ (∫⁻ x, f x ∂μ) + ε := by
rcases ENNReal.exists_pos_sum_of_countable' εpos ℕ with ⟨δ, δpos, hδ⟩
have :
∀ n,
∃ g : α → ℝ≥0,
(∀ x, SimpleFunc.eapproxDiff f n x ≤ g x) ∧
LowerSemicontinuous g ∧
(∫⁻ x, g x ∂μ) ≤ (∫⁻ x, SimpleFunc.eapproxDiff f n x ∂μ) + δ n :=
fun n =>
SimpleFunc.exists_le_lowerSemicontinuous_lintegral_ge μ (SimpleFunc.eapproxDiff f n)
(δpos n).ne'
choose g f_le_g gcont hg using this
refine ⟨fun x => ∑' n, g n x, fun x => ?_, ?_, ?_⟩
· rw [← SimpleFunc.tsum_eapproxDiff f hf]
exact ENNReal.tsum_le_tsum fun n => ENNReal.coe_le_coe.2 (f_le_g n x)
· refine lowerSemicontinuous_tsum fun n => ?_
exact
ENNReal.continuous_coe.comp_lowerSemicontinuous (gcont n) fun x y hxy =>
ENNReal.coe_le_coe.2 hxy
· calc
∫⁻ x, ∑' n : ℕ, g n x ∂μ = ∑' n, ∫⁻ x, g n x ∂μ := by
rw [lintegral_tsum fun n => (gcont n).measurable.coe_nnreal_ennreal.aemeasurable]
_ ≤ ∑' n, ((∫⁻ x, SimpleFunc.eapproxDiff f n x ∂μ) + δ n) := ENNReal.tsum_le_tsum hg
_ = ∑' n, ∫⁻ x, SimpleFunc.eapproxDiff f n x ∂μ + ∑' n, δ n := ENNReal.tsum_add
_ ≤ (∫⁻ x : α, f x ∂μ) + ε := by
refine add_le_add ?_ hδ.le
rw [← lintegral_tsum]
· simp_rw [SimpleFunc.tsum_eapproxDiff f hf, le_refl]
· intro n; exact (SimpleFunc.measurable _).coe_nnreal_ennreal.aemeasurable
/-- Given a measurable function `f` with values in `ℝ≥0` in a sigma-finite space, there exists a
lower semicontinuous function `g > f` with integral arbitrarily close to that of `f`.
Formulation in terms of `lintegral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem exists_lt_lowerSemicontinuous_lintegral_ge [SigmaFinite μ] (f : α → ℝ≥0)
(fmeas : Measurable f) {ε : ℝ≥0∞} (ε0 : ε ≠ 0) :
∃ g : α → ℝ≥0∞,
(∀ x, (f x : ℝ≥0∞) < g x) ∧ LowerSemicontinuous g ∧ (∫⁻ x, g x ∂μ) ≤ (∫⁻ x, f x ∂μ) + ε := by
have : ε / 2 ≠ 0 := (ENNReal.half_pos ε0).ne'
rcases exists_pos_lintegral_lt_of_sigmaFinite μ this with ⟨w, wpos, wmeas, wint⟩
let f' x := ((f x + w x : ℝ≥0) : ℝ≥0∞)
rcases exists_le_lowerSemicontinuous_lintegral_ge μ f' (fmeas.add wmeas).coe_nnreal_ennreal
this with
⟨g, le_g, gcont, gint⟩
refine ⟨g, fun x => ?_, gcont, ?_⟩
· calc
(f x : ℝ≥0∞) < f' x := by
simpa only [← ENNReal.coe_lt_coe, add_zero] using add_lt_add_left (wpos x) (f x)
_ ≤ g x := le_g x
· calc
(∫⁻ x : α, g x ∂μ) ≤ (∫⁻ x : α, f x + w x ∂μ) + ε / 2 := gint
_ = ((∫⁻ x : α, f x ∂μ) + ∫⁻ x : α, w x ∂μ) + ε / 2 := by
rw [lintegral_add_right _ wmeas.coe_nnreal_ennreal]
_ ≤ (∫⁻ x : α, f x ∂μ) + ε / 2 + ε / 2 := add_le_add_right (add_le_add_left wint.le _) _
_ = (∫⁻ x : α, f x ∂μ) + ε := by rw [add_assoc, ENNReal.add_halves]
/-- Given an almost everywhere measurable function `f` with values in `ℝ≥0` in a sigma-finite space,
there exists a lower semicontinuous function `g > f` with integral arbitrarily close to that of `f`.
Formulation in terms of `lintegral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem exists_lt_lowerSemicontinuous_lintegral_ge_of_aemeasurable [SigmaFinite μ] (f : α → ℝ≥0)
(fmeas : AEMeasurable f μ) {ε : ℝ≥0∞} (ε0 : ε ≠ 0) :
∃ g : α → ℝ≥0∞,
(∀ x, (f x : ℝ≥0∞) < g x) ∧ LowerSemicontinuous g ∧ (∫⁻ x, g x ∂μ) ≤ (∫⁻ x, f x ∂μ) + ε := by
have : ε / 2 ≠ 0 := (ENNReal.half_pos ε0).ne'
rcases exists_lt_lowerSemicontinuous_lintegral_ge μ (fmeas.mk f) fmeas.measurable_mk this with
⟨g0, f_lt_g0, g0_cont, g0_int⟩
rcases exists_measurable_superset_of_null fmeas.ae_eq_mk with ⟨s, hs, smeas, μs⟩
rcases exists_le_lowerSemicontinuous_lintegral_ge μ (s.indicator fun _x => ∞)
(measurable_const.indicator smeas) this with
⟨g1, le_g1, g1_cont, g1_int⟩
refine ⟨fun x => g0 x + g1 x, fun x => ?_, g0_cont.add g1_cont, ?_⟩
· by_cases h : x ∈ s
· have := le_g1 x
simp only [h, Set.indicator_of_mem, top_le_iff] at this
simp [this]
· have : f x = fmeas.mk f x := by rw [Set.compl_subset_comm] at hs; exact hs h
rw [this]
exact (f_lt_g0 x).trans_le le_self_add
· calc
∫⁻ x, g0 x + g1 x ∂μ = (∫⁻ x, g0 x ∂μ) + ∫⁻ x, g1 x ∂μ :=
lintegral_add_left g0_cont.measurable _
_ ≤ (∫⁻ x, f x ∂μ) + ε / 2 + (0 + ε / 2) := by
refine add_le_add ?_ ?_
· convert g0_int using 2
exact lintegral_congr_ae (fmeas.ae_eq_mk.fun_comp _)
· convert g1_int
simp only [smeas, μs, lintegral_const, Set.univ_inter, MeasurableSet.univ,
lintegral_indicator, mul_zero, restrict_apply]
_ = (∫⁻ x, f x ∂μ) + ε := by simp only [add_assoc, ENNReal.add_halves, zero_add]
variable {μ}
/-- Given an integrable function `f` with values in `ℝ≥0` in a sigma-finite space, there exists a
lower semicontinuous function `g > f` with integral arbitrarily close to that of `f`.
Formulation in terms of `integral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem exists_lt_lowerSemicontinuous_integral_gt_nnreal [SigmaFinite μ] (f : α → ℝ≥0)
(fint : Integrable (fun x => (f x : ℝ)) μ) {ε : ℝ} (εpos : 0 < ε) :
∃ g : α → ℝ≥0∞,
(∀ x, (f x : ℝ≥0∞) < g x) ∧
LowerSemicontinuous g ∧
(∀ᵐ x ∂μ, g x < ⊤) ∧
Integrable (fun x => (g x).toReal) μ ∧ (∫ x, (g x).toReal ∂μ) < (∫ x, ↑(f x) ∂μ) + ε := by
have fmeas : AEMeasurable f μ := by
convert fint.aestronglyMeasurable.real_toNNReal.aemeasurable
simp only [Real.toNNReal_coe]
lift ε to ℝ≥0 using εpos.le
obtain ⟨δ, δpos, hδε⟩ : ∃ δ : ℝ≥0, 0 < δ ∧ δ < ε := exists_between εpos
have int_f_ne_top : (∫⁻ a : α, f a ∂μ) ≠ ∞ :=
(hasFiniteIntegral_iff_ofNNReal.1 fint.hasFiniteIntegral).ne
rcases exists_lt_lowerSemicontinuous_lintegral_ge_of_aemeasurable μ f fmeas
(ENNReal.coe_ne_zero.2 δpos.ne') with
⟨g, f_lt_g, gcont, gint⟩
have gint_ne : (∫⁻ x : α, g x ∂μ) ≠ ∞ := ne_top_of_le_ne_top (by simpa) gint
have g_lt_top : ∀ᵐ x : α ∂μ, g x < ∞ := ae_lt_top gcont.measurable gint_ne
have Ig : (∫⁻ a : α, ENNReal.ofReal (g a).toReal ∂μ) = ∫⁻ a : α, g a ∂μ := by
apply lintegral_congr_ae
filter_upwards [g_lt_top] with _ hx
simp only [hx.ne, ENNReal.ofReal_toReal, Ne, not_false_iff]
refine ⟨g, f_lt_g, gcont, g_lt_top, ?_, ?_⟩
· refine ⟨gcont.measurable.ennreal_toReal.aemeasurable.aestronglyMeasurable, ?_⟩
simp only [hasFiniteIntegral_iff_norm, Real.norm_eq_abs, abs_of_nonneg ENNReal.toReal_nonneg]
convert gint_ne.lt_top using 1
· rw [integral_eq_lintegral_of_nonneg_ae, integral_eq_lintegral_of_nonneg_ae]
· calc
ENNReal.toReal (∫⁻ a : α, ENNReal.ofReal (g a).toReal ∂μ) =
ENNReal.toReal (∫⁻ a : α, g a ∂μ) := by congr 1
_ ≤ ENNReal.toReal ((∫⁻ a : α, f a ∂μ) + δ) := by
apply ENNReal.toReal_mono _ gint
simpa using int_f_ne_top
_ = ENNReal.toReal (∫⁻ a : α, f a ∂μ) + δ := by
rw [ENNReal.toReal_add int_f_ne_top ENNReal.coe_ne_top, ENNReal.coe_toReal]
_ < ENNReal.toReal (∫⁻ a : α, f a ∂μ) + ε := add_lt_add_left hδε _
_ = (∫⁻ a : α, ENNReal.ofReal ↑(f a) ∂μ).toReal + ε := by simp
· apply Filter.eventually_of_forall fun x => _; simp
· exact fmeas.coe_nnreal_real.aestronglyMeasurable
· apply Filter.eventually_of_forall fun x => _; simp
· apply gcont.measurable.ennreal_toReal.aemeasurable.aestronglyMeasurable
/-! ### Upper semicontinuous lower bound for nonnegative functions -/
/-- Given a simple function `f` with values in `ℝ≥0`, there exists an upper semicontinuous
function `g ≤ f` with integral arbitrarily close to that of `f`. Formulation in terms of
`lintegral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem SimpleFunc.exists_upperSemicontinuous_le_lintegral_le (f : α →ₛ ℝ≥0)
(int_f : (∫⁻ x, f x ∂μ) ≠ ∞) {ε : ℝ≥0∞} (ε0 : ε ≠ 0) :
∃ g : α → ℝ≥0, (∀ x, g x ≤ f x) ∧ UpperSemicontinuous g ∧
(∫⁻ x, f x ∂μ) ≤ (∫⁻ x, g x ∂μ) + ε := by
induction' f using MeasureTheory.SimpleFunc.induction with c s hs f₁ f₂ _ h₁ h₂ generalizing ε
· by_cases hc : c = 0
· refine ⟨fun _ => 0, ?_, upperSemicontinuous_const, ?_⟩
· classical
simp only [hc, Set.indicator_zero', Pi.zero_apply, SimpleFunc.const_zero, imp_true_iff,
eq_self_iff_true, SimpleFunc.coe_zero, Set.piecewise_eq_indicator,
SimpleFunc.coe_piecewise, le_zero_iff]
· classical
simp only [hc, Set.indicator_zero', lintegral_const, zero_mul, Pi.zero_apply,
SimpleFunc.const_zero, zero_add, zero_le', SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, ENNReal.coe_zero, SimpleFunc.coe_piecewise, zero_le]
have μs_lt_top : μ s < ∞ := by
classical
simpa only [hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const, or_false_iff,
lintegral_const, ENNReal.coe_indicator, Set.univ_inter, ENNReal.coe_ne_top,
Measure.restrict_apply MeasurableSet.univ, ENNReal.mul_eq_top, SimpleFunc.const_zero,
Function.const_apply, lintegral_indicator, ENNReal.coe_eq_zero, Ne, not_false_iff,
SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise,
false_and_iff] using int_f
have : (0 : ℝ≥0∞) < ε / c := ENNReal.div_pos_iff.2 ⟨ε0, ENNReal.coe_ne_top⟩
obtain ⟨F, Fs, F_closed, μF⟩ : ∃ (F : _), F ⊆ s ∧ IsClosed F ∧ μ s < μ F + ε / c :=
hs.exists_isClosed_lt_add μs_lt_top.ne this.ne'
refine
⟨Set.indicator F fun _ => c, fun x => ?_, F_closed.upperSemicontinuous_indicator (zero_le _),
?_⟩
· simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise]
exact Set.indicator_le_indicator_of_subset Fs (fun x => zero_le _) _
· suffices (c : ℝ≥0∞) * μ s ≤ c * μ F + ε by
classical
simpa only [hs, F_closed.measurableSet, SimpleFunc.coe_const, Function.const_apply,
lintegral_const, ENNReal.coe_indicator, Set.univ_inter, MeasurableSet.univ,
SimpleFunc.const_zero, lintegral_indicator, SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, Measure.restrict_apply]
calc
(c : ℝ≥0∞) * μ s ≤ c * (μ F + ε / c) := mul_le_mul_left' μF.le _
_ = c * μ F + ε := by
simp_rw [mul_add]
rw [ENNReal.mul_div_cancel' _ ENNReal.coe_ne_top]
simpa using hc
· have A : ((∫⁻ x : α, f₁ x ∂μ) + ∫⁻ x : α, f₂ x ∂μ) ≠ ⊤ := by
rwa [← lintegral_add_left f₁.measurable.coe_nnreal_ennreal]
rcases h₁ (ENNReal.add_ne_top.1 A).1 (ENNReal.half_pos ε0).ne' with
⟨g₁, f₁_le_g₁, g₁cont, g₁int⟩
rcases h₂ (ENNReal.add_ne_top.1 A).2 (ENNReal.half_pos ε0).ne' with
⟨g₂, f₂_le_g₂, g₂cont, g₂int⟩
refine
⟨fun x => g₁ x + g₂ x, fun x => add_le_add (f₁_le_g₁ x) (f₂_le_g₂ x), g₁cont.add g₂cont, ?_⟩
simp only [SimpleFunc.coe_add, ENNReal.coe_add, Pi.add_apply]
rw [lintegral_add_left f₁.measurable.coe_nnreal_ennreal,
lintegral_add_left g₁cont.measurable.coe_nnreal_ennreal]
convert add_le_add g₁int g₂int using 1
conv_lhs => rw [← ENNReal.add_halves ε]
abel
/-- Given an integrable function `f` with values in `ℝ≥0`, there exists an upper semicontinuous
function `g ≤ f` with integral arbitrarily close to that of `f`. Formulation in terms of
`lintegral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem exists_upperSemicontinuous_le_lintegral_le (f : α → ℝ≥0) (int_f : (∫⁻ x, f x ∂μ) ≠ ∞)
{ε : ℝ≥0∞} (ε0 : ε ≠ 0) :
∃ g : α → ℝ≥0, (∀ x, g x ≤ f x) ∧ UpperSemicontinuous g ∧
(∫⁻ x, f x ∂μ) ≤ (∫⁻ x, g x ∂μ) + ε := by
obtain ⟨fs, fs_le_f, int_fs⟩ :
∃ fs : α →ₛ ℝ≥0, (∀ x, fs x ≤ f x) ∧ (∫⁻ x, f x ∂μ) ≤ (∫⁻ x, fs x ∂μ) + ε / 2 := by
-- Porting note: need to name identifier (not `this`), because `conv_rhs at this` errors
have aux := ENNReal.lt_add_right int_f (ENNReal.half_pos ε0).ne'
conv_rhs at aux => rw [lintegral_eq_nnreal (fun x => (f x : ℝ≥0∞)) μ]
erw [ENNReal.biSup_add] at aux <;> [skip; exact ⟨0, fun x => by simp⟩]
simp only [lt_iSup_iff] at aux
rcases aux with ⟨fs, fs_le_f, int_fs⟩
refine ⟨fs, fun x => by simpa only [ENNReal.coe_le_coe] using fs_le_f x, ?_⟩
convert int_fs.le
rw [← SimpleFunc.lintegral_eq_lintegral]
simp only [SimpleFunc.coe_map, Function.comp_apply]
have int_fs_lt_top : (∫⁻ x, fs x ∂μ) ≠ ∞ := by
refine ne_top_of_le_ne_top int_f (lintegral_mono fun x => ?_)
simpa only [ENNReal.coe_le_coe] using fs_le_f x
obtain ⟨g, g_le_fs, gcont, gint⟩ :
∃ g : α → ℝ≥0,
(∀ x, g x ≤ fs x) ∧ UpperSemicontinuous g ∧ (∫⁻ x, fs x ∂μ) ≤ (∫⁻ x, g x ∂μ) + ε / 2 :=
fs.exists_upperSemicontinuous_le_lintegral_le int_fs_lt_top (ENNReal.half_pos ε0).ne'
refine ⟨g, fun x => (g_le_fs x).trans (fs_le_f x), gcont, ?_⟩
calc
(∫⁻ x, f x ∂μ) ≤ (∫⁻ x, fs x ∂μ) + ε / 2 := int_fs
_ ≤ (∫⁻ x, g x ∂μ) + ε / 2 + ε / 2 := add_le_add gint le_rfl
_ = (∫⁻ x, g x ∂μ) + ε := by rw [add_assoc, ENNReal.add_halves]
/-- Given an integrable function `f` with values in `ℝ≥0`, there exists an upper semicontinuous
function `g ≤ f` with integral arbitrarily close to that of `f`. Formulation in terms of
`integral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem exists_upperSemicontinuous_le_integral_le (f : α → ℝ≥0)
(fint : Integrable (fun x => (f x : ℝ)) μ) {ε : ℝ} (εpos : 0 < ε) :
∃ g : α → ℝ≥0,
(∀ x, g x ≤ f x) ∧
UpperSemicontinuous g ∧
Integrable (fun x => (g x : ℝ)) μ ∧ (∫ x, (f x : ℝ) ∂μ) - ε ≤ ∫ x, ↑(g x) ∂μ := by
lift ε to ℝ≥0 using εpos.le
rw [NNReal.coe_pos, ← ENNReal.coe_pos] at εpos
have If : (∫⁻ x, f x ∂μ) < ∞ := hasFiniteIntegral_iff_ofNNReal.1 fint.hasFiniteIntegral
rcases exists_upperSemicontinuous_le_lintegral_le f If.ne εpos.ne' with ⟨g, gf, gcont, gint⟩
have Ig : (∫⁻ x, g x ∂μ) < ∞ := by
refine lt_of_le_of_lt (lintegral_mono fun x => ?_) If
simpa using gf x
refine ⟨g, gf, gcont, ?_, ?_⟩
· refine
Integrable.mono fint gcont.measurable.coe_nnreal_real.aemeasurable.aestronglyMeasurable ?_
exact Filter.eventually_of_forall fun x => by simp [gf x]
· rw [integral_eq_lintegral_of_nonneg_ae, integral_eq_lintegral_of_nonneg_ae]
· rw [sub_le_iff_le_add]
convert ENNReal.toReal_mono _ gint
· simp
· rw [ENNReal.toReal_add Ig.ne ENNReal.coe_ne_top]; simp
· simpa using Ig.ne
· apply Filter.eventually_of_forall; simp
· exact gcont.measurable.coe_nnreal_real.aemeasurable.aestronglyMeasurable
· apply Filter.eventually_of_forall; simp
· exact fint.aestronglyMeasurable
/-! ### Vitali-Carathéodory theorem -/
/-- **Vitali-Carathéodory Theorem**: given an integrable real function `f`, there exists an
integrable function `g > f` which is lower semicontinuous, with integral arbitrarily close
to that of `f`. This function has to be `EReal`-valued in general. -/
theorem exists_lt_lowerSemicontinuous_integral_lt [SigmaFinite μ] (f : α → ℝ) (hf : Integrable f μ)
{ε : ℝ} (εpos : 0 < ε) :
∃ g : α → EReal,
(∀ x, (f x : EReal) < g x) ∧
LowerSemicontinuous g ∧
Integrable (fun x => EReal.toReal (g x)) μ ∧
(∀ᵐ x ∂μ, g x < ⊤) ∧ (∫ x, EReal.toReal (g x) ∂μ) < (∫ x, f x ∂μ) + ε := by
let δ : ℝ≥0 := ⟨ε / 2, (half_pos εpos).le⟩
have δpos : 0 < δ := half_pos εpos
let fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
have int_fp : Integrable (fun x => (fp x : ℝ)) μ := hf.real_toNNReal
rcases exists_lt_lowerSemicontinuous_integral_gt_nnreal fp int_fp δpos with
⟨gp, fp_lt_gp, gpcont, gp_lt_top, gp_integrable, gpint⟩
let fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
have int_fm : Integrable (fun x => (fm x : ℝ)) μ := hf.neg.real_toNNReal
rcases exists_upperSemicontinuous_le_integral_le fm int_fm δpos with
⟨gm, gm_le_fm, gmcont, gm_integrable, gmint⟩
let g : α → EReal := fun x => (gp x : EReal) - gm x
have ae_g : ∀ᵐ x ∂μ, (g x).toReal = (gp x : EReal).toReal - (gm x : EReal).toReal := by
filter_upwards [gp_lt_top] with _ hx
rw [EReal.toReal_sub] <;> simp [hx.ne]
refine ⟨g, ?lt, ?lsc, ?int, ?aelt, ?intlt⟩
case int =>
show Integrable (fun x => EReal.toReal (g x)) μ
rw [integrable_congr ae_g]
convert gp_integrable.sub gm_integrable
simp
case intlt =>
show (∫ x : α, (g x).toReal ∂μ) < (∫ x : α, f x ∂μ) + ε
exact
calc
(∫ x : α, (g x).toReal ∂μ) = ∫ x : α, EReal.toReal (gp x) - EReal.toReal (gm x) ∂μ :=
integral_congr_ae ae_g
_ = (∫ x : α, EReal.toReal (gp x) ∂μ) - ∫ x : α, ↑(gm x) ∂μ := by
simp only [EReal.toReal_coe_ennreal, ENNReal.coe_toReal]
exact integral_sub gp_integrable gm_integrable
_ < (∫ x : α, ↑(fp x) ∂μ) + ↑δ - ∫ x : α, ↑(gm x) ∂μ := by
apply sub_lt_sub_right
convert gpint
simp only [EReal.toReal_coe_ennreal]
_ ≤ (∫ x : α, ↑(fp x) ∂μ) + ↑δ - ((∫ x : α, ↑(fm x) ∂μ) - δ) := sub_le_sub_left gmint _
_ = (∫ x : α, f x ∂μ) + 2 * δ := by
simp_rw [integral_eq_integral_pos_part_sub_integral_neg_part hf]; ring
_ = (∫ x : α, f x ∂μ) + ε := by congr 1; field_simp [δ, mul_comm]
case aelt =>
show ∀ᵐ x : α ∂μ, g x < ⊤
filter_upwards [gp_lt_top] with ?_ hx
simp only [g, sub_eq_add_neg, Ne, (EReal.add_lt_top _ _).ne, lt_top_iff_ne_top,
lt_top_iff_ne_top.1 hx, EReal.coe_ennreal_eq_top_iff, not_false_iff, EReal.neg_eq_top_iff,
EReal.coe_ennreal_ne_bot]
case lt =>
show ∀ x, (f x : EReal) < g x
intro x
rw [EReal.coe_real_ereal_eq_coe_toNNReal_sub_coe_toNNReal (f x)]
refine EReal.sub_lt_sub_of_lt_of_le ?_ ?_ ?_ ?_
· simp only [EReal.coe_ennreal_lt_coe_ennreal_iff]; exact fp_lt_gp x
· simp only [ENNReal.coe_le_coe, EReal.coe_ennreal_le_coe_ennreal_iff]
exact gm_le_fm x
· simp only [EReal.coe_ennreal_ne_bot, Ne, not_false_iff]
· simp only [EReal.coe_nnreal_ne_top, Ne, not_false_iff]
case lsc =>
show LowerSemicontinuous g
apply LowerSemicontinuous.add'
· exact continuous_coe_ennreal_ereal.comp_lowerSemicontinuous gpcont fun x y hxy =>
EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
· apply continuous_neg.comp_upperSemicontinuous_antitone _ fun x y hxy =>
EReal.neg_le_neg_iff.2 hxy
dsimp
apply continuous_coe_ennreal_ereal.comp_upperSemicontinuous _ fun x y hxy =>
EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
exact ENNReal.continuous_coe.comp_upperSemicontinuous gmcont fun x y hxy =>
ENNReal.coe_le_coe.2 hxy
· intro x
exact EReal.continuousAt_add (by simp) (by simp)
/-- **Vitali-Carathéodory Theorem**: given an integrable real function `f`, there exists an
integrable function `g < f` which is upper semicontinuous, with integral arbitrarily close to that
of `f`. This function has to be `EReal`-valued in general. -/
theorem exists_upperSemicontinuous_lt_integral_gt [SigmaFinite μ] (f : α → ℝ) (hf : Integrable f μ)
{ε : ℝ} (εpos : 0 < ε) :
∃ g : α → EReal,
(∀ x, (g x : EReal) < f x) ∧
UpperSemicontinuous g ∧
Integrable (fun x => EReal.toReal (g x)) μ ∧
(∀ᵐ x ∂μ, ⊥ < g x) ∧ (∫ x, f x ∂μ) < (∫ x, EReal.toReal (g x) ∂μ) + ε := by
rcases exists_lt_lowerSemicontinuous_integral_lt (fun x => -f x) hf.neg εpos with
⟨g, g_lt_f, gcont, g_integrable, g_lt_top, gint⟩
refine ⟨fun x => -g x, ?_, ?_, ?_, ?_, ?_⟩
· exact fun x => EReal.neg_lt_iff_neg_lt.1 (by simpa only [EReal.coe_neg] using g_lt_f x)
· exact
continuous_neg.comp_lowerSemicontinuous_antitone gcont fun x y hxy =>
EReal.neg_le_neg_iff.2 hxy
· convert g_integrable.neg
simp
· simpa [bot_lt_iff_ne_bot, lt_top_iff_ne_top] using g_lt_top
· simp_rw [integral_neg, lt_neg_add_iff_add_lt] at gint
rw [add_comm] at gint
simpa [integral_neg] using gint
end MeasureTheory
|
MeasureTheory\MeasurableSpace\Basic.lean | /-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Mario Carneiro
-/
import Mathlib.Data.Finset.Update
import Mathlib.Data.Prod.TProd
import Mathlib.GroupTheory.Coset
import Mathlib.Logic.Equiv.Fin
import Mathlib.MeasureTheory.MeasurableSpace.Instances
import Mathlib.Order.LiminfLimsup
import Mathlib.Data.Set.UnionLift
import Mathlib.Order.Filter.SmallSets
/-!
# Measurable spaces and measurable functions
This file provides properties of measurable spaces and the functions and isomorphisms between them.
The definition of a measurable space is in `Mathlib/MeasureTheory/MeasurableSpace/Defs.lean`.
A measurable space is a set equipped with a σ-algebra, a collection of
subsets closed under complementation and countable union. A function
between measurable spaces is measurable if the preimage of each
measurable subset is measurable.
σ-algebras on a fixed set `α` form a complete lattice. Here we order
σ-algebras by writing `m₁ ≤ m₂` if every set which is `m₁`-measurable is
also `m₂`-measurable (that is, `m₁` is a subset of `m₂`). In particular, any
collection of subsets of `α` generates a smallest σ-algebra which
contains all of them. A function `f : α → β` induces a Galois connection
between the lattices of σ-algebras on `α` and `β`.
We say that a filter `f` is measurably generated if every set `s ∈ f` includes a measurable
set `t ∈ f`. This property is useful, e.g., to extract a measurable witness of `Filter.Eventually`.
## Implementation notes
Measurability of a function `f : α → β` between measurable spaces is
defined in terms of the Galois connection induced by f.
## References
* <https://en.wikipedia.org/wiki/Measurable_space>
* <https://en.wikipedia.org/wiki/Sigma-algebra>
* <https://en.wikipedia.org/wiki/Dynkin_system>
## Tags
measurable space, σ-algebra, measurable function, dynkin system, π-λ theorem, π-system
-/
open Set Encodable Function Equiv Filter MeasureTheory
universe uι
variable {α β γ δ δ' : Type*} {ι : Sort uι} {s t u : Set α}
namespace MeasurableSpace
section Functors
variable {m m₁ m₂ : MeasurableSpace α} {m' : MeasurableSpace β} {f : α → β} {g : β → α}
/-- The forward image of a measurable space under a function. `map f m` contains the sets
`s : Set β` whose preimage under `f` is measurable. -/
protected def map (f : α → β) (m : MeasurableSpace α) : MeasurableSpace β where
MeasurableSet' s := MeasurableSet[m] <| f ⁻¹' s
measurableSet_empty := m.measurableSet_empty
measurableSet_compl s hs := m.measurableSet_compl _ hs
measurableSet_iUnion f hf := by simpa only [preimage_iUnion] using m.measurableSet_iUnion _ hf
lemma map_def {s : Set β} : MeasurableSet[m.map f] s ↔ MeasurableSet[m] (f ⁻¹' s) := Iff.rfl
@[simp]
theorem map_id : m.map id = m :=
MeasurableSpace.ext fun _ => Iff.rfl
@[simp]
theorem map_comp {f : α → β} {g : β → γ} : (m.map f).map g = m.map (g ∘ f) :=
MeasurableSpace.ext fun _ => Iff.rfl
/-- The reverse image of a measurable space under a function. `comap f m` contains the sets
`s : Set α` such that `s` is the `f`-preimage of a measurable set in `β`. -/
protected def comap (f : α → β) (m : MeasurableSpace β) : MeasurableSpace α where
MeasurableSet' s := ∃ s', MeasurableSet[m] s' ∧ f ⁻¹' s' = s
measurableSet_empty := ⟨∅, m.measurableSet_empty, rfl⟩
measurableSet_compl := fun s ⟨s', h₁, h₂⟩ => ⟨s'ᶜ, m.measurableSet_compl _ h₁, h₂ ▸ rfl⟩
measurableSet_iUnion s hs :=
let ⟨s', hs'⟩ := Classical.axiom_of_choice hs
⟨⋃ i, s' i, m.measurableSet_iUnion _ fun i => (hs' i).left, by simp [hs']⟩
theorem comap_eq_generateFrom (m : MeasurableSpace β) (f : α → β) :
m.comap f = generateFrom { t | ∃ s, MeasurableSet s ∧ f ⁻¹' s = t } :=
(@generateFrom_measurableSet _ (.comap f m)).symm
@[simp]
theorem comap_id : m.comap id = m :=
MeasurableSpace.ext fun s => ⟨fun ⟨_, hs', h⟩ => h ▸ hs', fun h => ⟨s, h, rfl⟩⟩
@[simp]
theorem comap_comp {f : β → α} {g : γ → β} : (m.comap f).comap g = m.comap (f ∘ g) :=
MeasurableSpace.ext fun _ =>
⟨fun ⟨_, ⟨u, h, hu⟩, ht⟩ => ⟨u, h, ht ▸ hu ▸ rfl⟩, fun ⟨t, h, ht⟩ => ⟨f ⁻¹' t, ⟨_, h, rfl⟩, ht⟩⟩
theorem comap_le_iff_le_map {f : α → β} : m'.comap f ≤ m ↔ m' ≤ m.map f :=
⟨fun h _s hs => h _ ⟨_, hs, rfl⟩, fun h _s ⟨_t, ht, heq⟩ => heq ▸ h _ ht⟩
theorem gc_comap_map (f : α → β) :
GaloisConnection (MeasurableSpace.comap f) (MeasurableSpace.map f) := fun _ _ =>
comap_le_iff_le_map
theorem map_mono (h : m₁ ≤ m₂) : m₁.map f ≤ m₂.map f :=
(gc_comap_map f).monotone_u h
theorem monotone_map : Monotone (MeasurableSpace.map f) := fun _ _ => map_mono
theorem comap_mono (h : m₁ ≤ m₂) : m₁.comap g ≤ m₂.comap g :=
(gc_comap_map g).monotone_l h
theorem monotone_comap : Monotone (MeasurableSpace.comap g) := fun _ _ h => comap_mono h
@[simp]
theorem comap_bot : (⊥ : MeasurableSpace α).comap g = ⊥ :=
(gc_comap_map g).l_bot
@[simp]
theorem comap_sup : (m₁ ⊔ m₂).comap g = m₁.comap g ⊔ m₂.comap g :=
(gc_comap_map g).l_sup
@[simp]
theorem comap_iSup {m : ι → MeasurableSpace α} : (⨆ i, m i).comap g = ⨆ i, (m i).comap g :=
(gc_comap_map g).l_iSup
@[simp]
theorem map_top : (⊤ : MeasurableSpace α).map f = ⊤ :=
(gc_comap_map f).u_top
@[simp]
theorem map_inf : (m₁ ⊓ m₂).map f = m₁.map f ⊓ m₂.map f :=
(gc_comap_map f).u_inf
@[simp]
theorem map_iInf {m : ι → MeasurableSpace α} : (⨅ i, m i).map f = ⨅ i, (m i).map f :=
(gc_comap_map f).u_iInf
theorem comap_map_le : (m.map f).comap f ≤ m :=
(gc_comap_map f).l_u_le _
theorem le_map_comap : m ≤ (m.comap g).map g :=
(gc_comap_map g).le_u_l _
end Functors
@[simp] theorem map_const {m} (b : β) : MeasurableSpace.map (fun _a : α ↦ b) m = ⊤ :=
eq_top_iff.2 <| fun s _ ↦ by rw [map_def]; by_cases h : b ∈ s <;> simp [h]
@[simp] theorem comap_const {m} (b : β) : MeasurableSpace.comap (fun _a : α => b) m = ⊥ :=
eq_bot_iff.2 <| by rintro _ ⟨s, -, rfl⟩; by_cases b ∈ s <;> simp [*]
theorem comap_generateFrom {f : α → β} {s : Set (Set β)} :
(generateFrom s).comap f = generateFrom (preimage f '' s) :=
le_antisymm
(comap_le_iff_le_map.2 <|
generateFrom_le fun _t hts => GenerateMeasurable.basic _ <| mem_image_of_mem _ <| hts)
(generateFrom_le fun _t ⟨u, hu, Eq⟩ => Eq ▸ ⟨u, GenerateMeasurable.basic _ hu, rfl⟩)
end MeasurableSpace
section MeasurableFunctions
open MeasurableSpace
theorem measurable_iff_le_map {m₁ : MeasurableSpace α} {m₂ : MeasurableSpace β} {f : α → β} :
Measurable f ↔ m₂ ≤ m₁.map f :=
Iff.rfl
alias ⟨Measurable.le_map, Measurable.of_le_map⟩ := measurable_iff_le_map
theorem measurable_iff_comap_le {m₁ : MeasurableSpace α} {m₂ : MeasurableSpace β} {f : α → β} :
Measurable f ↔ m₂.comap f ≤ m₁ :=
comap_le_iff_le_map.symm
alias ⟨Measurable.comap_le, Measurable.of_comap_le⟩ := measurable_iff_comap_le
theorem comap_measurable {m : MeasurableSpace β} (f : α → β) : Measurable[m.comap f] f :=
fun s hs => ⟨s, hs, rfl⟩
theorem Measurable.mono {ma ma' : MeasurableSpace α} {mb mb' : MeasurableSpace β} {f : α → β}
(hf : @Measurable α β ma mb f) (ha : ma ≤ ma') (hb : mb' ≤ mb) : @Measurable α β ma' mb' f :=
fun _t ht => ha _ <| hf <| hb _ ht
lemma Measurable.iSup' {mα : ι → MeasurableSpace α} {_ : MeasurableSpace β} {f : α → β} (i₀ : ι)
(h : Measurable[mα i₀] f) :
Measurable[⨆ i, mα i] f :=
h.mono (le_iSup mα i₀) le_rfl
lemma Measurable.sup_of_left {mα mα' : MeasurableSpace α} {_ : MeasurableSpace β} {f : α → β}
(h : Measurable[mα] f) :
Measurable[mα ⊔ mα'] f :=
h.mono le_sup_left le_rfl
lemma Measurable.sup_of_right {mα mα' : MeasurableSpace α} {_ : MeasurableSpace β} {f : α → β}
(h : Measurable[mα'] f) :
Measurable[mα ⊔ mα'] f :=
h.mono le_sup_right le_rfl
theorem measurable_id'' {m mα : MeasurableSpace α} (hm : m ≤ mα) : @Measurable α α mα m id :=
measurable_id.mono le_rfl hm
-- Porting note (#11215): TODO: add TC `DiscreteMeasurable` + instances
@[measurability]
theorem measurable_from_top [MeasurableSpace β] {f : α → β} : Measurable[⊤] f := fun _ _ => trivial
theorem measurable_generateFrom [MeasurableSpace α] {s : Set (Set β)} {f : α → β}
(h : ∀ t ∈ s, MeasurableSet (f ⁻¹' t)) : @Measurable _ _ _ (generateFrom s) f :=
Measurable.of_le_map <| generateFrom_le h
variable {f g : α → β}
section TypeclassMeasurableSpace
variable [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ]
@[nontriviality, measurability]
theorem Subsingleton.measurable [Subsingleton α] : Measurable f := fun _ _ =>
@Subsingleton.measurableSet α _ _ _
@[nontriviality, measurability]
theorem measurable_of_subsingleton_codomain [Subsingleton β] (f : α → β) : Measurable f :=
fun s _ => Subsingleton.set_cases MeasurableSet.empty MeasurableSet.univ s
@[to_additive (attr := measurability)]
theorem measurable_one [One α] : Measurable (1 : β → α) :=
@measurable_const _ _ _ _ 1
theorem measurable_of_empty [IsEmpty α] (f : α → β) : Measurable f :=
Subsingleton.measurable
theorem measurable_of_empty_codomain [IsEmpty β] (f : α → β) : Measurable f :=
measurable_of_subsingleton_codomain f
/-- A version of `measurable_const` that assumes `f x = f y` for all `x, y`. This version works
for functions between empty types. -/
theorem measurable_const' {f : β → α} (hf : ∀ x y, f x = f y) : Measurable f := by
nontriviality β
inhabit β
convert @measurable_const α β _ _ (f default) using 2
apply hf
@[measurability]
theorem measurable_natCast [NatCast α] (n : ℕ) : Measurable (n : β → α) :=
@measurable_const α _ _ _ n
@[measurability]
theorem measurable_intCast [IntCast α] (n : ℤ) : Measurable (n : β → α) :=
@measurable_const α _ _ _ n
theorem measurable_of_countable [Countable α] [MeasurableSingletonClass α] (f : α → β) :
Measurable f := fun s _ =>
(f ⁻¹' s).to_countable.measurableSet
theorem measurable_of_finite [Finite α] [MeasurableSingletonClass α] (f : α → β) : Measurable f :=
measurable_of_countable f
end TypeclassMeasurableSpace
variable {m : MeasurableSpace α}
@[measurability]
theorem Measurable.iterate {f : α → α} (hf : Measurable f) : ∀ n, Measurable f^[n]
| 0 => measurable_id
| n + 1 => (Measurable.iterate hf n).comp hf
variable {mβ : MeasurableSpace β}
@[measurability]
theorem measurableSet_preimage {t : Set β} (hf : Measurable f) (ht : MeasurableSet t) :
MeasurableSet (f ⁻¹' t) :=
hf ht
protected theorem MeasurableSet.preimage {t : Set β} (ht : MeasurableSet t) (hf : Measurable f) :
MeasurableSet (f ⁻¹' t) :=
hf ht
@[measurability]
protected theorem Measurable.piecewise {_ : DecidablePred (· ∈ s)} (hs : MeasurableSet s)
(hf : Measurable f) (hg : Measurable g) : Measurable (piecewise s f g) := by
intro t ht
rw [piecewise_preimage]
exact hs.ite (hf ht) (hg ht)
/-- This is slightly different from `Measurable.piecewise`. It can be used to show
`Measurable (ite (x=0) 0 1)` by
`exact Measurable.ite (measurableSet_singleton 0) measurable_const measurable_const`,
but replacing `Measurable.ite` by `Measurable.piecewise` in that example proof does not work. -/
theorem Measurable.ite {p : α → Prop} {_ : DecidablePred p} (hp : MeasurableSet { a : α | p a })
(hf : Measurable f) (hg : Measurable g) : Measurable fun x => ite (p x) (f x) (g x) :=
Measurable.piecewise hp hf hg
@[measurability, fun_prop]
theorem Measurable.indicator [Zero β] (hf : Measurable f) (hs : MeasurableSet s) :
Measurable (s.indicator f) :=
hf.piecewise hs measurable_const
/-- The measurability of a set `A` is equivalent to the measurability of the indicator function
which takes a constant value `b ≠ 0` on a set `A` and `0` elsewhere. -/
lemma measurable_indicator_const_iff [Zero β] [MeasurableSingletonClass β] (b : β) [NeZero b] :
Measurable (s.indicator (fun (_ : α) ↦ b)) ↔ MeasurableSet s := by
constructor <;> intro h
· convert h (MeasurableSet.singleton (0 : β)).compl
ext a
simp [NeZero.ne b]
· exact measurable_const.indicator h
@[to_additive (attr := measurability)]
theorem measurableSet_mulSupport [One β] [MeasurableSingletonClass β] (hf : Measurable f) :
MeasurableSet (mulSupport f) :=
hf (measurableSet_singleton 1).compl
/-- If a function coincides with a measurable function outside of a countable set, it is
measurable. -/
theorem Measurable.measurable_of_countable_ne [MeasurableSingletonClass α] (hf : Measurable f)
(h : Set.Countable { x | f x ≠ g x }) : Measurable g := by
intro t ht
have : g ⁻¹' t = g ⁻¹' t ∩ { x | f x = g x }ᶜ ∪ g ⁻¹' t ∩ { x | f x = g x } := by
simp [← inter_union_distrib_left]
rw [this]
refine (h.mono inter_subset_right).measurableSet.union ?_
have : g ⁻¹' t ∩ { x : α | f x = g x } = f ⁻¹' t ∩ { x : α | f x = g x } := by
ext x
simp (config := { contextual := true })
rw [this]
exact (hf ht).inter h.measurableSet.of_compl
end MeasurableFunctions
section Constructions
theorem measurable_to_countable [MeasurableSpace α] [Countable α] [MeasurableSpace β] {f : β → α}
(h : ∀ y, MeasurableSet (f ⁻¹' {f y})) : Measurable f := fun s _ => by
rw [← biUnion_preimage_singleton]
refine MeasurableSet.iUnion fun y => MeasurableSet.iUnion fun hy => ?_
by_cases hyf : y ∈ range f
· rcases hyf with ⟨y, rfl⟩
apply h
· simp only [preimage_singleton_eq_empty.2 hyf, MeasurableSet.empty]
theorem measurable_to_countable' [MeasurableSpace α] [Countable α] [MeasurableSpace β] {f : β → α}
(h : ∀ x, MeasurableSet (f ⁻¹' {x})) : Measurable f :=
measurable_to_countable fun y => h (f y)
@[measurability]
theorem measurable_unit [MeasurableSpace α] (f : Unit → α) : Measurable f :=
measurable_from_top
section ULift
variable [MeasurableSpace α]
instance _root_.ULift.instMeasurableSpace : MeasurableSpace (ULift α) :=
‹MeasurableSpace α›.map ULift.up
lemma measurable_down : Measurable (ULift.down : ULift α → α) := fun _ ↦ id
lemma measurable_up : Measurable (ULift.up : α → ULift α) := fun _ ↦ id
@[simp] lemma measurableSet_preimage_down {s : Set α} :
MeasurableSet (ULift.down ⁻¹' s) ↔ MeasurableSet s := Iff.rfl
@[simp] lemma measurableSet_preimage_up {s : Set (ULift α)} :
MeasurableSet (ULift.up ⁻¹' s) ↔ MeasurableSet s := Iff.rfl
end ULift
section Nat
variable [MeasurableSpace α]
@[measurability]
theorem measurable_from_nat {f : ℕ → α} : Measurable f :=
measurable_from_top
theorem measurable_to_nat {f : α → ℕ} : (∀ y, MeasurableSet (f ⁻¹' {f y})) → Measurable f :=
measurable_to_countable
theorem measurable_to_bool {f : α → Bool} (h : MeasurableSet (f ⁻¹' {true})) : Measurable f := by
apply measurable_to_countable'
rintro (- | -)
· convert h.compl
rw [← preimage_compl, Bool.compl_singleton, Bool.not_true]
exact h
theorem measurable_to_prop {f : α → Prop} (h : MeasurableSet (f ⁻¹' {True})) : Measurable f := by
refine measurable_to_countable' fun x => ?_
by_cases hx : x
· simpa [hx] using h
· simpa only [hx, ← preimage_compl, Prop.compl_singleton, not_true, preimage_singleton_false]
using h.compl
theorem measurable_findGreatest' {p : α → ℕ → Prop} [∀ x, DecidablePred (p x)] {N : ℕ}
(hN : ∀ k ≤ N, MeasurableSet { x | Nat.findGreatest (p x) N = k }) :
Measurable fun x => Nat.findGreatest (p x) N :=
measurable_to_nat fun _ => hN _ N.findGreatest_le
theorem measurable_findGreatest {p : α → ℕ → Prop} [∀ x, DecidablePred (p x)] {N}
(hN : ∀ k ≤ N, MeasurableSet { x | p x k }) : Measurable fun x => Nat.findGreatest (p x) N := by
refine measurable_findGreatest' fun k hk => ?_
simp only [Nat.findGreatest_eq_iff, setOf_and, setOf_forall, ← compl_setOf]
repeat' apply_rules [MeasurableSet.inter, MeasurableSet.const, MeasurableSet.iInter,
MeasurableSet.compl, hN] <;> try intros
theorem measurable_find {p : α → ℕ → Prop} [∀ x, DecidablePred (p x)] (hp : ∀ x, ∃ N, p x N)
(hm : ∀ k, MeasurableSet { x | p x k }) : Measurable fun x => Nat.find (hp x) := by
refine measurable_to_nat fun x => ?_
rw [preimage_find_eq_disjointed (fun k => {x | p x k})]
exact MeasurableSet.disjointed hm _
end Nat
section Quotient
variable [MeasurableSpace α] [MeasurableSpace β]
instance Quot.instMeasurableSpace {α} {r : α → α → Prop} [m : MeasurableSpace α] :
MeasurableSpace (Quot r) :=
m.map (Quot.mk r)
instance Quotient.instMeasurableSpace {α} {s : Setoid α} [m : MeasurableSpace α] :
MeasurableSpace (Quotient s) :=
m.map Quotient.mk''
@[to_additive]
instance QuotientGroup.measurableSpace {G} [Group G] [MeasurableSpace G] (S : Subgroup G) :
MeasurableSpace (G ⧸ S) :=
Quotient.instMeasurableSpace
theorem measurableSet_quotient {s : Setoid α} {t : Set (Quotient s)} :
MeasurableSet t ↔ MeasurableSet (Quotient.mk'' ⁻¹' t) :=
Iff.rfl
theorem measurable_from_quotient {s : Setoid α} {f : Quotient s → β} :
Measurable f ↔ Measurable (f ∘ Quotient.mk'') :=
Iff.rfl
@[measurability]
theorem measurable_quotient_mk' [s : Setoid α] : Measurable (Quotient.mk' : α → Quotient s) :=
fun _ => id
@[measurability]
theorem measurable_quotient_mk'' {s : Setoid α} : Measurable (Quotient.mk'' : α → Quotient s) :=
fun _ => id
@[measurability]
theorem measurable_quot_mk {r : α → α → Prop} : Measurable (Quot.mk r) := fun _ => id
@[to_additive (attr := measurability)]
theorem QuotientGroup.measurable_coe {G} [Group G] [MeasurableSpace G] {S : Subgroup G} :
Measurable ((↑) : G → G ⧸ S) :=
measurable_quotient_mk''
@[to_additive]
nonrec theorem QuotientGroup.measurable_from_quotient {G} [Group G] [MeasurableSpace G]
{S : Subgroup G} {f : G ⧸ S → α} : Measurable f ↔ Measurable (f ∘ ((↑) : G → G ⧸ S)) :=
measurable_from_quotient
end Quotient
section Subtype
instance Subtype.instMeasurableSpace {α} {p : α → Prop} [m : MeasurableSpace α] :
MeasurableSpace (Subtype p) :=
m.comap ((↑) : _ → α)
section
variable [MeasurableSpace α]
@[measurability]
theorem measurable_subtype_coe {p : α → Prop} : Measurable ((↑) : Subtype p → α) :=
MeasurableSpace.le_map_comap
instance Subtype.instMeasurableSingletonClass {p : α → Prop} [MeasurableSingletonClass α] :
MeasurableSingletonClass (Subtype p) where
measurableSet_singleton x :=
⟨{(x : α)}, measurableSet_singleton (x : α), by
rw [← image_singleton, preimage_image_eq _ Subtype.val_injective]⟩
end
variable {m : MeasurableSpace α} {mβ : MeasurableSpace β}
theorem MeasurableSet.of_subtype_image {s : Set α} {t : Set s}
(h : MeasurableSet (Subtype.val '' t)) : MeasurableSet t :=
⟨_, h, preimage_image_eq _ Subtype.val_injective⟩
theorem MeasurableSet.subtype_image {s : Set α} {t : Set s} (hs : MeasurableSet s) :
MeasurableSet t → MeasurableSet (((↑) : s → α) '' t) := by
rintro ⟨u, hu, rfl⟩
rw [Subtype.image_preimage_coe]
exact hs.inter hu
@[measurability]
theorem Measurable.subtype_coe {p : β → Prop} {f : α → Subtype p} (hf : Measurable f) :
Measurable fun a : α => (f a : β) :=
measurable_subtype_coe.comp hf
alias Measurable.subtype_val := Measurable.subtype_coe
@[measurability]
theorem Measurable.subtype_mk {p : β → Prop} {f : α → β} (hf : Measurable f) {h : ∀ x, p (f x)} :
Measurable fun x => (⟨f x, h x⟩ : Subtype p) := fun t ⟨s, hs⟩ =>
hs.2 ▸ by simp only [← preimage_comp, (· ∘ ·), Subtype.coe_mk, hf hs.1]
@[measurability]
protected theorem Measurable.rangeFactorization {f : α → β} (hf : Measurable f) :
Measurable (rangeFactorization f) :=
hf.subtype_mk
theorem Measurable.subtype_map {f : α → β} {p : α → Prop} {q : β → Prop} (hf : Measurable f)
(hpq : ∀ x, p x → q (f x)) : Measurable (Subtype.map f hpq) :=
(hf.comp measurable_subtype_coe).subtype_mk
theorem measurable_inclusion {s t : Set α} (h : s ⊆ t) : Measurable (inclusion h) :=
measurable_id.subtype_map h
theorem MeasurableSet.image_inclusion' {s t : Set α} (h : s ⊆ t) {u : Set s}
(hs : MeasurableSet (Subtype.val ⁻¹' s : Set t)) (hu : MeasurableSet u) :
MeasurableSet (inclusion h '' u) := by
rcases hu with ⟨u, hu, rfl⟩
convert (measurable_subtype_coe hu).inter hs
ext ⟨x, hx⟩
simpa [@and_comm _ (_ = x)] using and_comm
theorem MeasurableSet.image_inclusion {s t : Set α} (h : s ⊆ t) {u : Set s}
(hs : MeasurableSet s) (hu : MeasurableSet u) :
MeasurableSet (inclusion h '' u) :=
(measurable_subtype_coe hs).image_inclusion' h hu
theorem MeasurableSet.of_union_cover {s t u : Set α} (hs : MeasurableSet s) (ht : MeasurableSet t)
(h : univ ⊆ s ∪ t) (hsu : MeasurableSet (((↑) : s → α) ⁻¹' u))
(htu : MeasurableSet (((↑) : t → α) ⁻¹' u)) : MeasurableSet u := by
convert (hs.subtype_image hsu).union (ht.subtype_image htu)
simp [image_preimage_eq_inter_range, ← inter_union_distrib_left, univ_subset_iff.1 h]
theorem measurable_of_measurable_union_cover {f : α → β} (s t : Set α) (hs : MeasurableSet s)
(ht : MeasurableSet t) (h : univ ⊆ s ∪ t) (hc : Measurable fun a : s => f a)
(hd : Measurable fun a : t => f a) : Measurable f := fun _u hu =>
.of_union_cover hs ht h (hc hu) (hd hu)
theorem measurable_of_restrict_of_restrict_compl {f : α → β} {s : Set α} (hs : MeasurableSet s)
(h₁ : Measurable (s.restrict f)) (h₂ : Measurable (sᶜ.restrict f)) : Measurable f :=
measurable_of_measurable_union_cover s sᶜ hs hs.compl (union_compl_self s).ge h₁ h₂
theorem Measurable.dite [∀ x, Decidable (x ∈ s)] {f : s → β} (hf : Measurable f)
{g : (sᶜ : Set α) → β} (hg : Measurable g) (hs : MeasurableSet s) :
Measurable fun x => if hx : x ∈ s then f ⟨x, hx⟩ else g ⟨x, hx⟩ :=
measurable_of_restrict_of_restrict_compl hs (by simpa) (by simpa)
theorem measurable_of_measurable_on_compl_finite [MeasurableSingletonClass α] {f : α → β}
(s : Set α) (hs : s.Finite) (hf : Measurable (sᶜ.restrict f)) : Measurable f :=
have := hs.to_subtype
measurable_of_restrict_of_restrict_compl hs.measurableSet (measurable_of_finite _) hf
theorem measurable_of_measurable_on_compl_singleton [MeasurableSingletonClass α] {f : α → β} (a : α)
(hf : Measurable ({ x | x ≠ a }.restrict f)) : Measurable f :=
measurable_of_measurable_on_compl_finite {a} (finite_singleton a) hf
end Subtype
section Atoms
variable [MeasurableSpace β]
/-- The *measurable atom* of `x` is the intersection of all the measurable sets countaining `x`.
It is measurable when the space is countable (or more generally when the measurable space is
countably generated). -/
def measurableAtom (x : β) : Set β :=
⋂ (s : Set β) (_h's : x ∈ s) (_hs : MeasurableSet s), s
@[simp] lemma mem_measurableAtom_self (x : β) : x ∈ measurableAtom x := by
simp (config := {contextual := true}) [measurableAtom]
lemma mem_of_mem_measurableAtom {x y : β} (h : y ∈ measurableAtom x) {s : Set β}
(hs : MeasurableSet s) (hxs : x ∈ s) : y ∈ s := by
simp only [measurableAtom, mem_iInter] at h
exact h s hxs hs
lemma measurableAtom_subset {s : Set β} {x : β} (hs : MeasurableSet s) (hx : x ∈ s) :
measurableAtom x ⊆ s :=
iInter₂_subset_of_subset s hx fun ⦃a⦄ ↦ (by simp [hs])
@[simp] lemma measurableAtom_of_measurableSingletonClass [MeasurableSingletonClass β] (x : β) :
measurableAtom x = {x} :=
Subset.antisymm (measurableAtom_subset (measurableSet_singleton x) rfl) (by simp)
lemma MeasurableSet.measurableAtom_of_countable [Countable β] (x : β) :
MeasurableSet (measurableAtom x) := by
have : ∀ (y : β), y ∉ measurableAtom x → ∃ s, x ∈ s ∧ MeasurableSet s ∧ y ∉ s :=
fun y hy ↦ by simpa [measurableAtom] using hy
choose! s hs using this
have : measurableAtom x = ⋂ (y ∈ (measurableAtom x)ᶜ), s y := by
apply Subset.antisymm
· intro z hz
simp only [mem_iInter, mem_compl_iff]
intro i hi
show z ∈ s i
exact mem_of_mem_measurableAtom hz (hs i hi).2.1 (hs i hi).1
· apply compl_subset_compl.1
intro z hz
simp only [compl_iInter, mem_iUnion, mem_compl_iff, exists_prop]
exact ⟨z, hz, (hs z hz).2.2⟩
rw [this]
exact MeasurableSet.biInter (to_countable (measurableAtom x)ᶜ) (fun i hi ↦ (hs i hi).2.1)
end Atoms
section Prod
/-- A `MeasurableSpace` structure on the product of two measurable spaces. -/
def MeasurableSpace.prod {α β} (m₁ : MeasurableSpace α) (m₂ : MeasurableSpace β) :
MeasurableSpace (α × β) :=
m₁.comap Prod.fst ⊔ m₂.comap Prod.snd
instance Prod.instMeasurableSpace {α β} [m₁ : MeasurableSpace α] [m₂ : MeasurableSpace β] :
MeasurableSpace (α × β) :=
m₁.prod m₂
@[measurability]
theorem measurable_fst {_ : MeasurableSpace α} {_ : MeasurableSpace β} :
Measurable (Prod.fst : α × β → α) :=
Measurable.of_comap_le le_sup_left
@[measurability]
theorem measurable_snd {_ : MeasurableSpace α} {_ : MeasurableSpace β} :
Measurable (Prod.snd : α × β → β) :=
Measurable.of_comap_le le_sup_right
variable {m : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ}
@[fun_prop]
theorem Measurable.fst {f : α → β × γ} (hf : Measurable f) : Measurable fun a : α => (f a).1 :=
measurable_fst.comp hf
@[fun_prop]
theorem Measurable.snd {f : α → β × γ} (hf : Measurable f) : Measurable fun a : α => (f a).2 :=
measurable_snd.comp hf
@[measurability]
theorem Measurable.prod {f : α → β × γ} (hf₁ : Measurable fun a => (f a).1)
(hf₂ : Measurable fun a => (f a).2) : Measurable f :=
Measurable.of_le_map <|
sup_le
(by
rw [MeasurableSpace.comap_le_iff_le_map, MeasurableSpace.map_comp]
exact hf₁)
(by
rw [MeasurableSpace.comap_le_iff_le_map, MeasurableSpace.map_comp]
exact hf₂)
@[fun_prop]
theorem Measurable.prod_mk {β γ} {_ : MeasurableSpace β} {_ : MeasurableSpace γ} {f : α → β}
{g : α → γ} (hf : Measurable f) (hg : Measurable g) : Measurable fun a : α => (f a, g a) :=
Measurable.prod hf hg
theorem Measurable.prod_map [MeasurableSpace δ] {f : α → β} {g : γ → δ} (hf : Measurable f)
(hg : Measurable g) : Measurable (Prod.map f g) :=
(hf.comp measurable_fst).prod_mk (hg.comp measurable_snd)
theorem measurable_prod_mk_left {x : α} : Measurable (@Prod.mk _ β x) :=
measurable_const.prod_mk measurable_id
theorem measurable_prod_mk_right {y : β} : Measurable fun x : α => (x, y) :=
measurable_id.prod_mk measurable_const
theorem Measurable.of_uncurry_left {f : α → β → γ} (hf : Measurable (uncurry f)) {x : α} :
Measurable (f x) :=
hf.comp measurable_prod_mk_left
theorem Measurable.of_uncurry_right {f : α → β → γ} (hf : Measurable (uncurry f)) {y : β} :
Measurable fun x => f x y :=
hf.comp measurable_prod_mk_right
theorem measurable_prod {f : α → β × γ} :
Measurable f ↔ (Measurable fun a => (f a).1) ∧ Measurable fun a => (f a).2 :=
⟨fun hf => ⟨measurable_fst.comp hf, measurable_snd.comp hf⟩, fun h => Measurable.prod h.1 h.2⟩
@[fun_prop, measurability]
theorem measurable_swap : Measurable (Prod.swap : α × β → β × α) :=
Measurable.prod measurable_snd measurable_fst
theorem measurable_swap_iff {_ : MeasurableSpace γ} {f : α × β → γ} :
Measurable (f ∘ Prod.swap) ↔ Measurable f :=
⟨fun hf => hf.comp measurable_swap, fun hf => hf.comp measurable_swap⟩
@[measurability]
protected theorem MeasurableSet.prod {s : Set α} {t : Set β} (hs : MeasurableSet s)
(ht : MeasurableSet t) : MeasurableSet (s ×ˢ t) :=
MeasurableSet.inter (measurable_fst hs) (measurable_snd ht)
theorem measurableSet_prod_of_nonempty {s : Set α} {t : Set β} (h : (s ×ˢ t).Nonempty) :
MeasurableSet (s ×ˢ t) ↔ MeasurableSet s ∧ MeasurableSet t := by
rcases h with ⟨⟨x, y⟩, hx, hy⟩
refine ⟨fun hst => ?_, fun h => h.1.prod h.2⟩
have : MeasurableSet ((fun x => (x, y)) ⁻¹' s ×ˢ t) := measurable_prod_mk_right hst
have : MeasurableSet (Prod.mk x ⁻¹' s ×ˢ t) := measurable_prod_mk_left hst
simp_all
theorem measurableSet_prod {s : Set α} {t : Set β} :
MeasurableSet (s ×ˢ t) ↔ MeasurableSet s ∧ MeasurableSet t ∨ s = ∅ ∨ t = ∅ := by
rcases (s ×ˢ t).eq_empty_or_nonempty with h | h
· simp [h, prod_eq_empty_iff.mp h]
· simp [← not_nonempty_iff_eq_empty, prod_nonempty_iff.mp h, measurableSet_prod_of_nonempty h]
theorem measurableSet_swap_iff {s : Set (α × β)} :
MeasurableSet (Prod.swap ⁻¹' s) ↔ MeasurableSet s :=
⟨fun hs => measurable_swap hs, fun hs => measurable_swap hs⟩
instance Prod.instMeasurableSingletonClass
[MeasurableSingletonClass α] [MeasurableSingletonClass β] :
MeasurableSingletonClass (α × β) :=
⟨fun ⟨a, b⟩ => @singleton_prod_singleton _ _ a b ▸ .prod (.singleton a) (.singleton b)⟩
theorem measurable_from_prod_countable' [Countable β]
{_ : MeasurableSpace γ} {f : α × β → γ} (hf : ∀ y, Measurable fun x => f (x, y))
(h'f : ∀ y y' x, y' ∈ measurableAtom y → f (x, y') = f (x, y)) :
Measurable f := fun s hs => by
have : f ⁻¹' s = ⋃ y, ((fun x => f (x, y)) ⁻¹' s) ×ˢ (measurableAtom y : Set β) := by
ext1 ⟨x, y⟩
simp only [mem_preimage, mem_iUnion, mem_prod]
refine ⟨fun h ↦ ⟨y, h, mem_measurableAtom_self y⟩, ?_⟩
rintro ⟨y', hy's, hy'⟩
rwa [h'f y' y x hy']
rw [this]
exact .iUnion (fun y ↦ (hf y hs).prod (.measurableAtom_of_countable y))
theorem measurable_from_prod_countable [Countable β] [MeasurableSingletonClass β]
{_ : MeasurableSpace γ} {f : α × β → γ} (hf : ∀ y, Measurable fun x => f (x, y)) :
Measurable f :=
measurable_from_prod_countable' hf (by simp (config := {contextual := true}))
/-- A piecewise function on countably many pieces is measurable if all the data is measurable. -/
@[measurability]
theorem Measurable.find {_ : MeasurableSpace α} {f : ℕ → α → β} {p : ℕ → α → Prop}
[∀ n, DecidablePred (p n)] (hf : ∀ n, Measurable (f n)) (hp : ∀ n, MeasurableSet { x | p n x })
(h : ∀ x, ∃ n, p n x) : Measurable fun x => f (Nat.find (h x)) x :=
have : Measurable fun p : α × ℕ => f p.2 p.1 := measurable_from_prod_countable fun n => hf n
this.comp (Measurable.prod_mk measurable_id (measurable_find h hp))
/-- Let `t i` be a countable covering of a set `T` by measurable sets. Let `f i : t i → β` be a
family of functions that agree on the intersections `t i ∩ t j`. Then the function
`Set.iUnionLift t f _ _ : T → β`, defined as `f i ⟨x, hx⟩` for `hx : x ∈ t i`, is measurable. -/
theorem measurable_iUnionLift [Countable ι] {t : ι → Set α} {f : ∀ i, t i → β}
(htf : ∀ (i j) (x : α) (hxi : x ∈ t i) (hxj : x ∈ t j), f i ⟨x, hxi⟩ = f j ⟨x, hxj⟩)
{T : Set α} (hT : T ⊆ ⋃ i, t i) (htm : ∀ i, MeasurableSet (t i)) (hfm : ∀ i, Measurable (f i)) :
Measurable (iUnionLift t f htf T hT) := fun s hs => by
rw [preimage_iUnionLift]
exact .preimage (.iUnion fun i => .image_inclusion _ (htm _) (hfm i hs)) (measurable_inclusion _)
/-- Let `t i` be a countable covering of `α` by measurable sets. Let `f i : t i → β` be a family of
functions that agree on the intersections `t i ∩ t j`. Then the function `Set.liftCover t f _ _`,
defined as `f i ⟨x, hx⟩` for `hx : x ∈ t i`, is measurable. -/
theorem measurable_liftCover [Countable ι] (t : ι → Set α) (htm : ∀ i, MeasurableSet (t i))
(f : ∀ i, t i → β) (hfm : ∀ i, Measurable (f i))
(hf : ∀ (i j) (x : α) (hxi : x ∈ t i) (hxj : x ∈ t j), f i ⟨x, hxi⟩ = f j ⟨x, hxj⟩)
(htU : ⋃ i, t i = univ) :
Measurable (liftCover t f hf htU) := fun s hs => by
rw [preimage_liftCover]
exact .iUnion fun i => .subtype_image (htm i) <| hfm i hs
/-- Let `t i` be a nonempty countable family of measurable sets in `α`. Let `g i : α → β` be a
family of measurable functions such that `g i` agrees with `g j` on `t i ∩ t j`. Then there exists
a measurable function `f : α → β` that agrees with each `g i` on `t i`.
We only need the assumption `[Nonempty ι]` to prove `[Nonempty (α → β)]`. -/
theorem exists_measurable_piecewise {ι} [Countable ι] [Nonempty ι] (t : ι → Set α)
(t_meas : ∀ n, MeasurableSet (t n)) (g : ι → α → β) (hg : ∀ n, Measurable (g n))
(ht : Pairwise fun i j => EqOn (g i) (g j) (t i ∩ t j)) :
∃ f : α → β, Measurable f ∧ ∀ n, EqOn f (g n) (t n) := by
inhabit ι
set g' : (i : ι) → t i → β := fun i => g i ∘ (↑)
-- see #2184
have ht' : ∀ (i j) (x : α) (hxi : x ∈ t i) (hxj : x ∈ t j), g' i ⟨x, hxi⟩ = g' j ⟨x, hxj⟩ := by
intro i j x hxi hxj
rcases eq_or_ne i j with rfl | hij
· rfl
· exact ht hij ⟨hxi, hxj⟩
set f : (⋃ i, t i) → β := iUnionLift t g' ht' _ Subset.rfl
have hfm : Measurable f := measurable_iUnionLift _ _ t_meas
(fun i => (hg i).comp measurable_subtype_coe)
classical
refine ⟨fun x => if hx : x ∈ ⋃ i, t i then f ⟨x, hx⟩ else g default x,
hfm.dite ((hg default).comp measurable_subtype_coe) (.iUnion t_meas), fun i x hx => ?_⟩
simp only [dif_pos (mem_iUnion.2 ⟨i, hx⟩)]
exact iUnionLift_of_mem ⟨x, mem_iUnion.2 ⟨i, hx⟩⟩ hx
end Prod
section Pi
variable {π : δ → Type*} [MeasurableSpace α]
instance MeasurableSpace.pi [m : ∀ a, MeasurableSpace (π a)] : MeasurableSpace (∀ a, π a) :=
⨆ a, (m a).comap fun b => b a
variable [∀ a, MeasurableSpace (π a)] [MeasurableSpace γ]
theorem measurable_pi_iff {g : α → ∀ a, π a} : Measurable g ↔ ∀ a, Measurable fun x => g x a := by
simp_rw [measurable_iff_comap_le, MeasurableSpace.pi, MeasurableSpace.comap_iSup,
MeasurableSpace.comap_comp, Function.comp, iSup_le_iff]
@[fun_prop, aesop safe 100 apply (rule_sets := [Measurable])]
theorem measurable_pi_apply (a : δ) : Measurable fun f : ∀ a, π a => f a :=
measurable_pi_iff.1 measurable_id a
@[aesop safe 100 apply (rule_sets := [Measurable])]
theorem Measurable.eval {a : δ} {g : α → ∀ a, π a} (hg : Measurable g) :
Measurable fun x => g x a :=
(measurable_pi_apply a).comp hg
@[fun_prop, aesop safe 100 apply (rule_sets := [Measurable])]
theorem measurable_pi_lambda (f : α → ∀ a, π a) (hf : ∀ a, Measurable fun c => f c a) :
Measurable f :=
measurable_pi_iff.mpr hf
/-- The function `(f, x) ↦ update f a x : (Π a, π a) × π a → Π a, π a` is measurable. -/
theorem measurable_update' {a : δ} [DecidableEq δ] :
Measurable (fun p : (∀ i, π i) × π a ↦ update p.1 a p.2) := by
rw [measurable_pi_iff]
intro j
dsimp [update]
split_ifs with h
· subst h
dsimp
exact measurable_snd
· exact measurable_pi_iff.1 measurable_fst _
theorem measurable_uniqueElim [Unique δ] :
Measurable (uniqueElim : π (default : δ) → ∀ i, π i) := by
simp_rw [measurable_pi_iff, Unique.forall_iff, uniqueElim_default]; exact measurable_id
theorem measurable_updateFinset [DecidableEq δ] {s : Finset δ} {x : ∀ i, π i} :
Measurable (updateFinset x s) := by
simp (config := { unfoldPartialApp := true }) only [updateFinset, measurable_pi_iff]
intro i
by_cases h : i ∈ s <;> simp [h, measurable_pi_apply]
/-- The function `update f a : π a → Π a, π a` is always measurable.
This doesn't require `f` to be measurable.
This should not be confused with the statement that `update f a x` is measurable. -/
@[measurability]
theorem measurable_update (f : ∀ a : δ, π a) {a : δ} [DecidableEq δ] : Measurable (update f a) :=
measurable_update'.comp measurable_prod_mk_left
theorem measurable_update_left {a : δ} [DecidableEq δ] {x : π a} :
Measurable (update · a x) :=
measurable_update'.comp measurable_prod_mk_right
variable (π) in
theorem measurable_eq_mp {i i' : δ} (h : i = i') : Measurable (congr_arg π h).mp := by
cases h
exact measurable_id
variable (π) in
theorem Measurable.eq_mp {β} [MeasurableSpace β] {i i' : δ} (h : i = i') {f : β → π i}
(hf : Measurable f) : Measurable fun x => (congr_arg π h).mp (f x) :=
(measurable_eq_mp π h).comp hf
theorem measurable_piCongrLeft (f : δ' ≃ δ) : Measurable (piCongrLeft π f) := by
rw [measurable_pi_iff]
intro i
simp_rw [piCongrLeft_apply_eq_cast]
exact Measurable.eq_mp π (f.apply_symm_apply i) <| measurable_pi_apply <| f.symm i
/- Even though we cannot use projection notation, we still keep a dot to be consistent with similar
lemmas, like `MeasurableSet.prod`. -/
@[measurability]
protected theorem MeasurableSet.pi {s : Set δ} {t : ∀ i : δ, Set (π i)} (hs : s.Countable)
(ht : ∀ i ∈ s, MeasurableSet (t i)) : MeasurableSet (s.pi t) := by
rw [pi_def]
exact MeasurableSet.biInter hs fun i hi => measurable_pi_apply _ (ht i hi)
protected theorem MeasurableSet.univ_pi [Countable δ] {t : ∀ i : δ, Set (π i)}
(ht : ∀ i, MeasurableSet (t i)) : MeasurableSet (pi univ t) :=
MeasurableSet.pi (to_countable _) fun i _ => ht i
theorem measurableSet_pi_of_nonempty {s : Set δ} {t : ∀ i, Set (π i)} (hs : s.Countable)
(h : (pi s t).Nonempty) : MeasurableSet (pi s t) ↔ ∀ i ∈ s, MeasurableSet (t i) := by
classical
rcases h with ⟨f, hf⟩
refine ⟨fun hst i hi => ?_, MeasurableSet.pi hs⟩
convert measurable_update f (a := i) hst
rw [update_preimage_pi hi]
exact fun j hj _ => hf j hj
theorem measurableSet_pi {s : Set δ} {t : ∀ i, Set (π i)} (hs : s.Countable) :
MeasurableSet (pi s t) ↔ (∀ i ∈ s, MeasurableSet (t i)) ∨ pi s t = ∅ := by
rcases (pi s t).eq_empty_or_nonempty with h | h
· simp [h]
· simp [measurableSet_pi_of_nonempty hs, h, ← not_nonempty_iff_eq_empty]
instance Pi.instMeasurableSingletonClass [Countable δ] [∀ a, MeasurableSingletonClass (π a)] :
MeasurableSingletonClass (∀ a, π a) :=
⟨fun f => univ_pi_singleton f ▸ MeasurableSet.univ_pi fun t => measurableSet_singleton (f t)⟩
variable (π)
@[measurability]
theorem measurable_piEquivPiSubtypeProd_symm (p : δ → Prop) [DecidablePred p] :
Measurable (Equiv.piEquivPiSubtypeProd p π).symm := by
refine measurable_pi_iff.2 fun j => ?_
by_cases hj : p j
· simp only [hj, dif_pos, Equiv.piEquivPiSubtypeProd_symm_apply]
have : Measurable fun (f : ∀ i : { x // p x }, π i.1) => f ⟨j, hj⟩ :=
measurable_pi_apply (π := fun i : {x // p x} => π i.1) ⟨j, hj⟩
exact Measurable.comp this measurable_fst
· simp only [hj, Equiv.piEquivPiSubtypeProd_symm_apply, dif_neg, not_false_iff]
have : Measurable fun (f : ∀ i : { x // ¬p x }, π i.1) => f ⟨j, hj⟩ :=
measurable_pi_apply (π := fun i : {x // ¬p x} => π i.1) ⟨j, hj⟩
exact Measurable.comp this measurable_snd
@[measurability]
theorem measurable_piEquivPiSubtypeProd (p : δ → Prop) [DecidablePred p] :
Measurable (Equiv.piEquivPiSubtypeProd p π) :=
(measurable_pi_iff.2 fun _ => measurable_pi_apply _).prod_mk
(measurable_pi_iff.2 fun _ => measurable_pi_apply _)
end Pi
instance TProd.instMeasurableSpace (π : δ → Type*) [∀ x, MeasurableSpace (π x)] :
∀ l : List δ, MeasurableSpace (List.TProd π l)
| [] => PUnit.instMeasurableSpace
| _::is => @Prod.instMeasurableSpace _ _ _ (TProd.instMeasurableSpace π is)
section TProd
open List
variable {π : δ → Type*} [∀ x, MeasurableSpace (π x)]
theorem measurable_tProd_mk (l : List δ) : Measurable (@TProd.mk δ π l) := by
induction' l with i l ih
· exact measurable_const
· exact (measurable_pi_apply i).prod_mk ih
theorem measurable_tProd_elim [DecidableEq δ] :
∀ {l : List δ} {i : δ} (hi : i ∈ l), Measurable fun v : TProd π l => v.elim hi
| i::is, j, hj => by
by_cases hji : j = i
· subst hji
simpa using measurable_fst
· simp only [TProd.elim_of_ne _ hji]
rw [mem_cons] at hj
exact (measurable_tProd_elim (hj.resolve_left hji)).comp measurable_snd
theorem measurable_tProd_elim' [DecidableEq δ] {l : List δ} (h : ∀ i, i ∈ l) :
Measurable (TProd.elim' h : TProd π l → ∀ i, π i) :=
measurable_pi_lambda _ fun i => measurable_tProd_elim (h i)
theorem MeasurableSet.tProd (l : List δ) {s : ∀ i, Set (π i)} (hs : ∀ i, MeasurableSet (s i)) :
MeasurableSet (Set.tprod l s) := by
induction' l with i l ih
· exact MeasurableSet.univ
· exact (hs i).prod ih
end TProd
instance Sum.instMeasurableSpace {α β} [m₁ : MeasurableSpace α] [m₂ : MeasurableSpace β] :
MeasurableSpace (α ⊕ β) :=
m₁.map Sum.inl ⊓ m₂.map Sum.inr
section Sum
@[measurability]
theorem measurable_inl [MeasurableSpace α] [MeasurableSpace β] : Measurable (@Sum.inl α β) :=
Measurable.of_le_map inf_le_left
@[measurability]
theorem measurable_inr [MeasurableSpace α] [MeasurableSpace β] : Measurable (@Sum.inr α β) :=
Measurable.of_le_map inf_le_right
variable {m : MeasurableSpace α} {mβ : MeasurableSpace β}
theorem measurableSet_sum_iff {s : Set (α ⊕ β)} :
MeasurableSet s ↔ MeasurableSet (Sum.inl ⁻¹' s) ∧ MeasurableSet (Sum.inr ⁻¹' s) :=
Iff.rfl
theorem measurable_sum {_ : MeasurableSpace γ} {f : α ⊕ β → γ} (hl : Measurable (f ∘ Sum.inl))
(hr : Measurable (f ∘ Sum.inr)) : Measurable f :=
Measurable.of_comap_le <|
le_inf (MeasurableSpace.comap_le_iff_le_map.2 <| hl)
(MeasurableSpace.comap_le_iff_le_map.2 <| hr)
@[measurability]
theorem Measurable.sumElim {_ : MeasurableSpace γ} {f : α → γ} {g : β → γ} (hf : Measurable f)
(hg : Measurable g) : Measurable (Sum.elim f g) :=
measurable_sum hf hg
theorem Measurable.sumMap {_ : MeasurableSpace γ} {_ : MeasurableSpace δ} {f : α → β} {g : γ → δ}
(hf : Measurable f) (hg : Measurable g) : Measurable (Sum.map f g) :=
(measurable_inl.comp hf).sumElim (measurable_inr.comp hg)
@[simp] theorem measurableSet_inl_image {s : Set α} :
MeasurableSet (Sum.inl '' s : Set (α ⊕ β)) ↔ MeasurableSet s := by
simp [measurableSet_sum_iff, Sum.inl_injective.preimage_image]
alias ⟨_, MeasurableSet.inl_image⟩ := measurableSet_inl_image
@[simp] theorem measurableSet_inr_image {s : Set β} :
MeasurableSet (Sum.inr '' s : Set (α ⊕ β)) ↔ MeasurableSet s := by
simp [measurableSet_sum_iff, Sum.inr_injective.preimage_image]
alias ⟨_, MeasurableSet.inr_image⟩ := measurableSet_inr_image
theorem measurableSet_range_inl [MeasurableSpace α] :
MeasurableSet (range Sum.inl : Set (α ⊕ β)) := by
rw [← image_univ]
exact MeasurableSet.univ.inl_image
theorem measurableSet_range_inr [MeasurableSpace α] :
MeasurableSet (range Sum.inr : Set (α ⊕ β)) := by
rw [← image_univ]
exact MeasurableSet.univ.inr_image
end Sum
instance Sigma.instMeasurableSpace {α} {β : α → Type*} [m : ∀ a, MeasurableSpace (β a)] :
MeasurableSpace (Sigma β) :=
⨅ a, (m a).map (Sigma.mk a)
section prop
variable [MeasurableSpace α] {p q : α → Prop}
@[simp] theorem measurableSet_setOf : MeasurableSet {a | p a} ↔ Measurable p :=
⟨fun h ↦ measurable_to_prop <| by simpa only [preimage_singleton_true], fun h => by
simpa using h (measurableSet_singleton True)⟩
@[simp] theorem measurable_mem : Measurable (· ∈ s) ↔ MeasurableSet s := measurableSet_setOf.symm
alias ⟨_, Measurable.setOf⟩ := measurableSet_setOf
alias ⟨_, MeasurableSet.mem⟩ := measurable_mem
lemma Measurable.not (hp : Measurable p) : Measurable (¬ p ·) :=
measurableSet_setOf.1 hp.setOf.compl
lemma Measurable.and (hp : Measurable p) (hq : Measurable q) : Measurable fun a ↦ p a ∧ q a :=
measurableSet_setOf.1 <| hp.setOf.inter hq.setOf
lemma Measurable.or (hp : Measurable p) (hq : Measurable q) : Measurable fun a ↦ p a ∨ q a :=
measurableSet_setOf.1 <| hp.setOf.union hq.setOf
lemma Measurable.imp (hp : Measurable p) (hq : Measurable q) : Measurable fun a ↦ p a → q a :=
measurableSet_setOf.1 <| hp.setOf.himp hq.setOf
lemma Measurable.iff (hp : Measurable p) (hq : Measurable q) : Measurable fun a ↦ p a ↔ q a :=
measurableSet_setOf.1 <| by simp_rw [iff_iff_implies_and_implies]; exact hq.setOf.bihimp hp.setOf
lemma Measurable.forall [Countable ι] {p : ι → α → Prop} (hp : ∀ i, Measurable (p i)) :
Measurable fun a ↦ ∀ i, p i a :=
measurableSet_setOf.1 <| by rw [setOf_forall]; exact MeasurableSet.iInter fun i ↦ (hp i).setOf
lemma Measurable.exists [Countable ι] {p : ι → α → Prop} (hp : ∀ i, Measurable (p i)) :
Measurable fun a ↦ ∃ i, p i a :=
measurableSet_setOf.1 <| by rw [setOf_exists]; exact MeasurableSet.iUnion fun i ↦ (hp i).setOf
end prop
section Set
variable [MeasurableSpace β] {g : β → Set α}
/-- This instance is useful when talking about Bernoulli sequences of random variables or binomial
random graphs. -/
instance Set.instMeasurableSpace : MeasurableSpace (Set α) := by unfold Set; infer_instance
instance Set.instMeasurableSingletonClass [Countable α] : MeasurableSingletonClass (Set α) := by
unfold Set; infer_instance
lemma measurable_set_iff : Measurable g ↔ ∀ a, Measurable fun x ↦ a ∈ g x := measurable_pi_iff
@[aesop safe 100 apply (rule_sets := [Measurable])]
lemma measurable_set_mem (a : α) : Measurable fun s : Set α ↦ a ∈ s := measurable_pi_apply _
@[aesop safe 100 apply (rule_sets := [Measurable])]
lemma measurable_set_not_mem (a : α) : Measurable fun s : Set α ↦ a ∉ s :=
(measurable_discrete Not).comp <| measurable_set_mem a
@[aesop safe 100 apply (rule_sets := [Measurable])]
lemma measurableSet_mem (a : α) : MeasurableSet {s : Set α | a ∈ s} :=
measurableSet_setOf.2 <| measurable_set_mem _
@[aesop safe 100 apply (rule_sets := [Measurable])]
lemma measurableSet_not_mem (a : α) : MeasurableSet {s : Set α | a ∉ s} :=
measurableSet_setOf.2 <| measurable_set_not_mem _
lemma measurable_compl : Measurable ((·ᶜ) : Set α → Set α) :=
measurable_set_iff.2 fun _ ↦ measurable_set_not_mem _
end Set
end Constructions
namespace MeasurableSpace
/-- The sigma-algebra generated by a single set `s` is `{∅, s, sᶜ, univ}`. -/
@[simp] theorem generateFrom_singleton (s : Set α) :
generateFrom {s} = MeasurableSpace.comap (· ∈ s) ⊤ := by
classical
letI : MeasurableSpace α := generateFrom {s}
refine le_antisymm (generateFrom_le fun t ht => ⟨{True}, trivial, by simp [ht.symm]⟩) ?_
rintro _ ⟨u, -, rfl⟩
exact (show MeasurableSet s from GenerateMeasurable.basic _ <| mem_singleton s).mem trivial
end MeasurableSpace
namespace Filter
variable [MeasurableSpace α]
/-- A filter `f` is measurably generates if each `s ∈ f` includes a measurable `t ∈ f`. -/
class IsMeasurablyGenerated (f : Filter α) : Prop where
exists_measurable_subset : ∀ ⦃s⦄, s ∈ f → ∃ t ∈ f, MeasurableSet t ∧ t ⊆ s
instance isMeasurablyGenerated_bot : IsMeasurablyGenerated (⊥ : Filter α) :=
⟨fun _ _ => ⟨∅, mem_bot, MeasurableSet.empty, empty_subset _⟩⟩
instance isMeasurablyGenerated_top : IsMeasurablyGenerated (⊤ : Filter α) :=
⟨fun _s hs => ⟨univ, univ_mem, MeasurableSet.univ, fun x _ => hs x⟩⟩
theorem Eventually.exists_measurable_mem {f : Filter α} [IsMeasurablyGenerated f] {p : α → Prop}
(h : ∀ᶠ x in f, p x) : ∃ s ∈ f, MeasurableSet s ∧ ∀ x ∈ s, p x :=
IsMeasurablyGenerated.exists_measurable_subset h
theorem Eventually.exists_measurable_mem_of_smallSets {f : Filter α} [IsMeasurablyGenerated f]
{p : Set α → Prop} (h : ∀ᶠ s in f.smallSets, p s) : ∃ s ∈ f, MeasurableSet s ∧ p s :=
let ⟨_s, hsf, hs⟩ := eventually_smallSets.1 h
let ⟨t, htf, htm, hts⟩ := IsMeasurablyGenerated.exists_measurable_subset hsf
⟨t, htf, htm, hs t hts⟩
instance inf_isMeasurablyGenerated (f g : Filter α) [IsMeasurablyGenerated f]
[IsMeasurablyGenerated g] : IsMeasurablyGenerated (f ⊓ g) := by
constructor
rintro t ⟨sf, hsf, sg, hsg, rfl⟩
rcases IsMeasurablyGenerated.exists_measurable_subset hsf with ⟨s'f, hs'f, hmf, hs'sf⟩
rcases IsMeasurablyGenerated.exists_measurable_subset hsg with ⟨s'g, hs'g, hmg, hs'sg⟩
refine ⟨s'f ∩ s'g, inter_mem_inf hs'f hs'g, hmf.inter hmg, ?_⟩
exact inter_subset_inter hs'sf hs'sg
theorem principal_isMeasurablyGenerated_iff {s : Set α} :
IsMeasurablyGenerated (𝓟 s) ↔ MeasurableSet s := by
refine ⟨?_, fun hs => ⟨fun t ht => ⟨s, mem_principal_self s, hs, ht⟩⟩⟩
rintro ⟨hs⟩
rcases hs (mem_principal_self s) with ⟨t, ht, htm, hts⟩
have : t = s := hts.antisymm ht
rwa [← this]
alias ⟨_, _root_.MeasurableSet.principal_isMeasurablyGenerated⟩ :=
principal_isMeasurablyGenerated_iff
instance iInf_isMeasurablyGenerated {f : ι → Filter α} [∀ i, IsMeasurablyGenerated (f i)] :
IsMeasurablyGenerated (⨅ i, f i) := by
refine ⟨fun s hs => ?_⟩
rw [← Equiv.plift.surjective.iInf_comp, mem_iInf] at hs
rcases hs with ⟨t, ht, ⟨V, hVf, rfl⟩⟩
choose U hUf hU using fun i => IsMeasurablyGenerated.exists_measurable_subset (hVf i)
refine ⟨⋂ i : t, U i, ?_, ?_, ?_⟩
· rw [← Equiv.plift.surjective.iInf_comp, mem_iInf]
exact ⟨t, ht, U, hUf, rfl⟩
· haveI := ht.countable.toEncodable.countable
exact MeasurableSet.iInter fun i => (hU i).1
· exact iInter_mono fun i => (hU i).2
end Filter
/-- The set of points for which a sequence of measurable functions converges to a given value
is measurable. -/
@[measurability]
lemma measurableSet_tendsto {_ : MeasurableSpace β} [MeasurableSpace γ]
[Countable δ] {l : Filter δ} [l.IsCountablyGenerated]
(l' : Filter γ) [l'.IsCountablyGenerated] [hl' : l'.IsMeasurablyGenerated]
{f : δ → β → γ} (hf : ∀ i, Measurable (f i)) :
MeasurableSet { x | Tendsto (fun n ↦ f n x) l l' } := by
rcases l.exists_antitone_basis with ⟨u, hu⟩
rcases (Filter.hasBasis_self.mpr hl'.exists_measurable_subset).exists_antitone_subbasis with
⟨v, v_meas, hv⟩
simp only [hu.tendsto_iff hv.toHasBasis, true_imp_iff, true_and, setOf_forall, setOf_exists]
exact .iInter fun n ↦ .iUnion fun _ ↦ .biInter (to_countable _) fun i _ ↦
(v_meas n).2.preimage (hf i)
/-- We say that a collection of sets is countably spanning if a countable subset spans the
whole type. This is a useful condition in various parts of measure theory. For example, it is
a needed condition to show that the product of two collections generate the product sigma algebra,
see `generateFrom_prod_eq`. -/
def IsCountablySpanning (C : Set (Set α)) : Prop :=
∃ s : ℕ → Set α, (∀ n, s n ∈ C) ∧ ⋃ n, s n = univ
theorem isCountablySpanning_measurableSet [MeasurableSpace α] :
IsCountablySpanning { s : Set α | MeasurableSet s } :=
⟨fun _ => univ, fun _ => MeasurableSet.univ, iUnion_const _⟩
namespace MeasurableSet
/-!
### Typeclasses on `Subtype MeasurableSet`
-/
variable [MeasurableSpace α]
instance Subtype.instMembership : Membership α (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun a s => a ∈ (s : Set α)⟩
@[simp]
theorem mem_coe (a : α) (s : Subtype (MeasurableSet : Set α → Prop)) : a ∈ (s : Set α) ↔ a ∈ s :=
Iff.rfl
instance Subtype.instEmptyCollection : EmptyCollection (Subtype (MeasurableSet : Set α → Prop)) :=
⟨⟨∅, MeasurableSet.empty⟩⟩
@[simp]
theorem coe_empty : ↑(∅ : Subtype (MeasurableSet : Set α → Prop)) = (∅ : Set α) :=
rfl
instance Subtype.instInsert [MeasurableSingletonClass α] :
Insert α (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun a s => ⟨insert a (s : Set α), s.prop.insert a⟩⟩
@[simp]
theorem coe_insert [MeasurableSingletonClass α] (a : α)
(s : Subtype (MeasurableSet : Set α → Prop)) :
↑(Insert.insert a s) = (Insert.insert a s : Set α) :=
rfl
instance Subtype.instSingleton [MeasurableSingletonClass α] :
Singleton α (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun a => ⟨{a}, .singleton _⟩⟩
@[simp] theorem coe_singleton [MeasurableSingletonClass α] (a : α) :
↑({a} : Subtype (MeasurableSet : Set α → Prop)) = ({a} : Set α) :=
rfl
instance Subtype.instLawfulSingleton [MeasurableSingletonClass α] :
LawfulSingleton α (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun _ => Subtype.eq <| insert_emptyc_eq _⟩
instance Subtype.instHasCompl : HasCompl (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun x => ⟨xᶜ, x.prop.compl⟩⟩
@[simp]
theorem coe_compl (s : Subtype (MeasurableSet : Set α → Prop)) : ↑sᶜ = (sᶜ : Set α) :=
rfl
instance Subtype.instUnion : Union (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun x y => ⟨(x : Set α) ∪ y, x.prop.union y.prop⟩⟩
@[simp]
theorem coe_union (s t : Subtype (MeasurableSet : Set α → Prop)) : ↑(s ∪ t) = (s ∪ t : Set α) :=
rfl
instance Subtype.instSup : Sup (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun x y => x ∪ y⟩
@[simp]
protected theorem sup_eq_union (s t : {s : Set α // MeasurableSet s}) : s ⊔ t = s ∪ t := rfl
instance Subtype.instInter : Inter (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun x y => ⟨x ∩ y, x.prop.inter y.prop⟩⟩
@[simp]
theorem coe_inter (s t : Subtype (MeasurableSet : Set α → Prop)) : ↑(s ∩ t) = (s ∩ t : Set α) :=
rfl
instance Subtype.instInf : Inf (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun x y => x ∩ y⟩
@[simp]
protected theorem inf_eq_inter (s t : {s : Set α // MeasurableSet s}) : s ⊓ t = s ∩ t := rfl
instance Subtype.instSDiff : SDiff (Subtype (MeasurableSet : Set α → Prop)) :=
⟨fun x y => ⟨x \ y, x.prop.diff y.prop⟩⟩
-- TODO: Why does it complain that `x ⇨ y` is noncomputable?
noncomputable instance Subtype.instHImp : HImp (Subtype (MeasurableSet : Set α → Prop)) where
himp x y := ⟨x ⇨ y, x.prop.himp y.prop⟩
@[simp]
theorem coe_sdiff (s t : Subtype (MeasurableSet : Set α → Prop)) : ↑(s \ t) = (s : Set α) \ t :=
rfl
@[simp]
lemma coe_himp (s t : Subtype (MeasurableSet : Set α → Prop)) : ↑(s ⇨ t) = (s ⇨ t : Set α) := rfl
instance Subtype.instBot : Bot (Subtype (MeasurableSet : Set α → Prop)) := ⟨∅⟩
@[simp]
theorem coe_bot : ↑(⊥ : Subtype (MeasurableSet : Set α → Prop)) = (⊥ : Set α) :=
rfl
instance Subtype.instTop : Top (Subtype (MeasurableSet : Set α → Prop)) :=
⟨⟨Set.univ, MeasurableSet.univ⟩⟩
@[simp]
theorem coe_top : ↑(⊤ : Subtype (MeasurableSet : Set α → Prop)) = (⊤ : Set α) :=
rfl
noncomputable instance Subtype.instBooleanAlgebra :
BooleanAlgebra (Subtype (MeasurableSet : Set α → Prop)) :=
Subtype.coe_injective.booleanAlgebra _ coe_union coe_inter coe_top coe_bot coe_compl coe_sdiff
coe_himp
@[measurability]
theorem measurableSet_blimsup {s : ℕ → Set α} {p : ℕ → Prop} (h : ∀ n, p n → MeasurableSet (s n)) :
MeasurableSet <| blimsup s atTop p := by
simp only [blimsup_eq_iInf_biSup_of_nat, iSup_eq_iUnion, iInf_eq_iInter]
exact .iInter fun _ => .iUnion fun m => .iUnion fun hm => h m hm.1
@[measurability]
theorem measurableSet_bliminf {s : ℕ → Set α} {p : ℕ → Prop} (h : ∀ n, p n → MeasurableSet (s n)) :
MeasurableSet <| Filter.bliminf s Filter.atTop p := by
simp only [Filter.bliminf_eq_iSup_biInf_of_nat, iInf_eq_iInter, iSup_eq_iUnion]
exact .iUnion fun n => .iInter fun m => .iInter fun hm => h m hm.1
@[measurability]
theorem measurableSet_limsup {s : ℕ → Set α} (hs : ∀ n, MeasurableSet <| s n) :
MeasurableSet <| Filter.limsup s Filter.atTop := by
simpa only [← blimsup_true] using measurableSet_blimsup fun n _ => hs n
@[measurability]
theorem measurableSet_liminf {s : ℕ → Set α} (hs : ∀ n, MeasurableSet <| s n) :
MeasurableSet <| Filter.liminf s Filter.atTop := by
simpa only [← bliminf_true] using measurableSet_bliminf fun n _ => hs n
end MeasurableSet
|
MeasureTheory\MeasurableSpace\Card.lean | /-
Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel, Violeta Hernández Palacios
-/
import Mathlib.MeasureTheory.MeasurableSpace.Defs
import Mathlib.SetTheory.Cardinal.Cofinality
import Mathlib.SetTheory.Cardinal.Continuum
/-!
# Cardinal of sigma-algebras
If a sigma-algebra is generated by a set of sets `s`, then the cardinality of the sigma-algebra is
bounded by `(max #s 2) ^ ℵ₀`. This is stated in `MeasurableSpace.cardinal_generate_measurable_le`
and `MeasurableSpace.cardinalMeasurableSet_le`.
In particular, if `#s ≤ 𝔠`, then the generated sigma-algebra has cardinality at most `𝔠`, see
`MeasurableSpace.cardinal_measurableSet_le_continuum`.
For the proof, we rely on an explicit inductive construction of the sigma-algebra generated by
`s` (instead of the inductive predicate `GenerateMeasurable`). This transfinite inductive
construction is parameterized by an ordinal `< ω₁`, and the cardinality bound is preserved along
each step of the construction. We show in `MeasurableSpace.generateMeasurable_eq_rec` that this
indeed generates this sigma-algebra.
-/
universe u
variable {α : Type u}
open Cardinal Set
-- Porting note: fix universe below, not here
local notation "ω₁" => (WellOrder.α <| Quotient.out <| Cardinal.ord (aleph 1 : Cardinal))
namespace MeasurableSpace
/-- Transfinite induction construction of the sigma-algebra generated by a set of sets `s`. At each
step, we add all elements of `s`, the empty set, the complements of already constructed sets, and
countable unions of already constructed sets. We index this construction by an ordinal `< ω₁`, as
this will be enough to generate all sets in the sigma-algebra.
This construction is very similar to that of the Borel hierarchy. -/
def generateMeasurableRec (s : Set (Set α)) : (ω₁ : Type u) → Set (Set α)
| i =>
let S := ⋃ j : Iio i, generateMeasurableRec s (j.1)
s ∪ {∅} ∪ compl '' S ∪ Set.range fun f : ℕ → S => ⋃ n, (f n).1
termination_by i => i
decreasing_by exact j.2
theorem self_subset_generateMeasurableRec (s : Set (Set α)) (i : ω₁) :
s ⊆ generateMeasurableRec s i := by
unfold generateMeasurableRec
apply_rules [subset_union_of_subset_left]
exact subset_rfl
theorem empty_mem_generateMeasurableRec (s : Set (Set α)) (i : ω₁) :
∅ ∈ generateMeasurableRec s i := by
unfold generateMeasurableRec
exact mem_union_left _ (mem_union_left _ (mem_union_right _ (mem_singleton ∅)))
theorem compl_mem_generateMeasurableRec {s : Set (Set α)} {i j : ω₁} (h : j < i) {t : Set α}
(ht : t ∈ generateMeasurableRec s j) : tᶜ ∈ generateMeasurableRec s i := by
unfold generateMeasurableRec
exact mem_union_left _ (mem_union_right _ ⟨t, mem_iUnion.2 ⟨⟨j, h⟩, ht⟩, rfl⟩)
theorem iUnion_mem_generateMeasurableRec {s : Set (Set α)} {i : ω₁} {f : ℕ → Set α}
(hf : ∀ n, ∃ j < i, f n ∈ generateMeasurableRec s j) :
(⋃ n, f n) ∈ generateMeasurableRec s i := by
unfold generateMeasurableRec
exact mem_union_right _ ⟨fun n => ⟨f n, let ⟨j, hj, hf⟩ := hf n; mem_iUnion.2 ⟨⟨j, hj⟩, hf⟩⟩, rfl⟩
theorem generateMeasurableRec_subset (s : Set (Set α)) {i j : ω₁} (h : i ≤ j) :
generateMeasurableRec s i ⊆ generateMeasurableRec s j := fun x hx => by
rcases eq_or_lt_of_le h with (rfl | h)
· exact hx
· convert iUnion_mem_generateMeasurableRec fun _ => ⟨i, h, hx⟩
exact (iUnion_const x).symm
/-- At each step of the inductive construction, the cardinality bound `≤ (max #s 2) ^ ℵ₀` holds.
-/
theorem cardinal_generateMeasurableRec_le (s : Set (Set α)) (i : ω₁) :
#(generateMeasurableRec s i) ≤ max #s 2 ^ aleph0.{u} := by
apply (aleph 1).ord.out.wo.wf.induction i
intro i IH
have A := aleph0_le_aleph 1
have B : aleph 1 ≤ max #s 2 ^ aleph0.{u} :=
aleph_one_le_continuum.trans (power_le_power_right (le_max_right _ _))
have C : ℵ₀ ≤ max #s 2 ^ aleph0.{u} := A.trans B
have J : #(⋃ j : Iio i, generateMeasurableRec s j.1) ≤ max #s 2 ^ aleph0.{u} := by
refine (mk_iUnion_le _).trans ?_
have D : ⨆ j : Iio i, #(generateMeasurableRec s j) ≤ _ := ciSup_le' fun ⟨j, hj⟩ => IH j hj
apply (mul_le_mul' ((mk_subtype_le _).trans (aleph 1).mk_ord_out.le) D).trans
rw [mul_eq_max A C]
exact max_le B le_rfl
rw [generateMeasurableRec]
apply_rules [(mk_union_le _ _).trans, add_le_of_le C, mk_image_le.trans]
· exact (le_max_left _ _).trans (self_le_power _ one_lt_aleph0.le)
· rw [mk_singleton]
exact one_lt_aleph0.le.trans C
· apply mk_range_le.trans
simp only [mk_pi, prod_const, lift_uzero, mk_denumerable, lift_aleph0]
have := @power_le_power_right _ _ ℵ₀ J
rwa [← power_mul, aleph0_mul_aleph0] at this
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
{ t | GenerateMeasurable s t } =
⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
ext t; refine ⟨fun ht => ?_, fun ht => ?_⟩
· inhabit ω₁
induction' ht with u hu u _ IH f _ IH
· exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
· exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
· rcases mem_iUnion.1 IH with ⟨i, hi⟩
obtain ⟨j, hj⟩ := exists_gt i
exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
· have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
choose I hI using this
have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
refine mem_iUnion.2
⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) ?_,
iUnion_mem_generateMeasurableRec fun n => ⟨I n, ?_, hI n⟩⟩
· rw [Ordinal.type_lt]
refine Ordinal.lsub_lt_ord_lift ?_ fun i => Ordinal.typein_lt_self _
rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
exact aleph0_lt_aleph_one
· rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
apply Ordinal.lt_lsub fun n : ℕ => _
· rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
revert t
apply (aleph 1).ord.out.wo.wf.induction i
intro j H t ht
unfold generateMeasurableRec at ht
rcases ht with (((h | (rfl : t = ∅)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩)
· exact .basic t h
· exact .empty
· exact .compl u (H k hk u hu)
· refine .iUnion _ @fun n => ?_
obtain ⟨-, ⟨⟨k, hk⟩, rfl⟩, hf⟩ := (f n).prop
exact H k hk _ hf
/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma-algebra has cardinality at
most `(max #s 2) ^ ℵ₀`. -/
theorem cardinal_generateMeasurable_le (s : Set (Set α)) :
#{ t | GenerateMeasurable s t } ≤ max #s 2 ^ aleph0.{u} := by
rw [generateMeasurable_eq_rec]
apply (mk_iUnion_le _).trans
rw [(aleph 1).mk_ord_out]
refine le_trans (mul_le_mul' aleph_one_le_continuum
(ciSup_le' fun i => cardinal_generateMeasurableRec_le s i)) ?_
refine (mul_le_max_of_aleph0_le_left aleph0_le_continuum).trans (max_le ?_ le_rfl)
exact power_le_power_right (le_max_right _ _)
/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma
algebra has cardinality at most `(max #s 2) ^ ℵ₀`. -/
theorem cardinalMeasurableSet_le (s : Set (Set α)) :
#{ t | @MeasurableSet α (generateFrom s) t } ≤ max #s 2 ^ aleph0.{u} :=
cardinal_generateMeasurable_le s
/-- If a sigma-algebra is generated by a set of sets `s` with cardinality at most the continuum,
then the sigma algebra has the same cardinality bound. -/
theorem cardinal_generateMeasurable_le_continuum {s : Set (Set α)} (hs : #s ≤ 𝔠) :
#{ t | GenerateMeasurable s t } ≤ 𝔠 :=
(cardinal_generateMeasurable_le s).trans
(by
rw [← continuum_power_aleph0]
exact mod_cast power_le_power_right (max_le hs (nat_lt_continuum 2).le))
/-- If a sigma-algebra is generated by a set of sets `s` with cardinality at most the continuum,
then the sigma algebra has the same cardinality bound. -/
theorem cardinal_measurableSet_le_continuum {s : Set (Set α)} :
#s ≤ 𝔠 → #{ t | @MeasurableSet α (generateFrom s) t } ≤ 𝔠 :=
cardinal_generateMeasurable_le_continuum
end MeasurableSpace
|
MeasureTheory\MeasurableSpace\CountablyGenerated.lean | /-
Copyright (c) 2023 Felix Weilacher. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Felix Weilacher, Yury G. Kudryashov, Rémy Degenne
-/
import Mathlib.MeasureTheory.MeasurableSpace.Embedding
import Mathlib.Data.Set.MemPartition
import Mathlib.Order.Filter.CountableSeparatingOn
/-!
# Countably generated measurable spaces
We say a measurable space is countably generated if it can be generated by a countable set of sets.
In such a space, we can also build a sequence of finer and finer finite measurable partitions of
the space such that the measurable space is generated by the union of all partitions.
## Main definitions
* `MeasurableSpace.CountablyGenerated`: class stating that a measurable space is countably
generated.
* `MeasurableSpace.countableGeneratingSet`: a countable set of sets that generates the σ-algebra.
* `MeasurableSpace.countablePartition`: sequences of finer and finer partitions of
a countably generated space, defined by taking the `memPartion` of an enumeration of the sets in
`countableGeneratingSet`.
* `MeasurableSpace.SeparatesPoints` : class stating that a measurable space separates points.
## Main statements
* `MeasurableSpace.measurable_equiv_nat_bool_of_countablyGenerated`: if a measurable space is
countably generated and separates points, it is measure equivalent to a subset of the Cantor Space
`ℕ → Bool` (equipped with the product sigma algebra).
* `MeasurableSpace.measurable_injection_nat_bool_of_countablyGenerated`: If a measurable space
admits a countable sequence of measurable sets separating points,
it admits a measurable injection into the Cantor space `ℕ → Bool`
`ℕ → Bool` (equipped with the product sigma algebra).
The file also contains measurability results about `memPartition`, from which the properties of
`countablePartition` are deduced.
-/
open Set MeasureTheory
namespace MeasurableSpace
variable {α β : Type*}
/-- We say a measurable space is countably generated
if it can be generated by a countable set of sets. -/
class CountablyGenerated (α : Type*) [m : MeasurableSpace α] : Prop where
isCountablyGenerated : ∃ b : Set (Set α), b.Countable ∧ m = generateFrom b
/-- A countable set of sets that generate the measurable space.
We insert `∅` to ensure it is nonempty. -/
def countableGeneratingSet (α : Type*) [MeasurableSpace α] [h : CountablyGenerated α] :
Set (Set α) :=
insert ∅ h.isCountablyGenerated.choose
lemma countable_countableGeneratingSet [MeasurableSpace α] [h : CountablyGenerated α] :
Set.Countable (countableGeneratingSet α) :=
Countable.insert _ h.isCountablyGenerated.choose_spec.1
lemma generateFrom_countableGeneratingSet [m : MeasurableSpace α] [h : CountablyGenerated α] :
generateFrom (countableGeneratingSet α) = m :=
(generateFrom_insert_empty _).trans <| h.isCountablyGenerated.choose_spec.2.symm
lemma empty_mem_countableGeneratingSet [MeasurableSpace α] [CountablyGenerated α] :
∅ ∈ countableGeneratingSet α := mem_insert _ _
lemma nonempty_countableGeneratingSet [MeasurableSpace α] [CountablyGenerated α] :
Set.Nonempty (countableGeneratingSet α) :=
⟨∅, mem_insert _ _⟩
lemma measurableSet_countableGeneratingSet [MeasurableSpace α] [CountablyGenerated α]
{s : Set α} (hs : s ∈ countableGeneratingSet α) :
MeasurableSet s := by
rw [← generateFrom_countableGeneratingSet (α := α)]
exact measurableSet_generateFrom hs
/-- A countable sequence of sets generating the measurable space. -/
def natGeneratingSequence (α : Type*) [MeasurableSpace α] [CountablyGenerated α] : ℕ → (Set α) :=
enumerateCountable (countable_countableGeneratingSet (α := α)) ∅
lemma generateFrom_natGeneratingSequence (α : Type*) [m : MeasurableSpace α]
[CountablyGenerated α] : generateFrom (range (natGeneratingSequence _)) = m := by
rw [natGeneratingSequence, range_enumerateCountable_of_mem _ empty_mem_countableGeneratingSet,
generateFrom_countableGeneratingSet]
lemma measurableSet_natGeneratingSequence [MeasurableSpace α] [CountablyGenerated α] (n : ℕ) :
MeasurableSet (natGeneratingSequence α n) :=
measurableSet_countableGeneratingSet $ Set.enumerateCountable_mem _
empty_mem_countableGeneratingSet n
theorem CountablyGenerated.comap [m : MeasurableSpace β] [h : CountablyGenerated β] (f : α → β) :
@CountablyGenerated α (.comap f m) := by
rcases h with ⟨⟨b, hbc, rfl⟩⟩
rw [comap_generateFrom]
letI := generateFrom (preimage f '' b)
exact ⟨_, hbc.image _, rfl⟩
theorem CountablyGenerated.sup {m₁ m₂ : MeasurableSpace β} (h₁ : @CountablyGenerated β m₁)
(h₂ : @CountablyGenerated β m₂) : @CountablyGenerated β (m₁ ⊔ m₂) := by
rcases h₁ with ⟨⟨b₁, hb₁c, rfl⟩⟩
rcases h₂ with ⟨⟨b₂, hb₂c, rfl⟩⟩
exact @mk _ (_ ⊔ _) ⟨_, hb₁c.union hb₂c, generateFrom_sup_generateFrom⟩
/-- Any measurable space structure on a countable space is countably generated. -/
instance (priority := 100) [MeasurableSpace α] [Countable α] : CountablyGenerated α where
isCountablyGenerated := by
refine ⟨⋃ y, {measurableAtom y}, countable_iUnion (fun i ↦ countable_singleton _), ?_⟩
refine le_antisymm ?_ (generateFrom_le (by simp [MeasurableSet.measurableAtom_of_countable]))
intro s hs
have : s = ⋃ y ∈ s, measurableAtom y := by
apply Subset.antisymm
· intro x hx
simpa using ⟨x, hx, by simp⟩
· simp only [iUnion_subset_iff]
intro x hx
exact measurableAtom_subset hs hx
rw [this]
apply MeasurableSet.biUnion (to_countable s) (fun x _hx ↦ ?_)
apply measurableSet_generateFrom
simp
instance [MeasurableSpace α] [CountablyGenerated α] {p : α → Prop} :
CountablyGenerated { x // p x } := .comap _
instance [MeasurableSpace α] [CountablyGenerated α] [MeasurableSpace β] [CountablyGenerated β] :
CountablyGenerated (α × β) :=
.sup (.comap Prod.fst) (.comap Prod.snd)
section SeparatesPoints
/-- We say that a measurable space separates points if for any two distinct points,
there is a measurable set containing one but not the other. -/
class SeparatesPoints (α : Type*) [m : MeasurableSpace α] : Prop where
separates : ∀ x y : α, (∀ s, MeasurableSet s → (x ∈ s → y ∈ s)) → x = y
theorem separatesPoints_def [MeasurableSpace α] [hs : SeparatesPoints α] {x y : α}
(h : ∀ s, MeasurableSet s → (x ∈ s → y ∈ s)) : x = y := hs.separates _ _ h
theorem exists_measurableSet_of_ne [MeasurableSpace α] [SeparatesPoints α] {x y : α}
(h : x ≠ y) : ∃ s, MeasurableSet s ∧ x ∈ s ∧ y ∉ s := by
contrapose! h
exact separatesPoints_def h
theorem separatesPoints_iff [MeasurableSpace α] : SeparatesPoints α ↔
∀ x y : α, (∀ s, MeasurableSet s → (x ∈ s ↔ y ∈ s)) → x = y :=
⟨fun h ↦ fun _ _ hxy ↦ h.separates _ _ fun _ hs xs ↦ (hxy _ hs).mp xs,
fun h ↦ ⟨fun _ _ hxy ↦ h _ _ fun _ hs ↦
⟨fun xs ↦ hxy _ hs xs, not_imp_not.mp fun xs ↦ hxy _ hs.compl xs⟩⟩⟩
/-- If the measurable space generated by `S` separates points,
then this is witnessed by sets in `S`. -/
theorem separating_of_generateFrom (S : Set (Set α))
[h : @SeparatesPoints α (generateFrom S)] :
∀ x y : α, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := by
letI := generateFrom S
intros x y hxy
rw [← forall_generateFrom_mem_iff_mem_iff] at hxy
exact separatesPoints_def $ fun _ hs ↦ (hxy _ hs).mp
theorem SeparatesPoints.mono {m m' : MeasurableSpace α} [hsep : @SeparatesPoints _ m] (h : m ≤ m') :
@SeparatesPoints _ m' := @SeparatesPoints.mk _ m' fun _ _ hxy ↦
@SeparatesPoints.separates _ m hsep _ _ fun _ hs ↦ hxy _ (h _ hs)
/-- We say that a measurable space is countably separated if there is a
countable sequence of measurable sets separating points. -/
class CountablySeparated (α : Type*) [MeasurableSpace α] : Prop where
countably_separated : HasCountableSeparatingOn α MeasurableSet univ
instance countablySeparated_of_hasCountableSeparatingOn [MeasurableSpace α]
[h : HasCountableSeparatingOn α MeasurableSet univ] : CountablySeparated α := ⟨h⟩
instance hasCountableSeparatingOn_of_countablySeparated [MeasurableSpace α]
[h : CountablySeparated α] : HasCountableSeparatingOn α MeasurableSet univ :=
h.countably_separated
theorem countablySeparated_def [MeasurableSpace α] :
CountablySeparated α ↔ HasCountableSeparatingOn α MeasurableSet univ :=
⟨fun h ↦ h.countably_separated, fun h ↦ ⟨h⟩⟩
theorem CountablySeparated.mono {m m' : MeasurableSpace α} [hsep : @CountablySeparated _ m]
(h : m ≤ m') : @CountablySeparated _ m' := by
simp_rw [countablySeparated_def] at *
rcases hsep with ⟨S, Sct, Smeas, hS⟩
use S, Sct, (fun s hs ↦ h _ <| Smeas _ hs), hS
theorem CountablySeparated.subtype_iff [MeasurableSpace α] {s : Set α} :
CountablySeparated s ↔ HasCountableSeparatingOn α MeasurableSet s := by
rw [countablySeparated_def]
exact HasCountableSeparatingOn.subtype_iff
instance (priority := 100) Subtype.separatesPoints [MeasurableSpace α] [h : SeparatesPoints α]
{s : Set α} : SeparatesPoints s :=
⟨fun _ _ hxy ↦ Subtype.val_injective $ h.1 _ _ fun _ ht ↦ hxy _ $ measurable_subtype_coe ht⟩
instance (priority := 100) Subtype.countablySeparated [MeasurableSpace α]
[h : CountablySeparated α] {s : Set α} : CountablySeparated s := by
rw [CountablySeparated.subtype_iff]
exact h.countably_separated.mono (fun s ↦ id) $ subset_univ _
instance (priority := 100) separatesPoints_of_measurableSingletonClass [MeasurableSpace α]
[MeasurableSingletonClass α] : SeparatesPoints α := by
refine ⟨fun x y h ↦ ?_⟩
specialize h _ (MeasurableSet.singleton x)
simp_rw [mem_singleton_iff, forall_true_left] at h
exact h.symm
instance hasCountableSeparatingOn_of_countablySeparated_subtype
[MeasurableSpace α] {s : Set α} [h : CountablySeparated s] :
HasCountableSeparatingOn _ MeasurableSet s := CountablySeparated.subtype_iff.mp h
instance countablySeparated_subtype_of_hasCountableSeparatingOn
[MeasurableSpace α] {s : Set α} [h : HasCountableSeparatingOn _ MeasurableSet s] :
CountablySeparated s := CountablySeparated.subtype_iff.mpr h
instance countablySeparated_of_separatesPoints [MeasurableSpace α]
[h : CountablyGenerated α] [SeparatesPoints α] : CountablySeparated α := by
rcases h with ⟨b, hbc, hb⟩
refine ⟨⟨b, hbc, fun t ht ↦ hb.symm ▸ .basic t ht, ?_⟩⟩
rw [hb] at ‹SeparatesPoints _›
convert separating_of_generateFrom b
simp
variable (α)
/-- If a measurable space admits a countable separating family of measurable sets,
there is a countably generated coarser space which still separates points. -/
theorem exists_countablyGenerated_le_of_countablySeparated [m : MeasurableSpace α]
[h : CountablySeparated α] :
∃ m' : MeasurableSpace α, @CountablyGenerated _ m' ∧ @SeparatesPoints _ m' ∧ m' ≤ m := by
rcases h with ⟨b, bct, hbm, hb⟩
refine ⟨generateFrom b, ?_, ?_, generateFrom_le hbm⟩
· use b
rw [@separatesPoints_iff]
exact fun x y hxy ↦ hb _ trivial _ trivial fun _ hs ↦ hxy _ $ measurableSet_generateFrom hs
open Function
open Classical in
/-- A map from a measurable space to the Cantor space `ℕ → Bool` induced by a countable
sequence of sets generating the measurable space. -/
noncomputable
def mapNatBool [MeasurableSpace α] [CountablyGenerated α] (x : α) (n : ℕ) :
Bool := x ∈ natGeneratingSequence α n
theorem measurable_mapNatBool [MeasurableSpace α] [CountablyGenerated α] :
Measurable (mapNatBool α) := by
rw [measurable_pi_iff]
refine fun n ↦ measurable_to_bool ?_
simp only [preimage, mem_singleton_iff, mapNatBool,
Bool.decide_iff, setOf_mem_eq]
apply measurableSet_natGeneratingSequence
theorem injective_mapNatBool [MeasurableSpace α] [CountablyGenerated α]
[SeparatesPoints α] : Injective (mapNatBool α) := by
intro x y hxy
rw [← generateFrom_natGeneratingSequence α] at *
apply separating_of_generateFrom (range (natGeneratingSequence _))
rintro - ⟨n, rfl⟩
rw [← decide_eq_decide]
exact congr_fun hxy n
/-- If a measurable space is countably generated and separates points, it is measure equivalent
to some subset of the Cantor space `ℕ → Bool` (equipped with the product sigma algebra).
Note: `s` need not be measurable, so this map need not be a `MeasurableEmbedding` to
the Cantor Space. -/
theorem measurableEquiv_nat_bool_of_countablyGenerated [MeasurableSpace α]
[CountablyGenerated α] [SeparatesPoints α] :
∃ s : Set (ℕ → Bool), Nonempty (α ≃ᵐ s) := by
use range (mapNatBool α), Equiv.ofInjective _ $
injective_mapNatBool _,
Measurable.subtype_mk $ measurable_mapNatBool _
simp_rw [← generateFrom_natGeneratingSequence α]
apply measurable_generateFrom
rintro _ ⟨n, rfl⟩
rw [← Equiv.image_eq_preimage _ _]
refine ⟨{y | y n}, by measurability, ?_⟩
rw [← Equiv.preimage_eq_iff_eq_image]
simp [mapNatBool]
/-- If a measurable space admits a countable sequence of measurable sets separating points,
it admits a measurable injection into the Cantor space `ℕ → Bool`
(equipped with the product sigma algebra). -/
theorem measurable_injection_nat_bool_of_countablySeparated [MeasurableSpace α]
[CountablySeparated α] : ∃ f : α → ℕ → Bool, Measurable f ∧ Injective f := by
rcases exists_countablyGenerated_le_of_countablySeparated α with ⟨m', _, _, m'le⟩
refine ⟨mapNatBool α, ?_, injective_mapNatBool _⟩
exact (measurable_mapNatBool _).mono m'le le_rfl
variable {α}
--TODO: Make this an instance
theorem measurableSingletonClass_of_countablySeparated
[MeasurableSpace α] [CountablySeparated α] :
MeasurableSingletonClass α := by
rcases measurable_injection_nat_bool_of_countablySeparated α with ⟨f, fmeas, finj⟩
refine ⟨fun x ↦ ?_⟩
rw [← finj.preimage_image {x}, image_singleton]
exact fmeas $ MeasurableSet.singleton _
end SeparatesPoints
section MeasurableMemPartition
lemma measurableSet_succ_memPartition (t : ℕ → Set α) (n : ℕ) {s : Set α}
(hs : s ∈ memPartition t n) :
MeasurableSet[generateFrom (memPartition t (n + 1))] s := by
rw [← diff_union_inter s (t n)]
refine MeasurableSet.union ?_ ?_ <;>
· refine measurableSet_generateFrom ?_
rw [memPartition_succ]
exact ⟨s, hs, by simp⟩
lemma generateFrom_memPartition_le_succ (t : ℕ → Set α) (n : ℕ) :
generateFrom (memPartition t n) ≤ generateFrom (memPartition t (n + 1)) :=
generateFrom_le (fun _ hs ↦ measurableSet_succ_memPartition t n hs)
lemma measurableSet_generateFrom_memPartition_iff (t : ℕ → Set α) (n : ℕ) (s : Set α) :
MeasurableSet[generateFrom (memPartition t n)] s
↔ ∃ S : Finset (Set α), ↑S ⊆ memPartition t n ∧ s = ⋃₀ S := by
refine ⟨fun h ↦ ?_, fun ⟨S, hS_subset, hS_eq⟩ ↦ ?_⟩
· refine MeasurableSpace.generateFrom_induction
(p := fun u ↦ ∃ S : Finset (Set α), ↑S ⊆ memPartition t n ∧ u = ⋃₀ ↑S)
(C := memPartition t n) ?_ ?_ ?_ ?_ h
· exact fun u hu ↦ ⟨{u}, by simp [hu], by simp⟩
· exact ⟨∅, by simp, by simp⟩
· rintro u ⟨S, hS_subset, rfl⟩
classical
refine ⟨(memPartition t n).toFinset \ S, ?_, ?_⟩
· simp only [Finset.coe_sdiff, coe_toFinset]
exact diff_subset
· simp only [Finset.coe_sdiff, coe_toFinset]
refine (IsCompl.eq_compl ⟨?_, ?_⟩).symm
· refine Set.disjoint_sUnion_right.mpr fun u huS => ?_
refine Set.disjoint_sUnion_left.mpr fun v huV => ?_
refine disjoint_memPartition t n (mem_of_mem_diff huV) (hS_subset huS) ?_
exact ne_of_mem_of_not_mem huS (not_mem_of_mem_diff huV) |>.symm
· rw [codisjoint_iff]
simp only [sup_eq_union, top_eq_univ]
rw [← sUnion_memPartition t n, union_comm, ← sUnion_union, union_diff_cancel hS_subset]
· intro f h
choose S hS_subset hS_eq using h
have : Fintype (⋃ n, (S n : Set (Set α))) := by
refine (Finite.subset (finite_memPartition t n) ?_).fintype
simp only [iUnion_subset_iff]
exact hS_subset
refine ⟨(⋃ n, (S n : Set (Set α))).toFinset, ?_, ?_⟩
· simp only [coe_toFinset, iUnion_subset_iff]
exact hS_subset
· simp only [coe_toFinset, sUnion_iUnion, hS_eq]
· rw [hS_eq, sUnion_eq_biUnion]
refine MeasurableSet.biUnion ?_ (fun t ht ↦ ?_)
· exact S.countable_toSet
· exact measurableSet_generateFrom (hS_subset ht)
lemma measurableSet_generateFrom_memPartition (t : ℕ → Set α) (n : ℕ) :
MeasurableSet[generateFrom (memPartition t (n + 1))] (t n) := by
have : t n = ⋃ u ∈ memPartition t n, u ∩ t n := by
simp_rw [← iUnion_inter, ← sUnion_eq_biUnion, sUnion_memPartition, univ_inter]
rw [this]
refine MeasurableSet.biUnion (finite_memPartition _ _).countable (fun v hv ↦ ?_)
refine measurableSet_generateFrom ?_
rw [memPartition_succ]
exact ⟨v, hv, Or.inl rfl⟩
lemma generateFrom_iUnion_memPartition (t : ℕ → Set α) :
generateFrom (⋃ n, memPartition t n) = generateFrom (range t) := by
refine le_antisymm (generateFrom_le fun u hu ↦ ?_) (generateFrom_le fun u hu ↦ ?_)
· simp only [mem_iUnion] at hu
obtain ⟨n, hun⟩ := hu
induction n generalizing u with
| zero =>
simp only [Nat.zero_eq, memPartition_zero, mem_insert_iff, mem_singleton_iff] at hun
rw [hun]
exact MeasurableSet.univ
| succ n ih =>
simp only [memPartition_succ, mem_setOf_eq] at hun
obtain ⟨v, hv, huv⟩ := hun
rcases huv with rfl | rfl
· exact (ih v hv).inter (measurableSet_generateFrom ⟨n, rfl⟩)
· exact (ih v hv).diff (measurableSet_generateFrom ⟨n, rfl⟩)
· simp only [iUnion_singleton_eq_range, mem_range] at hu
obtain ⟨n, rfl⟩ := hu
exact generateFrom_mono (subset_iUnion _ _) _ (measurableSet_generateFrom_memPartition t n)
lemma generateFrom_memPartition_le_range (t : ℕ → Set α) (n : ℕ) :
generateFrom (memPartition t n) ≤ generateFrom (range t) := by
conv_rhs => rw [← generateFrom_iUnion_memPartition t]
exact generateFrom_mono (subset_iUnion _ _)
lemma generateFrom_iUnion_memPartition_le [m : MeasurableSpace α] {t : ℕ → Set α}
(ht : ∀ n, MeasurableSet (t n)) :
generateFrom (⋃ n, memPartition t n) ≤ m := by
refine (generateFrom_iUnion_memPartition t).trans_le (generateFrom_le ?_)
rintro s ⟨i, rfl⟩
exact ht i
lemma generateFrom_memPartition_le [m : MeasurableSpace α] {t : ℕ → Set α}
(ht : ∀ n, MeasurableSet (t n)) (n : ℕ) :
generateFrom (memPartition t n) ≤ m :=
(generateFrom_mono (subset_iUnion _ _)).trans (generateFrom_iUnion_memPartition_le ht)
lemma measurableSet_memPartition [MeasurableSpace α] {t : ℕ → Set α}
(ht : ∀ n, MeasurableSet (t n)) (n : ℕ) {s : Set α} (hs : s ∈ memPartition t n) :
MeasurableSet s :=
generateFrom_memPartition_le ht n _ (measurableSet_generateFrom hs)
lemma measurableSet_memPartitionSet [MeasurableSpace α] {t : ℕ → Set α}
(ht : ∀ n, MeasurableSet (t n)) (n : ℕ) (a : α) :
MeasurableSet (memPartitionSet t n a) :=
measurableSet_memPartition ht n (memPartitionSet_mem t n a)
end MeasurableMemPartition
variable [m : MeasurableSpace α] [h : CountablyGenerated α]
/-- For each `n : ℕ`, `countablePartition α n` is a partition of the space in at most
`2^n` sets. Each partition is finer than the preceeding one. The measurable space generated by
the union of all those partitions is the measurable space on `α`. -/
def countablePartition (α : Type*) [MeasurableSpace α] [CountablyGenerated α] : ℕ → Set (Set α) :=
memPartition (enumerateCountable countable_countableGeneratingSet ∅)
lemma measurableSet_enumerateCountable_countableGeneratingSet
(α : Type*) [MeasurableSpace α] [CountablyGenerated α] (n : ℕ) :
MeasurableSet (enumerateCountable (countable_countableGeneratingSet (α := α)) ∅ n) :=
measurableSet_countableGeneratingSet
(enumerateCountable_mem _ (empty_mem_countableGeneratingSet) n)
lemma finite_countablePartition (α : Type*) [MeasurableSpace α] [CountablyGenerated α] (n : ℕ) :
Set.Finite (countablePartition α n) :=
finite_memPartition _ n
instance instFinite_countablePartition (n : ℕ) : Finite (countablePartition α n) :=
Set.finite_coe_iff.mp (finite_countablePartition _ _)
lemma disjoint_countablePartition {n : ℕ} {s t : Set α}
(hs : s ∈ countablePartition α n) (ht : t ∈ countablePartition α n) (hst : s ≠ t) :
Disjoint s t :=
disjoint_memPartition _ n hs ht hst
lemma sUnion_countablePartition (α : Type*) [MeasurableSpace α] [CountablyGenerated α] (n : ℕ) :
⋃₀ countablePartition α n = univ :=
sUnion_memPartition _ n
lemma measurableSet_generateFrom_countablePartition_iff (n : ℕ) (s : Set α) :
MeasurableSet[generateFrom (countablePartition α n)] s
↔ ∃ S : Finset (Set α), ↑S ⊆ countablePartition α n ∧ s = ⋃₀ S :=
measurableSet_generateFrom_memPartition_iff _ n s
lemma measurableSet_succ_countablePartition (n : ℕ) {s : Set α} (hs : s ∈ countablePartition α n) :
MeasurableSet[generateFrom (countablePartition α (n + 1))] s :=
measurableSet_succ_memPartition _ _ hs
lemma generateFrom_countablePartition_le_succ (α : Type*) [MeasurableSpace α] [CountablyGenerated α]
(n : ℕ) :
generateFrom (countablePartition α n) ≤ generateFrom (countablePartition α (n + 1)) :=
generateFrom_memPartition_le_succ _ _
lemma generateFrom_iUnion_countablePartition (α : Type*) [m : MeasurableSpace α]
[CountablyGenerated α] :
generateFrom (⋃ n, countablePartition α n) = m := by
rw [countablePartition, generateFrom_iUnion_memPartition,
range_enumerateCountable_of_mem _ empty_mem_countableGeneratingSet,
generateFrom_countableGeneratingSet]
lemma generateFrom_countablePartition_le (α : Type*) [m : MeasurableSpace α] [CountablyGenerated α]
(n : ℕ) :
generateFrom (countablePartition α n) ≤ m :=
generateFrom_memPartition_le (measurableSet_enumerateCountable_countableGeneratingSet α) n
lemma measurableSet_countablePartition (n : ℕ) {s : Set α} (hs : s ∈ countablePartition α n) :
MeasurableSet s :=
generateFrom_countablePartition_le α n _ (measurableSet_generateFrom hs)
/-- The set in `countablePartition α n` to which `a : α` belongs. -/
def countablePartitionSet (n : ℕ) (a : α) : Set α :=
memPartitionSet (enumerateCountable countable_countableGeneratingSet ∅) n a
lemma countablePartitionSet_mem (n : ℕ) (a : α) :
countablePartitionSet n a ∈ countablePartition α n :=
memPartitionSet_mem _ _ _
lemma mem_countablePartitionSet (n : ℕ) (a : α) : a ∈ countablePartitionSet n a :=
mem_memPartitionSet _ _ _
lemma countablePartitionSet_eq_iff {n : ℕ} (a : α) {s : Set α} (hs : s ∈ countablePartition α n) :
countablePartitionSet n a = s ↔ a ∈ s :=
memPartitionSet_eq_iff _ hs
lemma countablePartitionSet_of_mem {n : ℕ} {a : α} {s : Set α} (hs : s ∈ countablePartition α n)
(ha : a ∈ s) :
countablePartitionSet n a = s :=
memPartitionSet_of_mem hs ha
lemma measurableSet_countablePartitionSet (n : ℕ) (a : α) :
MeasurableSet (countablePartitionSet n a) :=
measurableSet_countablePartition n (countablePartitionSet_mem n a)
section CountableOrCountablyGenerated
variable [MeasurableSpace β]
/-- A class registering that either `α` is countable or `β` is a countably generated
measurable space. -/
class CountableOrCountablyGenerated (α β : Type*) [MeasurableSpace α] [MeasurableSpace β] : Prop :=
countableOrCountablyGenerated : Countable α ∨ MeasurableSpace.CountablyGenerated β
instance instCountableOrCountablyGeneratedOfCountable [h1 : Countable α] :
CountableOrCountablyGenerated α β := ⟨Or.inl h1⟩
instance instCountableOrCountablyGeneratedOfCountablyGenerated
[h : MeasurableSpace.CountablyGenerated β] :
CountableOrCountablyGenerated α β := ⟨Or.inr h⟩
end CountableOrCountablyGenerated
end MeasurableSpace
|
MeasureTheory\MeasurableSpace\Defs.lean | /-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Mario Carneiro
-/
import Mathlib.Data.Set.Countable
import Mathlib.Order.Disjointed
import Mathlib.Tactic.FunProp.Attr
import Mathlib.Tactic.Measurability
/-!
# Measurable spaces and measurable functions
This file defines measurable spaces and measurable functions.
A measurable space is a set equipped with a σ-algebra, a collection of
subsets closed under complementation and countable union. A function
between measurable spaces is measurable if the preimage of each
measurable subset is measurable.
σ-algebras on a fixed set `α` form a complete lattice. Here we order
σ-algebras by writing `m₁ ≤ m₂` if every set which is `m₁`-measurable is
also `m₂`-measurable (that is, `m₁` is a subset of `m₂`). In particular, any
collection of subsets of `α` generates a smallest σ-algebra which
contains all of them.
## References
* <https://en.wikipedia.org/wiki/Measurable_space>
* <https://en.wikipedia.org/wiki/Sigma-algebra>
* <https://en.wikipedia.org/wiki/Dynkin_system>
## Tags
measurable space, σ-algebra, measurable function
-/
open Set Encodable Function Equiv
variable {α β γ δ δ' : Type*} {ι : Sort*} {s t u : Set α}
/-- A measurable space is a space equipped with a σ-algebra. -/
@[class] structure MeasurableSpace (α : Type*) where
/-- Predicate saying that a given set is measurable. Use `MeasurableSet` in the root namespace
instead. -/
MeasurableSet' : Set α → Prop
/-- The empty set is a measurable set. Use `MeasurableSet.empty` instead. -/
measurableSet_empty : MeasurableSet' ∅
/-- The complement of a measurable set is a measurable set. Use `MeasurableSet.compl` instead. -/
measurableSet_compl : ∀ s, MeasurableSet' s → MeasurableSet' sᶜ
/-- The union of a sequence of measurable sets is a measurable set. Use a more general
`MeasurableSet.iUnion` instead. -/
measurableSet_iUnion : ∀ f : ℕ → Set α, (∀ i, MeasurableSet' (f i)) → MeasurableSet' (⋃ i, f i)
instance [h : MeasurableSpace α] : MeasurableSpace αᵒᵈ := h
/-- `MeasurableSet s` means that `s` is measurable (in the ambient measure space on `α`) -/
def MeasurableSet [MeasurableSpace α] (s : Set α) : Prop :=
‹MeasurableSpace α›.MeasurableSet' s
-- Porting note (#11215): TODO: `scoped[MeasureTheory]` doesn't work for unknown reason
namespace MeasureTheory
set_option quotPrecheck false in
/-- Notation for `MeasurableSet` with respect to a non-standard σ-algebra. -/
scoped notation "MeasurableSet[" m "]" => @MeasurableSet _ m
end MeasureTheory
open MeasureTheory
section
open scoped symmDiff
@[simp, measurability]
theorem MeasurableSet.empty [MeasurableSpace α] : MeasurableSet (∅ : Set α) :=
MeasurableSpace.measurableSet_empty _
variable {m : MeasurableSpace α}
@[measurability]
protected theorem MeasurableSet.compl : MeasurableSet s → MeasurableSet sᶜ :=
MeasurableSpace.measurableSet_compl _ s
protected theorem MeasurableSet.of_compl (h : MeasurableSet sᶜ) : MeasurableSet s :=
compl_compl s ▸ h.compl
@[simp]
theorem MeasurableSet.compl_iff : MeasurableSet sᶜ ↔ MeasurableSet s :=
⟨.of_compl, .compl⟩
@[simp, measurability]
protected theorem MeasurableSet.univ : MeasurableSet (univ : Set α) :=
.of_compl <| by simp
@[nontriviality, measurability]
theorem Subsingleton.measurableSet [Subsingleton α] {s : Set α} : MeasurableSet s :=
Subsingleton.set_cases MeasurableSet.empty MeasurableSet.univ s
theorem MeasurableSet.congr {s t : Set α} (hs : MeasurableSet s) (h : s = t) : MeasurableSet t := by
rwa [← h]
@[measurability]
protected theorem MeasurableSet.iUnion [Countable ι] ⦃f : ι → Set α⦄
(h : ∀ b, MeasurableSet (f b)) : MeasurableSet (⋃ b, f b) := by
cases isEmpty_or_nonempty ι
· simp
· rcases exists_surjective_nat ι with ⟨e, he⟩
rw [← iUnion_congr_of_surjective _ he (fun _ => rfl)]
exact m.measurableSet_iUnion _ fun _ => h _
protected theorem MeasurableSet.biUnion {f : β → Set α} {s : Set β} (hs : s.Countable)
(h : ∀ b ∈ s, MeasurableSet (f b)) : MeasurableSet (⋃ b ∈ s, f b) := by
rw [biUnion_eq_iUnion]
have := hs.to_subtype
exact MeasurableSet.iUnion (by simpa using h)
theorem Set.Finite.measurableSet_biUnion {f : β → Set α} {s : Set β} (hs : s.Finite)
(h : ∀ b ∈ s, MeasurableSet (f b)) : MeasurableSet (⋃ b ∈ s, f b) :=
.biUnion hs.countable h
theorem Finset.measurableSet_biUnion {f : β → Set α} (s : Finset β)
(h : ∀ b ∈ s, MeasurableSet (f b)) : MeasurableSet (⋃ b ∈ s, f b) :=
s.finite_toSet.measurableSet_biUnion h
protected theorem MeasurableSet.sUnion {s : Set (Set α)} (hs : s.Countable)
(h : ∀ t ∈ s, MeasurableSet t) : MeasurableSet (⋃₀ s) := by
rw [sUnion_eq_biUnion]
exact .biUnion hs h
theorem Set.Finite.measurableSet_sUnion {s : Set (Set α)} (hs : s.Finite)
(h : ∀ t ∈ s, MeasurableSet t) : MeasurableSet (⋃₀ s) :=
MeasurableSet.sUnion hs.countable h
@[measurability]
theorem MeasurableSet.iInter [Countable ι] {f : ι → Set α} (h : ∀ b, MeasurableSet (f b)) :
MeasurableSet (⋂ b, f b) :=
.of_compl <| by rw [compl_iInter]; exact .iUnion fun b => (h b).compl
theorem MeasurableSet.biInter {f : β → Set α} {s : Set β} (hs : s.Countable)
(h : ∀ b ∈ s, MeasurableSet (f b)) : MeasurableSet (⋂ b ∈ s, f b) :=
.of_compl <| by rw [compl_iInter₂]; exact .biUnion hs fun b hb => (h b hb).compl
theorem Set.Finite.measurableSet_biInter {f : β → Set α} {s : Set β} (hs : s.Finite)
(h : ∀ b ∈ s, MeasurableSet (f b)) : MeasurableSet (⋂ b ∈ s, f b) :=
.biInter hs.countable h
theorem Finset.measurableSet_biInter {f : β → Set α} (s : Finset β)
(h : ∀ b ∈ s, MeasurableSet (f b)) : MeasurableSet (⋂ b ∈ s, f b) :=
s.finite_toSet.measurableSet_biInter h
theorem MeasurableSet.sInter {s : Set (Set α)} (hs : s.Countable) (h : ∀ t ∈ s, MeasurableSet t) :
MeasurableSet (⋂₀ s) := by
rw [sInter_eq_biInter]
exact MeasurableSet.biInter hs h
theorem Set.Finite.measurableSet_sInter {s : Set (Set α)} (hs : s.Finite)
(h : ∀ t ∈ s, MeasurableSet t) : MeasurableSet (⋂₀ s) :=
MeasurableSet.sInter hs.countable h
@[simp, measurability]
protected theorem MeasurableSet.union {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁)
(h₂ : MeasurableSet s₂) : MeasurableSet (s₁ ∪ s₂) := by
rw [union_eq_iUnion]
exact .iUnion (Bool.forall_bool.2 ⟨h₂, h₁⟩)
@[simp, measurability]
protected theorem MeasurableSet.inter {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁)
(h₂ : MeasurableSet s₂) : MeasurableSet (s₁ ∩ s₂) := by
rw [inter_eq_compl_compl_union_compl]
exact (h₁.compl.union h₂.compl).compl
@[simp, measurability]
protected theorem MeasurableSet.diff {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁)
(h₂ : MeasurableSet s₂) : MeasurableSet (s₁ \ s₂) :=
h₁.inter h₂.compl
@[simp, measurability]
protected lemma MeasurableSet.himp {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁) (h₂ : MeasurableSet s₂) :
MeasurableSet (s₁ ⇨ s₂) := by rw [himp_eq]; exact h₂.union h₁.compl
@[simp, measurability]
protected theorem MeasurableSet.symmDiff {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁)
(h₂ : MeasurableSet s₂) : MeasurableSet (s₁ ∆ s₂) :=
(h₁.diff h₂).union (h₂.diff h₁)
@[simp, measurability]
protected lemma MeasurableSet.bihimp {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁)
(h₂ : MeasurableSet s₂) : MeasurableSet (s₁ ⇔ s₂) := (h₂.himp h₁).inter (h₁.himp h₂)
@[simp, measurability]
protected theorem MeasurableSet.ite {t s₁ s₂ : Set α} (ht : MeasurableSet t)
(h₁ : MeasurableSet s₁) (h₂ : MeasurableSet s₂) : MeasurableSet (t.ite s₁ s₂) :=
(h₁.inter ht).union (h₂.diff ht)
open Classical in
theorem MeasurableSet.ite' {s t : Set α} {p : Prop} (hs : p → MeasurableSet s)
(ht : ¬p → MeasurableSet t) : MeasurableSet (ite p s t) := by
split_ifs with h
exacts [hs h, ht h]
@[simp, measurability]
protected theorem MeasurableSet.cond {s₁ s₂ : Set α} (h₁ : MeasurableSet s₁)
(h₂ : MeasurableSet s₂) {i : Bool} : MeasurableSet (cond i s₁ s₂) := by
cases i
exacts [h₂, h₁]
@[simp, measurability]
protected theorem MeasurableSet.disjointed {f : ℕ → Set α} (h : ∀ i, MeasurableSet (f i)) (n) :
MeasurableSet (disjointed f n) :=
disjointedRec (fun _ _ ht => MeasurableSet.diff ht <| h _) (h n)
protected theorem MeasurableSet.const (p : Prop) : MeasurableSet { _a : α | p } := by
by_cases p <;> simp [*]
/-- Every set has a measurable superset. Declare this as local instance as needed. -/
theorem nonempty_measurable_superset (s : Set α) : Nonempty { t // s ⊆ t ∧ MeasurableSet t } :=
⟨⟨univ, subset_univ s, MeasurableSet.univ⟩⟩
end
theorem MeasurableSpace.measurableSet_injective : Injective (@MeasurableSet α)
| ⟨_, _, _, _⟩, ⟨_, _, _, _⟩, _ => by congr
@[ext]
theorem MeasurableSpace.ext {m₁ m₂ : MeasurableSpace α}
(h : ∀ s : Set α, MeasurableSet[m₁] s ↔ MeasurableSet[m₂] s) : m₁ = m₂ :=
measurableSet_injective <| funext fun s => propext (h s)
/-- A typeclass mixin for `MeasurableSpace`s such that each singleton is measurable. -/
class MeasurableSingletonClass (α : Type*) [MeasurableSpace α] : Prop where
/-- A singleton is a measurable set. -/
measurableSet_singleton : ∀ x, MeasurableSet ({x} : Set α)
export MeasurableSingletonClass (measurableSet_singleton)
@[simp]
lemma MeasurableSet.singleton [MeasurableSpace α] [MeasurableSingletonClass α] (a : α) :
MeasurableSet {a} :=
measurableSet_singleton a
section MeasurableSingletonClass
variable [MeasurableSpace α] [MeasurableSingletonClass α]
@[measurability]
theorem measurableSet_eq {a : α} : MeasurableSet { x | x = a } := .singleton a
@[measurability]
protected theorem MeasurableSet.insert {s : Set α} (hs : MeasurableSet s) (a : α) :
MeasurableSet (insert a s) :=
.union (.singleton a) hs
@[simp]
theorem measurableSet_insert {a : α} {s : Set α} :
MeasurableSet (insert a s) ↔ MeasurableSet s := by
classical
exact ⟨fun h =>
if ha : a ∈ s then by rwa [← insert_eq_of_mem ha]
else insert_diff_self_of_not_mem ha ▸ h.diff (.singleton _),
fun h => h.insert a⟩
theorem Set.Subsingleton.measurableSet {s : Set α} (hs : s.Subsingleton) : MeasurableSet s :=
hs.induction_on .empty .singleton
theorem Set.Finite.measurableSet {s : Set α} (hs : s.Finite) : MeasurableSet s :=
Finite.induction_on hs MeasurableSet.empty fun _ _ hsm => hsm.insert _
@[measurability]
protected theorem Finset.measurableSet (s : Finset α) : MeasurableSet (↑s : Set α) :=
s.finite_toSet.measurableSet
theorem Set.Countable.measurableSet {s : Set α} (hs : s.Countable) : MeasurableSet s := by
rw [← biUnion_of_singleton s]
exact .biUnion hs fun b _ => .singleton b
end MeasurableSingletonClass
namespace MeasurableSpace
/-- Copy of a `MeasurableSpace` with a new `MeasurableSet` equal to the old one. Useful to fix
definitional equalities. -/
protected def copy (m : MeasurableSpace α) (p : Set α → Prop) (h : ∀ s, p s ↔ MeasurableSet[m] s) :
MeasurableSpace α where
MeasurableSet' := p
measurableSet_empty := by simpa only [h] using m.measurableSet_empty
measurableSet_compl := by simpa only [h] using m.measurableSet_compl
measurableSet_iUnion := by simpa only [h] using m.measurableSet_iUnion
lemma measurableSet_copy {m : MeasurableSpace α} {p : Set α → Prop}
(h : ∀ s, p s ↔ MeasurableSet[m] s) {s} : MeasurableSet[.copy m p h] s ↔ p s :=
Iff.rfl
lemma copy_eq {m : MeasurableSpace α} {p : Set α → Prop} (h : ∀ s, p s ↔ MeasurableSet[m] s) :
m.copy p h = m :=
ext h
section CompleteLattice
instance : LE (MeasurableSpace α) where le m₁ m₂ := ∀ s, MeasurableSet[m₁] s → MeasurableSet[m₂] s
theorem le_def {α} {a b : MeasurableSpace α} : a ≤ b ↔ a.MeasurableSet' ≤ b.MeasurableSet' :=
Iff.rfl
instance : PartialOrder (MeasurableSpace α) :=
{ PartialOrder.lift (@MeasurableSet α) measurableSet_injective with
le := LE.le
lt := fun m₁ m₂ => m₁ ≤ m₂ ∧ ¬m₂ ≤ m₁ }
/-- The smallest σ-algebra containing a collection `s` of basic sets -/
inductive GenerateMeasurable (s : Set (Set α)) : Set α → Prop
| protected basic : ∀ u ∈ s, GenerateMeasurable s u
| protected empty : GenerateMeasurable s ∅
| protected compl : ∀ t, GenerateMeasurable s t → GenerateMeasurable s tᶜ
| protected iUnion : ∀ f : ℕ → Set α, (∀ n, GenerateMeasurable s (f n)) →
GenerateMeasurable s (⋃ i, f i)
/-- Construct the smallest measure space containing a collection of basic sets -/
def generateFrom (s : Set (Set α)) : MeasurableSpace α where
MeasurableSet' := GenerateMeasurable s
measurableSet_empty := .empty
measurableSet_compl := .compl
measurableSet_iUnion := .iUnion
theorem measurableSet_generateFrom {s : Set (Set α)} {t : Set α} (ht : t ∈ s) :
MeasurableSet[generateFrom s] t :=
.basic t ht
@[elab_as_elim]
theorem generateFrom_induction (p : Set α → Prop) (C : Set (Set α)) (hC : ∀ t ∈ C, p t)
(h_empty : p ∅) (h_compl : ∀ t, p t → p tᶜ)
(h_Union : ∀ f : ℕ → Set α, (∀ n, p (f n)) → p (⋃ i, f i)) {s : Set α}
(hs : MeasurableSet[generateFrom C] s) : p s := by
induction hs
exacts [hC _ ‹_›, h_empty, h_compl _ ‹_›, h_Union ‹_› ‹_›]
theorem generateFrom_le {s : Set (Set α)} {m : MeasurableSpace α}
(h : ∀ t ∈ s, MeasurableSet[m] t) : generateFrom s ≤ m :=
fun t (ht : GenerateMeasurable s t) =>
ht.recOn h .empty (fun _ _ => .compl) fun _ _ hf => .iUnion hf
theorem generateFrom_le_iff {s : Set (Set α)} (m : MeasurableSpace α) :
generateFrom s ≤ m ↔ s ⊆ { t | MeasurableSet[m] t } :=
Iff.intro (fun h _ hu => h _ <| measurableSet_generateFrom hu) fun h => generateFrom_le h
@[simp]
theorem generateFrom_measurableSet [MeasurableSpace α] :
generateFrom { s : Set α | MeasurableSet s } = ‹_› :=
le_antisymm (generateFrom_le fun _ => id) fun _ => measurableSet_generateFrom
theorem forall_generateFrom_mem_iff_mem_iff {S : Set (Set α)} {x y : α} :
(∀ s, MeasurableSet[generateFrom S] s → (x ∈ s ↔ y ∈ s)) ↔ (∀ s ∈ S, x ∈ s ↔ y ∈ s) := by
refine ⟨fun H s hs ↦ H s (.basic s hs), fun H s ↦ ?_⟩
apply generateFrom_induction
· exact H
· rfl
· exact fun _ ↦ Iff.not
· intro f hf
simp only [mem_iUnion, hf]
/-- If `g` is a collection of subsets of `α` such that the `σ`-algebra generated from `g` contains
the same sets as `g`, then `g` was already a `σ`-algebra. -/
protected def mkOfClosure (g : Set (Set α)) (hg : { t | MeasurableSet[generateFrom g] t } = g) :
MeasurableSpace α :=
(generateFrom g).copy (· ∈ g) <| Set.ext_iff.1 hg.symm
theorem mkOfClosure_sets {s : Set (Set α)} {hs : { t | MeasurableSet[generateFrom s] t } = s} :
MeasurableSpace.mkOfClosure s hs = generateFrom s :=
copy_eq _
/-- We get a Galois insertion between `σ`-algebras on `α` and `Set (Set α)` by using `generate_from`
on one side and the collection of measurable sets on the other side. -/
def giGenerateFrom : GaloisInsertion (@generateFrom α) fun m => { t | MeasurableSet[m] t } where
gc _ := generateFrom_le_iff
le_l_u _ _ := measurableSet_generateFrom
choice g hg := MeasurableSpace.mkOfClosure g <| le_antisymm hg <| (generateFrom_le_iff _).1 le_rfl
choice_eq _ _ := mkOfClosure_sets
instance : CompleteLattice (MeasurableSpace α) :=
giGenerateFrom.liftCompleteLattice
instance : Inhabited (MeasurableSpace α) := ⟨⊤⟩
@[mono]
theorem generateFrom_mono {s t : Set (Set α)} (h : s ⊆ t) : generateFrom s ≤ generateFrom t :=
giGenerateFrom.gc.monotone_l h
theorem generateFrom_sup_generateFrom {s t : Set (Set α)} :
generateFrom s ⊔ generateFrom t = generateFrom (s ∪ t) :=
(@giGenerateFrom α).gc.l_sup.symm
lemma iSup_generateFrom (s : ι → Set (Set α)) :
⨆ i, generateFrom (s i) = generateFrom (⋃ i, s i) :=
(@MeasurableSpace.giGenerateFrom α).gc.l_iSup.symm
@[simp]
lemma generateFrom_empty : generateFrom (∅ : Set (Set α)) = ⊥ :=
le_bot_iff.mp (generateFrom_le (by simp))
theorem generateFrom_singleton_empty : generateFrom {∅} = (⊥ : MeasurableSpace α) :=
bot_unique <| generateFrom_le <| by simp [@MeasurableSet.empty α ⊥]
theorem generateFrom_singleton_univ : generateFrom {Set.univ} = (⊥ : MeasurableSpace α) :=
bot_unique <| generateFrom_le <| by simp
@[simp]
theorem generateFrom_insert_univ (S : Set (Set α)) :
generateFrom (insert Set.univ S) = generateFrom S := by
rw [insert_eq, ← generateFrom_sup_generateFrom, generateFrom_singleton_univ, bot_sup_eq]
@[simp]
theorem generateFrom_insert_empty (S : Set (Set α)) :
generateFrom (insert ∅ S) = generateFrom S := by
rw [insert_eq, ← generateFrom_sup_generateFrom, generateFrom_singleton_empty, bot_sup_eq]
theorem measurableSet_bot_iff {s : Set α} : MeasurableSet[⊥] s ↔ s = ∅ ∨ s = univ :=
let b : MeasurableSpace α :=
{ MeasurableSet' := fun s => s = ∅ ∨ s = univ
measurableSet_empty := Or.inl rfl
measurableSet_compl := by simp (config := { contextual := true }) [or_imp]
measurableSet_iUnion := fun f hf => sUnion_mem_empty_univ (forall_mem_range.2 hf) }
have : b = ⊥ :=
bot_unique fun s hs =>
hs.elim (fun s => s.symm ▸ @measurableSet_empty _ ⊥) fun s =>
s.symm ▸ @MeasurableSet.univ _ ⊥
this ▸ Iff.rfl
@[simp, measurability] theorem measurableSet_top {s : Set α} : MeasurableSet[⊤] s := trivial
@[simp, nolint simpNF] -- Porting note (#11215): TODO: `simpNF` claims that
-- this lemma doesn't simplify LHS
theorem measurableSet_inf {m₁ m₂ : MeasurableSpace α} {s : Set α} :
MeasurableSet[m₁ ⊓ m₂] s ↔ MeasurableSet[m₁] s ∧ MeasurableSet[m₂] s :=
Iff.rfl
@[simp]
theorem measurableSet_sInf {ms : Set (MeasurableSpace α)} {s : Set α} :
MeasurableSet[sInf ms] s ↔ ∀ m ∈ ms, MeasurableSet[m] s :=
show s ∈ ⋂₀ _ ↔ _ by simp
theorem measurableSet_iInf {ι} {m : ι → MeasurableSpace α} {s : Set α} :
MeasurableSet[iInf m] s ↔ ∀ i, MeasurableSet[m i] s := by
rw [iInf, measurableSet_sInf, forall_mem_range]
theorem measurableSet_sup {m₁ m₂ : MeasurableSpace α} {s : Set α} :
MeasurableSet[m₁ ⊔ m₂] s ↔ GenerateMeasurable (MeasurableSet[m₁] ∪ MeasurableSet[m₂]) s :=
Iff.rfl
theorem measurableSet_sSup {ms : Set (MeasurableSpace α)} {s : Set α} :
MeasurableSet[sSup ms] s ↔
GenerateMeasurable { s : Set α | ∃ m ∈ ms, MeasurableSet[m] s } s := by
change GenerateMeasurable (⋃₀ _) _ ↔ _
simp [← setOf_exists]
theorem measurableSet_iSup {ι} {m : ι → MeasurableSpace α} {s : Set α} :
MeasurableSet[iSup m] s ↔ GenerateMeasurable { s : Set α | ∃ i, MeasurableSet[m i] s } s := by
simp only [iSup, measurableSet_sSup, exists_range_iff]
theorem measurableSpace_iSup_eq (m : ι → MeasurableSpace α) :
⨆ n, m n = generateFrom { s | ∃ n, MeasurableSet[m n] s } := by
ext s
rw [measurableSet_iSup]
rfl
theorem generateFrom_iUnion_measurableSet (m : ι → MeasurableSpace α) :
generateFrom (⋃ n, { t | MeasurableSet[m n] t }) = ⨆ n, m n :=
(@giGenerateFrom α).l_iSup_u m
end CompleteLattice
end MeasurableSpace
/-- A function `f` between measurable spaces is measurable if the preimage of every
measurable set is measurable. -/
@[fun_prop]
def Measurable [MeasurableSpace α] [MeasurableSpace β] (f : α → β) : Prop :=
∀ ⦃t : Set β⦄, MeasurableSet t → MeasurableSet (f ⁻¹' t)
namespace MeasureTheory
set_option quotPrecheck false in
/-- Notation for `Measurable` with respect to a non-standard σ-algebra in the domain. -/
scoped notation "Measurable[" m "]" => @Measurable _ _ m _
/-- Notation for `Measurable` with respect to a non-standard σ-algebra in the domain and codomain.
-/
scoped notation "Measurable[" mα ", " mβ "]" => @Measurable _ _ mα mβ
end MeasureTheory
section MeasurableFunctions
@[measurability]
theorem measurable_id {_ : MeasurableSpace α} : Measurable (@id α) := fun _ => id
@[fun_prop, measurability]
theorem measurable_id' {_ : MeasurableSpace α} : Measurable fun a : α => a := measurable_id
protected theorem Measurable.comp {_ : MeasurableSpace α} {_ : MeasurableSpace β}
{_ : MeasurableSpace γ} {g : β → γ} {f : α → β} (hg : Measurable g) (hf : Measurable f) :
Measurable (g ∘ f) :=
fun _ h => hf (hg h)
-- This is needed due to reducibility issues with the `measurability` tactic.
@[fun_prop, aesop safe 50 (rule_sets := [Measurable])]
protected theorem Measurable.comp' {_ : MeasurableSpace α} {_ : MeasurableSpace β}
{_ : MeasurableSpace γ} {g : β → γ} {f : α → β} (hg : Measurable g) (hf : Measurable f) :
Measurable (fun x => g (f x)) := Measurable.comp hg hf
@[simp, fun_prop, measurability]
theorem measurable_const {_ : MeasurableSpace α} {_ : MeasurableSpace β} {a : α} :
Measurable fun _ : β => a := fun s _ => .const (a ∈ s)
theorem Measurable.le {α} {m m0 : MeasurableSpace α} {_ : MeasurableSpace β} (hm : m ≤ m0)
{f : α → β} (hf : Measurable[m] f) : Measurable[m0] f := fun _ hs => hm _ (hf hs)
end MeasurableFunctions
/-- A typeclass mixin for `MeasurableSpace`s such that all sets are measurable. -/
class DiscreteMeasurableSpace (α : Type*) [MeasurableSpace α] : Prop where
/-- Do not use this. Use `measurableSet_discrete` instead. -/
forall_measurableSet : ∀ s : Set α, MeasurableSet s
instance : @DiscreteMeasurableSpace α ⊤ :=
@DiscreteMeasurableSpace.mk _ (_) fun _ ↦ MeasurableSpace.measurableSet_top
-- See note [lower instance priority]
instance (priority := 100) MeasurableSingletonClass.toDiscreteMeasurableSpace [MeasurableSpace α]
[MeasurableSingletonClass α] [Countable α] : DiscreteMeasurableSpace α where
forall_measurableSet _ := (Set.to_countable _).measurableSet
section DiscreteMeasurableSpace
variable [MeasurableSpace α] [MeasurableSpace β] [DiscreteMeasurableSpace α]
@[measurability] lemma measurableSet_discrete (s : Set α) : MeasurableSet s :=
DiscreteMeasurableSpace.forall_measurableSet _
@[measurability]
lemma measurable_discrete (f : α → β) : Measurable f := fun _ _ ↦ measurableSet_discrete _
/-- Warning: Creates a typeclass loop with `MeasurableSingletonClass.toDiscreteMeasurableSpace`.
To be monitored. -/
-- See note [lower instance priority]
instance (priority := 100) DiscreteMeasurableSpace.toMeasurableSingletonClass :
MeasurableSingletonClass α where
measurableSet_singleton _ := measurableSet_discrete _
end DiscreteMeasurableSpace
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.