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.ProfileHistories |
| 2 | import NavierStokes.NaturalProfile |
| 3 | import Mathlib.Analysis.SpecialFunctions.SmoothTransition |
| 4 | import Mathlib.Topology.UniformSpace.HeineCantor |
| 5 | import Mathlib.Topology.UniformSpace.UniformConvergence |
| 6 | |
| 7 | /-! |
| 8 | # The same-radius reference continuation |
| 9 | |
| 10 | The reference path integrates the natural slopes evaluated at the original |
| 11 | radius. A smooth cutoff damps those slopes to zero; no radial reparametrization |
| 12 | is substituted for the prescribed differential equation. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | namespace NavierStokes.ReferencePath |
| 18 | |
| 19 | open Set Filter MeasureTheory Metric |
| 20 | open scoped Topology ContDiff |
| 21 | open ProfileHistories |
| 22 | |
| 23 | def fullStrip (J : Set ℝ) (hJ : IsOpen J) : RadialDomain where |
| 24 | carrier := univ ×ˢ J |
| 25 | isOpen := isOpen_univ.prod hJ |
| 26 | scale_mem := fun _ hp _ _ => ⟨mem_univ _, hp.2⟩ |
| 27 | |
| 28 | def earlyStrip (T : ℝ) (hT : 0 < T) (J : Set ℝ) (hJ : IsOpen J) : RadialDomain where |
| 29 | carrier := Iio T ×ˢ J |
| 30 | isOpen := isOpen_Iio.prod hJ |
| 31 | scale_mem := by |
| 32 | intro p hp t ht |
| 33 | refine ⟨?_, hp.2⟩ |
| 34 | rcases le_total p.1 0 with hx | hx |
| 35 | · exact lt_of_le_of_lt (mul_nonpos_of_nonneg_of_nonpos ht.1 hx) hT |
| 36 | · exact lt_of_le_of_lt (mul_le_of_le_one_left hx ht.2) hp.1 |
| 37 | |
| 38 | /-- One until t=δ, smooth transition on (δ,2δ), and zero from 2δ onward. -/ |
| 39 | def slopeCutoff (δ t : ℝ) : ℝ := 1 - Real.smoothTransition ((t - δ) / δ) |
| 40 | |
| 41 | theorem slopeCutoff_smooth (δ : ℝ) : ContDiff ℝ ∞ (slopeCutoff δ) := |
| 42 | contDiff_const.sub (Real.smoothTransition.contDiff.comp |
| 43 | ((contDiff_id.sub contDiff_const).div_const δ)) |
| 44 | |
| 45 | theorem slopeCutoff_mem (δ t : ℝ) : slopeCutoff δ t ∈ Icc (0 : ℝ) 1 := by |
| 46 | have hlo := Real.smoothTransition.nonneg ((t - δ) / δ) |
| 47 | have hhi := Real.smoothTransition.le_one ((t - δ) / δ) |
| 48 | constructor <;> dsimp [slopeCutoff] <;> linarith |
| 49 | |
| 50 | theorem slopeCutoff_one {δ t : ℝ} (hδ : 0 < δ) (ht : t ≤ δ) : slopeCutoff δ t = 1 := by |
| 51 | rw [slopeCutoff, Real.smoothTransition.zero_of_nonpos |
| 52 | (div_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr ht) hδ.le), sub_zero] |
| 53 | |
| 54 | theorem slopeCutoff_zero {δ t : ℝ} (hδ : 0 < δ) (ht : 2 * δ ≤ t) : slopeCutoff δ t = 0 := by |
| 55 | rw [slopeCutoff, Real.smoothTransition.one_of_one_le |
| 56 | ((le_div_iff₀ hδ).2 (by linarith)), sub_self] |
| 57 | |
| 58 | def dampedSlope (δ : ℝ) (G : Field) : Field := |
| 59 | fun p => slopeCutoff δ p.1 * radialPartial G p |
| 60 | |
| 61 | /-- The prescribed continuation, defined by an actual integral of the |
| 62 | same-time natural derivative. -/ |
| 63 | def continuation (δ : ℝ) (G : Field) : Field := |
| 64 | fun p => G (0, p.2) + primitive (dampedSlope δ G) p |
| 65 | |
| 66 | theorem dampedSlope_smooth {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < T) |
| 67 | {J : Set ℝ} (hJ : IsOpen J) {G : Field} |
| 68 | (hG : ContDiffOn ℝ ∞ G (earlyStrip T hT J hJ).carrier) : |
| 69 | ContDiffOn ℝ ∞ (dampedSlope δ G) (fullStrip J hJ).carrier := by |
| 70 | intro p hp |
| 71 | by_cases ht : p.1 < T |
| 72 | · have hs := (radialPartial_smooth (earlyStrip T hT J hJ) hG).contDiffAt |
| 73 | ((earlyStrip T hT J hJ).isOpen.mem_nhds ⟨ht, hp.2⟩) |
| 74 | exact (((slopeCutoff_smooth δ).contDiffAt.comp p contDiffAt_fst).mul hs).contDiffWithinAt |
| 75 | · have hfar : 2 * δ < p.1 := hδT.trans_le (le_of_not_gt ht) |
| 76 | have heq : dampedSlope δ G =ᶠ[𝓝 p] fun _ => 0 := by |
| 77 | filter_upwards [continuousAt_fst.eventually (Ioi_mem_nhds hfar)] with q hq |
| 78 | simp only [dampedSlope, slopeCutoff_zero hδ hq.le, zero_mul] |
| 79 | exact (contDiffAt_const.congr_of_eventuallyEq heq).contDiffWithinAt |
| 80 | |
| 81 | theorem continuation_smooth {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < T) |
| 82 | {J : Set ℝ} (hJ : IsOpen J) {G : Field} |
| 83 | (hG : ContDiffOn ℝ ∞ G (earlyStrip T hT J hJ).carrier) : |
| 84 | ContDiffOn ℝ ∞ (continuation δ G) (fullStrip J hJ).carrier := by |
| 85 | apply ContDiffOn.add _ (primitive_smooth (fullStrip J hJ) (dampedSlope_smooth hT hδ hδT hJ hG)) |
| 86 | intro p hp |
| 87 | exact ((hG.contDiffAt ((earlyStrip T hT J hJ).isOpen.mem_nhds |
| 88 | (show (0, p.2) ∈ (earlyStrip T hT J hJ).carrier from ⟨hT, hp.2⟩))).comp p |
| 89 | (contDiffAt_const.prodMk contDiffAt_snd)).contDiffWithinAt |
| 90 | |
| 91 | theorem continuation_hasDerivAt {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < T) |
| 92 | {J : Set ℝ} (hJ : IsOpen J) {G : Field} |
| 93 | (hG : ContDiffOn ℝ ∞ G (earlyStrip T hT J hJ).carrier) |
| 94 | {p : Point} (hp : p.2 ∈ J) : |
| 95 | HasDerivAt (fun t => continuation δ G (t, p.2)) |
| 96 | (slopeCutoff δ p.1 * radialPartial G p) p.1 := by |
| 97 | have hd := (hasDerivAt_const p.1 (G (0, p.2))).fun_add |
| 98 | (primitive_hasDerivAt (fullStrip J hJ) (dampedSlope_smooth hT hδ hδT hJ hG) ⟨mem_univ _, hp⟩) |
| 99 | simp only [zero_add] at hd |
| 100 | exact hd |
| 101 | |
| 102 | theorem continuation_eq_natural {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < T) |
| 103 | {J : Set ℝ} (hJ : IsOpen J) {G : Field} |
| 104 | (hG : ContDiffOn ℝ ∞ G (earlyStrip T hT J hJ).carrier) |
| 105 | {p : Point} (hp : p.2 ∈ J) (ht : p.1 ≤ δ) : continuation δ G p = G p := by |
| 106 | have hd : ∀ t ∈ uIcc 0 p.1, |
| 107 | HasDerivAt (fun t => G (t, p.2)) (dampedSlope δ G (t, p.2)) t := by |
| 108 | intro t ht' |
| 109 | have htδ : t ≤ δ := (mem_uIcc.mp ht').elim |
| 110 | (fun h => h.2.trans ht) (fun h => h.2.trans hδ.le) |
| 111 | have htT : t < T := htδ.trans_lt (by linarith) |
| 112 | simpa only [dampedSlope, slopeCutoff_one hδ htδ, one_mul] using |
| 113 | radialPartial_hasDerivAt (earlyStrip T hT J hJ) hG (p := (t, p.2)) ⟨htT, hp⟩ |
| 114 | have hi := intervalIntegral.integral_eq_sub_of_hasDerivAt hd |
| 115 | (radial_slice_intervalIntegrable (fullStrip J hJ) |
| 116 | (dampedSlope_smooth hT hδ hδT hJ hG) (p := p) ⟨mem_univ _, hp⟩) |
| 117 | change G (0, p.2) + _ = _ |
| 118 | rw [show primitive (dampedSlope δ G) p = G p - G (0, p.2) from hi] |
| 119 | ring |
| 120 | |
| 121 | theorem continuation_frozen {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < T) |
| 122 | {J : Set ℝ} (hJ : IsOpen J) {G : Field} |
| 123 | (hG : ContDiffOn ℝ ∞ G (earlyStrip T hT J hJ).carrier) |
| 124 | {p : Point} (hp : p.2 ∈ J) (ht : 2 * δ ≤ p.1) : |
| 125 | continuation δ G p = continuation δ G (2 * δ, p.2) := by |
| 126 | have hd : ∀ t ∈ uIcc (2 * δ) p.1, |
| 127 | HasDerivAt (fun t => continuation δ G (t, p.2)) 0 t := by |
| 128 | intro t ht' |
| 129 | have hlow : 2 * δ ≤ t := (show t ∈ Icc (2 * δ) p.1 by simpa only [uIcc_of_le ht] using ht').1 |
| 130 | simpa only [slopeCutoff_zero hδ hlow, zero_mul] using |
| 131 | continuation_hasDerivAt hT hδ hδT hJ hG (p := (t, p.2)) hp |
| 132 | have hi := intervalIntegral.integral_eq_sub_of_hasDerivAt hd (intervalIntegrable_const : |
| 133 | IntervalIntegrable (fun _ : ℝ => (0 : ℝ)) volume (2 * δ) p.1) |
| 134 | have heq : (0 : ℝ) = continuation δ G p - continuation δ G (2 * δ, p.2) := by |
| 135 | simpa only [intervalIntegral.integral_zero, Prod.eta] using hi |
| 136 | linarith |
| 137 | |
| 138 | section CompactSmoothIntegral |
| 139 | |
| 140 | variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ℝ H] [ProperSpace H] |
| 141 | {s : Set H} {F : H → ℝ → ℝ} |
| 142 | |
| 143 | theorem compact_integral_smooth (hs : IsOpen s) |
| 144 | (hF : ∀ p ∈ s, ∀ t ∈ Icc (0 : ℝ) 1, |
| 145 | ContDiffAt ℝ ∞ (fun z : H × ℝ => F z.1 z.2) (p, t)) : |
| 146 | ContDiffOn ℝ ∞ (fun p => ∫ t in (0 : ℝ)..1, F p t) s := by |
| 147 | apply SmoothParameterIntegral.contDiffOn_intervalIntegral_of_continuous_jet hs zero_le_one |
| 148 | · intro t ht p hp |
| 149 | exact ((hF p hp t ht).comp p (contDiffAt_id.prodMk contDiffAt_const)).contDiffWithinAt |
| 150 | · intro k |
| 151 | rintro ⟨p, t⟩ ⟨hp, ht⟩ |
| 152 | have hflip : ContDiffAt ℝ ∞ (Function.uncurry (fun t p => F p t)) (t, p) := |
| 153 | (hF p hp t ht).comp (t, p) (contDiffAt_snd.prodMk contDiffAt_fst) |
| 154 | have hd := ParametricFlatFactor.contDiffAt_partial_iteratedFDeriv (fun t p => F p t) k t p hflip |
| 155 | exact ((hd.comp (p, t) (contDiffAt_snd.prodMk contDiffAt_fst)).continuousAt).continuousWithinAt |
| 156 | |
| 157 | end CompactSmoothIntegral |
| 158 | |
| 159 | abbrev MasterPoint := (ℝ × ℝ) × ℝ |
| 160 | |
| 161 | def masterDomain (T : ℝ) (J : Set ℝ) : Set MasterPoint := |
| 162 | {p | |p.1.1 * p.1.2| < T ∧ p.2 ∈ J} |
| 163 | |
| 164 | theorem masterDomain_open (T : ℝ) {J : Set ℝ} (hJ : IsOpen J) : IsOpen (masterDomain T J) := |
| 165 | (isOpen_lt ((continuous_fst.fst.mul continuous_fst.snd).abs) continuous_const).inter |
| 166 | (hJ.preimage continuous_snd) |
| 167 | |
| 168 | /-- The rescaled transition on a fixed parameter interval, smooth even at δ=0. -/ |
| 169 | def master (G : Field) (p : MasterPoint) : ℝ := |
| 170 | G (0, p.2) + p.1.1 * p.1.2 * |
| 171 | ∫ v in (0 : ℝ)..1, slopeCutoff 1 (p.1.2 * v) * radialPartial G (p.1.1 * (p.1.2 * v), p.2) |
| 172 | |
| 173 | theorem master_at_zero (G : Field) (u η : ℝ) : master G ((0, u), η) = G (0, η) := by |
| 174 | simp [master] |
| 175 | |
| 176 | theorem slopeCutoff_scaled {δ : ℝ} (hδ : δ ≠ 0) (u : ℝ) : |
| 177 | slopeCutoff δ (δ * u) = slopeCutoff 1 u := by |
| 178 | unfold slopeCutoff |
| 179 | congr 2 |
| 180 | field_simp |
| 181 | |
| 182 | theorem continuation_rescaled (G : Field) {δ : ℝ} (hδ : δ ≠ 0) (u η : ℝ) : |
| 183 | continuation δ G (δ * u, η) = master G ((δ, u), η) := by |
| 184 | unfold continuation master |
| 185 | rw [primitive_eq_mul_average] |
| 186 | apply congrArg (fun x : ℝ => G (0, η) + δ * u * x) |
| 187 | apply intervalIntegral.integral_congr |
| 188 | intro v _ |
| 189 | change slopeCutoff δ (v * (δ * u)) * radialPartial G (v * (δ * u), η) = _ |
| 190 | rw [show v * (δ * u) = δ * (u * v) by ring, slopeCutoff_scaled hδ] |
| 191 | |
| 192 | theorem master_smooth {T : ℝ} (hT : 0 < T) {J : Set ℝ} (hJ : IsOpen J) {G : Field} |
| 193 | (hG : ContDiffOn ℝ ∞ G (earlyStrip T hT J hJ).carrier) : |
| 194 | ContDiffOn ℝ ∞ (master G) (masterDomain T J) := by |
| 195 | apply ContDiffOn.add |
| 196 | · intro p hp |
| 197 | exact ((hG.contDiffAt ((earlyStrip T hT J hJ).isOpen.mem_nhds |
| 198 | (show (0, p.2) ∈ (earlyStrip T hT J hJ).carrier from ⟨hT, hp.2⟩))).comp p |
| 199 | (contDiffAt_const.prodMk contDiffAt_snd)).contDiffWithinAt |
| 200 | · apply ContDiffOn.mul (contDiffOn_fst.fst.mul contDiffOn_fst.snd) |
| 201 | apply compact_integral_smooth (masterDomain_open T hJ) |
| 202 | intro p hp v hv |
| 203 | have hbound : |p.1.1 * (p.1.2 * v)| ≤ |p.1.1 * p.1.2| := by |
| 204 | rw [← mul_assoc, abs_mul, abs_of_nonneg hv.1] |
| 205 | exact mul_le_of_le_one_right (abs_nonneg _) hv.2 |
| 206 | have hpv : (p.1.1 * (p.1.2 * v), p.2) ∈ (earlyStrip T hT J hJ).carrier := |
| 207 | ⟨(le_abs_self _).trans_lt (hbound.trans_lt hp.1), hp.2⟩ |
| 208 | have hd := (radialPartial_smooth (earlyStrip T hT J hJ) hG).contDiffAt |
| 209 | ((earlyStrip T hT J hJ).isOpen.mem_nhds hpv) |
| 210 | exact ((slopeCutoff_smooth 1).contDiffAt.comp (p, v) |
| 211 | (contDiffAt_fst.fst.snd.mul contDiffAt_snd)).mul |
| 212 | (hd.comp (p, v) ((contDiffAt_fst.fst.fst.mul |
| 213 | (contDiffAt_fst.fst.snd.mul contDiffAt_snd)).prodMk contDiffAt_fst.snd)) |
| 214 | |
| 215 | /-- The master representation covers the entire hold by saturating its |
| 216 | rescaled time at two. This does not change the natural slope's evaluation point. -/ |
| 217 | def holdTime (δ t : ℝ) : ℝ := min (t / δ) 2 |
| 218 | |
| 219 | theorem holdTime_mem {δ t : ℝ} (hδ : 0 < δ) (ht : 0 ≤ t) : holdTime δ t ∈ Icc (0 : ℝ) 2 := by |
| 220 | exact ⟨le_min (div_nonneg ht hδ.le) (by norm_num), min_le_right _ _⟩ |
| 221 | |
| 222 | theorem continuation_eq_master_hold {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < T) |
| 223 | {J : Set ℝ} (hJ : IsOpen J) {G : Field} |
| 224 | (hG : ContDiffOn ℝ ∞ G (earlyStrip T hT J hJ).carrier) |
| 225 | {t η : ℝ} (hη : η ∈ J) (_ : 0 ≤ t) : |
| 226 | continuation δ G (t, η) = master G ((δ, holdTime δ t), η) := by |
| 227 | by_cases hsmall : t ≤ 2 * δ |
| 228 | · have htdiv : t / δ ≤ 2 := (div_le_iff₀ hδ).2 (by nlinarith) |
| 229 | rw [holdTime, min_eq_left htdiv, ← continuation_rescaled G hδ.ne'] |
| 230 | rw [mul_div_cancel₀ _ hδ.ne'] |
| 231 | · have hbig : 2 * δ ≤ t := (lt_of_not_ge hsmall).le |
| 232 | have htdiv : 2 ≤ t / δ := (le_div_iff₀ hδ).2 (by nlinarith) |
| 233 | rw [continuation_frozen hT hδ hδT hJ hG hη hbig, |
| 234 | holdTime, min_eq_right htdiv, ← continuation_rescaled G hδ.ne'] |
| 235 | rw [mul_comm δ 2] |
| 236 | |
| 237 | def parameterJet (k : ℕ) (F : MasterPoint → ℝ) (p : MasterPoint) : ℝ := |
| 238 | iteratedDeriv k (fun η => F (p.1, η)) p.2 |
| 239 | |
| 240 | theorem parameterJet_continuousAt {F : MasterPoint → ℝ} {p : MasterPoint} |
| 241 | (hF : ContDiffAt ℝ ∞ F p) (k : ℕ) : ContinuousAt (parameterJet k F) p := by |
| 242 | have hd := ParametricFlatFactor.contDiffAt_partial_iteratedFDeriv |
| 243 | (fun a η => F (a, η)) k p.1 p.2 hF |
| 244 | exact (ContinuousMultilinearMap.piFieldEquiv ℝ (Fin k) ℝ).symm.continuous.continuousAt.comp |
| 245 | hd.continuousAt |
| 246 | |
| 247 | /-- Compactness supplies uniform control of every fixed genuine parameter jet |
| 248 | of a smooth master family at δ=0. -/ |
| 249 | theorem master_parameter_jet_close {T : ℝ} (hT : 0 < T) {J : Set ℝ} (hJ : IsOpen J) |
| 250 | {F : MasterPoint → ℝ} (hF : ContDiffOn ℝ ∞ F (masterDomain T J)) |
| 251 | (base : ℝ → ℝ) (hzero : ∀ u η, F ((0, u), η) = base η) |
| 252 | {K : Set ℝ} (hK : IsCompact K) (hKJ : K ⊆ J) (k : ℕ) |
| 253 | {ε : ℝ} (hε : 0 < ε) : |
| 254 | ∃ δ₀ > 0, ∀ δ, |δ| < δ₀ → ∀ u ∈ Icc (0 : ℝ) 2, ∀ η ∈ K, |
| 255 | |parameterJet k F ((δ, u), η) - iteratedDeriv k base η| < ε := by |
| 256 | let a : ℝ := T / 4 |
| 257 | have ha : 0 < a := by dsimp [a]; positivity |
| 258 | let C : Set MasterPoint := (Icc (-a) a ×ˢ Icc (0 : ℝ) 2) ×ˢ K |
| 259 | have hC : IsCompact C := (isCompact_Icc.prod isCompact_Icc).prod hK |
| 260 | have hCD : C ⊆ masterDomain T J := by |
| 261 | rintro ⟨⟨δ, u⟩, η⟩ ⟨⟨hδ, hu⟩, hη⟩ |
| 262 | refine ⟨?_, hKJ hη⟩ |
| 263 | have hδabs : |δ| ≤ a := abs_le.mpr hδ |
| 264 | have huabs : |u| ≤ 2 := by rw [abs_of_nonneg hu.1]; exact hu.2 |
| 265 | have hprod := mul_le_mul hδabs huabs (abs_nonneg u) ha.le |
| 266 | rw [abs_mul] |
| 267 | exact hprod.trans_lt (by dsimp [a]; linarith) |
| 268 | have hc : ContinuousOn (parameterJet k F) C := by |
| 269 | intro p hp |
| 270 | exact (parameterJet_continuousAt (hF.contDiffAt ((masterDomain_open T hJ).mem_nhds (hCD hp))) k).continuousWithinAt |
| 271 | obtain ⟨r, hr, hdist⟩ := (Metric.uniformContinuousOn_iff.mp |
| 272 | (hC.uniformContinuousOn_of_continuous hc)) ε hε |
| 273 | refine ⟨min a r, lt_min ha hr, ?_⟩ |
| 274 | intro δ hδ u hu η hη |
| 275 | have hδa : |δ| < a := hδ.trans_le (min_le_left _ _) |
| 276 | have hδr : |δ| < r := hδ.trans_le (min_le_right _ _) |
| 277 | have hx : ((δ, u), η) ∈ C := ⟨⟨abs_le.mp hδa.le, hu⟩, hη⟩ |
| 278 | have hy : ((0, u), η) ∈ C := ⟨⟨⟨neg_nonpos.mpr ha.le, ha.le⟩, hu⟩, hη⟩ |
| 279 | have hdxy : dist (((δ, u), η) : MasterPoint) ((0, u), η) < r := by |
| 280 | simpa only [Prod.dist_eq, dist_self, Real.dist_eq, sub_zero, max_self, |
| 281 | max_eq_left (abs_nonneg δ)] using hδr |
| 282 | have hz : parameterJet k F ((0, u), η) = iteratedDeriv k base η := by |
| 283 | unfold parameterJet |
| 284 | congr 1 |
| 285 | funext x |
| 286 | exact hzero u x |
| 287 | simpa only [Real.dist_eq, hz] using hdist _ hx _ hy hdxy |
| 288 | |
| 289 | def transformedMaster (Φ : ℝ × ℝ → ℝ) (G : Field) (p : MasterPoint) : ℝ := |
| 290 | Φ (master G p, G (0, p.2)) |
| 291 | |
| 292 | theorem transformedMaster_smooth {T : ℝ} (hT : 0 < T) {J : Set ℝ} (hJ : IsOpen J) |
| 293 | {G : Field} (hG : ContDiffOn ℝ ∞ G (earlyStrip T hT J hJ).carrier) |
| 294 | {Φ : ℝ × ℝ → ℝ} (hΦ : ContDiff ℝ ∞ Φ) : |
| 295 | ContDiffOn ℝ ∞ (transformedMaster Φ G) (masterDomain T J) := by |
| 296 | apply hΦ.comp_contDiffOn |
| 297 | apply (master_smooth hT hJ hG).prodMk |
| 298 | intro p hp |
| 299 | exact ((hG.contDiffAt ((earlyStrip T hT J hJ).isOpen.mem_nhds |
| 300 | (show (0, p.2) ∈ (earlyStrip T hT J hJ).carrier from ⟨hT, hp.2⟩))).comp p |
| 301 | (contDiffAt_const.prodMk contDiffAt_snd)).contDiffWithinAt |
| 302 | |
| 303 | /-- All fixed parameter jets of any smooth transformation of the path and its |
| 304 | endpoint converge uniformly on the whole nonnegative-time hold. Applying Φ |
| 305 | to x, exp x, x-b, or exp(x-b) gives field, log-field, and relative-field jets. -/ |
| 306 | theorem continuation_parameter_jet_close {T : ℝ} (hT : 0 < T) {J : Set ℝ} (hJ : IsOpen J) |
| 307 | {G : Field} (hG : ContDiffOn ℝ ∞ G (earlyStrip T hT J hJ).carrier) |
| 308 | {Φ : ℝ × ℝ → ℝ} (hΦ : ContDiff ℝ ∞ Φ) |
| 309 | {K : Set ℝ} (hK : IsCompact K) (hKJ : K ⊆ J) (k : ℕ) |
| 310 | {ε : ℝ} (hε : 0 < ε) : |
| 311 | ∃ δ₀ > 0, ∀ δ, 0 < δ → δ < δ₀ → ∀ t, 0 ≤ t → ∀ η ∈ K, |
| 312 | |iteratedDeriv k (fun y => Φ (continuation δ G (t, y), G (0, y))) η - |
| 313 | iteratedDeriv k (fun y => Φ (G (0, y), G (0, y))) η| < ε := by |
| 314 | obtain ⟨r, hr, hc⟩ := master_parameter_jet_close hT hJ |
| 315 | (transformedMaster_smooth hT hJ hG hΦ) (fun y => Φ (G (0, y), G (0, y))) |
| 316 | (fun u η => by simp only [transformedMaster, master_at_zero]) hK hKJ k hε |
| 317 | refine ⟨min r (T / 4), lt_min hr (by positivity), ?_⟩ |
| 318 | intro δ hδ hδ₀ t ht η hη |
| 319 | have hδT : 2 * δ < T := by have := hδ₀.trans_le (min_le_right _ _); linarith |
| 320 | have hδr : |δ| < r := by rw [abs_of_pos hδ]; exact hδ₀.trans_le (min_le_left _ _) |
| 321 | have heq : (fun y => Φ (continuation δ G (t, y), G (0, y))) =ᶠ[𝓝 η] |
| 322 | (fun y => transformedMaster Φ G ((δ, holdTime δ t), y)) := by |
| 323 | filter_upwards [hJ.mem_nhds (hKJ hη)] with y hy |
| 324 | rw [continuation_eq_master_hold hT hδ hδT hJ hG hy ht] |
| 325 | rfl |
| 326 | rw [heq.iteratedDeriv_eq k] |
| 327 | exact hc δ hδr (holdTime δ t) (holdTime_mem hδ ht) η hη |
| 328 | |
| 329 | def parameterInterval : Set ℝ := |
| 330 | Ioo NaturalAxisCoefficients.window.left NaturalAxisCoefficients.window.right |
| 331 | |
| 332 | theorem parameterInterval_open : IsOpen parameterInterval := isOpen_Ioo |
| 333 | |
| 334 | def rampLimit : ℝ := Real.log (41 / 40 : ℝ) |
| 335 | |
| 336 | theorem rampLimit_pos : 0 < rampLimit := Real.log_pos (by norm_num) |
| 337 | |
| 338 | theorem exists_small_length {ε : ℝ} (hε : 0 < ε) : |
| 339 | ∃ δ : ℝ, 0 < δ ∧ 2 * δ < rampLimit ∧ δ < ε := by |
| 340 | have hT := rampLimit_pos |
| 341 | refine ⟨min (rampLimit / 4) (ε / 2), lt_min (by positivity) (by positivity), ?_, ?_⟩ |
| 342 | · have := min_le_left (rampLimit / 4) (ε / 2) |
| 343 | have := rampLimit_pos |
| 344 | linarith |
| 345 | · have := min_le_right (rampLimit / 4) (ε / 2) |
| 346 | linarith |
| 347 | |
| 348 | /-- Only the proved natural-profile regularity and positivity are used in |
| 349 | constructing REF. The natural ODE is not replaced by a surrogate assumption. -/ |
| 350 | structure Input where |
| 351 | scale : ℝ |
| 352 | scale_pos : 0 < scale |
| 353 | f : Field |
| 354 | U : Field |
| 355 | f_smooth : ContDiffOn ℝ ∞ f (NaturalProfile.domain scale) |
| 356 | U_smooth : ContDiffOn ℝ ∞ U (NaturalProfile.domain scale) |
| 357 | positive : ∀ p ∈ NaturalProfile.domain scale, 0 ≤ scale * p.1 → |
| 358 | scale * p.1 ≤ 41 / 10 → 0 < f p |
| 359 | |
| 360 | def Input.ofNatural {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} |
| 361 | {d : NaturalAxisCoefficients.AnalyticInputs h j σ P0} |
| 362 | (hΛ : 0 < Λ) (F : NaturalProfile.ProfileFamily d Λ C) : Input where |
| 363 | scale := Λ |
| 364 | scale_pos := hΛ |
| 365 | f := F.f |
| 366 | U := F.U |
| 367 | f_smooth := F.natural.f_smooth |
| 368 | U_smooth := F.natural.U_smooth |
| 369 | positive := F.positive |
| 370 | |
| 371 | namespace Input |
| 372 | |
| 373 | variable (N : Input) |
| 374 | |
| 375 | def endpoint : ℝ := 4 / N.scale |
| 376 | |
| 377 | theorem endpoint_pos : 0 < N.endpoint := div_pos (by norm_num) N.scale_pos |
| 378 | |
| 379 | theorem scale_endpoint : N.scale * N.endpoint = 4 := by |
| 380 | dsimp [endpoint] |
| 381 | field_simp [N.scale_pos.ne'] |
| 382 | |
| 383 | def fromLog (p : Point) : Point := (N.endpoint * Real.exp p.1, p.2) |
| 384 | def logTime (X : ℝ) : ℝ := Real.log (X / N.endpoint) |
| 385 | def logF : Field := fun p => Real.log (N.f (N.fromLog p)) |
| 386 | def logU : Field := fun p => N.U (N.fromLog p) |
| 387 | |
| 388 | theorem fromLog_smooth : ContDiff ℝ ∞ N.fromLog := |
| 389 | (contDiff_const.mul contDiff_fst.exp).prodMk contDiff_snd |
| 390 | |
| 391 | theorem fromLog_scaled (p : Point) : N.scale * (N.fromLog p).1 = 4 * Real.exp p.1 := by |
| 392 | dsimp [fromLog] |
| 393 | rw [← mul_assoc, N.scale_endpoint] |
| 394 | |
| 395 | theorem fromLog_mem {p : Point} |
| 396 | (hp : p ∈ (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier) : |
| 397 | N.fromLog p ∈ NaturalProfile.domain N.scale := by |
| 398 | change (-20 < N.scale * (N.fromLog p).1 ∧ N.scale * (N.fromLog p).1 < 20) ∧ p.2 ∈ parameterInterval |
| 399 | rw [N.fromLog_scaled] |
| 400 | have hupper : Real.exp p.1 < 41 / 40 := by |
| 401 | simpa only [rampLimit, Real.exp_log (by norm_num : (0 : ℝ) < 41 / 40)] using Real.exp_lt_exp.mpr hp.1 |
| 402 | refine ⟨⟨?_, ?_⟩, hp.2⟩ <;> nlinarith [Real.exp_pos p.1] |
| 403 | |
| 404 | theorem fromLog_f_pos {p : Point} |
| 405 | (hp : p ∈ (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier) : |
| 406 | 0 < N.f (N.fromLog p) := by |
| 407 | apply N.positive _ (N.fromLog_mem hp) |
| 408 | · rw [N.fromLog_scaled]; positivity |
| 409 | · rw [N.fromLog_scaled] |
| 410 | have hupper : Real.exp p.1 < 41 / 40 := by |
| 411 | simpa only [rampLimit, Real.exp_log (by norm_num : (0 : ℝ) < 41 / 40)] using Real.exp_lt_exp.mpr hp.1 |
| 412 | linarith |
| 413 | |
| 414 | theorem logF_smooth : ContDiffOn ℝ ∞ N.logF |
| 415 | (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier := by |
| 416 | intro p hp |
| 417 | exact (((N.f_smooth.contDiffAt ((NaturalProfile.domain_isOpen N.scale).mem_nhds |
| 418 | (N.fromLog_mem hp))).comp p N.fromLog_smooth.contDiffAt).log (N.fromLog_f_pos hp).ne').contDiffWithinAt |
| 419 | |
| 420 | theorem logU_smooth : ContDiffOn ℝ ∞ N.logU |
| 421 | (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier := |
| 422 | N.U_smooth.comp N.fromLog_smooth.contDiffOn (fun _ hp => N.fromLog_mem hp) |
| 423 | |
| 424 | theorem fromLog_logTime {X η : ℝ} (hX : 0 < X) : |
| 425 | N.fromLog (N.logTime X, η) = (X, η) := by |
| 426 | ext |
| 427 | · dsimp [fromLog, logTime] |
| 428 | rw [Real.exp_log (div_pos hX N.endpoint_pos)] |
| 429 | field_simp [N.endpoint_pos.ne'] |
| 430 | · rfl |
| 431 | |
| 432 | theorem logTime_fromLog (t : ℝ) : N.logTime (N.endpoint * Real.exp t) = t := by |
| 433 | dsimp [logTime] |
| 434 | rw [mul_div_cancel_left₀ _ N.endpoint_pos.ne', Real.log_exp] |
| 435 | |
| 436 | theorem logTime_le_iff {X t : ℝ} (hX : 0 < X) : |
| 437 | N.logTime X ≤ t ↔ X ≤ N.endpoint * Real.exp t := by |
| 438 | rw [logTime, Real.log_le_iff_le_exp (div_pos hX N.endpoint_pos), div_le_iff₀ N.endpoint_pos] |
| 439 | rw [mul_comm] |
| 440 | |
| 441 | theorem le_logTime_iff {X t : ℝ} (hX : 0 < X) : |
| 442 | t ≤ N.logTime X ↔ N.endpoint * Real.exp t ≤ X := by |
| 443 | rw [logTime, Real.le_log_iff_exp_le (div_pos hX N.endpoint_pos), le_div_iff₀ N.endpoint_pos] |
| 444 | rw [mul_comm] |
| 445 | |
| 446 | /-- The radial domain of the extended profiles has no upper radial endpoint. -/ |
| 447 | def radialDomain : RadialDomain where |
| 448 | carrier := {p | -20 < N.scale * p.1 ∧ p.2 ∈ parameterInterval} |
| 449 | isOpen := (isOpen_lt continuous_const (continuous_const.mul continuous_fst)).inter |
| 450 | (parameterInterval_open.preimage continuous_snd) |
| 451 | scale_mem := by |
| 452 | intro p hp t ht |
| 453 | refine ⟨?_, hp.2⟩ |
| 454 | rw [show N.scale * (t * p.1) = t * (N.scale * p.1) by ring] |
| 455 | rcases le_total (N.scale * p.1) 0 with hs | hs |
| 456 | · have hb := mul_le_mul_of_nonpos_right ht.2 hs |
| 457 | exact hp.1.trans_le (by simpa only [one_mul] using hb) |
| 458 | · exact lt_of_lt_of_le (by norm_num) (mul_nonneg ht.1 hs) |
| 459 | |
| 460 | theorem natural_mem_of_le_endpoint {p : Point} (hp : p ∈ N.radialDomain.carrier) |
| 461 | (hX : p.1 ≤ N.endpoint) : p ∈ NaturalProfile.domain N.scale := by |
| 462 | change (-20 < N.scale * p.1 ∧ N.scale * p.1 < 20) ∧ p.2 ∈ parameterInterval |
| 463 | refine ⟨⟨hp.1, ?_⟩, hp.2⟩ |
| 464 | have hb := mul_le_mul_of_nonneg_left hX N.scale_pos.le |
| 465 | rw [N.scale_endpoint] at hb |
| 466 | linarith |
| 467 | |
| 468 | def refF (δ : ℝ) : Field := fun p => if p.1 ≤ N.endpoint then N.f p else |
| 469 | Real.exp (continuation δ N.logF (N.logTime p.1, p.2)) |
| 470 | |
| 471 | def refU (δ : ℝ) : Field := fun p => if p.1 ≤ N.endpoint then N.U p else |
| 472 | continuation δ N.logU (N.logTime p.1, p.2) |
| 473 | |
| 474 | theorem refF_eq_natural_initial (δ : ℝ) {p : Point} (hp : p.1 ≤ N.endpoint) : |
| 475 | N.refF δ p = N.f p := ite_eq_left hp |
| 476 | |
| 477 | theorem refU_eq_natural_initial (δ : ℝ) {p : Point} (hp : p.1 ≤ N.endpoint) : |
| 478 | N.refU δ p = N.U p := ite_eq_left hp |
| 479 | |
| 480 | theorem refF_pos (δ : ℝ) {p : Point} (hp : p ∈ N.radialDomain.carrier) (hX : 0 ≤ p.1) : |
| 481 | 0 < N.refF δ p := by |
| 482 | by_cases hx : p.1 ≤ N.endpoint |
| 483 | · rw [N.refF_eq_natural_initial δ hx] |
| 484 | apply N.positive _ (N.natural_mem_of_le_endpoint hp hx) (mul_nonneg N.scale_pos.le hX) |
| 485 | have hb := mul_le_mul_of_nonneg_left hx N.scale_pos.le |
| 486 | rw [N.scale_endpoint] at hb |
| 487 | linarith |
| 488 | · rw [refF, ite_eq_right hx] |
| 489 | exact Real.exp_pos _ |
| 490 | |
| 491 | theorem refF_eq_natural {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 492 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : p.1 ≤ N.endpoint * Real.exp δ) : |
| 493 | N.refF δ p = N.f p := by |
| 494 | by_cases hx : p.1 ≤ N.endpoint |
| 495 | · exact N.refF_eq_natural_initial δ hx |
| 496 | · have hxpos : 0 < p.1 := N.endpoint_pos.trans (lt_of_not_ge hx) |
| 497 | have ht := (N.logTime_le_iff hxpos).2 hX |
| 498 | have htT : N.logTime p.1 < rampLimit := ht.trans_lt (by linarith) |
| 499 | rw [refF, ite_eq_right hx, continuation_eq_natural rampLimit_pos hδ hδT |
| 500 | parameterInterval_open N.logF_smooth (p := (N.logTime p.1, p.2)) hη ht] |
| 501 | change Real.exp (Real.log (N.f (N.fromLog (N.logTime p.1, p.2)))) = _ |
| 502 | rw [Real.exp_log (N.fromLog_f_pos (p := (N.logTime p.1, p.2)) ⟨htT, hη⟩), N.fromLog_logTime hxpos] |
| 503 | |
| 504 | theorem refU_eq_natural {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 505 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : p.1 ≤ N.endpoint * Real.exp δ) : |
| 506 | N.refU δ p = N.U p := by |
| 507 | by_cases hx : p.1 ≤ N.endpoint |
| 508 | · exact N.refU_eq_natural_initial δ hx |
| 509 | · have hxpos : 0 < p.1 := N.endpoint_pos.trans (lt_of_not_ge hx) |
| 510 | rw [refU, ite_eq_right hx, continuation_eq_natural rampLimit_pos hδ hδT |
| 511 | parameterInterval_open N.logU_smooth (p := (N.logTime p.1, p.2)) hη ((N.logTime_le_iff hxpos).2 hX)] |
| 512 | change N.U (N.fromLog (N.logTime p.1, p.2)) = _ |
| 513 | rw [N.fromLog_logTime hxpos] |
| 514 | |
| 515 | theorem refF_eq_logtime {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 516 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : 0 < p.1) : |
| 517 | N.refF δ p = Real.exp (continuation δ N.logF (N.logTime p.1, p.2)) := by |
| 518 | by_cases hx : p.1 ≤ N.endpoint |
| 519 | · have ht : N.logTime p.1 ≤ 0 := (N.logTime_le_iff hX).2 (by simpa only [Real.exp_zero, mul_one] using hx) |
| 520 | have htδ := ht.trans hδ.le |
| 521 | rw [refF, ite_eq_left hx, continuation_eq_natural rampLimit_pos hδ hδT |
| 522 | parameterInterval_open N.logF_smooth (p := (N.logTime p.1, p.2)) hη htδ] |
| 523 | have hpos := N.fromLog_f_pos (p := (N.logTime p.1, p.2)) ⟨ht.trans_lt rampLimit_pos, hη⟩ |
| 524 | dsimp [logF] |
| 525 | rw [Real.exp_log hpos, N.fromLog_logTime hX] |
| 526 | · exact ite_eq_right hx |
| 527 | |
| 528 | theorem refU_eq_logtime {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 529 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : 0 < p.1) : |
| 530 | N.refU δ p = continuation δ N.logU (N.logTime p.1, p.2) := by |
| 531 | by_cases hx : p.1 ≤ N.endpoint |
| 532 | · have ht : N.logTime p.1 ≤ 0 := (N.logTime_le_iff hX).2 (by simpa only [Real.exp_zero, mul_one] using hx) |
| 533 | rw [refU, ite_eq_left hx, continuation_eq_natural rampLimit_pos hδ hδT |
| 534 | parameterInterval_open N.logU_smooth (p := (N.logTime p.1, p.2)) hη (ht.trans hδ.le)] |
| 535 | change N.U p = N.U (N.fromLog (N.logTime p.1, p.2)) |
| 536 | rw [N.fromLog_logTime hX] |
| 537 | · exact ite_eq_right hx |
| 538 | |
| 539 | theorem logtime_smoothAt {p : Point} (hX : 0 < p.1) : |
| 540 | ContDiffAt ℝ ∞ (fun q : Point => (N.logTime q.1, q.2)) p := |
| 541 | ((contDiffAt_fst.div_const N.endpoint).log (div_ne_zero hX.ne' N.endpoint_pos.ne')).prodMk contDiffAt_snd |
| 542 | |
| 543 | theorem refF_smooth {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) : |
| 544 | ContDiffOn ℝ ∞ (N.refF δ) N.radialDomain.carrier := by |
| 545 | intro p hp |
| 546 | by_cases hX : 0 < p.1 |
| 547 | · have hs := ((continuation_smooth rampLimit_pos hδ hδT parameterInterval_open N.logF_smooth).contDiffAt |
| 548 | ((fullStrip parameterInterval parameterInterval_open).isOpen.mem_nhds |
| 549 | (show (N.logTime p.1, p.2) ∈ (fullStrip parameterInterval parameterInterval_open).carrier from |
| 550 | ⟨mem_univ _, hp.2⟩))).comp p (N.logtime_smoothAt hX) |
| 551 | have heq : N.refF δ =ᶠ[𝓝 p] (fun q => Real.exp (continuation δ N.logF (N.logTime q.1, q.2))) := by |
| 552 | filter_upwards [continuousAt_fst.eventually (Ioi_mem_nhds hX), |
| 553 | continuousAt_snd.eventually (parameterInterval_open.mem_nhds hp.2)] with q hqX hqη |
| 554 | exact N.refF_eq_logtime hδ hδT hqη hqX |
| 555 | exact (hs.exp.congr_of_eventuallyEq heq).contDiffWithinAt |
| 556 | · have hbefore : p.1 < N.endpoint := (le_of_not_gt hX).trans_lt N.endpoint_pos |
| 557 | have hs := N.f_smooth.contDiffAt ((NaturalProfile.domain_isOpen N.scale).mem_nhds |
| 558 | (N.natural_mem_of_le_endpoint hp hbefore.le)) |
| 559 | have heq : N.refF δ =ᶠ[𝓝 p] N.f := by |
| 560 | filter_upwards [continuousAt_fst.eventually (Iio_mem_nhds hbefore)] with q hq |
| 561 | exact N.refF_eq_natural_initial δ hq.le |
| 562 | exact (hs.congr_of_eventuallyEq heq).contDiffWithinAt |
| 563 | |
| 564 | theorem refU_smooth {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) : |
| 565 | ContDiffOn ℝ ∞ (N.refU δ) N.radialDomain.carrier := by |
| 566 | intro p hp |
| 567 | by_cases hX : 0 < p.1 |
| 568 | · have hs := ((continuation_smooth rampLimit_pos hδ hδT parameterInterval_open N.logU_smooth).contDiffAt |
| 569 | ((fullStrip parameterInterval parameterInterval_open).isOpen.mem_nhds |
| 570 | (show (N.logTime p.1, p.2) ∈ (fullStrip parameterInterval parameterInterval_open).carrier from |
| 571 | ⟨mem_univ _, hp.2⟩))).comp p (N.logtime_smoothAt hX) |
| 572 | have heq : N.refU δ =ᶠ[𝓝 p] (fun q => continuation δ N.logU (N.logTime q.1, q.2)) := by |
| 573 | filter_upwards [continuousAt_fst.eventually (Ioi_mem_nhds hX), |
| 574 | continuousAt_snd.eventually (parameterInterval_open.mem_nhds hp.2)] with q hqX hqη |
| 575 | exact N.refU_eq_logtime hδ hδT hqη hqX |
| 576 | exact (hs.congr_of_eventuallyEq heq).contDiffWithinAt |
| 577 | · have hbefore : p.1 < N.endpoint := (le_of_not_gt hX).trans_lt N.endpoint_pos |
| 578 | have hs := N.U_smooth.contDiffAt ((NaturalProfile.domain_isOpen N.scale).mem_nhds |
| 579 | (N.natural_mem_of_le_endpoint hp hbefore.le)) |
| 580 | have heq : N.refU δ =ᶠ[𝓝 p] N.U := by |
| 581 | filter_upwards [continuousAt_fst.eventually (Iio_mem_nhds hbefore)] with q hq |
| 582 | exact N.refU_eq_natural_initial δ hq.le |
| 583 | exact (hs.congr_of_eventuallyEq heq).contDiffWithinAt |
| 584 | |
| 585 | theorem refF_frozen {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 586 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : N.endpoint * Real.exp (2 * δ) ≤ p.1) : |
| 587 | N.refF δ p = Real.exp (continuation δ N.logF (2 * δ, p.2)) := by |
| 588 | have hp : 0 < p.1 := (mul_pos N.endpoint_pos (Real.exp_pos _)).trans_le hX |
| 589 | rw [N.refF_eq_logtime hδ hδT hη hp, |
| 590 | continuation_frozen rampLimit_pos hδ hδT parameterInterval_open N.logF_smooth |
| 591 | (p := (N.logTime p.1, p.2)) hη ((N.le_logTime_iff hp).2 hX)] |
| 592 | |
| 593 | theorem refU_frozen {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 594 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : N.endpoint * Real.exp (2 * δ) ≤ p.1) : |
| 595 | N.refU δ p = continuation δ N.logU (2 * δ, p.2) := by |
| 596 | have hp : 0 < p.1 := (mul_pos N.endpoint_pos (Real.exp_pos _)).trans_le hX |
| 597 | rw [N.refU_eq_logtime hδ hδT hη hp, |
| 598 | continuation_frozen rampLimit_pos hδ hδT parameterInterval_open N.logU_smooth |
| 599 | (p := (N.logTime p.1, p.2)) hη ((N.le_logTime_iff hp).2 hX)] |
| 600 | |
| 601 | /-- Actual pressure, moments, and lag variables are recomputed from REF. -/ |
| 602 | def histories {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 603 | (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) : ProfileHistories.Profiles N.radialDomain where |
| 604 | f := N.refF δ |
| 605 | U := N.refU δ |
| 606 | f_smooth := N.refF_smooth hδ hδT |
| 607 | U_smooth := N.refU_smooth hδ hδT |
| 608 | pressure0 := P0 |
| 609 | pressure0_smooth := fun _ _ => hP0.contDiffAt |
| 610 | |
| 611 | theorem logTime_hasDerivAt {X : ℝ} (hX : 0 < X) : HasDerivAt N.logTime (1 / X) X := by |
| 612 | have hd := ((hasDerivAt_id X).div_const N.endpoint).log |
| 613 | (div_ne_zero hX.ne' N.endpoint_pos.ne') |
| 614 | apply hd.congr_deriv |
| 615 | simp only [id_eq] |
| 616 | field_simp [N.endpoint_pos.ne', hX.ne'] |
| 617 | |
| 618 | theorem log_refF_hasDerivAt {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 619 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : 0 < p.1) : |
| 620 | HasDerivAt (fun X => Real.log (N.refF δ (X, p.2))) |
| 621 | (slopeCutoff δ (N.logTime p.1) * radialPartial N.logF (N.logTime p.1, p.2) / p.1) p.1 := by |
| 622 | have hd := (continuation_hasDerivAt rampLimit_pos hδ hδT parameterInterval_open |
| 623 | N.logF_smooth (p := (N.logTime p.1, p.2)) hη).comp p.1 (N.logTime_hasDerivAt hX) |
| 624 | have hd' : HasDerivAt (fun X => continuation δ N.logF (N.logTime X, p.2)) |
| 625 | (slopeCutoff δ (N.logTime p.1) * radialPartial N.logF (N.logTime p.1, p.2) / p.1) p.1 := by |
| 626 | convert! hd using 1 ; ring |
| 627 | apply hd'.congr_of_eventuallyEq |
| 628 | filter_upwards [Ioi_mem_nhds hX] with X hXX |
| 629 | rw [N.refF_eq_logtime hδ hδT (p := (X, p.2)) hη hXX, Real.log_exp] |
| 630 | |
| 631 | theorem refU_hasDerivAt {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 632 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : 0 < p.1) : |
| 633 | HasDerivAt (fun X => N.refU δ (X, p.2)) |
| 634 | (slopeCutoff δ (N.logTime p.1) * radialPartial N.logU (N.logTime p.1, p.2) / p.1) p.1 := by |
| 635 | have hd := (continuation_hasDerivAt rampLimit_pos hδ hδT parameterInterval_open |
| 636 | N.logU_smooth (p := (N.logTime p.1, p.2)) hη).comp p.1 (N.logTime_hasDerivAt hX) |
| 637 | have hd' : HasDerivAt (fun X => continuation δ N.logU (N.logTime X, p.2)) |
| 638 | (slopeCutoff δ (N.logTime p.1) * radialPartial N.logU (N.logTime p.1, p.2) / p.1) p.1 := by |
| 639 | convert! hd using 1 ; ring |
| 640 | apply hd'.congr_of_eventuallyEq |
| 641 | filter_upwards [Ioi_mem_nhds hX] with X hXX |
| 642 | exact N.refU_eq_logtime hδ hδT hη hXX |
| 643 | |
| 644 | theorem natural_logtime_deriv {F : Field} (hF : ContDiffOn ℝ ∞ F (NaturalProfile.domain N.scale)) |
| 645 | {p : Point} (hp : p ∈ (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier) : |
| 646 | HasDerivAt (fun t => F (N.fromLog (t, p.2))) |
| 647 | ((N.fromLog p).1 * radialPartial F (N.fromLog p)) p.1 := by |
| 648 | have hf := (hF.contDiffAt ((NaturalProfile.domain_isOpen N.scale).mem_nhds (N.fromLog_mem hp))).differentiableAt (by simp) |
| 649 | have hs := hf.hasFDerivAt.comp_hasDerivAt (N.fromLog p).1 |
| 650 | ((hasDerivAt_id (N.fromLog p).1).prodMk (hasDerivAt_const (N.fromLog p).1 p.2)) |
| 651 | have hd := hs.comp p.1 ((Real.hasDerivAt_exp p.1).const_mul N.endpoint) |
| 652 | simpa only [fromLog, radialPartial, Function.comp_def, id_eq, mul_comm] using hd |
| 653 | |
| 654 | theorem radialPartial_logF {p : Point} |
| 655 | (hp : p ∈ (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier) : |
| 656 | radialPartial N.logF p = |
| 657 | (N.fromLog p).1 * radialPartial N.f (N.fromLog p) / N.f (N.fromLog p) := |
| 658 | (radialPartial_hasDerivAt (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open) |
| 659 | N.logF_smooth hp).unique ((N.natural_logtime_deriv N.f_smooth hp).log (N.fromLog_f_pos hp).ne') |
| 660 | |
| 661 | theorem radialPartial_logU {p : Point} |
| 662 | (hp : p ∈ (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier) : |
| 663 | radialPartial N.logU p = (N.fromLog p).1 * radialPartial N.U (N.fromLog p) := |
| 664 | (radialPartial_hasDerivAt (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open) |
| 665 | N.logU_smooth hp).unique (N.natural_logtime_deriv N.U_smooth hp) |
| 666 | |
| 667 | /-- Exact same-X damping of the natural logarithmic slope on the natural region. -/ |
| 668 | theorem same_radius_log_slope {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 669 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : 0 < p.1) (ht : N.logTime p.1 < rampLimit) : |
| 670 | p.1 * deriv (fun X => Real.log (N.refF δ (X, p.2))) p.1 = |
| 671 | slopeCutoff δ (N.logTime p.1) * (p.1 * radialPartial N.f p / N.f p) := by |
| 672 | rw [(N.log_refF_hasDerivAt hδ hδT hη hX).deriv, |
| 673 | N.radialPartial_logF (p := (N.logTime p.1, p.2)) ⟨ht, hη⟩, N.fromLog_logTime hX] |
| 674 | rw [← mul_div_assoc, mul_div_cancel_left₀ _ hX.ne'] |
| 675 | |
| 676 | /-- Exact same-X damping of the natural axial slope. -/ |
| 677 | theorem same_radius_U_slope {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) |
| 678 | {p : Point} (hη : p.2 ∈ parameterInterval) (hX : 0 < p.1) (ht : N.logTime p.1 < rampLimit) : |
| 679 | p.1 * deriv (fun X => N.refU δ (X, p.2)) p.1 = |
| 680 | slopeCutoff δ (N.logTime p.1) * (p.1 * radialPartial N.U p) := by |
| 681 | rw [(N.refU_hasDerivAt hδ hδT hη hX).deriv, |
| 682 | N.radialPartial_logU (p := (N.logTime p.1, p.2)) ⟨ht, hη⟩, N.fromLog_logTime hX] |
| 683 | field_simp |
| 684 | |
| 685 | theorem endpoint_f_pos {η : ℝ} (hη : η ∈ parameterInterval) : 0 < N.f (N.endpoint, η) := by |
| 686 | simpa only [fromLog, Real.exp_zero, mul_one] using N.fromLog_f_pos (p := (0, η)) ⟨rampLimit_pos, hη⟩ |
| 687 | |
| 688 | theorem ref_log_transformed_jet_close {Φ : ℝ × ℝ → ℝ} (hΦ : ContDiff ℝ ∞ Φ) |
| 689 | {K : Set ℝ} (hK : IsCompact K) (hKJ : K ⊆ parameterInterval) (k : ℕ) |
| 690 | {ε : ℝ} (hε : 0 < ε) : |
| 691 | ∃ δ₀ > 0, ∀ δ, 0 < δ → δ < δ₀ → ∀ X, N.endpoint ≤ X → ∀ η ∈ K, |
| 692 | |iteratedDeriv k (fun y => Φ (Real.log (N.refF δ (X, y)), Real.log (N.f (N.endpoint, y)))) η - |
| 693 | iteratedDeriv k (fun y => Φ (Real.log (N.f (N.endpoint, y)), Real.log (N.f (N.endpoint, y)))) η| < ε := by |
| 694 | obtain ⟨r, hr, hc⟩ := continuation_parameter_jet_close rampLimit_pos parameterInterval_open |
| 695 | N.logF_smooth hΦ hK hKJ k hε |
| 696 | refine ⟨min r (rampLimit / 4), lt_min hr (div_pos rampLimit_pos (by norm_num)), ?_⟩ |
| 697 | intro δ hδ hδ₀ X hX η hη |
| 698 | have hδT : 2 * δ < rampLimit := by have := hδ₀.trans_le (min_le_right _ _); linarith |
| 699 | have hXpos := N.endpoint_pos.trans_le hX |
| 700 | have ht : 0 ≤ N.logTime X := (N.le_logTime_iff hXpos).2 (by simpa only [Real.exp_zero, mul_one] using hX) |
| 701 | have heq : (fun y => Φ (Real.log (N.refF δ (X, y)), Real.log (N.f (N.endpoint, y)))) =ᶠ[𝓝 η] |
| 702 | (fun y => Φ (continuation δ N.logF (N.logTime X, y), N.logF (0, y))) := by |
| 703 | filter_upwards [parameterInterval_open.mem_nhds (hKJ hη)] with y hy |
| 704 | rw [N.refF_eq_logtime hδ hδT hy hXpos, Real.log_exp] |
| 705 | simp only [logF, fromLog, Real.exp_zero, mul_one] |
| 706 | rw [heq.iteratedDeriv_eq k] |
| 707 | simpa only [logF, fromLog, Real.exp_zero, mul_one] using |
| 708 | hc δ hδ (hδ₀.trans_le (min_le_left _ _)) (N.logTime X) ht η hη |
| 709 | |
| 710 | theorem ref_U_transformed_jet_close {Φ : ℝ × ℝ → ℝ} (hΦ : ContDiff ℝ ∞ Φ) |
| 711 | {K : Set ℝ} (hK : IsCompact K) (hKJ : K ⊆ parameterInterval) (k : ℕ) |
| 712 | {ε : ℝ} (hε : 0 < ε) : |
| 713 | ∃ δ₀ > 0, ∀ δ, 0 < δ → δ < δ₀ → ∀ X, N.endpoint ≤ X → ∀ η ∈ K, |
| 714 | |iteratedDeriv k (fun y => Φ (N.refU δ (X, y), N.U (N.endpoint, y))) η - |
| 715 | iteratedDeriv k (fun y => Φ (N.U (N.endpoint, y), N.U (N.endpoint, y))) η| < ε := by |
| 716 | obtain ⟨r, hr, hc⟩ := continuation_parameter_jet_close rampLimit_pos parameterInterval_open |
| 717 | N.logU_smooth hΦ hK hKJ k hε |
| 718 | refine ⟨min r (rampLimit / 4), lt_min hr (div_pos rampLimit_pos (by norm_num)), ?_⟩ |
| 719 | intro δ hδ hδ₀ X hX η hη |
| 720 | have hδT : 2 * δ < rampLimit := by have := hδ₀.trans_le (min_le_right _ _); linarith |
| 721 | have hXpos := N.endpoint_pos.trans_le hX |
| 722 | have ht : 0 ≤ N.logTime X := (N.le_logTime_iff hXpos).2 (by simpa only [Real.exp_zero, mul_one] using hX) |
| 723 | have heq : (fun y => Φ (N.refU δ (X, y), N.U (N.endpoint, y))) =ᶠ[𝓝 η] |
| 724 | (fun y => Φ (continuation δ N.logU (N.logTime X, y), N.logU (0, y))) := by |
| 725 | filter_upwards [parameterInterval_open.mem_nhds (hKJ hη)] with y hy |
| 726 | rw [N.refU_eq_logtime hδ hδT hy hXpos] |
| 727 | simp only [logU, fromLog, Real.exp_zero, mul_one] |
| 728 | rw [heq.iteratedDeriv_eq k] |
| 729 | simpa only [logU, fromLog, Real.exp_zero, mul_one] using |
| 730 | hc δ hδ (hδ₀.trans_le (min_le_left _ _)) (N.logTime X) ht η hη |
| 731 | |
| 732 | theorem iteratedDeriv_zero_function (k : ℕ) : |
| 733 | iteratedDeriv k (fun _ : ℝ => (0 : ℝ)) = fun _ => 0 := by |
| 734 | induction k with |
| 735 | | zero => rfl |
| 736 | | succ k ih => |
| 737 | funext x |
| 738 | rw [iteratedDeriv_succ, ih] |
| 739 | exact deriv_const x 0 |
| 740 | |
| 741 | theorem ref_log_error_jet_close {K : Set ℝ} (hK : IsCompact K) |
| 742 | (hKJ : K ⊆ parameterInterval) (k : ℕ) {ε : ℝ} (hε : 0 < ε) : |
| 743 | ∃ δ₀ > 0, ∀ δ, 0 < δ → δ < δ₀ → ∀ X, N.endpoint ≤ X → ∀ η ∈ K, |
| 744 | |iteratedDeriv k (fun y => Real.log (N.refF δ (X, y)) - Real.log (N.f (N.endpoint, y))) η| < ε := by |
| 745 | obtain ⟨r, hr, hc⟩ := N.ref_log_transformed_jet_close |
| 746 | (contDiff_fst.sub contDiff_snd) hK hKJ k hε |
| 747 | refine ⟨r, hr, ?_⟩ |
| 748 | intro δ hδ hδr X hX η hη |
| 749 | simpa only [sub_self, iteratedDeriv_zero_function, sub_zero] using hc δ hδ hδr X hX η hη |
| 750 | |
| 751 | theorem ref_U_error_jet_close {K : Set ℝ} (hK : IsCompact K) |
| 752 | (hKJ : K ⊆ parameterInterval) (k : ℕ) {ε : ℝ} (hε : 0 < ε) : |
| 753 | ∃ δ₀ > 0, ∀ δ, 0 < δ → δ < δ₀ → ∀ X, N.endpoint ≤ X → ∀ η ∈ K, |
| 754 | |iteratedDeriv k (fun y => N.refU δ (X, y) - N.U (N.endpoint, y)) η| < ε := by |
| 755 | obtain ⟨r, hr, hc⟩ := N.ref_U_transformed_jet_close |
| 756 | (contDiff_fst.sub contDiff_snd) hK hKJ k hε |
| 757 | refine ⟨r, hr, ?_⟩ |
| 758 | intro δ hδ hδr X hX η hη |
| 759 | simpa only [sub_self, iteratedDeriv_zero_function, sub_zero] using hc δ hδ hδr X hX η hη |
| 760 | |
| 761 | theorem ref_relative_error_jet_close {K : Set ℝ} (hK : IsCompact K) |
| 762 | (hKJ : K ⊆ parameterInterval) (k : ℕ) {ε : ℝ} (hε : 0 < ε) : |
| 763 | ∃ δ₀ > 0, ∀ δ, 0 < δ → δ < δ₀ → ∀ X, N.endpoint ≤ X → ∀ η ∈ K, |
| 764 | |iteratedDeriv k (fun y => N.refF δ (X, y) / N.f (N.endpoint, y) - 1) η| < ε := by |
| 765 | obtain ⟨r, hr, hc⟩ := N.ref_log_transformed_jet_close |
| 766 | (Φ := fun p => Real.exp (p.1 - p.2) - 1) |
| 767 | ((contDiff_fst.sub contDiff_snd).exp.sub contDiff_const) hK hKJ k hε |
| 768 | refine ⟨r, hr, ?_⟩ |
| 769 | intro δ hδ hδr X hX η hη |
| 770 | have hXpos := N.endpoint_pos.trans_le hX |
| 771 | have hb : |iteratedDeriv k (fun y => Real.exp |
| 772 | (Real.log (N.refF δ (X, y)) - Real.log (N.f (N.endpoint, y))) - 1) η| < ε := by |
| 773 | simpa only [sub_self, Real.exp_zero, iteratedDeriv_zero_function, sub_zero] using hc δ hδ hδr X hX η hη |
| 774 | have heq : (fun y => N.refF δ (X, y) / N.f (N.endpoint, y) - 1) =ᶠ[𝓝 η] |
| 775 | (fun y => Real.exp (Real.log (N.refF δ (X, y)) - Real.log (N.f (N.endpoint, y))) - 1) := by |
| 776 | filter_upwards [parameterInterval_open.mem_nhds (hKJ hη)] with y hy |
| 777 | have hp : (X, y) ∈ N.radialDomain.carrier := |
| 778 | ⟨lt_trans (by norm_num) (mul_pos N.scale_pos hXpos), hy⟩ |
| 779 | rw [Real.exp_sub, Real.exp_log (N.refF_pos δ hp hXpos.le), Real.exp_log (N.endpoint_f_pos hy)] |
| 780 | rw [heq.iteratedDeriv_eq k] |
| 781 | exact hb |
| 782 | |
| 783 | theorem ref_field_error_jet_close {K : Set ℝ} (hK : IsCompact K) |
| 784 | (hKJ : K ⊆ parameterInterval) (k : ℕ) {ε : ℝ} (hε : 0 < ε) : |
| 785 | ∃ δ₀ > 0, ∀ δ, 0 < δ → δ < δ₀ → ∀ X, N.endpoint ≤ X → ∀ η ∈ K, |
| 786 | |iteratedDeriv k (fun y => N.refF δ (X, y) - N.f (N.endpoint, y)) η| < ε := by |
| 787 | obtain ⟨r, hr, hc⟩ := N.ref_log_transformed_jet_close |
| 788 | (contDiff_fst.exp.sub contDiff_snd.exp) hK hKJ k hε |
| 789 | refine ⟨r, hr, ?_⟩ |
| 790 | intro δ hδ hδr X hX η hη |
| 791 | have hXpos := N.endpoint_pos.trans_le hX |
| 792 | have hb : |iteratedDeriv k (fun y => Real.exp (Real.log (N.refF δ (X, y))) - |
| 793 | Real.exp (Real.log (N.f (N.endpoint, y)))) η| < ε := by |
| 794 | simpa only [sub_self, iteratedDeriv_zero_function, sub_zero] using hc δ hδ hδr X hX η hη |
| 795 | have heq : (fun y => N.refF δ (X, y) - N.f (N.endpoint, y)) =ᶠ[𝓝 η] |
| 796 | (fun y => Real.exp (Real.log (N.refF δ (X, y))) - Real.exp (Real.log (N.f (N.endpoint, y)))) := by |
| 797 | filter_upwards [parameterInterval_open.mem_nhds (hKJ hη)] with y hy |
| 798 | have hp : (X, y) ∈ N.radialDomain.carrier := |
| 799 | ⟨lt_trans (by norm_num) (mul_pos N.scale_pos hXpos), hy⟩ |
| 800 | rw [Real.exp_log (N.refF_pos δ hp hXpos.le), Real.exp_log (N.endpoint_f_pos hy)] |
| 801 | rw [heq.iteratedDeriv_eq k] |
| 802 | exact hb |
| 803 | |
| 804 | def Xbig : ℝ := 100 |
| 805 | def Xi : ℝ := 110 |
| 806 | |
| 807 | theorem freeze_before_Xbig (hscale : 1 ≤ N.scale) {δ : ℝ} (hδT : 2 * δ < rampLimit) : |
| 808 | N.endpoint * Real.exp (2 * δ) < Xbig := by |
| 809 | have he : Real.exp (2 * δ) < 41 / 40 := by |
| 810 | simpa only [rampLimit, Real.exp_log (by norm_num : (0 : ℝ) < 41 / 40)] using Real.exp_lt_exp.mpr hδT |
| 811 | have hb : N.endpoint ≤ 4 := by |
| 812 | change 4 / N.scale ≤ 4 |
| 813 | apply (div_le_iff₀ N.scale_pos).2 |
| 814 | linarith |
| 815 | have hm := mul_le_mul_of_nonneg_right hb (Real.exp_pos (2 * δ)).le |
| 816 | dsimp [Xbig] |
| 817 | linarith |
| 818 | |
| 819 | /-- In particular the reference is already frozen throughout [100,110]. -/ |
| 820 | theorem frozen_through_Xi (hscale : 1 ≤ N.scale) {δ : ℝ} (hδ : 0 < δ) |
| 821 | (hδT : 2 * δ < rampLimit) {p : Point} (hη : p.2 ∈ parameterInterval) |
| 822 | (hX : p.1 ∈ Icc Xbig Xi) : |
| 823 | N.refF δ p = Real.exp (continuation δ N.logF (2 * δ, p.2)) ∧ |
| 824 | N.refU δ p = continuation δ N.logU (2 * δ, p.2) := by |
| 825 | have hfreeze := (N.freeze_before_Xbig hscale hδT).le.trans hX.1 |
| 826 | exact ⟨N.refF_frozen hδ hδT hη hfreeze, N.refU_frozen hδ hδT hη hfreeze⟩ |
| 827 | |
| 828 | end Input |
| 829 | |
| 830 | end NavierStokes.ReferencePath |
| 831 | |
| 832 | end |