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 PoincareLib.Analysis.Convex.Semiconcavity |
| 3 | import Mathlib.Analysis.InnerProductSpace.Basic |
| 4 | |
| 5 | /-! |
| 6 | # Smooth approximation preserving semiconcavity |
| 7 | |
| 8 | Positive normalized convolution preserves a quadratic concavity bound and |
| 9 | the Lipschitz constant. This is the Euclidean local analytic step toward the |
| 10 | controlled distance smoothing used in Petrunin, Section 4.5, manuscript p. 9. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set ContinuousLinearMap MeasureTheory |
| 16 | open scoped Convolution NNReal ContDiff |
| 17 | |
| 18 | namespace Poincare |
| 19 | |
| 20 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 21 | |
| 22 | /-- Translating a function preserves its quadratic concavity bound. -/ |
| 23 | theorem concaveOn_sub_norm_sq_translate {f : E → ℝ} {C : ℝ} {s T : Set E} |
| 24 | (hf : ConcaveOn ℝ T (fun x => f x - C * ‖x‖ ^ 2 / 2)) |
| 25 | (hs : Convex ℝ s) (t : E) (hsub : ∀ x ∈ s, x - t ∈ T) : |
| 26 | ConcaveOn ℝ s (fun x => f (x - t) - C * ‖x‖ ^ 2 / 2) := by |
| 27 | refine ⟨hs, ?_⟩ |
| 28 | intro x hx y hy a b ha hb hab |
| 29 | have h := hf.2 (hsub x hx) (hsub y hy) ha hb hab |
| 30 | have ht : a • (x - t) + b • (y - t) = (a • x + b • y) - t := by |
| 31 | rw [smul_sub, smul_sub, sub_add_sub_comm, ← add_smul, hab, one_smul] |
| 32 | rw [ht] at h |
| 33 | simp only [norm_sub_sq_real, inner_add_left, real_inner_smul_left, |
| 34 | smul_eq_mul] at h ⊢ |
| 35 | have hb' : b = 1 - a := by linarith |
| 36 | rw [hb'] at h ⊢ |
| 37 | nlinarith [h] |
| 38 | |
| 39 | variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] |
| 40 | (μ : Measure E) [μ.IsAddHaarMeasure] |
| 41 | |
| 42 | /-- Normalized positive convolution preserves a local semiconcavity constant |
| 43 | where all translated arguments in its support lie in the original domain. -/ |
| 44 | theorem concaveOn_sub_norm_sq_normed_convolution_on |
| 45 | {f : E → ℝ} {C : ℝ} {s T : Set E} (hs : Convex ℝ s) |
| 46 | (hf : Continuous f) |
| 47 | (hconc : ConcaveOn ℝ T (fun x => f x - C * ‖x‖ ^ 2 / 2)) |
| 48 | (φ : ContDiffBump (0 : E)) |
| 49 | (hsub : ∀ t ∈ Metric.ball (0 : E) φ.rOut, ∀ x ∈ s, x - t ∈ T) : |
| 50 | ConcaveOn ℝ s |
| 51 | (fun x => (φ.normed μ ⋆[lsmul ℝ ℝ, μ] f) x - C * ‖x‖ ^ 2 / 2) := by |
| 52 | have hi : ConvolutionExists (φ.normed μ) f (lsmul ℝ ℝ) μ := |
| 53 | φ.hasCompactSupport_normed.convolutionExists_left_of_continuous_right |
| 54 | (lsmul ℝ ℝ) (φ.contDiff_normed (n := 0)).continuous.locallyIntegrable hf |
| 55 | simp only [ConvolutionExists, ConvolutionExistsAt, lsmul_apply, smul_eq_mul] at hi |
| 56 | have hc : ConcaveOn ℝ s |
| 57 | (fun x => ∫ t, φ.normed μ t * (f (x - t) - C * ‖x‖ ^ 2 / 2) ∂μ) := by |
| 58 | apply integral_concaveOn_of_integrand_ae hs |
| 59 | · exact Filter.Eventually.of_forall fun t => by |
| 60 | by_cases ht : t ∈ Metric.ball (0 : E) φ.rOut |
| 61 | · simpa only [smul_eq_mul] using |
| 62 | (concaveOn_sub_norm_sq_translate hconc hs t (hsub t ht)).smul |
| 63 | (φ.nonneg_normed t) |
| 64 | · have hz : φ.normed μ t = 0 := by |
| 65 | by_contra hn |
| 66 | apply ht |
| 67 | rw [← φ.support_normed_eq (μ := μ)] |
| 68 | exact hn |
| 69 | simpa only [hz, zero_mul] using concaveOn_const (0 : ℝ) hs |
| 70 | · intro x _ |
| 71 | simp_rw [mul_sub] |
| 72 | exact (hi x).sub (φ.integrable_normed.mul_const _) |
| 73 | convert hc using 1 |
| 74 | ext x |
| 75 | simp only [convolution_def, lsmul_apply, smul_eq_mul, mul_sub] |
| 76 | rw [integral_sub (hi x) (φ.integrable_normed.mul_const _), |
| 77 | integral_mul_const, φ.integral_normed, one_mul] |
| 78 | |
| 79 | /-- Normalized positive convolution preserves the global semiconcavity constant. -/ |
| 80 | theorem concaveOn_sub_norm_sq_normed_convolution {f : E → ℝ} {C : ℝ} |
| 81 | (hf : Continuous f) |
| 82 | (hconc : ConcaveOn ℝ univ (fun x => f x - C * ‖x‖ ^ 2 / 2)) |
| 83 | (φ : ContDiffBump (0 : E)) : |
| 84 | ConcaveOn ℝ univ |
| 85 | (fun x => (φ.normed μ ⋆[lsmul ℝ ℝ, μ] f) x - C * ‖x‖ ^ 2 / 2) := |
| 86 | concaveOn_sub_norm_sq_normed_convolution_on μ convex_univ hf hconc φ |
| 87 | (fun _ _ _ _ => mem_univ _) |
| 88 | |
| 89 | end Poincare |
| 90 | |
| 91 | namespace Poincare |
| 92 | |
| 93 | /-- Euclidean smoothing with the original Lipschitz and semiconcavity constants. -/ |
| 94 | theorem exists_contDiff_lipschitz_semiconcave_approx |
| 95 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 96 | [FiniteDimensional ℝ E] {f : E → ℝ} {K : ℝ≥0} {C : ℝ} |
| 97 | (hf : LipschitzWith K f) |
| 98 | (hconc : ConcaveOn ℝ univ (fun x => f x - C * ‖x‖ ^ 2 / 2)) |
| 99 | {ε : ℝ} (hε : 0 < ε) : |
| 100 | ∃ u : E → ℝ, ContDiff ℝ ∞ u ∧ LipschitzWith K u ∧ |
| 101 | (∀ x, dist (u x) (f x) ≤ ε) ∧ |
| 102 | ConcaveOn ℝ univ (fun x => u x - C * ‖x‖ ^ 2 / 2) := by |
| 103 | borelize E |
| 104 | let μ : Measure E := Measure.addHaar |
| 105 | let r : ℝ := ε / (K + 1) |
| 106 | have hr : 0 < r := div_pos hε (by positivity) |
| 107 | let φ : ContDiffBump (0 : E) := ⟨r / 2, r, half_pos hr, half_lt_self hr⟩ |
| 108 | refine ⟨φ.normed μ ⋆[lsmul ℝ ℝ, μ] f, ?_, |
| 109 | lipschitzWith_normed_convolution μ hf φ, ?_, |
| 110 | concaveOn_sub_norm_sq_normed_convolution μ hf.continuous hconc φ⟩ |
| 111 | · exact φ.hasCompactSupport_normed.contDiff_convolution_left _ |
| 112 | φ.contDiff_normed hf.continuous.locallyIntegrable |
| 113 | · intro x |
| 114 | apply (dist_normed_convolution_le_radius μ hf φ x).trans |
| 115 | change (K : ℝ) * r ≤ ε |
| 116 | have heq : r * (K + 1) = ε := div_mul_cancel₀ _ (by positivity) |
| 117 | nlinarith |
| 118 | |
| 119 | /-- On a smaller ball, smoothing preserves a local Hessian upper bound as |
| 120 | well as a global Lipschitz bound and any prescribed uniform error. -/ |
| 121 | theorem exists_contDiff_lipschitz_hessian_approx_on_ball |
| 122 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 123 | [FiniteDimensional ℝ E] {f : E → ℝ} {K : ℝ≥0} {C : ℝ} |
| 124 | (hf : LipschitzWith K f) {x₀ : E} {r R : ℝ} (hrR : r < R) |
| 125 | (hconc : ConcaveOn ℝ (Metric.ball x₀ R) (fun x => f x - C * ‖x‖ ^ 2 / 2)) |
| 126 | {ε : ℝ} (hε : 0 < ε) : |
| 127 | ∃ u : E → ℝ, ContDiff ℝ ∞ u ∧ LipschitzWith K u ∧ |
| 128 | (∀ x, dist (u x) (f x) ≤ ε) ∧ |
| 129 | ∀ x ∈ Metric.ball x₀ r, ∀ v : E, |
| 130 | fderiv ℝ (fderiv ℝ u) x v v ≤ C * ‖v‖ ^ 2 := by |
| 131 | borelize E |
| 132 | let μ : Measure E := Measure.addHaar |
| 133 | let ρ : ℝ := min (R - r) (ε / (K + 1)) |
| 134 | have hρ : 0 < ρ := lt_min (sub_pos.mpr hrR) (div_pos hε (by positivity)) |
| 135 | let φ : ContDiffBump (0 : E) := ⟨ρ / 2, ρ, half_pos hρ, half_lt_self hρ⟩ |
| 136 | let u := φ.normed μ ⋆[lsmul ℝ ℝ, μ] f |
| 137 | have hu : ContDiff ℝ ∞ u := φ.hasCompactSupport_normed.contDiff_convolution_left _ |
| 138 | φ.contDiff_normed hf.continuous.locallyIntegrable |
| 139 | refine ⟨u, hu, lipschitzWith_normed_convolution μ hf φ, ?_, ?_⟩ |
| 140 | · intro x |
| 141 | apply (dist_normed_convolution_le_radius μ hf φ x).trans |
| 142 | change (K : ℝ) * ρ ≤ ε |
| 143 | have hsmall : ρ ≤ ε / (K + 1) := min_le_right _ _ |
| 144 | have hbound := (le_div_iff₀ (show 0 < (K : ℝ) + 1 by positivity)).mp hsmall |
| 145 | nlinarith [K.coe_nonneg] |
| 146 | · have hc : ConcaveOn ℝ (Metric.ball x₀ r) (fun x => u x - C * ‖x‖ ^ 2 / 2) := by |
| 147 | apply concaveOn_sub_norm_sq_normed_convolution_on μ (convex_ball x₀ r) |
| 148 | hf.continuous hconc φ |
| 149 | intro t ht x hx |
| 150 | have ht' : ‖t‖ < ρ := by simpa only [Metric.mem_ball, dist_zero_right] using ht |
| 151 | have hx' : ‖x - x₀‖ < r := by simpa only [Metric.mem_ball, dist_eq_norm] using hx |
| 152 | have hsmall : ρ ≤ R - r := min_le_left _ _ |
| 153 | rw [Metric.mem_ball, dist_eq_norm] |
| 154 | have heq : x - t - x₀ = (x - x₀) - t := by abel |
| 155 | rw [heq] |
| 156 | exact (norm_sub_le _ _).trans_lt (by linarith) |
| 157 | intro x hx v |
| 158 | exact Analysis.fderiv_fderiv_le_of_concaveOn_sub_norm_sq |
| 159 | Metric.isOpen_ball hu.contDiffOn hc hx v |
| 160 | |
| 161 | /-- A Lipschitz function on a ball admits smooth approximations with its |
| 162 | original Hessian upper bound on every strictly smaller concentric ball. -/ |
| 163 | theorem exists_contDiff_hessian_approx_of_lipschitzOn_ball |
| 164 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 165 | [FiniteDimensional ℝ E] {f : E → ℝ} {K : ℝ≥0} {C : ℝ} |
| 166 | {x₀ : E} {r R : ℝ} (hrR : r < R) |
| 167 | (hf : LipschitzOnWith K f (Metric.ball x₀ R)) |
| 168 | (hconc : ConcaveOn ℝ (Metric.ball x₀ R) (fun x => f x - C * ‖x‖ ^ 2 / 2)) |
| 169 | {ε : ℝ} (hε : 0 < ε) : |
| 170 | ∃ u : E → ℝ, ContDiff ℝ ∞ u ∧ LipschitzWith K u ∧ |
| 171 | (∀ x ∈ Metric.ball x₀ R, dist (u x) (f x) ≤ ε) ∧ |
| 172 | ∀ x ∈ Metric.ball x₀ r, ∀ v : E, |
| 173 | fderiv ℝ (fderiv ℝ u) x v v ≤ C * ‖v‖ ^ 2 := by |
| 174 | obtain ⟨F, hF, heq⟩ := hf.extend_real |
| 175 | have hc : ConcaveOn ℝ (Metric.ball x₀ R) |
| 176 | (fun x => F x - C * ‖x‖ ^ 2 / 2) := |
| 177 | hconc.congr (fun x hx => congrArg (fun z => z - C * ‖x‖ ^ 2 / 2) (heq hx)) |
| 178 | obtain ⟨u, hu, hLu, herr, hess⟩ := |
| 179 | exists_contDiff_lipschitz_hessian_approx_on_ball hF hrR hc hε |
| 180 | exact ⟨u, hu, hLu, fun x hx => by simpa only [heq hx] using herr x, hess⟩ |
| 181 | |
| 182 | end Poincare |