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.SimilarityProfile |
| 2 | import NavierStokes.SlowDivergence |
| 3 | import NavierStokes.VolterraAnalyticBounds |
| 4 | import NavierStokes.VolterraParity |
| 5 | import Mathlib.Analysis.Calculus.ContDiff.Operations |
| 6 | import Mathlib.Analysis.Analytic.Constructions |
| 7 | import Mathlib.Analysis.Complex.RealDeriv |
| 8 | import Mathlib.Algebra.BigOperators.Group.Finset.Basic |
| 9 | import Mathlib.Tactic.FinCases |
| 10 | import Mathlib.Tactic.LinearCombination |
| 11 | |
| 12 | /-! |
| 13 | # Explicit positive-order axis matrices |
| 14 | |
| 15 | The matrices are obtained by splitting the positive-order convolutions into |
| 16 | their two endpoint terms and their strictly lower-order source. No matrix |
| 17 | identity or existence of a transformed system is assumed. |
| 18 | -/ |
| 19 | |
| 20 | noncomputable section |
| 21 | |
| 22 | open Set |
| 23 | open scoped BigOperators ContDiff |
| 24 | |
| 25 | namespace NavierStokes.PositiveAxisSystem |
| 26 | |
| 27 | structure Jet (K : Type*) where |
| 28 | value : K |
| 29 | radial : K |
| 30 | radial2 : K |
| 31 | parameter : K |
| 32 | |
| 33 | structure BaseJet (K : Type*) where |
| 34 | phi : Jet K |
| 35 | axial : Jet K |
| 36 | beta : K |
| 37 | |
| 38 | /-- The first two entries are the lower-order convective sums minus the |
| 39 | known preceding axial diffusion. The last two give the lower pressure |
| 40 | convolution and the smooth quotient `Ω_(n-1)/X`. -/ |
| 41 | structure SourceJet (K : Type*) where |
| 42 | angular : K |
| 43 | axial : K |
| 44 | pressureProduct : K |
| 45 | omegaQuotient : K |
| 46 | |
| 47 | section Algebra |
| 48 | |
| 49 | variable {K : Type*} [Field K] [CharZero K] |
| 50 | |
| 51 | noncomputable def a (h : K) : K := 1 / 2 + h |
| 52 | noncomputable def dScale (h : K) : K := 1 / 2 - h |
| 53 | noncomputable def edge (eta : K) : K := 1 - eta ^ 2 |
| 54 | noncomputable def ell (h eta : K) : K := 1 - 2 * h * eta ^ 2 |
| 55 | noncomputable def angularPower (h : K) : K := -a h - 1 / 2 |
| 56 | noncomputable def axialPower (h : K) : K := -a h |
| 57 | noncomputable def inverseSquare (C : K) : K := (C ^ 2)⁻¹ |
| 58 | |
| 59 | noncomputable def timeValue (h power eta X : K) (j : Jet K) : K := |
| 60 | (-power * j.value + dScale h * eta * j.parameter + X * j.radial) / ell h eta |
| 61 | |
| 62 | noncomputable def axialValue (h power eta X : K) (j : Jet K) : K := |
| 63 | (2 * eta * power * j.value + edge eta * j.parameter - 2 * eta * X * j.radial) / ell h eta |
| 64 | |
| 65 | /-- The quotient `V_n/X` obtained from (21) with `Ubar_n=U_n+K_n`. -/ |
| 66 | noncomputable def betaValue (h lam eta : K) (u k : Jet K) : K := |
| 67 | (2 * eta * (a h - lam) * u.value - 2 * eta * (dScale h + lam) * k.value - |
| 68 | edge eta * (u.parameter + k.parameter)) / ell h eta |
| 69 | |
| 70 | noncomputable def pressureSource (C : K) (s : SourceJet K) : K := |
| 71 | inverseSquare C * s.pressureProduct - s.omegaQuotient / 2 |
| 72 | |
| 73 | noncomputable def pressureValue (C : K) (b : BaseJet K) (s : SourceJet K) (phi : Jet K) : K := |
| 74 | 2 * inverseSquare C * b.phi.value * phi.value + pressureSource C s |
| 75 | |
| 76 | noncomputable def angularRHS (h lam eta X : K) (b : BaseJet K) (s : SourceJet K) |
| 77 | (phi u k : Jet K) : K := |
| 78 | timeValue h (angularPower h + lam) eta X phi + |
| 79 | b.beta * (X * phi.radial + phi.value) + |
| 80 | betaValue h lam eta u k * (X * b.phi.radial + b.phi.value) + |
| 81 | b.axial.value * axialValue h (angularPower h + lam) eta X phi + |
| 82 | u.value * axialValue h (angularPower h) eta X b.phi + s.angular |
| 83 | |
| 84 | noncomputable def axialRHS (h lam eta X : K) (b : BaseJet K) (s : SourceJet K) |
| 85 | (_phi u k p : Jet K) : K := |
| 86 | timeValue h (axialPower h + lam) eta X u + b.beta * X * u.radial + |
| 87 | betaValue h lam eta u k * X * b.axial.radial + |
| 88 | b.axial.value * axialValue h (axialPower h + lam) eta X u + |
| 89 | u.value * axialValue h (axialPower h) eta X b.axial + |
| 90 | axialValue h (-2 * a h + lam) eta X p + s.axial |
| 91 | |
| 92 | /-- The four equations remaining after the first two components of W have |
| 93 | been defined as radial derivatives. These are the expanded (21)--(22). -/ |
| 94 | def ExpandedEquations (h lam C eta X : K) (b : BaseJet K) (s : SourceJet K) |
| 95 | (phi u k p : Jet K) : Prop := |
| 96 | X * (u.radial + k.radial) + k.value = 0 ∧ |
| 97 | p.radial = pressureValue C b s phi ∧ |
| 98 | 2 * (X * phi.radial2 + 2 * phi.radial) = angularRHS h lam eta X b s phi u k ∧ |
| 99 | 2 * (X * u.radial2 + u.radial) = axialRHS h lam eta X b s phi u k p |
| 100 | |
| 101 | noncomputable def diagonal : Fin 6 → K := ![0, 0, 2, 0, 3, 1] |
| 102 | |
| 103 | noncomputable def jetVector (r : K) (phi u k p : Jet K) : Fin 6 → K := |
| 104 | ![phi.value, u.value, k.value, p.value, 2 * r * phi.radial, 2 * r * u.radial] |
| 105 | |
| 106 | noncomputable def radialJetVector (r : K) (phi u k p : Jet K) : Fin 6 → K := |
| 107 | ![2 * r * phi.radial, 2 * r * u.radial, 2 * r * k.radial, 2 * r * p.radial, |
| 108 | 2 * phi.radial + 4 * r ^ 2 * phi.radial2, |
| 109 | 2 * u.radial + 4 * r ^ 2 * u.radial2] |
| 110 | |
| 111 | /-- Only the first four parameter derivatives enter the system. -/ |
| 112 | noncomputable def parameterJetVector (phi u k p : Jet K) (q₄ q₅ : K) : Fin 6 → K := |
| 113 | ![phi.parameter, u.parameter, k.parameter, p.parameter, q₄, q₅] |
| 114 | |
| 115 | noncomputable def A0 (h lam C r eta : K) (b : BaseJet K) : Matrix (Fin 6) (Fin 6) K := |
| 116 | let M := 1 - 2 * eta * b.axial.value |
| 117 | let R := M / ell h eta + b.beta |
| 118 | let Gphi := r ^ 2 * b.phi.radial + b.phi.value |
| 119 | let Gu := r ^ 2 * b.axial.radial |
| 120 | !![0, 0, 0, 0, 1, 0; |
| 121 | 0, 0, 0, 0, 0, 1; |
| 122 | 0, 0, 0, 0, 0, -1; |
| 123 | 4 * r * inverseSquare C * b.phi.value, 0, 0, 0, 0, 0; |
| 124 | 2 * (b.beta - (angularPower h + lam) * M / ell h eta), |
| 125 | 2 * (axialValue h (angularPower h) eta (r ^ 2) b.phi + |
| 126 | 2 * eta * (a h - lam) * Gphi / ell h eta), |
| 127 | -4 * eta * (dScale h + lam) * Gphi / ell h eta, 0, r * R, 0; |
| 128 | -8 * eta * r ^ 2 * inverseSquare C * b.phi.value / ell h eta, |
| 129 | 2 * (-(axialPower h + lam) * M / ell h eta + |
| 130 | axialValue h (axialPower h) eta (r ^ 2) b.axial + |
| 131 | 2 * eta * (a h - lam) * Gu / ell h eta), |
| 132 | -4 * eta * (dScale h + lam) * Gu / ell h eta, |
| 133 | 4 * eta * (-2 * a h + lam) / ell h eta, 0, r * R] |
| 134 | |
| 135 | noncomputable def A1 (h r eta : K) (b : BaseJet K) : Matrix (Fin 6) (Fin 6) K := |
| 136 | let H := dScale h * eta + edge eta * b.axial.value |
| 137 | let Gphi := r ^ 2 * b.phi.radial + b.phi.value |
| 138 | let Gu := r ^ 2 * b.axial.radial |
| 139 | !![0, 0, 0, 0, 0, 0; |
| 140 | 0, 0, 0, 0, 0, 0; |
| 141 | 0, 0, 0, 0, 0, 0; |
| 142 | 0, 0, 0, 0, 0, 0; |
| 143 | 2 * H / ell h eta, -2 * edge eta * Gphi / ell h eta, |
| 144 | -2 * edge eta * Gphi / ell h eta, 0, 0, 0; |
| 145 | 0, 2 * (H - edge eta * Gu) / ell h eta, |
| 146 | -2 * edge eta * Gu / ell h eta, 2 * edge eta / ell h eta, 0, 0] |
| 147 | |
| 148 | noncomputable def forcing (h C r eta : K) (s : SourceJet K) : Fin 6 → K := |
| 149 | ![0, 0, 0, 2 * r * pressureSource C s, 2 * s.angular, |
| 150 | 2 * s.axial - 4 * eta * r ^ 2 * pressureSource C s / ell h eta] |
| 151 | |
| 152 | noncomputable def matrixRHS (h lam C r eta : K) (b : BaseJet K) (s : SourceJet K) |
| 153 | (w v : Fin 6 → K) : Fin 6 → K := |
| 154 | (A0 h lam C r eta b).mulVec w + (A1 h r eta b).mulVec v + forcing h C r eta s |
| 155 | |
| 156 | def JetSystem (h lam C r eta : K) (b : BaseJet K) (s : SourceJet K) |
| 157 | (phi u k p : Jet K) (q₄ q₅ : K) : Prop := |
| 158 | (fun i => radialJetVector r phi u k p i + diagonal i / r * jetVector r phi u k p i) = |
| 159 | matrixRHS h lam C r eta b s (jetVector r phi u k p) (parameterJetVector phi u k p q₄ q₅) |
| 160 | |
| 161 | omit [CharZero K] in |
| 162 | theorem A1_shape (h r eta : K) (b : BaseJet K) (i j : Fin 6) |
| 163 | (hij : i.val < 4 ∨ 4 ≤ j.val) : A1 h r eta b i j = 0 := by |
| 164 | fin_cases i <;> fin_cases j <;> norm_num [A1] at hij <;> norm_num [A1] |
| 165 | |
| 166 | omit [CharZero K] in |
| 167 | theorem A1_high_parameters_irrelevant (h r eta : K) (b : BaseJet K) |
| 168 | (phi u k p : Jet K) (q₄ q₅ q₄' q₅' : K) : |
| 169 | (A1 h r eta b).mulVec (parameterJetVector phi u k p q₄ q₅) = |
| 170 | (A1 h r eta b).mulVec (parameterJetVector phi u k p q₄' q₅') := by |
| 171 | ext i |
| 172 | fin_cases i <;> simp [A1, parameterJetVector, Matrix.mulVec, dotProduct, Fin.sum_univ_succ] |
| 173 | |
| 174 | /-- Direct multiplication of the displayed matrices reproduces the expanded |
| 175 | right sides, with the pressure radial derivative explicitly substituted. -/ |
| 176 | theorem matrixRHS_jet (h lam C r eta : K) (b : BaseJet K) (s : SourceJet K) |
| 177 | (phi u k p : Jet K) (q₄ q₅ : K) : |
| 178 | matrixRHS h lam C r eta b s (jetVector r phi u k p) (parameterJetVector phi u k p q₄ q₅) = |
| 179 | ![2 * r * phi.radial, 2 * r * u.radial, -2 * r * u.radial, |
| 180 | 2 * r * pressureValue C b s phi, |
| 181 | 2 * angularRHS h lam eta (r ^ 2) b s phi u k, |
| 182 | 2 * axialRHS h lam eta (r ^ 2) b s phi u k {p with radial := pressureValue C b s phi}] := by |
| 183 | ext i |
| 184 | fin_cases i <;> |
| 185 | simp [matrixRHS, A0, A1, forcing, jetVector, parameterJetVector, |
| 186 | pressureValue, pressureSource, angularRHS, axialRHS, timeValue, axialValue, |
| 187 | betaValue, div_eq_mul_inv] <;> ring |
| 188 | |
| 189 | private theorem average_row_iff {r : K} (hr : r ≠ 0) (ux kx kv : K) : |
| 190 | 2 * r * kx + 2 / r * kv = -(2 * r * ux) ↔ r ^ 2 * (ux + kx) + kv = 0 := by |
| 191 | constructor |
| 192 | · intro h |
| 193 | field_simp [hr] at h |
| 194 | linear_combination h |
| 195 | · intro h |
| 196 | field_simp [hr] |
| 197 | linear_combination h |
| 198 | |
| 199 | private theorem second_row_iff {r : K} (hr : r ≠ 0) (v vx rhs : K) (c : K) : |
| 200 | 2 * v + 4 * r ^ 2 * vx + c / r * (2 * r * v) = 2 * rhs ↔ |
| 201 | 2 * (r ^ 2 * vx + ((c + 1) / 2) * v) = rhs := by |
| 202 | have he : c / r * (2 * r * v) = 2 * c * v := by field_simp |
| 203 | rw [he] |
| 204 | constructor |
| 205 | · intro h |
| 206 | linear_combination (norm := ring_nf) (1 / 2 : K) * h |
| 207 | · intro h |
| 208 | linear_combination (norm := ring_nf) (2 : K) * h |
| 209 | |
| 210 | /-- Equivalence with the expanded profile equations, including the average |
| 211 | row and the pressure-row substitution. Only the change of radial coordinate |
| 212 | requires `r≠0`; the matrices themselves are nonsingular at the axis. -/ |
| 213 | theorem jetSystem_iff_expanded {h lam C r eta : K} (hr : r ≠ 0) |
| 214 | (b : BaseJet K) (s : SourceJet K) (phi u k p : Jet K) (q₄ q₅ : K) : |
| 215 | JetSystem h lam C r eta b s phi u k p q₄ q₅ ↔ |
| 216 | ExpandedEquations h lam C eta (r ^ 2) b s phi u k p := by |
| 217 | unfold JetSystem |
| 218 | rw [matrixRHS_jet] |
| 219 | constructor |
| 220 | · intro hh |
| 221 | have h2 := congrFun hh 2 |
| 222 | have h3 := congrFun hh 3 |
| 223 | have h4 := congrFun hh 4 |
| 224 | have h5 := congrFun hh 5 |
| 225 | simp [radialJetVector, diagonal, jetVector] at h2 h3 h4 h5 |
| 226 | have hk := (average_row_iff hr _ _ _).mp h2 |
| 227 | have hp : p.radial = pressureValue C b s phi := by |
| 228 | exact h3.resolve_right hr |
| 229 | have hphi := (second_row_iff hr phi.radial phi.radial2 |
| 230 | (angularRHS h lam eta (r ^ 2) b s phi u k) 3).mp h4 |
| 231 | have hu := (second_row_iff hr u.radial u.radial2 |
| 232 | (axialRHS h lam eta (r ^ 2) b s phi u k {p with radial := pressureValue C b s phi}) 1).mp (by simpa only [one_div] using h5) |
| 233 | have hpjet : {p with radial := pressureValue C b s phi} = p := by |
| 234 | cases p |
| 235 | simp_all |
| 236 | rw [hpjet] at hu |
| 237 | refine ⟨hk, hp, ?_, ?_⟩ |
| 238 | · convert! hphi using 1; norm_num |
| 239 | · convert! hu using 1; norm_num |
| 240 | · rintro ⟨hk, hp, hphi, hu⟩ |
| 241 | have hpjet : {p with radial := pressureValue C b s phi} = p := by |
| 242 | cases p |
| 243 | simp_all |
| 244 | ext i |
| 245 | fin_cases i |
| 246 | · simp [radialJetVector, diagonal, jetVector] |
| 247 | · simp [radialJetVector, diagonal, jetVector] |
| 248 | · simpa [radialJetVector, diagonal, jetVector] using (average_row_iff hr _ _ _).mpr hk |
| 249 | · simp [radialJetVector, diagonal, jetVector, hp] |
| 250 | · simpa [radialJetVector, diagonal, jetVector] using |
| 251 | (second_row_iff hr phi.radial phi.radial2 (angularRHS h lam eta (r ^ 2) b s phi u k) 3).mpr |
| 252 | (by convert! hphi using 1; norm_num) |
| 253 | · rw [hpjet] |
| 254 | simpa [radialJetVector, diagonal, jetVector] using |
| 255 | (second_row_iff hr u.radial u.radial2 (axialRHS h lam eta (r ^ 2) b s phi u k p) 1).mpr |
| 256 | (by convert! hu using 1; norm_num) |
| 257 | |
| 258 | |
| 259 | /-- Slow exponent at order `n`. -/ |
| 260 | noncomputable def slowPower (h : K) (n : ℕ) : K := 2 * (n : K) * h |
| 261 | |
| 262 | /-- The coefficient of a Cauchy product at the indicated order. -/ |
| 263 | noncomputable def convolution (n : ℕ) (F : ℕ → ℕ → K) : K := |
| 264 | ∑ i ∈ Finset.range (n + 1), F i (n - i) |
| 265 | |
| 266 | /-- Both indices in this sum are strictly below a positive order `n`. -/ |
| 267 | noncomputable def lowerConvolution (n : ℕ) (F : ℕ → ℕ → K) : K := |
| 268 | ∑ i ∈ Finset.range (n - 1), F (i + 1) (n - (i + 1)) |
| 269 | |
| 270 | omit [CharZero K] in |
| 271 | theorem convolution_split {n : ℕ} (hn : 0 < n) (F : ℕ → ℕ → K) : |
| 272 | convolution n F = F 0 n + F n 0 + lowerConvolution n F := by |
| 273 | obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (Nat.ne_of_gt hn) |
| 274 | unfold convolution lowerConvolution |
| 275 | rw [Finset.sum_range_succ'] |
| 276 | simp only [Nat.succ_sub_one] |
| 277 | rw [Finset.sum_range_succ] |
| 278 | simp only [Nat.sub_self, Nat.sub_zero] |
| 279 | ring |
| 280 | |
| 281 | theorem lower_indices {n i : ℕ} (hi : i ∈ Finset.range (n - 1)) : |
| 282 | 0 < i + 1 ∧ i + 1 < n ∧ 0 < n - (i + 1) ∧ n - (i + 1) < n := by |
| 283 | have := Finset.mem_range.mp hi |
| 284 | omega |
| 285 | |
| 286 | omit [CharZero K] in |
| 287 | theorem lowerConvolution_congr {n : ℕ} {F G : ℕ → ℕ → K} |
| 288 | (h : ∀ i, i < n → ∀ j, j < n → F i j = G i j) : |
| 289 | lowerConvolution n F = lowerConvolution n G := by |
| 290 | apply Finset.sum_congr rfl |
| 291 | intro i hi |
| 292 | have hidx := lower_indices hi |
| 293 | exact h _ hidx.2.1 _ hidx.2.2.2 |
| 294 | |
| 295 | noncomputable def angularConvection (h eta X : K) (phi u : ℕ → Jet K) |
| 296 | (beta : ℕ → K) (i j : ℕ) : K := |
| 297 | beta i * (X * (phi j).radial + (phi j).value) + |
| 298 | (u i).value * axialValue h (angularPower h + slowPower h j) eta X (phi j) |
| 299 | |
| 300 | noncomputable def axialConvection (h eta X : K) (u : ℕ → Jet K) |
| 301 | (beta : ℕ → K) (i j : ℕ) : K := |
| 302 | beta i * X * (u j).radial + |
| 303 | (u i).value * axialValue h (axialPower h + slowPower h j) eta X (u j) |
| 304 | |
| 305 | /-- The known functions supplied here are exactly the previous-order axial |
| 306 | viscosities and the smooth extension of the previous radial residual divided |
| 307 | by `X`; no current-order unknown occurs in this source. -/ |
| 308 | noncomputable def lowerSource (h eta X : K) (n : ℕ) (phi u : ℕ → Jet K) |
| 309 | (beta : ℕ → K) (previousAngularDiffusion previousAxialDiffusion omegaQuotient : K) : |
| 310 | SourceJet K where |
| 311 | angular := lowerConvolution n (angularConvection h eta X phi u beta) - previousAngularDiffusion |
| 312 | axial := lowerConvolution n (axialConvection h eta X u beta) - previousAxialDiffusion |
| 313 | pressureProduct := lowerConvolution n (fun i j => (phi i).value * (phi j).value) |
| 314 | omegaQuotient := omegaQuotient |
| 315 | |
| 316 | noncomputable def baseAtOrderZero (phi u : ℕ → Jet K) (beta : ℕ → K) : BaseJet K := |
| 317 | ⟨phi 0, u 0, beta 0⟩ |
| 318 | |
| 319 | /-- The beta formula is precisely (21), with `Ubar=U+K`. -/ |
| 320 | theorem betaValue_eq_average_formula (h lam eta : K) (u k : Jet K) : |
| 321 | betaValue h lam eta u k = |
| 322 | (2 * eta * u.value - 2 * eta * (dScale h + lam) * (u.value + k.value) - |
| 323 | edge eta * (u.parameter + k.parameter)) / ell h eta := by |
| 324 | unfold betaValue a dScale |
| 325 | congr 1 |
| 326 | ring |
| 327 | |
| 328 | omit [CharZero K] in |
| 329 | /-- Replacing `V=X beta` in the angular convection is exact away from the axis. -/ |
| 330 | theorem angularConvection_radial_term {X : K} (hX : X ≠ 0) (beta f fx : K) : |
| 331 | beta * (X * fx + f) = (X * beta) * (fx + f / X) := by |
| 332 | field_simp |
| 333 | |
| 334 | omit [CharZero K] in |
| 335 | /-- Endpoint extraction, including the exact lower-order sums. -/ |
| 336 | theorem angularRHS_eq_convolution (h eta X : K) {n : ℕ} (hn : 0 < n) |
| 337 | (phi u : ℕ → Jet K) (beta : ℕ → K) (k : Jet K) |
| 338 | (previousAngularDiffusion previousAxialDiffusion omegaQuotient : K) |
| 339 | (hbeta : beta n = betaValue h (slowPower h n) eta (u n) k) : |
| 340 | angularRHS h (slowPower h n) eta X (baseAtOrderZero phi u beta) |
| 341 | (lowerSource h eta X n phi u beta previousAngularDiffusion previousAxialDiffusion omegaQuotient) |
| 342 | (phi n) (u n) k = |
| 343 | timeValue h (angularPower h + slowPower h n) eta X (phi n) + |
| 344 | convolution n (angularConvection h eta X phi u beta) - previousAngularDiffusion := by |
| 345 | rw [convolution_split hn] |
| 346 | simp only [angularRHS, baseAtOrderZero, lowerSource, angularConvection, slowPower, |
| 347 | Nat.cast_zero, mul_zero, zero_mul, add_zero, hbeta] |
| 348 | ring |
| 349 | |
| 350 | omit [CharZero K] in |
| 351 | theorem axialRHS_eq_convolution (h eta X : K) {n : ℕ} (hn : 0 < n) |
| 352 | (phi u : ℕ → Jet K) (beta : ℕ → K) (k p : Jet K) |
| 353 | (previousAngularDiffusion previousAxialDiffusion omegaQuotient : K) |
| 354 | (hbeta : beta n = betaValue h (slowPower h n) eta (u n) k) : |
| 355 | axialRHS h (slowPower h n) eta X (baseAtOrderZero phi u beta) |
| 356 | (lowerSource h eta X n phi u beta previousAngularDiffusion previousAxialDiffusion omegaQuotient) |
| 357 | (phi n) (u n) k p = |
| 358 | timeValue h (axialPower h + slowPower h n) eta X (u n) + |
| 359 | convolution n (axialConvection h eta X u beta) + |
| 360 | axialValue h (-2 * a h + slowPower h n) eta X p - previousAxialDiffusion := by |
| 361 | rw [convolution_split hn] |
| 362 | simp only [axialRHS, baseAtOrderZero, lowerSource, axialConvection, slowPower, |
| 363 | Nat.cast_zero, mul_zero, zero_mul, add_zero, hbeta] |
| 364 | ring |
| 365 | |
| 366 | theorem pressureValue_eq_convolution (h C eta X : K) {n : ℕ} (hn : 0 < n) |
| 367 | (phi u : ℕ → Jet K) (beta : ℕ → K) |
| 368 | (previousAngularDiffusion previousAxialDiffusion omegaQuotient : K) : |
| 369 | pressureValue C (baseAtOrderZero phi u beta) |
| 370 | (lowerSource h eta X n phi u beta previousAngularDiffusion previousAxialDiffusion omegaQuotient) |
| 371 | (phi n) = |
| 372 | inverseSquare C * convolution n (fun i j => (phi i).value * (phi j).value) - omegaQuotient / 2 := by |
| 373 | rw [convolution_split hn] |
| 374 | simp only [pressureValue, pressureSource, baseAtOrderZero, lowerSource] |
| 375 | ring |
| 376 | |
| 377 | |
| 378 | /-- Positive-order equations (22) before extraction of the endpoint terms. |
| 379 | The average relation is the derivative of `X Ubar = ∫₀ˣ U`, with `K=Ubar-U`. |
| 380 | The beta hypothesis in the equivalence below is the second identity of (21). -/ |
| 381 | def PositiveOrderEquations (h C eta X : K) (n : ℕ) (phi u : ℕ → Jet K) |
| 382 | (beta : ℕ → K) (k p : Jet K) |
| 383 | (previousAngularDiffusion previousAxialDiffusion omegaQuotient : K) : Prop := |
| 384 | X * ((u n).radial + k.radial) + k.value = 0 ∧ |
| 385 | p.radial = inverseSquare C * convolution n (fun i j => (phi i).value * (phi j).value) - |
| 386 | omegaQuotient / 2 ∧ |
| 387 | 2 * (X * (phi n).radial2 + 2 * (phi n).radial) = |
| 388 | timeValue h (angularPower h + slowPower h n) eta X (phi n) + |
| 389 | convolution n (angularConvection h eta X phi u beta) - previousAngularDiffusion ∧ |
| 390 | 2 * (X * (u n).radial2 + (u n).radial) = |
| 391 | timeValue h (axialPower h + slowPower h n) eta X (u n) + |
| 392 | convolution n (axialConvection h eta X u beta) + |
| 393 | axialValue h (-2 * a h + slowPower h n) eta X p - previousAxialDiffusion |
| 394 | |
| 395 | theorem expanded_iff_positiveOrder (h C eta X : K) {n : ℕ} (hn : 0 < n) |
| 396 | (phi u : ℕ → Jet K) (beta : ℕ → K) (k p : Jet K) |
| 397 | (previousAngularDiffusion previousAxialDiffusion omegaQuotient : K) |
| 398 | (hbeta : beta n = betaValue h (slowPower h n) eta (u n) k) : |
| 399 | ExpandedEquations h (slowPower h n) C eta X (baseAtOrderZero phi u beta) |
| 400 | (lowerSource h eta X n phi u beta previousAngularDiffusion previousAxialDiffusion omegaQuotient) |
| 401 | (phi n) (u n) k p ↔ |
| 402 | PositiveOrderEquations h C eta X n phi u beta k p |
| 403 | previousAngularDiffusion previousAxialDiffusion omegaQuotient := by |
| 404 | unfold ExpandedEquations PositiveOrderEquations |
| 405 | rw [angularRHS_eq_convolution h eta X hn phi u beta k _ _ _ hbeta, |
| 406 | axialRHS_eq_convolution h eta X hn phi u beta k p _ _ _ hbeta, |
| 407 | pressureValue_eq_convolution h C eta X hn phi u beta] |
| 408 | |
| 409 | theorem jetSystem_iff_positiveOrder (h C r eta : K) (hr : r ≠ 0) {n : ℕ} (hn : 0 < n) |
| 410 | (phi u : ℕ → Jet K) (beta : ℕ → K) (k p : Jet K) (q₄ q₅ : K) |
| 411 | (previousAngularDiffusion previousAxialDiffusion omegaQuotient : K) |
| 412 | (hbeta : beta n = betaValue h (slowPower h n) eta (u n) k) : |
| 413 | JetSystem h (slowPower h n) C r eta (baseAtOrderZero phi u beta) |
| 414 | (lowerSource h eta (r ^ 2) n phi u beta previousAngularDiffusion previousAxialDiffusion omegaQuotient) |
| 415 | (phi n) (u n) k p q₄ q₅ ↔ |
| 416 | PositiveOrderEquations h C eta (r ^ 2) n phi u beta k p |
| 417 | previousAngularDiffusion previousAxialDiffusion omegaQuotient := |
| 418 | (jetSystem_iff_expanded hr _ _ _ _ _ _ _ _).trans |
| 419 | (expanded_iff_positiveOrder h C eta (r ^ 2) hn phi u beta k p _ _ _ hbeta) |
| 420 | |
| 421 | end Algebra |
| 422 | |
| 423 | |
| 424 | section ActualProfiles |
| 425 | |
| 426 | open SimilarityProfile |
| 427 | |
| 428 | /-- Jets here are actual Fréchet partial derivatives of real profiles. -/ |
| 429 | noncomputable def actualJet (f : InnerProfile) (w : InnerPoint) : Jet ℝ := |
| 430 | ⟨f w, partialX f w, partialX (partialX f) w, partialEta f w⟩ |
| 431 | |
| 432 | theorem timeValue_actualJet (h b : ℝ) (f : InnerProfile) (w : InnerPoint) : |
| 433 | timeValue h b w.2 w.1 (actualJet f w) = T h b f w := rfl |
| 434 | |
| 435 | theorem axialValue_actualJet (h b : ℝ) (f : InnerProfile) (w : InnerPoint) : |
| 436 | axialValue h b w.2 w.1 (actualJet f w) = Z h b f w := rfl |
| 437 | |
| 438 | theorem partialX_contDiffAt {f : InnerProfile} {w : InnerPoint} |
| 439 | (hf : ContDiffAt ℝ 2 f w) : ContDiffAt ℝ 1 (partialX f) w := by |
| 440 | exact (hf.fderiv_right (by norm_num : (1 : WithTop ℕ∞) + 1 ≤ 2)).clm_apply contDiffAt_const |
| 441 | |
| 442 | theorem hasDerivAt_squareProfile {f : InnerProfile} {r eta : ℝ} |
| 443 | (hf : DifferentiableAt ℝ f (r ^ 2, eta)) : |
| 444 | HasDerivAt (fun s => f (s ^ 2, eta)) (2 * r * partialX f (r ^ 2, eta)) r := by |
| 445 | have hc := hf.hasFDerivAt.comp_hasDerivAt r |
| 446 | (((hasDerivAt_id r).pow 2).prodMk (hasDerivAt_const r eta)) |
| 447 | convert! hc using 1 |
| 448 | simp [fderiv_inner_apply] |
| 449 | ring |
| 450 | |
| 451 | theorem hasDerivAt_parameterProfile {f : InnerProfile} {X eta : ℝ} |
| 452 | (hf : DifferentiableAt ℝ f (X, eta)) : |
| 453 | HasDerivAt (fun z => f (X, z)) (partialEta f (X, eta)) eta := by |
| 454 | have hc := hf.hasFDerivAt.comp_hasDerivAt eta |
| 455 | ((hasDerivAt_const eta X).prodMk (hasDerivAt_id eta)) |
| 456 | simpa [fderiv_inner_apply, Function.comp_def] using hc |
| 457 | |
| 458 | theorem hasDerivAt_squareProfile_radial {f : InnerProfile} {r eta : ℝ} |
| 459 | (hf : ContDiffAt ℝ 2 f (r ^ 2, eta)) : |
| 460 | HasDerivAt (fun s => 2 * s * partialX f (s ^ 2, eta)) |
| 461 | (2 * partialX f (r ^ 2, eta) + 4 * r ^ 2 * partialX (partialX f) (r ^ 2, eta)) r := by |
| 462 | have hc := ((hasDerivAt_id r).const_mul 2).mul |
| 463 | (hasDerivAt_squareProfile ((partialX_contDiffAt hf).differentiableAt (by norm_num))) |
| 464 | convert! hc using 1 |
| 465 | simp only [id_eq] |
| 466 | ring |
| 467 | |
| 468 | noncomputable def profileVector (phi u k p : InnerProfile) (r eta : ℝ) : Fin 6 → ℝ := |
| 469 | jetVector r (actualJet phi (r ^ 2, eta)) (actualJet u (r ^ 2, eta)) |
| 470 | (actualJet k (r ^ 2, eta)) (actualJet p (r ^ 2, eta)) |
| 471 | |
| 472 | theorem profileVector_radial {phi u k p : InnerProfile} {r eta : ℝ} |
| 473 | (hphi : ContDiffAt ℝ 2 phi (r ^ 2, eta)) (hu : ContDiffAt ℝ 2 u (r ^ 2, eta)) |
| 474 | (hk : DifferentiableAt ℝ k (r ^ 2, eta)) (hp : DifferentiableAt ℝ p (r ^ 2, eta)) : |
| 475 | (fun i => deriv (fun s => profileVector phi u k p s eta i) r) = |
| 476 | radialJetVector r (actualJet phi (r ^ 2, eta)) (actualJet u (r ^ 2, eta)) |
| 477 | (actualJet k (r ^ 2, eta)) (actualJet p (r ^ 2, eta)) := by |
| 478 | have hphi' := hphi.differentiableAt (by norm_num) |
| 479 | have hu' := hu.differentiableAt (by norm_num) |
| 480 | ext i |
| 481 | fin_cases i <;> simp only [profileVector, jetVector, actualJet, radialJetVector] |
| 482 | · exact (hasDerivAt_squareProfile hphi').deriv |
| 483 | · exact (hasDerivAt_squareProfile hu').deriv |
| 484 | · exact (hasDerivAt_squareProfile hk).deriv |
| 485 | · exact (hasDerivAt_squareProfile hp).deriv |
| 486 | · exact (hasDerivAt_squareProfile_radial hphi).deriv |
| 487 | · exact (hasDerivAt_squareProfile_radial hu).deriv |
| 488 | |
| 489 | theorem profileVector_parameter {phi u k p : InnerProfile} {r eta : ℝ} |
| 490 | (hphi : DifferentiableAt ℝ phi (r ^ 2, eta)) (hu : DifferentiableAt ℝ u (r ^ 2, eta)) |
| 491 | (hk : DifferentiableAt ℝ k (r ^ 2, eta)) (hp : DifferentiableAt ℝ p (r ^ 2, eta)) : |
| 492 | (fun i => deriv (fun z => profileVector phi u k p r z i) eta) = |
| 493 | parameterJetVector (actualJet phi (r ^ 2, eta)) (actualJet u (r ^ 2, eta)) |
| 494 | (actualJet k (r ^ 2, eta)) (actualJet p (r ^ 2, eta)) |
| 495 | (deriv (fun z => profileVector phi u k p r z 4) eta) |
| 496 | (deriv (fun z => profileVector phi u k p r z 5) eta) := by |
| 497 | ext i |
| 498 | fin_cases i <;> simp only [profileVector, jetVector, actualJet, parameterJetVector] |
| 499 | · exact (hasDerivAt_parameterProfile hphi).deriv |
| 500 | · exact (hasDerivAt_parameterProfile hu).deriv |
| 501 | · exact (hasDerivAt_parameterProfile hk).deriv |
| 502 | · exact (hasDerivAt_parameterProfile hp).deriv |
| 503 | · rfl |
| 504 | · rfl |
| 505 | |
| 506 | /-- The displayed first-order system uses actual derivatives of the actual |
| 507 | profiles, not independent formal jet variables. -/ |
| 508 | def ProfileSystem (h lam C r eta : ℝ) (b : BaseJet ℝ) (s : SourceJet ℝ) |
| 509 | (phi u k p : InnerProfile) : Prop := |
| 510 | (fun i => deriv (fun q => profileVector phi u k p q eta i) r + |
| 511 | diagonal i / r * profileVector phi u k p r eta i) = |
| 512 | matrixRHS h lam C r eta b s (profileVector phi u k p r eta) |
| 513 | (fun i => deriv (fun z => profileVector phi u k p r z i) eta) |
| 514 | |
| 515 | theorem profileSystem_iff_expanded {h lam C r eta : ℝ} (hr : r ≠ 0) |
| 516 | (b : BaseJet ℝ) (s : SourceJet ℝ) {phi u k p : InnerProfile} |
| 517 | (hphi : ContDiffAt ℝ 2 phi (r ^ 2, eta)) (hu : ContDiffAt ℝ 2 u (r ^ 2, eta)) |
| 518 | (hk : DifferentiableAt ℝ k (r ^ 2, eta)) (hp : DifferentiableAt ℝ p (r ^ 2, eta)) : |
| 519 | ProfileSystem h lam C r eta b s phi u k p ↔ |
| 520 | ExpandedEquations h lam C eta (r ^ 2) b s (actualJet phi (r ^ 2, eta)) |
| 521 | (actualJet u (r ^ 2, eta)) (actualJet k (r ^ 2, eta)) (actualJet p (r ^ 2, eta)) := by |
| 522 | unfold ProfileSystem |
| 523 | rw [profileVector_parameter (hphi.differentiableAt (by norm_num)) |
| 524 | (hu.differentiableAt (by norm_num)) hk hp] |
| 525 | have hdr := profileVector_radial hphi hu hk hp |
| 526 | simp_rw [show ∀ i, deriv (fun q => profileVector phi u k p q eta i) r = |
| 527 | radialJetVector r (actualJet phi (r ^ 2, eta)) (actualJet u (r ^ 2, eta)) |
| 528 | (actualJet k (r ^ 2, eta)) (actualJet p (r ^ 2, eta)) i from congrFun hdr] |
| 529 | exact jetSystem_iff_expanded hr b s _ _ _ _ _ _ |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | /-- The preceding axial viscosity uses the actual similarity operator twice. |
| 535 | The negative-order term at order zero is zero. -/ |
| 536 | noncomputable def precedingDiffusion (h power : ℝ) (F : ℕ → InnerProfile) (n : ℕ) : InnerProfile := |
| 537 | if n = 0 then fun _ => 0 else |
| 538 | Z h (power + slowPower h (n - 1) - dScale h) |
| 539 | (Z h (power + slowPower h (n - 1)) (F (n - 1))) |
| 540 | |
| 541 | theorem precedingDiffusion_congr (h power : ℝ) {F G : ℕ → InnerProfile} {n : ℕ} |
| 542 | (hFG : ∀ j, j < n → F j = G j) : |
| 543 | precedingDiffusion h power F n = precedingDiffusion h power G n := by |
| 544 | cases n with |
| 545 | | zero => rfl |
| 546 | | succ k => simp [precedingDiffusion, hFG k (Nat.lt_succ_self k)] |
| 547 | |
| 548 | /-- Fully specified source from lower-order profile jets and a supplied |
| 549 | regular representative of the preceding `Ω/X`. -/ |
| 550 | noncomputable def actualLowerSource (h : ℝ) (n : ℕ) (phi u beta : ℕ → InnerProfile) |
| 551 | (omegaQuotient : InnerProfile) (w : InnerPoint) : SourceJet ℝ := |
| 552 | lowerSource h w.2 w.1 n (fun j => actualJet (phi j) w) (fun j => actualJet (u j) w) |
| 553 | (fun j => beta j w) (precedingDiffusion h (angularPower h) phi n w) |
| 554 | (precedingDiffusion h (axialPower h) u n w) (omegaQuotient w) |
| 555 | |
| 556 | theorem actualLowerSource_congr (h : ℝ) {n : ℕ} |
| 557 | {phi u beta phi' u' beta' : ℕ → InnerProfile} (omegaQuotient : InnerProfile) |
| 558 | (hphi : ∀ j, j < n → phi j = phi' j) |
| 559 | (hu : ∀ j, j < n → u j = u' j) (hbeta : ∀ j, j < n → beta j = beta' j) |
| 560 | (w : InnerPoint) : |
| 561 | actualLowerSource h n phi u beta omegaQuotient w = |
| 562 | actualLowerSource h n phi' u' beta' omegaQuotient w := by |
| 563 | have ha : lowerConvolution n (angularConvection h w.2 w.1 |
| 564 | (fun j => actualJet (phi j) w) (fun j => actualJet (u j) w) (fun j => beta j w)) = |
| 565 | lowerConvolution n (angularConvection h w.2 w.1 |
| 566 | (fun j => actualJet (phi' j) w) (fun j => actualJet (u' j) w) (fun j => beta' j w)) := by |
| 567 | apply lowerConvolution_congr |
| 568 | intro i hi j hj |
| 569 | simp only [angularConvection, hphi j hj, hu i hi, hbeta i hi] |
| 570 | have hb : lowerConvolution n (axialConvection h w.2 w.1 |
| 571 | (fun j => actualJet (u j) w) (fun j => beta j w)) = |
| 572 | lowerConvolution n (axialConvection h w.2 w.1 |
| 573 | (fun j => actualJet (u' j) w) (fun j => beta' j w)) := by |
| 574 | apply lowerConvolution_congr |
| 575 | intro i hi j hj |
| 576 | simp only [axialConvection, hu i hi, hu j hj, hbeta i hi] |
| 577 | have hc : lowerConvolution n (fun i j => (actualJet (phi i) w).value * (actualJet (phi j) w).value) = |
| 578 | lowerConvolution n (fun i j => (actualJet (phi' i) w).value * (actualJet (phi' j) w).value) := by |
| 579 | apply lowerConvolution_congr |
| 580 | intro i hi j hj |
| 581 | rw [hphi i hi, hphi j hj] |
| 582 | simp only [actualLowerSource, lowerSource, ha, hb, hc, |
| 583 | precedingDiffusion_congr h (angularPower h) hphi, |
| 584 | precedingDiffusion_congr h (axialPower h) hu] |
| 585 | |
| 586 | theorem actualLowerSource_update (h : ℝ) (n : ℕ) (phi u beta : ℕ → InnerProfile) |
| 587 | (phiNew uNew betaNew omegaQuotient : InnerProfile) (w : InnerPoint) : |
| 588 | actualLowerSource h n (Function.update phi n phiNew) (Function.update u n uNew) |
| 589 | (Function.update beta n betaNew) omegaQuotient w = |
| 590 | actualLowerSource h n phi u beta omegaQuotient w := by |
| 591 | apply actualLowerSource_congr |
| 592 | all_goals intro j hj; exact Function.update_of_ne (Nat.ne_of_lt hj) _ _ |
| 593 | |
| 594 | theorem baseAtOrderZero_update {n : ℕ} (hn : 0 < n) (phi u beta : ℕ → InnerProfile) |
| 595 | (phiNew uNew betaNew : InnerProfile) (w : InnerPoint) : |
| 596 | baseAtOrderZero (fun j => actualJet (Function.update phi n phiNew j) w) |
| 597 | (fun j => actualJet (Function.update u n uNew j) w) |
| 598 | (fun j => Function.update beta n betaNew j w) = |
| 599 | baseAtOrderZero (fun j => actualJet (phi j) w) |
| 600 | (fun j => actualJet (u j) w) (fun j => beta j w) := by |
| 601 | simp only [baseAtOrderZero, Function.update_of_ne (Nat.ne_of_lt hn)] |
| 602 | |
| 603 | /-- End-to-end equivalence from the actual profile derivatives to the |
| 604 | positive-order convolution equations, with all finite source terms displayed. -/ |
| 605 | theorem profileSystem_iff_positiveOrder {h C r eta : ℝ} (hr : r ≠ 0) |
| 606 | {n : ℕ} (hn : 0 < n) (phi u beta : ℕ → InnerProfile) (k p omegaQuotient : InnerProfile) |
| 607 | (hphi : ContDiffAt ℝ 2 (phi n) (r ^ 2, eta)) (hu : ContDiffAt ℝ 2 (u n) (r ^ 2, eta)) |
| 608 | (hk : DifferentiableAt ℝ k (r ^ 2, eta)) (hp : DifferentiableAt ℝ p (r ^ 2, eta)) |
| 609 | (hbeta : beta n (r ^ 2, eta) = betaValue h (slowPower h n) eta |
| 610 | (actualJet (u n) (r ^ 2, eta)) (actualJet k (r ^ 2, eta))) : |
| 611 | ProfileSystem h (slowPower h n) C r eta |
| 612 | (baseAtOrderZero (fun j => actualJet (phi j) (r ^ 2, eta)) |
| 613 | (fun j => actualJet (u j) (r ^ 2, eta)) (fun j => beta j (r ^ 2, eta))) |
| 614 | (actualLowerSource h n phi u beta omegaQuotient (r ^ 2, eta)) (phi n) (u n) k p ↔ |
| 615 | PositiveOrderEquations h C eta (r ^ 2) n |
| 616 | (fun j => actualJet (phi j) (r ^ 2, eta)) (fun j => actualJet (u j) (r ^ 2, eta)) |
| 617 | (fun j => beta j (r ^ 2, eta)) (actualJet k (r ^ 2, eta)) (actualJet p (r ^ 2, eta)) |
| 618 | (precedingDiffusion h (angularPower h) phi n (r ^ 2, eta)) |
| 619 | (precedingDiffusion h (axialPower h) u n (r ^ 2, eta)) (omegaQuotient (r ^ 2, eta)) := |
| 620 | (profileSystem_iff_expanded hr _ _ hphi hu hk hp).trans |
| 621 | (expanded_iff_positiveOrder h C eta (r ^ 2) hn _ _ _ _ _ _ _ _ hbeta) |
| 622 | |
| 623 | /-- The actual radial-average difference, with its regular value at the axis. -/ |
| 624 | noncomputable def averageDefect (u : InnerProfile) : InnerProfile := |
| 625 | fun w => ProfileHistories.average u w - u w |
| 626 | |
| 627 | theorem averageDefect_smooth (Ω : ProfileHistories.RadialDomain) {u : InnerProfile} |
| 628 | (hu : ContDiffOn ℝ ∞ u Ω.carrier) : ContDiffOn ℝ ∞ (averageDefect u) Ω.carrier := |
| 629 | (ProfileHistories.average_smooth Ω hu).sub hu |
| 630 | |
| 631 | theorem averageDefect_radial (Ω : ProfileHistories.RadialDomain) {u : InnerProfile} |
| 632 | (hu : ContDiffOn ℝ ∞ u Ω.carrier) {w : InnerPoint} (hw : w ∈ Ω.carrier) : |
| 633 | w.1 * (partialX u w + partialX (averageDefect u) w) + averageDefect u w = 0 := by |
| 634 | have hua := (hu.contDiffAt (Ω.isOpen.mem_nhds hw)).differentiableAt (by simp) |
| 635 | have haa := ((ProfileHistories.average_smooth Ω hu).contDiffAt |
| 636 | (Ω.isOpen.mem_nhds hw)).differentiableAt (by simp) |
| 637 | have hdx : partialX (averageDefect u) w = |
| 638 | partialX (ProfileHistories.average u) w - partialX u w := by |
| 639 | change (fderiv ℝ (fun v => ProfileHistories.average u v - u v) w) (1, 0) = _ |
| 640 | rw [fderiv_fun_sub haa hua] |
| 641 | rfl |
| 642 | have hd := (hasDerivAt_id w.1).fun_mul |
| 643 | (ProfileHistories.radialPartial_hasDerivAt Ω (ProfileHistories.average_smooth Ω hu) hw) |
| 644 | have hp := ProfileHistories.primitive_hasDerivAt Ω hu hw |
| 645 | have heq : (fun x => x * ProfileHistories.average u (x, w.2)) = |
| 646 | (fun x => ProfileHistories.primitive u (x, w.2)) := by |
| 647 | funext x |
| 648 | exact (ProfileHistories.primitive_eq_mul_average u (x, w.2)).symm |
| 649 | simp only [id_eq] at hd |
| 650 | rw [heq] at hd |
| 651 | have hh := hd.unique hp |
| 652 | rw [hdx] |
| 653 | change w.1 * (partialX u w + (partialX (ProfileHistories.average u) w - partialX u w)) + |
| 654 | (ProfileHistories.average u w - u w) = 0 |
| 655 | change 1 * ProfileHistories.average u (w.1, w.2) + |
| 656 | w.1 * partialX (ProfileHistories.average u) w = u w at hh |
| 657 | simp only [one_mul, Prod.eta] at hh |
| 658 | linear_combination hh |
| 659 | |
| 660 | theorem betaValue_averageDefect (Ω : ProfileHistories.RadialDomain) {u : InnerProfile} |
| 661 | (hu : ContDiffOn ℝ ∞ u Ω.carrier) (h lam : ℝ) {w : InnerPoint} |
| 662 | (hw : w ∈ Ω.carrier) (hX : w.1 ≠ 0) : |
| 663 | betaValue h lam w.2 (actualJet u w) (actualJet (averageDefect u) w) = |
| 664 | SlowDivergence.radialFlux h lam u w / w.1 := by |
| 665 | have hua := (hu.contDiffAt (Ω.isOpen.mem_nhds hw)).differentiableAt (by simp) |
| 666 | have haa := ((ProfileHistories.average_smooth Ω hu).contDiffAt |
| 667 | (Ω.isOpen.mem_nhds hw)).differentiableAt (by simp) |
| 668 | have hde : partialEta (averageDefect u) w = |
| 669 | partialEta (ProfileHistories.average u) w - partialEta u w := by |
| 670 | change (fderiv ℝ (fun v => ProfileHistories.average u v - u v) w) (0, 1) = _ |
| 671 | rw [fderiv_fun_sub haa hua] |
| 672 | rfl |
| 673 | rw [betaValue_eq_average_formula, SlowDivergence.radialFlux_div_radial h lam u hX] |
| 674 | simp only [actualJet] |
| 675 | rw [hde] |
| 676 | simp only [averageDefect, dScale, edge, ell, CoordinateAlgebra.D, |
| 677 | CoordinateAlgebra.d, CoordinateAlgebra.L] |
| 678 | simp only [div_eq_mul_inv] |
| 679 | ring |
| 680 | |
| 681 | /-- Both identities in (21) hold for the same actual reconstructed flux. -/ |
| 682 | theorem averageDefect_divergence (Ω : ProfileHistories.RadialDomain) {u : InnerProfile} |
| 683 | (hu : ContDiffOn ℝ ∞ u Ω.carrier) (h lam : ℝ) {w : InnerPoint} |
| 684 | (hw : w ∈ Ω.carrier) (hL : ell h w.2 ≠ 0) : |
| 685 | partialX (SlowDivergence.radialFlux h lam u) w = |
| 686 | -axialValue h (-a h + lam) w.2 w.1 (actualJet u w) := |
| 687 | SlowDivergence.partialX_radialFlux Ω hu h lam hw hL |
| 688 | |
| 689 | |
| 690 | /-- The regular average row also recovers the actual radial average. Thus a |
| 691 | smooth solution's third component cannot be an independent auxiliary field. -/ |
| 692 | theorem averageDefect_unique (Ω : ProfileHistories.RadialDomain) {u k : InnerProfile} |
| 693 | (hu : ContDiffOn ℝ ∞ u Ω.carrier) (hk : ContDiffOn ℝ ∞ k Ω.carrier) |
| 694 | (hrow : ∀ w ∈ Ω.carrier, w.1 * (partialX u w + partialX k w) + k w = 0) |
| 695 | {w : InnerPoint} (hw : w ∈ Ω.carrier) : k w = averageDefect u w := by |
| 696 | by_cases hX : w.1 = 0 |
| 697 | · have hk0 := hrow w hw |
| 698 | have hw0 : w = (0, w.2) := by ext <;> simp [hX] |
| 699 | rw [hw0] at hk0 ⊢ |
| 700 | simpa [averageDefect, ProfileHistories.average_at_axis] using hk0 |
| 701 | have hd : ∀ x ∈ uIcc (0 : ℝ) w.1, |
| 702 | HasDerivAt (fun y => y * (u (y, w.2) + k (y, w.2))) (u (x, w.2)) x := by |
| 703 | intro x hx |
| 704 | have hxΩ := Ω.segment_mem hw hx |
| 705 | have hdu := ProfileHistories.radialPartial_hasDerivAt Ω hu hxΩ |
| 706 | have hdk := ProfileHistories.radialPartial_hasDerivAt Ω hk hxΩ |
| 707 | apply ((hasDerivAt_id x).fun_mul (hdu.fun_add hdk)).congr_deriv |
| 708 | have he := hrow (x, w.2) hxΩ |
| 709 | change x * (ProfileHistories.radialPartial u (x, w.2) + |
| 710 | ProfileHistories.radialPartial k (x, w.2)) + k (x, w.2) = 0 at he |
| 711 | simp only [id_eq] |
| 712 | linear_combination he |
| 713 | have hi := intervalIntegral.integral_eq_sub_of_hasDerivAt hd |
| 714 | (ProfileHistories.radial_slice_intervalIntegrable Ω hu hw) |
| 715 | have hi' : ProfileHistories.primitive u w = w.1 * (u w + k w) := by |
| 716 | simpa only [ProfileHistories.primitive, zero_mul, sub_zero, Prod.eta] using hi |
| 717 | rw [ProfileHistories.primitive_eq_mul_average] at hi' |
| 718 | have he := mul_left_cancel₀ hX hi' |
| 719 | unfold averageDefect |
| 720 | linarith |
| 721 | |
| 722 | end ActualProfiles |
| 723 | |
| 724 | |
| 725 | section ComplexCoefficients |
| 726 | |
| 727 | open VolterraAnalyticBounds VolterraParity |
| 728 | |
| 729 | /-- The eleven finite input jets are, in order: |
| 730 | `φ₀, ∂Xφ₀, ∂ηφ₀, U₀, ∂XU₀, ∂ηU₀, β₀`, followed by the angular source, |
| 731 | axial source, lower pressure product, and regular quotient `Ω_(n-1)/X`. |
| 732 | Regularity is required of these actual finite jets, not inferred from |
| 733 | separate smoothness of a lower-order profile. -/ |
| 734 | abbrev CoefficientData := Fin 11 → ℝ × ℂ → ℂ |
| 735 | |
| 736 | noncomputable def coefficientBase (F : CoefficientData) (X : ℝ) (z : ℂ) : BaseJet ℂ := |
| 737 | ⟨⟨F 0 (X, z), F 1 (X, z), 0, F 2 (X, z)⟩, |
| 738 | ⟨F 3 (X, z), F 4 (X, z), 0, F 5 (X, z)⟩, F 6 (X, z)⟩ |
| 739 | |
| 740 | noncomputable def coefficientSource (F : CoefficientData) (X : ℝ) (z : ℂ) : SourceJet ℂ := |
| 741 | ⟨F 7 (X, z), F 8 (X, z), F 9 (X, z), F 10 (X, z)⟩ |
| 742 | |
| 743 | noncomputable def coefficient0 (h lam C : ℂ) (F : CoefficientData) : Coeff := |
| 744 | fun r z => A0 h lam C (r : ℂ) z (coefficientBase F (r ^ 2) z) |
| 745 | |
| 746 | noncomputable def coefficient1 (h : ℂ) (F : CoefficientData) : Coeff := |
| 747 | fun r z => A1 h (r : ℂ) z (coefficientBase F (r ^ 2) z) |
| 748 | |
| 749 | noncomputable def sourceField (h C : ℂ) (F : CoefficientData) : Field := |
| 750 | fun r z => forcing h C (r : ℂ) z (coefficientSource F (r ^ 2) z) |
| 751 | |
| 752 | theorem coefficient1_shape (h : ℂ) (F : CoefficientData) : |
| 753 | DerivativeShape (coefficient1 h F) := by |
| 754 | intro r z i j hij |
| 755 | exact A1_shape h (r : ℂ) z _ i j hij |
| 756 | |
| 757 | theorem diagonal_eq_exponent (i : Fin 6) : |
| 758 | (diagonal i : ℂ) = (exponent i : ℂ) := by |
| 759 | fin_cases i <;> norm_num [diagonal, exponent] |
| 760 | |
| 761 | theorem coefficient0_parity (h lam C : ℂ) (F : CoefficientData) : |
| 762 | CoefficientParity (coefficient0 h lam C F) := by |
| 763 | intro r z i j |
| 764 | simp only [coefficient0, neg_sq, Complex.ofReal_neg] |
| 765 | fin_cases i <;> fin_cases j <;> simp [A0, paritySign, axialValue] |
| 766 | |
| 767 | theorem coefficient1_parity (h : ℂ) (F : CoefficientData) : |
| 768 | CoefficientParity (coefficient1 h F) := by |
| 769 | intro r z i j |
| 770 | simp only [coefficient1, neg_sq, Complex.ofReal_neg] |
| 771 | fin_cases i <;> fin_cases j <;> simp [A1, paritySign] |
| 772 | |
| 773 | theorem sourceField_parity (h C : ℂ) (F : CoefficientData) : |
| 774 | ForcingParity (sourceField h C F) := by |
| 775 | intro r z i |
| 776 | simp only [sourceField, neg_sq, Complex.ofReal_neg] |
| 777 | fin_cases i <;> simp [forcing, paritySign] |
| 778 | |
| 779 | private theorem data_square_contDiffAt {n : WithTop ℕ∞} {F : CoefficientData} |
| 780 | {w : ℝ × ℂ} (hF : ∀ i, ContDiffAt ℝ n (F i) (w.1 ^ 2, w.2)) (i : Fin 11) : |
| 781 | ContDiffAt ℝ n (fun v : ℝ × ℂ => F i (v.1 ^ 2, v.2)) w := |
| 782 | (hF i).comp w ((contDiffAt_fst.pow 2).prodMk contDiffAt_snd) |
| 783 | |
| 784 | theorem coefficient0_contDiffAt_of_pullback {n : WithTop ℕ∞} {h lam C : ℂ} {F : CoefficientData} |
| 785 | {w : ℝ × ℂ} (hF : ∀ i, ContDiffAt ℝ n (fun v : ℝ × ℂ => F i (v.1 ^ 2, v.2)) w) |
| 786 | (hL : ell h w.2 ≠ 0) (i j : Fin 6) : |
| 787 | ContDiffAt ℝ n (fun v : ℝ × ℂ => coefficient0 h lam C F v.1 v.2 i j) w := by |
| 788 | have hdata := hF |
| 789 | change 1 - 2 * h * w.2 ^ 2 ≠ 0 at hL |
| 790 | have hlinv : ContDiffAt ℝ n (fun v : ℝ × ℂ => (1 - 2 * h * v.2 ^ 2)⁻¹) w := |
| 791 | (contDiffAt_const.sub (contDiffAt_const.mul (contDiffAt_snd.pow 2))).inv hL |
| 792 | have hcoe : ContDiffAt ℝ n (fun v : ℝ × ℂ => (v.1 : ℂ)) w := |
| 793 | Complex.ofRealCLM.contDiff.contDiffAt.comp w contDiffAt_fst |
| 794 | fin_cases i <;> fin_cases j <;> |
| 795 | simp [coefficient0, A0, coefficientBase, axialValue, ell, edge, |
| 796 | Matrix.cons_val_zero, Matrix.cons_val_one, div_eq_mul_inv] <;> |
| 797 | (repeat' first |
| 798 | | exact contDiffAt_const |
| 799 | | exact hdata _ |
| 800 | | exact contDiffAt_snd |
| 801 | | exact hcoe |
| 802 | | exact hlinv |
| 803 | | apply ContDiffAt.add |
| 804 | | apply ContDiffAt.sub |
| 805 | | apply ContDiffAt.mul |
| 806 | | apply ContDiffAt.neg) |
| 807 | |
| 808 | theorem coefficient1_contDiffAt_of_pullback {n : WithTop ℕ∞} {h : ℂ} {F : CoefficientData} |
| 809 | {w : ℝ × ℂ} (hF : ∀ i, ContDiffAt ℝ n (fun v : ℝ × ℂ => F i (v.1 ^ 2, v.2)) w) |
| 810 | (hL : ell h w.2 ≠ 0) (i j : Fin 6) : |
| 811 | ContDiffAt ℝ n (fun v : ℝ × ℂ => coefficient1 h F v.1 v.2 i j) w := by |
| 812 | have hdata := hF |
| 813 | change 1 - 2 * h * w.2 ^ 2 ≠ 0 at hL |
| 814 | have hlinv : ContDiffAt ℝ n (fun v : ℝ × ℂ => (1 - 2 * h * v.2 ^ 2)⁻¹) w := |
| 815 | (contDiffAt_const.sub (contDiffAt_const.mul (contDiffAt_snd.pow 2))).inv hL |
| 816 | have hcoe : ContDiffAt ℝ n (fun v : ℝ × ℂ => (v.1 : ℂ)) w := |
| 817 | Complex.ofRealCLM.contDiff.contDiffAt.comp w contDiffAt_fst |
| 818 | fin_cases i <;> fin_cases j <;> |
| 819 | simp [coefficient1, A1, coefficientBase, ell, edge, |
| 820 | Matrix.cons_val_zero, Matrix.cons_val_one, div_eq_mul_inv] <;> |
| 821 | (repeat' first |
| 822 | | exact contDiffAt_const |
| 823 | | exact hdata _ |
| 824 | | exact contDiffAt_snd |
| 825 | | exact hcoe |
| 826 | | exact hlinv |
| 827 | | apply ContDiffAt.add |
| 828 | | apply ContDiffAt.sub |
| 829 | | apply ContDiffAt.mul |
| 830 | | apply ContDiffAt.neg) |
| 831 | |
| 832 | theorem sourceField_contDiffAt_of_pullback {n : WithTop ℕ∞} {h C : ℂ} {F : CoefficientData} |
| 833 | {w : ℝ × ℂ} (hF : ∀ i, ContDiffAt ℝ n (fun v : ℝ × ℂ => F i (v.1 ^ 2, v.2)) w) |
| 834 | (hL : ell h w.2 ≠ 0) (i : Fin 6) : |
| 835 | ContDiffAt ℝ n (fun v : ℝ × ℂ => sourceField h C F v.1 v.2 i) w := by |
| 836 | have hdata := hF |
| 837 | change 1 - 2 * h * w.2 ^ 2 ≠ 0 at hL |
| 838 | have hlinv : ContDiffAt ℝ n (fun v : ℝ × ℂ => (1 - 2 * h * v.2 ^ 2)⁻¹) w := |
| 839 | (contDiffAt_const.sub (contDiffAt_const.mul (contDiffAt_snd.pow 2))).inv hL |
| 840 | have hcoe : ContDiffAt ℝ n (fun v : ℝ × ℂ => (v.1 : ℂ)) w := |
| 841 | Complex.ofRealCLM.contDiff.contDiffAt.comp w contDiffAt_fst |
| 842 | fin_cases i <;> |
| 843 | simp [sourceField, forcing, coefficientSource, pressureSource, ell, |
| 844 | Matrix.cons_val_zero, Matrix.cons_val_one, div_eq_mul_inv] <;> |
| 845 | (repeat' first |
| 846 | | exact contDiffAt_const |
| 847 | | exact hdata _ |
| 848 | | exact contDiffAt_snd |
| 849 | | exact hcoe |
| 850 | | exact hlinv |
| 851 | | apply ContDiffAt.add |
| 852 | | apply ContDiffAt.sub |
| 853 | | apply ContDiffAt.mul) |
| 854 | |
| 855 | theorem coefficient0_analyticAt {h lam C : ℂ} {F : CoefficientData} {r : ℝ} {z : ℂ} |
| 856 | (hF : ∀ i, AnalyticAt ℂ (fun v => F i (r ^ 2, v)) z) (hL : ell h z ≠ 0) (i j : Fin 6) : |
| 857 | AnalyticAt ℂ (fun v => coefficient0 h lam C F r v i j) z := by |
| 858 | change 1 - 2 * h * z ^ 2 ≠ 0 at hL |
| 859 | have hlinv : AnalyticAt ℂ (fun v : ℂ => (1 - 2 * h * v ^ 2)⁻¹) z := |
| 860 | (analyticAt_const.sub (analyticAt_const.mul (analyticAt_id.pow 2))).inv hL |
| 861 | fin_cases i <;> fin_cases j <;> |
| 862 | simp [coefficient0, A0, coefficientBase, axialValue, ell, edge, |
| 863 | Matrix.cons_val_zero, Matrix.cons_val_one, div_eq_mul_inv] <;> |
| 864 | (repeat' first |
| 865 | | exact analyticAt_const |
| 866 | | exact hF _ |
| 867 | | exact analyticAt_id |
| 868 | | exact hlinv |
| 869 | | apply AnalyticAt.fun_add |
| 870 | | apply AnalyticAt.fun_sub |
| 871 | | apply AnalyticAt.fun_mul |
| 872 | | apply AnalyticAt.fun_neg) |
| 873 | |
| 874 | theorem coefficient1_analyticAt {h : ℂ} {F : CoefficientData} {r : ℝ} {z : ℂ} |
| 875 | (hF : ∀ i, AnalyticAt ℂ (fun v => F i (r ^ 2, v)) z) (hL : ell h z ≠ 0) (i j : Fin 6) : |
| 876 | AnalyticAt ℂ (fun v => coefficient1 h F r v i j) z := by |
| 877 | change 1 - 2 * h * z ^ 2 ≠ 0 at hL |
| 878 | have hlinv : AnalyticAt ℂ (fun v : ℂ => (1 - 2 * h * v ^ 2)⁻¹) z := |
| 879 | (analyticAt_const.sub (analyticAt_const.mul (analyticAt_id.pow 2))).inv hL |
| 880 | fin_cases i <;> fin_cases j <;> |
| 881 | simp [coefficient1, A1, coefficientBase, ell, edge, |
| 882 | Matrix.cons_val_zero, Matrix.cons_val_one, div_eq_mul_inv] <;> |
| 883 | (repeat' first |
| 884 | | exact analyticAt_const |
| 885 | | exact hF _ |
| 886 | | exact analyticAt_id |
| 887 | | exact hlinv |
| 888 | | apply AnalyticAt.fun_add |
| 889 | | apply AnalyticAt.fun_sub |
| 890 | | apply AnalyticAt.fun_mul |
| 891 | | apply AnalyticAt.fun_neg) |
| 892 | |
| 893 | theorem sourceField_analyticAt {h C : ℂ} {F : CoefficientData} {r : ℝ} {z : ℂ} |
| 894 | (hF : ∀ i, AnalyticAt ℂ (fun v => F i (r ^ 2, v)) z) (hL : ell h z ≠ 0) (i : Fin 6) : |
| 895 | AnalyticAt ℂ (fun v => sourceField h C F r v i) z := by |
| 896 | change 1 - 2 * h * z ^ 2 ≠ 0 at hL |
| 897 | have hlinv : AnalyticAt ℂ (fun v : ℂ => (1 - 2 * h * v ^ 2)⁻¹) z := |
| 898 | (analyticAt_const.sub (analyticAt_const.mul (analyticAt_id.pow 2))).inv hL |
| 899 | fin_cases i <;> |
| 900 | simp [sourceField, forcing, coefficientSource, pressureSource, ell, |
| 901 | Matrix.cons_val_zero, Matrix.cons_val_one, div_eq_mul_inv] <;> |
| 902 | (repeat' first |
| 903 | | exact analyticAt_const |
| 904 | | exact hF _ |
| 905 | | exact analyticAt_id |
| 906 | | exact hlinv |
| 907 | | apply AnalyticAt.fun_add |
| 908 | | apply AnalyticAt.fun_sub |
| 909 | | apply AnalyticAt.fun_mul) |
| 910 | |
| 911 | |
| 912 | /-- One-sided smooth X data suffice for a smooth signed square pullback. -/ |
| 913 | theorem square_pullback_contDiffAt {n : WithTop ℕ∞} {f : ℝ × ℂ → ℂ} {w : ℝ × ℂ} |
| 914 | (hf : ContDiffWithinAt ℝ n f (Ici (0 : ℝ) ×ˢ (univ : Set ℂ)) (w.1 ^ 2, w.2)) : |
| 915 | ContDiffAt ℝ n (fun v : ℝ × ℂ => f (v.1 ^ 2, v.2)) w := by |
| 916 | change ContDiffWithinAt ℝ n _ univ _ |
| 917 | apply hf.comp w ((contDiffAt_fst.pow 2).prodMk contDiffAt_snd).contDiffWithinAt |
| 918 | intro v _hv |
| 919 | exact ⟨sq_nonneg v.1, Set.mem_univ _⟩ |
| 920 | |
| 921 | theorem coefficient0_contDiffAt {n : WithTop ℕ∞} {h lam C : ℂ} {F : CoefficientData} |
| 922 | {w : ℝ × ℂ} (hF : ∀ i, ContDiffAt ℝ n (F i) (w.1 ^ 2, w.2)) |
| 923 | (hL : ell h w.2 ≠ 0) (i j : Fin 6) : |
| 924 | ContDiffAt ℝ n (fun v : ℝ × ℂ => coefficient0 h lam C F v.1 v.2 i j) w := |
| 925 | coefficient0_contDiffAt_of_pullback (data_square_contDiffAt hF) hL i j |
| 926 | |
| 927 | theorem coefficient1_contDiffAt {n : WithTop ℕ∞} {h : ℂ} {F : CoefficientData} |
| 928 | {w : ℝ × ℂ} (hF : ∀ i, ContDiffAt ℝ n (F i) (w.1 ^ 2, w.2)) |
| 929 | (hL : ell h w.2 ≠ 0) (i j : Fin 6) : |
| 930 | ContDiffAt ℝ n (fun v : ℝ × ℂ => coefficient1 h F v.1 v.2 i j) w := |
| 931 | coefficient1_contDiffAt_of_pullback (data_square_contDiffAt hF) hL i j |
| 932 | |
| 933 | theorem sourceField_contDiffAt {n : WithTop ℕ∞} {h C : ℂ} {F : CoefficientData} |
| 934 | {w : ℝ × ℂ} (hF : ∀ i, ContDiffAt ℝ n (F i) (w.1 ^ 2, w.2)) |
| 935 | (hL : ell h w.2 ≠ 0) (i : Fin 6) : |
| 936 | ContDiffAt ℝ n (fun v : ℝ × ℂ => sourceField h C F v.1 v.2 i) w := |
| 937 | sourceField_contDiffAt_of_pullback (data_square_contDiffAt hF) hL i |
| 938 | |
| 939 | theorem coefficient0_contDiffOn_of_pullback {n : WithTop ℕ∞} {h lam C : ℂ} |
| 940 | {F : CoefficientData} {S : Set (ℝ × ℂ)} |
| 941 | (hF : ∀ w ∈ S, ∀ i, ContDiffAt ℝ n (fun v : ℝ × ℂ => F i (v.1 ^ 2, v.2)) w) |
| 942 | (hL : ∀ w ∈ S, ell h w.2 ≠ 0) (i j : Fin 6) : |
| 943 | ContDiffOn ℝ n (fun v : ℝ × ℂ => coefficient0 h lam C F v.1 v.2 i j) S := |
| 944 | fun w hw => (coefficient0_contDiffAt_of_pullback (hF w hw) (hL w hw) i j).contDiffWithinAt |
| 945 | |
| 946 | theorem coefficient1_contDiffOn_of_pullback {n : WithTop ℕ∞} {h : ℂ} |
| 947 | {F : CoefficientData} {S : Set (ℝ × ℂ)} |
| 948 | (hF : ∀ w ∈ S, ∀ i, ContDiffAt ℝ n (fun v : ℝ × ℂ => F i (v.1 ^ 2, v.2)) w) |
| 949 | (hL : ∀ w ∈ S, ell h w.2 ≠ 0) (i j : Fin 6) : |
| 950 | ContDiffOn ℝ n (fun v : ℝ × ℂ => coefficient1 h F v.1 v.2 i j) S := |
| 951 | fun w hw => (coefficient1_contDiffAt_of_pullback (hF w hw) (hL w hw) i j).contDiffWithinAt |
| 952 | |
| 953 | theorem sourceField_contDiffOn_of_pullback {n : WithTop ℕ∞} {h C : ℂ} |
| 954 | {F : CoefficientData} {S : Set (ℝ × ℂ)} |
| 955 | (hF : ∀ w ∈ S, ∀ i, ContDiffAt ℝ n (fun v : ℝ × ℂ => F i (v.1 ^ 2, v.2)) w) |
| 956 | (hL : ∀ w ∈ S, ell h w.2 ≠ 0) (i : Fin 6) : |
| 957 | ContDiffOn ℝ n (fun v : ℝ × ℂ => sourceField h C F v.1 v.2 i) S := |
| 958 | fun w hw => (sourceField_contDiffAt_of_pullback (hF w hw) (hL w hw) i).contDiffWithinAt |
| 959 | |
| 960 | theorem coefficient0_contDiffOn {n : WithTop ℕ∞} {h lam C : ℂ} {F : CoefficientData} |
| 961 | {S : Set (ℝ × ℂ)} |
| 962 | (hF : ∀ w ∈ S, ∀ i, ContDiffAt ℝ n (F i) (w.1 ^ 2, w.2)) |
| 963 | (hL : ∀ w ∈ S, ell h w.2 ≠ 0) (i j : Fin 6) : |
| 964 | ContDiffOn ℝ n (fun v : ℝ × ℂ => coefficient0 h lam C F v.1 v.2 i j) S := |
| 965 | fun w hw => (coefficient0_contDiffAt (hF w hw) (hL w hw) i j).contDiffWithinAt |
| 966 | |
| 967 | theorem coefficient1_contDiffOn {n : WithTop ℕ∞} {h : ℂ} {F : CoefficientData} |
| 968 | {S : Set (ℝ × ℂ)} |
| 969 | (hF : ∀ w ∈ S, ∀ i, ContDiffAt ℝ n (F i) (w.1 ^ 2, w.2)) |
| 970 | (hL : ∀ w ∈ S, ell h w.2 ≠ 0) (i j : Fin 6) : |
| 971 | ContDiffOn ℝ n (fun v : ℝ × ℂ => coefficient1 h F v.1 v.2 i j) S := |
| 972 | fun w hw => (coefficient1_contDiffAt (hF w hw) (hL w hw) i j).contDiffWithinAt |
| 973 | |
| 974 | theorem sourceField_contDiffOn {n : WithTop ℕ∞} {h C : ℂ} {F : CoefficientData} |
| 975 | {S : Set (ℝ × ℂ)} |
| 976 | (hF : ∀ w ∈ S, ∀ i, ContDiffAt ℝ n (F i) (w.1 ^ 2, w.2)) |
| 977 | (hL : ∀ w ∈ S, ell h w.2 ≠ 0) (i : Fin 6) : |
| 978 | ContDiffOn ℝ n (fun v : ℝ × ℂ => sourceField h C F v.1 v.2 i) S := |
| 979 | fun w hw => (sourceField_contDiffAt (hF w hw) (hL w hw) i).contDiffWithinAt |
| 980 | |
| 981 | end ComplexCoefficients |
| 982 | |
| 983 | |
| 984 | section RealOutput |
| 985 | |
| 986 | open VolterraAnalyticBounds |
| 987 | |
| 988 | noncomputable def complexJet (j : Jet ℝ) : Jet ℂ := |
| 989 | ⟨j.value, j.radial, j.radial2, j.parameter⟩ |
| 990 | |
| 991 | noncomputable def complexBase (b : BaseJet ℝ) : BaseJet ℂ := |
| 992 | ⟨complexJet b.phi, complexJet b.axial, b.beta⟩ |
| 993 | |
| 994 | noncomputable def complexSource (s : SourceJet ℝ) : SourceJet ℂ := |
| 995 | ⟨s.angular, s.axial, s.pressureProduct, s.omegaQuotient⟩ |
| 996 | |
| 997 | theorem A0_ofReal (h lam C r eta : ℝ) (b : BaseJet ℝ) : |
| 998 | A0 (h : ℂ) (lam : ℂ) (C : ℂ) (r : ℂ) (eta : ℂ) (complexBase b) = |
| 999 | (A0 h lam C r eta b).map Complex.ofReal := by |
| 1000 | -- Normalize casts once before splitting into the 36 matrix entries. |
| 1001 | simp only [A0, complexBase, complexJet, angularPower, axialPower, |
| 1002 | axialValue, inverseSquare, a, dScale, ell, edge, |
| 1003 | ← Complex.ofReal_zero, ← Complex.ofReal_one, ← Complex.ofReal_ofNat, |
| 1004 | ← Complex.ofReal_add, ← Complex.ofReal_sub, ← Complex.ofReal_mul, |
| 1005 | ← Complex.ofReal_div, ← Complex.ofReal_neg, ← Complex.ofReal_pow, |
| 1006 | ← Complex.ofReal_inv] |
| 1007 | apply Matrix.ext |
| 1008 | intro i j |
| 1009 | fin_cases i <;> fin_cases j <;> rfl |
| 1010 | |
| 1011 | theorem A1_ofReal (h r eta : ℝ) (b : BaseJet ℝ) : |
| 1012 | A1 (h : ℂ) (r : ℂ) (eta : ℂ) (complexBase b) = |
| 1013 | (A1 h r eta b).map Complex.ofReal := by |
| 1014 | ext i j |
| 1015 | fin_cases i <;> fin_cases j <;> |
| 1016 | simp [A1, complexBase, complexJet, Matrix.map, dScale, ell, edge] |
| 1017 | |
| 1018 | theorem forcing_ofReal (h C r eta : ℝ) (s : SourceJet ℝ) : |
| 1019 | forcing (h : ℂ) (C : ℂ) (r : ℂ) (eta : ℂ) (complexSource s) = |
| 1020 | fun i => ((forcing h C r eta s i : ℝ) : ℂ) := by |
| 1021 | ext i |
| 1022 | fin_cases i <;> |
| 1023 | simp [forcing, complexSource, pressureSource, inverseSquare, ell] |
| 1024 | |
| 1025 | theorem diagonal_ofReal (i : Fin 6) : |
| 1026 | (diagonal i : ℂ) = ((diagonal i : ℝ) : ℂ) := by |
| 1027 | fin_cases i <;> norm_num [diagonal] |
| 1028 | |
| 1029 | /-- Taking real parts commutes with the explicit system at real input jets. -/ |
| 1030 | theorem matrixRHS_realPart (h lam C r eta : ℝ) (b : BaseJet ℝ) (s : SourceJet ℝ) |
| 1031 | (w v : Vec) (i : Fin 6) : |
| 1032 | (matrixRHS (h : ℂ) (lam : ℂ) (C : ℂ) (r : ℂ) (eta : ℂ) |
| 1033 | (complexBase b) (complexSource s) w v i).re = |
| 1034 | matrixRHS h lam C r eta b s (fun j => (w j).re) (fun j => (v j).re) i := by |
| 1035 | simp only [matrixRHS, A0_ofReal, A1_ofReal, forcing_ofReal, Pi.add_apply, Complex.add_re] |
| 1036 | simp [Matrix.mulVec, dotProduct, Matrix.map, Complex.mul_re] |
| 1037 | |
| 1038 | noncomputable def realTrace (W : Field) (r eta : ℝ) (i : Fin 6) : ℝ := |
| 1039 | (W r (eta : ℂ) i).re |
| 1040 | |
| 1041 | /-- A complex solution with real coefficients yields a real solution by |
| 1042 | componentwise real part. Both radial and parameter derivatives in the result |
| 1043 | are actual real derivatives; no reality of the chosen complex solution is assumed. -/ |
| 1044 | theorem realTrace_solves_system (h lam C r eta : ℝ) (b : BaseJet ℝ) (s : SourceJet ℝ) |
| 1045 | (W : Field) |
| 1046 | (hr : ∀ i, DifferentiableAt ℝ (fun q => W q (eta : ℂ) i) r) |
| 1047 | (hz : ∀ i, DifferentiableAt ℂ (fun z => W r z i) (eta : ℂ)) |
| 1048 | (hW : ∀ i, deriv (fun q => W q (eta : ℂ) i) r + |
| 1049 | (diagonal i : ℂ) / (r : ℂ) * W r (eta : ℂ) i = |
| 1050 | matrixRHS (h : ℂ) (lam : ℂ) (C : ℂ) (r : ℂ) (eta : ℂ) |
| 1051 | (complexBase b) (complexSource s) (W r (eta : ℂ)) |
| 1052 | (fun j => deriv (fun z => W r z j) (eta : ℂ)) i) : |
| 1053 | ∀ i, deriv (fun q => realTrace W q eta i) r + |
| 1054 | (diagonal i : ℝ) / r * realTrace W r eta i = |
| 1055 | matrixRHS h lam C r eta b s (realTrace W r eta) |
| 1056 | (fun j => deriv (fun z => realTrace W r z j) eta) i := by |
| 1057 | have hrd (i : Fin 6) : deriv (fun q => realTrace W q eta i) r = |
| 1058 | (deriv (fun q => W q (eta : ℂ) i) r).re := by |
| 1059 | exact (Complex.reCLM.hasFDerivAt.comp_hasDerivAt r (hr i).hasDerivAt).deriv |
| 1060 | have hzd (i : Fin 6) : deriv (fun z => realTrace W r z i) eta = |
| 1061 | (deriv (fun z => W r z i) (eta : ℂ)).re := |
| 1062 | (hz i).hasDerivAt.real_of_complex.deriv |
| 1063 | intro i |
| 1064 | have he := congrArg Complex.re (hW i) |
| 1065 | have hc : (diagonal i : ℂ) / (r : ℂ) = (((diagonal i : ℝ) / r : ℝ) : ℂ) := by |
| 1066 | rw [diagonal_ofReal, Complex.ofReal_div] |
| 1067 | rw [Complex.add_re, hc, Complex.mul_re, matrixRHS_realPart] at he |
| 1068 | rw [hrd i] |
| 1069 | simp_rw [hzd] |
| 1070 | simp only [Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] at he |
| 1071 | exact he |
| 1072 | |
| 1073 | end RealOutput |
| 1074 | |
| 1075 | end NavierStokes.PositiveAxisSystem |