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.RicciFlow.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.CapTopology.NeckRegions |
| 3 | |
| 4 | /-! |
| 5 | # The actual first-end barrier of a neck chain |
| 6 | |
| 7 | Morgan--Tian Definition A.12, pp. 504-505, and Claim 10.3, pp. 248-249. |
| 8 | The pairwise negative-end exclusion confines intersections with each later |
| 9 | neck to an actual compact slab. It therefore excludes additional relative |
| 10 | closure points, even for an infinite chain with no uniform cutoff. For a |
| 11 | least chain index this identifies the cutoff frontier in the entire tube. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT |
| 22 | |
| 23 | variable {M : Type u} [TopologicalSpace M] [T2Space M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 25 | [IsManifold (𝓡 3) ∞ M] {g : RiemannianMetric 3 M} |
| 26 | |
| 27 | /-- Pairwise no-return and compact actual slabs exclude new negative-tail |
| 28 | closure points in every later neck; a common cutoff is not required. -/ |
| 29 | theorem BalancedNeckChain.closure_region_inter_later_carrier_subset |
| 30 | {ε : ℝ} (C : BalancedNeckChain g ε) {i j : ℤ} |
| 31 | (hi : i ∈ C.shape.active) (hj : j ∈ C.shape.active) (hij : i ≤ j) |
| 32 | {s : ℝ} (hs : s < ε⁻¹) : |
| 33 | closure ((C.neck i).region (-ε⁻¹) s) ∩ (C.neck j).carrier ⊆ |
| 34 | (C.neck i).carrier := by |
| 35 | intro x hx |
| 36 | rcases hij.eq_or_lt with rfl | hij |
| 37 | · exact hx.2 |
| 38 | obtain ⟨c, hc, hdis⟩ := C.later_disjoint_negative_end i hi j hj hij |
| 39 | have hcN : -(C.neck i).epsilon⁻¹ < c := by |
| 40 | rw [C.epsilon_eq i hi] |
| 41 | exact hc.1 |
| 42 | have hsN : s < (C.neck i).epsilon⁻¹ := by |
| 43 | rwa [C.epsilon_eq i hi] |
| 44 | let K : Set M := (C.neck i).coordinate_map '' (univ ×ˢ Icc c s) |
| 45 | have hK : IsCompact K := (C.neck i).isCompact_coordinate_slab_intrinsic hcN hsN |
| 46 | have hinter : (C.neck i).region (-ε⁻¹) s ∩ (C.neck j).carrier ⊆ K := by |
| 47 | intro y hy |
| 48 | have hcy : c ≤ ((C.neck i).coordinate_inverse y).2 := by |
| 49 | by_contra h |
| 50 | exact Set.disjoint_left.mp hdis hy.2 ⟨hy.1.1, hy.1.2.1, lt_of_not_ge h⟩ |
| 51 | exact ⟨(C.neck i).coordinate_inverse y, ⟨mem_univ _, hcy, hy.1.2.2.le⟩, |
| 52 | (C.neck i).coordinate_map_coordinate_inverse hy.1.1⟩ |
| 53 | have hxK : x ∈ K := by |
| 54 | by_contra hxnot |
| 55 | obtain ⟨y, hyO, hyW⟩ := mem_closure_iff.mp hx.1 ((C.neck j).carrier \ K) |
| 56 | ((C.neck j).carrier_open.sdiff hK.isClosed) ⟨hx.2, hxnot⟩ |
| 57 | exact hyO.2 (hinter ⟨hyW, hyO.1⟩) |
| 58 | exact (C.neck i).coordinate_slab_subset_carrier_m28 hcN hsN hxK |
| 59 | |
| 60 | /-- At a genuine least chain index, the cutoff sphere is the entire |
| 61 | relative frontier of the first neck's negative tail in the actual tube. -/ |
| 62 | theorem EpsilonTubeCertificate.frontier_first_region {X : Set M} |
| 63 | (T : EpsilonTubeCertificate g X) {i : ℤ} (hi : IsLeast T.chain.shape.active i) |
| 64 | {s : ℝ} (hslo : -T.epsilon⁻¹ < s) (hshi : s < T.epsilon⁻¹) : |
| 65 | frontier ((T.chain.neck i).region (-T.epsilon⁻¹) s) ∩ T.carrier = |
| 66 | (T.chain.neck i).coordinate_map '' (univ ×ˢ ({s} : Set ℝ)) := by |
| 67 | let N := T.chain.neck i |
| 68 | have hε : N.epsilon = T.epsilon := T.chain.epsilon_eq i hi.1 |
| 69 | have hW : IsOpen (N.region (-T.epsilon⁻¹) s) := N.region_open _ _ |
| 70 | ext x |
| 71 | constructor |
| 72 | · intro hx |
| 73 | have hxcl : x ∈ closure (N.region (-T.epsilon⁻¹) s) := |
| 74 | frontier_subset_closure hx.1 |
| 75 | have hxnot : x ∉ N.region (-T.epsilon⁻¹) s := (hW.frontier_eq ▸ hx.1).2 |
| 76 | have hxT : x ∈ ⋃ j : {j // j ∈ T.chain.shape.active}, |
| 77 | (T.chain.neck j.1).carrier := T.carrier_eq_chain_union ▸ hx.2 |
| 78 | obtain ⟨j, hxj⟩ := mem_iUnion.mp hxT |
| 79 | have hxN : x ∈ N.carrier := |
| 80 | T.chain.closure_region_inter_later_carrier_subset hi.1 j.2 (hi.2 j.2) |
| 81 | hshi ⟨hxcl, hxj⟩ |
| 82 | have hlo : -T.epsilon⁻¹ < (N.coordinate_inverse x).2 := by |
| 83 | simpa only [hε] using (N.coordinate_inverse_mem x hxN).2.1 |
| 84 | have hhi : (N.coordinate_inverse x).2 < T.epsilon⁻¹ := by |
| 85 | simpa only [hε] using (N.coordinate_inverse_mem x hxN).2.2 |
| 86 | have hheight : (N.coordinate_inverse x).2 = s := by |
| 87 | rcases lt_trichotomy (N.coordinate_inverse x).2 s with hlt | heq | hgt |
| 88 | · exact False.elim (hxnot ⟨hxN, hlo, hlt⟩) |
| 89 | · exact heq |
| 90 | · obtain ⟨y, hyouter, hyW⟩ := mem_closure_iff.mp hxcl |
| 91 | (N.region s T.epsilon⁻¹) (N.region_open _ _) ⟨hxN, hgt, hhi⟩ |
| 92 | exact False.elim ((not_lt_of_ge hyW.2.2.le) hyouter.2.1) |
| 93 | exact ⟨N.coordinate_inverse x, ⟨mem_univ _, hheight⟩, |
| 94 | N.coordinate_map_coordinate_inverse hxN⟩ |
| 95 | · rintro ⟨z, hz, rfl⟩ |
| 96 | have hzs : z.2 = s := hz.2 |
| 97 | have hzN : z.2 ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := by |
| 98 | rw [hε, hzs] |
| 99 | exact ⟨hslo, hshi⟩ |
| 100 | have hzcl : z ∈ closure (univ ×ˢ Ioo (-T.epsilon⁻¹) s) := by |
| 101 | rw [closure_prod_eq, closure_univ, closure_Ioo hslo.ne] |
| 102 | exact ⟨mem_univ _, by rw [hzs]; exact ⟨hslo.le, le_rfl⟩⟩ |
| 103 | have hcont : ContinuousAt N.coordinate_map z := |
| 104 | N.coordinate_map_smooth.continuousOn.continuousAt |
| 105 | ((isOpen_univ.prod isOpen_Ioo).mem_nhds ⟨mem_univ _, hzN⟩) |
| 106 | have himage : N.coordinate_map '' (univ ×ˢ Ioo (-T.epsilon⁻¹) s) ⊆ |
| 107 | N.region (-T.epsilon⁻¹) s := by |
| 108 | rintro y ⟨w, hw, rfl⟩ |
| 109 | have hwN : w.2 ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := by |
| 110 | rw [hε] |
| 111 | exact ⟨hw.2.1, hw.2.2.trans hshi⟩ |
| 112 | refine ⟨N.coordinate_map_mem_of_axial w hwN, ?_⟩ |
| 113 | rw [N.coordinate_inverse_coordinate_map_of_axial w hwN] |
| 114 | exact hw.2 |
| 115 | have hxcl : N.coordinate_map z ∈ closure (N.region (-T.epsilon⁻¹) s) := |
| 116 | closure_mono himage (hcont.continuousWithinAt.mem_closure_image hzcl) |
| 117 | have hxnot : N.coordinate_map z ∉ N.region (-T.epsilon⁻¹) s := by |
| 118 | intro hxW |
| 119 | have hlt := hxW.2.2 |
| 120 | rw [N.coordinate_inverse_coordinate_map_of_axial z hzN, hzs] at hlt |
| 121 | exact (lt_irrefl s) hlt |
| 122 | refine ⟨hW.frontier_eq.symm ▸ And.intro hxcl hxnot, ?_⟩ |
| 123 | rw [T.carrier_eq_chain_union] |
| 124 | exact mem_iUnion.mpr ⟨⟨i, hi.1⟩, N.coordinate_map_mem_of_axial z hzN⟩ |
| 125 | |
| 126 | end PoincareMT |