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.Nested.JoinedBands |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Straight.JoinBandCoverage |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Arc.BandInteriorCoverage |
| 4 | |
| 5 | /-! Rebuilt joined patches retain actual occupation and original-arc |
| 6 | coverage for every sufficiently small choice of physical cuts. |
| 7 | Source: MT Claim 19.40, pp. 470-471; cap-patch-chain derivation, Section 11. -/ |
| 8 | |
| 9 | noncomputable section |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set |
| 14 | open scoped Topology ContDiff Manifold |
| 15 | open Poincare.Topology.Plane.Curves PoincareMT.Topology.Surface |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | /-- Nesting the auxiliary patch preserves coverage on both original arc pieces, including |
| 20 | their C1 straight join. Source: MT Claim 19.40, pp. 470-471; cap-patch-chain derivation, |
| 21 | Section 11. Source: |
| 22 | `proof-work/tasks/M64/derivations/2026-09-27-cap-patch-chain-assembly.md`, Section 11. -/ |
| 23 | theorem m64Intrinsic_exists_nested_covered_join_patch |
| 24 | {alpha beta : ℝ → AnnulusCoordinates} |
| 25 | (ha : ContDiff ℝ ∞ alpha) (hb : ContDiff ℝ ∞ beta) |
| 26 | {A0 A B B1 s t speed : ℝ} (ha0 : A0 < s) (hsA : s < A) |
| 27 | (hBt : B < t) (hb1 : t < B1) (hspeed : 0 < speed) |
| 28 | (hai : InjOn alpha (Icc A0 A)) (hbi : InjOn beta (Icc B B1)) |
| 29 | (hend : alpha A = beta B) (hreg : deriv alpha A ≠ 0) |
| 30 | (htan : deriv beta B = speed • deriv alpha A) |
| 31 | (hmeet : ∀ x ∈ Icc A0 A, ∀ y ∈ Icc B B1, |
| 32 | alpha x = beta y → x = A ∧ y = B) |
| 33 | (hregularA : ∀ x ∈ Ioo A0 A, deriv alpha x ≠ 0) |
| 34 | (hregularB : ∀ y ∈ Ioo B B1, deriv beta y ≠ 0) |
| 35 | {K U V : Set AnnulusCoordinates} (hK : IsCompact K) (hpK : alpha A ∉ K) |
| 36 | (havoidA : ∀ x ∈ Ioo A0 A, alpha x ∉ K) |
| 37 | (havoidB : ∀ y ∈ Ioo B B1, beta y ∉ K) |
| 38 | (hU : IsOpen U) (hV : IsOpen V) (hUV : Disjoint U V) |
| 39 | (hfront : frontier U = alpha '' Icc A0 A ∪ beta '' Icc B B1 ∪ K) |
| 40 | (hfV : frontier V = frontier U) |
| 41 | (L R : (ℝ × ℝ) ≃L[ℝ] AnnulusCoordinates) |
| 42 | {f g : ℝ → ℝ} {a b c d ua wa ub wb uc wc ud wd ra r rb : ℝ} |
| 43 | (hab : a < b) (hcd : c < d) |
| 44 | (C : ObliqueBandFaces |
| 45 | (collarParameterEquiv.trans L).toHomeomorph.toOpenPartialHomeomorph |
| 46 | f a b ua wa ub wb ra r) |
| 47 | (D : ObliqueBandFaces |
| 48 | (collarParameterEquiv.trans R).toHomeomorph.toOpenPartialHomeomorph |
| 49 | g c d uc wc ud wd r rb) |
| 50 | (hleftC : L (a, f a) = alpha s) (hbaseC : L (b, f b) = alpha A) |
| 51 | (hbaseD : R (c, g c) = alpha A) (hrightD : R (d, g d) = beta t) |
| 52 | {w : AnnulusCoordinates} (hdirC : L (ub, wb) = w) (hdirD : R (uc, wc) = w) |
| 53 | (hlowerC : C.lowerArc = alpha '' Icc s A) |
| 54 | (hlowerD : D.lowerArc = beta '' Icc B t) |
| 55 | (hsubC : C.carrier ⊆ closure U) (hsubD : D.carrier ⊆ closure U) |
| 56 | (hopenC : C.carrier \ C.lowerArc ⊆ U) (hopenD : D.carrier \ D.lowerArc ⊆ U) |
| 57 | (hinter : C.carrier ∩ D.carrier = segment ℝ (alpha A) (alpha A + r • w)) : |
| 58 | ∃ cutoff > 0, ∀ sa ∈ Ioo (0 : ℝ) cutoff, ∀ z ∈ Ioo (0 : ℝ) cutoff, |
| 59 | ∀ sb ∈ Ioo (0 : ℝ) cutoff, |
| 60 | ∃ (C' : ObliqueBandFaces |
| 61 | (collarParameterEquiv.trans L).toHomeomorph.toOpenPartialHomeomorph |
| 62 | f a b ua wa ub wb sa z) |
| 63 | (D' : ObliqueBandFaces |
| 64 | (collarParameterEquiv.trans R).toHomeomorph.toOpenPartialHomeomorph |
| 65 | g c d uc wc ud wd z sb), |
| 66 | (∀ q, C'.coordinates q = C.coordinates q) ∧ |
| 67 | (∀ q, D'.coordinates q = D.coordinates q) ∧ |
| 68 | C'.lowerArc = alpha '' Icc s A ∧ D'.lowerArc = beta '' Icc B t ∧ |
| 69 | C'.band ⊆ C.band ∧ D'.band ⊆ D.band ∧ |
| 70 | C'.carrier ⊆ C.carrier ∧ D'.carrier ⊆ D.carrier ∧ |
| 71 | C'.carrier ⊆ closure U ∧ D'.carrier ⊆ closure U ∧ |
| 72 | C'.carrier \ C'.lowerArc ⊆ U ∧ D'.carrier \ D'.lowerArc ⊆ U ∧ |
| 73 | C'.carrier ∩ C.leftCut = C'.leftCut ∧ |
| 74 | D'.carrier ∩ D.rightCut = D'.rightCut ∧ |
| 75 | C'.rightCut = segment ℝ (alpha A) (alpha A + z • w) ∧ |
| 76 | D'.leftCut = segment ℝ (alpha A) (alpha A + z • w) ∧ |
| 77 | C'.carrier ∩ D'.carrier = segment ℝ (alpha A) (alpha A + z • w) ∧ |
| 78 | (∀ x ∈ Ioc s A, ∃ W : Set AnnulusCoordinates, IsOpen W ∧ alpha x ∈ W ∧ |
| 79 | W ∩ closure U ⊆ C'.carrier ∪ D'.carrier) ∧ |
| 80 | ∀ y ∈ Ico B t, ∃ W : Set AnnulusCoordinates, IsOpen W ∧ beta y ∈ W ∧ |
| 81 | W ∩ closure U ⊆ C'.carrier ∪ D'.carrier := by |
| 82 | obtain ⟨cutoff, hcutoff, hpatch⟩ := m64Intrinsic_exists_nested_joined_bands |
| 83 | L R hab hcd C D hbaseC hbaseD hdirC hdirD hinter |
| 84 | refine ⟨cutoff, hcutoff, ?_⟩ |
| 85 | intro sa hsa z hz sb hsb |
| 86 | obtain ⟨C', D', hCc, hDc, hCl, hDl, hCb, hDb, hCk, hDk, |
| 87 | hCcontact, hDcontact, hCcut, hDcut, hCD⟩ := hpatch sa hsa z hz sb hsb |
| 88 | have hClower : C'.lowerArc = alpha '' Icc s A := hCl.trans hlowerC |
| 89 | have hDlower : D'.lowerArc = beta '' Icc B t := hDl.trans hlowerD |
| 90 | have hClowerSub : C'.lowerArc ⊆ alpha '' Icc A0 A := |
| 91 | hClower.subset.trans (image_mono (Icc_subset_Icc ha0.le le_rfl)) |
| 92 | have hDlowerSub : D'.lowerArc ⊆ beta '' Icc B B1 := |
| 93 | hDlower.subset.trans (image_mono (Icc_subset_Icc le_rfl hb1.le)) |
| 94 | have hCregion : C'.carrier ⊆ closure U := hCk.trans hsubC |
| 95 | have hDregion : D'.carrier ⊆ closure U := hDk.trans hsubD |
| 96 | have hCopen : C'.carrier \ C'.lowerArc ⊆ U := by |
| 97 | rintro q ⟨hq, hn⟩ |
| 98 | exact hopenC ⟨hCk hq, fun h => hn (hCl.symm ▸ h)⟩ |
| 99 | have hDopen : D'.carrier \ D'.lowerArc ⊆ U := by |
| 100 | rintro q ⟨hq, hn⟩ |
| 101 | exact hopenD ⟨hDk hq, fun h => hn (hDl.symm ▸ h)⟩ |
| 102 | have hjoin := m64Intrinsic_straight_join_bands_cover_region ha hb |
| 103 | (ha0.trans hsA) (hBt.trans hb1) hspeed hai hbi hend hreg htan |
| 104 | hK hpK hU hV hUV hfront hfV L R C' D' |
| 105 | hbaseC hbaseD hdirC hdirD hCD hClowerSub hDlowerSub hCregion hDregion |
| 106 | refine ⟨C', D', hCc, hDc, hClower, hDlower, hCb, hDb, hCk, hDk, |
| 107 | hCregion, hDregion, hCopen, hDopen, hCcontact, hDcontact, hCcut, hDcut, hCD, ?_, ?_⟩ |
| 108 | · intro x hx |
| 109 | by_cases hxA : x = A |
| 110 | · exact hxA.symm ▸ hjoin |
| 111 | have hx' : x ∈ Ioo A0 A := ⟨ha0.trans hx.1, lt_of_le_of_ne hx.2 hxA⟩ |
| 112 | have hother : alpha x ∉ beta '' Icc B B1 ∪ K := by |
| 113 | rintro (⟨y, hy, he⟩ | hk) |
| 114 | · exact hxA (hmeet x (Ioo_subset_Icc_self hx') y hy he.symm).1 |
| 115 | · exact havoidA x hx' hk |
| 116 | have hf : frontier U = alpha '' Icc A0 A ∪ (beta '' Icc B B1 ∪ K) := by |
| 117 | simpa only [union_assoc] using hfront |
| 118 | have hpoint : alpha x ∈ C'.lowerArc := hClower.symm ▸ ⟨x, Ioc_subset_Icc_self hx, rfl⟩ |
| 119 | have hends (e : Bool) : alpha x ≠ (C'.endpointEdge e).map 0 := by |
| 120 | cases e |
| 121 | · rw [m64Intrinsic_band_left_endpoint_zero, hleftC] |
| 122 | intro he |
| 123 | exact hx.1.ne' (hai (Ioo_subset_Icc_self hx') ⟨ha0.le, hsA.le⟩ he) |
| 124 | · rw [m64Intrinsic_band_right_endpoint_zero, hbaseC] |
| 125 | intro he |
| 126 | exact hxA (hai (Ioo_subset_Icc_self hx') ⟨(ha0.trans hsA).le, le_rfl⟩ he) |
| 127 | obtain ⟨W, hW, hpW, hcover⟩ := m64Intrinsic_arc_band_covers_lower_interior ha hai |
| 128 | hregularA hx' ((isCompact_Icc.image hb.continuous).union hK) hother |
| 129 | hU hV hUV hf hfV C' hClowerSub hpoint hends hCregion |
| 130 | exact ⟨W, hW, hpW, hcover.trans subset_union_left⟩ |
| 131 | · intro y hy |
| 132 | by_cases hyB : y = B |
| 133 | · obtain ⟨W, hW, hpW, hcover⟩ := hjoin |
| 134 | exact ⟨W, hW, by simpa only [hyB, ← hend] using hpW, hcover⟩ |
| 135 | have hy' : y ∈ Ioo B B1 := ⟨lt_of_le_of_ne hy.1 (Ne.symm hyB), hy.2.trans hb1⟩ |
| 136 | have hother : beta y ∉ alpha '' Icc A0 A ∪ K := by |
| 137 | rintro (⟨x, hx, he⟩ | hk) |
| 138 | · exact hyB (hmeet x hx y (Ioo_subset_Icc_self hy') he).2 |
| 139 | · exact havoidB y hy' hk |
| 140 | have hf : frontier U = beta '' Icc B B1 ∪ (alpha '' Icc A0 A ∪ K) := by |
| 141 | rw [hfront] |
| 142 | ac_rfl |
| 143 | have hpoint : beta y ∈ D'.lowerArc := hDlower.symm ▸ ⟨y, Ico_subset_Icc_self hy, rfl⟩ |
| 144 | have hends (e : Bool) : beta y ≠ (D'.endpointEdge e).map 0 := by |
| 145 | cases e |
| 146 | · rw [m64Intrinsic_band_left_endpoint_zero, hbaseD, hend] |
| 147 | intro he |
| 148 | exact hyB (hbi (Ioo_subset_Icc_self hy') ⟨le_rfl, (hBt.trans hb1).le⟩ he) |
| 149 | · rw [m64Intrinsic_band_right_endpoint_zero, hrightD] |
| 150 | intro he |
| 151 | exact hy.2.ne (hbi (Ioo_subset_Icc_self hy') ⟨hBt.le, hb1.le⟩ he) |
| 152 | obtain ⟨W, hW, hpW, hcover⟩ := m64Intrinsic_arc_band_covers_lower_interior hb hbi |
| 153 | hregularB hy' ((isCompact_Icc.image ha.continuous).union hK) hother |
| 154 | hU hV hUV hf hfV D' hDlowerSub hpoint hends hDregion |
| 155 | exact ⟨W, hW, hpW, hcover.trans subset_union_right⟩ |
| 156 | |
| 157 | end PoincareMT |