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.Compact.Differential |
| 2 | import PoincareLib.Geometry.RicciFlow.Pinching.CurvatureTensor |
| 3 | import PoincareLib.Geometry.Riemannian.Curvature.ContractedBianchi |
| 4 | import PoincareLib.Geometry.Riemannian.ScalarOperators.Scaling |
| 5 | import PoincareLib.Geometry.Manifold.ContDiff.Constancy |
| 6 | |
| 7 | /-! |
| 8 | # Three-dimensional Einstein roundness |
| 9 | |
| 10 | The contracted Bianchi identity makes the scalar curvature constant when |
| 11 | Ricci equals one third of scalar curvature times the metric. In dimension |
| 12 | three the Ricci complement then identifies every sectional curvature. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle BigOperators |
| 19 | |
| 20 | namespace PoincareMT.LeviCivitaData |
| 21 | |
| 22 | variable {M : Type*} [TopologicalSpace M] [T2Space M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 24 | {g : RiemannianMetric 3 M} |
| 25 | |
| 26 | omit [T2Space M] in |
| 27 | /-- Contracted Bianchi forces the Einstein scalar to be locally constant. -/ |
| 28 | theorem mvfderiv_scalarCurvature_eq_zero_of_three_dimensional_einstein |
| 29 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) |
| 30 | (hEinstein : ∀ x, ∀ v w : TangentSpace (𝓡 3) x, |
| 31 | D.ricci x v w = (D.scalarCurvature x / 3) * g.inner x v w) |
| 32 | (x : M) (v : TangentSpace (𝓡 3) x) : |
| 33 | mvfderiv (𝓡 3) D.scalarCurvature x v = 0 := by |
| 34 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 35 | ⟨g.toRiemannianMetric⟩ |
| 36 | let b := g.orthonormalBasis x |
| 37 | have heq : D.ricciEvaluation = |
| 38 | (fun y w => ((1 / 3 : ℝ) * D.scalarCurvature y) * g.inner y (w 0) (w 1)) := by |
| 39 | funext y w |
| 40 | simp only [ricciEvaluation, hEinstein] |
| 41 | ring |
| 42 | have ha : ContMDiff (𝓡 3) 𝓘(ℝ, ℝ) ∞ |
| 43 | (fun y => (1 / 3 : ℝ) * D.scalarCurvature y) := |
| 44 | contMDiff_const.mul D.contMDiff_scalarCurvature |
| 45 | have hd (i) : mvfderiv (𝓡 3) D.scalarCurvature x (b i) = 0 := by |
| 46 | have h := D.frameRicciDerivative_trace hD x i |
| 47 | change (∑ p, D.covariantTensorDerivative D.ricciEvaluation x ![b p, b i, b p]) = |
| 48 | mvfderiv (𝓡 3) D.scalarCurvature x (b i) / 2 at h |
| 49 | simp_rw [heq, D.covariantTensorDerivative_scalar_mul_metric ha, |
| 50 | PoincareMT.mvfderiv_const_mul] at h |
| 51 | change (∑ p, (1 / 3 : ℝ) * mvfderiv (𝓡 3) D.scalarCurvature x (b p) * |
| 52 | inner ℝ (b i) (b p)) = _ at h |
| 53 | simp only [OrthonormalBasis.inner_eq_ite] at h |
| 54 | simp at h |
| 55 | linarith |
| 56 | have hv := b.toBasis.sum_repr v |
| 57 | rw [← hv, map_sum] |
| 58 | simp only [map_smul, smul_eq_mul] |
| 59 | exact Finset.sum_eq_zero fun i _ => by |
| 60 | change _ * mvfderiv (𝓡 3) D.scalarCurvature x (b i) = 0 |
| 61 | rw [hd, mul_zero] |
| 62 | |
| 63 | /-- Positive Einstein metrics in dimension three have constant positive sectional curvature. -/ |
| 64 | theorem constantPositiveSectionalCurvature_of_three_dimensional_einstein |
| 65 | [PreconnectedSpace M] [Nonempty M] |
| 66 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) |
| 67 | (hEinstein : ∀ x, ∀ v w : TangentSpace (𝓡 3) x, |
| 68 | D.ricci x v w = (D.scalarCurvature x / 3) * g.inner x v w) |
| 69 | (hR : ∀ x, 0 < D.scalarCurvature x) : |
| 70 | ConstantPositiveSectionalCurvature g D := by |
| 71 | obtain ⟨R, hconst⟩ := Poincare.Manifold.exists_eq_const_of_mvfderiv_eq_zero |
| 72 | (fun x => (D.contMDiff_scalarCurvature x).mdifferentiableAt (by simp)) |
| 73 | (D.mvfderiv_scalarCurvature_eq_zero_of_three_dimensional_einstein hD hEinstein) |
| 74 | have hpos : 0 < R := (hconst (Classical.arbitrary M)) ▸ hR (Classical.arbitrary M) |
| 75 | refine ⟨R / 6, div_pos hpos (by norm_num), fun x v w hv hw hvw => ?_⟩ |
| 76 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 77 | ⟨g.toRiemannianMetric⟩ |
| 78 | let : FiniteDimensional ℝ (TangentSpace (𝓡 3) x) := by |
| 79 | unfold TangentSpace |
| 80 | infer_instance |
| 81 | have hvw' : inner ℝ v w = 0 := hvw |
| 82 | have hwv : inner ℝ w v = 0 := by rw [real_inner_comm, hvw'] |
| 83 | have hframe : Orthonormal ℝ (({1, 2} : Set (Fin 3)).domRestrict ![0, v, w]) := by |
| 84 | apply orthonormal_iff_ite.mpr |
| 85 | rintro ⟨i, hi⟩ ⟨j, hj⟩ |
| 86 | have hi' : i = 1 ∨ i = 2 := by simpa only [Set.mem_insert_iff, Set.mem_singleton_iff] using hi |
| 87 | have hj' : j = 1 ∨ j = 2 := by simpa only [Set.mem_insert_iff, Set.mem_singleton_iff] using hj |
| 88 | rcases hi' with rfl | rfl <;> rcases hj' with rfl | rfl |
| 89 | · change inner ℝ v v = 1 |
| 90 | exact hv |
| 91 | · simpa using hvw' |
| 92 | · simpa using hwv |
| 93 | · change inner ℝ w w = 1 |
| 94 | exact hw |
| 95 | obtain ⟨b, hb⟩ := hframe.exists_orthonormalBasis_extension_of_card_eq |
| 96 | (show Module.finrank ℝ (TangentSpace (𝓡 3) x) = Fintype.card (Fin 3) from |
| 97 | finrank_euclideanSpace_fin) |
| 98 | have hb1 : b 1 = v := by simpa using hb 1 (by simp) |
| 99 | have hb2 : b 2 = w := by simpa using hb 2 (by simp) |
| 100 | have h := D.ricciComplementTensor_apply_orthonormalBasis hD x b 0 0 |
| 101 | rw [D.ricciComplementTensor_apply] at h |
| 102 | change (D.scalarCurvature x / 2) * inner ℝ (b 0) (b 0) - |
| 103 | D.ricci x (b 0) (b 0) = _ at h |
| 104 | rw [hEinstein] at h |
| 105 | change (D.scalarCurvature x / 2) * inner ℝ (b 0) (b 0) - |
| 106 | (D.scalarCurvature x / 3) * inner ℝ (b 0) (b 0) = _ at h |
| 107 | simp only [b.inner_eq_ite, if_true] at h |
| 108 | change D.scalarCurvature x / 2 * 1 - D.scalarCurvature x / 3 * 1 = |
| 109 | D.curvatureTensor x (b 1) (b 2) (b 1) (b 2) at h |
| 110 | rw [hb1, hb2, hconst] at h |
| 111 | simp only [sectionalCurvature, hv, hw, hvw] |
| 112 | norm_num |
| 113 | linarith |
| 114 | |
| 115 | end PoincareMT.LeviCivitaData |