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.CanonicalNeighborhood.Neck.Separation.Ambient |
| 2 | import Mathlib.Topology.OpenPartialHomeomorph.IsImage |
| 3 | |
| 4 | /-! |
| 5 | # The actual bounded side of a neck captured in one chart |
| 6 | |
| 7 | Compact closure inside the chart target preserves the exact central-sphere |
| 8 | frontier under the original inverse. No global Euclidean structure on the |
| 9 | ambient manifold is required. MT Proposition 17.1; |
| 10 | limit-finite-local-separation.md, T4. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Metric |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M47 |
| 21 | |
| 22 | private theorem finite_bounded_side_subset_ball |
| 23 | {S A B : Set (EuclideanSpace ℝ (Fin 3))} {r : ℝ} (hr : 0 < r) |
| 24 | (hSr : S ⊆ ball 0 r) (hA : IsOpen A) (hB : IsOpen B) |
| 25 | (hdis : Disjoint A B) (hcover : A ∪ B = Sᶜ) (hbounded : Bornology.IsBounded A) : |
| 26 | A ⊆ ball 0 r := by |
| 27 | have hout : {x : EuclideanSpace ℝ (Fin 3) | r ≤ ‖x‖} ⊆ A ∪ B := by |
| 28 | intro x hx |
| 29 | rw [hcover] |
| 30 | intro hxS |
| 31 | have h := hSr hxS |
| 32 | simp only [mem_ball, dist_zero_right] at h |
| 33 | exact (not_le_of_gt h) hx |
| 34 | have hpre := Poincare.Topology.isPreconnected_norm_ge |
| 35 | (E := EuclideanSpace ℝ (Fin 3)) (by rw [← Module.finrank_eq_rank]; simp) hr |
| 36 | rcases hpre.subset_or_subset hA hB hdis hout with hleft | hright |
| 37 | · have hwhole : (univ : Set (EuclideanSpace ℝ (Fin 3))) ⊆ ball 0 r ∪ A := by |
| 38 | intro x _ |
| 39 | by_cases hx : ‖x‖ < r |
| 40 | · exact Or.inl (by simpa only [mem_ball, dist_zero_right] using hx) |
| 41 | · exact Or.inr (hleft (le_of_not_gt hx)) |
| 42 | exact False.elim (NormedSpace.unbounded_univ ℝ (EuclideanSpace ℝ (Fin 3)) |
| 43 | ((isBounded_ball.union hbounded).subset hwhole)) |
| 44 | · intro x hx |
| 45 | simp only [mem_ball, dist_zero_right] |
| 46 | by_contra h |
| 47 | exact Set.disjoint_left.mp hdis hx (hright (le_of_not_gt h)) |
| 48 | |
| 49 | private theorem finite_inverse_frontier |
| 50 | {M : Type u} [TopologicalSpace M] [T2Space M] |
| 51 | (c : OpenPartialHomeomorph M (EuclideanSpace ℝ (Fin 3))) |
| 52 | {B : Set (EuclideanSpace ℝ (Fin 3))} (hcompact : IsCompact (closure B)) |
| 53 | (htarget : closure B ⊆ c.target) : |
| 54 | IsCompact (closure (c.symm '' B)) ∧ |
| 55 | frontier (c.symm '' B) = c.symm '' frontier B := by |
| 56 | have himage : c.symm.IsImage B (c.symm '' B) := by |
| 57 | intro x hx |
| 58 | constructor |
| 59 | · rintro ⟨y, hy, hxy⟩ |
| 60 | exact (c.symm.injOn (htarget (subset_closure hy)) hx hxy) ▸ hy |
| 61 | · exact mem_image_of_mem c.symm |
| 62 | have hclosure : closure (c.symm '' B) = c.symm '' closure B := |
| 63 | (image_closure_of_isCompact hcompact (c.symm.continuousOn.mono htarget)).symm |
| 64 | have hsource : closure (c.symm '' B) ⊆ c.source := by |
| 65 | rw [hclosure] |
| 66 | rintro _ ⟨x, hx, rfl⟩ |
| 67 | exact c.map_target (htarget hx) |
| 68 | refine ⟨?_, ?_⟩ |
| 69 | · rw [hclosure] |
| 70 | exact hcompact.image_of_continuousOn (c.symm.continuousOn.mono htarget) |
| 71 | · symm |
| 72 | simpa only [OpenPartialHomeomorph.symm_source, OpenPartialHomeomorph.symm_target, |
| 73 | inter_eq_right.mpr (frontier_subset_closure.trans htarget), |
| 74 | inter_eq_right.mpr (frontier_subset_closure.trans hsource)] using |
| 75 | himage.frontier.image_eq |
| 76 | |
| 77 | /-- A neck captured in one actual chart has a compactly contained open |
| 78 | side with precisely its central sphere as frontier and one whole signed half. -/ |
| 79 | theorem limitFinite_neck_local_bounded_side |
| 80 | {M : Type u} [TopologicalSpace M] |
| 81 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 82 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 83 | {g : RiemannianMetric 3 M} (N : EpsilonNeck g) |
| 84 | (c : OpenPartialHomeomorph M (EuclideanSpace ℝ (Fin 3))) |
| 85 | (hcapture : N.carrier ⊆ c.source) {r : ℝ} (hr : 0 < r) |
| 86 | (htarget : closedBall (0 : EuclideanSpace ℝ (Fin 3)) r ⊆ c.target) |
| 87 | (hsphere : c '' N.central_sphere ⊆ ball 0 r) : |
| 88 | ∃ A : Set M, IsOpen A ∧ IsCompact (closure A) ∧ |
| 89 | A ⊆ c.symm '' ball 0 r ∧ frontier A = N.central_sphere ∧ |
| 90 | (N.region (-N.epsilon⁻¹) 0 ⊆ A ∨ N.region 0 N.epsilon⁻¹ ⊆ A) := by |
| 91 | let : ConnectedSpace UnitTwoSphere := by |
| 92 | apply isConnected_iff_connectedSpace.mp |
| 93 | exact isConnected_sphere |
| 94 | (by rw [← Module.finrank_eq_rank]; norm_num) 0 (by norm_num) |
| 95 | let e : NeckDomain N.epsilon ≃ₜ (c '' N.carrier) := |
| 96 | N.coordinate.trans (c.homeomorphOfImageSubsetSource hcapture rfl) |
| 97 | have hcenter : range (fun y : UnitTwoSphere => |
| 98 | (e (y, ⟨0, neg_lt_zero.mpr (inv_pos.mpr N.epsilon_pos), |
| 99 | inv_pos.mpr N.epsilon_pos⟩) : EuclideanSpace ℝ (Fin 3))) = |
| 100 | c '' N.central_sphere := by |
| 101 | change range (fun y : UnitTwoSphere => c (N.coordinate |
| 102 | (y, ⟨0, neg_lt_zero.mpr (inv_pos.mpr N.epsilon_pos), |
| 103 | inv_pos.mpr N.epsilon_pos⟩) : M)) = _ |
| 104 | rw [Set.range_comp', N.coordinate_central_range] |
| 105 | have hnegative : (fun z : NeckDomain N.epsilon => |
| 106 | (e z : EuclideanSpace ℝ (Fin 3))) '' {z | (z.2 : ℝ) < 0} = |
| 107 | c '' N.region (-N.epsilon⁻¹) 0 := by |
| 108 | change (fun z : NeckDomain N.epsilon => c (N.coordinate z : M)) '' _ = _ |
| 109 | rw [← image_image, N.coordinate_negative_image] |
| 110 | have hpositive : (fun z : NeckDomain N.epsilon => |
| 111 | (e z : EuclideanSpace ℝ (Fin 3))) '' {z | 0 < (z.2 : ℝ)} = |
| 112 | c '' N.region 0 N.epsilon⁻¹ := by |
| 113 | change (fun z : NeckDomain N.epsilon => c (N.coordinate z : M)) '' _ = _ |
| 114 | rw [← image_image, N.coordinate_positive_image] |
| 115 | have hsep := Poincare.Topology.exists_collar_complementary_regions |
| 116 | (inv_pos.mpr N.epsilon_pos) |
| 117 | (c.isOpen_image_of_subset_source N.carrier_open hcapture) e |
| 118 | dsimp only at hsep |
| 119 | rw [hcenter, hnegative, hpositive] at hsep |
| 120 | obtain ⟨A, B, hA, hB, _, _, hdis, hcover, hfA, hfB, hneg, hpos⟩ := hsep |
| 121 | have hcompact : IsCompact (c '' N.central_sphere) := |
| 122 | N.isCompact_central_sphere.image_of_continuousOn |
| 123 | (c.continuousOn.mono (N.central_sphere_subset.trans hcapture)) |
| 124 | have hchoice : ∃ V : Set (EuclideanSpace ℝ (Fin 3)), |
| 125 | IsOpen V ∧ Bornology.IsBounded V ∧ V ⊆ ball 0 r ∧ |
| 126 | frontier V = c '' N.central_sphere ∧ |
| 127 | (c '' N.region (-N.epsilon⁻¹) 0 ⊆ V ∨ c '' N.region 0 N.epsilon⁻¹ ⊆ V) := by |
| 128 | rcases Poincare.Topology.bounded_side_of_compact_complement_partition_euclidean_three |
| 129 | hcompact hA hB hdis hcover with ⟨hbound, _⟩ | ⟨hbound, _⟩ |
| 130 | · exact ⟨A, hA, hbound, finite_bounded_side_subset_ball hr hsphere hA hB hdis |
| 131 | hcover hbound, hfA, Or.inl hneg⟩ |
| 132 | · exact ⟨B, hB, hbound, finite_bounded_side_subset_ball hr hsphere hB hA hdis.symm |
| 133 | ((union_comm B A).trans hcover) hbound, hfB, Or.inr hpos⟩ |
| 134 | obtain ⟨V, hV, hVbounded, hVball, hVfront, hVhalf⟩ := hchoice |
| 135 | have hVtarget : closure V ⊆ c.target := |
| 136 | ((closure_mono hVball).trans closure_ball_subset_closedBall).trans htarget |
| 137 | obtain ⟨hcompactInverse, hfrontInverse⟩ := |
| 138 | finite_inverse_frontier c hVbounded.isCompact_closure hVtarget |
| 139 | have hroundtrip : c.symm '' (c '' N.central_sphere) = N.central_sphere := by |
| 140 | ext x |
| 141 | constructor |
| 142 | · rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩ |
| 143 | simpa only [c.left_inv (hcapture (N.central_sphere_subset hy))] using hy |
| 144 | · intro hx |
| 145 | exact ⟨c x, mem_image_of_mem c hx, |
| 146 | c.left_inv (hcapture (N.central_sphere_subset hx))⟩ |
| 147 | refine ⟨c.symm '' V, |
| 148 | c.isOpen_image_symm_of_subset_target hV (subset_closure.trans hVtarget), |
| 149 | hcompactInverse, image_mono hVball, |
| 150 | hfrontInverse.trans (by rw [hVfront, hroundtrip]), ?_⟩ |
| 151 | rcases hVhalf with hnegV | hposV |
| 152 | · left |
| 153 | intro x hx |
| 154 | exact ⟨c x, hnegV (mem_image_of_mem c hx), c.left_inv (hcapture hx.1)⟩ |
| 155 | · right |
| 156 | intro x hx |
| 157 | exact ⟨c x, hposV (mem_image_of_mem c hx), c.left_inv (hcapture hx.1)⟩ |
| 158 | |
| 159 | end PoincareMT.M47 |