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.Gluing.TimeCover |
| 2 | |
| 3 | /-! |
| 4 | # Actual derivatives of the glued cylinder |
| 5 | -/ |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | open Set Function |
| 11 | open scoped Manifold ContDiff Topology |
| 12 | |
| 13 | universe u v w |
| 14 | |
| 15 | open PoincareMT |
| 16 | |
| 17 | namespace Poincare.Spacetime.Realization.CylinderTimeCover |
| 18 | |
| 19 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 20 | {I K : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 21 | {C : Type v} [TopologicalSpace C] [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] |
| 22 | [IsManifold (𝓡 n) ∞ C] (D : CylinderTimeCover.{u, v, w} F K C) |
| 23 | |
| 24 | theorem map_worldline_smooth (x : C) : |
| 25 | ContMDiff (𝓡∂ 1) (spacetimeModel n) ∞ |
| 26 | (fun t : (smoothInterval K).Point ↦ D.map (t, x)) := |
| 27 | D.map_smooth.comp (contMDiff_id.prodMk contMDiff_const) |
| 28 | |
| 29 | theorem map_worldline_derivative (t : (smoothInterval K).Point) (x : C) : |
| 30 | mfderiv (𝓡∂ 1) (spacetimeModel n) (fun s : (smoothInterval K).Point ↦ D.map (s, x)) t |
| 31 | ((smoothInterval K).positiveTangent t) = F.timeVector (D.map (t, x)) := by |
| 32 | let := F.chartedSpace |
| 33 | let := intervalChartedSpace K |
| 34 | obtain ⟨b, hb⟩ := D.covers t |
| 35 | let := intervalChartedSpace (D.interval b) |
| 36 | let r : (smoothInterval (D.interval b)).Point := ⟨t.val, hb⟩ |
| 37 | let j := spacetimeIntervalInclusion (smoothInterval (D.interval b)) |
| 38 | (smoothInterval K) (D.subset b) |
| 39 | have heq : (fun s ↦ D.map (s, x)) ∘ j = |
| 40 | (fun s ↦ (D.cylinder b).toSpacetime (s, x)) := funext fun s ↦ D.map_eq b s x |
| 41 | have hc := mfderiv_comp_apply r |
| 42 | ((D.map_worldline_smooth x (j r)).mdifferentiableAt (by simp)) |
| 43 | ((smoothInterval_inclusion_smooth (D.interval b) K (D.subset b) r).mdifferentiableAt (by simp)) |
| 44 | ((smoothInterval (D.interval b)).positiveTangent r) |
| 45 | rw [heq, smoothInterval_inclusion_derivative, (D.cylinder b).worldline_derivative, |
| 46 | ← D.map_eq b r x] at hc |
| 47 | exact hc.symm |
| 48 | |
| 49 | theorem map_differential_injective (p : (smoothInterval K).Point × C) : |
| 50 | Function.Injective (mfderiv (spacetimeModel n) (spacetimeModel n) D.map p) := by |
| 51 | let := F.chartedSpace |
| 52 | let := intervalChartedSpace K |
| 53 | obtain ⟨b, hb⟩ := D.covers p.1 |
| 54 | let := intervalChartedSpace (D.interval b) |
| 55 | let r : (smoothInterval (D.interval b)).Point × C := (⟨p.1.val, hb⟩, p.2) |
| 56 | let j := Prod.map (spacetimeIntervalInclusion (smoothInterval (D.interval b)) |
| 57 | (smoothInterval K) (D.subset b)) (id : C → C) |
| 58 | have heq : D.map ∘ j = (D.cylinder b).toSpacetime := funext fun q ↦ D.map_eq b q.1 q.2 |
| 59 | have hjSmooth := (smoothInterval_inclusion_smooth (D.interval b) K (D.subset b)).prodMap |
| 60 | (contMDiff_id (I := 𝓡 n) (M := C)) |
| 61 | have hc := mfderiv_comp r ((D.map_smooth (j r)).mdifferentiableAt (by simp)) |
| 62 | ((hjSmooth r).mdifferentiableAt (by simp)) |
| 63 | rw [heq] at hc |
| 64 | have hp : j r = p := Prod.ext (Subtype.ext rfl) rfl |
| 65 | suffices hi : Function.Injective |
| 66 | (mfderiv (spacetimeModel n) (spacetimeModel n) D.map (j r)) from hp ▸ hi |
| 67 | have hi : Function.Injective |
| 68 | ((mfderiv (spacetimeModel n) (spacetimeModel n) D.map (j r)).comp |
| 69 | (mfderiv (spacetimeModel n) (spacetimeModel n) j r)) := by |
| 70 | rw [← hc] |
| 71 | exact (D.cylinder b).differential_injective r |
| 72 | have hj := interval_product_differential_surjective (IM := 𝓡 n) K (D.interval b) |
| 73 | (D.subset b) (D.open_time b) r |
| 74 | intro v w hvw |
| 75 | obtain ⟨v', rfl⟩ := hj v |
| 76 | obtain ⟨w', rfl⟩ := hj w |
| 77 | exact congrArg (mfderiv (spacetimeModel n) (spacetimeModel n) j r) (hi hvw) |
| 78 | |
| 79 | end Poincare.Spacetime.Realization.CylinderTimeCover |