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.ChainEndpoints |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Nested.PatchContacts |
| 3 | |
| 4 | /-! Exact contacts of a concrete chain with its rebuilt incident patch. |
| 5 | Source: MT Claim 19.40, pp. 470-471; three-arc cap/patch seed derivation, |
| 6 | Section 8. All scalar rescalings retain the same physical cut. -/ |
| 7 | |
| 8 | noncomputable section |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | open Set |
| 13 | open scoped Topology |
| 14 | open Poincare.Topology.Plane.Curves PoincareMT.Topology.Surface |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | /-- Matching the rebuilt patch length to the actual chain gives exact cap and incident-patch |
| 19 | contacts and excludes the other rebuilt band. Source: MT Claim 19.40; three-arc cap/patch |
| 20 | seed, Section 8. Source: |
| 21 | `proof-work/tasks/M64/derivations/2026-09-27-three-arc-cap-patch-seed.md`, Section 8. -/ |
| 22 | theorem m64Intrinsic_chain_nested_patch_contacts |
| 23 | {gamma : ℝ → AnnulusCoordinates} {a b : ℝ} {U C Z Z' : Set AnnulusCoordinates} |
| 24 | (E : M64IntrinsicArcBandChain gamma a b U) (terminal : Bool) (hell : E.length ≤ 1) |
| 25 | (L : (ℝ × ℝ) ≃L[ℝ] AnnulusCoordinates) |
| 26 | {f : ℝ → ℝ} {a0 a1 ua wa ub wb ra rb sa sb : ℝ} |
| 27 | (B : ObliqueBandFaces |
| 28 | (collarParameterEquiv.trans L).toHomeomorph.toOpenPartialHomeomorph |
| 29 | f a0 a1 ua wa ub wb ra rb) |
| 30 | (B' : ObliqueBandFaces |
| 31 | (collarParameterEquiv.trans L).toHomeomorph.toOpenPartialHomeomorph |
| 32 | f a0 a1 ua wa ub wb sa sb) |
| 33 | (hbase : L (if terminal then a1 else a0, f (if terminal then a1 else a0)) = |
| 34 | gamma (if terminal then a else b)) |
| 35 | (hdirection : E.direction (if terminal then a else b) = |
| 36 | (if terminal then rb else ra) • (if terminal then L (ub, wb) else L (ua, wa))) |
| 37 | (hlength : (if terminal then sb else sa) = E.length * (if terminal then rb else ra)) |
| 38 | (hpath : ∀ z ∈ Icc (0 : ℝ) 1, gamma (if terminal then b else a) + |
| 39 | z • E.direction (if terminal then b else a) ∈ C) |
| 40 | (hBZ : B.carrier ∩ Z ⊆ if terminal then B.leftCut else B.rightCut) |
| 41 | (hC : Disjoint C (B.carrier ∪ Z)) (hnew : B'.carrier ⊆ B.carrier) (hZ : Z' ⊆ Z) |
| 42 | (hcutNew : (if terminal then B'.rightCut else B'.leftCut) ⊆ |
| 43 | if terminal then B.rightCut else B.leftCut) |
| 44 | (hcontact : ∀ i, (C ∪ (B.carrier ∪ Z)) ∩ (E.band i).carrier = |
| 45 | (if E.cut i.castSucc = a then (E.band i).leftCut else ∅) ∪ |
| 46 | (if E.cut i.succ = b then (E.band i).rightCut else ∅)) : |
| 47 | (if terminal then B'.rightCut else B'.leftCut) = |
| 48 | segment ℝ (gamma (if terminal then a else b)) |
| 49 | (gamma (if terminal then a else b) + E.length • E.direction (if terminal then a else b)) ∧ |
| 50 | ∀ i, |
| 51 | C ∩ (E.band i).carrier = |
| 52 | (if terminal then (if E.cut i.succ = b then (E.band i).rightCut else ∅) |
| 53 | else (if E.cut i.castSucc = a then (E.band i).leftCut else ∅)) ∧ |
| 54 | B'.carrier ∩ (E.band i).carrier = |
| 55 | (if terminal then (if E.cut i.castSucc = a then (E.band i).leftCut else ∅) |
| 56 | else (if E.cut i.succ = b then (E.band i).rightCut else ∅)) ∧ |
| 57 | Disjoint Z' (E.band i).carrier := by |
| 58 | have hcut : (if terminal then B'.rightCut else B'.leftCut) = |
| 59 | segment ℝ (gamma (if terminal then a else b)) |
| 60 | (gamma (if terminal then a else b) + |
| 61 | E.length • E.direction (if terminal then a else b)) := by |
| 62 | cases terminal |
| 63 | · change B'.leftCut = segment ℝ (gamma b) (gamma b + E.length • E.direction b) |
| 64 | change L (a0, f a0) = gamma b at hbase |
| 65 | change sa = E.length * ra at hlength |
| 66 | change E.direction b = ra • L (ua, wa) at hdirection |
| 67 | rw [m64Intrinsic_band_left_cut L B', hbase, hlength, hdirection, smul_smul] |
| 68 | · change B'.rightCut = segment ℝ (gamma a) (gamma a + E.length • E.direction a) |
| 69 | change L (a1, f a1) = gamma a at hbase |
| 70 | change sb = E.length * rb at hlength |
| 71 | change E.direction a = rb • L (ub, wb) at hdirection |
| 72 | rw [m64Intrinsic_band_right_cut L B', hbase, hlength, hdirection, smul_smul] |
| 73 | have hcapSegment : segment ℝ (gamma (if terminal then b else a)) |
| 74 | (gamma (if terminal then b else a) + E.length • E.direction (if terminal then b else a)) |
| 75 | ⊆ C := by |
| 76 | rw [← m64Intrinsic_ray_image_eq_segment _ _ E.length_pos.le] |
| 77 | rintro p ⟨z, hz, rfl⟩ |
| 78 | exact hpath z ⟨hz.1, hz.2.trans hell⟩ |
| 79 | have hcutCarrier : (if terminal then B'.rightCut else B'.leftCut) ⊆ B'.carrier := by |
| 80 | rw [← B'.endpointEdge_image terminal] |
| 81 | exact (B'.endpointEdge_subset_frontier terminal).trans B'.isClosed_carrier.frontier_subset |
| 82 | refine ⟨hcut, ?_⟩ |
| 83 | intro i |
| 84 | let S := if terminal then (if E.cut i.succ = b then (E.band i).rightCut else ∅) |
| 85 | else (if E.cut i.castSucc = a then (E.band i).leftCut else ∅) |
| 86 | let T := if terminal then (if E.cut i.castSucc = a then (E.band i).leftCut else ∅) |
| 87 | else (if E.cut i.succ = b then (E.band i).rightCut else ∅) |
| 88 | have hS : S ⊆ C := by |
| 89 | intro p hp |
| 90 | cases terminal |
| 91 | · change p ∈ (if E.cut i.castSucc = a then (E.band i).leftCut else ∅) at hp |
| 92 | split_ifs at hp with he |
| 93 | · rw [E.left_cut, he] at hp |
| 94 | exact hcapSegment hp |
| 95 | · exact hp.elim |
| 96 | · change p ∈ (if E.cut i.succ = b then (E.band i).rightCut else ∅) at hp |
| 97 | split_ifs at hp with he |
| 98 | · rw [E.right_cut, he] at hp |
| 99 | exact hcapSegment hp |
| 100 | · exact hp.elim |
| 101 | have hTcut : T ⊆ (if terminal then B'.rightCut else B'.leftCut) := by |
| 102 | intro p hp |
| 103 | rw [hcut] |
| 104 | cases terminal |
| 105 | · change p ∈ (if E.cut i.succ = b then (E.band i).rightCut else ∅) at hp |
| 106 | split_ifs at hp with he |
| 107 | · rw [E.right_cut, he] at hp |
| 108 | exact hp |
| 109 | · exact hp.elim |
| 110 | · change p ∈ (if E.cut i.castSucc = a then (E.band i).leftCut else ∅) at hp |
| 111 | split_ifs at hp with he |
| 112 | · rw [E.left_cut, he] at hp |
| 113 | exact hp |
| 114 | · exact hp.elim |
| 115 | have hT : T ⊆ (if terminal then B.rightCut else B.leftCut) ∩ B'.carrier := |
| 116 | subset_inter (hTcut.trans hcutNew) (hTcut.trans hcutCarrier) |
| 117 | have hcontact' : (C ∪ (B.carrier ∪ Z)) ∩ (E.band i).carrier = S ∪ T := by |
| 118 | rw [hcontact] |
| 119 | cases terminal |
| 120 | · rfl |
| 121 | · exact union_comm _ _ |
| 122 | exact m64Intrinsic_nested_patch_obstacle_contacts B terminal hBZ hC hnew hZ hS hT hcontact' |
| 123 | |
| 124 | end PoincareMT |