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 | |
| 4 | /-! |
| 5 | # The actual finite intrinsic metric of the recut |
| 6 | |
| 7 | The finite intrinsic diameter proved for the retained recut lets its open |
| 8 | Riemannian metric define a metric space with the original topology. This |
| 9 | is the metric used for completion and compactly confined rays, without |
| 10 | any completeness assertion. Source: Morgan--Tian Claims 10.13-10.14 and |
| 11 | Lemma 10.16, pp. 256-258; M28 derivation 134. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 19 | |
| 20 | namespace PoincareMT.M28 |
| 21 | |
| 22 | variable {M : Type*} [TopologicalSpace M] [T2Space M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 24 | |
| 25 | /-- Finite original-region distances give a metric space on the literal |
| 26 | open subtype, with the topology inherited from the ambient manifold. -/ |
| 27 | @[instance_reducible] noncomputable def intrinsicOpenMetricSpace |
| 28 | (g : RiemannianMetric 3 M) (U : TopologicalSpace.Opens M) |
| 29 | (hfinite : ∀ p q : U, intrinsicEDist g (U : Set M) (p : M) (q : M) ≠ ⊤) : |
| 30 | MetricSpace U := by |
| 31 | let gU := intrinsicOpenMetric g U |
| 32 | let : LocallyCompactSpace U := ChartedSpace.locallyCompactSpace |
| 33 | (EuclideanSpace ℝ (Fin 3)) U |
| 34 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : U → Type _) := |
| 35 | ⟨gU.toRiemannianMetric⟩ |
| 36 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin 3)) |
| 37 | (TangentSpace (𝓡 3) : U → Type _) := |
| 38 | ⟨⟨gU.inner, gU.toContinuousRiemannianMetric.continuous, fun _ _ _ => rfl⟩⟩ |
| 39 | let : EMetricSpace U := EMetricSpace.ofRiemannianMetric (𝓡 3) U |
| 40 | apply EMetricSpace.toMetricSpace |
| 41 | intro p q |
| 42 | change gU.edist p q ≠ ⊤ |
| 43 | rw [intrinsicOpenMetric_edist] |
| 44 | exact hfinite p q |
| 45 | |
| 46 | /-- The construction preserves the original open-subtype topology literally. -/ |
| 47 | theorem intrinsicOpenMetricSpace_topology |
| 48 | (g : RiemannianMetric 3 M) (U : TopologicalSpace.Opens M) |
| 49 | (hfinite : ∀ p q : U, intrinsicEDist g (U : Set M) (p : M) (q : M) ≠ ⊤) : |
| 50 | let d := intrinsicOpenMetricSpace g U hfinite |
| 51 | (inferInstance : TopologicalSpace U) = |
| 52 | d.toPseudoMetricSpace.toUniformSpace.toTopologicalSpace := |
| 53 | rfl |
| 54 | |
| 55 | /-- Extended distance is exactly the infimum over the original recut's |
| 56 | C1 competitors, with no ambient-distance substitution. -/ |
| 57 | theorem intrinsicOpenMetricSpace_edist |
| 58 | (g : RiemannianMetric 3 M) (U : TopologicalSpace.Opens M) |
| 59 | (hfinite : ∀ p q : U, intrinsicEDist g (U : Set M) (p : M) (q : M) ≠ ⊤) |
| 60 | (p q : U) : |
| 61 | letI := intrinsicOpenMetricSpace g U hfinite |
| 62 | edist p q = intrinsicEDist g (U : Set M) (p : M) (q : M) := |
| 63 | intrinsicOpenMetric_edist g U p q |
| 64 | |
| 65 | /-- Real distance is the finite real value of the same original-region |
| 66 | infimum used throughout the completion and ray arguments. -/ |
| 67 | theorem intrinsicOpenMetricSpace_dist |
| 68 | (g : RiemannianMetric 3 M) (U : TopologicalSpace.Opens M) |
| 69 | (hfinite : ∀ p q : U, intrinsicEDist g (U : Set M) (p : M) (q : M) ≠ ⊤) |
| 70 | (p q : U) : |
| 71 | letI := intrinsicOpenMetricSpace g U hfinite |
| 72 | dist p q = (intrinsicEDist g (U : Set M) (p : M) (q : M)).toReal := by |
| 73 | let := intrinsicOpenMetricSpace g U hfinite |
| 74 | rw [dist_edist, intrinsicOpenMetricSpace_edist] |
| 75 | |
| 76 | end PoincareMT.M28 |