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 evaluation of derivatives on open domains |
| 5 | -/ |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | open Set Bundle |
| 11 | open scoped Manifold ContDiff Bundle Topology |
| 12 | |
| 13 | namespace Poincare.Spacetime.Realization |
| 14 | |
| 15 | theorem derivative_apply_smooth_on_open |
| 16 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 17 | {H : Type*} [TopologicalSpace H] {I : ModelWithCorners ℝ E H} |
| 18 | {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [IsManifold I ∞ M] |
| 19 | {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 20 | {f : M → F} {s : Set M} (hf : ContMDiffOn I 𝓘(ℝ, F) ∞ f s) (hs : IsOpen s) : |
| 21 | ContMDiffOn (I.prod 𝓘(ℝ, E)) 𝓘(ℝ, F) ∞ |
| 22 | (fun v : TangentBundle I M ↦ mfderiv I 𝓘(ℝ, F) f v.proj v.2) |
| 23 | ((π E (TangentSpace I : M → Type _)) ⁻¹' s) := by |
| 24 | have ht := hf.contMDiffOn_tangentMapWithin (m := ∞) (by simp) hs.uniqueMDiffOn |
| 25 | have h := (contMDiff_snd_tangentBundle_modelSpace F 𝓘(ℝ, F)).comp_contMDiffOn ht |
| 26 | apply h.congr |
| 27 | intro v hv |
| 28 | change mfderiv I 𝓘(ℝ, F) f v.proj v.2 = mfderivWithin I 𝓘(ℝ, F) f s v.proj v.2 |
| 29 | rw [mfderivWithin_of_isOpen hs hv] |
| 30 | |
| 31 | end Poincare.Spacetime.Realization |