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.Differential |
| 2 | import PoincareLib.Geometry.Manifold.ContDiff.Constancy |
| 3 | |
| 4 | /-! |
| 5 | # Conserved scalar quantities of surface gradient solitons |
| 6 | |
| 7 | The differential identities integrate to constants on a preconnected surface. |
| 8 | The scale is arbitrary; positivity and completeness enter only when these |
| 9 | identities are used in the classification argument. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | open Bundle |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.LeviCivitaData |
| 21 | |
| 22 | variable {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 24 | [PreconnectedSpace M] {g : RiemannianMetric 2 M} |
| 25 | |
| 26 | /-- Scalar curvature times the inverse potential weight is constant. -/ |
| 27 | theorem exists_scalar_conservation_of_surface_soliton (D : LeviCivitaData g) |
| 28 | {f : M → ℝ} {lambda : ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) 2 f) |
| 29 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 30 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) : |
| 31 | ∃ A : ℝ, ∀ x, D.scalarCurvature x * Real.exp (-f x) = A := by |
| 32 | have hfs := D.contMDiff_of_C2_surface_soliton hf hsol |
| 33 | have hcont : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ |
| 34 | (fun x => D.scalarCurvature x * Real.exp (-f x)) := |
| 35 | D.contMDiff_scalarCurvature.mul (Real.contDiff_exp.contMDiff.comp hfs.neg) |
| 36 | exact Poincare.Manifold.exists_eq_const_of_mvfderiv_eq_zero |
| 37 | (fun x => (hcont x).mdifferentiableAt (by simp)) |
| 38 | (D.mvfderiv_weighted_scalar_of_surface_soliton hf hsol) |
| 39 | |
| 40 | /-- Hamilton's scalar identity holds globally at any constant soliton scale. -/ |
| 41 | theorem exists_hamilton_conservation_of_surface_soliton (D : LeviCivitaData g) |
| 42 | {f : M → ℝ} {lambda : ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) 2 f) |
| 43 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 44 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) : |
| 45 | ∃ C : ℝ, ∀ x, D.scalarCurvature x + |
| 46 | g.inner x (D.gradient f x) (D.gradient f x) - 2 * lambda * f x = C := by |
| 47 | have hfs := D.contMDiff_of_C2_surface_soliton hf hsol |
| 48 | have hnorm : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ |
| 49 | (fun x => g.inner x (D.gradient f x) (D.gradient f x)) := by |
| 50 | intro x |
| 51 | have hgrad := D.contMDiffAt_gradient (hfs x) |
| 52 | simpa using (contMDiffAt_totalSpace.mp |
| 53 | (((g.contMDiff x).clm_bundle_apply hgrad).clm_bundle_apply hgrad)).2 |
| 54 | have hcont : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ |
| 55 | (fun x => D.scalarCurvature x + |
| 56 | g.inner x (D.gradient f x) (D.gradient f x) - 2 * lambda * f x) := |
| 57 | (D.contMDiff_scalarCurvature.add hnorm).sub (contMDiff_const.mul hfs) |
| 58 | exact Poincare.Manifold.exists_eq_const_of_mvfderiv_eq_zero |
| 59 | (fun x => (hcont x).mdifferentiableAt (by simp)) |
| 60 | (D.mvfderiv_hamilton_of_surface_soliton hf hsol) |
| 61 | |
| 62 | /-- The two conservation constants needed for complete surface compactness. -/ |
| 63 | theorem exists_conservation_constants_of_surface_soliton (D : LeviCivitaData g) |
| 64 | {f : M → ℝ} {lambda : ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) 2 f) |
| 65 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 66 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) : |
| 67 | ∃ A C : ℝ, (∀ x, D.scalarCurvature x * Real.exp (-f x) = A) ∧ |
| 68 | (∀ x, D.scalarCurvature x + |
| 69 | g.inner x (D.gradient f x) (D.gradient f x) - 2 * lambda * f x = C) := by |
| 70 | obtain ⟨A, hA⟩ := D.exists_scalar_conservation_of_surface_soliton hf hsol |
| 71 | obtain ⟨C, hC⟩ := D.exists_hamilton_conservation_of_surface_soliton hf hsol |
| 72 | exact ⟨A, C, hA, hC⟩ |
| 73 | |
| 74 | end PoincareMT.LeviCivitaData |