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.Topology.Instances.Matrix |
| 2 | import Mathlib.Analysis.Real.Sqrt |
| 3 | import Mathlib.LinearAlgebra.Matrix.Determinant.Basic |
| 4 | |
| 5 | /-! |
| 6 | # Scaling the initial Gram determinant |
| 7 | |
| 8 | The scaled Gram limit 4 I gives the scaled square-root determinant limit |
| 9 | 2 to the dimension. The algebra also includes the empty matrix. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Filter |
| 15 | open scoped Topology |
| 16 | |
| 17 | namespace PoincareMT.ReducedVolume |
| 18 | |
| 19 | /-- A scaled Gram limit gives the exact scaled Jacobian limit in every dimension. -/ |
| 20 | theorem tendsto_scaled_sqrt_det {n : ℕ} {A : ℝ → Matrix (Fin n) (Fin n) ℝ} |
| 21 | (hA : Tendsto (fun s : ℝ ↦ (s⁻¹) ^ 2 • A s) (𝓝[>] (0 : ℝ)) |
| 22 | (𝓝 ((4 : ℝ) • (1 : Matrix (Fin n) (Fin n) ℝ)))) : |
| 23 | Tendsto (fun s : ℝ ↦ (s ^ n)⁻¹ * Real.sqrt (A s).det) |
| 24 | (𝓝[>] (0 : ℝ)) (𝓝 ((2 : ℝ) ^ n)) := by |
| 25 | have hdet := (Real.continuous_sqrt.comp continuous_id.matrix_det).continuousAt.tendsto.comp hA |
| 26 | simp only [Function.comp_def, id_eq] at hdet |
| 27 | have hlimit : Real.sqrt (((4 : ℝ) • (1 : Matrix (Fin n) (Fin n) ℝ)).det) = |
| 28 | (2 : ℝ) ^ n := by |
| 29 | rw [Matrix.det_smul, Matrix.det_one, mul_one, Fintype.card_fin] |
| 30 | have hp : (4 : ℝ) ^ n = ((2 : ℝ) ^ n) ^ 2 := by |
| 31 | rw [← pow_mul, Nat.mul_comm, pow_mul] |
| 32 | norm_num |
| 33 | rw [hp, Real.sqrt_sq (pow_nonneg (by norm_num) n)] |
| 34 | rw [hlimit] at hdet |
| 35 | apply hdet.congr' |
| 36 | filter_upwards [self_mem_nhdsWithin] with s hs |
| 37 | rw [Matrix.det_smul, Fintype.card_fin] |
| 38 | have hp : ((s⁻¹) ^ 2) ^ n = ((s⁻¹) ^ n) ^ 2 := by |
| 39 | rw [← pow_mul, ← pow_mul, Nat.mul_comm] |
| 40 | rw [hp, Real.sqrt_mul (sq_nonneg _), |
| 41 | Real.sqrt_sq (pow_nonneg (inv_nonneg.2 hs.le) n), inv_pow] |
| 42 | |
| 43 | end PoincareMT.ReducedVolume |