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.Uniqueness.Open |
| 2 | |
| 3 | /-! # Uniqueness on a compact time interval -/ |
| 4 | |
| 5 | open Set |
| 6 | open scoped ContDiff |
| 7 | |
| 8 | namespace Poincare.ODE |
| 9 | |
| 10 | /-- Two solutions of a continuously differentiable autonomous field agree |
| 11 | on a closed interval if they agree at its left endpoint. -/ |
| 12 | theorem eqOn_Icc_of_hasDerivAt |
| 13 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 14 | {F : E → E} (hF : ContDiff ℝ 1 F) {γ η : ℝ → E} {a b : ℝ} |
| 15 | (hγ : ∀ t ∈ Icc a b, HasDerivAt γ (F (γ t)) t) |
| 16 | (hη : ∀ t ∈ Icc a b, HasDerivAt η (F (η t)) t) |
| 17 | (heq : γ a = η a) : EqOn γ η (Icc a b) := by |
| 18 | have hcγ : ContinuousOn γ (Icc a b) := |
| 19 | fun t ht => (hγ t ht).continuousAt.continuousWithinAt |
| 20 | have hcη : ContinuousOn η (Icc a b) := |
| 21 | fun t ht => (hη t ht).continuousAt.continuousWithinAt |
| 22 | let K := γ '' Icc a b ∪ η '' Icc a b |
| 23 | have hK : IsCompact K := (isCompact_Icc.image_of_continuousOn hcγ).union |
| 24 | (isCompact_Icc.image_of_continuousOn hcη) |
| 25 | obtain ⟨C, hC⟩ := hF.locallyLipschitz.locallyLipschitzOn.exists_lipschitzOnWith_of_compact hK |
| 26 | exact ODE_solution_unique_of_mem_Icc_right (v := fun _ => F) (s := fun _ => K) |
| 27 | (fun _ _ => hC) hcγ |
| 28 | (fun t ht => (hγ t (Ico_subset_Icc_self ht)).hasDerivWithinAt) |
| 29 | (fun t ht => Or.inl ⟨t, Ico_subset_Icc_self ht, rfl⟩) hcη |
| 30 | (fun t ht => (hη t (Ico_subset_Icc_self ht)).hasDerivWithinAt) |
| 31 | (fun t ht => Or.inr ⟨t, Ico_subset_Icc_self ht, rfl⟩) heq |
| 32 | |
| 33 | end Poincare.ODE |