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.Cylinder.SpatialSmooth |
| 2 | import PoincareLib.Geometry.Spacetime.Realization.Bundle.BilinearSmooth |
| 3 | import PoincareLib.Geometry.Spacetime.Realization.Bundle.PositiveFormBounded |
| 4 | import PoincareLib.Geometry.Spacetime.Realization.Interval.Family |
| 5 | |
| 6 | /-! |
| 7 | # Jointly smooth positive metric pulled back by a compatible cylinder |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set Bundle |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | |
| 16 | open PoincareMT |
| 17 | |
| 18 | namespace Poincare.Spacetime.Realization |
| 19 | |
| 20 | variable {n : ℕ} {X : Type*} [TopologicalSpace X] {time : X → ℝ} |
| 21 | {I K : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 22 | {D : SmoothSpacetimeInterval K} |
| 23 | {C : Type*} [TopologicalSpace C] [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] |
| 24 | [IsManifold (𝓡 n) ∞ C] |
| 25 | |
| 26 | noncomputable def cylinderMetricForm (e : CompatibleSpacetimeCylinder F D C) |
| 27 | (t : D.Point) (x : C) : |
| 28 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ := by |
| 29 | let H : Submodule ℝ (SpacetimeModelVector n) := |
| 30 | spacetimeHorizontal F.timeFunction (e.toSpacetime (t, x)) |
| 31 | exact (show H →L[ℝ] H →L[ℝ] ℝ from |
| 32 | F.horizontalMetric.inner (e.toSpacetime (t, x))).bilinearComp |
| 33 | (show EuclideanSpace ℝ (Fin n) →L[ℝ] H from |
| 34 | (cylinderSpatialEquiv e t x).toContinuousLinearMap) |
| 35 | (show EuclideanSpace ℝ (Fin n) →L[ℝ] H from |
| 36 | (cylinderSpatialEquiv e t x).toContinuousLinearMap) |
| 37 | |
| 38 | theorem cylinderMetricForm_pos (e : CompatibleSpacetimeCylinder F D C) |
| 39 | (t : D.Point) (x : C) (v : EuclideanSpace ℝ (Fin n)) (hv : v ≠ 0) : |
| 40 | 0 < cylinderMetricForm e t x v v := by |
| 41 | apply F.horizontalMetric.pos |
| 42 | exact fun h ↦ hv ((cylinderSpatialEquiv e t x).injective (h.trans (map_zero _).symm)) |
| 43 | |
| 44 | theorem cylinderMetricForm_smooth (e : CompatibleSpacetimeCylinder F D C) : |
| 45 | ContMDiff (spacetimeModel n) |
| 46 | ((𝓡 n).prod |
| 47 | 𝓘(ℝ, EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ)) ∞ |
| 48 | (fun p : D.Point × C ↦ TotalSpace.mk' |
| 49 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 50 | (E := fun x : C ↦ TangentSpace (𝓡 n) x →L[ℝ] TangentSpace (𝓡 n) x →L[ℝ] ℝ) |
| 51 | p.2 (cylinderMetricForm e p.1 p.2)) := by |
| 52 | intro p |
| 53 | rw [← contMDiffWithinAt_univ] |
| 54 | apply contMDiffWithinAt_bilinear_of_eval (IB := 𝓡 n) (J := spacetimeModel n) |
| 55 | (F := EuclideanSpace ℝ (Fin n)) (E := (TangentSpace (𝓡 n) : C → Type _)) |
| 56 | (b := Prod.snd) (g := fun p ↦ cylinderMetricForm e p.1 p.2) contMDiffWithinAt_snd |
| 57 | intro v w |
| 58 | have hg := F.horizontalMetric.contMDiff.contMDiffAt.comp p (e.smooth p) |
| 59 | have hv := (cylinderSpatialTangentMap_smooth e).contMDiffAt.comp p |
| 60 | (contMDiffAt_fst.prodMk |
| 61 | ((frameVector_contMDiffAt (IB := 𝓡 n) |
| 62 | (E := (TangentSpace (𝓡 n) : C → Type _)) p.2 v).comp p contMDiffAt_snd)) |
| 63 | have hw := (cylinderSpatialTangentMap_smooth e).contMDiffAt.comp p |
| 64 | (contMDiffAt_fst.prodMk |
| 65 | ((frameVector_contMDiffAt (IB := 𝓡 n) |
| 66 | (E := (TangentSpace (𝓡 n) : C → Type _)) p.2 w).comp p contMDiffAt_snd)) |
| 67 | have h := ContMDiffAt.clm_bundle_apply₂ (F₃ := ℝ) (E₃ := fun _ : F.Point ↦ ℝ) |
| 68 | (b := e.toSpacetime) (ψ := fun q ↦ F.horizontalMetric.inner (e.toSpacetime q)) hg hv hw |
| 69 | exact (contMDiffAt_totalSpace.mp h).2.contMDiffWithinAt |
| 70 | |
| 71 | noncomputable def cylinderMetricAt (e : CompatibleSpacetimeCylinder F D C) |
| 72 | (t : D.Point) : RiemannianMetric n C where |
| 73 | inner := cylinderMetricForm e t |
| 74 | symm := fun x v w ↦ F.horizontalMetric.symm (e.toSpacetime (t, x)) |
| 75 | (cylinderSpatialEquiv e t x v) (cylinderSpatialEquiv e t x w) |
| 76 | pos := cylinderMetricForm_pos e t |
| 77 | isVonNBounded := fun x ↦ positiveForm_isVonNBounded (cylinderMetricForm e t x) |
| 78 | (cylinderMetricForm_pos e t x) |
| 79 | contMDiff := (cylinderMetricForm_smooth e).comp (contMDiff_const.prodMk contMDiff_id) |
| 80 | |
| 81 | noncomputable def cylinderMetricTime (K : SpacetimeInterval) (t : ℝ) : K.domain := by |
| 82 | classical |
| 83 | exact if ht : t ∈ K.domain then ⟨t, ht⟩ |
| 84 | else ⟨K.nontrivial.nonempty.some, K.nontrivial.nonempty.some_mem⟩ |
| 85 | |
| 86 | theorem cylinderMetricTime_of_mem (K : SpacetimeInterval) (t : K.domain) : |
| 87 | cylinderMetricTime K t.val = t := by |
| 88 | simp [cylinderMetricTime, t.property] |
| 89 | |
| 90 | noncomputable def pulledCylinderMetric |
| 91 | (e : CompatibleSpacetimeCylinder F (smoothInterval K) C) : SpacetimeCylinderMetric e where |
| 92 | metric := fun t ↦ cylinderMetricAt e (cylinderMetricTime K t) |
| 93 | smooth := by |
| 94 | apply interval_family_smoothOn K (cylinderMetricForm_smooth e) |
| 95 | intro t x |
| 96 | simp only [cylinderMetricTime_of_mem] |
| 97 | rfl |
| 98 | spatialTangentEquiv := cylinderSpatialEquiv e |
| 99 | spatialTangentEquiv_eq := cylinderSpatialEquiv_eq e |
| 100 | metric_eq := by |
| 101 | intro t x v w |
| 102 | change cylinderMetricForm e (cylinderMetricTime K t.val) x v w = _ |
| 103 | rw [cylinderMetricTime_of_mem] |
| 104 | rfl |
| 105 | |
| 106 | end Poincare.Spacetime.Realization |