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.Surgery.StandardCap.Existence.InitialMetric.RadialBounds |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Analysis.Metric.RadialConnection |
| 3 | import PoincareLib.Geometry.Riemannian.Connection.EuclideanConstruction |
| 4 | |
| 5 | /-! |
| 6 | # The actual initial-cap connection |
| 7 | |
| 8 | Morgan-Tian Lemma 12.2, printed pp. 294-295. The lower M07 Euclidean |
| 9 | construction supplies a genuine Levi-Civita connection for the smooth cap |
| 10 | metric. Koszul's formula identifies its coefficients at every nonzero |
| 11 | point. The origin is treated by smoothness in the later curvature proof. |
| 12 | See the M34 radial-curvature derivation. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | namespace PoincareMT.M34 |
| 20 | |
| 21 | /-- Angular part of the radial Christoffel coefficient, away from zero |
| 22 | (Lemma 12.2 computation, pp. 294-295). -/ |
| 23 | noncomputable def capChristoffelA (a r : ℝ) : ℝ := |
| 24 | deriv (capAngularCoefficient a) r / (2 * r * capAngularCoefficient a r) |
| 25 | |
| 26 | /-- Euclidean inner-product part of the radial Christoffel coefficient |
| 27 | (Lemma 12.2 computation, pp. 294-295). -/ |
| 28 | noncomputable def capChristoffelB (a r : ℝ) : ℝ := |
| 29 | capRadialCoefficient a r - deriv (capAngularCoefficient a) r / (2 * r) |
| 30 | |
| 31 | /-- Radial rank-one part of the Christoffel coefficient |
| 32 | (Lemma 12.2 computation, pp. 294-295). -/ |
| 33 | noncomputable def capChristoffelC (a r : ℝ) : ℝ := |
| 34 | deriv (capRadialCoefficient a) r / (2 * r) - |
| 35 | 2 * capChristoffelA a r * capRadialCoefficient a r |
| 36 | |
| 37 | /-- The first metric derivative in fixed Cartesian directions |
| 38 | (Lemma 12.2 connection calculation, pp. 294-295). -/ |
| 39 | theorem capMetricInner_fderiv (a : ℝ) {x : StandardCapSpace} (hx : x ≠ 0) |
| 40 | (u v w : StandardCapSpace) : |
| 41 | fderiv ℝ (fun y => capMetricInner a y u v) x w = |
| 42 | deriv (capAngularCoefficient a) ‖x‖ / ‖x‖ * inner ℝ x w * inner ℝ u v + |
| 43 | deriv (capRadialCoefficient a) ‖x‖ / ‖x‖ * inner ℝ x w * |
| 44 | (inner ℝ x u * inner ℝ x v) + |
| 45 | capRadialCoefficient a ‖x‖ * |
| 46 | (inner ℝ w u * inner ℝ x v + inner ℝ x u * inner ℝ w v) := by |
| 47 | exact Poincare.fderiv_radial_pairing hx |
| 48 | ((capAngularCoefficient_contDiffAt a (norm_ne_zero_iff.mpr hx)).differentiableAt |
| 49 | (by simp)).hasDerivAt |
| 50 | ((capRadialCoefficient_contDiffAt a (norm_ne_zero_iff.mpr hx)).differentiableAt |
| 51 | (by simp)).hasDerivAt u v w |
| 52 | |
| 53 | /-- The cap's actual Levi-Civita data, constructed from its smooth |
| 54 | positive metric (Lemma 12.2, pp. 294-295). -/ |
| 55 | noncomputable def capLeviCivitaData (a : ℝ) (ha : 0 < a) (hapi : a ≤ Real.pi / 2) : |
| 56 | LeviCivitaData (capRiemannianMetric a ha hapi) := |
| 57 | (capRiemannianMetric a ha hapi).euclideanLeviCivitaData |
| 58 | |
| 59 | set_option backward.isDefEq.respectTransparency false in |
| 60 | /-- Every retained Levi-Civita connection for the cap has the computed |
| 61 | radial coefficients off the origin (Lemma 12.2, pp. 294-295). -/ |
| 62 | theorem capConnection_formula {a : ℝ} (ha : 0 < a) (hapi : a ≤ Real.pi / 2) |
| 63 | (D : LeviCivitaData (capRiemannianMetric a ha hapi)) |
| 64 | {x : StandardCapSpace} (hx : x ≠ 0) (u v : StandardCapSpace) : |
| 65 | D.connection (fun _ => v) x u = |
| 66 | Poincare.radialChristoffel (capChristoffelA a ‖x‖) |
| 67 | (capChristoffelB a ‖x‖) (capChristoffelC a ‖x‖) x u v := by |
| 68 | apply ((capRiemannianMetric a ha hapi).inner_isInvertible x).injective |
| 69 | ext w |
| 70 | have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx |
| 71 | have hc : capAngularCoefficient a ‖x‖ ≠ 0 := |
| 72 | (capAngularCoefficient_pos ha.le hapi (norm_nonneg x)).ne' |
| 73 | have hr : capAngularCoefficient a ‖x‖ + |
| 74 | capRadialCoefficient a ‖x‖ * ‖x‖ ^ 2 = 1 := by |
| 75 | rw [capRadialCoefficient_mul_sq] |
| 76 | ring |
| 77 | have hA : 2 * capAngularCoefficient a ‖x‖ * capChristoffelA a ‖x‖ = |
| 78 | deriv (capAngularCoefficient a) ‖x‖ / ‖x‖ := by |
| 79 | unfold capChristoffelA |
| 80 | field_simp |
| 81 | have hB : 2 * capChristoffelB a ‖x‖ = 2 * capRadialCoefficient a ‖x‖ - |
| 82 | deriv (capAngularCoefficient a) ‖x‖ / ‖x‖ := by |
| 83 | unfold capChristoffelB |
| 84 | ring |
| 85 | have hC : 2 * (capChristoffelC a ‖x‖ + |
| 86 | 2 * capChristoffelA a ‖x‖ * capRadialCoefficient a ‖x‖) = |
| 87 | deriv (capRadialCoefficient a) ‖x‖ / ‖x‖ := by |
| 88 | unfold capChristoffelC |
| 89 | ring |
| 90 | have hk := D.inner_connection_const x u v w |
| 91 | change 2 * capMetricInner a x (D.connection (fun _ => v) x u) w = |
| 92 | fderiv ℝ (fun y => capMetricInner a y v w) x u + |
| 93 | fderiv ℝ (fun y => capMetricInner a y w u) x v - |
| 94 | fderiv ℝ (fun y => capMetricInner a y u v) x w at hk |
| 95 | rw [capMetricInner_fderiv a hx, capMetricInner_fderiv a hx, |
| 96 | capMetricInner_fderiv a hx] at hk |
| 97 | have he := Poincare.radialChristoffel_koszul _ _ _ _ _ _ _ x u v w hr hA hB hC |
| 98 | change capMetricInner a x (D.connection (fun _ => v) x u) w = |
| 99 | capMetricInner a x _ w |
| 100 | rw [capMetricInner_apply a x (Poincare.radialChristoffel _ _ _ x u v) w] |
| 101 | linarith only [hk, he] |
| 102 | |
| 103 | end PoincareMT.M34 |