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.Splitting.MaximumPrinciple.RicciNullity |
| 2 | import PoincareLib.Geometry.RicciFlow.Splitting.KernelTransport |
| 3 | import PoincareLib.Geometry.Riemannian.Tensor.MaximumPrinciple.Transport.Coordinates |
| 4 | import Mathlib.Analysis.InnerProductSpace.Dual |
| 5 | |
| 6 | /-! |
| 7 | # Smooth local sections of the Ricci kernel |
| 8 | |
| 9 | The Ricci form in a fixed tangent trivialization is raised using the standard |
| 10 | Euclidean inner product. Its kernel is linearly equivalent to the actual |
| 11 | Ricci kernel. Locally constant kernel dimension therefore makes the |
| 12 | regularized inverse construction produce smooth local null sections. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter Bundle |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | namespace PoincareMT.RicciFlow.Splitting |
| 23 | |
| 24 | open Poincare.RicciFlow.Splitting LeviCivitaData |
| 25 | |
| 26 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | {g : RiemannianMetric n M} |
| 29 | |
| 30 | private lemma inverse_regularized_mem_kernel |
| 31 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 32 | [FiniteDimensional ℝ E] (A : E →L[ℝ] E) (K : Submodule ℝ E) |
| 33 | (hB : (A + K.starProjection).IsInvertible) |
| 34 | (hdim : Module.finrank ℝ A.ker = Module.finrank ℝ K) (c : K) : |
| 35 | A ((A + K.starProjection).inverse c) = 0 := by |
| 36 | let L : A.ker →ₗ[ℝ] K := |
| 37 | K.orthogonalProjectionOnto.toLinearMap.comp A.ker.subtype |
| 38 | have hL : Function.Injective L := by |
| 39 | intro x y hxy |
| 40 | apply Subtype.ext |
| 41 | apply hB.injective |
| 42 | change A x + K.starProjection x = A y + K.starProjection y |
| 43 | rw [show A x = 0 from x.property, show A y = 0 from y.property, zero_add, zero_add] |
| 44 | exact congrArg Subtype.val hxy |
| 45 | obtain ⟨z, hz⟩ := |
| 46 | (LinearMap.injective_iff_surjective_of_finrank_eq_finrank hdim).mp hL c |
| 47 | have hsolve : (A + K.starProjection) z = c := by |
| 48 | change A z + K.starProjection z = c |
| 49 | rw [show A z = 0 from z.property, zero_add] |
| 50 | exact congrArg Subtype.val hz |
| 51 | rw [hB.inverse_apply_eq.mpr hsolve.symm] |
| 52 | exact z.property |
| 53 | |
| 54 | omit [IsManifold (𝓡 n) ∞ M] in |
| 55 | /-- Manifold-base version of the regularized inverse null-section construction. -/ |
| 56 | theorem exists_local_contMDiff_kernel_section |
| 57 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 58 | [FiniteDimensional ℝ E] |
| 59 | {A : M → E →L[ℝ] E} {U : Set M} (hU : IsOpen U) |
| 60 | (hA : ContMDiffOn (𝓡 n) 𝓘(ℝ, E →L[ℝ] E) ∞ A U) {p : M} (hp : p ∈ U) |
| 61 | (hsym : (A p).toLinearMap.IsSymmetric) |
| 62 | (hdim : ∀ q ∈ U, Module.finrank ℝ (A q).ker = Module.finrank ℝ (A p).ker) |
| 63 | (v : E) (hv : A p v = 0) : |
| 64 | ∃ (V : Set M) (s : M → E), IsOpen V ∧ p ∈ V ∧ V ⊆ U ∧ |
| 65 | ContMDiffOn (𝓡 n) 𝓘(ℝ, E) ∞ s V ∧ s p = v ∧ ∀ q ∈ V, A q (s q) = 0 := by |
| 66 | let K := (A p).ker |
| 67 | let B := fun q => A q + K.starProjection |
| 68 | have hBp : (B p).IsInvertible := isInvertible_add_kernel_projection (A p) hsym |
| 69 | have hnear : ∀ᶠ q in 𝓝 p, IsUnit (B q) := |
| 70 | ((hA.continuousOn.continuousAt (hU.mem_nhds hp)).add_const K.starProjection).eventually |
| 71 | (Units.isOpen.mem_nhds (ContinuousLinearMap.isUnit_iff_bijective.mpr hBp.bijective)) |
| 72 | obtain ⟨V, hVB, hVo, hpV⟩ := mem_nhds_iff.mp hnear |
| 73 | let W := V ∩ U |
| 74 | have hB (q : M) (hq : q ∈ W) : (B q).IsInvertible := by |
| 75 | rcases hVB hq.1 with ⟨e, he⟩ |
| 76 | exact ⟨ContinuousLinearEquiv.ofUnit e, he⟩ |
| 77 | refine ⟨W, fun q => (B q).inverse v, hVo.inter hU, ⟨hpV, hp⟩, |
| 78 | inter_subset_right, ?_, ?_, ?_⟩ |
| 79 | · intro q hq |
| 80 | have hBq : ContMDiffAt (𝓡 n) 𝓘(ℝ, E →L[ℝ] E) ∞ B q := |
| 81 | ((hA q hq.2).contMDiffAt (hU.mem_nhds hq.2)).add contMDiffAt_const |
| 82 | exact (((hB q hq).contDiffAt_map_inverse.contMDiffAt.comp q hBq).clm_apply |
| 83 | contMDiffAt_const).contMDiffWithinAt |
| 84 | · apply hBp.inverse_apply_eq.mpr |
| 85 | change v = A p v + K.starProjection v |
| 86 | rw [hv, zero_add, K.starProjection_mem_subspace_eq_self ⟨v, hv⟩] |
| 87 | · intro q hq |
| 88 | exact inverse_regularized_mem_kernel (A q) K (hB q hq) (hdim q hq.2) ⟨v, hv⟩ |
| 89 | |
| 90 | /-- The retained Ricci form pulled back to a fixed tangent trivialization. -/ |
| 91 | def coordinateRicciBilinear (D : LeviCivitaData g) (p x : M) : |
| 92 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ := |
| 93 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) p |
| 94 | let B := (ricciBilinear D x).compl₁₂ (e.symmL ℝ x).toLinearMap |
| 95 | (e.symmL ℝ x).toLinearMap |
| 96 | (LinearMap.toContinuousLinearMap.toLinearMap.comp B).toContinuousLinearMap |
| 97 | |
| 98 | lemma coordinateRicciBilinear_apply (D : LeviCivitaData g) (p x : M) |
| 99 | (v w : EuclideanSpace ℝ (Fin n)) : |
| 100 | coordinateRicciBilinear D p x v w = |
| 101 | D.ricci x (constantCoordinateField p v x) (constantCoordinateField p w x) := by |
| 102 | change ricciBilinear D x _ _ = _ |
| 103 | exact ricciBilinear_apply _ _ _ _ |
| 104 | |
| 105 | /-- Coordinate Ricci with an index raised by the fixed Euclidean inner product. -/ |
| 106 | def coordinateRicciOperator (D : LeviCivitaData g) (p x : M) : |
| 107 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) := |
| 108 | InnerProductSpace.continuousLinearMapOfBilin (coordinateRicciBilinear D p x) |
| 109 | |
| 110 | lemma coordinateRicciOperator_inner (D : LeviCivitaData g) (p x : M) |
| 111 | (v w : EuclideanSpace ℝ (Fin n)) : |
| 112 | inner ℝ (coordinateRicciOperator D p x v) w = |
| 113 | D.ricci x (constantCoordinateField p v x) (constantCoordinateField p w x) := by |
| 114 | rw [coordinateRicciOperator, InnerProductSpace.continuousLinearMapOfBilin_apply, |
| 115 | coordinateRicciBilinear_apply] |
| 116 | |
| 117 | private lemma contMDiffAt_coordinateRicciOperator (D : LeviCivitaData g) |
| 118 | (hD : D.CurvatureTensorCalculus) (p : M) {x : M} |
| 119 | (hx : x ∈ (trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 120 | (TangentSpace (𝓡 n)) p).baseSet) : |
| 121 | ContMDiffAt (𝓡 n) 𝓘(ℝ, EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 122 | EuclideanSpace ℝ (Fin n)) ∞ (coordinateRicciOperator D p) x := by |
| 123 | have hB : ContMDiffAt (𝓡 n) 𝓘(ℝ, EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 124 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) ∞ (coordinateRicciBilinear D p) x := by |
| 125 | apply contMDiffAt_clm_of_apply |
| 126 | intro v |
| 127 | apply contMDiffAt_clm_of_apply |
| 128 | intro w |
| 129 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) p |
| 130 | have h := hD.2.1.2 e.baseSet e.open_baseSet |
| 131 | ![constantCoordinateField p v, constantCoordinateField p w] |
| 132 | (by intro i; fin_cases i <;> exact fun y hy => |
| 133 | (contMDiffAt_constantCoordinateField p _ hy).contMDiffWithinAt) |
| 134 | simpa only [coordinateRicciBilinear_apply, ricciEvaluation, |
| 135 | Matrix.cons_val_zero, Matrix.cons_val_one] using |
| 136 | (h x hx).contMDiffAt (e.open_baseSet.mem_nhds hx) |
| 137 | exact contMDiffAt_const.clm_comp hB |
| 138 | |
| 139 | lemma coordinateRicciOperator_eq_zero_iff (D : LeviCivitaData g) |
| 140 | (p : M) {x : M} |
| 141 | (hx : x ∈ (trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 142 | (TangentSpace (𝓡 n)) p).baseSet) (v : EuclideanSpace ℝ (Fin n)) : |
| 143 | coordinateRicciOperator D p x v = 0 ↔ |
| 144 | ∀ w, D.ricci x (constantCoordinateField p v x) w = 0 := by |
| 145 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) p |
| 146 | constructor |
| 147 | · intro hv w |
| 148 | have h := coordinateRicciOperator_inner D p x v (e.continuousLinearMapAt ℝ x w) |
| 149 | rw [hv, inner_zero_left] at h |
| 150 | change 0 = D.ricci x (constantCoordinateField p v x) |
| 151 | (e.symmL ℝ x (e.continuousLinearMapAt ℝ x w)) at h |
| 152 | rw [e.symmL_continuousLinearMapAt hx] at h |
| 153 | exact h.symm |
| 154 | · intro hv |
| 155 | apply ext_inner_right ℝ |
| 156 | intro w |
| 157 | rw [coordinateRicciOperator_inner, hv, inner_zero_left] |
| 158 | |
| 159 | lemma coordinateRicciOperator_finrank_ker (D : LeviCivitaData g) |
| 160 | (p : M) {x : M} |
| 161 | (hx : x ∈ (trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 162 | (TangentSpace (𝓡 n)) p).baseSet) : |
| 163 | Module.finrank ℝ (coordinateRicciOperator D p x).ker = ricciNullity D x := by |
| 164 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) p |
| 165 | let L := e.continuousLinearEquivAt ℝ x hx |
| 166 | have hker : (coordinateRicciOperator D p x).ker = |
| 167 | (ricciKernel D x).map L.toLinearEquiv.toLinearMap := by |
| 168 | ext v |
| 169 | rw [Submodule.mem_map_equiv, mem_ricciKernel] |
| 170 | change coordinateRicciOperator D p x v = 0 ↔ _ |
| 171 | rw [coordinateRicciOperator_eq_zero_iff D p hx] |
| 172 | change (∀ w, D.ricci x (constantCoordinateField p v x) w = 0) ↔ |
| 173 | ∀ w, D.ricci x (L.symm v) w = 0 |
| 174 | rw [show L.symm v = constantCoordinateField p v x from |
| 175 | congrFun (e.symm_continuousLinearEquivAt_eq hx) v] |
| 176 | rw [hker, LinearEquiv.finrank_map_eq] |
| 177 | rfl |
| 178 | |
| 179 | /-- Locally constant actual Ricci nullity gives a smooth local null section |
| 180 | through every prescribed null vector. No restriction on the nullity is needed. -/ |
| 181 | theorem exists_local_smooth_ricci_null_section (D : LeviCivitaData g) |
| 182 | (hD : D.CurvatureTensorCalculus) {x : M} |
| 183 | (hdim : ∀ᶠ y in 𝓝 x, ricciNullity D y = ricciNullity D x) |
| 184 | (v : TangentSpace (𝓡 n) x) (hv : ∀ w, D.ricci x v w = 0) : |
| 185 | ∃ (U : Set M) (V : (y : M) → TangentSpace (𝓡 n) y), |
| 186 | IsOpen U ∧ x ∈ U ∧ |
| 187 | ContMDiffOn (𝓡 n) ((𝓡 n).prod (𝓡 n)) ∞ (T% V) U ∧ V x = v ∧ |
| 188 | ∀ y ∈ U, ∀ w, D.ricci y (V y) w = 0 := by |
| 189 | let E := EuclideanSpace ℝ (Fin n) |
| 190 | let e := trivializationAt E (TangentSpace (𝓡 n)) x |
| 191 | have hx : x ∈ e.baseSet := FiberBundle.mem_baseSet_trivializationAt E (TangentSpace (𝓡 n)) x |
| 192 | obtain ⟨W, hWdim, hWo, hxW⟩ := mem_nhds_iff.mp hdim |
| 193 | let U := W ∩ e.baseSet |
| 194 | have hU : IsOpen U := hWo.inter e.open_baseSet |
| 195 | have hxU : x ∈ U := ⟨hxW, hx⟩ |
| 196 | let A := coordinateRicciOperator D x |
| 197 | have hA : ContMDiffOn (𝓡 n) 𝓘(ℝ, E →L[ℝ] E) ∞ A U := fun y hy => |
| 198 | (contMDiffAt_coordinateRicciOperator D hD x hy.2).contMDiffWithinAt |
| 199 | have hsym : (A x).toLinearMap.IsSymmetric := by |
| 200 | intro u w |
| 201 | change inner ℝ (A x u) w = inner ℝ u (A x w) |
| 202 | conv_rhs => rw [real_inner_comm] |
| 203 | rw [coordinateRicciOperator_inner, coordinateRicciOperator_inner] |
| 204 | exact (hD.2.2.2.1 x _ _ 0 0).2.2.2 |
| 205 | have hAdim (y : M) (hy : y ∈ U) : |
| 206 | Module.finrank ℝ (A y).ker = Module.finrank ℝ (A x).ker := by |
| 207 | rw [coordinateRicciOperator_finrank_ker D x hy.2, |
| 208 | coordinateRicciOperator_finrank_ker D x hx] |
| 209 | exact hWdim hy.1 |
| 210 | let v₀ := e.continuousLinearMapAt ℝ x v |
| 211 | have hv₀ : A x v₀ = 0 := by |
| 212 | apply (coordinateRicciOperator_eq_zero_iff D x hx v₀).mpr |
| 213 | change ∀ w, D.ricci x (e.symmL ℝ x (e.continuousLinearMapAt ℝ x v)) w = 0 |
| 214 | rw [e.symmL_continuousLinearMapAt hx] |
| 215 | exact hv |
| 216 | obtain ⟨O, s, hOo, hxO, hOU, hs, hsx, hsnull⟩ := |
| 217 | exists_local_contMDiff_kernel_section hU hA hxU hsym hAdim v₀ hv₀ |
| 218 | let V : (y : M) → TangentSpace (𝓡 n) y := fun y => e.symmL ℝ y (s y) |
| 219 | refine ⟨O, V, hOo, hxO, ?_, ?_, ?_⟩ |
| 220 | · intro y hy |
| 221 | have hs' : ContMDiffAt (𝓡 n) ((𝓡 n).prod (𝓡 n)) ∞ |
| 222 | (fun z : M => TotalSpace.mk' E z (s z)) y := by |
| 223 | rw [contMDiffAt_totalSpace] |
| 224 | exact ⟨contMDiffAt_id, (hs y hy).contMDiffAt (hOo.mem_nhds hy)⟩ |
| 225 | exact ((e.contMDiffAt_symmL (IB := 𝓡 n) (n := ∞) (hOU hy).2).clm_bundle_apply |
| 226 | hs').contMDiffWithinAt |
| 227 | · change e.symmL ℝ x (s x) = v |
| 228 | rw [hsx] |
| 229 | exact e.symmL_continuousLinearMapAt hx v |
| 230 | · intro y hy |
| 231 | exact (coordinateRicciOperator_eq_zero_iff D x (hOU hy).2 (s y)).mp (hsnull y hy) |
| 232 | |
| 233 | end PoincareMT.RicciFlow.Splitting |