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.ReducedGeometry.ReducedLength.Tensor.CurvatureDerivativeSymmetry |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.CurvatureBianchi |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Basic |
| 4 | |
| 5 | /-! |
| 6 | # Contracted differential Bianchi for a flow slice |
| 7 | |
| 8 | Double contraction uses the frozen second and fourth curvature slots. |
| 9 | No pointwise choice of orthonormal basis is differentiated. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle BigOperators |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] {g : RiemannianMetric n M} |
| 24 | |
| 25 | theorem scalarCurvature_mvfderiv_of_bianchi (hM04 : RicciFlowCurvatureTheory.{u}) |
| 26 | (D : LeviCivitaData g) (p : M) |
| 27 | (hB : ∀ a u v w z : TangentSpace (𝓡 n) p, |
| 28 | D.covariantTensorDerivative D.riemannEvaluation p ![a, u, v, w, z] + |
| 29 | D.covariantTensorDerivative D.riemannEvaluation p ![u, v, a, w, z] + |
| 30 | D.covariantTensorDerivative D.riemannEvaluation p ![v, a, u, w, z] = 0) |
| 31 | (X : TangentSpace (𝓡 n) p) : |
| 32 | mvfderiv (𝓡 n) D.scalarCurvature p X = |
| 33 | 2 * ∑ i, ricciDerivativePairing D p (g.orthonormalBasis p i) X |
| 34 | (g.orthonormalBasis p i) := by |
| 35 | let e := g.orthonormalBasis p |
| 36 | let R := fun a u v w z ↦ |
| 37 | D.covariantTensorDerivative D.riemannEvaluation p ![a, u, v, w, z] |
| 38 | have hsecond : (∑ i, ∑ j, R (e i) (e j) X (e i) (e j)) = |
| 39 | -(∑ i, ∑ j, R (e i) X (e j) (e i) (e j)) := by |
| 40 | calc |
| 41 | _ = ∑ i, ∑ j, -R (e i) X (e j) (e i) (e j) := |
| 42 | Finset.sum_congr rfl (fun i _ ↦ Finset.sum_congr rfl (fun j _ ↦ |
| 43 | covariantRiemannDerivative_first_antisymm hM04 D p (e i) (e j) X (e i) (e j))) |
| 44 | _ = _ := by simp only [Finset.sum_neg_distrib] |
| 45 | have hthird : (∑ i, ∑ j, R (e j) X (e i) (e i) (e j)) = |
| 46 | -(∑ i, ∑ j, R (e i) X (e j) (e i) (e j)) := by |
| 47 | calc |
| 48 | _ = ∑ i, ∑ j, R (e i) X (e j) (e j) (e i) := Finset.sum_comm |
| 49 | _ = ∑ i, ∑ j, -R (e i) X (e j) (e i) (e j) := |
| 50 | Finset.sum_congr rfl (fun i _ ↦ Finset.sum_congr rfl (fun j _ ↦ |
| 51 | covariantRiemannDerivative_last_antisymm hM04 D p (e i) X (e j) (e j) (e i))) |
| 52 | _ = _ := by simp only [Finset.sum_neg_distrib] |
| 53 | have hb : (∑ i, ∑ j, (R X (e i) (e j) (e i) (e j) + |
| 54 | R (e i) (e j) X (e i) (e j) + R (e j) X (e i) (e i) (e j))) = 0 := |
| 55 | Finset.sum_eq_zero (fun i _ ↦ Finset.sum_eq_zero (fun j _ ↦ hB X (e i) (e j) (e i) (e j))) |
| 56 | simp only [Finset.sum_add_distrib] at hb |
| 57 | rw [hsecond, hthird] at hb |
| 58 | rw [scalarCurvature_mvfderiv_contraction hM04 D] |
| 59 | simp only [ricciDerivativePairing, covariantRicci_eq_contraction hM04 D] |
| 60 | change (∑ i, ∑ j, R X (e i) (e j) (e i) (e j)) = |
| 61 | 2 * ∑ i, ∑ j, R (e i) X (e j) (e i) (e j) |
| 62 | linarith |
| 63 | |
| 64 | theorem squareTime_scalarCurvature_mvfderiv_contracted_bianchi |
| 65 | {J : Set ℝ} (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 66 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 67 | (p : M) (s : ℝ) (hs : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 68 | (X : TangentSpace (𝓡 n) p) : |
| 69 | let D := F.connection (T - s ^ 2) |
| 70 | mvfderiv (𝓡 n) D.scalarCurvature p X = |
| 71 | 2 * ∑ i, ricciDerivativePairing D p ((F.metric (T - s ^ 2)).orthonormalBasis p i) |
| 72 | X ((F.metric (T - s ^ 2)).orthonormalBasis p i) := |
| 73 | scalarCurvature_mvfderiv_of_bianchi hM04 (F.connection (T - s ^ 2)) p |
| 74 | (squareTime_curvature_second_bianchi F hM04 T b hb hwindow p s hs) X |
| 75 | |
| 76 | end PoincareMT.ReducedLength |