\chapter{Topology}


\section{Topological spaces}

We'll now use our theory of metric spaces to understand how the set algebra laws for a topology were derived.


The motivation of topology was to study some abstraction of spaces on which the notion of continuous functions could be defined, even if a metric could not. In our study fo metric spaces, we found that open sets could be used to define a continuous function (indeed we found that open sets were sufficient to explain many concepts without a metric). This is the inspiration of synthetically defining spaces by a \emph{topology} (a set of all the open sets), rather than by an explicit metric.

If the idea of a topology is to be a set of all open sets, then we can definitely form a definition for a metric's topology.

\begin{definition}[Topology of a metric space]
Let $(X,d)$ be a metric space, \emph{the topology of $X$ generated by $d$} is the set $\mathcal{T}(d)$ of all the open sets of $(X,d)$.
When the metric is clear $\mathcal{T}(d)$ may just be called the \emph{topology of $X$}
\end{definition}

Originally, mathematicians desired to restrict the definition of a general topology to behave as close as possible to a metric's topology. They studied the open sets of metric topologies to find what conditions a general topology should obey to be as similar as possible to metric topologies.

In this pursuit, the following result was modelled as a condition for the definition of a general topology.


\begin{proposition}
Let $(X,d)$ be a metric space.
\begin{itemize}
	\item $X$ and $\emptyset$ are open sets 
	\item Open sets are closed under countable unions
	\item Open sets are closed under finite intersections
\end{itemize}
\end{proposition}


There are further properties of metric topologies (notably the Hausdorff condition) that were historically imposed for the definition of a general topology, however as the theory evolved, mathematicians eventually wanted to consider more general spaces, and this 'family of sets' condition became a great middleground between generality from metric spaces and similarity to metric spaces.

Besides, keeping the definition as a type of family of sets makes for nice comparison with other structures in other parts of mathematics defined also as a family of sets ($\sigma$-algebra).





\begin{definition}[Topology]
A \emph{topology on a set $X$} is a set $\mathcal{T}$ of subsets of $X$ such that:
\begin{itemize}
	\item $X$ and $\emptyset$ are in $\mathcal{T}$
	\item $\mathcal{T}$ is closed under finite intersections
	\item $\mathcal{T}$ is closed under countable unions
\end{itemize}
\[ \mathcal{T} \subseteq \mathcal{P}(X) \text{ is a topology on }X \iff X,\emptyset \in \mathcal{T} \land [  \bigcap^{n}_{i=0}U_i \in \mathcal{T} ] \land [ \bigcup^{\infty}_{i=0} U_i \in \mathcal{T} ] \]
\end{definition}


\begin{definition}[Topological space]
A \emph{topological space} is an ordered pair $(X,\mathcal{T})$ of a set $X$ and a topology $\mathcal{T}$ on $X$ denoted as . Elements of $X$ are referred to as \emph{points}.
\begin{itemize}
	\item $X$ is a set
	\item $\mathcal{T}$ is a topology over $X$
\end{itemize}
The sets in $\mathcal{T}$ are called the \emph{open sets}, and they are said to be \emph{open in $X$}
\[ (X, \mathcal{T}) \text{ is a topological space } \iff \mathcal{T} \text{ is a topology on } X\]
\[U \text{ is open in } X \iff U \in \mathcal{T} \]
When the topology is apparent, one may denote the topological space $(X,\mathcal{T})$ as just $X$.
\end{definition}


We have designed topological spaces in such a way that any metric space $(X,d)$ will function for all intensive purposes as the topological space $(X,\mathcal{T}(d))$. We willl continue our study of metric spaces within a topological viewpoint.


Our new objective is to port as much as possible from metric spaces to topological spaces.






We won't define boundaries for topological spaces just yet since we'll require the notion of 'neighborhoods and limit points', but we know from our study in metric spaces that we'll eventually prove that closed sets contain their whole boundary, and open sets contain none of it.






For any given set $X$, there are two 'obvious' topologies that could be made.
\[ \mathcal{T} \text{ is the discrete topology on } X \iff \mathcal{T} = \mathcal{P}(X) \]
\[ \mathcal{T} \text{ is the indiscrete topology on } X \iff \mathcal{T} = \{ X,\emptyset \} \]

We introduce a topology that can be put upon infinite sets.

\[ \mathcal{T} \text{ is the cocountable topology on } X \iff \mathcal{T} = \{ U \subseteq X : U = \emptyset \lor |X \setminus U| \leq \aleph_0 \} \]
\[ \mathcal{T} \text{ is the cofinite topology on } X \iff \mathcal{T} = \{ U \subseteq X : U = \emptyset \lor |X \setminus U| < \aleph_0 \} \]

\[ X \text{ is finite } \land \mathcal{T} \text{ is the cofinite topology on } X \implies \mathcal{T} \text{ is the discrete topology on } X \]


\subsection{Comparing topologies}

\begin{definition}
Given 2 topologies $\mathcal{T},\mathcal{U}$, we say that \emph{$\mathcal{U}$ is finer than $\mathcal{T}$ and $\mathcal{T}$ is coarser than $\mathcal{T}$} iff $\mathcal{T} \subset \mathcal{U}$.
\end{definition}
Similar to how $\leq$ orders the real numbers, we may use $\subseteq$ to form an order of topologies. The main difference is that not all topologies can be compared to eachother like real numbers. if $a \leq b$ is false, then $b \leq a$ is true, however it is posible that we can have $\mathcal{T} \subseteq \mathcal{U}$ and $\mathcal{U} \subseteq \mathcal{T}$ both false.

In order theory, we say that this is a partial order (or poset); an order where uncomparable pairs of elements may exist.


\subsection{Examples of topological spaces}
To build some intuition for topological spaces, we offer some basic examples of what topological spaces look like (and what they don't look like).

Basic examaples
\begin{example}
\[(\{1,2,3\} , \{ \emptyset , \{1,2,3\} , \{2,3\} , \{1,2\} ,  \{2\} \}  )\]
\[(\{1,2,3,4\} , \{ \emptyset , \{1,2,3,4\} , \{2,3\} , \{1,2,3\} ,  \{1,4\} , \{1\} \}  )\]
\end{example}

Examples that aren't topological spaces
\begin{example}
\[(\{1,2,3,4\} , \{ \emptyset , \{1,2,3,4\} , \{2,3,4\} , \{1,2,4\}  \}  )\]
\[(\{1,2,3\} , \{ \emptyset , \{2,3\} , \{1,2\} ,  \{2\} \}  )\]
\end{example}


\begin{example}
When one applies the cofinite topology on the set $\mathbb{N}$, the result is the following topological space.
\[( \mathbb{N} , \{ U  :  | \mathbb{N} \setminus U | < \aleph_0 \} )\]
\end{example}

\begin{example}
The \emph{Sierpiński space} is the topological space defined as such
\[( \{1,0\} , \{\emptyset , \{1\} , \{1,0\} \})\]
\end{example}

Though that last example was kind of cool, it's perhaps not entirely clear why we're doing topology in the first place. We now discuss a topological space that is quite familiar to us.

\begin{example}[Euclidean topology on $\mathbb{R}$]
	\[( \mathbb{R} , \{ U \subseteq \mathbb{R} : U = \bigcup_{n \in \mathbb{N}} (a_n ,b_n) \} )\]
\end{example}


It is interesting to note the nature of how Euclidean topologies are defined; and close them up under countable unions. This is the idea of a \emph{topological basis}.


\subsection{Basis of a topological space}

Those familiar with linear algebra are familiar with the idea of a \emph{basis}; a set of elements that under some operation can generate an entire space. Topological spaces follow the same principle; often we can find some basis that can generate the topological space that helps our analysis of the space. Better yet, perhaps we want to define a topological space by means of a basis!


\begin{definition}[Basis of a topology]
Let $(X,\mathcal{T})$ be a topological space. A \emph{basis} of $\mathcal{T}$ is a set $\mathcal{B} \subseteq \mathcal{T}$ such that any set open in $X$ is a union of sets in $\mathcal{B}$. Elements of $\mathcal{B}$ are called \emph{basic sets}.
\end{definition}

Every topological space can be represented by a basis since the topology itself forms a trivial basis for itself.

\begin{proposition}
Let $(X,\mathcal{T})$ be a topological space. $\mathcal{T}$ is a basis for $\mathcal{T}$ 
\end{proposition}


A topological basis can be though of as providing the 'ingredients' and the three set algebra laws generate these ingredients into a topology. But unfortunately not every set of sets can generate a topology under countable unions; when does a topological basis acually generate some topology?

By ensuring our set of sets agrees with the 3 conditions of the algebra of sets, we can be sure that our set is basis for some topology on the space.

\begin{proposition}
A set $\mathcal{B} \subset \mathcal{P}(X)$ generate some topology on $X$ iff both of the following hold
\begin{itemize}
	\item $X = \bigcup_{i \in \mathbb{N}} \mathcal{B}_i$
	\item For any sets $\mathcal{B}_i \mathcal{B}_j \in \mathcal{B}$, we have $\mathcal{B}_i \cap \mathcal{B}_j \in \mathcal{B}$
\end{itemize}
\end{proposition}

\begin{proposition}
Let $\mathcal{P}$ be a partition on $X$. Then $\mathcal{P}$ is a basis for some topology on $X$.
\end{proposition}


We can now check whether a set of sets can actually form a topology, but what if we want to check if our basis forms a \emph{particular} topology in question?

We can refine our definition of a basis to be more 'constructive' in this sense.

\begin{proposition}
	Let $(X,\mathcal{T})$ be a topological space. A set of sets $\mathcal{B}$ is a basis for $\mathcal{T}$ iff any of the following hold.
\begin{itemize}
	\item If $U$ is an open set, it is a union of sets in $\mathcal{B}$
	\item If $U$ is an open set, for any $u \in U$ there is a set in $\mathcal{B}$ containing $u$ that is completely contained in $U$
\end{itemize}
\end{proposition}


\begin{example}
	$\{ U \subset X : U =\{x\} , x\in X\}$ is a topological basis for the discrete topology on $X$
\end{example}

A basis is a nice way to define a topology, however it is possible that different basis' can actually generate the same topology!

\begin{proposition}
Two basis $\mathcal{B}_1 , \mathcal{B}_2 $ generate the same topology iff all the following hold.
\begin{itemize}
\item For any $B_1 \in \mathcal{B}_1$ each $b_1 \in B_1$ has a set $B_2 \in \mathcal{B}_2$ such that $b_ \in B_2$
\item For any $B_2 \in \mathcal{B}_2$ each $b_2 \in B_2$ has a set $B_1 \in \mathcal{B}_1$ such that $b_2 \in B_1$
\end{itemize}
\end{proposition}

When we have two basis' for a topology, we can compare their \emph{refinement}.

\begin{definition}
Let $(X,\mathcal{T})$ be a topological space. If $\mathcal{B}, \mathcal{C}$ are two basis' for $\mathcal{T}$, we say that $\mathcal{B}$ is a refinement of $\mathcal{C}$ iff $\mathcal{B} \subseteq \mathcal{C}$. 
\end{definition}



\subsection{Euclidean topology}

We have seen some rather rudimentary ways of constructing topologies on a general space $X$, however one of the most fundamental topologies for our intuition is the \emph{Euclidean topology}, which characterizes open sets in a Euclidean space.

\[ \mathcal{B}_{\mathbb{R}^n} = \{ U \subseteq X : U=\{x \in X : \sum^{n}_{i=1} (p_i-x_i)^2 < r^2 \}  \} \]



Note that we are implicitly using a metric to define the basis elements, this alludes to a way to create a topology from any metric space; more on this later.

In $\mathbb{R}$, the basis elements are the open intervals. 

Since we define open sets as unions of open intervals, we can see that the open intervals form a basis for the Euclidean topology.

\[ \mathcal{B}_{\mathbb{R}} = \{ (a,b) : a,b \in \mathbb{R} \land a < b \} \]


We'll briefly use the notation $B(\mathbf{p},r)$
\[ B(\mathbf{p},r) = \{ \mathbf{x} \in \mathbb{R}^n : \|\mathbf{p}-\mathbf{x} \| < r \} \]

\[ \mathcal{B}_{\mathbb{R}^n} = \{ B(\mathbf{p},r) : \mathbf{p} \in \mathbb{R}^n \land r \in \mathbb{R}^{+} \} \]

Noting that $(a,b) = (\frac{a+b}{2}-\frac{b-a}{2} ,  \frac{a+b}{2} +  \frac{b-a}{2} )=B_{\mathbb{R}}(\frac{a+b}{2},\frac{b-a}{2})$ we see that the open intervals are actually open balls of the single dimension Euclidean metric space. This alludes to the fact that this is actually a metric space; indeed this is true for any dimensional Euclidean topology, however we'll savour the details for later.


Due to the general familiarity that readers tend to have with the Euclidean topology, much of the theory developed for general topology will be applied to the Euclidean topology as a mode of demonstration.











\chapter{Limit points}

We've alluded to the fact that we're trying to model open sets as sets that don't contain any of their 'boundary', so we'd ultimately like to define what a boundary is on a formal level.

\section{Neighborhoods}

Now we will start developing more specific theory of topology that culminates to generalizing limits to topological spaces. We do this by means of beighborhoods.



\begin{definition}[Neighborhood]
A \emph{neighborhood of $p$} is a set $V$ containing some open set $U$ containing $p$.
An \emph{open neighborhood of $p$} is a neighborhood of $p$ that is an open set.
\[ V \text{ is a neighborhood of } p \iff \exists U \subseteq V [U \text{ is an open set }\land  p \in U] \]
\[ V \text{ is an open neighborhood of } p \iff V \text{ is an open set }\land  p \in V \]
\end{definition}


Topological spaces are an abstraction of metric space and hence cannot define limits with some distance function. The main idea of neighborhoods is a way of introducing some notion of 'closeness' using open sets strong enough to develop an idea of a limit.

Some authors define neighborhoods as open neighborhoods, however this book does not make that assumption.
It might be interesting to note that neighborhoods of $p$ can play a similar role to open balls of $p$ in the sense that they both contain open sets containing $p$. Though there are some notable differences like open balls relying on a metric and neighborhoods being much more general, they can be used with similar functions in some circumstances.

\begin{proposition}
If $p$ has a neighborhood $V$, then $p$ has an open neighborhood $U \subseteq V$.
\[ V \text{ is a neighborhood of } p \implies \exists U \subseteq V  [ U \text{ is an open neighborhood of }p ] \]
\end{proposition}




\section{Limit points of a set}

We're familiar with the idea that open intervals don't include their endpoints, however can we define this phenomena given any topology? This is the idea of a \emph{limit point}.

Imagine a set $S$ in $\mathbb{R}^2$ and examine the neighborhoods of various types of points. Points well outside the open set have neighborhoods disjoint to $S$, however neighborhoods of points $p\in S$ always have a nontrivial intersection with $S$, because they both contain $p$ as a bare minimum. What's interesting is that there are points outside of $S$ whose neighborhoods also always have a nontrivial intersection. It's like these points are 'nearly' in $S$; it turns out that having nontrivial intersection of all neighborhoods is the right way to define limit points.



\begin{definition}[Limit point of a set]
A \emph{limit point of a set $S$} is a point $p$ such that all neighborhoods of $p$ include another point in $S$ that isn't $p$.
\[ p \text{ is a limit point of } S \iff \forall V [ V \text{ is a neighborhood of } p \implies (V \cap S) \setminus \{ p \} \neq \emptyset ]\]
\[ S \to p \iff \forall V [ V \text{ is a neighborhood of } p \implies (V \cap S) \setminus \{ p \} \neq \emptyset ]\]
\end{definition}


%We can leverage the fact that all neighborhoods in metric spaces can be fully contained by an open ball to almost directly port our definition of boundaries to topological spaces!

\subsection{Constructions from limit points}

Limit points allow us to make various properties surrounding them.

\begin{definition}[Boundary of a set]
Let $(X,\mathcal{T})$ be a topological space. The \emph{boundary of $S$} is the set of all points $p\in X$ such that all their neighborhoods have intersections with $S$ and $X \setminus S$. We denote the boundary of $S$ as $\partial S$, and elements of $\partial S$ are called \emph{boundary points} of $S$.
\end{definition}

\begin{definition}[Closure of a set]
The \emph{closure of a set $S$} is the union of $S$ and the set of all limit points of $S$. Given that the topological space is $(X,\mathcal{T})$, the closure of $S$ is denoted as $\mathrm{cl}_{X}(S)$, and its elements are called points of closure of $S$.
\[ \mathrm{cl}_{X}(S) := S \cup \{p : p \text{ is a limit point of } S\}\]
\end{definition}

\begin{definition}[Interior of a set]
The \emph{interior of a set $S$} is the union of all subsets $U \subseteq S$ that are open. Given that the topological space is $(X,\mathcal{T})$, the interior of $S$ is denoted as $\mathrm{int}_{X}(S)$.
\end{definition}


\begin{definition}[Closed set]
\[ (X,\mathcal{T}) \]
A \emph{closed set in $X$} is a set $F$ that completely contains its boundary $\partial F$.
\end{definition}

In order to avoid this \href{https://www.youtube.com/watch?v=SyD4p8_y8Kw}{loss of sanity}, it's important to note that closed sets and open sets are not opposites in the sense meant by the English language. The definition of open and closed sets make this clear, however sometimes linguistic intuition can muddle the facts.

A testament to this is the fact that 'clopen' sets (sets that are closed and open simultaneously) exist.
\begin{definition}[Clopen set]
\[U \text{ is clopen in } (X,\mathcal{T}) \iff U \text{ is closed and open in } (\mathcal{T},X) \]
\end{definition}




\section{Properties of closure}

Closures are very useful constructs in topology with many important properties.



\begin{proposition}
Let $(X,\mathcal{T})$ be a topological space. For any set $S$, $\mathrm{cl}_{X}(S)$ is closed.
\[ (X,\mathcal{T}) \]
\[ \forall S \in X [ \mathrm{cl}_{X}(S) \text{ is closed in } (X,\mathcal{T}) ] \]
\end{proposition}


\begin{proposition}
	Let $(X,\mathcal{T})$ be a topological space. $\mathrm{cl}_{X}(S)$ is the smallest possible closed set containing $S$.
	\[ \forall T [ T \text{ is closed in } (X,\mathcal{T}) \land S \subseteq T \implies \mathrm{cl}_{X}(S) \subseteq T ]\]
\end{proposition}

Here's one intuitive way to think about that proposition; think of a swarm of all the open sets disjoint to $S$, all making a union around $S$. This swarm of open sets is trying to engulf everything around $S$, so any points that 'survive' are in the smallest possible closed superset of $S$.




\begin{proposition}
Let $(X,\mathcal{T})$ be a topological space. For any set $S$, $\mathrm{cl}_{X}(S)$ is closed.
\[ (X,\mathcal{T}) \]
\[ \forall S \in X [ \mathrm{cl}_{X}(S) \text{ is closed in } (X,\mathcal{T}) ] \]
\end{proposition}



Limit points follow a 'transitive property', that is, if the limit points of $S$ have limit points themselves, they are also limit points of $S$; we've had them the entire time. This leads to the following proposition.

\begin{proposition}
Let $(X,\mathcal{T})$ be a topological space. For any $S$, $\mathrm{cl}_{X}(S) \setminus S$ is closed.
\end{proposition}


\begin{proposition}
	\[ \mathrm{cl}(A \cap B) \subseteq \mathrm{cl}(A) \cap \mathrm{cl}(B) \]
	\[ \mathrm{cl}(A \cup B) = \mathrm{cl}(A) \cup \mathrm{cl}(B) \]
\end{proposition}

- closure of S is intersection of all closed sets containing S




\section{Properties of interior}


\begin{proposition}
Let $(X,\mathcal{T})$ be a topological space. For any set $S$, $\mathrm{int}_{X}(S)$ is open.
\[ (X,\mathcal{T}) \]
\[ \forall S \in X [ \mathrm{int}_{X}(S) \text{ is open in } (X,\mathcal{T}) ] \]
\end{proposition}

\begin{proposition}
	\[ \mathrm{int}(A \cap B) = \mathrm{int}(A) \cap \mathrm{int}(B) \]
	\[ \mathrm{int}(A \cup B) \supseteq \mathrm{int}(A) \cup \mathrm{int}(B) \]
\end{proposition}



\section{Equivalent definitions}


Using the language of closures and interiors, we can prove the following equivalent definitions. This will give us a bigger picture about the behaviour of topologies.

\begin{theorem}[Equivalent definitions of a boundary]
Let $(X,\mathcal{T})$ be a topological space. $\partial S$ is the boundary of $S$ iff any of the following hold.
\begin{itemize}
	\item For each point in $\partial S$, all the points neighborhoods have intersections with $S$ and $X \setminus S$.
	\item $\partial S = \mathrm{cl}_{X}(S) \setminus \mathrm{int}_{X}(S)$
	\item $\partial S = \mathrm{cl}_{X}(S) \cap \mathrm{cl}_{X}(X \setminus S)$
\end{itemize}
\end{theorem}


\begin{theorem}[Equivalent definitions of a closure]
	Let $(X,\mathcal{T})$ be a topological space. $\mathrm{cl}(S)$ is the closure of $S$ iff any of the following hold.
\begin{itemize}
	\item $\mathrm{cl}(S)$ is the union of $S$ and its limit points 
	\item $\mathrm{cl}(S)=S \cup \partial S$ 
	\item $\mathrm{cl}(S)$ is the intersection of all closed sets containing $S$ 
\end{itemize}
\end{theorem}



\begin{theorem}[Equivalent definitions of a closed set]
Let $(X,\mathcal{T})$ be a topological space. A set $F$ is closed in $X$ iff any of the following hold.
\begin{itemize}
	\item $X \setminus F$ is open.
	\item $\mathrm{cl}_{X}(F)=F$ ($F$ contains all its limit points)
	\item $\partial F \subseteq F$ 
\end{itemize}
\[ F \text{ is closed in }X  \iff [ X \setminus F \text{ is open in }X  ] \lor  [ \mathrm{cl}_{X}(F)=F  ] \lor [ \partial F \subseteq F ] \]
\end{theorem}



\begin{theorem}[Equivalent definitions of an open set]
Let $(X,\mathcal{T})$ be a topological space. A set $U$ is open in $X$ iff any of the following hold.
\begin{itemize}
	\item $X \setminus U$ is closed.
	\item $\mathrm{int}_{X}(U)=U$
	\item $\partial U \cap U = \emptyset$ 
\end{itemize}
\[ F \text{ is closed in }X  \iff [ X \setminus F \text{ is open in }X  ] \lor  [ \mathrm{cl}_{X}(F)=F  ] \lor [ \partial F \subseteq F ] \]
\end{theorem}























\begin{corollary}
Closure is idempotent.
\[\mathrm{cl}_{X} ( \mathrm{cl}_{X}(S)) = \mathrm{cl}_{X}(S)\]
\end{corollary}

\begin{corollary}
Let $(X,\mathcal{T})$ be a topological space. For any $S$, the set of its limit points is closed.
\[ \forall S [ \{p : p \text{ is a limit point of } S\} \text{ is closed in } (X,\mathcal{T}) ]  \]
\end{corollary}





\begin{definition}
Let $(X,\mathcal{T})$ be a topological space, a set $S$ is \emph{dense in $X$} iff its closure equals $X$.
\end{definition}

Here's an example demonstrating this idea in the Euclidean topological space.

\begin{proposition}
	Let $(\mathbb{R},\mathcal{T}_{\mathbb{R}})$ be the Euclidean topological space, then $\mathbb{Q}$ is dense in $\mathbb{R}$.
\end{proposition}


The topologies on $X$ form a poset with $ \subseteq$ as the order. If $\mathcal{T}_1 \subseteq \mathcal{T}_2$, we say $\mathcal{T}_2$ is finer than $\mathcal{T}_1$ and $\mathcal{T}_1$ is coarser than $\mathcal{T}_2$.



\section{Limit point of a sequence}


It is possible to generalize a definition of a convergent sequence to a topological space.


\begin{definition}[Convergent sequence (Topological space)]
In a topological space $(X,\mathcal{T})$, a \emph{limit} of a sequence is a point $p \in X$ such that for any neighborhood of $p$, the sequence eventually remains forever in that neighborhood. A \emph{convergent sequence} is a sequence with a limit.
\[ (X,\mathcal{T}) \]
\[ x_n \to p  \iff \forall V_p \subseteq X [ V_p \text{ is a neighborhood of } p \implies \exists N \in \mathbb{Z} [ \forall n \geq N [ x_n \in V_p ] ] ] \]
\end{definition}



Convergent sequences for a general topological space have much less structure; limits are not unique in a general topological space.

One may ask if limit points of a set can be calculated by considering all limits from all convergent sequences sampled from that set. Unfortunately this is not the case, however it is still a great question to ask! In some nicer spaces (like metric spaces), this actually does hold, and it is probably our intuition from Euclidean space that inspired this thought.






