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.Compactness.Convergence.Volume.PathComparison |
| 2 | import PoincareLib.Geometry.Riemannian.Measure.Basic |
| 3 | import PoincareLib.Geometry.Riemannian.Measure.HausdorffDensity.MeasureComparison |
| 4 | |
| 5 | /-! |
| 6 | # Volume comparison for smooth local embeddings |
| 7 | |
| 8 | A tangent norm bound gives a local Lipschitz bound for the intrinsic distances. |
| 9 | The corresponding Hausdorff measure inequality then assembles to a volume |
| 10 | comparison on the source of a smooth open partial homeomorphism. |
| 11 | |
| 12 | This is the volume comparison used in Kleiner--Lott, Appendix E, |
| 13 | pp. 2848--2849, and Corollary 44.1, pp. 2682--2683. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set MeasureTheory Filter |
| 20 | open scoped Manifold ContDiff Bundle ENNReal NNReal Topology |
| 21 | |
| 22 | namespace PoincareMT.RiemannianMetric |
| 23 | |
| 24 | variable {n : ℕ} {M N : Type*} [TopologicalSpace M] [TopologicalSpace N] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] [IsManifold (𝓡 n) ∞ N] |
| 27 | |
| 28 | /-- A derivative bound on a larger intrinsic ball controls image distances |
| 29 | between points of the smaller ball. -/ |
| 30 | private theorem edist_image_le_mul_edist_of_tangentNorm_le_on_ball |
| 31 | (g : RiemannianMetric n M) (h : RiemannianMetric n N) |
| 32 | {f : M → N} {p : M} {r C : ℝ} (hr : 0 < r) (hC : 0 < C) |
| 33 | (hf : ∀ z ∈ g.ball p (3 * r), ContMDiffAt (𝓡 n) (𝓡 n) 1 f z) |
| 34 | (hbound : ∀ z ∈ g.ball p (3 * r), ∀ v : TangentSpace (𝓡 n) z, |
| 35 | h.tangentNorm (f z) (mfderiv (𝓡 n) (𝓡 n) f z v) ≤ |
| 36 | C * g.tangentNorm z v) |
| 37 | {x y : M} (hx : x ∈ g.ball p r) (hy : y ∈ g.ball p r) : |
| 38 | h.edist (f x) (f y) ≤ ENNReal.ofReal C * g.edist x y := by |
| 39 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 40 | ⟨g.toRiemannianMetric⟩ |
| 41 | have hxy : g.edist x y < ENNReal.ofReal (2 * r) := by |
| 42 | calc |
| 43 | g.edist x y ≤ g.edist x p + g.edist p y := Manifold.riemannianEDist_triangle |
| 44 | _ < ENNReal.ofReal r + ENNReal.ofReal r := |
| 45 | ENNReal.add_lt_add (by simpa [ball, edist, Manifold.riemannianEDist_comm] using hx) hy |
| 46 | _ = ENNReal.ofReal (2 * r) := by rw [← ENNReal.ofReal_add hr.le hr.le]; congr 1; ring |
| 47 | have hdiv : h.edist (f x) (f y) / ENNReal.ofReal C ≤ g.edist x y := by |
| 48 | apply le_of_forall_gt_imp_ge_of_dense |
| 49 | intro b hb |
| 50 | obtain ⟨γ, hγ0, hγ1, hγsmooth, hγlength, _⟩ := |
| 51 | Manifold.exists_lt_locally_constant_of_riemannianEDist_lt (lt_min hb hxy) zero_lt_one |
| 52 | have hγball : ∀ u ∈ Icc (0 : ℝ) 1, γ u ∈ g.ball p (3 * r) := by |
| 53 | intro u hu |
| 54 | have hxu : g.edist x (γ u) < ENNReal.ofReal (2 * r) := by |
| 55 | exact ((Manifold.riemannianEDist_le_pathELength |
| 56 | hγsmooth.contMDiffOn hγ0 rfl hu.1).trans |
| 57 | (Manifold.pathELength_mono le_rfl hu.2)).trans_lt |
| 58 | (hγlength.trans_le (min_le_right _ _)) |
| 59 | calc |
| 60 | g.edist p (γ u) ≤ g.edist p x + g.edist x (γ u) := |
| 61 | Manifold.riemannianEDist_triangle |
| 62 | _ < ENNReal.ofReal r + ENNReal.ofReal (2 * r) := ENNReal.add_lt_add hx hxu |
| 63 | _ = ENNReal.ofReal (3 * r) := by |
| 64 | rw [← ENNReal.ofReal_add hr.le (by positivity : 0 ≤ 2 * r)]; congr 1; ring |
| 65 | have hlength := g.pathELength_comp_le_of_tangentNorm_le_on_Icc h hC.le hγsmooth |
| 66 | (fun u hu ↦ hf (γ u) (hγball u hu)) |
| 67 | (fun u hu ↦ hbound (γ u) (hγball u hu)) |
| 68 | have hdist : h.edist (f x) (f y) ≤ h.pathELength (f ∘ γ) 0 1 := by |
| 69 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : N → Type _) := |
| 70 | ⟨h.toRiemannianMetric⟩ |
| 71 | apply Manifold.riemannianEDist_le_pathELength _ (congrArg f hγ0) |
| 72 | (congrArg f hγ1) zero_le_one |
| 73 | exact (show ContMDiffOn (𝓡 n) (𝓡 n) 1 f (g.ball p (3 * r)) from |
| 74 | fun z hz ↦ (hf z hz).contMDiffWithinAt).comp hγsmooth.contMDiffOn hγball |
| 75 | apply (ENNReal.div_le_iff (ne_of_gt (ENNReal.ofReal_pos.mpr hC)) |
| 76 | ENNReal.ofReal_ne_top).mpr |
| 77 | calc |
| 78 | h.edist (f x) (f y) ≤ ENNReal.ofReal C * g.pathELength γ 0 1 := hdist.trans hlength |
| 79 | _ ≤ b * ENNReal.ofReal C := by |
| 80 | rw [mul_comm b] |
| 81 | exact mul_le_mul_right (hγlength.le.trans (min_le_left _ _)) _ |
| 82 | simpa only [mul_comm] using (ENNReal.div_le_iff |
| 83 | (ne_of_gt (ENNReal.ofReal_pos.mpr hC)) ENNReal.ofReal_ne_top).mp hdiv |
| 84 | |
| 85 | variable [T3Space M] |
| 86 | |
| 87 | /-- The local distance estimate requires the tangent bound only on a |
| 88 | neighborhood of the point. -/ |
| 89 | theorem exists_open_edist_image_le_of_tangentNorm_le |
| 90 | (g : RiemannianMetric n M) (h : RiemannianMetric n N) |
| 91 | {f : M → N} {s : Set M} {p : M} (hs : s ∈ 𝓝 p) |
| 92 | (hf : ∀ z ∈ s, ContMDiffAt (𝓡 n) (𝓡 n) 1 f z) |
| 93 | {C : ℝ} (hC : 0 < C) |
| 94 | (hbound : ∀ z ∈ s, ∀ v : TangentSpace (𝓡 n) z, |
| 95 | h.tangentNorm (f z) (mfderiv (𝓡 n) (𝓡 n) f z v) ≤ |
| 96 | C * g.tangentNorm z v) : |
| 97 | ∃ U : Set M, IsOpen U ∧ p ∈ U ∧ U ⊆ s ∧ |
| 98 | ∀ x ∈ U, ∀ y ∈ U, h.edist (f x) (f y) ≤ ENNReal.ofReal C * g.edist x y := by |
| 99 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 100 | ⟨g.toRiemannianMetric⟩ |
| 101 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 102 | (TangentSpace (𝓡 n) : M → Type _) := |
| 103 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 104 | obtain ⟨c, hc, hcs⟩ := setOfPred_riemannianEDist_lt_subset_nhds (𝓡 n) hs |
| 105 | let r : ℝ := (c : ℝ) / 3 |
| 106 | have hr : 0 < r := by dsimp [r]; positivity |
| 107 | have h3r : ENNReal.ofReal (3 * r) = c := by |
| 108 | dsimp [r] |
| 109 | rw [mul_div_cancel₀ _ (by norm_num), ENNReal.ofReal_coe_nnreal] |
| 110 | have hball : g.ball p (3 * r) ⊆ s := by |
| 111 | simpa only [ball, edist, h3r] using hcs |
| 112 | have hsmall : g.ball p r ⊆ g.ball p (3 * r) := by |
| 113 | intro z hz |
| 114 | exact hz.trans_le (ENNReal.ofReal_le_ofReal (by linarith)) |
| 115 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 116 | refine ⟨g.ball p r, ?_, ?_, hsmall.trans hball, ?_⟩ |
| 117 | · have hb : g.ball p r = Metric.eball p (ENNReal.ofReal r) := by |
| 118 | ext z |
| 119 | change Manifold.riemannianEDist (𝓡 n) p z < ENNReal.ofReal r ↔ |
| 120 | Manifold.riemannianEDist (𝓡 n) z p < ENNReal.ofReal r |
| 121 | rw [Manifold.riemannianEDist_comm] |
| 122 | rw [hb] |
| 123 | exact Metric.isOpen_eball |
| 124 | · change g.edist p p < ENNReal.ofReal r |
| 125 | simp only [edist, Manifold.riemannianEDist_self] |
| 126 | exact ENNReal.ofReal_pos.mpr hr |
| 127 | · intro x hx y hy |
| 128 | exact g.edist_image_le_mul_edist_of_tangentNorm_le_on_ball h hr hC |
| 129 | (fun z hz ↦ hf z (hball hz)) (fun z hz ↦ hbound z (hball hz)) hx hy |
| 130 | |
| 131 | variable [T3Space N] [MeasurableSpace M] [BorelSpace M] [SecondCountableTopology M] |
| 132 | [MeasurableSpace N] [BorelSpace N] |
| 133 | |
| 134 | /-- A uniform tangent norm bound controls the volume of the image of every |
| 135 | measurable subset of an open region in the embedding source. -/ |
| 136 | theorem volumeMeasure_image_le_of_tangentNorm_le |
| 137 | (g : RiemannianMetric n M) (h : RiemannianMetric n N) |
| 138 | (e : OpenPartialHomeomorph M N) {V : Set M} (hV : IsOpen V) |
| 139 | (hVe : V ⊆ e.source) |
| 140 | (he : ContMDiffOn (𝓡 n) (𝓡 n) 1 e e.source) |
| 141 | {C : ℝ} (hC : 0 < C) |
| 142 | (hbound : ∀ z ∈ V, ∀ v : TangentSpace (𝓡 n) z, |
| 143 | h.tangentNorm (e z) (mfderiv (𝓡 n) (𝓡 n) e z v) ≤ |
| 144 | C * g.tangentNorm z v) |
| 145 | {s : Set M} (hs : MeasurableSet s) (hsV : s ⊆ V) : |
| 146 | h.volumeMeasure (e '' s) ≤ ENNReal.ofReal C ^ n * g.volumeMeasure s := by |
| 147 | let μ := (h.volumeMeasure.restrict e.target).map e.symm |
| 148 | have hμ : ∀ t : Set M, MeasurableSet t → t ⊆ e.source → |
| 149 | μ t = h.volumeMeasure (e '' t) := by |
| 150 | intro t ht hte |
| 151 | have hm : AEMeasurable e.symm (h.volumeMeasure.restrict e.target) := |
| 152 | e.symm.continuousOn.aemeasurable e.open_target.measurableSet |
| 153 | have hset : e.symm ⁻¹' t ∩ e.target = e '' t := by |
| 154 | ext y |
| 155 | constructor |
| 156 | · intro hy |
| 157 | exact ⟨e.symm y, hy.1, e.right_inv hy.2⟩ |
| 158 | · rintro ⟨x, hx, rfl⟩ |
| 159 | exact ⟨by simpa only [mem_preimage, e.left_inv (hte hx)], e.map_source (hte hx)⟩ |
| 160 | dsimp only [μ] |
| 161 | rw [Measure.map_apply_of_aemeasurable hm ht, |
| 162 | Measure.restrict_apply' e.open_target.measurableSet, hset] |
| 163 | rw [← hμ s hs (hsV.trans hVe)] |
| 164 | change μ s ≤ (ENNReal.ofReal C ^ n • g.volumeMeasure) s |
| 165 | apply Poincare.HausdorffDensity.measure_le_of_locally_le hs |
| 166 | intro p hp |
| 167 | obtain ⟨U, hU, hpU, hUV, hdist⟩ := |
| 168 | g.exists_open_edist_image_le_of_tangentNorm_le h (hV.mem_nhds (hsV hp)) |
| 169 | (fun z hz ↦ he.contMDiffAt (e.open_source.mem_nhds (hVe hz))) hC hbound |
| 170 | refine ⟨U, hU, hpU, fun t ht hts ↦ ?_⟩ |
| 171 | rw [hμ t ht ((hts.trans inter_subset_left).trans (hUV.trans hVe))] |
| 172 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 173 | ⟨g.toRiemannianMetric⟩ |
| 174 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 175 | (TangentSpace (𝓡 n) : M → Type _) := |
| 176 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 177 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 178 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : N → Type _) := |
| 179 | ⟨h.toRiemannianMetric⟩ |
| 180 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 181 | (TangentSpace (𝓡 n) : N → Type _) := |
| 182 | ⟨⟨h.inner, h.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 183 | let : EMetricSpace N := EMetricSpace.ofRiemannianMetric (𝓡 n) N |
| 184 | let K : ℝ≥0 := ⟨C, hC.le⟩ |
| 185 | have hK : (K : ℝ≥0∞) = ENNReal.ofReal C := ENNReal.coe_nnreal_eq K |
| 186 | have hLip : LipschitzOnWith K e t := by |
| 187 | intro x hx y hy |
| 188 | change h.edist (e x) (e y) ≤ (K : ℝ≥0∞) * g.edist x y |
| 189 | rw [hK] |
| 190 | exact hdist x (hts hx).1 y (hts hy).1 |
| 191 | change Measure.euclideanHausdorffMeasure n (e '' t) ≤ |
| 192 | (ENNReal.ofReal C ^ n • Measure.euclideanHausdorffMeasure n) t |
| 193 | simpa only [Measure.smul_apply, ENNReal.smul_def, smul_eq_mul, |
| 194 | hK] using |
| 195 | Poincare.HausdorffDensity.euclideanHausdorffMeasure_image_le hLip n |
| 196 | |
| 197 | end PoincareMT.RiemannianMetric |