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.LocalizedMomentRepair |
| 2 | import NavierStokes.SmoothMomentRepair |
| 3 | import Mathlib.MeasureTheory.Group.Integral |
| 4 | import Mathlib.Topology.Algebra.Module.FiniteDimension |
| 5 | import Mathlib.Tactic.FinCases |
| 6 | |
| 7 | /-! |
| 8 | # A pressure-neutral angular-moment reset |
| 9 | |
| 10 | Two identical translated smooth relative bumps repair the angular moment while |
| 11 | preserving the pressure integral exactly. The actual two-row derivative matrix |
| 12 | is proved nonsingular, and the small smooth nonlinear branch is constructed. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | open Set Function Filter MeasureTheory |
| 18 | open scoped BigOperators ContDiff Topology |
| 19 | |
| 20 | namespace NavierStokes.AngularMomentReset |
| 21 | |
| 22 | abbrev Coeff := Fin 2 → ℝ |
| 23 | |
| 24 | def template : ℝ → ℝ := LocalizedMomentRepair.bump (-3 / 10) (3 / 10) |
| 25 | |
| 26 | def bump (j : Fin 2) (y : ℝ) : ℝ := template (y - 2 * (j.val : ℝ)) |
| 27 | |
| 28 | theorem template_contDiff : ContDiff ℝ ∞ template := |
| 29 | LocalizedMomentRepair.bump_contDiff _ _ |
| 30 | |
| 31 | theorem template_at_zero : template 0 = 1 := by |
| 32 | have h := LocalizedMomentRepair.bump_at_center (-3 / 10) (3 / 10) |
| 33 | norm_num at h |
| 34 | simpa [template, neg_div] using h |
| 35 | |
| 36 | theorem template_support : support template ⊆ Icc (-3 / 20 : ℝ) (3 / 20) := by |
| 37 | have h := LocalizedMomentRepair.bump_support_subset (-3 / 10) (3 / 10) (by norm_num) |
| 38 | norm_num [LocalizedMomentRepair.innerLower, LocalizedMomentRepair.innerUpper] at h |
| 39 | simpa [template, neg_div] using h |
| 40 | |
| 41 | theorem template_hasCompactSupport : HasCompactSupport template := |
| 42 | HasCompactSupport.of_support_subset_isCompact isCompact_Icc template_support |
| 43 | |
| 44 | theorem bump_contDiff (j : Fin 2) : ContDiff ℝ ∞ (bump j) := |
| 45 | template_contDiff.comp (contDiff_id.sub contDiff_const) |
| 46 | |
| 47 | theorem bump_nonneg (j : Fin 2) (y : ℝ) : 0 ≤ bump j y := |
| 48 | LocalizedMomentRepair.bump_nonneg _ _ _ |
| 49 | |
| 50 | theorem bump_le_one (j : Fin 2) (y : ℝ) : bump j y ≤ 1 := |
| 51 | LocalizedMomentRepair.bump_le_one _ _ _ |
| 52 | |
| 53 | theorem bump_support (j : Fin 2) : |
| 54 | support (bump j) ⊆ Icc (2 * (j.val : ℝ) - 3 / 20) (2 * (j.val : ℝ) + 3 / 20) := by |
| 55 | intro y hy |
| 56 | have h := template_support hy |
| 57 | change (-3 : ℝ) / 20 ≤ y - 2 * (j.val : ℝ) ∧ y - 2 * (j.val : ℝ) ≤ 3 / 20 at h |
| 58 | constructor <;> linarith [h.1, h.2] |
| 59 | |
| 60 | theorem bump_hasCompactSupport (j : Fin 2) : HasCompactSupport (bump j) := |
| 61 | HasCompactSupport.of_support_subset_isCompact isCompact_Icc (bump_support j) |
| 62 | |
| 63 | theorem bumps_disjoint (y : ℝ) : bump 0 y * bump 1 y = 0 := by |
| 64 | by_cases h0 : bump 0 y = 0 |
| 65 | · simp [h0] |
| 66 | by_cases h1 : bump 1 y = 0 |
| 67 | · simp [h1] |
| 68 | have hs0 := bump_support 0 h0 |
| 69 | have hs1 := bump_support 1 h1 |
| 70 | norm_num at hs0 hs1 |
| 71 | linarith [hs0.2, hs1.1] |
| 72 | |
| 73 | def moment (s : ℝ) : ℝ := ∫ y, Real.exp (s * y) * template y |
| 74 | |
| 75 | theorem weighted_bump_integrable (s : ℝ) (j : Fin 2) : |
| 76 | Integrable (fun y => Real.exp (s * y) * bump j y) := |
| 77 | ((Real.continuous_exp.comp (continuous_const.mul continuous_id)).mul |
| 78 | (bump_contDiff j).continuous).integrable_of_hasCompactSupport |
| 79 | (bump_hasCompactSupport j).mul_left |
| 80 | |
| 81 | theorem weighted_bump_sq_integrable (s : ℝ) (j : Fin 2) : |
| 82 | Integrable (fun y => Real.exp (s * y) * (bump j y) ^ 2) := by |
| 83 | have hc : HasCompactSupport (fun y => (bump j y) ^ 2) := by |
| 84 | simpa only [pow_two, Pi.mul_def] using (bump_hasCompactSupport j).mul_right (f' := bump j) |
| 85 | exact ((Real.continuous_exp.comp (continuous_const.mul continuous_id)).mul |
| 86 | ((bump_contDiff j).continuous.pow 2)).integrable_of_hasCompactSupport hc.mul_left |
| 87 | |
| 88 | theorem moment_pos (s : ℝ) : 0 < moment s := by |
| 89 | apply Continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero |
| 90 | ((Real.continuous_exp.comp (continuous_const.mul continuous_id)).mul template_contDiff.continuous) |
| 91 | template_hasCompactSupport.mul_left |
| 92 | · intro y |
| 93 | exact mul_nonneg (Real.exp_pos _).le (LocalizedMomentRepair.bump_nonneg _ _ _) |
| 94 | · exact (show Real.exp (s * 0) * template 0 ≠ 0 by simp [template_at_zero]) |
| 95 | |
| 96 | /-- Translation multiplies an exponential bump moment by its exact exponential factor. -/ |
| 97 | theorem bump_moment (s : ℝ) (j : Fin 2) : |
| 98 | (∫ y, Real.exp (s * y) * bump j y) = |
| 99 | Real.exp (s * (2 * (j.val : ℝ))) * moment s := by |
| 100 | rw [← integral_add_right_eq_self (fun y => Real.exp (s * y) * bump j y) |
| 101 | (2 * (j.val : ℝ))] |
| 102 | have hf : (fun y => Real.exp (s * (y + 2 * (j.val : ℝ))) * bump j (y + 2 * (j.val : ℝ))) = |
| 103 | (fun y => Real.exp (s * (2 * (j.val : ℝ))) * (Real.exp (s * y) * template y)) := by |
| 104 | funext y |
| 105 | simp only [bump, add_sub_cancel_right, mul_add, Real.exp_add] |
| 106 | ring |
| 107 | rw [hf, integral_const_mul] |
| 108 | rfl |
| 109 | |
| 110 | def angularSlope (lam : ℝ) : ℝ := 1 - lam |
| 111 | def pressureSlope (lam : ℝ) : ℝ := -1 - 2 * lam |
| 112 | |
| 113 | /-- The actual derivative matrix of the two integral changes at zero coefficients. -/ |
| 114 | def linearMatrix (lam : ℝ) : Matrix (Fin 2) (Fin 2) ℝ := |
| 115 | !![moment (angularSlope lam), Real.exp (2 * angularSlope lam) * moment (angularSlope lam); |
| 116 | 2 * moment (pressureSlope lam), |
| 117 | 2 * (Real.exp (2 * pressureSlope lam) * moment (pressureSlope lam))] |
| 118 | |
| 119 | theorem linearMatrix_det (lam : ℝ) : |
| 120 | (linearMatrix lam).det = 2 * moment (angularSlope lam) * moment (pressureSlope lam) * |
| 121 | (Real.exp (2 * pressureSlope lam) - Real.exp (2 * angularSlope lam)) := by |
| 122 | simp [linearMatrix, Matrix.det_fin_two] |
| 123 | ring |
| 124 | |
| 125 | theorem linearMatrix_det_ne_zero (lam : ℝ) (hlam : 0 < lam) : |
| 126 | (linearMatrix lam).det ≠ 0 := by |
| 127 | rw [linearMatrix_det] |
| 128 | apply mul_ne_zero |
| 129 | · exact mul_ne_zero (mul_ne_zero (by norm_num) (moment_pos _).ne') (moment_pos _).ne' |
| 130 | · apply ne_of_lt |
| 131 | apply sub_neg.mpr |
| 132 | apply Real.exp_lt_exp.mpr |
| 133 | unfold angularSlope pressureSlope |
| 134 | linarith |
| 135 | |
| 136 | /-- The integral derivative is an actual continuous linear equivalence. -/ |
| 137 | def linearEquiv (lam : ℝ) (hlam : 0 < lam) : Coeff ≃L[ℝ] Coeff := |
| 138 | LinearEquiv.toContinuousLinearEquiv |
| 139 | { toFun := (linearMatrix lam).mulVec |
| 140 | invFun := (linearMatrix lam)⁻¹.mulVec |
| 141 | map_add' := Matrix.mulVec_add _ |
| 142 | map_smul' := fun r c => Matrix.mulVec_smul _ r c |
| 143 | left_inv := fun c => by |
| 144 | rw [Matrix.mulVec_mulVec, Matrix.nonsing_inv_mul _ |
| 145 | (isUnit_iff_ne_zero.mpr (linearMatrix_det_ne_zero lam hlam)), Matrix.one_mulVec] |
| 146 | right_inv := fun c => by |
| 147 | rw [Matrix.mulVec_mulVec, Matrix.mul_nonsing_inv _ |
| 148 | (isUnit_iff_ne_zero.mpr (linearMatrix_det_ne_zero lam hlam)), Matrix.one_mulVec] } |
| 149 | |
| 150 | def relative (c : Coeff) (y : ℝ) : ℝ := c 0 * bump 0 y + c 1 * bump 1 y |
| 151 | |
| 152 | theorem relative_contDiff (c : Coeff) : ContDiff ℝ ∞ (relative c) := |
| 153 | (contDiff_const.mul (bump_contDiff 0)).add (contDiff_const.mul (bump_contDiff 1)) |
| 154 | |
| 155 | theorem relative_support (c : Coeff) : support (relative c) ⊆ Icc (-3 / 20 : ℝ) (43 / 20) := by |
| 156 | intro y hy |
| 157 | by_cases h0 : bump 0 y = 0 |
| 158 | · have h1 : bump 1 y ≠ 0 := by intro h1; exact hy (by simp [relative, h0, h1]) |
| 159 | have hs := bump_support 1 h1 |
| 160 | norm_num at hs |
| 161 | constructor <;> linarith [hs.1, hs.2] |
| 162 | · have hs := bump_support 0 h0 |
| 163 | norm_num at hs |
| 164 | constructor <;> linarith [hs.1, hs.2] |
| 165 | |
| 166 | theorem relative_hasCompactSupport (c : Coeff) : HasCompactSupport (relative c) := |
| 167 | HasCompactSupport.of_support_subset_isCompact isCompact_Icc (relative_support c) |
| 168 | |
| 169 | def quadraticMoment (lam : ℝ) (j : Fin 2) : ℝ := |
| 170 | ∫ y, Real.exp (pressureSlope lam * y) * (bump j y) ^ 2 |
| 171 | |
| 172 | def quadraticBilin (lam : ℝ) : Coeff →ₗ[ℝ] Coeff →ₗ[ℝ] Coeff where |
| 173 | toFun c := |
| 174 | { toFun := fun d => ![0, quadraticMoment lam 0 * c 0 * d 0 + quadraticMoment lam 1 * c 1 * d 1] |
| 175 | map_add' := fun d e => by |
| 176 | ext i |
| 177 | fin_cases i <;> simp [Pi.add_apply] |
| 178 | ring |
| 179 | map_smul' := fun r d => by |
| 180 | ext i |
| 181 | fin_cases i <;> simp [Pi.smul_apply, smul_eq_mul] |
| 182 | ring } |
| 183 | map_add' c d := by |
| 184 | ext e i |
| 185 | fin_cases i <;> simp [Pi.add_apply] |
| 186 | ring |
| 187 | map_smul' r c := by |
| 188 | ext e i |
| 189 | fin_cases i <;> simp [Pi.smul_apply, smul_eq_mul] |
| 190 | ring |
| 191 | |
| 192 | def quadraticCLM (lam : ℝ) : Coeff →L[ℝ] Coeff →L[ℝ] Coeff := |
| 193 | LinearMap.toContinuousLinearMap |
| 194 | ((LinearMap.toContinuousLinearMap (𝕜 := ℝ) (E := Coeff) (F' := Coeff)).toLinearMap.comp |
| 195 | (quadraticBilin lam)) |
| 196 | |
| 197 | theorem linearEquiv_apply (lam : ℝ) (hlam : 0 < lam) (c : Coeff) : |
| 198 | linearEquiv lam hlam c = (linearMatrix lam).mulVec c := rfl |
| 199 | |
| 200 | theorem quadraticCLM_apply (lam : ℝ) (c d : Coeff) : |
| 201 | quadraticCLM lam c d = |
| 202 | ![0, quadraticMoment lam 0 * c 0 * d 0 + quadraticMoment lam 1 * c 1 * d 1] := rfl |
| 203 | |
| 204 | theorem weighted_relative_integrable (s : ℝ) (c : Coeff) : |
| 205 | Integrable (fun y => Real.exp (s * y) * relative c y) := |
| 206 | ((Real.continuous_exp.comp (continuous_const.mul continuous_id)).mul |
| 207 | (relative_contDiff c).continuous).integrable_of_hasCompactSupport |
| 208 | (relative_hasCompactSupport c).mul_left |
| 209 | |
| 210 | theorem weighted_relative_sq_integrable (s : ℝ) (c : Coeff) : |
| 211 | Integrable (fun y => Real.exp (s * y) * (relative c y) ^ 2) := by |
| 212 | have hc : HasCompactSupport (fun y => (relative c y) ^ 2) := by |
| 213 | simpa only [pow_two, Pi.mul_def] using (relative_hasCompactSupport c).mul_right (f' := relative c) |
| 214 | exact ((Real.continuous_exp.comp (continuous_const.mul continuous_id)).mul |
| 215 | ((relative_contDiff c).continuous.pow 2)).integrable_of_hasCompactSupport hc.mul_left |
| 216 | |
| 217 | theorem relative_moment (s : ℝ) (c : Coeff) : |
| 218 | (∫ y, Real.exp (s * y) * relative c y) = |
| 219 | moment s * c 0 + Real.exp (2 * s) * moment s * c 1 := by |
| 220 | have hf : (fun y => Real.exp (s * y) * relative c y) = |
| 221 | (fun y => c 0 * (Real.exp (s * y) * bump 0 y) + |
| 222 | c 1 * (Real.exp (s * y) * bump 1 y)) := by |
| 223 | funext y |
| 224 | dsimp [relative] |
| 225 | ring |
| 226 | rw [hf, integral_add ((weighted_bump_integrable s 0).const_mul _) |
| 227 | ((weighted_bump_integrable s 1).const_mul _), integral_const_mul, integral_const_mul, |
| 228 | bump_moment, bump_moment] |
| 229 | norm_num |
| 230 | rw [mul_comm s 2] |
| 231 | ring |
| 232 | |
| 233 | theorem relative_square (c : Coeff) (y : ℝ) : |
| 234 | (relative c y) ^ 2 = (c 0) ^ 2 * (bump 0 y) ^ 2 + (c 1) ^ 2 * (bump 1 y) ^ 2 := by |
| 235 | calc |
| 236 | _ = (c 0) ^ 2 * (bump 0 y) ^ 2 + (c 1) ^ 2 * (bump 1 y) ^ 2 + |
| 237 | 2 * c 0 * c 1 * (bump 0 y * bump 1 y) := by dsimp [relative]; ring |
| 238 | _ = _ := by rw [bumps_disjoint]; ring |
| 239 | |
| 240 | theorem relative_square_moment (lam : ℝ) (c : Coeff) : |
| 241 | (∫ y, Real.exp (pressureSlope lam * y) * (relative c y) ^ 2) = |
| 242 | quadraticMoment lam 0 * (c 0) ^ 2 + quadraticMoment lam 1 * (c 1) ^ 2 := by |
| 243 | have hf : (fun y => Real.exp (pressureSlope lam * y) * (relative c y) ^ 2) = |
| 244 | (fun y => (c 0) ^ 2 * (Real.exp (pressureSlope lam * y) * (bump 0 y) ^ 2) + |
| 245 | (c 1) ^ 2 * (Real.exp (pressureSlope lam * y) * (bump 1 y) ^ 2)) := by |
| 246 | funext y |
| 247 | rw [relative_square] |
| 248 | ring |
| 249 | rw [hf, integral_add ((weighted_bump_sq_integrable _ 0).const_mul _) |
| 250 | ((weighted_bump_sq_integrable _ 1).const_mul _), integral_const_mul, integral_const_mul] |
| 251 | dsimp [quadraticMoment] |
| 252 | ring |
| 253 | |
| 254 | theorem pressure_change_integrable (lam : ℝ) (c : Coeff) : |
| 255 | Integrable (fun y => Real.exp (pressureSlope lam * y) * ((1 + relative c y) ^ 2 - 1)) := by |
| 256 | convert! ((weighted_relative_integrable (pressureSlope lam) c).const_mul 2).add |
| 257 | (weighted_relative_sq_integrable (pressureSlope lam) c) using 1 |
| 258 | ext y |
| 259 | simp only [Pi.add_apply] |
| 260 | ring |
| 261 | |
| 262 | theorem pressure_change_moment (lam : ℝ) (c : Coeff) : |
| 263 | (∫ y, Real.exp (pressureSlope lam * y) * ((1 + relative c y) ^ 2 - 1)) = |
| 264 | 2 * (moment (pressureSlope lam) * c 0 + |
| 265 | Real.exp (2 * pressureSlope lam) * moment (pressureSlope lam) * c 1) + |
| 266 | quadraticMoment lam 0 * (c 0) ^ 2 + quadraticMoment lam 1 * (c 1) ^ 2 := by |
| 267 | have hf : (fun y => Real.exp (pressureSlope lam * y) * ((1 + relative c y) ^ 2 - 1)) = |
| 268 | (fun y => 2 * (Real.exp (pressureSlope lam * y) * relative c y) + |
| 269 | Real.exp (pressureSlope lam * y) * (relative c y) ^ 2) := by funext y; ring |
| 270 | rw [hf, integral_add ((weighted_relative_integrable _ c).const_mul 2) |
| 271 | (weighted_relative_sq_integrable _ c), integral_const_mul, relative_moment, relative_square_moment] |
| 272 | ring |
| 273 | |
| 274 | /-- The quadratic coefficient map equals the two actual integral changes. -/ |
| 275 | theorem moment_map_identity (lam : ℝ) (hlam : 0 < lam) (c : Coeff) : |
| 276 | linearEquiv lam hlam c + quadraticCLM lam c c = |
| 277 | ![∫ y, Real.exp (angularSlope lam * y) * relative c y, |
| 278 | ∫ y, Real.exp (pressureSlope lam * y) * ((1 + relative c y) ^ 2 - 1)] := by |
| 279 | rw [linearEquiv_apply, quadraticCLM_apply, relative_moment, pressure_change_moment] |
| 280 | ext i |
| 281 | fin_cases i <;> simp [linearMatrix, dotProduct, Fin.sum_univ_two] |
| 282 | ring |
| 283 | |
| 284 | def debt (δ : ℝ) : Coeff := ![δ, 0] |
| 285 | |
| 286 | theorem debt_contDiff : ContDiff ℝ ∞ debt := by |
| 287 | apply contDiff_pi.mpr |
| 288 | intro i |
| 289 | fin_cases i |
| 290 | · exact contDiff_id |
| 291 | · exact contDiff_const |
| 292 | |
| 293 | theorem debt_norm_le (δ : ℝ) : ‖debt δ‖ ≤ |δ| := by |
| 294 | apply (pi_norm_le_iff_of_nonneg (abs_nonneg δ)).mpr |
| 295 | intro i |
| 296 | fin_cases i <;> simp [debt] |
| 297 | |
| 298 | /-- A smooth small branch is obtained from the proved actual moment derivative, |
| 299 | not from an assumed solution or matrix rank. -/ |
| 300 | theorem exists_normalized_branch (lam : ℝ) (hlam : 0 < lam) : |
| 301 | ∃ (c : ℝ → Coeff) (ε K : ℝ), 0 < ε ∧ 0 < K ∧ |
| 302 | ContDiffOn ℝ ∞ c (Ioo (-ε) ε) ∧ c 0 = 0 ∧ |
| 303 | ∀ δ ∈ Ioo (-ε) ε, |
| 304 | (∫ y, Real.exp (angularSlope lam * y) * relative (c δ) y) = δ ∧ |
| 305 | (∫ y, Real.exp (pressureSlope lam * y) * ((1 + relative (c δ) y) ^ 2 - 1)) = 0 ∧ |
| 306 | ‖c δ‖ ≤ K * |δ| := by |
| 307 | obtain ⟨c, U, K, hU, h0, hK, hc, hc0, heq⟩ := |
| 308 | SmoothMomentRepair.exists_smooth_parameter_branch (E := Coeff) (P := ℝ) 0 |
| 309 | (fun _ => (linearEquiv lam hlam).toContinuousLinearMap) |
| 310 | (fun _ => quadraticCLM lam) debt contDiff_const contDiff_const debt_contDiff |
| 311 | (linearEquiv lam hlam) rfl (by ext i; fin_cases i <;> simp [debt]) |
| 312 | obtain ⟨ε, hε, hεU⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds h0) |
| 313 | have hsub : Ioo (-ε) ε ⊆ U := by |
| 314 | intro δ hδ |
| 315 | apply hεU |
| 316 | simpa only [Metric.mem_ball, Real.dist_eq, sub_zero, abs_lt, Set.mem_Ioo] using hδ |
| 317 | refine ⟨c, ε, K, hε, hK, hc.mono hsub, hc0, ?_⟩ |
| 318 | intro δ hδ |
| 319 | obtain ⟨he, hb⟩ := heq δ (hsub hδ) |
| 320 | change linearEquiv lam hlam (c δ) + quadraticCLM lam (c δ) (c δ) = debt δ at he |
| 321 | rw [moment_map_identity] at he |
| 322 | refine ⟨?_, ?_, hb.trans (mul_le_mul_of_nonneg_left (debt_norm_le δ) hK.le)⟩ |
| 323 | · exact congrFun he 0 |
| 324 | · exact congrFun he 1 |
| 325 | |
| 326 | theorem relative_deriv (c : Coeff) (y : ℝ) : |
| 327 | deriv (relative c) y = c 0 * deriv (bump 0) y + c 1 * deriv (bump 1) y := by |
| 328 | have h0 := (bump_contDiff 0).differentiable (by simp : (∞ : WithTop ℕ∞) ≠ 0) |
| 329 | have h1 := (bump_contDiff 1).differentiable (by simp : (∞ : WithTop ℕ∞) ≠ 0) |
| 330 | unfold relative |
| 331 | rw [deriv_fun_add (h0.differentiableAt.const_mul _) (h1.differentiableAt.const_mul _), |
| 332 | deriv_const_mul _ h0.differentiableAt, deriv_const_mul _ h1.differentiableAt] |
| 333 | |
| 334 | /-- The fixed finite family controls both the relative perturbation and its first derivative. -/ |
| 335 | theorem relative_first_jet_bound : |
| 336 | ∃ D : ℝ, 0 < D ∧ ∀ (c : Coeff) (y : ℝ), |
| 337 | |relative c y| ≤ D * ‖c‖ ∧ |deriv (relative c) y| ≤ D * ‖c‖ := by |
| 338 | obtain ⟨D0, hD0, hb0⟩ := LocalizedMomentRepair.smooth_compact_derivative_bound |
| 339 | (bump 0) (bump_contDiff 0) (bump_hasCompactSupport 0) 1 |
| 340 | obtain ⟨D1, hD1, hb1⟩ := LocalizedMomentRepair.smooth_compact_derivative_bound |
| 341 | (bump 1) (bump_contDiff 1) (bump_hasCompactSupport 1) 1 |
| 342 | simp only [iteratedDeriv_one] at hb0 hb1 |
| 343 | refine ⟨2 + D0 + D1, by linarith, ?_⟩ |
| 344 | intro c y |
| 345 | have hc0 : |c 0| ≤ ‖c‖ := by simpa only [Real.norm_eq_abs] using norm_le_pi_norm c 0 |
| 346 | have hc1 : |c 1| ≤ ‖c‖ := by simpa only [Real.norm_eq_abs] using norm_le_pi_norm c 1 |
| 347 | have ha0 : |bump 0 y| ≤ 1 := by rw [abs_of_nonneg (bump_nonneg 0 y)]; exact bump_le_one 0 y |
| 348 | have ha1 : |bump 1 y| ≤ 1 := by rw [abs_of_nonneg (bump_nonneg 1 y)]; exact bump_le_one 1 y |
| 349 | constructor |
| 350 | · calc |
| 351 | |relative c y| ≤ |c 0| * |bump 0 y| + |c 1| * |bump 1 y| := by |
| 352 | simpa only [relative, abs_mul] using abs_add_le (c 0 * bump 0 y) (c 1 * bump 1 y) |
| 353 | _ ≤ ‖c‖ * 1 + ‖c‖ * 1 := add_le_add |
| 354 | (mul_le_mul hc0 ha0 (abs_nonneg _) (norm_nonneg _)) |
| 355 | (mul_le_mul hc1 ha1 (abs_nonneg _) (norm_nonneg _)) |
| 356 | _ ≤ (2 + D0 + D1) * ‖c‖ := by nlinarith [norm_nonneg c] |
| 357 | · rw [relative_deriv] |
| 358 | calc |
| 359 | _ ≤ |c 0| * |deriv (bump 0) y| + |c 1| * |deriv (bump 1) y| := by |
| 360 | simpa only [abs_mul] using abs_add_le (c 0 * deriv (bump 0) y) (c 1 * deriv (bump 1) y) |
| 361 | _ ≤ ‖c‖ * D0 + ‖c‖ * D1 := add_le_add |
| 362 | (mul_le_mul hc0 (hb0 y) (abs_nonneg _) (norm_nonneg _)) |
| 363 | (mul_le_mul hc1 (hb1 y) (abs_nonneg _) (norm_nonneg _)) |
| 364 | _ ≤ (2 + D0 + D1) * ‖c‖ := by nlinarith [norm_nonneg c] |
| 365 | |
| 366 | theorem positive_and_slope_of_small (lam : ℝ) (hlam : 0 < lam) (c : Coeff) (y : ℝ) |
| 367 | (h0 : |relative c y| ≤ 1 / 2) (h1 : |deriv (relative c) y| ≤ lam / 4) : |
| 368 | 0 < 1 + relative c y ∧ -lam + deriv (relative c) y / (1 + relative c y) ≤ -lam / 2 := by |
| 369 | have hlo : -(1 / 2 : ℝ) ≤ relative c y := (abs_le.mp h0).1 |
| 370 | have hden : 0 < 1 + relative c y := by linarith |
| 371 | refine ⟨hden, ?_⟩ |
| 372 | have hd : deriv (relative c) y ≤ lam / 4 := (le_abs_self _).trans h1 |
| 373 | have hratio : deriv (relative c) y / (1 + relative c y) ≤ lam / 2 := by |
| 374 | apply (div_le_iff₀ hden).mpr |
| 375 | nlinarith |
| 376 | linarith |
| 377 | |
| 378 | /-- A constructed branch, with exact normalized integrals and quantitative first-jet control. -/ |
| 379 | structure ResetBranch (lam : ℝ) where |
| 380 | coefficients : ℝ → Coeff |
| 381 | radius : ℝ |
| 382 | bound : ℝ |
| 383 | radius_pos : 0 < radius |
| 384 | bound_pos : 0 < bound |
| 385 | smooth : ContDiffOn ℝ ∞ coefficients (Ioo (-radius) radius) |
| 386 | at_zero : coefficients 0 = 0 |
| 387 | angular : ∀ δ ∈ Ioo (-radius) radius, |
| 388 | (∫ y, Real.exp (angularSlope lam * y) * relative (coefficients δ) y) = δ |
| 389 | pressure : ∀ δ ∈ Ioo (-radius) radius, |
| 390 | (∫ y, Real.exp (pressureSlope lam * y) * ((1 + relative (coefficients δ) y) ^ 2 - 1)) = 0 |
| 391 | coefficient_bound : ∀ δ ∈ Ioo (-radius) radius, ‖coefficients δ‖ ≤ bound * |δ| |
| 392 | first_jet_bound : ∀ δ ∈ Ioo (-radius) radius, ∀ y, |
| 393 | |relative (coefficients δ) y| ≤ bound * |δ| ∧ |
| 394 | |deriv (relative (coefficients δ)) y| ≤ bound * |δ| |
| 395 | small_jets : ∀ δ ∈ Ioo (-radius) radius, ∀ y, |
| 396 | |relative (coefficients δ) y| ≤ 1 / 2 ∧ |
| 397 | |deriv (relative (coefficients δ)) y| ≤ lam / 4 |
| 398 | |
| 399 | /-- No branch fields are hypotheses: all of them are constructed from the explicit bumps. -/ |
| 400 | theorem exists_resetBranch (lam : ℝ) (hlam : 0 < lam) : Nonempty (ResetBranch lam) := by |
| 401 | obtain ⟨c, ε0, K, hε0, hK, hc, hc0, heq⟩ := exists_normalized_branch lam hlam |
| 402 | obtain ⟨D, hD, hjet⟩ := relative_first_jet_bound |
| 403 | let b : ℝ := min (1 / 2) (lam / 4) |
| 404 | let ε : ℝ := min ε0 (b / (D * K)) |
| 405 | let L : ℝ := (1 + D) * K |
| 406 | have hb : 0 < b := lt_min (by norm_num) (by positivity) |
| 407 | have hDK : 0 < D * K := mul_pos hD hK |
| 408 | have hε : 0 < ε := lt_min hε0 (div_pos hb hDK) |
| 409 | have hL : 0 < L := mul_pos (by linarith) hK |
| 410 | have hsub : Ioo (-ε) ε ⊆ Ioo (-ε0) ε0 := by |
| 411 | intro δ hδ |
| 412 | have he : ε ≤ ε0 := min_le_left _ _ |
| 413 | constructor <;> linarith [hδ.1, hδ.2] |
| 414 | have htotal : ∀ δ ∈ Ioo (-ε) ε, D * ‖c δ‖ ≤ b := by |
| 415 | intro δ hδ |
| 416 | have hnorm := (heq δ (hsub hδ)).2.2 |
| 417 | have habs : |δ| ≤ ε := (abs_lt.mpr hδ).le |
| 418 | have he : ε ≤ b / (D * K) := min_le_right _ _ |
| 419 | have he' := (le_div_iff₀ hDK).mp he |
| 420 | nlinarith |
| 421 | have hcoeff : ∀ δ ∈ Ioo (-ε) ε, ‖c δ‖ ≤ L * |δ| := by |
| 422 | intro δ hδ |
| 423 | apply ((heq δ (hsub hδ)).2.2).trans |
| 424 | apply mul_le_mul_of_nonneg_right _ (abs_nonneg δ) |
| 425 | dsimp [L] |
| 426 | nlinarith |
| 427 | refine ⟨{ |
| 428 | coefficients := c |
| 429 | radius := ε |
| 430 | bound := L |
| 431 | radius_pos := hε |
| 432 | bound_pos := hL |
| 433 | smooth := hc.mono hsub |
| 434 | at_zero := hc0 |
| 435 | angular := fun δ hδ => (heq δ (hsub hδ)).1 |
| 436 | pressure := fun δ hδ => (heq δ (hsub hδ)).2.1 |
| 437 | coefficient_bound := hcoeff |
| 438 | first_jet_bound := ?_ |
| 439 | small_jets := ?_ }⟩ |
| 440 | · intro δ hδ y |
| 441 | have hn := (heq δ (hsub hδ)).2.2 |
| 442 | have hL' : D * K ≤ L := by dsimp [L]; nlinarith |
| 443 | have hbound : D * ‖c δ‖ ≤ L * |δ| := |
| 444 | (mul_le_mul_of_nonneg_left hn hD.le).trans |
| 445 | (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_right hL' (abs_nonneg δ)) |
| 446 | exact ⟨(hjet (c δ) y).1.trans hbound, (hjet (c δ) y).2.trans hbound⟩ |
| 447 | · intro δ hδ y |
| 448 | exact ⟨((hjet (c δ) y).1.trans (htotal δ hδ)).trans (min_le_left _ _), |
| 449 | ((hjet (c δ) y).2.trans (htotal δ hδ)).trans (min_le_right _ _)⟩ |
| 450 | |
| 451 | /-- One fixed choice of the proved small branch. -/ |
| 452 | def resetBranch (lam : ℝ) (hlam : 0 < lam) : ResetBranch lam := |
| 453 | Classical.choice (exists_resetBranch lam hlam) |
| 454 | |
| 455 | /-! ## Actual modified angular fields -/ |
| 456 | |
| 457 | def baseE (lam e0 y : ℝ) : ℝ := e0 * Real.exp ((-1 / 2 - lam) * y) |
| 458 | |
| 459 | /-- The first bump is centered at `y0`, and the second at `y0 + 2`. -/ |
| 460 | def modifiedE (lam e0 y0 : ℝ) (c : Coeff) (y : ℝ) : ℝ := |
| 461 | baseE lam e0 y * (1 + relative c (y - y0)) |
| 462 | |
| 463 | def radiusX (X0 y : ℝ) : ℝ := X0 * Real.exp y |
| 464 | |
| 465 | def baseH (lam e0 X0 y : ℝ) : ℝ := Real.sqrt (2 * radiusX X0 y) * baseE lam e0 y |
| 466 | |
| 467 | def modifiedH (lam e0 X0 y0 : ℝ) (c : Coeff) (y : ℝ) : ℝ := |
| 468 | Real.sqrt (2 * radiusX X0 y) * modifiedE lam e0 y0 c y |
| 469 | |
| 470 | def angularScale (lam e0 X0 y0 : ℝ) : ℝ := |
| 471 | X0 * Real.sqrt (2 * X0) * e0 * Real.exp (angularSlope lam * y0) |
| 472 | |
| 473 | def logSlope (E : ℝ → ℝ) (y : ℝ) : ℝ := 1 / 2 + deriv E y / E y |
| 474 | |
| 475 | theorem baseE_contDiff (lam e0 : ℝ) : ContDiff ℝ ∞ (baseE lam e0) := |
| 476 | contDiff_const.mul (contDiff_const.mul contDiff_id).exp |
| 477 | |
| 478 | theorem modifiedE_contDiff (lam e0 y0 : ℝ) (c : Coeff) : |
| 479 | ContDiff ℝ ∞ (modifiedE lam e0 y0 c) := |
| 480 | (baseE_contDiff lam e0).mul |
| 481 | (contDiff_const.add ((relative_contDiff c).comp (contDiff_id.sub contDiff_const))) |
| 482 | |
| 483 | theorem baseE_pos (lam e0 y : ℝ) (he0 : 0 < e0) : 0 < baseE lam e0 y := |
| 484 | mul_pos he0 (Real.exp_pos _) |
| 485 | |
| 486 | theorem modifiedE_sub_support (lam e0 y0 : ℝ) (c : Coeff) : |
| 487 | support (modifiedE lam e0 y0 c - baseE lam e0) ⊆ |
| 488 | Icc (y0 - 3 / 20) (y0 + 43 / 20) := by |
| 489 | intro y hy |
| 490 | have hn : relative c (y - y0) ≠ 0 := by |
| 491 | intro hz |
| 492 | exact hy (by simp [modifiedE, hz]) |
| 493 | have hs := relative_support c hn |
| 494 | constructor <;> linarith [hs.1, hs.2] |
| 495 | |
| 496 | theorem modifiedE_sub_hasCompactSupport (lam e0 y0 : ℝ) (c : Coeff) : |
| 497 | HasCompactSupport (modifiedE lam e0 y0 c - baseE lam e0) := |
| 498 | HasCompactSupport.of_support_subset_isCompact isCompact_Icc (modifiedE_sub_support lam e0 y0 c) |
| 499 | |
| 500 | /-- Choosing `y0 = T - 3` places the whole edit strictly inside `(T - 4, T)`. -/ |
| 501 | theorem modifiedE_sub_tsupport (lam e0 y0 : ℝ) (c : Coeff) : |
| 502 | tsupport (modifiedE lam e0 y0 c - baseE lam e0) ⊆ Ioo (y0 - 1) (y0 + 3) := by |
| 503 | apply (closure_minimal (modifiedE_sub_support lam e0 y0 c) isClosed_Icc).trans |
| 504 | intro y hy |
| 505 | constructor <;> linarith [hy.1, hy.2] |
| 506 | |
| 507 | theorem modifiedE_unchanged (lam e0 y0 : ℝ) (c : Coeff) {y : ℝ} |
| 508 | (hy : y ∉ Ioo (y0 - 1) (y0 + 3)) : modifiedE lam e0 y0 c y = baseE lam e0 y := by |
| 509 | by_contra hn |
| 510 | apply hy |
| 511 | apply modifiedE_sub_tsupport lam e0 y0 c |
| 512 | exact subset_closure (show (modifiedE lam e0 y0 c - baseE lam e0) y ≠ 0 from sub_ne_zero.mpr hn) |
| 513 | |
| 514 | theorem baseE_hasDerivAt (lam e0 y : ℝ) : |
| 515 | HasDerivAt (baseE lam e0) (baseE lam e0 y * (-1 / 2 - lam)) y := by |
| 516 | convert! (((hasDerivAt_id y).const_mul (-1 / 2 - lam)).exp).const_mul e0 using 1 |
| 517 | simp [baseE] |
| 518 | ring |
| 519 | |
| 520 | theorem modifiedE_hasDerivAt (lam e0 y0 : ℝ) (c : Coeff) (y : ℝ) : |
| 521 | HasDerivAt (modifiedE lam e0 y0 c) |
| 522 | (baseE lam e0 y * (-1 / 2 - lam) * (1 + relative c (y - y0)) + |
| 523 | baseE lam e0 y * deriv (relative c) (y - y0)) y := by |
| 524 | have hr := (((relative_contDiff c).differentiable (by simp)).differentiableAt.hasDerivAt).comp y |
| 525 | ((hasDerivAt_id y).sub_const y0) |
| 526 | convert! (baseE_hasDerivAt lam e0 y).mul (hr.const_add 1) using 1 |
| 527 | simp |
| 528 | |
| 529 | theorem modifiedE_logSlope (lam e0 y0 : ℝ) (c : Coeff) (y : ℝ) (he0 : e0 ≠ 0) |
| 530 | (hpos : 1 + relative c (y - y0) ≠ 0) : |
| 531 | logSlope (modifiedE lam e0 y0 c) y = |
| 532 | -lam + deriv (relative c) (y - y0) / (1 + relative c (y - y0)) := by |
| 533 | have hb : baseE lam e0 y ≠ 0 := mul_ne_zero he0 (Real.exp_ne_zero _) |
| 534 | unfold logSlope |
| 535 | rw [(modifiedE_hasDerivAt lam e0 y0 c y).deriv] |
| 536 | change 1 / 2 + |
| 537 | (baseE lam e0 y * (-1 / 2 - lam) * (1 + relative c (y - y0)) + |
| 538 | baseE lam e0 y * deriv (relative c) (y - y0)) / |
| 539 | (baseE lam e0 y * (1 + relative c (y - y0))) = _ |
| 540 | field_simp ; ring |
| 541 | |
| 542 | theorem weighted_translate_integral (s y0 : ℝ) (f : ℝ → ℝ) : |
| 543 | (∫ y, Real.exp (s * y) * f (y - y0)) = |
| 544 | Real.exp (s * y0) * ∫ y, Real.exp (s * y) * f y := by |
| 545 | rw [← integral_add_right_eq_self (fun y => Real.exp (s * y) * f (y - y0)) y0] |
| 546 | have hf : (fun y => Real.exp (s * (y + y0)) * f (y + y0 - y0)) = |
| 547 | (fun y => Real.exp (s * y0) * (Real.exp (s * y) * f y)) := by |
| 548 | funext y |
| 549 | simp only [add_sub_cancel_right, mul_add, Real.exp_add] |
| 550 | ring |
| 551 | rw [hf, integral_const_mul] |
| 552 | |
| 553 | theorem baseE_square (lam e0 y : ℝ) : |
| 554 | (baseE lam e0 y) ^ 2 = e0 ^ 2 * Real.exp (pressureSlope lam * y) := by |
| 555 | unfold baseE |
| 556 | rw [mul_pow, pow_two (Real.exp _), ← Real.exp_add] |
| 557 | congr 2 |
| 558 | unfold pressureSlope |
| 559 | ring |
| 560 | |
| 561 | theorem pressure_integral_formula (lam e0 y0 : ℝ) (c : Coeff) : |
| 562 | (∫ y, (modifiedE lam e0 y0 c y) ^ 2 - (baseE lam e0 y) ^ 2) = |
| 563 | e0 ^ 2 * Real.exp (pressureSlope lam * y0) * |
| 564 | ∫ y, Real.exp (pressureSlope lam * y) * ((1 + relative c y) ^ 2 - 1) := by |
| 565 | have hf : (fun y => (modifiedE lam e0 y0 c y) ^ 2 - (baseE lam e0 y) ^ 2) = |
| 566 | (fun y => e0 ^ 2 * (Real.exp (pressureSlope lam * y) * ((1 + relative c (y - y0)) ^ 2 - 1))) := by |
| 567 | funext y |
| 568 | calc |
| 569 | _ = (baseE lam e0 y) ^ 2 * ((1 + relative c (y - y0)) ^ 2 - 1) := by |
| 570 | unfold modifiedE |
| 571 | ring |
| 572 | _ = _ := by rw [baseE_square]; ring |
| 573 | rw [hf, integral_const_mul, |
| 574 | weighted_translate_integral (pressureSlope lam) y0 (fun y => (1 + relative c y) ^ 2 - 1)] |
| 575 | ring |
| 576 | |
| 577 | theorem sqrt_exp_half (y : ℝ) : Real.sqrt (Real.exp y) = Real.exp (y / 2) := by |
| 578 | apply (Real.sqrt_eq_iff_mul_self_eq_of_pos (Real.exp_pos _)).mpr |
| 579 | rw [← Real.exp_add] |
| 580 | congr 1 |
| 581 | ring |
| 582 | |
| 583 | theorem angular_weight_formula (lam e0 X0 y : ℝ) (hX : 0 ≤ X0) : |
| 584 | radiusX X0 y * baseH lam e0 X0 y = |
| 585 | X0 * Real.sqrt (2 * X0) * e0 * Real.exp (angularSlope lam * y) := by |
| 586 | have hs : Real.sqrt (2 * radiusX X0 y) = Real.sqrt (2 * X0) * Real.exp (y / 2) := by |
| 587 | unfold radiusX |
| 588 | rw [← mul_assoc, Real.sqrt_mul (by positivity), sqrt_exp_half] |
| 589 | unfold baseH |
| 590 | rw [hs] |
| 591 | unfold radiusX baseE |
| 592 | calc |
| 593 | _ = X0 * Real.sqrt (2 * X0) * e0 * |
| 594 | (Real.exp y * Real.exp (y / 2) * Real.exp ((-1 / 2 - lam) * y)) := by ring |
| 595 | _ = _ := by |
| 596 | rw [← Real.exp_add, ← Real.exp_add] |
| 597 | congr 2 |
| 598 | unfold angularSlope |
| 599 | ring |
| 600 | |
| 601 | theorem angular_integral_formula (lam e0 X0 y0 : ℝ) (c : Coeff) (hX : 0 ≤ X0) : |
| 602 | (∫ y, radiusX X0 y * (modifiedH lam e0 X0 y0 c y - baseH lam e0 X0 y)) = |
| 603 | angularScale lam e0 X0 y0 * ∫ y, Real.exp (angularSlope lam * y) * relative c y := by |
| 604 | have hf : (fun y => radiusX X0 y * (modifiedH lam e0 X0 y0 c y - baseH lam e0 X0 y)) = |
| 605 | (fun y => (X0 * Real.sqrt (2 * X0) * e0) * |
| 606 | (Real.exp (angularSlope lam * y) * relative c (y - y0))) := by |
| 607 | funext y |
| 608 | calc |
| 609 | _ = (radiusX X0 y * baseH lam e0 X0 y) * relative c (y - y0) := by |
| 610 | unfold modifiedH modifiedE baseH |
| 611 | ring |
| 612 | _ = _ := by rw [angular_weight_formula lam e0 X0 y hX]; ring |
| 613 | rw [hf, integral_const_mul, weighted_translate_integral] |
| 614 | unfold angularScale |
| 615 | ring |
| 616 | |
| 617 | theorem angularScale_pos (lam e0 X0 y0 : ℝ) (he0 : 0 < e0) (hX : 0 < X0) : |
| 618 | 0 < angularScale lam e0 X0 y0 := by |
| 619 | unfold angularScale |
| 620 | exact mul_pos (mul_pos (mul_pos hX (Real.sqrt_pos.mpr (by positivity))) he0) (Real.exp_pos _) |
| 621 | |
| 622 | /-- The pressure change is an integrable compactly supported difference. We do |
| 623 | not subtract divergent integrals of the pure exponential background over `ℝ`. -/ |
| 624 | theorem pressure_delta_integrable (lam e0 y0 : ℝ) (c : Coeff) : |
| 625 | Integrable (fun y => (modifiedE lam e0 y0 c y) ^ 2 - (baseE lam e0 y) ^ 2) := by |
| 626 | have hf : (fun y => (modifiedE lam e0 y0 c y) ^ 2 - (baseE lam e0 y) ^ 2) = |
| 627 | (fun y => (modifiedE lam e0 y0 c y + baseE lam e0 y) * |
| 628 | (modifiedE lam e0 y0 c y - baseE lam e0 y)) := by funext y; ring |
| 629 | rw [hf] |
| 630 | exact (((modifiedE_contDiff lam e0 y0 c).continuous.add (baseE_contDiff lam e0).continuous).mul |
| 631 | ((modifiedE_contDiff lam e0 y0 c).continuous.sub (baseE_contDiff lam e0).continuous)).integrable_of_hasCompactSupport |
| 632 | (modifiedE_sub_hasCompactSupport lam e0 y0 c).mul_left |
| 633 | |
| 634 | theorem angular_delta_integrable (lam e0 X0 y0 : ℝ) (c : Coeff) : |
| 635 | Integrable (fun y => radiusX X0 y * (modifiedH lam e0 X0 y0 c y - baseH lam e0 X0 y)) := by |
| 636 | have hf : (fun y => radiusX X0 y * (modifiedH lam e0 X0 y0 c y - baseH lam e0 X0 y)) = |
| 637 | (fun y => (radiusX X0 y * Real.sqrt (2 * radiusX X0 y)) * |
| 638 | (modifiedE lam e0 y0 c y - baseE lam e0 y)) := by |
| 639 | funext y |
| 640 | unfold modifiedH baseH |
| 641 | ring |
| 642 | rw [hf] |
| 643 | have hX : Continuous (radiusX X0) := continuous_const.mul Real.continuous_exp |
| 644 | have hw : Continuous (fun y => radiusX X0 y * Real.sqrt (2 * radiusX X0 y)) := |
| 645 | hX.mul (Real.continuous_sqrt.comp (continuous_const.mul hX)) |
| 646 | exact (hw.mul ((modifiedE_contDiff lam e0 y0 c).continuous.sub |
| 647 | (baseE_contDiff lam e0).continuous)).integrable_of_hasCompactSupport |
| 648 | (modifiedE_sub_hasCompactSupport lam e0 y0 c).mul_left |
| 649 | |
| 650 | theorem modifiedH_unchanged (lam e0 X0 y0 : ℝ) (c : Coeff) {y : ℝ} |
| 651 | (hy : y ∉ Ioo (y0 - 1) (y0 + 3)) : |
| 652 | modifiedH lam e0 X0 y0 c y = baseH lam e0 X0 y := by |
| 653 | unfold modifiedH baseH |
| 654 | rw [modifiedE_unchanged lam e0 y0 c hy] |
| 655 | |
| 656 | namespace ResetBranch |
| 657 | |
| 658 | variable {lam : ℝ} (B : ResetBranch lam) |
| 659 | |
| 660 | theorem pressure_neutral (e0 y0 δ : ℝ) (hδ : δ ∈ Ioo (-B.radius) B.radius) : |
| 661 | (∫ y, (modifiedE lam e0 y0 (B.coefficients δ) y) ^ 2 - (baseE lam e0 y) ^ 2) = 0 := by |
| 662 | rw [pressure_integral_formula, B.pressure δ hδ, mul_zero] |
| 663 | |
| 664 | theorem angular_change (e0 X0 y0 δ : ℝ) (hX : 0 ≤ X0) |
| 665 | (hδ : δ ∈ Ioo (-B.radius) B.radius) : |
| 666 | (∫ y, radiusX X0 y * |
| 667 | (modifiedH lam e0 X0 y0 (B.coefficients δ) y - baseH lam e0 X0 y)) = |
| 668 | angularScale lam e0 X0 y0 * δ := by |
| 669 | rw [angular_integral_formula lam e0 X0 y0 (B.coefficients δ) hX, B.angular δ hδ] |
| 670 | |
| 671 | theorem positive (hlam : 0 < lam) (e0 y0 δ y : ℝ) (he0 : 0 < e0) |
| 672 | (hδ : δ ∈ Ioo (-B.radius) B.radius) : |
| 673 | 0 < modifiedE lam e0 y0 (B.coefficients δ) y := by |
| 674 | apply mul_pos (baseE_pos lam e0 y he0) |
| 675 | exact (positive_and_slope_of_small lam hlam (B.coefficients δ) (y - y0) |
| 676 | (B.small_jets δ hδ (y - y0)).1 (B.small_jets δ hδ (y - y0)).2).1 |
| 677 | |
| 678 | theorem logSlope_le (hlam : 0 < lam) (e0 y0 δ y : ℝ) (he0 : 0 < e0) |
| 679 | (hδ : δ ∈ Ioo (-B.radius) B.radius) : |
| 680 | logSlope (modifiedE lam e0 y0 (B.coefficients δ)) y ≤ -lam / 2 := by |
| 681 | have hp := positive_and_slope_of_small lam hlam (B.coefficients δ) (y - y0) |
| 682 | (B.small_jets δ hδ (y - y0)).1 (B.small_jets δ hδ (y - y0)).2 |
| 683 | rw [modifiedE_logSlope lam e0 y0 (B.coefficients δ) y he0.ne' hp.1.ne'] |
| 684 | exact hp.2 |
| 685 | |
| 686 | /-- Any desired angular endpoint moment is reached when its normalized debt |
| 687 | lies in the constructed common small interval. -/ |
| 688 | theorem exact_target (e0 X0 y0 Iold Itarget : ℝ) (he0 : 0 < e0) (hX : 0 < X0) |
| 689 | (hδ : (Itarget - Iold) / angularScale lam e0 X0 y0 ∈ Ioo (-B.radius) B.radius) : |
| 690 | Iold + (∫ y, radiusX X0 y * |
| 691 | (modifiedH lam e0 X0 y0 |
| 692 | (B.coefficients ((Itarget - Iold) / angularScale lam e0 X0 y0)) y - |
| 693 | baseH lam e0 X0 y)) = Itarget := by |
| 694 | rw [B.angular_change e0 X0 y0 _ hX.le hδ] |
| 695 | have hs := (angularScale_pos lam e0 X0 y0 he0 hX).ne' |
| 696 | field_simp |
| 697 | ring |
| 698 | |
| 699 | end ResetBranch |
| 700 | |
| 701 | /-! ## Finite-interval moments, including an arbitrary earlier prefix -/ |
| 702 | |
| 703 | theorem radiusX_continuous (X0 : ℝ) : Continuous (radiusX X0) := |
| 704 | continuous_const.mul Real.continuous_exp |
| 705 | |
| 706 | theorem baseH_continuous (lam e0 X0 : ℝ) : Continuous (baseH lam e0 X0) := |
| 707 | (Real.continuous_sqrt.comp (continuous_const.mul (radiusX_continuous X0))).mul |
| 708 | (baseE_contDiff lam e0).continuous |
| 709 | |
| 710 | theorem modifiedH_continuous (lam e0 X0 y0 : ℝ) (c : Coeff) : |
| 711 | Continuous (modifiedH lam e0 X0 y0 c) := |
| 712 | (Real.continuous_sqrt.comp (continuous_const.mul (radiusX_continuous X0))).mul |
| 713 | (modifiedE_contDiff lam e0 y0 c).continuous |
| 714 | |
| 715 | theorem outside_window {a b y0 y : ℝ} (ha : a ≤ y0 - 1) (hb : y0 + 3 ≤ b) |
| 716 | (hy : y ∉ Icc a b) : y ∉ Ioo (y0 - 1) (y0 + 3) := by |
| 717 | intro h |
| 718 | exact hy ⟨ha.trans h.1.le, h.2.le.trans hb⟩ |
| 719 | |
| 720 | theorem angular_interval_change (lam e0 X0 y0 a b : ℝ) (c : Coeff) |
| 721 | (hX : 0 ≤ X0) (ha : a ≤ y0 - 1) (hb : y0 + 3 ≤ b) : |
| 722 | (∫ y in Icc a b, radiusX X0 y * modifiedH lam e0 X0 y0 c y) - |
| 723 | (∫ y in Icc a b, radiusX X0 y * baseH lam e0 X0 y) = |
| 724 | angularScale lam e0 X0 y0 * ∫ y, Real.exp (angularSlope lam * y) * relative c y := by |
| 725 | have hm : IntegrableOn (fun y => radiusX X0 y * modifiedH lam e0 X0 y0 c y) (Icc a b) := |
| 726 | ((radiusX_continuous X0).mul (modifiedH_continuous lam e0 X0 y0 c)).continuousOn.integrableOn_Icc |
| 727 | have he : IntegrableOn (fun y => radiusX X0 y * baseH lam e0 X0 y) (Icc a b) := |
| 728 | ((radiusX_continuous X0).mul (baseH_continuous lam e0 X0)).continuousOn.integrableOn_Icc |
| 729 | rw [← integral_sub hm he] |
| 730 | have hi : (fun y => radiusX X0 y * modifiedH lam e0 X0 y0 c y - |
| 731 | radiusX X0 y * baseH lam e0 X0 y) = |
| 732 | (fun y => radiusX X0 y * (modifiedH lam e0 X0 y0 c y - baseH lam e0 X0 y)) := by |
| 733 | funext y |
| 734 | ring |
| 735 | rw [hi, setIntegral_eq_integral_of_forall_compl_eq_zero] |
| 736 | · exact angular_integral_formula lam e0 X0 y0 c hX |
| 737 | · intro y hy |
| 738 | rw [modifiedH_unchanged lam e0 X0 y0 c (outside_window ha hb hy), sub_self, mul_zero] |
| 739 | |
| 740 | theorem pressure_interval_change (lam e0 y0 a b : ℝ) (c : Coeff) |
| 741 | (ha : a ≤ y0 - 1) (hb : y0 + 3 ≤ b) : |
| 742 | (∫ y in Icc a b, (modifiedE lam e0 y0 c y) ^ 2) - |
| 743 | (∫ y in Icc a b, (baseE lam e0 y) ^ 2) = |
| 744 | e0 ^ 2 * Real.exp (pressureSlope lam * y0) * |
| 745 | ∫ y, Real.exp (pressureSlope lam * y) * ((1 + relative c y) ^ 2 - 1) := by |
| 746 | have hm : IntegrableOn (fun y => (modifiedE lam e0 y0 c y) ^ 2) (Icc a b) := |
| 747 | ((modifiedE_contDiff lam e0 y0 c).continuous.pow 2).continuousOn.integrableOn_Icc |
| 748 | have he : IntegrableOn (fun y => (baseE lam e0 y) ^ 2) (Icc a b) := |
| 749 | ((baseE_contDiff lam e0).continuous.pow 2).continuousOn.integrableOn_Icc |
| 750 | rw [← integral_sub hm he, setIntegral_eq_integral_of_forall_compl_eq_zero] |
| 751 | · exact pressure_integral_formula lam e0 y0 c |
| 752 | · intro y hy |
| 753 | rw [modifiedE_unchanged lam e0 y0 c (outside_window ha hb hy), sub_self] |
| 754 | |
| 755 | theorem ResetBranch.pressure_interval_neutral {lam : ℝ} (B : ResetBranch lam) |
| 756 | (e0 y0 a b δ : ℝ) (ha : a ≤ y0 - 1) (hb : y0 + 3 ≤ b) |
| 757 | (hδ : δ ∈ Ioo (-B.radius) B.radius) : |
| 758 | (∫ y in Icc a b, (modifiedE lam e0 y0 (B.coefficients δ) y) ^ 2) = |
| 759 | ∫ y in Icc a b, (baseE lam e0 y) ^ 2 := by |
| 760 | apply sub_eq_zero.mp |
| 761 | rw [pressure_interval_change lam e0 y0 a b (B.coefficients δ) ha hb, B.pressure δ hδ, mul_zero] |
| 762 | |
| 763 | def prefixI (lam e0 X0 a b Iprior : ℝ) : ℝ := |
| 764 | Iprior + ∫ y in Icc a b, radiusX X0 y * baseH lam e0 X0 y |
| 765 | |
| 766 | theorem ResetBranch.exact_endpoint_moment {lam : ℝ} (B : ResetBranch lam) |
| 767 | (e0 X0 y0 a b Iprior Itarget : ℝ) (he0 : 0 < e0) (hX : 0 < X0) |
| 768 | (ha : a ≤ y0 - 1) (hb : y0 + 3 ≤ b) |
| 769 | (hδ : (Itarget - prefixI lam e0 X0 a b Iprior) / angularScale lam e0 X0 y0 ∈ |
| 770 | Ioo (-B.radius) B.radius) : |
| 771 | Iprior + (∫ y in Icc a b, radiusX X0 y * modifiedH lam e0 X0 y0 |
| 772 | (B.coefficients ((Itarget - prefixI lam e0 X0 a b Iprior) / angularScale lam e0 X0 y0)) y) = |
| 773 | Itarget := by |
| 774 | let δ := (Itarget - prefixI lam e0 X0 a b Iprior) / angularScale lam e0 X0 y0 |
| 775 | have hi := angular_interval_change lam e0 X0 y0 a b (B.coefficients δ) hX.le ha hb |
| 776 | rw [B.angular δ hδ] at hi |
| 777 | have hs : angularScale lam e0 X0 y0 ≠ 0 := (angularScale_pos lam e0 X0 y0 he0 hX).ne' |
| 778 | have hd : angularScale lam e0 X0 y0 * δ = Itarget - prefixI lam e0 X0 a b Iprior := by |
| 779 | dsimp [δ] |
| 780 | field_simp |
| 781 | rw [hd] at hi |
| 782 | dsimp [prefixI] at hi |
| 783 | linarith |
| 784 | |
| 785 | /-! ## Smooth dependence on the angular parameter -/ |
| 786 | |
| 787 | theorem relative_joint_contDiff : |
| 788 | ContDiff ℝ ∞ (fun z : Coeff × ℝ => relative z.1 z.2) := by |
| 789 | have h0 : ContDiff ℝ ∞ (fun z : Coeff × ℝ => z.1 0) := |
| 790 | contDiff_pi.mp (contDiff_fst : ContDiff ℝ ∞ (Prod.fst : Coeff × ℝ → Coeff)) 0 |
| 791 | have h1 : ContDiff ℝ ∞ (fun z : Coeff × ℝ => z.1 1) := |
| 792 | contDiff_pi.mp (contDiff_fst : ContDiff ℝ ∞ (Prod.fst : Coeff × ℝ → Coeff)) 1 |
| 793 | exact (h0.mul ((bump_contDiff 0).comp contDiff_snd)).add |
| 794 | (h1.mul ((bump_contDiff 1).comp contDiff_snd)) |
| 795 | |
| 796 | theorem ResetBranch.joint_contDiffOn {lam : ℝ} (B : ResetBranch lam) |
| 797 | (e0 y0 : ℝ) {P : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 798 | {S : Set P} {δ : P → ℝ} (hδ : ContDiffOn ℝ ∞ δ S) |
| 799 | (hsmall : ∀ p ∈ S, δ p ∈ Ioo (-B.radius) B.radius) : |
| 800 | ContDiffOn ℝ ∞ (fun z : P × ℝ => modifiedE lam e0 y0 (B.coefficients (δ z.1)) z.2) |
| 801 | (S ×ˢ univ) := by |
| 802 | have hc : ContDiffOn ℝ ∞ (fun p => B.coefficients (δ p)) S := |
| 803 | B.smooth.comp hδ hsmall |
| 804 | have hcz : ContDiffOn ℝ ∞ (fun z : P × ℝ => B.coefficients (δ z.1)) (S ×ˢ univ) := |
| 805 | hc.comp contDiffOn_fst (fun _ hz => hz.1) |
| 806 | have hs : ContDiffOn ℝ ∞ (fun z : P × ℝ => z.2 - y0) (S ×ˢ univ) := |
| 807 | contDiffOn_snd.sub contDiffOn_const |
| 808 | have hr : ContDiffOn ℝ ∞ (fun z : P × ℝ => relative (B.coefficients (δ z.1)) (z.2 - y0)) |
| 809 | (S ×ˢ univ) := |
| 810 | relative_joint_contDiff.contDiffOn.comp (hcz.prodMk hs) (mapsTo_univ _ _) |
| 811 | exact ((baseE_contDiff lam e0).comp contDiff_snd).contDiffOn.mul (contDiffOn_const.add hr) |
| 812 | |
| 813 | end NavierStokes.AngularMomentReset |