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.SpecialFunctions.Integrals.Basic |
| 2 | |
| 3 | /-! |
| 4 | # Exponential cutoffs for the Ricci integral |
| 5 | |
| 6 | The length of the interval and the cutoff scale are independent. These |
| 7 | estimates adapt AxelWorkspace's `Ch09/SolitonGeometry/RicciIntegralCutoff.lean` |
| 8 | at revision `f1cdb30cabdc8781d2d3dec86d3d99ab1820f30e` for the argument in |
| 9 | Morgan--Tian, Claim 9.47, Section 9.4.4, pp. 219--220. See |
| 10 | `references/analysis/axel-workspace/ricci-integral-reuse.md`. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set MeasureTheory intervalIntegral |
| 16 | open scoped ContDiff |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | namespace Poincare.RicciIntegral |
| 21 | |
| 22 | def cutoff (L scale t : ℝ) : ℝ := |
| 23 | (1 - Real.exp (-scale * t)) * (1 - Real.exp (-scale * (L - t))) |
| 24 | |
| 25 | theorem contDiff_cutoff (L scale : ℝ) : ContDiff ℝ ∞ (cutoff L scale) := by |
| 26 | unfold cutoff |
| 27 | fun_prop |
| 28 | |
| 29 | @[simp] theorem cutoff_zero (L scale : ℝ) : cutoff L scale 0 = 0 := by |
| 30 | simp [cutoff] |
| 31 | |
| 32 | @[simp] theorem cutoff_end (L scale : ℝ) : cutoff L scale L = 0 := by |
| 33 | simp [cutoff] |
| 34 | |
| 35 | theorem hasDerivAt_cutoff (L scale t : ℝ) : |
| 36 | HasDerivAt (cutoff L scale) |
| 37 | (scale * (Real.exp (-scale * t) - Real.exp (-scale * (L - t)))) t := by |
| 38 | have hA := ((hasDerivAt_id t).const_mul (-scale)).exp |
| 39 | have hB := (((hasDerivAt_id t).const_sub L).const_mul (-scale)).exp |
| 40 | convert (hA.const_sub 1).mul (hB.const_sub 1) using 1 <;> |
| 41 | first | rfl | (simp only [id_eq]; ring) |
| 42 | |
| 43 | theorem cutoff_mem_Icc {L scale t : ℝ} (hscale : 0 ≤ scale) (ht : t ∈ Icc 0 L) : |
| 44 | cutoff L scale t ∈ Icc 0 1 := by |
| 45 | have hA : Real.exp (-scale * t) ≤ 1 := Real.exp_le_one_iff.mpr (by nlinarith [ht.1]) |
| 46 | have hB : Real.exp (-scale * (L - t)) ≤ 1 := |
| 47 | Real.exp_le_one_iff.mpr (by nlinarith [ht.2]) |
| 48 | have hA0 := (Real.exp_pos (-scale * t)).le |
| 49 | have hB0 := (Real.exp_pos (-scale * (L - t))).le |
| 50 | constructor |
| 51 | · exact mul_nonneg (sub_nonneg.mpr hA) (sub_nonneg.mpr hB) |
| 52 | · exact (mul_le_mul (show 1 - Real.exp (-scale * t) ≤ 1 by linarith) |
| 53 | (show 1 - Real.exp (-scale * (L - t)) ≤ 1 by linarith) |
| 54 | (sub_nonneg.mpr hB) zero_le_one).trans_eq (one_mul 1) |
| 55 | |
| 56 | theorem cutoff_defect_le {L scale t : ℝ} (hscale : 0 ≤ scale) (ht : t ∈ Icc 0 L) : |
| 57 | 1 - cutoff L scale t ^ 2 ≤ |
| 58 | 2 * (Real.exp (-scale * t) + Real.exp (-scale * (L - t))) := by |
| 59 | have hphi := cutoff_mem_Icc hscale ht |
| 60 | have hAB := mul_nonneg (Real.exp_pos (-scale * t)).le |
| 61 | (Real.exp_pos (-scale * (L - t))).le |
| 62 | have hlo : 1 - Real.exp (-scale * t) - Real.exp (-scale * (L - t)) ≤ cutoff L scale t := by |
| 63 | dsimp [cutoff] |
| 64 | nlinarith |
| 65 | nlinarith [sq_nonneg (1 - cutoff L scale t)] |
| 66 | |
| 67 | private theorem integral_exp_neg_mul_le {L scale : ℝ} (hscale : 0 < scale) : |
| 68 | (∫ t : ℝ in 0..L, Real.exp (-scale * t)) ≤ 1 / scale := by |
| 69 | rw [intervalIntegral.integral_comp_mul_left Real.exp (neg_ne_zero.mpr hscale.ne')] |
| 70 | simp only [mul_zero, integral_exp, Real.exp_zero, smul_eq_mul] |
| 71 | have hpos := (Real.exp_pos (-(scale * L))).le |
| 72 | apply (mul_le_mul_iff_of_pos_left hscale).mp |
| 73 | field_simp |
| 74 | nlinarith |
| 75 | |
| 76 | private theorem integral_exp_neg_reflect_le {L scale : ℝ} (hscale : 0 < scale) : |
| 77 | (∫ t : ℝ in 0..L, Real.exp (-scale * (L - t))) ≤ 1 / scale := by |
| 78 | rw [intervalIntegral.integral_comp_sub_left (fun t => Real.exp (-scale * t)) L] |
| 79 | simpa using (integral_exp_neg_mul_le (L := L) hscale) |
| 80 | |
| 81 | theorem integral_cutoff_defect_le {L scale : ℝ} (hL : 0 ≤ L) (hscale : 0 < scale) : |
| 82 | (∫ t : ℝ in 0..L, 1 - cutoff L scale t ^ 2) ≤ 4 / scale := by |
| 83 | have hA : Continuous (fun t : ℝ => Real.exp (-scale * t)) := by fun_prop |
| 84 | have hB : Continuous (fun t : ℝ => Real.exp (-scale * (L - t))) := by fun_prop |
| 85 | have hc := (contDiff_cutoff L scale).continuous |
| 86 | calc |
| 87 | (∫ t : ℝ in 0..L, 1 - cutoff L scale t ^ 2) ≤ |
| 88 | ∫ t : ℝ in 0..L, 2 * (Real.exp (-scale * t) + Real.exp (-scale * (L - t))) := |
| 89 | intervalIntegral.integral_mono_on hL |
| 90 | ((continuous_const.sub (hc.pow 2)).intervalIntegrable 0 L) |
| 91 | (((hA.add hB).const_mul 2).intervalIntegrable 0 L) |
| 92 | (fun t ht => cutoff_defect_le hscale.le ht) |
| 93 | _ = 2 * ((∫ t : ℝ in 0..L, Real.exp (-scale * t)) + |
| 94 | ∫ t : ℝ in 0..L, Real.exp (-scale * (L - t))) := by |
| 95 | rw [intervalIntegral.integral_const_mul, |
| 96 | intervalIntegral.integral_add (hA.intervalIntegrable 0 L) (hB.intervalIntegrable 0 L)] |
| 97 | _ ≤ 2 * (1 / scale + 1 / scale) := |
| 98 | mul_le_mul_of_nonneg_left |
| 99 | (add_le_add (integral_exp_neg_mul_le hscale) (integral_exp_neg_reflect_le hscale)) |
| 100 | (by norm_num) |
| 101 | _ = 4 / scale := by ring |
| 102 | |
| 103 | theorem deriv_cutoff_sq_le (L scale t : ℝ) : |
| 104 | deriv (cutoff L scale) t ^ 2 ≤ |
| 105 | 2 * scale ^ 2 * (Real.exp (-(2 * scale) * t) + Real.exp (-(2 * scale) * (L - t))) := by |
| 106 | rw [(hasDerivAt_cutoff L scale t).deriv] |
| 107 | have hA : Real.exp (-(2 * scale) * t) = Real.exp (-scale * t) ^ 2 := by |
| 108 | rw [pow_two, ← Real.exp_add] |
| 109 | congr 1 |
| 110 | ring |
| 111 | have hB : Real.exp (-(2 * scale) * (L - t)) = Real.exp (-scale * (L - t)) ^ 2 := by |
| 112 | rw [pow_two, ← Real.exp_add] |
| 113 | congr 1 |
| 114 | ring |
| 115 | rw [hA, hB] |
| 116 | nlinarith [sq_nonneg (scale * (Real.exp (-scale * t) + Real.exp (-scale * (L - t))))] |
| 117 | |
| 118 | theorem integral_deriv_cutoff_sq_le {L scale : ℝ} (hL : 0 ≤ L) (hscale : 0 < scale) : |
| 119 | (∫ t : ℝ in 0..L, deriv (cutoff L scale) t ^ 2) ≤ 2 * scale := by |
| 120 | have hA : Continuous (fun t : ℝ => Real.exp (-(2 * scale) * t)) := by fun_prop |
| 121 | have hB : Continuous (fun t : ℝ => Real.exp (-(2 * scale) * (L - t))) := by fun_prop |
| 122 | have hd := (contDiff_cutoff L scale).continuous_deriv (by simp) |
| 123 | have h2scale : 0 < 2 * scale := by positivity |
| 124 | calc |
| 125 | (∫ t : ℝ in 0..L, deriv (cutoff L scale) t ^ 2) ≤ |
| 126 | ∫ t : ℝ in 0..L, |
| 127 | 2 * scale ^ 2 * (Real.exp (-(2 * scale) * t) + Real.exp (-(2 * scale) * (L - t))) := |
| 128 | intervalIntegral.integral_mono_on hL ((hd.pow 2).intervalIntegrable 0 L) |
| 129 | (((hA.add hB).const_mul (2 * scale ^ 2)).intervalIntegrable 0 L) |
| 130 | (fun t _ => deriv_cutoff_sq_le L scale t) |
| 131 | _ = 2 * scale ^ 2 * ((∫ t : ℝ in 0..L, Real.exp (-(2 * scale) * t)) + |
| 132 | ∫ t : ℝ in 0..L, Real.exp (-(2 * scale) * (L - t))) := by |
| 133 | rw [intervalIntegral.integral_const_mul, |
| 134 | intervalIntegral.integral_add (hA.intervalIntegrable 0 L) (hB.intervalIntegrable 0 L)] |
| 135 | _ ≤ 2 * scale ^ 2 * (1 / (2 * scale) + 1 / (2 * scale)) := |
| 136 | mul_le_mul_of_nonneg_left |
| 137 | (add_le_add (integral_exp_neg_mul_le h2scale) (integral_exp_neg_reflect_le h2scale)) |
| 138 | (by positivity) |
| 139 | _ = 2 * scale := by field_simp; ring |
| 140 | |
| 141 | end Poincare.RicciIntegral |