MATH-447 · Lesson 2 of 12 · 27 min
Topological spaces, bases and subspaces
Lesson 1 observed that continuity in metric spaces depends only on which sets are open, and that the open sets of a metric space obey three simple rules. This lesson turns those rules into a definition. A topological space is a set together with a chosen family of subsets, called open, satisfying the rules. Everything else in the course, from continuity to the fundamental group, is built on this one definition, so it is worth meeting a wide range of examples, including some that behave very differently from the familiar spaces of analysis.
The definition
Definition. A topology on a set \(X\) is a collection \(\mathcal{T}\) of subsets of \(X\) such that (1) \(\varnothing\) and \(X\) belong to \(\mathcal{T}\); (2) the union of any family of members of \(\mathcal{T}\) belongs to \(\mathcal{T}\); and (3) the intersection of any two, and hence of any finite number, of members of \(\mathcal{T}\) belongs to \(\mathcal{T}\). The pair \((X, \mathcal{T})\) is a topological space, and the members of \(\mathcal{T}\) are its open sets. A subset is closed if its complement is open.
The asymmetry between unions and intersections is essential. In the real line the intervals \((-1/n, 1/n)\) are open for every \(n\), but their intersection is \(\{0\}\), which is not open. Arbitrary intersections of open sets need not be open, and arbitrary unions of closed sets need not be closed. By De Morgan's laws the closed sets satisfy the mirror-image rules: \(\varnothing\) and \(X\) are closed, arbitrary intersections of closed sets are closed, and finite unions of closed sets are closed. A set can be both open and closed, like \(\varnothing\) and \(X\) in every space, or neither, like \([0, 1)\) in the real line.
A gallery of examples
Metric topologies. Every metric space \((X, d)\) is a topological space whose open sets are the unions of open balls. The real line with this topology is called the standard topology, and \(\mathbb{R}^n\) is given the topology of the Euclidean metric unless something else is said. A topological space is metrizable if its topology comes from some metric in this way.
The discrete and indiscrete topologies. At one extreme, every subset of \(X\) is declared open; this is the discrete topology, and it is the topology of the metric \(d(x, y) = 1\) for \(x \ne y\). At the other extreme, only \(\varnothing\) and \(X\) are open; this is the indiscrete or trivial topology. If \(X\) has at least two points, the indiscrete topology is not metrizable, because in a metric space a ball of radius \(d(x, y)\) about \(x\) is an open set containing \(x\) but not \(y\).
The cofinite topology. On any set \(X\), declare a set open if it is empty or its complement is finite. Checking the axioms: the complement of a union is the intersection of the complements, which is finite if any one of them is; and the complement of a finite intersection is a finite union of finite sets. On an infinite set any two nonempty open sets meet, since each misses only finitely many points. This topology appears in algebraic geometry: on the complex line, the closed sets of the Zariski topology are exactly the zero sets of polynomials, which are the finite sets and the whole line.
Sierpiński space. Let \(X = \{0, 1\}\) with open sets \(\varnothing, \{1\}, X\). This tiny space is neither discrete nor indiscrete. The point 1 is open but not closed; the point 0 is closed but not open. Sierpiński space is useful in computer science, where the open point models a computation that has halted and an observation that can be confirmed in finite time.
The lower limit line. On the real line, declare a set \(U\) open if for every \(x \in U\) there is \(\varepsilon > 0\) with \([x, x + \varepsilon) \subseteq U\). This topology, often called the Sorgenfrey line \(\mathbb{R}_\ell\) after Robert Sorgenfrey who studied it in 1947, has every standard open set open, since an open interval about \(x\) contains a half-open interval starting at \(x\), but also new open sets such as \([0, 1)\). It is a source of counterexamples in lessons 4, 5 and 8.
Comparing topologies
If \(\mathcal{T} \subseteq \mathcal{T}'\) are two topologies on the same set, \(\mathcal{T}'\) is called finer and \(\mathcal{T}\) coarser. The discrete topology is the finest of all and the indiscrete the coarsest. On the real line the cofinite topology is coarser than the standard topology, which is coarser than the lower limit topology. Two topologies need not be comparable: on \(\{a, b\}\) the topologies \(\{\varnothing, \{a\}, X\}\) and \(\{\varnothing, \{b\}, X\}\) are both finer than the indiscrete and coarser than the discrete topology, but neither contains the other.
A finer topology has more open sets, so it is easier for a function out of it to be continuous and harder for a sequence in it to converge. Choosing a topology is a balance: fine enough to separate the points we care about, coarse enough that useful sets are compact and useful sequences converge. That tension runs through lessons 5, 7 and 8.
Interior, closure and boundary
For a subset \(A\) of a space \(X\), the interior \(\operatorname{int} A\) is the union of all open sets contained in \(A\), the largest open subset of \(A\). The closure \(\overline{A}\) is the intersection of all closed sets containing \(A\), the smallest closed superset of \(A\). The boundary is \(\partial A = \overline{A} \setminus \operatorname{int} A\). A set \(A\) is dense if \(\overline{A} = X\). A neighborhood of a point \(x\) is any set containing an open set that contains \(x\).
Theorem. A point \(x\) lies in \(\overline{A}\) if and only if every open set containing \(x\) meets \(A\).
Proof. Suppose some open \(U\) contains \(x\) and misses \(A\). Then \(X \setminus U\) is a closed set containing \(A\), so \(\overline{A} \subseteq X \setminus U\), and \(x \notin \overline{A}\). Conversely, suppose \(x \notin \overline{A}\). Then some closed set \(C \supseteq A\) does not contain \(x\), and \(U = X \setminus C\) is an open set containing \(x\) and missing \(A\). Both directions are contrapositives of the statement.
A point \(x\) is a limit point of \(A\) if every open set containing \(x\) meets \(A\) in a point other than \(x\). Then \(\overline{A} = A \cup A'\), where \(A'\) is the set of limit points. In the standard real line, \(\overline{\mathbb{Q}} = \mathbb{R}\), so the rationals are dense; \(\overline{(0, 1)} = [0, 1]\) and \(\partial (0, 1) = \{0, 1\}\). In the cofinite topology on an infinite set, every infinite subset is dense, because the only closed set containing it is the whole space. In the lower limit line, the closure of \((0, 1)\) is \([0, 1)\): the point 1 is not in the closure because \([1, 2)\) is an open set about 1 missing \((0, 1)\).
Example: closures in Sierpiński space. In \(\{0, 1\}\) with open sets \(\varnothing, \{1\}, X\), the closed sets are \(X, \{0\}, \varnothing\). So \(\overline{\{1\}} = X\), the open point is dense, while \(\overline{\{0\}} = \{0\}\). The interior of \(\{0\}\) is empty. The boundary of \(\{1\}\) is \(X \setminus \{1\} = \{0\}\).
Sequences are not enough
In a topological space a sequence \((x_n)\) converges to \(x\) if every open set containing \(x\) contains \(x_n\) for all large \(n\). In metric spaces limits are unique and closures can be described by sequences: \(x \in \overline{A}\) exactly when some sequence in \(A\) converges to \(x\). Neither fact survives in general. In the indiscrete topology the only open set containing any point is \(X\), so every sequence converges to every point. In the cofinite topology on an infinite set, a sequence of distinct points converges to every point, because any open set misses only finitely many terms.
There are also spaces where a point lies in the closure of a set without being the limit of any sequence from it. A standard example uses the cocountable topology on an uncountable set, in which the open sets are the empty set and the sets with countable complement: a sequence converges there only if it is eventually constant, so the closure of an uncountable proper subset is the whole space although no sequence from it converges to an outside point. Lesson 5 explains that the trouble disappears in first countable spaces, those in which every point has a countable family of open sets that shrink down to it, as the balls of radius \(1/n\) do in a metric space. In general topology, sequences must be replaced by more general objects called nets or filters, which lesson 8 mentions in connection with Tychonoff's theorem.
Bases
Describing a topology by listing all its open sets is rarely practical. For metric spaces we describe the balls and then take unions. The same idea works in general.
Definition. A basis for a topology on \(X\) is a collection \(\mathcal{B}\) of subsets of \(X\), called basis elements, such that (B1) every point of \(X\) lies in at least one basis element, and (B2) if \(x \in B_1 \cap B_2\) for basis elements \(B_1, B_2\), there is a basis element \(B_3\) with \(x \in B_3 \subseteq B_1 \cap B_2\). The topology generated by \(\mathcal{B}\) consists of all sets \(U\) such that for each \(x \in U\) there is \(B \in \mathcal{B}\) with \(x \in B \subseteq U\).
Theorem. The collection generated by a basis is a topology, and it consists exactly of the unions of basis elements.
Proof. The empty set satisfies the condition vacuously, and \(X\) satisfies it by (B1). If each \(U_\alpha\) satisfies the condition and \(x \in \bigcup U_\alpha\), then \(x \in U_\beta\) for some \(\beta\), and a basis element containing \(x\) inside \(U_\beta\) also lies inside the union. For intersections, let \(U_1, U_2\) satisfy the condition and \(x \in U_1 \cap U_2\). Choose basis elements \(x \in B_1 \subseteq U_1\) and \(x \in B_2 \subseteq U_2\), and then by (B2) a basis element \(x \in B_3 \subseteq B_1 \cap B_2 \subseteq U_1 \cap U_2\). Finite intersections follow by induction. Finally, a union of basis elements satisfies the condition, since each point lies in one of them; and a set \(U\) satisfying the condition is the union, over its points \(x\), of the basis elements chosen for \(x\).
The open balls of a metric space form a basis: if \(x \in B(a, r) \cap B(b, s)\), then the ball about \(x\) of radius \(\min(r - d(a, x), s - d(b, x))\) lies in both, by the triangle inequality. On the real line the open intervals with rational endpoints also form a basis for the standard topology, and since there are only countably many such intervals, the real line is second countable: it has a countable basis. The half-open intervals \([a, b)\) form a basis for the lower limit topology. The one-point sets form a basis for the discrete topology.
Lemma (comparing bases). Let \(\mathcal{B}\) and \(\mathcal{B}'\) be bases for topologies \(\mathcal{T}\) and \(\mathcal{T}'\) on \(X\). Then \(\mathcal{T}'\) is finer than \(\mathcal{T}\) if and only if for each \(x\) and each \(B \in \mathcal{B}\) containing \(x\), there is \(B' \in \mathcal{B}'\) with \(x \in B' \subseteq B\). This is the precise form of lesson 1's argument with nested discs, diamonds and squares, and it shows at once that the open squares and the open discs generate the same topology on the plane.
A subbasis is a collection of sets whose union is \(X\); the finite intersections of subbasis elements then form a basis. On the real line the rays \((-\infty, a)\) and \((b, \infty)\) form a subbasis for the standard topology, since their pairwise intersections are the open intervals. Subbases are the natural way to describe topologies that should make a given family of functions continuous, such as the product topology in lesson 4.
Subspaces
Definition. If \(Y\) is a subset of a topological space \(X\), the subspace topology on \(Y\) consists of all sets \(U \cap Y\) with \(U\) open in \(X\). It is a topology because intersecting with \(Y\) commutes with unions and finite intersections: \(\bigcup (U_\alpha \cap Y) = (\bigcup U_\alpha) \cap Y\) and \((U_1 \cap Y) \cap (U_2 \cap Y) = (U_1 \cap U_2) \cap Y\). If \(\mathcal{B}\) is a basis for \(X\), the sets \(B \cap Y\) form a basis for \(Y\).
Open in \(Y\) does not mean open in \(X\). In the subspace \(Y = [0, 1]\) of the real line, the set \([0, 1/2) = (-1, 1/2) \cap Y\) is open in \(Y\), though not open in \(\mathbb{R}\). Similarly, the closed sets of \(Y\) are exactly the sets \(C \cap Y\) with \(C\) closed in \(X\), and \((0, 1]\) is closed in the subspace \((0, 2)\) although not closed in \(\mathbb{R}\). If \(Y\) is itself open in \(X\), then a set open in \(Y\) is open in \(X\), since it is the intersection of two open sets; similarly for closed subspaces and closed sets.
The subspace topology on a subset of a metric space is the topology of the restricted metric, because a ball of \(Y\) is a ball of \(X\) intersected with \(Y\). So spheres, curves and surfaces in \(\mathbb{R}^n\) all receive their topology this way. The integers \(\mathbb{Z}\) as a subspace of the real line receive the discrete topology, since \(\{n\} = (n - 1/2, n + 1/2) \cap \mathbb{Z}\). The set \(\{1/n : n \ge 1\}\) is also discrete as a subspace, but \(\{0\} \cup \{1/n\}\) is not, since every open set containing 0 contains infinitely many of the points \(1/n\).
Finite spaces by computer
Finite topological spaces are a good laboratory: everything can be checked exhaustively. The program enumerates all topologies on sets of up to four points, counts them up to relabeling, and computes interiors and closures in a sample space. The numbers 1, 4, 29, 355 of topologies on 1, 2, 3, 4 labeled points are classical; there is no known closed formula for them.
from itertools import combinations, permutations
def subsets(n):
return [frozenset(c) for k in range(n + 1) for c in combinations(range(n), k)]
def is_topology(T, n):
full = frozenset(range(n))
if frozenset() not in T or full not in T:
return False
for A in T:
for B in T:
if A | B not in T or A & B not in T:
return False
return True # for a finite family, pairwise unions suffice
def all_topologies(n):
middle = [s for s in subsets(n) if 0 < len(s) < n]
found = []
for mask in range(1 << len(middle)):
T = {frozenset(), frozenset(range(n))}
T |= {middle[i] for i in range(len(middle)) if mask >> i & 1}
if is_topology(T, n):
found.append(frozenset(T))
return found
def up_to_relabelling(tops, n):
seen = set()
for T in tops:
key = min(tuple(sorted(tuple(sorted(p[i] for i in U)) for U in T)) for p in permutations(range(n)))
seen.add(key)
return len(seen)
for n in range(1, 5):
tops = all_topologies(n)
print(n, "points:", len(tops), "topologies,", up_to_relabelling(tops, n), "up to relabelling")
# a sample space on {0, 1, 2, 3}
T = [frozenset(s) for s in [(), (0,), (0, 1), (2,), (0, 2), (0, 1, 2), (0, 1, 2, 3)]]
X = frozenset(range(4))
print("is a topology:", is_topology(set(T), 4))
def interior(A):
return frozenset().union(*[U for U in T if U <= A])
def closure(A):
closed = [X - U for U in T]
return frozenset(X).intersection(*[C for C in closed if A <= C])
for A in [frozenset({1}), frozenset({0}), frozenset({1, 2})]:
print("A =", sorted(A), "interior", sorted(interior(A)), "closure", sorted(closure(A)),
"boundary", sorted(closure(A) - interior(A)))1 points: 1 topologies, 1 up to relabeling 2 points: 4 topologies, 3 up to relabeling 3 points: 29 topologies, 9 up to relabeling 4 points: 355 topologies, 33 up to relabeling is a topology: True A = [1] interior [] closure [1, 3] boundary [1, 3] A = [0] interior [0] closure [0, 1, 3] boundary [1, 3] A = [1, 2] interior [2] closure [1, 2, 3] boundary [1, 3]
The counts 1, 3, 9, 33 up to relabeling grow much more slowly than the labeled counts but still fast; for 18 points the labeled count runs past \(10^{37}\). In the sample space the closed sets are the complements of the seven open sets. The point 3 lies in no open set except the whole space, so it belongs to the closure of every nonempty set; the point 1 lies only in open sets that also contain 0, so the closure of \(\{0\}\) picks up both 1 and 3. The set \(\{1\}\) has empty interior and closure \(\{1, 3\}\), so here the boundary is the whole closure. The set \(\{1, 2\}\) contains the open point 2, so its interior is \(\{2\}\).
Worked problem
Checking a basis and describing its topology
Show that the open rectangles \((a, b) \times (c, d)\) form a basis for a topology on \(\mathbb{R}^2\), and that it is the standard topology.
Show solution
- (B1): every point \((x, y)\) lies in \((x - 1, x + 1) \times (y - 1, y + 1)\).
- (B2): the intersection of two open rectangles is \((\max(a, a'), \min(b, b')) \times (\max(c, c'), \min(d, d'))\), which is again an open rectangle or empty, so take \(B_3\) to be the intersection itself.
- Every open disc about a point contains an open square about it, of side \(r\sqrt{2}\) for a disc of radius \(r\).
- Every open rectangle containing a point contains a small open disc about it, of radius the distance to the nearest side.
- By the lemma on comparing bases, each topology is finer than the other.
Answer: The open rectangles form a basis, and they generate exactly the Euclidean topology on the plane.
Common mistakes
MistakeRequiring arbitrary intersections of open sets to be open.
InsteadOnly finite intersections; the intersection of \((-1/n, 1/n)\) over all \(n\) is \(\{0\}\).
MistakeThinking closed means not open.
InsteadSets can be both, like \(\varnothing\) and \(X\), or neither, like \([0, 1)\) in the real line.
MistakeAssuming limits of sequences are unique in every space.
InsteadIn the indiscrete and cofinite topologies a sequence can converge to many points; uniqueness needs the Hausdorff property of lesson 5.
MistakeCalling \([0, 1/2)\) open without saying in which space.
InsteadIt is open in the subspace \([0, 1]\) but not in \(\mathbb{R}\); always name the ambient space.
MistakeTaking any family of sets as a basis.
InsteadCheck (B2): the family of all open intervals of length exactly 1 covers the line but fails (B2), since two of them can meet in a short interval containing no member.
Summary and key terms
- A topology is a family of subsets containing the empty set and the whole space, closed under arbitrary unions and finite intersections.
- Examples include metric, discrete, indiscrete, cofinite, Sierpiński and lower limit topologies.
- The closure of a set is the smallest closed superset; a point is in it exactly when every open set around the point meets the set.
- A basis generates a topology whose open sets are the unions of basis elements; nested bases compare topologies.
- A subspace receives the open sets of the ambient space intersected with it; open in a subspace need not mean open in the space.
- Sequences do not determine closures or have unique limits in general spaces.
- topology
- A family of open sets satisfying the three axioms.
- finer topology
- A topology containing another one, so having more open sets.
- closure
- The intersection of all closed sets containing a given set.
- dense set
- A set whose closure is the whole space.
- basis
- A family of sets satisfying (B1) and (B2), whose unions are the open sets of the topology it generates.
- subspace topology
- The topology on a subset made of the intersections of the subset with open sets of the space.
- second countable
- Having a countable basis.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Is \(\{\varnothing, \{a\}, \{b\}, \{a, b, c\}\}\) a topology on \(\{a, b, c\}\)?
Show answer
No: the union \(\{a, b\}\) is missing.
Find the closure of \(\mathbb{Z}\) in the cofinite topology on \(\mathbb{R}\).
Show answer
All of \(\mathbb{R}\): the only closed sets are finite sets and \(\mathbb{R}\), and \(\mathbb{Z}\) is infinite.
Show that in the lower limit line the set \([a, b)\) is both open and closed.
Show answer
It is a basis element, so open. Its complement \((-\infty, a) \cup [b, \infty)\) is a union of basis elements \([a - n, a)\) and \([b, b + n)\), so open as well.
In the subspace \(Y = [0, 1] \cup (2, 3)\) of the real line, is \([0, 1]\) open in \(Y\)? Closed?
Show answer
Both: \([0, 1] = (-1, 3/2) \cap Y\) is open, and \([0, 1] = [0, 1] \cap Y\) is closed, as is \((2, 3) = [2, 3] \cap Y\).
Prove that \(\overline{A \cup B} = \overline{A} \cup \overline{B}\).
Show answer
The right side is closed and contains \(A \cup B\), so contains the left side. Conversely \(\overline{A} \subseteq \overline{A \cup B}\) since the latter is a closed superset of \(A\), and likewise for \(B\).
Give a subbasis for the discrete topology on \(\mathbb{Z}\) consisting of infinite sets.
Show answer
Take all rays \(\{n, n + 1, \ldots\}\) and \(\{\ldots, n - 1, n\}\). They are infinite, they cover \(\mathbb{Z}\), and the intersection of the two rays ending at \(n\) is \(\{n\}\), so the generated topology contains every one-point set.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.