Skip to content

Commit

Permalink
feat: bound the measure of a set by the integral of a function, from …
Browse files Browse the repository at this point in the history
…above and from below (#8123)

Also weaken some T2 space assumptions in some integration lemmas.

---------

Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com>
  • Loading branch information
sgouezel and hrmacbeth committed Nov 7, 2023
1 parent 18d2099 commit 61adfa9
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 29 deletions.
49 changes: 29 additions & 20 deletions Mathlib/MeasureTheory/Function/LocallyIntegrable.lean
Expand Up @@ -370,69 +370,78 @@ open MeasureTheory

section borel

variable [OpensMeasurableSpace X] [IsLocallyFiniteMeasure μ]
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 [SecondCountableTopologyEither X E] (hf : Continuous f) :
LocallyIntegrable f μ :=
theorem Continuous.locallyIntegrable [IsLocallyFiniteMeasure μ] [SecondCountableTopologyEither X E]
(hf : Continuous f) : LocallyIntegrable f μ :=
hf.integrableAt_nhds
#align continuous.locally_integrable Continuous.locallyIntegrable

/-- A function `f` continuous on a set `K` is locally integrable on this set with respect
to any locally finite measure. -/
theorem ContinuousOn.locallyIntegrableOn [SecondCountableTopologyEither X E] (hf : ContinuousOn f K)
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
#align continuous_on.locally_integrable_on ContinuousOn.locallyIntegrableOn

variable [MetrizableSpace X]
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) (hf : ContinuousOn f K) :
theorem ContinuousOn.integrableOn_compact'
(hK : IsCompact K) (h'K : MeasurableSet K) (hf : ContinuousOn f K) :
IntegrableOn f K μ := by
letI := metrizableSpaceMetric X
refine' LocallyIntegrableOn.integrableOn_isCompact (fun x hx => _) hK
exact hf.integrableAt_nhdsWithin_of_isSeparable hK.measurableSet hK.isSeparable hx
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
#align continuous_on.integrable_on_compact ContinuousOn.integrableOn_compact

theorem ContinuousOn.integrableOn_Icc [Preorder X] [CompactIccSpace X]
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
#align continuous_on.integrable_on_Icc ContinuousOn.integrableOn_Icc

theorem Continuous.integrableOn_Icc [Preorder X] [CompactIccSpace X] (hf : Continuous f) :
IntegrableOn f (Icc a b) μ :=
theorem Continuous.integrableOn_Icc [Preorder X] [CompactIccSpace X] [T2Space X]
(hf : Continuous f) : IntegrableOn f (Icc a b) μ :=
hf.continuousOn.integrableOn_Icc
#align continuous.integrable_on_Icc Continuous.integrableOn_Icc

theorem Continuous.integrableOn_Ioc [Preorder X] [CompactIccSpace X] (hf : Continuous f) :
IntegrableOn f (Ioc a b) μ :=
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
#align continuous.integrable_on_Ioc Continuous.integrableOn_Ioc

theorem ContinuousOn.integrableOn_uIcc [LinearOrder X] [CompactIccSpace X]
theorem ContinuousOn.integrableOn_uIcc [LinearOrder X] [CompactIccSpace X] [T2Space X]
(hf : ContinuousOn f [[a, b]]) : IntegrableOn f [[a, b]] μ :=
hf.integrableOn_Icc
#align continuous_on.integrable_on_uIcc ContinuousOn.integrableOn_uIcc

theorem Continuous.integrableOn_uIcc [LinearOrder X] [CompactIccSpace X] (hf : Continuous f) :
IntegrableOn f [[a, b]] μ :=
theorem Continuous.integrableOn_uIcc [LinearOrder X] [CompactIccSpace X] [T2Space X]
(hf : Continuous f) : IntegrableOn f [[a, b]] μ :=
hf.integrableOn_Icc
#align continuous.integrable_on_uIcc Continuous.integrableOn_uIcc

theorem Continuous.integrableOn_uIoc [LinearOrder X] [CompactIccSpace X] (hf : Continuous f) :
IntegrableOn f (Ι a b) μ :=
theorem Continuous.integrableOn_uIoc [LinearOrder X] [CompactIccSpace X] [T2Space X]
(hf : Continuous f) : IntegrableOn f (Ι a b) μ :=
hf.integrableOn_Ioc
#align continuous.integrable_on_uIoc Continuous.integrableOn_uIoc

/-- 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
hf.continuousOn.integrableOn_compact' hcf (isClosed_tsupport _).measurableSet
#align continuous.integrable_of_has_compact_support Continuous.integrable_of_hasCompactSupport

end borel
Expand Down
5 changes: 5 additions & 0 deletions Mathlib/MeasureTheory/Integral/Bochner.lean
Expand Up @@ -1584,6 +1584,11 @@ theorem integral_smul_measure (f : α → G) (c : ℝ≥0∞) :
exact setToFun_congr_left' _ _ (fun s _ _ => weightedSMul_smul_measure μ c) f
#align measure_theory.integral_smul_measure MeasureTheory.integral_smul_measure

@[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
Expand Down
53 changes: 44 additions & 9 deletions Mathlib/MeasureTheory/Integral/Lebesgue.lean
Expand Up @@ -758,19 +758,30 @@ theorem lintegral_rw₂ {f₁ f₁' : α → β} {f₂ f₂' : α → γ} (h₁
lintegral_congr_ae <| h₁.mp <| h₂.mono fun _ h₂ h₁ => by dsimp only; rw [h₁, h₂]
#align measure_theory.lintegral_rw₂ MeasureTheory.lintegral_rw₂

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']
apply le_antisymm <;> refine' iSup_mono' (Subtype.forall.2 fun φ hφ => _)
· refine' ⟨⟨φ, le_trans hφ (indicator_le_self _ _)⟩, _⟩
refine' SimpleFunc.lintegral_mono (fun x => _) le_rfl
by_cases hx : x ∈ s
· simp [hx, hs, le_refl]
· apply le_trans (hφ x)
simp [hx, hs, le_refl]
· refine' ⟨⟨φ.restrict s, fun x => _⟩, le_rfl⟩
simp [hφ x, hs, indicator_le_indicator]
refine' iSup_mono' (Subtype.forall.2 fun φ hφ => _)
refine' ⟨⟨φ.restrict s, fun x => _⟩, le_rfl⟩
simp [hφ x, hs, indicator_le_indicator]
#align measure_theory.lintegral_indicator MeasureTheory.lintegral_indicator

theorem lintegral_indicator₀ (f : α → ℝ≥0∞) {s : Set α} (hs : NullMeasurableSet s μ) :
Expand All @@ -780,6 +791,10 @@ theorem lintegral_indicator₀ (f : α → ℝ≥0∞) {s : Set α} (hs : NullMe
Measure.restrict_congr_set hs.toMeasurable_ae_eq]
#align measure_theory.lintegral_indicator₀ MeasureTheory.lintegral_indicator₀

theorem lintegral_indicator_const_le (s : Set α) (c : ℝ≥0∞) :
∫⁻ a, s.indicator (fun _ => c) a ∂μ ≤ c * μ s :=
(lintegral_indicator_le _ _).trans (set_lintegral_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, set_lintegral_const]
Expand All @@ -797,6 +812,13 @@ theorem set_lintegral_eq_const {f : α → ℝ≥0∞} (hf : Measurable f) (r :
exact hf (measurableSet_singleton r)
#align measure_theory.set_lintegral_eq_const MeasureTheory.set_lintegral_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₀ (hs : NullMeasurableSet s μ) : ∫⁻ a, s.indicator 1 a ∂μ = μ s :=
(lintegral_indicator_const₀ hs _).trans $ one_mul _

@[simp]
theorem lintegral_indicator_one (hs : MeasurableSet s) : ∫⁻ a, s.indicator 1 a ∂μ = μ s :=
(lintegral_indicator_const hs _).trans $ one_mul _
Expand Down Expand Up @@ -836,6 +858,19 @@ theorem mul_meas_ge_le_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) (ε
mul_meas_ge_le_lintegral₀ hf.aemeasurable ε
#align measure_theory.mul_meas_ge_le_lintegral MeasureTheory.mul_meas_ge_le_lintegral

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 <|
Expand Down
31 changes: 31 additions & 0 deletions Mathlib/MeasureTheory/Integral/SetIntegral.lean
Expand Up @@ -810,6 +810,37 @@ theorem set_integral_nonpos_le {s : Set α} (hs : MeasurableSet s) (hf : Strongl
(hfi.indicator hs) (indicator_nonpos_le_indicator s f)
#align measure_theory.set_integral_nonpos_le MeasureTheory.set_integral_nonpos_le

lemma Integrable.measure_le_integral {f : α → ℝ} (f_int : Integrable f μ) (f_nonneg : 0 ≤ᵐ[μ] f)
{s : Set α} (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 : α → ℝ} {s : Set α}
(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 using hs x H
· apply le_trans _ zero_le_one
simpa using h's x H
· intro x hx
simpa using h's x hx

end Nonneg

section IntegrableUnion
Expand Down

0 comments on commit 61adfa9

Please sign in to comment.