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.SlowRecursion |
| 2 | import NavierStokes.PositiveOrderMoments |
| 3 | import NavierStokes.TransportPrimitive |
| 4 | import NavierStokes.SlowStressSupport |
| 5 | import NavierStokes.SlowResidualMatching |
| 6 | |
| 7 | /-! |
| 8 | # Globalization of the positive slow profiles |
| 9 | |
| 10 | The radial coordinate in this file is the physical similarity radius `R`, |
| 11 | so that `X = R² / 2`. Smoothness at the axis is represented by genuine |
| 12 | smooth even functions of the signed radius. Moment corrections are supported |
| 13 | in a fixed positive-radius patch and are reflected with the appropriate parity. |
| 14 | |
| 15 | All integrals and differential operators below are the actual ones. In |
| 16 | particular the preceding radial source is retained when pressure is recomputed. |
| 17 | -/ |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | open Set Filter Function MeasureTheory |
| 22 | open scoped ContDiff Topology BigOperators |
| 23 | |
| 24 | namespace NavierStokes.GlobalSlowProfiles |
| 25 | |
| 26 | abbrev Field := ℝ × ℝ → ℝ |
| 27 | abbrev History := ℕ → Field |
| 28 | abbrev region (S : Set ℝ) := (univ : Set ℝ) ×ˢ S |
| 29 | abbrev Smooth (S : Set ℝ) (f : Field) := ContDiffOn ℝ ∞ f (region S) |
| 30 | noncomputable def dr := ProfileHistories.radialPartial |
| 31 | noncomputable def de := ProfileHistories.parameterPartial |
| 32 | |
| 33 | structure Regular (S : Set ℝ) (f : Field) : Prop where |
| 34 | smooth : Smooth S f |
| 35 | even : ∀ eta ∈ S, ∀ R, f (-R, eta) = f (R, eta) |
| 36 | |
| 37 | theorem Regular.const (S : Set ℝ) (c : ℝ) : Regular S (fun _ => c) := |
| 38 | ⟨contDiffOn_const, fun _ _ _ => rfl⟩ |
| 39 | |
| 40 | theorem Regular.add {S : Set ℝ} {f g : Field} (hf : Regular S f) (hg : Regular S g) : |
| 41 | Regular S (f + g) := by |
| 42 | refine ⟨hf.smooth.add hg.smooth, ?_⟩ |
| 43 | intro eta heta R |
| 44 | change f (-R, eta) + g (-R, eta) = f (R, eta) + g (R, eta) |
| 45 | rw [hf.even eta heta, hg.even eta heta] |
| 46 | |
| 47 | theorem Regular.mul {S : Set ℝ} {f g : Field} (hf : Regular S f) (hg : Regular S g) : |
| 48 | Regular S (f * g) := by |
| 49 | refine ⟨hf.smooth.mul hg.smooth, ?_⟩ |
| 50 | intro eta heta R |
| 51 | change f (-R, eta) * g (-R, eta) = f (R, eta) * g (R, eta) |
| 52 | rw [hf.even eta heta, hg.even eta heta] |
| 53 | |
| 54 | noncomputable def regularAlgebra (S : Set ℝ) : Subalgebra ℝ Field where |
| 55 | carrier := {f | Regular S f} |
| 56 | zero_mem' := by exact Regular.const S 0 |
| 57 | one_mem' := by exact Regular.const S 1 |
| 58 | add_mem' := Regular.add |
| 59 | mul_mem' := Regular.mul |
| 60 | algebraMap_mem' := Regular.const S |
| 61 | |
| 62 | abbrev EvenProfile (S : Set ℝ) := ↥(regularAlgebra S) |
| 63 | |
| 64 | instance {S : Set ℝ} : CoeFun (EvenProfile S) (fun _ => Field) := ⟨fun f => f.1⟩ |
| 65 | |
| 66 | theorem EvenProfile.smooth {S : Set ℝ} (f : EvenProfile S) : Smooth S f := f.2.smooth |
| 67 | |
| 68 | theorem EvenProfile.even {S : Set ℝ} (f : EvenProfile S) {eta : ℝ} (heta : eta ∈ S) |
| 69 | (R : ℝ) : f (-R, eta) = f (R, eta) := f.2.even eta heta R |
| 70 | |
| 71 | theorem slice_smooth {S : Set ℝ} {f : Field} (hf : Smooth S f) |
| 72 | {eta : ℝ} (heta : eta ∈ S) : ContDiff ℝ ∞ (fun R => f (R, eta)) := by |
| 73 | apply contDiffOn_univ.mp |
| 74 | exact hf.comp (contDiffOn_id.prodMk contDiffOn_const) (fun _ _ => ⟨mem_univ _, heta⟩) |
| 75 | |
| 76 | @[simp] theorem add_apply {S : Set ℝ} (f g : EvenProfile S) (w : ℝ × ℝ) : |
| 77 | (f + g) w = f w + g w := rfl |
| 78 | @[simp] theorem mul_apply {S : Set ℝ} (f g : EvenProfile S) (w : ℝ × ℝ) : |
| 79 | (f * g) w = f w * g w := rfl |
| 80 | @[simp] theorem sub_apply {S : Set ℝ} (f g : EvenProfile S) (w : ℝ × ℝ) : |
| 81 | (f - g) w = f w - g w := rfl |
| 82 | @[simp] theorem neg_apply {S : Set ℝ} (f : EvenProfile S) (w : ℝ × ℝ) : |
| 83 | (-f) w = -f w := rfl |
| 84 | @[simp] theorem zero_apply {S : Set ℝ} (w : ℝ × ℝ) : (0 : EvenProfile S) w = 0 := rfl |
| 85 | @[simp] theorem one_apply {S : Set ℝ} (w : ℝ × ℝ) : (1 : EvenProfile S) w = 1 := rfl |
| 86 | |
| 87 | @[simp] theorem sum_apply {ι : Type*} {S : Set ℝ} (s : Finset ι) |
| 88 | (f : ι → EvenProfile S) (w : ℝ × ℝ) : (∑ i ∈ s, f i) w = ∑ i ∈ s, f i w := by |
| 89 | classical |
| 90 | induction s using Finset.induction_on with |
| 91 | | empty => simp |
| 92 | | @insert a s ha ih => simp only [Finset.sum_insert ha, add_apply, ih] |
| 93 | |
| 94 | noncomputable def constant (S : Set ℝ) (c : ℝ) : EvenProfile S := |
| 95 | algebraMap ℝ (EvenProfile S) c |
| 96 | |
| 97 | @[simp] theorem constant_apply (S : Set ℝ) (c : ℝ) (w : ℝ × ℝ) : constant S c w = c := rfl |
| 98 | |
| 99 | noncomputable def radiusSquared (S : Set ℝ) : EvenProfile S := |
| 100 | ⟨fun w => w.1 ^ 2 / 2, ⟨(contDiffOn_fst.pow 2).div_const 2, |
| 101 | fun _ _ _ => by simp only [neg_sq]⟩⟩ |
| 102 | |
| 103 | noncomputable def parameter (S : Set ℝ) : EvenProfile S := |
| 104 | ⟨Prod.snd, ⟨contDiffOn_snd, fun _ _ _ => rfl⟩⟩ |
| 105 | |
| 106 | noncomputable def inverse {S : Set ℝ} (f : EvenProfile S) |
| 107 | (hf : ∀ w ∈ region S, f w ≠ 0) : EvenProfile S := |
| 108 | ⟨fun w => (f w)⁻¹, ⟨f.smooth.inv hf, fun _ heta R => congrArg Inv.inv (f.even heta R)⟩⟩ |
| 109 | |
| 110 | theorem smooth_de {S : Set ℝ} (hS : IsOpen S) {f : Field} (hf : Smooth S f) : |
| 111 | Smooth S (de f) := |
| 112 | ProfileHistories.parameterPartial_smooth (PositiveOrderMoments.parameterDomain S hS) hf |
| 113 | |
| 114 | theorem parameter_derivative {S : Set ℝ} (hS : IsOpen S) {f : Field} (hf : Smooth S f) |
| 115 | {eta : ℝ} (heta : eta ∈ S) (R : ℝ) : |
| 116 | HasDerivAt (fun t => f (R, t)) (de f (R, eta)) eta := |
| 117 | ProfileHistories.parameterPartial_hasDerivAt (PositiveOrderMoments.parameterDomain S hS) |
| 118 | hf (p := (R, eta)) ⟨mem_univ _, heta⟩ |
| 119 | |
| 120 | noncomputable def etaDerivative {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) : |
| 121 | EvenProfile S := by |
| 122 | refine ⟨de f, ⟨smooth_de hS f.smooth, ?_⟩⟩ |
| 123 | intro eta heta R |
| 124 | have he : (fun t => f (-R, t)) =ᶠ[𝓝 eta] fun t => f (R, t) := by |
| 125 | filter_upwards [hS.mem_nhds heta] with t ht using f.even ht R |
| 126 | exact (parameter_derivative hS f.smooth heta (-R)).unique |
| 127 | ((parameter_derivative hS f.smooth heta R).congr_of_eventuallyEq he) |
| 128 | |
| 129 | /-- The genuine `X` derivative, smoothly continued through `R = 0`. -/ |
| 130 | noncomputable def xDerivative {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) : |
| 131 | EvenProfile S := |
| 132 | ⟨fun w => 2 * BoundaryAxisJets.radialJet f 1 w.1 w.2, ⟨ |
| 133 | contDiffOn_const.mul (BoundaryAxisJets.radialJet_joint_contDiffOn hS f.smooth 1), |
| 134 | fun _ heta R => congrArg (2 * ·) (BoundaryAxisJets.radialJet_even |
| 135 | (fun r => f.even heta r) 1 R)⟩⟩ |
| 136 | |
| 137 | theorem radius_mul_xDerivative {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) |
| 138 | {eta : ℝ} (heta : eta ∈ S) (R : ℝ) : |
| 139 | R * xDerivative hS f (R, eta) = dr f (R, eta) := by |
| 140 | have hi := EvenSmoothDescent.radialDerivative_identity (slice_smooth f.smooth heta) |
| 141 | (fun r => f.even heta r) R |
| 142 | have hd := ProfileHistories.radialPartial_hasDerivAt |
| 143 | (PositiveOrderMoments.parameterDomain S hS) f.smooth (p := (R, eta)) ⟨mem_univ _, heta⟩ |
| 144 | change R * xDerivative hS f (R, eta) = ProfileHistories.radialPartial f (R, eta) |
| 145 | rw [← hd.deriv] |
| 146 | simpa only [xDerivative, BoundaryAxisJets.radialJet, |
| 147 | EvenSmoothDescent.radialIterate_succ, EvenSmoothDescent.radialIterate_zero, |
| 148 | smul_eq_mul, mul_assoc, mul_left_comm] using hi |
| 149 | |
| 150 | /-- Literal `X`-only cutoff. The same two radii will be used at every order. -/ |
| 151 | noncomputable def coreCutoff (inner stop : ℝ) (w : ℝ × ℝ) : ℝ := |
| 152 | 1 - TransportPrimitive.cutoff inner stop (w.1 ^ 2 / 2) |
| 153 | |
| 154 | theorem coreCutoff_smooth (inner stop : ℝ) : ContDiff ℝ ∞ (coreCutoff inner stop) := |
| 155 | contDiff_const.sub ((TransportPrimitive.cutoff_contDiff inner stop).comp |
| 156 | ((contDiff_fst.pow 2).div_const 2)) |
| 157 | |
| 158 | theorem coreCutoff_one {inner stop : ℝ} (his : inner < stop) {w : ℝ × ℝ} |
| 159 | (hw : w.1 ^ 2 / 2 ≤ inner) : coreCutoff inner stop w = 1 := by |
| 160 | simp [coreCutoff, TransportPrimitive.cutoff_zero his hw] |
| 161 | |
| 162 | theorem coreCutoff_zero {inner stop : ℝ} (his : inner < stop) {w : ℝ × ℝ} |
| 163 | (hw : stop ≤ w.1 ^ 2 / 2) : coreCutoff inner stop w = 0 := by |
| 164 | simp [coreCutoff, TransportPrimitive.cutoff_one his hw] |
| 165 | |
| 166 | /-- A normalized mass average. There is no division by the radius. -/ |
| 167 | noncomputable def massAverage {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) : |
| 168 | EvenProfile S := by |
| 169 | refine ⟨fun w => 2 * ∫ t in (0 : ℝ)..1, t * f (t * w.1, w.2), ⟨?_, ?_⟩⟩ |
| 170 | · let G : (ℝ × ℝ) × ℝ → ℝ := fun w => w.2 * f (w.2 * w.1.1, w.1.2) |
| 171 | have hg : ContDiffOn ℝ ∞ G (region S ×ˢ univ) := |
| 172 | contDiffOn_snd.mul (f.smooth.comp |
| 173 | ((contDiffOn_snd.mul contDiffOn_fst.fst).prodMk contDiffOn_fst.snd) |
| 174 | (fun w hw => ⟨mem_univ _, hw.1.2⟩)) |
| 175 | exact contDiffOn_const.mul |
| 176 | (ParametricRephase.intervalIntegral_contDiffOn_of_joint G (region S) |
| 177 | (isOpen_univ.prod hS) hg 0 1 zero_le_one) |
| 178 | · intro eta heta R |
| 179 | congr 1 |
| 180 | apply intervalIntegral.integral_congr |
| 181 | intro t _ |
| 182 | change t * f (t * -R, eta) = t * f (t * R, eta) |
| 183 | rw [mul_neg, f.even heta] |
| 184 | |
| 185 | theorem massHistory_eq_massAverage {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) |
| 186 | (w : ℝ × ℝ) : |
| 187 | PositiveOrderMoments.massHistory f w = w.1 ^ 2 / 2 * massAverage hS f w := by |
| 188 | rw [PositiveOrderMoments.massHistory, ProfileHistories.primitive_eq_mul_average] |
| 189 | change w.1 * (∫ t in (0 : ℝ)..1, (t * w.1) * f (t * w.1, w.2)) = |
| 190 | w.1 ^ 2 / 2 * (2 * ∫ t in (0 : ℝ)..1, t * f (t * w.1, w.2)) |
| 191 | have he : (fun t : ℝ => (t * w.1) * f (t * w.1, w.2)) = |
| 192 | fun t => w.1 * (t * f (t * w.1, w.2)) := by funext t; ring |
| 193 | rw [he, intervalIntegral.integral_const_mul] |
| 194 | ring |
| 195 | |
| 196 | theorem parameterMassHistory_eq_massAverage {S : Set ℝ} (hS : IsOpen S) |
| 197 | (f : EvenProfile S) {w : ℝ × ℝ} (hw : w.2 ∈ S) : |
| 198 | PositiveOrderMoments.parameterMassHistory f w = |
| 199 | w.1 ^ 2 / 2 * massAverage hS (etaDerivative hS f) w := by |
| 200 | rw [← massHistory_eq_massAverage] |
| 201 | apply intervalIntegral.integral_congr |
| 202 | intro t _ |
| 203 | exact PositiveOrderMoments.weightedAxial_parameterPartial_on hS f.smooth hw |
| 204 | |
| 205 | structure Domain (S : Set ℝ) (h : ℝ) : Prop where |
| 206 | isOpen : IsOpen S |
| 207 | denominator : ∀ eta ∈ S, PositiveAxisSystem.ell h eta ≠ 0 |
| 208 | |
| 209 | noncomputable def inverseDenominator {S : Set ℝ} {h : ℝ} (d : Domain S h) : EvenProfile S := |
| 210 | inverse (1 - constant S (2 * h) * parameter S ^ 2) |
| 211 | (fun w hw => d.denominator w.2 hw.2) |
| 212 | |
| 213 | @[simp] theorem inverseDenominator_apply {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 214 | (w : ℝ × ℝ) : inverseDenominator d w = (PositiveAxisSystem.ell h w.2)⁻¹ := rfl |
| 215 | |
| 216 | /-- The normalized divergence reconstruction `V = X β`. -/ |
| 217 | noncomputable def betaFromU {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 218 | (lam : ℝ) (u : EvenProfile S) : EvenProfile S := |
| 219 | (constant S 2 * parameter S * u - |
| 220 | constant S (2 * (PositiveAxisSystem.dScale h + lam)) * parameter S * massAverage d.isOpen u - |
| 221 | (1 - parameter S ^ 2) * massAverage d.isOpen (etaDerivative d.isOpen u)) * |
| 222 | inverseDenominator d |
| 223 | |
| 224 | theorem betaFromU_eq_fluxHistory {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 225 | (lam : ℝ) (u : EvenProfile S) {w : ℝ × ℝ} (hw : w.2 ∈ S) : |
| 226 | w.1 ^ 2 / 2 * betaFromU d lam u w = PositiveOrderMoments.fluxHistory h lam u w := by |
| 227 | simp only [betaFromU, mul_apply, sub_apply, constant_apply, one_apply, |
| 228 | inverseDenominator_apply, PositiveOrderMoments.fluxHistory, |
| 229 | massHistory_eq_massAverage d.isOpen u, parameterMassHistory_eq_massAverage d.isOpen u hw] |
| 230 | change w.1 ^ 2 / 2 * ((2 * w.2 * u w - |
| 231 | 2 * (PositiveAxisSystem.dScale h + lam) * w.2 * massAverage d.isOpen u w - |
| 232 | (1 - w.2 ^ 2) * massAverage d.isOpen (etaDerivative d.isOpen u) w) * |
| 233 | (PositiveAxisSystem.ell h w.2)⁻¹) = _ |
| 234 | simp only [PositiveAxisSystem.edge, div_eq_mul_inv] |
| 235 | ring |
| 236 | |
| 237 | theorem reconstructed_flux_derivative {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 238 | (lam : ℝ) (u : EvenProfile S) {R eta : ℝ} (heta : eta ∈ S) : |
| 239 | HasDerivAt (fun r => r ^ 2 / 2 * betaFromU d lam u (r, eta)) |
| 240 | (-R * PositiveOrderMoments.radialZ h (-PositiveAxisSystem.a h + lam) u (R, eta)) R := by |
| 241 | have he : (fun r => r ^ 2 / 2 * betaFromU d lam u (r, eta)) = |
| 242 | fun r => PositiveOrderMoments.fluxHistory h lam u (r, eta) := |
| 243 | funext (fun r => betaFromU_eq_fluxHistory d lam u (w := (r, eta)) heta) |
| 244 | rw [he] |
| 245 | exact PositiveOrderMoments.fluxHistory_hasDerivAt_on h lam d.isOpen u.smooth (w := (R, eta)) heta |
| 246 | |
| 247 | noncomputable def timeOp {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 248 | (b : ℝ) (f : EvenProfile S) : EvenProfile S := |
| 249 | (-constant S b * f + constant S (SimilarityProfile.D h) * parameter S * |
| 250 | etaDerivative d.isOpen f + radiusSquared S * xDerivative d.isOpen f) * inverseDenominator d |
| 251 | |
| 252 | noncomputable def axialOp {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 253 | (b : ℝ) (f : EvenProfile S) : EvenProfile S := |
| 254 | (constant S (2 * b) * parameter S * f + (1 - parameter S ^ 2) * etaDerivative d.isOpen f - |
| 255 | constant S 2 * parameter S * radiusSquared S * xDerivative d.isOpen f) * inverseDenominator d |
| 256 | |
| 257 | noncomputable def axialOp2 {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 258 | (b : ℝ) (f : EvenProfile S) : EvenProfile S := |
| 259 | axialOp d (b - SimilarityProfile.D h) (axialOp d b f) |
| 260 | |
| 261 | noncomputable def shiftedAxial {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 262 | (beta : ℕ → EvenProfile S) : ℕ → EvenProfile S |
| 263 | | 0 => 0 |
| 264 | | k + 1 => axialOp2 d (AxisSourceRegularity.slowOrder h k - 1) (beta k) |
| 265 | |
| 266 | /-- The complete radial source divided by `X`, including both viscous terms. -/ |
| 267 | noncomputable def omegaDivX {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 268 | (u beta : ℕ → EvenProfile S) (k : ℕ) : EvenProfile S := |
| 269 | timeOp d (AxisSourceRegularity.slowOrder h k - 1) (beta k) + |
| 270 | (∑ ij ∈ Finset.antidiagonal k, |
| 271 | (beta ij.1 * (constant S (1 / 2) * beta ij.2 + radiusSquared S * xDerivative d.isOpen (beta ij.2)) + |
| 272 | u ij.1 * axialOp d (AxisSourceRegularity.slowOrder h ij.2 - 1) (beta ij.2))) - |
| 273 | (constant S 4 * xDerivative d.isOpen (beta k) + constant S 2 * radiusSquared S * |
| 274 | xDerivative d.isOpen (xDerivative d.isOpen (beta k))) - shiftedAxial d beta k |
| 275 | |
| 276 | noncomputable def previousOmegaDivX {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 277 | (u beta : ℕ → EvenProfile S) : ℕ → EvenProfile S |
| 278 | | 0 => 0 |
| 279 | | k + 1 => omegaDivX d u beta k |
| 280 | |
| 281 | noncomputable def angularField {S : Set ℝ} (C : ℝ) (phi : EvenProfile S) (w : ℝ × ℝ) : ℝ := |
| 282 | w.1 / C * phi w |
| 283 | |
| 284 | theorem angularField_smooth {S : Set ℝ} (C : ℝ) (phi : EvenProfile S) : |
| 285 | Smooth S (angularField C phi) := (contDiffOn_fst.div_const C).mul phi.smooth |
| 286 | |
| 287 | noncomputable def pressureSource {S : Set ℝ} (C : ℝ) (phi : ℕ → EvenProfile S) |
| 288 | (omega : EvenProfile S) (n : ℕ) : EvenProfile S := |
| 289 | constant S (C ^ 2)⁻¹ * (∑ i ∈ Finset.range (n + 1), phi i * phi (n - i)) - |
| 290 | constant S (1 / 2) * omega |
| 291 | |
| 292 | noncomputable def pressureFromSource {S : Set ℝ} (hS : IsOpen S) |
| 293 | (source : EvenProfile S) : EvenProfile S := radiusSquared S * massAverage hS source |
| 294 | |
| 295 | theorem pressureFromSource_eq_primitive {S : Set ℝ} (hS : IsOpen S) |
| 296 | (source : EvenProfile S) (w : ℝ × ℝ) : |
| 297 | pressureFromSource hS source w = |
| 298 | ProfileHistories.primitive (fun p => p.1 * source p) w := |
| 299 | (massHistory_eq_massAverage hS source w).symm |
| 300 | |
| 301 | theorem actual_pressureGradient {S : Set ℝ} (C : ℝ) (phi : ℕ → EvenProfile S) |
| 302 | (omega : EvenProfile S) (n : ℕ) (w : ℝ × ℝ) : |
| 303 | PositiveOrderMoments.jointPressureGradient n (fun j => angularField C (phi j)) |
| 304 | (fun p => p.1 ^ 2 / 2 * omega p) w = w.1 * pressureSource C phi omega n w := by |
| 305 | have hs : (∑ i ∈ Finset.range (n + 1), |
| 306 | angularField C (phi i) w * angularField C (phi (n - i)) w) = |
| 307 | w.1 ^ 2 / C ^ 2 * ∑ i ∈ Finset.range (n + 1), phi i w * phi (n - i) w := by |
| 308 | rw [Finset.mul_sum] |
| 309 | apply Finset.sum_congr rfl |
| 310 | intro ij _ |
| 311 | dsimp [angularField] |
| 312 | ring |
| 313 | change ((∑ i ∈ Finset.range (n + 1), |
| 314 | angularField C (phi i) w * angularField C (phi (n - i)) w) - w.1 ^ 2 / 2 * omega w) / w.1 = _ |
| 315 | rw [hs] |
| 316 | have hv : (∑ i ∈ Finset.range (n + 1), phi i * phi (n - i)) w = |
| 317 | ∑ i ∈ Finset.range (n + 1), phi i w * phi (n - i) w := by |
| 318 | simp only [sum_apply, mul_apply] |
| 319 | simp only [pressureSource, sub_apply, mul_apply, constant_apply, hv] |
| 320 | by_cases hR : w.1 = 0 |
| 321 | · simp [hR] |
| 322 | · field_simp [hR] |
| 323 | |
| 324 | theorem pressureFromSource_eq_pressureHistory {S : Set ℝ} (hS : IsOpen S) (C : ℝ) |
| 325 | (phi : ℕ → EvenProfile S) (omega : EvenProfile S) (n : ℕ) : |
| 326 | (pressureFromSource hS (pressureSource C phi omega n) : Field) = |
| 327 | PositiveOrderMoments.pressureHistory n (fun j => angularField C (phi j)) |
| 328 | (fun p => p.1 ^ 2 / 2 * omega p) := by |
| 329 | funext w |
| 330 | rw [pressureFromSource_eq_primitive] |
| 331 | unfold PositiveOrderMoments.pressureHistory |
| 332 | congr 1 |
| 333 | funext p |
| 334 | exact (actual_pressureGradient C phi omega n p).symm |
| 335 | |
| 336 | /-- Pull a local even axis function to the physical similarity radius. -/ |
| 337 | noncomputable def radialLift {rho : ℝ} {U : Set ℂ} (f : SlowRecursion.AxisFunction rho U) |
| 338 | (w : ℝ × ℝ) : ℝ := (f (w.1 / Real.sqrt 2, (w.2 : ℂ))).re |
| 339 | |
| 340 | theorem radialLift_mem {rho R : ℝ} (hrho : 0 < rho) (hR : R ^ 2 / 2 < rho ^ 2) : |
| 341 | R / Real.sqrt 2 ∈ Ioo (-rho) rho := by |
| 342 | have hs : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num) |
| 343 | have hs2 : (Real.sqrt 2) ^ 2 = 2 := Real.sq_sqrt (by norm_num) |
| 344 | have he : (R / Real.sqrt 2) ^ 2 = R ^ 2 / 2 := by rw [div_pow, hs2] |
| 345 | have hh : (R / Real.sqrt 2) ^ 2 < rho ^ 2 := by rw [he]; exact hR |
| 346 | exact abs_lt.mp (abs_lt_of_sq_lt_sq hh hrho.le) |
| 347 | |
| 348 | /-- Localizing never evaluates derivatives outside the common hierarchy |
| 349 | radius: the cutoff is already zero on a neighborhood of that boundary. -/ |
| 350 | noncomputable def cutoffLift {rho : ℝ} {U : Set ℂ} {S : Set ℝ} |
| 351 | (hrho : 0 < rho) (hU : IsOpen U) (_hS : IsOpen S) |
| 352 | (hSU : ∀ eta ∈ S, (eta : ℂ) ∈ U) |
| 353 | {inner stop : ℝ} (his : inner < stop) (hsrho : stop < rho ^ 2) |
| 354 | (f : SlowRecursion.AxisFunction rho U) : EvenProfile S := by |
| 355 | refine ⟨fun w => coreCutoff inner stop w * radialLift f w, ⟨?_, ?_⟩⟩ |
| 356 | · intro w hw |
| 357 | by_cases hR : w.1 ^ 2 / 2 < rho ^ 2 |
| 358 | · have hf := f.smooth.contDiffAt (x := (w.1 / Real.sqrt 2, (w.2 : ℂ))) ((isOpen_Ioo.prod hU).mem_nhds |
| 359 | ⟨radialLift_mem hrho hR, hSU w.2 hw.2⟩) |
| 360 | have hc : ContDiffAt ℝ ∞ (radialLift f) w := |
| 361 | Complex.reCLM.contDiff.contDiffAt.comp w |
| 362 | (hf.comp w ((contDiffAt_fst.div_const (Real.sqrt 2)).prodMk |
| 363 | (Complex.ofRealCLM.contDiff.contDiffAt.comp w contDiffAt_snd))) |
| 364 | exact ((coreCutoff_smooth inner stop).contDiffAt.mul hc).contDiffWithinAt |
| 365 | · have he : (fun p : ℝ × ℝ => coreCutoff inner stop p * radialLift f p) =ᶠ[𝓝 w] |
| 366 | fun _ => (0 : ℝ) := by |
| 367 | have hn : ∀ᶠ p : ℝ × ℝ in 𝓝 w, stop < p.1 ^ 2 / 2 := |
| 368 | (isOpen_lt continuous_const ((continuous_fst.pow 2).div_const 2)).mem_nhds |
| 369 | (hsrho.trans_le (le_of_not_gt hR)) |
| 370 | filter_upwards [hn] with p hp |
| 371 | rw [coreCutoff_zero his hp.le, zero_mul] |
| 372 | exact ((contDiffAt_const : ContDiffAt ℝ ∞ (fun _ : ℝ × ℝ => (0 : ℝ)) w).congr_of_eventuallyEq he).contDiffWithinAt |
| 373 | · intro eta heta R |
| 374 | have hcut : coreCutoff inner stop (-R, eta) = coreCutoff inner stop (R, eta) := by |
| 375 | simp only [coreCutoff, neg_sq] |
| 376 | rw [hcut] |
| 377 | by_cases hR : stop ≤ R ^ 2 / 2 |
| 378 | · rw [coreCutoff_zero his hR, zero_mul, zero_mul] |
| 379 | · have hr := radialLift_mem hrho ((lt_of_not_ge hR).trans hsrho) |
| 380 | congr 1 |
| 381 | dsimp only [radialLift] |
| 382 | rw [neg_div, f.even hr (hSU eta heta)] |
| 383 | |
| 384 | theorem cutoffLift_eq {rho : ℝ} {U : Set ℂ} {S : Set ℝ} |
| 385 | (hrho : 0 < rho) (hU : IsOpen U) (hS : IsOpen S) (hSU : ∀ eta ∈ S, (eta : ℂ) ∈ U) |
| 386 | {inner stop : ℝ} (his : inner < stop) (hsrho : stop < rho ^ 2) |
| 387 | (f : SlowRecursion.AxisFunction rho U) {w : ℝ × ℝ} (hw : w.1 ^ 2 / 2 ≤ inner) : |
| 388 | cutoffLift hrho hU hS hSU his hsrho f w = radialLift f w := by |
| 389 | change coreCutoff inner stop w * radialLift f w = _ |
| 390 | rw [coreCutoff_one his hw, one_mul] |
| 391 | |
| 392 | theorem cutoffLift_zero {rho : ℝ} {U : Set ℂ} {S : Set ℝ} |
| 393 | (hrho : 0 < rho) (hU : IsOpen U) (hS : IsOpen S) (hSU : ∀ eta ∈ S, (eta : ℂ) ∈ U) |
| 394 | {inner stop : ℝ} (his : inner < stop) (hsrho : stop < rho ^ 2) |
| 395 | (f : SlowRecursion.AxisFunction rho U) {w : ℝ × ℝ} (hw : stop ≤ w.1 ^ 2 / 2) : |
| 396 | cutoffLift hrho hU hS hSU his hsrho f w = 0 := by |
| 397 | change coreCutoff inner stop w * radialLift f w = _ |
| 398 | rw [coreCutoff_zero his hw, zero_mul] |
| 399 | |
| 400 | noncomputable def PatchSupport (a b : ℝ) (f : Field) : Prop := |
| 401 | ∀ eta, tsupport (fun R => f (R, eta)) ⊆ Ioo a b |
| 402 | |
| 403 | theorem patch_zero {a b : ℝ} {f : Field} (hs : PatchSupport a b f) |
| 404 | {R eta : ℝ} (hR : R ∉ Ioo a b) : f (R, eta) = 0 := by |
| 405 | by_contra hn |
| 406 | exact hR (hs eta (subset_closure hn)) |
| 407 | |
| 408 | noncomputable def evenCorrection {S : Set ℝ} {f : Field} (hf : Smooth S f) : EvenProfile S := |
| 409 | ⟨fun w => f w + f (-w.1, w.2), ⟨hf.add (hf.comp |
| 410 | (contDiffOn_fst.neg.prodMk contDiffOn_snd) (fun w hw => ⟨mem_univ _, hw.2⟩)), |
| 411 | fun _ _ _ => by simp only [neg_neg, add_comm]⟩⟩ |
| 412 | |
| 413 | /-- Odd angular correction divided by `R`. The support gap proves |
| 414 | smoothness at zero instead of appealing to a formal cancellation. -/ |
| 415 | noncomputable def phiCorrection {S : Set ℝ} (_hS : IsOpen S) {a b : ℝ} (ha : 0 < a) |
| 416 | {f : Field} (hf : Smooth S f) (hs : PatchSupport a b f) (C : ℝ) : EvenProfile S := by |
| 417 | refine ⟨fun w => C * (f w - f (-w.1, w.2)) / w.1, ⟨?_, ?_⟩⟩ |
| 418 | · intro w hw |
| 419 | by_cases hR : w.1 = 0 |
| 420 | · have hn : ∀ᶠ p : ℝ × ℝ in 𝓝 w, |p.1| < a := |
| 421 | (isOpen_lt continuous_fst.abs continuous_const).mem_nhds (by simpa [hR] using ha) |
| 422 | have he : (fun p : ℝ × ℝ => C * (f p - f (-p.1, p.2)) / p.1) =ᶠ[𝓝 w] |
| 423 | fun _ => (0 : ℝ) := by |
| 424 | filter_upwards [hn] with p hp |
| 425 | have h1 := patch_zero hs (eta := p.2) (R := p.1) (by |
| 426 | intro hh; linarith [(abs_lt.mp hp).2, hh.1]) |
| 427 | have h2 := patch_zero hs (eta := p.2) (R := -p.1) (by |
| 428 | intro hh; linarith [(abs_lt.mp hp).1, hh.1]) |
| 429 | simp [h1, h2] |
| 430 | exact ((contDiffAt_const : ContDiffAt ℝ ∞ (fun _ : ℝ × ℝ => (0 : ℝ)) w).congr_of_eventuallyEq he).contDiffWithinAt |
| 431 | · have hfr := hf.comp (s := region S) (contDiffOn_fst.neg.prodMk contDiffOn_snd) |
| 432 | (fun p hp => (show (-p.1, p.2) ∈ region S from ⟨mem_univ _, hp.2⟩)) |
| 433 | exact (contDiffWithinAt_const.mul ((hf w hw).sub (hfr w hw))).div |
| 434 | contDiffWithinAt_fst hR |
| 435 | · intro eta _ R |
| 436 | simp only [neg_neg] |
| 437 | ring |
| 438 | |
| 439 | theorem evenCorrection_nonneg {S : Set ℝ} {a b : ℝ} (ha : 0 < a) {f : Field} |
| 440 | (hf : Smooth S f) (hs : PatchSupport a b f) {R eta : ℝ} (hR : 0 ≤ R) : |
| 441 | evenCorrection hf (R, eta) = f (R, eta) := by |
| 442 | have hz := patch_zero hs (R := -R) (eta := eta) (by intro hh; linarith [hh.1]) |
| 443 | change f (R, eta) + f (-R, eta) = _ |
| 444 | rw [hz, add_zero] |
| 445 | |
| 446 | theorem phiCorrection_angular_nonneg {S : Set ℝ} (hS : IsOpen S) {a b : ℝ} (ha : 0 < a) |
| 447 | {f : Field} (hf : Smooth S f) (hs : PatchSupport a b f) {C : ℝ} (hC : C ≠ 0) |
| 448 | {R eta : ℝ} (hR : 0 ≤ R) : |
| 449 | angularField C (phiCorrection hS ha hf hs C) (R, eta) = f (R, eta) := by |
| 450 | have hz := patch_zero hs (R := -R) (eta := eta) (by intro hh; linarith [hh.1]) |
| 451 | change R / C * (C * (f (R, eta) - f (-R, eta)) / R) = _ |
| 452 | rw [hz, sub_zero] |
| 453 | rcases hR.eq_or_lt with he | he |
| 454 | · subst R |
| 455 | have h0 := patch_zero hs (R := 0) (eta := eta) (by intro hh; linarith [hh.1]) |
| 456 | simp [h0] |
| 457 | · field_simp [hC, he.ne'] |
| 458 | |
| 459 | theorem evenCorrection_inner {S : Set ℝ} {a b : ℝ} {f : Field} (hf : Smooth S f) |
| 460 | (hs : PatchSupport a b f) {R eta : ℝ} (hR : |R| ≤ a) : |
| 461 | evenCorrection hf (R, eta) = 0 := by |
| 462 | have hz := patch_zero hs (R := R) (eta := eta) (by |
| 463 | intro hh; linarith [(abs_le.mp hR).2, hh.1]) |
| 464 | have hn := patch_zero hs (R := -R) (eta := eta) (by |
| 465 | intro hh; linarith [(abs_le.mp hR).1, hh.1]) |
| 466 | change f (R, eta) + f (-R, eta) = _ |
| 467 | rw [hz, hn, add_zero] |
| 468 | |
| 469 | theorem phiCorrection_inner {S : Set ℝ} (hS : IsOpen S) {a b : ℝ} (ha : 0 < a) |
| 470 | {f : Field} (hf : Smooth S f) (hs : PatchSupport a b f) (C : ℝ) |
| 471 | {R eta : ℝ} (hR : |R| ≤ a) : phiCorrection hS ha hf hs C (R, eta) = 0 := by |
| 472 | have hz := patch_zero hs (R := R) (eta := eta) (by |
| 473 | intro hh; linarith [(abs_le.mp hR).2, hh.1]) |
| 474 | have hn := patch_zero hs (R := -R) (eta := eta) (by |
| 475 | intro hh; linarith [(abs_le.mp hR).1, hh.1]) |
| 476 | change C * (f (R, eta) - f (-R, eta)) / R = _ |
| 477 | simp [hz, hn] |
| 478 | |
| 479 | abbrev Exterior := SlowStressSupport.exterior |
| 480 | |
| 481 | theorem exterior_xDerivative {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) |
| 482 | {B : ℝ} (hB : 0 < B) (hf : Exterior B S f) : Exterior B S (xDerivative hS f) := by |
| 483 | have hd := SlowStressSupport.exterior_dr hS f.smooth hf |
| 484 | intro eta heta R hR |
| 485 | have he := radius_mul_xDerivative hS f heta R |
| 486 | change R * xDerivative hS f (R, eta) = ProfileHistories.radialPartial f (R, eta) at he |
| 487 | have hz : ProfileHistories.radialPartial f (R, eta) = 0 := hd eta heta R hR |
| 488 | rw [hz] at he |
| 489 | exact (mul_eq_zero.mp he).resolve_left (ne_of_gt (hB.trans_le hR)) |
| 490 | |
| 491 | theorem exterior_etaDerivative {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) |
| 492 | {B : ℝ} (hf : Exterior B S f) : Exterior B S (etaDerivative hS f) := |
| 493 | SlowStressSupport.exterior_de hS f.smooth hf |
| 494 | |
| 495 | theorem exterior_timeOp {S : Set ℝ} {h : ℝ} (d : Domain S h) (b : ℝ) |
| 496 | (f : EvenProfile S) {B : ℝ} (hB : 0 < B) (hf : Exterior B S f) : |
| 497 | Exterior B S (timeOp d b f) := by |
| 498 | intro eta heta R hR |
| 499 | simp only [timeOp, mul_apply, add_apply, neg_apply, |
| 500 | hf eta heta R hR, exterior_xDerivative d.isOpen f hB hf eta heta R hR, |
| 501 | exterior_etaDerivative d.isOpen f hf eta heta R hR, mul_zero, add_zero, zero_mul] |
| 502 | |
| 503 | theorem exterior_axialOp {S : Set ℝ} {h : ℝ} (d : Domain S h) (b : ℝ) |
| 504 | (f : EvenProfile S) {B : ℝ} (hB : 0 < B) (hf : Exterior B S f) : |
| 505 | Exterior B S (axialOp d b f) := by |
| 506 | intro eta heta R hR |
| 507 | simp [axialOp, hf eta heta R hR, exterior_xDerivative d.isOpen f hB hf eta heta R hR, |
| 508 | exterior_etaDerivative d.isOpen f hf eta heta R hR] |
| 509 | |
| 510 | theorem exterior_axialOp2 {S : Set ℝ} {h : ℝ} (d : Domain S h) (b : ℝ) |
| 511 | (f : EvenProfile S) {B : ℝ} (hB : 0 < B) (hf : Exterior B S f) : |
| 512 | Exterior B S (axialOp2 d b f) := |
| 513 | exterior_axialOp d _ _ hB (exterior_axialOp d _ _ hB hf) |
| 514 | |
| 515 | theorem exterior_omegaDivX {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 516 | (u beta : ℕ → EvenProfile S) (k : ℕ) {B : ℝ} (hB : 0 < B) |
| 517 | (hb : ∀ j ≤ k, Exterior B S (beta j)) : Exterior B S (omegaDivX d u beta k) := by |
| 518 | intro eta heta R hR |
| 519 | have hsum : (∑ ij ∈ Finset.antidiagonal k, |
| 520 | (beta ij.1 * (constant S (1 / 2) * beta ij.2 + radiusSquared S * xDerivative d.isOpen (beta ij.2)) + |
| 521 | u ij.1 * axialOp d (AxisSourceRegularity.slowOrder h ij.2 - 1) (beta ij.2))) (R, eta) = 0 := by |
| 522 | rw [sum_apply] |
| 523 | apply Finset.sum_eq_zero |
| 524 | intro ij hij |
| 525 | have hi := (AxisSourceRegularity.antidiagonal_indices_le hij).1 |
| 526 | have hj := (AxisSourceRegularity.antidiagonal_indices_le hij).2 |
| 527 | simp [hb _ hi eta heta R hR, exterior_axialOp d _ _ hB (hb _ hj) eta heta R hR] |
| 528 | have hshift : shiftedAxial d beta k (R, eta) = 0 := by |
| 529 | cases k with |
| 530 | | zero => rfl |
| 531 | | succ k => exact exterior_axialOp2 d _ _ hB (hb k (Nat.le_succ k)) eta heta R hR |
| 532 | simp only [omegaDivX, sub_apply, add_apply, mul_apply, hsum, hshift, |
| 533 | exterior_timeOp d _ _ hB (hb k le_rfl) eta heta R hR, |
| 534 | exterior_xDerivative d.isOpen _ hB (hb k le_rfl) eta heta R hR, |
| 535 | exterior_xDerivative d.isOpen _ hB (exterior_xDerivative d.isOpen _ hB (hb k le_rfl)) eta heta R hR, |
| 536 | mul_zero, add_zero, sub_zero] |
| 537 | |
| 538 | theorem exterior_previousOmegaDivX {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 539 | (u beta : ℕ → EvenProfile S) (n : ℕ) {B : ℝ} (hB : 0 < B) |
| 540 | (hb : ∀ j < n, Exterior B S (beta j)) : Exterior B S (previousOmegaDivX d u beta n) := by |
| 541 | cases n with |
| 542 | | zero => intro eta _ R _; rfl |
| 543 | | succ n => exact exterior_omegaDivX d u beta n hB (fun j hj => hb j (Nat.lt_succ_iff.mpr hj)) |
| 544 | |
| 545 | theorem exterior_pressureSource {S : Set ℝ} (C : ℝ) (phi : ℕ → EvenProfile S) |
| 546 | (omega : EvenProfile S) {n : ℕ} (hn : 0 < n) {B : ℝ} |
| 547 | (hp : ∀ j, 0 < j → j ≤ n → Exterior B S (phi j)) (ho : Exterior B S omega) : |
| 548 | Exterior B S (pressureSource C phi omega n) := by |
| 549 | intro eta heta R hR |
| 550 | have hs : (∑ i ∈ Finset.range (n + 1), phi i * phi (n - i)) (R, eta) = 0 := by |
| 551 | rw [sum_apply] |
| 552 | apply Finset.sum_eq_zero |
| 553 | intro i hi |
| 554 | have hin : i ≤ n := Nat.lt_succ_iff.mp (Finset.mem_range.mp hi) |
| 555 | by_cases hi0 : i = 0 |
| 556 | · subst i |
| 557 | simp [hp n hn le_rfl eta heta R hR] |
| 558 | · simp [hp i (Nat.pos_of_ne_zero hi0) hin eta heta R hR] |
| 559 | simp [pressureSource, hs, ho eta heta R hR] |
| 560 | |
| 561 | theorem exterior_evenCorrection {S : Set ℝ} {a b B : ℝ} (ha : 0 < a) (hab : a < b) |
| 562 | (hbB : b ≤ B) {f : Field} (hf : Smooth S f) (hs : PatchSupport a b f) : |
| 563 | Exterior B S (evenCorrection hf) := by |
| 564 | intro eta _ R hR |
| 565 | have hRa : a < R := hab.trans_le (hbB.trans hR) |
| 566 | rw [evenCorrection_nonneg ha hf hs (ha.trans hRa).le] |
| 567 | exact patch_zero hs (by intro hh; linarith [hh.2]) |
| 568 | |
| 569 | theorem exterior_phiCorrection {S : Set ℝ} (hS : IsOpen S) {a b B : ℝ} |
| 570 | (ha : 0 < a) (hab : a < b) (hbB : b ≤ B) {f : Field} (hf : Smooth S f) |
| 571 | (hs : PatchSupport a b f) (C : ℝ) : Exterior B S (phiCorrection hS ha hf hs C) := by |
| 572 | intro eta _ R hR |
| 573 | have hz := patch_zero hs (R := R) (eta := eta) (by intro hh; linarith [hh.2]) |
| 574 | have hn := patch_zero hs (R := -R) (eta := eta) (by intro hh; linarith [hh.1]) |
| 575 | change C * (f (R, eta) - f (-R, eta)) / R = 0 |
| 576 | simp [hz, hn] |
| 577 | |
| 578 | theorem moments_congr_positive {n : ℕ} |
| 579 | {u e u' e' : PositiveOrderMoments.History} {omega omega' : ℝ → ℝ} |
| 580 | (hu : ∀ R, 0 < R → ∀ j, u j R = u' j R) |
| 581 | (he : ∀ R, 0 < R → ∀ j, e j R = e' j R) |
| 582 | (ho : ∀ R, 0 < R → omega R = omega' R) : |
| 583 | PositiveOrderMoments.moments n u e omega = PositiveOrderMoments.moments n u' e' omega' := by |
| 584 | funext i |
| 585 | apply setIntegral_congr_fun measurableSet_Ioi |
| 586 | intro R hR |
| 587 | simp only [PositiveOrderMoments.rowDensity, PositiveOrderMoments.pressureGradient, |
| 588 | PositiveOrderMoments.cauchy, PositiveAxisSystem.convolution, hu R hR, he R hR, ho R hR] |
| 589 | |
| 590 | theorem actual_pressureGradient_smooth {S : Set ℝ} (C : ℝ) (phi : ℕ → EvenProfile S) |
| 591 | (omega : EvenProfile S) (n : ℕ) : |
| 592 | Smooth S (PositiveOrderMoments.jointPressureGradient n (fun j => angularField C (phi j)) |
| 593 | (fun p => p.1 ^ 2 / 2 * omega p)) := by |
| 594 | have he := funext (actual_pressureGradient C phi omega n) |
| 595 | rw [he] |
| 596 | exact contDiffOn_fst.mul (pressureSource C phi omega n).smooth |
| 597 | |
| 598 | /-- One repair step. Only actual smooth profiles and their compact exterior |
| 599 | are inputs; the five zero moments are proved by the explicit linear repair. -/ |
| 600 | theorem exists_repaired_order {S : Set ℝ} (hS : IsOpen S) {C lam a b B : ℝ} |
| 601 | (hC : C ≠ 0) (hlam : 0 < lam) (ha : 0 < a) (hab : a < b) (hbB : b ≤ B) |
| 602 | {n : ℕ} (hn : 0 < n) (u phi : ℕ → EvenProfile S) (omega : EvenProfile S) |
| 603 | (A : ℝ → ℝ) (hA : ContDiffOn ℝ ∞ A S) (hAn : ∀ eta ∈ S, A eta ≠ 0) |
| 604 | (hu0 : ∀ eta ∈ S, ∀ R ∈ Ioo a b, u 0 (R, eta) = 0) |
| 605 | (he0 : ∀ eta ∈ S, ∀ R ∈ Ioo a b, |
| 606 | angularField C (phi 0) (R, eta) = FiveRowRank.background lam (A eta) R) |
| 607 | (huB : ∀ j ≤ n, Exterior B S (u j)) |
| 608 | (hpB : ∀ j, 0 < j → j ≤ n → Exterior B S (phi j)) |
| 609 | (hoB : Exterior B S omega) : |
| 610 | ∃ un phin : EvenProfile S, |
| 611 | (∀ eta R, |R| ≤ a → un (R, eta) = u n (R, eta)) ∧ |
| 612 | (∀ eta R, |R| ≤ a → phin (R, eta) = phi n (R, eta)) ∧ |
| 613 | Exterior B S un ∧ Exterior B S phin ∧ |
| 614 | (∀ eta R, b ≤ R → un (R, eta) = u n (R, eta)) ∧ |
| 615 | (∀ eta R, b ≤ R → phin (R, eta) = phi n (R, eta)) ∧ |
| 616 | ∀ eta ∈ S, PositiveOrderMoments.moments n |
| 617 | (PositiveOrderMoments.slice (fun j => (Function.update u n un j : Field)) eta) |
| 618 | (PositiveOrderMoments.slice (fun j => angularField C (Function.update phi n phin j)) eta) |
| 619 | (fun R => R ^ 2 / 2 * omega (R, eta)) = 0 := by |
| 620 | classical |
| 621 | let uraw : History := fun j => u j |
| 622 | let eraw : History := fun j => angularField C (phi j) |
| 623 | let oraw : Field := fun p => p.1 ^ 2 / 2 * omega p |
| 624 | have hd : ∀ i, Smooth S (fun w => PositiveOrderMoments.jointRowDensity n uraw eraw oraw w i) := |
| 625 | PositiveOrderMoments.jointRowDensity_contDiffOn (fun j _ => (u j).smooth) |
| 626 | (fun j _ => angularField_smooth C (phi j)) (actual_pressureGradient_smooth C phi omega n) |
| 627 | have hs : ∀ eta ∈ S, ∀ R, B ≤ R → |
| 628 | PositiveOrderMoments.jointRowDensity n uraw eraw oraw (R, eta) = 0 := by |
| 629 | intro eta heta R hR |
| 630 | apply PositiveOrderMoments.jointRowDensity_exterior hn |
| 631 | · intro j hj |
| 632 | exact huB j hj eta heta R hR |
| 633 | · intro j hj hjn |
| 634 | change R / C * phi j (R, eta) = 0 |
| 635 | rw [hpB j hj hjn eta heta R hR, mul_zero] |
| 636 | · change R ^ 2 / 2 * omega (R, eta) = 0 |
| 637 | rw [hoB eta heta R hR, mul_zero] |
| 638 | have hB : 0 < B := ha.trans (hab.trans_le hbB) |
| 639 | obtain ⟨du, de', hdu, hde, hduS, hdeS, hm⟩ := |
| 640 | PositiveOrderMoments.exists_parameterized_exact_repair lam a b hlam ha hab hS hn |
| 641 | uraw eraw oraw A hA hAn hu0 he0 hd hB.le hs |
| 642 | let un : EvenProfile S := u n + evenCorrection hdu |
| 643 | let phin : EvenProfile S := phi n + phiCorrection hS ha hde hdeS C |
| 644 | refine ⟨un, phin, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ |
| 645 | · intro eta R hR |
| 646 | change u n (R, eta) + evenCorrection hdu (R, eta) = _ |
| 647 | rw [evenCorrection_inner hdu hduS hR, add_zero] |
| 648 | · intro eta R hR |
| 649 | change phi n (R, eta) + phiCorrection hS ha hde hdeS C (R, eta) = _ |
| 650 | rw [phiCorrection_inner hS ha hde hdeS C hR, add_zero] |
| 651 | · intro eta heta R hR |
| 652 | change u n (R, eta) + evenCorrection hdu (R, eta) = 0 |
| 653 | rw [huB n le_rfl eta heta R hR, exterior_evenCorrection ha hab hbB hdu hduS eta heta R hR, add_zero] |
| 654 | · intro eta heta R hR |
| 655 | change phi n (R, eta) + phiCorrection hS ha hde hdeS C (R, eta) = 0 |
| 656 | rw [hpB n hn le_rfl eta heta R hR, exterior_phiCorrection hS ha hab hbB hde hdeS C eta heta R hR, add_zero] |
| 657 | · intro eta R hR |
| 658 | have hz := patch_zero hduS (R := R) (eta := eta) (by intro hh; linarith [hh.2]) |
| 659 | have hn := patch_zero hduS (R := -R) (eta := eta) (by intro hh; linarith [hh.1]) |
| 660 | change u n (R, eta) + (du (R, eta) + du (-R, eta)) = u n (R, eta) |
| 661 | rw [hz, hn, add_zero, add_zero] |
| 662 | · intro eta R hR |
| 663 | have hz := patch_zero hdeS (R := R) (eta := eta) (by intro hh; linarith [hh.2]) |
| 664 | have hn := patch_zero hdeS (R := -R) (eta := eta) (by intro hh; linarith [hh.1]) |
| 665 | change phi n (R, eta) + C * (de' (R, eta) - de' (-R, eta)) / R = phi n (R, eta) |
| 666 | rw [hz, hn, sub_self, mul_zero, zero_div, add_zero] |
| 667 | · intro eta heta |
| 668 | rw [← hm eta heta] |
| 669 | apply moments_congr_positive |
| 670 | · intro R hR j |
| 671 | by_cases hj : j = n |
| 672 | · subst j |
| 673 | simp only [PositiveOrderMoments.slice, Function.update_self, PositiveOrderMoments.increment] |
| 674 | change u n (R, eta) + evenCorrection hdu (R, eta) = u n (R, eta) + du (R, eta) |
| 675 | rw [evenCorrection_nonneg ha hdu hduS hR.le] |
| 676 | · simp only [PositiveOrderMoments.slice, Function.update_of_ne hj, PositiveOrderMoments.increment] |
| 677 | rfl |
| 678 | · intro R hR j |
| 679 | by_cases hj : j = n |
| 680 | · subst j |
| 681 | simp only [PositiveOrderMoments.slice, Function.update_self, PositiveOrderMoments.increment] |
| 682 | change R / C * (phi n (R, eta) + phiCorrection hS ha hde hdeS C (R, eta)) = |
| 683 | angularField C (phi n) (R, eta) + de' (R, eta) |
| 684 | rw [mul_add] |
| 685 | change _ + angularField C (phiCorrection hS ha hde hdeS C) (R, eta) = _ |
| 686 | rw [phiCorrection_angular_nonneg hS ha hde hdeS hC hR.le] |
| 687 | rfl |
| 688 | · simp only [PositiveOrderMoments.slice, Function.update_of_ne hj, PositiveOrderMoments.increment] |
| 689 | rfl |
| 690 | · intro R _ |
| 691 | rfl |
| 692 | |
| 693 | theorem reconstructed_beta_exterior {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 694 | (lam : ℝ) (u : EvenProfile S) {B : ℝ} (hB : 0 < B) (hu : Exterior B S u) |
| 695 | (hm : ∀ eta ∈ S, PositiveOrderMoments.positiveIntegral (fun R => R * u (R, eta)) = 0) : |
| 696 | Exterior B S (betaFromU d lam u) := by |
| 697 | intro eta heta R hR |
| 698 | have hz := PositiveOrderMoments.fluxHistory_exterior_on h lam d.isOpen u.smooth hB.le hu hm hR heta |
| 699 | rw [← betaFromU_eq_fluxHistory d lam u (w := (R, eta)) heta] at hz |
| 700 | have hR0 : R ≠ 0 := ne_of_gt (hB.trans_le hR) |
| 701 | exact (mul_eq_zero.mp hz).resolve_left (div_ne_zero (pow_ne_zero 2 hR0) (by norm_num)) |
| 702 | |
| 703 | theorem reconstructed_pressure_exterior {S : Set ℝ} (hS : IsOpen S) (C : ℝ) |
| 704 | (u phi : ℕ → EvenProfile S) (omega : EvenProfile S) {n : ℕ} (hn : 0 < n) |
| 705 | {B : ℝ} (hB : 0 ≤ B) |
| 706 | (hpB : ∀ j, 0 < j → j ≤ n → Exterior B S (phi j)) (hoB : Exterior B S omega) |
| 707 | (hm : ∀ eta ∈ S, PositiveOrderMoments.moments n |
| 708 | (PositiveOrderMoments.slice (fun j => (u j : Field)) eta) |
| 709 | (PositiveOrderMoments.slice (fun j => angularField C (phi j)) eta) |
| 710 | (fun R => R ^ 2 / 2 * omega (R, eta)) = 0) : |
| 711 | Exterior B S (pressureFromSource hS (pressureSource C phi omega n)) := by |
| 712 | intro eta heta R hR |
| 713 | have hs : Exterior B S (PositiveOrderMoments.jointPressureGradient n |
| 714 | (fun j => angularField C (phi j)) (fun p => p.1 ^ 2 / 2 * omega p)) := by |
| 715 | intro t ht r hr |
| 716 | rw [actual_pressureGradient, exterior_pressureSource C phi omega hn hpB hoB t ht r hr, mul_zero] |
| 717 | change (pressureFromSource hS (pressureSource C phi omega n) : Field) (R, eta) = 0 |
| 718 | rw [pressureFromSource_eq_pressureHistory] |
| 719 | exact PositiveOrderMoments.pressureHistory_exterior_on hB hs hm hR heta |
| 720 | |
| 721 | structure Coefficient (S : Set ℝ) where |
| 722 | phi : EvenProfile S |
| 723 | axial : EvenProfile S |
| 724 | beta : EvenProfile S |
| 725 | pressure : EvenProfile S |
| 726 | |
| 727 | /-- The finite order-zero data and a sequence of localized seeds. The |
| 728 | constructor `schemeFromHierarchy` below supplies the seeds from one actual |
| 729 | local hierarchy and one common cutoff. -/ |
| 730 | structure Scheme (S : Set ℝ) (h C : ℝ) where |
| 731 | domain : Domain S h |
| 732 | nonzero_scale : C ≠ 0 |
| 733 | lam : ℝ |
| 734 | lam_pos : 0 < lam |
| 735 | a : ℝ |
| 736 | b : ℝ |
| 737 | B : ℝ |
| 738 | a_pos : 0 < a |
| 739 | a_lt_b : a < b |
| 740 | b_le_B : b ≤ B |
| 741 | amplitude : ℝ → ℝ |
| 742 | amplitude_smooth : ContDiffOn ℝ ∞ amplitude S |
| 743 | amplitude_ne : ∀ eta ∈ S, amplitude eta ≠ 0 |
| 744 | base : Coefficient S |
| 745 | base_axial_exterior : Exterior B S base.axial |
| 746 | base_beta_exterior : Exterior B S base.beta |
| 747 | base_axial_patch : ∀ eta ∈ S, ∀ R ∈ Ioo a b, base.axial (R, eta) = 0 |
| 748 | base_angular_patch : ∀ eta ∈ S, ∀ R ∈ Ioo a b, |
| 749 | angularField C base.phi (R, eta) = FiveRowRank.background lam (amplitude eta) R |
| 750 | seedAxial : ℕ → EvenProfile S |
| 751 | seedPhi : ℕ → EvenProfile S |
| 752 | seedAxial_exterior : ∀ n, Exterior B S (seedAxial n) |
| 753 | seedPhi_exterior : ∀ n, Exterior B S (seedPhi n) |
| 754 | |
| 755 | theorem Scheme.B_pos {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) : 0 < s.B := |
| 756 | s.a_pos.trans (s.a_lt_b.trans_le s.b_le_B) |
| 757 | |
| 758 | structure Admissible {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) where |
| 759 | data : Coefficient S |
| 760 | axial_exterior : Exterior s.B S data.axial |
| 761 | beta_exterior : Exterior s.B S data.beta |
| 762 | phi_exterior : 0 < n → Exterior s.B S data.phi |
| 763 | pressure_exterior : 0 < n → Exterior s.B S data.pressure |
| 764 | zero_data : n = 0 → data = s.base |
| 765 | inner_axial : 0 < n → ∀ eta R, |R| ≤ s.a → data.axial (R, eta) = s.seedAxial n (R, eta) |
| 766 | inner_phi : 0 < n → ∀ eta R, |R| ≤ s.a → data.phi (R, eta) = s.seedPhi n (R, eta) |
| 767 | outer_axial : 0 < n → ∀ eta R, s.b ≤ R → data.axial (R, eta) = s.seedAxial n (R, eta) |
| 768 | outer_phi : 0 < n → ∀ eta R, s.b ≤ R → data.phi (R, eta) = s.seedPhi n (R, eta) |
| 769 | |
| 770 | noncomputable def previousAxial {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) |
| 771 | (previous : (j : ℕ) → j < n → Admissible s j) (j : ℕ) : EvenProfile S := |
| 772 | if hj : j < n then (previous j hj).data.axial else s.seedAxial n |
| 773 | |
| 774 | noncomputable def previousPhi {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) |
| 775 | (previous : (j : ℕ) → j < n → Admissible s j) (j : ℕ) : EvenProfile S := |
| 776 | if hj : j < n then (previous j hj).data.phi else s.seedPhi n |
| 777 | |
| 778 | noncomputable def previousBeta {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) |
| 779 | (previous : (j : ℕ) → j < n → Admissible s j) (j : ℕ) : EvenProfile S := |
| 780 | if hj : j < n then (previous j hj).data.beta else 0 |
| 781 | |
| 782 | noncomputable def previousSource {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) |
| 783 | (previous : (j : ℕ) → j < n → Admissible s j) : EvenProfile S := |
| 784 | previousOmegaDivX s.domain (previousAxial s n previous) (previousBeta s n previous) n |
| 785 | |
| 786 | def StepProperties {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) |
| 787 | (previous : (j : ℕ) → j < n → Admissible s j) (out : Admissible s n) : Prop := |
| 788 | out.data.beta = betaFromU s.domain (AxisSourceRegularity.slowOrder h n) out.data.axial ∧ |
| 789 | out.data.pressure = pressureFromSource s.domain.isOpen |
| 790 | (pressureSource C (Function.update (previousPhi s n previous) n out.data.phi) |
| 791 | (previousSource s n previous) n) ∧ |
| 792 | ∀ eta ∈ S, PositiveOrderMoments.moments n |
| 793 | (PositiveOrderMoments.slice (fun j => |
| 794 | (Function.update (previousAxial s n previous) n out.data.axial j : Field)) eta) |
| 795 | (PositiveOrderMoments.slice (fun j => |
| 796 | angularField C (Function.update (previousPhi s n previous) n out.data.phi j)) eta) |
| 797 | (fun R => R ^ 2 / 2 * previousSource s n previous (R, eta)) = 0 |
| 798 | |
| 799 | theorem exists_step {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) |
| 800 | (previous : (j : ℕ) → j < n → Admissible s j) : |
| 801 | ∃ out : Admissible s n, StepProperties s n previous out := by |
| 802 | classical |
| 803 | let u := previousAxial s n previous |
| 804 | let p := previousPhi s n previous |
| 805 | let o := previousSource s n previous |
| 806 | have hu : ∀ j ≤ n, Exterior s.B S (u j) := by |
| 807 | intro j _ |
| 808 | dsimp [u, previousAxial] |
| 809 | split_ifs with hj |
| 810 | · exact (previous j hj).axial_exterior |
| 811 | · exact s.seedAxial_exterior n |
| 812 | have hp : ∀ j, 0 < j → j ≤ n → Exterior s.B S (p j) := by |
| 813 | intro j hj0 _ |
| 814 | dsimp [p, previousPhi] |
| 815 | split_ifs with hj |
| 816 | · exact (previous j hj).phi_exterior hj0 |
| 817 | · exact s.seedPhi_exterior n |
| 818 | have ho : Exterior s.B S o := by |
| 819 | apply exterior_previousOmegaDivX s.domain _ _ n s.B_pos |
| 820 | intro j hj |
| 821 | simpa only [previousBeta, dite_eq_left hj] using (previous j hj).beta_exterior |
| 822 | have hu0 : u 0 = s.base.axial := by |
| 823 | dsimp [u, previousAxial] |
| 824 | rw [dite_eq_left hn, (previous 0 hn).zero_data rfl] |
| 825 | have hp0 : p 0 = s.base.phi := by |
| 826 | dsimp [p, previousPhi] |
| 827 | rw [dite_eq_left hn, (previous 0 hn).zero_data rfl] |
| 828 | obtain ⟨un, pn, hui, hpi, hue, hpe, huo, hpo, hm⟩ := exists_repaired_order s.domain.isOpen |
| 829 | s.nonzero_scale s.lam_pos s.a_pos s.a_lt_b s.b_le_B hn u p o s.amplitude |
| 830 | s.amplitude_smooth s.amplitude_ne |
| 831 | (by simpa only [hu0] using s.base_axial_patch) |
| 832 | (by simpa only [hp0] using s.base_angular_patch) hu hp ho |
| 833 | let b := betaFromU s.domain (AxisSourceRegularity.slowOrder h n) un |
| 834 | let pressure := pressureFromSource s.domain.isOpen (pressureSource C (Function.update p n pn) o n) |
| 835 | have hmass : ∀ eta ∈ S, |
| 836 | PositiveOrderMoments.positiveIntegral (fun R => R * un (R, eta)) = 0 := by |
| 837 | intro eta heta |
| 838 | have hm0 := congrFun (hm eta heta) 0 |
| 839 | simpa only [PositiveOrderMoments.moments, PositiveOrderMoments.rowDensity, |
| 840 | PositiveOrderMoments.slice, Function.update_self, Matrix.cons_val_zero, Pi.zero_apply] using hm0 |
| 841 | have hbe : Exterior s.B S b := reconstructed_beta_exterior s.domain _ un s.B_pos hue hmass |
| 842 | have hpu : ∀ j, 0 < j → j ≤ n → Exterior s.B S (Function.update p n pn j) := by |
| 843 | intro j hj hjn |
| 844 | by_cases he : j = n |
| 845 | · subst j; simpa only [Function.update_self] using hpe |
| 846 | · simpa only [Function.update_of_ne he] using hp j hj hjn |
| 847 | have hpre : Exterior s.B S pressure := |
| 848 | reconstructed_pressure_exterior s.domain.isOpen C (Function.update u n un) |
| 849 | (Function.update p n pn) o hn s.B_pos.le hpu ho hm |
| 850 | let out : Admissible s n := { |
| 851 | data := ⟨pn, un, b, pressure⟩ |
| 852 | axial_exterior := hue |
| 853 | beta_exterior := hbe |
| 854 | phi_exterior := fun _ => hpe |
| 855 | pressure_exterior := fun _ => hpre |
| 856 | zero_data := fun hz => (Nat.ne_of_gt hn hz).elim |
| 857 | inner_axial := by |
| 858 | intro _ eta R hR |
| 859 | have hi := hui eta R hR |
| 860 | simpa only [u, previousAxial, dite_eq_right (lt_irrefl n)] using hi |
| 861 | inner_phi := by |
| 862 | intro _ eta R hR |
| 863 | have hi := hpi eta R hR |
| 864 | simpa only [p, previousPhi, dite_eq_right (lt_irrefl n)] using hi |
| 865 | outer_axial := by |
| 866 | intro _ eta R hR |
| 867 | have ho := huo eta R hR |
| 868 | simpa only [u, previousAxial, dite_eq_right (lt_irrefl n)] using ho |
| 869 | outer_phi := by |
| 870 | intro _ eta R hR |
| 871 | have ho := hpo eta R hR |
| 872 | simpa only [p, previousPhi, dite_eq_right (lt_irrefl n)] using ho } |
| 873 | exact ⟨out, rfl, rfl, hm⟩ |
| 874 | |
| 875 | noncomputable def step {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) |
| 876 | (previous : (j : ℕ) → j < n → Admissible s j) : Admissible s n := |
| 877 | Classical.choose (exists_step s hn previous) |
| 878 | |
| 879 | theorem step_spec {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) |
| 880 | (previous : (j : ℕ) → j < n → Admissible s j) : |
| 881 | StepProperties s n previous (step s hn previous) := |
| 882 | Classical.choose_spec (exists_step s hn previous) |
| 883 | |
| 884 | noncomputable def recursionStep {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) : |
| 885 | (n : ℕ) → ((j : ℕ) → j < n → Admissible s j) → Admissible s n |
| 886 | | 0, _ => { |
| 887 | data := s.base |
| 888 | axial_exterior := s.base_axial_exterior |
| 889 | beta_exterior := s.base_beta_exterior |
| 890 | phi_exterior := fun hn => (Nat.lt_irrefl 0 hn).elim |
| 891 | pressure_exterior := fun hn => (Nat.lt_irrefl 0 hn).elim |
| 892 | zero_data := fun _ => rfl |
| 893 | inner_axial := fun hn => (Nat.lt_irrefl 0 hn).elim |
| 894 | inner_phi := fun hn => (Nat.lt_irrefl 0 hn).elim |
| 895 | outer_axial := fun hn => (Nat.lt_irrefl 0 hn).elim |
| 896 | outer_phi := fun hn => (Nat.lt_irrefl 0 hn).elim } |
| 897 | | n + 1, previous => step s (Nat.succ_pos n) previous |
| 898 | |
| 899 | /-- A single coherent infinite sequence, constructed by well-founded |
| 900 | recursion; all coefficient indices used in the radial source are smaller. -/ |
| 901 | noncomputable def sequence {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) : |
| 902 | Admissible s n := Nat.lt_wfRel.wf.fix (recursionStep s) n |
| 903 | |
| 904 | noncomputable def profiles {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) : Coefficient S := |
| 905 | (sequence s n).data |
| 906 | |
| 907 | theorem sequence_succ {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) : |
| 908 | sequence s (n + 1) = step s (Nat.succ_pos n) (fun j _ => sequence s j) := by |
| 909 | unfold sequence |
| 910 | rw [WellFounded.fix_eq] |
| 911 | rfl |
| 912 | |
| 913 | theorem profiles_zero {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) : profiles s 0 = s.base := |
| 914 | (sequence s 0).zero_data rfl |
| 915 | |
| 916 | theorem profiles_axial_exterior {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) : |
| 917 | Exterior s.B S (profiles s n).axial := (sequence s n).axial_exterior |
| 918 | |
| 919 | theorem profiles_beta_exterior {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) : |
| 920 | Exterior s.B S (profiles s n).beta := (sequence s n).beta_exterior |
| 921 | |
| 922 | theorem profiles_phi_exterior {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) : |
| 923 | Exterior s.B S (profiles s n).phi := (sequence s n).phi_exterior hn |
| 924 | |
| 925 | theorem profiles_pressure_exterior {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) : |
| 926 | Exterior s.B S (profiles s n).pressure := (sequence s n).pressure_exterior hn |
| 927 | |
| 928 | theorem profiles_inner_axial {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) |
| 929 | {R eta : ℝ} (hR : |R| ≤ s.a) : (profiles s n).axial (R, eta) = s.seedAxial n (R, eta) := |
| 930 | (sequence s n).inner_axial hn eta R hR |
| 931 | |
| 932 | theorem profiles_inner_phi {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) |
| 933 | {R eta : ℝ} (hR : |R| ≤ s.a) : (profiles s n).phi (R, eta) = s.seedPhi n (R, eta) := |
| 934 | (sequence s n).inner_phi hn eta R hR |
| 935 | |
| 936 | /-- Positive-order repairs preserve the actual seed beyond the repair patch. |
| 937 | This property is retained in the predicate used to select each step. -/ |
| 938 | theorem profiles_outer_axial {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) |
| 939 | {R eta : ℝ} (hR : s.b ≤ R) : (profiles s n).axial (R, eta) = s.seedAxial n (R, eta) := |
| 940 | (sequence s n).outer_axial hn eta R hR |
| 941 | |
| 942 | theorem profiles_outer_phi {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) |
| 943 | {R eta : ℝ} (hR : s.b ≤ R) : (profiles s n).phi (R, eta) = s.seedPhi n (R, eta) := |
| 944 | (sequence s n).outer_phi hn eta R hR |
| 945 | |
| 946 | theorem omegaDivX_congr_prefix {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 947 | {u beta u' beta' : ℕ → EvenProfile S} (k : ℕ) |
| 948 | (hu : ∀ j ≤ k, u j = u' j) (hb : ∀ j ≤ k, beta j = beta' j) : |
| 949 | omegaDivX d u beta k = omegaDivX d u' beta' k := by |
| 950 | have hs : shiftedAxial d beta k = shiftedAxial d beta' k := by |
| 951 | cases k with |
| 952 | | zero => rfl |
| 953 | | succ k => simp only [shiftedAxial, hb k (Nat.le_succ k)] |
| 954 | have hsum : (∑ ij ∈ Finset.antidiagonal k, |
| 955 | (beta ij.1 * (constant S (1 / 2) * beta ij.2 + radiusSquared S * xDerivative d.isOpen (beta ij.2)) + |
| 956 | u ij.1 * axialOp d (AxisSourceRegularity.slowOrder h ij.2 - 1) (beta ij.2))) = |
| 957 | (∑ ij ∈ Finset.antidiagonal k, |
| 958 | (beta' ij.1 * (constant S (1 / 2) * beta' ij.2 + radiusSquared S * xDerivative d.isOpen (beta' ij.2)) + |
| 959 | u' ij.1 * axialOp d (AxisSourceRegularity.slowOrder h ij.2 - 1) (beta' ij.2))) := by |
| 960 | apply Finset.sum_congr rfl |
| 961 | intro ij hij |
| 962 | have hi := AxisSourceRegularity.antidiagonal_indices_le hij |
| 963 | rw [hb _ hi.1, hb _ hi.2, hu _ hi.1] |
| 964 | simp only [omegaDivX, hsum, hs, hb k le_rfl] |
| 965 | |
| 966 | theorem previousOmegaDivX_congr_prefix {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 967 | {u beta u' beta' : ℕ → EvenProfile S} (n : ℕ) |
| 968 | (hu : ∀ j < n, u j = u' j) (hb : ∀ j < n, beta j = beta' j) : |
| 969 | previousOmegaDivX d u beta n = previousOmegaDivX d u' beta' n := by |
| 970 | cases n with |
| 971 | | zero => rfl |
| 972 | | succ n => |
| 973 | exact omegaDivX_congr_prefix d n (fun j hj => hu j (Nat.lt_succ_iff.mpr hj)) |
| 974 | (fun j hj => hb j (Nat.lt_succ_iff.mpr hj)) |
| 975 | |
| 976 | theorem pressureSource_congr_prefix {S : Set ℝ} (C : ℝ) {phi phi' : ℕ → EvenProfile S} |
| 977 | (omega : EvenProfile S) (n : ℕ) (hp : ∀ j ≤ n, phi j = phi' j) : |
| 978 | pressureSource C phi omega n = pressureSource C phi' omega n := by |
| 979 | have he : (∑ i ∈ Finset.range (n + 1), phi i * phi (n - i)) = |
| 980 | ∑ i ∈ Finset.range (n + 1), phi' i * phi' (n - i) := by |
| 981 | apply Finset.sum_congr rfl |
| 982 | intro i hi |
| 983 | rw [hp i (Nat.lt_succ_iff.mp (Finset.mem_range.mp hi)), hp (n - i) (Nat.sub_le _ _)] |
| 984 | simp only [pressureSource, he] |
| 985 | |
| 986 | theorem cauchy_congr_prefix {u e u' e' : PositiveOrderMoments.History} (n : ℕ) (R : ℝ) |
| 987 | (hu : ∀ j ≤ n, u j R = u' j R) (he : ∀ j ≤ n, e j R = e' j R) : |
| 988 | PositiveOrderMoments.cauchy n u e R = PositiveOrderMoments.cauchy n u' e' R := by |
| 989 | unfold PositiveOrderMoments.cauchy PositiveAxisSystem.convolution |
| 990 | apply Finset.sum_congr rfl |
| 991 | intro i hi |
| 992 | change u i R * e (n - i) R = u' i R * e' (n - i) R |
| 993 | rw [hu i (Nat.lt_succ_iff.mp (Finset.mem_range.mp hi)), he (n - i) (Nat.sub_le _ _)] |
| 994 | |
| 995 | theorem moments_congr_prefix {n : ℕ} |
| 996 | {u e u' e' : PositiveOrderMoments.History} {omega omega' : ℝ → ℝ} |
| 997 | (hu : ∀ R, 0 < R → ∀ j ≤ n, u j R = u' j R) |
| 998 | (he : ∀ R, 0 < R → ∀ j ≤ n, e j R = e' j R) |
| 999 | (ho : ∀ R, 0 < R → omega R = omega' R) : |
| 1000 | PositiveOrderMoments.moments n u e omega = PositiveOrderMoments.moments n u' e' omega' := by |
| 1001 | funext i |
| 1002 | apply setIntegral_congr_fun measurableSet_Ioi |
| 1003 | intro R hR |
| 1004 | simp only [PositiveOrderMoments.rowDensity, PositiveOrderMoments.pressureGradient, |
| 1005 | cauchy_congr_prefix n R (hu R hR) (he R hR), cauchy_congr_prefix n R (hu R hR) (hu R hR), |
| 1006 | cauchy_congr_prefix n R (he R hR) (he R hR), hu R hR n le_rfl, he R hR n le_rfl, ho R hR] |
| 1007 | |
| 1008 | theorem sequence_step_spec {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) : |
| 1009 | StepProperties s n (fun j _ => sequence s j) (sequence s n) := by |
| 1010 | cases n with |
| 1011 | | zero => exact (Nat.lt_irrefl 0 hn).elim |
| 1012 | | succ n => rw [sequence_succ]; exact step_spec s _ _ |
| 1013 | |
| 1014 | theorem previousSource_sequence {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) : |
| 1015 | previousSource s n (fun j _ => sequence s j) = |
| 1016 | previousOmegaDivX s.domain (fun j => (profiles s j).axial) (fun j => (profiles s j).beta) n := by |
| 1017 | apply previousOmegaDivX_congr_prefix |
| 1018 | · intro j hj |
| 1019 | simp only [previousAxial, dite_eq_left hj, profiles] |
| 1020 | · intro j hj |
| 1021 | simp only [previousBeta, dite_eq_left hj, profiles] |
| 1022 | |
| 1023 | theorem updated_sequence_axial {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) |
| 1024 | {j : ℕ} (hj : j ≤ n) : |
| 1025 | Function.update (previousAxial s n (fun k _ => sequence s k)) n (profiles s n).axial j = |
| 1026 | (profiles s j).axial := by |
| 1027 | by_cases he : j = n |
| 1028 | · subst j; rw [Function.update_self] |
| 1029 | · rw [Function.update_of_ne he] |
| 1030 | have hjn : j < n := lt_of_le_of_ne hj he |
| 1031 | simp only [previousAxial, dite_eq_left hjn, profiles] |
| 1032 | |
| 1033 | theorem updated_sequence_phi {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) (n : ℕ) |
| 1034 | {j : ℕ} (hj : j ≤ n) : |
| 1035 | Function.update (previousPhi s n (fun k _ => sequence s k)) n (profiles s n).phi j = |
| 1036 | (profiles s j).phi := by |
| 1037 | by_cases he : j = n |
| 1038 | · subst j; rw [Function.update_self] |
| 1039 | · rw [Function.update_of_ne he] |
| 1040 | have hjn : j < n := lt_of_le_of_ne hj he |
| 1041 | simp only [previousPhi, dite_eq_left hjn, profiles] |
| 1042 | |
| 1043 | /-- All five actual total rows hold at every positive order of the same |
| 1044 | infinite sequence. The source is recomputed from that sequence's lower fields. -/ |
| 1045 | theorem profiles_moments {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) |
| 1046 | {eta : ℝ} (heta : eta ∈ S) : |
| 1047 | PositiveOrderMoments.moments n |
| 1048 | (PositiveOrderMoments.slice (fun j => ((profiles s j).axial : Field)) eta) |
| 1049 | (PositiveOrderMoments.slice (fun j => angularField C (profiles s j).phi) eta) |
| 1050 | (fun R => R ^ 2 / 2 * previousOmegaDivX s.domain |
| 1051 | (fun j => (profiles s j).axial) (fun j => (profiles s j).beta) n (R, eta)) = 0 := by |
| 1052 | have hm := (sequence_step_spec s hn).2.2 eta heta |
| 1053 | rw [← hm] |
| 1054 | apply moments_congr_prefix |
| 1055 | · intro R _ j hj |
| 1056 | exact congrArg (fun f : EvenProfile S => f (R, eta)) (updated_sequence_axial s n hj).symm |
| 1057 | · intro R _ j hj |
| 1058 | exact congrArg (fun f : EvenProfile S => angularField C f (R, eta)) (updated_sequence_phi s n hj).symm |
| 1059 | · intro R _ |
| 1060 | rw [previousSource_sequence] |
| 1061 | |
| 1062 | theorem profiles_beta_eq {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) : |
| 1063 | (profiles s n).beta = betaFromU s.domain (AxisSourceRegularity.slowOrder h n) (profiles s n).axial := |
| 1064 | (sequence_step_spec s hn).1 |
| 1065 | |
| 1066 | theorem profiles_pressure_eq {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) {n : ℕ} (hn : 0 < n) : |
| 1067 | (profiles s n).pressure = pressureFromSource s.domain.isOpen |
| 1068 | (pressureSource C (fun j => (profiles s j).phi) |
| 1069 | (previousOmegaDivX s.domain (fun j => (profiles s j).axial) |
| 1070 | (fun j => (profiles s j).beta) n) n) := by |
| 1071 | have hp := (sequence_step_spec s hn).2.1 |
| 1072 | change (profiles s n).pressure = _ at hp |
| 1073 | rw [previousSource_sequence] at hp |
| 1074 | exact hp.trans (congrArg (pressureFromSource s.domain.isOpen) |
| 1075 | (pressureSource_congr_prefix C _ n (fun j hj => updated_sequence_phi s n hj))) |
| 1076 | |
| 1077 | /-- Data required from the actual order-zero construction. No positive-order |
| 1078 | equations, moments, or extension properties are assumed here. -/ |
| 1079 | structure BaseData (S : Set ℝ) (C lam a b B : ℝ) where |
| 1080 | fields : Coefficient S |
| 1081 | axial_exterior : Exterior B S fields.axial |
| 1082 | beta_exterior : Exterior B S fields.beta |
| 1083 | amplitude : ℝ → ℝ |
| 1084 | amplitude_smooth : ContDiffOn ℝ ∞ amplitude S |
| 1085 | amplitude_ne : ∀ eta ∈ S, amplitude eta ≠ 0 |
| 1086 | axial_patch : ∀ eta ∈ S, ∀ R ∈ Ioo a b, fields.axial (R, eta) = 0 |
| 1087 | angular_patch : ∀ eta ∈ S, ∀ R ∈ Ioo a b, |
| 1088 | angularField C fields.phi (R, eta) = FiveRowRank.background lam (amplitude eta) R |
| 1089 | |
| 1090 | /-- The common cutoff is chosen strictly inside the hierarchy's proved |
| 1091 | radius; the moment patch begins beyond that cutoff. -/ |
| 1092 | noncomputable def schemeFromHierarchy {rho : ℝ} {U : Set ℂ} {S : Set ℝ} |
| 1093 | {h C lam inner stop a b B : ℝ} {base : Fin 5 → SimilarityProfile.InnerProfile} |
| 1094 | (A : SlowRecursion.LocalHierarchy rho U h C base) |
| 1095 | (hrho : 0 < rho) (hU : IsOpen U) (d : Domain S h) |
| 1096 | (hSU : ∀ eta ∈ S, (eta : ℂ) ∈ U) (hC : C ≠ 0) (hlam : 0 < lam) |
| 1097 | (his : inner < stop) (hsrho : stop < rho ^ 2) (hsa : stop < a ^ 2 / 2) |
| 1098 | (ha : 0 < a) (hab : a < b) (hbB : b ≤ B) (B0 : BaseData S C lam a b B) : Scheme S h C where |
| 1099 | domain := d |
| 1100 | nonzero_scale := hC |
| 1101 | lam := lam |
| 1102 | lam_pos := hlam |
| 1103 | a := a |
| 1104 | b := b |
| 1105 | B := B |
| 1106 | a_pos := ha |
| 1107 | a_lt_b := hab |
| 1108 | b_le_B := hbB |
| 1109 | amplitude := B0.amplitude |
| 1110 | amplitude_smooth := B0.amplitude_smooth |
| 1111 | amplitude_ne := B0.amplitude_ne |
| 1112 | base := B0.fields |
| 1113 | base_axial_exterior := B0.axial_exterior |
| 1114 | base_beta_exterior := B0.beta_exterior |
| 1115 | base_axial_patch := B0.axial_patch |
| 1116 | base_angular_patch := B0.angular_patch |
| 1117 | seedAxial n := cutoffLift hrho hU d.isOpen hSU his hsrho (A.coefficients n 1) |
| 1118 | seedPhi n := cutoffLift hrho hU d.isOpen hSU his hsrho (A.coefficients n 0) |
| 1119 | seedAxial_exterior n := by |
| 1120 | intro eta _ R hR |
| 1121 | apply cutoffLift_zero |
| 1122 | have haR : a ≤ R := hab.le.trans (hbB.trans hR) |
| 1123 | have hs : a ^ 2 ≤ R ^ 2 := (sq_le_sq₀ ha.le (ha.le.trans haR)).2 haR |
| 1124 | linarith |
| 1125 | seedPhi_exterior n := by |
| 1126 | intro eta _ R hR |
| 1127 | apply cutoffLift_zero |
| 1128 | have haR : a ≤ R := hab.le.trans (hbB.trans hR) |
| 1129 | have hs : a ^ 2 ≤ R ^ 2 := (sq_le_sq₀ ha.le (ha.le.trans haR)).2 haR |
| 1130 | linarith |
| 1131 | |
| 1132 | /-- The actual squared-radius profile. We use ordinary derivatives only |
| 1133 | at positive X; the axis jets are the right jets of this descent. -/ |
| 1134 | noncomputable def xProfile {S : Set ℝ} (f : EvenProfile S) (w : ℝ × ℝ) : ℝ := |
| 1135 | f (Real.sqrt (2 * w.1), w.2) |
| 1136 | |
| 1137 | theorem xProfile_radius {S : Set ℝ} (f : EvenProfile S) {R : ℝ} (hR : 0 ≤ R) (eta : ℝ) : |
| 1138 | xProfile f (R ^ 2 / 2, eta) = f (R, eta) := by |
| 1139 | simp only [xProfile, show 2 * (R ^ 2 / 2) = R ^ 2 by ring, Real.sqrt_sq hR] |
| 1140 | |
| 1141 | theorem xProfile_contDiffAt {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) |
| 1142 | {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : ContDiffAt ℝ ∞ (xProfile f) w := by |
| 1143 | have hf := f.smooth.contDiffAt (x := (Real.sqrt (2 * w.1), w.2)) |
| 1144 | ((isOpen_univ.prod hS).mem_nhds ⟨mem_univ _, heta⟩) |
| 1145 | exact hf.comp w (((Real.contDiffAt_sqrt (ne_of_gt (mul_pos (by norm_num) hX))).comp w |
| 1146 | (contDiffAt_const.mul contDiffAt_fst)).prodMk contDiffAt_snd) |
| 1147 | |
| 1148 | theorem partialX_hasDerivAt {f : Field} {w : ℝ × ℝ} (hf : DifferentiableAt ℝ f w) : |
| 1149 | HasDerivAt (fun X => f (X, w.2)) (SimilarityProfile.partialX f w) w.1 := by |
| 1150 | simpa only [SimilarityProfile.partialX, Function.comp_def, id_eq, Prod.eta] using |
| 1151 | hf.hasFDerivAt.comp_hasDerivAt w.1 ((hasDerivAt_id w.1).prodMk (hasDerivAt_const w.1 w.2)) |
| 1152 | |
| 1153 | theorem partialEta_hasDerivAt {f : Field} {w : ℝ × ℝ} (hf : DifferentiableAt ℝ f w) : |
| 1154 | HasDerivAt (fun eta => f (w.1, eta)) (SimilarityProfile.partialEta f w) w.2 := by |
| 1155 | simpa only [SimilarityProfile.partialEta, Function.comp_def, id_eq, Prod.eta] using |
| 1156 | hf.hasFDerivAt.comp_hasDerivAt w.2 ((hasDerivAt_const w.2 w.1).prodMk (hasDerivAt_id w.2)) |
| 1157 | |
| 1158 | theorem xProfile_partialEta {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) |
| 1159 | {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1160 | SimilarityProfile.partialEta (xProfile f) w = xProfile (etaDerivative hS f) w := |
| 1161 | (partialEta_hasDerivAt ((xProfile_contDiffAt hS f hX heta).differentiableAt (by simp))).unique |
| 1162 | (parameter_derivative hS f.smooth heta (Real.sqrt (2 * w.1))) |
| 1163 | |
| 1164 | theorem xProfile_partialX {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) |
| 1165 | {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1166 | SimilarityProfile.partialX (xProfile f) w = xProfile (xDerivative hS f) w := by |
| 1167 | let R := Real.sqrt (2 * w.1) |
| 1168 | have hR : R ≠ 0 := ne_of_gt (Real.sqrt_pos.mpr (mul_pos (by norm_num) hX)) |
| 1169 | have hd := ProfileHistories.radialPartial_hasDerivAt (PositiveOrderMoments.parameterDomain S hS) |
| 1170 | f.smooth (p := (R, w.2)) ⟨mem_univ _, heta⟩ |
| 1171 | have hs : HasDerivAt (fun X : ℝ => Real.sqrt (2 * X)) (1 / R) w.1 := by |
| 1172 | convert! (Real.hasDerivAt_sqrt (ne_of_gt (mul_pos (by norm_num) hX))).scomp w.1 |
| 1173 | ((hasDerivAt_id w.1).const_mul 2) using 1 |
| 1174 | dsimp [R] |
| 1175 | field_simp |
| 1176 | have hc := hd.scomp w.1 hs |
| 1177 | have hx := radius_mul_xDerivative hS f heta R |
| 1178 | change R * xDerivative hS f (R, w.2) = ProfileHistories.radialPartial f (R, w.2) at hx |
| 1179 | rw [← hx] at hc |
| 1180 | have he : (1 / R) • (R * xDerivative hS f (R, w.2)) = xDerivative hS f (R, w.2) := by |
| 1181 | rw [smul_eq_mul] |
| 1182 | field_simp |
| 1183 | rw [he] at hc |
| 1184 | exact (partialX_hasDerivAt ((xProfile_contDiffAt hS f hX heta).differentiableAt (by simp))).unique hc |
| 1185 | |
| 1186 | theorem xProfile_partialX_germ {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) |
| 1187 | {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1188 | SimilarityProfile.partialX (xProfile f) =ᶠ[𝓝 w] xProfile (xDerivative hS f) := by |
| 1189 | filter_upwards [(isOpen_Ioi.prod hS).mem_nhds ⟨hX, heta⟩] with p hp |
| 1190 | exact xProfile_partialX hS f hp.1 hp.2 |
| 1191 | |
| 1192 | theorem xProfile_partialXX {S : Set ℝ} (hS : IsOpen S) (f : EvenProfile S) |
| 1193 | {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1194 | SimilarityProfile.partialX (SimilarityProfile.partialX (xProfile f)) w = |
| 1195 | xProfile (xDerivative hS (xDerivative hS f)) w := by |
| 1196 | have he := (xProfile_partialX_germ hS f hX heta).fderiv_eq (𝕜 := ℝ) |
| 1197 | change (fderiv ℝ _ w) (1, 0) = _ |
| 1198 | rw [he] |
| 1199 | exact xProfile_partialX hS (xDerivative hS f) hX heta |
| 1200 | |
| 1201 | @[simp] theorem xProfile_add {S : Set ℝ} (f g : EvenProfile S) (w : ℝ × ℝ) : |
| 1202 | xProfile (f + g) w = xProfile f w + xProfile g w := rfl |
| 1203 | @[simp] theorem xProfile_sub {S : Set ℝ} (f g : EvenProfile S) (w : ℝ × ℝ) : |
| 1204 | xProfile (f - g) w = xProfile f w - xProfile g w := rfl |
| 1205 | @[simp] theorem xProfile_mul {S : Set ℝ} (f g : EvenProfile S) (w : ℝ × ℝ) : |
| 1206 | xProfile (f * g) w = xProfile f w * xProfile g w := rfl |
| 1207 | @[simp] theorem xProfile_constant (S : Set ℝ) (c : ℝ) (w : ℝ × ℝ) : |
| 1208 | xProfile (constant S c) w = c := rfl |
| 1209 | |
| 1210 | theorem xProfile_radiusSquared (S : Set ℝ) {w : ℝ × ℝ} (hX : 0 ≤ w.1) : |
| 1211 | xProfile (radiusSquared S) w = w.1 := by |
| 1212 | change (Real.sqrt (2 * w.1)) ^ 2 / 2 = w.1 |
| 1213 | rw [Real.sq_sqrt (mul_nonneg (by norm_num) hX)] |
| 1214 | ring |
| 1215 | |
| 1216 | theorem xProfile_timeOp {S : Set ℝ} {h : ℝ} (d : Domain S h) (b : ℝ) (f : EvenProfile S) |
| 1217 | {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1218 | xProfile (timeOp d b f) w = SimilarityProfile.T h b (xProfile f) w := by |
| 1219 | simp only [timeOp, xProfile_mul, xProfile_add, xProfile_constant, |
| 1220 | SimilarityProfile.T, CoordinateAlgebra.timeCoeff, |
| 1221 | xProfile_partialEta d.isOpen f hX heta, xProfile_partialX d.isOpen f hX heta, |
| 1222 | xProfile_radiusSquared S hX.le] |
| 1223 | change (-b * xProfile f w + SimilarityProfile.D h * w.2 * xProfile (etaDerivative d.isOpen f) w + |
| 1224 | w.1 * xProfile (xDerivative d.isOpen f) w) * (PositiveAxisSystem.ell h w.2)⁻¹ = _ |
| 1225 | rfl |
| 1226 | |
| 1227 | theorem xProfile_axialOp {S : Set ℝ} {h : ℝ} (d : Domain S h) (b : ℝ) (f : EvenProfile S) |
| 1228 | {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1229 | xProfile (axialOp d b f) w = SimilarityProfile.Z h b (xProfile f) w := by |
| 1230 | simp only [axialOp, xProfile_mul, xProfile_add, xProfile_sub, xProfile_constant, |
| 1231 | SimilarityProfile.Z, CoordinateAlgebra.axialCoeff, |
| 1232 | xProfile_partialEta d.isOpen f hX heta, xProfile_partialX d.isOpen f hX heta, |
| 1233 | xProfile_radiusSquared S hX.le] |
| 1234 | change (2 * b * w.2 * xProfile f w + (1 - w.2 ^ 2) * xProfile (etaDerivative d.isOpen f) w - |
| 1235 | 2 * w.2 * w.1 * xProfile (xDerivative d.isOpen f) w) * (PositiveAxisSystem.ell h w.2)⁻¹ = _ |
| 1236 | simp only [PositiveAxisSystem.ell, CoordinateAlgebra.L, CoordinateAlgebra.d, div_eq_mul_inv] |
| 1237 | ring |
| 1238 | |
| 1239 | theorem xProfile_axialOp_germ {S : Set ℝ} {h : ℝ} (d : Domain S h) (b : ℝ) (f : EvenProfile S) |
| 1240 | {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1241 | xProfile (axialOp d b f) =ᶠ[𝓝 w] SimilarityProfile.Z h b (xProfile f) := by |
| 1242 | filter_upwards [(isOpen_Ioi.prod d.isOpen).mem_nhds ⟨hX, heta⟩] with p hp |
| 1243 | exact xProfile_axialOp d b f hp.1 hp.2 |
| 1244 | |
| 1245 | theorem xProfile_axialOp2 {S : Set ℝ} {h : ℝ} (d : Domain S h) (b : ℝ) (f : EvenProfile S) |
| 1246 | {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1247 | xProfile (axialOp2 d b f) w = AxisSourceRegularity.Z2 h b (xProfile f) w := by |
| 1248 | rw [axialOp2, xProfile_axialOp d _ _ hX heta] |
| 1249 | exact AxisSourceRegularity.Z_congr_germ h _ (xProfile_axialOp_germ d b f hX heta) |
| 1250 | |
| 1251 | theorem xProfile_previousOmegaDivX {S : Set ℝ} {h : ℝ} (d : Domain S h) |
| 1252 | (u beta : ℕ → EvenProfile S) (n : ℕ) {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1253 | xProfile (previousOmegaDivX d u beta n) w = |
| 1254 | AxisSourceRegularity.previousOmegaDivX h (fun j => xProfile (u j)) |
| 1255 | (fun j => xProfile (beta j)) n w := by |
| 1256 | cases n with |
| 1257 | | zero => rfl |
| 1258 | | succ k => |
| 1259 | have hsum (q : ℕ × ℕ → EvenProfile S) : xProfile (∑ ij ∈ Finset.antidiagonal k, q ij) w = |
| 1260 | ∑ ij ∈ Finset.antidiagonal k, xProfile (q ij) w := sum_apply _ q _ |
| 1261 | have hs : xProfile (shiftedAxial d beta k) w = |
| 1262 | AxisSourceRegularity.shiftedAxialFactor h (fun j => xProfile (beta j)) k w := by |
| 1263 | cases k with |
| 1264 | | zero => rfl |
| 1265 | | succ k => exact xProfile_axialOp2 d _ _ hX heta |
| 1266 | simp only [previousOmegaDivX, AxisSourceRegularity.previousOmegaDivX, omegaDivX, |
| 1267 | AxisSourceRegularity.omegaDivX, xProfile_sub, xProfile_add, xProfile_mul, |
| 1268 | xProfile_constant, hsum, hs, xProfile_timeOp d _ _ hX heta, |
| 1269 | xProfile_radiusSquared S hX.le] |
| 1270 | simp only [ |
| 1271 | xProfile_axialOp d _ _ hX heta, xProfile_partialX d.isOpen _ hX heta, |
| 1272 | xProfile_partialXX d.isOpen _ hX heta] |
| 1273 | congr 3 |
| 1274 | apply Finset.sum_congr rfl |
| 1275 | intro ij _ |
| 1276 | ring |
| 1277 | |
| 1278 | theorem cutoffLift_xProfile {rho : ℝ} {U : Set ℂ} {S : Set ℝ} |
| 1279 | (hrho : 0 < rho) (hU : IsOpen U) (hS : IsOpen S) (hSU : ∀ eta ∈ S, (eta : ℂ) ∈ U) |
| 1280 | {inner stop : ℝ} (his : inner < stop) (hsrho : stop < rho ^ 2) |
| 1281 | (f : SlowRecursion.AxisFunction rho U) {w : ℝ × ℝ} |
| 1282 | (hX : 0 ≤ w.1) (hi : w.1 ≤ inner) : |
| 1283 | xProfile (cutoffLift hrho hU hS hSU his hsrho f) w = SlowRecursion.profile f w := by |
| 1284 | have hs : (Real.sqrt (2 * w.1)) ^ 2 / 2 = w.1 := by |
| 1285 | rw [Real.sq_sqrt (mul_nonneg (by norm_num) hX)]; ring |
| 1286 | unfold xProfile |
| 1287 | rw [cutoffLift_eq hrho hU hS hSU his hsrho f (by simpa only [hs] using hi)] |
| 1288 | change (f (Real.sqrt (2 * w.1) / Real.sqrt 2, (w.2 : ℂ))).re = |
| 1289 | (f (Real.sqrt w.1, (w.2 : ℂ))).re |
| 1290 | rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 2)] |
| 1291 | have hz : Real.sqrt 2 ≠ 0 := (Real.sqrt_pos.mpr (by norm_num)).ne' |
| 1292 | rw [mul_div_cancel_left₀ _ hz] |
| 1293 | |
| 1294 | /-- A transparent interface supplied by the common cutoff constructor. -/ |
| 1295 | structure Localization {S : Set ℝ} {h C rho : ℝ} {U : Set ℂ} |
| 1296 | {base : Fin 5 → SimilarityProfile.InnerProfile} (s : Scheme S h C) |
| 1297 | (A : SlowRecursion.LocalHierarchy rho U h C base) (inner : ℝ) : Prop where |
| 1298 | radius_pos : 0 < rho |
| 1299 | parameter_open : IsOpen U |
| 1300 | parameter_embedding : ∀ eta ∈ S, (eta : ℂ) ∈ U |
| 1301 | inner_pos : 0 < inner |
| 1302 | inner_radius : inner < rho ^ 2 |
| 1303 | inner_patch : inner < s.a ^ 2 / 2 |
| 1304 | axial_seed : ∀ n w, 0 ≤ w.1 → w.1 ≤ inner → |
| 1305 | xProfile (s.seedAxial n) w = SlowRecursion.profile (A.coefficients n 1) w |
| 1306 | phi_seed : ∀ n w, 0 ≤ w.1 → w.1 ≤ inner → |
| 1307 | xProfile (s.seedPhi n) w = SlowRecursion.profile (A.coefficients n 0) w |
| 1308 | |
| 1309 | theorem localizationFromHierarchy {rho : ℝ} {U : Set ℂ} {S : Set ℝ} |
| 1310 | {h C lam inner stop a b B : ℝ} {base : Fin 5 → SimilarityProfile.InnerProfile} |
| 1311 | (A : SlowRecursion.LocalHierarchy rho U h C base) |
| 1312 | (hrho : 0 < rho) (hU : IsOpen U) (d : Domain S h) |
| 1313 | (hSU : ∀ eta ∈ S, (eta : ℂ) ∈ U) (hC : C ≠ 0) (hlam : 0 < lam) |
| 1314 | (hi : 0 < inner) (his : inner < stop) (hsrho : stop < rho ^ 2) (hsa : stop < a ^ 2 / 2) |
| 1315 | (ha : 0 < a) (hab : a < b) (hbB : b ≤ B) (B0 : BaseData S C lam a b B) : |
| 1316 | Localization (schemeFromHierarchy A hrho hU d hSU hC hlam his hsrho hsa ha hab hbB B0) A inner := by |
| 1317 | refine ⟨hrho, hU, hSU, hi, his.trans hsrho, his.trans hsa, ?_, ?_⟩ |
| 1318 | · intro n w hX hwi |
| 1319 | exact cutoffLift_xProfile hrho hU d.isOpen hSU his hsrho (A.coefficients n 1) hX hwi |
| 1320 | · intro n w hX hwi |
| 1321 | exact cutoffLift_xProfile hrho hU d.isOpen hSU his hsrho (A.coefficients n 0) hX hwi |
| 1322 | |
| 1323 | theorem actual_previousOmega_congr_germ (h : ℝ) {u beta u' beta' : ℕ → Field} |
| 1324 | (n : ℕ) {w : ℝ × ℝ} |
| 1325 | (hu : ∀ j < n, u j =ᶠ[𝓝 w] u' j) (hb : ∀ j < n, beta j =ᶠ[𝓝 w] beta' j) : |
| 1326 | AxisSourceRegularity.previousOmegaDivX h u beta n w = |
| 1327 | AxisSourceRegularity.previousOmegaDivX h u' beta' n w := by |
| 1328 | cases n with |
| 1329 | | zero => rfl |
| 1330 | | succ k => |
| 1331 | have hbk := hb k (Nat.lt_succ_self k) |
| 1332 | have ht := SlowResidualMatching.T_congr_germ h (AxisSourceRegularity.slowOrder h k - 1) hbk |
| 1333 | have hx := (SlowResidualMatching.partialX_congr_germ hbk).eq_of_nhds |
| 1334 | have hxx := (SlowResidualMatching.partialX_congr_germ |
| 1335 | (SlowResidualMatching.partialX_congr_germ hbk)).eq_of_nhds |
| 1336 | have hshift : AxisSourceRegularity.shiftedAxialFactor h beta k w = |
| 1337 | AxisSourceRegularity.shiftedAxialFactor h beta' k w := by |
| 1338 | cases k with |
| 1339 | | zero => rfl |
| 1340 | | succ k => |
| 1341 | exact AxisSourceRegularity.Z_congr_germ h _ |
| 1342 | (SlowResidualMatching.Z_congr_germ h _ (hb k (by omega))) |
| 1343 | have hsum : (∑ ij ∈ Finset.antidiagonal k, |
| 1344 | (beta ij.1 w * (beta ij.2 w / 2 + w.1 * SimilarityProfile.partialX (beta ij.2) w) + |
| 1345 | u ij.1 w * SimilarityProfile.Z h (AxisSourceRegularity.slowOrder h ij.2 - 1) (beta ij.2) w)) = |
| 1346 | (∑ ij ∈ Finset.antidiagonal k, |
| 1347 | (beta' ij.1 w * (beta' ij.2 w / 2 + w.1 * SimilarityProfile.partialX (beta' ij.2) w) + |
| 1348 | u' ij.1 w * SimilarityProfile.Z h (AxisSourceRegularity.slowOrder h ij.2 - 1) (beta' ij.2) w)) := by |
| 1349 | apply Finset.sum_congr rfl |
| 1350 | intro ij hij |
| 1351 | have hi := AxisSourceRegularity.antidiagonal_indices_le hij |
| 1352 | have hi' : ij.1 < k + 1 := Nat.lt_succ_iff.mpr hi.1 |
| 1353 | have hj' : ij.2 < k + 1 := Nat.lt_succ_iff.mpr hi.2 |
| 1354 | rw [(hb _ hi').eq_of_nhds, (hb _ hj').eq_of_nhds, (hu _ hi').eq_of_nhds, |
| 1355 | (SlowResidualMatching.partialX_congr_germ (hb _ hj')).eq_of_nhds, |
| 1356 | AxisSourceRegularity.Z_congr_germ h _ (hb _ hj')] |
| 1357 | simp only [AxisSourceRegularity.previousOmegaDivX, AxisSourceRegularity.omegaDivX, |
| 1358 | ht, hx, hxx, hshift, hsum] |
| 1359 | |
| 1360 | /-- Agreement of the finite order-zero input with the same local hierarchy. |
| 1361 | These are identities on an inner region, not positive-order hypotheses. -/ |
| 1362 | structure BaseAgreement {S : Set ℝ} {h C rho : ℝ} {U : Set ℂ} |
| 1363 | {base : Fin 5 → SimilarityProfile.InnerProfile} (s : Scheme S h C) |
| 1364 | (A : SlowRecursion.LocalHierarchy rho U h C base) (inner : ℝ) : Prop where |
| 1365 | phi : ∀ w : ℝ × ℝ, 0 ≤ w.1 → w.1 < inner → w.2 ∈ S → |
| 1366 | xProfile s.base.phi w = SlowRecursion.profile (A.coefficients 0 0) w |
| 1367 | axial : ∀ w : ℝ × ℝ, 0 ≤ w.1 → w.1 < inner → w.2 ∈ S → |
| 1368 | xProfile s.base.axial w = SlowRecursion.profile (A.coefficients 0 1) w |
| 1369 | beta : ∀ w : ℝ × ℝ, 0 ≤ w.1 → w.1 < inner → w.2 ∈ S → |
| 1370 | xProfile s.base.beta w = SlowRecursion.profile (A.coefficients 0 4) w |
| 1371 | |
| 1372 | section LocalAgreement |
| 1373 | |
| 1374 | variable {S : Set ℝ} {h C rho inner : ℝ} {U : Set ℂ} |
| 1375 | {base : Fin 5 → SimilarityProfile.InnerProfile} |
| 1376 | {s : Scheme S h C} {A : SlowRecursion.LocalHierarchy rho U h C base} |
| 1377 | (L : Localization s A inner) |
| 1378 | |
| 1379 | include L |
| 1380 | |
| 1381 | theorem profiles_x_inner_axial {n : ℕ} (hn : 0 < n) {w : ℝ × ℝ} |
| 1382 | (hX : 0 ≤ w.1) (hi : w.1 ≤ inner) : |
| 1383 | xProfile (profiles s n).axial w = SlowRecursion.profile (A.coefficients n 1) w := by |
| 1384 | have hs : (Real.sqrt (2 * w.1)) ^ 2 = 2 * w.1 := Real.sq_sqrt (mul_nonneg (by norm_num) hX) |
| 1385 | have hr : |Real.sqrt (2 * w.1)| ≤ s.a := by |
| 1386 | rw [abs_of_nonneg (Real.sqrt_nonneg _)] |
| 1387 | exact (sq_le_sq₀ (Real.sqrt_nonneg _) s.a_pos.le).mp (by linarith [L.inner_patch]) |
| 1388 | change (profiles s n).axial (Real.sqrt (2 * w.1), w.2) = _ |
| 1389 | rw [profiles_inner_axial s hn hr] |
| 1390 | exact L.axial_seed n w hX hi |
| 1391 | |
| 1392 | theorem profiles_x_inner_phi {n : ℕ} (hn : 0 < n) {w : ℝ × ℝ} |
| 1393 | (hX : 0 ≤ w.1) (hi : w.1 ≤ inner) : |
| 1394 | xProfile (profiles s n).phi w = SlowRecursion.profile (A.coefficients n 0) w := by |
| 1395 | have hs : (Real.sqrt (2 * w.1)) ^ 2 = 2 * w.1 := Real.sq_sqrt (mul_nonneg (by norm_num) hX) |
| 1396 | have hr : |Real.sqrt (2 * w.1)| ≤ s.a := by |
| 1397 | rw [abs_of_nonneg (Real.sqrt_nonneg _)] |
| 1398 | exact (sq_le_sq₀ (Real.sqrt_nonneg _) s.a_pos.le).mp (by linarith [L.inner_patch]) |
| 1399 | change (profiles s n).phi (Real.sqrt (2 * w.1), w.2) = _ |
| 1400 | rw [profiles_inner_phi s hn hr] |
| 1401 | exact L.phi_seed n w hX hi |
| 1402 | |
| 1403 | theorem local_profile_smoothAt (n : ℕ) (i : Fin 5) {w : ℝ × ℝ} |
| 1404 | (hX : 0 < w.1) (hi : w.1 < rho ^ 2) (heta : w.2 ∈ S) : |
| 1405 | ContDiffAt ℝ ∞ (SlowRecursion.profile (A.coefficients n i)) w := by |
| 1406 | have hs : ContDiffOn ℝ ∞ (SlowRecursion.profile (A.coefficients n i)) |
| 1407 | (Ioo (0 : ℝ) (rho ^ 2) ×ˢ PositiveAxisExistence.realParameterDomain U) := |
| 1408 | (A.profiles_smooth L.radius_pos L.parameter_open n i).mono |
| 1409 | (Set.prod_mono Ioo_subset_Ico_self Subset.rfl) |
| 1410 | exact hs.contDiffAt ((isOpen_Ioo.prod (PositiveAxisExistence.realParameterDomain_isOpen L.parameter_open)).mem_nhds |
| 1411 | ⟨⟨hX, hi⟩, L.parameter_embedding w.2 heta⟩) |
| 1412 | |
| 1413 | omit L in |
| 1414 | /-- An actual substitution in the mass integral, with no axis differentiability |
| 1415 | assumption on the squared-radius function. -/ |
| 1416 | theorem massHistory_of_composition (u : EvenProfile S) (g : Field) {R eta : ℝ} |
| 1417 | (hR : 0 ≤ R) (hg : ContinuousOn (fun X => g (X, eta)) (Icc 0 (R ^ 2 / 2))) |
| 1418 | (hu : ∀ r ∈ Icc 0 R, u (r, eta) = g (r ^ 2 / 2, eta)) : |
| 1419 | PositiveOrderMoments.massHistory u (R, eta) = ProfileHistories.primitive g (R ^ 2 / 2, eta) := by |
| 1420 | have hder (r : ℝ) : HasDerivAt (fun x : ℝ => x ^ 2 / 2) r r := by |
| 1421 | convert! ((hasDerivAt_id r).pow 2).div_const 2 using 1 |
| 1422 | norm_num |
| 1423 | have him : (fun r : ℝ => r ^ 2 / 2) '' uIcc 0 R ⊆ Icc 0 (R ^ 2 / 2) := by |
| 1424 | rintro _ ⟨r, hr, rfl⟩ |
| 1425 | rw [uIcc_of_le hR] at hr |
| 1426 | constructor |
| 1427 | · positivity |
| 1428 | · have hs := (sq_le_sq₀ hr.1 hR).2 hr.2 |
| 1429 | linarith |
| 1430 | have hint := intervalIntegral.integral_comp_mul_deriv' |
| 1431 | (f := fun r : ℝ => r ^ 2 / 2) (f' := fun r => r) (g := fun X => g (X, eta)) |
| 1432 | (fun r _ => hder r) continuousOn_id (hg.mono him) |
| 1433 | simp only [zero_pow (by norm_num : 2 ≠ 0), zero_div, Function.comp_apply] at hint |
| 1434 | change (∫ r in (0 : ℝ)..R, r * u (r, eta)) = ∫ X in (0 : ℝ)..(R ^ 2 / 2), g (X, eta) |
| 1435 | rw [← hint] |
| 1436 | apply intervalIntegral.integral_congr |
| 1437 | intro r hr |
| 1438 | rw [uIcc_of_le hR] at hr |
| 1439 | change r * u (r, eta) = g (r ^ 2 / 2, eta) * r |
| 1440 | rw [hu r hr, mul_comm] |
| 1441 | |
| 1442 | theorem local_mass {n : ℕ} (hn : 0 < n) {R eta : ℝ} (hR : 0 ≤ R) |
| 1443 | (hi : R ^ 2 / 2 ≤ inner) (heta : eta ∈ S) : |
| 1444 | PositiveOrderMoments.massHistory (profiles s n).axial (R, eta) = R ^ 2 / 2 * |
| 1445 | (SlowRecursion.profile (A.coefficients n 1) (R ^ 2 / 2, eta) + |
| 1446 | SlowRecursion.profile (A.coefficients n 2) (R ^ 2 / 2, eta)) := by |
| 1447 | have hX : 0 ≤ R ^ 2 / 2 := by positivity |
| 1448 | have hxrho : R ^ 2 / 2 < rho ^ 2 := hi.trans_lt L.inner_radius |
| 1449 | have hg : ContinuousOn (fun X => SlowRecursion.profile (A.coefficients n 1) (X, eta)) |
| 1450 | (Icc 0 (R ^ 2 / 2)) := |
| 1451 | (A.profiles_smooth L.radius_pos L.parameter_open n 1).continuousOn.comp |
| 1452 | (continuous_id.prodMk continuous_const).continuousOn |
| 1453 | (fun X hXX => ⟨⟨hXX.1, hXX.2.trans_lt hxrho⟩, L.parameter_embedding eta heta⟩) |
| 1454 | rw [massHistory_of_composition (profiles s n).axial _ hR hg] |
| 1455 | · rw [ProfileHistories.primitive_eq_mul_average, A.average n hn _ ⟨hX, hxrho⟩ eta |
| 1456 | (L.parameter_embedding eta heta)] |
| 1457 | · intro r hr |
| 1458 | have hs : r ^ 2 / 2 ≤ inner := by |
| 1459 | have hsq := (sq_le_sq₀ hr.1 hR).2 hr.2 |
| 1460 | linarith |
| 1461 | rw [← xProfile_radius (profiles s n).axial hr.1 eta] |
| 1462 | exact profiles_x_inner_axial L hn (by positivity) hs |
| 1463 | |
| 1464 | theorem local_parameterMass {n : ℕ} (hn : 0 < n) {R eta : ℝ} (hR : 0 < R) |
| 1465 | (hi : R ^ 2 / 2 ≤ inner) (heta : eta ∈ S) : |
| 1466 | PositiveOrderMoments.parameterMassHistory (profiles s n).axial (R, eta) = R ^ 2 / 2 * |
| 1467 | (SimilarityProfile.partialEta (SlowRecursion.profile (A.coefficients n 1)) (R ^ 2 / 2, eta) + |
| 1468 | SimilarityProfile.partialEta (SlowRecursion.profile (A.coefficients n 2)) (R ^ 2 / 2, eta)) := by |
| 1469 | have hX : 0 < R ^ 2 / 2 := div_pos (sq_pos_of_pos hR) (by norm_num) |
| 1470 | have hxr : R ^ 2 / 2 < rho ^ 2 := hi.trans_lt L.inner_radius |
| 1471 | have hmassSmooth := ProfileHistories.primitive_smooth (PositiveOrderMoments.parameterDomain S s.domain.isOpen) |
| 1472 | (contDiffOn_fst.mul (profiles s n).axial.smooth) |
| 1473 | have hd := parameter_derivative s.domain.isOpen hmassSmooth heta R |
| 1474 | change HasDerivAt (fun t => PositiveOrderMoments.massHistory (profiles s n).axial (R, t)) |
| 1475 | (ProfileHistories.parameterPartial (PositiveOrderMoments.massHistory (profiles s n).axial) (R, eta)) eta at hd |
| 1476 | rw [PositiveOrderMoments.massHistory_parameterPartial_on s.domain.isOpen (profiles s n).axial.smooth heta] at hd |
| 1477 | have hu := partialEta_hasDerivAt ((local_profile_smoothAt L n 1 (w := (R ^ 2 / 2, eta)) hX hxr heta).differentiableAt (by simp)) |
| 1478 | have hk := partialEta_hasDerivAt ((local_profile_smoothAt L n 2 (w := (R ^ 2 / 2, eta)) hX hxr heta).differentiableAt (by simp)) |
| 1479 | have he : (fun t => PositiveOrderMoments.massHistory (profiles s n).axial (R, t)) =ᶠ[𝓝 eta] |
| 1480 | fun t => R ^ 2 / 2 * (SlowRecursion.profile (A.coefficients n 1) (R ^ 2 / 2, t) + |
| 1481 | SlowRecursion.profile (A.coefficients n 2) (R ^ 2 / 2, t)) := by |
| 1482 | filter_upwards [s.domain.isOpen.mem_nhds heta] with t ht |
| 1483 | exact local_mass L hn hR.le hi ht |
| 1484 | exact hd.unique (((hu.add hk).const_mul (R ^ 2 / 2)).congr_of_eventuallyEq he) |
| 1485 | |
| 1486 | theorem profiles_radial_inner_beta_pos {n : ℕ} (hn : 0 < n) {R eta : ℝ} (hR : 0 < R) |
| 1487 | (hi : R ^ 2 / 2 ≤ inner) (heta : eta ∈ S) : |
| 1488 | (profiles s n).beta (R, eta) = SlowRecursion.profile (A.coefficients n 4) (R ^ 2 / 2, eta) := by |
| 1489 | have hX : 0 < R ^ 2 / 2 := div_pos (sq_pos_of_pos hR) (by norm_num) |
| 1490 | have hu : (profiles s n).axial (R, eta) = |
| 1491 | SlowRecursion.profile (A.coefficients n 1) (R ^ 2 / 2, eta) := by |
| 1492 | rw [← xProfile_radius (profiles s n).axial hR.le eta] |
| 1493 | exact profiles_x_inner_axial L hn hX.le hi |
| 1494 | have hb := A.beta n hn _ ⟨hX, hi.trans_lt L.inner_radius⟩ eta (L.parameter_embedding eta heta) |
| 1495 | rw [PositiveAxisExistence.newBeta, PositiveAxisSystem.betaValue_eq_average_formula] at hb |
| 1496 | have hf := betaFromU_eq_fluxHistory s.domain (AxisSourceRegularity.slowOrder h n) |
| 1497 | (profiles s n).axial (w := (R, eta)) heta |
| 1498 | rw [← profiles_beta_eq s hn] at hf |
| 1499 | apply mul_left_cancel₀ hX.ne' |
| 1500 | rw [hf, PositiveOrderMoments.fluxHistory, hu, local_mass L hn hR.le hi heta, |
| 1501 | local_parameterMass L hn hR hi heta, hb] |
| 1502 | simp only [PositiveAxisSystem.actualJet, AxisSourceRegularity.slowOrder, PositiveAxisSystem.slowPower] |
| 1503 | ring |
| 1504 | |
| 1505 | noncomputable def localExtension (n : ℕ) (i : Fin 5) : EvenProfile S := |
| 1506 | cutoffLift L.radius_pos L.parameter_open s.domain.isOpen L.parameter_embedding |
| 1507 | (inner := inner) (stop := (inner + rho ^ 2) / 2) |
| 1508 | (by linarith [L.inner_radius]) (by linarith [L.inner_radius]) (A.coefficients n i) |
| 1509 | |
| 1510 | theorem localExtension_xProfile (n : ℕ) (i : Fin 5) {w : ℝ × ℝ} |
| 1511 | (hX : 0 ≤ w.1) (hi : w.1 ≤ inner) : |
| 1512 | xProfile (localExtension L n i) w = SlowRecursion.profile (A.coefficients n i) w := |
| 1513 | cutoffLift_xProfile L.radius_pos L.parameter_open s.domain.isOpen L.parameter_embedding _ _ _ hX hi |
| 1514 | |
| 1515 | theorem localExtension_radial (n : ℕ) (i : Fin 5) {R eta : ℝ} (hR : 0 ≤ R) |
| 1516 | (hi : R ^ 2 / 2 ≤ inner) : |
| 1517 | localExtension L n i (R, eta) = SlowRecursion.profile (A.coefficients n i) (R ^ 2 / 2, eta) := by |
| 1518 | rw [← xProfile_radius (localExtension L n i) hR eta] |
| 1519 | exact localExtension_xProfile L n i (by positivity) hi |
| 1520 | |
| 1521 | theorem localExtension_germ (n : ℕ) (i : Fin 5) {w : ℝ × ℝ} |
| 1522 | (hX : 0 < w.1) (hi : w.1 < inner) : |
| 1523 | xProfile (localExtension L n i) =ᶠ[𝓝 w] SlowRecursion.profile (A.coefficients n i) := by |
| 1524 | filter_upwards [(isOpen_Ioo.prod isOpen_univ).mem_nhds ⟨⟨hX, hi⟩, mem_univ w.2⟩] with p hp |
| 1525 | exact localExtension_xProfile L n i hp.1.1.le hp.1.2.le |
| 1526 | |
| 1527 | theorem localExtension_axis {n : ℕ} (hn : 0 < n) (i : Fin 5) {eta : ℝ} (heta : eta ∈ S) : |
| 1528 | localExtension L n i (0, eta) = 0 := by |
| 1529 | rw [localExtension_radial L n i le_rfl (by simpa using L.inner_pos.le)] |
| 1530 | simp only [zero_pow (by norm_num : 2 ≠ 0), zero_div, SlowRecursion.profile, Real.sqrt_zero] |
| 1531 | rw [A.zero_axis n hn i _ (L.parameter_embedding eta heta)] |
| 1532 | rfl |
| 1533 | |
| 1534 | theorem profiles_radial_inner_beta_axis {n : ℕ} (hn : 0 < n) {eta : ℝ} (heta : eta ∈ S) : |
| 1535 | (profiles s n).beta (0, eta) = localExtension L n 4 (0, eta) := by |
| 1536 | have hs : 0 < Real.sqrt inner := Real.sqrt_pos.mpr L.inner_pos |
| 1537 | have he : EqOn (fun R => (profiles s n).beta (R, eta)) (fun R => localExtension L n 4 (R, eta)) |
| 1538 | (Ioo 0 (Real.sqrt inner)) := by |
| 1539 | intro R hR |
| 1540 | have hi : R ^ 2 / 2 ≤ inner := by |
| 1541 | have hh := (sq_le_sq₀ hR.1.le hs.le).2 hR.2.le |
| 1542 | rw [Real.sq_sqrt L.inner_pos.le] at hh |
| 1543 | nlinarith [sq_nonneg R] |
| 1544 | change (profiles s n).beta (R, eta) = localExtension L n 4 (R, eta) |
| 1545 | rw [profiles_radial_inner_beta_pos L hn hR.1 hi heta, localExtension_radial L n 4 hR.1.le hi] |
| 1546 | have hc := he.closure (slice_smooth (profiles s n).beta.smooth heta).continuous |
| 1547 | (slice_smooth (localExtension L n 4).smooth heta).continuous |
| 1548 | apply hc |
| 1549 | rw [closure_Ioo hs.ne] |
| 1550 | exact ⟨le_rfl, hs.le⟩ |
| 1551 | |
| 1552 | theorem profiles_x_inner_beta {n : ℕ} (hn : 0 < n) {w : ℝ × ℝ} |
| 1553 | (hX : 0 ≤ w.1) (hi : w.1 ≤ inner) (heta : w.2 ∈ S) : |
| 1554 | xProfile (profiles s n).beta w = SlowRecursion.profile (A.coefficients n 4) w := by |
| 1555 | have hs : (Real.sqrt (2 * w.1)) ^ 2 / 2 = w.1 := by |
| 1556 | rw [Real.sq_sqrt (mul_nonneg (by norm_num) hX)]; ring |
| 1557 | by_cases h0 : w.1 = 0 |
| 1558 | · have he := profiles_radial_inner_beta_axis L hn heta |
| 1559 | have hw : w = (0, w.2) := Prod.ext h0 rfl |
| 1560 | rw [hw] |
| 1561 | simpa only [xProfile, mul_zero, Real.sqrt_zero, zero_pow (by norm_num : 2 ≠ 0), zero_div] using |
| 1562 | he.trans (localExtension_radial L n 4 le_rfl (by simpa using L.inner_pos.le)) |
| 1563 | · have hp : 0 < w.1 := lt_of_le_of_ne hX (Ne.symm h0) |
| 1564 | have hr : 0 < Real.sqrt (2 * w.1) := Real.sqrt_pos.mpr (mul_pos (by norm_num) hp) |
| 1565 | change (profiles s n).beta (Real.sqrt (2 * w.1), w.2) = _ |
| 1566 | simpa only [hs, Prod.eta] using profiles_radial_inner_beta_pos L hn hr (by simpa only [hs] using hi) heta |
| 1567 | |
| 1568 | variable (B0 : BaseAgreement s A inner) |
| 1569 | |
| 1570 | include B0 |
| 1571 | |
| 1572 | theorem profiles_x_phi_germ (n : ℕ) {w : ℝ × ℝ} |
| 1573 | (hX : 0 < w.1) (hi : w.1 < inner) (heta : w.2 ∈ S) : |
| 1574 | xProfile (profiles s n).phi =ᶠ[𝓝 w] SlowRecursion.profile (A.coefficients n 0) := by |
| 1575 | filter_upwards [(isOpen_Ioo.prod s.domain.isOpen).mem_nhds ⟨⟨hX, hi⟩, heta⟩] with p hp |
| 1576 | by_cases hn : n = 0 |
| 1577 | · subst n |
| 1578 | rw [profiles_zero] |
| 1579 | exact B0.phi p hp.1.1.le hp.1.2 hp.2 |
| 1580 | · exact profiles_x_inner_phi L (Nat.pos_of_ne_zero hn) hp.1.1.le hp.1.2.le |
| 1581 | |
| 1582 | theorem profiles_x_axial_germ (n : ℕ) {w : ℝ × ℝ} |
| 1583 | (hX : 0 < w.1) (hi : w.1 < inner) (heta : w.2 ∈ S) : |
| 1584 | xProfile (profiles s n).axial =ᶠ[𝓝 w] SlowRecursion.profile (A.coefficients n 1) := by |
| 1585 | filter_upwards [(isOpen_Ioo.prod s.domain.isOpen).mem_nhds ⟨⟨hX, hi⟩, heta⟩] with p hp |
| 1586 | by_cases hn : n = 0 |
| 1587 | · subst n |
| 1588 | rw [profiles_zero] |
| 1589 | exact B0.axial p hp.1.1.le hp.1.2 hp.2 |
| 1590 | · exact profiles_x_inner_axial L (Nat.pos_of_ne_zero hn) hp.1.1.le hp.1.2.le |
| 1591 | |
| 1592 | theorem profiles_x_beta_germ (n : ℕ) {w : ℝ × ℝ} |
| 1593 | (hX : 0 < w.1) (hi : w.1 < inner) (heta : w.2 ∈ S) : |
| 1594 | xProfile (profiles s n).beta =ᶠ[𝓝 w] SlowRecursion.profile (A.coefficients n 4) := by |
| 1595 | filter_upwards [(isOpen_Ioo.prod s.domain.isOpen).mem_nhds ⟨⟨hX, hi⟩, heta⟩] with p hp |
| 1596 | by_cases hn : n = 0 |
| 1597 | · subst n |
| 1598 | rw [profiles_zero] |
| 1599 | exact B0.beta p hp.1.1.le hp.1.2 hp.2 |
| 1600 | · exact profiles_x_inner_beta L (Nat.pos_of_ne_zero hn) hp.1.1.le hp.1.2.le hp.2 |
| 1601 | |
| 1602 | theorem profiles_source_local (n : ℕ) {w : ℝ × ℝ} |
| 1603 | (hX : 0 < w.1) (hi : w.1 < inner) (heta : w.2 ∈ S) : |
| 1604 | xProfile (previousOmegaDivX s.domain (fun j => (profiles s j).axial) |
| 1605 | (fun j => (profiles s j).beta) n) w = |
| 1606 | AxisSourceRegularity.previousOmegaDivX h (fun j => SlowRecursion.profile (A.coefficients j 1)) |
| 1607 | (fun j => SlowRecursion.profile (A.coefficients j 4)) n w := by |
| 1608 | rw [xProfile_previousOmegaDivX s.domain _ _ _ hX heta] |
| 1609 | exact actual_previousOmega_congr_germ h n |
| 1610 | (fun j _ => profiles_x_axial_germ L B0 j hX hi heta) |
| 1611 | (fun j _ => profiles_x_beta_germ L B0 j hX hi heta) |
| 1612 | |
| 1613 | theorem profiles_pressureSource_local {n : ℕ} (hn : 0 < n) {R eta : ℝ} (hR : 0 < R) |
| 1614 | (hi : R ^ 2 / 2 < inner) (heta : eta ∈ S) : |
| 1615 | pressureSource C (fun j => (profiles s j).phi) |
| 1616 | (previousOmegaDivX s.domain (fun j => (profiles s j).axial) (fun j => (profiles s j).beta) n) n (R, eta) = |
| 1617 | SimilarityProfile.partialX (SlowRecursion.profile (A.coefficients n 3)) (R ^ 2 / 2, eta) := by |
| 1618 | have hX : 0 < R ^ 2 / 2 := div_pos (sq_pos_of_pos hR) (by norm_num) |
| 1619 | have ho := profiles_source_local L B0 n (w := (R ^ 2 / 2, eta)) hX hi heta |
| 1620 | rw [xProfile_radius _ hR.le eta] at ho |
| 1621 | have hphi (j : ℕ) : (profiles s j).phi (R, eta) = |
| 1622 | SlowRecursion.profile (A.coefficients j 0) (R ^ 2 / 2, eta) := by |
| 1623 | have he := (profiles_x_phi_germ L B0 j (w := (R ^ 2 / 2, eta)) hX hi heta).eq_of_nhds |
| 1624 | rw [xProfile_radius _ hR.le eta] at he |
| 1625 | exact he |
| 1626 | have hp := (A.equations n hn _ ⟨hX, hi.trans L.inner_radius⟩ eta |
| 1627 | (L.parameter_embedding eta heta)).2.1 |
| 1628 | simp only [pressureSource, sub_apply, mul_apply, constant_apply, sum_apply, hphi, ho] |
| 1629 | simpa only [PositiveAxisSystem.actualJet, PositiveAxisSystem.convolution, |
| 1630 | PositiveAxisSystem.inverseSquare, inv_pow, div_eq_mul_inv, one_mul, mul_comm] using hp.symm |
| 1631 | |
| 1632 | omit B0 in |
| 1633 | theorem localExtension_radial_derivative (n : ℕ) (i : Fin 5) {R eta : ℝ} (hR : 0 < R) |
| 1634 | (hi : R ^ 2 / 2 < inner) (heta : eta ∈ S) : |
| 1635 | ProfileHistories.radialPartial (localExtension L n i) (R, eta) = |
| 1636 | R * SimilarityProfile.partialX (SlowRecursion.profile (A.coefficients n i)) (R ^ 2 / 2, eta) := by |
| 1637 | have hX : 0 < R ^ 2 / 2 := div_pos (sq_pos_of_pos hR) (by norm_num) |
| 1638 | have he := (localExtension_germ L n i (w := (R ^ 2 / 2, eta)) hX hi).fderiv_eq (𝕜 := ℝ) |
| 1639 | have hh := radius_mul_xDerivative s.domain.isOpen (localExtension L n i) heta R |
| 1640 | change R * xDerivative s.domain.isOpen (localExtension L n i) (R, eta) = |
| 1641 | ProfileHistories.radialPartial (localExtension L n i) (R, eta) at hh |
| 1642 | rw [← hh, ← xProfile_radius _ hR.le eta, ← xProfile_partialX s.domain.isOpen _ hX heta] |
| 1643 | unfold SimilarityProfile.partialX |
| 1644 | rw [he] |
| 1645 | |
| 1646 | theorem profiles_radial_inner_pressure {n : ℕ} (hn : 0 < n) {R eta : ℝ} (hR : 0 ≤ R) |
| 1647 | (hi : R ^ 2 / 2 < inner) (heta : eta ∈ S) : |
| 1648 | (profiles s n).pressure (R, eta) = |
| 1649 | SlowRecursion.profile (A.coefficients n 3) (R ^ 2 / 2, eta) := by |
| 1650 | let q := pressureSource C (fun j => (profiles s j).phi) |
| 1651 | (previousOmegaDivX s.domain (fun j => (profiles s j).axial) (fun j => (profiles s j).beta) n) n |
| 1652 | let P := localExtension L n 3 |
| 1653 | have hd : ∀ r ∈ uIcc (0 : ℝ) R, |
| 1654 | HasDerivAt (fun t => P (t, eta)) (r * q (r, eta)) r := by |
| 1655 | intro r hr |
| 1656 | rw [uIcc_of_le hR] at hr |
| 1657 | have hir : r ^ 2 / 2 < inner := by |
| 1658 | have hs := (sq_le_sq₀ hr.1 hR).2 hr.2 |
| 1659 | linarith |
| 1660 | have hp := ProfileHistories.radialPartial_hasDerivAt |
| 1661 | (PositiveOrderMoments.parameterDomain S s.domain.isOpen) P.smooth (p := (r, eta)) ⟨mem_univ _, heta⟩ |
| 1662 | apply hp.congr_deriv |
| 1663 | by_cases hz : r = 0 |
| 1664 | · subst r |
| 1665 | have he := EvenSmoothDescent.deriv_zero_of_even (f := fun t : ℝ => P (t, eta)) (fun t => P.even heta t) |
| 1666 | rw [hp.deriv] at he |
| 1667 | simpa only [zero_mul] using he |
| 1668 | · have hrp : 0 < r := lt_of_le_of_ne hr.1 (Ne.symm hz) |
| 1669 | rw [localExtension_radial_derivative L n 3 hrp hir heta] |
| 1670 | rw [profiles_pressureSource_local L B0 hn hrp hir heta] |
| 1671 | have hint := intervalIntegral.integral_eq_sub_of_hasDerivAt hd |
| 1672 | ((slice_smooth (contDiffOn_fst.mul q.smooth) heta).continuous.intervalIntegrable 0 R) |
| 1673 | have hz : P (0, eta) = 0 := localExtension_axis L hn 3 heta |
| 1674 | rw [hz, sub_zero] at hint |
| 1675 | rw [profiles_pressure_eq s hn, pressureFromSource_eq_primitive] |
| 1676 | change (∫ r in (0 : ℝ)..R, r * q (r, eta)) = _ |
| 1677 | rw [hint] |
| 1678 | exact localExtension_radial L n 3 hR hi.le |
| 1679 | |
| 1680 | theorem profiles_x_inner_pressure {n : ℕ} (hn : 0 < n) {w : ℝ × ℝ} |
| 1681 | (hX : 0 ≤ w.1) (hi : w.1 < inner) (heta : w.2 ∈ S) : |
| 1682 | xProfile (profiles s n).pressure w = SlowRecursion.profile (A.coefficients n 3) w := by |
| 1683 | have hs : (Real.sqrt (2 * w.1)) ^ 2 / 2 = w.1 := by |
| 1684 | rw [Real.sq_sqrt (mul_nonneg (by norm_num) hX)]; ring |
| 1685 | change (profiles s n).pressure (Real.sqrt (2 * w.1), w.2) = _ |
| 1686 | simpa only [hs, Prod.eta] using profiles_radial_inner_pressure L B0 hn (Real.sqrt_nonneg (2 * w.1)) |
| 1687 | (by simpa only [hs] using hi) heta |
| 1688 | |
| 1689 | end LocalAgreement |
| 1690 | |
| 1691 | theorem pressureFromSource_hasDerivAt {S : Set ℝ} (hS : IsOpen S) (q : EvenProfile S) |
| 1692 | {R eta : ℝ} (heta : eta ∈ S) : |
| 1693 | HasDerivAt (fun r => pressureFromSource hS q (r, eta)) (R * q (R, eta)) R := by |
| 1694 | have he : (fun r => pressureFromSource hS q (r, eta)) = |
| 1695 | fun r => ProfileHistories.primitive (fun p => p.1 * q p) (r, eta) := |
| 1696 | funext (fun r => pressureFromSource_eq_primitive hS q (r, eta)) |
| 1697 | rw [he] |
| 1698 | exact ProfileHistories.primitive_hasDerivAt (PositiveOrderMoments.parameterDomain S hS) |
| 1699 | (contDiffOn_fst.mul q.smooth) (p := (R, eta)) ⟨mem_univ _, heta⟩ |
| 1700 | |
| 1701 | theorem profiles_x_pressure_derivative {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) |
| 1702 | {n : ℕ} (hn : 0 < n) {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1703 | SimilarityProfile.partialX (xProfile (profiles s n).pressure) w = |
| 1704 | xProfile (pressureSource C (fun j => (profiles s j).phi) |
| 1705 | (previousOmegaDivX s.domain (fun j => (profiles s j).axial) (fun j => (profiles s j).beta) n) n) w := by |
| 1706 | let q := pressureSource C (fun j => (profiles s j).phi) |
| 1707 | (previousOmegaDivX s.domain (fun j => (profiles s j).axial) (fun j => (profiles s j).beta) n) n |
| 1708 | let R := Real.sqrt (2 * w.1) |
| 1709 | have hR : R ≠ 0 := (Real.sqrt_pos.mpr (mul_pos (by norm_num) hX)).ne' |
| 1710 | rw [xProfile_partialX s.domain.isOpen _ hX heta] |
| 1711 | change xDerivative s.domain.isOpen (profiles s n).pressure (R, w.2) = q (R, w.2) |
| 1712 | apply mul_left_cancel₀ hR |
| 1713 | rw [radius_mul_xDerivative s.domain.isOpen _ heta R] |
| 1714 | have hp := ProfileHistories.radialPartial_hasDerivAt (PositiveOrderMoments.parameterDomain S s.domain.isOpen) |
| 1715 | (profiles s n).pressure.smooth (p := (R, w.2)) ⟨mem_univ _, heta⟩ |
| 1716 | change ProfileHistories.radialPartial (profiles s n).pressure (R, w.2) = _ |
| 1717 | have hd := pressureFromSource_hasDerivAt s.domain.isOpen q (R := R) heta |
| 1718 | rw [← profiles_pressure_eq s hn] at hd |
| 1719 | exact hp.unique hd |
| 1720 | |
| 1721 | theorem radialZ_eq_axialOp {S : Set ℝ} {h : ℝ} (d : Domain S h) (b : ℝ) (u : EvenProfile S) |
| 1722 | {w : ℝ × ℝ} (heta : w.2 ∈ S) : |
| 1723 | PositiveOrderMoments.radialZ h b u w = axialOp d b u w := by |
| 1724 | have hx := radius_mul_xDerivative d.isOpen u heta w.1 |
| 1725 | change w.1 * xDerivative d.isOpen u w = ProfileHistories.radialPartial u w at hx |
| 1726 | simp only [PositiveOrderMoments.radialZ, axialOp, mul_apply, add_apply, sub_apply, |
| 1727 | constant_apply, inverseDenominator_apply] |
| 1728 | change (2 * w.2 * b * u w + PositiveAxisSystem.edge w.2 * etaDerivative d.isOpen u w - |
| 1729 | w.2 * w.1 * ProfileHistories.radialPartial u w) / PositiveAxisSystem.ell h w.2 = |
| 1730 | (2 * b * w.2 * u w + (1 - w.2 ^ 2) * etaDerivative d.isOpen u w - |
| 1731 | 2 * w.2 * (w.1 ^ 2 / 2) * xDerivative d.isOpen u w) * (PositiveAxisSystem.ell h w.2)⁻¹ |
| 1732 | rw [← hx] |
| 1733 | simp only [PositiveAxisSystem.edge, div_eq_mul_inv] |
| 1734 | ring |
| 1735 | |
| 1736 | theorem betaFromU_x_divergence {S : Set ℝ} {h : ℝ} (d : Domain S h) (lam : ℝ) |
| 1737 | (u : EvenProfile S) {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1738 | SimilarityProfile.partialX (AxisSourceRegularity.axisFactor (xProfile (betaFromU d lam u))) w + |
| 1739 | SimilarityProfile.Z h (-PositiveAxisSystem.a h + lam) (xProfile u) w = 0 := by |
| 1740 | let b := betaFromU d lam u |
| 1741 | let R := Real.sqrt (2 * w.1) |
| 1742 | have hR : R ≠ 0 := (Real.sqrt_pos.mpr (mul_pos (by norm_num) hX)).ne' |
| 1743 | have hR2 : R ^ 2 / 2 = w.1 := by |
| 1744 | dsimp [R]; rw [Real.sq_sqrt (mul_pos (by norm_num) hX).le]; ring |
| 1745 | have hb := ProfileHistories.radialPartial_hasDerivAt (PositiveOrderMoments.parameterDomain S d.isOpen) |
| 1746 | b.smooth (p := (R, w.2)) ⟨mem_univ _, heta⟩ |
| 1747 | have hr : HasDerivAt (fun r : ℝ => r ^ 2 / 2) R R := by |
| 1748 | convert! ((hasDerivAt_id R).pow 2).div_const 2 using 1 |
| 1749 | norm_num |
| 1750 | have he := (hr.mul hb).unique (reconstructed_flux_derivative d lam u (R := R) heta) |
| 1751 | dsimp only at he |
| 1752 | have hx := radius_mul_xDerivative d.isOpen b heta R |
| 1753 | change R * xDerivative d.isOpen b (R, w.2) = ProfileHistories.radialPartial b (R, w.2) at hx |
| 1754 | rw [← hx, radialZ_eq_axialOp d _ u (w := (R, w.2)) heta, hR2] at he |
| 1755 | rw [AxisSourceRegularity.partialX_axisFactor ((xProfile_contDiffAt d.isOpen b hX heta).differentiableAt (by simp)), |
| 1756 | xProfile_partialX d.isOpen b hX heta, ← xProfile_axialOp d _ u hX heta] |
| 1757 | change b (R, w.2) + w.1 * xDerivative d.isOpen b (R, w.2) + |
| 1758 | axialOp d (-PositiveAxisSystem.a h + lam) u (R, w.2) = 0 |
| 1759 | apply mul_left_cancel₀ hR |
| 1760 | linear_combination he |
| 1761 | |
| 1762 | noncomputable def asSlowProfiles {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) : |
| 1763 | SlowExpansionResidual.SlowProfiles := |
| 1764 | SlowResidualMatching.ofBeta (fun j => xProfile (profiles s j).phi) |
| 1765 | (fun j => xProfile (profiles s j).axial) (fun j => xProfile (profiles s j).beta) |
| 1766 | (fun j => xProfile (profiles s j).pressure) |
| 1767 | |
| 1768 | /-- Exact global divergence at every positive order. -/ |
| 1769 | theorem profiles_divergenceCoefficient {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) |
| 1770 | {n : ℕ} (hn : 0 < n) {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1771 | SlowExpansionResidual.divergenceCoefficient h (asSlowProfiles s) n w = 0 := by |
| 1772 | change SimilarityProfile.partialX (AxisSourceRegularity.axisFactor (xProfile (profiles s n).beta)) w + |
| 1773 | SimilarityProfile.Z h (SlowExpansionResidual.axialExponent h + SlowExpansionResidual.slowOrder h n) |
| 1774 | (xProfile (profiles s n).axial) w = 0 |
| 1775 | rw [profiles_beta_eq s hn] |
| 1776 | exact betaFromU_x_divergence s.domain (AxisSourceRegularity.slowOrder h n) (profiles s n).axial hX heta |
| 1777 | |
| 1778 | /-- Exact global pressure row, with the actual preceding radial residual. -/ |
| 1779 | theorem profiles_pressureCoefficient {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) |
| 1780 | {n : ℕ} (hn : 0 < n) {w : ℝ × ℝ} (hX : 0 < w.1) (heta : w.2 ∈ S) : |
| 1781 | SlowExpansionResidual.pressureCoefficient h C (asSlowProfiles s) n w = 0 := by |
| 1782 | have ho := SlowResidualMatching.previousOmega_ofBeta h |
| 1783 | (fun j => xProfile (profiles s j).phi) (fun j => xProfile (profiles s j).axial) |
| 1784 | (fun j => xProfile (profiles s j).beta) (fun j => xProfile (profiles s j).pressure) |
| 1785 | n w hX.ne' (s.domain.denominator w.2 heta) |
| 1786 | (fun j _ => (xProfile_contDiffAt s.domain.isOpen (profiles s j).beta hX heta).of_le |
| 1787 | (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)) |
| 1788 | rw [← xProfile_previousOmegaDivX s.domain _ _ n hX heta] at ho |
| 1789 | have hdiv : SlowExpansionResidual.previous |
| 1790 | (fun j => SlowExpansionResidual.omegaCoefficient h (asSlowProfiles s) j w) n / (2 * w.1) = |
| 1791 | xProfile (previousOmegaDivX s.domain (fun j => (profiles s j).axial) |
| 1792 | (fun j => (profiles s j).beta) n) w / 2 := by |
| 1793 | rw [← ho] |
| 1794 | unfold asSlowProfiles |
| 1795 | ring |
| 1796 | unfold SlowExpansionResidual.pressureCoefficient |
| 1797 | rw [hdiv] |
| 1798 | change SimilarityProfile.partialX (xProfile (profiles s n).pressure) w - |
| 1799 | C⁻¹ ^ 2 * SlowExpansionResidual.convolution |
| 1800 | (fun i j => xProfile (profiles s i).phi w * xProfile (profiles s j).phi w) n + _ = 0 |
| 1801 | rw [profiles_x_pressure_derivative s hn hX heta, SlowResidualMatching.convolution_eq_positiveAxis] |
| 1802 | simp only [pressureSource, |
| 1803 | xProfile, sum_apply, mul_apply, sub_apply, constant_apply, |
| 1804 | PositiveAxisSystem.convolution, inv_pow, div_eq_mul_inv] |
| 1805 | ring |
| 1806 | |
| 1807 | noncomputable def component {S : Set ℝ} (q : Coefficient S) (i : Fin 4) : EvenProfile S := |
| 1808 | ![q.phi, q.axial, q.beta, q.pressure] i |
| 1809 | |
| 1810 | noncomputable def localIndex (i : Fin 4) : Fin 5 := ![0, 1, 4, 3] i |
| 1811 | |
| 1812 | /-- Every repaired coefficient agrees with the original local hierarchy on |
| 1813 | one common inner domain, including the axis. -/ |
| 1814 | theorem profiles_inner_eq {S : Set ℝ} {h C rho inner : ℝ} {U : Set ℂ} |
| 1815 | {base : Fin 5 → SimilarityProfile.InnerProfile} {s : Scheme S h C} |
| 1816 | {A : SlowRecursion.LocalHierarchy rho U h C base} |
| 1817 | (L : Localization s A inner) (B0 : BaseAgreement s A inner) |
| 1818 | {n : ℕ} (hn : 0 < n) (i : Fin 4) {w : ℝ × ℝ} |
| 1819 | (hX : 0 ≤ w.1) (hi : w.1 < inner) (heta : w.2 ∈ S) : |
| 1820 | xProfile (component (profiles s n) i) w = SlowRecursion.profile (A.coefficients n (localIndex i)) w := by |
| 1821 | fin_cases i |
| 1822 | · simpa [component, localIndex] using profiles_x_inner_phi L hn hX hi.le |
| 1823 | · simpa [component, localIndex] using profiles_x_inner_axial L hn hX hi.le |
| 1824 | · simpa [component, localIndex] using profiles_x_inner_beta L hn hX hi.le heta |
| 1825 | · simpa [component, localIndex] using profiles_x_inner_pressure L B0 hn hX hi heta |
| 1826 | |
| 1827 | theorem profiles_axis_zero {S : Set ℝ} {h C rho inner : ℝ} {U : Set ℂ} |
| 1828 | {base : Fin 5 → SimilarityProfile.InnerProfile} {s : Scheme S h C} |
| 1829 | {A : SlowRecursion.LocalHierarchy rho U h C base} |
| 1830 | (L : Localization s A inner) (B0 : BaseAgreement s A inner) |
| 1831 | {n : ℕ} (hn : 0 < n) (i : Fin 4) {eta : ℝ} (heta : eta ∈ S) : |
| 1832 | component (profiles s n) i (0, eta) = 0 := by |
| 1833 | have he := profiles_inner_eq L B0 hn i (w := (0, eta)) le_rfl L.inner_pos heta |
| 1834 | simp only [xProfile, mul_zero, Real.sqrt_zero, SlowRecursion.profile] at he |
| 1835 | rw [he, A.zero_axis n hn (localIndex i) _ (L.parameter_embedding eta heta)] |
| 1836 | rfl |
| 1837 | |
| 1838 | /-- Joint smoothness up to the axis is inherited from actual local equality. -/ |
| 1839 | theorem profiles_inner_smooth {S : Set ℝ} {h C rho inner : ℝ} {U : Set ℂ} |
| 1840 | {base : Fin 5 → SimilarityProfile.InnerProfile} {s : Scheme S h C} |
| 1841 | {A : SlowRecursion.LocalHierarchy rho U h C base} |
| 1842 | (L : Localization s A inner) (B0 : BaseAgreement s A inner) |
| 1843 | {n : ℕ} (hn : 0 < n) (i : Fin 4) : |
| 1844 | ContDiffOn ℝ ∞ (xProfile (component (profiles s n) i)) (Ico 0 inner ×ˢ S) := by |
| 1845 | have hl : ContDiffOn ℝ ∞ (SlowRecursion.profile (A.coefficients n (localIndex i))) |
| 1846 | (Ico 0 inner ×ˢ S) := |
| 1847 | (A.profiles_smooth L.radius_pos L.parameter_open n (localIndex i)).mono |
| 1848 | (fun w hw => ⟨⟨hw.1.1, hw.1.2.trans L.inner_radius⟩, L.parameter_embedding w.2 hw.2⟩) |
| 1849 | exact hl.congr (fun w hw => profiles_inner_eq L B0 hn i hw.1.1 hw.1.2 hw.2) |
| 1850 | |
| 1851 | /-- All actual mixed right jets, not just the zero-order values, agree at |
| 1852 | the axis. The derivative is taken relative to the closed half-plane. -/ |
| 1853 | theorem profiles_axis_mixed_jets {S : Set ℝ} {h C rho inner : ℝ} {U : Set ℂ} |
| 1854 | {base : Fin 5 → SimilarityProfile.InnerProfile} {s : Scheme S h C} |
| 1855 | {A : SlowRecursion.LocalHierarchy rho U h C base} |
| 1856 | (L : Localization s A inner) (B0 : BaseAgreement s A inner) |
| 1857 | {n : ℕ} (hn : 0 < n) (i : Fin 4) (m : ℕ) {eta : ℝ} (heta : eta ∈ S) : |
| 1858 | iteratedFDerivWithin ℝ m (xProfile (component (profiles s n) i)) |
| 1859 | (Ici 0 ×ˢ (univ : Set ℝ)) (0, eta) = |
| 1860 | iteratedFDerivWithin ℝ m (SlowRecursion.profile (A.coefficients n (localIndex i))) |
| 1861 | (Ici 0 ×ˢ (univ : Set ℝ)) (0, eta) := by |
| 1862 | have he : xProfile (component (profiles s n) i) =ᶠ[𝓝[Ici 0 ×ˢ (univ : Set ℝ)] (0, eta)] |
| 1863 | SlowRecursion.profile (A.coefficients n (localIndex i)) := by |
| 1864 | have hN : ∀ᶠ w : ℝ × ℝ in 𝓝 (0, eta), w.1 < inner ∧ w.2 ∈ S := |
| 1865 | (isOpen_Iio.prod s.domain.isOpen).mem_nhds ⟨L.inner_pos, heta⟩ |
| 1866 | filter_upwards [self_mem_nhdsWithin, hN.filter_mono nhdsWithin_le_nhds] with w hw hNw |
| 1867 | exact profiles_inner_eq L B0 hn i hw.1 hNw.1 hNw.2 |
| 1868 | exact he.iteratedFDerivWithin_eq (profiles_inner_eq L B0 hn i le_rfl L.inner_pos heta) m |
| 1869 | |
| 1870 | theorem profiles_axis_right_jets {S : Set ℝ} {h C rho inner : ℝ} {U : Set ℂ} |
| 1871 | {base : Fin 5 → SimilarityProfile.InnerProfile} {s : Scheme S h C} |
| 1872 | {A : SlowRecursion.LocalHierarchy rho U h C base} |
| 1873 | (L : Localization s A inner) (B0 : BaseAgreement s A inner) |
| 1874 | {n : ℕ} (hn : 0 < n) (i : Fin 4) (m : ℕ) {eta : ℝ} (heta : eta ∈ S) : |
| 1875 | iteratedDerivWithin m (fun X => xProfile (component (profiles s n) i) (X, eta)) (Ici 0) 0 = |
| 1876 | iteratedDerivWithin m (fun X => SlowRecursion.profile (A.coefficients n (localIndex i)) (X, eta)) (Ici 0) 0 := by |
| 1877 | have he : (fun X => xProfile (component (profiles s n) i) (X, eta)) =ᶠ[𝓝[Ici 0] 0] |
| 1878 | fun X => SlowRecursion.profile (A.coefficients n (localIndex i)) (X, eta) := by |
| 1879 | have hN : ∀ᶠ X : ℝ in 𝓝 0, X < inner := isOpen_Iio.mem_nhds L.inner_pos |
| 1880 | filter_upwards [self_mem_nhdsWithin, hN.filter_mono nhdsWithin_le_nhds] with X hX hXi |
| 1881 | exact profiles_inner_eq L B0 hn i (w := (X, eta)) hX hXi heta |
| 1882 | simp only [iteratedDerivWithin_eq_iteratedFDerivWithin] |
| 1883 | rw [he.iteratedFDerivWithin_eq (profiles_inner_eq L B0 hn i (w := (0, eta)) le_rfl L.inner_pos heta) m] |
| 1884 | |
| 1885 | /-- Germ locality transfers the two solved tangential equations. No |
| 1886 | agreement outside the fixed inner region is required. -/ |
| 1887 | theorem profiles_inner_tangential {S : Set ℝ} {h C rho inner : ℝ} {U : Set ℂ} |
| 1888 | {base : Fin 5 → SimilarityProfile.InnerProfile} {s : Scheme S h C} |
| 1889 | {A : SlowRecursion.LocalHierarchy rho U h C base} |
| 1890 | (L : Localization s A inner) (B0 : BaseAgreement s A inner) |
| 1891 | {n : ℕ} (hn : 0 < n) {w : ℝ × ℝ} (hX : 0 < w.1) (hi : w.1 < inner) (heta : w.2 ∈ S) : |
| 1892 | SlowExpansionResidual.angularCoefficient h (asSlowProfiles s) n w = 0 ∧ |
| 1893 | SlowExpansionResidual.axialCoefficient h (asSlowProfiles s) n w = 0 := by |
| 1894 | have hv : ∀ j ≤ n, (asSlowProfiles s).flux j =ᶠ[𝓝 w] (SlowResidualMatching.hierarchyProfiles A).flux j := by |
| 1895 | intro j _ |
| 1896 | filter_upwards [profiles_x_beta_germ L B0 j hX hi heta] with p hp |
| 1897 | exact congrArg (p.1 * ·) hp |
| 1898 | have hu : ∀ j ≤ n, (asSlowProfiles s).axial j =ᶠ[𝓝 w] (SlowResidualMatching.hierarchyProfiles A).axial j := |
| 1899 | fun j _ => profiles_x_axial_germ L B0 j hX hi heta |
| 1900 | have hphi : ∀ j ≤ n, (asSlowProfiles s).phi j =ᶠ[𝓝 w] (SlowResidualMatching.hierarchyProfiles A).phi j := |
| 1901 | fun j _ => profiles_x_phi_germ L B0 j hX hi heta |
| 1902 | have hp : (asSlowProfiles s).pressure n =ᶠ[𝓝 w] (SlowResidualMatching.hierarchyProfiles A).pressure n := by |
| 1903 | filter_upwards [(isOpen_Ioo.prod s.domain.isOpen).mem_nhds ⟨⟨hX, hi⟩, heta⟩] with p hp |
| 1904 | exact profiles_x_inner_pressure L B0 hn hp.1.1.le hp.1.2 hp.2 |
| 1905 | rw [SlowResidualMatching.angularCoefficient_congr_germ h n hv hu hphi, |
| 1906 | SlowResidualMatching.axialCoefficient_congr_germ h n hv hu hp] |
| 1907 | exact SlowResidualMatching.hierarchy_tangential_coefficients A hn |
| 1908 | ⟨hX, hi.trans L.inner_radius⟩ (L.parameter_embedding w.2 heta) |
| 1909 | |
| 1910 | theorem compactSupport_of_even_exterior {S : Set ℝ} (f : EvenProfile S) {B : ℝ} |
| 1911 | (hf : Exterior B S f) {eta : ℝ} (heta : eta ∈ S) : HasCompactSupport (fun R => f (R, eta)) := by |
| 1912 | apply HasCompactSupport.of_support_subset_isCompact (K := Icc (-B) B) isCompact_Icc |
| 1913 | intro R hR |
| 1914 | by_contra hout |
| 1915 | apply hR |
| 1916 | change f (R, eta) = 0 |
| 1917 | by_cases hBR : B ≤ R |
| 1918 | · exact hf eta heta R hBR |
| 1919 | · have hneg : B ≤ -R := by |
| 1920 | by_contra hn |
| 1921 | exact hout ⟨by linarith, (lt_of_not_ge hBR).le⟩ |
| 1922 | rw [← f.even heta R] |
| 1923 | exact hf eta heta (-R) hneg |
| 1924 | |
| 1925 | theorem profiles_compactSupport {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) |
| 1926 | {n : ℕ} (hn : 0 < n) (i : Fin 4) {eta : ℝ} (heta : eta ∈ S) : |
| 1927 | HasCompactSupport (fun R => component (profiles s n) i (R, eta)) := by |
| 1928 | apply compactSupport_of_even_exterior _ (B := s.B) _ heta |
| 1929 | fin_cases i |
| 1930 | · exact profiles_phi_exterior s hn |
| 1931 | · exact profiles_axial_exterior s n |
| 1932 | · exact profiles_beta_exterior s n |
| 1933 | · exact profiles_pressure_exterior s hn |
| 1934 | |
| 1935 | theorem profiles_angular_compactSupport {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) |
| 1936 | {n : ℕ} (hn : 0 < n) {eta : ℝ} (heta : eta ∈ S) : |
| 1937 | HasCompactSupport (fun R => angularField C (profiles s n).phi (R, eta)) := |
| 1938 | (compactSupport_of_even_exterior _ (profiles_phi_exterior s hn) heta).mul_left |
| 1939 | |
| 1940 | theorem profiles_flux_compactSupport {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) |
| 1941 | (n : ℕ) {eta : ℝ} (heta : eta ∈ S) : |
| 1942 | HasCompactSupport (fun R => R ^ 2 / 2 * (profiles s n).beta (R, eta)) := |
| 1943 | (compactSupport_of_even_exterior _ (profiles_beta_exterior s n) heta).mul_left |
| 1944 | |
| 1945 | /-- The radial pressure is literally the forward primitive used by the |
| 1946 | moment module, with the actual preceding radial source retained. -/ |
| 1947 | theorem profiles_pressureHistory {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) |
| 1948 | {n : ℕ} (hn : 0 < n) : |
| 1949 | ((profiles s n).pressure : Field) = PositiveOrderMoments.pressureHistory n |
| 1950 | (fun j => angularField C (profiles s j).phi) |
| 1951 | (fun w => w.1 ^ 2 / 2 * previousOmegaDivX s.domain |
| 1952 | (fun j => (profiles s j).axial) (fun j => (profiles s j).beta) n w) := by |
| 1953 | rw [profiles_pressure_eq s hn] |
| 1954 | exact pressureFromSource_eq_pressureHistory s.domain.isOpen C _ _ n |
| 1955 | |
| 1956 | theorem profiles_fluxHistory {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) |
| 1957 | {n : ℕ} (hn : 0 < n) {w : ℝ × ℝ} (heta : w.2 ∈ S) : |
| 1958 | w.1 ^ 2 / 2 * (profiles s n).beta w = |
| 1959 | PositiveOrderMoments.fluxHistory h (AxisSourceRegularity.slowOrder h n) (profiles s n).axial w := by |
| 1960 | rw [profiles_beta_eq s hn] |
| 1961 | exact betaFromU_eq_fluxHistory s.domain _ _ heta |
| 1962 | |
| 1963 | /-- The genuine radial divergence identity holds at every signed radius, |
| 1964 | including the axis, on the original open parameter domain. -/ |
| 1965 | theorem profiles_radial_divergence {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) |
| 1966 | {n : ℕ} (hn : 0 < n) {R eta : ℝ} (heta : eta ∈ S) : |
| 1967 | HasDerivAt (fun r => r ^ 2 / 2 * (profiles s n).beta (r, eta)) |
| 1968 | (-R * PositiveOrderMoments.radialZ h (-PositiveAxisSystem.a h + AxisSourceRegularity.slowOrder h n) |
| 1969 | (profiles s n).axial (R, eta)) R := by |
| 1970 | rw [profiles_beta_eq s hn] |
| 1971 | exact reconstructed_flux_derivative s.domain _ _ heta |
| 1972 | |
| 1973 | end NavierStokes.GlobalSlowProfiles |