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.Metric.LipschitzBridge |
| 3 | import Mathlib.Analysis.Calculus.ContDiff.RCLike |
| 4 | |
| 5 | /-! |
| 6 | # Uniform local metric control of a compact retraction image |
| 7 | |
| 8 | Finite compactness combines actual local metric Lipschitz estimates into |
| 9 | one estimate on an open neighborhood of the diagonal. Distinct connected |
| 10 | components need not have finite Riemannian distance. |
| 11 | |
| 12 | Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. |
| 13 | 447-449. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Topology Bundle ENNReal NNReal |
| 21 | |
| 22 | namespace PoincareMT.M64 |
| 23 | |
| 24 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 27 | |
| 28 | /-- Construct a local Riemannian Lipschitz estimate for a C1 map in normalized target |
| 29 | coordinates. Proof expansion for Morgan-Tian (2007), Lemma 19.15, pp. 447-449. -/ |
| 30 | theorem metric_lipschitz_nhds_of_contMDiffAt |
| 31 | (g : RiemannianMetric n M) {f : E → M} {x : E} |
| 32 | (hf : ContMDiffAt 𝓘(ℝ, E) (𝓡 n) 1 f x) : |
| 33 | ∃ C : ℝ≥0, ∃ U : Set E, IsOpen U ∧ x ∈ U ∧ |
| 34 | ∀ y ∈ U, ∀ z ∈ U, |
| 35 | g.edist (f y) (f z) ≤ (C : ℝ≥0∞) * ENNReal.ofReal ‖y - z‖ := by |
| 36 | let : LocallyCompactSpace M := |
| 37 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 38 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 39 | ⟨g.toRiemannianMetric⟩ |
| 40 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 41 | (TangentSpace (𝓡 n) : M → Type _) := |
| 42 | ⟨⟨g.inner, g.contMDiff.continuous, fun _ _ _ => rfl⟩⟩ |
| 43 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 44 | let : IsRiemannianManifold (𝓡 n) M := ⟨fun _ _ => rfl⟩ |
| 45 | let e := chartAt (EuclideanSpace ℝ (Fin n)) (f x) |
| 46 | have he : e.MDifferentiable (𝓡 n) (𝓡 n) := mdifferentiable_chart _ |
| 47 | have hx : f x ∈ e.source := mem_chart_source _ _ |
| 48 | let chi := M40.normalizedSmoothChart e he hx |
| 49 | have hchi : f x ∈ chi.source := by |
| 50 | simpa only [chi, M40.normalizedSmoothChart_source] using hx |
| 51 | obtain ⟨R, hR, -, hInv, -⟩ := M40.normalizedSmoothChart_exists_lipschitz_ball |
| 52 | e he hx contMDiffOn_chart contMDiffOn_chart_symm 2 (by norm_num) |
| 53 | have hcoord : ContDiffAt ℝ 1 (chi ∘ f) x := |
| 54 | (((M40.normalizedSmoothChart_contMDiffOn e he hx contMDiffOn_chart).contMDiffAt |
| 55 | (chi.open_source.mem_nhds hchi)).of_le (m := 1) (by norm_num)).comp x hf |
| 56 | |>.contDiffAt |
| 57 | obtain ⟨C, U, hU, hLip⟩ := hcoord.exists_lipschitzOnWith |
| 58 | have hwindow : U ∩ f ⁻¹' chi.source ∩ |
| 59 | (chi ∘ f) ⁻¹' Metric.ball (chi (f x)) R ∈ 𝓝 x := |
| 60 | inter_mem (inter_mem hU (hf.continuousAt.preimage_mem_nhds |
| 61 | (chi.open_source.mem_nhds hchi))) |
| 62 | (hcoord.continuousAt.preimage_mem_nhds (Metric.ball_mem_nhds _ hR)) |
| 63 | obtain ⟨V, hVsub, hV, hxV⟩ := mem_nhds_iff.mp hwindow |
| 64 | have hLipV : LipschitzOnWith C (chi ∘ f) V := hLip.mono (fun y hy => (hVsub hy).1.1) |
| 65 | have hcomp := hInv.comp hLipV (fun y hy => (hVsub hy).2) |
| 66 | refine ⟨2 * C, V, hV, hxV, ?_⟩ |
| 67 | intro y hy z hz |
| 68 | have hh := hcomp hy hz |
| 69 | change g.edist (chi.symm (chi (f y))) (chi.symm (chi (f z))) ≤ |
| 70 | ((2 * C : ℝ≥0) : ℝ≥0∞) * edist y z at hh |
| 71 | simpa only [chi.left_inv (hVsub hy).1.2, chi.left_inv (hVsub hz).1.2, |
| 72 | edist_dist, dist_eq_norm] using hh |
| 73 | |
| 74 | /-- Combine local metric estimates into one open neighborhood of a compact diagonal. Proof |
| 75 | expansion for Morgan-Tian (2007), Lemma 19.15, pp. 447-449. -/ |
| 76 | theorem compact_metric_control_near_diagonal |
| 77 | (g : RiemannianMetric n M) {rho : E → M} {K O : Set E} |
| 78 | (hK : IsCompact K) (hO : IsOpen O) (hKO : K ⊆ O) |
| 79 | (hrho : ContMDiffOn 𝓘(ℝ, E) (𝓡 n) 1 rho O) : |
| 80 | ∃ C : ℝ, 0 < C ∧ ∃ V : Set (E × E), IsOpen V ∧ |
| 81 | (∀ z ∈ K, (z, z) ∈ V) ∧ |
| 82 | ∀ p ∈ V, g.edist (rho p.1) (rho p.2) ≤ ENNReal.ofReal (C * ‖p.1 - p.2‖) := by |
| 83 | classical |
| 84 | have hlocal (z : K) := metric_lipschitz_nhds_of_contMDiffAt g |
| 85 | (hrho.contMDiffAt (hO.mem_nhds (hKO z.property))) |
| 86 | choose C U hU hmem hLip using hlocal |
| 87 | obtain ⟨s, hs⟩ := hK.elim_nhds_subcover' (fun z hz => U ⟨z, hz⟩) |
| 88 | (fun z hz => (hU ⟨z, hz⟩).mem_nhds (hmem ⟨z, hz⟩)) |
| 89 | let L : ℝ := (∑ z ∈ s, (C z : ℝ)) + 1 |
| 90 | let V : Set (E × E) := ⋃ z ∈ s, U z ×ˢ U z |
| 91 | have hL : 0 < L := by |
| 92 | have hsnonneg := Finset.sum_nonneg (fun z (_ : z ∈ s) => (C z).coe_nonneg) |
| 93 | dsimp only [L] |
| 94 | linarith |
| 95 | refine ⟨L, hL, V, isOpen_biUnion (fun z _ => (hU z).prod (hU z)), ?_, ?_⟩ |
| 96 | · intro z hz |
| 97 | obtain ⟨w, hw, hzw⟩ := mem_iUnion₂.mp (hs hz) |
| 98 | exact mem_iUnion₂.mpr ⟨w, hw, hzw, hzw⟩ |
| 99 | · intro p hp |
| 100 | obtain ⟨z, hz, hp0, hp1⟩ := mem_iUnion₂.mp hp |
| 101 | have hC : (C z : ℝ) ≤ L := by |
| 102 | have hsum := Finset.single_le_sum (fun y (_ : y ∈ s) => (C y).coe_nonneg) hz |
| 103 | dsimp only [L] |
| 104 | linarith |
| 105 | have hh := hLip z p.1 hp0 p.2 hp1 |
| 106 | calc |
| 107 | _ ≤ (C z : ℝ≥0∞) * ENNReal.ofReal ‖p.1 - p.2‖ := hh |
| 108 | _ = ENNReal.ofReal ((C z : ℝ) * ‖p.1 - p.2‖) := by |
| 109 | rw [ENNReal.ofReal_mul (C z).coe_nonneg, ENNReal.ofReal_coe_nnreal] |
| 110 | _ ≤ ENNReal.ofReal (L * ‖p.1 - p.2‖) := |
| 111 | ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_right hC (norm_nonneg _)) |
| 112 | |
| 113 | end PoincareMT.M64 |