Let f : A → B be a function.

We call f an INJECTIVE (or ONE-TO-ONE) function if f(a1) = f(a2) ⇒ a1 = a2 for all a1,a2 ∈A.

Since this is logically equivalent to the statement a1 ≠ a2 ⇒ f(a1) ≠ f(a2), an injective function never repeats values. In other words, different inputs give different outputs.

We call f a SURJECTIVE (or ONTO) function if the range of f coincides with the codomain of f.

This means that for every b∈B there exists an a∈A with b = f(a). In other words, each element in the codomain is a value of the function.