A \textit{function} or \textit{map}$f$ from a set $A$ to a set $B$ is a rule that assigns an element of $B$ to each element of $A$. We write this as $f: A \to B$.
\vspace{1mm}
Let $L =\{\texttt{a}, \texttt{b}, \texttt{c}, \texttt{d}, ..., \texttt{z}\}$ be the set of lowercase english letters. \par
Let $C =\{\texttt{A}, \texttt{B}, \texttt{C}, \texttt{D}, ..., \texttt{Z}\}$ be the set of uppercase english letters. \par
\vspace{1mm}
Say we have a function $g: L \to C$ that capitalizes english letters. \par
We can think of this function as a \textit{map} from $A$ to $B$, shown below using arrows:
The words \say{function} and \say{map} are two views of the same mathematical object. We usually think of functions as \say{machines} that take an input, change it, and produce an output. We think of maps as \say{rules} that match each element of a set $A$ to an element of a set $B$.
\vspace{2mm}
Again, functions and maps are \textit{identical}. They do the same thing. The only difference between \say{functions} and \say{maps} is how we think about them.
% one-to-one = injective
% onto = surjective
\problem{}
Is the \say{capitalize} function in \ref{deffun} one-to-one? Is it onto?
\vfill
\problem{}
Consider the function $f: \mathbb{Z}\to\mathbb{Z}$ defined by $f(x)= x^2$. \par
Is this function one-to-one? Is it onto?
\vfill
\problem{}
Consider the function $f: \mathbb{Z}\to\mathbb{Z}$ defined below. \par
Is this function one-to-one? Is it onto?
\[
f(x) = \begin{cases}
0 &\text{if } x = 0 \\
x + 1 &\text{otherwise}
\end{cases}
\]
% TODO:
% bijections, same size if exists bijection
\vfill
\pagebreak
\definition{Invertible Functions}
A function $g$ is an \textit{inverse} of a function $f$ if $g(f(x))= x$ for any $x$. \par
In other words, the function $g$\say{undoes}$f$. Usually, the inverse of a function $f$ is written $f^{-1}$. \par
We say a function is \textit{invertible} if it has an inverse.
\vspace{2mm}
Intuitively, we could say that the inverse of $f$ reverses the \say{arrows} of $f$.
One-to-one maps are also called \textit{injective} maps. \par
Onto maps are also called \textit{surjective} maps.
\vspace{2mm}
If a function is both one-to-one and onto, we say it is a \textit{bijection}.
\vspace{4mm}
\theorem{}
All bijective functions are invertible. All invertible functions are bijections. \par
You should review the problems on the previous page and convince yourself that this is true.
\problem{}
We say a set $S$ is \textit{finite} if there exists a bijection from $S$ to $\{1, 2, 3, ..., n\}$ for some integer $n$.\par
Convince yourself that this definition of \say{finite-ness} is the same as the one in \ref{infiniteset}.
\problem{}
Is there a bijection between the sets $\{1, 2, 3\}$ and $\{\texttt{A}, \texttt{B}, \texttt{C}\}$? \par
If a bijection exists, find one; if one doesn't, prove it. \par
\vfill
\problem{}
Is there a bijection between the sets $\{1, 2, 3, 4\}$ and $\{\texttt{A}, \texttt{B}, \texttt{C}\}$? \par
If a bijection exists, find one; if one doesn't, prove it. \par
\vfill
\problem{}<samesize>
Let $A$ and $B$ be two sets of different sizes. \par
Show that no bijection between $A$ and $B$ exists.
\vfill
\ref{samesize} reveals a very important fact: if we can find a bijection between two sets $A$ and $B$, these sets must have the same number of elements. Similarly, if we know that a bijection doesn't exist, we know that $A$ and $B$ must have a different number of elements.
\vspace{2mm}
Intuitively, you can think of a bijection as a \say{matching} between elements of $A$ and $B$. If we were to draw a bijection, we'd see an arrow connecting every element in $A$ to every element in $B$. If a bijection exists, every element of $A$ directly corresponds to an element of $B$, therefore $A$ and $B$ must have the same number of elements.