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.Concrete.ArcBandChain |
| 2 | |
| 3 | /-! An actual cap-to-patch chain with a prescribed upper bound on its |
| 4 | physical patch cut. Source: MT Claim 19.40, pp. 470-471; three-arc |
| 5 | cap/patch seed derivation, Section 5. -/ |
| 6 | |
| 7 | noncomputable section |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set Filter |
| 12 | open scoped Topology ContDiff |
| 13 | open Poincare.Topology.Plane.Curves PoincareMT.Topology.Surface |
| 14 | open ChartCircleArrangementVertexPatch |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | /-- Construct a concrete occupied chain whose patch attachment can be realized within any |
| 19 | prescribed positive nesting bound. Both orientations retain the cap chord, physical patch |
| 20 | direction and original-arc coverage. Source: MT Claim 19.40; three-arc cap/patch seed, |
| 21 | Section 5. Construction: |
| 22 | proof-work/tasks/M64/derivations/2026-09-27-three-arc-cap-patch-seed.md, Section 5. -/ |
| 23 | theorem m64Intrinsic_exists_small_cap_patch_chain |
| 24 | {gamma : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) {T r b delta : ℝ} |
| 25 | (hr : 0 < r) (hrT : r < T) (hb : b ∈ Ioo (0 : ℝ) T) (hdelta : 0 < delta) |
| 26 | (terminal : Bool) (hgap : (if terminal then b else r) < if terminal then T - r else b) |
| 27 | (hinj : InjOn gamma (Icc 0 T)) |
| 28 | (hregular : ∀ t ∈ Ioo (0 : ℝ) T, deriv gamma t ≠ 0) |
| 29 | {K U V Z O : Set AnnulusCoordinates} (hK : IsCompact K) |
| 30 | (havoidK : ∀ t ∈ Ioo (0 : ℝ) T, gamma t ∉ K) |
| 31 | (hU : IsOpen U) (hV : IsOpen V) (hUV : Disjoint U V) |
| 32 | (hfront : frontier U = gamma '' Icc 0 T ∪ K) (hfV : frontier V = frontier U) |
| 33 | (hray : ∀ t ∈ Ioo (0 : ℝ) T, ∀ᶠ z in 𝓝[>] (0 : ℝ), |
| 34 | gamma t + z • quarterTurn (deriv gamma t) ∈ U) |
| 35 | (H : OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) |
| 36 | (F : Bool × Bool → OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) |
| 37 | (positive vertical : Bool) |
| 38 | (hsource : ∀ i, |
| 39 | {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} ⊆ (F i).source) |
| 40 | (hF : ∀ i, ContDiffOn ℝ ∞ (F i) (F i).source) |
| 41 | (hFi : ∀ i, ContDiffOn ℝ ∞ (F i).symm (F i).target) |
| 42 | (hfirst : ∀ i, ∀ s ∈ Icc (0 : ℝ) r, |
| 43 | F i (s, 0) = H (sectorParameterEquiv 0 i (s, 0))) |
| 44 | (hsecond : ∀ i, ∀ s ∈ Icc (0 : ℝ) r, |
| 45 | F i (0, s) = H (sectorParameterEquiv 0 i (0, s))) |
| 46 | (hchord : ∀ i, ∀ t : ℝ, F i ((1 - t) * r, t * r) = |
| 47 | (1 - t) • F i (r, 0) + t • F i (0, r)) |
| 48 | (hsector : ∀ i, |
| 49 | F i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} ⊆ |
| 50 | H '' (H.source ∩ (sectorParameterEquiv 0 i) '' |
| 51 | {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2})) |
| 52 | (haxis : ∀ s : ℝ, H (if vertical then (0, s) else (s, 0)) = |
| 53 | gamma (if terminal then T - s else s)) |
| 54 | (htip : (if vertical then ((0 : ℝ), r) else (r, 0)) ∈ H.source) |
| 55 | (L : (ℝ × ℝ) ≃L[ℝ] AnnulusCoordinates) |
| 56 | {f : ℝ → ℝ} {a0 a1 ua wa ub wb ra rb : ℝ} (ha01 : a0 < a1) |
| 57 | (B : ObliqueBandFaces |
| 58 | (collarParameterEquiv.trans L).toHomeomorph.toOpenPartialHomeomorph |
| 59 | f a0 a1 ua wa ub wb ra rb) |
| 60 | (hbase : L (if terminal then a1 else a0, f (if terminal then a1 else a0)) = gamma b) |
| 61 | (htangent : ∃ speed : ℝ, 0 < speed ∧ |
| 62 | deriv gamma b = speed • L (1, deriv f (if terminal then a1 else a0))) |
| 63 | (htrans : 0 < inner ℝ (quarterTurn (deriv gamma b)) |
| 64 | (if terminal then L (ub, wb) else L (ua, wa))) |
| 65 | (hlower : B.lowerArc = if terminal then gamma '' Icc 0 b else gamma '' Icc b T) |
| 66 | (hBopen : B.carrier \ B.lowerArc ⊆ U) |
| 67 | (hZ : IsClosed Z) (hZfront : Z ∩ frontier U ⊆ K) |
| 68 | (hO : IsOpen O) |
| 69 | (haxisO : gamma '' Icc (if terminal then b else r) (if terminal then T - r else b) ⊆ O) : |
| 70 | let selected := if vertical then (positive, true) else (true, positive) |
| 71 | let vC := if vertical then F selected (r, 0) - F selected (0, r) |
| 72 | else F selected (0, r) - F selected (r, 0) |
| 73 | let rho := if terminal then rb else ra |
| 74 | let w := if terminal then L (ub, wb) else L (ua, wa) |
| 75 | let C := ⋃ i, ⋃ (_ : if positive then i = (true, true) else i ≠ (true, true)), |
| 76 | F i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ r} |
| 77 | let P := B.carrier ∪ Z |
| 78 | C ⊆ closure U → Disjoint C P → |
| 79 | C ∩ frontier U ⊆ (fun s => gamma (if terminal then T - s else s)) '' Icc 0 r ∪ K → |
| 80 | (∃ W : Set AnnulusCoordinates, IsOpen W ∧ |
| 81 | gamma (if terminal then T else 0) ∈ W ∧ W ∩ closure U ⊆ C) → |
| 82 | ∃ E : M64IntrinsicArcBandChain gamma |
| 83 | (if terminal then b else r) (if terminal then T - r else b) U, |
| 84 | E.length ≤ 1 ∧ E.length * rho < delta ∧ |
| 85 | E.direction (if terminal then T - r else r) = vC ∧ E.direction b = rho • w ∧ |
| 86 | (∀ z ∈ Icc (0 : ℝ) 1, gamma (if terminal then T - r else r) + |
| 87 | z • E.direction (if terminal then T - r else r) ∈ C) ∧ |
| 88 | (∀ z ∈ Icc (0 : ℝ) 1, gamma b + z • E.direction b ∈ P) ∧ |
| 89 | (∀ i, (E.band i).carrier ⊆ O) ∧ |
| 90 | (∀ i, (C ∪ P) ∩ (E.band i).carrier = |
| 91 | (if E.cut i.castSucc = (if terminal then b else r) then (E.band i).leftCut else ∅) ∪ |
| 92 | (if E.cut i.succ = (if terminal then T - r else b) then (E.band i).rightCut else ∅)) ∧ |
| 93 | ∀ p ∈ (if terminal then Ioc b T else Ico 0 b), |
| 94 | ∃ W : Set AnnulusCoordinates, IsOpen W ∧ gamma p ∈ W ∧ |
| 95 | W ∩ closure U ⊆ C ∪ ⋃ i, (E.band i).carrier := by |
| 96 | intro selected vC rho w C P hCsub hCP hCfront hcorner |
| 97 | obtain ⟨d, hdC, hdP, hpathC, hpathP, n, c, R, G, g, |
| 98 | hn, hmono, hfirstCut, hlastCut, epsilon, hepsilon, he1, hbands⟩ := |
| 99 | m64Intrinsic_exists_cap_patch_arc_bands hg hr hrT hb terminal hgap hinj hregular |
| 100 | hK havoidK hU hV hUV hfront hfV hray H F positive vertical hsource hF hFi |
| 101 | hfirst hsecond hchord hsector haxis htip L ha01 B hbase htangent htrans |
| 102 | hlower hBopen hZ hZfront hO haxisO hCsub hCP hCfront hcorner |
| 103 | have hrho : 0 < rho := by |
| 104 | cases terminal |
| 105 | · exact B.left_length_pos |
| 106 | · exact B.right_length_pos |
| 107 | let ell := min epsilon (delta / rho) / 2 |
| 108 | have hmin : 0 < min epsilon (delta / rho) := lt_min hepsilon (div_pos hdelta hrho) |
| 109 | have hell : 0 < ell := half_pos hmin |
| 110 | have hellE : ell < epsilon := (half_lt_self hmin).trans_le (min_le_left _ _) |
| 111 | have hellD : ell * rho < delta := |
| 112 | (lt_div_iff₀ hrho).mp ((half_lt_self hmin).trans_le (min_le_right _ _)) |
| 113 | obtain ⟨bands, hbandsO, hgeometry, hsep, hadj, hcontact, hcover⟩ := |
| 114 | hbands (fun _ => ell) (fun _ => ⟨hell, hellE⟩) |
| 115 | let E : M64IntrinsicArcBandChain gamma |
| 116 | (if terminal then b else r) (if terminal then T - r else b) U := |
| 117 | { count := n |
| 118 | count_pos := hn |
| 119 | cut := c |
| 120 | cut_strictMono := hmono |
| 121 | first_cut := hfirstCut |
| 122 | last_cut := hlastCut |
| 123 | direction := d |
| 124 | frame := R |
| 125 | parameter := G |
| 126 | graph := g |
| 127 | length := ell |
| 128 | length_pos := hell |
| 129 | band := bands |
| 130 | lower_arc := fun i => (hgeometry i).1 |
| 131 | left_cut := fun i => (hgeometry i).2.1 |
| 132 | right_cut := fun i => (hgeometry i).2.2.1 |
| 133 | occupied := fun i => (hgeometry i).2.2.2.1 |
| 134 | off_lower := fun i => (hgeometry i).2.2.2.2 |
| 135 | separated := hsep |
| 136 | adjacent := hadj } |
| 137 | exact ⟨E, hellE.le.trans he1, hellD, hdC, hdP, hpathC, hpathP, |
| 138 | hbandsO, hcontact, hcover⟩ |
| 139 | |
| 140 | end PoincareMT |