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.Persistence.NeckAnalysis.SphereMetric |
| 3 | |
| 4 | /-! |
| 5 | # Smooth coefficients and inverse of the literal cylinder model |
| 6 | |
| 7 | Morgan--Tian Definition 2.16, p. 30, and Proposition 9.79, pp. 232-234. |
| 8 | These are identities for the frozen chosen-chart Gram function and its |
| 9 | actual derivatives, used by the cylinder-jet bootstrap derivation. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle BigOperators InnerProductSpace |
| 16 | |
| 17 | namespace PoincareMT.Proofs.M28.NeckAnalysis |
| 18 | |
| 19 | /-- The chosen sphere chart's conformal coefficient is smooth on its full |
| 20 | Euclidean target; its denominator is everywhere positive. -/ |
| 21 | theorem contDiff_sphereChartConformalFactor : |
| 22 | ContDiff ℝ ∞ sphereChartConformalFactor := by |
| 23 | unfold sphereChartConformalFactor |
| 24 | exact contDiff_const.div (((contDiff_norm_sq ℝ).add contDiff_const).pow 2) |
| 25 | (fun _ => by positivity) |
| 26 | |
| 27 | /-- The actual conformal coefficient differential at an arbitrary sphere |
| 28 | chart coordinate (cylinder-jet bootstrap derivation). -/ |
| 29 | theorem hasFDerivAt_sphereChartConformalFactor (x : EuclideanSpace ℝ (Fin 2)) : |
| 30 | HasFDerivAt sphereChartConformalFactor |
| 31 | ((-64 / (‖x‖ ^ 2 + 4) ^ 3) • innerSL ℝ x) x := by |
| 32 | have hd : ‖x‖ ^ 2 + 4 ≠ 0 := by positivity |
| 33 | have hsq : HasFDerivAt (fun y : EuclideanSpace ℝ (Fin 2) => ‖y‖ ^ 2) |
| 34 | ((2 : ℝ) • innerSL ℝ x) x := by |
| 35 | simpa only [two_smul] using (hasStrictFDerivAt_norm_sq x).hasFDerivAt |
| 36 | have hi := (hasFDerivAt_inv hd).comp x (hsq.add_const 4) |
| 37 | convert! (hi.pow 2).const_mul (16 : ℝ) using 1 |
| 38 | · funext y |
| 39 | simp [sphereChartConformalFactor, div_eq_mul_inv, inv_pow] |
| 40 | · ext h |
| 41 | simp [innerSL_apply_apply, nsmul_eq_mul] |
| 42 | field_simp [hd] |
| 43 | ring |
| 44 | |
| 45 | /-- The conformal differential after the actual product-chart projection. -/ |
| 46 | theorem fderiv_sphereChartConformalFactor_fst (p h : RoundCylinderCoordinates) : |
| 47 | fderiv ℝ (fun y : RoundCylinderCoordinates => sphereChartConformalFactor y.1) p h = |
| 48 | (-64 / (‖p.1‖ ^ 2 + 4) ^ 3) * inner ℝ p.1 h.1 := by |
| 49 | have hh := ((hasFDerivAt_sphereChartConformalFactor p.1).comp p |
| 50 | (ContinuousLinearMap.fst ℝ (EuclideanSpace ℝ (Fin 2)) ℝ).hasFDerivAt).fderiv |
| 51 | exact congrArg (fun L : RoundCylinderCoordinates →L[ℝ] ℝ => L h) hh |
| 52 | |
| 53 | /-- The full chosen-chart inverse is the inverse of the actual positive |
| 54 | diagonal, rather than a formal inverse with a possible zero determinant. -/ |
| 55 | theorem roundCylinderGram_inverse_chosen_chart {u : ℝ} (hu : u < 1) |
| 56 | (q : UnitTwoSphere) (p : RoundCylinderCoordinates) : |
| 57 | (roundCylinderGram u (chartAt (EuclideanSpace ℝ (Fin 2)) q) p)⁻¹ = |
| 58 | Matrix.diagonal ![(2 * (1-u) * sphereChartConformalFactor p.1)⁻¹, |
| 59 | (2 * (1-u) * sphereChartConformalFactor p.1)⁻¹, 1] := by |
| 60 | rw [roundCylinderGram_chosen_chart] |
| 61 | have hnonzero : 2 * (1-u) * sphereChartConformalFactor p.1 ≠ 0 := by |
| 62 | have hpos := sphereChartConformalFactor_pos p.1 |
| 63 | positivity |
| 64 | apply Matrix.inv_eq_right_inv |
| 65 | rw [Matrix.diagonal_mul_diagonal] |
| 66 | ext a b |
| 67 | by_cases hab : a = b |
| 68 | · subst b |
| 69 | fin_cases a |
| 70 | · change (2 * (1-u) * sphereChartConformalFactor p.1) * |
| 71 | (2 * (1-u) * sphereChartConformalFactor p.1)⁻¹ = 1 |
| 72 | exact mul_inv_cancel₀ hnonzero |
| 73 | · change (2 * (1-u) * sphereChartConformalFactor p.1) * |
| 74 | (2 * (1-u) * sphereChartConformalFactor p.1)⁻¹ = 1 |
| 75 | exact mul_inv_cancel₀ hnonzero |
| 76 | · norm_num [Matrix.diagonal] |
| 77 | · simp [Matrix.diagonal, hab] |
| 78 | |
| 79 | /-- The frozen Gram derivative vanishes in axial or off-diagonal slots and |
| 80 | has the displayed conformal derivative in the two sphere slots. -/ |
| 81 | theorem fderiv_roundCylinderGram_chosen_chart (u : ℝ) (q : UnitTwoSphere) |
| 82 | (p h : RoundCylinderCoordinates) (a b : Fin 3) : |
| 83 | fderiv ℝ (fun y => roundCylinderGram u |
| 84 | (chartAt (EuclideanSpace ℝ (Fin 2)) q) y a b) p h = |
| 85 | if a = b ∧ a ≠ 2 then |
| 86 | (-128 * (1-u) / (‖p.1‖ ^ 2 + 4) ^ 3) * inner ℝ p.1 h.1 |
| 87 | else 0 := by |
| 88 | have hd : DifferentiableAt ℝ |
| 89 | (fun y : RoundCylinderCoordinates => sphereChartConformalFactor y.1) p := |
| 90 | (contDiff_sphereChartConformalFactor.comp contDiff_fst).contDiffAt.differentiableAt (by simp) |
| 91 | simp_rw [roundCylinderGram_chosen_chart] |
| 92 | fin_cases a <;> fin_cases b <;> |
| 93 | simp [Matrix.diagonal, fderiv_const_mul hd, fderiv_sphereChartConformalFactor_fst] <;> |
| 94 | ring |
| 95 | |
| 96 | end PoincareMT.Proofs.M28.NeckAnalysis |