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.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Mathlib.SmoothAxisDivision |
| 3 | import Mathlib.Analysis.InnerProductSpace.Calculus |
| 4 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 5 | |
| 6 | /-! |
| 7 | # Smooth Euclidean extension of even radial profiles |
| 8 | |
| 9 | Morgan-Tian Section 12.6, pp. 307-314, and the corrected radial-gauge |
| 10 | tip requirement. A smooth even scalar profile on the signed axis gives |
| 11 | a genuinely smooth function of Euclidean radius, including the origin. |
| 12 | The derivative uses the actual integrated second derivative, so no |
| 13 | analyticity or assumed squared-radius factorization is needed. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Filter Asymptotics |
| 19 | open scoped ContDiff Topology |
| 20 | |
| 21 | namespace PoincareMT.M35.SmoothRadial |
| 22 | |
| 23 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 24 | |
| 25 | private theorem hasFDerivAt_norm_explicit {x : E} (hx : x ≠ 0) : |
| 26 | HasFDerivAt (fun y : E => ‖y‖) (‖x‖⁻¹ • innerSL ℝ x) x := by |
| 27 | have hn := (hasStrictFDerivAt_norm_sq x).hasFDerivAt.sqrt |
| 28 | (pow_ne_zero 2 (norm_ne_zero_iff.mpr hx)) |
| 29 | convert! hn using 1 |
| 30 | · funext y |
| 31 | simp only [Real.sqrt_sq_eq_abs, abs_norm] |
| 32 | · ext v |
| 33 | simp only [smul_apply, two_smul, add_apply, smul_eq_mul, Real.sqrt_sq_eq_abs, abs_norm] |
| 34 | field_simp [norm_ne_zero_iff.mpr hx] |
| 35 | ring |
| 36 | |
| 37 | /-- At the tip the zero derivative of an even profile cancels the norm singularity. -/ |
| 38 | theorem hasFDerivAt_even_norm_zero {f : ℝ → ℝ} |
| 39 | (hf : Differentiable ℝ f) (he : Function.Even f) : |
| 40 | HasFDerivAt (fun x : E => f ‖x‖) (0 : E →L[ℝ] ℝ) 0 := by |
| 41 | have hd : HasDerivAt f 0 0 := by |
| 42 | simpa only [deriv_zero_of_even hf he] using (hf 0).hasDerivAt |
| 43 | have ho : (fun r : ℝ => f r - f 0) =o[𝓝 0] (fun r => r) := by |
| 44 | simpa only [sub_zero, smul_zero] using hd.isLittleO |
| 45 | have hn : Tendsto (fun x : E => ‖x‖) (𝓝 0) (𝓝 0) := by |
| 46 | simpa only [norm_zero] using (continuous_norm : Continuous (fun x : E => ‖x‖)).tendsto 0 |
| 47 | have hh : (fun x : E => f ‖x‖ - f 0) =o[𝓝 0] (fun x => ‖x‖) := ho.comp_tendsto hn |
| 48 | have hh' : (fun x : E => f ‖x‖ - f 0) =o[𝓝 0] (fun x => x) := hh.of_norm_right |
| 49 | rw [hasFDerivAt_iff_isLittleO] |
| 50 | simpa only [norm_zero, zero_apply, sub_zero] using hh' |
| 51 | |
| 52 | /-- The genuine radial derivative at every point, written without division by radius. -/ |
| 53 | theorem hasFDerivAt_even_norm {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 54 | (he : Function.Even f) (x : E) : |
| 55 | HasFDerivAt (fun y : E => f ‖y‖) (axisDivision (deriv f) ‖x‖ • innerSL ℝ x) x := by |
| 56 | by_cases hx : x = 0 |
| 57 | · subst x |
| 58 | simpa only [map_zero, smul_zero] using |
| 59 | (hasFDerivAt_even_norm_zero (E := E) (hf.differentiable (by simp)) he) |
| 60 | · have hd := (hf.differentiable (by simp) ‖x‖).hasDerivAt.comp_hasFDerivAt x |
| 61 | (hasFDerivAt_norm_explicit hx) |
| 62 | convert! hd using 1 |
| 63 | ext v |
| 64 | simp only [smul_apply, smul_eq_mul] |
| 65 | rw [← mul_axisDivision_deriv hf he ‖x‖] |
| 66 | field_simp [norm_ne_zero_iff.mpr hx] |
| 67 | |
| 68 | /-- A smooth even profile extends smoothly to real Euclidean space in every dimension. -/ |
| 69 | theorem contDiff_even_norm {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 70 | (he : Function.Even f) : ContDiff ℝ ∞ (fun x : E => f ‖x‖) := by |
| 71 | have hfinite : ∀ k : ℕ, ∀ f : ℝ → ℝ, |
| 72 | ContDiff ℝ ∞ f → Function.Even f → ContDiff ℝ k (fun x : E => f ‖x‖) := by |
| 73 | intro k |
| 74 | induction k with |
| 75 | | zero => |
| 76 | intro f hf _ |
| 77 | exact contDiff_zero.mpr (hf.continuous.comp continuous_norm) |
| 78 | | succ k ih => |
| 79 | intro f hf he |
| 80 | rw [Nat.cast_add, Nat.cast_one, contDiff_succ_iff_fderiv] |
| 81 | refine ⟨fun x => (hasFDerivAt_even_norm hf he x).differentiableAt, by simp, ?_⟩ |
| 82 | have hq := ih (axisDivision (deriv f)) |
| 83 | (axisDivision_contDiff (contDiff_infty_iff_deriv.mp hf).2) |
| 84 | (axisDivision_deriv_even hf he) |
| 85 | have hd : fderiv ℝ (fun x : E => f ‖x‖) = |
| 86 | fun x => axisDivision (deriv f) ‖x‖ • innerSL ℝ x := |
| 87 | funext (fun x => (hasFDerivAt_even_norm hf he x).fderiv) |
| 88 | rw [hd] |
| 89 | let B : E →L[ℝ] E →L[ℝ] ℝ := innerSL ℝ |
| 90 | exact hq.smul B.contDiff |
| 91 | exact contDiff_infty.mpr (fun k => hfinite k f hf he) |
| 92 | |
| 93 | end PoincareMT.M35.SmoothRadial |