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.AxisymmetricResidual |
| 2 | import NavierStokes.SimilarityProfile |
| 3 | import NavierStokes.RadialFluxResidual |
| 4 | import NavierStokes.LocalAxisymmetricResidual |
| 5 | import Mathlib.Algebra.BigOperators.NatAntidiagonal |
| 6 | import Mathlib.Analysis.SpecialFunctions.Pow.Real |
| 7 | |
| 8 | /-! |
| 9 | # Finite slow expansions and their physical residuals |
| 10 | |
| 11 | Finite products are expanded exactly. Terms above the retained slow order and |
| 12 | the last axial-viscosity term are displayed as explicit finite remainders. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | namespace NavierStokes.SlowExpansionResidual |
| 18 | |
| 19 | open AxisymmetricFields |
| 20 | open SimilarityProfile (InnerProfile InnerPoint pullback partialX T Z) |
| 21 | open scoped BigOperators Topology ContDiff |
| 22 | |
| 23 | /-- The manuscript's slow order `λ_n=2nh`. -/ |
| 24 | def slowOrder (h : ℝ) (n : ℕ) : ℝ := 2 * (n : ℝ) * h |
| 25 | |
| 26 | @[simp] theorem slowOrder_zero (h : ℝ) : slowOrder h 0 = 0 := by simp [slowOrder] |
| 27 | theorem slowOrder_add (h : ℝ) (i j : ℕ) : |
| 28 | slowOrder h (i + j) = slowOrder h i + slowOrder h j := by |
| 29 | simp [slowOrder, Nat.cast_add] |
| 30 | ring |
| 31 | theorem slowOrder_succ (h : ℝ) (n : ℕ) : |
| 32 | slowOrder h (n + 1) = slowOrder h n + 2 * h := by |
| 33 | simp [slowOrder, Nat.cast_add] |
| 34 | ring |
| 35 | |
| 36 | def finiteSeries (N : ℕ) (q h b : ℝ) (a : ℕ → ℝ) : ℝ := |
| 37 | ∑ n ∈ Finset.range (N + 1), q ^ (b + slowOrder h n) * a n |
| 38 | |
| 39 | noncomputable def pairs (N : ℕ) : Finset (ℕ × ℕ) := |
| 40 | Finset.range (N + 1) ×ˢ Finset.range (N + 1) |
| 41 | |
| 42 | def convolution (K : ℕ → ℕ → ℝ) (n : ℕ) : ℝ := |
| 43 | ∑ ij ∈ Finset.antidiagonal n, K ij.1 ij.2 |
| 44 | |
| 45 | def finiteConvolution (N : ℕ) (K : ℕ → ℕ → ℝ) (n : ℕ) : ℝ := |
| 46 | ∑ ij ∈ (pairs N).filter (fun ij => ij.1 + ij.2 = n), K ij.1 ij.2 |
| 47 | |
| 48 | def pairTail (N : ℕ) (w : ℕ → ℝ) (K : ℕ → ℕ → ℝ) : ℝ := |
| 49 | ∑ ij ∈ (pairs N).filter (fun ij => N < ij.1 + ij.2), w (ij.1 + ij.2) * K ij.1 ij.2 |
| 50 | |
| 51 | noncomputable def previous (a : ℕ → ℝ) : ℕ → ℝ |
| 52 | | 0 => 0 |
| 53 | | n + 1 => a n |
| 54 | |
| 55 | @[simp] theorem previous_zero (a : ℕ → ℝ) : previous a 0 = 0 := rfl |
| 56 | @[simp] theorem previous_succ (a : ℕ → ℝ) (n : ℕ) : previous a (n + 1) = a n := rfl |
| 57 | |
| 58 | @[simp] theorem finiteSeries_order_zero (q h b : ℝ) (a : ℕ → ℝ) : |
| 59 | finiteSeries 0 q h b a = q ^ b * a 0 := by simp [finiteSeries] |
| 60 | |
| 61 | @[simp] theorem pairTail_order_zero (w : ℕ → ℝ) (K : ℕ → ℕ → ℝ) : |
| 62 | pairTail 0 w K = 0 := by |
| 63 | simp [pairTail, pairs, Finset.sum_filter] |
| 64 | |
| 65 | theorem finiteConvolution_eq {N n : ℕ} (hn : n ≤ N) (K : ℕ → ℕ → ℝ) : |
| 66 | finiteConvolution N K n = convolution K n := by |
| 67 | have hs : (pairs N).filter (fun ij => ij.1 + ij.2 = n) = Finset.antidiagonal n := by |
| 68 | ext ij |
| 69 | simp only [Finset.mem_filter, pairs, Finset.mem_product, Finset.mem_range, |
| 70 | Finset.mem_antidiagonal] |
| 71 | omega |
| 72 | unfold finiteConvolution convolution |
| 73 | rw [hs] |
| 74 | |
| 75 | theorem rpow_product_order {q : ℝ} (hq : 0 < q) (h b c : ℝ) (i j : ℕ) : |
| 76 | q ^ (b + slowOrder h i) * q ^ (c + slowOrder h j) = |
| 77 | q ^ (b + c + slowOrder h (i + j)) := by |
| 78 | rw [← Real.rpow_add hq, slowOrder_add] |
| 79 | congr 1 |
| 80 | ring |
| 81 | |
| 82 | /-- Exact Cauchy product of two finite slow expansions. -/ |
| 83 | theorem finiteSeries_mul {q : ℝ} (hq : 0 < q) (N : ℕ) (h b c : ℝ) (a d : ℕ → ℝ) : |
| 84 | finiteSeries N q h b a * finiteSeries N q h c d = |
| 85 | ∑ ij ∈ pairs N, q ^ (b + c + slowOrder h (ij.1 + ij.2)) * (a ij.1 * d ij.2) := by |
| 86 | unfold finiteSeries pairs |
| 87 | rw [Finset.sum_mul_sum, Finset.sum_product] |
| 88 | apply Finset.sum_congr rfl |
| 89 | intro i hi |
| 90 | apply Finset.sum_congr rfl |
| 91 | intro j hj |
| 92 | calc |
| 93 | _ = (q ^ (b + slowOrder h i) * q ^ (c + slowOrder h j)) * (a i * d j) := by ring |
| 94 | _ = _ := by rw [rpow_product_order hq] |
| 95 | |
| 96 | theorem finiteSeries_add (N : ℕ) (q h b : ℝ) (a d : ℕ → ℝ) : |
| 97 | finiteSeries N q h b (fun n => a n + d n) = |
| 98 | finiteSeries N q h b a + finiteSeries N q h b d := by |
| 99 | simp [finiteSeries, mul_add, Finset.sum_add_distrib] |
| 100 | |
| 101 | theorem finiteSeries_scale (N : ℕ) (q h b c : ℝ) (a : ℕ → ℝ) : |
| 102 | finiteSeries N q h b (fun n => c * a n) = c * finiteSeries N q h b a := by |
| 103 | unfold finiteSeries |
| 104 | rw [Finset.mul_sum] |
| 105 | apply Finset.sum_congr rfl |
| 106 | intro n hn |
| 107 | ring |
| 108 | |
| 109 | theorem finiteSeries_mul_q {q : ℝ} (hq : 0 < q) (N : ℕ) (h b : ℝ) (a : ℕ → ℝ) : |
| 110 | q * finiteSeries N q h b a = finiteSeries N q h (b + 1) a := by |
| 111 | unfold finiteSeries |
| 112 | rw [Finset.mul_sum] |
| 113 | apply Finset.sum_congr rfl |
| 114 | intro n hn |
| 115 | have hp : q * q ^ (b + slowOrder h n) = q ^ (b + 1 + slowOrder h n) := by |
| 116 | conv_lhs => lhs; rw [← Real.rpow_one q] |
| 117 | rw [← Real.rpow_add hq] |
| 118 | congr 1 |
| 119 | ring |
| 120 | rw [← mul_assoc, hp] |
| 121 | |
| 122 | theorem finiteSeries_div_qX {q X : ℝ} (hq : 0 < q) (hX : X ≠ 0) |
| 123 | (N : ℕ) (h b : ℝ) (a : ℕ → ℝ) : |
| 124 | finiteSeries N q h b a / (q * X) = |
| 125 | finiteSeries N q h (b - 1) (fun n => a n / X) := by |
| 126 | unfold finiteSeries |
| 127 | rw [Finset.sum_div] |
| 128 | apply Finset.sum_congr rfl |
| 129 | intro n hn |
| 130 | rw [show b - 1 + slowOrder h n = b + slowOrder h n - 1 by ring, |
| 131 | Real.rpow_sub_one hq.ne'] |
| 132 | field_simp |
| 133 | |
| 134 | theorem radialDiffusion_series {q : ℝ} (hq : 0 < q) (N : ℕ) |
| 135 | (h b X m : ℝ) (a d : ℕ → ℝ) : |
| 136 | 2 * (q * X) * finiteSeries N q h (b - 2) d + |
| 137 | 2 * m * finiteSeries N q h (b - 1) a = |
| 138 | finiteSeries N q h (b - 1) (fun n => 2 * (X * d n + m * a n)) := by |
| 139 | have hp := finiteSeries_mul_q hq N h (b - 2) d |
| 140 | rw [show b - 2 + 1 = b - 1 by ring] at hp |
| 141 | calc |
| 142 | _ = 2 * X * (q * finiteSeries N q h (b - 2) d) + |
| 143 | 2 * m * finiteSeries N q h (b - 1) a := by ring |
| 144 | _ = 2 * X * finiteSeries N q h (b - 1) d + |
| 145 | 2 * m * finiteSeries N q h (b - 1) a := by rw [hp] |
| 146 | _ = _ := by |
| 147 | rw [← finiteSeries_scale, ← finiteSeries_scale, ← finiteSeries_add] |
| 148 | congr 1 |
| 149 | funext n |
| 150 | ring |
| 151 | |
| 152 | theorem axialViscosity_shift (N : ℕ) (q h b : ℝ) (a : ℕ → ℝ) : |
| 153 | finiteSeries N q h (b - 2 * CoordinateAlgebra.D h) a = |
| 154 | ∑ n ∈ Finset.range (N + 1), q ^ (b - 1 + slowOrder h (n + 1)) * a n := by |
| 155 | unfold finiteSeries |
| 156 | apply Finset.sum_congr rfl |
| 157 | intro n hn |
| 158 | rw [slowOrder_succ] |
| 159 | congr 2 |
| 160 | unfold CoordinateAlgebra.D |
| 161 | ring |
| 162 | |
| 163 | theorem pair_sum_low (N : ℕ) (w : ℕ → ℝ) (K : ℕ → ℕ → ℝ) : |
| 164 | (∑ n ∈ Finset.range (N + 1), w n * finiteConvolution N K n) = |
| 165 | ∑ ij ∈ (pairs N).filter (fun ij => ij.1 + ij.2 ≤ N), |
| 166 | w (ij.1 + ij.2) * K ij.1 ij.2 := by |
| 167 | unfold finiteConvolution |
| 168 | simp_rw [Finset.mul_sum] |
| 169 | calc |
| 170 | _ = ∑ n ∈ Finset.range (N + 1), |
| 171 | ∑ ij ∈ (pairs N).filter (fun ij => ij.1 + ij.2 = n), |
| 172 | w (ij.1 + ij.2) * K ij.1 ij.2 := by |
| 173 | apply Finset.sum_congr rfl |
| 174 | intro n hn |
| 175 | apply Finset.sum_congr rfl |
| 176 | intro ij hij |
| 177 | rw [(Finset.mem_filter.mp hij).2] |
| 178 | _ = _ := by |
| 179 | rw [Finset.sum_fiberwise_eq_sum_filter] |
| 180 | simp only [Finset.mem_range, Nat.lt_succ_iff] |
| 181 | |
| 182 | /-- Low convolution coefficients and the exact omitted pair interactions. -/ |
| 183 | theorem pair_sum_split (N : ℕ) (w : ℕ → ℝ) (K : ℕ → ℕ → ℝ) : |
| 184 | (∑ ij ∈ pairs N, w (ij.1 + ij.2) * K ij.1 ij.2) = |
| 185 | (∑ n ∈ Finset.range (N + 1), w n * convolution K n) + pairTail N w K := by |
| 186 | have hlo : (∑ n ∈ Finset.range (N + 1), w n * convolution K n) = |
| 187 | ∑ n ∈ Finset.range (N + 1), w n * finiteConvolution N K n := by |
| 188 | apply Finset.sum_congr rfl |
| 189 | intro n hn |
| 190 | rw [finiteConvolution_eq (by have := Finset.mem_range.mp hn; omega)] |
| 191 | rw [hlo, pair_sum_low] |
| 192 | unfold pairTail |
| 193 | simpa only [not_le] using |
| 194 | (Finset.sum_filter_add_sum_filter_not (pairs N) (fun ij => ij.1 + ij.2 ≤ N) |
| 195 | (fun ij => w (ij.1 + ij.2) * K ij.1 ij.2)).symm |
| 196 | |
| 197 | /-- An axial derivative raises slow order by one. The last term is retained |
| 198 | here as a literal remainder rather than silently discarded. -/ |
| 199 | theorem shifted_sum (N : ℕ) (w a : ℕ → ℝ) : |
| 200 | (∑ n ∈ Finset.range (N + 1), w (n + 1) * a n) = |
| 201 | (∑ n ∈ Finset.range (N + 1), w n * previous a n) + w (N + 1) * a N := by |
| 202 | induction N with |
| 203 | | zero => simp |
| 204 | | succ N ih => |
| 205 | simp only [Finset.sum_range_succ, previous_succ] at ih ⊢ |
| 206 | linarith |
| 207 | |
| 208 | def recurrence (L : ℕ → ℝ) (K : ℕ → ℕ → ℝ) (A : ℕ → ℝ) (n : ℕ) : ℝ := |
| 209 | L n + convolution K n - previous A n |
| 210 | |
| 211 | /-- Universal finite-order recurrence identity used by the angular, axial, |
| 212 | and radial-flux equations. -/ |
| 213 | theorem recurrence_truncation (N : ℕ) (w L A : ℕ → ℝ) (K : ℕ → ℕ → ℝ) : |
| 214 | (∑ n ∈ Finset.range (N + 1), w n * L n) + |
| 215 | (∑ ij ∈ pairs N, w (ij.1 + ij.2) * K ij.1 ij.2) - |
| 216 | (∑ n ∈ Finset.range (N + 1), w (n + 1) * A n) = |
| 217 | (∑ n ∈ Finset.range (N + 1), w n * recurrence L K A n) + |
| 218 | pairTail N w K - w (N + 1) * A N := by |
| 219 | rw [pair_sum_split, shifted_sum] |
| 220 | simp only [recurrence, mul_sub, mul_add, Finset.sum_sub_distrib, Finset.sum_add_distrib] |
| 221 | ring |
| 222 | |
| 223 | /-- If the retained coefficient equations hold, the physical finite |
| 224 | expansion still has these explicit omitted interactions and viscosity term. -/ |
| 225 | theorem recurrence_truncation_of_zero (N : ℕ) (w L A : ℕ → ℝ) (K : ℕ → ℕ → ℝ) |
| 226 | (hzero : ∀ n ≤ N, recurrence L K A n = 0) : |
| 227 | (∑ n ∈ Finset.range (N + 1), w n * L n) + |
| 228 | (∑ ij ∈ pairs N, w (ij.1 + ij.2) * K ij.1 ij.2) - |
| 229 | (∑ n ∈ Finset.range (N + 1), w (n + 1) * A n) = |
| 230 | pairTail N w K - w (N + 1) * A N := by |
| 231 | rw [recurrence_truncation] |
| 232 | have hs : (∑ n ∈ Finset.range (N + 1), w n * recurrence L K A n) = 0 := by |
| 233 | apply Finset.sum_eq_zero |
| 234 | intro n hn |
| 235 | rw [hzero n (by have := Finset.mem_range.mp hn; omega), mul_zero] |
| 236 | rw [hs, zero_add] |
| 237 | |
| 238 | def transportLinear (X m : ℝ) (gt gx gxx source : ℕ → ℝ) (n : ℕ) : ℝ := |
| 239 | gt n - 2 * (X * gxx n + m * gx n) + source n |
| 240 | |
| 241 | def transportPair (X α : ℝ) (v u g gx gz : ℕ → ℝ) (i j : ℕ) : ℝ := |
| 242 | v i * (gx j + α * g j / X) + u i * gz j |
| 243 | |
| 244 | /-- Scalar transport/diffusion for arbitrary finite jets, with all product |
| 245 | orders and the final shifted viscosity displayed exactly. -/ |
| 246 | theorem transport_series_identity {q X : ℝ} (hq : 0 < q) (hX : X ≠ 0) |
| 247 | (N : ℕ) (h e α m : ℝ) (v u g gt gx gxx gz gzz source : ℕ → ℝ) : |
| 248 | finiteSeries N q h (e - 1) gt + |
| 249 | finiteSeries N q h 0 v * (finiteSeries N q h (e - 1) gx + |
| 250 | α * (finiteSeries N q h e g / (q * X))) + |
| 251 | finiteSeries N q h (-CoordinateAlgebra.A h) u * |
| 252 | finiteSeries N q h (e - CoordinateAlgebra.D h) gz - |
| 253 | (2 * (q * X) * finiteSeries N q h (e - 2) gxx + |
| 254 | 2 * m * finiteSeries N q h (e - 1) gx + |
| 255 | finiteSeries N q h (e - 2 * CoordinateAlgebra.D h) gzz) + |
| 256 | finiteSeries N q h (e - 1) source = |
| 257 | finiteSeries N q h (e - 1) |
| 258 | (recurrence (transportLinear X m gt gx gxx source) (transportPair X α v u g gx gz) gzz) + |
| 259 | pairTail N (fun n => q ^ (e - 1 + slowOrder h n)) (transportPair X α v u g gx gz) - |
| 260 | q ^ (e - 1 + slowOrder h (N + 1)) * gzz N := by |
| 261 | have hradial : finiteSeries N q h (e - 1) gx + |
| 262 | α * (finiteSeries N q h e g / (q * X)) = |
| 263 | finiteSeries N q h (e - 1) (fun n => gx n + α * g n / X) := by |
| 264 | rw [finiteSeries_div_qX hq hX, |
| 265 | ← finiteSeries_scale N q h (e - 1) α (fun n => g n / X), ← finiteSeries_add] |
| 266 | congr 1 |
| 267 | funext n |
| 268 | ring |
| 269 | have hv := finiteSeries_mul hq N h 0 (e - 1) v (fun n => gx n + α * g n / X) |
| 270 | simp only [zero_add] at hv |
| 271 | have hu := finiteSeries_mul hq N h (-CoordinateAlgebra.A h) |
| 272 | (e - CoordinateAlgebra.D h) u gz |
| 273 | rw [show -CoordinateAlgebra.A h + (e - CoordinateAlgebra.D h) = e - 1 by |
| 274 | unfold CoordinateAlgebra.A CoordinateAlgebra.D; ring] at hu |
| 275 | rw [hradial, hv, hu, radialDiffusion_series hq, axialViscosity_shift] |
| 276 | change _ = (∑ n ∈ Finset.range (N + 1), |
| 277 | q ^ (e - 1 + slowOrder h n) * |
| 278 | recurrence (transportLinear X m gt gx gxx source) (transportPair X α v u g gx gz) gzz n) + _ - _ |
| 279 | rw [← recurrence_truncation] |
| 280 | simp only [finiteSeries, transportLinear, transportPair, mul_add, mul_sub, |
| 281 | Finset.sum_add_distrib, Finset.sum_sub_distrib] |
| 282 | ring |
| 283 | |
| 284 | /-- Ordinary directional derivative on physical profile space. -/ |
| 285 | def derivativeAlong (v : ProfilePoint) (f : Profile) (p : ProfilePoint) : ℝ := |
| 286 | fderiv ℝ f p v |
| 287 | |
| 288 | theorem derivativeAlong_sum {ι : Type*} (s : Finset ι) (f : ι → Profile) |
| 289 | (v p : ProfilePoint) (hf : ∀ i ∈ s, DifferentiableAt ℝ (f i) p) : |
| 290 | derivativeAlong v (fun y => ∑ i ∈ s, f i y) p = |
| 291 | ∑ i ∈ s, derivativeAlong v (f i) p := by |
| 292 | unfold derivativeAlong |
| 293 | rw [fderiv_fun_sum hf, _root_.sum_apply] |
| 294 | |
| 295 | /-- Finite sums commute with actual second derivatives under C² regularity. -/ |
| 296 | theorem secondAlong_sum {ι : Type*} (s : Finset ι) (f : ι → Profile) |
| 297 | (v w p : ProfilePoint) (hf : ∀ i ∈ s, ContDiffAt ℝ 2 (f i) p) : |
| 298 | derivativeAlong w (derivativeAlong v (fun y => ∑ i ∈ s, f i y)) p = |
| 299 | ∑ i ∈ s, derivativeAlong w (derivativeAlong v (f i)) p := by |
| 300 | have hev : ∀ᶠ y in nhds p, ∀ i ∈ s, DifferentiableAt ℝ (f i) y := by |
| 301 | rw [Finset.eventually_all] |
| 302 | intro i hi |
| 303 | exact ((hf i hi).eventually (by simp)).mono fun y hy => hy.differentiableAt (by norm_num) |
| 304 | have he : derivativeAlong v (fun y => ∑ i ∈ s, f i y) =ᶠ[nhds p] |
| 305 | (fun y => ∑ i ∈ s, derivativeAlong v (f i) y) := by |
| 306 | filter_upwards [hev] with y hy |
| 307 | exact derivativeAlong_sum s f v y hy |
| 308 | change fderiv ℝ _ p w = _ |
| 309 | rw [he.fderiv_eq] |
| 310 | exact derivativeAlong_sum s (fun i => derivativeAlong v (f i)) w p |
| 311 | (fun i hi => (((hf i hi).fderiv_right (m := 1) (by norm_num)).clm_apply |
| 312 | contDiffAt_const).differentiableAt (by norm_num)) |
| 313 | |
| 314 | def finiteProfile (N : ℕ) (h b : ℝ) (f : ℕ → InnerProfile) : Profile := |
| 315 | fun p => ∑ n ∈ Finset.range (N + 1), pullback h (b + slowOrder h n) (f n) p |
| 316 | |
| 317 | @[simp] theorem finiteProfile_order_zero (h b : ℝ) (f : ℕ → InnerProfile) : |
| 318 | finiteProfile 0 h b f = pullback h b (f 0) := by |
| 319 | funext p |
| 320 | simp [finiteProfile] |
| 321 | |
| 322 | theorem finiteProfile_value (N : ℕ) (h b : ℝ) (f : ℕ → InnerProfile) (p : ProfilePoint) : |
| 323 | finiteProfile N h b f p = finiteSeries N (SimilarityProfile.q h p) h b |
| 324 | (fun n => f n (SimilarityProfile.inner h p)) := rfl |
| 325 | |
| 326 | theorem partialT_finiteProfile {h b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 327 | (N : ℕ) (f : ℕ → InnerProfile) {p : ProfilePoint} (hp : p.1 < 1) |
| 328 | (hf : ∀ n ≤ N, DifferentiableAt ℝ (f n) (SimilarityProfile.inner h p)) : |
| 329 | AxisymmetricResidual.partialT (finiteProfile N h b f) p = |
| 330 | finiteProfile N h (b - 1) (fun n => T h (b + slowOrder h n) (f n)) p := by |
| 331 | unfold finiteProfile |
| 332 | change derivativeAlong (1, (0, 0)) _ p = _ |
| 333 | rw [derivativeAlong_sum _ _ _ _ (fun n hn => SimilarityProfile.pullback_differentiableAt |
| 334 | hh hh1 hp (hf n (by have := Finset.mem_range.mp hn; omega)))] |
| 335 | apply Finset.sum_congr rfl |
| 336 | intro n hn |
| 337 | change SimilarityProfile.partialT _ p = _ |
| 338 | rw [SimilarityProfile.partialT_pullback hh hh1 hp |
| 339 | (hf n (by have := Finset.mem_range.mp hn; omega))] |
| 340 | rw [show b + slowOrder h n - 1 = b - 1 + slowOrder h n by ring] |
| 341 | |
| 342 | theorem partialS_finiteProfile {h b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 343 | (N : ℕ) (f : ℕ → InnerProfile) {p : ProfilePoint} (hp : p.1 < 1) |
| 344 | (hf : ∀ n ≤ N, DifferentiableAt ℝ (f n) (SimilarityProfile.inner h p)) : |
| 345 | partialS (finiteProfile N h b f) p = |
| 346 | finiteProfile N h (b - 1) (fun n => partialX (f n)) p := by |
| 347 | unfold finiteProfile |
| 348 | change derivativeAlong (0, (1, 0)) _ p = _ |
| 349 | rw [derivativeAlong_sum _ _ _ _ (fun n hn => SimilarityProfile.pullback_differentiableAt |
| 350 | hh hh1 hp (hf n (by have := Finset.mem_range.mp hn; omega)))] |
| 351 | apply Finset.sum_congr rfl |
| 352 | intro n hn |
| 353 | change SimilarityProfile.partialS _ p = _ |
| 354 | rw [SimilarityProfile.partialS_pullback hh hh1 hp |
| 355 | (hf n (by have := Finset.mem_range.mp hn; omega))] |
| 356 | rw [show b + slowOrder h n - 1 = b - 1 + slowOrder h n by ring] |
| 357 | |
| 358 | theorem partialZ_finiteProfile {h b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 359 | (N : ℕ) (f : ℕ → InnerProfile) {p : ProfilePoint} (hp : p.1 < 1) |
| 360 | (hf : ∀ n ≤ N, DifferentiableAt ℝ (f n) (SimilarityProfile.inner h p)) : |
| 361 | partialZ (finiteProfile N h b f) p = |
| 362 | finiteProfile N h (b - CoordinateAlgebra.D h) |
| 363 | (fun n => Z h (b + slowOrder h n) (f n)) p := by |
| 364 | unfold finiteProfile |
| 365 | change derivativeAlong (0, (0, 1)) _ p = _ |
| 366 | rw [derivativeAlong_sum _ _ _ _ (fun n hn => SimilarityProfile.pullback_differentiableAt |
| 367 | hh hh1 hp (hf n (by have := Finset.mem_range.mp hn; omega)))] |
| 368 | apply Finset.sum_congr rfl |
| 369 | intro n hn |
| 370 | change SimilarityProfile.partialZ _ p = _ |
| 371 | rw [SimilarityProfile.partialZ_pullback hh hh1 hp |
| 372 | (hf n (by have := Finset.mem_range.mp hn; omega))] |
| 373 | rw [show b + slowOrder h n - CoordinateAlgebra.D h = |
| 374 | b - CoordinateAlgebra.D h + slowOrder h n by ring] |
| 375 | |
| 376 | def Z2 (h b : ℝ) (f : InnerProfile) : InnerProfile := |
| 377 | Z h (b - CoordinateAlgebra.D h) (Z h b f) |
| 378 | |
| 379 | theorem partialSS_finiteProfile {h b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 380 | (N : ℕ) (f : ℕ → InnerProfile) {p : ProfilePoint} (hp : p.1 < 1) |
| 381 | (hf : ∀ n ≤ N, ContDiffAt ℝ 2 (f n) (SimilarityProfile.inner h p)) : |
| 382 | partialS (partialS (finiteProfile N h b f)) p = |
| 383 | finiteProfile N h (b - 2) (fun n => partialX (partialX (f n))) p := by |
| 384 | unfold finiteProfile |
| 385 | change derivativeAlong (0, (1, 0)) (derivativeAlong (0, (1, 0)) _) p = _ |
| 386 | rw [secondAlong_sum _ _ _ _ _ (fun n hn => SimilarityProfile.pullback_smoothAt |
| 387 | hh hh1 hp (hf n (by have := Finset.mem_range.mp hn; omega)))] |
| 388 | apply Finset.sum_congr rfl |
| 389 | intro n hn |
| 390 | change SimilarityProfile.partialS (SimilarityProfile.partialS _) p = _ |
| 391 | rw [SimilarityProfile.partialS_partialS_pullback hh hh1 hp |
| 392 | (hf n (by have := Finset.mem_range.mp hn; omega))] |
| 393 | rw [show b + slowOrder h n - 2 = b - 2 + slowOrder h n by ring] |
| 394 | |
| 395 | theorem partialZZ_finiteProfile {h b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 396 | (N : ℕ) (f : ℕ → InnerProfile) {p : ProfilePoint} (hp : p.1 < 1) |
| 397 | (hf : ∀ n ≤ N, ContDiffAt ℝ 2 (f n) (SimilarityProfile.inner h p)) : |
| 398 | partialZ (partialZ (finiteProfile N h b f)) p = |
| 399 | finiteProfile N h (b - 2 * CoordinateAlgebra.D h) |
| 400 | (fun n => Z2 h (b + slowOrder h n) (f n)) p := by |
| 401 | unfold finiteProfile |
| 402 | change derivativeAlong (0, (0, 1)) (derivativeAlong (0, (0, 1)) _) p = _ |
| 403 | rw [secondAlong_sum _ _ _ _ _ (fun n hn => SimilarityProfile.pullback_smoothAt |
| 404 | hh hh1 hp (hf n (by have := Finset.mem_range.mp hn; omega)))] |
| 405 | apply Finset.sum_congr rfl |
| 406 | intro n hn |
| 407 | change SimilarityProfile.partialZ (SimilarityProfile.partialZ _) p = _ |
| 408 | rw [SimilarityProfile.partialZ_partialZ_pullback hh hh1 hp |
| 409 | (hf n (by have := Finset.mem_range.mp hn; omega))] |
| 410 | rw [show b + slowOrder h n - 2 * CoordinateAlgebra.D h = |
| 411 | b - 2 * CoordinateAlgebra.D h + slowOrder h n by ring] |
| 412 | rfl |
| 413 | |
| 414 | def transportResidual (α m : ℝ) (V U G source : Profile) (p : ProfilePoint) : ℝ := |
| 415 | AxisymmetricResidual.partialT G p + V p * (partialS G p + α * (G p / p.2.1)) + |
| 416 | U p * partialZ G p - |
| 417 | (2 * p.2.1 * partialS (partialS G) p + 2 * m * partialS G p + partialZ (partialZ G) p) + |
| 418 | source p |
| 419 | |
| 420 | def transportCoefficient (h e α m : ℝ) (v u f source : ℕ → InnerProfile) |
| 421 | (n : ℕ) (w : InnerPoint) : ℝ := |
| 422 | recurrence |
| 423 | (transportLinear w.1 m (fun j => T h (e + slowOrder h j) (f j) w) |
| 424 | (fun j => partialX (f j) w) (fun j => partialX (partialX (f j)) w) (fun j => source j w)) |
| 425 | (transportPair w.1 α (fun j => v j w) (fun j => u j w) (fun j => f j w) |
| 426 | (fun j => partialX (f j) w) (fun j => Z h (e + slowOrder h j) (f j) w)) |
| 427 | (fun j => Z2 h (e + slowOrder h j) (f j) w) n |
| 428 | |
| 429 | def transportTail (N : ℕ) (q h e α : ℝ) (v u f : ℕ → InnerProfile) (w : InnerPoint) : ℝ := |
| 430 | pairTail N (fun n => q ^ (e - 1 + slowOrder h n)) |
| 431 | (transportPair w.1 α (fun j => v j w) (fun j => u j w) (fun j => f j w) |
| 432 | (fun j => partialX (f j) w) (fun j => Z h (e + slowOrder h j) (f j) w)) - |
| 433 | q ^ (e - 1 + slowOrder h (N + 1)) * Z2 h (e + slowOrder h N) (f N) w |
| 434 | |
| 435 | @[simp] theorem transportTail_order_zero (q h e α : ℝ) |
| 436 | (v u f : ℕ → InnerProfile) (w : InnerPoint) : |
| 437 | transportTail 0 q h e α v u f w = |
| 438 | -q ^ (e - 1 + 2 * h) * Z2 h e (f 0) w := by |
| 439 | simp [transportTail, slowOrder_succ] |
| 440 | |
| 441 | theorem q_mul_X {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 442 | {p : ProfilePoint} (hp : p.1 < 1) : |
| 443 | SimilarityProfile.q h p * (SimilarityProfile.inner h p).1 = p.2.1 := by |
| 444 | simp only [SimilarityProfile.inner, SimilarityProfile.X] |
| 445 | field_simp [(SimilarityProfile.q_pos hh hh1 hp).ne'] |
| 446 | |
| 447 | /-- The finite transport recurrence is obtained from genuine derivatives of |
| 448 | the reconstructed profiles, rather than from formal coefficient placeholders. -/ |
| 449 | theorem transport_finiteProfile {h e : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 450 | (N : ℕ) (α m : ℝ) (v u f source : ℕ → InnerProfile) {p : ProfilePoint} |
| 451 | (hp : p.1 < 1) (hs : 0 < p.2.1) |
| 452 | (hf : ∀ n ≤ N, ContDiffAt ℝ 2 (f n) (SimilarityProfile.inner h p)) : |
| 453 | transportResidual α m (finiteProfile N h 0 v) |
| 454 | (finiteProfile N h (-CoordinateAlgebra.A h) u) (finiteProfile N h e f) |
| 455 | (finiteProfile N h (e - 1) source) p = |
| 456 | finiteSeries N (SimilarityProfile.q h p) h (e - 1) |
| 457 | (fun n => transportCoefficient h e α m v u f source n (SimilarityProfile.inner h p)) + |
| 458 | transportTail N (SimilarityProfile.q h p) h e α v u f (SimilarityProfile.inner h p) := by |
| 459 | have hq := SimilarityProfile.q_pos hh hh1 hp |
| 460 | have hX : (SimilarityProfile.inner h p).1 ≠ 0 := by |
| 461 | change p.2.1 / SimilarityProfile.q h p ≠ 0 |
| 462 | exact div_ne_zero hs.ne' hq.ne' |
| 463 | have hd : ∀ n ≤ N, DifferentiableAt ℝ (f n) (SimilarityProfile.inner h p) := |
| 464 | fun n hn => (hf n hn).differentiableAt (by norm_num) |
| 465 | unfold transportResidual |
| 466 | rw [partialT_finiteProfile hh hh1 N f hp hd, partialS_finiteProfile hh hh1 N f hp hd, |
| 467 | partialZ_finiteProfile hh hh1 N f hp hd, partialSS_finiteProfile hh hh1 N f hp hf, |
| 468 | partialZZ_finiteProfile hh hh1 N f hp hf] |
| 469 | simp_rw [finiteProfile_value] |
| 470 | rw [← q_mul_X hh hh1 hp] |
| 471 | have hcalc := transport_series_identity hq hX N h e α m |
| 472 | (fun n => v n (SimilarityProfile.inner h p)) (fun n => u n (SimilarityProfile.inner h p)) |
| 473 | (fun n => f n (SimilarityProfile.inner h p)) |
| 474 | (fun n => T h (e + slowOrder h n) (f n) (SimilarityProfile.inner h p)) |
| 475 | (fun n => partialX (f n) (SimilarityProfile.inner h p)) |
| 476 | (fun n => partialX (partialX (f n)) (SimilarityProfile.inner h p)) |
| 477 | (fun n => Z h (e + slowOrder h n) (f n) (SimilarityProfile.inner h p)) |
| 478 | (fun n => Z2 h (e + slowOrder h n) (f n) (SimilarityProfile.inner h p)) |
| 479 | (fun n => source n (SimilarityProfile.inner h p)) |
| 480 | simpa only [transportCoefficient, transportTail, add_sub_assoc] using hcalc |
| 481 | |
| 482 | theorem finiteProfile_smoothAt {h e : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 483 | (N : ℕ) (f : ℕ → InnerProfile) {p : ProfilePoint} (hp : p.1 < 1) |
| 484 | (hf : ∀ n ≤ N, ContDiffAt ℝ 2 (f n) (SimilarityProfile.inner h p)) : |
| 485 | ContDiffAt ℝ 2 (finiteProfile N h e f) p := by |
| 486 | apply ContDiffAt.sum |
| 487 | intro n hn |
| 488 | exact SimilarityProfile.pullback_smoothAt hh hh1 hp |
| 489 | (hf n (by have := Finset.mem_range.mp hn; omega)) |
| 490 | |
| 491 | theorem finiteProfile_differentiableAt {h e : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 492 | (N : ℕ) (f : ℕ → InnerProfile) {p : ProfilePoint} (hp : p.1 < 1) |
| 493 | (hf : ∀ n ≤ N, DifferentiableAt ℝ (f n) (SimilarityProfile.inner h p)) : |
| 494 | DifferentiableAt ℝ (finiteProfile N h e f) p := by |
| 495 | apply DifferentiableAt.fun_sum |
| 496 | intro n hn |
| 497 | exact SimilarityProfile.pullback_differentiableAt hh hh1 hp |
| 498 | (hf n (by have := Finset.mem_range.mp hn; omega)) |
| 499 | |
| 500 | theorem derivativeAlong_scale (c : ℝ) {f : Profile} {p : ProfilePoint} |
| 501 | (hf : DifferentiableAt ℝ f p) (v : ProfilePoint) : |
| 502 | derivativeAlong v (fun y => c * f y) p = c * derivativeAlong v f p := by |
| 503 | unfold derivativeAlong |
| 504 | rw [fderiv_const_mul hf] |
| 505 | rfl |
| 506 | |
| 507 | theorem secondAlong_scale (c : ℝ) {f : Profile} {p : ProfilePoint} |
| 508 | (hf : ContDiffAt ℝ 2 f p) (v w : ProfilePoint) : |
| 509 | derivativeAlong w (derivativeAlong v (fun y => c * f y)) p = |
| 510 | c * derivativeAlong w (derivativeAlong v f) p := by |
| 511 | have he : derivativeAlong v (fun y => c * f y) =ᶠ[nhds p] |
| 512 | (fun y => c * derivativeAlong v f y) := by |
| 513 | filter_upwards [hf.eventually (by simp)] with y hy |
| 514 | exact derivativeAlong_scale c (hy.differentiableAt (by norm_num)) v |
| 515 | change fderiv ℝ _ p w = _ |
| 516 | rw [he.fderiv_eq] |
| 517 | exact derivativeAlong_scale c |
| 518 | (((hf.fderiv_right (m := 1) (by norm_num)).clm_apply contDiffAt_const).differentiableAt (by norm_num)) w |
| 519 | |
| 520 | theorem transportResidual_scale (c α m : ℝ) (V U : Profile) {G : Profile} {p : ProfilePoint} |
| 521 | (hG : ContDiffAt ℝ 2 G p) : |
| 522 | transportResidual α m V U (fun y => c * G y) (fun _ => 0) p = |
| 523 | c * transportResidual α m V U G (fun _ => 0) p := by |
| 524 | have hd := hG.differentiableAt (by norm_num) |
| 525 | unfold transportResidual |
| 526 | change derivativeAlong (1, (0, 0)) _ p + V p * |
| 527 | (derivativeAlong (0, (1, 0)) _ p + α * (c * G p / p.2.1)) + |
| 528 | U p * derivativeAlong (0, (0, 1)) _ p - |
| 529 | (2 * p.2.1 * derivativeAlong (0, (1, 0)) (derivativeAlong (0, (1, 0)) _) p + |
| 530 | 2 * m * derivativeAlong (0, (1, 0)) _ p + |
| 531 | derivativeAlong (0, (0, 1)) (derivativeAlong (0, (0, 1)) _) p) + 0 = _ |
| 532 | rw [derivativeAlong_scale c hd, derivativeAlong_scale c hd, derivativeAlong_scale c hd, |
| 533 | secondAlong_scale c hG, secondAlong_scale c hG] |
| 534 | change _ = c * (derivativeAlong (1, (0, 0)) G p + V p * |
| 535 | (derivativeAlong (0, (1, 0)) G p + α * (G p / p.2.1)) + |
| 536 | U p * derivativeAlong (0, (0, 1)) G p - |
| 537 | (2 * p.2.1 * derivativeAlong (0, (1, 0)) (derivativeAlong (0, (1, 0)) G) p + |
| 538 | 2 * m * derivativeAlong (0, (1, 0)) G p + |
| 539 | derivativeAlong (0, (0, 1)) (derivativeAlong (0, (0, 1)) G) p) + 0) |
| 540 | ring |
| 541 | |
| 542 | def angularExponent (h : ℝ) : ℝ := -CoordinateAlgebra.A h - 1 / 2 |
| 543 | def axialExponent (h : ℝ) : ℝ := -CoordinateAlgebra.A h |
| 544 | def pressureExponent (h : ℝ) : ℝ := -2 * CoordinateAlgebra.A h |
| 545 | |
| 546 | structure SlowProfiles where |
| 547 | phi : ℕ → InnerProfile |
| 548 | axial : ℕ → InnerProfile |
| 549 | flux : ℕ → InnerProfile |
| 550 | pressure : ℕ → InnerProfile |
| 551 | |
| 552 | def slowFlux (N : ℕ) (h : ℝ) (f : SlowProfiles) : Profile := finiteProfile N h 0 f.flux |
| 553 | def slowSwirl (N : ℕ) (h C : ℝ) (f : SlowProfiles) : Profile := |
| 554 | fun p => C⁻¹ * finiteProfile N h (angularExponent h) f.phi p |
| 555 | def slowAxial (N : ℕ) (h : ℝ) (f : SlowProfiles) : Profile := |
| 556 | finiteProfile N h (axialExponent h) f.axial |
| 557 | def slowPressure (N : ℕ) (h : ℝ) (f : SlowProfiles) : Profile := |
| 558 | finiteProfile N h (pressureExponent h) f.pressure |
| 559 | |
| 560 | def axialPressureSource (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := |
| 561 | Z h (pressureExponent h + slowOrder h n) (f.pressure n) |
| 562 | |
| 563 | def angularCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := |
| 564 | transportCoefficient h (angularExponent h) 1 2 f.flux f.axial f.phi (fun _ _ => 0) n |
| 565 | def axialCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := |
| 566 | transportCoefficient h (axialExponent h) 0 1 f.flux f.axial f.axial (axialPressureSource h f) n |
| 567 | def omegaCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := |
| 568 | transportCoefficient h 0 (-(1 / 2)) 0 f.flux f.axial f.flux (fun _ _ => 0) n |
| 569 | def divergenceCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) (w : InnerPoint) : ℝ := |
| 570 | partialX (f.flux n) w + Z h (axialExponent h + slowOrder h n) (f.axial n) w |
| 571 | def pressureCoefficient (h C : ℝ) (f : SlowProfiles) (n : ℕ) (w : InnerPoint) : ℝ := |
| 572 | partialX (f.pressure n) w - C⁻¹ ^ 2 * convolution (fun i j => f.phi i w * f.phi j w) n + |
| 573 | previous (fun j => omegaCoefficient h f j w) n / (2 * w.1) |
| 574 | |
| 575 | @[simp] theorem finiteProfile_zero (N : ℕ) (h b : ℝ) : |
| 576 | finiteProfile N h b (fun _ _ => 0) = fun _ => 0 := by |
| 577 | funext p |
| 578 | simp [finiteProfile, SimilarityProfile.pullback] |
| 579 | |
| 580 | /-- The physical angular equation for the finite swirl expansion. -/ |
| 581 | theorem angular_finite_expansion {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 582 | (N : ℕ) (C : ℝ) (f : SlowProfiles) {p : ProfilePoint} (hp : p.1 < 1) (hs : 0 < p.2.1) |
| 583 | (hf : ∀ n ≤ N, ContDiffAt ℝ 2 (f.phi n) (SimilarityProfile.inner h p)) : |
| 584 | transportResidual 1 2 (slowFlux N h f) (slowAxial N h f) (slowSwirl N h C f) (fun _ => 0) p = |
| 585 | C⁻¹ * (finiteSeries N (SimilarityProfile.q h p) h (angularExponent h - 1) |
| 586 | (fun n => angularCoefficient h f n (SimilarityProfile.inner h p)) + |
| 587 | transportTail N (SimilarityProfile.q h p) h (angularExponent h) 1 |
| 588 | f.flux f.axial f.phi (SimilarityProfile.inner h p)) := by |
| 589 | unfold slowSwirl |
| 590 | rw [transportResidual_scale C⁻¹ 1 2 _ _ (finiteProfile_smoothAt hh hh1 N f.phi hp hf)] |
| 591 | have he := transport_finiteProfile (e := angularExponent h) hh hh1 N 1 2 |
| 592 | f.flux f.axial f.phi (fun _ _ => 0) hp hs hf |
| 593 | simpa only [finiteProfile_zero, slowFlux, slowAxial, axialExponent, angularCoefficient] using |
| 594 | congrArg (fun z => C⁻¹ * z) he |
| 595 | |
| 596 | /-- The axial equation includes the complete axial pressure derivative. -/ |
| 597 | theorem axial_finite_expansion {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 598 | (N : ℕ) (f : SlowProfiles) {p : ProfilePoint} (hp : p.1 < 1) (hs : 0 < p.2.1) |
| 599 | (hf : ∀ n ≤ N, ContDiffAt ℝ 2 (f.axial n) (SimilarityProfile.inner h p)) |
| 600 | (hπ : ∀ n ≤ N, DifferentiableAt ℝ (f.pressure n) (SimilarityProfile.inner h p)) : |
| 601 | transportResidual 0 1 (slowFlux N h f) (slowAxial N h f) (slowAxial N h f) |
| 602 | (partialZ (slowPressure N h f)) p = |
| 603 | finiteSeries N (SimilarityProfile.q h p) h (axialExponent h - 1) |
| 604 | (fun n => axialCoefficient h f n (SimilarityProfile.inner h p)) + |
| 605 | transportTail N (SimilarityProfile.q h p) h (axialExponent h) 0 |
| 606 | f.flux f.axial f.axial (SimilarityProfile.inner h p) := by |
| 607 | have hpz := partialZ_finiteProfile (b := pressureExponent h) hh hh1 N f.pressure hp hπ |
| 608 | rw [show pressureExponent h - CoordinateAlgebra.D h = axialExponent h - 1 by |
| 609 | unfold pressureExponent axialExponent CoordinateAlgebra.A CoordinateAlgebra.D; ring] at hpz |
| 610 | have he := transport_finiteProfile (e := axialExponent h) hh hh1 N 0 1 |
| 611 | f.flux f.axial f.axial (axialPressureSource h f) hp hs hf |
| 612 | change _ = _ at he |
| 613 | have hpz' : partialZ (slowPressure N h f) p = |
| 614 | finiteProfile N h (axialExponent h - 1) (axialPressureSource h f) p := hpz |
| 615 | unfold transportResidual |
| 616 | rw [hpz'] |
| 617 | exact he |
| 618 | |
| 619 | /-- The radial acceleration flux `Ω`, before centrifugal and pressure terms. -/ |
| 620 | theorem omega_finite_expansion {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 621 | (N : ℕ) (f : SlowProfiles) {p : ProfilePoint} (hp : p.1 < 1) (hs : 0 < p.2.1) |
| 622 | (hf : ∀ n ≤ N, ContDiffAt ℝ 2 (f.flux n) (SimilarityProfile.inner h p)) : |
| 623 | transportResidual (-(1 / 2)) 0 (slowFlux N h f) (slowAxial N h f) (slowFlux N h f) |
| 624 | (fun _ => 0) p = |
| 625 | finiteSeries N (SimilarityProfile.q h p) h (-1) |
| 626 | (fun n => omegaCoefficient h f n (SimilarityProfile.inner h p)) + |
| 627 | transportTail N (SimilarityProfile.q h p) h 0 (-(1 / 2)) |
| 628 | f.flux f.axial f.flux (SimilarityProfile.inner h p) := by |
| 629 | simpa only [finiteProfile_zero, zero_sub, slowFlux, slowAxial, axialExponent, |
| 630 | omegaCoefficient] using transport_finiteProfile (e := 0) hh hh1 N (-(1 / 2)) 0 |
| 631 | f.flux f.axial f.flux (fun _ _ => 0) hp hs hf |
| 632 | |
| 633 | /-- Equation (21) is the exact divergence coefficient at every retained order. -/ |
| 634 | theorem divergence_finite_expansion {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 635 | (N : ℕ) (f : SlowProfiles) {p : ProfilePoint} (hp : p.1 < 1) |
| 636 | (hv : ∀ n ≤ N, DifferentiableAt ℝ (f.flux n) (SimilarityProfile.inner h p)) |
| 637 | (hu : ∀ n ≤ N, DifferentiableAt ℝ (f.axial n) (SimilarityProfile.inner h p)) : |
| 638 | partialS (slowFlux N h f) p + partialZ (slowAxial N h f) p = |
| 639 | finiteSeries N (SimilarityProfile.q h p) h (-1) |
| 640 | (fun n => divergenceCoefficient h f n (SimilarityProfile.inner h p)) := by |
| 641 | unfold slowFlux slowAxial |
| 642 | rw [partialS_finiteProfile hh hh1 N f.flux hp hv, |
| 643 | partialZ_finiteProfile hh hh1 N f.axial hp hu] |
| 644 | rw [show axialExponent h - CoordinateAlgebra.D h = -1 by |
| 645 | unfold axialExponent CoordinateAlgebra.A CoordinateAlgebra.D; ring] |
| 646 | simp only [zero_sub, finiteProfile_value, divergenceCoefficient] |
| 647 | exact (finiteSeries_add _ _ _ _ _ _).symm |
| 648 | |
| 649 | theorem pressure_series_identity {q X : ℝ} (hq : 0 < q) (hX : X ≠ 0) |
| 650 | (N : ℕ) (h C tail : ℝ) (phi px omega : ℕ → ℝ) : |
| 651 | finiteSeries N q h (-1) omega + tail + |
| 652 | 2 * (q * X) * (finiteSeries N q h (pressureExponent h - 1) px - |
| 653 | (C⁻¹ * finiteSeries N q h (angularExponent h) phi) ^ 2) = |
| 654 | 2 * X * finiteSeries N q h (pressureExponent h) |
| 655 | (fun n => px n - C⁻¹ ^ 2 * convolution (fun i j => phi i * phi j) n + |
| 656 | previous omega n / (2 * X)) + |
| 657 | (tail + q ^ (pressureExponent h + slowOrder h (N + 1)) * omega N - |
| 658 | 2 * X * C⁻¹ ^ 2 * pairTail N (fun n => q ^ (pressureExponent h + slowOrder h n)) |
| 659 | (fun i j => phi i * phi j)) := by |
| 660 | let conv := convolution (fun i j => phi i * phi j) |
| 661 | let ptail := pairTail N (fun n => q ^ (pressureExponent h + slowOrder h n)) |
| 662 | (fun i j => phi i * phi j) |
| 663 | have hs : finiteSeries N q h (-1) omega = |
| 664 | finiteSeries N q h (pressureExponent h) (previous omega) + |
| 665 | q ^ (pressureExponent h + slowOrder h (N + 1)) * omega N := by |
| 666 | have he : finiteSeries N q h (-1) omega = |
| 667 | ∑ n ∈ Finset.range (N + 1), q ^ (pressureExponent h + slowOrder h (n + 1)) * omega n := by |
| 668 | unfold finiteSeries |
| 669 | apply Finset.sum_congr rfl |
| 670 | intro n hn |
| 671 | rw [slowOrder_succ] |
| 672 | congr 2 |
| 673 | unfold pressureExponent CoordinateAlgebra.A |
| 674 | ring |
| 675 | rw [he] |
| 676 | exact shifted_sum N (fun n => q ^ (pressureExponent h + slowOrder h n)) omega |
| 677 | have hp := finiteSeries_mul_q hq N h (pressureExponent h - 1) px |
| 678 | rw [show pressureExponent h - 1 + 1 = pressureExponent h by ring] at hp |
| 679 | have hphi : q * (finiteSeries N q h (angularExponent h) phi) ^ 2 = |
| 680 | finiteSeries N q h (pressureExponent h) conv + ptail := by |
| 681 | rw [pow_two, finiteSeries_mul hq, Finset.mul_sum] |
| 682 | have he : (∑ ij ∈ pairs N, |
| 683 | q * (q ^ (angularExponent h + angularExponent h + slowOrder h (ij.1 + ij.2)) * |
| 684 | (phi ij.1 * phi ij.2))) = |
| 685 | ∑ ij ∈ pairs N, q ^ (pressureExponent h + slowOrder h (ij.1 + ij.2)) * |
| 686 | (phi ij.1 * phi ij.2) := by |
| 687 | apply Finset.sum_congr rfl |
| 688 | intro ij hij |
| 689 | rw [← mul_assoc] |
| 690 | congr 1 |
| 691 | conv_lhs => lhs; rw [← Real.rpow_one q] |
| 692 | rw [← Real.rpow_add hq] |
| 693 | congr 1 |
| 694 | unfold angularExponent pressureExponent |
| 695 | ring |
| 696 | rw [he] |
| 697 | exact pair_sum_split N (fun n => q ^ (pressureExponent h + slowOrder h n)) |
| 698 | (fun i j => phi i * phi j) |
| 699 | have hphysical : 2 * (q * X) * (finiteSeries N q h (pressureExponent h - 1) px - |
| 700 | (C⁻¹ * finiteSeries N q h (angularExponent h) phi) ^ 2) = |
| 701 | 2 * X * finiteSeries N q h (pressureExponent h) px - |
| 702 | 2 * X * C⁻¹ ^ 2 * (finiteSeries N q h (pressureExponent h) conv + ptail) := by |
| 703 | calc |
| 704 | _ = 2 * X * (q * finiteSeries N q h (pressureExponent h - 1) px) - |
| 705 | 2 * X * C⁻¹ ^ 2 * (q * (finiteSeries N q h (angularExponent h) phi) ^ 2) := by ring |
| 706 | _ = _ := by rw [hp, hphi] |
| 707 | have hnormal : 2 * X * finiteSeries N q h (pressureExponent h) |
| 708 | (fun n => px n - C⁻¹ ^ 2 * conv n + previous omega n / (2 * X)) = |
| 709 | 2 * X * finiteSeries N q h (pressureExponent h) px - |
| 710 | 2 * X * C⁻¹ ^ 2 * finiteSeries N q h (pressureExponent h) conv + |
| 711 | finiteSeries N q h (pressureExponent h) (previous omega) := by |
| 712 | have he : (fun n => px n - C⁻¹ ^ 2 * conv n + previous omega n / (2 * X)) = |
| 713 | (fun n => (1 : ℝ) * px n + (-C⁻¹ ^ 2) * conv n + (2 * X)⁻¹ * previous omega n) := by |
| 714 | funext n |
| 715 | ring |
| 716 | rw [he, finiteSeries_add, finiteSeries_add, finiteSeries_scale, finiteSeries_scale, |
| 717 | finiteSeries_scale] |
| 718 | field_simp ; ring |
| 719 | change _ = 2 * X * finiteSeries N q h (pressureExponent h) |
| 720 | (fun n => px n - C⁻¹ ^ 2 * conv n + previous omega n / (2 * X)) + |
| 721 | (tail + q ^ (pressureExponent h + slowOrder h (N + 1)) * omega N - 2 * X * C⁻¹ ^ 2 * ptail) |
| 722 | rw [hs, hphysical, hnormal] |
| 723 | ring |
| 724 | |
| 725 | def pressureTail (N : ℕ) (q h C : ℝ) (f : SlowProfiles) (w : InnerPoint) : ℝ := |
| 726 | transportTail N q h 0 (-(1 / 2)) f.flux f.axial f.flux w + |
| 727 | q ^ (pressureExponent h + slowOrder h (N + 1)) * omegaCoefficient h f N w - |
| 728 | 2 * w.1 * C⁻¹ ^ 2 * pairTail N (fun n => q ^ (pressureExponent h + slowOrder h n)) |
| 729 | (fun i j => f.phi i w * f.phi j w) |
| 730 | |
| 731 | /-- The pressure row of (22), including the shifted radial acceleration and |
| 732 | the exact finite pressure remainder. -/ |
| 733 | theorem pressure_finite_expansion {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 734 | (N : ℕ) (C : ℝ) (f : SlowProfiles) {p : ProfilePoint} (hp : p.1 < 1) (hs : 0 < p.2.1) |
| 735 | (hv : ∀ n ≤ N, ContDiffAt ℝ 2 (f.flux n) (SimilarityProfile.inner h p)) |
| 736 | (hπ : ∀ n ≤ N, DifferentiableAt ℝ (f.pressure n) (SimilarityProfile.inner h p)) : |
| 737 | RadialFluxResidual.fluxResidual (slowFlux N h f) (slowSwirl N h C f) |
| 738 | (slowAxial N h f) (slowPressure N h f) p = |
| 739 | 2 * (SimilarityProfile.inner h p).1 * |
| 740 | finiteSeries N (SimilarityProfile.q h p) h (pressureExponent h) |
| 741 | (fun n => pressureCoefficient h C f n (SimilarityProfile.inner h p)) + |
| 742 | pressureTail N (SimilarityProfile.q h p) h C f (SimilarityProfile.inner h p) := by |
| 743 | have hq := SimilarityProfile.q_pos hh hh1 hp |
| 744 | have hX : (SimilarityProfile.inner h p).1 ≠ 0 := by |
| 745 | change p.2.1 / SimilarityProfile.q h p ≠ 0 |
| 746 | exact div_ne_zero hs.ne' hq.ne' |
| 747 | have hflux : RadialFluxResidual.fluxResidual (slowFlux N h f) (slowSwirl N h C f) |
| 748 | (slowAxial N h f) (slowPressure N h f) p = |
| 749 | transportResidual (-(1 / 2)) 0 (slowFlux N h f) (slowAxial N h f) (slowFlux N h f) |
| 750 | (fun _ => 0) p + 2 * p.2.1 * |
| 751 | (partialS (slowPressure N h f) p - (slowSwirl N h C f p) ^ 2) := by |
| 752 | unfold RadialFluxResidual.fluxResidual transportResidual |
| 753 | ring |
| 754 | rw [hflux, omega_finite_expansion hh hh1 N f hp hs hv] |
| 755 | have hpS := partialS_finiteProfile (b := pressureExponent h) hh hh1 N f.pressure hp hπ |
| 756 | change partialS (slowPressure N h f) p = _ at hpS |
| 757 | rw [hpS] |
| 758 | unfold slowSwirl |
| 759 | simp_rw [finiteProfile_value] |
| 760 | rw [← q_mul_X hh hh1 hp] |
| 761 | exact pressure_series_identity hq hX N h C |
| 762 | (transportTail N (SimilarityProfile.q h p) h 0 (-(1 / 2)) f.flux f.axial f.flux |
| 763 | (SimilarityProfile.inner h p)) |
| 764 | (fun n => f.phi n (SimilarityProfile.inner h p)) |
| 765 | (fun n => partialX (f.pressure n) (SimilarityProfile.inner h p)) |
| 766 | (fun n => omegaCoefficient h f n (SimilarityProfile.inner h p)) |
| 767 | |
| 768 | /-- The first differential equation in (21), with the actual inner derivative. -/ |
| 769 | theorem divergenceCoefficient_eq_zero_iff (h : ℝ) (f : SlowProfiles) |
| 770 | (n : ℕ) (w : InnerPoint) : |
| 771 | divergenceCoefficient h f n w = 0 ↔ |
| 772 | partialX (f.flux n) w = |
| 773 | -Z h (axialExponent h + slowOrder h n) (f.axial n) w := by |
| 774 | unfold divergenceCoefficient |
| 775 | constructor <;> intro he <;> linarith |
| 776 | |
| 777 | /-- The angular row of (22). `previous` makes the missing order `-1` equal zero. -/ |
| 778 | theorem angularCoefficient_eq_zero_iff (h : ℝ) (f : SlowProfiles) |
| 779 | (n : ℕ) (w : InnerPoint) : |
| 780 | angularCoefficient h f n w = 0 ↔ |
| 781 | 2 * (w.1 * partialX (partialX (f.phi n)) w + 2 * partialX (f.phi n) w) = |
| 782 | T h (angularExponent h + slowOrder h n) (f.phi n) w + |
| 783 | convolution (fun i j => f.flux i w * |
| 784 | (partialX (f.phi j) w + f.phi j w / w.1) + |
| 785 | f.axial i w * Z h (angularExponent h + slowOrder h j) (f.phi j) w) n - |
| 786 | previous (fun j => Z2 h (angularExponent h + slowOrder h j) (f.phi j) w) n := by |
| 787 | unfold angularCoefficient transportCoefficient recurrence transportLinear transportPair |
| 788 | simp only [one_mul, add_zero] |
| 789 | constructor <;> intro he <;> linarith |
| 790 | |
| 791 | /-- The axial row of (22), including the pressure derivative and viscosity shift. -/ |
| 792 | theorem axialCoefficient_eq_zero_iff (h : ℝ) (f : SlowProfiles) |
| 793 | (n : ℕ) (w : InnerPoint) : |
| 794 | axialCoefficient h f n w = 0 ↔ |
| 795 | 2 * (w.1 * partialX (partialX (f.axial n)) w + partialX (f.axial n) w) = |
| 796 | T h (axialExponent h + slowOrder h n) (f.axial n) w + |
| 797 | convolution (fun i j => f.flux i w * partialX (f.axial j) w + |
| 798 | f.axial i w * Z h (axialExponent h + slowOrder h j) (f.axial j) w) n + |
| 799 | Z h (pressureExponent h + slowOrder h n) (f.pressure n) w - |
| 800 | previous (fun j => Z2 h (axialExponent h + slowOrder h j) (f.axial j) w) n := by |
| 801 | unfold axialCoefficient transportCoefficient recurrence transportLinear transportPair |
| 802 | axialPressureSource |
| 803 | simp only [zero_mul, zero_div, add_zero, one_mul] |
| 804 | constructor <;> intro he <;> linarith |
| 805 | |
| 806 | /-- The radial acceleration coefficient appearing in the pressure row of (22). -/ |
| 807 | theorem omegaCoefficient_eq (h : ℝ) (f : SlowProfiles) (n : ℕ) (w : InnerPoint) : |
| 808 | omegaCoefficient h f n w = |
| 809 | T h (slowOrder h n) (f.flux n) w + |
| 810 | convolution (fun i j => f.flux i w * |
| 811 | (partialX (f.flux j) w - f.flux j w / (2 * w.1)) + |
| 812 | f.axial i w * Z h (slowOrder h j) (f.flux j) w) n - |
| 813 | 2 * w.1 * partialX (partialX (f.flux n)) w - |
| 814 | previous (fun j => Z2 h (slowOrder h j) (f.flux j) w) n := by |
| 815 | unfold omegaCoefficient transportCoefficient recurrence transportLinear transportPair |
| 816 | simp only [zero_add, zero_mul, add_zero] |
| 817 | have hk : (fun i j => f.flux i w * |
| 818 | (partialX (f.flux j) w + -(1 / 2 : ℝ) * f.flux j w / w.1) + |
| 819 | f.axial i w * Z h (slowOrder h j) (f.flux j) w) = |
| 820 | (fun i j => f.flux i w * |
| 821 | (partialX (f.flux j) w - f.flux j w / (2 * w.1)) + |
| 822 | f.axial i w * Z h (slowOrder h j) (f.flux j) w) := by |
| 823 | funext i j |
| 824 | ring |
| 825 | rw [hk] |
| 826 | ring |
| 827 | |
| 828 | /-- The pressure row of (22), including the preceding radial acceleration. -/ |
| 829 | theorem pressureCoefficient_eq_zero_iff (h C : ℝ) (f : SlowProfiles) |
| 830 | (n : ℕ) (w : InnerPoint) : |
| 831 | pressureCoefficient h C f n w = 0 ↔ |
| 832 | partialX (f.pressure n) w = |
| 833 | C⁻¹ ^ 2 * convolution (fun i j => f.phi i w * f.phi j w) n - |
| 834 | previous (fun j => omegaCoefficient h f j w) n / (2 * w.1) := by |
| 835 | unfold pressureCoefficient |
| 836 | constructor <;> intro he <;> linarith |
| 837 | |
| 838 | /-- The angular coefficient in Cartesian coordinates has the opposite sign |
| 839 | because it multiplies `(y,-x,0)` in the residual formula. -/ |
| 840 | theorem residualAngular_radialB (V F U : Profile) {p : ProfilePoint} (hs : p.2.1 ≠ 0) : |
| 841 | AxisymmetricResidual.residualAngular (RadialFluxResidual.radialB V) F U p = |
| 842 | -transportResidual 1 2 V U F (fun _ => 0) p := by |
| 843 | unfold AxisymmetricResidual.residualAngular AxisymmetricResidual.advectionAngular |
| 844 | AxisymmetricResidual.laplaceWeighted RadialFluxResidual.radialB transportResidual |
| 845 | field_simp [hs] ; ring |
| 846 | |
| 847 | theorem residualAxial_radialB (V U P : Profile) {p : ProfilePoint} (hs : p.2.1 ≠ 0) : |
| 848 | AxisymmetricResidual.residualAxial (RadialFluxResidual.radialB V) U P p = |
| 849 | transportResidual 0 1 V U U (partialZ P) p := by |
| 850 | unfold AxisymmetricResidual.residualAxial AxisymmetricResidual.advectionAxial |
| 851 | AxisymmetricResidual.laplaceScalar RadialFluxResidual.radialB transportResidual |
| 852 | field_simp [hs] ; ring |
| 853 | |
| 854 | noncomputable def slowVelocity (N : ℕ) (h C : ℝ) (f : SlowProfiles) : |
| 855 | ProblemStatement.VelocityField := |
| 856 | AxisymmetricResidual.velocity (RadialFluxResidual.radialB (slowFlux N h f)) |
| 857 | (slowSwirl N h C f) (slowAxial N h f) |
| 858 | |
| 859 | noncomputable def slowPressureField (N : ℕ) (h : ℝ) (f : SlowProfiles) : |
| 860 | ProblemStatement.PressureField := AxisymmetricResidual.pressure (slowPressure N h f) |
| 861 | |
| 862 | /-- Cartesian realization of the radial-flux and swirl ansatz. -/ |
| 863 | theorem slowVelocity_components (N : ℕ) (h C : ℝ) (f : SlowProfiles) |
| 864 | (t : ℝ) (x : ProblemStatement.Space) : |
| 865 | slowVelocity N h C f (t, x) = |
| 866 | AxisymmetricResidual.pack |
| 867 | (x 0 * (slowFlux N h f (profilePoint t x) / (2 * radialEnergy x)) - |
| 868 | x 1 * slowSwirl N h C f (profilePoint t x)) |
| 869 | (x 1 * (slowFlux N h f (profilePoint t x) / (2 * radialEnergy x)) + |
| 870 | x 0 * slowSwirl N h C f (profilePoint t x)) |
| 871 | (slowAxial N h f (profilePoint t x)) := by |
| 872 | ext i |
| 873 | fin_cases i <;> |
| 874 | simp [slowVelocity, AxisymmetricResidual.velocity, AxisymmetricResidual.componentX, |
| 875 | AxisymmetricResidual.componentY, AxisymmetricResidual.lift, RadialFluxResidual.radialB, |
| 876 | AxisymmetricResidual.pack, ProblemStatement.coordinateVector, |
| 877 | profilePoint] <;> ring |
| 878 | |
| 879 | theorem slowVelocity_radial_flux (N : ℕ) (h C : ℝ) (f : SlowProfiles) |
| 880 | (t : ℝ) (x : ProblemStatement.Space) (hs : 0 < radialEnergy x) : |
| 881 | x 0 * slowVelocity N h C f (t, x) 0 + x 1 * slowVelocity N h C f (t, x) 1 = |
| 882 | slowFlux N h f (profilePoint t x) := |
| 883 | RadialFluxResidual.radial_flux_velocity _ _ _ _ _ hs |
| 884 | |
| 885 | /-- The finite field's divergence is exactly its finite divergence-coefficient |
| 886 | sum. This assertion uses the actual Euclidean divergence, away from the axis. -/ |
| 887 | theorem divergence_slowVelocity {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 888 | (N : ℕ) (C : ℝ) (f : SlowProfiles) {t : ℝ} {x : ProblemStatement.Space} |
| 889 | (ht : t < 1) (hs : 0 < radialEnergy x) |
| 890 | (hv : ∀ n ≤ N, DifferentiableAt ℝ (f.flux n) |
| 891 | (SimilarityProfile.inner h (profilePoint t x))) |
| 892 | (hf : ∀ n ≤ N, DifferentiableAt ℝ (f.phi n) |
| 893 | (SimilarityProfile.inner h (profilePoint t x))) |
| 894 | (hu : ∀ n ≤ N, DifferentiableAt ℝ (f.axial n) |
| 895 | (SimilarityProfile.inner h (profilePoint t x))) : |
| 896 | ProblemStatement.spatialDivergence (slowVelocity N h C f) t x = |
| 897 | finiteSeries N (SimilarityProfile.q h (profilePoint t x)) h (-1) |
| 898 | (fun n => divergenceCoefficient h f n (SimilarityProfile.inner h (profilePoint t x))) := by |
| 899 | have hV := finiteProfile_differentiableAt (e := 0) hh hh1 N f.flux ht hv |
| 900 | have hF := (finiteProfile_differentiableAt (e := angularExponent h) hh hh1 N f.phi ht hf).const_mul C⁻¹ |
| 901 | have hU := finiteProfile_differentiableAt (e := axialExponent h) hh hh1 N f.axial ht hu |
| 902 | change ProblemStatement.spatialDivergence |
| 903 | (AxisymmetricResidual.velocity (RadialFluxResidual.radialB (slowFlux N h f)) |
| 904 | (slowSwirl N h C f) (slowAxial N h f)) t x = _ |
| 905 | exact (RadialFluxResidual.divergence_radialB hV hF hU hs).trans |
| 906 | (divergence_finite_expansion hh hh1 N f ht hv hu) |
| 907 | |
| 908 | theorem finiteSeries_eq_zero (N : ℕ) (q h e : ℝ) (a : ℕ → ℝ) |
| 909 | (ha : ∀ n ≤ N, a n = 0) : finiteSeries N q h e a = 0 := by |
| 910 | unfold finiteSeries |
| 911 | apply Finset.sum_eq_zero |
| 912 | intro n hn |
| 913 | rw [ha n (by have := Finset.mem_range.mp hn; omega), mul_zero] |
| 914 | |
| 915 | theorem divergence_slowVelocity_eq_zero {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 916 | (N : ℕ) (C : ℝ) (f : SlowProfiles) {t : ℝ} {x : ProblemStatement.Space} |
| 917 | (ht : t < 1) (hs : 0 < radialEnergy x) |
| 918 | (hv : ∀ n ≤ N, DifferentiableAt ℝ (f.flux n) |
| 919 | (SimilarityProfile.inner h (profilePoint t x))) |
| 920 | (hf : ∀ n ≤ N, DifferentiableAt ℝ (f.phi n) |
| 921 | (SimilarityProfile.inner h (profilePoint t x))) |
| 922 | (hu : ∀ n ≤ N, DifferentiableAt ℝ (f.axial n) |
| 923 | (SimilarityProfile.inner h (profilePoint t x))) |
| 924 | (hdiv : ∀ n ≤ N, divergenceCoefficient h f n |
| 925 | (SimilarityProfile.inner h (profilePoint t x)) = 0) : |
| 926 | ProblemStatement.spatialDivergence (slowVelocity N h C f) t x = 0 := by |
| 927 | rw [divergence_slowVelocity hh hh1 N C f ht hs hv hf hu] |
| 928 | exact finiteSeries_eq_zero _ _ _ _ _ hdiv |
| 929 | |
| 930 | noncomputable def angularExpansion (N : ℕ) (q h C : ℝ) (f : SlowProfiles) |
| 931 | (w : InnerPoint) : ℝ := |
| 932 | C⁻¹ * (finiteSeries N q h (angularExponent h - 1) (fun n => angularCoefficient h f n w) + |
| 933 | transportTail N q h (angularExponent h) 1 f.flux f.axial f.phi w) |
| 934 | |
| 935 | noncomputable def axialExpansion (N : ℕ) (q h : ℝ) (f : SlowProfiles) |
| 936 | (w : InnerPoint) : ℝ := |
| 937 | finiteSeries N q h (axialExponent h - 1) (fun n => axialCoefficient h f n w) + |
| 938 | transportTail N q h (axialExponent h) 0 f.flux f.axial f.axial w |
| 939 | |
| 940 | noncomputable def radialFluxExpansion (N : ℕ) (q h C : ℝ) (f : SlowProfiles) |
| 941 | (w : InnerPoint) : ℝ := |
| 942 | 2 * w.1 * finiteSeries N q h (pressureExponent h) (fun n => pressureCoefficient h C f n w) + |
| 943 | pressureTail N q h C f w |
| 944 | |
| 945 | /-- Reconstruction of the full Cartesian Navier--Stokes residual of the |
| 946 | finite slow expansion. Every derivative on the left is the genuine spatial |
| 947 | or temporal Fréchet derivative from `ProblemStatement`. -/ |
| 948 | theorem navierStokesResidual_slowVelocity {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 949 | (N : ℕ) (C : ℝ) (f : SlowProfiles) {t : ℝ} {x : ProblemStatement.Space} |
| 950 | (ht : t < 1) (hs : 0 < radialEnergy x) |
| 951 | (hv : ∀ n ≤ N, ContDiffAt ℝ 2 (f.flux n) |
| 952 | (SimilarityProfile.inner h (profilePoint t x))) |
| 953 | (hf : ∀ n ≤ N, ContDiffAt ℝ 2 (f.phi n) |
| 954 | (SimilarityProfile.inner h (profilePoint t x))) |
| 955 | (hu : ∀ n ≤ N, ContDiffAt ℝ 2 (f.axial n) |
| 956 | (SimilarityProfile.inner h (profilePoint t x))) |
| 957 | (hπ : ∀ n ≤ N, DifferentiableAt ℝ (f.pressure n) |
| 958 | (SimilarityProfile.inner h (profilePoint t x))) : |
| 959 | ProblemStatement.navierStokesResidual (slowVelocity N h C f) (slowPressureField N h f) t x = |
| 960 | let q := SimilarityProfile.q h (profilePoint t x) |
| 961 | let w := SimilarityProfile.inner h (profilePoint t x) |
| 962 | AxisymmetricResidual.pack |
| 963 | (x 0 * (radialFluxExpansion N q h C f w / (2 * radialEnergy x)) - |
| 964 | x 1 * angularExpansion N q h C f w) |
| 965 | (x 1 * (radialFluxExpansion N q h C f w / (2 * radialEnergy x)) + |
| 966 | x 0 * angularExpansion N q h C f w) |
| 967 | (axialExpansion N q h f w) := by |
| 968 | have hV : ContDiffAt ℝ 2 (slowFlux N h f) (profilePoint t x) := |
| 969 | finiteProfile_smoothAt hh hh1 N f.flux ht hv |
| 970 | have hF : ContDiffAt ℝ 2 (slowSwirl N h C f) (profilePoint t x) := |
| 971 | contDiffAt_const.mul (finiteProfile_smoothAt hh hh1 N f.phi ht hf) |
| 972 | have hU : ContDiffAt ℝ 2 (slowAxial N h f) (profilePoint t x) := |
| 973 | finiteProfile_smoothAt hh hh1 N f.axial ht hu |
| 974 | have hP : DifferentiableAt ℝ (slowPressure N h f) (profilePoint t x) := |
| 975 | finiteProfile_differentiableAt hh hh1 N f.pressure ht hπ |
| 976 | have hB := RadialFluxResidual.contDiffAt_radialB hV hs.ne' |
| 977 | have hR : AxisymmetricResidual.residualRadial (RadialFluxResidual.radialB (slowFlux N h f)) |
| 978 | (slowSwirl N h C f) (slowAxial N h f) (slowPressure N h f) (profilePoint t x) = |
| 979 | radialFluxExpansion N (SimilarityProfile.q h (profilePoint t x)) h C f |
| 980 | (SimilarityProfile.inner h (profilePoint t x)) / (2 * radialEnergy x) := by |
| 981 | apply (eq_div_iff (mul_ne_zero (by norm_num) hs.ne')).2 |
| 982 | rw [mul_comm] |
| 983 | exact (RadialFluxResidual.residualRadial_radialB _ _ _ hV hs).trans |
| 984 | (pressure_finite_expansion hh hh1 N C f ht hs hv hπ) |
| 985 | have hA : AxisymmetricResidual.residualAngular (RadialFluxResidual.radialB (slowFlux N h f)) |
| 986 | (slowSwirl N h C f) (slowAxial N h f) (profilePoint t x) = |
| 987 | -angularExpansion N (SimilarityProfile.q h (profilePoint t x)) h C f |
| 988 | (SimilarityProfile.inner h (profilePoint t x)) := by |
| 989 | rw [residualAngular_radialB _ _ _ hs.ne'] |
| 990 | exact congrArg Neg.neg (angular_finite_expansion hh hh1 N C f ht hs hf) |
| 991 | have hZ : AxisymmetricResidual.residualAxial (RadialFluxResidual.radialB (slowFlux N h f)) |
| 992 | (slowAxial N h f) (slowPressure N h f) (profilePoint t x) = |
| 993 | axialExpansion N (SimilarityProfile.q h (profilePoint t x)) h f |
| 994 | (SimilarityProfile.inner h (profilePoint t x)) := by |
| 995 | rw [residualAxial_radialB _ _ _ hs.ne'] |
| 996 | exact axial_finite_expansion hh hh1 N f ht hs hu hπ |
| 997 | have he := LocalAxisymmetricResidual.navierStokesResidual_velocity hB hF hU hP |
| 998 | rw [hR, hA, hZ] at he |
| 999 | unfold slowVelocity slowPressureField |
| 1000 | simpa only [mul_neg, sub_neg_eq_add, ← sub_eq_add_neg] using he |
| 1001 | |
| 1002 | /-- The explicit forcing left by truncation once all retained coefficient |
| 1003 | equations hold. This includes omitted quadratic interactions and the final |
| 1004 | axial-viscosity and radial-acceleration terms. -/ |
| 1005 | noncomputable def truncationResidual (N : ℕ) (h C : ℝ) (f : SlowProfiles) |
| 1006 | (t : ℝ) (x : ProblemStatement.Space) : ProblemStatement.Space := |
| 1007 | let q := SimilarityProfile.q h (profilePoint t x) |
| 1008 | let w := SimilarityProfile.inner h (profilePoint t x) |
| 1009 | let R := pressureTail N q h C f w / (2 * radialEnergy x) |
| 1010 | let A := C⁻¹ * transportTail N q h (angularExponent h) 1 f.flux f.axial f.phi w |
| 1011 | let U := transportTail N q h (axialExponent h) 0 f.flux f.axial f.axial w |
| 1012 | AxisymmetricResidual.pack (x 0 * R - x 1 * A) (x 1 * R + x 0 * A) U |
| 1013 | |
| 1014 | /-- Solving all retained coefficient equations produces precisely the |
| 1015 | displayed truncation forcing; it does not make that forcing disappear. -/ |
| 1016 | theorem navierStokesResidual_slowVelocity_of_coefficients |
| 1017 | {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) |
| 1018 | (N : ℕ) (C : ℝ) (f : SlowProfiles) {t : ℝ} {x : ProblemStatement.Space} |
| 1019 | (ht : t < 1) (hs : 0 < radialEnergy x) |
| 1020 | (hv : ∀ n ≤ N, ContDiffAt ℝ 2 (f.flux n) |
| 1021 | (SimilarityProfile.inner h (profilePoint t x))) |
| 1022 | (hf : ∀ n ≤ N, ContDiffAt ℝ 2 (f.phi n) |
| 1023 | (SimilarityProfile.inner h (profilePoint t x))) |
| 1024 | (hu : ∀ n ≤ N, ContDiffAt ℝ 2 (f.axial n) |
| 1025 | (SimilarityProfile.inner h (profilePoint t x))) |
| 1026 | (hπ : ∀ n ≤ N, DifferentiableAt ℝ (f.pressure n) |
| 1027 | (SimilarityProfile.inner h (profilePoint t x))) |
| 1028 | (hA : ∀ n ≤ N, angularCoefficient h f n (SimilarityProfile.inner h (profilePoint t x)) = 0) |
| 1029 | (hZ : ∀ n ≤ N, axialCoefficient h f n (SimilarityProfile.inner h (profilePoint t x)) = 0) |
| 1030 | (hR : ∀ n ≤ N, pressureCoefficient h C f n (SimilarityProfile.inner h (profilePoint t x)) = 0) : |
| 1031 | ProblemStatement.navierStokesResidual (slowVelocity N h C f) (slowPressureField N h f) t x = |
| 1032 | truncationResidual N h C f t x := by |
| 1033 | rw [navierStokesResidual_slowVelocity hh hh1 N C f ht hs hv hf hu hπ] |
| 1034 | simp only [radialFluxExpansion, angularExpansion, axialExpansion, |
| 1035 | finiteSeries_eq_zero _ _ _ _ _ hA, finiteSeries_eq_zero _ _ _ _ _ hZ, |
| 1036 | finiteSeries_eq_zero _ _ _ _ _ hR, mul_zero, zero_add] |
| 1037 | rfl |
| 1038 | |
| 1039 | end NavierStokes.SlowExpansionResidual |