Distance function to a closed set in a Banach space I would first formulate the problem and then make the question:
Let us first define a Banach space of sequences $x = (x_i)_{i\in\mathbb{N}}$ with $x_i \in \mathbb{R}^{n_i}$.
On each $\mathbb{R}^{n_i}$, we fix the standard infinity norm $|\cdot|_\infty$.
Then we introduce the following Banach space
\begin{equation*}
  \ell^{\infty}(\mathbb{N},(n_i)) := \Bigl\{ x = (x_i)_{i\in\mathbb{N}} : x_i \in \mathbb{R}^{n_i},\ \sup_{i\in\mathbb{N}}|x_i|_\infty < \infty \Bigr\},%
\end{equation*}
and equip this space with the norm $||x||_{\infty} := \sup_{i\in\mathbb{N}}|x_i|_\infty$.
Let $X=\ell^\infty(\mathbb{N},(n_i))$. Consider nonempty closed sets $\mathcal{A}_i \subset \mathbb{R}^{n_i}$, $i\in\mathbb{N}$. For each $x_i \in \mathbb{R}^{n_i}$ we define the distance of $x_i$ to the set $\mathcal{A}_i$ by
\begin{equation*}
  |x_i|_{\mathcal{A}_i} := \inf_{y_i\in \mathcal{A}_i}|x_i - y_i|_\infty .
\end{equation*}
Now we define the set
\begin{eqnarray}\label{eq:Overall_set}
  \mathcal{A} := \{x \in X: \ x_i \in \mathcal{A}_i,\ i\in\mathbb{N}\} =  X \cap (\mathcal{A}_1\times \mathcal{A}_2 \times \ldots).
\end{eqnarray}
If $\mathcal{A} \neq \emptyset$, we can define the distance from any $x\in X$ to $\mathcal{A}$ as
\begin{eqnarray}\label{eq:Distance_to_overall_set}
  ||x||_{\mathcal{A}} := \inf_{y\in \mathcal{A}}||x-y||_\infty = \inf_{y\in \mathcal{A}} \sup_{i\in\mathbb{N}} |x_i-y_i|_\infty .
\end{eqnarray}
Question: Let $X=\ell^\infty(\mathbb{N},(n_i))$.
Assume that $\mathcal{A}$ as defined above is nonempty. How can one show that for any $x \in X$ the following holds?
\begin{eqnarray}\label{eq:Distance_to_overall_set_Formula}
  ||x||_{\mathcal{A}} = \sup_{i\in\mathbb{N}} |x_i|_{\mathcal{A}_i} 
\end{eqnarray}
 A: Fix $x \in X$ and $y \in \mathcal{A}$. Then,
$$\|x - y\|_\infty = \sup_{i \in \Bbb{N}} |x_i - y_i|_\infty \ge \sup_{i \in \Bbb{N}} |x_i|_{\mathcal{A}_i},$$
since each $y_i \in \mathcal{A}_i$. Taking the infimum over $y \in \mathcal{A}$, we get
$$\|x\|_{\mathcal{A}} = \inf_{y \in \mathcal{A}} \|x - y\|_\infty \ge \sup_{i \in \Bbb{N}} |x_i|_{\mathcal{A}_i}.$$

On the other hand, note that, since $\mathcal{A}_i$ is boundedly compact (as a closed set in finite-dimensional space), meaning that closed, bounded subsets of $\mathcal{A}_i$ are compact. This implies that $\inf_{y_i \in \mathcal{A}_i} |x_i - y_i|_\infty$ has at least one minimiser for all $x_i \in \Bbb{R}^{n_i}$, since
$$\mathcal{A}_i \cap B\left[x_i;|x_i|_{\mathcal{A}_i} + 1\right]$$
is a non-empty, closed, bounded, and hence compact subset of $\mathcal{A}_i$, on which $y_i \mapsto |x_i - y_i|$ is a continuous function. Thus, for a given $x \in X$, there exists some $y^* \in \mathcal{A}$ such that, for all $i \in \Bbb{N}$,
$$|x_i - y^*_i|_\infty = |x_i|_{\mathcal{A}_i}.$$
But then,
$$\sup_{i \in \Bbb{N}} |x_i|_{\mathcal{A}_i} = \sup_{i \in \Bbb{N}} |x_i - y^*_i|_\infty =\|x - y^*\|_\infty \ge \|x\|_\mathcal{A},$$
as required.
