Uniform Spaces 1  Nets
Prerequisites: pointset topology, metric spaces.
Introduction
I recently became very interested in topological vector spaces, and this interest led me naturally to the concept of uniform spaces, since every topological vector space is a uniform space. Uniform spaces generalize topological vector spaces, metric spaces, topological groups, compact Hausdorff spaces, and more.
This is the first in a series of seven posts about the theory behind uniform spaces. In the next post, I will go deeper into what exactly a uniform space is and what they are used for, but this first post is focused on the idea of nets. At first, I was going to introduce nets in the context of uniform spaces, but the more I read about nets, the more I realized that they are actually a pretty cool tool for pointset topology. So, in this post, I will go over some of the intuition and basic theorems behind nets in a topological space.
The other posts in this series are:
 Nets
 Introduction to Uniform Spaces
 The Completion of a Uniform Space
 The BolzanoWeierstrass Theorem
 Countably Uniform Spaces
Sequences and Topology
The net a generalization of the sequence. Recall that a sequence is a function $a: \mathbb{N} \rightarrow X$, commonly written $a_n$. To emphasize that some function $a$ is a sequence (or net), we will write it as $a_\bullet$. When something is true of $a_n$ all sufficiently large $n$, we say that it holds eventually for $a_\bullet$.
A sequence $a_\bullet$ in a topological space $X$ is said to converge to a point $x \in X$ if for all open sets $U$ such that $x \in U$, the sequence $a_\bullet$ is eventually in $U$. In other words, if $x \in U$ and $U$ is open, then there exists $N \in \mathbb{N}$ such for all $n \geq N$, $a_n \in U$.
If this definition is new to you, it may be worth considering the more common case where $X$ is a metric space. If $(X, d)$ is a metric space, then $a_\bullet$ converges to $x$ (in the above sense) if and only if for all $\epsilon > 0$, $a_\bullet$ is eventually in the open ball $B_\epsilon(x)$. This leads to the following more common characterization of convergence in metric spaces.
Theorem (Topological Convergence of Sequences in Metric Spaces): A sequence $(a_n)$ in a metric space $(X, d)$ converges to $x \in X$ if and only if for all $\epsilon > 0$, $d(a_\bullet, x) < \epsilon$ eventually.
In fact, convergence of sequences completely defines the topology of a metric space, as shown by the following theorems. These theorems are left as an exercise to the interested reader.
Theorem (Closed Subsets of a Metric Space): Let $(X, d)$ be a metric space. A subset $A \subset X$ is closed if and only if whenever $a_\bullet$ is a sequence in $A$ and converges to $x$, then $x \in A$.
Theorem (Open Subsets of a Metric Space): Let $(X, d)$ be a metric space. A subset $A \subset X$ is open if and only if whenever $x_\bullet$ is a convergent sequence in $X$ and converges to $a \in A$, then $x_\bullet$ is eventually in $A$.
These important theorems are no longer true for general topological spaces. For example, consider $X = [0, 1]^{\mathbb{R}}$ with the product topology, viewed as the set of all realvalued functions on $[0, 1]$. Let $A$ be the set of all functions $f \in X$ such that $f(c) = 0$ for all except countably many $c \in [0, 1]$. $A$ is not closed in $X$. To see this, let $h(c) = 1$ for all $c \in [0,1]$. Clearly, $h \not\in A$. If $A$ were closed, then $X  A$ would be open, and would contain an open neighborhood of $h$. Every open neighborhood of $h$ contains on open neighborhood $U_{c_1 \dots c_k}$ of the form:
However, $U_{c_1 \dots c_k}$ contains $g$ where $g(c_i) = 1$ for all $c_i$, and $g(c) = 0$ for all other $c$. Clearly, $g \in A$. So, every open neighborhood of $h$ intersects with $A$. Thus, $A$ is not closed.
On the other hand, if $f_\bullet$ is a sequence in $A$ and $f_\bullet$ converges to $g \in X$, then $g \in A$. To see this, let $C_n = \{c : f(c) \neq 0\}$. Since $(f_n)$ converges to $g$, $g(c) = 0$ for all $c \not\in \bigcup_n C_n$. Since $\bigcup_n C_n$ is countable, $g$ lies in $A$.
Nets and Topology
To salvage these theorems, we introduce the concept of a net.
What is a Net?
A net is simply a function whose domain is a directed set.
Definition: A directed set $(D, \leq)$ is a set $D$ with a binary relation $\leq$ such that the following conditions hold.

(Transitive) For all $a, b, c \in D$, if $a \leq b$ and $b \leq c$, then $a \leq c$

(Reflexive) For all $a \in D$, $a \leq a$

(Upper Bounds) For all $a, b \in D$, there exists $c \in D$ such that $a \leq c$ and $b \leq c$.

(NonEmpty) $D \neq \varnothing$
Definition: A net in $X$ is a function $a: D \rightarrow X$ where $D$ is a directed set.
When the order is obvious, we often use the set $D$ to represent the directed set $(D, \leq)$. Some people require that a directed set also satisfies the following axiom, making every directed set into a poset.
 (AntiSymmetry) For all $a, b \in D$, if $a \leq b$ and $b \leq a$, then $a = b$.
Realistically, this axiom wouldn't impact the theory of nets at all, since we could replace every nonantisymmetric net with an antisymmetic net by identifying $a \sim b$ if $a \leq b$ and $b \leq a$. In my opinion, this axiom just makes the theory of nets slightly more complicated.
Most importantly, $\mathbb{N}$ is a directed set, so every sequence is also a net. In general, though, nets can be a lot stranger than sequences  nets could be indexed by $\mathbb{R}$, $\mathbb{N}^3$, $\mathcal{P}(\mathbb{R})$, and more.
Convergence of Nets
Similar to sequences, a statement concerning a net $a_\bullet: D \rightarrow X$ is said to hold eventually if there is some $i \in D$ such that for all $j \geq i$, the statement holds for $a_j$. Importantly, if two statements ($T_1$, $T_2$) concerning $a_\bullet$ are both true eventually, then their conjunction ("$T_1$ and $T_2$") is also true eventually. All relevant properties of nets are properties that hold "eventually".
Definition: A net $a_\bullet$ in a topological space $X$ is said to converge to $x \in X$ if for all open sets $U \subset X$ such that $x \in U$, $a_\bullet \in U$ eventually.
Happily, our characterizations of closed and open sets in metric spaces also hold for general topological spaces if sequences are replaced with nets.
Theorem (Closed Subsets of a Topological Space): Let $X$ be a topological space. A subset $A \subset X$ is closed if and only if whenever $a_\bullet$ is a net in $A$ and converges to $x$, then $x \in A$.
Proof: Suppose that $A$ is closed, and let $a_\bullet$ be a net in $A$ which converges to some $x \in X  A$. As $X  A$ is an open set, $a_\bullet \in X  A$ eventually. This is a contradiction. Hence, every time a net in $A$ converges to $x$, we have $x \in A$.
Now suppose that $A$ is some subset of $X$ such that whenever a net in $A$ converges to $y$, $y \in A$. Let $x \in \overline{A}$.
Let $D = \{(U, b) : x \in U \text{ and } b \in A \cap U\}$ where $U$ is open. Define an order on $D$ by: $(U, b) \leq (U', b')$ if and only if $U \subset U'$. Note that if $U$ is open and $x \in U$, then there always exists some $b \in U \cap A$. So, if $(U, b), (U', b') \in D$, then there exists $c \in U \cap U' \cap A$, and $(U \cap U', c)$ is an upper bound on both $(U, b)$ and $(U', b')$. Thus, $D$ is a directed set.
Define the net $a_\bullet: D \rightarrow X$ by: $a_{(U, b)} = b$. We now prove that $a_\bullet$ converges to $x$. Whenever $(U, b) \leq (U', b')$, we have $a_{(U', b')} \in U' \subset U$. So, $a_\bullet$ is eventually in $U$ for any open $U$ containing $x$. Thus, $a_\bullet$ does converge to $x$.
As $x$ is the limit of a net in $A$, we have $x \in A$. Since $x$ was arbitrary, $A$ is closed.
$\square$
Theorem (Open Subsets of a Metric Space): Let $X$ be a topological space. A subset $A \subset X$ is open if and only if whenever $x_\bullet$ is a net in $X$ and converges to $a \in A$, $(x_\bullet)$ is eventually in $A$.
Proof: If $A$ is an open set and $x_\bullet$ converges to $a \in A$, then $x_\bullet$ is eventually in $A$ by the definition of convergence.
Now suppose that $A$ is a set such that whenever $x_\bullet$ is a net which converges to $a \in A$, $x_\bullet$ is eventually in $A$. Thus, whenever $y_\bullet \not\in A$ eventually and $y_\bullet$ converges to $x$, then $x \not\in A$. By the previous theorem, this implies that $X A$ is closed. Thus, $A$ is open.
$\square$
Nets and Hausdorffness
It is common to say that $a$ is "the limit" of a net $x_\bullet$ if $x_\bullet$ converges to $a$. This terminology can be confusing because a given net may have more than one limit. For example, consider $X = \{x, y\}$ with the indiscrete topology. Consider the constant sequence $a_n = x$. Both $x$ and $y$ are limits of $a_\bullet$. This happens because $x$ and $y$ are indistinguishable under the topology of $X$.
As a slightly more complicated example, give $X$ the new topology
Although $x$ and $y$ are now topologically distinguishable, they are still both limits of $a_\bullet$. This is because $x$ and $y$ are not very strongly separated. Thankfully, everything works if the underlying topological space is Hausdorff. And, at the risk of angering some pointset topologists, all important topological spaces are Hausdorff.
Theorem (Unique Limits iff Hausdorff): A topological space $X$ is Hausdorff if and only if whenever $x_\bullet$ is a net, and $x_\bullet$ converges to both $a$ and $b$, then $a = b$.
Proof: Suppose that $X$ is Hausdorff, $x_\bullet$ is a net, and $x_\bullet$ converges to both $a$ and $b$. If $a \neq b$, then let $a \in U$ and $b \in V$ where $U, V$ are disjoint open subsets of $X$. $x_\bullet \in U$ eventually and $x_\bullet \in V$ eventually. Thus, $x_\bullet \in U \cap V$ eventually. This is impossible, so $X$ has unique limits.
Suppose that $X$ has unique limits, but is not Hausdorff. Let $a, b \in X$ such that $a$ and $b$ can not be separated by disjoint neighborhoods. Let
for $U$ and $V$ open sets. Give $D$ the order: $(U, V, q) \leq (U', V', q')$ if and only if $U \subset U'$ and $V \subset V'$. Note that whenever $a \in U$ and $b \in V$, there exists some $q \in U \cap V$. From this observation, it can be seen that $D$ is a directed set.
Define the net $x_\bullet: D \rightarrow X$ by $x_{(U, V, q)} = q$. If $U$ is open and $a \in U$, then $x_\bullet \in U$ eventually. Thus, $x_\bullet$ converges to $a$. Similarly, $x_\bullet$ converges to $b$. This is a contradiction. Thus, $X$ must be Hausdorff.
$\square$
Nets and Continuity
In metric spaces, there is a strong relationship between continuous functions and convergent sequences. This relationship is codified in the following theorem.
Theorem: Let $X$ anad $Y$ be metric spaces, and let $f: X \rightarrow Y$ be any function. $f$ is continuous if and only if whenever a sequence $a_\bullet$ in $X$ converges to $b$, the sequence $f(a_\bullet)$ in $Y$ converges to $f(b)$.
More generally, nets can be used to determine when a function between topological spaces is continuous. This comes in handy, for example, when proving that functions involving the completion of a uniform space are continuous. For now, it serves as another example of how nets generalize intuitive ideas from metric spaces to more general topological spaces.
Theroem (Continuous iff Preserves Limits): Let $X$ and $Y$ be topological spaces, and let $f: X \rightarrow Y$ be any function. $f$ is continuous if and only if whenever a net $a_\bullet$ in $X$ converges to $x$, the net $f(a_\bullet)$ in $Y$ converges to $f(x)$.
Proof: Let $f$ be a continuous function. Let $a_\bullet$ be a net in $X$ which converges to $x \in X$. For all open subsets $V \subset Y$ containing $f(x)$, $f^{1}(V)$ is an open subset of $X$ containing $x$. Thus, $a_\bullet \in f^{1}(V)$ eventually. Hence, $f(a_\bullet) \in V$ eventually. Since $V$ was arbitrary, $f(a_\bullet)$ converges to $f(a)$.
Now, suppose that $f$ preserves the limits of nets. Let $V \subset Y$ be an arbitrary open set. To prove that $f$ is continuous, it suffices to prove that $f^{1}(V)$ is open. Hence, it suffices to prove that for all $x \in X$ and all nets $a_\bullet$ which converge to $x$, eventually $a_\bullet \in f^{1}(V)$. Note that $f(a_\bullet)$ converges to $f(x)$, so eventually $f(a_\bullet) \in V$. Thus, eventually $a_\bullet \in f^{1}(V)$.
$\square$
Nets and Compactness
There is a wellknown characterization of when a metric spaces is compact that relies only upon the topology of the metric space.
Theorem: A metric space $(X, d)$ is compact if and only if every arbitrary sequence in $X$ has a convergent subsequence.
Unfortunately, but ontheme for this post, this theorem does not generalize to all topological spaces. The property that every sequence has a convergent subsequence is called sequential compactness, and every compact space is sequentially compact.
But there exist sequentially compact spaces that are not compact. For example, once again take $X = [0,1]^{\mathbb{R}}$ viewed as the realvalued functions on $[0,1]$, and let $A \subset X$ to be the set of all functions that are zero except on a countable subset of $[0,1]$. Since $X$ is Hausdorff and $A$ is not a closed subset of $X$, $A$ is not compact. Since $X$ is compact, every sequence in $X$ has a convergent subsequence. So, every sequence in $A$ has a subsequence which converges in $X$. Its limit is in $A$. Thus, $A$ is sequentially compact but not compact.
To characterize compactness for all topological space, we need to consider nets instead of sequences. It turns out that a topological space is compact if and only if every net has a convergent subnet. To properly state and prove this theorem, we first have to get acquainted with subnets.
Definition: Given a net $a_\bullet: D \rightarrow X$, a subnet is a net $b_\bullet: E \rightarrow X$ function $f: E \rightarrow D$ such that there exists a function $f: E \rightarrow D$ satisfying:

For all $i \in E$, $b_i = a_{f(i)}$

For all $i, j \in E$, if $i \leq j$, then $f(i) \leq f(j)$.

For all $k \in D$, there exists $i \in E$ such that $d \leq f(a)$.
Every subsequence is actually a subnet in disguise. A subsequence of a sequence $a_\bullet$ is can be described as a sequence $b_\bullet$ for which there exists a strictly increasing function $f: \mathbb{N} \rightarrow \mathbb{N}$ such that $b_n = a_{f(m)}$. This satisfies the definition of a subnet.
However, subnets can be much more general. For one thing, the domain of a net may not be the same (or even contain) the domains of its subnets. But, subnets and their parent nets are related by one very important property: if some statement is true eventually for $a_\bullet$, and $b_\bullet$ is a subnet of $a_\bullet$, then it is also true eventually for $b_\bullet$.
Lemma: If $a_\bullet$ converges to $x$ and $b_\bullet$ is a subnet of $a_\bullet$, then $b_\bullet$ also converges to $x$.
Proof: If $a_\bullet$ converges to $x$, then for all open subset $U$ containing $x$, $a_\bullet \in U$ eventually. Thus, $b_\bullet \in U$ eventually. Thus, $b_\bullet$ converges to $x$.
$\square$
Subnets are a more complicated idea then subsequences, and can be hard to get a handle on at first. Thankfully, there is an easy criterion that tells us when convergent subnets exist.
Definition: A cluster point of a net $a_\bullet: D \rightarrow X$ is a point $x \in X$ such that for all open sets $U$ such that $x \in U$, and all $i \in D$, there exists $j \geq i$ such that $a_j \in U$.
To simplify this definition, say that some statement about a net $a_\bullet$ is true infinitely often if for all $i$, there exists $j \geq i$ such that the statement is true for $a_j$. This (slightly confusing) terminology is borrowed from sequences, and is not the same as being true for infinitely many $a_j$ terms. Using this terminology, $x$ is a cluster point of $a_\bullet$ if and only if for all neighborhoods $U$ of $x$, $a_\bullet \in U$ infinite often. Importantly, if $b_\bullet$ is a subnet of $a_\bullet$ and some statement is true infinitely often for $b_\bullet$, then it is also true infinite often for $a_\bullet$.
Lemma (Cluster Point iff Convergent Subnet): Let $a_\bullet$ be a net in $X$. $x \in X$ is a cluster point of $U$ if and only if there exists a subnet of $a_\bullet$ that converges to $x$.
Proof: Suppose that $b_\bullet$ is a subnet of $a_\bullet$ that converges to $x$. Let $a_\bullet$ be a net in $X$. If $U$ is an open set containing $x$, then $b_\bullet \in U$ eventually. Thus, $b_\bullet \in U$ infinitely often. Thus, $a_\bullet \in U$ infinitely often. Thus, $x$ is a cluster point of $a_\bullet$.
On the other hand, suppose that $x$ is a cluster point of $a_\bullet: D \rightarrow X$. Define $E = \{(U, j) : x\in U, j \in D, a_j \in U\}$ where $U$ is an open neighborhood of $x$. Give $E$ the ordering $(U, j) \leq (U', j')$ if $U' \subset U$. It is straightforward to show that $E$ is a directed set. Define the net $b_\bullet: E \rightarrow X$ by $b_{(U, j)} = a_j$.
It is again straightforward to show that $b_\bullet$ converges to $x$. Also, $b_\bullet$ is a subnet of $a_\bullet$ with the function $f: E \rightarrow D$ defined by $f((U, j)) = j$. Thus, a subnet of $a_\bullet$ converges to $b_\bullet$.
$\square$
Now that we know a little bit about subnets and cluster points, we can successfully characterize compactness in the language of nets.
Theorem (Convergent Subnets iff Compact): Let $X$ be a topological space. $X$ is compact if and only if every net in $X$ has a convergent subnet if and only if every net in $X$ has a cluster point.
Proof: It suffices to prove that $X$ is compact if and only if every net in $X$ has a cluster point.
Let $X$ be a compact topological space. Suppose for contradiction that $a_\bullet$ is a net in $X$ that has no cluster point. Then, for every $x \in X$, there exists an open neighborhood $U$ of $x$ such that $a_\bullet \not\in U$ eventually. Let $\mathcal{C}$ be the collection of all open sets $U$ such that $a_\bullet$ is eventually not in $U$. We have just shown that $\mathcal{C}$ is an open cover of $X$. Since $X$ is compact, $\mathcal{C}$ has a finite subcover $(U_1, U_2 \dots U_k)$. $a_\bullet$ is eventually not in any of these open sets, so $a_\bullet$ is eventually not in $X$. This is absurd. Thus, every net in $X$ must have a cluster point.
Let $X$ be topological space such that every net has a convergent subnet. Suppose for contradiction that $X$ is not compact. Let $\mathcal{C} = (U_\alpha)_{\alpha \in I}$ be an open cover of $X$ with no finite subcover. Let $F$ be the set of all finite subsets of $I$. By assumption, for all $J \in F$, there exists $q \not\in \bigcup_{\alpha \in J} U_\alpha$. Define $D = \{(J, q)\}$ where $J \in F$ and $q \not\in \bigcup_{\alpha \in J} U_\alpha$. Give $D$ the ordering $(A, q) \leq (A', q')$ if $A \subset A'$. It is straightforward to show that $D$. Define the net $a_\bullet: D \rightarrow X$ by $a_{(A, q)} = q$.
The net $a_\bullet$ has a cluster point $x$. Let $\alpha \in I$ such that $x \in U_\alpha$. Eventually, $a_\bullet$ is not in $U_\alpha$. This is a contradiction. Thus, $X$ must be compact.
$\square$
I'll end with a true application of nets to topology: a short proof of Tychonoff's Theorem. This is a true gem of a proof. As Tychonoff's Theorem is actually equivalent to the Axiom of Choice, it is impossible to get around invoking the axiom of choice.
Theorem (Tychonoff's Theorem): [Assuming choice] Let $(X_\alpha)_{\alpha \in I}$ be a collection of compact topological spaces. Then, the product $\prod_{\alpha \in I} X_\alpha$ is also compact.
Proof: Let $X = \prod_{\alpha \in I} X_\alpha$ and let $\pi_\alpha: X \rightarrow X_\alpha$ be the projection onto $X_\alpha$. To prove that $X$ is compact, it suffices to prove that an arbitrary net $x_\bullet: D \rightarrow X$ has a cluster point. For each $\alpha$, choose a cluster point $a_\alpha$ of $\pi_\alpha(x_\bullet)$. Let $a \in X$ such that $\pi_\alpha(a) = a_\alpha$.
To prove that $a$ is a cluster point of $x_\bullet$, it suffices to prove that $x_\bullet \in \pi_\alpha^{1}(W)$ infinitely often for each $\alpha$ and each neighborhood $W$ of $a_\alpha$. This is true because $\pi_\alpha(x_\bullet) \in W$ infinite often.
$\square$
Extensions: A sequential space is precisely a space whose topology is defined by its notion of convergent sequences (such as metric spaces and any firstcountable space). There is also another tool, filters, which can be used instead of nets when studying uniform spaces. I like nets better because nets are more like sequences.