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.Generalized.ReducedGeometry.Variation.Pullback.OpenSurfaceFields |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Add |
| 3 | |
| 4 | /-! |
| 5 | # Actual clocks of an original-time variation surface |
| 6 | |
| 7 | Morgan-Tian Definition 6.2 and Lemma 6.4, pp. 106-108. A surface |
| 8 | with clock T-s has first clock derivative -1 and second clock derivative |
| 9 | zero. Its actual second tangent is therefore horizontal. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- The real tangent fiber is the scalar codomain of the frozen clock derivative. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {α : ℝ × ℝ → G.Point} {J P : Set ℝ} {T s v : ℝ} |
| 26 | |
| 27 | /-- The actual first partial tangent has clock derivative -1, |
| 28 | Definition 6.2 and Lemma 6.4, pp. 106-108. -/ |
| 29 | theorem surface_time_clock (hJ : IsOpen J) (hP : IsOpen P) |
| 30 | (hα : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ α (J ×ˢ P)) |
| 31 | (hclock : ∀ z ∈ J ×ˢ P, G.spacetime.timeFunction (α z) = T - z.1) |
| 32 | (hs : s ∈ J) (hv : v ∈ P) : |
| 33 | (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) G.spacetime.timeFunction (α (s, v)) |
| 34 | (mfderiv (𝓘(ℝ, ℝ)) (spacetimeModel n) (fun r => α (r, v)) s (1 : ℝ))) = -1 := by |
| 35 | have hγ := (((hα _ ⟨hs, hv⟩).contMDiffAt ((hJ.prod hP).mem_nhds ⟨hs, hv⟩)).mdifferentiableAt |
| 36 | (by simp)).comp s (mdifferentiableAt_id.prodMk mdifferentiableAt_const) |
| 37 | have htime : ContMDiff (spacetimeModel n) 𝓘(ℝ) ∞ G.spacetime.timeFunction := |
| 38 | G.spacetime.time_smooth |
| 39 | have hd := ((htime.mdifferentiable (by simp) (α (s, v))).hasMFDerivAt.comp s |
| 40 | hγ.hasMFDerivAt).hasFDerivAt.hasDerivAt |
| 41 | have hc : HasDerivAt (fun r => G.spacetime.timeFunction (α (r, v))) (-1) s := by |
| 42 | apply (show HasDerivAt (fun r : ℝ => T - r) (-1) s from by |
| 43 | exact (hasDerivAt_id s).const_sub T).congr_of_eventuallyEq |
| 44 | filter_upwards [hJ.mem_nhds hs] with r hr |
| 45 | exact hclock (r, v) ⟨hr, hv⟩ |
| 46 | exact hd.unique hc |
| 47 | |
| 48 | /-- The actual variation tangent has zero clock derivative, |
| 49 | the fixed-time variation in Lemma 6.4, pp. 107-108. -/ |
| 50 | theorem surface_parameter_clock (hJ : IsOpen J) (hP : IsOpen P) |
| 51 | (hα : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ α (J ×ˢ P)) |
| 52 | (hclock : ∀ z ∈ J ×ˢ P, G.spacetime.timeFunction (α z) = T - z.1) |
| 53 | (hs : s ∈ J) (hv : v ∈ P) : |
| 54 | (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) G.spacetime.timeFunction (α (s, v)) |
| 55 | (mfderiv (𝓘(ℝ, ℝ)) (spacetimeModel n) (fun u => α (s, u)) v (1 : ℝ))) = 0 := by |
| 56 | have hγ := (((hα _ ⟨hs, hv⟩).contMDiffAt ((hJ.prod hP).mem_nhds ⟨hs, hv⟩)).mdifferentiableAt |
| 57 | (by simp)).comp v (mdifferentiableAt_const.prodMk mdifferentiableAt_id) |
| 58 | have htime : ContMDiff (spacetimeModel n) 𝓘(ℝ) ∞ G.spacetime.timeFunction := |
| 59 | G.spacetime.time_smooth |
| 60 | have hd := ((htime.mdifferentiable (by simp) (α (s, v))).hasMFDerivAt.comp v |
| 61 | hγ.hasMFDerivAt).hasFDerivAt.hasDerivAt |
| 62 | have hc : HasDerivAt (fun u => G.spacetime.timeFunction (α (s, u))) 0 v := by |
| 63 | apply (hasDerivAt_const v (T - s)).congr_of_eventuallyEq |
| 64 | filter_upwards [hP.mem_nhds hv] with u hu |
| 65 | exact hclock (s, u) ⟨hs, hu⟩ |
| 66 | exact hd.unique hc |
| 67 | |
| 68 | /-- The horizontal second partial equals the actual variation tangent |
| 69 | when the clock is fixed, Lemma 6.4, pp. 107-108. -/ |
| 70 | theorem surfaceHorizontalSnd_val (hJ : IsOpen J) (hP : IsOpen P) |
| 71 | (hα : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ α (J ×ˢ P)) |
| 72 | (hclock : ∀ z ∈ J ×ˢ P, G.spacetime.timeFunction (α z) = T - z.1) |
| 73 | (hs : s ∈ J) (hv : v ∈ P) : |
| 74 | (surfaceHorizontalSnd α s v).val = |
| 75 | mfderiv (𝓘(ℝ, ℝ)) (spacetimeModel n) (fun u => α (s, u)) v (1 : ℝ) := by |
| 76 | unfold surfaceHorizontalSnd |
| 77 | rw [G.spacetime.horizontalProjection_eq] |
| 78 | change mfderiv (𝓘(ℝ, ℝ)) (spacetimeModel n) (fun u => α (s, u)) v (1 : ℝ) - |
| 79 | (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) G.spacetime.timeFunction (α (s, v)) |
| 80 | (mfderiv (𝓘(ℝ, ℝ)) (spacetimeModel n) (fun u => α (s, u)) v (1 : ℝ))) • |
| 81 | G.spacetime.timeVector (α (s, v)) = _ |
| 82 | rw [surface_parameter_clock hJ hP hα hclock hs hv, zero_smul, sub_zero] |
| 83 | |
| 84 | end PoincareMT.M14 |