Skip to content

Mathematics · Ch 15 — Functions

Function

15.1

Function

A function (or mapping) ff from a set AA to a set BB, written f:A→Bf:A\to B, is a relation which associates to every element xx in AA a unique (exactly one) element yy in BB. We write y=f(x)y=f(x), and say yy is the image of xx under ff. The word 'function', 'map' and 'transformation' are used interchangeably.

If such a function exists, AA is called the domain of ff (the set of allowed inputs) and BB is called the co-domain of ff (the set that outputs are guaranteed to land inside — not necessarily every element of BB is actually used).

The two things that make a relation fail to be a function are exactly the two things ruled out by the words 'every' and 'unique' above:

  • Some element of AA might be left with no arrow to BB at all (Fig. 6.2) — this breaks 'every'.
  • Some element of AA might have two or more arrows to different elements of BB (Fig. 6.3) — this breaks 'unique'.

A function from AA to BB is often given by an algebraic rule rather than a picture. For example, if A=ZA=Z (the integers) and B=QB=Q (the rationals), the rule f(n)=n7f(n)=\dfrac{n}{7} for n∈Zn\in Z defines a function, since dividing any integer by 7 always gives exactly one rational number.

Figure 1Fig. 6.1 — a well-defined function

What this figure shows. An arrow diagram with two ovals labelled A and B, each containing a handful of dots (elements). A short straight arrow is drawn from every single element of A to exactly one element of B — no element of A is left without an arrow, and no element of A has two arrows leaving it. This is the picture used to introduce the phrase 'well defined function': every input is committed to one and only one output.

1: Fig. 6.1 — a well-defined function.

Figure 2Fig. 6.2 — a relation that is NOT a function (missing image)

What this figure shows. The same style of two-oval arrow diagram as Fig. 6.1, but one element of the left oval A, labelled d, has no arrow leaving it at all — every other element of A has exactly one arrow to B, but d is stranded with no partner in B. The caption explains this fails the function definition because d is not associated with any element of B.

2: Fig. 6.2 — a relation that is NOT a function (missing image).

Figure 3Fig. 6.3 — a relation that is NOT a function (two images)

What this figure shows. Another two-oval arrow diagram where one element of the left oval A, labelled a, has TWO arrows leaving it, landing on two different elements of B. Every other element of A has a single arrow. The caption explains this fails the function definition because a is associated with two different elements of B at once, and a function may never assign more than one output to the same input.

3: Fig. 6.3 — a relation that is NOT a function (two images).