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.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.Limits.PartialDiffeomorphOnOpens |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.IntrinsicGeometry.IntrinsicOpenMetric |
| 4 | import PoincareLib.Geometry.Riemannian.Metric.Diffeomorph |
| 5 | |
| 6 | /-! |
| 7 | # Exact induced distance on an actual open image |
| 8 | |
| 9 | The metric pulled back by a diffeomorphism onto an open image has the |
| 10 | literal intrinsic image distance. Source: Morgan--Tian Theorem 5.6, |
| 11 | pp. 85-87; M28 derivation 132. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | universe u v |
| 22 | |
| 23 | namespace PoincareMT.M28 |
| 24 | |
| 25 | variable {X : Type u} {N : Type v} |
| 26 | [TopologicalSpace X] [TopologicalSpace N] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) N] |
| 29 | [IsManifold (𝓡 3) ∞ X] [IsManifold (𝓡 3) ∞ N] |
| 30 | |
| 31 | /-- A metric pulled back from the ambient map has the exact intrinsic |
| 32 | image distance. The source can use either inherited or singleton charts. -/ |
| 33 | theorem edist_eq_intrinsicOpenMetric_of_diffeomorph_pullback |
| 34 | (g : RiemannianMetric 3 X) (h : RiemannianMetric 3 N) |
| 35 | (W : TopologicalSpace.Opens N) (D : X ≃ₘ⟮𝓡 3, 𝓡 3⟯ W) |
| 36 | (hinner : ∀ (x : X) (v w : TangentSpace (𝓡 3) x), |
| 37 | g.inner x v w = h.inner (D x : N) |
| 38 | (mfderiv (𝓡 3) (𝓡 3) ((Subtype.val : W → N) ∘ D) x v) |
| 39 | (mfderiv (𝓡 3) (𝓡 3) ((Subtype.val : W → N) ∘ D) x w)) |
| 40 | (x y : X) : |
| 41 | g.edist x y = (intrinsicOpenMetric h W).edist (D x) (D y) := by |
| 42 | apply RiemannianMetric.edist_diffeomorph g (intrinsicOpenMetric h W) D |
| 43 | intro z v w |
| 44 | rw [hinner z v w, intrinsicOpenMetric_inner] |
| 45 | have hi : MDifferentiableAt (𝓡 3) (𝓡 3) (Subtype.val : W → N) (D z) := |
| 46 | (contMDiff_subtype_val (I := 𝓡 3) (U := W) (n := 1)).mdifferentiable |
| 47 | one_ne_zero (D z) |
| 48 | rw [mfderiv_comp z hi (D.mdifferentiable (by simp) z)] |
| 49 | rfl |
| 50 | |
| 51 | omit [IsManifold (𝓡 3) ∞ X] [IsManifold (𝓡 3) ∞ N] in |
| 52 | /-- The actual ambient map of a diffeomorphism onto an open image is a |
| 53 | local diffeomorphism, so its literal pullback metric exists. -/ |
| 54 | theorem diffeomorph_openImageMap_isLocalDiffeomorph |
| 55 | (W : TopologicalSpace.Opens N) (D : X ≃ₘ⟮𝓡 3, 𝓡 3⟯ W) : |
| 56 | IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ ((Subtype.val : W → N) ∘ D) := by |
| 57 | intro x |
| 58 | exact (D.isLocalDiffeomorph x).comp (𝓡 3) N |
| 59 | (openSubtype_isLocalDiffeomorph W (D x)) |
| 60 | |
| 61 | /-- The concrete pullback constructor satisfies the exact image-distance |
| 62 | identity; its tensor identity is definitional, not an extra assumption. -/ |
| 63 | theorem pullbackOfLocalDiffeomorph_edist_openImage |
| 64 | (h : RiemannianMetric 3 N) (W : TopologicalSpace.Opens N) |
| 65 | (D : X ≃ₘ⟮𝓡 3, 𝓡 3⟯ W) (x y : X) : |
| 66 | (h.pullbackOfLocalDiffeomorph ((Subtype.val : W → N) ∘ D) |
| 67 | (diffeomorph_openImageMap_isLocalDiffeomorph W D)).edist x y = |
| 68 | (intrinsicOpenMetric h W).edist (D x) (D y) := by |
| 69 | apply edist_eq_intrinsicOpenMetric_of_diffeomorph_pullback |
| 70 | intro z v w |
| 71 | rfl |
| 72 | |
| 73 | end PoincareMT.M28 |