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.SmoothFourierData |
| 2 | import NavierStokes.TransportPrimitive |
| 3 | import Mathlib.Analysis.Calculus.SmoothSeries |
| 4 | |
| 5 | /-! |
| 6 | # The actual smooth torus inverse with an external real parameter |
| 7 | |
| 8 | The coefficients are the integrals of the given function. Local uniform |
| 9 | decay is obtained from genuine derivatives on compact parameter intervals. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | namespace NavierStokes.ParametricTorusInverse |
| 15 | |
| 16 | open Set Filter MeasureTheory |
| 17 | open TorusInverse |
| 18 | open scoped Topology ContDiff BigOperators |
| 19 | |
| 20 | abbrev Point := ℝ × Plane |
| 21 | abbrev Source := Point → ℂ |
| 22 | |
| 23 | noncomputable def slice (f : Source) (p : ℝ) : Plane → ℂ := fun Y => f (p, Y) |
| 24 | |
| 25 | def Periodic (f : Source) : Prop := ∀ p, SmoothFourierData.UnitPeriodic (slice f p) |
| 26 | |
| 27 | noncomputable def parameterPartial (f : Source) (z : Point) : ℂ := |
| 28 | fderiv ℝ f z (1, 0) |
| 29 | |
| 30 | noncomputable def torusXPartial (f : Source) (z : Point) : ℂ := |
| 31 | fderiv ℝ f z (0, (1, 0)) |
| 32 | |
| 33 | noncomputable def parameterJet (n : ℕ) (f : Source) : Source := parameterPartial^[n] f |
| 34 | |
| 35 | noncomputable def torusXJet : ℕ → Source → Source |
| 36 | | 0, f => f |
| 37 | | n + 1, f => torusXPartial (torusXJet n f) |
| 38 | |
| 39 | noncomputable def swapTorus (f : Source) : Source := fun z => f (z.1, (z.2.2, z.2.1)) |
| 40 | |
| 41 | noncomputable def coefficient (f : Source) (p : ℝ) (k : Frequency) : ℂ := |
| 42 | SmoothFourierData.coefficient (slice f p) k |
| 43 | |
| 44 | noncomputable def mean (f : Source) (p : ℝ) : ℂ := coefficient f p 0 |
| 45 | |
| 46 | def ZeroMean (f : Source) : Prop := ∀ p, mean f p = 0 |
| 47 | |
| 48 | noncomputable def inverse (d : Direction) (f : Source) (z : Point) : ℂ := |
| 49 | directionalInverse d (coefficient f z.1) z.2 |
| 50 | |
| 51 | noncomputable def iterateInverse (d : Direction) (n : ℕ) (f : Source) : Source := |
| 52 | (inverse d)^[n] f |
| 53 | |
| 54 | theorem mean_eq_integral (f : Source) (p : ℝ) : |
| 55 | mean f p = ∫ y in (0 : ℝ)..1, ∫ x in (0 : ℝ)..1, f (p, (x, y)) := |
| 56 | SmoothFourierData.coefficient_zero_eq_integral _ |
| 57 | |
| 58 | theorem slice_smooth {f : Source} (hf : ContDiff ℝ ∞ f) (p : ℝ) : |
| 59 | ContDiff ℝ ∞ (slice f p) := |
| 60 | hf.comp (contDiff_const.prodMk contDiff_id) |
| 61 | |
| 62 | theorem fixedPartial_smooth {f : Source} (hf : ContDiff ℝ ∞ f) (v : Point) : |
| 63 | ContDiff ℝ ∞ (fun z => fderiv ℝ f z v) := |
| 64 | (ContinuousLinearMap.apply ℝ ℂ v).contDiff.comp (hf.fderiv_right (by simp)) |
| 65 | |
| 66 | theorem parameterPartial_smooth {f : Source} (hf : ContDiff ℝ ∞ f) : |
| 67 | ContDiff ℝ ∞ (parameterPartial f) := fixedPartial_smooth hf (1, 0) |
| 68 | |
| 69 | theorem torusXPartial_smooth {f : Source} (hf : ContDiff ℝ ∞ f) : |
| 70 | ContDiff ℝ ∞ (torusXPartial f) := fixedPartial_smooth hf (0, (1, 0)) |
| 71 | |
| 72 | theorem fixedPartial_periodic {f : Source} (hp : Periodic f) (v : Point) : |
| 73 | Periodic (fun z => fderiv ℝ f z v) := by |
| 74 | intro p Y k |
| 75 | have he : (fun z : Point => f (z + (0, ((k.1 : ℝ), (k.2 : ℝ))))) = f := by |
| 76 | funext z |
| 77 | change f (z.1 + 0, z.2 + ((k.1 : ℝ), (k.2 : ℝ))) = f (z.1, z.2) |
| 78 | simpa [slice] using hp z.1 z.2 k |
| 79 | have hd := congrArg (fun g : Source => fderiv ℝ g (p, Y)) he |
| 80 | rw [fderiv_comp_add_right] at hd |
| 81 | simpa only [slice, Prod.mk_add_mk, add_zero] using |
| 82 | congrArg (fun L : Point →L[ℝ] ℂ => L v) hd |
| 83 | |
| 84 | theorem parameterPartial_periodic {f : Source} (hp : Periodic f) : |
| 85 | Periodic (parameterPartial f) := fixedPartial_periodic hp (1, 0) |
| 86 | |
| 87 | theorem torusXJet_smooth {f : Source} (hf : ContDiff ℝ ∞ f) (n : ℕ) : |
| 88 | ContDiff ℝ ∞ (torusXJet n f) := by |
| 89 | induction n with |
| 90 | | zero => exact hf |
| 91 | | succ n ih => exact torusXPartial_smooth ih |
| 92 | |
| 93 | theorem parameterJet_smooth {f : Source} (hf : ContDiff ℝ ∞ f) (n : ℕ) : |
| 94 | ContDiff ℝ ∞ (parameterJet n f) := by |
| 95 | induction n with |
| 96 | | zero => exact hf |
| 97 | | succ n ih => |
| 98 | rw [parameterJet, Function.iterate_succ_apply'] |
| 99 | exact parameterPartial_smooth ih |
| 100 | |
| 101 | theorem parameterJet_periodic {f : Source} (hp : Periodic f) (n : ℕ) : |
| 102 | Periodic (parameterJet n f) := by |
| 103 | induction n with |
| 104 | | zero => exact hp |
| 105 | | succ n ih => |
| 106 | rw [parameterJet, Function.iterate_succ_apply'] |
| 107 | exact parameterPartial_periodic ih |
| 108 | |
| 109 | theorem swapTorus_smooth {f : Source} (hf : ContDiff ℝ ∞ f) : |
| 110 | ContDiff ℝ ∞ (swapTorus f) := |
| 111 | hf.comp (contDiff_fst.prodMk (contDiff_snd.snd.prodMk contDiff_snd.fst)) |
| 112 | |
| 113 | theorem parameter_slice_hasDerivAt {f : Source} (hf : ContDiff ℝ ∞ f) |
| 114 | (p : ℝ) (Y : Plane) : |
| 115 | HasDerivAt (fun q => f (q, Y)) (parameterPartial f (p, Y)) p := by |
| 116 | exact ((hf.differentiable (by simp)) (p, Y)).hasFDerivAt.comp_hasDerivAt p |
| 117 | ((hasDerivAt_id p).prodMk (hasDerivAt_const p Y)) |
| 118 | |
| 119 | theorem slice_hasFDerivAt {f : Source} (hf : ContDiff ℝ ∞ f) (p : ℝ) (Y : Plane) : |
| 120 | HasFDerivAt (slice f p) |
| 121 | ((fderiv ℝ f (p, Y)).comp (ContinuousLinearMap.inr ℝ ℝ Plane)) Y := by |
| 122 | exact ((hf.differentiable (by simp)) (p, Y)).hasFDerivAt.comp Y |
| 123 | ((hasFDerivAt_const p Y).prodMk (hasFDerivAt_id Y)) |
| 124 | |
| 125 | theorem slice_torusXPartial {f : Source} (hf : ContDiff ℝ ∞ f) (p : ℝ) : |
| 126 | slice (torusXPartial f) p = SmoothFourierData.partialX (slice f p) := by |
| 127 | funext Y |
| 128 | symm |
| 129 | exact congrArg (fun L : Plane →L[ℝ] ℂ => L (1, 0)) (slice_hasFDerivAt hf p Y).fderiv |
| 130 | |
| 131 | theorem slice_torusXJet {f : Source} (hf : ContDiff ℝ ∞ f) (n : ℕ) (p : ℝ) : |
| 132 | slice (torusXJet n f) p = SmoothFourierData.xJet n (slice f p) := by |
| 133 | induction n with |
| 134 | | zero => rfl |
| 135 | | succ n ih => |
| 136 | rw [torusXJet, slice_torusXPartial (torusXJet_smooth hf n), |
| 137 | SmoothFourierData.xJet_succ, ih] |
| 138 | |
| 139 | theorem kernel_eq_mode (k : Frequency) (Y : Plane) : |
| 140 | SmoothFourierData.kernel k Y = mode (-k) Y := by |
| 141 | rw [mode_eq_torusMode] |
| 142 | rfl |
| 143 | |
| 144 | theorem mode_smooth (k : Frequency) : ContDiff ℝ ∞ (mode k) := |
| 145 | Complex.contDiff_exp.comp (phase k).contDiff |
| 146 | |
| 147 | theorem kernel_smooth (k : Frequency) : ContDiff ℝ ∞ (SmoothFourierData.kernel k) := by |
| 148 | simpa only [funext (kernel_eq_mode k)] using mode_smooth (-k) |
| 149 | |
| 150 | /-- Differentiation of an actual fixed-interval integral. -/ |
| 151 | theorem integral_hasDerivAt {g g' : ℝ × ℝ → ℂ} (hg : ContDiff ℝ ∞ g) |
| 152 | (hd : ∀ p u, HasDerivAt (fun q => g (q, u)) (g' (p, u)) p) |
| 153 | (a b p : ℝ) : |
| 154 | HasDerivAt (fun q => ∫ u in a..b, g (q, u)) (∫ u in a..b, g' (p, u)) p := by |
| 155 | have hh := (TransportPrimitive.parameterIntegral_hasFDerivAt hg a b p).hasDerivAt |
| 156 | have hi : IntervalIntegrable (fun u => TransportPrimitive.parameterDerivative g (p, u)) |
| 157 | volume a b := |
| 158 | ((TransportPrimitive.parameterDerivative_contDiff hg).continuous.comp |
| 159 | (continuous_const.prodMk continuous_id)).intervalIntegrable a b |
| 160 | rw [ContinuousLinearMap.intervalIntegral_apply hi (1 : ℝ)] at hh |
| 161 | convert! hh using 1 |
| 162 | apply intervalIntegral.integral_congr |
| 163 | intro u hu |
| 164 | exact ((TransportPrimitive.parameter_hasFDerivAt hg p u).hasDerivAt.unique (hd p u)).symm |
| 165 | |
| 166 | noncomputable def weightedSource (k : Frequency) (f : Source) (q : (ℝ × ℝ) × ℝ) : ℂ := |
| 167 | SmoothFourierData.kernel k (q.2, q.1.2) * f (q.1.1, (q.2, q.1.2)) |
| 168 | |
| 169 | theorem weightedSource_smooth {f : Source} (hf : ContDiff ℝ ∞ f) (k : Frequency) : |
| 170 | ContDiff ℝ ∞ (weightedSource k f) := |
| 171 | ((kernel_smooth k).comp (contDiff_snd.prodMk contDiff_fst.snd)).mul |
| 172 | (hf.comp (contDiff_fst.fst.prodMk (contDiff_snd.prodMk contDiff_fst.snd))) |
| 173 | |
| 174 | theorem coefficient_smooth {f : Source} (hf : ContDiff ℝ ∞ f) (k : Frequency) : |
| 175 | ContDiff ℝ ∞ (fun p => coefficient f p k) := by |
| 176 | have hi := TransportPrimitive.parameterIntegral_contDiff (weightedSource_smooth hf k) |
| 177 | (0 : ℝ) 1 |
| 178 | have ho := TransportPrimitive.parameterIntegral_contDiff hi (0 : ℝ) 1 |
| 179 | simpa only [coefficient, SmoothFourierData.coefficient_eq_doubleIntegral, weightedSource, |
| 180 | slice] using ho |
| 181 | |
| 182 | theorem coefficient_hasDerivAt {f : Source} (hf : ContDiff ℝ ∞ f) |
| 183 | (k : Frequency) (p : ℝ) : |
| 184 | HasDerivAt (fun q => coefficient f q k) (coefficient (parameterPartial f) p k) p := by |
| 185 | let inner : ℝ × ℝ → ℂ := fun q => ∫ x in (0 : ℝ)..1, weightedSource k f (q, x) |
| 186 | let innerD : ℝ × ℝ → ℂ := fun q => ∫ x in (0 : ℝ)..1, |
| 187 | weightedSource k (parameterPartial f) (q, x) |
| 188 | have hi : ContDiff ℝ ∞ inner := |
| 189 | TransportPrimitive.parameterIntegral_contDiff (weightedSource_smooth hf k) 0 1 |
| 190 | have hd : ∀ q y, HasDerivAt (fun u => inner (u, y)) (innerD (q, y)) q := by |
| 191 | intro q y |
| 192 | have hy : ContDiff ℝ ∞ (fun z : ℝ × ℝ => weightedSource k f ((z.1, y), z.2)) := |
| 193 | ((weightedSource_smooth hf k).comp |
| 194 | ((contDiff_fst.prodMk contDiff_const).prodMk contDiff_snd)) |
| 195 | exact integral_hasDerivAt |
| 196 | (g' := fun z : ℝ × ℝ => weightedSource k (parameterPartial f) ((z.1, y), z.2)) |
| 197 | hy (fun u x => by |
| 198 | simpa only [weightedSource] using |
| 199 | (parameter_slice_hasDerivAt hf u (x, y)).const_mul |
| 200 | (SmoothFourierData.kernel k (x, y))) 0 1 q |
| 201 | have ho := integral_hasDerivAt hi hd 0 1 p |
| 202 | simpa only [coefficient, SmoothFourierData.coefficient_eq_doubleIntegral, slice, |
| 203 | inner, innerD, weightedSource] using ho |
| 204 | |
| 205 | theorem parameterPartial_zeroMean {f : Source} (hf : ContDiff ℝ ∞ f) |
| 206 | (hm : ZeroMean f) : ZeroMean (parameterPartial f) := by |
| 207 | intro p |
| 208 | have he : (fun q => coefficient f q 0) = fun _ => (0 : ℂ) := funext hm |
| 209 | have hd := (coefficient_hasDerivAt hf 0 p).deriv |
| 210 | rw [he, deriv_const] at hd |
| 211 | exact hd.symm |
| 212 | |
| 213 | /-- Uniform polynomial decay on any fixed compact parameter interval, |
| 214 | derived from bounds for actual torus derivatives. -/ |
| 215 | theorem exists_uniform_coefficient_bound {f : Source} (hf : ContDiff ℝ ∞ f) |
| 216 | (hp : Periodic f) (n : ℕ) (a b : ℝ) : |
| 217 | ∃ C : ℝ, 0 ≤ C ∧ ∀ p ∈ Icc a b, ∀ k, |
| 218 | weight k ^ n * ‖coefficient f p k‖ ≤ C := by |
| 219 | let K : Set Point := Icc a b ×ˢ (Icc (0 : ℝ) 1 ×ˢ Icc (0 : ℝ) 1) |
| 220 | have hK : IsCompact K := isCompact_Icc.prod (isCompact_Icc.prod isCompact_Icc) |
| 221 | obtain ⟨C₀, h₀⟩ := hK.exists_bound_of_continuousOn hf.continuous.continuousOn |
| 222 | obtain ⟨C₁, h₁⟩ := hK.exists_bound_of_continuousOn |
| 223 | (torusXJet_smooth hf n).continuous.continuousOn |
| 224 | obtain ⟨C₂, h₂⟩ := hK.exists_bound_of_continuousOn |
| 225 | (torusXJet_smooth (swapTorus_smooth hf) n).continuous.continuousOn |
| 226 | let C := max 0 (max C₀ (max C₁ C₂)) |
| 227 | have hC : 0 ≤ C := le_max_left _ _ |
| 228 | have hC₀ : C₀ ≤ C := (le_max_left _ _).trans (le_max_right _ _) |
| 229 | have hC₁ : C₁ ≤ C := ((le_max_left _ _).trans (le_max_right _ _)).trans (le_max_right _ _) |
| 230 | have hC₂ : C₂ ≤ C := ((le_max_right _ _).trans (le_max_right _ _)).trans (le_max_right _ _) |
| 231 | refine ⟨3 ^ n * C, mul_nonneg (by positivity) hC, ?_⟩ |
| 232 | intro p hparam k |
| 233 | apply SmoothFourierData.coefficient_polynomial_bound (slice_smooth hf p) (hp p) n |
| 234 | · intro x hx y hy |
| 235 | exact (h₀ (p, (x, y)) ⟨hparam, hx, hy⟩).trans hC₀ |
| 236 | · intro x hx y hy |
| 237 | rw [← slice_torusXJet hf n p] |
| 238 | exact (h₁ (p, (x, y)) ⟨hparam, hx, hy⟩).trans hC₁ |
| 239 | · intro x hx y hy |
| 240 | change ‖SmoothFourierData.xJet n (slice (swapTorus f) p) (x, y)‖ ≤ C |
| 241 | rw [← slice_torusXJet (swapTorus_smooth hf) n p] |
| 242 | exact (h₂ (p, (x, y)) ⟨hparam, hx, hy⟩).trans hC₂ |
| 243 | |
| 244 | def PolynomialGrowth (m : Frequency → ℂ) : Prop := |
| 245 | ∃ s : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ k, ‖m k‖ ≤ C * weight k ^ s |
| 246 | |
| 247 | noncomputable def multiplierX (m : Frequency → ℂ) (k : Frequency) : ℂ := freqX k * m k |
| 248 | noncomputable def multiplierY (m : Frequency → ℂ) (k : Frequency) : ℂ := freqY k * m k |
| 249 | |
| 250 | theorem PolynomialGrowth.mulX {m : Frequency → ℂ} (hm : PolynomialGrowth m) : |
| 251 | PolynomialGrowth (multiplierX m) := by |
| 252 | obtain ⟨s, C, hC, hm⟩ := hm |
| 253 | refine ⟨s + 1, ‖omega‖ * C, mul_nonneg (norm_nonneg _) hC, ?_⟩ |
| 254 | intro k |
| 255 | have hw := (weight_pos k).le |
| 256 | calc |
| 257 | ‖multiplierX m k‖ = ‖freqX k‖ * ‖m k‖ := norm_mul _ _ |
| 258 | _ ≤ (‖omega‖ * weight k) * (C * weight k ^ s) := |
| 259 | mul_le_mul (norm_freqX_le k) (hm k) (norm_nonneg _) (by positivity) |
| 260 | _ = _ := by rw [pow_succ]; ring |
| 261 | |
| 262 | theorem PolynomialGrowth.mulY {m : Frequency → ℂ} (hm : PolynomialGrowth m) : |
| 263 | PolynomialGrowth (multiplierY m) := by |
| 264 | obtain ⟨s, C, hC, hm⟩ := hm |
| 265 | refine ⟨s + 1, ‖omega‖ * C, mul_nonneg (norm_nonneg _) hC, ?_⟩ |
| 266 | intro k |
| 267 | have hw := (weight_pos k).le |
| 268 | calc |
| 269 | ‖multiplierY m k‖ = ‖freqY k‖ * ‖m k‖ := norm_mul _ _ |
| 270 | _ ≤ (‖omega‖ * weight k) * (C * weight k ^ s) := |
| 271 | mul_le_mul (norm_freqY_le k) (hm k) (norm_nonneg _) (by positivity) |
| 272 | _ = _ := by rw [pow_succ]; ring |
| 273 | |
| 274 | theorem inverseMultiplier_growth (d : Direction) : PolynomialGrowth (multiplier d) := |
| 275 | ⟨1, 6 * ‖omega⁻¹‖, by positivity, fun k => by simpa using norm_multiplier_le d k⟩ |
| 276 | |
| 277 | theorem PolynomialGrowth.rapid_mul {m a : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 278 | (ha : Rapid a) : Rapid (fun k => m k * a k) := by |
| 279 | obtain ⟨s, C, hC, hm⟩ := hm |
| 280 | intro n |
| 281 | apply Summable.of_nonneg_of_le |
| 282 | (fun k => mul_nonneg (pow_nonneg (weight_pos k).le n) (norm_nonneg _)) |
| 283 | _ ((ha (n + s)).mul_left C) |
| 284 | intro k |
| 285 | have hw := (weight_pos k).le |
| 286 | calc |
| 287 | weight k ^ n * ‖m k * a k‖ = weight k ^ n * (‖m k‖ * ‖a k‖) := by rw [norm_mul] |
| 288 | _ ≤ weight k ^ n * ((C * weight k ^ s) * ‖a k‖) := by |
| 289 | gcongr |
| 290 | exact hm k |
| 291 | _ = _ := by rw [pow_add]; ring |
| 292 | |
| 293 | theorem multiplied_coeff_bound {m a : Frequency → ℂ} {s : ℕ} {C B : ℝ} |
| 294 | (hC : 0 ≤ C) (hm : ∀ k, ‖m k‖ ≤ C * weight k ^ s) |
| 295 | (ha : ∀ k, weight k ^ (s + 4) * ‖a k‖ ≤ B) (k : Frequency) : |
| 296 | ‖m k * a k‖ ≤ (C * B) * (weight k ^ 4)⁻¹ := by |
| 297 | rw [← div_eq_mul_inv] |
| 298 | apply (le_div_iff₀ (pow_pos (weight_pos k) 4)).mpr |
| 299 | calc |
| 300 | ‖m k * a k‖ * weight k ^ 4 ≤ |
| 301 | ((C * weight k ^ s) * ‖a k‖) * weight k ^ 4 := by |
| 302 | rw [norm_mul] |
| 303 | gcongr |
| 304 | exact hm k |
| 305 | _ = C * (weight k ^ (s + 4) * ‖a k‖) := by rw [pow_add]; ring |
| 306 | _ ≤ C * B := mul_le_mul_of_nonneg_left (ha k) hC |
| 307 | |
| 308 | theorem uniform_multiplied_coeff_bound {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 309 | {f : Source} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (a b : ℝ) : |
| 310 | ∃ C : ℝ, 0 ≤ C ∧ ∀ p ∈ Icc a b, ∀ k, |
| 311 | ‖m k * coefficient f p k‖ ≤ C * (weight k ^ 4)⁻¹ := by |
| 312 | obtain ⟨s, M, hM, hm⟩ := hm |
| 313 | obtain ⟨B, hB, hbound⟩ := exists_uniform_coefficient_bound hf hp (s + 4) a b |
| 314 | exact ⟨M * B, mul_nonneg hM hB, fun p hp k => multiplied_coeff_bound hM hm (hbound p hp) k⟩ |
| 315 | |
| 316 | noncomputable def applyMultiplier (m : Frequency → ℂ) (f : Source) (z : Point) : ℂ := |
| 317 | series (fun k => m k * coefficient f z.1 k) z.2 |
| 318 | |
| 319 | theorem multiplied_coeff_rapid {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 320 | {f : Source} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (p : ℝ) : |
| 321 | Rapid (fun k => m k * coefficient f p k) := |
| 322 | hm.rapid_mul (SmoothFourierData.rapid_coefficient (slice_smooth hf p) (hp p)) |
| 323 | |
| 324 | noncomputable def jointDP : Point →L[ℝ] ℝ := ContinuousLinearMap.fst ℝ ℝ Plane |
| 325 | noncomputable def jointDX : Point →L[ℝ] ℝ := |
| 326 | TorusInverse.dx.comp (ContinuousLinearMap.snd ℝ ℝ Plane) |
| 327 | noncomputable def jointDY : Point →L[ℝ] ℝ := |
| 328 | TorusInverse.dy.comp (ContinuousLinearMap.snd ℝ ℝ Plane) |
| 329 | |
| 330 | noncomputable def jointLiftP : ℂ →L[ℝ] (Point →L[ℝ] ℂ) := |
| 331 | ContinuousLinearMap.smulRightL ℝ Point ℂ jointDP |
| 332 | noncomputable def jointLiftX : ℂ →L[ℝ] (Point →L[ℝ] ℂ) := |
| 333 | ContinuousLinearMap.smulRightL ℝ Point ℂ jointDX |
| 334 | noncomputable def jointLiftY : ℂ →L[ℝ] (Point →L[ℝ] ℂ) := |
| 335 | ContinuousLinearMap.smulRightL ℝ Point ℂ jointDY |
| 336 | |
| 337 | @[simp] theorem jointLiftP_apply (c : ℂ) (v : Point) : jointLiftP c v = v.1 • c := rfl |
| 338 | @[simp] theorem jointLiftX_apply (c : ℂ) (v : Point) : jointLiftX c v = v.2.1 • c := rfl |
| 339 | @[simp] theorem jointLiftY_apply (c : ℂ) (v : Point) : jointLiftY c v = v.2.2 • c := rfl |
| 340 | |
| 341 | noncomputable def multiplierTermDerivative (m : Frequency → ℂ) (f : Source) |
| 342 | (k : Frequency) (z : Point) : Point →L[ℝ] ℂ := |
| 343 | jointLiftP (m k * coefficient (parameterPartial f) z.1 k * mode k z.2) + |
| 344 | jointLiftX (multiplierX m k * coefficient f z.1 k * mode k z.2) + |
| 345 | jointLiftY (multiplierY m k * coefficient f z.1 k * mode k z.2) |
| 346 | |
| 347 | theorem hasFDerivAt_multiplierTerm {f : Source} (hf : ContDiff ℝ ∞ f) |
| 348 | (m : Frequency → ℂ) (k : Frequency) (z : Point) : |
| 349 | HasFDerivAt (fun w : Point => m k * coefficient f w.1 k * mode k w.2) |
| 350 | (multiplierTermDerivative m f k z) z := by |
| 351 | have hc : HasFDerivAt (fun w : Point => coefficient f w.1 k) |
| 352 | (jointLiftP (coefficient (parameterPartial f) z.1 k)) z := by |
| 353 | convert! (coefficient_hasDerivAt hf k z.1).hasFDerivAt.comp z |
| 354 | (hasFDerivAt_fst) using 1 |
| 355 | have he : HasFDerivAt (fun w : Point => mode k w.2) |
| 356 | (mode k z.2 • ((phase k).comp (ContinuousLinearMap.snd ℝ ℝ Plane))) z := |
| 357 | ((phase k).hasFDerivAt.comp z (hasFDerivAt_snd)).cexp |
| 358 | have hd : multiplierTermDerivative m f k z = |
| 359 | (m k * coefficient f z.1 k) • |
| 360 | (mode k z.2 • ((phase k).comp (ContinuousLinearMap.snd ℝ ℝ Plane))) + |
| 361 | mode k z.2 • (m k • jointLiftP (coefficient (parameterPartial f) z.1 k)) := by |
| 362 | apply ContinuousLinearMap.ext |
| 363 | intro v |
| 364 | change v.1 • (m k * coefficient (parameterPartial f) z.1 k * mode k z.2) + |
| 365 | v.2.1 • (freqX k * m k * coefficient f z.1 k * mode k z.2) + |
| 366 | v.2.2 • (freqY k * m k * coefficient f z.1 k * mode k z.2) = |
| 367 | (m k * coefficient f z.1 k) • |
| 368 | (mode k z.2 • (v.2.1 • freqX k + v.2.2 • freqY k)) + |
| 369 | mode k z.2 • (m k • (v.1 • coefficient (parameterPartial f) z.1 k)) |
| 370 | simp only [Complex.real_smul, smul_eq_mul] |
| 371 | ring |
| 372 | rw [hd] |
| 373 | exact (hc.const_mul (m k)).mul he |
| 374 | |
| 375 | theorem norm_multiplierTermDerivative_le (m : Frequency → ℂ) (f : Source) |
| 376 | (k : Frequency) (z : Point) : |
| 377 | ‖multiplierTermDerivative m f k z‖ ≤ |
| 378 | ‖jointLiftP‖ * ‖m k * coefficient (parameterPartial f) z.1 k‖ + |
| 379 | ‖jointLiftX‖ * ‖multiplierX m k * coefficient f z.1 k‖ + |
| 380 | ‖jointLiftY‖ * ‖multiplierY m k * coefficient f z.1 k‖ := by |
| 381 | unfold multiplierTermDerivative |
| 382 | apply (norm_add_le _ _).trans |
| 383 | apply add_le_add |
| 384 | · apply (norm_add_le _ _).trans |
| 385 | apply add_le_add |
| 386 | · simpa only [norm_mul, norm_mode, mul_one] using |
| 387 | jointLiftP.le_opNorm (m k * coefficient (parameterPartial f) z.1 k * mode k z.2) |
| 388 | · simpa only [norm_mul, norm_mode, mul_one] using |
| 389 | jointLiftX.le_opNorm (multiplierX m k * coefficient f z.1 k * mode k z.2) |
| 390 | · simpa only [norm_mul, norm_mode, mul_one] using |
| 391 | jointLiftY.le_opNorm (multiplierY m k * coefficient f z.1 k * mode k z.2) |
| 392 | |
| 393 | theorem uniform_multiplierDerivative_bound {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 394 | {f : Source} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (a b : ℝ) : |
| 395 | ∃ C : ℝ, 0 ≤ C ∧ ∀ z : Point, z.1 ∈ Icc a b → ∀ k, |
| 396 | ‖multiplierTermDerivative m f k z‖ ≤ C * (weight k ^ 4)⁻¹ := by |
| 397 | obtain ⟨CP, hCP, hP⟩ := uniform_multiplied_coeff_bound hm |
| 398 | (parameterPartial_smooth hf) (parameterPartial_periodic hp) a b |
| 399 | obtain ⟨CX, hCX, hX⟩ := uniform_multiplied_coeff_bound hm.mulX hf hp a b |
| 400 | obtain ⟨CY, hCY, hY⟩ := uniform_multiplied_coeff_bound hm.mulY hf hp a b |
| 401 | refine ⟨‖jointLiftP‖ * CP + ‖jointLiftX‖ * CX + ‖jointLiftY‖ * CY, by positivity, ?_⟩ |
| 402 | intro z hz k |
| 403 | apply (norm_multiplierTermDerivative_le m f k z).trans |
| 404 | calc |
| 405 | _ ≤ ‖jointLiftP‖ * (CP * (weight k ^ 4)⁻¹) + |
| 406 | ‖jointLiftX‖ * (CX * (weight k ^ 4)⁻¹) + |
| 407 | ‖jointLiftY‖ * (CY * (weight k ^ 4)⁻¹) := by |
| 408 | gcongr |
| 409 | · exact hP z.1 hz k |
| 410 | · exact hX z.1 hz k |
| 411 | · exact hY z.1 hz k |
| 412 | _ = _ := by ring |
| 413 | |
| 414 | theorem hasFDerivAt_applyMultiplier {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 415 | {f : Source} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (z : Point) : |
| 416 | HasFDerivAt (applyMultiplier m f) (∑' k, multiplierTermDerivative m f k z) z := by |
| 417 | obtain ⟨C, hC, hbound⟩ := uniform_multiplierDerivative_bound hm hf hp (z.1 - 1) (z.1 + 1) |
| 418 | have hs : Summable (fun k : Frequency => C * (weight k ^ 4)⁻¹) := |
| 419 | SmoothFourierData.summable_weight_inv_four.mul_left C |
| 420 | have hbox : ∀ w ∈ Metric.ball z 1, w.1 ∈ Icc (z.1 - 1) (z.1 + 1) := by |
| 421 | intro w hw |
| 422 | have hd : dist w.1 z.1 < 1 := by |
| 423 | simpa only [dist_eq_norm, Prod.fst_sub] using |
| 424 | (norm_fst_le (w - z)).trans_lt (show ‖w - z‖ < 1 by |
| 425 | simpa only [dist_eq_norm] using Metric.mem_ball.mp hw) |
| 426 | rw [Real.dist_eq] at hd |
| 427 | constructor <;> linarith [(abs_lt.mp hd).1, (abs_lt.mp hd).2] |
| 428 | exact hasFDerivAt_tsum_of_isPreconnected hs Metric.isOpen_ball |
| 429 | (convex_ball z (1 : ℝ)).isPreconnected |
| 430 | (fun k w _ => hasFDerivAt_multiplierTerm hf m k w) |
| 431 | (fun k w hw => hbound w (hbox w hw) k) |
| 432 | (Metric.mem_ball_self (by norm_num : (0 : ℝ) < 1)) |
| 433 | (summable_terms (multiplied_coeff_rapid hm hf hp z.1) z.2) |
| 434 | (Metric.mem_ball_self (by norm_num : (0 : ℝ) < 1)) |
| 435 | |
| 436 | theorem fderiv_applyMultiplier {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 437 | {f : Source} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (z : Point) : |
| 438 | fderiv ℝ (applyMultiplier m f) z = |
| 439 | jointLiftP (applyMultiplier m (parameterPartial f) z) + |
| 440 | jointLiftX (applyMultiplier (multiplierX m) f z) + |
| 441 | jointLiftY (applyMultiplier (multiplierY m) f z) := by |
| 442 | have hP := summable_terms (multiplied_coeff_rapid hm |
| 443 | (parameterPartial_smooth hf) (parameterPartial_periodic hp) z.1) z.2 |
| 444 | have hX := summable_terms (multiplied_coeff_rapid hm.mulX hf hp z.1) z.2 |
| 445 | have hY := summable_terms (multiplied_coeff_rapid hm.mulY hf hp z.1) z.2 |
| 446 | rw [(hasFDerivAt_applyMultiplier hm hf hp z).fderiv] |
| 447 | simp only [multiplierTermDerivative] |
| 448 | rw [Summable.tsum_add ((jointLiftP.summable hP).add (jointLiftX.summable hX)) |
| 449 | (jointLiftY.summable hY), |
| 450 | Summable.tsum_add (jointLiftP.summable hP) (jointLiftX.summable hX), |
| 451 | ← jointLiftP.map_tsum hP, ← jointLiftX.map_tsum hX, ← jointLiftY.map_tsum hY] |
| 452 | rfl |
| 453 | |
| 454 | /-- Joint smoothness is derived from actual locally uniform Fourier |
| 455 | differentiation, allowing arbitrary polynomially growing multipliers. -/ |
| 456 | theorem applyMultiplier_smooth_nat (n : ℕ) {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 457 | {f : Source} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) : |
| 458 | ContDiff ℝ n (applyMultiplier m f) := by |
| 459 | induction n generalizing m f with |
| 460 | | zero => |
| 461 | exact contDiff_zero.mpr (show Differentiable ℝ (applyMultiplier m f) from |
| 462 | fun z => (hasFDerivAt_applyMultiplier hm hf hp z).differentiableAt).continuous |
| 463 | | succ n ih => |
| 464 | rw [show ((n + 1 : ℕ) : WithTop ℕ∞) = (n : WithTop ℕ∞) + 1 by simp, |
| 465 | contDiff_succ_iff_fderiv] |
| 466 | refine ⟨fun z => (hasFDerivAt_applyMultiplier hm hf hp z).differentiableAt, by simp, ?_⟩ |
| 467 | have he : fderiv ℝ (applyMultiplier m f) = fun z => |
| 468 | jointLiftP (applyMultiplier m (parameterPartial f) z) + |
| 469 | jointLiftX (applyMultiplier (multiplierX m) f z) + |
| 470 | jointLiftY (applyMultiplier (multiplierY m) f z) := |
| 471 | funext (fderiv_applyMultiplier hm hf hp) |
| 472 | rw [he] |
| 473 | exact ((jointLiftP.contDiff.comp |
| 474 | (ih hm (parameterPartial_smooth hf) (parameterPartial_periodic hp))).add |
| 475 | (jointLiftX.contDiff.comp (ih hm.mulX hf hp))).add |
| 476 | (jointLiftY.contDiff.comp (ih hm.mulY hf hp)) |
| 477 | |
| 478 | theorem applyMultiplier_smooth {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 479 | {f : Source} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) : |
| 480 | ContDiff ℝ ∞ (applyMultiplier m f) := |
| 481 | contDiff_infty.mpr (fun n => applyMultiplier_smooth_nat n hm hf hp) |
| 482 | |
| 483 | theorem inverse_smooth (d : Direction) {f : Source} (hf : ContDiff ℝ ∞ f) |
| 484 | (hp : Periodic f) : ContDiff ℝ ∞ (inverse d f) := |
| 485 | applyMultiplier_smooth (inverseMultiplier_growth d) hf hp |
| 486 | |
| 487 | theorem parameterPartial_applyMultiplier {m : Frequency → ℂ} (hm : PolynomialGrowth m) |
| 488 | {f : Source} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) : |
| 489 | parameterPartial (applyMultiplier m f) = applyMultiplier m (parameterPartial f) := by |
| 490 | funext z |
| 491 | simp [parameterPartial, fderiv_applyMultiplier hm hf hp, jointLiftP_apply, |
| 492 | jointLiftX_apply, jointLiftY_apply] |
| 493 | |
| 494 | theorem parameterPartial_inverse (d : Direction) {f : Source} (hf : ContDiff ℝ ∞ f) |
| 495 | (hp : Periodic f) : parameterPartial (inverse d f) = inverse d (parameterPartial f) := |
| 496 | parameterPartial_applyMultiplier (inverseMultiplier_growth d) hf hp |
| 497 | |
| 498 | theorem inverse_periodic (d : Direction) (f : Source) : Periodic (inverse d f) := by |
| 499 | intro p Y k |
| 500 | exact directionalInverse_periodic d (coefficient f p) Y k.1 k.2 |
| 501 | |
| 502 | /-- The inverse has zero mean even if the input has a nonzero constant mode. -/ |
| 503 | theorem inverse_zeroMean (d : Direction) {f : Source} (hf : ContDiff ℝ ∞ f) |
| 504 | (hp : Periodic f) : ZeroMean (inverse d f) := by |
| 505 | intro p |
| 506 | have ha := SmoothFourierData.rapid_coefficient (slice_smooth hf p) (hp p) |
| 507 | let g : C(Torus, ℂ) := |
| 508 | ⟨torusSeries (inverseCoeff d (coefficient f p)), |
| 509 | continuous_torusSeries (ha.inverseCoeff d)⟩ |
| 510 | have hg : SmoothFourierData.torusLift g = slice (inverse d f) p := by |
| 511 | funext Y |
| 512 | exact (series_eq_torusSeries (inverseCoeff d (coefficient f p)) Y).symm |
| 513 | change SmoothFourierData.coefficient (slice (inverse d f) p) 0 = 0 |
| 514 | rw [← hg, SmoothFourierData.coefficient_zero_eq_mean] |
| 515 | exact TorusInverse.inverse_zero_mean d ha |
| 516 | |
| 517 | noncomputable def directionalPartial (d : Direction) (f : Source) (z : Point) : ℂ := |
| 518 | fderiv ℝ f z (0, vector d) |
| 519 | |
| 520 | /-- Exact inversion for the given function, with the derivative taken in the |
| 521 | joint parameter--torus space. -/ |
| 522 | theorem inverse_solves (d : Direction) {f : Source} (hf : ContDiff ℝ ∞ f) |
| 523 | (hp : Periodic f) (hm : ZeroMean f) : directionalPartial d (inverse d f) = f := by |
| 524 | funext z |
| 525 | have hz := SmoothFourierData.inverse_solves_smooth_periodic d |
| 526 | (slice_smooth hf z.1) (hp z.1) (by |
| 527 | change (∫ y in (0 : ℝ)..1, ∫ x in (0 : ℝ)..1, f (z.1, (x, y))) = 0 |
| 528 | rw [← mean_eq_integral] |
| 529 | exact hm z.1) z.2 |
| 530 | have hd := congrArg (fun L : Plane →L[ℝ] ℂ => L (vector d)) |
| 531 | (slice_hasFDerivAt (inverse_smooth d hf hp) z.1 z.2).fderiv |
| 532 | exact hd.symm.trans hz |
| 533 | |
| 534 | theorem inverse_preserves_parameter_support (d : Direction) (f : Source) (S : Set ℝ) |
| 535 | (hs : ∀ p, p ∉ S → ∀ Y, f (p, Y) = 0) : |
| 536 | ∀ p, p ∉ S → ∀ Y, inverse d f (p, Y) = 0 := by |
| 537 | apply TorusInverse.inverse_preserves_parameter_support d (coefficient f) S |
| 538 | intro p hp k |
| 539 | simp only [coefficient, SmoothFourierData.coefficient_eq_doubleIntegral, slice, |
| 540 | hs p hp, mul_zero, intervalIntegral.integral_zero] |
| 541 | |
| 542 | @[simp] theorem parameterJet_zero (f : Source) : parameterJet 0 f = f := rfl |
| 543 | |
| 544 | theorem parameterJet_succ (n : ℕ) (f : Source) : |
| 545 | parameterJet (n + 1) f = parameterPartial (parameterJet n f) := |
| 546 | Function.iterate_succ_apply' _ _ _ |
| 547 | |
| 548 | /-- All actual derivatives in the external parameter commute with inversion. -/ |
| 549 | theorem parameterJet_inverse (d : Direction) {f : Source} (hf : ContDiff ℝ ∞ f) |
| 550 | (hp : Periodic f) (n : ℕ) : |
| 551 | parameterJet n (inverse d f) = inverse d (parameterJet n f) := by |
| 552 | induction n with |
| 553 | | zero => rfl |
| 554 | | succ n ih => |
| 555 | rw [parameterJet_succ, ih, parameterPartial_inverse d (parameterJet_smooth hf n) |
| 556 | (parameterJet_periodic hp n), parameterJet_succ] |
| 557 | |
| 558 | @[simp] theorem iterateInverse_zero (d : Direction) (f : Source) : |
| 559 | iterateInverse d 0 f = f := rfl |
| 560 | |
| 561 | theorem iterateInverse_succ (d : Direction) (n : ℕ) (f : Source) : |
| 562 | iterateInverse d (n + 1) f = inverse d (iterateInverse d n f) := |
| 563 | Function.iterate_succ_apply' _ _ _ |
| 564 | |
| 565 | theorem iterateInverse_periodic (d : Direction) {f : Source} (hp : Periodic f) |
| 566 | (n : ℕ) : Periodic (iterateInverse d n f) := by |
| 567 | induction n with |
| 568 | | zero => exact hp |
| 569 | | succ n ih => |
| 570 | rw [iterateInverse_succ] |
| 571 | exact inverse_periodic d _ |
| 572 | |
| 573 | theorem iterateInverse_smooth (d : Direction) {f : Source} (hf : ContDiff ℝ ∞ f) |
| 574 | (hp : Periodic f) (n : ℕ) : ContDiff ℝ ∞ (iterateInverse d n f) := by |
| 575 | induction n with |
| 576 | | zero => exact hf |
| 577 | | succ n ih => |
| 578 | rw [iterateInverse_succ] |
| 579 | exact inverse_smooth d ih (iterateInverse_periodic d hp n) |
| 580 | |
| 581 | /-- A genuine mixed coordinate jet: first actual parameter derivatives, then |
| 582 | the indicated word of actual torus-coordinate derivatives. -/ |
| 583 | noncomputable def mixedJet (q : ℕ) (w : List Bool) (f : Source) (z : Point) : ℂ := |
| 584 | derivativeWord w (slice (parameterJet q f) z.1) z.2 |
| 585 | |
| 586 | noncomputable def mixedLossConstant (r : ℕ) : ℝ := |
| 587 | ((6 * ‖omega⁻¹‖) * ‖omega‖ ^ r) * 3 ^ (r + 5) * |
| 588 | ∑' k : Frequency, (weight k ^ 4)⁻¹ |
| 589 | |
| 590 | theorem mixedLossConstant_nonneg (r : ℕ) : 0 ≤ mixedLossConstant r := by |
| 591 | unfold mixedLossConstant |
| 592 | positivity |
| 593 | |
| 594 | /-- Uniform finite loss: a mixed output jet with r torus derivatives requires |
| 595 | only r+5 pure torus derivatives of the same parameter jet of the input. |
| 596 | The constant is independent of the parameter set and the function. -/ |
| 597 | theorem mixedJet_inverse_bound (d : Direction) {f : Source} (hf : ContDiff ℝ ∞ f) |
| 598 | (hp : Periodic f) (q : ℕ) (w : List Bool) (S : Set ℝ) {C : ℝ} |
| 599 | (hzero : ∀ p ∈ S, ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 600 | ‖parameterJet q f (p, (x, y))‖ ≤ C) |
| 601 | (hfirst : ∀ p ∈ S, ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 602 | ‖SmoothFourierData.xJet (w.length + 5) (slice (parameterJet q f) p) (x, y)‖ ≤ C) |
| 603 | (hsecond : ∀ p ∈ S, ∀ x ∈ Icc (0 : ℝ) 1, ∀ y ∈ Icc (0 : ℝ) 1, |
| 604 | ‖SmoothFourierData.xJet (w.length + 5) |
| 605 | (SmoothFourierData.swapFunction (slice (parameterJet q f) p)) (x, y)‖ ≤ C) |
| 606 | (p : ℝ) (hps : p ∈ S) (Y : Plane) : |
| 607 | ‖mixedJet q w (inverse d f) (p, Y)‖ ≤ mixedLossConstant w.length * C := by |
| 608 | rw [mixedJet, parameterJet_inverse d hf hp] |
| 609 | have hq := slice_smooth (parameterJet_smooth hf q) p |
| 610 | have hpq := parameterJet_periodic hp q p |
| 611 | have hbound := SmoothFourierData.coefficient_seminorm_bound hq hpq (w.length + 1) |
| 612 | (hzero p hps) (by simpa only [Nat.add_assoc] using hfirst p hps) |
| 613 | (by simpa only [Nat.add_assoc] using hsecond p hps) |
| 614 | calc |
| 615 | _ ≤ ((6 * ‖omega⁻¹‖) * ‖omega‖ ^ w.length) * |
| 616 | coeffSeminorm (w.length + 1) (coefficient (parameterJet q f) p) := |
| 617 | inverse_derivativeWord_bound d (SmoothFourierData.rapid_coefficient hq hpq) w Y |
| 618 | _ ≤ ((6 * ‖omega⁻¹‖) * ‖omega‖ ^ w.length) * |
| 619 | ((3 ^ ((w.length + 1) + 4) * C) * ∑' k : Frequency, (weight k ^ 4)⁻¹) := |
| 620 | mul_le_mul_of_nonneg_left hbound (by positivity) |
| 621 | _ = mixedLossConstant w.length * C := by |
| 622 | simp only [mixedLossConstant, Nat.add_assoc] |
| 623 | ring |
| 624 | |
| 625 | end NavierStokes.ParametricTorusInverse |