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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.NeckGeometry.NeckTransfer |
| 3 | import Mathlib.Geometry.Manifold.LocalDiffeomorph |
| 4 | |
| 5 | /-! |
| 6 | # Transport the literal neck geometry through a guarded inverse |
| 7 | |
| 8 | The target metric supplies its own scalar-defined scale. The source neck |
| 9 | supplies the actual coordinate homeomorphism and smooth inverse on the |
| 10 | captured carrier. No target metric comparison is inferred. Source: |
| 11 | Morgan--Tian Proposition 9.79, pp. 232-234, and Proposition 10.7, p. 253; |
| 12 | M28 derivation 102. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | universe u v |
| 21 | |
| 22 | namespace PoincareMT.Proofs.M28.NeckTransfer |
| 23 | |
| 24 | variable {M : Type u} {X : Type v} [TopologicalSpace M] [TopologicalSpace X] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] |
| 27 | [IsManifold (𝓡 3) ∞ M] [IsManifold (𝓡 3) ∞ X] |
| 28 | {g : RiemannianMetric 3 M} {h : RiemannianMetric 3 X} |
| 29 | |
| 30 | /-- Pull the actual source coordinates through a partial diffeomorphism, |
| 31 | using the target scalar to set the scale. The output is a geometry core; |
| 32 | its metric comparison remains a separate obligation. Source: Proposition |
| 33 | 10.7, p. 253; M28 derivation 102. Source and target universes may differ. -/ |
| 34 | noncomputable def pullbackNeckGeometry |
| 35 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) M X ∞) (N : EpsilonNeck h) |
| 36 | (hcapture : N.carrier ⊆ e.target) (D : LeviCivitaData g) |
| 37 | (hscalar : 0 < D.scalarCurvature (e.symm N.center)) : |
| 38 | NeckGeometryCore g N.epsilon := by |
| 39 | classical |
| 40 | let V : Set M := e.symm '' N.carrier |
| 41 | have hVopen : IsOpen V := |
| 42 | e.toOpenPartialHomeomorph.isOpen_image_symm_of_subset_target N.carrier_open hcapture |
| 43 | let H := e.toOpenPartialHomeomorph.symm.homeomorphOfImageSubsetSource |
| 44 | hcapture (rfl : e.symm '' N.carrier = V) |
| 45 | have hH_apply (y : N.carrier) : (H y : M) = e.symm y := rfl |
| 46 | let tmap : UnitTwoSphere × ℝ → M := fun z => e.symm (N.coordinate_map z) |
| 47 | let tinv : M → UnitTwoSphere × ℝ := fun x => N.coordinate_inverse (e x) |
| 48 | have hcoord_mem : ∀ z : UnitTwoSphere × ℝ, |
| 49 | z.2 ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ → N.coordinate_map z ∈ e.target := |
| 50 | fun z hz => hcapture (N.coordinate_map_mem_of_axial z hz) |
| 51 | have hVsource : V ⊆ e.source := by |
| 52 | rintro _ ⟨y, hy, rfl⟩ |
| 53 | exact e.map_target (hcapture hy) |
| 54 | have hright (y : X) (hy : y ∈ e.target) : e (e.symm y) = y := e.right_inv hy |
| 55 | have hmap_to_carrier : MapsTo e V N.carrier := by |
| 56 | rintro _ ⟨y, hy, rfl⟩ |
| 57 | rw [hright y (hcapture hy)] |
| 58 | exact hy |
| 59 | have hcoord_smooth : ContMDiffOn ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) ∞ tmap |
| 60 | (univ ×ˢ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹) := |
| 61 | e.contMDiffOn_invFun.comp N.coordinate_map_smooth (fun z hz => hcoord_mem z hz.2) |
| 62 | have hinv_smooth : ContMDiffOn (𝓡 3) ((𝓡 2).prod 𝓘(ℝ, ℝ)) ∞ tinv V := |
| 63 | N.coordinate_inverse_smooth.comp (e.contMDiffOn_toFun.mono hVsource) hmap_to_carrier |
| 64 | refine { |
| 65 | epsilon_pos := N.epsilon_pos |
| 66 | epsilon_lt_half := N.epsilon_lt_half |
| 67 | scale := (D.scalarCurvature (e.symm N.center)) ^ (-1 / 2 : ℝ) |
| 68 | scale_pos := Real.rpow_pos_of_pos hscalar _ |
| 69 | center := e.symm N.center |
| 70 | connection := D |
| 71 | scalar_center_pos := hscalar |
| 72 | scale_eq_scalar := rfl |
| 73 | carrier := V |
| 74 | carrier_open := hVopen |
| 75 | coordinate := N.coordinate.trans H |
| 76 | coordinate_map := tmap |
| 77 | coordinate_map_eq := ?_ |
| 78 | coordinate_map_smooth := hcoord_smooth |
| 79 | coordinate_inverse := tinv |
| 80 | coordinate_inverse_mem := ?_ |
| 81 | coordinate_inverse_left := ?_ |
| 82 | coordinate_inverse_right := ?_ |
| 83 | coordinate_inverse_smooth := hinv_smooth |
| 84 | central_sphere := e.symm '' N.central_sphere |
| 85 | central_sphere_eq := ?_ |
| 86 | center_on_central_sphere := ?_ |
| 87 | central_sphere_subset := ?_ } |
| 88 | · intro z |
| 89 | change H (N.coordinate z) = tmap (z.1, (z.2 : ℝ)) |
| 90 | dsimp [H, tmap] |
| 91 | change e.symm (N.coordinate z) = e.symm (N.coordinate_map (z.1, (z.2 : ℝ))) |
| 92 | rw [N.coordinate_map_eq] |
| 93 | · rintro _ ⟨y, hy, rfl⟩ |
| 94 | change N.coordinate_inverse (e (e.symm y)) ∈ univ ×ˢ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ |
| 95 | rw [hright y (hcapture hy)] |
| 96 | exact N.coordinate_inverse_mem y hy |
| 97 | · intro z |
| 98 | have hz := z.2.property |
| 99 | have hzcarrier : (N.coordinate z : X) ∈ N.carrier := (N.coordinate z).property |
| 100 | rw [Homeomorph.trans_apply] |
| 101 | dsimp [tinv] |
| 102 | rw [hH_apply, hright _ (hcapture hzcarrier), N.coordinate_map_eq z] |
| 103 | exact N.coordinate_inverse_coordinate_map_of_axial (z.1, (z.2 : ℝ)) hz |
| 104 | · rintro _ ⟨y, hy, rfl⟩ |
| 105 | have hyT := hcapture hy |
| 106 | have hyinv : e (e.symm y) = y := e.right_inv hyT |
| 107 | have hw : e (e.symm y) ∈ N.carrier := by |
| 108 | rw [hyinv] |
| 109 | exact hy |
| 110 | have hcoord := N.coordinate_inverse_right (e (e.symm y)) hw |
| 111 | have hval : (N.coordinate |
| 112 | ((N.coordinate_inverse (e (e.symm y))).1, |
| 113 | ⟨(N.coordinate_inverse (e (e.symm y))).2, |
| 114 | (N.coordinate_inverse_mem (e (e.symm y)) hw).2⟩) : X) = e (e.symm y) := |
| 115 | congrArg Subtype.val hcoord |
| 116 | have hleft : e.symm (e (e.symm y)) = e.symm y := e.left_inv (e.map_target hyT) |
| 117 | rw [Homeomorph.trans_apply] |
| 118 | dsimp [tinv] |
| 119 | apply Subtype.ext |
| 120 | rw [hH_apply, hval, hleft] |
| 121 | · rw [N.central_sphere_eq, image_image] |
| 122 | · exact ⟨N.center, N.center_on_central_sphere, rfl⟩ |
| 123 | · rintro _ ⟨y, hy, rfl⟩ |
| 124 | exact ⟨y, N.central_sphere_subset hy, rfl⟩ |
| 125 | |
| 126 | /-- The transported center is the original center under the guarded inverse. |
| 127 | Source: the pointed initial-neck construction in M28 derivation 102. -/ |
| 128 | @[simp] theorem pullbackNeckGeometry_center |
| 129 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) M X ∞) (N : EpsilonNeck h) |
| 130 | (hcapture : N.carrier ⊆ e.target) (D : LeviCivitaData g) |
| 131 | (hscalar : 0 < D.scalarCurvature (e.symm N.center)) : |
| 132 | (pullbackNeckGeometry e N hcapture D hscalar).center = e.symm N.center := rfl |
| 133 | |
| 134 | /-- The target core keeps the literal composed coordinate map. |
| 135 | Source: the actual metric identity in M28 derivation 102. -/ |
| 136 | @[simp] theorem pullbackNeckGeometry_coordinate_map |
| 137 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) M X ∞) (N : EpsilonNeck h) |
| 138 | (hcapture : N.carrier ⊆ e.target) (D : LeviCivitaData g) |
| 139 | (hscalar : 0 < D.scalarCurvature (e.symm N.center)) (z : UnitTwoSphere × ℝ) : |
| 140 | (pullbackNeckGeometry e N hcapture D hscalar).coordinate_map z = |
| 141 | e.symm (N.coordinate_map z) := rfl |
| 142 | |
| 143 | /-- The target carrier is exactly the inverse image under the guarded map. |
| 144 | Source: Proposition 10.7, p. 253; M28 derivation 102. -/ |
| 145 | @[simp] theorem pullbackNeckGeometry_carrier |
| 146 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) M X ∞) (N : EpsilonNeck h) |
| 147 | (hcapture : N.carrier ⊆ e.target) (D : LeviCivitaData g) |
| 148 | (hscalar : 0 < D.scalarCurvature (e.symm N.center)) : |
| 149 | (pullbackNeckGeometry e N hcapture D hscalar).carrier = e.symm '' N.carrier := rfl |
| 150 | |
| 151 | /-- The scale is the target metric's scalar-defined scale, with no equality |
| 152 | to the unnormalized source scale assumed. Source: M28 derivation 102. -/ |
| 153 | @[simp] theorem pullbackNeckGeometry_scale |
| 154 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) M X ∞) (N : EpsilonNeck h) |
| 155 | (hcapture : N.carrier ⊆ e.target) (D : LeviCivitaData g) |
| 156 | (hscalar : 0 < D.scalarCurvature (e.symm N.center)) : |
| 157 | (pullbackNeckGeometry e N hcapture D hscalar).scale = |
| 158 | (D.scalarCurvature (e.symm N.center)) ^ (-1 / 2 : ℝ) := rfl |
| 159 | |
| 160 | end PoincareMT.Proofs.M28.NeckTransfer |