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.Curvature.Calculus |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Basic |
| 3 | import PoincareLib.Geometry.RicciFlow.Curvature.Theory |
| 4 | import PoincareLib.Geometry.Riemannian.Connection.LocalRegularity |
| 5 | import PoincareLib.Geometry.Riemannian.Curvature.Calculus |
| 6 | import PoincareLib.Geometry.Riemannian.Splitting.ParallelGradient.Basic |
| 7 | |
| 8 | /-! |
| 9 | # Fixed parallel fields on a Ricci-flow slab |
| 10 | |
| 11 | This module packages a fixed global parallel field and proves its |
| 12 | metric-duality consequences directly from the retained Ricci-flow equation. |
| 13 | The unconditional producer in `Splitting.Persistence` derives these data |
| 14 | from nonnegative curvature by the tensor strong maximum principle. |
| 15 | |
| 16 | The source route is Cook--Kotschwar, Corollary 4.1 and Section 4.0.1, p. 7, |
| 17 | with the curvature-nullity propagation described by Kleiner--Lott, Appendix A, |
| 18 | Theorem A.7, p. 2841. |
| 19 | -/ |
| 20 | |
| 21 | set_option autoImplicit false |
| 22 | set_option backward.isDefEq.respectTransparency false |
| 23 | |
| 24 | open Set |
| 25 | open scoped Manifold ContDiff Bundle Topology |
| 26 | |
| 27 | namespace PoincareMT.RicciFlow.Splitting |
| 28 | |
| 29 | universe u |
| 30 | |
| 31 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 32 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 33 | {a b : ℝ} |
| 34 | |
| 35 | /- The field is fixed on the original manifold. Its time-independent value |
| 36 | is what distinguishes global field persistence from a local product chart. -/ |
| 37 | structure ParallelFieldData (F : RicciFlow n M (Icc a b)) (f : M → ℝ) where |
| 38 | field : ∀ x : M, TangentSpace (𝓡 n) x |
| 39 | terminal : ∀ x, field x = (F.connection b).gradient f x |
| 40 | parallel : ∀ t ∈ Ico a b, ∀ x : M, ∀ u : TangentSpace (𝓡 n) x, |
| 41 | (F.connection t).connection field x u = 0 |
| 42 | ricci_null : ∀ t ∈ Icc a b, ∀ x : M, ∀ v : TangentSpace (𝓡 n) x, |
| 43 | (F.connection t).ricci x (field x) v = 0 |
| 44 | |
| 45 | /-! A spatially parallel smooth field is in the curvature nullity. -/ |
| 46 | |
| 47 | theorem curvature_eq_zero_of_parallel_field |
| 48 | {g : RiemannianMetric n M} (D : LeviCivitaData g) |
| 49 | (hD : D.CurvatureTensorCalculus) |
| 50 | (X : (x : M) → TangentSpace (𝓡 n) x) |
| 51 | (hX : ContMDiff (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% X)) |
| 52 | (hparallel : ∀ x : M, D.connection X x = 0) |
| 53 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 54 | D.curvature x u v (X x) = 0 := by |
| 55 | obtain ⟨U, hU, hx, hExt⟩ := exists_open_contMDiffOn_extend (n := n) x |
| 56 | let E := EuclideanSpace ℝ (Fin n) |
| 57 | let A : (y : M) → TangentSpace (𝓡 n) y := FiberBundle.extend E u |
| 58 | let B : (y : M) → TangentSpace (𝓡 n) y := FiberBundle.extend E v |
| 59 | have hA : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ (T% A) U := hExt u |
| 60 | have hB : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ (T% B) U := hExt v |
| 61 | have hcurv := hD.2.2.2.2 U hU A B X hA hB hX.contMDiffOn x hx |
| 62 | have hA0 : (fun y => D.connection X y (A y)) = 0 := by |
| 63 | funext y |
| 64 | rw [hparallel y] |
| 65 | simp |
| 66 | have hB0 : (fun y => D.connection X y (B y)) = 0 := by |
| 67 | funext y |
| 68 | rw [hparallel y] |
| 69 | simp |
| 70 | have hzero : D.curvatureOnFields A B X x = 0 := by |
| 71 | unfold LeviCivitaData.curvatureOnFields |
| 72 | rw [hA0, hB0, hparallel x] |
| 73 | simp |
| 74 | have hpoint : D.curvature x u v (X x) = 0 := by |
| 75 | have := hcurv.symm ▸ hzero |
| 76 | simpa [A, B] using this |
| 77 | exact hpoint |
| 78 | |
| 79 | theorem ricci_eq_zero_of_parallel_field |
| 80 | {g : RiemannianMetric n M} (D : LeviCivitaData g) |
| 81 | (hD : D.CurvatureTensorCalculus) |
| 82 | (X : (x : M) → TangentSpace (𝓡 n) x) |
| 83 | (hX : ContMDiff (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% X)) |
| 84 | (hparallel : ∀ x : M, D.connection X x = 0) |
| 85 | (x : M) (v : TangentSpace (𝓡 n) x) : |
| 86 | D.ricci x (X x) v = 0 := by |
| 87 | let basis := g.orthonormalBasis x |
| 88 | rw [LeviCivitaData.ricci] |
| 89 | apply Finset.sum_eq_zero |
| 90 | intro i hi |
| 91 | have hpair := hD.2.2.2.1 x (X x) (basis i) v (basis i) |
| 92 | have hlast := hD.2.2.2.1 x v (basis i) (X x) (basis i) |
| 93 | rw [hpair.2.1, hlast.1] |
| 94 | have hcurv := curvature_eq_zero_of_parallel_field D hD X hX hparallel x v (basis i) |
| 95 | simp [LeviCivitaData.curvatureTensor, hcurv] |
| 96 | |
| 97 | /-! M04 supplies the curvature calculus needed to derive the Ricci-null input |
| 98 | from a fixed smooth field that is parallel on the whole slab. -/ |
| 99 | |
| 100 | def ParallelFieldData.of_parallel_field |
| 101 | (hC : RicciFlowCurvatureCalculus.{u}) |
| 102 | (F : RicciFlow n M (Icc a b)) (f : M → ℝ) |
| 103 | (field : ∀ x : M, TangentSpace (𝓡 n) x) |
| 104 | (terminal : ∀ x, field x = (F.connection b).gradient f x) |
| 105 | (hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f) |
| 106 | (hzero : RiemannianMetric.HasZeroHessian (F.connection b) f) |
| 107 | (hfield : ContMDiff (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 108 | (T% field)) |
| 109 | (hparallel : ∀ t ∈ Ico a b, ∀ x : M, |
| 110 | ∀ u : TangentSpace (𝓡 n) x, (F.connection t).connection field x u = 0) : |
| 111 | ParallelFieldData F f := by |
| 112 | have hterminal : field = (F.connection b).gradient f := funext terminal |
| 113 | have hparallel_closed : ∀ t ∈ Icc a b, ∀ x : M, |
| 114 | ∀ u : TangentSpace (𝓡 n) x, (F.connection t).connection field x u = 0 := by |
| 115 | intro t ht x u |
| 116 | by_cases htb : t = b |
| 117 | · subst t |
| 118 | rw [hterminal] |
| 119 | exact RiemannianMetric.connection_gradient_eq_zero_of_hasZeroHessian hf hzero x u |
| 120 | · exact hparallel t ⟨ht.1, lt_of_le_of_ne ht.2 htb⟩ x u |
| 121 | refine |
| 122 | { field := field |
| 123 | terminal := terminal |
| 124 | parallel := ?_ |
| 125 | ricci_null := ?_ } |
| 126 | · intro t ht x u |
| 127 | exact hparallel t ht x u |
| 128 | · intro t ht x v |
| 129 | have hD := hC.tensor_calculus n M (F.metric t) (F.connection t) |
| 130 | have hpar : ∀ y : M, (F.connection t).connection field y = 0 := by |
| 131 | intro y |
| 132 | ext u |
| 133 | exact hparallel_closed t ht y u |
| 134 | exact ricci_eq_zero_of_parallel_field (F.connection t) hD field hfield hpar x v |
| 135 | |
| 136 | namespace ParallelFieldData |
| 137 | |
| 138 | /-- The metric dual of a fixed Ricci-null field is constant in time. -/ |
| 139 | theorem metric_dual_eq |
| 140 | {F : RicciFlow n M (Icc a b)} {f : M → ℝ} |
| 141 | (h : ParallelFieldData F f) (hab : a < b) {t : ℝ} |
| 142 | (ht : t ∈ Icc a b) (x : M) (v : TangentSpace (𝓡 n) x) : |
| 143 | (F.metric t).inner x (h.field x) v = |
| 144 | (F.metric b).inner x (h.field x) v := by |
| 145 | let q : ℝ → ℝ := fun s => (F.metric s).inner x (h.field x) v |
| 146 | have hderiv : ∀ s ∈ Icc a b, HasDerivWithinAt q 0 (Icc a b) s := by |
| 147 | intro s hs |
| 148 | have hflow := F.equation s hs x (h.field x) v |
| 149 | simpa only [q, h.ricci_null s hs x v, mul_zero] using hflow |
| 150 | have hdiff : DifferentiableOn ℝ q (Icc a b) := by |
| 151 | intro s hs |
| 152 | exact (hderiv s hs).differentiableWithinAt |
| 153 | have hzero : ∀ s ∈ Ico a b, derivWithin q (Icc a b) s = 0 := by |
| 154 | intro s hs |
| 155 | exact (hderiv s ⟨hs.1, hs.2.le⟩).derivWithin |
| 156 | (uniqueDiffOn_Icc hab s ⟨hs.1, hs.2.le⟩) |
| 157 | exact (constant_of_derivWithin_zero hdiff hzero t ht).trans |
| 158 | (constant_of_derivWithin_zero hdiff hzero b ⟨hab.le, le_rfl⟩).symm |
| 159 | |
| 160 | end ParallelFieldData |
| 161 | |
| 162 | /-- |
| 163 | Backward persistence from the global fixed-field transport input. |
| 164 | |
| 165 | The completeness, curvature-operator positivity, and uniform full-curvature |
| 166 | bound are retained in the interface because they are the hypotheses of the |
| 167 | Cook--Kotschwar/strong-maximum-principle producer. The theorem below proves |
| 168 | the metric-duality and scalar consequences once that producer supplies its |
| 169 | fixed field. |
| 170 | -/ |
| 171 | theorem backward_persistence_of_parallel_field_data |
| 172 | [T3Space M] |
| 173 | (hab : a < b) (F : RicciFlow n M (Icc a b)) |
| 174 | (_hcomplete : ∀ t ∈ Icc a b, MetricComplete (F.metric t)) |
| 175 | (_hcurv : ∀ t ∈ Icc a b, ∀ x : M, |
| 176 | (F.connection t).NonnegativeCurvatureOperator x) |
| 177 | (_hbound : ∃ K : ℝ, 0 ≤ K ∧ ∀ t ∈ Icc a b, ∀ x : M, |
| 178 | (F.connection t).curvatureTensorNorm x ≤ K) |
| 179 | (f : M → ℝ) (hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f) |
| 180 | (hunit : RiemannianMetric.HasUnitGradient (F.connection b) f) |
| 181 | (hzero : RiemannianMetric.HasZeroHessian (F.connection b) f) |
| 182 | (hfield : ParallelFieldData F f) : |
| 183 | ∀ t ∈ Icc a b, |
| 184 | (F.connection t).gradient f = (F.connection b).gradient f ∧ |
| 185 | RiemannianMetric.HasUnitGradient (F.connection t) f ∧ |
| 186 | RiemannianMetric.HasZeroHessian (F.connection t) f := by |
| 187 | intro t ht |
| 188 | have hdual (s : ℝ) (hs : s ∈ Icc a b) (x : M) |
| 189 | (v : TangentSpace (𝓡 n) x) : |
| 190 | (F.metric s).inner x (hfield.field x) v = |
| 191 | mvfderiv (𝓡 n) f x v := by |
| 192 | calc |
| 193 | (F.metric s).inner x (hfield.field x) v = |
| 194 | (F.metric b).inner x (hfield.field x) v := |
| 195 | ParallelFieldData.metric_dual_eq hfield hab hs x v |
| 196 | _ = (F.metric b).inner x ((F.connection b).gradient f x) v := by |
| 197 | rw [hfield.terminal] |
| 198 | _ = mvfderiv (𝓡 n) f x v := (F.metric b).inner_gradient f x v |
| 199 | have hgrad (s : ℝ) (hs : s ∈ Icc a b) : |
| 200 | (F.connection s).gradient f = hfield.field := by |
| 201 | funext x |
| 202 | apply (F.metric s).inner_isInvertible x |>.injective |
| 203 | ext v |
| 204 | rw [(F.connection s).gradient_eq_metric_gradient] |
| 205 | exact ((F.metric s).inner_gradient f x v).trans (hdual s hs x v).symm |
| 206 | have hgrad_eq : (F.connection t).gradient f = (F.connection b).gradient f := by |
| 207 | exact (hgrad t ht).trans (hgrad b ⟨hab.le, le_rfl⟩).symm |
| 208 | refine ⟨hgrad_eq, ?_, ?_⟩ |
| 209 | · intro x |
| 210 | calc |
| 211 | (F.metric t).inner x ((F.connection t).gradient f x) |
| 212 | ((F.connection t).gradient f x) = |
| 213 | (F.metric t).inner x (hfield.field x) (hfield.field x) := by |
| 214 | rw [hgrad t ht] |
| 215 | _ = (F.metric b).inner x (hfield.field x) (hfield.field x) := |
| 216 | ParallelFieldData.metric_dual_eq hfield hab ht x (hfield.field x) |
| 217 | _ = (F.metric b).inner x ((F.connection b).gradient f x) |
| 218 | ((F.connection b).gradient f x) := by |
| 219 | rw [hfield.terminal] |
| 220 | _ = 1 := hunit x |
| 221 | · by_cases htb : t = b |
| 222 | · subst t |
| 223 | exact hzero |
| 224 | · have htlt : t ∈ Ico a b := ⟨ht.1, lt_of_le_of_ne ht.2 htb⟩ |
| 225 | intro x u v |
| 226 | rw [(F.connection t).hessian_eq_inner_connection_gradient (hf x), hgrad t ht, |
| 227 | hfield.parallel t htlt x u] |
| 228 | simp |
| 229 | |
| 230 | end PoincareMT.RicciFlow.Splitting |