|
| 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 |
0 commit comments