Show that if either $X$ or $Y$ is disconnected then $X \times Y$ is disconnected as well Here is the statement: Let $X$ and $Y$ be two non-empty metric spaces. Show that if either $X$ or $Y$ is disconnected, then the Cartesian product $X\times Y$ is also disconnected
My idea(s): The placement of this exercise in my book is around a section where the connection between connectedness and continuous functions is established, leading me to believe that one could also prove the claim by constructing some function. However, I think that it is also possible to prove it by using the definition of disconnectednessn and choosing an appropriate metric for a product space.
Namely, let $X$ be disconnected and $Z = X \times Y$. Then there exists two non-empty open subsets $S_1, S_2 \subset X$ such that $S_1 \cup S_2 = X$ and $S_1 \cap S_2 = \varnothing$. Since for any $z \in Z: z = (x, y), x \in X = S_1 \cup S_2, y \in Y$ it follows that $\left(S_1 \times Y\right) \cup \left(S_2 \times Y\right) = Z$. Also $\left(S_1 \times Y\right) \cap \left(S_2 \times Y\right) = \varnothing$, as $S_1$ and $S_2$ are disjoint. $\left(S_1 \times Y\right)$ and $\left(S_2 \times Y\right)$.
Now, if we can show that $\left(S_1 \times Y\right)$ and $ \left(S_2 \times Y\right)$ are both open w.r.t. the metric in $Z$, we are done. Thus for $(a, b), (c, d) \in Z$, let $d_{Z}((a, b), (c, d)) = d_{X}(a, c)$. Since $S_1$ and $S_2$ are open w.r.t. $d_{X}$, and the metric does not depend on $Y$, it follows that $\left(S_1 \times Y\right)$ and $\left(S_2 \times Y\right)$ are also open w.r.t. $d_{X}$. Hence there exists two non-empty, disjoint and open subsets of $Z$ whose union is $Z$. Thus $Z$ is disjoint.
Edit: It is a shame that I cannot accept multiple answers, since so far all answers given here have been brilliant!

Your proof is almost correct, except for the justification of openness of $(S_1\times Y)$-- the space $X\times Y$ comes equipped with a very specific topology (the product topology) and your task is to show $(S_1\times Y)$ is open in that particular topology. (Otherwise, you could just say "let $d_Z$ be the discrete metric, then every set is open hence we are done." There is an obvious problem with the argument.)
The topology on $X\times Y$ can be defined in two ways:

*

*Either by the definition of product topology, where the open sets in $X\times Y$ are generated by (i.e. unions of) the sets in $\{U\times V\;|\; U\overset{\text{open}}\subset X, V\overset{\text{open}}\subset Y\}$. Using this definition, it is immediate that $S_1\times Y$ is open.

*Or by using one of the product metrics:

*

*$d_{1}((a,b),(c,d))=d_X(a,c) + d_Y(b,d)$


*$d_{2}((a,b),(c,d))=\sqrt{(d_X(a,c))^2 + (d_Y(b,d))^2}$


*$d_{\infty}((a,b),(c,d))=\max\{d_X(a,c),d_Y(b,d)\}$
It is a non-trivial fact that all the metrics above induce exactly the product topology on $X\times Y$ so it does not matter which one you choose to prove the openness of $S_1\times Y$-- using $d_\infty$ should be the easiest.
