A function $f\colon A\to B$ is **bijective** (or
$f$ is a **bijection**) if each $b\in B$ has
exactly one preimage. Since
*"at least one''* + *"at most one''* = *"exactly one''*,
$f$ is a bijection if
and only if it is both an injection and a surjection. A
bijection is also called a **one-to-one
correspondence**.

Example 4.6.1 If $A=\{1,2,3,4\}$ and $B=\{r,s,t,u\}$, then

$$ \begin{array}{} f(1)=u&f(3)=t\\ f(2)=r&f(4)=s\\ \end{array} $$

Example 4.6.2 The functions $f\colon \R\to \R$ and $g\colon \R\to \R^+$ (where $\R^+$ denotes the positive real numbers) given by $f(x)=x^5$ and $g(x)=5^x$ are bijections. $\square$

Example 4.6.3 For any set $A$, the identity function $i_A$ is a bijection. $\square$

Definition 4.6.4
If $f\colon A\to B$ and $g\colon B\to A$ are functions, we say $g$ is
an **inverse** to $f$ (and $f$ is an inverse to $g$) if and only
if $f\circ g=i_B$ and $g\circ f=i_A$.
$\square$

Example 4.6.5 If $f$ is the function from example 4.6.1 and

$$ \begin{array}{} g(r)=2&g(t)=3\\ g(s)=4&g(u)=1\\ \end{array} $$

then $f$ and $g$ are inverses. For example, $f(g(r))=f(2)=r$ and $g(f(3))=g(t)=3$. $\square$

Example 4.6.6 An inverse to $x^5$ is $\root 5 \of x$: $$ (\root 5 \of x\,)^5 = x, \quad \root 5 \of {x^5} = x. $$ $\square$

Example 4.6.7 If we think of the exponential function $e^x$ as having domain $\R$ and codomain $\R^{>0}$ (the positive real numbers), and $\ln x$ as having domain $\R^{>0}$ and codomain $\R$, then they are inverses: and $$ \ln e^x = x, \quad e^{\ln x}=x. $$ $\square$

Example 4.6.8 The identity function $i_A\colon A\to A$ is its own inverse. $\square$

If you understand these examples, the following should come as no surprise.

Theorem 4.6.9 A function $f\colon A\to B$ has an inverse if and only if it is bijective.

**Proof.**
Suppose $g$ is an inverse for $f$ (we are proving the
implication $\Rightarrow$). Since $g\circ f=i_A$ is injective, so is
$f$ (by 4.4.1(a)). Since $f\circ g=i_B$ is
surjective, so is $f$ (by 4.4.1(b)).
Therefore $f$ is injective and surjective, that is, bijective.

Conversely, suppose $f$ is bijective. Let $g\colon B\to A$ be a pseudo-inverse to $f$. From the proof of theorem 4.5.2, we know that since $f$ is surjective, $f\circ g=i_B$, and since $f$ is injective, $g\circ f= i_A$. $\qed$

We have talked about "an'' inverse of $f$, but really there is only one.

**Proof.**
Suppose $g_1$ and $g_2$ are both inverses to $f$. Then
$$
g_1=g_1\circ i_B=g_1\circ (f\circ g_2)=(g_1\circ f)\circ g_2=i_A\circ g_2= g_2,
$$
proving the theorem.
(See exercise 7 in
section 4.1.)
$\qed$

Because of theorem 4.6.10, we can talk about
"the'' inverse of $f$, assuming it has one; we write $f^{-1}$ for the
inverse of $f$. Note well that this extends the meaning of
"$f^{-1}$'', in a potentially confusing way. No matter what function
$f$ we are given, the induced set function $f^{-1}$ is defined, but
the inverse function $f^{-1}$ is defined only if $f$ is bijective. In
other words, $f^{-1}$ is always defined for *subsets* of the
codomain, but it is defined for *elements* of the codomain only
if $f$ is a bijection.

We close with a pair of easy observations:

Theorem 4.6.11

**Proof.**
Part (a) follows from theorems 4.3.5
and 4.3.11. For part (b), if $f\colon A\to B$ is a
bijection, then since $f^{-1}$ has an inverse function (namely $f$),
$f^{-1}$ is a bijection.$\qed$

## Exercises 4.6

**Ex 4.6.1**
Find an example of functions $f\colon A\to B$ and
$g\colon B\to A$ such that $f\circ g=i_B$, but $f$ and $g$ are not
inverse functions.

**Ex 4.6.2**
Suppose $[a]$ is a fixed element of $\Z_n$. Define $A_{{[
a]}}\colon \Z_n\to \Z_n$ by $A_{{[a]}}([x])=[a]+[x]$.
Show this is a bijection by finding an inverse to $A_{{[a]}}$.

**Ex 4.6.3**
Suppose $[u]$ is a fixed element of $\U_n$. Define $M_{{[
u]}}\colon \Z_n\to \Z_n$ by $M_{{[ u]}}([x])=[u]\cdot[x]$.
Show this is a bijection by finding an inverse to $M_{{[u]}}$.

**Ex 4.6.4**
Show that for any $m, b$ in $\R$ with $m\ne 0$, the function
$L(x)=mx+b$ is a bijection, by finding an inverse.

**Ex 4.6.5**
Suppose $f\colon A\to A$ is a function and $f\circ f$ is
bijective. Is $f$ necessarily bijective?

**Ex 4.6.6**
Show there is a bijection $f\colon \N\to \Z$. (Hint:
define $f$ separately on the odd and even positive integers.)

**Ex 4.6.7**
If $f\colon A\to B$ and $g\colon B\to C$ are bijections,
prove $(g\circ f)^{-1} = f^{-1}\circ g^{-1}$.

**Ex 4.6.8**
Suppose $f\colon A\to B$ is an injection and $X\subseteq A$. Prove
$f^{-1}(f(X))=X$.