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 Mathlib.Analysis.Convex.Continuous |
| 2 | import Mathlib.Analysis.Normed.Module.FiniteDimension |
| 3 | import Mathlib.Topology.MetricSpace.Lipschitz |
| 4 | |
| 5 | /-! |
| 6 | # A global Lipschitz representative of a local concave function |
| 7 | |
| 8 | Continuity bounds the concave function on a compact intermediate ball. |
| 9 | The interior concavity estimate gives a Lipschitz constant and the |
| 10 | real-valued extension theorem preserves the function on the inner ball. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Metric |
| 16 | open scoped NNReal |
| 17 | |
| 18 | namespace PoincareMT.ReducedVolume |
| 19 | |
| 20 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] |
| 21 | |
| 22 | /-- A continuous concave function on a larger ball has a global Lipschitz local representative. -/ |
| 23 | theorem exists_lipschitz_extension_of_concave {f : E → ℝ} {x : E} {r : ℝ} |
| 24 | (hr : 0 < r) (hf : ContinuousOn f (ball x (4 * r))) |
| 25 | (hconc : ConcaveOn ℝ (ball x (4 * r)) f) : |
| 26 | ∃ (L : ℝ≥0) (g : E → ℝ), LipschitzWith L g ∧ EqOn f g (ball x (2 * r)) := by |
| 27 | have hsub : closedBall x (3 * r) ⊆ ball x (4 * r) := |
| 28 | closedBall_subset_ball (by linarith) |
| 29 | obtain ⟨A, hA⟩ := (isCompact_closedBall x (3 * r)).bddAbove_image |
| 30 | ((hf.mono hsub).abs) |
| 31 | have hbound (y : E) (hy : dist y x < 3 * r) : |f y| ≤ A := |
| 32 | hA ⟨y, mem_closedBall.mpr hy.le, rfl⟩ |
| 33 | have hconc' : ConcaveOn ℝ (ball x (3 * r)) f := |
| 34 | hconc.subset (ball_subset_ball (by linarith)) (convex_ball _ _) |
| 35 | have hLip := hconc'.lipschitzOnWith_of_abs_le hr hbound |
| 36 | rw [show 3 * r - r = 2 * r by ring] at hLip |
| 37 | obtain ⟨g, hg, heq⟩ := hLip.extend_real |
| 38 | exact ⟨_, g, hg, heq⟩ |
| 39 | |
| 40 | end PoincareMT.ReducedVolume |