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.ReducedGeometry.LGeometry.Basic |
| 2 | |
| 3 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/MetricCompactness.lean` at |
| 4 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 5 | |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | |
| 9 | open scoped Manifold ContDiff Bundle ENNReal |
| 10 | |
| 11 | universe u |
| 12 | |
| 13 | namespace PoincareMT.LGeometry |
| 14 | |
| 15 | open Set |
| 16 | |
| 17 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 18 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 19 | [IsManifold (𝓡 n) ∞ M] [ConnectedSpace M] [T3Space M] |
| 20 | |
| 21 | private theorem edist_ne_top_of_connected' |
| 22 | {X : Type*} [PseudoEMetricSpace X] [ConnectedSpace X] : |
| 23 | ∀ x y : X, edist x y ≠ ⊤ := by |
| 24 | intro x y hxy |
| 25 | let U : Set X := Metric.eball x ⊤ |
| 26 | have hUopen : IsOpen U := by |
| 27 | exact Metric.isOpen_eball |
| 28 | have hUclosed : IsClosed U := by |
| 29 | exact Metric.isClosed_eball_top |
| 30 | have hxU : x ∈ U := by |
| 31 | exact Metric.mem_eball_self ENNReal.zero_lt_top |
| 32 | have hUall : U = Set.univ := |
| 33 | IsClopen.eq_univ ⟨hUclosed, hUopen⟩ ⟨x, hxU⟩ |
| 34 | have hyU : y ∈ U := by |
| 35 | rw [hUall] |
| 36 | exact mem_univ y |
| 37 | exact (ne_of_lt (Metric.mem_eball'.mp hyU)) hxy |
| 38 | |
| 39 | theorem finiteEdistMetric (g : RiemannianMetric n M) : |
| 40 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 41 | ⟨g.toRiemannianMetric⟩ |
| 42 | letI : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 43 | (TangentSpace (𝓡 n) : M → Type _) := |
| 44 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 45 | letI : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 46 | ∀ x y : M, edist x y ≠ ⊤ := by |
| 47 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 48 | ⟨g.toRiemannianMetric⟩ |
| 49 | letI : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 50 | (TangentSpace (𝓡 n) : M → Type _) := |
| 51 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 52 | letI : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 53 | exact edist_ne_top_of_connected' |
| 54 | |
| 55 | theorem existsLocalCompactMetricBall (g : RiemannianMetric n M) (x : M) : |
| 56 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 57 | ⟨g.toRiemannianMetric⟩ |
| 58 | letI : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 59 | (TangentSpace (𝓡 n) : M → Type _) := |
| 60 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 61 | letI : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 62 | letI : PseudoMetricSpace M := |
| 63 | PseudoEMetricSpace.toPseudoMetricSpace (finiteEdistMetric g) |
| 64 | ∃ r : ℝ, 0 < r ∧ IsCompact (Metric.closedBall x r) := by |
| 65 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 66 | ⟨g.toRiemannianMetric⟩ |
| 67 | letI : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 68 | (TangentSpace (𝓡 n) : M → Type _) := |
| 69 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 70 | letI : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 71 | letI : PseudoMetricSpace M := |
| 72 | PseudoEMetricSpace.toPseudoMetricSpace (finiteEdistMetric g) |
| 73 | letI : LocallyCompactSpace M := |
| 74 | Manifold.locallyCompact_of_finiteDimensional (M := M) (𝓡 n) |
| 75 | exact Metric.exists_isCompact_closedBall x |
| 76 | |
| 77 | end PoincareMT.LGeometry |