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 | /- |
| 2 | Adapted from AxelWorkspace, released under Apache 2.0, at revision |
| 3 | f1cdb30cabdc8781d2d3dec86d3d99ab1820f30e: |
| 4 | formalized-sources/riemannian/MorganTian/MorganTianLib/Ch01/JacobiODE.lean. |
| 5 | Original SHA-256: 463653fb522e8a6caabd02884fec13d95bd09e60fb9e846c8ecd7da98e767818 |
| 6 | Changes: retain the solution predicate and quantitative estimates, use the |
| 7 | Poincare linear-ODE foundation, and organize the declarations by subject. |
| 8 | -/ |
| 9 | import PoincareLib.Analysis.ODE.Linear |
| 10 | import Mathlib.Analysis.Normed.Operator.Prod |
| 11 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus |
| 12 | import Mathlib.Analysis.SpecialFunctions.Integrals.Basic |
| 13 | |
| 14 | /-! |
| 15 | # Quantitative Jacobi ODE estimates |
| 16 | |
| 17 | A solution of `y' = v`, `v' = -R y` on a closed interval has an exponential |
| 18 | bound in the product norm. With zero initial position, successive integrations |
| 19 | give linear position growth, a quadratic velocity remainder, and a cubic |
| 20 | position remainder with coefficient `1 / 6`. |
| 21 | |
| 22 | This auxiliary estimate supports Morgan--Tian, Lemma 5.7, pp. 109--110, and |
| 23 | Section 3.4, p. 45 in arXiv:math/0607607v2. |
| 24 | -/ |
| 25 | |
| 26 | open Set intervalIntegral |
| 27 | open scoped Topology Interval |
| 28 | |
| 29 | noncomputable section |
| 30 | set_option autoImplicit false |
| 31 | |
| 32 | namespace Poincare.ODE.Jacobi |
| 33 | |
| 34 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 35 | |
| 36 | /-- The companion coefficient for the Jacobi equation on the product space. -/ |
| 37 | def pairCoeff (R : ℝ → E →L[ℝ] E) (t : ℝ) : (E × E) →L[ℝ] E × E := |
| 38 | (ContinuousLinearMap.snd ℝ E E).prod (-((R t).comp (ContinuousLinearMap.fst ℝ E E))) |
| 39 | |
| 40 | @[simp] theorem pairCoeff_apply (R : ℝ → E →L[ℝ] E) (t : ℝ) (p : E × E) : |
| 41 | pairCoeff R t p = (p.2, -(R t) p.1) := rfl |
| 42 | |
| 43 | theorem norm_pairCoeff_le (R : ℝ → E →L[ℝ] E) (t : ℝ) : |
| 44 | ‖pairCoeff R t‖ ≤ max 1 ‖R t‖ := by |
| 45 | refine ContinuousLinearMap.opNorm_le_bound _ |
| 46 | (le_trans zero_le_one (le_max_left _ _)) fun p => ?_ |
| 47 | have hp : ‖pairCoeff R t p‖ = max ‖p.2‖ ‖(R t) p.1‖ := by |
| 48 | simp [Prod.norm_def] |
| 49 | rw [hp] |
| 50 | refine max_le ?_ ?_ |
| 51 | · calc |
| 52 | ‖p.2‖ ≤ ‖p‖ := norm_snd_le p |
| 53 | _ = 1 * ‖p‖ := (one_mul _).symm |
| 54 | _ ≤ max 1 ‖R t‖ * ‖p‖ := |
| 55 | mul_le_mul_of_nonneg_right (le_max_left _ _) (norm_nonneg _) |
| 56 | · calc |
| 57 | ‖(R t) p.1‖ ≤ ‖R t‖ * ‖p.1‖ := (R t).le_opNorm _ |
| 58 | _ ≤ ‖R t‖ * ‖p‖ := mul_le_mul_of_nonneg_left (norm_fst_le p) (norm_nonneg _) |
| 59 | _ ≤ max 1 ‖R t‖ * ‖p‖ := |
| 60 | mul_le_mul_of_nonneg_right (le_max_right _ _) (norm_nonneg _) |
| 61 | |
| 62 | /-- The equations `y' = v` and `v' = -R y`, with derivatives within `[a,b]`. -/ |
| 63 | structure IsJacobiSolOn (R : ℝ → E →L[ℝ] E) (a b : ℝ) (y v : ℝ → E) : Prop where |
| 64 | hasDerivWithinAt_fst : ∀ t ∈ Icc a b, |
| 65 | HasDerivWithinAt y (v t) (Icc a b) t |
| 66 | hasDerivWithinAt_snd : ∀ t ∈ Icc a b, |
| 67 | HasDerivWithinAt v (-(R t) (y t)) (Icc a b) t |
| 68 | |
| 69 | namespace IsJacobiSolOn |
| 70 | |
| 71 | variable {R : ℝ → E →L[ℝ] E} {a b : ℝ} {y v : ℝ → E} |
| 72 | |
| 73 | theorem continuousOn_fst (h : IsJacobiSolOn R a b y v) : ContinuousOn y (Icc a b) := |
| 74 | fun t ht => (h.hasDerivWithinAt_fst t ht).continuousWithinAt |
| 75 | |
| 76 | theorem continuousOn_snd (h : IsJacobiSolOn R a b y v) : ContinuousOn v (Icc a b) := |
| 77 | fun t ht => (h.hasDerivWithinAt_snd t ht).continuousWithinAt |
| 78 | |
| 79 | theorem isSolOn_pair (h : IsJacobiSolOn R a b y v) : |
| 80 | Poincare.ODE.Linear.IsSolOn (pairCoeff R) a b (fun t => (y t, v t)) := by |
| 81 | intro t ht |
| 82 | simpa using (h.hasDerivWithinAt_fst t ht).prodMk (h.hasDerivWithinAt_snd t ht) |
| 83 | |
| 84 | /-- Gronwall's bound for the pair in the maximum norm. -/ |
| 85 | theorem max_norm_le {C : ℝ} (h : IsJacobiSolOn R a b y v) |
| 86 | (hC : ∀ t ∈ Icc a b, ‖R t‖ ≤ C) : |
| 87 | ∀ t ∈ Icc a b, |
| 88 | max ‖y t‖ ‖v t‖ ≤ max ‖y a‖ ‖v a‖ * Real.exp (max 1 C * (t - a)) := by |
| 89 | intro t ht |
| 90 | set f : ℝ → E × E := fun s => (y s, v s) |
| 91 | have hcont : ContinuousOn f (Icc a b) := h.isSolOn_pair.continuousOn |
| 92 | have hderiv : ∀ x ∈ Ico a b, |
| 93 | HasDerivWithinAt f (pairCoeff R x (f x)) (Ici x) x := fun x hx => |
| 94 | (h.isSolOn_pair x (Ico_subset_Icc_self hx)).mono_of_mem_nhdsWithin |
| 95 | (Poincare.ODE.Linear.Icc_mem_nhdsWithin_Ici hx) |
| 96 | have hbound : ∀ x ∈ Ico a b, |
| 97 | ‖pairCoeff R x (f x)‖ ≤ max 1 C * ‖f x‖ + 0 := by |
| 98 | intro x hx |
| 99 | rw [add_zero] |
| 100 | exact ((pairCoeff R x).le_opNorm _).trans (mul_le_mul_of_nonneg_right |
| 101 | ((norm_pairCoeff_le R x).trans |
| 102 | (max_le_max le_rfl (hC x (Ico_subset_Icc_self hx)))) (norm_nonneg _)) |
| 103 | have hg := norm_le_gronwallBound_of_norm_deriv_right_le hcont hderiv |
| 104 | (le_refl ‖f a‖) hbound t ht |
| 105 | rw [gronwallBound_ε0] at hg |
| 106 | simpa [f, Prod.norm_def] using hg |
| 107 | |
| 108 | end IsJacobiSolOn |
| 109 | |
| 110 | variable [CompleteSpace E] |
| 111 | |
| 112 | /-- Fundamental theorem of calculus for a curve with derivatives within `[a,b]`. -/ |
| 113 | theorem sub_eq_integral_of_hasDerivWithinAt_Icc {a b : ℝ} {f f' : ℝ → E} |
| 114 | (hf : ∀ t ∈ Icc a b, HasDerivWithinAt f (f' t) (Icc a b) t) |
| 115 | (hf' : ContinuousOn f' (Icc a b)) {t : ℝ} (ht : t ∈ Icc a b) : |
| 116 | f t - f a = ∫ s in a..t, f' s := by |
| 117 | have hsub : Icc a t ⊆ Icc a b := Icc_subset_Icc le_rfl ht.2 |
| 118 | have hcont : ContinuousOn f (Icc a t) := |
| 119 | fun s hs => ((hf s (hsub hs)).continuousWithinAt).mono hsub |
| 120 | have hderiv : ∀ x ∈ Ioo a t, HasDerivWithinAt f (f' x) (Ioi x) x := by |
| 121 | intro x hx |
| 122 | have hx' : x ∈ Ico a b := ⟨hx.1.le, lt_of_lt_of_le hx.2 ht.2⟩ |
| 123 | exact ((hf x (Ico_subset_Icc_self hx')).mono_of_mem_nhdsWithin |
| 124 | (Poincare.ODE.Linear.Icc_mem_nhdsWithin_Ici hx')).mono Ioi_subset_Ici_self |
| 125 | have hint : IntervalIntegrable f' MeasureTheory.volume a t := by |
| 126 | apply ContinuousOn.intervalIntegrable |
| 127 | rw [uIcc_of_le ht.1] |
| 128 | exact hf'.mono hsub |
| 129 | exact (integral_eq_sub_of_hasDeriv_right_of_le ht.1 hcont hderiv hint).symm |
| 130 | |
| 131 | namespace IsJacobiSolOn |
| 132 | |
| 133 | variable {R : ℝ → E →L[ℝ] E} {b C : ℝ} {y v : ℝ → E} |
| 134 | |
| 135 | omit [CompleteSpace E] in |
| 136 | /-- The velocity is bounded uniformly by its initial exponential scale. -/ |
| 137 | theorem norm_snd_le (h : IsJacobiSolOn R 0 b y v) |
| 138 | (hC : ∀ t ∈ Icc 0 b, ‖R t‖ ≤ C) (hy0 : y 0 = 0) : |
| 139 | ∀ t ∈ Icc 0 b, ‖v t‖ ≤ ‖v 0‖ * Real.exp (max 1 C * b) := by |
| 140 | intro t ht |
| 141 | have hK0 : (0 : ℝ) ≤ max 1 C := le_trans zero_le_one (le_max_left _ _) |
| 142 | have h1 := h.max_norm_le hC t ht |
| 143 | rw [hy0] at h1 |
| 144 | rw [show max ‖(0 : E)‖ ‖v 0‖ = ‖v 0‖ by simp, sub_zero] at h1 |
| 145 | calc |
| 146 | ‖v t‖ ≤ max ‖y t‖ ‖v t‖ := le_max_right _ _ |
| 147 | _ ≤ ‖v 0‖ * Real.exp (max 1 C * t) := by simpa using h1 |
| 148 | _ ≤ ‖v 0‖ * Real.exp (max 1 C * b) := by |
| 149 | apply mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr ?_) (norm_nonneg _) |
| 150 | exact mul_le_mul_of_nonneg_left ht.2 hK0 |
| 151 | |
| 152 | /-- Integrating the velocity bound gives linear position growth. -/ |
| 153 | theorem norm_fst_le (h : IsJacobiSolOn R 0 b y v) |
| 154 | (hC : ∀ t ∈ Icc 0 b, ‖R t‖ ≤ C) (hy0 : y 0 = 0) : |
| 155 | ∀ t ∈ Icc 0 b, ‖y t‖ ≤ (‖v 0‖ * Real.exp (max 1 C * b)) * t := by |
| 156 | intro t ht |
| 157 | have key := sub_eq_integral_of_hasDerivWithinAt_Icc h.hasDerivWithinAt_fst |
| 158 | h.continuousOn_snd ht |
| 159 | rw [hy0, sub_zero] at key |
| 160 | rw [key] |
| 161 | have hbound : ∀ x ∈ Ι (0 : ℝ) t, |
| 162 | ‖v x‖ ≤ ‖v 0‖ * Real.exp (max 1 C * b) := by |
| 163 | intro x hx |
| 164 | rw [uIoc_of_le ht.1] at hx |
| 165 | exact h.norm_snd_le hC hy0 x ⟨hx.1.le, hx.2.trans ht.2⟩ |
| 166 | have hi := norm_integral_le_of_norm_le_const hbound |
| 167 | rwa [sub_zero, abs_of_nonneg ht.1] at hi |
| 168 | |
| 169 | /-- Integrating `v' = -R y` gives the quadratic velocity remainder. -/ |
| 170 | theorem norm_snd_sub_le (h : IsJacobiSolOn R 0 b y v) |
| 171 | (hR : ContinuousOn R (Icc 0 b)) (hC : ∀ t ∈ Icc 0 b, ‖R t‖ ≤ C) |
| 172 | (hy0 : y 0 = 0) : |
| 173 | ∀ t ∈ Icc 0 b, ‖v t - v 0‖ ≤ |
| 174 | C * (‖v 0‖ * Real.exp (max 1 C * b)) * t ^ 2 / 2 := by |
| 175 | intro t ht |
| 176 | have hC0 : (0 : ℝ) ≤ C := (norm_nonneg (R 0)).trans (hC 0 ⟨le_rfl, ht.1.trans ht.2⟩) |
| 177 | set M : ℝ := ‖v 0‖ * Real.exp (max 1 C * b) |
| 178 | have hRy : ContinuousOn (fun s => -(R s) (y s)) (Icc 0 b) := |
| 179 | (hR.clm_apply h.continuousOn_fst).neg |
| 180 | have key := sub_eq_integral_of_hasDerivWithinAt_Icc h.hasDerivWithinAt_snd hRy ht |
| 181 | rw [key] |
| 182 | have hsub : Icc 0 t ⊆ Icc 0 b := Icc_subset_Icc le_rfl ht.2 |
| 183 | have hi1 : IntervalIntegrable (fun s => ‖-(R s) (y s)‖) |
| 184 | MeasureTheory.volume 0 t := by |
| 185 | apply ContinuousOn.intervalIntegrable |
| 186 | rw [uIcc_of_le ht.1] |
| 187 | exact (hRy.mono hsub).norm |
| 188 | have hi2 : IntervalIntegrable (fun s => C * M * s) MeasureTheory.volume 0 t := |
| 189 | intervalIntegrable_id.const_mul _ |
| 190 | calc |
| 191 | ‖∫ s in (0 : ℝ)..t, -(R s) (y s)‖ ≤ |
| 192 | ∫ s in (0 : ℝ)..t, ‖-(R s) (y s)‖ := norm_integral_le_integral_norm ht.1 |
| 193 | _ ≤ ∫ s in (0 : ℝ)..t, C * M * s := by |
| 194 | apply integral_mono_on ht.1 hi1 hi2 |
| 195 | intro s hs |
| 196 | have hs' := hsub hs |
| 197 | rw [norm_neg] |
| 198 | calc |
| 199 | ‖(R s) (y s)‖ ≤ ‖R s‖ * ‖y s‖ := (R s).le_opNorm _ |
| 200 | _ ≤ C * (M * s) := mul_le_mul (hC s hs') (h.norm_fst_le hC hy0 s hs') |
| 201 | (norm_nonneg _) hC0 |
| 202 | _ = C * M * s := by ring |
| 203 | _ = C * M * t ^ 2 / 2 := by |
| 204 | rw [intervalIntegral.integral_const_mul, integral_id] |
| 205 | ring |
| 206 | |
| 207 | /-- Integrating the velocity remainder gives the cubic position remainder. -/ |
| 208 | theorem norm_fst_sub_le (h : IsJacobiSolOn R 0 b y v) |
| 209 | (hR : ContinuousOn R (Icc 0 b)) (hC : ∀ t ∈ Icc 0 b, ‖R t‖ ≤ C) |
| 210 | (hy0 : y 0 = 0) : |
| 211 | ∀ t ∈ Icc 0 b, ‖y t - t • v 0‖ ≤ |
| 212 | C * (‖v 0‖ * Real.exp (max 1 C * b)) * t ^ 3 / 6 := by |
| 213 | intro t ht |
| 214 | set M : ℝ := ‖v 0‖ * Real.exp (max 1 C * b) |
| 215 | have hz : ∀ s ∈ Icc (0 : ℝ) b, |
| 216 | HasDerivWithinAt (fun τ => y τ - τ • v 0) (v s - v 0) (Icc 0 b) s := by |
| 217 | intro s hs |
| 218 | have hsm : HasDerivWithinAt (fun τ : ℝ => τ • v 0) (v 0) (Icc 0 b) s := by |
| 219 | simpa using ((hasDerivAt_id s).smul_const (v 0)).hasDerivWithinAt |
| 220 | exact (h.hasDerivWithinAt_fst s hs).sub hsm |
| 221 | have hcont : ContinuousOn (fun s => v s - v 0) (Icc 0 b) := |
| 222 | h.continuousOn_snd.sub continuousOn_const |
| 223 | have key := sub_eq_integral_of_hasDerivWithinAt_Icc hz hcont ht |
| 224 | rw [hy0] at key |
| 225 | simp only [zero_smul, sub_zero] at key |
| 226 | rw [key] |
| 227 | have hsub : Icc 0 t ⊆ Icc 0 b := Icc_subset_Icc le_rfl ht.2 |
| 228 | have hi1 : IntervalIntegrable (fun s => ‖v s - v 0‖) |
| 229 | MeasureTheory.volume 0 t := by |
| 230 | apply ContinuousOn.intervalIntegrable |
| 231 | rw [uIcc_of_le ht.1] |
| 232 | exact (hcont.mono hsub).norm |
| 233 | have hi2 : IntervalIntegrable (fun s => C * M * s ^ 2 / 2) |
| 234 | MeasureTheory.volume 0 t := by |
| 235 | apply ContinuousOn.intervalIntegrable |
| 236 | exact Continuous.continuousOn (by fun_prop) |
| 237 | calc |
| 238 | ‖∫ s in (0 : ℝ)..t, (v s - v 0)‖ ≤ |
| 239 | ∫ s in (0 : ℝ)..t, ‖v s - v 0‖ := norm_integral_le_integral_norm ht.1 |
| 240 | _ ≤ ∫ s in (0 : ℝ)..t, C * M * s ^ 2 / 2 := by |
| 241 | apply integral_mono_on ht.1 hi1 hi2 |
| 242 | intro s hs |
| 243 | exact h.norm_snd_sub_le hR hC hy0 s (hsub hs) |
| 244 | _ = C * M * t ^ 3 / 6 := by |
| 245 | simp_rw [show ∀ s : ℝ, C * M * s ^ 2 / 2 = (C * M / 2) * s ^ 2 by intro s; ring] |
| 246 | rw [intervalIntegral.integral_const_mul, integral_pow] |
| 247 | norm_num |
| 248 | ring |
| 249 | |
| 250 | end IsJacobiSolOn |
| 251 | |
| 252 | end Poincare.ODE.Jacobi |