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.Joined.PatchData |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Nested.CoveredJoinPatch |
| 3 | |
| 4 | /-! Replace a fixed actual joined patch by a smaller covered patch with |
| 5 | three independently chosen physical cuts. Source: MT Claim 19.40, |
| 6 | pp. 470-471; combined-boundary-collar derivation, Section 2. -/ |
| 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 PoincareMT.Topology.Surface |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | /-- A positive cutoff for replacing the actual patch preserves its direction, coordinates, |
| 19 | exact outer contacts and original-arc coverage. Source: MT Claim 19.40; |
| 20 | combined-boundary-collar derivation, Section 2. Source: |
| 21 | `proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md`, Section 2. -/ |
| 22 | theorem m64Intrinsic_exists_nested_patch_data |
| 23 | (gamma : Bool → ℝ → AnnulusCoordinates) (T b : Bool → ℝ) |
| 24 | (hg : ∀ e, ContDiff ℝ ∞ (gamma e)) (hb : ∀ e, b e ∈ Ioo (0 : ℝ) (T e)) |
| 25 | {speed : ℝ} (hspeed : 0 < speed) (hinj : ∀ e, InjOn (gamma e) (Icc 0 (T e))) |
| 26 | (hjoin : gamma false (T false) = gamma true 0) |
| 27 | (hreg : deriv (gamma false) (T false) ≠ 0) |
| 28 | (htan : deriv (gamma true) 0 = speed • deriv (gamma false) (T false)) |
| 29 | (hab : ∀ x ∈ Icc 0 (T false), ∀ y ∈ Icc 0 (T true), |
| 30 | gamma false x = gamma true y → x = T false ∧ y = 0) |
| 31 | (hregular : ∀ e, ∀ t ∈ Ioo (0 : ℝ) (T e), deriv (gamma e) t ≠ 0) |
| 32 | {K U V : Set AnnulusCoordinates} (hK : IsCompact K) |
| 33 | (hpK : gamma false (T false) ∉ K) |
| 34 | (havoid : ∀ e, ∀ t ∈ Ioo (0 : ℝ) (T e), gamma e t ∉ K) |
| 35 | (hU : IsOpen U) (hV : IsOpen V) (hUV : Disjoint U V) |
| 36 | (hfront : frontier U = gamma false '' Icc 0 (T false) ∪ |
| 37 | gamma true '' Icc 0 (T true) ∪ K) (hfV : frontier V = frontier U) |
| 38 | (P : M64IntrinsicJoinedBandPatch gamma T b U) : |
| 39 | ∃ delta > 0, ∀ sa ∈ Ioo (0 : ℝ) delta, ∀ z ∈ Ioo (0 : ℝ) delta, |
| 40 | ∀ sb ∈ Ioo (0 : ℝ) delta, |
| 41 | ∃ Q : M64IntrinsicJoinedBandPatch gamma T b U, |
| 42 | Q.direction = P.direction ∧ Q.left_length = sa ∧ |
| 43 | Q.middle_length = z ∧ Q.right_length = sb ∧ |
| 44 | (∀ e, ∀ q, (Q.band e).coordinates q = (P.band e).coordinates q) ∧ |
| 45 | (∀ e, (Q.band e).carrier ⊆ (P.band e).carrier) ∧ |
| 46 | (∀ e : Bool, |
| 47 | (Q.band e).carrier ∩ (if e then (P.band e).rightCut else (P.band e).leftCut) = |
| 48 | (if e then (Q.band e).rightCut else (Q.band e).leftCut)) ∧ |
| 49 | ∀ e : Bool, ∀ p ∈ (if e then Ico 0 (b e) else Ioc (b e) (T e)), |
| 50 | ∃ W : Set AnnulusCoordinates, IsOpen W ∧ gamma e p ∈ W ∧ |
| 51 | W ∩ closure U ⊆ (Q.band false).carrier ∪ (Q.band true).carrier := by |
| 52 | obtain ⟨delta, hdelta, hpatch⟩ := m64Intrinsic_exists_nested_covered_join_patch |
| 53 | (hg false) (hg true) (hb false).1 (hb false).2 (hb true).1 (hb true).2 hspeed |
| 54 | (hinj false) (hinj true) hjoin hreg htan hab (hregular false) (hregular true) |
| 55 | hK hpK (havoid false) (havoid true) hU hV hUV hfront hfV (P.frame false) (P.frame true) |
| 56 | (P.increasing false) (P.increasing true) (P.band false) (P.band true) |
| 57 | (P.left_base false) (P.right_base false) (P.left_base true) (P.right_base true) |
| 58 | (by simp only [Prod.eta, ContinuousLinearEquiv.apply_symm_apply]) |
| 59 | (by simp only [Prod.eta, ContinuousLinearEquiv.apply_symm_apply]) |
| 60 | (P.lower_arc false) (P.lower_arc true) (P.occupied false) (P.occupied true) |
| 61 | (P.off_lower false) (P.off_lower true) P.intersection |
| 62 | refine ⟨delta, hdelta, ?_⟩ |
| 63 | intro sa hsa z hz sb hsb |
| 64 | obtain ⟨Q0, Q1, hcoords0, hcoords1, hlower0, hlower1, _, _, hsub0, hsub1, |
| 65 | hU0, hU1, hopen0, hopen1, hcut0, hcut1, _, _, hinter, hcover0, hcover1⟩ := |
| 66 | hpatch sa hsa z hz sb hsb |
| 67 | let Q : M64IntrinsicJoinedBandPatch gamma T b U := |
| 68 | { frame := P.frame |
| 69 | graph := P.graph |
| 70 | left := P.left |
| 71 | right := P.right |
| 72 | increasing := P.increasing |
| 73 | direction := P.direction |
| 74 | left_length := sa |
| 75 | middle_length := z |
| 76 | right_length := sb |
| 77 | band := fun e => Bool.rec Q0 Q1 e |
| 78 | left_base := P.left_base |
| 79 | right_base := P.right_base |
| 80 | transverse := P.transverse |
| 81 | tangent := P.tangent |
| 82 | lower_arc := by |
| 83 | intro e |
| 84 | cases e |
| 85 | · exact hlower0 |
| 86 | · exact hlower1 |
| 87 | occupied := by |
| 88 | intro e |
| 89 | cases e |
| 90 | · exact hU0 |
| 91 | · exact hU1 |
| 92 | off_lower := by |
| 93 | intro e |
| 94 | cases e |
| 95 | · exact hopen0 |
| 96 | · exact hopen1 |
| 97 | intersection := hinter } |
| 98 | refine ⟨Q, rfl, rfl, rfl, rfl, ?_, ?_, ?_, ?_⟩ |
| 99 | · intro e q |
| 100 | cases e |
| 101 | · exact hcoords0 q |
| 102 | · exact hcoords1 q |
| 103 | · intro e |
| 104 | cases e |
| 105 | · exact hsub0 |
| 106 | · exact hsub1 |
| 107 | · intro e |
| 108 | cases e |
| 109 | · exact hcut0 |
| 110 | · exact hcut1 |
| 111 | · intro e p hp |
| 112 | cases e |
| 113 | · exact hcover0 p hp |
| 114 | · exact hcover1 p hp |
| 115 | |
| 116 | end PoincareMT |