Skip to content
GRE Math overview

Public topic · GRE Math

Metric Spaces and Compactness

A free GRE Mathematics note on metrics, open and closed sets, the Heine-Borel characterisation of compactness, what compactness buys for continuous functions, and how connectedness is tested.

Concise answer

In Euclidean space, compact means closed and bounded, and that single equivalence answers most exam items after two quick checks. Outside Euclidean space the definition that survives is the covering one — every open cover has a finite subcover — and the reason compactness matters is what it gives continuous functions: attained maxima and minima, uniform continuity, and compact images.

Definitions

Metric
A function d(x,y)0d(x,y) \ge 0 on a set XX with d(x,y)=0d(x,y) = 0 exactly when x=yx = y, d(x,y)=d(y,x)d(x,y) = d(y,x), and d(x,z)d(x,y)+d(y,z)d(x,z) \le d(x,y) + d(y,z).
Open set
A set UU such that every xUx \in U has some radius r>0r > 0 with the ball B(x,r)={y:d(x,y)<r}B(x,r) = \{y : d(x,y) < r\} contained in UU.
Closed set
A set whose complement is open; equivalently, a set that contains all of its limit points. 'Closed' is not the negation of 'open': [0,1)[0,1) is neither and \emptyset is both.
Compact set
A set for which every open cover has a finite subcover. In Rn\mathbb{R}^n this is equivalent to being closed and bounded.
Connected set
A set that cannot be written as the union of two disjoint nonempty subsets that are both open in it. In R\mathbb{R} the connected sets are exactly the intervals.
Complete metric space
A space in which every Cauchy sequence converges to a point of the space. Completeness depends on the metric, not on the topology alone.

Intuition

Compactness is a finiteness surrogate. A finite set has no room for a sequence to escape, and no cover of it needs infinitely many pieces; compactness gives an infinite set those same two conveniences, which is why the theorems that fail on (0,1)(0,1) — attained maxima, uniform continuity — hold on [0,1][0,1]. The set (0,1)(0,1) fails because the cover {(1/n,1)}\{(1/n, 1)\} has no finite subcover: the escape route toward 00 is never closed off.

Closed and bounded are two independent leaks, and Heine-Borel says that in Rn\mathbb{R}^n plugging both is enough. Outside Rn\mathbb{R}^n that is false: an infinite set under the discrete metric (distance 11 between distinct points) is closed and bounded, yet the cover by all balls of radius 12\tfrac{1}{2} has no finite subcover. Remembering that one counterexample is what keeps the equivalence from being over-applied.

Concept walkthrough

A metric is only four conditions — nonnegativity with d(x,y)=0d(x,y)=0 iff x=yx=y, symmetry, and the triangle inequality — and everything topological is defined from the balls it generates. A set is open when each of its points sits inside a ball contained in the set, and closed when its complement is open. Two habits prevent most errors here: 'closed' is not 'not open' (in R\mathbb{R}, [0,1)[0,1) is neither, while \emptyset and R\mathbb{R} are both), and openness is relative to the ambient space, so [0,1][0,1] is open as a subset of itself.

Compactness has three faces on this exam. The covering definition — every open cover admits a finite subcover — is the one that generalises and the one to use when the space is unfamiliar. Sequential compactness — every sequence has a subsequence converging inside the set — is usually the easiest to disprove. Heine-Borel ties both to 'closed and bounded' in Rn\mathbb{R}^n only. Compact always implies closed and bounded in any metric space, so a set that fails either condition is immediately non-compact; but a closed bounded set outside Rn\mathbb{R}^n may still fail to be compact.

The payoff is in the theorems that need compactness as a hypothesis. A continuous image of a compact set is compact, so a continuous real function on a compact set is bounded and attains its maximum and minimum; a continuous function on a compact set is automatically uniformly continuous. Connectedness carries its own transfer rule: a continuous image of a connected set is connected, which is exactly the intermediate value theorem once you know that the connected subsets of R\mathbb{R} are the intervals. When an exam item asserts a property of ff on a set, first ask whether the set is compact, connected, both, or neither — the hypothesis being tested is almost always one of those.

After this page, you should be able to

  • Decide whether a given subset of R\mathbb{R} or Rn\mathbb{R}^n is open, closed, both, or neither, by checking interior points and limit points.
  • Apply the Heine-Borel characterisation correctly and state where it stops applying.
  • Produce an explicit open cover with no finite subcover to prove a set is not compact.
  • Use compactness to justify attained extrema, uniform continuity, and compact images under continuous maps.
  • Test connectedness in R\mathbb{R} by the interval criterion and in Rn\mathbb{R}^n by exhibiting paths.

Formulas and assumptions

Open ball

B(x,r)={yX:d(x,y)<r}B(x, r) = \{\, y \in X : d(x, y) < r \,\}

Variables

  • x: the centre
  • r: a positive radius
  • d: the metric on X

Assumptions

  • r > 0.
  • The inequality is strict, so the ball is always an open set.

Heine-Borel (Euclidean space only)

KRn compact    K closed and boundedK \subseteq \mathbb{R}^{n} \text{ compact} \iff K \text{ closed and bounded}

Variables

  • K: the subset under test
  • n: the Euclidean dimension

Assumptions

  • The ambient space is R^n with the usual metric.
  • In a general metric space only the forward direction holds.

Covering definition of compactness

K compact     open covers {Gi}iI of K,   finite JI with KiJGiK \text{ compact} \iff \forall \text{ open covers } \{G_i\}_{i \in I} \text{ of } K, \; \exists \text{ finite } J \subseteq I \text{ with } K \subseteq \bigcup_{i \in J} G_i

Variables

  • K: the set being tested
  • {G_i}: a family of open sets whose union contains K

Assumptions

  • This definition applies in any metric or topological space.
  • Disproving compactness needs one explicit cover with no finite subcover.

Continuity by preimages

f continuous    f1(U) open for every open Uf \text{ continuous} \iff f^{-1}(U) \text{ open for every open } U

Variables

  • f: a map between metric spaces
  • U: an arbitrary open set in the codomain

Assumptions

  • Preimages, not images: a continuous map need not send open sets to open sets.

Worked example

One set is compact, its subset is not

Let S={0}{1n:nN}S = \{0\} \cup \left\{ \tfrac{1}{n} : n \in \mathbb{N} \right\} and T=S{0}T = S \setminus \{0\}. Show that SS is compact and that TT is not.

  1. 1Both sets lie in [0,1][0,1], so both are bounded and Heine-Borel reduces the question to whether each is closed.
  2. 2The only limit point of {1n}\left\{ \tfrac{1}{n} \right\} is 00, because any point p0p \neq 0 has a ball around it meeting the sequence in at most finitely many terms. Since 0S0 \in S, the set SS contains all its limit points and is closed; by Heine-Borel it is compact.
  3. 3Direct covering check for SS: given an open cover, some member UU contains 00, so U(ε,ε)U \supseteq (-\varepsilon, \varepsilon) for some ε>0\varepsilon > 0, and UU already contains every 1n\tfrac{1}{n} with n>1/εn > 1/\varepsilon. Only finitely many points remain, and one cover member for each of them completes a finite subcover.
  4. 4TT omits 00, which is a limit point of TT, so TT is not closed and therefore is not compact.
  5. 5Explicit cover proving it: let Un=(1n+1,2)U_n = \left( \tfrac{1}{n+1}, 2 \right) for n1n \ge 1. Then 1kUn\tfrac{1}{k} \in U_n exactly when knk \le n, so nUn=T\bigcup_n U_n = T; any finite subfamily has a largest index NN and misses 1N+1\tfrac{1}{N+1}.

SS is closed and bounded, hence compact, and every open cover of it reduces to a finite one. TT is bounded but not closed, and the cover {(1n+1,2)}n1\left\{ \left( \tfrac{1}{n+1}, 2 \right) \right\}_{n \ge 1} has no finite subcover, so TT is not compact.

Common traps

  • Applying Heine-Borel outside Rn\mathbb{R}^n: an infinite set with the discrete metric is closed and bounded but not compact.
  • Reading 'not open' as 'closed'. In R\mathbb{R} the set [0,1)[0,1) is neither, and \emptyset and R\mathbb{R} are both.
  • Claiming a continuous map sends open sets to open sets, or closed sets to closed sets — only preimages of open sets are guaranteed open, and f(x)=1/(1+x2)f(x) = 1/(1+x^2) maps the closed set R\mathbb{R} onto the non-closed set (0,1](0,1].
  • Treating boundedness as compactness and concluding that a continuous function on (0,1)(0,1) must attain a maximum; f(x)=1/xf(x) = 1/x is the standing counterexample.
  • Assuming completeness is a topological property: (0,1)(0,1) and R\mathbb{R} are homeomorphic, yet R\mathbb{R} is complete with the usual metric and (0,1)(0,1) is not.

Question depth and domain coverage vary by exam. Practice answers are checked after submission.

Sources

  1. GRE Subject Test Content and StructureETS. Accessed 2026-07-06. Use as a cited source for exam facts; do not imply affiliation or reproduce protected test material.
  2. Mathematical Analysis (Zakon), Section 3.7: Metric SpacesLibreTexts Mathematics. Accessed 2026-08-15. Zakon's Mathematical Analysis on LibreTexts is CC BY 3.0; attribute the author and platform and avoid verbatim reuse beyond short cited references.
  3. Mathematical Analysis (Zakon), Section 3.8: Open and Closed Sets. NeighborhoodsLibreTexts Mathematics. Accessed 2026-08-15. Zakon's Mathematical Analysis on LibreTexts is CC BY 3.0; attribute the author and platform and avoid verbatim reuse beyond short cited references.
  4. Mathematical Analysis (Zakon), Section 4.6: Compact SetsLibreTexts Mathematics. Accessed 2026-08-15. Zakon's Mathematical Analysis on LibreTexts is CC BY 3.0; attribute the author and platform and avoid verbatim reuse beyond short cited references.
  5. Mathematical Analysis (Zakon), Section 4.7: More on CompactnessLibreTexts Mathematics. Accessed 2026-08-15. Zakon's Mathematical Analysis on LibreTexts is CC BY 3.0; attribute the author and platform and avoid verbatim reuse beyond short cited references.
  6. Mathematical Analysis (Zakon), Section 4.8: Continuity on Compact Sets. Uniform ContinuityLibreTexts Mathematics. Accessed 2026-08-15. Zakon's Mathematical Analysis on LibreTexts is CC BY 3.0; attribute the author and platform and avoid verbatim reuse beyond short cited references.
  7. Mathematical Analysis (Zakon), Section 4.10: Arcs and Curves. Connected SetsLibreTexts Mathematics. Accessed 2026-08-15. Zakon's Mathematical Analysis on LibreTexts is CC BY 3.0; attribute the author and platform and avoid verbatim reuse beyond short cited references.

Sources and corrections

Sources last checked 2026-08-15

Every source cited on this page was checked on the date shown, and we update the page when a source changes. If something looks wrong, tell us and we'll recheck it.