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.Soliton.TwoDimensional.Compact.Gradient |
| 2 | import PoincareLib.Geometry.Riemannian.ScalarOperators.Extrema |
| 3 | |
| 4 | /-! |
| 5 | # Extrema of a shrinking surface potential |
| 6 | |
| 7 | Tracing the surface soliton equation locates the scalar curvature at potential |
| 8 | extrema on opposite sides of twice the shrinking scale. These are the endpoint |
| 9 | signs in the compact-surface rigidity argument of Chow--Knopf, Proposition 5.21, |
| 10 | p. 118. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | namespace PoincareMT.LeviCivitaData |
| 20 | |
| 21 | variable {M : Type*} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 23 | {g : RiemannianMetric 2 M} |
| 24 | |
| 25 | /-- The trace of the surface soliton equation at arbitrary shrinking scale. -/ |
| 26 | theorem scalar_add_laplacian_of_surface_soliton (D : LeviCivitaData g) |
| 27 | {f : M → ℝ} {lambda : ℝ} |
| 28 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 29 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) |
| 30 | (x : M) : D.scalarCurvature x + D.laplacian f x = 2 * lambda := by |
| 31 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 2) : M → Type _) := |
| 32 | ⟨g.toRiemannianMetric⟩ |
| 33 | have hd : Module.finrank ℝ (TangentSpace (𝓡 2) x) = 2 := by |
| 34 | rw [VectorBundle.finrank_eq ℝ (EuclideanSpace ℝ (Fin 2)), finrank_euclideanSpace] |
| 35 | simp |
| 36 | unfold scalarCurvature laplacian |
| 37 | rw [← Finset.sum_add_distrib] |
| 38 | simp_rw [hsol] |
| 39 | have hnorm (i) : g.inner x (g.orthonormalBasis x i) (g.orthonormalBasis x i) = 1 := |
| 40 | (g.orthonormalBasis x).inner_eq_ite i i |>.trans (if_pos rfl) |
| 41 | simp only [hnorm, mul_one, Finset.sum_const, Finset.card_univ, Fintype.card_fin, |
| 42 | hd, nsmul_eq_mul, Nat.cast_ofNat] |
| 43 | |
| 44 | theorem scalar_le_twice_scale_of_potential_min (D : LeviCivitaData g) |
| 45 | {f : M → ℝ} {lambda : ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ f) |
| 46 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 47 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) |
| 48 | {p : M} (hp : IsLocalMin f p) : D.scalarCurvature p ≤ 2 * lambda := by |
| 49 | have htrace := D.scalar_add_laplacian_of_surface_soliton hsol p |
| 50 | have hsign := D.laplacian_nonneg_of_isLocalMin hf hp |
| 51 | linarith |
| 52 | |
| 53 | theorem twice_scale_le_scalar_of_potential_max (D : LeviCivitaData g) |
| 54 | {f : M → ℝ} {lambda : ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ f) |
| 55 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 56 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) |
| 57 | {p : M} (hp : IsLocalMax f p) : 2 * lambda ≤ D.scalarCurvature p := by |
| 58 | have htrace := D.scalar_add_laplacian_of_surface_soliton hsol p |
| 59 | have hsign := D.laplacian_nonpos_of_isLocalMax hf hp |
| 60 | linarith |
| 61 | |
| 62 | theorem gradient_eq_zero_of_potential_max (D : LeviCivitaData g) |
| 63 | {f : M → ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ f) |
| 64 | {p : M} (hp : IsLocalMax f p) : D.gradient f p = 0 := by |
| 65 | apply (g.inner_isInvertible p).injective |
| 66 | apply ContinuousLinearMap.ext |
| 67 | intro v |
| 68 | rw [D.inner_gradient, mvfderiv_eq_zero_of_isLocalMax hf hp] |
| 69 | simp |
| 70 | |
| 71 | theorem gradient_eq_zero_of_potential_min (D : LeviCivitaData g) |
| 72 | {f : M → ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ f) |
| 73 | {p : M} (hp : IsLocalMin f p) : D.gradient f p = 0 := by |
| 74 | have hz := mvfderiv_eq_zero_of_isLocalMax hf.neg hp.neg |
| 75 | have hd : mvfderiv (𝓡 2) f p = 0 := by |
| 76 | have heq : (fun x => -f x) = -f := rfl |
| 77 | rw [heq, mvfderiv_neg] at hz |
| 78 | exact neg_eq_zero.mp hz |
| 79 | apply (g.inner_isInvertible p).injective |
| 80 | apply ContinuousLinearMap.ext |
| 81 | intro v |
| 82 | rw [D.inner_gradient, hd] |
| 83 | simp |
| 84 | |
| 85 | end PoincareMT.LeviCivitaData |