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 | |
| 3 | /-! |
| 4 | # A Jordan region with three prescribed full boundary arcs |
| 5 | |
| 6 | Affine parameter changes allow arbitrary base and tail intervals. The |
| 7 | actual incidence condition forces the crossing-region selector to retain |
| 8 | both entire sides. Source: MT Claim 19.40; minimal-contact derivation, Section 11. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Function |
| 15 | open scoped Topology |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | /-- Three embedded arcs with precisely the prescribed endpoint incidences bound a compact |
| 20 | Jordan region with exactly their full images as frontier. Source: |
| 21 | `proof-work/tasks/M64/derivations/2026-09-27-minimal-contact-regularity.md`, Section 11. -/ |
| 22 | theorem m64Intrinsic_exists_three_arc_region |
| 23 | {base alpha beta : ℝ → AnnulusCoordinates} {a b A u L : ℝ} |
| 24 | (hab : a < b) (hA : 0 < A) (huL : u < L) |
| 25 | (hb : ContinuousOn base (Icc a b)) (ha : Continuous alpha) (hc : Continuous beta) |
| 26 | (hbi : InjOn base (Icc a b)) (hai : InjOn alpha (Icc 0 A)) |
| 27 | (hci : InjOn beta (Icc u L)) |
| 28 | (hstart : base a = alpha 0) (hend : base b = beta u) (hmeet : alpha A = beta L) |
| 29 | (hba : ∀ x ∈ Icc a b, ∀ t ∈ Icc 0 A, base x = alpha t → x = a ∧ t = 0) |
| 30 | (hbc : ∀ x ∈ Icc a b, ∀ t ∈ Icc u L, base x = beta t → x = b ∧ t = u) |
| 31 | (hac : ∀ s ∈ Icc 0 A, ∀ t ∈ Icc u L, alpha s = beta t → s = A ∧ t = L) : |
| 32 | ∃ U V : Set AnnulusCoordinates, |
| 33 | IsOpen U ∧ IsOpen V ∧ IsPathConnected U ∧ IsPathConnected V ∧ |
| 34 | Bornology.IsBounded U ∧ ¬ Bornology.IsBounded V ∧ Disjoint U V ∧ |
| 35 | U ∪ V = (frontier U)ᶜ ∧ frontier V = frontier U ∧ |
| 36 | IsCompact (closure U) ∧ |
| 37 | frontier U = base '' Icc a b ∪ (alpha '' Icc 0 A ∪ beta '' Icc u L) := by |
| 38 | let f : ℝ → AnnulusCoordinates := fun x => base ((b - a) * x + a) |
| 39 | let g : ℝ → AnnulusCoordinates := fun t => beta (u + t) |
| 40 | have hparam (x : ℝ) (hx : x ∈ Icc 0 1) : (b - a) * x + a ∈ Icc a b := |
| 41 | ⟨by nlinarith [hx.1], by nlinarith [hx.2]⟩ |
| 42 | have htparam (t : ℝ) (ht : t ∈ Icc 0 (L - u)) : u + t ∈ Icc u L := |
| 43 | ⟨by linarith [ht.1], by linarith [ht.2]⟩ |
| 44 | have hf : ContinuousOn f (Icc 0 1) := hb.comp |
| 45 | ((continuous_const.mul continuous_id).add continuous_const).continuousOn hparam |
| 46 | have hg : Continuous g := hc.comp (continuous_const.add continuous_id) |
| 47 | have hfi : InjOn f (Icc 0 1) := by |
| 48 | intro x hx y hy hxy |
| 49 | have heq := hbi (hparam x hx) (hparam y hy) hxy |
| 50 | nlinarith |
| 51 | have hgi : InjOn g (Icc 0 (L - u)) := by |
| 52 | intro x hx y hy hxy |
| 53 | have heq := hci (htparam x hx) (htparam y hy) hxy |
| 54 | linarith |
| 55 | have hfa : ∀ x ∈ Icc 0 1, ∀ t ∈ Icc 0 A, |
| 56 | f x = alpha t → x = 0 ∧ t = 0 := by |
| 57 | intro x hx t ht hxt |
| 58 | have hh := hba _ (hparam x hx) t ht hxt |
| 59 | exact ⟨by nlinarith [hh.1], hh.2⟩ |
| 60 | have hfg : ∀ x ∈ Icc 0 1, ∀ t ∈ Icc 0 (L - u), |
| 61 | f x = g t → x = 1 ∧ t = 0 := by |
| 62 | intro x hx t ht hxt |
| 63 | have hh := hbc _ (hparam x hx) _ (htparam t ht) hxt |
| 64 | exact ⟨by nlinarith [hh.1], by linarith [hh.2]⟩ |
| 65 | obtain ⟨s, t, hs, hsA, ht, htL, hst, U, V, hU, hV, hpU, hpV, |
| 66 | hbU, hbV, hd, hcover, hfU, hfV, hcompact⟩ := |
| 67 | m64Intrinsic_exists_crossing_ray_region ha hg hai hgi hf hfi |
| 68 | (by simpa only [f, mul_zero, zero_add] using hstart) |
| 69 | (by simpa only [f, g, mul_one, sub_add_cancel, add_zero] using hend) |
| 70 | hfa hfg ⟨A, ⟨hA.le, le_rfl⟩, L - u, ⟨sub_nonneg.mpr huL.le, le_rfl⟩, |
| 71 | by simpa only [g, add_sub_cancel] using hmeet⟩ |
| 72 | have hends := hac s ⟨hs.le, hsA⟩ (u + t) (htparam t ⟨ht.le, htL⟩) hst |
| 73 | have hs' : s = A := hends.1 |
| 74 | have ht' : t = L - u := by linarith [hends.2] |
| 75 | subst s |
| 76 | subst t |
| 77 | have hfimage : f '' Icc 0 1 = base '' Icc a b := by |
| 78 | change (base ∘ fun x => (b - a) * x + a) '' Icc 0 1 = _ |
| 79 | rw [image_comp, image_affine_Icc' (sub_pos.mpr hab)] |
| 80 | simp only [mul_zero, zero_add, mul_one, sub_add_cancel] |
| 81 | have hgimage : g '' Icc 0 (L - u) = beta '' Icc u L := by |
| 82 | change (beta ∘ fun t => u + t) '' Icc 0 (L - u) = _ |
| 83 | rw [image_comp, image_const_add_Icc] |
| 84 | simp only [add_zero, add_sub_cancel] |
| 85 | rw [hfimage, hgimage] at hcover hfU hfV |
| 86 | exact ⟨U, V, hU, hV, hpU, hpV, hbU, hbV, hd, |
| 87 | by simpa only [hfU] using hcover, hfV.trans hfU.symm, hcompact, hfU⟩ |
| 88 | |
| 89 | end PoincareMT |