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.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Uniqueness.RadialConnection |
| 3 | import PoincareLib.Geometry.Riemannian.Curvature.Euclidean |
| 4 | import Mathlib.Analysis.Calculus.ContDiff.Deriv |
| 5 | |
| 6 | /-! |
| 7 | # Differentiating the actual radial connection |
| 8 | |
| 9 | Morgan-Tian Section 12.6, pp. 307-309. The retained connection was |
| 10 | identified from the actual rotational metric by Koszul's formula. |
| 11 | Here its coefficients are differentiated on the punctured space. These |
| 12 | are the derivatives in the retained Euclidean curvature formula. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Filter |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | namespace PoincareMT.M35.Uniqueness |
| 22 | |
| 23 | /-- Section 12.6: the three actual radial connection coefficients are |
| 24 | smooth away from the origin, including the derivatives of metric coefficients. -/ |
| 25 | theorem radialConnection_contDiffAt |
| 26 | (g : RiemannianMetric 3 StandardCapSpace) {r : ℝ} (hr : 0 < r) : |
| 27 | ContDiffAt ℝ ∞ (radialConnectionAlpha g) r ∧ |
| 28 | ContDiffAt ℝ ∞ (radialConnectionBeta g) r ∧ |
| 29 | ContDiffAt ℝ ∞ (radialConnectionGamma g) r := by |
| 30 | have ha := (axisAngularCoefficient_contDiff g).contDiffAt (x := r) |
| 31 | have hb := (axisRadialCoefficient_contDiff g).contDiffAt (x := r) |
| 32 | have hcor : ContDiffAt ℝ ∞ (axisCorrectionCoefficient g) r := |
| 33 | (hb.sub ha).div (contDiffAt_id.pow 2) (pow_ne_zero 2 hr.ne') |
| 34 | have hda : ContDiffAt ℝ ∞ (deriv (axisAngularCoefficient g)) r := |
| 35 | ha.derivWithin (by simp) |
| 36 | have hA : ContDiffAt ℝ ∞ (radialConnectionAlpha g) r := |
| 37 | hda.div ((contDiffAt_const.mul ha).mul contDiffAt_id) |
| 38 | (mul_ne_zero (mul_ne_zero (by norm_num) |
| 39 | (axisAngularCoefficient_pos g r).ne') hr.ne') |
| 40 | have hB : ContDiffAt ℝ ∞ (radialConnectionBeta g) r := |
| 41 | (hcor.sub (hda.div (contDiffAt_const.mul contDiffAt_id) |
| 42 | (by positivity : (2 : ℝ) * r ≠ 0))).div hb |
| 43 | (axisRadialCoefficient_pos g r).ne' |
| 44 | have hdcor : ContDiffAt ℝ ∞ (deriv (axisCorrectionCoefficient g)) r := |
| 45 | hcor.derivWithin (by simp) |
| 46 | have hC : ContDiffAt ℝ ∞ (radialConnectionGamma g) r := |
| 47 | ((hdcor.div (contDiffAt_const.mul contDiffAt_id) |
| 48 | (by positivity : (2 : ℝ) * r ≠ 0)).sub |
| 49 | ((contDiffAt_const.mul hcor).mul hA)).div hb |
| 50 | (axisRadialCoefficient_pos g r).ne' |
| 51 | exact ⟨hA, hB, hC⟩ |
| 52 | |
| 53 | private theorem norm_hasFDerivAt {x : StandardCapSpace} (hx : x ≠ 0) : |
| 54 | HasFDerivAt (fun y : StandardCapSpace => ‖y‖) |
| 55 | (‖x‖⁻¹ • innerSL ℝ x) x := by |
| 56 | have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx |
| 57 | have h := (hasStrictFDerivAt_norm_sq x).hasFDerivAt.sqrt (pow_ne_zero 2 hn) |
| 58 | simp only [Real.sqrt_sq_eq_abs, abs_norm] at h |
| 59 | convert! h using 1 |
| 60 | ext w |
| 61 | simp [smul_eq_mul] |
| 62 | ring |
| 63 | |
| 64 | /-- Section 12.6: differentiating the literal retained constant-field |
| 65 | connection in every actual Euclidean spatial direction. -/ |
| 66 | theorem rotational_connection_first_derivative |
| 67 | {g : RiemannianMetric 3 StandardCapSpace} (D : LeviCivitaData g) |
| 68 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 69 | ∀ x u v : StandardCapSpace, |
| 70 | g.inner (standardRotation A x) |
| 71 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 72 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = g.inner x u v) |
| 73 | {x : StandardCapSpace} (hx : x ≠ 0) (u v w : StandardCapSpace) : |
| 74 | fderiv ℝ (D.euclideanConnection u v) x w = |
| 75 | (deriv (radialConnectionAlpha g) ‖x‖ / ‖x‖ * inner ℝ x w) • |
| 76 | (inner ℝ x u • v + inner ℝ x v • u) + |
| 77 | radialConnectionAlpha g ‖x‖ • |
| 78 | (inner ℝ w u • v + inner ℝ w v • u) + |
| 79 | (deriv (radialConnectionBeta g) ‖x‖ / ‖x‖ * inner ℝ x w * inner ℝ u v + |
| 80 | deriv (radialConnectionGamma g) ‖x‖ / ‖x‖ * |
| 81 | inner ℝ x w * inner ℝ x u * inner ℝ x v + |
| 82 | radialConnectionGamma g ‖x‖ * |
| 83 | (inner ℝ w u * inner ℝ x v + inner ℝ x u * inner ℝ w v)) • x + |
| 84 | (radialConnectionBeta g ‖x‖ * inner ℝ u v + |
| 85 | radialConnectionGamma g ‖x‖ * inner ℝ x u * inner ℝ x v) • w := by |
| 86 | obtain ⟨hA, hB, hC⟩ := radialConnection_contDiffAt g (norm_pos_iff.mpr hx) |
| 87 | have hn := norm_hasFDerivAt hx |
| 88 | have hda := ((hA.differentiableAt (by simp)).hasDerivAt).comp_hasFDerivAt x hn |
| 89 | have hdb := ((hB.differentiableAt (by simp)).hasDerivAt).comp_hasFDerivAt x hn |
| 90 | have hdc := ((hC.differentiableAt (by simp)).hasDerivAt).comp_hasFDerivAt x hn |
| 91 | have hu := (innerSL ℝ u).hasFDerivAt (x := x) |
| 92 | have hv := (innerSL ℝ v).hasFDerivAt (x := x) |
| 93 | have hd := (hda.smul ((hu.smul_const v).add (hv.smul_const u))).add |
| 94 | (((hdb.mul_const (inner ℝ u v)).add ((hdc.mul hu).mul hv)).smul (hasFDerivAt_id x)) |
| 95 | have heq : D.euclideanConnection u v =ᶠ[𝓝 x] |
| 96 | (fun y => radialConnectionAlpha g ‖y‖ • |
| 97 | (inner ℝ u y • v + inner ℝ v y • u) + |
| 98 | (radialConnectionBeta g ‖y‖ * inner ℝ u v + |
| 99 | radialConnectionGamma g ‖y‖ * inner ℝ u y * inner ℝ v y) • y) := by |
| 100 | filter_upwards [eventually_ne_nhds hx] with y hy |
| 101 | have h := rotational_connection_const D hrotation hy u v |
| 102 | simpa only [LeviCivitaData.euclideanConnection, real_inner_comm y u, |
| 103 | real_inner_comm y v] using h |
| 104 | erw [heq.fderiv_eq, hd.fderiv] |
| 105 | ext i |
| 106 | simp only [add_apply, smul_apply, Pi.add_apply, Pi.mul_apply, id_eq, |
| 107 | ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.id_apply, |
| 108 | smul_eq_mul, innerSL_apply_apply, |
| 109 | Function.comp_apply, PiLp.add_apply, PiLp.smul_apply, real_inner_comm u x, |
| 110 | real_inner_comm v x, real_inner_comm u w, real_inner_comm v w] |
| 111 | ring |
| 112 | |
| 113 | end PoincareMT.M35.Uniqueness |