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.ContMDiff.NormedSpace |
| 2 | import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions |
| 3 | |
| 4 | /-! |
| 5 | # Actual differentials of a smooth manifold retraction |
| 6 | |
| 7 | The ambient composite is smooth, and differentiating the retraction |
| 8 | identity gives the actual left inverse on tangent spaces. MT2007 |
| 9 | Claim 19.1, p. 437; `2026-09-21-geometric-retraction-identities.md`, item 2. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff |
| 17 | |
| 18 | universe u v w |
| 19 | |
| 20 | namespace PoincareMT.M63 |
| 21 | |
| 22 | variable {E : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 23 | {V : Type v} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 24 | {M : Type w} [TopologicalSpace M] [ChartedSpace E M] |
| 25 | |
| 26 | /-- A smooth manifold retraction gives the actual ambient derivative |
| 27 | factorization and a left inverse on every tangent space. MT2007 |
| 28 | Claim 19.1, p. 437; geometric retraction derivation, item 2. -/ |
| 29 | theorem smooth_retraction_differentials [IsManifold 𝓘(ℝ, E) ∞ M] {e : M → V} |
| 30 | (he : ContMDiff 𝓘(ℝ, E) 𝓘(ℝ, V) ∞ e) {U : Set V} (hU : IsOpen U) |
| 31 | (heU : range e ⊆ U) {ρ : V → M} |
| 32 | (hρ : ContMDiffOn 𝓘(ℝ, V) 𝓘(ℝ, E) ∞ ρ U) (hρe : ∀ p, ρ (e p) = p) : |
| 33 | ContDiffOn ℝ ∞ (e ∘ ρ) U ∧ |
| 34 | (∀ z ∈ U, ∀ v : V, fderiv ℝ (e ∘ ρ) z v = |
| 35 | mfderiv 𝓘(ℝ, E) 𝓘(ℝ, V) e (ρ z) (mfderiv 𝓘(ℝ, V) 𝓘(ℝ, E) ρ z v)) ∧ |
| 36 | ∀ p : M, ∀ v : TangentSpace 𝓘(ℝ, E) p, |
| 37 | mfderiv 𝓘(ℝ, V) 𝓘(ℝ, E) ρ (e p) (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, V) e p v) = v := by |
| 38 | refine ⟨(he.comp_contMDiffOn hρ).contDiffOn, ?_, ?_⟩ |
| 39 | · intro z hz v |
| 40 | have hchain : fderiv ℝ (e ∘ ρ) z = |
| 41 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, V) e (ρ z)).comp |
| 42 | (mfderiv 𝓘(ℝ, V) 𝓘(ℝ, E) ρ z) := by |
| 43 | rw [← mfderiv_eq_fderiv] |
| 44 | exact mfderiv_comp z (he.mdifferentiable (by simp)).mdifferentiableAt |
| 45 | ((hρ.contMDiffAt (hU.mem_nhds hz)).mdifferentiableAt (by simp)) |
| 46 | exact congrArg (fun L : V →L[ℝ] V => L v) hchain |
| 47 | · intro p v |
| 48 | have hchain := mfderiv_comp p |
| 49 | ((hρ.contMDiffAt (hU.mem_nhds (heU (mem_range_self p)))).mdifferentiableAt (by simp)) |
| 50 | (he.mdifferentiable (by simp)).mdifferentiableAt |
| 51 | have heq : ρ ∘ e = id := funext hρe |
| 52 | rw [heq, mfderiv_id] at hchain |
| 53 | exact (congrArg (fun L : E →L[ℝ] E => L v) hchain).symm |
| 54 | |
| 55 | end PoincareMT.M63 |