Skip to main content

Discrete Mathematical Structures

Subsection 2.3.4 Injective functions

Some functions “lose information” in the sense that the output does not uniquely determine the input. For example, consider the father function \(F\) given in Example 2.3.1.9. Knowing that the father of \(x\) is George Foreman does uniquely determine \(x\) since George Foreman has twelve children (including five sons all named George). Other functions do not lose information in this way. This property is known as injectivity. Namely, injective functions are the functions that do not lose information.

Definition 2.3.4.1.

Let \(f \colon A \to B\) be a function. The function \(f\) is injective or one-to-one if for all \(a\) and \(\ah\) in \(A\text{,}\) \(f(a) = f(\ah)\) implies \(a = \ah\text{.}\)

Example 2.3.4.2. Squaring function is not injective.

The squaring function \(f \colon \RR \to \RR\) defined by \(f(x) = x^2\) is not injective because \(f(-2) = f(2)\text{,}\) but \(-2 \neq 2\text{.}\)
Example 2.3.4.2 shows the general technique for showing a function is not injective.

Example 2.3.4.4. Students and ID.

The function \(U\) denote the set of UNCG students, and consider the function \(\ID \colon U \to \ZZ\) that assigns to each student their university ID. In other words, \(\ID(x)\) is the university ID of \(x\text{.}\) These ID numbers are unique by design so that so that no two students have the same university ID. Specifically, the only way to have \(\ID(\text{student }a) = \ID(\text{student }\ah)\) is to have student \(a\) be the same student as \(\ah\text{.}\) The \(\ID\) function is injective.
For an injective function, every element in the codomain can have at most one preimage.
Two sets A and B are represented each by an oval.  The ovals do not overlap. Inside A are the numbers 1, 2, 3 and 4. Inside B are the numbers 1, 2, 3 and 4. An arrow labeled f goes from 1 in A to to 4 in B. An arrow labeled f goes from 2 in A to to 3 in B. An arrow labeled f goes from 3 in A to to 1 in B. An arrow labeled f goes from 4 in A to to 3 in B.
Figure 2.3.4.5. Graphical representations of an injective function \(f:A\to B\) where \(A=\set{1,2,3,4}\) and \(B=\set{1,2,3,4}\text{.}\) Each element in the codomain \(B\) has at most one preimage in the domain \(A\text{.}\)
Two sets A and B are represented each by an oval.  The ovals do not overlap. Inside A are the numbers 1, 2, and 3. Inside B are the numbers 1, 2, 3 and 4. An arrow labeled f goes from 1 in A to to 1 in B. An arrow labeled f goes from 2 in A to to 4 in B. An arrow labeled f goes from 3 in A to to 3 in B.
Figure 2.3.4.6. Graphical representations of an injective function \(f:A\to B\) where \(A=\set{1,2,3}\) and \(B=\set{1,2,3,4}\text{.}\) Each element in the codomain \(B\) has at most one preimage in the domain \(A\text{.}\)
Two sets A and B are represented each by an oval.  The ovals do not overlap. Inside A are the numbers 1, 2, 3 and 4. Inside B are the numbers 1, 2, 3 and 4. An arrow labeled f goes from 1 in A to to 2 in B. An arrow labeled f goes from 2 in A to to 3 in B. An arrow labeled f goes from 3 in A to to 1 in B. An arrow labeled f goes from 4 in A to to 2 in B.
Figure 2.3.4.7. Graphical representation of a function \(f:A\to B\) where \(A=\set{1,2,3,4}\) and \(B=\set{1,2,3,4}\) that is not injective. There is an element in the codomain has more than one preimage. Both \(1\) and \(4\) map to \(2\text{,}\) so \(2\) has two preimages.
Two sets A and B are represented each by an oval.  The ovals do not overlap. Inside A are the numbers 1, 2, 3 and 4. Inside B are the numbers 1, 2, 3 and 4. An arrow labeled f goes from 1 in A to to 1 in B. An arrow labeled f goes from 2 in A to to 3 in B. An arrow labeled f goes from 3 in A to to 3 in B. An arrow labeled f goes from 4 in A to to 3 in B.
Figure 2.3.4.8. Graphical representation of a function \(f:A\to B\) where \(A=\set{1,2,3,4}\) and \(B=\set{1,2,3,4}\) that is not injective. There is an element in the codomain has more than one preimage. Because \(2\text{,}\) \(3\text{,}\) and \(4\) map to \(3\text{,}\) the element \(3\) of the codomain has three preimages.

Example 2.3.4.9. Prove injectivity.

Let \(f \colon \RR \to \RR\) be the function \(f(x) = 3x - 2\text{.}\) Show that \(f\) is injective
Solution.
We show \(f\) is injective using the definition.
  1. First, we rewrite what we want to show in the form “if \(p\text{,}\) then \(q\text{.}\)” This will involve giving names to objects, and recalling the definition of injective. We want to prove \(f\) is injective, which means we want to prove: “If \(f(a_1) = f(a_2)\text{,}\) then \(a_1 = a_2\text{.}\)”
  2. As before, to prove a statement of the form “if \(p\text{,}\) then \(q\)” directly, we assume \(p\) is true and try to show \(q\text{.}\) This is commonly where we set some notation as well. It is also a good place to remind the reader what we want to show, for example, “Let \(a_1\) and \(a_2\) be real numbers such that \(f(a_1) = f(a_2)\text{.}\) We want to show that \(a_1 = a_2\)”.
  3. Now look back at the goal. It should be some relationship between \(a_1\) and \(a_2\text{.}\) It makes sense to write out what we know and simplify to see if we get what we want.
    \begin{align*} f(a_1) \amp = f(a_2) \\ 3a_1 -2 \amp = 3a_2 -2 \\ 3a_1 \amp = 3 a_2 \\ a_1 \amp =a_2 \end{align*}
  4. The part above should complete the proof. Since we chose generic \(a_1\) and \(a_2\) from the domain of \(f\text{,}\) the argument covers all \(a_1\) and \(a_2\) in the domain of \(f\text{.}\)
The technique in Example 2.3.4.9 can be generalized to prove a function is injective.