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.NeckGeometry.NeckGraphSides |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.NeckGeometry.NeckSignedRegions |
| 4 | |
| 5 | /-! |
| 6 | # The actual outward side of a captured old-neck sphere |
| 7 | |
| 8 | Morgan--Tian, Proposition A.11, pp. 503--504. The original signed collar |
| 9 | has two connected coordinate regions. Its outer region accumulates at |
| 10 | the successor center, so its graph-height sign is fixed there. An actual |
| 11 | axial perturbation in the successor coordinates forces the other sign |
| 12 | on the inner region. No side identification is assumed. |
| 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.M28 |
| 23 | |
| 24 | variable {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 26 | [IsManifold (𝓡 3) ∞ M] {g : RiemannianMetric 3 M} |
| 27 | |
| 28 | /-- An actual captured old collar and its literal successor graph determine |
| 29 | the outward sign from the successor center. Both side identities are proved |
| 30 | from the original coordinate regions, actual graph equality and closure. -/ |
| 31 | theorem neck_graph_side_alignment (N N' : EpsilonNeck g) |
| 32 | {sigma lo a hi : ℝ} (hsigma : sigma = 1 ∨ sigma = -1) |
| 33 | (hlo : -N.epsilon⁻¹ ≤ lo) (hhi : hi ≤ N.epsilon⁻¹) |
| 34 | (hla : lo < a) (hah : a < hi) |
| 35 | {f : UnitTwoSphere → ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ f) |
| 36 | (hdom : ∀ p, f p ∈ Ioo (-N'.epsilon⁻¹) N'.epsilon⁻¹) |
| 37 | (hrange : range (fun p : UnitTwoSphere => N.coordinate_map (p, sigma * a)) = |
| 38 | range (fun p : UnitTwoSphere => N'.coordinate_map (p, f p))) |
| 39 | (hcapture : neckSignedRegion N sigma lo hi ⊆ N'.carrier) |
| 40 | (hclose : N'.center ∈ closure (neckSignedRegion N sigma a hi)) |
| 41 | (hcenter_out : N'.center ∉ N.carrier) : |
| 42 | ∃ kappa : ℝ, (kappa = 1 ∨ kappa = -1) ∧ |
| 43 | 0 < kappa * neckGraphHeight N' f N'.center ∧ |
| 44 | ∀ x ∈ neckSignedRegion N sigma lo hi, |
| 45 | (0 < kappa * neckGraphHeight N' f x ↔ a < sigma * (N.coordinate_inverse x).2) ∧ |
| 46 | (kappa * neckGraphHeight N' f x < 0 ↔ sigma * (N.coordinate_inverse x).2 < a) := by |
| 47 | let T := neckSignedRegion N sigma lo hi |
| 48 | let O := neckSignedRegion N sigma a hi |
| 49 | let I := neckSignedRegion N sigma lo a |
| 50 | have ha : sigma * a ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := by |
| 51 | rcases hsigma with rfl | rfl |
| 52 | · change -N.epsilon⁻¹ < 1 * a ∧ 1 * a < N.epsilon⁻¹ |
| 53 | simpa only [one_mul] using And.intro (hlo.trans_lt hla) (hah.trans_le hhi) |
| 54 | · constructor <;> nlinarith |
| 55 | have hOT : O ⊆ T := fun x hx => ⟨hx.1, hla.trans hx.2.1, hx.2.2⟩ |
| 56 | have hIT : I ⊆ T := fun x hx => ⟨hx.1, hx.2.1, hx.2.2.trans hah⟩ |
| 57 | have hzero (x : M) (hx : x ∈ T) : |
| 58 | neckGraphHeight N' f x = 0 ↔ sigma * (N.coordinate_inverse x).2 = a := by |
| 59 | have h := neckGraphHeight_eq_zero_iff N' hdom (hcapture hx) |
| 60 | rw [← hrange] at h |
| 61 | exact h.trans (mem_neck_slice_iff_signed_axis N hsigma ha hx.1) |
| 62 | have hpN : N'.center ∈ N'.carrier := |
| 63 | N'.central_sphere_subset N'.center_on_central_sphere |
| 64 | have hpne : neckGraphHeight N' f N'.center ≠ 0 := by |
| 65 | intro hz |
| 66 | have hmem := (neckGraphHeight_eq_zero_iff N' hdom hpN).mp hz |
| 67 | rw [← hrange] at hmem |
| 68 | obtain ⟨p, hp⟩ := hmem |
| 69 | exact hcenter_out (hp ▸ N.coordinate_map_mem ⟨mem_univ _, ha⟩) |
| 70 | obtain ⟨kappa, hkappa, hp⟩ : ∃ kappa : ℝ, (kappa = 1 ∨ kappa = -1) ∧ |
| 71 | 0 < kappa * neckGraphHeight N' f N'.center := by |
| 72 | rcases lt_or_gt_of_ne hpne with hn | hp |
| 73 | · exact ⟨-1, Or.inr rfl, by nlinarith⟩ |
| 74 | · exact ⟨1, Or.inl rfl, by simpa only [one_mul] using hp⟩ |
| 75 | let F : M → ℝ := fun x => kappa * neckGraphHeight N' f x |
| 76 | have hkne : kappa ≠ 0 := by rcases hkappa with rfl | rfl <;> norm_num |
| 77 | have hF : ContinuousOn F N'.carrier := |
| 78 | continuousOn_const.mul (continuousOn_neckGraphHeight N' hf) |
| 79 | have hOconn : IsPreconnected O := |
| 80 | isPreconnected_neckSignedRegion N hsigma (hlo.trans hla.le) hhi |
| 81 | have hIconn : IsPreconnected I := |
| 82 | isPreconnected_neckSignedRegion N hsigma hlo (hah.le.trans hhi) |
| 83 | have hOne (x : M) (hx : x ∈ O) : F x ≠ 0 := by |
| 84 | intro hz |
| 85 | have hq : neckGraphHeight N' f x = 0 := (mul_eq_zero.mp hz).resolve_left hkne |
| 86 | exact (ne_of_gt hx.2.1) ((hzero x (hOT hx)).mp hq) |
| 87 | have hIne (x : M) (hx : x ∈ I) : F x ≠ 0 := by |
| 88 | intro hz |
| 89 | have hq : neckGraphHeight N' f x = 0 := (mul_eq_zero.mp hz).resolve_left hkne |
| 90 | exact (ne_of_lt hx.2.2) ((hzero x (hIT hx)).mp hq) |
| 91 | have hPopen : IsOpen (N'.carrier ∩ F ⁻¹' Ioi 0) := |
| 92 | hF.isOpen_inter_preimage N'.carrier_open isOpen_Ioi |
| 93 | obtain ⟨y, hyP, hyO⟩ := mem_closure_iff.mp hclose |
| 94 | (N'.carrier ∩ F ⁻¹' Ioi 0) hPopen ⟨hpN, hp⟩ |
| 95 | have hpositive (x : M) (hx : x ∈ O) : 0 < F x := |
| 96 | hOconn.lt_of_ne (hF.mono (hOT.trans hcapture)) hOne ⟨y, hyO, hyP.2⟩ hx |
| 97 | let p0 : UnitTwoSphere := (N.coordinate_inverse N.center).1 |
| 98 | let z0 : M := N.coordinate_map (p0, sigma * a) |
| 99 | have hzN : z0 ∈ N.carrier := N.coordinate_map_mem ⟨mem_univ _, ha⟩ |
| 100 | have hzaxis : sigma * (N.coordinate_inverse z0).2 = a := |
| 101 | (mem_neck_slice_iff_signed_axis N hsigma ha hzN).mp ⟨p0, rfl⟩ |
| 102 | have hzT : z0 ∈ T := ⟨hzN, by rw [hzaxis]; exact hla, by rw [hzaxis]; exact hah⟩ |
| 103 | have hzGraph : z0 ∈ range (fun p : UnitTwoSphere => N'.coordinate_map (p, f p)) := by |
| 104 | rw [← hrange] |
| 105 | exact ⟨p0, rfl⟩ |
| 106 | obtain ⟨theta, htheta⟩ := hzGraph |
| 107 | change N'.coordinate_map (theta, f theta) = z0 at htheta |
| 108 | have hthetaT : N'.coordinate_map (theta, f theta) ∈ T := htheta.symm ▸ hzT |
| 109 | obtain ⟨y, hyT, _, hyneg⟩ := exists_neckGraphHeight_negative_in_open N' f |
| 110 | (isOpen_neckSignedRegion N sigma lo hi) theta hthetaT |
| 111 | (hdom theta) hkappa |
| 112 | have hya : sigma * (N.coordinate_inverse y).2 < a := by |
| 113 | rcases lt_trichotomy (sigma * (N.coordinate_inverse y).2) a with h | h | h |
| 114 | · exact h |
| 115 | · have hq : neckGraphHeight N' f y = 0 := (hzero y hyT).mpr h |
| 116 | rw [hq, mul_zero] at hyneg |
| 117 | exact (lt_irrefl (0 : ℝ) hyneg).elim |
| 118 | · have hpos := hpositive y ⟨hyT.1, h, hyT.2.2⟩ |
| 119 | exact ((not_lt_of_ge hyneg.le) hpos).elim |
| 120 | have hnegative (x : M) (hx : x ∈ I) : F x < 0 := |
| 121 | hIconn.gt_of_ne (hF.mono (hIT.trans hcapture)) hIne |
| 122 | ⟨y, ⟨hyT.1, hyT.2.1, hya⟩, hyneg⟩ hx |
| 123 | refine ⟨kappa, hkappa, hp, ?_⟩ |
| 124 | intro x hx |
| 125 | change (0 < F x ↔ a < sigma * (N.coordinate_inverse x).2) ∧ |
| 126 | (F x < 0 ↔ sigma * (N.coordinate_inverse x).2 < a) |
| 127 | rcases lt_trichotomy (sigma * (N.coordinate_inverse x).2) a with h | h | h |
| 128 | · have hn := hnegative x ⟨hx.1, hx.2.1, h⟩ |
| 129 | exact ⟨iff_of_false (not_lt_of_ge hn.le) (not_lt_of_ge h.le), iff_of_true hn h⟩ |
| 130 | · have hz : F x = 0 := by |
| 131 | change kappa * neckGraphHeight N' f x = 0 |
| 132 | rw [(hzero x hx).mpr h, mul_zero] |
| 133 | simp only [hz, h, lt_self_iff_false, iff_self, and_self] |
| 134 | · have hp := hpositive x ⟨hx.1, h, hx.2.2⟩ |
| 135 | exact ⟨iff_of_true hp h, iff_of_false (not_lt_of_ge hp.le) (not_lt_of_ge h.le)⟩ |
| 136 | |
| 137 | end PoincareMT.M28 |