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.PatchData |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Three.ArcJoinPatch |
| 4 | |
| 5 | /-! Construct a fixed actual auxiliary patch from the retained original |
| 6 | caps. Source: MT Claim 19.40, pp. 470-471; combined-boundary-collar |
| 7 | derivation, Sections 1-2. -/ |
| 8 | |
| 9 | noncomputable section |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set Filter |
| 14 | open scoped Topology ContDiff |
| 15 | open Poincare.Topology.Plane.Curves PoincareMT.Topology.Surface |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | /-- Fix actual auxiliary bands outside both caps and the original third arc, leaving |
| 20 | positive intervals for both chains. Source: MT Claim 19.40; combined-boundary-collar |
| 21 | derivation, Sections 1-2. Construction: |
| 22 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Sections 1-2. -/ |
| 23 | theorem m64Intrinsic_exists_three_arc_patch_data |
| 24 | (gamma : Bool → ℝ → AnnulusCoordinates) (sigma : ℝ → AnnulusCoordinates) |
| 25 | (T : Bool → ℝ) {S speed : ℝ} (hg : ∀ e, ContDiff ℝ ∞ (gamma e)) |
| 26 | (hs : Continuous sigma) (hT : ∀ e, 0 < T e) (hS : 0 < S) (hspeed : 0 < speed) |
| 27 | (hinj : ∀ e, InjOn (gamma e) (Icc 0 (T e))) |
| 28 | (hjoin : gamma false (T false) = gamma true 0) |
| 29 | (hreg : deriv (gamma false) (T false) ≠ 0) |
| 30 | (htan : deriv (gamma true) 0 = speed • deriv (gamma false) (T false)) |
| 31 | (hab : ∀ x ∈ Icc 0 (T false), ∀ y ∈ Icc 0 (T true), |
| 32 | gamma false x = gamma true y → x = T false ∧ y = 0) |
| 33 | (has : ∀ x ∈ Icc 0 (T false), ∀ y ∈ Icc 0 S, |
| 34 | gamma false x = sigma y → x = 0 ∧ y = 0) |
| 35 | (hbs : ∀ x ∈ Icc 0 (T true), ∀ y ∈ Icc 0 S, |
| 36 | gamma true x = sigma y → x = T true ∧ y = S) |
| 37 | (hregular : ∀ t ∈ Ioo (0 : ℝ) (T false), deriv (gamma false) t ≠ 0) |
| 38 | {U V : Set AnnulusCoordinates} (hU : IsOpen U) (hV : IsOpen V) (hUV : Disjoint U V) |
| 39 | (hfront : frontier U = gamma false '' Icc 0 (T false) ∪ |
| 40 | gamma true '' Icc 0 (T true) ∪ sigma '' Icc 0 S) |
| 41 | (hfV : frontier V = frontier U) |
| 42 | (hray : ∀ t ∈ Ioo (0 : ℝ) (T false), ∀ᶠ z in 𝓝[>] (0 : ℝ), |
| 43 | gamma false t + z • quarterTurn (deriv (gamma false) t) ∈ U) |
| 44 | (C : M64IntrinsicThreeArcCaps gamma sigma T S U) : |
| 45 | ∃ b : Bool → ℝ, (∀ e, b e ∈ Ioo (0 : ℝ) (T e)) ∧ |
| 46 | (∀ e : Bool, (if e then b e else C.radius e) < |
| 47 | if e then T e - C.radius e else b e) ∧ |
| 48 | ∃ P : M64IntrinsicJoinedBandPatch gamma T b U, |
| 49 | P.direction = quarterTurn (deriv (gamma false) (T false)) ∧ |
| 50 | ∀ e, (P.band e).carrier ⊆ |
| 51 | (C.carrier false ∪ C.carrier true ∪ sigma '' Icc 0 S)ᶜ := by |
| 52 | classical |
| 53 | obtain ⟨_, _, epsilon, hepsilon, hgap0, hgap1, hb0, hb1, |
| 54 | L, R, f, g, a0, a1, c0, c1, ha, hc, hbase0, hjoin0, hjoin1, hbase1, |
| 55 | htrans0, htrans1, htan0, htan1, cutoff, hcutoff, hbands⟩ := |
| 56 | m64Intrinsic_exists_three_arc_join_patch (hg false) (hg true) hs |
| 57 | (hT false) (hT true) hS hspeed (C.radius_bound false) (C.radius_bound true) |
| 58 | (hinj false) (hinj true) hjoin hreg htan hab has hbs hregular |
| 59 | hU hV hUV hfront hfV hray (C.compact false) (C.compact true) |
| 60 | (C.frontier_contact false).subset (C.frontier_contact true).subset |
| 61 | let rho := cutoff / 2 |
| 62 | have hrho : rho ∈ Ioo (0 : ℝ) cutoff := ⟨half_pos hcutoff, half_lt_self hcutoff⟩ |
| 63 | obtain ⟨B0, B1, hlower0, hlower1, hO0, hO1, hsub0, hsub1, hopen0, hopen1, |
| 64 | _, _, _, _, hinter, _⟩ := hbands rho hrho rho hrho rho hrho |
| 65 | let b : Bool → ℝ := fun e => if e then epsilon else T false - epsilon |
| 66 | let frame : Bool → (ℝ × ℝ) ≃L[ℝ] AnnulusCoordinates := fun e => if e then R else L |
| 67 | let graph : Bool → ℝ → ℝ := fun e => if e then g else f |
| 68 | let left : Bool → ℝ := fun e => if e then c0 else a0 |
| 69 | let right : Bool → ℝ := fun e => if e then c1 else a1 |
| 70 | let P : M64IntrinsicJoinedBandPatch gamma T b U := |
| 71 | { frame := frame |
| 72 | graph := graph |
| 73 | left := left |
| 74 | right := right |
| 75 | increasing := by |
| 76 | intro e |
| 77 | cases e |
| 78 | · exact ha |
| 79 | · exact hc |
| 80 | direction := quarterTurn (deriv (gamma false) (T false)) |
| 81 | left_length := rho |
| 82 | middle_length := rho |
| 83 | right_length := rho |
| 84 | band := fun e => Bool.rec B0 B1 e |
| 85 | left_base := by |
| 86 | intro e |
| 87 | cases e |
| 88 | · exact hbase0 |
| 89 | · exact hjoin1 |
| 90 | right_base := by |
| 91 | intro e |
| 92 | cases e |
| 93 | · exact hjoin0 |
| 94 | · exact hbase1 |
| 95 | transverse := by |
| 96 | intro e |
| 97 | cases e |
| 98 | · exact htrans0 |
| 99 | · exact htrans1 |
| 100 | tangent := by |
| 101 | intro e |
| 102 | cases e |
| 103 | · exact htan0 |
| 104 | · exact htan1 |
| 105 | lower_arc := by |
| 106 | intro e |
| 107 | cases e |
| 108 | · exact hlower0 |
| 109 | · exact hlower1 |
| 110 | occupied := by |
| 111 | intro e |
| 112 | cases e |
| 113 | · exact hsub0 |
| 114 | · exact hsub1 |
| 115 | off_lower := by |
| 116 | intro e |
| 117 | cases e |
| 118 | · exact hopen0 |
| 119 | · exact hopen1 |
| 120 | intersection := hinter } |
| 121 | refine ⟨b, ?_, ?_, P, rfl, ?_⟩ |
| 122 | · intro e |
| 123 | cases e |
| 124 | · exact ⟨hb0, sub_lt_self _ hepsilon⟩ |
| 125 | · exact ⟨hepsilon, hb1⟩ |
| 126 | · intro e |
| 127 | cases e |
| 128 | · exact hgap0 |
| 129 | · exact hgap1 |
| 130 | · intro e |
| 131 | cases e |
| 132 | · exact hO0 |
| 133 | · exact hO1 |
| 134 | |
| 135 | end PoincareMT |