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.Surgery.Induction.EpochExtension.Spacetime.GeneralizedCylinderClock |
| 2 | import PoincareLib.Geometry.Spacetime.Realization.Manifold.OpenSubsetDiffeomorph |
| 3 | |
| 4 | /-! |
| 5 | # Actual spatial differential of a raw cylinder |
| 6 | |
| 7 | The inverse need only be smooth within the actual image. Differentiating |
| 8 | its left-inverse identity on the open source proves injectivity, without |
| 9 | assuming that a smooth topological embedding is an immersion. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Function |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.EpochExtension.Spacetime |
| 21 | |
| 22 | open Poincare.Spacetime.Realization |
| 23 | |
| 24 | variable {F : GeneralizedRicciFlowData.{u}} {C : GeneralizedSliceCarrier.{u}} |
| 25 | {a q : ℝ} {J : SpacetimeInterval} {U : TopologicalSpace.Opens C.carrier} |
| 26 | (e : GeneralizedFlowCylinder F C a q J.domain U) |
| 27 | |
| 28 | theorem rawForward_differential_injective (s : J.domain) (x : U) : |
| 29 | Injective (mfderiv (𝓡 3) (𝓡 3) (e.forward s.val s.property) x.val) := by |
| 30 | have hf := (e.forward_smooth s.val s.property x.val x.property).mdifferentiableWithinAt |
| 31 | (by simp) |
| 32 | have hg := (e.inverse_smooth s.val s.property (e.forward s.val s.property x.val) |
| 33 | (mem_image_of_mem _ x.property)).mdifferentiableWithinAt (by simp) |
| 34 | have hunique := U.isOpen.uniqueMDiffWithinAt (I := 𝓡 3) x.property |
| 35 | have hcomp := mfderivWithin_comp x.val hg hf |
| 36 | (fun y hy => mem_image_of_mem (e.forward s.val s.property) hy) hunique |
| 37 | have hid : mfderivWithin (𝓡 3) (𝓡 3) |
| 38 | (e.inverse s.val s.property ∘ e.forward s.val s.property) U x.val = |
| 39 | ContinuousLinearMap.id ℝ (TangentSpace (𝓡 3) x.val) := |
| 40 | (mfderivWithin_congr_of_mem (e.left_inverse s.val s.property) x.property).trans |
| 41 | (mfderivWithin_id hunique) |
| 42 | rw [hid, mfderivWithin_eq_mfderiv hunique |
| 43 | (hf.mdifferentiableAt (U.isOpen.mem_nhds x.property))] at hcomp |
| 44 | intro v w hvw |
| 45 | have hv := congrArg (fun l : TangentSpace (𝓡 3) x.val →L[ℝ] |
| 46 | TangentSpace (𝓡 3) x.val => l v) hcomp |
| 47 | have hw := congrArg (fun l : TangentSpace (𝓡 3) x.val →L[ℝ] |
| 48 | TangentSpace (𝓡 3) x.val => l w) hcomp |
| 49 | exact hv.trans ((congrArg (mfderivWithin (𝓡 3) (𝓡 3) (e.inverse s.val s.property) |
| 50 | (e.forward s.val s.property '' U) (e.forward s.val s.property x.val)) hvw).trans hw.symm) |
| 51 | |
| 52 | def rawSpatialMap (s : J.domain) : U → (F.slice (a + s.val / q)).carrier := |
| 53 | fun x => e.forward s.val s.property x.val |
| 54 | |
| 55 | theorem rawSpatialMap_smooth (s : J.domain) : ContMDiff (𝓡 3) (𝓡 3) ∞ (rawSpatialMap e s) := |
| 56 | (e.forward_smooth s.val s.property).comp_contMDiff contMDiff_subtype_val |
| 57 | (fun x => x.property) |
| 58 | |
| 59 | theorem rawSpatialMap_differential_injective (s : J.domain) (x : U) : |
| 60 | Injective (mfderiv (𝓡 3) (𝓡 3) (rawSpatialMap e s) x) := by |
| 61 | have hf := (e.forward_smooth s.val s.property x.val x.property).contMDiffAt |
| 62 | (U.isOpen.mem_nhds x.property) |
| 63 | change Injective (mfderiv (𝓡 3) (𝓡 3) |
| 64 | (e.forward s.val s.property ∘ (Subtype.val : U → C.carrier)) x) |
| 65 | rw [mfderiv_comp x (hf.mdifferentiableAt (by simp)) |
| 66 | (contMDiff_subtype_val (n := ∞) x |>.mdifferentiableAt (by simp))] |
| 67 | exact (rawForward_differential_injective e s x).comp |
| 68 | (openSubset_differential_injective U x) |
| 69 | |
| 70 | end PoincareMT.EpochExtension.Spacetime |