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.Band.CutContacts |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Cap.BandGluing |
| 3 | |
| 4 | /-! |
| 5 | # Actual shared cuts at cap attachments |
| 6 | |
| 7 | Regular closedness forces cap-band contacts onto both frontiers. The |
| 8 | positive cut lies inside the Jordan region, hence on the cap chord. |
| 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 Manifold |
| 21 | open Poincare.Topology.Plane.Curves PoincareMT.Topology.Surface |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- If a set meets a regular closed set only on its frontier, the intersection also lies on |
| 26 | the frontier of the first set. Source: |
| 27 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-obstacle-bands-review.md`, round_1, check |
| 28 | 20. -/ |
| 29 | theorem m64Intrinsic_inter_subset_frontier_of_regular |
| 30 | {A B : Set AnnulusCoordinates} (hB : closure (interior B) = B) |
| 31 | (hinter : A ∩ B ⊆ frontier B) : A ∩ B ⊆ frontier A := by |
| 32 | have hd : Disjoint (interior A) (interior B) := by |
| 33 | apply disjoint_left.mpr |
| 34 | intro z hzA hzB |
| 35 | exact disjoint_left.mp disjoint_interior_frontier hzB |
| 36 | (hinter ⟨interior_subset hzA, interior_subset hzB⟩) |
| 37 | have hd' := hd.closure_right isOpen_interior |
| 38 | rw [hB] at hd' |
| 39 | exact fun _ hz => ⟨subset_closure hz.1, fun hint => disjoint_left.mp hd' hint hz.2⟩ |
| 40 | |
| 41 | section Band |
| 42 | |
| 43 | variable {F : OpenPartialHomeomorph AnnulusCoordinates AnnulusCoordinates} |
| 44 | {lo : ℝ → ℝ} {a b ua wa ub wb ra rb : ℝ} |
| 45 | (B : ObliqueBandFaces F lo a b ua wa ub wb ra rb) |
| 46 | |
| 47 | /-- The exact outer-cut intersections imply contact only on the cap frontier, even when one |
| 48 | band is attached at both ends. Source: |
| 49 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-obstacle-bands-review.md`, round_1, check |
| 50 | 20. -/ |
| 51 | theorem m64Intrinsic_band_cap_inter_subset_frontier |
| 52 | {C A : Set AnnulusCoordinates} (hAC : A ⊆ C) |
| 53 | (hinter : C ∩ B.carrier ⊆ B.leftCut ∪ B.rightCut) : |
| 54 | A ∩ B.carrier ⊆ frontier A := by |
| 55 | apply m64Intrinsic_inter_subset_frontier_of_regular B.closure_interior_carrier |
| 56 | intro z hz |
| 57 | apply B.outer_boundaries_subset_frontier |
| 58 | rcases hinter ⟨hAC hz.1, hz.2⟩ with hl | hr |
| 59 | · exact Or.inl (Or.inr hl) |
| 60 | · exact Or.inr hr |
| 61 | |
| 62 | /-- A sufficiently short actual cut lies on the unique cap chord. The open part avoids the |
| 63 | original loop because it lies inside the region. Source: |
| 64 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-obstacle-bands-review.md`, round_1, check |
| 65 | 20. -/ |
| 66 | theorem m64Intrinsic_cap_attachment_cut_subset_chord |
| 67 | (face : SmoothFace AnnulusCoordinates) (right : Bool) |
| 68 | {U K C N : Set AnnulusCoordinates} |
| 69 | (hregion : B.carrier \ B.lowerArc ⊆ U) (hdisj : Disjoint U K) |
| 70 | (hface : face.carrier ⊆ C) |
| 71 | (hinter : C ∩ B.carrier ⊆ B.leftCut ∪ B.rightCut) |
| 72 | (hselected : N ∩ C ⊆ face.carrier) |
| 73 | (hfront : N ∩ frontier face.carrier ⊆ K ∪ (face.boundary 0).map '' Icc (0 : ℝ) 1) |
| 74 | (hcutN : (B.endpointEdge right).map '' Icc (0 : ℝ) 1 ⊆ N) |
| 75 | (hcutC : (B.endpointEdge right).map '' Icc (0 : ℝ) 1 ⊆ C) |
| 76 | (hbase : (B.endpointEdge right).map 0 ∈ (face.boundary 0).map '' Icc (0 : ℝ) 1) : |
| 77 | (B.endpointEdge right).map '' Icc (0 : ℝ) 1 ⊆ |
| 78 | (face.boundary 0).map '' Icc (0 : ℝ) 1 := by |
| 79 | rintro z ⟨t, ht, rfl⟩ |
| 80 | by_cases ht0 : t = 0 |
| 81 | · exact ht0 ▸ hbase |
| 82 | have hzN := hcutN ⟨t, ht, rfl⟩ |
| 83 | have hzC := hcutC ⟨t, ht, rfl⟩ |
| 84 | have hzB := B.isClosed_carrier.frontier_subset |
| 85 | (B.endpointEdge_subset_frontier right ⟨t, ht, rfl⟩) |
| 86 | have hzfront := m64Intrinsic_band_cap_inter_subset_frontier B hface hinter |
| 87 | ⟨hselected ⟨hzN, hzC⟩, hzB⟩ |
| 88 | apply (hfront ⟨hzN, hzfront⟩).resolve_left |
| 89 | intro hzK |
| 90 | exact disjoint_left.mp hdisj (m64Intrinsic_band_positive_endpoint_subset_region B right |
| 91 | hregion ⟨t, ⟨lt_of_le_of_ne ht.1 (Ne.symm ht0), ht.2⟩, rfl⟩) hzK |
| 92 | |
| 93 | /-- A cap chord and an actual band cut cancel their whole open common part. The unequal |
| 94 | endpoint condition is supplied by the constructed attachment neighborhood, not by an |
| 95 | unproved gluing certificate. Source: |
| 96 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-obstacle-bands-review.md`, round_1, check |
| 97 | 20. -/ |
| 98 | theorem m64Intrinsic_cap_attachment_open_cut_interior |
| 99 | (face : SmoothFace AnnulusCoordinates) |
| 100 | (C : OpenPartialHomeomorph AnnulusCoordinates AnnulusCoordinates) |
| 101 | (basis : AffineBasis (Fin 3) ℝ AnnulusCoordinates) |
| 102 | (hsource : convexHull ℝ (range basis) ⊆ C.source) |
| 103 | (hcarrier : face.carrier = C '' convexHull ℝ (range basis)) |
| 104 | (hboundary : ∀ k : Fin 3, (face.boundary k).map = C ∘ |
| 105 | affineChartSegment (basis (k.succAbove 0)) (basis (k.succAbove 1))) |
| 106 | (right terminal : Bool) {N : Set AnnulusCoordinates} |
| 107 | (hbase : (B.endpointEdge right).map 0 = |
| 108 | (face.boundary 0).map (if terminal then 1 else 0)) |
| 109 | (hfar : (face.boundary 0).map (if terminal then 0 else 1) ∉ N) |
| 110 | (hcutN : (B.endpointEdge right).map '' Icc (0 : ℝ) 1 ⊆ N) |
| 111 | (hshared : (B.endpointEdge right).map '' Icc (0 : ℝ) 1 ⊆ |
| 112 | (face.boundary 0).map '' Icc (0 : ℝ) 1) |
| 113 | (hinter : face.carrier ∩ B.carrier ⊆ frontier face.carrier) : |
| 114 | (B.endpointEdge right).map '' Ioo (0 : ℝ) 1 ⊆ interior (face.carrier ∪ B.carrier) := by |
| 115 | rintro z ⟨u, hu, rfl⟩ |
| 116 | have hzN := hcutN ⟨u, Ioo_subset_Icc_self hu, rfl⟩ |
| 117 | obtain ⟨t, ht, htu⟩ := hshared ⟨u, Ioo_subset_Icc_self hu, rfl⟩ |
| 118 | have hbaseNe : (B.endpointEdge right).map u ≠ (B.endpointEdge right).map 0 := by |
| 119 | intro heq |
| 120 | exact hu.1.ne' (B.endpointEdge_injective right (Ioo_subset_Icc_self hu) |
| 121 | (by norm_num) heq) |
| 122 | have ht0 : t ≠ 0 := by |
| 123 | intro ht0 |
| 124 | rw [ht0] at htu |
| 125 | cases terminal |
| 126 | · exact hbaseNe (htu.symm.trans hbase.symm) |
| 127 | · exact hfar (htu.symm ▸ hzN) |
| 128 | have ht1 : t ≠ 1 := by |
| 129 | intro ht1 |
| 130 | rw [ht1] at htu |
| 131 | cases terminal |
| 132 | · exact hfar (htu.symm ▸ hzN) |
| 133 | · exact hbaseNe (htu.symm.trans hbase.symm) |
| 134 | rw [← htu] |
| 135 | exact m64Intrinsic_cap_band_attachment_interior face C basis hsource hcarrier hboundary |
| 136 | B 0 right ⟨lt_of_le_of_ne ht.1 (Ne.symm ht0), lt_of_le_of_ne ht.2 ht1⟩ hu |
| 137 | htu hshared hinter |
| 138 | |
| 139 | end Band |
| 140 | |
| 141 | end PoincareMT |