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.SphereGram |
| 3 | |
| 4 | /-! |
| 5 | # Full chosen-chart coefficients of the round cylinder |
| 6 | |
| 7 | Morgan--Tian Definition 2.16, p. 30, and Proposition 9.79, pp. 232-234. |
| 8 | The actual stereographic inverse is conformal at every point, not only |
| 9 | at its center. Its Gram formula is independent of the chosen sphere |
| 10 | point and frame. See the cylinder-jet bootstrap derivation. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle BigOperators InnerProductSpace |
| 16 | |
| 17 | namespace PoincareMT.Proofs.M28.NeckAnalysis |
| 18 | |
| 19 | local instance : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin 3)) = 2 + 1) := |
| 20 | ⟨finrank_euclideanSpace_fin⟩ |
| 21 | |
| 22 | private theorem stereoInvFunAux_fderiv_apply |
| 23 | (v x h : EuclideanSpace ℝ (Fin 3)) : |
| 24 | fderiv ℝ (stereoInvFunAux v) x h = |
| 25 | (‖x‖ ^ 2 + 4)⁻¹ • ((4 : ℝ) • h + (2 * inner ℝ x h) • v) + |
| 26 | (-((‖x‖ ^ 2 + 4) ^ 2)⁻¹ * (2 * inner ℝ x h)) • |
| 27 | ((4 : ℝ) • x + (‖x‖ ^ 2 - 4) • v) := by |
| 28 | have hd : ‖x‖ ^ 2 + 4 ≠ 0 := by positivity |
| 29 | have hsq : HasFDerivAt (fun y : EuclideanSpace ℝ (Fin 3) => ‖y‖ ^ 2) |
| 30 | ((2 : ℝ) • innerSL ℝ x) x := by |
| 31 | simpa only [two_smul] using (hasStrictFDerivAt_norm_sq x).hasFDerivAt |
| 32 | have hden := (hasFDerivAt_inv hd).comp x (hsq.add_const 4) |
| 33 | have hnum := ((hasFDerivAt_id x).const_smul (4 : ℝ)).add |
| 34 | ((hsq.sub_const 4).smul_const v) |
| 35 | have heq := congrArg (fun L : EuclideanSpace ℝ (Fin 3) →L[ℝ] |
| 36 | EuclideanSpace ℝ (Fin 3) => L h) (hden.smul hnum).fderiv |
| 37 | change fderiv ℝ (stereoInvFunAux v) x h = |
| 38 | (‖x‖ ^ 2 + 4)⁻¹ • ((4 : ℝ) • h + (2 * inner ℝ x h) • v) + |
| 39 | ((2 * inner ℝ x h) * -((‖x‖ ^ 2 + 4) ^ 2)⁻¹) • |
| 40 | ((4 : ℝ) • x + (‖x‖ ^ 2 - 4) • v) at heq |
| 41 | simpa only [mul_comm] using heq |
| 42 | |
| 43 | private theorem stereoInvFunAux_fderiv_inner |
| 44 | (v x h k : EuclideanSpace ℝ (Fin 3)) |
| 45 | (hv : ‖v‖ = 1) (hx : inner ℝ v x = 0) |
| 46 | (hh : inner ℝ v h = 0) (hk : inner ℝ v k = 0) : |
| 47 | inner ℝ (fderiv ℝ (stereoInvFunAux v) x h) |
| 48 | (fderiv ℝ (stereoInvFunAux v) x k) = |
| 49 | (16 / (‖x‖ ^ 2 + 4) ^ 2) * inner ℝ h k := by |
| 50 | have hd : ‖x‖ ^ 2 + 4 ≠ 0 := by positivity |
| 51 | have hx' : inner ℝ x v = 0 := by rw [real_inner_comm, hx] |
| 52 | have hh' : inner ℝ h v = 0 := by rw [real_inner_comm, hh] |
| 53 | rw [stereoInvFunAux_fderiv_apply, stereoInvFunAux_fderiv_apply] |
| 54 | simp only [inner_add_left, inner_add_right, inner_smul_left, inner_smul_right, |
| 55 | RCLike.conj_to_real, hx, hx', hh', hk, real_inner_self_eq_norm_sq, |
| 56 | hv, one_pow, mul_zero, add_zero, zero_add] |
| 57 | rw [real_inner_comm h x] |
| 58 | field_simp [hd] |
| 59 | ring |
| 60 | |
| 61 | /-- The positive conformal coefficient in every chosen stereographic sphere |
| 62 | chart (Morgan--Tian Proposition 9.79; cylinder-jet bootstrap derivation). -/ |
| 63 | noncomputable def sphereChartConformalFactor (x : EuclideanSpace ℝ (Fin 2)) : ℝ := |
| 64 | 16 / (‖x‖ ^ 2 + 4) ^ 2 |
| 65 | |
| 66 | /-- No chart coordinate makes the literal model sphere coefficient vanish. -/ |
| 67 | theorem sphereChartConformalFactor_pos (x : EuclideanSpace ℝ (Fin 2)) : |
| 68 | 0 < sphereChartConformalFactor x := by |
| 69 | unfold sphereChartConformalFactor |
| 70 | positivity |
| 71 | |
| 72 | /-- The actual sphere inclusion pulled back by its chosen chart has the same |
| 73 | conformal formula at every coordinate, independent of the chart choice. -/ |
| 74 | theorem sphere_chart_inverse_inner_at (q : UnitTwoSphere) |
| 75 | (x v w : EuclideanSpace ℝ (Fin 2)) : |
| 76 | let c := chartAt (EuclideanSpace ℝ (Fin 2)) q |
| 77 | inner ℝ |
| 78 | (mfderiv (𝓡 2) (𝓡 3) (fun y : UnitTwoSphere => y.1) (c.symm x) |
| 79 | (mfderiv (𝓡 2) (𝓡 2) c.symm x v)) |
| 80 | (mfderiv (𝓡 2) (𝓡 3) (fun y : UnitTwoSphere => y.1) (c.symm x) |
| 81 | (mfderiv (𝓡 2) (𝓡 2) c.symm x w)) = |
| 82 | sphereChartConformalFactor x * inner ℝ v w := by |
| 83 | let c := chartAt (EuclideanSpace ℝ (Fin 2)) q |
| 84 | let U := (OrthonormalBasis.fromOrthogonalSpanSingleton (𝕜 := ℝ) 2 |
| 85 | (ne_zero_of_mem_unit_sphere (-q))).repr |
| 86 | let A := (ℝ ∙ (↑(-q) : EuclideanSpace ℝ (Fin 3)))ᗮ.subtypeL.comp |
| 87 | U.symm.toContinuousLinearEquiv.toContinuousLinearMap |
| 88 | have hderiv : HasFDerivAt |
| 89 | (fun y : EuclideanSpace ℝ (Fin 2) => (c.symm y).1) |
| 90 | ((fderiv ℝ (stereoInvFunAux (↑(-q) : EuclideanSpace ℝ (Fin 3))) (A x)).comp A) |
| 91 | x := |
| 92 | ((contDiff_stereoInvFunAux (v := (↑(-q) : EuclideanSpace ℝ (Fin 3))) |
| 93 | (m := ∞)).differentiable (by simp)).differentiableAt.hasFDerivAt.comp x |
| 94 | A.hasFDerivAt |
| 95 | have htarget : x ∈ c.target := by |
| 96 | change x ∈ (stereographic' 2 (-q)).target |
| 97 | rw [stereographic'_target] |
| 98 | exact Set.mem_univ x |
| 99 | have hsymm : MDifferentiableAt (𝓡 2) (𝓡 2) c.symm x := |
| 100 | mdifferentiableAt_atlas_symm (chart_mem_atlas _ q) htarget |
| 101 | have hcoe : MDifferentiableAt (𝓡 2) (𝓡 3) |
| 102 | (fun y : UnitTwoSphere => y.1) (c.symm x) := |
| 103 | (contMDiff_coe_sphere (c.symm x)).mdifferentiableAt one_ne_zero |
| 104 | have hcomp : |
| 105 | (mfderiv (𝓡 2) (𝓡 3) (fun y : UnitTwoSphere => y.1) (c.symm x)).comp |
| 106 | (mfderiv (𝓡 2) (𝓡 2) c.symm x) = |
| 107 | (fderiv ℝ (stereoInvFunAux (↑(-q) : EuclideanSpace ℝ (Fin 3))) (A x)).comp A := by |
| 108 | rw [← mfderiv_comp x hcoe hsymm, mfderiv_eq_fderiv] |
| 109 | exact hderiv.fderiv |
| 110 | change inner ℝ |
| 111 | (((mfderiv (𝓡 2) (𝓡 3) (fun y : UnitTwoSphere => y.1) (c.symm x)).comp |
| 112 | (mfderiv (𝓡 2) (𝓡 2) c.symm x)) v) |
| 113 | (((mfderiv (𝓡 2) (𝓡 3) (fun y : UnitTwoSphere => y.1) (c.symm x)).comp |
| 114 | (mfderiv (𝓡 2) (𝓡 2) c.symm x)) w) = _ |
| 115 | rw [hcomp] |
| 116 | have horth (y : EuclideanSpace ℝ (Fin 2)) : |
| 117 | inner ℝ (↑(-q) : EuclideanSpace ℝ (Fin 3)) (A y) = 0 := by |
| 118 | exact Submodule.mem_orthogonal_singleton_iff_inner_right.mp (U.symm y).2 |
| 119 | have hnorm (y : EuclideanSpace ℝ (Fin 2)) : ‖A y‖ = ‖y‖ := U.symm.norm_map y |
| 120 | have hinner : inner ℝ (A v) (A w) = inner ℝ v w := U.symm.inner_map_map v w |
| 121 | change inner ℝ |
| 122 | (fderiv ℝ (stereoInvFunAux (↑(-q) : EuclideanSpace ℝ (Fin 3))) (A x) (A v)) |
| 123 | (fderiv ℝ (stereoInvFunAux (↑(-q) : EuclideanSpace ℝ (Fin 3))) (A x) (A w)) = _ |
| 124 | simpa only [hnorm, hinner, sphereChartConformalFactor] using |
| 125 | stereoInvFunAux_fderiv_inner (↑(-q)) (A x) (A v) (A w) |
| 126 | (norm_eq_of_mem_sphere (-q)) (horth x) (horth v) (horth w) |
| 127 | |
| 128 | /-- The full frozen Gram function in every chosen sphere chart. This function |
| 129 | identity justifies differentiating it in the literal Christoffel formula. -/ |
| 130 | theorem roundCylinderGram_chosen_chart (u : ℝ) (q : UnitTwoSphere) |
| 131 | (p : RoundCylinderCoordinates) : |
| 132 | roundCylinderGram u (chartAt (EuclideanSpace ℝ (Fin 2)) q) p = |
| 133 | Matrix.diagonal ![2 * (1-u) * sphereChartConformalFactor p.1, |
| 134 | 2 * (1-u) * sphereChartConformalFactor p.1, 1] := by |
| 135 | ext a b |
| 136 | dsimp [roundCylinderGram, roundCylinderTensorCoefficient, EvolvingRoundCylinderMetric] |
| 137 | rw [sphere_chart_inverse_inner_at] |
| 138 | fin_cases a <;> fin_cases b <;> |
| 139 | simp [roundCylinderCoordinateBasis, Matrix.diagonal, EuclideanSpace.inner_single_left] |
| 140 | |
| 141 | end PoincareMT.Proofs.M28.NeckAnalysis |