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.TwoDimensional.Compact.Rigidity.Jacobi.Potential |
| 2 | import PoincareLib.Geometry.RicciFlow.Soliton.TwoDimensional.Compact.Rigidity.RegularLevels |
| 3 | import PoincareLib.Geometry.Riemannian.Comparison.Laplacian.Branch.Complete |
| 4 | import PoincareLib.Geometry.Riemannian.Distance.SegmentSpeed |
| 5 | import Mathlib.Analysis.Calculus.LocalExtr.Rolle |
| 6 | |
| 7 | /-! |
| 8 | # Critical levels of a complete shrinking surface are singletons |
| 9 | |
| 10 | A minimizing geodesic between two points on the same potential level would |
| 11 | have an interior turning point. Starting at a nondegenerate critical point, |
| 12 | the transverse Jacobi equation rules this out. Thus a nonround compact |
| 13 | shrinking surface has precisely one minimum and one maximum. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle ENNReal |
| 21 | |
| 22 | namespace PoincareMT.LeviCivitaData |
| 23 | |
| 24 | variable {M : Type*} [TopologicalSpace M] [T3Space M] [PreconnectedSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 26 | {g : RiemannianMetric 2 M} |
| 27 | |
| 28 | /-- A nondegenerate critical point is the only point on its potential level. -/ |
| 29 | theorem eq_of_potential_eq_at_nondegenerate_critical_point (D : LeviCivitaData g) |
| 30 | (hc : MetricComplete g) {f : M → ℝ} {lambda : ℝ} |
| 31 | (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) 2 f) |
| 32 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 33 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) |
| 34 | {p q : M} (hcrit : D.gradient f p = 0) |
| 35 | (hR : D.scalarCurvature p ≠ 2 * lambda) (hpq : f p = f q) : p = q := by |
| 36 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 2) : M → Type _) := |
| 37 | ⟨g.toRiemannianMetric⟩ |
| 38 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin 2)) |
| 39 | (TangentSpace (𝓡 2) : M → Type _) := |
| 40 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ => rfl⟩⟩ |
| 41 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 2) M |
| 42 | by_contra hne |
| 43 | let L := (g.edist p q).toReal |
| 44 | have hL : 0 < L := ENNReal.toReal_pos (by |
| 45 | change edist p q ≠ 0 |
| 46 | exact mt edist_eq_zero.mp hne) (g.edist_ne_top p q) |
| 47 | obtain ⟨ε, hε, γ, hγ, hγ0, hγ1, hmin⟩ := |
| 48 | g.exists_minimizing_geodesic_of_metricComplete hc p q |
| 49 | have hI : Icc (0 : ℝ) 1 ⊆ Ioo (-ε) (1 + ε) := by |
| 50 | intro t ht |
| 51 | constructor <;> linarith [ht.1, ht.2] |
| 52 | have h0 := hI (show (0 : ℝ) ∈ Icc 0 1 by simp) |
| 53 | obtain ⟨C, hC⟩ := hγ.exists_constant_tangentNorm (by linarith) |
| 54 | have hv := (hγ.hasDerivAt_chart_at h0 p (by |
| 55 | simpa only [hγ0] using mem_extChartAt_source p)).1 |
| 56 | have hC0 : g.tangentNorm p (deriv (fun t => extChartAt (𝓡 2) p (γ t)) 0) = C := by |
| 57 | simpa only [RiemannianMetric.chartCoefficients_self, RiemannianMetric.tangentNorm] using |
| 58 | (hγ.tangentNorm_initial h0 hγ0 hv).symm.trans (hC 0 h0) |
| 59 | have hCL : (C : ℝ) = L := by |
| 60 | have h := hγ.initial_tangentNorm_eq_of_edist_segment hε hγ0 hv hmin |
| 61 | rw [hC0] at h |
| 62 | simpa only [ENNReal.toReal_ofReal (show 0 ≤ (C : ℝ) from C.2)] using |
| 63 | congrArg ENNReal.toReal h |
| 64 | have hspeed (t : ℝ) (ht : t ∈ Ioo (-ε) (1 + ε)) : |
| 65 | g.tangentNorm (γ t) (mfderiv 𝓘(ℝ, ℝ) (𝓡 2) γ t 1) = L := by |
| 66 | rw [← hCL] |
| 67 | exact hC t ht |
| 68 | obtain ⟨t, ht, hturn⟩ := exists_deriv_eq_zero (by norm_num : (0 : ℝ) < 1) |
| 69 | (hf.continuous.comp_continuousOn (hγ.contMDiffOn.continuousOn.mono hI)) |
| 70 | (by simpa only [Function.comp_apply, hγ0, hγ1] using hpq) |
| 71 | apply D.deriv_potential_ne_zero_inside_minimizing hf hsol hε hL hγ hspeed |
| 72 | (by rw [hγ0, hγ1]; exact (ENNReal.ofReal_toReal (g.edist_ne_top p q)).symm) |
| 73 | (by rw [hγ0]; exact hcrit) (by simpa only [hγ0] using hR) ht hturn |
| 74 | |
| 75 | /-- Every critical level of a nonround complete shrinking surface is a |
| 76 | singleton. -/ |
| 77 | theorem eq_of_potential_eq_at_critical_point_of_not_round (D : LeviCivitaData g) |
| 78 | (hc : MetricComplete g) {f : M → ℝ} {lambda : ℝ} (hlambda : 0 < lambda) |
| 79 | (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) 2 f) |
| 80 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 81 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) |
| 82 | (hnot : ¬ ConstantPositiveSectionalCurvature g D) |
| 83 | {p q : M} (hcrit : D.gradient f p = 0) (hpq : f p = f q) : p = q := by |
| 84 | apply D.eq_of_potential_eq_at_nondegenerate_critical_point hc hf hsol hcrit _ hpq |
| 85 | intro hR |
| 86 | exact hnot (D.round_of_degenerate_critical_point hlambda hf hsol hcrit hR) |
| 87 | |
| 88 | end PoincareMT.LeviCivitaData |