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.LGeometry.Basic |
| 2 | import PoincareLib.Geometry.Riemannian.Tensor.Operations |
| 3 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic |
| 4 | |
| 5 | /-! |
| 6 | # Curve shortening in an ambient Ricci flow |
| 7 | |
| 8 | The real parameter interval below is a periodic representative of `S¹`. |
| 9 | All vector derivatives below use the actual spatial Levi-Civita connection. |
| 10 | The milestone retains the corrected upper bounds; constructing the auxiliary |
| 11 | spacetime curvature used in their source proof is not part of these definitions. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] |
| 25 | variable {t₀ t₁ : ℝ} |
| 26 | variable {F : RicciFlow n M (Set.Icc t₀ t₁)} |
| 27 | |
| 28 | /-- The period of the real representative of the parameter circle. -/ |
| 29 | noncomputable def curvePeriod : ℝ := 2 * Real.pi |
| 30 | |
| 31 | /-- Speed of a periodic curve at a fixed time. -/ |
| 32 | noncomputable def curveSpeed (F : RicciFlow n M (Set.Icc t₀ t₁)) |
| 33 | (curve : ℝ → ℝ → M) (t x : ℝ) : ℝ := |
| 34 | (F.metric t).tangentNorm (curve x t) |
| 35 | (curveVelocity (n := n) (fun y ↦ curve y t) x) |
| 36 | |
| 37 | /-- Unit tangent in the increasing parameter direction. -/ |
| 38 | noncomputable def spatialUnitTangent (F : RicciFlow n M (Set.Icc t₀ t₁)) |
| 39 | (curve : ℝ → ℝ → M) (t x : ℝ) : TangentSpace (𝓡 n) (curve x t) := |
| 40 | (curveSpeed F curve t x)⁻¹ • |
| 41 | curveVelocity (n := n) (fun y ↦ curve y t) x |
| 42 | |
| 43 | namespace CurveShrinkingFlow |
| 44 | |
| 45 | /-- A smooth immersed periodic family in the ambient Ricci flow. -/ |
| 46 | structure Data (F : RicciFlow n M (Set.Icc t₀ t₁)) where |
| 47 | curve : ℝ → ℝ → M |
| 48 | time_nontrivial : t₀ < t₁ |
| 49 | regular : ∀ t : ℝ, ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) 2 |
| 50 | (fun x ↦ curve x t) Set.univ |
| 51 | time_regular : ∀ x : ℝ, ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) 2 |
| 52 | (fun t ↦ curve x t) (Set.Icc t₀ t₁) |
| 53 | joint_regular : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (𝓡 n) ∞ |
| 54 | (fun z : ℝ × ℝ ↦ curve z.1 z.2) (Set.univ ×ˢ Set.Icc t₀ t₁) |
| 55 | periodic : ∀ (x t : ℝ), curve (x + curvePeriod) t = curve x t |
| 56 | immersed : ∀ (x t : ℝ), |
| 57 | curveVelocity (n := n) (fun y ↦ curve y t) x ≠ 0 |
| 58 | spatial_unit_extension : |
| 59 | ∀ (t : ℝ), |
| 60 | SmoothAlongCurveExtensionOn Set.univ |
| 61 | (fun x ↦ curve x t) |
| 62 | (fun x ↦ spatialUnitTangent F (curve := curve) t x) |
| 63 | |
| 64 | end CurveShrinkingFlow |
| 65 | |
| 66 | open CurveShrinkingFlow |
| 67 | |
| 68 | /-- Curvature vector `H = ∇_S S`, using the supplied local unit-tangent extension. -/ |
| 69 | noncomputable def curveCurvatureVector |
| 70 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) (t x : ℝ) : |
| 71 | TangentSpace (𝓡 n) (P.curve x t) := |
| 72 | alongCovariantDerivative F (fun _ ↦ t) (fun y ↦ P.curve y t) |
| 73 | (fun y ↦ spatialUnitTangent F P.curve t y) Set.univ (P.spatial_unit_extension t) |
| 74 | (spatialUnitTangent F P.curve t) x (by simp) |
| 75 | |
| 76 | /-- The curve-shrinking equation `∂ₜc = H`. -/ |
| 77 | def SatisfiesCurveShrinkingEquation |
| 78 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) : Prop := |
| 79 | ∀ (x t : ℝ), t ∈ Set.Icc t₀ t₁ → |
| 80 | curveVelocity (n := n) (fun s ↦ P.curve x s) t = |
| 81 | curveCurvatureVector P t x |
| 82 | |
| 83 | /-- Squared curvature `k² = ⟨H,H⟩`. -/ |
| 84 | noncomputable def curveCurvatureSquared |
| 85 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) (t x : ℝ) : ℝ := |
| 86 | (F.metric t).inner (P.curve x t) (curveCurvatureVector P t x) |
| 87 | (curveCurvatureVector P t x) |
| 88 | |
| 89 | /-- Curvature `k = |H|`, totalized by the nonnegative square root. -/ |
| 90 | noncomputable def curveCurvature |
| 91 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) (t x : ℝ) : ℝ := |
| 92 | Real.sqrt (curveCurvatureSquared P t x) |
| 93 | |
| 94 | /-- The normal component of `∇_S H`. -/ |
| 95 | noncomputable def normalCovariantDerivative |
| 96 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) (t x : ℝ) |
| 97 | (E : SmoothAlongCurveExtensionOn Set.univ |
| 98 | (fun y ↦ P.curve y t) |
| 99 | (fun y ↦ curveCurvatureVector P t y)) : |
| 100 | TangentSpace (𝓡 n) (P.curve x t) := |
| 101 | let A := alongCovariantDerivative F (fun _ ↦ t) (fun y ↦ P.curve y t) |
| 102 | (fun y ↦ curveCurvatureVector P t y) Set.univ E |
| 103 | (spatialUnitTangent F P.curve t) x (by simp) |
| 104 | A - (F.metric t).inner (P.curve x t) A (spatialUnitTangent F P.curve t x) • |
| 105 | spatialUnitTangent F P.curve t x |
| 106 | |
| 107 | /-- First derivative with respect to arc length at a fixed time. -/ |
| 108 | noncomputable def arcLengthDerivative |
| 109 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) (t : ℝ) (f : ℝ → ℝ) (x : ℝ) : ℝ := |
| 110 | (curveSpeed F P.curve t x)⁻¹ * deriv f x |
| 111 | |
| 112 | /-- Second arc-length derivative, obtained by iterating the preceding operator. -/ |
| 113 | noncomputable def arcLengthSecondDerivativeOf |
| 114 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) |
| 115 | (t : ℝ) (f : ℝ → ℝ) (x : ℝ) : ℝ := |
| 116 | arcLengthDerivative P t |
| 117 | (fun y ↦ arcLengthDerivative P t f y) x |
| 118 | |
| 119 | /-- Second arc-length derivative of the squared curvature. -/ |
| 120 | noncomputable def arcLengthSecondDerivative |
| 121 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) (t x : ℝ) : ℝ := |
| 122 | arcLengthDerivative P t |
| 123 | (fun y ↦ arcLengthDerivative P t (fun z ↦ curveCurvatureSquared P t z) y) x |
| 124 | |
| 125 | /-- Total length of a periodic curve. -/ |
| 126 | noncomputable def totalCurveLength |
| 127 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) (t : ℝ) : ℝ := |
| 128 | ∫ x in (0 : ℝ)..curvePeriod, curveSpeed F P.curve t x |
| 129 | |
| 130 | /-- Total curvature of a periodic curve. -/ |
| 131 | noncomputable def totalCurveCurvature |
| 132 | (P : CurveShrinkingFlow.Data (n := n) (M := M) F) (t : ℝ) : ℝ := |
| 133 | ∫ x in (0 : ℝ)..curvePeriod, |
| 134 | curveCurvature P t x * curveSpeed F P.curve t x |
| 135 | |
| 136 | end PoincareMT |