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.IntrinsicComparison.Cross.RayRegion |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Two.ArcLoop |
| 3 | |
| 4 | /-! A simple closed loop through the three original boundary arcs. |
| 5 | Source: MT Claim 19.40, pp. 470-471; combined-boundary-collar derivation, |
| 6 | Section 12. Only the original continuity and incidence data are used. -/ |
| 7 | |
| 8 | noncomputable section |
| 9 | set_option autoImplicit false |
| 10 | |
| 11 | open Set |
| 12 | open scoped Topology |
| 13 | |
| 14 | namespace PoincareMT |
| 15 | |
| 16 | /-- Three embedded arcs with the original endpoint incidences give an actual simple closed |
| 17 | loop with exactly their full images as trace. Source: MT Claim 19.40; |
| 18 | combined-boundary-collar derivation, Section 12. Construction: |
| 19 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Section 12. -/ |
| 20 | theorem m64Intrinsic_exists_three_arc_loop |
| 21 | (gamma : Bool → ℝ → AnnulusCoordinates) (sigma : ℝ → AnnulusCoordinates) |
| 22 | (T : Bool → ℝ) {S : ℝ} (hg : ∀ e, ContinuousOn (gamma e) (Icc 0 (T e))) |
| 23 | (hs : ContinuousOn sigma (Icc 0 S)) (hT : ∀ e, 0 < T e) (hS : 0 < S) |
| 24 | (hinj : ∀ e, InjOn (gamma e) (Icc 0 (T e))) (hsi : InjOn sigma (Icc 0 S)) |
| 25 | (hstart : sigma 0 = gamma false 0) (hend : sigma S = gamma true (T true)) |
| 26 | (hjoin : gamma false (T false) = gamma true 0) |
| 27 | (hab : ∀ x ∈ Icc 0 (T false), ∀ y ∈ Icc 0 (T true), |
| 28 | gamma false x = gamma true y → x = T false ∧ y = 0) |
| 29 | (has : ∀ x ∈ Icc 0 (T false), ∀ y ∈ Icc 0 S, |
| 30 | gamma false x = sigma y → x = 0 ∧ y = 0) |
| 31 | (hbs : ∀ x ∈ Icc 0 (T true), ∀ y ∈ Icc 0 S, |
| 32 | gamma true x = sigma y → x = T true ∧ y = S) : |
| 33 | ∃ loop : ℝ → AnnulusCoordinates, |
| 34 | ContinuousOn loop (Icc 0 2) ∧ loop 0 = loop 2 ∧ InjOn loop (Ico 0 2) ∧ |
| 35 | loop '' Icc 0 2 = gamma false '' Icc 0 (T false) ∪ |
| 36 | gamma true '' Icc 0 (T true) ∪ sigma '' Icc 0 S := by |
| 37 | let f (e : Bool) (x : ℝ) := gamma e (T e * x) |
| 38 | have hparam (e : Bool) {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) : |
| 39 | T e * x ∈ Icc 0 (T e) := |
| 40 | ⟨mul_nonneg (hT e).le hx.1, by nlinarith [hT e, hx.2]⟩ |
| 41 | have hf (e : Bool) : ContinuousOn (f e) (Icc 0 1) := |
| 42 | (hg e).comp (continuous_const.mul continuous_id).continuousOn (fun _ hx => hparam e hx) |
| 43 | have hfi (e : Bool) : InjOn (f e) (Icc 0 1) := by |
| 44 | intro x hx y hy he |
| 45 | exact mul_left_cancel₀ (hT e).ne' (hinj e (hparam e hx) (hparam e hy) he) |
| 46 | have hfjoin : f false 1 = f true 0 := by |
| 47 | simpa only [f, mul_one, mul_zero] using hjoin |
| 48 | have hfmeet : ∀ x ∈ Icc 0 1, ∀ y ∈ Icc 0 1, |
| 49 | f false x = f true y → x = 1 ∧ y = 0 := by |
| 50 | intro x hx y hy he |
| 51 | have hh := hab _ (hparam false hx) _ (hparam true hy) he |
| 52 | constructor |
| 53 | · nlinarith [hh.1, hT false] |
| 54 | · exact (mul_eq_zero.mp hh.2).resolve_left (hT true).ne' |
| 55 | obtain ⟨q, hq, hqi, hq0, hq1, hqimage⟩ := |
| 56 | m64Intrinsic_exists_embedded_join (hf false) (hf true) (hfi false) (hfi true) |
| 57 | hfjoin hfmeet |
| 58 | have hfimage (e : Bool) : f e '' Icc 0 1 = gamma e '' Icc 0 (T e) := by |
| 59 | change (gamma e ∘ fun x => T e * x) '' Icc 0 1 = _ |
| 60 | rw [image_comp, image_mul_left_Icc' (hT e)] |
| 61 | simp only [mul_zero, mul_one] |
| 62 | rw [hfimage false, hfimage true] at hqimage |
| 63 | have hq0' : q 0 = gamma false 0 := by simpa only [f, mul_zero] using hq0 |
| 64 | have hq1' : q 1 = gamma true (T true) := by simpa only [f, mul_one] using hq1 |
| 65 | have hqs : ∀ x ∈ Icc 0 1, ∀ y ∈ Icc 0 S, |
| 66 | q x = sigma y → (x = 0 ∧ y = 0) ∨ (x = 1 ∧ y = S) := by |
| 67 | intro x hx y hy he |
| 68 | have hximage : q x ∈ gamma false '' Icc 0 (T false) ∪ |
| 69 | gamma true '' Icc 0 (T true) := hqimage ▸ mem_image_of_mem q hx |
| 70 | rcases hximage with ⟨t, ht, htq⟩ | ⟨t, ht, htq⟩ |
| 71 | · obtain ⟨ht0, hy0⟩ := has t ht y hy (htq.trans he) |
| 72 | refine Or.inl ⟨hqi hx (by norm_num) ?_, hy0⟩ |
| 73 | exact htq.symm.trans ((congrArg (gamma false) ht0).trans hq0'.symm) |
| 74 | · obtain ⟨htT, hyS⟩ := hbs t ht y hy (htq.trans he) |
| 75 | refine Or.inr ⟨hqi hx (by norm_num) ?_, hyS⟩ |
| 76 | exact htq.symm.trans ((congrArg (gamma true) htT).trans hq1'.symm) |
| 77 | obtain ⟨loop, hl, he, hi, himage⟩ := m64Intrinsic_exists_simple_loop_between_arcs |
| 78 | (by norm_num : (0 : ℝ) < 1) hS hq hs hqi hsi |
| 79 | (hq0'.trans hstart.symm) (hq1'.trans hend.symm) hqs |
| 80 | exact ⟨loop, hl, he, hi, by rwa [hqimage] at himage⟩ |
| 81 | |
| 82 | end PoincareMT |