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.ReducedGeometry.ReducedLength.Coordinates.CurvePhase |
| 2 | import Mathlib.Geometry.Manifold.MFDeriv.FDeriv |
| 3 | import Mathlib.Analysis.Calculus.FDeriv.Prod |
| 4 | |
| 5 | /-! |
| 6 | # The actual phase of a smooth parameter family |
| 7 | |
| 8 | The time-slice velocity is the manifold derivative in the constant direction |
| 9 | (0,1). Its bundled tangent map is smooth in both the parameter and time. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u v |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] |
| 24 | {E : Type v} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 25 | |
| 26 | noncomputable def familyPhase (f : E × ℝ → M) (z : E × ℝ) : TangentBundle (𝓡 n) M := |
| 27 | curvePhase (n := n) (fun s ↦ f (z.1, s)) z.2 |
| 28 | |
| 29 | set_option backward.isDefEq.respectTransparency false in |
| 30 | theorem curveVelocity_timeSlice (f : E × ℝ → M) (z : E × ℝ) |
| 31 | (hf : MDifferentiableAt (𝓘(ℝ, E × ℝ)) (𝓡 n) f z) : |
| 32 | curveVelocity (n := n) (fun s ↦ f (z.1, s)) z.2 = |
| 33 | (mfderiv (𝓘(ℝ, E × ℝ)) (𝓡 n) f z) (0, 1) := by |
| 34 | let i : ℝ → E × ℝ := fun s ↦ (z.1, s) |
| 35 | have hi : HasFDerivAt i |
| 36 | ((0 : ℝ →L[ℝ] E).prod (ContinuousLinearMap.id ℝ ℝ)) z.2 := |
| 37 | (hasFDerivAt_const z.1 z.2).prodMk (hasFDerivAt_id z.2) |
| 38 | change (mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) (f ∘ i) z.2) 1 = _ |
| 39 | rw [mfderiv_comp z.2 (show MDifferentiableAt (𝓘(ℝ, E × ℝ)) (𝓡 n) f (i z.2) from hf) |
| 40 | hi.hasMFDerivAt.mdifferentiableAt, hi.hasMFDerivAt.mfderiv] |
| 41 | rfl |
| 42 | |
| 43 | set_option backward.isDefEq.respectTransparency false in |
| 44 | theorem familyPhase_contMDiffOn (f : E × ℝ → M) (U : Set (E × ℝ)) (hU : IsOpen U) |
| 45 | (hf : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓡 n) ∞ f U) : |
| 46 | ContMDiffOn (𝓘(ℝ, E × ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ (familyPhase (n := n) f) U := by |
| 47 | have hmodel : ContMDiff ((𝓘(ℝ, E × ℝ)).prod (𝓘(ℝ, E × ℝ))) |
| 48 | ((𝓘(ℝ, E × ℝ)).prod (𝓘(ℝ, E × ℝ))) ∞ |
| 49 | (fun z : (E × ℝ) × (E × ℝ) ↦ |
| 50 | (⟨z.1, z.2⟩ : TangentBundle (𝓘(ℝ, E × ℝ)) (E × ℝ))) := by |
| 51 | convert! (contMDiff_tangentBundleModelSpaceHomeomorph_symm |
| 52 | (I := 𝓘(ℝ, E × ℝ)) (n := ∞)) using 1 |
| 53 | rw [chartedSpaceSelf_prod] |
| 54 | rfl |
| 55 | have hs : ContMDiff (𝓘(ℝ, E × ℝ)) |
| 56 | ((𝓘(ℝ, E × ℝ)).prod (𝓘(ℝ, E × ℝ))) ∞ |
| 57 | (fun z : E × ℝ ↦ (⟨z, (0, 1)⟩ : TangentBundle (𝓘(ℝ, E × ℝ)) (E × ℝ))) := |
| 58 | hmodel.comp (contMDiff_id.prodMk contMDiff_const) |
| 59 | have h := (hf.contMDiffOn_tangentMapWithin (m := ∞) (by simp) hU.uniqueMDiffOn).comp |
| 60 | hs.contMDiffOn (fun z hz ↦ hz) |
| 61 | apply h.congr |
| 62 | intro z hz |
| 63 | change (⟨f z, curveVelocity (n := n) (fun s ↦ f (z.1, s)) z.2⟩ : TangentBundle (𝓡 n) M) = |
| 64 | ⟨f z, (mfderivWithin (𝓘(ℝ, E × ℝ)) (𝓡 n) f U z) (0, 1)⟩ |
| 65 | rw [mfderivWithin_of_isOpen hU hz, |
| 66 | curveVelocity_timeSlice f z ((hf.contMDiffAt (hU.mem_nhds hz)).mdifferentiableAt (by simp))] |
| 67 | |
| 68 | end PoincareMT.ReducedLength |