# Surjective and injective functions

So let's say that we have some function $f: \mathbb{A} \rightarrow \mathbb{B}$

Is it possible to have some function such that not all elements of A map to some value in B?

Like for example, in these pictures for various surjective and injective functions:

Would it be possible to have some function that has elements in A that don't map to any values of B? Like in example 1, just have the 3 in A without mapping to the element in B?

-

By definition, $f$ is a function from $A$ to $B$ if it assigns to each element $a \in A$ an element $f(a) \in B$. A partial function from $A$ to $B$ is exactly what you're after: it is a function assignment to some elements $a \in A$ values $f(a) \in B$. In a context when partial functions are discussed, if you want to emphasize that a function is not partial, then you call it a total function.

-
Exactly what I was looking for. Thank you. –  Pterodactyl Aug 6 '12 at 20:46
Curiously, real analysis and calculus are better expressed in terms of partial functions $f: \mathbb R \to \mathbb R$, which have a domain $D(f)$ and a range $R(f)$. I'll just use the name function for these. Then an injective function $f$ has an inverse $f^{-1}$, and $D(f^{-1}) = R(f), R(f^{-1}) = D(f)$. Of course the function sin is not injective but its restriction to the interval $[-\pi/2, +\pi/2]$ is injective and its inverse is our old friend sin$^{-1}$. We also have the empty function, given by, for example, log(log(sin $x$))). Notice that the solution of a first order differential equation is usually a partial function.
A,M. Abd-Allah and R. Brown, A compact-open topology on partial maps with open domain'', J. London Math Soc. (2) 21 (1980) 480-486.