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.ManifoldOpenMap |
| 2 | import Mathlib.Analysis.Normed.Module.FiniteDimension |
| 3 | import Mathlib.Topology.Connected.Clopen |
| 4 | |
| 5 | /-! |
| 6 | # Compact manifolds do not immerse in Euclidean space of the same dimension |
| 7 | |
| 8 | An injective differential in equal finite dimension is bijective. The |
| 9 | inverse function theorem makes the image open. A nonempty compact image |
| 10 | would also be closed, hence all of the connected noncompact target. |
| 11 | Source: Morgan-Tian Theorem 12.28, pp. 323-324; the compact-alternative |
| 12 | exclusion in the M34 unit-lifetime derivation, section 4. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | namespace PoincareMT.M34 |
| 21 | |
| 22 | /-- A smooth immersion into an equal-dimensional nonzero real normed |
| 23 | space rules out compactness of its nonempty domain (Theorem 12.28). -/ |
| 24 | theorem not_isCompact_univ_of_euclidean_immersion |
| 25 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 26 | [hfinite : FiniteDimensional ℝ E] [Nontrivial E] |
| 27 | {M : Type*} [TopologicalSpace M] [ChartedSpace E M] |
| 28 | (x0 : M) (f : M → E) (hf : ContMDiff 𝓘(ℝ, E) 𝓘(ℝ, E) ∞ f) |
| 29 | (hinj : ∀ x, Function.Injective (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, E) f x)) : |
| 30 | ¬ IsCompact (univ : Set M) := by |
| 31 | intro hcompact |
| 32 | have hbij (x : M) : Function.Bijective (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, E) f x) := by |
| 33 | let : FiniteDimensional ℝ (TangentSpace 𝓘(ℝ, E) x) := by |
| 34 | unfold TangentSpace |
| 35 | exact hfinite |
| 36 | let : FiniteDimensional ℝ (TangentSpace 𝓘(ℝ, E) (f x)) := by |
| 37 | unfold TangentSpace |
| 38 | exact hfinite |
| 39 | have hd : Module.finrank ℝ (TangentSpace 𝓘(ℝ, E) x) = |
| 40 | Module.finrank ℝ (TangentSpace 𝓘(ℝ, E) (f x)) := rfl |
| 41 | exact ⟨hinj x, (LinearMap.injective_iff_surjective_of_finrank_eq_finrank hd).mp (hinj x)⟩ |
| 42 | have hclosed := hcompact.image hf.continuous |
| 43 | have hopen : IsOpen (f '' univ) := |
| 44 | isOpen_image_of_contMDiffOn_mfderiv_bijective isOpen_univ hf.contMDiffOn |
| 45 | (fun x _ => hbij x) |
| 46 | have hall : f '' univ = univ := |
| 47 | (show IsClopen (f '' univ) from ⟨hclosed.isClosed, hopen⟩).eq_univ |
| 48 | ⟨f x0, x0, mem_univ _, rfl⟩ |
| 49 | exact noncompact_univ E (hall ▸ hclosed) |
| 50 | |
| 51 | end PoincareMT.M34 |