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.Soliton.Basic |
| 2 | import PoincareLib.Geometry.Riemannian.Curvature.LocalIsometryRicci |
| 3 | import PoincareLib.Geometry.Riemannian.Normalization.Scaling.Curvature |
| 4 | import Mathlib.Analysis.Calculus.MeanValue |
| 5 | |
| 6 | /-! |
| 7 | # The fixed metric scale of an Einstein shrinking flow |
| 8 | |
| 9 | The self-similar slice identifications and Ricci naturality determine the |
| 10 | time derivative on the original manifold. Integrating this scalar equation |
| 11 | removes the time-dependent diffeomorphisms from the metric identity. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 19 | |
| 20 | namespace PoincareMT.ShrinkingSolitonFlow |
| 21 | |
| 22 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 25 | [T2Space M] [T3Space M] [SecondCountableTopology M] [ConnectedSpace M] |
| 26 | {S : GradientShrinkingSolitonData n M} |
| 27 | |
| 28 | /-- An Einstein soliton's supplied shrinking flow has a fixed metric scale. -/ |
| 29 | theorem inner_eq_neg_time_mul_of_einstein (G : ShrinkingSolitonFlow S) |
| 30 | (hEinstein : ∀ x : M, ∀ u v : TangentSpace (𝓡 n) x, |
| 31 | S.connection.ricci x u v = (1 / 2 : ℝ) * S.metric.inner x u v) |
| 32 | (t : ℝ) (ht : t < 0) (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 33 | (G.flow.metric t).inner x u v = (-t) * S.metric.inner x u v := by |
| 34 | have hder (s : ℝ) (hs : s < 0) : |
| 35 | HasDerivAt (fun r => (G.flow.metric r).inner x u v) |
| 36 | ((G.flow.metric s).inner x u v / s) s := by |
| 37 | obtain ⟨H⟩ := G.self_similar s hs |
| 38 | have habs : 0 < |s| := abs_pos.mpr hs.ne |
| 39 | let Ds := rescaledMetric_connection S.metric S.connection |s| habs |
| 40 | have hR := (G.flow.connection s).ricci_eq_of_local_isometry Ds |
| 41 | isOpen_univ H.map.contMDiff.contMDiffOn |
| 42 | (fun y _ a b => by simpa only [rescaledMetric_inner] using H.inner_eq y a b) |
| 43 | (Set.mem_univ x) u v |
| 44 | rw [rescaledMetric_ricci, hEinstein] at hR |
| 45 | have hcoefficient : -2 * (G.flow.connection s).ricci x u v = |
| 46 | (G.flow.metric s).inner x u v / s := by |
| 47 | rw [hR, H.inner_eq] |
| 48 | simp only [abs_of_neg hs] |
| 49 | field_simp [hs.ne] |
| 50 | rw [← hcoefficient] |
| 51 | exact (G.flow.equation s hs x u v).hasDerivAt (isOpen_Iio.mem_nhds hs) |
| 52 | have hquot (s : ℝ) (hs : s < 0) : |
| 53 | HasDerivAt (fun r => (G.flow.metric r).inner x u v / r) 0 s := by |
| 54 | have hd := (hder s hs).div (hasDerivAt_id s) hs.ne |
| 55 | convert hd using 1 <;> first | rfl | simp [hs.ne] |
| 56 | have heq := isOpen_Iio.is_const_of_deriv_eq_zero (convex_Iio (0 : ℝ)).isPreconnected |
| 57 | (fun s hs => (hquot s hs).differentiableAt.differentiableWithinAt) |
| 58 | (fun s hs => (hquot s hs).deriv) ht (by norm_num : (-1 : ℝ) < 0) |
| 59 | rw [G.at_minus_one] at heq |
| 60 | have hmul := (div_eq_iff ht.ne).mp heq |
| 61 | simpa only [div_neg, div_one, neg_mul, mul_neg, mul_comm] using hmul |
| 62 | |
| 63 | end PoincareMT.ShrinkingSolitonFlow |