In Pugh's analysis book, why are these metric spaces? Pugh introduces the notion of metric space in chapter 2 as follows

Definition: A metric space is a set $X$ equipped with a metric $d$

Clear!

For example, a metric space is $(\mathbb{R}, |x-y|)$, where $|\cdot|$
  is the absolute value

Super clear!

The following are also metric spaces


What!!!!!??? It is my first time doing analysis...
Can someone please illustrate just for a single example in the above figure as to what the set and the metric would be. For example, what would be the set $X$ and the metric $d$ used in the "closed spiral" figure?
Much thanks!
 A: You can consider all of these sets as subsets of the euclidean plane, which is a metric space with euclidean distance $d$. Restricting $d$ to these each of these sets provides a metric for each of them.
A: There are different choices of metrics that make those sets become metric spaces.
The easiest choice for all of them is to consider them as a subset of $\Bbb{R}^2$, and to use the induced metric, e.g. if I let $X$ be the closed spiral, I can let $d$ be the metric given by $d(x,y) = ||x-y||$, where $||x-y||$  is the usual distance in $\Bbb{R}^2$, i.e.
$$||x-y|| = \sqrt{(x_1-y_1)^2+(x_2-y_2)^2}.$$
This choice will work for all the sets, since they can all be considered a subset of $\Bbb{R}^2$.
Another possible choice for the closed spiral $X$ is to let $d(x,y)$ be the shortest distance following the spiral between $x$ and $y$, i.e. the length of the curve segment on the spiral connecting the two points $x$ and $y$.
The moral is that when the author says that these are examples of metric spaces, he should really mention what metrics he has in mind, as a bunch of different metrics are possible on each set.
Edit: You were also asking what the set $X$ is in the closed spiral case. I don't think it's important to describe it in exact terms in this case. You can just make a drawing like the author did, and say that your set $X$ consists of all points on that curve.
Also, it's hard to give the exact parametrization from his drawing alone, but it could be something like $r(t) = \arctan(t)$ for $t\geq 0$ in polar coordinates, or $r(t) = f(t)$ for any increasing $f$ that has a horizontal asymptote.
A: As others have pointed out, these are simply subsets of $\mathbb{R}^2$ with the induced distance.
Here is a possible definition of the closed outward spiral. It is the union of the unit circle and the polar curve $\theta = 1/(1-r)$, for $0 \leq r<1$. 
This is only a reasonable approximation of what you see in the figure. Other choices are possible, so long as they have the same essential features from a topological standpoint. What this means is that if I pick a metric space $X_1$ and a friend picks a metric space $X_2$, then there is a bijection $f$ between $X_1$ and $X_2$ such that open sets in one correspond to open sets in the other via $f$. (A mapping $f$ with this property is called a homeomorphism.)
