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.Geometry.Manifold.ContMDiff.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Differential of the actual inclusion of an open spatial domain |
| 6 | -/ |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set |
| 12 | open scoped Manifold ContDiff Topology |
| 13 | |
| 14 | namespace Poincare.Spacetime.Realization |
| 15 | |
| 16 | theorem mfderiv_openSubtype_val {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 17 | (U : TopologicalSpace.Opens E) (x : U) : |
| 18 | mfderiv 𝓘(ℝ, E) 𝓘(ℝ, E) (Subtype.val : U → E) x = |
| 19 | ContinuousLinearMap.id ℝ E := by |
| 20 | have hd : MDifferentiableAt 𝓘(ℝ, E) 𝓘(ℝ, E) (Subtype.val : U → E) x := |
| 21 | contMDiff_subtype_val.mdifferentiableAt (n := ∞) (by simp) |
| 22 | have heq := TopologicalSpace.Opens.chartAt_subtype_val_symm_eventuallyEq |
| 23 | (H := E) U (x := x) |
| 24 | change (id : E → E) =ᶠ[𝓝 x.val] Subtype.val ∘ (chartAt E x).symm at heq |
| 25 | rw [hd.mfderiv] |
| 26 | have hderiv := heq.symm.fderiv_eq (𝕜 := ℝ) |
| 27 | have hx : chartAt E x x = x.val := rfl |
| 28 | simpa only [writtenInExtChartAt, extChartAt, mfld_simps, fderivWithin_univ, fderiv_id, hx] |
| 29 | using hderiv |
| 30 | |
| 31 | end Poincare.Spacetime.Realization |