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 Mathlib.Analysis.InnerProductSpace.Dual |
| 2 | import Mathlib.LinearAlgebra.Trace |
| 3 | |
| 4 | /-! |
| 5 | # Basis independence of the metric trace |
| 6 | |
| 7 | The diagonal contraction of a covariant bilinear form is the trace of its |
| 8 | Riesz endomorphism. This supporting algebra for the M48 scalar Laplacian |
| 9 | uses no symmetry hypothesis and works in dimension zero. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped BigOperators |
| 15 | |
| 16 | namespace PoincareMT.M48ScalarCalculus |
| 17 | |
| 18 | /-- In an orthonormal basis, the metric diagonal contraction is the trace |
| 19 | of the endomorphism obtained by raising the second covariant index. -/ |
| 20 | theorem sum_diag_eq_trace |
| 21 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 22 | [FiniteDimensional ℝ E] {ι : Type*} [Fintype ι] |
| 23 | (B : E →L[ℝ] E →L[ℝ] ℝ) (b : OrthonormalBasis ι ℝ E) : |
| 24 | (∑ i, B (b i) (b i)) = |
| 25 | LinearMap.trace ℝ E (InnerProductSpace.continuousLinearMapOfBilin B).toLinearMap := by |
| 26 | classical |
| 27 | rw [LinearMap.trace_eq_matrix_trace ℝ b.toBasis] |
| 28 | simp only [Matrix.trace, Matrix.diag, LinearMap.toMatrix_apply, |
| 29 | OrthonormalBasis.coe_toBasis] |
| 30 | apply Finset.sum_congr rfl |
| 31 | intro i _hi |
| 32 | change B (b i) (b i) = (b.repr (InnerProductSpace.continuousLinearMapOfBilin B (b i))) i |
| 33 | rw [OrthonormalBasis.repr_apply_apply, real_inner_comm, |
| 34 | InnerProductSpace.continuousLinearMapOfBilin_apply] |
| 35 | |
| 36 | /-- The diagonal contraction of a covariant bilinear form is independent |
| 37 | of the chosen orthonormal basis. -/ |
| 38 | theorem sum_diag_basis_independent |
| 39 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 40 | [FiniteDimensional ℝ E] {ι κ : Type*} [Fintype ι] [Fintype κ] |
| 41 | (B : E →L[ℝ] E →L[ℝ] ℝ) |
| 42 | (b : OrthonormalBasis ι ℝ E) (c : OrthonormalBasis κ ℝ E) : |
| 43 | (∑ i, B (b i) (b i)) = ∑ i, B (c i) (c i) := by |
| 44 | exact (sum_diag_eq_trace B b).trans (sum_diag_eq_trace B c).symm |
| 45 | |
| 46 | end PoincareMT.M48ScalarCalculus |