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.Gauss |
| 2 | |
| 3 | /-! |
| 4 | # The metric of the normal strip |
| 5 | |
| 6 | Normal geodesics have unit speed. Together with Gauss orthogonality, the |
| 7 | transverse comparison yields the full product-metric bound and injectivity |
| 8 | of the differential, including the boundary and first exit endpoints. |
| 9 | |
| 10 | Morgan--Tian context: Claim 19.37, printed pp. 468-469, in the proof of Proposition |
| 11 | 19.35. This module supplies actual normal-geodesic data or its coordinate and measure |
| 12 | transport. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Topology Manifold ContDiff Bundle |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 25 | normedSpaceTangentSpaceVectorSpace |
| 26 | |
| 27 | /-- An intrinsic geodesic with unit initial velocity has unit velocity on the whole compact |
| 28 | interval of existence. Source/construction: Morgan--Tian Claim 19.37, printed pp. 468-469. -/ |
| 29 | theorem m64Intrinsic_geodesic_velocity_unit |
| 30 | (N : IntrinsicAnnulus) {q : ℝ → AnnulusCoordinates} {I : Set ℝ} {b : ℝ} |
| 31 | (hb : 0 < b) (hgeo : N.metric.IsGeodesicOn q I) (hsub : Icc (0 : ℝ) b ⊆ I) |
| 32 | (hzero : N.metric.inner (q 0) (curveVelocity (n := 2) q 0) |
| 33 | (curveVelocity (n := 2) q 0) = 1) : |
| 34 | ∀ t ∈ Icc (0 : ℝ) b, |
| 35 | N.metric.inner (q t) (curveVelocity (n := 2) q t) (curveVelocity (n := 2) q t) = 1 := by |
| 36 | let speed : ℝ → ℝ := fun t => N.metric.tangentNorm (q t) (curveVelocity (n := 2) q t) |
| 37 | have hs (t : ℝ) (ht : t ∈ Icc (0 : ℝ) b) : HasDerivAt speed 0 t := |
| 38 | hgeo.hasDerivAt_tangentNorm_zero (hsub ht) |
| 39 | have hz : (0 : ℝ) ∈ Icc (0 : ℝ) b := ⟨le_rfl, hb.le⟩ |
| 40 | have hs0 : speed 0 = 1 := by |
| 41 | change Real.sqrt (N.metric.inner (q 0) |
| 42 | (curveVelocity (n := 2) q 0) (curveVelocity (n := 2) q 0)) = 1 |
| 43 | rw [hzero, Real.sqrt_one] |
| 44 | intro t ht |
| 45 | have h := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le |
| 46 | (fun s hs' => (hs s hs').hasDerivWithinAt) |
| 47 | (C := 0) (fun _ _ => by simp) (convex_Icc (0 : ℝ) b) hz ht |
| 48 | have heq : speed t = 1 := by |
| 49 | simpa only [zero_mul, norm_le_zero_iff, sub_eq_zero, hs0] using h |
| 50 | change Real.sqrt (N.metric.inner (q t) |
| 51 | (curveVelocity (n := 2) q t) (curveVelocity (n := 2) q t)) = 1 at heq |
| 52 | have hpos := (Real.sqrt_pos.mp (show 0 < Real.sqrt _ from heq.symm ▸ zero_lt_one)).le |
| 53 | have hsq := Real.sq_sqrt hpos |
| 54 | rw [heq] at hsq |
| 55 | simpa only [one_pow] using hsq.symm |
| 56 | |
| 57 | /-- Bilinearity and Gauss orthogonality identify the exact pullback metric of a unit-speed |
| 58 | normal variation in product coordinates. Source/construction: Morgan--Tian Claim 19.37, |
| 59 | printed pp. 468-469. -/ |
| 60 | theorem m64Intrinsic_normal_variation_metric |
| 61 | (N : IntrinsicAnnulus) {u : ℝ × ℝ → AnnulusCoordinates} {a t : ℝ} |
| 62 | (hu : DifferentiableAt ℝ u (a, t)) |
| 63 | (hunit : N.metric.inner (u (a, t)) |
| 64 | (curveVelocity (n := 2) (fun r => u (a, r)) t) |
| 65 | (curveVelocity (n := 2) (fun r => u (a, r)) t) = 1) |
| 66 | (horth : N.metric.inner (u (a, t)) |
| 67 | (curveVelocity (n := 2) (fun r => u (a, r)) t) |
| 68 | (curveVelocity (n := 2) (fun s => u (s, t)) a) = 0) |
| 69 | (v : ℝ × ℝ) : |
| 70 | N.metric.inner (u (a, t)) (fderiv ℝ u (a, t) v) (fderiv ℝ u (a, t) v) = |
| 71 | v.1 ^ 2 * N.metric.inner (u (a, t)) |
| 72 | (curveVelocity (n := 2) (fun s => u (s, t)) a) |
| 73 | (curveVelocity (n := 2) (fun s => u (s, t)) a) + v.2 ^ 2 := by |
| 74 | let X : AnnulusCoordinates := curveVelocity (n := 2) (fun s => u (s, t)) a |
| 75 | let T : AnnulusCoordinates := curveVelocity (n := 2) (fun r => u (a, r)) t |
| 76 | let L := fderiv ℝ u (a, t) |
| 77 | change N.metric.inner (u (a, t)) T T = 1 at hunit |
| 78 | change N.metric.inner (u (a, t)) T X = 0 at horth |
| 79 | have hfst : L (1, 0) = X := by |
| 80 | have h := hu.hasFDerivAt.comp_hasDerivAt (l := u) (f := fun s => (s, t)) a |
| 81 | ((hasDerivAt_id a).prodMk (hasDerivAt_const a t)) |
| 82 | exact h.deriv.symm.trans (m64Intrinsic_curveVelocity_eq_deriv _ _).symm |
| 83 | have hsnd : L (0, 1) = T := by |
| 84 | have h := hu.hasFDerivAt.comp_hasDerivAt (l := u) (f := fun r => (a, r)) t |
| 85 | ((hasDerivAt_const t a).prodMk (hasDerivAt_id t)) |
| 86 | exact h.deriv.symm.trans (m64Intrinsic_curveVelocity_eq_deriv _ _).symm |
| 87 | have hL : L v = v.1 • X + v.2 • T := by |
| 88 | have hv : v = v.1 • (1, 0) + v.2 • (0, 1) := by ext <;> simp |
| 89 | calc |
| 90 | L v = L (v.1 • (1, 0) + v.2 • (0, 1)) := congrArg L hv |
| 91 | _ = _ := by rw [map_add, map_smul, map_smul, hfst, hsnd] |
| 92 | have horth' : N.metric.inner (u (a, t)) X T = 0 := by |
| 93 | rw [N.metric.symm] |
| 94 | exact horth |
| 95 | change N.metric.inner (u (a, t)) (L v) (L v) = _ |
| 96 | rw [hL] |
| 97 | simp only [map_add, add_apply, map_smul, smul_apply, smul_eq_mul, |
| 98 | horth', horth, hunit, mul_zero, mul_one, zero_add, add_zero] |
| 99 | ring |
| 100 | |
| 101 | /-- The exact product formula turns the transverse norm estimate into the full lower bound; |
| 102 | in particular the differential is injective. Source/construction: Morgan--Tian Claim 19.37, |
| 103 | printed pp. 468-469. -/ |
| 104 | theorem m64Intrinsic_normal_variation_metric_lower |
| 105 | (N : IntrinsicAnnulus) {u : ℝ × ℝ → AnnulusCoordinates} {a t c speed : ℝ} |
| 106 | (hu : DifferentiableAt ℝ u (a, t)) (hc : 0 < c) (hc1 : c ≤ 1) (hspeed : 0 < speed) |
| 107 | (hunit : N.metric.inner (u (a, t)) |
| 108 | (curveVelocity (n := 2) (fun r => u (a, r)) t) |
| 109 | (curveVelocity (n := 2) (fun r => u (a, r)) t) = 1) |
| 110 | (horth : N.metric.inner (u (a, t)) |
| 111 | (curveVelocity (n := 2) (fun r => u (a, r)) t) |
| 112 | (curveVelocity (n := 2) (fun s => u (s, t)) a) = 0) |
| 113 | (hlower : c * speed ≤ N.metric.tangentNorm (u (a, t)) |
| 114 | (curveVelocity (n := 2) (fun s => u (s, t)) a)) : |
| 115 | (∀ v : ℝ × ℝ, |
| 116 | c ^ 2 * (speed ^ 2 * v.1 ^ 2 + v.2 ^ 2) ≤ |
| 117 | N.metric.inner (u (a, t)) (fderiv ℝ u (a, t) v) (fderiv ℝ u (a, t) v)) ∧ |
| 118 | Function.Injective (fderiv ℝ u (a, t)) := by |
| 119 | let X : AnnulusCoordinates := curveVelocity (n := 2) (fun s => u (s, t)) a |
| 120 | have hpositive : 0 < N.metric.tangentNorm (u (a, t)) X := |
| 121 | (mul_pos hc hspeed).trans_le hlower |
| 122 | have hxx : 0 ≤ N.metric.inner (u (a, t)) X X := (Real.sqrt_pos.mp hpositive).le |
| 123 | have hsq : c ^ 2 * speed ^ 2 ≤ N.metric.inner (u (a, t)) X X := by |
| 124 | have hnormsq := Real.sq_sqrt hxx |
| 125 | change (N.metric.tangentNorm (u (a, t)) X) ^ 2 = _ at hnormsq |
| 126 | nlinarith [mul_pos hc hspeed] |
| 127 | have hbound (v : ℝ × ℝ) : |
| 128 | c ^ 2 * (speed ^ 2 * v.1 ^ 2 + v.2 ^ 2) ≤ |
| 129 | N.metric.inner (u (a, t)) (fderiv ℝ u (a, t) v) (fderiv ℝ u (a, t) v) := by |
| 130 | rw [m64Intrinsic_normal_variation_metric N hu hunit horth v] |
| 131 | have hx := mul_le_mul_of_nonneg_left hsq (sq_nonneg v.1) |
| 132 | have hc2 : c ^ 2 ≤ 1 := by nlinarith |
| 133 | have ht := mul_le_mul_of_nonneg_right hc2 (sq_nonneg v.2) |
| 134 | nlinarith |
| 135 | refine ⟨hbound, (injective_iff_map_eq_zero (fderiv ℝ u (a, t))).mpr ?_⟩ |
| 136 | intro v hv |
| 137 | have h := hbound v |
| 138 | rw [hv, map_zero] at h |
| 139 | have hz : speed ^ 2 * v.1 ^ 2 + v.2 ^ 2 ≤ 0 := |
| 140 | (mul_le_mul_iff_right₀ (sq_pos_of_pos hc)).mp (by simpa only [mul_zero] using h) |
| 141 | have hv2 : v.2 = 0 := by nlinarith [mul_nonneg (sq_nonneg speed) (sq_nonneg v.1)] |
| 142 | have hv1 : v.1 = 0 := by |
| 143 | have hx : speed ^ 2 * v.1 ^ 2 ≤ 0 := by nlinarith |
| 144 | have hvs : v.1 ^ 2 ≤ 0 := by |
| 145 | exact (mul_le_mul_iff_right₀ (sq_pos_of_pos hspeed)).mp |
| 146 | (by simpa only [mul_zero] using hx) |
| 147 | nlinarith [sq_nonneg v.1] |
| 148 | exact Prod.ext hv1 hv2 |
| 149 | |
| 150 | end PoincareMT |