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.Boundary.Normal |
| 2 | import PoincareLib.Geometry.Riemannian.Coordinates.GeodesicFlow |
| 3 | import PoincareLib.Geometry.Riemannian.Coordinates.Exponential.InitialData |
| 4 | |
| 5 | /-! |
| 6 | # The local inward normal geodesic family |
| 7 | |
| 8 | M07's smooth geodesic flow constructs the actual family from the smooth |
| 9 | metric unit normal. The family retains its initial position and velocity, |
| 10 | its intrinsic geodesic equation, and unit speed. No completeness assumption |
| 11 | is used for this local construction. Source: Claim 19.37, pp. 468-469. |
| 12 | |
| 13 | Context: Morgan--Tian Claim 19.37, printed pp. 468-469, in the proof of Proposition |
| 14 | 19.35. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set Filter |
| 22 | open scoped Topology Manifold ContDiff Bundle |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 27 | normedSpaceTangentSpaceVectorSpace |
| 28 | |
| 29 | /-- A coordinate phase solution is an intrinsic geodesic for the retained metric on the |
| 30 | annulus coordinate plane. Source/construction: Morgan--Tian Claim 19.37, printed pp. |
| 31 | 468-469. -/ |
| 32 | theorem m64Intrinsic_isGeodesicOn_of_phase |
| 33 | (N : IntrinsicAnnulus) {phase : ℝ → AnnulusCoordinates × AnnulusCoordinates} |
| 34 | {J : Set ℝ} (hJ : IsOpen J) |
| 35 | (hphase : ∀ t ∈ J, HasDerivAt phase |
| 36 | (coordinateGeodesicField N.metric.euclideanCoefficients (phase t)) t) : |
| 37 | N.metric.IsGeodesicOn (fun t => (phase t).1) J := by |
| 38 | have hcoeff : N.metric.pullbackCoefficients (extChartAt (𝓡 2) (0 : AnnulusCoordinates)).symm = |
| 39 | N.metric.euclideanCoefficients := by |
| 40 | ext p v w |
| 41 | simp only [extChartAt_model_space_eq_id, PartialEquiv.refl_symm, PartialEquiv.refl_coe] |
| 42 | change N.metric.inner p (mfderiv (𝓡 2) (𝓡 2) id p v) |
| 43 | (mfderiv (𝓡 2) (𝓡 2) id p w) = N.metric.inner p v w |
| 44 | rw [mfderiv_id] |
| 45 | rfl |
| 46 | have h := N.metric.isGeodesicOn_chart_curve (0 : AnnulusCoordinates) hJ |
| 47 | (q := fun t => (phase t).1) (w := fun t => (phase t).2) (by |
| 48 | intro t ht |
| 49 | refine ⟨by simp, ?_, ?_⟩ |
| 50 | · simpa [coordinateGeodesicField] using (hphase t ht).hasFDerivAt.fst.hasDerivAt |
| 51 | · rw [hcoeff] |
| 52 | simpa [coordinateGeodesicField] using (hphase t ht).hasFDerivAt.snd.hasDerivAt) |
| 53 | simpa only [extChartAt_model_space_eq_id, PartialEquiv.refl_symm, |
| 54 | PartialEquiv.refl_coe, id_eq] using! h |
| 55 | |
| 56 | /-- Smooth initial position and velocity produce a jointly smooth local geodesic phase |
| 57 | family with its actual energy identity. Source/construction: Morgan--Tian Claim 19.37, |
| 58 | printed pp. 468-469. -/ |
| 59 | theorem m64Intrinsic_exists_local_geodesic_variation |
| 60 | (N : IntrinsicAnnulus) {gamma velocity : ℝ → AnnulusCoordinates} |
| 61 | (hgamma : ContDiff ℝ ∞ gamma) (hvelocity : ContDiff ℝ ∞ velocity) (a : ℝ) : |
| 62 | ∃ (U : Set ℝ) (delta : ℝ) |
| 63 | (phase : ℝ × ℝ → AnnulusCoordinates × AnnulusCoordinates), |
| 64 | IsOpen U ∧ a ∈ U ∧ 0 < delta ∧ |
| 65 | ContDiffOn ℝ ∞ phase (U ×ˢ Ioo (-delta) delta) ∧ |
| 66 | (∀ x ∈ U, phase (x, 0) = (gamma x, velocity x)) ∧ |
| 67 | (∀ x ∈ U, ∀ t ∈ Ioo (-delta) delta, |
| 68 | HasDerivAt (fun s => phase (x, s)) |
| 69 | (coordinateGeodesicField N.metric.euclideanCoefficients (phase (x, t))) t) ∧ |
| 70 | (∀ x ∈ U, N.metric.IsGeodesicOn (fun t => (phase (x, t)).1) |
| 71 | (Ioo (-delta) delta)) ∧ |
| 72 | ∀ x ∈ U, ∀ t ∈ Ioo (-delta) delta, |
| 73 | N.metric.inner (phase (x, t)).1 (phase (x, t)).2 (phase (x, t)).2 = |
| 74 | N.metric.inner (gamma x) (velocity x) (velocity x) := by |
| 75 | have hB : ContDiffOn ℝ ∞ N.metric.euclideanCoefficients univ := |
| 76 | (contDiff_iff_contDiffAt.mpr N.metric.contDiffAt_euclideanCoefficients).contDiffOn |
| 77 | obtain ⟨V, delta, Phi, hV, ha, _, hdelta, hPhi, hinit, hflow⟩ := |
| 78 | exists_smooth_coordinate_geodesic_flow isOpen_univ hB |
| 79 | (fun x _ => N.metric.inner_isInvertible x) |
| 80 | (fun x _ v w => N.metric.symm x v w) (mem_univ (gamma a)) (velocity a) |
| 81 | let initial : ℝ → AnnulusCoordinates × AnnulusCoordinates := fun x => (gamma x, velocity x) |
| 82 | let U := initial ⁻¹' V |
| 83 | let phase : ℝ × ℝ → AnnulusCoordinates × AnnulusCoordinates := |
| 84 | fun z => Phi (initial z.1, z.2) |
| 85 | have hinitial : ContDiff ℝ ∞ initial := hgamma.prodMk hvelocity |
| 86 | have hU : IsOpen U := hV.preimage hinitial.continuous |
| 87 | have hsmooth : ContDiffOn ℝ ∞ phase (U ×ˢ Ioo (-delta) delta) := by |
| 88 | exact hPhi.comp |
| 89 | ((hinitial.comp contDiff_fst).prodMk contDiff_snd).contDiffOn |
| 90 | (fun z hz => ⟨hz.1, hz.2⟩) |
| 91 | have hphase (x : ℝ) (hx : x ∈ U) (t : ℝ) (ht : t ∈ Ioo (-delta) delta) : |
| 92 | HasDerivAt (fun s => phase (x, s)) |
| 93 | (coordinateGeodesicField N.metric.euclideanCoefficients (phase (x, t))) t := |
| 94 | (hflow (initial x) hx t ht).2.1 |
| 95 | refine ⟨U, delta, phase, hU, ha, hdelta, hsmooth, ?_, hphase, ?_, ?_⟩ |
| 96 | · intro x hx |
| 97 | exact hinit (initial x) hx |
| 98 | · intro x hx |
| 99 | exact m64Intrinsic_isGeodesicOn_of_phase N isOpen_Ioo (hphase x hx) |
| 100 | · intro x hx t ht |
| 101 | exact (hflow (initial x) hx t ht).2.2 |
| 102 | |
| 103 | /-- The constructed inward metric unit normal is the initial velocity of a smooth unit-speed |
| 104 | intrinsic geodesic variation near every boundary point. Source/construction: Morgan--Tian |
| 105 | Claim 19.37, printed pp. 468-469. -/ |
| 106 | theorem m64Intrinsic_exists_local_normal_geodesic_variation |
| 107 | (N : IntrinsicAnnulus) {radius : ℝ} (hradius : radius ≠ 0) : |
| 108 | ∃ normal : ℝ → AnnulusCoordinates, ContDiff ℝ ∞ normal ∧ |
| 109 | (∀ t, N.metric.inner (intrinsicAnnulusBoundary radius t) (normal t) (normal t) = 1 ∧ |
| 110 | N.metric.inner (intrinsicAnnulusBoundary radius t) (normal t) |
| 111 | (curveVelocity (n := 2) (intrinsicAnnulusBoundary radius) t) = 0 ∧ |
| 112 | 0 < inner ℝ (intrinsicAnnulusBoundary radius t) (normal t)) ∧ |
| 113 | ∀ a : ℝ, ∃ (U : Set ℝ) (delta : ℝ) |
| 114 | (phase : ℝ × ℝ → AnnulusCoordinates × AnnulusCoordinates), |
| 115 | IsOpen U ∧ a ∈ U ∧ 0 < delta ∧ |
| 116 | ContDiffOn ℝ ∞ phase (U ×ˢ Ioo (-delta) delta) ∧ |
| 117 | (∀ x ∈ U, phase (x, 0) = (intrinsicAnnulusBoundary radius x, normal x)) ∧ |
| 118 | (∀ x ∈ U, N.metric.IsGeodesicOn (fun t => (phase (x, t)).1) |
| 119 | (Ioo (-delta) delta)) ∧ |
| 120 | ∀ x ∈ U, ∀ t ∈ Ioo (-delta) delta, |
| 121 | HasDerivAt (fun s => (phase (x, s)).1) (phase (x, t)).2 t ∧ |
| 122 | N.metric.inner (phase (x, t)).1 (phase (x, t)).2 (phase (x, t)).2 = 1 := by |
| 123 | obtain ⟨normal, hnormal, hn⟩ := m64Intrinsic_exists_smooth_inward_boundary_normal N hradius |
| 124 | refine ⟨normal, hnormal, hn, ?_⟩ |
| 125 | intro a |
| 126 | obtain ⟨U, delta, phase, hU, ha, hdelta, hsmooth, hinit, hphase, hgeo, henergy⟩ := |
| 127 | m64Intrinsic_exists_local_geodesic_variation N (m64Intrinsic_contDiff_boundary radius) hnormal a |
| 128 | refine ⟨U, delta, phase, hU, ha, hdelta, hsmooth, hinit, hgeo, ?_⟩ |
| 129 | intro x hx t ht |
| 130 | refine ⟨?_, (henergy x hx t ht).trans (hn x).1⟩ |
| 131 | simpa [coordinateGeodesicField] using (hphase x hx t ht).hasFDerivAt.fst.hasDerivAt |
| 132 | |
| 133 | end PoincareMT |