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.Metric |
| 2 | import Mathlib.Topology.Compactness.LocallyCompact |
| 3 | |
| 4 | /-! |
| 5 | # Compact tangent disks over compact base sets |
| 6 | |
| 7 | Local bundle norm bounds place each disk in finitely many compact inverse |
| 8 | trivialization images. This is the compactness step for continuation in |
| 9 | Morgan--Tian Chapter 6 and requires no completeness of the metric. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | open Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] [T2Space M] |
| 24 | |
| 25 | theorem isCompact_tangentDisk (g : RiemannianMetric n M) (K : Set M) |
| 26 | (hK : IsCompact K) (R : ℝ) (hR : 0 ≤ R) : |
| 27 | IsCompact {z : TangentBundle (𝓡 n) M | |
| 28 | z.proj ∈ K ∧ g.inner z.proj z.2 z.2 ≤ R} := by |
| 29 | classical |
| 30 | letI : RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 31 | ⟨g.toRiemannianMetric⟩ |
| 32 | letI : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 33 | (TangentSpace (𝓡 n) : M → Type _) := |
| 34 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 35 | letI : LocallyCompactSpace M := ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 36 | let e := fun x : M ↦ trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 37 | (TangentSpace (𝓡 n) : M → Type _) x |
| 38 | have hlocal (x : M) : ∃ B : ℝ, 0 < B ∧ ∃ L : Set M, |
| 39 | IsCompact L ∧ x ∈ interior L ∧ |
| 40 | ∀ y ∈ L, y ∈ (e x).baseSet ∧ ‖(e x).continuousLinearMapAt ℝ y‖ < B := by |
| 41 | obtain ⟨B, hB, hnorm⟩ := eventually_norm_trivializationAt_lt |
| 42 | (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n) : M → Type _) x |
| 43 | have hb : (e x).baseSet ∈ 𝓝 x := |
| 44 | (e x).open_baseSet.mem_nhds (FiberBundle.mem_baseSet_trivializationAt' x) |
| 45 | obtain ⟨U, hUsub, hUopen, hxU⟩ := mem_nhds_iff.mp (Filter.inter_mem hb hnorm) |
| 46 | obtain ⟨L, hLc, hxL, hLU⟩ := exists_compact_subset hUopen hxU |
| 47 | exact ⟨B, hB, L, hLc, hxL, fun y hy ↦ hUsub (hLU hy)⟩ |
| 48 | choose B hB L hLc hxL hL using hlocal |
| 49 | obtain ⟨S, _, hcover⟩ := hK.elim_nhds_subcover (fun x ↦ interior (L x)) |
| 50 | (fun x _ ↦ isOpen_interior.mem_nhds (hxL x)) |
| 51 | let C := fun x : M ↦ (e x).toOpenPartialHomeomorph.symm '' |
| 52 | (L x ×ˢ Metric.closedBall (0 : EuclideanSpace ℝ (Fin n)) (B x * Real.sqrt R)) |
| 53 | have hCc (x : M) : IsCompact (C x) := by |
| 54 | apply ((hLc x).prod (isCompact_closedBall _ _)).image_of_continuousOn |
| 55 | apply (e x).toOpenPartialHomeomorph.continuousOn_symm.mono |
| 56 | intro z hz |
| 57 | exact (e x).mem_target.mpr (hL x z.1 hz.1).1 |
| 58 | have hclosed : IsClosed {z : TangentBundle (𝓡 n) M | |
| 59 | z.proj ∈ K ∧ g.inner z.proj z.2 z.2 ≤ R} := by |
| 60 | have hi : Continuous (fun z : TangentBundle (𝓡 n) M ↦ g.inner z.proj z.2 z.2) := |
| 61 | Continuous.inner_bundle (b := fun z : TangentBundle (𝓡 n) M ↦ z.proj) |
| 62 | (v := fun z ↦ z.2) (w := fun z ↦ z.2) continuous_id continuous_id |
| 63 | exact (hK.isClosed.preimage (FiberBundle.continuous_proj _ _)).inter |
| 64 | (isClosed_le hi continuous_const) |
| 65 | apply (S.isCompact_biUnion (fun x _ ↦ hCc x)).of_isClosed_subset hclosed |
| 66 | intro z hz |
| 67 | obtain ⟨x, hxS, hx⟩ := Set.mem_iUnion₂.mp (hcover hz.1) |
| 68 | have hzL : z.proj ∈ L x := interior_subset hx |
| 69 | have hzb : z.proj ∈ (e x).baseSet := (hL x z.proj hzL).1 |
| 70 | have hzs : z ∈ (e x).source := (e x).mem_source.mpr hzb |
| 71 | have hnorm : ‖z.2‖ ≤ Real.sqrt R := by |
| 72 | rw [norm_eq_sqrt_real_inner] |
| 73 | exact Real.sqrt_le_sqrt hz.2 |
| 74 | have hcoord : ‖((e x) z).2‖ ≤ B x * Real.sqrt R := by |
| 75 | rw [← (e x).continuousLinearMapAt_apply_of_mem ℝ hzb z.2] |
| 76 | calc |
| 77 | _ ≤ ‖(e x).continuousLinearMapAt ℝ z.proj‖ * ‖z.2‖ := |
| 78 | ((e x).continuousLinearMapAt ℝ z.proj).le_opNorm z.2 |
| 79 | _ ≤ B x * ‖z.2‖ := |
| 80 | mul_le_mul_of_nonneg_right (hL x z.proj hzL).2.le (norm_nonneg _) |
| 81 | _ ≤ _ := mul_le_mul_of_nonneg_left hnorm (hB x).le |
| 82 | apply Set.mem_iUnion₂.mpr |
| 83 | refine ⟨x, hxS, (e x) z, ?_, ?_⟩ |
| 84 | · refine ⟨?_, ?_⟩ |
| 85 | · simpa only [(e x).coe_fst hzs] using hzL |
| 86 | · simpa only [Metric.mem_closedBall, dist_zero_right] using hcoord |
| 87 | · exact (e x).toOpenPartialHomeomorph.left_inv hzs |
| 88 | |
| 89 | end PoincareMT.ReducedLength |