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.Manifold.SmoothDomain.Embedding |
| 2 | import PoincareLib.Geometry.Manifold.ContDiff.CompactCutoff |
| 3 | import PoincareLib.Geometry.Manifold.Sard.Nullity |
| 4 | |
| 5 | /-! |
| 6 | # Compact smooth neighborhoods |
| 7 | |
| 8 | A regular superlevel of a smooth compactly supported cutoff gives a compact |
| 9 | codimension-zero submanifold containing a prescribed compact set in its interior. |
| 10 | Adapted from AxelWorkspace, `MorganTianLib/Foundations/CompactCodimZero.lean`, |
| 11 | revision `f1cdb30cabdc8781d2d3dec86d3d99ab1820f30e`. |
| 12 | See `references/analysis/axel-workspace/regular-domain-reuse.md`. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Function |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | namespace Poincare.Manifold |
| 21 | |
| 22 | /-- A compact set has a compact smooth neighborhood with an actual half-space |
| 23 | atlas on the containing subset and smooth inclusion into the ambient manifold. -/ |
| 24 | theorem exists_compact_smooth_neighborhood |
| 25 | {n : ℕ} {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 26 | [FiniteDimensional ℝ E] {M : Type*} [TopologicalSpace M] |
| 27 | [ChartedSpace E M] [IsManifold 𝓘(ℝ, E) ∞ M] |
| 28 | [T2Space M] [SecondCountableTopology M] |
| 29 | (hn : Module.finrank ℝ E = n + 1) {C : Set M} (hC : IsCompact C) : |
| 30 | ∃ (K : Set M) (CS : ChartedSpace (EuclideanHalfSpace (n + 1)) K), |
| 31 | IsCompact K ∧ C ⊆ interior K ∧ |
| 32 | @IsManifold ℝ _ (EuclideanSpace ℝ (Fin (n + 1))) _ _ |
| 33 | (EuclideanHalfSpace (n + 1)) _ (𝓡∂ (n + 1)) ∞ K _ CS ∧ |
| 34 | _root_.Manifold.IsSmoothEmbedding (𝓡∂ (n + 1)) 𝓘(ℝ, E) ∞ |
| 35 | (Subtype.val : K → M) := by |
| 36 | obtain ⟨f, hf, _, _, _, _, hlevels⟩ := |
| 37 | exists_compact_smooth_cutoff (I := 𝓘(ℝ, E)) hC isOpen_univ (subset_univ C) |
| 38 | obtain ⟨c, hc, hreg⟩ := exists_regular_value_in_interval_of_smooth hf |
| 39 | (I := Ioo (0 : ℝ) 1) isOpen_Ioo ⟨1 / 2, by norm_num, by norm_num⟩ |
| 40 | obtain ⟨hK, hCK, _, _⟩ := hlevels c hc |
| 41 | obtain ⟨K, CS, _, _, heq, _, hman, hemb⟩ := |
| 42 | exists_regular_superlevel_smooth_embedding hn hf c hreg |
| 43 | exact ⟨K, CS, heq.symm ▸ hK, heq.symm ▸ hCK, hman, hemb⟩ |
| 44 | |
| 45 | end Poincare.Manifold |