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.ReducedVolume.Analysis.Distance.CurveCalculus |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Regularity.Continuity.MinimizingLifts |
| 3 | import Mathlib.Analysis.Calculus.Deriv.Pow |
| 4 | |
| 5 | /-! |
| 6 | # Kinetic energy of a locally smooth curve |
| 7 | |
| 8 | The energy is the selected metric evaluated on the actual curve velocity. |
| 9 | Its continuity is local on the smooth parameter domain. Reparametrization |
| 10 | by square time is handled directly by the manifold chain rule. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter Bundle |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedVolume |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | set_option backward.isDefEq.respectTransparency false in |
| 26 | /-- The actual kinetic energy is continuous on an open smooth curve domain. -/ |
| 27 | theorem curve_energy_continuousOn (g : RiemannianMetric n M) {γ : ℝ → M} {U : Set ℝ} |
| 28 | (hU : IsOpen U) (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) 1 γ U) : |
| 29 | ContinuousOn (fun s ↦ g.inner (γ s) (curveVelocity γ s) (curveVelocity γ s)) U := by |
| 30 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 31 | ⟨g.toRiemannianMetric⟩ |
| 32 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 33 | (TangentSpace (𝓡 n) : M → Type _) := |
| 34 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 35 | have hsection : Continuous |
| 36 | (fun t : ℝ ↦ (⟨t, (1 : ℝ)⟩ : TangentBundle (𝓘(ℝ, ℝ)) ℝ)) := |
| 37 | (tangentBundleModelSpaceHomeomorph (𝓘(ℝ, ℝ))).symm.continuous.comp |
| 38 | (continuous_id.prodMk continuous_const) |
| 39 | have hD := hγ.continuousOn_tangentMapWithin le_rfl hU.uniqueMDiffOn |
| 40 | have hv : ContinuousOn (fun t : ℝ ↦ (⟨γ t, |
| 41 | mfderivWithin (𝓘(ℝ, ℝ)) (𝓡 n) γ U t 1⟩ : TangentBundle (𝓡 n) M)) U := |
| 42 | hD.comp hsection.continuousOn (fun _ ht ↦ ht) |
| 43 | apply (hv.inner_bundle hv).congr |
| 44 | intro s hs |
| 45 | change g.inner (γ s) (curveVelocity γ s) (curveVelocity γ s) = _ |
| 46 | simp only [curveVelocity, mfderivWithin_of_mem_nhds (hU.mem_nhds hs)] |
| 47 | rfl |
| 48 | |
| 49 | /-- The actual metric energy depends only on the curve germ. -/ |
| 50 | theorem curve_energy_eq_of_eventuallyEq (g : RiemannianMetric n M) |
| 51 | {γ η : ℝ → M} {s : ℝ} (h : γ =ᶠ[𝓝 s] η) : |
| 52 | g.inner (γ s) (curveVelocity γ s) (curveVelocity γ s) = |
| 53 | g.inner (η s) (curveVelocity η s) (curveVelocity η s) := by |
| 54 | unfold curveVelocity |
| 55 | rw [h.mfderiv_eq (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n), h.eq_of_nhds] |
| 56 | |
| 57 | set_option backward.isDefEq.respectTransparency false in |
| 58 | /-- Squaring the parameter multiplies actual kinetic energy by four times parameter squared. -/ |
| 59 | theorem curve_energy_comp_square (g : RiemannianMetric n M) {γ : ℝ → M} {s : ℝ} |
| 60 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ (s ^ 2)) : |
| 61 | g.inner (γ (s ^ 2)) (curveVelocity (fun r : ℝ ↦ γ (r ^ 2)) s) |
| 62 | (curveVelocity (fun r : ℝ ↦ γ (r ^ 2)) s) = |
| 63 | (2 * s) ^ 2 * g.inner (γ (s ^ 2)) |
| 64 | (curveVelocity γ (s ^ 2)) (curveVelocity γ (s ^ 2)) := by |
| 65 | have hsq : HasDerivAt (fun r : ℝ ↦ r ^ 2) (2 * s) s := by |
| 66 | simpa using hasDerivAt_pow 2 s |
| 67 | have hc := mfderiv_comp (f := fun r : ℝ ↦ r ^ 2) s hγ |
| 68 | hsq.differentiableAt.mdifferentiableAt |
| 69 | simp only [Function.comp_def] at hc |
| 70 | unfold curveVelocity |
| 71 | rw [hc, mfderiv_eq_fderiv, hsq.hasFDerivAt.fderiv] |
| 72 | have hv : mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) γ (s ^ 2) (2 * s) = |
| 73 | (2 * s) • mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) γ (s ^ 2) 1 := by |
| 74 | simpa only [smul_eq_mul, mul_one] using |
| 75 | (mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) γ (s ^ 2)).map_smul (2 * s) (1 : ℝ) |
| 76 | simp only [ContinuousLinearMap.comp_apply] |
| 77 | change g.inner (γ (s ^ 2)) |
| 78 | (mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) γ (s ^ 2) (1 * (2 * s))) |
| 79 | (mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) γ (s ^ 2) (1 * (2 * s))) = _ |
| 80 | rw [one_mul, hv] |
| 81 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 82 | ring |
| 83 | |
| 84 | end PoincareMT.ReducedVolume |