Skip to content

Commit 85ded51

Browse files
committed
feat: extend ContDiff to take a smoothness exponent in WithTop ℕ∞ (#19442)
This is mathematically not meaningful at all, since the definition of `C^∞` and `C^ω` functions is the same in this PR. However, this opens the way to replacing the definition of `C^ω` with analytic in #17152. So, the current PR is just an intermediate step towards #17152, but making sure that the final diff will be smaller than the current +1280 lines changes. There is *no* mathematical content in the current PR: it's mostly adapting the library to provide an element of `WithTop ℕ∞` when it was expecting an element of `ℕ∞` before. In the locale `ContDiff`, we introduce two notations `ω` for `⊤ : WithTop ℕ∞ ` and `∞` for `(⊤ : ℕ∞) : WithTop ℕ∞`. A lot of the changes are to open the locale and use `∞` at suitable places.
1 parent f2336c4 commit 85ded51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+483
-373
lines changed

Archive/Hairer.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ noncomputable section
2626
open Metric Set MeasureTheory
2727
open MvPolynomial hiding support
2828
open Function hiding eval
29+
open scoped ContDiff
2930

3031
variable {ι : Type*} [Fintype ι]
3132

@@ -110,7 +111,7 @@ lemma inj_L : Injective (L ι) :=
110111
apply subset_closure
111112

112113
lemma hairer (N : ℕ) (ι : Type*) [Fintype ι] :
113-
∃ (ρ : EuclideanSpace ℝ ι → ℝ), tsupport ρ ⊆ closedBall 0 1 ∧ ContDiff ℝ ρ ∧
114+
∃ (ρ : EuclideanSpace ℝ ι → ℝ), tsupport ρ ⊆ closedBall 0 1 ∧ ContDiff ℝ ρ ∧
114115
∀ (p : MvPolynomial ι ℝ), p.totalDegree ≤ N →
115116
∫ x : EuclideanSpace ℝ ι, eval x p • ρ x = eval 0 p := by
116117
have := (inj_L ι).comp (restrictTotalDegree ι ℝ N).injective_subtype

Mathlib/Analysis/Calculus/AddTorsor/AffineMap.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ variable [NormedAddCommGroup V] [NormedSpace 𝕜 V]
2525
variable [NormedAddCommGroup W] [NormedSpace 𝕜 W]
2626

2727
/-- A continuous affine map between normed vector spaces is smooth. -/
28-
theorem contDiff {n : ℕ∞} (f : V →ᴬ[𝕜] W) : ContDiff 𝕜 n f := by
28+
theorem contDiff {n : WithTop ℕ∞} (f : V →ᴬ[𝕜] W) : ContDiff 𝕜 n f := by
2929
rw [f.decomp]
3030
apply f.contLinear.contDiff.add
3131
exact contDiff_const

Mathlib/Analysis/Calculus/BumpFunction/Basic.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ smooth function, smooth bump function
4949
noncomputable section
5050

5151
open Function Set Filter
52-
open scoped Topology Filter
52+
open scoped Topology Filter ContDiff
5353

5454
variable {E X : Type*}
5555

@@ -80,7 +80,7 @@ structure ContDiffBumpBase (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E
8080
toFun : ℝ → E → ℝ
8181
mem_Icc : ∀ (R : ℝ) (x : E), toFun R x ∈ Icc (0 : ℝ) 1
8282
symmetric : ∀ (R : ℝ) (x : E), toFun R (-x) = toFun R x
83-
smooth : ContDiffOn ℝ (uncurry toFun) (Ioi (1 : ℝ) ×ˢ (univ : Set E))
83+
smooth : ContDiffOn ℝ (uncurry toFun) (Ioi (1 : ℝ) ×ˢ (univ : Set E))
8484
eq_one : ∀ R : ℝ, 1 < R → ∀ x : E, ‖x‖ ≤ 1 → toFun R x = 1
8585
support : ∀ R : ℝ, 1 < R → Function.support (toFun R) = Metric.ball (0 : E) R
8686

@@ -178,7 +178,8 @@ protected theorem _root_.ContDiffWithinAt.contDiffBump {c g : X → E} {s : Set
178178
ContDiffWithinAt ℝ n (fun x => f x (g x)) s x := by
179179
change ContDiffWithinAt ℝ n (uncurry (someContDiffBumpBase E).toFun ∘ fun x : X =>
180180
((f x).rOut / (f x).rIn, (f x).rIn⁻¹ • (g x - c x))) s x
181-
refine (((someContDiffBumpBase E).smooth.contDiffAt ?_).of_le le_top).comp_contDiffWithinAt x ?_
181+
refine (((someContDiffBumpBase E).smooth.contDiffAt ?_).of_le
182+
(mod_cast le_top)).comp_contDiffWithinAt x ?_
182183
· exact prod_mem_nhds (Ioi_mem_nhds (f x).one_lt_rOut_div_rIn) univ_mem
183184
· exact (hR.div hr (f x).rIn_pos.ne').prod ((hr.inv (f x).rIn_pos.ne').smul (hg.sub hc))
184185

Mathlib/Analysis/Calculus/BumpFunction/FiniteDimension.lean

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ noncomputable section
2828
open Set Metric TopologicalSpace Function Asymptotics MeasureTheory Module
2929
ContinuousLinearMap Filter MeasureTheory.Measure Bornology
3030

31-
open scoped Pointwise Topology NNReal Convolution
31+
open scoped Pointwise Topology NNReal Convolution ContDiff
3232

3333
variable {E : Type*} [NormedAddCommGroup E]
3434

@@ -40,7 +40,7 @@ variable [NormedSpace ℝ E] [FiniteDimensional ℝ E]
4040
values in `[0, 1]`, supported in `s` and with `f x = 1`. -/
4141
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
4242
∃ f : E → ℝ,
43-
tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
43+
tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
4444
obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ :=
4545
Euclidean.nhds_basis_closedBall.mem_iff.1 hs
4646
let c : ContDiffBump (toEuclidean x) :=
@@ -73,7 +73,7 @@ theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) :
7373
/-- Given an open set `s` in a finite-dimensional real normed vector space, there exists a smooth
7474
function with values in `[0, 1]` whose support is exactly `s`. -/
7575
theorem IsOpen.exists_smooth_support_eq {s : Set E} (hs : IsOpen s) :
76-
∃ f : E → ℝ, f.support = s ∧ ContDiff ℝ f ∧ Set.range f ⊆ Set.Icc 0 1 := by
76+
∃ f : E → ℝ, f.support = s ∧ ContDiff ℝ f ∧ Set.range f ⊆ Set.Icc 0 1 := by
7777
/- For any given point `x` in `s`, one can construct a smooth function with support in `s` and
7878
nonzero at `x`. By second-countability, it follows that we may cover `s` with the supports of
7979
countably many such functions, say `g i`.
@@ -85,7 +85,7 @@ theorem IsOpen.exists_smooth_support_eq {s : Set E} (hs : IsOpen s) :
8585
· exact
8686
fun _ => 0, Function.support_zero, contDiff_const, by
8787
simp only [range_const, singleton_subset_iff, left_mem_Icc, zero_le_one]⟩
88-
let ι := { f : E → ℝ // f.support ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ f ∧ range f ⊆ Icc 0 1 }
88+
let ι := { f : E → ℝ // f.support ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ f ∧ range f ⊆ Icc 0 1 }
8989
obtain ⟨T, T_count, hT⟩ : ∃ T : Set ι, T.Countable ∧ ⋃ f ∈ T, support (f : E → ℝ) = s := by
9090
have : ⋃ f : ι, (f : E → ℝ).support = s := by
9191
refine Subset.antisymm (iUnion_subset fun f => f.2.1) ?_
@@ -116,7 +116,7 @@ theorem IsOpen.exists_smooth_support_eq {s : Set E} (hs : IsOpen s) :
116116
rcases iT with ⟨n, hn⟩
117117
rw [← hn] at hi
118118
exact ⟨n, hi⟩
119-
have g_smooth : ∀ n, ContDiff ℝ (g n) := fun n => (g0 n).2.2.2.1
119+
have g_smooth : ∀ n, ContDiff ℝ (g n) := fun n => (g0 n).2.2.2.1
120120
have g_comp_supp : ∀ n, HasCompactSupport (g n) := fun n => (g0 n).2.2.1
121121
have g_nonneg : ∀ n x, 0 ≤ g n x := fun n x => ((g0 n).2.2.2.2 (mem_range_self x)).1
122122
obtain ⟨δ, δpos, c, δc, c_lt⟩ :
@@ -127,8 +127,8 @@ theorem IsOpen.exists_smooth_support_eq {s : Set E} (hs : IsOpen s) :
127127
have : ∀ i, ∃ R, ∀ x, ‖iteratedFDeriv ℝ i (fun x => g n x) x‖ ≤ R := by
128128
intro i
129129
have : BddAbove (range fun x => ‖iteratedFDeriv ℝ i (fun x : E => g n x) x‖) := by
130-
apply
131-
((g_smooth n).continuous_iteratedFDeriv le_top).norm.bddAbove_range_of_hasCompactSupport
130+
apply ((g_smooth n).continuous_iteratedFDeriv
131+
(mod_cast le_top)).norm.bddAbove_range_of_hasCompactSupport
132132
apply HasCompactSupport.comp_left _ norm_zero
133133
apply (g_comp_supp n).iteratedFDeriv
134134
rcases this with ⟨R, hR⟩
@@ -148,7 +148,8 @@ theorem IsOpen.exists_smooth_support_eq {s : Set E} (hs : IsOpen s) :
148148
refine ⟨M⁻¹ * δ n, by positivity, fun i hi x => ?_⟩
149149
calc
150150
‖iteratedFDeriv ℝ i ((M⁻¹ * δ n) • g n) x‖ = ‖(M⁻¹ * δ n) • iteratedFDeriv ℝ i (g n) x‖ := by
151-
rw [iteratedFDeriv_const_smul_apply]; exact (g_smooth n).of_le le_top
151+
rw [iteratedFDeriv_const_smul_apply]
152+
exact (g_smooth n).of_le (mod_cast le_top)
152153
_ = M⁻¹ * δ n * ‖iteratedFDeriv ℝ i (g n) x‖ := by
153154
rw [norm_smul _ (iteratedFDeriv ℝ i (g n) x), Real.norm_of_nonneg]; positivity
154155
_ ≤ M⁻¹ * δ n * M := (mul_le_mul_of_nonneg_left ((hR i x).trans (IR i hi)) (by positivity))
@@ -207,10 +208,10 @@ variable (E)
207208

208209
theorem u_exists :
209210
∃ u : E → ℝ,
210-
ContDiff ℝ u ∧ (∀ x, u x ∈ Icc (0 : ℝ) 1) ∧ support u = ball 0 1 ∧ ∀ x, u (-x) = u x := by
211+
ContDiff ℝ u ∧ (∀ x, u x ∈ Icc (0 : ℝ) 1) ∧ support u = ball 0 1 ∧ ∀ x, u (-x) = u x := by
211212
have A : IsOpen (ball (0 : E) 1) := isOpen_ball
212213
obtain ⟨f, f_support, f_smooth, f_range⟩ :
213-
∃ f : E → ℝ, f.support = ball (0 : E) 1 ∧ ContDiff ℝ f ∧ Set.range f ⊆ Set.Icc 0 1 :=
214+
∃ f : E → ℝ, f.support = ball (0 : E) 1 ∧ ContDiff ℝ f ∧ Set.range f ⊆ Set.Icc 0 1 :=
214215
A.exists_smooth_support_eq
215216
have B : ∀ x, f x ∈ Icc (0 : ℝ) 1 := fun x => f_range (mem_range_self x)
216217
refine ⟨fun x => (f x + f (-x)) / 2, ?_, ?_, ?_, ?_⟩
@@ -243,7 +244,7 @@ def u (x : E) : ℝ :=
243244

244245
variable (E)
245246

246-
theorem u_smooth : ContDiff ℝ (u : E → ℝ) :=
247+
theorem u_smooth : ContDiff ℝ (u : E → ℝ) :=
247248
(Classical.choose_spec (u_exists E)).1
248249

249250
theorem u_continuous : Continuous (u : E → ℝ) :=
@@ -433,7 +434,7 @@ theorem y_pos_of_mem_ball {D : ℝ} {x : E} (Dpos : 0 < D) (D_lt_one : D < 1)
433434

434435
variable (E)
435436

436-
theorem y_smooth : ContDiffOn ℝ (uncurry y) (Ioo (0 : ℝ) 1 ×ˢ (univ : Set E)) := by
437+
theorem y_smooth : ContDiffOn ℝ (uncurry y) (Ioo (0 : ℝ) 1 ×ˢ (univ : Set E)) := by
437438
have hs : IsOpen (Ioo (0 : ℝ) (1 : ℝ)) := isOpen_Ioo
438439
have hk : IsCompact (closedBall (0 : E) 1) := ProperSpace.isCompact_closedBall _ _
439440
refine contDiffOn_convolution_left_with_param (lsmul ℝ ℝ) hs hk ?_ ?_ ?_
@@ -489,7 +490,7 @@ instance (priority := 100) {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E
489490
· rfl
490491
smooth := by
491492
suffices
492-
ContDiffOn ℝ
493+
ContDiffOn ℝ
493494
(uncurry y ∘ fun p : ℝ × E => ((p.1 - 1) / (p.1 + 1), ((p.1 + 1) / 2)⁻¹ • p.2))
494495
(Ioi 1 ×ˢ univ) by
495496
apply this.congr

0 commit comments

Comments
 (0)