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.Generalized.ReducedGeometry.Regularity.Hessian.SharpHessianBilinear |
| 2 | import PoincareLib.Geometry.Riemannian.Tensor.Trace |
| 3 | import Mathlib.LinearAlgebra.BilinearForm.Hom |
| 4 | |
| 5 | /-! |
| 6 | # Extending the sharp tensor identity from a horizontal basis |
| 7 | |
| 8 | M12 supplies the actual horizontal Ricci tensor. Its bilinearity, |
| 9 | together with that of the raw endpoint Hessian and metric, extends |
| 10 | the adapted-frame calculation to every pair of horizontal vectors. |
| 11 | Morgan-Tian Proposition 6.43, Claim 6.44 and Theorem 6.50, pp. 127-128, 131. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 24 | |
| 25 | /-- A Ricci-corrected bilinear form equals the scaled metric whenever |
| 26 | the equality holds on every pair of actual basis vectors, Proposition 6.43 |
| 27 | and Claim 6.44, pp. 127-128. The assertion also covers dimension zero. -/ |
| 28 | theorem ricci_add_bilinear_eq_of_basis |
| 29 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (q : G.Point) |
| 30 | (B : LinearMap.BilinForm ℝ (G.Horizontal q)) (c : ℝ) |
| 31 | (b : Module.Basis (Fin n) ℝ (G.Horizontal q)) |
| 32 | (heq : ∀ i j, horizontalRicci G.leafwise q (b i) (b j) + B (b i) (b j) = |
| 33 | G.spacetime.horizontalMetric.inner q (b i) (b j) / c) |
| 34 | (v w : G.Horizontal q) : |
| 35 | horizontalRicci G.leafwise q v w + B v w = |
| 36 | G.spacetime.horizontalMetric.inner q v w / c := by |
| 37 | have H := (hM12.leafwise_calculus X time I G.spacetime G.slices |
| 38 | G.timeIntervals G.gaugeCover).2 G.leafwise |
| 39 | obtain ⟨A, hA⟩ := H.ricci_tensor.1 q |
| 40 | let C := bilinearOfTensorCons A ![] |
| 41 | have hC (u z : G.Horizontal q) : C u z = horizontalRicci G.leafwise q u z := by |
| 42 | change A (Fin.cons u (Fin.cons z ![])) = _ |
| 43 | rw [show Fin.cons u (Fin.cons z ![]) = ![u, z] by |
| 44 | funext i |
| 45 | fin_cases i <;> rfl] |
| 46 | exact (hA ![u, z]).symm |
| 47 | let M : LinearMap.BilinForm ℝ (G.Horizontal q) := |
| 48 | (ContinuousLinearMap.coeLM ℝ).comp (G.spacetime.horizontalMetric.inner q).toLinearMap |
| 49 | have hM (u z : G.Horizontal q) : M u z = G.spacetime.horizontalMetric.inner q u z := rfl |
| 50 | have hforms : C + B = c⁻¹ • M := by |
| 51 | apply LinearMap.BilinForm.ext_basis b |
| 52 | intro i j |
| 53 | change C (b i) (b j) + B (b i) (b j) = c⁻¹ * M (b i) (b j) |
| 54 | rw [hC] |
| 55 | exact (heq i j).trans (by rw [hM]; ring) |
| 56 | have hvalue := congrArg (fun F : LinearMap.BilinForm ℝ (G.Horizontal q) => F v w) hforms |
| 57 | change C v w + B v w = c⁻¹ * M v w at hvalue |
| 58 | rw [hC] at hvalue |
| 59 | exact hvalue.trans (by rw [hM]; ring) |
| 60 | |
| 61 | end PoincareMT.M14 |