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.Manifold.RegularLevel.UniversalProperty |
| 2 | import PoincareLib.Geometry.Riemannian.Metric.Induced.RegularLevel |
| 3 | import PoincareLib.Geometry.Riemannian.Curvature.LocalIsometryInvariants |
| 4 | import PoincareLib.Geometry.Riemannian.Connection.Construction |
| 5 | |
| 6 | /-! # Scalar curvature of an immersed parametrization of a regular level -/ |
| 7 | |
| 8 | noncomputable section |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | open Set Function TopologicalSpace |
| 12 | open Poincare.Geometry.Manifold.RegularLevel |
| 13 | open scoped Manifold ContDiff Topology |
| 14 | |
| 15 | namespace PoincareMT.LeviCivitaData |
| 16 | |
| 17 | variable {n : ℕ} {M N : Type*} [TopologicalSpace M] [TopologicalSpace N] |
| 18 | [ChartedSpace (EuclideanSpace ℝ (Fin (n + 1))) M] |
| 19 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 20 | [IsManifold (𝓡 (n + 1)) ∞ M] [IsManifold (𝓡 n) ∞ N] |
| 21 | |
| 22 | /-- The scalar curvature of an ambient pullback metric on a regular-level |
| 23 | parametrization is the actual scalar curvature of the induced level metric. -/ |
| 24 | theorem scalarCurvature_eq_regularLevel_of_ambient_pullback |
| 25 | {f : M → ℝ} (hf : ContMDiff (𝓡 (n + 1)) 𝓘(ℝ, ℝ) ∞ f) |
| 26 | (U : Opens M) (hreg : ∀ x ∈ U, mfderiv (𝓡 (n + 1)) 𝓘(ℝ, ℝ) f x ≠ 0) |
| 27 | (c : ℝ) (g : RiemannianMetric (n + 1) M) (gN : RiemannianMetric n N) |
| 28 | (DN : LeviCivitaData gN) (F : N → openLevelSet f U c) |
| 29 | (hF : ContMDiff (𝓡 n) (𝓡 (n + 1)) ∞ (openLevelIncl f U c ∘ F)) |
| 30 | (hmetric : ∀ x (v w : TangentSpace (𝓡 n) x), gN.inner x v w = |
| 31 | g.inner (openLevelIncl f U c (F x)) |
| 32 | (mfderiv (𝓡 n) (𝓡 (n + 1)) (openLevelIncl f U c ∘ F) x v) |
| 33 | (mfderiv (𝓡 n) (𝓡 (n + 1)) (openLevelIncl f U c ∘ F) x w)) (x : N) : |
| 34 | letI : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin (n + 1))) = n + 1) := |
| 35 | ⟨finrank_euclideanSpace_fin⟩ |
| 36 | letI := openLevelSetChartedSpace hf U hreg n c |
| 37 | letI := isManifold_openLevelSet hf U hreg n c |
| 38 | DN.scalarCurvature x = |
| 39 | (RiemannianMetric.regularLevelMetric hf U hreg c g).leviCivitaData.scalarCurvature (F x) := by |
| 40 | let : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin (n + 1))) = n + 1) := |
| 41 | ⟨finrank_euclideanSpace_fin⟩ |
| 42 | let := openLevelSetChartedSpace hf U hreg n c |
| 43 | let := isManifold_openLevelSet hf U hreg n c |
| 44 | have hFs : ContMDiff (𝓡 n) (𝓡 n) ∞ F := fun y => |
| 45 | (contMDiffAt_into_openLevelSet_iff hf n c U hreg F y).mpr (hF y) |
| 46 | apply DN.scalarCurvature_eq_of_local_isometry |
| 47 | (RiemannianMetric.regularLevelMetric hf U hreg c g).leviCivitaData |
| 48 | isOpen_univ hFs.contMDiffOn (fun y _ v w => ?_) (mem_univ x) |
| 49 | rw [RiemannianMetric.regularLevelMetric_inner, hmetric] |
| 50 | have he := mfderiv_comp y |
| 51 | ((contMDiff_openLevelIncl hf U hreg n c (F y)).mdifferentiableAt (by simp)) |
| 52 | ((hFs y).mdifferentiableAt (by simp)) |
| 53 | rw [he] |
| 54 | rfl |
| 55 | |
| 56 | end PoincareMT.LeviCivitaData |