8

I have seen answers to this question, which go beyond my understanding of compactness and continuity. I was wondering whether we can cook up a proof using sequential compactness and certain equivalent definitions of continuity such as the inverse image of any closed set is closed.

Here is what I have been able to conjure up so far.

Assume that the graph of $f$ is compact. This means that it is also closed and bounded. The graph is a closed and bounded subset of $A \times f(A)$. All we need to show is that $f(A)$ is compact, and we are are home free, right? (since continuous functions take compact sets to compact sets).

Question is: how do we show that $f(A)$ using the fact that the graph is compact. Can we claim that $f(A)$ is closed and bounded (since by Heine-Borel, any closed and bounded subset of $\mathbb R$ is compact)?

I feel like I am really close. Can anyone help me out?

leo
  • 10,769
user43901
  • 1,058
  • 1
    I'm not convinced that showing $f(A)$ compact will suffice, since we can construct noncontinuous functions that take a particular compact set to a compact set. – Eric Stucky Nov 07 '12 at 00:30
  • You have the logic backwards: if $f$ is continuous, then $f[A]$ is compact, but the converse isn’t true in general. – Brian M. Scott Nov 07 '12 at 00:31
  • But if I can show that $f(A)$ is compact and A is already given to be compact, can't I conclude that $f$ is continuous? – user43901 Nov 07 '12 at 01:37

3 Answers3

15

Corrected 2 December 2021.

Suppose that $f$ is not continuous. Then there are a point $x\in A$, an $\epsilon>0$, and a sequence $\langle x_n:n\in\Bbb N\rangle$ in $A$ converging to $x$ such that $\left|f(x_n)-f(x)\right|\ge\epsilon$. (Why?) Let $G$ be the graph of $f$. Then $\big\langle\langle x_n,f(x_n)\rangle:n\in\Bbb N\big\rangle$ is a sequence in the compact metric space $G$, so it has a convergent subsequence $\big\langle\langle x_{n_k},f(x_{n_k})\rangle:k\in\Bbb N\big\rangle$.

  1. Show that the limit of this subsequence must be of the form $\langle x,\alpha\rangle$ for some $\alpha\in\Bbb R$. (Recall that $x$ is the limit of $\langle x_n:n\in\Bbb N\rangle$.)

  2. Show that $\alpha\ne f(x)$. Conclude that $\langle x,\alpha\rangle\notin G$.

This contradicts the compactness of $G$; how?

Brian M. Scott
  • 631,399
  • can we not go for a more direct route? Since G is compact, then for every sequence $(x_n,f(x_n))$ there exists a subsequence $(x_{n_k},f(x_{n_k}))$ that converges to the ordered pair say $(x, y) \in A\times f(A)$. $(x_{n_k},f(x_{n_k})$ converges iff each of the component sequences converges in $A$ and $f(A)$ respectively. $(x_{n_k}) \rightarrow x$ and $(f(x_{n_k}))\rightarrow f(x)=y$ Thus, any convergent sequence in $A$ is mapped to a convergent sequence in $f(A)$, limits being mapped to limits under $f$. Hence, $f$ is continuous. – user43901 Nov 08 '12 at 21:11
  • @user43901: You argument is circular: when you say that the $f(x_{n_k})$ converge to $f(x)$, you’re already assuming that $f$ is continuous. – Brian M. Scott Nov 08 '12 at 21:15
  • A function is continuous iff it sends every convergent sequence in the domain to a convergent sequence in the range, limits being sent to limits. The sequence in G by definition is the ordered pair (a, f(a)); hence, how is it circular? If a_n converges to a, then can I not claim the argument?

    On a related note, if I can show that each of A and f(A) is compact, then using the fact that continuous functions map compact sets to compact sets, I can claim that since f(A) is the map under f, f is continuous, right?

    – user43901 Nov 09 '12 at 02:13
  • 1
    @user43901: No, of course you can’t assume that the $f(X_{n_k})$ converge to $f(x)$: that’s what you’re trying to prove! The answer to your second question is also no, as I pointed out in the comments under your original post. Continuous functions preserve compactness, but functions that preserve compactness are not necessarily continuous. Look at the function $f:\Bbb R\to\Bbb R$ defined by $f(x)=1$ if $x\ge 0$ and $f(x)=0$ if $x<0$. – Brian M. Scott Nov 09 '12 at 14:49
  • I think I understand, but the example you gave: is both the domain and range compact? What I am trying to argue is, if both the domain and the image of f is compact, then f must be continuous. – user43901 Nov 09 '12 at 15:34
  • @user43901: What you’re trying to argue is false, as you can see by a trivial modification of my last example: $$f:[-1,1]\to[0,1]:x\mapsto\begin{cases}1,&\text{if }0\le x\le 1\0,&\text{if }-1\le x<0;.\end{cases}$$ – Brian M. Scott Nov 09 '12 at 15:39
  • but is the graph of that function compact? There is a hole at x=0 and I can think of a sequence which converges to 0. – user43901 Nov 09 '12 at 16:14
  • @user43901: I was dealing only with your fundamental misconception that a function that takes compact sets to compact sets has to be continuous. That is false. If the graph is compact, the function does have to be continuous, but you’re trying to construct an argument that simply does not exist, because you’re trying to use an implication that is false in general. – Brian M. Scott Nov 09 '12 at 16:19
  • I finally get it Brian. Thank you for being so patient with me throughout this process. I really thought about every possibility and now see where I was wrong. Thanks again! – user43901 Nov 09 '12 at 18:01
  • 1
    @user43901: Whew! I was starting to worry. :-) You’re welcome! – Brian M. Scott Nov 09 '12 at 18:07
  • 1
    What a fine answer professor! – MathMan Sep 08 '20 at 18:41
  • Why $\alpha \neq f(x)$, $\alpha$ is just a limit point – Hamilton Dec 02 '21 at 05:57
  • 2
    @Beginner: As it was written, $\alpha$ actually could have been equal to $f(x)$; the sequence $\langle x_n:n\in\Bbb N\rangle$ has to be chosen so that no subsequence of $\langle f(x_n):n\in\Bbb N\rangle$ converges to $f(x)$. I’ve changed the write-up to ensure that, though you have to do a little work to fill in the details where it says ‘(Why?)’. – Brian M. Scott Dec 02 '21 at 21:12
  • 1
    @BrianM.Scott Thank you! Just for completeness, I will state a result here. We can prove " if, whenever $x_n \to x$, there is a subsequence of $(f(x_n))$ that converges to $f(x)$. Then $f(x)$ is continuous at $x$. " – Hamilton Dec 03 '21 at 20:34
8

First, to answer the question in your comment, it seems that you claim:

If $A$ is a compact metric space, for all functions $f:A\to\Bbb R$, $f(A)$ compact implies $f$ continuous.

This claim is false. For example, consider $A=[-1,1]$ as a metric subspace of $\Bbb R$ and define $f:A\to\Bbb R$ by $$f(x)=\begin{cases} 1&\text{if } x\gt 0\\ -1&\text{otherwise}\end{cases}.$$ Thus $f(A)$ is the compact set $\{-1,1\}$ but $f$ is not continuous.

Second, I'll give a proof using sequential compactness, something equivalent to continuity, namely sequential continuity, something else.

Proof.

Assume then that $(A,d)$ is a compact metric space, and $f:A\to\Bbb R$ is a function such that $$G=\{(x,f(x)):x\in A\}$$ is compact in $(A\times\Bbb R,D)$ where $D$ is the usual product metric (one of the usual metrics) given by $$D((u,x),(v,y))=d(u,v)+|y-x|.$$

Since we are dealing with metric spaces, it is enough to show that $f$ is sequentially continuous.

Then, consider a sequence $(x_n)$ in $A$ with $$\lim_{n\to\infty} x_n=x\in A.$$

We must show that $$\lim_{n\to\infty} f(x_n)=f(x).$$

As says the "abstract thing" stated here, it is enough to show that every subsequence $(f(x_{n_k}))_{k\in\Bbb N}$ has a subsequence $(f(x_{n_{k_j}}))_{j\in\Bbb N}$ converging to $f(x)$.

So, consider $(f(x_{n_k}))_{k\in\Bbb N}$ a subsequence of $(f(x_n))_{n\in\Bbb N}$. We will prove that this subsequence has a subsequence converging to $f(x)$.

Since $G$ is a compact metric space, $G$ is sequentially compact, thus, the sequence $((x_{n_k},f(x_{n_k})))_{k\in\Bbb N}$ in $G$ must have a convergent subsequence, say $((x_{n_{k_j}},f(x_{n_{k_j}})))$ with $$\lim_{j\to\infty} (x_{n_{k_j}},f(x_{n_{k_j}}))=(y,f(y))\in G.$$

Notice that for each $j\in\Bbb N$ we have $$D((x_{n_{k_j}},f(x_{n_{k_j}})),(y,f(y)))\geq d(x_{n_{k_j}},y)\geq 0,$$ so $$\lim_{j\to\infty} d(x_{n_{k_j}},y)=0$$ i.e. $$\lim_{j\to\infty} x_{n_{k_j}}=y.\tag{1}$$ By similar arguments it follows that $$\lim_{j\to\infty} f\left(x_{n_{k_j}}\right)=f(y).\tag{2}$$ Since convergent sequences can have at most one limit, $(1)$ says $$x=y,$$ therefore by $(2)$ $$\lim_{j\to\infty} f\left(x_{n_{k_j}}\right)=f(x)$$ as we wanted.

leo
  • 10,769
1

I will add one more proof, which works in greater generality and is shorter, as its requires no sequences, no inequalities, just pure thought:

Theorem. Suppose that $X, Y$ are topological spaces, $X$ is Hausdorff, and $f: X\to Y$ is a map whose graph $G_f\subset X\times Y$ is compact. Then $f$ is continuous.

Proof. Consider the surjective map $$ F: X\to G_f, F(x)=(x, f(x)). $$ Continuity of $F$ is equivalent to continuity of $f$, thus, I will be proving that $F$ is continuous. The inverse map to $F$ is the restriction to $G_f$ of the projection $\pi_X: X\times Y\to X$. The projection $\pi_X$ is continuous, so is its restriction to $G_f$. Now, the map $$ F^{-1}=\pi_X|_{G_f}: G_f\to X $$ is a continuous bijection from a compact space to a Hausdorff space. Hence, $F^{-1}$ is a homeomorphism (see for instance here). Thus, its inverse, $F$, is also continuous. qed

Moishe Kohan
  • 111,854