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.Harnack.Matrix.Tensors |
| 2 | import PoincareLib.Geometry.Riemannian.Curvature.ContractedBianchi |
| 3 | import PoincareLib.Geometry.Riemannian.Curvature.Derivative |
| 4 | |
| 5 | /-! |
| 6 | # Antisymmetrization in the Hamilton P evolution calculation |
| 7 | |
| 8 | This is the pointwise algebraic step in Chow--Chu--Glickenstein--Guenther-- |
| 9 | Isenberg--Ivey--Knopf--Lu--Luo--Ni, Part II, Lemma 15.18, (15.45), printed |
| 10 | pp. 273--274 (PDF pp. 300--301). The source curvature convention is obtained |
| 11 | by retaining `LeviCivitaData.curvatureTensor` in its native order. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle BigOperators Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace Poincare.RicciFlow.Harnack |
| 21 | |
| 22 | open PoincareMT |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | {g : RiemannianMetric n M} |
| 27 | |
| 28 | /-- The four-term pointwise quantity before antisymmetrizing the first two |
| 29 | slots in Hamilton's P evolution computation. -/ |
| 30 | noncomputable def hamiltonPPreAntisym (D : LeviCivitaData g) (x : M) |
| 31 | (u v w : TangentSpace (𝓡 n) x) : ℝ := |
| 32 | let b := g.orthonormalBasis x |
| 33 | 2 * ∑ d, ∑ e, |
| 34 | (D.covariantTensorDerivative D.riemannEvaluation x ![u, v, b d, w, b e] * |
| 35 | D.ricci x (b d) (b e) + |
| 36 | D.curvatureTensor x v (b d) w (b e) * |
| 37 | D.covariantTensorDerivative D.ricciEvaluation x ![u, b d, b e] + |
| 38 | D.curvatureTensor x u (b d) v (b e) * |
| 39 | D.covariantTensorDerivative D.ricciEvaluation x ![b d, b e, w] + |
| 40 | D.curvatureTensor x u (b d) w (b e) * |
| 41 | D.covariantTensorDerivative D.ricciEvaluation x ![b d, v, b e]) |
| 42 | |
| 43 | /-- Antisymmetrizing the four terms in `hamiltonPPreAntisym` gives the three |
| 44 | curvature--P contractions and the Ricci-weighted curvature derivative. -/ |
| 45 | lemma hamiltonPPreAntisym_sub_swap |
| 46 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (x : M) |
| 47 | (u v w : TangentSpace (𝓡 n) x) : |
| 48 | hamiltonPPreAntisym D x u v w - hamiltonPPreAntisym D x v u w = |
| 49 | 2 * ∑ d, ∑ e, |
| 50 | (D.curvatureTensor x u (g.orthonormalBasis x d) v (g.orthonormalBasis x e) * |
| 51 | hamiltonP D x (g.orthonormalBasis x d) (g.orthonormalBasis x e) w + |
| 52 | D.curvatureTensor x u (g.orthonormalBasis x d) w (g.orthonormalBasis x e) * |
| 53 | hamiltonP D x (g.orthonormalBasis x d) v (g.orthonormalBasis x e) + |
| 54 | D.curvatureTensor x v (g.orthonormalBasis x d) w (g.orthonormalBasis x e) * |
| 55 | hamiltonP D x u (g.orthonormalBasis x d) (g.orthonormalBasis x e)) - |
| 56 | 2 * ∑ d, ∑ e, |
| 57 | D.ricci x (g.orthonormalBasis x d) (g.orthonormalBasis x e) * |
| 58 | D.covariantTensorDerivative D.riemannEvaluation x |
| 59 | ![g.orthonormalBasis x d, u, v, w, g.orthonormalBasis x e] := by |
| 60 | let b := g.orthonormalBasis x |
| 61 | have hRm₁ (a c d e : TangentSpace (𝓡 n) x) : |
| 62 | D.curvatureTensor x a c d e = -D.curvatureTensor x a c e d := |
| 63 | (hD.2.2.2.1 x a c d e).1 |
| 64 | have hRm₂ (a c d e : TangentSpace (𝓡 n) x) : |
| 65 | D.curvatureTensor x a c d e = D.curvatureTensor x d e a c := |
| 66 | (hD.2.2.2.1 x a c d e).2.1 |
| 67 | have hK₁ (a c d e f : TangentSpace (𝓡 n) x) : |
| 68 | D.covariantTensorDerivative D.riemannEvaluation x ![a, c, d, e, f] = |
| 69 | -D.covariantTensorDerivative D.riemannEvaluation x ![a, d, c, e, f] := |
| 70 | D.covariantTensorDerivative_riemannEvaluation_skew_first hD x a c d e f |
| 71 | have hS (a c d : TangentSpace (𝓡 n) x) : |
| 72 | D.covariantTensorDerivative D.ricciEvaluation x ![a, c, d] = |
| 73 | D.covariantTensorDerivative D.ricciEvaluation x ![a, d, c] := |
| 74 | D.covariantTensorDerivative_ricciEvaluation_symm hD x a c d |
| 75 | have hB (a c d e f : TangentSpace (𝓡 n) x) : |
| 76 | D.covariantTensorDerivative D.riemannEvaluation x ![a, c, d, e, f] + |
| 77 | D.covariantTensorDerivative D.riemannEvaluation x ![c, d, a, e, f] + |
| 78 | D.covariantTensorDerivative D.riemannEvaluation x ![d, a, c, e, f] = 0 := |
| 79 | D.covariantTensorDerivative_curvature_second_bianchi hD x a c d e f |
| 80 | have hpoint (d e : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x))) : |
| 81 | (D.covariantTensorDerivative D.riemannEvaluation x ![u, v, b d, w, b e] * |
| 82 | D.ricci x (b d) (b e) + |
| 83 | D.curvatureTensor x v (b d) w (b e) * |
| 84 | D.covariantTensorDerivative D.ricciEvaluation x ![u, b d, b e] + |
| 85 | D.curvatureTensor x u (b d) v (b e) * |
| 86 | D.covariantTensorDerivative D.ricciEvaluation x ![b d, b e, w] + |
| 87 | D.curvatureTensor x u (b d) w (b e) * |
| 88 | D.covariantTensorDerivative D.ricciEvaluation x ![b d, v, b e]) - |
| 89 | (D.covariantTensorDerivative D.riemannEvaluation x ![v, u, b d, w, b e] * |
| 90 | D.ricci x (b d) (b e) + |
| 91 | D.curvatureTensor x u (b d) w (b e) * |
| 92 | D.covariantTensorDerivative D.ricciEvaluation x ![v, b d, b e] + |
| 93 | D.curvatureTensor x v (b e) u (b d) * |
| 94 | D.covariantTensorDerivative D.ricciEvaluation x ![b e, b d, w] + |
| 95 | D.curvatureTensor x v (b d) w (b e) * |
| 96 | D.covariantTensorDerivative D.ricciEvaluation x ![b d, u, b e]) = |
| 97 | (D.curvatureTensor x u (b d) v (b e) * |
| 98 | hamiltonP D x (b d) (b e) w + |
| 99 | D.curvatureTensor x u (b d) w (b e) * |
| 100 | hamiltonP D x (b d) v (b e) + |
| 101 | D.curvatureTensor x v (b d) w (b e) * |
| 102 | hamiltonP D x u (b d) (b e)) - |
| 103 | D.ricci x (b d) (b e) * |
| 104 | D.covariantTensorDerivative D.riemannEvaluation x ![b d, u, v, w, b e] := by |
| 105 | have hK : |
| 106 | D.covariantTensorDerivative D.riemannEvaluation x ![u, v, b d, w, b e] - |
| 107 | D.covariantTensorDerivative D.riemannEvaluation x ![v, u, b d, w, b e] = |
| 108 | -D.covariantTensorDerivative D.riemannEvaluation x ![b d, u, v, w, b e] := by |
| 109 | have hb := hB u v (b d) w (b e) |
| 110 | rw [hK₁ v (b d) u w (b e)] at hb |
| 111 | linarith |
| 112 | simp only [hamiltonP] |
| 113 | rw [hS, hS, hRm₂, hRm₂, hRm₂, hRm₂, |
| 114 | hRm₂ v (b e) u (b d)] |
| 115 | linear_combination D.ricci x (b d) (b e) * hK |
| 116 | dsimp only [hamiltonPPreAntisym, b] |
| 117 | simp only [Finset.sum_add_distrib] |
| 118 | rw [show (∑ x_1, ∑ x_2, |
| 119 | D.curvatureTensor x v (b x_1) u (b x_2) * |
| 120 | D.covariantTensorDerivative D.ricciEvaluation x ![b x_1, b x_2, w]) = |
| 121 | ∑ x_1, ∑ x_2, |
| 122 | D.curvatureTensor x v (b x_2) u (b x_1) * |
| 123 | D.covariantTensorDerivative D.ricciEvaluation x ![b x_2, b x_1, w] by |
| 124 | rw [Finset.sum_comm]] |
| 125 | simp_rw [← Finset.sum_add_distrib] |
| 126 | have hs : (∑ d, ∑ e, |
| 127 | ((D.covariantTensorDerivative D.riemannEvaluation x ![u, v, b d, w, b e] * |
| 128 | D.ricci x (b d) (b e) + |
| 129 | D.curvatureTensor x v (b d) w (b e) * |
| 130 | D.covariantTensorDerivative D.ricciEvaluation x ![u, b d, b e] + |
| 131 | D.curvatureTensor x u (b d) v (b e) * |
| 132 | D.covariantTensorDerivative D.ricciEvaluation x ![b d, b e, w] + |
| 133 | D.curvatureTensor x u (b d) w (b e) * |
| 134 | D.covariantTensorDerivative D.ricciEvaluation x ![b d, v, b e]) - |
| 135 | (D.covariantTensorDerivative D.riemannEvaluation x ![v, u, b d, w, b e] * |
| 136 | D.ricci x (b d) (b e) + |
| 137 | D.curvatureTensor x u (b d) w (b e) * |
| 138 | D.covariantTensorDerivative D.ricciEvaluation x ![v, b d, b e] + |
| 139 | D.curvatureTensor x v (b e) u (b d) * |
| 140 | D.covariantTensorDerivative D.ricciEvaluation x ![b e, b d, w] + |
| 141 | D.curvatureTensor x v (b d) w (b e) * |
| 142 | D.covariantTensorDerivative D.ricciEvaluation x ![b d, u, b e]))) = |
| 143 | ∑ d, ∑ e, ((D.curvatureTensor x u (b d) v (b e) * |
| 144 | hamiltonP D x (b d) (b e) w + |
| 145 | D.curvatureTensor x u (b d) w (b e) * |
| 146 | hamiltonP D x (b d) v (b e) + |
| 147 | D.curvatureTensor x v (b d) w (b e) * |
| 148 | hamiltonP D x u (b d) (b e)) - |
| 149 | D.ricci x (b d) (b e) * |
| 150 | D.covariantTensorDerivative D.riemannEvaluation x ![b d, u, v, w, b e]) := by |
| 151 | apply Finset.sum_congr rfl |
| 152 | intro d hd |
| 153 | apply Finset.sum_congr rfl |
| 154 | intro e he |
| 155 | exact hpoint d e |
| 156 | convert congrArg (fun z : ℝ => 2 * z) hs using 1 <;> |
| 157 | simp [Finset.sum_sub_distrib, Finset.sum_add_distrib, b] <;> ring_nf |
| 158 | |
| 159 | end Poincare.RicciFlow.Harnack |