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.Induction.Noncollapse.Compat.GeneralizedEquation |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.EpochExtension.History.Transport.GuardedCylinders |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.EpochExtension.History.Transport.SurgeryCylinderRestriction |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.EpochExtension.Spacetime.GeneralizedCylinderClock |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.PersistenceGeometry |
| 6 | |
| 7 | /-! |
| 8 | # The actual persistence cylinder inside the tested history |
| 9 | |
| 10 | Proposition 16.13 and Lemma 16.15, pp. 377-382. The M44 alternative |
| 11 | retains its original physical cylinder and comparison. Its positive-time |
| 12 | part, truncated at the tested terminal time, lifts to the actual M33 |
| 13 | history on the full physical birth ball. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.Proofs.M12 |
| 25 | end PoincareMT.Proofs.M12 |
| 26 | open PoincareMT.EpochExtension.Spacetime |
| 27 | |
| 28 | namespace PoincareMT.Proofs.M46 |
| 29 | |
| 30 | open PoincareMT.Proofs.M12 |
| 31 | |
| 32 | /-- Normalize the literal M44 alternatives while retaining the actual |
| 33 | original cylinder. Source: Proposition 16.5, pp. 370-374. -/ |
| 34 | theorem exists_capPersistence_source_window |
| 35 | {F : SurgeryFlowData.{u}} (O : SurgeryObservation F) |
| 36 | {t : ℝ} {hT : t ∈ F.surgery_times} [Nonempty (F.slice t).carrier] |
| 37 | (i : Fin (F.event t hT).cap_count) {A eta theta : ℝ} |
| 38 | (hh : 0 < F.parameters.h t) (htH : t < O.H) (htheta : 0 < theta) |
| 39 | (control : SurgeryCapPersistenceAlternative F O t hT i A eta theta) : |
| 40 | ∃ top : ℝ, t < top ∧ top ≤ t + theta * (F.parameters.h t) ^ 2 ∧ |
| 41 | ∃ e : SurgeryFlowCylinder F (F.slice t) t ((F.parameters.h t)⁻¹ ^ 2) |
| 42 | (Ico 0 ((top - t) / (F.parameters.h t) ^ 2)) |
| 43 | ((F.metric t).ball ((F.event t hT).caps i).tip (A * F.parameters.h t)), |
| 44 | ∃ initial : SurgeryCapInitialComparison F t hT i A, |
| 45 | SurgeryCapFamilyComparison F O.standard_flow A eta e initial.chart ∧ |
| 46 | (∀ h x, x ∈ (F.metric t).ball ((F.event t hT).caps i).tip |
| 47 | (A * F.parameters.h t) → HEq (e.forward 0 h x) x) ∧ |
| 48 | (top = O.H ∨ top = t + theta * (F.parameters.h t) ^ 2 ∨ |
| 49 | SurgeryBallDisappearsAt F e top) := by |
| 50 | rcases control with ⟨e, initial, comparison, based⟩ | |
| 51 | ⟨top, httop, _hTtop, htop, e, initial, comparison, based, disappears⟩ |
| 52 | · refine ⟨surgeryCapEnd t O.H (F.parameters.h t) theta, ?_, min_le_right _ _, |
| 53 | e, initial, comparison, based, ?_⟩ |
| 54 | · exact lt_min htH (by nlinarith [mul_pos htheta (sq_pos_of_pos hh)]) |
| 55 | · by_cases hle : O.H ≤ t + theta * (F.parameters.h t) ^ 2 |
| 56 | · exact Or.inl (min_eq_left hle) |
| 57 | · exact Or.inr (Or.inl (min_eq_right (le_of_not_ge hle))) |
| 58 | · exact ⟨top, httop, htop.le.trans (min_le_right _ _), e, initial, |
| 59 | comparison, based, Or.inr (Or.inr disappears)⟩ |
| 60 | |
| 61 | /-- The open normalized interval corresponding to the actual physical |
| 62 | interval between birth and its chosen top. Source: Lemma 16.15, p. 381. -/ |
| 63 | noncomputable def capOpenInterval (origin top h : ℝ) (htop : origin < top) |
| 64 | (hh : 0 < h) : SpacetimeInterval where |
| 65 | domain := Ioo 0 ((top - origin) / h ^ 2) |
| 66 | ordConnected := ordConnected_Ioo |
| 67 | nontrivial := by |
| 68 | have hb : 0 < (top - origin) / h ^ 2 := |
| 69 | div_pos (sub_pos.mpr htop) (sq_pos_of_pos hh) |
| 70 | refine ⟨((top - origin) / h ^ 2) / 3, ⟨by linarith, by linarith⟩, |
| 71 | 2 * ((top - origin) / h ^ 2) / 3, ⟨by linarith, by linarith⟩, ?_⟩ |
| 72 | linarith |
| 73 | |
| 74 | /-- The normalized cylinder has exactly its displayed physical open |
| 75 | interval, including neither birth nor top. Source: Lemma 16.15, p. 381. -/ |
| 76 | theorem capOpenInterval_physical (origin top h : ℝ) (htop : origin < top) |
| 77 | (hh : 0 < h) (hq : 0 < h⁻¹ ^ 2) : |
| 78 | (cylinderPhysicalInterval origin (h⁻¹ ^ 2) hq |
| 79 | (capOpenInterval origin top h htop hh)).domain = Ioo origin top := by |
| 80 | have hsq : 0 < h ^ 2 := sq_pos_of_pos hh |
| 81 | ext t |
| 82 | constructor |
| 83 | · rintro ⟨s, hs, rfl⟩ |
| 84 | change origin + s / (h⁻¹ ^ 2) ∈ Ioo origin top |
| 85 | rw [inv_pow, div_inv_eq_mul] |
| 86 | refine ⟨by nlinarith [mul_pos hs.1 hsq], ?_⟩ |
| 87 | have := (lt_div_iff₀ hsq).mp hs.2 |
| 88 | linarith |
| 89 | · intro ht |
| 90 | refine ⟨(t - origin) / h ^ 2, ⟨div_pos (sub_pos.mpr ht.1) hsq, |
| 91 | div_lt_div_of_pos_right (sub_lt_sub_right ht.2 origin) hsq⟩, ?_⟩ |
| 92 | change origin + ((t - origin) / h ^ 2) / (h⁻¹ ^ 2) = t |
| 93 | rw [inv_pow, div_inv_eq_mul, div_mul_cancel₀ _ hsq.ne'] |
| 94 | ring |
| 95 | |
| 96 | /-- The positive-time part of the actual full physical ball lifts to |
| 97 | M33 after truncation at the test time. Every point has an earlier |
| 98 | included point, so the literal retained-at-surgery guard applies. |
| 99 | Source: Proposition 14.12 and Lemma 16.15, pp. 350 and 379-382. -/ |
| 100 | theorem exists_capCylinder_test_window_lift |
| 101 | {F : SurgeryFlowData.{u}} {W : M33RegularHistoryWindow F} |
| 102 | (H : M33RegularHistoryData W) {origin top T h : ℝ} |
| 103 | {U : Set (F.slice origin).carrier} (hU : IsOpen U) |
| 104 | (hh : 0 < h) (htop : origin < top) (hT : origin < T) |
| 105 | (hwindow : Ioo origin (min T top) ⊆ H.generalized.interval) |
| 106 | (e : SurgeryFlowCylinder F (F.slice origin) origin (h⁻¹ ^ 2) |
| 107 | (Ico 0 ((top - origin) / h ^ 2)) U) : |
| 108 | let J := capOpenInterval origin (min T top) h (lt_min hT htop) hh |
| 109 | ∃ (hJI : J.domain ⊆ Ico 0 ((top - origin) / h ^ 2)) |
| 110 | (htime : ∀ s ∈ J.domain, origin + s / (h⁻¹ ^ 2) ∈ H.generalized.interval), |
| 111 | ∃ d : GeneralizedFlowCylinder H.generalized (F.slice origin) origin |
| 112 | (h⁻¹ ^ 2) J.domain U, |
| 113 | (∀ s hs x, x ∈ U → |
| 114 | H.history.forward (origin + s / (h⁻¹ ^ 2)) (htime s hs) |
| 115 | (d.forward s hs x) = e.forward s (hJI hs) x) ∧ |
| 116 | (∀ s hs x, x ∈ U → ∀ v w : TangentSpace (𝓡 3) x, |
| 117 | d.pullbackInner s hs x v w = e.pullbackInner s (hJI hs) x v w) := by |
| 118 | dsimp only |
| 119 | let J := capOpenInterval origin (min T top) h (lt_min hT htop) hh |
| 120 | have hJI : J.domain ⊆ Ico 0 ((top - origin) / h ^ 2) := by |
| 121 | intro s hs |
| 122 | exact ⟨hs.1.le, hs.2.trans_le (div_le_div_of_nonneg_right |
| 123 | (sub_le_sub_right (min_le_right T top) origin) (sq_nonneg h))⟩ |
| 124 | have htime : ∀ s ∈ J.domain, |
| 125 | origin + s / (h⁻¹ ^ 2) ∈ H.generalized.interval := by |
| 126 | intro s hs |
| 127 | apply hwindow |
| 128 | rw [← capOpenInterval_physical origin (min T top) h (lt_min hT htop) hh e.scale_pos] |
| 129 | exact ⟨s, hs, rfl⟩ |
| 130 | let restricted := e.restrict hJI J.ordConnected (Subset.rfl : U ⊆ U) |
| 131 | obtain ⟨d, forward, metric⟩ := H.cylinder_from_surgery_of_earlier hU htime restricted |
| 132 | (fun s hs => ⟨s / 2, ⟨by linarith [hs.1], by linarith [hs.1, hs.2]⟩, |
| 133 | by linarith [hs.1]⟩) |
| 134 | exact ⟨hJI, htime, d, forward, metric⟩ |
| 135 | |
| 136 | end PoincareMT.Proofs.M46 |