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.Positivity.Sectional.Compact |
| 2 | import PoincareLib.Geometry.RicciFlow.Pinching.Definitions |
| 3 | |
| 4 | /-! |
| 5 | # The positive sectional cone used in Remark 16.2 |
| 6 | |
| 7 | Morgan--Tian Lemma 4.13, pp. 68-69, and the component argument on p. 393. |
| 8 | The model-pair algebra adapts the private helpers in M04's |
| 9 | CompactSectionalPreservation to a quantitative positive lower bound. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Topology |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M04 |
| 20 | end PoincareMT.M04 |
| 21 | open PoincareMT.RicciFlowAnalysis |
| 22 | |
| 23 | namespace PoincareMT.Proofs.M46 |
| 24 | |
| 25 | open PoincareMT.M04 |
| 26 | |
| 27 | section Algebra |
| 28 | |
| 29 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 30 | |
| 31 | private theorem alternating_pair_scale |
| 32 | (A : MultilinearMap ℝ (fun _ : Fin 4 => E) ℝ) |
| 33 | (hfirst : ∀ a b c d, A ![a, b, c, d] = -A ![b, a, c, d]) |
| 34 | (hlast : ∀ a b c d, A ![a, b, c, d] = -A ![a, b, d, c]) |
| 35 | (p q : E) (r d s : ℝ) : |
| 36 | A ![r • p, d • p + s • q, r • p, d • p + s • q] = |
| 37 | r ^ 2 * s ^ 2 * A ![p, q, p, q] := by |
| 38 | have hs0 (a b c f : E) (z : ℝ) : |
| 39 | A ![z • a, b, c, f] = z * A ![a, b, c, f] := by |
| 40 | simpa only [Matrix.vecCons, smul_eq_mul] using A.cons_smul ![b, c, f] z a |
| 41 | have hs1 (a b c f : E) (z : ℝ) : |
| 42 | A ![a, z • b, c, f] = z * A ![a, b, c, f] := by |
| 43 | simpa only [MultilinearMap.curryLeft_apply, Matrix.vecCons, smul_eq_mul] using |
| 44 | (A.curryLeft a).cons_smul ![c, f] z b |
| 45 | have hs2 (a b c f : E) (z : ℝ) : |
| 46 | A ![a, b, z • c, f] = z * A ![a, b, c, f] := by |
| 47 | simpa only [MultilinearMap.curryLeft_apply, Matrix.vecCons, smul_eq_mul] using |
| 48 | ((A.curryLeft a).curryLeft b).cons_smul ![f] z c |
| 49 | have hs3 (a b c f : E) (z : ℝ) : |
| 50 | A ![a, b, c, z • f] = z * A ![a, b, c, f] := by |
| 51 | simpa only [MultilinearMap.curryLeft_apply, Matrix.vecCons, smul_eq_mul] using |
| 52 | (((A.curryLeft a).curryLeft b).curryLeft c).cons_smul ![] z f |
| 53 | have ha1 (a b c f z : E) : |
| 54 | A ![a, b + c, f, z] = A ![a, b, f, z] + A ![a, c, f, z] := by |
| 55 | simpa only [MultilinearMap.curryLeft_apply, Matrix.vecCons] using |
| 56 | (A.curryLeft a).cons_add ![f, z] b c |
| 57 | have ha3 (a b c f z : E) : |
| 58 | A ![a, b, c, f + z] = A ![a, b, c, f] + A ![a, b, c, z] := by |
| 59 | simpa only [MultilinearMap.curryLeft_apply, Matrix.vecCons] using |
| 60 | (((A.curryLeft a).curryLeft b).curryLeft c).cons_add ![] f z |
| 61 | have hf (a b c : E) : A ![a, a, b, c] = 0 := by |
| 62 | linarith only [hfirst a a b c] |
| 63 | have hl (a b c : E) : A ![a, b, c, c] = 0 := by |
| 64 | linarith only [hlast a b c c] |
| 65 | simp only [hs0, hs2, ha1, ha3, hs1, hs3, hf, hl] |
| 66 | ring |
| 67 | |
| 68 | private theorem alternating_pair_nonnegative |
| 69 | (A : MultilinearMap ℝ (fun _ : Fin 4 => E) ℝ) |
| 70 | (hfirst : ∀ a b c d, A ![a, b, c, d] = -A ![b, a, c, d]) |
| 71 | (hlast : ∀ a b c d, A ![a, b, c, d] = -A ![a, b, d, c]) |
| 72 | (hunit : ∀ p q : E, ‖p‖ = 1 → ‖q‖ = 1 → inner ℝ p q = 0 → |
| 73 | 0 ≤ A ![p, q, p, q]) (u v : E) : 0 ≤ A ![u, v, u, v] := by |
| 74 | by_cases hu : u = 0 |
| 75 | · subst u |
| 76 | rw [A.map_coord_zero (0 : Fin 4) rfl] |
| 77 | let r := ‖u‖ |
| 78 | let p := r⁻¹ • u |
| 79 | have hp : ‖p‖ = 1 := norm_smul_inv_norm (𝕜 := ℝ) hu |
| 80 | have hup : u = r • p := by |
| 81 | simp [p, r, smul_smul, mul_inv_cancel₀ (norm_ne_zero_iff.mpr hu)] |
| 82 | let d := inner ℝ p v |
| 83 | let w := v - d • p |
| 84 | have hvw : v = d • p + w := by dsimp only [w]; abel |
| 85 | have hpw : inner ℝ p w = 0 := by simp [w, d, inner_sub_right, inner_smul_right, hp] |
| 86 | by_cases hw : w = 0 |
| 87 | · have hv0 : v = d • p + (0 : ℝ) • (0 : E) := by simpa [hw] using hvw |
| 88 | rw [congrArg₂ (fun a b => A ![a, b, a, b]) hup hv0, |
| 89 | alternating_pair_scale A hfirst hlast p 0 r d 0] |
| 90 | simp |
| 91 | let s := ‖w‖ |
| 92 | let q := s⁻¹ • w |
| 93 | have hq : ‖q‖ = 1 := norm_smul_inv_norm (𝕜 := ℝ) hw |
| 94 | have hpq : inner ℝ p q = 0 := by simp [q, inner_smul_right, hpw] |
| 95 | have hwq : w = s • q := by |
| 96 | simp [q, s, smul_smul, mul_inv_cancel₀ (norm_ne_zero_iff.mpr hw)] |
| 97 | have hvq : v = d • p + s • q := by rw [← hwq]; exact hvw |
| 98 | rw [congrArg₂ (fun a b => A ![a, b, a, b]) hup hvq, |
| 99 | alternating_pair_scale A hfirst hlast p q r d s] |
| 100 | exact mul_nonneg (mul_nonneg (sq_nonneg r) (sq_nonneg s)) (hunit p q hp hq hpq) |
| 101 | |
| 102 | end Algebra |
| 103 | |
| 104 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 105 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 106 | {g : RiemannianMetric n M} |
| 107 | |
| 108 | set_option maxHeartbeats 1200000 in |
| 109 | -- The shifted tensor has the same alternating symmetries as curvature. |
| 110 | set_option backward.isDefEq.respectTransparency false in |
| 111 | /-- A model-frame lower bound controls every tangent plane, including |
| 112 | dependent pairs. This is the cone in Lemma 4.13, pp. 68-69. -/ |
| 113 | theorem sectional_lower_from_model_pairs (D : LeviCivitaData g) (c y : M) |
| 114 | (hy : y ∈ (trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 115 | (TangentSpace (𝓡 n) : M → Type _) c).baseSet) (m : ℝ) |
| 116 | (hmin : ∀ p ∈ modelOrthonormalPairs n, |
| 117 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 118 | (TangentSpace (𝓡 n) : M → Type _) c |
| 119 | m * metricGram g y (e.symmL ℝ y p.1) (e.symmL ℝ y p.2) ≤ |
| 120 | D.curvatureTensor y (e.symmL ℝ y p.1) (e.symmL ℝ y p.2) |
| 121 | (e.symmL ℝ y p.1) (e.symmL ℝ y p.2)) |
| 122 | (u v : TangentSpace (𝓡 n) y) : m * metricGram g y u v ≤ D.curvatureTensor y u v u v := by |
| 123 | let E := EuclideanSpace ℝ (Fin n) |
| 124 | let e := trivializationAt E (TangentSpace (𝓡 n) : M → Type _) c |
| 125 | let f := e.symmL ℝ y |
| 126 | obtain ⟨R, hR⟩ := (isSmoothCovariantTensor_riemannEvaluation D).1 y |
| 127 | obtain ⟨G, hG⟩ := (isSmoothCovariantTensor_metricGramEvaluation g).1 y |
| 128 | let A : MultilinearMap ℝ (fun _ : Fin 4 => E) ℝ := |
| 129 | (R - m • G).compLinearMap (fun _ => f.toLinearMap) |
| 130 | have hA (a b c d : E) : A ![a, b, c, d] = |
| 131 | D.curvatureTensor y (f a) (f b) (f c) (f d) - |
| 132 | m * (g.inner y (f a) (f c) * g.inner y (f b) (f d) - |
| 133 | g.inner y (f a) (f d) * g.inner y (f b) (f c)) := by |
| 134 | simp only [A, MultilinearMap.compLinearMap_apply, ContinuousLinearMap.coe_coe, |
| 135 | sub_apply, smul_apply, smul_eq_mul, ← hR, ← hG, |
| 136 | LeviCivitaData.riemannEvaluation, metricGramEvaluation, |
| 137 | Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val] |
| 138 | have hfirst (a b c d : E) : A ![a, b, c, d] = -A ![b, a, c, d] := by |
| 139 | rw [hA, hA, curvatureTensor_swap_first D] |
| 140 | ring |
| 141 | have hlast (a b c d : E) : A ![a, b, c, d] = -A ![a, b, d, c] := by |
| 142 | rw [hA, hA, curvatureTensor_swap_last D] |
| 143 | ring |
| 144 | have hdiag (a b : E) : A ![a, b, a, b] = |
| 145 | D.curvatureTensor y (f a) (f b) (f a) (f b) - m * metricGram g y (f a) (f b) := by |
| 146 | rw [hA, g.symm y (f b) (f a)] |
| 147 | simp only [metricGram, pow_two] |
| 148 | have hall (a b : E) : 0 ≤ A ![a, b, a, b] := |
| 149 | alternating_pair_nonnegative A hfirst hlast (fun p q hp hq hpq => by |
| 150 | rw [hdiag] |
| 151 | exact sub_nonneg.mpr (hmin (p, q) ⟨hp, hq, hpq⟩)) a b |
| 152 | have h := hall (e.continuousLinearMapAt ℝ y u) (e.continuousLinearMapAt ℝ y v) |
| 153 | rw [hdiag] at h |
| 154 | simpa only [f, e.symmL_continuousLinearMapAt hy] using sub_nonneg.mp h |
| 155 | |
| 156 | set_option backward.isDefEq.respectTransparency false in |
| 157 | /-- Taking the scalar trace of the cone in Lemma 4.13 gives six times |
| 158 | the sectional lower bound in dimension three. -/ |
| 159 | theorem scalar_lower_of_sectional_lower {N : Type u} [TopologicalSpace N] |
| 160 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) N] [IsManifold (𝓡 3) ∞ N] |
| 161 | {g : RiemannianMetric 3 N} (D : LeviCivitaData g) (x : N) (m : ℝ) |
| 162 | (hsec : ∀ u v : TangentSpace (𝓡 3) x, |
| 163 | m * metricGram g x u v ≤ D.curvatureTensor x u v u v) : |
| 164 | 6 * m ≤ D.scalarCurvature x := by |
| 165 | classical |
| 166 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : N → Type _) := |
| 167 | ⟨g.toRiemannianMetric⟩ |
| 168 | let b := g.orthonormalBasis x |
| 169 | have hdim : Module.finrank ℝ (TangentSpace (𝓡 3) x) = 3 := by |
| 170 | change Module.finrank ℝ (EuclideanSpace ℝ (Fin 3)) = 3 |
| 171 | exact finrank_euclideanSpace_fin |
| 172 | have hgram (i j : Fin (Module.finrank ℝ (TangentSpace (𝓡 3) x))) : |
| 173 | metricGram g x (b i) (b j) = if i = j then 0 else 1 := by |
| 174 | change inner ℝ (b i) (b i) * inner ℝ (b j) (b j) - |
| 175 | (inner ℝ (b i) (b j)) ^ 2 = _ |
| 176 | simp only [b.inner_eq_one, b.inner_eq_ite] |
| 177 | split_ifs <;> norm_num |
| 178 | have h := Finset.sum_le_sum (s := Finset.univ) (fun i _ => |
| 179 | Finset.sum_le_sum (s := Finset.univ) (fun j _ => hsec (b i) (b j))) |
| 180 | change (∑ i, ∑ j, m * metricGram g x (b i) (b j)) ≤ D.scalarCurvature x at h |
| 181 | simp_rw [hgram, mul_ite, mul_zero, mul_one] at h |
| 182 | have hrow (i : Fin (Module.finrank ℝ (TangentSpace (𝓡 3) x))) : |
| 183 | (∑ j : Fin (Module.finrank ℝ (TangentSpace (𝓡 3) x)), |
| 184 | if i = j then 0 else m) = 2 * m := by |
| 185 | calc |
| 186 | _ = ∑ j : Fin (Module.finrank ℝ (TangentSpace (𝓡 3) x)), |
| 187 | (m - if i = j then m else 0) := by |
| 188 | apply Finset.sum_congr rfl |
| 189 | intro j _ |
| 190 | split_ifs <;> ring |
| 191 | _ = 3 * m - m := by simp [Finset.sum_sub_distrib, hdim] |
| 192 | _ = 2 * m := by ring |
| 193 | simp_rw [hrow] at h |
| 194 | simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, |
| 195 | hdim, nsmul_eq_mul] at h |
| 196 | norm_num at h |
| 197 | linarith |
| 198 | |
| 199 | set_option maxHeartbeats 1200000 in |
| 200 | -- Gram-Schmidt uses the metric's Riemannian bundle instance at the point. |
| 201 | set_option backward.isDefEq.respectTransparency false in |
| 202 | /-- Strict positivity on metric orthonormal pairs implies positivity on |
| 203 | every independent pair, as used in Remark 16.2's compact minimum. -/ |
| 204 | theorem curvature_pair_positive_of_orthonormal {N : Type u} [TopologicalSpace N] |
| 205 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) N] [IsManifold (𝓡 3) ∞ N] |
| 206 | {g : RiemannianMetric 3 N} (D : LeviCivitaData g) (x : N) |
| 207 | (hpos : ∀ a b : TangentSpace (𝓡 3) x, |
| 208 | LeviCivitaData.IsOrthonormalPair g x a b → 0 < D.sectionalCurvature x a b) |
| 209 | (u v : TangentSpace (𝓡 3) x) (hlin : LinearIndependent ℝ ![u, v]) : |
| 210 | 0 < D.curvatureTensor x u v u v := by |
| 211 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : N → Type _) := |
| 212 | ⟨g.toRiemannianMetric⟩ |
| 213 | let E := TangentSpace (𝓡 3) x |
| 214 | have hgram : 0 < inner ℝ u u * inner ℝ v v - (inner ℝ u v) ^ 2 := |
| 215 | metricGram_pos_of_linearIndependent g x u v hlin |
| 216 | have hu : u ≠ 0 := by |
| 217 | intro hu |
| 218 | simp [hu] at hgram |
| 219 | let r := ‖u‖ |
| 220 | let p : E := r⁻¹ • u |
| 221 | have hp : ‖p‖ = 1 := norm_smul_inv_norm (𝕜 := ℝ) hu |
| 222 | have hpp : inner ℝ p p = 1 := by rw [real_inner_self_eq_norm_sq, hp]; norm_num |
| 223 | have hup : u = r • p := by |
| 224 | simp [p, r, smul_smul, mul_inv_cancel₀ (norm_ne_zero_iff.mpr hu)] |
| 225 | let d := inner ℝ p v |
| 226 | let w := v - d • p |
| 227 | have hvw : v = d • p + w := by dsimp only [w]; abel |
| 228 | have hpw : inner ℝ p w = 0 := by simp [w, d, inner_sub_right, inner_smul_right, hp] |
| 229 | have hw : w ≠ 0 := by |
| 230 | intro hw0 |
| 231 | have hv : v = d • p := by simpa [hw0] using hvw |
| 232 | rw [hup, hv] at hgram |
| 233 | simp only [inner_smul_left, inner_smul_right, conj_trivial, hpp, mul_one] at hgram |
| 234 | nlinarith |
| 235 | let s := ‖w‖ |
| 236 | let q : E := s⁻¹ • w |
| 237 | have hq : ‖q‖ = 1 := norm_smul_inv_norm (𝕜 := ℝ) hw |
| 238 | have hqq : inner ℝ q q = 1 := by rw [real_inner_self_eq_norm_sq, hq]; norm_num |
| 239 | have hpq : inner ℝ p q = 0 := by simp [q, inner_smul_right, hpw] |
| 240 | have hwq : w = s • q := by |
| 241 | simp [q, s, smul_smul, mul_inv_cancel₀ (norm_ne_zero_iff.mpr hw)] |
| 242 | have hvq : v = d • p + s • q := by rw [← hwq]; exact hvw |
| 243 | have hpair : LeviCivitaData.IsOrthonormalPair g x p q := ⟨hpp, hqq, hpq⟩ |
| 244 | have hpqpos : 0 < D.curvatureTensor x p q p q := by |
| 245 | have h := hpos p q hpair |
| 246 | simpa only [LeviCivitaData.sectionalCurvature, hpair.1, hpair.2.1, hpair.2.2, |
| 247 | one_mul, zero_pow (by decide : 2 ≠ 0), sub_zero, div_one] using h |
| 248 | obtain ⟨A, hA⟩ := (isSmoothCovariantTensor_riemannEvaluation D).1 x |
| 249 | have hR (a b c d : E) : D.curvatureTensor x a b c d = A ![a, b, c, d] := hA ![a, b, c, d] |
| 250 | have hfirst (a b c d : E) : A ![a, b, c, d] = -A ![b, a, c, d] := by |
| 251 | simpa only [← hR] using curvatureTensor_swap_first D x b a c d |
| 252 | have hlast (a b c d : E) : A ![a, b, c, d] = -A ![a, b, d, c] := by |
| 253 | simpa only [← hR] using curvatureTensor_swap_last D x a b c d |
| 254 | rw [hR, congrArg₂ (fun a b => A ![a, b, a, b]) hup hvq, |
| 255 | alternating_pair_scale A hfirst hlast p q r d s, ← hR] |
| 256 | exact mul_pos (mul_pos (sq_pos_of_pos (norm_pos_iff.mpr hu)) |
| 257 | (sq_pos_of_pos (norm_pos_iff.mpr hw))) hpqpos |
| 258 | |
| 259 | end PoincareMT.Proofs.M46 |