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.OpenPartialHomeomorph.Basic |
| 2 | import Mathlib.Analysis.Normed.Module.Basic |
| 3 | import Mathlib.Topology.Instances.Real.Lemmas |
| 4 | |
| 5 | /-! Local radius control for contacts with an embedded compact arc. |
| 6 | Source: MT Claim 19.41; short-geodesic-digons derivation, Section 10. |
| 7 | Compact tails turn one-sided inverse-lift control into a full neighborhood. -/ |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | |
| 11 | open Set Filter Metric |
| 12 | open scoped Topology |
| 13 | |
| 14 | namespace PoincareMT |
| 15 | |
| 16 | /-- A shorter inverse lift at earlier parameters controls every contact with the compact |
| 17 | embedded arc from a neighborhood of its terminal lift. Source: MT Claim 19.41; digon |
| 18 | derivation, Section 10. Source/construction: |
| 19 | proof-work/tasks/M64/derivations/2026-09-27-short-geodesic-digons.md, Section 10. -/ |
| 20 | theorem m64_eventually_lift_contact_norm_le |
| 21 | {E X : Type*} [NormedAddCommGroup E] [TopologicalSpace X] [T2Space X] |
| 22 | (F : OpenPartialHomeomorph E X) {v : E} (hv : v ∈ F.source) |
| 23 | {beta : ℝ → X} {s : ℝ} (hs : 0 ≤ s) |
| 24 | (hb : ContinuousOn beta (Icc 0 s)) (hi : InjOn beta (Icc 0 s)) |
| 25 | (hend : F v = beta s) |
| 26 | (hshort : ∀ᶠ b in 𝓝[<] s, ‖F.symm (beta b)‖ < ‖v‖) : |
| 27 | ∀ᶠ w in 𝓝 v, ∀ b ∈ Icc 0 s, F w = beta b → ‖w‖ ≤ ‖v‖ := by |
| 28 | obtain ⟨l, hls, hbound⟩ := mem_nhdsLT_iff_exists_Ioo_subset.mp hshort |
| 29 | have hsub : Icc 0 l ⊆ Icc 0 s := Icc_subset_Icc le_rfl hls.le |
| 30 | have htail : IsClosed (beta '' Icc 0 l) := |
| 31 | (isCompact_Icc.image_of_continuousOn (hb.mono hsub)).isClosed |
| 32 | have havoid : F v ∉ beta '' Icc 0 l := by |
| 33 | rintro ⟨b, hbI, heq⟩ |
| 34 | have hbs := hi (hsub hbI) ⟨hs, le_rfl⟩ (heq.trans hend) |
| 35 | exact hls.not_ge (hbs ▸ hbI.2) |
| 36 | have hnear : ∀ᶠ w in 𝓝 v, F w ∉ beta '' Icc 0 l := |
| 37 | ((F.continuousOn v hv).continuousAt (F.open_source.mem_nhds hv)).eventually |
| 38 | (htail.isOpen_compl.mem_nhds havoid) |
| 39 | filter_upwards [hnear, F.open_source.mem_nhds hv] with w hw hws |
| 40 | intro b hbI heq |
| 41 | rcases hbI.2.eq_or_lt with rfl | hbs |
| 42 | · have hwv : w = v := F.injOn hws hv (heq.trans hend.symm) |
| 43 | exact hwv ▸ le_rfl |
| 44 | · have hlb : l < b := by |
| 45 | by_contra hn |
| 46 | exact hw ⟨b, ⟨hbI.1, le_of_not_gt hn⟩, heq.symm⟩ |
| 47 | have h : ‖F.symm (beta b)‖ < ‖v‖ := hbound ⟨hlb, hbs⟩ |
| 48 | rw [← heq, F.left_inv hws] at h |
| 49 | exact h.le |
| 50 | |
| 51 | /-- The local terminal contact bound and the open norm ball give an open neighborhood of the |
| 52 | whole radial segment with the same contact bound. Source: MT Claim 19.41; digon derivation, |
| 53 | Section 10. Source/construction: |
| 54 | proof-work/tasks/M64/derivations/2026-09-27-short-geodesic-digons.md, Section 10. -/ |
| 55 | theorem m64_exists_radial_contact_neighborhood |
| 56 | {E X : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 57 | {S : Set E} (hS : IsOpen S) {v : E} (hv : v ≠ 0) {R : ℝ} (hR : ‖v‖ ≤ R) |
| 58 | (hsegment : ∀ t ∈ Icc (0 : ℝ) 1, t • v ∈ S) |
| 59 | {e : E → X} {beta : ℝ → X} {s : ℝ} |
| 60 | (hlocal : ∀ᶠ w in 𝓝 v, ∀ b ∈ Icc 0 s, e w = beta b → ‖w‖ ≤ ‖v‖) : |
| 61 | ∃ O : Set E, IsOpen O ∧ O ⊆ S ∧ |
| 62 | (∀ t ∈ Icc (0 : ℝ) 1, t • v ∈ O) ∧ |
| 63 | ∀ w ∈ O, ∀ b ∈ Icc 0 s, e w = beta b → ‖w‖ ≤ R := by |
| 64 | obtain ⟨V, hVsub, hV, hvV⟩ := _root_.mem_nhds_iff.mp hlocal |
| 65 | refine ⟨S ∩ (ball 0 R ∪ V), hS.inter (isOpen_ball.union hV), inter_subset_left, ?_, ?_⟩ |
| 66 | · intro t ht |
| 67 | refine ⟨hsegment t ht, ?_⟩ |
| 68 | rcases ht.2.eq_or_lt with rfl | ht1 |
| 69 | · rw [one_smul] |
| 70 | exact Or.inr hvV |
| 71 | · left |
| 72 | rw [mem_ball, dist_zero_right, norm_smul, Real.norm_of_nonneg ht.1] |
| 73 | exact (mul_lt_mul_of_pos_right ht1 (norm_pos_iff.mpr hv)).trans_le (by simpa using hR) |
| 74 | · intro w hw b hb heq |
| 75 | rcases hw.2 with hball | hVw |
| 76 | · exact (show ‖w‖ < R by simpa only [mem_ball, dist_zero_right] using hball).le |
| 77 | · exact (hVsub hVw b hb heq).trans hR |
| 78 | |
| 79 | end PoincareMT |