Skip to content

Commit 6e8bf48

Browse files
committed
feat(Analysis/ContDiff): smooth compactly supported functions are dense in Lp (#31079)
1 parent 9389269 commit 6e8bf48

File tree

5 files changed

+137
-17
lines changed

5 files changed

+137
-17
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ public import Mathlib.Analysis.Normed.Lp.LpEquiv
19201920
public import Mathlib.Analysis.Normed.Lp.MeasurableSpace
19211921
public import Mathlib.Analysis.Normed.Lp.PiLp
19221922
public import Mathlib.Analysis.Normed.Lp.ProdLp
1923+
public import Mathlib.Analysis.Normed.Lp.SmoothApprox
19231924
public import Mathlib.Analysis.Normed.Lp.WithLp
19241925
public import Mathlib.Analysis.Normed.Lp.lpSpace
19251926
public import Mathlib.Analysis.Normed.Module.Alternating.Basic
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/-
2+
Copyright (c) 2025 Moritz Doll. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Moritz Doll
5+
-/
6+
module
7+
8+
public import Mathlib.Geometry.Manifold.SmoothApprox
9+
public import Mathlib.MeasureTheory.Function.ContinuousMapDense
10+
public import Mathlib.Tactic.MoveAdd
11+
12+
/-!
13+
14+
# Density of smooth compactly supported functions in `Lp`
15+
16+
In this file, we prove that `Lp` functions can be approximated by smooth compactly supported
17+
functions for `p < ∞`.
18+
19+
This result is recorded in `MeasureTheory.MemLp.exist_sub_eLpNorm_le`.
20+
-/
21+
22+
variable {α β E F : Type*} [MeasurableSpace E] [NormedAddCommGroup F]
23+
24+
open scoped Nat NNReal ContDiff
25+
open MeasureTheory Pointwise ENNReal
26+
27+
namespace HasCompactSupport
28+
29+
variable [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [BorelSpace E]
30+
[NormedSpace ℝ F]
31+
(μ : Measure E := by volume_tac) [IsFiniteMeasureOnCompacts μ]
32+
33+
/-- For every continuous compactly supported function `f`there exists a smooth compactly supported
34+
function `g` such that `f - g` is arbitrary small in the `Lp`-norm for `p < ∞`. -/
35+
theorem exist_eLpNorm_sub_le_of_continuous {p : ℝ≥0∞} (hp : p ≠ ⊤) {ε : ℝ} (hε : 0 < ε) {f : E → F}
36+
(h₁ : HasCompactSupport f) (h₂ : Continuous f) :
37+
∃ (g : E → F), HasCompactSupport g ∧ ContDiff ℝ ∞ g ∧
38+
eLpNorm (f - g) p μ ≤ ENNReal.ofReal ε := by
39+
by_cases hf : f =ᵐ[μ] 0
40+
-- We will need that the support is non-empty, so we treat the trivial case `f = 0` first.
41+
· use 0
42+
simpa [HasCompactSupport.zero, eLpNorm_congr_ae hf] using contDiff_const
43+
have hs₁ : μ (tsupport f) ≠ ⊤ := h₁.measure_lt_top.ne
44+
have hs₂ : 0 < (μ <| tsupport f).toReal := by
45+
-- Since `f` is not the zero function `tsupport f` has positive measure
46+
rw [← Measure.measure_support_eq_zero_iff _] at hf
47+
exact toReal_pos (pos_mono (subset_tsupport f) (pos_of_ne_zero hf)).ne' hs₁
48+
set ε' := ε * (μ <| tsupport f).toReal ^ (-(1 / p.toReal)) with ε'_def
49+
have hε' : 0 < ε' := by positivity
50+
have hε₂ : ENNReal.ofReal ε' * μ (tsupport f) ^ (1 / p.toReal) ≤ ENNReal.ofReal ε := by
51+
rw [← ofReal_toReal hs₁, ofReal_rpow_of_pos hs₂, ← ofReal_mul hε'.le,
52+
ofReal_le_ofReal_iff hε.le, ε'_def, mul_assoc, ← Real.rpow_add hs₂, neg_add_cancel,
53+
Real.rpow_zero, mul_one]
54+
obtain ⟨g, hg₁, hg₂, hg₃⟩ := h₂.exists_contDiff_approx ⊤ (ε := fun _ ↦ ε') (by fun_prop)
55+
(by intro; positivity)
56+
refine ⟨g, h₁.mono hg₃, hg₁, (eLpNorm_sub_le_of_dist_bdd μ hp h₁.measurableSet hε'.le ?_
57+
(subset_tsupport f) (hg₃.trans (subset_tsupport f))).trans hε₂⟩
58+
intro x
59+
rw [dist_comm]
60+
exact (hg₂ x).le
61+
62+
end HasCompactSupport
63+
64+
namespace MeasureTheory.MemLp
65+
66+
variable [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [BorelSpace E]
67+
[NormedSpace ℝ F]
68+
{μ : Measure E} [IsFiniteMeasureOnCompacts μ]
69+
70+
/-- Every `Lp` function can be approximated by a smooth compactly supported function provided that
71+
`p < ∞`. -/
72+
theorem exist_eLpNorm_sub_le {p : ℝ≥0∞} (hp : p ≠ ⊤) (hp₂ : 1 ≤ p) {f : E → F} (hf : MemLp f p μ)
73+
{ε : ℝ} (hε : 0 < ε) :
74+
∃ g, HasCompactSupport g ∧ ContDiff ℝ ∞ g ∧ eLpNorm (f - g) p μ ≤ ENNReal.ofReal ε := by
75+
-- We use a standard ε / 2 argument to deduce the result from the approximation for
76+
-- continuous compactly supported functions.
77+
have hε₂ : 0 < ε / 2 := by positivity
78+
have hε₂' : 0 < ENNReal.ofReal (ε / 2) := by positivity
79+
obtain ⟨g, hg₁, hg₂, hg₃, hg₄⟩ := hf.exists_hasCompactSupport_eLpNorm_sub_le hp hε₂'.ne'
80+
obtain ⟨g', hg'₁, hg'₂, hg'₃⟩ := hg₁.exist_eLpNorm_sub_le_of_continuous μ hp hε₂ hg₃
81+
refine ⟨g', hg'₁, hg'₂, ?_⟩
82+
have : f - g' = (f - g) - (g' - g) := by simp
83+
grw [this, eLpNorm_sub_le (hf.aestronglyMeasurable.sub hg₄.aestronglyMeasurable)
84+
(hg'₂.continuous.aestronglyMeasurable.sub hg₄.aestronglyMeasurable) hp₂, hg₂,
85+
eLpNorm_sub_comm, hg'₃, ← ENNReal.ofReal_add hε₂.le hε₂.le, add_halves]
86+
87+
theorem _root_.MeasureTheory.Lp.dense_hasCompactSupport_contDiff {p : ℝ≥0∞} (hp : p ≠ ⊤)
88+
[hp₂ : Fact (1 ≤ p)] :
89+
Dense {f : Lp F p μ | ∃ (g : E → F), f =ᵐ[μ] g ∧ HasCompactSupport g ∧ ContDiff ℝ ∞ g} := by
90+
intro f
91+
refine (mem_closure_iff_nhds_basis Metric.nhds_basis_closedBall).2 fun ε hε ↦ ?_
92+
obtain ⟨g, hg₁, hg₂, hg₃⟩ := exist_eLpNorm_sub_le hp hp₂.out (Lp.memLp f) hε
93+
have hg₄ : MemLp g p μ := hg₂.continuous.memLp_of_hasCompactSupport hg₁
94+
use hg₄.toLp
95+
use ⟨g, hg₄.coeFn_toLp, hg₁, hg₂⟩
96+
rw [Metric.mem_closedBall, dist_comm, Lp.dist_def,
97+
← le_ofReal_iff_toReal_le ((Lp.memLp f).sub (Lp.memLp hg₄.toLp)).eLpNorm_ne_top hε.le]
98+
convert hg₃ using 1
99+
apply eLpNorm_congr_ae
100+
gcongr
101+
exact hg₄.coeFn_toLp
102+
103+
end MeasureTheory.MemLp

Mathlib/MeasureTheory/Function/LpSeminorm/Basic.lean

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,32 @@ protected lemma MemLp.piecewise {f : α → ε} [DecidablePred (· ∈ s)] {g} (
754754
rw [setLIntegral_congr_fun hs.compl h]
755755
exact lintegral_rpow_enorm_lt_top_of_eLpNorm_lt_top hp_zero hp_top hg.2
756756

757+
theorem eLpNorm_indicator_sub_le_of_dist_bdd {β : Type*} [NormedAddCommGroup β]
758+
(μ : Measure α := by volume_tac) (hp' : p ≠ ∞) (hs : MeasurableSet s)
759+
{f g : α → β} {c : ℝ} (hc : 0 ≤ c) (hf : ∀ x ∈ s, dist (f x) (g x) ≤ c) :
760+
eLpNorm (s.indicator (f - g)) p μ ≤ ENNReal.ofReal c * μ s ^ (1 / p.toReal) := by
761+
by_cases hp : p = 0
762+
· simp [hp]
763+
have : ∀ x, ‖s.indicator (f - g) x‖ ≤ ‖s.indicator (fun _ => c) x‖ := by
764+
intro x
765+
by_cases hx : x ∈ s
766+
· rw [Set.indicator_of_mem hx, Set.indicator_of_mem hx, Pi.sub_apply, ← dist_eq_norm,
767+
Real.norm_eq_abs, abs_of_nonneg hc]
768+
exact hf x hx
769+
· simp [Set.indicator_of_notMem hx]
770+
grw [eLpNorm_mono this, eLpNorm_indicator_const hs hp hp', ← ofReal_norm_eq_enorm,
771+
Real.norm_eq_abs, abs_of_nonneg hc]
772+
773+
theorem eLpNorm_sub_le_of_dist_bdd {β : Type*} [NormedAddCommGroup β]
774+
(μ : Measure α := by volume_tac) (hp : p ≠ ⊤) (hs : MeasurableSet s) {c : ℝ} (hc : 0 ≤ c)
775+
{f g : α → β} (h : ∀ x, dist (f x) (g x) ≤ c) (hs₁ : f.support ⊆ s) (hs₂ : g.support ⊆ s) :
776+
eLpNorm (f - g) p μ ≤ ENNReal.ofReal c * μ s ^ (1 / p.toReal) := by
777+
have hs₃ : s.indicator (f - g) = f - g := by
778+
rw [Set.indicator_eq_self]
779+
exact (Function.support_sub _ _).trans (Set.union_subset hs₁ hs₂)
780+
rw [← hs₃]
781+
exact eLpNorm_indicator_sub_le_of_dist_bdd μ hp hs hc (fun x _ ↦ h x)
782+
757783
end Indicator
758784

759785
section ENormedAddMonoid
@@ -1481,3 +1507,5 @@ theorem MemLp.exists_eLpNorm_indicator_compl_lt {β : Type*} [NormedAddCommGroup
14811507
end UnifTight
14821508
end Lp
14831509
end MeasureTheory
1510+
1511+
set_option linter.style.longFile 1700

Mathlib/MeasureTheory/Function/UniformIntegrable.lean

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -452,22 +452,6 @@ theorem unifIntegrable_finite [Finite ι] (hp_one : 1 ≤ p) (hp_top : p ≠ ∞
452452

453453
end
454454

455-
theorem eLpNorm_sub_le_of_dist_bdd (μ : Measure α)
456-
{p : ℝ≥0∞} (hp' : p ≠ ∞) {s : Set α} (hs : MeasurableSet[m] s)
457-
{f g : α → β} {c : ℝ} (hc : 0 ≤ c) (hf : ∀ x ∈ s, dist (f x) (g x) ≤ c) :
458-
eLpNorm (s.indicator (f - g)) p μ ≤ ENNReal.ofReal c * μ s ^ (1 / p.toReal) := by
459-
by_cases hp : p = 0
460-
· simp [hp]
461-
have : ∀ x, ‖s.indicator (f - g) x‖ ≤ ‖s.indicator (fun _ => c) x‖ := by
462-
intro x
463-
by_cases hx : x ∈ s
464-
· rw [Set.indicator_of_mem hx, Set.indicator_of_mem hx, Pi.sub_apply, ← dist_eq_norm,
465-
Real.norm_eq_abs, abs_of_nonneg hc]
466-
exact hf x hx
467-
· simp [Set.indicator_of_notMem hx]
468-
grw [eLpNorm_mono this, eLpNorm_indicator_const hs hp hp', ← ofReal_norm_eq_enorm,
469-
Real.norm_eq_abs, abs_of_nonneg hc]
470-
471455
/-- A sequence of uniformly integrable functions which converges μ-a.e. converges in Lp. -/
472456
theorem tendsto_Lp_finite_of_tendsto_ae_of_meas [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
473457
{f : ℕ → α → β} {g : α → β} (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
@@ -509,7 +493,7 @@ theorem tendsto_Lp_finite_of_tendsto_ae_of_meas [IsFiniteMeasure μ] (hp : 1 ≤
509493
have hlt : eLpNorm (tᶜ.indicator (f n - g)) p μ ≤ ENNReal.ofReal (ε.toReal / 3) := by
510494
specialize hN n hn
511495
have : 0 ≤ ε.toReal / (3 * measureUnivNNReal μ ^ (1 / p.toReal)) := by positivity
512-
have := eLpNorm_sub_le_of_dist_bdd μ hp' htm.compl this fun x hx =>
496+
have := eLpNorm_indicator_sub_le_of_dist_bdd μ hp' htm.compl this fun x hx =>
513497
(dist_comm (g x) (f n x) ▸ (hN x hx).le :
514498
dist (f n x) (g x) ≤ ε.toReal / (3 * measureUnivNNReal μ ^ (1 / p.toReal)))
515499
refine le_trans this ?_

Mathlib/MeasureTheory/Measure/MeasureSpace.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,10 @@ lemma nonempty_of_neZero (μ : Measure α) [NeZero μ] : Nonempty α :=
11771177
(isEmpty_or_nonempty α).resolve_left fun h ↦ by
11781178
simpa [eq_empty_of_isEmpty] using NeZero.ne (μ univ)
11791179

1180+
theorem measure_support_eq_zero_iff {E : Type*} [Zero E] (μ : Measure α := by volume_tac)
1181+
{f : α → E} : μ f.support = 0 ↔ f =ᵐ[μ] 0 := by
1182+
rfl
1183+
11801184
section Sum
11811185
variable {f : ι → Measure α}
11821186

0 commit comments

Comments
 (0)