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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.NeckAnalysis.AffineDifference |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.NeckAnalysis.CovariantJetBounds |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.NeckAnalysis.TensorNorms |
| 5 | |
| 6 | /-! |
| 7 | # Ordinary coordinate errors control the frozen cylinder comparison |
| 8 | |
| 9 | Morgan--Tian Proposition 9.79, pp. 232-234, and Proposition 10.7 and |
| 10 | Claim 10.8, pp. 253-254. The model connection has uniformly bounded jets |
| 11 | at the chosen sphere chart centers. Normalizing a raw tensor difference |
| 12 | therefore bounds its covariant error arrays, including every derivative |
| 13 | slot, without requiring the coordinate maps to converge. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Bundle BigOperators Topology |
| 20 | |
| 21 | namespace PoincareMT.Proofs.M28.NeckAnalysis |
| 22 | |
| 23 | open FiniteHessian |
| 24 | |
| 25 | /-- Uniform finite ordinary error bounds give a quadratic bound on the |
| 26 | actual frozen covariant error. The constant is independent of the family |
| 27 | index and its positive error tolerance. Source: Proposition 10.7 and |
| 28 | Claim 10.8, pp. 253-254; derivation 10, section 3. -/ |
| 29 | theorem exists_cylinderJetDifferenceSquared_bound |
| 30 | {ι : Type*} (m : ℕ) (epsilon : ι → ℝ) |
| 31 | (B C : ι → RoundCylinderTwoTensor) (z : ι → RoundCylinderSpace) |
| 32 | (hB : ∀ i, RoundCylinderTensorSmoothOn (epsilon i) (B i)) |
| 33 | (hC : ∀ i, RoundCylinderTensorSmoothOn (epsilon i) (C i)) |
| 34 | (hz : ∀ i, (z i).2 ∈ Ioo (-(epsilon i)⁻¹) (epsilon i)⁻¹) |
| 35 | (error : ι → ℝ) (herror : ∀ i, 0 < error i) |
| 36 | (hraw : ∀ j ≤ m, ∀ i, ∀ a b : Fin 3, |
| 37 | ‖iteratedFDeriv ℝ j (fun p => |
| 38 | roundCylinderTensorCoefficient (B i) |
| 39 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) p a b - |
| 40 | roundCylinderTensorCoefficient (C i) |
| 41 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) p a b) |
| 42 | (0, (z i).2)‖ ≤ error i) : |
| 43 | ∃ L : ℝ, 0 ≤ L ∧ ∀ i, |
| 44 | cylinderJetDifferenceSquared 0 (B i) (C i) m (z i) ≤ L * error i ^ 2 := by |
| 45 | classical |
| 46 | let T := fun i => cylinderModelPlusDifference 0 (error i)⁻¹ (B i) (C i) |
| 47 | have hT : ∀ i, RoundCylinderTensorSmoothOn (epsilon i) (T i) := |
| 48 | fun i => cylinderModelPlusDifference_smooth 0 _ (hB i) (hC i) |
| 49 | have hp (i : ι) : (0, (z i).2) ∈ |
| 50 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1).target ×ˢ |
| 51 | Ioo (-(epsilon i)⁻¹) (epsilon i)⁻¹ := by |
| 52 | refine ⟨?_, hz i⟩ |
| 53 | rw [← sphere_chart_center (z i).1] |
| 54 | exact (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1).map_source |
| 55 | (mem_chart_source _ (z i).1) |
| 56 | have hzero : ∀ a, HasUniformJetBoundsAt m |
| 57 | (fun i p => roundCylinderIteratedDerivative 0 |
| 58 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) (T i) 0 p a) |
| 59 | (fun i => (0, (z i).2)) := by |
| 60 | intro a j hj |
| 61 | refine ⟨1, fun i => ?_⟩ |
| 62 | have hbc : ContDiffAt ℝ ∞ (fun p => |
| 63 | roundCylinderTensorCoefficient (B i) |
| 64 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) p (a 0) (a 1) - |
| 65 | roundCylinderTensorCoefficient (C i) |
| 66 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) p (a 0) (a 1)) |
| 67 | (0, (z i).2) := |
| 68 | ((hB i _ _ _).sub (hC i _ _ _)).contDiffAt |
| 69 | (((chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1).open_target.prod |
| 70 | isOpen_Ioo).mem_nhds (hp i)) |
| 71 | change ‖iteratedFDeriv ℝ j (fun p => roundCylinderIteratedDerivative 0 |
| 72 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) |
| 73 | (cylinderModelPlusDifference 0 (error i)⁻¹ (B i) (C i)) 0 p a) |
| 74 | (0, (z i).2)‖ ≤ 1 |
| 75 | simp_rw [cylinderModelPlusDifference_error_zero] |
| 76 | change ‖iteratedFDeriv ℝ j (fun p => (error i)⁻¹ • |
| 77 | (roundCylinderTensorCoefficient (B i) |
| 78 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) p (a 0) (a 1) - |
| 79 | roundCylinderTensorCoefficient (C i) |
| 80 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) p (a 0) (a 1))) |
| 81 | (0, (z i).2)‖ ≤ 1 |
| 82 | rw [iteratedFDeriv_const_smul_apply' (hbc.of_le (by exact_mod_cast le_top)), |
| 83 | norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr (herror i))] |
| 84 | calc |
| 85 | _ ≤ (error i)⁻¹ * error i := |
| 86 | mul_le_mul_of_nonneg_left (hraw j hj i _ _) (inv_nonneg.mpr (herror i).le) |
| 87 | _ = 1 := inv_mul_cancel₀ (herror i).ne' |
| 88 | have hjet := hasUniformJetBoundsAt_roundCylinderIteratedDerivative m epsilon |
| 89 | (fun _ => 0) (fun _ => by norm_num) (fun i => (z i).1) |
| 90 | (fun i => (z i).2) hz T hT hzero |
| 91 | choose c hc0 hc using fun (k : Fin (m + 1)) (a : Fin (2 + k.val) → Fin 3) => |
| 92 | (hjet k.val (by omega) a).bound_all |
| 93 | let L : ℝ := ∑ k : Fin (m + 1), ∑ a : Fin (2 + k.val) → Fin 3, |
| 94 | cylinderTensorWeight 0 a * c k a ^ 2 |
| 95 | refine ⟨L, ?_, ?_⟩ |
| 96 | · exact Finset.sum_nonneg fun k _ => Finset.sum_nonneg fun a _ => |
| 97 | mul_nonneg (cylinderTensorWeight_pos (by norm_num) a).le (sq_nonneg _) |
| 98 | · intro i |
| 99 | unfold cylinderJetDifferenceSquared |
| 100 | dsimp only |
| 101 | rw [← Fin.sum_univ_eq_sum_range] |
| 102 | change (∑ k : Fin (m + 1), _) ≤ L * error i ^ 2 |
| 103 | dsimp only [L] |
| 104 | rw [Finset.sum_mul] |
| 105 | apply Finset.sum_le_sum |
| 106 | intro k _ |
| 107 | rw [roundCylinderTensorNormSquared_eq_sum (by norm_num), Finset.sum_mul] |
| 108 | apply Finset.sum_le_sum |
| 109 | intro a _ |
| 110 | have hh := hc k a 0 (Nat.zero_le _) i |
| 111 | simp only [norm_iteratedFDeriv_zero, Real.norm_eq_abs] at hh |
| 112 | change |roundCylinderIteratedDerivative 0 |
| 113 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) |
| 114 | (cylinderModelPlusDifference 0 (error i)⁻¹ (B i) (C i)) |
| 115 | k.val (0, (z i).2) a| ≤ c k a at hh |
| 116 | rw [cylinderModelPlusDifference_iterated (by norm_num) _ (hB i) (hC i) |
| 117 | (z i).1 k.val (0, (z i).2) (hp i), abs_mul, abs_inv, |
| 118 | abs_of_pos (herror i)] at hh |
| 119 | have hcomponent := (div_le_iff₀ (herror i)).mp |
| 120 | (show |roundCylinderIteratedDerivative 0 |
| 121 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) (B i) k.val (0, (z i).2) a - |
| 122 | roundCylinderIteratedDerivative 0 |
| 123 | (chartAt (EuclideanSpace ℝ (Fin 2)) (z i).1) (C i) k.val (0, (z i).2) a| / |
| 124 | error i ≤ c k a by simpa only [div_eq_mul_inv, mul_comm] using hh) |
| 125 | rw [sphere_chart_center] |
| 126 | have hsquare := pow_le_pow_left₀ (abs_nonneg _) hcomponent 2 |
| 127 | rw [sq_abs, mul_pow] at hsquare |
| 128 | simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hsquare |
| 129 | (cylinderTensorWeight_pos (by norm_num) a).le |
| 130 | |
| 131 | private structure RawErrorDatum (m : ℕ) where |
| 132 | epsilon : ℝ |
| 133 | B : RoundCylinderTwoTensor |
| 134 | C : RoundCylinderTwoTensor |
| 135 | z : RoundCylinderSpace |
| 136 | error : ℝ |
| 137 | smooth_B : RoundCylinderTensorSmoothOn epsilon B |
| 138 | smooth_C : RoundCylinderTensorSmoothOn epsilon C |
| 139 | point_mem : z.2 ∈ Ioo (-epsilon⁻¹) epsilon⁻¹ |
| 140 | error_pos : 0 < error |
| 141 | raw_bound : ∀ j ≤ m, ∀ a b : Fin 3, |
| 142 | ‖iteratedFDeriv ℝ j (fun p => |
| 143 | roundCylinderTensorCoefficient B |
| 144 | (chartAt (EuclideanSpace ℝ (Fin 2)) z.1) p a b - |
| 145 | roundCylinderTensorCoefficient C |
| 146 | (chartAt (EuclideanSpace ℝ (Fin 2)) z.1) p a b) |
| 147 | (0, z.2)‖ ≤ error |
| 148 | |
| 149 | /-- The finite comparison constant precedes every tensor, point and error |
| 150 | tolerance. Apply the family estimate to the family of all admissible germs; |
| 151 | no compactness of the tensor family is assumed. Source: Proposition 10.7 |
| 152 | and Claim 10.8, pp. 253-254. -/ |
| 153 | theorem exists_uniform_cylinderJetDifferenceSquared_bound (m : ℕ) : |
| 154 | ∃ L : ℝ, 0 ≤ L ∧ ∀ (epsilon : ℝ) (B C : RoundCylinderTwoTensor), |
| 155 | RoundCylinderTensorSmoothOn epsilon B → |
| 156 | RoundCylinderTensorSmoothOn epsilon C → |
| 157 | ∀ z : RoundCylinderSpace, z.2 ∈ Ioo (-epsilon⁻¹) epsilon⁻¹ → |
| 158 | ∀ error : ℝ, 0 < error → |
| 159 | (∀ j ≤ m, ∀ a b : Fin 3, |
| 160 | ‖iteratedFDeriv ℝ j (fun p => |
| 161 | roundCylinderTensorCoefficient B |
| 162 | (chartAt (EuclideanSpace ℝ (Fin 2)) z.1) p a b - |
| 163 | roundCylinderTensorCoefficient C |
| 164 | (chartAt (EuclideanSpace ℝ (Fin 2)) z.1) p a b) |
| 165 | (0, z.2)‖ ≤ error) → |
| 166 | cylinderJetDifferenceSquared 0 B C m z ≤ L * error ^ 2 := by |
| 167 | obtain ⟨L, hL, hbound⟩ := exists_cylinderJetDifferenceSquared_bound m |
| 168 | (RawErrorDatum.epsilon (m := m)) RawErrorDatum.B RawErrorDatum.C RawErrorDatum.z |
| 169 | RawErrorDatum.smooth_B RawErrorDatum.smooth_C RawErrorDatum.point_mem |
| 170 | RawErrorDatum.error RawErrorDatum.error_pos (fun _ hj i => i.raw_bound _ hj) |
| 171 | refine ⟨L, hL, ?_⟩ |
| 172 | intro epsilon B C hB hC z hz error herror hraw |
| 173 | exact hbound ⟨epsilon, B, C, z, error, hB, hC, hz, herror, hraw⟩ |
| 174 | |
| 175 | /-- A prescribed covariant-jet budget has one positive raw-coordinate |
| 176 | tolerance chosen before the strip, tensors and point. Source: the finite |
| 177 | coordinate transfer in Proposition 10.7 and Claim 10.8, pp. 253-254. -/ |
| 178 | theorem exists_cylinder_raw_error_tolerance (m : ℕ) {delta : ℝ} |
| 179 | (hdelta : 0 < delta) : |
| 180 | ∃ rho : ℝ, 0 < rho ∧ ∀ (epsilon : ℝ) (B C : RoundCylinderTwoTensor), |
| 181 | RoundCylinderTensorSmoothOn epsilon B → |
| 182 | RoundCylinderTensorSmoothOn epsilon C → |
| 183 | ∀ z : RoundCylinderSpace, z.2 ∈ Ioo (-epsilon⁻¹) epsilon⁻¹ → |
| 184 | (∀ j ≤ m, ∀ a b : Fin 3, |
| 185 | ‖iteratedFDeriv ℝ j (fun p => |
| 186 | roundCylinderTensorCoefficient B |
| 187 | (chartAt (EuclideanSpace ℝ (Fin 2)) z.1) p a b - |
| 188 | roundCylinderTensorCoefficient C |
| 189 | (chartAt (EuclideanSpace ℝ (Fin 2)) z.1) p a b) |
| 190 | (0, z.2)‖ ≤ rho) → |
| 191 | cylinderJetDifferenceSquared 0 B C m z ≤ delta := by |
| 192 | obtain ⟨L, hL, hbound⟩ := exists_uniform_cylinderJetDifferenceSquared_bound m |
| 193 | let rho := min 1 (delta / (L + 1)) |
| 194 | have hL1 : 0 < L + 1 := by linarith |
| 195 | have hrho : 0 < rho := lt_min (by norm_num) (div_pos hdelta hL1) |
| 196 | have hrho1 : rho ≤ 1 := min_le_left _ _ |
| 197 | have hbudget : (L + 1) * rho ≤ delta := by |
| 198 | have h := mul_le_mul_of_nonneg_left (min_le_right 1 (delta / (L + 1))) hL1.le |
| 199 | simpa only [mul_div_cancel₀ _ hL1.ne'] using h |
| 200 | refine ⟨rho, hrho, ?_⟩ |
| 201 | intro epsilon B C hB hC z hz hraw |
| 202 | apply (hbound epsilon B C hB hC z hz rho hrho hraw).trans |
| 203 | have hsquare : rho ^ 2 ≤ rho := by nlinarith |
| 204 | calc |
| 205 | L * rho ^ 2 ≤ L * rho := mul_le_mul_of_nonneg_left hsquare hL |
| 206 | _ ≤ (L + 1) * rho := by nlinarith |
| 207 | _ ≤ delta := hbudget |
| 208 | |
| 209 | /-- Compact-uniform raw coefficient convergence supplies the eventual frozen |
| 210 | cylinder comparison. The raw convergence is tested only through the finite |
| 211 | order required by the retained epsilon strip. Source: Proposition 9.79, |
| 212 | pp. 232-234; Proposition 10.7 and Claim 10.8, pp. 253-254. -/ |
| 213 | theorem eventually_cylinderJetDifferenceSquared_of_raw_bounds |
| 214 | {ι : Type*} (l : Filter ι) (m : ℕ) |
| 215 | {epsilon : ℝ} {B C : ι → RoundCylinderTwoTensor} |
| 216 | (hB : ∀ᶠ i in l, RoundCylinderTensorSmoothOn epsilon (B i)) |
| 217 | (hC : ∀ᶠ i in l, RoundCylinderTensorSmoothOn epsilon (C i)) |
| 218 | {delta : ℝ} (hdelta : 0 < delta) |
| 219 | (hraw : ∀ rho : ℝ, 0 < rho → ∀ᶠ i in l, ∀ z : RoundCylinderSpace, |
| 220 | z.2 ∈ Ioo (-epsilon⁻¹) epsilon⁻¹ → ∀ j ≤ m, ∀ a b : Fin 3, |
| 221 | ‖iteratedFDeriv ℝ j (fun p => |
| 222 | roundCylinderTensorCoefficient (B i) |
| 223 | (chartAt (EuclideanSpace ℝ (Fin 2)) z.1) p a b - |
| 224 | roundCylinderTensorCoefficient (C i) |
| 225 | (chartAt (EuclideanSpace ℝ (Fin 2)) z.1) p a b) |
| 226 | (0, z.2)‖ ≤ rho) : |
| 227 | ∀ᶠ i in l, ∀ z : RoundCylinderSpace, |
| 228 | z.2 ∈ Ioo (-epsilon⁻¹) epsilon⁻¹ → |
| 229 | cylinderJetDifferenceSquared 0 (B i) (C i) m z ≤ delta := by |
| 230 | obtain ⟨rho, hrho, hpoint⟩ := exists_cylinder_raw_error_tolerance m hdelta |
| 231 | filter_upwards [hB, hC, hraw rho hrho] with i hiB hiC hi z hz |
| 232 | exact hpoint epsilon (B i) (C i) hiB hiC z hz (hi z hz) |
| 233 | |
| 234 | end PoincareMT.Proofs.M28.NeckAnalysis |