$K\subseteq \mathbb{R}^n$ is a compact space iff every continuous function in $K$ is bounded.

I need to prove that $K\subseteq \mathbb{R}^n$ is a compact space iff every continuous function in $K$ is bounded.

One direction is obvious because of Weierstrass theorem. How can i prove the other direction? I tried to assume the opposite but it didn't work for me.

Thanks a lot.

• Do you mean "continuous real-valued function on $K$" where you say "continues in K?" – Thomas Andrews Jan 16 '12 at 19:32
• Use your theorem again. If $K$ is noncompact, then either $K$ is not closed, or $K$ is not bounded. Given an unbounded set in $\mathbb{R}^n$, can you find an unbounded continuous function? Given a nonclosed set, can you find an unbounded continuous function? – Chris Eagle Jan 16 '12 at 19:32
• And how are you defining "compact?" Different books define compactness differently. – Thomas Andrews Jan 16 '12 at 19:34
• Sorry guys! I forgot the word "function". – Jozef Jan 16 '12 at 19:44

Let $K$ be a set which is such that every continuous function on it is bounded.

Clearly $K$ itself is bounded, for the function «distance to the origin» is bounded by hypothesis.

Suppose $K$ is not closed, so that there is a point $x$ which is in the closure of $K$ but not in $K$. Consider the function $$f:y\in K\mapsto \frac{1}{d(x,y)}\in\mathbb R,$$ which is clearly well defined and continuous. The choice of $x$ implies more or less immediately that $f$ is not bounded on $K$, so something's amiss...

• Dear Mariano, Thank you very much. – Jozef Jan 16 '12 at 20:16
• @Mariano Suárez-Alvarez) Sir I have a question. If $K$ is a subset of $\mathbb R$ then I think the converse of the statement is NOT true. As, $f:(0,1)\to \mathbb R$ by $f(x)=x$. Then $f$ is continuous and bounded but $(0,1)$ is NOT compact in $\mathbb R$. – user181525 Aug 5 '15 at 3:47
• @Panja717 the converse is "If every continuous function is bounded, then the set is compact", not "if ther exists a bounded continuous function, then the set is compact". – Mariano Suárez-Álvarez Aug 5 '15 at 4:33

A topological space $X$ is called pseudocompact if every continuous function $f: X \rightarrow \mathbb{R}$ is bounded.

The aforelinked wikipedia article does a good job of comparing this condition to other versions of compactness. In particular:

$\bullet$ compact $\implies$ countably compact (i.e., every countable cover has a finite subcover; equivalently, every infinite subset has an $\omega$-accumulation point) $\implies$ pseudocompact.

$\bullet$ A normal Hausdorff space is pseudocompact iff it is countably compact iff it is limit point compact (every infinite subset has an accumulation point).

One of the big theorems in undergraduate analysis is that a metrizable space is limit point compact iff it is compact iff it is sequentially compact, so all notions of compactness mentioned here coincide on the class of metrizable spaces. This provides a more general answer to your question.

If $K$ is not compact, there exists a subset $D\subseteq K$ which is discrete and infinite.

On the other hand, if $D$ is a discrete subset of $\Bbb R^n$ any function on $D$ can be extended to a continuous function on $\Bbb R^n$.

So, just take an unbounded function $f$ on $D$ (which certainly exists) and consider the restriction to $K$ of a continuous extension of $f$ to $\Bbb R^n$.

• What do you mean by "discrete"? The subspace topology on $D=\{1/n:n\in\mathbb N\}$ is discrete, but the function $f(x)=1/x$ on $D$ cannot be extended continuously to $\mathbb R$. Do you mean a set such that there is a lower bound on the distances of distinct points? Or at least discrete and closed? – Jonas Meyer Jan 16 '12 at 20:01
• But on the other hand taking any bounded noncompact subset of $\mathbb R$, it is not true that there is subset that is discrete, infinite, and closed in $\mathbb R^n$, so I do not know what you mean. – Jonas Meyer Jan 16 '12 at 20:16

This is in GRE 0568 #62 for $$\mathbb R^n, n>1$$

Charles Rambo and DM Ashura aka Bill Shillito prove that $$K$$ is compact by choosing $$f(x)=||x||$$ and $$f(x)=\frac{1}{||x-a||}$$ to deduce, resp, bounded and closed and then conclude by Heine-Borel theorem which works in $$\mathbb R^n$$ and metric spaces in general. Ian Coley says the condition in $$(II)$$ is pseudo compactness which in metric spaces is compactness.