---
tag: 054Q5PW5GX
kind: statement
role: theorem
name: Compact iff complete and totally bounded
msc: ["54E45"]
uses: [0K8SGQSV7G, 08EWT7J0SC, 0WE5BBHGM6, 0T2WYDTRP2]
sources:
  - url: https://en.wikipedia.org/wiki/Totally_bounded_space
    locator: Comparison with compact sets
  - url: https://en.wikipedia.org/wiki/Compact_space
    locator: Metric spaces
---

## Statement

Let $(X, d)$ be a [[metric space|063W5JMY85]] and let $K \subseteq X$.
Then $K$ is [[compact|00R0X1WGPX]] if and only if $K$, with the [[subspace metric|0T2WYDTRP2]], is [[complete|08EWT7J0SC]] and $K$ is [[totally bounded|0WE5BBHGM6]].

## Remarks

Proof idea of the converse: in a totally bounded set, a diagonal argument gives a Cauchy subsequence of each sequence. Completeness gives a limit. Thus $K$ is sequentially compact, and so [[compact|0K8SGQSV7G]].
In a complete space $X$, a subset is compact if and only if it is closed and totally bounded.
The [[Heine–Borel theorem|07PFYV65MB]] follows, because bounded subsets of $\mathbb{R}^n$ are totally bounded.

## Explanations

### L1 human

Compactness in a metric space splits into two parts: no holes, and finitely many small pieces for each size.
The interval $(0, 1)$ is totally bounded but has holes at its ends. The real line has no holes but is not totally bounded.
