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.Riemannian.Comparison.Volume.Polar.Coverage |
| 2 | import PoincareLib.Geometry.Riemannian.Comparison.Volume.Polar.NullImage |
| 3 | import PoincareLib.Geometry.Riemannian.Comparison.Laplacian.Branch.Complete |
| 4 | import PoincareLib.Geometry.Riemannian.Measure.LocalFinite |
| 5 | import Mathlib.MeasureTheory.Integral.Indicator |
| 6 | |
| 7 | /-! |
| 8 | # Sphere nullity and continuity of intrinsic ball volumes |
| 9 | |
| 10 | The minimizing exponential parameters of an intrinsic sphere lie on a |
| 11 | Euclidean sphere. Differentiable maps preserve nullity, so positive-radius |
| 12 | intrinsic spheres have zero volume. This gives continuity in radius on complete |
| 13 | manifolds, including disconnected manifolds and dimension zero. |
| 14 | |
| 15 | These are intermediate lemmas for ball-volume convergence in Kleiner--Lott, |
| 16 | Corollary 44.1, pp. 2682--2683, with pointed convergence as in Appendix E, |
| 17 | pp. 2848--2849. |
| 18 | -/ |
| 19 | |
| 20 | noncomputable section |
| 21 | set_option autoImplicit false |
| 22 | set_option backward.isDefEq.respectTransparency false |
| 23 | |
| 24 | open Set Filter MeasureTheory |
| 25 | open scoped Manifold ContDiff Topology Bundle ENNReal |
| 26 | |
| 27 | namespace PoincareMT.RiemannianMetric |
| 28 | |
| 29 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 30 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 32 | |
| 33 | /-- A positive-radius intrinsic sphere is null whenever it lies inside a |
| 34 | larger precompact ball. -/ |
| 35 | theorem volumeMeasure_sphere_eq_zero_of_precompact_ball |
| 36 | (g : RiemannianMetric n M) (p : M) {r R : ℝ} (hr : 0 < r) (hrR : r < R) |
| 37 | (hcompact : IsCompact (closure (g.ball p R))) : |
| 38 | g.volumeMeasure {q | g.edist p q = ENNReal.ofReal r} = 0 := by |
| 39 | have hR : 0 < R := hr.trans hrR |
| 40 | obtain ⟨L, e, hL, he, he0, hed, hgeo⟩ := |
| 41 | g.exists_orthonormal_radial_exponential_of_precompact_ball p hR hcompact |
| 42 | have hcover := Poincare.VolumeComparison.image_localMinimizingSet_eq_ball |
| 43 | g p hR hcompact L e hL he0 hed (fun v hv => (hgeo v hv).1) |
| 44 | have hsub : {q | g.edist p q = ENNReal.ofReal r} ⊆ |
| 45 | e '' Metric.sphere (0 : EuclideanSpace ℝ (Fin n)) r := by |
| 46 | intro q hq |
| 47 | have hqR : q ∈ g.ball p R := by |
| 48 | change g.edist p q < ENNReal.ofReal R |
| 49 | rw [hq] |
| 50 | exact (ENNReal.ofReal_lt_ofReal_iff hR).mpr hrR |
| 51 | rw [← hcover] at hqR |
| 52 | obtain ⟨v, hv, rfl⟩ := hqR |
| 53 | refine ⟨v, ?_, rfl⟩ |
| 54 | rw [Metric.mem_sphere, dist_zero_right] |
| 55 | exact (ENNReal.ofReal_eq_ofReal_iff (norm_nonneg v) hr.le).mp (hv.2.symm.trans hq) |
| 56 | apply measure_mono_null hsub |
| 57 | apply g.volumeMeasure_image_eq_zero_of_mdifferentiableAt |
| 58 | · intro v hv |
| 59 | apply (he.contMDiffAt (Metric.isOpen_ball.mem_nhds ?_)).mdifferentiableAt |
| 60 | (by simp) |
| 61 | rw [Metric.mem_ball, dist_zero_right] |
| 62 | have hv' : ‖v‖ = r := by simpa only [Metric.mem_sphere, dist_zero_right] using hv |
| 63 | rwa [hv'] |
| 64 | · exact Measure.addHaar_sphere_of_ne_zero volume 0 hr.ne' |
| 65 | |
| 66 | /-- Every positive-radius sphere has zero volume in a complete metric. -/ |
| 67 | theorem volumeMeasure_sphere_eq_zero_of_metricComplete |
| 68 | (g : RiemannianMetric n M) (hcomplete : MetricComplete g) (p : M) |
| 69 | {r : ℝ} (hr : 0 < r) : |
| 70 | g.volumeMeasure {q | g.edist p q = ENNReal.ofReal r} = 0 := |
| 71 | g.volumeMeasure_sphere_eq_zero_of_precompact_ball p hr (lt_add_one r) |
| 72 | (g.isCompact_closure_ball_of_metricComplete hcomplete p (r + 1)) |
| 73 | |
| 74 | /-- Intrinsic ball volume is continuous in every positive radius for a |
| 75 | complete Riemannian metric. -/ |
| 76 | theorem continuousAt_ball_volume_of_metricComplete |
| 77 | (g : RiemannianMetric n M) (hcomplete : MetricComplete g) (p : M) |
| 78 | {r : ℝ} (hr : 0 < r) : |
| 79 | ContinuousAt (fun s : ℝ => g.volumeMeasure (g.ball p s)) r := by |
| 80 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 81 | ⟨g.toRiemannianMetric⟩ |
| 82 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 83 | (TangentSpace (𝓡 n) : M → Type _) := |
| 84 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ => rfl⟩⟩ |
| 85 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 86 | have hball (s : ℝ) : MeasurableSet (g.ball p s) := |
| 87 | (isOpen_lt (continuous_const.edist continuous_id) continuous_const).measurableSet |
| 88 | have hfinite : g.volumeMeasure (g.ball p (r + 1)) ≠ ⊤ := |
| 89 | (lt_of_le_of_lt (measure_mono (subset_closure : g.ball p (r + 1) ⊆ _)) |
| 90 | (g.volumeMeasure_lt_top_of_isCompact |
| 91 | (g.isCompact_closure_ball_of_metricComplete hcomplete p (r + 1)))).ne |
| 92 | apply tendsto_measure_of_ae_tendsto_indicator (𝓝 r) (hball r) hball |
| 93 | (hball (r + 1)) hfinite |
| 94 | · filter_upwards [eventually_lt_nhds (lt_add_one r)] with s hs q hq |
| 95 | exact lt_of_lt_of_le hq (ENNReal.ofReal_le_ofReal hs.le) |
| 96 | · have hae : ∀ᵐ q ∂g.volumeMeasure, g.edist p q ≠ ENNReal.ofReal r := by |
| 97 | simpa only [ae_iff, not_not] using |
| 98 | g.volumeMeasure_sphere_eq_zero_of_metricComplete hcomplete p hr |
| 99 | filter_upwards [hae] with q hq |
| 100 | rcases lt_or_gt_of_ne hq with hlt | hgt |
| 101 | · filter_upwards [(ENNReal.continuous_ofReal.tendsto r).eventually_const_lt hlt] |
| 102 | with s hs |
| 103 | exact iff_of_true hs hlt |
| 104 | · filter_upwards [(ENNReal.continuous_ofReal.tendsto r).eventually_lt_const hgt] |
| 105 | with s hs |
| 106 | exact iff_of_false (not_lt_of_ge hs.le) (not_lt_of_ge hgt.le) |
| 107 | |
| 108 | /-- The real-valued volume convention is also continuous in positive radius. -/ |
| 109 | theorem continuousAt_ball_volume_toReal_of_metricComplete |
| 110 | (g : RiemannianMetric n M) (hcomplete : MetricComplete g) (p : M) |
| 111 | {r : ℝ} (hr : 0 < r) : |
| 112 | ContinuousAt (fun s : ℝ => (g.volumeMeasure (g.ball p s)).toReal) r := by |
| 113 | apply (ENNReal.continuousAt_toReal ?_).comp |
| 114 | (g.continuousAt_ball_volume_of_metricComplete hcomplete p hr) |
| 115 | exact (lt_of_le_of_lt (measure_mono (subset_closure : g.ball p r ⊆ _)) |
| 116 | (g.volumeMeasure_lt_top_of_isCompact |
| 117 | (g.isCompact_closure_ball_of_metricComplete hcomplete p r))).ne |
| 118 | |
| 119 | end PoincareMT.RiemannianMetric |