Solution (source code)

= Solution

A <connected> complete <Riemannian manifold> is <disconnected at infinity> when the complement of some <compact> set has at least two unbounded <connected> components. Equivalently it has at least two ends. A <line in a Riemannian manifold> is a unit-speed <geodesic> $\ell:\mathbb R\to M$ satisfying $d(\ell(s),\ell(t))=|s-t|$ for every $s,t$.

Let $K$ be the <compact> separating set, enlarged inside a fixed <compact> metric ball if needed for bounds. Choose $x_j,y_j$ in two different unbounded components of $M\setminus K$, with both distances from $K$ tending to infinity. By the <Hopf-Rinow theorem>, join them by unit-speed <minimizing geodesics>. Every such segment meets $K$, since a path avoiding it cannot join its different components. Reparametrize a segment so that one crossing point is at time zero. Its parameter interval is $[-a_j,b_j]$, where $a_j,b_j\to\infty$ by the distances from the endpoints to $K$.

The <unit tangent bundle> over $K$ is <compact>, so a subsequence of the initial position/velocity pairs converges. Continuous dependence of the <geodesic equation> on its initial data, and completeness, give a limiting <geodesic> defined on all of $\mathbb R$. For any fixed $s<t$, the approximating segments are defined on $[s,t]$ for large $j$ and satisfy $d(\gamma_j(s),\gamma_j(t))=t-s$. Continuity of the distance passes this equality to the limit. Thus \b[the limiting <geodesic> is a line], proving <a line from disconnection at infinity>.