Small Group Tutorials

Here to help students catch up, keep up, and move ahead. Book a consultation here.

Compactness and Connectedness | Finite Control, Separation and Global Structure

Topology becomes powerful when local information can control an entire space.

Compactness and connectedness are two of the first genuinely global ideas in topology. Compactness asks whether an apparently infinite collection of local pieces can, in a precise sense, be reduced to finitely many. Connectedness asks whether the space can be separated into two nonempty open pieces. Neither idea is simply about size, distance or drawing. Both are properties of the topology itself and therefore survive homeomorphism.

This guide serves R22.03 · Compactness and connectedness in the BTT Mathematics Atlas. It builds on Topological Spaces and Continuity and Metric Spaces and Examples. The central objective is to distinguish statements that hold in all topological spaces from stronger statements that require metric, Hausdorff or Euclidean hypotheses.

Return route: BTT Mathematics Hub.

The simple answer

A topological space X is compact if every open cover of X has a finite subcover. An open cover is a collection of open sets whose union contains X. Compactness says that no matter how many open sets are used to cover the space, finitely many of them already suffice.

A space X is connected if it cannot be written as the union of two disjoint nonempty open sets. Equivalently, the only subsets of X that are both open and closed are ∅ and X. Connectedness says the space cannot be split into two topologically separated pieces.

Compactness is about finite control. Connectedness is about inseparability. They are independent properties: a space may have one, both or neither.

1. Open covers and finite subcovers

Let X be a topological space. A family {Ui}i∈I of open sets is an open cover of X if X⊆⋃i∈IUi. Usually each Ui is itself a subset of X, so the condition is simply X=⋃Ui.

A subcover is a subfamily that still covers X. A finite subcover uses only finitely many members Ui₁,…,Uiₙ.

The order of quantifiers matters. Compactness does not say that there exists one favourite finite collection of open sets covering X. It says that every open cover, however chosen, contains some finite subcover.

Worked example 1: every finite space is compact

Let X={x₁,…,xₙ} be finite and let {Ui} be any open cover. For each point xk, choose one cover member containing it. At most n chosen sets are needed. Their union contains every point of X, so they form a finite subcover.

This proof does not depend on the topology. Every finite topological space is compact.

2. Why R is not compact

To prove a space is not compact, it is enough to find one open cover with no finite subcover.

Cover R by the sets Un=(−n,n), n=1,2,3,…. Their union is R. But any finite selection has a largest index N, and its union is contained in (−N,N), so it misses points outside that interval. Hence no finite subcover exists. Therefore R is not compact.

The lesson is not merely “unbounded spaces are noncompact”. That conclusion is true in Euclidean spaces, but compactness is topological while boundedness depends on a metric. In an arbitrary topological space, the word bounded may not even be defined.

3. Why (0,1) is not compact

The open interval (0,1) is bounded in the usual metric, yet it is not compact. One open cover is

Un=(1/n,1), n=2,3,4,… .

Every x∈(0,1) lies in some Un, because eventually 1/n<x. But any finite selection has a largest n, and the union equals one of the selected intervals with smallest left endpoint, still missing points sufficiently close to 0. Therefore there is no finite subcover.

This example prevents an important mistake: boundedness by itself does not imply compactness, even in R.

4. Heine–Borel in Euclidean space

In Rⁿ with its usual topology, a subset K is compact if and only if it is closed and bounded. This is the Heine–Borel theorem.

The theorem is extremely useful and extremely easy to overgeneralise. “Compact = closed and bounded” is not the definition of compactness and is not true in every metric space. It is a theorem for Euclidean finite-dimensional spaces and for some related settings under additional hypotheses.

For example, the closed unit ball in an infinite-dimensional normed space need not be compact. The familiar Rⁿ intuition must therefore be carried with its domain attached.

Worked example 2: [0,1] is compact

The interval [0,1] is closed and bounded in R. By Heine–Borel it is compact. This fact drives many theorems in elementary analysis: continuous functions on [0,1] cannot behave as wildly as continuous functions on arbitrary domains.

5. Compact subsets of Hausdorff spaces are closed

Every metric space is Hausdorff, so in metric spaces every compact subset is closed. More generally, compact subsets of Hausdorff topological spaces are closed.

The Hausdorff condition matters. Without it, a compact subset need not be closed. It is therefore unsafe to state “compact sets are closed” without naming a setting such as a metric or Hausdorff space.

Proof idea

Let K be compact in a Hausdorff space X, and take x∉K. For each y∈K, choose disjoint open neighbourhoods Uy of y and Vy of x. The Uy cover K. Compactness gives finitely many Uy₁,…,Uyₙ. The intersection V=Vy₁∩⋯∩Vyₙ is an open neighbourhood of x disjoint from K. Thus X\K is open, so K is closed.

The proof shows how compactness converts infinitely many local separations—one for every y∈K—into finitely many that can be intersected.

6. Closed subsets of compact spaces are compact

If X is compact and F⊆X is closed, then F is compact in the subspace topology.

Suppose {Ui} is an open cover of F by sets open in the subspace. Extend each to an open set of X, or equivalently use the subspace form. Add the open set X\F. The resulting family covers X. Compactness gives a finite subcover; discarding X\F if it appears leaves finitely many sets covering F.

Unlike the previous theorem, this implication does not require Hausdorffness.

7. Continuous images of compact spaces are compact

If f:X→Y is continuous and X is compact, then f(X) is compact.

Take an open cover {Vi} of f(X). The inverse images f−1(Vi) form an open cover of X. Compactness gives finitely many of them covering X. The corresponding Vi then cover f(X).

This theorem is one of topology’s most reusable machines: continuous maps transport compactness forward.

8. Extreme values from compactness

Let f:X→R be continuous and X compact. Then f(X) is compact in R. By Heine–Borel, f(X) is closed and bounded. Being bounded means f has a finite supremum M and infimum m. Being closed means those limit values belong to f(X). Therefore there exist points xmax,xmin∈X with f(xmax)=M and f(xmin)=m.

This is the topological engine behind the Extreme Value Theorem. On a compact domain, a continuous real-valued function actually attains its maximum and minimum.

Why the hypotheses matter

On the noncompact interval (0,1), the continuous function f(x)=x has supremum 1 and infimum 0, but neither value is attained. The formula is harmless; the missing endpoints are the issue.

9. Compact-to-Hausdorff continuous bijections

If f:X→Y is a continuous bijection, X is compact and Y is Hausdorff, then f is a homeomorphism.

For a closed set F⊆X, F is compact because it is closed in a compact space. Its image f(F) is compact because f is continuous. Since Y is Hausdorff, f(F) is closed. Thus f maps closed sets to closed sets. A bijective closed map has continuous inverse, so f−1 is continuous.

This theorem repairs the common misconception that every continuous bijection is automatically a homeomorphism. Compactness plus Hausdorffness supplies the missing control.

10. Sequential compactness in metric spaces

A space is sequentially compact if every sequence has a convergent subsequence whose limit lies in the space.

In metric spaces, compactness and sequential compactness are equivalent. In arbitrary topological spaces, they need not be equivalent. This is another place where metric-space habits must not be promoted to universal laws.

Worked example 3: Bolzano–Weierstrass on [0,1]

Any sequence in [0,1] has a convergent subsequence with limit in [0,1]. One proof repeatedly bisects the interval and chooses a half containing infinitely many sequence terms. The nested intervals shrink to a point, and selecting one later sequence term from each interval produces a convergent subsequence.

This is sequential compactness in concrete form.

11. Compactness, completeness and total boundedness

In a metric space, compactness is equivalent to being complete and totally bounded. Total boundedness means that for every ε>0, the whole space can be covered by finitely many ε-balls.

Total boundedness is stronger than ordinary boundedness. A bounded metric space may still require infinitely many small ε-balls. For example, an infinite set with the discrete metric is bounded by 1, but for ε<1 each ε-ball contains only one point, so an infinite number of them is needed. Thus an infinite discrete metric space is not totally bounded and is not compact.

This explains why “closed and bounded” fails outside finite-dimensional Euclidean settings. Boundedness is too weak; total boundedness is the metric condition aligned with compactness.

12. Connectedness by separation

A separation of X is a pair of disjoint nonempty open subsets U,V whose union is X. A space is connected if no such separation exists.

Because U=X\V and V=X\U, each member of a separation is both open and closed. Therefore X is connected if and only if the only clopen subsets are ∅ and X.

Worked example 4: a disconnected set

Let X=(−2,−1)∪(1,2) as a subspace of R. The two intervals are nonempty, disjoint and open in X, and their union is X. Therefore X is disconnected.

The visual gap suggests the answer, but the proof is topological: exhibit a separation in the subspace topology.

13. Intervals in R are connected

Every interval in R is connected. Conversely, every connected subset of R is an interval in the broad order-convex sense: whenever a<c are in the subset, every b between them must also be in the subset.

The proof uses the least-upper-bound property of R. If an interval could be separated into U and V, choose a point from each side and consider the supremum of points from one side before the other. The supremum cannot belong consistently to either open piece without forcing points from the other side arbitrarily close, creating a contradiction.

This theorem is the topological core behind the Intermediate Value Theorem.

14. Continuous images of connected spaces are connected

If X is connected and f:X→Y is continuous, then f(X) is connected.

Suppose f(X) were separated into nonempty open pieces A and B in the subspace topology. Then f−1(A) and f−1(B) would be disjoint nonempty open subsets of X whose union is X, contradicting connectedness.

Intermediate Value Theorem as connectedness

If f:[a,b]→R is continuous, the interval [a,b] is connected, so f([a,b]) is connected. Connected subsets of R are intervals. Therefore if f(a)<y<f(b), the value y must belong to f([a,b]), so there is c∈[a,b] with f(c)=y.

The familiar theorem from calculus is therefore an instance of a general topological preservation principle.

15. Path connectedness

A space X is path connected if for every x,y∈X there exists a continuous map γ:[0,1]→X with γ(0)=x and γ(1)=y. The map γ is a path from x to y.

Every path-connected space is connected. If X had a separation U∪V, a path joining a point of U to a point of V would have connected image γ([0,1]), because [0,1] is connected. That image could not meet both separated pieces.

The converse is false. There are connected spaces that are not path connected. The classical topologist’s sine curve provides a standard example: the closure of {(x,sin(1/x)):x>0} in R² is connected but cannot be joined by paths across all of its limiting vertical segment in the expected way.

16. Convex sets are path connected

A subset C of Rⁿ is convex if for any x,y∈C and t∈[0,1], the point (1−t)x+ty lies in C. Then γ(t)=(1−t)x+ty is a continuous path inside C. Therefore every convex subset of Rⁿ is path connected, hence connected.

This gives a fast route to connectedness for intervals, balls, boxes and many feasible regions in optimisation.

17. Components and path components

A connected component of X is a maximal connected subset: it is connected and cannot be enlarged within X while remaining connected. Every point lies in exactly one connected component.

A path component is a maximal path-connected subset. Path components sit inside connected components, but the two need not coincide in general. In well-behaved spaces such as many manifolds and open subsets of Rⁿ that are locally path connected, connected components and path components do coincide.

18. Unions of connected sets with a common point

If {Ci} is a family of connected subsets of X and all Ci share at least one common point, then ⋃Ci is connected.

Suppose the union had a separation U,V. The common point lies in one side, say U. Each connected Ci meets U at that point and therefore cannot also meet V, or else Ci itself would be separated. Thus every Ci lies in U, contradicting that V is nonempty.

This theorem is an effective construction tool: build a larger connected object from overlapping connected pieces.

19. Compactness and connectedness are independent

  • Compact and connected: [0,1].
  • Compact and disconnected: {0,1} with the usual subspace topology.
  • Noncompact and connected: R.
  • Noncompact and disconnected: (−∞,0)∪(0,∞).

A space does not become connected merely because it is compact, and it does not become compact merely because it is connected. The properties answer different questions.

20. Compact connected spaces and continua

In many areas of topology, a nonempty compact connected metric space is called a continuum. Examples include a closed interval, a circle and many compact curves. The term packages two kinds of global control: the space cannot break into separated pieces, and its open-cover behaviour is finite in the compactness sense.

Terminology varies by field, so definitions should be stated when the term is used. The underlying ideas—compactness and connectedness—are the important mathematical objects.

21. Local connectedness

A space is locally connected if every point has a neighbourhood basis consisting of connected open sets. Local connectedness does not mean the whole space is connected. For example, a disjoint union of two open intervals is locally connected but disconnected.

Likewise, locally path connected means points have neighbourhood bases of path-connected sets. In locally path-connected spaces, connected open sets have strong path behaviour, and components are open. These local-global distinctions become important in covering-space theory.

22. Compactness under products

The product of two compact spaces is compact. More generally, the Tychonoff theorem states that an arbitrary product of compact spaces is compact in the product topology. The general theorem is deep and in standard set-theoretic foundations is equivalent to a form of the Axiom of Choice.

For this stage, the finite-product result is the practical one to carry forward. It explains why closed rectangles [a,b]×[c,d] are compact once the product topology is understood.

23. Connectedness under products

The product of connected spaces is connected. For two factors X and Y, fix (x₀,y₀). Each slice X×{y} is connected and each vertical slice {x₀}×Y is connected. The union of suitable slices shares common points and fills X×Y, allowing the common-point union theorem to establish connectedness.

Products therefore preserve two of the central properties introduced in this guide. The next Atlas cell develops product topology systematically.

24. Compactness under quotients

A quotient map is continuous and surjective by definition of the usual quotient construction. Since continuous images of compact spaces are compact, any quotient of a compact space is compact.

Similarly, continuous images of connected spaces are connected, so quotients of connected spaces are connected. This is one reason quotient constructions are effective for producing circles, tori and other connected compact spaces from compact connected pieces.

25. Common misconceptions

  • “Compact means small.” No. Compactness is an open-cover property, not visual size.
  • “Compact means closed and bounded.” Only under hypotheses such as subsets of Rⁿ with the usual topology.
  • “Bounded implies compact.” False. (0,1) is bounded and noncompact.
  • “Every compact set is closed.” True in Hausdorff spaces, not universally.
  • “Every sequence in a compact topological space has a convergent subsequence.” This equivalence is safe in metric spaces; arbitrary topological spaces require more care.
  • “Connected means path connected.” Path connected implies connected; the converse can fail.
  • “A disconnected space must have a visible geometric gap.” The proof criterion is a separation, not a picture.
  • “Locally connected means connected.” False; local and global properties differ.

26. Proof pattern: showing compactness

There are several reliable strategies:

  1. Use the definition: start with an arbitrary open cover and extract finitely many sets.
  2. In Rⁿ, prove the set is closed and bounded and invoke Heine–Borel.
  3. Show the space is the continuous image of a compact space.
  4. Show it is a closed subset of an already compact space.
  5. In metric spaces, use sequential compactness or completeness plus total boundedness when that route is more natural.

The method must match the setting. Invoking Heine–Borel outside its domain is not a proof.

27. Proof pattern: showing connectedness

  1. Assume a separation exists and derive a contradiction.
  2. Show the space is an interval or convex set.
  3. Show it is a continuous image of a connected space.
  4. Build it as a union of connected subsets with a common point.
  5. Show it is path connected by writing an explicit path.

To prove disconnection, one explicit separation is enough.

28. Practice set

  1. Prove every finite topological space is compact.
  2. Give an open cover showing R is not compact.
  3. Give an open cover showing (0,1) is not compact.
  4. Use Heine–Borel to decide whether [−2,5] is compact.
  5. Use Heine–Borel to decide whether [−2,5) is compact.
  6. Prove a closed subset of a compact space is compact.
  7. Prove the continuous image of a compact space is compact.
  8. Show a continuous f:[0,1]→R is bounded and attains its bounds.
  9. Explain why an infinite discrete metric space is not compact.
  10. Show {0}∪{1/n:n∈N} is compact in R.
  11. Show (−1,1) is connected.
  12. Show (−1,0)∪(0,1) is disconnected.
  13. Prove a convex subset of Rⁿ is path connected.
  14. Explain why path connected implies connected.
  15. Show the image of a connected space under a continuous function is connected.
  16. Use connectedness to prove an intermediate-value statement.
  17. Give examples of spaces in all four compact/connected combinations.
  18. Decide whether S¹ is compact and connected.
  19. Decide whether Z with the subspace topology from R is connected.
  20. Explain why compactness is topological but boundedness is metric-dependent.

29. Answers and checks

  1. Choose one cover member for each of finitely many points.
  2. {(−n,n):n∈N}; no finite subfamily reaches arbitrarily large points.
  3. {(1/n,1):n≥2}; finite subfamilies miss points near 0.
  4. Yes: it is closed and bounded in R.
  5. No: it is bounded but not closed in R, hence not compact by Heine–Borel.
  6. Add the open complement to an open cover of the closed subset, compactly cover the whole space, then discard the complement.
  7. Pull an open cover back by inverse images, extract a finite subcover, then push the selected indices forward.
  8. f([0,1]) is compact in R, hence closed and bounded; its supremum and infimum belong to the image.
  9. For ε<1, every ε-ball is a singleton, so finitely many cannot cover infinitely many points.
  10. It is closed and bounded in R, so compact by Heine–Borel.
  11. It is an interval, hence connected.
  12. The two displayed intervals form a separation in the subspace.
  13. Join x to y by γ(t)=(1−t)x+ty.
  14. The image of [0,1] under a path is connected; a separation of X would separate such an image joining opposite sides.
  15. Take a hypothetical separation of the image and pull it back to a separation of the domain.
  16. The image of a connected interval under a continuous real-valued function is a connected subset of R, hence an interval.
  17. Examples: [0,1]; {0,1}; R; (−∞,0)∪(0,∞).
  18. Yes to both: S¹ is the continuous image of [0,1] under t↦(cos2πt,sin2πt), giving compactness and connectedness.
  19. No. Singletons are open in Z as a subspace of R; for example even and odd integers can be separated further, and any two distinct integers lie in different connected components.
  20. Homeomorphisms preserve open covers and finite-subcover structure; boundedness changes when the metric changes even if the topology stays the same.

30. What to carry forward

Compactness converts infinite local information into finite global control. Connectedness prevents a space from decomposing into separated open pieces. Continuous maps preserve both properties, which makes them powerful invariants: if one space is compact or connected and another candidate image is not, certain continuous or homeomorphic relationships are immediately impossible.

The next step is constructive. Instead of only testing an existing space, we build new spaces from old ones. Products place coordinates side by side; quotients deliberately identify points. Continue with Quotients, Products and Identifications.

Return to the BTT Mathematics Hub.