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.OpenGeometry.OpenMetricBalls |
| 3 | |
| 4 | /-! |
| 5 | # Compact ball closures through two actual open restrictions |
| 6 | |
| 7 | Morgan--Tian Definition 5.1 and Claim 10.5, pp. 83 and 251-252. |
| 8 | An ambient compact ball closure contained in the final open region |
| 9 | remains compact for the literal nested inclusion metric. Only the |
| 10 | captured balls are identified, not arbitrary distances. M28 derivation 87. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M28 |
| 21 | |
| 22 | variable {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 24 | [IsManifold (𝓡 3) ∞ M] |
| 25 | |
| 26 | /-- A compact ambient ball closure contained in an open region gives |
| 27 | the same-radius compact closure for its inclusion metric (Definition 5.1; |
| 28 | Claim 10.5; M28 derivation 87). -/ |
| 29 | theorem intrinsicOpenMetric_isCompact_closure_ball |
| 30 | (g : RiemannianMetric 3 M) (U : TopologicalSpace.Opens M) (p : U) {r : ℝ} |
| 31 | (hcompact : IsCompact (closure (g.ball (p : M) r))) |
| 32 | (hclosure : closure (g.ball (p : M) r) ⊆ (U : Set M)) : |
| 33 | IsCompact (closure ((intrinsicOpenMetric g U).ball p r)) := by |
| 34 | rw [intrinsicOpenMetric_closure_ball_eq_preimage g U p |
| 35 | (subset_closure.trans hclosure)] |
| 36 | apply Topology.IsEmbedding.subtypeVal.isInducing.isCompact_preimage' hcompact |
| 37 | intro x hx |
| 38 | exact ⟨⟨x, hclosure hx⟩, rfl⟩ |
| 39 | |
| 40 | /-- Ambient compact capture inside two nested open regions survives |
| 41 | both actual inclusion metrics (Definition 5.1; Claim 10.5; derivation 87). -/ |
| 42 | theorem nested_intrinsicOpenMetric_isCompact_closure_ball |
| 43 | (g : RiemannianMetric 3 M) (U : TopologicalSpace.Opens M) |
| 44 | (V : TopologicalSpace.Opens U) (p : V) {r : ℝ} |
| 45 | (hcompact : IsCompact (closure (g.ball ((p : U) : M) r))) |
| 46 | (hclosure : closure (g.ball ((p : U) : M) r) ⊆ |
| 47 | (Subtype.val : U → M) '' (V : Set U)) : |
| 48 | IsCompact (closure ((intrinsicOpenMetric (intrinsicOpenMetric g U) V).ball p r)) := by |
| 49 | have hU : closure (g.ball ((p : U) : M) r) ⊆ (U : Set M) := by |
| 50 | intro x hx |
| 51 | obtain ⟨y, _hy, rfl⟩ := hclosure hx |
| 52 | exact y.property |
| 53 | have hcompactU := intrinsicOpenMetric_isCompact_closure_ball g U (p : U) hcompact hU |
| 54 | have hV : closure ((intrinsicOpenMetric g U).ball (p : U) r) ⊆ (V : Set U) := by |
| 55 | rw [intrinsicOpenMetric_closure_ball_eq_preimage g U (p : U) |
| 56 | (subset_closure.trans hU)] |
| 57 | intro y hy |
| 58 | obtain ⟨z, hz, hzy⟩ := hclosure hy |
| 59 | have heq : z = y := Subtype.ext hzy |
| 60 | exact heq ▸ hz |
| 61 | exact intrinsicOpenMetric_isCompact_closure_ball (intrinsicOpenMetric g U) V p hcompactU hV |
| 62 | |
| 63 | end PoincareMT.M28 |