\documentclass[%
version=last,%
a5paper,twoside,%
%a4paper,landscape,twocolumn,%
12pt,%
%headings=small,%
bibliography=totoc,%
index=totoc,%
%titlepage=no,%
reqno,%
%abstract=yes,%
cleardoublepage=empty,%
open=any,%
%titlepage=false,%
draft=true,%
%DIV=classic,%
DIV=12,%
headinclude=false,%
pagesize]%
{scrbook}
%{scrreprt}
%{scrartcl}

%\usepackage{layout}
%\usepackage[notref,notcite]{showkeys}

%\renewcommand{\sectionmark}[1]{\markleft{#1}} % needed for scrart
\usepackage{scrpage2}
\pagestyle{scrheadings}
\clearscrheadings
\refoot{Cantor Set 2018}
\lofoot{\leftmark}
\ofoot{\pagemark}
%\ifoot{\headmark}

\usepackage{moredefs,lips}
%\makeindex
%\usepackage{makeidx}

\usepackage[perpage,symbol]{footmisc}
%\renewcommand{\captionformat}{. }

%\usepackage{chngcntr}
%\counterwithout{figure}{chapter}
%\counterwithout{table}{chapter}

\usepackage{graphicx} % allows \rotatebox
\usepackage{verbatim}

\usepackage{relsize} % Here \smaller scales by 1/1.2; \relscale{X} scales by X

\usepackage{multicol}
\usepackage{pstricks,pst-node,pst-plot,pst-math}

\usepackage{amsmath,amsthm,amssymb,bm,upgreek,mathrsfs,nicefrac}

\newcommand{\CS}{\mathrm C}
\newcommand{\CSclo}{\mathrm D}
\newcommand{\gee}{\mathrm g}
\newcommand{\Gee}{\mathrm G}
\newcommand{\Ell}{\mathrm L}
\newcommand{\universe}{\mathbf V}
\newcommand{\pow}[1]{\mathscr P(#1)}
\newcommand{\powo}{\pow{\upomega}}
\newcommand{\powf}[1]{\mathscr P_{\upomega}(#1)}
\newcommand{\symdiff}{\mathbin{\triangle}}
\DeclareMathOperator{\dom}{dom}
\renewcommand{\models}{\vDash}
\newcommand{\nmodels}{\nvDash}
\DeclareMathOperator{\Model}{Mod}
\newcommand{\Mod}[1]{\Model(#1)}
\newcommand{\comp}{^{\mathrm c}}
\newcommand{\modsim}{/\mathord{\sim}}
\DeclareMathOperator{\Theory}{Th}
\newcommand{\Th}[1]{\Theory(#1)}
\newcommand{\Stone}[1]{\mathrm S(#1)}  % Stone space of #1
\DeclareMathOperator{\ball}{B}


\swapnumbers
\newtheorem{theorem}{Theorem}
\newtheorem{Cantor}[theorem]{Cantor's Theorem}
\newtheorem{RP}[theorem]{Russell Paradox}
\newtheorem{CSB}[theorem]{Cantor--Schr\"oder--Bernstein Theorem}
\newtheorem{CI}[theorem]{Cantor Intersection Theorem}
\newtheorem{HB}[theorem]{Heine--Borel Theorem}
\newtheorem{KL}[theorem]{K\"onig's Lemma}
\newtheorem{TT}[theorem]{Tychonoff Theorem}
\newtheorem{Compactness}[theorem]{Compactness Theorem}
\newtheorem{SRT}[theorem]{Stone Representation Theorem}
\newtheorem{axiom}[theorem]{Axiom}
\newtheorem{lemma}{Lemma}
\newtheorem*{corollary}{Corollary}
\theoremstyle{definition}
\newtheorem{exercise}{Exercise}

%\allowdisplaybreaks

\newcommand{\inv}{^{-1}}
\renewcommand{\phi}{\varphi}
\newcommand{\included}{\subseteq}
\newcommand{\includes}{\supseteq}
\newcommand{\pincluded}{\subset}
\newcommand{\pincludes}{\supset}
\let\oldvec\vec
\renewcommand{\vec}[1]{\bm{#1}}

\newcommand{\R}{\mathbb R}
\newcommand{\Q}{\mathbb Q}
\newcommand{\Z}{\mathbb Z}
\renewcommand{\setminus}{\smallsetminus}

\newcommand{\Exists}[1]{\exists#1\;}
\newcommand{\Forall}[1]{\forall#1\;}

%\newcommand{\lto}{\Rightarrow}
\newcommand{\lto}{\rightarrow}
%\newcommand{\liff}{\Leftrightarrow}
\newcommand{\liff}{\leftrightarrow}
\renewcommand{\geq}{\geqslant}
\renewcommand{\leq}{\leqslant}
\renewcommand{\emptyset}{\varnothing}
\renewcommand{\epsilon}{\varepsilon}

\usepackage[all]{xy}
%\renewcommand{\theequation}{\fnsymbol{equation}}

\newcommand{\abs}[1]{\left\lvert#1\right\rvert}

\usepackage{hfoldsty}
\usepackage[neverdecrease]{paralist}
\usepackage{url}

\begin{document}

\subtitle{A winter course at the Nesin Matematik K\"oy\"u}
\title{The Cantor Set}
\author{David Pierce}
\date{January 15--21, 2018\\
Edited January 29, 2018}
\publishers{Matematik B\"ol\"um\"u\\
Mimar Sinan G\"uzel Sanatlar \"Universitesi\\
\.Istanbul\\
\url{mat.msgsu.edu.tr/~dpierce/}\\
\url{dpierce@msgsu.edu.tr}}

\uppertitleback{\centerline{Abstract}
We show how the Cantor set, 
with the order topology induced from $\R$,
is homeomorphic to the power set of the natural numbers,
as equipped with the Tychonoff topology.
We obtain an analogy between the Heine--Borel Theorem
and the Tychonoff Theorem---and with the Compactness Theorem of model theory.}

\maketitle
%\thispagestyle{empty}

\chapter*{Preface}

These notes are based on a course of seven lectures, 
$2\times 50$ minutes each.
I have thoroughly revised the notes from a similar course in January 2017.
Those notes were divided by day;
the present notes are divided by topic
and may differ more from what actually happened in class.
The Summary on page \pageref{ch:sum} lists the numbered theorems of these notes
(other results are called lemmas and have their own numbering);
what I did day by day is roughly as follows.
\begin{compactdesc}
  \item[Monday]
Theorem \ref{thm:CS}.
\item[Tuesday]
Theorem \ref{thm:g}, Cantor's Theorem, Russell Paradox.
\item[Wednesday]
Schr\"oder--Bernstein,
Cantor Intersection.
\item[Thursday]
Theorems \ref{thm:open}, \ref{thm:closed}, and \ref{thm:R-clopen}.
\item[Friday]
Theorem \ref{thm:C-clopen},
Heine--Borel.
\item[Saturday]
K\"onig's Lemma, Tychonoff Theorem.
\item[Sunday]
Compactness Theorem, Stone Representation.
\end{compactdesc}
The section on topological rings is an afterthought
that connects the course to the following week's course,
on finite fields.
Two students attended at least parts of both courses.
For the Cantor set course,
I had thirty or forty students the first day;
down to about fifteen on Thursday, six on Friday, and four on Sunday.

\chapter*{Summary}\label{ch:sum}

The Cantor Set is the intersection $\CS$ of an infinite family of sets,
as in \eqref{eqn:CS}.
The family forms a decreasing chain, as in \eqref{eqn:chain}.
Each set in the family is a union, as in \eqref{eqn:I}, 
of finitely many sets,
which closed intervals of $\R$, as in \eqref{eqn:a}.
\begin{compactenum}
  \item
$\CS$ is the set of points in $[0,1]$
that can be written in base $3$ without the digit $1$
(page \pageref{thm:CS}).
\item
$\CS$ is equipollent with the set $\powo$ of subsets 
of the set $\upomega$ of natural numbers
(page \pageref{thm:g}).
\item
$\powo$ is uncountable,
By Cantor's Theorem (page \pageref{thm:Cantor}).
\item
The proof is as for the Russell Paradox
(page \pageref{thm:RP}).
\item
$\powo$ and $\R$ are equipollent,
by the Cantor--Schr\"oder--Bernstein Theorem
(page \pageref{thm:CSB}).
\item
As the intersection of a decreasing chain of nonempty bounded closed sets,
$\CS$ is nonempty,
by the Cantor Intersection Theorem (page \pageref{thm:CI}).
\item
$\R$ is a topological space with open intervals as a basis
(page \pageref{thm:open}).
\item
$\CS$ is closed in this topology
(page \pageref{thm:closed}).
\item
$\R$ has only itself and the empty set as clopen subsets 
(page \pageref{thm:R-clopen}).
\item
$\CS$ has many clopen subsets,
namely its intersection with the intervals mentioned above
(page \pageref{thm:C-clopen}).
\item
$\CS$ is compact
by the Heine--Borel Theorem (page \pageref{thm:HB}),
so every clopen subset is a finite union 
of the clopen subsets just mentioned.
\item
Our proof of the Heine--Borel Theorem
is analous to that of
K\"onig's Lemma (page \pageref{thm:KL}).
\item
---Also to that of
the Tychonoff Theorem (page \pageref{thm:TT}).
\item
---And of the Compactness Theorem for propositional logic
(page \pageref{thm:comp}).
\item
This Compactness Theorem is a special case of the
Stone Representation Theorem (page \pageref{thm:Stone}),
though the Compactness Theorem of first-order logic is not.
\end{compactenum}
With the topology induced from $\R$,
the Cantor set is a topological ring in two different ways,
as (isomorphic to) the Boolean ring $\powo$
and the ring $\Z_{(2)}$ of dyadic integers.

\tableofcontents
\listoffigures

\chapter{Cardinality}

\section{The Cantor Set}

The \emph{Cantor set} is a certain subset of $\R$.
For the sake of defining it, we let
\begin{gather*}
  \CS_0=[0,1],\\
\CS_1=[0,\nicefrac13]\cup[\nicefrac23,1],\\
\CS_2=[0,\nicefrac19]\cup[\nicefrac29,\nicefrac13]
\cup[\nicefrac23,\nicefrac79]\cup[\nicefrac89,1],
\end{gather*}
and so on, as in Figure \ref{fig:F}.
\begin{figure}
  \centering
  \begin{pspicture}(0,-1.2)(10,2.5)
\uput[u](0,2){$0$}
\uput[u](1,2){$\nicefrac19$}
\uput[u](2,2){$\nicefrac29$}
\uput[u](3,2){$\nicefrac13$}
\uput[u](6,2){$\nicefrac23$}
\uput[u](7,2){$\nicefrac79$}
\uput[u](8,2){$\nicefrac89$}
\uput[u](9,2){$1$}
\psline{*-*}(0,2)(9,2)
\uput[r](9,2){$\quad\CS_0$}
\psline{*-*}(0,1)(3,1)
\psline{*-*}(6,1)(9,1)
\uput[r](9,1){$\quad\CS_1$}
\psline{*-*}(0,0)(1,0)
\psline{*-*}(2,0)(3,0)
\psline{*-*}(6,0)(7,0)
\psline{*-*}(8,0)(9,0)
\uput[r](9,0){$\quad\CS_2$}
\psline{*-*}(0,-1)(! 1 3 div -1)
\psline{*-*}(! 2 3 div -1)(1,-1)
\psline{*-*}(2,-1)(! 7 3 div -1)
\psline{*-*}(! 8 3 div -1)(3,-1)
\psline{*-*}(6,-1)(! 19 3 div -1)
\psline{*-*}(! 20 3 div -1)(7,-1)
\psline{*-*}(8,-1)(! 25 3 div -1)
\psline{*-*}(! 26 3 div -1)(9,-1)
\uput[r](9,-1){$\quad\CS_3$}
\psset{linestyle=dotted}
\psline(0,2)(0,-1)
\psline(1,2)(1,-1)
\psline(2,2)(2,-1)
\psline(3,2)(3,-1)
\psline(6,2)(6,-1)
\psline(7,2)(7,-1)
\psline(8,2)(8,-1)
\psline(9,2)(9,-1)
  \end{pspicture}
  \caption{Some sets $\CS_n$}
  \label{fig:F}
\end{figure}
Thus each $\CS_n$ is a union of bounded closed intervals,
and we obtain $\CS_{n+1}$ from $\CS_n$
by removing the middle third of each component interval.
Presently we shall find a ``closed'' expression for each set $\CS_n$,
ultimately as in \eqref{eqn:F_n}.
For now, we make three observations.
\begin{compactenum}
  \item
The sets $\CS_n$ compose a \textbf{decreasing chain:}
\begin{equation}\label{eqn:chain}
  \CS_0\includes \CS_1\includes \CS_2\includes\dotsb
\end{equation}
\item
Each $\CS_n$ is the union of $2^n$-many 
disjoint bounded closed intervals.
\item
Each of those intervals has length $3^{-n}$.
\end{compactenum}
Thus the \textbf{measure} of $\CS_n$ is $(\nicefrac23)^n$;
we may write
\begin{equation*}
  \upmu(\CS_n)=\left(\frac23\right)^n,
\end{equation*}
where $\upmu$ is the minuscule Greek letter mu.
By definition, the \textbf{Cantor Set}
is the subset \fbox{$\CS$} of $\R$ given by
\begin{equation*}
\CS=  \CS_0\cap \CS_1\cap \CS_2\cap\dotsb
\end{equation*}
of $\R$.  We may write the intersection here as
\begin{equation*}
  \bigcap_{n=0}^{\infty}\CS_n.
\end{equation*}
If this has a measure, it ought to be $\lim_{n\to\infty}(\nicefrac23)^n$,
which is $0$.
Nonetheless, $\CS$ is not empty.
This will turn out to be a special case of the Cantor Intersection Theorem,
page \pageref{thm:CI}.
For example, 
$\CS$ contains the endpoints of the component intervals of each $\CS_n$.
To specify these points, we observe
\begin{equation}\label{eqn:CS01}
\begin{gathered}
  \CS_0=\left[0,\frac1{3^0}\right],\\
\CS_1=\left[0,\frac1{3^1}\right]
\cup\left[\frac2{3^1},\frac2{3^1}+\frac1{3^1}\right],
\end{gathered}
\end{equation}
and
\begin{multline}\label{eqn:CS2}
\CS_2=\left[0,\frac1{3^2}\right]
\cup\left[\frac2{3^2},\frac2{3^2}+\frac1{3^2}\right]\\
\cup\left[\frac2{3^1},\frac2{3^1}+\frac1{3^2}\right]
\cup\left[\frac2{3^1}+\frac2{3^2},\frac2{3^1}+\frac2{3^2}+\frac1{3^2}\right].
\end{multline}
In general, each $\CS_n$ is the union of all of the intervals of the form
\begin{equation*}
  \left[\frac{d_1}{3^1}+\dots+\frac{d_n}{3^n},
\frac{d_1}{3^1}+\dots+\frac{d_n}{3^n}+\frac1{3^n}\right],
\end{equation*}
where each $d_k$ is either $0$ or $2$.
In Sigma-notation, the intervals are
\begin{equation*}
  \left[\sum_{k=1}^n\frac{d_k}{3^k},
\sum_{k=1}^n\frac{d_k}{3^k}+\frac1{3^n}\right].
\end{equation*}

\section{Natural numbers}

In seeking to understand the Cantor set $\CS$,
we shall make use, at least notationally, 
of the natural numbers according to the definition of von Neumann.
We shall denote the \emph{set} of natural numbers by \fbox{$\upomega$,}
which is the minuscule Greek letter omega.  
Informally,
\begin{equation*}
  \upomega=\{0,1,2,\dots\}.
\end{equation*}
We make a recursive definition as follows.
\begin{compactenum}
  \item
$0$ is $\emptyset$, the empty set, and this is in $\upomega$.
\item
If $n$ is in $\upomega$, then the \textbf{successor} of $n$,
namely $n+1$, is $n\cup\{n\}$,
and this is in $\upomega$.
\item
Nothing else is in $\upomega$.
\end{compactenum}
It is a set-theoretical challenge
to establish that $\upomega$ is a well-defined set;
we accept that it is.%%%%%
\footnote{Each element of $\upomega$
\emph{includes,} as a subset, each of its elements;
it is also well-ordered,
in the sense to be defined presently;
therefore, by definition, each element of $\upomega$
is an \textbf{ordinal.}
There may be other ordinals, such as $\upomega$ itself.
Still, $\upomega$ would be a \textbf{limit} ordinal,
in the sense of being neither $0$ nor a successor.
By definition, $\upomega$ is the \emph{class,}
in the sense of page \pageref{class},
of ordinals that neither \emph{are} limits
nor \emph{contain} limits.
Though it is not usually expressed this way,
the \emph{Axiom of Infinity}
is that the class $\upomega$ is a set.
In this way, the Axiom is parallel to most of the other
Zermelo--Fraenkel Axioms,
namely those whereby certain classes are sets.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
We have
\begin{align*}
  0&=\emptyset,&
1&=\{0\},&
2&=\{0,1\},
\end{align*}
and for all $n$ in $\upomega$,
\begin{equation}\label{eqn:n}
  n=\{0,\dots,n-1\}=\{x\in\upomega\colon x<n\}.
\end{equation}
Here the ordering $<$ of $\upomega$ is $\pincluded$,
and one can show that this is also $\in$.
Easily $\upomega$ is \textbf{well-ordered,}
that is, each nonempty subset has a least element;
for the least element of a nonempty subset $A$ of $\upomega$
is the intersection $\bigcap A$.

We shall denote the set of functions from a set $B$ to a set $A$ by
\begin{equation*}
  {}^BA.
\end{equation*}
Putting everything together, we have
\begin{gather*}
{}^n2=\bigl\{\text{functions from $\{0,\dots,n-1\}$ to $\{0,1\}$}\bigr\}.
\end{gather*}
A typical element of ${}^n2$ can be written as either of
\begin{align*}
  &(e_0,\dots,e_{n-1}),&&\vec e
\end{align*}
---in handwriting, \fbox{$\oldvec e\,$}---, where each $e_k$ is in $2$.
We can now say precisely
\begin{equation}\label{eqn:CS}
  \CS=\bigcap_{n\in\upomega}\CS_n,
\end{equation}
where
\begin{equation}\label{eqn:F_n}
\CS_n=  \bigcup_{\vec e\in{}^n2}
  \left[\sum_{k\in n}\frac{2e_k}{3^{k+1}},
\sum_{k\in n}\frac{2e_k}{3^{k+1}}+\frac1{3^n}\right].
\end{equation}
In \textbf{ternary} (base-$3$) notation,
\begin{equation*}
  \sum_{k\in n}\frac{2e_k}{3^{k+1}}=0.d_1\cdots d_n,
\end{equation*}
where $d_{k+1}=2e_k$.
In this notation then,
from \eqref{eqn:CS01} and \eqref{eqn:CS2} we have
\begin{gather*}
  \CS_0=[0,1],\\
\CS_1=[0,0.1]\cup[0.2,1],\\
\CS_2=[0,0.01]\cup[0.02,0.1]
\cup[0.2,0.21]\cup[0.22,1],
\end{gather*}
and likewise
\begin{multline*}
  \CS_3=[0,0.001]\cup[0.002,0.01]
\cup[0.02,0.021]\cup[0.022,0.1]\\
\cup[0.2,0.201]\cup[0.202,0.21]
\cup[0.22,0.221]\cup[0.222,1].
\end{multline*}
Again, $\CS$ contains all of the endpoints here.
Some of these are shown in Figure \ref{fig:Cantor}.
\begin{figure}
\centering
\psset{xunit=1cm,yunit=15cm}
\begin{pspicture}(2,1)
\uput[l](0,0.5){$X$}
\uput[r](2,0.5){$\displaystyle\sum_{k\in X}\frac2{3^{k+1}}$}
\psdots(1,0)
(1,1)
(! 1 1 3 div)(! 1 2 3 div)
(! 1 1 9 div)(! 1 2 9 div)(! 1 7 9 div)(! 1 8 9 div)
(! 1 1 27 div)(! 1 2 27 div)(! 1 7 27 div)(! 1 8 27 div)(! 1 19 27 div)(! 1 20 27 div)(! 1 25 27 div)(! 1 26 27 div)
(! 1 1 81 div)(! 1 2 81 div)(! 1 7 81 div)(! 1 8 81 div)(! 1 19 81 div)(! 1 20 81 div)(! 1 25 81 div)(! 1 26 81 div)
(! 1 55 81 div)(! 1 56 81 div)(! 1 61 81 div)(! 1 62 81 div)(! 1 73 81 div)(! 1 74 81 div)(! 1 79 81 div)(! 1 80 81 div)
%(! 1 1 243 div)(! 1 2 243 div)(! 1 7 243 div)(! 1 8 243 div)(! 1 19 243 div)(! 1 20 243 div)(! 1 25 243 div)(! 1 26 243 div)
%(! 1 55 243 div)(! 1 56 243 div)(! 1 61 243 div)(! 1 62 243 div)(! 1 73 243 div)(! 1 74 243 div)(! 1 79 243 div)(! 1 80 243 div)
{%\relscale{1.1}
\uput[l](0,0){$\emptyset$}
\uput[r](2,0){$0$}
\uput[l](0,1){$\upomega$}
\uput[r](2,1){$1$}
}
\uput[l](! 0 1 3 div){$\upomega\setminus\{0\}$}
\uput[r](! 2 1 3 div){$0.1$}
\uput[l](! 0 2 3 div){$\{0\}$}
\uput[r](! 2 2 3 div){$0.2$}
{%\relscale{0.9}
\uput[l](! 0 1 9 div){$\upomega\setminus\{0,1\}$}
\uput[r](! 2 1 9 div){$0.01$}
\uput[l](! 0 2 9 div){$\{1\}$}
\uput[r](! 2 2 9 div){$0.02$}
\uput[l](! 0 7 9 div){$\upomega\setminus\{1\}$}
\uput[r](! 2 7 9 div){$0.21$}
\uput[l](! 0 8 9 div){$\{0,1\}$}
\uput[r](! 2 8 9 div){$0.22$}
}
{%\relscale{0.8}
\uput[l](! 0 1 27 div){$\upomega\setminus\{0,1,2\}$}
\uput[r](! 2 1 27 div){$0.001$}
\uput[l](! 0 2 27 div){$\{2\}$}
\uput[r](! 2 2 27 div){$0.002$}
\uput[l](! 0 7 27 div){$\upomega\setminus\{0,2\}$}
\uput[r](! 2 7 27 div){$0.021$}
\uput[l](! 0 8 27 div){$\{1,2\}$}
\uput[r](! 2 8 27 div){$0.022$}
\uput[l](! 0 19 27 div){$\upomega\setminus\{1,2\}$}
\uput[r](! 2 19 27 div){$0.201$}
\uput[l](! 0 20 27 div){$\{0,2\}$}
\uput[r](! 2 20 27 div){$0.202$}
\uput[l](! 0 25 27 div){$\upomega\setminus\{2\}$}
\uput[r](! 2 25 27 div){$0.221$}
\uput[l](! 0 26 27 div){$\{0,1,2\}$}
\uput[r](! 2 26 27 div){$0.222$}
}
\end{pspicture}
\caption{The Cantor set}\label{fig:Cantor}
\end{figure}
Since
\begin{equation*}
  \sum_{n\in\upomega}\frac2{3^{n+1}}=1,
\end{equation*}
we can replace terminal digits $1$
with $0$ followed by repeating $2$:
\begin{equation*}
  0.d_1\cdots d_n1
=0.d_1\cdots d_n0222\cdots
=0.d_1\cdots d_n0\overline2.
\end{equation*}
Thus each of the endpoints of a component interval of $\CS_n$
is a series
\begin{equation*}
  \sum_{k=0}^{\infty}\frac{2e_k}{3^{k+1}},
\end{equation*}
where each $e_k$ is in the set $2$.
Then the series is just
\begin{equation*}
  \sum_{k\in A}\frac2{3^{k+1}},
\end{equation*}
where $A$ is the subset $\{k\in\upomega\colon e_k=1\}$ of $\upomega$.

The set of subsets any set $A$ is the called the \textbf{power set} of $A$,
for reasons to be suggested by \eqref{eqn:why-pow}.
We shall denote the power set of $A$ by
\fbox{$\pow A$.}  Thus
\begin{equation}
  \label{eqn:pow}
  \pow A=\{X\colon X\included A\}=\{X\colon\Forall y(y\in X\implies y\in A)\}.
\end{equation}

\begin{theorem}\label{thm:CS}
  The Cantor set consists precisely of the points of the interval $[0,1]$
that can be written in ternary notation without use of the digit $1$.
That is,
\begin{equation*}
  \CS=\left\{\sum_{k\in X}\frac2{3^{k+1}}\colon X\in\powo\right\}.
\end{equation*}
\end{theorem}

\begin{proof}
Using \eqref{eqn:chain} and \eqref{eqn:CS},
and applying an infinitary De Morgan law, we compute
\begin{multline}\label{eqn:DeM}
  [0,1]\setminus\CS
=\CS_0\setminus\bigcap_{n\in\upomega}\CS_{n+1}
=\bigcup_{n\in\upomega}(\CS_0\setminus \CS_{n+1})\\
=\bigcup_{n\in\upomega}(\CS_n\setminus \CS_{n+1}).  
\end{multline}
In ternary notation, by \eqref{eqn:F_n},
\begin{equation*}
  \CS_0\setminus \CS_1=(0.1,0.2),
\end{equation*}
which is just the set of numbers in $[0,1]$
that need the digit $1$ in the first place after the point.
Likewise,
\begin{equation*}
  \CS_1\setminus \CS_2=(0.01,0.02)\cup(0.21,0.22),
\end{equation*}
consisting of numbers needing the digit $1$
not in the first place, but in the second place after the point.
In general,
\begin{equation*}
  \CS_n\setminus \CS_{n+1}=
\bigcup_{\vec e\in{}^n2}\left(\sum_{k\in n}\frac{2e_k}{3^{k+1}}+\frac1{3^{n+1}},
\sum_{k\in n}\frac{2e_k}{3^{k+1}}+\frac2{3^{n+1}}\right),
\end{equation*}
and so $[0,1]\setminus\CS$
consists of the points of $[0,1]$
that do need $1$ at any place in their ternary expansions.
\end{proof}

We now define a function $\gee$ from $\powo$ to $\R$ by
\begin{equation}\label{eqn:g}
\gee(A)=\sum_{k\in A}\frac2{3^{k+1}}.
\end{equation}
Then
\begin{equation*}
  \CS=\gee[\powo]=\{\gee(X)\colon X\in\powo\},
\end{equation*}
which is the \textbf{range} of $\gee$
or the \textbf{image} of $\powo$ under $\gee$.
Note that $\gee$ is increasing, in the sense that
\begin{equation}\label{eqn:inc}
  A\pincluded B\implies \gee(A)<\gee(B).
\end{equation}
Also $\gee$ is additive in the sense that
\begin{equation}\label{eqn:add}
  A\cap B=\emptyset
\implies \gee(A\cup B)=\gee(A)+\gee(B).
\end{equation}
Here we use the result from analysis
that the sum of an absolutely convergent series
is independent of the order of the terms.

The symbol \fbox{$\symdiff$}
denotes the operation of taking the \textbf{symmetric difference} of two sets,
so that
\begin{equation*}
  A\symdiff B=(A\setminus B)\cup(B\setminus A).
\end{equation*}
Then
\begin{equation}\label{eqn:symdiff}
  A=B\iff A\symdiff B=\emptyset.
\end{equation}

\begin{theorem}\label{thm:g}
  The function $\gee$ given by \eqref{eqn:g} is injective.
\end{theorem}

\begin{proof}
Suppose $A$ and $B$ are distinct subsets of $\upomega$.
Then $A\symdiff B\neq\emptyset$ by \eqref{eqn:symdiff},
and so, since $\upomega$ is well-ordered,
we may let
\begin{equation*}
m=\min(A\symdiff B).
\end{equation*}
Then
\begin{equation*}
  A\cap m=\{x\in A\colon x<m\}
=\{x\in B\colon x<m\}
=B\cap m.
\end{equation*}
We may assume $m\in B\setminus A$.  Then
\begin{gather*}
A\included(A\cap m)\cup\{x\in\upomega\colon x>m\},\\
(A\cap m)\cup\{m\}\included B,  
\end{gather*}
and so, by \eqref{eqn:inc} and \eqref{eqn:add},
\begin{equation*}
	\gee(A)\leq \gee(A\cap m)+\frac1{3^{m+1}}
<\gee(A\cap m)+\frac2{3^{m+1}}\leq \gee(B).
\end{equation*}
In short,
if $A\neq B$, then $\gee(A)\neq \gee(B)$.
Thus $\gee$ is injective.
\end{proof}


\section{Comparison of sets}

If there is a bijection from a set $A$ to a set $B$,
we shall write
\begin{equation*}
A\approx B,
\end{equation*}
and we shall say that $A$ and $B$ are \textbf{equipollent}
(words like ``equipotent'' are also used).
By Theorem \ref{thm:g} then,
\begin{equation}\label{eqn:powo-C}
  \powo\approx\CS.
\end{equation}
A set is called \textbf{countable}
if it is equipollent with a subset of $\upomega$
(possibly $\upomega$ itself).
We shall show presently that $\CS$ is not countable.

If there is an injection from $A$ to $B$,
that is, an embedding of $A$ in $B$, 
we may write simply
\begin{equation*}
  A\preccurlyeq B.
\end{equation*}
By Theorem \ref{thm:g} then,
\begin{equation*}
  \powo\preccurlyeq\R.
\end{equation*}
By definition
\begin{equation*}
  A\prec B\iff A\preccurlyeq B\And A\not\approx B.
\end{equation*}

\begin{Cantor}\label{thm:Cantor}
For all sets $A$,
\begin{equation*}
A\prec\pow A.
\end{equation*}
\end{Cantor}

\begin{proof}
The map $x\mapsto\{x\}$ embeds $A$ in $\pow A$.
Suppose some function $f$ embeds $A$ in $\pow A$.
Let
\begin{equation*}
  B=\{x\in A\colon x\notin f(x)\}.
\end{equation*}
Then $B\in\pow A$, and for all $c$ in $A$ we have
\begin{equation*}
  c\in B\iff c\notin f(c).
\end{equation*}
Thus $B\neq f(c)$.
This means $f$ is not surjective onto $\pow A$.
\end{proof}

By \eqref{eqn:powo-C} now,
\begin{equation*}
  \upomega\prec\CS,
\end{equation*}
and so $\CS$ is uncountable.
Note also that, for any set $A$,
\begin{equation}\label{eqn:why-pow}
  \pow A\approx{}^A2,
\end{equation}
since there is a bijection $X\mapsto\upchi_X$ 
from $\pow A$ to ${}^A2$ given by
\begin{equation}\label{eqn:chi}
  \upchi_B(x)=
  \begin{cases}
    1,\text{ if $x\in B$},\\
0,\text{ if $x\in A\setminus B$},
  \end{cases}
\end{equation}
where $B$ ranges over $\pow A$.
Here $\upchi$ is the minuscule Greek letter khi or chi,
standing for \emph{characteristic,}
since $\upchi_B$ can be called the \textbf{characteristic function} of $B$;
strictly this function depends on $A$ as well.
The inverse of $X\mapsto\upchi_X$ is
$\sigma\mapsto\sigma\inv(1)$,
where, if $i\in 2$,
\begin{equation}\label{eqn:sigma-inv}
  \sigma\inv(i)=\{k\in\upomega\colon\sigma(k)=i\}.
\end{equation}
By Cantor's Theorem,
\begin{equation*}
  A\prec{}^A2.
\end{equation*}
When $n\in\upomega$,
the size of the set ${}^n2$ is just $2^n$.
This, with \eqref{eqn:why-pow}, is why the power set is so called.
Cantor's Theorem is a generalization of the theorem that
$n<2^n$.

The proof of Cantor's Theorem
is similar to one proof that there are \emph{classes}\label{class} 
that are not sets.
In set theory,
a \textbf{class} 
is the collection
\begin{equation*}
  \{x\colon\phi(x)\}
\end{equation*}
of sets 
that satisfy a formula $\phi(x)$ of the language of set theory.
We shall not define formulas now, but shall only give examples.
\begin{compactitem}
  \item
For each set $A$,
\begin{equation*}
  A=\{x\colon x\in A\},
\end{equation*}
the class of elements of $A$.
Variables stand for sets;
thus the language of set theory requires all elements of sets to be sets.
Von Neumann's definition of the natural numbers
conforms to this convention:
numbers are sets, and their elements (which are other numbers) are sets.
\item
We let
\begin{equation*}
\universe=  \{x\colon x=x\},
\end{equation*}
the \textbf{universal class,}
consisting of all of the sets.
\item
For an arbitrary class $\bm D$,
generalizing \eqref{eqn:pow},
we let
\begin{equation*}
  \pow{\bm D}=\{x\colon x\included\bm D\},
\end{equation*}
the class of all subsets of $\bm D$.
\end{compactitem}
We now have
\begin{equation}\label{eqn:powV}
  \pow{\universe}=\universe.
\end{equation}

\begin{exercise}
Why does \eqref{eqn:powV} not contradict Cantor's Theorem?
\end{exercise}

\begin{RP}\label{thm:RP}
  The class $\{x\colon x\notin x\}$ 
of sets that are not elements of themselves cannot be a set.
\end{RP}

\begin{proof}
If we denote the class by $\bm R$,
then for every set $b$ we have
\begin{equation*}
  b\in\bm R\iff b\notin b,
\end{equation*}
and so $b\neq\bm R$.
Thus $\bm R$ is not a set.
\end{proof}

The conclusion of the Russell Paradox is that the class called $\bm R$ in the proof is a \textbf{proper class:}
a class that is not a set.
The \textbf{Separation Axiom}
is that every sub-class of a set is a set.
Since every class is a sub-class of the universal class $\universe$,
it follows that this too is a proper class.
But we already knew this from \eqref{eqn:powV} and Cantor's Theorem.

We now define a function $f$, like $\gee$ in \eqref{eqn:g},
from $\powo$ to $\R$.
We let
\begin{equation*}
f(A)=\sum_{k\in A}\frac1{2^{k+1}}.
\end{equation*}
Then $f(\emptyset)=0$ and $f(\upomega)=1$, and in general
\begin{equation*}
f(A)\in[0,1].
\end{equation*}
Indeed,
\begin{equation*}
  f[\powo]=[0,1],
\end{equation*}
since every number in the interval has a binary expansion.
However, some of these numbers have more than one binary expansion.
For example,
the equation $f(X)=\nicefrac12$ has two solutions,
$\{0\}$ and $\upomega\setminus\{0\}$;
so $f$ is not injective.
By the \textbf{Axiom of Choice,}
$f$ has a \emph{right inverse} $h$, which means
\begin{equation}\label{eqn:fha=a}
f\bigl(h(a)\bigr)=a
\end{equation}
for all $y$ in $[0,1]$.
Then $h$ is injective, so
\begin{equation}\label{eqn:01powo}
  [0,1]\preccurlyeq\powo.
\end{equation}
In fact we can make an explicit definition of $h$ once for all,
without needing the Axiom of Choice.
If $a\in[0,1]$, we define
\begin{equation*}
h(a)=\{k\in\upomega\colon a_k=1\},
\end{equation*}
where the $a_k$ are defined recursively by
\begin{equation*}
a_k=\begin{cases}
	0,&\text{ if }a<\displaystyle\sum_{i\in k}\displaystyle\frac{a_i}{2^{i+1}}
+\displaystyle\frac1{2^{k+1}},\\
	1,&\text{ if }a\geq\displaystyle\sum_{i\in k}\displaystyle\frac{a_i}{2^{i+1}}
+\displaystyle\frac1{2^{k+1}}.
\end{cases}
\end{equation*}
This ensures \eqref{eqn:fha=a}.
We have defined the $a_n$ so that,
for all $k$ in $\upomega$,
for some $n$ in $\upomega$, we have $k\leq n$ and $a_n=0$,
unless $a=1$.

We have
\begin{equation}\label{eqn:R01}
  \R\approx(0,1)
\end{equation}
because the function
\begin{equation*}
x\mapsto\frac{x-\nicefrac12}{x\cdot(1-x)},
\end{equation*}
restricted to $(0,1)$,
is a bijection onto $\R$,
as in Figure \ref{fig:xy}.
\begin{figure}
  \centering
  \psset{unit=20mm}
  \begin{pspicture}*(-2.2,-3.2)(3.2,3.2)
\psline[linestyle=dashed](1,-3.2)(1,3.2)
\psaxes[fillstyle=solid,fillcolor=white]%didn't work to make 1 show up
(0,0)(-2.2,-3.2)(3.2,3.2)
    \psplot{0.1}{0.9}{x 0.5 sub x div 1 x sub div}
    \psplot{-2.2}{-0.1}{x 0.5 sub x div 1 x sub div}
    \psplot{1.1}{3.2}{x 0.5 sub x div 1 x sub div}
  \end{pspicture}
  \caption{Graph of $y=\displaystyle\frac{x-\nicefrac12}{x\cdot(1-x)}$}
  \label{fig:xy}
\end{figure}
Indeed,
the inverse can be computed as
\begin{equation*}
y\mapsto
\frac12+\frac12\cdot\frac{\sqrt{1+y^2}-1}y
\end{equation*}
away from $0$.
This is by the computations
\begin{gather*}
y=\frac{x-\nicefrac12}{x\cdot(1-x)},\\
yx-yx^2=x-\nicefrac12,\\
yx^2+(1-y)x-\nicefrac12=0,\\
x=\frac{y-1\pm\sqrt{(1-y)^2+2y}}{2y}=\frac{y-1\pm\sqrt{1+y^2}}{2y},
\end{gather*}
and we let the ambiguous sign $\pm$ be $+$ to put $x$ in the interval $(0,1)$.
In sum,
by \eqref{eqn:powo-C}, \eqref{eqn:R01}, and \eqref{eqn:01powo},
\begin{equation}\label{eqn:string}
  \powo\approx\CS\included\R\approx(0,1)\included[0,1]\preccurlyeq\powo.
\end{equation}
By the next theorem, we shall be able to conclude
\begin{equation}\label{eqn:R=powo}
  \R\approx\powo.
\end{equation}

\begin{CSB}\label{thm:CSB}
If $A\preccurlyeq B$ and $B\preccurlyeq A$, then
\begin{equation*}
A\approx B.
\end{equation*}
\end{CSB}

\begin{proof}
Suppose $f$ is an injection from $A$ to $B$;
and $g$, from $B$ to $A$.
By recursion, we define
\begin{align*}
 &\begin{gathered}
    A_0=A\setminus g[B],\\
A_{n+1}=g[B_n],
  \end{gathered}&
  &\begin{gathered}
B_0=B\setminus f[A],\\
B_{n+1}=f[A_n].
\end{gathered}
\end{align*}
See Figure \ref{fig:CSB}.%
\begin{figure}
 \centering%\relscale{1.2}
%\renewcommand{\arraystretch}{2}
\newcommand{\mybox}{\psframebox}
\psset{framearc=0.5}
 \begin{tabular}{lr}
\mybox{\parbox{4cm}{\centering$A$}}
&
\mybox{\parbox{4cm}{\centering$B$}}
\\
\vphantom{X}&\\
  \mybox{\parbox{4cm}{\centering$A_0$\\
\mybox{\parbox{3.5cm}{\centering$g[B]$}}}}
&
  \mybox{\parbox{4cm}{\centering$B_0$\\
\mybox{\parbox{3.5cm}{\centering$f[A]$}}}}
\\
\vphantom{X}&\\
  \mybox{\parbox{4cm}{\centering$A_0$\\
\mybox{\parbox{3.5cm}{\centering$A_1$\\
\mybox{\parbox{3cm}{\centering$g\bigl[f[A]\bigr]$}}}}}}
&
  \mybox{\parbox{4cm}{\centering$B_0$\\
\mybox{\parbox{3.5cm}{\centering$B_1$\\
\mybox{\parbox{3cm}{\centering$f\bigl[g[B]\bigr]$}}}}}}
\\
\vphantom{X}&\\
  \mybox{\parbox{4cm}{\centering$A_0$\\
\mybox{\parbox{3.5cm}{\centering$A_1$\\
\mybox{\parbox{3cm}{\centering$A_2$\\
\mybox{\parbox{2.5cm}{\centering$g\Bigl[f\bigl[g[B]\bigr]\Bigr]$}}}}}}}}
&
  \mybox{\parbox{4cm}{\centering$B_0$\\
\mybox{\parbox{3.5cm}{\centering$B_1$\\
\mybox{\parbox{3cm}{\centering$B_2$\\
\mybox{\parbox{2.5cm}{\centering$f\Bigl[g\bigl[f[A]\bigr]\Bigr]$}}}}}}}}
 \end{tabular}
 \caption{Cantor--Schr\"oder--Bernstein Theorem}
  \label{fig:CSB}
\end{figure}
By induction,
we prove
\begin{align*}
  A_n&\included A\setminus\bigcup_{k<n}A_k,&
  B_n&\included B\setminus\bigcup_{k<n}B_k.
\end{align*}
This is clear when $n=0$,
and if true when $n=m$, then for example
\begin{equation*}
B_{m+1}\included f[A]\setminus\bigcup_{k<m}B_{k+1},  
\end{equation*}
but the latter is $B\setminus\bigcup_{k<m+1}B_k$,
since
\begin{equation}\label{eqn:f[A]}
 f[A]=B\setminus B_0. 
\end{equation}
Then also, not by induction,
\begin{equation*}
A_{2n}\cup A_{2n+1}\approx B_{2n+1}\cup B_{2n},
\end{equation*}
and therefore
\begin{equation*}
\bigcup_{n\in\upomega}A_n
\approx\bigcup_{n\in\upomega}B_n.
\end{equation*}
Finally,
\begin{equation*}
A\setminus\bigcup_{n\in\upomega}A_n
\approx B\setminus\bigcup_{n\in\upomega}B_n,
\end{equation*}
since
\begin{multline*}
f\left[A\setminus\bigcup_{n\in\upomega}A_n\right]
=f\left[A\setminus\bigcup_{n\in\upomega}\bigcup_{k<n}A_n\right]\\
=f\left[\bigcap_{n\in\upomega}\left(A\setminus\bigcup_{k<n}A_n\right)\right]
=\bigcap_{n\in\upomega}f\left[A\setminus\bigcup_{k<n}A_k\right]\\
=\bigcap_{n\in\upomega}\left(B\setminus\bigcup_{k\leq n}B_k\right)
=B\setminus\bigcup_{n\in\upomega}B_n,
\end{multline*}
by an infinitary De Morgan law as in \eqref{eqn:DeM},
and \eqref{eqn:f[A]}.
\end{proof}

%Now \eqref{eqn:string} gives us \eqref{eqn:R=powo}.


\chapter{Topology}

\section{Open and closed sets}

We shall study how to generalize the following 
into the Cantor Intersection Theorem.

\begin{lemma}\label{lem:Fc}
  If a sequence $(F_n\colon n\in\upomega)$
of closed, bounded intervals compose a decreasing chain,
then
\begin{equation*}
  \bigcap_{n\in\upomega}F_n\neq\emptyset.
\end{equation*}
\end{lemma}

\begin{proof}
  We can write each $F_n$ as $[a_n,b_n]$.
Then the sequence $(a_n\colon n\in\upomega)$
is bounded and increasing, so it converges.
Let
\begin{equation}
  \label{eqn:lim}
  \lim_{n\to\infty}a_n=c.
\end{equation}
Since
\begin{equation}\label{eqn:acb}
  a_0\leq a_1\leq a_2\leq\cdots\leq c\leq\cdots\leq b_2\leq b_1\leq b_0,
\end{equation}
$c$ belongs to each $F_n$.
\end{proof}

In the proof, we still get \eqref{eqn:acb},
provided each $F_n$ is bounded, so that we can define
\begin{align*}
  a_n&=\inf F_n,&b_n&=\sup F_n.
\end{align*}
If we also have $a_n\in F_n$, 
then because the $F_n$ compose a decreasing chain, we can conclude
\begin{equation*}
  \{a_n\colon n\geq k\}\included F_k.
\end{equation*}
What property do the $F_k$ need so that,
from \eqref{eqn:lim}, we can conclude $c\in F_k$?
It will be the property of being \emph{closed.}

Suppose $A\included\R$ and $b\in A$.
We may denote the \textbf{complement,} $\R\setminus A$, of $A$ in $\R$ by
\begin{equation*}
  A\comp.
\end{equation*}
There are two possibilities.
\begin{compactenum}
  \item
If, for some positive $\epsilon$,
\begin{equation*}
  (b-\epsilon,b+\epsilon)\included A,
\end{equation*}
then $b$ is called an \textbf{interior point} of $A$.
\item
In the other case, for all positive $\epsilon$,
\begin{equation*}
  (b-\epsilon,b+\epsilon)\cap A\comp\neq\emptyset,
\end{equation*}
and now $b$ is a \textbf{limit point} of $A\comp$.
In this case, $b$ is also a limit point of $A\comp\cup\{b\}$.
\end{compactenum}
As a special case,
if the sequence $(a_n\colon n\in\upomega)$
is not eventually constant, and \eqref{eqn:lim} holds,
then $c$ is a limit point of the set $\{a_n\colon n\in\upomega\}$
and therefore of any set that includes this one.

A subset of $\R$ is called
\begin{compactenum}[(1)]
  \item
\textbf{open,} if its every point is an interior point;
\item
\textbf{closed,} if it contains all of its limit points.
\end{compactenum}
Now Lemma \ref{lem:Fc} generalizes, as discussed.

\begin{CI}\label{thm:CI}\sloppy
Every decreasing chain
of nonempty, closed, bounded subsets of $\R$
has nonempty intersection.
\end{CI}

We aim to characterize open and closed sets.
Generalizing notation already used,
for any \emph{family} $\mathscr A$ of sets,
we define
\begin{gather*}
  \bigcup\mathscr A=\{x\colon\Exists Y(Y\in\mathscr A\And x\in Y)\},\\
  \bigcap\mathscr A=\{x\colon\Forall Y(Y\in\mathscr A\implies x\in Y)\};
\end{gather*}
these are the \textbf{union} and \textbf{intersection} of $\mathscr A$,
respectively.
A \textbf{family} is just a set whose elements are sets
whose own elements will be of interest to us.

\begin{theorem}\label{thm:open}
A subset of $\R$ is open if and only if 
it is the union of a family of open intervals.
\end{theorem}

\begin{proof}
Open intervals contain all of their interior points,
and therefore a union of open intervals does the same.

Conversely, for every open set $A$, for every $b$ in $A$,
writing
\begin{equation*}
  E_{A,b}=\{\epsilon\colon\epsilon>0\And(b-\epsilon,b+\epsilon)\included A\},
\end{equation*}
we have
\begin{equation}\label{eqn:A}
A=
\bigcup\bigl\{(b-\epsilon,b+\epsilon)\colon 
b\in A\And\epsilon\in E_{A,b}\bigr\},
%\bigcup_{b\in A}\bigcup_{\epsilon\in E_{A,b}}(b-\epsilon,b+\epsilon),
\end{equation}
a union of open intervals.
\end{proof}

The set $\Q$ of rational numbers,
and therefore the product $\Q\times\Q$, are countable,
and $\Q$ is \textbf{dense} in $\R$, 
in the sense that every interval contains an element of $\Q$.

\begin{exercise}
Show that the family of open intervals in Theorem \ref{thm:open} 
can be required to be countable, because,
still assuming $A$ is open, 
we can rewrite \eqref{eqn:A} as
\begin{equation*}
  A=
\bigcup\bigl\{(b-\epsilon,b+\epsilon)\colon
b\in A\cap\Q\And\epsilon\in E_{A,b}\cap\Q\bigr\}.
%\bigcup_{b\in A\cap\Q}\bigcup_{\epsilon\in E_{A,b}\cap\Q}(b-\epsilon,b+\epsilon).
\end{equation*}
\end{exercise}

\begin{theorem}\label{thm:closed}
In $\R$,
  \begin{compactenum}[(1)]
    \item
if $A$ and $B$ are closed, so is $A\cup B$;
\item
if $\mathscr F$ is a family of closed sets, then $\bigcap\mathscr F$ is closed;
\item
every closed set is the intersection of a family,
each of whose elements is the union of finitely many closed intervals.
  \end{compactenum}
\end{theorem}

\begin{exercise}
  Prove the theorem.
\end{exercise}

In the theorem, 
the intersection of the empty family should be understood as $\R$;
the union of the empty family is the empty set.
Thus $\R$ and $\emptyset$ are closed.
Each of them being the complement of the other,
they are also open.

According to Theorem \ref{thm:closed},
the closed intervals of $\R$
compose a \textbf{sub-basis,}
and their finite unions compose a \textbf{basis,}
for a \textbf{topology} of closed sets on $\R$.
By Theorem \ref{thm:open}, 
the open intervals compose a basis of open sets for the same topology.
For a precise definition,
some writers define a topology on a set 
to be the family of subsets that are to be called open;
other writers, the family of subsets called closed.
In any case, a set with a topology is called a \textbf{topological space,}
and it has open and closed subsets meeting the conditions discussed:
\begin{compactitem}
  \item
finite unions of closed sets are closed,
\item
arbitrary intersections of closed sets are closed,
\end{compactitem}
and complementarily,
\begin{compactitem}
  \item
finite intersections of open sets are open,
\item
arbitrary unions of open sets are open,
\end{compactitem}

\section{Clopen sets}

In any topological space,
being the union of the empty set of open sets,
the empty set is open;
being the union of the empty set of closed sets,
it is closed.
Then the whole space is also open and closed.
We call such sets \textbf{clopen.}

\begin{theorem}\label{thm:R-clopen}
  The only clopen subsets of $\R$ are $\R$ and $\emptyset$.
\end{theorem}

\begin{proof}
  Suppose $A\included\R$ and $b\in A$, but $c\in A\comp$.
We may assume $b<c$.
If $b$ is a limit point of $A\comp$,
then $A$ is not open.
If $b$ is an interior point of $A$, let
\begin{equation*}
  d=\sup\{\epsilon\colon\epsilon>0\And[b,b+\epsilon)\included A\}.
\end{equation*}
Then $d$ is a limit point of both $A$ and $A\comp$,
so one of these is not closed.
\end{proof}

The intersection of an open subset of $\R$
with $\CS$ is called open in $\CS$;
it might not be open in $\R$
(in fact it will not be, unless it is empty).
The intersection of a closed subset of $\R$
with $\CS$ is called closed in $\CS$,
but it is still closed in $\R$ anyway.
In this way we obtain a topology on $\CS$,
namely the \textbf{subspace topology} inherited from $\R$.

Let us recall that $\CS$ is the intersection of the sets $\CS_n$ 
as in \eqref{eqn:CS}, where
\begin{equation}\label{eqn:Fn}
  \CS_n=\bigcup_{\vec e\in{}^2n}I_{\vec e},
\end{equation}
where
\begin{equation}\label{eqn:I}
  I_{\vec e}=\left[a_{\vec e},a_{\vec e}+\frac1{3^n}\right],
\end{equation}
where we have
\begin{equation}\label{eqn:a}
  a_{\vec e}=\sum_{k\in n}\frac{2e_k}{3^{k+1}}.
\end{equation}
Let us write
\begin{equation}\label{eqn:o>2}
  {}^{\upomega>}2=\bigcup_{n\in\upomega}{}^n2.
\end{equation}
If $\vec e\in{}^{\upomega>}2$, let us define
\begin{equation}\label{eqn:Fe}
  \CSclo_{\vec e}=I_{\vec e}\cap\CS.
\end{equation}
Each of these is immediately closed in $\CS$.

\begin{theorem}\label{thm:C-clopen}
The subsets $\CSclo_{\vec e}$ of $\CS$ are open 
and compose a basis of open sets for the subspace topology on $\CS$
inherited from $\R$.
\end{theorem}

\begin{proof}
  For each $n$ in $\upomega$,
  \begin{equation*}
    \CS=\bigcup_{\vec e\in{}^n2}\CSclo_{\vec e}.
  \end{equation*}
Since ${}^n2$ is finite,
and the sets $\CSclo_{\vec e}$ are disjoint from one another,
the complement of each of these is closed,
so each is open as well as closed.

Now let $U$ be an open subset of $\R$.
For every $a$ in $\CS\cap U$,
for some positive $\epsilon$,
\begin{equation*}
  (a-\epsilon,a+\epsilon)\included U.
\end{equation*}
With $\gee$ as in \eqref{eqn:g},
we know by Theorem \ref{thm:CS} that $a$ is $\gee(A)$
for some subset $A$ of $\upomega$.  Thus
\begin{equation*}
  a=\sum_{k\in A}\frac2{3^{k+1}}.
\end{equation*}
For any $n$ in $\upomega$,
by \eqref{eqn:inc},
\begin{multline*}
  \gee(A\cap n)\leq a\leq \gee(A\cap n)+\gee(\{x\in\upomega\colon x\geq n\})\\
=\gee(A\cap n)+\frac1{3^n}.
\end{multline*}
Now let $\vec e$ in ${}^n2$ be such that
\begin{equation*}
  \gee(A\cap n)=a_{\bm e}
\end{equation*}
as in \eqref{eqn:a}.
With $I_{\bm e}$ as in \eqref{eqn:I},
and now requiring $n$ to be so large that $3^n>\nicefrac1{\epsilon}$,
we have
\begin{equation*}
  I_{\bm e}\included(a-\epsilon,a+\epsilon),
\end{equation*}
and so
\begin{equation*}
  \CSclo_{\bm e}\included U\cap\CS.
\end{equation*}
Since also $a\in \CSclo_{\bm e}$, and $a$ was an arbitrary element of $U\cap\CS$,
this is a union of various sets $\CSclo_{\bm e}$.
\end{proof}

We now know that unions of finite subsets of
\begin{equation*}
  \{\CSclo_{\vec e}\colon\vec e\in{}^{\upomega>}2\}
\end{equation*}
are clopen subsets of $\CS$.
We aim to show the converse.
If $E$ is a clopen subset of $\CS$,
so that, being open, $E$ is a union of \emph{some} family $\mathscr U$
of sets $\CSclo_{\vec e}$,
we shall show that,
being closed, $E$ is $\bigcup\mathscr U_0$
for some \emph{finite} subset $\mathscr U_0$ of $\mathscr U$.

\section{Compactness}

If a topological space is the union of a certain family of open subsets,
this family is called an \textbf{open cover} of the space.
If some finite subset of the family also covers the space,
that subset is called a \textbf{finite sub-cover.}
If every open cover of a space has a finite sub-cover,
then the space itself is called \textbf{compact}.\label{compact}

Easily, 
every closed subset of a compact space is compact in the subspace topology,
since an open cover of the subset, together with the complement of the subset,
yields an open cover of the whole space.

There is an equivalent definition of compactness in terms of closed sets.
A family of subsets of a topological space
whose every finite subset has nonempty intersection
is said to have the \textbf{Finite Intersection Property}\label{FIP}
or \textbf{FIP.}
Then the space is compact if and only if
every family of subsets with FIP
has nonempty intersection.

\begin{HB}\label{thm:HB}
Every closed bounded subset of $\R$ is compact in the subspace topology.
\end{HB}

\begin{proof}
For reasons discussed,
it is enough to show that an interval $[a,b]$ is compact.
Writing this interval as $I_0$,
we let $\mathscr F$ be a collection of closed subsets of $I_0$
that has FIP.
Let $c=\frac12(a+b)$, so that
\begin{equation*}
  a<c<b.
\end{equation*}
One of the intervals $[a,c]$ and $[c,b]$
is an interval $I_1$ such that the family
$\mathscr F\cup\{I_1\}$ 
has FIP.  
For, suppose $I_1$ cannot be $[a,c]$.
Then for some finite subset $\mathscr F_0$ of $\mathscr F$,
\begin{equation*}
  \bigcap\mathscr F_0\cap[a,c]=\emptyset.
\end{equation*}
But then for every finite subset $\mathscr F_1$ of $\mathscr F$,
since
\begin{equation*}
\bigcap\left(\mathscr F_0\cup\mathscr F_1\right)
=\bigcap\mathscr F_0\cap\bigcap\mathscr F_1\neq\emptyset
\end{equation*}
(note that the signs are correct,
and we are not applying a De Morgan law),
we must have
\begin{equation*}
  \bigcap\mathscr F_0\cap\bigcap\mathscr F_1\cap[c,b]\neq\emptyset.
\end{equation*}
Thus $\mathscr F\cup\{[c,b]\}$ must have FIP.

Continuing in this way, 
we obtain a decreasing chain of closed intervals $I_n$ such that
\begin{equation}
  \label{eqn:mu}
\upmu(I_n)=\frac1{2^n}\upmu(I_0),
\end{equation}
and each family $\mathscr F\cup\{I_n\}$ has FIP.
By the Cantor Intersection Theorem,
or just Lemma \ref{lem:Fc},
$\bigcap_{n\in\upomega}I_n$ contains a point $d$.
By \eqref{eqn:mu} then,
\begin{equation*}
  \bigcap_{n\in\upomega}I_n=\{d\}.
\end{equation*}
Then $d$ must be in $\bigcap\mathscr F$.
For, if it is not, then some $E$ in $\mathscr F$ does not contain $d$.
Since $E$ is closed, $d$ is not a limit point of it,
and so for some positive $\epsilon$,
\begin{equation*}
  E\cap(d-\epsilon,d+\epsilon)=\emptyset.
\end{equation*}
If $n$ is so large that $\upmu(I_n)<\epsilon$, then
\begin{equation*}
  \bigcap\{E,I_n\}=\emptyset,
\end{equation*}
contradicting that $\mathscr F\cup\{I_n\}$ has FIP.
\end{proof}

For reasons discussed,
we now know that the clopen subsets of $\CS$
are just the finite unions of sets $\CSclo_{\bm e}$ as in \eqref{eqn:Fe}.

\section{Continuity}

One way that notion of compactness arises in mathematics is as follows.
On a subset $A$ of $\R$, a function $f$ is \textbf{continuous} if
\begin{multline*}
  \Forall{\epsilon}
\biggl(\epsilon>0\implies\Forall x
\Bigl(x\in A\implies\Exists{\delta}
\bigl(\delta>0\And\Forall y\\
(y\in A\And\abs{x-y}<\delta\implies\abs{f(x)-f(y)}<\epsilon)
\bigr)
\Bigr)
\biggr),
\end{multline*}
while $f$ is \textbf{absolutely continuous} if
\begin{multline*}
  \Forall{\epsilon}
\biggl(\epsilon>0\implies
\Exists{\delta}
\Bigl(\delta>0\And
\Forall x
\bigl(x\in A\implies\Forall y\\
(y\in A\And\abs{x-y}<\delta\implies\abs{f(x)-f(y)}<\epsilon)
\bigr)
\Bigr)
\biggr).
\end{multline*}
Note that I write
\begin{gather*}
  \Forall{\epsilon}(\epsilon>0\implies\dots
\text{ rather than }\Forall{(\epsilon>0)}\dots,\\
\Exists{\delta}(\delta>0\And\dots
\text{ rather than }\Exists{(\delta>0)}\dots
\end{gather*}

\begin{exercise}
  Using the Heine--Borel Theorem,
prove that, if $A$ is closed and bounded,
then every function that is continuous on $A$
is uniformly continuous on $A$.
\end{exercise}

It will be useful to note that continuity\label{continuity} 
of $f$ on $A$
is equivalent to the requirement that,
for every open set $U$, $f\inv(U)$ be open,
and similarly for closed sets.

\section{K\"onig's Lemma}

If $\vec e\in{}^n2$,
so that the domain of $\vec e$ is $n$, 
we may write
\begin{equation*}
  \dom(\vec e)=n.
\end{equation*}
If $m\leq n$, then
\begin{equation}\label{eqn:rest}
  \vec e\restriction m=(e_0,\dots,e_{m-1}),
\end{equation}
and we may write
\begin{equation*}
  \vec e\restriction m\included\vec e.
\end{equation*}
When understood to be ordered by inclusion in this way, 
the set ${}^{\upomega>}2$ defined by \eqref{eqn:o>2}
is a \textbf{binary tree} of height $\upomega$.
Note that ${}^02$ has the single element $\emptyset$.
For elements of the binary tree,
we may use notation as in \eqref{eqn:rest},
so that if $\sigma\in{}^{\upomega}2$ and $n\in\upomega$,
we write
\begin{equation*}
  \sigma\restriction n=  (\sigma(0),\dots,\sigma(n-1)).
\end{equation*}
If $\vec e\in{}^n2$ and $i\in2$,
we may write
\begin{equation*}
  (\vec e,i)=(e_0,\dots,e_{n-1},i),
\end{equation*}
an element of ${}^{n+1}2$.
In our proof of the Heine--Borel Theorem,
we work with the binary tree
\begin{equation*}
  (I_{\vec e}\colon\vec e\in{}^{\upomega>}2),
\end{equation*}
where $I_{\emptyset}$ is the closed interval $[a,b]$,
and each $I_{\vec e}$ is divided at its midpoint
into the closed intervals $I_{(\vec e,0)}$ and $I_{(\vec e,1)}$.
To be precise, if again $\vec e\in{}^n2$, then
\begin{equation*}
  I_{\vec e}=\left[c_{\vec e},c_{\vec e}+\frac{b-a}{2^n}\right],
\end{equation*}
where
\begin{equation*}
c_{\vec e}=a+(b-a)\cdot\sum_{k\in n}\frac{e_k}{2^{k+1}},
\end{equation*}
so that
\begin{align*}
  I_{\vec e}&=I_{(\vec e,0)}\cup I_{(\vec e,1)},&
  c_{(\vec e,0)}+\frac{b-a}{2^{n+1}}&=c_{(\vec e,1)}.
\end{align*}
We find $\sigma$ in ${}^{\upomega>}2$ such that,
for each $n$ in $\upomega$, the family
\begin{equation*}
  \mathscr F\cup\{I_{\sigma\restriction n}\}
\end{equation*}
has FIP.
We can do this because,
if $\mathscr F\cup\{I_{\vec e}\}$ has FIP,
then so does one of
$\mathscr F\cup\{I_{(\vec e,0)}\}$ 
and $\mathscr F\cup\{I_{(\vec e,1)}\}$.
The same idea yields the following.

\begin{KL}\label{thm:KL}
  If $T$ is an infinite subset of ${}^{\upomega}2$,
then for some $\sigma$ in ${}^{\upomega}2$,
the set
\begin{equation*}
  \{n\in\upomega\colon\sigma\restriction n\in T\}
\end{equation*}
is infinite.
More generally,
every infinite \emph{finitely branching tree}
has an infinite branch.
\end{KL}

\begin{proof}
  If, for some $n$ in $\upomega$,
for some $\vec e$ in ${}^n2$,
the set
\begin{equation*}
  \{\vec x\in T\colon\vec e\included\vec x\}
\end{equation*}
is infinite, then, for some $i$ in $2$, the set
\begin{equation*}
  \{\vec x\in T\colon(\vec e,i)\included\vec x\}
\end{equation*}
must be infinite, since
\begin{equation*}
  \{\vec x\in T\colon\vec e\included\vec x\}
\included
\{\vec e\}\cup\bigcup_{i\in2}\{\vec x\in T\colon(\vec e,i)\included\vec x\}.
\end{equation*}
If perhaps not $2$, but a finite number of elements of the tree
are immediately above a given element,
the same argument works.
\end{proof}

In the same way, we can prove directly that $\CS$ is compact.
For suppose $\mathscr F$ is a family of subsets of $\CS$
having FIP.
In the notation of \eqref{eqn:Fe},
we have
\begin{equation*}
  \CS=\CSclo_{\emptyset},
\end{equation*}
and for all $n$ in $\upomega$,
for all $\vec e$ in ${}^n2$,
\begin{equation*}
  \CSclo_{\vec e}=\CSclo_{(\vec e,0)}\cup \CSclo_{(\vec e,1)}.
\end{equation*}
Then trivially 
$\mathscr F\cup\{\CSclo_{\emptyset}\}$ has FIP,
and if
$\mathscr F\cup\{\CSclo_{\vec e}\}$ has FIP,
then so must
$\mathscr F\cup\{\CSclo_{(\vec e,i)}\}$ for some $i$ in $2$.
Hence for some $\sigma$ in ${}^{\upomega}2$,
for each $n$ in $\upomega$, each set
$\mathscr F\cup\{\CSclo_{\sigma\restriction n}\}$ has FIP.
Since, with $\gee$ as in \eqref{eqn:g},
with $\sigma\inv$ as in \eqref{eqn:sigma-inv}
we have
\begin{equation*}
  \bigcap_{n\in\upomega}\CSclo_{\sigma\restriction n}
=\left\{\sum_{\sigma(k)=1}\frac2{3^{k+1}}\right\}
=\left\{\gee(\sigma\inv(1))\right\},
\end{equation*}
we can conclude as before
\begin{equation*}
  \gee(\sigma\inv(1))\in\bigcap\mathscr F.
\end{equation*}

\section{Tychonoff topology}

As in \eqref{eqn:g} 
we defined the map $\gee$ from $\powo$ to $\R$
that turned out,
by Theorems \ref{thm:CS} and \ref{thm:g}, to be a bijection onto $\CS$,
so now we let $\Gee$ be the bijection from ${}^{\upomega}2$ to $\CS$
given by
\begin{equation*}
  \Gee(\sigma)=\sum_{k\in\upomega}\frac{2\sigma(k)}{3^{k+1}}.
\end{equation*}
For each $n$ in $\upomega$,
for each $i$ in $2$,
let us define
\begin{equation*}
  E_{n\;i}=\{\sigma\in{}^{\upomega}2\colon\sigma(n)=i\},
\end{equation*}
so that
\begin{equation*}
  \Gee[E_{n\;i}]=\bigcup_{\vec e\in{}^n2}\CSclo_{(\vec e,i)},
\end{equation*}
and also,
for each $\vec e$ in ${}^n2$,
\begin{equation*}
  \Gee\inv(\CSclo_{\vec e})
=\{\sigma\in{}^{\upomega}2\colon\sigma\restriction n=\vec e\}
=\bigcap_{k\in n}E_{k\;e_k}.
\end{equation*}
Therefore the sets $E_{n\;i}$ compose a sub-basis of closed sets
for a topology on ${}^{\upomega}2$
in which $\Gee$ is a \textbf{homeomorphism} onto $\CS$.
This means $\Gee$ is a bijection,
and both $\Gee$ and $\Gee\inv$ are \emph{continuous.}
Generalizing from the description of continuity on page \pageref{continuity},
we define a function $f$ from one topological space to another to be 
\textbf{continuous}
if $f\inv(F)$ is closed for every closed set $F$.

We give the set $2$ the topology in which every subset is closed.
Then the topology on ${}^{\upomega}2$ is the \textbf{product topology}
or \textbf{Tychonoff topology} for the following reason.

If $(\Omega_i\colon i\in I)$ is an indexed family of topological spaces,
we define the product
\begin{equation*}
  \prod_{i\in I}\Omega_i
\end{equation*}
as the set of functions $f$ from $I$ to $\bigcup_{i\in I}\Omega_i$
such that, for each $i$ in $I$,
\begin{equation*}
  f(i)\in\Omega_i.
\end{equation*}
If we denote the product by $\Omega$,
we can define, for each $i$ in $I$,
the function $\uppi_i$ from $\Omega$ to $\Omega_i$ given by
\begin{equation*}
  \uppi_i(f)=f(i).
\end{equation*}
Here $\Omega$ is the capital Greek letter Omega.%%%%%
\footnote{Often the Capital letter $X$ is used for a topological space,
but I prefer to use that letter as a variable for sets.}
%%%%%%%%%%%%%%%%%%%%%%%%%%
The Tychonoff topology on $\Omega$ 
is the weakest topology in which each function $\uppi_i$ is continuous.
This means that the sets $\uppi_i{}\inv(F)$,
where $F$ ranges over the closed subsets of $\Omega_i$,
where $i$ ranges over $I$,
compose a sub-basis of closed subsets of $\Omega$.
In the special case when $I$ is $\upomega$,
and each $\Omega_i$ is $2$,
we recover the topology on ${}^{\upomega}2$ that we have already defined.

\begin{TT}\label{thm:TT}
  Every product of compact spaces is compact in the Tychonoff topology.
\end{TT}

\begin{proof}
In the notation above,
let $\mathscr F$ be family of closed subsets of $\Omega$
that has FIP.
Each element $F$ of $\mathscr F$ 
is the intersection of a family $\mathscr E_F$ of sub-basic closed subsets.
Now let
\begin{equation*}
  \mathscr F^*=\bigcup_{F\in\mathscr F}\mathscr E_F.
\end{equation*}
This too has FIP, and
\begin{equation*}
  \bigcap\mathscr F^*=\bigcap\mathscr F.
\end{equation*}
Suppose now $\mathscr F^*$ contains
\begin{equation*}
  \bigcup_{k\in n}\uppi_{i(k)}{}\inv(F_k)
\end{equation*}
for some $(i(k)\colon k\in n)$ in ${}^nI$
and some closed subset $F_k$ of $\Omega_{i(k)}$ for each $k$ in $n$.
As before, for some $k$ in $n$, the set
\begin{equation*}
  \mathscr F^*\cup\{\uppi_{i(k)}{}\inv(F_k)\}
\end{equation*}
must have FIP; moreover,
the intersection of this set is included in $\bigcap\mathscr F^*$ itself.
By continuing in this way---%
strictly we use \textbf{Zorn's Lemma,}
which follows from the Axiom of Choice)---,
we obtain a set $\mathscr G$ with FIP such that
\begin{equation*}
  \bigcap\mathscr G\included\bigcap\mathscr F^*,
\end{equation*}
and whose every element is, for some $i$ in $I$, 
of the form $\uppi_i{}\inv(F)$,
where $F$ is a closed subset of $\Omega_i$.
For each $i$ in $I$,
let $\mathscr G_i$ consist of the closed subsets $F$ of $\Omega_i$
such that $\uppi_i{}\inv(F)$ belongs to $\mathscr G$.
Then $\mathscr G_i$ has FIP,
so $\bigcap\mathscr G_i$ has an element $a_i$,
if we assume $\Omega_i$ is compact.  Then
\begin{equation*}
  (a_i\colon i\in I)\in\bigcap\mathscr G.\qedhere
\end{equation*}
\end{proof}

\chapter{Algebra}

\section{Logic}

The Tychonoff topology on ${}^{\upomega}2$ 
arises independently in propositional logic as follows.

Starting with a collection $\{P_k\colon k\in\upomega\}$
of \textbf{(propositional) variables,}
we define \textbf{(propositional) formulas} recursively:
\begin{compactenum}
\item
Each variable is a formula,
namely an \textbf{atomic} formula.
\item
If $F$ is a formula, then so is $\lnot G$,
the \textbf{negation} of $F$.
\item
If $F$ and $G$ are formulas, then so is $(F\land G)$,
the \textbf{conjunction} of $F$ and $G$.
\end{compactenum}
Let us denote by
\begin{equation*}
  \Ell
\end{equation*}
the set of propositional formulas so defined.
Then for example,
if $\Ell$ contains $F$ and $G$,
then it contains
\begin{equation*}
  \lnot(\lnot F\land\lnot G),
\end{equation*}
which is the \textbf{disjunction} of $F$ and $G$;
we may denote this by $(F\lor G)$.
Then the expression
\begin{equation*}
  (\lnot F\lor G)
\end{equation*}
stands for another formula in $\Ell$, denoted by $F\lto G$.
Officially though,
$\Ell$ is the smallest set that includes $\{P_k\colon k\in\upomega\}$
and is closed under the operations $F\mapsto\lnot F$
and $(F,G)\mapsto(F\land G)$.

\begin{lemma}\label{lem:UR}
Every formula in $\Ell$ is \textbf{uniquely readable:}
\begin{compactenum}[1)]
\item
no atomic formula is also a negation or a conjunction;
\item
no negation is also a conjunction;
\item
every conjunction is uniquely so.
\end{compactenum}
\end{lemma}

\begin{proof}
Only the last claim is not entirely clear.
By induction in $\Ell$, we show that for all formulas $F$,
\begin{compactenum}[(a)]
\item
no proper initial segment of $F$ is a formula, and
\item
$F$ is not a proper initial segment of any formula.
\end{compactenum}
\begin{asparaenum}
\item
The claim is clearly true when $F$ is atomic.
\item
Suppose the claim is true when $F$ is a formula $G$.
Then the claim must be true when $F$ is $\lnot G$.
For if $H$ is a proper initial segment of $\lnot G$,
then $H$ is of the form $\lnot K$ for some $K$,
which is a proper initial segment of $G$,
so, by hypothesis, $K$ cannot be a formula,
and therefore $H$ cannot be a formula.
There is a similar argument if $\lnot G$ is a proper initial segment of $H$.
\item
Similarly,
if the claim is true when $F$ is $G$ or $H$,
then it must be true when $F$ is $(G\land H)$.
\end{asparaenum}

By induction, which is made possible by the recursive definition of $\Ell$,
the claim holds for all formulas $F$.
The last part of the theorem now follows.
\end{proof}

Lemma \ref{lem:UR} allows us to make recursive definitions 
of functions on $\Ell$.
For example, for all subsets $A$ of $\upomega$,
we recursively define which formulas are \textbf{true} in $A$.
We shall express that a formula $F$ is true in $A$ by writing
\begin{equation*}
A\models F.
\end{equation*}
Then by definition
\begin{subequations}\label{eqn:models}
  \begin{gather}\label{eqn:AmodP}
A\models P_k\iff k\in A,\\\label{eqn:Amod-F}
A\models\lnot F\iff A\nmodels F,\\\label{eqn:AmodF&G}
A\models(F\land G)\iff A\models F\And A\models G.
\end{gather}
\end{subequations}
Note that the expressions $\iff$ and $\And$ here,
as throughout these notes,
are just abbreviations of ordinary language.

Without recursion, if $F\in \Ell$, we define
\begin{equation}\label{eqn:ModF}
\Mod F=\{X\in\powo\colon X\models F\}.
\end{equation}
If $\Gamma\included \Ell$,
we define
\begin{equation}\label{eqn:ModGamma}
\Mod{\Gamma}=\bigcap\{\Mod F\colon F\in\Gamma\};
\end{equation}
this is the set of \textbf{models} of $\Gamma$.

\begin{lemma}\label{lem:ltop}
  The family
  \begin{equation*}
    \{\Mod{\Gamma}\colon\Gamma\included \Ell\}
  \end{equation*}
is the family of closed subsets of $\powo$
in the topology whereby the function
$X\mapsto\upchi_X$,
which is given by \eqref{eqn:chi}
and whose inverse $\sigma\mapsto\sigma\inv(1)$
is given by \eqref{eqn:sigma-inv},
is a homeomorphism with ${}^{\upomega}2$
in the Tychonoff topology.
The clopen subsets of the topology on $\powo$
compose the family
\begin{equation*}
  \{\Mod F\colon\Gamma\in \Ell\}.
\end{equation*}
\end{lemma}

\begin{proof}
The family of sets $\Mod F$ is a basis of closed sets for a topology,
since the family is closed under taking finite unions.
Indeed the family contains the empty set as
\begin{equation*}
  \Mod{F\land\lnot F},
\end{equation*}
and the family is closed under binary unions since
\begin{equation}\label{eqn:lor}
  \Mod F\cup\Mod G=\Mod{F\lor G}.
\end{equation}
Moreover,
\begin{multline*}
  \{X\in\powo\colon\upchi_X\in E_{k\;1}\}\\
=\{X\in\powo\colon k\in X\}
=\Mod{P_k},
\end{multline*}
and likewise
\begin{equation*}
  \{X\in\powo\colon\upchi_X\in E_{k\;0}\}
=\Mod{\lnot P_k},
\end{equation*}
so $X\mapsto\upchi_X$ is continuous.
Since in addition to \eqref{eqn:lor} we have generally
\begin{gather}\label{eqn:land}
  \Mod F\cap\Mod G=\Mod{F\land G},\\\label{eqn:lnot}
\Mod F\comp=\Mod{\lnot F},
\end{gather}
by means of the De Morgan laws
we obtain that each set $\Mod F$
is a finite union of finite intersections
of sets $\Mod{P_k}$ and $\Mod{\lnot P_k}$.
This yields that $\sigma\mapsto\sigma\inv(1)$
is continuous,
and the rest follows.
\end{proof}

If every finite subset of $\Gamma$ has a model,
we shall say that $\Gamma$ is \textbf{consistent.}
This is another way of saying that the family 
$\{\Mod F\colon F\in\Gamma\}$ has FIP.
We shall show that every consistent set of formulas has a model.
This is another way of saying $\powo$ is compact.
We already know this compactness,
but now we shall prove it in a new way,
or at least in new language.

To do so, we make one more recursive definition,
parallel to \eqref{eqn:models}.
\begin{subequations}
\begin{gather}\label{eqn:VP}
  V(P_k)=\{k\},\\\label{eqn:V-F}
V(\lnot F)=V(F),\\\label{eqn:VF&G}
V\bigl((F\land G)\bigr)=V(F)\cup V(G).
\end{gather}
\end{subequations}
We do not really need recursion here:
we can just say
\begin{equation*}
V(F)=\{k\in\upomega\colon\text{$P_k$ occurs in $F$}\}.
\end{equation*}
We are defining a formal logic.
Logic lets us do mathematics with logical precision.
Such precision may be illusory 
when used to define the logic in the first place.
The same consideration arises in the proof of the following.

\begin{lemma}\label{lem:models}
Let $F$ be a formula, and let $A$ and $B$ be subsets of $\upomega$
such that
\begin{equation*}
V(F)\cap A=V(F)\cap B.
\end{equation*}
Then
\begin{equation*}
A\models F\iff B\models F.
\end{equation*}
\end{lemma}

\begin{proof}
The theorem is that whether $F$ is true in $A$
depends only on whether $k\in A$ when $P_k$ actually occurs in $F$.
This is obvious when $F$ is an atomic formula,
by \eqref{eqn:AmodP}.
The remaining rules \eqref{eqn:Amod-F} and \eqref{eqn:AmodF&G} 
maintain the claim, since they do not involve variables explicitly.
In all formal detail though,
we can use induction to show
\begin{equation*}
  A\models F\iff V(F)\cap A\models F
\end{equation*}
as follows.
\begin{asparaenum}
  \item
Supposing first that $F$ is an atomic formula $P_k$,
we have $V(F)=\{k\}$ by \eqref{eqn:VP}, and then
\begin{align*}
  A\models F
&\iff k\in A&&\text{[by \eqref{eqn:AmodP}]}\\
&\iff k\in V(F)\cap A&&\text{[by \eqref{eqn:VP}]}\\
&\iff V(F)\cap A\models F.&&\text{[by \eqref{eqn:AmodP} again]}
\end{align*}
\item
Suppose the claim is true when $F$ is a formula $G$.  Then
\begin{align*}
  A\models\lnot G
&\iff A\nmodels G&&\text{[by \eqref{eqn:Amod-F}]}\\
&\iff V(G)\cap A\nmodels G&&\text{[by hypothesis]}\\
&\iff V(\lnot G)\cap A\nmodels G&&\text{[by \eqref{eqn:V-F}]}\\
&\iff V(\lnot G)\cap A\models\lnot G,&&\text{[by \eqref{eqn:Amod-F} again]}
\end{align*}
so the claim holds when $F$ is $\lnot G$.
\item
Suppose finally the claim is true
when $F$ is either of $G$ and $H$.  Since
\begin{align}\label{eqn:VGinc}
  V(G)&\included V\bigl((G\land H)\bigr),&
  V(H)&\included V\bigl((G\land H)\bigr)
\end{align}
by \eqref{eqn:VF&G},
so that
\begin{gather}\label{eqn:VGV}
  V(G)\cap V\bigl((G\land H)\bigr)\cap A=V(G)\cap A,\\\notag
  V(H)\cap V\bigl((G\land H)\bigr)\cap A=V(H)\cap A,
\end{gather}
we have
\begin{equation}
  \label{eqn:int}
  \begin{gathered}
    A\models G
\iff V\bigl(G\land H)\bigr)\cap A\models G,\\
    A\models H
\iff V\bigl(G\land H)\bigr)\cap A\models H,
  \end{gathered}
\end{equation}
since for example
\begin{align*}
  A\models G
&\iff V(G)\cap A\models G&&\text{[by hyp.]}\\
&\iff V(G)\cap V\bigl((G\land H)\bigr)\cap A\models G&&\text{[by \eqref{eqn:VGV}]}\\
&\iff V\bigl((G\land H)\bigr)\cap A\models G.&&\text{[by hyp.]}\\
\end{align*}
This gives us
\begin{align*}
%\phantom{{}\iff{}}
A\models(G\land H)
&\iff A\models G\And A\models H&&\text{[\eqref{eqn:AmodF&G}]}\\
&\iff V\bigl((G\land H)\bigr)\cap A\models G&&\\
&\phantom{{}\iff{}}\qquad
\And V\bigl((G\land H)\bigr)\cap A\models H&&\text{[\eqref{eqn:int}]}\\
&\iff V\bigl((G\land H)\bigr)\cap A\models(G\land H).
&&\text{[\eqref{eqn:AmodF&G}]}
\end{align*}
\end{asparaenum}
This completes the induction.
\end{proof}

\begin{Compactness}\label{thm:comp}
Every consistent set of propositional formulas has a model.
\end{Compactness}

\begin{proof}
Let $\Gamma$ be a consistent set of formulas.
As in our earlier proofs,
one of $\Gamma\cup\{P_0\}$ and $\Gamma\cup\{\lnot P_0\}$
must be consistent.
In this way, by recursion,
we obtain a sequence $(G_k\colon k\in\upomega)$,
where each $G_k$ is either $P_k$ or $\lnot P_k$,
and each collection $\Gamma\cup\{G_k\colon k<n\}$ is consistent.
Let
\begin{equation*}
A=\{k\in\upomega\colon\text{$G_k$ is $P_k$}\}.
\end{equation*}
For all $F$ in $\Gamma$,
the collection
\begin{equation*}
\{F\}\cup\{G_k\colon k\in V(F)\},
\end{equation*}
being finite, has a model $B$.
Then for all $k$ in $V(F)$, we have $B\models G_k$,
and so
\begin{equation*}
k\in B\iff k\in A.
\end{equation*}
By the last lemma,
since $B\models F$, also $A\models F$.
Thus $A\in\Mod{\Gamma}$.
\end{proof}

\section{Boolean algebras}

The relation $\sim$ of \textbf{logical equivalence} on $\Ell$ is given by
\begin{equation}\label{eqn:sim}
F\sim G\iff\Mod F=\Mod G.
\end{equation}
We can now define
\begin{gather*}
	[F]=\{X\in \Ell\colon X\sim F\},\\
	\Ell\modsim=\{[X]\colon X\in \Ell\}.
\end{gather*}
The definitions ensure that there is a well-defined injection
\begin{equation*}
  [X]\mapsto\Mod X
\end{equation*}
from $\Ell\modsim$ to $\powo$.
By Lemma \ref{lem:ltop},
the map is also surjective onto the collection 
$\mathscr B$ of clopen subsets of $\upomega$.
Here $\mathscr B$ is closed under
\begin{compactenum}[(1)]
	\item 
the binary operations $\cap$ and $\cup$,
\item
the singulary operation ${}\comp$, and
\item
the nullary operations $\emptyset$ and $\upomega$
(that is, $\mathscr B$ contains these sets).
\end{compactenum}
This makes $\mathscr B$ a \emph{Boolean subalgebra} of $\powo$.
Because of \eqref{eqn:lor}, \eqref{eqn:land}, and \eqref{eqn:lnot},
along with
\begin{gather*}
\Mod{P_0\land\lnot P_0}=\emptyset,\\
\Mod{P_0\lor\lnot P_0}=\upomega,
\end{gather*}
$\Ell\modsim$ is a Boolean algebra
with respect to the (well-defined) operations given by
\begin{gather*}
	[F]\land[G]=[F\land G],\\
	[F]\lor[G]=[F\lor G],\\
	\lnot[F]=[\lnot F],\\
	\bot=[P_0\land\lnot P_0],\\
	\top=[P_0\lor\lnot P_0].
\end{gather*}
In general, an abstract \textbf{Boolean algebra}
(like $\Ell\modsim$)
is a set $B$ with operations $\land$, $\lor$, $\lnot$,
$\bot$, and $\top$ with the following properties.
\begin{compactenum}
\item
The binary operations $\lor$ and $\land$ are \textbf{commutative:}
\begin{align*}
  x\lor y&=y\lor x,&x\land y&=y\land x.
\end{align*}
\item
The elements $\bot$ and $\top$ 
are \textbf{identities} for $\lor$ and $\land$ respectively:
\begin{align*}
x\lor\bot&=x,&x\land\top&=x.  
\end{align*}
\item
$\lor$ and $\land$ are mutually \textbf{distributive:}
  \begin{align*}
    x\lor(y\land z)&=(x\lor y)\land(x\lor z),\\
    x\land(y\lor z)&=(x\land y)\lor(x\land z).
  \end{align*}
\item
The element $\lnot x$ is a \textbf{complement} of $x$:
\begin{align*}
  x\lor\lnot x&=\top,&x\land\lnot x&=\bot.
\end{align*}
\end{compactenum}
Additional properties like associativity of $\land$ and $\lor$
follow from the given identities:

\begin{lemma}[E. Huntington, 1904]
  In any Boolean algebra:
  \begin{gather}\notag%\label{eqn:idemp}
    x\lor x=x,\qquad x\land x=x,\\\notag%\label{eqn:zero-el}
x\lor\top=\top,\qquad x\land\bot=\bot,\\\label{eqn:absorb}
x\lor(x\land y)=x,\qquad x\land(x\lor y)=x,\\\notag%\label{eqn:double-neg}
\lnot\lnot x=x,\\\notag%\label{eqn:De-M}
\lnot(x\lor y)=\lnot x\land\lnot y,\qquad
\lnot(x\land y)=\lnot x\lor\lnot y,\\\notag%\label{eqn:assoc}
(x\lor y)\lor z=x\lor(y\lor z),\qquad(x\land y)\land z=x\land(y\land z).
  \end{gather}
\end{lemma}

\begin{proof}
We prove only \eqref{eqn:absorb}:
\begin{align*}
x\lor(x\land y)
&=(x\land\top)\lor(x\land y)\\
&=x\land(\top\lor y)
=x\land\top=x.\qedhere
\end{align*}
\end{proof}

We shall investigate how $\powo$,
or more precisely a space homeomorphic with it,
can be obtained from the Boolean algebra $\Ell\modsim$.
The same construction will work for any Boolean algebra,
and then the algebra can be recovered 
as being isomorphic to the algebra of clopen subsets of the space.
This is the \textbf{Stone Representation Theorem,} 
Theorem \ref{thm:Stone} below.

We shall need that, on any Boolean algebra,
there is a partial ordering $\vdash$ given by
\begin{equation*}
x\vdash y\iff x\land y=x.
\end{equation*}
Note that, by \eqref{eqn:absorb},
\begin{equation*}
x\land y=x\iff x\lor y=y.
\end{equation*}

If $A\included\upomega$, we define
\begin{equation}\label{eqn:Th}
\Th A=\{X\in \Ell\colon A\models X\}.
\end{equation}
This is the \textbf{theory} of $A$,
and it has the following properties.
\begin{gather}\label{eqn:and}
F\in\Th A\And G\in\Th A\implies(F\land G)\in\Th A,\\\label{eqn:up}
F\in\Th A\And F\vdash G\implies G\in\Th A,\\\label{eqn:not}
F\notin\Th A\iff\lnot F\in\Th A.
\end{gather}
As a result,
$\Th A$,
or more precisely
the set $\{[X]\colon X\in\Th A\}$,
\begin{compactitem}
  \item
is a \textbf{filter} of the algebra $\Ell\modsim$,
by \eqref{eqn:and} and \eqref{eqn:up},
\item
by these and \eqref{eqn:not}, is an \textbf{ultrafilter.}
\end{compactitem}
Note that we can replace
\eqref{eqn:and} and \eqref{eqn:up} with the single equivalence
\begin{equation*}
  F\in\Th A\And G\in\Th A\iff(F\land G)\in\Th A.
\end{equation*}
We may blur the distinction between formulas in $\Ell$
and their equivalence classes in $\Ell\modsim$,
thus identifying the sets $\Th A$ and $\{[X]\colon X\in\Th A\}$.
An ultrafilter is a maximal filter,
if the whole algebra is not counted as a filter;
any larger filter than $\Th A$ would contain some $F$ not in $\Th A$;
but then $\Th A$ contains $\lnot F$, 
so the larger filter contains $F\land\lnot F$,
which is equivalent to $\bot$,
and $\bot\vdash G$ for all $G$ in $\Ell$.

The converse also holds:

\begin{lemma}\label{lem:ultra}
Every ultrafilter of $\Ell\modsim$
is the theory of some element of $\powo$.
\end{lemma}

\begin{proof}
Given an ultrafilter $\Phi$ of $\Ell\modsim$,
we may let
\begin{equation*}
A=\{k\in\upomega\colon P_k\in\Phi\}.
\end{equation*}
By induction in $\Ell$,
$\Phi=\Th A$, that is, for all $F$ in $\Ell$,
\begin{equation}\label{eqn:FinPhi}
F\in\Phi\iff A\models F.
\end{equation}
In detail:
\begin{asparaenum}
  \item
\eqref{eqn:FinPhi} holds by \eqref{eqn:AmodP} when $F$ is atomic.
\item
If \eqref{eqn:FinPhi} holds when $F$ is $G$, then
\begin{align*}
  \lnot G\in\Phi
&\iff G\notin\Phi&&\text{[by \eqref{eqn:not}]}\\
&\iff A\nmodels G&&\text{[by hypothesis]}\\
&\iff A\models\lnot G.&&\text{[by \eqref{eqn:Amod-F}]}
\end{align*}
\item
If \eqref{eqn:FinPhi} holds when $F$ is either of $G$ and $H$,
then
\begin{align*}
  (G\land H)\in\Phi
&\iff G\in\Phi\And H\in\Phi&&\text{[by \eqref{eqn:and} and \eqref{eqn:up}]}\\
&\iff A\models G\And A\models H&&\text{[by hypothesis]}\\
&\iff A\models(G\land H).&&\text{[by \eqref{eqn:AmodF&G}]}
\end{align*}
\end{asparaenum}
This completes the induction.
\end{proof}


\section{Stone spaces}


For any Boolean algebra $B$,
we shall denote the set of ultrafilters of $B$ by
\begin{equation*}
\Stone B;
\end{equation*}
this is the \textbf{Stone space} of $B$,
because it will have a topology.
In our case,
we have a bijection $X\mapsto\Th X$
from $\powo$ to $\Stone{\Ell\modsim}$,
and this will be a homeomorphism.

We have been working with the relation $\models$ from $\powo$ to $\Ell$.
We have used it to define, by \eqref{eqn:ModF},
a map $X\mapsto\Mod X$ from $\Ell$ to $\pow{\powo}$.
This map has the properties given by
\eqref{eqn:land} and \eqref{eqn:lnot},
so that, when we define the relation $\sim$ 
of logical equivalence as in \eqref{eqn:sim},
the map $X\mapsto\Mod X$ induces a
Boolean-algebra embedding of $\Ell\modsim$ in $\pow{\powo}$.
By Lemma \ref{lem:ltop},
the embedding is an isomorphism with the algebra of clopen subsets of $\powo$.

We have also defined by \eqref{eqn:Th} a ``dual'' map, $Y\mapsto\Th Y$,
from $\powo$ to $\pow{\Ell\modsim}$.
By Lemma \ref{lem:ultra},
the map is a bijection
onto $\Stone{\Ell\modsim}$,
the set of ultrafilters of $\Ell\modsim$.

As by \eqref{eqn:ModGamma} we define $\Mod{\Gamma}$
when $\Gamma\included \Ell$,
so we can define
\begin{equation*}
\Th{\mathscr A}=\bigcap_{Y\in\mathscr A}\Th Y
\end{equation*}
when $\mathscr A\included\powo$.  Then
\begin{gather*}
\Gamma\included\Delta\implies\Mod{\Gamma}\includes\Mod{\Delta},\\
\mathscr A\included\mathscr B\implies\Th{\mathscr A}\includes\Th{\mathscr B}.
\end{gather*}
Simply on this basis,
\begin{gather*}
\Model\circ\Theory\circ\Model=\Model,\\
\Theory\circ\Model\circ\Theory=\Theory,
\end{gather*}
so that there is a one-to-one correspondence,
called a \textbf{Galois correspondence,}
between the sets $\Mod{\Gamma}$
and the sets $\Th{\mathscr A}$.
In the original Galois theory,
the correspondence is between subfields of a field $K$ 
and subgroups of the group of automorphisms of $K$;
one obtains this by using, in place of our $\models$, 
the relation $R$ from the field to the automorphism group
given by
\begin{equation*}
x\mathrel R\sigma\iff x^{\sigma}=x.
\end{equation*}
In our case, the sets $\Th{\mathscr A}$ are filters of $\Ell\modsim$,
while the sets $\Mod{\Gamma}$ can be called
\textbf{elementary classes}
(though all this means is that they are the classes of models of sets of formulas).

\begin{SRT}\label{thm:Stone}
Every Boolean algebra embeds in an algebra $\pow{\Omega}$
for some set $\Omega$.
Indeed, when the algebra is $B$,
it embeds in $\pow{\Stone B}$ under the map $x\mapsto[x]$,
where
\begin{equation*}
[a]=\{U\in\Stone B\colon a\in U\};
\end{equation*}
and then the subsets $[a]$ of $\Stone B$
are the clopen sets in a compact topology on $\Stone B$.
\end{SRT}

\begin{proof}
In what we have done,
if we replace $\Ell$ with an arbitrary Boolean algebra $B$,
then we can also replace $\powo$ with $\Stone B$,
and $\models$ with $\in$.
When we define the map $x\mapsto[x]$ from $B$ to $\pow{\Stone B}$ as indicated,
then
\begin{gather*}
[a]\cap[b]=[a\land b],\\
	[a]\comp=[\lnot a],
\end{gather*}
so the map is a homomorphism of Boolean algebras.
It is an embedding, by the Axiom of Choice,
or rather by the weaker axiom called the
\textbf{Prime Ideal Theorem}
(which is that every proper ideal of a ring is included in a prime ideal;
the Axiom of Choice gives 
that every proper ideal is included in a maximal ideal;
maximal ideals are always prime, but in Boolean rings,
prime ideals are also maximal).

Since the image of $B$ in $\pow{\Stone B}$
is closed under finite unions,
it is a basis for a topology of closed sets on $\Stone B$.
Thus the closed sets in this topology are the sets
\begin{equation*}
\bigcap_{x\in I}[x],
\end{equation*}
where $I\included B$.
The topology is compact,
because if $\bigcap_{x\in I_0}[x]$ is never empty
when $I_0$ is a finite subset of $I$,
then $I$ is included in a proper filter,
and therefore (by the Prime Ideal Theorem) an ultrafilter $U$;
but this just means $U\in\bigcap_{x\in I}[x]$.
\end{proof}

The topology in the theorem is the \textbf{Stone topology} on $\Stone B$.


A \textbf{first-order logic,} such as the logic of set theory,
defines formulas as in propositional logic,
except that the atomic formulas are not propositional variables,
but (in the case of set theory) formulas $x\in y$;
also, if $\phi$ is a formula, and $x$ is a variable,
then so is $\Exists x\phi$.
One has the notion of a \textbf{free variable} of a formula;
if a formula has no free variable, the formula is a \textbf{sentence.}
Every sentence has a class of \textbf{models,}
which, considered in themselves, are \textbf{structures.}
Defining logical equivalence as before,
one obtains a Boolean algebra of sentences,
called a \textbf{Lindenbaum algebra} after a student of Tarski,
murdered by the Nazis.
The Stone space of this algebra is automatically compact.
The Compactness Theorem of first-order logic
can then be understood as corresponding to Lemma \ref{lem:ultra}:
it is that every ultrafilter of the Lindenbaum algebra
is in fact the theory of some structure
(and it is not so easy to prove).

Finally,
in the Stone Representation Theorem,
instead of a Boolean algebra,
we may start with an arbitrary topological space
and extract its algebra of clopen subsets.
However, the Stone space of this algebra
will not be homeomorphic with the original space
unless this is compact and \textbf{totally disconnected}
(for any two points, some clopen set contains only one of them).

\section{Topological rings}

With respect to the operations of addition and multiplication
defined unsurprisingly as in Figure \ref{fig:2BR},
\begin{figure}
  \begin{align*}
    &\begin{array}{c|cc}
      +&0&1\\\hline
0&0&1\\
1&1&0
    \end{array}&
&
  \begin{array}{c|cc}
    \times&0&1\\\hline
0&0&0\\
1&0&1
  \end{array}
  \end{align*}
  \caption{Ring operations on $2$}
  \label{fig:2BR}
\end{figure}
the set $2$ becomes a \textbf{(commutative) ring}
because the following identities hold:
\begin{gather*}
  \begin{gathered}
    x+y=y+x,\\
x+(y+z)=(x+y)+z,\\
x+0=x,
\end{gathered}\qquad
  \begin{gathered}
    xy=yx,\\
x(yz)=(xy)z,\\
x\cdot1=x,
\end{gathered}\\
x(y+z)=xy+xz,\\
x+x=0.
\end{gather*}
For an arbitrary commutative ring, the last identity would be $x-x=0$;
but $-x=x$ in $2$.
Also in $2$,
\begin{equation*}
  x^2=x,
\end{equation*}
and therefore $2$ is called a \textbf{Boolean ring.}
From this and the other identities,
$x+x=0$ and $xy=yx$ follow,
at least if additive cancellation is assumed, so that
\begin{equation*}
x^2+y^2=x+y=(x+y)^2=x^2+xy+yx+y^2
\end{equation*}
and therefore
\begin{equation*}
  0=xy+yx,
\end{equation*}
and hence as a special case
\begin{equation*}
  0=x^2+x^2=x+x,
\end{equation*}
and consequently
\begin{equation*}
  xy=xy+yx+yx=yx.
\end{equation*}
A Boolean ring is a Boolean algebra,
and conversely, by the rules
\begin{gather*}
  x\land y=xy,\\
x\lor y=x+y+xy,\\
\lnot x=x+1,\\
(x\lor y)\land(\lnot x\lor\lnot y)=x+y.
\end{gather*}
Now ${}^{\upomega}2$ is a Boolean ring
with respect to the pointwise operations given by
\begin{equation*}
  (x_k\colon k\in\upomega)*(y_k\colon k\in\upomega)
=(x_k*y_k\colon k\in\upomega),
\end{equation*}
where $*$ is $+$ or $\times$.
By the Stone Representation Theorem,
${}^{\upomega}2$ is isomorphic to the Boolean algebra of clopen subsets
in the Stone topology on $\Stone{{}^{\upomega}2}$.
This space consists of the \textbf{principal ultrafilters}
\begin{equation*}
  \{\upchi_X\colon a\in X\},
\end{equation*}
where $a\in\upomega$, along with the \textbf{nonprincipal ultrafilters,}
which include the filter
\begin{equation*}
  \{\upchi_X\colon X\comp\in\powf{\upomega}\},
\end{equation*}
where \fbox{$\powf{A}$} consists of the finite subsets of $A$;
but the existence of the nonprincipal ultrafilters
depends on the Prime Ideal Theorem mentioned above.

The elements $\upchi_{\{n\}}$ (where $n\in\upomega$) 
are the \textbf{atoms} 
of the Boolean algebra ${}^{\upomega}2$;
but when this is given the Tychonoff topology,
the Boolean algebra of clopen subsets is atomless.

The Boolean ring ${}^{\upomega}2$ is a \textbf{topological ring}
with respect to the Tychonoff topology,
because addition and multiplication are continuous in each factor.
Indeed, if $A\in\powo$, and
\begin{compactitem}
  \item
if $f$ is $x\mapsto x+\upchi_A$,
then
\begin{equation*}
  f\inv(E_{n\;i})=
  \begin{cases}
    E_{n\;i+1},&\text{ if }n\in A,\\
    E_{n\;i},&\text{ if }n\in A\comp;
  \end{cases}
\end{equation*}
\item
if $g$ is $x\mapsto x\cdot\upchi_A$, then
\begin{equation*}
  f\inv(E_{n\;i})=
  \begin{cases}
    E_{n\;i},&\text{ if }n\in A,\\
    \emptyset,&\text{ if }n\in A\comp\And i=1;\\
    {}^{\upomega}2,&\text{ if }n\in A\comp\And i=0.
  \end{cases}
\end{equation*}
\end{compactitem}

There is another ring structure on ${}^{\upomega}2$
that makes this a topological ring with respect to the Tychonoff topology.
In the new ring structure,
whether $*$ is $+$ or $\times$, we have
\begin{equation*}
  (x_k\colon k\in\upomega)*(y_k\colon k\in\upomega)
=(z_k\colon k\in\upomega)
\end{equation*}
if and only if, for all $n$ in $\upomega$,
\begin{equation*}
  \sum_{k\in n}x_k2^k*\sum_{k\in n}y_k2^k
\equiv\sum_{k\in n}z_k2^k\pmod{2^n},
\end{equation*}
the computations being performed in $\upomega$ as usual.
The element $(x_k\colon k\in\upomega)$ can be denoted by
\begin{equation*}
  \sum_{k\in\upomega}x_k2^k,
\end{equation*}
and the new ring itself by
\fbox{$\Z_{(2)}$}.
This is the ring of \textbf{dyadic integers}
(or $2$-adic integers).
Since
\begin{equation*}
  1+\sum_{k\in\upomega}2^k=0
\end{equation*}
in the ring, negatives do exist.
If $a$ is a nonzero element $\sum_{k\in\upomega}a_k2^2$ of $\Z_{(2)}$,
we define
\begin{equation*}
  \abs a=\frac1{2^m},
\end{equation*}
where
\begin{equation*}
  m=\min\{n\in\upomega\colon a_n\neq0\}.
\end{equation*}
Also
$\abs0=0$.
Then the \textbf{triangle inequality} holds in the strong form
\begin{equation*}
  \abs{x+y}\leq\max\{\abs x,\abs y\},
\end{equation*}
so the function $(x,y)\mapsto\abs{x-y}$ is a \emph{metric} on $\Z_{(2)}$
(called an \emph{ultrametric}).
The induced topology is just the Tychonoff topology, since,
if we define
\begin{equation*}
  \ball(a;r)=\{x\in\Z_{(2)}\colon\abs{x-a}<r\},
\end{equation*}
so that these are a basis of open sets in $\Z_{(2)}$, then
\begin{gather*}
  E_{n\;i}=\bigcup_{\vec e\in{}^n2}\ball\left(\sum_{k\in n}e_k2^k+i2^n;
\frac1{2^n}\right),\\
\ball\left(\sum_{k\in\upomega}a_k2^k;\frac1{2^n}\right)
=\bigcap_{k\in n}E_{k\;a_k}.
\end{gather*}

\end{document}
