I'm new to Riemann Geometry and I read on Wikipedia in the section called "Riemann manifolds are metric spaces" that
Assuming the manifold is compact, any two points x and y can be connected with a geodesic whose length is d(x,y).
I understand how geodesic length is defined on Riemann manifold but I'm not entirely clear how compactness gives us the length of the geodesic. Could someone share some insights?
This is the theorem of Hopf Rinow.
https://en.wikipedia.org/wiki/Hopf%E2%80%93Rinow_theorem
If the manifold is not compact, it is not true: Consider $R^2-\{0\}$ with the standard flat metric, there does not exists a geodesic between $(x,0)$ and $(y,0)$ if $x<0, y>0$.