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.Count.UniformCapCount |
| 2 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Count.ComponentHistory |
| 3 | |
| 4 | /-! |
| 5 | Adapted from Mapher `PoincareMT/Proofs/M49/UniformEventCount.lean` at |
| 6 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 7 | |
| 8 | # Uniform event counts on included prefixes |
| 9 | |
| 10 | Morgan-Tian Lemma 17.12, pp. 410-411. The normalized initial |
| 11 | component bound and twice the full cap count control every finite |
| 12 | set of actual events. The complete prefix is used for component |
| 13 | bookkeeping even when the requested set omits events. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set MeasureTheory |
| 19 | open scoped ENNReal BigOperators |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.SurgeryVolume |
| 24 | |
| 25 | /-- Common volume and surgery-scale bounds fix the event count before |
| 26 | the flow and its included prefix (MT Lemma 17.12, pp. 410-411). -/ |
| 27 | theorem exists_uniform_event_prefix_bound |
| 28 | (c d B : ℝ) (V₀ : ℝ≥0∞) (hMin : ℝ) |
| 29 | (hc : 0 < c) (hd : 0 < d) (hV₀ : V₀ ≠ ⊤) (hhMin : 0 < hMin) : |
| 30 | ∃ N : ℕ, ∀ (F : SurgeryFlowData.{u}) (b : ℝ), |
| 31 | b ∈ F.time_domain → b ≤ B → |
| 32 | (∀ t ∈ Icc 0 b, SurgeryPinchedAt (F.connection t) t) → |
| 33 | (∀ (T : ℝ) (hT : T ∈ F.surgery_times), T ∈ Icc 0 b → |
| 34 | ∀ [Nonempty (F.slice T).carrier], (F.event T hT).cap_count = 0 → |
| 35 | ∃ x : (F.slice (F.event T hT).tMinus).carrier, |
| 36 | connectedComponent x ⊆ (F.event T hT).retained_preᶜ) → |
| 37 | calibratedMetricVolume (F.metric 0) univ ≤ V₀ → |
| 38 | (∀ T ∈ F.surgery_times ∩ Icc 0 b, |
| 39 | F.parameters.delta T ≤ d ∧ hMin ≤ F.parameters.h T) → |
| 40 | (∀ (T : ℝ) (hT : T ∈ F.surgery_times), T ∈ Icc 0 b → |
| 41 | ∀ [Nonempty (F.slice T).carrier], |
| 42 | calibratedMetricVolume (F.metric T) univ + |
| 43 | ((F.event T hT).cap_count : ℝ≥0∞) * |
| 44 | ENNReal.ofReal (c * (F.parameters.h T ^ 3 / F.parameters.delta T)) ≤ |
| 45 | calibratedMetricVolume (F.event T hT).limit_metric univ) → |
| 46 | ∀ S : Finset ℝ, (S : Set ℝ) ⊆ F.surgery_times ∩ Icc 0 b → S.card ≤ N := by |
| 47 | classical |
| 48 | obtain ⟨Nc, hNc⟩ := exists_uniform_cap_count_bound c d B V₀ hMin hc hd hV₀ hhMin |
| 49 | obtain ⟨N₀, hN₀⟩ := exists_uniform_initial_component_bound V₀ hV₀ |
| 50 | refine ⟨N₀ + 2 * Nc, ?_⟩ |
| 51 | intro F b hb hbB hpinched hdiscard hvol hscale hdrop S hS |
| 52 | have hfinite : (F.surgery_times ∩ Ioc 0 b).Finite := |
| 53 | (surgeryTimes_inter_Icc_finite F F.zero_mem hb).subset |
| 54 | (inter_subset_inter_right _ Ioc_subset_Icc_self) |
| 55 | let A := hfinite.toFinset |
| 56 | have hA : (A : Set ℝ) = F.surgery_times ∩ Ioc 0 b := hfinite.coe_toFinset |
| 57 | have hAI : (A : Set ℝ) ⊆ F.surgery_times ∩ Icc 0 b := by |
| 58 | rw [hA] |
| 59 | exact inter_subset_inter_right _ Ioc_subset_Icc_self |
| 60 | have hSA : S ⊆ A := by |
| 61 | intro T hTS |
| 62 | have hT := hS hTS |
| 63 | change T ∈ (A : Set ℝ) |
| 64 | rw [hA] |
| 65 | exact ⟨hT.1, surgeryTime_pos F hT.1, hT.2.2⟩ |
| 66 | have hcap := hNc F b hb hbB hpinched hvol hscale hdrop A hAI |
| 67 | have hcomponent := event_card_le_initial_add_twice_caps F hb hdiscard A hA |
| 68 | have hinitial := hN₀ F hvol |
| 69 | have hcard := Finset.card_le_card hSA |
| 70 | omega |
| 71 | |
| 72 | end PoincareMT.SurgeryVolume |