Section 2.1 Dense Sets
Before we can say what we mean by the completion of a metric space, we need the following concept.
Definition 2.1.
Let \((X,d)\) be a metric space. A set \(Y \subseteq X\) is called dense in \(X\) if for every \(x \in X\) and every \(\varepsilon \gt 0\text{,}\) there exists \(y \in Y\) such that \(d(x, y) \lt \varepsilon\text{.}\)
In other words, a set \(Y \subseteq X\) is dense in \(X\) if any point in \(X\) has points in \(Y\) arbitrarily close.
Example 2.2.
The set \(\Q\) of rational numbers is dense in \(\R\text{.}\)
Lemma 2.3.
Let \((X,d)\) be a metric space and \(Y \subseteq X\text{.}\) The following are equivalent.
- \(Y\) is dense in \(X\text{.}\)
- For any \(x \in X\text{,}\) there exists a sequence \((y_n)_{n \in \N}\) in \(Y\) satisfying \(x = \lim_{n \to \infty} y_n\text{.}\)
- \(\overline{Y} = X\text{.}\)
Proof.
(i) \(\implies\) (ii).
Assume that \(Y\) is dense in \(X\text{.}\) Let \(x \in X\text{.}\) Then for every \(n \in \N\text{,}\) there exists a point \(y_n \in Y\) with \(d(y_n, x) \lt \frac{1}{n}\text{.}\) The resulting sequence \((y_n)_{n \in \N}\) has the property that \(x = \lim_{n \to \infty} y_n\text{.}\)
(ii) \(\implies\) (iii).
Assume that (ii) holds. Let \(x \in X\text{.}\) Then there exists a sequence \((y_n)_{n \in \N}\) in \(Y\) with \(x = \lim_{n \to \infty} y_n\text{.}\) Hence for any \(r \gt 0\text{,}\) there exists \(n \in \N\) such that \(y_n \in B_r(x)\text{.}\) In particular, it follows that \(B_r(x) \cap Y \ne \varnothing\text{.}\) Therefore, we see that \(X \subseteq \overline{Y}\text{.}\) It is clear that \(\overline{Y} \subseteq X\text{,}\) so \(X = \overline{Y}\text{.}\)
(iii) \(\implies\) (i).
Assume that \(\overline{Y} = X\text{.}\) Then for any \(x \in X\) and any \(\varepsilon \gt 0\text{,}\) there exists a point \(y \in B_\varepsilon(x) \cap Y\text{.}\) That is, it satisfies \(d(x, y) \lt \varepsilon\text{.}\)
The following lemma is extremely useful.
Lemma 2.4. Continuous extension.
Suppose that \((X, d_X)\) and \((Y, d_Y)\) are metric spaces. Let \(S
\subseteq X\) be dense in \(X\text{.}\) If \(Y\) is complete, then any uniformly continuous map \(f \maps S \to Y\) has a unique continuous extension to \(X\text{.}\)
Proof.
Suppose that \(Y\) is complete and \(f \maps S \to Y\) is uniformly continuous. We define \(\hat{f} \maps X \to Y\) as follows. Given \(x \in
X\text{,}\) we use density to choose a sequence \((s_n)_{n \in \N}\) in \(S\) such that \(x
= \lim_{n \to \infty} s_n\text{.}\) Then in particular \(\seq sn\) is Cauchy, and so by Exercise 2.1.2 and the uniform continuity of \(f\text{,}\) the sequence \((f(s_n))_{n \in \N}\) is a Cauchy in \(Y\text{.}\) As \(Y\) is complete, this sequence is therefore convergent, and we set
\begin{equation*}
\hat f(x) = \lim_{n \to \infty} f(s_n) \text{.}
\end{equation*}
This gives rise to a well-defined map, because for any other sequence \((\tilde{s}_n)_{n \in \N}\) in \(S\) with the same limit \(x = \lim_{n \to \infty} \tilde{s}_n\text{,}\) we find that
\begin{equation*}
d_X(s_n, \tilde{s}_n) \le d_X(s_n, x) + d_X(\tilde{s}_n, x) \to 0
\end{equation*}
as \(n \to \infty\text{.}\) Hence by the uniform continuity of \(f\text{,}\)
\begin{equation*}
d_Y(f(\tilde{s}_n), \hat f(x)) \le d_Y(f(\tilde{s}_n), f(s_n)) + d_Y(f(s_n), \hat f(x)) \to 0
\end{equation*}
as \(n \to \infty\text{.}\) That is, we have \(\hat f(x) = \lim_{n \to \infty}
f(\tilde{s}_n)\) as well.
Moreover, the map \(\hat{f}\) is continuous (even uniformly so). This follows from the uniform continuity of \(f\) again: for any \(\varepsilon \gt 0\) there exists \(\delta \gt 0\) such that \(d_Y(f(x), f(x')) \lt \frac{\varepsilon}{2}\) for all \(x, x' \in S\) with \(d_X(x, x') \lt \delta\text{.}\) Now let \(x, x' \in
X\) with \(d_X(x, x') \lt \delta\text{.}\) If we choose sequences \((s_n)_{n \in
\N}\) and \((s_n')_{n \in \N}\) in \(S\) converging to \(x\) and \(x'\text{,}\) respectively, then \(d_X(s_n, s_n') \lt \delta\) whenever \(n\) is sufficiently large. Hence \(d_Y(f(s_n), f(s_n')) \lt \frac{\varepsilon}{2}\text{.}\) It follows that
\begin{equation*}
\begin{split}
d_Y(\hat{f}(x), \hat{f}(x')) \amp \le d_Y(\hat{f}(x), f(s_n)) + d_Y(f(s_n), f(s_n')) + d_Y(f(s_n'), \hat{f}(x')) \\
\amp \lt d_Y(\hat{f}(x), f(s_n)) + \frac{\varepsilon}{2} + d_Y(f(s_n'), \hat{f}(x'))
\end{split}\text{.}
\end{equation*}
Passing to the limit \(n \to \infty\text{,}\) we obtain the inequality \(d_Y(\hat{f}(x), \hat{f}(x')) \lt \varepsilon\text{.}\)
Finally, we show that \(\hat{f}\) is the only continuous extension of \(f\) to \(X\text{.}\) Suppose that \(g \maps X \to Y\) is a continuous map such that \(g(s) = f(s)\) for all \(s \in S\text{.}\) Let \(x \in X\text{.}\) Choose a sequence \((s_n)_{n \in \N}\) in \(S\) converging to \(x\text{.}\) Then by the continuity,
\begin{equation*}
g(x) = \lim_{n \to \infty} g(s_n) = \lim_{n \to \infty} f(s_n) = \hat{f}(x).
\end{equation*}
This concludes the proof.
When working with a sequence (or a countably infinite set), we can often use step-by-step procedures to prove certain properties. This does not work for uncountably infinite sets. But if we have a sequence that is dense in a given metric space, then such arguments can still be useful. This is the motivation for the following concept.
Definition 2.5.
A metric space is separable if it contains a countable dense set.
Example 2.6.
The space \(\R\) is separable because it contains the countable dense set \(\Q\text{.}\)
Exercises Exercises
1. (PS5) Dense sets in product spaces.
Suppose that \((X, d_X)\) and \((Y, d_Y)\) are non-empty metric spaces. Consider two sets \(S \subseteq X\) and \(T \subseteq Y\text{.}\) Show that \(S \times
T\) is dense in the product space \(X \times Y\) if and only if \(S\) is dense in \(X\) and \(T\) is dense in \(Y\text{.}\)
Hint 1.
It is worth looking back to Exercise 1.3.2, either for inspiration or as a potential tool.
Hint 2.
If you like sequences, you could use the sequence characterisation of density in Lemma 2.3.
Solution.
Suppose that \(S\) is dense in \(X\) and \(T\) is dense in \(Y\text{,}\) and let \((x, y) \in X \times Y\) and \(\varepsilon \gt 0\text{.}\) Then by density there exists \(s \in S\) with \(d_X(s, x) \lt
\frac{\varepsilon}{2}\) and \(t \in T\) with \(d_Y(t, y) \lt \frac{\varepsilon}{2}\text{.}\) Hence
\begin{equation*}
d_{X \times Y}((s, t), (x, y)) \lt \sqrt{\frac{\varepsilon^2}{4} + \frac{\varepsilon^2}{4}} \lt \varepsilon.
\end{equation*}
Conversely, suppose that \(S \times T\) is dense in \(X \times Y\text{,}\) and let \(x
\in X\text{,}\) \(y \in Y\) and \(\varepsilon \gt 0\text{.}\) Then there exists \((s, t) \in S \times
T\) such that \(d_{X \times Y}((s, t), (x, y)) \lt \varepsilon\text{.}\) This implies in particular that \(d_X(s, x) \lt \varepsilon\) and \(d_Y(t,y) \lt \varepsilon\text{.}\) So \(S\) is dense in \(X\) and \(T\) is dense in \(Y\text{.}\)
With the same arguments we prove that \(T\) is dense in \(Y\text{.}\)
Comment 1.
Lemma 2.3 gives us other characterisations of what it means for a set to be dense, one in terms of sequences and another in terms of closures. For the proof using sequences we can take advantage of Exercise 1.3.2.
Comment 2.
Since this is a relatively straightforward question, I used is as an opportunity to be picky about ways of writing arguments which don’t scale well when things get a bit more complicated, e.g. Exercise 2.1.2 below. Many students wrote things like the following:
Since \(S\) is dense in \(X\) and \(T\) is dense in \(Y\text{,}\)\begin{gather*} \forall x \in X\, \forall \varepsilon \gt 0\, \exists s \in S \st d_X(x,s) \lt \varepsilon/\sqrt 2\\ \forall y \in Y\, \forall \varepsilon \gt 0\, \exists t \in T \st d_Y(y,t) \lt \varepsilon/\sqrt 2\text{.} \end{gather*}So\begin{gather*} d_{X \times Y}\big((x,y),(s,t)\big) \lt \sqrt{\frac \varepsilon2 + \frac \varepsilon2} = \varepsilon\text{.} \end{gather*}
When writing this way the logical status of \(x,y,s,t,\varepsilon\) in the second line is not entirely clear. Given some \(x,y,\varepsilon\) in the definition of \(S \times T\) being dense in \(X \times Y\text{,}\) the author presumably plans to use the first two lines to choose \(s,t\) appropriately? But they haven’t explicitly said this and so we are forced to guess. In my experience with this unit, longer arguments written in this style eventually become impossible to follow, and students who write this way routinely get themselves confused when attempting more difficult problems. The lecture notes will always avoid this sort of ambiguity by explicitly introducing variables and how they relate to one another:
Let \((x,y) \in X \times Y\) and \(\varepsilon \gt 0\text{.}\) Since \(S\) is dense in \(X\) and \(T\) is dense in \(Y\text{,}\)\begin{gather*} \exists s \in S \st d_X(x,s) \lt \varepsilon/\sqrt 2\\ \exists t \in T \st d_Y(y,t) \lt \varepsilon/\sqrt 2\text{.} \end{gather*}So\begin{gather*} d_{X \times Y}\big((x,y),(s,t)\big) \lt \sqrt{\frac \varepsilon2 + \frac \varepsilon2} = \varepsilon\text{.} \end{gather*}
I encourage you in the strongest possible terms to start writing your arguments in something closer to this style if you are not already.
2. (PS5) Uniform continuity and Cauchy sequences.
Let \((X,d_X)\) and \((Y,d_Y)\) be metric spaces. If \(\seq
xn\) is a Cauchy sequence in \(X\text{,}\) and \(f \maps X \to Y\) is uniformly continuous, show that \((f(x_n))_{n\in\N}\) is a Cauchy sequence in \(Y\text{.}\)
Hint.
Use the uniform continuity of \(f\) first, and only then take advantage of the fact that \(\seq xn\) is Cauchy.
Solution.
Fix \(\varepsilon \gt 0\text{.}\) Since \(f\) is uniformly continuous, there exists \(\delta
\gt 0\) such that \(d_Y(f(x),f(\tilde x)) \lt \varepsilon\) for all \(x,\tilde x \in
X\) with \(d_X(x,\tilde x) \lt \delta\text{.}\) Since \(\seq xn\) is Cauchy, there exists \(N \in \N\) such that \(d_X(x_n,x_m) \lt \delta\) for all \(n,m \ge
N\text{.}\) By our above choice of \(\delta\text{,}\) this therefore guarantees that \(d_Y(f(x_n),f(x_m)) \lt \varepsilon\text{.}\)
Comment 1.
In the official solution we really do need to pick \(\delta\) depending on \(\varepsilon\) first, and only then pick \(N\) based on \(\delta\text{.}\) It is worth thinking carefully about why doing things in the reverse order, first picking \(N\) and then picking \(\delta\text{,}\) does not work. Errors of this type can be more easily avoided if you practice good ‘variable hygiene’.
Comment 2.
Copied verbatim from previous years, just as relevant this year:
Many students wrote arguments where the logical status of the symbol \(\delta\) (and sometimes also \(\varepsilon\)) was not clear. For instance, some students seemed to be implying that in the definition of uniform continuity they were free to choose both \(\varepsilon \gt 0\) and \(\delta \gt 0\) arbitrarily, which is not true. (Rather, uniform continuity tells us that, for any given \(\varepsilon \gt 0\text{,}\) there exists a suitable choice of \(\delta \gt
0\text{.}\)) In an advanced analysis unit such as this one, this sort of fuzziness with logic and quantifiers is a very fast way to lose marks on an exam. In my experience, students who write arguments in this way are also very likely to get extremely confused when attempting more difficult problems with multiple parts.
In general, I would discourage you from beginning your arguments by copying down all of the definitions involved, complete with all of their quantifiers and potentially conflicting uses of the same symbols, and then writing down a set of relations between these symbols which seems like it gets you the inequality you want. This is fine as a brainstorming technique on scratch paper, but to see if it actually works (and to get full marks on an exam question) you will likely want to be more explicit about the logical flow of your argument. Here the official solution is a good model: It starts from a fixed \(\varepsilon \gt 0\text{,}\) uses continuity to find a corresponding \(\delta \gt 0\text{,}\) and then uses the definition of a Cauchy sequence to find an \(N \in \N\text{.}\) It does not simply copy out all of these definitions at the beginning, and no symbol is used twice to mean different things. For more on this see Section G.2 and Section G.3.
3. (PS5) Continuous extensions.
Let \(a,b \in \R\) with \(a\lt b\) and consider two functions \(f \maps
[a,b] \to \R\) and \(g \maps [a,b] \cap \Q \to \R\) which agree on \([a,b] \cap \Q\text{,}\) that is
\begin{gather}
f(x) = g(x) \quad \text{for all } x \in [a,b] \cap \Q\text{.}\tag{✶}
\end{gather}
Show the following.
(a)
If \(f\) is continuous, then \(g\) is also continuous.
Hint.
Don’t overthink it.
Solution.
Let \(\varepsilon \gt 0\) and \(x \in [a,b] \cap \Q\text{.}\) Since \(f\) is continuous, there exists \(\delta \gt 0\) such that \(\abs{f(x)-f(y)} \lt \varepsilon\) for all \(y \in [a,b]\) with \(\abs{x-y} \lt \delta\text{.}\) In particular, for all \(y \in [a,b] \cap
\Q\) we have by (✶) that
\begin{equation*}
\abs{g(x)-g(y)}
= \abs{f(x)-f(y)}
\lt \varepsilon\text{.}
\end{equation*}
(b)
If \(f\) is uniformly continuous, then \(g\) is also uniformly continuous.
Hint.
Again, don’t overthink it.
Solution.
Let \(\varepsilon \gt 0\text{.}\) Since \(f\) is uniformly continuous, there exists \(\delta \gt 0\) such that \(\abs{f(x)-f(y)} \lt \varepsilon\) for all \(x,y \in [a,b]\) with \(\abs{x-y} \lt \delta\text{.}\) In particular, for all \(x,y \in [a,b] \cap
\Q\) with \(\abs{x-y}\lt \delta\) we have by (✶) that
\begin{equation*}
\abs{g(x)-g(y)}
= \abs{f(x)-f(y)}
\lt \varepsilon\text{.}
\end{equation*}
Comment.
As you have seen in previous analysis units, and as we will see in more generality in Exercise 4.3.3 of Chapter 2, continuity of \(f \maps [a,b] \to \R\) automatically implies uniform continuity, as the domain \([a,b]\) is a compact metric space.
(c)
\([a,b] \cap \Q\) is a dense subset of \([a,b]\text{.}\)
Solution.
First observe that this does not immediately follow from the fact that \(\Q\) is dense in \(\R\text{.}\) Indeed, \(\{\sqrt 2\}\) is a perfectly nice metric subspace of \(\R\text{,}\) but \(\{\sqrt 2\} \cap \Q =
\varnothing\) is certainly not a dense subset of \(\{\sqrt 2\}\text{.}\)
Let \(x \in [a,b]\) and \(\varepsilon \gt 0\text{.}\) We seek \(q \in [a,b] \cap \Q\) such that \(\abs{x-q} \lt \varepsilon\text{.}\) If \(x \in (a,b)\text{,}\) then we can use the openness of \((a,b)\) to find \(\varepsilon \gt 0\) such that \(B_\varepsilon(x) \subset
(a,b)\text{.}\) The density of \(\Q\) in \(\R\) then implies that there exists \(q \in \Q\) such that \(q \in B_\varepsilon(x)\text{,}\) which gives \(q \in [a,b]
\cap \Q\) as desired.
For \(x=b\) things are a bit trickier, because the \(q \in \Q\) that we get from the density of \(\Q\) in \(\R\) might have \(q \gt b\) and hence \(q \notin [a,b] \cap \Q\text{.}\) To get around this, first choose \(n \in \N\) large enough that \(b-1/n \in (a,b)\) and \(1/n \lt \varepsilon/2\text{.}\) Applying our above argument to \(b-1/n\) then yields \(q \in [a,b] \cap \Q\) with \(\abs{q-(b-1/n)} \lt \varepsilon/2\text{.}\) Applying the triangle inequality we conclude that \(\abs{q-b} \le \abs{q-(b-1/n)} + \abs{1/n} \lt \varepsilon/2 + \varepsilon/2 = \varepsilon\text{.}\) as desired. The argument for \(x=a\) is similar.
Here we have argued directly using Definition 2.1, but we could have also used Lemma 2.3 and given an alternative argument in terms of sequences. In either case, the endpoints \(a,b\) need some additional thought.
Comment 1.
Several students gave alternative solutions using the method from Example 5 in the problems classes. This can also work, but depending on how we set things up we may still have to worry a bit about what happens near the endpoints.
Comment 2.
The official solution uses the fact that \(\Q\) is dense in \(\R\) according to the definition in Definition 2.1. Several students cited the slightly stronger fact that between any two distinct real numbers there exists a rational number. If used appropriately, this can lead to a somewhat streamline argument.
Comment 3.
Several students simply wrote that
\begin{equation*}
\overline{[a,b] \cap \Q} = \overline{[a,b]} \cap \overline \Q = [a,b] \cap \R = \R\text{.}
\end{equation*}
One question here is in which metric space the various closures are being taken. In any case, it is not in general true that \(\overline{A \cap B} = \overline A \cap \overline B\text{.}\) Indeed, for \(\{\sqrt 2\}\) and \(\Q\) as a subsets of \(\R\) we have
\begin{equation*}
\overline{\{\sqrt 2\} \cap \Q} = \overline{\varnothing} = \varnothing
\end{equation*}
but
\begin{equation*}
\overline{\{\sqrt 2\}} \cap \overline \Q =
\{\sqrt 2\} \cap \R = \{\sqrt 2\}\text{.}
\end{equation*}
(d)
If \(g\) is uniformly continuous, then there exists \(f \maps [a,b]
\to \R\) which satisfies (✶) and is continuous.
(e)
Part d does not necessarily hold if uniform continuity is replaced by continuity. (Find a counterexample.)
Hint 1.
You’re looking for an \(g\) where any extension \(f\) is necessarily discontinuous.
Hint 2.
Find a function which misbehaves at a point in \([a,b] \without \Q\) but is otherwise continuous \([a,b] \to \R\text{,}\) and then let \(g\) be the restriction of this function to \([a,b] \cap \Q\text{.}\)
Solution.
Let \(x_0 \in (a,b) \without \Q\text{,}\) and define \(g(x) =
(x-x_0)^{-1}\text{.}\) Then \(g\) is continuous on \([a,b] \without
\{x_0\}\) and hence in particular it is continuous on \([a,b] \cap \Q
\subseteq [a,b] \without \{x_0\}\text{.}\)
Suppose that \(f \maps [a,b] \to \R\) satisfies (✶). To see that \(f\) is not continuous, use density to find a sequence \(\seq qn\) of points in \([a,b] \cap \Q\) converging to \(x_0\text{.}\) Then
\begin{equation*}
\lim_{n\to\infty} f(q_n) = \lim_{n\to\infty} g(q_n) = \infty\text{.}
\end{equation*}
Since \(f(x_0) \in \R\text{,}\) this in particular means (by Theorem 1.46) that \(f\) cannot be continuous at \(x_0\text{.}\)
See the comments for one of many possible alternative solutions.
Comment 1.
Note that it is not enough to find a function \(g\) which has a discontinuous extension (indeed, all functions \(g\) will have many discontinuous extensions, see Example 6). Instead, we need to find a function \(g\) such that no extension could possibly be continuous.
Comment 2.
There are many different functions \(g\) we could have chosen. For instance, we could pick \(x_0 \in (a,b) \without \Q\) and set
\begin{equation*}
g(x) =
\begin{cases}
0 \amp x \in [a,x_0) \cap \Q, \\
1 \amp x \in (x_0,b] \cap \Q.
\end{cases}
\end{equation*}
Since \(x_0 \notin [a,b] \cap \Q\text{,}\) it is easy to show that \(g\) is continuous. Suppose that \(f \maps [a,b] \to \R\) satisfies (✶). Using the density of \(\Q\text{,}\) we can find sequences \(\seq xn\) and \(\seq{x'}n\) in \([a,b] \cap \Q\) converging to \(x_0\text{,}\) with \(x_n \lt x_0 \le x_n'\) for all \(n \in \N\text{.}\) Then
\begin{equation*}
\lim_{n \to \infty} f(x_n) = 0 \ne 1 = \lim_{n \to \infty} f(x_n'),
\end{equation*}
4. (PS6) \(\C\) is separable.
Consider the space \(\C\) with the norm \(|\blank|\) such that \(|x + iy| = \sqrt{x^2 + y^2}\) for \(x, y \in \R\text{.}\)
(a)
Show that \(\Q\) is not dense in \(\C\text{.}\)
Hint.
One way to start is to write down what it means for a set not to be dense, in the same way that in Exercise B.1 you wrote down what it means for a sequence not to converge. If you are having trouble accurately negating statements with quantifiers please come talk to me.
Solution.
Consider the point \(z=i \in \C\text{.}\) Then for any rational number \(q \in
\Q\text{,}\) we have
\begin{equation*}
\abs{z-q} = \sqrt{(0-q)^2 + (1-0)^2} = \sqrt{q^2 + 1} \ge 1\text{.}
\end{equation*}
Thus, setting \(\varepsilon = 1\text{,}\) there is no \(q \in \Q\) with \(\abs{z-q} \lt
\varepsilon\text{.}\)
Comment.
Note that the closure \(\overline \Q\) of \(\Q\) depends very much on which metric space we are thinking of \(\Q\) as a subset of. For instance, if we consider \(\Q\) as a subset of itself, then \(\overline \Q = \Q\text{!}\) So in order to use the last part of Lemma 2.3 here we would have to argue that \(\overline \Q = \R\) as a subset of \(\C\).
(b)
Show that \(\C\) is separable.
Hint 1.
If you’re having trouble thinking of a good candidate for a countable dense subset, take a look through Section 1.8, particularly Example 1.67 and Lemma 1.70.
Hint 2.
Once you’ve got your candidate for the countable dense subset, just argue directly using Definition 2.1. Alternatively, you could think about how \(\C\) is isometric to \(\R^2 = \R \times \R\text{,}\) and try to use Exercise 2.1.1.
Solution 1. Direct argument
We know that \(\Q\) is countable, so
\begin{equation*}
\Q + i\Q = \set{p + iq}{p, q \in \Q},
\end{equation*}
which can be mapped bijectively to \(\Q \times \Q\text{,}\) is countable as well. We want to show that \(\Q + i\Q\) is dense in \(\C\text{.}\)
Let \(z = x + iy \in \C\) and fix \(\varepsilon \gt 0\text{.}\) Since \(\Q\) is dense in \(\R\text{,}\) we can choose \(p, q \in \Q\) such that \(|x - p| \lt
\frac{\varepsilon}{2}\) and \(|y - q| \lt \frac{\varepsilon}{2}\text{.}\) Then
\begin{equation*}
|z - (p + iq)| \lt \sqrt{\frac{\varepsilon^2}{4} + \frac{\varepsilon^2}{4}} = \frac{\varepsilon}{\sqrt{2}} \lt \varepsilon.
\end{equation*}
Hence \(\Q + i\Q\) is dense in \(\C\text{.}\)
Solution 2. Using isometries
It is straightforward to check that the mapping \(f \maps \R \times \R \to \C\) defined by \(f(x,y) = x+iy\) is bijective and an isometry. The metric spaces \(\C\) and \(\R \times \R\) are therefore isometric, and so it suffices to show that \(\R \times \R\) is separable. As \(\Q\) is dense in \(\R\text{,}\) by Exercise 2.1.1 \(\Q \times \Q\) is dense in \(\R \times \R\text{.}\) As \(\Q\) is countable, \(\Q \times
\Q\) is countable, and so the proof is complete.
Comment.
The official solution above using isometries is already relatively terse, but some students went one step further and simply wrote \(\C ≅ \R \times \R\) without further comment or explanation. On an exam this would probably have lost some marks. Some students also never explicitly said that they even had a bijective isometry between \(\R \times \R\) and \(\C\text{,}\) and (at least as far as I could tell) only talked about an isometry with domain \(\Q \times \Q\text{.}\) This alone is not enough.
5. Open subsets of separable spaces.
Let \((X,d)\) be a separable metric space, and let \(U \subset X\) be open. Show that \(U\text{,}\) viewed as a metric subspace, is also separable.
6. Separable spaces are second countable.
Let \((X,d)\) be a separable metric space, with \(X_0 \subset X\) a countable dense subset, and consider the collection
\begin{equation*}
\mathcal B = \{ B_{1/n}(x_0) : x_0 \in X_0,\, n \in \N \}
\end{equation*}
of balls in \(X\) whose centres lie in \(X_0\) and whose radii are of the form \(1/n\) for some \(n \in \N\text{.}\)
(a)
Show that \(\mathcal B\) is countable.
(b)
Show that any open set \(U \subseteq X\) can be written as a union of elements of \(\mathcal B\text{.}\)
Spaces with this property are called second countable.