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.Generalized.ReducedGeometry.SourceNames.Realization |
| 2 | import PoincareLib.Geometry.Spacetime.Realization.Box.Spatial.Calculus |
| 3 | import Mathlib.Geometry.Manifold.MFDeriv.FDeriv |
| 4 | |
| 5 | /-! |
| 6 | # Actual velocity in an open Euclidean subset |
| 7 | |
| 8 | The coordinate calculation in Morgan-Tian Definitions 6.1-6.2, |
| 9 | pp. 105-106, uses the actual derivative of the spatial inclusion. |
| 10 | M11 identifies that inclusion differential with the identity. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- Both tangent fibers retain the same ambient vector-space model. |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | namespace TopologicalSpace.Opens |
| 20 | |
| 21 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 22 | |
| 23 | /-- A differentiable curve in an open subset has the ambient inclusion |
| 24 | velocity, the coordinate identity in Definitions 6.1-6.2, pp. 105-106. -/ |
| 25 | theorem mfderiv_curve_eq_deriv_val (U : Opens E) {f : ℝ → U} {s : ℝ} |
| 26 | (hf : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) f s) : |
| 27 | mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) f s (1 : ℝ) = deriv (fun t => (f t).val) s := by |
| 28 | have hi : MDifferentiableAt (𝓘(ℝ, E)) (𝓘(ℝ, E)) (Subtype.val : U → E) (f s) := |
| 29 | contMDiff_subtype_val.mdifferentiableAt (n := ∞) (by simp) |
| 30 | have hd := mfderiv_comp_apply s hi hf (1 : ℝ) |
| 31 | rw [PoincareMT.Proofs.M11.mfderiv_openSubtype_val, mfderiv_eq_fderiv] at hd |
| 32 | change fderiv ℝ (fun t => (f t).val) s (1 : ℝ) = |
| 33 | mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) f s (1 : ℝ) at hd |
| 34 | exact hd.symm |
| 35 | |
| 36 | /-- The same actual inclusion velocity identity holds for unique |
| 37 | within derivatives, including closed endpoints in Lemma 6.8, |
| 38 | pp. 108-109. -/ |
| 39 | theorem mfderivWithin_curve_eq_derivWithin_val (U : Opens E) |
| 40 | {f : ℝ → U} {J : Set ℝ} {s : ℝ} |
| 41 | (hf : MDifferentiableWithinAt (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) f J s) |
| 42 | (hJ : UniqueDiffWithinAt ℝ J s) : |
| 43 | mfderivWithin (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) f J s (1 : ℝ) = |
| 44 | derivWithin (fun t => (f t).val) J s := by |
| 45 | have hi : MDifferentiableAt (𝓘(ℝ, E)) (𝓘(ℝ, E)) (Subtype.val : U → E) (f s) := |
| 46 | contMDiff_subtype_val.mdifferentiableAt (n := ∞) (by simp) |
| 47 | have hd := congrArg (fun L => L (1 : ℝ)) |
| 48 | (mfderiv_comp_mfderivWithin s hi hf hJ.uniqueMDiffWithinAt) |
| 49 | rw [PoincareMT.Proofs.M11.mfderiv_openSubtype_val, mfderivWithin_eq_fderivWithin] at hd |
| 50 | change fderivWithin ℝ (fun t => (f t).val) J s (1 : ℝ) = |
| 51 | mfderivWithin (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) f J s (1 : ℝ) at hd |
| 52 | exact hd.symm |
| 53 | |
| 54 | end TopologicalSpace.Opens |