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.Continuation.Construction.Splice.Geometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Construction.Splice.Nonempty |
| 3 | |
| 4 | /-! |
| 5 | # Maximal old intervals in the spliced flow |
| 6 | |
| 7 | An old surgery endpoint or the excluded original terminal time retains the |
| 8 | original maximal-interval curvature blow-up. The new slice identification |
| 9 | preserves its full curvature norm. |
| 10 | Source: Morgan--Tian, Definition 15.8, p. 362. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.Surgery.Splice |
| 21 | |
| 22 | variable (F : SurgeryFlowData.{u}) (T : ℝ) (C : GeneralizedSliceCarrier.{u}) |
| 23 | {B : ℝ≥0∞} (R : RicciFlow 3 C.carrier {t : ℝ | T ≤ t ∧ ENNReal.ofReal t < B}) |
| 24 | |
| 25 | theorem maximal_intervals_before (I : RepairedContinuationInput F T) |
| 26 | (a b : ℝ) (ha : 0 ≤ a) (hstart : a = 0 ∨ a ∈ eventTimes F T) (hab : a < b) |
| 27 | (hfree : Disjoint (eventTimes F T) (Ioo a b)) |
| 28 | (hb : b ∈ F.surgery_times ∨ b = T) : |
| 29 | ∀ L : ℝ, ∀ s : ℝ, s < b → ∃ t ∈ Ioo (max a s) b, |
| 30 | ∃ x : (slice F T C R t).carrier, L < (connection F T C R t).curvatureTensorNorm x := by |
| 31 | have hbT : b ≤ T := by |
| 32 | rcases hb with hb | rfl |
| 33 | · exact ((I.time_domain_eq ▸ F.surgery_times_subset hb).2).le |
| 34 | · exact le_rfl |
| 35 | have haT : a < T := hab.trans_le hbT |
| 36 | have haF : a ∈ F.time_domain := I.time_domain_eq ▸ (show a ∈ Ico 0 T from ⟨ha, haT⟩) |
| 37 | have hstartF : a = 0 ∨ a ∈ F.surgery_times := by |
| 38 | rcases hstart with hzero | hevent |
| 39 | · exact Or.inl hzero |
| 40 | · rcases mem_insert_iff.mp hevent with heq | hold |
| 41 | · exact (haT.ne heq).elim |
| 42 | · exact Or.inr hold |
| 43 | have hJ : Ico a b ⊆ F.time_domain := by |
| 44 | intro t ht |
| 45 | rw [I.time_domain_eq] |
| 46 | exact ⟨ha.trans ht.1, ht.2.trans_le hbT⟩ |
| 47 | have hfreeF := hfree.mono_left (subset_insert T F.surgery_times) |
| 48 | have hbF : b ∈ F.surgery_times ∨ b ∉ F.time_domain := by |
| 49 | rcases hb with hold | rfl |
| 50 | · exact Or.inl hold |
| 51 | · right |
| 52 | rw [I.time_domain_eq] |
| 53 | exact fun h => h.2.false |
| 54 | let := I.slices_nonempty a haF |
| 55 | intro L s hs |
| 56 | obtain ⟨t, ht, x, hL⟩ := F.maximal_intervals a b haF hstartF hab hJ hfreeF hbF L s hs |
| 57 | have htT : t < T := ht.2.trans_le hbT |
| 58 | refine ⟨t, ht, identifyBefore F T C R t htT x, ?_⟩ |
| 59 | rw [curvature_before F T C R t htT] |
| 60 | exact hL |
| 61 | |
| 62 | end PoincareMT.Surgery.Splice |