\documentclass{article}

\usepackage[english]{babel}
\usepackage[margin=1in]{geometry}

\usepackage{amsmath}
% for symbols such as /implies
\usepackage{amssymb}
% for symbols such as /subsetneq
\usepackage{amsthm}
% for commands such as \newtheorem

\theoremstyle{definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\newtheorem{axiom}{Axiom}

\begin{document}

\section{Topology}

% topological space
\begin{definition}
  A \emph{topology} on a set $X$ is a collection of subsets $\tau \subseteq \mathcal{P}(X)$ such that
  \begin{enumerate}
    \item $\{\emptyset, X\} \subseteq \tau$
    \item For any collection of subsets $\mathcal{A} \subseteq \tau$ one has $\cup\mathcal{A}\in \tau$
    \item For any finite collection of subsets $\mathcal{A} \subseteq \tau$ one has $\cap\mathcal{A}\in \tau$
  \end{enumerate}
  If $\tau$ is a topology on $X$, we call $(X,\tau)$ a \emph{topological space}. We may occasionaly say $X$ is a topological space with topology $\tau$.
\end{definition}

% open/closed set
\begin{definition}
  Let $(X,\tau)$ be a topological space. A subset $U\subseteq X$ is an \emph{open set} if $U\in\tau$. A subset $F\subseteq X$ is a \emph{closed set} if $X\setminus F\in\tau$. If $x\in X$ and $U\subseteq X$ is an open set with $x\in U$, we call $U$ a \emph{neighborhood} of $x$.
\end{definition}

\begin{theorem}
  Let $(X,\tau)$ be a topological space and let $\rho$ be the collection of closed subsets of $X$. Then
  \begin{enumerate}
    \item $\{\emptyset, X\} \subseteq \rho$
    \item For any collection of subsets $\mathcal{A} \subseteq \rho$ one has $\cap\mathcal{A}\in \rho$
    \item For any finite collection of subsets $\mathcal{A} \subseteq \rho$ one has $\cup\mathcal{A}\in \rho$
  \end{enumerate}
  \begin{proof}
    Since $\tau$ is a topology, $\emptyset\in\tau$ and $X\in\tau$. Then $X\setminus\emptyset = X\in \tau$ and $X\setminus X = \emptyset\in\tau$ so that $\{\emptyset, X\}\subseteq \rho$.

    Let $\mathcal{A} \subseteq \rho$ be any collection of closed subsets. Then $\mathcal{C} = \{X\setminus A : A\in\mathcal{A}\} \subseteq \tau$. Since $\tau$ is a topology $\cup\mathcal{C}\in\tau$. By the laws of DeMorgan
    $$
      \cap\mathcal{A} = \bigcap_{A\in\mathcal{A}} A = X\setminus \bigcup_{A\in\mathcal{A}} (X\setminus A) = X\setminus \cup\mathcal{C}.
    $$
    Since $\cup\mathcal{C}$ is open, $\cap\mathcal{A}$ is closed.

    Let $\mathcal{A} \subseteq \rho$ be any finite collection of closed subsets. Then $\mathcal{C} = \{X\setminus A : A\in\mathcal{A}\} \subseteq \tau$ is a finite collection of open sets. Since $\tau$ is a topology $\cap\mathcal{C}\in\tau$. By the laws of DeMorgan
    $$
      \cup\mathcal{A} = \bigcup_{A\in\mathcal{A}} A = X\setminus \bigcap_{A\in\mathcal{A}} (X\setminus A) = X\setminus \cap\mathcal{C}.
    $$
    Since $\cap\mathcal{C}$ is open, $\cup\mathcal{A}$ is closed.
  \end{proof}
\end{theorem}

% Hausdorff
\begin{definition}
  A topological space $(X,\tau)$ is \emph{Hausdorff} if for any distinct points $x,y\in X$ there are $U,V\in\tau$ with $x\in U$, $y\in V$, and $U\cap V = \emptyset$. That is, $(X,\tau)$ is Hausdorff if for any pair of distinct points in $X$, one can find disjoint neighborhoods containing them.
\end{definition}

\begin{example}
  Let $X$ be a set and let $\tau$ be the collection of subsets $A\subseteq X$ such that $A=\emptyset$ or $X\setminus A$ is finite. Then $\tau$ is a topology on $X$ and $(X,\tau)$ is Hausdorff if and only if $X$ is finite. We call $\tau$ the \emph{finite complement} topology on $X$.
  \begin{proof}
    We have $\emptyset\in\tau$ and since $X\setminus X = \emptyset$ is finite, $X\in\tau$. 
    
    Let $\mathcal{A} \subseteq \tau$. Then
    $$
      X\setminus \cup\mathcal{A} = \bigcap_{A\in\mathcal{A}} (X\setminus A)
    $$
    is contained in $X\setminus A$ for each $A\in\mathcal{A}$. Since each is finite, so is $X\setminus\cup\mathcal{A}$. Then $\cup\mathcal{A}\in\tau$.

    Let $\mathcal{A} \subseteq\tau$ be a finite set. Then
    $$
      X\setminus \cap\mathcal{A} = \bigcup_{A\in\mathcal{A}} (X\setminus A)
    $$
    is a finite union of finite sets and hence finite. Then $\cap\mathcal{A}\in\tau$. Hence $\tau$ is a topology on $X$.

    Suppose $X$ is finite. Let $x,y\in X$ be distinct, i.e., $x\neq y$. Since $X$ is finite, $X\setminus \{x\}$ and $X\setminus \{y\}$ are finite sets. Then $\{x\}$ and $\{y\}$ are disjoint neighborhoods of $x$ and $y$ respectively. Hence $X$ is Hausdorff.

    Suppose $X$ is infinite. Let $x,y\in X$ be distinct. Let $U$ be a neighborhood of $x$ and $V$ be a neighborhood of $y$. Then $X\setminus U$ and $X\setminus V$ are finite sets. Then
    $$
      X\setminus (U\cap V) = (X\setminus U) \cup (X\setminus V)
    $$
    is a finite set. Since $X$ is infinite, $U\cap V$ must be infinite as well. In particular, $U\cap V\neq\emptyset$ and $\tau$ is not Hausdorff.
  \end{proof}
\end{example}

\begin{definition}
  A collection of subsets $\mathcal{B}$ of $X$ is a \emph{basis} for a topology on $X$ if
  \begin{enumerate}
    \item For each $x\in X$, there is $B\in\mathcal{B}$ with $x\in B$
    \item For each $x\in X$, if there is $B_1,B_2\in\mathcal{B}$ with $x\in B_1\cap B_2$, then there is $B\in\mathcal{B}$ with $x\in B\subseteq B_1\cap B_2$
  \end{enumerate}
  We define $\tau_\mathcal{B}$ to be the collection of subsets $U$ of $X$ such that for each $x\in U$ there is $B\in\mathcal{B}$ with $x\in B\subseteq U$.
\end{definition}

\begin{lemma}
  Let $\mathcal{B}$ be a basis for a topology on $X$. Let $n\in\mathbb{N}$. If $\mathcal{A}\subseteq\tau_\mathcal{B}$ is a set of cardinality $n$, then $\cap\mathcal{A}\in\tau_{\mathcal{B}}$.
  \begin{proof}
    We proceed with induction on $n$. If $|\mathcal{A}| = 0$, then $\mathcal{A}=\emptyset$ and $\cap\mathcal{A}=\emptyset\in \tau_\mathcal{B}$.
    If $|\mathcal{A}|=1$, then there is $A\in\tau_\mathcal{B}$ with $\mathcal{A}=\{A\}$. Then $\cap\mathcal{A} = A\in\tau_\mathcal{B}$.
    Suppose for $k\in\mathbb{N}$ that any subset $\mathcal{A}\subseteq\tau_\mathcal{B}$ with $|\mathcal{A}|=k$ has $\cap\mathcal{A}\in\tau_\mathcal{B}$.
    Let $\mathcal{A}\subseteq\tau_\mathcal{B}$ be a subset with $|\mathcal{A}|=k+1$. Let $A\in\mathcal{A}$. Then $\mathcal{A}\setminus \{A\}$ is a subset of $\tau_\mathcal{B}$ of cardinality $k$. Let $x\in\cap\mathcal{A}$. Then $x\in A\in \tau_\mathcal{B}$ and $x\in \cap (\mathcal{A}\setminus\{A\}) \in \tau_\mathcal{B}$. Then there is $B_1\in\mathcal{B}$ with $x\in B_1\subseteq A$ and there is $B_2\in\mathcal{B}$ with $x\in B_2\subseteq \cap(\mathcal{A}\setminus\{A\})$. Then $x\in B_1 \cap B_2$. Since $\mathcal{B}$ is a basis, there is $B\in\mathcal{B}$ with $x\in B\subseteq B_1\cap B_2\subseteq \cap\mathcal{A}$. Then $\cap\mathcal{A} \in \tau_\mathcal{B}$.
  \end{proof}
\end{lemma}

\begin{theorem}
  If $\mathcal{B}$ is a basis for a topology on $X$, then $\tau_\mathcal{B}$ is a topology on $X$.
  \begin{proof}
    Let $\mathcal{B}$ be a basis for a topology on $X$. Since $\emptyset$ has no elements, it follows that $\emptyset\in\tau_\mathcal{B}$. Since $B$ is a basis, for each $x\in X$ there is $B\in\mathcal{B}$ with $x\in B\subseteq X$. Then $X\in\tau_\mathcal{B}$. 
    
    Let $\mathcal{A} \subseteq \tau_\mathcal{B}$. Let $x\in \cup\mathcal{A}$. Then there is some $A\in\mathcal{A}$ with $x\in A$. Since $A\in\tau_\mathcal{B}$, there is $B\in\mathcal{B}$ with $x\in B\subseteq A\subseteq\cup\mathcal{A}$. Then $\cup\mathcal{A} \in \tau_\mathcal{B}$.
    
    Let $\mathcal{A} \subseteq \tau_\mathcal{B}$ be finite. Then there is $n\in\mathbb{N}$ with $|A|=n$. By the preceeding lemma, $\cap\mathcal{A}\in\tau_\mathcal{B}$. Then $\tau_\mathcal{B}$ is a topology on $X$.
  \end{proof}
\end{theorem}

\begin{theorem}
  Let $\tau$ be a topology on $X$. Let $\mathcal{B}\subseteq \tau$. If for each open set $U\in\tau$ and each $x\in U$ there is $B\in\mathcal{B}$ such that $x\in B\subseteq U$, then $\mathcal{B}$ is a basis for a topology on $X$ and $\tau_\mathcal{B} = \tau$.
  \begin{proof}
    Suppose for each open set $U\in\tau$ and each $x\in U$, there is $B\in\mathcal{B}$ with $x\in B\subseteq U$.

    Since $\tau$ is a topology on $X$, we have $X\in\tau$. Let $x\in X$. Then there is $B\in\mathcal{B}$ with $x\in B$.

    Let $x\in X$ and suppose there is $B_1,B_2\in\mathcal{B}$ with $x\in B_1\cap B_2$. Since $\mathcal{B}\subseteq\tau$ and $\tau$ is a topology, $B_1\cap B_2\in\tau$. Then there is $B\in\mathcal{B}$ such that $x\in B\subseteq B_1\cap B_2$. Hence $\mathcal{B}$ is a basis for a topology on $X$.

    Let $U\in\tau$. Let $x\in U$. Then there is $B\in\mathcal{B}$ with $x\in B\subseteq U$. Hence $U\in\tau_\mathcal{B}$ and $\tau\subseteq\tau_\mathcal{B}$.

    Let $V\in\tau_\mathcal{B}$. For each $x\in V$ there is $B_x\in\mathcal{B}$ with $x\in B_x\subseteq V$. Since $\mathcal{B}\subseteq \tau$, we have $B_x\in \tau$ for each $x\in V$. Then 
    $$
      V = \bigcup_{x\in V} B_x \in \tau
    $$
    and $\tau_\mathcal{B}\subseteq \tau$. Hence $\tau_\mathcal{B} = \tau$.
  \end{proof}
\end{theorem}

\begin{theorem}
  Let $\mathcal{A}$ and $\mathcal{B}$ be bases of topologies on $X$. Then $\tau_\mathcal{A} \subseteq \tau_\mathcal{B}$ if and only if for each $x\in X$ and each $A\in\mathcal{A}$ with $x\in A$ there is $B\in\mathcal{B}$ with $x\in B\subseteq A$.
  \begin{proof}
    Suppose $\tau_\mathcal{A} \subseteq \tau_\mathcal{B}$. Let $x\in X$ and let $A\in\mathcal{A}$ with $x\in A$.
    Let $a\in A$. Then $a\in A\subseteq A$ with $A\in\mathcal{A}$. Hence $A\in\tau_\mathcal{A}\subseteq\tau_\mathcal{B}$.
    Then there is $B\in\mathcal{B}$ such that $x\in B\subseteq A$.

    Suppose for each $x\in X$ and each $A\in\mathcal{A}$, there is $B\in\mathcal{B}$ with $x\in B\subseteq A$.
    Let $U\in\tau_\mathcal{A}$. If $U$ is empty, then $U=\emptyset\in\tau_\mathcal{B}$ since $\tau_\mathcal{B}$ is a topology.
    Suppose $U$ is nonempty and let $x\in U$. Then there is $A\in\mathcal{A}$ such that $x\in A\subseteq U$. Then there is $B\in\mathcal{B}$ with $x\in B\subseteq A\subseteq U$. Then $U\in\tau_\mathcal{B}$. It follows that $\tau_\mathcal{A}\subseteq \tau_\mathcal{B}$.
  \end{proof}
\end{theorem}

\end{document}