Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.TraceCurvatureForcing |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Periodic.GaussianRestartBound |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Periodic.GaussianUniformTrace |
| 4 | import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Periodic.SmoothApproximation |
| 5 | import PoincareLib.Geometry.RicciFlow.CurveShortening.Integral.Periodicity |
| 6 | import Mathlib.Analysis.SpecificLimits.Basic |
| 7 | |
| 8 | /-! |
| 9 | # Actual uniform initial curvature modulus |
| 10 | |
| 11 | The positive restart formula is passed to the initial time for each |
| 12 | actual smooth curve before selecting a common modulus on compact |
| 13 | initial data. MT2007 Claim 19.1, p. 437; MT2015Correction, pp. 3--6; |
| 14 | `2026-09-22-c2-actual-uniform-initial-trace.md`. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter MeasureTheory |
| 21 | open scoped Manifold ContDiff Bundle Topology |
| 22 | |
| 23 | universe u v |
| 24 | |
| 25 | namespace PoincareMT.M63 |
| 26 | |
| 27 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 29 | [T2Space M] {ι : Type v} [Fintype ι] {a b : ℝ} |
| 30 | |
| 31 | local notation "W" => EuclideanSpace ℝ ι |
| 32 | local notation "X" => C(AddCircle curvePeriod, W) |
| 33 | |
| 34 | /-- The actual embedded curvature has a heat error with constants |
| 35 | chosen before the smooth curve. Both closed endpoints follow from |
| 36 | actual field continuity. MT2007 Claim 19.1, p. 437; actual uniform |
| 37 | initial-trace derivation, statement 1. -/ |
| 38 | theorem exists_uniform_embeddedCurvature_heat_error |
| 39 | (F : RicciFlow n M (Icc a b)) (hab : a < b) |
| 40 | (hcompact : IsCompact (univ : Set M)) {e : M → W} |
| 41 | (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 42 | {K R J m0 V0 : ℝ} (hK : 0 ≤ K) (hR : 0 ≤ R) (hJ : 0 ≤ J) |
| 43 | (hBounds : CurveEvolutionAmbientBounds F K K K) (hm0 : 0 < m0) (hmV : m0 ≤ V0) : |
| 44 | let _ : Fact (0 < curvePeriod) := ⟨by unfold curvePeriod; positivity⟩ |
| 45 | ∃ D E : ℝ, (0 ≤ D ∧ 0 ≤ E) ∧ |
| 46 | ∀ (c : ℝ → ℝ → M) (_hc : M62ShrinkingCurve F c) (v0 : ℝ), v0 ∈ Icc m0 V0 → |
| 47 | (∀ x, curveSpeed F c a x = v0) → |
| 48 | (∀ t ∈ Ioo a b, ∀ x, m62CurvatureSquared F c t x ≤ R) → |
| 49 | (∀ t ∈ Ioo a b, ∀ x, |
| 50 | (F.metric t).tangentNorm (c x t) (m63CurvatureJet F c 1 t x) ≤ |
| 51 | J / Real.sqrt (t - a)) → |
| 52 | ∀ h : ℝ → X, |
| 53 | (∀ t ∈ Icc a b, ∀ x : ℝ, h t (x : AddCircle curvePeriod) = |
| 54 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) (m62CurvatureVector F c t x)) → |
| 55 | ∀ t ∈ Icc a b, |
| 56 | ‖h t - periodicGaussianHeat ((v0 ^ 2)⁻¹ * (t - a)) (h a)‖ ≤ |
| 57 | D * (t - a) + E * Real.sqrt (t - a) := by |
| 58 | classical |
| 59 | let : Fact (0 < curvePeriod) := ⟨by unfold curvePeriod; positivity⟩ |
| 60 | dsimp only |
| 61 | obtain ⟨A, B, C, ⟨hA, hB, hC⟩, hforcing⟩ := |
| 62 | exists_uniform_embeddedCurvature_forcing_bounds F hab hcompact he hK hR hJ |
| 63 | hBounds hm0 hmV |
| 64 | let K1 := ∫ z : ℝ, ‖(-2 * z) * gaussianHeatKernel 1 z‖ |
| 65 | let D := K1 * V0 * A + B |
| 66 | let E := 2 * C |
| 67 | have hK1 : 0 ≤ K1 := integral_nonneg fun _ => norm_nonneg _ |
| 68 | have hV0 : 0 < V0 := hm0.trans_le hmV |
| 69 | have hD : 0 ≤ D := by dsimp only [D]; positivity |
| 70 | have hE : 0 ≤ E := by dsimp only [E]; positivity |
| 71 | refine ⟨D, E, ⟨hD, hE⟩, ?_⟩ |
| 72 | intro c hc v0 hv0 hInitial hCurv hJet h hrep |
| 73 | let H : ℝ → ℝ → W := fun t x => |
| 74 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) (m62CurvatureVector F c t x) |
| 75 | let ν := (v0 ^ 2)⁻¹ |
| 76 | let η : ℝ → ℝ → ℝ := fun t x => (curveSpeed F c t x ^ 2)⁻¹ - ν |
| 77 | have hv0pos : 0 < v0 := hm0.trans_le hv0.1 |
| 78 | have hν : 0 < ν := inv_pos.mpr (sq_pos_of_pos hv0pos) |
| 79 | have hforce := hforcing c hc v0 hv0 hInitial hCurv hJet |
| 80 | obtain ⟨h₀, h₁, h₂, hdot, hh₀, hh₁, hh₂, hhdot, |
| 81 | hval₀, hval₁, hval₂, hvaldot, hx, hxx, htime⟩ := |
| 82 | exists_periodic_embeddedCurvature_restart_data F c hab hc he |
| 83 | have hsame (t : ℝ) (ht : t ∈ Icc a b) : h t = h₀ t := by |
| 84 | apply ContinuousMap.ext |
| 85 | intro z |
| 86 | obtain ⟨x, rfl⟩ := QuotientAddGroup.mk_surjective z |
| 87 | exact (hrep t ht x).trans (hval₀ t ht x).symm |
| 88 | have hh : ContinuousOn h (Icc a b) := hh₀.congr hsame |
| 89 | have hηsmooth (t : ℝ) (ht : t ∈ Ioo a b) : ContDiff ℝ 1 (η t) := |
| 90 | (((M62.speed_contDiff F c hc (Ioo_subset_Icc_self ht)).pow 2).inv |
| 91 | (fun x => pow_ne_zero 2 (M62.speed_pos F c hc (Ioo_subset_Icc_self ht) x).ne')).sub |
| 92 | contDiff_const |
| 93 | have hηper (t : ℝ) (ht : t ∈ Ioo a b) : Function.Periodic (η t) curvePeriod := by |
| 94 | intro x |
| 95 | dsimp only [η] |
| 96 | rw [M62.speed_periodic F c hc (Ioo_subset_Icc_self ht) x] |
| 97 | have hη₁per (t : ℝ) (ht : t ∈ Ioo a b) : |
| 98 | Function.Periodic (deriv (η t)) curvePeriod := |
| 99 | (hηper t ht).deriv_of_differentiable ((hηsmooth t ht).differentiable (by norm_num)) |
| 100 | let ηc : ℝ → C(AddCircle curvePeriod, ℝ) := fun t => |
| 101 | if ht : t ∈ Ioo a b then |
| 102 | ⟨(hηper t ht).lift, |
| 103 | (QuotientAddGroup.isQuotientMap_mk (AddSubgroup.zmultiples curvePeriod)).continuous_iff.mpr |
| 104 | (hηsmooth t ht).continuous⟩ |
| 105 | else 0 |
| 106 | let η₁c : ℝ → C(AddCircle curvePeriod, ℝ) := fun t => |
| 107 | if ht : t ∈ Ioo a b then |
| 108 | ⟨(hη₁per t ht).lift, |
| 109 | (QuotientAddGroup.isQuotientMap_mk (AddSubgroup.zmultiples curvePeriod)).continuous_iff.mpr |
| 110 | (hηsmooth t ht).continuous_deriv_one⟩ |
| 111 | else 0 |
| 112 | have hηc (t : ℝ) (ht : t ∈ Ioo a b) (x : ℝ) : |
| 113 | ηc t (x : AddCircle curvePeriod) = η t x := by |
| 114 | simp only [ηc, dif_pos ht] |
| 115 | rfl |
| 116 | have hη₁c (t : ℝ) (ht : t ∈ Ioo a b) (x : ℝ) : |
| 117 | η₁c t (x : AddCircle curvePeriod) = deriv (η t) x := by |
| 118 | simp only [η₁c, dif_pos ht] |
| 119 | rfl |
| 120 | let F₀ : ℝ → X := fun t => ηc t • h₁ t |
| 121 | let F₁ : ℝ → X := fun t => η₁c t • h₁ t + ηc t • h₂ t |
| 122 | let G : ℝ → X := fun t => |
| 123 | (hdot t - (ηc t + ContinuousMap.const _ ν) • h₂ t) - η₁c t • h₁ t |
| 124 | have hF₀val (t : ℝ) (ht : t ∈ Ioo a b) (x : ℝ) : |
| 125 | F₀ t (x : AddCircle curvePeriod) = η t x • deriv (H t) x := by |
| 126 | change ηc t (x : AddCircle curvePeriod) • h₁ t (x : AddCircle curvePeriod) = _ |
| 127 | rw [hηc t ht x, hval₁ t ht x] |
| 128 | have hF₁val (t : ℝ) (ht : t ∈ Ioo a b) (x : ℝ) : |
| 129 | F₁ t (x : AddCircle curvePeriod) = |
| 130 | deriv (η t) x • deriv (H t) x + η t x • iteratedDeriv 2 (H t) x := by |
| 131 | change η₁c t (x : AddCircle curvePeriod) • h₁ t (x : AddCircle curvePeriod) + |
| 132 | ηc t (x : AddCircle curvePeriod) • h₂ t (x : AddCircle curvePeriod) = _ |
| 133 | rw [hη₁c t ht x, hηc t ht x, hval₁ t ht x, hval₂ t ht x] |
| 134 | have hGval (t : ℝ) (ht : t ∈ Ioo a b) (x : ℝ) : |
| 135 | G t (x : AddCircle curvePeriod) = |
| 136 | (deriv (fun r => H r x) t - (curveSpeed F c t x ^ 2)⁻¹ • iteratedDeriv 2 (H t) x) - |
| 137 | deriv (η t) x • deriv (H t) x := by |
| 138 | change (hdot t (x : AddCircle curvePeriod) - |
| 139 | (ηc t (x : AddCircle curvePeriod) + ν) • h₂ t (x : AddCircle curvePeriod)) - |
| 140 | η₁c t (x : AddCircle curvePeriod) • h₁ t (x : AddCircle curvePeriod) = _ |
| 141 | rw [hvaldot t ht x, hηc t ht x, hval₂ t ht x, hη₁c t ht x, hval₁ t ht x] |
| 142 | simp only [η, sub_add_cancel] |
| 143 | rfl |
| 144 | have hFderiv (t : ℝ) (ht : t ∈ Ioo a b) (x : ℝ) : |
| 145 | HasDerivAt (fun y : ℝ => F₀ t (y : AddCircle curvePeriod)) |
| 146 | (F₁ t (x : AddCircle curvePeriod)) x := by |
| 147 | rw [show (fun y : ℝ => F₀ t (y : AddCircle curvePeriod)) = |
| 148 | (fun y => η t y • deriv (H t) y) from funext (hF₀val t ht), hF₁val t ht x] |
| 149 | exact (hforce t ht x).1 |
| 150 | have hresidual (t : ℝ) (ht : t ∈ Ioo a b) : hdot t - ν • h₂ t = F₁ t + G t := by |
| 151 | apply ContinuousMap.ext |
| 152 | intro z |
| 153 | obtain ⟨x, rfl⟩ := QuotientAddGroup.mk_surjective z |
| 154 | change hdot t (x : AddCircle curvePeriod) - ν • h₂ t (x : AddCircle curvePeriod) = |
| 155 | F₁ t (x : AddCircle curvePeriod) + G t (x : AddCircle curvePeriod) |
| 156 | rw [hvaldot t ht x, hval₂ t ht x, hF₁val t ht x, hGval t ht x] |
| 157 | exact (hforce t ht x).2.1 |
| 158 | have hFnorm (t : ℝ) (ht : t ∈ Ioo a b) : ‖F₀ t‖ ≤ A * Real.sqrt (t - a) := by |
| 159 | apply (ContinuousMap.norm_le (F₀ t) (mul_nonneg hA (Real.sqrt_nonneg _))).mpr |
| 160 | intro z |
| 161 | obtain ⟨x, rfl⟩ := QuotientAddGroup.mk_surjective z |
| 162 | rw [hF₀val t ht x] |
| 163 | exact (hforce t ht x).2.2.1 |
| 164 | have hGnorm (t : ℝ) (ht : t ∈ Ioo a b) : ‖G t‖ ≤ B + C / Real.sqrt (t - a) := by |
| 165 | apply (ContinuousMap.norm_le (G t) |
| 166 | (add_nonneg hB (div_nonneg hC (Real.sqrt_nonneg _)))).mpr |
| 167 | intro z |
| 168 | obtain ⟨x, rfl⟩ := QuotientAddGroup.mk_surjective z |
| 169 | rw [hGval t ht x] |
| 170 | exact (hforce t ht x).2.2.2 |
| 171 | have hsqrt : Real.sqrt ν = v0⁻¹ := by |
| 172 | dsimp only [ν] |
| 173 | rw [Real.sqrt_inv, Real.sqrt_sq_eq_abs, abs_of_pos hv0pos] |
| 174 | have hcoef : 2 * (K1 / (2 * Real.sqrt ν)) * A + B ≤ D := by |
| 175 | calc |
| 176 | _ = K1 * v0 * A + B := by |
| 177 | rw [hsqrt] |
| 178 | field_simp |
| 179 | _ ≤ D := add_le_add |
| 180 | (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hv0.2 hK1) hA) le_rfl |
| 181 | have hrestart (τ σ : ℝ) (hτ : 0 < τ) (hτb : τ < b - a) |
| 182 | (hσ : 0 < σ) (hστ : σ ≤ τ) : |
| 183 | ‖h₀ (a + τ) - periodicGaussianHeat (ν * (τ - σ)) (h₀ (a + σ))‖ ≤ |
| 184 | D * τ + E * Real.sqrt τ := by |
| 185 | have hmap (r : ℝ) (hr : r ∈ Icc σ τ) : a + r ∈ Ioo a b := by |
| 186 | constructor <;> linarith [hr.1, hr.2] |
| 187 | have hc₀ : ContinuousOn (fun r => h₀ (a + r)) (Icc σ τ) := |
| 188 | hh₀.comp (continuous_const.add continuous_id).continuousOn |
| 189 | (fun r hr => Ioo_subset_Icc_self (hmap r hr)) |
| 190 | have hc₁ : ContinuousOn (fun r => h₁ (a + r)) (Icc σ τ) := |
| 191 | hh₁.comp (continuous_const.add continuous_id).continuousOn hmap |
| 192 | have hc₂ : ContinuousOn (fun r => h₂ (a + r)) (Icc σ τ) := |
| 193 | hh₂.comp (continuous_const.add continuous_id).continuousOn hmap |
| 194 | have hct : ContinuousOn (fun r => hdot (a + r)) (Icc σ τ) := |
| 195 | hhdot.comp (continuous_const.add continuous_id).continuousOn hmap |
| 196 | have htd (r : ℝ) (hr : r ∈ Ioo σ τ) (x : ℝ) : |
| 197 | HasDerivAt (fun s => h₀ (a + s) (x : AddCircle curvePeriod)) |
| 198 | (hdot (a + r) (x : AddCircle curvePeriod)) r := by |
| 199 | simpa only [Function.comp_def, one_smul] using |
| 200 | (htime (a + r) (hmap r (Ioo_subset_Icc_self hr)) x).scomp r |
| 201 | ((hasDerivAt_id r).const_add a) |
| 202 | have hbound := periodicGaussianHeat_restart_norm_bound hσ hστ hν hA hB hC |
| 203 | (fun r => h₀ (a + r)) (fun r => h₁ (a + r)) (fun r => h₂ (a + r)) |
| 204 | (fun r => hdot (a + r)) (fun r => F₀ (a + r)) (fun r => F₁ (a + r)) |
| 205 | (fun r => G (a + r)) hc₀ hc₁ hc₂ hct |
| 206 | (fun r hr => hx (a + r) (hmap r hr)) |
| 207 | (fun r hr => hxx (a + r) (hmap r hr)) htd |
| 208 | (fun r hr => hFderiv (a + r) (hmap r (Ioo_subset_Icc_self hr))) |
| 209 | (fun r hr => hresidual (a + r) (hmap r (Ioo_subset_Icc_self hr))) |
| 210 | (fun r hr => by |
| 211 | simpa only [add_sub_cancel_left] using |
| 212 | hFnorm (a + r) (hmap r (Ioo_subset_Icc_self hr))) |
| 213 | (fun r hr => by |
| 214 | simpa only [add_sub_cancel_left] using |
| 215 | hGnorm (a + r) (hmap r (Ioo_subset_Icc_self hr))) |
| 216 | exact hbound.trans (add_le_add (mul_le_mul_of_nonneg_right hcoef hτ.le) le_rfl) |
| 217 | have hinitial (τ : ℝ) (hτ : 0 < τ) (hτb : τ < b - a) : |
| 218 | ‖h₀ (a + τ) - periodicGaussianHeat (ν * τ) (h₀ a)‖ ≤ |
| 219 | D * τ + E * Real.sqrt τ := by |
| 220 | let σ : ℕ → ℝ := fun k => τ * (1 / ((k : ℝ) + 1)) |
| 221 | have hσpos (k : ℕ) : 0 < σ k := by dsimp only [σ]; positivity |
| 222 | have hστ (k : ℕ) : σ k ≤ τ := by |
| 223 | dsimp only [σ] |
| 224 | apply mul_le_of_le_one_right hτ.le |
| 225 | exact (div_le_one (by positivity)).mpr (by linarith [Nat.cast_nonneg (α := ℝ) k]) |
| 226 | have hσzero : Tendsto σ atTop (𝓝 0) := by |
| 227 | simpa only [mul_zero] using |
| 228 | (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul τ |
| 229 | have hatime : Tendsto (fun k => a + σ k) atTop (𝓝[Icc a b] a) := by |
| 230 | apply tendsto_nhdsWithin_iff.mpr |
| 231 | refine ⟨?_, Eventually.of_forall fun k => ?_⟩ |
| 232 | · simpa only [add_zero] using hσzero.const_add a |
| 233 | · exact ⟨by linarith [hσpos k], by linarith [hστ k]⟩ |
| 234 | have hpath : Tendsto (fun k => h₀ (a + σ k)) atTop (𝓝 (h₀ a)) := |
| 235 | (hh₀ a ⟨le_rfl, hab.le⟩).tendsto.comp hatime |
| 236 | have hlag : Tendsto (fun k => ν * (τ - σ k)) atTop (𝓝 (ν * τ)) := by |
| 237 | simpa only [sub_zero] using (tendsto_const_nhds.sub hσzero).const_mul ν |
| 238 | have hheat := continuous_periodicGaussianHeat_action.continuousAt.tendsto.comp |
| 239 | (hlag.prodMk_nhds hpath) |
| 240 | exact le_of_tendsto' (tendsto_const_nhds.sub hheat).norm |
| 241 | (fun k => hrestart τ (σ k) hτ hτb (hσpos k) (hστ k)) |
| 242 | have hinterior (t : ℝ) (ht : t ∈ Ioo a b) : |
| 243 | ‖h t - periodicGaussianHeat (ν * (t - a)) (h a)‖ ≤ |
| 244 | D * (t - a) + E * Real.sqrt (t - a) := by |
| 245 | rw [hsame t (Ioo_subset_Icc_self ht), hsame a ⟨le_rfl, hab.le⟩] |
| 246 | simpa only [add_sub_cancel] using |
| 247 | hinitial (t - a) (sub_pos.mpr ht.1) (sub_lt_sub_right ht.2 a) |
| 248 | have hleft : ContinuousOn (fun t => |
| 249 | ‖h t - periodicGaussianHeat (ν * (t - a)) (h a)‖) (Icc a b) := |
| 250 | (hh.sub (continuous_periodicGaussianHeat_action.comp_continuousOn |
| 251 | (((continuous_const.mul (continuous_id.sub continuous_const)).prodMk |
| 252 | continuous_const).continuousOn))).norm |
| 253 | have hright : Continuous (fun t : ℝ => D * (t - a) + E * Real.sqrt (t - a)) := |
| 254 | (continuous_const.mul (continuous_id.sub continuous_const)).add |
| 255 | (continuous_const.mul (Real.continuous_sqrt.comp (continuous_id.sub continuous_const))) |
| 256 | intro t ht |
| 257 | exact le_on_closure hinterior (by simpa only [closure_Ioo hab.ne] using hleft) |
| 258 | hright.continuousOn (by simpa only [closure_Ioo hab.ne] using ht) |
| 259 | |
| 260 | /-- Compact actual initial curvature data have one initial trace modulus |
| 261 | under the stated uniform geometric bounds. MT2007 Claim 19.1, p. 437; |
| 262 | actual uniform initial-trace derivation, statement 2. -/ |
| 263 | theorem embeddedCurvature_uniform_initial_trace_on_compact_data |
| 264 | (F : RicciFlow n M (Icc a b)) (hab : a < b) |
| 265 | (hcompact : IsCompact (univ : Set M)) {e : M → W} |
| 266 | (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 267 | {K R J m0 V0 : ℝ} (hK : 0 ≤ K) (hR : 0 ≤ R) (hJ : 0 ≤ J) |
| 268 | (hBounds : CurveEvolutionAmbientBounds F K K K) (hm0 : 0 < m0) (hmV : m0 ≤ V0) |
| 269 | {Kinitial : Set X} (hinitial : IsCompact Kinitial) {ε : ℝ} (hε : 0 < ε) : |
| 270 | let _ : Fact (0 < curvePeriod) := ⟨by unfold curvePeriod; positivity⟩ |
| 271 | ∃ d : ℝ, 0 < d ∧ |
| 272 | ∀ (c : ℝ → ℝ → M) (_hc : M62ShrinkingCurve F c) (v0 : ℝ), v0 ∈ Icc m0 V0 → |
| 273 | (∀ x, curveSpeed F c a x = v0) → |
| 274 | (∀ t ∈ Ioo a b, ∀ x, m62CurvatureSquared F c t x ≤ R) → |
| 275 | (∀ t ∈ Ioo a b, ∀ x, |
| 276 | (F.metric t).tangentNorm (c x t) (m63CurvatureJet F c 1 t x) ≤ |
| 277 | J / Real.sqrt (t - a)) → |
| 278 | ∀ h : ℝ → X, |
| 279 | (∀ t ∈ Icc a b, ∀ x : ℝ, h t (x : AddCircle curvePeriod) = |
| 280 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) (m62CurvatureVector F c t x)) → |
| 281 | h a ∈ Kinitial → ∀ t ∈ Icc a b, t - a < d → ‖h t - h a‖ < ε := by |
| 282 | let : Fact (0 < curvePeriod) := ⟨by unfold curvePeriod; positivity⟩ |
| 283 | dsimp only |
| 284 | obtain ⟨D, E, _, herror⟩ := exists_uniform_embeddedCurvature_heat_error |
| 285 | F hab hcompact he hK hR hJ hBounds hm0 hmV |
| 286 | have hcerror : Continuous (fun τ : ℝ => D * τ + E * Real.sqrt τ) := |
| 287 | (continuous_const.mul continuous_id).add (continuous_const.mul Real.continuous_sqrt) |
| 288 | have hzero : D * (0 : ℝ) + E * Real.sqrt 0 < ε / 2 := by |
| 289 | simpa only [mul_zero, Real.sqrt_zero, add_zero] using half_pos hε |
| 290 | obtain ⟨dError, hdError, hnear⟩ := Metric.mem_nhds_iff.mp |
| 291 | (hcerror.continuousAt.eventually (isOpen_Iio.mem_nhds hzero)) |
| 292 | obtain ⟨dHeat, hdHeat, hheat⟩ := |
| 293 | periodicGaussianHeat_uniform_initial_trace hinitial (half_pos hε) |
| 294 | let d := min dError (dHeat * m0 ^ 2) |
| 295 | have hd : 0 < d := lt_min hdError (mul_pos hdHeat (sq_pos_of_pos hm0)) |
| 296 | refine ⟨d, hd, ?_⟩ |
| 297 | intro c hc v0 hv0 hInitial hCurv hJet h hrep hKinitial t ht htd |
| 298 | have hτ : 0 ≤ t - a := sub_nonneg.mpr ht.1 |
| 299 | have hv0pos : 0 < v0 := hm0.trans_le hv0.1 |
| 300 | have herr : D * (t - a) + E * Real.sqrt (t - a) < ε / 2 := |
| 301 | hnear (by |
| 302 | rw [Metric.mem_ball, Real.dist_eq, sub_zero, abs_of_nonneg hτ] |
| 303 | exact htd.trans_le (min_le_left _ _)) |
| 304 | have hsq : m0 ^ 2 ≤ v0 ^ 2 := by nlinarith [hv0.1] |
| 305 | have hlag : |(v0 ^ 2)⁻¹ * (t - a)| < dHeat := by |
| 306 | rw [abs_of_nonneg (mul_nonneg (inv_nonneg.mpr (sq_nonneg _)) hτ)] |
| 307 | calc |
| 308 | (v0 ^ 2)⁻¹ * (t - a) = (t - a) / v0 ^ 2 := by ring |
| 309 | _ ≤ (t - a) / m0 ^ 2 := div_le_div_of_nonneg_left hτ (sq_pos_of_pos hm0) hsq |
| 310 | _ < dHeat := (div_lt_iff₀ (sq_pos_of_pos hm0)).mpr |
| 311 | (htd.trans_le (min_le_right _ _)) |
| 312 | have hheaterr := hheat ((v0 ^ 2)⁻¹ * (t - a)) hlag (h a) hKinitial |
| 313 | have herrbound := herror c hc v0 hv0 hInitial hCurv hJet h hrep t ht |
| 314 | have htriangle := norm_add_le |
| 315 | (h t - periodicGaussianHeat ((v0 ^ 2)⁻¹ * (t - a)) (h a)) |
| 316 | (periodicGaussianHeat ((v0 ^ 2)⁻¹ * (t - a)) (h a) - h a) |
| 317 | rw [sub_add_sub_cancel] at htriangle |
| 318 | exact htriangle.trans_lt (by linarith) |
| 319 | |
| 320 | end PoincareMT.M63 |