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.Short.AttachmentRays |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Two.ArcAttachmentNeighborhood |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Arc.CapBandEndpointCoverage |
| 4 | |
| 5 | /-! |
| 6 | # A positive cut length for cap-band coverage on either boundary arc |
| 7 | |
| 8 | The signed caps construct the attachment neighborhood. A bound on the |
| 9 | actual endpoint ray is chosen before the band. Exact outer-cut contacts |
| 10 | then supply every shared-chord and local-frontier input of the join proof. |
| 11 | |
| 12 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481, including Claim 19.40, |
| 13 | pp. 470-471. These project constructions supply actual occupied boundary collars |
| 14 | and attachment coverage for the regional Gauss--Bonnet argument. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set |
| 22 | open scoped Topology ContDiff Manifold |
| 23 | open Poincare.Topology.Plane.Curves PoincareMT.Topology.Surface |
| 24 | open ChartCircleArrangementVertexPatch |
| 25 | |
| 26 | namespace PoincareMT |
| 27 | |
| 28 | /-- The actual retained cap family gives a positive cut-length bound at either attachment. |
| 29 | Every shorter actual band with the retained contacts fills the Jordan closure near that |
| 30 | join. Source: `proof-work/tasks/M64/reports/2026-09-24-short-cap-band-join.md`. -/ |
| 31 | theorem m64Intrinsic_exists_arc_short_cap_band_join_length |
| 32 | {gamma : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) {T r : ℝ} |
| 33 | (hr : 0 < r) (hrT : r < T) |
| 34 | (hinj : InjOn gamma (Icc 0 T)) |
| 35 | (hregular : ∀ t ∈ Ioo (0 : ℝ) T, deriv gamma t ≠ 0) |
| 36 | {K U V : Set AnnulusCoordinates} (hK : IsCompact K) |
| 37 | (havoid : ∀ t ∈ Ioo (0 : ℝ) T, gamma t ∉ K) |
| 38 | (hU : IsOpen U) (hV : IsOpen V) (hdisj : Disjoint U V) |
| 39 | (hfU : frontier U = gamma '' Icc 0 T ∪ K) |
| 40 | (hfV : frontier V = gamma '' Icc 0 T ∪ K) |
| 41 | (H : OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) |
| 42 | (F : Bool × Bool → OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) |
| 43 | (hsource : ∀ i, |
| 44 | {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} ⊆ (F i).source) |
| 45 | (hF : ∀ i, ContDiffOn ℝ ∞ (F i) (F i).source) |
| 46 | (hFi : ∀ i, ContDiffOn ℝ ∞ (F i).symm (F i).target) |
| 47 | (hfirst : ∀ i, ∀ s ∈ Icc (0 : ℝ) r, |
| 48 | F i (s, 0) = H (sectorParameterEquiv 0 i (s, 0))) |
| 49 | (hsecond : ∀ i, ∀ s ∈ Icc (0 : ℝ) r, |
| 50 | F i (0, s) = H (sectorParameterEquiv 0 i (0, s))) |
| 51 | (hchord : ∀ i t, F i ((1 - t) * r, t * r) = |
| 52 | (1 - t) • F i (r, 0) + t • F i (0, r)) |
| 53 | (hsector : ∀ i, |
| 54 | F i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} ⊆ |
| 55 | H '' (H.source ∩ (sectorParameterEquiv 0 i) '' |
| 56 | {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2})) |
| 57 | (positive terminal vertical : Bool) |
| 58 | (haxis : ∀ s : ℝ, H (if vertical then (0, s) else (s, 0)) = |
| 59 | gamma (if terminal then T - s else s)) |
| 60 | (htipSource : (if vertical then ((0 : ℝ), r) else (r, 0)) ∈ H.source) |
| 61 | (d : AnnulusCoordinates) |
| 62 | (hcapRegion : (⋃ i, ⋃ (_ : if positive then i = (true, true) else i ≠ (true, true)), |
| 63 | F i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r}) ⊆ closure U) : |
| 64 | let selected := if vertical then (positive, true) else (true, positive) |
| 65 | let cap := F selected '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} |
| 66 | let caps := ⋃ i, ⋃ (_ : if positive then i = (true, true) else i ≠ (true, true)), |
| 67 | F i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} |
| 68 | ∃ delta > 0, ∀ ell : ℝ, 0 < ell → ell ≤ delta → |
| 69 | ∀ (L : (ℝ × ℝ) ≃L[ℝ] AnnulusCoordinates) |
| 70 | (lo : ℝ → ℝ) (a b ua wa ub wb ra rb : ℝ) |
| 71 | (B : ObliqueBandFaces |
| 72 | (collarParameterEquiv.trans L).toHomeomorph.toOpenPartialHomeomorph |
| 73 | lo a b ua wa ub wb ra rb), |
| 74 | (B.endpointEdge terminal).map 0 = gamma (if terminal then T - r else r) → |
| 75 | (B.endpointEdge terminal).map '' Icc (0 : ℝ) 1 = |
| 76 | (fun u : ℝ => gamma (if terminal then T - r else r) + u • d) '' Icc 0 ell → |
| 77 | (B.endpointEdge terminal).map '' Icc (0 : ℝ) 1 ⊆ caps → |
| 78 | caps ∩ B.carrier ⊆ B.leftCut ∪ B.rightCut → |
| 79 | B.carrier ⊆ closure U → B.carrier \ B.lowerArc ⊆ U → |
| 80 | B.lowerArc ⊆ gamma '' Icc 0 T → |
| 81 | ∃ W : Set AnnulusCoordinates, IsOpen W ∧ |
| 82 | gamma (if terminal then T - r else r) ∈ W ∧ W ∩ closure U ⊆ cap ∪ B.carrier := by |
| 83 | classical |
| 84 | dsimp only |
| 85 | let selected := if vertical then (positive, true) else (true, positive) |
| 86 | let caps := ⋃ i, ⋃ (_ : if positive then i = (true, true) else i ≠ (true, true)), |
| 87 | F i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} |
| 88 | have hselectedOccupied : |
| 89 | if positive then selected = (true, true) else selected ≠ (true, true) := by |
| 90 | cases positive <;> cases vertical <;> simp [selected] |
| 91 | have hselectedSub : (F selected '' |
| 92 | {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r}) ⊆ caps := |
| 93 | fun _ hz => mem_iUnion.mpr ⟨selected, mem_iUnion.mpr ⟨hselectedOccupied, hz⟩⟩ |
| 94 | obtain ⟨N, hN, hpN, hselectN, hfrontN, hfarN⟩ := |
| 95 | m64Intrinsic_exists_arc_cap_attachment_neighborhood hr hrT H F |
| 96 | hsource hF hFi hfirst hsecond hsector positive terminal vertical haxis htipSource |
| 97 | obtain ⟨delta, hdelta, hshort⟩ := |
| 98 | m64Intrinsic_exists_short_ray_in_neighborhood (gamma (if terminal then T - r else r)) d hN hpN |
| 99 | obtain ⟨face, hc, hz, _, _, D, basis, _, _, hs, hcarrier, hboundary⟩ := |
| 100 | m64Intrinsic_exists_coordinate_face_of_chosen_cap (F selected) hr |
| 101 | (hsource selected) (hF selected) (hFi selected) |
| 102 | have hfaceSub : face.carrier ⊆ caps := hc ▸ hselectedSub |
| 103 | have hchordFace (t : ℝ) : (face.boundary 0).map t = |
| 104 | (1 - t) • (face.boundary 0).map 0 + t • (face.boundary 0).map 1 := by |
| 105 | rw [hz t, hz 0, hz 1] |
| 106 | simpa only [sub_zero, one_mul, zero_mul, sub_self] using hchord selected t |
| 107 | have htip : (face.boundary 0).map (if vertical then 1 else 0) = |
| 108 | gamma (if terminal then T - r else r) := by |
| 109 | rw [hz] |
| 110 | cases vertical |
| 111 | · calc |
| 112 | F selected ((1 - 0) * r, 0 * r) = H (r, 0) := by |
| 113 | simpa [selected, sectorParameterEquiv_apply] using |
| 114 | hfirst (true, positive) r ⟨hr.le, le_rfl⟩ |
| 115 | _ = gamma (if terminal then T - r else r) := haxis r |
| 116 | · calc |
| 117 | F selected ((1 - 1) * r, 1 * r) = H (0, r) := by |
| 118 | simpa [selected, sectorParameterEquiv_apply] using |
| 119 | hsecond (positive, true) r ⟨hr.le, le_rfl⟩ |
| 120 | _ = gamma (if terminal then T - r else r) := haxis r |
| 121 | have hfar : (face.boundary 0).map (if vertical then 0 else 1) ∉ N := by |
| 122 | rw [hz] |
| 123 | cases vertical <;> simpa only [selected, ↓reduceIte, Bool.false_eq_true, sub_zero, |
| 124 | one_mul, zero_mul, sub_self] using hfarN |
| 125 | have hfront : N ∩ frontier face.carrier ⊆ gamma '' Icc 0 T ∪ |
| 126 | (face.boundary 0).map '' Icc (0 : ℝ) 1 := by |
| 127 | rw [hc] |
| 128 | rw [show (face.boundary 0).map = |
| 129 | (fun t : ℝ => F selected ((1 - t) * r, t * r)) from funext hz] |
| 130 | exact hfrontN |
| 131 | have hp : (if terminal then T - r else r) ∈ Ioo (0 : ℝ) T := by |
| 132 | cases terminal |
| 133 | · exact ⟨hr, hrT⟩ |
| 134 | · exact ⟨sub_pos.mpr hrT, sub_lt_self T hr⟩ |
| 135 | have hloopdisj : Disjoint U (gamma '' Icc 0 T) := by |
| 136 | have h : Disjoint (interior U) (frontier U) := disjoint_interior_frontier |
| 137 | have h' : Disjoint U (gamma '' Icc 0 T ∪ K) := by |
| 138 | simpa only [hU.interior_eq, hfU] using h |
| 139 | exact h'.mono_right subset_union_left |
| 140 | refine ⟨delta, hdelta, ?_⟩ |
| 141 | intro ell _ hell L lo a b ua wa ub wb ra rb B hpbase hcut hcutCaps hinter hBU hBregion hlower |
| 142 | have hcutN : (B.endpointEdge terminal).map '' Icc (0 : ℝ) 1 ⊆ N := by |
| 143 | rw [hcut] |
| 144 | exact (image_mono (Icc_subset_Icc le_rfl hell)).trans hshort |
| 145 | have hbaseEdge : (B.endpointEdge terminal).map 0 = |
| 146 | (face.boundary 0).map (if vertical then 1 else 0) := hpbase.trans htip.symm |
| 147 | have hshared := m64Intrinsic_cap_attachment_cut_subset_chord B face terminal hBregion |
| 148 | hloopdisj hfaceSub hinter (hc ▸ hselectN) hfront hcutN hcutCaps |
| 149 | ⟨if vertical then 1 else 0, by cases vertical <;> norm_num, hbaseEdge.symm⟩ |
| 150 | have hinterFace := m64Intrinsic_band_cap_inter_subset_frontier B hfaceSub hinter |
| 151 | obtain ⟨W, hW, hpW, hcover⟩ := m64Intrinsic_arc_cap_band_endpoint_covers_region hg hinj |
| 152 | hregular hp hK (havoid _ hp) hU hV hdisj hfU hfV |
| 153 | face D basis hs hcarrier hboundary hchordFace L B |
| 154 | terminal vertical hbaseEdge hpbase (hfaceSub.trans hcapRegion) hBU hlower hinterFace |
| 155 | hN hpN hfront hfar hcutN hshared |
| 156 | exact ⟨W, hW, hpW, hc ▸ hcover⟩ |
| 157 | |
| 158 | end PoincareMT |