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.ReducedLength.Action.EnergyBound |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Comp |
| 3 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic |
| 4 | |
| 5 | /-! |
| 6 | # Closed-interval estimates for nonnegative scalar energy |
| 7 | |
| 8 | These scalar estimates retain within derivatives at both endpoints. |
| 9 | Affine reparametrization compares any two energies, including zero |
| 10 | velocity, and integration bounds every energy by the action. This is |
| 11 | the form of Morgan-Tian Lemma 6.60, pp. 135-136, needed for generalized |
| 12 | spacetimes with physical time endpoints. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Topology intervalIntegral |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | /-- A closed-interval differential inequality compares energy plus one |
| 23 | at any two parameters. No open derivative at an endpoint is used; |
| 24 | Lemma 6.60, pp. 135-136. -/ |
| 25 | theorem nonnegativeEnergy_pair_bound_within (e e' : ℝ → ℝ) {H A : ℝ} |
| 26 | (hA : 0 ≤ A) (hc : ContinuousOn e (Icc 0 H)) |
| 27 | (he : ∀ s ∈ Icc 0 H, 0 ≤ e s) |
| 28 | (hd : ∀ s ∈ Icc 0 H, HasDerivWithinAt e (e' s) (Icc 0 H) s) |
| 29 | (hbound : ∀ s ∈ Icc 0 H, |e' s| ≤ A * (e s + 1)) |
| 30 | {r t : ℝ} (hr : r ∈ Icc 0 H) (ht : t ∈ Icc 0 H) : |
| 31 | e r + 1 ≤ (e t + 1) * Real.exp (A * H) := by |
| 32 | let c : ℝ → ℝ := fun s => t + s * (r - t) |
| 33 | have hmap : MapsTo c (Icc 0 1) (Icc 0 H) := by |
| 34 | intro s hs |
| 35 | dsimp [c] |
| 36 | constructor |
| 37 | · nlinarith [mul_nonneg hs.1 hr.1, mul_nonneg (sub_nonneg.mpr hs.2) ht.1] |
| 38 | · nlinarith [mul_nonneg hs.1 (sub_nonneg.mpr hr.2), |
| 39 | mul_nonneg (sub_nonneg.mpr hs.2) (sub_nonneg.mpr ht.2)] |
| 40 | have hcn : ∀ s ∈ Icc 0 1, 0 ≤ e (c s) + 1 := |
| 41 | fun s hs => by linarith [he (c s) (hmap hs)] |
| 42 | have hrt : |r - t| ≤ H := abs_le.mpr ⟨by linarith [hr.1, ht.2], |
| 43 | by linarith [hr.2, ht.1]⟩ |
| 44 | have hcd (s : ℝ) : HasDerivAt c (r - t) s := by |
| 45 | simpa only [c, id_eq, one_mul] using ((hasDerivAt_id s).mul_const (r - t)).const_add t |
| 46 | have hf : ContinuousOn (fun s => e (c s) + 1) (Icc 0 1) := |
| 47 | (hc.comp (continuous_const.add |
| 48 | (continuous_id.mul continuous_const)).continuousOn hmap).add_const 1 |
| 49 | have hdf : ∀ s ∈ Ico 0 1, |
| 50 | HasDerivWithinAt (fun s => e (c s) + 1) (e' (c s) * (r - t)) (Ici s) s := by |
| 51 | intro s hs |
| 52 | have h := ((hd (c s) (hmap ⟨hs.1, hs.2.le⟩)).comp s |
| 53 | (hcd s).hasDerivWithinAt hmap).add_const 1 |
| 54 | exact h.mono_of_mem_nhdsWithin (Icc_mem_nhdsGE_of_mem hs) |
| 55 | have hbf : ∀ s ∈ Ico 0 1, |
| 56 | ‖e' (c s) * (r - t)‖ ≤ A * H * ‖e (c s) + 1‖ + 0 := by |
| 57 | intro s hs |
| 58 | have hn := hcn s ⟨hs.1, hs.2.le⟩ |
| 59 | rw [Real.norm_eq_abs, abs_mul, Real.norm_eq_abs, abs_of_nonneg hn, add_zero] |
| 60 | calc |
| 61 | _ ≤ (A * (e (c s) + 1)) * H := |
| 62 | mul_le_mul (hbound (c s) (hmap ⟨hs.1, hs.2.le⟩)) hrt |
| 63 | (abs_nonneg _) (mul_nonneg hA hn) |
| 64 | _ = _ := by ring |
| 65 | have hg := norm_le_gronwallBound_of_norm_deriv_right_le hf hdf |
| 66 | (δ := e t + 1) (K := A * H) (ε := 0) |
| 67 | (by simpa only [c, zero_mul, add_zero, Real.norm_eq_abs, |
| 68 | abs_of_nonneg (show 0 ≤ e t + 1 by linarith [he t ht])] |
| 69 | using le_refl (e t + 1)) hbf 1 |
| 70 | (show (1 : ℝ) ∈ Icc 0 1 by constructor <;> norm_num) |
| 71 | have hc1 : c 1 = r := by dsimp [c]; ring |
| 72 | simpa only [hc1, Real.norm_eq_abs, |
| 73 | abs_of_nonneg (show 0 ≤ e r + 1 by linarith [he r hr]), gronwallBound_ε0, |
| 74 | sub_zero, mul_one] using hg |
| 75 | |
| 76 | /-- Integrating the two-point estimate controls any closed-interval |
| 77 | energy by its integral, Lemma 6.60, pp. 135-136. -/ |
| 78 | theorem nonnegativeEnergy_integral_bound_within (e e' : ℝ → ℝ) {H A : ℝ} |
| 79 | (hH : 0 ≤ H) (hA : 0 ≤ A) (hc : ContinuousOn e (Icc 0 H)) |
| 80 | (he : ∀ s ∈ Icc 0 H, 0 ≤ e s) |
| 81 | (hd : ∀ s ∈ Icc 0 H, HasDerivWithinAt e (e' s) (Icc 0 H) s) |
| 82 | (hbound : ∀ s ∈ Icc 0 H, |e' s| ≤ A * (e s + 1)) |
| 83 | {r : ℝ} (hr : r ∈ Icc 0 H) : |
| 84 | H * (e r + 1) ≤ Real.exp (A * H) * (∫ s in (0 : ℝ)..H, e s + 1) := by |
| 85 | have hi : IntervalIntegrable (fun s => e s + 1) MeasureTheory.volume 0 H := by |
| 86 | apply ContinuousOn.intervalIntegrable |
| 87 | simpa only [uIcc_of_le hH] using hc.add_const 1 |
| 88 | have hm := intervalIntegral.integral_mono_on hH intervalIntegrable_const |
| 89 | (hi.const_mul (Real.exp (A * H))) (fun t ht => by |
| 90 | simpa only [mul_comm] using |
| 91 | nonnegativeEnergy_pair_bound_within e e' hA hc he hd hbound hr ht) |
| 92 | simpa only [intervalIntegral.integral_const, sub_zero, smul_eq_mul, |
| 93 | intervalIntegral.integral_const_mul] using hm |
| 94 | |
| 95 | /-- A scalar-curvature lower bound turns the closed-interval energy |
| 96 | estimate into an action bound for every square velocity. This is the |
| 97 | coercive estimate behind Proposition 6.59, pp. 134-137. -/ |
| 98 | theorem nonnegativeEnergy_action_bound_within (e e' R : ℝ → ℝ) {H A C : ℝ} |
| 99 | (hH : 0 ≤ H) (hA : 0 ≤ A) (hC : 0 ≤ C) |
| 100 | (hc : ContinuousOn e (Icc 0 H)) (he : ∀ s ∈ Icc 0 H, 0 ≤ e s) |
| 101 | (hd : ∀ s ∈ Icc 0 H, HasDerivWithinAt e (e' s) (Icc 0 H) s) |
| 102 | (hbound : ∀ s ∈ Icc 0 H, |e' s| ≤ A * (e s + 1)) |
| 103 | (hRc : ContinuousOn R (Icc 0 H)) (hR : ∀ s ∈ Icc 0 H, -C ≤ R s) |
| 104 | {r : ℝ} (hr : r ∈ Icc 0 H) : |
| 105 | H * (e r + 1) ≤ Real.exp (A * H) * |
| 106 | (2 * (∫ s in (0 : ℝ)..H, 2 * s ^ 2 * R s + (1 / 2 : ℝ) * e s) + |
| 107 | 4 * C * H ^ 3 + H) := by |
| 108 | let L : ℝ → ℝ := fun s => 2 * s ^ 2 * R s + (1 / 2 : ℝ) * e s |
| 109 | have hi : IntervalIntegrable e MeasureTheory.volume 0 H := by |
| 110 | apply ContinuousOn.intervalIntegrable |
| 111 | simpa only [uIcc_of_le hH] using hc |
| 112 | have hLi : IntervalIntegrable L MeasureTheory.volume 0 H := by |
| 113 | apply ContinuousOn.intervalIntegrable |
| 114 | rw [uIcc_of_le hH] |
| 115 | exact ((continuousOn_const.mul (continuousOn_id.pow 2)).mul hRc).add |
| 116 | (continuousOn_const.mul hc) |
| 117 | have hpoint : ∀ s ∈ Icc 0 H, e s ≤ 2 * L s + 4 * C * H ^ 2 := by |
| 118 | intro s hs |
| 119 | have hs2 : s ^ 2 ≤ H ^ 2 := by nlinarith [hs.1, hs.2] |
| 120 | have h1 := mul_le_mul_of_nonneg_left (hR s hs) (sq_nonneg s) |
| 121 | have h2 := mul_le_mul_of_nonneg_left hs2 hC |
| 122 | dsimp [L] |
| 123 | nlinarith |
| 124 | have henergy := intervalIntegral.integral_mono_on hH hi |
| 125 | ((hLi.const_mul 2).add intervalIntegrable_const) hpoint |
| 126 | rw [intervalIntegral.integral_add (hLi.const_mul 2) intervalIntegrable_const, |
| 127 | intervalIntegral.integral_const_mul, intervalIntegral.integral_const] at henergy |
| 128 | simp only [sub_zero, smul_eq_mul] at henergy |
| 129 | have hreverse := nonnegativeEnergy_integral_bound_within e e' hH hA hc he hd hbound hr |
| 130 | rw [intervalIntegral.integral_add hi intervalIntegrable_const, |
| 131 | intervalIntegral.integral_const] at hreverse |
| 132 | simp only [sub_zero, smul_eq_mul, mul_one] at hreverse |
| 133 | apply hreverse.trans |
| 134 | apply mul_le_mul_of_nonneg_left _ (Real.exp_nonneg _) |
| 135 | dsimp [L] at henergy |
| 136 | nlinarith |
| 137 | |
| 138 | end PoincareMT.M14 |