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.MinimalSphere.Round.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Area.MinimalSphere.Stereographic.Integral |
| 3 | import PoincareLib.Geometry.Riemannian.Measure.Green.ChangeOfVariables |
| 4 | |
| 5 | /-! |
| 6 | # Round sphere volume in the fixed stereographic coordinates |
| 7 | |
| 8 | Morgan-Tian Claim 18.12, printed pp. 426-427. The actual Riemannian |
| 9 | volume is the normalized Hausdorff measure, transported by M07's |
| 10 | coordinate formula. The omitted pole is null and the total volume is 4*pi. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set MeasureTheory |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | /-- The round metric's pullback volume is precisely the frozen chart |
| 22 | factor. Source: MT Claim 18.12, pp. 426-427. -/ |
| 23 | theorem m60RoundSphereMetric_pullbackVolumeDensity (z : LoopPlane) : |
| 24 | m60RoundSphereMetric.pullbackVolumeDensity m60SphereParameter z = |
| 25 | 16 / (‖z‖ ^ 2 + 4) ^ 2 := by |
| 26 | unfold RiemannianMetric.pullbackVolumeDensity |
| 27 | have hgram : (Matrix.of (fun i j : Fin 2 => |
| 28 | m60RoundSphereMetric.inner (m60SphereParameter z) |
| 29 | (mfderiv (𝓡 2) (𝓡 2) m60SphereParameter z (EuclideanSpace.basisFun (Fin 2) ℝ i)) |
| 30 | (mfderiv (𝓡 2) (𝓡 2) m60SphereParameter z (EuclideanSpace.basisFun (Fin 2) ℝ j)))) = |
| 31 | Matrix.diagonal (fun _ : Fin 2 => 16 / (‖z‖ ^ 2 + 4) ^ 2) := by |
| 32 | ext i j |
| 33 | simp only [Matrix.of_apply, m60RoundSphereMetric_inner, m60SphereParameter_inner, |
| 34 | Matrix.diagonal_apply] |
| 35 | fin_cases i <;> fin_cases j <;> |
| 36 | simp [EuclideanSpace.basisFun, EuclideanSpace.inner_single_left] |
| 37 | rw [hgram, Matrix.det_diagonal, Fin.prod_univ_two, Real.sqrt_mul_self (by positivity)] |
| 38 | |
| 39 | /-- Every singleton is null for the actual round Riemannian volume. |
| 40 | Source: MT Claim 18.12, pp. 426-427, omitted-pole and finite-branch argument. -/ |
| 41 | theorem m60RoundSphereMetric_volume_singleton (p : UnitTwoSphere) : |
| 42 | m60RoundSphereMetric.volumeMeasure {p} = 0 := by |
| 43 | let g := m60RoundSphereMetric |
| 44 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 2) : UnitTwoSphere → Type) := |
| 45 | ⟨g.toRiemannianMetric⟩ |
| 46 | let : IsContinuousRiemannianBundle LoopPlane |
| 47 | (TangentSpace (𝓡 2) : UnitTwoSphere → Type) := |
| 48 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 49 | let : EMetricSpace UnitTwoSphere := EMetricSpace.ofRiemannianMetric (𝓡 2) UnitTwoSphere |
| 50 | let : NullSingletonClass (Measure.hausdorffMeasure (2 : ℝ) : Measure UnitTwoSphere) := |
| 51 | Measure.nullSingletonClass_hausdorff UnitTwoSphere (by norm_num) |
| 52 | change (Measure.euclideanHausdorffMeasure 2 : Measure UnitTwoSphere) {p} = 0 |
| 53 | rw [Measure.euclideanHausdorffMeasure_def] |
| 54 | simp |
| 55 | |
| 56 | /-- A continuous function integrates in the fixed chart with its exact |
| 57 | round factor. Source: MT Claim 18.12, pp. 426-427. -/ |
| 58 | theorem m60RoundSphereMetric_integral (φ : UnitTwoSphere → ℝ) (hφ : Continuous φ) : |
| 59 | (∫ p, φ p ∂m60RoundSphereMetric.volumeMeasure) = |
| 60 | ∫ z : LoopPlane, φ (m60SphereParameter z) * (16 / (‖z‖ ^ 2 + 4) ^ 2) := by |
| 61 | have ht : m60SphereChart.target = univ := by simp [m60SphereChart] |
| 62 | have hs : m60SphereChart.source = {m60SpherePole}ᶜ := by simp [m60SphereChart] |
| 63 | have hnull : m60RoundSphereMetric.volumeMeasure (m60SphereChart.source)ᶜ = 0 := by |
| 64 | rw [hs, compl_compl] |
| 65 | exact m60RoundSphereMetric_volume_singleton _ |
| 66 | have hi := m60RoundSphereMetric.integral_target_eq_integral_pullback_density |
| 67 | m60SphereChart.symm |
| 68 | (by rw [m60SphereChart_eq_chartAt]; exact contMDiffOn_chart_symm) |
| 69 | (by rw [m60SphereChart_eq_chartAt]; exact contMDiffOn_chart) |
| 70 | (hφ.continuousOn) |
| 71 | change (∫ p in m60SphereChart.source, φ p ∂m60RoundSphereMetric.volumeMeasure) = |
| 72 | ∫ z in m60SphereChart.target, φ (m60SphereParameter z) * |
| 73 | m60RoundSphereMetric.pullbackVolumeDensity m60SphereParameter z at hi |
| 74 | have hae : ∀ᵐ p ∂m60RoundSphereMetric.volumeMeasure, p ∈ m60SphereChart.source := by |
| 75 | rw [ae_iff] |
| 76 | exact hnull |
| 77 | rw [← integral_eq_setIntegral hae φ, ht, |
| 78 | setIntegral_univ] at hi |
| 79 | simpa only [m60RoundSphereMetric_pullbackVolumeDensity] using hi |
| 80 | |
| 81 | /-- The actual round sphere has total volume 4*pi. |
| 82 | Source: MT Claim 18.12, pp. 426-427. -/ |
| 83 | theorem m60RoundSphereMetric_volume_univ : |
| 84 | m60RoundSphereMetric.volumeMeasure.real univ = 4 * Real.pi := by |
| 85 | have h := m60RoundSphereMetric_integral (fun _ => 1) continuous_const |
| 86 | simpa only [integral_const, smul_eq_mul, mul_one, one_mul, |
| 87 | m60SphereParameter_factor_integral] using h |
| 88 | |
| 89 | end PoincareMT |