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.CapGeometry.CapRatio |
| 3 | import PoincareLib.Topology.Manifold.NeckCap.Theory |
| 4 | |
| 5 | /-! |
| 6 | # Eliminating the two cap-only branches of repaired Appendix A.21 |
| 7 | |
| 8 | The actual scalar ratio excludes a single cap and a connected union of |
| 9 | two caps. The other four geometric certificates remain available for |
| 10 | the intrinsic minimizing argument of Morgan--Tian Claim 10.3, p. 248. |
| 11 | See section 10.3.1, p. 247, and task derivation 14. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M28 |
| 22 | |
| 23 | variable {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 25 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 26 | {g : RiemannianMetric 3 M} |
| 27 | |
| 28 | /-- The four actual M25 alternatives left after the cap-only exclusions. |
| 29 | This predicate filters existing certificates; it supplies no replacement |
| 30 | geometric data (section 10.3.1, p. 247). -/ |
| 31 | def regionHasTubeOrFibration {X : Set M} (R : NeckCapRegion g X) : Prop := |
| 32 | match R with |
| 33 | | .twoCaps _ _ _ _ _ _ => False |
| 34 | | .singleCap _ _ => False |
| 35 | | .doubleCappedTube _ _ _ _ => True |
| 36 | | .cappedTube _ _ => True |
| 37 | | .tube _ => True |
| 38 | | .fibration _ => True |
| 39 | |
| 40 | /-- A large actual endpoint scalar ratio rules out exactly the two |
| 41 | cap-only alternatives in any compatible M25 region (section 10.3.1, |
| 42 | p. 247; the other four branches are retained for Claim 10.3). -/ |
| 43 | theorem regionHasTubeOrFibration_of_scalar_ratio |
| 44 | (H : ConnectedNeckCapCover g) (D : LeviCivitaData g) |
| 45 | (R : RepairedNeckCapTopologyData g H) |
| 46 | {x y : M} (hx : x ∈ H.X) (hy : y ∈ H.X) |
| 47 | (hlarge : H.cap_constant ^ 2 * D.scalarCurvature x < D.scalarCurvature y) : |
| 48 | regionHasTubeOrFibration R.region := by |
| 49 | obtain ⟨R, hcompat⟩ := R |
| 50 | cases R with |
| 51 | | twoCaps kind N N' component hunion hcontains => |
| 52 | change False |
| 53 | obtain ⟨_, _, hC, hC'⟩ := hcompat |
| 54 | have hconn : IsPreconnected (N.carrier ∪ N'.carrier) := |
| 55 | hunion ▸ component.connected.isPreconnected |
| 56 | have hbound := N.scalar_le_sq_mul_on_union N' D hC hC' |
| 57 | (N.inter_nonempty_of_preconnected_union N' hconn) |
| 58 | (hunion ▸ hcontains hx) (hunion ▸ hcontains hy) |
| 59 | exact (not_lt_of_ge hbound) hlarge |
| 60 | | singleCap N hcontains => |
| 61 | change False |
| 62 | obtain ⟨_, hC⟩ := hcompat |
| 63 | have hxN := hcontains hx |
| 64 | have hyN := hcontains hy |
| 65 | have hbound := N.scalar_le_sq_mul_on_union N D hC hC ⟨x, hxN, hxN⟩ |
| 66 | (Or.inl hxN) (Or.inl hyN) |
| 67 | exact (not_lt_of_ge hbound) hlarge |
| 68 | | doubleCappedTube _ _ _ _ => trivial |
| 69 | | cappedTube _ _ => trivial |
| 70 | | tube _ => trivial |
| 71 | | fibration _ => trivial |
| 72 | |
| 73 | /-- M25 supplies an actual compatible region in one of the four remaining |
| 74 | branches when the cover contains a sufficiently large scalar ratio. |
| 75 | Constants and the accuracy threshold precede the metric and its points |
| 76 | (section 10.3.1, p. 247; task derivation 14). -/ |
| 77 | theorem exists_tube_or_fibration_region (P : RepairedNeckCapTopologyTheory.{u}) |
| 78 | (H : ConnectedNeckCapCover g) (hsmall : H.epsilon ≤ P.epsilon₀) |
| 79 | (D : LeviCivitaData g) {x y : M} (hx : x ∈ H.X) (hy : y ∈ H.X) |
| 80 | (hlarge : H.cap_constant ^ 2 * D.scalarCurvature x < D.scalarCurvature y) : |
| 81 | ∃ R : RepairedNeckCapTopologyData g H, regionHasTubeOrFibration R.region := by |
| 82 | obtain ⟨R⟩ := P.a21 g H hsmall |
| 83 | exact ⟨R, regionHasTubeOrFibration_of_scalar_ratio H D R hx hy hlarge⟩ |
| 84 | |
| 85 | end PoincareMT.M28 |