# Compactess of a set in $\mathbb{R}^d$ defined as the union of compact sets

Let $$f:[a,b]\to \mathbb{R}^d$$ be a function of class $$C^1$$. Let us consider the following set: $$\mathcal{A}:=\bigcup_{x\in [a,b]}\{y\in \mathbb{R}^d, \quad ||y- f(x)||\leq 1/2 \}$$ I think that this set describes a tube of raduis $$1/2$$ that is centered around the function $$f$$. Now the goal is to prove that $$\mathcal{A}$$ is compact set of $$\mathbb{R}^d$$. To do so, I thought of using the sequential definition: Let $$(y_n)_n$$ be a sequence that belongs to $$\mathcal{A}$$. Therefore, there exists $$x_n \in [a,b]$$ such that $$y_n \in \{y \in \mathbb{R}^d, \quad ||y-f(x_n)||\leq 1/2\}.$$ Now, from the compactness of $$[a,b]$$ then, $$(x_n)_n$$ has a subsequence $$(x_{\phi(n)})_n$$ that converges towards $$x^* \in [a,b]$$. This implies that we have $$y_{\phi(n)} \in \{y \in \mathbb{R}^d, \quad ||y-f(x_{\phi(n)})||\leq 1/2\}.$$ On the other hand, one has $$||y_{\phi(n)}-f(x^*)||\leq ||y_{\phi(n)}-f(x_{\phi(n)})|| + ||f(x_{\phi(n)})- f(x^*)||$$ Moreover, for all $$\epsilon>0$$ then there exists $$N\in \mathbb{N}^*$$ such that $$||f(x_{\phi(n)})- f(x^*)|| \leq \epsilon,$$ for all $$n\geq N$$. this means that $$||y_{\phi(n)}-f(x^*)||\leq 1/2 + \epsilon$$ for all $$n\geq N$$ i.e. $$y_{\phi(n)}\in \bigcap_{\epsilon>0} \{y\in \mathbb{R}^d, \quad ||y-f(x^*)||\leq 1/2+\epsilon\}$$ for all $$n\geq N$$. But I cannot deduce why it necessarly converges in $$\mathcal{A}$$.

The Heine-Borel theorem tells us that it is sufficient to check that $$\mathcal{A}$$ is closed and bounded. Rewrite $$\mathcal{A}$$ as: $$\mathcal{A} = \{y \in \mathbb{R}^d: \exists x \in [a, b], \lVert y - f(x) \rVert \le 1/2\}$$
• Closedness: Let $$y$$ be an accumulation point of $$\mathcal{A}$$. Then there exists $$(x_n) \subseteq [a, b], (y_n) \subseteq \mathcal{A}$$ such that $$\lVert y_n - f(x_n) \rVert \le \dfrac{1}{2} \ \forall n, \text{ and } \lVert y_n - y \rVert \rightarrow 0 \text{ as } n \rightarrow \infty$$ The compactness of $$[a,b]$$ implies, there exists a subsequence $$(x_{n_k})$$ of $$(x_n)$$ converges to some $$x_0 \in [a, b]$$. Then, \begin{align*}\lVert y - f(x_0) \rVert &\le \lVert y - y_{n_k} \rVert + \lVert y_{n_k} - f(x_{n_k}) \rVert + \lVert f(x_{n_k}) - f(x_0) \rVert \ \forall k \in \mathbb{N}\\ &\le \lVert y - y_{n_k} \rVert + \lVert f(x_{n_k}) - f(x_0) \rVert + \dfrac{1}{2} \end{align*} which implies $$\lVert y - f(x_0) \rVert \le 1/2$$ by the continuity of $$f$$. Thus $$y \in \mathcal{A}$$, i.e $$\mathcal{A}$$ is closed.
• Boundedness: Since $$f$$ is continuous, $$f([a, b])$$ is bounded, which means, there exists $$M > 0$$ such that $$\lVert f(x) \rVert \le M \ \forall x \in [a, b]$$ For $$y \in \mathcal{A}$$, there exists $$x \in [a, b], \lVert y - f(x) \rVert \le 1/2$$. Using the triangle inequality, we have $$\lVert y \rVert \le \lVert y - f(x) \rVert + \lVert f(x) \rVert \le M + \dfrac{1}{2}$$ Thus, $$\mathcal{A}$$ is bounded.