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.Area.FixedMap.RicciQuadratic |
| 2 | import PoincareLib.Geometry.RicciFlow.Area.FixedMap.GramDerivative |
| 3 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Gram.TraceBound |
| 4 | |
| 5 | /-! |
| 6 | # Pointwise Ricci-trace bound |
| 7 | |
| 8 | Morgan-Tian Claim 18.13, printed p. 427. The actual squared Ricci norm |
| 9 | bounds its quadratic evaluations. The inverse-Gram contraction on a |
| 10 | two-plane is bounded by twice this norm bound; the frozen coarse bound |
| 11 | four is consequently valid. The rank-deficient density is handled by |
| 12 | its defining zero branch. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle BigOperators |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | {g : RiemannianMetric n M} |
| 27 | |
| 28 | /-- The actual Ricci-trace area density has a pointwise relative bound. |
| 29 | Source: MT Claim 18.13, p. 427, corrected variation derivation. -/ |
| 30 | theorem m60SphereRicciTraceDensity_bound (D : LeviCivitaData g) |
| 31 | (hD : D.CurvatureTensorCalculus) {C : ℝ} (hC : 0 ≤ C) |
| 32 | (hnorm : ∀ x : M, D.ricciNormSq x ≤ C ^ 2) |
| 33 | (f : UnitTwoSphere → M) (z : LoopPlane) : |
| 34 | |m60SphereRicciTraceDensity D f z| ≤ 4 * C * m60SphereAreaDensity g f z := by |
| 35 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 36 | ⟨g.toRiemannianMetric⟩ |
| 37 | let x := (f ∘ m60SphereParameter) z |
| 38 | let v := fun i : Fin 2 => mfderiv (𝓡 2) (𝓡 n) (f ∘ m60SphereParameter) z |
| 39 | (EuclideanSpace.basisFun (Fin 2) ℝ i) |
| 40 | have harea : 0 ≤ m60SphereAreaDensity g f z := |
| 41 | m60AreaDensity_nonneg g (f ∘ m60SphereParameter) z |
| 42 | by_cases hdeg : Matrix.det (m60AreaGram g (f ∘ m60SphereParameter) z) = 0 |
| 43 | · rw [m60SphereRicciTraceDensity_eq_zero D f z hdeg, abs_zero] |
| 44 | positivity |
| 45 | have hpos : 0 < Matrix.det (Matrix.gram ℝ v) := |
| 46 | lt_of_le_of_ne (m60AreaGram_det_nonneg g (f ∘ m60SphereParameter) z) (Ne.symm hdeg) |
| 47 | obtain ⟨B, hB⟩ := m60Ricci_exists_bilinear D hD x |
| 48 | have hbound (w : TangentSpace (𝓡 n) x) : |B w w| ≤ C * inner ℝ w w := by |
| 49 | rw [hB] |
| 50 | exact m60Ricci_quadratic_bound D hD x hC (hnorm x) w |
| 51 | have htrace : |∑ i : Fin 2, ∑ j : Fin 2, |
| 52 | ((m60AreaGram g (f ∘ m60SphereParameter) z)⁻¹) i j * D.ricci x (v j) (v i)| ≤ 2 * C := by |
| 53 | have h := M60.abs_inverse_gram_contraction_le v B hbound hpos |
| 54 | change |∑ i : Fin 2, ∑ j : Fin 2, |
| 55 | ((m60AreaGram g (f ∘ m60SphereParameter) z)⁻¹) i j * B (v j) (v i)| ≤ 2 * C at h |
| 56 | simp_rw [hB] at h |
| 57 | exact h |
| 58 | change 0 ≤ m60AreaDensity g (f ∘ m60SphereParameter) z at harea |
| 59 | unfold m60SphereRicciTraceDensity |
| 60 | rw [if_neg hdeg, abs_mul, abs_of_nonneg harea] |
| 61 | exact (mul_le_mul_of_nonneg_right htrace harea).trans |
| 62 | (mul_le_mul_of_nonneg_right (by linarith : 2 * C ≤ 4 * C) harea) |
| 63 | |
| 64 | end PoincareMT |