|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Chris Birkbeck. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Chris Birkbeck |
| 5 | +-/ |
| 6 | +import Mathlib.Analysis.Calculus.IteratedDeriv.Defs |
| 7 | +import Mathlib.Analysis.Calculus.UniformLimitsDeriv |
| 8 | +import Mathlib.Analysis.NormedSpace.FunctionSeries |
| 9 | +import Mathlib.Topology.Algebra.InfiniteSum.UniformOn |
| 10 | + |
| 11 | +/-! |
| 12 | +# Differentiability of sum of functions |
| 13 | +
|
| 14 | +We prove some `HasSumUniformlyOn` versions of theorems from |
| 15 | +`Mathlib.Analysis.NormedSpace.FunctionSeries`. |
| 16 | +
|
| 17 | +Alongside this we prove `derivWithin_tsum` which states that the derivative of a series of functions |
| 18 | +is the sum of the derivatives, under suitable conditions we also prove an `iteratedDerivWithin` |
| 19 | +version. |
| 20 | +
|
| 21 | +-/ |
| 22 | + |
| 23 | +open Set Metric TopologicalSpace Function Filter |
| 24 | + |
| 25 | +open scoped Topology NNReal |
| 26 | + |
| 27 | +section UniformlyOn |
| 28 | + |
| 29 | +variable {α β F : Type*} [NormedAddCommGroup F] [CompleteSpace F] {u : α → ℝ} |
| 30 | + |
| 31 | +theorem HasSumUniformlyOn.of_norm_le_summable {f : α → β → F} (hu : Summable u) {s : Set β} |
| 32 | + (hfu : ∀ n x, x ∈ s → ‖f n x‖ ≤ u n) : HasSumUniformlyOn f (fun x ↦ ∑' n, f n x) {s} := by |
| 33 | + simp [hasSumUniformlyOn_iff_tendstoUniformlyOn, tendstoUniformlyOn_tsum hu hfu] |
| 34 | + |
| 35 | +theorem HasSumUniformlyOn.of_norm_le_summable_eventually {ι : Type*} {f : ι → β → F} {u : ι → ℝ} |
| 36 | + (hu : Summable u) {s : Set β} (hfu : ∀ᶠ n in cofinite, ∀ x ∈ s, ‖f n x‖ ≤ u n) : |
| 37 | + HasSumUniformlyOn f (fun x ↦ ∑' n, f n x) {s} := by |
| 38 | + simp [hasSumUniformlyOn_iff_tendstoUniformlyOn, |
| 39 | + tendstoUniformlyOn_tsum_of_cofinite_eventually hu hfu] |
| 40 | + |
| 41 | +lemma SummableLocallyUniformlyOn.of_locally_bounded_eventually [TopologicalSpace β] |
| 42 | + [LocallyCompactSpace β] {f : α → β → F} {s : Set β} (hs : IsOpen s) |
| 43 | + (hu : ∀ K ⊆ s, IsCompact K → ∃ u : α → ℝ, Summable u ∧ |
| 44 | + ∀ᶠ n in cofinite, ∀ k ∈ K, ‖f n k‖ ≤ u n) : SummableLocallyUniformlyOn f s := by |
| 45 | + apply HasSumLocallyUniformlyOn.summableLocallyUniformlyOn (g := fun x ↦ ∑' n, f n x) |
| 46 | + rw [hasSumLocallyUniformlyOn_iff_tendstoLocallyUniformlyOn, |
| 47 | + tendstoLocallyUniformlyOn_iff_forall_isCompact hs] |
| 48 | + intro K hK hKc |
| 49 | + obtain ⟨u, hu1, hu2⟩ := hu K hK hKc |
| 50 | + exact tendstoUniformlyOn_tsum_of_cofinite_eventually hu1 hu2 |
| 51 | + |
| 52 | +lemma SummableLocallyUniformlyOn_of_locally_bounded [TopologicalSpace β] [LocallyCompactSpace β] |
| 53 | + {f : α → β → F} {s : Set β} (hs : IsOpen s) |
| 54 | + (hu : ∀ K ⊆ s, IsCompact K → ∃ u : α → ℝ, Summable u ∧ ∀ n, ∀ k ∈ K, ‖f n k‖ ≤ u n) : |
| 55 | + SummableLocallyUniformlyOn f s := by |
| 56 | + apply SummableLocallyUniformlyOn.of_locally_bounded_eventually hs |
| 57 | + intro K hK hKc |
| 58 | + obtain ⟨u, hu1, hu2⟩ := hu K hK hKc |
| 59 | + exact ⟨u, hu1, by filter_upwards using hu2⟩ |
| 60 | + |
| 61 | +end UniformlyOn |
| 62 | + |
| 63 | +variable {ι F E : Type*} [NontriviallyNormedField E] [IsRCLikeNormedField E] |
| 64 | + [NormedAddCommGroup F] [NormedSpace E F] {s : Set E} |
| 65 | + |
| 66 | +/-- The `derivWithin` of a sum whose derivative is absolutely and uniformly convergent sum on an |
| 67 | +open set `s` is the sum of the derivatives of sequence of functions on the open set `s` -/ |
| 68 | +theorem derivWithin_tsum {f : ι → E → F} (hs : IsOpen s) {x : E} (hx : x ∈ s) |
| 69 | + (hf : ∀ y ∈ s, Summable fun n ↦ f n y) |
| 70 | + (h : SummableLocallyUniformlyOn (fun n ↦ (derivWithin (fun z ↦ f n z) s)) s) |
| 71 | + (hf2 : ∀ n r, r ∈ s → DifferentiableAt E (f n) r) : |
| 72 | + derivWithin (fun z ↦ ∑' n , f n z) s x = ∑' n, derivWithin (f n) s x := by |
| 73 | + apply HasDerivWithinAt.derivWithin ?_ (hs.uniqueDiffWithinAt hx) |
| 74 | + apply HasDerivAt.hasDerivWithinAt |
| 75 | + apply hasDerivAt_of_tendstoLocallyUniformlyOn hs _ _ (fun y hy ↦(hf y hy).hasSum ) hx |
| 76 | + (f' := fun n : Finset ι ↦ fun a ↦ ∑ i ∈ n, derivWithin (fun z ↦ f i z) s a) |
| 77 | + · obtain ⟨g, hg⟩ := h |
| 78 | + apply (hasSumLocallyUniformlyOn_iff_tendstoLocallyUniformlyOn.mp hg).congr_right |
| 79 | + exact fun _ hb ↦ Eq.symm (hg.tsum_eqOn hb) |
| 80 | + · filter_upwards with t r hr using HasDerivAt.fun_sum |
| 81 | + (fun q hq ↦ ((hf2 q r hr).differentiableWithinAt.hasDerivWithinAt.hasDerivAt) |
| 82 | + (hs.mem_nhds hr)) |
| 83 | + |
| 84 | +/-- If a sequence of functions `fₙ` is such that `∑ fₙ (z)` is summable for each `z` in an |
| 85 | +open set `s`, and for each `1 ≤ k ≤ m`, the series of `k`-th iterated derivatives |
| 86 | +`∑ (iteratedDerivWithin k fₙ s) (z)` |
| 87 | +is summable locally uniformly on `s`, and each `fₙ` is `m`-times differentiable, then the `m`-th |
| 88 | +iterated derivative of the sum is the sum of the `m`-th iterated derivatives. -/ |
| 89 | +theorem iteratedDerivWithin_tsum {f : ι → E → F} (m : ℕ) (hs : IsOpen s) |
| 90 | + {x : E} (hx : x ∈ s) (hsum : ∀ t ∈ s, Summable (fun n : ι ↦ f n t)) |
| 91 | + (h : ∀ k, 1 ≤ k → k ≤ m → SummableLocallyUniformlyOn |
| 92 | + (fun n ↦ (iteratedDerivWithin k (fun z ↦ f n z) s)) s) |
| 93 | + (hf2 : ∀ n k r, k ≤ m → r ∈ s → |
| 94 | + DifferentiableAt E (iteratedDerivWithin k (fun z ↦ f n z) s) r) : |
| 95 | + iteratedDerivWithin m (fun z ↦ ∑' n , f n z) s x = ∑' n, iteratedDerivWithin m (f n) s x := by |
| 96 | + induction' m with m hm generalizing x |
| 97 | + · simp |
| 98 | + · simp_rw [iteratedDerivWithin_succ] |
| 99 | + rw [← derivWithin_tsum hs hx _ _ (fun n r hr ↦ hf2 n m r (by omega) hr)] |
| 100 | + · exact derivWithin_congr (fun t ht ↦ hm ht (fun k hk1 hkm ↦ h k hk1 (by omega)) |
| 101 | + (fun k r e hr he ↦ hf2 k r e (by omega) he)) (hm hx (fun k hk1 hkm ↦ h k hk1 (by omega)) |
| 102 | + (fun k r e hr he ↦ hf2 k r e (by omega) he)) |
| 103 | + · intro r hr |
| 104 | + by_cases hm2 : m = 0 |
| 105 | + · simp [hm2, hsum r hr] |
| 106 | + · exact ((h m (by omega) (by omega)).summable hr).congr (fun _ ↦ by simp) |
| 107 | + · exact SummableLocallyUniformlyOn_congr |
| 108 | + (fun _ _ ht ↦ iteratedDerivWithin_succ) (h (m + 1) (by omega) (by omega)) |
0 commit comments