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.CorrectedPulseAmplitude |
| 2 | import NavierStokes.SchedulePressure |
| 3 | import NavierStokes.ProfileHistories |
| 4 | import Mathlib.MeasureTheory.Integral.IntegralEqImproper |
| 5 | |
| 6 | /-! |
| 7 | # Actual histories of the corrected outgoing fields |
| 8 | |
| 9 | The first coordinate is the global logarithmic radius `y`, with normalized |
| 10 | `X = exp y`. In particular smoothness here is not smoothness at the radial |
| 11 | axis. Every history starts with the integral of the explicit ideal past and |
| 12 | then integrates the same corrected angular field and the same axial field. |
| 13 | The axial amplitude can be any smooth function of the parameter. |
| 14 | |
| 15 | `I` and `J` omit the common physical factor `sqrt 2`. For arbitrary entrance |
| 16 | radius `XR`, the physical factors are `XR` for `M,S` and `XR * sqrt (2*XR)` |
| 17 | for `I,J`. These factors cancel from both normalized lags. |
| 18 | -/ |
| 19 | |
| 20 | noncomputable section |
| 21 | |
| 22 | open Set Filter Function MeasureTheory |
| 23 | open scoped Topology ContDiff |
| 24 | open NavierStokes.OutgoingSchedule NavierStokes.OutgoingTail |
| 25 | open NavierStokes.AngularMomentReset NavierStokes.UniformAngularReset |
| 26 | open NavierStokes.StressAlgebra |
| 27 | |
| 28 | namespace NavierStokes.OutgoingHistories |
| 29 | |
| 30 | abbrev Point := ℝ × ℝ |
| 31 | abbrev Field := Point → ℝ |
| 32 | noncomputable abbrev dY := ProfileHistories.radialPartial |
| 33 | noncomputable abbrev dEta := ProfileHistories.parameterPartial |
| 34 | |
| 35 | /-- The whole log-coordinate plane; this is not a radial domain at `X=0`. -/ |
| 36 | noncomputable def logDomain : ProfileHistories.RadialDomain where |
| 37 | carrier := univ |
| 38 | isOpen := isOpen_univ |
| 39 | scale_mem := by intros; trivial |
| 40 | |
| 41 | theorem dY_hasDerivAt {f : Field} (hf : ContDiff ℝ ∞ f) (p : Point) : |
| 42 | HasDerivAt (fun y => f (y, p.2)) (dY f p) p.1 := |
| 43 | ProfileHistories.radialPartial_hasDerivAt logDomain hf.contDiffOn (mem_univ p) |
| 44 | |
| 45 | theorem dEta_hasDerivAt {f : Field} (hf : ContDiff ℝ ∞ f) (p : Point) : |
| 46 | HasDerivAt (fun eta => f (p.1, eta)) (dEta f p) p.2 := |
| 47 | ProfileHistories.parameterPartial_hasDerivAt logDomain hf.contDiffOn (mem_univ p) |
| 48 | |
| 49 | theorem dY_eq_deriv {f : Field} (hf : ContDiff ℝ ∞ f) (p : Point) : |
| 50 | dY f p = deriv (fun y => f (y, p.2)) p.1 := (dY_hasDerivAt hf p).deriv.symm |
| 51 | |
| 52 | theorem dEta_eq_deriv {f : Field} (hf : ContDiff ℝ ∞ f) (p : Point) : |
| 53 | dEta f p = deriv (fun eta => f (p.1, eta)) p.2 := (dEta_hasDerivAt hf p).deriv.symm |
| 54 | |
| 55 | theorem dY_smooth {f : Field} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (dY f) := |
| 56 | contDiffOn_univ.mp (ProfileHistories.radialPartial_smooth logDomain hf.contDiffOn) |
| 57 | |
| 58 | theorem dEta_smooth {f : Field} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (dEta f) := |
| 59 | contDiffOn_univ.mp (ProfileHistories.parameterPartial_smooth logDomain hf.contDiffOn) |
| 60 | |
| 61 | /-- A fixed incoming integral plus a finite log-coordinate integral. -/ |
| 62 | noncomputable def history (initial : ℝ → ℝ) (f : Field) (p : Point) : ℝ := |
| 63 | initial p.2 + ProfileHistories.primitive f p |
| 64 | |
| 65 | theorem prefix_smooth {initial : ℝ → ℝ} {f : Field} |
| 66 | (hi : ContDiff ℝ ∞ initial) (hf : ContDiff ℝ ∞ f) : |
| 67 | ContDiff ℝ ∞ (history initial f) := |
| 68 | (hi.comp contDiff_snd).add |
| 69 | (contDiffOn_univ.mp (ProfileHistories.primitive_smooth logDomain hf.contDiffOn)) |
| 70 | |
| 71 | theorem prefix_hasDerivAt {initial : ℝ → ℝ} {f : Field} |
| 72 | (hf : ContDiff ℝ ∞ f) (p : Point) : |
| 73 | HasDerivAt (fun y => history initial f (y, p.2)) (f p) p.1 := by |
| 74 | unfold history |
| 75 | exact |
| 76 | (ProfileHistories.primitive_hasDerivAt logDomain hf.contDiffOn (mem_univ p)).const_add |
| 77 | (initial p.2) |
| 78 | |
| 79 | theorem dEta_prefix {initial : ℝ → ℝ} {f : Field} |
| 80 | (hi : ContDiff ℝ ∞ initial) (hf : ContDiff ℝ ∞ f) (p : Point) : |
| 81 | dEta (history initial f) p = deriv initial p.2 + ProfileHistories.primitive (dEta f) p := by |
| 82 | have hd := ((hi.differentiable (by simp) p.2).hasDerivAt).add |
| 83 | (ProfileHistories.parameterPartial_hasDerivAt logDomain |
| 84 | (ProfileHistories.primitive_smooth logDomain hf.contDiffOn) (mem_univ p)) |
| 85 | have he := (dEta_hasDerivAt (prefix_smooth hi hf) p).unique hd |
| 86 | rw [ProfileHistories.parameterPartial_primitive logDomain hf.contDiffOn (mem_univ p)] at he |
| 87 | exact he |
| 88 | |
| 89 | theorem dEta_prefix_hasDerivAt {initial : ℝ → ℝ} {f : Field} |
| 90 | (hi : ContDiff ℝ ∞ initial) (hf : ContDiff ℝ ∞ f) (p : Point) : |
| 91 | HasDerivAt (fun y => dEta (history initial f) (y, p.2)) (dEta f p) p.1 := by |
| 92 | have hd := (ProfileHistories.primitive_hasDerivAt logDomain |
| 93 | (dEta_smooth hf).contDiffOn (mem_univ p)).const_add (deriv initial p.2) |
| 94 | convert! hd using 1 |
| 95 | funext y |
| 96 | exact dEta_prefix hi hf (y, p.2) |
| 97 | |
| 98 | theorem dEta_mul {f g : Field} (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) (p : Point) : |
| 99 | dEta (fun q => f q * g q) p = dEta f p * g p + f p * dEta g p := |
| 100 | (dEta_hasDerivAt (hf.mul hg) p).unique ((dEta_hasDerivAt hf p).mul (dEta_hasDerivAt hg p)) |
| 101 | |
| 102 | noncomputable def X (p : Point) : ℝ := Real.exp p.1 |
| 103 | |
| 104 | theorem X_pos (p : Point) : 0 < X p := Real.exp_pos _ |
| 105 | theorem X_smooth : ContDiff ℝ ∞ X := contDiff_fst.exp |
| 106 | theorem X_hasDerivAt (p : Point) : HasDerivAt (fun y => X (y, p.2)) (X p) p.1 := |
| 107 | Real.hasDerivAt_exp p.1 |
| 108 | theorem dEta_X (p : Point) : dEta X p = 0 := |
| 109 | (dEta_hasDerivAt X_smooth p).unique (hasDerivAt_const p.2 (Real.exp p.1)) |
| 110 | |
| 111 | variable {d : TailData} {K : ℝ} |
| 112 | |
| 113 | noncomputable def E (w : ResetWitness d K) : Field := correctedAngular d w.coefficients |
| 114 | noncomputable def U (d : TailData) (Amp : ℝ → ℝ) : Field := axial d.core Amp |
| 115 | noncomputable def H (w : ResetWitness d K) (p : Point) : ℝ := Real.exp (p.1 / 2) * E w p |
| 116 | |
| 117 | noncomputable def massWeight (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := X p * U d Amp p |
| 118 | noncomputable def angularWeight (w : ResetWitness d K) (p : Point) : ℝ := X p * H w p |
| 119 | noncomputable def transportWeight (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 120 | X p * (U d Amp p * H w p) |
| 121 | noncomputable def energyDensity (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 122 | U d Amp p ^ 2 - E w p ^ 2 / 2 |
| 123 | noncomputable def energyWeight (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 124 | X p * energyDensity w Amp p |
| 125 | noncomputable def pressureWeight (w : ResetWitness d K) (p : Point) : ℝ := E w p ^ 2 / 2 |
| 126 | |
| 127 | noncomputable def initialM (eta : ℝ) : ℝ := 4 * eta |
| 128 | noncomputable def initialI (d : TailData) (eta : ℝ) : ℝ := (5 / 8) * d.core.P * shape eta |
| 129 | noncomputable def initialJ (d : TailData) (eta : ℝ) : ℝ := (5 / 2) * d.core.P * eta * shape eta |
| 130 | noncomputable def initialS (d : TailData) (eta : ℝ) : ℝ := |
| 131 | 16 * eta ^ 2 - (5 / 12) * d.core.P ^ 2 * shape eta ^ 2 |
| 132 | noncomputable def initialPi (d : TailData) (eta : ℝ) : ℝ := |
| 133 | SchedulePressure.axisPressure d eta + (5 / 2) * d.core.P ^ 2 * shape eta ^ 2 |
| 134 | |
| 135 | noncomputable def M (d : TailData) (Amp : ℝ → ℝ) : Field := history initialM (massWeight d Amp) |
| 136 | noncomputable def I (w : ResetWitness d K) : Field := history (initialI d) (angularWeight w) |
| 137 | noncomputable def J (w : ResetWitness d K) (Amp : ℝ → ℝ) : Field := history (initialJ d) (transportWeight w Amp) |
| 138 | noncomputable def S (w : ResetWitness d K) (Amp : ℝ → ℝ) : Field := history (initialS d) (energyWeight w Amp) |
| 139 | noncomputable def Pi (w : ResetWitness d K) : Field := history (initialPi d) (pressureWeight w) |
| 140 | |
| 141 | theorem E_smooth (w : ResetWitness d K) : ContDiff ℝ ∞ (E w) := |
| 142 | correctedAngular_contDiff d w.coefficients w.smooth |
| 143 | theorem E_pos (w : ResetWitness d K) (p : Point) : 0 < E w p := w.positive p |
| 144 | theorem U_smooth (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 145 | ContDiff ℝ ∞ (U d Amp) := axial_contDiff d.core ha |
| 146 | theorem H_smooth (w : ResetWitness d K) : ContDiff ℝ ∞ (H w) := |
| 147 | (contDiff_fst.div_const 2).exp.mul (E_smooth w) |
| 148 | theorem H_pos (w : ResetWitness d K) (p : Point) : 0 < H w p := |
| 149 | mul_pos (Real.exp_pos _) (E_pos w p) |
| 150 | |
| 151 | theorem angularWeight_eq (w : ResetWitness d K) (p : Point) : |
| 152 | angularWeight w p = Real.exp (3 * p.1 / 2) * E w p := by |
| 153 | simp only [angularWeight, X, H, ← mul_assoc, ← Real.exp_add] |
| 154 | congr 2 |
| 155 | ring |
| 156 | |
| 157 | theorem massWeight_smooth (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 158 | ContDiff ℝ ∞ (massWeight d Amp) := X_smooth.mul (U_smooth d ha) |
| 159 | theorem angularWeight_smooth (w : ResetWitness d K) : ContDiff ℝ ∞ (angularWeight w) := |
| 160 | X_smooth.mul (H_smooth w) |
| 161 | theorem transportWeight_smooth (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 162 | (ha : ContDiff ℝ ∞ Amp) : ContDiff ℝ ∞ (transportWeight w Amp) := |
| 163 | X_smooth.mul ((U_smooth d ha).mul (H_smooth w)) |
| 164 | theorem energyDensity_smooth (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 165 | (ha : ContDiff ℝ ∞ Amp) : ContDiff ℝ ∞ (energyDensity w Amp) := |
| 166 | ((U_smooth d ha).pow 2).sub (((E_smooth w).pow 2).div_const 2) |
| 167 | theorem energyWeight_smooth (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 168 | (ha : ContDiff ℝ ∞ Amp) : ContDiff ℝ ∞ (energyWeight w Amp) := |
| 169 | X_smooth.mul (energyDensity_smooth w ha) |
| 170 | theorem pressureWeight_smooth (w : ResetWitness d K) : ContDiff ℝ ∞ (pressureWeight w) := |
| 171 | ((E_smooth w).pow 2).div_const 2 |
| 172 | |
| 173 | theorem initialM_smooth : ContDiff ℝ ∞ initialM := contDiff_const.mul contDiff_id |
| 174 | theorem initialI_smooth (d : TailData) : ContDiff ℝ ∞ (initialI d) := contDiff_const.mul shape_contDiff |
| 175 | theorem initialJ_smooth (d : TailData) : ContDiff ℝ ∞ (initialJ d) := |
| 176 | (contDiff_const.mul contDiff_id).mul shape_contDiff |
| 177 | theorem initialS_smooth (d : TailData) : ContDiff ℝ ∞ (initialS d) := |
| 178 | (contDiff_const.mul (contDiff_id.pow 2)).sub (contDiff_const.mul (shape_contDiff.pow 2)) |
| 179 | theorem initialPi_smooth (d : TailData) : ContDiff ℝ ∞ (initialPi d) := |
| 180 | (SchedulePressure.axisPressure_contDiff d).add (contDiff_const.mul (shape_contDiff.pow 2)) |
| 181 | |
| 182 | theorem M_smooth (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 183 | ContDiff ℝ ∞ (M d Amp) := prefix_smooth initialM_smooth (massWeight_smooth d ha) |
| 184 | theorem I_smooth (w : ResetWitness d K) : ContDiff ℝ ∞ (I w) := |
| 185 | prefix_smooth (initialI_smooth d) (angularWeight_smooth w) |
| 186 | theorem J_smooth (w : ResetWitness d K) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 187 | ContDiff ℝ ∞ (J w Amp) := prefix_smooth (initialJ_smooth d) (transportWeight_smooth w ha) |
| 188 | theorem S_smooth (w : ResetWitness d K) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 189 | ContDiff ℝ ∞ (S w Amp) := prefix_smooth (initialS_smooth d) (energyWeight_smooth w ha) |
| 190 | theorem Pi_smooth (w : ResetWitness d K) : ContDiff ℝ ∞ (Pi w) := |
| 191 | prefix_smooth (initialPi_smooth d) (pressureWeight_smooth w) |
| 192 | |
| 193 | theorem M_hasDerivAt (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 194 | HasDerivAt (fun y => M d Amp (y, p.2)) (X p * U d Amp p) p.1 := |
| 195 | prefix_hasDerivAt (massWeight_smooth d ha) p |
| 196 | theorem I_hasDerivAt (w : ResetWitness d K) (p : Point) : |
| 197 | HasDerivAt (fun y => I w (y, p.2)) (X p * H w p) p.1 := |
| 198 | prefix_hasDerivAt (angularWeight_smooth w) p |
| 199 | theorem J_hasDerivAt (w : ResetWitness d K) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 200 | HasDerivAt (fun y => J w Amp (y, p.2)) (X p * (U d Amp p * H w p)) p.1 := |
| 201 | prefix_hasDerivAt (transportWeight_smooth w ha) p |
| 202 | theorem S_hasDerivAt (w : ResetWitness d K) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 203 | HasDerivAt (fun y => S w Amp (y, p.2)) (X p * energyDensity w Amp p) p.1 := |
| 204 | prefix_hasDerivAt (energyWeight_smooth w ha) p |
| 205 | theorem Pi_hasDerivAt (w : ResetWitness d K) (p : Point) : |
| 206 | HasDerivAt (fun y => Pi w (y, p.2)) (E w p ^ 2 / 2) p.1 := |
| 207 | prefix_hasDerivAt (pressureWeight_smooth w) p |
| 208 | |
| 209 | theorem dEta_massWeight (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 210 | dEta (massWeight d Amp) p = X p * dEta (U d Amp) p := by |
| 211 | unfold massWeight |
| 212 | rw [dEta_mul X_smooth (U_smooth d ha), dEta_X, zero_mul, zero_add] |
| 213 | |
| 214 | theorem dEta_angularWeight (w : ResetWitness d K) (p : Point) : |
| 215 | dEta (angularWeight w) p = X p * dEta (H w) p := by |
| 216 | unfold angularWeight |
| 217 | rw [dEta_mul X_smooth (H_smooth w), dEta_X, zero_mul, zero_add] |
| 218 | |
| 219 | theorem dEta_transportWeight (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 220 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 221 | dEta (transportWeight w Amp) p = |
| 222 | X p * (dEta (U d Amp) p * H w p + U d Amp p * dEta (H w) p) := by |
| 223 | unfold transportWeight |
| 224 | rw [dEta_mul X_smooth ((U_smooth d ha).mul (H_smooth w)), |
| 225 | dEta_X, zero_mul, zero_add, dEta_mul (U_smooth d ha) (H_smooth w)] |
| 226 | |
| 227 | theorem dEta_energyDensity (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 228 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 229 | dEta (energyDensity w Amp) p = |
| 230 | 2 * U d Amp p * dEta (U d Amp) p - E w p * dEta (E w) p := by |
| 231 | have he := (dEta_hasDerivAt (energyDensity_smooth w ha) p).unique |
| 232 | (((dEta_hasDerivAt (U_smooth d ha) p).pow 2).sub |
| 233 | (((dEta_hasDerivAt (E_smooth w) p).pow 2).div_const 2)) |
| 234 | simpa only [Nat.cast_ofNat, pow_one, Nat.reduceSub] using he.trans (by ring) |
| 235 | |
| 236 | theorem dEta_energyWeight (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 237 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 238 | dEta (energyWeight w Amp) p = X p * |
| 239 | (2 * U d Amp p * dEta (U d Amp) p - E w p * dEta (E w) p) := by |
| 240 | unfold energyWeight |
| 241 | rw [dEta_mul X_smooth (energyDensity_smooth w ha), |
| 242 | dEta_X, zero_mul, zero_add, dEta_energyDensity w ha] |
| 243 | |
| 244 | theorem dEta_pressureWeight (w : ResetWitness d K) (p : Point) : |
| 245 | dEta (pressureWeight w) p = E w p * dEta (E w) p := by |
| 246 | have he := (dEta_hasDerivAt (pressureWeight_smooth w) p).unique |
| 247 | (((dEta_hasDerivAt (E_smooth w) p).pow 2).div_const 2) |
| 248 | simpa only [Nat.cast_ofNat, pow_one, Nat.reduceSub] using he.trans (by ring) |
| 249 | |
| 250 | theorem dEta_M_hasDerivAt (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 251 | HasDerivAt (fun y => dEta (M d Amp) (y, p.2)) (X p * dEta (U d Amp) p) p.1 := by |
| 252 | have hd := dEta_prefix_hasDerivAt initialM_smooth (massWeight_smooth d ha) p |
| 253 | simp only [dEta_massWeight d ha] at hd |
| 254 | exact hd |
| 255 | |
| 256 | theorem dEta_I_hasDerivAt (w : ResetWitness d K) (p : Point) : |
| 257 | HasDerivAt (fun y => dEta (I w) (y, p.2)) (X p * dEta (H w) p) p.1 := by |
| 258 | have hd := dEta_prefix_hasDerivAt (initialI_smooth d) (angularWeight_smooth w) p |
| 259 | simp only [dEta_angularWeight w] at hd |
| 260 | exact hd |
| 261 | |
| 262 | theorem dEta_J_hasDerivAt (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 263 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 264 | HasDerivAt (fun y => dEta (J w Amp) (y, p.2)) |
| 265 | (X p * (dEta (U d Amp) p * H w p + U d Amp p * dEta (H w) p)) p.1 := by |
| 266 | have hd := dEta_prefix_hasDerivAt (initialJ_smooth d) (transportWeight_smooth w ha) p |
| 267 | simp only [dEta_transportWeight w ha] at hd |
| 268 | exact hd |
| 269 | |
| 270 | theorem dEta_S_hasDerivAt (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 271 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 272 | HasDerivAt (fun y => dEta (S w Amp) (y, p.2)) |
| 273 | (X p * (2 * U d Amp p * dEta (U d Amp) p - E w p * dEta (E w) p)) p.1 := by |
| 274 | have hd := dEta_prefix_hasDerivAt (initialS_smooth d) (energyWeight_smooth w ha) p |
| 275 | simp only [dEta_energyWeight w ha] at hd |
| 276 | exact hd |
| 277 | |
| 278 | theorem dEta_Pi_hasDerivAt (w : ResetWitness d K) (p : Point) : |
| 279 | HasDerivAt (fun y => dEta (Pi w) (y, p.2)) (E w p * dEta (E w) p) p.1 := by |
| 280 | have hd := dEta_prefix_hasDerivAt (initialPi_smooth d) (pressureWeight_smooth w) p |
| 281 | simp only [dEta_pressureWeight w] at hd |
| 282 | exact hd |
| 283 | |
| 284 | /-! ## Transport and the two genuine lags -/ |
| 285 | |
| 286 | noncomputable def XW (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 287 | X p - 2 * axialExponent d.h * p.2 * M d Amp p - coordinateFactor p.2 * dEta (M d Amp) p |
| 288 | noncomputable def W (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := XW d Amp p / X p |
| 289 | noncomputable def Ubar (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := M d Amp p / X p |
| 290 | |
| 291 | noncomputable def angularSource (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 292 | -W d Amp p * dY (H w) p - d.h * (1 - 2 * p.2 * U d Amp p) * H w p - |
| 293 | (axialExponent d.h * p.2 + coordinateFactor p.2 * U d Amp p) * dEta (H w) p |
| 294 | |
| 295 | noncomputable def Sq (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := angularSource w Amp p / H w p |
| 296 | |
| 297 | noncomputable def Sn (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 298 | -W d Amp p * dY (U d Amp) p - velocityExponent d.h * (1 - 2 * p.2 * U d Amp p) * U d Amp p - |
| 299 | (axialExponent d.h * p.2 + coordinateFactor p.2 * U d Amp p) * dEta (U d Amp) p - |
| 300 | coordinateFactor p.2 * dEta (Pi w) p + 4 * velocityExponent d.h * p.2 * Pi w p + |
| 301 | 2 * p.2 * dY (Pi w) p |
| 302 | |
| 303 | noncomputable def angularStock (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 304 | -(XW d Amp p * H w p) + (1 - d.h) * I w p - axialExponent d.h * p.2 * dEta (I w) p - |
| 305 | coordinateFactor p.2 * dEta (J w Amp) p + 2 * (d.h - axialExponent d.h) * p.2 * J w Amp p |
| 306 | |
| 307 | noncomputable def axialStock (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 308 | -(XW d Amp p * U d Amp p) + axialExponent d.h * (M d Amp p - p.2 * dEta (M d Amp) p) + |
| 309 | 4 * d.h * p.2 * S w Amp p - coordinateFactor p.2 * dEta (S w Amp) p + |
| 310 | X p * (4 * velocityExponent d.h * p.2 * Pi w p - coordinateFactor p.2 * dEta (Pi w) p) |
| 311 | |
| 312 | noncomputable def Qs (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 313 | angularStock w Amp p / (X p * H w p) |
| 314 | noncomputable def Ns (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := axialStock w Amp p / X p |
| 315 | |
| 316 | theorem XW_smooth (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 317 | ContDiff ℝ ∞ (XW d Amp) := |
| 318 | (X_smooth.sub ((contDiff_const.mul contDiff_snd).mul (M_smooth d ha))).sub |
| 319 | ((contDiff_const.sub (contDiff_snd.pow 2)).mul (dEta_smooth (M_smooth d ha))) |
| 320 | theorem W_smooth (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 321 | ContDiff ℝ ∞ (W d Amp) := (XW_smooth d ha).div X_smooth (fun p => (X_pos p).ne') |
| 322 | theorem Ubar_smooth (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 323 | ContDiff ℝ ∞ (Ubar d Amp) := (M_smooth d ha).div X_smooth (fun p => (X_pos p).ne') |
| 324 | |
| 325 | theorem XW_eq_mul_W (d : TailData) (Amp : ℝ → ℝ) (p : Point) : |
| 326 | XW d Amp p = X p * W d Amp p := by |
| 327 | unfold W |
| 328 | field_simp [(X_pos p).ne'] |
| 329 | |
| 330 | theorem Ubar_parameter (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 331 | dEta (Ubar d Amp) p = dEta (M d Amp) p / X p := by |
| 332 | exact (dEta_hasDerivAt (Ubar_smooth d ha) p).unique |
| 333 | ((dEta_hasDerivAt (M_smooth d ha) p).div_const (X p)) |
| 334 | |
| 335 | theorem W_formula (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 336 | W d Amp p = 1 - 2 * axialExponent d.h * p.2 * Ubar d Amp p - |
| 337 | coordinateFactor p.2 * dEta (Ubar d Amp) p := by |
| 338 | rw [Ubar_parameter d ha] |
| 339 | unfold W XW Ubar |
| 340 | field_simp [(X_pos p).ne'] |
| 341 | |
| 342 | theorem XW_hasDerivAt (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 343 | HasDerivAt (fun y => XW d Amp (y, p.2)) |
| 344 | (X p * (1 - 2 * axialExponent d.h * p.2 * U d Amp p - |
| 345 | coordinateFactor p.2 * dEta (U d Amp) p)) p.1 := by |
| 346 | have hd := ((X_hasDerivAt p).sub ((M_hasDerivAt d ha p).const_mul |
| 347 | (2 * axialExponent d.h * p.2))).sub |
| 348 | ((dEta_M_hasDerivAt d ha p).const_mul (coordinateFactor p.2)) |
| 349 | convert! hd using 1 |
| 350 | ring |
| 351 | |
| 352 | theorem angularStock_smooth (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 353 | (ha : ContDiff ℝ ∞ Amp) : ContDiff ℝ ∞ (angularStock w Amp) := |
| 354 | (((((XW_smooth d ha).mul (H_smooth w)).neg.add |
| 355 | (contDiff_const.mul (I_smooth w))).sub |
| 356 | ((contDiff_const.mul contDiff_snd).mul (dEta_smooth (I_smooth w)))).sub |
| 357 | ((contDiff_const.sub (contDiff_snd.pow 2)).mul (dEta_smooth (J_smooth w ha)))).add |
| 358 | ((contDiff_const.mul contDiff_snd).mul (J_smooth w ha)) |
| 359 | |
| 360 | theorem axialStock_smooth (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 361 | (ha : ContDiff ℝ ∞ Amp) : ContDiff ℝ ∞ (axialStock w Amp) := |
| 362 | (((((XW_smooth d ha).mul (U_smooth d ha)).neg.add |
| 363 | (contDiff_const.mul ((M_smooth d ha).sub (contDiff_snd.mul (dEta_smooth (M_smooth d ha)))))).add |
| 364 | ((contDiff_const.mul contDiff_snd).mul (S_smooth w ha))).sub |
| 365 | ((contDiff_const.sub (contDiff_snd.pow 2)).mul (dEta_smooth (S_smooth w ha)))).add |
| 366 | (X_smooth.mul (((contDiff_const.mul contDiff_snd).mul (Pi_smooth w)).sub |
| 367 | ((contDiff_const.sub (contDiff_snd.pow 2)).mul (dEta_smooth (Pi_smooth w))))) |
| 368 | |
| 369 | theorem Qs_smooth (w : ResetWitness d K) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 370 | ContDiff ℝ ∞ (Qs w Amp) := |
| 371 | (angularStock_smooth w ha).div (X_smooth.mul (H_smooth w)) |
| 372 | (fun p => (mul_pos (X_pos p) (H_pos w p)).ne') |
| 373 | theorem Ns_smooth (w : ResetWitness d K) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : |
| 374 | ContDiff ℝ ∞ (Ns w Amp) := |
| 375 | (axialStock_smooth w ha).div X_smooth (fun p => (X_pos p).ne') |
| 376 | |
| 377 | theorem dY_Pi (w : ResetWitness d K) (p : Point) : dY (Pi w) p = E w p ^ 2 / 2 := |
| 378 | (dY_hasDerivAt (Pi_smooth w) p).unique (Pi_hasDerivAt w p) |
| 379 | |
| 380 | theorem angularStock_hasDerivAt (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 381 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 382 | HasDerivAt (fun y => angularStock w Amp (y, p.2)) (X p * angularSource w Amp p) p.1 := by |
| 383 | have hd := (((((XW_hasDerivAt d ha p).mul (dY_hasDerivAt (H_smooth w) p)).neg.add |
| 384 | ((I_hasDerivAt w p).const_mul (1 - d.h))).sub |
| 385 | ((dEta_I_hasDerivAt w p).const_mul (axialExponent d.h * p.2))).sub |
| 386 | ((dEta_J_hasDerivAt w ha p).const_mul (coordinateFactor p.2))).add |
| 387 | ((J_hasDerivAt w ha p).const_mul (2 * (d.h - axialExponent d.h) * p.2)) |
| 388 | change HasDerivAt (fun y => angularStock w Amp (y, p.2)) _ p.1 at hd |
| 389 | apply hd.congr_deriv |
| 390 | rw [XW_eq_mul_W] |
| 391 | unfold angularSource |
| 392 | ring |
| 393 | |
| 394 | theorem axialStock_hasDerivAt (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 395 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 396 | HasDerivAt (fun y => axialStock w Amp (y, p.2)) (X p * Sn w Amp p) p.1 := by |
| 397 | have hd := (((((XW_hasDerivAt d ha p).fun_mul (dY_hasDerivAt (U_smooth d ha) p)).fun_neg.fun_add |
| 398 | (((M_hasDerivAt d ha p).fun_sub ((dEta_M_hasDerivAt d ha p).const_mul p.2)).const_mul |
| 399 | (axialExponent d.h))).fun_add ((S_hasDerivAt w ha p).const_mul (4 * d.h * p.2))).fun_sub |
| 400 | ((dEta_S_hasDerivAt w ha p).const_mul (coordinateFactor p.2))).fun_add |
| 401 | ((X_hasDerivAt p).fun_mul (((Pi_hasDerivAt w p).const_mul (4 * velocityExponent d.h * p.2)).fun_sub |
| 402 | ((dEta_Pi_hasDerivAt w p).const_mul (coordinateFactor p.2)))) |
| 403 | change HasDerivAt (fun y => axialStock w Amp (y, p.2)) _ p.1 at hd |
| 404 | apply hd.congr_deriv |
| 405 | rw [XW_eq_mul_W] |
| 406 | unfold Sn |
| 407 | rw [dY_Pi] |
| 408 | unfold energyDensity axialExponent velocityExponent |
| 409 | ring |
| 410 | |
| 411 | /-- Equation (9), with every moment and derivative constructed above. -/ |
| 412 | theorem Qs_integrated (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : |
| 413 | Qs w Amp p = -W d Amp p + |
| 414 | ((1 - d.h) * I w p - axialExponent d.h * p.2 * dEta (I w) p - |
| 415 | coordinateFactor p.2 * dEta (J w Amp) p + |
| 416 | 2 * (d.h - axialExponent d.h) * p.2 * J w Amp p) / (X p * H w p) := by |
| 417 | unfold Qs angularStock |
| 418 | rw [XW_eq_mul_W] |
| 419 | field_simp [(X_pos p).ne', (H_pos w p).ne'] ; ring |
| 420 | |
| 421 | /-- The axial row of (9) for the same corrected fields as `Qs`. -/ |
| 422 | theorem Ns_integrated (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : |
| 423 | Ns w Amp p = -W d Amp p * U d Amp p + |
| 424 | axialExponent d.h * (M d Amp p - p.2 * dEta (M d Amp) p) / X p + |
| 425 | (4 * d.h * p.2 * S w Amp p - coordinateFactor p.2 * dEta (S w Amp) p) / X p + |
| 426 | 4 * velocityExponent d.h * p.2 * Pi w p - coordinateFactor p.2 * dEta (Pi w) p := by |
| 427 | unfold Ns axialStock |
| 428 | rw [XW_eq_mul_W] |
| 429 | field_simp [(X_pos p).ne'] ; ring |
| 430 | |
| 431 | theorem Qs_hasDerivAt (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 432 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 433 | HasDerivAt (fun y => Qs w Amp (y, p.2)) |
| 434 | (Sq w Amp p - (1 + dY (H w) p / H w p) * Qs w Amp p) p.1 := by |
| 435 | have hd := (angularStock_hasDerivAt w ha p).fun_div |
| 436 | ((X_hasDerivAt p).fun_mul (dY_hasDerivAt (H_smooth w) p)) |
| 437 | (mul_ne_zero (X_pos p).ne' (H_pos w p).ne') |
| 438 | change HasDerivAt (fun y => Qs w Amp (y, p.2)) _ p.1 at hd |
| 439 | apply hd.congr_deriv |
| 440 | unfold Sq Qs |
| 441 | field_simp [(X_pos p).ne', (H_pos w p).ne'] |
| 442 | |
| 443 | theorem Ns_hasDerivAt (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 444 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 445 | HasDerivAt (fun y => Ns w Amp (y, p.2)) (Sn w Amp p - Ns w Amp p) p.1 := by |
| 446 | have hd := (axialStock_hasDerivAt w ha p).div (X_hasDerivAt p) (X_pos p).ne' |
| 447 | change HasDerivAt (fun y => Ns w Amp (y, p.2)) _ p.1 at hd |
| 448 | apply hd.congr_deriv |
| 449 | unfold Ns |
| 450 | field_simp [(X_pos p).ne'] |
| 451 | |
| 452 | /-- The angular ODE (6), using the derivative in the true log coordinate. -/ |
| 453 | theorem Qs_equation (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 454 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 455 | deriv (fun y => Qs w Amp (y, p.2)) p.1 + |
| 456 | (1 + dY (H w) p / H w p) * Qs w Amp p = Sq w Amp p := by |
| 457 | rw [(Qs_hasDerivAt w ha p).deriv] |
| 458 | ring |
| 459 | |
| 460 | /-- The axial ODE (6); no derivative identity is an input hypothesis. -/ |
| 461 | theorem Ns_equation (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 462 | (ha : ContDiff ℝ ∞ Amp) (p : Point) : |
| 463 | deriv (fun y => Ns w Amp (y, p.2)) p.1 + Ns w Amp p = Sn w Amp p := by |
| 464 | rw [(Ns_hasDerivAt w ha p).deriv] |
| 465 | ring |
| 466 | |
| 467 | theorem dEta_H (w : ResetWitness d K) (p : Point) : |
| 468 | dEta (H w) p = Real.exp (p.1 / 2) * dEta (E w) p := by |
| 469 | exact (dEta_hasDerivAt (H_smooth w) p).unique |
| 470 | ((dEta_hasDerivAt (E_smooth w) p).const_mul (Real.exp (p.1 / 2))) |
| 471 | |
| 472 | /-- The source as printed in (6), with logarithmic derivatives written as ratios. -/ |
| 473 | theorem Sq_formula (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : |
| 474 | Sq w Amp p = -W d Amp p * (dY (H w) p / H w p) - d.h * (1 - 2 * p.2 * U d Amp p) - |
| 475 | (axialExponent d.h * p.2 + coordinateFactor p.2 * U d Amp p) * (dEta (E w) p / E w p) := by |
| 476 | unfold Sq angularSource |
| 477 | rw [dEta_H] |
| 478 | unfold H |
| 479 | field_simp [(Real.exp_pos (p.1 / 2)).ne', (E_pos w p).ne'] |
| 480 | |
| 481 | /-! ## The incoming values and the unchanged pre-pulse region -/ |
| 482 | |
| 483 | theorem E_before (w : ResetWitness d K) (eta : ℝ) {y : ℝ} (hy : y ≤ d.core.endpoint) : |
| 484 | E w (y, eta) = angular d.core.P d.core.dropLength d.core.lam (y, eta) := by |
| 485 | have hout : y ∉ Ioo (d.releaseStart - 4) d.releaseStart := by |
| 486 | intro h |
| 487 | linarith [last_four_after_flatten d, flattenEnd_gt_core d, h.1] |
| 488 | rw [E, correctedAngular_unchanged d w.coefficients eta hout, finalAngular_before d eta hy] |
| 489 | |
| 490 | theorem E_ideal (w : ResetWitness d K) (eta : ℝ) {y : ℝ} (hy : y ≤ 0) : |
| 491 | E w (y, eta) = d.core.P * shape eta * Real.exp (y / 10) := by |
| 492 | rw [E_before w eta (hy.trans (SchedulePressure.endpoint_pos d).le)] |
| 493 | exact angular_ideal d.core.dropLength_pos.le hy |
| 494 | |
| 495 | theorem U_ideal (d : TailData) (Amp : ℝ → ℝ) (eta : ℝ) {y : ℝ} (hy : y ≤ 0) : |
| 496 | U d Amp (y, eta) = 4 * eta := axial_ideal d.core Amp eta hy |
| 497 | |
| 498 | theorem U_before_pulse (d : TailData) (Amp : ℝ → ℝ) (eta : ℝ) {y : ℝ} (hy : y ≤ d.core.pulseStart) : |
| 499 | U d Amp (y, eta) = dropCoefficient d.core.m y * eta := axial_before_pulse d.core Amp eta hy |
| 500 | |
| 501 | theorem M_eq_massMoment (d : TailData) (Amp : ℝ → ℝ) (y eta : ℝ) : |
| 502 | M d Amp (y, eta) = massMoment d.core Amp eta y := rfl |
| 503 | |
| 504 | @[simp] theorem history_zero (initial : ℝ → ℝ) (f : Field) (eta : ℝ) : |
| 505 | history initial f (0, eta) = initial eta := by simp [history, ProfileHistories.primitive] |
| 506 | |
| 507 | theorem dEta_history_zero {initial : ℝ → ℝ} {f : Field} |
| 508 | (hi : ContDiff ℝ ∞ initial) (hf : ContDiff ℝ ∞ f) (eta : ℝ) : |
| 509 | dEta (history initial f) (0, eta) = deriv initial eta := by |
| 510 | rw [dEta_prefix hi hf] |
| 511 | simp [ProfileHistories.primitive] |
| 512 | |
| 513 | @[simp] theorem M_zero (d : TailData) (Amp : ℝ → ℝ) (eta : ℝ) : |
| 514 | M d Amp (0, eta) = initialM eta := history_zero _ _ _ |
| 515 | @[simp] theorem I_zero (w : ResetWitness d K) (eta : ℝ) : |
| 516 | I w (0, eta) = initialI d eta := history_zero _ _ _ |
| 517 | @[simp] theorem J_zero (w : ResetWitness d K) (Amp : ℝ → ℝ) (eta : ℝ) : |
| 518 | J w Amp (0, eta) = initialJ d eta := history_zero _ _ _ |
| 519 | @[simp] theorem S_zero (w : ResetWitness d K) (Amp : ℝ → ℝ) (eta : ℝ) : |
| 520 | S w Amp (0, eta) = initialS d eta := history_zero _ _ _ |
| 521 | @[simp] theorem Pi_zero (w : ResetWitness d K) (eta : ℝ) : |
| 522 | Pi w (0, eta) = initialPi d eta := history_zero _ _ _ |
| 523 | @[simp] theorem X_zero (eta : ℝ) : X (0, eta) = 1 := Real.exp_zero |
| 524 | @[simp] theorem H_zero (w : ResetWitness d K) (eta : ℝ) : H w (0, eta) = d.core.P * shape eta := by |
| 525 | simp only [H, E_ideal w eta le_rfl, zero_div, Real.exp_zero, one_mul, mul_one] |
| 526 | |
| 527 | theorem dEta_M_zero (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) : |
| 528 | dEta (M d Amp) (0, eta) = 4 := by |
| 529 | rw [M, dEta_history_zero initialM_smooth (massWeight_smooth d ha)] |
| 530 | unfold initialM |
| 531 | simpa only [id_eq, mul_one] using ((hasDerivAt_id eta).const_mul (4 : ℝ)).deriv |
| 532 | |
| 533 | theorem dEta_I_zero (w : ResetWitness d K) (eta : ℝ) : |
| 534 | dEta (I w) (0, eta) = ((5 / 8) * d.core.P) * |
| 535 | (shape eta * (-(2 * eta / (1 + eta ^ 2)))) := by |
| 536 | rw [I, dEta_history_zero (initialI_smooth d) (angularWeight_smooth w)] |
| 537 | exact ((UniformAngularReset.shape_hasDerivAt eta).const_mul ((5 / 8) * d.core.P)).deriv |
| 538 | |
| 539 | theorem dEta_J_zero (w : ResetWitness d K) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) : |
| 540 | dEta (J w Amp) (0, eta) = ((5 / 2) * d.core.P) * shape eta + |
| 541 | ((5 / 2) * d.core.P * eta) * (shape eta * (-(2 * eta / (1 + eta ^ 2)))) := by |
| 542 | rw [J, dEta_history_zero (initialJ_smooth d) (transportWeight_smooth w ha)] |
| 543 | unfold initialJ |
| 544 | simpa only [id_eq, mul_one] using |
| 545 | (((hasDerivAt_id eta).const_mul ((5 / 2) * d.core.P)).fun_mul |
| 546 | (UniformAngularReset.shape_hasDerivAt eta)).deriv |
| 547 | |
| 548 | /-- The incoming angular lag is fixed by the actual ideal-past integrals. -/ |
| 549 | theorem Qs_initial (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 550 | (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) : |
| 551 | Qs w Amp (0, eta) = |
| 552 | ((3 / 5) * (4 * (1 - 2 * d.h * eta ^ 2) - 1) - d.h * (1 - 8 * eta ^ 2) + |
| 553 | (axialExponent d.h + 4 * coordinateFactor eta) * eta * |
| 554 | (2 * eta / (1 + eta ^ 2))) / (8 / 5) := by |
| 555 | rw [Qs_integrated] |
| 556 | simp only [W, XW, X_zero, M_zero, dEta_M_zero d ha eta, I_zero, dEta_I_zero w eta, |
| 557 | J_zero, dEta_J_zero w ha eta, H_zero, one_mul, div_one] |
| 558 | unfold initialM initialI initialJ axialExponent coordinateFactor |
| 559 | have hp := d.core.P_pos.ne' |
| 560 | have hs := (shape_pos eta).ne' |
| 561 | have he : (1 : ℝ) + eta ^ 2 ≠ 0 := by positivity |
| 562 | field_simp [hp, hs, he] ; ring |
| 563 | |
| 564 | /-! ## Exact endpoint cancellation for the common fields -/ |
| 565 | |
| 566 | theorem U_after_endpoint (d : TailData) (Amp : ℝ → ℝ) (eta : ℝ) |
| 567 | {y : ℝ} (hy : d.core.endpoint ≤ y) : U d Amp (y, eta) = 0 := |
| 568 | axial_after_pulse d.core Amp eta hy |
| 569 | |
| 570 | theorem angular_product_eq (w : ResetWitness d K) (Amp : ℝ → ℝ) (y eta : ℝ) : |
| 571 | E w (y, eta) * U d Amp (y, eta) = |
| 572 | angular d.core.P d.core.dropLength d.core.lam (y, eta) * U d Amp (y, eta) := by |
| 573 | by_cases hy : y ≤ d.core.endpoint |
| 574 | · rw [E_before w eta hy] |
| 575 | · rw [U_after_endpoint d Amp eta (le_of_not_ge hy)] |
| 576 | simp |
| 577 | |
| 578 | theorem transportWeight_eq_core (w : ResetWitness d K) (Amp : ℝ → ℝ) (y eta : ℝ) : |
| 579 | transportWeight w Amp (y, eta) = Real.exp (3 * y / 2) * |
| 580 | angular d.core.P d.core.dropLength d.core.lam (y, eta) * U d Amp (y, eta) := by |
| 581 | calc |
| 582 | _ = angularWeight w (y, eta) * U d Amp (y, eta) := by |
| 583 | unfold transportWeight angularWeight |
| 584 | ring |
| 585 | _ = Real.exp (3 * y / 2) * (E w (y, eta) * U d Amp (y, eta)) := by |
| 586 | rw [angularWeight_eq] |
| 587 | ring |
| 588 | _ = _ := by rw [angular_product_eq]; ring |
| 589 | |
| 590 | theorem J_eq_angularMoment (w : ResetWitness d K) (Amp : ℝ → ℝ) (y eta : ℝ) : |
| 591 | Real.sqrt 2 * J w Amp (y, eta) = angularMoment d.core Amp eta y := by |
| 592 | unfold J history ProfileHistories.primitive angularMoment |
| 593 | rw [mul_add, ← intervalIntegral.integral_const_mul] |
| 594 | congr 1 |
| 595 | · unfold initialJ |
| 596 | ring |
| 597 | · apply intervalIntegral.integral_congr |
| 598 | intro t _ |
| 599 | dsimp only |
| 600 | rw [transportWeight_eq_core] |
| 601 | unfold U |
| 602 | ring |
| 603 | |
| 604 | theorem M_after_endpoint (d : TailData) (Amp : ℝ → ℝ) (eta : ℝ) |
| 605 | {y : ℝ} (hy : d.core.endpoint ≤ y) : M d Amp (y, eta) = 0 := |
| 606 | massMoment_after_pulse d.core Amp eta hy |
| 607 | |
| 608 | theorem J_after_endpoint (w : ResetWitness d K) (Amp : ℝ → ℝ) (eta : ℝ) |
| 609 | {y : ℝ} (hy : d.core.endpoint ≤ y) : J w Amp (y, eta) = 0 := by |
| 610 | have he := J_eq_angularMoment w Amp y eta |
| 611 | rw [angularMoment_after_pulse d.core Amp eta hy] at he |
| 612 | exact (mul_eq_zero.mp he).resolve_left (Real.sqrt_pos.mpr (by norm_num)).ne' |
| 613 | |
| 614 | theorem dEta_M_after_endpoint (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) |
| 615 | {y : ℝ} (hy : d.core.endpoint ≤ y) : dEta (M d Amp) (y, eta) = 0 := by |
| 616 | have he : (fun eta => M d Amp (y, eta)) = (fun _ : ℝ => 0) := |
| 617 | funext (fun eta => M_after_endpoint d Amp eta hy) |
| 618 | rw [dEta_eq_deriv (M_smooth d ha), he] |
| 619 | exact deriv_const _ _ |
| 620 | |
| 621 | theorem dEta_J_after_endpoint (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 622 | (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} (hy : d.core.endpoint ≤ y) : |
| 623 | dEta (J w Amp) (y, eta) = 0 := by |
| 624 | have he : (fun eta => J w Amp (y, eta)) = (fun _ : ℝ => 0) := |
| 625 | funext (fun eta => J_after_endpoint w Amp eta hy) |
| 626 | rw [dEta_eq_deriv (J_smooth w ha), he] |
| 627 | exact deriv_const _ _ |
| 628 | |
| 629 | theorem W_after_endpoint (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) |
| 630 | {y : ℝ} (hy : d.core.endpoint ≤ y) : W d Amp (y, eta) = 1 := by |
| 631 | simp [W, XW, M_after_endpoint d Amp eta hy, dEta_M_after_endpoint d ha eta hy, (X_pos _).ne'] |
| 632 | |
| 633 | theorem Qs_after_endpoint (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 634 | (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} (hy : d.core.endpoint ≤ y) : |
| 635 | Qs w Amp (y, eta) = -1 + |
| 636 | ((1 - d.h) * I w (y, eta) - axialExponent d.h * eta * dEta (I w) (y, eta)) / |
| 637 | (Real.exp (3 * y / 2) * E w (y, eta)) := by |
| 638 | rw [Qs_integrated, W_after_endpoint d ha eta hy, J_after_endpoint w Amp eta hy, |
| 639 | dEta_J_after_endpoint w ha eta hy] |
| 640 | have he := angularWeight_eq w (y, eta) |
| 641 | change X (y, eta) * H w (y, eta) = _ at he |
| 642 | rw [he] |
| 643 | ring |
| 644 | |
| 645 | theorem Ns_after_endpoint (w : ResetWitness d K) {Amp : ℝ → ℝ} |
| 646 | (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} (hy : d.core.endpoint ≤ y) : |
| 647 | Ns w Amp (y, eta) = |
| 648 | (4 * d.h * eta * S w Amp (y, eta) - coordinateFactor eta * dEta (S w Amp) (y, eta)) / |
| 649 | Real.exp y + 4 * velocityExponent d.h * eta * Pi w (y, eta) - |
| 650 | coordinateFactor eta * dEta (Pi w) (y, eta) := by |
| 651 | rw [Ns_integrated, U_after_endpoint d Amp eta hy, M_after_endpoint d Amp eta hy, |
| 652 | dEta_M_after_endpoint d ha eta hy] |
| 653 | simp only [X, mul_zero, sub_zero, zero_div, zero_add] |
| 654 | |
| 655 | /-! ## Identification with actual improper past integrals -/ |
| 656 | |
| 657 | theorem past_integrable {f : ℝ → ℝ} (hf : Continuous f) |
| 658 | (h0 : IntegrableOn f (Iic (0 : ℝ))) (y : ℝ) : IntegrableOn f (Iic y) := by |
| 659 | by_cases hy : 0 ≤ y |
| 660 | · rw [← Iic_union_Ioc_eq_Iic hy] |
| 661 | exact h0.union hf.integrableOn_Ioc |
| 662 | · exact h0.mono_set (Iic_subset_Iic.mpr (le_of_not_ge hy)) |
| 663 | |
| 664 | theorem past_integral {f : ℝ → ℝ} (hf : Continuous f) |
| 665 | (h0 : IntegrableOn f (Iic (0 : ℝ))) (y : ℝ) : |
| 666 | (∫ t in Iic y, f t) = (∫ t in Iic (0 : ℝ), f t) + ∫ t in (0 : ℝ)..y, f t := by |
| 667 | have he := intervalIntegral.integral_Iic_sub_Iic h0 (past_integrable hf h0 y) |
| 668 | linarith |
| 669 | |
| 670 | theorem exponential_past {f : ℝ → ℝ} (a b : ℝ) (hb : 0 < b) |
| 671 | (he : ∀ y ≤ 0, f y = a * Real.exp (b * y)) : |
| 672 | IntegrableOn f (Iic (0 : ℝ)) ∧ (∫ t in Iic (0 : ℝ), f t) = a / b := by |
| 673 | refine ⟨IntegrableOn.congr_fun ((integrableOn_exp_mul_Iic hb 0).const_mul a) |
| 674 | (fun t ht => (he t ht).symm) measurableSet_Iic, ?_⟩ |
| 675 | calc |
| 676 | _ = ∫ t in Iic (0 : ℝ), a * Real.exp (b * t) := |
| 677 | setIntegral_congr_fun measurableSet_Iic (fun t ht => he t ht) |
| 678 | _ = _ := by rw [integral_const_mul, integral_exp_mul_Iic hb]; simp [div_eq_mul_inv] |
| 679 | |
| 680 | theorem mass_past (d : TailData) (Amp : ℝ → ℝ) (eta : ℝ) : |
| 681 | IntegrableOn (fun y => massWeight d Amp (y, eta)) (Iic (0 : ℝ)) ∧ |
| 682 | (∫ y in Iic (0 : ℝ), massWeight d Amp (y, eta)) = initialM eta := by |
| 683 | have he := exponential_past (f := fun y => massWeight d Amp (y, eta)) (4 * eta) 1 (by norm_num) ?_ |
| 684 | · simpa [initialM] using he |
| 685 | · intro y hy |
| 686 | unfold massWeight |
| 687 | rw [U_ideal d Amp eta hy] |
| 688 | simp [X, mul_comm] |
| 689 | |
| 690 | theorem angularWeight_ideal (w : ResetWitness d K) (eta : ℝ) {y : ℝ} (hy : y ≤ 0) : |
| 691 | angularWeight w (y, eta) = (d.core.P * shape eta) * Real.exp ((8 / 5 : ℝ) * y) := by |
| 692 | rw [angularWeight_eq, E_ideal w eta hy] |
| 693 | calc |
| 694 | _ = (d.core.P * shape eta) * (Real.exp (3 * y / 2) * Real.exp (y / 10)) := by ring |
| 695 | _ = _ := by rw [← Real.exp_add]; congr 2; ring |
| 696 | |
| 697 | theorem angular_past (w : ResetWitness d K) (eta : ℝ) : |
| 698 | IntegrableOn (fun y => angularWeight w (y, eta)) (Iic (0 : ℝ)) ∧ |
| 699 | (∫ y in Iic (0 : ℝ), angularWeight w (y, eta)) = initialI d eta := by |
| 700 | have he := exponential_past (f := fun y => angularWeight w (y, eta)) |
| 701 | (d.core.P * shape eta) (8 / 5) (by norm_num) (fun y hy => angularWeight_ideal w eta hy) |
| 702 | refine ⟨he.1, he.2.trans ?_⟩ |
| 703 | unfold initialI |
| 704 | ring |
| 705 | |
| 706 | theorem transport_past (w : ResetWitness d K) (Amp : ℝ → ℝ) (eta : ℝ) : |
| 707 | IntegrableOn (fun y => transportWeight w Amp (y, eta)) (Iic (0 : ℝ)) ∧ |
| 708 | (∫ y in Iic (0 : ℝ), transportWeight w Amp (y, eta)) = initialJ d eta := by |
| 709 | have he := exponential_past (f := fun y => transportWeight w Amp (y, eta)) |
| 710 | (4 * eta * (d.core.P * shape eta)) (8 / 5) (by norm_num) ?_ |
| 711 | · refine ⟨he.1, he.2.trans ?_⟩ |
| 712 | unfold initialJ |
| 713 | ring |
| 714 | · intro y hy |
| 715 | have hw : transportWeight w Amp (y, eta) = U d Amp (y, eta) * angularWeight w (y, eta) := by |
| 716 | unfold transportWeight angularWeight |
| 717 | ring |
| 718 | rw [hw, U_ideal d Amp eta hy, angularWeight_ideal w eta hy] |
| 719 | ring |
| 720 | |
| 721 | theorem weighted_square_ideal (w : ResetWitness d K) (b eta : ℝ) {y : ℝ} (hy : y ≤ 0) : |
| 722 | Real.exp (b * y) * E w (y, eta) ^ 2 / 2 = |
| 723 | (d.core.P ^ 2 * shape eta ^ 2 / 2) * Real.exp ((b + 1 / 5) * y) := by |
| 724 | rw [E_ideal w eta hy] |
| 725 | simp only [mul_pow] |
| 726 | rw [pow_two (Real.exp _), ← Real.exp_add] |
| 727 | calc |
| 728 | _ = (d.core.P ^ 2 * shape eta ^ 2 / 2) * |
| 729 | (Real.exp (b * y) * Real.exp (y / 10 + y / 10)) := by ring |
| 730 | _ = _ := by rw [← Real.exp_add]; congr 2; ring |
| 731 | |
| 732 | theorem energy_past (w : ResetWitness d K) (Amp : ℝ → ℝ) (eta : ℝ) : |
| 733 | IntegrableOn (fun y => energyWeight w Amp (y, eta)) (Iic (0 : ℝ)) ∧ |
| 734 | (∫ y in Iic (0 : ℝ), energyWeight w Amp (y, eta)) = initialS d eta := by |
| 735 | have hu := exponential_past (f := fun y => Real.exp y * U d Amp (y, eta) ^ 2) |
| 736 | (16 * eta ^ 2) 1 (by norm_num) (by |
| 737 | intro y hy |
| 738 | rw [U_ideal d Amp eta hy, one_mul] |
| 739 | ring) |
| 740 | have he := exponential_past (f := fun y => Real.exp y * E w (y, eta) ^ 2 / 2) |
| 741 | (d.core.P ^ 2 * shape eta ^ 2 / 2) (6 / 5) (by norm_num) (by |
| 742 | intro y hy |
| 743 | simpa only [one_mul, show (1 : ℝ) + 1 / 5 = 6 / 5 by norm_num] using |
| 744 | weighted_square_ideal w 1 eta hy) |
| 745 | have hf : (fun y => energyWeight w Amp (y, eta)) = |
| 746 | (fun y => Real.exp y * U d Amp (y, eta) ^ 2 - Real.exp y * E w (y, eta) ^ 2 / 2) := by |
| 747 | funext y |
| 748 | unfold energyWeight X energyDensity |
| 749 | ring |
| 750 | rw [hf] |
| 751 | refine ⟨hu.1.sub he.1, ?_⟩ |
| 752 | rw [integral_sub hu.1 he.1, hu.2, he.2] |
| 753 | unfold initialS |
| 754 | ring |
| 755 | |
| 756 | theorem pressure_past (w : ResetWitness d K) (eta : ℝ) : |
| 757 | IntegrableOn (fun y => pressureWeight w (y, eta)) (Iic (0 : ℝ)) ∧ |
| 758 | (∫ y in Iic (0 : ℝ), pressureWeight w (y, eta)) = |
| 759 | (5 / 2) * d.core.P ^ 2 * shape eta ^ 2 := by |
| 760 | have he := exponential_past (f := fun y => pressureWeight w (y, eta)) |
| 761 | (d.core.P ^ 2 * shape eta ^ 2 / 2) (1 / 5) (by norm_num) (by |
| 762 | intro y hy |
| 763 | simpa [pressureWeight] using weighted_square_ideal w 0 eta hy) |
| 764 | exact ⟨he.1, he.2.trans (by ring)⟩ |
| 765 | |
| 766 | theorem M_eq_integral (d : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (y eta : ℝ) : |
| 767 | M d Amp (y, eta) = ∫ t in Iic y, Real.exp t * U d Amp (t, eta) := by |
| 768 | have he := past_integral (f := fun t => massWeight d Amp (t, eta)) |
| 769 | ((massWeight_smooth d ha).continuous.comp (continuous_id.prodMk continuous_const)) |
| 770 | (mass_past d Amp eta).1 y |
| 771 | rw [(mass_past d Amp eta).2] at he |
| 772 | exact he.symm |
| 773 | |
| 774 | theorem I_eq_integral (w : ResetWitness d K) (y eta : ℝ) : |
| 775 | I w (y, eta) = ∫ t in Iic y, Real.exp (3 * t / 2) * E w (t, eta) := by |
| 776 | have he : (fun t => Real.exp (3 * t / 2) * E w (t, eta)) = |
| 777 | (fun t => angularWeight w (t, eta)) := funext (fun t => (angularWeight_eq w (t, eta)).symm) |
| 778 | rw [he] |
| 779 | have hi := past_integral (f := fun t => angularWeight w (t, eta)) |
| 780 | ((angularWeight_smooth w).continuous.comp (continuous_id.prodMk continuous_const)) |
| 781 | (angular_past w eta).1 y |
| 782 | rw [(angular_past w eta).2] at hi |
| 783 | exact hi.symm |
| 784 | |
| 785 | theorem J_eq_integral (w : ResetWitness d K) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (y eta : ℝ) : |
| 786 | J w Amp (y, eta) = ∫ t in Iic y, Real.exp (3 * t / 2) * E w (t, eta) * U d Amp (t, eta) := by |
| 787 | have he : (fun t => Real.exp (3 * t / 2) * E w (t, eta) * U d Amp (t, eta)) = |
| 788 | (fun t => transportWeight w Amp (t, eta)) := by |
| 789 | funext t |
| 790 | have hi := angularWeight_eq w (t, eta) |
| 791 | dsimp only at hi |
| 792 | rw [← hi] |
| 793 | unfold angularWeight transportWeight |
| 794 | ring |
| 795 | rw [he] |
| 796 | have hi := past_integral (f := fun t => transportWeight w Amp (t, eta)) |
| 797 | ((transportWeight_smooth w ha).continuous.comp (continuous_id.prodMk continuous_const)) |
| 798 | (transport_past w Amp eta).1 y |
| 799 | rw [(transport_past w Amp eta).2] at hi |
| 800 | exact hi.symm |
| 801 | |
| 802 | theorem S_eq_integral (w : ResetWitness d K) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (y eta : ℝ) : |
| 803 | S w Amp (y, eta) = ∫ t in Iic y, Real.exp t * (U d Amp (t, eta) ^ 2 - E w (t, eta) ^ 2 / 2) := by |
| 804 | have hi := past_integral (f := fun t => energyWeight w Amp (t, eta)) |
| 805 | ((energyWeight_smooth w ha).continuous.comp (continuous_id.prodMk continuous_const)) |
| 806 | (energy_past w Amp eta).1 y |
| 807 | rw [(energy_past w Amp eta).2] at hi |
| 808 | exact hi.symm |
| 809 | |
| 810 | theorem Pi_eq_past_integral (w : ResetWitness d K) (y eta : ℝ) : |
| 811 | Pi w (y, eta) = SchedulePressure.axisPressure d eta + |
| 812 | ∫ t in Iic y, E w (t, eta) ^ 2 / 2 := by |
| 813 | have hi := past_integral (f := fun t => pressureWeight w (t, eta)) |
| 814 | ((pressureWeight_smooth w).continuous.comp (continuous_id.prodMk continuous_const)) |
| 815 | (pressure_past w eta).1 y |
| 816 | rw [(pressure_past w eta).2] at hi |
| 817 | change Pi w (y, eta) = SchedulePressure.axisPressure d eta + |
| 818 | ∫ t in Iic y, pressureWeight w (t, eta) |
| 819 | rw [hi] |
| 820 | unfold Pi history ProfileHistories.primitive initialPi |
| 821 | ring |
| 822 | |
| 823 | /-! ## The same corrected field fixes the canonical pressure -/ |
| 824 | |
| 825 | theorem E_square_integrable (w : ResetWitness d K) (eta : ℝ) : |
| 826 | Integrable (fun y => E w (y, eta) ^ 2) := by |
| 827 | let changeE : ℝ → ℝ := fun y => E w (y, eta) ^ 2 - finalAngular d (y, eta) ^ 2 |
| 828 | have hc : Continuous changeE := |
| 829 | (((E_smooth w).continuous.comp (continuous_id.prodMk continuous_const)).pow 2).sub |
| 830 | (((finalAngular_contDiff d).continuous.comp (continuous_id.prodMk continuous_const)).pow 2) |
| 831 | have hs : support changeE ⊆ Icc (d.releaseStart - 4) d.releaseStart := by |
| 832 | intro y hy |
| 833 | by_contra hn |
| 834 | apply hy |
| 835 | have hout : y ∉ Ioo (d.releaseStart - 4) d.releaseStart := fun hm => hn ⟨hm.1.le, hm.2.le⟩ |
| 836 | simp [changeE, E, correctedAngular_unchanged d w.coefficients eta hout] |
| 837 | have hi : Integrable changeE := hc.integrable_of_hasCompactSupport |
| 838 | (HasCompactSupport.of_support_subset_isCompact isCompact_Icc hs) |
| 839 | convert! hi.add (SchedulePressure.angular_square_integrable d eta) using 1 |
| 840 | funext y |
| 841 | dsimp [changeE] |
| 842 | ring |
| 843 | |
| 844 | theorem E_square_integral (w : ResetWitness d K) (eta : ℝ) : |
| 845 | (∫ y, E w (y, eta) ^ 2) = ∫ y, finalAngular d (y, eta) ^ 2 := by |
| 846 | have he := w.pressure_neutral eta |
| 847 | change (∫ y, E w (y, eta) ^ 2 - finalAngular d (y, eta) ^ 2) = 0 at he |
| 848 | rw [integral_sub (E_square_integrable w eta) (SchedulePressure.angular_square_integrable d eta)] at he |
| 849 | linarith |
| 850 | |
| 851 | theorem Pi_eq_future_integral (w : ResetWitness d K) (y eta : ℝ) : |
| 852 | Pi w (y, eta) = -(1 / 2 : ℝ) * ∫ t in Ioi y, E w (t, eta) ^ 2 := by |
| 853 | have hi := E_square_integrable w eta |
| 854 | have hs := intervalIntegral.integral_Iic_add_Ioi |
| 855 | (hi.integrableOn (s := Iic y)) (hi.integrableOn (s := Ioi y)) |
| 856 | have he := E_square_integral w eta |
| 857 | rw [Pi_eq_past_integral, integral_div] |
| 858 | unfold SchedulePressure.axisPressure |
| 859 | linarith |
| 860 | |
| 861 | noncomputable def shapeRate (eta : ℝ) : ℝ := 2 * eta / (1 + eta ^ 2) |
| 862 | |
| 863 | /-! ## The ideal past also fixes the source primitives -/ |
| 864 | |
| 865 | /-! ## Entrance-radius factors -/ |
| 866 | |
| 867 | noncomputable def physicalX (XR : ℝ) (p : Point) : ℝ := XR * X p |
| 868 | |
| 869 | noncomputable def p1 (XR : ℝ) (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 870 | physicalX XR p * Qs w Amp p / (1 - 2 * d.h * p.2 ^ 2) |
| 871 | noncomputable def p2 (XR : ℝ) (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := |
| 872 | physicalX XR p * Ns w Amp p / ((1 - 2 * d.h * p.2 ^ 2) * E w p) |
| 873 | |
| 874 | theorem p1_dilation (XR : ℝ) (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : |
| 875 | p1 XR w Amp p = XR * p1 1 w Amp p := by |
| 876 | unfold p1 physicalX |
| 877 | ring |
| 878 | |
| 879 | end NavierStokes.OutgoingHistories |