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.ReducedVolume.Metric.Coordinates.MetricCoordinates |
| 2 | import PoincareLib.Geometry.Riemannian.ScalarOperators |
| 3 | |
| 4 | /-! |
| 5 | # Traces in the fixed metric coordinates |
| 6 | |
| 7 | The source normalization uses the selected metric's actual orthonormal basis, |
| 8 | reindexed by Fin n. These identities retain that selection in both geometric |
| 9 | traces used in the Jacobian evolution. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle BigOperators |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.ReducedVolume |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | set_option backward.isDefEq.respectTransparency false in |
| 24 | /-- Fixed metric coordinates preserve the literal selected inner product. -/ |
| 25 | theorem metricCoordinates_inner (g : RiemannianMetric n M) (q : M) |
| 26 | (v w : EuclideanSpace ℝ (Fin n)) : |
| 27 | g.inner q (metricCoordinates g q v) (metricCoordinates g q w) = inner ℝ v w := by |
| 28 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 29 | ⟨g.toRiemannianMetric⟩ |
| 30 | exact (metricCoordinates g q).inner_map_map v w |
| 31 | |
| 32 | /-- The Gram matrix of the selected coordinate basis is the identity. -/ |
| 33 | theorem metricCoordinates_basis_inner (g : RiemannianMetric n M) (q : M) (i j : Fin n) : |
| 34 | g.inner q (metricCoordinates g q (EuclideanSpace.basisFun (Fin n) ℝ i)) |
| 35 | (metricCoordinates g q (EuclideanSpace.basisFun (Fin n) ℝ j)) = |
| 36 | if i = j then 1 else 0 := by |
| 37 | rw [metricCoordinates_inner] |
| 38 | exact (EuclideanSpace.basisFun (Fin n) ℝ).inner_eq_ite i j |
| 39 | |
| 40 | set_option backward.isDefEq.respectTransparency false in |
| 41 | /-- Summing over the fixed coordinates is summing over the exact selected orthonormal basis. -/ |
| 42 | theorem sum_metricCoordinates_basis (g : RiemannianMetric n M) (q : M) |
| 43 | (f : TangentSpace (𝓡 n) q → ℝ) : |
| 44 | (∑ i : Fin n, f (metricCoordinates g q (EuclideanSpace.basisFun (Fin n) ℝ i))) = |
| 45 | ∑ i, f (g.orthonormalBasis q i) := by |
| 46 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 47 | ⟨g.toRiemannianMetric⟩ |
| 48 | have hdim : Module.finrank ℝ (TangentSpace (𝓡 n) q) = n := by |
| 49 | change Module.finrank ℝ (EuclideanSpace ℝ (Fin n)) = n |
| 50 | simp |
| 51 | simp only [metricCoordinates, EuclideanSpace.basisFun_apply, |
| 52 | OrthonormalBasis.repr_symm_single, OrthonormalBasis.reindex_apply] |
| 53 | exact Equiv.sum_comp (finCongr hdim).symm (fun i ↦ f (g.orthonormalBasis q i)) |
| 54 | |
| 55 | /-- The Ricci trace in the fixed orthonormal coordinates is the selected scalar curvature. -/ |
| 56 | theorem sum_metricCoordinates_ricci (g : RiemannianMetric n M) (D : LeviCivitaData g) |
| 57 | (q : M) : |
| 58 | (∑ i : Fin n, D.ricci q |
| 59 | (metricCoordinates g q (EuclideanSpace.basisFun (Fin n) ℝ i)) |
| 60 | (metricCoordinates g q (EuclideanSpace.basisFun (Fin n) ℝ i))) = |
| 61 | D.scalarCurvature q := |
| 62 | sum_metricCoordinates_basis g q (fun v ↦ D.ricci q v v) |
| 63 | |
| 64 | /-- The Hessian trace in the same fixed coordinates is the literal frozen Laplacian. -/ |
| 65 | theorem sum_metricCoordinates_hessian (g : RiemannianMetric n M) (D : LeviCivitaData g) |
| 66 | (f : M → ℝ) (q : M) : |
| 67 | (∑ i : Fin n, D.hessian f q |
| 68 | (metricCoordinates g q (EuclideanSpace.basisFun (Fin n) ℝ i)) |
| 69 | (metricCoordinates g q (EuclideanSpace.basisFun (Fin n) ℝ i))) = |
| 70 | D.laplacian f q := |
| 71 | sum_metricCoordinates_basis g q (fun v ↦ D.hessian f q v v) |
| 72 | |
| 73 | end PoincareMT.ReducedVolume |