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.ThreeDimensional.Splitting.NullPlane |
| 2 | import PoincareLib.Geometry.RicciFlow.Pinching.CurvatureTensor |
| 3 | import PoincareLib.Geometry.RicciFlow.Splitting.CurvatureNullity |
| 4 | import PoincareLib.Geometry.RicciFlow.Splitting.MaximumPrinciple.RicciPropagation |
| 5 | import PoincareLib.Geometry.RicciFlow.Harnack.Regularity |
| 6 | |
| 7 | /-! |
| 8 | # A Ricci-null direction from the three-dimensional reaction |
| 9 | |
| 10 | At a null coordinate plane the curvature reaction is twice the determinant |
| 11 | of the remaining two-by-two curvature block. Nonpositivity of this reaction |
| 12 | produces a nonzero Ricci-null vector. |
| 13 | |
| 14 | Reference: Morgan--Tian, Claim 9.45, pp. 208--209. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set |
| 21 | open scoped Manifold ContDiff Bundle BigOperators |
| 22 | open Poincare.Geometry.Curvature.Operator |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.LeviCivitaData |
| 27 | |
| 28 | variable {M : Type u} [TopologicalSpace M] [T2Space M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 30 | {g : RiemannianMetric 3 M} |
| 31 | |
| 32 | /-- In a frame containing a null plane, a nonpositive curvature reaction |
| 33 | forces a nontrivial kernel of Ricci. -/ |
| 34 | theorem exists_ricci_null_vector_of_null_frame_plane |
| 35 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) |
| 36 | (x : M) (hsec : ∀ u z : TangentSpace (𝓡 3) x, |
| 37 | 0 ≤ D.curvatureTensor x u z u z) : |
| 38 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 39 | ⟨g.toRiemannianMetric⟩ |
| 40 | ∀ (b : OrthonormalBasis (Fin 3) ℝ (TangentSpace (𝓡 3) x)), |
| 41 | D.curvatureTensor x (b 1) (b 2) (b 1) (b 2) = 0 → |
| 42 | D.curvatureReaction x (b 1) (b 2) (b 1) (b 2) ≤ 0 → |
| 43 | ∃ v : TangentSpace (𝓡 3) x, v ≠ 0 ∧ ∀ w, D.ricci x v w = 0 := by |
| 44 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 45 | ⟨g.toRiemannianMetric⟩ |
| 46 | intro b hzero hreaction |
| 47 | let R := fun i j k l => D.curvatureTensor x (b i) (b j) (b k) (b l) |
| 48 | let A := curvatureMatrix R |
| 49 | have hA (i j) : A i j = R (pairFirst i) (pairSecond i) |
| 50 | (pairFirst j) (pairSecond j) := rfl |
| 51 | have hsym (i j) : A i j = A j i := (hD.2.2.2.1 x _ _ _ _).2.1 |
| 52 | have h00 : A 0 0 = 0 := hzero |
| 53 | have h01 : A 0 1 = 0 := by |
| 54 | change D.curvatureTensor x (b 1) (b 2) (b 2) (b 0) = 0 |
| 55 | rw [D.curvatureTensor_swap_last, (hD.2.2.2.1 x (b 1) (b 2) (b 0) (b 2)).2.1] |
| 56 | rw [D.curvatureTensor_radial_eq_zero_of_null_plane hD x hsec hzero, neg_zero] |
| 57 | have h02 : A 0 2 = 0 := by |
| 58 | have hz : D.curvatureTensor x (b 2) (b 1) (b 2) (b 1) = 0 := by |
| 59 | rw [D.curvatureTensor_swap_first, D.curvatureTensor_swap_last, neg_neg, hzero] |
| 60 | change D.curvatureTensor x (b 1) (b 2) (b 0) (b 1) = 0 |
| 61 | rw [D.curvatureTensor_swap_first, (hD.2.2.2.1 x (b 2) (b 1) (b 0) (b 1)).2.1] |
| 62 | rw [D.curvatureTensor_radial_eq_zero_of_null_plane hD x hsec hz, neg_zero] |
| 63 | have hreact : Poincare.Geometry.Curvature.Operator.curvatureReaction A 0 0 ≤ 0 := by |
| 64 | rw [← D.curvatureB_cyclic_reaction hD x b 0 0] |
| 65 | exact (D.curvatureReaction_null_plane_eq_curvatureB hD x hsec hzero) ▸ hreaction |
| 66 | have hdet : A 1 1 * A 2 2 - A 1 2 ^ 2 ≤ 0 := by |
| 67 | simp only [Poincare.Geometry.Curvature.Operator.curvatureReaction, |
| 68 | Matrix.smul_apply, Matrix.add_apply, smul_eq_mul, Matrix.mul_apply, |
| 69 | Fin.sum_univ_three, h00, h01, h02, zero_mul, zero_add, |
| 70 | Matrix.adjugate_fin_three] at hreact |
| 71 | change 2 * (A 1 1 * A 2 2 - A 1 2 * A 2 1) ≤ 0 at hreact |
| 72 | rw [hsym 2 1] at hreact |
| 73 | nlinarith |
| 74 | have hRic (v : TangentSpace (𝓡 3) x) : 0 ≤ D.ricci x v v := |
| 75 | Finset.sum_nonneg fun i _ => hsec v (g.orthonormalBasis x i) |
| 76 | have hdiag (i j) : D.ricci x (b i) (b j) = |
| 77 | (D.scalarCurvature x / 2) * (if i = j then 1 else 0) - A i j := by |
| 78 | have h := D.ricciComplementTensor_apply_orthonormalBasis hD x b i j |
| 79 | rw [D.ricciComplementTensor_apply] at h |
| 80 | change (D.scalarCurvature x / 2) * inner ℝ (b i) (b j) - |
| 81 | D.ricci x (b i) (b j) = A i j at h |
| 82 | rw [b.inner_eq_ite] at h |
| 83 | linarith |
| 84 | have htrace : D.scalarCurvature x / 2 = A 1 1 + A 2 2 := by |
| 85 | rw [D.scalarCurvature_eq_twice_trace_curvatureOperator hD x b, |
| 86 | curvatureOperator_trace] |
| 87 | change 2 * Matrix.trace A / 2 = _ |
| 88 | simp only [Matrix.trace, Fin.sum_univ_three, Matrix.diag_apply, h00] |
| 89 | ring |
| 90 | have h11 : D.ricci x (b 1) (b 1) = A 2 2 := by rw [hdiag, htrace]; norm_num |
| 91 | have h22 : D.ricci x (b 2) (b 2) = A 1 1 := by rw [hdiag, htrace]; norm_num |
| 92 | have h12 : D.ricci x (b 1) (b 2) = -A 1 2 := by |
| 93 | rw [hdiag, if_neg (by decide : (1 : Fin 3) ≠ 2), mul_zero, zero_sub] |
| 94 | have h21 : D.ricci x (b 2) (b 1) = -A 1 2 := by |
| 95 | rw [(hD.2.2.2.1 x (b 2) (b 1) (b 2) (b 1)).2.2.2, h12] |
| 96 | by_cases hA11 : A 1 1 = 0 |
| 97 | · refine ⟨b 2, b.orthonormal.ne_zero 2, ?_⟩ |
| 98 | exact PoincareMT.RicciFlow.Splitting.ricci_eq_zero_of_nonneg_of_self_eq_zero |
| 99 | D hD x hRic (h22.trans hA11) |
| 100 | · let v := (A 1 1) • b 1 + (A 1 2) • b 2 |
| 101 | have hv : v ≠ 0 := by |
| 102 | intro hz |
| 103 | have h := congrArg (fun z => inner ℝ z (b 1)) hz |
| 104 | simp only [v, inner_add_left, real_inner_smul_left, b.inner_eq_ite] at h |
| 105 | simp only [ite_true, if_neg (by decide : (2 : Fin 3) ≠ 1), |
| 106 | mul_one, mul_zero, add_zero, inner_zero_left] at h |
| 107 | exact hA11 h |
| 108 | have hvalue : D.ricci x v v = A 1 1 * (A 1 1 * A 2 2 - A 1 2 ^ 2) := by |
| 109 | let B : LinearMap.BilinForm ℝ (TangentSpace (𝓡 3) x) := |
| 110 | ∑ i, D.curvatureTensor_bilinear_first_third x |
| 111 | (g.orthonormalBasis x i) (g.orthonormalBasis x i) |
| 112 | have hB (u w) : B u w = D.ricci x u w := by |
| 113 | simp [B, LeviCivitaData.ricci, LinearMap.sum_apply] |
| 114 | rw [← hB] |
| 115 | simp only [v, map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply, |
| 116 | smul_eq_mul, hB, h11, h22, h12, h21] |
| 117 | ring |
| 118 | have hnull : D.ricci x v v = 0 := by |
| 119 | apply le_antisymm _ (hRic v) |
| 120 | rw [hvalue] |
| 121 | exact mul_nonpos_of_nonneg_of_nonpos (h22 ▸ hRic (b 2)) hdet |
| 122 | exact ⟨v, hv, PoincareMT.RicciFlow.Splitting.ricci_eq_zero_of_nonneg_of_self_eq_zero |
| 123 | D hD x hRic hnull⟩ |
| 124 | |
| 125 | end PoincareMT.LeviCivitaData |
| 126 | |
| 127 | namespace PoincareMT.RicciFlow |
| 128 | |
| 129 | /-- Every genuine null sectional plane on a three-dimensional ancient |
| 130 | nonnegatively curved flow gives a nonzero Ricci-null direction. -/ |
| 131 | theorem exists_ricci_null_vector_of_terminal_null_plane |
| 132 | {M : Type u} [TopologicalSpace M] [T2Space M] |
| 133 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 134 | (hC : RicciFlowCurvatureTheory.{u}) (F : RicciFlow 3 M (Iic 0)) |
| 135 | (hoperator : ∀ t ≤ 0, ∀ x, (F.connection t).NonnegativeCurvatureOperator x) |
| 136 | (x : M) (v w : TangentSpace (𝓡 3) x) |
| 137 | (hv : (F.metric 0).inner x v v = 1) |
| 138 | (hw : (F.metric 0).inner x w w = 1) |
| 139 | (hvw : (F.metric 0).inner x v w = 0) |
| 140 | (hzero : (F.connection 0).curvatureTensor x v w v w = 0) : |
| 141 | ∃ z : TangentSpace (𝓡 3) x, z ≠ 0 ∧ ∀ u, (F.connection 0).ricci x z u = 0 := by |
| 142 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 143 | ⟨(F.metric 0).toRiemannianMetric⟩ |
| 144 | let : FiniteDimensional ℝ (TangentSpace (𝓡 3) x) := by |
| 145 | unfold TangentSpace |
| 146 | infer_instance |
| 147 | have hvw' : inner ℝ v w = 0 := hvw |
| 148 | have hwv : inner ℝ w v = 0 := by rw [real_inner_comm, hvw'] |
| 149 | have hframe : Orthonormal ℝ (({1, 2} : Set (Fin 3)).domRestrict ![0, v, w]) := by |
| 150 | apply orthonormal_iff_ite.mpr |
| 151 | rintro ⟨i, hi⟩ ⟨j, hj⟩ |
| 152 | have hi' : i = 1 ∨ i = 2 := by simpa only [Set.mem_insert_iff, Set.mem_singleton_iff] using hi |
| 153 | have hj' : j = 1 ∨ j = 2 := by simpa only [Set.mem_insert_iff, Set.mem_singleton_iff] using hj |
| 154 | rcases hi' with rfl | rfl <;> rcases hj' with rfl | rfl |
| 155 | · change inner ℝ v v = 1 |
| 156 | exact hv |
| 157 | · simpa using hvw' |
| 158 | · simpa using hwv |
| 159 | · change inner ℝ w w = 1 |
| 160 | exact hw |
| 161 | obtain ⟨b, hb⟩ := hframe.exists_orthonormalBasis_extension_of_card_eq |
| 162 | (show Module.finrank ℝ (TangentSpace (𝓡 3) x) = Fintype.card (Fin 3) from |
| 163 | finrank_euclideanSpace_fin) |
| 164 | have hb1 : b 1 = v := by simpa using hb 1 (by simp) |
| 165 | have hb2 : b 2 = w := by simpa using hb 2 (by simp) |
| 166 | have hD := hC.tensor_calculus 3 M (F.metric 0) (F.connection 0) |
| 167 | apply (F.connection 0).exists_ricci_null_vector_of_null_frame_plane hD x |
| 168 | (fun u z => (F.connection 0).curvatureTensor_self_nonneg_of_nonnegative_curvatureOperator |
| 169 | x (hoperator 0 le_rfl x) u z) b |
| 170 | · simpa only [hb1, hb2] using hzero |
| 171 | · simpa only [hb1, hb2] using |
| 172 | F.curvatureReaction_nonpos_on_terminal_null_plane hC hoperator x v w hzero |
| 173 | |
| 174 | /-- A terminal null sectional plane forces a nonzero Ricci kernel at |
| 175 | every point of every earlier slice, using the actual ancient flow. -/ |
| 176 | theorem exists_ricci_null_vector_on_past_of_terminal_null_plane |
| 177 | {M : Type u} [TopologicalSpace M] [T2Space M] [ConnectedSpace M] |
| 178 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 179 | (hC : RicciFlowCurvatureTheory.{u}) (F : RicciFlow 3 M (Iic 0)) |
| 180 | (hoperator : ∀ t ≤ 0, ∀ x, (F.connection t).NonnegativeCurvatureOperator x) |
| 181 | (x : M) (v w : TangentSpace (𝓡 3) x) |
| 182 | (hv : (F.metric 0).inner x v v = 1) |
| 183 | (hw : (F.metric 0).inner x w w = 1) |
| 184 | (hvw : (F.metric 0).inner x v w = 0) |
| 185 | (hzero : (F.connection 0).curvatureTensor x v w v w = 0) : |
| 186 | ∀ t ≤ 0, ∀ y : M, ∃ z : TangentSpace (𝓡 3) y, |
| 187 | z ≠ 0 ∧ ∀ u, (F.connection t).ricci y z u = 0 := by |
| 188 | obtain ⟨z, hz, hzn⟩ := F.exists_ricci_null_vector_of_terminal_null_plane |
| 189 | hC hoperator x v w hv hw hvw hzero |
| 190 | have hpos : 0 < Splitting.ricciNullity (F.connection 0) x := by |
| 191 | apply Module.finrank_pos_iff_exists_ne_zero.mpr |
| 192 | refine ⟨⟨z, (Splitting.mem_ricciKernel _ _ _).mpr hzn⟩, ?_⟩ |
| 193 | intro heq |
| 194 | exact hz (congrArg Subtype.val heq) |
| 195 | intro t ht y |
| 196 | have hab : t - 1 < (0 : ℝ) := by linarith |
| 197 | let G := Poincare.Geometry.RicciFlow.Harnack.restrictFlow F |
| 198 | (show Icc (t - 1) 0 ⊆ Iic (0 : ℝ) from fun _ hs => hs.2) ordConnected_Icc |
| 199 | ⟨t - 1, left_mem_Icc.mpr hab.le, 0, right_mem_Icc.mpr hab.le, hab.ne⟩ |
| 200 | have hsec : ∀ s ∈ Icc (t - 1) 0, (G.connection s).NonnegativeSectionalCurvature := by |
| 201 | intro s hs p a b |
| 202 | exact (F.connection s).curvatureTensor_self_nonneg_of_nonnegative_curvatureOperator |
| 203 | p (hoperator s hs.2 p) a b |
| 204 | have hpast := Splitting.ricciNullity_antitoneOn hC hab G hsec x |
| 205 | (show t ∈ Icc (t - 1) 0 from ⟨by linarith, ht⟩) |
| 206 | (right_mem_Icc.mpr hab.le) ht |
| 207 | have hspace := Splitting.ricciNullity_eq_on_positive_slice hC hab G hsec |
| 208 | (show t ∈ Ioc (t - 1) 0 from ⟨by linarith, ht⟩) x y |
| 209 | have hposy : 0 < Splitting.ricciNullity (F.connection t) y := by |
| 210 | change 0 < Splitting.ricciNullity (G.connection t) y |
| 211 | rw [← hspace] |
| 212 | exact hpos.trans_le hpast |
| 213 | obtain ⟨z, hz⟩ := Module.finrank_pos_iff_exists_ne_zero.mp hposy |
| 214 | refine ⟨z, ?_, (Splitting.mem_ricciKernel _ _ _).mp z.property⟩ |
| 215 | intro heq |
| 216 | exact hz (Subtype.ext heq) |
| 217 | |
| 218 | end PoincareMT.RicciFlow |