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.ReducedGeometry.LGeometry.Basic |
| 2 | import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace |
| 3 | import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions |
| 4 | import Mathlib.Analysis.Calculus.Deriv.Comp |
| 5 | |
| 6 | /-! |
| 7 | # Differentiating a parametric function along a manifold curve |
| 8 | |
| 9 | The product chain rule separates the explicit parameter derivative from |
| 10 | the spatial derivative. The conclusion retains an actual derivative witness. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped Manifold ContDiff |
| 16 | |
| 17 | namespace PoincareMT.ReducedLength |
| 18 | |
| 19 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 21 | [IsManifold (𝓡 n) ∞ M] |
| 22 | {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] |
| 23 | |
| 24 | set_option backward.isDefEq.respectTransparency false in |
| 25 | theorem hasDerivAt_parametric_curve (f : ℝ × M → W) (γ : ℝ → M) (s : ℝ) |
| 26 | (hf : MDifferentiableAt ((𝓘(ℝ, ℝ)).prod (𝓡 n)) (𝓘(ℝ, W)) f (s, γ s)) |
| 27 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) : |
| 28 | HasDerivAt (fun t ↦ f (t, γ t)) |
| 29 | (deriv (fun t ↦ f (t, γ s)) s + |
| 30 | mvfderiv (𝓡 n) (fun x ↦ f (s, x)) (γ s) (curveVelocity γ s)) s := by |
| 31 | have hgraph := (hasMFDerivAt_id (I := 𝓘(ℝ, ℝ)) s).prodMk hγ.hasMFDerivAt |
| 32 | have hcomp := (hf.hasMFDerivAt.comp s hgraph).hasFDerivAt.hasDerivAt |
| 33 | have hsplit := mfderiv_prod_eq_add_apply |
| 34 | (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n) (I'' := 𝓘(ℝ, W)) |
| 35 | (v := (1, curveVelocity γ s)) hf |
| 36 | have htime : mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, W)) (fun t ↦ f (t, γ s)) s 1 = |
| 37 | deriv (fun t ↦ f (t, γ s)) s := by |
| 38 | exact (congrArg (fun L : ℝ →L[ℝ] W ↦ L 1) |
| 39 | (mfderiv_eq_fderiv (f := fun t ↦ f (t, γ s)) (x := s))).trans |
| 40 | fderiv_apply_one_eq_deriv |
| 41 | have hvalue : mfderiv ((𝓘(ℝ, ℝ)).prod (𝓡 n)) (𝓘(ℝ, W)) f (s, γ s) |
| 42 | (1, curveVelocity γ s) = |
| 43 | deriv (fun t ↦ f (t, γ s)) s + |
| 44 | mvfderiv (𝓡 n) (fun x ↦ f (s, x)) (γ s) (curveVelocity γ s) := by |
| 45 | exact hsplit.trans (congrArg (· + |
| 46 | mvfderiv (𝓡 n) (fun x ↦ f (s, x)) (γ s) (curveVelocity γ s)) htime) |
| 47 | convert! hcomp using 1 |
| 48 | exact hvalue.symm |
| 49 | |
| 50 | end PoincareMT.ReducedLength |