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.CylinderIntervalModel |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Cylinders.CylinderEndRegions |
| 4 | |
| 5 | /-! |
| 6 | # Reflection and restriction of the smooth cylinder |
| 7 | |
| 8 | Morgan--Tian Claim 10.8, p. 254; M28 derivation 94. The literal affine |
| 9 | formulas orient the chosen end and restrict it to a strict height tail. |
| 10 | The ambient metric and the selected spatial points do not change. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.OpenCylinderModel |
| 21 | |
| 22 | variable {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] {U : Set M} |
| 24 | |
| 25 | /-- Smooth axial reflection preserves the literal middle sphere and |
| 26 | retains both formulas (MT Claim 10.8, p. 254). -/ |
| 27 | theorem exists_reflected_model (T : OpenCylinderModel U) : |
| 28 | ∃ T' : OpenCylinderModel U, |
| 29 | T'.coordinate = (fun z => T.coordinate (z.1, 1 - z.2)) ∧ |
| 30 | T'.inverse = (fun x => ((T.inverse x).1, 1 - (T.inverse x).2)) ∧ |
| 31 | T'.middleSphere = T.middleSphere := by |
| 32 | have hmem : MapsTo (fun s : ℝ => 1 - s) (Ioo (0 : ℝ) 1) (Ioo (0 : ℝ) 1) := by |
| 33 | intro s hs |
| 34 | constructor <;> linarith [hs.1, hs.2] |
| 35 | have hinv : LeftInvOn (fun s : ℝ => 1 - s) (fun s : ℝ => 1 - s) |
| 36 | (Ioo (0 : ℝ) 1) := by intro s _hs; dsimp; ring |
| 37 | obtain ⟨T', hc, hv⟩ := T.exists_model_of_interval_reparametrization subset_rfl |
| 38 | (V := U) (fun x => ⟨fun hx => ⟨hx, (T.inverse_mem x hx).2⟩, fun hx => hx.1⟩) |
| 39 | (fun s => 1 - s) (fun s => 1 - s) |
| 40 | (contDiff_const.sub contDiff_id).contDiffOn |
| 41 | (contDiff_const.sub contDiff_id).contDiffOn hmem hmem hinv hinv |
| 42 | refine ⟨T', hc, hv, ?_⟩ |
| 43 | have hmiddle (q : UnitTwoSphere) : |
| 44 | T'.coordinate (q, 1 / 2) = T.coordinate (q, 1 / 2) := by |
| 45 | rw [hc] |
| 46 | norm_num |
| 47 | ext x |
| 48 | constructor |
| 49 | · rintro ⟨⟨q, s⟩, ⟨_, hs⟩, rfl⟩ |
| 50 | have hs' : s = 1 / 2 := hs |
| 51 | subst s |
| 52 | exact ⟨(q, 1 / 2), ⟨mem_univ _, rfl⟩, (hmiddle q).symm⟩ |
| 53 | · rintro ⟨⟨q, s⟩, ⟨_, hs⟩, rfl⟩ |
| 54 | have hs' : s = 1 / 2 := hs |
| 55 | subst s |
| 56 | exact ⟨(q, 1 / 2), ⟨mem_univ _, rfl⟩, hmiddle q⟩ |
| 57 | |
| 58 | /-- Every strict positive tail has a smooth cylinder model given by the |
| 59 | actual affine height change (MT Claim 10.8, p. 254). -/ |
| 60 | theorem exists_positive_tail_model (T : OpenCylinderModel U) {a : ℝ} |
| 61 | (ha : 0 < a) (ha' : a < 1) : |
| 62 | ∃ T' : OpenCylinderModel (T.tail true a), |
| 63 | T'.coordinate = (fun z => T.coordinate (z.1, a + (1 - a) * z.2)) ∧ |
| 64 | T'.inverse = |
| 65 | (fun x => ((T.inverse x).1, ((T.inverse x).2 - a) / (1 - a))) := by |
| 66 | have hpos : 0 < 1 - a := sub_pos.mpr ha' |
| 67 | have hV (x : M) : x ∈ T.tail true a ↔ x ∈ U ∧ (T.inverse x).2 ∈ Ioo a 1 := by |
| 68 | rw [T.mem_tail_iff_m28 true ha ha'] |
| 69 | constructor |
| 70 | · intro hx |
| 71 | exact ⟨hx.1, hx.2, (T.inverse_mem x hx.1).2.2⟩ |
| 72 | · intro hx |
| 73 | exact ⟨hx.1, hx.2.1⟩ |
| 74 | apply T.exists_model_of_interval_reparametrization |
| 75 | (fun _ hs => ⟨ha.trans hs.1, hs.2⟩) hV |
| 76 | (fun s => a + (1 - a) * s) (fun s => (s - a) / (1 - a)) |
| 77 | · exact (contDiff_const.add (contDiff_const.mul contDiff_id)).contDiffOn |
| 78 | · exact ((contDiff_id.sub contDiff_const).div_const (1 - a)).contDiffOn |
| 79 | · intro s hs |
| 80 | change a < a + (1 - a) * s ∧ a + (1 - a) * s < 1 |
| 81 | constructor |
| 82 | · linarith [mul_pos hpos hs.1] |
| 83 | · nlinarith [mul_pos hpos (sub_pos.mpr hs.2)] |
| 84 | · intro s hs |
| 85 | exact ⟨div_pos (sub_pos.mpr hs.1) hpos, |
| 86 | (div_lt_one hpos).mpr (sub_lt_sub_right hs.2 a)⟩ |
| 87 | · intro s _hs |
| 88 | dsimp |
| 89 | field_simp [hpos.ne'] |
| 90 | ring |
| 91 | · intro s _hs |
| 92 | dsimp |
| 93 | field_simp [hpos.ne'] |
| 94 | ring |
| 95 | |
| 96 | end PoincareMT.OpenCylinderModel |