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.CapGeometry.RoundSurfaceRicci |
| 3 | import PoincareLib.Geometry.RicciFlow.CanonicalNeighborhood.Ancient.Products |
| 4 | import PoincareLib.Geometry.Riemannian.Homothety.Curvature.ContractionTransport |
| 5 | import Mathlib.Analysis.Calculus.MeanValue |
| 6 | |
| 7 | /-! |
| 8 | # The actual affine time law of a round surface Ricci flow |
| 9 | |
| 10 | Every metric coefficient satisfies the same scalar evolution. Dividing by |
| 11 | one fixed positive coefficient proves that the whole metric changes by a |
| 12 | spatially constant factor. Native homothety invariance of Ricci then makes |
| 13 | the metric derivative constant in time, including at the terminal endpoint. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | namespace PoincareMT.M35 |
| 23 | |
| 24 | local notation "E2" => EuclideanSpace ℝ (Fin 2) |
| 25 | |
| 26 | private theorem ancient_zero_derivative_constant {f : ℝ → ℝ} |
| 27 | (hf : ∀ t ≤ 0, HasDerivWithinAt f 0 (Iic 0) t) {t : ℝ} (ht : t ≤ 0) : |
| 28 | f t = f 0 := by |
| 29 | have hd (s : ℝ) (hs : s ∈ Iic (0 : ℝ)) : |
| 30 | HasFDerivWithinAt f (0 : ℝ →L[ℝ] ℝ) (Iic 0) s := |
| 31 | hasFDerivWithinAt_iff_hasDerivWithinAt.mpr (hf s hs) |
| 32 | have h := (convex_Iic (0 : ℝ)).norm_image_sub_le_of_norm_hasFDerivWithin_le |
| 33 | hd (fun _ _ => norm_zero.le) (show (0 : ℝ) ∈ Iic 0 by norm_num) ht |
| 34 | simpa only [zero_mul, norm_le_zero_iff, sub_eq_zero] using h |
| 35 | |
| 36 | /-- An actual round surface family satisfying the actual Ricci-flow |
| 37 | equation evolves affinely in fixed coordinates, at every nonpositive time. -/ |
| 38 | theorem round_factor_metric_time_affine |
| 39 | (g : ℝ → RiemannianMetric 2 E2) (D : ∀ t, LeviCivitaData (g t)) |
| 40 | (hround : ∀ t ≤ 0, ConstantPositiveSectionalCurvature (g t) (D t)) |
| 41 | (heq : ∀ t ≤ 0, ∀ x u v : E2, |
| 42 | HasDerivWithinAt (fun s => (g s).inner x u v) |
| 43 | (-2 * (D t).ricci x u v) (Iic 0) t) |
| 44 | (t : ℝ) (ht : t ≤ 0) (x u v : E2) : |
| 45 | (g t).inner x u v = (g 0).inner x u v - 2 * t * (D 0).ricci x u v := by |
| 46 | classical |
| 47 | let e : E2 := EuclideanSpace.single 0 1 |
| 48 | have he : e ≠ 0 := by simp [e] |
| 49 | let a (s : ℝ) := (g s).inner 0 e e |
| 50 | have ha (s : ℝ) : 0 < a s := (g s).pos 0 e he |
| 51 | have hratio (y p q : E2) (s : ℝ) (hs : s ≤ 0) : |
| 52 | HasDerivWithinAt (fun z => (g z).inner y p q / a z) 0 (Iic 0) s := by |
| 53 | obtain ⟨c, _hc, hsec⟩ := hround s hs |
| 54 | have hf := heq s hs y p q |
| 55 | have hA := heq s hs 0 e e |
| 56 | rw [surface_ricci_of_sectional (D s) y c (hsec y)] at hf |
| 57 | rw [surface_ricci_of_sectional (D s) 0 c (hsec 0)] at hA |
| 58 | have hquot := hf.div hA (ha s).ne' |
| 59 | dsimp only [a] |
| 60 | convert! hquot using 1 |
| 61 | ring |
| 62 | have hscale (s : ℝ) (hs : s ≤ 0) (y p q : E2) : |
| 63 | (g s).inner y p q = (a s / a 0) * (g 0).inner y p q := by |
| 64 | have h := ancient_zero_derivative_constant (hratio y p q) hs |
| 65 | have hcross := (div_eq_div_iff (ha s).ne' (ha 0).ne').mp h |
| 66 | rw [div_mul_eq_mul_div, eq_div_iff (ha 0).ne'] |
| 67 | simpa only [mul_comm] using hcross |
| 68 | have hricci (s : ℝ) (hs : s ≤ 0) (y p q : E2) : |
| 69 | (D s).ricci y p q = (D 0).ricci y p q := by |
| 70 | have hhom : MetricHomothety (g 0) (g s) (Diffeomorph.refl (𝓡 2) E2 ∞) |
| 71 | (a s / a 0) := by |
| 72 | intro z b c |
| 73 | rw [Diffeomorph.coe_refl, mfderiv_id] |
| 74 | exact hscale s hs z b c |
| 75 | have h := M13.homothety_ricci_eq (g 0) (g s) (Diffeomorph.refl (𝓡 2) E2 ∞) |
| 76 | (a s / a 0) (div_pos (ha s) (ha 0)) hhom (D 0) (D s) y p q |
| 77 | rw [Diffeomorph.coe_refl, mfderiv_id] at h |
| 78 | exact h |
| 79 | have hzero (s : ℝ) (hs : s ≤ 0) : |
| 80 | HasDerivWithinAt (fun z => (g z).inner x u v + 2 * z * (D 0).ricci x u v) |
| 81 | 0 (Iic 0) s := by |
| 82 | have hf := heq s hs x u v |
| 83 | rw [hricci s hs] at hf |
| 84 | have hlin := (((hasDerivAt_id s).const_mul 2).mul_const |
| 85 | ((D 0).ricci x u v)).hasDerivWithinAt (s := Iic 0) |
| 86 | convert! hf.add hlin using 1 |
| 87 | ring |
| 88 | have h := ancient_zero_derivative_constant hzero ht |
| 89 | simp only [mul_zero, zero_mul, add_zero] at h |
| 90 | linarith only [h] |
| 91 | |
| 92 | end PoincareMT.M35 |