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.Blowup.Construction.Generalized.CylinderSpatialHomeomorph |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.EpochExtension.Spacetime.GeneralizedCylinderRestriction |
| 3 | import Mathlib.Topology.Algebra.Group.Basic |
| 4 | |
| 5 | /-! |
| 6 | # Recenter an actual generalized cylinder |
| 7 | |
| 8 | Morgan--Tian Definitions 3.38--3.41, pp. 61--62, and Definition 9.1, |
| 9 | p. 180. A chosen included slice supplies new spatial labels and a new |
| 10 | origin, with the same positive scale and the same actual worldlines. |
| 11 | The stored maps remain total, and the spacetime embedding and vertical |
| 12 | compatibility are retained on every supplied translated time domain. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M30.Cylinder |
| 23 | |
| 24 | private noncomputable def recenterSliceDiffeomorph (F : GeneralizedRicciFlowData.{u}) |
| 25 | {s t : ℝ} (h : s = t) : |
| 26 | (F.slice s).carrier ≃ₘ^∞⟮𝓡 3, 𝓡 3⟯ (F.slice t).carrier := by |
| 27 | subst t |
| 28 | exact Diffeomorph.refl (𝓡 3) (F.slice s).carrier ∞ |
| 29 | |
| 30 | private theorem recenterSliceDiffeomorph_point (F : GeneralizedRicciFlowData.{u}) |
| 31 | {s t : ℝ} (h : s = t) (x : (F.slice s).carrier) : |
| 32 | (⟨t, recenterSliceDiffeomorph F h x⟩ : F.point) = (⟨s, x⟩ : F.point) := by |
| 33 | subst t |
| 34 | rfl |
| 35 | |
| 36 | private theorem recenterClock_eq (a q t0 s : ℝ) : |
| 37 | a + (t0 + s) / q = (a + t0 / q) + s / q := by |
| 38 | simp only [add_div, add_assoc] |
| 39 | |
| 40 | variable {F : GeneralizedRicciFlowData.{u}} {C : GeneralizedSliceCarrier.{u}} |
| 41 | {a q : ℝ} {J : SpacetimeInterval} {U : TopologicalSpace.Opens C.carrier} |
| 42 | (e : GeneralizedFlowCylinder F C a q J.domain U) |
| 43 | (t0 : J.domain) |
| 44 | (V : TopologicalSpace.Opens (F.slice (a + t0.val / q)).carrier) |
| 45 | (hV : (V : Set (F.slice (a + t0.val / q)).carrier) ⊆ |
| 46 | e.forward t0.val t0.property '' (U : Set C.carrier)) |
| 47 | {I : Set ℝ} |
| 48 | (hI : I ⊆ (fun s : ℝ => t0.val + s) ⁻¹' J.domain) |
| 49 | |
| 50 | /-- Use an included actual slice as the cylinder's reference carrier, |
| 51 | retaining its scale and worldlines (Definitions 3.38--3.41, pp. 61--62). |
| 52 | The new spatial subset and time domain may be empty. -/ |
| 53 | noncomputable def recenter : |
| 54 | GeneralizedFlowCylinder F (F.slice (a + t0.val / q)) |
| 55 | (a + t0.val / q) q I V := by |
| 56 | let H0 := spatialHomeomorph e t0 |
| 57 | let D (s : ℝ) := recenterSliceDiffeomorph F (recenterClock_eq a q t0.val s) |
| 58 | have hinto (y : (F.slice (a + t0.val / q)).carrier) (hy : y ∈ H0.target) : |
| 59 | e.inverse t0.val t0.property y ∈ U := H0.map_target hy |
| 60 | let R : GeneralizedFlowCylinder F (F.slice (a + t0.val / q)) |
| 61 | (a + t0.val / q) q I H0.target := { |
| 62 | scale_pos := e.scale_pos |
| 63 | forward := fun s hs => D s ∘ e.forward (t0.val + s) (hI hs) ∘ |
| 64 | e.inverse t0.val t0.property |
| 65 | inverse := fun s hs => e.forward t0.val t0.property ∘ |
| 66 | e.inverse (t0.val + s) (hI hs) ∘ (D s).symm |
| 67 | forward_smooth := fun s hs => (D s).contMDiff.comp_contMDiffOn |
| 68 | ((e.forward_smooth (t0.val + s) (hI hs)).comp |
| 69 | (e.inverse_smooth t0.val t0.property) hinto) |
| 70 | inverse_smooth := by |
| 71 | intro s hs |
| 72 | apply (e.forward_smooth t0.val t0.property).comp |
| 73 | · apply (e.inverse_smooth (t0.val + s) (hI hs)).comp |
| 74 | (D s).symm.contMDiff.contMDiffOn |
| 75 | rintro y ⟨x, hx, rfl⟩ |
| 76 | change (D s).symm (D s (e.forward (t0.val + s) (hI hs) |
| 77 | (e.inverse t0.val t0.property x))) ∈ |
| 78 | e.forward (t0.val + s) (hI hs) '' (U : Set C.carrier) |
| 79 | rw [Diffeomorph.symm_apply_apply] |
| 80 | exact mem_image_of_mem (e.forward (t0.val + s) (hI hs)) (hinto x hx) |
| 81 | · rintro y ⟨x, hx, rfl⟩ |
| 82 | change e.inverse (t0.val + s) (hI hs) |
| 83 | ((D s).symm (D s (e.forward (t0.val + s) (hI hs) |
| 84 | (e.inverse t0.val t0.property x)))) ∈ U |
| 85 | rw [Diffeomorph.symm_apply_apply, |
| 86 | e.left_inverse (t0.val + s) (hI hs) (hinto x hx)] |
| 87 | exact hinto x hx |
| 88 | left_inverse := by |
| 89 | intro s hs x hx |
| 90 | simpa only [Function.comp_apply, Diffeomorph.symm_apply_apply, |
| 91 | e.left_inverse (t0.val + s) (hI hs) (hinto x hx)] using |
| 92 | e.right_inverse t0.val t0.property hx |
| 93 | right_inverse := by |
| 94 | intro s hs y hy |
| 95 | obtain ⟨x, hx, rfl⟩ := hy |
| 96 | simp only [Function.comp_apply, Diffeomorph.symm_apply_apply, |
| 97 | e.left_inverse (t0.val + s) (hI hs) (hinto x hx), |
| 98 | e.right_inverse t0.val t0.property hx] |
| 99 | embedding := by |
| 100 | have hclock : Topology.IsEmbedding (fun s : I => t0.val + s.val) := |
| 101 | (Homeomorph.addLeft t0.val).isEmbedding.comp |
| 102 | (Topology.IsEmbedding.subtypeVal : |
| 103 | Topology.IsEmbedding (Subtype.val : I → ℝ)) |
| 104 | have hspace : Topology.IsEmbedding |
| 105 | (fun y : H0.target => |
| 106 | (⟨e.inverse t0.val t0.property y.val, hinto y.val y.property⟩ : U)) := |
| 107 | H0.symm.toHomeomorphSourceTarget.isEmbedding |
| 108 | have h := e.embedding.comp |
| 109 | ((hclock.codRestrict J.domain (fun s => hI s.property)).prodMap hspace) |
| 110 | convert h using 1 |
| 111 | funext p |
| 112 | exact recenterSliceDiffeomorph_point F (recenterClock_eq a q t0.val p.1.val) _ |
| 113 | vertical_compatibility := by |
| 114 | intro s hs x hx |
| 115 | obtain ⟨b, y, δ, hδ, hbox⟩ := e.vertical_compatibility |
| 116 | (t0.val + s) (hI hs) (e.inverse t0.val t0.property x) (hinto x hx) |
| 117 | refine ⟨b, y, δ, hδ, ?_⟩ |
| 118 | intro s' hs' hnear |
| 119 | have hnear' : |(t0.val + s') - (t0.val + s)| < δ := by |
| 120 | rw [show (t0.val + s') - (t0.val + s) = s' - s by ring] |
| 121 | exact hnear |
| 122 | obtain ⟨hb, hforward⟩ := hbox (t0.val + s') (hI hs') hnear' |
| 123 | have ht := recenterClock_eq a q t0.val s' |
| 124 | have hb' : (a + t0.val / q) + s' / q ∈ (F.box b).interval := ht ▸ hb |
| 125 | refine ⟨hb', ?_⟩ |
| 126 | have hpoints : |
| 127 | (⟨(a + t0.val / q) + s' / q, |
| 128 | D s' (e.forward (t0.val + s') (hI hs') |
| 129 | (e.inverse t0.val t0.property x))⟩ : F.point) = |
| 130 | (⟨(a + t0.val / q) + s' / q, |
| 131 | (F.box b).forward _ hb' y⟩ : F.point) := by |
| 132 | calc |
| 133 | _ = (⟨a + (t0.val + s') / q, |
| 134 | e.forward (t0.val + s') (hI hs') |
| 135 | (e.inverse t0.val t0.property x)⟩ : F.point) := |
| 136 | recenterSliceDiffeomorph_point F ht _ |
| 137 | _ = (⟨a + (t0.val + s') / q, (F.box b).forward _ hb y⟩ : F.point) := |
| 138 | congrArg (Sigma.mk _) hforward |
| 139 | _ = _ := congrArg |
| 140 | (fun t : (F.box b).interval => |
| 141 | (⟨t.val, (F.box b).forward t.val t.property y⟩ : F.point)) |
| 142 | (show (⟨a + (t0.val + s') / q, hb⟩ : (F.box b).interval) = |
| 143 | ⟨(a + t0.val / q) + s' / q, hb'⟩ from Subtype.ext ht) |
| 144 | exact eq_of_heq (Sigma.mk.inj_iff.mp hpoints).2 } |
| 145 | exact R.restrict Subset.rfl hV |
| 146 | |
| 147 | /-- Recentering retains the actual old spacetime point for every input, |
| 148 | including total values outside the spatial subset |
| 149 | (Definitions 3.38 and 3.40, p. 61). -/ |
| 150 | @[simp] theorem recenter_pointMap (s : ℝ) (hs : s ∈ I) |
| 151 | (y : (F.slice (a + t0.val / q)).carrier) : |
| 152 | (recenter e t0 V hV hI).pointMap s hs y = |
| 153 | e.pointMap (t0.val + s) (hI hs) |
| 154 | (e.inverse t0.val t0.property y) := |
| 155 | recenterSliceDiffeomorph_point F (recenterClock_eq a q t0.val s) _ |
| 156 | |
| 157 | /-- The recentered cylinder is the identity on its actual reference slice, |
| 158 | as required for the parabolic test of Definitions 3.38 and 9.1, |
| 159 | pp. 61 and 180. -/ |
| 160 | theorem recenter_zero_identity (hzero : (0 : ℝ) ∈ I) |
| 161 | (y : (F.slice (a + t0.val / q)).carrier) (hy : y ∈ V) : |
| 162 | (recenter e t0 V hV hI).pointMap 0 hzero y = |
| 163 | (⟨a + t0.val / q, y⟩ : F.point) := by |
| 164 | rw [recenter_pointMap] |
| 165 | calc |
| 166 | _ = e.pointMap t0.val t0.property (e.inverse t0.val t0.property y) := |
| 167 | congrArg (fun s : J.domain => |
| 168 | e.pointMap s.val s.property (e.inverse t0.val t0.property y)) |
| 169 | (show (⟨t0.val + 0, hI hzero⟩ : J.domain) = t0 from |
| 170 | Subtype.ext (add_zero t0.val)) |
| 171 | _ = _ := congrArg (fun x : (F.slice (a + t0.val / q)).carrier => |
| 172 | (⟨a + t0.val / q, x⟩ : F.point)) |
| 173 | (e.right_inverse t0.val t0.property (hV hy)) |
| 174 | |
| 175 | end PoincareMT.M30.Cylinder |