# Compactness and continuous functions

> In R^n, compactness is equivalent to being closed and bounded.

Course: [Real analysis: limits and rigorous reasoning](https://studybrix.com/en/courses/real-analysis/index.md)
Level: advanced
Prerequisites: Real limits, closed sets and boundedness.

## Notes

### Euclidean criterion

In R^n, compactness is equivalent to being closed and bounded.

### Extreme values

A continuous real-valued function on a nonempty compact set attains a maximum and minimum.

### Uniform continuity

Continuity on a compact domain implies uniform continuity.

### Domain matters

Closed-and-bounded is not a general compactness criterion in every metric or normed space.

## Practice questions

### 1. Which subset of R is compact?

A. R
B. [0,1]
C. [0,infinity)
D. (0,1)

Answer: [0,1]

Explanation: The interval is closed and bounded in R.

### 2. Give a continuous bounded function on (0,1) that does not attain its supremum.

Sample answer / marking guidance: f(x)=x has supremum 1, but x=1 is not in the domain.

Explanation: Credit the open domain and absence of a maximizing point.

### 3. What hypothesis is missing from the claim that every continuous function has a maximum?

A. An appropriate nonempty compact domain
B. Only a name for the function
C. A colorful graph
D. A positive derivative everywhere

Answer: An appropriate nonempty compact domain

Explanation: Continuity alone is insufficient on arbitrary domains.

### 4. Explain why f(x)=1/x is not uniformly continuous on (0,1).

Sample answer / marking guidance: Take x_n=1/(n+1) and y_n=1/n for n≥2. Their distance tends to zero but abs(f(x_n)−f(y_n))=1.

Explanation: Credit two valid domain sequences with input distance tending to zero and output separation not tending to zero.

### 5. Find the maximum of x(1−x) on [0,1].

Answer: 0.25

Explanation: Complete the square: x(1−x)=1/4−(x−1/2)².

### 6. What does sequential compactness say in a metric space?

Sample answer / marking guidance: Every sequence in the set has a subsequence converging to a point in the set.

Explanation: Credit the subsequence and the requirement that its limit remain in the set.

### 7. Does a continuous image of a compact set remain compact?

A. Never
B. Only if the map is linear
C. Yes
D. Only if it is injective

Answer: Yes

Explanation: Continuous images preserve compactness.

### 8. Distinguish a supremum from a maximum.

Sample answer / marking guidance: A supremum is the least upper bound. A maximum is an attained value that is at least every other value; the supremum need not be attained.

Explanation: Credit the attainment distinction and a coherent definition.

## Further reading

- https://ocw.mit.edu/courses/18-100a-real-analysis-fall-2020/
- https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/

Original AI-assisted educational draft; not independently teacher-reviewed. References support further study, not copied exercises, affiliation or curriculum accreditation.
