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.ConeAlgebra |
| 2 | import NavierStokes.StressActivation |
| 3 | import NavierStokes.UniformCone |
| 4 | import NavierStokes.NaturalEntrance |
| 5 | import NavierStokes.ActivationBounds |
| 6 | import NavierStokes.ActivationStocks |
| 7 | import Mathlib.Tactic.GCongr |
| 8 | import Mathlib.Topology.UniformSpace.HeineCantor |
| 9 | |
| 10 | /-! |
| 11 | # Initial activation cone estimates |
| 12 | |
| 13 | The scalar estimates keep every error proportional to the activation itself. |
| 14 | In particular, none of their constants involves the inverse of the retained |
| 15 | damping parameter. The later results use the constructed activation fields. |
| 16 | -/ |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | namespace NavierStokes.ActivationCone |
| 21 | |
| 22 | open Set Filter |
| 23 | open scoped Topology ContDiff |
| 24 | open ConeAlgebra StressActivation ProfileHistories |
| 25 | |
| 26 | /-- Actual smooth factor in the reciprocal angular-field ratio. -/ |
| 27 | noncomputable def inverseRelativeError (L : Field) (q : ActivationBounds.ScaledPoint) : ℝ := |
| 28 | -ActivationBounds.controlledErrorFactor L q * |
| 29 | meanExp (-ActivationBounds.scaledDistance q * ActivationBounds.controlledErrorFactor L q) |
| 30 | |
| 31 | theorem inverseRelativeError_smooth {J : Set ℝ} (hJ : IsOpen J) {L : Field} |
| 32 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) : |
| 33 | ContDiffOn ℝ ∞ (inverseRelativeError L) (ActivationBounds.scaledDomain J) := |
| 34 | (ActivationBounds.controlledErrorFactor_smooth hJ hL).neg.mul |
| 35 | (meanExp_smooth.comp_contDiffOn |
| 36 | (ActivationBounds.scaledDistance_smooth.contDiffOn.neg.mul |
| 37 | (ActivationBounds.controlledErrorFactor_smooth hJ hL))) |
| 38 | |
| 39 | theorem inverse_relative_scaled_factor {T : ℝ} (hT : T ≠ 0) (κ : ℝ) |
| 40 | {J : Set ℝ} (hJ : IsOpen J) {L : Field} |
| 41 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) (u : ℝ) {η : ℝ} (hη : η ∈ J) : |
| 42 | referenceAngular L (T * u, η) / activatedAngular T κ L (T * u, η) - 1 = |
| 43 | ActivationBounds.scaledDistance ((κ, T), (u, η)) * inverseRelativeError L ((κ, T), (u, η)) := by |
| 44 | have hd := ActivationBounds.controlled_scaled_factor hT κ hJ hL u hη |
| 45 | have hrev : L (T * u, η) - controlled T κ L (T * u, η) = |
| 46 | -ActivationBounds.scaledDistance ((κ, T), (u, η)) * |
| 47 | ActivationBounds.controlledErrorFactor L ((κ, T), (u, η)) := by linarith |
| 48 | rw [referenceAngular, activatedAngular, ← Real.exp_sub, hrev, exp_sub_one] |
| 49 | unfold inverseRelativeError |
| 50 | ring |
| 51 | |
| 52 | /-- All fixed parameter jets of this actual ratio have uniform `C*y*ea` |
| 53 | bounds as the ramp width and retained damping tend to zero. -/ |
| 54 | theorem inverse_relative_uniform_jets {J K : Set ℝ} (hJ : IsOpen J) (hK : IsCompact K) |
| 55 | (hKJ : K ⊆ J) {L : Field} (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 56 | (T0 : ℝ) (n : ℕ) : |
| 57 | ∃ M : ℝ, 0 ≤ M ∧ ∀ T ∈ Ioc (0 : ℝ) T0, ∀ κ ∈ Icc (0 : ℝ) 1, |
| 58 | ∀ y ∈ Icc (0 : ℝ) T, ∀ η ∈ K, |
| 59 | |iteratedDeriv n (fun ξ => |
| 60 | referenceAngular L (y, ξ) / activatedAngular T κ L (y, ξ) - 1) η| ≤ |
| 61 | M * y * activation T κ y := by |
| 62 | apply ActivationBounds.width_uniform_jet_bound hJ hK hKJ (inverseRelativeError_smooth hJ hL) |
| 63 | intro κ T hT u η hη |
| 64 | exact inverse_relative_scaled_factor hT.ne' κ hJ hL u hη |
| 65 | |
| 66 | /-- A quantitative cone estimate retaining the small activation factor. |
| 67 | The error scale `s` is `C*y` in the activation ramp. -/ |
| 68 | theorem ramp_cone_of_errors {c B r e s P J v : ℝ} |
| 69 | (hc : 0 < c) (hr : 2 + c ≤ r) (hrB : r ≤ B) |
| 70 | (he : 0 < e) (he1 : e ≤ 1) (hs : 0 ≤ s) |
| 71 | (hsquarter : s ≤ 1 / 4) (hsc : s ≤ c / 2) |
| 72 | (hsB : (B + 1) * s ≤ 1 / 4) |
| 73 | (hP : |P - r| ≤ s * e) (hv : |v - (1 - e) * r| ≤ s * e) |
| 74 | (hJ : |J| ≤ s * e) : |
| 75 | e ≤ P - v ∧ 2 + c / 4 < P ∧ (v - 2) * J ^ 2 < 2 * (P - v) ^ 2 := by |
| 76 | have hrpos : 0 < r := by linarith |
| 77 | have hBpos : 0 < B := lt_of_lt_of_le hrpos hrB |
| 78 | obtain ⟨hPl, hPu⟩ := abs_le.mp hP |
| 79 | obtain ⟨hvl, hvu⟩ := abs_le.mp hv |
| 80 | obtain ⟨hJl, hJu⟩ := abs_le.mp hJ |
| 81 | have hse : 0 ≤ s * e := mul_nonneg hs he.le |
| 82 | have hsle : s * e ≤ s := mul_le_of_le_one_right hs he1 |
| 83 | have hrgap : 1 ≤ r - 2 * s := by linarith |
| 84 | have hgap : e ≤ P - v := by |
| 85 | have h := mul_le_mul_of_nonneg_left hrgap he.le |
| 86 | nlinarith |
| 87 | have hPgt : 2 + c / 4 < P := by linarith |
| 88 | have hvB : v - 2 ≤ B := by |
| 89 | have h := mul_nonneg he.le hrpos.le |
| 90 | nlinarith |
| 91 | have hJsq : J ^ 2 ≤ s ^ 2 * e ^ 2 := by |
| 92 | have h := mul_nonneg (show 0 ≤ s * e - J by linarith) |
| 93 | (show 0 ≤ s * e + J by linarith) |
| 94 | nlinarith |
| 95 | have hBs : B * s ≤ 1 / 4 := by nlinarith |
| 96 | have hBss : B * s ^ 2 ≤ 1 / 16 := by |
| 97 | have h := mul_le_mul_of_nonneg_right hBs hs |
| 98 | nlinarith |
| 99 | have he2 : 0 < e ^ 2 := sq_pos_of_pos he |
| 100 | have hquad : (v - 2) * J ^ 2 < 2 * (P - v) ^ 2 := calc |
| 101 | (v - 2) * J ^ 2 ≤ B * J ^ 2 := mul_le_mul_of_nonneg_right hvB (sq_nonneg J) |
| 102 | _ ≤ B * (s ^ 2 * e ^ 2) := mul_le_mul_of_nonneg_left hJsq hBpos.le |
| 103 | _ = (B * s ^ 2) * e ^ 2 := by ring |
| 104 | _ ≤ (1 / 16 : ℝ) * e ^ 2 := mul_le_mul_of_nonneg_right hBss he2.le |
| 105 | _ < 2 * e ^ 2 := by nlinarith |
| 106 | _ ≤ 2 * (P - v) ^ 2 := by nlinarith |
| 107 | exact ⟨hgap, hPgt, hquad⟩ |
| 108 | |
| 109 | /-- A small activation preserves a uniform part of the reference `v > 2` |
| 110 | margin. There is no inverse-damping loss. -/ |
| 111 | theorem collar_lower_of_errors {c B r e s v : ℝ} |
| 112 | (hc : 0 < c) (hr : 2 + c ≤ r) (hrB : r ≤ B) |
| 113 | (he : 0 ≤ e) (hs : s ≤ 1) (heB : e * (B + 1) ≤ c / 4) |
| 114 | (hv : |v - (1 - e) * r| ≤ s * e) : |
| 115 | 2 + c / 2 < v := by |
| 116 | have hl := (abs_le.mp hv).1 |
| 117 | have hm := mul_le_mul_of_nonneg_left (show r + s ≤ B + 1 by linarith) he |
| 118 | nlinarith |
| 119 | |
| 120 | /-- Combining the ramp and collar estimates gives the actual lower-root |
| 121 | criterion, including the strict lower bound on `v`. -/ |
| 122 | theorem true_collar_of_errors {c B r e s P J v : ℝ} |
| 123 | (hc : 0 < c) (hr : 2 + c ≤ r) (hrB : r ≤ B) |
| 124 | (he : 0 < e) (he1 : e ≤ 1) (hs : 0 ≤ s) |
| 125 | (hsquarter : s ≤ 1 / 4) (hsc : s ≤ c / 2) |
| 126 | (hsB : (B + 1) * s ≤ 1 / 4) (heB : e * (B + 1) ≤ c / 4) |
| 127 | (hP : |P - r| ≤ s * e) (hv : |v - (1 - e) * r| ≤ s * e) |
| 128 | (hJ : |J| ≤ s * e) : |
| 129 | e ≤ P - v ∧ 2 + c / 2 < v ∧ 2 < P ∧ v < coneBound P J := by |
| 130 | obtain ⟨hgap, _, hquad⟩ := ramp_cone_of_errors hc hr hrB he he1 hs hsquarter hsc hsB hP hv hJ |
| 131 | have hvc := collar_lower_of_errors hc hr hrB he.le (by linarith) heB hv |
| 132 | have hv2 : 2 < v := by linarith |
| 133 | have hcone := (true_cone_iff hv2).mpr ⟨by linarith, hquad⟩ |
| 134 | exact ⟨hgap, hvc, hcone⟩ |
| 135 | |
| 136 | /-- A single error tolerance is chosen from the fixed reference bounds. -/ |
| 137 | noncomputable def errorTolerance (c B : ℝ) : ℝ := |
| 138 | min (1 / 4) (min (c / 2) (1 / (4 * (B + 1)))) |
| 139 | |
| 140 | theorem errorTolerance_pos {c B : ℝ} (hc : 0 < c) (hB : 0 ≤ B) : |
| 141 | 0 < errorTolerance c B := by |
| 142 | unfold errorTolerance |
| 143 | exact lt_min (by norm_num) (lt_min (by positivity) (by positivity)) |
| 144 | |
| 145 | theorem errorTolerance_bounds {c B s : ℝ} (hB : 0 ≤ B) (hs : s ≤ errorTolerance c B) : |
| 146 | s ≤ 1 / 4 ∧ s ≤ c / 2 ∧ (B + 1) * s ≤ 1 / 4 := by |
| 147 | have h1 : s ≤ 1 / 4 := hs.trans (min_le_left _ _) |
| 148 | have h2 : s ≤ c / 2 := hs.trans ((min_le_right _ _).trans (min_le_left _ _)) |
| 149 | have h3 : s ≤ 1 / (4 * (B + 1)) := |
| 150 | hs.trans ((min_le_right _ _).trans (min_le_right _ _)) |
| 151 | have hp : 0 < 4 * (B + 1) := by positivity |
| 152 | have hm := (le_div_iff₀ hp).mp h3 |
| 153 | refine ⟨h1, h2, ?_⟩ |
| 154 | nlinarith |
| 155 | |
| 156 | /-- Positivity of the actual flat activation on the nonzero ramp. -/ |
| 157 | theorem activation_pos {T κ y : ℝ} (hT : 0 < T) (hκ : κ < 1) (hy : 0 < y) : |
| 158 | 0 < activation T κ y := by |
| 159 | unfold activation OutgoingSchedule.sigma |
| 160 | exact mul_pos (sub_pos.mpr hκ) |
| 161 | (div_pos (FlatCutoff.edge_pos 1 (div_pos hy hT)) (OutgoingSchedule.sigma_denom_pos _)) |
| 162 | |
| 163 | /-- For any requested small activation, a fixed fraction of the ramp works |
| 164 | uniformly in its width and in every retained damping `κ ∈ [0,1]`. -/ |
| 165 | theorem activation_uniform_collar {m : ℝ} (hm : 0 < m) : |
| 166 | ∃ θ : ℝ, 0 < θ ∧ θ ≤ 1 ∧ ∀ T : ℝ, 0 < T → ∀ κ ∈ Icc (0 : ℝ) 1, |
| 167 | ∀ y ∈ Icc (0 : ℝ) (θ * T), activation T κ y < m := by |
| 168 | have hcont := OutgoingSchedule.sigma_contDiff.continuous.continuousAt (x := (0 : ℝ)) |
| 169 | obtain ⟨δ, hδ, hδprop⟩ := Metric.continuousAt_iff.mp hcont m hm |
| 170 | refine ⟨min (δ / 2) 1, lt_min (by positivity) zero_lt_one, min_le_right _ _, ?_⟩ |
| 171 | intro T hT κ hκ y hy |
| 172 | have hu : 0 ≤ y / T := div_nonneg hy.1 hT.le |
| 173 | have huy : y / T ≤ min (δ / 2) 1 := (div_le_iff₀ hT).mpr hy.2 |
| 174 | have hud : dist (y / T) (0 : ℝ) < δ := by |
| 175 | rw [Real.dist_eq, sub_zero, abs_of_nonneg hu] |
| 176 | have := huy.trans (min_le_left _ _) |
| 177 | linarith |
| 178 | have hsigma : OutgoingSchedule.sigma (y / T) < m := by |
| 179 | have h := hδprop hud |
| 180 | simpa only [OutgoingSchedule.sigma_zero le_rfl, Real.dist_eq, sub_zero, |
| 181 | abs_of_nonneg (OutgoingSchedule.sigma_nonneg _)] using h |
| 182 | have hact : activation T κ y ≤ OutgoingSchedule.sigma (y / T) := by |
| 183 | unfold activation |
| 184 | exact mul_le_of_le_one_left (OutgoingSchedule.sigma_nonneg _) (by linarith [hκ.1]) |
| 185 | exact hact.trans_lt hsigma |
| 186 | |
| 187 | /-- Uniform conversion of proved comparison estimates into a complete |
| 188 | initial ramp and a first true-cone collar. The constants are chosen before |
| 189 | the retained damping parameter. -/ |
| 190 | theorem uniform_ramp_from_comparison {K : Set ℝ} {r : Field} |
| 191 | {P J v : ℝ → ℝ → Field} {c B C T0 : ℝ} |
| 192 | (hc : 0 < c) (hB : 0 ≤ B) (hC : 0 ≤ C) (hT0 : 0 < T0) |
| 193 | (href : ∀ y ∈ Icc (0 : ℝ) T0, ∀ η ∈ K, 2 + c ≤ r (y, η) ∧ r (y, η) ≤ B) |
| 194 | (herr : ∀ T ∈ Ioc (0 : ℝ) T0, ∀ κ ∈ Ioo (0 : ℝ) 1, |
| 195 | ∀ y ∈ Icc (0 : ℝ) T, ∀ η ∈ K, |
| 196 | |P T κ (y, η) - r (y, η)| ≤ C * y * activation T κ y ∧ |
| 197 | |v T κ (y, η) - damping T κ y * r (y, η)| ≤ C * y * activation T κ y ∧ |
| 198 | |J T κ (y, η)| ≤ C * y * activation T κ y) : |
| 199 | ∃ Tstar θ : ℝ, 0 < Tstar ∧ Tstar ≤ T0 ∧ 0 < θ ∧ θ ≤ 1 ∧ |
| 200 | ∀ T ∈ Ioc (0 : ℝ) Tstar, ∀ κ ∈ Ioo (0 : ℝ) 1, |
| 201 | ∀ y ∈ Ioc (0 : ℝ) T, ∀ η ∈ K, |
| 202 | activation T κ y ≤ P T κ (y, η) - v T κ (y, η) ∧ |
| 203 | 2 + c / 4 < P T κ (y, η) ∧ |
| 204 | (v T κ (y, η) - 2) * J T κ (y, η) ^ 2 < |
| 205 | 2 * (P T κ (y, η) - v T κ (y, η)) ^ 2 ∧ |
| 206 | v T κ (y, η) < coneBound (P T κ (y, η)) (J T κ (y, η)) ∧ |
| 207 | (y ≤ θ * T → 2 + c / 2 < v T κ (y, η)) := by |
| 208 | have htolerance : 0 < errorTolerance c B := errorTolerance_pos hc hB |
| 209 | have hCp : 0 < C + 1 := by linarith |
| 210 | have hBp : 0 < 4 * (B + 1) := by positivity |
| 211 | obtain ⟨θ, hθ, hθone, hsmallactivation⟩ := |
| 212 | activation_uniform_collar (div_pos hc hBp) |
| 213 | let Tstar := min T0 (errorTolerance c B / (C + 1)) |
| 214 | have hTstar : 0 < Tstar := lt_min hT0 (div_pos htolerance hCp) |
| 215 | refine ⟨Tstar, θ, hTstar, min_le_left _ _, hθ, hθone, ?_⟩ |
| 216 | intro T hT κ hκ y hy η hη |
| 217 | have hTbound : T ≤ T0 := hT.2.trans (min_le_left _ _) |
| 218 | have hyT0 : y ≤ T0 := hy.2.trans hTbound |
| 219 | have herrors := herr T ⟨hT.1, hTbound⟩ κ hκ y ⟨hy.1.le, hy.2⟩ η hη |
| 220 | have hr := href y ⟨hy.1.le, hyT0⟩ η hη |
| 221 | have he : 0 < activation T κ y := activation_pos hT.1 hκ.2 hy.1 |
| 222 | have heone : activation T κ y ≤ 1 := activation_le_one T κ y ⟨hκ.1.le, hκ.2.le⟩ |
| 223 | have hs : 0 ≤ C * y := mul_nonneg hC hy.1.le |
| 224 | have hytol : y ≤ errorTolerance c B / (C + 1) := |
| 225 | hy.2.trans (hT.2.trans (min_le_right _ _)) |
| 226 | have hstol : C * y ≤ errorTolerance c B := by |
| 227 | have h := (le_div_iff₀ hCp).mp hytol |
| 228 | nlinarith |
| 229 | obtain ⟨hsq, hsc, hsB⟩ := errorTolerance_bounds hB hstol |
| 230 | have hve : |v T κ (y, η) - (1 - activation T κ y) * r (y, η)| ≤ |
| 231 | (C * y) * activation T κ y := herrors.2.1 |
| 232 | obtain ⟨hgap, hPgt, hquad⟩ := ramp_cone_of_errors hc hr.1 hr.2 he heone hs hsq hsc hsB herrors.1 hve herrors.2.2 |
| 233 | have hP2 : 2 < P T κ (y, η) := by linarith |
| 234 | have hroot : v T κ (y, η) < coneBound (P T κ (y, η)) (J T κ (y, η)) := by |
| 235 | by_cases hv2 : 2 < v T κ (y, η) |
| 236 | · exact ((true_cone_iff hv2).mpr ⟨by linarith, hquad⟩).2 |
| 237 | · exact relaxed_cone_of_le_two hP2 (le_of_not_gt hv2) |
| 238 | refine ⟨hgap, hPgt, hquad, hroot, ?_⟩ |
| 239 | intro hycollar |
| 240 | have hsmall := hsmallactivation T hT.1 κ ⟨hκ.1.le, hκ.2.le⟩ y ⟨hy.1.le, hycollar⟩ |
| 241 | have heB : activation T κ y * (B + 1) ≤ c / 4 := by |
| 242 | have h := (lt_div_iff₀ hBp).mp hsmall |
| 243 | nlinarith |
| 244 | exact collar_lower_of_errors hc hr.1 hr.2 he.le (by linarith) heB hve |
| 245 | |
| 246 | /-- Exact stress factorization when stock and shear-ratio errors carry the |
| 247 | constructed factor `y*e`. Neither component divides by the damping. -/ |
| 248 | theorem stress_factorization (F A B κ y e dA dB dR : ℝ) (hκ : κ = 1 - e) : |
| 249 | (F * ((A + y * e * dA) - κ * A), |
| 250 | F * ((B + y * e * dB) - κ * B * (1 + y * e * dR))) = |
| 251 | (e * (F * (A + y * dA)), |
| 252 | e * (F * (B + y * (dB - κ * B * dR)))) := by |
| 253 | subst κ |
| 254 | congr 1 <;> ring |
| 255 | |
| 256 | /-- The smooth extension of stress divided by the activation factor. -/ |
| 257 | noncomputable def reducedStress (F A B κ y dA dB dR : ℝ) : ℝ × ℝ := |
| 258 | (F * (A + y * dA), F * (B + y * (dB - κ * B * dR))) |
| 259 | |
| 260 | @[simp] theorem reducedStress_at_edge (F A B κ dA dB dR : ℝ) : |
| 261 | reducedStress F A B κ 0 dA dB dR = (F * A, F * B) := by |
| 262 | simp [reducedStress] |
| 263 | |
| 264 | /-- This extension is smooth without dividing by either activation or damping. -/ |
| 265 | theorem reducedStress_smooth {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 266 | {S : Set E} {F A B κ y dA dB dR : E → ℝ} |
| 267 | (hF : ContDiffOn ℝ ∞ F S) (hA : ContDiffOn ℝ ∞ A S) |
| 268 | (hB : ContDiffOn ℝ ∞ B S) (hκ : ContDiffOn ℝ ∞ κ S) |
| 269 | (hy : ContDiffOn ℝ ∞ y S) (hdA : ContDiffOn ℝ ∞ dA S) |
| 270 | (hdB : ContDiffOn ℝ ∞ dB S) (hdR : ContDiffOn ℝ ∞ dR S) : |
| 271 | ContDiffOn ℝ ∞ (fun p => reducedStress (F p) (A p) (B p) (κ p) (y p) (dA p) (dB p) (dR p)) S := |
| 272 | (hF.mul (hA.add (hy.mul hdA))).prodMk |
| 273 | (hF.mul (hB.add (hy.mul (hdB.sub ((hκ.mul hB).mul hdR))))) |
| 274 | |
| 275 | /-- A common coefficient bound makes the normalized stress direction nonzero |
| 276 | on a uniform first collar; the bound does not involve inverse damping. -/ |
| 277 | theorem reducedStress_first_positive {F A B κ y dA dB dR α M : ℝ} |
| 278 | (hF : 0 < F) (hα : 0 < α) (hA : α ≤ A) (hy : 0 ≤ y) |
| 279 | (hdA : |dA| ≤ M) (hsmall : y * M ≤ α / 2) : |
| 280 | 0 < (reducedStress F A B κ y dA dB dR).1 := by |
| 281 | apply mul_pos hF |
| 282 | have hlo := (abs_le.mp hdA).1 |
| 283 | have hm := mul_le_mul_of_nonneg_left hlo hy |
| 284 | nlinarith |
| 285 | |
| 286 | theorem reducedStress_nonzero {F A B κ y dA dB dR α M : ℝ} |
| 287 | (hF : 0 < F) (hα : 0 < α) (hA : α ≤ A) (hy : 0 ≤ y) |
| 288 | (hdA : |dA| ≤ M) (hsmall : y * M ≤ α / 2) : |
| 289 | reducedStress F A B κ y dA dB dR ≠ 0 := by |
| 290 | intro hz |
| 291 | have hpos := reducedStress_first_positive (B := B) (κ := κ) (dB := dB) (dR := dR) |
| 292 | hF hα hA hy hdA hsmall |
| 293 | rw [hz] at hpos |
| 294 | exact (lt_irrefl (0 : ℝ)) hpos |
| 295 | |
| 296 | theorem reducedStress_edge_projection (F A B κ dA dB dR : ℝ) : |
| 297 | (reducedStress F A B κ 0 dA dB dR).1 + |
| 298 | (B / A) * (reducedStress F A B κ 0 dA dB dR).2 = |
| 299 | F * (A + B ^ 2 / A) := by |
| 300 | simp only [reducedStress_at_edge] |
| 301 | ring |
| 302 | |
| 303 | /-- The true angular directional margin has a strictly positive edge limit. -/ |
| 304 | theorem reducedStress_edge_margin {F A B c κ dA dB dR : ℝ} |
| 305 | (hF : 0 < F) (hc : 0 < c) (hr : 2 + c ≤ A + B ^ 2 / A) : |
| 306 | 2 * F < (reducedStress F A B κ 0 dA dB dR).1 + |
| 307 | (B / A) * (reducedStress F A B κ 0 dA dB dR).2 := by |
| 308 | rw [reducedStress_edge_projection] |
| 309 | nlinarith |
| 310 | |
| 311 | /-- The quadratic cone gap after removing the square of the flat activation. -/ |
| 312 | noncomputable def normalizedConeGap (r v y dP dv dJ : ℝ) : ℝ := |
| 313 | 2 * (r + y * (dP - dv)) ^ 2 - (v - 2) * (y * dJ) ^ 2 |
| 314 | |
| 315 | theorem cone_gap_factorization (r e y dP dv dJ : ℝ) : |
| 316 | 2 * ((r + y * e * dP) - ((1 - e) * r + y * e * dv)) ^ 2 - |
| 317 | (((1 - e) * r + y * e * dv) - 2) * (y * e * dJ) ^ 2 = |
| 318 | e ^ 2 * normalizedConeGap r ((1 - e) * r + y * e * dv) y dP dv dJ := by |
| 319 | unfold normalizedConeGap |
| 320 | ring |
| 321 | |
| 322 | @[simp] theorem normalizedConeGap_at_edge (r v dP dv dJ : ℝ) : |
| 323 | normalizedConeGap r v 0 dP dv dJ = 2 * r ^ 2 := by |
| 324 | simp [normalizedConeGap] |
| 325 | |
| 326 | theorem normalizedConeGap_edge_positive {r : ℝ} (hr : r ≠ 0) (v dP dv dJ : ℝ) : |
| 327 | 0 < normalizedConeGap r v 0 dP dv dJ := by |
| 328 | rw [normalizedConeGap_at_edge] |
| 329 | positivity |
| 330 | |
| 331 | /-- The actual cone coordinates formed from two stock coordinates and a shear ratio. -/ |
| 332 | noncomputable def stockProjection (p q t : ℝ) : ℝ := p + q * t |
| 333 | noncomputable def stockCross (p q t : ℝ) : ℝ := q - p * t |
| 334 | |
| 335 | noncomputable def projectionError (A B z dA dB dR : ℝ) : ℝ := |
| 336 | dA + dB * (B / A) * (1 + z * dR) + (B ^ 2 / A) * dR |
| 337 | |
| 338 | noncomputable def crossError (A B z dA dB dR : ℝ) : ℝ := |
| 339 | dB - B * dR - dA * (B / A) * (1 + z * dR) |
| 340 | |
| 341 | noncomputable def sizeError (κ A B z dR : ℝ) : ℝ := |
| 342 | κ * (B ^ 2 / A) * dR * (2 + z * dR) |
| 343 | |
| 344 | /-- Passing from stock errors to cone errors preserves the exact common |
| 345 | factor. This computation contains no division by the damping `κ`. -/ |
| 346 | theorem cone_error_factorizations (κ A B z dA dB dR : ℝ) (hA : A ≠ 0) : |
| 347 | stockProjection (A + z * dA) (B + z * dB) ((B / A) * (1 + z * dR)) - |
| 348 | (A + B ^ 2 / A) = z * projectionError A B z dA dB dR ∧ |
| 349 | stockCross (A + z * dA) (B + z * dB) ((B / A) * (1 + z * dR)) = |
| 350 | z * crossError A B z dA dB dR ∧ |
| 351 | κ * (A + (B ^ 2 / A) * (1 + z * dR) ^ 2) - κ * (A + B ^ 2 / A) = |
| 352 | z * sizeError κ A B z dR := by |
| 353 | dsimp [stockProjection, stockCross, projectionError, crossError, sizeError] |
| 354 | constructor |
| 355 | · field_simp [hA] |
| 356 | ring |
| 357 | constructor <;> field_simp [hA] <;> ring |
| 358 | |
| 359 | noncomputable def comparisonConstant (M : ℝ) : ℝ := M + 2 * M ^ 2 + M ^ 3 |
| 360 | |
| 361 | /-- One bound for the transported error factors, depending only on the |
| 362 | reference and primitive-factor bounds. It is uniform down to `κ = 0`. -/ |
| 363 | theorem cone_error_bounds {κ A B z dA dB dR M : ℝ} |
| 364 | (hM : 0 ≤ M) (hκ : |κ| ≤ 1) (hz : |z| ≤ 1) |
| 365 | (hB : |B| ≤ M) (hBA : |B / A| ≤ M) (hB2A : |B ^ 2 / A| ≤ M) |
| 366 | (hdA : |dA| ≤ M) (hdB : |dB| ≤ M) (hdR : |dR| ≤ M) : |
| 367 | |projectionError A B z dA dB dR| ≤ comparisonConstant M ∧ |
| 368 | |crossError A B z dA dB dR| ≤ comparisonConstant M ∧ |
| 369 | |sizeError κ A B z dR| ≤ comparisonConstant M := by |
| 370 | have hzr : |z * dR| ≤ M := by |
| 371 | rw [abs_mul] |
| 372 | simpa only [one_mul] using mul_le_mul hz hdR (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 373 | have h1 : |1 + z * dR| ≤ 1 + M := (abs_add_le _ _).trans (by simpa using add_le_add_right hzr 1) |
| 374 | have h2 : |2 + z * dR| ≤ 2 + M := (abs_add_le _ _).trans (by simpa using add_le_add_right hzr 2) |
| 375 | refine ⟨?_, ?_, ?_⟩ |
| 376 | · calc |
| 377 | |projectionError A B z dA dB dR| ≤ |
| 378 | |dA| + |dB| * |B / A| * |1 + z * dR| + |B ^ 2 / A| * |dR| := by |
| 379 | exact (abs_add_le _ _).trans (add_le_add_left (abs_add_le _ _) _) |
| 380 | |>.trans_eq (by simp only [abs_mul]) |
| 381 | _ ≤ M + M * M * (1 + M) + M * M := by gcongr |
| 382 | _ = comparisonConstant M := by unfold comparisonConstant; ring |
| 383 | · calc |
| 384 | |crossError A B z dA dB dR| ≤ |
| 385 | |dB| + |B| * |dR| + |dA| * |B / A| * |1 + z * dR| := by |
| 386 | exact (abs_sub _ _).trans (add_le_add_left (abs_sub _ _) _) |
| 387 | |>.trans_eq (by simp only [abs_mul]) |
| 388 | _ ≤ M + M * M + M * M * (1 + M) := by gcongr |
| 389 | _ = comparisonConstant M := by unfold comparisonConstant; ring |
| 390 | · calc |
| 391 | |sizeError κ A B z dR| = |κ| * |B ^ 2 / A| * |dR| * |2 + z * dR| := by |
| 392 | simp only [sizeError, abs_mul] |
| 393 | _ ≤ 1 * M * M * (2 + M) := by gcongr |
| 394 | _ ≤ comparisonConstant M := by unfold comparisonConstant; nlinarith |
| 395 | |
| 396 | private theorem bounded_error_factor {M z x : ℝ} (hM : 0 ≤ M) (hz : 0 ≤ z) |
| 397 | (hx : |x| ≤ M * z) : ∃ d : ℝ, |d| ≤ M ∧ x = z * d := by |
| 398 | by_cases hz0 : z = 0 |
| 399 | · have hx0 : x = 0 := abs_nonpos_iff.mp (by simpa only [hz0, mul_zero] using hx) |
| 400 | exact ⟨0, by simpa using hM, by simp [hx0]⟩ |
| 401 | · have hzp : 0 < z := lt_of_le_of_ne hz (Ne.symm hz0) |
| 402 | refine ⟨x / z, ?_, ?_⟩ |
| 403 | · rw [abs_div, abs_of_pos hzp] |
| 404 | exact (div_le_iff₀ hzp).mpr hx |
| 405 | · field_simp |
| 406 | |
| 407 | /-- Explicit transport of actual stock and reciprocal-field error bounds to |
| 408 | the three cone-coordinate error bounds. -/ |
| 409 | theorem cone_comparison_from_stock_bounds {κ A B z p q R M : ℝ} |
| 410 | (hM : 0 ≤ M) (hA : A ≠ 0) (hκ : |κ| ≤ 1) (hz : 0 ≤ z) (hz1 : z ≤ 1) |
| 411 | (hB : |B| ≤ M) (hBA : |B / A| ≤ M) (hB2A : |B ^ 2 / A| ≤ M) |
| 412 | (hp : |p - A| ≤ M * z) (hq : |q - B| ≤ M * z) (hR : |R - 1| ≤ M * z) : |
| 413 | |stockProjection p q ((B / A) * R) - (A + B ^ 2 / A)| ≤ comparisonConstant M * z ∧ |
| 414 | |κ * (A + (B ^ 2 / A) * R ^ 2) - κ * (A + B ^ 2 / A)| ≤ comparisonConstant M * z ∧ |
| 415 | |stockCross p q ((B / A) * R)| ≤ comparisonConstant M * z := by |
| 416 | obtain ⟨dA, hdA, hda⟩ := bounded_error_factor hM hz hp |
| 417 | obtain ⟨dB, hdB, hdb⟩ := bounded_error_factor hM hz hq |
| 418 | obtain ⟨dR, hdR, hdr⟩ := bounded_error_factor hM hz hR |
| 419 | have hpval : p = A + z * dA := by linarith |
| 420 | have hqval : q = B + z * dB := by linarith |
| 421 | have hRval : R = 1 + z * dR := by linarith |
| 422 | rw [hpval, hqval, hRval] |
| 423 | obtain ⟨hfP, hfJ, hfv⟩ := cone_error_factorizations κ A B z dA dB dR hA |
| 424 | obtain ⟨hbP, hbJ, hbv⟩ := cone_error_bounds (A := A) (B := B) (z := z) |
| 425 | (dA := dA) (dB := dB) (dR := dR) hM hκ |
| 426 | (by simpa only [abs_of_nonneg hz] using hz1) hB hBA hB2A hdA hdB hdR |
| 427 | rw [hfP, hfJ, hfv] |
| 428 | simp only [abs_mul, abs_of_nonneg hz] |
| 429 | exact ⟨by nlinarith [mul_le_mul_of_nonneg_left hbP hz], |
| 430 | by nlinarith [mul_le_mul_of_nonneg_left hbv hz], |
| 431 | by nlinarith [mul_le_mul_of_nonneg_left hbJ hz]⟩ |
| 432 | |
| 433 | /-- The genuine derivative-defined shear size has the cancellation form used |
| 434 | in the error transport. -/ |
| 435 | theorem shearSize_eq (T : ℝ) {κ X0 : ℝ} (hκ : κ ∈ Ioc (0 : ℝ) 1) (hX0 : 0 < X0) |
| 436 | {J : Set ℝ} (hJ : IsOpen J) {L U : Field} |
| 437 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 438 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) (y : ℝ) {η : ℝ} (hη : η ∈ J) |
| 439 | (hA : referenceP1 L (y, η) ≠ 0) : |
| 440 | shearSize T κ X0 L U (y, η) = damping T κ y * |
| 441 | (referenceP1 L (y, η) + (referenceP2 X0 L U (y, η) ^ 2 / referenceP1 L (y, η)) * |
| 442 | (referenceAngular L (y, η) / activatedAngular T κ L (y, η)) ^ 2) := by |
| 443 | have h := shearSize_error T hκ hX0 hJ hL hU y hη hA |
| 444 | unfold referenceSize at h |
| 445 | nlinarith |
| 446 | |
| 447 | noncomputable def activatedStockOne (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) |
| 448 | (L U : Field) (T κ : ℝ) : Field := |
| 449 | ActivationStocks.logViewOne h X0 (activatedAngular T κ L) |
| 450 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) |
| 451 | |
| 452 | noncomputable def activatedStockTwo (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) |
| 453 | (L U : Field) (T κ : ℝ) : Field := |
| 454 | ActivationStocks.logViewTwo h X0 (activatedAngular T κ L) (controlled T κ U) |
| 455 | (logHistory X0 initial (activatedAngular T κ L) (controlled T κ U)) |
| 456 | |
| 457 | noncomputable def activatedProjection (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) |
| 458 | (L U : Field) (T κ : ℝ) : Field := fun p => |
| 459 | stockProjection (activatedStockOne h X0 initial L U T κ p) |
| 460 | (activatedStockTwo h X0 initial L U T κ p) (shearSlope T κ X0 L U p) |
| 461 | |
| 462 | noncomputable def activatedCross (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) |
| 463 | (L U : Field) (T κ : ℝ) : Field := fun p => |
| 464 | stockCross (activatedStockOne h X0 initial L U T κ p) |
| 465 | (activatedStockTwo h X0 initial L U T κ p) (shearSlope T κ X0 L U p) |
| 466 | |
| 467 | noncomputable def activatedStress (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) |
| 468 | (L U : Field) (T κ : ℝ) (p : Point) : ℝ × ℝ := |
| 469 | (activatedAngular T κ L p * (activatedStockOne h X0 initial L U T κ p - actualP1 T κ L p), |
| 470 | activatedAngular T κ L p * (activatedStockTwo h X0 initial L U T κ p - actualP2 T κ X0 L U p)) |
| 471 | |
| 472 | theorem reference_coordinates_smooth {X0 : ℝ} (hX0 : 0 < X0) |
| 473 | {J : Set ℝ} (hJ : IsOpen J) {L U : Field} |
| 474 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 475 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) : |
| 476 | ContDiffOn ℝ ∞ (referenceP1 L) (logDomain J hJ).carrier ∧ |
| 477 | ContDiffOn ℝ ∞ (referenceP2 X0 L U) (logDomain J hJ).carrier := by |
| 478 | have hs : ContDiff ℝ ∞ (fun p : Point => Real.sqrt (2 * radius X0 p.1)) := |
| 479 | (contDiff_const.mul (contDiff_const.mul (Real.contDiff_exp.comp contDiff_fst))).sqrt |
| 480 | (fun p => (mul_pos (by norm_num : (0 : ℝ) < 2) (mul_pos hX0 (Real.exp_pos p.1))).ne') |
| 481 | refine ⟨contDiffOn_const.mul (radialPartial_smooth (logDomain J hJ) hL), ?_⟩ |
| 482 | exact (contDiffOn_const.mul (radialPartial_smooth (logDomain J hJ) hU)).div |
| 483 | (hs.contDiffOn.mul hL.exp) (fun p _ => |
| 484 | (mul_pos (Real.sqrt_pos.mpr (mul_pos (by norm_num) (mul_pos hX0 (Real.exp_pos p.1)))) |
| 485 | (Real.exp_pos _)).ne') |
| 486 | |
| 487 | /-- The actual integral-history stress has a smooth factor after division by |
| 488 | the flat activation. Its inner-edge value is the positive reference direction. -/ |
| 489 | theorem exists_actual_stress_direction (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) |
| 490 | (initial : HistoryRow → ℝ → ℝ) {J K : Set ℝ} (hJ : IsOpen J) (hKJ : K ⊆ J) |
| 491 | {L U : Field} (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 492 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) |
| 493 | (hi : ∀ r, ContDiffOn ℝ ∞ (initial r) J) |
| 494 | (hcoef : ∀ η ∈ J, NaturalAxisData.L h η ≠ 0) {T0 : ℝ} |
| 495 | (hmatch : ∀ y ∈ Icc (0 : ℝ) T0, ∀ η ∈ K, |
| 496 | ActivationStocks.logViewOne h X0 (referenceAngular L) |
| 497 | (logHistory X0 initial (referenceAngular L) U) (y, η) = referenceP1 L (y, η) ∧ |
| 498 | ActivationStocks.logViewTwo h X0 (referenceAngular L) U |
| 499 | (logHistory X0 initial (referenceAngular L) U) (y, η) = referenceP2 X0 L U (y, η)) : |
| 500 | ∃ D : ActivationBounds.ScaledPoint → ℝ × ℝ, |
| 501 | ContDiffOn ℝ ∞ D (ActivationBounds.scaledDomain J) ∧ |
| 502 | (∀ κ T η : ℝ, D ((κ, T), (0, η)) = |
| 503 | (referenceAngular L (0, η) * referenceP1 L (0, η), |
| 504 | referenceAngular L (0, η) * referenceP2 X0 L U (0, η))) ∧ |
| 505 | ∀ T : ℝ, 0 < T → ∀ κ u η : ℝ, T * u ∈ Icc (0 : ℝ) T0 → η ∈ K → |
| 506 | activatedStress h X0 initial L U T κ (T * u, η) = |
| 507 | (activation 1 κ u * (D ((κ, T), (u, η))).1, |
| 508 | activation 1 κ u * (D ((κ, T), (u, η))).2) := by |
| 509 | obtain ⟨dA, dB, hdA, hdB, hfactors⟩ := |
| 510 | ActivationStocks.exists_log_stock_factors h hX0 initial hJ hL hU hi hcoef |
| 511 | let D : ActivationBounds.ScaledPoint → ℝ × ℝ := fun q => |
| 512 | reducedStress (ActivationBounds.angularValue L q) |
| 513 | (ActivationBounds.rescale (referenceP1 L) q) (ActivationBounds.rescale (referenceP2 X0 L U) q) |
| 514 | (damping 1 q.1.1 q.2.1) (q.1.2 * q.2.1) (dA q) (dB q) (inverseRelativeError L q) |
| 515 | refine ⟨D, ?_, ?_, ?_⟩ |
| 516 | · obtain ⟨ha, hb⟩ := reference_coordinates_smooth hX0 hJ hL hU |
| 517 | apply reducedStress_smooth |
| 518 | · exact (ActivationBounds.controlledValue_smooth hJ hL).exp |
| 519 | · exact ActivationBounds.rescale_smooth hJ ha |
| 520 | · exact ActivationBounds.rescale_smooth hJ hb |
| 521 | · exact (contDiff_const.sub ((contDiff_const.sub contDiff_fst.fst).mul |
| 522 | (OutgoingSchedule.sigma_contDiff.comp (contDiff_snd.fst.div_const 1)))).contDiffOn |
| 523 | · exact (contDiff_fst.snd.mul contDiff_snd.fst).contDiffOn |
| 524 | · exact hdA |
| 525 | · exact hdB |
| 526 | · exact inverseRelativeError_smooth hJ hL |
| 527 | · intro κ T η |
| 528 | simp [D, reducedStress, ActivationBounds.angularValue, ActivationBounds.controlledValue, |
| 529 | ActivationBounds.rescale, ActivationBounds.scaledDistance, referenceAngular] |
| 530 | · intro T hT κ u η hu hη |
| 531 | have hηJ := hKJ hη |
| 532 | obtain ⟨hfa, hfb⟩ := hfactors T hT.ne' κ u η hηJ |
| 533 | obtain ⟨hma, hmb⟩ := hmatch (T * u) hu η hη |
| 534 | rw [hma] at hfa |
| 535 | rw [hmb] at hfb |
| 536 | have hpa : activatedStockOne h X0 initial L U T κ (T * u, η) = |
| 537 | referenceP1 L (T * u, η) + T * u * activation 1 κ u * dA ((κ, T), (u, η)) := by |
| 538 | dsimp only [ActivationBounds.scaledDistance] at hfa |
| 539 | change activatedStockOne h X0 initial L U T κ (T * u, η) - _ = _ at hfa |
| 540 | linarith |
| 541 | have hpb : activatedStockTwo h X0 initial L U T κ (T * u, η) = |
| 542 | referenceP2 X0 L U (T * u, η) + T * u * activation 1 κ u * dB ((κ, T), (u, η)) := by |
| 543 | dsimp only [ActivationBounds.scaledDistance] at hfb |
| 544 | change activatedStockTwo h X0 initial L U T κ (T * u, η) - _ = _ at hfb |
| 545 | linarith |
| 546 | have hir := inverse_relative_scaled_factor hT.ne' κ hJ hL u hηJ |
| 547 | have hratio : referenceAngular L (T * u, η) / activatedAngular T κ L (T * u, η) = |
| 548 | 1 + T * u * activation 1 κ u * inverseRelativeError L ((κ, T), (u, η)) := by |
| 549 | dsimp only [ActivationBounds.scaledDistance] at hir |
| 550 | linarith |
| 551 | have hF : ActivationBounds.angularValue L ((κ, T), (u, η)) = |
| 552 | activatedAngular T κ L (T * u, η) := by |
| 553 | unfold ActivationBounds.angularValue activatedAngular |
| 554 | rw [ActivationBounds.controlledValue_eq hT.ne' κ hJ hL u hηJ] |
| 555 | have hdamp : damping T κ (T * u) = damping 1 κ u := by |
| 556 | unfold damping |
| 557 | rw [ActivationBounds.activation_scaled hT.ne'] |
| 558 | unfold activatedStress |
| 559 | rw [hpa, hpb, actualP1_eq T κ hJ hL (T * u) hηJ, |
| 560 | actualP2_eq T κ hX0 hJ hU (T * u) hηJ, hdamp, hratio] |
| 561 | dsimp only [D, ActivationBounds.rescale] |
| 562 | rw [hF] |
| 563 | exact stress_factorization _ _ _ _ _ _ _ _ _ rfl |
| 564 | |
| 565 | /-- The comparison estimates are derived from genuine log histories and |
| 566 | the constructed reciprocal-field factor. Uniform stock estimates are |
| 567 | obtained internally from their proved smooth factors. -/ |
| 568 | theorem actual_comparisons (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) |
| 569 | (initial : HistoryRow → ℝ → ℝ) {J K : Set ℝ} (hJ : IsOpen J) |
| 570 | (hK : IsCompact K) (hKJ : K ⊆ J) {L U : Field} |
| 571 | (hL : ContDiffOn ℝ ∞ L (logDomain J hJ).carrier) |
| 572 | (hU : ContDiffOn ℝ ∞ U (logDomain J hJ).carrier) |
| 573 | (hi : ∀ r, ContDiffOn ℝ ∞ (initial r) J) |
| 574 | (hcoef : ∀ η ∈ J, NaturalAxisData.L h η ≠ 0) |
| 575 | {T0 Mref : ℝ} (hT0 : T0 ≤ 1) (hMref : 0 ≤ Mref) |
| 576 | (href : ∀ y ∈ Icc (0 : ℝ) T0, ∀ η ∈ K, |
| 577 | referenceP1 L (y, η) ≠ 0 ∧ |
| 578 | |referenceP2 X0 L U (y, η)| ≤ Mref ∧ |
| 579 | |referenceP2 X0 L U (y, η) / referenceP1 L (y, η)| ≤ Mref ∧ |
| 580 | |referenceP2 X0 L U (y, η) ^ 2 / referenceP1 L (y, η)| ≤ Mref) |
| 581 | (hmatch : ∀ y ∈ Icc (0 : ℝ) T0, ∀ η ∈ K, |
| 582 | ActivationStocks.logViewOne h X0 (referenceAngular L) |
| 583 | (logHistory X0 initial (referenceAngular L) U) (y, η) = referenceP1 L (y, η) ∧ |
| 584 | ActivationStocks.logViewTwo h X0 (referenceAngular L) U |
| 585 | (logHistory X0 initial (referenceAngular L) U) (y, η) = referenceP2 X0 L U (y, η)) : |
| 586 | ∃ C : ℝ, 0 ≤ C ∧ ∀ T ∈ Ioc (0 : ℝ) T0, ∀ κ ∈ Ioo (0 : ℝ) 1, |
| 587 | ∀ y ∈ Icc (0 : ℝ) T, ∀ η ∈ K, |
| 588 | |activatedProjection h X0 initial L U T κ (y, η) - referenceSize X0 L U (y, η)| ≤ |
| 589 | C * y * activation T κ y ∧ |
| 590 | |shearSize T κ X0 L U (y, η) - damping T κ y * referenceSize X0 L U (y, η)| ≤ |
| 591 | C * y * activation T κ y ∧ |
| 592 | |activatedCross h X0 initial L U T κ (y, η)| ≤ C * y * activation T κ y := by |
| 593 | obtain ⟨Cs, hCs, hs⟩ := ActivationStocks.log_stocks_uniform_jets h hX0 initial hJ hL hU hi hcoef hK hKJ T0 0 |
| 594 | obtain ⟨Cr, hCr, hr⟩ := inverse_relative_uniform_jets hJ hK hKJ hL T0 0 |
| 595 | let M := max Mref (max Cs Cr) |
| 596 | have hM : 0 ≤ M := hMref.trans (le_max_left _ _) |
| 597 | have hrefM : Mref ≤ M := le_max_left _ _ |
| 598 | have hsM : Cs ≤ M := (le_max_left _ _).trans (le_max_right _ _) |
| 599 | have hrM : Cr ≤ M := (le_max_right _ _).trans (le_max_right _ _) |
| 600 | refine ⟨comparisonConstant M, by unfold comparisonConstant; positivity, ?_⟩ |
| 601 | intro T hT κ hκ y hy η hη |
| 602 | have hy0 : y ∈ Icc (0 : ℝ) T0 := ⟨hy.1, hy.2.trans hT.2⟩ |
| 603 | have hηJ := hKJ hη |
| 604 | have hκcc : κ ∈ Icc (0 : ℝ) 1 := ⟨hκ.1.le, hκ.2.le⟩ |
| 605 | have hκoc : κ ∈ Ioc (0 : ℝ) 1 := ⟨hκ.1, hκ.2.le⟩ |
| 606 | have he0 := activation_nonneg T κ y hκ.2.le |
| 607 | have he1 := activation_le_one T κ y hκcc |
| 608 | have hz : 0 ≤ y * activation T κ y := mul_nonneg hy.1 he0 |
| 609 | have hz1 : y * activation T κ y ≤ 1 := by |
| 610 | exact (mul_le_of_le_one_right hy.1 he1).trans (hy0.2.trans hT0) |
| 611 | have hdamp : |damping T κ y| ≤ 1 := by |
| 612 | rw [abs_of_nonneg (damping_pos T κ y hκoc).le] |
| 613 | unfold damping |
| 614 | linarith |
| 615 | obtain ⟨ha, hb, hba, hb2⟩ := href y hy0 η hη |
| 616 | obtain ⟨hm1, hm2⟩ := hmatch y hy0 η hη |
| 617 | have hsval := hs T hT κ hκcc y hy η hη |
| 618 | simp only [iteratedDeriv_zero, hm1, hm2] at hsval |
| 619 | have hpbound : |activatedStockOne h X0 initial L U T κ (y, η) - referenceP1 L (y, η)| ≤ |
| 620 | M * (y * activation T κ y) := by |
| 621 | exact hsval.1.trans (by nlinarith [mul_le_mul_of_nonneg_right hsM hz]) |
| 622 | have hqbound : |activatedStockTwo h X0 initial L U T κ (y, η) - referenceP2 X0 L U (y, η)| ≤ |
| 623 | M * (y * activation T κ y) := by |
| 624 | exact hsval.2.trans (by nlinarith [mul_le_mul_of_nonneg_right hsM hz]) |
| 625 | have hrval := hr T hT κ hκcc y hy η hη |
| 626 | simp only [iteratedDeriv_zero] at hrval |
| 627 | have hrbound : |referenceAngular L (y, η) / activatedAngular T κ L (y, η) - 1| ≤ |
| 628 | M * (y * activation T κ y) := |
| 629 | hrval.trans (by nlinarith [mul_le_mul_of_nonneg_right hrM hz]) |
| 630 | have hcomp := cone_comparison_from_stock_bounds hM ha hdamp hz hz1 |
| 631 | (hb.trans hrefM) (hba.trans hrefM) (hb2.trans hrefM) hpbound hqbound hrbound |
| 632 | unfold activatedProjection activatedCross |
| 633 | rw [shearSlope_eq T hκoc hX0 hJ hL hU y hηJ ha, |
| 634 | shearSize_eq T hκoc hX0 hJ hL hU y hηJ ha] |
| 635 | simpa only [referenceSize, mul_assoc] using hcomp |
| 636 | |
| 637 | /-- A strict initial reference margin persists on one common radial collar. |
| 638 | The collar is obtained from actual uniform continuity on a compact set. -/ |
| 639 | theorem compact_reference_collar {K : Set ℝ} (hK : IsCompact K) |
| 640 | {T c : ℝ} (hT : 0 < T) (hc : 0 < c) {r : Field} |
| 641 | (hr : ContinuousOn r (Icc (0 : ℝ) T ×ˢ K)) |
| 642 | (hzero : ∀ η ∈ K, 2 + 2 * c ≤ r (0, η)) : |
| 643 | ∃ τ : ℝ, 0 < τ ∧ τ ≤ T ∧ ∀ y ∈ Icc (0 : ℝ) τ, ∀ η ∈ K, |
| 644 | 2 + c < r (y, η) := by |
| 645 | have hu := (isCompact_Icc.prod hK).uniformContinuousOn_of_continuous hr |
| 646 | obtain ⟨δ, hδ, hδprop⟩ := Metric.uniformContinuousOn_iff.mp hu c hc |
| 647 | refine ⟨min T (δ / 2), lt_min hT (by positivity), min_le_left _ _, ?_⟩ |
| 648 | intro y hy η hη |
| 649 | have hyT : y ≤ T := hy.2.trans (min_le_left _ _) |
| 650 | have hyd : y < δ := by have := hy.2.trans (min_le_right _ _); linarith |
| 651 | have hd : dist (y, η) (0, η) < δ := by |
| 652 | simpa only [Prod.dist_eq, Real.dist_eq, sub_zero, sub_self, abs_zero, |
| 653 | abs_of_nonneg hy.1, max_eq_left hy.1] using hyd |
| 654 | have hclose := hδprop (y, η) ⟨⟨hy.1, hyT⟩, hη⟩ (0, η) ⟨⟨le_rfl, hT.le⟩, hη⟩ hd |
| 655 | have habs : |r (y, η) - r (0, η)| < c := by simpa only [Real.dist_eq] using hclose |
| 656 | have hlo := (abs_lt.mp habs).1 |
| 657 | linarith [hzero η hη] |
| 658 | |
| 659 | /-- Compact reference data provide all fixed bounds needed by the algebraic |
| 660 | error transport and a genuine common initial cone collar. -/ |
| 661 | theorem compact_reference_bounds {K : Set ℝ} (hK : IsCompact K) |
| 662 | {T c : ℝ} (hT : 0 < T) (hc : 0 < c) {A B : Field} |
| 663 | (hA : ContinuousOn A (Icc (0 : ℝ) T ×ˢ K)) |
| 664 | (hB : ContinuousOn B (Icc (0 : ℝ) T ×ˢ K)) |
| 665 | (hApos : ∀ p ∈ Icc (0 : ℝ) T ×ˢ K, 0 < A p) |
| 666 | (hzero : ∀ η ∈ K, 2 + 2 * c ≤ A (0, η) + B (0, η) ^ 2 / A (0, η)) : |
| 667 | ∃ τ α M : ℝ, 0 < τ ∧ τ ≤ T ∧ 0 < α ∧ 1 ≤ M ∧ |
| 668 | ∀ y ∈ Icc (0 : ℝ) τ, ∀ η ∈ K, |
| 669 | α ≤ A (y, η) ∧ 2 + c < A (y, η) + B (y, η) ^ 2 / A (y, η) ∧ |
| 670 | A (y, η) + B (y, η) ^ 2 / A (y, η) ≤ M ∧ |
| 671 | |B (y, η)| ≤ M ∧ |B (y, η) / A (y, η)| ≤ M ∧ |
| 672 | |B (y, η) ^ 2 / A (y, η)| ≤ M := by |
| 673 | let D := Icc (0 : ℝ) T ×ˢ K |
| 674 | have hD : IsCompact D := isCompact_Icc.prod hK |
| 675 | have hne : ∀ p ∈ D, A p ≠ 0 := fun p hp => (hApos p hp).ne' |
| 676 | have hR : ContinuousOn (fun p => A p + B p ^ 2 / A p) D := hA.add ((hB.pow 2).div hA hne) |
| 677 | obtain ⟨τ, hτ, hτT, hcollar⟩ := compact_reference_collar hK hT hc hR hzero |
| 678 | obtain ⟨α, hα, hαbound⟩ := UniformCone.positive_uniform_margin hD hA hApos |
| 679 | let g : Field := fun p => |B p| + |B p / A p| + |B p ^ 2 / A p| + |A p + B p ^ 2 / A p| |
| 680 | have hg : ContinuousOn g D := |
| 681 | ((hB.abs.add ((hB.div hA hne).abs)).add (((hB.pow 2).div hA hne).abs)).add hR.abs |
| 682 | obtain ⟨M, hM⟩ := (hD.image_of_continuousOn hg).bddAbove |
| 683 | refine ⟨τ, α, max 1 M, hτ, hτT, hα, le_max_left _ _, ?_⟩ |
| 684 | intro y hy η hη |
| 685 | have hp : (y, η) ∈ D := ⟨⟨hy.1, hy.2.trans hτT⟩, hη⟩ |
| 686 | have hb : g (y, η) ≤ max 1 M := (hM (mem_image_of_mem g hp)).trans (le_max_right _ _) |
| 687 | dsimp only [g] at hb |
| 688 | refine ⟨hαbound (y, η) hp, hcollar y hy η hη, ?_, ?_, ?_, ?_⟩ |
| 689 | · linarith [le_abs_self (A (y, η) + B (y, η) ^ 2 / A (y, η)), |
| 690 | abs_nonneg (B (y, η)), abs_nonneg (B (y, η) / A (y, η)), abs_nonneg (B (y, η) ^ 2 / A (y, η))] |
| 691 | · linarith [abs_nonneg (B (y, η) / A (y, η)), abs_nonneg (B (y, η) ^ 2 / A (y, η)), |
| 692 | abs_nonneg (A (y, η) + B (y, η) ^ 2 / A (y, η))] |
| 693 | · linarith [abs_nonneg (B (y, η)), abs_nonneg (B (y, η) ^ 2 / A (y, η)), |
| 694 | abs_nonneg (A (y, η) + B (y, η) ^ 2 / A (y, η))] |
| 695 | · linarith [abs_nonneg (B (y, η)), abs_nonneg (B (y, η) / A (y, η)), |
| 696 | abs_nonneg (A (y, η) + B (y, η) ^ 2 / A (y, η))] |
| 697 | |
| 698 | private theorem radialPartial_eq_partialY {F : Field} {p : Point} |
| 699 | (hF : ContDiffAt ℝ ∞ F p) : radialPartial F p = NaturalAxisBridge.partialY F p := by |
| 700 | have hd := (hF.differentiableAt (by simp)).hasFDerivAt.comp_hasDerivAt p.1 |
| 701 | ((hasDerivAt_id p.1).prodMk (hasDerivAt_const p.1 p.2)) |
| 702 | exact hd.deriv.symm |
| 703 | |
| 704 | section NaturalReference |
| 705 | |
| 706 | open ReferencePath |
| 707 | variable (N : ReferencePath.Input) |
| 708 | |
| 709 | theorem referenceP1_natural {δ : ℝ} (hδ : 0 < δ) (hδlim : 2 * δ < rampLimit) |
| 710 | {y η : ℝ} (hy : y ≤ δ) (hη : η ∈ parameterInterval) : |
| 711 | referenceP1 (FromReference.refLog N δ) (y, η) = |
| 712 | NaturalEntrance.p1 N.f (N.fromLog (y, η)) := by |
| 713 | have hp : (y, η) ∈ (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier := |
| 714 | ⟨show y < rampLimit by linarith, hη⟩ |
| 715 | have href := radialPartial_hasDerivAt (logDomain parameterInterval parameterInterval_open) |
| 716 | (FromReference.refLog_smooth N hδ hδlim) (p := (y, η)) ⟨mem_univ _, hη⟩ |
| 717 | have hnat := continuation_hasDerivAt rampLimit_pos hδ hδlim parameterInterval_open N.logF_smooth (p := (y, η)) hη |
| 718 | have hd : radialPartial (FromReference.refLog N δ) (y, η) = radialPartial N.logF (y, η) := by |
| 719 | simpa only [FromReference.refLog, slopeCutoff_one hδ hy, one_mul] using href.unique hnat |
| 720 | rw [referenceP1, hd, N.radialPartial_logF hp] |
| 721 | rw [radialPartial_eq_partialY (N.f_smooth.contDiffAt ((NaturalProfile.domain_isOpen N.scale).mem_nhds (N.fromLog_mem hp)))] |
| 722 | unfold NaturalEntrance.p1 |
| 723 | ring |
| 724 | |
| 725 | theorem referenceP2_natural {δ : ℝ} (hδ : 0 < δ) (hδlim : 2 * δ < rampLimit) |
| 726 | {y η : ℝ} (hy : y ≤ δ) (hη : η ∈ parameterInterval) : |
| 727 | referenceP2 N.endpoint (FromReference.refLog N δ) (FromReference.refAxial N δ) (y, η) = |
| 728 | NaturalEntrance.p2 N.f N.U (N.fromLog (y, η)) := by |
| 729 | have hp : (y, η) ∈ (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier := |
| 730 | ⟨show y < rampLimit by linarith, hη⟩ |
| 731 | have href := radialPartial_hasDerivAt (logDomain parameterInterval parameterInterval_open) |
| 732 | (FromReference.refAxial_smooth N hδ hδlim) (p := (y, η)) ⟨mem_univ _, hη⟩ |
| 733 | have hnat := continuation_hasDerivAt rampLimit_pos hδ hδlim parameterInterval_open N.logU_smooth (p := (y, η)) hη |
| 734 | have hd : radialPartial (FromReference.refAxial N δ) (y, η) = radialPartial N.logU (y, η) := by |
| 735 | simpa only [FromReference.refAxial, slopeCutoff_one hδ hy, one_mul] using href.unique hnat |
| 736 | have hf : referenceAngular (FromReference.refLog N δ) (y, η) = N.f (N.fromLog (y, η)) := by |
| 737 | unfold referenceAngular FromReference.refLog |
| 738 | rw [continuation_eq_natural rampLimit_pos hδ hδlim parameterInterval_open N.logF_smooth hη hy] |
| 739 | exact Real.exp_log (N.fromLog_f_pos hp) |
| 740 | rw [referenceP2, hd, N.radialPartial_logU hp] |
| 741 | rw [radialPartial_eq_partialY (N.U_smooth.contDiffAt ((NaturalProfile.domain_isOpen N.scale).mem_nhds (N.fromLog_mem hp)))] |
| 742 | dsimp only [velocity] |
| 743 | rw [hf] |
| 744 | dsimp only [NaturalEntrance.p2, NaturalEntrance.ns, NaturalEntrance.angularVelocity, radius, Input.fromLog] |
| 745 | ring |
| 746 | |
| 747 | theorem referenceP1_smooth {δ : ℝ} (hδ : 0 < δ) (hδlim : 2 * δ < rampLimit) : |
| 748 | ContDiffOn ℝ ∞ (referenceP1 (FromReference.refLog N δ)) |
| 749 | (logDomain parameterInterval parameterInterval_open).carrier := |
| 750 | contDiffOn_const.mul (radialPartial_smooth (logDomain parameterInterval parameterInterval_open) |
| 751 | (FromReference.refLog_smooth N hδ hδlim)) |
| 752 | |
| 753 | theorem referenceP2_smooth {δ : ℝ} (hδ : 0 < δ) (hδlim : 2 * δ < rampLimit) : |
| 754 | ContDiffOn ℝ ∞ (referenceP2 N.endpoint (FromReference.refLog N δ) (FromReference.refAxial N δ)) |
| 755 | (logDomain parameterInterval parameterInterval_open).carrier := by |
| 756 | have hs : ContDiff ℝ ∞ (fun p : Point => Real.sqrt (2 * radius N.endpoint p.1)) := |
| 757 | (contDiff_const.mul (contDiff_const.mul (Real.contDiff_exp.comp contDiff_fst))).sqrt |
| 758 | (fun p => (mul_pos (by norm_num : (0 : ℝ) < 2) (mul_pos N.endpoint_pos (Real.exp_pos p.1))).ne') |
| 759 | have he : ContDiffOn ℝ ∞ (referenceAngular (FromReference.refLog N δ)) |
| 760 | (logDomain parameterInterval parameterInterval_open).carrier := |
| 761 | Real.contDiff_exp.comp_contDiffOn (FromReference.refLog_smooth N hδ hδlim) |
| 762 | exact (contDiffOn_const.mul (radialPartial_smooth (logDomain parameterInterval parameterInterval_open) |
| 763 | (FromReference.refAxial_smooth N hδ hδlim))).div (hs.contDiffOn.mul he) |
| 764 | (fun p _ => (mul_pos (Real.sqrt_pos.mpr (mul_pos (by norm_num) (mul_pos N.endpoint_pos (Real.exp_pos p.1)))) |
| 765 | (Real.exp_pos _)).ne') |
| 766 | |
| 767 | end NaturalReference |
| 768 | |
| 769 | /-- The compact reference bounds are obtained for the actual constructed |
| 770 | natural entrance profile, not supplied as extra estimates. The reference |
| 771 | cutoff width is fixed while the later activation width is allowed to shrink. -/ |
| 772 | theorem natural_reference_bounds {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} |
| 773 | {d : NaturalAxisCoefficients.AnalyticInputs h j σ P0} |
| 774 | (hΛ : 0 < Λ) (F : NaturalEntrance.EntranceProfile d Λ C) |
| 775 | {δ : ℝ} (hδ : 0 < δ) (hδlim : 2 * δ < ReferencePath.rampLimit) : |
| 776 | let N := ReferencePath.Input.ofNatural hΛ F.profile.family |
| 777 | let A := referenceP1 (FromReference.refLog N δ) |
| 778 | let B := referenceP2 N.endpoint (FromReference.refLog N δ) (FromReference.refAxial N δ) |
| 779 | ∃ τ α M : ℝ, 0 < τ ∧ τ ≤ δ ∧ 0 < α ∧ 1 ≤ M ∧ |
| 780 | ∀ y ∈ Icc (0 : ℝ) τ, ∀ η ∈ Icc (-1 : ℝ) 1, |
| 781 | α ≤ A (y, η) ∧ 2 + 1 / 8 < A (y, η) + B (y, η) ^ 2 / A (y, η) ∧ |
| 782 | A (y, η) + B (y, η) ^ 2 / A (y, η) ≤ M ∧ |
| 783 | |B (y, η)| ≤ M ∧ |B (y, η) / A (y, η)| ≤ M ∧ |B (y, η) ^ 2 / A (y, η)| ≤ M := by |
| 784 | let N := ReferencePath.Input.ofNatural hΛ F.profile.family |
| 785 | let A := referenceP1 (FromReference.refLog N δ) |
| 786 | let B := referenceP2 N.endpoint (FromReference.refLog N δ) (FromReference.refAxial N δ) |
| 787 | have hsub : Icc (0 : ℝ) δ ×ˢ Icc (-1 : ℝ) 1 ⊆ |
| 788 | (logDomain ReferencePath.parameterInterval ReferencePath.parameterInterval_open).carrier := |
| 789 | fun p hp => ⟨mem_univ _, NaturalAxisCoefficients.original_interval_interior hp.2⟩ |
| 790 | apply compact_reference_bounds isCompact_Icc hδ (by norm_num : (0 : ℝ) < 1 / 8) |
| 791 | ((referenceP1_smooth N hδ hδlim).continuousOn.mono hsub) |
| 792 | ((referenceP2_smooth N hδ hδlim).continuousOn.mono hsub) |
| 793 | · intro p hp |
| 794 | rw [referenceP1_natural N hδ hδlim hp.1.2 (NaturalAxisCoefficients.original_interval_interior hp.2)] |
| 795 | apply F.slope_positive |
| 796 | · change (Λ * (N.fromLog p).1, p.2) ∈ NaturalEntrance.entranceSet |
| 797 | have he : Real.exp p.1 < 41 / 40 := by |
| 798 | have hy : p.1 < ReferencePath.rampLimit := by linarith [hp.1.2] |
| 799 | simpa only [ReferencePath.rampLimit, Real.exp_log (by norm_num : (0 : ℝ) < 41 / 40)] |
| 800 | using Real.exp_lt_exp.mpr hy |
| 801 | have hid : Λ * (N.fromLog p).1 = 4 * Real.exp p.1 := N.fromLog_scaled p |
| 802 | exact ⟨⟨by rw [hid]; positivity, by rw [hid]; linarith⟩, hp.2⟩ |
| 803 | · exact mul_pos N.endpoint_pos (Real.exp_pos p.1) |
| 804 | · intro η hη |
| 805 | rw [referenceP1_natural N hδ hδlim (by linarith) (NaturalAxisCoefficients.original_interval_interior hη), |
| 806 | referenceP2_natural N hδ hδlim (by linarith) (NaturalAxisCoefficients.original_interval_interior hη)] |
| 807 | have hm := F.cone_margin η hη |
| 808 | rw [show (2 + 2 * (1 / 8) : ℝ) = 9 / 4 by norm_num] |
| 809 | simpa only [NaturalEntrance.coneSize, ReferencePath.Input.fromLog, Real.exp_zero, |
| 810 | mul_one, N, ReferencePath.Input.endpoint, ReferencePath.Input.ofNatural] using hm.le |
| 811 | |
| 812 | theorem natural_reference_log_match {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} |
| 813 | {d : NaturalAxisCoefficients.AnalyticInputs h j σ P0} |
| 814 | (hΛ : 0 < Λ) (F : NaturalProfile.ProfileFamily d Λ C) (hP0 : ContDiff ℝ ∞ P0) |
| 815 | (hsmall : NaturalAxisData.SmallParameters h j) |
| 816 | {δ : ℝ} (hδ : 0 < δ) (hδlim : 2 * δ < ReferencePath.rampLimit) |
| 817 | {y η : ℝ} (hy : y ≤ δ) (hη : η ∈ Icc (-1 : ℝ) 1) : |
| 818 | let N := ReferencePath.Input.ofNatural hΛ F |
| 819 | let L := FromReference.refLog N δ |
| 820 | let U := FromReference.refAxial N δ |
| 821 | let I := ActivationStocks.FromReference.initial N hδ hδlim P0 hP0 |
| 822 | ActivationStocks.logViewOne h N.endpoint (referenceAngular L) |
| 823 | (logHistory N.endpoint I (referenceAngular L) U) (y, η) = referenceP1 L (y, η) ∧ |
| 824 | ActivationStocks.logViewTwo h N.endpoint (referenceAngular L) U |
| 825 | (logHistory N.endpoint I (referenceAngular L) U) (y, η) = referenceP2 N.endpoint L U (y, η) := by |
| 826 | let N := ReferencePath.Input.ofNatural hΛ F |
| 827 | have hηJ := NaturalAxisCoefficients.original_interval_interior hη |
| 828 | have hm := ActivationStocks.reference_stocks_natural F hΛ hP0 hδ hδlim hsmall y hy hη |
| 829 | have hv1 := ActivationStocks.FromReference.reference_stockOne_logView N hδ hδlim h P0 hP0 y hηJ |
| 830 | have hv2 := ActivationStocks.FromReference.reference_stockTwo_logView N hδ hδlim h P0 hP0 y hηJ |
| 831 | have hn1 := referenceP1_natural N hδ hδlim hy hηJ |
| 832 | have hn2 := referenceP2_natural N hδ hδlim hy hηJ |
| 833 | exact ⟨hv1.symm.trans (hm.1.trans hn1.symm), hv2.symm.trans (hm.2.trans hn2.symm)⟩ |
| 834 | |
| 835 | /-- The initial activation assertion is proved for the actual natural entrance |
| 836 | and its actual recomputed lag histories. Both the ramp width and the first |
| 837 | collar fraction are chosen uniformly in `κ₀ ∈ (0,1)`. -/ |
| 838 | theorem natural_initial_activation {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} |
| 839 | {d : NaturalAxisCoefficients.AnalyticInputs h j σ P0} |
| 840 | (hΛ : 0 < Λ) (F : NaturalEntrance.EntranceProfile d Λ C) |
| 841 | (hP0 : ContDiff ℝ ∞ P0) (hsmall : NaturalAxisData.SmallParameters h j) |
| 842 | {δ : ℝ} (hδ : 0 < δ) (hδlim : 2 * δ < ReferencePath.rampLimit) : |
| 843 | let N := ReferencePath.Input.ofNatural hΛ F.profile.family |
| 844 | let L := FromReference.refLog N δ |
| 845 | let U := FromReference.refAxial N δ |
| 846 | let I := ActivationStocks.FromReference.initial N hδ hδlim P0 hP0 |
| 847 | ∃ Tstar θ : ℝ, 0 < Tstar ∧ Tstar ≤ δ ∧ 0 < θ ∧ θ ≤ 1 ∧ |
| 848 | ∀ T ∈ Ioc (0 : ℝ) Tstar, ∀ κ ∈ Ioo (0 : ℝ) 1, |
| 849 | ∀ y ∈ Ioc (0 : ℝ) T, ∀ η ∈ Icc (-1 : ℝ) 1, |
| 850 | activation T κ y ≤ activatedProjection h N.endpoint I L U T κ (y, η) - |
| 851 | shearSize T κ N.endpoint L U (y, η) ∧ |
| 852 | 2 + 1 / 32 < activatedProjection h N.endpoint I L U T κ (y, η) ∧ |
| 853 | (shearSize T κ N.endpoint L U (y, η) - 2) * |
| 854 | activatedCross h N.endpoint I L U T κ (y, η) ^ 2 < |
| 855 | 2 * (activatedProjection h N.endpoint I L U T κ (y, η) - |
| 856 | shearSize T κ N.endpoint L U (y, η)) ^ 2 ∧ |
| 857 | shearSize T κ N.endpoint L U (y, η) < |
| 858 | coneBound (activatedProjection h N.endpoint I L U T κ (y, η)) |
| 859 | (activatedCross h N.endpoint I L U T κ (y, η)) ∧ |
| 860 | (y ≤ θ * T → 2 + 1 / 16 < shearSize T κ N.endpoint L U (y, η)) := by |
| 861 | let N := ReferencePath.Input.ofNatural hΛ F.profile.family |
| 862 | let L := FromReference.refLog N δ |
| 863 | let U := FromReference.refAxial N δ |
| 864 | let I := ActivationStocks.FromReference.initial N hδ hδlim P0 hP0 |
| 865 | have hL := FromReference.refLog_smooth N hδ hδlim |
| 866 | have hU := FromReference.refAxial_smooth N hδ hδlim |
| 867 | have hi := ActivationStocks.FromReference.initial_smooth N hδ hδlim P0 hP0 |
| 868 | have hKJ : Icc (-1 : ℝ) 1 ⊆ ReferencePath.parameterInterval := NaturalAxisCoefficients.original_interval_interior |
| 869 | have hcoef : ∀ η ∈ ReferencePath.parameterInterval, NaturalAxisData.L h η ≠ 0 := by |
| 870 | intro η hη |
| 871 | exact (NaturalAxisCoefficients.L_pos_on_window (NaturalAxisRange.ofSmall hsmall) ⟨hη.1.le, hη.2.le⟩).ne' |
| 872 | obtain ⟨τ, α, M, hτ, hτδ, hα, hM, hb⟩ := natural_reference_bounds hΛ F hδ hδlim |
| 873 | let T0 := min τ 1 |
| 874 | have hT0 : 0 < T0 := lt_min hτ zero_lt_one |
| 875 | have hT0τ : T0 ≤ τ := min_le_left _ _ |
| 876 | have hT0δ : T0 ≤ δ := hT0τ.trans hτδ |
| 877 | have hM0 : 0 ≤ M := by linarith |
| 878 | have href : ∀ y ∈ Icc (0 : ℝ) T0, ∀ η ∈ Icc (-1 : ℝ) 1, |
| 879 | referenceP1 L (y, η) ≠ 0 ∧ |referenceP2 N.endpoint L U (y, η)| ≤ M ∧ |
| 880 | |referenceP2 N.endpoint L U (y, η) / referenceP1 L (y, η)| ≤ M ∧ |
| 881 | |referenceP2 N.endpoint L U (y, η) ^ 2 / referenceP1 L (y, η)| ≤ M := by |
| 882 | intro y hy η hη |
| 883 | have hx := hb y ⟨hy.1, hy.2.trans hT0τ⟩ η hη |
| 884 | exact ⟨(hα.trans_le hx.1).ne', hx.2.2.2⟩ |
| 885 | have hm : ∀ y ∈ Icc (0 : ℝ) T0, ∀ η ∈ Icc (-1 : ℝ) 1, |
| 886 | ActivationStocks.logViewOne h N.endpoint (referenceAngular L) |
| 887 | (logHistory N.endpoint I (referenceAngular L) U) (y, η) = referenceP1 L (y, η) ∧ |
| 888 | ActivationStocks.logViewTwo h N.endpoint (referenceAngular L) U |
| 889 | (logHistory N.endpoint I (referenceAngular L) U) (y, η) = referenceP2 N.endpoint L U (y, η) := by |
| 890 | intro y hy η hη |
| 891 | exact natural_reference_log_match hΛ F.profile.family hP0 hsmall hδ hδlim (hy.2.trans hT0δ) hη |
| 892 | obtain ⟨Cerr, hCerr, he⟩ := actual_comparisons h N.endpoint_pos I ReferencePath.parameterInterval_open |
| 893 | isCompact_Icc hKJ hL hU hi hcoef (min_le_right τ 1) hM0 href hm |
| 894 | have hr : ∀ y ∈ Icc (0 : ℝ) T0, ∀ η ∈ Icc (-1 : ℝ) 1, |
| 895 | 2 + 1 / 8 ≤ referenceSize N.endpoint L U (y, η) ∧ referenceSize N.endpoint L U (y, η) ≤ M := by |
| 896 | intro y hy η hη |
| 897 | have hx := hb y ⟨hy.1, hy.2.trans hT0τ⟩ η hη |
| 898 | exact ⟨hx.2.1.le, hx.2.2.1⟩ |
| 899 | obtain ⟨Tstar, θ, hTs, hTs0, hθ, hθ1, hcone⟩ := |
| 900 | uniform_ramp_from_comparison (by norm_num : (0 : ℝ) < 1 / 8) hM0 hCerr hT0 hr he |
| 901 | refine ⟨Tstar, θ, hTs, hTs0.trans hT0δ, hθ, hθ1, ?_⟩ |
| 902 | simpa only [show ((1 / 8 : ℝ) / 4) = 1 / 32 by norm_num, |
| 903 | show ((1 / 8 : ℝ) / 2) = 1 / 16 by norm_num] using hcone |
| 904 | |
| 905 | /-- The normalized stress of the actual activation extends smoothly to the |
| 906 | inner edge, where its first component and angular directional margin have |
| 907 | one positive lower bound, uniform in all activation parameters. -/ |
| 908 | theorem natural_activation_direction {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} |
| 909 | {d : NaturalAxisCoefficients.AnalyticInputs h j σ P0} |
| 910 | (hΛ : 0 < Λ) (F : NaturalEntrance.EntranceProfile d Λ C) |
| 911 | (hP0 : ContDiff ℝ ∞ P0) (hsmall : NaturalAxisData.SmallParameters h j) |
| 912 | {δ : ℝ} (hδ : 0 < δ) (hδlim : 2 * δ < ReferencePath.rampLimit) : |
| 913 | let N := ReferencePath.Input.ofNatural hΛ F.profile.family |
| 914 | let L := FromReference.refLog N δ |
| 915 | let U := FromReference.refAxial N δ |
| 916 | let I := ActivationStocks.FromReference.initial N hδ hδlim P0 hP0 |
| 917 | ∃ D : ActivationBounds.ScaledPoint → ℝ × ℝ, ∃ ε : ℝ, |
| 918 | ContDiffOn ℝ ∞ D (ActivationBounds.scaledDomain ReferencePath.parameterInterval) ∧ 0 < ε ∧ |
| 919 | (∀ κ T η : ℝ, η ∈ Icc (-1 : ℝ) 1 → |
| 920 | ε ≤ (D ((κ, T), (0, η))).1 ∧ |
| 921 | ε ≤ (D ((κ, T), (0, η))).1 + |
| 922 | (referenceP2 N.endpoint L U (0, η) / referenceP1 L (0, η)) * |
| 923 | (D ((κ, T), (0, η))).2 - 2 * referenceAngular L (0, η)) ∧ |
| 924 | ∀ T : ℝ, 0 < T → ∀ κ u η : ℝ, T * u ∈ Icc (0 : ℝ) δ → η ∈ Icc (-1 : ℝ) 1 → |
| 925 | activatedStress h N.endpoint I L U T κ (T * u, η) = |
| 926 | (activation 1 κ u * (D ((κ, T), (u, η))).1, |
| 927 | activation 1 κ u * (D ((κ, T), (u, η))).2) := by |
| 928 | let N := ReferencePath.Input.ofNatural hΛ F.profile.family |
| 929 | let L := FromReference.refLog N δ |
| 930 | let U := FromReference.refAxial N δ |
| 931 | let I := ActivationStocks.FromReference.initial N hδ hδlim P0 hP0 |
| 932 | let K := Icc (-1 : ℝ) 1 |
| 933 | have hL := FromReference.refLog_smooth N hδ hδlim |
| 934 | have hU := FromReference.refAxial_smooth N hδ hδlim |
| 935 | have hi := ActivationStocks.FromReference.initial_smooth N hδ hδlim P0 hP0 |
| 936 | have hKJ : K ⊆ ReferencePath.parameterInterval := NaturalAxisCoefficients.original_interval_interior |
| 937 | have hcoef : ∀ η ∈ ReferencePath.parameterInterval, NaturalAxisData.L h η ≠ 0 := by |
| 938 | intro η hη |
| 939 | exact (NaturalAxisCoefficients.L_pos_on_window (NaturalAxisRange.ofSmall hsmall) ⟨hη.1.le, hη.2.le⟩).ne' |
| 940 | have hm : ∀ y ∈ Icc (0 : ℝ) δ, ∀ η ∈ K, |
| 941 | ActivationStocks.logViewOne h N.endpoint (referenceAngular L) |
| 942 | (logHistory N.endpoint I (referenceAngular L) U) (y, η) = referenceP1 L (y, η) ∧ |
| 943 | ActivationStocks.logViewTwo h N.endpoint (referenceAngular L) U |
| 944 | (logHistory N.endpoint I (referenceAngular L) U) (y, η) = referenceP2 N.endpoint L U (y, η) := by |
| 945 | intro y hy η hη |
| 946 | exact natural_reference_log_match hΛ F.profile.family hP0 hsmall hδ hδlim hy.2 hη |
| 947 | obtain ⟨D, hD, hedge, hfactor⟩ := exists_actual_stress_direction h N.endpoint_pos I |
| 948 | ReferencePath.parameterInterval_open hKJ hL hU hi hcoef hm |
| 949 | obtain ⟨τ, α, M, hτ, _, hα, _, hb⟩ := natural_reference_bounds hΛ F hδ hδlim |
| 950 | have hmap : Set.MapsTo (fun η : ℝ => (0, η)) K |
| 951 | (logDomain ReferencePath.parameterInterval ReferencePath.parameterInterval_open).carrier := |
| 952 | fun η hη => ⟨mem_univ _, hKJ hη⟩ |
| 953 | have hA : ContinuousOn (fun η => referenceP1 L (0, η)) K := |
| 954 | (referenceP1_smooth N hδ hδlim).continuousOn.comp |
| 955 | (continuous_const.prodMk continuous_id).continuousOn hmap |
| 956 | have hB : ContinuousOn (fun η => referenceP2 N.endpoint L U (0, η)) K := |
| 957 | (referenceP2_smooth N hδ hδlim).continuousOn.comp |
| 958 | (continuous_const.prodMk continuous_id).continuousOn hmap |
| 959 | have hF : ContinuousOn (fun η => referenceAngular L (0, η)) K := |
| 960 | hL.exp.continuousOn.comp (continuous_const.prodMk continuous_id).continuousOn hmap |
| 961 | have hApos : ∀ η ∈ K, 0 < referenceP1 L (0, η) := by |
| 962 | intro η hη |
| 963 | exact hα.trans_le (hb 0 ⟨le_rfl, hτ.le⟩ η hη).1 |
| 964 | let first : ℝ → ℝ := fun η => referenceAngular L (0, η) * referenceP1 L (0, η) |
| 965 | let margin : ℝ → ℝ := fun η => referenceAngular L (0, η) * |
| 966 | (referenceP1 L (0, η) + referenceP2 N.endpoint L U (0, η) ^ 2 / referenceP1 L (0, η) - 2) |
| 967 | have hfirst : ContinuousOn first K := hF.mul hA |
| 968 | have hmargin : ContinuousOn margin K := hF.mul |
| 969 | ((hA.add ((hB.pow 2).div hA (fun η hη => (hApos η hη).ne'))).sub continuousOn_const) |
| 970 | obtain ⟨ε1, hε1, hbound1⟩ := UniformCone.positive_uniform_margin isCompact_Icc hfirst |
| 971 | (fun η hη => mul_pos (Real.exp_pos _) (hApos η hη)) |
| 972 | obtain ⟨ε2, hε2, hbound2⟩ := UniformCone.positive_uniform_margin isCompact_Icc hmargin (by |
| 973 | intro η hη |
| 974 | apply mul_pos (Real.exp_pos _) |
| 975 | have hr := (hb 0 ⟨le_rfl, hτ.le⟩ η hη).2.1 |
| 976 | linarith) |
| 977 | refine ⟨D, min ε1 ε2, hD, lt_min hε1 hε2, ?_, hfactor⟩ |
| 978 | intro κ T η hη |
| 979 | rw [hedge] |
| 980 | refine ⟨(min_le_left _ _).trans (hbound1 η hη), ?_⟩ |
| 981 | have hid : referenceAngular L (0, η) * referenceP1 L (0, η) + |
| 982 | (referenceP2 N.endpoint L U (0, η) / referenceP1 L (0, η)) * |
| 983 | (referenceAngular L (0, η) * referenceP2 N.endpoint L U (0, η)) - |
| 984 | 2 * referenceAngular L (0, η) = margin η := by |
| 985 | dsimp only [margin] |
| 986 | ring |
| 987 | exact (min_le_right _ _).trans (hid ▸ hbound2 η hη) |
| 988 | |
| 989 | end NavierStokes.ActivationCone |