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.Surgery.StandardCap.Uniqueness.Imports |
| 2 | import Mathlib.Analysis.Calculus.Deriv.MeanValue |
| 3 | import Mathlib.Tactic |
| 4 | |
| 5 | /-! |
| 6 | # Concave radius bounds from an eventual scalar floor |
| 7 | |
| 8 | Morgan-Tian Proposition 12.31, pp. 325-326, direct rotational argument. |
| 9 | For an actual arclength warped-product radius, nonnegative radial sectional |
| 10 | curvature gives concavity and completeness supplies the unbounded domain. |
| 11 | The scalar-curvature formula then bounds the radius by any eventual |
| 12 | positive scalar floor. The lemmas here prove only the real-variable step; |
| 13 | the actual radial coordinate and curvature identities must be supplied by |
| 14 | the geometric reduction, not postulated as a new contract. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set Filter |
| 20 | |
| 21 | namespace PoincareMT.M35 |
| 22 | |
| 23 | private theorem false_of_nonneg_of_uniform_negative_deriv |
| 24 | {f f₁ : ℝ → ℝ} {a C : ℝ} (hC : C < 0) |
| 25 | (hpos : ∀ s, a ≤ s → 0 ≤ f s) |
| 26 | (hderiv : ∀ s, a ≤ s → HasDerivAt f (f₁ s) s) |
| 27 | (hbound : ∀ s, a ≤ s → f₁ s ≤ C) : False := by |
| 28 | let b := a + (f a + 1) / (-C) |
| 29 | have hab : a ≤ b := le_add_of_nonneg_right |
| 30 | (div_nonneg (by linarith [hpos a le_rfl]) (neg_pos.mpr hC).le) |
| 31 | have hgrow := (convex_Ici a).image_sub_le_mul_sub_of_deriv_le |
| 32 | (fun s hs => (hderiv s hs).continuousAt.continuousWithinAt) |
| 33 | (fun s hs => (hderiv s (interior_subset hs)).differentiableAt.differentiableWithinAt) |
| 34 | (fun s hs => by |
| 35 | rw [(hderiv s (interior_subset hs)).deriv] |
| 36 | exact hbound s (interior_subset hs)) a (by simp) b hab hab |
| 37 | have heq : C * (b - a) = -(f a + 1) := by |
| 38 | dsimp only [b] |
| 39 | field_simp [ne_of_lt hC] |
| 40 | ring |
| 41 | rw [heq] at hgrow |
| 42 | linarith [hpos b hab] |
| 43 | |
| 44 | /-- A positive concave radius on the entire positive ray is nondecreasing: |
| 45 | a negative first derivative would make the radius eventually negative. -/ |
| 46 | theorem radial_derivative_nonneg_of_positive_concave |
| 47 | {f f₁ f₂ : ℝ → ℝ} |
| 48 | (hpos : ∀ s, 0 < s → 0 < f s) |
| 49 | (hderiv : ∀ s, 0 < s → HasDerivAt f (f₁ s) s) |
| 50 | (hderiv₂ : ∀ s, 0 < s → HasDerivAt f₁ (f₂ s) s) |
| 51 | (hconcave : ∀ s, 0 < s → f₂ s ≤ 0) |
| 52 | {s : ℝ} (hs : 0 < s) : 0 ≤ f₁ s := by |
| 53 | have hanti : AntitoneOn f₁ (Ioi 0) := |
| 54 | antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ioi 0) |
| 55 | (fun r hr => (hderiv₂ r hr).continuousAt.continuousWithinAt) |
| 56 | (fun r hr => (hderiv₂ r (interior_subset hr)).hasDerivWithinAt) |
| 57 | (fun r hr => hconcave r (interior_subset hr)) |
| 58 | by_contra hneg |
| 59 | exact false_of_nonneg_of_uniform_negative_deriv (lt_of_not_ge hneg) |
| 60 | (fun r hr => (hpos r (hs.trans_le hr)).le) |
| 61 | (fun r hr => hderiv r (hs.trans_le hr)) |
| 62 | (fun r hr => hanti hs (hs.trans_le hr) hr) |
| 63 | |
| 64 | /-- A positive concave three-dimensional warped-product radius obeys |
| 65 | `f² ≤ 2/c` if its scalar expression is eventually at least `c > 0`. |
| 66 | No convergence of the radius or of its derivatives is assumed. -/ |
| 67 | theorem radial_radius_sq_le_of_eventual_scalar_floor |
| 68 | {f f₁ f₂ : ℝ → ℝ} |
| 69 | (hpos : ∀ s, 0 < s → 0 < f s) |
| 70 | (hderiv : ∀ s, 0 < s → HasDerivAt f (f₁ s) s) |
| 71 | (hderiv₂ : ∀ s, 0 < s → HasDerivAt f₁ (f₂ s) s) |
| 72 | (hconcave : ∀ s, 0 < s → f₂ s ≤ 0) |
| 73 | {c : ℝ} (hc : 0 < c) |
| 74 | (hfloor : ∀ᶠ s in atTop, |
| 75 | c ≤ 2 * (1 - (f₁ s) ^ 2) / (f s) ^ 2 - 4 * f₂ s / f s) |
| 76 | {s : ℝ} (hs : 0 < s) : (f s) ^ 2 ≤ 2 / c := by |
| 77 | have hnonneg (r : ℝ) (hr : 0 < r) : 0 ≤ f₁ r := |
| 78 | radial_derivative_nonneg_of_positive_concave hpos hderiv hderiv₂ hconcave hr |
| 79 | have hmono : MonotoneOn f (Ioi 0) := |
| 80 | monotoneOn_of_hasDerivWithinAt_nonneg (convex_Ioi 0) |
| 81 | (fun r hr => (hderiv r hr).continuousAt.continuousWithinAt) |
| 82 | (fun r hr => (hderiv r (interior_subset hr)).hasDerivWithinAt) |
| 83 | (fun r hr => hnonneg r (interior_subset hr)) |
| 84 | by_contra hbad |
| 85 | have hlarge : 2 < c * (f s) ^ 2 := by |
| 86 | have h := (div_lt_iff₀ hc).mp (lt_of_not_ge hbad) |
| 87 | nlinarith |
| 88 | let C := (2 / f s - c * f s) / 4 |
| 89 | have hC : C < 0 := by |
| 90 | apply div_neg_of_neg_of_pos _ (by norm_num : (0 : ℝ) < 4) |
| 91 | apply sub_neg.mpr |
| 92 | apply (div_lt_iff₀ (hpos s hs)).mpr |
| 93 | nlinarith |
| 94 | obtain ⟨a, ha⟩ := eventually_atTop.mp hfloor |
| 95 | let b := max a s |
| 96 | have hsb : s ≤ b := le_max_right _ _ |
| 97 | have hab : a ≤ b := le_max_left _ _ |
| 98 | apply false_of_nonneg_of_uniform_negative_deriv (f := f₁) (f₁ := f₂) hC |
| 99 | (fun r hr => hnonneg r (hs.trans_le (hsb.trans hr))) |
| 100 | (fun r hr => hderiv₂ r (hs.trans_le (hsb.trans hr))) |
| 101 | intro r hr |
| 102 | have hsr : s ≤ r := hsb.trans hr |
| 103 | have hrpos : 0 < f r := hpos r (hs.trans_le hsr) |
| 104 | have hfr : f s ≤ f r := hmono hs (hs.trans_le hsr) hsr |
| 105 | have hscaled := mul_le_mul_of_nonneg_right (ha r (hab.trans hr)) (sq_nonneg (f r)) |
| 106 | have heq : |
| 107 | (2 * (1 - (f₁ r) ^ 2) / (f r) ^ 2 - 4 * f₂ r / f r) * (f r) ^ 2 = |
| 108 | 2 * (1 - (f₁ r) ^ 2) - 4 * f₂ r * f r := by |
| 109 | field_simp [hrpos.ne'] |
| 110 | rw [heq] at hscaled |
| 111 | have hsecond : 4 * f₂ r ≤ 2 / f r - c * f r := by |
| 112 | apply le_of_mul_le_mul_right (a := f r) _ hrpos |
| 113 | have hcancel : 2 / f r * f r = 2 := div_mul_cancel₀ _ hrpos.ne' |
| 114 | nlinarith [sq_nonneg (f₁ r)] |
| 115 | have hinv : 2 / f r ≤ 2 / f s := |
| 116 | div_le_div_of_nonneg_left (by norm_num) (hpos s hs) hfr |
| 117 | have hmul : c * f s ≤ c * f r := mul_le_mul_of_nonneg_left hfr hc.le |
| 118 | dsimp only [C] |
| 119 | linarith |
| 120 | |
| 121 | end PoincareMT.M35 |