Relations as functions

We can view functions as a special kind of relations because every function from AA to BB is a special subset of A×BA\times B. A function ff from the set AA to the set BB is a subset of A×BA\times B that contains exactly one ordered pair (a,b)(a,b) for each aAa\in A for some bBb\in B. We can write such a function in a compact way as f:ABf: A\to B. This means that a function from AA to BB relates each element of AA to exactly one element of BB. However, an element of BB can be related to more than one element of AA or even none.

Note: Remember that every function is also a relation, but a relation may or may not be a function.

Terminology

A function from AA to BB is also called a map or a mapping from AA to BB and can also be referred as a functionfrom A into B\text{from }A\text{ into } B.

If a function f:ABf: A\to B contains an ordered pair (a,b)(a,b), we write it as f(a)=bf(a)=b. In this function, we can say that the element bBb\in B is the image of the element aAa\in A under the function ff. Also, the element aAa\in A can be called a preimage of bBb\in B under ff.

Examples

Let’s take the following two sets:

Get hands-on with 1200+ tech skills courses.