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 Mathlib.Analysis.Calculus.Deriv.MeanValue |
| 2 | import Mathlib.Analysis.SpecialFunctions.ExpDeriv |
| 3 | |
| 4 | /-! |
| 5 | Adapted from Mapher `PoincareMT/Proofs/M49/Mathlib/ExponentialComparison.lean` at |
| 6 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 7 | |
| 8 | # Exponential comparison from an interior differential inequality |
| 9 | |
| 10 | The scalar integrating-factor argument used in Morgan-Tian Lemma 17.12, |
| 11 | p. 410. Only continuity is needed at the interval endpoints. See |
| 12 | `proof-work/tasks/M49/derivations/02-density-evolution.md`. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | |
| 19 | namespace Real |
| 20 | |
| 21 | /-- The differential inequality used in MT Lemma 17.12, p. 410, gives exponential growth. -/ |
| 22 | theorem le_exp_mul_of_hasDerivAt_le {f f' : ℝ → ℝ} {a b k : ℝ} |
| 23 | (hab : a ≤ b) (hc : ContinuousOn f (Icc a b)) |
| 24 | (hd : ∀ t ∈ Ioo a b, HasDerivAt f (f' t) t) |
| 25 | (hbound : ∀ t ∈ Ioo a b, f' t ≤ k * f t) : |
| 26 | f b ≤ exp (k * (b - a)) * f a := by |
| 27 | have hw : AntitoneOn (fun t => exp (-(k * t)) * f t) (Icc a b) := by |
| 28 | apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc a b) |
| 29 | ((continuous_exp.comp (continuous_const.mul continuous_id).neg).continuousOn.mul hc) |
| 30 | (f' := fun t => exp (-(k * t)) * (f' t - k * f t)) |
| 31 | · intro t ht |
| 32 | have ht' : t ∈ Ioo a b := by simpa only [interior_Icc] using ht |
| 33 | have h := (((hasDerivAt_id t).const_mul k).neg.exp).mul (hd t ht') |
| 34 | exact (h.congr_deriv (by dsimp; ring)).hasDerivWithinAt |
| 35 | · intro t ht |
| 36 | have ht' : t ∈ Ioo a b := by simpa only [interior_Icc] using ht |
| 37 | exact mul_nonpos_of_nonneg_of_nonpos (exp_pos _).le (sub_nonpos.mpr (hbound t ht')) |
| 38 | have h := mul_le_mul_of_nonneg_left |
| 39 | (hw ⟨le_rfl, hab⟩ ⟨hab, le_rfl⟩ hab) (exp_pos (k * b)).le |
| 40 | calc |
| 41 | f b = exp (k * b) * (exp (-(k * b)) * f b) := by |
| 42 | rw [← mul_assoc, ← exp_add, add_neg_cancel, exp_zero, one_mul] |
| 43 | _ ≤ exp (k * b) * (exp (-(k * a)) * f a) := h |
| 44 | _ = exp (k * (b - a)) * f a := by |
| 45 | rw [← mul_assoc, ← exp_add] |
| 46 | congr 2 |
| 47 | ring |
| 48 | |
| 49 | end Real |