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.Matched.RegionParents |
| 2 | |
| 3 | /-! |
| 4 | # Matched regional parents retaining cap provenance |
| 5 | |
| 6 | The cap, refined-band, and residual-core parents are assembled as before, but |
| 7 | the final finite reindexing records the exact index of every unchanged cap |
| 8 | parent. This is the provenance needed to retain distinguished corner vertices. |
| 9 | |
| 10 | Context: Morgan--Tian Lemma 19.46, printed pp. 474-478; the actual two-arc |
| 11 | construction and retention of its original joins are recorded below. |
| 12 | Source/construction: |
| 13 | proof-work/tasks/M64/derivations/2026-09-25-two-arc-coordinate-triangulation.md. |
| 14 | -/ |
| 15 | |
| 16 | noncomputable section |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set |
| 21 | open scoped Topology ContDiff Manifold |
| 22 | open PoincareMT.Topology.Surface Poincare.Topology.Plane.Meshes |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | /-- The matched cap-band-core family retains every supplied cap coordinate triangle |
| 27 | literally through the final `Fin` reindexing. Source/construction: |
| 28 | proof-work/tasks/M64/derivations/2026-09-25-two-arc-coordinate-triangulation.md. -/ |
| 29 | theorem m64Intrinsic_exists_cap_band_core_coordinate_parents_retaining_caps |
| 30 | {I J : Type*} [Finite I] [Finite J] |
| 31 | (F : I → OpenPartialHomeomorph AnnulusCoordinates AnnulusCoordinates) |
| 32 | (lo : I → ℝ → ℝ) (a b ua wa ub wb ra rb : I → ℝ) |
| 33 | (B : ∀ i, ObliqueBandFaces (F i) (lo i) (a i) (b i) |
| 34 | (ua i) (wa i) (ub i) (wb i) (ra i) (rb i)) |
| 35 | (hF : ∀ i, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (F i) (F i).source) |
| 36 | (hFi : ∀ i, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (F i).symm (F i).target) |
| 37 | (hBB : ∀ (p q : (i : I) × (Fin (B i).interface.count × Bool)), p ≠ q → |
| 38 | CoordinateTriangleBoundaryIntersection |
| 39 | ((B p.1).faceCoordinates p.2) ((B q.1).faceCoordinates q.2) |
| 40 | ((B p.1).faceBasis p.2) ((B q.1).faceBasis q.2)) |
| 41 | (hcuts : ∀ i (right : Bool), ∃ u v : AnnulusCoordinates, |
| 42 | ((B i).endpointEdge right).map '' Icc (0 : ℝ) 1 = segment ℝ u v) |
| 43 | (G : J → OpenPartialHomeomorph Plane AnnulusCoordinates) |
| 44 | (d : J → AffineBasis (Fin 3) ℝ Plane) |
| 45 | (hG : ∀ j, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (G j) (G j).source) |
| 46 | (hGi : ∀ j, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (G j).symm (G j).target) |
| 47 | (hsource : ∀ j, convexHull ℝ (range (d j)) ⊆ (G j).source) |
| 48 | (hGG : ∀ j k, j ≠ k → CoordinateTriangleBoundaryIntersection (G j) (G k) (d j) (d k)) |
| 49 | (k : J → Fin 3) (u v : J → AnnulusCoordinates) |
| 50 | (hchord : ∀ j, G j '' affineSegment ℝ (d j ((k j).succAbove 0)) |
| 51 | (d j ((k j).succAbove 1)) = segment ℝ (u j) (v j)) |
| 52 | (houter : ∀ i j, (B i).carrier ∩ (G j '' convexHull ℝ (range (d j))) ⊆ |
| 53 | (B i).leftCut ∪ (B i).rightCut) |
| 54 | (hcap : ∀ i j, (B i).carrier ∩ (G j '' convexHull ℝ (range (d j))) ⊆ |
| 55 | G j '' affineSegment ℝ (d j ((k j).succAbove 0)) (d j ((k j).succAbove 1))) |
| 56 | (T : TriangleMesh) |
| 57 | (hcorecap : ∀ (t : T.Triangle) j, |
| 58 | CoordinateTriangleBoundaryIntersection (OpenPartialHomeomorph.refl AnnulusCoordinates) |
| 59 | (G j) (meshTriangleBasis T t) (d j)) |
| 60 | (hcoreband : ∀ (t : T.Triangle) i (p : Fin (B i).interface.count × Bool), |
| 61 | CoordinateTriangleBoundaryIntersection (OpenPartialHomeomorph.refl AnnulusCoordinates) |
| 62 | ((B i).faceCoordinates p) (meshTriangleBasis T t) ((B i).faceBasis p)) : |
| 63 | ∃ (m : ℕ) (C : Fin m → OpenPartialHomeomorph Plane AnnulusCoordinates) |
| 64 | (c : Fin m → AffineBasis (Fin 3) ℝ Plane), |
| 65 | (∀ p, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (C p) (C p).source) ∧ |
| 66 | (∀ p, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (C p).symm (C p).target) ∧ |
| 67 | (∀ p, convexHull ℝ (range (c p)) ⊆ (C p).source) ∧ |
| 68 | (∀ p q, p ≠ q → CoordinateTriangleBoundaryIntersection (C p) (C q) (c p) (c q)) ∧ |
| 69 | (⋃ p, C p '' convexHull ℝ (range (c p))) = |
| 70 | ((⋃ j, G j '' convexHull ℝ (range (d j))) ∪ ⋃ i, (B i).carrier) ∪ |
| 71 | T.toPlaneComplex.support ∧ |
| 72 | ∀ j, ∃ p, C p = G j ∧ c p = d j := by |
| 73 | classical |
| 74 | choose M hsupport _ hcontact using fun i => |
| 75 | m64Intrinsic_refine_band_faces_to_chord_family (B i) (hcuts i) G d hsource |
| 76 | k u v hchord (houter i) (hcap i) |
| 77 | let K := (i : I) × (Fin (B i).interface.count × Bool) |
| 78 | let E : K → OpenPartialHomeomorph Plane AnnulusCoordinates := |
| 79 | fun p => (B p.1).faceCoordinates p.2 |
| 80 | let e : K → AffineBasis (Fin 3) ℝ Plane := fun p => (B p.1).faceBasis p.2 |
| 81 | let mesh : K → TriangleMesh := fun p => M p.1 p.2 |
| 82 | let Child := (p : K) × (mesh p).Triangle |
| 83 | have hchild (p : Child) : convexHull ℝ (range (meshTriangleBasis (mesh p.1) p.2)) ⊆ |
| 84 | convexHull ℝ (range (e p.1)) := by |
| 85 | rw [← hsupport p.1.1 p.1.2] |
| 86 | exact meshTriangleBasis_subset_support (mesh p.1) p.2 |
| 87 | have hEsource (p : K) : convexHull ℝ (range (e p)) ⊆ (E p).source := |
| 88 | (B p.1).face_triangle_subset_source p.2 |
| 89 | obtain ⟨hchildren, hcover⟩ := m64Intrinsic_coordinate_mesh_family_canonical |
| 90 | E e hEsource hBB mesh (fun p => hsupport p.1 p.2) |
| 91 | let A := J ⊕ (Child ⊕ T.Triangle) |
| 92 | let C : A → OpenPartialHomeomorph Plane AnnulusCoordinates := Sum.elim G |
| 93 | (Sum.elim (fun p => E p.1) (fun _ => OpenPartialHomeomorph.refl AnnulusCoordinates)) |
| 94 | let c : A → AffineBasis (Fin 3) ℝ Plane := Sum.elim d |
| 95 | (Sum.elim (fun p => meshTriangleBasis (mesh p.1) p.2) (meshTriangleBasis T)) |
| 96 | have hC (p : A) : ContMDiffOn (𝓡 2) (𝓡 2) ∞ (C p) (C p).source := by |
| 97 | rcases p with j | p |
| 98 | · exact hG j |
| 99 | · rcases p with p | t |
| 100 | · exact (B p.1.1).smooth_faceCoordinates (hF p.1.1) p.1.2 |
| 101 | · exact contMDiffOn_id |
| 102 | have hCi (p : A) : ContMDiffOn (𝓡 2) (𝓡 2) ∞ (C p).symm (C p).target := by |
| 103 | rcases p with j | p |
| 104 | · exact hGi j |
| 105 | · rcases p with p | t |
| 106 | · exact (B p.1.1).smooth_faceCoordinates_symm (hFi p.1.1) p.1.2 |
| 107 | · exact contMDiffOn_id |
| 108 | have hCsource (p : A) : convexHull ℝ (range (c p)) ⊆ (C p).source := by |
| 109 | rcases p with j | p |
| 110 | · exact hsource j |
| 111 | · rcases p with p | t |
| 112 | · exact (hchild p).trans (hEsource p.1) |
| 113 | · exact subset_univ _ |
| 114 | have hcorechild (t : T.Triangle) (p : Child) : |
| 115 | CoordinateTriangleBoundaryIntersection (OpenPartialHomeomorph.refl AnnulusCoordinates) |
| 116 | (E p.1) (meshTriangleBasis T t) (meshTriangleBasis (mesh p.1) p.2) := |
| 117 | m64Intrinsic_canonical_contact_children _ _ (meshTriangleBasis T t) (e p.1) |
| 118 | (meshTriangleBasis T t) (meshTriangleBasis (mesh p.1) p.2) |
| 119 | (subset_univ _) (hEsource p.1) (Subset.refl _) (hchild p) |
| 120 | (hcoreband t p.1.1 p.1.2) |
| 121 | have hparents (p q : A) (hpq : p ≠ q) : |
| 122 | CoordinateTriangleBoundaryIntersection (C p) (C q) (c p) (c q) := by |
| 123 | rcases p with j | p |
| 124 | · rcases q with l | q |
| 125 | · exact hGG j l (fun h => hpq (congrArg Sum.inl h)) |
| 126 | · rcases q with q | t |
| 127 | · exact (hcontact q.1.1 q.1.2 q.2 j).symm |
| 128 | · exact (hcorecap t j).symm |
| 129 | · rcases p with p | t |
| 130 | · rcases q with j | q |
| 131 | · exact hcontact p.1.1 p.1.2 p.2 j |
| 132 | · rcases q with q | s |
| 133 | · exact hchildren p q (fun h => hpq (congrArg (Sum.inr ∘ Sum.inl) h)) |
| 134 | · exact (hcorechild s p).symm |
| 135 | · rcases q with j | q |
| 136 | · exact hcorecap t j |
| 137 | · rcases q with q | s |
| 138 | · exact hcorechild t q |
| 139 | · exact mesh_coordinate_triangle_intersection T |
| 140 | (OpenPartialHomeomorph.refl AnnulusCoordinates) (subset_univ _) t s |
| 141 | (fun h => hpq (congrArg (Sum.inr ∘ Sum.inr) h)) |
| 142 | have hbands : (⋃ p : K, E p '' convexHull ℝ (range (e p))) = |
| 143 | ⋃ i, (B i).carrier := by |
| 144 | ext x |
| 145 | simp only [K, E, e, mem_iUnion, Sigma.exists, ← ObliqueBandFaces.face_carrier_eq_coordinates] |
| 146 | simp only [ObliqueBandFaces.carrier, mem_iUnion] |
| 147 | have htotal : (⋃ p : A, C p '' convexHull ℝ (range (c p))) = |
| 148 | ((⋃ j, G j '' convexHull ℝ (range (d j))) ∪ ⋃ i, (B i).carrier) ∪ |
| 149 | T.toPlaneComplex.support := by |
| 150 | simp only [A, C, c, iUnion_sum, Sum.elim_inl, Sum.elim_inr, |
| 151 | OpenPartialHomeomorph.refl_apply, image_id] |
| 152 | rw [hcover, hbands, meshTriangleBasis_sources_cover, union_assoc] |
| 153 | let _ := Fintype.ofFinite A |
| 154 | let index := Fintype.equivFin A |
| 155 | refine ⟨Fintype.card A, C ∘ index.symm, c ∘ index.symm, |
| 156 | fun p => hC _, fun p => hCi _, fun p => hCsource _, ?_, ?_, ?_⟩ |
| 157 | · intro p q hpq |
| 158 | exact hparents _ _ (fun h => hpq (index.symm.injective h)) |
| 159 | · rw [← htotal] |
| 160 | ext x |
| 161 | constructor |
| 162 | · rintro hx |
| 163 | obtain ⟨p, hp⟩ := mem_iUnion.mp hx |
| 164 | exact mem_iUnion.mpr ⟨index.symm p, hp⟩ |
| 165 | · rintro hx |
| 166 | obtain ⟨p, hp⟩ := mem_iUnion.mp hx |
| 167 | refine mem_iUnion.mpr ⟨index p, ?_⟩ |
| 168 | simpa only [Function.comp_apply, index.symm_apply_apply] using hp |
| 169 | · intro j |
| 170 | refine ⟨index (Sum.inl j), ?_, ?_⟩ |
| 171 | · simp only [Function.comp_apply, index.symm_apply_apply, C, Sum.elim_inl] |
| 172 | · simp only [Function.comp_apply, index.symm_apply_apply, c, Sum.elim_inl] |
| 173 | |
| 174 | end PoincareMT |