On injective, bijective, surjective

Consider a function $$f: \mathcal{A}\rightarrow \mathbb{R}$$ where $$\mathcal{A}\equiv \{a_1,a_2,a_3,a_4\}\subset \mathbb{R}$$ .

We know that $$f$$ is injective, i.e., $$f(a_j)\neq f(a_k)$$ $$\forall a_j\neq a_k$$.

I would like your help with the following: given that the domain of $$f$$ is finite (and hence the image set of $$f$$ is finite), does this mean that $$f$$ being injective implies $$f$$ being bijective? If not, can you give an example of $$f$$ with domain $$\mathcal{A}$$ that is injective but not bijective?

• There are more than 4 real numbers. – Randall Jan 11 at 20:26
• Just for general knowledge (it sounds somewhat related): It's true to say that a function $f:A\rightarrow B$ for two finite sets $A,B$ with $|A|=|B|$ is injective if and only if it is surjective. However this doesn't seem to be the case in your question. – Yanko Jan 11 at 20:30

Quite the opposite, in fact: there are no bijective (or even surjective) functions from a finite set to an infinite set (this a perfectly reasonable definition of "infinite set"). For an explicit example, take the function $$f: \mathcal{A}\to\mathbb{R}$$ that sents $$a_1$$ to $$1$$, $$a_2$$ to $$2$$, $$a_3$$ to $$3$$, and $$a_4$$ to $$4$$. This is clearly injective, but clearly not bijective: nothing is sent to $$5$$. Any other injective function $$\mathcal{A}\to\mathbb{R}$$ would work equally.

However, for the question that I suspect you meant to ask (at any rate, it's the closest thing to your statement that is true): if $$f: A \to B$$ is a function such that $$A$$ and $$B$$ are finite sets, and $$|A| = |B|$$, then the following are equivalent:

1. $$f$$ is injective.
2. $$f$$ is surjective.
3. $$f$$ is bijective.

To see this, note that clearly (3) implies both (1) and (2), and that if we have both (1) and (2), then we have (3), so we merely need to show that (1) implies (2), and (2) implies (1). For the former, note that if $$f$$ is injective, then there are $$|A|$$ distinct elements in its image. But $$|A| = |B|$$, so all elements of $$B$$ are in the image of $$f$$, so $$f$$ is surjective. For the latter, note that if $$f$$ is surjective, then all elements of $$B$$ are in its image, so there are $$|B|$$ distinct elements in its image, each of which must have at least one element of $$A$$ sent to it, but since $$|B| = |A|$$, each must have exactly one sent to it, and so no two elements of $$A$$ are sent to the same element of $$B$$, hence $$f$$ is injective.

• Thanks. Then I think that I have a more basic question on the definition of codomain of a function. And I apologise in advance for my very untechnical language. While the image set of a function is uniquely define, is there a "rule of thumb" to define the codomain of a function? E.g. $f=x+2$ with domain the set of natural number $\mathbb{N}$ could have as codomain $\mathbb{R}$ or also $\mathbb{N}$. In turn, the classification as injective, surjective depends on how we choose the codomain. – STF Jan 11 at 20:33
• The codomain of a function is, like the domain, part of the definition of the function. $f = x + 2$ does not define a function, by itself: you also need to specify both the domain and the codomain. As you've noticed, changing either of these changes the function. – user3482749 Jan 11 at 20:35

The map $$f$$ is definitely not surjective because it misses everything in $$\mathbb{R}\setminus\{f(a_{1}),f(a_{2}),f(a_{3}),f(a_{4})\}$$