Solution (source code)

= Solution

The <Baire category theorem> states that every countable intersection of open dense subsets of a <complete metric space> is dense. Equivalently, no nonempty open subset of a complete metric space is a countable union of <nowhere dense sets>.

To prove the first form, let $G_1,G_2,\ldots$ be open dense subsets of a complete metric space $X$, and let $V\subseteq X$ be nonempty and open. Choose a closed ball
$$
\overline B(x_1,r_1)\subseteq V\cap G_1,
\qquad 0<r_1<2^{-1}.
$$
Inductively, density and openness of $G_{n+1}$ allow a closed ball
$$
\overline B(x_{n+1},r_{n+1})
\subseteq B(x_n,r_n)\cap G_{n+1},
\qquad 0<r_{n+1}<2^{-(n+1)}.
$$
The balls are nested and $d(x_m,x_n)<2^{-n}$ for $m>n$, so $(x_n)$ is Cauchy. Completeness gives $x_n\to x\in X$. For every $n$, all later centres lie in $\overline B(x_n,r_n)$; closedness gives $x\in\overline B(x_n,r_n)\subseteq G_n$. The first ball also lies in $V$, hence
$$
x\in V\cap\bigcap_{n=1}^\infty G_n.
$$
Since every nonempty open $V$ meets the intersection, that intersection is dense.