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.RicciFlow.Surgery.StandardCap.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.RawFlow.AxisTimeCoefficients |
| 3 | import Mathlib.Analysis.Calculus.ParametricIntegral |
| 4 | |
| 5 | /-! |
| 6 | # Time differentiation of the actual arclength integral |
| 7 | |
| 8 | Morgan-Tian Section 12.6, pp. 309-313. Joint raw-flow regularity |
| 9 | bounds the actual speed derivative on a compact time-radius rectangle, |
| 10 | justifying differentiation under the finite radial integral. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | namespace PoincareMT.M35.Uniqueness |
| 19 | |
| 20 | variable {g₀ : StandardInitialMetric} (G : PartialStandardCapFlow g₀) |
| 21 | |
| 22 | /-- The genuine arclength integral differentiates under its compact |
| 23 | radial integral, using the joint regularity of the retained raw flow. -/ |
| 24 | theorem raw_radialArclength_hasDerivAt_integral {t : ℝ} (ht : t ∈ Ioo 0 G.lifetime) |
| 25 | {r : ℝ} (hr : 0 ≤ r) : |
| 26 | HasDerivAt (fun s => radialArclength (G.flow.metric s) r) |
| 27 | (∫ a in (0 : ℝ)..r, rawAxisSpeedTimeDerivative G t a) t := by |
| 28 | have ht0 : 0 < t := ht.1 |
| 29 | have htL : t < G.lifetime := ht.2 |
| 30 | let d := min t (G.lifetime - t) / 2 |
| 31 | have hd : 0 < d := by dsimp only [d]; positivity |
| 32 | have hdt : d < t := by |
| 33 | dsimp only [d] |
| 34 | linarith [min_le_left t (G.lifetime - t)] |
| 35 | have hdL : d < G.lifetime - t := by |
| 36 | dsimp only [d] |
| 37 | linarith [min_le_right t (G.lifetime - t)] |
| 38 | have hvalid {s : ℝ} (hs : s ∈ Icc (t - d) (t + d)) : s ∈ Ioo 0 G.lifetime := by |
| 39 | constructor <;> linarith [hs.1, hs.2] |
| 40 | have hc (s : ℝ) : Continuous (fun a => axisRadialSpeed (G.flow.metric s) a) := |
| 41 | (axisRadialCoefficient_contDiff (G.flow.metric s)).continuous.sqrt |
| 42 | have hdc (s : ℝ) (hs : s ∈ Ico 0 G.lifetime) : |
| 43 | Continuous (rawAxisSpeedTimeDerivative G s) := by |
| 44 | rw [← continuousOn_univ] |
| 45 | have hm : MapsTo (fun a : ℝ => (s, a)) univ (Ico 0 G.lifetime ×ˢ univ) := |
| 46 | fun _ _ => ⟨hs, mem_univ _⟩ |
| 47 | have hc' : Continuous (fun a : ℝ => (s, a)) := continuous_const.prodMk continuous_id |
| 48 | have hh := (rawAxisSpeedTimeDerivative_contDiffOn G).continuousOn.comp hc'.continuousOn hm |
| 49 | exact hh |
| 50 | have hcompact := (isCompact_Icc : IsCompact (Icc (t - d) (t + d))).prod |
| 51 | (isCompact_Icc : IsCompact (Icc (0 : ℝ) r)) |
| 52 | have hdp : ContinuousOn (Function.uncurry (rawAxisSpeedTimeDerivative G)) |
| 53 | (Icc (t - d) (t + d) ×ˢ Icc 0 r) := |
| 54 | (rawAxisSpeedTimeDerivative_contDiffOn G).continuousOn.mono |
| 55 | (fun p hp => ⟨⟨(hvalid hp.1).1.le, (hvalid hp.1).2⟩, mem_univ _⟩) |
| 56 | obtain ⟨C, hC⟩ := hcompact.exists_bound_of_continuousOn hdp |
| 57 | have hs : Ioo (t - d) (t + d) ∈ 𝓝 t := Ioo_mem_nhds (by linarith) (by linarith) |
| 58 | have h := hasDerivAt_integral_of_dominated_loc_of_deriv_le |
| 59 | (μ := volume.restrict (Ioc (0 : ℝ) r)) |
| 60 | (F := fun s a => axisRadialSpeed (G.flow.metric s) a) |
| 61 | (F' := rawAxisSpeedTimeDerivative G) (bound := fun _ => C) hs |
| 62 | (Filter.Eventually.of_forall (fun s => (hc s).aestronglyMeasurable)) |
| 63 | ((hc t).integrableOn_Ioc) |
| 64 | ((hdc t ⟨ht.1.le, ht.2⟩).aestronglyMeasurable) |
| 65 | (by |
| 66 | rw [ae_restrict_iff' measurableSet_Ioc] |
| 67 | filter_upwards [] with a ha s hs' |
| 68 | exact hC (s, a) ⟨⟨hs'.1.le, hs'.2.le⟩, ⟨ha.1.le, ha.2⟩⟩) |
| 69 | (integrable_const C) |
| 70 | (by |
| 71 | rw [ae_restrict_iff' measurableSet_Ioc] |
| 72 | filter_upwards [] with a _ s hs' |
| 73 | have hst := hvalid ⟨hs'.1.le, hs'.2.le⟩ |
| 74 | exact (raw_axisRadialSpeed_hasDerivWithinAt G ⟨hst.1.le, hst.2⟩ a).hasDerivAt |
| 75 | (mem_of_superset (Ioo_mem_nhds hst.1 hst.2) Ioo_subset_Ico_self)) |
| 76 | simpa only [radialArclength, axisRadialSpeed, intervalIntegral.integral_of_le hr] using h.2 |
| 77 | |
| 78 | end PoincareMT.M35.Uniqueness |