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.Volume.Surgery.Finiteness.Telescoping |
| 2 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.FiniteCardBound |
| 3 | |
| 4 | /-! |
| 5 | Adapted from Mapher `PoincareMT/Proofs/M50/Lemma17_12_EventCount.lean` at |
| 6 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 7 | |
| 8 | # Finite event counts below arbitrary finite horizons |
| 9 | |
| 10 | Morgan-Tian Lemma 17.12, pp. 410-411: positive cap losses bound cap |
| 11 | events, while the separate component estimate bounds all other events. |
| 12 | The horizon need not belong to the flow domain. The corrected geometric |
| 13 | loss scale h^3/delta is already part of the exact M49 certificate. |
| 14 | See `reviews/contracts/2026-09-20-m50-finite-subsets.md`. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set |
| 20 | open scoped ENNReal BigOperators |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.SurgeryFiniteness |
| 25 | |
| 26 | /-- One natural bounds every finite set of positive-cap events in [0,H] |
| 27 | for the supplied certificate (MT Lemma 17.12, pp. 410-411). -/ |
| 28 | theorem cap_event_count_bound |
| 29 | (F : SurgeryFlowData.{u}) (C : RepairedVolumeLossControls F) |
| 30 | (V : RepairedVolumeLossData F C) (H : ℝ) (hH : 0 ≤ H) : |
| 31 | ∃ n : ℕ, ∀ S : Finset ℝ, |
| 32 | (↑S : Set ℝ) ⊆ {T ∈ F.surgery_times ∩ Icc 0 H | |
| 33 | ∃ hT : T ∈ F.surgery_times, |
| 34 | ∃ hN : Nonempty (F.slice T).carrier, |
| 35 | letI := hN |
| 36 | 0 < (F.event T hT).cap_count} → |
| 37 | S.card ≤ n := by |
| 38 | obtain ⟨sigma, hsigma, hlower⟩ := V.horn_loss_lower_bound H hH |
| 39 | let w := Real.exp (-(6 * H)) * sigma |
| 40 | have hw : 0 < w := mul_pos (Real.exp_pos _) hsigma |
| 41 | obtain ⟨n, hn⟩ := exists_nat_ge |
| 42 | ((calibratedMetricVolume (F.metric 0) univ).toReal / w) |
| 43 | refine ⟨n, ?_⟩ |
| 44 | intro S hS |
| 45 | have hsum := weighted_constant_losses_le_initial F C V sigma S (by |
| 46 | intro T hTS |
| 47 | obtain ⟨hTI, hT, hN, hcap⟩ := hS hTS |
| 48 | let := hN |
| 49 | exact ⟨hT, hN, (hlower T hT hTI.2 hcap).1⟩) |
| 50 | have hbound : (S.card : ℝ≥0∞) * ENNReal.ofReal w ≤ |
| 51 | calibratedMetricVolume (F.metric 0) univ := by |
| 52 | calc |
| 53 | _ = ∑ _T ∈ S, ENNReal.ofReal w := by |
| 54 | simp only [Finset.sum_const, nsmul_eq_mul] |
| 55 | _ ≤ ∑ T ∈ S, ENNReal.ofReal (Real.exp (-(6 * T))) * |
| 56 | ENNReal.ofReal sigma := by |
| 57 | apply Finset.sum_le_sum |
| 58 | intro T hTS |
| 59 | have hTH := (hS hTS).1.2.2 |
| 60 | have hexp : Real.exp (-(6 * H)) ≤ Real.exp (-(6 * T)) := |
| 61 | Real.exp_le_exp.mpr (by linarith) |
| 62 | rw [show w = Real.exp (-(6 * H)) * sigma from rfl, |
| 63 | ENNReal.ofReal_mul (Real.exp_pos _).le] |
| 64 | exact mul_le_mul' (ENNReal.ofReal_le_ofReal hexp) le_rfl |
| 65 | _ ≤ _ := hsum |
| 66 | have hreal := ENNReal.toReal_mono V.initial_volume_ne_top hbound |
| 67 | simp only [ENNReal.toReal_mul, ENNReal.toReal_natCast, |
| 68 | ENNReal.toReal_ofReal hw.le] at hreal |
| 69 | exact_mod_cast (((le_div_iff₀ hw).mpr hreal).trans hn) |
| 70 | |
| 71 | /-- The cap and component bounds exclude infinitely many events below H, |
| 72 | including at an excluded domain endpoint (MT Lemma 17.12, p. 411). -/ |
| 73 | theorem surgery_times_inter_Icc_finite |
| 74 | (F : SurgeryFlowData.{u}) (C : RepairedVolumeLossControls F) |
| 75 | (V : RepairedVolumeLossData F C) (H : ℝ) (hH : 0 ≤ H) : |
| 76 | (F.surgery_times ∩ Icc 0 H).Finite := by |
| 77 | obtain ⟨ncap, hcap⟩ := cap_event_count_bound F C V H hH |
| 78 | obtain ⟨ncomp, hcomp⟩ := V.component_event_count_bound H hH |
| 79 | have hcapfinite := Set.finite_of_forall_finset_card_le _ ncap hcap |
| 80 | have hcompfinite := Set.finite_of_forall_finset_card_le _ ncomp hcomp |
| 81 | apply (hcapfinite.union hcompfinite).subset |
| 82 | intro T hTI |
| 83 | rcases isEmpty_or_nonempty (F.slice T).carrier with hEmpty | hNonempty |
| 84 | · exact Or.inr ⟨hTI, hTI.1, Or.inl hEmpty⟩ |
| 85 | · let := hNonempty |
| 86 | by_cases hzero : (F.event T hTI.1).cap_count = 0 |
| 87 | · exact Or.inr ⟨hTI, hTI.1, Or.inr ⟨hNonempty, hzero⟩⟩ |
| 88 | · exact Or.inl ⟨hTI, hTI.1, hNonempty, Nat.pos_of_ne_zero hzero⟩ |
| 89 | |
| 90 | end PoincareMT.SurgeryFiniteness |