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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Spheres.RoundModelTensorConnection |
| 3 | |
| 4 | /-! |
| 5 | # Radius-independent first connection jet at a Gauss centre |
| 6 | |
| 7 | The derivative of a torsion-free connection is symmetric in its two vector |
| 8 | slots. The radial geodesic identity kills its trilinear diagonal. Full |
| 9 | polarization therefore expresses that derivative through the curvature at |
| 10 | the centre, independently of the radius of the chosen normal chart. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | set_option maxSynthPendingDepth 12 |
| 17 | |
| 18 | open Set Filter Metric |
| 19 | open scoped Manifold ContDiff Bundle BigOperators Topology |
| 20 | |
| 21 | namespace PoincareMT.M28.tube |
| 22 | |
| 23 | open PoincareMT.CoordinateExponential PoincareMT.ConnectionVariation |
| 24 | |
| 25 | section Algebra |
| 26 | |
| 27 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 28 | |
| 29 | theorem trilinear_gauss_polarization |
| 30 | (A : E →L[ℝ] E →L[ℝ] E →L[ℝ] E) |
| 31 | (hsymm : ∀ u v w, A u v w = A u w v) |
| 32 | (hdiag : ∀ u, A u u u = 0) (u v w : E) : |
| 33 | (3 : ℝ) • A u v w = |
| 34 | (A u v w - A v u w) + (A u w v - A w u v) := by |
| 35 | have hcyclic : A u v w + A v u w + A w u v = 0 := by |
| 36 | apply ext_inner_right ℝ |
| 37 | intro z |
| 38 | have h₁ := congrArg (fun a => inner ℝ a z) (hdiag (u + v + w)) |
| 39 | have h₂ := congrArg (fun a => inner ℝ a z) (hdiag (u + v)) |
| 40 | have h₃ := congrArg (fun a => inner ℝ a z) (hdiag (u + w)) |
| 41 | have h₄ := congrArg (fun a => inner ℝ a z) (hdiag (v + w)) |
| 42 | have h₅ := congrArg (fun a => inner ℝ a z) (hdiag u) |
| 43 | have h₆ := congrArg (fun a => inner ℝ a z) (hdiag v) |
| 44 | have h₇ := congrArg (fun a => inner ℝ a z) (hdiag w) |
| 45 | simp only [map_add, add_apply, inner_add_left, inner_zero_left] at * |
| 46 | rw [hsymm u w v, hsymm v w u, hsymm w v u] at h₁ |
| 47 | linarith only [h₁, h₂, h₃, h₄, h₅, h₆, h₇] |
| 48 | apply ext_inner_right ℝ |
| 49 | intro z |
| 50 | have hc := congrArg (fun a => inner ℝ a z) hcyclic |
| 51 | rw [hsymm u w v] |
| 52 | simp only [real_inner_smul_left, inner_add_left, inner_sub_left, |
| 53 | inner_zero_left] at * |
| 54 | linarith only [hc] |
| 55 | |
| 56 | theorem gauss_connection_derivative_three_eq_curvature |
| 57 | {Γ : E → E →L[ℝ] E →L[ℝ] E} |
| 58 | (hΓ : DifferentiableAt ℝ Γ 0) |
| 59 | (hsymm : ∀ x v w, Γ x v w = Γ x w v) |
| 60 | (hradial : ∀ (x : E) (t : ℝ), Γ (t • x) x x = 0) |
| 61 | (hzero : Γ 0 = 0) (u v w : E) : |
| 62 | (3 : ℝ) • fderiv ℝ Γ 0 u v w = |
| 63 | christoffelCurvature Γ 0 u v w + christoffelCurvature Γ 0 u w v := by |
| 64 | have happ (a b c : E) : |
| 65 | fderiv ℝ (fun y => Γ y b c) 0 a = fderiv ℝ Γ 0 a b c := by |
| 66 | rw [fderiv_clm_apply (hΓ.clm_apply (differentiableAt_const (c := b))) |
| 67 | (differentiableAt_const (c := c)), |
| 68 | fderiv_clm_apply hΓ (differentiableAt_const (c := b))] |
| 69 | simp |
| 70 | have hsym (a b c : E) : fderiv ℝ Γ 0 a b c = fderiv ℝ Γ 0 a c b := by |
| 71 | rw [← happ a b c, ← happ a c b] |
| 72 | exact congrArg (fun L : E →L[ℝ] E => L a) |
| 73 | (congrArg (fun f => fderiv ℝ f 0) (funext fun y => hsymm y b c)) |
| 74 | have hdiag (a : E) : fderiv ℝ Γ 0 a a a = 0 := by |
| 75 | have hpath : HasDerivAt (fun t : ℝ => Γ (t • a)) (fderiv ℝ Γ 0 a) 0 := by |
| 76 | have hΓ' : HasFDerivAt Γ (fderiv ℝ Γ 0) ((0 : ℝ) • a) := by |
| 77 | simpa using hΓ.hasFDerivAt |
| 78 | convert! hΓ'.comp_hasDerivAt 0 |
| 79 | ((hasDerivAt_id (0 : ℝ)).smul_const a) using 1 |
| 80 | simp |
| 81 | have hd := (hpath.clm_apply (hasDerivAt_const 0 a)).clm_apply |
| 82 | (hasDerivAt_const 0 a) |
| 83 | have heq : (fun t : ℝ => Γ (t • a) a a) = fun _ => (0 : E) := |
| 84 | funext (hradial a) |
| 85 | rw [heq] at hd |
| 86 | simpa using hd.unique (hasDerivAt_const 0 (0 : E)) |
| 87 | simpa [christoffelCurvature, hzero] using |
| 88 | trilinear_gauss_polarization (fderiv ℝ Γ 0) hsym hdiag u v w |
| 89 | |
| 90 | theorem norm_fderiv_gauss_connection_le_of_curvature |
| 91 | {Γ : E → E →L[ℝ] E →L[ℝ] E} |
| 92 | (hΓ : DifferentiableAt ℝ Γ 0) |
| 93 | (hsymm : ∀ x v w, Γ x v w = Γ x w v) |
| 94 | (hradial : ∀ (x : E) (t : ℝ), Γ (t • x) x x = 0) |
| 95 | (hzero : Γ 0 = 0) {K : ℝ} (hK : 0 ≤ K) |
| 96 | (hcurv : ∀ u v w, ‖christoffelCurvature Γ 0 u v w‖ ≤ |
| 97 | K * ‖u‖ * ‖v‖ * ‖w‖) (u : E) : |
| 98 | ‖fderiv ℝ Γ 0 u‖ ≤ K * ‖u‖ := by |
| 99 | have hpoint (v w : E) : |
| 100 | ‖fderiv ℝ Γ 0 u v w‖ ≤ K * ‖u‖ * ‖v‖ * ‖w‖ := by |
| 101 | have hthree := congrArg norm |
| 102 | (gauss_connection_derivative_three_eq_curvature hΓ hsymm hradial hzero u v w) |
| 103 | have hsum := (norm_add_le (christoffelCurvature Γ 0 u v w) |
| 104 | (christoffelCurvature Γ 0 u w v)).trans |
| 105 | (add_le_add (hcurv u v w) (hcurv u w v)) |
| 106 | simp only [norm_smul, Real.norm_eq_abs, abs_of_nonneg (by norm_num : |
| 107 | (0 : ℝ) ≤ 3)] at hthree |
| 108 | have hn : 0 ≤ K * ‖u‖ * ‖v‖ * ‖w‖ := by positivity |
| 109 | nlinarith only [hthree, hsum, hn] |
| 110 | apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) |
| 111 | intro v |
| 112 | apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) |
| 113 | intro w |
| 114 | exact hpoint v w |
| 115 | |
| 116 | end Algebra |
| 117 | |
| 118 | section RoundModel |
| 119 | |
| 120 | variable {M : Type*} [TopologicalSpace M] |
| 121 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 122 | [IsManifold (𝓡 3) ∞ M] |
| 123 | |
| 124 | /-- At the normalized centre of any round-model Gauss chart, the first |
| 125 | Christoffel derivative has the same universal bound `2`. No chart radius |
| 126 | occurs in the bound. -/ |
| 127 | theorem norm_round_model_christoffel_fderiv_le_two |
| 128 | {g : RiemannianMetric 3 M} {epsilon : ℝ} |
| 129 | (N : SingularRoundComponent g epsilon) |
| 130 | {R : ℝ} (hR : 0 < R) |
| 131 | (e : ModelE → N.model.carrier) |
| 132 | (he : ContMDiffOn (𝓡 3) (𝓡 3) ∞ e (ball 0 R)) |
| 133 | (hi : ∀ x ∈ ball 0 R, |
| 134 | (mfderiv (𝓡 3) (𝓡 3) e x).IsInvertible) |
| 135 | (hcenter : ∀ v w, |
| 136 | N.model_metric.pullbackCoefficients e 0 v w = inner ℝ v w) |
| 137 | (hgauss : ∀ x ∈ ball 0 R, ∀ w, |
| 138 | N.model_metric.pullbackCoefficients e x x w = inner ℝ x w) |
| 139 | (u : ModelE) : |
| 140 | ‖fderiv ℝ (christoffelBilinear |
| 141 | (N.model_metric.pullbackCoefficients e)) 0 u‖ ≤ 2 * ‖u‖ := by |
| 142 | let B := N.model_metric.pullbackCoefficients e |
| 143 | let r := R / 3 |
| 144 | let s := 2 * R / 3 |
| 145 | have hr : 0 < r := by dsimp [r]; positivity |
| 146 | have hrs : r < s := by dsimp [r, s]; linarith |
| 147 | have hsR : s < R := by dsimp [s]; linarith |
| 148 | have hB : ContDiffOn ℝ ∞ B (ball 0 R) := by |
| 149 | intro y hy |
| 150 | exact (N.model_metric.contDiffAt_pullbackCoefficients |
| 151 | (he.contMDiffAt (isOpen_ball.mem_nhds hy))).contDiffWithinAt |
| 152 | have hsymm : ∀ y ∈ ball (0 : ModelE) R, ∀ v w, B y v w = B y w v := by |
| 153 | intro y _hy v w |
| 154 | exact N.model_metric.symm (e y) _ _ |
| 155 | have hpos : ∀ y ∈ ball (0 : ModelE) R, ∀ v, v ≠ 0 → 0 < B y v v := by |
| 156 | intro y hy v hv |
| 157 | apply N.model_metric.pos (e y) |
| 158 | intro hz |
| 159 | apply hv |
| 160 | apply (hi y hy).injective |
| 161 | rw [map_zero] |
| 162 | convert! hz using 1 |
| 163 | obtain ⟨gE, DE, heq, hEgauss⟩ := |
| 164 | exists_gauss_metric_extension hr hrs hsR B hB hsymm hpos hgauss |
| 165 | have hcoeff : B =ᶠ[𝓝 (0 : ModelE)] gE.euclideanCoefficients := by |
| 166 | filter_upwards [isOpen_ball.mem_nhds (mem_ball_self hr)] with y hy |
| 167 | exact (heq y (ball_subset_closedBall hy)).symm |
| 168 | have hΓeq : christoffelBilinear B =ᶠ[𝓝 (0 : ModelE)] |
| 169 | christoffelBilinear gE.euclideanCoefficients := by |
| 170 | filter_upwards [hcoeff.eventually_nhds] with y hy |
| 171 | have hy' : B =ᶠ[𝓝 y] gE.euclideanCoefficients := hy |
| 172 | unfold christoffelBilinear |
| 173 | rw [hy'.self_of_nhds, hy'.fderiv_eq] |
| 174 | have h0 : ∀ v w : ModelE, gE.inner 0 v w = inner ℝ v w := by |
| 175 | intro v w |
| 176 | have hc := congrArg (fun K => K v w) hcoeff.self_of_nhds |
| 177 | exact hc.symm.trans (hcenter v w) |
| 178 | have hmetric : ∀ᶠ y in 𝓝 (0 : ModelE), ∀ v w : ModelE, |
| 179 | gE.inner y v w = N.model_metric.inner (e y) |
| 180 | (mfderiv (𝓡 3) (𝓡 3) e y v) (mfderiv (𝓡 3) (𝓡 3) e y w) := by |
| 181 | filter_upwards [hcoeff] with y hy v w |
| 182 | exact (congrArg (fun K => K v w) hy).symm |
| 183 | have hi' : ∀ᶠ y in 𝓝 (0 : ModelE), |
| 184 | (mfderiv (𝓡 3) (𝓡 3) e y).IsInvertible := by |
| 185 | filter_upwards [isOpen_ball.mem_nhds (mem_ball_self hR)] with y hy |
| 186 | exact hi y hy |
| 187 | have he0 := he.contMDiffAt (isOpen_ball.mem_nhds (mem_ball_self hR)) |
| 188 | have hmodel (v w : ModelE) : N.model_metric.inner (e 0) |
| 189 | (mfderiv (𝓡 3) (𝓡 3) e 0 v) (mfderiv (𝓡 3) (𝓡 3) e 0 w) = |
| 190 | inner ℝ v w := hcenter v w |
| 191 | have hcurv (a b c : ModelE) : DE.curvature 0 a b c = |
| 192 | inner ℝ b c • a - inner ℝ a c • b := by |
| 193 | apply ext_inner_right ℝ |
| 194 | intro z |
| 195 | have hc := DE.curvatureTensor_eq_pullback_euclidean N.model_connection |
| 196 | he0 hi' hmetric a b z c |
| 197 | rw [singularRound_curvatureTensor_eq_metricGram N] at hc |
| 198 | simp only [hmodel] at hc |
| 199 | change gE.inner 0 (DE.curvature 0 a b c) z = _ at hc |
| 200 | rw [h0] at hc |
| 201 | simp only [inner_sub_left, real_inner_smul_left] |
| 202 | calc |
| 203 | _ = inner ℝ a z * inner ℝ b c - inner ℝ b z * inner ℝ a c := hc |
| 204 | _ = _ := by ring |
| 205 | let Γ := christoffelBilinear gE.euclideanCoefficients |
| 206 | have hΓ : ContDiff ℝ ∞ Γ := |
| 207 | contDiff_iff_contDiffAt.mpr fun y => contDiffAt_christoffelBilinear |
| 208 | (gE.contDiffAt_euclideanCoefficients y) (gE.inner_isInvertible y) |
| 209 | have hΓd : DifferentiableAt ℝ Γ 0 := hΓ.contDiffAt.differentiableAt (by simp) |
| 210 | have hΓsymm (y a b : ModelE) : Γ y a b = Γ y b a := |
| 211 | christoffelBilinear_symm ((gE.contDiffAt_euclideanCoefficients y).differentiableAt |
| 212 | (by simp)) (Filter.Eventually.of_forall fun x v w => gE.symm x v w) a b |
| 213 | have hΓradial (a : ModelE) (t : ℝ) : Γ (t • a) a a = 0 := |
| 214 | christoffelBilinear_radial_eq_zero_of_gauss |
| 215 | (contDiff_iff_contDiffAt.mpr gE.contDiffAt_euclideanCoefficients) |
| 216 | (fun y => gE.inner_isInvertible y) (fun y a b => gE.symm y a b) hEgauss a t |
| 217 | have hΓzero : Γ 0 = 0 := by |
| 218 | exact christoffelBilinear_zero_of_gauss |
| 219 | (contDiff_iff_contDiffAt.mpr gE.contDiffAt_euclideanCoefficients) |
| 220 | (fun y => gE.inner_isInvertible y) (fun y a b => gE.symm y a b) hEgauss |
| 221 | have hΓcurv (a b c : ModelE) : ‖christoffelCurvature Γ 0 a b c‖ ≤ |
| 222 | 2 * ‖a‖ * ‖b‖ * ‖c‖ := by |
| 223 | rw [← coordinateCurvature_eq_christoffelCurvature hΓd, |
| 224 | coordinateCurvature_eq_retained DE, hcurv] |
| 225 | calc |
| 226 | ‖inner ℝ b c • a - inner ℝ a c • b‖ ≤ |
| 227 | ‖inner ℝ b c • a‖ + ‖inner ℝ a c • b‖ := norm_sub_le _ _ |
| 228 | _ = |inner ℝ b c| * ‖a‖ + |inner ℝ a c| * ‖b‖ := by |
| 229 | simp only [norm_smul, Real.norm_eq_abs] |
| 230 | _ ≤ (‖b‖ * ‖c‖) * ‖a‖ + (‖a‖ * ‖c‖) * ‖b‖ := by |
| 231 | exact add_le_add |
| 232 | (mul_le_mul_of_nonneg_right (abs_real_inner_le_norm b c) (norm_nonneg a)) |
| 233 | (mul_le_mul_of_nonneg_right (abs_real_inner_le_norm a c) (norm_nonneg b)) |
| 234 | _ = 2 * ‖a‖ * ‖b‖ * ‖c‖ := by ring |
| 235 | rw [hΓeq.fderiv_eq] |
| 236 | exact norm_fderiv_gauss_connection_le_of_curvature hΓd hΓsymm hΓradial hΓzero |
| 237 | (by norm_num) hΓcurv u |
| 238 | |
| 239 | /-- The induced connection on covariant two-tensors inherits a fixed bound |
| 240 | depending only on the dimension-three slot-action map. This is the uniform |
| 241 | connection correction used by the ordinary second metric-error jet. -/ |
| 242 | theorem norm_round_model_tensor_connection_fderiv_le_universal |
| 243 | {g : RiemannianMetric 3 M} {epsilon : ℝ} |
| 244 | (N : SingularRoundComponent g epsilon) |
| 245 | {R : ℝ} (hR : 0 < R) |
| 246 | (e : ModelE → N.model.carrier) |
| 247 | (he : ContMDiffOn (𝓡 3) (𝓡 3) ∞ e (ball 0 R)) |
| 248 | (hi : ∀ x ∈ ball 0 R, |
| 249 | (mfderiv (𝓡 3) (𝓡 3) e x).IsInvertible) |
| 250 | (hcenter : ∀ v w, |
| 251 | N.model_metric.pullbackCoefficients e 0 v w = inner ℝ v w) |
| 252 | (hgauss : ∀ x ∈ ball 0 R, ∀ w, |
| 253 | N.model_metric.pullbackCoefficients e x x w = inner ℝ x w) |
| 254 | (u : ModelE) : |
| 255 | ‖fderiv ℝ (roundModelTensorConnection |
| 256 | (N.model_metric.pullbackCoefficients e)) 0 u‖ ≤ |
| 257 | (‖modelTensorConnectionLiftMap‖ * 2) * ‖u‖ := by |
| 258 | apply norm_fderiv_roundModelTensorConnection_le |
| 259 | · exact N.model_metric.contDiffAt_pullbackCoefficients |
| 260 | (he.contMDiffAt (isOpen_ball.mem_nhds (mem_ball_self hR))) |
| 261 | · exact N.model_metric.isInvertible_pullbackCoefficients |
| 262 | (hi 0 (mem_ball_self hR)).injective |
| 263 | · norm_num |
| 264 | · exact norm_round_model_christoffel_fderiv_le_two N hR e he hi hcenter hgauss |
| 265 | |
| 266 | end RoundModel |
| 267 | |
| 268 | end PoincareMT.M28.tube |