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.Corner.BandChords |
| 2 | |
| 3 | /-! Positive corner axes meet a trimmed incident arc only at the fitted tip. |
| 4 | |
| 5 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481, including Claim 19.40, |
| 6 | pp. 470-471. These project constructions supply actual occupied boundary collars |
| 7 | and attachment coverage for the regional Gauss--Bonnet argument. |
| 8 | -/ |
| 9 | |
| 10 | noncomputable section |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set |
| 14 | open scoped Topology |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | /-- An original near-end arc meets the closed trimmed middle only at its fitted tip, |
| 19 | including reversed terminal parametrization. Source: |
| 20 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-boundary-coverage-review.md`, round_1, |
| 21 | semantic check 14. -/ |
| 22 | theorem m64Intrinsic_near_arc_inter_trimmed_arc_subset_tip |
| 23 | {gamma : ℝ → AnnulusCoordinates} {T : ℝ} (hinj : InjOn gamma (Icc 0 T)) |
| 24 | (r : Bool → ℝ) (hr : ∀ e, 0 < r e) (hrT : ∀ e, r e ≤ T) (e : Bool) : |
| 25 | ((fun s => gamma (if e then T - s else s)) '' Icc 0 (r e)) ∩ |
| 26 | (gamma '' Icc (r false) (T - r true)) ⊆ |
| 27 | {gamma (if e then T - r e else r e)} := by |
| 28 | rintro z ⟨⟨s, hs, hsz⟩, t, ht, htz⟩ |
| 29 | have htT : t ∈ Icc (0 : ℝ) T := |
| 30 | ⟨(hr false).le.trans ht.1, ht.2.trans (sub_le_self T (hr true).le)⟩ |
| 31 | have hsT : (if e then T - s else s) ∈ Icc (0 : ℝ) T := by |
| 32 | cases e |
| 33 | · exact ⟨hs.1, hs.2.trans (hrT false)⟩ |
| 34 | · change T - s ∈ Icc (0 : ℝ) T |
| 35 | constructor <;> linarith [hs.1, hs.2, hrT true] |
| 36 | have heq := hinj hsT htT (hsz.trans htz.symm) |
| 37 | apply mem_singleton_iff.mpr |
| 38 | rw [← hsz] |
| 39 | apply congrArg gamma |
| 40 | cases e |
| 41 | · change s = r false |
| 42 | change s = t at heq |
| 43 | linarith [ht.1, hs.2] |
| 44 | · change T - s = T - r true |
| 45 | change T - s = t at heq |
| 46 | linarith [ht.2, hs.2] |
| 47 | |
| 48 | /-- The two original corner axes meet the trimmed first arc only at fitted tips; original |
| 49 | inter-arc disjointness excludes the other axis. Source: |
| 50 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-boundary-coverage-review.md`, round_1, |
| 51 | semantic check 14. -/ |
| 52 | theorem m64Intrinsic_corner_axes_inter_trimmed_arc_subset_tips |
| 53 | {alpha beta : ℝ → AnnulusCoordinates} {A B : ℝ} |
| 54 | (hai : InjOn alpha (Icc 0 A)) |
| 55 | (havoid : Disjoint (alpha '' Ioo 0 A) (beta '' Icc 0 B)) |
| 56 | (r : Bool → ℝ) (hr : ∀ e, 0 < r e) |
| 57 | (hrA : ∀ e, r e ≤ A) (hrB : ∀ e, r e ≤ B) (e : Bool) |
| 58 | (H : OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) |
| 59 | (haxis : ∀ s : ℝ, H (s, 0) = alpha (if e then A - s else s)) |
| 60 | (haxis' : ∀ s : ℝ, H (0, s) = beta (if e then B - s else s)) : |
| 61 | ((fun t : ℝ => H (0, t * r e)) '' Icc 0 1 ∪ |
| 62 | (fun t : ℝ => H (t * r e, 0)) '' Icc 0 1) ∩ |
| 63 | (alpha '' Icc (r false) (A - r true)) ⊆ {H (r e, 0), H (0, r e)} := by |
| 64 | rintro z ⟨haxes, hz⟩ |
| 65 | have hzopen : z ∈ alpha '' Ioo 0 A := by |
| 66 | apply image_mono _ hz |
| 67 | intro t ht |
| 68 | exact ⟨(hr false).trans_le ht.1, ht.2.trans_lt (sub_lt_self A (hr true))⟩ |
| 69 | rcases haxes with ⟨t, ht, htz⟩ | ⟨t, ht, htz⟩ |
| 70 | · have htr : t * r e ∈ Icc (0 : ℝ) (r e) := |
| 71 | ⟨mul_nonneg ht.1 (hr e).le, mul_le_of_le_one_left (hr e).le ht.2⟩ |
| 72 | have hp : (if e then B - t * r e else t * r e) ∈ Icc (0 : ℝ) B := by |
| 73 | cases e |
| 74 | · exact ⟨htr.1, htr.2.trans (hrB false)⟩ |
| 75 | · change B - t * r true ∈ Icc (0 : ℝ) B |
| 76 | constructor <;> linarith [htr.1, htr.2, hrB true] |
| 77 | exact False.elim (disjoint_left.mp havoid hzopen |
| 78 | ⟨_, hp, by simpa only [haxis'] using htz⟩) |
| 79 | · have htr : t * r e ∈ Icc (0 : ℝ) (r e) := |
| 80 | ⟨mul_nonneg ht.1 (hr e).le, mul_le_of_le_one_left (hr e).le ht.2⟩ |
| 81 | have hnear : z ∈ (fun s => alpha (if e then A - s else s)) '' Icc 0 (r e) := |
| 82 | ⟨t * r e, htr, by simpa only [haxis] using htz⟩ |
| 83 | have heq := mem_singleton_iff.mp |
| 84 | (m64Intrinsic_near_arc_inter_trimmed_arc_subset_tip hai r hr hrA e ⟨hnear, hz⟩) |
| 85 | exact Or.inl (heq.trans (haxis (r e)).symm) |
| 86 | |
| 87 | /-- Swapping the actual corner coordinates gives the corresponding fitted-tip contact |
| 88 | statement for the trimmed second arc. Source: |
| 89 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-boundary-coverage-review.md`, round_1, |
| 90 | semantic check 14. -/ |
| 91 | theorem m64Intrinsic_corner_axes_inter_other_trimmed_arc_subset_tips |
| 92 | {alpha beta : ℝ → AnnulusCoordinates} {A B : ℝ} |
| 93 | (hbi : InjOn beta (Icc 0 B)) |
| 94 | (havoid : Disjoint (beta '' Ioo 0 B) (alpha '' Icc 0 A)) |
| 95 | (r : Bool → ℝ) (hr : ∀ e, 0 < r e) |
| 96 | (hrA : ∀ e, r e ≤ A) (hrB : ∀ e, r e ≤ B) (e : Bool) |
| 97 | (H : OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) |
| 98 | (haxis : ∀ s : ℝ, H (s, 0) = alpha (if e then A - s else s)) |
| 99 | (haxis' : ∀ s : ℝ, H (0, s) = beta (if e then B - s else s)) : |
| 100 | ((fun t : ℝ => H (0, t * r e)) '' Icc 0 1 ∪ |
| 101 | (fun t : ℝ => H (t * r e, 0)) '' Icc 0 1) ∩ |
| 102 | (beta '' Icc (r false) (B - r true)) ⊆ {H (r e, 0), H (0, r e)} := by |
| 103 | let H' := (Homeomorph.prodComm ℝ ℝ).toOpenPartialHomeomorph.trans H |
| 104 | have h := m64Intrinsic_corner_axes_inter_trimmed_arc_subset_tips |
| 105 | hbi havoid r hr hrB hrA e H' haxis' haxis |
| 106 | change ((fun t : ℝ => H (t * r e, 0)) '' Icc 0 1 ∪ |
| 107 | (fun t : ℝ => H (0, t * r e)) '' Icc 0 1) ∩ |
| 108 | (beta '' Icc (r false) (B - r true)) ⊆ {H (0, r e), H (r e, 0)} at h |
| 109 | simpa only [union_comm, pair_comm] using h |
| 110 | |
| 111 | end PoincareMT |