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.CurveShortening.Comparison.IntrinsicComparison.Normal.Regularity |
| 2 | import PoincareLib.Geometry.Riemannian.Connection.Variation.Coordinates |
| 3 | |
| 4 | /-! |
| 5 | # The Jacobi equation of the constructed normal variation |
| 6 | |
| 7 | The actual phase ODE gives a vanishing covariant acceleration. Commuting |
| 8 | its derivatives then gives the Jacobi equation for the derivative in the |
| 9 | boundary parameter. Source: Morgan--Tian, Claim 19.37, pp. 468-469. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Topology Manifold ContDiff Bundle |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | open ConnectionVariation CoordinateExponential |
| 22 | |
| 23 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 24 | normedSpaceTangentSpaceVectorSpace |
| 25 | |
| 26 | /-- The phase velocity is the time partial of the constructed position. Source/construction: |
| 27 | Morgan--Tian Claim 19.37, printed pp. 468-469. -/ |
| 28 | theorem m64Intrinsic_phase_time_partial |
| 29 | (N : IntrinsicAnnulus) |
| 30 | {phase : ℝ × ℝ → AnnulusCoordinates × AnnulusCoordinates} {z : ℝ × ℝ} |
| 31 | (hsmooth : DifferentiableAt ℝ phase z) |
| 32 | (hode : HasDerivAt (fun t => phase (z.1, t)) |
| 33 | (coordinateGeodesicField N.metric.euclideanCoefficients (phase z)) z.2) : |
| 34 | fderiv ℝ (fun p => (phase p).1) z (0, 1) = (phase z).2 ∧ |
| 35 | fderiv ℝ (fun p => (phase p).2) z (0, 1) = |
| 36 | -coordinateChristoffel N.metric.euclideanCoefficients |
| 37 | (phase z).1 (phase z).2 (phase z).2 := by |
| 38 | have hfirst := hsmooth.fst.hasFDerivAt.comp_hasDerivAt |
| 39 | (l := fun p => (phase p).1) (f := fun t => (z.1, t)) z.2 |
| 40 | ((hasDerivAt_const z.2 z.1).prodMk (hasDerivAt_id z.2)) |
| 41 | have hsecond := hsmooth.snd.hasFDerivAt.comp_hasDerivAt |
| 42 | (l := fun p => (phase p).2) (f := fun t => (z.1, t)) z.2 |
| 43 | ((hasDerivAt_const z.2 z.1).prodMk (hasDerivAt_id z.2)) |
| 44 | have hposition : HasDerivAt (fun t => (phase (z.1, t)).1) (phase z).2 z.2 := by |
| 45 | simpa [coordinateGeodesicField] using hode.hasFDerivAt.fst.hasDerivAt |
| 46 | have hvelocity : HasDerivAt (fun t => (phase (z.1, t)).2) |
| 47 | (-coordinateChristoffel N.metric.euclideanCoefficients |
| 48 | (phase z).1 (phase z).2 (phase z).2) z.2 := by |
| 49 | simpa [coordinateGeodesicField] using hode.hasFDerivAt.snd.hasDerivAt |
| 50 | exact ⟨hfirst.unique hposition, hsecond.unique hvelocity⟩ |
| 51 | |
| 52 | /-- The variation in the boundary parameter satisfies the Jacobi equation as a consequence |
| 53 | of the actual smooth geodesic phase ODE. Source/construction: Morgan--Tian Claim 19.37, |
| 54 | printed pp. 468-469. -/ |
| 55 | theorem m64Intrinsic_normal_variation_jacobi |
| 56 | (N : IntrinsicAnnulus) |
| 57 | {phase : ℝ × ℝ → AnnulusCoordinates × AnnulusCoordinates} |
| 58 | {Omega : Set (ℝ × ℝ)} (hOmega : IsOpen Omega) |
| 59 | (hsmooth : ContDiffOn ℝ ∞ phase Omega) |
| 60 | (hode : ∀ z ∈ Omega, HasDerivAt (fun t => phase (z.1, t)) |
| 61 | (coordinateGeodesicField N.metric.euclideanCoefficients (phase z)) z.2) |
| 62 | {z : ℝ × ℝ} (hz : z ∈ Omega) : |
| 63 | let F : ℝ × ℝ → AnnulusCoordinates := fun p => (phase p).1 |
| 64 | let Gamma := christoffelBilinear N.metric.euclideanCoefficients |
| 65 | let X : ℝ × ℝ → AnnulusCoordinates := fun p => fderiv ℝ F p (1, 0) |
| 66 | covDerivAlong Gamma F (covDerivAlong Gamma F X (0, 1)) (0, 1) z + |
| 67 | christoffelCurvature Gamma (F z) (X z) (phase z).2 (phase z).2 = 0 := by |
| 68 | let F : ℝ × ℝ → AnnulusCoordinates := fun p => (phase p).1 |
| 69 | let V : ℝ × ℝ → AnnulusCoordinates := fun p => (phase p).2 |
| 70 | let Gamma := christoffelBilinear N.metric.euclideanCoefficients |
| 71 | have hF : ContDiffOn ℝ ∞ F Omega := hsmooth.fst |
| 72 | have hpartial (p : ℝ × ℝ) (hp : p ∈ Omega) := |
| 73 | m64Intrinsic_phase_time_partial N |
| 74 | ((hsmooth.contDiffAt (hOmega.mem_nhds hp)).differentiableAt (by simp)) (hode p hp) |
| 75 | have haccel (p : ℝ × ℝ) (hp : p ∈ Omega) : |
| 76 | covDerivAlong Gamma F (fun q => fderiv ℝ F q (0, 1)) (0, 1) p = 0 := by |
| 77 | have hVeq : (fun q => fderiv ℝ F q (0, 1)) =ᶠ[𝓝 p] V := by |
| 78 | filter_upwards [hOmega.mem_nhds hp] with q hq |
| 79 | exact (hpartial q hq).1 |
| 80 | rw [covDerivAlong_congr Gamma F hVeq, covDerivAlong] |
| 81 | change fderiv ℝ V p (0, 1) + |
| 82 | coordinateChristoffel N.metric.euclideanCoefficients (F p) |
| 83 | (fderiv ℝ F p (0, 1)) (V p) = 0 |
| 84 | rw [(hpartial p hp).1, (hpartial p hp).2] |
| 85 | exact neg_add_cancel _ |
| 86 | have hGamma : DifferentiableAt ℝ Gamma (F z) := |
| 87 | (contDiffAt_christoffelBilinear (N.metric.contDiffAt_euclideanCoefficients (F z)) |
| 88 | (N.metric.inner_isInvertible (F z))).differentiableAt (by simp) |
| 89 | have hsymm : ∀ᶠ p in 𝓝 z, ∀ v w, Gamma (F p) v w = Gamma (F p) w v := by |
| 90 | apply Eventually.of_forall |
| 91 | intro p v w |
| 92 | exact christoffelBilinear_symm |
| 93 | ((N.metric.contDiffAt_euclideanCoefficients (F p)).differentiableAt (by simp)) |
| 94 | (Eventually.of_forall fun q x y => N.metric.symm q x y) v w |
| 95 | have hgeo : ∀ᶠ p in 𝓝 z, |
| 96 | covDerivAlong Gamma F (fun q => fderiv ℝ F q (0, 1)) (0, 1) p = 0 := by |
| 97 | filter_upwards [hOmega.mem_nhds hz] with p hp |
| 98 | exact haccel p hp |
| 99 | have h := covDerivAlong_geodesic_family_jacobi (ds := (1, 0)) (dt := (0, 1)) |
| 100 | ((hF.contDiffAt (hOmega.mem_nhds hz)).of_le |
| 101 | (WithTop.coe_le_coe.2 (show (3 : ℕ∞) ≤ (⊤ : ℕ∞) from le_top))) hGamma hsymm hgeo |
| 102 | rw [(hpartial z hz).1] at h |
| 103 | exact h |
| 104 | |
| 105 | /-- The coordinate curvature in the normal-variation equation is the actual Gaussian |
| 106 | curvature operator of the intrinsic surface. Source/construction: Morgan--Tian Claim 19.37, |
| 107 | printed pp. 468-469. -/ |
| 108 | theorem m64Intrinsic_christoffel_curvature_pairing |
| 109 | (N : IntrinsicAnnulus) (p X T W : AnnulusCoordinates) : |
| 110 | N.metric.inner p |
| 111 | (christoffelCurvature (christoffelBilinear N.metric.euclideanCoefficients) p X T T) W = |
| 112 | N.connection.scalarCurvature p / 2 * |
| 113 | (N.metric.inner p X W * N.metric.inner p T T - |
| 114 | N.metric.inner p X T * N.metric.inner p T W) := by |
| 115 | have hGamma : DifferentiableAt ℝ (christoffelBilinear N.metric.euclideanCoefficients) p := |
| 116 | (contDiffAt_christoffelBilinear (N.metric.contDiffAt_euclideanCoefficients p) |
| 117 | (N.metric.inner_isInvertible p)).differentiableAt (by simp) |
| 118 | rw [← coordinateCurvature_eq_christoffelCurvature hGamma X T T, |
| 119 | coordinateCurvature_eq_retained N.connection] |
| 120 | change N.connection.curvatureTensor p X T W T = _ |
| 121 | exact N.connection.curvatureTensor_eq_half_scalarCurvature p X T W T |
| 122 | |
| 123 | /-- Pairing the constructed Jacobi equation with any vector gives the surface equation with |
| 124 | coefficient `scalar / 2`, without a curvature-norm or lower-Ricci hypothesis. |
| 125 | Source/construction: Morgan--Tian Claim 19.37, printed pp. 468-469. -/ |
| 126 | theorem m64Intrinsic_normal_variation_gaussian_jacobi |
| 127 | (N : IntrinsicAnnulus) |
| 128 | {phase : ℝ × ℝ → AnnulusCoordinates × AnnulusCoordinates} |
| 129 | {Omega : Set (ℝ × ℝ)} (hOmega : IsOpen Omega) |
| 130 | (hsmooth : ContDiffOn ℝ ∞ phase Omega) |
| 131 | (hode : ∀ z ∈ Omega, HasDerivAt (fun t => phase (z.1, t)) |
| 132 | (coordinateGeodesicField N.metric.euclideanCoefficients (phase z)) z.2) |
| 133 | {z : ℝ × ℝ} (hz : z ∈ Omega) (W : AnnulusCoordinates) : |
| 134 | let F : ℝ × ℝ → AnnulusCoordinates := fun p => (phase p).1 |
| 135 | let Gamma := christoffelBilinear N.metric.euclideanCoefficients |
| 136 | let X : ℝ × ℝ → AnnulusCoordinates := fun p => fderiv ℝ F p (1, 0) |
| 137 | N.metric.inner (F z) |
| 138 | (covDerivAlong Gamma F (covDerivAlong Gamma F X (0, 1)) (0, 1) z) W + |
| 139 | N.connection.scalarCurvature (F z) / 2 * |
| 140 | (N.metric.inner (F z) (X z) W * N.metric.inner (F z) (phase z).2 (phase z).2 - |
| 141 | N.metric.inner (F z) (X z) (phase z).2 * N.metric.inner (F z) (phase z).2 W) = 0 := by |
| 142 | have h := congrArg (fun v => N.metric.inner (phase z).1 v W) |
| 143 | (m64Intrinsic_normal_variation_jacobi N hOmega hsmooth hode hz) |
| 144 | simp only [map_add, add_apply, map_zero, zero_apply] at h |
| 145 | rw [m64Intrinsic_christoffel_curvature_pairing N] at h |
| 146 | exact h |
| 147 | |
| 148 | end PoincareMT |