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.Event.LimitConvergence |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.Terminal.Event.Retention |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.Terminal.Event.RetainedDisappearing |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.Terminal.Gluing.Caps.Height |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.EventRebuild.Transport |
| 6 | |
| 7 | /-! |
| 8 | # The terminal nonempty surgery event |
| 9 | |
| 10 | The finite local metric surgeries and the actual retained region determine |
| 11 | the original event record on any future family agreeing with the old flow |
| 12 | before the terminal time and with the cut-and-cap metric at that time. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set TopologicalSpace |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.RepairedContinuationLimitBridge |
| 25 | |
| 26 | open Surgery.Terminal.Gluing SurgeryEventRebuild |
| 27 | |
| 28 | variable {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 30 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] [SecondCountableTopology M] |
| 31 | {G : GeneralizedRicciFlowData.{u}} {T : ℝ} {H : SingularTimeAssumptions G T M} |
| 32 | {L : RepairedSingularRegularLimitData H} {N : RepairedHornSelectionData H} |
| 33 | {F : SurgeryFlowData.{u}} {I : RepairedContinuationInput F T} |
| 34 | (B : RepairedContinuationLimitBridge H L N I) |
| 35 | |
| 36 | def assembleNonemptyEvent |
| 37 | (σ : Ico H.reference.tMinus T) (hclose : T - (F.parameters.h T) ^ 2 < σ.1) |
| 38 | {ι : Type u} [Fintype ι] |
| 39 | (J : ι → MetricSurgeryInput F.local_constants (N.limit.extension.extended.metric T)) |
| 40 | (R : ∀ i, MetricSurgeryResult F.standard_initial (J i)) |
| 41 | (U : Opens (N.limit.extension.extended.slice T).carrier) (hU : Nonempty U) |
| 42 | (hd : Pairwise (fun i j => Disjoint |
| 43 | ((J i).negativeHalf : Set (N.limit.extension.extended.slice T).carrier) (J j).negativeHalf)) |
| 44 | (hc : ∀ i, Disjoint (U : Set (N.limit.extension.extended.slice T).carrier) |
| 45 | (J i).neck.central_sphere) |
| 46 | (hneck : Pairwise (fun i j => Disjoint (J i).neck.carrier (J j).neck.carrier)) |
| 47 | (hUn : ∀ i, (U : Set (N.limit.extension.extended.slice T).carrier) ∩ |
| 48 | (J i).neck.carrier = (J i).negativeHalf) |
| 49 | (hfront : frontier (U : Set (N.limit.extension.extended.slice T).carrier) ⊆ |
| 50 | ⋃ i, (J i).neck.central_sphere) |
| 51 | (hcompact : IsCompact (closure (U : Set (N.limit.extension.extended.slice T).carrier))) |
| 52 | (hcore : {x | N.limit.terminal_scalar x ≤ I.rho⁻¹ ^ 2} ⊆ U) |
| 53 | (htime : ∀ i, (J i).time = T) |
| 54 | (hdelta : ∀ i, (J i).neck.epsilon = F.parameters.delta T) |
| 55 | (hscale : ∀ i, (J i).neck.scale = F.parameters.h T) |
| 56 | (future : ℝ → SliceMetric.{u}) |
| 57 | (hPast : ∀ t, t < T → (⟨F.slice t, F.metric t⟩ : SliceMetric.{u}) = future t) |
| 58 | (hPost : (⟨cutCarrier J R U hU hd hc, cutMetric J R U hU hd hc⟩ : SliceMetric.{u}) = |
| 59 | future T) : |
| 60 | SurgeryEventData F.standard_initial F.local_constants F.parameters |
| 61 | (fun t => (future t).1) (fun t => (future t).2) T := by |
| 62 | letI : Nonempty (N.limit.extension.extended.slice T).carrier := hU.map Subtype.val |
| 63 | let r := B.referenceRebaseTime σ |
| 64 | let L₀ := B.referenceLimitIdentify N.limit σ |
| 65 | let A := referenceRetained U L₀ |
| 66 | let P := retainedMap J R U hU hd hc '' closure (U : Set _) |
| 67 | let ret := referenceRetention J R U hU hd hc hneck hUn hfront L₀ |
| 68 | let e : Fin (Fintype.card ι) ≃ ι := (Fintype.equivFin ι).symm |
| 69 | let C : Fin (Fintype.card ι) → SurgeryCapChart F.standard_initial |
| 70 | (cutCarrier J R U hU hd hc) (cutMetric J R U hU hd hc) (F.parameters.h T) := |
| 71 | fun i => (capChart J R U hU hd hc (e i)).atHeight (hscale (e i)) |
| 72 | let d := Classical.choose (B.exists_reference_disappearing_cover U hcore σ) |
| 73 | have hdcover := Classical.choose_spec (B.exists_reference_disappearing_cover U hcore σ) |
| 74 | have hm := hPast σ.1 σ.2.2 |
| 75 | have hT := hPost |
| 76 | refine { |
| 77 | tMinus := σ.1 |
| 78 | tMinus_nonnegative := F.time_domain_nonnegative (I.last_slab.time_subset r.2) |
| 79 | tMinus_lt := σ.2.2 |
| 80 | preterminal_close := hclose |
| 81 | pre_flow := flow hm (I.last_slab.rebaseFlow r) |
| 82 | pre_identify := fun t => diffeomorph hm (hPast t.1 t.2.2) (I.last_slab.rebaseIdentify r t) |
| 83 | pre_initial := by |
| 84 | intro x |
| 85 | obtain ⟨y, rfl⟩ := (identify _ _ hm).surjective x |
| 86 | exact (diffeomorph_apply hm hm |
| 87 | (I.last_slab.rebaseIdentify r ⟨σ.1, le_rfl, σ.2.2⟩) y).trans |
| 88 | (congrArg (identify _ _ hm) (I.last_slab.rebaseIdentify_initial r y)) |
| 89 | pre_metric := fun t => diffeomorph_flow_metric_pullback hm (hPast t.1 t.2.2) |
| 90 | (I.last_slab.rebaseFlow r) t.1 (I.last_slab.rebaseIdentify r t) |
| 91 | (I.last_slab.rebase_metric r t) |
| 92 | regular_limit := relabel (C := fun p => Set p.1.carrier) hm |
| 93 | (B.reference_identify σ ⁻¹' H.reference.regularLimitSet) |
| 94 | regular_limit_eq := ?_ |
| 95 | regular_limit_open := ?_ |
| 96 | terminal := N.limit.extension.extended.slice T |
| 97 | limit_identify := regionSource hm (N.limit.extension.extended.slice T) |
| 98 | (B.reference_identify σ ⁻¹' H.reference.regularLimitSet) univ L₀ |
| 99 | limit_metric := N.limit.extension.extended.metric T |
| 100 | limit_connection := N.limit.extension.extended.connection T |
| 101 | metric_converges := ?_ |
| 102 | retained_pre := relabel (C := fun p => Set p.1.carrier) hm A |
| 103 | retained_pre_compact := ?_ |
| 104 | retained_pre_subset := ?_ |
| 105 | low_curvature_retained := ?_ |
| 106 | retained_post := relabel (C := fun p => Set p.1.carrier) hT P |
| 107 | retained_post_compact := ?_ |
| 108 | retention := region hm hT A P ret |
| 109 | retained_metric := ?_ |
| 110 | cap_count := Fintype.card ι |
| 111 | caps := relabel (C := fun p => Fin (Fintype.card ι) → |
| 112 | SurgeryCapChart F.standard_initial p.1 p.2 (F.parameters.h T)) hT C |
| 113 | cap_disjoint := ?_ |
| 114 | post_cover := ?_ |
| 115 | cap_boundary := ?_ |
| 116 | necks := fun i => J (e i) |
| 117 | neck_carrier_disjoint := fun i j hij => hneck (e.injective.ne hij) |
| 118 | neck_time := fun i => htime (e i) |
| 119 | neck_delta := fun i => hdelta (e i) |
| 120 | neck_scale := fun i => hscale (e i) |
| 121 | pre_boundary := ?_ |
| 122 | boundary_correspondence := ?_ |
| 123 | neck_negative_retained := ?_ |
| 124 | neck_positive_discarded := ?_ |
| 125 | local_result := fun i => R (e i) |
| 126 | local_embed := relabel |
| 127 | (C := fun p => ∀ i : Fin (Fintype.card ι), (R (e i)).output.carrier → p.1.carrier) |
| 128 | hT (fun i => capInclusion J R U hU hd hc (e i)) |
| 129 | local_embed_smooth := ?_ |
| 130 | local_embed_injective := ?_ |
| 131 | local_metric := ?_ |
| 132 | local_tip := ?_ |
| 133 | local_cap_image := ?_ |
| 134 | local_retention := ?_ |
| 135 | disappearing_start := d |
| 136 | disappearing_start_bounds := ⟨hdcover.1, hdcover.2.1⟩ |
| 137 | disappearing_curvature := ?_ |
| 138 | disappearing_cover := ?_ } |
| 139 | all_goals |
| 140 | try dsimp only [flow, diffeomorph, relabel, regionSource, region] at * |
| 141 | generalize hval : future σ.1 = m at * |
| 142 | clear hval |
| 143 | subst m |
| 144 | generalize hval : future T = b at * |
| 145 | clear hval |
| 146 | subst b |
| 147 | · exact B.reference_regularLimit_eq σ |
| 148 | · exact B.reference_regularLimit_open N.limit σ |
| 149 | · have h := B.reference_surgeryMetricLimitOn N.limit σ |
| 150 | rw [N.limit.terminal_metric_eq] at h |
| 151 | exact h |
| 152 | · exact referenceRetained_compact U L₀ hcompact |
| 153 | · exact referenceRetained_subset U L₀ |
| 154 | · rw [referenceRetained_image] |
| 155 | intro x hx |
| 156 | apply subset_closure |
| 157 | apply hcore |
| 158 | rw [N.limit.terminal_scalar_eq] |
| 159 | simpa only [I.rho_eq] using hx |
| 160 | · exact retainedMap_image_compact J R U hU hd hc hneck hUn hfront hcompact |
| 161 | · exact referenceRetention_metric J R U hU hd hc hneck hUn hfront L₀ |
| 162 | (B.reference_regularLimit_open N.limit σ) |
| 163 | · intro i j hij |
| 164 | exact capChart_disjoint J R U hU hd hc (e.injective.ne hij) |
| 165 | · change P ∪ (⋃ i, (capChart J R U hU hd hc (e i)).carrier) = univ |
| 166 | rw [e.surjective.iUnion_comp (fun i => (capChart J R U hU hd hc i).carrier)] |
| 167 | dsimp only [P] |
| 168 | rw [retainedMap_image_eq_retainedPost J R U hU hd hc hneck hUn hfront] |
| 169 | exact retainedPost_cover J R U hU hd hc |
| 170 | · intro i |
| 171 | change P ∩ (capChart J R U hU hd hc (e i)).carrier = |
| 172 | frontier (capChart J R U hU hd hc (e i)).carrier |
| 173 | dsimp only [P] |
| 174 | rw [retainedMap_image_eq_retainedPost J R U hU hd hc hneck hUn hfront] |
| 175 | exact retainedPost_inter_cap J R U hU hd hc (e i) |
| 176 | · change frontier A = ⋃ i, L₀.inverse '' (J (e i)).neck.central_sphere |
| 177 | rw [e.surjective.iUnion_comp (fun i => L₀.inverse '' (J i).neck.central_sphere)] |
| 178 | exact referenceRetained_frontier J R U hU hd hc hneck hUn hfront L₀ hcompact |
| 179 | · intro i |
| 180 | exact referenceRetention_boundary J R U hU hd hc hneck hUn hfront L₀ (e i) |
| 181 | · intro i |
| 182 | exact referenceRetained_negative J U hUn L₀ (e i) |
| 183 | · intro i |
| 184 | exact referenceRetained_positive J U hUn L₀ (e i) |
| 185 | · intro i |
| 186 | exact (capInclusion_localDiffeomorph J R U hU hd hc (e i)).contMDiff |
| 187 | · intro i |
| 188 | exact (capInclusion_openEmbedding J R U hU hd hc (e i)).injective |
| 189 | · intro i |
| 190 | exact capInclusion_metric J R U hU hd hc (e i) |
| 191 | · intro i |
| 192 | rfl |
| 193 | · intro i |
| 194 | rfl |
| 195 | · intro i x hx |
| 196 | exact referenceRetention_local J R U hU hd hc hneck hUn hfront L₀ (e i) x hx |
| 197 | · intro a ha |
| 198 | obtain ⟨s, hs, hsT, htail⟩ := B.reference_uniform_scalar_tail_off_open U hcore σ a |
| 199 | (I.rho_eq ▸ ha) |
| 200 | refine ⟨s, hs.le, hsT, fun t ht x hx => htail t ht x ?_⟩ |
| 201 | rwa [← referenceRetained_interior J R U hU hd hc hneck hUn hfront L₀] |
| 202 | · intro t ht x hx |
| 203 | apply hdcover.2.2 t ht x |
| 204 | rwa [← referenceRetained_interior J R U hU hd hc hneck hUn hfront L₀] |
| 205 | |
| 206 | end PoincareMT.RepairedContinuationLimitBridge |