Why are these two definitions of a perfectly normal space equivalent?

I've been skimming through some topology textbooks recently. Some sources, (such as Munkres' Topology and Willard's General Topology) define a space $(X,\mathcal{T})$ to be perfectly normal iff $X$ is normal and every closed set is a $G_\delta$ set, that is, a countable intersection of open sets. Other sources (such as Dudley's Real Analysis) define a space $(X,\mathcal{T})$ to be perfectly normal iff for every closed set $A$, there is a continuous function $f$ into $\mathbb{R}$ such that $A=f^{-1}(\{0\})$.

Is there a nice, complete proof of why these two definitions are in fact equivalent? Thanks.

-

Note that if $f\colon X\to Y$ is continuous and $A\subseteq Y$ is $G_\delta$, then $f^{-1}(A)$ is also $G_\delta$.

Proof: Let $A=\bigcap U_i$, where $U_i$ are open, and let $V_i=f^{-1}(U_i)$. Since $f$ is continuous $V_i$ is open. Now we will show that $G=\bigcap V_i = f^{-1}(A)$.

Let $x\in G$, then for every $i\in\omega$ we have $x\in V_i$, so $f(x)\in U_i$ for all $i$, and so $f(x)\in A$. Therefore $x\in f^{-1}(A)$.

In the other direction, let $x\in f^{-1}(A)$ then we have $f(x)\in U_i$ for all $i$, therefore $x\in V_i$ for all $i$, so $x\in G$.

The rest of follows from the normality.

Suppose $X$ is normal and every closed set is $G_\delta$. Let $A$ be a closed set, then $A=\bigcap U_i$ for some $U_i$ open, $i\in\omega$. Without loss of generality $U_i\subseteq U_k$ for $i\ge k$ (otherwise take $U'_i = U_i\cap \bigcup_{j<i} U_j$ as open sets instead).

Since $X$ is normal, we have $f_i\colon X\to[0,1]$ for which $f_i[A]=0$, and $f_i[X\setminus U_i] = 1$.

Now define $f\colon X\to[0,1]$ as:

$$\sum_{k=1}^\infty\frac{f_k(x)}{2^k}$$

This is a continuous function, and $f[A]=0$. Suppose $f(x)=0$ then $f_i(x)=0$ for all $i$, therefore $x\in A$.

-
@yunone: I tried to write a proof, I hope it's okay. – Asaf Karagila Oct 12 '11 at 22:40
Thanks to t.b. for suggesting this correction! – Asaf Karagila Oct 12 '11 at 23:58
Yes, I agree now. I deleted my earlier skeptical comment. – Nate Eldredge Oct 13 '11 at 14:00