One of the things that topologists like to say is that a topological set is just a set with some structure. That structure is, basically, the nearness relation - a relation that allows us to talk about what points are *near* other points.

So to talk about topology, you need to be able to talk about nearness. The way that we do that in topology is through a fundamental concept called an *open sphere*. An open sphere defines the set of all points that are *close to* a particular point according to some metric. That's not the only way of defining it; there are various other ways of explaining it, but I find the idea of using a metric to be the easiest one to understand.

Of course, there's a catch. (There's always a catch, isn't there?) The catch is, we need to define just what we mean by "according to some metric".Fundamentally, we need to understand just what we mean by *distance*. Remember - we're starting with a completely pure set of points. Any structure like a plane, or a sphere, or anything like that will be defined in term of our open spheres - which, in turn, will be defined by the distance metric. So we can't use any of that to define distance.

## Defining Distance

So. Suppose we've got a totally arbitrary set of points, \(S\), consisting of elements \(s_1, s_2, s_3, s_4, ..., s_n, ...\). What's the *distance* between \(s_i\) and \(s_j\)?

Let's start by thinking about a simple number line with the set of real numbers. What's the distance between two numbers on the number line? It's a measure of *how far* over the number line you have to go to get from one point to the other. But that's cheating: *how far you have to go* is really just a re-arrangement of the words; it's defining distance in terms of distance.

But now, suppose that you've got your real number line, and you've got a ruler. Then you can measure distances over the number line. The ruler defines what distances are. It's something *in addition to* the set of pointsthat allows you to define distance.

So what we really want to do is to define an abstract ruler. In pure mathematical terms, that ruler is just a function that takes two elements, \(s_i\) and \(s_j\), and returns a real number. That real number is the distance between those two points.

To be a metric, a distance function \(d\) needs to have four fundamental properties:

- Non-Negativity
- \(forall s_i, s_j in S: d(s_i, s_j) geq 0\): distance is never negative.
- Identity
- \(forall s_i, s_j in S: d(s_i, s_j) = 0 iff i=j\); that is, the distance from a point to itself is 0; and no two distinct points are seperated by a 0 distance.
- Symmetry
- \(forall s_i, s_j in S: d(s_i, s_j) = d(s_j, s_i)\). It doesn't matter which way you measure: the distance between two points is always the same.
- Triangle Inequality
- \(forall s_i, s_j, s_k in S: d(s_i, s_j) + d(s_j, s_k) geq d(s_i, s_k)\).

A *metric space* is a pair \((S, d)\) of a set, and a metric over the set.

For example:

- The real numbers are a metric space with the ruler-metric function. You can easily verify that properties of a metric function all work with the ruler-metric. In fact, they are are all things that you can easily check with a ruler and a number-line, to see that they work. The function that you're creating with the ruler is: \(d(x,y) = |x-y|\) (the absolute value of \(x - y\)). So the ruler-metric distance from 1 to 3 is 2.
- A cartesian plane is a metric space whose distance function is the euclidean distance: \(d((a_x,ay_), (b_x,b_y)) = ((a_x-b_x)^2 + (a_y-b_y)^2 )^{frac{1}{2}}\). In fact, for every \(n\), the euclidean n-space is a metric space using the euclidean distance.
- A checkerboard is a metric space if you use the number of kings moves as the distance function.
- The Manhattan street grid is a metric space where the distance function between two intersections is the sum of the number of horizontal blocks and the number of vertical blocks between them.

With that, we can define the open spheres.

## Open and Closed Sets

You can start moving from metric spaces to topological spaces by looking at *open sets*. Take a metric space, \((S,d)\), and a point \(p in S\). An open sphere \(B(p,r)\) (a ball of radius r around point p) in \(S\) is the set of points \(x\) such that \(d(p,x) < r\).

Now, think of a subset \(T subseteq S\). A point \(p in S\) is in the interior of \(T\) if/f there is some point \(r\) where \(B(p,r) in T\). \(T\) is an open subset of \(S\) if every element of \(T\) is in its interior. A subset of space formed by an open ball is always an open subset. An open subset of a metric space \(S\) is also called an open space in \(S\).

Here's where we can start to do some interesting things, that foreshadow what we'll do with topological spaces. If you have two open spaces \(T\) and \(U\) in a metric space \(S\), then \(T cup U\) is an open space in \(S\). So if you have open spaces, you can glue them together to form other open spaces.

In fact, in a metric space \(S\), every open space is the union of a collection of open spheres in \(S\).

In addition to the simple gluing, we can also prove that every intersection of two open subsets is open. In fact, the intersection of any finite set of open subsets form an open subset. So we can assemble open spaces with all sorts of bizarre shapes by gluing together collections of open balls, and then taking intersections between the shapes we've built.

So now, think about a subspace \(T\) of a metric space \(S\). We can say that a point \(p\) is *adherent to* \(T\) if \(forall r > 0; B(p, r) cap T neq emptyset\). The closure of \(T\), written \(overline{T}\) is the set of all points adherent to \(T\).

A subset \(T\) of \(S\) is called a *closed* subset if and only if \(T=overline{T}\). Intuitively, \(T\) is closed if it contains the surface that forms its boundary. So in 3-space, a solid sphere is a closed space. The contents of the sphere (think of the shape formed by the air in a spherical balloon) is not a closed space; it's bounded by a surface, but that surface is not part of the space.