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.Branch |
| 2 | |
| 3 | /-! |
| 4 | Adapted from Mapher `PoincareMT/Definitions/M33RegularHistory.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. Declaration bodies are retained; |
| 6 | see `references/ricci-flow/mapher/surgery-adapters-port.json`. |
| 7 | -/ |
| 8 | |
| 9 | /-! |
| 10 | # The actual regular part of a finite surgery history |
| 11 | |
| 12 | Morgan--Tian Lemma 14.11 and Proposition 14.12, pp. 349-350. The input |
| 13 | window is primitive data on the actual surgery flow. The generalized flow, |
| 14 | its exact regular-slice images and both cylinder transports are outputs. |
| 15 | No canonical, analytic or noncollapsing estimate is assumed or produced. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | /-- Primitive observation guards. The interval may have an excluded endpoint; |
| 27 | finiteness concerns only its included old surgery times. -/ |
| 28 | structure M33RegularHistoryWindow (F : SurgeryFlowData.{u}) where |
| 29 | interval : Set ℝ |
| 30 | interval_connected : interval.OrdConnected |
| 31 | interval_nontrivial : interval.Nontrivial |
| 32 | zero_mem : 0 ∈ interval |
| 33 | time_subset : interval ⊆ F.time_domain |
| 34 | slice_nonempty : ∀ t ∈ interval, Nonempty (F.slice t).carrier |
| 35 | events_finite : (F.surgery_times ∩ interval).Finite |
| 36 | |
| 37 | /-- At an old surgery retain precisely its continuing interior. The point |
| 38 | itself supplies nonemptiness for the event; at other times the set is univ. -/ |
| 39 | def m33RegularRegion (F : SurgeryFlowData.{u}) (t : ℝ) : Set (F.slice t).carrier := |
| 40 | {x | ∀ hT : t ∈ F.surgery_times, |
| 41 | x ∈ interior (@SurgeryFlowData.event F t hT ⟨x⟩).retained_post} |
| 42 | |
| 43 | /-- The maximal regular generalized subset on the specified window. All |
| 44 | identifications concern this one selected flow and the actual historical |
| 45 | maps. Metric statements about cylinders are restricted to their open U. -/ |
| 46 | structure M33RegularHistoryData {F : SurgeryFlowData.{u}} |
| 47 | (W : M33RegularHistoryWindow F) where |
| 48 | generalized : GeneralizedRicciFlowData.{u} |
| 49 | interval_eq : generalized.interval = W.interval |
| 50 | history : M33RegularHistoryRealization generalized F |
| 51 | regular_range : ∀ t ht, |
| 52 | Set.range (history.forward t ht) = m33RegularRegion F t |
| 53 | scalar_pullback : ∀ t ht x, |
| 54 | (F.connection t).scalarCurvature (history.forward t ht x) = |
| 55 | (generalized.connection t).scalarCurvature x |
| 56 | curvature_norm_pullback : ∀ t ht x, |
| 57 | (F.connection t).curvatureTensorNorm (history.forward t ht x) = |
| 58 | (generalized.connection t).curvatureTensorNorm x |
| 59 | negative_part_pullback : ∀ t ht x, |
| 60 | (F.connection t).negativeCurvaturePart (history.forward t ht x) = |
| 61 | (generalized.connection t).negativeCurvaturePart x |
| 62 | volume_image : ∀ t ht (U : Set (generalized.slice t).carrier), |
| 63 | calibratedMetricVolume (F.metric t) (history.forward t ht '' U) = |
| 64 | calibratedMetricVolume (generalized.metric t) U |
| 65 | regular_distance : ∀ t ht, t ∉ F.surgery_times → |
| 66 | ∀ x y : (generalized.slice t).carrier, |
| 67 | (F.metric t).edist (history.forward t ht x) (history.forward t ht y) = |
| 68 | (generalized.metric t).edist x y |
| 69 | cylinders_to_surgery : ∀ (C : GeneralizedSliceCarrier.{u}) |
| 70 | (origin scale : ℝ) (J : Set ℝ) (U : Set C.carrier), |
| 71 | J.OrdConnected → IsOpen U → |
| 72 | ∀ htime : ∀ s ∈ J, origin + s / scale ∈ generalized.interval, |
| 73 | ∀ e : GeneralizedFlowCylinder generalized C origin scale J U, |
| 74 | ∃ d : SurgeryFlowCylinder F C origin scale J U, |
| 75 | (∀ s hs x, x ∈ U → d.forward s hs x = |
| 76 | history.forward (origin + s / scale) (htime s hs) (e.forward s hs x)) ∧ |
| 77 | (∀ s hs x, x ∈ U → ∀ v w : TangentSpace (𝓡 3) x, |
| 78 | d.pullbackInner s hs x v w = e.pullbackInner s hs x v w) |
| 79 | cylinders_from_surgery : ∀ (C : GeneralizedSliceCarrier.{u}) |
| 80 | (origin scale : ℝ) (J : Set ℝ) (U : Set C.carrier), |
| 81 | IsOpen U → |
| 82 | ∀ htime : ∀ s ∈ J, origin + s / scale ∈ generalized.interval, |
| 83 | ∀ e : SurgeryFlowCylinder F C origin scale J U, |
| 84 | (∀ s hs, e.forward s hs '' U ⊆ m33RegularRegion F (origin + s / scale)) → |
| 85 | ∃ d : GeneralizedFlowCylinder generalized C origin scale J U, |
| 86 | (∀ s hs x, x ∈ U → |
| 87 | history.forward (origin + s / scale) (htime s hs) (d.forward s hs x) = |
| 88 | e.forward s hs x) ∧ |
| 89 | (∀ s hs x, x ∈ U → ∀ v w : TangentSpace (𝓡 3) x, |
| 90 | d.pullbackInner s hs x v w = e.pullbackInner s hs x v w) |
| 91 | |
| 92 | end PoincareMT |