One-to-One and Onto Functions
Two different coverage questions for functions
For a function f:A→B, the domain A is the set of permitted inputs and the codomain B is the stated target set. The words one-to-one and onto answer different questions about the arrows between these sets.
A mapping from a domain to a stated codomain. Labels identify elements for the questions.
One-to-one (injective)
A function is one-to-one if distinct inputs never share an output. Formally, f(a)=f(b) implies a=b. On an arrow diagram, inspect the target endpoints: no target element may receive arrows from two different domain elements. A function can be one-to-one even if some codomain values are unused.
Onto (surjective)
A function is onto if every element of the codomain is hit by at least one input. In symbols, for every b∈B, there is an a∈A with f(a)=b. On an arrow diagram, every element drawn in the codomain needs at least one incoming arrow. An onto function may send several inputs to the same target.
Worked classification
Suppose a function maps three inputs to three displayed codomain values, with exactly one arrow ending at each value. No outputs repeat and none are left unused.
It is both one-to-one and onto, hence bijective. If two inputs instead end at the same codomain value, it is not one-to-one; if another codomain value then has no arrow, it is also not onto.
Let f:{1,2,3}→{a,b,c,d} be given by f(1)=a, f(2)=b, and f(3)=c. How should f be classified?
Refer to the figure. Which classification applies to the displayed mapping f:A→B?
A mapping from a domain to a stated codomain. Labels identify elements for the questions.