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.Within.CellLipschitz |
| 2 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Compact.ExtendedLipschitz |
| 3 | |
| 4 | /-! |
| 5 | # Compact-cell Lipschitz assembly |
| 6 | |
| 7 | The within-cell transfer gives local metric bounds for the actual polygon |
| 8 | map. Compact extended-metric globalization then supplies one bound on the |
| 9 | whole closed cell. A finite-distance certificate is kept explicit because |
| 10 | the Riemannian extended distance may be infinite between different target |
| 11 | components. |
| 12 | |
| 13 | Morgan--Tian context: Section 19.4, Definition 19.18 and Claims 19.19-19.22, printed pp. |
| 14 | 450-453. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter MeasureTheory Bundle |
| 21 | open scoped Manifold ContDiff Topology Bundle ENNReal NNReal |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT |
| 26 | |
| 27 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T2Space M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 29 | [IsManifold (𝓡 n) ∞ M] |
| 30 | |
| 31 | /-- A smooth extension and finite target distances give one Lipschitz bound on a compact |
| 32 | cell. Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; |
| 33 | project construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 34 | theorem m64_lipschitzOn_cell_of_extension |
| 35 | (g : RiemannianMetric n M) {f F : LoopPlane → M} {S : Set LoopPlane} |
| 36 | (hS : IsCompact S) |
| 37 | (hfinite : ∀ x ∈ S, ∀ y ∈ S, |
| 38 | g.edist (f x) (f y) ≠ (⊤ : ENNReal)) |
| 39 | (hF : ∀ x ∈ S, ContMDiffAt (𝓡 2) (𝓡 n) 1 F x) |
| 40 | (hEq : EqOn f F S) : |
| 41 | ∃ K : ℝ≥0, ∀ x ∈ S, ∀ y ∈ S, |
| 42 | g.edist (f x) (f y) ≤ |
| 43 | (K : ℝ≥0∞) * ENNReal.ofReal ‖x - y‖ := by |
| 44 | let : LocallyCompactSpace M := |
| 45 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 46 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 47 | ⟨g.toRiemannianMetric⟩ |
| 48 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 49 | (TangentSpace (𝓡 n) : M → Type _) := |
| 50 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 51 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 52 | let : IsRiemannianManifold (𝓡 n) M := ⟨fun _ _ => rfl⟩ |
| 53 | have hloc : LocallyLipschitzOn S f := by |
| 54 | intro x hx |
| 55 | obtain ⟨K, U, hU, hK⟩ := |
| 56 | m64_lipschitzOn_nhdsWithin_of_extension g (hF x hx) hEq |
| 57 | refine ⟨K, U ∩ S, |
| 58 | inter_mem (nhdsWithin_le_nhds hU) self_mem_nhdsWithin, ?_⟩ |
| 59 | intro y hy z hz |
| 60 | change g.edist (f y) (f z) ≤ (K : ℝ≥0∞) * edist y z |
| 61 | simpa only [edist_dist, dist_eq_norm] using hK y hy z hz |
| 62 | obtain ⟨K, hK⟩ := M60.exists_lipschitzOnWith_of_compact_edist_ne_top |
| 63 | hS hloc hfinite |
| 64 | refine ⟨K, ?_⟩ |
| 65 | intro x hx y hy |
| 66 | have h := hK hx hy |
| 67 | change g.edist (f x) (f y) ≤ (K : ℝ≥0∞) * edist x y at h |
| 68 | simpa only [edist_dist, dist_eq_norm] using h |
| 69 | |
| 70 | end PoincareMT |