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.Topology.Manifold.ConnectedSum.Surgery.Topology |
| 2 | import PoincareLib.Topology.Manifold.ThreeDimensional.Orientation.Basic |
| 3 | import Mathlib.AlgebraicTopology.SingularHomology.Basic |
| 4 | import Mathlib.Algebra.Category.ModuleCat.Abelian |
| 5 | import Mathlib.Algebra.Category.ModuleCat.Colimits |
| 6 | import Mathlib.Topology.Homotopy.Equiv |
| 7 | |
| 8 | /-! |
| 9 | # Comparison maps across a separating surgery |
| 10 | |
| 11 | The source map agrees with the actual retained-region identification. Its |
| 12 | smooth approximants have arbitrarily near-unit metric Lipschitz constants, |
| 13 | one common homotopy class, and degree one in integral third homology. |
| 14 | The simply connected specialization records the resulting actual map on |
| 15 | third homotopy groups, as required for later width transport. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 21 | |
| 22 | universe u v |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | def surgeryMappedGenLoop {X : Type u} {Y : Type v} |
| 27 | [TopologicalSpace X] [TopologicalSpace Y] |
| 28 | {x : X} {y : Y} {n : ℕ} (f : ContinuousMap X Y) (h : f x = y) |
| 29 | (gamma : GenLoop (Fin n) X x) : GenLoop (Fin n) Y y := |
| 30 | ⟨f.comp gamma.1, fun z hz => by |
| 31 | change f (gamma z) = y |
| 32 | have hg : gamma z = x := gamma.2 z hz |
| 33 | simpa [hg] using h⟩ |
| 34 | |
| 35 | def surgeryHomotopyMap {X : Type u} {Y : Type v} |
| 36 | [TopologicalSpace X] [TopologicalSpace Y] |
| 37 | {x : X} {y : Y} {n : ℕ} (f : ContinuousMap X Y) (h : f x = y) : |
| 38 | HomotopyGroup.Pi n X x → HomotopyGroup.Pi n Y y := |
| 39 | Quotient.map (surgeryMappedGenLoop f h) |
| 40 | (fun _ _ hab => hab.comp_continuousMap f) |
| 41 | |
| 42 | noncomputable def surgeryThirdHomology (X : Type u) [TopologicalSpace X] : |
| 43 | ModuleCat.{u} ℤ := |
| 44 | (((AlgebraicTopology.singularHomologyFunctor (ModuleCat.{u} ℤ) 3).obj |
| 45 | (ModuleCat.of ℤ (ULift.{u} ℤ))).obj (TopCat.of X)) |
| 46 | |
| 47 | noncomputable def surgeryThirdHomologyMap {X Y : Type u} |
| 48 | [TopologicalSpace X] [TopologicalSpace Y] (f : ContinuousMap X Y) : |
| 49 | surgeryThirdHomology X →ₗ[ℤ] surgeryThirdHomology Y := |
| 50 | (((AlgebraicTopology.singularHomologyFunctor (ModuleCat.{u} ℤ) 3).obj |
| 51 | (ModuleCat.of ℤ (ULift.{u} ℤ))).map (TopCat.ofHom f)).hom |
| 52 | |
| 53 | /-- A compact connected component with its actual smooth inclusion. -/ |
| 54 | structure SurgerySelectedComponent (A : GeneralizedSliceCarrier.{u}) where |
| 55 | carrier : GeneralizedSliceCarrier.{u} |
| 56 | basepoint : carrier.carrier |
| 57 | inclusion : carrier.carrier → A.carrier |
| 58 | inverse : A.carrier → carrier.carrier |
| 59 | inclusion_openEmbedding : Topology.IsOpenEmbedding inclusion |
| 60 | inclusion_smooth : ContMDiff (𝓡 3) (𝓡 3) ∞ inclusion |
| 61 | inverse_smooth : ContMDiffOn (𝓡 3) (𝓡 3) ∞ inverse (Set.range inclusion) |
| 62 | left_inverse : Function.LeftInverse inverse inclusion |
| 63 | range_eq_component : Set.range inclusion = connectedComponent (inclusion basepoint) |
| 64 | compact : IsCompact (Set.univ : Set carrier.carrier) |
| 65 | connected : IsConnected (Set.univ : Set carrier.carrier) |
| 66 | |
| 67 | /-- The local hypotheses needed for the augmented Poincare-specific |
| 68 | comparison statement. Separation is stated for the actual surgery spheres. -/ |
| 69 | structure SurgeryComparisonInput (F : SurgeryFlowData.{u}) |
| 70 | (T : ℝ) (hT : T ∈ F.surgery_times) [Nonempty (F.slice T).carrier] where |
| 71 | parent : SurgerySelectedComponent (F.slice (F.event T hT).tMinus) |
| 72 | child : SurgerySelectedComponent (F.slice T) |
| 73 | parent_metric : ℝ → RiemannianMetric 3 parent.carrier.carrier |
| 74 | child_metric : RiemannianMetric 3 child.carrier.carrier |
| 75 | parent_pullback : ∀ t : Set.Ico (F.event T hT).tMinus T, |
| 76 | ∀ x v w, ((F.event T hT).pre_flow.metric t.1).inner (parent.inclusion x) |
| 77 | (mfderiv (𝓡 3) (𝓡 3) parent.inclusion x v) |
| 78 | (mfderiv (𝓡 3) (𝓡 3) parent.inclusion x w) = |
| 79 | (parent_metric t.1).inner x v w |
| 80 | child_pullback : ∀ x v w, (F.metric T).inner (child.inclusion x) |
| 81 | (mfderiv (𝓡 3) (𝓡 3) child.inclusion x v) |
| 82 | (mfderiv (𝓡 3) (𝓡 3) child.inclusion x w) = child_metric.inner x v w |
| 83 | separating : ∀ i : Fin (F.event T hT).cap_count, |
| 84 | SeparatingSphere |
| 85 | (parent.inverse '' ((F.event T hT).limit_identify.inverse '' |
| 86 | ((F.event T hT).necks i).neck.central_sphere)) |
| 87 | inherited : ∃ x : parent.carrier.carrier, |
| 88 | parent.inclusion x ∈ interior (F.event T hT).retained_pre ∧ |
| 89 | (F.event T hT).retention.map (parent.inclusion x) ∈ Set.range child.inclusion |
| 90 | parent_simply_connected : SimplyConnectedSpace parent.carrier.carrier |
| 91 | child_simply_connected : SimplyConnectedSpace child.carrier.carrier |
| 92 | parent_orientation : surgeryThirdHomology parent.carrier.carrier ≃ₗ[ℤ] ULift.{u} ℤ |
| 93 | |
| 94 | def SurgeryComparisonInput.retained |
| 95 | {F : SurgeryFlowData.{u}} {T : ℝ} {hT : T ∈ F.surgery_times} |
| 96 | [Nonempty (F.slice T).carrier] |
| 97 | (I : SurgeryComparisonInput F T hT) : Set I.parent.carrier.carrier := |
| 98 | {x | I.parent.inclusion x ∈ interior (F.event T hT).retained_pre ∧ |
| 99 | (F.event T hT).retention.map (I.parent.inclusion x) ∈ Set.range I.child.inclusion} |
| 100 | |
| 101 | structure SurgeryComparisonConclusion {F : SurgeryFlowData.{u}} |
| 102 | {T : ℝ} {hT : T ∈ F.surgery_times} [Nonempty (F.slice T).carrier] |
| 103 | (I : SurgeryComparisonInput F T hT) where |
| 104 | map : ContinuousMap I.parent.carrier.carrier I.child.carrier.carrier |
| 105 | target_basepoint : I.child.carrier.carrier |
| 106 | based : map I.parent.basepoint = target_basepoint |
| 107 | child_orientation : surgeryThirdHomology I.child.carrier.carrier ≃ₗ[ℤ] ULift.{u} ℤ |
| 108 | retained_agreement : ∀ x ∈ I.retained, |
| 109 | I.child.inclusion (map x) = (F.event T hT).retention.map (I.parent.inclusion x) |
| 110 | outside_distance_decreasing : ∃ d : ℝ, 0 < d ∧ |
| 111 | ∀ t : ℝ, T - d < t → t < T → |
| 112 | ∀ x ∉ I.retained, ∀ y ∉ I.retained, |
| 113 | I.child_metric.edist (map x) (map y) ≤ |
| 114 | intrinsicEDist (I.parent_metric t) I.retainedᶜ x y |
| 115 | ambient_distance_decreasing : ∃ d : ℝ, 0 < d ∧ |
| 116 | ∀ t : ℝ, T - d < t → t < T → |
| 117 | ∀ x ∉ I.retained, ∀ y ∉ I.retained, |
| 118 | I.child_metric.edist (map x) (map y) ≤ |
| 119 | (I.parent_metric t).edist x y |
| 120 | degree_one : ∀ z : surgeryThirdHomology I.parent.carrier.carrier, |
| 121 | child_orientation (surgeryThirdHomologyMap map z) = I.parent_orientation z |
| 122 | homotopy_equivalence : ∃ e : ContinuousMap.HomotopyEquiv |
| 123 | I.parent.carrier.carrier I.child.carrier.carrier, e.toFun = map |
| 124 | pi_three_bijective : Function.Bijective (surgeryHomotopyMap (n := 3) map based) |
| 125 | smooth_approximants : ∀ eta : ℝ, 0 < eta → ∃ d : ℝ, 0 < d ∧ |
| 126 | ∀ t : ℝ, T - d < t → t < T → |
| 127 | ∃ f : ContinuousMap I.parent.carrier.carrier I.child.carrier.carrier, |
| 128 | ContMDiff (𝓡 3) (𝓡 3) ∞ f ∧ |
| 129 | (∃ hbase : f I.parent.basepoint = target_basepoint, |
| 130 | ∀ alpha, surgeryHomotopyMap (n := 3) f hbase alpha = |
| 131 | surgeryHomotopyMap map based alpha) ∧ |
| 132 | ContinuousMap.Homotopic f map ∧ |
| 133 | (∀ x y, I.child_metric.edist (f x) (f y) ≤ |
| 134 | ENNReal.ofReal (1 + eta) * (I.parent_metric t).edist x y) ∧ |
| 135 | (∀ z : surgeryThirdHomology I.parent.carrier.carrier, |
| 136 | child_orientation (surgeryThirdHomologyMap f z) = I.parent_orientation z) |
| 137 | |
| 138 | end PoincareMT |