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.Chosen.CapGeometry |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Cap.Compatibility |
| 4 | |
| 5 | /-! Coordinate faces of the already fixed original corner caps. |
| 6 | Source: MT Claim 19.40, pp. 470-471; combined-boundary-collar derivation, |
| 7 | Section 6. No new cap maps or carriers are selected. -/ |
| 8 | |
| 9 | noncomputable section |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set |
| 14 | open scoped Topology ContDiff Manifold |
| 15 | open PoincareMT.Topology.Surface ChartCircleArrangementVertexPatch |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | /-- Coordinate faces retaining the actual two original cap families. Source: MT Claim 19.40; |
| 20 | combined-boundary-collar derivation, Section 6. Construction: |
| 21 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Section 6. -/ |
| 22 | structure M64IntrinsicThreeArcCapFaces |
| 23 | {gamma : Bool → ℝ → AnnulusCoordinates} {sigma : ℝ → AnnulusCoordinates} |
| 24 | {T : Bool → ℝ} {S : ℝ} {U : Set AnnulusCoordinates} |
| 25 | (C : M64IntrinsicThreeArcCaps gamma sigma T S U) where |
| 26 | face : Bool → Bool × Bool → SmoothFace AnnulusCoordinates |
| 27 | coordinates : Bool → Bool × Bool → OpenPartialHomeomorph AnnulusCoordinates AnnulusCoordinates |
| 28 | basis : Bool → Bool × Bool → AffineBasis (Fin 3) ℝ AnnulusCoordinates |
| 29 | smooth : ∀ e i, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (coordinates e i) (coordinates e i).source |
| 30 | inverse_smooth : ∀ e i, |
| 31 | ContMDiffOn (𝓡 2) (𝓡 2) ∞ (coordinates e i).symm (coordinates e i).target |
| 32 | source : ∀ e i, convexHull ℝ (range (basis e i)) ⊆ (coordinates e i).source |
| 33 | carrier : ∀ e i, (face e i).carrier = coordinates e i '' convexHull ℝ (range (basis e i)) |
| 34 | boundary : ∀ e i k, ((face e i).boundary k).map = coordinates e i ∘ |
| 35 | affineChartSegment (basis e i (k.succAbove 0)) (basis e i (k.succAbove 1)) |
| 36 | original_carrier : ∀ e i, (face e i).carrier = |
| 37 | C.cap e i '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2 ∧ q.1 + q.2 ≤ C.radius e} |
| 38 | original_zero : ∀ e i (t : ℝ), ((face e i).boundary 0).map t = |
| 39 | C.cap e i ((1 - t) * C.radius e, t * C.radius e) |
| 40 | original_one : ∀ e i (t : ℝ), ((face e i).boundary 1).map t = C.cap e i (0, t * C.radius e) |
| 41 | original_two : ∀ e i (t : ℝ), ((face e i).boundary 2).map t = C.cap e i (t * C.radius e, 0) |
| 42 | |
| 43 | namespace M64IntrinsicThreeArcCaps |
| 44 | |
| 45 | /-- The retained cap maps produce their own actual coordinate faces. Source: MT Claim 19.40; |
| 46 | combined-boundary-collar derivation, Section 6. Construction: |
| 47 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Section 6. -/ |
| 48 | theorem exists_faces |
| 49 | {gamma : Bool → ℝ → AnnulusCoordinates} {sigma : ℝ → AnnulusCoordinates} |
| 50 | {T : Bool → ℝ} {S : ℝ} {U : Set AnnulusCoordinates} |
| 51 | (C : M64IntrinsicThreeArcCaps gamma sigma T S U) : |
| 52 | Nonempty (M64IntrinsicThreeArcCapFaces C) := by |
| 53 | classical |
| 54 | choose face hface hzero hone htwo Q b hQ hQi hsource hcarrier hboundary using |
| 55 | fun (e : Bool) (i : Bool × Bool) => m64Intrinsic_exists_coordinate_face_of_chosen_cap |
| 56 | (C.cap e i) (C.radius_pos e) (C.cap_source e i) (C.cap_smooth e i) (C.cap_inverse_smooth e i) |
| 57 | exact ⟨{ |
| 58 | face := face |
| 59 | coordinates := Q |
| 60 | basis := b |
| 61 | smooth := hQ |
| 62 | inverse_smooth := hQi |
| 63 | source := hsource |
| 64 | carrier := hcarrier |
| 65 | boundary := hboundary |
| 66 | original_carrier := hface |
| 67 | original_zero := hzero |
| 68 | original_one := hone |
| 69 | original_two := htwo }⟩ |
| 70 | |
| 71 | end M64IntrinsicThreeArcCaps |
| 72 | |
| 73 | namespace M64IntrinsicThreeArcCapFaces |
| 74 | |
| 75 | variable {gamma : Bool → ℝ → AnnulusCoordinates} {sigma : ℝ → AnnulusCoordinates} |
| 76 | {T : Bool → ℝ} {S : ℝ} {U : Set AnnulusCoordinates} |
| 77 | {C : M64IntrinsicThreeArcCaps gamma sigma T S U} |
| 78 | (A : M64IntrinsicThreeArcCapFaces C) |
| 79 | |
| 80 | /-- The occupied face union is the original occupied cap carrier. Source: MT Claim 19.40; |
| 81 | combined-boundary-collar derivation, Section 6. Construction: |
| 82 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Section 6. -/ |
| 83 | theorem occupied_union (e : Bool) : |
| 84 | (⋃ i, ⋃ (_ : if C.positive e then i = (true, true) else i ≠ (true, true)), |
| 85 | (A.face e i).carrier) = C.carrier e := by |
| 86 | simp only [A.original_carrier] |
| 87 | |
| 88 | /-- Each chosen face stays in its original signed sector. Source: MT Claim 19.40; |
| 89 | combined-boundary-collar derivation, Section 6. Construction: |
| 90 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Section 6. -/ |
| 91 | theorem sector (e : Bool) (i : Bool × Bool) : |
| 92 | (A.face e i).carrier ⊆ C.chart e '' ((C.chart e).source ∩ |
| 93 | (sectorParameterEquiv 0 i) '' {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2}) := by |
| 94 | rw [A.original_carrier] |
| 95 | exact C.cap_sector e i |
| 96 | |
| 97 | /-- The original second axis is the same face edge. Source: MT Claim 19.40; |
| 98 | combined-boundary-collar derivation, Section 6. Construction: |
| 99 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Section 6. -/ |
| 100 | theorem second (e : Bool) (i : Bool × Bool) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : |
| 101 | ((A.face e i).boundary 1).map t = |
| 102 | C.chart e (sectorParameterEquiv 0 i (0, t * C.radius e)) := by |
| 103 | rw [A.original_one] |
| 104 | exact C.cap_second e i _ ⟨mul_nonneg ht.1 (C.radius_pos e).le, |
| 105 | mul_le_of_le_one_left (C.radius_pos e).le ht.2⟩ |
| 106 | |
| 107 | /-- The original first axis is the same face edge. Source: MT Claim 19.40; |
| 108 | combined-boundary-collar derivation, Section 6. Construction: |
| 109 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Section 6. -/ |
| 110 | theorem first (e : Bool) (i : Bool × Bool) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : |
| 111 | ((A.face e i).boundary 2).map t = |
| 112 | C.chart e (sectorParameterEquiv 0 i (t * C.radius e, 0)) := by |
| 113 | rw [A.original_two] |
| 114 | exact C.cap_first e i _ ⟨mul_nonneg ht.1 (C.radius_pos e).le, |
| 115 | mul_le_of_le_one_left (C.radius_pos e).le ht.2⟩ |
| 116 | |
| 117 | /-- The exposed face edge is the actual fixed straight chord. Source: MT Claim 19.40; |
| 118 | combined-boundary-collar derivation, Section 6. Construction: |
| 119 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Section 6. -/ |
| 120 | theorem chord (e : Bool) (i : Bool × Bool) (t : ℝ) : ((A.face e i).boundary 0).map t = |
| 121 | (1 - t) • C.chart e (sectorParameterEquiv 0 i (C.radius e, 0)) + |
| 122 | t • C.chart e (sectorParameterEquiv 0 i (0, C.radius e)) := by |
| 123 | rw [A.original_zero, C.cap_chord, |
| 124 | C.cap_first e i (C.radius e) ⟨(C.radius_pos e).le, le_rfl⟩, |
| 125 | C.cap_second e i (C.radius e) ⟨(C.radius_pos e).le, le_rfl⟩] |
| 126 | |
| 127 | /-- All faces at one original corner are canonically compatible in their actual coordinates. |
| 128 | Source: MT Claim 19.40; combined-boundary-collar derivation, Section 6. Construction: |
| 129 | proof-work/tasks/M64/derivations/2026-09-27-combined-boundary-collar.md, Section 6. -/ |
| 130 | theorem canonical (e : Bool) (i j : Bool × Bool) (hij : i ≠ j) : |
| 131 | CoordinateTriangleBoundaryIntersection (A.coordinates e i) (A.coordinates e j) |
| 132 | (A.basis e i) (A.basis e j) := by |
| 133 | apply m64Intrinsic_retained_caps_canonical_compatibility (C.chart e) (C.radius_pos e) |
| 134 | (A.face e) (A.coordinates e) (A.basis e) (A.carrier e) (A.boundary e) (A.sector e) |
| 135 | (fun i => ?_) (C.axes_source e) (A.second e) (A.first e) i j hij |
| 136 | rw [A.original_carrier] |
| 137 | exact C.cap_axis_contact e i |
| 138 | |
| 139 | end M64IntrinsicThreeArcCapFaces |
| 140 | |
| 141 | end PoincareMT |