# Can an injective function have unmapped elements of the domain?

I know that a function is injective if every element of the domain maps onto at most one element of the co-domain, that is, if $$f(x_{1}) = f(x_{2})$$ implies $$x_{1} = x_{2}$$, or the contrapositive. However, is it allowable for an injective function to have some number of elements $$n$$ that don't map onto any values in the co-domain? It seems like, at most, there could be one unmapped element. Otherwise, with an unmapped $$x_{1}$$, $$x_{2}$$, $$f(x_{1}) = f(x_{2}) = \varnothing$$, implying that in fact $$x_{1} = x_{2}$$.

Am I missing something here?

• The definition of the domain is that every element of it is mapped to something... Commented Jul 16, 2020 at 23:05
• A function is a mapping... Commented Jul 16, 2020 at 23:12

It is possible to have what is called a partial function from a set $$A$$ to a set $$B$$: this is a subset $$f$$ of $$A\times B$$ such that for each $$a\in A$$ there is at most one $$b\in B$$ such that $$\langle a,b\rangle\in f$$. In other words, $$f$$ is a function from some subset $$D$$ of $$A$$ to $$B$$. However, the domain of $$f$$ is that subset $$D$$, not $$A$$ itself (unless, of course, $$D=A$$, in which case it is called a total function on $$A$$): by definition $$a$$ is in the domain of $$f$$ if and only if there is some $$b\in B$$ such that $$\langle a,b\rangle\in f$$.
Your last sentence contains a significant misunderstanding: $$f(x)$$ is undefined does not mean that $$f(x)=\varnothing$$. If $$f(x)$$ is undefined for some particular $$x$$, then every statement of the form $$f(x)=y$$ is false.