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.RicciFlow.Surgery.StandardCap.Existence.Analysis.Basic.OpenSubsetTransition |
| 2 | import Mathlib.Geometry.Manifold.ContMDiff.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Smooth transitions restricted to an open model subset |
| 6 | |
| 7 | Conjugating a smooth transition by the inclusion chart preserves |
| 8 | smoothness on its exact source. This is the manifold restriction in |
| 9 | Morgan-Tian Theorem 12.5, p. 297, compact-double derivation. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Topology |
| 15 | open scoped Manifold ContDiff |
| 16 | |
| 17 | namespace OpenPartialHomeomorph |
| 18 | |
| 19 | variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] |
| 20 | {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] |
| 21 | {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) |
| 22 | (e : OpenPartialHomeomorph H H) {U : Set H} (hU : IsOpen U) [Nonempty U] |
| 23 | {n : ℕ∞ω} |
| 24 | |
| 25 | /-- Smoothness survives restriction of both source and target to an open |
| 26 | subset of the model (Theorem 12.5, p. 297, compact-double derivation). -/ |
| 27 | theorem contMDiffOn_onOpenSubset (he : ContMDiffOn I I n e e.source) |
| 28 | (htarget : e.target ⊆ U) : |
| 29 | let := hU.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 30 | ContMDiffOn I I n (e.onOpenSubset hU) (e.onOpenSubset hU).source := by |
| 31 | let := hU.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 32 | rw [onOpenSubset_source e hU htarget] |
| 33 | have hc : ContMDiff I I n (Subtype.val : U → H) := |
| 34 | contMDiff_isOpenEmbedding (I := I) hU.isOpenEmbedding_subtypeVal |
| 35 | have hi := contMDiffOn_isOpenEmbedding_symm (I := I) (n := n) |
| 36 | hU.isOpenEmbedding_subtypeVal |
| 37 | have hcomp := he.comp hc.contMDiffOn (fun _ hx => hx) |
| 38 | have hresult := hi.comp hcomp (fun x hx => |
| 39 | (show e (x : H) ∈ range (Subtype.val : U → H) from |
| 40 | ⟨⟨e (x : H), htarget (e.map_source hx)⟩, rfl⟩)) |
| 41 | simpa only [onOpenSubset, coe_trans, |
| 42 | IsOpenEmbedding.toOpenPartialHomeomorph_apply] using hresult |
| 43 | |
| 44 | end OpenPartialHomeomorph |