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.Flow.Basic |
| 2 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Neck.NeckCoordinates |
| 3 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Topology.FiniteComponents |
| 4 | import Mathlib.Analysis.Normed.Module.Connected |
| 5 | |
| 6 | /-! |
| 7 | Adapted from Mapher `PoincareMT/Proofs/M49/EventComponents.lean` at |
| 8 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 9 | |
| 10 | # Component counts at an actual surgery event |
| 11 | |
| 12 | Morgan-Tian Lemma 17.12, pp. 410-411. The retained region has one |
| 13 | connected boundary sphere per cut, and every post-surgery component |
| 14 | meets its actual image. An explicit omitted pre-component gives the |
| 15 | strict decrease for a zero-cap event. Finiteness is proved before |
| 16 | using natural-number component counts. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open Set |
| 22 | open scoped Manifold ContDiff Topology |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.SurgeryVolume |
| 27 | |
| 28 | variable {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 30 | {g : RiemannianMetric 3 M} |
| 31 | |
| 32 | /-- The actual central sphere is connected (MT Definition 2.18, p. 31; |
| 33 | component counting in Lemma 17.12, pp. 410-411). -/ |
| 34 | theorem epsilonNeck_isConnected_central_sphere (N : EpsilonNeck g) : |
| 35 | IsConnected N.central_sphere := by |
| 36 | have hdim : 1 < Module.rank ℝ (EuclideanSpace ℝ (Fin 3)) := by |
| 37 | rw [← Module.finrank_eq_rank] |
| 38 | norm_num |
| 39 | let : ConnectedSpace UnitTwoSphere := |
| 40 | Subtype.connectedSpace (isConnected_sphere hdim (0 : EuclideanSpace ℝ (Fin 3)) |
| 41 | (by norm_num : (0 : ℝ) ≤ 1)) |
| 42 | rw [N.central_sphere_eq] |
| 43 | refine ((isConnected_univ : IsConnected (univ : Set UnitTwoSphere)).prod |
| 44 | isConnected_singleton).image N.coordinate_map ?_ |
| 45 | apply N.coordinate_map_smooth.continuousOn.mono |
| 46 | rintro ⟨q, t⟩ ⟨hq, ht⟩ |
| 47 | have ht0 : t = 0 := mem_singleton_iff.mp ht |
| 48 | subst t |
| 49 | exact ⟨hq, neg_lt_zero.mpr (inv_pos.mpr N.epsilon_pos), inv_pos.mpr N.epsilon_pos⟩ |
| 50 | |
| 51 | /-- The actual retained half-neck is nonempty (MT Definition 2.18, p. 31; |
| 52 | the retained-side anchor in Lemma 17.12, pp. 410-411). -/ |
| 53 | theorem epsilonNeck_negative_half_nonempty (N : EpsilonNeck g) : |
| 54 | (N.region (-N.epsilon⁻¹) 0).Nonempty := by |
| 55 | have he : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 56 | rw [← epsilonNeckChart_image_region N (-N.epsilon⁻¹) 0 le_rfl he.le] |
| 57 | apply Set.Nonempty.image |
| 58 | refine ⟨((N.coordinate_inverse N.center).1, -N.epsilon⁻¹ / 2), mem_univ _, ?_⟩ |
| 59 | constructor <;> linarith |
| 60 | |
| 61 | variable {g0 : StandardInitialMetric} {K : MetricSurgeryConstants} |
| 62 | {P : SurgeryParameters} {slice : ℝ → GeneralizedSliceCarrier.{u}} |
| 63 | {metric : ∀ t, RiemannianMetric 3 (slice t).carrier} {T : ℝ} |
| 64 | |
| 65 | /-- Each displayed retained-boundary piece is connected, as required for |
| 66 | the per-sphere component bound in MT Lemma 17.12, pp. 410-411. -/ |
| 67 | theorem event_boundary_isConnected |
| 68 | (E : SurgeryEventData g0 K P slice metric T) (i : Fin E.cap_count) : |
| 69 | IsConnected (E.limit_identify.inverse '' (E.necks i).neck.central_sphere) := by |
| 70 | exact (epsilonNeck_isConnected_central_sphere (E.necks i).neck).image |
| 71 | E.limit_identify.inverse (E.limit_identify.inverse_smooth.continuousOn.mono |
| 72 | (subset_univ _)) |
| 73 | |
| 74 | /-- Every actual post-surgery component contains a retained point |
| 75 | (MT Lemma 17.12, pp. 410-411). A cap lies in a connected local output |
| 76 | whose negative neck half supplies the retained point. -/ |
| 77 | theorem event_post_component_meets_retained |
| 78 | (E : SurgeryEventData g0 K P slice metric T) (y : (slice T).carrier) : |
| 79 | ∃ z ∈ E.retained_post, z ∈ connectedComponent y := by |
| 80 | have hy : y ∈ E.retained_post ∪ ⋃ i, (E.caps i).carrier := by |
| 81 | rw [E.post_cover] |
| 82 | exact mem_univ _ |
| 83 | rcases hy with hy | hy |
| 84 | · exact ⟨y, hy, mem_connectedComponent⟩ |
| 85 | obtain ⟨i, hyi⟩ := mem_iUnion.mp hy |
| 86 | obtain ⟨e⟩ := (E.local_result i).open_ball_model |
| 87 | let : ConnectedSpace (E.local_result i).output.carrier := |
| 88 | (e.trans Homeomorph.ulift).connectedSpace_iff.mpr inferInstance |
| 89 | have hc : IsConnected (range (E.local_embed i)) := |
| 90 | isConnected_range (E.local_embed_smooth i).continuous |
| 91 | have hyc : y ∈ range (E.local_embed i) := by |
| 92 | rw [← E.local_cap_image i] at hyi |
| 93 | obtain ⟨w, _, rfl⟩ := hyi |
| 94 | exact mem_range_self _ |
| 95 | obtain ⟨a, ha⟩ := epsilonNeck_negative_half_nonempty (E.necks i).neck |
| 96 | obtain ⟨x, hx, hxa⟩ := E.neck_negative_retained i ha |
| 97 | have hinv : E.limit_identify.inverse a ∈ E.retained_pre := by |
| 98 | rw [← hxa, E.limit_identify.left_inverse (E.retained_pre_subset hx)] |
| 99 | exact hx |
| 100 | refine ⟨E.local_embed i ((E.local_result i).collapse a), ?_, |
| 101 | hc.subset_connectedComponent hyc (mem_range_self _)⟩ |
| 102 | rw [E.local_retention i a ha] |
| 103 | exact E.retention.map_image.subset (mem_image_of_mem _ hinv) |
| 104 | |
| 105 | /-- The actual restricted retention map is surjective on connected |
| 106 | components (MT Lemma 17.12, pp. 410-411), although its point image is |
| 107 | only the retained post-region. -/ |
| 108 | theorem event_retention_connectedComponentsMap_surjective |
| 109 | (E : SurgeryEventData g0 K P slice metric T) : |
| 110 | Function.Surjective |
| 111 | E.retention.map_smooth.continuousOn.domRestrict.connectedComponentsMap := by |
| 112 | intro c |
| 113 | obtain ⟨y, rfl⟩ := ConnectedComponents.surjective_coe c |
| 114 | obtain ⟨z, hz, hzy⟩ := event_post_component_meets_retained E y |
| 115 | rw [← E.retention.map_image] at hz |
| 116 | obtain ⟨x, hx, hxz⟩ := hz |
| 117 | refine ⟨ConnectedComponents.mk ⟨x, hx⟩, ?_⟩ |
| 118 | change ConnectedComponents.mk (E.retention.map x) = ConnectedComponents.mk y |
| 119 | rw [hxz] |
| 120 | exact ConnectedComponents.coe_eq_coe'.mpr hzy |
| 121 | |
| 122 | /-- The actual retained component quotient is finite when the pre-slice |
| 123 | component quotient is finite (MT Lemma 17.12, pp. 410-411). Only the |
| 124 | ambient manifold, not the retained subtype, is locally connected. -/ |
| 125 | theorem event_retained_components_finite |
| 126 | (E : SurgeryEventData g0 K P slice metric T) |
| 127 | [Finite (ConnectedComponents (slice E.tMinus).carrier)] : |
| 128 | Finite (ConnectedComponents E.retained_pre) := by |
| 129 | let : LocallyConnectedSpace (slice E.tMinus).carrier := |
| 130 | ChartedSpace.locallyConnectedSpace (EuclideanSpace ℝ (Fin 3)) (slice E.tMinus).carrier |
| 131 | apply E.retained_pre_compact.isClosed.finite_connectedComponents_of_frontier_cover |
| 132 | (fun i => E.limit_identify.inverse '' (E.necks i).neck.central_sphere) |
| 133 | (fun i => (event_boundary_isConnected E i).isPreconnected) |
| 134 | · intro i x hx |
| 135 | apply E.retained_pre_compact.isClosed.frontier_subset |
| 136 | rw [E.pre_boundary] |
| 137 | exact mem_iUnion.mpr ⟨i, hx⟩ |
| 138 | · exact E.pre_boundary.subset |
| 139 | |
| 140 | /-- The actual post-component quotient is finite, via the actual |
| 141 | retention component surjection (MT Lemma 17.12, pp. 410-411). -/ |
| 142 | theorem event_post_components_finite |
| 143 | (E : SurgeryEventData g0 K P slice metric T) |
| 144 | [Finite (ConnectedComponents (slice E.tMinus).carrier)] : |
| 145 | Finite (ConnectedComponents (slice T).carrier) := by |
| 146 | let := event_retained_components_finite E |
| 147 | exact Finite.of_surjective |
| 148 | E.retention.map_smooth.continuousOn.domRestrict.connectedComponentsMap |
| 149 | (event_retention_connectedComponentsMap_surjective E) |
| 150 | |
| 151 | /-- Each actual sphere cut increases the component count by at most one |
| 152 | (MT Lemma 17.12, pp. 410-411), summed over every cap of the event. -/ |
| 153 | theorem event_components_card_le |
| 154 | (E : SurgeryEventData g0 K P slice metric T) |
| 155 | [Finite (ConnectedComponents (slice E.tMinus).carrier)] : |
| 156 | Nat.card (ConnectedComponents (slice T).carrier) ≤ |
| 157 | Nat.card (ConnectedComponents (slice E.tMinus).carrier) + E.cap_count := by |
| 158 | let := event_retained_components_finite E |
| 159 | let : LocallyConnectedSpace (slice E.tMinus).carrier := |
| 160 | ChartedSpace.locallyConnectedSpace (EuclideanSpace ℝ (Fin 3)) (slice E.tMinus).carrier |
| 161 | have hpost := Nat.card_le_card_of_surjective |
| 162 | E.retention.map_smooth.continuousOn.domRestrict.connectedComponentsMap |
| 163 | (event_retention_connectedComponentsMap_surjective E) |
| 164 | have hret := E.retained_pre_compact.isClosed.card_connectedComponents_le_of_frontier_cover |
| 165 | (fun i => E.limit_identify.inverse '' (E.necks i).neck.central_sphere) |
| 166 | (fun i => (event_boundary_isConnected E i).isPreconnected) |
| 167 | (fun i x hx => E.retained_pre_compact.isClosed.frontier_subset |
| 168 | (E.pre_boundary.symm ▸ mem_iUnion.mpr ⟨i, hx⟩)) E.pre_boundary.subset |
| 169 | exact hpost.trans (by simpa using hret) |
| 170 | |
| 171 | /-- A zero-cap event omitting an entire pre-component strictly decreases |
| 172 | the count (MT Lemma 17.12, pp. 410-411). The genuine-discard witness |
| 173 | is an explicit premise. -/ |
| 174 | theorem event_components_card_add_one_le |
| 175 | (E : SurgeryEventData g0 K P slice metric T) |
| 176 | [Finite (ConnectedComponents (slice E.tMinus).carrier)] |
| 177 | (hzero : E.cap_count = 0) (x : (slice E.tMinus).carrier) |
| 178 | (hx : connectedComponent x ⊆ E.retained_preᶜ) : |
| 179 | Nat.card (ConnectedComponents (slice T).carrier) + 1 ≤ |
| 180 | Nat.card (ConnectedComponents (slice E.tMinus).carrier) := by |
| 181 | let := event_retained_components_finite E |
| 182 | have hpost := Nat.card_le_card_of_surjective |
| 183 | E.retention.map_smooth.continuousOn.domRestrict.connectedComponentsMap |
| 184 | (event_retention_connectedComponentsMap_surjective E) |
| 185 | have hclopen : IsClopen E.retained_pre := by |
| 186 | apply isClopen_iff_frontier_eq_empty.mpr |
| 187 | apply subset_empty_iff.mp |
| 188 | intro y hy |
| 189 | rw [E.pre_boundary] at hy |
| 190 | obtain ⟨i, _⟩ := mem_iUnion.mp hy |
| 191 | have hi := i.isLt |
| 192 | omega |
| 193 | exact Nat.add_one_le_iff.mpr |
| 194 | (hpost.trans_lt (hclopen.card_connectedComponents_lt_of_component_omitted x hx)) |
| 195 | |
| 196 | end PoincareMT.SurgeryVolume |