|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Yury Kudryashov. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Yury Kudryashov |
| 5 | +-/ |
| 6 | +module |
| 7 | + |
| 8 | +public import Mathlib.Analysis.Calculus.FDeriv.ContinuousMultilinearMap |
| 9 | +public import Mathlib.Analysis.Normed.Module.Alternating.Basic |
| 10 | + |
| 11 | +/-! |
| 12 | +# Derivatives of operations on continuous alternating maps |
| 13 | +
|
| 14 | +In this file we prove formulas for the derivatives of |
| 15 | +
|
| 16 | +- `ContinuousAlternatingMap.compContinuousLinearMap`, the pullback of a continuous alternating map |
| 17 | + along a continuous linear map; |
| 18 | +- application of a `ContinuousAlternatingMap` as a function of both the map and the vectors. |
| 19 | +-/ |
| 20 | + |
| 21 | +@[expose] public section |
| 22 | + |
| 23 | +variable {𝕜 ι E F G H : Type*} |
| 24 | + [NontriviallyNormedField 𝕜] |
| 25 | + [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] |
| 26 | + [NormedAddCommGroup G] [NormedSpace 𝕜 G] [NormedAddCommGroup H] [NormedSpace 𝕜 H] |
| 27 | + |
| 28 | +open ContinuousAlternatingMap |
| 29 | +open scoped Topology BigOperators |
| 30 | + |
| 31 | +section CompContinuousLinearMap |
| 32 | + |
| 33 | +variable |
| 34 | + {f : E → G [⋀^ι]→L[𝕜] H} {f' : E →L[𝕜] G [⋀^ι]→L[𝕜] H} |
| 35 | + {g : E → F →L[𝕜] G} {g' : E →L[𝕜] F →L[𝕜] G} |
| 36 | + {s : Set E} {x : E} |
| 37 | + |
| 38 | +/-! |
| 39 | +### Derivative of the pullback |
| 40 | +
|
| 41 | +In this section we prove a formula for the derivative |
| 42 | +of the pullback of a continuous alternating map along a continuous linear map, |
| 43 | +as a function of both maps. |
| 44 | +-/ |
| 45 | + |
| 46 | +theorem ContinuousAlternatingMap.hasStrictFDerivAt_toContinuousMultilinearMap_comp_iff [Finite ι] : |
| 47 | + HasStrictFDerivAt (toContinuousMultilinearMap ∘ f) (toContinuousMultilinearMapCLM 𝕜 ∘L f') x ↔ |
| 48 | + HasStrictFDerivAt f f' x := by |
| 49 | + cases nonempty_fintype ι |
| 50 | + constructor <;> intro h |
| 51 | + · rw [hasStrictFDerivAt_iff_isLittleOTVS] at h ⊢ |
| 52 | + refine Asymptotics.IsBigOTVS.trans_isLittleOTVS ?_ h |
| 53 | + simp only [Function.comp_apply, ← toContinuousMultilinearMapCLM_apply 𝕜, |
| 54 | + ContinuousLinearMap.comp_apply, ← map_sub] |
| 55 | + apply LinearMap.isBigOTVS_rev_comp |
| 56 | + simp [isEmbedding_toContinuousMultilinearMap.nhds_eq_comap] |
| 57 | + · exact (toContinuousMultilinearMapCLM 𝕜).hasStrictFDerivAt.comp x h |
| 58 | + |
| 59 | +section HasFDerivAt |
| 60 | + |
| 61 | +variable [Fintype ι] [DecidableEq ι] |
| 62 | + |
| 63 | +theorem ContinuousAlternatingMap.hasStrictFDerivAt_compContinuousLinearMap |
| 64 | + (fg : (G [⋀^ι]→L[𝕜] H) × (F →L[𝕜] G)) : |
| 65 | + HasStrictFDerivAt |
| 66 | + (fun fg : (G [⋀^ι]→L[𝕜] H) × (F →L[𝕜] G) ↦ fg.1.compContinuousLinearMap fg.2) |
| 67 | + (compContinuousLinearMapCLM fg.2 ∘L .fst _ _ _ + |
| 68 | + fg.1.fderivCompContinuousLinearMap fg.2 ∘L .snd _ _ _) |
| 69 | + fg := by |
| 70 | + rw [← hasStrictFDerivAt_toContinuousMultilinearMap_comp_iff] |
| 71 | + have H₁ := ContinuousMultilinearMap.hasStrictFDerivAt_compContinuousLinearMap |
| 72 | + (fg.1.1, fun _ : ι ↦ fg.2) |
| 73 | + have H₂ := ((toContinuousMultilinearMapCLM 𝕜).hasStrictFDerivAt (x := fg.1)) |
| 74 | + have H₃ := hasStrictFDerivAt_pi.mpr fun i : ι ↦ hasStrictFDerivAt_id (𝕜 := 𝕜) fg.2 |
| 75 | + exact H₁.comp fg (H₂.prodMap fg H₃) |
| 76 | + |
| 77 | +theorem HasStrictFDerivAt.continuousAlternatingMapCompContinuousLinearMap |
| 78 | + (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : |
| 79 | + HasStrictFDerivAt (fun x ↦ (f x).compContinuousLinearMap (g x)) |
| 80 | + (compContinuousLinearMapCLM (g x) ∘L f' + |
| 81 | + (f x).fderivCompContinuousLinearMap (g x) ∘L g') x := |
| 82 | + hasStrictFDerivAt_compContinuousLinearMap (f x, g x) |>.comp x (hf.prodMk hg) |
| 83 | + |
| 84 | +theorem HasFDerivAt.continuousAlternatingMapCompContinuousLinearMap |
| 85 | + (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : |
| 86 | + HasFDerivAt (fun x ↦ (f x).compContinuousLinearMap (g x)) |
| 87 | + (compContinuousLinearMapCLM (g x) ∘L f' + |
| 88 | + (f x).fderivCompContinuousLinearMap (g x) ∘L g') x := by |
| 89 | + convert hasStrictFDerivAt_compContinuousLinearMap (f x, (g x)) |>.hasFDerivAt |
| 90 | + |>.comp x (hf.prodMk hg) |
| 91 | + |
| 92 | +theorem HasFDerivWithinAt.continuousAlternatingMapCompContinuousLinearMap |
| 93 | + (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : |
| 94 | + HasFDerivWithinAt (fun x ↦ (f x).compContinuousLinearMap (g x)) |
| 95 | + (compContinuousLinearMapCLM (g x) ∘L f' + |
| 96 | + (f x).fderivCompContinuousLinearMap (g x) ∘L g') s x := by |
| 97 | + convert hasStrictFDerivAt_compContinuousLinearMap (f x, (g x)) |>.hasFDerivAt |
| 98 | + |>.comp_hasFDerivWithinAt x (hf.prodMk hg) |
| 99 | + |
| 100 | +theorem fderivWithin_continuousAlternatingMapCompContinuousLinearMap |
| 101 | + (hf : DifferentiableWithinAt 𝕜 f s x) (hg : DifferentiableWithinAt 𝕜 g s x) |
| 102 | + (hs : UniqueDiffWithinAt 𝕜 s x) : |
| 103 | + fderivWithin 𝕜 (fun x ↦ (f x).compContinuousLinearMap (g x)) s x = |
| 104 | + compContinuousLinearMapCLM (g x) ∘L fderivWithin 𝕜 f s x + |
| 105 | + (f x).fderivCompContinuousLinearMap (g x) ∘L fderivWithin 𝕜 g s x := |
| 106 | + hf.hasFDerivWithinAt.continuousAlternatingMapCompContinuousLinearMap (hg.hasFDerivWithinAt) |
| 107 | + |>.fderivWithin hs |
| 108 | + |
| 109 | +theorem fderiv_continuousAlternatingMapCompContinuousLinearMap |
| 110 | + (hf : DifferentiableAt 𝕜 f x) (hg : DifferentiableAt 𝕜 g x) : |
| 111 | + fderiv 𝕜 (fun x ↦ (f x).compContinuousLinearMap (g x)) x = |
| 112 | + compContinuousLinearMapCLM (g x) ∘L fderiv 𝕜 f x + |
| 113 | + (f x).fderivCompContinuousLinearMap (g x) ∘L fderiv 𝕜 g x := |
| 114 | + hf.hasFDerivAt.continuousAlternatingMapCompContinuousLinearMap (hg.hasFDerivAt) |>.fderiv |
| 115 | + |
| 116 | +end HasFDerivAt |
| 117 | + |
| 118 | +/-! |
| 119 | +### Differentiability of the pullback |
| 120 | +
|
| 121 | +In this section we prove that the pullback of a continuous alternating map |
| 122 | +along a continuous linear map is differentiable with respect to a parameter, |
| 123 | +provided that both maps are differentiable. |
| 124 | +-/ |
| 125 | + |
| 126 | +variable [Finite ι] |
| 127 | + |
| 128 | +theorem DifferentiableWithinAt.continuousAlternatingMapCompContinuousLinearMap |
| 129 | + (hf : DifferentiableWithinAt 𝕜 f s x) (hg : DifferentiableWithinAt 𝕜 g s x) : |
| 130 | + DifferentiableWithinAt 𝕜 (fun x ↦ (f x).compContinuousLinearMap (g x)) s x := by |
| 131 | + cases nonempty_fintype ι |
| 132 | + classical |
| 133 | + exact hf.hasFDerivWithinAt.continuousAlternatingMapCompContinuousLinearMap hg.hasFDerivWithinAt |
| 134 | + |>.differentiableWithinAt |
| 135 | + |
| 136 | +theorem DifferentiableAt.continuousAlternatingMapCompContinuousLinearMap |
| 137 | + (hf : DifferentiableAt 𝕜 f x) (hg : DifferentiableAt 𝕜 g x) : |
| 138 | + DifferentiableAt 𝕜 (fun x ↦ (f x).compContinuousLinearMap (g x)) x := by |
| 139 | + cases nonempty_fintype ι |
| 140 | + classical |
| 141 | + exact hf.hasFDerivAt.continuousAlternatingMapCompContinuousLinearMap hg.hasFDerivAt |
| 142 | + |>.differentiableAt |
| 143 | + |
| 144 | +end CompContinuousLinearMap |
| 145 | + |
| 146 | +/-! |
| 147 | +### Derivative of a continuous alternating map applied to a tuple of vectors |
| 148 | +
|
| 149 | +In this section we prove the formula for the derivative `D_xf(x; g_0(x), ..., g_n(x))`. |
| 150 | +-/ |
| 151 | + |
| 152 | +section Apply |
| 153 | + |
| 154 | +variable {f : E → F [⋀^ι]→L[𝕜] G} {f' : E →L[𝕜] F [⋀^ι]→L[𝕜] G} |
| 155 | + {g : ι → E → F} {g' : ι → E →L[𝕜] F} |
| 156 | + {s : Set E} {x : E} |
| 157 | + |
| 158 | +section HasFDerivAt |
| 159 | + |
| 160 | +variable [Fintype ι] [DecidableEq ι] |
| 161 | + |
| 162 | +namespace ContinuousAlternatingMap |
| 163 | + |
| 164 | +theorem hasStrictFDerivAt (f : E [⋀^ι]→L[𝕜] F) (x : ι → E) : |
| 165 | + HasStrictFDerivAt f (f.1.linearDeriv x) x := |
| 166 | + f.1.hasStrictFDerivAt x |
| 167 | + |
| 168 | +theorem hasFDerivAt (f : E [⋀^ι]→L[𝕜] F) (x : ι → E) : HasFDerivAt f (f.1.linearDeriv x) x := |
| 169 | + f.1.hasFDerivAt x |
| 170 | + |
| 171 | +theorem hasFDerivWithinAt (f : E [⋀^ι]→L[𝕜] F) (s : Set (ι → E)) (x : ι → E) : |
| 172 | + HasFDerivWithinAt f (f.1.linearDeriv x) s x := |
| 173 | + (f.hasFDerivAt x).hasFDerivWithinAt |
| 174 | + |
| 175 | +end ContinuousAlternatingMap |
| 176 | + |
| 177 | +theorem HasStrictFDerivAt.continuousAlternatingMap_apply (hf : HasStrictFDerivAt f f' x) |
| 178 | + (hg : ∀ i, HasStrictFDerivAt (g i) (g' i) x) : |
| 179 | + HasStrictFDerivAt |
| 180 | + (fun x ↦ f x (g · x)) |
| 181 | + (apply 𝕜 F G (g · x) ∘L f' + ∑ i, (f x).toContinuousLinearMap (g · x) i ∘L g' i) |
| 182 | + x := |
| 183 | + (toContinuousMultilinearMapCLM 𝕜).hasStrictFDerivAt.comp x hf |
| 184 | + |>.continuousMultilinearMap_apply hg |
| 185 | + |
| 186 | +theorem HasFDerivAt.continuousAlternatingMap_apply (hf : HasFDerivAt f f' x) |
| 187 | + (hg : ∀ i, HasFDerivAt (g i) (g' i) x) : |
| 188 | + HasFDerivAt |
| 189 | + (fun x ↦ f x (g · x)) |
| 190 | + (apply 𝕜 F G (g · x) ∘L f' + ∑ i, (f x).toContinuousLinearMap (g · x) i ∘L g' i) |
| 191 | + x := |
| 192 | + (toContinuousMultilinearMapCLM 𝕜).hasFDerivAt.comp x hf |
| 193 | + |>.continuousMultilinearMap_apply hg |
| 194 | + |
| 195 | +theorem HasFDerivWithinAt.continuousAlternatingMap_apply (hf : HasFDerivWithinAt f f' s x) |
| 196 | + (hg : ∀ i, HasFDerivWithinAt (g i) (g' i) s x) : |
| 197 | + HasFDerivWithinAt |
| 198 | + (fun x ↦ f x (g · x)) |
| 199 | + (apply 𝕜 F G (g · x) ∘L f' + ∑ i, (f x).toContinuousLinearMap (g · x) i ∘L g' i) |
| 200 | + s x := |
| 201 | + (toContinuousMultilinearMapCLM 𝕜).hasFDerivAt.comp_hasFDerivWithinAt x hf |
| 202 | + |>.continuousMultilinearMap_apply hg |
| 203 | + |
| 204 | +theorem fderivWithin_continuousAlternatingMap_apply (hf : DifferentiableWithinAt 𝕜 f s x) |
| 205 | + (hg : ∀ i, DifferentiableWithinAt 𝕜 (g i) s x) (hs : UniqueDiffWithinAt 𝕜 s x) : |
| 206 | + fderivWithin 𝕜 (fun x ↦ f x (g · x)) s x = |
| 207 | + apply 𝕜 F G (g · x) ∘L fderivWithin 𝕜 f s x + |
| 208 | + ∑ i, (f x).toContinuousLinearMap (g · x) i ∘L fderivWithin 𝕜 (g i) s x := |
| 209 | + hf.hasFDerivWithinAt.continuousAlternatingMap_apply (fun i ↦ (hg i).hasFDerivWithinAt) |
| 210 | + |>.fderivWithin hs |
| 211 | + |
| 212 | +theorem fderiv_continuousAlternatingMap_apply (hf : DifferentiableAt 𝕜 f x) |
| 213 | + (hg : ∀ i, DifferentiableAt 𝕜 (g i) x) : |
| 214 | + fderiv 𝕜 (fun x ↦ f x (g · x)) x = |
| 215 | + apply 𝕜 F G (g · x) ∘L fderiv 𝕜 f x + |
| 216 | + ∑ i, (f x).toContinuousLinearMap (g · x) i ∘L fderiv 𝕜 (g i) x := |
| 217 | + hf.hasFDerivAt.continuousAlternatingMap_apply (fun i ↦ (hg i).hasFDerivAt) |>.fderiv |
| 218 | + |
| 219 | +end HasFDerivAt |
| 220 | + |
| 221 | +variable [Finite ι] |
| 222 | + |
| 223 | +theorem DifferentiableWithinAt.continuousAlternatingMap_apply (hf : DifferentiableWithinAt 𝕜 f s x) |
| 224 | + (hg : ∀ i, DifferentiableWithinAt 𝕜 (g i) s x) : |
| 225 | + DifferentiableWithinAt 𝕜 (fun x ↦ f x (g · x)) s x := by |
| 226 | + cases nonempty_fintype ι |
| 227 | + classical |
| 228 | + exact hf.hasFDerivWithinAt.continuousAlternatingMap_apply (fun i ↦ (hg i).hasFDerivWithinAt) |
| 229 | + |>.differentiableWithinAt |
| 230 | + |
| 231 | +theorem DifferentiableAt.continuousAlternatingMap_apply (hf : DifferentiableAt 𝕜 f x) |
| 232 | + (hg : ∀ i, DifferentiableAt 𝕜 (g i) x) : DifferentiableAt 𝕜 (fun x ↦ f x (g · x)) x := by |
| 233 | + cases nonempty_fintype ι |
| 234 | + classical |
| 235 | + exact hf.hasFDerivAt.continuousAlternatingMap_apply (fun i ↦ (hg i).hasFDerivAt) |
| 236 | + |>.differentiableAt |
| 237 | + |
| 238 | +theorem DifferentiableOn.continuousAlternatingMap_apply (hf : DifferentiableOn 𝕜 f s) |
| 239 | + (hg : ∀ i, DifferentiableOn 𝕜 (g i) s) : DifferentiableOn 𝕜 (fun x ↦ f x (g · x)) s := |
| 240 | + fun x hx ↦ (hf x hx).continuousAlternatingMap_apply (hg · x hx) |
| 241 | + |
| 242 | +theorem Differentiable.continuousAlternatingMap_apply (hf : Differentiable 𝕜 f) |
| 243 | + (hg : ∀ i, Differentiable 𝕜 (g i)) : Differentiable 𝕜 (fun x ↦ f x (g · x)) := |
| 244 | + fun x ↦ (hf x).continuousAlternatingMap_apply (hg · x) |
| 245 | + |
| 246 | +theorem ContinuousAlternatingMap.differentiable (f : E [⋀^ι]→L[𝕜] F) : Differentiable 𝕜 f := by |
| 247 | + cases nonempty_fintype ι |
| 248 | + apply Differentiable.continuousAlternatingMap_apply <;> fun_prop |
| 249 | + |
| 250 | +end Apply |
0 commit comments