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.Evolution.QuadraticCancellation |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Matrix.Reaction.Contractions |
| 3 | |
| 4 | /-! |
| 5 | # Geometric cancellations in the Hamilton quadratic evolution |
| 6 | |
| 7 | The prescribed first jets cancel the derivative and reciprocal-time terms |
| 8 | using the proved divergence identity. This is the cancellation from (15.56) |
| 9 | to (15.57) in Chow et al., Part II, printed pp. 278-279. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle BigOperators |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace Poincare.RicciFlow.Harnack |
| 20 | |
| 21 | open PoincareMT |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | {g : RiemannianMetric n M} |
| 26 | |
| 27 | /-- The derivative and reciprocal-time cancellation for the actual geometric |
| 28 | Hamilton tensors, with no additional divergence or symmetry assumptions. -/ |
| 29 | lemma hamiltonM_geometric_prescribed_jet_cancellation |
| 30 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (τ : ℝ) (x : M) |
| 31 | (W : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → ℝ) : |
| 32 | let b := g.orthonormalBasis x |
| 33 | let R := fun a c d e => D.curvatureTensor x (b a) (b c) (b d) (b e) |
| 34 | let Ric := fun a c => D.ricci x (b a) (b c) |
| 35 | let dP := fun e a c d => D.covariantTensorDerivative |
| 36 | (fun y z => hamiltonP D y (z 0) (z 1) (z 2)) x ![b e, b a, b c, b d] |
| 37 | let k := (2 * τ)⁻¹ |
| 38 | let V := fun e a c => |
| 39 | ((Ric e a + k * (if e = a then 1 else 0)) * W c - |
| 40 | W a * (Ric e c + k * (if e = c then 1 else 0))) / 2 |
| 41 | 2 * (∑ e, ∑ a, ∑ c, ∑ d, Ric e a * (dP e a c d + dP e a d c) * W c * W d) - |
| 42 | 4 * (∑ e, ∑ a, ∑ c, ∑ d, dP e a c d * V e a c * W d) + |
| 43 | 4 * k * (∑ a, ∑ c, hamiltonM D τ x (b a) (b c) * W a * W c) - |
| 44 | 2 * k ^ 2 * (∑ a, ∑ c, Ric a c * W a * W c) + |
| 45 | 2 * (∑ e, ∑ a, ∑ c, ∑ d, ∑ f, R a c d f * Ric e a * W c * Ric e d * W f) - |
| 46 | 2 * (∑ e, ∑ a, ∑ c, ∑ d, ∑ f, R a c d f * V e a c * V e d f) = 0 := by |
| 47 | let b := g.orthonormalBasis x |
| 48 | let R := fun a c d e => D.curvatureTensor x (b a) (b c) (b d) (b e) |
| 49 | let Ric := fun a c => D.ricci x (b a) (b c) |
| 50 | have hfirst (a c d e) : R a c d e = -R c a d e := by |
| 51 | dsimp [R] |
| 52 | rw [(hD.2.2.2.1 x (b a) (b c) (b d) (b e)).2.1, |
| 53 | (hD.2.2.2.1 x (b d) (b e) (b a) (b c)).1, |
| 54 | (hD.2.2.2.1 x (b d) (b e) (b c) (b a)).2.1] |
| 55 | have hlast (a c d e) : R a c d e = -R a c e d := |
| 56 | (hD.2.2.2.1 x (b a) (b c) (b d) (b e)).1 |
| 57 | have hRic (c e) : (∑ a, R a c a e) = Ric c e := by |
| 58 | change (∑ a, R a c a e) = ∑ a, R c a e a |
| 59 | apply Finset.sum_congr rfl |
| 60 | intro a _ |
| 61 | rw [hfirst a c a e, hlast c a a e, neg_neg] |
| 62 | apply hamiltonM_prescribed_jet_cancellation R _ Ric |
| 63 | (fun a c => hamiltonM D τ x (b a) (b c)) W ((2 * τ)⁻¹) |
| 64 | hfirst hlast hRic |
| 65 | (fun a c => (hD.2.2.2.1 x (b a) (b c) (b a) (b c)).2.2.2) |
| 66 | (fun e a c d => covariantTensorDerivative_hamiltonP_skew D hD x |
| 67 | (b e) (b a) (b c) (b d)) |
| 68 | intro c e |
| 69 | have h := hamiltonM_eq_divergence_hamiltonP D hD τ x (b c) (b e) |
| 70 | dsimp only at h |
| 71 | dsimp only [R, Ric] |
| 72 | rw [div_eq_mul_inv] at h |
| 73 | linarith only [h] |
| 74 | |
| 75 | /-- Contracted differential Bianchi supplies the curvature derivative |
| 76 | cancellation for the actual geometric P tensor. -/ |
| 77 | lemma hamiltonP_geometric_prescribed_jet_cancellation |
| 78 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (k : ℝ) (x : M) |
| 79 | (U : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → |
| 80 | Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → ℝ) |
| 81 | (W : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → ℝ) : |
| 82 | let b := g.orthonormalBasis x |
| 83 | let Ric := fun a c => D.ricci x (b a) (b c) |
| 84 | let P := fun a c d => hamiltonP D x (b a) (b c) (b d) |
| 85 | let dR := fun e a c d f => D.covariantTensorDerivative D.riemannEvaluation |
| 86 | x ![b e, b a, b c, b d, b f] |
| 87 | let V := fun e a c => |
| 88 | ((Ric e a + k * (if e = a then 1 else 0)) * W c - |
| 89 | W a * (Ric e c + k * (if e = c then 1 else 0))) / 2; |
| 90 | -(4 * (∑ a, ∑ c, ∑ d, ∑ e, ∑ f, Ric e f * dR e a c d f * U a c * W d)) + |
| 91 | 4 * k * (∑ a, ∑ c, ∑ d, P a c d * U a c * W d) - |
| 92 | 4 * (∑ e, ∑ a, ∑ c, ∑ d, ∑ f, dR e a c d f * V e a c * U d f) = 0 := by |
| 93 | let b := g.orthonormalBasis x |
| 94 | apply hamiltonP_prescribed_jet_cancellation |
| 95 | · intro e a c d f |
| 96 | exact D.covariantTensorDerivative_riemannEvaluation_skew_first hD x |
| 97 | (b e) (b a) (b c) (b d) (b f) |
| 98 | · intro e a c d f |
| 99 | exact D.covariantTensorDerivative_riemannEvaluation_pair_swap hD x |
| 100 | (b e) (b a) (b c) (b d) (b f) |
| 101 | · intro e a c d f |
| 102 | exact D.covariantTensorDerivative_riemannEvaluation_skew_last hD x |
| 103 | (b e) (b a) (b c) (b d) (b f) |
| 104 | · intro c d f |
| 105 | exact sum_covariantTensorDerivative_riemann_eq_hamiltonP D hD x (b c) (b d) (b f) |
| 106 | |
| 107 | end Poincare.RicciFlow.Harnack |