# Homework Help: Question about compactness

1. Dec 7, 2012

### sammycaps

1. So I worked on this problem, only to find that the solutions claim a fairly simple answer. The question is as follows

Let X be a metric space with metric d; let A $\subset$ X be nonempty. Show that if A is compact, d(x,A)=d(x,a) for some a$\in$A.

2. Relevant equations
d(x,A)=inf{d(x,a)|a$\in$A}

3. The attempt at a solution
So the solutions claimed an easy fix. The function is continuous in both variables so a continuous image of a compact set is compact and so on the set {x} × A, it reaches a minimum.

My solution was more convoluted, because I did not immediately see that the distance function was continuous in the second variable. This is how I did it.

Pf:
Consider the collection, ℂ, of all sets ℂε, ε>d(x,A) , such that a$\in$ℂε if and only if d(x,a)<ε.

Then, for any arbitrary finite collection {Cεi}, we can order them by set inclusion and we see that their intersection is nonempty, for if it were empty, then this would imply that d(x,A)≠inf{d(x,a)|a$\in$A}.

Then, by the finite intersection property of a compact set, the intersection of all of these sets must be nonempty, so let p be that element in the intersection. Then I claim that d(x,p)≤d(x,a) for all a$\in$A, for if not then d(x,p)>d(x,a) for some a, so then we can fit an ε between d(x,p) and d(x,a) (by the order properties of ℝ). Then, the infinite intersection will not contain p, a contradiction.

So, then d(x,p)≤d(x,a) for all a$\in$A. So, by the definition, d(x,A)≤d(x,p) but similarly, d(x,p)≤d(x,A) since it is a lower bound of the set. Therefor d(x,A)=d(x,p).

There are a few places where I was lax on the rigor (like claiming my formation of the collection is actually ok), but let me know if it looks right.

2. Dec 7, 2012

### pasmith

I'm going to assume that X is complete, because otherwise the proposition that a continuous function on a compact set attains its bounds does not hold.

By definition d(x,y) = d(y,x) for all x and y. Thus if f(x) = d(x,a) for some fixed a is continuous, we have immediately that f(x) = d(a,x) is continuous.

So $C_\epsilon = \{a \in A: d(x,a) < \epsilon \}$ and $\mathcal{C} = \{C_\epsilon: \epsilon > d(x,A)\}$.

It's obvious that, for a finite collection,
$$\bigcap_{i} C_{\epsilon_i} = C_{\min \epsilon_i} = \{a \in A : d(x,a) < \min \epsilon_i \}.$$
But since $\min \epsilon_i > d(x,A),$ there must by definition of infimum exist some $y \in A$ such that $d(x,A) < d(x,y) < \min \epsilon_i$, and so the intersection is not empty. This is so whether or not A is compact, provided the infimum exists (which it must do, because 0 is always a lower bound for d(x,y)).

The remainder of your proof is suspect since you've never actually used the assumption that A is compact (other than to invoke a proposition about intersections of compact sets, which as you are applying it says that if the $C_{\epsilon_i}$ are compact then their intersection is compact; unfortunately the $C_{\epsilon_i}$ are open and so not compact).

I think what you need to do is take a countable intersection, so that you may rightly conclude that
$$\bigcap_{i} C_{\epsilon_i} = \{a \in A : d(x,a) = d(x,A)\}.$$
Then you need to use compactness of A to show that this intersection is not empty: for example, by constructing a Cauchy sequence $(a_i)$ whose limit is in the intersection (X is complete, so by definition every Cauchy sequence converges, and A is closed, so the limit of the sequence must be in A). But that's essentially the proof that a continuous function on a compact set is bounded and attains its bounds.

Last edited: Dec 7, 2012
3. Dec 7, 2012

### sammycaps

Well the solutions claim that d is a continuous function into ℝ, a set in the order topology, and so for fixed x, d(x,A) attains a minimum in ℝ (I guess by extreme value theorem). Is this not correct?

Also, there is no mention of completeness, and so I'm guessing the continuous function proof is the best way.

Anyway, I see now where I messed up in my construction, thanks very much.

4. Dec 7, 2012

### pasmith

Yes. I had overlooked that a continuous function from a compact space to $\mathbb{R}$ is bounded and attains its bounds, whether or not that space is complete.

5. Dec 7, 2012

### sammycaps

Not to worry, you've helped me plenty.

Out of curiosity then, is it true that a continuous function from a compact subset of a complete metric space attains a minimum?