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.ContMDiffMFDeriv |
| 2 | |
| 3 | /-! |
| 4 | # Smooth within derivatives applied to a fixed source vector |
| 5 | |
| 6 | The velocity-regularity step in Morgan-Tian Lemma 6.8, pp. 108-109. |
| 7 | Unique derivatives on the source set suffice; no open-domain extension |
| 8 | is used to prove smoothness of the bundled tangent derivative. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle |
| 14 | |
| 15 | variable {𝕜 E E' H M : Type*} [NontriviallyNormedField 𝕜] |
| 16 | [NormedAddCommGroup E] [NormedSpace 𝕜 E] |
| 17 | [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] |
| 18 | [TopologicalSpace H] {I : ModelWithCorners 𝕜 E' H} |
| 19 | [TopologicalSpace M] [ChartedSpace H M] [IsManifold I 1 M] |
| 20 | {U : Set E} {α : E → M} {m k : ℕ∞ω} |
| 21 | |
| 22 | /-- Applying the within derivative to a constant source vector preserves |
| 23 | smoothness with one derivative lost, as used in Lemma 6.8, pp. 108-109. -/ |
| 24 | theorem ContMDiffOn.contMDiffOn_mfderivWithin_const_apply |
| 25 | (hα : ContMDiffOn (𝓘(𝕜, E)) I m α U) (hU : UniqueDiffOn 𝕜 U) |
| 26 | (v : E) (hkm : k + 1 ≤ m) : |
| 27 | ContMDiffOn (𝓘(𝕜, E)) I.tangent k |
| 28 | (fun s => Bundle.TotalSpace.mk' E' (α s) |
| 29 | (mfderivWithin (𝓘(𝕜, E)) I α U s v)) U := by |
| 30 | have hv : ContMDiff (𝓘(𝕜, E)) (𝓘(𝕜, E)).tangent k |
| 31 | (fun s : E => (⟨s, v⟩ : TangentBundle (𝓘(𝕜, E)) E)) := by |
| 32 | apply contMDiff_vectorSpace_iff_contDiff.mpr |
| 33 | exact contDiff_const |
| 34 | exact (hα.contMDiffOn_tangentMapWithin hkm hU.uniqueMDiffOn).comp |
| 35 | hv.contMDiffOn (fun _ hs => hs) |