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.CurveShortening.Comparison.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.PolygonApproximation.Lipschitz.AnnulusAdapter |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Infimum |
| 4 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Compact.ExtendedLipschitz |
| 5 | import PoincareLib.Topology.MetricSpace.Completeness |
| 6 | |
| 7 | /-! |
| 8 | # Local-to-global metric Lipschitz bridge |
| 9 | |
| 10 | Normalized target charts turn a `C1` rectangle map into a local metric |
| 11 | Lipschitz estimate. The compact extended-metric service then globalizes the |
| 12 | estimate on the closed annulus domain. The polygon construction still has to |
| 13 | provide the local hypotheses on each cell and across its cuts. |
| 14 | |
| 15 | Morgan--Tian context: Section 19.4, Definition 19.18 and Claims 19.19-19.22, printed pp. |
| 16 | 450-453. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set Filter MeasureTheory Bundle |
| 23 | open scoped Manifold ContDiff Topology Bundle ENNReal NNReal |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT |
| 28 | |
| 29 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T2Space M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 31 | [IsManifold (𝓡 n) ∞ M] |
| 32 | |
| 33 | /- The rectangle is an intersection of four affine half-spaces. -/ |
| 34 | /-- The closed coordinate annulus rectangle is convex. Source: Auxiliary step for MT |
| 35 | Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project construction in |
| 36 | `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 37 | theorem m64AnnulusDomain_convex : Convex ℝ m64AnnulusDomain := by |
| 38 | intro x hx y hy a b ha hb hab |
| 39 | change 0 ≤ (a • x + b • y) 0 ∧ (a • x + b • y) 0 ≤ curvePeriod ∧ |
| 40 | 0 ≤ (a • x + b • y) 1 ∧ (a • x + b • y) 1 ≤ 1 |
| 41 | simp only [PiLp.add_apply, PiLp.smul_apply, smul_eq_mul] |
| 42 | constructor |
| 43 | · exact add_nonneg (mul_nonneg ha hx.1) (mul_nonneg hb hy.1) |
| 44 | · constructor |
| 45 | · calc |
| 46 | a * x 0 + b * y 0 ≤ a * curvePeriod + b * curvePeriod := |
| 47 | add_le_add (mul_le_mul_of_nonneg_left hx.2.1 ha) |
| 48 | (mul_le_mul_of_nonneg_left hy.2.1 hb) |
| 49 | _ = curvePeriod := by rw [← add_mul, hab, one_mul] |
| 50 | · constructor |
| 51 | · exact add_nonneg (mul_nonneg ha hx.2.2.1) (mul_nonneg hb hy.2.2.1) |
| 52 | · calc |
| 53 | a * x 1 + b * y 1 ≤ a * 1 + b * 1 := |
| 54 | add_le_add (mul_le_mul_of_nonneg_left hx.2.2.2 ha) |
| 55 | (mul_le_mul_of_nonneg_left hy.2.2.2 hb) |
| 56 | _ = 1 := by rw [← add_mul, hab, one_mul] |
| 57 | |
| 58 | /- A normalized M40 chart supplies the target-side metric estimate, while |
| 59 | the coordinate composition is handled by M40's local C1 service. -/ |
| 60 | /-- A normalized smooth target chart gives a local metric Lipschitz bound for a C1 map. |
| 61 | Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project |
| 62 | construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 63 | theorem m64_lipschitzOn_nhds_of_contMDiffAt |
| 64 | (g : RiemannianMetric n M) {f : LoopPlane → M} {x : LoopPlane} |
| 65 | (hf : ContMDiffAt (𝓡 2) (𝓡 n) 1 f x) : |
| 66 | ∃ K : ℝ≥0, ∃ U ∈ 𝓝 x, ∀ y ∈ U, ∀ z ∈ U, |
| 67 | g.edist (f y) (f z) ≤ (K : ℝ≥0∞) * ENNReal.ofReal ‖y - z‖ := by |
| 68 | let : LocallyCompactSpace M := |
| 69 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 70 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 71 | ⟨g.toRiemannianMetric⟩ |
| 72 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 73 | (TangentSpace (𝓡 n) : M → Type _) := |
| 74 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 75 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 76 | let : IsRiemannianManifold (𝓡 n) M := ⟨fun _ _ => rfl⟩ |
| 77 | let e := chartAt (EuclideanSpace ℝ (Fin n)) (f x) |
| 78 | have he : e.MDifferentiable (𝓡 n) (𝓡 n) := mdifferentiable_chart _ |
| 79 | have hx : f x ∈ e.source := mem_chart_source _ _ |
| 80 | let chi := M40.normalizedSmoothChart e he hx |
| 81 | have hchi : f x ∈ chi.source := by |
| 82 | simpa only [chi, M40.normalizedSmoothChart_source] using hx |
| 83 | obtain ⟨R, hR, _hRtarget, hInv, _hForward⟩ := |
| 84 | M40.normalizedSmoothChart_exists_lipschitz_ball e he hx |
| 85 | contMDiffOn_chart contMDiffOn_chart_symm 2 (by norm_num) |
| 86 | have hchiAt := |
| 87 | (M40.normalizedSmoothChart_contMDiffOn e he hx contMDiffOn_chart).contMDiffAt |
| 88 | (chi.open_source.mem_nhds hchi) |
| 89 | have hcoord : ContMDiffAt (𝓡 2) 𝓘(ℝ, TangentSpace (𝓡 n) (f x)) 1 |
| 90 | (chi ∘ f) x := by |
| 91 | exact (hchiAt.of_le (m := 1) (by norm_num)).comp x hf |
| 92 | obtain ⟨K, _hK, U, hU, hcoordLip⟩ := |
| 93 | M40.exists_lipschitzOn_nhds_of_contMDiffAt hcoord |
| 94 | have hU' : U ∩ f ⁻¹' chi.source ∩ |
| 95 | (chi ∘ f) ⁻¹' Metric.ball (chi (f x)) R ∈ 𝓝 x := by |
| 96 | apply inter_mem (inter_mem hU |
| 97 | (hf.continuousAt.preimage_mem_nhds (chi.open_source.mem_nhds hchi))) |
| 98 | exact (hcoord.continuousAt.preimage_mem_nhds (Metric.ball_mem_nhds _ hR)) |
| 99 | let V := U ∩ f ⁻¹' chi.source ∩ |
| 100 | (chi ∘ f) ⁻¹' Metric.ball (chi (f x)) R |
| 101 | have hcoordV : LipschitzOnWith K (chi ∘ f) V := hcoordLip.mono (by |
| 102 | intro y hy |
| 103 | exact hy.1.1) |
| 104 | have hmap : MapsTo (chi ∘ f) V (Metric.ball (chi (f x)) R) := by |
| 105 | intro y hy |
| 106 | exact hy.2 |
| 107 | have hcomp : LipschitzOnWith (2 * K) (chi.symm ∘ (chi ∘ f)) V := |
| 108 | hInv.comp hcoordV hmap |
| 109 | refine ⟨2 * K, V, hU', ?_⟩ |
| 110 | intro y hy z hz |
| 111 | have hy' : f y ∈ chi.source := hy.1.2 |
| 112 | have hz' : f z ∈ chi.source := hz.1.2 |
| 113 | have heqy : chi.symm (chi (f y)) = f y := chi.left_inv hy' |
| 114 | have heqz : chi.symm (chi (f z)) = f z := chi.left_inv hz' |
| 115 | have hc := hcomp hy hz |
| 116 | change g.edist (chi.symm (chi (f y))) (chi.symm (chi (f z))) ≤ |
| 117 | ((2 * K : ℝ≥0) : ℝ≥0∞) * edist y z at hc |
| 118 | simpa only [heqy, heqz, edist_dist, dist_eq_norm] using hc |
| 119 | |
| 120 | /-- An open-domain C1 map is locally Lipschitz for the target's Riemannian extended |
| 121 | distance. Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. |
| 122 | 450-453; project construction in |
| 123 | `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 124 | theorem m64_lipschitzOn_nhds_of_contMDiffOn |
| 125 | (g : RiemannianMetric n M) {f : LoopPlane → M} {S : Set LoopPlane} |
| 126 | (hS : IsOpen S) (hf : ContMDiffOn (𝓡 2) (𝓡 n) 1 f S) : |
| 127 | ∀ x ∈ S, ∃ K : ℝ≥0, ∃ U ∈ 𝓝 x, ∀ y ∈ U, ∀ z ∈ U, |
| 128 | g.edist (f y) (f z) ≤ (K : ℝ≥0∞) * ENNReal.ofReal ‖y - z‖ := by |
| 129 | intro x hx |
| 130 | exact m64_lipschitzOn_nhds_of_contMDiffAt g |
| 131 | ((hf x hx).contMDiffAt (hS.mem_nhds hx)) |
| 132 | |
| 133 | /- On a continuous image of the convex annulus domain, every extended |
| 134 | Riemannian distance is finite. This removes a repeated side condition from |
| 135 | the compact globalization call. -/ |
| 136 | /-- A continuous image of the connected rectangle lies in one finite-distance target |
| 137 | component. Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. |
| 138 | 450-453; project construction in |
| 139 | `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 140 | theorem m64AnnulusDomain_edist_ne_top |
| 141 | (g : RiemannianMetric n M) {f : LoopPlane → M} |
| 142 | (hcontinuous : ContinuousOn f m64AnnulusDomain) : |
| 143 | ∀ x ∈ m64AnnulusDomain, ∀ y ∈ m64AnnulusDomain, |
| 144 | g.edist (f x) (f y) ≠ (⊤ : ENNReal) := by |
| 145 | let : LocallyCompactSpace M := |
| 146 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 147 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 148 | ⟨g.toRiemannianMetric⟩ |
| 149 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 150 | (TangentSpace (𝓡 n) : M → Type _) := |
| 151 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 152 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 153 | let R := f '' m64AnnulusDomain |
| 154 | have hR : IsPreconnected R := |
| 155 | m64AnnulusDomain_convex.isPreconnected.image f hcontinuous |
| 156 | let : PreconnectedSpace R := isPreconnected_iff_preconnectedSpace.mp hR |
| 157 | intro x hx y hy |
| 158 | exact Poincare.edist_ne_top_of_preconnected |
| 159 | (⟨f x, mem_image_of_mem f hx⟩ : R) |
| 160 | (⟨f y, mem_image_of_mem f hy⟩ : R) |
| 161 | |
| 162 | /-- Globalize local Lipschitz estimates over the compact annulus rectangle. Source: |
| 163 | Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project |
| 164 | construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 165 | theorem m64Annulus_hLip_of_local |
| 166 | (g : RiemannianMetric n M) {f : LoopPlane → M} |
| 167 | (hcontinuous : ContinuousOn f m64AnnulusDomain) |
| 168 | (hLocal : ∀ x ∈ m64AnnulusDomain, ∃ K : ℝ≥0, ∃ U ∈ 𝓝 x, |
| 169 | ∀ y ∈ U, ∀ z ∈ U, |
| 170 | g.edist (f y) (f z) ≤ (K : ℝ≥0∞) * ENNReal.ofReal ‖y - z‖) : |
| 171 | ∃ K : ℝ≥0, ∀ x y : m64AnnulusDomain, |
| 172 | g.edist (f x) (f y) ≤ |
| 173 | (K : ℝ≥0∞) * ENNReal.ofReal ‖(x : LoopPlane) - y‖ := by |
| 174 | let : LocallyCompactSpace M := |
| 175 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 176 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 177 | ⟨g.toRiemannianMetric⟩ |
| 178 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 179 | (TangentSpace (𝓡 n) : M → Type _) := |
| 180 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 181 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 182 | let : IsRiemannianManifold (𝓡 n) M := ⟨fun _ _ => rfl⟩ |
| 183 | have hloc : LocallyLipschitzOn m64AnnulusDomain f := by |
| 184 | intro x hx |
| 185 | obtain ⟨K, U, hU, hK⟩ := hLocal x hx |
| 186 | refine ⟨K, U ∩ m64AnnulusDomain, |
| 187 | inter_mem (nhdsWithin_le_nhds hU) self_mem_nhdsWithin, ?_⟩ |
| 188 | intro y hy z hz |
| 189 | change g.edist (f y) (f z) ≤ (K : ℝ≥0∞) * edist y z |
| 190 | simpa only [edist_dist, dist_eq_norm] using hK y hy.1 z hz.1 |
| 191 | obtain ⟨K, hK⟩ := M60.exists_lipschitzOnWith_of_compact_edist_ne_top |
| 192 | m64AnnulusDomain_isCompact hloc |
| 193 | (m64AnnulusDomain_edist_ne_top g hcontinuous) |
| 194 | refine ⟨K, ?_⟩ |
| 195 | intro x y |
| 196 | have h := hK x.property y.property |
| 197 | change g.edist (f x) (f y) ≤ (K : ℝ≥0∞) * edist (x : LoopPlane) y at h |
| 198 | simpa only [edist_dist, dist_eq_norm] using h |
| 199 | |
| 200 | end PoincareMT |