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.ContMDiff.Basic |
| 2 | |
| 3 | /-! |
| 4 | # Totalizing a map defined on an open submanifold |
| 5 | |
| 6 | Values outside the open domain are irrelevant to local smoothness inside it. |
| 7 | This elementary adapter lets the punctured-plane approximation supply the |
| 8 | total extension field of a C1 loop. Source: the approximation derivation |
| 9 | for MT Claim 18.16, printed p. 430. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Topology |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | namespace PoincareMT.Proofs.M59 |
| 19 | |
| 20 | variable {E H X F K M : Type*} |
| 21 | [NormedAddCommGroup E] [NormedSpace ℝ E] [TopologicalSpace H] |
| 22 | {I : ModelWithCorners ℝ E H} |
| 23 | [TopologicalSpace X] [ChartedSpace H X] |
| 24 | [NormedAddCommGroup F] [NormedSpace ℝ F] [TopologicalSpace K] |
| 25 | {J : ModelWithCorners ℝ F K} |
| 26 | [TopologicalSpace M] [ChartedSpace K M] |
| 27 | |
| 28 | /-- Extend a map by a chosen value outside its open domain. |
| 29 | Source: the total-loop-extension convention of MT, pp. 429-430. -/ |
| 30 | def openMapExtension (U : TopologicalSpace.Opens X) (g : U → M) (p : M) (x : X) : M := by |
| 31 | classical |
| 32 | exact if hx : x ∈ U then g ⟨x, hx⟩ else p |
| 33 | |
| 34 | omit [TopologicalSpace M] in |
| 35 | /-- On the open domain the totalization is the original map. |
| 36 | Source: MT Claim 18.16, p. 430, approximation derivation. -/ |
| 37 | theorem openMapExtension_apply (U : TopologicalSpace.Opens X) (g : U → M) (p : M) (x : U) : |
| 38 | openMapExtension U g p x.val = g x := by |
| 39 | simp only [openMapExtension, dif_pos x.property] |
| 40 | |
| 41 | /-- Totalization retains smoothness at every point of the open domain. |
| 42 | Source: MT Claim 18.16, p. 430, approximation derivation. -/ |
| 43 | theorem contMDiffAt_openMapExtension (U : TopologicalSpace.Opens X) (g : U → M) (p : M) |
| 44 | (x : U) {n : ℕ∞ω} (hg : ContMDiffAt I J n g x) : |
| 45 | ContMDiffAt I J n (openMapExtension U g p) x.val := by |
| 46 | apply (contMDiffAt_subtype_iff (U := U) (x := x)).mp |
| 47 | have heq : (fun y : U => openMapExtension U g p y.val) = g := |
| 48 | funext (openMapExtension_apply U g p) |
| 49 | rw [heq] |
| 50 | exact hg |
| 51 | |
| 52 | end PoincareMT.Proofs.M59 |