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.Rigidity.CriticalLevel |
| 2 | import PoincareLib.Geometry.RicciFlow.Soliton.TwoDimensional.Compact.Rigidity.TotalCurvature |
| 3 | import PoincareLib.Geometry.Riemannian.Surface.SublevelVolume |
| 4 | |
| 5 | /-! |
| 6 | # Compact shrinking surfaces have constant positive curvature |
| 7 | |
| 8 | The conserved soliton quantities force a strict scalar-curvature inequality |
| 9 | between distinct critical values. Coarea makes the potential-volume density |
| 10 | constant, while the local volume asymptotic at the unique minimum fixes its |
| 11 | normalization. The resulting total scalar curvature would exceed the |
| 12 | Gauss--Bonnet upper bound unless the potential is constant. |
| 13 | |
| 14 | This proves the compact rigidity used in Morgan--Tian, Corollary 9.50, |
| 15 | pp. 213-214, from the actual surface soliton equation. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set MeasureTheory Filter |
| 22 | open scoped Manifold ContDiff Topology |
| 23 | |
| 24 | namespace PoincareMT.LeviCivitaData |
| 25 | |
| 26 | variable {M : Type*} [TopologicalSpace M] [T3Space M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 28 | [CompactSpace M] [ConnectedSpace M] {g : RiemannianMetric 2 M} |
| 29 | |
| 30 | /-- A compact connected nonnegatively curved gradient shrinking surface has |
| 31 | constant positive sectional curvature. The potential need only be C2. -/ |
| 32 | theorem constantPositiveSectionalCurvature_of_compact_surface_soliton |
| 33 | (D : LeviCivitaData g) {f : M → ℝ} {lambda : ℝ} (hlambda : 0 < lambda) |
| 34 | (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) 2 f) |
| 35 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 36 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) |
| 37 | (hRnonneg : ∀ x, 0 ≤ D.scalarCurvature x) : |
| 38 | ConstantPositiveSectionalCurvature g D := by |
| 39 | let : MeasurableSpace M := borel M |
| 40 | let : BorelSpace M := ⟨rfl⟩ |
| 41 | by_contra hnot |
| 42 | have hfs := D.contMDiff_of_C2_surface_soliton hf hsol |
| 43 | obtain ⟨p, z, hbounds, hp, hz, hpz, hRp, hRz, hsum⟩ := |
| 44 | D.exists_strict_extrema_of_compact_not_round hlambda hf hsol hnot |
| 45 | have hc : MetricComplete g := by |
| 46 | unfold MetricComplete |
| 47 | infer_instance |
| 48 | have huniq (x : M) (hx : f x = f p) : x = p := |
| 49 | (D.eq_of_potential_eq_at_critical_point_of_not_round hc hlambda hf hsol hnot hp hx.symm).symm |
| 50 | let a : ℝ := lambda - D.scalarCurvature p / 2 |
| 51 | have ha : 0 < a := by dsimp [a]; linarith |
| 52 | have hhess (v w : TangentSpace (𝓡 2) p) : |
| 53 | D.hessian f p v w = a * g.inner p v w := by |
| 54 | rw [D.hessian_eq_of_surface_soliton hsol] |
| 55 | dsimp [a] |
| 56 | ring |
| 57 | have hlimit := D.tendsto_sublevelVolume_div_sub_min hfs (fun x => (hbounds x).1) |
| 58 | huniq hp ha hhess |
| 59 | obtain ⟨c, hcpos, hslab⟩ := |
| 60 | D.exists_constant_slab_density_of_surface_soliton hlambda hf hsol hRnonneg hp hpz |
| 61 | have hconst : (fun t : ℝ => (g.volumeMeasure (f ⁻¹' Ioo (f p) t)).toReal / (t - f p)) |
| 62 | =ᶠ[𝓝[>] f p] fun _ => c := by |
| 63 | filter_upwards [self_mem_nhdsWithin, |
| 64 | mem_nhdsWithin_of_mem_nhds (gt_mem_nhds hpz)] with t ht htz |
| 65 | change g.volumeMeasure.real (f ⁻¹' Ioo (f p) t) / (t - f p) = c |
| 66 | rw [g.volume_open_slab_eq_of_constant_slab_density hslab ht htz.le, |
| 67 | mul_div_cancel_right₀ _ (sub_pos.mpr ht).ne'] |
| 68 | have hcvalue : c = 2 * Real.pi / a := |
| 69 | tendsto_nhds_unique (tendsto_const_nhds.congr' hconst.symm) hlimit |
| 70 | have htotal := D.density_mul_scalar_difference_le_eight_pi hf hsol hRnonneg hpz hslab |
| 71 | rw [hcvalue, div_mul_eq_mul_div, div_le_iff₀ ha] at htotal |
| 72 | have hstrict : 4 * a < D.scalarCurvature z - D.scalarCurvature p := by |
| 73 | dsimp [a] |
| 74 | linarith |
| 75 | have hpi := Real.pi_pos |
| 76 | nlinarith |
| 77 | |
| 78 | end PoincareMT.LeviCivitaData |