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 | /-! |
| 4 | # Open subset inclusions are actual local diffeomorphisms |
| 5 | -/ |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | open Set |
| 11 | open scoped Manifold ContDiff Topology |
| 12 | |
| 13 | namespace Poincare.Spacetime.Realization |
| 14 | |
| 15 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 16 | {H : Type*} [TopologicalSpace H] {J : ModelWithCorners ℝ E H} |
| 17 | {M : Type*} [TopologicalSpace M] [ChartedSpace H M] |
| 18 | |
| 19 | theorem openSubset_localDiffeomorph (U : TopologicalSpace.Opens M) : |
| 20 | IsLocalDiffeomorph J J ∞ (Subtype.val : U → M) := by |
| 21 | intro x |
| 22 | let e := U.openPartialHomeomorphSubtypeCoe ⟨x⟩ |
| 23 | have hi : ContMDiffOn J J ∞ e.symm e.target := by |
| 24 | intro p hp |
| 25 | apply (ContMDiffWithinAt.subtypeVal_comp_iff U e.symm e.target p).mp |
| 26 | apply contMDiffWithinAt_id.congr_of_mem _ hp |
| 27 | intro q hq |
| 28 | exact e.right_inv hq |
| 29 | exact ⟨{ |
| 30 | toPartialEquiv := e.toPartialEquiv |
| 31 | open_source := e.open_source |
| 32 | open_target := e.open_target |
| 33 | contMDiffOn_toFun := contMDiff_subtype_val.contMDiffOn |
| 34 | contMDiffOn_invFun := hi |
| 35 | }, mem_univ x, fun _ _ ↦ rfl⟩ |
| 36 | |
| 37 | theorem openSubset_differential_injective (U : TopologicalSpace.Opens M) (x : U) : |
| 38 | Function.Injective (mfderiv J J (Subtype.val : U → M) x) := |
| 39 | ((openSubset_localDiffeomorph (J := J) U x).mfderivToContinuousLinearEquiv (by simp)).injective |
| 40 | |
| 41 | end Poincare.Spacetime.Realization |