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.Extinction.Width.Transport.Regular.Neighborhoods |
| 2 | |
| 3 | set_option autoImplicit false |
| 4 | |
| 5 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 6 | |
| 7 | universe u |
| 8 | |
| 9 | namespace PoincareMT |
| 10 | |
| 11 | variable |
| 12 | {g₀ : StandardInitialMetric} |
| 13 | {D : RepairedSurgeryFlowData.{u} g₀} |
| 14 | {W : RepairedEventChildWitness D.flow} |
| 15 | {T : ℝ} {P : RepairedComponentPath D.flow T W} |
| 16 | {K : RepairedComparisonMapData D} |
| 17 | {C : RepairedComparisonHomotopyData D K} |
| 18 | {H : RepairedAncestryTransportInput D W P K C} |
| 19 | {B : M59HigherBasepointTransportService} |
| 20 | {A : RepairedAncestryTransportData D W P K C H B} |
| 21 | {q : M59SphereQuotient} |
| 22 | {hM61 : M61RawWidthCore.{u}} |
| 23 | {hM64 : M64ComparisonTheory.{u}} |
| 24 | {hM65 : M65DeformationTheory hM61 hM64} |
| 25 | |
| 26 | /-- The width of a changing path is right continuous, including at surgery times. -/ |
| 27 | theorem m67_width_right_continuous |
| 28 | (X : M67ChangingWidthPath D W P K C H B A q hM61 hM65) |
| 29 | (s : Set.Icc (0 : ℝ) T) (epsilon : ℝ) (hepsilon : 0 < epsilon) : |
| 30 | ∃ delta : ℝ, 0 < delta ∧ |
| 31 | ∀ t : Set.Icc (0 : ℝ) T, |
| 32 | s.1 ≤ t.1 → t.1 < s.1 + delta → |
| 33 | |X.width t - X.width s| < epsilon := by |
| 34 | by_cases hs : s.1 < T |
| 35 | · obtain ⟨b, hsb, hb, hJ⟩ := m67_exists_right_regular_interval P s hs |
| 36 | obtain ⟨J⟩ := X.regular_piece s.2.1 hsb hb hJ |
| 37 | let s' : Set.Icc s.1 b := ⟨s.1, le_rfl, hsb.le⟩ |
| 38 | obtain ⟨delta, hd, hclose⟩ := |
| 39 | Metric.continuousAt_iff.mp (J.conclusion.continuous_at s') epsilon hepsilon |
| 40 | refine ⟨min delta (b - s.1), lt_min hd (sub_pos.mpr hsb), ?_⟩ |
| 41 | intro t hst ht |
| 42 | have htb : t.1 ≤ b := by |
| 43 | have := min_le_right delta (b - s.1) |
| 44 | linarith |
| 45 | let t' : Set.Icc s.1 b := ⟨t.1, hst, htb⟩ |
| 46 | have hdist : dist t' s' < delta := by |
| 47 | change dist t.1 s.1 < delta |
| 48 | rw [Real.dist_eq, abs_of_nonneg (sub_nonneg.mpr hst)] |
| 49 | have := min_le_left delta (b - s.1) |
| 50 | linarith |
| 51 | have hwidth := hclose hdist |
| 52 | have hs_eq : J.interval s' = s := Subtype.ext (J.interval_time s') |
| 53 | have ht_eq : J.interval t' = t := Subtype.ext (J.interval_time t') |
| 54 | rw [← J.width_agreement t', ← J.width_agreement s', ht_eq, hs_eq, |
| 55 | Real.dist_eq] at hwidth |
| 56 | exact hwidth |
| 57 | · refine ⟨1, zero_lt_one, ?_⟩ |
| 58 | intro t hst _ht |
| 59 | have hts : t = s := Subtype.ext (by linarith [t.2.2]) |
| 60 | simpa [hts] using hepsilon |
| 61 | |
| 62 | /-- M66 continuity on ordinary pieces gives continuity at every regular time. -/ |
| 63 | theorem m67_width_continuous_at_regular |
| 64 | (X : M67ChangingWidthPath D W P K C H B A q hM61 hM65) |
| 65 | (s : Set.Icc (0 : ℝ) T) |
| 66 | (hs : s.1 ∉ (↑P.surgery_times : Set ℝ)) : ContinuousAt X.width s := by |
| 67 | apply Metric.continuousAt_iff.mpr |
| 68 | intro epsilon hepsilon |
| 69 | by_cases hT : 0 < T |
| 70 | · obtain ⟨a, b, ha, hab, hb, hsab, hJ, rho, hrho, hnear⟩ := |
| 71 | m67_exists_regular_neighborhood P hT s hs |
| 72 | obtain ⟨J⟩ := X.regular_piece ha hab hb hJ |
| 73 | let s' : Set.Icc a b := ⟨s.1, hsab⟩ |
| 74 | obtain ⟨delta, hd, hclose⟩ := |
| 75 | Metric.continuousAt_iff.mp (J.conclusion.continuous_at s') epsilon hepsilon |
| 76 | refine ⟨min delta rho, lt_min hd hrho, ?_⟩ |
| 77 | intro t ht |
| 78 | have hdist : |t.1 - s.1| < min delta rho := by |
| 79 | simpa only [Subtype.dist_eq, Real.dist_eq] using ht |
| 80 | let t' : Set.Icc a b := ⟨t.1, hnear t (hdist.trans_le (min_le_right _ _))⟩ |
| 81 | have ht's' : dist t' s' < delta := by |
| 82 | change dist t.1 s.1 < delta |
| 83 | rw [Real.dist_eq] |
| 84 | exact hdist.trans_le (min_le_left _ _) |
| 85 | have hwidth := hclose ht's' |
| 86 | have hs_eq : J.interval s' = s := Subtype.ext (J.interval_time s') |
| 87 | have ht_eq : J.interval t' = t := Subtype.ext (J.interval_time t') |
| 88 | rwa [← J.width_agreement t', ← J.width_agreement s', ht_eq, hs_eq] at hwidth |
| 89 | · refine ⟨1, zero_lt_one, ?_⟩ |
| 90 | intro t _ht |
| 91 | have hts : t = s := Subtype.ext (by linarith [t.2.1, t.2.2, s.2.1, s.2.2]) |
| 92 | simpa [hts] using hepsilon |
| 93 | |
| 94 | end PoincareMT |