Definition. A function is a mapping from a
domain to a codomain. The domain is the set of all possible inputs
to the function, and the codomain is the set of all possible
outputs of the function. A function f can be denoted as being
mapped from the domain A to the codomain B as f: A
B.
Ex. Suppose we have the following sets:
A = { 0, 1, 2, 3, 4, 5 }
B = { 0 , 1, 1/2, 1/3, 1/4, 1/5 , 4, 9, 16, 25 }
And we allow the function f to be as follows:
f: A B
= f(x) = 1 / x.
g: A B
= g(x) = x*x.
g: A B
= { f(0) = 25, f(1) = 1/3, f(2) = 1/5, f(3) =
1, f(4) = 1}
Notice that all of the domain and codomain do not have to be used.
Also, elements in the codomain can be used multiple times, however, an
element in the domain can only be mapped once.
Definition. The image is a subset of the domain that is
used as actual inputs. The range is subset of the codomain that is
used by the image. The preimage is the subset of the domain that
contains all the elements which could cause a given range. The preimage is
denoted as f -1, and while it appears to be the inverse
function, it is not the same thing.
The preimage is formally defined as:
f -1 (B) = { x
A : f(x)
B }.
The preimage consists of all the elements of A that, once passed
through the function, become an element passed to the preimage. I know
that sounds really confusing, but after an example it'll be pretty clear
how simple it is.
Ex. Using our above function f and applying the image {
1, 2, 3, 4, 5 }, the range is { 1, 1/2, 1/3, 1/4, 1/5 }.
Ex. Suppose we have the following sets:
A = { -2, -1, 0, 1, 2, 3, 4, 5 }
B = { -1, 0 , 1, 2, 3, 4, 5 }
And the following function:
f: A B
= f(x) = Abs) = (the absolute value of x)
f(-1) = 1, f(0) = 0, f(1) = 1, f(2) = 2,
f(3) = 3, f(4) = 4, f(5) = 5
When using the image { -1, 0, 1 }, the range is { 0, 1}.
The preimage of { 1 } is { -1, 1 }.
The preimage of { 1, 2 } is { -2, -1, 1, 2 }.
The preimage of { -1 } is the null set (empty set), since no values in
A could give a function output of { -1 }.
Definition. A function is onto and called a surjection
if every element in the domain maps to every element in the codomain. A
function is one-to-one and called an injection if no
elements in the range are used more than once.
Ex. Given A = { 1, 2, 3, 4 } and B = { 0 } and
f: A B,
and f(1) = 0, f(2) = 0, f(3) = 0, and f(4) =
0, f is onto and therefore a surjection
Given f: B
A, and f(0) = 3, f is one-to-one and therefore an
injection.
Definition. A function is a bijection if it both
one-to-one and onto. Two sets have the same cardinality if and only if a
bijection can be formed between the two sets.
Ex. A bijection can be formed between the integers
, the natural numbers
, and the rational
numbers . |