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.Approximation.Convolution |
| 2 | import Mathlib.Analysis.Convex.Deriv |
| 3 | |
| 4 | /-! # A smooth convex regularization of absolute value |
| 5 | |
| 6 | Convolution with a normalized even bump preserves convexity and the Lipschitz |
| 7 | constant. Its vanishing first moment makes the result equal to absolute value |
| 8 | outside the support radius. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set MeasureTheory ContinuousLinearMap |
| 14 | open scoped Convolution ContDiff NNReal |
| 15 | |
| 16 | namespace Poincare |
| 17 | |
| 18 | private noncomputable def absoluteValueBump (δ : ℝ) (hδ : 0 < δ) : ContDiffBump (0 : ℝ) := |
| 19 | ⟨δ / 2, δ, half_pos hδ, half_lt_self hδ⟩ |
| 20 | |
| 21 | /-- Smooth absolute value obtained from an even probability kernel of radius `δ`. -/ |
| 22 | noncomputable def regularizedAbs (δ : ℝ) (hδ : 0 < δ) : ℝ → ℝ := |
| 23 | (absoluteValueBump δ hδ).normed volume ⋆[lsmul ℝ ℝ, volume] (fun t : ℝ => |t|) |
| 24 | |
| 25 | private theorem abs_lipschitz : LipschitzWith 1 (fun t : ℝ => |t|) := by |
| 26 | apply LipschitzWith.of_dist_le_mul |
| 27 | intro x y |
| 28 | simpa only [Real.dist_eq, NNReal.coe_one, one_mul] using abs_abs_sub_abs_le_abs_sub x y |
| 29 | |
| 30 | theorem contDiff_regularizedAbs (δ : ℝ) (hδ : 0 < δ) : |
| 31 | ContDiff ℝ ∞ (regularizedAbs δ hδ) := |
| 32 | (absoluteValueBump δ hδ).hasCompactSupport_normed.contDiff_convolution_left _ |
| 33 | (absoluteValueBump δ hδ).contDiff_normed abs_lipschitz.continuous.locallyIntegrable |
| 34 | |
| 35 | theorem lipschitzWith_regularizedAbs (δ : ℝ) (hδ : 0 < δ) : |
| 36 | LipschitzWith 1 (regularizedAbs δ hδ) := |
| 37 | lipschitzWith_normed_convolution volume abs_lipschitz (absoluteValueBump δ hδ) |
| 38 | |
| 39 | private theorem integral_bump_mul_id (φ : ContDiffBump (0 : ℝ)) : |
| 40 | ∫ t : ℝ, φ.normed volume t * t = 0 := by |
| 41 | have h := integral_neg_eq_self (fun t : ℝ => φ.normed volume t * t) volume |
| 42 | simp only [φ.normed_neg, mul_neg, integral_neg] at h |
| 43 | linarith |
| 44 | |
| 45 | private theorem integrable_bump_mul_id (φ : ContDiffBump (0 : ℝ)) : |
| 46 | Integrable (fun t : ℝ => φ.normed volume t * t) := |
| 47 | ((φ.contDiff_normed (n := 0)).continuous.mul continuous_id).integrable_of_hasCompactSupport |
| 48 | φ.hasCompactSupport_normed.mul_right |
| 49 | |
| 50 | private theorem integrable_bump_mul_abs_sub (φ : ContDiffBump (0 : ℝ)) (x : ℝ) : |
| 51 | Integrable (fun t : ℝ => φ.normed volume t * |x - t|) := by |
| 52 | exact φ.hasCompactSupport_normed.convolutionExists_left_of_continuous_right |
| 53 | (lsmul ℝ ℝ) (φ.contDiff_normed (n := 0)).continuous.locallyIntegrable |
| 54 | abs_lipschitz.continuous x |
| 55 | |
| 56 | theorem regularizedAbs_neg (δ : ℝ) (hδ : 0 < δ) (x : ℝ) : |
| 57 | regularizedAbs δ hδ (-x) = regularizedAbs δ hδ x := by |
| 58 | let φ := absoluteValueBump δ hδ |
| 59 | change (∫ t : ℝ, φ.normed volume t * |-x - t|) = |
| 60 | ∫ t : ℝ, φ.normed volume t * |x - t| |
| 61 | rw [← integral_neg_eq_self (fun t : ℝ => φ.normed volume t * |-x - t|) volume] |
| 62 | apply integral_congr_ae |
| 63 | exact Filter.Eventually.of_forall fun t => by |
| 64 | dsimp only |
| 65 | rw [φ.normed_neg] |
| 66 | congr 1 |
| 67 | rw [show -x - -t = -(x - t) by ring, abs_neg] |
| 68 | |
| 69 | theorem regularizedAbs_eq_abs (δ : ℝ) (hδ : 0 < δ) {x : ℝ} |
| 70 | (hx : δ ≤ |x|) : regularizedAbs δ hδ x = |x| := by |
| 71 | have hpos (x : ℝ) (hx : δ ≤ x) : regularizedAbs δ hδ x = x := by |
| 72 | let φ := absoluteValueBump δ hδ |
| 73 | change (∫ t : ℝ, φ.normed volume t * |x - t|) = x |
| 74 | have heq : (fun t : ℝ => φ.normed volume t * |x - t|) = |
| 75 | fun t : ℝ => φ.normed volume t * x - φ.normed volume t * t := by |
| 76 | funext t |
| 77 | by_cases ht : φ.normed volume t = 0 |
| 78 | · simp [ht] |
| 79 | · have ht' : |t| < δ := by |
| 80 | have hmem : t ∈ Function.support (φ.normed volume) := ht |
| 81 | rw [φ.support_normed_eq] at hmem |
| 82 | simpa only [Metric.mem_ball, Real.dist_eq, sub_zero, φ, absoluteValueBump] using hmem |
| 83 | rw [abs_of_nonneg (by linarith [le_abs_self t])] |
| 84 | ring |
| 85 | rw [heq, integral_sub (φ.integrable_normed.mul_const _) (integrable_bump_mul_id φ), |
| 86 | integral_mul_const, φ.integral_normed, integral_bump_mul_id, one_mul, sub_zero] |
| 87 | rcases le_total 0 x with hx0 | hx0 |
| 88 | · simpa only [abs_of_nonneg hx0] using hpos x (by simpa [abs_of_nonneg hx0] using hx) |
| 89 | · rw [← regularizedAbs_neg δ hδ x, hpos (-x) (by simpa [abs_of_nonpos hx0] using hx), |
| 90 | abs_of_nonpos hx0] |
| 91 | |
| 92 | theorem abs_le_regularizedAbs (δ : ℝ) (hδ : 0 < δ) (x : ℝ) : |
| 93 | |x| ≤ regularizedAbs δ hδ x := by |
| 94 | let φ := absoluteValueBump δ hδ |
| 95 | have heq : (∫ t : ℝ, φ.normed volume t * (x - t)) = x := by |
| 96 | simp_rw [mul_sub] |
| 97 | rw [integral_sub (φ.integrable_normed.mul_const _) (integrable_bump_mul_id φ), |
| 98 | integral_mul_const, φ.integral_normed, integral_bump_mul_id, one_mul, sub_zero] |
| 99 | calc |
| 100 | |x| = |∫ t : ℝ, φ.normed volume t * (x - t)| := congrArg abs heq.symm |
| 101 | _ ≤ |
| 102 | ∫ t : ℝ, |φ.normed volume t * (x - t)| := abs_integral_le_integral_abs |
| 103 | _ = regularizedAbs δ hδ x := by |
| 104 | simp only [abs_mul, abs_of_nonneg (φ.nonneg_normed _)] |
| 105 | rfl |
| 106 | |
| 107 | theorem regularizedAbs_le_abs_add (δ : ℝ) (hδ : 0 < δ) (x : ℝ) : |
| 108 | regularizedAbs δ hδ x ≤ |x| + δ := by |
| 109 | have h := dist_normed_convolution_le_radius volume abs_lipschitz |
| 110 | (absoluteValueBump δ hδ) x |
| 111 | change abs (regularizedAbs δ hδ x - abs x) ≤ (1 : ℝ) * δ at h |
| 112 | linarith [le_abs_self (regularizedAbs δ hδ x - |x|)] |
| 113 | |
| 114 | theorem convexOn_regularizedAbs (δ : ℝ) (hδ : 0 < δ) : |
| 115 | ConvexOn ℝ univ (regularizedAbs δ hδ) := by |
| 116 | let φ := absoluteValueBump δ hδ |
| 117 | change ConvexOn ℝ univ (fun x => ∫ t : ℝ, φ.normed volume t * |x - t|) |
| 118 | apply integral_convexOn_of_integrand_ae convex_univ |
| 119 | · apply Filter.Eventually.of_forall |
| 120 | intro t |
| 121 | have hc : ConvexOn ℝ (univ : Set ℝ) (fun x => |x - t|) := by |
| 122 | simpa only [Real.norm_eq_abs, preimage_univ, Function.comp_def, sub_eq_add_neg] using |
| 123 | (convexOn_norm (E := ℝ) convex_univ).translate_left (-t) |
| 124 | simpa only [smul_eq_mul] using hc.smul (φ.nonneg_normed t) |
| 125 | · exact fun x _ => integrable_bump_mul_abs_sub φ x |
| 126 | |
| 127 | theorem abs_deriv_regularizedAbs_le_one (δ : ℝ) (hδ : 0 < δ) (x : ℝ) : |
| 128 | |deriv (regularizedAbs δ hδ) x| ≤ 1 := by |
| 129 | simpa only [Real.norm_eq_abs, NNReal.coe_one] using |
| 130 | norm_deriv_le_of_lipschitz (x₀ := x) (lipschitzWith_regularizedAbs δ hδ) |
| 131 | |
| 132 | theorem deriv2_regularizedAbs_nonneg (δ : ℝ) (hδ : 0 < δ) (x : ℝ) : |
| 133 | 0 ≤ deriv (deriv (regularizedAbs δ hδ)) x := by |
| 134 | have hm := (convexOn_regularizedAbs δ hδ).monotoneOn_deriv |
| 135 | (fun x _ => (contDiff_regularizedAbs δ hδ).differentiable (by simp) x) |
| 136 | exact (show Monotone (deriv (regularizedAbs δ hδ)) from fun x y hxy => |
| 137 | hm (mem_univ x) (mem_univ y) hxy).deriv_nonneg |
| 138 | |
| 139 | end Poincare |