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.MatchingDebtBounds |
| 2 | import NavierStokes.OutgoingEntranceCone |
| 3 | |
| 4 | /-! |
| 5 | # Cone bounds through the shape transition and moment repair |
| 6 | |
| 7 | The source estimates use the actual fields and their radial averages. The |
| 8 | large natural logarithmic gradient is retained in the growing term rather |
| 9 | than estimated by an absolute constant. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | open Set Filter Function MeasureTheory |
| 15 | open scoped Topology ContDiff BigOperators |
| 16 | |
| 17 | namespace NavierStokes.MatchingConeBounds |
| 18 | |
| 19 | open ProfileHistories NaturalAxisData |
| 20 | |
| 21 | |
| 22 | theorem logShape_hasDerivAt (eta : ℝ) : |
| 23 | HasDerivAt ShapeTransition.logShape (-OutgoingEntranceCone.shapeGradient eta) eta := by |
| 24 | have he : ShapeTransition.logShape = fun e : ℝ => -Real.log (1 + e ^ 2) := by |
| 25 | funext e |
| 26 | simp [ShapeTransition.logShape, OutgoingSchedule.shape, Real.log_inv] |
| 27 | rw [he] |
| 28 | convert! ((((hasDerivAt_id eta).fun_pow 2).const_add 1).log (by positivity)).fun_neg using 1 |
| 29 | simp [OutgoingEntranceCone.shapeGradient, id_eq] |
| 30 | |
| 31 | theorem shape_axis_lower {h j eta ell theta : ℝ} |
| 32 | (hs : SmallParameters h j) (hη : eta ∈ Icc (-1 : ℝ) 1) |
| 33 | (hl : 11 / 20 ≤ ell) (ht : theta ∈ Icc (0 : ℝ) 1) : |
| 34 | (8 / 5 : ℝ) < -W h j eta * ell - h * (1 - 2 * eta * U j eta) + |
| 35 | theta * H h j eta * OutgoingEntranceCone.shapeGradient eta := by |
| 36 | have heta : |eta| ≤ 1 := abs_le.mpr hη |
| 37 | have hd0 := d_nonneg hη |
| 38 | have hd1 : d eta ≤ 1 := by unfold d; nlinarith [sq_nonneg eta] |
| 39 | have hD := D_pos hs |
| 40 | have hu : |U j eta| ≤ 4001 / 1000 := by |
| 41 | calc |
| 42 | _ ≤ |4 * eta| + |j| := abs_add_le _ _ |
| 43 | _ = 4 * |eta| + j := by rw [abs_mul, abs_of_pos hs.j_pos]; norm_num |
| 44 | _ ≤ _ := by linarith [hs.j_le] |
| 45 | have hup : |eta * U j eta| ≤ 4001 / 1000 := by |
| 46 | rw [abs_mul] |
| 47 | exact (mul_le_mul heta hu (abs_nonneg _) (by norm_num)).trans_eq (by ring) |
| 48 | have hterm : h * (1 - 2 * eta * U j eta) ≤ 4501 / 500000 := by |
| 49 | have he : 1 - 2 * eta * U j eta ≤ 4501 / 500 := by |
| 50 | linarith [(abs_le.mp hup).1] |
| 51 | have h1 := mul_le_mul_of_nonneg_left he hs.h_pos.le |
| 52 | have h2 := mul_le_mul_of_nonneg_right hs.h_le (by norm_num : (0 : ℝ) ≤ 4501 / 500) |
| 53 | linarith |
| 54 | have hgabs : |OutgoingEntranceCone.shapeGradient eta| ≤ 2 := |
| 55 | (OutgoingEntranceCone.abs_shapeGradient_le eta).trans (by linarith) |
| 56 | have hget : 0 ≤ eta * OutgoingEntranceCone.shapeGradient eta := |
| 57 | (sq_nonneg eta).trans (OutgoingEntranceCone.eta_shapeGradient_bounds heta).1 |
| 58 | have hmain : 0 ≤ (D h + 4 * d eta) * (eta * OutgoingEntranceCone.shapeGradient eta) := |
| 59 | mul_nonneg (by positivity) hget |
| 60 | have hdj : 0 ≤ d eta * j := mul_nonneg hd0 hs.j_pos.le |
| 61 | have hdj1 : d eta * j ≤ 1 / 1000 := |
| 62 | (mul_le_of_le_one_left hs.j_pos.le hd1).trans hs.j_le |
| 63 | have herr : -(1 / 500 : ℝ) ≤ d eta * j * OutgoingEntranceCone.shapeGradient eta := by |
| 64 | have hm := mul_le_mul_of_nonneg_left (abs_le.mp hgabs).1 hdj |
| 65 | nlinarith |
| 66 | have hid : H h j eta * OutgoingEntranceCone.shapeGradient eta = |
| 67 | (D h + 4 * d eta) * (eta * OutgoingEntranceCone.shapeGradient eta) + |
| 68 | d eta * j * OutgoingEntranceCone.shapeGradient eta := by |
| 69 | unfold H U |
| 70 | ring |
| 71 | have hH : -(1 / 500 : ℝ) ≤ H h j eta * OutgoingEntranceCone.shapeGradient eta := by |
| 72 | rw [hid] |
| 73 | linarith |
| 74 | have htheta : -(1 / 500 : ℝ) ≤ theta * H h j eta * OutgoingEntranceCone.shapeGradient eta := by |
| 75 | have hm := mul_le_mul_of_nonneg_left hH ht.1 |
| 76 | nlinarith [ht.2] |
| 77 | have hW := neg_W_lower_bound hs hη |
| 78 | have hbase : (2991 / 1000 : ℝ) * (11 / 20) ≤ -W h j eta * ell := |
| 79 | mul_le_mul hW hl (by norm_num) (by linarith) |
| 80 | linarith |
| 81 | |
| 82 | noncomputable def shapeRemainder (h j sigma eta theta ell : ℝ) (v : Fin 5 → ℝ) (t : ℝ) : ℝ := |
| 83 | let Wc := W h j eta - t * (2 * D h * eta * v 2 + d eta * v 3) |
| 84 | let Uc := U j eta + t * v 1 |
| 85 | let Hc := H h j eta + t * d eta * v 1 |
| 86 | show ℝ from -Wc * ell - h * (1 - 2 * eta * Uc) + theta * Hc * OutgoingEntranceCone.shapeGradient eta - |
| 87 | (1 - theta) * (Hc * v 4 + d eta * v 1 * NaturalAxisCoefficients.realGradient h j sigma eta) |
| 88 | |
| 89 | abbrev ShapeParameter (B : ℝ) := |
| 90 | Icc (-1 : ℝ) 1 × (Icc (0 : ℝ) 1 × (Icc (11 / 20 : ℝ) (13 / 20) × ReferenceBounds.BoundedJets B)) |
| 91 | |
| 92 | noncomputable def shapeModel (h j sigma B : ℝ) (p : ShapeParameter B) (t : ℝ) : ℝ := |
| 93 | shapeRemainder h j sigma p.1.val p.2.1.val p.2.2.1.val p.2.2.2.val t |
| 94 | |
| 95 | theorem shapeModel_continuous (h j B : ℝ) {sigma : ℝ} (hsigma : 0 < sigma) : |
| 96 | Continuous (fun p : ShapeParameter B × ℝ => shapeModel h j sigma B p.1 p.2) := by |
| 97 | have hg := NaturalEntrance.realGradient_continuous h j hsigma |
| 98 | have hs := OutgoingEntranceCone.shapeGradient_contDiff.continuous |
| 99 | have he : Continuous (fun p : ShapeParameter B × ℝ => p.1.1.val) := by fun_prop |
| 100 | have hv (i : Fin 5) : Continuous (fun p : ShapeParameter B × ℝ => p.1.2.2.2.val i) := |
| 101 | (continuous_apply i).comp (by fun_prop) |
| 102 | have hgc := hg.comp he |
| 103 | have hsc := hs.comp he |
| 104 | dsimp only [shapeModel, shapeRemainder, W, H, U, D, d] |
| 105 | fun_prop |
| 106 | |
| 107 | theorem shapeModel_zero_lower {h j sigma B : ℝ} (hs : SmallParameters h j) |
| 108 | (hsigma : 0 < sigma) (p : ShapeParameter B) |
| 109 | (hz : (1 - p.2.1.val) * L h p.1.val * chi h j sigma p.1.val = 0) : |
| 110 | (3 / 2 : ℝ) < shapeModel h j sigma B p 0 := by |
| 111 | have ha := shape_axis_lower hs p.1.property p.2.2.1.property.1 p.2.1.property |
| 112 | have hcases : p.2.1.val = 1 ∨ chi h j sigma p.1.val = 0 := by |
| 113 | rcases mul_eq_zero.mp hz with hleft | hright |
| 114 | · have ht := (mul_eq_zero.mp hleft).resolve_right (L_pos hs p.1.property).ne' |
| 115 | left |
| 116 | linarith |
| 117 | · exact Or.inr hright |
| 118 | rcases hcases with ht | hc |
| 119 | · simp only [shapeModel, shapeRemainder, ht, zero_mul, sub_zero, add_zero, |
| 120 | sub_self, one_mul] at ha ⊢ |
| 121 | linarith |
| 122 | · have hH := NaturalEntrance.chi_zero_imp_H_zero h j hsigma hc |
| 123 | have hg := NaturalEntrance.gradient_zero_of_chi_zero h j hsigma hc |
| 124 | simp only [shapeModel, shapeRemainder, zero_mul, mul_zero, sub_zero, add_zero, hH, hg] |
| 125 | rw [hH] at ha |
| 126 | simp only [mul_zero, zero_mul, add_zero] at ha |
| 127 | linarith |
| 128 | |
| 129 | theorem shapeModel_uniform_lower {h j sigma : ℝ} (hs : SmallParameters h j) |
| 130 | (hsigma : 0 < sigma) (B : ℝ) : |
| 131 | ∃ M : ℝ, 0 < M ∧ ∀ Λ : ℝ, M ≤ Λ → ∀ p : ShapeParameter B, |
| 132 | (5 / 4 : ℝ) < Λ * ((1 - p.2.1.val) * L h p.1.val * chi h j sigma p.1.val) + |
| 133 | shapeModel h j sigma B p (1 / Λ) := by |
| 134 | have hcoef : Continuous (fun p : ShapeParameter B => |
| 135 | (1 - p.2.1.val) * L h p.1.val * chi h j sigma p.1.val) := by |
| 136 | have hc := NaturalEntrance.chi_continuous h j hsigma |
| 137 | unfold L |
| 138 | fun_prop |
| 139 | have hbase : Continuous (fun p : ShapeParameter B => shapeModel h j sigma B p 0) := by |
| 140 | simpa only [Function.comp_def, id_eq] using (shapeModel_continuous h j B hsigma).comp |
| 141 | (continuous_id.prodMk (continuous_const (y := (0 : ℝ)))) |
| 142 | obtain ⟨M0, hM0, hmain⟩ := NaturalEntrance.compact_absorption _ _ hcoef hbase |
| 143 | (fun p => mul_nonneg (mul_nonneg (sub_nonneg.mpr p.2.1.property.2) |
| 144 | (L_pos hs p.1.property).le) (NaturalAxisData.chi_bounds h j hsigma p.1.val).1) |
| 145 | (3 / 2 : ℝ) (shapeModel_zero_lower hs hsigma) |
| 146 | obtain ⟨tau, htau, hpert⟩ := NaturalEntrance.compact_small_perturbation _ |
| 147 | (shapeModel_continuous h j B hsigma) (by norm_num : (0 : ℝ) < 1 / 4) |
| 148 | refine ⟨max M0 (1 + 1 / tau), hM0.trans_le (le_max_left _ _), ?_⟩ |
| 149 | intro Λ hΛ p |
| 150 | have hΛp : 0 < Λ := hM0.trans_le ((le_max_left _ _).trans hΛ) |
| 151 | have ht : ‖(1 / Λ : ℝ)‖ < tau := by |
| 152 | rw [Real.norm_eq_abs, abs_of_pos (one_div_pos.mpr hΛp), div_lt_iff₀ hΛp] |
| 153 | have hm := (div_lt_iff₀ htau).mp (show 1 / tau < Λ by |
| 154 | have := (le_max_right M0 (1 + 1 / tau)).trans hΛ |
| 155 | linarith) |
| 156 | nlinarith |
| 157 | have he := (abs_lt.mp (hpert p (1 / Λ) ht)).1 |
| 158 | have hm := hmain Λ ((le_max_left _ _).trans hΛ) p |
| 159 | linarith |
| 160 | |
| 161 | noncomputable def shapeJet {D : RadialDomain} (P : Profiles D) (_h j Λ g : ℝ) |
| 162 | (p : Point) : Fin 5 → ℝ := |
| 163 | ![1, Λ * (P.U p - U j p.2), Λ * (P.Ubar p - U j p.2), |
| 164 | Λ * (average (parameterPartial P.U) p - 4), g] |
| 165 | |
| 166 | theorem shapeSource_identity {D : RadialDomain} (P : Profiles D) |
| 167 | (h j sigma Λ theta ell g : ℝ) (hΛ : Λ ≠ 0) (p : Point) |
| 168 | (hl : ReferenceBounds.logSlope P p = ell) |
| 169 | (hg : parameterPartial P.f p / P.f p = |
| 170 | (1 - theta) * (Λ * NaturalAxisCoefficients.realGradient h j sigma p.2 + g) - |
| 171 | theta * OutgoingEntranceCone.shapeGradient p.2) : |
| 172 | ReferenceBounds.sourceQ P h p = |
| 173 | Λ * ((1 - theta) * L h p.2 * chi h j sigma p.2) + |
| 174 | shapeRemainder h j sigma p.2 theta ell (shapeJet P h j Λ g p) (1 / Λ) := by |
| 175 | have hU : U j p.2 + (1 / Λ) * (Λ * (P.U p - U j p.2)) = P.U p := by |
| 176 | field_simp ; ring |
| 177 | have hW : W h j p.2 - (1 / Λ) * |
| 178 | (2 * NaturalAxisData.D h * p.2 * (Λ * (P.Ubar p - U j p.2)) + |
| 179 | d p.2 * (Λ * (average (parameterPartial P.U) p - 4))) = P.W h p := by |
| 180 | unfold W U Profiles.W NaturalAxisData.D d StressAlgebra.axialExponent StressAlgebra.coordinateFactor |
| 181 | field_simp ; ring |
| 182 | have hH : H h j p.2 + (1 / Λ) * d p.2 * (Λ * (P.U p - U j p.2)) = |
| 183 | NaturalAxisData.D h * p.2 + d p.2 * P.U p := by |
| 184 | unfold H |
| 185 | field_simp ; ring |
| 186 | rw [ReferenceBounds.sourceQ, hl, hg] |
| 187 | simp only [shapeRemainder, shapeJet, Matrix.cons_val_zero, Matrix.cons_val_one, |
| 188 | Matrix.cons_val, Fin.isValue, hU, hW, hH] |
| 189 | have hid := NaturalProfile.gradient_identity h j sigma p.2 |
| 190 | unfold H at hid |
| 191 | dsimp only [StressAlgebra.axialExponent, StressAlgebra.coordinateFactor, NaturalAxisData.D, d] at * |
| 192 | linear_combination -(1 - theta) * Λ * hid |
| 193 | |
| 194 | /-- Uniform positivity for the literal convex interpolation of the old and |
| 195 | target parameter gradients. The hypotheses concern only low-order actual |
| 196 | field jets; no angular-stock or cone estimate is assumed. -/ |
| 197 | theorem actual_shape_source_threshold {h j sigma B : ℝ} |
| 198 | (hs : SmallParameters h j) (hsigma : 0 < sigma) (hB : 1 ≤ B) : |
| 199 | ∃ M : ℝ, 0 < M ∧ ∀ Λ : ℝ, M ≤ Λ → |
| 200 | ∀ {D : RadialDomain} (P : Profiles D) (p : Point) (theta ell g : ℝ), |
| 201 | p.2 ∈ Icc (-1 : ℝ) 1 → theta ∈ Icc (0 : ℝ) 1 → ell ∈ Icc (11 / 20 : ℝ) (13 / 20) → |
| 202 | ReferenceBounds.logSlope P p = ell → |
| 203 | parameterPartial P.f p / P.f p = |
| 204 | (1 - theta) * (Λ * NaturalAxisCoefficients.realGradient h j sigma p.2 + g) - |
| 205 | theta * OutgoingEntranceCone.shapeGradient p.2 → |
| 206 | |Λ * (P.U p - U j p.2)| ≤ B → |Λ * (P.Ubar p - U j p.2)| ≤ B → |
| 207 | |Λ * (average (parameterPartial P.U) p - 4)| ≤ B → |g| ≤ B → |
| 208 | (5 / 4 : ℝ) < ReferenceBounds.sourceQ P h p := by |
| 209 | obtain ⟨M, hM, hm⟩ := shapeModel_uniform_lower hs hsigma B |
| 210 | refine ⟨M, hM, ?_⟩ |
| 211 | intro Λ hΛ D P p theta ell g hη ht hl hle hg hu hv hvη hgb |
| 212 | have hj : shapeJet P h j Λ g p ∈ ReferenceBounds.BoundedJets B := by |
| 213 | rw [Metric.mem_closedBall, dist_zero_right, pi_norm_le_iff_of_nonneg (zero_le_one.trans hB)] |
| 214 | intro i |
| 215 | fin_cases i |
| 216 | · simpa [shapeJet] using hB |
| 217 | · simpa [shapeJet, Real.norm_eq_abs, abs_mul] using hu |
| 218 | · simpa [shapeJet, Real.norm_eq_abs, abs_mul] using hv |
| 219 | · simpa [shapeJet, Real.norm_eq_abs, abs_mul] using hvη |
| 220 | · simpa [shapeJet, Real.norm_eq_abs] using hgb |
| 221 | let sample : ShapeParameter B := (⟨p.2, hη⟩, ⟨theta, ht⟩, ⟨ell, hl⟩, ⟨shapeJet P h j Λ g p, hj⟩) |
| 222 | have he := hm Λ hΛ sample |
| 223 | rw [shapeSource_identity P h j sigma Λ theta ell g (hM.trans_le hΛ).ne' p hle hg] |
| 224 | exact he |
| 225 | |
| 226 | noncomputable def angularGap {D : RadialDomain} (P : Profiles D) (h eta X : ℝ) : ℝ := |
| 227 | primitive (P.angularSource h) (X, eta) - 2 * L h eta * P.H (X, eta) |
| 228 | |
| 229 | theorem angularGap_hasDerivAt {D : RadialDomain} (P : Profiles D) (h : ℝ) |
| 230 | {eta X : ℝ} (hp : (X, eta) ∈ D.carrier) : |
| 231 | HasDerivAt (angularGap P h eta) |
| 232 | (P.angularSource h (X, eta) - 2 * L h eta * radialPartial P.H (X, eta)) X := |
| 233 | (primitive_hasDerivAt D (P.angularSource_smooth h) hp).sub |
| 234 | ((radialPartial_hasDerivAt D P.H_smooth hp).const_mul (2 * L h eta)) |
| 235 | |
| 236 | /-- A barrier with a variable logarithmic slope. It uses the actual source |
| 237 | primitive and the actual integrating factor `H`. -/ |
| 238 | theorem angular_barrier {D : RadialDomain} (P : Profiles D) {h eta a X : ℝ} |
| 239 | (ha : 2 ≤ a) (haX : a ≤ X) (hL : 0 < L h eta) (hL1 : L h eta ≤ 1) |
| 240 | (hmem : ∀ s ∈ Icc a X, (s, eta) ∈ D.carrier) |
| 241 | (hf : ∀ s ∈ Icc a X, 0 < P.f (s, eta)) |
| 242 | (hl : ∀ s ∈ Icc a X, ReferenceBounds.logSlope P (s, eta) ≤ 1) |
| 243 | (hq : ∀ s ∈ Icc a X, 1 < ReferenceBounds.sourceQ P h (s, eta)) |
| 244 | (hinit : 2 < ReferenceBounds.p1 P h (a, eta)) : |
| 245 | 2 < ReferenceBounds.p1 P h (X, eta) := by |
| 246 | have hspos (s : ℝ) (hs : s ∈ Icc a X) : 0 < s := lt_of_lt_of_le (by linarith) hs.1 |
| 247 | have hHpos (s : ℝ) (hs : s ∈ Icc a X) : 0 < P.H (s, eta) := by |
| 248 | change 0 < 2 * s * P.f (s, eta) |
| 249 | exact mul_pos (mul_pos (by norm_num) (hspos s hs)) (hf s hs) |
| 250 | have hder (s : ℝ) (hs : s ∈ Icc a X) : |
| 251 | 0 ≤ P.angularSource h (s, eta) - 2 * L h eta * radialPartial P.H (s, eta) := by |
| 252 | have hdot : s * radialPartial P.H (s, eta) = |
| 253 | P.H (s, eta) * ReferenceBounds.logSlope P (s, eta) := by |
| 254 | rw [ReferenceBounds.H_radialPartial P (hmem s hs)] |
| 255 | unfold Profiles.H ReferenceBounds.logSlope |
| 256 | dsimp only |
| 257 | field_simp [(hf s hs).ne'] |
| 258 | have he := ReferenceBounds.angularSource_eq P (hmem s hs) (hf s hs).ne' h |
| 259 | have hterm : 2 * L h eta * ReferenceBounds.logSlope P (s, eta) ≤ 2 := by |
| 260 | have hh := mul_le_mul_of_nonneg_left (hl s hs) (show 0 ≤ 2 * L h eta by positivity) |
| 261 | nlinarith |
| 262 | have hsq : 2 < s * ReferenceBounds.sourceQ P h (s, eta) := by |
| 263 | have hh := mul_lt_mul_of_pos_left (hq s hs) (hspos s hs) |
| 264 | linarith [hs.1] |
| 265 | have hprod : 0 ≤ P.H (s, eta) * |
| 266 | (s * ReferenceBounds.sourceQ P h (s, eta) - 2 * L h eta * ReferenceBounds.logSlope P (s, eta)) := |
| 267 | mul_nonneg (hHpos s hs).le (by linarith) |
| 268 | rw [he] |
| 269 | nlinarith [hspos s hs] |
| 270 | have hm : MonotoneOn (angularGap P h eta) (Icc a X) := by |
| 271 | apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc a X) |
| 272 | · intro s hs |
| 273 | exact (angularGap_hasDerivAt P h (hmem s hs)).continuousAt.continuousWithinAt |
| 274 | · intro s hs |
| 275 | exact (angularGap_hasDerivAt P h (hmem s (interior_subset hs))).hasDerivWithinAt |
| 276 | · intro s hs |
| 277 | exact hder s (interior_subset hs) |
| 278 | have hini : 0 < angularGap P h eta a := by |
| 279 | rw [ReferenceBounds.p1_primitive P (hspos a ⟨le_rfl, haX⟩).ne' h] at hinit |
| 280 | have hi := (lt_div_iff₀ (mul_pos hL (hHpos a ⟨le_rfl, haX⟩))).mp hinit |
| 281 | unfold angularGap |
| 282 | nlinarith |
| 283 | have hout : 0 < angularGap P h eta X := hini.trans_le (hm ⟨le_rfl, haX⟩ ⟨haX, le_rfl⟩ haX) |
| 284 | rw [ReferenceBounds.p1_primitive P (hspos X ⟨haX, le_rfl⟩).ne' h] |
| 285 | apply (lt_div_iff₀ (mul_pos hL (hHpos X ⟨haX, le_rfl⟩))).mpr |
| 286 | unfold angularGap at hout |
| 287 | nlinarith |
| 288 | |
| 289 | theorem shape_relaxed_from_source {D : RadialDomain} (P : Profiles D) {h eta a X : ℝ} |
| 290 | (ha : 2 ≤ a) (haX : a ≤ X) (hL : 0 < L h eta) (hL1 : L h eta ≤ 1) |
| 291 | (hmem : ∀ s ∈ Icc a X, (s, eta) ∈ D.carrier) |
| 292 | (hf : ∀ s ∈ Icc a X, 0 < P.f (s, eta)) |
| 293 | (hl : ∀ s ∈ Icc a X, ReferenceBounds.logSlope P (s, eta) ∈ Icc (11 / 20 : ℝ) (13 / 20)) |
| 294 | (hq : ∀ s ∈ Icc a X, 1 < ReferenceBounds.sourceQ P h (s, eta)) |
| 295 | (hinit : 2 < ReferenceBounds.p1 P h (a, eta)) |
| 296 | (hu : radialPartial P.U (X, eta) = 0) : ActivationContinuation.IsRelaxed P h (X, eta) := by |
| 297 | have hp := angular_barrier P ha haX hL hL1 hmem hf |
| 298 | (fun s hs => (hl s hs).2.trans (by norm_num)) hq hinit |
| 299 | have he := ActivationContinuation.logSlope_eq_shear P (X, eta) |
| 300 | have hb := hl X ⟨haX, le_rfl⟩ |
| 301 | exact ActivationContinuation.zero_axial_relaxed_profile P |
| 302 | (by linarith [hb.1, hb.2]) (by linarith [hb.1, hb.2]) hu hp |
| 303 | |
| 304 | theorem axial_error_jet {J K : Set ℝ} (R : TransitionRamp.StockReference J) |
| 305 | (hJ : IsOpen J) (hKJ : K ⊆ J) {N : ℕ} {eps T kappa wU wE y eta : ℝ} |
| 306 | (hb : 0 ≤ R.bigTime) (hwU : 0 < wU) (hwE : 0 < wE) |
| 307 | (hc : R.SmallLogControl K N eps T kappa wU wE) (hy : 0 ≤ y) (hη : eta ∈ K) |
| 308 | {n : ℕ} (hn : n ≤ N) : |
| 309 | |iteratedDeriv n (fun e => R.axialVelocity T kappa wU (y, e) - R.initialU e) eta| ≤ eps := by |
| 310 | by_cases hf : y ≤ R.finalTime |
| 311 | · exact (hc.axial_jets y ⟨hy, hf⟩ eta hη n hn).le |
| 312 | · have he : (fun e => R.axialVelocity T kappa wU (y, e) - R.initialU e) =ᶠ[𝓝 eta] |
| 313 | (fun e => R.axialVelocity T kappa wU (R.finalTime, e) - R.initialU e) := by |
| 314 | filter_upwards [hJ.mem_nhds (hKJ hη)] with e he |
| 315 | rw [show R.axialVelocity T kappa wU (y, e) = |
| 316 | R.axialVelocity T kappa wU (R.finalTime, e) from |
| 317 | TransitionRamp.axialField_hold hwU hJ R.initialU (R.axialStock_smooth hJ) |
| 318 | (by linarith [hc.finish_before]) (le_of_not_ge hf) he] |
| 319 | rw [he.iteratedDeriv_eq n] |
| 320 | exact (hc.axial_jets R.finalTime ⟨hb.trans R.finalTime_gt_bigTime.le, le_rfl⟩ eta hη n hn).le |
| 321 | |
| 322 | section IncomingBounds |
| 323 | |
| 324 | variable {F : OutgoingProfile.Profile} {A : NominalProfile.AxisStage F} |
| 325 | (c : NominalProfile.Controls A) |
| 326 | |
| 327 | theorem seedU_error_jets {N : ℕ} {eps X eta : ℝ} |
| 328 | (hc : MatchingDebtBounds.SmallControl c N eps) (heps : 0 ≤ eps) |
| 329 | (hX : 0 ≤ X) (hη : eta ∈ Icc (-1 : ℝ) 1) {n : ℕ} (hn : n ≤ N) : |
| 330 | |iteratedDeriv n (fun e => c.seedU (X, e) - U A.j e) eta| ≤ |
| 331 | ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 n / A.scale + eps := by |
| 332 | have hηJ := NaturalAxisCoefficients.original_interval_interior hη |
| 333 | have hUstar : ContDiff ℝ ∞ (U A.j) := (contDiff_const.mul contDiff_id).add contDiff_const |
| 334 | by_cases hx : X ≤ c.reference.radius0 |
| 335 | · have hxn : X ≤ 4 / A.scale := by simpa only [c.reference_radius] using hx |
| 336 | have hY : A.scale * X ∈ Ioo (-20 : ℝ) 20 := by |
| 337 | have hb := (le_div_iff₀ A.scale_pos).mp hxn |
| 338 | constructor <;> nlinarith [mul_nonneg A.scale_pos.le hX] |
| 339 | have he : (fun e => c.seedU (X, e) - U A.j e) = |
| 340 | (fun e => A.natural.profile.family.U (X, e) - U A.j e) := by |
| 341 | funext e |
| 342 | rw [(c.seed_initial (p := (X, e)) hxn).2] |
| 343 | rw [he, TransitionRamp.naturalU_error_jet A.preparation.inputs A.natural.profile hY hηJ n, |
| 344 | abs_mul, abs_of_pos (one_div_pos.mpr A.scale_pos)] |
| 345 | have hY5 : |A.scale * X| ≤ 5 := by |
| 346 | rw [abs_of_nonneg (mul_nonneg A.scale_pos.le hX)] |
| 347 | have hb := (le_div_iff₀ A.scale_pos).mp hxn |
| 348 | nlinarith |
| 349 | have hb := (ReferenceJetBounds.coefficient_jet_bound A.preparation.inputs.coefficients |
| 350 | A.natural.profile.coefficients A.natural.profile.norm_ball 0 n (p := (A.scale * X, eta)) hY5).2 |
| 351 | have hh := mul_le_mul_of_nonneg_left hb (one_div_nonneg.mpr A.scale_pos.le) |
| 352 | calc |
| 353 | _ ≤ (1 / A.scale) * ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 n := hh |
| 354 | _ ≤ _ := by simpa only [one_div_mul_eq_div] using le_add_of_nonneg_right heps |
| 355 | · have hxR : c.reference.radius0 < X := lt_of_not_ge hx |
| 356 | have hy : 0 ≤ c.reference.logTime X := |
| 357 | Real.log_nonneg ((one_le_div c.reference.radius0_pos).mpr hxR.le) |
| 358 | have he : (fun e => c.seedU (X, e)) = |
| 359 | fun e => c.reference.axialVelocity c.activationTime c.kappa c.axialWidth (c.reference.logTime X, e) := by |
| 360 | funext e |
| 361 | exact ite_eq_right hx |
| 362 | have hp : (X, eta) ∈ A.referenceInput.radialDomain.carrier := |
| 363 | ⟨lt_of_lt_of_le (by norm_num) (mul_nonneg A.scale_pos.le hX), hηJ⟩ |
| 364 | have hseed : ContDiffAt ℝ ∞ (fun e => c.seedU (X, e)) eta := |
| 365 | (c.seedU_smooth.contDiffAt (A.referenceInput.radialDomain.isOpen.mem_nhds |
| 366 | hp)).comp eta |
| 367 | (contDiffAt_const.prodMk contDiffAt_id) |
| 368 | have hinit : ContDiffAt ℝ ∞ c.reference.initialU eta := |
| 369 | (c.reference.initialU_smooth ReferencePath.parameterInterval_open).contDiffAt |
| 370 | (ReferencePath.parameterInterval_open.mem_nhds hηJ) |
| 371 | apply TransitionRamp.jet_transfer n (hseed.sub hUstar.contDiffAt) (hinit.sub hUstar.contDiffAt) |
| 372 | · have hh := axial_error_jet c.reference ReferencePath.parameterInterval_open |
| 373 | NaturalAxisCoefficients.original_interval_interior c.reference_before_big.le |
| 374 | c.axialWidth_pos c.angularWidth_pos hc hy hη hn |
| 375 | have hfun : (fun e => (c.seedU (X, e) - U A.j e) - (c.reference.initialU e - U A.j e)) = |
| 376 | fun e => c.reference.axialVelocity c.activationTime c.kappa c.axialWidth |
| 377 | (c.reference.logTime X, e) - c.reference.initialU e := by |
| 378 | funext e |
| 379 | rw [congrFun he e] |
| 380 | ring |
| 381 | rwa [hfun] |
| 382 | · exact TransitionRamp.initialU_error_jet_bound A.scale_pos A.small |
| 383 | c.referenceWidth_pos c.referenceWidth_small F.axisDatum_contDiff A.natural.profile n hηJ |
| 384 | |
| 385 | theorem seedU_scaled_error_jets {N : ℕ} {eps X eta : ℝ} |
| 386 | (hc : MatchingDebtBounds.SmallControl c N eps) (heps : 0 ≤ eps) |
| 387 | (hX : 0 ≤ X) (hη : eta ∈ Icc (-1 : ℝ) 1) {n : ℕ} (hn : n ≤ N) : |
| 388 | |A.scale * iteratedDeriv n (fun e => c.seedU (X, e) - U A.j e) eta| ≤ |
| 389 | ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 n + A.scale * eps := by |
| 390 | rw [abs_mul, abs_of_pos A.scale_pos] |
| 391 | have hb := mul_le_mul_of_nonneg_left (seedU_error_jets c hc heps hX hη hn) A.scale_pos.le |
| 392 | calc |
| 393 | _ ≤ A.scale * (ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 n / A.scale + eps) := hb |
| 394 | _ = _ := by rw [mul_add, mul_div_cancel₀ _ A.scale_pos.ne'] |
| 395 | |
| 396 | theorem initialShape_gradient_bound {N : ℕ} {eps eta : ℝ} |
| 397 | (hc : MatchingDebtBounds.SmallControl c N eps) (hN : 1 ≤ N) |
| 398 | (hscale : AxisReference.stabilityScale A.preparation.inputs.coefficients.epsilon |
| 399 | (NaturalProfile.profileErrorConstant A.preparation.inputs) ≤ A.scale) |
| 400 | (hη : eta ∈ Icc (-1 : ℝ) 1) : |
| 401 | |deriv c.initialShape eta - A.scale * NaturalAxisCoefficients.realGradient |
| 402 | F.data.h A.j A.preparation.sigma eta| ≤ |
| 403 | 8 * ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 1 + eps := by |
| 404 | have hηJ := NaturalAxisCoefficients.original_interval_interior hη |
| 405 | let L0 := c.reference.initialLog |
| 406 | let L1 := fun e => c.reference.logAmplitude c.activationTime c.kappa c.axialWidth |
| 407 | c.angularWidth (c.reference.finalTime, e) |
| 408 | have h0 : DifferentiableAt ℝ L0 eta := |
| 409 | (c.reference.initialLog_smooth ReferencePath.parameterInterval_open).differentiableOn |
| 410 | (by simp) eta hηJ |>.differentiableAt (ReferencePath.parameterInterval_open.mem_nhds hηJ) |
| 411 | have h1 : DifferentiableAt ℝ L1 eta := by |
| 412 | have hp : (c.reference.finalTime, eta) ∈ |
| 413 | (StressActivation.logDomain ReferencePath.parameterInterval |
| 414 | ReferencePath.parameterInterval_open).carrier := ⟨mem_univ _, hηJ⟩ |
| 415 | exact ((c.reference.logAmplitude_smooth ReferencePath.parameterInterval_open _ _ _ _).contDiffAt |
| 416 | ((StressActivation.logDomain _ _).isOpen.mem_nhds hp)).differentiableAt (by simp) |>.comp eta |
| 417 | ((differentiableAt_const c.reference.finalTime).prodMk differentiableAt_id) |
| 418 | have herr := hc.positive_log_jets c.reference.finalTime |
| 419 | ⟨c.reference_before_big.le.trans c.reference.finalTime_gt_bigTime.le, le_rfl⟩ eta hη 1 hN (by norm_num) |
| 420 | change |iteratedDeriv 1 (fun e => L1 e - L0 e) eta| < eps at herr |
| 421 | rw [iteratedDeriv_one, deriv_fun_sub h1 h0] at herr |
| 422 | have hfinal : deriv c.initialShape eta = deriv L1 eta := by |
| 423 | exact (h1.hasDerivAt.const_add (Real.log A.normalization + Real.log 220 / 2)).deriv |
| 424 | have hi : L0 = fun e => Real.log (A.natural.profile.family.f (A.referenceInput.endpoint, e)) := by |
| 425 | funext e |
| 426 | exact TransitionRamp.initialLog_natural A.natural.profile.family A.scale_pos A.small |
| 427 | c.referenceWidth_pos c.referenceWidth_small F.axisDatum_contDiff e |
| 428 | have hm := ReferenceJetBounds.endpoint_mem A.referenceInput hη |
| 429 | have hn := A.referenceInput.endpoint_f_pos hηJ |
| 430 | have hd := (ReferenceJetBounds.parameter_deriv |
| 431 | (A.natural.profile.family.natural.f_smooth.contDiffAt |
| 432 | ((NaturalProfile.domain_isOpen A.scale).mem_nhds hm))).log hn.ne' |
| 433 | have hinit : deriv L0 eta = parameterPartial A.natural.profile.family.f |
| 434 | (A.referenceInput.endpoint, eta) / A.natural.profile.family.f (A.referenceInput.endpoint, eta) := by |
| 435 | rw [hi] |
| 436 | exact hd.deriv |
| 437 | have hnat := ReferenceJetBounds.natural_log_bound A.natural.profile A.preparation.sigma_pos |
| 438 | A.scale_pos A.normalization_pos hscale (p := (A.referenceInput.endpoint, eta)) |
| 439 | (by |
| 440 | change NaturalProfile.rescalePoint A.scale |
| 441 | ((ReferencePath.Input.ofNatural A.scale_pos A.natural.profile.family).endpoint, eta) ∈ _ |
| 442 | rw [TransitionRamp.endpoint_rescale A.natural.profile.family A.scale_pos] |
| 443 | exact ⟨by norm_num, hη⟩) |
| 444 | rw [hfinal] |
| 445 | calc |
| 446 | _ = |(deriv L1 eta - deriv L0 eta) + (deriv L0 eta - A.scale * |
| 447 | NaturalAxisCoefficients.realGradient F.data.h A.j A.preparation.sigma eta)| := by congr 1; ring |
| 448 | _ ≤ |deriv L1 eta - deriv L0 eta| + |deriv L0 eta - A.scale * |
| 449 | NaturalAxisCoefficients.realGradient F.data.h A.j A.preparation.sigma eta| := abs_add_le _ _ |
| 450 | _ ≤ _ := by |
| 451 | have hb : |deriv L0 eta - A.scale * NaturalAxisCoefficients.realGradient |
| 452 | F.data.h A.j A.preparation.sigma eta| ≤ |
| 453 | 8 * ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 1 := by |
| 454 | simpa only [hinit] using hnat |
| 455 | linarith |
| 456 | |
| 457 | theorem seedU_source_jets {N : ℕ} {eps X eta : ℝ} |
| 458 | (hc : MatchingDebtBounds.SmallControl c N eps) (heps : 0 ≤ eps) (hN : 1 ≤ N) |
| 459 | (hX : 0 ≤ X) (hη : eta ∈ Icc (-1 : ℝ) 1) : |
| 460 | |A.scale * (c.seedU (X, eta) - U A.j eta)| ≤ |
| 461 | ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 0 + A.scale * eps ∧ |
| 462 | |A.scale * (parameterPartial c.seedU (X, eta) - 4)| ≤ |
| 463 | ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 1 + A.scale * eps := by |
| 464 | have h0 := seedU_scaled_error_jets c hc heps hX hη (n := 0) (Nat.zero_le _) |
| 465 | have h1 := seedU_scaled_error_jets c hc heps hX hη hN |
| 466 | have hp := ReferenceJetBounds.reference_mem A.referenceInput (p := (X, eta)) hX hη |
| 467 | have hd := ReferenceJetBounds.parameter_deriv |
| 468 | (c.seedU_smooth.contDiffAt (A.referenceInput.radialDomain.isOpen.mem_nhds hp)) |
| 469 | have hs : HasDerivAt (U A.j) 4 eta := by |
| 470 | convert! ((hasDerivAt_id eta).const_mul 4).add_const A.j using 1 |
| 471 | simp [] |
| 472 | rw [iteratedDeriv_one, (hd.fun_sub hs).deriv] at h1 |
| 473 | exact ⟨h0, h1⟩ |
| 474 | |
| 475 | theorem profiles_before_restore (hsep : c.separation ≤ Real.exp (-8)) |
| 476 | {p : Point} (hX : p.1 ≤ c.radius * Real.exp (-8)) : |
| 477 | (c.profiles hsep).U p = c.seedU p ∧ (c.profiles hsep).f p = c.shapedF p := by |
| 478 | have hx : p.1 / c.radius ≤ Real.exp (-8) := |
| 479 | (div_le_iff₀ c.radius_pos).mpr (by simpa only [mul_comm] using hX) |
| 480 | have hb : p.1 / c.radius ≤ NominalProfile.resetPatch.left := hx.trans |
| 481 | (Real.exp_le_exp.mpr (by norm_num : (-8 : ℝ) ≤ -6)) |
| 482 | have he := NominalProfile.joined_before_patch F A.normalization c.shapeTime |
| 483 | c.initialShape c.seedF c.seedU (p := (p.1 / c.radius, p.2)) hb |
| 484 | have hU : c.U p = c.seedU p := by |
| 485 | change NominalProfile.joinedU F A.normalization c.shapeTime c.initialShape c.seedF c.seedU |
| 486 | (p.1 / c.radius, p.2) = _ |
| 487 | rw [he.1] |
| 488 | change NominalProfile.restoredU c.radius c.seedU (c.radius * (p.1 / c.radius), p.2) = _ |
| 489 | rw [mul_div_cancel₀ _ c.radius_pos.ne', NominalProfile.restoredU_before c.radius_pos hX] |
| 490 | have hE : c.E p = Real.sqrt (2 * p.1) * c.shapedF p := by |
| 491 | change NominalProfile.joinedE F A.normalization c.shapeTime c.initialShape c.seedF c.seedU |
| 492 | (p.1 / c.radius, p.2) = _ |
| 493 | rw [he.2] |
| 494 | change Real.sqrt (2 * (c.radius * (p.1 / c.radius))) * |
| 495 | c.shapedF (c.radius * (p.1 / c.radius), p.2) = _ |
| 496 | rw [mul_div_cancel₀ _ c.radius_pos.ne'] |
| 497 | refine ⟨hU, ?_⟩ |
| 498 | by_cases hi : p.1 ≤ NominalProfile.Xi |
| 499 | · exact (c.f_before_Xi hi).trans |
| 500 | (ShapeTransition.shapeField_before NominalProfile.Xi_pos c.shapeTime_pos hi _ _ _).symm |
| 501 | · change c.f p = _ |
| 502 | rw [NominalProfile.Controls.f, ite_eq_right hi, hE] |
| 503 | exact mul_div_cancel_left₀ _ (Real.sqrt_pos.mpr (show 0 < 2 * p.1 by |
| 504 | have := NominalProfile.Xi_pos.trans (lt_of_not_ge hi) |
| 505 | positivity)).ne' |
| 506 | |
| 507 | theorem profiles_source_jets (hsep : c.separation ≤ Real.exp (-8)) |
| 508 | {N : ℕ} {eps X eta : ℝ} |
| 509 | (hc : MatchingDebtBounds.SmallControl c N eps) (heps : 0 ≤ eps) (hN : 1 ≤ N) |
| 510 | (hX : 0 ≤ X) (hR : X ≤ c.radius * Real.exp (-8)) |
| 511 | (hη : eta ∈ Icc (-1 : ℝ) 1) (hsmall : NominalProfile.SmallDebt F c.debt eta) : |
| 512 | |A.scale * ((c.profiles hsep).U (X, eta) - U A.j eta)| ≤ |
| 513 | ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 0 + A.scale * eps ∧ |
| 514 | |A.scale * ((c.profiles hsep).Ubar (X, eta) - U A.j eta)| ≤ |
| 515 | ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 0 + A.scale * eps ∧ |
| 516 | |A.scale * (average (parameterPartial (c.profiles hsep).U) (X, eta) - 4)| ≤ |
| 517 | ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 1 + A.scale * eps := by |
| 518 | have hh : ∀ t ∈ Icc (0 : ℝ) 1, t * X ≤ c.radius * Real.exp (-8) := |
| 519 | fun t ht => (mul_le_of_le_one_left hX ht.2).trans hR |
| 520 | have hu : ∀ t ∈ Icc (0 : ℝ) 1, |
| 521 | |A.scale * ((c.profiles hsep).U (t * X, eta) - U A.j eta)| ≤ |
| 522 | ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 0 + A.scale * eps := by |
| 523 | intro t ht |
| 524 | rw [(profiles_before_restore c hsep (hh t ht)).1] |
| 525 | exact (seedU_source_jets c hc heps hN (mul_nonneg ht.1 hX) hη).1 |
| 526 | have huη : ∀ t ∈ Icc (0 : ℝ) 1, |
| 527 | |A.scale * (parameterPartial (c.profiles hsep).U (t * X, eta) - 4)| ≤ |
| 528 | ReferenceJetBounds.jetConstant A.preparation.inputs.coefficients 0 1 + A.scale * eps := by |
| 529 | intro t ht |
| 530 | have hf : (fun e => (c.profiles hsep).U (t * X, e)) = fun e => c.seedU (t * X, e) := by |
| 531 | funext e |
| 532 | exact (profiles_before_restore c hsep (hh t ht)).1 |
| 533 | have hp := c.admissible_nonnegative (p := (t * X, eta)) (mul_nonneg ht.1 hX) |
| 534 | (NaturalAxisCoefficients.original_interval_interior hη) hsmall |
| 535 | have hseed := ReferenceJetBounds.reference_mem A.referenceInput |
| 536 | (p := (t * X, eta)) (mul_nonneg ht.1 hX) hη |
| 537 | have he := congrArg (fun f : ℝ → ℝ => deriv f eta) hf |
| 538 | rw [(parameterPartial_hasDerivAt c.admissibleDomain (c.profiles hsep).U_smooth hp).deriv, |
| 539 | (parameterPartial_hasDerivAt A.referenceInput.radialDomain c.seedU_smooth hseed).deriv] at he |
| 540 | rw [he] |
| 541 | exact (seedU_source_jets c hc heps hN (mul_nonneg ht.1 hX) hη).2 |
| 542 | have hp := c.admissible_nonnegative (p := (X, eta)) hX |
| 543 | (NaturalAxisCoefficients.original_interval_interior hη) hsmall |
| 544 | refine ⟨?_, ReferenceBounds.average_error_bound (c.profiles hsep).U_smooth hp hu, |
| 545 | ReferenceBounds.average_error_bound (parameterPartial_smooth c.admissibleDomain |
| 546 | (c.profiles hsep).U_smooth) hp huη⟩ |
| 547 | simpa only [one_mul] using hu 1 ⟨zero_le_one, le_rfl⟩ |
| 548 | |
| 549 | end IncomingBounds |
| 550 | |
| 551 | theorem deriv_eqOn_Ici {f g : ℝ → ℝ} {a x : ℝ} (hx : a ≤ x) |
| 552 | (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) |
| 553 | (he : EqOn f g (Ici a)) : deriv f x = deriv g x := by |
| 554 | exact (uniqueDiffOn_Ici a x hx).eq_deriv _ hf.hasDerivAt.hasDerivWithinAt |
| 555 | (hg.hasDerivAt.hasDerivWithinAt.congr_of_mem he hx) |
| 556 | |
| 557 | theorem deriv_eqOn_Iic {f g : ℝ → ℝ} {a x : ℝ} (hx : x ≤ a) |
| 558 | (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) |
| 559 | (he : EqOn f g (Iic a)) : deriv f x = deriv g x := by |
| 560 | exact (uniqueDiffOn_Iic a x hx).eq_deriv _ hf.hasDerivAt.hasDerivWithinAt |
| 561 | (hg.hasDerivAt.hasDerivWithinAt.congr_of_mem he hx) |
| 562 | |
| 563 | noncomputable def shapeValue (C T : ℝ) (li : ℝ → ℝ) (X eta : ℝ) : ℝ := |
| 564 | ShapeTransition.angular C T li (Real.log (X / NominalProfile.Xi), eta) / Real.sqrt (2 * X) |
| 565 | |
| 566 | theorem shapeValue_hasDerivAt_x (C T : ℝ) (li : ℝ → ℝ) {X : ℝ} (hX : 0 < X) (eta : ℝ) : |
| 567 | HasDerivAt (fun s => shapeValue C T li s eta) |
| 568 | (shapeValue C T li X eta * |
| 569 | (ShapeTransition.logarithmicSlope T li (Real.log (X / NominalProfile.Xi), eta) - 1) / X) X := by |
| 570 | have hx : HasDerivAt (fun s : ℝ => Real.log (s / NominalProfile.Xi)) (1 / X) X := by |
| 571 | convert! ((hasDerivAt_id X).div_const NominalProfile.Xi).log |
| 572 | (div_ne_zero hX.ne' NominalProfile.Xi_pos.ne') using 1 |
| 573 | norm_num [NominalProfile.Xi, div_eq_mul_inv] |
| 574 | ring |
| 575 | have ha := ((ShapeTransition.logProfile_hasDerivAt C T li |
| 576 | (Real.log (X / NominalProfile.Xi)) eta).comp X hx).exp |
| 577 | have hr : HasDerivAt (fun s : ℝ => Real.sqrt (2 * s)) (1 / Real.sqrt (2 * X)) X := by |
| 578 | convert! ((hasDerivAt_id X).const_mul 2).sqrt (show 2 * X ≠ 0 by positivity) using 1 |
| 579 | simp only [id_eq] |
| 580 | ring |
| 581 | have hroot := Real.sqrt_pos.mpr (show 0 < 2 * X by positivity) |
| 582 | have hsq := Real.sq_sqrt (show 0 ≤ 2 * X by positivity) |
| 583 | convert! ha.div hr hroot.ne' using 1 |
| 584 | dsimp only [shapeValue, ShapeTransition.angular, Function.comp_def, Function.comp_apply] |
| 585 | generalize hk : Real.exp (ShapeTransition.logProfile C T li |
| 586 | (Real.log (X / NominalProfile.Xi), eta)) = k |
| 587 | generalize hr' : Real.sqrt (2 * X) = r at hroot hsq ⊢ |
| 588 | field_simp [hX.ne', hroot.ne'] |
| 589 | linear_combination -k * hsq |
| 590 | |
| 591 | theorem shapeValue_hasDerivAt_eta (C T : ℝ) {li : ℝ → ℝ} {X eta : ℝ} |
| 592 | (hli : DifferentiableAt ℝ li eta) : |
| 593 | HasDerivAt (shapeValue C T li X) |
| 594 | (shapeValue C T li X eta * |
| 595 | ((1 - OutgoingSchedule.sigma (Real.log (X / NominalProfile.Xi) / T)) * deriv li eta - |
| 596 | OutgoingSchedule.sigma (Real.log (X / NominalProfile.Xi) / T) * |
| 597 | OutgoingEntranceCone.shapeGradient eta)) eta := by |
| 598 | have hd := (((hli.hasDerivAt.const_mul |
| 599 | (1 - OutgoingSchedule.sigma (Real.log (X / NominalProfile.Xi) / T))).fun_add |
| 600 | ((logShape_hasDerivAt eta).const_mul |
| 601 | (OutgoingSchedule.sigma (Real.log (X / NominalProfile.Xi) / T)))).const_add |
| 602 | (-Real.log C + Real.log (X / NominalProfile.Xi) / 10)).exp.div_const (Real.sqrt (2 * X)) |
| 603 | convert! hd using 1 |
| 604 | dsimp only [shapeValue, ShapeTransition.angular, ShapeTransition.logProfile, ShapeTransition.blend] |
| 605 | ring |
| 606 | |
| 607 | section ShapeCoordinates |
| 608 | |
| 609 | variable {F : OutgoingProfile.Profile} {A : NominalProfile.AxisStage F} |
| 610 | (c : NominalProfile.Controls A) (hsep : c.separation ≤ Real.exp (-8)) |
| 611 | |
| 612 | theorem shapedF_value {X eta : ℝ} (hX : NominalProfile.Xi ≤ X) |
| 613 | (hη : eta ∈ ReferencePath.parameterInterval) : |
| 614 | c.shapedF (X, eta) = shapeValue A.normalization c.shapeTime c.initialShape X eta := |
| 615 | ShapeTransition.shapeField_eq_profile NominalProfile.Xi_pos A.normalization_pos |
| 616 | c.shapeTime_pos (NominalProfile.Xi_pos.trans_le hX) _ _ _ (c.seedF_held hX hη) |
| 617 | |
| 618 | theorem profiles_shape_value {X eta : ℝ} (hX : NominalProfile.Xi ≤ X) |
| 619 | (hR : X ≤ c.radius * Real.exp (-8)) (hη : eta ∈ ReferencePath.parameterInterval) : |
| 620 | (c.profiles hsep).f (X, eta) = shapeValue A.normalization c.shapeTime c.initialShape X eta := |
| 621 | (profiles_before_restore c hsep hR).2.trans (shapedF_value c hX hη) |
| 622 | |
| 623 | theorem profiles_shape_positive {X eta : ℝ} (hX : 0 ≤ X) |
| 624 | (hR : X ≤ c.radius * Real.exp (-8)) (hη : eta ∈ ReferencePath.parameterInterval) : |
| 625 | 0 < (c.profiles hsep).f (X, eta) := by |
| 626 | rw [(profiles_before_restore c hsep hR).2] |
| 627 | exact mul_pos (c.seedF_positive hη hX) (Real.exp_pos _) |
| 628 | |
| 629 | theorem profiles_shape_radialU {X eta : ℝ} (hX : NominalProfile.Xi ≤ X) |
| 630 | (hR : X ≤ c.radius * Real.exp (-8)) (hη : eta ∈ ReferencePath.parameterInterval) |
| 631 | (hsmall : NominalProfile.SmallDebt F c.debt eta) : |
| 632 | radialPartial (c.profiles hsep).U (X, eta) = 0 := by |
| 633 | have hX0 := NominalProfile.Xi_pos.trans_le hX |
| 634 | have hp := c.admissible_nonnegative (p := (X, eta)) hX0.le hη hsmall |
| 635 | have hs : (X, eta) ∈ A.referenceInput.radialDomain.carrier := hp.1 |
| 636 | have hdP := radialPartial_hasDerivAt c.admissibleDomain (c.profiles hsep).U_smooth hp |
| 637 | have hdS := radialPartial_hasDerivAt A.referenceInput.radialDomain c.seedU_smooth hs |
| 638 | have he := deriv_eqOn_Iic hR hdP.differentiableAt hdS.differentiableAt |
| 639 | (fun s hs => (profiles_before_restore c hsep (p := (s, eta)) hs).1) |
| 640 | have hc := deriv_eqOn_Ici hX hdS.differentiableAt |
| 641 | (differentiableAt_const (c.initialAxial eta)) (fun s hs => c.seedU_held hs hη) |
| 642 | rw [hdP.deriv] at he |
| 643 | rw [he, hc, deriv_const] |
| 644 | |
| 645 | theorem profiles_shape_radialF {X eta : ℝ} (hX : NominalProfile.Xi ≤ X) |
| 646 | (hR : X ≤ c.radius * Real.exp (-8)) (hη : eta ∈ ReferencePath.parameterInterval) |
| 647 | (hsmall : NominalProfile.SmallDebt F c.debt eta) : |
| 648 | radialPartial (c.profiles hsep).f (X, eta) = |
| 649 | (c.profiles hsep).f (X, eta) * |
| 650 | (ShapeTransition.logarithmicSlope c.shapeTime c.initialShape |
| 651 | (Real.log (X / NominalProfile.Xi), eta) - 1) / X := by |
| 652 | have hX0 := NominalProfile.Xi_pos.trans_le hX |
| 653 | have hp := c.admissible_nonnegative (p := (X, eta)) hX0.le hη hsmall |
| 654 | have hdP := radialPartial_hasDerivAt c.admissibleDomain (c.profiles hsep).f_smooth hp |
| 655 | have hdS := radialPartial_hasDerivAt A.referenceInput.radialDomain c.shapedF_smooth hp.1 |
| 656 | have hdV := shapeValue_hasDerivAt_x A.normalization c.shapeTime c.initialShape hX0 eta |
| 657 | have he := deriv_eqOn_Iic hR hdP.differentiableAt hdS.differentiableAt |
| 658 | (fun s hs => (profiles_before_restore c hsep (p := (s, eta)) hs).2) |
| 659 | have hv := deriv_eqOn_Ici hX hdS.differentiableAt hdV.differentiableAt |
| 660 | (fun s hs => shapedF_value c hs hη) |
| 661 | rw [hdP.deriv, hv, hdV.deriv] at he |
| 662 | rw [he, profiles_shape_value c hsep hX hR hη] |
| 663 | |
| 664 | theorem profiles_shape_logSlope {X eta : ℝ} (hX : NominalProfile.Xi ≤ X) |
| 665 | (hR : X ≤ c.radius * Real.exp (-8)) (hη : eta ∈ ReferencePath.parameterInterval) |
| 666 | (hsmall : NominalProfile.SmallDebt F c.debt eta) : |
| 667 | ReferenceBounds.logSlope (c.profiles hsep) (X, eta) = |
| 668 | ShapeTransition.logarithmicSlope c.shapeTime c.initialShape |
| 669 | (Real.log (X / NominalProfile.Xi), eta) := by |
| 670 | have hX0 := NominalProfile.Xi_pos.trans_le hX |
| 671 | have hf := profiles_shape_positive c hsep hX0.le hR hη |
| 672 | unfold ReferenceBounds.logSlope |
| 673 | rw [profiles_shape_radialF c hsep hX hR hη hsmall] |
| 674 | dsimp only |
| 675 | field_simp ; ring |
| 676 | |
| 677 | theorem profiles_shape_gradient {X eta : ℝ} (hX : NominalProfile.Xi ≤ X) |
| 678 | (hR : X ≤ c.radius * Real.exp (-8)) (hη : eta ∈ ReferencePath.parameterInterval) |
| 679 | (hsmall : NominalProfile.SmallDebt F c.debt eta) : |
| 680 | parameterPartial (c.profiles hsep).f (X, eta) / (c.profiles hsep).f (X, eta) = |
| 681 | (1 - OutgoingSchedule.sigma (Real.log (X / NominalProfile.Xi) / c.shapeTime)) * |
| 682 | deriv c.initialShape eta - |
| 683 | OutgoingSchedule.sigma (Real.log (X / NominalProfile.Xi) / c.shapeTime) * |
| 684 | OutgoingEntranceCone.shapeGradient eta := by |
| 685 | have hX0 := NominalProfile.Xi_pos.trans_le hX |
| 686 | have hp := c.admissible_nonnegative (p := (X, eta)) hX0.le hη hsmall |
| 687 | have hf := profiles_shape_positive c hsep hX0.le hR hη |
| 688 | have hdP := parameterPartial_hasDerivAt c.admissibleDomain (c.profiles hsep).f_smooth hp |
| 689 | have hdV := shapeValue_hasDerivAt_eta A.normalization c.shapeTime |
| 690 | (X := X) ((c.initialShape_smooth.contDiffAt |
| 691 | (ReferencePath.parameterInterval_open.mem_nhds hη)).differentiableAt (by simp)) |
| 692 | have he : (fun e => (c.profiles hsep).f (X, e)) =ᶠ[𝓝 eta] |
| 693 | shapeValue A.normalization c.shapeTime c.initialShape X := by |
| 694 | filter_upwards [ReferencePath.parameterInterval_open.mem_nhds hη] with e he |
| 695 | exact profiles_shape_value c hsep hX hR he |
| 696 | have he' := he.deriv_eq |
| 697 | rw [hdP.deriv, hdV.deriv] at he' |
| 698 | rw [he', ← profiles_shape_value c hsep hX hR hη, mul_div_cancel_left₀ _ hf.ne'] |
| 699 | |
| 700 | end ShapeCoordinates |
| 701 | |
| 702 | noncomputable def shapeConstant {F : OutgoingProfile.Profile} {j : ℝ} |
| 703 | (prep : NominalProfile.AxisPreparation F j) : ℝ := |
| 704 | 1 + ReferenceJetBounds.jetConstant prep.inputs.coefficients 0 0 + |
| 705 | 9 * ReferenceJetBounds.jetConstant prep.inputs.coefficients 0 1 |
| 706 | |
| 707 | theorem shapeConstant_one {F : OutgoingProfile.Profile} {j : ℝ} |
| 708 | (prep : NominalProfile.AxisPreparation F j) : 1 ≤ shapeConstant prep := by |
| 709 | have h0 := ReferenceJetBounds.jetConstant_nonneg prep.inputs.coefficients 0 0 |
| 710 | have h1 := ReferenceJetBounds.jetConstant_nonneg prep.inputs.coefficients 0 1 |
| 711 | unfold shapeConstant |
| 712 | linarith |
| 713 | |
| 714 | /-- The shape-source scale depends on the fixed natural-axis data, before |
| 715 | the normalization or continuation controls are chosen. -/ |
| 716 | noncomputable def shapeScale {F : OutgoingProfile.Profile} {j : ℝ} |
| 717 | (hj : SmallParameters F.data.h j) (prep : NominalProfile.AxisPreparation F j) : ℝ := |
| 718 | max 1 (max |
| 719 | (AxisReference.stabilityScale prep.inputs.coefficients.epsilon |
| 720 | (NaturalProfile.profileErrorConstant prep.inputs)) |
| 721 | (Classical.choose (actual_shape_source_threshold hj prep.sigma_pos (shapeConstant_one prep)))) |
| 722 | |
| 723 | theorem shapeScale_one {F : OutgoingProfile.Profile} {j : ℝ} |
| 724 | (hj : SmallParameters F.data.h j) (prep : NominalProfile.AxisPreparation F j) : |
| 725 | 1 ≤ shapeScale hj prep := le_max_left _ _ |
| 726 | |
| 727 | section ActualShapeCone |
| 728 | |
| 729 | variable {F : OutgoingProfile.Profile} {A : NominalProfile.AxisStage F} |
| 730 | (c : NominalProfile.Controls A) (hsep : c.separation ≤ Real.exp (-8)) |
| 731 | |
| 732 | theorem actual_shape_source {eps X eta : ℝ} |
| 733 | (hscale : shapeScale A.small A.preparation ≤ A.scale) |
| 734 | (hc : MatchingDebtBounds.SmallControl c 1 eps) (heps : 0 ≤ eps) |
| 735 | (heps1 : eps ≤ min 1 (1 / A.scale)) |
| 736 | (hX : NominalProfile.Xi ≤ X) (hR : X ≤ c.radius * Real.exp (-8)) |
| 737 | (hη : eta ∈ Icc (-1 : ℝ) 1) (hsmall : NominalProfile.SmallDebt F c.debt eta) |
| 738 | (hl : ReferenceBounds.logSlope (c.profiles hsep) (X, eta) ∈ |
| 739 | Icc (11 / 20 : ℝ) (13 / 20)) : |
| 740 | (5 / 4 : ℝ) < ReferenceBounds.sourceQ (c.profiles hsep) F.data.h (X, eta) := by |
| 741 | have hnatural : AxisReference.stabilityScale A.preparation.inputs.coefficients.epsilon |
| 742 | (NaturalProfile.profileErrorConstant A.preparation.inputs) ≤ A.scale := |
| 743 | (le_max_left _ _).trans ((le_max_right _ _).trans hscale) |
| 744 | have hthreshold := Classical.choose_spec |
| 745 | (actual_shape_source_threshold A.small A.preparation.sigma_pos (shapeConstant_one A.preparation)) |
| 746 | have hM : Classical.choose |
| 747 | (actual_shape_source_threshold A.small A.preparation.sigma_pos (shapeConstant_one A.preparation)) ≤ A.scale := |
| 748 | (le_max_right _ _).trans ((le_max_right _ _).trans hscale) |
| 749 | have hjets := profiles_source_jets c hsep hc heps le_rfl |
| 750 | (NominalProfile.Xi_pos.le.trans hX) hR hη hsmall |
| 751 | have hgrad := initialShape_gradient_bound c hc le_rfl hnatural hη |
| 752 | have h0 := ReferenceJetBounds.jetConstant_nonneg A.preparation.inputs.coefficients 0 0 |
| 753 | have h1 := ReferenceJetBounds.jetConstant_nonneg A.preparation.inputs.coefficients 0 1 |
| 754 | have he1 : eps ≤ 1 := heps1.trans (min_le_left _ _) |
| 755 | have heL : A.scale * eps ≤ 1 := by |
| 756 | have hh := (le_div_iff₀ A.scale_pos).mp (heps1.trans (min_le_right _ _)) |
| 757 | linarith |
| 758 | let theta := OutgoingSchedule.sigma (Real.log (X / NominalProfile.Xi) / c.shapeTime) |
| 759 | let g := deriv c.initialShape eta - A.scale * NaturalAxisCoefficients.realGradient |
| 760 | F.data.h A.j A.preparation.sigma eta |
| 761 | apply hthreshold.2 A.scale hM (c.profiles hsep) (X, eta) theta |
| 762 | (ReferenceBounds.logSlope (c.profiles hsep) (X, eta)) g hη |
| 763 | ⟨OutgoingSchedule.sigma_nonneg _, OutgoingSchedule.sigma_le_one _⟩ hl rfl |
| 764 | · rw [profiles_shape_gradient c hsep hX hR |
| 765 | (NaturalAxisCoefficients.original_interval_interior hη) hsmall] |
| 766 | dsimp only [g, theta] |
| 767 | ring |
| 768 | · exact hjets.1.trans (by unfold shapeConstant; linarith) |
| 769 | · exact hjets.2.1.trans (by unfold shapeConstant; linarith) |
| 770 | · exact hjets.2.2.trans (by unfold shapeConstant; linarith) |
| 771 | · exact hgrad.trans (by unfold shapeConstant; linarith) |
| 772 | |
| 773 | /-- The actual shape interval satisfies the relaxed cone. The sole stock |
| 774 | input is the incoming value at `Xi`, supplied by the same continuation |
| 775 | witness; the angular source and its propagation are proved here. -/ |
| 776 | theorem actual_shape_relaxed {N : ℕ} {rho eps X eta : ℝ} |
| 777 | (hm : MatchingDebtBounds.MatchingBounds c N rho) |
| 778 | (hrho : rho ≤ NominalProfile.resetSolver.radius) |
| 779 | (hscale : shapeScale A.small A.preparation ≤ A.scale) |
| 780 | (hc : MatchingDebtBounds.SmallControl c 1 eps) (heps : 0 ≤ eps) |
| 781 | (heps1 : eps ≤ min 1 (1 / A.scale)) |
| 782 | (hX : NominalProfile.Xi ≤ X) (hR : X ≤ c.radius * Real.exp (-8)) |
| 783 | (hη : eta ∈ Icc (-1 : ℝ) 1) |
| 784 | (hinit : 2 < ReferenceBounds.p1 (c.profiles hsep) F.data.h (NominalProfile.Xi, eta)) : |
| 785 | 2 < ReferenceBounds.p1 (c.profiles hsep) F.data.h (X, eta) ∧ |
| 786 | ActivationContinuation.IsRelaxed (c.profiles hsep) F.data.h (X, eta) := by |
| 787 | have hsmall := hm.smallDebt hrho hη |
| 788 | have hηJ := NaturalAxisCoefficients.original_interval_interior hη |
| 789 | have hL := L_pos A.small hη |
| 790 | have hL1 : L F.data.h eta ≤ 1 := by |
| 791 | unfold L |
| 792 | nlinarith [A.small.h_pos, sq_nonneg eta] |
| 793 | have hmem : ∀ s ∈ Icc NominalProfile.Xi X, (s, eta) ∈ c.admissibleDomain.carrier := by |
| 794 | intro s hs |
| 795 | exact c.admissible_nonnegative (p := (s, eta)) (NominalProfile.Xi_pos.le.trans hs.1) hηJ hsmall |
| 796 | have hf : ∀ s ∈ Icc NominalProfile.Xi X, 0 < (c.profiles hsep).f (s, eta) := by |
| 797 | intro s hs |
| 798 | exact profiles_shape_positive c hsep (NominalProfile.Xi_pos.le.trans hs.1) |
| 799 | (hs.2.trans hR) hηJ |
| 800 | have hl : ∀ s ∈ Icc NominalProfile.Xi X, |
| 801 | ReferenceBounds.logSlope (c.profiles hsep) (s, eta) ∈ Icc (11 / 20 : ℝ) (13 / 20) := by |
| 802 | intro s hs |
| 803 | rw [profiles_shape_logSlope c hsep hs.1 (hs.2.trans hR) hηJ hsmall, |
| 804 | ShapeTransition.logarithmicSlope_eq A.normalization] |
| 805 | exact hm.shape_slope _ eta hη |
| 806 | have hq : ∀ s ∈ Icc NominalProfile.Xi X, |
| 807 | 1 < ReferenceBounds.sourceQ (c.profiles hsep) F.data.h (s, eta) := by |
| 808 | intro s hs |
| 809 | exact (by norm_num : (1 : ℝ) < 5 / 4).trans |
| 810 | (actual_shape_source c hsep hscale hc heps heps1 hs.1 (hs.2.trans hR) hη hsmall (hl s hs)) |
| 811 | have hp := angular_barrier (c.profiles hsep) (by norm_num [NominalProfile.Xi]) hX hL hL1 |
| 812 | hmem hf (fun s hs => (hl s hs).2.trans (by norm_num)) hq hinit |
| 813 | refine ⟨hp, ?_⟩ |
| 814 | have hls := hl X ⟨hX, le_rfl⟩ |
| 815 | have he := ActivationContinuation.logSlope_eq_shear (c.profiles hsep) (X, eta) |
| 816 | exact ActivationContinuation.zero_axial_relaxed_profile (c.profiles hsep) |
| 817 | (by linarith [hls.1, hls.2]) (by linarith [hls.1, hls.2]) |
| 818 | (profiles_shape_radialU c hsep hX hR hηJ hsmall) hp |
| 819 | |
| 820 | end ActualShapeCone |
| 821 | |
| 822 | /-- Quantitative inputs for the shape and repair regions, obtained together |
| 823 | from one continuation. The endpoint drift is controlled separately from the |
| 824 | vanishing prefix debt. -/ |
| 825 | structure PreparedBounds {F : OutgoingProfile.Profile} {A : NominalProfile.AxisStage F} |
| 826 | (c : NominalProfile.Controls A) (N : ℕ) (rho delta radiusFloor : ℝ) : Prop where |
| 827 | matching : MatchingDebtBounds.MatchingBounds c N rho |
| 828 | debt_radius : rho ≤ NominalProfile.resetSolver.radius |
| 829 | scale_large : shapeScale A.small A.preparation ≤ A.scale |
| 830 | control : MatchingDebtBounds.SmallControl c 1 (min 1 (1 / A.scale)) |
| 831 | radius_large : radiusFloor ≤ c.radius |
| 832 | coefficients : JetBounds.FiniteJetBound N (NominalProfile.resetCoefficients F c.debt) |
| 833 | (Icc (-1 : ℝ) 1) delta |
| 834 | endpoint : ∀ eta ∈ Icc (-1 : ℝ) 1, ∀ n ≤ N, |
| 835 | |iteratedDeriv n (fun e => c.initialAxial e - 4 * e) eta| ≤ delta |
| 836 | |
| 837 | theorem PreparedBounds.shape_relaxed {F : OutgoingProfile.Profile} {A : NominalProfile.AxisStage F} |
| 838 | {c : NominalProfile.Controls A} {N : ℕ} {rho delta radiusFloor : ℝ} |
| 839 | (hb : PreparedBounds c N rho delta radiusFloor) {X eta : ℝ} |
| 840 | (hX : NominalProfile.Xi ≤ X) (hR : X ≤ c.radius * Real.exp (-8)) |
| 841 | (hη : eta ∈ Icc (-1 : ℝ) 1) |
| 842 | (hinit : 2 < ReferenceBounds.p1 (c.profiles hb.matching.separation.le) |
| 843 | F.data.h (NominalProfile.Xi, eta)) : |
| 844 | ActivationContinuation.IsRelaxed (c.profiles hb.matching.separation.le) F.data.h (X, eta) := |
| 845 | (actual_shape_relaxed c hb.matching.separation.le hb.matching hb.debt_radius hb.scale_large |
| 846 | hb.control (le_min zero_le_one (one_div_nonneg.mpr A.scale_pos.le)) le_rfl hX hR hη hinit).2 |
| 847 | |
| 848 | /-- Ordered common-witness selection. The repair tolerance and requested |
| 849 | finite jet order are fixed before `j`; the source and endpoint scales are |
| 850 | fixed before `C`. Every sufficiently large `C` works. The same entrance |
| 851 | profile then supports every later finite control order and tolerance. -/ |
| 852 | theorem exists_ordered_prepared_continuation (F : OutgoingProfile.Profile) (N : ℕ) |
| 853 | (hN : 1 ≤ N) {delta : ℝ} (hdelta : 0 < delta) (radiusFloor : ℝ) : |
| 854 | ∃ rho : ℝ, 0 < rho ∧ ∃ jcap : ℝ, 0 < jcap ∧ jcap ≤ 1 ∧ |
| 855 | ∀ j : ℝ, |j| ≤ jcap → ∀ hj : SmallParameters F.data.h j, |
| 856 | ∀ prep : NominalProfile.AxisPreparation F j, |
| 857 | ∀ nu : ℝ, 0 < nu → |
| 858 | (∀ eta ∈ Icc (-1 : ℝ) 1, |Z F.data.h j F.axisDatum eta| ≤ nu → |
| 859 | 99 / 100 < chi F.data.h j prep.sigma eta) → |
| 860 | ∃ Λ0 : ℝ, 1 ≤ Λ0 ∧ ∀ Λ : ℝ, ∀ hΛ : 0 < Λ, Λ0 ≤ Λ → |
| 861 | ∃ T : ℝ, ∃ hT : 0 < T, ∃ C0 : ℝ, 1 ≤ C0 ∧ ∀ C : ℝ, C0 ≤ C → |
| 862 | ∃ hΛlarge : prep.scaleBound ≤ Λ, |
| 863 | ∃ hClarge : NaturalEntrance.entranceNormalization prep.inputs Λ prep.delta ≤ C, |
| 864 | ∃ E : NaturalEntrance.EntranceProfile prep.inputs Λ C, |
| 865 | ∀ J : ℕ, ∀ epsilon : ℝ, 0 < epsilon → |
| 866 | ∃ tolerance : ℝ, 0 < tolerance ∧ tolerance ≤ epsilon ∧ |
| 867 | ∃ w : ActivationContinuation.ContinuationWitness E hΛ hj F.axisDatum_contDiff |
| 868 | (max N J) tolerance, |
| 869 | let A := NominalProfile.AxisStage.ofEntrance hj prep Λ C hΛlarge hClarge E |
| 870 | let c := NominalProfile.Controls.ofContinuation A w T hT |
| 871 | PreparedBounds c N rho delta radiusFloor := by |
| 872 | obtain ⟨K, hK, hcoeff⟩ := MatchingDebtBounds.resetCoefficients_jet_control N |
| 873 | let tau := min (min 1 (NominalProfile.resetSolver.radius / 2)) (delta / (2 * K)) |
| 874 | have htau : 0 < tau := lt_min |
| 875 | (lt_min zero_lt_one (div_pos NominalProfile.resetSolver.radius_pos (by norm_num))) |
| 876 | (div_pos hdelta (by positivity)) |
| 877 | have hmax : tau ≤ min 1 (NominalProfile.resetSolver.radius / 2) := min_le_left _ _ |
| 878 | have ht1 : tau ≤ 1 := hmax.trans (min_le_left _ _) |
| 879 | have hcoefdelta : K * tau ≤ delta := by |
| 880 | have hm := (le_div_iff₀ (show 0 < 2 * K by positivity)).mp (min_le_right |
| 881 | (min 1 (NominalProfile.resetSolver.radius / 2)) (delta / (2 * K))) |
| 882 | change tau * (2 * K) ≤ delta at hm |
| 883 | nlinarith [mul_nonneg hK.le htau.le] |
| 884 | let rho := tau ^ (N + 1) |
| 885 | have hrho : 0 < rho := pow_pos htau _ |
| 886 | have hpow : rho ≤ tau := by |
| 887 | simpa only [pow_one] using pow_le_pow_of_le_one htau.le ht1 (show 1 ≤ N + 1 by omega) |
| 888 | have hradius : rho ≤ NominalProfile.resetSolver.radius := |
| 889 | hpow.trans ((hmax.trans (min_le_right _ _)).trans |
| 890 | (by linarith [NominalProfile.resetSolver.radius_pos])) |
| 891 | obtain ⟨eps, heps, heps1, hmatching⟩ := |
| 892 | MatchingDebtBounds.exists_ordered_matching_continuation F N hrho hradius |
| 893 | let jcap := min eps (delta / 3) |
| 894 | have hjcap : 0 < jcap := lt_min heps (by positivity) |
| 895 | refine ⟨rho, hrho, jcap, hjcap, (min_le_left _ _).trans heps1, ?_⟩ |
| 896 | intro j hjbound hj prep nu hnu hcut |
| 897 | obtain ⟨Lmatch, hLmatch, hmatch⟩ := |
| 898 | hmatching j (hjbound.trans (min_le_left _ _)) hj prep nu hnu hcut |
| 899 | obtain ⟨D, hD, hDb⟩ := TransitionRamp.finite_majorant |
| 900 | (fun n => ReferenceJetBounds.jetConstant prep.inputs.coefficients 0 n) N |
| 901 | let Λ0 := max Lmatch (max (shapeScale hj prep) (3 * D / delta)) |
| 902 | refine ⟨Λ0, hLmatch.trans (le_max_left _ _), ?_⟩ |
| 903 | intro Λ hΛ hΛlarge |
| 904 | have hLm : Lmatch ≤ Λ := (le_max_left _ _).trans hΛlarge |
| 905 | have hLs : shapeScale hj prep ≤ Λ := |
| 906 | (le_max_left _ _).trans ((le_max_right _ _).trans hΛlarge) |
| 907 | have hLD : 3 * D / delta ≤ Λ := |
| 908 | (le_max_right _ _).trans ((le_max_right _ _).trans hΛlarge) |
| 909 | have hjet (n : ℕ) (hn : n ≤ N) : |
| 910 | ReferenceJetBounds.jetConstant prep.inputs.coefficients 0 n / Λ ≤ delta / 3 := by |
| 911 | apply (div_le_iff₀ hΛ).mpr |
| 912 | have hmul := (div_le_iff₀ hdelta).mp hLD |
| 913 | nlinarith [hDb n hn] |
| 914 | obtain ⟨T, hT, Cmatch, hCmatch, hnorm⟩ := hmatch Λ hΛ hLm |
| 915 | obtain ⟨Cgeo, hgeo⟩ := eventually_atTop.mp |
| 916 | (NominalProfile.eventually_matching_geometry F T radiusFloor Cmatch) |
| 917 | refine ⟨T, hT, max Cmatch Cgeo, hCmatch.trans (le_max_left _ _), ?_⟩ |
| 918 | intro C hC |
| 919 | have hCm : Cmatch ≤ C := (le_max_left _ _).trans hC |
| 920 | have hCg := hgeo C ((le_max_right _ _).trans hC) |
| 921 | obtain ⟨hL, hCl, E, hcontrols⟩ := hnorm C hCm |
| 922 | refine ⟨hL, hCl, E, ?_⟩ |
| 923 | intro J epsilon hepsilon |
| 924 | let requested := min epsilon (min (1 / Λ) (delta / 3)) |
| 925 | have hrequested : 0 < requested := lt_min hepsilon (lt_min (one_div_pos.mpr hΛ) (by positivity)) |
| 926 | obtain ⟨w, hm, _hsmall⟩ := hcontrols J requested hrequested |
| 927 | let tolerance := min eps requested |
| 928 | have htol : 0 < tolerance := lt_min heps hrequested |
| 929 | have hteps : tolerance ≤ epsilon := (min_le_right _ _).trans (min_le_left _ _) |
| 930 | refine ⟨tolerance, htol, hteps, w, ?_⟩ |
| 931 | let A := NominalProfile.AxisStage.ofEntrance hj prep Λ C hL hCl E |
| 932 | let c := NominalProfile.Controls.ofContinuation A w T hT |
| 933 | have hc : MatchingDebtBounds.SmallControl c (max N J) tolerance := w.logarithmic_control |
| 934 | have htol1 : tolerance ≤ 1 := (min_le_left _ _).trans heps1 |
| 935 | have htolL : tolerance ≤ 1 / Λ := |
| 936 | (min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _)) |
| 937 | have htolD : tolerance ≤ delta / 3 := |
| 938 | (min_le_right _ _).trans ((min_le_right _ _).trans (min_le_right _ _)) |
| 939 | refine ⟨hm, hradius, hLs, ?_, hCg.2.2.1.le, ?_, ?_⟩ |
| 940 | · exact (hc.of_le (hN.trans (le_max_left _ _))).mono (le_min htol1 htolL) |
| 941 | · have hco := hcoeff c hm.separation.le tau htau hmax |
| 942 | (fun n hn eta hη => (hm.normalized_jets n hn eta hη).le) |
| 943 | exact fun n hn eta hη => (hco n hn eta hη).trans hcoefdelta |
| 944 | · intro eta hη n hn |
| 945 | have hb := MatchingDebtBounds.actual_endpoint_drift c (hc.of_le (le_max_left _ _)) hη hn |
| 946 | change _ ≤ ReferenceJetBounds.jetConstant prep.inputs.coefficients 0 n / Λ + tolerance + |j| at hb |
| 947 | have hjD : |j| ≤ delta / 3 := hjbound.trans (min_le_right _ _) |
| 948 | exact hb.trans (by linarith [hjet n hn]) |
| 949 | |
| 950 | /-- The actual entrance profile and continuation are stored, so subsequent |
| 951 | cone gluing uses the same controls that produced the small repair debt. -/ |
| 952 | structure PreparedWitness (F : OutgoingProfile.Profile) (N : ℕ) (delta radiusFloor : ℝ) where |
| 953 | axis : NominalProfile.AxisStage F |
| 954 | order : ℕ |
| 955 | order_ge : N ≤ order |
| 956 | tolerance : ℝ |
| 957 | tolerance_pos : 0 < tolerance |
| 958 | continuation : ActivationContinuation.ContinuationWitness axis.natural axis.scale_pos |
| 959 | axis.small F.axisDatum_contDiff order tolerance |
| 960 | shapeTime : ℝ |
| 961 | shapeTime_pos : 0 < shapeTime |
| 962 | rho : ℝ |
| 963 | rho_pos : 0 < rho |
| 964 | bounds : PreparedBounds |
| 965 | (NominalProfile.Controls.ofContinuation axis continuation shapeTime shapeTime_pos) |
| 966 | N rho delta radiusFloor |
| 967 | |
| 968 | noncomputable def PreparedWitness.controls {F : OutgoingProfile.Profile} {N : ℕ} |
| 969 | {delta radiusFloor : ℝ} (W : PreparedWitness F N delta radiusFloor) : |
| 970 | NominalProfile.Controls W.axis := |
| 971 | NominalProfile.Controls.ofContinuation W.axis W.continuation W.shapeTime W.shapeTime_pos |
| 972 | |
| 973 | /-- The final `j`, axis preparation, scale, normalization and continuation |
| 974 | are chosen in their required order. The incoming cone witness remains part |
| 975 | of the output, rather than being replaced by unrelated fields. -/ |
| 976 | theorem preparedWitness_exists (F : OutgoingProfile.Profile) (hP : 2 ≤ F.data.core.P) |
| 977 | (hh : F.data.h ≤ 1 / 1000) (N : ℕ) (hN : 1 ≤ N) |
| 978 | {delta : ℝ} (hdelta : 0 < delta) (radiusFloor : ℝ) : |
| 979 | Nonempty (PreparedWitness F N delta radiusFloor) := by |
| 980 | obtain ⟨rho, hrho, jcap, hjcap, _hjcap1, hchoose⟩ := |
| 981 | exists_ordered_prepared_continuation F N hN hdelta radiusFloor |
| 982 | let j := min (jcap / 2) (1 / 2000) |
| 983 | have hjpos : 0 < j := lt_min (by positivity) (by norm_num) |
| 984 | have hjbound : |j| ≤ jcap := by |
| 985 | rw [abs_of_pos hjpos] |
| 986 | exact (min_le_left _ _).trans (by linarith) |
| 987 | have hj : SmallParameters F.data.h j := |
| 988 | ⟨F.data.h_pos, hh, hjpos, (min_le_right _ _).trans (by norm_num)⟩ |
| 989 | obtain ⟨prep, hcut⟩ := NominalProfile.prepare_axis_with_cutoff F hP hj |
| 990 | obtain ⟨Λ0, hΛ0, hscale⟩ := hchoose j hjbound hj prep prep.delta prep.delta_pos hcut |
| 991 | have hΛ : 0 < Λ0 := zero_lt_one.trans_le hΛ0 |
| 992 | obtain ⟨T, hT, C0, _hC0, hnormalization⟩ := hscale Λ0 hΛ le_rfl |
| 993 | obtain ⟨hL, hC, E, hcontrols⟩ := hnormalization C0 le_rfl |
| 994 | obtain ⟨tolerance, htol, _htol1, w, hb⟩ := hcontrols 0 1 zero_lt_one |
| 995 | let A := NominalProfile.AxisStage.ofEntrance hj prep Λ0 C0 hL hC E |
| 996 | exact ⟨⟨A, max N 0, le_max_left _ _, tolerance, htol, w, T, hT, rho, hrho, hb⟩⟩ |
| 997 | |
| 998 | end NavierStokes.MatchingConeBounds |
| 999 | |
| 1000 | end |