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.HeatedOutgoing |
| 2 | import NavierStokes.OutgoingCone |
| 3 | import Mathlib.Analysis.Calculus.MeanValue |
| 4 | import Mathlib.Topology.MetricSpace.Thickening |
| 5 | |
| 6 | /-! |
| 7 | # The compensated heat switch preserves the outgoing cone |
| 8 | |
| 9 | The inverse entrance radius, the three compensation coefficients, and their |
| 10 | actual parameter derivatives are finite-dimensional perturbation parameters. |
| 11 | All estimates are on a fixed logarithmic interval, before the fully switched |
| 12 | terminal edge. Constants are chosen after the outgoing profile and before |
| 13 | the entrance radius. |
| 14 | -/ |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | open Set Filter Function MeasureTheory |
| 19 | open scoped ContDiff Topology BigOperators |
| 20 | open NavierStokes.OutgoingProfile (Profile) |
| 21 | |
| 22 | namespace NavierStokes.HeatSwitchCone |
| 23 | |
| 24 | |
| 25 | /-- A smooth finite-dimensional family has a uniform first-order estimate in |
| 26 | its control variable near a compact convex set of base points. -/ |
| 27 | theorem compact_control_estimate |
| 28 | {P B V : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] [FiniteDimensional ℝ P] |
| 29 | [NormedAddCommGroup B] [NormedSpace ℝ B] |
| 30 | [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 31 | {s : Set B} (hs : IsCompact s) (hc : Convex ℝ s) |
| 32 | {u : Set (P × B)} (hu : IsOpen u) (hsub : ({0} : Set P) ×ˢ s ⊆ u) |
| 33 | {f : P × B → V} (hf : ContDiffOn ℝ ∞ f u) : |
| 34 | ∃ r L : ℝ, 0 < r ∧ 0 ≤ L ∧ ∀ p : P, ‖p‖ ≤ r → ∀ b ∈ s, |
| 35 | (p, b) ∈ u ∧ ‖f (p, b) - f (0, b)‖ ≤ L * ‖p‖ := by |
| 36 | obtain ⟨r, hr, hru⟩ := (isCompact_singleton.prod hs).exists_cthickening_subset_open hu hsub |
| 37 | let t : Set (P × B) := Metric.closedBall 0 r ×ˢ s |
| 38 | have htu : t ⊆ u := by |
| 39 | intro z hz |
| 40 | apply hru |
| 41 | apply Metric.mem_cthickening_of_dist_le z (0, z.2) r (({0} : Set P) ×ˢ s) |
| 42 | · exact ⟨rfl, hz.2⟩ |
| 43 | · simpa [Prod.dist_eq, Metric.mem_closedBall, dist_zero_right] using hz.1 |
| 44 | have ht : IsCompact t := (isCompact_closedBall (0 : P) r).prod hs |
| 45 | have hd : ContinuousOn (fderiv ℝ f) t := by |
| 46 | intro z hz |
| 47 | exact (((hf.contDiffAt (hu.mem_nhds (htu hz))).fderiv_right |
| 48 | (m := 0) (by simp)).continuousAt).continuousWithinAt |
| 49 | obtain ⟨L, hL⟩ := ht.exists_bound_of_continuousOn hd |
| 50 | refine ⟨r, max 0 L, hr, le_max_left _ _, ?_⟩ |
| 51 | intro p hp b hb |
| 52 | have hp' : (p, b) ∈ t := ⟨by simpa using hp, hb⟩ |
| 53 | have h0 : ((0 : P), b) ∈ t := ⟨by simpa using hr.le, hb⟩ |
| 54 | refine ⟨htu hp', ?_⟩ |
| 55 | have he := Convex.norm_image_sub_le_of_norm_fderiv_le |
| 56 | (fun z hz => (hf.contDiffAt (hu.mem_nhds (htu hz))).differentiableAt (by simp)) |
| 57 | (fun z hz => (hL z hz).trans (le_max_right 0 L)) |
| 58 | ((convex_closedBall (0 : P) r).prod hc) h0 hp' |
| 59 | simpa only [Prod.mk_sub_mk, sub_zero, sub_self, Prod.norm_mk, norm_zero, |
| 60 | max_eq_left (norm_nonneg p)] using he |
| 61 | |
| 62 | abbrev Point := ℝ × ℝ |
| 63 | abbrev Coeff := TerminalCompensation.Coeff |
| 64 | abbrev Raw := (ℝ × Coeff) × Point |
| 65 | abbrev Control := ℝ × (Coeff × Coeff) |
| 66 | |
| 67 | /-- The genuine heat multiplier, smoothly continued only in the auxiliary |
| 68 | inverse-radius variable and outside the physical parameter band. -/ |
| 69 | noncomputable def freeE (F : Profile) (z : Raw) : ℝ := |
| 70 | F.logE z.2 * (1 + OutgoingSchedule.sigma |
| 71 | ((z.2.1 - HeatTailEdit.switchStart F.data) / (3 / 10)) * |
| 72 | (HeatProfileExtension.extension (1 + F.data.h) |
| 73 | (2 * (1 - z.2.2 ^ 2) * z.1.1 * Real.exp (-z.2.1)) - 1)) + |
| 74 | OutgoingDilation.shapedPatchAmplitude F z.2.2 * TerminalCompensation.correction OutgoingDilation.compensationPatch z.1.2 |
| 75 | (Real.exp (z.2.1 - OutgoingDilation.patchClock F)) |
| 76 | |
| 77 | theorem freeE_contDiff (F : Profile) : ContDiff ℝ ∞ (freeE F) := by |
| 78 | have he := F.logE_contDiff.comp (contDiff_snd : ContDiff ℝ ∞ (fun z : Raw => z.2)) |
| 79 | have hs : ContDiff ℝ ∞ (fun z : Raw => OutgoingSchedule.sigma |
| 80 | ((z.2.1 - HeatTailEdit.switchStart F.data) / (3 / 10))) := |
| 81 | OutgoingSchedule.sigma_contDiff.comp ((contDiff_snd.fst.sub contDiff_const).div_const _) |
| 82 | have hz : ContDiff ℝ ∞ (fun z : Raw => |
| 83 | 2 * (1 - z.2.2 ^ 2) * z.1.1 * Real.exp (-z.2.1)) := |
| 84 | ((contDiff_const.mul (contDiff_const.sub (contDiff_snd.snd.pow 2))).mul |
| 85 | contDiff_fst.fst).mul contDiff_snd.fst.neg.exp |
| 86 | have hh := (HeatProfileExtension.extension_contDiff |
| 87 | (show 1 < 1 + F.data.h by linarith [F.data.h_pos])).comp hz |
| 88 | have hb : ContDiff ℝ ∞ (fun z : Raw => TerminalCompensation.correction OutgoingDilation.compensationPatch z.1.2 |
| 89 | (Real.exp (z.2.1 - OutgoingDilation.patchClock F))) := by |
| 90 | apply ContDiff.sum |
| 91 | intro j _ |
| 92 | exact ((contDiff_apply ℝ ℝ j).comp contDiff_fst.snd).mul |
| 93 | ((TerminalCompensation.bump_contDiff OutgoingDilation.compensationPatch j).comp |
| 94 | (contDiff_snd.fst.sub contDiff_const).exp) |
| 95 | exact (he.mul (contDiff_const.add (hs.mul (hh.sub contDiff_const)))).add |
| 96 | (((OutgoingDilation.shapedPatchAmplitude_contDiff F).comp contDiff_snd.snd).mul hb) |
| 97 | |
| 98 | @[simp] theorem freeE_zero (F : Profile) (p : Point) : freeE F ((0, 0), p) = F.logE p := by |
| 99 | simp [freeE, HeatProfileExtension.extension_zero |
| 100 | (show 1 < 1 + F.data.h by linarith [F.data.h_pos]), TerminalCompensation.correction] |
| 101 | |
| 102 | /-- The normalized integral of a perturbation, starting at the reserved patch. -/ |
| 103 | noncomputable def finitePrefix (F : Profile) (f : Raw → ℝ) (z : Raw) : ℝ := |
| 104 | ∫ t in OutgoingDilation.patchClock F..z.2.1, f (z.1, (t, z.2.2)) |
| 105 | |
| 106 | theorem finitePrefix_contDiff (F : Profile) {f : Raw → ℝ} (hf : ContDiff ℝ ∞ f) : |
| 107 | ContDiff ℝ ∞ (finitePrefix F f) := by |
| 108 | have hmap : ContDiff ℝ ∞ (fun z : ((ℝ × Coeff) × ℝ) × ℝ => |
| 109 | (z.1.1, (z.2, z.1.2)) : (((ℝ × Coeff) × ℝ) × ℝ) → Raw) := |
| 110 | contDiff_fst.fst.prodMk (contDiff_snd.prodMk contDiff_fst.snd) |
| 111 | have hg : ContDiff ℝ ∞ (fun z : ((ℝ × Coeff) × ℝ) × ℝ => f (z.1.1, (z.2, z.1.2))) := |
| 112 | hf.comp hmap |
| 113 | have hi : ContDiff ℝ ∞ (fun z : ((ℝ × Coeff) × ℝ) × ℝ => |
| 114 | ∫ t in OutgoingDilation.patchClock F..z.2, f (z.1.1, (t, z.1.2))) := |
| 115 | HeatedOutgoing.anchoredPrimitive_contDiff (P := (ℝ × Coeff) × ℝ) |
| 116 | (fun z => f (z.1.1, (z.2, z.1.2))) hg (OutgoingDilation.patchClock F) |
| 117 | have hm : ContDiff ℝ ∞ (fun z : Raw => ((z.1, z.2.2), z.2.1)) := |
| 118 | (contDiff_fst.prodMk contDiff_snd.snd).prodMk contDiff_snd.fst |
| 119 | have hh := hi.comp hm |
| 120 | exact hh |
| 121 | |
| 122 | noncomputable def freeI (F : Profile) (z : Raw) : ℝ := |
| 123 | OutgoingHistories.I F.reset z.2 + finitePrefix F |
| 124 | (fun q => Real.exp (3 * q.2.1 / 2) * (freeE F q - F.logE q.2)) z |
| 125 | |
| 126 | noncomputable def freeS (F : Profile) (z : Raw) : ℝ := |
| 127 | OutgoingHistories.S F.reset F.amp z.2 - (1 / 2 : ℝ) * finitePrefix F |
| 128 | (fun q => Real.exp q.2.1 * (freeE F q ^ 2 - F.logE q.2 ^ 2)) z |
| 129 | |
| 130 | noncomputable def freePi (F : Profile) (z : Raw) : ℝ := |
| 131 | OutgoingHistories.Pi F.reset z.2 + (1 / 2 : ℝ) * finitePrefix F |
| 132 | (fun q => freeE F q ^ 2 - F.logE q.2 ^ 2) z |
| 133 | |
| 134 | theorem freeI_contDiff (F : Profile) : ContDiff ℝ ∞ (freeI F) := by |
| 135 | exact ((OutgoingHistories.I_smooth F.reset).comp contDiff_snd).add |
| 136 | (finitePrefix_contDiff F (((contDiff_const.mul contDiff_snd.fst).div_const 2).exp.mul |
| 137 | ((freeE_contDiff F).sub (F.logE_contDiff.comp contDiff_snd)))) |
| 138 | |
| 139 | theorem freeS_contDiff (F : Profile) : ContDiff ℝ ∞ (freeS F) := by |
| 140 | exact ((OutgoingHistories.S_smooth F.reset F.amp_contDiff).comp contDiff_snd).sub |
| 141 | (contDiff_const.mul (finitePrefix_contDiff F (contDiff_snd.fst.exp.mul |
| 142 | (((freeE_contDiff F).pow 2).sub ((F.logE_contDiff.comp contDiff_snd).pow 2))))) |
| 143 | |
| 144 | theorem freePi_contDiff (F : Profile) : ContDiff ℝ ∞ (freePi F) := by |
| 145 | exact ((OutgoingHistories.Pi_smooth F.reset).comp contDiff_snd).add |
| 146 | (contDiff_const.mul (finitePrefix_contDiff F |
| 147 | (((freeE_contDiff F).pow 2).sub ((F.logE_contDiff.comp contDiff_snd).pow 2)))) |
| 148 | |
| 149 | @[simp] theorem freeI_zero (F : Profile) (p : Point) : |
| 150 | freeI F ((0, 0), p) = OutgoingHistories.I F.reset p := by |
| 151 | change OutgoingHistories.I F.reset p + |
| 152 | (∫ t in OutgoingDilation.patchClock F..p.1, |
| 153 | Real.exp (3 * t / 2) * (freeE F ((0, 0), (t, p.2)) - F.logE (t, p.2))) = _ |
| 154 | simp only [freeE_zero, sub_self, mul_zero, intervalIntegral.integral_zero, add_zero] |
| 155 | |
| 156 | @[simp] theorem freeS_zero (F : Profile) (p : Point) : |
| 157 | freeS F ((0, 0), p) = OutgoingHistories.S F.reset F.amp p := by |
| 158 | change OutgoingHistories.S F.reset F.amp p - (1 / 2 : ℝ) * |
| 159 | (∫ t in OutgoingDilation.patchClock F..p.1, |
| 160 | Real.exp t * (freeE F ((0, 0), (t, p.2)) ^ 2 - F.logE (t, p.2) ^ 2)) = _ |
| 161 | simp only [freeE_zero, sub_self, mul_zero, intervalIntegral.integral_zero, sub_zero] |
| 162 | |
| 163 | @[simp] theorem freePi_zero (F : Profile) (p : Point) : |
| 164 | freePi F ((0, 0), p) = OutgoingHistories.Pi F.reset p := by |
| 165 | change OutgoingHistories.Pi F.reset p + (1 / 2 : ℝ) * |
| 166 | (∫ t in OutgoingDilation.patchClock F..p.1, |
| 167 | freeE F ((0, 0), (t, p.2)) ^ 2 - F.logE (t, p.2) ^ 2) = _ |
| 168 | simp only [freeE_zero, sub_self, intervalIntegral.integral_zero, mul_zero, add_zero] |
| 169 | |
| 170 | noncomputable def rawPoint (z : Control × Point) : Raw := ((z.1.1, z.1.2.1), z.2) |
| 171 | |
| 172 | noncomputable def value (f : Raw → ℝ) (z : Control × Point) : ℝ := f (rawPoint z) |
| 173 | noncomputable def radialJet (f : Raw → ℝ) (z : Control × Point) : ℝ := |
| 174 | fderiv ℝ f (rawPoint z) ((0, 0), (1, 0)) |
| 175 | noncomputable def parameterJet (f : Raw → ℝ) (z : Control × Point) : ℝ := |
| 176 | fderiv ℝ f (rawPoint z) ((0, z.1.2.2), (0, 1)) |
| 177 | |
| 178 | theorem rawPoint_contDiff : ContDiff ℝ ∞ rawPoint := |
| 179 | (contDiff_fst.fst.prodMk contDiff_fst.snd.fst).prodMk contDiff_snd |
| 180 | |
| 181 | theorem value_contDiff {f : Raw → ℝ} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (value f) := |
| 182 | hf.comp rawPoint_contDiff |
| 183 | |
| 184 | theorem radialJet_contDiff {f : Raw → ℝ} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (radialJet f) := |
| 185 | ((hf.fderiv_right (m := ∞) (by simp)).comp rawPoint_contDiff).clm_apply contDiff_const |
| 186 | |
| 187 | theorem parameterJet_contDiff {f : Raw → ℝ} (hf : ContDiff ℝ ∞ f) : |
| 188 | ContDiff ℝ ∞ (parameterJet f) := |
| 189 | ((hf.fderiv_right (m := ∞) (by simp)).comp rawPoint_contDiff).clm_apply |
| 190 | ((contDiff_const.prodMk contDiff_fst.snd.snd).prodMk contDiff_const) |
| 191 | |
| 192 | theorem radialJet_hasDerivAt {f : Raw → ℝ} (hf : ContDiff ℝ ∞ f) |
| 193 | (v : Control) (p : Point) : |
| 194 | HasDerivAt (fun y => value f (v, (y, p.2))) (radialJet f (v, p)) p.1 := by |
| 195 | have hg : HasDerivAt (fun y => ((v.1, v.2.1), (y, p.2)) : ℝ → Raw) |
| 196 | ((0, 0), (1, 0)) p.1 := |
| 197 | (hasDerivAt_const _ _).prodMk ((hasDerivAt_id _).prodMk (hasDerivAt_const _ _)) |
| 198 | exact ((hf.differentiable (by simp) _).hasFDerivAt.comp_hasDerivAt _ hg) |
| 199 | |
| 200 | theorem parameterJet_hasDerivWithinAt {f : Raw → ℝ} (hf : ContDiff ℝ ∞ f) |
| 201 | {c : ℝ → Coeff} {dc : Coeff} {s : Set ℝ} {eta : ℝ} |
| 202 | (hc : HasDerivWithinAt c dc s eta) (delta y : ℝ) : |
| 203 | HasDerivWithinAt (fun t => f ((delta, c t), (y, t))) |
| 204 | (parameterJet f ((delta, (c eta, dc)), (y, eta))) s eta := by |
| 205 | have hg : HasDerivWithinAt (fun t => ((delta, c t), (y, t)) : ℝ → Raw) |
| 206 | ((0, dc), (0, 1)) s eta := |
| 207 | ((hasDerivWithinAt_const _ _ _).prodMk hc).prodMk |
| 208 | ((hasDerivWithinAt_const _ _ _).prodMk (hasDerivWithinAt_id _ _)) |
| 209 | exact ((hf.differentiable (by simp) _).hasFDerivAt.comp_hasDerivWithinAt _ hg) |
| 210 | |
| 211 | theorem radialJet_zero {f : Raw → ℝ} {g : Point → ℝ} |
| 212 | (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) |
| 213 | (hzero : ∀ p, f ((0, 0), p) = g p) (p : Point) : |
| 214 | radialJet f (0, p) = OutgoingHistories.dY g p := by |
| 215 | have hd := radialJet_hasDerivAt hf (0 : Control) p |
| 216 | have he : (fun y => value f (0, (y, p.2))) = (fun y => g (y, p.2)) := by |
| 217 | funext y |
| 218 | exact hzero _ |
| 219 | rw [he] at hd |
| 220 | exact hd.unique (OutgoingHistories.dY_hasDerivAt hg p) |
| 221 | |
| 222 | theorem parameterJet_zero {f : Raw → ℝ} {g : Point → ℝ} |
| 223 | (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) |
| 224 | (hzero : ∀ p, f ((0, 0), p) = g p) (p : Point) : |
| 225 | parameterJet f (0, p) = OutgoingHistories.dEta g p := by |
| 226 | have hd := parameterJet_hasDerivWithinAt hf |
| 227 | (hasDerivWithinAt_const p.2 univ (0 : Coeff)) 0 p.1 |
| 228 | have he : (fun t => f ((0, 0), (p.1, t))) = (fun t => g (p.1, t)) := by |
| 229 | funext t |
| 230 | exact hzero _ |
| 231 | rw [he] at hd |
| 232 | exact (hasDerivWithinAt_univ.mp hd).unique (OutgoingHistories.dEta_hasDerivAt hg p) |
| 233 | |
| 234 | theorem radius_quotient (XR y a : ℝ) (hXR : 0 < XR) : |
| 235 | XR * Real.exp y / (XR * Real.exp a) = Real.exp (y - a) := by |
| 236 | rw [Real.exp_sub] |
| 237 | field_simp |
| 238 | |
| 239 | /-- Exact equality with the physical edit, including the actual diffusion |
| 240 | `1 - eta^2` and all three additive compensation bumps. -/ |
| 241 | theorem freeE_eq_physical (F : Profile) (XR : ℝ) (c : ℝ → Coeff) |
| 242 | (hXR : 0 < XR) (y eta : ℝ) (heta : eta ∈ HeatedOutgoing.parameterDomain) : |
| 243 | freeE F ((1 / XR, c eta), (y, eta)) = |
| 244 | HeatedOutgoing.E F XR c (XR * Real.exp y, eta) := by |
| 245 | have hs : (XR * Real.exp y, eta) ∈ HeatedOutgoing.domain := |
| 246 | ⟨mul_pos hXR (Real.exp_pos _), heta⟩ |
| 247 | rw [HeatedOutgoing.E, HeatedOutgoing.heatE_eq_extended F XR hs] |
| 248 | have hz : 2 * (1 - eta ^ 2) * (1 / XR) * Real.exp (-y) = |
| 249 | 2 * (1 - eta ^ 2) / (XR * Real.exp y) := by |
| 250 | rw [Real.exp_neg] |
| 251 | ring |
| 252 | simp only [freeE, HeatedOutgoing.extendedHeatE, HeatedOutgoing.patchIncrement, |
| 253 | OutgoingDilation.E, OutgoingProfile.Profile.E, OutgoingDilation.switchRadius, |
| 254 | OutgoingDilation.patchRadius, OutgoingDilation.radius, HeatTailEdit.switch, |
| 255 | HeatProfileExtension.physicalProfile, HeatProfileExtension.scaledProfile, |
| 256 | mul_div_cancel_left₀ _ hXR.ne', radius_quotient XR y _ hXR, Real.log_exp, hz] |
| 257 | |
| 258 | noncomputable def controls (F : Profile) {XR C : ℝ} |
| 259 | (w : HeatedOutgoing.CompensationWitness F XR C) (eta : ℝ) : Control := |
| 260 | (1 / XR, (w.coefficients eta, derivWithin w.coefficients HeatedOutgoing.parameterDomain eta)) |
| 261 | |
| 262 | theorem controls_norm (F : Profile) {XR C : ℝ} |
| 263 | (w : HeatedOutgoing.CompensationWitness F XR C) {eta : ℝ} |
| 264 | (heta : eta ∈ HeatedOutgoing.parameterDomain) : |
| 265 | ‖controls F w eta‖ ≤ |
| 266 | max (Real.exp (HeatTailEdit.switchStart F.data)) C / OutgoingDilation.switchRadius F XR := by |
| 267 | have hK := OutgoingDilation.switchRadius_pos F XR w.radius_pos |
| 268 | have hfirst : ‖(1 : ℝ) / XR‖ = Real.exp (HeatTailEdit.switchStart F.data) / |
| 269 | OutgoingDilation.switchRadius F XR := by |
| 270 | rw [Real.norm_eq_abs, abs_of_pos (div_pos zero_lt_one w.radius_pos)] |
| 271 | unfold OutgoingDilation.switchRadius OutgoingDilation.radius |
| 272 | rw [mul_comm XR] |
| 273 | simpa only [mul_one] using |
| 274 | (mul_div_mul_left (1 : ℝ) XR (Real.exp_ne_zero (HeatTailEdit.switchStart F.data))).symm |
| 275 | rw [controls, Prod.norm_mk, Prod.norm_mk, hfirst] |
| 276 | apply max_le |
| 277 | · exact (div_le_div_iff_of_pos_right hK).mpr (le_max_left _ _) |
| 278 | · exact (max_le (w.coefficient_bound eta heta) (w.derivative_bound eta heta)).trans |
| 279 | ((div_le_div_iff_of_pos_right hK).mpr (le_max_right _ _)) |
| 280 | |
| 281 | open StressAlgebra |
| 282 | |
| 283 | noncomputable def angularNumerator (F : Profile) (z : Control × Point) : ℝ := |
| 284 | -OutgoingHistories.W F.data F.amp z.2 * |
| 285 | (Real.exp (3 * z.2.1 / 2) * value (freeE F) z) + |
| 286 | ((1 - F.data.h) * value (freeI F) z - axialExponent F.data.h * z.2.2 * |
| 287 | parameterJet (freeI F) z - coordinateFactor z.2.2 * |
| 288 | OutgoingHistories.dEta (OutgoingHistories.J F.reset F.amp) z.2 + |
| 289 | 2 * (F.data.h - axialExponent F.data.h) * z.2.2 * |
| 290 | OutgoingHistories.J F.reset F.amp z.2) |
| 291 | |
| 292 | noncomputable def radialNumerator (F : Profile) (z : Control × Point) : ℝ := |
| 293 | value (freeE F) z - 2 * radialJet (freeE F) z |
| 294 | |
| 295 | noncomputable def familyQ (F : Profile) (z : Control × Point) : ℝ := |
| 296 | angularNumerator F z / (Real.exp (3 * z.2.1 / 2) * value (freeE F) z) |
| 297 | |
| 298 | noncomputable def familyN (F : Profile) (z : Control × Point) : ℝ := |
| 299 | -OutgoingHistories.W F.data F.amp z.2 * F.logU z.2 + |
| 300 | axialExponent F.data.h * (OutgoingHistories.M F.data F.amp z.2 - |
| 301 | z.2.2 * OutgoingHistories.dEta (OutgoingHistories.M F.data F.amp) z.2) / Real.exp z.2.1 + |
| 302 | (4 * F.data.h * z.2.2 * value (freeS F) z - |
| 303 | coordinateFactor z.2.2 * parameterJet (freeS F) z) / Real.exp z.2.1 + |
| 304 | 4 * velocityExponent F.data.h * z.2.2 * value (freePi F) z - |
| 305 | coordinateFactor z.2.2 * parameterJet (freePi F) z |
| 306 | |
| 307 | noncomputable def familyA (F : Profile) (z : Control × Point) : ℝ := |
| 308 | radialNumerator F z / value (freeE F) z |
| 309 | noncomputable def familyB (F : Profile) (z : Control × Point) : ℝ := |
| 310 | 2 * OutgoingHistories.dY F.logU z.2 / value (freeE F) z |
| 311 | noncomputable def familyR (F : Profile) (z : Control × Point) : ℝ := |
| 312 | familyN F z / (value (freeE F) z * familyQ F z) |
| 313 | noncomputable def familyC (F : Profile) (z : Control × Point) : ℝ := |
| 314 | 1 - familyB F z * familyR F z / familyA F z |
| 315 | noncomputable def familyJ (F : Profile) (z : Control × Point) : ℝ := |
| 316 | familyR F z + familyB F z / familyA F z |
| 317 | noncomputable def familyV (F : Profile) (z : Control × Point) : ℝ := |
| 318 | familyA F z * (1 + (familyB F z / familyA F z) ^ 2) |
| 319 | noncomputable def familyGap (F : Profile) (z : Control × Point) : ℝ := |
| 320 | 2 * familyC F z ^ 2 - (familyV F z - 2) * familyJ F z ^ 2 |
| 321 | |
| 322 | theorem angularNumerator_contDiff (F : Profile) : ContDiff ℝ ∞ (angularNumerator F) := by |
| 323 | have he := value_contDiff (freeE_contDiff F) |
| 324 | have hi := value_contDiff (freeI_contDiff F) |
| 325 | have hi' := parameterJet_contDiff (freeI_contDiff F) |
| 326 | have hj := (OutgoingHistories.J_smooth F.reset F.amp_contDiff).comp |
| 327 | (contDiff_snd : ContDiff ℝ ∞ (fun z : Control × Point => z.2)) |
| 328 | have hj' := (OutgoingHistories.dEta_smooth |
| 329 | (OutgoingHistories.J_smooth F.reset F.amp_contDiff)).comp |
| 330 | (contDiff_snd : ContDiff ℝ ∞ (fun z : Control × Point => z.2)) |
| 331 | have hw := (OutgoingHistories.W_smooth F.data F.amp_contDiff).comp |
| 332 | (contDiff_snd : ContDiff ℝ ∞ (fun z : Control × Point => z.2)) |
| 333 | have hd : ContDiff ℝ ∞ (fun z : Control × Point => coordinateFactor z.2.2) := |
| 334 | contDiff_const.sub (contDiff_snd.snd.pow 2) |
| 335 | exact (hw.neg.mul (((contDiff_const.mul contDiff_snd.fst).div_const 2).exp.mul he)).add |
| 336 | ((((contDiff_const.mul hi).sub |
| 337 | ((contDiff_const.mul contDiff_snd.snd).mul hi')).sub (hd.mul hj')).add |
| 338 | ((contDiff_const.mul contDiff_snd.snd).mul hj)) |
| 339 | |
| 340 | theorem radialNumerator_contDiff (F : Profile) : ContDiff ℝ ∞ (radialNumerator F) := |
| 341 | (value_contDiff (freeE_contDiff F)).sub (contDiff_const.mul (radialJet_contDiff (freeE_contDiff F))) |
| 342 | |
| 343 | theorem familyN_contDiff (F : Profile) : ContDiff ℝ ∞ (familyN F) := by |
| 344 | have hw := (OutgoingHistories.W_smooth F.data F.amp_contDiff).comp |
| 345 | (contDiff_snd : ContDiff ℝ ∞ (fun z : Control × Point => z.2)) |
| 346 | have hm := (OutgoingHistories.M_smooth F.data F.amp_contDiff).comp |
| 347 | (contDiff_snd : ContDiff ℝ ∞ (fun z : Control × Point => z.2)) |
| 348 | have hm' := (OutgoingHistories.dEta_smooth |
| 349 | (OutgoingHistories.M_smooth F.data F.amp_contDiff)).comp |
| 350 | (contDiff_snd : ContDiff ℝ ∞ (fun z : Control × Point => z.2)) |
| 351 | have hd : ContDiff ℝ ∞ (fun z : Control × Point => coordinateFactor z.2.2) := |
| 352 | contDiff_const.sub (contDiff_snd.snd.pow 2) |
| 353 | have hs := value_contDiff (freeS_contDiff F) |
| 354 | have hs' := parameterJet_contDiff (freeS_contDiff F) |
| 355 | have hp := value_contDiff (freePi_contDiff F) |
| 356 | have hp' := parameterJet_contDiff (freePi_contDiff F) |
| 357 | exact ((((hw.neg.mul (F.logU_contDiff.comp contDiff_snd)).add |
| 358 | ((contDiff_const.mul (hm.sub (contDiff_snd.snd.mul hm'))).div |
| 359 | contDiff_snd.fst.exp (fun z => (Real.exp_pos _).ne'))).add |
| 360 | ((((contDiff_const.mul contDiff_snd.snd).mul hs).sub (hd.mul hs')).div |
| 361 | contDiff_snd.fst.exp (fun z => (Real.exp_pos _).ne'))).add |
| 362 | ((contDiff_const.mul contDiff_snd.snd).mul hp)).sub (hd.mul hp') |
| 363 | |
| 364 | /-- This open set excludes only the denominators of the actual normalized |
| 365 | cone coordinates. Its zero-control slice contains the clean true cone. -/ |
| 366 | noncomputable def regular (F : Profile) : Set (Control × Point) := |
| 367 | {z | value (freeE F) z ≠ 0 ∧ angularNumerator F z ≠ 0 ∧ radialNumerator F z ≠ 0} |
| 368 | |
| 369 | theorem regular_isOpen (F : Profile) : IsOpen (regular F) := |
| 370 | (isOpen_ne_fun (value_contDiff (freeE_contDiff F)).continuous continuous_const).inter |
| 371 | ((isOpen_ne_fun (angularNumerator_contDiff F).continuous continuous_const).inter |
| 372 | (isOpen_ne_fun (radialNumerator_contDiff F).continuous continuous_const)) |
| 373 | |
| 374 | theorem familyQ_ne (F : Profile) {z : Control × Point} (hz : z ∈ regular F) : familyQ F z ≠ 0 := |
| 375 | div_ne_zero hz.2.1 (mul_ne_zero (Real.exp_ne_zero _) hz.1) |
| 376 | theorem familyA_ne (F : Profile) {z : Control × Point} (hz : z ∈ regular F) : familyA F z ≠ 0 := |
| 377 | div_ne_zero hz.2.2 hz.1 |
| 378 | |
| 379 | theorem familyQ_contDiffOn (F : Profile) : ContDiffOn ℝ ∞ (familyQ F) (regular F) := |
| 380 | (angularNumerator_contDiff F).contDiffOn.div |
| 381 | ((((contDiff_const.mul contDiff_snd.fst).div_const 2).exp).mul |
| 382 | (value_contDiff (freeE_contDiff F))).contDiffOn |
| 383 | (fun _ hz => mul_ne_zero (Real.exp_ne_zero _) hz.1) |
| 384 | theorem familyA_contDiffOn (F : Profile) : ContDiffOn ℝ ∞ (familyA F) (regular F) := |
| 385 | (radialNumerator_contDiff F).contDiffOn.div (value_contDiff (freeE_contDiff F)).contDiffOn |
| 386 | (fun _ hz => hz.1) |
| 387 | theorem familyB_contDiffOn (F : Profile) : ContDiffOn ℝ ∞ (familyB F) (regular F) := |
| 388 | (contDiff_const.mul ((OutgoingHistories.dY_smooth F.logU_contDiff).comp |
| 389 | contDiff_snd)).contDiffOn.div (value_contDiff (freeE_contDiff F)).contDiffOn (fun _ hz => hz.1) |
| 390 | theorem familyR_contDiffOn (F : Profile) : ContDiffOn ℝ ∞ (familyR F) (regular F) := |
| 391 | (familyN_contDiff F).contDiffOn.div |
| 392 | ((value_contDiff (freeE_contDiff F)).contDiffOn.mul (familyQ_contDiffOn F)) |
| 393 | (fun _ hz => mul_ne_zero hz.1 (familyQ_ne F hz)) |
| 394 | theorem familyC_contDiffOn (F : Profile) : ContDiffOn ℝ ∞ (familyC F) (regular F) := |
| 395 | contDiffOn_const.sub (((familyB_contDiffOn F).mul (familyR_contDiffOn F)).div |
| 396 | (familyA_contDiffOn F) (fun _ hz => familyA_ne F hz)) |
| 397 | theorem familyJ_contDiffOn (F : Profile) : ContDiffOn ℝ ∞ (familyJ F) (regular F) := |
| 398 | (familyR_contDiffOn F).add ((familyB_contDiffOn F).div |
| 399 | (familyA_contDiffOn F) (fun _ hz => familyA_ne F hz)) |
| 400 | theorem familyV_contDiffOn (F : Profile) : ContDiffOn ℝ ∞ (familyV F) (regular F) := |
| 401 | (familyA_contDiffOn F).mul (contDiffOn_const.add |
| 402 | (((familyB_contDiffOn F).div (familyA_contDiffOn F) (fun _ hz => familyA_ne F hz)).pow 2)) |
| 403 | theorem familyGap_contDiffOn (F : Profile) : ContDiffOn ℝ ∞ (familyGap F) (regular F) := |
| 404 | (contDiffOn_const.mul ((familyC_contDiffOn F).pow 2)).sub |
| 405 | (((familyV_contDiffOn F).sub contDiffOn_const).mul ((familyJ_contDiffOn F).pow 2)) |
| 406 | |
| 407 | @[simp] theorem familyQ_zero (F : Profile) (p : Point) : |
| 408 | familyQ F (0, p) = OutgoingHistories.Qs F.reset F.amp p := by |
| 409 | have hi := parameterJet_zero (freeI_contDiff F) (OutgoingHistories.I_smooth F.reset) |
| 410 | (freeI_zero F) p |
| 411 | rw [OutgoingHistories.Qs_integrated] |
| 412 | simp only [familyQ, angularNumerator, value, rawPoint, Prod.fst_zero, Prod.snd_zero, |
| 413 | freeE_zero, freeI_zero, hi] |
| 414 | rw [show OutgoingHistories.X p * OutgoingHistories.H F.reset p = |
| 415 | Real.exp (3 * p.1 / 2) * F.logE p from OutgoingHistories.angularWeight_eq F.reset p] |
| 416 | change (-OutgoingHistories.W F.data F.amp p * (Real.exp (3 * p.1 / 2) * F.logE p) + _) / |
| 417 | (Real.exp (3 * p.1 / 2) * F.logE p) = _ |
| 418 | have hp : F.logE p ≠ 0 := (OutgoingHistories.E_pos F.reset p).ne' |
| 419 | field_simp [(Real.exp_pos (3 * p.1 / 2)).ne', hp] |
| 420 | |
| 421 | @[simp] theorem familyN_zero (F : Profile) (p : Point) : |
| 422 | familyN F (0, p) = OutgoingHistories.Ns F.reset F.amp p := by |
| 423 | have hs := parameterJet_zero (freeS_contDiff F) |
| 424 | (OutgoingHistories.S_smooth F.reset F.amp_contDiff) (freeS_zero F) p |
| 425 | have hp := parameterJet_zero (freePi_contDiff F) (OutgoingHistories.Pi_smooth F.reset) |
| 426 | (freePi_zero F) p |
| 427 | rw [OutgoingHistories.Ns_integrated] |
| 428 | simp only [familyN, value, rawPoint, Prod.fst_zero, Prod.snd_zero, freeS_zero, freePi_zero, hs, hp] |
| 429 | rfl |
| 430 | |
| 431 | @[simp] theorem familyA_zero (F : Profile) (p : Point) : |
| 432 | familyA F (0, p) = OutgoingEntranceCone.coneA F.reset p := by |
| 433 | have he := radialJet_zero (freeE_contDiff F) F.logE_contDiff (freeE_zero F) p |
| 434 | rw [OutgoingEntranceCone.coneA_eq_E_derivative] |
| 435 | simp only [familyA, radialNumerator, value, rawPoint, Prod.fst_zero, Prod.snd_zero, |
| 436 | freeE_zero, he] |
| 437 | change (F.logE p - 2 * OutgoingHistories.dY F.logE p) / F.logE p = |
| 438 | 1 - 2 * OutgoingHistories.dY F.logE p / F.logE p |
| 439 | have hp : F.logE p ≠ 0 := (OutgoingHistories.E_pos F.reset p).ne' |
| 440 | field_simp |
| 441 | |
| 442 | @[simp] theorem familyB_zero (F : Profile) (p : Point) : |
| 443 | familyB F (0, p) = OutgoingEntranceCone.coneB F.reset F.amp p := by |
| 444 | simp only [familyB, value, rawPoint, Prod.fst_zero, Prod.snd_zero, freeE_zero] |
| 445 | rfl |
| 446 | @[simp] theorem familyR_zero (F : Profile) (p : Point) : |
| 447 | familyR F (0, p) = OutgoingEntranceCone.coneRatio F.reset F.amp p := by |
| 448 | simp only [familyR, familyN_zero, familyQ_zero, value, rawPoint, |
| 449 | Prod.fst_zero, Prod.snd_zero, freeE_zero] |
| 450 | rfl |
| 451 | @[simp] theorem familyC_zero (F : Profile) (p : Point) : |
| 452 | familyC F (0, p) = OutgoingCone.sourceC F.reset F.amp p := by |
| 453 | simp only [familyC, familyB_zero, familyR_zero, familyA_zero] |
| 454 | rfl |
| 455 | @[simp] theorem familyJ_zero (F : Profile) (p : Point) : |
| 456 | familyJ F (0, p) = OutgoingCone.sourceJ F.reset F.amp p := by |
| 457 | simp only [familyJ, familyB_zero, familyR_zero, familyA_zero] |
| 458 | rfl |
| 459 | @[simp] theorem familyV_zero (F : Profile) (p : Point) : |
| 460 | familyV F (0, p) = OutgoingCone.normalV F.reset F.amp p := by |
| 461 | simp only [familyV, familyB_zero, familyA_zero] |
| 462 | rfl |
| 463 | @[simp] theorem familyGap_zero (F : Profile) (p : Point) : |
| 464 | familyGap F (0, p) = OutgoingCone.leadingGap F.reset F.amp p := by |
| 465 | simp only [familyGap, familyC_zero, familyJ_zero, familyV_zero] |
| 466 | rfl |
| 467 | |
| 468 | /-- Evaluation at the actual compensation coefficients. -/ |
| 469 | noncomputable def realize (f : Raw → ℝ) (delta : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 470 | f ((delta, c p.2), p) |
| 471 | |
| 472 | theorem realize_radial_derivative {f : Raw → ℝ} (hf : ContDiff ℝ ∞ f) |
| 473 | (delta : ℝ) (c : ℝ → Coeff) (p : Point) (dc : Coeff) : |
| 474 | deriv (fun y => realize f delta c (y, p.2)) p.1 = |
| 475 | radialJet f ((delta, (c p.2, dc)), p) := |
| 476 | (radialJet_hasDerivAt hf (delta, (c p.2, dc)) p).deriv |
| 477 | |
| 478 | theorem realize_parameter_derivative {f : Raw → ℝ} (hf : ContDiff ℝ ∞ f) |
| 479 | (delta : ℝ) {c : ℝ → Coeff} |
| 480 | (hc : ContDiffOn ℝ ∞ c HeatedOutgoing.parameterDomain) |
| 481 | {p : Point} (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 482 | derivWithin (fun eta => realize f delta c (p.1, eta)) HeatedOutgoing.parameterDomain p.2 = |
| 483 | parameterJet f ((delta, (c p.2, derivWithin c HeatedOutgoing.parameterDomain p.2)), p) := by |
| 484 | exact (parameterJet_hasDerivWithinAt hf |
| 485 | ((hc.differentiableOn (by simp) p.2 hp).hasDerivWithinAt) delta p.1).derivWithin |
| 486 | (uniqueDiffOn_Icc (by norm_num) p.2 hp) |
| 487 | |
| 488 | /-- The actual angular velocity in the fixed logarithmic coordinate. -/ |
| 489 | noncomputable def logE (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 490 | HeatedOutgoing.E F XR c (XR * Real.exp p.1, p.2) |
| 491 | |
| 492 | /-- Incoming histories are retained. Only the integrals of the actual |
| 493 | changes beginning at the reserved patch are added. -/ |
| 494 | noncomputable def logI (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 495 | OutgoingHistories.I F.reset p + ∫ t in OutgoingDilation.patchClock F..p.1, |
| 496 | Real.exp (3 * t / 2) * (logE F XR c (t, p.2) - F.logE (t, p.2)) |
| 497 | |
| 498 | noncomputable def logS (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 499 | OutgoingHistories.S F.reset F.amp p - (1 / 2 : ℝ) * |
| 500 | ∫ t in OutgoingDilation.patchClock F..p.1, |
| 501 | Real.exp t * (logE F XR c (t, p.2) ^ 2 - F.logE (t, p.2) ^ 2) |
| 502 | |
| 503 | noncomputable def logPi (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 504 | OutgoingHistories.Pi F.reset p + (1 / 2 : ℝ) * |
| 505 | ∫ t in OutgoingDilation.patchClock F..p.1, |
| 506 | logE F XR c (t, p.2) ^ 2 - F.logE (t, p.2) ^ 2 |
| 507 | |
| 508 | theorem logE_eq_realize (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (hXR : 0 < XR) |
| 509 | (p : Point) (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 510 | logE F XR c p = realize (freeE F) (1 / XR) c p := |
| 511 | (freeE_eq_physical F XR c hXR p.1 p.2 hp).symm |
| 512 | |
| 513 | theorem logI_eq_realize (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (hXR : 0 < XR) |
| 514 | (p : Point) (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 515 | logI F XR c p = realize (freeI F) (1 / XR) c p := by |
| 516 | unfold logI realize freeI finitePrefix |
| 517 | congr 1 |
| 518 | apply intervalIntegral.integral_congr |
| 519 | intro t _ |
| 520 | dsimp only |
| 521 | rw [logE_eq_realize F XR c hXR (t, p.2) hp] |
| 522 | rfl |
| 523 | |
| 524 | theorem logS_eq_realize (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (hXR : 0 < XR) |
| 525 | (p : Point) (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 526 | logS F XR c p = realize (freeS F) (1 / XR) c p := by |
| 527 | unfold logS realize freeS finitePrefix |
| 528 | congr 2 |
| 529 | apply intervalIntegral.integral_congr |
| 530 | intro t _ |
| 531 | dsimp only |
| 532 | rw [logE_eq_realize F XR c hXR (t, p.2) hp] |
| 533 | rfl |
| 534 | |
| 535 | theorem logPi_eq_realize (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (hXR : 0 < XR) |
| 536 | (p : Point) (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 537 | logPi F XR c p = realize (freePi F) (1 / XR) c p := by |
| 538 | unfold logPi realize freePi finitePrefix |
| 539 | congr 2 |
| 540 | apply intervalIntegral.integral_congr |
| 541 | intro t _ |
| 542 | dsimp only |
| 543 | rw [logE_eq_realize F XR c hXR (t, p.2) hp] |
| 544 | rfl |
| 545 | |
| 546 | theorem logE_before_patch (F : Profile) {XR : ℝ} (hXR : 0 < XR) (c : ℝ → Coeff) |
| 547 | {p : Point} (hp : p.1 ≤ OutgoingDilation.patchClock F) : logE F XR c p = F.logE p := by |
| 548 | rw [logE, HeatedOutgoing.E_before_patch F XR c p.2 (XR * Real.exp p.1) hXR |
| 549 | (mul_pos hXR (Real.exp_pos _))] |
| 550 | · simp only [OutgoingDilation.E, OutgoingProfile.Profile.E, |
| 551 | mul_div_cancel_left₀ _ hXR.ne', Real.log_exp, Prod.mk.eta] |
| 552 | · exact mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hp) hXR.le |
| 553 | |
| 554 | theorem logE_parameter_derivative (F : Profile) {XR C : ℝ} |
| 555 | (w : HeatedOutgoing.CompensationWitness F XR C) {p : Point} |
| 556 | (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 557 | derivWithin (fun eta => logE F XR w.coefficients (p.1, eta)) |
| 558 | HeatedOutgoing.parameterDomain p.2 = parameterJet (freeE F) (controls F w p.2, p) := by |
| 559 | rw [derivWithin_congr (fun eta heta => logE_eq_realize F XR w.coefficients w.radius_pos |
| 560 | (p.1, eta) heta) (logE_eq_realize F XR w.coefficients w.radius_pos p hp)] |
| 561 | exact realize_parameter_derivative (freeE_contDiff F) _ w.smooth hp |
| 562 | |
| 563 | theorem logI_parameter_derivative (F : Profile) {XR C : ℝ} |
| 564 | (w : HeatedOutgoing.CompensationWitness F XR C) {p : Point} |
| 565 | (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 566 | derivWithin (fun eta => logI F XR w.coefficients (p.1, eta)) |
| 567 | HeatedOutgoing.parameterDomain p.2 = parameterJet (freeI F) (controls F w p.2, p) := by |
| 568 | rw [derivWithin_congr (fun eta heta => logI_eq_realize F XR w.coefficients w.radius_pos |
| 569 | (p.1, eta) heta) (logI_eq_realize F XR w.coefficients w.radius_pos p hp)] |
| 570 | exact realize_parameter_derivative (freeI_contDiff F) _ w.smooth hp |
| 571 | |
| 572 | theorem logS_parameter_derivative (F : Profile) {XR C : ℝ} |
| 573 | (w : HeatedOutgoing.CompensationWitness F XR C) {p : Point} |
| 574 | (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 575 | derivWithin (fun eta => logS F XR w.coefficients (p.1, eta)) |
| 576 | HeatedOutgoing.parameterDomain p.2 = parameterJet (freeS F) (controls F w p.2, p) := by |
| 577 | rw [derivWithin_congr (fun eta heta => logS_eq_realize F XR w.coefficients w.radius_pos |
| 578 | (p.1, eta) heta) (logS_eq_realize F XR w.coefficients w.radius_pos p hp)] |
| 579 | exact realize_parameter_derivative (freeS_contDiff F) _ w.smooth hp |
| 580 | |
| 581 | theorem logPi_parameter_derivative (F : Profile) {XR C : ℝ} |
| 582 | (w : HeatedOutgoing.CompensationWitness F XR C) {p : Point} |
| 583 | (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 584 | derivWithin (fun eta => logPi F XR w.coefficients (p.1, eta)) |
| 585 | HeatedOutgoing.parameterDomain p.2 = parameterJet (freePi F) (controls F w p.2, p) := by |
| 586 | rw [derivWithin_congr (fun eta heta => logPi_eq_realize F XR w.coefficients w.radius_pos |
| 587 | (p.1, eta) heta) (logPi_eq_realize F XR w.coefficients w.radius_pos p hp)] |
| 588 | exact realize_parameter_derivative (freePi_contDiff F) _ w.smooth hp |
| 589 | |
| 590 | theorem logE_radial_derivative (F : Profile) {XR C : ℝ} |
| 591 | (w : HeatedOutgoing.CompensationWitness F XR C) {p : Point} |
| 592 | (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 593 | deriv (fun y => logE F XR w.coefficients (y, p.2)) p.1 = |
| 594 | radialJet (freeE F) (controls F w p.2, p) := by |
| 595 | have he : (fun y => logE F XR w.coefficients (y, p.2)) = |
| 596 | (fun y => realize (freeE F) (1 / XR) w.coefficients (y, p.2)) := |
| 597 | funext (fun y => logE_eq_realize F XR w.coefficients w.radius_pos (y, p.2) hp) |
| 598 | rw [he] |
| 599 | exact realize_radial_derivative (freeE_contDiff F) _ _ _ _ |
| 600 | |
| 601 | theorem zero_regular (F : Profile) {anchor left : ℝ} |
| 602 | (h : OutgoingCone.CleanOutgoingCone F.reset anchor left) (ha : 0 < anchor) |
| 603 | {p : Point} (hp : p ∈ OutgoingCone.trueWindow F.data) : (0, p) ∈ regular F := by |
| 604 | have hm := OutgoingCone.clean_true_source_positive F.reset h ha hp |
| 605 | have he : value (freeE F) (0, p) = F.logE p := freeE_zero F p |
| 606 | refine ⟨by rw [he]; exact (OutgoingHistories.E_pos F.reset p).ne', ?_, ?_⟩ |
| 607 | · intro hn |
| 608 | have hz : familyQ F (0, p) = 0 := by simp only [familyQ, hn, zero_div] |
| 609 | rw [familyQ_zero] at hz |
| 610 | exact hm.1.ne' hz |
| 611 | · intro hn |
| 612 | have hz : familyA F (0, p) = 0 := by simp only [familyA, hn, zero_div] |
| 613 | rw [familyA_zero] at hz |
| 614 | exact hm.2.1.ne' hz |
| 615 | |
| 616 | /-- Values, all first jets needed in (9), both lags, and all normalized |
| 617 | stress coordinates. The last coordinate is the leading strict cone gap. -/ |
| 618 | noncomputable def observations (F : Profile) (z : Control × Point) : Fin 18 → ℝ := |
| 619 | ![value (freeE F) z, radialJet (freeE F) z, parameterJet (freeE F) z, |
| 620 | value (freeI F) z, parameterJet (freeI F) z, |
| 621 | value (freeS F) z, parameterJet (freeS F) z, |
| 622 | value (freePi F) z, parameterJet (freePi F) z, |
| 623 | familyQ F z, familyN F z, familyA F z, familyB F z, familyR F z, |
| 624 | familyC F z, familyJ F z, familyV F z, familyGap F z] |
| 625 | |
| 626 | theorem observations_contDiffOn (F : Profile) : |
| 627 | ContDiffOn ℝ ∞ (observations F) (regular F) := by |
| 628 | apply contDiffOn_pi.mpr |
| 629 | intro i |
| 630 | fin_cases i <;> dsimp only [observations, Matrix.cons_val_zero, Matrix.cons_val_succ] |
| 631 | · exact (value_contDiff (freeE_contDiff F)).contDiffOn |
| 632 | · exact (radialJet_contDiff (freeE_contDiff F)).contDiffOn |
| 633 | · exact (parameterJet_contDiff (freeE_contDiff F)).contDiffOn |
| 634 | · exact (value_contDiff (freeI_contDiff F)).contDiffOn |
| 635 | · exact (parameterJet_contDiff (freeI_contDiff F)).contDiffOn |
| 636 | · exact (value_contDiff (freeS_contDiff F)).contDiffOn |
| 637 | · exact (parameterJet_contDiff (freeS_contDiff F)).contDiffOn |
| 638 | · exact (value_contDiff (freePi_contDiff F)).contDiffOn |
| 639 | · exact (parameterJet_contDiff (freePi_contDiff F)).contDiffOn |
| 640 | · exact familyQ_contDiffOn F |
| 641 | · exact (familyN_contDiff F).contDiffOn |
| 642 | · exact familyA_contDiffOn F |
| 643 | · exact familyB_contDiffOn F |
| 644 | · exact familyR_contDiffOn F |
| 645 | · exact familyC_contDiffOn F |
| 646 | · exact familyJ_contDiffOn F |
| 647 | · exact familyV_contDiffOn F |
| 648 | · exact familyGap_contDiffOn F |
| 649 | |
| 650 | theorem observations_estimate (F : Profile) {anchor left : ℝ} |
| 651 | (h : OutgoingCone.CleanOutgoingCone F.reset anchor left) (ha : 0 < anchor) : |
| 652 | ∃ r L : ℝ, 0 < r ∧ 0 ≤ L ∧ ∀ v : Control, ‖v‖ ≤ r → |
| 653 | ∀ p ∈ OutgoingCone.trueWindow F.data, (v, p) ∈ regular F ∧ |
| 654 | ‖observations F (v, p) - observations F (0, p)‖ ≤ L * ‖v‖ := by |
| 655 | apply compact_control_estimate (isCompact_Icc.prod isCompact_Icc) |
| 656 | ((convex_Icc _ _).prod (convex_Icc _ _)) (regular_isOpen F) |
| 657 | · rintro ⟨v, p⟩ ⟨hv, hp⟩ |
| 658 | have hv' : v = 0 := hv |
| 659 | subst v |
| 660 | exact zero_regular F h ha hp |
| 661 | · exact observations_contDiffOn F |
| 662 | |
| 663 | /-- A single constant controls the actual value, radial and parameter jets, |
| 664 | histories, lags and normalized stresses. It is fixed before `XR` or the |
| 665 | particular compensation witness at that radius is chosen. -/ |
| 666 | theorem compensated_observations_bound (F : Profile) {anchor left : ℝ} |
| 667 | (h : OutgoingCone.CleanOutgoingCone F.reset anchor left) (ha : 0 < anchor) (C : ℝ) : |
| 668 | ∃ XR₀ B : ℝ, 0 < XR₀ ∧ 0 < B ∧ ∀ XR : ℝ, XR₀ ≤ XR → |
| 669 | ∀ w : HeatedOutgoing.CompensationWitness F XR C, |
| 670 | ∀ p ∈ OutgoingCone.trueWindow F.data, |
| 671 | (controls F w p.2, p) ∈ regular F ∧ ∀ i : Fin 18, |
| 672 | |observations F (controls F w p.2, p) i - observations F (0, p) i| ≤ |
| 673 | B / OutgoingDilation.switchRadius F XR := by |
| 674 | obtain ⟨r, L, hr, hL, he⟩ := observations_estimate F h ha |
| 675 | let k := Real.exp (HeatTailEdit.switchStart F.data) |
| 676 | let D := max k C |
| 677 | have hk : 0 < k := Real.exp_pos _ |
| 678 | have hD : 0 < D := hk.trans_le (le_max_left _ _) |
| 679 | let XR₀ := D / (r * k) |
| 680 | let B := max 1 (L * D) |
| 681 | refine ⟨XR₀, B, div_pos hD (mul_pos hr hk), lt_of_lt_of_le zero_lt_one (le_max_left _ _), ?_⟩ |
| 682 | intro XR hXR w p hp |
| 683 | have hK := OutgoingDilation.switchRadius_pos F XR w.radius_pos |
| 684 | have hsmall : D / OutgoingDilation.switchRadius F XR ≤ r := by |
| 685 | apply (div_le_iff₀ hK).mpr |
| 686 | have hh := (div_le_iff₀ (mul_pos hr hk)).mp hXR |
| 687 | change D ≤ r * (XR * k) |
| 688 | nlinarith only [hh] |
| 689 | have hnorm := controls_norm F w hp.2 |
| 690 | have hob := he (controls F w p.2) (hnorm.trans hsmall) p hp |
| 691 | refine ⟨hob.1, ?_⟩ |
| 692 | intro i |
| 693 | calc |
| 694 | |observations F (controls F w p.2, p) i - observations F (0, p) i| ≤ |
| 695 | ‖observations F (controls F w p.2, p) - observations F (0, p)‖ := by |
| 696 | simpa only [Real.norm_eq_abs, Pi.sub_apply] using |
| 697 | (norm_le_pi_norm (observations F (controls F w p.2, p) - observations F (0, p)) i) |
| 698 | _ ≤ L * ‖controls F w p.2‖ := hob.2 |
| 699 | _ ≤ L * (D / OutgoingDilation.switchRadius F XR) := mul_le_mul_of_nonneg_left hnorm hL |
| 700 | _ = (L * D) / OutgoingDilation.switchRadius F XR := by ring |
| 701 | _ ≤ B / OutgoingDilation.switchRadius F XR := |
| 702 | (div_le_div_iff_of_pos_right hK).mpr (le_max_right _ _) |
| 703 | |
| 704 | theorem cleanPi_eq (F : Profile) (p : Point) : |
| 705 | F.logPi p = OutgoingHistories.Pi F.reset p := by |
| 706 | rcases p with ⟨y, eta⟩ |
| 707 | rw [OutgoingHistories.Pi_eq_future_integral] |
| 708 | rfl |
| 709 | |
| 710 | theorem cleanPi_increment (F : Profile) (a y eta : ℝ) : |
| 711 | (1 / 2 : ℝ) * ∫ t in a..y, F.logE (t, eta) ^ 2 = |
| 712 | OutgoingHistories.Pi F.reset (y, eta) - OutgoingHistories.Pi F.reset (a, eta) := by |
| 713 | have hc : Continuous (fun t => F.logE (t, eta) ^ 2 / 2) := |
| 714 | ((F.logE_contDiff.continuous.comp (continuous_id.prodMk continuous_const)).pow 2).div_const 2 |
| 715 | have hd (t : ℝ) : HasDerivAt (fun y => OutgoingHistories.Pi F.reset (y, eta)) |
| 716 | (F.logE (t, eta) ^ 2 / 2) t := OutgoingHistories.Pi_hasDerivAt F.reset (t, eta) |
| 717 | have hi := intervalIntegral.integral_eq_sub_of_hasDerivAt (a := a) (b := y) |
| 718 | (fun t _ => hd t) (hc.intervalIntegrable a y) |
| 719 | change (∫ t in a..y, F.logE (t, eta) ^ 2 / 2) = _ at hi |
| 720 | rw [intervalIntegral.integral_div] at hi |
| 721 | linarith |
| 722 | |
| 723 | /-- The pressure in the normalized histories is the actual canonical future |
| 724 | integral. The proof uses exact three-row compensation through the existing |
| 725 | pressure primitive, not an independently chosen pressure constant. -/ |
| 726 | theorem logPi_eq_canonical (F : Profile) {XR C : ℝ} |
| 727 | (w : HeatedOutgoing.CompensationWitness F XR C) (p : Point) |
| 728 | (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 729 | logPi F XR w.coefficients p = |
| 730 | HeatedOutgoing.Pi F XR w.coefficients (XR * Real.exp p.1, p.2) := by |
| 731 | let a := OutgoingDilation.patchClock F |
| 732 | have hh := w.Pi_exp_primitive p.2 (Real.log XR + p.1) hp |
| 733 | have hlog : Real.log (OutgoingDilation.patchRadius F XR) = Real.log XR + a := by |
| 734 | rw [OutgoingDilation.patchRadius, OutgoingDilation.radius, Real.log_mul w.radius_pos.ne' |
| 735 | (Real.exp_ne_zero _), Real.log_exp] |
| 736 | have hbase : OutgoingDilation.Pi F XR (OutgoingDilation.patchRadius F XR, p.2) = |
| 737 | OutgoingHistories.Pi F.reset (a, p.2) := by |
| 738 | unfold OutgoingDilation.Pi OutgoingDilation.patchRadius OutgoingDilation.radius |
| 739 | simp only [mul_div_cancel_left₀ _ w.radius_pos.ne', OutgoingProfile.Profile.Pi, Real.log_exp] |
| 740 | exact cleanPi_eq F (a, p.2) |
| 741 | rw [Real.exp_add, Real.exp_log w.radius_pos, hlog, hbase] at hh |
| 742 | have hs : (∫ t in (Real.log XR + a)..(Real.log XR + p.1), |
| 743 | HeatedOutgoing.freeLogE F XR ((w.coefficients p.2, p.2), t) ^ 2) = |
| 744 | ∫ t in a..p.1, logE F XR w.coefficients (t, p.2) ^ 2 := by |
| 745 | rw [← intervalIntegral.integral_comp_add_left |
| 746 | (fun t => HeatedOutgoing.freeLogE F XR ((w.coefficients p.2, p.2), t) ^ 2) (Real.log XR)] |
| 747 | apply intervalIntegral.integral_congr |
| 748 | intro t _ |
| 749 | dsimp only |
| 750 | rw [HeatedOutgoing.freeLogE_eq F XR w.coefficients p.2 _ hp, |
| 751 | Real.exp_add, Real.exp_log w.radius_pos] |
| 752 | rfl |
| 753 | rw [hs] at hh |
| 754 | have hclean := cleanPi_increment F a p.1 p.2 |
| 755 | have hheated : Continuous (fun t => logE F XR w.coefficients (t, p.2) ^ 2) := by |
| 756 | have hg : Continuous (fun t => freeE F ((1 / XR, w.coefficients p.2), (t, p.2))) := |
| 757 | (freeE_contDiff F).continuous.comp (continuous_const.prodMk |
| 758 | (continuous_id.prodMk continuous_const)) |
| 759 | have he : (fun t => logE F XR w.coefficients (t, p.2)) = |
| 760 | (fun t => freeE F ((1 / XR, w.coefficients p.2), (t, p.2))) := by |
| 761 | funext t |
| 762 | exact logE_eq_realize F XR w.coefficients w.radius_pos (t, p.2) hp |
| 763 | have h0 : Continuous (fun t => logE F XR w.coefficients (t, p.2)) := he.symm ▸ hg |
| 764 | exact h0.pow 2 |
| 765 | have hcleanc : Continuous (fun t => F.logE (t, p.2) ^ 2) := |
| 766 | (F.logE_contDiff.continuous.comp (continuous_id.prodMk continuous_const)).pow 2 |
| 767 | unfold logPi |
| 768 | rw [intervalIntegral.integral_sub (hheated.intervalIntegrable _ _) (hcleanc.intervalIntegrable _ _)] |
| 769 | dsimp only [a] at hh hclean |
| 770 | linarith |
| 771 | |
| 772 | noncomputable def Qs (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 773 | -OutgoingHistories.W F.data F.amp p + |
| 774 | ((1 - F.data.h) * logI F XR c p - axialExponent F.data.h * p.2 * |
| 775 | derivWithin (fun eta => logI F XR c (p.1, eta)) HeatedOutgoing.parameterDomain p.2 - |
| 776 | coordinateFactor p.2 * OutgoingHistories.dEta (OutgoingHistories.J F.reset F.amp) p + |
| 777 | 2 * (F.data.h - axialExponent F.data.h) * p.2 * OutgoingHistories.J F.reset F.amp p) / |
| 778 | (Real.exp (3 * p.1 / 2) * logE F XR c p) |
| 779 | |
| 780 | noncomputable def Ns (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 781 | -OutgoingHistories.W F.data F.amp p * F.logU p + |
| 782 | axialExponent F.data.h * (OutgoingHistories.M F.data F.amp p - |
| 783 | p.2 * OutgoingHistories.dEta (OutgoingHistories.M F.data F.amp) p) / Real.exp p.1 + |
| 784 | (4 * F.data.h * p.2 * logS F XR c p - coordinateFactor p.2 * |
| 785 | derivWithin (fun eta => logS F XR c (p.1, eta)) HeatedOutgoing.parameterDomain p.2) / |
| 786 | Real.exp p.1 + 4 * velocityExponent F.data.h * p.2 * logPi F XR c p - |
| 787 | coordinateFactor p.2 * derivWithin (fun eta => logPi F XR c (p.1, eta)) |
| 788 | HeatedOutgoing.parameterDomain p.2 |
| 789 | |
| 790 | noncomputable def radialA (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 791 | 1 - 2 * deriv (fun y => logE F XR c (y, p.2)) p.1 / logE F XR c p |
| 792 | noncomputable def radialB (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 793 | 2 * OutgoingHistories.dY F.logU p / logE F XR c p |
| 794 | noncomputable def ratio (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 795 | Ns F XR c p / (logE F XR c p * Qs F XR c p) |
| 796 | noncomputable def sourceC (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 797 | 1 - radialB F XR c p * ratio F XR c p / radialA F XR c p |
| 798 | noncomputable def sourceJ (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 799 | ratio F XR c p + radialB F XR c p / radialA F XR c p |
| 800 | noncomputable def normalV (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 801 | radialA F XR c p * (1 + (radialB F XR c p / radialA F XR c p) ^ 2) |
| 802 | noncomputable def leadingGap (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 803 | 2 * sourceC F XR c p ^ 2 - (normalV F XR c p - 2) * sourceJ F XR c p ^ 2 |
| 804 | |
| 805 | theorem Qs_eq_family (F : Profile) {XR C : ℝ} (w : HeatedOutgoing.CompensationWitness F XR C) |
| 806 | {p : Point} (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 807 | Qs F XR w.coefficients p = familyQ F (controls F w p.2, p) := by |
| 808 | have hE := w.positive p.2 (XR * Real.exp p.1) hp (mul_pos w.radius_pos (Real.exp_pos _)) |
| 809 | change 0 < logE F XR w.coefficients p at hE |
| 810 | rw [logE_eq_realize F XR w.coefficients w.radius_pos p hp] at hE |
| 811 | rw [Qs, logI_parameter_derivative F w hp, logI_eq_realize F XR w.coefficients w.radius_pos p hp, |
| 812 | logE_eq_realize F XR w.coefficients w.radius_pos p hp] |
| 813 | unfold familyQ angularNumerator |
| 814 | change -OutgoingHistories.W F.data F.amp p + _ / _ = _ |
| 815 | have hne : value (freeE F) (controls F w p.2, p) ≠ 0 := hE.ne' |
| 816 | change 0 < value (freeE F) (controls F w p.2, p) at hE |
| 817 | change -OutgoingHistories.W F.data F.amp p + _ / |
| 818 | (Real.exp (3 * p.1 / 2) * value (freeE F) (controls F w p.2, p)) = _ |
| 819 | rw [show realize (freeI F) (1 / XR) w.coefficients p = |
| 820 | value (freeI F) (controls F w p.2, p) from rfl] |
| 821 | field_simp [hne, Real.exp_ne_zero] |
| 822 | |
| 823 | theorem Ns_eq_family (F : Profile) {XR C : ℝ} (w : HeatedOutgoing.CompensationWitness F XR C) |
| 824 | {p : Point} (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 825 | Ns F XR w.coefficients p = familyN F (controls F w p.2, p) := by |
| 826 | rw [Ns, logS_parameter_derivative F w hp, logPi_parameter_derivative F w hp, |
| 827 | logS_eq_realize F XR w.coefficients w.radius_pos p hp, |
| 828 | logPi_eq_realize F XR w.coefficients w.radius_pos p hp] |
| 829 | rfl |
| 830 | |
| 831 | theorem radialA_eq_family (F : Profile) {XR C : ℝ} (w : HeatedOutgoing.CompensationWitness F XR C) |
| 832 | {p : Point} (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 833 | radialA F XR w.coefficients p = familyA F (controls F w p.2, p) := by |
| 834 | have hE := w.positive p.2 (XR * Real.exp p.1) hp (mul_pos w.radius_pos (Real.exp_pos _)) |
| 835 | change 0 < logE F XR w.coefficients p at hE |
| 836 | rw [logE_eq_realize F XR w.coefficients w.radius_pos p hp] at hE |
| 837 | rw [radialA, logE_radial_derivative F w hp, |
| 838 | logE_eq_realize F XR w.coefficients w.radius_pos p hp] |
| 839 | change 1 - 2 * radialJet (freeE F) (controls F w p.2, p) / |
| 840 | value (freeE F) (controls F w p.2, p) = _ |
| 841 | unfold familyA radialNumerator |
| 842 | have hne : value (freeE F) (controls F w p.2, p) ≠ 0 := hE.ne' |
| 843 | field_simp [hne] |
| 844 | |
| 845 | theorem normalized_eq_family (F : Profile) {XR C : ℝ} |
| 846 | (w : HeatedOutgoing.CompensationWitness F XR C) {p : Point} |
| 847 | (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 848 | radialB F XR w.coefficients p = familyB F (controls F w p.2, p) ∧ |
| 849 | ratio F XR w.coefficients p = familyR F (controls F w p.2, p) ∧ |
| 850 | sourceC F XR w.coefficients p = familyC F (controls F w p.2, p) ∧ |
| 851 | sourceJ F XR w.coefficients p = familyJ F (controls F w p.2, p) ∧ |
| 852 | normalV F XR w.coefficients p = familyV F (controls F w p.2, p) ∧ |
| 853 | leadingGap F XR w.coefficients p = familyGap F (controls F w p.2, p) := by |
| 854 | have hb : radialB F XR w.coefficients p = familyB F (controls F w p.2, p) := by |
| 855 | rw [radialB, logE_eq_realize F XR w.coefficients w.radius_pos p hp] |
| 856 | rfl |
| 857 | have hr : ratio F XR w.coefficients p = familyR F (controls F w p.2, p) := by |
| 858 | rw [ratio, Ns_eq_family F w hp, Qs_eq_family F w hp, |
| 859 | logE_eq_realize F XR w.coefficients w.radius_pos p hp] |
| 860 | rfl |
| 861 | have hc : sourceC F XR w.coefficients p = familyC F (controls F w p.2, p) := by |
| 862 | rw [sourceC, hb, hr, radialA_eq_family F w hp] |
| 863 | rfl |
| 864 | have hj : sourceJ F XR w.coefficients p = familyJ F (controls F w p.2, p) := by |
| 865 | rw [sourceJ, hb, hr, radialA_eq_family F w hp] |
| 866 | rfl |
| 867 | have hv : normalV F XR w.coefficients p = familyV F (controls F w p.2, p) := by |
| 868 | rw [normalV, hb, radialA_eq_family F w hp] |
| 869 | rfl |
| 870 | refine ⟨hb, hr, hc, hj, hv, ?_⟩ |
| 871 | rw [leadingGap, hc, hj, hv] |
| 872 | rfl |
| 873 | |
| 874 | noncomputable def actualObservations (F : Profile) (XR : ℝ) (c : ℝ → Coeff) |
| 875 | (p : Point) : Fin 18 → ℝ := |
| 876 | ![logE F XR c p, deriv (fun y => logE F XR c (y, p.2)) p.1, |
| 877 | derivWithin (fun eta => logE F XR c (p.1, eta)) HeatedOutgoing.parameterDomain p.2, |
| 878 | logI F XR c p, |
| 879 | derivWithin (fun eta => logI F XR c (p.1, eta)) HeatedOutgoing.parameterDomain p.2, |
| 880 | logS F XR c p, |
| 881 | derivWithin (fun eta => logS F XR c (p.1, eta)) HeatedOutgoing.parameterDomain p.2, |
| 882 | logPi F XR c p, |
| 883 | derivWithin (fun eta => logPi F XR c (p.1, eta)) HeatedOutgoing.parameterDomain p.2, |
| 884 | Qs F XR c p, Ns F XR c p, radialA F XR c p, radialB F XR c p, ratio F XR c p, |
| 885 | sourceC F XR c p, sourceJ F XR c p, normalV F XR c p, leadingGap F XR c p] |
| 886 | |
| 887 | theorem actualObservations_eq (F : Profile) {XR C : ℝ} |
| 888 | (w : HeatedOutgoing.CompensationWitness F XR C) {p : Point} |
| 889 | (hp : p.2 ∈ HeatedOutgoing.parameterDomain) : |
| 890 | actualObservations F XR w.coefficients p = observations F (controls F w p.2, p) := by |
| 891 | obtain ⟨hb, hr, hc, hj, hv, hg⟩ := normalized_eq_family F w hp |
| 892 | unfold actualObservations observations |
| 893 | rw [logE_radial_derivative F w hp, logE_parameter_derivative F w hp, |
| 894 | logI_parameter_derivative F w hp, logS_parameter_derivative F w hp, |
| 895 | logPi_parameter_derivative F w hp, Qs_eq_family F w hp, Ns_eq_family F w hp, |
| 896 | radialA_eq_family F w hp, hb, hr, hc, hj, hv, hg, |
| 897 | logE_eq_realize F XR w.coefficients w.radius_pos p hp, |
| 898 | logI_eq_realize F XR w.coefficients w.radius_pos p hp, |
| 899 | logS_eq_realize F XR w.coefficients w.radius_pos p hp, |
| 900 | logPi_eq_realize F XR w.coefficients w.radius_pos p hp] |
| 901 | rfl |
| 902 | |
| 903 | theorem actual_observations_bound (F : Profile) {anchor left : ℝ} |
| 904 | (h : OutgoingCone.CleanOutgoingCone F.reset anchor left) (ha : 0 < anchor) (C : ℝ) : |
| 905 | ∃ XR₀ B : ℝ, 0 < XR₀ ∧ 0 < B ∧ ∀ XR : ℝ, XR₀ ≤ XR → |
| 906 | ∀ w : HeatedOutgoing.CompensationWitness F XR C, |
| 907 | ∀ p ∈ OutgoingCone.trueWindow F.data, ∀ i : Fin 18, |
| 908 | |actualObservations F XR w.coefficients p i - observations F (0, p) i| ≤ |
| 909 | B / OutgoingDilation.switchRadius F XR := by |
| 910 | obtain ⟨XR₀, B, hXR₀, hB, he⟩ := compensated_observations_bound F h ha C |
| 911 | refine ⟨XR₀, B, hXR₀, hB, ?_⟩ |
| 912 | intro XR hXR w p hp i |
| 913 | rw [actualObservations_eq F w hp.2] |
| 914 | exact (he XR hXR w p hp).2 i |
| 915 | |
| 916 | theorem div_switch_le (F : Profile) {B eps XR : ℝ} (heps : 0 < eps) (hXR : 0 < XR) |
| 917 | (hlarge : B / (eps * Real.exp (HeatTailEdit.switchStart F.data)) ≤ XR) : |
| 918 | B / OutgoingDilation.switchRadius F XR ≤ eps := by |
| 919 | apply (div_le_iff₀ (OutgoingDilation.switchRadius_pos F XR hXR)).mpr |
| 920 | have hh := (div_le_iff₀ (mul_pos heps (Real.exp_pos _))).mp hlarge |
| 921 | change B ≤ eps * (XR * Real.exp (HeatTailEdit.switchStart F.data)) |
| 922 | nlinarith only [hh] |
| 923 | |
| 924 | /-- Uniform strict source margins for every sufficiently large physical |
| 925 | radius, with a bound for the two coordinates entering the finite-radius |
| 926 | quadratic test. All constants precede the radius and witness quantifiers. -/ |
| 927 | theorem compensated_source_margins (F : Profile) {anchor left : ℝ} |
| 928 | (h : OutgoingCone.CleanOutgoingCone F.reset anchor left) (ha : 0 < anchor) (C : ℝ) : |
| 929 | ∃ XR₀ m T : ℝ, 0 < XR₀ ∧ 0 < m ∧ 0 < T ∧ ∀ XR : ℝ, XR₀ ≤ XR → |
| 930 | ∀ w : HeatedOutgoing.CompensationWitness F XR C, |
| 931 | ∀ p ∈ OutgoingCone.trueWindow F.data, |
| 932 | m ≤ Qs F XR w.coefficients p ∧ m ≤ radialA F XR w.coefficients p ∧ |
| 933 | m ≤ normalV F XR w.coefficients p - 2 ∧ m ≤ sourceC F XR w.coefficients p ∧ |
| 934 | m ≤ leadingGap F XR w.coefficients p ∧ |
| 935 | |sourceC F XR w.coefficients p| ≤ T ∧ |normalV F XR w.coefficients p| ≤ T := by |
| 936 | obtain ⟨X₀, B, hX₀, hB, hb⟩ := actual_observations_bound F h ha C |
| 937 | obtain ⟨eps, heps, hm⟩ := OutgoingCone.clean_true_source_margins F.reset h ha |
| 938 | have hc : ContinuousOn (fun p : Point => observations F (0, p)) |
| 939 | (OutgoingCone.trueWindow F.data) := |
| 940 | (observations_contDiffOn F).continuousOn.comp |
| 941 | (continuous_const.prodMk continuous_id).continuousOn (fun p hp => zero_regular F h ha hp) |
| 942 | obtain ⟨M, hM⟩ := (isCompact_Icc.prod isCompact_Icc).exists_bound_of_continuousOn hc |
| 943 | let err := min (eps / 2) 1 |
| 944 | have herr : 0 < err := lt_min (by positivity) zero_lt_one |
| 945 | let X₁ := B / (err * Real.exp (HeatTailEdit.switchStart F.data)) |
| 946 | let T := max 1 (M + 1) |
| 947 | refine ⟨max X₀ X₁, eps / 2, T, hX₀.trans_le (le_max_left _ _), by positivity, |
| 948 | lt_of_lt_of_le zero_lt_one (le_max_left _ _), ?_⟩ |
| 949 | intro XR hXR w p hp |
| 950 | have he := hb XR ((le_max_left _ _).trans hXR) w p hp |
| 951 | have hsmall := div_switch_le F herr w.radius_pos ((le_max_right _ _).trans hXR) |
| 952 | have herrs : ∀ i : Fin 18, |
| 953 | |actualObservations F XR w.coefficients p i - observations F (0, p) i| ≤ err := |
| 954 | fun i => (he i).trans hsmall |
| 955 | have hq : |Qs F XR w.coefficients p - OutgoingHistories.Qs F.reset F.amp p| ≤ err := by |
| 956 | simpa [actualObservations, observations] using herrs 9 |
| 957 | have ha' : |radialA F XR w.coefficients p - OutgoingEntranceCone.coneA F.reset p| ≤ err := by |
| 958 | simpa [actualObservations, observations] using herrs 11 |
| 959 | have hv : |normalV F XR w.coefficients p - OutgoingCone.normalV F.reset F.amp p| ≤ err := by |
| 960 | simpa [actualObservations, observations] using herrs 16 |
| 961 | have hc' : |sourceC F XR w.coefficients p - OutgoingCone.sourceC F.reset F.amp p| ≤ err := by |
| 962 | simpa [actualObservations, observations] using herrs 14 |
| 963 | have hg : |leadingGap F XR w.coefficients p - OutgoingCone.leadingGap F.reset F.amp p| ≤ err := by |
| 964 | simpa [actualObservations, observations] using herrs 17 |
| 965 | have hm' := hm p hp |
| 966 | have herreps : err ≤ eps / 2 := min_le_left _ _ |
| 967 | have herrone : err ≤ 1 := min_le_right _ _ |
| 968 | have habs (i : Fin 18) : |observations F (0, p) i| ≤ M := by |
| 969 | have hi := norm_le_pi_norm (observations F (0, p)) i |
| 970 | exact hi.trans (hM p hp) |
| 971 | have hCM : |OutgoingCone.sourceC F.reset F.amp p| ≤ M := by |
| 972 | simpa [observations] using habs 14 |
| 973 | have hVM : |OutgoingCone.normalV F.reset F.amp p| ≤ M := by |
| 974 | simpa [observations] using habs 16 |
| 975 | dsimp only [OutgoingProfile.Profile.amp] at hq hv hc' hg |
| 976 | refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ |
| 977 | · linarith [(abs_le.mp hq).1, hm'.1] |
| 978 | · linarith [(abs_le.mp ha').1, hm'.2.1] |
| 979 | · linarith [(abs_le.mp hv).1, hm'.2.2.1] |
| 980 | · linarith [(abs_le.mp hc').1, hm'.2.2.2.1] |
| 981 | · linarith [(abs_le.mp hg).1, hm'.2.2.2.2] |
| 982 | · calc |
| 983 | |sourceC F XR w.coefficients p| ≤ |
| 984 | |sourceC F XR w.coefficients p - OutgoingCone.sourceC F.reset F.amp p| + |
| 985 | |OutgoingCone.sourceC F.reset F.amp p| := by |
| 986 | simpa only [sub_add_cancel] using abs_add_le |
| 987 | (sourceC F XR w.coefficients p - OutgoingCone.sourceC F.reset F.amp p) |
| 988 | (OutgoingCone.sourceC F.reset F.amp p) |
| 989 | _ ≤ err + M := add_le_add hc' hCM |
| 990 | _ ≤ T := by dsimp [T]; linarith [le_max_right (1 : ℝ) (M + 1)] |
| 991 | · calc |
| 992 | |normalV F XR w.coefficients p| ≤ |
| 993 | |normalV F XR w.coefficients p - OutgoingCone.normalV F.reset F.amp p| + |
| 994 | |OutgoingCone.normalV F.reset F.amp p| := by |
| 995 | simpa only [sub_add_cancel] using abs_add_le |
| 996 | (normalV F XR w.coefficients p - OutgoingCone.normalV F.reset F.amp p) |
| 997 | (OutgoingCone.normalV F.reset F.amp p) |
| 998 | _ ≤ err + M := add_le_add hv hVM |
| 999 | _ ≤ T := by dsimp [T]; linarith [le_max_right (1 : ℝ) (M + 1)] |
| 1000 | |
| 1001 | noncomputable def stressScale (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 1002 | XR * Real.exp p.1 * Qs F XR c p / CoordinateAlgebra.L F.data.h p.2 |
| 1003 | noncomputable def normalP (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 1004 | stressScale F XR c p * sourceC F XR c p |
| 1005 | noncomputable def normalJ (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := |
| 1006 | stressScale F XR c p * sourceJ F XR c p |
| 1007 | |
| 1008 | /-- The strict true cone, expressed in the same normalized stress coordinates |
| 1009 | as the clean outgoing theorem. -/ |
| 1010 | def TrueAt (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : Prop := |
| 1011 | 0 < Qs F XR c p ∧ 0 < radialA F XR c p ∧ 2 < normalV F XR c p ∧ |
| 1012 | 2 < normalP F XR c p ∧ normalV F XR c p < ConeAlgebra.coneBound (normalP F XR c p) (normalJ F XR c p) |
| 1013 | |
| 1014 | /-- Compensation and the full switch-on interval preserve the strict true |
| 1015 | cone. The outgoing profile, its reset and its axial amplitude remain fixed. |
| 1016 | The final radius threshold is uniform over all compensation witnesses having |
| 1017 | the previously fixed coefficient constant `C`. -/ |
| 1018 | theorem preserves_true_cone (F : Profile) {anchor left : ℝ} |
| 1019 | (h : OutgoingCone.CleanOutgoingCone F.reset anchor left) (ha : 0 < anchor) (C : ℝ) : |
| 1020 | ∃ XR₀ : ℝ, 0 < XR₀ ∧ ∀ XR : ℝ, XR₀ ≤ XR → |
| 1021 | ∀ w : HeatedOutgoing.CompensationWitness F XR C, |
| 1022 | ∀ p ∈ OutgoingCone.trueWindow F.data, TrueAt F XR w.coefficients p := by |
| 1023 | obtain ⟨X₀, m, T, hX₀, hm, hT, hs⟩ := compensated_source_margins F h ha C |
| 1024 | let k := Real.exp F.data.core.holdStart |
| 1025 | have hk : 0 < k := Real.exp_pos _ |
| 1026 | let B := 3 + T + 4 * T ^ 2 |
| 1027 | let X₁ := B / (k * m ^ 2) |
| 1028 | refine ⟨max X₀ X₁, hX₀.trans_le (le_max_left _ _), ?_⟩ |
| 1029 | intro XR hXR w p hp |
| 1030 | obtain ⟨hq, har, hv, hc, hg, hcT, hvT⟩ := hs XR ((le_max_left _ _).trans hXR) w p hp |
| 1031 | have hqpos := hm.trans_le hq |
| 1032 | have harpos := hm.trans_le har |
| 1033 | have hvpos : 2 < normalV F XR w.coefficients p := by linarith |
| 1034 | have hcpos := hm.trans_le hc |
| 1035 | have hL : 0 < CoordinateAlgebra.L F.data.h p.2 := CoordinateAlgebra.L_pos |
| 1036 | F.data.h_pos.le F.data.h_lt_half |
| 1037 | (OutgoingEntranceCone.parameter_square_le_one (abs_le.mpr hp.2)) |
| 1038 | have hL1 : CoordinateAlgebra.L F.data.h p.2 ≤ 1 := by |
| 1039 | unfold CoordinateAlgebra.L |
| 1040 | nlinarith [mul_nonneg F.data.h_pos.le (sq_nonneg p.2)] |
| 1041 | have hscale : 0 < stressScale F XR w.coefficients p := |
| 1042 | div_pos (mul_pos (mul_pos w.radius_pos (Real.exp_pos _)) hqpos) hL |
| 1043 | have hlow : XR * k * m ≤ stressScale F XR w.coefficients p := by |
| 1044 | apply (le_div_iff₀ hL).mpr |
| 1045 | have hnonneg : 0 ≤ XR * k * m := (mul_pos (mul_pos w.radius_pos hk) hm).le |
| 1046 | calc |
| 1047 | XR * k * m * CoordinateAlgebra.L F.data.h p.2 ≤ XR * k * m := by |
| 1048 | simpa only [mul_one] using mul_le_mul_of_nonneg_left hL1 hnonneg |
| 1049 | _ ≤ XR * Real.exp p.1 * Qs F XR w.coefficients p := by |
| 1050 | apply mul_le_mul |
| 1051 | · exact mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hp.1.1) w.radius_pos.le |
| 1052 | · exact hq |
| 1053 | · exact hm.le |
| 1054 | · exact (mul_pos w.radius_pos (Real.exp_pos _)).le |
| 1055 | have hB : B ≤ stressScale F XR w.coefficients p * m := by |
| 1056 | have hh := (div_le_iff₀ (mul_pos hk (sq_pos_of_pos hm))).mp ((le_max_right _ _).trans hXR) |
| 1057 | calc |
| 1058 | B ≤ XR * (k * m ^ 2) := hh |
| 1059 | _ = (XR * k * m) * m := by ring |
| 1060 | _ ≤ stressScale F XR w.coefficients p * m := mul_le_mul_of_nonneg_right hlow hm.le |
| 1061 | have hpc : B ≤ normalP F XR w.coefficients p := |
| 1062 | hB.trans (mul_le_mul_of_nonneg_left hc hscale.le) |
| 1063 | have hP : 2 < normalP F XR w.coefficients p := by |
| 1064 | dsimp [B] at hpc |
| 1065 | nlinarith [sq_nonneg T] |
| 1066 | have hvc : normalV F XR w.coefficients p < normalP F XR w.coefficients p := by |
| 1067 | have hvT' := (le_abs_self _).trans hvT |
| 1068 | dsimp [B] at hpc |
| 1069 | nlinarith [sq_nonneg T] |
| 1070 | have hquad : 4 * sourceC F XR w.coefficients p * normalV F XR w.coefficients p < |
| 1071 | stressScale F XR w.coefficients p * leadingGap F XR w.coefficients p := by |
| 1072 | have hpT : sourceC F XR w.coefficients p * normalV F XR w.coefficients p ≤ T ^ 2 := by |
| 1073 | have hh := mul_le_mul ((le_abs_self _).trans hcT) ((le_abs_self _).trans hvT) |
| 1074 | (by linarith : 0 ≤ normalV F XR w.coefficients p) hT.le |
| 1075 | simpa only [pow_two] using hh |
| 1076 | have hgap := hB.trans (mul_le_mul_of_nonneg_left hg hscale.le) |
| 1077 | dsimp [B] at hgap |
| 1078 | nlinarith |
| 1079 | refine ⟨hqpos, harpos, hvpos, hP, ?_⟩ |
| 1080 | exact ConeAlgebra.finite_amplitude_cone hscale hP hvc hquad |
| 1081 | |
| 1082 | /-- Existence uses the already constructed compensation branch for the same |
| 1083 | outgoing profile, after taking the maximum of its threshold and the cone |
| 1084 | threshold. -/ |
| 1085 | theorem exists_compensated_true_cone (F : Profile) {anchor left : ℝ} |
| 1086 | (h : OutgoingCone.CleanOutgoingCone F.reset anchor left) (ha : 0 < anchor) : |
| 1087 | ∃ XR₀ C : ℝ, 0 < XR₀ ∧ 0 < C ∧ ∀ XR : ℝ, XR₀ ≤ XR → |
| 1088 | ∃ w : HeatedOutgoing.CompensationWitness F XR C, |
| 1089 | ∀ p ∈ OutgoingCone.trueWindow F.data, TrueAt F XR w.coefficients p := by |
| 1090 | obtain ⟨X₀, C, hX₀, hC, hw⟩ := HeatedOutgoing.exists_compensation F |
| 1091 | obtain ⟨X₁, _, hc⟩ := preserves_true_cone F h ha C |
| 1092 | refine ⟨max X₀ X₁, C, hX₀.trans_le (le_max_left _ _), hC, ?_⟩ |
| 1093 | intro XR hXR |
| 1094 | obtain ⟨w⟩ := hw XR ((le_max_left _ _).trans hXR) |
| 1095 | exact ⟨w, hc XR ((le_max_right _ _).trans hXR) w⟩ |
| 1096 | |
| 1097 | theorem past_integrable_from {f : ℝ → ℝ} (hf : Continuous f) {a : ℝ} |
| 1098 | (ha : IntegrableOn f (Iic a)) (y : ℝ) : IntegrableOn f (Iic y) := by |
| 1099 | by_cases h : a ≤ y |
| 1100 | · rw [← Iic_union_Ioc_eq_Iic h] |
| 1101 | exact ha.union hf.integrableOn_Ioc |
| 1102 | · exact ha.mono_set (Iic_subset_Iic.mpr (le_of_not_ge h)) |
| 1103 | |
| 1104 | /-- Updating an actual past integral by the finite integral of the change. |
| 1105 | The two functions agree throughout their entire incoming history. -/ |
| 1106 | theorem past_integral_update {f g : ℝ → ℝ} (hf : Continuous f) (hg : Continuous g) |
| 1107 | {a : ℝ} (ha : IntegrableOn f (Iic a)) (he : ∀ t ≤ a, g t = f t) (y : ℝ) : |
| 1108 | IntegrableOn g (Iic y) ∧ (∫ t in Iic y, g t) = |
| 1109 | (∫ t in Iic y, f t) + ∫ t in a..y, g t - f t := by |
| 1110 | have hga : IntegrableOn g (Iic a) := |
| 1111 | ha.congr_fun (fun t ht => (he t ht).symm) measurableSet_Iic |
| 1112 | have hgy := past_integrable_from hg hga y |
| 1113 | have hfy := past_integrable_from hf ha y |
| 1114 | have hbase : (∫ t in Iic a, g t) = ∫ t in Iic a, f t := |
| 1115 | setIntegral_congr_fun measurableSet_Iic (fun t ht => he t ht) |
| 1116 | have hfg := intervalIntegral.integral_Iic_sub_Iic ha hfy |
| 1117 | have hgg := intervalIntegral.integral_Iic_sub_Iic hga hgy |
| 1118 | refine ⟨hgy, ?_⟩ |
| 1119 | rw [intervalIntegral.integral_sub (hg.intervalIntegrable a y) (hf.intervalIntegrable a y)] |
| 1120 | linarith |
| 1121 | |
| 1122 | theorem logE_continuous_radial (F : Profile) {XR : ℝ} (hXR : 0 < XR) |
| 1123 | (c : ℝ → Coeff) {eta : ℝ} (heta : eta ∈ HeatedOutgoing.parameterDomain) : |
| 1124 | Continuous (fun y => logE F XR c (y, eta)) := by |
| 1125 | have hc : Continuous (fun y => freeE F ((1 / XR, c eta), (y, eta))) := |
| 1126 | (freeE_contDiff F).continuous.comp (continuous_const.prodMk |
| 1127 | (continuous_id.prodMk continuous_const)) |
| 1128 | exact hc.congr (fun y => (logE_eq_realize F XR c hXR (y, eta) heta).symm) |
| 1129 | |
| 1130 | theorem logI_eq_past_integral (F : Profile) {XR : ℝ} (hXR : 0 < XR) (c : ℝ → Coeff) |
| 1131 | {eta : ℝ} (heta : eta ∈ HeatedOutgoing.parameterDomain) (y : ℝ) : |
| 1132 | IntegrableOn (fun t => Real.exp (3 * t / 2) * logE F XR c (t, eta)) (Iic y) ∧ |
| 1133 | logI F XR c (y, eta) = ∫ t in Iic y, Real.exp (3 * t / 2) * logE F XR c (t, eta) := by |
| 1134 | let f : ℝ → ℝ := fun t => Real.exp (3 * t / 2) * F.logE (t, eta) |
| 1135 | let g : ℝ → ℝ := fun t => Real.exp (3 * t / 2) * logE F XR c (t, eta) |
| 1136 | have hex : Continuous (fun t : ℝ => Real.exp (3 * t / 2)) := |
| 1137 | Real.continuous_exp.comp ((continuous_const.mul continuous_id).div_const 2) |
| 1138 | have hf : Continuous f := hex.mul |
| 1139 | (F.logE_contDiff.continuous.comp (continuous_id.prodMk continuous_const)) |
| 1140 | have hg : Continuous g := hex.mul |
| 1141 | (logE_continuous_radial F hXR c heta) |
| 1142 | have hzero : IntegrableOn f (Iic (0 : ℝ)) := by |
| 1143 | have hh := (OutgoingHistories.angular_past F.reset eta).1 |
| 1144 | simp only [OutgoingHistories.angularWeight_eq] at hh |
| 1145 | exact hh |
| 1146 | have hbefore : ∀ t ≤ OutgoingDilation.patchClock F, g t = f t := by |
| 1147 | intro t ht |
| 1148 | dsimp [f, g] |
| 1149 | rw [logE_before_patch F hXR c ht] |
| 1150 | have hh := past_integral_update hf hg |
| 1151 | (past_integrable_from hf hzero (OutgoingDilation.patchClock F)) hbefore y |
| 1152 | refine ⟨hh.1, ?_⟩ |
| 1153 | rw [hh.2] |
| 1154 | unfold logI |
| 1155 | rw [OutgoingHistories.I_eq_integral] |
| 1156 | congr 1 |
| 1157 | apply intervalIntegral.integral_congr |
| 1158 | intro t _ |
| 1159 | dsimp [f, g] |
| 1160 | ring |
| 1161 | |
| 1162 | theorem logS_eq_past_integral (F : Profile) {XR : ℝ} (hXR : 0 < XR) (c : ℝ → Coeff) |
| 1163 | {eta : ℝ} (heta : eta ∈ HeatedOutgoing.parameterDomain) (y : ℝ) : |
| 1164 | IntegrableOn (fun t => Real.exp t * (F.logU (t, eta) ^ 2 - logE F XR c (t, eta) ^ 2 / 2)) |
| 1165 | (Iic y) ∧ logS F XR c (y, eta) = |
| 1166 | ∫ t in Iic y, Real.exp t * (F.logU (t, eta) ^ 2 - logE F XR c (t, eta) ^ 2 / 2) := by |
| 1167 | let f : ℝ → ℝ := fun t => Real.exp t * (F.logU (t, eta) ^ 2 - F.logE (t, eta) ^ 2 / 2) |
| 1168 | let g : ℝ → ℝ := fun t => Real.exp t * (F.logU (t, eta) ^ 2 - logE F XR c (t, eta) ^ 2 / 2) |
| 1169 | have hu := F.logU_contDiff.continuous.comp (continuous_id.prodMk (continuous_const : Continuous (fun _ : ℝ => eta))) |
| 1170 | have hf : Continuous f := Real.continuous_exp.mul ((hu.pow 2).sub |
| 1171 | (((F.logE_contDiff.continuous.comp (continuous_id.prodMk continuous_const)).pow 2).div_const 2)) |
| 1172 | have hg : Continuous g := Real.continuous_exp.mul ((hu.pow 2).sub |
| 1173 | (((logE_continuous_radial F hXR c heta).pow 2).div_const 2)) |
| 1174 | have hzero : IntegrableOn f (Iic (0 : ℝ)) := (OutgoingHistories.energy_past F.reset F.amp eta).1 |
| 1175 | have hbefore : ∀ t ≤ OutgoingDilation.patchClock F, g t = f t := by |
| 1176 | intro t ht |
| 1177 | dsimp [f, g] |
| 1178 | rw [logE_before_patch F hXR c ht] |
| 1179 | have hh := past_integral_update hf hg |
| 1180 | (past_integrable_from hf hzero (OutgoingDilation.patchClock F)) hbefore y |
| 1181 | refine ⟨hh.1, ?_⟩ |
| 1182 | rw [hh.2] |
| 1183 | unfold logS |
| 1184 | rw [OutgoingHistories.S_eq_integral F.reset F.amp_contDiff] |
| 1185 | have hi : (∫ t in OutgoingDilation.patchClock F..y, g t - f t) = |
| 1186 | -(1 / 2 : ℝ) * ∫ t in OutgoingDilation.patchClock F..y, |
| 1187 | Real.exp t * (logE F XR c (t, eta) ^ 2 - F.logE (t, eta) ^ 2) := by |
| 1188 | rw [← intervalIntegral.integral_const_mul] |
| 1189 | apply intervalIntegral.integral_congr |
| 1190 | intro t _ |
| 1191 | dsimp [f, g] |
| 1192 | ring |
| 1193 | rw [hi] |
| 1194 | change (∫ t in Iic y, f t) - _ = (∫ t in Iic y, f t) + _ |
| 1195 | ring |
| 1196 | |
| 1197 | theorem logE_mul_logU (F : Profile) {XR : ℝ} (hXR : 0 < XR) (c : ℝ → Coeff) (p : Point) : |
| 1198 | logE F XR c p * F.logU p = F.logE p * F.logU p := by |
| 1199 | have hh := HeatedOutgoing.E_times_U F XR c p.2 (XR * Real.exp p.1) hXR |
| 1200 | (mul_pos hXR (Real.exp_pos _)) |
| 1201 | simpa only [logE, HeatedOutgoing.U, OutgoingDilation.U, OutgoingDilation.E, |
| 1202 | OutgoingProfile.Profile.U, OutgoingProfile.Profile.E, mul_div_cancel_left₀ _ hXR.ne', |
| 1203 | Real.log_exp, Prod.mk.eta] using hh |
| 1204 | |
| 1205 | theorem J_eq_heated_past_integral (F : Profile) {XR : ℝ} (hXR : 0 < XR) (c : ℝ → Coeff) |
| 1206 | (y eta : ℝ) : OutgoingHistories.J F.reset F.amp (y, eta) = |
| 1207 | ∫ t in Iic y, Real.exp (3 * t / 2) * logE F XR c (t, eta) * F.logU (t, eta) := by |
| 1208 | rw [OutgoingHistories.J_eq_integral F.reset F.amp_contDiff] |
| 1209 | apply setIntegral_congr_fun measurableSet_Iic |
| 1210 | intro t _ |
| 1211 | change Real.exp (3 * t / 2) * F.logE (t, eta) * F.logU (t, eta) = _ |
| 1212 | dsimp only |
| 1213 | rw [mul_assoc, mul_assoc, logE_mul_logU F hXR c (t, eta)] |
| 1214 | |
| 1215 | theorem changeRow_after_switch (F : Profile) {XR : ℝ} (hXR : 0 < XR) (c : ℝ → Coeff) |
| 1216 | (eta : ℝ) (i : Fin 3) {X : ℝ} (hX : OutgoingDilation.switchRadius F XR ≤ X) : |
| 1217 | HeatedOutgoing.changeRow F XR c eta i X = HeatedOutgoing.heatRow F XR eta i X := by |
| 1218 | have hpos := (OutgoingDilation.switchRadius_pos F XR hXR).trans_le hX |
| 1219 | rw [HeatedOutgoing.changeRow_decomposition F XR c eta i X hXR hpos] |
| 1220 | have hc := OutgoingDilation.correction_zero_after_switch F XR X hXR (c eta) hX |
| 1221 | have hz : HeatedOutgoing.patchRow F XR c eta i X = 0 := by |
| 1222 | fin_cases i <;> simp [HeatedOutgoing.patchRow, TerminalCompensation.physicalProfile, |
| 1223 | TerminalCompensation.cleanProfile, hc] |
| 1224 | rw [hz, add_zero] |
| 1225 | |
| 1226 | /-- Exact restored total moments identify a finite-point change with the |
| 1227 | remaining future heat debt. In particular finite histories do not become |
| 1228 | equal merely because compensation is completed. -/ |
| 1229 | theorem changeRow_prefix_eq_neg_future_heat (F : Profile) {XR C : ℝ} |
| 1230 | (w : HeatedOutgoing.CompensationWitness F XR C) {eta : ℝ} |
| 1231 | (heta : eta ∈ HeatedOutgoing.parameterDomain) (i : Fin 3) {X : ℝ} |
| 1232 | (hX : OutgoingDilation.switchRadius F XR ≤ X) : |
| 1233 | (∫ t in Ioc 0 X, HeatedOutgoing.changeRow F XR w.coefficients eta i t) = |
| 1234 | -(∫ t in Ioi X, HeatedOutgoing.heatRow F XR eta i t) := by |
| 1235 | have hpos := (OutgoingDilation.switchRadius_pos F XR w.radius_pos).trans_le hX |
| 1236 | have hi := w.changeRow_integrable eta i heta |
| 1237 | have hsum := setIntegral_union Ioc_disjoint_Ioi_same measurableSet_Ioi |
| 1238 | (hi.mono_set Ioc_subset_Ioi_self) (hi.mono_set (Ioi_subset_Ioi hpos.le)) |
| 1239 | rw [Ioc_union_Ioi_eq_Ioi hpos.le, w.changeRow_integral_zero eta i heta] at hsum |
| 1240 | have htail : (∫ t in Ioi X, HeatedOutgoing.changeRow F XR w.coefficients eta i t) = |
| 1241 | ∫ t in Ioi X, HeatedOutgoing.heatRow F XR eta i t := by |
| 1242 | apply setIntegral_congr_fun measurableSet_Ioi |
| 1243 | intro t ht |
| 1244 | exact changeRow_after_switch F w.radius_pos w.coefficients eta i (hX.trans ht.le) |
| 1245 | rw [htail] at hsum |
| 1246 | linarith |
| 1247 | |
| 1248 | end NavierStokes.HeatSwitchCone |