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.MeanValue |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Inv |
| 3 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 4 | |
| 5 | /-! |
| 6 | # A homogeneous scalar ray fixed by its initial limit |
| 7 | |
| 8 | The equation f' = f/t makes f/t constant on a positive open interval. |
| 9 | Its initial square-time limit fixes that constant without assumptions at |
| 10 | the singular endpoint. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Topology |
| 17 | |
| 18 | namespace PoincareMT.ReducedVolume |
| 19 | |
| 20 | /-- The actual homogeneous derivative and initial scaled limit determine a scalar ray. -/ |
| 21 | theorem homogeneous_ray_eq {f : ℝ → ℝ} {b C : ℝ} (hb : 0 < b) |
| 22 | (hf : ∀ t ∈ Ioo 0 b, HasDerivAt f (f t / t) t) |
| 23 | (hlim : Tendsto (fun s : ℝ ↦ (s⁻¹) ^ 2 * f (s ^ 2)) |
| 24 | (𝓝[>] (0 : ℝ)) (𝓝 C)) {t : ℝ} (ht : t ∈ Ioo 0 b) : |
| 25 | f t = C * t := by |
| 26 | have hd (r : ℝ) (hr : r ∈ Ioo 0 b) : HasDerivAt (fun s ↦ f s / s) 0 r := by |
| 27 | apply ((hf r hr).div (hasDerivAt_id r) hr.1.ne').congr_deriv |
| 28 | simp only [id_eq] |
| 29 | field_simp [hr.1.ne'] |
| 30 | ring |
| 31 | have hconst (r : ℝ) (hr : r ∈ Ioo 0 b) : f r / r = f t / t := |
| 32 | isOpen_Ioo.is_const_of_deriv_eq_zero (convex_Ioo 0 b).isPreconnected |
| 33 | (fun s hs ↦ (hd s hs).differentiableAt.differentiableWithinAt) |
| 34 | (fun s hs ↦ (hd s hs).deriv) hr ht |
| 35 | have heq : (fun s : ℝ ↦ (s⁻¹) ^ 2 * f (s ^ 2)) =ᶠ[𝓝[>] (0 : ℝ)] |
| 36 | (fun _ ↦ f t / t) := by |
| 37 | filter_upwards [Ioo_mem_nhdsGT (Real.sqrt_pos.2 hb)] with s hs |
| 38 | have hsquare : s ^ 2 ∈ Ioo 0 b := by |
| 39 | refine ⟨sq_pos_of_pos hs.1, ?_⟩ |
| 40 | nlinarith [Real.sq_sqrt hb.le, hs.1, hs.2] |
| 41 | calc |
| 42 | (s⁻¹) ^ 2 * f (s ^ 2) = f (s ^ 2) / s ^ 2 := by |
| 43 | rw [div_eq_mul_inv, inv_pow] |
| 44 | ring |
| 45 | _ = f t / t := hconst (s ^ 2) hsquare |
| 46 | have hC : C = f t / t := tendsto_nhds_unique (hlim.congr' heq) tendsto_const_nhds |
| 47 | exact (div_eq_iff ht.1.ne').mp hC.symm |
| 48 | |
| 49 | end PoincareMT.ReducedVolume |