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.OutgoingEntranceCone |
| 2 | import NavierStokes.ShapedWaitBounds |
| 3 | import NavierStokes.PulseCone |
| 4 | import NavierStokes.TailCone |
| 5 | import NavierStokes.OutgoingProfile |
| 6 | |
| 7 | /-! |
| 8 | # One clean outgoing cone on one reset witness |
| 9 | |
| 10 | The shaped-hold estimate below is obtained from the actual angular floor and |
| 11 | axial history. The later assembly keeps the same reset and corrected amplitude |
| 12 | through every interval. The true additional inequality starts at the shaped |
| 13 | hold; the early outgoing region only requires the relaxed cone. |
| 14 | -/ |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | open Set Filter Function MeasureTheory |
| 19 | open scoped Topology ContDiff |
| 20 | open NavierStokes.OutgoingSchedule NavierStokes.OutgoingTail |
| 21 | open NavierStokes.UniformAngularReset (ResetWitness) |
| 22 | open NavierStokes.OutgoingEntranceCone (coneA coneB coneRatio) |
| 23 | |
| 24 | namespace NavierStokes.OutgoingCone |
| 25 | |
| 26 | theorem coneA_eq_actualA {d : TailData} {K : ℝ} (w : ResetWitness d K) (y eta : ℝ) : |
| 27 | coneA w (y, eta) = TailCone.actualA w y eta := by |
| 28 | rw [OutgoingEntranceCone.coneA_eq_E_derivative] |
| 29 | have hd := ((OutgoingHistories.dY_hasDerivAt (OutgoingHistories.E_smooth w) (y, eta)).log |
| 30 | (OutgoingHistories.E_pos w (y, eta)).ne').deriv |
| 31 | unfold TailCone.actualA |
| 32 | rw [hd] |
| 33 | ring |
| 34 | |
| 35 | theorem coneB_eq_actualBs {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 36 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (y eta : ℝ) : |
| 37 | coneB w Amp (y, eta) = TailCone.actualBs w Amp y eta := by |
| 38 | rw [OutgoingEntranceCone.coneB, OutgoingHistories.dY_eq_deriv (OutgoingHistories.U_smooth d ha)] |
| 39 | rfl |
| 40 | |
| 41 | theorem hold_Qs_pos {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 42 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) {eta t : ℝ} |
| 43 | (hh1 : d.h ≤ 1 / 100) (hhlam : d.h ≤ d.core.lam / 4) |
| 44 | (hhT : d.h ≤ Real.exp (-(d.core.holdStart + 3 / 5)) / 8) |
| 45 | (heta : |eta| ≤ 1) (ht : 0 ≤ t) (htw : t ≤ d.core.wait) : |
| 46 | 0 < OutgoingHistories.Qs w Amp (d.core.holdStart + t, eta) := by |
| 47 | have hf := ShapedWaitBounds.holdFloor_pos d.core.m |
| 48 | have hl := ShapedWaitBounds.canonical_Qs_hold_lower w ha hh1 hhlam hhT heta ht htw |
| 49 | have hp : 0 < ShapedWaitBounds.holdFloor d.core.m * |
| 50 | (eta ^ 2 + d.core.lam + Real.exp (-(1 - d.core.lam) * t)) := by |
| 51 | exact mul_pos hf (by nlinarith [sq_nonneg eta, d.core.lam_pos, Real.exp_pos (-(1 - d.core.lam) * t)]) |
| 52 | exact hp.trans_le hl |
| 53 | |
| 54 | noncomputable def holdRatioConstant (P m : ℝ) : ℝ := |
| 55 | ShapedWaitBounds.axialWaitConstant P m / (2 * ShapedWaitBounds.holdFloor m) |
| 56 | |
| 57 | theorem holdRatioConstant_pos {P : ℝ} (hP : 0 < P) (m : ℝ) : 0 < holdRatioConstant P m := |
| 58 | div_pos (ShapedWaitBounds.axialWaitConstant_pos hP m) |
| 59 | (mul_pos (by norm_num) (ShapedWaitBounds.holdFloor_pos m)) |
| 60 | |
| 61 | /-- The Gaussian part of the genuine angular floor cancels the parameter |
| 62 | factor in the genuine axial history bound. -/ |
| 63 | theorem hold_ratio_bound {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 64 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) {eta t : ℝ} |
| 65 | (hh1 : d.h ≤ 1 / 100) (hhlam : d.h ≤ d.core.lam / 4) |
| 66 | (hhT : d.h ≤ Real.exp (-(d.core.holdStart + 3 / 5)) / 8) |
| 67 | (heta : |eta| ≤ 1) (ht : 0 ≤ t) (htw : t ≤ d.core.wait) : |
| 68 | |coneRatio w Amp (d.core.holdStart + t, eta)| ≤ |
| 69 | holdRatioConstant d.core.P d.core.m * (1 + t) * Real.exp (d.core.lam * t / 2) := by |
| 70 | have hc := ShapedWaitBounds.holdFloor_pos d.core.m |
| 71 | have hC := ShapedWaitBounds.axialWaitConstant_pos d.core.P_pos d.core.m |
| 72 | have hQ := hold_Qs_pos w ha hh1 hhlam hhT heta ht htw |
| 73 | have hlo := ShapedWaitBounds.canonical_Qs_hold_lower w ha hh1 hhlam hhT heta ht htw |
| 74 | have hN := ShapedWaitBounds.canonical_Ns_hold_ratio_bound w ha hh1 heta ht htw |
| 75 | let s : ℝ := Real.exp (-(1 - d.core.lam) * t / 2) |
| 76 | have hs : s ^ 2 = Real.exp (-(1 - d.core.lam) * t) := by |
| 77 | dsimp [s] |
| 78 | rw [pow_two, ← Real.exp_add] |
| 79 | congr 1 |
| 80 | ring |
| 81 | have hsq : 2 * |eta| * s ≤ eta ^ 2 + Real.exp (-(1 - d.core.lam) * t) := by |
| 82 | have hb := sq_nonneg (|eta| - s) |
| 83 | nlinarith [hs, sq_abs eta] |
| 84 | have hmul := mul_le_mul_of_nonneg_left hsq hc.le |
| 85 | have hqeta : 2 * ShapedWaitBounds.holdFloor d.core.m * |eta| * s ≤ |
| 86 | OutgoingHistories.Qs w Amp (d.core.holdStart + t, eta) := by |
| 87 | nlinarith [mul_pos hc d.core.lam_pos] |
| 88 | have hfac : 0 ≤ holdRatioConstant d.core.P d.core.m * (1 + t) * Real.exp (d.core.lam * t / 2) := |
| 89 | mul_nonneg (mul_nonneg (holdRatioConstant_pos d.core.P_pos d.core.m).le (by linarith)) (Real.exp_pos _).le |
| 90 | have hb := mul_le_mul_of_nonneg_left hqeta hfac |
| 91 | have hex : Real.exp (d.core.lam * t / 2) * s = Real.exp (-(1 / 2 - d.core.lam) * t) := by |
| 92 | dsimp [s] |
| 93 | rw [← Real.exp_add] |
| 94 | congr 1 |
| 95 | ring |
| 96 | have hid : (holdRatioConstant d.core.P d.core.m * (1 + t) * Real.exp (d.core.lam * t / 2)) * |
| 97 | (2 * ShapedWaitBounds.holdFloor d.core.m * |eta| * s) = |
| 98 | ShapedWaitBounds.axialWaitConstant d.core.P d.core.m * |eta| * (1 + t) * |
| 99 | Real.exp (-(1 / 2 - d.core.lam) * t) := by |
| 100 | rw [← hex] |
| 101 | dsimp [holdRatioConstant] |
| 102 | field_simp [hc.ne'] |
| 103 | rw [hid] at hb |
| 104 | unfold OutgoingEntranceCone.coneRatio |
| 105 | rw [← div_div, abs_div, abs_of_pos hQ] |
| 106 | exact (div_le_iff₀ hQ).mpr (hN.trans hb) |
| 107 | |
| 108 | noncomputable def holdSmallConstant (P m : ℝ) : ℝ := |
| 109 | 60 * Real.exp 30 * holdRatioConstant P m |
| 110 | |
| 111 | theorem holdSmallConstant_pos {P : ℝ} (hP : 0 < P) (m : ℝ) : 0 < holdSmallConstant P m := |
| 112 | mul_pos (mul_pos (by norm_num) (Real.exp_pos _)) (holdRatioConstant_pos hP m) |
| 113 | |
| 114 | theorem hold_sqrt_ratio_bound {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 115 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) {eta t : ℝ} |
| 116 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 117 | (hh1 : d.h ≤ 1 / 100) (hhlam : d.h ≤ d.core.lam / 4) |
| 118 | (hhT : d.h ≤ Real.exp (-(d.core.holdStart + 3 / 5)) / 8) |
| 119 | (heta : |eta| ≤ 1) (ht : 0 ≤ t) (htw : t ≤ d.core.wait) : |
| 120 | Real.sqrt d.core.lam * |coneRatio w Amp (d.core.holdStart + t, eta)| ≤ |
| 121 | holdSmallConstant d.core.P d.core.m * PulseCone.coneRate d.core.lam := by |
| 122 | have hlog : 0 ≤ Real.log (1 / d.core.lam) := Real.log_nonneg |
| 123 | ((le_div_iff₀ d.core.lam_pos).mpr (by linarith [d.core.lam_lt])) |
| 124 | have htlog : t ≤ 60 * Real.log (1 / d.core.lam) := by rwa [hwait] at htw |
| 125 | have hlin : 1 + t ≤ 60 * (1 + Real.log (1 / d.core.lam)) := by linarith |
| 126 | have hlambda := mul_le_mul_of_nonneg_left htlog d.core.lam_pos.le |
| 127 | have harg : d.core.lam * t / 2 ≤ 30 := by nlinarith [TailCone.lambda_log_bound d] |
| 128 | have hex := Real.exp_le_exp.mpr harg |
| 129 | have hb := hold_ratio_bound w ha hh1 hhlam hhT heta ht htw |
| 130 | have hC := (holdRatioConstant_pos d.core.P_pos d.core.m).le |
| 131 | have hbound := mul_le_mul hlin hex (Real.exp_pos _).le (by positivity : 0 ≤ 60 * (1 + Real.log (1 / d.core.lam))) |
| 132 | have hm := mul_le_mul_of_nonneg_left hbound hC |
| 133 | have hraw : |coneRatio w Amp (d.core.holdStart + t, eta)| ≤ |
| 134 | holdSmallConstant d.core.P d.core.m * (1 + Real.log (1 / d.core.lam)) := by |
| 135 | dsimp [holdSmallConstant] |
| 136 | nlinarith |
| 137 | have hs := mul_le_mul_of_nonneg_left hraw (Real.sqrt_nonneg d.core.lam) |
| 138 | have hr := (PulseCone.coneRate_parts d.core.lam_pos (by linarith [d.core.lam_lt])).2.2 |
| 139 | have hr' := mul_le_mul_of_nonneg_left hr (holdSmallConstant_pos d.core.P_pos d.core.m).le |
| 140 | nlinarith |
| 141 | |
| 142 | theorem exists_hold_threshold (P m : ℝ) : |
| 143 | ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ lam : ℝ, 0 < lam → lam < lam0 → |
| 144 | holdSmallConstant P m * PulseCone.coneRate lam ≤ 1 / 2 := by |
| 145 | have ht := PulseCone.coneRate_tendsto_zero.const_mul (holdSmallConstant P m) |
| 146 | have he : ∀ᶠ lam in 𝓝[>] (0 : ℝ), holdSmallConstant P m * PulseCone.coneRate lam < 1 / 2 := |
| 147 | ht.eventually (gt_mem_nhds (by norm_num : holdSmallConstant P m * (0 : ℝ) < 1 / 2)) |
| 148 | obtain ⟨delta, hd, hsub⟩ := mem_nhdsGT_iff_exists_Ioo_subset.mp he |
| 149 | exact ⟨delta, hd, fun lam hl hu => (hsub ⟨hl, hu⟩).le⟩ |
| 150 | |
| 151 | theorem hold_coneA {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta : ℝ) {y : ℝ} |
| 152 | (hy : d.core.holdStart ≤ y) (hy' : y ≤ d.core.pulseStart) : |
| 153 | coneA w (y, eta) = 2 + 2 * d.core.lam := by |
| 154 | have hend : y < d.core.endpoint := by |
| 155 | dsimp [OutgoingSchedule.Parameters.endpoint] |
| 156 | linarith [d.core.pulseLength_pos] |
| 157 | rw [OutgoingEntranceCone.coneA_before w hend] |
| 158 | dsimp [OutgoingEntranceCone.radialA] |
| 159 | rw [slope_hold d.core.dropLength_pos.le hy] |
| 160 | ring |
| 161 | |
| 162 | theorem hold_coneB {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 163 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} |
| 164 | (hy : d.core.holdStart ≤ y) (hy' : y ≤ d.core.pulseStart) : coneB w Amp (y, eta) = 0 := by |
| 165 | have hHB : d.core.holdStart < d.core.pulseStart := by |
| 166 | dsimp [OutgoingSchedule.Parameters.pulseStart] |
| 167 | linarith [d.core.wait_gt] |
| 168 | have hz : HasDerivWithinAt (fun t => OutgoingHistories.U d Amp (t, eta)) 0 |
| 169 | (Icc d.core.holdStart d.core.pulseStart) y := by |
| 170 | apply (hasDerivWithinAt_const y (Icc d.core.holdStart d.core.pulseStart) (0 : ℝ)).congr |
| 171 | · intro t ht |
| 172 | exact axial_shaped_wait d.core Amp eta ht.1 ht.2 |
| 173 | · exact axial_shaped_wait d.core Amp eta hy hy' |
| 174 | have hd := (uniqueDiffOn_Icc hHB y ⟨hy, hy'⟩).eq_deriv _ |
| 175 | (OutgoingHistories.dY_hasDerivAt (OutgoingHistories.U_smooth d ha) (y, eta)).hasDerivWithinAt hz |
| 176 | simp [OutgoingEntranceCone.coneB, hd] |
| 177 | |
| 178 | theorem hold_source_criterion {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 179 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) |
| 180 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 181 | (hh1 : d.h ≤ 1 / 100) (hhlam : d.h ≤ d.core.lam / 4) |
| 182 | (hhT : d.h ≤ Real.exp (-(d.core.holdStart + 3 / 5)) / 8) |
| 183 | (hsmall : holdSmallConstant d.core.P d.core.m * PulseCone.coneRate d.core.lam ≤ 1 / 2) |
| 184 | {eta y : ℝ} (heta : |eta| ≤ 1) (hy : d.core.holdStart ≤ y) (hy' : y ≤ d.core.pulseStart) : |
| 185 | 0 < OutgoingHistories.Qs w Amp (y, eta) ∧ |
| 186 | 0 < coneA w (y, eta) - coneB w Amp (y, eta) * coneRatio w Amp (y, eta) ∧ |
| 187 | 2 * coneB w Amp (y, eta) * coneRatio w Amp (y, eta) + |
| 188 | coneB w Amp (y, eta) ^ 2 / coneA w (y, eta) + |
| 189 | (coneA w (y, eta) - 2) * coneRatio w Amp (y, eta) ^ 2 < 2 ∧ |
| 190 | 2 < coneA w (y, eta) := by |
| 191 | have ht : 0 ≤ y - d.core.holdStart := sub_nonneg.mpr hy |
| 192 | have htw : y - d.core.holdStart ≤ d.core.wait := by |
| 193 | dsimp [OutgoingSchedule.Parameters.pulseStart] at hy' |
| 194 | linarith |
| 195 | have hsum : d.core.holdStart + (y - d.core.holdStart) = y := by ring |
| 196 | have hq := hold_Qs_pos w ha hh1 hhlam hhT heta ht htw |
| 197 | rw [hsum] at hq |
| 198 | have hr := (hold_sqrt_ratio_bound w ha hwait hh1 hhlam hhT heta ht htw).trans hsmall |
| 199 | rw [hsum] at hr |
| 200 | have hpow : d.core.lam * coneRatio w Amp (y, eta) ^ 2 ≤ 1 / 4 := by |
| 201 | have hp := Real.sq_sqrt d.core.lam_pos.le |
| 202 | have hab : |coneRatio w Amp (y, eta)| ^ 2 = coneRatio w Amp (y, eta) ^ 2 := sq_abs _ |
| 203 | have hnonneg := mul_nonneg (Real.sqrt_nonneg d.core.lam) (abs_nonneg (coneRatio w Amp (y, eta))) |
| 204 | nlinarith [sq_nonneg (Real.sqrt d.core.lam * |coneRatio w Amp (y, eta)| - 1 / 2)] |
| 205 | rw [hold_coneA w eta hy hy', hold_coneB w ha eta hy hy'] |
| 206 | refine ⟨hq, ?_, ?_, ?_⟩ |
| 207 | · simp only [zero_mul, sub_zero] |
| 208 | linarith [d.core.lam_pos] |
| 209 | · norm_num only [zero_mul, mul_zero, zero_pow, zero_div, zero_add, add_zero] |
| 210 | nlinarith |
| 211 | · linarith [d.core.lam_pos] |
| 212 | |
| 213 | /-! ## Common actual cone coordinates and source tests -/ |
| 214 | |
| 215 | noncomputable def normalV {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 216 | (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := |
| 217 | coneA w p * (1 + (coneB w Amp p / coneA w p) ^ 2) |
| 218 | |
| 219 | noncomputable def normalP {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 220 | (Amp : ℝ → ℝ) (XR : ℝ) (p : ℝ × ℝ) : ℝ := |
| 221 | OutgoingHistories.p1 XR w Amp p * (1 - coneB w Amp p * coneRatio w Amp p / coneA w p) |
| 222 | |
| 223 | noncomputable def normalJ {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 224 | (Amp : ℝ → ℝ) (XR : ℝ) (p : ℝ × ℝ) : ℝ := |
| 225 | OutgoingHistories.p1 XR w Amp p * (coneRatio w Amp p + coneB w Amp p / coneA w p) |
| 226 | |
| 227 | structure SourceCriterion {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 228 | (Amp : ℝ → ℝ) (p : ℝ × ℝ) : Prop where |
| 229 | angular_positive : 0 < OutgoingHistories.Qs w Amp p |
| 230 | radial_positive : 0 < coneA w p |
| 231 | first_positive : 0 < coneA w p - coneB w Amp p * coneRatio w Amp p |
| 232 | second_strict : 2 * coneB w Amp p * coneRatio w Amp p + |
| 233 | coneB w Amp p ^ 2 / coneA w p + (coneA w p - 2) * coneRatio w Amp p ^ 2 < 2 |
| 234 | |
| 235 | structure RelaxedAt {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 236 | (Amp : ℝ → ℝ) (XR : ℝ) (p : ℝ × ℝ) : Prop where |
| 237 | angular_positive : 0 < OutgoingHistories.Qs w Amp p |
| 238 | radial_positive : 0 < coneA w p |
| 239 | stress_gt_two : 2 < normalP w Amp XR p |
| 240 | root_strict : normalV w Amp p < ConeAlgebra.coneBound (normalP w Amp XR p) (normalJ w Amp XR p) |
| 241 | |
| 242 | noncomputable def TrueAt {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 243 | (Amp : ℝ → ℝ) (XR : ℝ) (p : ℝ × ℝ) : Prop := |
| 244 | RelaxedAt w Amp XR p ∧ 2 < normalV w Amp p |
| 245 | |
| 246 | theorem normalV_gt_two_of_radial {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 247 | (Amp : ℝ → ℝ) (p : ℝ × ℝ) (ha : 2 < coneA w p) : 2 < normalV w Amp p := by |
| 248 | have hm := mul_nonneg (show 0 ≤ coneA w p by linarith) (sq_nonneg (coneB w Amp p / coneA w p)) |
| 249 | unfold normalV |
| 250 | nlinarith |
| 251 | |
| 252 | theorem sourceCriterion_before_endpoint {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 253 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) |
| 254 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 255 | (hh1 : d.h ≤ 1 / 100) (hhlam : d.h ≤ d.core.lam / 4) |
| 256 | (hhT : d.h ≤ Real.exp (-(d.core.holdStart + 3 / 5)) / 8) |
| 257 | (hP : Real.exp (d.core.dropLength + 1) ≤ d.core.P ^ 2) |
| 258 | (hdrop : OutgoingEntranceCone.dropSpeed d.core.m ≤ OutgoingEntranceCone.dropThreshold) |
| 259 | (hentrance : d.core.lam * OutgoingEntranceCone.entranceRatioBound d.core.P d.core.m ^ 2 ≤ 1 / 4) |
| 260 | (hhold : holdSmallConstant d.core.P d.core.m * PulseCone.coneRate d.core.lam ≤ 1 / 2) |
| 261 | (hpulse : ∀ eta t : ℝ, |eta| ≤ 1 → 0 ≤ t → t ≤ d.core.pulseLength → |
| 262 | PulseCone.PulseConeAt w Amp (d.core.pulseStart + t, eta)) |
| 263 | {y eta : ℝ} (hy : y ≤ d.core.endpoint) (heta : |eta| ≤ 1) : |
| 264 | SourceCriterion w Amp (y, eta) := by |
| 265 | by_cases hy0 : y ≤ 0 |
| 266 | · have hi := OutgoingEntranceCone.actual_ideal_cone_margins w ha hy0 eta |
| 267 | refine ⟨?_, ?_, hi.2.2.1, hi.2.2.2.trans_lt (by norm_num)⟩ |
| 268 | · exact (by norm_num : (0 : ℝ) < 1).trans_le |
| 269 | (OutgoingEntranceCone.canonical_Qs_ideal_lower w ha hh1 hy0 heta) |
| 270 | · rw [hi.1]; norm_num |
| 271 | have hy0' : 0 ≤ y := (lt_of_not_ge hy0).le |
| 272 | by_cases hyH : y ≤ d.core.holdStart |
| 273 | · have hm := OutgoingEntranceCone.actual_preliminary_margins w ha hh1 hP hhT hdrop hentrance |
| 274 | (show (y, eta) ∈ OutgoingEntranceCone.preliminaryWindow d from ⟨⟨hy0', hyH⟩, abs_le.mp heta⟩) |
| 275 | refine ⟨OutgoingEntranceCone.canonical_Qs_pos w ha hh1 hy0' hyH heta hhT, ?_, |
| 276 | (by norm_num : (0 : ℝ) < 4 / 5).trans_le hm.1, hm.2.trans_lt (by norm_num)⟩ |
| 277 | have he : y < d.core.endpoint := by |
| 278 | dsimp [OutgoingSchedule.Parameters.endpoint] |
| 279 | linarith [d.core.pulseStart_ge_hold, d.core.pulseLength_pos] |
| 280 | rw [OutgoingEntranceCone.coneA_before w he] |
| 281 | exact (by norm_num : (0 : ℝ) < 4 / 5).trans_le (OutgoingEntranceCone.radialA_bounds d.core y).1 |
| 282 | by_cases hyB : y ≤ d.core.pulseStart |
| 283 | · have hh := hold_source_criterion w ha hwait hh1 hhlam hhT hhold heta (le_of_not_ge hyH) hyB |
| 284 | exact ⟨hh.1, by linarith [hh.2.2.2], hh.2.1, hh.2.2.1⟩ |
| 285 | have ht : 0 ≤ y - d.core.pulseStart := by linarith |
| 286 | have ht' : y - d.core.pulseStart ≤ d.core.pulseLength := by |
| 287 | dsimp [OutgoingSchedule.Parameters.endpoint] at hy |
| 288 | linarith |
| 289 | have hp := hpulse eta (y - d.core.pulseStart) heta ht ht' |
| 290 | rw [add_sub_cancel] at hp |
| 291 | exact ⟨hp.angular_positive, by change 0 < PulseCone.radialA w (y, eta); linarith [hp.radial_gt_two], |
| 292 | hp.true_criterion.1, hp.true_criterion.2.1⟩ |
| 293 | |
| 294 | theorem true_radial_before_endpoint {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 295 | (Amp : ℝ → ℝ) |
| 296 | (hpulse : ∀ eta t : ℝ, |eta| ≤ 1 → 0 ≤ t → t ≤ d.core.pulseLength → |
| 297 | PulseCone.PulseConeAt w Amp (d.core.pulseStart + t, eta)) |
| 298 | {y eta : ℝ} (hy : d.core.holdStart ≤ y) (hy' : y ≤ d.core.endpoint) (heta : |eta| ≤ 1) : |
| 299 | 2 < normalV w Amp (y, eta) := by |
| 300 | apply normalV_gt_two_of_radial |
| 301 | by_cases hyB : y ≤ d.core.pulseStart |
| 302 | · rw [hold_coneA w eta hy hyB] |
| 303 | linarith [d.core.lam_pos] |
| 304 | · have hp := hpulse eta (y - d.core.pulseStart) heta (by linarith) (by |
| 305 | dsimp [OutgoingSchedule.Parameters.endpoint] at hy'; linarith) |
| 306 | rw [add_sub_cancel] at hp |
| 307 | exact hp.radial_gt_two |
| 308 | |
| 309 | noncomputable def preWindow (d : TailData) (left : ℝ) : Set (ℝ × ℝ) := |
| 310 | Icc left d.core.endpoint ×ˢ Icc (-1) 1 |
| 311 | |
| 312 | theorem actual_p1_pos {d : TailData} {K : ℝ} (w : ResetWitness d K) (Amp : ℝ → ℝ) |
| 313 | {y eta : ℝ} (heta : |eta| ≤ 1) (hQ : 0 < OutgoingHistories.Qs w Amp (y, eta)) : |
| 314 | 0 < OutgoingHistories.p1 1 w Amp (y, eta) := by |
| 315 | have heta2 : eta ^ 2 ≤ 1 := OutgoingEntranceCone.parameter_square_le_one heta |
| 316 | have hL := CoordinateAlgebra.L_pos d.h_pos.le d.h_lt_half heta2 |
| 317 | change 0 < 1 * Real.exp y * OutgoingHistories.Qs w Amp (y, eta) / CoordinateAlgebra.L d.h eta |
| 318 | exact div_pos (mul_pos (mul_pos (by norm_num) (Real.exp_pos _)) hQ) hL |
| 319 | |
| 320 | /-- Compactness is applied to actual smooth data after the source tests have |
| 321 | been established. It gives one radial scale for the whole pre-tail interval. -/ |
| 322 | theorem compact_actual_pre_cone {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 323 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (left : ℝ) |
| 324 | (hsource : ∀ p ∈ preWindow d left, SourceCriterion w Amp p) : |
| 325 | ∃ XR0 : ℝ, 0 < XR0 ∧ ∀ XR : ℝ, XR0 < XR → ∀ p ∈ preWindow d left, RelaxedAt w Amp XR p := by |
| 326 | have hcompact : IsCompact (preWindow d left) := isCompact_Icc.prod isCompact_Icc |
| 327 | have hratio : ContinuousOn (coneRatio w Amp) (preWindow d left) := by |
| 328 | apply (OutgoingHistories.Ns_smooth w ha).continuous.continuousOn.div |
| 329 | ((OutgoingHistories.E_smooth w).continuous.mul (OutgoingHistories.Qs_smooth w ha).continuous).continuousOn |
| 330 | intro p hp |
| 331 | exact (mul_pos (OutgoingHistories.E_pos w p) (hsource p hp).angular_positive).ne' |
| 332 | obtain ⟨gap, p0, hgap, hp0, Hcone⟩ := UniformCone.compact_equation_eleven_gap hcompact |
| 333 | (OutgoingEntranceCone.coneA_continuous w).continuousOn |
| 334 | (OutgoingEntranceCone.coneB_continuous w ha).continuousOn hratio |
| 335 | (fun p hp => (hsource p hp).radial_positive) (fun p hp => (hsource p hp).first_positive) |
| 336 | (fun p hp => (hsource p hp).second_strict) |
| 337 | have hp1 : ContinuousOn (OutgoingHistories.p1 1 w Amp) (preWindow d left) := by |
| 338 | have hx : Continuous (fun p : ℝ × ℝ => Real.exp p.1 * OutgoingHistories.Qs w Amp p) := |
| 339 | (Real.continuous_exp.comp continuous_fst).mul (OutgoingHistories.Qs_smooth w ha).continuous |
| 340 | have hL : Continuous (fun p : ℝ × ℝ => 1 - 2 * d.h * p.2 ^ 2) := |
| 341 | continuous_const.sub (continuous_const.mul (continuous_snd.pow 2)) |
| 342 | change ContinuousOn (fun p => (1 * Real.exp p.1 * OutgoingHistories.Qs w Amp p) / |
| 343 | (1 - 2 * d.h * p.2 ^ 2)) (preWindow d left) |
| 344 | simp only [one_mul] |
| 345 | apply hx.continuousOn.div hL.continuousOn |
| 346 | rintro ⟨y, eta⟩ hp |
| 347 | exact (CoordinateAlgebra.L_pos d.h_pos.le d.h_lt_half |
| 348 | (OutgoingEntranceCone.parameter_square_le_one (abs_le.mpr hp.2))).ne' |
| 349 | obtain ⟨c, hc, Hc⟩ := UniformCone.positive_uniform_margin hcompact hp1 (by |
| 350 | rintro ⟨y, eta⟩ hp |
| 351 | exact actual_p1_pos w Amp (abs_le.mpr hp.2) (hsource _ hp).angular_positive) |
| 352 | refine ⟨(p0 + 1) / c, div_pos (by linarith) hc, ?_⟩ |
| 353 | intro XR hXR p hp |
| 354 | have hXR0 : 0 < XR := (div_pos (by linarith : 0 < p0 + 1) hc).trans hXR |
| 355 | have hlarge : p0 < OutgoingHistories.p1 XR w Amp p := by |
| 356 | have ht := (div_lt_iff₀ hc).mp hXR |
| 357 | have hm := mul_le_mul_of_nonneg_left (Hc p hp) hXR0.le |
| 358 | rw [OutgoingHistories.p1_dilation] |
| 359 | linarith |
| 360 | have hcone := Hcone _ hlarge p hp |
| 361 | refine ⟨(hsource p hp).angular_positive, (hsource p hp).radial_positive, ?_, ?_⟩ |
| 362 | · dsimp [normalP] |
| 363 | linarith [hcone.1] |
| 364 | · dsimp [normalV, normalP, normalJ] |
| 365 | linarith [hcone.2] |
| 366 | |
| 367 | theorem relaxed_of_zero_shear {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 368 | (Amp : ℝ → ℝ) (XR y eta : ℝ) (heta : |eta| ≤ 1) |
| 369 | (hQ : 0 < OutgoingHistories.Qs w Amp (y, eta)) (hA : 0 < coneA w (y, eta)) |
| 370 | (hB : coneB w Amp (y, eta) = 0) (hP : 2 < OutgoingHistories.p1 XR w Amp (y, eta)) |
| 371 | (hroot : coneA w (y, eta) < ConeAlgebra.coneBound |
| 372 | (OutgoingHistories.p1 XR w Amp (y, eta)) (OutgoingHistories.p2 XR w Amp (y, eta))) : |
| 373 | RelaxedAt w Amp XR (y, eta) := by |
| 374 | have hj := TailCone.actualP2_eq w Amp XR eta y |
| 375 | (OutgoingEntranceCone.parameter_square_le_one heta) hQ |
| 376 | change OutgoingHistories.p2 XR w Amp (y, eta) = |
| 377 | OutgoingHistories.p1 XR w Amp (y, eta) * coneRatio w Amp (y, eta) at hj |
| 378 | rw [hj] at hroot |
| 379 | refine ⟨hQ, hA, ?_, ?_⟩ |
| 380 | · simpa only [normalP, hB, zero_mul, zero_div, sub_zero, mul_one] using hP |
| 381 | · simpa only [normalV, normalP, normalJ, hB, zero_mul, zero_div, zero_pow (by decide : (2 : ℕ) ≠ 0), |
| 382 | sub_zero, add_zero, mul_one] using hroot |
| 383 | |
| 384 | noncomputable def cleanEnd (d : TailData) : ℝ := tailStart d + 1 / 2 |
| 385 | |
| 386 | noncomputable def cleanWindow (d : TailData) (left : ℝ) : Set (ℝ × ℝ) := |
| 387 | Icc left (cleanEnd d) ×ˢ Icc (-1) 1 |
| 388 | |
| 389 | noncomputable def trueWindow (d : TailData) : Set (ℝ × ℝ) := |
| 390 | Icc d.core.holdStart (cleanEnd d) ×ˢ Icc (-1) 1 |
| 391 | |
| 392 | structure CleanOutgoingCone {d : TailData} {K : ℝ} (w : ResetWitness d K) (XR left : ℝ) : Prop where |
| 393 | relaxed : ∀ p ∈ cleanWindow d left, |
| 394 | RelaxedAt w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p |
| 395 | true_from_hold : ∀ p ∈ trueWindow d, |
| 396 | TrueAt w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p |
| 397 | |
| 398 | /-- Join the proved intervals without choosing another reset or amplitude. -/ |
| 399 | theorem clean_cone_of_components {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 400 | (hK : 0 < K) (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 401 | (hsmall : d.core.lam ≤ 1 / 120) (hscale : CorrectedPulseAmplitude.combinedScale d K ≤ 1 / 1000) |
| 402 | (hsource : PulseCone.sourceConstant d.core.P d.core.m * d.core.lam ^ (29 : ℕ) ≤ 1 / 8) |
| 403 | (hh1 : d.h ≤ 1 / 100) (hhlam : d.h ≤ d.core.lam / 4) |
| 404 | (hhT : d.h ≤ Real.exp (-(d.core.holdStart + 3 / 5)) / 8) |
| 405 | (hreset : TailCone.resetSourceError d K ≤ d.core.lam / 4) |
| 406 | (hfinite : TailCone.finiteConeConstant d.core.P d.core.m * d.core.lam ^ (10 : ℕ) ≤ 1 / 2) |
| 407 | (hrelease : TailCone.releaseConeConstant d.core.P d.core.m * d.core.lam ^ (29 : ℕ) ≤ 1 / 2) |
| 408 | (hP : Real.exp (d.core.dropLength + 1) ≤ d.core.P ^ 2) |
| 409 | (hdrop : OutgoingEntranceCone.dropSpeed d.core.m ≤ OutgoingEntranceCone.dropThreshold) |
| 410 | (hentrance : d.core.lam * OutgoingEntranceCone.entranceRatioBound d.core.P d.core.m ^ 2 ≤ 1 / 4) |
| 411 | (hhold : holdSmallConstant d.core.P d.core.m * PulseCone.coneRate d.core.lam ≤ 1 / 2) |
| 412 | (hpulse : ∀ eta t : ℝ, |eta| ≤ 1 → 0 ≤ t → t ≤ d.core.pulseLength → |
| 413 | PulseCone.PulseConeAt w (CorrectedPulseAmplitude.amplitude d w.coefficients) (d.core.pulseStart + t, eta)) |
| 414 | (left : ℝ) (hleft : left ≤ 0) : |
| 415 | ∃ XR0 : ℝ, 0 < XR0 ∧ ∀ XR : ℝ, XR0 < XR → CleanOutgoingCone w XR left := by |
| 416 | let Amp := CorrectedPulseAmplitude.amplitude d w.coefficients |
| 417 | have ha : ContDiff ℝ ∞ Amp := CorrectedPulseAmplitude.amplitude_contDiff d w.smooth |
| 418 | have Hpre : ∀ p ∈ preWindow d left, SourceCriterion w Amp p := by |
| 419 | rintro ⟨y, eta⟩ hp |
| 420 | exact sourceCriterion_before_endpoint w ha hwait hh1 hhlam hhT hP hdrop hentrance hhold hpulse |
| 421 | hp.1.2 (abs_le.mpr hp.2) |
| 422 | obtain ⟨preXR, hpreXR, HpreXR⟩ := compact_actual_pre_cone w ha left Hpre |
| 423 | refine ⟨max preXR (TailCone.tailRadiusThreshold d), hpreXR.trans_le (le_max_left _ _), ?_⟩ |
| 424 | intro XR hXR |
| 425 | have hXRpre : preXR < XR := (le_max_left _ _).trans_lt hXR |
| 426 | have hXRtail : TailCone.tailRadiusThreshold d < XR := (le_max_right _ _).trans_lt hXR |
| 427 | have Htail : ∀ y eta : ℝ, d.core.endpoint ≤ y → y ≤ cleanEnd d → |eta| ≤ 1 → |
| 428 | TrueAt w Amp XR (y, eta) := by |
| 429 | intro y eta hy hy' heta |
| 430 | have ht := TailCone.corrected_tail_cone w hK hwait hsmall hscale hsource hh1 hhT hreset hfinite hrelease |
| 431 | hXRtail heta hy hy' |
| 432 | have hA : 2 < coneA w (y, eta) := by rw [coneA_eq_actualA]; exact ht.2.2.1 |
| 433 | have hB : coneB w Amp (y, eta) = 0 := by rw [coneB_eq_actualBs w ha]; exact ht.2.1 |
| 434 | refine ⟨relaxed_of_zero_shear w Amp XR y eta heta ht.1 (by linarith) hB ht.2.2.2.2.1 ?_, |
| 435 | normalV_gt_two_of_radial w Amp (y, eta) hA⟩ |
| 436 | rw [coneA_eq_actualA] |
| 437 | exact ht.2.2.2.2.2 |
| 438 | have Hrelaxed : ∀ p ∈ cleanWindow d left, RelaxedAt w Amp XR p := by |
| 439 | rintro ⟨y, eta⟩ hp |
| 440 | by_cases hy : y ≤ d.core.endpoint |
| 441 | · exact HpreXR XR hXRpre (y, eta) ⟨⟨hp.1.1, hy⟩, hp.2⟩ |
| 442 | · exact (Htail y eta (le_of_not_ge hy) hp.1.2 (abs_le.mpr hp.2)).1 |
| 443 | refine ⟨Hrelaxed, ?_⟩ |
| 444 | rintro ⟨y, eta⟩ hp |
| 445 | have hyLeft : left ≤ y := hleft.trans (d.core.holdStart_pos.le.trans hp.1.1) |
| 446 | refine ⟨Hrelaxed (y, eta) ⟨⟨hyLeft, hp.1.2⟩, hp.2⟩, ?_⟩ |
| 447 | by_cases hy : y ≤ d.core.endpoint |
| 448 | · exact true_radial_before_endpoint w Amp hpulse hp.1.1 hy (abs_le.mpr hp.2) |
| 449 | · exact (Htail y eta (le_of_not_ge hy) hp.1.2 (abs_le.mpr hp.2)).2 |
| 450 | |
| 451 | noncomputable def heightThreshold (m lam : ℝ) : ℝ := |
| 452 | min (OutgoingEntranceCone.heightThreshold m lam) (lam / 100000) |
| 453 | |
| 454 | theorem heightThreshold_pos (m : ℝ) {lam : ℝ} (hlam : 0 < lam) : 0 < heightThreshold m lam := |
| 455 | lt_min (OutgoingEntranceCone.heightThreshold_pos m hlam) (div_pos hlam (by norm_num)) |
| 456 | |
| 457 | /-- First choose the drop parameter, then the entrance amplitude, then lambda, |
| 458 | then the terminal height, and only then a finite radius. The theorem accepts |
| 459 | any one existing reset witness throughout. -/ |
| 460 | theorem exists_ordered_clean_cone : |
| 461 | ∃ M : ℝ, 0 < M ∧ ∀ m : ℝ, M ≤ m → ∀ P : ℝ, |
| 462 | OutgoingEntranceCone.amplitudeThreshold m ≤ P → ∀ K : ℝ, 0 < K → |
| 463 | ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ d : TailData, |
| 464 | d.core.P = P → d.core.m = m → d.core.wait = 60 * Real.log (1 / d.core.lam) → |
| 465 | d.core.lam < lam0 → d.h ≤ heightThreshold m d.core.lam → |
| 466 | ∀ w : ResetWitness d K, ∀ left : ℝ, left ≤ 0 → |
| 467 | ∃ XR0 : ℝ, 0 < XR0 ∧ ∀ XR : ℝ, XR0 < XR → CleanOutgoingCone w XR left := by |
| 468 | obtain ⟨M, hM, Hdrop⟩ := OutgoingEntranceCone.exists_small_dropSpeed OutgoingEntranceCone.dropThreshold_pos |
| 469 | refine ⟨M, hM, ?_⟩ |
| 470 | intro m hm P hP K hK |
| 471 | have hPpos := (OutgoingEntranceCone.amplitudeThreshold_pos m).trans_le hP |
| 472 | obtain ⟨holdLam, hholdLam, Hhold⟩ := exists_hold_threshold P m |
| 473 | obtain ⟨pulseLam, hpulseLam, Hpulse⟩ := PulseCone.exists_corrected_pulse_threshold P m K hPpos hK |
| 474 | obtain ⟨tailLam, htailLam, Htail⟩ := TailCone.exists_tail_smallness_threshold P m K hPpos hK |
| 475 | refine ⟨min (OutgoingEntranceCone.lambdaThreshold P m) (min holdLam (min pulseLam tailLam)), |
| 476 | lt_min (OutgoingEntranceCone.lambdaThreshold_pos P m) (lt_min hholdLam (lt_min hpulseLam htailLam)), ?_⟩ |
| 477 | intro d hdP hdm hwait hlam hh w left hleft |
| 478 | rcases lt_min_iff.mp hlam with ⟨hentranceLam, hlam⟩ |
| 479 | rcases lt_min_iff.mp hlam with ⟨hhold, hlam⟩ |
| 480 | rcases lt_min_iff.mp hlam with ⟨hpulse, htail⟩ |
| 481 | have hhTiny : d.h ≤ d.core.lam / 100000 := hh.trans (min_le_right _ _) |
| 482 | have hhEntrance : d.h ≤ OutgoingEntranceCone.heightThreshold d.core.m d.core.lam := by |
| 483 | rw [hdm] |
| 484 | exact hh.trans (min_le_left _ _) |
| 485 | have hchosen := OutgoingEntranceCone.chosen_parameters_bounds d |
| 486 | (by rwa [hdm, hdP]) (by rw [hdP, hdm]; exact hentranceLam.le) hhEntrance |
| 487 | obtain ⟨hsmall, hscale, hsource, hh1, hhT, hreset, hfinite, hrelease⟩ := Htail d hdP hdm htail |
| 488 | have hdrop : OutgoingEntranceCone.dropSpeed d.core.m ≤ OutgoingEntranceCone.dropThreshold := by |
| 489 | rw [hdm]; exact Hdrop m hm |
| 490 | have hhold' : holdSmallConstant d.core.P d.core.m * PulseCone.coneRate d.core.lam ≤ 1 / 2 := by |
| 491 | rw [hdP, hdm]; exact Hhold _ d.core.lam_pos hhold |
| 492 | apply clean_cone_of_components w hK hwait hsmall hscale hsource hh1 (by linarith [d.core.lam_pos]) hhT |
| 493 | hreset hfinite hrelease hchosen.1 hdrop hchosen.2.1 hhold' ?_ left hleft |
| 494 | exact Hpulse d hdP hdm hwait hpulse hhTiny w |
| 495 | |
| 496 | /-! ## The existing profile object and compact margins -/ |
| 497 | |
| 498 | noncomputable def ProfileCleanCone (F : OutgoingProfile.Profile) (XR left : ℝ) : Prop := |
| 499 | CleanOutgoingCone F.reset XR left |
| 500 | |
| 501 | /-- The profile wrapper retains the input profile, its reset, and its |
| 502 | amplitude. It does not select a second profile satisfying separate estimates. -/ |
| 503 | theorem exists_ordered_profile_cone : |
| 504 | ∃ M : ℝ, 0 < M ∧ ∀ m : ℝ, M ≤ m → ∀ P : ℝ, |
| 505 | OutgoingEntranceCone.amplitudeThreshold m ≤ P → ∀ K : ℝ, 0 < K → |
| 506 | ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ F : OutgoingProfile.Profile, |
| 507 | F.data.core.P = P → F.data.core.m = m → F.coefficientBound = K → |
| 508 | F.data.core.wait = 60 * Real.log (1 / F.data.core.lam) → |
| 509 | F.data.core.lam < lam0 → F.data.h ≤ heightThreshold m F.data.core.lam → |
| 510 | ∀ left : ℝ, left ≤ 0 → |
| 511 | ∃ XR0 : ℝ, 0 < XR0 ∧ ∀ XR : ℝ, XR0 < XR → ProfileCleanCone F XR left := by |
| 512 | obtain ⟨M, hM, H⟩ := exists_ordered_clean_cone |
| 513 | refine ⟨M, hM, ?_⟩ |
| 514 | intro m hm P hP K hK |
| 515 | obtain ⟨lam0, hlam0, Hlam⟩ := H m hm P hP K hK |
| 516 | refine ⟨lam0, hlam0, ?_⟩ |
| 517 | rintro ⟨d, K', w⟩ hdP hdm hK' hwait hlam hh left hleft |
| 518 | dsimp only at hdP hdm hK' hwait hlam hh ⊢ |
| 519 | subst K' |
| 520 | exact Hlam d hdP hdm hwait hlam hh w left hleft |
| 521 | |
| 522 | theorem normal_data_continuousOn {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 523 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (XR : ℝ) {s : Set (ℝ × ℝ)} |
| 524 | (heta : ∀ p ∈ s, |p.2| ≤ 1) (hQ : ∀ p ∈ s, 0 < OutgoingHistories.Qs w Amp p) |
| 525 | (hA : ∀ p ∈ s, 0 < coneA w p) : |
| 526 | ContinuousOn (normalP w Amp XR) s ∧ ContinuousOn (normalJ w Amp XR) s ∧ |
| 527 | ContinuousOn (normalV w Amp) s := by |
| 528 | have hca := (OutgoingEntranceCone.coneA_continuous w).continuousOn (s := s) |
| 529 | have hcb := (OutgoingEntranceCone.coneB_continuous w ha).continuousOn (s := s) |
| 530 | have hcr : ContinuousOn (coneRatio w Amp) s := by |
| 531 | apply (OutgoingHistories.Ns_smooth w ha).continuous.continuousOn.div |
| 532 | ((OutgoingHistories.E_smooth w).continuous.mul (OutgoingHistories.Qs_smooth w ha).continuous).continuousOn |
| 533 | intro p hp |
| 534 | exact (mul_pos (OutgoingHistories.E_pos w p) (hQ p hp)).ne' |
| 535 | have hp1 : ContinuousOn (OutgoingHistories.p1 XR w Amp) s := by |
| 536 | have hx : Continuous (fun p : ℝ × ℝ => XR * Real.exp p.1 * OutgoingHistories.Qs w Amp p) := |
| 537 | (continuous_const.mul (Real.continuous_exp.comp continuous_fst)).mul (OutgoingHistories.Qs_smooth w ha).continuous |
| 538 | have hL : Continuous (fun p : ℝ × ℝ => 1 - 2 * d.h * p.2 ^ 2) := |
| 539 | continuous_const.sub (continuous_const.mul (continuous_snd.pow 2)) |
| 540 | apply hx.continuousOn.div hL.continuousOn |
| 541 | intro p hp |
| 542 | exact (CoordinateAlgebra.L_pos d.h_pos.le d.h_lt_half |
| 543 | (OutgoingEntranceCone.parameter_square_le_one (heta p hp))).ne' |
| 544 | have hane : ∀ p ∈ s, coneA w p ≠ 0 := fun p hp => (hA p hp).ne' |
| 545 | exact ⟨hp1.mul (continuousOn_const.sub ((hcb.mul hcr).div hca hane)), |
| 546 | hp1.mul (hcr.add (hcb.div hca hane)), |
| 547 | hca.mul (continuousOn_const.add ((hcb.div hca hane).pow 2))⟩ |
| 548 | |
| 549 | /-- Uniform relaxed margins on the full chosen finite outgoing interval. -/ |
| 550 | theorem clean_relaxed_margins {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 551 | {XR left : ℝ} (h : CleanOutgoingCone w XR left) : |
| 552 | ∃ eps : ℝ, 0 < eps ∧ ∀ p ∈ cleanWindow d left, |
| 553 | eps ≤ OutgoingHistories.Qs w (CorrectedPulseAmplitude.amplitude d w.coefficients) p ∧ |
| 554 | eps ≤ coneA w p ∧ eps ≤ normalP w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p - 2 ∧ |
| 555 | eps ≤ ConeAlgebra.coneBound |
| 556 | (normalP w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p) |
| 557 | (normalJ w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p) - |
| 558 | normalV w (CorrectedPulseAmplitude.amplitude d w.coefficients) p := by |
| 559 | let Amp := CorrectedPulseAmplitude.amplitude d w.coefficients |
| 560 | have ha : ContDiff ℝ ∞ Amp := CorrectedPulseAmplitude.amplitude_contDiff d w.smooth |
| 561 | have hk : IsCompact (cleanWindow d left) := isCompact_Icc.prod isCompact_Icc |
| 562 | have hd := normal_data_continuousOn w ha XR (s := cleanWindow d left) |
| 563 | (fun p hp => abs_le.mpr hp.2) (fun p hp => (h.relaxed p hp).angular_positive) |
| 564 | (fun p hp => (h.relaxed p hp).radial_positive) |
| 565 | obtain ⟨eQ, heQ, HQ⟩ := UniformCone.positive_uniform_margin hk |
| 566 | (OutgoingHistories.Qs_smooth w ha).continuous.continuousOn (fun p hp => (h.relaxed p hp).angular_positive) |
| 567 | obtain ⟨eA, heA, HA⟩ := UniformCone.positive_uniform_margin hk |
| 568 | (OutgoingEntranceCone.coneA_continuous w).continuousOn (fun p hp => (h.relaxed p hp).radial_positive) |
| 569 | obtain ⟨eP, heP, HP⟩ := UniformCone.positive_uniform_margin hk (hd.1.sub continuousOn_const) |
| 570 | (fun p hp => sub_pos.mpr (h.relaxed p hp).stress_gt_two) |
| 571 | have hroot : ContinuousOn (fun p => ConeAlgebra.coneBound (normalP w Amp XR p) (normalJ w Amp XR p) - |
| 572 | normalV w Amp p) (cleanWindow d left) := |
| 573 | (UniformCone.continuous_coneBound.comp_continuousOn (hd.1.prodMk (hd.2.1.prodMk hd.2.2))).sub hd.2.2 |
| 574 | obtain ⟨eR, heR, HR⟩ := UniformCone.positive_uniform_margin hk hroot |
| 575 | (fun p hp => sub_pos.mpr (h.relaxed p hp).root_strict) |
| 576 | refine ⟨min eQ (min eA (min eP eR)), lt_min heQ (lt_min heA (lt_min heP heR)), ?_⟩ |
| 577 | intro p hp |
| 578 | exact ⟨(min_le_left _ _).trans (HQ p hp), |
| 579 | ((min_le_right _ _).trans (min_le_left _ _)).trans (HA p hp), |
| 580 | ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _))).trans (HP p hp), |
| 581 | ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_right _ _))).trans (HR p hp)⟩ |
| 582 | |
| 583 | theorem clean_true_margins {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 584 | {XR left : ℝ} (h : CleanOutgoingCone w XR left) : |
| 585 | ∃ eps : ℝ, 0 < eps ∧ ∀ p ∈ trueWindow d, |
| 586 | eps ≤ normalV w (CorrectedPulseAmplitude.amplitude d w.coefficients) p - 2 ∧ |
| 587 | eps ≤ normalP w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p - 2 ∧ |
| 588 | eps ≤ ConeAlgebra.coneBound |
| 589 | (normalP w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p) |
| 590 | (normalJ w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p) - |
| 591 | normalV w (CorrectedPulseAmplitude.amplitude d w.coefficients) p := by |
| 592 | have ha := CorrectedPulseAmplitude.amplitude_contDiff d w.smooth |
| 593 | have hd := normal_data_continuousOn w ha XR (s := trueWindow d) |
| 594 | (fun p hp => abs_le.mpr hp.2) (fun p hp => (h.true_from_hold p hp).1.angular_positive) |
| 595 | (fun p hp => (h.true_from_hold p hp).1.radial_positive) |
| 596 | exact UniformCone.compact_trueCone_margins (isCompact_Icc.prod isCompact_Icc) hd.1 hd.2.1 hd.2.2 |
| 597 | (fun p hp => ⟨(h.true_from_hold p hp).2, (h.true_from_hold p hp).1.stress_gt_two, |
| 598 | (h.true_from_hold p hp).1.root_strict⟩) |
| 599 | |
| 600 | /-- A coordinate perturbation tolerance for later edits on the true region. |
| 601 | The competing coordinates need not be continuous; their closeness must be |
| 602 | proved separately for the actual edit. -/ |
| 603 | theorem clean_true_stable {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 604 | {XR left : ℝ} (h : CleanOutgoingCone w XR left) : |
| 605 | ∃ rho : ℝ, 0 < rho ∧ ∀ p ∈ trueWindow d, ∀ P' J' v' : ℝ, |
| 606 | |P' - normalP w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p| ≤ rho → |
| 607 | |J' - normalJ w (CorrectedPulseAmplitude.amplitude d w.coefficients) XR p| ≤ rho → |
| 608 | |v' - normalV w (CorrectedPulseAmplitude.amplitude d w.coefficients) p| ≤ rho → |
| 609 | 2 < v' ∧ v' < P' ∧ (v' - 2) * J' ^ 2 < 2 * (P' - v') ^ 2 := by |
| 610 | have ha := CorrectedPulseAmplitude.amplitude_contDiff d w.smooth |
| 611 | have hd := normal_data_continuousOn w ha XR (s := trueWindow d) |
| 612 | (fun p hp => abs_le.mpr hp.2) (fun p hp => (h.true_from_hold p hp).1.angular_positive) |
| 613 | (fun p hp => (h.true_from_hold p hp).1.radial_positive) |
| 614 | exact UniformCone.compact_family_quadratic_stable (isCompact_Icc.prod isCompact_Icc) hd.1 hd.2.1 hd.2.2 |
| 615 | (fun p hp => ⟨(h.true_from_hold p hp).2, (h.true_from_hold p hp).1.stress_gt_two, |
| 616 | (h.true_from_hold p hp).1.root_strict⟩) |
| 617 | |
| 618 | /-! ## Margins independent of the later entrance radius -/ |
| 619 | |
| 620 | noncomputable def sourceC {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 621 | (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := |
| 622 | 1 - coneB w Amp p * coneRatio w Amp p / coneA w p |
| 623 | |
| 624 | noncomputable def sourceJ {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 625 | (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := |
| 626 | coneRatio w Amp p + coneB w Amp p / coneA w p |
| 627 | |
| 628 | noncomputable def leadingGap {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 629 | (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := |
| 630 | 2 * sourceC w Amp p ^ 2 - (normalV w Amp p - 2) * sourceJ w Amp p ^ 2 |
| 631 | |
| 632 | theorem leading_gap_of_finite {s c j v : ℝ} (hs : 0 < s) (hv : 2 < v) |
| 633 | (hvP : v < s * c) (hquad : (v - 2) * (s * j) ^ 2 < 2 * (s * c - v) ^ 2) : |
| 634 | 0 < c ∧ 0 < 2 * c ^ 2 - (v - 2) * j ^ 2 := by |
| 635 | have hc : 0 < c := by |
| 636 | by_contra hn |
| 637 | have hm := mul_nonpos_of_nonneg_of_nonpos hs.le (le_of_not_gt hn) |
| 638 | linarith |
| 639 | have hd : (s * c - v) ^ 2 < (s * c) ^ 2 := by |
| 640 | apply (sq_lt_sq₀ (by linarith : 0 ≤ s * c - v) (mul_pos hs hc).le).mpr |
| 641 | linarith |
| 642 | have hgap : s ^ 2 * ((v - 2) * j ^ 2) < s ^ 2 * (2 * c ^ 2) := by |
| 643 | nlinarith only [hquad, hd] |
| 644 | exact ⟨hc, sub_pos.mpr ((mul_lt_mul_iff_right₀ (sq_pos_of_pos hs)).mp hgap)⟩ |
| 645 | |
| 646 | theorem clean_true_source_positive {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 647 | {XR left : ℝ} (h : CleanOutgoingCone w XR left) (hXR : 0 < XR) |
| 648 | {p : ℝ × ℝ} (hp : p ∈ trueWindow d) : |
| 649 | 0 < OutgoingHistories.Qs w (CorrectedPulseAmplitude.amplitude d w.coefficients) p ∧ |
| 650 | 0 < coneA w p ∧ 2 < normalV w (CorrectedPulseAmplitude.amplitude d w.coefficients) p ∧ |
| 651 | 0 < sourceC w (CorrectedPulseAmplitude.amplitude d w.coefficients) p ∧ |
| 652 | 0 < leadingGap w (CorrectedPulseAmplitude.amplitude d w.coefficients) p := by |
| 653 | let Amp := CorrectedPulseAmplitude.amplitude d w.coefficients |
| 654 | have ht := h.true_from_hold p hp |
| 655 | have hp1 : 0 < OutgoingHistories.p1 XR w Amp p := by |
| 656 | rw [OutgoingHistories.p1_dilation] |
| 657 | exact mul_pos hXR (actual_p1_pos w Amp (abs_le.mpr hp.2) ht.1.angular_positive) |
| 658 | have hc := (ConeAlgebra.true_cone_iff ht.2).mp ⟨ht.1.stress_gt_two, ht.1.root_strict⟩ |
| 659 | have hg := leading_gap_of_finite (s := OutgoingHistories.p1 XR w Amp p) |
| 660 | (c := sourceC w Amp p) (j := sourceJ w Amp p) (v := normalV w Amp p) hp1 ht.2 hc.1 hc.2 |
| 661 | exact ⟨ht.1.angular_positive, ht.1.radial_positive, ht.2, hg.1, hg.2⟩ |
| 662 | |
| 663 | /-- All five quantities in this margin are independent of `XR`. A single |
| 664 | realized true cone therefore supplies a margin for later radius choices. -/ |
| 665 | theorem clean_true_source_margins {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 666 | {XR left : ℝ} (h : CleanOutgoingCone w XR left) (hXR : 0 < XR) : |
| 667 | ∃ eps : ℝ, 0 < eps ∧ ∀ p ∈ trueWindow d, |
| 668 | eps ≤ OutgoingHistories.Qs w (CorrectedPulseAmplitude.amplitude d w.coefficients) p ∧ |
| 669 | eps ≤ coneA w p ∧ eps ≤ normalV w (CorrectedPulseAmplitude.amplitude d w.coefficients) p - 2 ∧ |
| 670 | eps ≤ sourceC w (CorrectedPulseAmplitude.amplitude d w.coefficients) p ∧ |
| 671 | eps ≤ leadingGap w (CorrectedPulseAmplitude.amplitude d w.coefficients) p := by |
| 672 | let Amp := CorrectedPulseAmplitude.amplitude d w.coefficients |
| 673 | have ha : ContDiff ℝ ∞ Amp := CorrectedPulseAmplitude.amplitude_contDiff d w.smooth |
| 674 | have hk : IsCompact (trueWindow d) := isCompact_Icc.prod isCompact_Icc |
| 675 | have hpositive {p : ℝ × ℝ} (hp : p ∈ trueWindow d) := clean_true_source_positive w h hXR hp |
| 676 | have hca := (OutgoingEntranceCone.coneA_continuous w).continuousOn (s := trueWindow d) |
| 677 | have hcb := (OutgoingEntranceCone.coneB_continuous w ha).continuousOn (s := trueWindow d) |
| 678 | have hcr : ContinuousOn (coneRatio w Amp) (trueWindow d) := by |
| 679 | apply (OutgoingHistories.Ns_smooth w ha).continuous.continuousOn.div |
| 680 | ((OutgoingHistories.E_smooth w).continuous.mul (OutgoingHistories.Qs_smooth w ha).continuous).continuousOn |
| 681 | intro p hp |
| 682 | exact (mul_pos (OutgoingHistories.E_pos w p) (hpositive hp).1).ne' |
| 683 | have hane : ∀ p ∈ trueWindow d, coneA w p ≠ 0 := fun p hp => (hpositive hp).2.1.ne' |
| 684 | have hC : ContinuousOn (sourceC w Amp) (trueWindow d) := |
| 685 | continuousOn_const.sub ((hcb.mul hcr).div hca hane) |
| 686 | have hJ : ContinuousOn (sourceJ w Amp) (trueWindow d) := hcr.add (hcb.div hca hane) |
| 687 | have hV : ContinuousOn (normalV w Amp) (trueWindow d) := |
| 688 | hca.mul (continuousOn_const.add ((hcb.div hca hane).pow 2)) |
| 689 | have hG : ContinuousOn (leadingGap w Amp) (trueWindow d) := |
| 690 | (continuousOn_const.mul (hC.pow 2)).sub ((hV.sub continuousOn_const).mul (hJ.pow 2)) |
| 691 | obtain ⟨eQ, heQ, HQ⟩ := UniformCone.positive_uniform_margin hk |
| 692 | (OutgoingHistories.Qs_smooth w ha).continuous.continuousOn (fun p hp => (hpositive hp).1) |
| 693 | obtain ⟨eA, heA, HA⟩ := UniformCone.positive_uniform_margin hk hca (fun p hp => (hpositive hp).2.1) |
| 694 | obtain ⟨eV, heV, HV⟩ := UniformCone.positive_uniform_margin hk (hV.sub continuousOn_const) |
| 695 | (fun p hp => sub_pos.mpr (hpositive hp).2.2.1) |
| 696 | obtain ⟨eC, heC, HC⟩ := UniformCone.positive_uniform_margin hk hC (fun p hp => (hpositive hp).2.2.2.1) |
| 697 | obtain ⟨eG, heG, HG⟩ := UniformCone.positive_uniform_margin hk hG (fun p hp => (hpositive hp).2.2.2.2) |
| 698 | refine ⟨min eQ (min eA (min eV (min eC eG))), lt_min heQ (lt_min heA (lt_min heV (lt_min heC heG))), ?_⟩ |
| 699 | intro p hp |
| 700 | exact ⟨(min_le_left _ _).trans (HQ p hp), |
| 701 | ((min_le_right _ _).trans (min_le_left _ _)).trans (HA p hp), |
| 702 | ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _))).trans (HV p hp), |
| 703 | ((min_le_right _ _).trans ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _)))).trans (HC p hp), |
| 704 | ((min_le_right _ _).trans ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_right _ _)))).trans (HG p hp)⟩ |
| 705 | |
| 706 | end NavierStokes.OutgoingCone |