Define a metric on $G_\delta$ set making it complete A subset $A$ is a $G_{\delta}$ subset if $A=\bigcap_{1}^{\infty} G_i$ is a countable intersection of open sets $\{ G_i \}$. Show that in metric space $(X,d)$, every closed set is a $G_\delta$ set. If $A$ is a $G_\delta$ subset of a complete metric space $(X,d)$ show that there is metric $D$ on $A$ that induces the same convergence as $d$ on $A$, but $(A,D)$ is complete.
For the first part of the question, I take a closed set $C$, define $d(x,C)=\inf\{d(x,b):b\in C\}$, then let $G_k=\{x\in X: d(x,C)<\frac{1}{k}\}$, prove $G_k$ is open and $C=\bigcap G_k$. But to the second part, I really don't know where to start. My professor showed in his lecture notes that, if $O$ is an open set in $(X,d)$, define $D(x,y)=d(x,y)+|\frac{1}{d(x,O^C)}-\frac{1}{d(y,O^C)}|$, then $(O,D)$ is complete. I understand why this works. But in a $G_\delta$ set $A$, $A$ could be closed, and I have difficulty defining metric at the boundary. I tried $D(x,y)=\begin{cases} d(x,y)+|\frac{1}{d(x,O^C)}-\frac{1}{d(y,O^C)}| &\quad d(x,O^C)\cdot d(y,O^C) \neq 0\\d(x,y) &\quad otherwise \end{cases}$, but it seems to fail that it doesn't satisfy triangular inequality. Any hint for this? Thank you!
 A: Presumably you know how to define a metric on a product of countably many (nonempty) metric spaces that induces the product topology, and that makes the product a complete metric space if all factors are complete.
Thus, if we have a $G_{\delta}$ set
$$A = \bigcap_{n \in \mathbb{N}} O_n,$$
since you know how to define a metric on each $O_n$ that makes it complete and induces the subspace topology, you can define a metric $d_P$ on
$$P = \prod_{n\in \mathbb{N}} O_n$$
that induces the product topology and makes $P$ complete. The product topology on $P$ coincides with the subspace topology induced from $X^{\mathbb{N}}$. In $X^{\mathbb{N}}$ we consider the diagonal
$$\Delta = \bigl\{ f \in X^{\mathbb{N}} : \bigl(\forall k,n\bigr)\bigl(f(k) = f(n)\bigr)\bigr\}.$$
$\Delta$ is easily seen to be closed in $X^{\mathbb{N}}$, hence
$$B = P \cap \Delta$$
is a (relatively) closed subspace of $P$. Hence $(B,d_P\lvert_{B\times B})$ is a complete metric space.
Now note that the diagonal map $\delta \colon x \mapsto c_x$, where $c_x(n) = x$ for all $n\in \mathbb{N}$ is a homeomorphism between $A$ and $B$. Hence $d_A \colon (x,y) \mapsto d_P(\delta(x),\delta(y))$ is a metric on $A$ that induces the subspace topology, and makes $A$ complete.
A: To extend your teacher's idea:
Let $Y = \cap_n O_n$ be a $G_\delta$ in $(X,d)$ and define as the new metric
$$\rho(x,y) = d(x,y) + \sum_n \frac{1}{2^n}\min(|\frac{1}{d(x, X\setminus O_n)} - \frac{1}{d(y, X\setminus O_n)}|, 1), x,y \in Y$$
and show it is complete using Daniel's idea. The $\frac{1}{2^n}$ and $\min(.,1)$ is to ensure convergence of the series. We essentially embed $X$ as a closed subset of $X \times \mathbb{R}^{\mathbb{N}}$, using the maps $f_n: x \to \frac{1}{d(x,X\setminus O_n)}$. 
A: Here is a sketch of the proof for my new ideas:
If $A=\bigcap_{j=1}^{\infty}G_j$, define the metric
$$D(x,y)=d(x,y)+\sum_{j=1}^{\infty}\frac{1}{2^j}\frac{\left|\frac{1}{d(x,G_j^C)}-\frac{1}{d(y,G_j^C)}\right|}{1+\left|\frac{1}{d(x,G_j^C)}-\frac{1}{d(y,G_j^C)}\right|}$$
Need to show that $(A,D)$ is complete.
On $A$, $D$ and $d$ are equivalent, since if $x_n\to x$, and $x_n$, $x\in G_j$ for every $j$, $$\left|\frac{1}{d(x,G_j^C)}-\frac{1}{d(y,G_j^C)}\right|\to 0$$
then $D(x_n,x)\to 0$. If $D(x_n,x_m)\to 0$, since $d(x_n,x)\to 0$ and $d(x,G_j^C)>0$ for every $j$, this implies $x\in\bigcap_{j=1}^{\infty}G_j=A$.
