6.6 Properties of functions

Definition 6.41 (Injective, injection).

A function f:DCf:D\to C is said to be injective (or an injection) if f(x1)=f(x2)f(x_{1})=f(x_{2}) implies x1=x2x_{1}=x_{2} for every x1,x2Dx_{1},x_{2}\in D i.e. for every yCy\in C, there is at most one element xDx\in D such that f(x)=yf(x)=y.

Example 6.42.

Consider the function f:00f\colon\mathbb{N}_{0}\rightarrow\mathbb{N}_{0}, where 0={0}\mathbb{N}_{0}=\mathbb{N}\cup\{0\} and f(n)=n2f(n)=n^{2}.

Claim: The function ff is injective.

Proof: Let m,n0m,n\in\mathbb{N}_{0} be such that f(m)=f(n)f(m)=f(n). Then m2=n2m^{2}=n^{2}, and so

0=m2n2=(mn)(m+n).0=m^{2}-n^{2}=(m-n)(m+n).

If m+n=0m+n=0 then m=0m=0 and n=0n=0, so m=nm=n. Otherwise, mn=0m-n=0, so m=nm=n. Thus ff is injective. \square

Definition 6.43 (Surjective, surjection).

A function f:DCf:D\to C is said to be surjective (or a surjection) if, given any yCy\in C, there is some xDx\in D such that f(x)=yf(x)=y.

Example 6.44.

Consider the function g:[5,+)g\colon\mathbb{R}\rightarrow[-5,+\infty) defined by g(x)=x2+2x4g(x)=x^{2}+2x-4.

Claim: The function gg is surjective.

Proof: Let y5y\geq-5. We need to show there is some xx\in\mathbb{R} such that g(x)=yg(x)=y. Observe that g(x)=yx2+2x4=yg(x)=y\iff x^{2}+2x-4=y. By the quadratic formula, that means

x=2±4+4(4+y)2x=\frac{-2\pm\sqrt{4+4(4+y)}}{2}

and since y5y\geq-5, the square root is defined and this gives our value for xx. Thus, since we can find such an xx\in\mathbb{R} for every y[5,)y\in[-5,\infty), this implies that gg is surjective. \square

Definition 6.45 (Bijective, bijection).

A function is said to be bijective if it is both injective and surjective.

Notice that a function f:DCf:D\to C is injective if every element of CC has at most one element of DD that ff maps to it. And ff is surjective if every element of CC has at least one element of DD that maps to it. Thus, if ff is bijective, every element of CC has exactly one element of DD that maps to it. In particular, we can say that, for every element of CC, there exists a unique element of DD that ff maps to it.

We can interpret this from a graph perspective too. If ff is injective, then every horizontal line of the form y=cy=c where cCc\in C must cross the graph of ff at most once. If ff is surjective, then every such horizontal line must cross the graph of ff at least once. So if ff is bijective, every such horizontal line must cross the graph of ff exactly once.

Exercise 6.46.

If f:STf:S\rightarrow T is a function with ASA\subseteq S and BTB\subseteq T, prove that

  1. (a)

    A=f1(f(A))A=f^{-1}(f(A)) if ff is injective.

  2. (b)

    f(f1(B))=Bf(f^{-1}(B))=B if ff is surjective.

Solution (please try for yourself before looking)

We first note that Proposition 6.39 already does half of the work for us since it says Af1(f(A))A\subseteq f^{-1}(f(A)) and f(f1(B))Bf(f^{-1}(B))\subseteq B.

  1. (a)

    Suppose that ff is injective. To prove that A=f1(f(A))A=f^{-1}(f(A)), it suffices to show that Af1(f(A))A\supseteq f^{-1}(f(A)). Indeed, suppose xf1(f(A))x\in f^{-1}(f(A)). Then f(x)f(A)f(x)\in f(A) but this doesn’t necessarily mean xAx\in A. All this tells us is there exists some sAs\in A such that f(s)=f(x)f(s)=f(x). However, since ff is injective, this means s=xs=x. Hence, xAx\in A and thus, Af1(f(A))A\supseteq f^{-1}(f(A)). Together with the result in Proposition 6.39, we conclude that A=f1(f(A))A=f^{-1}(f(A)).

  2. (b)

    Suppose that ff is surjective and let yBy\in B. Then, since BTB\subseteq T and ff is surjective, there exists some xSx\in S such that f(x)=yf(x)=y. In particular, since yBy\in B, this means xf1(B)x\in f^{-1}(B). But then yy is mapped to be an element in f1(B)f^{-1}(B) by ff. So this means yf(f1(B))y\in f(f^{-1}(B)). Hence, f(f1(B))Bf(f^{-1}(B))\supseteq B. Together with our result in Proposition 6.39, this means f(f1(B))=Bf(f^{-1}(B))=B.

The following results show how we can deduce the injectivity and surjectivity of compositions of functions with these properties.

Proposition 6.47.

Let f:ABf:A\to B, g:BCg:B\to C be functions.

  1. 1.

    If ff, gg are injective then so is gfg\circ f.

  2. 2.

    If ff, gg are surjective then so is gfg\circ f.

Hence if ff, gg are bijective then so is gfg\circ f.

Proof.
  1. 1.

    Suppose ff and gg are injective and suppose x,xXx,x^{\prime}\in X satisfies (gf)(x)=(gf)(x)(g\circ f)(x)=(g\circ f)(x^{\prime}). Then g(f(x))=g(f(x))g(f(x))=g(f(x^{\prime})). Since gg is injective, this means f(x)=f(x)f(x)=f(x^{\prime}). Since ff is injective, this implies x=xx=x^{\prime}.

    This completes the proof that gfg\circ f is injective.

  2. 2.

    Now suppose ff and gg are surjective and let zZz\in Z. Since gg is surjective, there is some yYy\in Y such that z=g(y)z=g(y). Since ff is surjective, there is some xXx\in X such that f(x)=yf(x)=y. Then

    (gf)(x)=g(f(x))=g(y)=z.(g\circ f)(x)=g(f(x))=g(y)=z.

    This finishes the proof that gfg\circ f is surjective.

Thus, if gg and ff are bijective, then they are both injective and surjective, so by the previous two parts, gfg\circ f is also both injective and surjective, and hence gfg\circ f is bijective.

The proof above is an example of a “definition chase” style proof, where you work from one definition to another.

Inverse Functions

Suppose that we have a function f:DCf:D\to C with graph GG, where

G={(x,y):y=f(x),xD}.G=\{(x,y):y=f(x),x\in D\}.

Under what circumstances will the set of ordered pairs

G:={(y,x):(x,y)G}G^{\prime}:=\{(y,x):(x,y)\in G\}

also define a legitimate function F:CDF:C\to D? Note, we have reversed the role of CC and DD and also the order of the pairs in the graph so that

(x,y)G(y,x)G.(x,y)\in G\Leftrightarrow(y,x)\in G^{\prime}.

GG^{\prime} gives a new function if, and only if, for each yCy\in C there exists a unique point xDx\in D with y=f(x)y=f(x). Hence,

  • the image of ff must be the whole of the codomain so that for each yCy\in C there is at least one point xDx\in D with y=f(x)y=f(x) i.e. ff must be surjective, AND

  • further, ff must be injective so that the xDx\in D with y=f(x)y=f(x) is unique.

When such a function exists we call it the inverse of ff, and write this as f1f^{-1}. If the inverse of ff exists, we say that ff is invertible. This discussion shows that an inverse exists if and only if the original function is a bijection.

Proposition 6.48.

A function is bijective if and only if it is invertible.

Proposition 6.49.

If f:DCf:D\to C is invertible, then f1:CDf^{-1}:C\to D is its inverse function if and only if ff1=idCf\circ f^{-1}=id_{C} and f1f=idDf^{-1}\circ f=id_{D}.

Proof.

Let G={(x,y):y=f(x),xD}G=\{(x,y):y=f(x),x\in D\} be the graph of ff. Then, the graph of its inverse f1f^{-1} is defined to be G:={(y,x):(x,y)G}={(a,b):b=f1(a),aC}G^{\prime}:=\{(y,x):(x,y)\in G\}=\{(a,b):b=f^{-1}(a),a\in C\} such that

(x,y)G(y,x)G.(x,y)\in G\iff(y,x)\in G^{\prime}.

Therefore,

x=f1(y)=f1(f(x))=f1f(x)=idD(x).\displaystyle x=f^{-1}(y)=f^{-1}(f(x))=f^{-1}\circ f(x)=id_{D}(x).

Since f1f:DDf^{-1}\circ f:D\to D and idD:DDid_{D}:D\to D, this means that f1f=idDf^{-1}\circ f=id_{D}.

Also,

y=f(x)=f(f1(y))=ff1(y)=idC(y).\displaystyle y=f(x)=f(f^{-1}(y))=f\circ f^{-1}(y)=id_{C}(y).

Since, ff1:CCf\circ f^{-1}:C\to C and idC:CCid_{C}:C\to C, this means that ff1=idCf\circ f^{-1}=id_{C}.

For the other direction, suppose that f1:CDf^{-1}:C\to D is some function where ff1=idCf\circ f^{-1}=id_{C} and f1f=idDf^{-1}\circ f=id_{D}. We claim that its graph G={(a,b):b=f1(a),aC}G^{\prime}=\{(a,b):b=f^{-1}(a),a\in C\} satisfies

(x,y)G(y,x)G.(x,y)\in G\iff(y,x)\in G^{\prime}.

Indeed,

(y,x)Gf(x)=f(f1(y))=ff1(y)=idC(y)=y(x,y)G,(y,x)\in G^{\prime}\implies f(x)=f(f^{-1}(y))=f\circ f^{-1}(y)=id_{C}(y)=y% \implies(x,y)\in G,

and

(x,y)Gf1(y)=f1(f(x))=f1f(x)=idD(x)=x(y,x)G.(x,y)\in G\implies f^{-1}(y)=f^{-1}(f(x))=f^{-1}\circ f(x)=id_{D}(x)=x\implies% (y,x)\in G^{\prime}.

Thus, f1f^{-1} is an inverse for ff.

Inverse vs Preimage

Suppose BB is a subset of the codomain of some function ff. Rather confusingly, the notation for the inverse function f1f^{-1} of ff (if it exists) leads to the image of BB under f1f^{-1} being denoted by f1(B)f^{-1}(B) which is the same notation as the preimage of BB under ff. So watch out! The preimage f1(B)f^{-1}(B) of the set BB under ff is always defined, regardless of whether or not ff has an inverse. But if ff is bijective, its inverse function f1f^{-1} exists and f1(B)f^{-1}(B) denotes both the preimage of the set BB under ff and the image of BB under f1f^{-1}, and both sets are equal in this case.