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.ReducedGeometry.ReducedVolume.Analysis.Smoothing.MollifierConcavity |
| 2 | |
| 3 | /-! |
| 4 | # Adding back the semiconcavity quadratic |
| 5 | |
| 6 | The fixed Euclidean quadratic has a controlled gradient. Adding it |
| 7 | to a smooth concave approximation restores the prescribed upper |
| 8 | Hessian bound. Local C2 addition also transports derivative limits. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set Filter Metric |
| 14 | open scoped ContDiff Topology NNReal |
| 15 | |
| 16 | namespace PoincareMT.ReducedVolume |
| 17 | |
| 18 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 19 | |
| 20 | /-- The fixed quadratic subtracted in the semiconcavity argument. -/ |
| 21 | noncomputable def euclideanQuadratic (K : ℝ) (x : E) : ℝ := K * ‖x‖ ^ 2 / 2 |
| 22 | |
| 23 | /-- The semiconcavity quadratic is smooth everywhere. -/ |
| 24 | theorem euclideanQuadratic_contDiff (K : ℝ) : ContDiff ℝ ∞ (euclideanQuadratic (E := E) K) := |
| 25 | (contDiff_const.mul (contDiff_norm_sq ℝ)).div_const 2 |
| 26 | |
| 27 | /-- The differential of the fixed quadratic is the scaled Euclidean inner product. -/ |
| 28 | theorem euclideanQuadratic_fderiv (K : ℝ) (x : E) : |
| 29 | fderiv ℝ (euclideanQuadratic K) x = K • innerSL ℝ x := by |
| 30 | have heq : euclideanQuadratic (E := E) K = fun y ↦ (K / 2) • ‖y‖ ^ 2 := by |
| 31 | funext y |
| 32 | simp only [euclideanQuadratic, smul_eq_mul] |
| 33 | ring |
| 34 | rw [heq] |
| 35 | change fderiv ℝ ((K / 2) • fun y : E ↦ ‖y‖ ^ 2) x = _ |
| 36 | rw [((hasStrictFDerivAt_norm_sq x).hasFDerivAt.const_smul (K / 2)).fderiv] |
| 37 | ext v |
| 38 | simp only [smul_apply, two_smul, add_apply, |
| 39 | smul_eq_mul] |
| 40 | ring |
| 41 | |
| 42 | /-- Local C2 addition commutes with the second Fréchet derivative. -/ |
| 43 | theorem second_fderiv_add_at {f g : E → ℝ} {x : E} |
| 44 | (hf : ContDiffAt ℝ 2 f x) (hg : ContDiffAt ℝ 2 g x) : |
| 45 | fderiv ℝ (fderiv ℝ (fun y ↦ f y + g y)) x = |
| 46 | fderiv ℝ (fderiv ℝ f) x + fderiv ℝ (fderiv ℝ g) x := by |
| 47 | have heq : fderiv ℝ (fun y ↦ f y + g y) =ᶠ[𝓝 x] |
| 48 | fun y ↦ fderiv ℝ f y + fderiv ℝ g y := by |
| 49 | filter_upwards [hf.eventually (by norm_num), hg.eventually (by norm_num)] with y hy hy' |
| 50 | exact fderiv_fun_add (hy.differentiableAt two_ne_zero) (hy'.differentiableAt two_ne_zero) |
| 51 | rw [heq.fderiv_eq] |
| 52 | exact fderiv_fun_add ((hf.fderiv_right (by norm_num)).differentiableAt one_ne_zero) |
| 53 | ((hg.fderiv_right (by norm_num)).differentiableAt one_ne_zero) |
| 54 | |
| 55 | /-- Adding the quadratic gives a uniform gradient bound on the inner ball. -/ |
| 56 | theorem norm_fderiv_add_quadratic_le {f : E → ℝ} {L : ℝ≥0} (hf : LipschitzWith L f) |
| 57 | (hfd : Differentiable ℝ f) {K : ℝ} (hK : 0 ≤ K) {x x₀ : E} {r : ℝ} |
| 58 | (hx : x ∈ ball x₀ r) : |
| 59 | ‖fderiv ℝ (fun y ↦ f y + euclideanQuadratic K y) x‖ ≤ |
| 60 | L + K * (‖x₀‖ + r) := by |
| 61 | have hq := (euclideanQuadratic_contDiff (E := E) K).differentiable (by simp) |
| 62 | rw [fderiv_fun_add (hfd x) (hq x), euclideanQuadratic_fderiv] |
| 63 | have hnorm : ‖x‖ ≤ ‖x₀‖ + r := by |
| 64 | calc |
| 65 | ‖x‖ ≤ ‖x - x₀‖ + ‖x₀‖ := norm_le_norm_sub_add _ _ |
| 66 | _ ≤ r + ‖x₀‖ := add_le_add (mem_ball_iff_norm.mp hx).le le_rfl |
| 67 | _ = ‖x₀‖ + r := add_comm _ _ |
| 68 | calc |
| 69 | _ ≤ ‖fderiv ℝ f x‖ + ‖K • innerSL ℝ x‖ := norm_add_le _ _ |
| 70 | _ = ‖fderiv ℝ f x‖ + K * ‖x‖ := by |
| 71 | rw [norm_smul, Real.norm_of_nonneg hK, innerSL_apply_norm] |
| 72 | _ ≤ L + K * (‖x₀‖ + r) := add_le_add (norm_fderiv_le_of_lipschitz ℝ hf) |
| 73 | (mul_le_mul_of_nonneg_left hnorm hK) |
| 74 | |
| 75 | /-- A smooth concave scalar plus the quadratic has the prescribed upper Hessian bound. -/ |
| 76 | theorem second_fderiv_add_quadratic_le {f : E → ℝ} {U : Set E} |
| 77 | (hU : IsOpen U) (hf : ContDiff ℝ 2 f) (hconc : ConcaveOn ℝ U f) |
| 78 | {x : E} (hx : x ∈ U) (K : ℝ) (v : E) : |
| 79 | fderiv ℝ (fderiv ℝ (fun y ↦ f y + euclideanQuadratic K y)) x v v ≤ K * ‖v‖ ^ 2 := by |
| 80 | have hq := (euclideanQuadratic_contDiff (E := E) K).of_le |
| 81 | (by decide : (2 : ℕ∞ω) ≤ ∞) |
| 82 | have hs := second_deriv_sub_norm_sq_on_line (f := fun y ↦ f y + euclideanQuadratic K y) |
| 83 | x v (t := 0) (by simpa only [zero_smul, add_zero] using (hf.add hq).contDiffAt) K |
| 84 | simp only [euclideanQuadratic, add_sub_cancel_right, zero_smul, add_zero] at hs |
| 85 | rw [second_deriv_affine_line hf.contDiffAt v] at hs |
| 86 | have hn := second_fderiv_nonpos_of_concaveOn hU hf.contDiffOn hconc hx v |
| 87 | simp only [euclideanQuadratic] |
| 88 | linarith |
| 89 | |
| 90 | end PoincareMT.ReducedVolume |