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.LinearAlgebra.Matrix.Determinant.Basic |
| 2 | import Mathlib.Analysis.Real.Sqrt |
| 3 | |
| 4 | /-! |
| 5 | Adapted from Mapher `PoincareMT/Proofs/M49/Mathlib/GramScaling.lean` at |
| 6 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 7 | |
| 8 | # Spatial scaling of the Gram volume density |
| 9 | |
| 10 | The determinant contributes one metric scale per dimension and its square |
| 11 | root gives length scale to that dimension. This is the scaling used in |
| 12 | Morgan-Tian Lemma 17.12, p. 410, corrected to the cubic three-dimensional |
| 13 | power as in Perelman II, Section 8.1, p. 21. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | namespace Matrix |
| 19 | |
| 20 | /-- Squared length scaling gives the corresponding dimensional density |
| 21 | factor (MT Lemma 17.12, p. 410; Perelman II, Section 8.1, p. 21). -/ |
| 22 | theorem sqrt_det_smul_sq {ι : Type*} [Fintype ι] [DecidableEq ι] |
| 23 | (A : Matrix ι ι ℝ) {c : ℝ} (hc : 0 ≤ c) : |
| 24 | Real.sqrt ((c ^ 2 • A).det) = c ^ Fintype.card ι * Real.sqrt A.det := by |
| 25 | rw [det_smul] |
| 26 | have hp : (c ^ 2) ^ Fintype.card ι = (c ^ Fintype.card ι) ^ 2 := by |
| 27 | rw [← pow_mul, Nat.mul_comm, pow_mul] |
| 28 | rw [hp, Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq (pow_nonneg hc _)] |
| 29 | |
| 30 | end Matrix |