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!
 A: The problem with this idea is that $d_Z$ is not a metric unless $Y$ consists of a single point: if $y_0$ and $y_1$ are distinct points of $Y$, and $x\in X$, then
$$d_Z(\langle x,y_0\rangle,\langle x,y_1\rangle)=0$$
even though $\langle x,y_0\rangle\ne\langle x,y_1\rangle$.
However, it is true that $S_1\times Y$ and $S_2\times Y$ are open in $Z$. This is immediate from the definition of the product topology: both are actually basic open sets in the product.
If you’re required to argue in terms of a metric on $X\times Y$, you have to work a little harder, and the argument will depend somewhat on the specific product metric that you use. The most common product metrics define $d_Z(\langle x,y_0\rangle,\langle x,y_1\rangle)$ to be
$$\sqrt{d_X(x_0,x_1)^2+d_Y(y_0,y_1)^2}\,,$$
$$d_X(x_0,x_1)+d_Y(y_0,y_1)\,,$$
or
$$\max\{d_X(x_0,x_1),d_Y(y_0,y_1)\}\,.$$
All of these generate the same topology, so you can use any of them. Let $p=\langle x,y\rangle\in S_1\times Y$. There is an $\epsilon>0$ such that $B_{d_X}(x,\epsilon)\subseteq S_1$, and for each of these three product metrics it’s straightforward to show that $B_{d_Z}(p,\epsilon)\subseteq S_1\times Y$.
A: Here is a proof that uses continuous functions: since $X$ is disconnected, there is a continuous surjection $f:X\rightarrow \{0,1\}$ where the latter is equipped with the discrete topology. Then $g:X\times Y \rightarrow \{0,1\}$ given by $g(x,y)=f(x)$ is a continuous surjection as well (it is equal to $f$ composed with the projection map onto the first coordinate), proving disconnectedness of $X\times Y$.
A: The continuous image of a connected space is connected, so from this the "positive" version of your statement follows:

If $X \times Y$ is connected then $X$ and $Y$ are connected,

which is logically equivalent to

$X$ disconnected or $Y$ disconnected implies $X \times Y$ disconnected.

(let $p="X \text{ connected}"$, $q = "Y \text{ connected}"$, $r = "X \times Y\text{ connected}"$ then the first is $$r \implies (p \land q)$$
while the latter is $$(\lnot p \lor \lnot q) \implies \lnot r$$
and simple FOL tells us those are equivalent statements.)
And the first can be seen immediately by noting that $X= \pi_1[X \times Y], Y = \pi_2[X \times Y]$ and applying the "continuous image of connected spaces" fact twice. All we need are that both projections are continuous.
A: 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.
