Metric Spaces Practice Quiz with a Step-by-Step Interactive Lesson
Use the quiz at the top of the page to practice metric spaces: metric axioms, positive rescalings of metrics, open balls \(B(a,r)\), closed balls, open and closed sets, isolated points, closure, interior and boundary, dense subsets, equivalent metrics with the same open sets, convergence \(x_n\to x\), Cauchy sequences, completeness, completions such as \(\mathbb{Q}\) completing to \(\mathbb{R}\), continuity, uniform continuity, isometries, product metrics, compactness, and total boundedness. If you need a refresher, open the lesson for mentally followable examples and quick checks.
How this metric spaces practice works
1. Take the quiz: answer the metric, topology, convergence, completeness, and compactness questions at the top of the page.
2. Open the lesson: review the definitions and recognition tests with short worked examples.
3. Retry: return to the quiz and translate each question into a definition or theorem before choosing.
What you will learn in the metric spaces lesson
Metrics, balls, and examples
Metric axioms: nonnegativity, separation, symmetry, and the triangle inequality.
Balls: \(B(a,r)=\{x:d(x,a)<r\}\) and closed balls \(\{x:d(x,a)\le r\}\).
Examples: usual distance, positive rescalings such as \(2d\), discrete metric, and product metrics.
Open, closed, dense, boundary
Open and isolated: every point of an open set has a ball inside the set; an isolated point has a ball containing only itself.
Closed: limits of convergent sequences in the set stay in the set.
Dense and topology: every nonempty open ball meets the subset; metrics with the same open sets define the same topology.
Sequences and completeness
Convergence: \(x_n\to x\) means \(d(x_n,x)\to0\).
Cauchy: terms eventually become arbitrarily close to each other.
Complete: every Cauchy sequence converges inside the space; every finite metric space is complete.
Compactness and total boundedness
Compact metric spaces: every sequence has a convergent subsequence.
Total boundedness: finitely many \(\varepsilon\)-balls cover the space for every \(\varepsilon>0\).
Key theorem: compactness is equivalent to completeness plus total boundedness in metric spaces.
Ready to test the definitions?
Return to the quiz and identify whether each question is about a metric axiom, a ball, a limit, completeness, continuity, compactness, or total boundedness.
Loading...
Higher Analysis
Metric Spaces Lesson
1 / 8
Lesson overview
Purpose: Build a reliable metric-space toolkit: check metric axioms, read open and closed balls, identify open, closed, dense, interior, boundary, and closure behavior, translate convergence and Cauchy definitions into inequalities, recognize completeness and compactness, and use continuity, isometries, product metrics, and total boundedness without relying on pictures alone.
Success criteria
State the four metric axioms and use separation: \(d(x,y)=0\) iff \(x=y\).
Compute open balls and closed balls in usual, discrete, rescaled, and product metrics.
Recognize open, closed, isolated, interior, boundary, closure, and dense subsets using balls or sequences.
Explain that metrics with the same open sets define the same topology.
Translate \(x_n\to x\) into \(d(x_n,x)\to0\), and prove limits are unique.
Use the Cauchy definition and distinguish convergent from merely Cauchy in incomplete spaces.
Know that \(\mathbb{R}\) is complete, \(\mathbb{Q}\) is not complete, finite metric spaces are complete, and the completion of \(\mathbb{Q}\) is \(\mathbb{R}\).
Use continuity through \(\varepsilon\)-\(\delta\), sequences, preimages of open sets, and the fact that uniform continuity preserves Cauchy sequences.
Recognize compact metric spaces through sequential compactness and through completeness plus total boundedness.
Avoid the trap that closed and bounded always implies compact in every metric space.
Key vocabulary
Metric: a distance function \(d:X\times X\to[0,\infty)\) satisfying separation, symmetry, and triangle inequality.
Open ball: \(B(a,r)=\{x\in X:d(x,a)<r\}\).
Cauchy sequence: terms eventually become arbitrarily close to each other.
Complete space: every Cauchy sequence converges to a point of the space.
Dense subset: every nonempty open ball meets the subset, equivalently the closure is the whole space.
Totally bounded: for every \(\varepsilon>0\), finitely many \(\varepsilon\)-balls cover the space.
Quick pre-check
Pre-check: Which statement is part of the definition of a metric?
Hint: A metric must separate points, so zero distance is reserved for identical points.
A metric is an abstract distance with concrete ball tests
Learning goal: Check whether a formula behaves like a distance and compute balls in simple metrics.
Key idea
A metric \(d\) on \(X\) assigns a nonnegative number to each pair of points. It must satisfy \(d(x,y)=0\) exactly when \(x=y\), symmetry \(d(x,y)=d(y,x)\), and the triangle inequality \(d(x,z)\le d(x,y)+d(y,z)\). The triangle inequality is the main engine behind uniqueness of limits and continuity estimates.
Examples
Usual metric: on \(\mathbb{R}\), \(d(x,y)=|x-y|\).
Positive rescaling: if \(d\) is a metric, then \(d_2(x,y)=2d(x,y)\) is also a metric.
Discrete metric: \(d(x,y)=0\) if \(x=y\), and \(d(x,y)=1\) if \(x≠ y\).
Product metric: \(d((x,y),(x',y'))=d_X(x,x')+d_Y(y,y')\) is a metric on \(X\times Y\).
An open ball is \(B(a,r)=\{x:d(x,a)<r\}\). A closed ball is \(\overline{B}(a,r)=\{x:d(x,a)\le r\}\). In unusual metrics, balls can look very different from intervals or round disks.
Worked example
Example: In the discrete metric, what is \(B(a,1/2)\)?
Every point \(x≠ a\) has \(d(x,a)=1\), which is not less than \(1/2\). The center has distance \(0\). Therefore \(B(a,1/2)=\{a\}\).
Try it
Try it: In the discrete metric, what is \(B(a,1/2)\)?
Hint: Compare the radius \(1/2\) with the distance from \(a\) to any different point.
Metric topology is controlled by balls
Learning goal: Decide whether points are interior, boundary, closure, or density points using open balls.
Key idea
A set \(U\subseteq X\) is open if every \(u\in U\) has some ball \(B(u,r)\subseteq U\). A set \(F\) is closed if it contains the limits of all convergent sequences from \(F\). In metric spaces, sequential language is usually enough to test closedness.
Recognition checklist
Interior: \(x\) is interior to \(A\) if some ball around \(x\) lies inside \(A\).
Closure: \(x\in\overline{A}\) if every ball around \(x\) meets \(A\).
Boundary: every ball around \(x\) meets both \(A\) and \(X\setminus A\).
Isolated point: \(a\) is isolated if some open ball around \(a\) contains only \(a\).
Same topology: two metrics define the same topology when they have the same open sets.
Closed: \(A=\overline{A}\), or equivalently \(A\) contains all its sequential limits.
In the discrete metric: every subset is open, and every subset is also closed.
Density
A subset \(D\) is dense in \(X\) when \(\overline{D}=X\). Equivalently, every nonempty open ball in \(X\) intersects \(D\). Density does not mean \(D=X\); it means \(D\) is present at every positive scale.
Worked example
Example: Why is \(\mathbb{Q}\) dense in \(\mathbb{R}\) with the usual distance?
Every open interval \((a-r,a+r)\) contains a rational number. Since open balls in \(\mathbb{R}\) are intervals, every ball meets \(\mathbb{Q}\), so \(\overline{\mathbb{Q}}=\mathbb{R}\).
Try it
Try it: A boundary point of \(A\) has every ball meeting which sets?
Hint: Boundary points cannot be separated locally from either the set or its complement.
Metric convergence is convergence of distances to zero
Learning goal: Use \(d(x_n,x)\to0\) and the Cauchy condition without assuming an order or coordinates.
Key idea
A sequence \(x_n\) converges to \(x\) if \(d(x_n,x)\to0\). It is Cauchy if for every \(\varepsilon>0\), there is \(N\) such that \(d(x_m,x_n)<\varepsilon\) whenever \(m,n\ge N\). Convergence gives a target; Cauchy only says the tail clusters internally.
Sequence tests
Limits are unique: if \(x_n\to x\) and \(x_n\to y\), the triangle inequality gives \(d(x,y)=0\).
Every convergent sequence is Cauchy.
Every subsequence of a convergent sequence converges to the same limit.
A Cauchy sequence need not converge unless the space is complete.
Worked example
Example: Why is \(x_n=1/n\) Cauchy in \((0,1)\) but not convergent in \((0,1)\)?
In the usual metric, \(1/n\to0\) in \(\mathbb{R}\), so the terms eventually become arbitrarily close to each other. But \(0\notin(0,1)\), so the sequence has no limit inside the space \((0,1)\).
Try it
Try it: Every convergent sequence in a metric space is:
Hint: Use \(d(x_m,x_n)\le d(x_m,x)+d(x_n,x)\) once both terms are close to the same limit.
Completeness means Cauchy sequences have their limits inside
Learning goal: Distinguish complete spaces from dense incomplete subspaces, and know the closed-subset rule.
Key idea
A metric space is complete when every Cauchy sequence converges to a point of that same space. The real line with the usual metric is complete. The rationals with the usual metric are not complete because rational Cauchy sequences can converge to irrational real numbers.
Facts to remember
The completion of \(\mathbb{Q}\) with the usual metric is \(\mathbb{R}\).
A finite metric space is complete because Cauchy sequences are eventually constant.
A closed subset of a complete metric space is complete with the inherited metric.
A complete subspace of any metric space is closed in the ambient space.
Completeness is not compactness: complete spaces can be noncompact.
Worked example
Example: Why is \([0,1]\) complete inside \(\mathbb{R}\)?
The real line is complete, and \([0,1]\) is closed in \(\mathbb{R}\). Any Cauchy sequence in \([0,1]\) converges in \(\mathbb{R}\), and closedness keeps the limit in \([0,1]\).
Try it
Try it: If \(X\) is complete and \(A\subseteq X\) is closed with the inherited metric, then \(A\) is:
Hint: A Cauchy sequence in \(A\) converges in \(X\), then closedness puts its limit back in \(A\).
Continuity can be tested by balls, sequences, or open sets
Learning goal: Move between the common metric-space forms of continuity and recognize distance-preserving maps.
Key idea
A map \(f:X\to Y\) is continuous at \(x\) if every small target tolerance can be achieved by taking \(y\) close enough to \(x\). Equivalently in metric spaces, \(x_n\to x\) implies \(f(x_n)\to f(x)\). Globally, \(f\) is continuous exactly when preimages of open sets in \(Y\) are open in \(X\).
Practical tests
\(\varepsilon\)-\(\delta\): control \(d_Y(f(x),f(y))\) from a bound on \(d_X(x,y)\).
Sequential continuity: preserve limits of convergent sequences.
Uniform continuity: sends Cauchy sequences in \(X\) to Cauchy sequences in \(Y\).
Topological: preimages of open sets are open.
Isometry: \(d_Y(f(x),f(y))=d_X(x,y)\), so every isometry is continuous.
Product metric: componentwise estimates often prove continuity on products.
Worked example
Example: Why is every isometry continuous?
If \(f\) is an isometry, then \(d_Y(f(x_n),f(x))=d_X(x_n,x)\). Whenever \(x_n\to x\), the right side tends to \(0\), so \(f(x_n)\to f(x)\).
Try it
Try it: A map between metric spaces is continuous exactly when preimages of open sets are:
Hint: Continuity pulls open neighborhoods in the target back to open neighborhoods in the domain.
In metric spaces, compactness can be read from sequences
Learning goal: Recognize compactness through sequential compactness and through completeness plus total boundedness.
Key idea
A compact metric space has the sequential property that every sequence has a convergent subsequence whose limit lies in the space. Compact metric spaces are always complete and totally bounded. Conversely, a metric space is compact when it is complete and totally bounded.
Facts to remember
Compact metric spaces are closed and bounded when viewed as subsets of another metric space.
Closed and bounded alone is not a universal compactness test in every metric space.
Total boundedness means finite \(\varepsilon\)-nets exist for every \(\varepsilon>0\).
Continuous functions send compact sets to compact sets.
A sequence in a compact metric space always has a convergent subsequence.
Worked example
Example: Why is an infinite set with the discrete metric not compact?
For radius \(1/2\), every ball is a singleton. Covering an infinite discrete space by \(1/2\)-balls would require infinitely many balls, so the space is not totally bounded. Therefore it is not compact.
Try it
Try it: In metric spaces, compactness is equivalent to completeness plus:
Hint: The missing condition says every positive scale has a finite ball cover.
Most mistakes mix up compact, complete, closed, and bounded
Learning goal: Finish with the distinctions that prevent common metric-space errors.
Common traps
Zero distance: if different points can have distance \(0\), the formula is not a metric.
Open versus closed ball: strict \(d<r\) and weak \(d\le r\) inequalities behave differently.
Dense versus equal: a dense subset can still miss many points.
Cauchy versus convergent: Cauchy sequences need completeness to guarantee a limit inside the space.
Complete versus compact: \(\mathbb{R}\) is complete but not compact.
Closed and bounded: compact implies closed and bounded, but the converse is not automatic in every metric space.
Discrete metric: every subset is open and closed, while infinite discrete spaces are not compact.
Worked example
Example: Give a complete metric space that is not compact.
The real line \(\mathbb{R}\) with \(d(x,y)=|x-y|\) is complete: real Cauchy sequences converge to real numbers. It is not compact; for example, the sequence \(1,2,3,\dots\) has no convergent subsequence in \(\mathbb{R}\).
Try it
Try it: Is every complete metric space compact?
Hint: A complete space can fail total boundedness.
Final recap
A metric separates points: \(d(x,y)=0\) iff \(x=y\), and positive rescalings such as \(2d\) are still metrics.
Open balls define openness; isolated points have a small ball containing only that point.
Closed sets contain sequential limits, and metrics with the same open sets define the same topology.
Dense means every nonempty open ball meets the subset.
Convergence means \(d(x_n,x)\to0\); every convergent sequence is Cauchy.
Complete means every Cauchy sequence converges inside the space, and finite metric spaces are complete.
Closed subsets of complete spaces are complete.
Continuity is equivalent to preimages of open sets being open; uniform continuity preserves Cauchy sequences.
Isometries preserve distances and are continuous.
Compact metric spaces are sequentially compact.
Metric compactness is equivalent to completeness plus total boundedness.
Next step: Close this lesson and try the quiz again. Translate each problem into a ball, sequence, Cauchy, continuity, compactness, or total-boundedness statement before answering.