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.ReducedGeometry.ReducedLength.Minimum.Variational.Extension.Jets |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variational.Extension.Pasting |
| 3 | |
| 4 | /-! |
| 5 | Adapted from Mapher `Proofs/M08/SmoothEndpointExtension.lean`, commit |
| 6 | `49331b7d7ecad38f53e4300c3b35d6a84b2cc648`. |
| 7 | -/ |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | |
| 11 | open Set |
| 12 | open scoped ContDiff |
| 13 | |
| 14 | namespace PoincareMT.ReducedLengthMinimum.Variational |
| 15 | |
| 16 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] |
| 17 | |
| 18 | theorem exists_smooth_extension_Icc {a b : ℝ} (hab : a < b) |
| 19 | (f : ℝ → E) (hf : ContDiffOn ℝ ∞ f (Icc a b)) : |
| 20 | ∃ g : ℝ → E, ContDiff ℝ ∞ g ∧ EqOn g f (Icc a b) := by |
| 21 | obtain ⟨L, hL, hLa⟩ := exists_smooth_endpoint_jets |
| 22 | (fun k ↦ iteratedDerivWithin k f (Icc a b) a) |
| 23 | obtain ⟨R, hR, hRb⟩ := exists_smooth_endpoint_jets |
| 24 | (fun k ↦ iteratedDerivWithin k f (Icc a b) b) |
| 25 | apply smooth_pasting_of_matching_endpoint_jets hab f |
| 26 | (fun x ↦ L (x - a)) (fun x ↦ R (x - b)) hf |
| 27 | (hL.comp (contDiff_id.sub contDiff_const)) (hR.comp (contDiff_id.sub contDiff_const)) |
| 28 | · intro k |
| 29 | simpa only [iteratedDeriv_comp_sub_const, sub_self] using hLa k |
| 30 | · intro k |
| 31 | simpa only [iteratedDeriv_comp_sub_const, sub_self] using hRb k |
| 32 | |
| 33 | end PoincareMT.ReducedLengthMinimum.Variational |
| 34 |