In this explainer, we will learn how to determine whether a function is a one-to-one function (injective).
We recall that the definition of a function requires each element of its domain to be associated with exactly one element of its range. For a function to be injective, it must also satisfy this statement with the roles of its domain and range reversed.
Definition: Injective Function
A function is injective, or one to one, if each element of the range of the function corresponds to exactly one element of the domain.
Together with the requirement for it to be a function, we can say that there is a one-to-one correspondence between each element of the domain and a unique element in the range of an injective function. This is why we also refer to an injective function as a one-to-one function.
In the picture above, two functions and are described by their mapping diagrams. The function has two elements (4 and 5) in its range. While the range element 4 has exactly one arrow pointed to it corresponding to the domain element 3, the range element 5 has two different arrows corresponding to the domain elements 1 and 2. Since each element of the range should correspond to exactly one element of the domain for an injective function, we can say that is not injective. On the other hand, each element of the range of function has exactly one arrow pointed to it, corresponding to exactly one element of the domain. So, function is injective.
Let us think through an example where we use mapping diagrams for functions to determine their injectivity.
Example 1: Sum of Two Injective Functions
True or False: If and are both one-to-one functions, then must be a one-to-one function.
Answer
We will show that the statement is false via a counterexample.
We recall that a function is one to one if each element of the range of the function corresponds to exactly one element of the domain. In mapping diagrams, this means that each element in the range has exactly one arrow pointing to it.
Consider functions and represented by the mapping diagrams below:
Both functions and are injective because each element of the range has exactly one arrow from the domain pointed at it. When we add and , we obtain the following diagram.
Noting that all three lines in the range give the same number, the mapping diagram for is given below.
Since the range element 10 has three arrows pointing to it, this range element corresponds to more than one of the domain elements. Hence, the function is not injective.
We have shown by a counterexample that the given statement is false.
We can easily recognize injective functions from their mapping diagrams, but how do we recognize them from their graphs in the -plane? We know that the range of a function is given by the portion of the vertical axis used by its graph, while the domain is given by the portion of the horizontal axis used by its graph. Since an injective function must associate each element of its range with a unique element in its domain, there must be exactly one point on the horizontal axis within the domain associated with each point of the function, within its range on the vertical axis.
We can test for this condition by drawing a horizontal line for each range element and checking how many times the graph intersects with the line. If there is more than one intersection between the horizontal line and the function’s graph, then that range element is associated with more than one domain element. In this case, the function would not be injective. Let us look at two examples.
For function in the first diagram, we are able to draw a horizontal line for the range element 2 which intersects with the graph of more than once. More precisely, the range element 2 corresponds to the three distinct domain elements , 0, and 3. Hence, function is not injective. On the other hand, we can see that any horizontal line drawn across the graph of in the second diagram intersects with the graph at exactly one point. By sliding a ruler horizontally up and down the graph, we can verify that there is no horizontal line that intersects with the graph more than once. This means that each range element of corresponds to exactly one domain element. So, function is injective. This process is called the horizontal line test.
Theorem: Horizontal Line Test
A function is injective, or one to one, if each horizontal line intersects the graph of a function at most once.
A function is not injective, or one to one, if there is a horizontal line that crosses its graph more than once.
This is similar to the vertical line test that is used to verify the definition of a function. In place of vertical lines, we use horizontal lines to verify whether a function satisfies the definition of injective, or one to one.
We note that there is no reference to the range of the function in the horizontal line test. If a given horizontal line does not belong to an element of the range, then it will not intersect the graph, so a horizontal line may intersect the graph of an injective function zero times. In other words, the condition for being injective is that the graph of the function intersects each horizontal line at most once.
Let us consider a few examples where we use the horizontal line test to determine whether or not a function is injective.
Example 2: Identifying One-to-One Functions from Their Graph
Is the function shown in the graph a one-to-one function?
Answer
We recall the horizontal line test, which states that a function is one to one, or injective, if and only if its graph intersects with each horizontal line at most once. Let us use the horizontal line test on the given graph.
In the picture above, we have drawn a horizontal line that crosses the graph at three different points: that is, where , where is close to 0, and where . This means that the function fails the horizontal line test.
Hence, the given function is not one to one.
Let us consider another example applying the horizontal line test to become more familiar with different contexts.
Example 3: Identifying One-to-One Functions from Their Graph
Which curve among those shown in the graph below is a one-to-one function?
Answer
We recall the horizontal line test, which states that a function is one to one, or injective, if and only if its graph intersects with each horizontal line at most once.
Let us begin with the red graph. Our goal is to draw, if possible, a horizontal line that crosses the graph more than once, thereby indicating that the function is not injective.
In the picture above, we have drawn a horizontal line that crosses the red graph twice. So, the function represented by the red graph is not one to one.
Similarly, in the second picture, we are able to draw a horizontal line crossing the green graph three times. Hence, the function represented by the green graph is not one to one.
In the third picture, we are able to draw a horizontal line crossing the yellow graph twice, so by the horizontal line test, the function represented by the yellow graph is not one to one.
Finally, in the fourth picture, we have drawn several horizontal lines to search for one that intersects the blue graph more than once, but we could find no line that does this. By sliding a horizontal ruler up and down the graph, we can be sure that no such horizontal line exists. Each horizontal line crosses the blue graph at most once, so by the horizontal line test, the function represented by the blue graph is one to one.
Hence, only the blue graph represents a one-to-one function.
In the previous two examples, we used the horizontal line test to determine whether a given graph represents an injective function. If we are given the algebraic expressions for functions rather than their graphs, then the horizontal line test is not the ideal method to apply because it requires an accurate graph.
On the other hand, we can apply the horizontal line test algebraically in the following sense. In the horizontal line test, we search for a horizontal line that intersects the graph at more than one point. Consider applying the horizontal line test to function in the graph below.
Since such a horizontal line exists, that is, a line that intersects the graph at more than one point, there are at least two values, say and , for a single value such that
It may be the case, as in the graph above, that there are more than two -values corresponding to a single -value; however, we need only find two such points since if two -values correspond to the same -value, then the given function is not one to one. We state the following method.
How To: Identifying Injective Functions Algebraically
Given an algebraic expression for a function ,
- if there are two different -values from the domain, say and , satisfying , then is not injective;
- is injective if the conditions that and that and belong to the domain imply that .
Let us consider an example where we identify injective functions from their algebraic expressions.
Example 4: Identifying One-to-One Functions
Which of the following is a one-to-one function?
Answer
We recall that a function is not one to one if there are two different -values from the domain, say and , satisfying
Let us consider each possible option with respect to this condition.
- is the absolute value function. We know that two numbers of the same size but with opposite signs have the same absolute value. For example, if we choose and , then Since , is not one to one.
- is the square function. Just like the absolute value function, two numbers of the same size but with opposite signs have the same squared value. For example, if we choose and , then Since , is not one to one.
- is a constant function. Whichever number we input to a constant function, the output will always be the same. For example, if we choose and , then Since , is not one to one.
- We recall that a function is one to one if the conditions
that and that
and belong to the domain of
imply that .
Say that for the function . Then,
Subtracting 2 from both sides of the equation, we see that this condition implies . This tells us that is only possible when . So, in this case, is one to one.
Thus, the only one-to-one function from the given list is D.
Let us consider an example where we identify injective functions with restricted domains.
Example 5: Identifying One-to-One Functions with Restricted Domains
Which of the following is not a one-to-one function on the interval ?
Answer
We recall that a function is one to one if the conditions
- ,
- and belong to the domain of
imply that . On the other hand, we can say that is not one to one if we can find two distinct and , that is, , in its domain satisfying
Let us consider each example with this condition.
- is the absolute value function. Note that the domain of the function is restricted to in this example; that is, . If , then we note that Hence, if and , then we must have . This implies that is one to one on the interval .
- is the square function. If , then We can factor this equation by using the difference of the square formula, for any constant and : Then, the equation can be written as For the last equation to hold, we must have either Since both and are in and, therefore, are nonnegative, the second equation is only possible if both and are equal to zero. On the other hand, the first equation implies that . In either case, we must have . Hence, is one to one on the interval .
- is a constant function. Whichever number we input to a constant function, the output will always be the same. For example, if we choose and , then Since and , the function is not one to one on .
- Suppose that for the function . Then, Subtracting 4 from both sides of the equation, we get Dividing both sides of this equation by 2 gives us . This is true for any , in , so it must also be true for . Hence, is one to one on the interval .
- Suppose that for the function . Then, Since both , the denominators on both sides of the equation are positive. Cross-multiplying the equation gives us Subtracting 1 from both sides of the equation, we get Hence, is one to one on the interval .
Thus, the only function that is not one to one on from the given list is , which is C.
In our final example, we will examine the injectivity of trigonometric functions using their graphs.
Example 6: Determining Injectivity of a Trigonometric Function
Determine whether is a one-to-one function in each of the following cases.
Answer
We recall the horizontal line test, which states that a function is one to one, or injective, if its graph intersects with each horizontal line at most once.
We begin by graphing accurately. We know that is a periodic function with the period . We also know that at and when . So, we have the following graph of .
We apply the horizontal line test to this graph.
Since the given horizontal line crosses the graph more than once in the interval shown, we can conclude that the function is not one to one for . We note that, in fact, over , the horizontal line crosses the graph infinitely many times because is periodic.
On the other hand, if we restrict the domain to , then we have the following graph.
We apply the horizontal line test over this graph.
By sliding a ruler horizontally up and down the graph, we can tell that any horizontal line crosses the graph at most once. Hence, the function is one to one for .
Thus, the function is not one to one for , but it is one to one for .
Let us summarize a few important concepts from this explainer.
Key Points
- A function is injective, or one to one, if each element of the range of the function corresponds to exactly one element of the domain.
- The horizontal line test states that a function is injective, or one to one, if and only if each horizontal line intersects with the graph of a function at most once.
- A function is one to one if the conditions
- ,
- and belong to the domain of
- is not one to one if we can find two distinct and in its domain satisfying