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 Mathlib.Geometry.Manifold.LocalDiffeomorph |
| 2 | |
| 3 | /-! # The inclusion of an open submanifold is a local diffeomorphism -/ |
| 4 | |
| 5 | set_option autoImplicit false |
| 6 | |
| 7 | open Set TopologicalSpace |
| 8 | open scoped Manifold ContDiff Topology |
| 9 | |
| 10 | namespace Poincare |
| 11 | |
| 12 | /-- The inherited atlas makes an open-submanifold inclusion a local |
| 13 | diffeomorphism, including when the open set is empty. -/ |
| 14 | theorem isLocalDiffeomorph_opensSubtypeVal |
| 15 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 16 | {H : Type*} [TopologicalSpace H] (I : ModelWithCorners ℝ E H) |
| 17 | {M : Type*} [TopologicalSpace M] [ChartedSpace H M] |
| 18 | (U : Opens M) : IsLocalDiffeomorph I I ∞ (Subtype.val : U → M) := by |
| 19 | intro x |
| 20 | let : Nonempty U := ⟨x⟩ |
| 21 | let e := U.isOpen.isOpenEmbedding_subtypeVal.toOpenPartialHomeomorph |
| 22 | let d : PartialDiffeomorph I I U M ∞ := |
| 23 | { toPartialEquiv := e.toPartialEquiv |
| 24 | open_source := e.open_source |
| 25 | open_target := e.open_target |
| 26 | contMDiffOn_toFun := contMDiff_subtype_val.contMDiffOn |
| 27 | contMDiffOn_invFun := by |
| 28 | intro y hy |
| 29 | apply (ContMDiffWithinAt.subtypeVal_comp_iff U e.symm e.target y).mp |
| 30 | apply contMDiffWithinAt_id.congr |
| 31 | · intro z hz |
| 32 | exact e.right_inv hz |
| 33 | · exact e.right_inv hy } |
| 34 | exact ⟨d, mem_univ x, fun _ _ => rfl⟩ |
| 35 | |
| 36 | end Poincare |