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 | |
| 3 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/JacobiFieldPackaging.lean` at |
| 4 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 5 | |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | |
| 9 | noncomputable section |
| 10 | |
| 11 | open Set |
| 12 | open scoped Manifold ContDiff Bundle |
| 13 | |
| 14 | universe u |
| 15 | |
| 16 | namespace PoincareMT.LGeometry |
| 17 | |
| 18 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 19 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 20 | |
| 21 | theorem tangent_totalSpace_cast {x y : M} (h : x = y) (v : TangentSpace (𝓡 n) x) : |
| 22 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) y (h ▸ v) = |
| 23 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) x v := by |
| 24 | cases h |
| 25 | rfl |
| 26 | |
| 27 | theorem tangent_eq_of_totalSpace_eq {x y : M} (h : x = y) |
| 28 | {v : TangentSpace (𝓡 n) x} {w : TangentSpace (𝓡 n) y} |
| 29 | (heq : Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) x v = |
| 30 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) y w) : v = h.symm ▸ w := by |
| 31 | cases h |
| 32 | exact Bundle.TotalSpace.mk_injective x heq |
| 33 | |
| 34 | theorem tangent_cast_zero {x y : M} (h : x = y) : |
| 35 | (h ▸ (0 : TangentSpace (𝓡 n) x)) = (0 : TangentSpace (𝓡 n) y) := by |
| 36 | cases h |
| 37 | rfl |
| 38 | |
| 39 | variable {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ τ₂ : ℝ} |
| 40 | {p : BackwardTimePath F T τ₁ τ₂} |
| 41 | |
| 42 | theorem sqrt_mem_sqrtParameterInterval {τ : ℝ} (hτ : τ ∈ Icc τ₁ τ₂) : |
| 43 | Real.sqrt τ ∈ sqrtParameterInterval τ₁ τ₂ := |
| 44 | ⟨Real.sqrt_le_sqrt hτ.1, Real.sqrt_le_sqrt hτ.2⟩ |
| 45 | |
| 46 | theorem square_mem_backward_interval (p : BackwardTimePath F T τ₁ τ₂) |
| 47 | {s : ℝ} (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : s ^ 2 ∈ Icc τ₁ τ₂ := by |
| 48 | have hsn : 0 ≤ s := (Real.sqrt_nonneg τ₁).trans hs.1 |
| 49 | constructor |
| 50 | · simpa only [Real.sq_sqrt p.nonnegative] using |
| 51 | (sq_le_sq₀ (Real.sqrt_nonneg τ₁) hsn).mpr hs.1 |
| 52 | · simpa only [Real.sq_sqrt (p.nonnegative.trans p.ordered.le)] using |
| 53 | (sq_le_sq₀ hsn (Real.sqrt_nonneg τ₂)).mpr hs.2 |
| 54 | |
| 55 | theorem sqrtRegularPath_point_eq (R : SqrtRegularPath p) {τ : ℝ} |
| 56 | (hτ : τ ∈ Icc τ₁ τ₂) : R.curve (Real.sqrt τ) = p.curve τ := |
| 57 | (R.agrees _ (sqrt_mem_sqrtParameterInterval hτ)).trans |
| 58 | (congrArg p.curve (Real.sq_sqrt (p.nonnegative.trans hτ.1))) |
| 59 | |
| 60 | def backwardFieldOfSqrt (R : SqrtRegularPath p) |
| 61 | (Yhat : ∀ s, TangentSpace (𝓡 n) (R.curve s)) (τ : ℝ) : |
| 62 | TangentSpace (𝓡 n) (p.curve τ) := by |
| 63 | classical |
| 64 | exact if hτ : τ ∈ Icc τ₁ τ₂ then sqrtRegularPath_point_eq R hτ ▸ Yhat (Real.sqrt τ) |
| 65 | else 0 |
| 66 | |
| 67 | theorem backwardFieldOfSqrt_totalSpace (R : SqrtRegularPath p) |
| 68 | (Yhat : ∀ s, TangentSpace (𝓡 n) (R.curve s)) {τ : ℝ} |
| 69 | (hτ : τ ∈ Icc τ₁ τ₂) : |
| 70 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (p.curve τ) (backwardFieldOfSqrt R Yhat τ) = |
| 71 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (R.curve (Real.sqrt τ)) |
| 72 | (Yhat (Real.sqrt τ)) := by |
| 73 | rw [backwardFieldOfSqrt, dif_pos hτ] |
| 74 | exact tangent_totalSpace_cast (sqrtRegularPath_point_eq R hτ) _ |
| 75 | |
| 76 | theorem backwardFieldOfSqrt_agrees (R : SqrtRegularPath p) |
| 77 | (Yhat : ∀ s, TangentSpace (𝓡 n) (R.curve s)) {s : ℝ} |
| 78 | (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : |
| 79 | Yhat s = (R.agrees s hs).symm ▸ backwardFieldOfSqrt R Yhat (s ^ 2) := by |
| 80 | have h := backwardFieldOfSqrt_totalSpace R Yhat (square_mem_backward_interval p hs) |
| 81 | rw [Real.sqrt_sq ((Real.sqrt_nonneg τ₁).trans hs.1)] at h |
| 82 | exact tangent_eq_of_totalSpace_eq (R.agrees s hs) h.symm |
| 83 | |
| 84 | theorem backwardFieldOfSqrt_initial_zero (R : SqrtRegularPath p) |
| 85 | (Yhat : ∀ s, TangentSpace (𝓡 n) (R.curve s)) |
| 86 | (hY : Yhat (Real.sqrt τ₁) = 0) : backwardFieldOfSqrt R Yhat τ₁ = 0 := by |
| 87 | have hτ : τ₁ ∈ Icc τ₁ τ₂ := ⟨le_rfl, p.ordered.le⟩ |
| 88 | rw [backwardFieldOfSqrt, dif_pos hτ, hY] |
| 89 | exact tangent_cast_zero (sqrtRegularPath_point_eq R hτ) |
| 90 | |
| 91 | def sqrtRegularFieldOfPullback (R : SqrtRegularPath p) |
| 92 | (Yhat P : ∀ s, TangentSpace (𝓡 n) (R.curve s)) |
| 93 | (E : ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) R.curve Yhat) |
| 94 | (EP : ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) R.curve P) |
| 95 | (hP : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, |
| 96 | pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) R.curve Yhat |
| 97 | (sqrtParameterInterval τ₁ τ₂) E s = P s) : |
| 98 | SqrtRegularField R (backwardFieldOfSqrt R Yhat) where |
| 99 | field := Yhat |
| 100 | agrees s hs := backwardFieldOfSqrt_agrees R Yhat hs |
| 101 | extension := E |
| 102 | derivative_extension := { |
| 103 | extension := EP.extension |
| 104 | domain := EP.domain |
| 105 | open_domain := EP.open_domain |
| 106 | graph_mem := EP.graph_mem |
| 107 | smooth := EP.smooth |
| 108 | agrees := fun s hs ↦ (EP.agrees s hs).trans (hP s hs).symm } |
| 109 | |
| 110 | theorem sqrtRegularFieldOfPullback_firstDerivative (R : SqrtRegularPath p) |
| 111 | (Yhat P : ∀ s, TangentSpace (𝓡 n) (R.curve s)) |
| 112 | (E : ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) R.curve Yhat) |
| 113 | (EP : ParametricAlongCurveExtensionOn (sqrtParameterInterval τ₁ τ₂) R.curve P) |
| 114 | (hP : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, |
| 115 | pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) R.curve Yhat |
| 116 | (sqrtParameterInterval τ₁ τ₂) E s = P s) |
| 117 | {s : ℝ} (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : |
| 118 | (sqrtRegularFieldOfPullback R Yhat P E EP hP).firstDerivative s = P s := hP s hs |
| 119 | |
| 120 | theorem sqrtRegularField_totalSpace_agrees {R : SqrtRegularPath p} |
| 121 | {Y : ∀ τ, TangentSpace (𝓡 n) (p.curve τ)} (Q : SqrtRegularField R Y) |
| 122 | {s : ℝ} (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : |
| 123 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (R.curve s) (Q.field s) = |
| 124 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (p.curve (s ^ 2)) (Y (s ^ 2)) := by |
| 125 | rw [Q.agrees s hs] |
| 126 | exact tangent_totalSpace_cast (R.agrees s hs).symm _ |
| 127 | |
| 128 | theorem sqrtRegularField_eq_of_totalSpace_eq {R R' : SqrtRegularPath p} |
| 129 | {Y Z : ∀ τ, TangentSpace (𝓡 n) (p.curve τ)} |
| 130 | (Q : SqrtRegularField R Y) (Q' : SqrtRegularField R' Z) |
| 131 | (heq : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, |
| 132 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (R.curve s) (Q.field s) = |
| 133 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (R'.curve s) (Q'.field s)) : |
| 134 | ∀ τ ∈ Icc τ₁ τ₂, Y τ = Z τ := by |
| 135 | intro τ hτ |
| 136 | have hs := sqrt_mem_sqrtParameterInterval hτ |
| 137 | have h := (sqrtRegularField_totalSpace_agrees Q hs).symm.trans |
| 138 | ((heq (Real.sqrt τ) hs).trans (sqrtRegularField_totalSpace_agrees Q' hs)) |
| 139 | have hf := Bundle.TotalSpace.mk_injective (p.curve ((Real.sqrt τ) ^ 2)) h |
| 140 | exact (congrArg (fun r : ℝ ↦ Y r = Z r) |
| 141 | (Real.sq_sqrt (p.nonnegative.trans hτ.1))).mp hf |
| 142 | |
| 143 | end PoincareMT.LGeometry |