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.Variation.Initial.InitialVectorVariation |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Exponential.FamilySlices |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.VelocityChainRules |
| 4 | |
| 5 | /-! |
| 6 | # The actual initial-vector variation fields at the endpoints |
| 7 | |
| 8 | The initial square endpoint is constant. At the terminal endpoint the |
| 9 | parameter curve equals the actual exponential slice composed with an |
| 10 | affine line, so its velocity is the frozen slice differential. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option maxSynthPendingDepth 3 |
| 15 | set_option maxHeartbeats 800000 |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedLength |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 25 | [IsManifold (𝓡 n) ∞ M] |
| 26 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 27 | |
| 28 | @[simp] theorem initialVectorVariation_baseSquareCurve (A : LExponentialFamily F T τmax p) |
| 29 | (Z W : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 30 | (initialVectorVariation A Z W b hb hmax).toLVariation.baseSquareCurve = |
| 31 | A.squareFamily Z := by |
| 32 | funext s |
| 33 | simp only [LVariation.baseSquareCurve, initialVectorVariation_squareFamily, zero_smul, add_zero] |
| 34 | |
| 35 | set_option backward.isDefEq.respectTransparency false in |
| 36 | theorem initialVectorVariation_squareField_zero (A : LExponentialFamily F T τmax p) |
| 37 | (Z W : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 38 | (squareVariationField (initialVectorVariation A Z W b hb hmax).toLVariation 0 : |
| 39 | EuclideanSpace ℝ (Fin n)) = 0 := by |
| 40 | have heq : (fun u : ℝ ↦ A.squareFamily (Z + u • W) 0) = fun _ : ℝ ↦ p := |
| 41 | funext fun u ↦ A.square_at_zero (Z + u • W) |
| 42 | have hvelocity := congrArg (fun α : ℝ → M ↦ |
| 43 | (curveVelocity (n := n) α 0 : EuclideanSpace ℝ (Fin n))) heq |
| 44 | exact hvelocity.trans (by simp [curveVelocity]) |
| 45 | |
| 46 | set_option backward.isDefEq.respectTransparency false in |
| 47 | theorem initialVectorVariation_squareField_terminal (A : LExponentialFamily F T τmax p) |
| 48 | (Z W : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 49 | (squareVariationField (initialVectorVariation A Z W b hb hmax).toLVariation |
| 50 | (Real.sqrt b) : EuclideanSpace ℝ (Fin n)) = A.sliceDifferential Z b W := by |
| 51 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 52 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 53 | have heq : (fun u : ℝ ↦ A.squareFamily (Z + u • W) (Real.sqrt b)) = |
| 54 | (fun u : ℝ ↦ A.gamma (Z + u • W) b) := by |
| 55 | funext u |
| 56 | simpa only [Real.sq_sqrt hb.le] using A.square_agrees (Z + u • W) (Real.sqrt b) |
| 57 | ⟨Real.sqrt_nonneg b, Real.sqrt_lt_sqrt hb.le hmax⟩ |
| 58 | have hvelocity := congrArg (fun α : ℝ → M ↦ |
| 59 | (curveVelocity (n := n) α 0 : EuclideanSpace ℝ (Fin n))) heq |
| 60 | have hdiff := (lExponentialFamily_initialSlice_contMDiffAt A Z b hb hmax).mdifferentiableAt |
| 61 | (by simp) |
| 62 | have hchain := curveVelocity_comp_initial_line (fun V ↦ A.gamma V b) Z W hdiff |
| 63 | exact hvelocity.trans hchain |
| 64 | |
| 65 | end PoincareMT.ReducedLength |