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.SourceNames |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.EpochExtension.Spacetime.GeneralizedCylinderSpatial |
| 3 | import PoincareLib.Geometry.Manifold.InverseFunction |
| 4 | |
| 5 | /-! |
| 6 | # Spatial homeomorphisms of generalized cylinders |
| 7 | |
| 8 | The actual stored inverse makes the spatial differential injective. In |
| 9 | equal dimensions this gives an open image and a smooth partial |
| 10 | homeomorphism, also at included time endpoints. These are the maps used |
| 11 | in the volume step of Theorem 11.8, p. 272, with the cylinder conventions |
| 12 | of Morgan--Tian Definitions 3.38--3.41, pp. 61--62. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M30.Cylinder |
| 23 | |
| 24 | variable {F : GeneralizedRicciFlowData.{u}} {C : GeneralizedSliceCarrier.{u}} |
| 25 | {a q : ℝ} {J : SpacetimeInterval} {U : TopologicalSpace.Opens C.carrier} |
| 26 | (e : GeneralizedFlowCylinder F C a q J.domain U) |
| 27 | |
| 28 | /-- Each spatial image is open, including at the time endpoints |
| 29 | (Definitions 3.38--3.41, pp. 61--62; Theorem 11.8, p. 272). -/ |
| 30 | theorem isOpen_spatial_image (s : J.domain) : |
| 31 | IsOpen (e.forward s.1 s.2 '' U) := by |
| 32 | apply isOpen_iff_mem_nhds.mpr |
| 33 | rintro y ⟨x, hx, rfl⟩ |
| 34 | have hi := Proofs.M12.rawForward_differential_injective e s ⟨x, hx⟩ |
| 35 | let : FiniteDimensional ℝ (TangentSpace (𝓡 3) x) := by |
| 36 | unfold TangentSpace |
| 37 | exact (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis.finiteDimensional_of_finite |
| 38 | let : FiniteDimensional ℝ (TangentSpace (𝓡 3) (e.forward s.1 s.2 x)) := by |
| 39 | unfold TangentSpace |
| 40 | exact (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis.finiteDimensional_of_finite |
| 41 | have hbij : Function.Bijective (mfderiv (𝓡 3) (𝓡 3) (e.forward s.1 s.2) x) := |
| 42 | ⟨hi, (LinearMap.injective_iff_surjective_of_finrank_eq_finrank rfl).mp hi⟩ |
| 43 | rw [← Poincare.map_nhds_eq_of_contMDiffAt_mfderiv_bijective |
| 44 | ((e.forward_smooth s.1 s.2 x hx).contMDiffAt (U.isOpen.mem_nhds hx)) hbij] |
| 45 | exact image_mem_map (U.isOpen.mem_nhds hx) |
| 46 | |
| 47 | /-- The literal forward and inverse maps form an open partial homeomorphism |
| 48 | on the actual cylinder source (Definitions 3.38--3.41, pp. 61--62). -/ |
| 49 | def spatialHomeomorph (s : J.domain) : |
| 50 | OpenPartialHomeomorph C.carrier (F.slice (a + s.1 / q)).carrier where |
| 51 | toFun := e.forward s.1 s.2 |
| 52 | invFun := e.inverse s.1 s.2 |
| 53 | source := U |
| 54 | target := e.forward s.1 s.2 '' U |
| 55 | map_source' x hx := mem_image_of_mem _ hx |
| 56 | map_target' y hy := by |
| 57 | rcases hy with ⟨x, hx, rfl⟩ |
| 58 | rw [e.left_inverse s.1 s.2 hx] |
| 59 | exact hx |
| 60 | left_inv' := e.left_inverse s.1 s.2 |
| 61 | right_inv' := e.right_inverse s.1 s.2 |
| 62 | open_source := U.isOpen |
| 63 | open_target := isOpen_spatial_image e s |
| 64 | continuousOn_toFun := (e.forward_smooth s.1 s.2).continuousOn |
| 65 | continuousOn_invFun := (e.inverse_smooth s.1 s.2).continuousOn |
| 66 | |
| 67 | /-- The actual forward slice is smooth at every source point |
| 68 | (Definitions 3.38--3.41, pp. 61--62; Theorem 11.8, p. 272). -/ |
| 69 | theorem spatialHomeomorph_contMDiffAt (s : J.domain) {x : C.carrier} |
| 70 | (hx : x ∈ (spatialHomeomorph e s).source) : |
| 71 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ (spatialHomeomorph e s) x := |
| 72 | (e.forward_smooth s.1 s.2 x hx).contMDiffAt (U.isOpen.mem_nhds hx) |
| 73 | |
| 74 | /-- The stored inverse is smooth at every point of the actual open image |
| 75 | (Definitions 3.38--3.41, pp. 61--62; Theorem 11.8, p. 272). -/ |
| 76 | theorem spatialHomeomorph_symm_contMDiffAt (s : J.domain) |
| 77 | {y : (F.slice (a + s.1 / q)).carrier} |
| 78 | (hy : y ∈ (spatialHomeomorph e s).target) : |
| 79 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ (spatialHomeomorph e s).symm y := |
| 80 | (e.inverse_smooth s.1 s.2 y hy).contMDiffAt |
| 81 | ((isOpen_spatial_image e s).mem_nhds hy) |
| 82 | |
| 83 | end PoincareMT.M30.Cylinder |