Exercise 1.2 · Q4: The modulus function
Show that the Modulus Function , given by , is neither one-one nor onto, where is , if is positive or 0 and is , if is negative.
and , but . So is not one-one.
for every , so is not the image of any . So is not onto.
Hence is neither one-one nor onto.
Want the reason behind every step, the basics and the checks?
The modulus throws away the sign of a number and keeps its size. Throwing away the sign means and always give the same output, so the function is not one-one. Keeping only the size means the output is never negative, so a negative number in the codomain , such as , is never produced: not onto. Because is defined by two formulas, each claim is checked separately for and for .
- Given
- with if and if .
- To show
- is not one-one, and is not onto.
- Plan
- (1) Confirm the two formulas give exactly one output for each . (2) Not one-one: compute and with the correct pieces. (3) Not onto: show in both cases, so is never an image. (4) Conclude, and see how changing the domain or codomain changes the answer.
Basics you need
To evaluate , first decide which piece belongs to ( or ), then use only that formula. Examples: (since ), (since ), . Basics: what a function is
One-one: for all inputs (Definition 5). Onto: every in the codomain is for some in the domain (Definition 6). Basics: one-one and onto
"Not one-one" is shown by one pair with . "Not onto" is shown by one codomain value together with a proof that for every . Basics: how to prove and disprove
If , then (multiplying an inequality by reverses it). This is what makes non-negative on the second piece. Basics: integers, even and odd
Solution
The two formulas define one output for each
Every real number satisfies exactly one of and . So exactly one of the two formulas applies, and it gives one real number: or . Hence is a function from to .
With a piecewise definition it is worth confirming that the pieces do not overlap (which could give two outputs) or leave gaps (which could give none). Here the condition "positive or 0" and the condition "negative" split cleanly, with in the first piece.Evaluate a piecewise function by first choosing the piece (Basic 1).Not one-one:
Compute each value using the correct piece:
So although . Hence is not one-one.
The same happens for every : . Every positive output is shared by exactly two inputs, and .
A single pair of different inputs with equal outputs disproves one-one, because one-one is a claim about all pairs. We choose and because they sit in different pieces and the arithmetic is easy. The general line shows the failure is not an accident of one pair; it is built into the definition (the sign is discarded).One counterexample disproves a "for all" statement (Basic 3). Basics: how to prove and disproveis never negative
Check each piece:
- If , then .
- If , then , by Basic 4.
Since the two cases cover all real numbers, for every .
This is the fact the onto argument needs, and it must be proved for both pieces. It would not be enough to look at the first formula , which on its own can be negative; for negative that formula is not the one in use.Multiplying by reverses the inequality: (Basic 4).Not onto: is never an output
The number is in the codomain . By Step 3, for every , so for every . No element of the domain is mapped to , and is not onto.
The graph of (scales differ): the line on the left of the origin and on the right. The horizontal line meets it twice, at and , so is not one-one. The whole graph lies on or above the -axis, so the line never meets it and is not onto . To disprove onto we must name a value in the codomain and show that no input gives it. Choosing a negative value makes this immediate, because Step 3 already proved that all outputs are . Any negative number would do; non-negative numbers would not, since every is reached ().Definition 6: onto means every element of the codomain is an image. Equivalently, the range must equal the codomain; here the range is , not . Basics: one-one and ontoConclude, and see how the sets change the answer
is not one-one (Step 2) and not onto (Step 4), so the modulus function is neither one-one nor onto.
The verdict depends on the domain and codomain, not only on the formula :
- With codomain (domain still ), it becomes onto: any equals , since uses the first piece. It is still not one-one, since .
- With domain and codomain both , only the first piece is ever used, so . Then means (one-one), and every equals (onto). So that function is bijective.
Removing the negative inputs removes the partner of each , which repairs one-one. Shrinking the codomain to the actual range repairs onto. Seeing which change fixes which property is a good check that you understand why each property failed.
from to is not one-one, because with , and not onto, because for every real , so in the codomain is never an image. Hence it is neither one-one nor onto, as required. (The textbook's answer list gives no entry for this "show that" question; the result is the statement asked for.)
, and : pairs of opposite numbers share an output, and is the only output with a single preimage. A computer check of inputs from to in steps of finds different outputs, every one of them ; never appears.
- Using the wrong piece. uses because : , not .
- Reading "" as " is negative". For negative , the number is positive.
- Disproving onto with a positive value. Every is reached. Only negative values are missed.
- Forgetting that the answer depends on the sets. On the same formula gives a bijection.
- For a piecewise function, check each claim on every piece, and choose the piece by the input, not by the formula you would like to use.
- "Symmetric" functions with (such as and ) are never one-one on a domain that contains some together with .
- If all outputs satisfy a restriction (here ) that some elements of the codomain fail, the function is not onto: pick a codomain value that breaks the restriction.
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| for , for | Steps 1 to 5 | Statement of Exercise 1.2, Q4 |
| Step 3 | Order properties of real numbers | |
| Definition of one-one | Steps 2, 5 | Definition 5, Section 1.3 (Lesson: types of functions) |
| Definition of onto; onto range = codomain | Steps 4, 5 | Definition 6 and the Remark after it, Section 1.3 |
| Bijective means one-one and onto | Step 5 | Definition 7, Section 1.3 |
| All numerical values and graph coordinates | Check, figure | Recomputed in the site's verification script |
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →