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.CutGeometry.Sides |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.Terminal.Ends.Orientation |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.Terminal.Ends.EndCorrespondence |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.Flow.TerminalPolicy |
| 5 | |
| 6 | /-! |
| 7 | # Orienting an actual escaping horn cut |
| 8 | |
| 9 | An escaping ambient side determines a surgery end cut, after reversing the |
| 10 | given neck when necessary. For an arbitrary selected horn cut the only |
| 11 | remaining alternative is a compact region inside the horn bounded by the |
| 12 | same central sphere. All data in the escaping case are preserved literally. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.EpsilonNeck |
| 24 | |
| 25 | variable {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 27 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 28 | {g : RiemannianMetric 3 M} |
| 29 | |
| 30 | private theorem exists_endCut_of_positive_frontier_region (N : EpsilonNeck g) |
| 31 | (hsep : N.IsSeparating) {V : Set M} (hVo : IsOpen V) (hVc : IsConnected V) |
| 32 | (hfV : frontier V = N.central_sphere) |
| 33 | (hescape : ∀ K : Set M, IsCompact K → ¬ V ⊆ K) |
| 34 | {q : M} (hqV : q ∈ V) (hq : q ∈ N.region 0 N.epsilon⁻¹) : |
| 35 | ∃ D : SurgeryEndCut N, D.tail = V := by |
| 36 | have hVS : V ⊆ N.central_sphereᶜ := by |
| 37 | intro x hx hs |
| 38 | exact (hfV.symm ▸ hs).2 (hVo.interior_eq.symm ▸ hx) |
| 39 | have heq : V = connectedComponentIn N.central_sphereᶜ q := by |
| 40 | apply Subset.antisymm (hVc.isPreconnected.subset_connectedComponentIn hqV hVS) |
| 41 | apply (Poincare.Topology.preconnected_subset_interior_of_disjoint_frontier |
| 42 | isPreconnected_connectedComponentIn ?_ ?_).trans interior_subset |
| 43 | · apply disjoint_left.mpr |
| 44 | intro x hx hxf |
| 45 | exact connectedComponentIn_subset _ _ hx (hfV ▸ hxf) |
| 46 | · exact ⟨q, mem_connectedComponentIn (hVS hqV), hVo.interior_eq.symm ▸ hqV⟩ |
| 47 | have hi := inv_pos.mpr N.epsilon_pos |
| 48 | obtain ⟨p, hp⟩ := (N.isConnected_region le_rfl hi.le (neg_lt_zero.mpr hi)).nonempty |
| 49 | obtain ⟨_, _, _, _, hdis, hneg, hpos, _, _, _, _⟩ := |
| 50 | N.complementary_component_frontiers hsep hp hq |
| 51 | refine ⟨{ |
| 52 | point := q |
| 53 | point_positive := hq |
| 54 | tail := V |
| 55 | component_eq := heq |
| 56 | frontier_eq := hfV |
| 57 | escapes_compact := hescape |
| 58 | positive_subset := ?_ |
| 59 | negative_disjoint := ?_ }, rfl⟩ |
| 60 | · rwa [heq] |
| 61 | · rw [heq] |
| 62 | exact hdis.mono_left hneg |
| 63 | |
| 64 | /-- The sign of a separating neck can be chosen so that its positive half |
| 65 | points into the given escaping region. The region itself is unchanged. -/ |
| 66 | theorem exists_oriented_endCut_of_frontier_region (N : EpsilonNeck g) |
| 67 | (hsep : N.IsSeparating) {V : Set M} (hVo : IsOpen V) (hVc : IsConnected V) |
| 68 | (hfV : frontier V = N.central_sphere) |
| 69 | (hescape : ∀ K : Set M, IsCompact K → ¬ V ⊆ K) : |
| 70 | (∃ D : SurgeryEndCut N, D.tail = V) ∨ |
| 71 | (∃ D : SurgeryEndCut N.reversed, D.tail = V) := by |
| 72 | have hc : N.center ∈ closure V := |
| 73 | frontier_subset_closure (hfV.symm ▸ N.center_on_central_sphere) |
| 74 | obtain ⟨q, hqN, hqV⟩ := mem_closure_iff.mp hc N.carrier N.carrier_open |
| 75 | (N.central_sphere_subset N.center_on_central_sphere) |
| 76 | rcases N.carrier_subset_region_union_central_union_region hqN with (hneg | hs) | hpos |
| 77 | · right |
| 78 | apply exists_endCut_of_positive_frontier_region N.reversed |
| 79 | (N.reversed_isSeparating.mpr hsep) hVo hVc hfV hescape hqV |
| 80 | simpa only [reversed_region, reversed_epsilon, neg_inv, neg_zero] using hneg |
| 81 | · exact False.elim ((hfV.symm ▸ hs).2 (hVo.interior_eq.symm ▸ hqV)) |
| 82 | · exact Or.inl (exists_endCut_of_positive_frontier_region N hsep hVo hVc hfV hescape hqV hpos) |
| 83 | |
| 84 | end PoincareMT.EpsilonNeck |
| 85 | |
| 86 | namespace PoincareMT.HornEndCut |
| 87 | |
| 88 | variable {F : GeneralizedRicciFlowData.{u}} {T epsilon delta rho : ℝ} |
| 89 | {E : GeneralizedFlowExtension F T} {horn : StrongHorn E epsilon} |
| 90 | {N : TerminalStrongNeck E delta} |
| 91 | |
| 92 | /-- A contained actual horn cut gives an exactly oriented surgery end cut, |
| 93 | unless the chosen sphere bounds a compact region contained in the horn. |
| 94 | There is no additional neck-accuracy hypothesis. -/ |
| 95 | theorem exists_oriented_surgeryEndCut_or_compact_filling (cut : HornEndCut horn N rho) |
| 96 | (hdelta : delta < 1 / 2) (hN : N.carrier ⊆ horn.carrier) : |
| 97 | (∃ D : SurgeryEndCut (N.spatialNeck hdelta), D.tail = cut.carrier) ∨ |
| 98 | (∃ D : SurgeryEndCut (N.reversed.spatialNeck hdelta), D.tail = cut.carrier) ∨ |
| 99 | ∃ K : Set (E.extended.slice T).carrier, IsCompact K ∧ K ⊆ horn.carrier ∧ |
| 100 | frontier K = N.central_sphere ∧ (interior K).Nonempty := by |
| 101 | obtain ⟨U, V, _, hVo, _, hVc, _, _, _, hfV, hfcV, hiV, _, hVH, _, halt⟩ := |
| 102 | horn.exists_contained_neck_partition N hdelta hN |
| 103 | rcases halt with he | hcompact |
| 104 | · have hVC : V = cut.carrier := he.trans cut.carrier_eq_escapingComponent.symm |
| 105 | have hescape : ∀ K : Set (E.extended.slice T).carrier, IsCompact K → ¬ V ⊆ K := by |
| 106 | simpa only [hVC] using cut.escapes_compact |
| 107 | rcases (N.spatialNeck hdelta).exists_oriented_endCut_of_frontier_region |
| 108 | (horn.contained_neck_isSeparating N hdelta hN) hVo hVc hfV hescape with h | h |
| 109 | · exact Or.inl (by simpa only [hVC] using h) |
| 110 | · exact Or.inr (Or.inl (by simpa only [N.reversed_spatialNeck hdelta, hVC] using h)) |
| 111 | · exact Or.inr (Or.inr ⟨closure V, hcompact, hVH, hfcV, hiV⟩) |
| 112 | |
| 113 | end PoincareMT.HornEndCut |