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.Compact.RicciSpectrum |
| 2 | |
| 3 | /-! |
| 4 | # Pointwise algebra for the positive weighted Ricci estimate |
| 5 | |
| 6 | The spectral bridge retains the least-eigenvector evaluation needed to |
| 7 | apply the shared Hamilton quartic estimate to the actual Ricci tensor. |
| 8 | The final real inequality combines tensor Kato with the critical-point |
| 9 | identity for `(S - R^2/3) / R^p`. These are the weighted pinching steps in |
| 10 | Morgan--Tian, Theorem 4.23, pp. 74-75. The independently reviewed derivation |
| 11 | is in `proof-work/tasks/M47/derivations/positive-pinching.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- Matrix and metric-fiber formulations use the same underlying tangent space. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle BigOperators |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M47Positive |
| 23 | |
| 24 | variable {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 26 | [T2Space M] {g : RiemannianMetric 3 M} |
| 27 | |
| 28 | /-- The actual metric Ricci spectrum retains its unit-vector lower bound. |
| 29 | This supplements the shared intrinsic spectrum proof with the least |
| 30 | eigenvector evaluation used in Morgan--Tian, Theorem 4.23, pp. 74-75. -/ |
| 31 | theorem exists_pinched_ricci_spectrum (D : LeviCivitaData g) |
| 32 | (hD : D.CurvatureTensorCalculus) (x : M) {delta : ℝ} |
| 33 | (hpinch : ∀ v : TangentSpace (𝓡 3) x, g.inner x v v = 1 → |
| 34 | delta * D.scalarCurvature x ≤ D.ricci x v v) : |
| 35 | ∃ a b c : ℝ, b ≤ a ∧ c ≤ b ∧ delta * D.scalarCurvature x ≤ c ∧ |
| 36 | D.scalarCurvature x = a + b + c ∧ D.ricciNormSq x = a ^ 2 + b ^ 2 + c ^ 2 ∧ |
| 37 | (∑ i, ∑ j, ∑ k, |
| 38 | D.ricci x (g.orthonormalBasis x i) (g.orthonormalBasis x j) * |
| 39 | D.ricci x (g.orthonormalBasis x j) (g.orthonormalBasis x k) * |
| 40 | D.ricci x (g.orthonormalBasis x k) (g.orthonormalBasis x i)) = |
| 41 | a ^ 3 + b ^ 3 + c ^ 3 := by |
| 42 | classical |
| 43 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 44 | ⟨g.toRiemannianMetric⟩ |
| 45 | let b := g.orthonormalBasis x |
| 46 | let C : Matrix _ _ ℝ := fun i j => D.ricci x (b i) (b j) |
| 47 | let T : TangentSpace (𝓡 3) x →ₗ[ℝ] TangentSpace (𝓡 3) x := |
| 48 | C.toLin b.toBasis b.toBasis |
| 49 | have hsym (i j) : C i j = C j i := |
| 50 | (hD.2.2.2.1 x (b i) (b j) (b i) (b j)).2.2.2 |
| 51 | have hT : T.IsSymmetric := (Matrix.isSymmetric_toLin_iff b).mpr (by |
| 52 | ext i j |
| 53 | exact hsym j i) |
| 54 | have hd : Module.finrank ℝ (TangentSpace (𝓡 3) x) = 3 := by |
| 55 | rw [VectorBundle.finrank_eq ℝ (EuclideanSpace ℝ (Fin 3)), finrank_euclideanSpace] |
| 56 | simp |
| 57 | let e := hT.eigenvalues hd |
| 58 | let v := hT.eigenvectorBasis hd |
| 59 | have hentry (i j) : inner ℝ (b i) (T (b j)) = C i j := by |
| 60 | have hm : LinearMap.toMatrix b.toBasis b.toBasis T = C := |
| 61 | LinearMap.toMatrix_toLin b.toBasis b.toBasis C |
| 62 | simpa only [LinearMap.toMatrix_apply, OrthonormalBasis.coe_toBasis, |
| 63 | OrthonormalBasis.coe_toBasis_repr_apply, OrthonormalBasis.repr_apply_apply] using |
| 64 | congrFun (congrFun hm i) j |
| 65 | have hform (v w : TangentSpace (𝓡 3) x) : inner ℝ v (T w) = D.ricci x v w := by |
| 66 | rw [D.ricci_eq_sum_frame x v w] |
| 67 | conv_lhs => rw [← b.sum_repr' v, ← b.sum_repr' w] |
| 68 | simp only [map_sum, map_smul, inner_sum, sum_inner, |
| 69 | real_inner_smul_left, real_inner_smul_right, hentry] |
| 70 | rw [Finset.sum_comm] |
| 71 | apply Finset.sum_congr rfl |
| 72 | intro i _ |
| 73 | apply Finset.sum_congr rfl |
| 74 | intro j _ |
| 75 | change _ = C i j * inner ℝ (b i) v * inner ℝ (b j) w |
| 76 | ring |
| 77 | have hleast : delta * D.scalarCurvature x ≤ e 2 := by |
| 78 | have hunit : g.inner x (v 2) (v 2) = 1 := by |
| 79 | change inner ℝ (v 2) (v 2) = 1 |
| 80 | simp only [v, OrthonormalBasis.inner_eq_ite, if_true] |
| 81 | have h := hpinch (v 2) hunit |
| 82 | rw [← hform, hT.apply_eigenvectorBasis hd] at h |
| 83 | simpa [v, e, real_inner_smul_right, OrthonormalBasis.inner_eq_ite] using h |
| 84 | have htrace (k : ℕ) : Matrix.trace (C ^ k) = ∑ i, (e i) ^ k := by |
| 85 | have hm : LinearMap.toMatrix b.toBasis b.toBasis T = C := |
| 86 | LinearMap.toMatrix_toLin b.toBasis b.toBasis C |
| 87 | rw [← hm, LinearMap.toMatrix_pow, |
| 88 | ← LinearMap.trace_eq_matrix_trace ℝ b.toBasis, |
| 89 | LinearMap.trace_eq_matrix_trace ℝ v.toBasis, |
| 90 | ← LinearMap.toMatrix_pow, hT.toMatrix_eigenvectorBasis hd, |
| 91 | Matrix.diagonal_pow, Matrix.trace_diagonal] |
| 92 | rfl |
| 93 | refine ⟨e 0, e 1, e 2, hT.eigenvalues_antitone hd (by decide), |
| 94 | hT.eigenvalues_antitone hd (by decide), hleast, ?_, ?_, ?_⟩ |
| 95 | · simpa only [pow_one, Matrix.trace, Matrix.diag_apply, C, b, |
| 96 | Fin.sum_univ_three, LeviCivitaData.scalarCurvature] using htrace 1 |
| 97 | · have h := htrace 2 |
| 98 | simp only [pow_two, Matrix.trace, Matrix.diag_apply, Matrix.mul_apply] at h |
| 99 | simp_rw [hsym] at h |
| 100 | simpa only [C, b, ← pow_two, Fin.sum_univ_three, LeviCivitaData.ricciNormSq] using h |
| 101 | · have h := htrace 3 |
| 102 | have hcubic : Matrix.trace (C ^ 3) = ∑ i, ∑ j, ∑ k, C i j * C j k * C k i := by |
| 103 | rw [show C ^ 3 = C * C * C by noncomm_ring] |
| 104 | simp only [Matrix.trace, Matrix.diag_apply, Matrix.mul_apply, Finset.sum_mul] |
| 105 | apply Finset.sum_congr rfl |
| 106 | intro i _ |
| 107 | exact Finset.sum_comm |
| 108 | rw [hcubic] at h |
| 109 | simpa only [C, b, Fin.sum_univ_three] using h |
| 110 | |
| 111 | /-- Hamilton's shared quartic inequality applies to the actual Ricci |
| 112 | contraction once the metric-unit Ricci lower ratio is known; this is the |
| 113 | reaction estimate in Morgan--Tian, Theorem 4.23, pp. 74-75. -/ |
| 114 | theorem weighted_ricci_reaction_nonpos (D : LeviCivitaData g) |
| 115 | (hD : D.CurvatureTensorCalculus) (x : M) {delta epsilon : ℝ} |
| 116 | (hdelta : 0 ≤ delta) (hR : 0 < D.scalarCurvature x) |
| 117 | (hpinch : ∀ v : TangentSpace (𝓡 3) x, g.inner x v v = 1 → |
| 118 | delta * D.scalarCurvature x ≤ D.ricci x v v) |
| 119 | (hepsilon : epsilon ≤ 2 * delta ^ 2) : |
| 120 | epsilon * D.ricciNormSq x * (D.ricciNormSq x - D.scalarCurvature x ^ 2 / 3) - |
| 121 | (2 * D.ricciNormSq x ^ 2 - 2 * D.scalarCurvature x * |
| 122 | (∑ i, ∑ j, D.ricci x (g.orthonormalBasis x i) (g.orthonormalBasis x j) * |
| 123 | (∑ a, ∑ c, D.curvatureTensor x (g.orthonormalBasis x i) |
| 124 | (g.orthonormalBasis x a) (g.orthonormalBasis x j) (g.orthonormalBasis x c) * |
| 125 | D.ricci x (g.orthonormalBasis x a) (g.orthonormalBasis x c)))) ≤ 0 := by |
| 126 | obtain ⟨a, b, c, hab, hbc, hleast, hscalar, hnorm, hcube⟩ := |
| 127 | exists_pinched_ricci_spectrum D hD x hpinch |
| 128 | have hc : 0 ≤ c := (mul_nonneg hdelta hR.le).trans hleast |
| 129 | have hp : delta * Poincare.ThreeDimensionalRicciPinching.scalar a b c ≤ c := by |
| 130 | simpa only [Poincare.ThreeDimensionalRicciPinching.scalar, ← hscalar] using hleast |
| 131 | have h := Poincare.ThreeDimensionalRicciPinching.weighted_reaction_numerator_nonpos |
| 132 | hab hbc hc hdelta hp hepsilon |
| 133 | rw [Poincare.ThreeDimensionalRicciPinching.quartic_eq_contracted_polynomial] at h |
| 134 | rw [D.curvature_ricci_contraction_eq_cubic hD, hscalar, hnorm, hcube] |
| 135 | exact h |
| 136 | |
| 137 | /-- The weighted critical-point Kato remainder is nonpositive for |
| 138 | `1 <= p <= 2`. This real calculation is the gradient part of the weighted |
| 139 | pinching step in Morgan--Tian, Theorem 4.23, pp. 74-75. -/ |
| 140 | theorem weighted_gradient_remainder_nonpos {R S A G p : ℝ} |
| 141 | (hR : 0 < R) (hD : 0 ≤ S - R ^ 2 / 3) (hG : 0 ≤ G) |
| 142 | (hp : 1 ≤ p) (hp' : p ≤ 2) |
| 143 | (hK : (p * (S - R ^ 2 / 3) / R + 2 * R / 3) ^ 2 * G ≤ 4 * S * A) : |
| 144 | -2 * A + (2 / 3 + p * (p - 1) * (S - R ^ 2 / 3) / R ^ 2) * G ≤ 0 := by |
| 145 | have hS : 0 < S := by nlinarith [sq_pos_of_pos hR] |
| 146 | have hid : (p * (S - R ^ 2 / 3) / R + 2 * R / 3) ^ 2 - |
| 147 | 2 * S * (2 / 3 + p * (p - 1) * (S - R ^ 2 / 3) / R ^ 2) = |
| 148 | (2 - p) * (S - R ^ 2 / 3) * |
| 149 | (p * (S - R ^ 2 / 3) / R ^ 2 + (2 / 3) * (p - 1)) := by |
| 150 | field_simp [hR.ne'] |
| 151 | ring |
| 152 | have hsign : 0 ≤ (2 - p) * (S - R ^ 2 / 3) * |
| 153 | (p * (S - R ^ 2 / 3) / R ^ 2 + (2 / 3) * (p - 1)) := by |
| 154 | have hp0 : 0 ≤ p := by linarith |
| 155 | have hp1 : 0 ≤ p - 1 := by linarith |
| 156 | have hp2 : 0 ≤ 2 - p := by linarith |
| 157 | positivity |
| 158 | have hbound := mul_le_mul_of_nonneg_right (sub_nonneg.mp (hid.symm ▸ hsign)) hG |
| 159 | have hmul : (2 * S) * |
| 160 | (-2 * A + (2 / 3 + p * (p - 1) * (S - R ^ 2 / 3) / R ^ 2) * G) ≤ 0 := by |
| 161 | nlinarith only [hbound, hK] |
| 162 | exact nonpos_of_mul_nonpos_right hmul (mul_pos (by norm_num) hS) |
| 163 | |
| 164 | end PoincareMT.M47Positive |