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.Continuation.Construction.Terminal.Ends.RetainedCompactness.FiniteSubcoverTraces |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.Terminal.Ends.RetainedCompactness.TerminalEnd |
| 3 | |
| 4 | /-! |
| 5 | # A finite cover of the actual terminal ends |
| 6 | |
| 7 | Any family eventually covering every original end covers the terminal |
| 8 | component modulo a compact set after choosing finitely many members. For |
| 9 | open regions, the uncovered remainder is itself compact. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | universe u v |
| 18 | |
| 19 | namespace PoincareMT.TerminalComponentPath |
| 20 | |
| 21 | variable {F : GeneralizedRicciFlowData.{u}} {T : ℝ} |
| 22 | {E : GeneralizedFlowExtension F T} (K : TerminalComponentPath E) |
| 23 | |
| 24 | theorem exists_finite_cover_modulo_compact {ι : Type v} |
| 25 | (V : ι → Set (E.extended.slice T).carrier) |
| 26 | (hcover : ∀ e : TerminalEnd K, ∃ i n, Subtype.val '' e.tail n ⊆ V i) : |
| 27 | ∃ (s : Finset ι) (L : Set (E.extended.slice T).carrier), |
| 28 | IsCompact L ∧ K.component ⊆ L ∪ ⋃ i ∈ s, V i := by |
| 29 | classical |
| 30 | let : LocallyConnectedSpace (E.extended.slice T).carrier := |
| 31 | ChartedSpace.locallyConnectedSpace (EuclideanSpace ℝ (Fin 3)) _ |
| 32 | let : LocallyCompactSpace (E.extended.slice T).carrier := |
| 33 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin 3)) _ |
| 34 | have hKo : IsOpen K.component := K.component_eq.symm ▸ isOpen_connectedComponent |
| 35 | have hKc : IsClosed K.component := K.component_eq.symm ▸ isClosed_connectedComponent |
| 36 | let : LocallyConnectedSpace K.component := hKo.locallyConnectedSpace |
| 37 | let : LocallyCompactSpace K.component := hKc.locallyCompactSpace |
| 38 | let : PreconnectedSpace K.component := isPreconnected_iff_preconnectedSpace.mp |
| 39 | (K.component_eq.symm ▸ isPreconnected_connectedComponent) |
| 40 | let C : CompactExhaustion K.component := CompactExhaustion.choice K.component |
| 41 | let W : ι → Set K.component := fun i => Subtype.val ⁻¹' V i |
| 42 | have hfinite : ∃ (s : Finset ι) (L : Set K.component), |
| 43 | IsCompact L ∧ univ ⊆ L ∪ ⋃ i ∈ s, W i := by |
| 44 | by_contra h |
| 45 | push Not at h |
| 46 | obtain ⟨p, hp, hnest, htrace⟩ := |
| 47 | Poincare.Topology.exists_nested_component_traces_without_finite_cover C W h |
| 48 | let e : TerminalEnd K := { |
| 49 | exhaustion := C |
| 50 | tail := fun n => connectedComponentIn (C n)ᶜ (p n) |
| 51 | tail_component := fun n => ⟨p n, hp n, rfl⟩ |
| 52 | nested := hnest |
| 53 | escapes_compact := by |
| 54 | intro n L hL hsub |
| 55 | apply htrace n ∅ L hL |
| 56 | simpa only [univ_inter, Finset.notMem_empty, iUnion_of_empty, |
| 57 | iUnion_empty, union_empty] using hsub } |
| 58 | obtain ⟨i, n, hn⟩ := hcover e |
| 59 | apply htrace n {i} ∅ isCompact_empty |
| 60 | intro x hx |
| 61 | exact Or.inr (mem_iUnion₂.mpr ⟨i, Finset.mem_singleton_self _, hn ⟨x, hx.2, rfl⟩⟩) |
| 62 | obtain ⟨s, L, hL, hsub⟩ := hfinite |
| 63 | refine ⟨s, Subtype.val '' L, hL.image continuous_subtype_val, ?_⟩ |
| 64 | intro x hx |
| 65 | rcases hsub (mem_univ (⟨x, hx⟩ : K.component)) with hxL | hxV |
| 66 | · exact Or.inl ⟨⟨x, hx⟩, hxL, rfl⟩ |
| 67 | · obtain ⟨i, hi, hxi⟩ := mem_iUnion₂.mp hxV |
| 68 | exact Or.inr (mem_iUnion₂.mpr ⟨i, hi, hxi⟩) |
| 69 | |
| 70 | /-- An arbitrary open end cover has a finite subfamily with compact remainder. -/ |
| 71 | theorem exists_finite_isCompact_diff_of_end_tail_cover {ι : Type v} |
| 72 | (V : ι → Set (E.extended.slice T).carrier) (hV : ∀ i, IsOpen (V i)) |
| 73 | (hcover : ∀ e : TerminalEnd K, ∃ i n, Subtype.val '' e.tail n ⊆ V i) : |
| 74 | ∃ s : Finset ι, IsCompact (K.component \ ⋃ i ∈ s, V i) := by |
| 75 | obtain ⟨s, L, hL, hsub⟩ := K.exists_finite_cover_modulo_compact V hcover |
| 76 | refine ⟨s, hL.of_isClosed_subset ?_ ?_⟩ |
| 77 | · exact (K.component_eq.symm ▸ isClosed_connectedComponent).sdiff |
| 78 | (isOpen_iUnion fun i => isOpen_iUnion fun _ => hV i) |
| 79 | · intro x hx |
| 80 | exact (hsub hx.1).resolve_right hx.2 |
| 81 | |
| 82 | end PoincareMT.TerminalComponentPath |