Construct such $d$ that $(\mathbb{R} \setminus \mathbb{Z}, d)$ is complete metric space

Solution 1:

This is same as construct a metric on (0,1) that is compatible.

To do so, you just need to notice (0,1) is homeomorphic to the real line R. Now pull back the standard metric on R to (0,1), which gives you an "equivalent" but now complete metric.

Such a map is not so hard to get and I bet you have already seen one in the lectures.

Solution 2:

In general, if $(X,d)$ is a complete metric space and $A \subset X$, then $A$ can be given a complete metric iff $A$ is a $G_\delta$ subset of $X$, i.e. $A = \cap_{n} U_n$ where all $U_n$ are open in $X$. This is a classical result, and looking at the proof of that result, we also get the complete (and equivalent to $d \restriction A$ on $A$) metric $d_A$ on $A$ defined by:

$$d_A(x,y) = d(x,y) + \sum_{n} \frac{1}{2^n} \left|\frac{1}{d(x,X\setminus U_n)} - \frac{1}{d(y, X\setminus U_n)}\right| $$

This works because the map $x \rightarrow (x, \frac{1}{d(x, X\setminus U_0)}, \frac{1}{d(x, X\setminus U_1)},\ldots)$ embeds $A$ as a closed subset into $X \times \mathbb{R}^{\mathbb{N}}$, which has a complete metric from the sum, as described. See these notes for a proof for this, and also why being a $G_\delta$ is necessary.

Note that we can apply this to $U_n = X \setminus \{n, -n\}$ to get $\cap_n U_n = \mathbb{R} \setminus \mathbb{Z}$.