What is the relationship between one-to-one and onto? Can a one-to-one function be onto? Can an onto function be one-to-one? Must a one-to-one function be onto? Must an onto function be 1-1?
$\endgroup$ 65 Answers
$\begingroup$Onto function:
A function $f$ from $A$ to $B$ is called onto if for all $b$ in $B$ there is an $a$ in $A$ such that $f (a) = b$. All elements in $B$ are used.
1-1 function:
A function $f$ from $A$ to $B$ is called one-to-one (or 1-1) if whenever $f (a) = f (b)$ then $a = b$. No element of $B$ is the image of more than one element in $A$.
Onto functions could be 1-1 functions, and 1-1 functions could also be onto functions.
You may find this website useful
$\endgroup$ $\begingroup$The simplest way to think about injectivity (one-to-one), surjectivity (onto), and bijectivity (one-to-one and onto) of a mapping $f$ between sets $f : A \to B$, is to consider the number of preimages of $x \in B$ under $f$. For each $x \in B$,
Injective: $x$ has at most one preimage in $A$.
Surjective: $x$ has at least one preimage in $A$.
Bijective: $x$ has exactly one preimage in $A$.
$\endgroup$ $\begingroup$To explain this, it helps to have a list of the "parts of a function".
There are three main "parts" to a function $f:A \to B$.
The domain (this is $A$).
The co-domain (this is $B$, and it is different than the "range").
The rule (this tells us which $b \in B$ any $a \in A$ maps to, which we indicate by writing $b = f(a)$.)
There are two other "kinds" of sets that are useful for describing a function $f: A \to B$.
If $X \subseteq A$, we have the set $f(X) = \{y \in B: y = f(x), x \in X\}$, called the image set of $X$. If $X$ has just one element in it, say $X = \{a_0\}$, then so does $f(X) = \{f(a_0)\}$. But functions can send more than one domain element to the same co-domain element, for example the function:
$f:\Bbb R \to \Bbb R$ with the rule $f(x) = x^2$, sends both $2$ and $-2$ to $4$.
The other kind of useful set is called a pre-image set: if $Y \subset B$, we have:
$f^{-1}(Y) = \{x \in A: f(x) \in Y\}$.
If $f$ is the squaring function on the reals I gave above, we have $f^{-1}(\{4\}) = \{-2,2\}$.
Now any function maps singleton sets to singleton sets. We say a function is one-to-one if the pre-image $f^{-1}$ (which is defined on SUBSETS of $B$) maps singletons to singletons (hence the name "one-to-one"). This is the same as saying any domain element maps to a co-domain element that NO OTHER domain element maps to.
We say a function is onto if $B = f(A)$ (that is, any $b \in B$ has a pre-image in $A$).
It is possible for a function to be both one-to-one AND onto, such a function is then called a "one-to-one correspondence" or bijection. For example, the function:
$g: \Bbb R \to \Bbb R$ given by $g(x) = x+1$ is both:
If $g(x) = g(y)$, then $x + 1 = y + 1 \implies x = y$, so each real number is mapped under $g$ to a unique image no other real number is mapped to.
On the other hand, given $a \in \Bbb R$, we have $a - 1 \in \Bbb R$, and $g(a - 1) = (a - 1) + 1 = a$, so any real number is realizable as the image of some other real number under $g$.
The squaring function I gave above is neither one-to-one nor onto (no negative real numbers are in the image). The function:
$h: \Bbb Z \to \Bbb Z$ given by $h(n) = 2n$ is one-to-one, but not onto.
The function $k: \Bbb R \to \{1\}$ given by $k(x) = 1$ is onto, but certainly not one-to-one.
$\endgroup$ $\begingroup$Onto = Surjective, i.e. every element in the codomain is mapped by some element in the domain
One-to-one = Injective, i.e. no two distinct elements in the domain are mapped to the same element in the codomain
Those two properties are independent. If a function is one-to-one and onto, it is called a bijection.
PS: please use Google next time; looking up the definition of those two terms would have immediately given you the answer
$\endgroup$ $\begingroup$A function is onto (or surjective) iff every element of its codomain is the image of at least one element of the domain, and it is one to one (or injective) if there are no two different elements of the domain that have the same image
$\endgroup$