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.Loop.CapContacts |
| 2 | |
| 3 | /-! |
| 4 | # Unique occupied cap at each retained loop endpoint |
| 5 | |
| 6 | The two signed sectors adjacent to an original axis determine the inverse |
| 7 | coordinate of its endpoint. Embeddedness excludes the vertex, so no cap |
| 8 | on the opposite side can contain that endpoint. |
| 9 | |
| 10 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481, including Claim 19.40, |
| 11 | pp. 470-471. These project constructions provide actual fitted boundary pieces and |
| 12 | contacts for the regional Gauss--Bonnet arguments. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Topology ContDiff |
| 21 | open PoincareMT.Topology.Surface ChartCircleArrangementVertexPatch |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- The actual signed cap family has a unique occupied cap at either retained endpoint, |
| 26 | including a reflex corner with three occupied caps. Source: |
| 27 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-obstacle-bands-review.md`, round_1, check |
| 28 | 4. -/ |
| 29 | theorem m64Intrinsic_loop_cap_tip_unique |
| 30 | {gamma : ℝ → AnnulusCoordinates} {T r : ℝ} (hr : 0 < r) (hrT : r < T) |
| 31 | (hinj : InjOn gamma (Ico 0 T)) |
| 32 | (H : OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) (hbase : H 0 = gamma 0) |
| 33 | (haxis : ∀ s : ℝ, H (s, 0) = gamma s) |
| 34 | (haxis' : ∀ s : ℝ, H (0, s) = gamma (T - s)) |
| 35 | (F : Bool × Bool → OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) |
| 36 | (hfirst : ∀ i, ∀ s ∈ Icc (0 : ℝ) r, F i (s, 0) = H (sectorParameterEquiv 0 i (s, 0))) |
| 37 | (hsecond : ∀ i, ∀ s ∈ Icc (0 : ℝ) r, F i (0, s) = H (sectorParameterEquiv 0 i (0, s))) |
| 38 | (hsector : ∀ i, |
| 39 | F i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} ⊆ |
| 40 | H '' (H.source ∩ (sectorParameterEquiv 0 i) '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2})) |
| 41 | (positive terminal : Bool) : |
| 42 | ∀ i : Bool × Bool, (if positive then i = (true, true) else i ≠ (true, true)) → |
| 43 | gamma (if terminal then T - r else r) ∈ |
| 44 | F i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} → |
| 45 | i = if terminal then (positive, true) else (true, positive) := by |
| 46 | let C (i : Bool × Bool) := |
| 47 | F i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} |
| 48 | let p := if terminal then T - r else r |
| 49 | let q := H.symm (gamma p) |
| 50 | have hcoordinates (i : Bool × Bool) (hz : gamma p ∈ C i) : |
| 51 | (if i.1 then 0 ≤ q.1 else q.1 ≤ 0) ∧ |
| 52 | (if i.2 then 0 ≤ q.2 else q.2 ≤ 0) := by |
| 53 | obtain ⟨_, ⟨hs, u, hu, rfl⟩, heq⟩ := hsector i hz |
| 54 | have hq : q = sectorParameterEquiv 0 i u := by |
| 55 | change H.symm (gamma p) = _ |
| 56 | rw [← heq, H.left_inv hs] |
| 57 | rw [hq] |
| 58 | rcases i with ⟨i, j⟩ |
| 59 | cases i <;> cases j <;> simp [sectorParameterEquiv_apply, hu.1, hu.2] |
| 60 | have htip : gamma p ∈ C (true, true) := by |
| 61 | cases terminal |
| 62 | · refine ⟨(r, 0), ⟨hr.le, le_rfl, by simp⟩, ?_⟩ |
| 63 | simpa [p, sectorParameterEquiv_apply, haxis] using hfirst (true, true) r ⟨hr.le, le_rfl⟩ |
| 64 | · refine ⟨(0, r), ⟨le_rfl, hr.le, by simp⟩, ?_⟩ |
| 65 | simpa [p, sectorParameterEquiv_apply, haxis'] using hsecond (true, true) r ⟨hr.le, le_rfl⟩ |
| 66 | have hqpos : 0 ≤ q.1 ∧ 0 ≤ q.2 := hcoordinates (true, true) htip |
| 67 | have hptarget : gamma p ∈ H.target := by |
| 68 | obtain ⟨u, hu, heq⟩ := hsector (true, true) htip |
| 69 | exact heq ▸ H.map_source hu.1 |
| 70 | have hp : p ∈ Ioo (0 : ℝ) T := by |
| 71 | cases terminal |
| 72 | · exact ⟨hr, hrT⟩ |
| 73 | · exact ⟨sub_pos.mpr hrT, sub_lt_self T hr⟩ |
| 74 | have hqne : q ≠ 0 := by |
| 75 | intro hzero |
| 76 | have heq : gamma p = gamma 0 := by |
| 77 | rw [← H.right_inv hptarget] |
| 78 | change H q = gamma 0 |
| 79 | rw [hzero, hbase] |
| 80 | have hpzero := hinj ⟨hp.1.le, hp.2⟩ ⟨le_rfl, hp.1.trans hp.2⟩ heq |
| 81 | exact hp.1.ne' hpzero |
| 82 | intro i hi hmember |
| 83 | cases positive |
| 84 | · have hci := hcoordinates i hmember |
| 85 | cases terminal |
| 86 | · have hother : gamma p ∈ C (true, false) := by |
| 87 | refine ⟨(r, 0), ⟨hr.le, le_rfl, by simp⟩, ?_⟩ |
| 88 | simpa [p, sectorParameterEquiv_apply, haxis] using hfirst (true, false) r ⟨hr.le, le_rfl⟩ |
| 89 | have hq2 : q.2 = 0 := le_antisymm (hcoordinates (true, false) hother).2 hqpos.2 |
| 90 | have hq1 : 0 < q.1 := lt_of_le_of_ne hqpos.1 (fun heq => hqne (Prod.ext heq.symm hq2)) |
| 91 | rcases i with ⟨i, j⟩ |
| 92 | cases i <;> cases j <;> simp_all <;> linarith |
| 93 | · have hother : gamma p ∈ C (false, true) := by |
| 94 | refine ⟨(0, r), ⟨le_rfl, hr.le, by simp⟩, ?_⟩ |
| 95 | simpa [p, sectorParameterEquiv_apply, haxis'] using hsecond (false, true) r ⟨hr.le, le_rfl⟩ |
| 96 | have hq1 : q.1 = 0 := le_antisymm (hcoordinates (false, true) hother).1 hqpos.1 |
| 97 | have hq2 : 0 < q.2 := lt_of_le_of_ne hqpos.2 (fun heq => hqne (Prod.ext hq1 heq.symm)) |
| 98 | rcases i with ⟨i, j⟩ |
| 99 | cases i <;> cases j <;> simp_all <;> linarith |
| 100 | · cases terminal <;> exact hi |
| 101 | |
| 102 | end PoincareMT |