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.Compact |
| 2 | import PoincareLib.Geometry.Manifold.SmoothDomain.Component |
| 3 | import PoincareLib.Geometry.Manifold.SmoothDomain.FromEmbedding |
| 4 | import PoincareLib.Topology.Exhaustion |
| 5 | |
| 6 | /-! |
| 7 | # Exhaustions by smooth domains |
| 8 | |
| 9 | Regular superlevels of compact cutoffs, followed by connected components, |
| 10 | give smooth domains containing arbitrary compact sets. Repeated enlargement |
| 11 | produces an exhaustion with nested closures. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | namespace Poincare.Manifold |
| 20 | |
| 21 | private theorem exists_connected_compact_superset |
| 22 | {M : Type*} [TopologicalSpace M] [T2Space M] |
| 23 | [SecondCountableTopology M] [LocallyCompactSpace M] [LocallyConnectedSpace M] |
| 24 | [PreconnectedSpace M] (base : M) {C : Set M} (hC : IsCompact C) : |
| 25 | ∃ L : Set M, IsCompact L ∧ IsConnected L ∧ C ⊆ L := by |
| 26 | obtain ⟨U, ho, hc, hk, hnest, hcover, _⟩ := |
| 27 | Poincare.exists_connected_open_exhaustion base |
| 28 | have hmono : Monotone U := monotone_nat_of_le_succ hnest |
| 29 | obtain ⟨j, hj⟩ := hC.elim_directed_cover U ho (by rw [hcover]; exact subset_univ C) |
| 30 | hmono.directed_le |
| 31 | exact ⟨closure (U j), hk j, (hc j).closure, hj.trans subset_closure⟩ |
| 32 | |
| 33 | /-- Every compact subset lies in a connected relatively compact smooth domain |
| 34 | with nonempty boundary. -/ |
| 35 | theorem exists_smoothDomain_superset |
| 36 | {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] |
| 37 | [SecondCountableTopology M] |
| 38 | [ChartedSpace (EuclideanSpace ℝ (Fin (n + 1))) M] |
| 39 | [IsManifold (𝓡 (n + 1)) ∞ M] |
| 40 | [PreconnectedSpace M] [NoncompactSpace M] |
| 41 | {C : Set M} (hC : IsCompact C) : |
| 42 | ∃ Ω : Set M, Nonempty (SmoothDomain (n + 1) Ω) ∧ C ⊆ Ω := by |
| 43 | have : Nonempty M := by |
| 44 | by_contra h |
| 45 | let : IsEmpty M := not_nonempty_iff.mp h |
| 46 | exact NoncompactSpace.noncompact_univ (X := M) isCompact_univ |
| 47 | let : LocallyCompactSpace M := |
| 48 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin (n + 1))) M |
| 49 | let : LocallyConnectedSpace M := |
| 50 | ChartedSpace.locallyConnectedSpace (EuclideanSpace ℝ (Fin (n + 1))) M |
| 51 | obtain ⟨L, hL, hconn, hCL⟩ := |
| 52 | exists_connected_compact_superset (Classical.arbitrary M) hC |
| 53 | obtain ⟨K, CS, hK, hLK, hman, hemb⟩ := |
| 54 | exists_compact_smooth_neighborhood (n := n) |
| 55 | (E := EuclideanSpace ℝ (Fin (n + 1))) (by simp) hL |
| 56 | let := CS |
| 57 | let := hman |
| 58 | obtain ⟨V, VS, _, hV, hcV, hLV, hmV, heV⟩ := |
| 59 | exists_connected_smooth_component hK hemb hconn hLK |
| 60 | let := VS |
| 61 | let := hmV |
| 62 | exact ⟨interior V, nonempty_smoothDomain_interior hV hcV heV, hCL.trans hLV⟩ |
| 63 | |
| 64 | /-- A connected noncompact smooth manifold admits smooth domains with nested |
| 65 | closures that exhaust the entire manifold. -/ |
| 66 | theorem exists_smoothDomain_exhaustion |
| 67 | {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] |
| 68 | [SecondCountableTopology M] |
| 69 | [ChartedSpace (EuclideanSpace ℝ (Fin (n + 1))) M] |
| 70 | [IsManifold (𝓡 (n + 1)) ∞ M] |
| 71 | [PreconnectedSpace M] [NoncompactSpace M] : |
| 72 | ∃ Ω : ℕ → Set M, |
| 73 | (∀ j, Nonempty (SmoothDomain (n + 1) (Ω j))) ∧ |
| 74 | (∀ j, closure (Ω j) ⊆ Ω (j + 1)) ∧ |
| 75 | (⋃ j, Ω j) = univ := by |
| 76 | classical |
| 77 | let : LocallyCompactSpace M := |
| 78 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin (n + 1))) M |
| 79 | let K := CompactExhaustion.choice M |
| 80 | choose F hF hCF using fun C : {C : Set M // IsCompact C} => |
| 81 | exists_smoothDomain_superset (n := n) C.property |
| 82 | let V : ℕ → {Ω : Set M // Nonempty (SmoothDomain (n + 1) Ω)} := |
| 83 | Nat.rec ⟨F ⟨K 0, K.isCompact 0⟩, hF _⟩ fun j prev => |
| 84 | let C : {C : Set M // IsCompact C} := |
| 85 | ⟨closure prev.val ∪ K (j + 1), |
| 86 | prev.property.some.isCompact_closure.union (K.isCompact _)⟩ |
| 87 | ⟨F C, hF C⟩ |
| 88 | refine ⟨fun j => (V j).val, fun j => (V j).property, ?_, ?_⟩ |
| 89 | · intro j x hx |
| 90 | exact hCF ⟨closure (V j).val ∪ K (j + 1), |
| 91 | (V j).property.some.isCompact_closure.union (K.isCompact _)⟩ (Or.inl hx) |
| 92 | · apply iUnion_eq_univ_iff.mpr |
| 93 | intro x |
| 94 | obtain ⟨j, hj⟩ := K.exists_mem x |
| 95 | refine ⟨j, ?_⟩ |
| 96 | cases j with |
| 97 | | zero => exact hCF _ hj |
| 98 | | succ j => exact hCF _ (Or.inr hj) |
| 99 | |
| 100 | end Poincare.Manifold |