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.Flow.Regularity.Euclidean |
| 2 | import PoincareLib.Geometry.RicciFlow.Soliton.TwoDimensional.Compact.Regularity.Pullback |
| 3 | import PoincareLib.Geometry.RicciFlow.Limit.RicciConvergence |
| 4 | import PoincareLib.Geometry.Riemannian.Metric.LocalExtension |
| 5 | import PoincareLib.Geometry.Riemannian.Coordinates.Coefficients |
| 6 | |
| 7 | /-! |
| 8 | # Smoothness of a shrinking soliton potential |
| 9 | |
| 10 | The frozen soliton equation identifies the Hessian of the C2 potential with |
| 11 | one half of the smooth metric minus its smooth Ricci tensor. Local metric |
| 12 | realization and the coordinate bootstrap therefore make the potential smooth |
| 13 | without additional hypotheses. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | set_option maxSynthPendingDepth 8 |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | open Set Filter |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.GradientShrinkingSolitonData |
| 26 | |
| 27 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 28 | normedSpaceTangentSpaceVectorSpace |
| 29 | |
| 30 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 32 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 33 | [SecondCountableTopology M] [ConnectedSpace M] |
| 34 | |
| 35 | /-- The original C2 shrinking soliton potential is smooth. -/ |
| 36 | theorem potential_contMDiff (S : GradientShrinkingSolitonData n M) : |
| 37 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ S.potential := by |
| 38 | intro p |
| 39 | let c := extChartAt (𝓡 n) p |
| 40 | have hc : IsOpen c.target := isOpen_extChartAt_target p |
| 41 | have hpc : c p ∈ c.target := mem_extChartAt_target p |
| 42 | have hcs : ContMDiffOn (𝓡 n) (𝓡 n) ∞ c.symm c.target := |
| 43 | contMDiffOn_extChartAt_symm p |
| 44 | have hcinv (y : EuclideanSpace ℝ (Fin n)) (hy : y ∈ c.target) : |
| 45 | (mfderiv (𝓡 n) (𝓡 n) c.symm y).IsInvertible := by |
| 46 | simpa only [ModelWithCorners.range_eq_univ, mfderivWithin_univ] using |
| 47 | (isInvertible_mfderivWithin_extChartAt_symm (I := 𝓡 n) (x := p) hy) |
| 48 | have hpos : ∀ y ∈ c.target, ∀ v : EuclideanSpace ℝ (Fin n), v ≠ 0 → |
| 49 | 0 < S.metric.pullbackCoefficients c.symm y v v := by |
| 50 | intro y hy v hv |
| 51 | change 0 < S.metric.inner (c.symm y) |
| 52 | (mfderiv (𝓡 n) (𝓡 n) c.symm y v) (mfderiv (𝓡 n) (𝓡 n) c.symm y v) |
| 53 | apply S.metric.pos |
| 54 | intro hz |
| 55 | exact hv ((hcinv y hy).injective (by simpa using hz)) |
| 56 | obtain ⟨gE, DE, V, hV, hpV, hVc, hmetric⟩ := RiemannianMetric.exists_local_realization |
| 57 | hc hpc (S.metric.pullbackCoefficients c.symm) (S.metric.contDiffOn_chartCoefficients p) |
| 58 | (fun y _ v w => S.metric.symm (c.symm y) _ _) hpos |
| 59 | have hfcomp : ContDiffOn ℝ 2 (S.potential ∘ c.symm) V := by |
| 60 | intro y hy |
| 61 | exact ((S.potential_C2 (c.symm y)).comp y |
| 62 | ((hcs.contMDiffAt (hc.mem_nhds (hVc hy))).of_le |
| 63 | (by norm_cast : (2 : ℕ∞ω) ≤ ∞))).contDiffAt.contDiffWithinAt |
| 64 | have heq (y : EuclideanSpace ℝ (Fin n)) (hy : y ∈ V) |
| 65 | (v w : TangentSpace (𝓡 n) y) : |
| 66 | gE.inner y v w = S.metric.inner (c.symm y) |
| 67 | (mfderiv (𝓡 n) (𝓡 n) c.symm y v) (mfderiv (𝓡 n) (𝓡 n) c.symm y w) := by |
| 68 | change gE.euclideanCoefficients y v w = _ |
| 69 | rw [hmetric y hy] |
| 70 | rfl |
| 71 | have hesscomp (y : EuclideanSpace ℝ (Fin n)) (hy : y ∈ V) |
| 72 | (v w : EuclideanSpace ℝ (Fin n)) : |
| 73 | DE.hessian (S.potential ∘ c.symm) y v w = |
| 74 | (1 / 2 : ℝ) * gE.inner y v w - DE.ricci y v w := by |
| 75 | have hnat := DE.hessian_comp_of_metric_pullback_of_C2 S.connection |
| 76 | (hcs.contMDiffAt (hc.mem_nhds (hVc hy))) |
| 77 | (Filter.eventually_of_mem (hV.mem_nhds hy) fun z hz => hcinv z (hVc hz)) |
| 78 | (Filter.eventually_of_mem (hV.mem_nhds hy) fun z hz => heq z hz) |
| 79 | (S.potential_C2 (c.symm y)) v w |
| 80 | have hric := DE.ricci_eq_pullback_euclidean S.connection |
| 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) v w |
| 84 | rw [hnat, hric, heq y hy v w] |
| 85 | linarith [S.soliton_equation (c.symm y) |
| 86 | (mfderiv (𝓡 n) (𝓡 n) c.symm y v) (mfderiv (𝓡 n) (𝓡 n) c.symm y w)] |
| 87 | have hh : ∀ v w : EuclideanSpace ℝ (Fin n), |
| 88 | ContDiffOn ℝ ∞ (fun y => DE.hessian (S.potential ∘ c.symm) y v w) V := by |
| 89 | intro v w |
| 90 | have hg : ContDiff ℝ ∞ (fun y => gE.euclideanCoefficients y v w) := |
| 91 | ((contDiff_iff_contDiffAt.mpr gE.contDiffAt_euclideanCoefficients).clm_apply |
| 92 | contDiff_const).clm_apply contDiff_const |
| 93 | have h : ContDiff ℝ ∞ |
| 94 | (fun y => (1 / 2 : ℝ) * gE.euclideanCoefficients y v w - DE.ricci y v w) := |
| 95 | (contDiff_const.mul hg).sub (DE.contDiff_ricci_const v w) |
| 96 | exact h.contDiffOn.congr (fun y hy => hesscomp y hy v w) |
| 97 | have hs := DE.contDiffOn_of_C2_hessian_smooth hV hfcomp hh |
| 98 | rw [contMDiffAt_iff_source] |
| 99 | simpa only [ModelWithCorners.range_eq_univ, contMDiffWithinAt_univ] using |
| 100 | (hs.contDiffAt (hV.mem_nhds hpV)).contMDiffAt |
| 101 | |
| 102 | end PoincareMT.GradientShrinkingSolitonData |