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.AnnularEvolution.Sweep.Metric.Transport |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.PolygonApproximation.Metric.LipschitzBridge |
| 3 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Lipschitz.Gluing |
| 4 | |
| 5 | /-! |
| 6 | # Joining two actual Lipschitz annuli |
| 7 | |
| 8 | Each annulus occupies half of the radial interval. Their literal common |
| 9 | boundary makes the piecewise map continuous and globally Lipschitz; the |
| 10 | rectangle Rademacher service then supplies all admissibility fields. |
| 11 | |
| 12 | Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. |
| 13 | 447-449. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set MeasureTheory |
| 20 | open scoped Manifold ContDiff Bundle ENNReal NNReal |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | /-- The affine radial doubling used to place one annulus on half of the joined rectangle. |
| 27 | Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep construction. -/ |
| 28 | noncomputable def m64RadialDouble (d : ℝ) (p : LoopPlane) : LoopPlane := |
| 29 | annulusPoint (p 0) (2 * p 1 - d) |
| 30 | |
| 31 | /-- Radial doubling is Lipschitz with constant two in the source-plane norm. Source: MT |
| 32 | Lemma 19.15, pp. 447-449, its weak minimum and sweep construction. -/ |
| 33 | theorem m64RadialDouble_norm_sub_le (d : ℝ) (p q : LoopPlane) : |
| 34 | ‖m64RadialDouble d p - m64RadialDouble d q‖ ≤ 2 * ‖p - q‖ := by |
| 35 | have heq : m64RadialDouble d p - m64RadialDouble d q = |
| 36 | (p - q) + (p 1 - q 1) • EuclideanSpace.basisFun (Fin 2) ℝ 1 := by |
| 37 | ext i |
| 38 | fin_cases i <;> simp [m64RadialDouble, annulusPoint, EuclideanSpace.basisFun_apply] |
| 39 | ring |
| 40 | rw [heq] |
| 41 | have hc : |p 1 - q 1| ≤ ‖p - q‖ := by |
| 42 | simpa only [PiLp.sub_apply, Real.norm_eq_abs] using PiLp.norm_apply_le (p - q) 1 |
| 43 | calc |
| 44 | _ ≤ ‖p - q‖ + ‖(p 1 - q 1) • EuclideanSpace.basisFun (Fin 2) ℝ 1‖ := norm_add_le _ _ |
| 45 | _ = ‖p - q‖ + |p 1 - q 1| := by |
| 46 | rw [norm_smul, Real.norm_eq_abs, OrthonormalBasis.norm_eq_one, mul_one] |
| 47 | _ ≤ 2 * ‖p - q‖ := by linarith |
| 48 | |
| 49 | /-- Join two maps along their common literal radial trace using the two half-rectangle |
| 50 | rescalings. Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep construction. -/ |
| 51 | noncomputable def m64AnnulusJoinMap {M : Type u} (f h : LoopPlane → M) (p : LoopPlane) : M := |
| 52 | if p 1 ≤ (1 / 2 : ℝ) then f (m64RadialDouble 0 p) else h (m64RadialDouble 1 p) |
| 53 | |
| 54 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T2Space M] |
| 55 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 56 | |
| 57 | /-- Two Lipschitz maps with the same joining trace give a globally Lipschitz joined annulus |
| 58 | map. Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep construction. -/ |
| 59 | theorem m64AnnulusJoinMap_lipschitz |
| 60 | {g : RiemannianMetric n M} {c0 c1 c2 : ℝ → M} |
| 61 | (A : M64Annulus g c0 c1) (B : M64Annulus g c1 c2) : |
| 62 | ∃ K : ℝ≥0, ∀ x y : m64AnnulusDomain, |
| 63 | g.edist (m64AnnulusJoinMap A.map B.map x) (m64AnnulusJoinMap A.map B.map y) ≤ |
| 64 | (K : ℝ≥0∞) * ENNReal.ofReal ‖(x : LoopPlane) - y‖ := by |
| 65 | let : LocallyCompactSpace M := |
| 66 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 67 | let : R1Space M := T2Space.r1Space |
| 68 | let : RegularSpace M := RegularSpace.of_hasBasis |
| 69 | isCompact_isClosed_basis_nhds (fun _ _ ⟨_, _, h⟩ => h) |
| 70 | let : T3Space M := ⟨⟩ |
| 71 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 72 | ⟨g.toRiemannianMetric⟩ |
| 73 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 74 | (TangentSpace (𝓡 n) : M → Type _) := |
| 75 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 76 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 77 | let K : ℝ≥0 := ⟨2 * A.lipschitz_constant, mul_nonneg (by norm_num) A.lipschitz_nonnegative⟩ |
| 78 | let L : ℝ≥0 := ⟨2 * B.lipschitz_constant, mul_nonneg (by norm_num) B.lipschitz_nonnegative⟩ |
| 79 | have hbound {c d : ℝ → M} (D : M64Annulus g c d) (shift : ℝ) |
| 80 | {S : Set LoopPlane} (hS : MapsTo (m64RadialDouble shift) S m64AnnulusDomain) : |
| 81 | LipschitzOnWith (⟨2 * D.lipschitz_constant, |
| 82 | mul_nonneg (by norm_num) D.lipschitz_nonnegative⟩ : ℝ≥0) |
| 83 | (fun p => D.map (m64RadialDouble shift p)) S := by |
| 84 | intro x hx y hy |
| 85 | change g.edist _ _ ≤ _ |
| 86 | have h := D.lipschitz_on_domain ⟨_, hS hx⟩ ⟨_, hS hy⟩ |
| 87 | calc |
| 88 | _ ≤ ENNReal.ofReal D.lipschitz_constant * |
| 89 | ENNReal.ofReal ‖m64RadialDouble shift x - m64RadialDouble shift y‖ := h |
| 90 | _ ≤ ENNReal.ofReal D.lipschitz_constant * ENNReal.ofReal (2 * ‖x - y‖) := by |
| 91 | gcongr |
| 92 | exact m64RadialDouble_norm_sub_le shift x y |
| 93 | _ = _ := by |
| 94 | rw [ENNReal.coe_nnreal_eq] |
| 95 | change ENNReal.ofReal D.lipschitz_constant * ENNReal.ofReal (2 * ‖x - y‖) = |
| 96 | ENNReal.ofReal (2 * D.lipschitz_constant) * edist x y |
| 97 | rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] |
| 98 | simp only [edist_dist, dist_eq_norm] |
| 99 | rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] |
| 100 | ring |
| 101 | have hleft : LipschitzOnWith K (fun p => A.map (m64RadialDouble 0 p)) |
| 102 | (m64AnnulusDomain ∩ {p | p 1 ≤ (1 / 2 : ℝ)}) := by |
| 103 | apply hbound A 0 |
| 104 | intro p hp |
| 105 | change 0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ 2 * p 1 - 0 ∧ 2 * p 1 - 0 ≤ 1 |
| 106 | have hhalf : p 1 ≤ (1 / 2 : ℝ) := hp.2 |
| 107 | refine ⟨hp.1.1, hp.1.2.1, ?_, ?_⟩ <;> linarith [hp.1.2.2.1] |
| 108 | have hright : LipschitzOnWith L (fun p => B.map (m64RadialDouble 1 p)) |
| 109 | (m64AnnulusDomain ∩ {p | (1 / 2 : ℝ) ≤ p 1}) := by |
| 110 | apply hbound B 1 |
| 111 | intro p hp |
| 112 | change 0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ 2 * p 1 - 1 ∧ 2 * p 1 - 1 ≤ 1 |
| 113 | have hhalf : (1 / 2 : ℝ) ≤ p 1 := hp.2 |
| 114 | refine ⟨hp.1.1, hp.1.2.1, ?_, ?_⟩ <;> linarith [hp.1.2.2.2] |
| 115 | have hjoin := M60.lipschitzOnWith_piecewise_of_convex m64AnnulusDomain_convex |
| 116 | (fun p : LoopPlane => p 1) (PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 1).continuousOn |
| 117 | (1 / 2 : ℝ) hleft hright (fun p _ hp => by |
| 118 | simp only [m64RadialDouble, hp] |
| 119 | norm_num |
| 120 | rw [A.upper_boundary, B.lower_boundary]) |
| 121 | refine ⟨max K L, ?_⟩ |
| 122 | intro x y |
| 123 | have h := hjoin x.property y.property |
| 124 | change g.edist _ _ ≤ _ at h |
| 125 | simpa only [m64AnnulusJoinMap, Set.piecewise, mem_ofPred_eq, edist_dist, dist_eq_norm] using |
| 126 | h |
| 127 | |
| 128 | /-- Construct an admissible annulus by joining two actual annuli along their common labeled |
| 129 | boundary. Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep construction. -/ |
| 130 | theorem m64Annulus_join |
| 131 | {g : RiemannianMetric n M} {c0 c1 c2 : ℝ → M} |
| 132 | (A : M64Annulus g c0 c1) (B : M64Annulus g c1 c2) : |
| 133 | ∃ C : M64Annulus g c0 c2, C.map = m64AnnulusJoinMap A.map B.map := by |
| 134 | let f := m64AnnulusJoinMap A.map B.map |
| 135 | obtain ⟨K, hK⟩ := m64AnnulusJoinMap_lipschitz A B |
| 136 | have hLip : ∀ x y : m64AnnulusDomain, g.edist (f x) (f y) ≤ |
| 137 | ENNReal.ofReal (K : ℝ) * ENNReal.ofReal ‖(x : LoopPlane) - y‖ := by |
| 138 | simpa only [ENNReal.ofReal_coe_nnreal] using hK |
| 139 | have hcontinuous : ContinuousOn f m64AnnulusDomain := by |
| 140 | let : LocallyCompactSpace M := |
| 141 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 142 | let : R1Space M := T2Space.r1Space |
| 143 | let : RegularSpace M := RegularSpace.of_hasBasis |
| 144 | isCompact_isClosed_basis_nhds (fun _ _ ⟨_, _, h⟩ => h) |
| 145 | let : T3Space M := ⟨⟩ |
| 146 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 147 | ⟨g.toRiemannianMetric⟩ |
| 148 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 149 | (TangentSpace (𝓡 n) : M → Type _) := |
| 150 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 151 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 152 | have h : LipschitzOnWith K f m64AnnulusDomain := by |
| 153 | intro x hx y hy |
| 154 | change g.edist (f x) (f y) ≤ _ |
| 155 | simpa only [edist_dist, dist_eq_norm] using hK ⟨x, hx⟩ ⟨y, hy⟩ |
| 156 | exact h.continuousOn |
| 157 | have hfinite : volume m64AnnulusInterior ≠ (⊤ : ENNReal) := by |
| 158 | rw [← measure_congr m64AnnulusDomain_ae_eq_interior] |
| 159 | exact m64AnnulusDomain_volume_ne_top |
| 160 | obtain ⟨C, hmap, _⟩ := m64Annulus_of_lipschitz g (c0 := c0) (c1 := c2) f hcontinuous |
| 161 | (by |
| 162 | intro x s |
| 163 | simp only [f, m64AnnulusJoinMap, m64RadialDouble, annulusPoint, |
| 164 | Matrix.cons_val_zero, Matrix.cons_val_one] |
| 165 | split_ifs <;> first | exact A.periodic x (2 * s - 0) | exact B.periodic x (2 * s - 1)) |
| 166 | (by |
| 167 | intro x |
| 168 | norm_num [f, m64AnnulusJoinMap, m64RadialDouble, annulusPoint] |
| 169 | exact A.lower_boundary x) |
| 170 | (by |
| 171 | intro x |
| 172 | norm_num [f, m64AnnulusJoinMap, m64RadialDouble, annulusPoint] |
| 173 | exact B.upper_boundary x) |
| 174 | K.coe_nonneg hLip hfinite |
| 175 | (show m64AnnulusArea g f < m64AnnulusArea g f + 1 by linarith) |
| 176 | exact ⟨C, hmap⟩ |
| 177 | |
| 178 | end PoincareMT |