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.ExistUnique |
| 2 | import Mathlib.Analysis.Calculus.MeanValue |
| 3 | |
| 4 | /-! |
| 5 | # Uniform Picard bounds on a closed time slab |
| 6 | |
| 7 | Morgan-Tian Lemma 6.18, pp. 113-114. A smooth field on a closed |
| 8 | time slab and an open state domain has uniform field and state |
| 9 | Lipschitz bounds on a positive closed ball inside that domain. |
| 10 | Compactness and Mathlib's convex mean-value theorem provide the bounds. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Metric |
| 16 | open scoped ContDiff NNReal |
| 17 | |
| 18 | namespace PoincareMT.M14 |
| 19 | |
| 20 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [ProperSpace E] |
| 21 | |
| 22 | /-- Smooth closed-time coefficients have uniform positive field |
| 23 | and state Lipschitz bounds on a closed ball inside their open state |
| 24 | domain, the local existence estimates in Lemma 6.18, pp. 113-114. -/ |
| 25 | theorem closedODE_exists_ball_bounds {a b : ℝ} (hab : a < b) |
| 26 | {U : Set E} (hU : IsOpen U) (V : ℝ × E → E) |
| 27 | (hV : ContDiffOn ℝ ∞ V (Icc a b ×ˢ U)) {x₀ : E} (hx₀ : x₀ ∈ U) : |
| 28 | ∃ A L K : ℝ≥0, 0 < A ∧ 0 < L ∧ closedBall x₀ (A : ℝ) ⊆ U ∧ |
| 29 | (∀ t ∈ Icc a b, ∀ x ∈ closedBall x₀ (A : ℝ), ‖V (t, x)‖ ≤ L) ∧ |
| 30 | ∀ t ∈ Icc a b, LipschitzOnWith K (fun x => V (t, x)) (closedBall x₀ (A : ℝ)) := by |
| 31 | obtain ⟨r, hr, hball⟩ := Metric.isOpen_iff.mp hU x₀ hx₀ |
| 32 | let A : ℝ≥0 := ⟨r / 2, (half_pos hr).le⟩ |
| 33 | have hA : 0 < A := half_pos hr |
| 34 | have hAU : closedBall x₀ (A : ℝ) ⊆ U := |
| 35 | (closedBall_subset_ball (half_lt_self hr)).trans hball |
| 36 | let D := Icc a b ×ˢ U |
| 37 | let S := Icc a b ×ˢ closedBall x₀ (A : ℝ) |
| 38 | have hSD : S ⊆ D := prod_mono Subset.rfl hAU |
| 39 | have hD : UniqueDiffOn ℝ D := (uniqueDiffOn_Icc hab).prod hU.uniqueDiffOn |
| 40 | have hS : IsCompact S := isCompact_Icc.prod (isCompact_closedBall x₀ (A : ℝ)) |
| 41 | obtain ⟨L₀, hL₀⟩ := hS.exists_bound_of_continuousOn (hV.continuousOn.mono hSD) |
| 42 | obtain ⟨K₀, hK₀⟩ := hS.exists_bound_of_continuousOn |
| 43 | ((hV.fderivWithin hD (m := ∞) (by simp)).continuousOn.mono hSD) |
| 44 | let L : ℝ≥0 := ⟨|L₀| + 1, by positivity⟩ |
| 45 | let K : ℝ≥0 := ⟨|K₀|, abs_nonneg _⟩ |
| 46 | have hbound : ∀ z ∈ S, ‖fderivWithin ℝ V D z‖₊ ≤ K := by |
| 47 | intro z hz |
| 48 | exact_mod_cast (hK₀ z hz).trans (le_abs_self K₀) |
| 49 | have hLip : LipschitzOnWith K V S := |
| 50 | Convex.lipschitzOnWith_of_nnnorm_hasFDerivWithin_le |
| 51 | (fun z hz => ((hV z (hSD hz)).differentiableWithinAt (by simp)).hasFDerivWithinAt.mono hSD) |
| 52 | hbound ((convex_Icc a b).prod (convex_closedBall x₀ (A : ℝ))) |
| 53 | refine ⟨A, L, K, hA, show (0 : ℝ) < |L₀| + 1 by positivity, hAU, ?_, ?_⟩ |
| 54 | · intro t ht x hx |
| 55 | exact (hL₀ (t, x) ⟨ht, hx⟩).trans |
| 56 | (show L₀ ≤ |L₀| + 1 by linarith [le_abs_self L₀]) |
| 57 | · intro t ht x hx y hy |
| 58 | simpa only [Prod.edist_eq, edist_self, |
| 59 | max_eq_right (show 0 ≤ edist x y from bot_le)] using |
| 60 | hLip (x := (t, x)) (y := (t, y)) ⟨ht, hx⟩ ⟨ht, hy⟩ |
| 61 | |
| 62 | end PoincareMT.M14 |