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.MollifierBasics |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Regularity.Semiconcavity.ContactSemiconcavity |
| 3 | import Mathlib.Analysis.Convex.Deriv |
| 4 | |
| 5 | /-! |
| 6 | # Local concavity survives normalized convolution |
| 7 | |
| 8 | Morgan-Tian Claim 7.20, pp. 160-161. Translation by a point of the |
| 9 | kernel support stays in the larger concavity ball. Nonnegative averaging |
| 10 | preserves its chord inequalities, hence the smooth approximations have |
| 11 | nonpositive second directional derivatives on the inner ball. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter Metric MeasureTheory ContinuousLinearMap |
| 17 | open scoped Topology ContDiff Convolution |
| 18 | |
| 19 | namespace PoincareMT.ReducedVolume |
| 20 | |
| 21 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 22 | [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] |
| 23 | {μ : Measure E} [Measure.IsAddHaarMeasure μ] |
| 24 | |
| 25 | omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in |
| 26 | /-- A short translation maps the inner ball into the larger concavity ball. -/ |
| 27 | theorem sub_mem_double_ball {x z x₀ : E} {r : ℝ} |
| 28 | (hx : x ∈ ball x₀ r) (hz : ‖z‖ ≤ r) : x - z ∈ ball x₀ (2 * r) := by |
| 29 | rw [mem_ball_iff_norm] at hx ⊢ |
| 30 | calc |
| 31 | ‖x - z - x₀‖ = ‖(x - x₀) - z‖ := by congr 1; abel |
| 32 | _ ≤ ‖x - x₀‖ + ‖z‖ := norm_sub_le _ _ |
| 33 | _ < r + r := add_lt_add_of_lt_of_le hx hz |
| 34 | _ = 2 * r := by ring |
| 35 | |
| 36 | /-- A kernel supported in the radius margin preserves concavity on the inner ball. -/ |
| 37 | theorem concaveOn_normed_convolution (κ : ContDiffBump (0 : E)) |
| 38 | {f : E → ℝ} (hf : Continuous f) {x₀ : E} {r : ℝ} |
| 39 | (hκ : κ.rOut ≤ r) (hconc : ConcaveOn ℝ (ball x₀ (2 * r)) f) : |
| 40 | ConcaveOn ℝ (ball x₀ r) (κ.normed μ ⋆[lsmul ℝ ℝ, μ] f) := by |
| 41 | have hex := (κ.hasCompactSupport_normed (μ := μ)).convolutionExists_left |
| 42 | (μ := μ) (lsmul ℝ ℝ) |
| 43 | κ.continuous_normed hf.locallyIntegrable |
| 44 | apply integral_concaveOn_of_integrand_ae (convex_ball _ _) _ (fun x _ ↦ hex x) |
| 45 | apply Eventually.of_forall |
| 46 | intro z |
| 47 | change ConcaveOn ℝ (ball x₀ r) (fun x ↦ κ.normed μ z * f (x - z)) |
| 48 | by_cases hz : κ.normed μ z = 0 |
| 49 | · simp only [hz, zero_mul] |
| 50 | exact concaveOn_const _ (convex_ball _ _) |
| 51 | · have hzn : ‖z‖ ≤ r := by |
| 52 | have hmem : z ∈ Function.support (κ.normed μ) := hz |
| 53 | rw [κ.support_normed_eq, mem_ball, dist_zero_right] at hmem |
| 54 | exact hmem.le.trans hκ |
| 55 | refine ⟨convex_ball _ _, ?_⟩ |
| 56 | intro x hx y hy a b ha hb hab |
| 57 | have hsub : (a • x + b • y) - z = a • (x - z) + b • (y - z) := by |
| 58 | have hsum : a • z + b • z = z := by rw [← add_smul, hab, one_smul] |
| 59 | calc |
| 60 | _ = (a • x + b • y) - (a • z + b • z) := by rw [hsum] |
| 61 | _ = _ := by simp only [smul_sub]; abel |
| 62 | dsimp only |
| 63 | rw [hsub] |
| 64 | have hc := hconc.2 (sub_mem_double_ball hx hzn) (sub_mem_double_ball hy hzn) ha hb hab |
| 65 | simp only [smul_eq_mul] at hc ⊢ |
| 66 | nlinarith [mul_le_mul_of_nonneg_left hc (κ.nonneg_normed (μ := μ) z)] |
| 67 | |
| 68 | omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in |
| 69 | /-- A C2 concave function has a nonpositive coordinate Hessian on its open convex domain. -/ |
| 70 | theorem second_fderiv_nonpos_of_concaveOn {f : E → ℝ} {U : Set E} |
| 71 | (hU : IsOpen U) (hf : ContDiffOn ℝ 2 f U) (hconc : ConcaveOn ℝ U f) |
| 72 | {x : E} (hx : x ∈ U) (v : E) : fderiv ℝ (fderiv ℝ f) x v v ≤ 0 := by |
| 73 | let A : ℝ →ᵃ[ℝ] E := |
| 74 | { toFun := fun t ↦ x + t • v |
| 75 | linear := (lsmul ℝ ℝ).flip v |>.toLinearMap |
| 76 | map_vadd' := by intros; simp [add_smul]; abel } |
| 77 | have hA : Continuous A := by change Continuous (fun t : ℝ ↦ x + t • v); fun_prop |
| 78 | have h0 : (0 : ℝ) ∈ A ⁻¹' U := by simpa [A] using hx |
| 79 | have hn : A ⁻¹' U ∈ 𝓝 (0 : ℝ) := (hU.preimage hA).mem_nhds h0 |
| 80 | have hc : ConcaveOn ℝ (A ⁻¹' U) (f ∘ A) := hconc.comp_affineMap A |
| 81 | have hd : ∀ t ∈ A ⁻¹' U, DifferentiableAt ℝ (f ∘ A) t := by |
| 82 | intro t ht |
| 83 | exact ((hf.contDiffAt (hU.mem_nhds ht)).comp t |
| 84 | (show ContDiffAt ℝ 2 A t by |
| 85 | change ContDiffAt ℝ 2 (fun s : ℝ ↦ x + s • v) t |
| 86 | fun_prop)).differentiableAt two_ne_zero |
| 87 | have h := (hc.antitoneOn_deriv hd).derivWithin_nonpos (x := (0 : ℝ)) |
| 88 | rw [derivWithin_of_mem_nhds hn] at h |
| 89 | have hsecond := second_deriv_affine_line (hf.contDiffAt (hU.mem_nhds hx)) v |
| 90 | change deriv (deriv (fun t : ℝ ↦ f (x + t • v))) 0 ≤ 0 at h |
| 91 | rwa [hsecond] at h |
| 92 | |
| 93 | end PoincareMT.ReducedVolume |