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.AssemblyProperties |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.Terminal.Gluing.Retained.Policy |
| 3 | |
| 4 | /-! |
| 5 | # Terminal end policy of the assembled surgery event |
| 6 | |
| 7 | The event retains exactly the geometrically selected closure, with the same |
| 8 | end cuts reindexed by its finite cap index. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set TopologicalSpace |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.RepairedContinuationLimitBridge |
| 21 | |
| 22 | open Surgery.Terminal.Gluing SurgeryEventRebuild |
| 23 | |
| 24 | variable {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 26 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] [SecondCountableTopology M] |
| 27 | {G : GeneralizedRicciFlowData.{u}} {T : ℝ} {H : SingularTimeAssumptions G T M} |
| 28 | {L : RepairedSingularRegularLimitData H} {N : RepairedHornSelectionData H} |
| 29 | {F : SurgeryFlowData.{u}} {I : RepairedContinuationInput F T} |
| 30 | (B : RepairedContinuationLimitBridge H L N I) |
| 31 | (σ : Ico H.reference.tMinus T) (hclose : T - (F.parameters.h T) ^ 2 < σ.1) |
| 32 | {ι : Type u} [Fintype ι] |
| 33 | (J : ι → MetricSurgeryInput F.local_constants (N.limit.extension.extended.metric T)) |
| 34 | (R : ∀ i, MetricSurgeryResult F.standard_initial (J i)) |
| 35 | (U : Opens (N.limit.extension.extended.slice T).carrier) (hU : Nonempty U) |
| 36 | (hd : Pairwise (fun i j => Disjoint |
| 37 | ((J i).negativeHalf : Set (N.limit.extension.extended.slice T).carrier) (J j).negativeHalf)) |
| 38 | (hc : ∀ i, Disjoint (U : Set (N.limit.extension.extended.slice T).carrier) |
| 39 | (J i).neck.central_sphere) |
| 40 | (hneck : Pairwise (fun i j => Disjoint (J i).neck.carrier (J j).neck.carrier)) |
| 41 | (hUn : ∀ i, (U : Set (N.limit.extension.extended.slice T).carrier) ∩ |
| 42 | (J i).neck.carrier = (J i).negativeHalf) |
| 43 | (hfront : frontier (U : Set (N.limit.extension.extended.slice T).carrier) ⊆ |
| 44 | ⋃ i, (J i).neck.central_sphere) |
| 45 | (hcompact : IsCompact (closure (U : Set (N.limit.extension.extended.slice T).carrier))) |
| 46 | (hcore : {x | N.limit.terminal_scalar x ≤ I.rho⁻¹ ^ 2} ⊆ U) |
| 47 | (htime : ∀ i, (J i).time = T) |
| 48 | (hdelta : ∀ i, (J i).neck.epsilon = F.parameters.delta T) |
| 49 | (hscale : ∀ i, (J i).neck.scale = F.parameters.h T) |
| 50 | (future : ℝ → SliceMetric.{u}) |
| 51 | (hPast : ∀ t, t < T → (⟨F.slice t, F.metric t⟩ : SliceMetric.{u}) = future t) |
| 52 | (hPost : (⟨cutCarrier J R U hU hd hc, cutMetric J R U hU hd hc⟩ : SliceMetric.{u}) = |
| 53 | future T) |
| 54 | |
| 55 | local notation "E" => B.assembleNonemptyEvent σ hclose J R U hU hd hc hneck hUn hfront |
| 56 | hcompact hcore htime hdelta hscale future hPast hPost |
| 57 | |
| 58 | def assembleNonemptyEvent_terminalPolicy |
| 59 | (cuts : ∀ i, SurgeryEndCut (J i).neck) |
| 60 | (hretained : closure (U : Set (N.limit.extension.extended.slice T).carrier) = |
| 61 | SurgeryTerminalCoreComponents (N.limit.extension.extended.connection T) I.rho \ |
| 62 | ⋃ i, (cuts i).tail) : SurgeryEventTerminalPolicy (E) where |
| 63 | cuts i := cuts ((Fintype.equivFin ι).symm i) |
| 64 | retained_eq := by |
| 65 | rw [B.assembleNonemptyEvent_retained_image] |
| 66 | change closure (U : Set (N.limit.extension.extended.slice T).carrier) = |
| 67 | SurgeryTerminalCoreComponents (N.limit.extension.extended.connection T) |
| 68 | (F.parameters.delta T * F.parameters.r T) \ |
| 69 | ⋃ i : Fin (Fintype.card ι), (cuts ((Fintype.equivFin ι).symm i)).tail |
| 70 | have hunion : (⋃ i : Fin (Fintype.card ι), |
| 71 | (cuts ((Fintype.equivFin ι).symm i)).tail) = ⋃ i, (cuts i).tail := |
| 72 | (Fintype.equivFin ι).symm.surjective.iUnion_comp (fun i => (cuts i).tail) |
| 73 | rw [hunion, ← I.rho_eq] |
| 74 | exact hretained |
| 75 | |
| 76 | end PoincareMT.RepairedContinuationLimitBridge |