A metric does more than measure distances: it tells us which points are close enough to count as approximations. Continuity means that sufficiently accurate input approximations produce accurate outputs. The same idea has three useful forms: an – estimate for calculations, preservation of convergent sequences for limit arguments, and open preimages for reasoning about whole sets. We prove their equivalence for arbitrary metric spaces, where coordinates and order may be unavailable.
We use the metric compactness equivalences established in the earlier compactness note: compact metric spaces are sequentially compact, and compact subsets of a metric space are closed and bounded.
Open sets and the subspace viewpoint
Definition 1.3.1
(Open and closed sets in a metric space)
Let be a metric space. The open ball consists of points with .
- A set is open in when each has some ball .
- A set is closed in when its complement in is open.
Arbitrary unions and finite intersections of open sets are open: at a point of a finite intersection take the smallest of the finitely many positive ball radii. Infinite intersections can fail to be open; in , .
Definition 1.3.2
(Subspace metric)
If , its inherited metric is the restriction of to . Its balls satisfy
Proposition 1.3.3
(Relatively open and relatively closed sets)
Let carry the subspace metric. A set is open in exactly when for some open in . The closed subsets of are exactly the sets with closed in .
Proof
(Gluing ambient balls)
If with open in and , choose ; then , so is open in . For the nontrivial direction, choose for each an ambient ball whose intersection with lies in ; the union of those ambient balls is open in and satisfies . Taking complements, , shows that the closed subsets of are exactly with closed in .
Worked example 1.3.4
(Relatively open but not open in )
In , the set is open relative to because it is . It is not open in : every real ball about contains negative numbers. The set itself is both open and closed in its own metric space; this makes no assertion that is open in . Always name the ambient space before deciding whether a set is open or closed.
Three descriptions of continuity
Definition 1.3.5
(Continuity at a point)
A map between metric spaces is continuous at if, for every , there is such that
The allowed may depend on and . The map is continuous if it is continuous at every point of .
Theorem 1.3.6
(Equivalent tests for continuity)
For a map between metric spaces, the following are equivalent:
- is continuous at every point of .
- For every sequence in , one has in .
- For every open , the preimage is open in .
Equivalently, preimages of closed sets are closed. Here the sequence limit must belong to .
Proof
(Sequences, balls and complements)
Assume (1). Given and , choose from continuity at ; eventually , so eventually . Thus (2) holds.
For the converse, suppose continuity fails at some . Negating its quantifiers gives an such that for every there is with but . Choosing gives while does not converge to . Thus (2) implies (1).
Assume (1) and let be open in . For choose with . Continuity supplies with . Hence is open, proving (3). Conversely, under (3), the preimage of is an open set containing and therefore contains some ; this is the – condition. Finally, converts the open-preimage condition into its closed-set version.
Proof X-ray
The order of the quantifiers matters
To construct a sequence witnessing failure, first fix one output tolerance that defeats every input radius. Only then choose the radii . Choosing a different output tolerance at each step would not ensure failure to converge to .
Common mistake
(Continuity pulls back; it does not push forward)
The theorem uses preimages, not images. Even a continuous map need not send open sets to open sets: the constant map , , sends the open set to , which is not open.
Distance to a set and separation
Distance from a point to a set measures how well that point can be approximated by members of the set.
Definition 1.3.7
(Distance from a point to a set)
For a nonempty subset of a metric space , define
The infimum is finite and nonnegative, but it need not be attained. For example, in the distance from to is , although no point of that set is at distance from . The definition does not require to be closed or compact.
Theorem 1.3.8
(Distance is a continuous test for closure)
For every nonempty , the function is -Lipschitz. Moreover, exactly when , where the closure is taken in . Thus, if is closed, is precisely the zero set of this continuous function.
Proof
(Taking infima in the triangle inequality)
The triangle inequality gives for every . Taking the infimum over on both sides yields . Interchanging and proves
If , every ball meets , so for every and the distance is zero. Conversely, if the infimum is zero, then for every some has ; hence every ball about meets . This is exactly the closure condition. No nearest point was chosen in this argument.
This function also separates disjoint closed sets by values, even if the sets approach one another arbitrarily closely. Let be nonempty, disjoint and closed in . Then
is continuous and takes values in . The denominator is positive at each point: if both distances were zero, the closure test would put that point in both and . On the value is , and on it is . Continuity follows from the Lipschitz estimate and the nonzero denominator. Consequently and are disjoint open neighborhoods of and .
Worked example 1.3.9
(Disjoint closed sets need not have a positive gap)
In take and . Both sets are closed: any convergent sequence in either set is bounded, so its terms lie in a finite subset, and its limit belongs to that subset. They are disjoint because is not an integer for . Yet , so the infimum of distances between the sets is zero. The function above still separates them: a positive lower bound for the denominator at each fixed point is enough for continuity; a common positive lower bound over all of is not required.
Quick check
(On , use and in the formula for . Find for , , and .)
Write out and on each interval before dividing.
Solution · Answer
Here and . The ratio is for , for , and for . The formulas agree at the endpoints. In particular, the separating function need not be constant outside the interval; check the actual distance formula rather than assuming it is a clipped line.
Composition, restriction and compact domains
If and are continuous, then is continuous: for open ,
which is open by two applications of the theorem. If , the restriction is continuous because is relatively open. These statements do not require to be open or closed in .
A continuous image of a compact metric space is compact. Indeed, an open cover of pulls back to an open cover of ; a finite subcover of pushes forward to finitely many members covering . Thus a real-valued continuous function on nonempty compact attains its maximum and minimum: is a nonempty compact subset of , hence closed and bounded.
Common mistake
(Continuous images of closed sets need not be closed)
Compactness is preserved by continuous maps; closedness is not. The map sends the closed set onto the nonclosed set . Only the preimage of a closed set is guaranteed to be closed.
When a continuous bijection has a continuous inverse
A continuous bijection has a set-theoretic inverse, but continuity of that inverse is a separate question: output points close together might come from inputs far apart. Compactness rules out this behavior when the target is a metric space.
Definition 1.3.10
(Homeomorphism)
A homeomorphism is a bijection for which both the map and its inverse are continuous, with the stated domain and codomain metrics.
Theorem 1.3.11
(Compact-to-metric inverse theorem)
If is a compact metric space, is a metric space, and is a continuous bijection, then is continuous. More generally, a continuous injection is a homeomorphism from onto its image , equipped with the subspace metric.
Proof
(Closed sets are sent to closed sets)
First, every closed subset of is compact. Given an open cover of by sets open in , add the open set to obtain an open cover of ; a finite subcover restricts to a finite cover of . Since is continuous, is compact, hence closed in the metric space . Let . For every closed , the preimage is closed in . The closed-preimage criterion therefore makes continuous. For an injection, regard the same map as a bijection ; its continuity into the subspace follows from the relative topology. Applying the argument to that metric target proves the second claim.
The target here may be the image rather than all of the ambient space. For example, maps continuously and injectively into , so it is a homeomorphism onto its parabolic arc. Its inverse on that arc is simply . There is no inverse defined on all of .
Counterexample mode
Without compactness the inverse can tear
Claim: every continuous bijection between metric spaces has a continuous inverse. Let be , with the inherited metrics. This is a continuous bijection. But , while sends these points to , which does not tend to . Thus the inverse is discontinuous at , and the claim is false. The interval is not compact. Including would restore compactness but destroy injectivity, since ; the hypotheses work together. The repaired statement is the theorem above: a compact domain is required.
Quick check
(Suppose is continuous and injective. Is its inverse on uniformly continuous?)
Combine the inverse theorem with the uniform-continuity theorem proved below.
Solution · Answer
Yes: the theorem gives continuity of the inverse , and its domain is compact as a continuous image of a compact space, so the uniform-continuity theorem proved below applies. Compactness does not give a numerical modulus without further information about .
Uniform continuity and the role of compactness
Definition 1.3.12
(Uniform continuity)
A map is uniformly continuous if for every there is one that works for all : implies .
This is stronger than pointwise continuity because the radius may not depend on the base point.
Concept lensAnalytic
Uniform continuity through pairs of sequences
An equivalent description: is uniformly continuous exactly when, for all sequences and in ,
If is uniformly continuous and , the uniform satisfies for all large , so the outputs are eventually within . If is not uniformly continuous, negating the definition gives one and, for each , points with but . Neither sequence is required to converge. Freezing recovers the sequential test for continuity at . This is the form used in the proof below and in every refutation of uniform continuity on this page: exhibit two sequences that merge in the input but not in the output.
Theorem 1.3.13
(Continuous maps on compact metric spaces are uniformly continuous)
If is compact and is continuous, then is uniformly continuous.
Proof
(A convergent subsequence of bad pairs)
Suppose uniform continuity fails. There is and, for each , points with but . Compactness gives a subsequence . The triangle inequality implies too. Continuity gives and , contradicting the fixed lower bound on their distance.
Compactness entered only once, to make the bad pairs accumulate at a point where continuity could be applied. Without it the bad pairs may escape.
Counterexample mode
Continuity on a noncompact space need not be uniform
Claim: every continuous function on is uniformly continuous. The function is continuous on , but take and . Their input distance is , while , so the tolerance is defeated by every radius. This does not contradict the theorem: is not compact. Conversely, compactness is sufficient, not necessary; the identity map on is uniformly continuous.
Two metrics, one topology, different uniform control
Consider with the usual metric and the metric . The latter is a metric because is injective. These metrics have the same open sets: the cubic and its inverse, the real cube root, are continuous in the usual metric, so each identity map between and is continuous. Thus a function is continuous for one of these input metrics exactly when it is continuous for the other.
Worked example 1.3.14
(Same open sets, different uniform control)
The identity from to is nevertheless not uniformly continuous. With and , , while expanding the cube gives
By the pair-of-sequences description, no single radius works. Same open sets preserve ordinary continuity, but they do not supply a single global modulus of continuity. This is a different question from whether the metric spaces are complete.
For a non-coordinate example, take with . Evaluation at a fixed , , is continuous: . It is even uniformly continuous. The points of this metric space are continuous functions, yet the same – definition and open-preimage theorem apply without change.
Practice with solutions
Quick check
(Is open in ? Is it open in ?)
Look for an open subset of whose intersection with is .
Solution · Answer
Yes, , so it is open in . It is not open in : every ambient open ball around includes points greater than .
Quick check
(Prove that the distance-to-a-point map is continuous on any metric space.)
Compare and with the triangle inequality.
Solution · Answer
The reverse triangle inequality gives , so works at every point. This is the special case of the distance-to-a-set theorem.
Quick check
(Let be continuous and closed. Show that is closed. Must be closed when is closed?)
Express the complement of as a preimage.
Solution · Answer
The complement is , open by continuity, so is closed. Images need not be closed: maps the closed set onto .
Quick check
(Explain why is continuous but not uniformly continuous on .)
For the failure of uniformity, find two sequences approaching whose reciprocals stay apart.
Solution · Answer
At each fixed , choosing sufficiently close to keeps it away from zero and controls . But and , for , lie in and have input distance , while their outputs differ by . Thus no single radius works for tolerance .