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.IntrinsicGeometry.IntrinsicOpenMetric |
| 3 | import PoincareLib.Geometry.Riemannian.Distance.CompactConfinement |
| 4 | |
| 5 | /-! |
| 6 | # Actual core balls after restriction to an open region |
| 7 | |
| 8 | In the relative A.8 construction, a source cap lies in the literal open |
| 9 | canonical union. Its original core-ball containment field makes short |
| 10 | ambient competitors lift with unchanged length. The actual core balls, |
| 11 | their closures, and their compactness therefore survive restriction to |
| 12 | the inclusion pullback metric. See the cap-topology open-cap derivation. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M28 |
| 24 | |
| 25 | variable {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 27 | [IsManifold (𝓡 3) ∞ M] |
| 28 | |
| 29 | /-- A ball already contained in the selected open region is exactly the |
| 30 | ball for its actual inclusion pullback metric. The reverse inclusion uses |
| 31 | ambient competitors whose whole tested interval stays inside that ball. -/ |
| 32 | theorem intrinsicOpenMetric_ball_eq_preimage (g : RiemannianMetric 3 M) |
| 33 | (V : TopologicalSpace.Opens M) (p : V) {r : ℝ} |
| 34 | (hball : g.ball (p : M) r ⊆ (V : Set M)) : |
| 35 | (intrinsicOpenMetric g V).ball p r = |
| 36 | (Subtype.val : V → M) ⁻¹' g.ball (p : M) r := by |
| 37 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 38 | ⟨g.toRiemannianMetric⟩ |
| 39 | ext q |
| 40 | change (intrinsicOpenMetric g V).edist p q < ENNReal.ofReal r ↔ |
| 41 | g.edist (p : M) (q : M) < ENNReal.ofReal r |
| 42 | rw [intrinsicOpenMetric_edist g V] |
| 43 | constructor |
| 44 | · intro hq |
| 45 | have hle : g.edist (p : M) (q : M) ≤ |
| 46 | intrinsicEDist g (V : Set M) (p : M) (q : M) := by |
| 47 | rw [intrinsicEDist] |
| 48 | apply le_sInf |
| 49 | rintro L ⟨α, hα, hα0, hα1, _, rfl⟩ |
| 50 | exact Manifold.riemannianEDist_le_pathELength hα hα0 hα1 zero_le_one |
| 51 | exact hle.trans_lt hq |
| 52 | · intro hq |
| 53 | obtain ⟨α, hα0, hα1, hα, hαlen⟩ := |
| 54 | Manifold.exists_lt_of_riemannianEDist_lt hq |
| 55 | have hαball : MapsTo α (Icc (0 : ℝ) 1) (g.ball (p : M) r) := by |
| 56 | simpa only [hα0] using g.mapsTo_ball_of_pathELength_lt hα hαlen |
| 57 | have hinf := intrinsicEDist_le_pathELength g zero_le_one hα |
| 58 | (fun t ht => hball (hαball ht)) |
| 59 | rw [hα0, hα1] at hinf |
| 60 | exact hinf.trans_lt hαlen |
| 61 | |
| 62 | /-- The same actual ball identity commutes with closure because inclusion |
| 63 | of the selected open region is both open and continuous. -/ |
| 64 | theorem intrinsicOpenMetric_closure_ball_eq_preimage (g : RiemannianMetric 3 M) |
| 65 | (V : TopologicalSpace.Opens M) (p : V) {r : ℝ} |
| 66 | (hball : g.ball (p : M) r ⊆ (V : Set M)) : |
| 67 | closure ((intrinsicOpenMetric g V).ball p r) = |
| 68 | (Subtype.val : V → M) ⁻¹' closure (g.ball (p : M) r) := by |
| 69 | rw [intrinsicOpenMetric_ball_eq_preimage g V p hball] |
| 70 | have hopen := V.isOpen.isOpenEmbedding_subtypeVal.isOpenMap |
| 71 | exact (hopen.preimage_closure_eq_closure_preimage continuous_subtype_val _).symm |
| 72 | |
| 73 | variable [T3Space M] [MeasurableSpace M] [BorelSpace M] |
| 74 | |
| 75 | /-- The frozen source cap supplies the containment and compactness of each |
| 76 | actual, unchanged-radius core ball after restriction. No radius or capture |
| 77 | field is assumed for a target cap. -/ |
| 78 | theorem CapCertificate.core_ball_intrinsicOpenMetric |
| 79 | {g : RiemannianMetric 3 M} (N : CapCertificate g) |
| 80 | (V : TopologicalSpace.Opens M) (hNV : N.carrier ⊆ (V : Set M)) |
| 81 | (y : V) (hy : (y : M) ∈ N.core) : |
| 82 | (intrinsicOpenMetric g V).ball y (N.core_radius y) = |
| 83 | (Subtype.val : V → M) ⁻¹' g.ball (y : M) (N.core_radius y) ∧ |
| 84 | closure ((intrinsicOpenMetric g V).ball y (N.core_radius y)) = |
| 85 | (Subtype.val : V → M) ⁻¹' closure (g.ball (y : M) (N.core_radius y)) ∧ |
| 86 | IsCompact (closure ((intrinsicOpenMetric g V).ball y (N.core_radius y))) ∧ |
| 87 | closure ((intrinsicOpenMetric g V).ball y (N.core_radius y)) ⊆ |
| 88 | (Subtype.val : V → M) ⁻¹' N.carrier := by |
| 89 | have hclosure : closure (g.ball (y : M) (N.core_radius y)) ⊆ (V : Set M) := |
| 90 | (N.core_ball_subset y hy).trans hNV |
| 91 | have hball : g.ball (y : M) (N.core_radius y) ⊆ (V : Set M) := |
| 92 | subset_closure.trans hclosure |
| 93 | have hclosure_eq := intrinsicOpenMetric_closure_ball_eq_preimage g V y hball |
| 94 | refine ⟨intrinsicOpenMetric_ball_eq_preimage g V y hball, hclosure_eq, ?_, ?_⟩ |
| 95 | · rw [hclosure_eq] |
| 96 | apply Topology.IsEmbedding.subtypeVal.isInducing.isCompact_preimage' |
| 97 | (N.core_ball_compact y hy) |
| 98 | intro z hz |
| 99 | exact ⟨⟨z, hclosure hz⟩, rfl⟩ |
| 100 | · rw [hclosure_eq] |
| 101 | exact preimage_mono (N.core_ball_subset y hy) |
| 102 | |
| 103 | end PoincareMT.M28 |