Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

5.4: Onto Functions and Images/Preimages of Sets

( \newcommand{\kernel}{\mathrm{null}\,}\)

One-to-one functions focus on the elements in the domain. We do not want any two of them sharing a common image. Onto functions focus on the codomain. We want to know if it contains elements not associated with any element in the domain.

Definition: ONTO (surjection)

A function f:AB is onto if, for every element bB, there exists an element aA such that f(a)=b. An onto function is also called a surjection, and we say it is surjective.

Example 5.4.1

The graph of the piecewise-defined functions h:[1,3][2,5] defined by

h(x)={3x1 if 1x23x+11 if 2<x3

is displayed on the left in Figure 6.5. It is clearly onto, because, given any y[2,5], we can find at least one x[1,3] such that h(x)=y. Likewise, the function k:[1,3][2,5] defined by

k(x)={3x1 if 1x25 if 2<x3

is also onto. Its graph is displayed on the right of Figure 6.5.

clipboard_e5498198a514fb908345bb0b74e9ef561.png

Hands-on exercise 5.4.1

The two functions in Example 5.4.1 are onto but not one-to-one. Construct a one-to-one and onto function f from [1,3] to [2,5].

Hands-on exercise 5.4.2

Construct a function g:[1,3][2,5] that is one-to-one but not onto.

Hands-on exercise 5.4.3

Find a subset B of R that would make the function s:RB defined by s(x)=x2 an onto function.

Example 5.4.2

Consider the function g:R×RR defined by g(x,y)=x+y2.

Is this function onto?

Remark

This function maps ordered pairs to a single real numbers. The image of an ordered pair is the average of the two coordinates of the ordered pair. To decide if this function is onto, we need to determine if every element in the codomain has a preimage in the domain.

Solution

Take any real number, xR.   Choose (a,b)=(2x,0)(a,b)R×R since 2xR because the real numbers are closed under multiplication and  0R.  g(a,b)=g(2x,0)=2x+02=x.  Thus, for any real number, we have shown a preimage R×R that maps to this real number.  Therefore, this function is onto.

 

In general, how can we tell if a function f:AB is onto? The key question is: given an element y in the codomain, is it the image of some element x in the domain? If it is, we must be able to find an element x in the domain such that f(x)=y. Mathematically, if the rule of assignment is in the form of a computation, then we need to solve the equation y=f(x) for x. If we can always express x in terms of y, and if the resulting x-value is in the domain, the function is onto.

To prove a function is onto

For f:AB

  • Let y be any element in the codomain, B.
  • Figure out an element in the domain that is a preimage of y; often this involves some "scratch work" on the side.
  • Choose x= the value you found.
  • Demonstrate x is indeed an element of the domain, A.
  • Show f(x)=y.
  • Conclude with: we have found a preimage in the domain for an arbitrary element of the codomain, so every element of the codomain has a preimage in the domain. Therefore f is onto, by definition of onto.

Example 5.4.3

The function g:RR is defined as g(x)=5x+11. Prove that it is onto.

Scratch Work

We need to find an x that maps to y. Suppose  y=5x+11; now we solve for x in terms of y. We find x=y115. (We'll need to verify x is a real number - an element in the domain.)

That's the x we want to choose so that g(x)=y.  

Now for the proof:

Proof

Let y be any element of R.  
Choose  x=y115. 
Now, since the real numbers are closed under subtraction and non-zero division, xR.

g(x)=g(y115)=5(y115)+11=y11+11=y.

Thus, we have found an xR such that g(x)=y.

So, given an arbitrary element of the codomain, we have shown a preimage in the domain.
Thus every element in the codomain has a preimage in the domain. Therefore, by the definition of onto, g is onto.

Hands-on exercise 5.4.4

Determine whether  f:RR defined by f(x)={3x+1 if x2 4x if x>2  is an onto function.

Example 5.4.4

Is the function u:ZZ defined by

u(n)={2n if n0 n if n<0 

one-to-one? Is it onto?

Solution

Since u(2)=u(1)=2, the function u is not one-to-one. Since u(n)0 for any nZ, the function u is not onto.

hands-on exercise 5.4.5

Is the function v:NN defined by v(n)=n+1 onto? Explain.

Images and Preimages of Sets 

Definition: Image of a Set

Given a function f:AB, and CA, the image of  C under  f is defined as f(C)={f(x)xC}. In words, f(C) is the set of all the images of the elements of C.

A few remarks about the definition:

  1. It is about the image of a subset C of the domain of A. Do not confuse it with the image of an element x from A.
  2. Therefore, do not merely say “the image.” Be specific: the image of an element, or the image of a subset.
  3. Better yet: include the notation f(x) or f(C) in the discussion.
  4. While f(x) is an element in the codomain, f(C) is a subset of the codomain.
  5. Perhaps, the most important thing to remember is:

If yf(C), then yB, and there exists an xC
such that f(x)=y.

This key observation is often what we need to start a proof with.

Note:

Let f:AB be a function. The image of set A is the range of f, which is the set of all possible images that f can assume.

Also, if the range of f is equal to B, then f is onto.

Example 5.4.5

For the function f:RR defined by

f(x)=x2,

we find  the range of f is [0,). We also have, for example, f([2,))=[4,). It is clear that f is neither one-to-one nor onto.

Example 5.4.6

For the function g:ZZ defined by g(n)=n+3, we find range of g is Z, and g(N)={4,5,6,}. The function g is both one-to-one and onto.

Example 5.4.7

Determine f({(0,2),(1,3)}), where the function f:{0,1,2}×{0,1,2,3}Z is defined according to

f(a,b)=a+b.

Remark: Strictly speaking, we should write f((a,b)) because the argument is an ordered pair of the form (a,b). However, we often write f(a,b), because f can be viewed as a two-variable function. The first variable comes from {0,1,2}, the second comes from {0,1,2,3}, and we add them to form the image.  Notice we are asked for the image of a set with two elements.

Solution

Because f(0,2)=0+2=2,andf(1,3)=1+3=4, we determine that f({(0,2),(1,3)})={2,4}.a Set

Definition: Preimage of a Set

Given a function f:AB, and DB, the preimage  D of under  f is defined as f1(D)={xAf(x)D}. Hence, f1(D) is the set of elements in the domain whose images are in C. The symbol f1(D) is also pronounced as “f inverse of D.”

Some remarks about the definition:

  1. The preimage of D is a subset of the domain A.

  2. In particular, the preimage of B is always A.

  3. The key thing to remember is:

    If xf1(D), then xA, and f(x)D.

  4. It is possible that f1(D)= for some subset D. If this happens, f is not onto.

  5. Therefore, f is onto if and only if f1({b}) for every bB.

Example 5.4.8

If t:RR is defined by t(x)=x25x+5, find t1({1}).

Solution

We want to find x such that t(x)=x25x+5=1. Hence, we have to solve the equation 0=x25x+6=(x2)(x3). The solutions are x=2 and x=3. Therefore, t1({1})={2,3}.

hands-on Exercise 5.4.6

If k:QR is defined by k(x)=x2x7, find k1({3}).

Example 5.4.9

For the function f:{0,1,2}×{0,1,2,3}Z defined by f(a,b)=a+b, we find f1({3})={(0,3),(1,2),(2,1)},f1({4})={(1,3),(2,2)}. Since preimages are sets, we need to write the answers in set notation.

Summary and Review

  • A function f:AB is onto if, for every element bB, there exists an element aA such that f(a)=b.
  • Know how to prove f is an onto function.
  • To show that a function is not onto, all we need is to find an element yB, and show that no x-value from A would satisfy f(x)=y.
  • In addition to finding images & preimages of elements, we also find images & preimages of sets.
  • Given a function f:AB, the image of CA is defined as f(C)={f(x)xC}.
    • If yf(C), then yB, and there exists an xC such that f(x)=y.
  • The preimage of DB is defined as f1(D)={xAf(x)D}.
    • If xf1(D), then xA, and f(x)D.

Exercises 

exercise 5.4.1

Determine which of the following are onto functions.

  1. f:ZZ; f(n)=n3+1
  2. g:QQ; g(x)=n2
  3. h:RR; h(x)=x3x
  4. k:RR; k(x)=5x
Solution

(a) Not onto (b) Not onto (c) Onto (d) Not onto .

exercise 5.4.2

Determine which of the following are onto functions.

  1. p:P({1,2,3,,n}){0,1,2,,n}; p(S)=|S|
  2. q:P({1,2,3,,n})P({1,2,3,,n}); q(S)=¯S

exercise 5.4.3

Determine which of the following functions are onto.

  1. f1:{1,2,3,4,5}{a,b,c,d}; f1(1)=b, f1(2)=c, f1(3)=a, f1(4)=a, f1(5)=c
  2. f2:{1,2,3,4}{a,b,c,d,e}; f2(1)=c, f2(2)=b, f2(3)=a, f2(4)=d
  3. f3:ZZ; f3(n)=n
Solution

f1 and f2 are not onto, f3 is onto.

exercise 5.4.4

Determine which of the following functions are onto.

  1. g1:{1,2,3,4,5}{a,b,c,d,e}; g1(1)=b, g1(2)=b, g1(3)=b, g1(4)=a, g1(5)=d
  2. g2:{1,2,3,4,5}{a,b,c,d,e}; g2(1)=d, g2(2)=b, g2(3)=e, g2(4)=a, g2(5)=c

Exercise 5.4.5

Is it possible for a function from {1,2} to {a,b,c,d} to be onto? Explain.

Answer

No, because we have at most two distinct images, but the codomain has four elements.

exercise 5.4.6

List all the onto functions from {1,2,3,4} to {a,b}?

Hint

List the images of each function.

exercise 5.4.7

Determine which of the following functions are onto.

  1. f:Z10Z10; h(n)3n (mod 10).
  2. g:Z10Z10; g(n)5n (mod 10).
  3. h:Z36Z36; h(n)3n (mod 36).
Solution

(a) Onto (b) Not onto (c) Not onto

exercise 5.4.8

Determine which of the following functions are onto.

  1. r:Z36Z36; r(n)5n (mod 36).
  2. s:Z10Z10; s(n)n+5 (mod 10).
  3. t:Z10Z10; t(n)3n+5 (mod 10).

exercise 5.4.9

Given a function f:AB, and CA, since f(C) is a subset of B, the preimage of this subset is indicated by the notation f1(f(C)). Consider the function f:ZZ defined by f(x)=x2, and C={0,1,2,3}.

(a) Find f(C).

(b) Find f1(f(C)).

Solution

(a) f(C)={0,2,4,9}.
(b) f1(f(C))={3,2,1,0,1,2,3}.

exercise 5.4.10

Give an example of a function f:NN that is

  1. neither one-to-one nor onto
  2. one-to-one but not onto
  3. onto but not one-to-one
  4. both one-to-one and onto

Exercise 5.4.11

For each of the following functions, find the image of C, and the preimage of D.

(a) f1:{1,2,3,4,5}{a,b,c,d}; f1(1)=b, f1(2)=c, f1(3)=a, f1(4)=a, f1(5)=c; C={1,3}, D={a,c}.

(b) f2:{1,2,3,4}{a,b,c,d,e}; f2(1)=c, f2(2)=b, f2(3)=a, f2(4)=d;C={1,3}, D={b,d}.

(c) f3:{1,2,3,4,5}{a,b,c,d,e}; f3(1)=b, f3(2)=b, f3(3)=b, f3(4)=a, f3(5)=d; C={1,3,5}, D={c}.

(d) f4:{1,2,3,4,5}{a,b,c,d,e}; f4(1)=d, f4(2)=b, f4(3)=e, f4(4)=a, f4(5)=c; C={3}, D={c}.

Solution

(a) f1(C)={a,b} ; f11(D)={2,3,4,5}
(b) f2(C)={a,c} ; f12(D)={2,4}
(c) f3(C)={b,d} ; f13(D)=
(d) f4(C)={e} ; f14(D)={5}

Exercise 5.4.12

Define the r:Z×ZQ according to r(m,n)=3m5n.

  1. Find r({1,2,3}×{1,0,1}).
  2. Find r1({2527}).
  3. Find r1(D), where D={3,9,27,81,}.

Exercise 5.4.13

The function u:RR is defined as u(x)=3x+11, and the function v:ZR is defined as v(x)=3x+11.

  1. Find u([3,5)) and v({3,4,5}).
  2. Find u1((2,7]) and v1((2,7]).
Solution

(a) u([3,5))=[20,26] and  v({3,4,5})={20,23,26}.
(b)  u1((2,7])=(3,43] and v1((2,7]={2}).

Exercise 5.4.14

Is the function h:ZZ defined by h(n)={2n if n0 n if n<0  one-to-one? Is it onto?

Exercise 5.4.15

The function f:R×RR×R is defined as f(x,y)=(x+y,3y).

(a) Find f(3,4)f(2,5)f(2,0).

(b) Is f onto?

(c) Is f one-to-one?

Answer

(a) f(3,4)=(7,12)f(2,5)=(3,15)f(2,0)=(2,0).
(b) Consider any (a,b) in the codomain.  Let (x,y)=(ab3,b3). Since R is closed under subtraction and non-zero division, ab3R and b3R , thus (x,y)R×R
Then f(x,y)=f(ab3,b3)=(a,b).  So, every element in the codomain has a preimage in the domain and thus f is onto.
(c) Yes, if  f(x1,y1)=f(x2,y2) then (x1+y1,3y1)=(x2+y2,3y2). This means 3y1=3y2 and (dividing by 3) y1=y2.
Now, since x1+y1=x2+y2, subtract equals, y1 and y2 from both sides to get x1=x2.  Because x1=x2 and  y1=y2, we have (x1,y1)=(x2,y2). 
f(x1,y1)=f(x2,y2)(x1,y1)=(x2,y2), so f is one-to-one.

 


This page titled 5.4: Onto Functions and Images/Preimages of Sets is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Harris Kwong (OpenSUNY) .

  • Was this article helpful?

Support Center

How can we help?