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 Mathlib.Geometry.Manifold.MFDeriv.NormedSpace |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Mul |
| 3 | |
| 4 | /-! |
| 5 | # A moving linear map along a manifold curve |
| 6 | |
| 7 | The product rule for the projection coefficients in Morgan-Tian |
| 8 | Lemma 6.4, pp. 107-108. Both the coefficient and its vector argument |
| 9 | may move; the coefficient derivative is written as the actual |
| 10 | manifold differential of its fixed-vector evaluation. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped Manifold |
| 16 | |
| 17 | variable {E H M V W : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 18 | [TopologicalSpace H] {I : ModelWithCorners ℝ E H} |
| 19 | [TopologicalSpace M] [ChartedSpace H M] |
| 20 | [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedAddCommGroup W] [NormedSpace ℝ W] |
| 21 | |
| 22 | -- Vector-valued manifold differentials use the same tangent-space aliases as Fréchet derivatives. |
| 23 | set_option backward.isDefEq.respectTransparency false in |
| 24 | /-- The derivative of a moving operator applied to a moving vector |
| 25 | along a manifold curve, in Lemma 6.4, pp. 107-108. -/ |
| 26 | theorem moving_linearMap_comp_hasDerivAt {f : M → V →L[ℝ] W} |
| 27 | {γ : ℝ → M} {v : ℝ → V} {s : ℝ} {k : V} |
| 28 | (hf : MDifferentiableAt I 𝓘(ℝ, V →L[ℝ] W) f (γ s)) |
| 29 | (hγ : MDifferentiableAt 𝓘(ℝ) I γ s) (hv : HasDerivAt v k s) : |
| 30 | HasDerivAt (fun r => f (γ r) (v r)) |
| 31 | (mvfderiv I (fun p => f p (v s)) (γ s) (mfderiv 𝓘(ℝ) I γ s (1 : ℝ)) + |
| 32 | f (γ s) k) s := by |
| 33 | have hc := (hf.comp s hγ).differentiableAt.hasDerivAt |
| 34 | have hconst := hc.clm_apply (hasDerivAt_const s (v s)) |
| 35 | have hfixed := ((hf.clm_apply (mdifferentiableAt_const (c := v s))).hasMFDerivAt.comp s |
| 36 | hγ.hasMFDerivAt).hasFDerivAt.hasDerivAt |
| 37 | change HasDerivAt (fun r => f (γ r) (v s)) |
| 38 | (mvfderiv I (fun p => f p (v s)) (γ s) (mfderiv 𝓘(ℝ) I γ s (1 : ℝ))) s at hfixed |
| 39 | have hd : deriv (f ∘ γ) s (v s) = |
| 40 | mvfderiv I (fun p => f p (v s)) (γ s) (mfderiv 𝓘(ℝ) I γ s (1 : ℝ)) := by |
| 41 | simpa only [map_zero, add_zero] using hconst.unique hfixed |
| 42 | convert! hc.clm_apply hv using 1 |
| 43 | exact congrArg (fun w => w + f (γ s) k) hd.symm |