Open sets in a product of metric spaces 
Let $(X_i,d_i), i=1,2,\dots,n$ be metric spaces. Let $X=\prod_{i=1}^{n}X_i$ and let $(X,d)$ be the metric space defined in the standard manner. For $i=1,2,\dots,n$, let $O_i$ be an open subset of $X_i$. Prove that the subset $O_1 \times O_2 \times \dots \times O_n$ of $X$ is open and that each open subset of $X$ is a union of sets of this form.

Here the standard manner for converting a product of sets into a metric space is by using the metric, $$d(x,y)= \max\{d_i(x_i,y_i)\}, i=1,\dots ,n$$
$$x,y \in X.$$
I've managed to prove the first part, that is I have shown that the product of open sets is open. I'm stuck on showing that any open subset of $X$ is the union of sets who are themselves products of open sets. I know that open sets are unions of open balls, so if I can show that open balls can be written as products of open sets then I am done. Any hints on how to finish this problem? 
Any help is greatly appreciated.
 A: If $U$ is an open set in $X$ then, by definition, for any $x \in U$
there exists some $\epsilon_x>0$ such that $B(x,\epsilon_x) \subset U$. Then we have $U = \cup_{x \in U} B(x,\epsilon_x)$. So, if we show that $B(x,\epsilon_x)$ is the product of open sets, we are finished.
I claim that for any $x \in X$ and for any $\epsilon>0$ we have
$B(x,\epsilon_x) = \prod_i B(x_i, \epsilon)$.
This follows from the sequence of equivalences: $y \in B(x,\epsilon_x)$ iff $d(x,y) < \epsilon$ iff
$\max_i(d_i(x_i,y_i)) < \epsilon$ iff $d_i(x_i,y_i) < \epsilon$ for all $i$
iff $y_i \in B(x_i,\epsilon)$ for all $i$.
A: It suffices to show the the projection maps
$$
\pi_i :X=X_1\times\cdots\times X_n\to X_i, \quad\text{with}\quad \pi(x_1,\ldots,x_n)=x_i,
$$
are open, i.e., they take open subsets of $X=X_1\times\cdots\times X_n$ to open subsets of $X_i$.
Assume that $U\subset X$ is open, and $x_i=\pi_i(x)\in \pi_i(U)$, where $x\in U$. Then there exists an open $V$ neighbourhood of $x\in U$, in $U$, i.e., $V\subset U$. Hence, there is an $\varepsilon>0$, such that
$$
B_X(x,\varepsilon)=\prod_{i=1}^nB_{X_i}(x_i,\varepsilon)\subset U,
$$ 
where $x=(x_1,\ldots,x_n)$, and thus
$$
B_{X_i}(x_i,\varepsilon)=\pi_i\big(B_X(x,\varepsilon)\big)\subset \pi_i(U).
$$
Therefore $\pi_i$ is indeed an open mapping. Thus if $U_1\times\cdots\times U_n$ is open, so are
$$
U_i=\pi_i(U_1\times\cdots\times U_n).
$$ 
A: You have to remember 2 things:


*

*Opened ball is an opened set. Let's denote it as $B$.

*$\forall x \in B$ you can find subset $O_1×O_2×⋯×O_n \subset B$ and $x \in O_1×O_2×⋯×O_n$. This fact is pretty obvious for opened balls. Then to get whole opened ball you have to take the union of $O_1×O_2×⋯×O_n$ over all $x$ in $B$.


Then every opened set is a union of opened balls and every one of them is a union of $O_1×O_2×⋯×O_n$.
