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.Interval.Restriction |
| 2 | |
| 3 | /-! |
| 4 | # Actual worldlines restricted by the coherent interval inclusions |
| 5 | -/ |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | open scoped Manifold ContDiff Topology |
| 11 | |
| 12 | open PoincareMT |
| 13 | |
| 14 | namespace Poincare.Spacetime.Realization |
| 15 | |
| 16 | variable {n : ℕ} {X : Type*} [TopologicalSpace X] {time : X → ℝ} |
| 17 | {I : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 18 | |
| 19 | noncomputable def worldlineTimeRestrict (S : SpacetimeIntervalSystem) |
| 20 | (K L : SpacetimeInterval) (h : L.domain ⊆ K.domain) |
| 21 | (γ : SpacetimeWorldline F (S.interval K)) : SpacetimeWorldline F (S.interval L) where |
| 22 | interval_subset := fun _ ht ↦ γ.interval_subset (h ht) |
| 23 | curve := γ.curve ∘ spacetimeIntervalInclusion (S.interval L) (S.interval K) h |
| 24 | smooth := γ.smooth.comp (S.inclusion_smooth L K h) |
| 25 | time_eq := fun t ↦ γ.time_eq |
| 26 | (spacetimeIntervalInclusion (S.interval L) (S.interval K) h t) |
| 27 | derivative_eq := by |
| 28 | intro t |
| 29 | have hc := mfderiv_comp_apply t |
| 30 | ((γ.smooth _).mdifferentiableAt (by simp)) |
| 31 | ((S.inclusion_smooth L K h t).mdifferentiableAt (by simp)) |
| 32 | ((S.interval L).positiveTangent t) |
| 33 | rw [S.inclusion_derivative, γ.derivative_eq] at hc |
| 34 | exact hc |
| 35 | |
| 36 | noncomputable def embeddingWorldline {K : SpacetimeInterval} {D : SmoothSpacetimeInterval K} |
| 37 | {C : Type*} [TopologicalSpace C] (e : CompatibleSpacetimeEmbedding F D C) (x : C) : |
| 38 | SpacetimeWorldline F D where |
| 39 | interval_subset := e.interval_subset |
| 40 | curve := fun t ↦ e.toSpacetime (t, x) |
| 41 | smooth := e.worldline_smooth x |
| 42 | time_eq := fun t ↦ e.time_eq (t, x) |
| 43 | derivative_eq := fun t ↦ e.worldline_derivative t x |
| 44 | |
| 45 | end Poincare.Spacetime.Realization |