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.IntrinsicSplicing |
| 3 | |
| 4 | /-! |
| 5 | # Intrinsic minimality of actual path subsegments |
| 6 | |
| 7 | Morgan--Tian Claim 10.3, printed pp. 248-249, and the replacement argument |
| 8 | in Appendix A.1, pp. 497-498. A shorter regional subsegment competitor |
| 9 | would splice into a shorter full path. All lengths and the intrinsic |
| 10 | infimum refer to the same metric and literal region. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 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 | /-- Every ordered subsegment of an actual finite C1 intrinsic minimizer |
| 27 | is intrinsically minimizing in the same set. The set need not be open |
| 28 | or complete (Claim 10.3, pp. 248-249; Appendix A.1, pp. 497-498). -/ |
| 29 | theorem pathELength_eq_intrinsicEDist_subsegment (g : RiemannianMetric 3 M) |
| 30 | {U : Set M} {γ : ℝ → M} {a b c d : ℝ} |
| 31 | (hac : a ≤ c) (hcd : c ≤ d) (hdb : d ≤ b) |
| 32 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Icc a b)) |
| 33 | (hγU : MapsTo γ (Icc a b) U) |
| 34 | (hfinite : g.pathELength γ a b ≠ ⊤) |
| 35 | (hmin : g.pathELength γ a b = intrinsicEDist g U (γ a) (γ b)) : |
| 36 | g.pathELength γ c d = intrinsicEDist g U (γ c) (γ d) := by |
| 37 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 38 | ⟨g.toRiemannianMetric⟩ |
| 39 | have hsub : Icc c d ⊆ Icc a b := Icc_subset_Icc hac hdb |
| 40 | apply le_antisymm ?_ |
| 41 | (intrinsicEDist_le_pathELength g hcd (hγ.mono hsub) |
| 42 | (fun _ ht => hγU (hsub ht))) |
| 43 | by_contra hnot |
| 44 | have hshort : intrinsicEDist g U (γ c) (γ d) < g.pathELength γ c d := |
| 45 | lt_of_not_ge hnot |
| 46 | obtain ⟨α, hα0, hα1, hα, hαU, hαlen⟩ := |
| 47 | exists_intrinsic_competitor g hshort |
| 48 | obtain ⟨σ, hσ0, hσ1, hσ, hσU, hσlen⟩ := |
| 49 | exists_intrinsic_subarc_replacement g hac hcd hdb hγ hγU |
| 50 | hα hαU hα0 hα1 |
| 51 | have hleft : g.pathELength γ a c ≠ ⊤ := |
| 52 | ne_top_of_le_ne_top hfinite |
| 53 | (Manifold.pathELength_mono le_rfl (hcd.trans hdb)) |
| 54 | have hright : g.pathELength γ d b ≠ ⊤ := |
| 55 | ne_top_of_le_ne_top hfinite |
| 56 | (Manifold.pathELength_mono (hac.trans hcd) le_rfl) |
| 57 | have hsplit : g.pathELength γ a c + g.pathELength γ c d + |
| 58 | g.pathELength γ d b = g.pathELength γ a b := by |
| 59 | change Manifold.pathELength (𝓡 3) γ a c + |
| 60 | Manifold.pathELength (𝓡 3) γ c d + |
| 61 | Manifold.pathELength (𝓡 3) γ d b = Manifold.pathELength (𝓡 3) γ a b |
| 62 | rw [Manifold.pathELength_add hac hcd, |
| 63 | Manifold.pathELength_add (hac.trans hcd) hdb] |
| 64 | have hshorter : g.pathELength σ 0 1 < g.pathELength γ a b := by |
| 65 | rw [hσlen, ← hsplit] |
| 66 | exact ENNReal.add_lt_add_right hright (ENNReal.add_lt_add_left hleft hαlen) |
| 67 | have hbound := intrinsicEDist_le_pathELength g zero_le_one hσ hσU |
| 68 | rw [hσ0, hσ1, ← hmin] at hbound |
| 69 | exact (not_lt_of_ge hbound) hshorter |
| 70 | |
| 71 | end PoincareMT.M28 |