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.Extinction.Width.Deformation.Family |
| 2 | import PoincareLib.Geometry.RicciFlow.Blowup.Controlled.Geometry |
| 3 | import Mathlib.AlgebraicTopology.SingularHomology.Basic |
| 4 | import Mathlib.Algebra.Category.ModuleCat.Abelian |
| 5 | import Mathlib.Algebra.Category.ModuleCat.Colimits |
| 6 | import Mathlib.Geometry.Manifold.Diffeomorph |
| 7 | |
| 8 | /-! |
| 9 | # A transported width class along changing surgery components |
| 10 | |
| 11 | The selected component is a compact manifold embedded as an actual connected |
| 12 | component of its ambient time slice. Regular intervals carry ordinary Ricci |
| 13 | flows; only maps approaching a surgery time have an asymptotically unit |
| 14 | Lipschitz bound. Their degree uses Mathlib's integral singular homology map. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle Topology ENNReal intervalIntegral |
| 20 | |
| 21 | universe u v |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- Postcomposition of a based cube representative by an actual continuous map. -/ |
| 26 | def mappedGenLoop {X : Type u} {Y : Type v} [TopologicalSpace X] |
| 27 | [TopologicalSpace Y] {x : X} {y : Y} {n : ℕ} |
| 28 | (f : ContinuousMap X Y) (h : f x = y) (gamma : GenLoop (Fin n) X x) : |
| 29 | 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 | /-- The induced homotopy-group map, defined on the actual homotopy quotient. -/ |
| 36 | def mappedHomotopyClass {X : Type u} {Y : Type v} [TopologicalSpace X] |
| 37 | [TopologicalSpace Y] {x : X} {y : Y} {n : ℕ} |
| 38 | (f : ContinuousMap X Y) (h : f x = y) : |
| 39 | HomotopyGroup.Pi n X x → HomotopyGroup.Pi n Y y := |
| 40 | Quotient.map (mappedGenLoop f h) (fun _ _ hab => |
| 41 | ContinuousMap.HomotopicRel.comp_continuousMap hab f) |
| 42 | |
| 43 | /-- Integral third homology with the coefficient copy of `Z` in the carrier universe. -/ |
| 44 | noncomputable def componentThirdHomology (X : Type u) [TopologicalSpace X] : |
| 45 | ModuleCat.{u} ℤ := |
| 46 | (((AlgebraicTopology.singularHomologyFunctor (ModuleCat.{u} ℤ) 3).obj |
| 47 | (ModuleCat.of ℤ (ULift.{u} ℤ))).obj (TopCat.of X)) |
| 48 | |
| 49 | noncomputable def componentThirdHomologyMap {X Y : Type u} |
| 50 | [TopologicalSpace X] [TopologicalSpace Y] (f : ContinuousMap X Y) : |
| 51 | componentThirdHomology X →ₗ[ℤ] componentThirdHomology Y := |
| 52 | (((AlgebraicTopology.singularHomologyFunctor (ModuleCat.{u} ℤ) 3).obj |
| 53 | (ModuleCat.of ℤ (ULift.{u} ℤ))).map (TopCat.ofHom f)).hom |
| 54 | |
| 55 | /-- One selected connected component, including its actual ambient-slice embedding. -/ |
| 56 | structure WidthComponentSlice where |
| 57 | ambient : GeneralizedSliceCarrier.{u} |
| 58 | carrier : GeneralizedSliceCarrier.{u} |
| 59 | inclusion : carrier.carrier → ambient.carrier |
| 60 | inclusion_openEmbedding : Topology.IsOpenEmbedding inclusion |
| 61 | inclusion_smooth : ContMDiff (𝓡 3) (𝓡 3) ∞ inclusion |
| 62 | ambient_metric : RiemannianMetric 3 ambient.carrier |
| 63 | metric : RiemannianMetric 3 carrier.carrier |
| 64 | connection : LeviCivitaData metric |
| 65 | metric_pullback : ∀ x v w, |
| 66 | ambient_metric.inner (inclusion x) |
| 67 | (mfderiv (𝓡 3) (𝓡 3) inclusion x v) |
| 68 | (mfderiv (𝓡 3) (𝓡 3) inclusion x w) = metric.inner x v w |
| 69 | compact : IsCompact (Set.univ : Set carrier.carrier) |
| 70 | connected : IsConnected (Set.univ : Set carrier.carrier) |
| 71 | family : FreeTwoSphereFamily (M := carrier.carrier) |
| 72 | component_range : Set.range inclusion = connectedComponent (inclusion family.basepoint) |
| 73 | pi_two : Subsingleton (HomotopyGroup.Pi 2 carrier.carrier family.basepoint) |
| 74 | loop_pi_three : HomotopyGroup.Pi 2 (C1FreeLoopSpace (M := carrier.carrier)) |
| 75 | (constantC1Loop family.basepoint) ≃* |
| 76 | HomotopyGroup.Pi 3 carrier.carrier family.basepoint |
| 77 | pi_three_integer : HomotopyGroup.Pi 3 carrier.carrier family.basepoint ≃* |
| 78 | Multiplicative ℤ |
| 79 | orientation : componentThirdHomology carrier.carrier ≃ₗ[ℤ] ULift.{u} ℤ |
| 80 | |
| 81 | noncomputable def componentPiThreeClass (C : WidthComponentSlice.{u}) : |
| 82 | HomotopyGroup.Pi 3 C.carrier.carrier C.family.basepoint := |
| 83 | C.loop_pi_three C.family.homotopy_class |
| 84 | |
| 85 | /-- A geometric map with its actual action on both representatives and classes. |
| 86 | The loop postcomposition is determined on the whole carried C1 extension; |
| 87 | the homotopy-group action is therefore not a freely chosen group homomorphism. -/ |
| 88 | structure SmoothComponentClassMap (C D : WidthComponentSlice.{u}) where |
| 89 | map : ContinuousMap C.carrier.carrier D.carrier.carrier |
| 90 | smooth : ContMDiff (𝓡 3) (𝓡 3) ∞ map |
| 91 | based : map C.family.basepoint = D.family.basepoint |
| 92 | loop_map : ContinuousMap (C1FreeLoopSpace (M := C.carrier.carrier)) |
| 93 | (C1FreeLoopSpace (M := D.carrier.carrier)) |
| 94 | loop_extension : ∀ gamma x, (loop_map gamma).extension x = map (gamma.extension x) |
| 95 | loop_based : loop_map (constantC1Loop C.family.basepoint) = |
| 96 | constantC1Loop D.family.basepoint |
| 97 | loop_class : mappedHomotopyClass loop_map loop_based C.family.homotopy_class = |
| 98 | D.family.homotopy_class |
| 99 | pi_three_naturality : ∀ alpha, |
| 100 | D.loop_pi_three (mappedHomotopyClass loop_map loop_based alpha) = |
| 101 | mappedHomotopyClass map based (C.loop_pi_three alpha) |
| 102 | pi_three_injective : Function.Injective (mappedHomotopyClass (n := 3) map based) |
| 103 | family_homotopic : ∃ Gamma : FreeTwoSphereFamily (M := D.carrier.carrier), |
| 104 | (∀ c, Gamma.family c = loop_map (C.family.family c)) ∧ |
| 105 | FreeTwoSphereHomotopic Gamma D.family |
| 106 | |
| 107 | /-- Degree one means that the actual integral homology map preserves the |
| 108 | selected orientation generators. -/ |
| 109 | def ComponentMapDegreeOne {C D : WidthComponentSlice.{u}} |
| 110 | (f : SmoothComponentClassMap C D) : Prop := |
| 111 | ∀ z : componentThirdHomology C.carrier.carrier, |
| 112 | D.orientation (componentThirdHomologyMap f.map z) = C.orientation z |
| 113 | |
| 114 | variable {M : Type u} [TopologicalSpace M] |
| 115 | [ChartedSpace LoopAmbient M] [IsManifold (𝓡 3) ∞ M] |
| 116 | |
| 117 | /-- Identification of one surgery-free closed subinterval with a genuine |
| 118 | Ricci flow on its initial selected component. -/ |
| 119 | structure WidthRegularSlab {t₀ t₁ : ℝ} |
| 120 | (slice : Set.Icc t₀ t₁ → WidthComponentSlice.{u}) |
| 121 | (a b : Set.Icc t₀ t₁) where |
| 122 | ordered : a.1 < b.1 |
| 123 | flow : RicciFlow 3 (slice a).carrier.carrier (Set.Icc a.1 b.1) |
| 124 | identify : ∀ s : Set.Icc a.1 b.1, |
| 125 | Diffeomorph (𝓡 3) (𝓡 3) (slice a).carrier.carrier |
| 126 | (slice ⟨s.1, ⟨a.2.1.trans s.2.1, s.2.2.trans b.2.2⟩⟩).carrier.carrier ∞ |
| 127 | initial_identify : ∀ x, |
| 128 | identify ⟨a.1, ⟨le_rfl, ordered.le⟩⟩ x = x |
| 129 | class_map : ∀ s : Set.Icc a.1 b.1, |
| 130 | SmoothComponentClassMap (slice a) |
| 131 | (slice ⟨s.1, ⟨a.2.1.trans s.2.1, s.2.2.trans b.2.2⟩⟩) |
| 132 | class_map_identify : ∀ s x, (class_map s).map x = identify s x |
| 133 | metric_pullback : ∀ (s : Set.Icc a.1 b.1) x v w, |
| 134 | (slice ⟨s.1, ⟨a.2.1.trans s.2.1, s.2.2.trans b.2.2⟩⟩).metric.inner |
| 135 | (identify s x) (mfderiv (𝓡 3) (𝓡 3) (identify s) x v) |
| 136 | (mfderiv (𝓡 3) (𝓡 3) (identify s) x w) = |
| 137 | (flow.metric s.1).inner x v w |
| 138 | scalar_pullback : ∀ (s : Set.Icc a.1 b.1) x, |
| 139 | (slice ⟨s.1, ⟨a.2.1.trans s.2.1, s.2.2.trans b.2.2⟩⟩).connection.scalarCurvature |
| 140 | (identify s x) = (flow.connection s.1).scalarCurvature x |
| 141 | |
| 142 | /-- A component path carrying one transported nonzero class. This interface |
| 143 | contains topology and geometry supplied by the surgery construction, but no |
| 144 | width inequality or extinction assumption. -/ |
| 145 | structure SurgeryComponentPath (M : Type u) [TopologicalSpace M] |
| 146 | [ChartedSpace LoopAmbient M] [IsManifold (𝓡 3) ∞ M] |
| 147 | (t₀ t₁ : ℝ) where |
| 148 | time_ordered : t₀ ≤ t₁ |
| 149 | slice : Set.Icc t₀ t₁ → WidthComponentSlice.{u} |
| 150 | initial_identification : Diffeomorph (𝓡 3) (𝓡 3) M |
| 151 | (slice ⟨t₀, ⟨le_rfl, time_ordered⟩⟩).carrier.carrier ∞ |
| 152 | initial_class_nonzero : |
| 153 | componentPiThreeClass (slice ⟨t₀, ⟨le_rfl, time_ordered⟩⟩) ≠ 1 |
| 154 | surgery_times : Set ℝ |
| 155 | surgery_finite : (surgery_times ∩ Set.Icc t₀ t₁).Finite |
| 156 | transport : ∀ s t : Set.Icc t₀ t₁, s.1 ≤ t.1 → |
| 157 | SmoothComponentClassMap (slice s) (slice t) |
| 158 | regular_slabs : ∀ a b : Set.Icc t₀ t₁, a.1 < b.1 → |
| 159 | Disjoint surgery_times (Set.Ioc a.1 b.1) → Nonempty (WidthRegularSlab slice a b) |
| 160 | surgery_comparison : ∀ t : Set.Icc t₀ t₁, t.1 ∈ surgery_times → |
| 161 | ∀ eta : ℝ, 0 < eta → ∃ delta : ℝ, 0 < delta ∧ |
| 162 | ∀ s : Set.Icc t₀ t₁, t.1 - delta < s.1 → s.1 < t.1 → |
| 163 | ∃ f : SmoothComponentClassMap (slice s) (slice t), |
| 164 | ComponentMapDegreeOne f ∧ |
| 165 | (∀ x y, (slice t).metric.edist (f.map x) (f.map y) ≤ |
| 166 | ENNReal.ofReal (1 + eta) * (slice s).metric.edist x y) ∧ |
| 167 | (∀ (hst : s.1 < t.1) alpha, |
| 168 | mappedHomotopyClass (n := 3) f.map f.based alpha = |
| 169 | mappedHomotopyClass (transport s t (le_of_lt hst)).map |
| 170 | (transport s t (le_of_lt hst)).based alpha) |
| 171 | |
| 172 | noncomputable def componentWidth {t₀ t₁ : ℝ} |
| 173 | (P : SurgeryComponentPath M t₀ t₁) |
| 174 | (t : Set.Icc t₀ t₁) : ℝ := |
| 175 | classWidth (P.slice t).metric (P.slice t).family |
| 176 | |
| 177 | noncomputable def componentScalarInfimum {t₀ t₁ : ℝ} |
| 178 | (P : SurgeryComponentPath M t₀ t₁) |
| 179 | (t : Set.Icc t₀ t₁) : ℝ := |
| 180 | sInf (Set.range (fun x : (P.slice t).carrier.carrier => |
| 181 | (P.slice t).connection.scalarCurvature x)) |
| 182 | |
| 183 | end PoincareMT |