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.Marked.CoordinateParents |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Region.RefinementCorner |
| 3 | |
| 4 | /-! One synchronized coordinate triangulation with actual marked vertices. |
| 5 | Source: MT Claim 19.40, pp. 470-471; combined-boundary-collar derivation, |
| 6 | Section 9. All contacts and marked vertices belong to the same refinement. -/ |
| 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 Manifold |
| 14 | open PoincareMT.Topology.Surface Poincare.Topology.Plane.Meshes |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | /-- An actual finite smooth coordinate triangulation with exact support and full edge or |
| 19 | vertex contacts. Source: MT Claim 19.40; combined-boundary-collar derivation, Section 9. |
| 20 | Source: Morgan--Tian Proposition 19.35, printed pp. 467-481, especially the regional |
| 21 | Gauss--Bonnet argument of Lemma 19.45, p. 474; the explicit coordinate construction is |
| 22 | reviewed in `proof-work/tasks/M64/reviews/2026-09-27-round1-intrinsic-contacts.md`, |
| 23 | Mathematical Checks. -/ |
| 24 | structure M64IntrinsicCoordinateTriangulation (K : Set AnnulusCoordinates) where |
| 25 | count : ℕ |
| 26 | face : Fin count → SmoothFace AnnulusCoordinates |
| 27 | coordinates : Fin count → OpenPartialHomeomorph Plane AnnulusCoordinates |
| 28 | basis : Fin count → AffineBasis (Fin 3) ℝ Plane |
| 29 | smooth : ∀ p, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (coordinates p) (coordinates p).source |
| 30 | inverse_smooth : ∀ p, |
| 31 | ContMDiffOn (𝓡 2) (𝓡 2) ∞ (coordinates p).symm (coordinates p).target |
| 32 | source : ∀ p, convexHull ℝ (range (basis p)) ⊆ (coordinates p).source |
| 33 | carrier : ∀ p, (face p).carrier = coordinates p '' convexHull ℝ (range (basis p)) |
| 34 | boundary : ∀ p k, ((face p).boundary k).map = coordinates p ∘ |
| 35 | affineChartSegment (basis p (k.succAbove 0)) (basis p (k.succAbove 1)) |
| 36 | intersection_frontier : ∀ p q, p ≠ q → |
| 37 | (face p).carrier ∩ (face q).carrier ⊆ frontier (face p).carrier |
| 38 | intersections : ∀ p q, p ≠ q → |
| 39 | (∃ k l : Fin 3, (face p).carrier ∩ (face q).carrier = |
| 40 | ((face p).boundary k).map '' Icc (0 : ℝ) 1 ∧ |
| 41 | ((face p).boundary k).map '' Icc (0 : ℝ) 1 = ((face q).boundary l).map '' Icc (0 : ℝ) 1) ∨ |
| 42 | ∃ v : Fin 3, (face p).carrier ∩ (face q).carrier ⊆ {coordinates p (basis p v)} |
| 43 | cover : (⋃ p, (face p).carrier) = K |
| 44 | |
| 45 | /-- Compatible actual parents give one synchronized triangulation that retains every |
| 46 | prescribed support point as a vertex. Source: MT Claim 19.40; combined-boundary-collar |
| 47 | derivation, Section 9. Source: Morgan--Tian Proposition 19.35, printed pp. 467-481, |
| 48 | especially the regional Gauss--Bonnet argument of Lemma 19.45, p. 474; the explicit |
| 49 | coordinate construction is reviewed in |
| 50 | `proof-work/tasks/M64/reviews/2026-09-27-round1-intrinsic-contacts.md`, Mathematical Checks. -/ |
| 51 | theorem m64Intrinsic_exists_marked_region_triangulation |
| 52 | {I : Type*} [Finite I] |
| 53 | (F : I → OpenPartialHomeomorph Plane AnnulusCoordinates) |
| 54 | (b : I → AffineBasis (Fin 3) ℝ Plane) |
| 55 | (hF : ∀ i, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (F i) (F i).source) |
| 56 | (hFi : ∀ i, ContMDiffOn (𝓡 2) (𝓡 2) ∞ (F i).symm (F i).target) |
| 57 | (hsource : ∀ i, convexHull ℝ (range (b i)) ⊆ (F i).source) |
| 58 | (hparents : ∀ i j, i ≠ j → CoordinateTriangleBoundaryIntersection (F i) (F j) (b i) (b j)) |
| 59 | {K : Set AnnulusCoordinates} (hcover : (⋃ i, F i '' convexHull ℝ (range (b i))) = K) |
| 60 | (marks : Finset AnnulusCoordinates) (hmarks : (marks : Set AnnulusCoordinates) ⊆ K) : |
| 61 | ∃ R : M64IntrinsicCoordinateTriangulation K, |
| 62 | ∀ q ∈ marks, ∃ v : Euler.CoordinateVertex R.coordinates R.basis, v.1 = q := by |
| 63 | classical |
| 64 | obtain ⟨n, G, d, hG, hGi, hGs, hGp, hGc, hkeep⟩ := |
| 65 | m64Intrinsic_exists_marked_coordinate_parents F b hF hFi hsource hparents marks |
| 66 | (hmarks.trans hcover.symm.subset) |
| 67 | obtain ⟨_, R, hcompat, hcov⟩ := |
| 68 | m64Intrinsic_exists_compatible_region_refinement G d hG hGi hGs hGp |
| 69 | let Child := (i : Fin n) × (R i).mesh.Triangle |
| 70 | let _ := Fintype.ofFinite Child |
| 71 | let index := Fintype.equivFin Child |
| 72 | let face (p : Fin (Fintype.card Child)) := (R (index.symm p).1).face (index.symm p).2 |
| 73 | let C (p : Fin (Fintype.card Child)) := G (index.symm p).1 |
| 74 | let basis (p : Fin (Fintype.card Child)) := |
| 75 | meshTriangleBasis (R (index.symm p).1).mesh (index.symm p).2 |
| 76 | have htotal : (⋃ p, (face p).carrier) = K := by |
| 77 | rw [← hcover, ← hGc, ← hcov] |
| 78 | ext x |
| 79 | constructor |
| 80 | · intro hx |
| 81 | obtain ⟨p, hp⟩ := mem_iUnion.mp hx |
| 82 | exact mem_iUnion.mpr ⟨index.symm p, hp⟩ |
| 83 | · intro hx |
| 84 | obtain ⟨p, hp⟩ := mem_iUnion.mp hx |
| 85 | apply mem_iUnion.mpr |
| 86 | refine ⟨index p, ?_⟩ |
| 87 | change x ∈ ((R (index.symm (index p)).1).face (index.symm (index p)).2).carrier |
| 88 | rw [index.symm_apply_apply] |
| 89 | exact hp |
| 90 | let triangulation : M64IntrinsicCoordinateTriangulation K := |
| 91 | { count := Fintype.card Child |
| 92 | face := face |
| 93 | coordinates := C |
| 94 | basis := basis |
| 95 | smooth := fun p => hG _ |
| 96 | inverse_smooth := fun p => hGi _ |
| 97 | source := fun p => (R (index.symm p).1).source_subset (index.symm p).2 |
| 98 | carrier := fun p => (R (index.symm p).1).carrier_eq (index.symm p).2 |
| 99 | boundary := fun p k => (R (index.symm p).1).boundary_map (index.symm p).2 k |
| 100 | intersection_frontier := fun p q hpq => (hcompat (index.symm p) (index.symm q) |
| 101 | (fun h => hpq (index.symm.injective h))).2 |
| 102 | intersections := fun p q hpq => (hcompat (index.symm p) (index.symm q) |
| 103 | (fun h => hpq (index.symm.injective h))).1 |
| 104 | cover := htotal } |
| 105 | refine ⟨triangulation, ?_⟩ |
| 106 | intro q hq |
| 107 | obtain ⟨p, k, hpk⟩ := hkeep q hq |
| 108 | obtain ⟨v, hv⟩ := m64Intrinsic_coordinate_parent_corner_retained G d R p k |
| 109 | obtain ⟨⟨s, j⟩, hsj⟩ := v.property |
| 110 | refine ⟨Euler.coordinateCorner C basis (index s) j, ?_⟩ |
| 111 | change G (index.symm (index s)).1 |
| 112 | (meshTriangleBasis (R (index.symm (index s)).1).mesh (index.symm (index s)).2 j) = q |
| 113 | rw [index.symm_apply_apply] |
| 114 | exact hsj.trans (hv.trans hpk) |
| 115 | |
| 116 | end PoincareMT |