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.StereographicCalculus |
| 2 | import PoincareLib.Geometry.Riemannian.Curvature.Euclidean |
| 3 | |
| 4 | /-! |
| 5 | # The actual stereographic cylinder connection |
| 6 | |
| 7 | Constant-frame Koszul identifies every retained compatible connection |
| 8 | with the two horizontal conformal matrices. Those matrices commute, so |
| 9 | the quadratic curvature terms cancel. This is Morgan-Tian Proposition |
| 10 | 12.7, pp. 298-299 and stereographic-cylinder-euclidean.md. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open scoped Manifold ContDiff |
| 17 | |
| 18 | namespace PoincareMT.M34 |
| 19 | |
| 20 | local notation "E3" => EuclideanSpace ℝ (Fin 3) |
| 21 | |
| 22 | /-- The two-dimensional conformal Christoffel vector, with zero axial |
| 23 | component; the first vector is the direction, the second the section |
| 24 | value (Proposition 12.7, pp. 298-299). -/ |
| 25 | noncomputable def stereographicCylinderChristoffel (x u v : E3) : E3 := |
| 26 | WithLp.toLp 2 |
| 27 | ![stereographicCylinderLogDerivative 0 x * (u 0 * v 0 - u 1 * v 1) + |
| 28 | stereographicCylinderLogDerivative 1 x * (u 1 * v 0 + u 0 * v 1), |
| 29 | stereographicCylinderLogDerivative 1 x * (u 1 * v 1 - u 0 * v 0) + |
| 30 | stereographicCylinderLogDerivative 0 x * (u 0 * v 1 + u 1 * v 0), 0] |
| 31 | |
| 32 | /-- The explicit coefficients satisfy the actual constant-frame Koszul |
| 33 | identity at every spatial point (Proposition 12.7, pp. 298-299). -/ |
| 34 | theorem stereographicCylinderChristoffel_koszul (b : ℝ) (x u v w : E3) : |
| 35 | 2 * stereographicCylinderCoefficients b x (stereographicCylinderChristoffel x u v) w = |
| 36 | fderiv ℝ (fun y => stereographicCylinderCoefficients b y v w) x u + |
| 37 | fderiv ℝ (fun y => stereographicCylinderCoefficients b y w u) x v - |
| 38 | fderiv ℝ (fun y => stereographicCylinderCoefficients b y u v) x w := by |
| 39 | rw [stereographicCylinderCoefficients_fderiv, stereographicCylinderCoefficients_fderiv, |
| 40 | stereographicCylinderCoefficients_fderiv, stereographicCylinderCoefficients_apply] |
| 41 | simp [stereographicCylinderChristoffel] |
| 42 | ring |
| 43 | |
| 44 | /-- The two horizontal connection matrices commute; every quadratic |
| 45 | connection term therefore cancels in curvature |
| 46 | (Proposition 12.7, pp. 298-299). -/ |
| 47 | theorem stereographicCylinderChristoffel_comp_comm (x u v w : E3) : |
| 48 | stereographicCylinderChristoffel x u (stereographicCylinderChristoffel x v w) = |
| 49 | stereographicCylinderChristoffel x v (stereographicCylinderChristoffel x u w) := by |
| 50 | ext i |
| 51 | fin_cases i <;> simp [stereographicCylinderChristoffel] <;> ring |
| 52 | |
| 53 | /-- Every actual compatible connection has precisely the computed |
| 54 | Christoffel vector (Proposition 12.7, pp. 298-299). -/ |
| 55 | theorem stereographicCylinderConnection_formula {b : ℝ} (hb : 0 < b) |
| 56 | (D : LeviCivitaData (stereographicCylinderMetric b hb)) (x u v : E3) : |
| 57 | D.connection (fun _ => v) x u = stereographicCylinderChristoffel x u v := by |
| 58 | apply ((stereographicCylinderMetric b hb).inner_isInvertible x).injective |
| 59 | ext w |
| 60 | have hk := D.inner_connection_const x u v w |
| 61 | change 2 * stereographicCylinderCoefficients b x (D.connection (fun _ => v) x u) w = |
| 62 | fderiv ℝ (fun y => stereographicCylinderCoefficients b y v w) x u + |
| 63 | fderiv ℝ (fun y => stereographicCylinderCoefficients b y w u) x v - |
| 64 | fderiv ℝ (fun y => stereographicCylinderCoefficients b y u v) x w at hk |
| 65 | have he := stereographicCylinderChristoffel_koszul b x u v w |
| 66 | change stereographicCylinderCoefficients b x (D.connection (fun _ => v) x u) w = |
| 67 | stereographicCylinderCoefficients b x (stereographicCylinderChristoffel x u v) w |
| 68 | linarith only [hk, he] |
| 69 | |
| 70 | /-- Whole-function equality permits differentiation of the actual |
| 71 | retained connection field (Proposition 12.7, pp. 298-299). -/ |
| 72 | theorem stereographicCylinderEuclideanConnection_eq {b : ℝ} (hb : 0 < b) |
| 73 | (D : LeviCivitaData (stereographicCylinderMetric b hb)) (u v : E3) : |
| 74 | D.euclideanConnection u v = fun x => stereographicCylinderChristoffel x u v := |
| 75 | funext (fun x => stereographicCylinderConnection_formula hb D x u v) |
| 76 | |
| 77 | end PoincareMT.M34 |