It turns out that metric spaces are not sufficiently general for some applications. This section is a brief introduction to general topology. In making this generalization, the properties of balls in a metric space are stated as axioms for a subset of the power set of a given set. This subset of the power set (set of all subsets) will be known as a basis for a topology. The properties of balls which are of importance are that the intersection of finitely many is the union of balls and that the union of all of them give the whole space. Recall that with a metric space, an open set was just one in which every point was an interior point. This simply meant that every point is contained in a ball which is contained in the given set. All that is being done here is to make these simple properties into axioms.
Definition 21.1.1 Let X be a nonempty set and suppose ℬ ⊆P
1.) Whenever p ∈ A ∩ B for A,B ∈ ℬ, it follows there exists C ∈ ℬ such that p ∈ C ⊆ A ∩ B.
2.) ∪ℬ = X.
Then a subset U, of X is an open set if for every point x ∈ U, there exists B ∈ℬ such that x ∈ B ⊆ U. Thus the open sets are exactly those which can be obtained as a union of sets of ℬ. Denote these subsets of X by the symbol τ and refer to τ as the topology or the set of open sets.
Note that this is simply the analog of saying a set is open exactly when every point is an interior point.
Proposition 21.1.2 Let X be a set and let ℬ be a basis for a topology as defined above and let τ be the set of open sets determined by ℬ. Then
 (21.1) 
 (21.2) 
 (21.3) 
Proof: If p ∈∅ then there exists B ∈ℬ such that p ∈ B ⊆∅ because there are no points in ∅. Therefore, ∅∈ τ. Now if p ∈ X, then by part 2.) of Definition 21.1.1 p ∈ B ⊆ X for some B ∈ℬ and so X ∈ τ.
If C⊆ τ, and if p ∈∪C, then there exists a set, B ∈C such that p ∈ B. However, B is itself a union of sets from ℬ and so there exists C ∈ℬ such that p ∈ C ⊆ B ⊆∪C. This verifies 21.2.
Finally, if A,B ∈ τ and p ∈ A∩B, then since A and B are themselves unions of sets of ℬ, it follows there exists A_{1},B_{1} ∈ℬ such that A_{1} ⊆ A,B_{1} ⊆ B, and p ∈ A_{1} ∩B_{1}. Therefore, by 1.) of Definition 21.1.1 there exists C ∈ℬ such that p ∈ C ⊆ A_{1} ∩B_{1} ⊆ A∩B, showing that A ∩ B ∈ τ as claimed. Of course if A ∩ B = ∅, then A ∩ B ∈ τ. ■
Definition 21.1.3 A set X together with such a collection of its subsets satisfying 21.121.3 is called a topological space. τ is called the topology or set of open sets of X.
Definition 21.1.4 A topological space is said to be Hausdorff if whenever p and q are distinct points of X, there exist disjoint open sets U,V such that p ∈ U,q ∈ V . In other words points can be separated with open sets.
Definition 21.1.5 A subset of a topological space is said to be closed if its complement is open. Let p be a point of X and let E ⊆ X. Then p is said to be a limit point of E if every open set containing p contains a point of E distinct from p.
Note that if the topological space is Hausdorff, then this definition is equivalent to requiring that every open set containing p contains infinitely many points from E. Why?
Proof: Suppose first that E is closed and let x be a limit point of E. Is x ∈ E? If x
Now suppose E contains all its limit points. Is the complement of E open? If x ∈ E^{C}, then x is not a limit point of E because E has all its limit points and so there exists an open set, U containing x such that U contains no point of E other than x. Since x
Proof: If x≠p, there exist open sets U and V such that x ∈ U,p ∈ V and U ∩ V = ∅. Therefore,
Note that the Hausdorff axiom was stronger than needed in order to draw the conclusion of the last theorem. In fact it would have been enough to assume that if x≠y, then there exists an open set containing x which does not intersect y.
Definition 21.1.8 A topological space (X,τ) is said to be regular if whenever C is a closed set and p is a point not in C, there exist disjoint open sets U and V such that p ∈ U,C ⊆ V . Thus a closed set can be separated from a point not in the closed set by two disjoint open sets.
Definition 21.1.9 The topological space, (X,τ) is said to be normal if whenever C and K are disjoint closed sets, there exist disjoint open sets U and V such that C ⊆ U,K ⊆ V . Thus any two disjoint closed sets can be separated with open sets.
Lemma 21.1.11 The above definition is well defined.
Proof: Let C denote all the closed sets which contain E. Then C is nonempty because X ∈C.

an open set which shows that ∩C is a closed set and is the smallest closed set which contains E.
Proof: Let x ∈E and suppose that x
Now E ⊆E so suppose x is a limit point of E. Is x ∈E? If H is a closed set containing E, which does not contain x, then H^{C} is an open set containing x which contains no points of E other than x negating the assumption that x is a limit point of E. ■
The following is the definition of continuity in terms of general topological spaces. It is really just a generalization of the ε  δ definition of continuity given in calculus.
Definition 21.1.13 Let (X,τ) and (Y,η) be two topological spaces and let f : X → Y . f is continuous at x ∈ X if whenever V is an open set of Y containing f(x), there exists an open set U ∈ τ such that x ∈ U and f(U) ⊆ V . f is continuous if f^{−1}(V ) ∈ τ whenever V ∈ η.
You should prove the following.
Proposition 21.1.14 In the situation of Definition 21.1.13 f is continuous if and only if f is continuous at every point of X.
Definition 21.1.15 Let (X_{i},τ_{i}) be topological spaces. ∏ _{i=1}^{n}X_{i} is the Cartesian product. Define a product topology as follows. Let ℬ = ∏ _{i=1}^{n}A_{i} where A_{i} ∈ τ_{i}. Then ℬ is a basis for the product topology.
Theorem 21.1.16 The set ℬ of Definition 21.1.15 is a basis for a topology.
Proof: Suppose x ∈∏ _{i=1}^{n}A_{i}∩∏ _{i=1}^{n}B_{i} where A_{i} and B_{i} are open sets. Say

Then x_{i} ∈ A_{i} ∩ B_{i} for each i. Therefore, x ∈∏ _{i=1}^{n}A_{i} ∩ B_{i} ∈ℬ and ∏ _{i=1}^{n}A_{i} ∩ B_{i} ⊆ ∏ _{i=1}^{n}A_{i}. ■
The definition of compactness is also considered for a general topological space. This is given next.
Definition 21.1.17 A subset, E, of a topological space (X,τ) is said to be compact if whenever C ⊆ τ and E ⊆∪C, there exists a finite subset of C,{U_{1}
In general topological spaces there may be no concept of “bounded”. Even if there is, closed and bounded is not necessarily the same as compactness. However, in any Hausdorff space every compact set must be a closed set.
Proof: Suppose p

and

If K is assumed to be compact, there are finitely many of these sets, U_{x1},
Definition 21.1.19 If every finite subset of a collection of sets has nonempty intersection, the collection has the finite intersection property.
Theorem 21.1.20 Let K be a set whose elements are compact subsets of a Hausdorff topological space,
Proof: Suppose to the contrary that ∅ = ∩K. Then consider

It follows C is an open cover of K_{0} where K_{0} is any particular element of K. But then there are finitely many K ∈K, K_{1},
There is a fundamental theorem for locally compact Hausdorff spaces which is presented next.
Lemma 21.1.21 Let X be a locally compact Hausdorff space and let K ⊆ V ⊆ X where K is compact and V is open. Then there exists an open set U_{k} containing k such that U_{k} is compact and U_{k} ⊆U_{k} ⊆ V. Also there exists U such that U is compact and U ⊆U ⊆ V .
Proof: Since X is locally compact, there exists a basis of open sets whose closures are compact U. Denote by C the set of all U ∈U which contain k and let C^{′} denote the set of all closures of these sets of C intersected with the closed set V ^{C}. Thus C^{′} is a collection of compact sets. There are finitely many of the sets of C^{′} which have empty intersection. If not, then C^{′} has the finite intersection property and so there exists a point p in all of them. Since X is a Hausdorff space, there exist disjoint basic open sets from U, A,B such that k ∈ A and p ∈ B. Therefore, p

Let U_{k} = A_{1} ∩
For the second part, consider all such U_{k}. Since K is compact, there are finitely many which cover K U_{k1},

and each of these is compact so this set works. ■
The following is Urysohn’s lemma for locally compact Hausdorff spaces.
Proof: This involves using Lemma 21.1.21 repeatedly. First use this lemma to obtain V open such that its closure is compact and contained in U. Let D ≡{r_{n}}_{n=1}^{∞} be the rational numbers in (0,1]. Using Lemma 21.1.21, let V _{r1} be an open set such that

Suppose V _{r1},

If r_{k+1} > r_{lk} then letting p = r_{lk}, let V _{rk+1} satisfy

If r_{k+1} ∈ (r_{li},r_{li+1}), let p = r_{li} and let q = r_{li+1}. Then let V _{rk+1} satisfy

If r_{k+1} < r_{l1}, let p = r_{l1} and let V _{rk+1} satisfy

Thus there exist open sets V _{r} for each r ∈ ℚ ∩

Now let

(Recall D = ℚ ∩ (0,1].) I claim f is continuous.

an open set.
Next consider x ∈ f^{−1}

Thus

which is a closed set. If x ∈∩{V _{t} : t > a}, then x ∈∩{V _{t} : t > a} and so f

and so f^{−1}
In any metric space there is a much easier proof of the conclusion of Urysohn’s lemma which applies.
Proof: Consider
Proof: Let δ > 0 be such that for all h ∈ H,dist

This is continuous, equals 1 on H and equals 0 off V because the denominator is always positive since both H,V ^{C} are closed. ■
A useful construction when dealing with locally compact Hausdorff spaces is the notion of the one point compactification of the space.
Definition 21.1.25 Suppose

The complement is taken with respect to
The reason this is called a compactification is contained in the next lemma.
Proof: Since
To see the last claim, suppose U contains ∞ since otherwise there is nothing to show. Notice that if C is a compact set, then X ∖C is an open set. Therefore, if x ∈ U ∖
Lemma 21.1.27 Let (X,τ) be a topological space and let ℬ be a basis for τ. Then K is compact if and only if every open cover of basic open sets admits a finite subcover.
Proof: Suppose first that X is compact. Then if C is an open cover consisting of basic open sets, it follows it admits a finite subcover because these are open sets in C.
Next suppose that every basic open cover admits a finite subcover and let C be an open cover of X. Then define
Actually, there is a profound generalization of this lemma.