Reputation: 9
Give the formal definition of a function f : Q → Q that is injective but not surjective, or prove why no such function exists.
Upvotes: -10
Views: 142
Reputation: 333
An injective function, also known as a one-to-one function, is a function where each element of the range is mapped to by at most one element of the domain. In other words, no two different elements in the domain map to the same element in the range.
A surjective function, or onto function, is one where every element of the range is mapped to by at least one element of the domain.
For a function (f: ℚ → ℚ) (from the set of rational numbers to itself) to be injective but not surjective, it must map each rational number to a unique rational number, but there must be at least one rational number that is not the image of any element from the domain.
One example of such a function is:
f(x) = x/2
if x is even,
f(x) = (x - 1)/2
if x is odd.
This function is injective because each input gives a unique output. However, it's not surjective because there's no rational number (x) such that f(x) = -1/2, for instance. Thus, not all elements in ℚ are covered by this function.
Upvotes: 0
Reputation: 391
Edit: I just realized I didn't answer your question - this is a counterexample proving that such a function exists, but it is by no means formal :).
Let's say you're mapping from X->Y.
Injective: for every element in X, you get a different element in Y. If your function is NOT surjective, then not every element in Y is reached by an f(x).
So an injective but not surjective function would be one where (1) there are fewer elements in X than in Y, (2) your mapping is a one-to-one function, where each element in X maps to a different element in Y, and (3) where all the things that you map to from all the elements in X exist in Y.
For example: X={1, 2, 3}, Y={10, 20, 30, 40}, f(x) = 10*x.
Upvotes: 0