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.PolygonApproximation.Polygon.CellLipschitz |
| 2 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Lipschitz.Gluing |
| 3 | |
| 4 | /-! |
| 5 | # Global Lipschitz control from the polygon cells |
| 6 | |
| 7 | Successively adjoining the closed angular strips preserves Lipschitz control: |
| 8 | M60 glues the two restrictions across their common vertical line. The |
| 9 | constant may depend on the polygon; uniform area control comes separately |
| 10 | from the two differential columns. |
| 11 | |
| 12 | Morgan--Tian context: Section 19.4, Definition 19.18 and Claims 19.19-19.22, printed pp. |
| 13 | 450-453. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle ENNReal NNReal |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- Successively glue finitely many closed-cell Lipschitz bounds across their shared |
| 26 | vertical cuts. Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. |
| 27 | 450-453; project construction in |
| 28 | `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 29 | theorem m64_lipschitzOn_annulus_of_polygon_cells |
| 30 | {Y : Type*} [PseudoEMetricSpace Y] {f : LoopPlane → Y} |
| 31 | {N : ℕ} (hN : 0 < N) |
| 32 | (hcell : ∀ j : Fin N, ∃ K : ℝ≥0, |
| 33 | LipschitzOnWith K f (m64PolygonCellSet j)) : |
| 34 | ∃ K : ℝ≥0, LipschitzOnWith K f m64AnnulusDomain := by |
| 35 | classical |
| 36 | let S : ℕ → Set LoopPlane := fun k => |
| 37 | {p | 0 ≤ p 0 ∧ p 0 ≤ (k : ℝ) * m63CellLength N ∧ |
| 38 | 0 ≤ p 1 ∧ p 1 ≤ 1} |
| 39 | have hell : 0 ≤ m63CellLength N := (m63CellLength_pos hN).le |
| 40 | have hconvex (k : ℕ) : Convex ℝ (S k) := by |
| 41 | intro x hx y hy a b ha hb hab |
| 42 | change 0 ≤ (a • x + b • y) 0 ∧ |
| 43 | (a • x + b • y) 0 ≤ (k : ℝ) * m63CellLength N ∧ |
| 44 | 0 ≤ (a • x + b • y) 1 ∧ (a • x + b • y) 1 ≤ 1 |
| 45 | simp only [PiLp.add_apply, PiLp.smul_apply, smul_eq_mul] |
| 46 | refine ⟨add_nonneg (mul_nonneg ha hx.1) (mul_nonneg hb hy.1), ?_, |
| 47 | add_nonneg (mul_nonneg ha hx.2.2.1) (mul_nonneg hb hy.2.2.1), ?_⟩ |
| 48 | · calc |
| 49 | a * x 0 + b * y 0 ≤ a * ((k : ℝ) * m63CellLength N) + |
| 50 | b * ((k : ℝ) * m63CellLength N) := |
| 51 | add_le_add (mul_le_mul_of_nonneg_left hx.2.1 ha) |
| 52 | (mul_le_mul_of_nonneg_left hy.2.1 hb) |
| 53 | _ = (k : ℝ) * m63CellLength N := by rw [← add_mul, hab, one_mul] |
| 54 | · calc |
| 55 | a * x 1 + b * y 1 ≤ a * 1 + b * 1 := |
| 56 | add_le_add (mul_le_mul_of_nonneg_left hx.2.2.2 ha) |
| 57 | (mul_le_mul_of_nonneg_left hy.2.2.2 hb) |
| 58 | _ = 1 := by rw [← add_mul, hab, one_mul] |
| 59 | have hprefix : ∀ k : ℕ, k ≤ N → ∃ K : ℝ≥0, LipschitzOnWith K f (S k) := by |
| 60 | intro k |
| 61 | induction k with |
| 62 | | zero => |
| 63 | intro _ |
| 64 | obtain ⟨K, hK⟩ := hcell ⟨0, hN⟩ |
| 65 | refine ⟨K, hK.mono ?_⟩ |
| 66 | intro p hp |
| 67 | simp only [S, mem_ofPred_eq, Nat.cast_zero, zero_mul] at hp |
| 68 | change m63CellLeft N ⟨0, hN⟩ ≤ p 0 ∧ |
| 69 | p 0 ≤ m63CellLeft N ⟨0, hN⟩ + m63CellLength N ∧ |
| 70 | 0 ≤ p 1 ∧ p 1 ≤ 1 |
| 71 | simp only [m63CellLeft, Nat.cast_zero, zero_mul, zero_add] at hp ⊢ |
| 72 | exact ⟨hp.1, hp.2.1.trans hell, hp.2.2⟩ |
| 73 | | succ k ih => |
| 74 | intro hk |
| 75 | obtain ⟨K, hK⟩ := ih (by omega) |
| 76 | let j : Fin N := ⟨k, by omega⟩ |
| 77 | obtain ⟨L, hL⟩ := hcell j |
| 78 | have hleft : S (k + 1) ∩ {p | p 0 ≤ (k : ℝ) * m63CellLength N} ⊆ S k := by |
| 79 | intro p hp |
| 80 | exact ⟨hp.1.1, hp.2, hp.1.2.2⟩ |
| 81 | have hright : S (k + 1) ∩ {p | (k : ℝ) * m63CellLength N ≤ p 0} ⊆ |
| 82 | m64PolygonCellSet j := by |
| 83 | intro p hp |
| 84 | change m63CellLeft N j ≤ p 0 ∧ |
| 85 | p 0 ≤ m63CellLeft N j + m63CellLength N ∧ 0 ≤ p 1 ∧ p 1 ≤ 1 |
| 86 | refine ⟨hp.2, ?_, hp.1.2.2⟩ |
| 87 | have h := hp.1.2.1 |
| 88 | simpa only [m63CellLeft, j, Nat.cast_add, Nat.cast_one, add_mul, one_mul] |
| 89 | using h |
| 90 | have hglue := M60.lipschitzOnWith_piecewise_of_convex (hconvex (k + 1)) |
| 91 | (fun p : LoopPlane => p 0) |
| 92 | (PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 0).continuousOn |
| 93 | ((k : ℝ) * m63CellLength N) (hK.mono hleft) (hL.mono hright) |
| 94 | (fun _ _ _ => rfl) |
| 95 | refine ⟨max K L, ?_⟩ |
| 96 | simpa only [piecewise_same] using hglue |
| 97 | obtain ⟨K, hK⟩ := hprefix N le_rfl |
| 98 | refine ⟨K, ?_⟩ |
| 99 | have hSN : S N = m64AnnulusDomain := by |
| 100 | ext p |
| 101 | change (0 ≤ p 0 ∧ p 0 ≤ (N : ℝ) * m63CellLength N ∧ |
| 102 | 0 ≤ p 1 ∧ p 1 ≤ 1) ↔ |
| 103 | (0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ p 1 ∧ p 1 ≤ 1) |
| 104 | rw [m63_count_mul_cellLength hN] |
| 105 | rfl |
| 106 | rwa [hSN] at hK |
| 107 | |
| 108 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T2Space M] |
| 109 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 110 | [IsManifold (𝓡 n) ∞ M] |
| 111 | |
| 112 | /-- Convert the glued cell estimate into the annulus record's intrinsic-distance bound. |
| 113 | Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project |
| 114 | construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 115 | theorem m64Annulus_hLip_of_polygon_cells |
| 116 | (g : RiemannianMetric n M) {f : LoopPlane → M} |
| 117 | {N : ℕ} (hN : 0 < N) |
| 118 | (hcell : ∀ j : Fin N, ∃ K : ℝ≥0, |
| 119 | ∀ x ∈ m64PolygonCellSet j, ∀ y ∈ m64PolygonCellSet j, |
| 120 | g.edist (f x) (f y) ≤ (K : ℝ≥0∞) * ENNReal.ofReal ‖x - y‖) : |
| 121 | ∃ K : ℝ≥0, ∀ x y : m64AnnulusDomain, |
| 122 | g.edist (f x) (f y) ≤ |
| 123 | (K : ℝ≥0∞) * ENNReal.ofReal ‖(x : LoopPlane) - y‖ := by |
| 124 | let : LocallyCompactSpace M := |
| 125 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 126 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 127 | ⟨g.toRiemannianMetric⟩ |
| 128 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 129 | (TangentSpace (𝓡 n) : M → Type _) := |
| 130 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 131 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 132 | have hcell' : ∀ j : Fin N, ∃ K : ℝ≥0, |
| 133 | LipschitzOnWith K f (m64PolygonCellSet j) := by |
| 134 | intro j |
| 135 | obtain ⟨K, hK⟩ := hcell j |
| 136 | refine ⟨K, ?_⟩ |
| 137 | intro x hx y hy |
| 138 | change g.edist (f x) (f y) ≤ (K : ℝ≥0∞) * edist x y |
| 139 | simpa only [edist_dist, dist_eq_norm] using hK x hx y hy |
| 140 | obtain ⟨K, hK⟩ := m64_lipschitzOn_annulus_of_polygon_cells hN hcell' |
| 141 | refine ⟨K, ?_⟩ |
| 142 | intro x y |
| 143 | have h := hK x.property y.property |
| 144 | change g.edist (f x) (f y) ≤ (K : ℝ≥0∞) * edist (x : LoopPlane) y at h |
| 145 | simpa only [edist_dist, dist_eq_norm] using h |
| 146 | |
| 147 | end PoincareMT |