It's the length of the shortest path lying in the space (so option #1). In other words, the distance between two points in a 2-d space is defined as the distance "as measured by 2d beings whose universe is said space".
We measure the distance between two points P and Q like so:
1) We consider consider all the smooth curves between P and Q.
2) We record their length and put them in a set S.
3) We say that the distance d(P,Q) between P and Q is the infimum of that set (i.e. the largest number that is smaller than all the numbers in S).
The infimum of a set is not necessarily an element of that set (for instance, the infimum of the set S={all real numbers >0} is 0 but 0 is not in S).
What this means for our definition is that the distance between P and Q might not be realized by any particular curve (there might not be a curve c between P and Q whose length is d(P,Q)). This is the case for instance in the space obtained from the plane by removing a point, say the origin, (0,0). Then, in cartesian coordinates, the distance between the points P=(0,-1) and Q=(1,0) is 2 but there are no curves of length 2 joining P and Q: there is only a sequence of curves whose length is arbitrarily close to 2.)
If is a fact however that if the distance is realized by some curve c, then c is a "geodesic". A geodesic is defined as a curve whose acceleration is 0. So it serves as generalization to the notion of a "straight line" in the plane.
that is the intrinsic approach, but for an embedded space, like a sphere in three space, it seems acceptable also to use the restriction of the 3 space metric. I think quasar is giving you the preferable way, but maybe not the only way. ?
sometimes the ambient space is easier to deal with than the intrinsic manifold.
e.g. the whitney embedding theorem tells you that you can embed manifolds in euclidean space. this has as a useful corollary that you can also define a metric on the manifold, and even a triangulation.
Oh, alright! I need one more clarification. Is this the same thing as geodesic?
If there is a distance minimizing curve between two points then it will be a geodesic. But in some spaces there is no distance minimizing curve.
Also a geodesic may not minimize distance. It will do so locally, that is for small enough distances, but not necessarily for large distances. Although it is true that a distance minimizing curve is a geodesic, a geodesic may not be a distance minimizing curve.
Don't you need to start with a choice of metric so that you can select the infimum over the collection of all curves? i.e., in order to define d_L:=inf{d(x,y)} over all rectifiable curves joining x and y, we must start with a notion of d .
To add to your and Mathwonk's example, (example is also given in above Wikipedia link), the circle with the subspace metric does not generate an intrinsic metric, since the Euclidean distance between any x,y on the circle does not equal the arc-length distance, i.e., there are no arc-length paths of length equal to the Euclidean length between points, say, for (-1,0) and (1,0), there are no arc-length paths of length 2 in S^1 between those two points.