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.Asymptotics.StereographicMetric |
| 2 | |
| 3 | /-! |
| 4 | # Spatial derivatives of the literal cylinder coefficients |
| 5 | |
| 6 | The conformal logarithmic derivatives are -2*x_i/d. Their actual |
| 7 | ordinary derivatives and the derivative of rho supply the constant-frame |
| 8 | Koszul and curvature computations. This is Morgan-Tian Proposition 12.7, |
| 9 | pp. 298-299 and cylinder-asymptotics-by-end-energy.md. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open scoped ContDiff |
| 16 | |
| 17 | namespace PoincareMT.M34 |
| 18 | |
| 19 | local notation "E3" => EuclideanSpace ℝ (Fin 3) |
| 20 | |
| 21 | /-- A horizontal logarithmic derivative of the conformal metric |
| 22 | (Proposition 12.7, pp. 298-299). -/ |
| 23 | noncomputable def stereographicCylinderLogDerivative (i : Fin 2) (x : E3) : ℝ := |
| 24 | -2 * x i.castSucc / stereographicCylinderDenominator x |
| 25 | |
| 26 | /-- The actual derivative of the positive denominator |
| 27 | (Proposition 12.7, pp. 298-299). -/ |
| 28 | theorem stereographicCylinderDenominator_hasFDerivAt (x : E3) : |
| 29 | HasFDerivAt stereographicCylinderDenominator |
| 30 | ((2 * x 0) • (EuclideanSpace.proj 0 : E3 →L[ℝ] ℝ) + |
| 31 | (2 * x 1) • (EuclideanSpace.proj 1 : E3 →L[ℝ] ℝ)) x := by |
| 32 | convert! ((hasFDerivAt_const (4 : ℝ) x).add |
| 33 | ((EuclideanSpace.proj 0 : E3 →L[ℝ] ℝ).hasFDerivAt.pow 2)).add |
| 34 | ((EuclideanSpace.proj 1 : E3 →L[ℝ] ℝ).hasFDerivAt.pow 2) using 1 |
| 35 | simp |
| 36 | |
| 37 | /-- The actual conformal-factor derivative on all Euclidean points |
| 38 | (Proposition 12.7, pp. 298-299). -/ |
| 39 | theorem stereographicCylinderDensity_fderiv (x w : E3) : |
| 40 | fderiv ℝ stereographicCylinderDensity x w = |
| 41 | -64 * (x 0 * w 0 + x 1 * w 1) / stereographicCylinderDenominator x ^ 3 := by |
| 42 | have hne := (stereographicCylinderDenominator_pos x).ne' |
| 43 | have ho : HasDerivAt (fun s : ℝ => 16 / s ^ 2) |
| 44 | (-32 / stereographicCylinderDenominator x ^ 3) (stereographicCylinderDenominator x) := by |
| 45 | convert! (hasDerivAt_const (stereographicCylinderDenominator x) (16 : ℝ)).div |
| 46 | ((hasDerivAt_id _).pow 2) (pow_ne_zero 2 hne) using 1 |
| 47 | simp only [Pi.pow_apply, id_eq, Nat.reduceSub, pow_one] |
| 48 | field_simp |
| 49 | ring |
| 50 | have h := ho.comp_hasFDerivAt x (stereographicCylinderDenominator_hasFDerivAt x) |
| 51 | change HasFDerivAt stereographicCylinderDensity _ x at h |
| 52 | rw [h.fderiv] |
| 53 | simp only [smul_apply, add_apply, smul_eq_mul] |
| 54 | change (-32 / stereographicCylinderDenominator x ^ 3) * |
| 55 | (2 * x 0 * w 0 + 2 * x 1 * w 1) = _ |
| 56 | field_simp |
| 57 | ring |
| 58 | |
| 59 | /-- Each horizontal logarithmic derivative has its explicit ordinary |
| 60 | directional derivative (Proposition 12.7, pp. 298-299). -/ |
| 61 | theorem stereographicCylinderLogDerivative_fderiv (i : Fin 2) (x w : E3) : |
| 62 | fderiv ℝ (stereographicCylinderLogDerivative i) x w = |
| 63 | -2 * w i.castSucc / stereographicCylinderDenominator x + |
| 64 | 4 * x i.castSucc * (x 0 * w 0 + x 1 * w 1) / |
| 65 | stereographicCylinderDenominator x ^ 2 := by |
| 66 | have hne := (stereographicCylinderDenominator_pos x).ne' |
| 67 | have hinv := (hasDerivAt_inv hne).comp_hasFDerivAt x |
| 68 | (stereographicCylinderDenominator_hasFDerivAt x) |
| 69 | have h := ((EuclideanSpace.proj i.castSucc : E3 →L[ℝ] ℝ).hasFDerivAt.const_mul |
| 70 | (-2 : ℝ)).mul hinv |
| 71 | rw [show stereographicCylinderLogDerivative i = |
| 72 | (fun y : E3 => (-2 * y i.castSucc) * (stereographicCylinderDenominator y)⁻¹) from |
| 73 | funext (fun y => by simp only [stereographicCylinderLogDerivative, div_eq_mul_inv])] |
| 74 | change HasFDerivAt (fun y : E3 => (-2 * y i.castSucc) * |
| 75 | (stereographicCylinderDenominator y)⁻¹) _ x at h |
| 76 | rw [h.fderiv] |
| 77 | simp only [smul_apply, add_apply, smul_eq_mul, Function.comp_apply] |
| 78 | change (-2 * x i.castSucc) * (-(stereographicCylinderDenominator x ^ 2)⁻¹ * |
| 79 | (2 * x 0 * w 0 + 2 * x 1 * w 1)) + |
| 80 | (stereographicCylinderDenominator x)⁻¹ * (-2 * w i.castSucc) = _ |
| 81 | field_simp |
| 82 | ring |
| 83 | |
| 84 | /-- The model's scalar bilinear evaluations have the derivative used by |
| 85 | the genuine Koszul formula (Proposition 12.7, pp. 298-299). -/ |
| 86 | theorem stereographicCylinderCoefficients_fderiv (b : ℝ) (x u v w : E3) : |
| 87 | fderiv ℝ (fun y => stereographicCylinderCoefficients b y u v) x w = |
| 88 | 2 * b * stereographicCylinderDensity x * |
| 89 | (stereographicCylinderLogDerivative 0 x * w 0 + |
| 90 | stereographicCylinderLogDerivative 1 x * w 1) * (u 0 * v 0 + u 1 * v 1) := by |
| 91 | have hd := (stereographicCylinderDensity_contDiff.differentiable (by simp) x).hasFDerivAt |
| 92 | have h := ((hd.const_mul b).mul_const (u 0 * v 0 + u 1 * v 1)).add_const (u 2 * v 2) |
| 93 | have heq : (fun y => stereographicCylinderCoefficients b y u v) = |
| 94 | (fun y => b * stereographicCylinderDensity y * (u 0 * v 0 + u 1 * v 1) + u 2 * v 2) := |
| 95 | funext (fun y => stereographicCylinderCoefficients_apply b y u v) |
| 96 | rw [heq, h.fderiv] |
| 97 | simp only [smul_apply, smul_eq_mul] |
| 98 | rw [stereographicCylinderDensity_fderiv] |
| 99 | have hne := (stereographicCylinderDenominator_pos x).ne' |
| 100 | dsimp only [stereographicCylinderDensity, stereographicCylinderLogDerivative] |
| 101 | norm_num only [Fin.castSucc_zero, Fin.castSucc_one] |
| 102 | field_simp |
| 103 | ring |
| 104 | |
| 105 | end PoincareMT.M34 |