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.Tube.CompactGeometry.CompactCapSide |
| 3 | |
| 4 | /-! |
| 5 | # One actual confinement set for a cap endpoint and a neck endpoint |
| 6 | |
| 7 | Morgan--Tian Claim 10.3, printed pp. 248-249. The genuine compact cap |
| 8 | side is enlarged by the selected endpoint neck's compact middle slab. |
| 9 | Every path from the cap to the selected sphere that leaves this same K |
| 10 | has two actual sphere hits surrounding a middle-neck excursion. These |
| 11 | are the geometric inputs consumed by `ConfinementMinimizers`. |
| 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.CappedTubeCertificate |
| 22 | |
| 23 | variable {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 25 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 26 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} |
| 27 | |
| 28 | /-- The actual cap/neck geometry produces one compact K and literal |
| 29 | central-sphere return times for every path exiting it. No minimizing |
| 30 | sequence, compact-side or return-crossing assumption is added (Claim 10.3). -/ |
| 31 | theorem exists_core_neck_confinement (T : CappedTubeCertificate g) |
| 32 | (N : EpsilonNeck g) (hNU : N.carrier ⊆ T.tube.carrier) |
| 33 | (hS : SmoothSphereIsotopicIn T.tube.carrier N.central_sphere |
| 34 | T.tube.cylinder.middleSphere) |
| 35 | (hcapN : Disjoint T.cap.carrier N.carrier) : |
| 36 | ∃ K : Set M, IsCompact K ∧ K ⊆ T.carrier ∧ |
| 37 | ∀ γ : ℝ → M, γ 0 ∈ T.cap.carrier → γ 1 ∈ N.central_sphere → |
| 38 | ContinuousOn γ (Icc (0 : ℝ) 1) → MapsTo γ (Icc (0 : ℝ) 1) T.carrier → |
| 39 | ∀ t ∈ Icc (0 : ℝ) 1, γ t ∉ K → |
| 40 | ∃ c d : ℝ, 0 ≤ c ∧ c ≤ t ∧ t ≤ d ∧ d ≤ 1 ∧ |
| 41 | γ c ∈ N.central_sphere ∧ γ d ∈ N.central_sphere ∧ |
| 42 | γ t ∉ N.region (-(N.epsilon⁻¹ / 2)) (N.epsilon⁻¹ / 2) := by |
| 43 | obtain ⟨C, hC, hCU, hcapC, _, hfront⟩ := |
| 44 | T.exists_compact_cap_side hS (hcapN.mono_right N.central_sphere_subset) |
| 45 | have hA : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 46 | let D := N.coordinate_map '' (univ ×ˢ Icc (-(N.epsilon⁻¹ / 2)) (N.epsilon⁻¹ / 2)) |
| 47 | have hD : IsCompact D := N.isCompact_coordinate_slab_intrinsic (by linarith) (by linarith) |
| 48 | have hDN : D ⊆ N.carrier := N.coordinate_slab_subset_carrier_m28 (by linarith) (by linarith) |
| 49 | have hmiddle : N.region (-(N.epsilon⁻¹ / 2)) (N.epsilon⁻¹ / 2) ⊆ D := by |
| 50 | intro x hx |
| 51 | exact ⟨N.coordinate_inverse x, ⟨mem_univ _, hx.2.1.le, hx.2.2.le⟩, |
| 52 | N.coordinate_map_coordinate_inverse hx.1⟩ |
| 53 | let K := C ∪ D |
| 54 | refine ⟨K, hC.union hD, union_subset hCU ((hDN.trans hNU).trans T.tube_subset), ?_⟩ |
| 55 | intro γ hγ₀ hγ₁ hγ _hγU t ht htK |
| 56 | have htC : γ t ∉ C := fun hx => htK (Or.inl hx) |
| 57 | have h₀C : γ 0 ∈ C := interior_subset (hcapC hγ₀) |
| 58 | have hexit : γ t ∉ N.region (-(N.epsilon⁻¹ / 2)) (N.epsilon⁻¹ / 2) := |
| 59 | fun hx => htK (Or.inr (hmiddle hx)) |
| 60 | have hcross : ∃ c ∈ Icc (0 : ℝ) t, γ c ∈ N.central_sphere := by |
| 61 | have hcomp : IsOpen Cᶜ := hC.isClosed.isOpen_compl |
| 62 | have hconn : IsPreconnected (γ '' Icc (0 : ℝ) t) := |
| 63 | isPreconnected_Icc.image γ (hγ.mono (Icc_subset_Icc le_rfl ht.2)) |
| 64 | by_contra havoid |
| 65 | push Not at havoid |
| 66 | have hsubset : γ '' Icc (0 : ℝ) t ⊆ Cᶜ := by |
| 67 | apply hconn.subset_of_closure_inter_subset hcomp |
| 68 | ⟨γ t, ⟨t, right_mem_Icc.mpr ht.1, rfl⟩, htC⟩ |
| 69 | rintro x ⟨hxcl, c, hc, rfl⟩ |
| 70 | by_contra hcnot |
| 71 | have hfc : γ c ∈ frontier Cᶜ := hcomp.frontier_eq.symm ▸ And.intro hxcl hcnot |
| 72 | have hfC : γ c ∈ frontier C := by simpa only [frontier_compl] using hfc |
| 73 | exact havoid c hc (hfront hfC) |
| 74 | exact (hsubset ⟨0, left_mem_Icc.mpr ht.1, rfl⟩) h₀C |
| 75 | obtain ⟨c, hc, hcsphere⟩ := hcross |
| 76 | exact ⟨c, 1, hc.1, hc.2, ht.2, le_rfl, hcsphere, hγ₁, hexit⟩ |
| 77 | |
| 78 | end PoincareMT.CappedTubeCertificate |