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.ODE.Gronwall |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Prod |
| 3 | |
| 4 | /-! |
| 5 | # Two-sided propagation from a fixed reference time |
| 6 | |
| 7 | An affine derivative estimate propagates a norm bound in either direction |
| 8 | from zero. Parametrizing the segment by the unit interval avoids any endpoint |
| 9 | derivative assumption beyond differentiability on the given time set. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set |
| 16 | |
| 17 | namespace PoincareMT.SpacetimeBounds |
| 18 | |
| 19 | theorem norm_le_exp_of_affine_deriv_bound |
| 20 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 21 | {f : ℝ → E} {J : Set ℝ} (hJ : Convex ℝ J) (h0 : (0 : ℝ) ∈ J) |
| 22 | (hf : ∀ t ∈ J, DifferentiableAt ℝ f t) |
| 23 | {C K D : ℝ} (hC : 0 ≤ C) (hK : 0 ≤ K) |
| 24 | (hinit : ‖f 0‖ ≤ D) |
| 25 | (hbound : ∀ t ∈ J, ‖deriv f t‖ ≤ C + K * ‖f t‖) |
| 26 | {t : ℝ} (ht : t ∈ J) : |
| 27 | ‖f t‖ ≤ max D 1 * Real.exp ((C + K) * |t|) := by |
| 28 | let q : ℝ → E × ℝ := fun s => (f (s * t), 1) |
| 29 | let q' : ℝ → E × ℝ := fun s => (t • deriv f (s * t), 0) |
| 30 | have hseg {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : s * t ∈ J := by |
| 31 | simpa only [smul_eq_mul, mul_zero, zero_add] using |
| 32 | hJ h0 ht (sub_nonneg.mpr hs.2) hs.1 (by ring : (1 - s) + s = 1) |
| 33 | have hq {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : HasDerivAt q (q' s) s := by |
| 34 | have hline := (hasDerivAt_id s).mul_const t |
| 35 | have hcomp := ((hf _ (hseg hs)).hasDerivAt.scomp s hline).prodMk |
| 36 | (hasDerivAt_const s (1 : ℝ)) |
| 37 | simpa only [q, q', one_mul, Function.comp_def, id_eq] using hcomp |
| 38 | have hqbound {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : |
| 39 | ‖q' s‖ ≤ ((C + K) * |t|) * ‖q s‖ + 0 := by |
| 40 | have hinit' : C ≤ C * max ‖f (s * t)‖ 1 := by |
| 41 | simpa using mul_le_mul_of_nonneg_left (le_max_right ‖f (s * t)‖ 1) hC |
| 42 | have hlinear : K * ‖f (s * t)‖ ≤ K * max ‖f (s * t)‖ 1 := |
| 43 | mul_le_mul_of_nonneg_left (le_max_left _ _) hK |
| 44 | have hderiv : ‖deriv f (s * t)‖ ≤ (C + K) * max ‖f (s * t)‖ 1 := by |
| 45 | nlinarith only [hbound _ (hseg hs), hinit', hlinear] |
| 46 | simpa only [q', q, Prod.norm_def, norm_zero, norm_smul, Real.norm_eq_abs, |
| 47 | max_eq_left (mul_nonneg (abs_nonneg t) (norm_nonneg _)), |
| 48 | norm_one, add_zero, mul_assoc, mul_left_comm, mul_comm] using |
| 49 | mul_le_mul_of_nonneg_left hderiv (abs_nonneg t) |
| 50 | have hgr := norm_le_gronwallBound_of_norm_deriv_right_le |
| 51 | (fun s hs => (hq hs).continuousAt.continuousWithinAt) |
| 52 | (fun s hs => (hq (Ico_subset_Icc_self hs)).hasDerivWithinAt) |
| 53 | (show ‖q 0‖ ≤ max D 1 by simpa [q, Prod.norm_def] using max_le_max hinit (le_refl (1 : ℝ))) |
| 54 | (fun s hs => hqbound (Ico_subset_Icc_self hs)) 1 (by constructor <;> norm_num) |
| 55 | rw [gronwallBound_ε0] at hgr |
| 56 | have hnorm : ‖f t‖ ≤ ‖q 1‖ := by |
| 57 | simpa only [q, one_mul] using norm_fst_le (q 1) |
| 58 | exact hnorm.trans (by simpa using hgr) |
| 59 | |
| 60 | end PoincareMT.SpacetimeBounds |