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.Spacetime.Realization.Manifold.OpenSubsetDiffeomorph |
| 2 | import PoincareLib.Geometry.Spacetime.Cylinder.Basic |
| 3 | import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions |
| 4 | |
| 5 | /-! |
| 6 | # Exact source restrictions of compatible embeddings and cylinders |
| 7 | -/ |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | open Topology |
| 13 | open scoped Manifold ContDiff Bundle Topology |
| 14 | |
| 15 | open PoincareMT |
| 16 | |
| 17 | namespace Poincare.Spacetime.Realization |
| 18 | |
| 19 | variable {n : ℕ} {X : Type*} [TopologicalSpace X] {time : X → ℝ} |
| 20 | {I K : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 21 | {D : SmoothSpacetimeInterval K} |
| 22 | |
| 23 | noncomputable def embeddingSourceRestrict {C C' : Type*} |
| 24 | [TopologicalSpace C] [TopologicalSpace C'] (e : CompatibleSpacetimeEmbedding F D C) |
| 25 | (j : C' → C) (hj : IsEmbedding j) : CompatibleSpacetimeEmbedding F D C' where |
| 26 | interval_subset := e.interval_subset |
| 27 | toSpacetime := fun p ↦ e.toSpacetime (p.1, j p.2) |
| 28 | embedding := e.embedding.comp (IsEmbedding.id.prodMap hj) |
| 29 | time_eq := fun p ↦ e.time_eq (p.1, j p.2) |
| 30 | worldline_smooth := fun x ↦ e.worldline_smooth (j x) |
| 31 | worldline_derivative := fun t x ↦ e.worldline_derivative t (j x) |
| 32 | |
| 33 | noncomputable def cylinderOpenRestrict {C : Type*} [TopologicalSpace C] |
| 34 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 35 | (e : CompatibleSpacetimeCylinder F D C) (U : TopologicalSpace.Opens C) : |
| 36 | CompatibleSpacetimeCylinder F D U where |
| 37 | toCompatibleSpacetimeEmbedding := embeddingSourceRestrict e.toCompatibleSpacetimeEmbedding |
| 38 | Subtype.val IsEmbedding.subtypeVal |
| 39 | smooth := e.smooth.comp (contMDiff_id.prodMap contMDiff_subtype_val) |
| 40 | differential_injective := by |
| 41 | intro p |
| 42 | have hd : MDifferentiableAt (𝓡 n) (𝓡 n) (Subtype.val : U → C) p.2 := |
| 43 | contMDiff_subtype_val.mdifferentiableAt (n := ∞) (by simp) |
| 44 | have hj : Function.Injective |
| 45 | (mfderiv (spacetimeModel n) (spacetimeModel n) |
| 46 | (Prod.map (id : D.Point → D.Point) (Subtype.val : U → C)) p) := by |
| 47 | rw [mfderiv_prodMap mdifferentiableAt_id hd, mfderiv_id] |
| 48 | intro v w hvw |
| 49 | have h₁ := congrArg Prod.fst hvw |
| 50 | have h₂ := congrArg Prod.snd hvw |
| 51 | apply Prod.ext |
| 52 | · exact h₁ |
| 53 | · exact openSubset_differential_injective U p.2 h₂ |
| 54 | change Function.Injective (mfderiv (spacetimeModel n) (spacetimeModel n) |
| 55 | (e.toSpacetime ∘ Prod.map id (Subtype.val : U → C)) p) |
| 56 | rw [mfderiv_comp p ((e.smooth _).mdifferentiableAt (by simp)) |
| 57 | (mdifferentiableAt_id.prodMap hd)] |
| 58 | exact (e.differential_injective _).comp hj |
| 59 | |
| 60 | end Poincare.Spacetime.Realization |