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.StandardCap.Existence.Geometry.Basic.GeneralizedCylinderDifferential |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Analysis.Basic.ManifoldOpenMap |
| 3 | import Mathlib.Analysis.Normed.Module.FiniteDimension |
| 4 | |
| 5 | /-! |
| 6 | # Actual open spatial embeddings of generalized cylinders |
| 7 | |
| 8 | The cylinder's inverse laws and smoothness make its spatial restriction |
| 9 | a homeomorphism onto its actual image. In equal finite dimension its |
| 10 | injective differential is bijective, so an open source has open image. |
| 11 | These statements justify pushing forward the shorter neck carrier in |
| 12 | Morgan-Tian Theorem 12.28, pp. 323-324. |
| 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.GeneralizedFlowCylinder |
| 23 | |
| 24 | variable {F : GeneralizedRicciFlowData.{u}} {C : GeneralizedSliceCarrier.{u}} |
| 25 | {origin scale : ℝ} {I : Set ℝ} {U : Set C.carrier} |
| 26 | (e : GeneralizedFlowCylinder F C origin scale I U) |
| 27 | |
| 28 | /-- A spatial restriction of an actual generalized cylinder is a |
| 29 | homeomorphism onto its image, including endpoint times (Theorem 12.28). -/ |
| 30 | noncomputable def restrictedSpatialHomeomorph {V : Set C.carrier} (hV : V ⊆ U) |
| 31 | (s : ℝ) (hs : s ∈ I) : V ≃ₜ (e.forward s hs '' V) := by |
| 32 | have hmem (y : e.forward s hs '' V) : e.inverse s hs y ∈ V := by |
| 33 | obtain ⟨x, hx, heq⟩ := y.property |
| 34 | rw [← heq, e.left_inverse s hs (hV hx)] |
| 35 | exact hx |
| 36 | refine { |
| 37 | toFun := fun x => ⟨e.forward s hs x, mem_image_of_mem _ x.property⟩ |
| 38 | invFun := fun y => ⟨e.inverse s hs y, hmem y⟩ |
| 39 | left_inv := fun x => Subtype.ext (e.left_inverse s hs (hV x.property)) |
| 40 | right_inv := fun y => Subtype.ext |
| 41 | (e.right_inverse s hs ((image_mono hV) y.property)) |
| 42 | continuous_toFun := ?_ |
| 43 | continuous_invFun := ?_ |
| 44 | } |
| 45 | · exact ((e.forward_smooth s hs).continuousOn.comp_continuous |
| 46 | continuous_subtype_val (fun x => hV x.property)).subtype_mk _ |
| 47 | · exact ((e.inverse_smooth s hs).continuousOn.comp_continuous |
| 48 | continuous_subtype_val (fun y => (image_mono hV) y.property)).subtype_mk _ |
| 49 | |
| 50 | namespace StandardCapImport |
| 51 | |
| 52 | /-- The spatial derivative of the cylinder is bijective on its actual |
| 53 | open source, using the equal finite tangent dimension (Theorem 12.28). -/ |
| 54 | theorem forward_mfderiv_bijective (hU : IsOpen U) {s : ℝ} (hs : s ∈ I) |
| 55 | {x : C.carrier} (hx : x ∈ U) : |
| 56 | Function.Bijective (mfderiv (𝓡 3) (𝓡 3) (e.forward s hs) x) := by |
| 57 | have hfinite : FiniteDimensional ℝ (EuclideanSpace ℝ (Fin 3)) := |
| 58 | Module.Finite.of_basis (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis |
| 59 | let : FiniteDimensional ℝ (TangentSpace (𝓡 3) x) := by |
| 60 | unfold TangentSpace |
| 61 | exact hfinite |
| 62 | let : FiniteDimensional ℝ (TangentSpace (𝓡 3) (e.forward s hs x)) := by |
| 63 | unfold TangentSpace |
| 64 | exact hfinite |
| 65 | have hd : Module.finrank ℝ (TangentSpace (𝓡 3) x) = |
| 66 | Module.finrank ℝ (TangentSpace (𝓡 3) (e.forward s hs x)) := rfl |
| 67 | have hi := e.forward_mfderiv_injective hU hs hx |
| 68 | exact ⟨hi, (LinearMap.injective_iff_surjective_of_finrank_eq_finrank hd).mp hi⟩ |
| 69 | |
| 70 | end StandardCapImport |
| 71 | |
| 72 | export StandardCapImport (forward_mfderiv_bijective) |
| 73 | |
| 74 | namespace StandardCapImport |
| 75 | |
| 76 | /-- The image of every open subset of the cylinder source is open in |
| 77 | the actual target time slice (Theorem 12.28). -/ |
| 78 | theorem isOpen_forward_image (hU : IsOpen U) {V : Set C.carrier} |
| 79 | (hV : IsOpen V) (hVU : V ⊆ U) {s : ℝ} (hs : s ∈ I) : |
| 80 | IsOpen (e.forward s hs '' V) := |
| 81 | M34.isOpen_image_of_contMDiffOn_mfderiv_bijective hV |
| 82 | ((e.forward_smooth s hs).mono hVU) |
| 83 | (fun _ hx => e.forward_mfderiv_bijective hU hs (hVU hx)) |
| 84 | |
| 85 | end StandardCapImport |
| 86 | |
| 87 | export StandardCapImport (isOpen_forward_image) |
| 88 | |
| 89 | /-- The actual spatial cylinder maps form an open partial homeomorphism |
| 90 | with the original total inverse and the precise image as target. -/ |
| 91 | noncomputable def spatialOpenPartialHomeomorph (hU : IsOpen U) |
| 92 | (s : ℝ) (hs : s ∈ I) : |
| 93 | OpenPartialHomeomorph C.carrier (F.slice (origin + s / scale)).carrier where |
| 94 | toFun := e.forward s hs |
| 95 | invFun := e.inverse s hs |
| 96 | source := U |
| 97 | target := e.forward s hs '' U |
| 98 | map_source' := fun _ hx => mem_image_of_mem _ hx |
| 99 | map_target' := by |
| 100 | rintro _ ⟨x, hx, rfl⟩ |
| 101 | rwa [e.left_inverse s hs hx] |
| 102 | left_inv' := e.left_inverse s hs |
| 103 | right_inv' := e.right_inverse s hs |
| 104 | continuousOn_toFun := (e.forward_smooth s hs).continuousOn |
| 105 | continuousOn_invFun := (e.inverse_smooth s hs).continuousOn |
| 106 | open_source := hU |
| 107 | open_target := e.isOpen_forward_image hU hU (Subset.refl U) hs |
| 108 | |
| 109 | /-- The partial homeomorphism retains the supplied smooth forward map |
| 110 | on its actual open source. -/ |
| 111 | theorem spatialOpenPartialHomeomorph_contMDiffOn (hU : IsOpen U) |
| 112 | (s : ℝ) (hs : s ∈ I) : |
| 113 | ContMDiffOn (𝓡 3) (𝓡 3) ∞ (e.spatialOpenPartialHomeomorph hU s hs) |
| 114 | (e.spatialOpenPartialHomeomorph hU s hs).source := |
| 115 | e.forward_smooth s hs |
| 116 | |
| 117 | /-- The partial homeomorphism retains the supplied smooth inverse on |
| 118 | the actual image, as required by the reverse-ball continuation argument. -/ |
| 119 | theorem spatialOpenPartialHomeomorph_symm_contMDiffOn (hU : IsOpen U) |
| 120 | (s : ℝ) (hs : s ∈ I) : |
| 121 | ContMDiffOn (𝓡 3) (𝓡 3) ∞ (e.spatialOpenPartialHomeomorph hU s hs).symm |
| 122 | (e.spatialOpenPartialHomeomorph hU s hs).target := |
| 123 | e.inverse_smooth s hs |
| 124 | |
| 125 | /-- The spatial cylinder restriction is an open embedding of the |
| 126 | source subtype into the retained target slice (Theorem 12.28). -/ |
| 127 | theorem isOpenEmbedding_forward_restrict (hU : IsOpen U) {V : Set C.carrier} |
| 128 | (hV : IsOpen V) (hVU : V ⊆ U) {s : ℝ} (hs : s ∈ I) : |
| 129 | Topology.IsOpenEmbedding (fun x : V => e.forward s hs x) := |
| 130 | (e.isOpen_forward_image hU hV hVU hs).isOpenEmbedding_subtypeVal.comp |
| 131 | (e.restrictedSpatialHomeomorph hVU s hs).isOpenEmbedding |
| 132 | |
| 133 | end PoincareMT.GeneralizedFlowCylinder |