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.Generalized.ReducedGeometry.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.SourceNames.ReducedLength |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Euler.InteriorConnection |
| 4 | |
| 5 | /-! |
| 6 | # The actual scalar potential in the open coordinate linearization |
| 7 | |
| 8 | Morgan-Tian equation (6.2), Lemma 6.10 and Lemma 6.19, |
| 9 | pp. 106, 109-110, 114. The actual potential is 2s^2 times the |
| 10 | actual scalar curvature. Its spatial derivatives and the genuine |
| 11 | closed connection identify the corrected open Jacobi potential. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | {J : Set ℝ} (F : RicciFlow n M J) (T : ℝ) (x : M) |
| 26 | |
| 27 | /-- The actual scalar curvature in the same extended chart as M08's |
| 28 | action metric, the scalar term of equation (6.2), p. 106. -/ |
| 29 | noncomputable def chartActionScalar (z : ℝ × EuclideanSpace ℝ (Fin n)) : ℝ := |
| 30 | (F.connection (T - z.1 ^ 2)).scalarCurvature ((extChartAt (𝓡 n) x).symm z.2) |
| 31 | |
| 32 | /-- The actual scalar coordinate is smooth on every admissible closed |
| 33 | time-chart product, the coefficient regularity in Lemmas 6.10 and |
| 34 | 6.19, pp. 109-110, 114. -/ |
| 35 | theorem chartActionScalar_contDiffOn |
| 36 | (hM04 : RicciFlowCurvatureTheory.{u}) {C : Set ℝ} |
| 37 | (htime : ∀ s ∈ C, T - s ^ 2 ∈ J) : |
| 38 | ContDiffOn ℝ ∞ (chartActionScalar F T x) (C ×ˢ (extChartAt (𝓡 n) x).target) := by |
| 39 | have ht : ContMDiffOn (𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n))) (𝓘(ℝ, ℝ)) ∞ |
| 40 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => T - z.1 ^ 2) |
| 41 | (C ×ˢ (extChartAt (𝓡 n) x).target) := |
| 42 | (contDiff_const.sub (contDiff_fst.pow 2)).contMDiff.contMDiffOn |
| 43 | have hq : ContMDiffOn (𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n))) (𝓡 n) ∞ |
| 44 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => (extChartAt (𝓡 n) x).symm z.2) |
| 45 | (C ×ˢ (extChartAt (𝓡 n) x).target) := |
| 46 | (contMDiffOn_extChartAt_symm (I := 𝓡 n) x).comp |
| 47 | contDiff_snd.contMDiff.contMDiffOn (fun _ hz => hz.2) |
| 48 | exact ((hM04.scalar_regular n M J F).comp (ht.prodMk hq) |
| 49 | (fun z hz => ⟨htime z.1 hz.1, mem_univ _⟩)).contDiffOn |
| 50 | |
| 51 | /-- At an interior time, the first spatial derivative of the actual |
| 52 | potential is 2s^2 times the actual scalar spatial derivative, |
| 53 | equation (6.2), p. 106, and Lemma 6.10, pp. 109-110. -/ |
| 54 | theorem chartActionPotential_spatialWithin_eq |
| 55 | (hM04 : RicciFlowCurvatureTheory.{u}) {C : Set ℝ} |
| 56 | (htime : ∀ r ∈ C, T - r ^ 2 ∈ J) {s : ℝ} (hs : s ∈ C) (hnear : C ∈ 𝓝 s) |
| 57 | {q : EuclideanSpace ℝ (Fin n)} (hq : q ∈ (extChartAt (𝓡 n) x).target) : |
| 58 | M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 59 | (M08.chartActionPotential F T x) (s, q) = |
| 60 | (2 * s ^ 2) • M08.spatialFDeriv (chartActionScalar F T x) (s, q) := by |
| 61 | have hU := isOpen_extChartAt_target (I := 𝓡 n) x |
| 62 | have hR := M08.hasFDerivAt_spatialWithin hU (chartActionScalar F T x) |
| 63 | (chartActionScalar_contDiffOn F T x hM04 htime) hs hq |
| 64 | have hP := M08.hasFDerivAt_spatialWithin hU (M08.chartActionPotential F T x) |
| 65 | (M08.chartActionPotential_closed_contDiffOn F hM04 T x htime) hs hq |
| 66 | have hscaled : HasFDerivAt (fun y => M08.chartActionPotential F T x (s, y)) |
| 67 | ((2 * s ^ 2) • M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 68 | (chartActionScalar F T x) (s, q)) q := hR.const_smul (2 * s ^ 2) |
| 69 | rw [hP.unique hscaled, M08.spatialWithinFDeriv_eq_spatialFDeriv hU _ hnear hq] |
| 70 | |
| 71 | /-- The second spatial derivative retains the same factor 2s^2 and |
| 72 | the actual derivative of the scalar spatial differential, as used |
| 73 | in the Hessian term of Lemma 6.10, pp. 109-110. -/ |
| 74 | theorem chartActionPotential_spatialWithin_twice_eq |
| 75 | (hM04 : RicciFlowCurvatureTheory.{u}) {C : Set ℝ} (hC : UniqueDiffOn ℝ C) |
| 76 | (htime : ∀ r ∈ C, T - r ^ 2 ∈ J) {s : ℝ} (hs : s ∈ C) (hnear : C ∈ 𝓝 s) |
| 77 | {q : EuclideanSpace ℝ (Fin n)} (hq : q ∈ (extChartAt (𝓡 n) x).target) : |
| 78 | M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 79 | (M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 80 | (M08.chartActionPotential F T x)) (s, q) = |
| 81 | (2 * s ^ 2) • fderiv ℝ (fun y => M08.spatialFDeriv (chartActionScalar F T x) (s, y)) q := by |
| 82 | have hU := isOpen_extChartAt_target (I := 𝓡 n) x |
| 83 | have hR := (chartActionScalar_contDiffOn F T x hM04 htime).contDiffAt |
| 84 | (prod_mem_nhds hnear (hU.mem_nhds hq)) |
| 85 | have hD : ContDiffAt ℝ ∞ |
| 86 | (fun y => M08.spatialFDeriv (chartActionScalar F T x) (s, y)) q := |
| 87 | ((hR.fderiv_right (m := ∞) (by simp)).comp q |
| 88 | (contDiffAt_const.prodMk contDiffAt_id)).clm_comp contDiffAt_const |
| 89 | have hP := M08.hasFDerivAt_spatialWithin hU |
| 90 | (M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target (M08.chartActionPotential F T x)) |
| 91 | (M08.spatialWithinFDeriv_contDiffOn hC hU _ |
| 92 | (M08.chartActionPotential_closed_contDiffOn F hM04 T x htime)) hs hq |
| 93 | have heq : (fun y => M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 94 | (M08.chartActionPotential F T x) (s, y)) =ᶠ[𝓝 q] |
| 95 | fun y => (2 * s ^ 2) • M08.spatialFDeriv (chartActionScalar F T x) (s, y) := by |
| 96 | filter_upwards [hU.mem_nhds hq] with y hy |
| 97 | exact chartActionPotential_spatialWithin_eq F T x hM04 htime hs hnear hy |
| 98 | exact hP.unique (((hD.differentiableAt (by simp)).hasFDerivAt.const_smul |
| 99 | (2 * s ^ 2)).congr_of_eventuallyEq heq) |
| 100 | |
| 101 | /-- The frozen closed Jacobi potential is exactly the open-coordinate |
| 102 | potential of the actual metric and scalar term at every interior |
| 103 | time-chart point, Lemmas 6.10 and 6.19, pp. 109-110, 114. -/ |
| 104 | theorem closedChartJacobiPotential_eq_open |
| 105 | (hM04 : RicciFlowCurvatureTheory.{u}) {C : Set ℝ} (hC : UniqueDiffOn ℝ C) |
| 106 | (htime : ∀ r ∈ C, T - r ^ 2 ∈ J) {s : ℝ} (hs : s ∈ C) (hnear : C ∈ 𝓝 s) |
| 107 | {q : EuclideanSpace ℝ (Fin n)} (hq : q ∈ (extChartAt (𝓡 n) x).target) |
| 108 | (A : EuclideanSpace ℝ (Fin n)) : |
| 109 | let Γ := Proofs.M09.coordinateConnectionBilinear (M08.chartActionMetric F T x) |
| 110 | let P := fun y => M08.spatialFDeriv (chartActionScalar F T x) (s, y) |
| 111 | M08.closedChartJacobiPotential F T x C (s, q) A = |
| 112 | M08.weightedChartPotential (M08.chartActionMetric F T x (s, q)) (Γ (s, q)) |
| 113 | ((fderiv ℝ Γ (s, q)).comp (ContinuousLinearMap.inr ℝ ℝ (EuclideanSpace ℝ (Fin n)))) |
| 114 | (fderiv ℝ Γ (s, q) (1, 0)) ((2 * s ^ 2) • P q) |
| 115 | ((2 * s ^ 2) • fderiv ℝ P q) A := by |
| 116 | dsimp only |
| 117 | unfold M08.closedChartJacobiPotential |
| 118 | rw [closedChartConnection_eq_open F T x hnear hq, |
| 119 | chartActionPotential_spatialWithin_eq F T x hM04 htime hs hnear hq, |
| 120 | chartActionPotential_spatialWithin_twice_eq F T x hM04 hC htime hs hnear hq] |
| 121 | unfold M08.spatialWithinFDeriv M08.timeWithinFDeriv |
| 122 | rw [closedChartConnection_fderivWithin_eq_open F T x hnear hq] |
| 123 | |
| 124 | end PoincareMT.M14 |