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.Two.ArcRegion |
| 2 | |
| 3 | /-! |
| 4 | # A simple closed loop through two actual embedded arcs |
| 5 | |
| 6 | Positive parameter intervals rescale to the unit interval. Following the |
| 7 | first arc and then the reverse of the second gives a continuous loop on |
| 8 | the double unit interval, injective before its closing endpoint. Its image |
| 9 | is exactly the union of the two original arc images. |
| 10 | |
| 11 | Context: Morgan--Tian Lemma 19.46, printed pp. 474-478; the actual two-arc |
| 12 | construction and retention of its original joins are recorded below. |
| 13 | Source/construction: |
| 14 | proof-work/tasks/M64/derivations/2026-09-25-two-arc-region-curvature.md. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open Set |
| 21 | open scoped Topology |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | private theorem exists_unit_loop_between_arcs |
| 26 | {alpha beta : ℝ → AnnulusCoordinates} |
| 27 | (halpha : ContinuousOn alpha (Icc 0 1)) (hbeta : ContinuousOn beta (Icc 0 1)) |
| 28 | (halphaInj : InjOn alpha (Icc 0 1)) (hbetaInj : InjOn beta (Icc 0 1)) |
| 29 | (h0 : alpha 0 = beta 0) (hend : alpha 1 = beta 1) |
| 30 | (hmeet : ∀ s ∈ Icc 0 1, ∀ t ∈ Icc 0 1, |
| 31 | alpha s = beta t → (s = 0 ∧ t = 0) ∨ (s = 1 ∧ t = 1)) : |
| 32 | ∃ loop : ℝ → AnnulusCoordinates, |
| 33 | ContinuousOn loop (Icc 0 2) ∧ loop 0 = loop 2 ∧ InjOn loop (Ico 0 2) ∧ |
| 34 | loop '' Icc 0 2 = alpha '' Icc 0 1 ∪ beta '' Icc 0 1 := by |
| 35 | classical |
| 36 | let loop : ℝ → AnnulusCoordinates := fun t => if t ≤ 1 then alpha t else beta (2 - t) |
| 37 | have hcont : ContinuousOn loop (Icc 0 2) := by |
| 38 | apply ContinuousOn.if |
| 39 | · intro t ht |
| 40 | have ht' : t = 1 := by |
| 41 | have h := ht.2 |
| 42 | change t ∈ frontier (Iic (1 : ℝ)) at h |
| 43 | simpa only [frontier_Iic, mem_singleton_iff] using h |
| 44 | subst t |
| 45 | convert hend using 1 |
| 46 | norm_num |
| 47 | · apply halpha.mono |
| 48 | intro t ht |
| 49 | exact ⟨ht.1.1, by simpa only [show {a : ℝ | a ≤ 1} = Iic 1 from rfl, |
| 50 | isClosed_Iic.closure_eq, mem_Iic] using ht.2⟩ |
| 51 | · apply hbeta.comp (continuous_const.sub continuous_id).continuousOn |
| 52 | intro t ht |
| 53 | have ht1 : 1 ≤ t := by |
| 54 | have h := ht.2 |
| 55 | simp only [not_le] at h |
| 56 | change t ∈ closure (Ioi (1 : ℝ)) at h |
| 57 | simpa only [closure_Ioi, mem_Ici] using h |
| 58 | change 2 - t ∈ Icc 0 1 |
| 59 | exact ⟨by linarith [ht.1.2], by linarith⟩ |
| 60 | have hstart : loop 0 = alpha 0 := by norm_num [loop] |
| 61 | have hfinish : loop 2 = beta 0 := by norm_num [loop] |
| 62 | have hclosed : loop 0 = loop 2 := hstart.trans (h0.trans hfinish.symm) |
| 63 | have hinj : InjOn loop (Ico 0 2) := by |
| 64 | intro s hs t ht heq |
| 65 | wlog hst : s ≤ t generalizing s t |
| 66 | · exact (this ht hs heq.symm (le_of_not_ge hst)).symm |
| 67 | by_cases ht1 : t ≤ 1 |
| 68 | · have hs1 : s ≤ 1 := hst.trans ht1 |
| 69 | apply halphaInj ⟨hs.1, hs1⟩ ⟨ht.1, ht1⟩ |
| 70 | simpa only [loop, if_pos hs1, if_pos ht1] using heq |
| 71 | · by_cases hs1 : s ≤ 1 |
| 72 | · have h := hmeet s ⟨hs.1, hs1⟩ (2 - t) |
| 73 | ⟨by linarith [ht.2], by linarith⟩ |
| 74 | (by simpa only [loop, if_pos hs1, if_neg ht1] using heq) |
| 75 | rcases h with ⟨_, ht0⟩ | ⟨_, ht'⟩ |
| 76 | · linarith [ht.2] |
| 77 | · linarith |
| 78 | · have h := hbetaInj (x₁ := 2 - s) (x₂ := 2 - t) |
| 79 | ⟨by linarith [hs.2], by linarith⟩ |
| 80 | ⟨by linarith [ht.2], by linarith⟩ |
| 81 | (by simpa only [loop, if_neg hs1, if_neg ht1] using heq) |
| 82 | linarith |
| 83 | have himage : loop '' Icc 0 2 = alpha '' Icc 0 1 ∪ beta '' Icc 0 1 := by |
| 84 | apply Subset.antisymm |
| 85 | · rintro p ⟨t, ht, rfl⟩ |
| 86 | by_cases ht1 : t ≤ 1 |
| 87 | · exact Or.inl ⟨t, ⟨ht.1, ht1⟩, (if_pos ht1).symm⟩ |
| 88 | · exact Or.inr ⟨2 - t, ⟨by linarith [ht.2], by linarith⟩, (if_neg ht1).symm⟩ |
| 89 | · rintro p (⟨t, ht, rfl⟩ | ⟨t, ht, rfl⟩) |
| 90 | · exact ⟨t, ⟨ht.1, by linarith [ht.2]⟩, if_pos ht.2⟩ |
| 91 | · refine ⟨2 - t, ⟨by linarith [ht.2], by linarith [ht.1]⟩, ?_⟩ |
| 92 | by_cases ht1 : t = 1 |
| 93 | · subst t |
| 94 | norm_num [loop] |
| 95 | exact hend |
| 96 | · have htlt : t < 1 := lt_of_le_of_ne ht.2 ht1 |
| 97 | rw [show loop (2 - t) = beta (2 - (2 - t)) from if_neg (by linarith)] |
| 98 | congr 1 |
| 99 | ring |
| 100 | exact ⟨loop, hcont, hclosed, hinj, himage⟩ |
| 101 | |
| 102 | /-- Two embedded continuous arcs on positive intervals, meeting only at their corresponding |
| 103 | endpoints, supply an actual simple closed loop. The closed image is exactly the union of the |
| 104 | original unscaled arc images. Source/construction: |
| 105 | proof-work/tasks/M64/derivations/2026-09-25-two-arc-region-curvature.md. -/ |
| 106 | theorem m64Intrinsic_exists_simple_loop_between_arcs |
| 107 | {alpha beta : ℝ → AnnulusCoordinates} {A B : ℝ} (hA : 0 < A) (hB : 0 < B) |
| 108 | (halpha : ContinuousOn alpha (Icc 0 A)) (hbeta : ContinuousOn beta (Icc 0 B)) |
| 109 | (halphaInj : InjOn alpha (Icc 0 A)) (hbetaInj : InjOn beta (Icc 0 B)) |
| 110 | (h0 : alpha 0 = beta 0) (hend : alpha A = beta B) |
| 111 | (hmeet : ∀ s ∈ Icc 0 A, ∀ t ∈ Icc 0 B, |
| 112 | alpha s = beta t → (s = 0 ∧ t = 0) ∨ (s = A ∧ t = B)) : |
| 113 | ∃ loop : ℝ → AnnulusCoordinates, |
| 114 | ContinuousOn loop (Icc 0 2) ∧ loop 0 = loop 2 ∧ InjOn loop (Ico 0 2) ∧ |
| 115 | loop '' Icc 0 2 = alpha '' Icc 0 A ∪ beta '' Icc 0 B := by |
| 116 | let alphaUnit : ℝ → AnnulusCoordinates := fun s => alpha (A * s) |
| 117 | let betaUnit : ℝ → AnnulusCoordinates := fun s => beta (B * s) |
| 118 | have hscale {C : ℝ} (hC : 0 < C) {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : |
| 119 | C * s ∈ Icc 0 C := |
| 120 | ⟨mul_nonneg hC.le hs.1, by nlinarith [hs.2]⟩ |
| 121 | have halphaUnit : ContinuousOn alphaUnit (Icc 0 1) := |
| 122 | halpha.comp (continuous_const.mul continuous_id).continuousOn (fun _ hs => hscale hA hs) |
| 123 | have hbetaUnit : ContinuousOn betaUnit (Icc 0 1) := |
| 124 | hbeta.comp (continuous_const.mul continuous_id).continuousOn (fun _ hs => hscale hB hs) |
| 125 | have halphaUnitInj : InjOn alphaUnit (Icc 0 1) := by |
| 126 | intro s hs t ht heq |
| 127 | exact mul_left_cancel₀ hA.ne' (halphaInj (hscale hA hs) (hscale hA ht) heq) |
| 128 | have hbetaUnitInj : InjOn betaUnit (Icc 0 1) := by |
| 129 | intro s hs t ht heq |
| 130 | exact mul_left_cancel₀ hB.ne' (hbetaInj (hscale hB hs) (hscale hB ht) heq) |
| 131 | have hunit0 : alphaUnit 0 = betaUnit 0 := by simpa only [alphaUnit, betaUnit, mul_zero] using h0 |
| 132 | have hunit1 : alphaUnit 1 = betaUnit 1 := by simpa only [alphaUnit, betaUnit, mul_one] using hend |
| 133 | have hunitMeet : ∀ s ∈ Icc 0 1, ∀ t ∈ Icc 0 1, |
| 134 | alphaUnit s = betaUnit t → (s = 0 ∧ t = 0) ∨ (s = 1 ∧ t = 1) := by |
| 135 | intro s hs t ht heq |
| 136 | rcases hmeet (A * s) (hscale hA hs) (B * t) (hscale hB ht) heq with h | h |
| 137 | · exact Or.inl ⟨(mul_eq_zero.mp h.1).resolve_left hA.ne', |
| 138 | (mul_eq_zero.mp h.2).resolve_left hB.ne'⟩ |
| 139 | · exact Or.inr ⟨by nlinarith [h.1], by nlinarith [h.2]⟩ |
| 140 | have hscaleImage (f : ℝ → AnnulusCoordinates) {C : ℝ} (hC : 0 < C) : |
| 141 | (fun s => f (C * s)) '' Icc (0 : ℝ) 1 = f '' Icc 0 C := by |
| 142 | apply Subset.antisymm |
| 143 | · rintro p ⟨s, hs, rfl⟩ |
| 144 | exact ⟨C * s, hscale hC hs, rfl⟩ |
| 145 | · rintro p ⟨s, hs, rfl⟩ |
| 146 | refine ⟨s / C, ⟨div_nonneg hs.1 hC.le, (div_le_one hC).mpr hs.2⟩, ?_⟩ |
| 147 | field_simp |
| 148 | obtain ⟨loop, hcont, hclosed, hinj, himage⟩ := |
| 149 | exists_unit_loop_between_arcs halphaUnit hbetaUnit halphaUnitInj hbetaUnitInj |
| 150 | hunit0 hunit1 hunitMeet |
| 151 | refine ⟨loop, hcont, hclosed, hinj, ?_⟩ |
| 152 | exact himage.trans (congrArg₂ (· ∪ ·) (hscaleImage alpha hA) (hscaleImage beta hB)) |
| 153 | |
| 154 | end PoincareMT |