# Functions

If a function maps from some set $X$ to some set $Y$, $f: X \rightarrow Y$, what does this mean?

It means that the mapping function $f$ sends $x \in X$ to an element of $Y$. This is denoted as $f(x) \in Y$

What is the domain and codomain of the mapping $f: X \rightarrow Y$ where $X$ and $Y$ are sets?

Domain: $X$ Codomain: $Y$

What does the symbol $\mapsto$ represent?

$\mapsto$ specifically denotes what element maps to what in differing sets.

Given $f: X \rightarrow Y$ where $X$ and $Y$ are sets, what is the image of $f$?

$im(f) := \{y \in Y | \exists x \in X \text{ such that } f(x) = y\}$

Basically, it is every element that $x \in X$ maps to in the set $Y$.

If the function $f: X \rightarrow Y$ maps sets $X$ and $Y$ and the function $g: Y \rightarrow Z$ maps sets $Y$ and $Z$, are they able to be composed? Why?

Yes, they are able to be composed because $f$ shares the set $Y$ with the function $g$. In this case, $Y$ is $f$'s codomain and $g$'s domain. It is joined "tip-to-tip" to borrow from the world of vectors in physics:

$X \xrightarrow[]{f} Y$ $Y \xrightarrow[]{g} Z$

How do you write the composition of the functions $f: X \rightarrow Y$ and $g: Y \rightarrow Z$ where $X$, $Y$, and $Z$ are sets?

$g \circ f: X \rightarrow Z$

What does $Hom_{Set}(X, Y)$ mean given $X$ and $Y$ are sets?

The $Hom_{Set}(X, Y)$ represents the set of functions $X \rightarrow Y$. This set can be represented as: $\{f(x_{1}), f(x_{2}), f(x_{3}), ...\}$

Given some set $X$, what is its identity function?

$id_{X}: X \rightarrow X$

Given some set $X$, what does $id_{X}: X \rightarrow X$ mean?

That for all $x \in X$, the function $id_{X}(x) = x$. Basically, the $id$ function returns any element it is given of some set unchanged. An example being: $id_{X}(10) = 10$.

Definition 2.1.2.8 (Isomorphism)

Let $X$ and $Y$ be two sets.

A function $f: X \rightarrow Y$ is an isomorphism if there exists a function $g: Y \rightarrow X$ such that $g \circ f: id_{X}$ and $f \circ g: id_{Y}$. An isomorphism is denoted as $f: X\xrightarrow[]{\cong}Y$ where $\cong$ stands for congruency. $f$ is invertible and $g$ is the inverse of $f$.

If there is an isomorphism $X\xrightarrow[]{\cong}Y$, $X$ and $Y$ are isomorphic sets and can be denoted as $X \cong Y$

# Exercises

Exercise 2.1.2.2 Here is a simplified account of how the brain receives light. The eye contains about 100 million photoreceptor ($PR$) cells. Each connects to a retinal ganglion ($RG$) cell. No $PR$ cell connects to two different $RG$ cells, but usually many $PR$ cells can attach to a single $RG$ cell. Let $PR$ denote the set of photoreceptor cells and let $RG$ denote the set of retinal ganglion cells.

1. According to the above account, does the connection pattern constitute a function $RG \rightarrow PR$, a function $PR \rightarrow RG$ or neither one?

$f: PR \rightarrow RG$

Which can also be written as: $f(x) \in RG$ where $x \in PR$

1. Would you guess that the connection pattern that exists between other areas of the brain are "function-like"?

I would guess that other parts of the brain are function-like!

Exercise 2.1.2.4 Let $f: \mathbb{N} \rightarrow \mathbb{N}$ be the function that sends every natural number to its square, e.g. $f(6) = 36$. First fill in the blanks below, then answer a question.

1. Answer: $2 \mapsto \underline{\hspace{3cm}}$

$2 \mapsto 4$
1. Answer: $0 \mapsto \underline{\hspace{3cm}}$

$0 \mapsto 0$
1. Answer: $-2 \mapsto \underline{\hspace{3cm}}$

Undefined

1. Answer: $5 \mapsto \underline{\hspace{3cm}}$

$5 \mapsto 25$
1. Consider the symbol $\rightarrow$ and the symbol $\mapsto$.

What is the difference between how these two symbols are used in this book?

$\rightarrow$ means a general rule for a mapping elements between sets whereas $\mapsto$ specifically denotes what element maps to what in differing sets.

Exercise 2.1.2.5 If $f: X \rightarrow Y$ is represented by the diagram below, write its image, $im(f)$ as a set.

$im(f) = \{y_{1}, y_{2}, y_{4}\}$

Exercise 2.1.2.6 Let $A = \{1, 2, 3, 4, 5\}$ and $B = \{x, y\}$.

1. How many elements does $Hom_{Set}(A, B)$ have?

Answer: $2^5$ or $32$

1. How many elements does $Hom_{Set}(B, A)$ have?

Answer: $5^2$ or $25$

Exercise 2.1.2.7.

1. Find a set $A$ such that for all sets $X$ there is exactly one element in $Hom_{Set}(X, A)$.

Hint: draw a picture of proposed $A$'s and $X$'s.

Answer: $A = \{a\}$

1. Find a set $B$ such that for all sets $X$ there is exactly one element in $Hom_{Set}(B, X)$.

Answer: $B = \{\emptyset\}$