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 Mathlib.Topology.MetricSpace.Equicontinuity |
| 2 | import Mathlib.Topology.MetricSpace.Thickening |
| 3 | import Mathlib.Topology.Connected.Clopen |
| 4 | |
| 5 | /-! |
| 6 | # Compact confinement of anchored equicontinuous paths |
| 7 | |
| 8 | The evaluation fibers that are totally bounded form a clopen set of |
| 9 | parameters. Completeness and local compactness give compact thickenings |
| 10 | of their closures. Connectedness propagates the anchored fiber, and a |
| 11 | finite parameter cover gives one compact range. This is the compactness |
| 12 | step in the reconstruction of Morgan-Tian Claim 7.11. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter Metric |
| 18 | open scoped Topology |
| 19 | |
| 20 | namespace PoincareMT.ReducedVolume |
| 21 | |
| 22 | variable {A X ι : Type*} [TopologicalSpace A] [MetricSpace X] |
| 23 | |
| 24 | /-- Totally bounded evaluation fibers persist at closure points by equicontinuity. -/ |
| 25 | theorem isClosed_totallyBounded_fibers {f : ι → A → X} (hf : Equicontinuous f) : |
| 26 | IsClosed {a | TotallyBounded (range (fun i ↦ f i a))} := by |
| 27 | apply isClosed_of_closure_subset |
| 28 | intro a ha |
| 29 | apply Metric.totallyBounded_iff.mpr |
| 30 | intro ε hε |
| 31 | have hnear := Metric.equicontinuousAt_iff_right.mp (hf a) (ε / 2) (half_pos hε) |
| 32 | obtain ⟨b, hbnear, hb⟩ := mem_closure_iff_nhds.mp ha _ hnear |
| 33 | obtain ⟨S, hS, hcover⟩ := Metric.totallyBounded_iff.mp hb (ε / 2) (half_pos hε) |
| 34 | refine ⟨S, hS, ?_⟩ |
| 35 | rintro _ ⟨i, rfl⟩ |
| 36 | obtain ⟨y, hy, hdist⟩ := mem_iUnion₂.mp (hcover (mem_range_self i)) |
| 37 | apply mem_iUnion₂.mpr ⟨y, hy, ?_⟩ |
| 38 | change dist (f i a) y < ε |
| 39 | have hdy : dist (f i b) y < ε / 2 := hdist |
| 40 | exact lt_of_le_of_lt (dist_triangle _ (f i b) _) (by linarith [hbnear i]) |
| 41 | |
| 42 | variable [CompleteSpace X] [LocallyCompactSpace X] |
| 43 | |
| 44 | /-- A totally bounded fiber has a common compact range for all nearby parameters. -/ |
| 45 | theorem exists_compact_range_nhds {f : ι → A → X} {a : A} |
| 46 | (hf : EquicontinuousAt f a) (ha : TotallyBounded (range (fun i ↦ f i a))) : |
| 47 | ∃ K : Set X, IsCompact K ∧ ∀ᶠ b in 𝓝 a, ∀ i, f i b ∈ K := by |
| 48 | have hc : IsCompact (closure (range (fun i ↦ f i a))) := |
| 49 | ha.closure.isCompact_of_isClosed isClosed_closure |
| 50 | obtain ⟨δ, hδ, hK⟩ := hc.exists_isCompact_cthickening |
| 51 | refine ⟨cthickening δ (closure (range (fun i ↦ f i a))), hK, ?_⟩ |
| 52 | filter_upwards [Metric.equicontinuousAt_iff_right.mp hf δ hδ] with b hb |
| 53 | intro i |
| 54 | apply mem_cthickening_of_dist_le _ (f i a) _ _ (subset_closure (mem_range_self i)) |
| 55 | simpa only [dist_comm] using (hb i).le |
| 56 | |
| 57 | /-- In a complete locally compact space, the totally bounded evaluation fibers are open. -/ |
| 58 | theorem isOpen_totallyBounded_fibers {f : ι → A → X} (hf : Equicontinuous f) : |
| 59 | IsOpen {a | TotallyBounded (range (fun i ↦ f i a))} := by |
| 60 | apply isOpen_iff_mem_nhds.mpr |
| 61 | intro a ha |
| 62 | obtain ⟨K, hK, hnear⟩ := exists_compact_range_nhds (hf a) ha |
| 63 | filter_upwards [hnear] with b hb |
| 64 | exact hK.totallyBounded.subset (range_subset_iff.mpr hb) |
| 65 | |
| 66 | /-- An anchored equicontinuous family on a compact connected parameter space has compact range. -/ |
| 67 | theorem exists_compact_range_of_anchored_equicontinuous |
| 68 | [CompactSpace A] [PreconnectedSpace A] {f : ι → A → X} |
| 69 | (hf : Equicontinuous f) (a₀ : A) (p : X) (hanchor : ∀ i, f i a₀ = p) : |
| 70 | ∃ K : Set X, IsCompact K ∧ ∀ i a, f i a ∈ K := by |
| 71 | classical |
| 72 | have hanchor' : TotallyBounded (range (fun i ↦ f i a₀)) := by |
| 73 | apply (isCompact_singleton (x := p)).totallyBounded.subset |
| 74 | rintro _ ⟨i, rfl⟩ |
| 75 | exact mem_singleton_iff.mpr (hanchor i) |
| 76 | have hall : {a | TotallyBounded (range (fun i ↦ f i a))} = univ := |
| 77 | IsClopen.eq_univ ⟨isClosed_totallyBounded_fibers hf, |
| 78 | isOpen_totallyBounded_fibers hf⟩ ⟨a₀, hanchor'⟩ |
| 79 | have hlocal (a : A) : ∃ K : Set X, IsCompact K ∧ |
| 80 | ∀ᶠ b in 𝓝 a, ∀ i, f i b ∈ K := |
| 81 | exists_compact_range_nhds (hf a) (by |
| 82 | change a ∈ {b | TotallyBounded (range (fun i ↦ f i b))} |
| 83 | rw [hall] |
| 84 | trivial) |
| 85 | choose K hK hnear using hlocal |
| 86 | obtain ⟨s, hs⟩ := finite_cover_nhds hnear |
| 87 | refine ⟨⋃ a ∈ s, K a, s.isCompact_biUnion (fun a _ ↦ hK a), ?_⟩ |
| 88 | intro i a |
| 89 | have ha : a ∈ ⋃ b ∈ s, {c | ∀ j, f j c ∈ K b} := by rw [hs]; trivial |
| 90 | obtain ⟨b, hb, hab⟩ := mem_iUnion₂.mp ha |
| 91 | exact mem_iUnion₂.mpr ⟨b, hb, hab i⟩ |
| 92 | |
| 93 | end PoincareMT.ReducedVolume |