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.Regularity.Euclidean |
| 2 | import PoincareLib.Geometry.RicciFlow.Soliton.TwoDimensional.Compact.Regularity.Pullback |
| 3 | import PoincareLib.Geometry.Riemannian.Metric.LocalExtension |
| 4 | import PoincareLib.Geometry.Riemannian.Coordinates.Coefficients |
| 5 | import PoincareLib.Geometry.Riemannian.Surface.Regularity |
| 6 | |
| 7 | /-! |
| 8 | # Smoothness of a shrinking surface potential |
| 9 | |
| 10 | The frozen potential starts with two derivatives. Its pure-trace Hessian has |
| 11 | smooth coefficients, so local metric realization and the coordinate |
| 12 | bootstrap prove smoothness of the original potential. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | set_option maxSynthPendingDepth 8 |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | open Set Filter |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.LeviCivitaData |
| 25 | |
| 26 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 27 | normedSpaceTangentSpaceVectorSpace |
| 28 | |
| 29 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 31 | {g : RiemannianMetric n M} |
| 32 | |
| 33 | /-- A C2 function with a smooth pure-trace Hessian is smooth. -/ |
| 34 | theorem contMDiff_of_C2_hessian_eq_smooth_mul_metric (D : LeviCivitaData g) |
| 35 | {f a : M → ℝ} (hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) 2 f) |
| 36 | (ha : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ a) |
| 37 | (hess : ∀ x, ∀ v w : TangentSpace (𝓡 n) x, |
| 38 | D.hessian f x v w = a x * g.inner x v w) : |
| 39 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f := by |
| 40 | intro p |
| 41 | let c := extChartAt (𝓡 n) p |
| 42 | have hc : IsOpen c.target := isOpen_extChartAt_target p |
| 43 | have hpc : c p ∈ c.target := mem_extChartAt_target p |
| 44 | have hcs : ContMDiffOn (𝓡 n) (𝓡 n) ∞ c.symm c.target := |
| 45 | contMDiffOn_extChartAt_symm p |
| 46 | have hcinv (y : EuclideanSpace ℝ (Fin n)) (hy : y ∈ c.target) : |
| 47 | (mfderiv (𝓡 n) (𝓡 n) c.symm y).IsInvertible := by |
| 48 | simpa only [ModelWithCorners.range_eq_univ, mfderivWithin_univ] using |
| 49 | (isInvertible_mfderivWithin_extChartAt_symm (I := 𝓡 n) (x := p) hy) |
| 50 | have hpos : ∀ y ∈ c.target, ∀ v : EuclideanSpace ℝ (Fin n), v ≠ 0 → |
| 51 | 0 < g.pullbackCoefficients c.symm y v v := by |
| 52 | intro y hy v hv |
| 53 | change 0 < g.inner (c.symm y) |
| 54 | (mfderiv (𝓡 n) (𝓡 n) c.symm y v) (mfderiv (𝓡 n) (𝓡 n) c.symm y v) |
| 55 | apply g.pos |
| 56 | intro hz |
| 57 | exact hv ((hcinv y hy).injective (by simpa using hz)) |
| 58 | obtain ⟨gE, DE, V, hV, hpV, hVc, hmetric⟩ := RiemannianMetric.exists_local_realization hc hpc |
| 59 | (g.pullbackCoefficients c.symm) (g.contDiffOn_chartCoefficients p) |
| 60 | (fun y _ v w => g.symm (c.symm y) _ _) hpos |
| 61 | have hfcomp : ContDiffOn ℝ 2 (f ∘ c.symm) V := by |
| 62 | intro y hy |
| 63 | exact ((hf (c.symm y)).comp y |
| 64 | ((hcs.contMDiffAt (hc.mem_nhds (hVc hy))).of_le |
| 65 | (by norm_cast : (2 : ℕ∞ω) ≤ ∞))).contDiffAt.contDiffWithinAt |
| 66 | have hacomp : ContDiffOn ℝ ∞ (a ∘ c.symm) V := by |
| 67 | intro y hy |
| 68 | exact ((ha (c.symm y)).comp y |
| 69 | (hcs.contMDiffAt (hc.mem_nhds (hVc hy)))).contDiffAt.contDiffWithinAt |
| 70 | have heq (y : EuclideanSpace ℝ (Fin n)) (hy : y ∈ V) |
| 71 | (v w : TangentSpace (𝓡 n) y) : |
| 72 | gE.inner y v w = g.inner (c.symm y) |
| 73 | (mfderiv (𝓡 n) (𝓡 n) c.symm y v) (mfderiv (𝓡 n) (𝓡 n) c.symm y w) := by |
| 74 | change gE.euclideanCoefficients y v w = _ |
| 75 | rw [hmetric y hy] |
| 76 | rfl |
| 77 | have hesscomp : ∀ y ∈ V, ∀ v w, |
| 78 | DE.hessian (f ∘ c.symm) y v w = (a ∘ c.symm) y * gE.inner y v w := by |
| 79 | intro y hy v w |
| 80 | have hnat := DE.hessian_comp_of_metric_pullback_of_C2 D |
| 81 | (hcs.contMDiffAt (hc.mem_nhds (hVc hy))) |
| 82 | (Filter.eventually_of_mem (hV.mem_nhds hy) fun z hz => hcinv z (hVc hz)) |
| 83 | (Filter.eventually_of_mem (hV.mem_nhds hy) fun z hz => heq z hz) |
| 84 | (hf (c.symm y)) v w |
| 85 | rw [hnat, hess, ← heq y hy v w] |
| 86 | rfl |
| 87 | have hs := DE.contDiffOn_of_C2_hessian_eq_smooth_mul_metric hV hfcomp hacomp hesscomp |
| 88 | rw [contMDiffAt_iff_source] |
| 89 | simpa only [ModelWithCorners.range_eq_univ, contMDiffWithinAt_univ] using |
| 90 | (hs.contDiffAt (hV.mem_nhds hpV)).contMDiffAt |
| 91 | |
| 92 | end PoincareMT.LeviCivitaData |
| 93 | |
| 94 | namespace PoincareMT.GradientShrinkingSolitonData |
| 95 | |
| 96 | variable {M : Type u} [TopologicalSpace M] |
| 97 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 98 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 99 | [SecondCountableTopology M] [ConnectedSpace M] |
| 100 | |
| 101 | /-- The twice differentiable potential of a shrinking surface is smooth. -/ |
| 102 | theorem potential_smooth (S : GradientShrinkingSolitonData 2 M) : |
| 103 | ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ S.potential := by |
| 104 | apply S.connection.contMDiff_of_C2_hessian_eq_smooth_mul_metric S.potential_C2 |
| 105 | (a := fun x => (1 - S.connection.scalarCurvature x) / 2) |
| 106 | · exact (contMDiff_const.sub S.connection.contMDiff_scalarCurvature).div_const 2 |
| 107 | · exact S.hessian_potential_eq_scalar |
| 108 | |
| 109 | end PoincareMT.GradientShrinkingSolitonData |