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.Soliton.TwoDimensional.Ancient.Entropy.ScalarEvolution |
| 2 | import PoincareLib.Geometry.RicciFlow.Soliton.Homothety |
| 3 | import Mathlib.Analysis.Calculus.MeanValue |
| 4 | |
| 5 | /-! |
| 6 | # Scalar normalization of a cylindrical limit |
| 7 | |
| 8 | Spatial constancy eliminates the scalar Laplacian. For a round surface or an |
| 9 | ambient flow with cylindrical Ricci norm, the inverse scalar curvature then |
| 10 | has derivative minus one. Positivity throughout `Iio 1` and a lower bound |
| 11 | diverging at time one determine the extinction parameter. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | namespace PoincareMT.RicciFlow |
| 22 | |
| 23 | variable {N : Type*} [TopologicalSpace N] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) N] [IsManifold (𝓡 2) ∞ N] |
| 25 | |
| 26 | /-- Spatial roundness reduces the genuine scalar evolution equation to |
| 27 | the scalar Riccati equation. -/ |
| 28 | theorem hasDerivAt_scalarCurvature_round_surface |
| 29 | {J : Set ℝ} (H : RicciFlow 2 N J) {t : ℝ} (ht : t ∈ interior J) |
| 30 | (hround : ConstantPositiveSectionalCurvature (H.metric t) (H.connection t)) |
| 31 | (x : N) : |
| 32 | HasDerivAt (fun s ↦ (H.connection s).scalarCurvature x) |
| 33 | ((H.connection t).scalarCurvature x ^ 2) t := by |
| 34 | obtain ⟨R, _, hR⟩ := (constantPositiveSectionalCurvature_iff_scalarCurvature _).mp hround |
| 35 | have hconst : (H.connection t).scalarCurvature = fun _ ↦ R := funext hR |
| 36 | have hlap : (H.connection t).laplacian (H.connection t).scalarCurvature x = 0 := by |
| 37 | rw [hconst] |
| 38 | simp only [LeviCivitaData.laplacian, LeviCivitaData.hessian, |
| 39 | LeviCivitaData.hessianOnFields, mvfderiv_const, |
| 40 | zero_apply, sub_self, Finset.sum_const_zero] |
| 41 | simpa only [hlap, zero_add] using H.hasDerivAt_scalarCurvature_surface ht x |
| 42 | |
| 43 | /-- Positivity up to time one and the shrinking lower bound determine the |
| 44 | extinction parameter in the scalar Riccati equation. -/ |
| 45 | theorem eq_inverse_one_sub_of_riccati_lower_bound |
| 46 | {R : ℝ → ℝ} (hpositive : ∀ t < 1, 0 < R t) |
| 47 | (hderivative : ∀ t < 1, HasDerivAt R (R t ^ 2) t) |
| 48 | {c : ℝ} (hc : 0 < c) (hlower : ∀ t < 1, c / (1 - t) ≤ R t) : |
| 49 | ∀ t < 1, R t = 1 / (1 - t) := by |
| 50 | have hinv (s : ℝ) (hs : s < 1) : |
| 51 | HasDerivAt (fun t ↦ (R t)⁻¹) (-1) s := by |
| 52 | have h := (hderivative s hs).inv (hpositive s hs).ne' |
| 53 | convert! h using 1 |
| 54 | simp [(hpositive s hs).ne'] |
| 55 | have hsum (s : ℝ) (hs : s < 1) : |
| 56 | HasDerivAt (fun t ↦ (R t)⁻¹ + t) 0 s := by |
| 57 | convert! (hinv s hs).add (hasDerivAt_id s) using 1 |
| 58 | norm_num |
| 59 | let A := (R 0)⁻¹ |
| 60 | have hconstant (s : ℝ) (hs : s < 1) : (R s)⁻¹ + s = A := by |
| 61 | have h := isOpen_Iio.is_const_of_deriv_eq_zero (convex_Iio (1 : ℝ)).isPreconnected |
| 62 | (fun t ht ↦ (hsum t ht).differentiableAt.differentiableWithinAt) |
| 63 | (fun t ht ↦ (hsum t ht).deriv) hs (show (0 : ℝ) ∈ Iio 1 by norm_num) |
| 64 | simpa only [add_zero] using h |
| 65 | have hinverse (s : ℝ) (hs : s < 1) : (R s)⁻¹ = A - s := by |
| 66 | linarith [hconstant s hs] |
| 67 | have hAlo : 1 ≤ A := by |
| 68 | by_contra h |
| 69 | have hA : A < 1 := lt_of_not_ge h |
| 70 | have hs : (A + 1) / 2 < 1 := by linarith |
| 71 | have hp := inv_pos.mpr (hpositive ((A + 1) / 2) hs) |
| 72 | rw [hinverse _ hs] at hp |
| 73 | linarith |
| 74 | have hbound (s : ℝ) (hs : s < 1) : c * (A - s) ≤ 1 - s := by |
| 75 | have h := (div_le_iff₀ (sub_pos.mpr hs)).mp (hlower s hs) |
| 76 | have h' : c / R s ≤ 1 - s := |
| 77 | (div_le_iff₀ (hpositive s hs)).mpr (by nlinarith) |
| 78 | simpa only [div_eq_mul_inv, hinverse s hs] using h' |
| 79 | have hlim : Tendsto (fun s : ℝ ↦ c * (A - s) - (1 - s)) |
| 80 | (𝓝[<] (1 : ℝ)) (𝓝 (c * (A - 1))) := by |
| 81 | have hid : Tendsto (fun s : ℝ ↦ s) (𝓝[<] (1 : ℝ)) (𝓝 (1 : ℝ)) := |
| 82 | tendsto_id.mono_left nhdsWithin_le_nhds |
| 83 | simpa only [sub_self, sub_zero] using |
| 84 | ((tendsto_const_nhds (x := c)).mul ((tendsto_const_nhds (x := A)).sub hid)).sub |
| 85 | ((tendsto_const_nhds (x := (1 : ℝ))).sub hid) |
| 86 | have hprod : c * (A - 1) ≤ 0 := by |
| 87 | apply le_of_tendsto hlim |
| 88 | filter_upwards [self_mem_nhdsWithin] with s hs |
| 89 | exact sub_nonpos.mpr (hbound s hs) |
| 90 | have hA : A = 1 := by nlinarith |
| 91 | intro t ht |
| 92 | have h := hinverse t ht |
| 93 | rw [hA] at h |
| 94 | have hi := congrArg Inv.inv h |
| 95 | simpa only [inv_inv, one_div] using hi |
| 96 | |
| 97 | /-- A round surface flow defined up to time one, whose scalar curvature is |
| 98 | bounded below by a positive multiple of `(1 - t)⁻¹`, has exactly the |
| 99 | normalized scalar curvature `(1 - t)⁻¹` at every time and point. -/ |
| 100 | theorem scalarCurvature_eq_one_div_one_sub_of_round_lower_bound |
| 101 | (H : RicciFlow 2 N (Iio 1)) |
| 102 | (hround : ∀ t < 1, |
| 103 | ConstantPositiveSectionalCurvature (H.metric t) (H.connection t)) |
| 104 | {c : ℝ} (hc : 0 < c) |
| 105 | (hlower : ∀ t < 1, ∀ x : N, c / (1 - t) ≤ (H.connection t).scalarCurvature x) : |
| 106 | ∀ t < 1, ∀ x : N, (H.connection t).scalarCurvature x = 1 / (1 - t) := by |
| 107 | intro t ht x |
| 108 | apply eq_inverse_one_sub_of_riccati_lower_bound |
| 109 | (R := fun s ↦ (H.connection s).scalarCurvature x) ?_ ?_ hc |
| 110 | (fun s hs ↦ hlower s hs x) t ht |
| 111 | · intro s hs |
| 112 | exact (div_pos hc (sub_pos.mpr hs)).trans_le (hlower s hs x) |
| 113 | · intro s hs |
| 114 | exact H.hasDerivAt_scalarCurvature_round_surface |
| 115 | (by simpa only [interior_Iio, mem_Iio] using hs) (hround s hs) x |
| 116 | |
| 117 | section Ambient |
| 118 | |
| 119 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 120 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 121 | |
| 122 | /-- Spatial scalar constancy and the cylindrical Ricci norm identity reduce |
| 123 | the actual ambient scalar evolution equation to the Riccati equation. -/ |
| 124 | theorem hasDerivAt_scalarCurvature_of_spatially_constant |
| 125 | {J : Set ℝ} (F : RicciFlow n M J) {t : ℝ} (ht : t ∈ interior J) |
| 126 | (hconst : ∀ x y : M, |
| 127 | (F.connection t).scalarCurvature x = (F.connection t).scalarCurvature y) |
| 128 | (hnorm : ∀ x : M, (F.connection t).ricciNormSq x = |
| 129 | (1 / 2 : ℝ) * (F.connection t).scalarCurvature x ^ 2) |
| 130 | (x : M) : |
| 131 | HasDerivAt (fun s ↦ (F.connection s).scalarCurvature x) |
| 132 | ((F.connection t).scalarCurvature x ^ 2) t := by |
| 133 | have hscalar : (F.connection t).scalarCurvature = |
| 134 | fun _ ↦ (F.connection t).scalarCurvature x := funext fun y ↦ hconst y x |
| 135 | have hlap : (F.connection t).laplacian (F.connection t).scalarCurvature x = 0 := by |
| 136 | rw [hscalar] |
| 137 | simp only [LeviCivitaData.laplacian, LeviCivitaData.hessian, |
| 138 | LeviCivitaData.hessianOnFields, mvfderiv_const, |
| 139 | zero_apply, sub_self, Finset.sum_const_zero] |
| 140 | have h := F.hasDerivAt_scalarCurvature ht x |
| 141 | rw [hlap, hnorm x] at h |
| 142 | convert! h using 1 |
| 143 | ring |
| 144 | |
| 145 | /-- Normalization follows on the actual ambient flow from spatial scalar |
| 146 | constancy, the cylindrical Ricci norm, and the shrinking lower bound. -/ |
| 147 | theorem scalarCurvature_eq_one_div_one_sub_of_spatially_constant_lower_bound |
| 148 | (F : RicciFlow n M (Iio 1)) |
| 149 | (hconst : ∀ t < 1, ∀ x y : M, |
| 150 | (F.connection t).scalarCurvature x = (F.connection t).scalarCurvature y) |
| 151 | (hnorm : ∀ t < 1, ∀ x : M, (F.connection t).ricciNormSq x = |
| 152 | (1 / 2 : ℝ) * (F.connection t).scalarCurvature x ^ 2) |
| 153 | {c : ℝ} (hc : 0 < c) |
| 154 | (hlower : ∀ t < 1, ∀ x : M, c / (1 - t) ≤ (F.connection t).scalarCurvature x) : |
| 155 | ∀ t < 1, ∀ x : M, (F.connection t).scalarCurvature x = 1 / (1 - t) := by |
| 156 | intro t ht x |
| 157 | apply eq_inverse_one_sub_of_riccati_lower_bound |
| 158 | (R := fun s ↦ (F.connection s).scalarCurvature x) ?_ ?_ hc |
| 159 | (fun s hs ↦ hlower s hs x) t ht |
| 160 | · intro s hs |
| 161 | exact (div_pos hc (sub_pos.mpr hs)).trans_le (hlower s hs x) |
| 162 | · intro s hs |
| 163 | exact F.hasDerivAt_scalarCurvature_of_spatially_constant |
| 164 | (by simpa only [interior_Iio, mem_Iio] using hs) (hconst s hs) (hnorm s hs) x |
| 165 | |
| 166 | end Ambient |
| 167 | |
| 168 | end PoincareMT.RicciFlow |