I’ve gotten a different answer than the one provided by the professor, and based on how the question is worded and the definition of onto, the answer ought to be no.
Textbook definition of onto: “A function f from A to B is called onto, or a surjection, if and only if for every element b ∈ B there is an element a ∈ A with f(a) = b. A function f is called surjective if it is onto.”
This is ℤ: {…, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, …}
Both and () are in ℤ.
If is onto, then for every element in ℤ, there should be a corresponding in ℤ that produces it when fed to the function . However, the output of is only even integers—excludes odd integers. For that reason, cannot be onto because there are some elements in ℤ that are not outputs of .
| () | Comment | |
|---|---|---|
| -1 | -5 | |
| ❌ | -4 | no corresponding input in ℤ |
| 0 | -3 | |
| ❌ | -2 | no corresponding input in ℤ |
| 1 | -1 |