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.Surface.Curvature |
| 3 | |
| 4 | /-! |
| 5 | # Curvature identities for a shrinking surface soliton |
| 6 | |
| 7 | The two-dimensional curvature contraction makes the Hessian of the soliton |
| 8 | potential pure trace. These identities enter compact shrinking-surface |
| 9 | rigidity, as in Chow--Knopf, Proposition 5.21, p. 118, cited by Morgan--Tian |
| 10 | in the proof of Corollary 9.50, pp. 213-214. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle BigOperators |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT |
| 21 | |
| 22 | variable {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 24 | |
| 25 | namespace LeviCivitaData |
| 26 | |
| 27 | /-- On a surface, the Ricci tensor is half the scalar curvature times the metric. -/ |
| 28 | theorem ricci_eq_half_scalarCurvature_mul_inner {g : RiemannianMetric 2 M} |
| 29 | (D : LeviCivitaData g) (x : M) (u v : TangentSpace (𝓡 2) x) : |
| 30 | D.ricci x u v = D.scalarCurvature x / 2 * g.inner x u v := by |
| 31 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 2) : M → Type _) := |
| 32 | ⟨g.toRiemannianMetric⟩ |
| 33 | let b := g.orthonormalBasis x |
| 34 | have hd : Module.finrank ℝ (TangentSpace (𝓡 2) x) = 2 := by |
| 35 | rw [VectorBundle.finrank_eq ℝ (EuclideanSpace ℝ (Fin 2)), finrank_euclideanSpace] |
| 36 | simp |
| 37 | have hnorm (i) : g.inner x (b i) (b i) = 1 := b.inner_eq_ite i i |>.trans (if_pos rfl) |
| 38 | have hparseval : (∑ i, g.inner x u (b i) * g.inner x (b i) v) = g.inner x u v := |
| 39 | b.sum_inner_mul_inner u v |
| 40 | dsimp only [b] at hnorm hparseval |
| 41 | unfold ricci |
| 42 | simp_rw [D.curvatureTensor_eq_half_scalarCurvature, hnorm, mul_one] |
| 43 | rw [← Finset.mul_sum, Finset.sum_sub_distrib, hparseval] |
| 44 | simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, hd, nsmul_eq_mul] |
| 45 | ring |
| 46 | |
| 47 | end LeviCivitaData |
| 48 | |
| 49 | namespace GradientShrinkingSolitonData |
| 50 | |
| 51 | variable [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 52 | [SecondCountableTopology M] [ConnectedSpace M] |
| 53 | |
| 54 | /-- The soliton potential has a pure-trace Hessian in dimension two. -/ |
| 55 | theorem hessian_potential_eq_scalar (S : GradientShrinkingSolitonData 2 M) |
| 56 | (x : M) (u v : TangentSpace (𝓡 2) x) : |
| 57 | S.connection.hessian S.potential x u v = |
| 58 | (1 - S.connection.scalarCurvature x) / 2 * S.metric.inner x u v := by |
| 59 | have h := S.soliton_equation x u v |
| 60 | rw [S.connection.ricci_eq_half_scalarCurvature_mul_inner] at h |
| 61 | linarith |
| 62 | |
| 63 | /-- Tracing the normalized shrinking equation gives `R + Δf = 1` on a surface. -/ |
| 64 | theorem scalarCurvature_add_laplacian_potential (S : GradientShrinkingSolitonData 2 M) |
| 65 | (x : M) : S.connection.scalarCurvature x + S.connection.laplacian S.potential x = 1 := by |
| 66 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 2) : M → Type _) := |
| 67 | ⟨S.metric.toRiemannianMetric⟩ |
| 68 | let b := S.metric.orthonormalBasis x |
| 69 | have hd : Module.finrank ℝ (TangentSpace (𝓡 2) x) = 2 := by |
| 70 | rw [VectorBundle.finrank_eq ℝ (EuclideanSpace ℝ (Fin 2)), finrank_euclideanSpace] |
| 71 | simp |
| 72 | have hnorm (i) : S.metric.inner x (b i) (b i) = 1 := |
| 73 | b.inner_eq_ite i i |>.trans (if_pos rfl) |
| 74 | dsimp only [b] at hnorm |
| 75 | unfold LeviCivitaData.laplacian |
| 76 | simp_rw [S.hessian_potential_eq_scalar, hnorm, mul_one] |
| 77 | simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, hd, nsmul_eq_mul] |
| 78 | ring |
| 79 | |
| 80 | end GradientShrinkingSolitonData |
| 81 | |
| 82 | end PoincareMT |