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.Splitting.MaximumPrinciple.RicciNullity |
| 2 | import PoincareLib.Geometry.Riemannian.Curvature.LocalIsometryRicci |
| 3 | import Mathlib.Geometry.Manifold.LocalDiffeomorph |
| 4 | import Mathlib.LinearAlgebra.Dimension.Finrank |
| 5 | |
| 6 | /-! |
| 7 | # Ricci nullity under an actual local isometry |
| 8 | |
| 9 | The differential of a supplied metric-preserving local diffeomorphism |
| 10 | identifies the full Ricci kernels of the two actual connections. Their |
| 11 | dimensions agree. This transports terminal nullity in Morgan--Tian |
| 12 | Claim 11.7, pp. 270-271, without a common source time interval. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Manifold PoincareMT.RicciFlow.Splitting |
| 19 | open scoped Manifold ContDiff Bundle |
| 20 | |
| 21 | universe u v |
| 22 | |
| 23 | namespace PoincareMT.M30 |
| 24 | |
| 25 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 26 | normedSpaceTangentSpaceVectorSpace |
| 27 | |
| 28 | /-- An actual local isometry preserves the full Ricci-kernel dimension, |
| 29 | as used to transport terminal nullity in Claim 11.7, pp. 270-271. -/ |
| 30 | theorem ricciNullity_eq_of_local_isometry |
| 31 | {n : ℕ} {N : Type u} {M : Type v} |
| 32 | [TopologicalSpace N] [TopologicalSpace M] |
| 33 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 34 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 35 | [IsManifold (𝓡 n) ∞ N] [IsManifold (𝓡 n) ∞ M] |
| 36 | {gN : RiemannianMetric n N} {gM : RiemannianMetric n M} |
| 37 | (DN : LeviCivitaData gN) (DM : LeviCivitaData gM) |
| 38 | {f : N → M} (hf : IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ f) |
| 39 | (hmetric : ∀ y : N, ∀ v1 v2 : TangentSpace (𝓡 n) y, |
| 40 | gN.inner y v1 v2 = gM.inner (f y) |
| 41 | (mfderiv (𝓡 n) (𝓡 n) f y v1) (mfderiv (𝓡 n) (𝓡 n) f y v2)) |
| 42 | (x : N) : ricciNullity DN x = ricciNullity DM (f x) := by |
| 43 | let L := ((hf x).mfderivToContinuousLinearEquiv (by simp)).toLinearEquiv |
| 44 | have hric (v w : TangentSpace (𝓡 n) x) : |
| 45 | DN.ricci x v w = DM.ricci (f x) (L v) (L w) := |
| 46 | DN.ricci_eq_of_local_isometry DM isOpen_univ hf.contMDiff.contMDiffOn |
| 47 | (fun y _ v1 v2 => hmetric y v1 v2) (mem_univ x) v w |
| 48 | have hker : ricciKernel DM (f x) = (ricciKernel DN x).map L.toLinearMap := by |
| 49 | ext v |
| 50 | rw [Submodule.mem_map_equiv, mem_ricciKernel, mem_ricciKernel] |
| 51 | constructor |
| 52 | · intro hv w |
| 53 | rw [hric, L.apply_symm_apply] |
| 54 | exact hv _ |
| 55 | · intro hv w |
| 56 | obtain ⟨z, rfl⟩ := L.surjective w |
| 57 | have hz := hv z |
| 58 | rw [hric, L.apply_symm_apply] at hz |
| 59 | exact hz |
| 60 | unfold ricciNullity |
| 61 | rw [hker, LinearEquiv.finrank_map_eq] |
| 62 | |
| 63 | end PoincareMT.M30 |