# Domains and topology part I: motivating topology

This is going to be a multi-part nearly stream of consciousness series of posts as I try to understand myself the topological character of domain theory and try to figure out intuitive understandable ways to explain it.

To start, what’s point-set, sometimes called general, topology really about? Being evocative, you could say that general topology is the study of all possible shapes: this includes things that we normally think of as shapes like spheres and cubes, toruses and klein bottles, but also just about anything you can conceive of that involves sets of objects. These shapes are studied not by measurements, that’s more the ken of differential geometry, but rather by the ways in which the “points”, the objects, that make up the shape are related to each other by a very general idea of “closeness” that doesn’t even need numbers and measurements.

To this end, we introduce our basic terms. A topological space is a set, which is going to be all the “points” of our shape, along with a collection of subsets that represent what points are related to each other. This collection of subsets, called the topology on the set, are the open sets.

These open sets have a few conditions that they need to follow. First, the entire set needs to be an open set, because at the top level every two points are related by being a part of the shape. Next, if you take the union of any number of open sets you should always have an open set. This makes sense because it’s a kind of transitive property of being related. If A is related to B and B is related to C, then A is related to C. We also insist that we can always take the intersection of any two open sets and get a new open set. Why? Because if there are two ways we can relate two things, A and B, then we can create a more fine grained distinction relating A and B by the overlap between the two open sets. The final condition is that the set with no elements, the empty set, is also an open set. Why? Well, it’s because the set with no elements is the thing that proves no points are related. That sounds slightly silly, but it’s also true. It’s very similar to the way that the disjunction of no clauses should be true.

This has all been a bit abstract, but we can think of the open sets as describing closeness in the following way: the more open sets two points have in common, the “closer” we are to each other. An imperfect analogy might be addressing. We’re all connected at the level that we live on the same planet. If we share the same country as well as the same planet, we’re even closer. If we share not only the same country and planet but the same state/province, we’re closer still. If we share all the way down to the same address, then we’re very close indeed and, in fact, this is as fine grained a distinction as our “address topology” can bring us.

At this point, let’s take this intuition and slightly fuzzy language and turn it into precise mathematics.

A topological space is a set $X$ and a topology $\mathcal O$ on $X$. A topology on $X$ is a collection of subsets $\mathcal O$ of $X$ that have the following properties

1. $X \in \mathcal{O}$
2. $\varnothing \in \mathcal{O}$
3. $\mathcal{O}$ is closed under arbitrary unions
4. $\mathcal{O}$ is closed under finite intersections

Also, let’s try to explain one thing that may not be obvious: how open sets actually describe shape and what distinctions they can make. So you may have heard the joke that a topologist is a person who dunks their coffee cup in their doughnut. The idea is that at this course level of “relatedness” the exact locations of points are meaningless, only their relations. Both a sphere and a cube have the property that you can “go through the center” to connect points on either side by open sets. Indeed, there’s open sets that relate points all over the sphere and cube to each other without having to travel along the surface. The fact that one has corners but the other is round doesn’t affect anything about how points are related to each other in the topology. On the other hand, a torus (doughnut shape) has a hole that limits the ways points on either side of the hole are allowed to be related to each other. No matter how you stretch and pull, you still have that limitation in place.

The other concepts I want to introduce before we start talking about domains in earnest are the separation axioms and the idea of compactness in topology. We’ll start with compactness first.

Compactness is about covers. A cover of a subset $A$ of $X$, our topological space, is a set of open sets whose union contains $X$. In thinking about open sets as “relatedness” we could say that a cover over a subset $A$ of $X$ are a collection of related points that includes at least every point in $A$. So for our example of the addressing topology, then a cover of all the united states would be all the postal codes.

A subset $A$ of $X$ is called compact when every cover of $A$ has a finite subcover, that is you can choose only a finite number of open sets from the cover and still cover $A$. Now this doesn’t say “there exists a finite cover over $A$” because that’s actually a trivial property since $X$ itself is an open set that covers any subset. No, compactness actually means something a little more interesting: if we think of each open set in the cover as a “distinction” that relates some points to each other, then compactness means that no matter how you’re breaking apart $A$ into a set of distinctions you actually only need a finite number of those distinctions to explain the entire set $A$. Finite sets are trivially compact, even as subsets of an infinite space, by the following algorithm:

1. Choose any point $x \in A$, then choose an open set from the cover of $A$ that includes $x$.
2. Choose a point that hasn’t been chosen yet, and choose an open set that includes it and add it to the finite cover. If there aren’t any unchosen points in $A$ then stop, otherwise repeat step 2.

This doesn’t choose any kind of minimal finite cover, but it’s finite nonetheless since we have at most a number of open sets equal to the number of points in $A$.

That’s still a bit abstract, so let’s try another analogy: look around you at any object, say the device you’re reading this post on. This device has a finite shape and size. It has a definite dimensions of height and width and depth. An open cover would be literally picking (borderless) regions in space that overlap to include the entire object. We can choose a finite subcover with the following pseudo-algorithm:

1. start by picking the largest region in the open cover
2. pick the largest cover that overlaps with the remaining space, if the whole region is covered then stop, otherwise repeat step 2

Now, it might feel like this algorithm should terminate but you might have some anxiety over the possibility of a Zeno-like situation where you manage to only cover a small enough fraction in each step that it takes an infinite number of regions to cover the entire space. This is guaranteed to not happen by a property described in the Heine-Borel theorem.

A rough intuition for how Heine-Borel saves us is that the fact that your object in question has edges is actually what keeps this infinite regress from happening. Since you need to reach the edge, not just get arbitrarily close to it, there must be some neighborhood that crosses the gap and actually touches it. That’s what keeps this situation from being like Zeno’s paradox in which you never quite get there at any finite step.

This post has gotten a little long, so next time we’ll get back to separation axioms and then the scott topology.