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.Fields.InitialVariationFields |
| 2 | |
| 3 | /-! |
| 4 | # The actual initial-vector variation is the slice differential |
| 5 | |
| 6 | The affine chain rule identifies the given variation field. At backward |
| 7 | time zero the entire initial-vector slice is constant. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option maxSynthPendingDepth 3 |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.ReducedLength |
| 18 | |
| 19 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 21 | [IsManifold (𝓡 n) ∞ M] |
| 22 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 23 | |
| 24 | local notation "Q" => EuclideanSpace ℝ (Fin n) |
| 25 | |
| 26 | set_option backward.isDefEq.respectTransparency false in |
| 27 | theorem initialVectorVariation_field_zero (A : LExponentialFamily F T τmax p) |
| 28 | (Z W : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 29 | variationField (initialVectorVariation A Z W b hb hmax).toLVariation 0 = 0 := by |
| 30 | have hcast (x y : M) (h : x = y) (v : TangentSpace (𝓡 n) x) : |
| 31 | (h ▸ v : TangentSpace (𝓡 n) y) = (show TangentSpace (𝓡 n) y from v) := by |
| 32 | cases h |
| 33 | rfl |
| 34 | unfold variationField |
| 35 | rw [hcast] |
| 36 | have heq : (fun u : ℝ ↦ A.gamma (Z + u • W) 0) = fun _ : ℝ ↦ p := |
| 37 | funext fun u ↦ A.gamma_at_zero (Z + u • W) |
| 38 | have hvelocity := congrArg (fun α : ℝ → M ↦ (curveVelocity (n := n) α 0 : Q)) heq |
| 39 | exact hvelocity.trans (by simp [curveVelocity]) |
| 40 | |
| 41 | set_option backward.isDefEq.respectTransparency false in |
| 42 | theorem initialVectorVariation_field_eq_sliceDifferential (A : LExponentialFamily F T τmax p) |
| 43 | (Z W : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 44 | (τ : ℝ) (hτ : 0 < τ) (hτmax : τ < τmax) : |
| 45 | (variationField (initialVectorVariation A Z W b hb hmax).toLVariation τ : Q) = |
| 46 | A.sliceDifferential Z τ W := by |
| 47 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 48 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 49 | have hcast (x y : M) (h : x = y) (v : TangentSpace (𝓡 n) x) : |
| 50 | (h ▸ v : TangentSpace (𝓡 n) y) = (show TangentSpace (𝓡 n) y from v) := by |
| 51 | cases h |
| 52 | rfl |
| 53 | unfold variationField |
| 54 | rw [hcast] |
| 55 | have hdiff := (lExponentialFamily_initialSlice_contMDiffAt A Z τ hτ hτmax).mdifferentiableAt |
| 56 | (by simp) |
| 57 | exact curveVelocity_comp_initial_line (fun Y ↦ A.gamma Y τ) Z W hdiff |
| 58 | |
| 59 | set_option backward.isDefEq.respectTransparency false in |
| 60 | theorem initialVectorVariation_differential_on_interval (A : LExponentialFamily F T τmax p) |
| 61 | (Z W : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 62 | ∀ τ ∈ Set.Icc 0 b, |
| 63 | ((congrFun (A.path_eq Z b hb hmax) τ) ▸ |
| 64 | variationField (initialVectorVariation A Z W b hb hmax).toLVariation τ : |
| 65 | TangentSpace (𝓡 n) (A.gamma Z τ)) = A.sliceDifferential Z τ W := by |
| 66 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 67 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 68 | intro τ hτ |
| 69 | have hcast (x y : M) (h : x = y) (v : TangentSpace (𝓡 n) x) : |
| 70 | (h ▸ v : TangentSpace (𝓡 n) y) = (show TangentSpace (𝓡 n) y from v) := by |
| 71 | cases h |
| 72 | rfl |
| 73 | rw [hcast] |
| 74 | rcases eq_or_lt_of_le hτ.1 with hzero | hpos |
| 75 | · subst τ |
| 76 | rw [initialVectorVariation_field_zero] |
| 77 | have heq : (fun Y : TangentSpace (𝓡 n) p ↦ A.gamma Y 0) = fun _ ↦ p := |
| 78 | funext fun Y ↦ A.gamma_at_zero Y |
| 79 | unfold LExponentialFamily.sliceDifferential |
| 80 | rw [heq] |
| 81 | simp |
| 82 | · exact initialVectorVariation_field_eq_sliceDifferential A Z W b hb hmax τ hpos |
| 83 | (hτ.2.trans_lt hmax) |
| 84 | |
| 85 | end PoincareMT.ReducedLength |