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 | /-- Scaling a prescribed fast direction produces exactly the manuscript's |
| 248 | prefactor, for example `c = Q^(1+h)` multiplying `Nabs`. -/ |
| 249 | theorem along_scaled_direction (c : ℝ) (V : E → E) (f : E → ℂ) (x : E) : |
| 250 | along (fun y => c • V y) f x = (c : ℂ) * along V f x := by |
| 251 | simp [along, map_smul, Complex.real_smul] |
| 252 | |
| 253 | /-- The material defect used in the residual is the actual backward-time |
| 254 | material derivative already computed in `PhaseCalculus`. -/ |
| 255 | theorem materialPhaseDefect_slot (ε p pz x₀ : ℝ) (b F G : PhaseCalculus.Slow → ℝ) |
| 256 | (q : PhaseCalculus.Slot) (hR : q.1.1 ≠ 0) : |
| 257 | materialPhaseDefect (fun y : PhaseCalculus.Slot => y.1.1) |
| 258 | (fun y => b y.1) (fun y => F y.1) (fun y => G y.1) |
| 259 | (fun _ => PhaseCalculus.eR) (fun _ => PhaseCalculus.eTheta) |
| 260 | (fun _ => ε • PhaseCalculus.eZ) |
| 261 | (timeDirection ε (fun _ => PhaseCalculus.eV) (fun _ => PhaseCalculus.eT)) |
| 262 | (PhaseCalculus.phase ε p pz x₀ F G) q = |
| 263 | PhaseCalculus.backwardMaterialOp ε b F G (PhaseCalculus.phase ε p pz x₀ F G) q := by |
| 264 | unfold materialPhaseDefect PhaseCalculus.backwardMaterialOp PhaseCalculus.signedMaterialOp |
| 265 | simp only [along, timeDirection, map_sub, map_smul, smul_eq_mul, PhaseCalculus.baseV] |
| 266 | field_simp [hR] ; ring |
| 267 | |
| 268 | /-- Explicit formula for the phase material defect, including the sign of |
| 269 | the slow-time term. No estimate for this term is assumed. -/ |
| 270 | theorem materialPhaseDefect_slot_formula (ε p pz x₀ : ℝ) |
| 271 | (b F G : PhaseCalculus.Slow → ℝ) (q : PhaseCalculus.Slot) |
| 272 | (hε : ε ≠ 0) (hR : 0 < q.1.1) |
| 273 | (hF : DifferentiableAt ℝ F q.1) (hG : DifferentiableAt ℝ G q.1) : |
| 274 | materialPhaseDefect (fun y : PhaseCalculus.Slot => y.1.1) |
| 275 | (fun y => b y.1) (fun y => F y.1) (fun y => G y.1) |
| 276 | (fun _ => PhaseCalculus.eR) (fun _ => PhaseCalculus.eTheta) |
| 277 | (fun _ => ε • PhaseCalculus.eZ) |
| 278 | (timeDirection ε (fun _ => PhaseCalculus.eV) (fun _ => PhaseCalculus.eT)) |
| 279 | (PhaseCalculus.phase ε p pz x₀ F G) q = |
| 280 | b q.1 * x₀ - q.2.2 * |
| 281 | (b q.1 * (p * PhaseCalculus.slowR F q.1 + pz * PhaseCalculus.slowR G q.1) - |
| 282 | ε * (p * PhaseCalculus.slowT F q.1 + pz * PhaseCalculus.slowT G q.1) + |
| 283 | ε * G q.1 * (p * PhaseCalculus.slowZ F q.1 + pz * PhaseCalculus.slowZ G q.1)) := by |
| 284 | rw [materialPhaseDefect_slot ε p pz x₀ b F G q (ne_of_gt hR)] |
| 285 | exact PhaseCalculus.backwardMaterialOp_phase ε p pz x₀ b F G q hε hR hF hG |
| 286 | |
| 287 | /-- A base coefficient depending only on slow coordinates has precisely |
| 288 | the slow differential along a slot direction. -/ |
| 289 | theorem slot_base_derivative (f : PhaseCalculus.Slow → ℝ) (q w : PhaseCalculus.Slot) |
| 290 | (hf : DifferentiableAt ℝ f q.1) : |
| 291 | along (fun _ => w) (fun y : PhaseCalculus.Slot => f y.1) q = fderiv ℝ f q.1 w.1 := by |
| 292 | have hd := (hf.hasFDerivAt.comp q (hasFDerivAt_id (𝕜 := ℝ) q).fst).fderiv |
| 293 | dsimp only [Function.comp_def] at hd |
| 294 | unfold along |
| 295 | rw [hd] |
| 296 | rfl |
| 297 | |
| 298 | theorem slot_base_radial (f : PhaseCalculus.Slow → ℝ) (q : PhaseCalculus.Slot) |
| 299 | (hf : DifferentiableAt ℝ f q.1) : |
| 300 | along (fun _ => PhaseCalculus.eR) (fun y : PhaseCalculus.Slot => f y.1) q = |
| 301 | PhaseCalculus.slowR f q.1 := slot_base_derivative f q PhaseCalculus.eR hf |
| 302 | |
| 303 | theorem slot_base_angular (f : PhaseCalculus.Slow → ℝ) (q : PhaseCalculus.Slot) |
| 304 | (hf : DifferentiableAt ℝ f q.1) : |
| 305 | along (fun _ => PhaseCalculus.eTheta) (fun y : PhaseCalculus.Slot => f y.1) q = 0 := by |
| 306 | rw [slot_base_derivative f q PhaseCalculus.eTheta hf] |
| 307 | change fderiv ℝ f q.1 0 = 0 |
| 308 | exact map_zero _ |
| 309 | |
| 310 | /-- Numerator in the pressure from the projected equation. The derivative |
| 311 | of `n` is the actual derivative in the fast direction. -/ |
| 312 | noncomputable def projectionNumerator (Vf : E → E) (n : E → EuclideanSpace ℝ (Fin 3)) |
| 313 | (a Ka f : E → ComplexVector) (x : E) : ℂ := |
| 314 | normalDot (n x) (Ka x) - normalDot (along Vf n x) (a x) + normalDot (n x) (f x) |
| 315 | |
| 316 | noncomputable def projectedPressure (κ : ℝ) (Vf : E → E) |
| 317 | (n : E → EuclideanSpace ℝ (Fin 3)) (a Ka f : E → ComplexVector) (x : E) : ℂ := |
| 318 | (Complex.I / (κ : ℂ)) * projectionNumerator Vf n a Ka f x / |
| 319 | Complex.ofReal (‖n x‖ ^ 2) |
| 320 | |
| 321 | theorem projectedPressure_force (κ : ℝ) (Vf : E → E) |
| 322 | (n : E → EuclideanSpace ℝ (Fin 3)) (a Ka f : E → ComplexVector) (x : E) |
| 323 | (hκ : κ ≠ 0) (i : Fin 3) : |
| 324 | phaseFactor κ * Complex.ofReal (n x i) * projectedPressure κ Vf n a Ka f x = |
| 325 | -Complex.ofReal (n x i) * projectionNumerator Vf n a Ka f x / |
| 326 | Complex.ofReal (‖n x‖ ^ 2) := by |
| 327 | have hk : (κ : ℂ) ≠ 0 := by exact_mod_cast hκ |
| 328 | have hc : phaseFactor κ * (Complex.I / (κ : ℂ)) = -1 := by |
| 329 | unfold phaseFactor |
| 330 | field_simp [hk] |
| 331 | simp [] |
| 332 | unfold projectedPressure |
| 333 | calc |
| 334 | _ = (phaseFactor κ * (Complex.I / (κ : ℂ))) * Complex.ofReal (n x i) * |
| 335 | projectionNumerator Vf n a Ka f x / Complex.ofReal (‖n x‖ ^ 2) := by ring |
| 336 | _ = _ := by rw [hc]; ring |
| 337 | |
| 338 | /-- Substituting the projected pressure into the principal part is an exact |
| 339 | identity for arbitrary amplitudes; no tangent ODE is imposed on the actual |
| 340 | coefficient supplied to the residual. -/ |
| 341 | theorem principal_projectedPressure (ε κ : ℝ) (R F G : E → ℝ) (Vr Vθ Vz Vf : E → E) |
| 342 | (Φ : E → ℝ) (a f : E → ComplexVector) (x : E) (hκ : κ ≠ 0) : |
| 343 | principal ε κ R F G Vr Vθ Vz Vf Φ a |
| 344 | (projectedPressure κ Vf (phaseNormal R Vr Vθ Vz Φ) a (shear R F G Vr a) f) x = |
| 345 | fun i => along Vf (fun y => a y i) x + shear R F G Vr a x i + |
| 346 | Complex.ofReal (ε * κ ^ 2 * ‖phaseNormal R Vr Vθ Vz Φ x‖ ^ 2) * a x i - |
| 347 | Complex.ofReal (phaseNormal R Vr Vθ Vz Φ x i) * |
| 348 | projectionNumerator Vf (phaseNormal R Vr Vθ Vz Φ) a (shear R F G Vr a) f x / |
| 349 | Complex.ofReal (‖phaseNormal R Vr Vθ Vz Φ x‖ ^ 2) := by |
| 350 | ext i |
| 351 | unfold principal |
| 352 | rw [projectedPressure_force κ Vf (phaseNormal R Vr Vθ Vz Φ) a (shear R F G Vr a) f x hκ i] |
| 353 | ring |
| 354 | |
| 355 | theorem contDiffOn_normalDot {U : Set E} {n : E → EuclideanSpace ℝ (Fin 3)} |
| 356 | {a : E → ComplexVector} (hn : ContDiffOn ℝ ∞ n U) |
| 357 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) : |
| 358 | ContDiffOn ℝ ∞ (fun y => normalDot (n y) (a y)) U := by |
| 359 | have hc i : ContDiffOn ℝ ∞ (fun y => Complex.ofReal (n y i)) U := |
| 360 | Complex.ofRealCLM.contDiff.comp_contDiffOn |
| 361 | ((EuclideanSpace.proj i : EuclideanSpace ℝ (Fin 3) →L[ℝ] ℝ).contDiff.comp_contDiffOn hn) |
| 362 | exact (((hc 0).mul (ha 0)).add ((hc 1).mul (ha 1))).add ((hc 2).mul (ha 2)) |
| 363 | |
| 364 | theorem contDiffOn_projectedPressure {U : Set E} (κ : ℝ) {Vf : E → E} |
| 365 | {n : E → EuclideanSpace ℝ (Fin 3)} {a Ka f : E → ComplexVector} |
| 366 | (hU : IsOpen U) (hVf : ContDiffOn ℝ ∞ Vf U) (hn : ContDiffOn ℝ ∞ n U) |
| 367 | (hn₀ : ∀ x ∈ U, n x ≠ 0) |
| 368 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 369 | (hKa : ∀ i, ContDiffOn ℝ ∞ (fun y => Ka y i) U) |
| 370 | (hf : ∀ i, ContDiffOn ℝ ∞ (fun y => f y i) U) : |
| 371 | ContDiffOn ℝ ∞ (projectedPressure κ Vf n a Ka f) U := by |
| 372 | have hnum : ContDiffOn ℝ ∞ (projectionNumerator Vf n a Ka f) U := |
| 373 | ((contDiffOn_normalDot hn hKa).sub |
| 374 | (contDiffOn_normalDot (contDiffOn_along hU hVf hn) ha)).add (contDiffOn_normalDot hn hf) |
| 375 | have hden : ContDiffOn ℝ ∞ (fun y => Complex.ofReal (‖n y‖ ^ 2)) U := |
| 376 | Complex.ofRealCLM.contDiff.comp_contDiffOn ((contDiff_norm_sq ℝ).comp_contDiffOn hn) |
| 377 | have htop : ContDiffOn ℝ ∞ (fun y => (Complex.I / (κ : ℂ)) * |
| 378 | projectionNumerator Vf n a Ka f y) U := contDiffOn_const.mul hnum |
| 379 | have hnz : ∀ x ∈ U, Complex.ofReal (‖n x‖ ^ 2) ≠ 0 := by |
| 380 | intro x hx |
| 381 | exact_mod_cast pow_ne_zero 2 (norm_ne_zero_iff.mpr (hn₀ x hx)) |
| 382 | unfold projectedPressure |
| 383 | simpa only [div_eq_mul_inv, Pi.inv_apply] using htop.mul (hden.inv hnz) |
| 384 | |
| 385 | /-! ## Real-linear transfer of the complex calculation -/ |
| 386 | |
| 387 | section LinearMaps |
| 388 | |
| 389 | variable {F₁ F₂ : Type*} [NormedAddCommGroup F₁] [NormedSpace ℝ F₁] |
| 390 | [NormedAddCommGroup F₂] [NormedSpace ℝ F₂] |
| 391 | |
| 392 | theorem along_map (L : F₁ →L[ℝ] F₂) (V : E → E) {f : E → F₁} {x : E} |
| 393 | (hf : DifferentiableAt ℝ f x) : |
| 394 | along V (fun y => L (f y)) x = L (along V f x) := by |
| 395 | have hd := (L.hasFDerivAt.comp x hf.hasFDerivAt).fderiv |
| 396 | dsimp only [Function.comp_def] at hd |
| 397 | unfold along |
| 398 | rw [hd] |
| 399 | rfl |
| 400 | |
| 401 | theorem along_along_map (L : F₁ →L[ℝ] F₂) {U : Set E} {V : E → E} |
| 402 | {f : E → F₁} {x : E} (hU : IsOpen U) (hV : ContDiffOn ℝ ∞ V U) |
| 403 | (hf : ContDiffOn ℝ ∞ f U) (hx : x ∈ U) : |
| 404 | along V (along V (fun y => L (f y))) x = L (along V (along V f) x) := by |
| 405 | have he : EqOn (along V (fun y => L (f y))) (fun y => L (along V f y)) U := by |
| 406 | intro y hy |
| 407 | exact along_map L V ((hf.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) |
| 408 | rw [along_congr hU he hx] |
| 409 | exact along_map L V |
| 410 | (((contDiffOn_along hU hV hf).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 411 | |
| 412 | theorem cylindricalLaplacian_map (L : F₁ →L[ℝ] F₂) {U : Set E} (R : E → ℝ) |
| 413 | {Vr Vθ Vz : E → E} {f : E → F₁} {x : E} (hU : IsOpen U) |
| 414 | (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) |
| 415 | (hz : ContDiffOn ℝ ∞ Vz U) (hf : ContDiffOn ℝ ∞ f U) (hx : x ∈ U) : |
| 416 | cylindricalLaplacian R Vr Vθ Vz (fun y => L (f y)) x = |
| 417 | L (cylindricalLaplacian R Vr Vθ Vz f x) := by |
| 418 | simp only [cylindricalLaplacian, along_along_map L hU hr hf hx, |
| 419 | along_along_map L hU hθ hf hx, along_along_map L hU hz hf hx, |
| 420 | along_map L Vr ((hf.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)), |
| 421 | map_add, map_smul] |
| 422 | |
| 423 | end LinearMaps |
| 424 | |
| 425 | noncomputable def realLift (a : E → Fin 3 → ℝ) (x : E) : ComplexVector := fun i => (a x i : ℂ) |
| 426 | |
| 427 | noncomputable def realAngularGenerator (a : Fin 3 → ℝ) : Fin 3 → ℝ := ![-a 1, a 0, 0] |
| 428 | |
| 429 | noncomputable def realTransport (R : E → ℝ) (Vr Vθ Vz : E → E) |
| 430 | (u v : E → Fin 3 → ℝ) (x : E) : Fin 3 → ℝ := fun i => |
| 431 | u x 0 * along Vr (fun y => v y i) x + |
| 432 | (u x 1 / R x) * (along Vθ (fun y => v y i) x + realAngularGenerator (v x) i) + |
| 433 | u x 2 * along Vz (fun y => v y i) x |
| 434 | |
| 435 | noncomputable def realFrameLaplacian (R : E → ℝ) (Vr Vθ Vz : E → E) |
| 436 | (a : E → Fin 3 → ℝ) (x : E) : Fin 3 → ℝ := fun i => |
| 437 | cylindricalLaplacian R Vr Vθ Vz (fun y => a y i) x + ((R x) ^ 2)⁻¹ * |
| 438 | (2 * realAngularGenerator (fun j => along Vθ (fun y => a y j) x) i + |
| 439 | realAngularGenerator (realAngularGenerator (a x)) i) |
| 440 | |
| 441 | /-- Real component form of the same differential linearization. -/ |
| 442 | noncomputable def realComponentLinearResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) |
| 443 | (B a : E → Fin 3 → ℝ) (p : E → ℝ) (x : E) : Fin 3 → ℝ := fun i => |
| 444 | along Vt (fun y => a y i) x + realTransport R Vr Vθ Vz B a x i + |
| 445 | realTransport R Vr Vθ Vz a B x i + |
| 446 | (![along Vr p x, (R x)⁻¹ * along Vθ p x, along Vz p x] i) - |
| 447 | ε * realFrameLaplacian R Vr Vθ Vz a x i |
| 448 | |
| 449 | theorem map_ofReal_mul (L : ℂ →L[ℝ] ℝ) (r : ℝ) (z : ℂ) : |
| 450 | L ((r : ℂ) * z) = r * L z := by |
| 451 | change L (r • z) = _ |
| 452 | rw [map_smul] |
| 453 | rfl |
| 454 | |
| 455 | theorem map_mul_ofReal (L : ℂ →L[ℝ] ℝ) (r : ℝ) (z : ℂ) : |
| 456 | L (z * (r : ℂ)) = L z * r := by |
| 457 | rw [mul_comm, map_ofReal_mul] |
| 458 | ring |
| 459 | |
| 460 | theorem map_div_ofReal (L : ℂ →L[ℝ] ℝ) (r : ℝ) (z : ℂ) : |
| 461 | L (z / (r : ℂ)) = L z / r := by |
| 462 | rw [div_eq_mul_inv, ← Complex.ofReal_inv, map_mul_ofReal, div_eq_mul_inv] |
| 463 | |
| 464 | theorem map_two_mul (L : ℂ →L[ℝ] ℝ) (z : ℂ) : L (2 * z) = 2 * L z := |
| 465 | map_ofReal_mul L 2 z |
| 466 | |
| 467 | /-- The complex linearization transfers through any real continuous linear |
| 468 | functional, in particular real and imaginary parts, because its base is real. -/ |
| 469 | theorem realMap_linearResidual {U : Set E} (L : ℂ →L[ℝ] ℝ) (ε : ℝ) (R : E → ℝ) |
| 470 | {Vr Vθ Vz : E → E} (Vt : E → E) {B : E → Fin 3 → ℝ} |
| 471 | {a : E → ComplexVector} {p : E → ℂ} {x : E} |
| 472 | (hU : IsOpen U) (hr : ContDiffOn ℝ ∞ Vr U) (hθ : ContDiffOn ℝ ∞ Vθ U) |
| 473 | (hz : ContDiffOn ℝ ∞ Vz U) (ha : ∀ i, ContDiffOn ℝ ∞ (fun y => a y i) U) |
| 474 | (hB : ∀ i, DifferentiableAt ℝ (fun y => B y i) x) |
| 475 | (hp : DifferentiableAt ℝ p x) (hx : x ∈ U) : |
| 476 | (fun i => L (linearResidual ε R Vr Vθ Vz Vt (realLift B) a p x i)) = |
| 477 | realComponentLinearResidual ε R Vr Vθ Vz Vt B |
| 478 | (fun y i => L (a y i)) (fun y => L (p y)) x := by |
| 479 | have da i := ((ha i).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) |
| 480 | have hD (V : E → E) (i : Fin 3) := along_map L V (da i) |
| 481 | have hDB (V : E → E) (i : Fin 3) := along_ofReal V (hB i) |
| 482 | have hLap i := cylindricalLaplacian_map L R hU hr hθ hz (ha i) hx |
| 483 | ext i |
| 484 | fin_cases i <;> |
| 485 | simp [linearResidual, realComponentLinearResidual, transport, realTransport, realLift, |
| 486 | gradient, cylindricalVectorLaplacian, realFrameLaplacian, angularGenerator, |
| 487 | realAngularGenerator, hD, hDB, hLap, along_map L _ hp, |
| 488 | ← Complex.ofReal_div, map_ofReal_mul, map_mul_ofReal, map_add, |
| 489 | map_sub, map_neg, Complex.real_smul] <;> |
| 490 | simp only [← Complex.ofReal_neg, ← Complex.ofReal_add, ← Complex.ofReal_pow, |
| 491 | ← Complex.ofReal_inv, map_ofReal_mul, map_mul_ofReal, map_div_ofReal, map_two_mul, |
| 492 | true_or] <;> ring |
| 493 | |
| 494 | /-! ## The actual Cartesian and cylindrical linearizations -/ |
| 495 | |
| 496 | open ProblemStatement |
| 497 | |
| 498 | noncomputable def bilinearAdvection (u v : Space → Space) (q : Space) : Space := |
| 499 | u q 0 • CylindricalResidual.dCoord 0 v q + |
| 500 | (u q 1 / q 0) • (CylindricalResidual.dCoord 1 v q + CylindricalResidual.connection (v q)) + |
| 501 | u q 2 • CylindricalResidual.dCoord 2 v q |
| 502 | |
| 503 | noncomputable def cylindricalLinearResidual (ε : ℝ) (B a : VelocityField) (p : PressureField) |
| 504 | (t : ℝ) (q : Space) : Space := |
| 505 | temporalDerivative a t q + bilinearAdvection (fun y => B (t, y)) (fun y => a (t, y)) q + |
| 506 | bilinearAdvection (fun y => a (t, y)) (fun y => B (t, y)) q + |
| 507 | CylindricalResidual.scalarGradient (fun y => p (t, y)) q - |
| 508 | ε • CylindricalResidual.vectorLaplacian (fun y => a (t, y)) q |
| 509 | |
| 510 | /-- Linearization in the original Cartesian derivative definitions. -/ |
| 511 | noncomputable def cartesianLinearResidual (ε : ℝ) (B a : VelocityField) (p : PressureField) |
| 512 | (t : ℝ) (x : Space) : Space := |
| 513 | temporalDerivative a t x + spatialDerivative a t x (B (t, x)) + |
| 514 | spatialDerivative B t x (a (t, x)) + pressureGradient p t x - |
| 515 | ε • spatialLaplacian a t x |
| 516 | |
| 517 | theorem cartesianBilinearAdvection_components {u v : Space → Space} {q : Space} |
| 518 | (hv : DifferentiableAt ℝ v (CylindricalResidual.chart q)) (hr : q 0 ≠ 0) : |
| 519 | fderiv ℝ v (CylindricalResidual.chart q) (u (CylindricalResidual.chart q)) = |
| 520 | CylindricalResidual.frame (q 1) |
| 521 | (bilinearAdvection (CylindricalResidual.components u) (CylindricalResidual.components v) q) := by |
| 522 | have he := CylindricalResidual.cartesianDerivative_components hv hr |
| 523 | (CylindricalResidual.components u q) |
| 524 | have hu : CylindricalResidual.frame (q 1) (CylindricalResidual.components u q) = |
| 525 | u (CylindricalResidual.chart q) := CylindricalResidual.frame_inverse' _ _ |
| 526 | rw [hu] at he |
| 527 | have he' := congrArg (CylindricalResidual.frame (q 1)) he |
| 528 | simp only [CylindricalResidual.frame_inverse'] at he' |
| 529 | exact he' |
| 530 | |
| 531 | /-- The real differential linearization is exactly conjugated by the |
| 532 | cylindrical frame. Both cross-advections are derived from the actual |
| 533 | Cartesian derivative, rather than from a postulated residual identity. -/ |
| 534 | theorem cartesianLinearResidual_cylindrical (ε : ℝ) {B a : VelocityField} {p : PressureField} |
| 535 | {t : ℝ} {q : Space} |
| 536 | (ha : ContDiffAt ℝ 2 a (t, CylindricalResidual.chart q)) |
| 537 | (hB : DifferentiableAt ℝ B (t, CylindricalResidual.chart q)) |
| 538 | (hp : DifferentiableAt ℝ p (t, CylindricalResidual.chart q)) (hr : 0 < q 0) : |
| 539 | cartesianLinearResidual ε B a p t (CylindricalResidual.chart q) = |
| 540 | CylindricalResidual.frame (q 1) |
| 541 | (cylindricalLinearResidual ε (CylindricalResidual.velocityComponents B) |
| 542 | (CylindricalResidual.velocityComponents a) (CylindricalResidual.pressurePullback p) t q) := by |
| 543 | have has : ContDiffAt ℝ 2 (fun y => a (t, y)) (CylindricalResidual.chart q) := |
| 544 | ha.comp _ (contDiffAt_const.prodMk contDiffAt_id) |
| 545 | have had := has.differentiableAt (by norm_num) |
| 546 | have hBs : DifferentiableAt ℝ (fun y : Space => B (t, y)) (CylindricalResidual.chart q) := |
| 547 | hB.comp (CylindricalResidual.chart q) ((differentiableAt_const t).prodMk differentiableAt_id) |
| 548 | have hps : DifferentiableAt ℝ (fun y : Space => p (t, y)) (CylindricalResidual.chart q) := |
| 549 | hp.comp (CylindricalResidual.chart q) ((differentiableAt_const t).prodMk differentiableAt_id) |
| 550 | have hat : DifferentiableAt ℝ (fun s : ℝ => a (s, CylindricalResidual.chart q)) t := |
| 551 | (ha.differentiableAt (by norm_num)).comp t |
| 552 | (differentiableAt_id.prodMk (differentiableAt_const (CylindricalResidual.chart q))) |
| 553 | have ht : temporalDerivative a t (CylindricalResidual.chart q) = |
| 554 | CylindricalResidual.frame (q 1) |
| 555 | (temporalDerivative (CylindricalResidual.velocityComponents a) t q) := by |
| 556 | rw [CylindricalResidual.temporalDerivative_components hat, CylindricalResidual.frame_inverse'] |
| 557 | unfold cartesianLinearResidual |
| 558 | change temporalDerivative a t (CylindricalResidual.chart q) + |
| 559 | fderiv ℝ (fun y => a (t, y)) (CylindricalResidual.chart q) (B (t, CylindricalResidual.chart q)) + |
| 560 | fderiv ℝ (fun y => B (t, y)) (CylindricalResidual.chart q) (a (t, CylindricalResidual.chart q)) + |
| 561 | CylindricalResidual.euclideanGradient (fun y => p (t, y)) (CylindricalResidual.chart q) - |
| 562 | ε • CylindricalResidual.euclideanLaplacian (fun y => a (t, y)) (CylindricalResidual.chart q) = _ |
| 563 | rw [ht, cartesianBilinearAdvection_components (u := fun y => B (t, y)) had (ne_of_gt hr), |
| 564 | cartesianBilinearAdvection_components (u := fun y => a (t, y)) hBs (ne_of_gt hr), |
| 565 | CylindricalResidual.cartesianGradient_pullback hps (ne_of_gt hr), |
| 566 | CylindricalResidual.cartesianLaplacian_components has (ne_of_gt hr)] |
| 567 | simp only [cylindricalLinearResidual, map_add, map_sub, map_smul, |
| 568 | CylindricalResidual.velocityComponents, CylindricalResidual.pressurePullback] |
| 569 | rfl |
| 570 | |
| 571 | noncomputable def spaceDirection (i : Fin 3) (_ : SpaceTime) : SpaceTime := |
| 572 | (0, coordinateVector i) |
| 573 | |
| 574 | noncomputable def physicalTimeDirection (_ : SpaceTime) : SpaceTime := (1, 0) |
| 575 | |
| 576 | noncomputable def coordinateRadius (x : SpaceTime) : ℝ := x.2 0 |
| 577 | |
| 578 | section Slices |
| 579 | |
| 580 | variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] |
| 581 | |
| 582 | theorem along_space_slice {f : SpaceTime → W} {t : ℝ} {q : Space} |
| 583 | (hf : DifferentiableAt ℝ f (t, q)) (i : Fin 3) : |
| 584 | along (spaceDirection i) f (t, q) = CylindricalResidual.dCoord i (fun y => f (t, y)) q := by |
| 585 | have hd := (hf.hasFDerivAt.comp q (hasFDerivAt_prodMk_right t q)).fderiv |
| 586 | dsimp only [Function.comp_def] at hd |
| 587 | unfold along CylindricalResidual.dCoord spaceDirection |
| 588 | rw [hd] |
| 589 | rfl |
| 590 | |
| 591 | theorem along_time_slice {f : SpaceTime → W} {t : ℝ} {q : Space} |
| 592 | (hf : DifferentiableAt ℝ f (t, q)) : |
| 593 | along physicalTimeDirection f (t, q) = fderiv ℝ (fun s => f (s, q)) t 1 := by |
| 594 | have hd := (hf.hasFDerivAt.comp t (hasFDerivAt_prodMk_left (𝕜 := ℝ) t q)).fderiv |
| 595 | dsimp only [Function.comp_def] at hd |
| 596 | unfold along physicalTimeDirection |
| 597 | rw [hd] |
| 598 | rfl |
| 599 | |
| 600 | theorem along_space_space_slice {U : Set SpaceTime} {f : SpaceTime → W} {t : ℝ} {q : Space} |
| 601 | (hU : IsOpen U) (hf : ContDiffOn ℝ ∞ f U) (hx : (t, q) ∈ U) (i : Fin 3) : |
| 602 | along (spaceDirection i) (along (spaceDirection i) f) (t, q) = |
| 603 | CylindricalResidual.dCoord i (CylindricalResidual.dCoord i (fun y => f (t, y))) q := by |
| 604 | have hd := contDiffOn_along hU (show ContDiffOn ℝ ∞ (spaceDirection i) U from contDiffOn_const) hf |
| 605 | rw [along_space_slice ((hd.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp))] |
| 606 | apply CylindricalResidual.dCoord_congr |
| 607 | have hn : {y : Space | (t, y) ∈ U} ∈ 𝓝 q := |
| 608 | (continuous_const.prodMk continuous_id).continuousAt.preimage_mem_nhds (hU.mem_nhds hx) |
| 609 | filter_upwards [hn] with y hy |
| 610 | exact along_space_slice ((hf.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) i |
| 611 | |
| 612 | theorem laplacian_space_slice {U : Set SpaceTime} {f : SpaceTime → W} {t : ℝ} {q : Space} |
| 613 | (hU : IsOpen U) (hf : ContDiffOn ℝ ∞ f U) (hx : (t, q) ∈ U) : |
| 614 | cylindricalLaplacian coordinateRadius (spaceDirection 0) (spaceDirection 1) (spaceDirection 2) |
| 615 | f (t, q) = CylindricalResidual.scalarLaplacian (fun y => f (t, y)) q := by |
| 616 | unfold cylindricalLaplacian CylindricalResidual.scalarLaplacian coordinateRadius |
| 617 | rw [along_space_space_slice hU hf hx 0, along_space_space_slice hU hf hx 1, |
| 618 | along_space_space_slice hU hf hx 2, |
| 619 | along_space_slice ((hf.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) 0] |
| 620 | |
| 621 | end Slices |
| 622 | |
| 623 | /-- The generic real component operator used for the harmonic calculation |
| 624 | is the actual cylindrical linearization when its directions are the physical |
| 625 | spacetime coordinate directions. -/ |
| 626 | theorem realComponentLinearResidual_eq_cylindrical {U : Set SpaceTime} (ε : ℝ) |
| 627 | {B a : VelocityField} {p : PressureField} {t : ℝ} {q : Space} |
| 628 | (hU : IsOpen U) (hB : ContDiffOn ℝ ∞ B U) (ha : ContDiffOn ℝ ∞ a U) |
| 629 | (hp : ContDiffOn ℝ ∞ p U) (hx : (t, q) ∈ U) : |
| 630 | realComponentLinearResidual ε coordinateRadius (spaceDirection 0) (spaceDirection 1) |
| 631 | (spaceDirection 2) physicalTimeDirection (fun z i => B z i) (fun z i => a z i) p (t, q) = |
| 632 | fun i => cylindricalLinearResidual ε B a p t q i := by |
| 633 | have hAc (i : Fin 3) : ContDiffOn ℝ ∞ (fun z => a z i) U := |
| 634 | (AxisymmetricFields.projection i).contDiff.comp_contDiffOn ha |
| 635 | have hBc (i : Fin 3) : ContDiffOn ℝ ∞ (fun z => B z i) U := |
| 636 | (AxisymmetricFields.projection i).contDiff.comp_contDiffOn hB |
| 637 | have had := (ha.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) |
| 638 | have hbd := (hB.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) |
| 639 | have hpd := (hp.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) |
| 640 | have has : ContDiffAt ℝ 2 (fun y : Space => a (t, y)) q := |
| 641 | ((ha.contDiffAt (hU.mem_nhds hx)).comp q (contDiffAt_const.prodMk contDiffAt_id)).of_le |
| 642 | (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2) |
| 643 | have hasd := has.differentiableAt (by norm_num) |
| 644 | have hbsd : DifferentiableAt ℝ (fun y : Space => B (t, y)) q := |
| 645 | hbd.comp q ((differentiableAt_const t).prodMk differentiableAt_id) |
| 646 | have hAfirst (i j : Fin 3) : along (spaceDirection i) (fun z => a z j) (t, q) = |
| 647 | CylindricalResidual.dCoord i (fun y => a (t, y)) q j := by |
| 648 | rw [along_space_slice (((hAc j).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp))] |
| 649 | exact CylindricalResidual.dCoord_map (AxisymmetricFields.projection j) hasd i |
| 650 | have hBfirst (i j : Fin 3) : along (spaceDirection i) (fun z => B z j) (t, q) = |
| 651 | CylindricalResidual.dCoord i (fun y => B (t, y)) q j := by |
| 652 | rw [along_space_slice (((hBc j).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp))] |
| 653 | exact CylindricalResidual.dCoord_map (AxisymmetricFields.projection j) hbsd i |
| 654 | have hLap (j : Fin 3) : cylindricalLaplacian coordinateRadius |
| 655 | (spaceDirection 0) (spaceDirection 1) (spaceDirection 2) (fun z => a z j) (t, q) = |
| 656 | CylindricalResidual.scalarLaplacian (fun y => a (t, y)) q j := by |
| 657 | rw [laplacian_space_slice hU (hAc j) hx] |
| 658 | exact CylindricalResidual.scalarLaplacian_component has j |
| 659 | have htime (j : Fin 3) : along physicalTimeDirection (fun z => a z j) (t, q) = |
| 660 | temporalDerivative a t q j := by |
| 661 | calc |
| 662 | _ = (along physicalTimeDirection a (t, q)) j := |
| 663 | along_map (AxisymmetricFields.projection j) physicalTimeDirection had |
| 664 | _ = _ := congrArg (fun v : Space => v j) (along_time_slice had) |
| 665 | ext i |
| 666 | fin_cases i <;> |
| 667 | simp [realComponentLinearResidual, realTransport, realFrameLaplacian, realAngularGenerator, |
| 668 | hAfirst, hBfirst, hLap, htime, along_space_slice hpd, coordinateRadius, |
| 669 | cylindricalLinearResidual, bilinearAdvection, CylindricalResidual.vectorLaplacian, |
| 670 | CylindricalResidual.scalarGradient, CylindricalResidual.connection_apply] <;> ring |
| 671 | |
| 672 | end NavierStokes.LinearWaveResidual |