2  Topology of \mathbb{R}^n

Consider the function f : \mathbb{R}^2 \to \mathbb{R} defined by f(x,y) = \frac{xy}{x^2 + y^2}, \qquad (x,y) \neq (0,0). Does f have a limit as (x,y) \to (0,0)? Along the x-axis, f(x,0) = 0. Along the line y = x, f(x,x) = 1/2. The limit does not exist — the function approaches different values along different paths.

Path dependence

This is the first genuinely new phenomenon of multivariable calculus. In one variable, a point has only two sides; approaching it means moving from the left or the right, and a limit requires only that these two agree. In \mathbb{R}^2 a point is surrounded by infinitely many paths, and a limit must be consistent along all of them simultaneously. The epsilon-delta definition handles this perfectly well — it is logically complete — but working with it directly becomes unwieldy fast. The function above is not exotic. It is a rational function. And yet proving that its limit fails requires in principle ruling out infinitely many approach directions, not just two.

This is worth sitting with for a moment, because the difficulty is not just computational. It points to something structural. In one variable the real line has a simple enough geometry that our intuitions about limits are essentially correct and the epsilon-delta definition is mostly a rigorous version of those intuitions. In \mathbb{R}^n the geometry is richer, the intuitions are less reliable, and the epsilon-delta definition — while still correct — no longer organises the subject well on its own. We need a better language.

That language is topology. The idea is to step back from distances entirely and ask: what is the minimal structure on a set that makes it possible to talk about limits and continuity at all? The answer turns out to be a notion of which sets are “open” — and once that is in place, limits, continuity, compactness, and connectedness all follow from it cleanly, without any distances appearing in the definitions.


2.1 Scalar-Valued Functions and Limits

A scalar-valued function of several variables is a map f : U \to \mathbb{R} where U \subset \mathbb{R}^n is some domain. The value f(x_1, \ldots, x_n) is a single real number depending on n real inputs. These are the functions of multivariable calculus: temperature as a function of position in space, the pressure in a fluid as a function of position and time, the distance from a moving point to a fixed curve.

Before differentiating or integrating such functions we need a workable theory of limits and continuity. The natural starting point is the Euclidean distance on \mathbb{R}^n.

Definition 2.1 (Euclidean norm and distance) The Euclidean norm of x = (x_1, \ldots, x_n) \in \mathbb{R}^n is \|x\| = \sqrt{\langle x, x \rangle} = \sqrt{x_1^2 + \cdots + x_n^2}. The distance between x and y is \|x - y\|.

The norm satisfies the triangle inequality \|x + y\| \leq \|x\| + \|y\|, which is the Cauchy–Schwarz inequality in disguise. With this distance, the epsilon-delta definition of a limit carries over from one variable without any change in the words.

Definition 2.2 (Limit) Let f : U \to \mathbb{R} and let a \in \mathbb{R}^n be a point with points of U arbitrarily close to it (not necessarily a \in U itself). We say \lim_{x \to a} f(x) = L if for every \varepsilon > 0 there exists \delta > 0 such that 0 < \|x - a\| < \delta \implies |f(x) - L| < \varepsilon.

The definition is word-for-word the single-variable version, with |x-a| replaced by \|x-a\|. The content is richer: the condition \|x-a\| < \delta describes a ball in \mathbb{R}^n, and the limit must hold uniformly as x approaches a from any direction.

Example. We show \lim_{(x,y)\to(0,0)} \dfrac{x^2 y}{x^2 + y^2} = 0.

Given \varepsilon > 0 we need \delta > 0 such that \|(x,y)\| < \delta implies |x^2 y/(x^2+y^2)| < \varepsilon. The key inequality is x^2 \leq x^2 + y^2, which gives \left|\frac{x^2 y}{x^2 + y^2}\right| \leq |y| \leq \|(x,y)\|. So \delta = \varepsilon works. \square

Example. We show \lim_{(x,y)\to(0,0)} \dfrac{xy}{x^2+y^2} does not exist.

Along the line y = mx, the function evaluates to f(x,mx) = m/(1+m^2), which depends on m. Two different choices of m give two different limiting values, so no single limit L can satisfy the definition. \square

The contrast between these two examples is instructive. Disproving a limit is easy: exhibit two paths with different limits. Proving a limit requires a single uniform bound that controls the function over all paths simultaneously — and finding such a bound typically requires inequalities tailored to the specific function. There is no systematic procedure. This is part of what makes the epsilon-delta approach feel unwieldy in \mathbb{R}^n: it forces us to engage with the geometry of the function directly at each step, when what we really want is a framework where the basic properties of limits are theorems, not case-by-case arguments.

Definition 2.3 (Continuity) f : U \to \mathbb{R} is continuous at a \in U if \lim_{x \to a} f(x) = f(a). It is continuous on U if it is continuous at every point.

Sums, products, and compositions of continuous functions are continuous, by the same arguments as in one variable. Every polynomial in x_1, \ldots, x_n is continuous on \mathbb{R}^n; every rational function is continuous wherever its denominator does not vanish.

The function f(x,y) = xy/(x^2+y^2) cannot be extended continuously to (0,0). There is no value L that makes the limit definition work, so no assignment f(0,0) = L can restore continuity.


2.2 The Trouble with Epsilon-Delta

The epsilon-delta definition is not wrong. But it is a pointwise definition — it says what continuity means at a single point a — and this limits what it can do directly. Consider three questions that arise naturally.

Question 1. Is f(x,y) = \sin(xy)/(1 + x^2 + y^2) continuous on \mathbb{R}^2?

The answer is yes — it is a composition and quotient of continuous functions — but confirming this from the epsilon-delta definition requires tracking estimates through the composition. The argument works but it obscures what is really happening: the function is continuous because it is built from continuous pieces using operations that preserve continuity, not because of any particular bound on |\sin(xy)|.

Question 2. If f : \mathbb{R}^2 \to \mathbb{R} is continuous, is the set \{(x,y) : f(x,y) > 0\} open?

The answer is again yes, but the question itself requires knowing what “open” means — a concept that the epsilon-delta definition does not directly provide. We have been using “ball” as an informal substitute, but a ball is a metric notion. The question is really asking about the structure of the preimage of (0, \infty) under f, and answering it cleanly requires a language for talking about open sets in the domain.

Question 3. Does every continuous function on the closed disk \bar{B}(0,1) attain its maximum?

This is the extreme value theorem in two dimensions. Its proof requires compactness — a property of \bar{B}(0,1) that cannot even be stated, let alone proved, within the epsilon-delta framework alone.

All three questions point to the same gap. Epsilon-delta defines continuity at a point. To study continuity as a global property — to ask which sets are the preimages of open sets, to formulate compactness, to prove that maxima exist — we need a language for talking about the structure of sets, not just distances between points. That language is topology.


2.3 What Topology Keeps

Look carefully at what the epsilon-delta condition 0 < \|x - a\| < \delta \implies |f(x) - f(a)| < \varepsilon actually says. It says: the ball B(a, \delta) = \{x : \|x-a\| < \delta\} maps into the interval (f(a)-\varepsilon,\, f(a)+\varepsilon). An interval is itself a ball in \mathbb{R}. So the condition is: for every ball V around f(a) in the range, the preimage f^{-1}(V) contains a ball around a in the domain.

A set that contains a ball around each of its points is called an open set. (Balls themselves are open, since if y \in B(a,r) then B(y, r - \|y-a\|) \subset B(a,r).) With this language, the continuity condition becomes:

For every open set V containing f(a), the preimage f^{-1}(V) contains an open set containing a.

Now here is the key observation: if this holds for every open V and the preimage of every open set is open, then the condition above is automatically satisfied. Conversely, if the condition holds for every point a and every open V, then the preimage of any open set is open — because we can test openness pointwise. So:

f is continuous in the epsilon-delta sense if and only if the preimage of every open set is open.

This is not yet a theorem — we have been working informally — but it will be proved precisely once we have the definitions in place. The point is that “open set” is the real protagonist of the definition of continuity, and distances are just one way — the Euclidean way — of specifying which sets are open. The same definition of continuity will work in any setting where we have a notion of open set, with no distances required.


2.4 Topological Spaces

A topology on a set X is a specification of which subsets of X are “open,” required to satisfy three axioms that capture the properties open sets have in \mathbb{R}^n.

Definition 2.4 (Topological space) A topology on a set X is a collection \mathscr{T} \subset \mathcal{P}(X) satisfying:

  1. \varnothing \in \mathscr{T} and X \in \mathscr{T}
  2. If \{U_\alpha\}_{\alpha \in A} \subset \mathscr{T} for any index set A, then \bigcup_{\alpha \in A} U_\alpha \in \mathscr{T}
  3. If U_1, \ldots, U_k \in \mathscr{T}, then \bigcap_{i=1}^k U_i \in \mathscr{T}

The pair (X, \mathscr{T}) is a topological space. Elements of \mathscr{T} are called open sets. A subset F \subset X is closed if its complement X \setminus F is open.

In words: arbitrary unions of open sets are open, and finite intersections of open sets are open. The asymmetry between (2) and (3) is not an accident — it is necessary. In \mathbb{R}, each interval (-1/n, 1/n) is open, but \bigcap_{n=1}^\infty \left(-\frac{1}{n}, \frac{1}{n}\right) = \{0\} is not open. An infinite intersection of open sets can collapse to a single point, which contains no ball. So we only require finite intersections to be open. Arbitrary unions are harmless because a union of sets each containing a ball around x still contains a ball around x.

Two remarks on language. First, “closed” does not mean “not open.” A set can be both open and closed — \varnothing and X always are — and a set can be neither, like [0,1) \subset \mathbb{R}. Open and closed are not logical opposites; they are independent conditions on a set’s relationship to the topology. Second, the closed sets are determined entirely by the open sets, since a set is closed iff its complement is open. We could equivalently axiomatise topology in terms of closed sets; the open-set formulation is conventional.

With the definition in hand, we can state what continuity means in full generality.

Definition 2.5 (Continuous map) A map f : X \to Y between topological spaces is continuous if f^{-1}(V) \in \mathscr{T}_X for every V \in \mathscr{T}_Y. That is, preimages of open sets are open.

This is a single, clean condition: no \varepsilon, no \delta, no distances. We now verify it agrees with the definition we started with.

Theorem 2.1 (Equivalences of continuity) For f : U \to \mathbb{R} with U \subset \mathbb{R}^n open, the following are equivalent:

  1. f^{-1}(V) is open in U for every open V \subset \mathbb{R}
  2. For every a \in U and \varepsilon > 0, there exists \delta > 0 with \|x-a\| < \delta \implies |f(x)-f(a)| < \varepsilon
  3. x_k \to a implies f(x_k) \to f(a)

Proof. (i) \Rightarrow (ii): Given a \in U and \varepsilon > 0, the interval (f(a)-\varepsilon, f(a)+\varepsilon) is open in \mathbb{R}, so its preimage f^{-1}((f(a)-\varepsilon, f(a)+\varepsilon)) is open in U by (i). It contains a, so it contains some ball B(a, \delta). That \delta works.

  1. \Rightarrow (iii): Given x_k \to a and \varepsilon > 0, choose \delta from (ii). For all sufficiently large k we have \|x_k - a\| < \delta, so |f(x_k) - f(a)| < \varepsilon.

  2. \Rightarrow (i): Suppose f^{-1}(V) fails to be open for some open V \subset \mathbb{R}. Then there is some a \in f^{-1}(V) such that no ball B(a, 1/k) is contained in f^{-1}(V). Picking a point x_k \in B(a, 1/k) \setminus f^{-1}(V) for each k gives a sequence with x_k \to a but f(x_k) \notin V for all k. Since f(a) \in V and V is open, this contradicts (iii). \square

The topological definition (i) is the cleanest: no quantifiers over \varepsilon and \delta, and it generalises immediately to any topological space. The sequential characterisation (iii) is often the easiest to verify in practice. All three say the same thing.

Before moving on, we record one further structural property. Not all topological spaces behave nicely: in a topology with too few open sets, distinct points cannot be separated, and sequences can converge to more than one limit. We will only ever work with spaces free of this pathology.

Definition 2.6 (Hausdorff space) (X, \mathscr{T}) is Hausdorff if distinct points can be separated by disjoint open sets: for every x \neq y there exist U \ni x and V \ni y with U \cap V = \varnothing.

In a Hausdorff space, limits of sequences are unique. Suppose x_k \to x and x_k \to y with x \neq y. Let U \ni x and V \ni y be disjoint open sets. Both sequences f(x_k) = x_k eventually lie in U, and also eventually lie in V — but U \cap V = \varnothing, a contradiction. Every metric space is Hausdorff: given x \neq y, the balls B(x, r) and B(y, r) with r = d(x,y)/2 are disjoint. So every space we work with is Hausdorff.


2.5 Metric Spaces

The topologies we actually use in analysis come almost exclusively from a distance function.

Definition 2.7 (Metric space) A metric on X is a function d : X \times X \to \mathbb{R} satisfying, for all x, y, z \in X:

  1. d(x,y) \geq 0, with equality if and only if x = y
  2. d(x,y) = d(y,x)
  3. d(x,z) \leq d(x,y) + d(y,z)

The open ball of radius r around x is B(x,r) = \{y : d(x,y) < r\}. Declaring U \subset X open when every point of U is the centre of some open ball contained in U produces the metric topology on X.

One checks that this topology satisfies the axioms: \varnothing and X are open; a union of open sets is open since any point in the union already has a ball around it lying in one of the sets; a finite intersection of open sets is open since the minimum of finitely many positive radii is still positive. The Euclidean norm on \mathbb{R}^n is a metric — the triangle inequality is Cauchy–Schwarz — and the metric topology it induces is the topology we use throughout this course.

The reason to introduce metric spaces separately, rather than just working in \mathbb{R}^n, is that the same ideas apply without change to other natural spaces: the space of continuous functions on [0,1] with the supremum distance, or the space of n \times n matrices with the operator norm. In each case the metric gives a topology, and continuity in that topology is exactly what the metric definition says. The abstract framework handles all these cases at once.

It is also worth noting the following: on \mathbb{R}^n, the Euclidean metric is not the only metric. The \ell^1 metric d_1(x,y) = \sum_i |x_i - y_i| and the \ell^\infty metric d_\infty(x,y) = \max_i |x_i - y_i| both give valid metrics, and they give the same topology as the Euclidean metric — the same open sets, the same continuous functions, the same limits. The topology is what matters; the particular metric that generates it is not. This is why we work topologically: it keeps visible which properties depend only on the open sets and which happen to depend on the specific distance.


2.6 Open and Closed Sets in \mathbb{R}^n

In \mathbb{R}^n a set is open if and only if it is a union of open balls — equivalently, if around every point it contains some ball. It is closed if and only if its complement is open.

Open balls

The following characterisation of closed sets is often more convenient to work with.

Definition 2.8 (Limit point) A point x \in \mathbb{R}^n is a limit point of S \subset \mathbb{R}^n if every ball B(x,r) contains a point of S other than x itself.

Theorem 2.2 (Closed sets and limit points) F \subset \mathbb{R}^n is closed if and only if it contains all its limit points. Equivalently, F is closed if and only if every convergent sequence in F has its limit in F.

Proof. Suppose F is closed and x is a limit point of F with x \notin F. Then x lies in the open set \mathbb{R}^n \setminus F, which contains some B(x,r). But this ball must contain a point of F — contradicting that it is disjoint from F.

Conversely, suppose F contains all its limit points and let x \notin F. Since x is not a limit point, some ball B(x,r) contains no point of F, so B(x,r) \subset \mathbb{R}^n \setminus F. Since x was arbitrary, \mathbb{R}^n \setminus F is open, so F is closed.

For the sequential equivalence: x is a limit point of F if and only if there is a sequence in F \setminus \{x\} converging to x. So “contains all limit points” and “contains all sequential limits of sequences in F” say the same thing. \square

Example. The set S = \{(x,y) : x > 0,\; y \geq 1/x\} is closed. If (x_k, y_k) \in S and (x_k, y_k) \to (a,b), then x_k \to a > 0 and y_k \geq 1/x_k \to 1/a, so b \geq 1/a and (a,b) \in S.

Example. The set \{(x,y) : xy > 1\} is open. For any (a,b) with ab > 1, the function (x,y) \mapsto xy is continuous, so the preimage of the open set (1, \infty) is open — it contains a ball around (a,b) on which xy > 1 still holds.

The second example illustrates the power of the topological definition. We did not need to estimate |xy - ab|; we just recognised the set as the preimage of an open set under a continuous function.

The two examples also illustrate a geometric contrast: every point of \{xy > 1\} is surrounded by a ball that stays entirely inside the set, while every point of S = \{xy \geq 1\} that lies on the curve xy = 1 is surrounded by balls that reach both inside and outside. This distinction — between points that are interior to a set and points that sit on its edge — is captured precisely by the interior, closure, and boundary.

The interior of S, written S^\circ (or \operatorname{int}(S)), is the union of all open sets contained in S: it consists exactly of those x \in S for which some ball B(x,r) lies entirely in S. The closure \bar S (or \operatorname{cl}(S)) is the intersection of all closed sets containing S: by the previous theorem it equals S together with all its limit points, and it is the smallest closed set containing S.

Definition 2.9 (Interior, closure, and boundary) Let S \subset \mathbb{R}^n. The boundary of S is \partial S \;=\; \bar S \setminus S^\circ. A point x belongs to \partial S if and only if every ball B(x,r) contains at least one point of S and at least one point of \mathbb{R}^n \setminus S.

Because \partial S is the intersection of two closed sets — \bar S and \overline{\mathbb{R}^n \setminus S} = \mathbb{R}^n \setminus S^\circ — it is always closed, regardless of whether S itself is open, closed, or neither. The three pieces S^\circ, \partial S, and \mathbb{R}^n \setminus \bar S are pairwise disjoint and together cover \mathbb{R}^n.

This decomposition gives the cleanest way to read off whether a set is open or closed. S is open exactly when \partial S \cap S = \varnothing — it contains no boundary points. S is closed exactly when \partial S \subset S — it contains all its boundary points. A set that contains some but not all of its boundary points — like [0,1) \subset \mathbb{R} — is neither open nor closed.

Notice also that \partial S = \partial(\mathbb{R}^n \setminus S): the complement has the same boundary, since the ball condition is symmetric in S and its complement.

Examples.

  • Open ball: \operatorname{int}(B(0,1)) = B(0,1), \;\overline{B(0,1)} = \bar B(0,1) = \{x : \|x\| \leq 1\}, and \partial B(0,1) = S^{n-1} = \{x : \|x\| = 1\}, the unit sphere.

  • Closed ball: the same boundary S^{n-1}. Open and closed balls share a boundary; they differ in whether they contain it.

  • Half-open interval: [0,1) \subset \mathbb{R} has \operatorname{int}([0,1)) = (0,1), closure [0,1], and \partial[0,1) = \{0,1\} — the same boundary as (0,1) and [0,1].

  • Rationals: \mathbb{Q} \subset \mathbb{R} has empty interior (no interval is entirely rational) and closure \mathbb{R} (every real is a limit of rationals), so \partial \mathbb{Q} = \mathbb{R}.

The rational example is a reminder that boundary is a topological concept, not a geometric one: \mathbb{Q} looks like scattered points, yet its boundary is all of \mathbb{R}.


2.7 Compactness

Why does a continuous function on [a,b] attain its maximum, while one on (a,b) need not? It is not about intervals — the function f(x) = x on (0,1) is continuous and bounded above but has no maximum. The relevant property is compactness.

Definition 2.10 (Compact set) K \subset \mathbb{R}^n is compact if every open cover of K has a finite subcover: whenever \{U_\alpha\} is a collection of open sets with K \subset \bigcup_\alpha U_\alpha, some finite subcollection U_{\alpha_1}, \ldots, U_{\alpha_m} already covers K.

Finite subcover

The open-cover definition is the right one — it is what appears in proofs, it generalises to any topological space, and it makes the argument that “the continuous image of a compact set is compact” completely transparent: an open cover of f(K) pulls back to an open cover of K, which has a finite subcover, and the images of those finitely many sets cover f(K).

In \mathbb{R}^n the open-cover definition has a clean equivalent formulation in terms of sequences: K is compact if and only if every sequence in K has a subsequence converging to a point of K. This equivalence — between open-cover compactness and sequential compactness — is a theorem that belongs properly to a topology course; its proof requires tools (such as second countability of \mathbb{R}^n) that we are not developing here, and we will take it as given. What it gives us is a concrete handle on compactness in \mathbb{R}^n.

Theorem 2.3 (Heine-Borel theorem) K \subset \mathbb{R}^n is compact if and only if it is closed and bounded.

Proof. We use the equivalence of compactness and sequential compactness in \mathbb{R}^n.

Suppose K is closed and bounded. Given any sequence (x_k) in K: since K is bounded, all the x_k lie in some closed box [-M,M]^n. In each coordinate the sequence is bounded, so by the Bolzano–Weierstrass theorem applied n times (once per coordinate), there is a subsequence converging in \mathbb{R}^n. Since K is closed, the limit lies in K. So every sequence in K has a convergent subsequence in K: K is sequentially compact, hence compact.

Conversely, suppose K is compact. If K were unbounded we could find a sequence (x_k) in K with \|x_k\| \to \infty; this has no convergent subsequence, contradicting compactness. If K were not closed, there would be a limit point x \notin K; the sequence of points in K converging to x would have no subsequence converging inside K, again a contradiction. So K is closed and bounded. \square

Examples. The closed ball \bar{B}(0,1) is compact. The open ball B(0,1) is not — it is not closed, and the sequence x_k = (1 - 1/k, 0, \ldots, 0) converges to the boundary point (1, 0, \ldots, 0) \notin B(0,1). All of \mathbb{R}^n is not compact — it is not bounded.

Theorem 2.4 (Extreme value theorem) If f : K \to \mathbb{R} is continuous and K is compact, then f attains its maximum and minimum on K.

Proof. The image f(K) is compact in \mathbb{R}: by Heine-Borel, it is closed and bounded. A bounded subset of \mathbb{R} has a supremum; since f(K) is closed, that supremum belongs to f(K). So there is some x \in K with f(x) = \sup f(K). Likewise for the infimum. \square


2.8 Connectedness and Convexity

Compactness captures the idea that a set is “finite in spirit.” Connectedness captures the idea that it is “in one piece.”

Definition 2.11 (Connected and path-connected) A topological space X is connected if it cannot be written as the union of two disjoint nonempty open sets. It is path-connected if for every x, y \in X there exists a continuous map \gamma : [0,1] \to X with \gamma(0) = x and \gamma(1) = y.

Connectedness

Path-connectedness implies connectedness: if X = U \cup V with U, V disjoint and open, and \gamma : [0,1] \to X is a path, then [0,1] = \gamma^{-1}(U) \cup \gamma^{-1}(V) is a partition of the connected interval [0,1] into two open sets, which forces one of them to be empty.

The continuous image of a connected set is connected. A connected subset of \mathbb{R} is an interval. Together these give the intermediate value theorem in full generality: if f : X \to \mathbb{R} is continuous and X is connected, then f(X) is an interval, so f cannot skip values.

Example. Every open ball B(a,r) \subset \mathbb{R}^n is path-connected: any two points can be joined by a straight line segment lying entirely in the ball (since the ball is convex, which we define next). The punctured plane \mathbb{R}^2 \setminus \{0\} is path-connected — any two points can be joined by a path avoiding the origin — but \mathbb{R} \setminus \{0\} is not connected: it splits into (-\infty, 0) and (0, \infty).

Definition 2.12 (Convex set) C \subset \mathbb{R}^n is convex if for all x, y \in C and all t \in [0,1], the point (1-t)x + ty lies in C.

In other words, C is convex if the straight-line segment between any two of its points stays inside C. Every convex set is path-connected: join any two points by that segment. Balls are convex. Halfspaces \{x : \langle a, x \rangle \leq c\} are convex. The intersection of any family of convex sets is convex.

Convexity will appear throughout the calculus developed in later chapters. On a convex domain, the mean value theorem extends to give useful global estimates, and critical points of differentiable functions are automatically global minima when the function is convex. For now the key point is geometric: a convex set is not just connected, it is connected in the simplest possible way — any two points are joined by a straight line.