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.HarmonicCalculus |
| 2 | import NavierStokes.CylindricalResidual |
| 3 | import NavierStokes.TangentProjection |
| 4 | |
| 5 | /-! |
| 6 | # Exact linear harmonic residual |
| 7 | |
| 8 | Every differential operator uses an actual Fréchet derivative. The coefficient |
| 9 | field supplied to the linearization is arbitrary, so the formula also applies |
| 10 | to a curl-corrected coefficient without replacing it by its tangent principal |
| 11 | part. The angular direction is unscaled. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | namespace NavierStokes.LinearWaveResidual |
| 17 | |
| 18 | open HarmonicCalculus Set Filter |
| 19 | open scoped Topology ContDiff BigOperators |
| 20 | |
| 21 | |
| 22 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 23 | |
| 24 | noncomputable def timeDirection (ε : ℝ) (Vf Vs : E → E) (x : E) : E := |
| 25 | Vf x - ε • Vs x |
| 26 | |
| 27 | theorem along_timeDirection (ε : ℝ) (Vf Vs : E → E) (f : E → ℂ) (x : E) : |
| 28 | along (timeDirection ε Vf Vs) f x = along Vf f x - (ε : ℂ) * along Vs f x := by |
| 29 | simp [along, timeDirection, map_sub, map_smul, Complex.real_smul] |
| 30 | |
| 31 | theorem along_mul_real (V : E → E) {f g : E → ℝ} {x : E} |
| 32 | (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : |
| 33 | along V (fun y => f y * g y) x = along V f x * g x + f x * along V g x := by |
| 34 | simp only [along, fderiv_fun_mul hf hg, _root_.add_apply, |
| 35 | _root_.smul_apply, smul_eq_mul] |
| 36 | ring |
| 37 | |
| 38 | /-- The real base components, with angular velocity `V=R F`. -/ |
| 39 | noncomputable def base (R b F G : E → ℝ) (x : E) : Fin 3 → ℝ := |
| 40 | ![b x, R x * F x, G x] |
| 41 | |
| 42 | noncomputable def complexBase (R b F G : E → ℝ) (x : E) : ComplexVector := |
| 43 | fun i => (base R b F G x i : ℂ) |
| 44 | |
| 45 | /-- Cylindrical bilinear advection, including the derivative of the frame. -/ |
| 46 | noncomputable def transport (R : E → ℝ) (Vr Vθ Vz : E → E) |
| 47 | (u v : E → ComplexVector) (x : E) : ComplexVector := fun i => |
| 48 | u x 0 * along Vr (fun y => v y i) x + |
| 49 | (u x 1 / (R x : ℂ)) * (along Vθ (fun y => v y i) x + angularGenerator (v x) i) + |
| 50 | u x 2 * along Vz (fun y => v y i) x |
| 51 | |
| 52 | noncomputable def gradient (R : E → ℝ) (Vr Vθ Vz : E → E) |
| 53 | (p : E → ℂ) (x : E) : ComplexVector := |
| 54 | ![along Vr p x, (R x)⁻¹ • along Vθ p x, along Vz p x] |
| 55 | |
| 56 | /-- The genuine differential linearization with viscosity `ε`. -/ |
| 57 | noncomputable def linearResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) |
| 58 | (B a : E → ComplexVector) (p : E → ℂ) (x : E) : ComplexVector := fun i => |
| 59 | along Vt (fun y => a y i) x + transport R Vr Vθ Vz B a x i + |
| 60 | transport R Vr Vθ Vz a B x i + gradient R Vr Vθ Vz p x i - |
| 61 | (ε : ℂ) * cylindricalVectorLaplacian R Vr Vθ Vz a x i |
| 62 | |
| 63 | /-- Matrix `K` from (27), with its radial coefficients actually differentiated. -/ |
| 64 | noncomputable def shear (R F G : E → ℝ) (Vr : E → E) |
| 65 | (a : E → ComplexVector) (x : E) : ComplexVector := |
| 66 | ![-2 * (F x : ℂ) * a x 1, |
| 67 | Complex.ofReal (2 * F x + R x * along Vr F x) * a x 0, |
| 68 | Complex.ofReal (along Vr G x) * a x 0] |
| 69 | |
| 70 | /-- The base derivative and radial-flow connection terms outside `K`. -/ |
| 71 | noncomputable def baseDerivativeRemainder (R b F G : E → ℝ) (Vr Vz : E → E) |
| 72 | (a : E → ComplexVector) (x : E) : ComplexVector := fun i => |
| 73 | (![a x 0 * Complex.ofReal (along Vr b x), (b x : ℂ) / (R x : ℂ) * a x 1, 0] i) + |
| 74 | a x 2 * Complex.ofReal (along Vz (fun y => base R b F G y i) x) |
| 75 | |
| 76 | noncomputable def materialPhaseDefect (_R b F G : E → ℝ) (Vr Vθ Vz Vt : E → E) |
| 77 | (Φ : E → ℝ) (x : E) : ℝ := |
| 78 | along Vt Φ x + b x * along Vr Φ x + F x * along Vθ Φ x + G x * along Vz Φ x |
| 79 | |
| 80 | noncomputable def slowTransport (ε : ℝ) (b G : E → ℝ) (Vs Vr Vz : E → E) |
| 81 | (a : E → ComplexVector) (x : E) : ComplexVector := fun i => |
| 82 | -(ε : ℂ) * along Vs (fun y => a y i) x + |
| 83 | (b x : ℂ) * along Vr (fun y => a y i) x + |
| 84 | (G x : ℂ) * along Vz (fun y => a y i) x |
| 85 | |
| 86 | noncomputable def strippedPressureGradient (Vr Vz : E → E) (p : E → ℂ) |
| 87 | (x : E) : ComplexVector := ![along Vr p x, 0, along Vz p x] |
| 88 | |
| 89 | /-- The complete viscous braces in (31), after removal of phase-square damping. -/ |
| 90 | noncomputable def viscousRemainder (R : E → ℝ) (Vr Vθ Vz : E → E) (κ : ℝ) |
| 91 | (Φ : E → ℝ) (a : E → ComplexVector) (x : E) : ComplexVector := fun i => |
| 92 | along Vr (along Vr (fun y => a y i)) x + (R x)⁻¹ • along Vr (fun y => a y i) x + |
| 93 | along Vz (along Vz (fun y => a y i)) x + |
| 94 | ((R x) ^ 2)⁻¹ • angularGenerator (angularGenerator (a x)) i + |
| 95 | 2 * phaseFactor κ * |
| 96 | (Complex.ofReal (phaseNormal R Vr Vθ Vz Φ x 0) * along Vr (fun y => a y i) x + |
| 97 | Complex.ofReal (phaseNormal R Vr Vθ Vz Φ x 2) * along Vz (fun y => a y i) x) + |
| 98 | phaseFactor κ * Complex.ofReal |
| 99 | (along Vr (fun y => phaseNormal R Vr Vθ Vz Φ y 0) x + |
| 100 | phaseNormal R Vr Vθ Vz Φ x 0 / R x + |
| 101 | along Vz (fun y => phaseNormal R Vr Vθ Vz Φ y 2) x) * a x i + |
| 102 | 2 * phaseFactor κ * Complex.ofReal (phaseNormal R Vr Vθ Vz Φ x 1 / R x) * |
| 103 | angularGenerator (a x) i |
| 104 | |
| 105 | noncomputable def principal (ε κ : ℝ) (R F G : E → ℝ) (Vr Vθ Vz Vf : E → E) |
| 106 | (Φ : E → ℝ) (a : E → ComplexVector) (p : E → ℂ) (x : E) : ComplexVector := fun i => |
| 107 | along Vf (fun y => a y i) x + shear R F G Vr a x i + |
| 108 | Complex.ofReal (ε * κ ^ 2 * ‖phaseNormal R Vr Vθ Vz Φ x‖ ^ 2) * a x i + |
| 109 | phaseFactor κ * Complex.ofReal (phaseNormal R Vr Vθ Vz Φ x i) * p x |
| 110 | |
| 111 | noncomputable def remainder (ε κ : ℝ) (R b F G : E → ℝ) (Vr Vθ Vz Vf Vs : E → E) |
| 112 | (Φ : E → ℝ) (a : E → ComplexVector) (p : E → ℂ) (x : E) : ComplexVector := fun i => |
| 113 | slowTransport ε b G Vs Vr Vz a x i + |
| 114 | phaseFactor κ * Complex.ofReal |
| 115 | (materialPhaseDefect R b F G Vr Vθ Vz (timeDirection ε Vf Vs) Φ x) * a x i + |
| 116 | baseDerivativeRemainder R b F G Vr Vz a x i + strippedPressureGradient Vr Vz p x i - |
| 117 | (ε : ℂ) * viscousRemainder R Vr Vθ Vz κ Φ a x i |
| 118 | |
| 119 | theorem differentiableAt_base {R b F G : E → ℝ} {x : E} |
| 120 | (hR : DifferentiableAt ℝ R x) (hb : DifferentiableAt ℝ b x) |
| 121 | (hF : DifferentiableAt ℝ F x) (hG : DifferentiableAt ℝ G x) (i : Fin 3) : |
| 122 | DifferentiableAt ℝ (fun y => base R b F G y i) x := by |
| 123 | fin_cases i |
| 124 | · exact hb |
| 125 | · exact hR.mul hF |
| 126 | · exact hG |
| 127 | |
| 128 | theorem along_complexBase (V : E → E) {R b F G : E → ℝ} {x : E} |
| 129 | (hR : DifferentiableAt ℝ R x) (hb : DifferentiableAt ℝ b x) |
| 130 | (hF : DifferentiableAt ℝ F x) (hG : DifferentiableAt ℝ G x) (i : Fin 3) : |
| 131 | along V (fun y => complexBase R b F G y i) x = |
| 132 | Complex.ofReal (along V (fun y => base R b F G y i) x) := |
| 133 | along_ofReal V (differentiableAt_base hR hb hF hG i) |
| 134 | |
| 135 | theorem gradient_mode (R : E → ℝ) (Vr Vθ Vz : E → E) (κ : ℝ) |
| 136 | {Φ : E → ℝ} {p : E → ℂ} {x : E} |
| 137 | (hΦ : DifferentiableAt ℝ Φ x) (hp : DifferentiableAt ℝ p x) |
| 138 | (hpθ : along Vθ p x = 0) : |
| 139 | gradient R Vr Vθ Vz (mode κ Φ p) x = fun i => |
| 140 | (strippedPressureGradient Vr Vz p x i + |
| 141 | phaseFactor κ * Complex.ofReal (phaseNormal R Vr Vθ Vz Φ x i) * p x) * carrier κ Φ x := by |
| 142 | ext i |
| 143 | fin_cases i <;> |
| 144 | simp [gradient, strippedPressureGradient, phaseNormal, along_mode _ κ hΦ hp, |
| 145 | hpθ, Complex.real_smul, div_eq_mul_inv] |
| 146 | all_goals ring |
| 147 | |
| 148 | /-- The two linear advection terms produce `K` and exactly the displayed |
| 149 | base-derivative and radial-flow connection terms. -/ |
| 150 | theorem linearAdvection_mode (R b F G : E → ℝ) (Vr Vθ Vz : E → E) (κ : ℝ) |
| 151 | {Φ : E → ℝ} {a : E → ComplexVector} {x : E} |
| 152 | (hR : DifferentiableAt ℝ R x) (hb : DifferentiableAt ℝ b x) |
| 153 | (hF : DifferentiableAt ℝ F x) (hG : DifferentiableAt ℝ G x) |
| 154 | (hRx : R x ≠ 0) (hDr : along Vr R x = 1) |
| 155 | (hBθ : ∀ i, along Vθ (fun y => base R b F G y i) x = 0) |
| 156 | (hΦ : DifferentiableAt ℝ Φ x) |
| 157 | (ha : ∀ i, DifferentiableAt ℝ (fun y => a y i) x) |
| 158 | (haθ : ∀ i, along Vθ (fun y => a y i) x = 0) : |
| 159 | (fun i => transport R Vr Vθ Vz (complexBase R b F G) (vectorMode κ Φ a) x i + |
| 160 | transport R Vr Vθ Vz (vectorMode κ Φ a) (complexBase R b F G) x i) = fun i => |
| 161 | ((b x : ℂ) * along Vr (fun y => a y i) x + |
| 162 | (G x : ℂ) * along Vz (fun y => a y i) x + shear R F G Vr a x i + |
| 163 | baseDerivativeRemainder R b F G Vr Vz a x i + |
| 164 | phaseFactor κ * Complex.ofReal |
| 165 | (b x * along Vr Φ x + F x * along Vθ Φ x + G x * along Vz Φ x) * a x i) * |
| 166 | carrier κ Φ x := by |
| 167 | have hmode (V : E → E) (i : Fin 3) : |
| 168 | along V (fun y => vectorMode κ Φ a y i) x = |
| 169 | (along V (fun y => a y i) x + |
| 170 | phaseFactor κ * Complex.ofReal (along V Φ x) * a x i) * carrier κ Φ x := |
| 171 | along_mode V κ hΦ (ha i) |
| 172 | have hbase (V : E → E) (i : Fin 3) := along_complexBase V hR hb hF hG i |
| 173 | have hrad : along Vr (fun y => R y * F y) x = F x + R x * along Vr F x := by |
| 174 | rw [along_mul_real Vr hR hF, hDr, one_mul] |
| 175 | have hrC : (R x : ℂ) ≠ 0 := by exact_mod_cast hRx |
| 176 | ext i |
| 177 | fin_cases i <;> |
| 178 | simp only [transport, hmode, hbase, haθ, hBθ, Complex.ofReal_zero, |
| 179 | zero_add] <;> |
| 180 | simp [complexBase, base, vectorMode, mode, shear, baseDerivativeRemainder, |
| 181 | angularGenerator, Complex.ofReal_add, Complex.ofReal_mul, hrad] <;> |
| 182 | field_simp [hrC] <;> ring |
| 183 | |
| 184 | /-- The scalar and frame Laplacian identities assembled into the viscous |
| 185 | braces of (31), with the phase-square term separated. -/ |
| 186 | theorem vectorLaplacian_mode_split {U : Set E} (R : E → ℝ) |
| 187 | {Vr Vθ Vz : E → E} (κ : ℝ) {Φ : E → ℝ} {a : E → ComplexVector} {pθ : ℝ} {x : E} |
| 188 | (hU : IsOpen U) (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) |
| 189 | (hz : ContDiffOn ℝ ∞ Vz U) (hΦ : ContDiffOn ℝ ∞ Φ U) |
| 190 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 191 | (haθ : ∀ i, EqOn (along Vθ (fun y => a y i)) (fun _ => 0) U) |
| 192 | (hΦθ : EqOn (along Vθ Φ) (fun _ => pθ) U) (hx : x ∈ U) : |
| 193 | cylindricalVectorLaplacian R Vr Vθ Vz (vectorMode κ Φ a) x = fun i => |
| 194 | (viscousRemainder R Vr Vθ Vz κ Φ a x i - |
| 195 | (κ : ℂ) ^ 2 * Complex.ofReal (‖phaseNormal R Vr Vθ Vz Φ x‖ ^ 2) * a x i) * |
| 196 | carrier κ Φ x := by |
| 197 | rw [cylindricalVectorLaplacian_vectorMode R κ hU hr hθ hz hΦ ha hx, |
| 198 | cylindricalVectorLaplacian_angular_independent R Vr Vθ Vz hU haθ hx, |
| 199 | cylindricalLaplacian_phase R Vr Vθ Vz hU hΦθ hx] |
| 200 | ext i |
| 201 | simp [viscousRemainder, phaseCross, haθ i hx, phaseNormal] |
| 202 | ring |
| 203 | |
| 204 | /-- Full identity (31) for the actual amplitude supplied to the linear |
| 205 | operator. The principal and remainder are both explicitly defined above. -/ |
| 206 | theorem linearResidual_mode_split {U : Set E} (ε κ : ℝ) (R b F G : E → ℝ) |
| 207 | {Vr Vθ Vz : E → E} (Vf Vs : E → E) {Φ : E → ℝ} {a : E → ComplexVector} |
| 208 | {p : E → ℂ} {pθ : ℝ} {x : E} |
| 209 | (hU : IsOpen U) (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) |
| 210 | (hz : ContDiffOn ℝ ∞ Vz U) (hΦ : ContDiffOn ℝ ∞ Φ U) |
| 211 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 212 | (hR : DifferentiableAt ℝ R x) (hb : DifferentiableAt ℝ b x) |
| 213 | (hF : DifferentiableAt ℝ F x) (hG : DifferentiableAt ℝ G x) |
| 214 | (hRx : R x ≠ 0) (hDr : along Vr R x = 1) |
| 215 | (hBθ : ∀ i, along Vθ (fun y => base R b F G y i) x = 0) |
| 216 | (haθ : ∀ i, EqOn (along Vθ (fun y => a y i)) (fun _ => 0) U) |
| 217 | (hΦθ : EqOn (along Vθ Φ) (fun _ => pθ) U) |
| 218 | (hp : DifferentiableAt ℝ p x) (hpθ : along Vθ p x = 0) (hx : x ∈ U) : |
| 219 | linearResidual ε R Vr Vθ Vz (timeDirection ε Vf Vs) (complexBase R b F G) |
| 220 | (vectorMode κ Φ a) (mode κ Φ p) x = fun i => |
| 221 | (principal ε κ R F G Vr Vθ Vz Vf Φ a p x i + |
| 222 | remainder ε κ R b F G Vr Vθ Vz Vf Vs Φ a p x i) * carrier κ Φ x := by |
| 223 | have dΦ := (hΦ.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) |
| 224 | have da i := ((ha i).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) |
| 225 | have hadv := linearAdvection_mode R b F G Vr Vθ Vz κ hR hb hF hG hRx hDr hBθ dΦ da |
| 226 | (fun i => haθ i hx) |
| 227 | have hlap := vectorLaplacian_mode_split R κ hU hr hθ hz hΦ ha haθ hΦθ hx |
| 228 | have hg := gradient_mode R Vr Vθ Vz κ dΦ hp hpθ |
| 229 | ext i |
| 230 | have hadvi := congrFun hadv i |
| 231 | have hlapi := congrFun hlap i |
| 232 | have hgi := congrFun hg i |
| 233 | unfold linearResidual |
| 234 | rw [show along (timeDirection ε Vf Vs) (fun y => vectorMode κ Φ a y i) x = |
| 235 | (along (timeDirection ε Vf Vs) (fun y => a y i) x + |
| 236 | phaseFactor κ * Complex.ofReal (along (timeDirection ε Vf Vs) Φ x) * a x i) * |
| 237 | carrier κ Φ x from along_mode _ κ dΦ (da i)] |
| 238 | rw [add_assoc _ (transport R Vr Vθ Vz (complexBase R b F G) (vectorMode κ Φ a) x i) |
| 239 | (transport R Vr Vθ Vz (vectorMode κ Φ a) (complexBase R b F G) x i)] |
| 240 | rw [hadvi, hlapi, hgi] |
| 241 | simp only [principal, remainder, slowTransport, materialPhaseDefect, along_timeDirection, |
| 242 | Complex.ofReal_add, Complex.ofReal_mul, Complex.ofReal_pow] |
| 243 | ring |
| 244 | |
| 245 | /-! ## Actual slot phase and projected pressure -/ |
| 246 | |
| 247 | /-- The material defect used in the residual is the actual backward-time |
| 248 | material derivative already computed in `PhaseCalculus`. -/ |
| 249 | theorem materialPhaseDefect_slot (ε p pz x₀ : ℝ) (b F G : PhaseCalculus.Slow → ℝ) |
| 250 | (q : PhaseCalculus.Slot) (hR : q.1.1 ≠ 0) : |
| 251 | materialPhaseDefect (fun y : PhaseCalculus.Slot => y.1.1) |
| 252 | (fun y => b y.1) (fun y => F y.1) (fun y => G y.1) |
| 253 | (fun _ => PhaseCalculus.eR) (fun _ => PhaseCalculus.eTheta) |
| 254 | (fun _ => ε • PhaseCalculus.eZ) |
| 255 | (timeDirection ε (fun _ => PhaseCalculus.eV) (fun _ => PhaseCalculus.eT)) |
| 256 | (PhaseCalculus.phase ε p pz x₀ F G) q = |
| 257 | PhaseCalculus.backwardMaterialOp ε b F G (PhaseCalculus.phase ε p pz x₀ F G) q := by |
| 258 | unfold materialPhaseDefect PhaseCalculus.backwardMaterialOp PhaseCalculus.signedMaterialOp |
| 259 | simp only [along, timeDirection, map_sub, map_smul, smul_eq_mul, PhaseCalculus.baseV] |
| 260 | field_simp [hR] ; ring |
| 261 | |
| 262 | /-- Explicit formula for the phase material defect, including the sign of |
| 263 | the slow-time term. No estimate for this term is assumed. -/ |
| 264 | theorem materialPhaseDefect_slot_formula (ε p pz x₀ : ℝ) |
| 265 | (b F G : PhaseCalculus.Slow → ℝ) (q : PhaseCalculus.Slot) |
| 266 | (hε : ε ≠ 0) (hR : 0 < q.1.1) |
| 267 | (hF : DifferentiableAt ℝ F q.1) (hG : DifferentiableAt ℝ G q.1) : |
| 268 | materialPhaseDefect (fun y : PhaseCalculus.Slot => y.1.1) |
| 269 | (fun y => b y.1) (fun y => F y.1) (fun y => G y.1) |
| 270 | (fun _ => PhaseCalculus.eR) (fun _ => PhaseCalculus.eTheta) |
| 271 | (fun _ => ε • PhaseCalculus.eZ) |
| 272 | (timeDirection ε (fun _ => PhaseCalculus.eV) (fun _ => PhaseCalculus.eT)) |
| 273 | (PhaseCalculus.phase ε p pz x₀ F G) q = |
| 274 | b q.1 * x₀ - q.2.2 * |
| 275 | (b q.1 * (p * PhaseCalculus.slowR F q.1 + pz * PhaseCalculus.slowR G q.1) - |
| 276 | ε * (p * PhaseCalculus.slowT F q.1 + pz * PhaseCalculus.slowT G q.1) + |
| 277 | ε * G q.1 * (p * PhaseCalculus.slowZ F q.1 + pz * PhaseCalculus.slowZ G q.1)) := by |
| 278 | rw [materialPhaseDefect_slot ε p pz x₀ b F G q (ne_of_gt hR)] |
| 279 | exact PhaseCalculus.backwardMaterialOp_phase ε p pz x₀ b F G q hε hR hF hG |
| 280 | |
| 281 | /-- Numerator in the pressure from the projected equation. The derivative |
| 282 | of `n` is the actual derivative in the fast direction. -/ |
| 283 | noncomputable def projectionNumerator (Vf : E → E) (n : E → EuclideanSpace ℝ (Fin 3)) |
| 284 | (a Ka f : E → ComplexVector) (x : E) : ℂ := |
| 285 | normalDot (n x) (Ka x) - normalDot (along Vf n x) (a x) + normalDot (n x) (f x) |
| 286 | |
| 287 | noncomputable def projectedPressure (κ : ℝ) (Vf : E → E) |
| 288 | (n : E → EuclideanSpace ℝ (Fin 3)) (a Ka f : E → ComplexVector) (x : E) : ℂ := |
| 289 | (Complex.I / (κ : ℂ)) * projectionNumerator Vf n a Ka f x / |
| 290 | Complex.ofReal (‖n x‖ ^ 2) |
| 291 | |
| 292 | /-! ## Real-linear transfer of the complex calculation -/ |
| 293 | |
| 294 | section LinearMaps |
| 295 | |
| 296 | variable {F₁ F₂ : Type*} [NormedAddCommGroup F₁] [NormedSpace ℝ F₁] |
| 297 | [NormedAddCommGroup F₂] [NormedSpace ℝ F₂] |
| 298 | |
| 299 | theorem along_map (L : F₁ →L[ℝ] F₂) (V : E → E) {f : E → F₁} {x : E} |
| 300 | (hf : DifferentiableAt ℝ f x) : |
| 301 | along V (fun y => L (f y)) x = L (along V f x) := by |
| 302 | have hd := (L.hasFDerivAt.comp x hf.hasFDerivAt).fderiv |
| 303 | dsimp only [Function.comp_def] at hd |
| 304 | unfold along |
| 305 | rw [hd] |
| 306 | rfl |
| 307 | |
| 308 | theorem along_along_map (L : F₁ →L[ℝ] F₂) {U : Set E} {V : E → E} |
| 309 | {f : E → F₁} {x : E} (hU : IsOpen U) (hV : ContDiffOn ℝ ∞ V U) |
| 310 | (hf : ContDiffOn ℝ ∞ f U) (hx : x ∈ U) : |
| 311 | along V (along V (fun y => L (f y))) x = L (along V (along V f) x) := by |
| 312 | have he : EqOn (along V (fun y => L (f y))) (fun y => L (along V f y)) U := by |
| 313 | intro y hy |
| 314 | exact along_map L V ((hf.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) |
| 315 | rw [along_congr hU he hx] |
| 316 | exact along_map L V |
| 317 | (((contDiffOn_along hU hV hf).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 318 | |
| 319 | theorem cylindricalLaplacian_map (L : F₁ →L[ℝ] F₂) {U : Set E} (R : E → ℝ) |
| 320 | {Vr Vθ Vz : E → E} {f : E → F₁} {x : E} (hU : IsOpen U) |
| 321 | (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) |
| 322 | (hz : ContDiffOn ℝ ∞ Vz U) (hf : ContDiffOn ℝ ∞ f U) (hx : x ∈ U) : |
| 323 | cylindricalLaplacian R Vr Vθ Vz (fun y => L (f y)) x = |
| 324 | L (cylindricalLaplacian R Vr Vθ Vz f x) := by |
| 325 | simp only [cylindricalLaplacian, along_along_map L hU hr hf hx, |
| 326 | along_along_map L hU hθ hf hx, along_along_map L hU hz hf hx, |
| 327 | along_map L Vr ((hf.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)), |
| 328 | map_add, map_smul] |
| 329 | |
| 330 | end LinearMaps |
| 331 | |
| 332 | noncomputable def realLift (a : E → Fin 3 → ℝ) (x : E) : ComplexVector := fun i => (a x i : ℂ) |
| 333 | |
| 334 | noncomputable def realAngularGenerator (a : Fin 3 → ℝ) : Fin 3 → ℝ := ![-a 1, a 0, 0] |
| 335 | |
| 336 | noncomputable def realTransport (R : E → ℝ) (Vr Vθ Vz : E → E) |
| 337 | (u v : E → Fin 3 → ℝ) (x : E) : Fin 3 → ℝ := fun i => |
| 338 | u x 0 * along Vr (fun y => v y i) x + |
| 339 | (u x 1 / R x) * (along Vθ (fun y => v y i) x + realAngularGenerator (v x) i) + |
| 340 | u x 2 * along Vz (fun y => v y i) x |
| 341 | |
| 342 | noncomputable def realFrameLaplacian (R : E → ℝ) (Vr Vθ Vz : E → E) |
| 343 | (a : E → Fin 3 → ℝ) (x : E) : Fin 3 → ℝ := fun i => |
| 344 | cylindricalLaplacian R Vr Vθ Vz (fun y => a y i) x + ((R x) ^ 2)⁻¹ * |
| 345 | (2 * realAngularGenerator (fun j => along Vθ (fun y => a y j) x) i + |
| 346 | realAngularGenerator (realAngularGenerator (a x)) i) |
| 347 | |
| 348 | /-- Real component form of the same differential linearization. -/ |
| 349 | noncomputable def realComponentLinearResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) |
| 350 | (B a : E → Fin 3 → ℝ) (p : E → ℝ) (x : E) : Fin 3 → ℝ := fun i => |
| 351 | along Vt (fun y => a y i) x + realTransport R Vr Vθ Vz B a x i + |
| 352 | realTransport R Vr Vθ Vz a B x i + |
| 353 | (![along Vr p x, (R x)⁻¹ * along Vθ p x, along Vz p x] i) - |
| 354 | ε * realFrameLaplacian R Vr Vθ Vz a x i |
| 355 | |
| 356 | theorem map_ofReal_mul (L : ℂ →L[ℝ] ℝ) (r : ℝ) (z : ℂ) : |
| 357 | L ((r : ℂ) * z) = r * L z := by |
| 358 | change L (r • z) = _ |
| 359 | rw [map_smul] |
| 360 | rfl |
| 361 | |
| 362 | theorem map_mul_ofReal (L : ℂ →L[ℝ] ℝ) (r : ℝ) (z : ℂ) : |
| 363 | L (z * (r : ℂ)) = L z * r := by |
| 364 | rw [mul_comm, map_ofReal_mul] |
| 365 | ring |
| 366 | |
| 367 | theorem map_div_ofReal (L : ℂ →L[ℝ] ℝ) (r : ℝ) (z : ℂ) : |
| 368 | L (z / (r : ℂ)) = L z / r := by |
| 369 | rw [div_eq_mul_inv, ← Complex.ofReal_inv, map_mul_ofReal, div_eq_mul_inv] |
| 370 | |
| 371 | theorem map_two_mul (L : ℂ →L[ℝ] ℝ) (z : ℂ) : L (2 * z) = 2 * L z := |
| 372 | map_ofReal_mul L 2 z |
| 373 | |
| 374 | /-- The complex linearization transfers through any real continuous linear |
| 375 | functional, in particular real and imaginary parts, because its base is real. -/ |
| 376 | theorem realMap_linearResidual {U : Set E} (L : ℂ →L[ℝ] ℝ) (ε : ℝ) (R : E → ℝ) |
| 377 | {Vr Vθ Vz : E → E} (Vt : E → E) {B : E → Fin 3 → ℝ} |
| 378 | {a : E → ComplexVector} {p : E → ℂ} {x : E} |
| 379 | (hU : IsOpen U) (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) |
| 380 | (hz : ContDiffOn ℝ ∞ Vz U) (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 381 | (hB : ∀ i, DifferentiableAt ℝ (fun y => B y i) x) |
| 382 | (hp : DifferentiableAt ℝ p x) (hx : x ∈ U) : |
| 383 | (fun i => L (linearResidual ε R Vr Vθ Vz Vt (realLift B) a p x i)) = |
| 384 | realComponentLinearResidual ε R Vr Vθ Vz Vt B |
| 385 | (fun y i => L (a y i)) (fun y => L (p y)) x := by |
| 386 | have da i := ((ha i).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) |
| 387 | have hD (V : E → E) (i : Fin 3) := along_map L V (da i) |
| 388 | have hDB (V : E → E) (i : Fin 3) := along_ofReal V (hB i) |
| 389 | have hLap i := cylindricalLaplacian_map L R hU hr hθ hz (ha i) hx |
| 390 | ext i |
| 391 | fin_cases i <;> |
| 392 | simp [linearResidual, realComponentLinearResidual, transport, realTransport, realLift, |
| 393 | gradient, cylindricalVectorLaplacian, realFrameLaplacian, angularGenerator, |
| 394 | realAngularGenerator, hD, hDB, hLap, along_map L _ hp, |
| 395 | ← Complex.ofReal_div, map_ofReal_mul, map_mul_ofReal, map_add, |
| 396 | map_sub, map_neg, Complex.real_smul] <;> |
| 397 | simp only [← Complex.ofReal_neg, ← Complex.ofReal_add, ← Complex.ofReal_pow, |
| 398 | ← Complex.ofReal_inv, map_ofReal_mul, map_mul_ofReal, map_div_ofReal, map_two_mul, |
| 399 | true_or] <;> ring |
| 400 | |
| 401 | /-! ## The actual Cartesian and cylindrical linearizations -/ |
| 402 | |
| 403 | open ProblemStatement |
| 404 | |
| 405 | noncomputable def bilinearAdvection (u v : Space → Space) (q : Space) : Space := |
| 406 | u q 0 • CylindricalResidual.dCoord 0 v q + |
| 407 | (u q 1 / q 0) • (CylindricalResidual.dCoord 1 v q + CylindricalResidual.connection (v q)) + |
| 408 | u q 2 • CylindricalResidual.dCoord 2 v q |
| 409 | |
| 410 | theorem cartesianBilinearAdvection_components {u v : Space → Space} {q : Space} |
| 411 | (hv : DifferentiableAt ℝ v (CylindricalResidual.chart q)) (hr : q 0 ≠ 0) : |
| 412 | fderiv ℝ v (CylindricalResidual.chart q) (u (CylindricalResidual.chart q)) = |
| 413 | CylindricalResidual.frame (q 1) |
| 414 | (bilinearAdvection (CylindricalResidual.components u) (CylindricalResidual.components v) q) := by |
| 415 | have he := CylindricalResidual.cartesianDerivative_components hv hr |
| 416 | (CylindricalResidual.components u q) |
| 417 | have hu : CylindricalResidual.frame (q 1) (CylindricalResidual.components u q) = |
| 418 | u (CylindricalResidual.chart q) := CylindricalResidual.frame_inverse' _ _ |
| 419 | rw [hu] at he |
| 420 | have he' := congrArg (CylindricalResidual.frame (q 1)) he |
| 421 | simp only [CylindricalResidual.frame_inverse'] at he' |
| 422 | exact he' |
| 423 | |
| 424 | noncomputable def spaceDirection (i : Fin 3) (_ : SpaceTime) : SpaceTime := |
| 425 | (0, coordinateVector i) |
| 426 | |
| 427 | noncomputable def physicalTimeDirection (_ : SpaceTime) : SpaceTime := (1, 0) |
| 428 | |
| 429 | noncomputable def coordinateRadius (x : SpaceTime) : ℝ := x.2 0 |
| 430 | |
| 431 | section Slices |
| 432 | |
| 433 | variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] |
| 434 | |
| 435 | theorem along_space_slice {f : SpaceTime → W} {t : ℝ} {q : Space} |
| 436 | (hf : DifferentiableAt ℝ f (t, q)) (i : Fin 3) : |
| 437 | along (spaceDirection i) f (t, q) = CylindricalResidual.dCoord i (fun y => f (t, y)) q := by |
| 438 | have hd := (hf.hasFDerivAt.comp q (hasFDerivAt_prodMk_right t q)).fderiv |
| 439 | dsimp only [Function.comp_def] at hd |
| 440 | unfold along CylindricalResidual.dCoord spaceDirection |
| 441 | rw [hd] |
| 442 | rfl |
| 443 | |
| 444 | theorem along_time_slice {f : SpaceTime → W} {t : ℝ} {q : Space} |
| 445 | (hf : DifferentiableAt ℝ f (t, q)) : |
| 446 | along physicalTimeDirection f (t, q) = fderiv ℝ (fun s => f (s, q)) t 1 := by |
| 447 | have hd := (hf.hasFDerivAt.comp t (hasFDerivAt_prodMk_left (𝕜 := ℝ) t q)).fderiv |
| 448 | dsimp only [Function.comp_def] at hd |
| 449 | unfold along physicalTimeDirection |
| 450 | rw [hd] |
| 451 | rfl |
| 452 | |
| 453 | theorem along_space_space_slice {U : Set SpaceTime} {f : SpaceTime → W} {t : ℝ} {q : Space} |
| 454 | (hU : IsOpen U) (hf : ContDiffOn ℝ ∞ f U) (hx : (t, q) ∈ U) (i : Fin 3) : |
| 455 | along (spaceDirection i) (along (spaceDirection i) f) (t, q) = |
| 456 | CylindricalResidual.dCoord i (CylindricalResidual.dCoord i (fun y => f (t, y))) q := by |
| 457 | have hd := contDiffOn_along hU (show ContDiffOn ℝ ∞ (spaceDirection i) U from contDiffOn_const) hf |
| 458 | rw [along_space_slice ((hd.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp))] |
| 459 | apply CylindricalResidual.dCoord_congr |
| 460 | have hn : {y : Space | (t, y) ∈ U} ∈ 𝓝 q := |
| 461 | (continuous_const.prodMk continuous_id).continuousAt.preimage_mem_nhds (hU.mem_nhds hx) |
| 462 | filter_upwards [hn] with y hy |
| 463 | exact along_space_slice ((hf.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) i |
| 464 | |
| 465 | theorem laplacian_space_slice {U : Set SpaceTime} {f : SpaceTime → W} {t : ℝ} {q : Space} |
| 466 | (hU : IsOpen U) (hf : ContDiffOn ℝ ∞ f U) (hx : (t, q) ∈ U) : |
| 467 | cylindricalLaplacian coordinateRadius (spaceDirection 0) (spaceDirection 1) (spaceDirection 2) |
| 468 | f (t, q) = CylindricalResidual.scalarLaplacian (fun y => f (t, y)) q := by |
| 469 | unfold cylindricalLaplacian CylindricalResidual.scalarLaplacian coordinateRadius |
| 470 | rw [along_space_space_slice hU hf hx 0, along_space_space_slice hU hf hx 1, |
| 471 | along_space_space_slice hU hf hx 2, |
| 472 | along_space_slice ((hf.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) 0] |
| 473 | |
| 474 | end Slices |
| 475 | |
| 476 | end NavierStokes.LinearWaveResidual |