Definition 5.27 (Domain, Codomain, Image, Preimage)

Let f:A→B be a function

Then the set A is called the domain of the function f, and the set B is called the codomain of the function f

If f(a)=b, we say that b is the image of a, and a is the preimage of b

The range (also called image) of f is the set of all images of elements of A

Also if f is a function from A to B, we say the f maps A to B

Example

What is the domain, codomain and range of the function that assigns grades to the students of our module?

\color{lightgreen}\text{The domain is the set of students in our module}
\color{lightgreen}\text{The codomain is the set of all possible grades}

\color{lightgreen}\text{The range is the set of those grades,}
that have been assigned to at least one student

When specifying a function, you always need to say

  1. Which set you choose as the domain,
  2. Which set you choose as the codomain, and
  3. For each memeber of the domain you have to say which member of the codomain it is mapped to
Important

Note that if you change the domain or the codomain, you have a different function.
If you change the mapping of the elements, you also have a different function.