# $A \subset \mathbb{R}^n$. If every continuous function $f: A \rightarrow \mathbb{R}$ is is bounded and attains its bounds then A is compact.

I'm doing a metric spaces course and got stuck on proposition. I have a feeling that I want to show that $A$ is bounded and closed then use Heine-Borel theorem. The proposition states that $f$ is bounded and attains its bounds so I don't know how to show that $A$ is bounded and closed. It just seems obvious and I seem to be going around in a circular argument.

• Your question is not clear. What do you have to prove? What are $A, C$? – Crostul Nov 4 '14 at 18:03
• @Crostul Sorry. I have edited it now :) – user120227 Nov 4 '14 at 18:05
• math.stackexchange.com/questions/114123/… – Max Nov 4 '14 at 18:06
• I will post an easier proof without using Tietze's theorem. – Crostul Nov 4 '14 at 18:08
• thank you both of you. I think I do need an easier proof – user120227 Nov 4 '14 at 18:17

we are given that $A\subset \mathbb R^n$. In order to show that $A$ is compact, it suffices to show that $A$ is bounded and closed.

$A$ is bounded. Clearly the function $f:A\to\mathbb R$, with $f(x)=\|x\|$ is continuous, and as it has to be bounded, then there exists an $M>0$, such that $f(x)=\|x\|\le M$, for all $x\in A$. But this means that $A$ is bounded.

$A$ is closed. If not, then there exists a sequence $\{x_n\}_{n\in\mathbb N}\subset A$, with $x_n\to x_0\not\in A$. Then the function $\,f:A\to\mathbb R$, with $$f(x)=\frac{1}{\|x-x_0\|},$$
in continuous and unbounded. A contradiction, and hence $A$ is closed.

Altogether, indeed $A$ is compact.

Note. The function $g(x)=\|x-x_0\|$ is continuous, but it does not attain a minimum. The infimum of $f$ is equal to zero, while $f$ takes only positive values.

• $f$ should be $f(y) = \|x-y\|^{-1}$. – daw Nov 4 '14 at 20:29
• You are right. Thanks! – Yiorgos S. Smyrlis Nov 4 '14 at 20:42
• @YiorgosS.Smyrlis, is $f(x) = \frac{1}{\Vert x- x_{0} \Vert}$ also an example of a function that does not attain its minimum? If not, what would be one? – ALannister May 3 '16 at 17:51
• @JessyCat See my edited answer. – Yiorgos S. Smyrlis May 4 '16 at 10:21

Let $B \subseteq \mathbb{R}$ be any bounded subset. Then "$B$ attains its bounds" means that $B$ is closed.

Call $C(A)= \{ f: \mathbb{R}^n \longrightarrow \mathbb{R} \mbox{ continuous functions} \}$. Then

$$A = \bigcap_{f \in C(A)} f^{-1}(f(A))$$

Since for all $f \in C(A)$ $f(A)$ is closed, $f^{-1}(f(A))$ is closed as well (because $f$ is continuous). So, $A$ is an intersection of closed sets, hence it is closed.

Finally, consider for all $i=1, \dots, n$ the continuous functions $$\pi_i :A \longrightarrow \mathbb{R} \ \ \ \ \ (x_1, \dots, x_n) \mapsto x_i$$

Since all the sets $\{\pi_i(A) \}_{i=1}^n$ are bounded, then so is their product $\prod_{i=1}^n \pi_i(A) \subseteq \mathbb{R}^n$. But $A \subseteq \prod_{i=1}^n \pi_i(A)$, so it is bounded.

Being closed and bounded, $A$ is compact.

• $B=[0,1)\cup(1,2]$, attains its bound, but it is not closed! – Yiorgos S. Smyrlis Nov 4 '14 at 18:38
• @YiorgosS.Smyrlis You are right! My proof is in some sense incomplete... =( – Crostul Nov 4 '14 at 18:48