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.Pinching.CurvatureTensor |
| 2 | import PoincareLib.Geometry.RicciFlow.Pinching.TensorReaction |
| 3 | import PoincareLib.Geometry.Riemannian.Curvature.Reaction |
| 4 | |
| 5 | /-! |
| 6 | # Reaction of the intrinsic curvature tensor |
| 7 | |
| 8 | The Hamilton--Ivey tensor reaction on the Ricci complement has precisely the |
| 9 | cyclic components of the moving-input geometric curvature reaction. |
| 10 | |
| 11 | Reference: Morgan--Tian, Proposition 3.19, pp. 44--45; Lemma 4.13, pp. 68--69. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle BigOperators |
| 18 | open Poincare.Geometry.Curvature.Operator Poincare.HamiltonIvey |
| 19 | |
| 20 | namespace PoincareMT.LeviCivitaData |
| 21 | |
| 22 | private theorem tensorReaction_curvatureOperator_apply |
| 23 | (R : Fin 3 → Fin 3 → Fin 3 → Fin 3 → ℝ) (i j : Fin 3) : |
| 24 | tensorReaction (TensorFiber.operatorTensor (curvatureOperator R)) |
| 25 | ![EuclideanSpace.basisFun (Fin 3) ℝ i, EuclideanSpace.basisFun (Fin 3) ℝ j] = |
| 26 | Poincare.Geometry.Curvature.Operator.curvatureReaction (curvatureMatrix R) i j := by |
| 27 | rw [tensorReaction_operatorTensor, TensorFiber.operatorTensor_apply] |
| 28 | have h := toMatrix_endomorphismReaction_eq_curvatureReaction |
| 29 | (EuclideanSpace.basisFun (Fin 3) ℝ) (curvatureOperator R) |
| 30 | have hmatrix : LinearMap.toMatrix (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis |
| 31 | (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis (curvatureOperator R) = |
| 32 | curvatureMatrix R := by |
| 33 | rw [curvatureOperator, Matrix.toEuclideanLin_eq_toLin_orthonormal, |
| 34 | LinearMap.toMatrix_toLin] |
| 35 | rw [hmatrix] at h |
| 36 | simpa only [LinearMap.toMatrix_apply, OrthonormalBasis.coe_toBasis_repr_apply, |
| 37 | OrthonormalBasis.repr_apply_apply, OrthonormalBasis.coe_toBasis] using |
| 38 | congrFun (congrFun h i) j |
| 39 | |
| 40 | variable {M : Type*} [TopologicalSpace M] |
| 41 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 42 | {g : RiemannianMetric 3 M} |
| 43 | |
| 44 | private instance reactionFiniteDimensional (x : M) : |
| 45 | FiniteDimensional ℝ (TangentSpace (𝓡 3) x) := by |
| 46 | unfold TangentSpace |
| 47 | infer_instance |
| 48 | |
| 49 | /-- The intrinsic tensor reaction has the cyclic matrix-reaction components |
| 50 | in every orthonormal frame. -/ |
| 51 | theorem tensorReaction_ricciComplementTensor_apply_orthonormalBasis [T2Space M] |
| 52 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (x : M) : |
| 53 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 54 | ⟨g.toRiemannianMetric⟩ |
| 55 | ∀ (b : OrthonormalBasis (Fin 3) ℝ (TangentSpace (𝓡 3) x)) (i j : Fin 3), |
| 56 | tensorReaction (D.ricciComplementTensor hD x) ![b i, b j] = |
| 57 | Poincare.Geometry.Curvature.Operator.curvatureReaction |
| 58 | (curvatureMatrix (fun i j k l => |
| 59 | D.curvatureTensor x (b i) (b j) (b k) (b l))) i j := by |
| 60 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 61 | ⟨g.toRiemannianMetric⟩ |
| 62 | intro b i j |
| 63 | rw [D.ricciComplementTensor_eq_transport_operatorTensor hD x b, |
| 64 | tensorReaction_transport, TensorFiber.transport_apply] |
| 65 | convert tensorReaction_curvatureOperator_apply |
| 66 | (fun p q r s => D.curvatureTensor x (b p) (b q) (b r) (b s)) i j using 1 |
| 67 | congr 1 |
| 68 | ext k |
| 69 | fin_cases k <;> simp [OrthonormalBasis.repr_self, EuclideanSpace.basisFun_apply] |
| 70 | |
| 71 | /-- The reaction used by tensor preservation agrees with the geometric |
| 72 | four-term contraction in the moving-input curvature equation. -/ |
| 73 | theorem tensorReaction_ricciComplementTensor_eq_curvatureB [T2Space M] |
| 74 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) (x : M) : |
| 75 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 76 | ⟨g.toRiemannianMetric⟩ |
| 77 | ∀ (b : OrthonormalBasis (Fin 3) ℝ (TangentSpace (𝓡 3) x)) (i j : Fin 3), |
| 78 | tensorReaction (D.ricciComplementTensor hD x) ![b i, b j] = |
| 79 | 2 * (D.curvatureB x (b (pairFirst i)) (b (pairSecond i)) |
| 80 | (b (pairFirst j)) (b (pairSecond j)) - |
| 81 | D.curvatureB x (b (pairFirst i)) (b (pairSecond i)) |
| 82 | (b (pairSecond j)) (b (pairFirst j)) - |
| 83 | D.curvatureB x (b (pairFirst i)) (b (pairSecond j)) |
| 84 | (b (pairSecond i)) (b (pairFirst j)) + |
| 85 | D.curvatureB x (b (pairFirst i)) (b (pairFirst j)) |
| 86 | (b (pairSecond i)) (b (pairSecond j))) := by |
| 87 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 88 | ⟨g.toRiemannianMetric⟩ |
| 89 | intro b i j |
| 90 | rw [D.tensorReaction_ricciComplementTensor_apply_orthonormalBasis hD x b] |
| 91 | exact (D.curvatureB_cyclic_reaction hD x b i j).symm |
| 92 | |
| 93 | end PoincareMT.LeviCivitaData |