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.Manifold.ConnectedComponent |
| 2 | import Mathlib.Geometry.Manifold.Diffeomorph |
| 3 | import Mathlib.Geometry.Manifold.Instances.Real |
| 4 | |
| 5 | /-! # Restricting smooth equivalences to connected components -/ |
| 6 | |
| 7 | noncomputable section |
| 8 | set_option autoImplicit false |
| 9 | open Set |
| 10 | open scoped Manifold ContDiff Topology |
| 11 | |
| 12 | namespace Poincare |
| 13 | |
| 14 | variable {n m : ℕ} {M N : Type*} [TopologicalSpace M] [TopologicalSpace N] |
| 15 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 16 | [ChartedSpace (EuclideanSpace ℝ (Fin m)) N] |
| 17 | |
| 18 | /-- A smooth equivalence restricts to the actual connected components. -/ |
| 19 | def connectedComponentDiffeomorph (e : M ≃ₘ⟮𝓡 n, 𝓡 m⟯ N) (p : M) : |
| 20 | connectedComponentOpens (EuclideanSpace ℝ (Fin n)) p ≃ₘ⟮𝓡 n, 𝓡 m⟯ |
| 21 | connectedComponentOpens (EuclideanSpace ℝ (Fin m)) (e p) := by |
| 22 | let U := connectedComponentOpens (EuclideanSpace ℝ (Fin n)) p |
| 23 | let V := connectedComponentOpens (EuclideanSpace ℝ (Fin m)) (e p) |
| 24 | let E : U ≃ V := |
| 25 | { toFun := fun x => ⟨e x.val, e.continuous.mapsTo_connectedComponent p x.property⟩ |
| 26 | invFun := fun y => ⟨e.symm y.val, by |
| 27 | have hy := e.symm.continuous.mapsTo_connectedComponent (e p) y.property |
| 28 | change e.symm y.val ∈ connectedComponent p |
| 29 | simpa only [e.symm_apply_apply] using hy⟩ |
| 30 | left_inv := fun x => Subtype.ext (e.symm_apply_apply x.val) |
| 31 | right_inv := fun y => Subtype.ext (e.apply_symm_apply y.val) } |
| 32 | refine { E with contMDiff_toFun := ?_, contMDiff_invFun := ?_ } |
| 33 | · apply (ContMDiff.subtypeVal_comp_iff V E).mp |
| 34 | exact e.contMDiff.comp contMDiff_subtype_val |
| 35 | · apply (ContMDiff.subtypeVal_comp_iff U E.symm).mp |
| 36 | exact e.symm.contMDiff.comp contMDiff_subtype_val |
| 37 | |
| 38 | @[simp] theorem connectedComponentDiffeomorph_val |
| 39 | (e : M ≃ₘ⟮𝓡 n, 𝓡 m⟯ N) (p : M) |
| 40 | (x : connectedComponentOpens (EuclideanSpace ℝ (Fin n)) p) : |
| 41 | (connectedComponentDiffeomorph e p x).val = e x.val := rfl |
| 42 | |
| 43 | end Poincare |
| 44 |