I'm trying to prove this basic property of the product metric. Could you please verify if my proof looks fine or contains logical gaps/errors? Thank you so much for your help!
If $(X_{k}, d_{k})$ are metric spaces for $1 \leq k \leq m$, then $X = \prod_{k=1}^{m} X_k$ is a metric space with respect to the product metric $d:X \times X \to \mathbb R$ where $$d(x, y) =\max_{1 \leq k \leq m} d_{k}(x_{k}, y_{k})$$ for $x =(x_{1}, \ldots, x_{m}) \in X$ and $y =(y_{1}, \ldots, y_{m}) \in X$.
Theorem: If $A_k \subseteq X_k$ is open (closed) in $X_k$ for all $1 \leq k \leq m$, then $A = \prod_{k=1}^{m} A_k$ is open (closed) in $X$.
My attempt:
- If $A_k \subseteq X_k$ is open in $X_k$ for all $1 \leq k \leq m$, then $A$ is open in $X$
Lemma: $$\mathbb{B}_{X}(x, r) = \prod_{k=1}^{m} \mathbb{B}_{X_{k}}(x_k, r), \quad \overline{\mathbb{B}}_{X}(x, r) = \prod_{k=1}^{m} \overline{\mathbb{B}}_{X_{k}} (x_k, r)$$ for all $x=(x_{1}, \ldots, x_{m}) \in X$ and $r>0$.
For $a =(a_{1}, \ldots, a_{m}) \in A$, there is $(r_{1}, \ldots, r_{m}) \in \mathbb {(R^+)}^m$ such that $ \mathbb{B}_{X_{k}}(a_k, r_k) \subseteq A_k$ for all $1 \leq k \leq m$. Let $r = \min_{1 \leq k \leq m} r_k$. It follows from our Lemma that $$\mathbb{B}_{X}(a, r) = \prod_{k=1}^{m} \mathbb{B}_{X_{k}}(x_k, r) \subseteq \prod_{k=1}^{m} \mathbb{B}_{X_{k}}(x_k, r_k)\subseteq \prod_{k=1}^{m} A_k = A$$ As such, $A$ is open in $X$.
- If $A_k \subseteq X_k$ is closed in $X_k$ for all $1 \leq k \leq m$, then $A$ is closed in $X$
Because $A_k$ is closed in $X_k$ for all $1 \leq k \leq m$, $A^c_k$ is open in $X_k$ for all $1 \leq k \leq m$. We proved above that $\prod_{k=1}^{m} A^c_k$ is open in $X$, so $A = X - \prod_{k=1}^{m} A^c_k$ is closed in $X$.
@Henna Brandsma pointed out in his comment that the complement of a product set is NOT the product of the complements. I present my fix here. Thank you so much @Henna Brandsma!
My fix:
For $1 \le k \le m$ and $1 \le i \le m$, we define $B_{ki}$ by $$B_{ki} = \begin{cases}A^c_k \quad \text{if} \quad k=i \\ X_k \quad \text{otherwise}\end{cases}$$
For $x = (x_1, \ldots, x_m) \in X$, we have $$\begin{aligned} x \in A^c &\iff x \in \left( \prod_{k = 1}^m A_k \right)^c &&\iff \bigvee_{k = 1}^m (x_k \in A_k^c)\\ &\iff \bigvee_{k = 1}^m \left (x \in \prod_{i = 1}^m B_{ki} \right) && \iff x \in \bigcup_{k = 1}^m \left (\prod_{i = 1}^m B_{ki} \right) \end{aligned}$$
Because $B_{ki}$ is open in $X_k$ for all $1 \le k \le m$ and $1 \le i \le m$, $\prod_{i = 1}^m B_{ki}$ is open in $X$ for all $1 \le k \le m$ as we proved above. Hence $\bigcup_{k = 1}^m \left (\prod_{i = 1}^m B_{ki} \right)$ is open in $X$ and so is $A^c$. As a result, $A$ is closed in $X$.