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.Calculus.MeanValue |
| 2 | import Mathlib.Analysis.Normed.Module.Convex |
| 3 | |
| 4 | /-! |
| 5 | # Quadratic remainder on a convex set |
| 6 | |
| 7 | The local action comparison for Morgan-Tian Corollary 6.79, |
| 8 | pp. 144-145, uses a quadratic remainder bound for the metric and |
| 9 | potential coefficients. Derivatives are only required within the |
| 10 | convex coordinate region. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped NNReal |
| 17 | |
| 18 | namespace PoincareMT.M14 |
| 19 | |
| 20 | variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 21 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 22 | |
| 23 | /-- A Lipschitz derivative gives a quadratic Taylor remainder on a |
| 24 | convex set, the coefficient estimate in the local action comparison |
| 25 | for Corollary 6.79, pp. 144-145. -/ |
| 26 | theorem norm_sub_sub_linear_le_sq {S : Set E} {f : E → F} |
| 27 | {f' : E → E →L[ℝ] F} {K : ℝ≥0} (hS : Convex ℝ S) |
| 28 | (hf : ∀ z ∈ S, HasFDerivWithinAt f (f' z) S z) |
| 29 | (hLip : LipschitzOnWith K f' S) {x y : E} (hx : x ∈ S) (hy : y ∈ S) : |
| 30 | ‖f y - f x - f' x (y - x)‖ ≤ (K : ℝ) * ‖y - x‖ ^ 2 := by |
| 31 | have hseg : segment ℝ x y ⊆ S := hS.segment_subset hx hy |
| 32 | have hder : ∀ z ∈ segment ℝ x y, |
| 33 | HasFDerivWithinAt (fun z => f z - f' x z) (f' z - f' x) |
| 34 | (segment ℝ x y) z := by |
| 35 | intro z hz |
| 36 | exact ((hf z (hseg hz)).mono hseg).sub (f' x).hasFDerivAt.hasFDerivWithinAt |
| 37 | have hbound : ∀ z ∈ segment ℝ x y, |
| 38 | ‖f' z - f' x‖ ≤ (K : ℝ) * ‖y - x‖ := by |
| 39 | intro z hz |
| 40 | exact (hLip.norm_sub_le (hseg hz) hx).trans |
| 41 | (mul_le_mul_of_nonneg_left (norm_sub_le_of_mem_segment hz) K.coe_nonneg) |
| 42 | have h := (convex_segment x y).norm_image_sub_le_of_norm_hasFDerivWithin_le |
| 43 | hder hbound (left_mem_segment ℝ x y) (right_mem_segment ℝ x y) |
| 44 | simpa only [map_sub, sub_sub_sub_comm, mul_assoc, ← pow_two] using h |
| 45 | |
| 46 | end PoincareMT.M14 |