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.Analysis.FiniteJumpBalance |
| 2 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Analysis.ExponentialLeftLimit |
| 3 | |
| 4 | /-! |
| 5 | Adapted from Mapher `PoincareMT/Proofs/M49/Mathlib/ExponentialJumpBalance.lean` |
| 6 | at revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 7 | |
| 8 | # Exponentially weighted additive event losses |
| 9 | |
| 10 | Morgan-Tian Lemma 17.12, pp. 410-411. Multiplication by the positive |
| 11 | finite exponential weight turns ordinary exponential growth into |
| 12 | nonincrease and preserves every additive event loss, even at an |
| 13 | infinite ENNReal left limit. See M49 derivation 31. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Topology ENNReal BigOperators |
| 20 | |
| 21 | namespace ENNReal |
| 22 | |
| 23 | /-- Exponential growth and actual jumps bound the sum of weighted losses |
| 24 | (MT Lemma 17.12, pp. 410-411; M49 derivation 31). -/ |
| 25 | theorem expWeighted_add_sum_le_of_finite_left_jumps (k : ℝ) |
| 26 | {V loss : ℝ → ℝ≥0∞} {a b : ℝ} (S : Finset ℝ) |
| 27 | (hab : a ≤ b) (hS : (S : Set ℝ) ⊆ Ioc a b) |
| 28 | (hregular : ∀ x ∈ Icc a b, ∀ y ∈ Icc a b, x ≤ y → |
| 29 | Disjoint (S : Set ℝ) (Ioc x y) → |
| 30 | V y ≤ ENNReal.ofReal (Real.exp (k * (y - x))) * V x) |
| 31 | (hjump : ∀ T ∈ S, ∃ L : ℝ≥0∞, Tendsto V (𝓝[<] T) (𝓝 L) ∧ |
| 32 | V T + loss T ≤ L) : |
| 33 | ENNReal.ofReal (Real.exp (-(k * b))) * V b + |
| 34 | ∑ T ∈ S, ENNReal.ofReal (Real.exp (-(k * T))) * loss T ≤ |
| 35 | ENNReal.ofReal (Real.exp (-(k * a))) * V a := by |
| 36 | let w := fun t => ENNReal.ofReal (Real.exp (-(k * t))) * V t |
| 37 | have hbalance : w b + ∑ T ∈ S, ENNReal.ofReal (Real.exp (-(k * T))) * loss T ≤ |
| 38 | w a + ∑ _T ∈ S, (0 : ℝ≥0∞) := by |
| 39 | apply add_sum_le_add_sum_of_finite_left_jumps S hab hS |
| 40 | · intro x hx y hy hxy hdis |
| 41 | have h := mul_le_mul_right (hregular x hx y hy hxy hdis) |
| 42 | (ENNReal.ofReal (Real.exp (-(k * y)))) |
| 43 | rw [← mul_assoc, ← ofReal_mul (Real.exp_pos _).le, ← Real.exp_add] at h |
| 44 | have he : -(k * y) + k * (y - x) = -(k * x) := by ring |
| 45 | rwa [he] at h |
| 46 | · intro T hT |
| 47 | obtain ⟨L, hL, hdrop⟩ := hjump T hT |
| 48 | have hweight : Continuous (fun t : ℝ => ENNReal.ofReal (Real.exp (-(k * t)))) := |
| 49 | continuous_ofReal.comp |
| 50 | (Real.continuous_exp.comp (continuous_const.mul continuous_id).neg) |
| 51 | refine ⟨ENNReal.ofReal (Real.exp (-(k * T))) * L, ?_, ?_⟩ |
| 52 | · exact ENNReal.Tendsto.mul |
| 53 | ((hweight.tendsto T).mono_left nhdsWithin_le_nhds) |
| 54 | (Or.inl (ne_of_gt (ofReal_pos.mpr (Real.exp_pos _)))) |
| 55 | hL (Or.inr ofReal_ne_top) |
| 56 | · simpa only [w, mul_add, add_zero] using |
| 57 | mul_le_mul_right hdrop (ENNReal.ofReal (Real.exp (-(k * T)))) |
| 58 | simpa only [Finset.sum_const_zero, add_zero] using hbalance |
| 59 | |
| 60 | end ENNReal |