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.Riemannian.Comparison.Laplacian.Branch.Complete |
| 2 | |
| 3 | /-! |
| 4 | # Finite-distance adapters for disconnected manifolds |
| 5 | |
| 6 | The retained intrinsic distance is extended-valued on a disconnected |
| 7 | manifold. These adapters expose the same minimizing-geodesic input used by |
| 8 | the Calabi support argument, with finiteness supplied at the selected pair |
| 9 | instead of through a global preconnectedness instance. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology Bundle ENNReal |
| 18 | |
| 19 | namespace PoincareMT.RiemannianMetric |
| 20 | |
| 21 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T3Space M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | /-- A complete retained metric has minimizing geodesics between any pair at |
| 25 | finite intrinsic distance, without assuming that the whole manifold is |
| 26 | connected. -/ |
| 27 | theorem exists_minimizing_geodesic_of_metricComplete_of_finite |
| 28 | (g : RiemannianMetric n M) (hc : MetricComplete g) |
| 29 | {p x : M} (hfinite : g.edist p x ≠ ⊤) : |
| 30 | ∃ ε : ℝ, 0 < ε ∧ ∃ γ : ℝ → M, |
| 31 | g.IsGeodesicOn γ (Ioo (-ε) (1 + ε)) ∧ |
| 32 | γ 0 = p ∧ γ 1 = x ∧ |
| 33 | ∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, |
| 34 | g.edist (γ s) (γ t) = ENNReal.ofReal |s - t| * g.edist p x := by |
| 35 | let R := (g.edist p x).toReal + 1 |
| 36 | have hR : 0 < R := by |
| 37 | dsimp [R] |
| 38 | positivity |
| 39 | apply g.exists_minimizing_geodesic_of_precompact_ball p x hR |
| 40 | (g.isCompact_closure_ball_of_metricComplete hc p R) |
| 41 | change g.edist p x < ENNReal.ofReal R |
| 42 | rw [← ENNReal.ofReal_toReal hfinite] |
| 43 | exact (ENNReal.ofReal_lt_ofReal_iff hR).mpr (by |
| 44 | dsimp [R] |
| 45 | linarith) |
| 46 | |
| 47 | /-- A finite intrinsic distance has a continuous real-valued distance germ at |
| 48 | the endpoint. -/ |
| 49 | theorem continuousAt_toReal_edist_of_ne_top |
| 50 | (g : RiemannianMetric n M) (O y : M) |
| 51 | (hfinite : g.edist O y ≠ ⊤) : |
| 52 | ContinuousAt (fun z => (g.edist O z).toReal) y := by |
| 53 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 54 | ⟨g.toRiemannianMetric⟩ |
| 55 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 56 | (TangentSpace (𝓡 n) : M → Type _) := |
| 57 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ |
| 58 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 59 | exact (ENNReal.continuousAt_toReal hfinite).comp |
| 60 | (continuous_const.edist continuous_id).continuousAt |
| 61 | |
| 62 | end PoincareMT.RiemannianMetric |
| 63 |