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.CurveShortening.Comparison.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Smoothing.Local.Approximation |
| 3 | import PoincareLib.Geometry.Riemannian.LoopSpace.Width |
| 4 | import Mathlib.Analysis.Distribution.SchwartzSpace.Basic |
| 5 | import Mathlib.Analysis.Calculus.BumpFunction.InnerProduct |
| 6 | |
| 7 | /-! |
| 8 | # Schwartz approximation of a C1 test and its actual derivative |
| 9 | |
| 10 | A cutoff retains the test near the compact set. A single normalized |
| 11 | convolution approximates both its values and its derivative, and a final |
| 12 | cutoff gives a Schwartz function with the same approximation there. |
| 13 | Source: M40 normalized smoothing; M60 C1 smoothing for MT Lemma 18.10; |
| 14 | M64 boundary semicircle assembly derivation. |
| 15 | |
| 16 | Context: Morgan--Tian Lemma 19.15, printed pp. 447-449; this analytic helper supports |
| 17 | the actual annular minimizer and boundary regularity construction. |
| 18 | -/ |
| 19 | |
| 20 | noncomputable section |
| 21 | set_option autoImplicit false |
| 22 | set_option warningAsError true |
| 23 | |
| 24 | open Set Filter MeasureTheory Metric ContinuousLinearMap |
| 25 | open scoped Topology ContDiff SchwartzMap Convolution |
| 26 | |
| 27 | namespace PoincareMT |
| 28 | |
| 29 | /-- Every C1 scalar test has a Schwartz approximation of its full first jet on a prescribed |
| 30 | compact set. Source: derivations/2026-09-26-boundary-semicircle-assembly.md, C1 Green tests. -/ |
| 31 | theorem m64C1_schwartz_approximation {K : Set LoopPlane} (hK : IsCompact K) |
| 32 | {f : LoopPlane → ℝ} (hf : ContDiff ℝ 1 f) {epsilon : ℝ} (hepsilon : 0 < epsilon) : |
| 33 | ∃ g : 𝓢(LoopPlane, ℝ), ∀ x ∈ K, |
| 34 | dist (g x) (f x) < epsilon ∧ dist (fderiv ℝ g x) (fderiv ℝ f x) < epsilon := by |
| 35 | obtain ⟨R, hR, hKR⟩ := hK.isBounded.subset_ball_lt 0 (0 : LoopPlane) |
| 36 | let chi : ContDiffBump (0 : LoopPlane) := ⟨R, R + 1, hR, by linarith⟩ |
| 37 | let F := fun x => chi x * f x |
| 38 | have hF : ContDiff ℝ 1 F := chi.contDiff.mul hf |
| 39 | have hFc : HasCompactSupport F := chi.hasCompactSupport.mul_right |
| 40 | have hnear (x : LoopPlane) (hx : x ∈ K) : F =ᶠ[𝓝 x] f := by |
| 41 | filter_upwards [chi.eventuallyEq_one_of_mem_ball (hKR hx)] with y hy |
| 42 | simp only [F, hy, Pi.one_apply, one_mul] |
| 43 | obtain ⟨r0, hr0, h0⟩ := M40.exists_radius_normalizedConvolution_dist_lt_uniform |
| 44 | (μ := volume) (hFc.uniformContinuous_of_continuous hF.continuous) hepsilon |
| 45 | obtain ⟨r1, hr1, h1⟩ := M40.exists_radius_normalizedConvolution_dist_lt_uniform |
| 46 | (μ := volume) ((hFc.fderiv ℝ).uniformContinuous_of_continuous |
| 47 | (hF.continuous_fderiv one_ne_zero)) hepsilon |
| 48 | let r := min r0 r1 / 2 |
| 49 | have hr : 0 < r := half_pos (lt_min hr0 hr1) |
| 50 | let phi : ContDiffBump (0 : LoopPlane) := ⟨r / 2, r, half_pos hr, half_lt_self hr⟩ |
| 51 | let G := M40.normalizedConvolution volume phi F |
| 52 | have hG : ContDiff ℝ ∞ G := |
| 53 | M40.normalizedConvolution_contDiff phi hF.continuous.locallyIntegrable |
| 54 | have hDG (x : LoopPlane) : fderiv ℝ G x = |
| 55 | M40.normalizedConvolution volume phi (fderiv ℝ F) x := |
| 56 | (hFc.hasFDerivAt_convolution_right (μ := volume) (lsmul ℝ ℝ) |
| 57 | ((phi.continuous_normed (μ := volume)).locallyIntegrable) hF x).fderiv |
| 58 | let g : 𝓢(LoopPlane, ℝ) := chi.hasCompactSupport.mul_right.toSchwartzMap |
| 59 | (chi.contDiff.mul hG) |
| 60 | refine ⟨g, ?_⟩ |
| 61 | intro x hx |
| 62 | have hgnear : (g : LoopPlane → ℝ) =ᶠ[𝓝 x] G := by |
| 63 | filter_upwards [chi.eventuallyEq_one_of_mem_ball (hKR hx)] with y hy |
| 64 | change chi y * G y = G y |
| 65 | rw [hy, Pi.one_apply, one_mul] |
| 66 | rw [hgnear.self_of_nhds, hgnear.fderiv_eq, ← (hnear x hx).self_of_nhds, |
| 67 | ← (hnear x hx).fderiv_eq, hDG] |
| 68 | exact ⟨h0 phi ((half_lt_self (lt_min hr0 hr1)).le.trans (min_le_left _ _)) x, |
| 69 | h1 phi ((half_lt_self (lt_min hr0 hr1)).le.trans (min_le_right _ _)) x⟩ |
| 70 | |
| 71 | end PoincareMT |