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.Directional |
| 2 | import PoincareLib.Analysis.Calculus.MeanValue.UpperSupport |
| 3 | |
| 4 | /-! |
| 5 | # Local smoothing with directional constraints |
| 6 | |
| 7 | A single positive convolution preserves local semiconcavity, Lipschitz and |
| 8 | directional increment bounds. Directions may depend on the evaluation point. |
| 9 | Independent differentiable upper supports can supply the directional bounds. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | open Set Filter ContinuousLinearMap MeasureTheory |
| 14 | open scoped Convolution NNReal ContDiff Topology |
| 15 | |
| 16 | namespace Poincare |
| 17 | |
| 18 | /-- Local convolution preserves any family of two-sided directional increment bounds. -/ |
| 19 | theorem exists_contDiff_hessian_directional_approx_of_lipschitzOn_ball |
| 20 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 21 | [FiniteDimensional ℝ E] {ι : Type*} {f : E → ℝ} {K : ℝ≥0} {C : ℝ} |
| 22 | {x₀ : E} {r R : ℝ} (hrR : r < R) |
| 23 | (hf : LipschitzOnWith K f (Metric.ball x₀ R)) |
| 24 | (hconc : ConcaveOn ℝ (Metric.ball x₀ R) (fun x => f x - C * ‖x‖ ^ 2 / 2)) |
| 25 | (v : ι → E → E) (lo hi : ι → E → ℝ) |
| 26 | (hinc : ∀ i x, x ∈ Metric.ball x₀ r → ∀ y ∈ Metric.ball x₀ R, |
| 27 | ∀ t : ℝ, 0 ≤ t → y + t • v i x ∈ Metric.ball x₀ R → |
| 28 | t * lo i x ≤ f (y + t • v i x) - f y ∧ |
| 29 | f (y + t • v i x) - f y ≤ t * hi i x) |
| 30 | {ε : ℝ} (hε : 0 < ε) : |
| 31 | ∃ u : E → ℝ, ContDiff ℝ ∞ u ∧ LipschitzWith K u ∧ |
| 32 | (∀ x ∈ Metric.ball x₀ R, dist (u x) (f x) ≤ ε) ∧ |
| 33 | (∀ x ∈ Metric.ball x₀ r, ∀ w : E, |
| 34 | fderiv ℝ (fderiv ℝ u) x w w ≤ C * ‖w‖ ^ 2) ∧ |
| 35 | ∀ i x, x ∈ Metric.ball x₀ r → |
| 36 | lo i x ≤ fderiv ℝ u x (v i x) ∧ fderiv ℝ u x (v i x) ≤ hi i x := by |
| 37 | borelize E |
| 38 | let μ : Measure E := Measure.addHaar |
| 39 | obtain ⟨F, hF, heq⟩ := hf.extend_real |
| 40 | have hcF : ConcaveOn ℝ (Metric.ball x₀ R) |
| 41 | (fun x => F x - C * ‖x‖ ^ 2 / 2) := |
| 42 | hconc.congr (fun x hx => congrArg (fun z => z - C * ‖x‖ ^ 2 / 2) (heq hx)) |
| 43 | let ρ : ℝ := min ((R - r) / 2) (ε / (K + 1)) |
| 44 | have hρ : 0 < ρ := lt_min (half_pos (sub_pos.mpr hrR)) |
| 45 | (div_pos hε (by positivity)) |
| 46 | have hρR : ρ ≤ (R - r) / 2 := min_le_left _ _ |
| 47 | let φ : ContDiffBump (0 : E) := ⟨ρ / 2, ρ, half_pos hρ, half_lt_self hρ⟩ |
| 48 | let u := φ.normed μ ⋆[lsmul ℝ ℝ, μ] F |
| 49 | have hu : ContDiff ℝ ∞ u := φ.hasCompactSupport_normed.contDiff_convolution_left _ |
| 50 | φ.contDiff_normed hF.continuous.locallyIntegrable |
| 51 | have hnear : ∀ x ∈ Metric.ball x₀ r, ∀ y ∈ Metric.ball x ρ, |
| 52 | dist y x₀ < r + ρ := by |
| 53 | intro x hx y hy |
| 54 | exact (dist_triangle y x x₀).trans_lt (by |
| 55 | have := Metric.mem_ball.mp hx |
| 56 | have := Metric.mem_ball.mp hy |
| 57 | linarith) |
| 58 | have hnearR : ∀ x ∈ Metric.ball x₀ r, ∀ y ∈ Metric.ball x ρ, |
| 59 | y ∈ Metric.ball x₀ R := by |
| 60 | intro x hx y hy |
| 61 | exact (hnear x hx y hy).trans_le (by linarith) |
| 62 | refine ⟨u, hu, lipschitzWith_normed_convolution μ hF φ, ?_, ?_, ?_⟩ |
| 63 | · intro x hx |
| 64 | rw [heq hx] |
| 65 | apply (dist_normed_convolution_le_radius μ hF φ x).trans |
| 66 | change (K : ℝ) * ρ ≤ ε |
| 67 | have hsmall : ρ ≤ ε / (K + 1) := min_le_right _ _ |
| 68 | have hbound := (le_div_iff₀ (show 0 < (K : ℝ) + 1 by positivity)).mp hsmall |
| 69 | nlinarith [K.coe_nonneg] |
| 70 | · have hc : ConcaveOn ℝ (Metric.ball x₀ r) (fun x => u x - C * ‖x‖ ^ 2 / 2) := by |
| 71 | apply concaveOn_sub_norm_sq_normed_convolution_on μ (convex_ball x₀ r) |
| 72 | hF.continuous hcF φ |
| 73 | intro z hz x hx |
| 74 | apply hnearR x hx |
| 75 | simpa only [Metric.mem_ball, dist_eq_norm, sub_sub_cancel_left, |
| 76 | norm_neg, sub_zero] using hz |
| 77 | intro x hx w |
| 78 | exact Analysis.fderiv_fderiv_le_of_concaveOn_sub_norm_sq |
| 79 | Metric.isOpen_ball hu.contDiffOn hc hx w |
| 80 | · intro i x hx |
| 81 | let T : ℝ := (R - r) / (2 * (‖v i x‖ + 1)) |
| 82 | have hT : 0 < T := div_pos (sub_pos.mpr hrR) (by positivity) |
| 83 | have hstep : ∀ t ∈ Ioo (0 : ℝ) T, ∀ y ∈ Metric.ball x ρ, |
| 84 | ∀ w : E, ‖w‖ = ‖v i x‖ → y + t • w ∈ Metric.ball x₀ R := by |
| 85 | intro t ht y hy w hw |
| 86 | have htprod : t * (2 * (‖v i x‖ + 1)) < R - r := |
| 87 | (lt_div_iff₀ (by positivity)).mp ht.2 |
| 88 | have hn : ‖t • w‖ = t * ‖v i x‖ := by |
| 89 | rw [norm_smul, Real.norm_eq_abs, abs_of_pos ht.1, hw] |
| 90 | have hdist : dist (y + t • w) x₀ ≤ dist y x₀ + ‖t • w‖ := by |
| 91 | simpa only [dist_eq_norm, add_sub_right_comm] using |
| 92 | norm_add_le (y - x₀) (t • w) |
| 93 | have hnnear := hnear x hx y hy |
| 94 | rw [Metric.mem_ball] |
| 95 | rw [hn] at hdist |
| 96 | nlinarith [norm_nonneg (v i x)] |
| 97 | have hupper : fderiv ℝ u x (v i x) ≤ hi i x := by |
| 98 | apply fderiv_normed_convolution_apply_le_of_increment_bound μ hF.continuous φ hT |
| 99 | intro t ht y hy |
| 100 | have hyR := hnearR x hx y hy |
| 101 | have hzR := hstep t ht y hy (v i x) rfl |
| 102 | simpa only [heq hyR, heq hzR] using (hinc i x hx y hyR t ht.1.le hzR).2 |
| 103 | have hlower : fderiv ℝ u x (-v i x) ≤ -lo i x := by |
| 104 | apply fderiv_normed_convolution_apply_le_of_increment_bound μ hF.continuous φ hT |
| 105 | intro t ht y hy |
| 106 | have hyR := hnearR x hx y hy |
| 107 | have hzR := hstep t ht y hy (-v i x) (norm_neg _) |
| 108 | have hz : y + t • (-v i x) + t • v i x = y := by |
| 109 | simp only [smul_neg] |
| 110 | abel |
| 111 | have hb := (hinc i x hx (y + t • (-v i x)) hzR t ht.1.le |
| 112 | (by simpa only [hz] using hyR)).1 |
| 113 | rw [hz] at hb |
| 114 | rw [← heq hyR, ← heq hzR] |
| 115 | nlinarith |
| 116 | rw [map_neg] at hlower |
| 117 | exact ⟨by linarith, hupper⟩ |
| 118 | |
| 119 | /-- Directional upper supports and semiconcavity can be supplied independently. -/ |
| 120 | theorem exists_contDiff_hessian_directional_approx_of_upper_support |
| 121 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 122 | [FiniteDimensional ℝ E] {ι : Type*} {f : E → ℝ} {K : ℝ≥0} {C : ℝ} |
| 123 | {x₀ : E} {r R : ℝ} (hrR : r < R) |
| 124 | (hf : LipschitzOnWith K f (Metric.ball x₀ R)) |
| 125 | (hconc : ConcaveOn ℝ (Metric.ball x₀ R) (fun x => f x - C * ‖x‖ ^ 2 / 2)) |
| 126 | (v : ι → E → E) (lo hi : ι → E → ℝ) |
| 127 | (hsupport : ∀ i x, x ∈ Metric.ball x₀ r → ∀ y ∈ Metric.ball x₀ R, |
| 128 | ∃ g : E → ℝ, DifferentiableAt ℝ g y ∧ g y = f y ∧ |
| 129 | (∀ᶠ z in 𝓝 y, f z ≤ g z) ∧ |
| 130 | lo i x ≤ fderiv ℝ g y (v i x) ∧ fderiv ℝ g y (v i x) ≤ hi i x) |
| 131 | {ε : ℝ} (hε : 0 < ε) : |
| 132 | ∃ u : E → ℝ, ContDiff ℝ ∞ u ∧ LipschitzWith K u ∧ |
| 133 | (∀ x ∈ Metric.ball x₀ R, dist (u x) (f x) ≤ ε) ∧ |
| 134 | (∀ x ∈ Metric.ball x₀ r, ∀ w : E, |
| 135 | fderiv ℝ (fderiv ℝ u) x w w ≤ C * ‖w‖ ^ 2) ∧ |
| 136 | ∀ i x, x ∈ Metric.ball x₀ r → |
| 137 | lo i x ≤ fderiv ℝ u x (v i x) ∧ fderiv ℝ u x (v i x) ≤ hi i x := by |
| 138 | apply exists_contDiff_hessian_directional_approx_of_lipschitzOn_ball hrR hf hconc |
| 139 | v lo hi ?_ hε |
| 140 | intro i x hx y hy t ht hz |
| 141 | exact Analysis.increment_bounds_of_fderiv_upper_support |
| 142 | (convex_ball x₀ R) hf.continuousOn (hsupport i x hx) hy ht hz |
| 143 | |
| 144 | /-- Bounds against varying fields survive smoothing with the explicit field-oscillation loss. -/ |
| 145 | theorem exists_contDiff_hessian_directional_approx_of_field_upper_support |
| 146 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 147 | [FiniteDimensional ℝ E] {ι : Type*} {f : E → ℝ} {K : ℝ≥0} {C L η : ℝ} |
| 148 | {x₀ : E} {r R : ℝ} (hrR : r < R) |
| 149 | (hf : LipschitzOnWith K f (Metric.ball x₀ R)) |
| 150 | (hconc : ConcaveOn ℝ (Metric.ball x₀ R) (fun x => f x - C * ‖x‖ ^ 2 / 2)) |
| 151 | (v : ι → E → E) (B : ι → ℝ) (hL : 0 ≤ L) |
| 152 | (hvariation : ∀ i x, x ∈ Metric.ball x₀ r → ∀ y ∈ Metric.ball x₀ R, |
| 153 | ‖v i x - v i y‖ ≤ η) |
| 154 | (hsupport : ∀ i y, y ∈ Metric.ball x₀ R → |
| 155 | ∃ g : E → ℝ, DifferentiableAt ℝ g y ∧ g y = f y ∧ |
| 156 | (∀ᶠ z in 𝓝 y, f z ≤ g z) ∧ ‖fderiv ℝ g y‖ ≤ L ∧ |
| 157 | |fderiv ℝ g y (v i y)| ≤ B i) |
| 158 | {ε : ℝ} (hε : 0 < ε) : |
| 159 | ∃ u : E → ℝ, ContDiff ℝ ∞ u ∧ LipschitzWith K u ∧ |
| 160 | (∀ x ∈ Metric.ball x₀ R, dist (u x) (f x) ≤ ε) ∧ |
| 161 | (∀ x ∈ Metric.ball x₀ r, ∀ w : E, |
| 162 | fderiv ℝ (fderiv ℝ u) x w w ≤ C * ‖w‖ ^ 2) ∧ |
| 163 | ∀ i x, x ∈ Metric.ball x₀ r → |
| 164 | |fderiv ℝ u x (v i x)| ≤ B i + L * η := by |
| 165 | have hfixed : ∀ i x, x ∈ Metric.ball x₀ r → ∀ y ∈ Metric.ball x₀ R, |
| 166 | ∃ g : E → ℝ, DifferentiableAt ℝ g y ∧ g y = f y ∧ |
| 167 | (∀ᶠ z in 𝓝 y, f z ≤ g z) ∧ |
| 168 | -(B i + L * η) ≤ fderiv ℝ g y (v i x) ∧ |
| 169 | fderiv ℝ g y (v i x) ≤ B i + L * η := by |
| 170 | intro i x hx y hy |
| 171 | obtain ⟨g, hg, heq, hmajor, hnorm, hbound⟩ := hsupport i y hy |
| 172 | refine ⟨g, hg, heq, hmajor, ?_⟩ |
| 173 | apply abs_le.mp |
| 174 | calc |
| 175 | |fderiv ℝ g y (v i x)| = |
| 176 | |fderiv ℝ g y (v i y) + fderiv ℝ g y (v i x - v i y)| := by |
| 177 | congr 1 |
| 178 | rw [map_sub] |
| 179 | ring |
| 180 | _ ≤ |fderiv ℝ g y (v i y)| + |fderiv ℝ g y (v i x - v i y)| := abs_add_le _ _ |
| 181 | _ ≤ B i + L * η := add_le_add hbound (by |
| 182 | rw [← Real.norm_eq_abs] |
| 183 | exact ((fderiv ℝ g y).le_opNorm _).trans |
| 184 | (mul_le_mul hnorm (hvariation i x hx y hy) (norm_nonneg _) hL)) |
| 185 | obtain ⟨u, hu, hLip, herr, hess, hdir⟩ := |
| 186 | exists_contDiff_hessian_directional_approx_of_upper_support hrR hf hconc v |
| 187 | (fun i _ => -(B i + L * η)) (fun i _ => B i + L * η) hfixed hε |
| 188 | exact ⟨u, hu, hLip, herr, hess, fun i x hx => abs_le.mpr (hdir i x hx)⟩ |
| 189 | |
| 190 | end Poincare |
| 191 |