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.Pinching.CurvatureCarrier |
| 2 | import PoincareLib.Geometry.RicciFlow.Pinching.TensorRegion |
| 3 | import PoincareLib.Geometry.Riemannian.Tensor.Algebra |
| 4 | import PoincareLib.Geometry.Riemannian.Tensor.TraceRegularity |
| 5 | |
| 6 | /-! |
| 7 | # Intrinsic three-dimensional curvature tensors |
| 8 | |
| 9 | The Ricci complement `(R / 2) g - Ric` is an intrinsic covariant two-tensor. |
| 10 | Its components in every orthonormal three-frame are the cyclic curvature |
| 11 | matrix. This identifies its Hamilton--Ivey tensor carrier with the retained |
| 12 | scalar and least-sectional-curvature definitions. |
| 13 | |
| 14 | Reference: Morgan--Tian, Theorem 4.8, p. 66; Claim 4.28, pp. 77--78. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle BigOperators |
| 21 | open Poincare.Geometry.Curvature.Operator Poincare.HamiltonIvey |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.LeviCivitaData |
| 26 | |
| 27 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 29 | {g : RiemannianMetric n M} |
| 30 | |
| 31 | private instance ricciComplementFiniteDimensional (x : M) : |
| 32 | FiniteDimensional ℝ (TangentSpace (𝓡 n) x) := by |
| 33 | unfold TangentSpace |
| 34 | infer_instance |
| 35 | |
| 36 | /-- The intrinsic Ricci complement, without choosing a local frame. -/ |
| 37 | noncomputable def ricciComplementEvaluation (D : LeviCivitaData g) : |
| 38 | CovariantTensorEvaluation n M 2 := |
| 39 | fun x v => (D.scalarCurvature x / 2) * g.inner x (v 0) (v 1) - |
| 40 | D.ricci x (v 0) (v 1) |
| 41 | |
| 42 | /-- The Ricci complement is a smooth covariant tensor. -/ |
| 43 | theorem isSmoothCovariantTensor_ricciComplementEvaluation |
| 44 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) : |
| 45 | IsSmoothCovariantTensor D.ricciComplementEvaluation := by |
| 46 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 47 | ⟨g.toRiemannianMetric⟩ |
| 48 | let : IsContMDiffRiemannianBundle (𝓡 n) ∞ (EuclideanSpace ℝ (Fin n)) |
| 49 | (TangentSpace (𝓡 n) : M → Type _) := ⟨g.inner, g.contMDiff, fun _ _ _ => rfl⟩ |
| 50 | have hscalar : ContMDiff (𝓡 n) (𝓘(ℝ, ℝ)) ∞ D.scalarCurvature := by |
| 51 | change ContMDiff (𝓡 n) (𝓘(ℝ, ℝ)) ∞ |
| 52 | (fun x => ∑ i, D.ricci x (g.orthonormalBasis x i) (g.orthonormalBasis x i)) |
| 53 | have hs := (hD.2.1.tensorTrace (g := g)).2 Set.univ isOpen_univ |
| 54 | (fun i => Fin.elim0 i) (fun i => Fin.elim0 i) |
| 55 | simpa [contMDiffOn_univ, RiemannianMetric.tensorTrace, LeviCivitaData.scalarCurvature, |
| 56 | ricciEvaluation] using hs |
| 57 | constructor |
| 58 | · intro x |
| 59 | obtain ⟨A, hA⟩ := hD.2.1.1 x |
| 60 | refine ⟨(D.scalarCurvature x / 2) • |
| 61 | TensorFiber.toMultilinear (TensorFiber.operatorTensor (LinearMap.id : |
| 62 | TangentSpace (𝓡 n) x →ₗ[ℝ] TangentSpace (𝓡 n) x)) - A, ?_⟩ |
| 63 | intro v |
| 64 | change _ = (D.scalarCurvature x / 2) * inner ℝ (v 0) (v 1) - A v |
| 65 | exact congrArg ((D.scalarCurvature x / 2) * g.inner x (v 0) (v 1) - ·) (hA v) |
| 66 | · intro U hU X hX |
| 67 | exact ((hscalar.contMDiffOn.div_const 2).mul |
| 68 | ((hX 0).inner_bundle (hX 1))).sub (hD.2.1.2 U hU X hX) |
| 69 | |
| 70 | /-- The intrinsic Ricci complement in the Hilbert tensor fiber. -/ |
| 71 | noncomputable def ricciComplementTensor (D : LeviCivitaData g) |
| 72 | (hD : D.CurvatureTensorCalculus) (x : M) : |
| 73 | TensorFiber (TangentSpace (𝓡 n) x) 2 := |
| 74 | TensorFiber.toMultilinear.symm |
| 75 | (Classical.choose ((D.isSmoothCovariantTensor_ricciComplementEvaluation hD).1 x)) |
| 76 | |
| 77 | @[simp] theorem ricciComplementTensor_apply (D : LeviCivitaData g) |
| 78 | (hD : D.CurvatureTensorCalculus) (x : M) |
| 79 | (v : Fin 2 → TangentSpace (𝓡 n) x) : |
| 80 | D.ricciComplementTensor hD x v = D.ricciComplementEvaluation x v := |
| 81 | (Classical.choose_spec |
| 82 | ((D.isSmoothCovariantTensor_ricciComplementEvaluation hD).1 x) v).symm |
| 83 | |
| 84 | theorem ricciComplementEvaluation_symm (D : LeviCivitaData g) |
| 85 | (hD : D.CurvatureTensorCalculus) (x : M) (v w : TangentSpace (𝓡 n) x) : |
| 86 | D.ricciComplementEvaluation x ![v, w] = |
| 87 | D.ricciComplementEvaluation x ![w, v] := by |
| 88 | change _ * g.inner x v w - D.ricci x v w = |
| 89 | _ * g.inner x w v - D.ricci x w v |
| 90 | rw [g.symm, (hD.2.2.2.1 x v w v w).2.2.2] |
| 91 | |
| 92 | end PoincareMT.LeviCivitaData |
| 93 | |
| 94 | namespace Poincare.Geometry.Curvature.Operator |
| 95 | |
| 96 | private theorem curvatureMatrix_eq_trace_sub_ricci |
| 97 | (R : Fin 3 → Fin 3 → Fin 3 → Fin 3 → ℝ) |
| 98 | (hfirst : ∀ i j k l, R i j k l = -R j i k l) |
| 99 | (hlast : ∀ i j k l, R i j k l = -R i j l k) |
| 100 | (hpair : ∀ i j k l, R i j k l = R k l i j) (i j : Fin 3) : |
| 101 | curvatureMatrix R i j = |
| 102 | Matrix.trace (curvatureMatrix R) * (if i = j then 1 else 0) - |
| 103 | ∑ p, R i p j p := by |
| 104 | have hdiagFirst (i k l) : R i i k l = 0 := by linarith [hfirst i i k l] |
| 105 | have hdiagLast (i j k) : R i j k k = 0 := by linarith [hlast i j k k] |
| 106 | have hswap (i j) : R i j i j = R j i j i := by |
| 107 | rw [hfirst, hlast j i i j, neg_neg] |
| 108 | fin_cases i <;> fin_cases j <;> |
| 109 | simp [curvatureMatrix, Matrix.trace, Fin.sum_univ_succ, pairFirst, pairSecond, |
| 110 | hdiagFirst, hdiagLast] |
| 111 | · linarith [hswap 0 2] |
| 112 | · linarith [hfirst 0 2 1 2, hpair 2 0 1 2] |
| 113 | · linarith [hlast 0 1 2 1, hpair 0 1 1 2] |
| 114 | · linarith [hlast 1 2 0 2, hpair 1 2 2 0] |
| 115 | · linarith [hswap 1 0] |
| 116 | · linarith [hfirst 1 0 2 0, hpair 0 1 2 0] |
| 117 | · linarith [hfirst 2 1 0 1, hpair 1 2 0 1] |
| 118 | · linarith [hlast 2 0 1 0, hpair 2 0 0 1] |
| 119 | · linarith [hswap 2 1] |
| 120 | |
| 121 | end Poincare.Geometry.Curvature.Operator |
| 122 | |
| 123 | namespace PoincareMT.LeviCivitaData |
| 124 | |
| 125 | variable {M : Type u} [TopologicalSpace M] |
| 126 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 127 | {g : RiemannianMetric 3 M} |
| 128 | |
| 129 | private instance ricciComplementThreeFiniteDimensional (x : M) : |
| 130 | FiniteDimensional ℝ (TangentSpace (𝓡 3) x) := by |
| 131 | unfold TangentSpace |
| 132 | infer_instance |
| 133 | |
| 134 | private theorem complement_curvature_skew_first (D : LeviCivitaData g) |
| 135 | (hD : D.CurvatureTensorCalculus) (x : M) (u v w z : TangentSpace (𝓡 3) x) : |
| 136 | D.curvatureTensor x u v w z = -D.curvatureTensor x v u w z := by |
| 137 | rw [(hD.2.2.2.1 x u v w z).2.1, (hD.2.2.2.1 x w z u v).1, |
| 138 | (hD.2.2.2.1 x w z v u).2.1] |
| 139 | |
| 140 | /-- Ricci contraction in an arbitrary orthonormal three-frame. -/ |
| 141 | theorem ricci_eq_sum_orthonormalBasis [T2Space M] |
| 142 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (x : M) : |
| 143 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 144 | ⟨g.toRiemannianMetric⟩ |
| 145 | ∀ (b : OrthonormalBasis (Fin 3) ℝ (TangentSpace (𝓡 3) x)) |
| 146 | (u v : TangentSpace (𝓡 3) x), |
| 147 | D.ricci x u v = ∑ p, D.curvatureTensor x u (b p) v (b p) := by |
| 148 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 149 | ⟨g.toRiemannianMetric⟩ |
| 150 | intro b u v |
| 151 | have hswap (a c : TangentSpace (𝓡 3) x) : |
| 152 | D.curvatureTensor x u a v c = D.curvatureTensor x a u c v := by |
| 153 | rw [complement_curvature_skew_first D hD x, |
| 154 | (hD.2.2.2.1 x a u v c).1, neg_neg] |
| 155 | simp only [ricci, hswap] |
| 156 | exact bilinear_sum_orthonormalBasis_eq |
| 157 | (D.curvatureTensor_bilinear_first_third x u v) (g.orthonormalBasis x) b |
| 158 | |
| 159 | /-- The intrinsic Ricci complement has the cyclic curvature-matrix entries. -/ |
| 160 | theorem ricciComplementTensor_apply_orthonormalBasis [T2Space M] |
| 161 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (x : M) : |
| 162 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 163 | ⟨g.toRiemannianMetric⟩ |
| 164 | ∀ (b : OrthonormalBasis (Fin 3) ℝ (TangentSpace (𝓡 3) x)) (i j : Fin 3), |
| 165 | D.ricciComplementTensor hD x ![b i, b j] = |
| 166 | curvatureMatrix (fun i j k l => D.curvatureTensor x (b i) (b j) (b k) (b l)) i j := by |
| 167 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 168 | ⟨g.toRiemannianMetric⟩ |
| 169 | intro b i j |
| 170 | rw [ricciComplementTensor_apply] |
| 171 | change (D.scalarCurvature x / 2) * inner ℝ (b i) (b j) - D.ricci x (b i) (b j) = _ |
| 172 | rw [b.inner_eq_ite, D.ricci_eq_sum_orthonormalBasis hD x b, |
| 173 | D.scalarCurvature_eq_twice_trace_curvatureOperator hD x b, |
| 174 | curvatureOperator_trace] |
| 175 | rw [mul_div_cancel_left₀ _ (by norm_num : (2 : ℝ) ≠ 0)] |
| 176 | exact (curvatureMatrix_eq_trace_sub_ricci _ |
| 177 | (fun i j k l => complement_curvature_skew_first D hD x (b i) (b j) (b k) (b l)) |
| 178 | (fun i j k l => (hD.2.2.2.1 x (b i) (b j) (b k) (b l)).1) |
| 179 | (fun i j k l => (hD.2.2.2.1 x (b i) (b j) (b k) (b l)).2.1) i j).symm |
| 180 | |
| 181 | /-- The frame-free tensor is the isometric image of the cyclic curvature operator. -/ |
| 182 | theorem ricciComplementTensor_eq_transport_operatorTensor [T2Space M] |
| 183 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (x : M) : |
| 184 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 185 | ⟨g.toRiemannianMetric⟩ |
| 186 | ∀ b : OrthonormalBasis (Fin 3) ℝ (TangentSpace (𝓡 3) x), |
| 187 | D.ricciComplementTensor hD x = TensorFiber.transport b.repr.symm 2 |
| 188 | (TensorFiber.operatorTensor (curvatureOperator |
| 189 | (fun i j k l => D.curvatureTensor x (b i) (b j) (b k) (b l)))) := by |
| 190 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 191 | ⟨g.toRiemannianMetric⟩ |
| 192 | intro b |
| 193 | apply TensorFiber.toMultilinear.injective |
| 194 | apply Module.Basis.ext_multilinear (fun _ => b.toBasis) |
| 195 | intro v |
| 196 | have hv : (fun i => b.toBasis (v i)) = ![b (v 0), b (v 1)] := by |
| 197 | ext i; fin_cases i <;> rfl |
| 198 | simp only [TensorFiber.toMultilinear_apply, hv] |
| 199 | rw [D.ricciComplementTensor_apply_orthonormalBasis hD x b] |
| 200 | simp [TensorFiber.transport_apply, TensorFiber.operatorTensor, |
| 201 | OrthonormalBasis.repr_self, curvatureOperator, Matrix.toLpLin_apply, |
| 202 | EuclideanSpace.inner_single_left, Matrix.mulVec_single, Matrix.col] |
| 203 | |
| 204 | /-- Intrinsic tensor-carrier membership uses exactly the retained scalar and |
| 205 | least-sectional-curvature quantities. -/ |
| 206 | theorem ricciComplementTensor_mem_tensorRegion_iff [T2Space M] |
| 207 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (x : M) |
| 208 | (hn : Module.finrank ℝ (TangentSpace (𝓡 3) x) = 3) |
| 209 | {t : ℝ} (ht : 0 ≤ t) : |
| 210 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 211 | ⟨g.toRiemannianMetric⟩ |
| 212 | D.ricciComplementTensor hD x ∈ tensorRegion hn t ↔ |
| 213 | (D.scalarCurvature x / 2, D.negativeCurvaturePart x) ∈ scalarRegion t := by |
| 214 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 215 | ⟨g.toRiemannianMetric⟩ |
| 216 | let b := (g.orthonormalBasis x).reindex (finCongr hn) |
| 217 | rw [D.ricciComplementTensor_eq_transport_operatorTensor hD x b, |
| 218 | tensorRegion_transport_equiv_iff (by simp) hn b.repr.symm ht, |
| 219 | operatorTensor_mem_tensorRegion] |
| 220 | exact D.curvatureOperator_mem_region_iff hD x t b |
| 221 | |
| 222 | /-- The frozen initial inequalities put the intrinsic scaled tensor in the |
| 223 | fixed Hamilton--Ivey carrier. -/ |
| 224 | theorem scaled_ricciComplementTensor_mem_tensorRegion_of_pinching [T2Space M] |
| 225 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (x : M) |
| 226 | (hn : Module.finrank ℝ (TangentSpace (𝓡 3) x) = 3) |
| 227 | {t : ℝ} (ht : 0 ≤ t) |
| 228 | (htrace : -6 / (1 + 4 * t) ≤ D.scalarCurvature x) |
| 229 | (hlog : 0 < D.negativeCurvaturePart x → |
| 230 | 2 * D.negativeCurvaturePart x * |
| 231 | (Real.log (D.negativeCurvaturePart x) + Real.log (1 + t) - 3) ≤ |
| 232 | D.scalarCurvature x) : |
| 233 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 234 | ⟨g.toRiemannianMetric⟩ |
| 235 | (1 + t) • D.ricciComplementTensor hD x ∈ tensorRegion hn 0 := by |
| 236 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 237 | ⟨g.toRiemannianMetric⟩ |
| 238 | apply (tensorRegion_scale_iff hn ht _).mp |
| 239 | apply (D.ricciComplementTensor_mem_tensorRegion_iff hD x hn ht).mpr |
| 240 | apply PoincareMT.initial_scalar_region_of_pinching ht |
| 241 | · nlinarith [htrace] |
| 242 | · intro hX |
| 243 | nlinarith [hlog hX] |
| 244 | |
| 245 | /-- Preserving the intrinsic scaled tensor gives the frozen logarithmic bound. -/ |
| 246 | theorem logarithmic_pinching_of_scaled_ricciComplementTensor_mem [T2Space M] |
| 247 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (x : M) |
| 248 | (hn : Module.finrank ℝ (TangentSpace (𝓡 3) x) = 3) |
| 249 | {t : ℝ} (ht : 0 ≤ t) : |
| 250 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 251 | ⟨g.toRiemannianMetric⟩ |
| 252 | (1 + t) • D.ricciComplementTensor hD x ∈ tensorRegion hn 0 → |
| 253 | 0 < D.negativeCurvaturePart x → |
| 254 | 2 * D.negativeCurvaturePart x * |
| 255 | (Real.log (D.negativeCurvaturePart x) + Real.log (1 + t) - 3) ≤ |
| 256 | D.scalarCurvature x := by |
| 257 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 258 | ⟨g.toRiemannianMetric⟩ |
| 259 | intro hmem |
| 260 | let b := (g.orthonormalBasis x).reindex (finCongr hn) |
| 261 | apply D.logarithmic_pinching_of_scaled_curvatureOperator_mem hD x ht |
| 262 | b |
| 263 | apply (region_scale_iff _ ht _).mp |
| 264 | apply (D.curvatureOperator_mem_region_iff hD x t b).mpr |
| 265 | exact (D.ricciComplementTensor_mem_tensorRegion_iff hD x hn ht).mp |
| 266 | ((tensorRegion_scale_iff hn ht _).mpr hmem) |
| 267 | |
| 268 | end PoincareMT.LeviCivitaData |