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.Straight.JoinCoveredBands |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Band.EndpointGeometry |
| 3 | |
| 4 | /-! Concrete joined-patch data retaining both actual bands and their |
| 5 | original physical bases. Source: MT Claim 19.40, pp. 470-471; |
| 6 | combined-boundary-collar derivation, Section 1. -/ |
| 7 | |
| 8 | noncomputable section |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | open Set |
| 13 | open scoped Topology ContDiff |
| 14 | open Poincare.Topology.Plane.Curves PoincareMT.Topology.Surface |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | /-- An actual two-band patch on the original joined arcs, with one shared physical direction |
| 19 | and three cut lengths. Source: MT Claim 19.40; combined-boundary-collar derivation, Section |
| 20 | 1. Source: `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, |
| 21 | Section 1. -/ |
| 22 | structure M64IntrinsicJoinedBandPatch (gamma : Bool → ℝ → AnnulusCoordinates) |
| 23 | (T b : Bool → ℝ) (U : Set AnnulusCoordinates) where |
| 24 | frame : Bool → (ℝ × ℝ) ≃L[ℝ] AnnulusCoordinates |
| 25 | graph : Bool → ℝ → ℝ |
| 26 | left : Bool → ℝ |
| 27 | right : Bool → ℝ |
| 28 | increasing : ∀ e, left e < right e |
| 29 | direction : AnnulusCoordinates |
| 30 | left_length : ℝ |
| 31 | middle_length : ℝ |
| 32 | right_length : ℝ |
| 33 | band : ∀ e : Bool, ObliqueBandFaces |
| 34 | (collarParameterEquiv.trans (frame e)).toHomeomorph.toOpenPartialHomeomorph |
| 35 | (graph e) (left e) (right e) |
| 36 | ((frame e).symm direction).1 ((frame e).symm direction).2 |
| 37 | ((frame e).symm direction).1 ((frame e).symm direction).2 |
| 38 | (if e then middle_length else left_length) (if e then right_length else middle_length) |
| 39 | left_base : ∀ e : Bool, frame e (left e, graph e (left e)) = |
| 40 | if e then gamma false (T false) else gamma false (b false) |
| 41 | right_base : ∀ e : Bool, frame e (right e, graph e (right e)) = |
| 42 | if e then gamma true (b true) else gamma false (T false) |
| 43 | transverse : ∀ e, 0 < inner ℝ (quarterTurn (deriv (gamma e) (b e))) direction |
| 44 | tangent : ∀ e : Bool, ∃ v : ℝ, 0 < v ∧ deriv (gamma e) (b e) = |
| 45 | v • frame e (1, deriv (graph e) (if e then right e else left e)) |
| 46 | lower_arc : ∀ e : Bool, (band e).lowerArc = |
| 47 | if e then gamma e '' Icc 0 (b e) else gamma e '' Icc (b e) (T e) |
| 48 | occupied : ∀ e, (band e).carrier ⊆ closure U |
| 49 | off_lower : ∀ e, (band e).carrier \ (band e).lowerArc ⊆ U |
| 50 | intersection : (band false).carrier ∩ (band true).carrier = |
| 51 | segment ℝ (gamma false (T false)) (gamma false (T false) + middle_length • direction) |
| 52 | |
| 53 | namespace M64IntrinsicJoinedBandPatch |
| 54 | |
| 55 | variable {gamma : Bool → ℝ → AnnulusCoordinates} {T b : Bool → ℝ} |
| 56 | {U : Set AnnulusCoordinates} (P : M64IntrinsicJoinedBandPatch gamma T b U) |
| 57 | |
| 58 | /-- The positive physical length at either outer attachment. Source: MT Claim 19.40; |
| 59 | combined-boundary-collar derivation, Section 2. Source: |
| 60 | `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Section 1. -/ |
| 61 | theorem outer_length_pos (e : Bool) : 0 < (if e then P.right_length else P.left_length) := by |
| 62 | cases e |
| 63 | · exact (P.band false).left_length_pos |
| 64 | · exact (P.band true).right_length_pos |
| 65 | |
| 66 | /-- The shared cut has strictly positive length. Source: MT Claim 19.40; |
| 67 | combined-boundary-collar derivation, Section 2. Source: |
| 68 | `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Section 1. -/ |
| 69 | theorem middle_length_pos : 0 < P.middle_length := (P.band false).right_length_pos |
| 70 | |
| 71 | /-- The retained outer graph base is the original attachment point. Source: MT Claim 19.40; |
| 72 | combined-boundary-collar derivation, Section 1. Source: |
| 73 | `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Section 1. -/ |
| 74 | theorem outer_base (e : Bool) : |
| 75 | P.frame e (if e then P.right e else P.left e, |
| 76 | P.graph e (if e then P.right e else P.left e)) = gamma e (b e) := by |
| 77 | cases e |
| 78 | · exact P.left_base false |
| 79 | · exact P.right_base true |
| 80 | |
| 81 | /-- The outer cut is the literal physical segment at its original arc point. Source: MT |
| 82 | Claim 19.40; combined-boundary-collar derivation, Section 2. Source: |
| 83 | `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Section 1. -/ |
| 84 | theorem outer_cut (e : Bool) : (if e then (P.band e).rightCut else (P.band e).leftCut) = |
| 85 | segment ℝ (gamma e (b e)) |
| 86 | (gamma e (b e) + (if e then P.right_length else P.left_length) • P.direction) := by |
| 87 | cases e |
| 88 | · change (P.band false).leftCut = _ |
| 89 | rw [m64Intrinsic_band_left_cut (P.frame false) (P.band false), P.left_base] |
| 90 | simp only [Bool.false_eq_true, if_false, Prod.eta, ContinuousLinearEquiv.apply_symm_apply] |
| 91 | · change (P.band true).rightCut = _ |
| 92 | rw [m64Intrinsic_band_right_cut (P.frame true) (P.band true), P.right_base] |
| 93 | simp only [if_true, Prod.eta, ContinuousLinearEquiv.apply_symm_apply] |
| 94 | |
| 95 | /-- Both inner cuts are the same literal join segment. Source: MT Claim 19.40; |
| 96 | combined-boundary-collar derivation, Section 2. Source: |
| 97 | `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Section 1. -/ |
| 98 | theorem inner_cut (e : Bool) : (if e then (P.band e).leftCut else (P.band e).rightCut) = |
| 99 | segment ℝ (gamma false (T false)) |
| 100 | (gamma false (T false) + P.middle_length • P.direction) := by |
| 101 | cases e |
| 102 | · change (P.band false).rightCut = _ |
| 103 | rw [m64Intrinsic_band_right_cut (P.frame false) (P.band false), P.right_base] |
| 104 | simp only [Bool.false_eq_true, if_false, Prod.eta, ContinuousLinearEquiv.apply_symm_apply] |
| 105 | · change (P.band true).leftCut = _ |
| 106 | rw [m64Intrinsic_band_left_cut (P.frame true) (P.band true), P.left_base] |
| 107 | simp only [if_true, Prod.eta, ContinuousLinearEquiv.apply_symm_apply] |
| 108 | |
| 109 | /-- The actual outer endpoint edge starts at the original attachment. Source: MT Claim |
| 110 | 19.40; combined-boundary-collar derivation, Section 3. Source: |
| 111 | `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Section 1. -/ |
| 112 | theorem outer_endpoint_zero (e : Bool) : |
| 113 | ((P.band e).endpointEdge e).map 0 = gamma e (b e) := by |
| 114 | cases e |
| 115 | · rw [m64Intrinsic_band_left_endpoint_zero] |
| 116 | exact P.left_base false |
| 117 | · rw [m64Intrinsic_band_right_endpoint_zero] |
| 118 | exact P.right_base true |
| 119 | |
| 120 | end M64IntrinsicJoinedBandPatch |
| 121 | |
| 122 | end PoincareMT |