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.Cap.Intersections |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Region.Refinement |
| 3 | import PoincareLib.Topology.Surface.Euler.EdgeGeometry |
| 4 | |
| 5 | /-! |
| 6 | # Canonical compatibility of the actual signed caps |
| 7 | |
| 8 | The already constructed common-axis intersections are converted to exact |
| 9 | canonical coordinate-edge intervals. Neighboring caps share the original |
| 10 | full radial arc, while opposite caps meet only at the original corner. |
| 11 | This supplies the cap-cap parent data for the regional subdivision. |
| 12 | |
| 13 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. These project |
| 14 | Jordan-region constructions supply the actual domains, boundary charts and finite |
| 15 | faces used in its regional Gauss--Bonnet arguments. |
| 16 | -/ |
| 17 | |
| 18 | noncomputable section |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set |
| 23 | open scoped Topology ContDiff Manifold |
| 24 | open PoincareMT.Topology.Surface ChartCircleArrangementVertexPatch |
| 25 | |
| 26 | namespace PoincareMT |
| 27 | |
| 28 | private theorem cap_scaled_axes_image {r : ℝ} (hr : 0 < r) : |
| 29 | (fun t : ℝ => (t * r, (0 : ℝ))) '' Icc 0 1 = Icc 0 r ×ˢ {0} ∧ |
| 30 | (fun t : ℝ => ((0 : ℝ), t * r)) '' Icc 0 1 = {0} ×ˢ Icc 0 r := by |
| 31 | constructor |
| 32 | · ext z |
| 33 | constructor |
| 34 | · rintro ⟨t, ht, rfl⟩ |
| 35 | exact ⟨⟨mul_nonneg ht.1 hr.le, by nlinarith [ht.2]⟩, rfl⟩ |
| 36 | · rintro ⟨hz, hz0⟩ |
| 37 | refine ⟨z.1 / r, ⟨div_nonneg hz.1 hr.le, (div_le_one hr).mpr hz.2⟩, ?_⟩ |
| 38 | exact Prod.ext (div_mul_cancel₀ z.1 hr.ne') (mem_singleton_iff.mp hz0).symm |
| 39 | · ext z |
| 40 | constructor |
| 41 | · rintro ⟨t, ht, rfl⟩ |
| 42 | exact ⟨rfl, ⟨mul_nonneg ht.1 hr.le, by nlinarith [ht.2]⟩⟩ |
| 43 | · rintro ⟨hz0, hz⟩ |
| 44 | refine ⟨z.2 / r, ⟨div_nonneg hz.1 hr.le, (div_le_one hr).mpr hz.2⟩, ?_⟩ |
| 45 | exact Prod.ext (mem_singleton_iff.mp hz0).symm (div_mul_cancel₀ z.2 hr.ne') |
| 46 | |
| 47 | private theorem cap_compatible_of_full_shared_edge |
| 48 | (f g : SmoothFace AnnulusCoordinates) |
| 49 | (C D : OpenPartialHomeomorph AnnulusCoordinates AnnulusCoordinates) |
| 50 | (b c : AffineBasis (Fin 3) ℝ AnnulusCoordinates) |
| 51 | (hC : f.carrier = C '' convexHull ℝ (range b)) |
| 52 | (hD : g.carrier = D '' convexHull ℝ (range c)) |
| 53 | (k l : Fin 3) |
| 54 | (hk : (f.boundary k).map = C ∘ affineChartSegment (b (k.succAbove 0)) (b (k.succAbove 1))) |
| 55 | (hl : (g.boundary l).map = D ∘ affineChartSegment (c (l.succAbove 0)) (c (l.succAbove 1))) |
| 56 | (hinter : f.carrier ∩ g.carrier = (f.boundary k).map '' Icc (0 : ℝ) 1) |
| 57 | (hshared : (f.boundary k).map '' Icc (0 : ℝ) 1 = (g.boundary l).map '' Icc (0 : ℝ) 1) : |
| 58 | CoordinateTriangleBoundaryIntersection C D b c := by |
| 59 | apply CoordinateTriangleBoundaryIntersection.subsegment k l 0 1 0 1 |
| 60 | (by simp) (by simp) (by simp) (by simp) |
| 61 | · simpa only [uIcc_of_le zero_le_one, ← hC, ← hD, ← hk] using hinter |
| 62 | · simpa only [uIcc_of_le zero_le_one, ← hC, ← hD, ← hl] using hinter.trans hshared |
| 63 | |
| 64 | /-- The full signed-cap family is canonically compatible, derived from its actual sector |
| 65 | containment and full-axis contact equalities. Restricting to the occupied caps therefore |
| 66 | needs no separate cap-contact premise. Source: |
| 67 | `proof-work/tasks/M64/reports/2026-09-25-retained-parent-compatibility.md`, Retained Parent |
| 68 | Compatibility. -/ |
| 69 | theorem m64Intrinsic_retained_caps_canonical_compatibility |
| 70 | (H : OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) {r : ℝ} (hr : 0 < r) |
| 71 | (face : Bool × Bool → SmoothFace AnnulusCoordinates) |
| 72 | (C : Bool × Bool → OpenPartialHomeomorph AnnulusCoordinates AnnulusCoordinates) |
| 73 | (b : Bool × Bool → AffineBasis (Fin 3) ℝ AnnulusCoordinates) |
| 74 | (hcarrier : ∀ i, (face i).carrier = C i '' convexHull ℝ (range (b i))) |
| 75 | (hboundary : ∀ i k, ((face i).boundary k).map = C i ∘ |
| 76 | affineChartSegment (b i (k.succAbove 0)) (b i (k.succAbove 1))) |
| 77 | (hsector : ∀ i, (face i).carrier ⊆ H '' (H.source ∩ (sectorParameterEquiv 0 i) '' |
| 78 | {q : ℝ × ℝ | 0 ≤ q.1 ∧ 0 ≤ q.2})) |
| 79 | (haxes : ∀ i, (face i).carrier ∩ |
| 80 | H '' (H.source ∩ {q : ℝ × ℝ | q.1 = 0 ∨ q.2 = 0}) = |
| 81 | H '' ((sectorParameterEquiv 0 i) '' |
| 82 | ((Icc (0 : ℝ) r ×ˢ {0}) ∪ ({0} ×ˢ Icc (0 : ℝ) r)))) |
| 83 | (hsmall : ∀ i : Bool × Bool, ∀ s ∈ Icc (0 : ℝ) r, |
| 84 | sectorParameterEquiv 0 i (s, 0) ∈ H.source ∧ |
| 85 | sectorParameterEquiv 0 i (0, s) ∈ H.source) |
| 86 | (hsecond : ∀ i, ∀ t ∈ Icc (0 : ℝ) 1, ((face i).boundary 1).map t = |
| 87 | H (sectorParameterEquiv 0 i (0, t * r))) |
| 88 | (hfirst : ∀ i, ∀ t ∈ Icc (0 : ℝ) 1, ((face i).boundary 2).map t = |
| 89 | H (sectorParameterEquiv 0 i (t * r, 0))) : |
| 90 | ∀ i j, i ≠ j → CoordinateTriangleBoundaryIntersection (C i) (C j) (b i) (b j) := by |
| 91 | have hfirstimage (i : Bool × Bool) : ((face i).boundary 2).map '' Icc (0 : ℝ) 1 = |
| 92 | H '' ((sectorParameterEquiv 0 i) '' (Icc (0 : ℝ) r ×ˢ {0})) := by |
| 93 | calc |
| 94 | _ = (H ∘ (sectorParameterEquiv 0 i) ∘ (fun t : ℝ => (t * r, 0))) '' Icc 0 1 := |
| 95 | image_congr (fun t ht => hfirst i t ht) |
| 96 | _ = _ := by rw [image_comp, image_comp, (cap_scaled_axes_image hr).1] |
| 97 | have hsecondimage (i : Bool × Bool) : ((face i).boundary 1).map '' Icc (0 : ℝ) 1 = |
| 98 | H '' ((sectorParameterEquiv 0 i) '' ({0} ×ˢ Icc (0 : ℝ) r)) := by |
| 99 | calc |
| 100 | _ = (H ∘ (sectorParameterEquiv 0 i) ∘ (fun t : ℝ => (0, t * r))) '' Icc 0 1 := |
| 101 | image_congr (fun t ht => hsecond i t ht) |
| 102 | _ = _ := by rw [image_comp, image_comp, (cap_scaled_axes_image hr).2] |
| 103 | have hhorizontal (i : Bool) : |
| 104 | CoordinateTriangleBoundaryIntersection (C (i, false)) (C (i, true)) |
| 105 | (b (i, false)) (b (i, true)) := by |
| 106 | apply cap_compatible_of_full_shared_edge (face _) (face _) _ _ _ _ |
| 107 | (hcarrier _) (hcarrier _) 2 2 (hboundary _ _) (hboundary _ _) |
| 108 | · exact (m64Intrinsic_neighbor_caps_inter_horizontal H hr.le (fun i => (face i).carrier) |
| 109 | hsector haxes hsmall i).trans (hfirstimage _).symm |
| 110 | · apply image_congr |
| 111 | intro t ht |
| 112 | rw [hfirst _ t ht, hfirst _ t ht] |
| 113 | simp [sectorParameterEquiv_apply] |
| 114 | have hvertical (j : Bool) : |
| 115 | CoordinateTriangleBoundaryIntersection (C (false, j)) (C (true, j)) |
| 116 | (b (false, j)) (b (true, j)) := by |
| 117 | apply cap_compatible_of_full_shared_edge (face _) (face _) _ _ _ _ |
| 118 | (hcarrier _) (hcarrier _) 1 1 (hboundary _ _) (hboundary _ _) |
| 119 | · exact (m64Intrinsic_neighbor_caps_inter_vertical H hr.le (fun i => (face i).carrier) |
| 120 | hsector haxes hsmall j).trans (hsecondimage _).symm |
| 121 | · apply image_congr |
| 122 | intro t ht |
| 123 | rw [hsecond _ t ht, hsecond _ t ht] |
| 124 | simp [sectorParameterEquiv_apply] |
| 125 | have hcorner (i : Bool × Bool) : H 0 ∈ C i '' frontier (convexHull ℝ (range (b i))) := by |
| 126 | have hzero := hfirst i 0 (by simp) |
| 127 | have heq : C i (b i 0) = H 0 := by |
| 128 | change C i (b i 0) = H (0, 0) |
| 129 | simpa [hboundary, affineChartSegment, sectorParameterEquiv_apply] using hzero |
| 130 | rw [← heq] |
| 131 | exact mem_image_of_mem _ (Euler.coordinate_vertices_subset_frontier _ (mem_range_self 0)) |
| 132 | have hopposite (i : Bool × Bool) : |
| 133 | CoordinateTriangleBoundaryIntersection (C i) (C (!i.1, !i.2)) (b i) (b (!i.1, !i.2)) := by |
| 134 | apply CoordinateTriangleBoundaryIntersection.point (H 0) (hcorner i) (hcorner (!i.1, !i.2)) |
| 135 | rw [← hcarrier, ← hcarrier, |
| 136 | m64Intrinsic_opposite_caps_inter H hr.le (fun i => (face i).carrier) hsector haxes i] |
| 137 | rintro ⟨i, i'⟩ ⟨j, j'⟩ hij |
| 138 | cases i <;> cases i' <;> cases j <;> cases j' |
| 139 | all_goals first |
| 140 | | exact (hij rfl).elim |
| 141 | | exact hhorizontal false |
| 142 | | exact (hhorizontal false).symm |
| 143 | | exact hhorizontal true |
| 144 | | exact (hhorizontal true).symm |
| 145 | | exact hvertical false |
| 146 | | exact (hvertical false).symm |
| 147 | | exact hvertical true |
| 148 | | exact (hvertical true).symm |
| 149 | | exact hopposite (false, false) |
| 150 | | exact hopposite (false, true) |
| 151 | | exact hopposite (true, false) |
| 152 | | exact hopposite (true, true) |
| 153 | |
| 154 | end PoincareMT |