Navier–Stokes: the Lean blow-up proof, cleaned up together
OpenAI's 2026 Lean proofs of blowup for forced Navier–Stokes and Euler, rerun by others, not refereed, no ruling from Clay; cleaned up together: more readable, faster to build

| 1 | import NavierStokes.ParametricTorusInverse |
| 2 | import Mathlib.Analysis.Calculus.ContDiff.Bounds |
| 3 | import Mathlib.Analysis.Normed.Module.FiniteDimension |
| 4 | |
| 5 | /-! |
| 6 | # Actual torus inversion for smooth finite-dimensional parameter families |
| 7 | |
| 8 | The source is an actual jointly smooth function. Fourier coefficients are |
| 9 | the unit-square integrals of that source. No output regularity or decay |
| 10 | assumptions are part of the construction. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | namespace NavierStokes.SmoothFamilyTorusInverse |
| 16 | |
| 17 | open Set Filter MeasureTheory TorusInverse |
| 18 | open scoped Topology ContDiff BigOperators |
| 19 | |
| 20 | abbrev Point (P : Type) := P × Plane |
| 21 | abbrev Source (P : Type) := Point P → ℂ |
| 22 | |
| 23 | variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 24 | |
| 25 | noncomputable def slice (f : Source P) (p : P) : Plane → ℂ := fun Y => f (p, Y) |
| 26 | |
| 27 | def Periodic (f : Source P) : Prop := |
| 28 | ∀ p, SmoothFourierData.UnitPeriodic (slice f p) |
| 29 | |
| 30 | noncomputable def coefficient (f : Source P) (p : P) (k : Frequency) : ℂ := |
| 31 | SmoothFourierData.coefficient (slice f p) k |
| 32 | |
| 33 | noncomputable def mean (f : Source P) (p : P) : ℂ := coefficient f p 0 |
| 34 | def ZeroMean (f : Source P) : Prop := ∀ p, mean f p = 0 |
| 35 | |
| 36 | noncomputable def inverse (d : Direction) (f : Source P) (z : Point P) : ℂ := |
| 37 | directionalInverse d (coefficient f z.1) z.2 |
| 38 | |
| 39 | noncomputable def fixedPartial (v : Point P) (f : Source P) (z : Point P) : ℂ := |
| 40 | fderiv ℝ f z v |
| 41 | |
| 42 | noncomputable def parameterPartial (v : P) (f : Source P) : Source P := |
| 43 | fixedPartial (v, 0) f |
| 44 | |
| 45 | noncomputable def parameterDerivative (f : Source P) (z : Point P) : P →L[ℝ] ℂ := |
| 46 | (fderiv ℝ f z).comp (ContinuousLinearMap.inl ℝ P Plane) |
| 47 | |
| 48 | noncomputable def torusXJet (n : ℕ) (f : Source P) : Source P := |
| 49 | (fixedPartial (0, (1, 0)))^[n] f |
| 50 | |
| 51 | noncomputable def swapTorus (f : Source P) : Source P := |
| 52 | fun z => f (z.1, (z.2.2, z.2.1)) |
| 53 | |
| 54 | theorem slice_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) (p : P) : |
| 55 | ContDiff ℝ ∞ (slice f p) := |
| 56 | hf.comp (contDiff_const.prodMk contDiff_id) |
| 57 | |
| 58 | theorem fixedPartial_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) (v : Point P) : |
| 59 | ContDiff ℝ ∞ (fixedPartial v f) := |
| 60 | (ContinuousLinearMap.apply ℝ ℂ v).contDiff.comp (hf.fderiv_right (by simp)) |
| 61 | |
| 62 | theorem parameterPartial_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) (v : P) : |
| 63 | ContDiff ℝ ∞ (parameterPartial v f) := fixedPartial_smooth hf (v, 0) |
| 64 | |
| 65 | theorem parameterDerivative_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) : |
| 66 | ContDiff ℝ ∞ (parameterDerivative f) := |
| 67 | (hf.fderiv_right (by simp)).clm_comp contDiff_const |
| 68 | |
| 69 | theorem fixedPartial_periodic {f : Source P} (hp : Periodic f) (v : Point P) : |
| 70 | Periodic (fixedPartial v f) := by |
| 71 | intro p Y k |
| 72 | have he : (fun z : Point P => f (z + (0, ((k.1 : ℝ), (k.2 : ℝ))))) = f := by |
| 73 | funext z |
| 74 | change f (z.1 + 0, z.2 + ((k.1 : ℝ), (k.2 : ℝ))) = f (z.1, z.2) |
| 75 | simpa [slice] using hp z.1 z.2 k |
| 76 | have hd := congrArg (fun g : Source P => fderiv ℝ g (p, Y)) he |
| 77 | rw [fderiv_comp_add_right] at hd |
| 78 | simpa only [slice, fixedPartial, Prod.mk_add_mk, add_zero] using |
| 79 | congrArg (fun L : Point P →L[ℝ] ℂ => L v) hd |
| 80 | |
| 81 | theorem parameterPartial_periodic {f : Source P} (hp : Periodic f) (v : P) : |
| 82 | Periodic (parameterPartial v f) := fixedPartial_periodic hp (v, 0) |
| 83 | |
| 84 | theorem torusXJet_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) (n : ℕ) : |
| 85 | ContDiff ℝ ∞ (torusXJet n f) := by |
| 86 | induction n with |
| 87 | | zero => exact hf |
| 88 | | succ n ih => |
| 89 | rw [torusXJet, Function.iterate_succ_apply'] |
| 90 | exact fixedPartial_smooth ih _ |
| 91 | |
| 92 | theorem swapTorus_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) : |
| 93 | ContDiff ℝ ∞ (swapTorus f) := |
| 94 | hf.comp (contDiff_fst.prodMk (contDiff_snd.snd.prodMk contDiff_snd.fst)) |
| 95 | |
| 96 | theorem slice_hasFDerivAt {f : Source P} (hf : ContDiff ℝ ∞ f) (p : P) (Y : Plane) : |
| 97 | HasFDerivAt (slice f p) |
| 98 | ((fderiv ℝ f (p, Y)).comp (ContinuousLinearMap.inr ℝ P Plane)) Y := |
| 99 | ((hf.differentiable (by simp)) (p, Y)).hasFDerivAt.comp Y |
| 100 | ((hasFDerivAt_const p Y).prodMk (hasFDerivAt_id Y)) |
| 101 | |
| 102 | theorem parameter_hasFDerivAt {f : Source P} (hf : ContDiff ℝ ∞ f) (p : P) (Y : Plane) : |
| 103 | HasFDerivAt (fun q => f (q, Y)) (parameterDerivative f (p, Y)) p := |
| 104 | ((hf.differentiable (by simp)) (p, Y)).hasFDerivAt.comp p |
| 105 | ((hasFDerivAt_id p).prodMk (hasFDerivAt_const Y p)) |
| 106 | |
| 107 | theorem slice_torusXJet {f : Source P} (hf : ContDiff ℝ ∞ f) (n : ℕ) (p : P) : |
| 108 | slice (torusXJet n f) p = SmoothFourierData.xJet n (slice f p) := by |
| 109 | induction n with |
| 110 | | zero => rfl |
| 111 | | succ n ih => |
| 112 | rw [torusXJet, Function.iterate_succ_apply', SmoothFourierData.xJet_succ, ← ih] |
| 113 | funext Y |
| 114 | exact (congrArg (fun L : Plane →L[ℝ] ℂ => L (1, 0)) |
| 115 | (slice_hasFDerivAt (torusXJet_smooth hf n) p Y).fderiv).symm |
| 116 | |
| 117 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 118 | theorem mean_eq_integral (f : Source P) (p : P) : |
| 119 | mean f p = ∫ y in (0 : ℝ)..1, ∫ x in (0 : ℝ)..1, f (p, (x, y)) := |
| 120 | SmoothFourierData.coefficient_zero_eq_integral _ |
| 121 | |
| 122 | noncomputable def weightedSource (k : Frequency) (f : Source P) (q : (P × ℝ) × ℝ) : ℂ := |
| 123 | SmoothFourierData.kernel k (q.2, q.1.2) * f (q.1.1, (q.2, q.1.2)) |
| 124 | |
| 125 | theorem weightedSource_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) (k : Frequency) : |
| 126 | ContDiff ℝ ∞ (weightedSource k f) := |
| 127 | ((ParametricTorusInverse.kernel_smooth k).comp |
| 128 | (contDiff_snd.prodMk contDiff_fst.snd)).mul |
| 129 | (hf.comp (contDiff_fst.fst.prodMk (contDiff_snd.prodMk contDiff_fst.snd))) |
| 130 | |
| 131 | theorem coefficient_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) (k : Frequency) : |
| 132 | ContDiff ℝ ∞ (fun p => coefficient f p k) := by |
| 133 | have hi := TransportPrimitive.parameterIntegral_contDiff (weightedSource_smooth hf k) 0 1 |
| 134 | have ho := TransportPrimitive.parameterIntegral_contDiff hi 0 1 |
| 135 | simpa only [coefficient, SmoothFourierData.coefficient_eq_doubleIntegral, |
| 136 | weightedSource, slice] using ho |
| 137 | |
| 138 | /-- Restricting the actual family to a line only changes its external |
| 139 | parameter. It leaves every torus Fourier integral unchanged. -/ |
| 140 | noncomputable def lineSource (f : Source P) (p v : P) : ParametricTorusInverse.Source := |
| 141 | fun z => f (p + z.1 • v, z.2) |
| 142 | |
| 143 | theorem lineSource_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) (p v : P) : |
| 144 | ContDiff ℝ ∞ (lineSource f p v) := |
| 145 | hf.comp ((contDiff_const.add (contDiff_fst.smul contDiff_const)).prodMk contDiff_snd) |
| 146 | |
| 147 | theorem parameterPartial_lineSource {f : Source P} (hf : ContDiff ℝ ∞ f) (p v : P) : |
| 148 | ParametricTorusInverse.parameterPartial (lineSource f p v) = |
| 149 | lineSource (parameterPartial v f) p v := by |
| 150 | funext z |
| 151 | have hd : HasDerivAt (fun t : ℝ => f (p + t • v, z.2)) |
| 152 | (parameterPartial v f (p + z.1 • v, z.2)) z.1 := by |
| 153 | apply ((hf.differentiable (by simp)) (p + z.1 • v, z.2)).hasFDerivAt.comp_hasDerivAt z.1 |
| 154 | simpa only [one_smul, id_eq] using |
| 155 | (((hasDerivAt_id z.1).smul_const v |>.const_add p).prodMk |
| 156 | (hasDerivAt_const z.1 z.2)) |
| 157 | exact (ParametricTorusInverse.parameter_slice_hasDerivAt |
| 158 | (lineSource_smooth hf p v) z.1 z.2).unique hd |
| 159 | |
| 160 | theorem coefficient_fderiv_apply {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 161 | (k : Frequency) (p v : P) : |
| 162 | fderiv ℝ (fun q => coefficient f q k) p v = |
| 163 | coefficient (parameterPartial v f) p k := by |
| 164 | have hline : HasFDerivAt (fun q => coefficient f q k) |
| 165 | (fderiv ℝ (fun q => coefficient f q k) p) p := |
| 166 | ((coefficient_smooth hf k).differentiable (by simp) p).hasFDerivAt |
| 167 | have hd : HasDerivAt (fun t : ℝ => coefficient f (p + t • v) k) |
| 168 | (fderiv ℝ (fun q => coefficient f q k) p v) 0 := by |
| 169 | apply hline.comp_hasDerivAt_of_eq (0 : ℝ) |
| 170 | · simpa only [one_smul, id_eq] using (((hasDerivAt_id (0 : ℝ)).smul_const v).const_add p) |
| 171 | · simp |
| 172 | have hs := ParametricTorusInverse.coefficient_hasDerivAt (lineSource_smooth hf p v) k 0 |
| 173 | rw [parameterPartial_lineSource hf p v] at hs |
| 174 | change HasDerivAt (fun t : ℝ => coefficient f (p + t • v) k) |
| 175 | (coefficient (parameterPartial v f) (p + (0 : ℝ) • v) k) 0 at hs |
| 176 | simpa only [zero_smul, add_zero] using hd.unique hs |
| 177 | |
| 178 | theorem parameterPartial_zeroMean {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 179 | (hm : ZeroMean f) (v : P) : ZeroMean (parameterPartial v f) := by |
| 180 | intro p |
| 181 | have he : (fun q => coefficient f q 0) = fun _ => (0 : ℂ) := funext hm |
| 182 | have hd := coefficient_fderiv_apply hf 0 p v |
| 183 | rw [he] at hd |
| 184 | simp only [fderiv_fun_const] at hd |
| 185 | exact hd.symm |
| 186 | |
| 187 | theorem exists_uniform_coefficient_bound {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 188 | (hp : Periodic f) (n : ℕ) {K : Set P} (hK : IsCompact K) : |
| 189 | ∃ C : ℝ, 0 ≤ C ∧ ∀ p ∈ K, ∀ k, |
| 190 | weight k ^ n * ‖coefficient f p k‖ ≤ C := by |
| 191 | let T : Set (Point P) := K ×ˢ (Icc (0 : ℝ) 1 ×ˢ Icc (0 : ℝ) 1) |
| 192 | have hT : IsCompact T := hK.prod (isCompact_Icc.prod isCompact_Icc) |
| 193 | obtain ⟨C₀, h₀⟩ := hT.exists_bound_of_continuousOn hf.continuous.continuousOn |
| 194 | obtain ⟨C₁, h₁⟩ := hT.exists_bound_of_continuousOn |
| 195 | (torusXJet_smooth hf n).continuous.continuousOn |
| 196 | obtain ⟨C₂, h₂⟩ := hT.exists_bound_of_continuousOn |
| 197 | (torusXJet_smooth (swapTorus_smooth hf) n).continuous.continuousOn |
| 198 | let C := max 0 (max C₀ (max C₁ C₂)) |
| 199 | have hC : 0 ≤ C := le_max_left _ _ |
| 200 | have hC₀ : C₀ ≤ C := (le_max_left _ _).trans (le_max_right _ _) |
| 201 | have hC₁ : C₁ ≤ C := ((le_max_left _ _).trans (le_max_right _ _)).trans (le_max_right _ _) |
| 202 | have hC₂ : C₂ ≤ C := ((le_max_right _ _).trans (le_max_right _ _)).trans (le_max_right _ _) |
| 203 | refine ⟨3 ^ n * C, mul_nonneg (by positivity) hC, ?_⟩ |
| 204 | intro p hparam k |
| 205 | apply SmoothFourierData.coefficient_polynomial_bound (slice_smooth hf p) (hp p) n |
| 206 | · intro x hx y hy |
| 207 | exact (h₀ (p, (x, y)) ⟨hparam, hx, hy⟩).trans hC₀ |
| 208 | · intro x hx y hy |
| 209 | rw [← slice_torusXJet hf n p] |
| 210 | exact (h₁ (p, (x, y)) ⟨hparam, hx, hy⟩).trans hC₁ |
| 211 | · intro x hx y hy |
| 212 | change ‖SmoothFourierData.xJet n (slice (swapTorus f) p) (x, y)‖ ≤ C |
| 213 | rw [← slice_torusXJet (swapTorus_smooth hf) n p] |
| 214 | exact (h₂ (p, (x, y)) ⟨hparam, hx, hy⟩).trans hC₂ |
| 215 | |
| 216 | open ParametricTorusInverse (PolynomialGrowth multiplierX multiplierY) |
| 217 | |
| 218 | noncomputable def applyMultiplier (m : Frequency → ℂ) (f : Source P) (z : Point P) : ℂ := |
| 219 | series (fun k => m k * coefficient f z.1 k) z.2 |
| 220 | |
| 221 | theorem multiplied_coeff_rapid {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 222 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (p : P) : |
| 223 | Rapid (fun k => m k * coefficient f p k) := |
| 224 | hm.rapid_mul (SmoothFourierData.rapid_coefficient (slice_smooth hf p) (hp p)) |
| 225 | |
| 226 | theorem uniform_multiplied_coeff_bound {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 227 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) |
| 228 | {K : Set P} (hK : IsCompact K) : |
| 229 | ∃ C : ℝ, 0 ≤ C ∧ ∀ p ∈ K, ∀ k, |
| 230 | ‖m k * coefficient f p k‖ ≤ C * (weight k ^ 4)⁻¹ := by |
| 231 | obtain ⟨s, M, hM, hm⟩ := hm |
| 232 | obtain ⟨B, hB, hb⟩ := exists_uniform_coefficient_bound hf hp (s + 4) hK |
| 233 | exact ⟨M * B, mul_nonneg hM hB, |
| 234 | fun p hp k => ParametricTorusInverse.multiplied_coeff_bound hM hm (hb p hp) k⟩ |
| 235 | |
| 236 | section JetNorms |
| 237 | |
| 238 | variable {E F G : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 239 | [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] |
| 240 | |
| 241 | theorem norm_jet_partial {f : E → F} (hf : ContDiff ℝ ∞ f) (v : E) (n : ℕ) (z : E) : |
| 242 | ‖iteratedFDeriv ℝ n (fun x => fderiv ℝ f x v) z‖ ≤ |
| 243 | ‖v‖ * ‖iteratedFDeriv ℝ (n + 1) f z‖ := by |
| 244 | simpa only [norm_iteratedFDeriv_fderiv] using |
| 245 | (norm_iteratedFDeriv_clm_apply_const |
| 246 | (hf.fderiv_right (by simp)).contDiffAt (by exact_mod_cast le_top : (n : WithTop ℕ∞) ≤ ∞) |
| 247 | (c := v) (x := z)) |
| 248 | |
| 249 | theorem norm_jet_linear (L : F →L[ℝ] G) {f : E → F} |
| 250 | (hf : ContDiff ℝ ∞ f) (n : ℕ) (z : E) : |
| 251 | ‖iteratedFDeriv ℝ n (fun x => L (f x)) z‖ ≤ |
| 252 | ‖L‖ * ‖iteratedFDeriv ℝ n f z‖ := by |
| 253 | rw [show (fun x => L (f x)) = L ∘ f from rfl, |
| 254 | L.iteratedFDeriv_comp_left hf.contDiffAt (by exact_mod_cast le_top : (n : WithTop ℕ∞) ≤ ∞)] |
| 255 | exact L.norm_compContinuousMultilinearMap_le _ |
| 256 | |
| 257 | theorem norm_jet_add {f g : E → F} (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) |
| 258 | (n : ℕ) (z : E) : |
| 259 | ‖iteratedFDeriv ℝ n (fun x => f x + g x) z‖ ≤ |
| 260 | ‖iteratedFDeriv ℝ n f z‖ + ‖iteratedFDeriv ℝ n g z‖ := by |
| 261 | change ‖iteratedFDeriv ℝ n (f + g) z‖ ≤ _ |
| 262 | rw [iteratedFDeriv_add_apply (hf.of_le (by exact_mod_cast le_top)).contDiffAt |
| 263 | (hg.of_le (by exact_mod_cast le_top)).contDiffAt] |
| 264 | exact norm_add_le _ _ |
| 265 | |
| 266 | theorem norm_jet_sum {ι : Type} [Fintype ι] {f : ι → E → F} |
| 267 | (hf : ∀ i, ContDiff ℝ ∞ (f i)) (n : ℕ) (z : E) : |
| 268 | ‖iteratedFDeriv ℝ n (fun x => ∑ i, f i x) z‖ ≤ |
| 269 | ∑ i, ‖iteratedFDeriv ℝ n (f i) z‖ := by |
| 270 | have he := iteratedFDeriv_sum (fun i (_ : i ∈ (Finset.univ : Finset ι)) => |
| 271 | (hf i).of_le (show (n : WithTop ℕ∞) ≤ ∞ by exact_mod_cast le_top)) |
| 272 | rw [he] |
| 273 | simpa only [Finset.sum_apply] using norm_sum_le Finset.univ (fun i => iteratedFDeriv ℝ n (f i) z) |
| 274 | |
| 275 | noncomputable def repeatPartial (v : E) (n : ℕ) (f : E → F) : E → F := |
| 276 | (fun g x => fderiv ℝ g x v)^[n] f |
| 277 | |
| 278 | theorem norm_repeatPartial {f : E → F} (hf : ContDiff ℝ ∞ f) |
| 279 | (v : E) (n : ℕ) (z : E) : |
| 280 | ‖repeatPartial v n f z‖ ≤ ‖v‖ ^ n * ‖iteratedFDeriv ℝ n f z‖ := by |
| 281 | induction n generalizing f with |
| 282 | | zero => simp [repeatPartial] |
| 283 | | succ n ih => |
| 284 | rw [repeatPartial, Function.iterate_succ_apply] |
| 285 | have hp : ContDiff ℝ ∞ (fun x => fderiv ℝ f x v) := |
| 286 | (ContinuousLinearMap.apply ℝ F v).contDiff.comp (hf.fderiv_right (by simp)) |
| 287 | calc |
| 288 | _ ≤ ‖v‖ ^ n * ‖iteratedFDeriv ℝ n (fun x => fderiv ℝ f x v) z‖ := ih hp |
| 289 | _ ≤ ‖v‖ ^ n * (‖v‖ * ‖iteratedFDeriv ℝ (n + 1) f z‖) := |
| 290 | mul_le_mul_of_nonneg_left (norm_jet_partial hf v n z) (by positivity) |
| 291 | _ = _ := by rw [pow_succ]; ring |
| 292 | |
| 293 | |
| 294 | end JetNorms |
| 295 | |
| 296 | section TorusWords |
| 297 | variable {G H : Type} [NormedAddCommGroup G] [NormedSpace ℝ G] |
| 298 | [NormedAddCommGroup H] [NormedSpace ℝ H] |
| 299 | |
| 300 | noncomputable def tensorTorusWord : List Bool → (Plane → G) → Plane → G |
| 301 | | [], g => g |
| 302 | | b :: w, g => fun Y => fderiv ℝ (tensorTorusWord w g) Y |
| 303 | (if b then (0, 1) else (1, 0)) |
| 304 | |
| 305 | theorem tensorTorusWord_smooth {g : Plane → G} (hg : ContDiff ℝ ∞ g) (w : List Bool) : |
| 306 | ContDiff ℝ ∞ (tensorTorusWord w g) := by |
| 307 | induction w with |
| 308 | | nil => exact hg |
| 309 | | cons b w ih => |
| 310 | have hd : ContDiff ℝ ∞ (fderiv ℝ (tensorTorusWord w g)) := |
| 311 | ih.fderiv_right (by simp) |
| 312 | exact (ContinuousLinearMap.apply ℝ G (if b then (0, 1) else (1, 0))).contDiff.comp |
| 313 | hd |
| 314 | |
| 315 | theorem tensorTorusWord_map (L : G →L[ℝ] H) {g : Plane → G} |
| 316 | (hg : ContDiff ℝ ∞ g) (w : List Bool) : |
| 317 | tensorTorusWord w (fun Y => L (g Y)) = fun Y => L (tensorTorusWord w g Y) := by |
| 318 | induction w with |
| 319 | | nil => rfl |
| 320 | | cons b w ih => |
| 321 | funext Y |
| 322 | simp only [tensorTorusWord, ih] |
| 323 | have hd := L.hasFDerivAt.comp Y |
| 324 | (((tensorTorusWord_smooth hg w).differentiable (by simp)) Y).hasFDerivAt |
| 325 | exact congrArg (fun M : Plane →L[ℝ] H => M (if b then (0, 1) else (1, 0))) hd.fderiv |
| 326 | |
| 327 | end TorusWords |
| 328 | |
| 329 | theorem tensorTorusWord_scalar (g : Plane → ℂ) (w : List Bool) : |
| 330 | tensorTorusWord w g = derivativeWord w g := by |
| 331 | induction w with |
| 332 | | nil => rfl |
| 333 | | cons b w ih => |
| 334 | simp only [tensorTorusWord, derivativeWord, ih] |
| 335 | rfl |
| 336 | |
| 337 | theorem tensorTorusWord_replicate (g : Plane → ℂ) (n : ℕ) : |
| 338 | tensorTorusWord (List.replicate n false) g = SmoothFourierData.xJet n g := by |
| 339 | induction n with |
| 340 | | zero => rfl |
| 341 | | succ n ih => |
| 342 | rw [List.replicate_succ, tensorTorusWord, SmoothFourierData.xJet_succ, ih] |
| 343 | rfl |
| 344 | |
| 345 | |
| 346 | section FiniteDimensional |
| 347 | |
| 348 | variable [FiniteDimensional ℝ P] |
| 349 | |
| 350 | abbrev BasisIndex (P : Type) [NormedAddCommGroup P] [NormedSpace ℝ P] := |
| 351 | Fin (Module.finrank ℝ P) |
| 352 | |
| 353 | noncomputable def parameterBasis : Module.Basis (BasisIndex P) ℝ P := Module.finBasis ℝ P |
| 354 | noncomputable def parameterCoord (i : BasisIndex P) : P →L[ℝ] ℝ := |
| 355 | ((parameterBasis (P := P)).coord i).toContinuousLinearMap |
| 356 | |
| 357 | noncomputable def parameterLift (i : BasisIndex P) : ℂ →L[ℝ] (Point P →L[ℝ] ℂ) := |
| 358 | ContinuousLinearMap.smulRightL ℝ (Point P) ℂ |
| 359 | ((parameterCoord i).comp (ContinuousLinearMap.fst ℝ P Plane)) |
| 360 | |
| 361 | noncomputable def torusLiftX : ℂ →L[ℝ] (Point P →L[ℝ] ℂ) := |
| 362 | ContinuousLinearMap.smulRightL ℝ (Point P) ℂ |
| 363 | (dx.comp (ContinuousLinearMap.snd ℝ P Plane)) |
| 364 | |
| 365 | noncomputable def torusLiftY : ℂ →L[ℝ] (Point P →L[ℝ] ℂ) := |
| 366 | ContinuousLinearMap.smulRightL ℝ (Point P) ℂ |
| 367 | (dy.comp (ContinuousLinearMap.snd ℝ P Plane)) |
| 368 | |
| 369 | @[simp] theorem parameterLift_apply (i : BasisIndex P) (c : ℂ) (v : Point P) : |
| 370 | parameterLift i c v = parameterCoord i v.1 • c := rfl |
| 371 | |
| 372 | omit [FiniteDimensional ℝ P] in |
| 373 | @[simp] theorem torusLiftX_apply (c : ℂ) (v : Point P) : |
| 374 | torusLiftX c v = v.2.1 • c := rfl |
| 375 | |
| 376 | omit [FiniteDimensional ℝ P] in |
| 377 | @[simp] theorem torusLiftY_apply (c : ℂ) (v : Point P) : |
| 378 | torusLiftY c v = v.2.2 • c := rfl |
| 379 | |
| 380 | theorem clm_parameter_expansion (L : P →L[ℝ] ℂ) (v : P) : |
| 381 | L v = ∑ i : BasisIndex P, parameterCoord i v • L (parameterBasis i) := by |
| 382 | conv_lhs => rw [← (parameterBasis (P := P)).sum_repr v] |
| 383 | simp only [map_sum, map_smul, parameterCoord, Module.Basis.coord_apply, |
| 384 | LinearMap.coe_toContinuousLinearMap'] |
| 385 | |
| 386 | noncomputable def multiplierTermDerivative (m : Frequency → ℂ) (f : Source P) |
| 387 | (k : Frequency) (z : Point P) : Point P →L[ℝ] ℂ := |
| 388 | (∑ i : BasisIndex P, parameterLift i |
| 389 | (m k * coefficient (parameterPartial (parameterBasis i) f) z.1 k * mode k z.2)) + |
| 390 | torusLiftX (multiplierX m k * coefficient f z.1 k * mode k z.2) + |
| 391 | torusLiftY (multiplierY m k * coefficient f z.1 k * mode k z.2) |
| 392 | |
| 393 | theorem hasFDerivAt_multiplierTerm {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 394 | (m : Frequency → ℂ) (k : Frequency) (z : Point P) : |
| 395 | HasFDerivAt (fun w : Point P => m k * coefficient f w.1 k * mode k w.2) |
| 396 | (multiplierTermDerivative m f k z) z := by |
| 397 | let L := fderiv ℝ (fun q => coefficient f q k) z.1 |
| 398 | have hc : HasFDerivAt (fun w : Point P => coefficient f w.1 k) |
| 399 | (L.comp (ContinuousLinearMap.fst ℝ P Plane)) z := |
| 400 | (((coefficient_smooth hf k).differentiable (by simp) z.1).hasFDerivAt.comp z |
| 401 | (hasFDerivAt_fst)) |
| 402 | have he : HasFDerivAt (fun w : Point P => mode k w.2) |
| 403 | (mode k z.2 • ((phase k).comp (ContinuousLinearMap.snd ℝ P Plane))) z := |
| 404 | ((phase k).hasFDerivAt.comp z (hasFDerivAt_snd)).cexp |
| 405 | have hd : multiplierTermDerivative m f k z = |
| 406 | (m k * coefficient f z.1 k) • |
| 407 | (mode k z.2 • ((phase k).comp (ContinuousLinearMap.snd ℝ P Plane))) + |
| 408 | mode k z.2 • (m k • (L.comp (ContinuousLinearMap.fst ℝ P Plane))) := by |
| 409 | apply ContinuousLinearMap.ext |
| 410 | intro v |
| 411 | have hs : (∑ i : BasisIndex P, parameterCoord i v.1 • |
| 412 | (m k * coefficient (parameterPartial (parameterBasis i) f) z.1 k * mode k z.2)) = |
| 413 | mode k z.2 * (m k * L v.1) := by |
| 414 | rw [clm_parameter_expansion L v.1] |
| 415 | simp_rw [show ∀ i : BasisIndex P, L (parameterBasis i) = |
| 416 | coefficient (parameterPartial (parameterBasis i) f) z.1 k from |
| 417 | fun i => coefficient_fderiv_apply hf k z.1 _, Complex.real_smul] |
| 418 | rw [Finset.mul_sum, Finset.mul_sum] |
| 419 | apply Finset.sum_congr rfl |
| 420 | intro i hi |
| 421 | ring |
| 422 | simp only [multiplierTermDerivative, _root_.add_apply, |
| 423 | _root_.sum_apply, parameterLift_apply, torusLiftX_apply, torusLiftY_apply] |
| 424 | rw [hs] |
| 425 | change mode k z.2 * (m k * L v.1) + |
| 426 | v.2.1 • (freqX k * m k * coefficient f z.1 k * mode k z.2) + |
| 427 | v.2.2 • (freqY k * m k * coefficient f z.1 k * mode k z.2) = |
| 428 | (m k * coefficient f z.1 k) • |
| 429 | (mode k z.2 • (v.2.1 • freqX k + v.2.2 • freqY k)) + |
| 430 | mode k z.2 • (m k • L v.1) |
| 431 | simp only [Complex.real_smul, smul_eq_mul] |
| 432 | ring |
| 433 | rw [hd] |
| 434 | exact (hc.const_mul (m k)).mul he |
| 435 | |
| 436 | theorem norm_multiplierTermDerivative_le (m : Frequency → ℂ) (f : Source P) |
| 437 | (k : Frequency) (z : Point P) : |
| 438 | ‖multiplierTermDerivative m f k z‖ ≤ |
| 439 | (∑ i : BasisIndex P, ‖parameterLift i‖ * |
| 440 | ‖m k * coefficient (parameterPartial (parameterBasis i) f) z.1 k‖) + |
| 441 | ‖torusLiftX (P := P)‖ * ‖multiplierX m k * coefficient f z.1 k‖ + |
| 442 | ‖torusLiftY (P := P)‖ * ‖multiplierY m k * coefficient f z.1 k‖ := by |
| 443 | unfold multiplierTermDerivative |
| 444 | apply (norm_add_le _ _).trans |
| 445 | apply add_le_add |
| 446 | · apply (norm_add_le _ _).trans |
| 447 | apply add_le_add |
| 448 | · apply (norm_sum_le _ _).trans |
| 449 | apply Finset.sum_le_sum |
| 450 | intro i hi |
| 451 | simpa only [norm_mul, norm_mode, mul_one] using |
| 452 | (parameterLift i).le_opNorm |
| 453 | (m k * coefficient (parameterPartial (parameterBasis i) f) z.1 k * mode k z.2) |
| 454 | · simpa only [norm_mul, norm_mode, mul_one] using |
| 455 | (torusLiftX (P := P)).le_opNorm (multiplierX m k * coefficient f z.1 k * mode k z.2) |
| 456 | · simpa only [norm_mul, norm_mode, mul_one] using |
| 457 | (torusLiftY (P := P)).le_opNorm (multiplierY m k * coefficient f z.1 k * mode k z.2) |
| 458 | |
| 459 | theorem uniform_multiplierDerivative_bound {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 460 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) |
| 461 | {K : Set P} (hK : IsCompact K) : |
| 462 | ∃ C : ℝ, 0 ≤ C ∧ ∀ z : Point P, z.1 ∈ K → ∀ k, |
| 463 | ‖multiplierTermDerivative m f k z‖ ≤ C * (weight k ^ 4)⁻¹ := by |
| 464 | have hparam := fun i : BasisIndex P => uniform_multiplied_coeff_bound hm |
| 465 | (parameterPartial_smooth hf (parameterBasis i)) |
| 466 | (parameterPartial_periodic hp (parameterBasis i)) hK |
| 467 | choose CP hCP hP using hparam |
| 468 | obtain ⟨CX, hCX, hX⟩ := uniform_multiplied_coeff_bound hm.mulX hf hp hK |
| 469 | obtain ⟨CY, hCY, hY⟩ := uniform_multiplied_coeff_bound hm.mulY hf hp hK |
| 470 | have hsum : 0 ≤ ∑ i : BasisIndex P, ‖parameterLift i‖ * CP i := |
| 471 | Finset.sum_nonneg (fun i _ => mul_nonneg (norm_nonneg (parameterLift i)) (hCP i)) |
| 472 | refine ⟨(∑ i : BasisIndex P, ‖parameterLift i‖ * CP i) + |
| 473 | ‖torusLiftX (P := P)‖ * CX + ‖torusLiftY (P := P)‖ * CY, by positivity, ?_⟩ |
| 474 | intro z hz k |
| 475 | apply (norm_multiplierTermDerivative_le m f k z).trans |
| 476 | calc |
| 477 | _ ≤ (∑ i : BasisIndex P, ‖parameterLift i‖ * (CP i * (weight k ^ 4)⁻¹)) + |
| 478 | ‖torusLiftX (P := P)‖ * (CX * (weight k ^ 4)⁻¹) + |
| 479 | ‖torusLiftY (P := P)‖ * (CY * (weight k ^ 4)⁻¹) := by |
| 480 | gcongr with i |
| 481 | · exact hP i z.1 hz k |
| 482 | · exact hX z.1 hz k |
| 483 | · exact hY z.1 hz k |
| 484 | _ = _ := by simp only [← mul_assoc, ← Finset.sum_mul]; ring |
| 485 | |
| 486 | theorem hasFDerivAt_applyMultiplier {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 487 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (z : Point P) : |
| 488 | HasFDerivAt (applyMultiplier m f) (∑' k, multiplierTermDerivative m f k z) z := by |
| 489 | obtain ⟨C, hC, hb⟩ := uniform_multiplierDerivative_bound hm hf hp |
| 490 | (isCompact_closedBall z.1 (1 : ℝ)) |
| 491 | have hs := SmoothFourierData.summable_weight_inv_four.mul_left C |
| 492 | have hbox : ∀ w ∈ Metric.ball z 1, w.1 ∈ Metric.closedBall z.1 1 := by |
| 493 | intro w hw |
| 494 | rw [Metric.mem_closedBall, dist_eq_norm] |
| 495 | exact (norm_fst_le (w - z)).trans (le_of_lt (by |
| 496 | simpa only [dist_eq_norm] using Metric.mem_ball.mp hw)) |
| 497 | exact hasFDerivAt_tsum_of_isPreconnected hs Metric.isOpen_ball |
| 498 | (convex_ball z (1 : ℝ)).isPreconnected |
| 499 | (fun k w _ => hasFDerivAt_multiplierTerm hf m k w) |
| 500 | (fun k w hw => hb w (hbox w hw) k) |
| 501 | (Metric.mem_ball_self (by norm_num : (0 : ℝ) < 1)) |
| 502 | (summable_terms (multiplied_coeff_rapid hm hf hp z.1) z.2) |
| 503 | (Metric.mem_ball_self (by norm_num : (0 : ℝ) < 1)) |
| 504 | |
| 505 | theorem fderiv_applyMultiplier {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 506 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (z : Point P) : |
| 507 | fderiv ℝ (applyMultiplier m f) z = |
| 508 | (∑ i : BasisIndex P, parameterLift i |
| 509 | (applyMultiplier m (parameterPartial (parameterBasis i) f) z)) + |
| 510 | torusLiftX (applyMultiplier (multiplierX m) f z) + |
| 511 | torusLiftY (applyMultiplier (multiplierY m) f z) := by |
| 512 | have hP := fun i : BasisIndex P => summable_terms (multiplied_coeff_rapid hm |
| 513 | (parameterPartial_smooth hf (parameterBasis i)) |
| 514 | (parameterPartial_periodic hp (parameterBasis i)) z.1) z.2 |
| 515 | have hLP := fun i : BasisIndex P => (parameterLift i).summable (hP i) |
| 516 | have hX := summable_terms (multiplied_coeff_rapid hm.mulX hf hp z.1) z.2 |
| 517 | have hY := summable_terms (multiplied_coeff_rapid hm.mulY hf hp z.1) z.2 |
| 518 | rw [(hasFDerivAt_applyMultiplier hm hf hp z).fderiv] |
| 519 | simp only [multiplierTermDerivative] |
| 520 | rw [Summable.tsum_add ((summable_sum fun i hi => hLP i).add |
| 521 | ((torusLiftX (P := P)).summable hX)) ((torusLiftY (P := P)).summable hY), |
| 522 | Summable.tsum_add (summable_sum fun i hi => hLP i) ((torusLiftX (P := P)).summable hX), |
| 523 | Summable.tsum_finsetSum (fun i hi => hLP i)] |
| 524 | congr 2 |
| 525 | · apply Finset.sum_congr rfl |
| 526 | intro i hi |
| 527 | exact ((parameterLift i).map_tsum (hP i)).symm |
| 528 | · exact ((torusLiftX (P := P)).map_tsum hX).symm |
| 529 | · exact ((torusLiftY (P := P)).map_tsum hY).symm |
| 530 | |
| 531 | theorem applyMultiplier_smooth_nat (n : ℕ) {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 532 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) : |
| 533 | ContDiff ℝ n (applyMultiplier m f) := by |
| 534 | induction n generalizing m f with |
| 535 | | zero => |
| 536 | exact contDiff_zero.mpr (show Differentiable ℝ (applyMultiplier m f) from |
| 537 | fun z => (hasFDerivAt_applyMultiplier hm hf hp z).differentiableAt).continuous |
| 538 | | succ n ih => |
| 539 | rw [show ((n + 1 : ℕ) : WithTop ℕ∞) = (n : WithTop ℕ∞) + 1 by simp, |
| 540 | contDiff_succ_iff_fderiv] |
| 541 | refine ⟨fun z => (hasFDerivAt_applyMultiplier hm hf hp z).differentiableAt, by simp, ?_⟩ |
| 542 | have he : fderiv ℝ (applyMultiplier m f) = fun z => |
| 543 | (∑ i : BasisIndex P, parameterLift i |
| 544 | (applyMultiplier m (parameterPartial (parameterBasis i) f) z)) + |
| 545 | torusLiftX (applyMultiplier (multiplierX m) f z) + |
| 546 | torusLiftY (applyMultiplier (multiplierY m) f z) := |
| 547 | funext (fderiv_applyMultiplier hm hf hp) |
| 548 | rw [he] |
| 549 | have hP : ∀ i : BasisIndex P, ContDiff ℝ n (fun z : Point P => |
| 550 | parameterLift i (applyMultiplier m (parameterPartial (parameterBasis i) f) z)) := by |
| 551 | intro i |
| 552 | exact (parameterLift i).contDiff.comp |
| 553 | (ih hm (parameterPartial_smooth hf (parameterBasis i)) |
| 554 | (parameterPartial_periodic hp (parameterBasis i))) |
| 555 | have hPS : ContDiff ℝ n (fun z : Point P => |
| 556 | ∑ i : BasisIndex P, parameterLift i |
| 557 | (applyMultiplier m (parameterPartial (parameterBasis i) f) z)) := |
| 558 | ContDiff.sum (fun i (_ : i ∈ (Finset.univ : Finset (BasisIndex P))) => hP i) |
| 559 | have hX : ContDiff ℝ n (fun z : Point P => |
| 560 | torusLiftX (P := P) (applyMultiplier (multiplierX m) f z)) := |
| 561 | (torusLiftX (P := P)).contDiff.comp (ih hm.mulX hf hp) |
| 562 | have hY : ContDiff ℝ n (fun z : Point P => |
| 563 | torusLiftY (P := P) (applyMultiplier (multiplierY m) f z)) := |
| 564 | (torusLiftY (P := P)).contDiff.comp (ih hm.mulY hf hp) |
| 565 | exact (hPS.add hX).add hY |
| 566 | |
| 567 | theorem applyMultiplier_smooth {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 568 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) : |
| 569 | ContDiff ℝ ∞ (applyMultiplier m f) := |
| 570 | contDiff_infty.mpr (fun n => applyMultiplier_smooth_nat n hm hf hp) |
| 571 | |
| 572 | theorem inverse_smooth (d : Direction) {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 573 | (hp : Periodic f) : ContDiff ℝ ∞ (inverse d f) := |
| 574 | applyMultiplier_smooth (ParametricTorusInverse.inverseMultiplier_growth d) hf hp |
| 575 | |
| 576 | omit [FiniteDimensional ℝ P] [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 577 | theorem inverse_periodic (d : Direction) (f : Source P) : Periodic (inverse d f) := by |
| 578 | intro p Y k |
| 579 | exact directionalInverse_periodic d (coefficient f p) Y k.1 k.2 |
| 580 | |
| 581 | omit [FiniteDimensional ℝ P] in |
| 582 | theorem mean_applyMultiplier {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 583 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (p : P) : |
| 584 | mean (applyMultiplier m f) p = m 0 * mean f p := by |
| 585 | have ha := multiplied_coeff_rapid hm hf hp p |
| 586 | let g : C(Torus, ℂ) := |
| 587 | ⟨torusSeries (fun k => m k * coefficient f p k), continuous_torusSeries ha⟩ |
| 588 | have hg : SmoothFourierData.torusLift g = slice (applyMultiplier m f) p := by |
| 589 | funext Y |
| 590 | exact (series_eq_torusSeries (fun k => m k * coefficient f p k) Y).symm |
| 591 | change SmoothFourierData.coefficient (slice (applyMultiplier m f) p) 0 = _ |
| 592 | rw [← hg, SmoothFourierData.coefficient_zero_eq_mean] |
| 593 | exact integral_torusSeries ha |
| 594 | |
| 595 | omit [FiniteDimensional ℝ P] in |
| 596 | theorem inverse_zeroMean (d : Direction) {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 597 | (hp : Periodic f) : ZeroMean (inverse d f) := by |
| 598 | intro p |
| 599 | change mean (applyMultiplier (multiplier d) f) p = 0 |
| 600 | rw [mean_applyMultiplier (ParametricTorusInverse.inverseMultiplier_growth d) hf hp p] |
| 601 | simp only [multiplier, symbol_zero, Complex.ofReal_zero, mul_zero, inv_zero, zero_mul] |
| 602 | |
| 603 | noncomputable def directionalPartial (d : Direction) (f : Source P) (z : Point P) : ℂ := |
| 604 | fderiv ℝ f z (0, vector d) |
| 605 | |
| 606 | theorem inverse_solves (d : Direction) {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 607 | (hp : Periodic f) (hm : ZeroMean f) : directionalPartial d (inverse d f) = f := by |
| 608 | funext z |
| 609 | have hz := SmoothFourierData.inverse_solves_smooth_periodic d |
| 610 | (slice_smooth hf z.1) (hp z.1) (by |
| 611 | change (∫ y in (0 : ℝ)..1, ∫ x in (0 : ℝ)..1, f (z.1, (x, y))) = 0 |
| 612 | rw [← mean_eq_integral] |
| 613 | exact hm z.1) z.2 |
| 614 | have hd := congrArg (fun L : Plane →L[ℝ] ℂ => L (vector d)) |
| 615 | (slice_hasFDerivAt (inverse_smooth d hf hp) z.1 z.2).fderiv |
| 616 | exact hd.symm.trans hz |
| 617 | |
| 618 | omit [FiniteDimensional ℝ P] [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 619 | theorem inverse_preserves_parameter_support (d : Direction) (f : Source P) (S : Set P) |
| 620 | (hs : ∀ p, p ∉ S → ∀ Y, f (p, Y) = 0) : |
| 621 | ∀ p, p ∉ S → ∀ Y, inverse d f (p, Y) = 0 := by |
| 622 | apply TorusInverse.inverse_preserves_parameter_support d (coefficient f) S |
| 623 | intro p hp k |
| 624 | simp only [coefficient, SmoothFourierData.coefficient_eq_doubleIntegral, slice, |
| 625 | hs p hp, mul_zero, intervalIntegral.integral_zero] |
| 626 | |
| 627 | theorem parameterPartial_applyMultiplier {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 628 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (v : P) : |
| 629 | parameterPartial v (applyMultiplier m f) = applyMultiplier m (parameterPartial v f) := by |
| 630 | funext z |
| 631 | have hlp : ParametricTorusInverse.Periodic (lineSource f z.1 v) := |
| 632 | fun t => hp (z.1 + t • v) |
| 633 | have hh := congrFun (ParametricTorusInverse.parameterPartial_applyMultiplier hm |
| 634 | (lineSource_smooth hf z.1 v) hlp) (0, z.2) |
| 635 | change ParametricTorusInverse.parameterPartial |
| 636 | (lineSource (applyMultiplier m f) z.1 v) (0, z.2) = |
| 637 | ParametricTorusInverse.applyMultiplier m |
| 638 | (ParametricTorusInverse.parameterPartial (lineSource f z.1 v)) (0, z.2) at hh |
| 639 | rw [parameterPartial_lineSource (applyMultiplier_smooth hm hf hp) z.1 v, |
| 640 | parameterPartial_lineSource hf z.1 v] at hh |
| 641 | change parameterPartial v (applyMultiplier m f) (z.1 + (0 : ℝ) • v, z.2) = |
| 642 | applyMultiplier m (parameterPartial v f) (z.1 + (0 : ℝ) • v, z.2) at hh |
| 643 | simpa only [zero_smul, add_zero] using hh |
| 644 | |
| 645 | theorem parameterPartial_inverse (d : Direction) {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 646 | (hp : Periodic f) (v : P) : |
| 647 | parameterPartial v (inverse d f) = inverse d (parameterPartial v f) := |
| 648 | parameterPartial_applyMultiplier (ParametricTorusInverse.inverseMultiplier_growth d) hf hp v |
| 649 | |
| 650 | /-- A prefix of actual full joint Fréchet-jet bounds on a parameter set. |
| 651 | The torus argument ranges over the whole universal cover. -/ |
| 652 | def JetBound (f : Source P) (S : Set P) (n : ℕ) (C : ℝ) : Prop := |
| 653 | ∀ j ≤ n, ∀ p ∈ S, ∀ Y, ‖iteratedFDeriv ℝ j f (p, Y)‖ ≤ C |
| 654 | |
| 655 | omit [FiniteDimensional ℝ P] in |
| 656 | theorem JetBound.mono_order {f : Source P} {S : Set P} {n m : ℕ} {C : ℝ} |
| 657 | (h : JetBound f S n C) (hm : m ≤ n) : JetBound f S m C := |
| 658 | fun j hj => h j (hj.trans hm) |
| 659 | |
| 660 | omit [FiniteDimensional ℝ P] in |
| 661 | theorem JetBound.fixedPartial {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 662 | {S : Set P} {n : ℕ} {C : ℝ} (h : JetBound f S (n + 1) C) (v : Point P) : |
| 663 | JetBound (fixedPartial v f) S n (‖v‖ * C) := by |
| 664 | intro j hj p hp Y |
| 665 | exact (norm_jet_partial hf v j (p, Y)).trans |
| 666 | (mul_le_mul_of_nonneg_left (h (j + 1) (Nat.add_le_add_right hj 1) p hp Y) |
| 667 | (norm_nonneg _)) |
| 668 | |
| 669 | omit [FiniteDimensional ℝ P] in |
| 670 | theorem norm_torusXJet_le {f : Source P} (hf : ContDiff ℝ ∞ f) (n : ℕ) (z : Point P) : |
| 671 | ‖torusXJet n f z‖ ≤ ‖iteratedFDeriv ℝ n f z‖ := by |
| 672 | have hn : ‖((0 : P), ((1 : ℝ), (0 : ℝ)))‖ = 1 := by simp [Prod.norm_def] |
| 673 | have h := norm_repeatPartial hf (0, (1, 0)) n z |
| 674 | simp only [hn, one_pow, one_mul] at h |
| 675 | exact h |
| 676 | |
| 677 | omit [FiniteDimensional ℝ P] in |
| 678 | theorem norm_jet_swapTorus (f : Source P) (n : ℕ) (z : Point P) : |
| 679 | ‖iteratedFDeriv ℝ n (swapTorus f) z‖ = |
| 680 | ‖iteratedFDeriv ℝ n f (z.1, (z.2.2, z.2.1))‖ := by |
| 681 | let e : Point P ≃ₗᵢ[ℝ] Point P := |
| 682 | { toLinearEquiv := (LinearEquiv.refl ℝ P).prodCongr (LinearEquiv.prodComm ℝ ℝ ℝ) |
| 683 | norm_map' := fun z => by |
| 684 | change max ‖z.1‖ (max ‖z.2.2‖ ‖z.2.1‖) = max ‖z.1‖ (max ‖z.2.1‖ ‖z.2.2‖) |
| 685 | rw [max_comm ‖z.2.2‖ ‖z.2.1‖] } |
| 686 | exact e.norm_iteratedFDeriv_comp_right f z n |
| 687 | |
| 688 | omit [FiniteDimensional ℝ P] in |
| 689 | theorem coefficient_moment_bound {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) |
| 690 | {S : Set P} (l : ℕ) {C : ℝ} (h : JetBound f S (l + 4) C) |
| 691 | (p : P) (hps : p ∈ S) : |
| 692 | coeffSeminorm l (coefficient f p) ≤ |
| 693 | (3 ^ (l + 4) * C) * ∑' k : Frequency, (weight k ^ 4)⁻¹ := by |
| 694 | apply SmoothFourierData.coefficient_seminorm_bound (slice_smooth hf p) (hp p) l |
| 695 | · intro x hx y hy |
| 696 | simpa only [slice, norm_iteratedFDeriv_zero] using h 0 (by omega) p hps (x, y) |
| 697 | · intro x hx y hy |
| 698 | rw [← slice_torusXJet hf (l + 4) p] |
| 699 | exact (norm_torusXJet_le hf (l + 4) (p, (x, y))).trans |
| 700 | (h (l + 4) le_rfl p hps (x, y)) |
| 701 | · intro x hx y hy |
| 702 | change ‖SmoothFourierData.xJet (l + 4) (slice (swapTorus f) p) (x, y)‖ ≤ C |
| 703 | rw [← slice_torusXJet (swapTorus_smooth hf) (l + 4) p] |
| 704 | apply (norm_torusXJet_le (swapTorus_smooth hf) (l + 4) (p, (x, y))).trans |
| 705 | rw [norm_jet_swapTorus] |
| 706 | exact h (l + 4) le_rfl p hps (y, x) |
| 707 | |
| 708 | noncomputable def multiplierJetConstant : ℕ → ℕ → ℝ |
| 709 | | 0, l => 3 ^ (l + 4) * ∑' k : Frequency, (weight k ^ 4)⁻¹ |
| 710 | | n + 1, l => |
| 711 | (∑ i : BasisIndex P, ‖parameterLift i‖ * ‖(parameterBasis i, (0 : Plane))‖) * |
| 712 | multiplierJetConstant n l + |
| 713 | (‖torusLiftX (P := P)‖ + ‖torusLiftY (P := P)‖) * ‖omega‖ * |
| 714 | multiplierJetConstant n (l + 1) |
| 715 | |
| 716 | theorem multiplierJetConstant_nonneg (n l : ℕ) : 0 ≤ multiplierJetConstant (P := P) n l := by |
| 717 | induction n generalizing l with |
| 718 | | zero => unfold multiplierJetConstant; positivity |
| 719 | | succ n ih => |
| 720 | rw [multiplierJetConstant] |
| 721 | exact add_nonneg (mul_nonneg (Finset.sum_nonneg fun i hi => by positivity) (ih l)) |
| 722 | (mul_nonneg (by positivity) (ih (l + 1))) |
| 723 | |
| 724 | /-- The loss l+4 comes only from the order-l multiplier and the summable |
| 725 | two-dimensional lattice majorant; it does not grow with jet order. -/ |
| 726 | theorem norm_jet_applyMultiplier_le (n l : ℕ) {m : Frequency → ℂ} |
| 727 | {B : ℝ} (hB : 0 ≤ B) (hm : ∀ k, ‖m k‖ ≤ B * weight k ^ l) |
| 728 | {f : Source P} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) |
| 729 | {S : Set P} {C : ℝ} (hC : 0 ≤ C) (h : JetBound f S (n + l + 4) C) |
| 730 | (p : P) (hps : p ∈ S) (Y : Plane) : |
| 731 | ‖iteratedFDeriv ℝ n (applyMultiplier m f) (p, Y)‖ ≤ |
| 732 | multiplierJetConstant (P := P) n l * B * C := by |
| 733 | have hmg : PolynomialGrowth m := ⟨l, B, hB, hm⟩ |
| 734 | induction n generalizing l m B f C with |
| 735 | | zero => |
| 736 | rw [norm_iteratedFDeriv_zero] |
| 737 | have ha := SmoothFourierData.rapid_coefficient (slice_smooth hf p) (hp p) |
| 738 | have hb : coeffSeminorm 0 (fun k => m k * coefficient f p k) ≤ |
| 739 | B * coeffSeminorm l (coefficient f p) := by |
| 740 | have hb' : ∀ k, ‖m k * coefficient f p k‖ ≤ |
| 741 | B * (weight k ^ l * ‖coefficient f p k‖) := by |
| 742 | intro k |
| 743 | rw [norm_mul] |
| 744 | exact (mul_le_mul_of_nonneg_right (hm k) (norm_nonneg _)).trans_eq (by ring) |
| 745 | have hh := (multiplied_coeff_rapid hmg hf hp p).summable_norm.tsum_le_tsum hb' |
| 746 | ((ha l).mul_left B) |
| 747 | simpa only [coeffSeminorm, pow_zero, one_mul, tsum_mul_left] using hh |
| 748 | calc |
| 749 | _ ≤ coeffSeminorm 0 (fun k => m k * coefficient f p k) := |
| 750 | norm_series_le (multiplied_coeff_rapid hmg hf hp p) Y |
| 751 | _ ≤ B * coeffSeminorm l (coefficient f p) := hb |
| 752 | _ ≤ B * ((3 ^ (l + 4) * C) * ∑' k : Frequency, (weight k ^ 4)⁻¹) := |
| 753 | mul_le_mul_of_nonneg_left |
| 754 | (coefficient_moment_bound hf hp l (by simpa only [zero_add] using h) p hps) hB |
| 755 | _ = _ := by simp only [multiplierJetConstant]; ring |
| 756 | | succ n ih => |
| 757 | let G (i : BasisIndex P) : Source P := parameterPartial (parameterBasis i) f |
| 758 | have hG : ∀ i : BasisIndex P, ContDiff ℝ ∞ (G i) := |
| 759 | fun i => parameterPartial_smooth hf _ |
| 760 | have hPG : ∀ i : BasisIndex P, Periodic (G i) := |
| 761 | fun i => parameterPartial_periodic hp _ |
| 762 | have hGb : ∀ i : BasisIndex P, |
| 763 | ‖iteratedFDeriv ℝ n (applyMultiplier m (G i)) (p, Y)‖ ≤ |
| 764 | multiplierJetConstant (P := P) n l * B * |
| 765 | (‖(parameterBasis i, (0 : Plane))‖ * C) := by |
| 766 | intro i |
| 767 | apply ih l hB hm (hG i) (hPG i) (mul_nonneg (norm_nonneg _) hC) |
| 768 | · have hi := h.fixedPartial hf (parameterBasis i, (0 : Plane)) |
| 769 | convert! hi using 1 |
| 770 | omega |
| 771 | · exact hmg |
| 772 | have hmx : ∀ k, ‖multiplierX m k‖ ≤ (‖omega‖ * B) * weight k ^ (l + 1) := by |
| 773 | intro k |
| 774 | rw [multiplierX, norm_mul] |
| 775 | calc |
| 776 | _ ≤ (‖omega‖ * weight k) * (B * weight k ^ l) := |
| 777 | mul_le_mul (norm_freqX_le k) (hm k) (norm_nonneg _) |
| 778 | (mul_nonneg (norm_nonneg _) (weight_pos k).le) |
| 779 | _ = _ := by rw [pow_succ]; ring |
| 780 | have hmy : ∀ k, ‖multiplierY m k‖ ≤ (‖omega‖ * B) * weight k ^ (l + 1) := by |
| 781 | intro k |
| 782 | rw [multiplierY, norm_mul] |
| 783 | calc |
| 784 | _ ≤ (‖omega‖ * weight k) * (B * weight k ^ l) := |
| 785 | mul_le_mul (norm_freqY_le k) (hm k) (norm_nonneg _) |
| 786 | (mul_nonneg (norm_nonneg _) (weight_pos k).le) |
| 787 | _ = _ := by rw [pow_succ]; ring |
| 788 | have hbshift : JetBound f S (n + (l + 1) + 4) C := by |
| 789 | convert! h using 1 |
| 790 | omega |
| 791 | have hx := ih (l + 1) (mul_nonneg (norm_nonneg _) hB) hmx hf hp hC hbshift hmg.mulX |
| 792 | have hy := ih (l + 1) (mul_nonneg (norm_nonneg _) hB) hmy hf hp hC hbshift hmg.mulY |
| 793 | have hLS (i : BasisIndex P) : ContDiff ℝ ∞ |
| 794 | (fun z : Point P => parameterLift i (applyMultiplier m (G i) z)) := |
| 795 | (parameterLift i).contDiff.comp (applyMultiplier_smooth hmg (hG i) (hPG i)) |
| 796 | have hLSum := ContDiff.sum (fun i (_ : i ∈ (Finset.univ : Finset (BasisIndex P))) => hLS i) |
| 797 | have hLX : ContDiff ℝ ∞ |
| 798 | (fun z : Point P => torusLiftX (P := P) (applyMultiplier (multiplierX m) f z)) := |
| 799 | (torusLiftX (P := P)).contDiff.comp (applyMultiplier_smooth hmg.mulX hf hp) |
| 800 | have hLY : ContDiff ℝ ∞ |
| 801 | (fun z : Point P => torusLiftY (P := P) (applyMultiplier (multiplierY m) f z)) := |
| 802 | (torusLiftY (P := P)).contDiff.comp (applyMultiplier_smooth hmg.mulY hf hp) |
| 803 | have he : fderiv ℝ (applyMultiplier m f) = fun z : Point P => |
| 804 | (∑ i : BasisIndex P, parameterLift i (applyMultiplier m (G i) z)) + |
| 805 | torusLiftX (P := P) (applyMultiplier (multiplierX m) f z) + |
| 806 | torusLiftY (P := P) (applyMultiplier (multiplierY m) f z) := |
| 807 | funext (fderiv_applyMultiplier hmg hf hp) |
| 808 | rw [← norm_iteratedFDeriv_fderiv, he] |
| 809 | apply (norm_jet_add (hLSum.add hLX) hLY n (p, Y)).trans |
| 810 | apply (add_le_add_left (norm_jet_add hLSum hLX n (p, Y)) _).trans |
| 811 | apply (add_le_add_left (add_le_add_left (norm_jet_sum hLS n (p, Y)) _) _).trans |
| 812 | calc |
| 813 | _ ≤ (∑ i : BasisIndex P, ‖parameterLift i‖ * |
| 814 | (multiplierJetConstant (P := P) n l * B * |
| 815 | (‖(parameterBasis i, (0 : Plane))‖ * C))) + |
| 816 | ‖torusLiftX (P := P)‖ * |
| 817 | (multiplierJetConstant (P := P) n (l + 1) * (‖omega‖ * B) * C) + |
| 818 | ‖torusLiftY (P := P)‖ * |
| 819 | (multiplierJetConstant (P := P) n (l + 1) * (‖omega‖ * B) * C) := by |
| 820 | apply add_le_add |
| 821 | · apply add_le_add |
| 822 | · apply Finset.sum_le_sum |
| 823 | intro i hi |
| 824 | exact (norm_jet_linear (parameterLift i) |
| 825 | (applyMultiplier_smooth hmg (hG i) (hPG i)) n (p, Y)).trans |
| 826 | (mul_le_mul_of_nonneg_left (hGb i) (norm_nonneg _)) |
| 827 | · exact (norm_jet_linear (torusLiftX (P := P)) |
| 828 | (applyMultiplier_smooth hmg.mulX hf hp) n (p, Y)).trans |
| 829 | (mul_le_mul_of_nonneg_left hx (norm_nonneg _)) |
| 830 | · exact (norm_jet_linear (torusLiftY (P := P)) |
| 831 | (applyMultiplier_smooth hmg.mulY hf hp) n (p, Y)).trans |
| 832 | (mul_le_mul_of_nonneg_left hy (norm_nonneg _)) |
| 833 | _ = _ := by |
| 834 | rw [multiplierJetConstant] |
| 835 | have hs : (∑ i : BasisIndex P, ‖parameterLift i‖ * |
| 836 | (multiplierJetConstant (P := P) n l * B * |
| 837 | (‖(parameterBasis i, (0 : Plane))‖ * C))) = |
| 838 | (∑ i : BasisIndex P, ‖parameterLift i‖ * ‖(parameterBasis i, (0 : Plane))‖) * |
| 839 | multiplierJetConstant (P := P) n l * B * C := by |
| 840 | simp only [Finset.sum_mul] |
| 841 | apply Finset.sum_congr rfl |
| 842 | intro i hi |
| 843 | ring |
| 844 | rw [hs] |
| 845 | ring |
| 846 | |
| 847 | theorem applyMultiplier_finiteJets (n l : ℕ) : |
| 848 | ∃ K : ℝ, 0 ≤ K ∧ ∀ (m : Frequency → ℂ) (B : ℝ), 0 ≤ B → |
| 849 | (∀ k, ‖m k‖ ≤ B * weight k ^ l) → |
| 850 | ∀ (f : Source P) (S : Set P) (C : ℝ), ContDiff ℝ ∞ f → Periodic f → 0 ≤ C → |
| 851 | JetBound f S (n + l + 4) C → JetBound (applyMultiplier m f) S n (K * B * C) := by |
| 852 | let K := ∑ j ∈ Finset.range (n + 1), multiplierJetConstant (P := P) j l |
| 853 | have hK : 0 ≤ K := Finset.sum_nonneg (fun j hj => multiplierJetConstant_nonneg j l) |
| 854 | refine ⟨K, hK, ?_⟩ |
| 855 | intro m B hB hm f S C hf hp hC h j hj p hps Y |
| 856 | apply (norm_jet_applyMultiplier_le j l hB hm hf hp hC |
| 857 | (h.mono_order (by omega)) p hps Y).trans |
| 858 | have hjK : multiplierJetConstant (P := P) j l ≤ K := |
| 859 | Finset.single_le_sum (fun k hk => multiplierJetConstant_nonneg k l) |
| 860 | (Finset.mem_range.mpr (by omega)) |
| 861 | exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hjK hB) hC |
| 862 | |
| 863 | /-- Uniform full-tensor bound with five torus derivatives lost. The |
| 864 | constant is chosen before the source, parameter set, or input bound. -/ |
| 865 | theorem inverse_finiteJets (d : Direction) (n : ℕ) : |
| 866 | ∃ K : ℝ, 0 ≤ K ∧ ∀ (f : Source P) (S : Set P) (C : ℝ), |
| 867 | ContDiff ℝ ∞ f → Periodic f → 0 ≤ C → |
| 868 | JetBound f S (n + 5) C → JetBound (inverse d f) S n (K * C) := by |
| 869 | obtain ⟨K, hK, hb⟩ := applyMultiplier_finiteJets (P := P) n 1 |
| 870 | refine ⟨K * (6 * ‖omega⁻¹‖), by positivity, ?_⟩ |
| 871 | intro f S C hf hp hC h |
| 872 | have hh := hb (multiplier d) (6 * ‖omega⁻¹‖) (by positivity) |
| 873 | (fun k => by simpa only [pow_one] using norm_multiplier_le d k) |
| 874 | f S C hf hp hC (by simpa only [Nat.add_assoc] using h) |
| 875 | exact hh |
| 876 | |
| 877 | noncomputable def parameterJet (q : ℕ) (f : Source P) (z : Point P) : |
| 878 | ContinuousMultilinearMap ℝ (fun _ : Fin q => P) ℂ := |
| 879 | (iteratedFDeriv ℝ q f z).compContinuousLinearMap |
| 880 | (fun _ => ContinuousLinearMap.inl ℝ P Plane) |
| 881 | |
| 882 | noncomputable def parameterJetApply (q : ℕ) (v : Fin q → P) (f : Source P) : Source P := |
| 883 | fun z => parameterJet q f z v |
| 884 | |
| 885 | omit [FiniteDimensional ℝ P] in |
| 886 | theorem parameterJet_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) (q : ℕ) : |
| 887 | ContDiff ℝ ∞ (parameterJet q f) := by |
| 888 | have hq : ContDiff ℝ ∞ (iteratedFDeriv ℝ q f) := |
| 889 | hf.iteratedFDeriv_right (by exact_mod_cast (le_top : (⊤ : ℕ∞) + (q : ℕ∞) ≤ ⊤)) |
| 890 | exact (ContinuousMultilinearMap.compContinuousLinearMapL |
| 891 | (fun _ : Fin q => ContinuousLinearMap.inl ℝ P Plane)).contDiff.comp |
| 892 | hq |
| 893 | |
| 894 | omit [FiniteDimensional ℝ P] in |
| 895 | theorem parameterJetApply_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 896 | (q : ℕ) (v : Fin q → P) : ContDiff ℝ ∞ (parameterJetApply q v f) := |
| 897 | (ContinuousMultilinearMap.apply ℝ (fun _ : Fin q => P) ℂ v).contDiff.comp |
| 898 | (parameterJet_smooth hf q) |
| 899 | |
| 900 | omit [FiniteDimensional ℝ P] in |
| 901 | theorem parameterJet_eq_slice {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 902 | (q : ℕ) (p : P) (Y : Plane) : |
| 903 | parameterJet q f (p, Y) = iteratedFDeriv ℝ q (fun t => f (t, Y)) p := by |
| 904 | let L : P →L[ℝ] Point P := ContinuousLinearMap.inl ℝ P Plane |
| 905 | let g : Point P → ℂ := fun z => f (z + (0, Y)) |
| 906 | have hg : ContDiff ℝ ∞ g := hf.comp (contDiff_id.add contDiff_const) |
| 907 | have he : (fun t => f (t, Y)) = g ∘ L := by ext t; simp [g, L] |
| 908 | rw [he, L.iteratedFDeriv_comp_right hg p (by exact_mod_cast le_top : (q : WithTop ℕ∞) ≤ ∞)] |
| 909 | change (iteratedFDeriv ℝ q f (p, Y)).compContinuousLinearMap _ = |
| 910 | (iteratedFDeriv ℝ q (fun z => f (z + (0, Y))) (p, 0)).compContinuousLinearMap _ |
| 911 | rw [iteratedFDeriv_comp_add_right] |
| 912 | simp only [Prod.mk_add_mk, add_zero, zero_add] |
| 913 | rfl |
| 914 | |
| 915 | omit [FiniteDimensional ℝ P] in |
| 916 | theorem parameterJetApply_succ {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 917 | (q : ℕ) (v : Fin (q + 1) → P) : |
| 918 | parameterJetApply (q + 1) v f = |
| 919 | parameterPartial (v 0) (parameterJetApply q (Fin.tail v) f) := by |
| 920 | funext z |
| 921 | change iteratedFDeriv ℝ (q + 1) f z (fun i => (v i, 0)) = |
| 922 | fderiv ℝ (fun x => iteratedFDeriv ℝ q f x (fun i => (Fin.tail v i, 0))) z (v 0, 0) |
| 923 | have hq : ContDiff ℝ ∞ (iteratedFDeriv ℝ q f) := |
| 924 | hf.iteratedFDeriv_right (by exact_mod_cast (le_top : (⊤ : ℕ∞) + (q : ℕ∞) ≤ ⊤)) |
| 925 | rw [iteratedFDeriv_succ_apply_left, |
| 926 | fderiv_continuousMultilinear_apply_const_apply |
| 927 | (hq.differentiable (by simp) z)] |
| 928 | rfl |
| 929 | |
| 930 | omit [FiniteDimensional ℝ P] in |
| 931 | theorem parameterJetApply_periodic {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 932 | (hp : Periodic f) (q : ℕ) (v : Fin q → P) : Periodic (parameterJetApply q v f) := by |
| 933 | induction q with |
| 934 | | zero => exact hp |
| 935 | | succ q ih => |
| 936 | rw [parameterJetApply_succ hf] |
| 937 | exact parameterPartial_periodic (ih (Fin.tail v)) (v 0) |
| 938 | |
| 939 | theorem parameterJetApply_inverse (d : Direction) {f : Source P} |
| 940 | (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (q : ℕ) (v : Fin q → P) : |
| 941 | parameterJetApply q v (inverse d f) = inverse d (parameterJetApply q v f) := by |
| 942 | induction q with |
| 943 | | zero => rfl |
| 944 | | succ q ih => |
| 945 | rw [parameterJetApply_succ (inverse_smooth d hf hp), ih, |
| 946 | parameterPartial_inverse d (parameterJetApply_smooth hf q (Fin.tail v)) |
| 947 | (parameterJetApply_periodic hf hp q (Fin.tail v)), |
| 948 | parameterJetApply_succ hf] |
| 949 | |
| 950 | theorem parameterJet_inverse (d : Direction) {f : Source P} |
| 951 | (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (q : ℕ) (z : Point P) (v : Fin q → P) : |
| 952 | parameterJet q (inverse d f) z v = |
| 953 | inverse d (fun w => parameterJet q f w v) z := |
| 954 | congrFun (parameterJetApply_inverse d hf hp q v) z |
| 955 | |
| 956 | noncomputable def nonzeroMultiplier (k : Frequency) : ℂ := if k = 0 then 0 else 1 |
| 957 | |
| 958 | theorem nonzeroMultiplier_growth : ParametricTorusInverse.PolynomialGrowth nonzeroMultiplier := by |
| 959 | refine ⟨0, 1, zero_le_one, ?_⟩ |
| 960 | intro k |
| 961 | by_cases hk : k = 0 <;> simp [nonzeroMultiplier, hk] |
| 962 | |
| 963 | noncomputable def nonbarPart (f : Source P) (z : Point P) : ℂ := f z - mean f z.1 |
| 964 | |
| 965 | omit [FiniteDimensional ℝ P] in |
| 966 | theorem nonbarPart_eq_applyMultiplier {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 967 | (hp : Periodic f) : nonbarPart f = applyMultiplier nonzeroMultiplier f := by |
| 968 | funext z |
| 969 | have ha := SmoothFourierData.rapid_coefficient (slice_smooth hf z.1) (hp z.1) |
| 970 | have he : (fun k => nonzeroMultiplier k * coefficient f z.1 k * mode k z.2) = |
| 971 | (fun k => coefficient f z.1 k * mode k z.2) - |
| 972 | (fun k => if k = 0 then coefficient f z.1 0 else 0) := by |
| 973 | funext k |
| 974 | by_cases hk : k = 0 |
| 975 | · subst k |
| 976 | simp [nonzeroMultiplier, mode, phase, freqX, freqY, liftX, liftY] |
| 977 | · simp [nonzeroMultiplier, hk] |
| 978 | have hs : Summable (fun k : Frequency => if k = 0 then coefficient f z.1 0 else 0) := |
| 979 | (hasSum_ite_eq 0 _).summable |
| 980 | change f z - mean f z.1 = ∑' k, nonzeroMultiplier k * coefficient f z.1 k * mode k z.2 |
| 981 | rw [he] |
| 982 | change f z - mean f z.1 = ∑' k, |
| 983 | (coefficient f z.1 k * mode k z.2 - if k = 0 then coefficient f z.1 0 else 0) |
| 984 | have ht := Summable.tsum_sub (summable_terms ha z.2) hs |
| 985 | change (∑' k, (coefficient f z.1 k * mode k z.2 - |
| 986 | if k = 0 then coefficient f z.1 0 else 0)) = |
| 987 | (∑' k, coefficient f z.1 k * mode k z.2) - |
| 988 | (∑' k, if k = 0 then coefficient f z.1 0 else 0) at ht |
| 989 | rw [ht] |
| 990 | rw [(hasSum_ite_eq (0 : Frequency) (coefficient f z.1 0)).tsum_eq] |
| 991 | rw [show (∑' k, coefficient f z.1 k * mode k z.2) = f z from |
| 992 | SmoothFourierData.series_coefficient (slice_smooth hf z.1) (hp z.1) z.2] |
| 993 | rfl |
| 994 | |
| 995 | theorem nonbarPart_smooth {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 996 | (hp : Periodic f) : ContDiff ℝ ∞ (nonbarPart f) := by |
| 997 | rw [nonbarPart_eq_applyMultiplier hf hp] |
| 998 | exact applyMultiplier_smooth nonzeroMultiplier_growth hf hp |
| 999 | |
| 1000 | omit [FiniteDimensional ℝ P] [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 1001 | theorem nonbarPart_periodic {f : Source P} (hp : Periodic f) : Periodic (nonbarPart f) := by |
| 1002 | intro p Y k |
| 1003 | change f (p, Y + ((k.1 : ℝ), (k.2 : ℝ))) - mean f p = f (p, Y) - mean f p |
| 1004 | rw [show f (p, Y + ((k.1 : ℝ), (k.2 : ℝ))) = f (p, Y) from hp p Y k] |
| 1005 | |
| 1006 | omit [FiniteDimensional ℝ P] in |
| 1007 | theorem nonbarPart_zeroMean {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 1008 | (hp : Periodic f) : ZeroMean (nonbarPart f) := by |
| 1009 | rw [nonbarPart_eq_applyMultiplier hf hp] |
| 1010 | intro p |
| 1011 | rw [mean_applyMultiplier nonzeroMultiplier_growth hf hp p] |
| 1012 | simp [nonzeroMultiplier] |
| 1013 | |
| 1014 | theorem centered_inverse_solves (d : Direction) {f : Source P} |
| 1015 | (hf : ContDiff ℝ ∞ f) (hp : Periodic f) : |
| 1016 | directionalPartial d (inverse d (nonbarPart f)) = nonbarPart f := |
| 1017 | inverse_solves d (nonbarPart_smooth hf hp) (nonbarPart_periodic hp) |
| 1018 | (nonbarPart_zeroMean hf hp) |
| 1019 | |
| 1020 | theorem nonbarPart_finiteJets (n : ℕ) : |
| 1021 | ∃ K : ℝ, 0 ≤ K ∧ ∀ (f : Source P) (S : Set P) (C : ℝ), |
| 1022 | ContDiff ℝ ∞ f → Periodic f → 0 ≤ C → |
| 1023 | JetBound f S (n + 4) C → JetBound (nonbarPart f) S n (K * C) := by |
| 1024 | obtain ⟨K, hK, hb⟩ := applyMultiplier_finiteJets (P := P) n 0 |
| 1025 | refine ⟨K, hK, ?_⟩ |
| 1026 | intro f S C hf hp hC h |
| 1027 | rw [nonbarPart_eq_applyMultiplier hf hp] |
| 1028 | have hm : ∀ k, ‖nonzeroMultiplier k‖ ≤ (1 : ℝ) * weight k ^ 0 := by |
| 1029 | intro k |
| 1030 | by_cases hk : k = 0 <;> simp [nonzeroMultiplier, hk] |
| 1031 | simpa only [mul_one, add_zero] using |
| 1032 | hb nonzeroMultiplier 1 zero_le_one hm f S C hf hp hC (by simpa only [add_zero] using h) |
| 1033 | |
| 1034 | omit [FiniteDimensional ℝ P] [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 1035 | theorem nonbarPart_preserves_parameter_support (f : Source P) (S : Set P) |
| 1036 | (hs : ∀ p, p ∉ S → ∀ Y, f (p, Y) = 0) : |
| 1037 | ∀ p, p ∉ S → ∀ Y, nonbarPart f (p, Y) = 0 := by |
| 1038 | intro p hp Y |
| 1039 | rw [nonbarPart, hs p hp Y, mean_eq_integral] |
| 1040 | simp only [hs p hp, intervalIntegral.integral_zero, sub_zero] |
| 1041 | |
| 1042 | noncomputable def mixedJet (q : ℕ) (w : List Bool) (f : Source P) (z : Point P) : |
| 1043 | ContinuousMultilinearMap ℝ (fun _ : Fin q => P) ℂ := |
| 1044 | tensorTorusWord w (fun Y => parameterJet q f (z.1, Y)) z.2 |
| 1045 | |
| 1046 | omit [FiniteDimensional ℝ P] in |
| 1047 | theorem mixedJet_apply {f : Source P} (hf : ContDiff ℝ ∞ f) |
| 1048 | (q : ℕ) (w : List Bool) (z : Point P) (v : Fin q → P) : |
| 1049 | mixedJet q w f z v = |
| 1050 | derivativeWord w (slice (parameterJetApply q v f) z.1) z.2 := by |
| 1051 | have hg : ContDiff ℝ ∞ (fun Y => parameterJet q f (z.1, Y)) := |
| 1052 | (parameterJet_smooth hf q).comp (contDiff_const.prodMk contDiff_id) |
| 1053 | have h := congrFun (tensorTorusWord_map |
| 1054 | (ContinuousMultilinearMap.apply ℝ (fun _ : Fin q => P) ℂ v) hg w) z.2 |
| 1055 | rw [tensorTorusWord_scalar] at h |
| 1056 | exact h.symm |
| 1057 | |
| 1058 | omit [FiniteDimensional ℝ P] in |
| 1059 | theorem norm_derivativeWord_inverse_le (d : Direction) {f : Source P} |
| 1060 | (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (w : List Bool) (p : P) (Y : Plane) {C : ℝ} |
| 1061 | (hzero : ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, ‖f (p, (x, y))‖ ≤ C) |
| 1062 | (hfirst : ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 1063 | ‖SmoothFourierData.xJet (w.length + 5) (slice f p) (x, y)‖ ≤ C) |
| 1064 | (hsecond : ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 1065 | ‖SmoothFourierData.xJet (w.length + 5) |
| 1066 | (SmoothFourierData.swapFunction (slice f p)) (x, y)‖ ≤ C) : |
| 1067 | ‖derivativeWord w (slice (inverse d f) p) Y‖ ≤ |
| 1068 | ParametricTorusInverse.mixedLossConstant w.length * C := by |
| 1069 | have hbound := SmoothFourierData.coefficient_seminorm_bound (slice_smooth hf p) (hp p) |
| 1070 | (w.length + 1) hzero (by simpa only [Nat.add_assoc] using hfirst) |
| 1071 | (by simpa only [Nat.add_assoc] using hsecond) |
| 1072 | calc |
| 1073 | _ ≤ ((6 * ‖omega⁻¹‖) * ‖omega‖ ^ w.length) * |
| 1074 | coeffSeminorm (w.length + 1) (coefficient f p) := |
| 1075 | inverse_derivativeWord_bound d |
| 1076 | (SmoothFourierData.rapid_coefficient (slice_smooth hf p) (hp p)) w Y |
| 1077 | _ ≤ ((6 * ‖omega⁻¹‖) * ‖omega‖ ^ w.length) * |
| 1078 | ((3 ^ ((w.length + 1) + 4) * C) * ∑' k : Frequency, (weight k ^ 4)⁻¹) := |
| 1079 | mul_le_mul_of_nonneg_left hbound (by positivity) |
| 1080 | _ = _ := by simp only [ParametricTorusInverse.mixedLossConstant, Nat.add_assoc]; ring |
| 1081 | |
| 1082 | theorem mixedJet_inverse_bound (d : Direction) {f : Source P} |
| 1083 | (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (q : ℕ) (w : List Bool) |
| 1084 | (S : Set P) {C : ℝ} (hC : 0 ≤ C) |
| 1085 | (hzero : ∀ p ∈ S, ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 1086 | ‖parameterJet q f (p, (x, y))‖ ≤ C) |
| 1087 | (hfirst : ∀ p ∈ S, ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 1088 | ‖tensorTorusWord (List.replicate (w.length + 5) false) |
| 1089 | (fun Y => parameterJet q f (p, Y)) (x, y)‖ ≤ C) |
| 1090 | (hsecond : ∀ p ∈ S, ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 1091 | ‖tensorTorusWord (List.replicate (w.length + 5) false) |
| 1092 | (fun Y => parameterJet q f (p, (Y.2, Y.1))) (x, y)‖ ≤ C) |
| 1093 | (p : P) (hps : p ∈ S) (Y : Plane) : |
| 1094 | ‖mixedJet q w (inverse d f) (p, Y)‖ ≤ |
| 1095 | ParametricTorusInverse.mixedLossConstant w.length * C := by |
| 1096 | apply ContinuousMultilinearMap.opNorm_le_bound |
| 1097 | (mul_nonneg (ParametricTorusInverse.mixedLossConstant_nonneg w.length) hC) |
| 1098 | intro v |
| 1099 | rw [mixedJet_apply (inverse_smooth d hf hp), |
| 1100 | parameterJetApply_inverse d hf hp] |
| 1101 | have hg : ContDiff ℝ ∞ (fun Y => parameterJet q f (p, Y)) := |
| 1102 | (parameterJet_smooth hf q).comp (contDiff_const.prodMk contDiff_id) |
| 1103 | have hgs : ContDiff ℝ ∞ (fun Y : Plane => parameterJet q f (p, (Y.2, Y.1))) := |
| 1104 | hg.comp (contDiff_snd.prodMk contDiff_fst) |
| 1105 | let L := ContinuousMultilinearMap.apply ℝ (fun _ : Fin q => P) ℂ v |
| 1106 | have hb0 : ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 1107 | ‖parameterJetApply q v f (p, (x, y))‖ ≤ C * ∏ i, ‖v i‖ := by |
| 1108 | intro x hx y hy |
| 1109 | exact ContinuousMultilinearMap.le_of_opNorm_le (hzero p hps x hx y hy) v |
| 1110 | have hb1 : ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 1111 | ‖SmoothFourierData.xJet (w.length + 5) (slice (parameterJetApply q v f) p) (x, y)‖ ≤ |
| 1112 | C * ∏ i, ‖v i‖ := by |
| 1113 | intro x hx y hy |
| 1114 | have he := congrFun (tensorTorusWord_map L hg (List.replicate (w.length + 5) false)) (x, y) |
| 1115 | rw [tensorTorusWord_replicate] at he |
| 1116 | change SmoothFourierData.xJet (w.length + 5) |
| 1117 | (slice (parameterJetApply q v f) p) (x, y) = |
| 1118 | (tensorTorusWord (List.replicate (w.length + 5) false) |
| 1119 | (fun Y => parameterJet q f (p, Y)) (x, y)) v at he |
| 1120 | rw [he] |
| 1121 | exact ContinuousMultilinearMap.le_of_opNorm_le (hfirst p hps x hx y hy) v |
| 1122 | have hb2 : ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 1123 | ‖SmoothFourierData.xJet (w.length + 5) |
| 1124 | (SmoothFourierData.swapFunction (slice (parameterJetApply q v f) p)) (x, y)‖ ≤ |
| 1125 | C * ∏ i, ‖v i‖ := by |
| 1126 | intro x hx y hy |
| 1127 | have he := congrFun (tensorTorusWord_map L hgs (List.replicate (w.length + 5) false)) (x, y) |
| 1128 | rw [tensorTorusWord_replicate] at he |
| 1129 | change SmoothFourierData.xJet (w.length + 5) |
| 1130 | (SmoothFourierData.swapFunction (slice (parameterJetApply q v f) p)) (x, y) = |
| 1131 | (tensorTorusWord (List.replicate (w.length + 5) false) |
| 1132 | (fun Y => parameterJet q f (p, (Y.2, Y.1))) (x, y)) v at he |
| 1133 | rw [he] |
| 1134 | exact ContinuousMultilinearMap.le_of_opNorm_le (hsecond p hps x hx y hy) v |
| 1135 | exact (norm_derivativeWord_inverse_le d (parameterJetApply_smooth hf q v) |
| 1136 | (parameterJetApply_periodic hf hp q v) w p Y hb0 hb1 hb2).trans_eq (by ring) |
| 1137 | |
| 1138 | |
| 1139 | end FiniteDimensional |
| 1140 | end NavierStokes.SmoothFamilyTorusInverse |