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.OrdinaryProduct.Identification |
| 2 | import PoincareLib.Geometry.Spacetime.Realization.Box.Cylinder |
| 3 | |
| 4 | /-! |
| 5 | # The product time field and the identity compatible cylinder |
| 6 | -/ |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set Function |
| 12 | open scoped Manifold ContDiff Topology |
| 13 | |
| 14 | open PoincareMT |
| 15 | |
| 16 | namespace Poincare.Spacetime.Realization |
| 17 | |
| 18 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 19 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 20 | [T2Space M] [SecondCountableTopology M] [Nonempty M] |
| 21 | |
| 22 | theorem ordinaryProduct_timeVector_box (g : ℝ → RiemannianMetric n M) |
| 23 | (I : SpacetimeInterval) (hg : RiemannianMetric.IsSmoothFamilyOn g I.domain) |
| 24 | (b : M) (q : (smoothInterval I).Point × spatialChartDomain (n := n) b) : |
| 25 | mfderiv (spacetimeModel n) (spacetimeModel n) (ordinaryProductIdentification g I hg) |
| 26 | (q.1, spatialChartInverse b q.2) ((smoothInterval I).positiveTangent q.1, 0) = |
| 27 | (adaptedSpacetime (ordinaryAtlas g I hg)).timeVector |
| 28 | (ordinaryProductIdentification g I hg (q.1, spatialChartInverse b q.2)) := by |
| 29 | let D := ordinaryProductIdentification g I hg |
| 30 | let j : (smoothInterval I).Point × spatialChartDomain (n := n) b → |
| 31 | (smoothInterval I).Point × M := Prod.map id (spatialChartInverse b) |
| 32 | have hj : ContMDiff (spacetimeModel n) (spacetimeModel n) ∞ j := |
| 33 | contMDiff_fst.prodMk ((spatialChartInverse_smooth b).comp contMDiff_snd) |
| 34 | have hd : mfderiv (spacetimeModel n) (spacetimeModel n) j q |
| 35 | ((smoothInterval I).positiveTangent q.1, 0) = |
| 36 | ((smoothInterval I).positiveTangent q.1, 0) := by |
| 37 | rw [mfderiv_prodMap mdifferentiableAt_id |
| 38 | ((spatialChartInverse_smooth b q.2).mdifferentiableAt (by simp)), mfderiv_id] |
| 39 | apply Prod.ext |
| 40 | · rfl |
| 41 | · change mfderiv (𝓡 n) (𝓡 n) (spatialChartInverse b) q.2 0 = 0 |
| 42 | exact map_zero _ |
| 43 | have h := mfderiv_comp_apply q ((D.contMDiff (j q)).mdifferentiableAt (by simp)) |
| 44 | ((hj q).mdifferentiableAt (by simp)) ((smoothInterval I).positiveTangent q.1, 0) |
| 45 | rw [hd] at h |
| 46 | exact h.symm.trans (adaptedTimeVector_box (ordinaryAtlas g I hg) b q).symm |
| 47 | |
| 48 | theorem ordinaryProduct_timeVector (g : ℝ → RiemannianMetric n M) |
| 49 | (I : SpacetimeInterval) (hg : RiemannianMetric.IsSmoothFamilyOn g I.domain) |
| 50 | (p : (smoothInterval I).Point × M) : |
| 51 | mfderiv (spacetimeModel n) (spacetimeModel n) (ordinaryProductIdentification g I hg) p |
| 52 | ((smoothInterval I).positiveTangent p.1, 0) = |
| 53 | (adaptedSpacetime (ordinaryAtlas g I hg)).timeVector |
| 54 | (ordinaryProductIdentification g I hg p) := by |
| 55 | let x : spatialChartDomain (n := n) p.2 := |
| 56 | ⟨chartAt (EuclideanSpace ℝ (Fin n)) p.2 p.2, mem_chart_target _ p.2⟩ |
| 57 | have hx : spatialChartInverse p.2 x = p.2 := |
| 58 | (chartAt (EuclideanSpace ℝ (Fin n)) p.2).left_inv (mem_chart_source _ p.2) |
| 59 | have h := ordinaryProduct_timeVector_box g I hg p.2 (p.1, x) |
| 60 | rw [hx] at h |
| 61 | exact h |
| 62 | |
| 63 | noncomputable def ordinaryProductCylinder (g : ℝ → RiemannianMetric n M) |
| 64 | (I : SpacetimeInterval) (hg : RiemannianMetric.IsSmoothFamilyOn g I.domain) : |
| 65 | CompatibleSpacetimeCylinder (adaptedSpacetime (ordinaryAtlas g I hg)) |
| 66 | (smoothInterval I) M where |
| 67 | interval_subset := Subset.rfl |
| 68 | toSpacetime := ordinaryProductIdentification g I hg |
| 69 | embedding := (ordinaryProductIdentification g I hg).toHomeomorph.isEmbedding |
| 70 | time_eq := fun _ ↦ rfl |
| 71 | worldline_smooth := fun x ↦ (ordinaryProductIdentification g I hg).contMDiff.comp |
| 72 | (contMDiff_id.prodMk contMDiff_const) |
| 73 | worldline_derivative := by |
| 74 | intro t x |
| 75 | have h := mfderiv_comp_apply t |
| 76 | (((ordinaryProductIdentification g I hg).contMDiff (t, x)).mdifferentiableAt (by simp)) |
| 77 | ((contMDiff_id.prodMk contMDiff_const : ContMDiff (𝓡∂ 1) (spacetimeModel n) ∞ |
| 78 | (fun s : (smoothInterval I).Point ↦ (s, x))) t |>.mdifferentiableAt (by simp)) |
| 79 | ((smoothInterval I).positiveTangent t) |
| 80 | simp only [id_eq] at h |
| 81 | rw [mfderiv_prod_left] at h |
| 82 | exact h.trans (ordinaryProduct_timeVector g I hg (t, x)) |
| 83 | smooth := (ordinaryProductIdentification g I hg).contMDiff |
| 84 | differential_injective := fun p ↦ |
| 85 | ((ordinaryProductIdentification g I hg).mfderivToContinuousLinearEquiv (by simp) p).injective |
| 86 | |
| 87 | end Poincare.Spacetime.Realization |