\magnification=\magstep1
\baselineskip=12pt
\parskip=6pt
\input amstex
\documentstyle{amsppt}
\voffset=-3pc
\def\cA{\Cal A}
\def\cS{\Cal S}
\def\cJ{\Cal J}
\centerline{Functions and Categories}
\bigskip
\noindent
\S1\ \ Functions

\definition{Definition 1}A {\it map} $f\colon X\to Y$ is a rule $f$ which assigns to every object $x$ in the {\it source} $X$ an object $f(x)$ in 
the {\it target} $Y$.
\enddefinition

\definition{Definition 2}Two sets $X$ and $Y$ are {\it equal}, denoted $X=Y$, 
$\Leftrightarrow$ every object of $X$ is an object in $Y$ and every 
object in $Y$ is an object in $X$.
\enddefinition

\definition{Definition 3}Two maps are equal\ $\Leftrightarrow$ \ their 
sources are equal, their targets are equal, and their rules do the 
same thing.
\enddefinition

\noindent
In more symbolic notation this definition reads as follows:\ \ Let 
$f\colon X\to Y$ and $g\colon X'\to Y'$ be two maps .
Then $f=g\Leftrightarrow X=X'$, and $ Y=Y'$ and $f(a)=g(a)$ for all $a$ in the
source.

\definition{Definition 4}Suppose we have two maps, $f\colon X\to Y$
and $g\colon Y\to Z$ (note the target of $f$ is the source of $g$).
Then the map $h\colon X\to Z$ is the {\it composition} of $f$ and 
$g\Leftrightarrow$ $h(x)=g(f(x))$ for every $x$ in the source $X$.
\enddefinition

We say that $f(x)$ is the {\it image} of $x$, and that $x$ is a {\it preimage}
of $f(x)$.
The set of all the preimages of $y$ we will call the
{\it fiber} of $y$.

The subset of the target $Y$ which consists of elements $y$ assigned to some
$x$ is called the {\it image} of $f$. Thus we can say that the {\it 
image} of $f$ is the subset of objects of the target with non--empty 
fibers.

If $A$ is a subset of the source $X$, then the {\it image} of $A$ in 
the target $Y$
consists of the set of images of all the objects in $A$. The image of $A$ is
denoted by $f(A)$. Similarly, the {\it preimage of a subset} $B$ of 
the target $Y$
is the set of all objects in the source $X$ whose images are objects in $B$.
The preimage of $B$ is denoted by $f^{-1}(B)$.

If the {\it image} of $f$ is the entire {\it target} of $f$, then we say that
$f$ is {\it onto}. Thus $f$ is onto if and only if no fiber is empty.
If the fibers of $f$ have at most one object in it, then we
say $f$ is {\it one--to--one}. If every fiber of $f$ has exactly one object in
it, then we say that $f$ is {\it one--to--one onto} or equivalently that
$f$ is {\it bijective}.

\loadmsbm
\def\cC{\Cal C}
\def\cD{\Cal D}
\def\bZ{\Bbb Z}
\remark{Remark 5}The following are synonyms for types of functions:
$$
\vbox{
\offinterlineskip\tabskip=0pt
\halign{
\strut # &
# \hfil &
# \hfil\quad &
# \hfil\quad &
# \hfil\cr
& & Anglosaxon & Latin & Greek\cr
& 1. & One--to--one & injective & monomorphism\cr
& 2. & onto & surjective & epimorphism\cr
& 3. & one--to--one--onto & bijective & isomorphism\cr
}}
$$
\endremark
\vfill\eject
\noindent
\S2.\ \ Categories

\definition{Definition 6}The {\it identity map} $1_X\colon X\to X$ sends $x\mapsto x$ for all $x\in X$.
\enddefinition

\proclaim{Proposition 7} a) Suppose $f\colon X\to Y$ is a map, then $f=f\circ 1_X=1_Y\circ f$ (identity law).

\itemitem{b)}$(f\circ g)\circ h=f\circ (g\circ h)$ whenever all compositions are defined (associativity).
\endproclaim

\definition{Definition 8} A set of functions $\cC$ is called a (concrete) category if it is:

\itemitem{a)}closed under composition
\itemitem{b)}contains the identity map for every source and target of maps in $\cC$.
\enddefinition

\noindent
that means

\itemitem{a)}If $f$ and $g$ are in $\cC$ and if $f\circ g$ is defined, then $f\circ g\in\cC$.

\itemitem{b)}If $f\colon X\to Y$ is in $\cC$, then $1_X$ and $1_Y$ are in $\cC$.

\remark{Remark 9}The sources and targets of all maps in a category $\cC$ 
are called the {\it objects of $\cC$}, and the maps in $\cC$ are called the 
{\it morphisms of $\cC$}.
\endremark

We usually describe categories by naming the objects and then the maps.
So we have the following examples:

\item{1.}The category $\cS$ of sets and functions.

\item{2.}The category of sets and identity maps.

\item{3.}The category $\cJ$ of topological spaces and continuous maps.
This is also called the {\it topological category}.

\item{4.}The category of vector spaces and linear transformations.

\item{5.}The category of groups and homomorphisms.

\item{6.}The category of rings and ring homomorphisms.

\item{7.}The category of manifolds and smooth maps.
This is called the {\it smooth category}.

\item{8.}The category of metric spaces and isometries.

\item{9.}The category of categories and covariant functors.

\definition{Definition 10} A {\it functor} is a map of categories 
$F\colon \cC\to \cD$
which preserves composition and takes identities to identities.
That is $F(1_X)=1_Y$ where $Y$ is some object in $\cD$ and
$F(f\circ g)=F(f)\circ F(g)$ (called a {\it covariant} functor) or $F(f\circ g)=
F(g)\circ F(f)$, (called a {\it contravariant} functor).
\enddefinition

Note that the identity map $\cC\to \cC$ is a covariant functor and the composition of two covariant functors is a covariant functor, so covariant functors
form a category as in 9.

We have the following examples of functors.
First a definition.

\definition{Definition 11} Suppose $A\subset X$.
The inclusion map $i\colon A\hookrightarrow X$ is the map defined
by $i(a)=a$.
\enddefinition

\def\cA{\Cal A}
\def\cS{\Cal S}
\def\cJ{\Cal J}
\noindent
Examples of functors:

\item{1.}If $\cA\subset \cC$ are categories, then the inclusion map
$i\colon \cA\to \cC$ is a covariant functor, called the
{\it forgetful functor}.

\item{2.}Consider the map $\cS \overset{F_*}\to\longrightarrow \cS$ which
takes any function $f\colon X\to Y$ to a function $f_*\colon 2^X\to 2^Y$,
where $2^X$ denotes the set of all subsets of $X$, and where
$f_*\colon A\mapsto f(A)\in 2^Y$.
This $F_*$ is a covariant functor.

\item{3.}$F^*\colon \cS\longrightarrow \cS$ which takes $f\colon X\to Y$
to $f^*\colon 2^Y\to 2^X$ by $B\subset Y\mapsto f^{-1} (B)\subset X$.
This $F^*$ is a contravariant functor.

\item{4.}{\it Homology} is a covariant functor from $\cJ$ to the category
of abelian groups and homomorphisms.

\item{5.}{\it Cohomology} is a contravariant functor from $\cJ$ to the
category of rings and ring homomorphisms.

\bigskip\noindent
\S3.\ \ Equivalence 

\noindent
Let $A$ be a set.

\definition{Definition 12} A relation $\sim$ on $A$ is an {\it equivalence 
relation} if and only if the following three axioms are satisfied.

\itemitem{a)}(Reflexivity) $a\sim a$ for all $a\in A$.
\itemitem{b)}(Symmetry) If $a\sim b$, then $b\sim a$.
\itemitem{c)}(Transitivity) If $a\sim b$ and $b\sim c$, then $a\sim c$.
\enddefinition

\noindent
Examples of equivalence relations include equality, congruence modulo
$N$ for an integer $N$, congruence of triangles, similarity of triangles.

The equivalence class of $a\in A$ is the set of all $x\in A$ such that 
$x\sim a$.
The set of equivalence classes of $\sim$ form a {\it partition} of $A$.
A partition of $A$ is a family of disjoint subsets of $A$ covering $A$.
That is $A=$ union of the equivalence classes and each equivalence class
has empty intersection with any other.
In other words, each $a\in A$ is in an equivalence class $E(a)$, and if
$E(a)\cap E(b)\not= 0$, then $E(a)=E(b)$.

Conversely, every partition of $A$ gives rise to an equivalence relation 
on $A$.  
Namely $a\sim b\Leftrightarrow a$ and $b$ are in the same subset of 
the partition.

Let $A/\sim$ \ \  denote the set of equivalence class of $\sim$ which
partition A.
Define the map $q\colon A\to A/\sim$ \ \ given by $q(a)=[a]$, where $[a]$ 
denotes the
equivalence class containing $a$.
Note $q$ is surjective.

Note that the fibres of any map partition the source.

\definition{Definition 13}A map $f\colon X\to Y$ in a category $\cC$
is an {\it isomorphism} in $\cC\ \Leftrightarrow$ there exists a map
$g\colon Y\to X$ in $\cC$ such that $f\circ g=1_Y$ and $g\circ f=1_X$.
Then $g$ is said to be the {\it inverse} of $f$ in $\cC$.
Note the inverse $g$ is also an isomorphism in $\cC$ with $f$
as its inverse.
\enddefinition

\definition{Definition 14}We say that two objects $X$ and $Y$ are
{\it equivalent in category} $\cC$ or {\it isomorphic in} $\cC$ if there
is an isomorphism $f$ in $\cC$ so that $f\colon X\to Y$.
Denote this by $X\sim_{\cC} Y$.
\enddefinition

\proclaim{Theorem 15}The relation $\sim_{\cC}$ is an equivalence relation.
\endproclaim

\demo{Proof}a)\ $X\sim_{\cC} X$ since $1_X\colon X\to X$ is an isomorphism
in $\cC$.

\item{b)}If $X\sim_{\cC} Y$ then $Y\sim_{\cC} X$ since $X\sim_{\cC} Y$ means
that there exists an $f\colon X\to Y$ in $\cC$ which is an
isomorphism.
The inverse $g\colon Y\to X$ is an isomorphism also, so $Y\sim_{\cC} X$.
\item{c)}Suppose $X\sim_{\cC} Y$ and $Y\sim_{\cC} Z$, then $X\sim_{\cC} Z$.
We have isomorphisms in $\cC,\ f\colon X\to Y$ and $g\colon Y\to Z$.
Then we claim $g\circ f\colon X\to Z$ is an isomorphism in $\cC$.
To see this, we will show that the inverse of $g\circ f$, denoted $(g\circ f)'$,
 is equal to $f'\circ g'$, where $f'$ is the inverse of $f$ in $\cC$ and $g'$ is
 the inverse of $g$ in $\cC$.
This follows by the following argument:
$$
\align
(g\circ f)\circ (f'\circ g')&=g\circ (f\circ f')\circ g'=g\circ 1_Y\circ g'\\
&=g\circ g'=1_Z
\endalign
$$
and
$$
\align
(f'\circ g')\circ (g\circ f)&=f'\circ (g'\circ g)\circ f=f'\circ 1_Y\circ f\\
&=f'\circ f=1_X.
\endalign
$$


\enddemo


\proclaim{Theorem 16}Suppose $f\in\cC$ has a {\it left inverse}
and a right inverse.
That is, suppose there exists $\ell\in\cC$ and $r\in\cC$ so that $\ell\circ f=1_X$ and $f\circ r=1_Y$ where $f\colon X\to Y$.
Then 

\item{a)} $\ell=r$ and is an inverse to $f$.
Hence $f$ is an isomorphism in $\cC$.

\item{b)}$f$ is bijective
\item{c)}If $f$ is bijective, then $f$ is an equivalence in $\cS$, the category
of sets and functions.
\endproclaim

\demo{Proof}
\item{a)}Consider $\ell=\ell\circ 1_Y=\ell\circ (f\circ r)=(\ell\circ f) 
\circ r =1_X\circ r=r$.
\item{b)}Let $\ell=r\colon =f'$.
Now $f$ is $1-1$ since $f'\circ f=1_X$ is $1-1$.
Also $f$ is onto since $f\circ f'=1_Y$ is onto.
\item{c)}Suppose $f\in \cS$ is bijective.
Then every fibre has exactly one element in it.
Define $g\colon Y\to X$ to be the map which sends each $y\in Y$ to the unique element in its fibre $f^{-1}(y)$.
\enddemo
\vfill\eject
\noindent
Examples:

\item{1.}Isomorphisms in the category $\cS$ of sets and functions are bijections.
Two sets are isomorphic in $\cS$ if they have the  same {\it cardinal number}
of elements.

\item{2.}Isomorphisms in the category of topological spaces and continuous maps are called {\it homeomorphisms} and isomorphic spaces are said to be 
{\it homeomorphic} or of the same {\it topological type}.

\item{3.}In the smooth category, the isomorphisms are called
{\it diffeomorphisms} and two manifolds are said to be {\it diffeomorphic}
if they are isomorphic in the smooth category.

\item{4.}For groups and homomorphisms we have isomorphic
and isomorphism.

\item{5.}For metric spaces and isometric maps, we say isometric spaces 
 and isometries.

\bigskip\noindent
\S4.\ \ The category of sets and functions $\cS$.

If two sets are isomorphic in $\cS$, we say they have the {\it same cardinality}, or the same number of elements.

We know from Theorem 16 that in $\cS$ the bijections are the isomorphisms.
So the fact that there is a one--to--one--onto correspondence between $X$ and $Y$ leads us to say they have the same number of elements.
The two key theorems are:

\noindent
\proclaim{Theorem 17, Schroeder--Bernstein} 

Suppose $f\colon X\to Y$ and $g\colon Y\to X$ are injective maps.
Then there exists a bijection $b\colon X\to Y$.
That is, $X$ and $Y$ have the same cardinality.
\endproclaim

\proclaim{Theorem 18} Let $2^X$ denote the set of all subsets of $X$.
Then $X$ and $2^X$ cannot have the same cardinality.
\endproclaim

The Schroeder--Bernstein theorem allows us to put a ``greater than'' relation $\leq$ on cardinality.
So we say that card $x <$ card $2^X$.

The main cardinalities we will use are:\ Finite sets, countably infinite sets (of the same cardinality as the set of natural numbers $\bZ_+$), and $2^{\bZ_+}$ (the same cardinality as the real numbers).

\bye
