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.Generalized.ReducedGeometry.SourceNames.RicciFlowAnalysis |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.SourceNames.ReducedLength |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Local.HessianTrace |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Index.AdaptedIndexTrace |
| 5 | import PoincareLib.Geometry.RicciFlow.Curvature.Calculus.Identities.SecondBianchi |
| 6 | |
| 7 | /-! |
| 8 | # The adapted index trace on an actual selected metric |
| 9 | |
| 10 | M09's generic tensor contractions and M04's actual second Bianchi |
| 11 | identity give the pointwise trace without an ordinary flow window. |
| 12 | Morgan-Tian Proposition 6.43 and Claim 6.44, pp. 127-129. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- The selected metric renorms the actual tangent fibers used in the trace. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle BigOperators |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M14 |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {g : RiemannianMetric n M} |
| 28 | |
| 29 | /-- Contracted Bianchi in every orthonormal basis of the specified |
| 30 | metric, used in Proposition 6.43, pp. 127-128. -/ |
| 31 | theorem covariantRicci_divergence_orthonormal_trace |
| 32 | (hM04 : RicciFlowCurvatureTheory.{u}) (D : LeviCivitaData g) (q : M) |
| 33 | (A : TangentSpace (𝓡 n) q) {ι : Type*} [Fintype ι] : |
| 34 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 35 | ⟨g.toRiemannianMetric⟩ |
| 36 | ∀ e : OrthonormalBasis ι ℝ (TangentSpace (𝓡 n) q), |
| 37 | (∑ i, ricciDerivativePairing D q (e i) A (e i)) = |
| 38 | mvfderiv (𝓡 n) D.scalarCurvature q A / 2 := by |
| 39 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 40 | ⟨g.toRiemannianMetric⟩ |
| 41 | intro e |
| 42 | rw [Proofs.M09.covariantRicci_divergence_trace_basis_eq hM04 D q A e] |
| 43 | have h := Proofs.M09.scalarCurvature_mvfderiv_of_bianchi hM04 D q |
| 44 | (M04.riemann_second_bianchi D q) A |
| 45 | linarith |
| 46 | |
| 47 | /-- The five diagonal index terms on one specified metric and |
| 48 | connection, Proposition 6.33, pp. 120-121. -/ |
| 49 | noncomputable def sliceIndexDensity (D : LeviCivitaData g) (q : M) (s : ℝ) |
| 50 | (A Y W : TangentSpace (𝓡 n) q) : ℝ := |
| 51 | g.inner q W W + D.curvatureTensor q Y A A Y + |
| 52 | 2 * s ^ 2 * D.hessian D.scalarCurvature q Y Y - |
| 53 | 4 * s * ricciDerivativePairing D q Y A Y + |
| 54 | 2 * s * ricciDerivativePairing D q A Y Y |
| 55 | |
| 56 | /-- Summing the actual adapted index density cancels the two |
| 57 | covariant-Ricci contractions, Proposition 6.43, pp. 127-128. -/ |
| 58 | theorem sliceIndexDensity_adapted_trace (hM04 : RicciFlowCurvatureTheory.{u}) |
| 59 | (D : LeviCivitaData g) (q : M) (s : ℝ) (A : TangentSpace (𝓡 n) q) (f fp : ℝ) : |
| 60 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 61 | ⟨g.toRiemannianMetric⟩ |
| 62 | ∀ e : OrthonormalBasis (Fin n) ℝ (TangentSpace (𝓡 n) q), |
| 63 | (∑ i, sliceIndexDensity D q s A (f • e i) |
| 64 | (fp • e i - (2 * s * f) • Proofs.M09.ricciOperator hM04 D q (e i))) = |
| 65 | (n : ℝ) * fp ^ 2 - 4 * s * f * fp * D.scalarCurvature q + |
| 66 | f ^ 2 * (4 * s ^ 2 * D.ricciNormSq q + |
| 67 | 2 * s ^ 2 * D.laplacian D.scalarCurvature q - D.ricci q A A) := by |
| 68 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 69 | ⟨g.toRiemannianMetric⟩ |
| 70 | intro e |
| 71 | let L := Proofs.M09.ricciOperator hM04 D q |
| 72 | have hf := Proofs.M09.scalarCurvature_contMDiff hM04 D |
| 73 | obtain ⟨H, hH⟩ := hessian_exists_bilinear D D.scalarCurvature q (hf q) |
| 74 | have hHscale (v : TangentSpace (𝓡 n) q) : |
| 75 | D.hessian D.scalarCurvature q (f • v) (f • v) = |
| 76 | f ^ 2 * D.hessian D.scalarCurvature q v v := by |
| 77 | rw [hH, hH] |
| 78 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 79 | ring |
| 80 | have hone (i : Fin n) : g.inner q (e i) (e i) = 1 := e.inner_eq_one i |
| 81 | have hnorm (i : Fin n) : |
| 82 | g.inner q (fp • e i - (2 * s * f) • L (e i)) |
| 83 | (fp • e i - (2 * s * f) • L (e i)) = |
| 84 | fp ^ 2 - 4 * s * f * fp * D.ricci q (e i) (e i) + |
| 85 | 4 * s ^ 2 * f ^ 2 * g.inner q (L (e i)) (L (e i)) := by |
| 86 | have hsym : g.inner q (e i) (L (e i)) = g.inner q (L (e i)) (e i) := g.symm q _ _ |
| 87 | simp only [map_sub, sub_apply, map_smul, smul_apply, smul_eq_mul, hone, hsym, |
| 88 | Proofs.M09.ricciOperator_pairing, L] |
| 89 | ring |
| 90 | have hRic := Proofs.M09.ricci_orthonormal_trace hM04 D q e |
| 91 | have hSquare := Proofs.M09.ricciOperator_orthonormal_square hM04 D q e |
| 92 | have hR := Proofs.M09.curvature_orthonormal_index_trace hM04 D q A e |
| 93 | have hHtrace := laplacian_eq_orthonormal_hessian_trace D D.scalarCurvature q (hf q) e |
| 94 | have hDiv := covariantRicci_divergence_orthonormal_trace hM04 D q A e |
| 95 | have hDir := Proofs.M09.covariantRicci_direction_orthonormal_trace hM04 D q A e |
| 96 | unfold sliceIndexDensity |
| 97 | change (∑ i, (g.inner q (fp • e i - (2 * s * f) • L (e i)) |
| 98 | (fp • e i - (2 * s * f) • L (e i)) + D.curvatureTensor q (f • e i) A A (f • e i) + |
| 99 | 2 * s ^ 2 * D.hessian D.scalarCurvature q (f • e i) (f • e i) - |
| 100 | 4 * s * ricciDerivativePairing D q (f • e i) A (f • e i) + |
| 101 | 2 * s * ricciDerivativePairing D q A (f • e i) (f • e i))) = _ |
| 102 | simp_rw [hnorm, Proofs.M09.curvature_index_smul hM04 D, hHscale, |
| 103 | Proofs.M09.ricciDerivative_smul_first_third hM04 D, |
| 104 | Proofs.M09.ricciDerivative_smul_last_two hM04 D] |
| 105 | simp only [Finset.sum_add_distrib, Finset.sum_sub_distrib, ← Finset.mul_sum, |
| 106 | Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] |
| 107 | rw [hRic, hSquare, hR, ← hHtrace, hDiv, hDir] |
| 108 | ring |
| 109 | |
| 110 | /-- The same trace applies to any supplied vectors characterized by |
| 111 | their actual adapted metric pairings, Proposition 6.43, pp. 127-128. -/ |
| 112 | theorem sliceIndexDensity_adapted_trace_of_pair (hM04 : RicciFlowCurvatureTheory.{u}) |
| 113 | (D : LeviCivitaData g) (q : M) (s : ℝ) (A : TangentSpace (𝓡 n) q) (f fp : ℝ) : |
| 114 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 115 | ⟨g.toRiemannianMetric⟩ |
| 116 | ∀ (e : OrthonormalBasis (Fin n) ℝ (TangentSpace (𝓡 n) q)) |
| 117 | (W : Fin n → TangentSpace (𝓡 n) q), |
| 118 | (∀ i v, g.inner q (W i) v = fp * g.inner q (e i) v - |
| 119 | 2 * s * f * D.ricci q (e i) v) → |
| 120 | (∑ i, sliceIndexDensity D q s A (f • e i) (W i)) = |
| 121 | (n : ℝ) * fp ^ 2 - 4 * s * f * fp * D.scalarCurvature q + |
| 122 | f ^ 2 * (4 * s ^ 2 * D.ricciNormSq q + |
| 123 | 2 * s ^ 2 * D.laplacian D.scalarCurvature q - D.ricci q A A) := by |
| 124 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 125 | ⟨g.toRiemannianMetric⟩ |
| 126 | intro e W hW |
| 127 | have heq (i : Fin n) : |
| 128 | W i = fp • e i - (2 * s * f) • Proofs.M09.ricciOperator hM04 D q (e i) := by |
| 129 | apply ext_inner_right ℝ |
| 130 | intro v |
| 131 | change g.inner q (W i) v = _ |
| 132 | simp only [hW, inner_sub_left, real_inner_smul_left] |
| 133 | exact congrArg (fun r => fp * g.inner q (e i) v - 2 * s * f * r) |
| 134 | (Proofs.M09.ricciOperator_pairing hM04 D q (e i) v).symm |
| 135 | simp_rw [heq] |
| 136 | exact sliceIndexDensity_adapted_trace hM04 D q s A f fp e |
| 137 | |
| 138 | end PoincareMT.M14 |