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.Three.ArcCapData |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Joined.PatchChainContacts |
| 3 | |
| 4 | /-! The actual joined-arc collar, retaining exact contacts and coverage. |
| 5 | Source: MT Claim 19.40, pp. 470-471; combined-boundary-collar derivation, |
| 6 | Sections 2-3. -/ |
| 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 PoincareMT.Topology.Surface |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | /-- The literal finite union of both chains and the two patch bands. Source: MT Claim 19.40; |
| 19 | combined-boundary-collar derivation, Section 3. Source: |
| 20 | `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Sections 1-3. -/ |
| 21 | abbrev m64IntrinsicJoinedBandUnion |
| 22 | {gamma : Bool → ℝ → AnnulusCoordinates} {T r b : Bool → ℝ} |
| 23 | {U : Set AnnulusCoordinates} |
| 24 | (E : ∀ e : Bool, M64IntrinsicArcBandChain (gamma e) |
| 25 | (if e then b e else r e) (if e then T e - r e else b e) U) |
| 26 | (P : M64IntrinsicJoinedBandPatch gamma T b U) : Set AnnulusCoordinates := |
| 27 | ⋃ e, (⋃ i, ((E e).band i).carrier) ∪ (P.band e).carrier |
| 28 | |
| 29 | /-- A constructed collar of the original joined arcs, with the same retained caps and actual |
| 30 | replacement patch. Source: MT Claim 19.40; combined-boundary-collar derivation, Sections |
| 31 | 2-3. Source: `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, |
| 32 | Sections 1-3. -/ |
| 33 | structure M64IntrinsicJoinedArcCollar |
| 34 | {gamma : Bool → ℝ → AnnulusCoordinates} {sigma : ℝ → AnnulusCoordinates} |
| 35 | {T : Bool → ℝ} {S : ℝ} {U : Set AnnulusCoordinates} |
| 36 | (C : M64IntrinsicThreeArcCaps gamma sigma T S U) (b : Bool → ℝ) where |
| 37 | attachment : ∀ e, b e ∈ Ioo (0 : ℝ) (T e) |
| 38 | chain : ∀ e : Bool, M64IntrinsicArcBandChain (gamma e) |
| 39 | (if e then b e else C.radius e) (if e then T e - C.radius e else b e) U |
| 40 | patch : M64IntrinsicJoinedBandPatch gamma T b U |
| 41 | cap_direction : ∀ e : Bool, |
| 42 | (chain e).direction (if e then T e - C.radius e else C.radius e) = |
| 43 | C.cap e (true, C.positive e) (0, C.radius e) - |
| 44 | C.cap e (true, C.positive e) (C.radius e, 0) |
| 45 | cap_path : ∀ e : Bool, ∀ z ∈ Icc (0 : ℝ) 1, |
| 46 | gamma e (if e then T e - C.radius e else C.radius e) + |
| 47 | z • (chain e).direction (if e then T e - C.radius e else C.radius e) ∈ C.carrier e |
| 48 | opposite_cap : ∀ e i, Disjoint (C.carrier (!e)) ((chain e).band i).carrier |
| 49 | cap_contact : ∀ (e : Bool) i, C.carrier e ∩ ((chain e).band i).carrier = |
| 50 | if e then |
| 51 | (if (chain e).cut i.succ = T e - C.radius e then ((chain e).band i).rightCut else ∅) |
| 52 | else (if (chain e).cut i.castSucc = C.radius e then ((chain e).band i).leftCut else ∅) |
| 53 | patch_contact : ∀ (e : Bool) i, (patch.band e).carrier ∩ ((chain e).band i).carrier = |
| 54 | if e then (if (chain e).cut i.castSucc = b e then ((chain e).band i).leftCut else ∅) |
| 55 | else (if (chain e).cut i.succ = b e then ((chain e).band i).rightCut else ∅) |
| 56 | opposite_patch : ∀ e i, Disjoint (patch.band (!e)).carrier ((chain e).band i).carrier |
| 57 | matched_cut : ∀ e : Bool, |
| 58 | (if e then (patch.band e).rightCut else (patch.band e).leftCut) = |
| 59 | segment ℝ (gamma e (b e)) (gamma e (b e) + (chain e).length • (chain e).direction (b e)) |
| 60 | caps_patch_disjoint : ∀ e f, Disjoint (C.carrier e) (patch.band f).carrier |
| 61 | chains_disjoint : ∀ i j, |
| 62 | Disjoint ((chain false).band i).carrier ((chain true).band j).carrier |
| 63 | third_avoids : Disjoint (sigma '' Icc 0 S) (m64IntrinsicJoinedBandUnion chain patch) |
| 64 | covered : ∀ e, ∀ p ∈ Icc (0 : ℝ) (T e), |
| 65 | ∃ W : Set AnnulusCoordinates, IsOpen W ∧ gamma e p ∈ W ∧ |
| 66 | W ∩ closure U ⊆ (C.carrier false ∪ C.carrier true) ∪ |
| 67 | m64IntrinsicJoinedBandUnion chain patch |
| 68 | |
| 69 | namespace M64IntrinsicJoinedArcCollar |
| 70 | |
| 71 | variable {gamma : Bool → ℝ → AnnulusCoordinates} {sigma : ℝ → AnnulusCoordinates} |
| 72 | {T b : Bool → ℝ} {S : ℝ} {U : Set AnnulusCoordinates} |
| 73 | {C : M64IntrinsicThreeArcCaps gamma sigma T S U} |
| 74 | (J : M64IntrinsicJoinedArcCollar C b) |
| 75 | |
| 76 | /-- The already fitted bands form a closed set, so the remaining chain can be constructed in |
| 77 | its open complement. Source: MT Claim 19.40; combined-boundary-collar derivation, Section 3. |
| 78 | Source: `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Sections |
| 79 | 1-3. -/ |
| 80 | theorem bands_closed : IsClosed (m64IntrinsicJoinedBandUnion J.chain J.patch) := by |
| 81 | apply isClosed_iUnion_of_finite |
| 82 | intro e |
| 83 | exact (isClosed_iUnion_of_finite fun i => ((J.chain e).band i).isClosed_carrier).union |
| 84 | (J.patch.band e).isClosed_carrier |
| 85 | |
| 86 | /-- Every point of the retained joined collar is in the occupied closure. Source: MT Claim |
| 87 | 19.40; combined-boundary-collar derivation, Section 3. Source: |
| 88 | `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Sections 1-3. -/ |
| 89 | theorem occupied : (C.carrier false ∪ C.carrier true) ∪ |
| 90 | m64IntrinsicJoinedBandUnion J.chain J.patch ⊆ closure U := by |
| 91 | apply union_subset (union_subset (C.occupied false) (C.occupied true)) |
| 92 | apply iUnion_subset |
| 93 | intro e |
| 94 | exact union_subset (iUnion_subset fun i => (J.chain e).occupied i) (J.patch.occupied e) |
| 95 | |
| 96 | end M64IntrinsicJoinedArcCollar |
| 97 | |
| 98 | end PoincareMT |