Mathematics · Ch 15 — Functions
Function
Function
A function (or mapping) from a set to a set , written , is a relation which associates to every element in a unique (exactly one) element in . We write , and say is the image of under . The word 'function', 'map' and 'transformation' are used interchangeably.
If such a function exists, is called the domain of (the set of allowed inputs) and is called the co-domain of (the set that outputs are guaranteed to land inside — not necessarily every element of 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 might be left with no arrow to at all (Fig. 6.2) — this breaks 'every'.
- Some element of might have two or more arrows to different elements of (Fig. 6.3) — this breaks 'unique'.
A function from to is often given by an algebraic rule rather than a picture. For example, if (the integers) and (the rationals), the rule for defines a function, since dividing any integer by 7 always gives exactly one rational number.
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.
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).
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).