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 | /- Adapted from Mapher `PoincareMT/Proofs/M03/ConnectionRegularity.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.Connection.Koszul |
| 6 | import PoincareLib.Geometry.RicciFlow.Local.Connection.Coordinates |
| 7 | import Mathlib.Geometry.Manifold.VectorBundle.Hom |
| 8 | |
| 9 | /-! |
| 10 | # Local regularity of the explicit Levi-Civita connection |
| 11 | |
| 12 | The first theorem uses the local Koszul identity and smooth inversion of a |
| 13 | positive Gram matrix, as in Morgan-Tian, Theorem 1.2 and formula (1.1), |
| 14 | printed pp. 3-4. The second theorem applies that result to a smooth direction |
| 15 | field. The imported proofs are kernel-closed; their semantic review remains |
| 16 | part of the M03 helper review. The aggregate audit checks the foundation |
| 17 | closure without weakening the module or project guards. |
| 18 | -/ |
| 19 | |
| 20 | set_option autoImplicit false |
| 21 | |
| 22 | open scoped Manifold ContDiff Bundle |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.LeviCivitaData |
| 27 | |
| 28 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 30 | {g : RiemannianMetric n M} |
| 31 | |
| 32 | /-- Smoothness of the connection on a locally smooth section. -/ |
| 33 | theorem contMDiffOn_connection (D : LeviCivitaData g) |
| 34 | {U : Set M} (hU : IsOpen U) |
| 35 | (Y : (x : M) → TangentSpace (𝓡 n) x) |
| 36 | (hY : ContMDiffOn (𝓡 n) |
| 37 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% Y) U) : |
| 38 | ContMDiffOn (𝓡 n) |
| 39 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n))) ∞ |
| 40 | (fun x ↦ Bundle.TotalSpace.mk' |
| 41 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) |
| 42 | x (D.connection Y x)) U := by |
| 43 | apply RicciFlow.Local.koszul_operator_contMDiffOn g (fun Y x ↦ D.connection Y x) |
| 44 | ?_ hU Y hY |
| 45 | intro X Y Z x hX hY hZ |
| 46 | have hk := D.koszul X Y Z hX hY hZ |
| 47 | linarith only [hk] |
| 48 | |
| 49 | /-- Apply the local regularity obligation to a smooth direction field. -/ |
| 50 | theorem contMDiffOn_connection_apply (D : LeviCivitaData g) |
| 51 | {U : Set M} (hU : IsOpen U) |
| 52 | (X Y : (x : M) → TangentSpace (𝓡 n) x) |
| 53 | (hX : ContMDiffOn (𝓡 n) |
| 54 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% X) U) |
| 55 | (hY : ContMDiffOn (𝓡 n) |
| 56 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% Y) U) : |
| 57 | ContMDiffOn (𝓡 n) |
| 58 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 59 | (T% (fun x ↦ D.connection Y x (X x))) U := by |
| 60 | exact (D.contMDiffOn_connection hU Y hY).clm_bundle_apply hX |
| 61 | |
| 62 | end PoincareMT.LeviCivitaData |