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.Tube.Cylinders.CylinderSphereModel |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Cylinders.CylinderTailModel |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Cylinders.CylinderComponentSide |
| 5 | |
| 6 | /-! |
| 7 | # Smooth coordinates oriented toward the actual ambient component |
| 8 | |
| 9 | Morgan--Tian Claim 10.8, p. 254. Smooth sphere transport and axial |
| 10 | reflection identify the supplied full ambient component with the positive |
| 11 | half of a genuine smooth model on the same containing cylinder. Derivation 94. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.OpenCylinderModel |
| 22 | |
| 23 | open M28 |
| 24 | |
| 25 | variable {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] {U : TopologicalSpace.Opens M} |
| 27 | |
| 28 | private theorem inverse_height_readout (T : OpenCylinderModel (U : Set M)) (x : U) : |
| 29 | ((T.homeomorph.symm x).2 : ℝ) = (T.inverse x).2 := by |
| 30 | have hcoord : T.coordinate |
| 31 | ((T.homeomorph.symm x).1, ((T.homeomorph.symm x).2 : ℝ)) = x := by |
| 32 | rw [← T.coordinate_eq] |
| 33 | exact congrArg Subtype.val (T.homeomorph.apply_symm_apply x) |
| 34 | have hh := T.left_inverse |
| 35 | (show ((T.homeomorph.symm x).1, ((T.homeomorph.symm x).2 : ℝ)) ∈ |
| 36 | univ ×ˢ Ioo (0 : ℝ) 1 from ⟨mem_univ _, (T.homeomorph.symm x).2.property⟩) |
| 37 | rw [hcoord] at hh |
| 38 | exact (congrArg Prod.snd hh).symm |
| 39 | |
| 40 | /-- A full ambient sphere-complement component contained in the cylinder |
| 41 | is exactly its positive half in suitable smooth coordinates. The original |
| 42 | carrier and the selected boundary sphere are retained (MT Claim 10.8). -/ |
| 43 | theorem exists_oriented_model_of_component |
| 44 | (T : OpenCylinderModel (U : Set M)) {S P : Set M} |
| 45 | (hS : SmoothSphereIsotopicIn (U : Set M) S T.middleSphere) |
| 46 | (hP : IsConnected P) (hPU : P ⊆ (U : Set M) \ S) |
| 47 | (hcomponent : ∀ x ∈ P, connectedComponentIn Sᶜ x = P) : |
| 48 | ∃ T' : OpenCylinderModel (U : Set M), |
| 49 | T'.middleSphere = S ∧ P = T'.tail true (1 / 2) := by |
| 50 | obtain ⟨A, hA⟩ := T.exists_isotopic_sphere_model hS |
| 51 | have hzero (x : U) : cylinderSignedHeight A.homeomorph.symm x = 0 ↔ x.val ∈ S := by |
| 52 | rw [cylinderSignedHeight, inverse_height_readout, sub_eq_zero] |
| 53 | exact (A.mem_middleSphere_iff x.property).symm.trans (by rw [hA]) |
| 54 | have hrelative (x : M) (hx : x ∈ P) : |
| 55 | connectedComponentIn ((U : Set M) \ S) x = P := by |
| 56 | apply Subset.antisymm |
| 57 | · exact (connectedComponentIn_mono x (fun _ hy => hy.2)).trans_eq (hcomponent x hx) |
| 58 | · exact hP.isPreconnected.subset_connectedComponentIn hx hPU |
| 59 | rcases cylinderSignedHeight_component_half A.homeomorph.symm hzero hP hPU hrelative |
| 60 | with hn | hp |
| 61 | · obtain ⟨R, _hc, hv, hm⟩ := A.exists_reflected_model |
| 62 | refine ⟨R, hm.trans hA, ?_⟩ |
| 63 | have hhalf (x : U) : (1 / 2 : ℝ) < (R.inverse x).2 ↔ x.val ∈ P := by |
| 64 | have hh : (A.inverse x).2 < 1 / 2 ↔ x.val ∈ P := by |
| 65 | have hh := hn x |
| 66 | change ((A.homeomorph.symm x).2 : ℝ) - 1 / 2 < 0 ↔ x.val ∈ P at hh |
| 67 | rwa [inverse_height_readout A x, sub_neg] at hh |
| 68 | rw [hv] |
| 69 | change 1 / 2 < 1 - (A.inverse x).2 ↔ x.val ∈ P |
| 70 | exact (by constructor <;> intro h <;> linarith : |
| 71 | (1 / 2 : ℝ) < 1 - (A.inverse x).2 ↔ (A.inverse x).2 < 1 / 2).trans hh |
| 72 | ext x |
| 73 | rw [R.mem_tail_iff_m28 true (by norm_num) (by norm_num)] |
| 74 | exact ⟨fun hx => ⟨(hPU hx).1, (hhalf ⟨x, (hPU hx).1⟩).mpr hx⟩, |
| 75 | fun hx => (hhalf ⟨x, hx.1⟩).mp hx.2⟩ |
| 76 | · refine ⟨A, hA, ?_⟩ |
| 77 | have hhalf (x : U) : (1 / 2 : ℝ) < (A.inverse x).2 ↔ x.val ∈ P := by |
| 78 | have hh := hp x |
| 79 | change 0 < ((A.homeomorph.symm x).2 : ℝ) - 1 / 2 ↔ x.val ∈ P at hh |
| 80 | rwa [inverse_height_readout A x, sub_pos] at hh |
| 81 | ext x |
| 82 | rw [A.mem_tail_iff_m28 true (by norm_num) (by norm_num)] |
| 83 | exact ⟨fun hx => ⟨(hPU hx).1, (hhalf ⟨x, (hPU hx).1⟩).mpr hx⟩, |
| 84 | fun hx => (hhalf ⟨x, hx.1⟩).mp hx.2⟩ |
| 85 | |
| 86 | end PoincareMT.OpenCylinderModel |