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.GlobalSchedule.Empty.EmptyExtension |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.OldEventPolicy |
| 3 | |
| 4 | /-! |
| 5 | # Terminal policy in the permanent empty continuation |
| 6 | |
| 7 | Morgan--Tian Definition 15.8 and Section 17.2, pp. 362 and 409. |
| 8 | The copied events retain their actual terminal geometry and pre-flow. |
| 9 | Every event of the extended flow belongs to the old event set. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | namespace SurgeryEventData |
| 20 | |
| 21 | /-- Relabeling the past preserves the primitive terminal-policy data. -/ |
| 22 | theorem reindexPast_preservation |
| 23 | {g0 : StandardInitialMetric} {K : MetricSurgeryConstants} |
| 24 | {P : SurgeryParameters} {slice : Real -> GeneralizedSliceCarrier.{u}} |
| 25 | {metric : forall t, RiemannianMetric 3 (slice t).carrier} {T : Real} |
| 26 | (E : SurgeryEventData g0 K P slice metric T) |
| 27 | (tau : Real -> Real) (hTau : forall t, t <= T -> tau t = t) : |
| 28 | M33NonemptyEventDataPreservation E (E.reindexPast tau hTau) := by |
| 29 | refine { |
| 30 | terminal_eq := rfl |
| 31 | limit_metric_heq := HEq.rfl |
| 32 | limit_connection_heq := HEq.rfl |
| 33 | cap_count_eq := rfl |
| 34 | necks_heq := HEq.rfl |
| 35 | retained_image_heq := ?_ } |
| 36 | apply heq_of_eq |
| 37 | rw [<- E.reindexPast_retained_pre_image tau hTau, Set.image_image] |
| 38 | apply Set.image_congr |
| 39 | intro x _ |
| 40 | exact E.reindexPast_limit_identify_map tau hTau x |
| 41 | |
| 42 | end SurgeryEventData |
| 43 | |
| 44 | namespace SurgeryVanishingEventData |
| 45 | |
| 46 | /-- The copied vanishing event has the same reference carrier and pre-flow. -/ |
| 47 | theorem reindexPast_preservation |
| 48 | {P : SurgeryParameters} {slice : Real -> GeneralizedSliceCarrier.{u}} |
| 49 | {metric : forall t, RiemannianMetric 3 (slice t).carrier} {T : Real} |
| 50 | (E : SurgeryVanishingEventData P slice metric T) |
| 51 | (tau : Real -> Real) (hTau : forall t, t <= T -> tau t = t) : |
| 52 | M33VanishingEventDataPreservation E (E.reindexPast tau hTau) where |
| 53 | reference_eq := rfl |
| 54 | pre_carrier_eq := congrArg slice (hTau E.tMinus E.tMinus_lt.le) |
| 55 | pre_flow_heq := E.reindexPast_pre_flow_heq tau hTau |
| 56 | |
| 57 | end SurgeryVanishingEventData |
| 58 | |
| 59 | namespace M51Empty |
| 60 | |
| 61 | variable (F : SurgeryFlowData.{u}) {a : Real} (ha : a ∈ F.time_domain) |
| 62 | [IsEmpty (F.slice a).carrier] |
| 63 | |
| 64 | /-- The actual permanent-empty extension preserves both old event branches. -/ |
| 65 | theorem oldEventDataPreservation : |
| 66 | M33OldEventDataPreservation (extension F ha) := by |
| 67 | constructor |
| 68 | · intro T hT hOld hNew hT' |
| 69 | let : Nonempty (slice F a T).carrier := hNew |
| 70 | change M33NonemptyEventDataPreservation (F.event T hT) (event F ha T hT') |
| 71 | cases Subsingleton.elim hT' hT |
| 72 | exact (F.event T hT).reindexPast_preservation |
| 73 | (fun t => min t a) (event_clock F ha T hT) |
| 74 | · intro T hT hOld hNew hT' |
| 75 | let : IsEmpty (slice F a T).carrier := hNew |
| 76 | change M33VanishingEventDataPreservation |
| 77 | (F.vanishing_event T hT) (vanishingEvent F ha T hT') |
| 78 | cases Subsingleton.elim hT' hT |
| 79 | exact (F.vanishing_event T hT).reindexPast_preservation |
| 80 | (fun t => min t a) (event_clock F ha T hT) |
| 81 | |
| 82 | /-- No new event appears after the included empty slice, so old policy |
| 83 | covers every event in the full extended domain, including the event at a. -/ |
| 84 | theorem terminalPolicy |
| 85 | (policy : SurgeryFlowTerminalPolicyOn F F.time_domain) : |
| 86 | SurgeryFlowTerminalPolicyOn (flow F ha) (flow F ha).time_domain := by |
| 87 | have old := (oldEventDataPreservation F ha).transportPolicy (Set.Subset.refl _) policy |
| 88 | change SurgeryFlowTerminalPolicyOn (extension F ha).extended |
| 89 | (extension F ha).extended.time_domain |
| 90 | constructor |
| 91 | · intro T _ hT hpost |
| 92 | exact old.nonempty T (F.surgery_times_subset hT) hT |
| 93 | · intro T _ hT hempty |
| 94 | exact old.vanishing T (F.surgery_times_subset hT) hT |
| 95 | |
| 96 | end M51Empty |
| 97 | |
| 98 | end PoincareMT |