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.MeanMomentBounds |
| 2 | import NavierStokes.MeanIncrementBounds |
| 3 | import NavierStokes.MeanRankUpdate |
| 4 | import NavierStokes.CorrectionState |
| 5 | |
| 6 | /-! |
| 7 | # Actual defect changes under the slow rank update |
| 8 | |
| 9 | The pressure, angular flux, and axial flux defects are actual torus/radial |
| 10 | moments. Their linear changes are precisely the last three rows of (35). |
| 11 | The remaining terms include the complete radial-source remainder of (32). |
| 12 | -/ |
| 13 | |
| 14 | namespace NavierStokes.DefectIncrementBounds |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | open Set Function MeasureTheory Filter |
| 19 | open scoped ContDiff Topology Interval |
| 20 | open WeightedClasses MeanIncrementBounds |
| 21 | |
| 22 | variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 23 | |
| 24 | abbrev Point (P : Type) := PressureStream.Lift P |
| 25 | abbrev ScalarField (D : Type) := MeanIncrementBounds.Field D |
| 26 | |
| 27 | noncomputable def positiveDomain : Set (Point P) := {x | 0 < x.1} |
| 28 | |
| 29 | omit [NormedSpace ℝ P] in |
| 30 | theorem positiveDomain_open : IsOpen (positiveDomain (P := P)) := |
| 31 | isOpen_lt continuous_const continuous_fst |
| 32 | |
| 33 | /-- Global smooth zero extension with a fixed radial support shell. -/ |
| 34 | structure Shell (a b : ℝ) (f : ScalarField (Point P)) : Prop where |
| 35 | smooth : ∀ n, ContDiff ℝ ∞ (f n) |
| 36 | supported : ∀ n, RadialAlias.RadiallySupported a b (f n) |
| 37 | |
| 38 | namespace Shell |
| 39 | |
| 40 | variable {a b : ℝ} {f g : ScalarField (Point P)} |
| 41 | |
| 42 | theorem zero_of_not_mem (hf : Shell a b f) (n : ℕ) (x : Point P) |
| 43 | (hx : x.1 ∉ Icc a b) : f n x = 0 := by |
| 44 | by_contra hn |
| 45 | exact hx (hf.supported n hn) |
| 46 | |
| 47 | theorem zero : Shell a b (0 : ScalarField (Point P)) := |
| 48 | ⟨fun _ => contDiff_const, fun _ _ hx => (hx rfl).elim⟩ |
| 49 | |
| 50 | theorem add (hf : Shell a b f) (hg : Shell a b g) : Shell a b (f + g) := by |
| 51 | refine ⟨fun n => (hf.smooth n).add (hg.smooth n), ?_⟩ |
| 52 | intro n x hx |
| 53 | by_contra hn |
| 54 | exact hx (by simp [hf.zero_of_not_mem n x hn, hg.zero_of_not_mem n x hn]) |
| 55 | |
| 56 | theorem neg (hf : Shell a b f) : Shell a b (-f) := by |
| 57 | refine ⟨fun n => (hf.smooth n).neg, ?_⟩ |
| 58 | intro n x hx |
| 59 | exact hf.supported n (neg_ne_zero.mp hx) |
| 60 | |
| 61 | theorem sub (hf : Shell a b f) (hg : Shell a b g) : Shell a b (f - g) := by |
| 62 | simpa only [sub_eq_add_neg] using hf.add hg.neg |
| 63 | |
| 64 | theorem mul (hf : Shell a b f) (hg : Shell a b g) : Shell a b (f * g) := by |
| 65 | refine ⟨fun n => (hf.smooth n).mul (hg.smooth n), ?_⟩ |
| 66 | intro n x hx |
| 67 | exact hf.supported n (left_ne_zero_of_mul hx) |
| 68 | |
| 69 | theorem band_mul (hf : Shell a b f) (c : ℕ → ℝ) : |
| 70 | Shell a b (fun n x => c n * f n x) := by |
| 71 | refine ⟨fun n => contDiff_const.mul (hf.smooth n), ?_⟩ |
| 72 | intro n x hx |
| 73 | exact hf.supported n (right_ne_zero_of_mul hx) |
| 74 | |
| 75 | theorem smul (hf : Shell a b f) (c : ℝ) : Shell a b (c • f) := |
| 76 | hf.band_mul (fun _ => c) |
| 77 | |
| 78 | theorem directional (hf : Shell a b f) (v : Point P) : |
| 79 | Shell a b (fun n x => fderiv ℝ (f n) x v) := |
| 80 | ⟨fun n => ((hf.smooth n).fderiv_right (by simp)).clm_apply contDiff_const, |
| 81 | fun n => RadialAlias.radialSupport_fderiv_apply (hf.supported n) v⟩ |
| 82 | |
| 83 | /-- Coefficients need smoothness only on the physical region `R > 0`. |
| 84 | Near the axis the actual product vanishes because the other factor is |
| 85 | supported away from it. -/ |
| 86 | theorem coefficient_mul (hf : Shell a b f) (ha : 0 < a) |
| 87 | (hg : SmoothOn (positiveDomain (P := P)) g) : Shell a b (g * f) := by |
| 88 | refine ⟨?_, fun n x hx => hf.supported n (right_ne_zero_of_mul hx)⟩ |
| 89 | intro n |
| 90 | apply contDiff_iff_contDiffAt.mpr |
| 91 | intro x |
| 92 | by_cases hx : x.1 < a |
| 93 | · apply (contDiffAt_const : ContDiffAt ℝ ∞ (fun _ : Point P => (0 : ℝ)) x).congr_of_eventuallyEq |
| 94 | filter_upwards [(isOpen_lt continuous_fst continuous_const).mem_nhds hx] with y hy |
| 95 | have hzero := hf.zero_of_not_mem n y (fun h => (not_le_of_gt hy) h.1) |
| 96 | simp only [Pi.mul_apply, hzero, mul_zero] |
| 97 | · have hpos : x ∈ positiveDomain (P := P) := ha.trans_le (le_of_not_gt hx) |
| 98 | exact ((hg n).contDiffAt (positiveDomain_open.mem_nhds hpos)).mul (hf.smooth n).contDiffAt |
| 99 | |
| 100 | theorem mul_coefficient (hf : Shell a b f) (ha : 0 < a) |
| 101 | (hg : SmoothOn (positiveDomain (P := P)) g) : Shell a b (f * g) := by |
| 102 | simpa only [mul_comm] using hf.coefficient_mul ha hg |
| 103 | |
| 104 | theorem smoothOn (hf : Shell a b f) (U : Set (Point P)) : SmoothOn U f := |
| 105 | fun n => (hf.smooth n).contDiffOn |
| 106 | |
| 107 | end Shell |
| 108 | |
| 109 | structure ShellTriple (a b : ℝ) (m : Triple (Point P)) : Prop where |
| 110 | radial : Shell a b m.radial |
| 111 | angular : Shell a b m.angular |
| 112 | axial : Shell a b m.axial |
| 113 | |
| 114 | theorem ShellTriple.updated {a b : ℝ} {m h : Triple (Point P)} |
| 115 | (hm : ShellTriple a b m) (hh : ShellTriple a b h) : ShellTriple a b (updated m h) := |
| 116 | ⟨hm.radial.add hh.radial, hm.angular.add hh.angular, hm.axial.add hh.axial⟩ |
| 117 | |
| 118 | theorem ShellTriple.smooth {a b : ℝ} {m : Triple (Point P)} |
| 119 | (hm : ShellTriple a b m) (U : Set (Point P)) : SmoothTriple U m := |
| 120 | ⟨hm.radial.smoothOn U, hm.angular.smoothOn U, hm.axial.smoothOn U⟩ |
| 121 | |
| 122 | /-- The radial chart has its actual radius and a coefficient smooth on the |
| 123 | physical positive radial region. No estimate on a residual is assumed. -/ |
| 124 | structure PositiveOperators (o : Operators (Point P)) : Prop where |
| 125 | radius_eq : o.radius = Prod.fst |
| 126 | radialProfile : ContDiffOn ℝ ∞ o.radialProfile (positiveDomain (P := P)) |
| 127 | |
| 128 | theorem PositiveOperators.invRadius_smooth {o : Operators (Point P)} |
| 129 | (ho : PositiveOperators o) : SmoothOn (positiveDomain (P := P)) o.invRadius := by |
| 130 | intro n |
| 131 | change ContDiffOn ℝ ∞ (fun x => (o.radius x)⁻¹) positiveDomain |
| 132 | rw [ho.radius_eq] |
| 133 | exact contDiffOn_fst.inv (fun x hx => (ne_of_gt hx)) |
| 134 | |
| 135 | namespace Shell |
| 136 | |
| 137 | variable {a b : ℝ} {f : ScalarField (Point P)} {o : Operators (Point P)} |
| 138 | |
| 139 | theorem dr (hf : Shell a b f) (ha : 0 < a) (ho : PositiveOperators o) : |
| 140 | Shell a b (o.dr f) := by |
| 141 | have hr := hf.directional o.eR |
| 142 | have hv := ((hf.directional o.vR).coefficient_mul ha |
| 143 | (fun _ => ho.radialProfile)).band_mul o.radialFrequency |
| 144 | exact hr.add hv |
| 145 | |
| 146 | theorem dz (hf : Shell a b f) (o : Operators (Point P)) : Shell a b (o.dz f) := |
| 147 | (hf.directional o.eZ).band_mul o.epsilon |
| 148 | |
| 149 | theorem time (hf : Shell a b f) (o : Operators (Point P)) : Shell a b (o.time f) := |
| 150 | ((hf.directional o.eT).band_mul o.epsilon).neg.add |
| 151 | ((hf.directional o.vT).band_mul o.fastCoefficient) |
| 152 | |
| 153 | theorem inv_mul (hf : Shell a b f) (ha : 0 < a) (ho : PositiveOperators o) : |
| 154 | Shell a b (o.invRadius * f) := hf.coefficient_mul ha ho.invRadius_smooth |
| 155 | |
| 156 | theorem radialDiv (hf : Shell a b f) (ha : 0 < a) (ho : PositiveOperators o) (c : ℝ) : |
| 157 | Shell a b (o.radialDiv c f) := |
| 158 | (hf.dr ha ho).add ((hf.inv_mul ha ho).smul c) |
| 159 | |
| 160 | theorem viscosity (hf : Shell a b f) (ha : 0 < a) (ho : PositiveOperators o) (c : ℝ) : |
| 161 | Shell a b (o.viscosity c f) := by |
| 162 | exact (((((hf.dr ha ho).dr ha ho).add ((hf.dr ha ho).inv_mul ha ho)).add |
| 163 | ((hf.dz o).dz o)).sub (((hf.inv_mul ha ho).inv_mul ha ho).smul c)).band_mul o.epsilon |
| 164 | |
| 165 | end Shell |
| 166 | |
| 167 | section FluxSupport |
| 168 | |
| 169 | variable {a b : ℝ} (ha : 0 < a) {base m h : Triple (Point P)} |
| 170 | (hb : SmoothTriple (positiveDomain (P := P)) base) |
| 171 | (hm : ShellTriple a b m) (hh : ShellTriple a b h) |
| 172 | |
| 173 | include ha hb hm in |
| 174 | theorem thetaAxial_shell : Shell a b (thetaAxial base m) := |
| 175 | ((hm.angular.coefficient_mul ha hb.axial).add |
| 176 | (hm.axial.coefficient_mul ha hb.angular)).add (hm.axial.mul hm.angular) |
| 177 | |
| 178 | include ha hb hm in |
| 179 | theorem axialAxial_shell : Shell a b (axialAxial base m) := |
| 180 | ((hm.axial.coefficient_mul ha hb.axial).smul 2).add (hm.axial.mul hm.axial) |
| 181 | |
| 182 | include ha hb hm in |
| 183 | theorem axialRadial_shell : Shell a b (axialRadial base m) := |
| 184 | ((hm.axial.coefficient_mul ha hb.radial).add |
| 185 | (hm.radial.mul_coefficient ha hb.axial)).add (hm.radial.mul hm.axial) |
| 186 | |
| 187 | include ha hb hm in |
| 188 | theorem radialRadial_shell : Shell a b (radialRadial base m) := |
| 189 | ((hm.radial.coefficient_mul ha hb.radial).smul 2).add (hm.radial.mul hm.radial) |
| 190 | |
| 191 | include ha hb hm in |
| 192 | theorem radialAngular_shell : Shell a b (radialAngular base m) := |
| 193 | ((hm.angular.coefficient_mul ha hb.angular).smul 2).add (hm.angular.mul hm.angular) |
| 194 | |
| 195 | include ha hb hm in |
| 196 | theorem gr_shell {o : Operators (Point P)} (ho : PositiveOperators o) |
| 197 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) (hW : ∀ i j, Shell a b (W i j)) : |
| 198 | Shell a b (gr o base m W) := by |
| 199 | exact (((((hm.radial.time o).add |
| 200 | (((radialRadial_shell ha hb hm).add (hW 0 0)).radialDiv ha ho 1)).add |
| 201 | (((axialRadial_shell ha hb hm).add (hW 2 0)).dz o)).sub |
| 202 | (((radialAngular_shell ha hb hm).add (hW 1 1)).inv_mul ha ho)).sub |
| 203 | (hm.radial.viscosity ha ho 1)).neg |
| 204 | |
| 205 | include ha hb hh in |
| 206 | theorem leadingRadial_shell {o : Operators (Point P)} (ho : PositiveOperators o) : |
| 207 | Shell a b (leadingRadial o base h) := |
| 208 | (((hh.angular.coefficient_mul ha hb.angular).smul 2).inv_mul ha ho) |
| 209 | |
| 210 | end FluxSupport |
| 211 | |
| 212 | /-! ## The actual three moments and their linearity -/ |
| 213 | |
| 214 | noncomputable def barMoment (k : ℕ) (f : ScalarField (Point P)) : ScalarField P := |
| 215 | CorrectionState.radialMoment k f |
| 216 | |
| 217 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 218 | theorem barMoment_apply (k : ℕ) (f : ScalarField (Point P)) (n : ℕ) (p : P) : |
| 219 | barMoment k f n p = ∫ r, r ^ k * PressureStream.torusAverage (f n) (r, p) := |
| 220 | MeanMomentBounds.pressureMass_radialWeighted k (f n) p |
| 221 | |
| 222 | omit [NormedSpace ℝ P] in |
| 223 | theorem torusAverage_add {f g : Point P → ℝ} (hf : Continuous f) (hg : Continuous g) |
| 224 | (p : ℝ × P) : |
| 225 | PressureStream.torusAverage (fun x => f x + g x) p = |
| 226 | PressureStream.torusAverage f p + PressureStream.torusAverage g p := by |
| 227 | change FourierAlias.torusMean (fun Y => f (p.1, (p.2, Y)) + g (p.1, (p.2, Y))) = _ |
| 228 | exact FourierAlias.torusMean_add |
| 229 | (hf.comp (continuous_const.prodMk (continuous_const.prodMk continuous_id))) |
| 230 | (hg.comp (continuous_const.prodMk (continuous_const.prodMk continuous_id))) |
| 231 | |
| 232 | theorem Shell.barIntegrable {a b : ℝ} {f : ScalarField (Point P)} (hf : Shell a b f) |
| 233 | (k n : ℕ) (p : P) : |
| 234 | Integrable (fun r => r ^ k * PressureStream.torusAverage (f n) (r, p)) := |
| 235 | IntegratedMeanBalances.weighted_integrable |
| 236 | (PressureStream.torusAverage_slice_contDiff (hf.smooth n) p).continuous |
| 237 | (PressureStream.torusAverage_slice_hasCompactSupport (hf.supported n) p) k |
| 238 | |
| 239 | theorem barMoment_add {a b : ℝ} {f g : ScalarField (Point P)} |
| 240 | (hf : Shell a b f) (hg : Shell a b g) (k : ℕ) : |
| 241 | barMoment k (f + g) = barMoment k f + barMoment k g := by |
| 242 | funext n p |
| 243 | change barMoment k (f + g) n p = barMoment k f n p + barMoment k g n p |
| 244 | have he : PressureStream.torusAverage ((f + g) n) = |
| 245 | fun q => PressureStream.torusAverage (f n) q + PressureStream.torusAverage (g n) q := by |
| 246 | funext q |
| 247 | exact torusAverage_add (hf.smooth n).continuous (hg.smooth n).continuous q |
| 248 | simp only [barMoment_apply, he, mul_add] |
| 249 | exact integral_add (hf.barIntegrable k n p) (hg.barIntegrable k n p) |
| 250 | |
| 251 | theorem barMoment_sub {a b : ℝ} {f g : ScalarField (Point P)} |
| 252 | (hf : Shell a b f) (hg : Shell a b g) (k : ℕ) : |
| 253 | barMoment k (f - g) = barMoment k f - barMoment k g := by |
| 254 | funext n p |
| 255 | change barMoment k (f - g) n p = barMoment k f n p - barMoment k g n p |
| 256 | have he : PressureStream.torusAverage ((f - g) n) = |
| 257 | fun q => PressureStream.torusAverage (f n) q - PressureStream.torusAverage (g n) q := by |
| 258 | funext q |
| 259 | exact PressureStream.torusAverage_sub (hf.smooth n).continuous (hg.smooth n).continuous q |
| 260 | simp only [barMoment_apply, he, mul_sub] |
| 261 | exact integral_sub (hf.barIntegrable k n p) (hg.barIntegrable k n p) |
| 262 | |
| 263 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 264 | theorem barMoment_smul (c : ℝ) (f : ScalarField (Point P)) (k : ℕ) : |
| 265 | barMoment k (c • f) = c • barMoment k f := by |
| 266 | funext n p |
| 267 | change PressureStream.pressureMass (fun x => x.1 ^ k * (c * f n x)) p = |
| 268 | c * PressureStream.pressureMass (fun x => x.1 ^ k * f n x) p |
| 269 | have he : (fun x : Point P => x.1 ^ k * (c * f n x)) = |
| 270 | (fun x => c * (x.1 ^ k * f n x)) := by funext x; ring |
| 271 | rw [he] |
| 272 | simp only [PressureStream.pressureMass, PressureStream.torusAverage, PressureStream.torusInner, |
| 273 | intervalIntegral.integral_const_mul, integral_const_mul] |
| 274 | |
| 275 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 276 | @[simp] theorem barMoment_zero (k : ℕ) : barMoment k (0 : ScalarField (Point P)) = 0 := by |
| 277 | funext n p |
| 278 | simp [barMoment, CorrectionState.radialMoment, PressureStream.pressureMass, |
| 279 | PressureStream.torusAverage, PressureStream.torusInner] |
| 280 | |
| 281 | theorem barMoment_mem |
| 282 | {a b cL cR : ℝ} (ha : 0 < a) (hab : a < b) (hcL : 0 < cL) (hcR : 0 < cR) |
| 283 | (ε S : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hεone : ∀ n, ε n ≤ 1) |
| 284 | (hS : ∀ n, 1 ≤ S n) {α : ℝ} {f : ScalarField (Point P)} |
| 285 | (hf : Shell a b f) |
| 286 | (hclass : MeanClass |
| 287 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS) α f) |
| 288 | (k : ℕ) : |
| 289 | UnweightedClass (MeanMomentBounds.slowStripData (D := P) ε S hε hεone hS) α (barMoment k f) := by |
| 290 | have h := MeanMomentBounds.meanClass_radialMoment ha hab hcL hcR ε S hε hεone hS |
| 291 | hf.smooth hf.supported hclass k |
| 292 | have he : barMoment k f = fun n => |
| 293 | IntegratedMeanBalances.radialMoment k (PressureStream.torusAverage (f n)) := by |
| 294 | funext n p |
| 295 | exact barMoment_apply k f n p |
| 296 | rw [he] |
| 297 | exact h |
| 298 | |
| 299 | /-! ## Literal changes, linear rows, and explicit nonlinear remainders -/ |
| 300 | |
| 301 | noncomputable def thetaLeading (base h : Triple (Point P)) : ScalarField (Point P) := |
| 302 | base.axial * h.angular + base.angular * h.axial |
| 303 | |
| 304 | noncomputable def axialLeading (base h : Triple (Point P)) : ScalarField (Point P) := |
| 305 | (2 : ℝ) • (base.axial * h.axial) |
| 306 | |
| 307 | noncomputable def thetaQuadratic (m h : Triple (Point P)) : ScalarField (Point P) := |
| 308 | m.axial * h.angular + h.axial * m.angular + h.axial * h.angular |
| 309 | |
| 310 | noncomputable def axialQuadratic (m h : Triple (Point P)) : ScalarField (Point P) := |
| 311 | (2 : ℝ) • (m.axial * h.axial) + h.axial * h.axial |
| 312 | |
| 313 | /-- This is the actual source difference minus the centrifugal linear row; |
| 314 | its formula and class are proved from equation (32). -/ |
| 315 | noncomputable def actualRadialError (o : Operators (Point P)) (base m h : Triple (Point P)) |
| 316 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ScalarField (Point P) := |
| 317 | gr o base (updated m h) W - gr o base m W - leadingRadial o base h |
| 318 | |
| 319 | noncomputable def pressureDefect (o : Operators (Point P)) (base m : Triple (Point P)) |
| 320 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ScalarField P := barMoment 0 (gr o base m W) |
| 321 | |
| 322 | noncomputable def thetaDefect (base m : Triple (Point P)) |
| 323 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ScalarField P := |
| 324 | barMoment 2 (thetaAxial base m + W 2 1) |
| 325 | |
| 326 | noncomputable def axialDefect (o : Operators (Point P)) (base m : Triple (Point P)) |
| 327 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ScalarField P := |
| 328 | barMoment 1 (axialAxial base m + W 2 2) - (1 / 2 : ℝ) • barMoment 2 (gr o base m W) |
| 329 | |
| 330 | noncomputable def defects (o : Operators (Point P)) (base m : Triple (Point P)) |
| 331 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ℕ → P → Fin 3 → ℝ := |
| 332 | fun n p => ![pressureDefect o base m W n p, thetaDefect base m W n p, |
| 333 | axialDefect o base m W n p] |
| 334 | |
| 335 | noncomputable def linearRows (o : Operators (Point P)) (base h : Triple (Point P)) : |
| 336 | ℕ → P → Fin 3 → ℝ := fun n p => |
| 337 | ![barMoment 0 (leadingRadial o base h) n p, |
| 338 | barMoment 2 (thetaLeading base h) n p, |
| 339 | barMoment 1 (axialLeading base h) n p - (1 / 2) * barMoment 2 (leadingRadial o base h) n p] |
| 340 | |
| 341 | noncomputable def remainders (o : Operators (Point P)) (base m h : Triple (Point P)) |
| 342 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ℕ → P → Fin 3 → ℝ := fun n p => |
| 343 | ![barMoment 0 (actualRadialError o base m h W) n p, |
| 344 | barMoment 2 (thetaQuadratic m h) n p, |
| 345 | barMoment 1 (axialQuadratic m h) n p - |
| 346 | (1 / 2) * barMoment 2 (actualRadialError o base m h W) n p] |
| 347 | |
| 348 | theorem thetaQuadratic_shell {a b : ℝ} {m h : Triple (Point P)} |
| 349 | (hm : ShellTriple a b m) (hh : ShellTriple a b h) : Shell a b (thetaQuadratic m h) := |
| 350 | ((hm.axial.mul hh.angular).add (hh.axial.mul hm.angular)).add (hh.axial.mul hh.angular) |
| 351 | |
| 352 | theorem axialQuadratic_shell {a b : ℝ} {m h : Triple (Point P)} |
| 353 | (hm : ShellTriple a b m) (hh : ShellTriple a b h) : Shell a b (axialQuadratic m h) := |
| 354 | ((hm.axial.mul hh.axial).smul 2).add (hh.axial.mul hh.axial) |
| 355 | |
| 356 | theorem thetaLeading_shell {a b : ℝ} (ha : 0 < a) {base h : Triple (Point P)} |
| 357 | (hb : SmoothTriple positiveDomain base) (hh : ShellTriple a b h) : |
| 358 | Shell a b (thetaLeading base h) := |
| 359 | (hh.angular.coefficient_mul ha hb.axial).add (hh.axial.coefficient_mul ha hb.angular) |
| 360 | |
| 361 | theorem axialLeading_shell {a b : ℝ} (ha : 0 < a) {base h : Triple (Point P)} |
| 362 | (hb : SmoothTriple positiveDomain base) (hh : ShellTriple a b h) : |
| 363 | Shell a b (axialLeading base h) := (hh.axial.coefficient_mul ha hb.axial).smul 2 |
| 364 | |
| 365 | theorem actualRadialError_shell {a b : ℝ} (ha : 0 < a) {o : Operators (Point P)} |
| 366 | (ho : PositiveOperators o) {base m h : Triple (Point P)} |
| 367 | (hb : SmoothTriple positiveDomain base) (hm : ShellTriple a b m) (hh : ShellTriple a b h) |
| 368 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) (hW : ∀ i j, Shell a b (W i j)) : |
| 369 | Shell a b (actualRadialError o base m h W) := |
| 370 | ((gr_shell ha hb (hm.updated hh) ho W hW).sub |
| 371 | (gr_shell ha hb hm ho W hW)).sub (leadingRadial_shell ha hb hh ho) |
| 372 | |
| 373 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 374 | theorem thetaAxial_update_split (base m h : Triple (Point P)) |
| 375 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) : |
| 376 | thetaAxial base (updated m h) + W 2 1 = |
| 377 | (thetaAxial base m + W 2 1) + thetaLeading base h + thetaQuadratic m h := by |
| 378 | ext n x |
| 379 | simp only [thetaAxial, updated, thetaLeading, thetaQuadratic, Pi.add_apply, Pi.mul_apply] |
| 380 | ring |
| 381 | |
| 382 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 383 | theorem axialAxial_update_split (base m h : Triple (Point P)) |
| 384 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) : |
| 385 | axialAxial base (updated m h) + W 2 2 = |
| 386 | (axialAxial base m + W 2 2) + axialLeading base h + axialQuadratic m h := by |
| 387 | ext n x |
| 388 | simp only [axialAxial, updated, axialLeading, axialQuadratic, Pi.add_apply, Pi.mul_apply, |
| 389 | Pi.smul_apply, smul_eq_mul] |
| 390 | ring |
| 391 | |
| 392 | theorem radial_update_split (o : Operators (Point P)) (base m h : Triple (Point P)) |
| 393 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) : |
| 394 | gr o base (updated m h) W = |
| 395 | gr o base m W + leadingRadial o base h + actualRadialError o base m h W := by |
| 396 | unfold actualRadialError |
| 397 | abel |
| 398 | |
| 399 | /-- The complete equation-(32) remainder: slow/fast time, radial transport, |
| 400 | axial transport, old/new angular products, and viscosity are retained. -/ |
| 401 | theorem actualRadialError_eq_formula {U : Set (Point P)} (hU : IsOpen U) |
| 402 | (o : Operators (Point P)) (ha : ContDiffOn ℝ ∞ o.radialProfile U) |
| 403 | {base m h : Triple (Point P)} (hb : SmoothTriple U base) |
| 404 | (hm : SmoothTriple U m) (hh : SmoothTriple U h) |
| 405 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) (hW : ∀ i j, SmoothOn U (W i j)) : |
| 406 | Agree U (actualRadialError o base m h W) (radialRemainder o base m h) := by |
| 407 | intro n x hx |
| 408 | have he := gr_change hU o ha hb hm hh W hW n hx |
| 409 | simp only [actualRadialError, Pi.add_apply, Pi.sub_apply] at he ⊢ |
| 410 | linarith |
| 411 | |
| 412 | section RemainderClasses |
| 413 | |
| 414 | variable {s : StripData (Point P)} {o : Operators (Point P)} {κ H : ℝ} |
| 415 | {base m h : Triple (Point P)} (ho : OperatorBounds s o κ) |
| 416 | (hb : BaseBounds s base) (hm : CumulativeBounds s m) (hh : IncrementBounds s H h) |
| 417 | (hH : 9 / 10 ≤ H) |
| 418 | |
| 419 | include ho hm hh hH in |
| 420 | theorem thetaQuadratic_mem : MeanClass s (H + 9 / 10 - 2 * κ) (thetaQuadratic m h) := by |
| 421 | have h1 : MeanClass s (H + 9 / 10) (m.axial * h.angular) := by |
| 422 | simpa only [add_comm] using Class.product hm.axial hh.angular ho.weight_le_one |
| 423 | have h2 := Class.product hh.axial hm.angular ho.weight_le_one |
| 424 | have h3 := (Class.product hh.axial hh.angular ho.weight_le_one).mono_exponent |
| 425 | (show H + 9 / 10 ≤ H + H from by linarith) |
| 426 | exact ((h1.add h2).add h3).mono_exponent (by linarith [ho.kappa_nonneg]) |
| 427 | |
| 428 | include ho hm hh hH in |
| 429 | theorem axialQuadratic_mem : MeanClass s (H + 9 / 10 - 2 * κ) (axialQuadratic m h) := by |
| 430 | have h1 : MeanClass s (H + 9 / 10) ((2 : ℝ) • (m.axial * h.axial)) := by |
| 431 | simpa only [add_comm] using Class.smul (Class.product hm.axial hh.axial ho.weight_le_one) 2 |
| 432 | have h2 := (Class.product hh.axial hh.axial ho.weight_le_one).mono_exponent |
| 433 | (show H + 9 / 10 ≤ H + H from by linarith) |
| 434 | exact (h1.add h2).mono_exponent (by linarith [ho.kappa_nonneg]) |
| 435 | |
| 436 | include ho hb hm hh hH in |
| 437 | theorem actualRadialError_mem |
| 438 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) (hW : ∀ i j, SmoothOn s.domain (W i j)) : |
| 439 | MeanClass s (H + 9 / 10 - 2 * κ) (actualRadialError o base m h W) := |
| 440 | gr_change_sub_leading_mem ho hb hm hh hH W hW |
| 441 | |
| 442 | end RemainderClasses |
| 443 | |
| 444 | section ExactMoments |
| 445 | |
| 446 | variable {a b : ℝ} (ha : 0 < a) {o : Operators (Point P)} (hop : PositiveOperators o) |
| 447 | {base m h : Triple (Point P)} (hb : SmoothTriple positiveDomain base) |
| 448 | (hm : ShellTriple a b m) (hh : ShellTriple a b h) |
| 449 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) (hW : ∀ i j, Shell a b (W i j)) |
| 450 | |
| 451 | include ha hop hb hm hh hW in |
| 452 | theorem pressureDefect_update : |
| 453 | pressureDefect o base (updated m h) W = pressureDefect o base m W + |
| 454 | barMoment 0 (leadingRadial o base h) + barMoment 0 (actualRadialError o base m h W) := by |
| 455 | have h0 := gr_shell ha hb hm hop W hW |
| 456 | have hl := leadingRadial_shell ha hb hh hop |
| 457 | have hr := actualRadialError_shell ha hop hb hm hh W hW |
| 458 | unfold pressureDefect |
| 459 | rw [radial_update_split, barMoment_add (h0.add hl) hr, barMoment_add h0 hl] |
| 460 | |
| 461 | include ha hb hm hh hW in |
| 462 | theorem thetaDefect_update : |
| 463 | thetaDefect base (updated m h) W = thetaDefect base m W + |
| 464 | barMoment 2 (thetaLeading base h) + barMoment 2 (thetaQuadratic m h) := by |
| 465 | have h0 := (thetaAxial_shell ha hb hm).add (hW 2 1) |
| 466 | have hl := thetaLeading_shell ha hb hh |
| 467 | have hr := thetaQuadratic_shell hm hh |
| 468 | unfold thetaDefect |
| 469 | rw [thetaAxial_update_split, barMoment_add (h0.add hl) hr, barMoment_add h0 hl] |
| 470 | |
| 471 | include ha hop hb hm hh hW in |
| 472 | theorem axialDefect_update : |
| 473 | axialDefect o base (updated m h) W = axialDefect o base m W + |
| 474 | (barMoment 1 (axialLeading base h) - (1 / 2 : ℝ) • barMoment 2 (leadingRadial o base h)) + |
| 475 | (barMoment 1 (axialQuadratic m h) - |
| 476 | (1 / 2 : ℝ) • barMoment 2 (actualRadialError o base m h W)) := by |
| 477 | have hz0 := (axialAxial_shell ha hb hm).add (hW 2 2) |
| 478 | have hzl := axialLeading_shell ha hb hh |
| 479 | have hzr := axialQuadratic_shell hm hh |
| 480 | have hr0 := gr_shell ha hb hm hop W hW |
| 481 | have hrl := leadingRadial_shell ha hb hh hop |
| 482 | have hrr := actualRadialError_shell ha hop hb hm hh W hW |
| 483 | unfold axialDefect |
| 484 | rw [axialAxial_update_split, radial_update_split, |
| 485 | barMoment_add (hz0.add hzl) hzr, barMoment_add hz0 hzl, |
| 486 | barMoment_add (hr0.add hrl) hrr, barMoment_add hr0 hrl] |
| 487 | simp only [smul_add] |
| 488 | abel |
| 489 | |
| 490 | include ha hop hb hm hh hW in |
| 491 | /-- Every defect changes by the exact row (35) and its explicitly computed |
| 492 | remainder. No estimate or cancellation is a premise of this identity. -/ |
| 493 | theorem defects_update : |
| 494 | defects o base (updated m h) W = |
| 495 | defects o base m W + linearRows o base h + remainders o base m h W := by |
| 496 | have hp := pressureDefect_update ha hop hb hm hh W hW |
| 497 | have ht := thetaDefect_update ha hb hm hh W hW |
| 498 | have hz := axialDefect_update ha hop hb hm hh W hW |
| 499 | funext n p i |
| 500 | fin_cases i <;> |
| 501 | simp [defects, linearRows, remainders, hp, ht, hz, Pi.add_apply, Pi.sub_apply, smul_eq_mul] |
| 502 | |
| 503 | include ha hop hb hm hh hW in |
| 504 | theorem defects_after_solved_rows |
| 505 | (hrows : linearRows o base h = -defects o base m W) : |
| 506 | defects o base (updated m h) W = remainders o base m h W := by |
| 507 | rw [defects_update ha hop hb hm hh W hW, hrows] |
| 508 | simp |
| 509 | |
| 510 | end ExactMoments |
| 511 | |
| 512 | theorem unweighted_sub {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] |
| 513 | {s : StripData D} {α : ℝ} {f g : ScalarField D} |
| 514 | (hf : UnweightedClass s α f) (hg : UnweightedClass s α g) : |
| 515 | UnweightedClass s α (f - g) := by |
| 516 | have hn : UnweightedClass s α (-g) := by |
| 517 | exact hg.map (-ContinuousLinearMap.id ℝ ℝ) |
| 518 | simp only [sub_eq_add_neg] |
| 519 | exact hf.add hn |
| 520 | |
| 521 | theorem unweighted_smul {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] |
| 522 | {s : StripData D} {α : ℝ} {f : ScalarField D} |
| 523 | (hf : UnweightedClass s α f) (c : ℝ) : UnweightedClass s α (c • f) := by |
| 524 | exact hf.map (c • ContinuousLinearMap.id ℝ ℝ) |
| 525 | |
| 526 | section IntegratedBounds |
| 527 | |
| 528 | variable {a b cL cR : ℝ} (ha : 0 < a) (hab : a < b) (hcL : 0 < cL) (hcR : 0 < cR) |
| 529 | (ε S : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hεone : ∀ n, ε n ≤ 1) (hS : ∀ n, 1 ≤ S n) |
| 530 | {o : Operators (Point P)} {κ H : ℝ} {base m h : Triple (Point P)} |
| 531 | (hop : PositiveOperators o) (hbs : SmoothTriple positiveDomain base) |
| 532 | (hms : ShellTriple a b m) (hhs : ShellTriple a b h) |
| 533 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) (hW : ∀ i j, Shell a b (W i j)) |
| 534 | |
| 535 | variable (ho : OperatorBounds |
| 536 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS) o κ) |
| 537 | (hb : BaseBounds |
| 538 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS) base) |
| 539 | (hm : CumulativeBounds |
| 540 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS) m) |
| 541 | (hh : IncrementBounds |
| 542 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS) H h) |
| 543 | (hH : 9 / 10 ≤ H) |
| 544 | |
| 545 | include ha hab hcL hcR hop hbs hms hhs hW ho hb hm hh hH in |
| 546 | /-- The remainder bound is derived from the primitive mean classes and the |
| 547 | literal equation-(32) source, then integrated by the actual moment map. -/ |
| 548 | theorem remainders_mem (i : Fin 3) : |
| 549 | UnweightedClass (MeanMomentBounds.slowStripData (D := P) ε S hε hεone hS) (H + 9 / 10 - 2 * κ) |
| 550 | (fun n p => remainders o base m h W n p i) := by |
| 551 | have hrc := actualRadialError_mem ho hb hm hh hH W |
| 552 | (fun i j => (hW i j).smoothOn |
| 553 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS).domain) |
| 554 | have hrs := actualRadialError_shell ha hop hbs hms hhs W hW |
| 555 | have hr0 := barMoment_mem ha hab hcL hcR ε S hε hεone hS hrs hrc 0 |
| 556 | have hr2 := barMoment_mem ha hab hcL hcR ε S hε hεone hS hrs hrc 2 |
| 557 | have ht := barMoment_mem ha hab hcL hcR ε S hε hεone hS |
| 558 | (thetaQuadratic_shell hms hhs) (thetaQuadratic_mem ho hm hh hH) 2 |
| 559 | have hz := barMoment_mem ha hab hcL hcR ε S hε hεone hS |
| 560 | (axialQuadratic_shell hms hhs) (axialQuadratic_mem ho hm hh hH) 1 |
| 561 | fin_cases i |
| 562 | · exact hr0 |
| 563 | · exact ht |
| 564 | · exact unweighted_sub hz (unweighted_smul hr2 (1 / 2)) |
| 565 | |
| 566 | include ha hab hcL hcR hop hbs hms hhs hW ho hb hm hh hH in |
| 567 | theorem defects_after_rank_mem |
| 568 | (hrows : linearRows o base h = -defects o base m W) (i : Fin 3) : |
| 569 | UnweightedClass (MeanMomentBounds.slowStripData (D := P) ε S hε hεone hS) (H + 9 / 10 - 2 * κ) |
| 570 | (fun n p => defects o base (updated m h) W n p i) := by |
| 571 | rw [defects_after_solved_rows ha hop hbs hms hhs W hW hrows] |
| 572 | exact remainders_mem ha hab hcL hcR ε S hε hεone hS hop hbs hms hhs W hW ho hb hm hh hH i |
| 573 | |
| 574 | end IntegratedBounds |
| 575 | |
| 576 | /-! ## Identification with the five solved rows and both exact masses -/ |
| 577 | |
| 578 | noncomputable def slowSlice (f : ScalarField (Point P)) (n : ℕ) (p : P) (r : ℝ) : ℝ := |
| 579 | f n (r, (p, 0)) |
| 580 | |
| 581 | noncomputable def IsSlow (f : ScalarField (Point P)) : Prop := |
| 582 | ∀ n r p Y, f n (r, (p, Y)) = slowSlice f n p r |
| 583 | |
| 584 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 585 | theorem IsSlow.add {f g : ScalarField (Point P)} (hf : IsSlow f) (hg : IsSlow g) : |
| 586 | IsSlow (f + g) := by |
| 587 | intro n r p Y |
| 588 | simp only [Pi.add_apply, slowSlice, hf n r p Y, hg n r p Y] |
| 589 | |
| 590 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 591 | theorem IsSlow.mul {f g : ScalarField (Point P)} (hf : IsSlow f) (hg : IsSlow g) : |
| 592 | IsSlow (f * g) := by |
| 593 | intro n r p Y |
| 594 | simp only [Pi.mul_apply, slowSlice, hf n r p Y, hg n r p Y] |
| 595 | |
| 596 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 597 | theorem IsSlow.smul {f : ScalarField (Point P)} (hf : IsSlow f) (c : ℝ) : IsSlow (c • f) := by |
| 598 | intro n r p Y |
| 599 | simp only [Pi.smul_apply, smul_eq_mul, slowSlice, hf n r p Y] |
| 600 | |
| 601 | theorem PositiveOperators.invRadius_slow {o : Operators (Point P)} (ho : PositiveOperators o) : |
| 602 | IsSlow o.invRadius := by |
| 603 | intro n r p Y |
| 604 | simp only [Operators.invRadius, slowSlice, ho.radius_eq] |
| 605 | |
| 606 | omit [NormedAddCommGroup P] [NormedSpace ℝ P] in |
| 607 | theorem barMoment_slow {f : ScalarField (Point P)} (hf : IsSlow f) (k n : ℕ) (p : P) : |
| 608 | barMoment k f n p = ∫ r, r ^ k * slowSlice f n p r := by |
| 609 | rw [barMoment_apply] |
| 610 | apply integral_congr_ae |
| 611 | filter_upwards [] with r |
| 612 | congr 1 |
| 613 | simp [PressureStream.torusAverage, PressureStream.torusInner, hf n r p] |
| 614 | |
| 615 | theorem Shell.sliceIntegrable {a b : ℝ} {f : ScalarField (Point P)} (hf : Shell a b f) |
| 616 | (k n : ℕ) (p : P) : Integrable (fun r => r ^ k * slowSlice f n p r) := |
| 617 | IntegratedMeanBalances.weighted_integrable |
| 618 | ((hf.smooth n).continuous.comp (continuous_id.prodMk continuous_const)) |
| 619 | (IntegratedMeanBalances.radial_slice_compact (hf.supported n) (p, 0)) k |
| 620 | |
| 621 | theorem fiveRows_mass_zero {o : Operators (Point P)} {base m h : Triple (Point P)} |
| 622 | {W : Fin 3 → Fin 3 → ScalarField (Point P)} |
| 623 | (hv : IsSlow h.angular) (hg : IsSlow h.axial) |
| 624 | (hrows : ∀ n p, FiveRowRank.FiveRows (slowSlice base.angular n p) (slowSlice base.axial n p) |
| 625 | (defects o base m W n p) (slowSlice h.angular n p) (slowSlice h.axial n p)) : |
| 626 | barMoment 2 h.angular = 0 ∧ barMoment 1 h.axial = 0 := by |
| 627 | constructor |
| 628 | · funext n p |
| 629 | rw [barMoment_slow hv] |
| 630 | exact (hrows n p).1 |
| 631 | · funext n p |
| 632 | rw [barMoment_slow hg] |
| 633 | simpa only [pow_one, Pi.zero_apply] using (hrows n p).2.1 |
| 634 | |
| 635 | theorem fiveRows_preserve_masses {a b : ℝ} {o : Operators (Point P)} |
| 636 | {base m h : Triple (Point P)} {W : Fin 3 → Fin 3 → ScalarField (Point P)} |
| 637 | (hm : ShellTriple a b m) (hh : ShellTriple a b h) |
| 638 | (hv : IsSlow h.angular) (hg : IsSlow h.axial) |
| 639 | (hrows : ∀ n p, FiveRowRank.FiveRows (slowSlice base.angular n p) (slowSlice base.axial n p) |
| 640 | (defects o base m W n p) (slowSlice h.angular n p) (slowSlice h.axial n p)) : |
| 641 | barMoment 2 (updated m h).angular = barMoment 2 m.angular ∧ |
| 642 | barMoment 1 (updated m h).axial = barMoment 1 m.axial := by |
| 643 | obtain ⟨hzv, hzg⟩ := fiveRows_mass_zero hv hg hrows |
| 644 | change barMoment 2 (m.angular + h.angular) = _ ∧ barMoment 1 (m.axial + h.axial) = _ |
| 645 | rw [barMoment_add hm.angular hh.angular, barMoment_add hm.axial hh.axial, hzv, hzg] |
| 646 | simp |
| 647 | |
| 648 | /-- The three moment rows are exactly those solved in (35), including the |
| 649 | minus sign and factor one half in the axial pressure moment. -/ |
| 650 | theorem linearRows_eq_neg_of_fiveRows {a b : ℝ} (ha : 0 < a) |
| 651 | {o : Operators (Point P)} (hop : PositiveOperators o) {base m h : Triple (Point P)} |
| 652 | (hb : SmoothTriple positiveDomain base) (hh : ShellTriple a b h) |
| 653 | (hV : IsSlow base.angular) (hG : IsSlow base.axial) |
| 654 | (hv : IsSlow h.angular) (hg : IsSlow h.axial) |
| 655 | (W : Fin 3 → Fin 3 → ScalarField (Point P)) |
| 656 | (hrows : ∀ n p, FiveRowRank.FiveRows (slowSlice base.angular n p) (slowSlice base.axial n p) |
| 657 | (defects o base m W n p) (slowSlice h.angular n p) (slowSlice h.axial n p)) : |
| 658 | linearRows o base h = -defects o base m W := by |
| 659 | have hrslow : IsSlow (leadingRadial o base h) := |
| 660 | hop.invRadius_slow.mul ((hV.mul hv).smul 2) |
| 661 | have htslow : IsSlow (thetaLeading base h) := (hG.mul hv).add (hV.mul hg) |
| 662 | have hzslow : IsSlow (axialLeading base h) := (hG.mul hg).smul 2 |
| 663 | have hrs := leadingRadial_shell ha hb hh hop |
| 664 | have hzs := axialLeading_shell ha hb hh |
| 665 | funext n p i |
| 666 | fin_cases i |
| 667 | · change barMoment 0 (leadingRadial o base h) n p = -(defects o base m W n p 0) |
| 668 | rw [barMoment_slow hrslow] |
| 669 | calc |
| 670 | _ = ∫ r, (2 * slowSlice base.angular n p r / r) * slowSlice h.angular n p r := by |
| 671 | apply integral_congr_ae |
| 672 | filter_upwards [] with r |
| 673 | simp only [slowSlice, leadingRadial, Operators.invRadius, hop.radius_eq, |
| 674 | Pi.mul_apply, Pi.smul_apply, smul_eq_mul, pow_zero, one_mul, div_eq_mul_inv] |
| 675 | ring |
| 676 | _ = _ := (hrows n p).2.2.1 |
| 677 | · change barMoment 2 (thetaLeading base h) n p = -(defects o base m W n p 1) |
| 678 | rw [barMoment_slow htslow] |
| 679 | exact (hrows n p).2.2.2.1 |
| 680 | · change barMoment 1 (axialLeading base h) n p - |
| 681 | (1 / 2) * barMoment 2 (leadingRadial o base h) n p = -(defects o base m W n p 2) |
| 682 | rw [barMoment_slow hzslow, barMoment_slow hrslow] |
| 683 | calc |
| 684 | _ = ∫ r, r ^ (1 : ℕ) * slowSlice (axialLeading base h) n p r - |
| 685 | (1 / 2) * (r ^ (2 : ℕ) * slowSlice (leadingRadial o base h) n p r) := by |
| 686 | rw [integral_sub (hzs.sliceIntegrable 1 n p) ((hrs.sliceIntegrable 2 n p).const_mul (1 / 2)), |
| 687 | integral_const_mul] |
| 688 | _ = ∫ r, 2 * r * slowSlice base.axial n p r * slowSlice h.axial n p r - |
| 689 | r * slowSlice base.angular n p r * slowSlice h.angular n p r := by |
| 690 | apply integral_congr_ae |
| 691 | filter_upwards [] with r |
| 692 | simp only [slowSlice, axialLeading, leadingRadial, Operators.invRadius, hop.radius_eq, |
| 693 | Pi.mul_apply, Pi.smul_apply, smul_eq_mul, pow_one] |
| 694 | by_cases hr : r = 0 |
| 695 | · simp [hr] |
| 696 | · field_simp |
| 697 | _ = _ := (hrows n p).2.2.2.2 |
| 698 | |
| 699 | /-! ## The actual constructed `CorrectionState.rankStage` -/ |
| 700 | |
| 701 | theorem defects_eq_stateDebt (c : CorrectionState.Context (Point P)) |
| 702 | (u : CorrectionState.State (Point P)) : |
| 703 | defects c.operators c.base u.mean u.covariance = CorrectionState.debt c u := rfl |
| 704 | |
| 705 | theorem rankStage_covariance (p : CorrectionState.ReconstructionData) (r : CorrectionState.RankData P) |
| 706 | (axial : P × PressureStream.Plane) (c : CorrectionState.Context (Point P)) |
| 707 | (u : CorrectionState.State (Point P)) : |
| 708 | (CorrectionState.rankStage p r axial c u).covariance = u.covariance := by |
| 709 | funext i j |
| 710 | change CorrectionState.bilinearCovariance (u.oscillation + 0) (u.oscillation + 0) i j = _ |
| 711 | rw [add_zero] |
| 712 | rfl |
| 713 | |
| 714 | theorem rankStage_debt_eq (p : CorrectionState.ReconstructionData) (r : CorrectionState.RankData P) |
| 715 | (axial : P × PressureStream.Plane) (c : CorrectionState.Context (Point P)) |
| 716 | (u : CorrectionState.State (Point P)) : |
| 717 | CorrectionState.debt c (CorrectionState.rankStage p r axial c u) = |
| 718 | defects c.operators c.base |
| 719 | (updated u.mean (CorrectionState.rankIncrement p r axial c u)) u.covariance := by |
| 720 | rw [← defects_eq_stateDebt, rankStage_covariance] |
| 721 | rfl |
| 722 | |
| 723 | /-- Geometric and primitive regularity hypotheses for the constructed rank |
| 724 | patch. The conclusion is not among the fields: the inverse, actual stream, |
| 725 | five rows, and their cancellation are supplied by proved theorems. -/ |
| 726 | structure RankGeometry (p : CorrectionState.ReconstructionData) (r : CorrectionState.RankData P) |
| 727 | (c : CorrectionState.Context (Point P)) (u : CorrectionState.State (Point P)) : Prop where |
| 728 | primitive_inner_pos : 0 < p.inner |
| 729 | exponent_pos : 0 < p.exponent |
| 730 | lambda_pos : 0 < r.lambda |
| 731 | coefficient_ne : ∀ n x, r.coefficient n x ≠ 0 |
| 732 | inner_pos : 0 < r.inner |
| 733 | inner_lt_outer : r.inner < r.outer |
| 734 | length_pos : ∀ n x, 0 < r.length n x |
| 735 | velocity_ne : ∀ n x, r.velocity n x ≠ 0 |
| 736 | desired_smooth : ∀ n, ContDiff ℝ ∞ (CorrectionState.rankDesiredAxial r c u n) |
| 737 | desired_supported : ∀ n, RadialAlias.RadiallySupported p.inner p.outer |
| 738 | (CorrectionState.rankDesiredAxial r c u n) |
| 739 | angular_model : ∀ n x R, R ∈ Ioo (r.length n x * r.inner) (r.length n x * r.outer) → |
| 740 | c.base.angular n (R, (x, 0)) = |
| 741 | MeanRankUpdate.background r.lambda (r.coefficient n x) (r.length n x) (r.velocity n x) R |
| 742 | axial_model : ∀ n x R, R ∈ Ioo (r.length n x * r.inner) (r.length n x * r.outer) → |
| 743 | c.base.axial n (R, (x, 0)) = 0 |
| 744 | |
| 745 | theorem rankIncrement_angular_slow (p : CorrectionState.ReconstructionData) |
| 746 | (r : CorrectionState.RankData P) (axial : P × PressureStream.Plane) |
| 747 | (c : CorrectionState.Context (Point P)) (u : CorrectionState.State (Point P)) : |
| 748 | IsSlow (CorrectionState.rankIncrement p r axial c u).angular := by |
| 749 | intro n R x Y |
| 750 | rfl |
| 751 | |
| 752 | namespace RankGeometry |
| 753 | |
| 754 | variable {p : CorrectionState.ReconstructionData} {r : CorrectionState.RankData P} |
| 755 | {c : CorrectionState.Context (Point P)} {u : CorrectionState.State (Point P)} |
| 756 | (hg : RankGeometry p r c u) (axial : P × PressureStream.Plane) |
| 757 | |
| 758 | include hg |
| 759 | |
| 760 | theorem axial_exact (n : ℕ) (x : Point P) : |
| 761 | (CorrectionState.rankIncrement p r axial c u).axial n x = |
| 762 | CorrectionState.rankDesiredAxial r c u n (x.1, x.2.1) := |
| 763 | CorrectionState.rank_axial_eq_desired p r axial c u hg.primitive_inner_pos hg.exponent_pos n |
| 764 | hg.lambda_pos (hg.coefficient_ne n) hg.inner_pos hg.inner_lt_outer (hg.length_pos n) |
| 765 | (hg.velocity_ne n) (hg.desired_smooth n) (hg.desired_supported n) x |
| 766 | |
| 767 | theorem axial_slow : IsSlow (CorrectionState.rankIncrement p r axial c u).axial := by |
| 768 | intro n R x Y |
| 769 | change (CorrectionState.rankIncrement p r axial c u).axial n (R, (x, Y)) = |
| 770 | (CorrectionState.rankIncrement p r axial c u).axial n (R, (x, 0)) |
| 771 | rw [hg.axial_exact, hg.axial_exact] |
| 772 | |
| 773 | /-- These are the solved rows for the actual axial stream, not for an |
| 774 | unrealized desired increment. -/ |
| 775 | theorem fiveRows (n : ℕ) (x : P) : |
| 776 | FiveRowRank.FiveRows (slowSlice c.base.angular n x) (slowSlice c.base.axial n x) |
| 777 | (defects c.operators c.base u.mean u.covariance n x) |
| 778 | (slowSlice (CorrectionState.rankIncrement p r axial c u).angular n x) |
| 779 | (slowSlice (CorrectionState.rankIncrement p r axial c u).axial n x) := by |
| 780 | have hax : slowSlice (CorrectionState.rankIncrement p r axial c u).axial n x = |
| 781 | fun R => CorrectionState.rankDesiredAxial r c u n (R, x) := by |
| 782 | funext R |
| 783 | exact hg.axial_exact axial n (R, (x, 0)) |
| 784 | rw [hax] |
| 785 | exact CorrectionState.rank_rows_on_patch r c u n x 0 hg.lambda_pos (hg.coefficient_ne n x) |
| 786 | hg.inner_pos hg.inner_lt_outer (hg.length_pos n x) (hg.velocity_ne n x) |
| 787 | (hg.angular_model n x) (hg.axial_model n x) |
| 788 | |
| 789 | theorem solved_rows {a b : ℝ} (ha : 0 < a) (hop : PositiveOperators c.operators) |
| 790 | (hb : SmoothTriple positiveDomain c.base) |
| 791 | (hh : ShellTriple a b (CorrectionState.rankIncrement p r axial c u)) |
| 792 | (hV : IsSlow c.base.angular) (hG : IsSlow c.base.axial) : |
| 793 | linearRows c.operators c.base (CorrectionState.rankIncrement p r axial c u) = |
| 794 | -defects c.operators c.base u.mean u.covariance := |
| 795 | linearRows_eq_neg_of_fiveRows ha hop hb hh hV hG |
| 796 | (rankIncrement_angular_slow p r axial c u) (hg.axial_slow axial) |
| 797 | u.covariance (hg.fiveRows axial) |
| 798 | |
| 799 | theorem preserve_masses {a b : ℝ} (hm : ShellTriple a b u.mean) |
| 800 | (hh : ShellTriple a b (CorrectionState.rankIncrement p r axial c u)) : |
| 801 | CorrectionState.radialMoment 2 (CorrectionState.rankStage p r axial c u).mean.angular = |
| 802 | CorrectionState.radialMoment 2 u.mean.angular ∧ |
| 803 | CorrectionState.radialMoment 1 (CorrectionState.rankStage p r axial c u).mean.axial = |
| 804 | CorrectionState.radialMoment 1 u.mean.axial := |
| 805 | fiveRows_preserve_masses hm hh (rankIncrement_angular_slow p r axial c u) |
| 806 | (hg.axial_slow axial) (hg.fiveRows axial) |
| 807 | |
| 808 | theorem zeroMasses {a b : ℝ} (hm : ShellTriple a b u.mean) |
| 809 | (hh : ShellTriple a b (CorrectionState.rankIncrement p r axial c u)) |
| 810 | (hzero : CorrectionState.ZeroMasses u) : |
| 811 | CorrectionState.ZeroMasses (CorrectionState.rankStage p r axial c u) := by |
| 812 | obtain ⟨hv, hz⟩ := hg.preserve_masses axial hm hh |
| 813 | exact ⟨hv.trans hzero.1, hz.trans hzero.2⟩ |
| 814 | |
| 815 | theorem debt_eq_remainders {a b : ℝ} (ha : 0 < a) (hop : PositiveOperators c.operators) |
| 816 | (hb : SmoothTriple positiveDomain c.base) (hm : ShellTriple a b u.mean) |
| 817 | (hh : ShellTriple a b (CorrectionState.rankIncrement p r axial c u)) |
| 818 | (hW : ∀ i j, Shell a b (u.covariance i j)) |
| 819 | (hV : IsSlow c.base.angular) (hG : IsSlow c.base.axial) : |
| 820 | CorrectionState.debt c (CorrectionState.rankStage p r axial c u) = |
| 821 | remainders c.operators c.base u.mean (CorrectionState.rankIncrement p r axial c u) |
| 822 | u.covariance := by |
| 823 | rw [rankStage_debt_eq] |
| 824 | exact defects_after_solved_rows ha hop hb hm hh u.covariance hW |
| 825 | (hg.solved_rows axial ha hop hb hh hV hG) |
| 826 | |
| 827 | end RankGeometry |
| 828 | |
| 829 | section ConstructedBounds |
| 830 | |
| 831 | variable {a b cL cR : ℝ} (ha : 0 < a) (hab : a < b) (hcL : 0 < cL) (hcR : 0 < cR) |
| 832 | (ε S : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hεone : ∀ n, ε n ≤ 1) (hS : ∀ n, 1 ≤ S n) |
| 833 | {p : CorrectionState.ReconstructionData} {r : CorrectionState.RankData P} |
| 834 | {c : CorrectionState.Context (Point P)} {u : CorrectionState.State (Point P)} |
| 835 | (axial : P × PressureStream.Plane) (hg : RankGeometry p r c u) |
| 836 | (hop : PositiveOperators c.operators) (hbs : SmoothTriple positiveDomain c.base) |
| 837 | (hms : ShellTriple a b u.mean) |
| 838 | (hhs : ShellTriple a b (CorrectionState.rankIncrement p r axial c u)) |
| 839 | (hW : ∀ i j, Shell a b (u.covariance i j)) |
| 840 | (hV : IsSlow c.base.angular) (hG : IsSlow c.base.axial) {κ H : ℝ} |
| 841 | (ho : OperatorBounds |
| 842 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS) c.operators κ) |
| 843 | (hb : BaseBounds |
| 844 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS) c.base) |
| 845 | (hm : CumulativeBounds |
| 846 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS) u.mean) |
| 847 | (hh : IncrementBounds |
| 848 | (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε S hε hεone hS) H |
| 849 | (CorrectionState.rankIncrement p r axial c u)) |
| 850 | (hH : 9 / 10 ≤ H) |
| 851 | |
| 852 | include ha hab hcL hcR axial hg hop hbs hms hhs hW hV hG ho hb hm hh hH in |
| 853 | /-- The constructed rank solve followed by actual pressure recomputation |
| 854 | has the claimed stronger defects. The inputs are primitive fields and their |
| 855 | classes; no solved-row, defect-remainder, or pressure-error estimate is assumed. -/ |
| 856 | theorem rankStage_defect_class (i : Fin 3) : |
| 857 | UnweightedClass (MeanMomentBounds.slowStripData (D := P) ε S hε hεone hS) |
| 858 | (H + 9 / 10 - 2 * κ) |
| 859 | (fun n x => CorrectionState.debt c (CorrectionState.rankStage p r axial c u) n x i) := by |
| 860 | rw [rankStage_debt_eq] |
| 861 | exact defects_after_rank_mem ha hab hcL hcR ε S hε hεone hS hop hbs hms hhs |
| 862 | u.covariance hW ho hb hm hh hH (hg.solved_rows axial ha hop hbs hhs hV hG) i |
| 863 | |
| 864 | include ha hab hcL hcR axial hg hop hbs hms hhs hW hV hG ho hb hm hh hH in |
| 865 | theorem rankStage_defectBounds {σ : ℝ} (hσ : 1 + σ ≤ H + 9 / 10 - 2 * κ) : |
| 866 | CorrectionState.DefectBounds (MeanMomentBounds.slowStripData (D := P) ε S hε hεone hS) σ c |
| 867 | (CorrectionState.rankStage p r axial c u) := by |
| 868 | intro i |
| 869 | exact (rankStage_defect_class ha hab hcL hcR ε S hε hεone hS axial hg hop hbs hms hhs hW |
| 870 | hV hG ho hb hm hh hH i).mono_exponent hσ |
| 871 | |
| 872 | end ConstructedBounds |
| 873 | |
| 874 | end |
| 875 | |
| 876 | end NavierStokes.DefectIncrementBounds |