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.Analysis.ODE.CompactConfinement |
| 2 | |
| 3 | /-! |
| 4 | # Continuation from a speed bound |
| 5 | |
| 6 | A bounded smooth vector field can be continued for every time shorter than |
| 7 | the distance to the boundary divided by its speed bound. Compactness supplies |
| 8 | local existence times; the speed estimate confines the orbit to a compact ball. |
| 9 | This is the coordinate confinement argument in Eschenburg, Lemma 7.4, p. 521. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | namespace Poincare.ODE |
| 15 | |
| 16 | open Set Metric |
| 17 | open scoped ContDiff |
| 18 | |
| 19 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 20 | |
| 21 | /-- A speed bound controls the displacement of every finite solution. -/ |
| 22 | theorem dist_le_of_solution_bounded_speed |
| 23 | {U : Set E} {F : E → E} {C T : ℝ} (hC : 0 ≤ C) |
| 24 | (hbound : ∀ y ∈ U, ‖F y‖ ≤ C) {γ : ℝ → E} |
| 25 | (hγ : ∀ t ∈ Icc 0 T, γ t ∈ U ∧ |
| 26 | HasDerivWithinAt γ (F (γ t)) (Icc 0 T) t) |
| 27 | {t : ℝ} (ht : t ∈ Icc 0 T) : dist (γ t) (γ 0) ≤ C * t := by |
| 28 | have hlip := (convex_Icc (0 : ℝ) T).lipschitzOnWith_of_nnnorm_hasDerivWithin_le |
| 29 | (C := ⟨C, hC⟩) (fun s hs => (hγ s hs).2) |
| 30 | (fun s hs => show ‖F (γ s)‖₊ ≤ ⟨C, hC⟩ from hbound (γ s) (hγ s hs).1) |
| 31 | have hb : dist (γ t) (γ 0) ≤ C * dist t 0 := |
| 32 | hlip.dist_le_mul t ht 0 ⟨le_rfl, ht.1.trans ht.2⟩ |
| 33 | simpa only [Real.dist_eq, sub_zero, abs_of_nonneg ht.1] using hb |
| 34 | |
| 35 | variable [FiniteDimensional ℝ E] |
| 36 | |
| 37 | /-- A speed bound on an open domain constructs a solution up to any time |
| 38 | whose displacement bound stays in a compact ball contained in that domain. -/ |
| 39 | theorem exists_solution_of_bounded_speed |
| 40 | {U : Set E} (hU : IsOpen U) {F : E → E} (hF : ContDiffOn ℝ ∞ F U) |
| 41 | {p x : E} {R C T : ℝ} (hball : closedBall p R ⊆ U) |
| 42 | (hC : 0 ≤ C) (hbound : ∀ y ∈ U, ‖F y‖ ≤ C) (hT : 0 ≤ T) |
| 43 | (hmargin : dist x p + C * T ≤ R) : |
| 44 | ∃ γ : ℝ → E, γ 0 = x ∧ |
| 45 | ∀ t ∈ Icc 0 T, γ t ∈ U ∧ dist (γ t) p ≤ dist x p + C * t ∧ |
| 46 | HasDerivWithinAt γ (F (γ t)) (Icc 0 T) t := by |
| 47 | have hx : x ∈ closedBall p R := by |
| 48 | apply (mem_closedBall).mpr |
| 49 | nlinarith [mul_nonneg hC hT] |
| 50 | have hdist {t : ℝ} {γ : ℝ → E} (hinit : γ 0 = x) |
| 51 | (hγ : ∀ r ∈ Icc 0 t, γ r ∈ U ∧ HasDerivWithinAt γ (F (γ r)) (Icc 0 t) r) |
| 52 | (ht : 0 ≤ t) : dist (γ t) p ≤ dist x p + C * t := by |
| 53 | have hb := dist_le_of_solution_bounded_speed hC hbound hγ ⟨ht, le_rfl⟩ |
| 54 | have hh := dist_triangle (γ t) (γ 0) p |
| 55 | rw [hinit] at hb hh |
| 56 | linarith |
| 57 | obtain ⟨γ, hinit, hγ⟩ := exists_solution_of_compact_confinement hU |
| 58 | (isCompact_closedBall p R) hball hF hx hT (fun t ht γ hinit hγ => by |
| 59 | apply (hdist hinit hγ ht.1).trans |
| 60 | nlinarith [mul_le_mul_of_nonneg_left ht.2 hC]) |
| 61 | refine ⟨γ, hinit, fun t ht => ⟨(hγ t ht).1, ?_, (hγ t ht).2⟩⟩ |
| 62 | exact hdist hinit (fun r hr => ⟨(hγ r ⟨hr.1, hr.2.trans ht.2⟩).1, |
| 63 | (hγ r ⟨hr.1, hr.2.trans ht.2⟩).2.mono (Icc_subset_Icc_right ht.2)⟩) ht.1 |
| 64 | |
| 65 | end Poincare.ODE |