Again, letf:A→B be a function. Theimage off is the set of valuesf actually takes on: Image(f) ={f(a)|a∈A}. The definition of a surjection can be rewritten Image(f) =B
because a surjection was defined to be a function f : A → B such that, for every b ∈ B
there is ana∈A withf(a) =b.
For eachb∈B, theinverse image ofb, writtenf−1(b) is the set of those elements inA
whose image isb; i.e.,
f−1(b) ={a|a∈Aandf(a) =b}.
This extends our earlier definition of f−1 from bijections to all functions; however, such
anf−1 can’t be thought of as a function fromB toAunlessf is a bijection because it will not give a uniquea∈A for eachb∈B.4
Suppose f is given by the functional relation R ⊂A×B. Then f−1(b) is all those a
such that (a, b)∈R. Equivalently,f−1(b) is all those asuch that (b, a)∈R−1.
Definition 4 (Coimage) Let f:A → B be a function. The collection of nonempty inverse images of elements ofB is called thecoimage of f. In mathematical notation
Coimage(f) ={f−1(b)|b∈B, f−1(b)=6 ∅}={f−1(b)|b∈Image(f)}.
We claim that the coimage of f is the partition of A whose blocks5 are the maximal subsets ofA on whichf is constant. For example, iff ∈ {a, b, c}5 is given in one line form
as (a, c, a, a, c), then
Coimage(f) ={f−1(a), f−1(c)}=
{1,3,4},{2,5} , f is aon {1,3,4} and is con {2,5}.
We now prove the claim. Ifx∈A, let y=f(x). Thenx∈f−1(y) and the set f−1(y)
is an element of Coimage(f). Hence the union of the nonempty inverse images contains
A. Clearly it does not contain anything which is not in A. If y1 6= y2, then we cannot
have x ∈ f−1(y
1) and x ∈ f−1(y2) because this would imply f(x) =y1 andf(x) =y2, a
contradiction of the definition of a function. Thus Coimage(f) is a partition of A. Since the value of f(x) determines the block to which x belongs, x1 andx2 belong to the same
block if and only iff(x1) =f(x2). Hence a block is a maximal set on which f is constant.
4 There is a slight abuse of notation here: Iff:A →B is a bijection, our new notation
is f−1(b) ={a}and our old notation is f−1(b) =a.
5 Recall that a partition of a setSis an unordered collection of disjoint nonempty subsets
Section 3: Other Combinatorial Aspects of Functions
Example 12 (f−1 as a function) Letf:A→B be a function. For eachb∈B,
f−1(b) ={a|a∈Aandf(a) =b}.
Thus, for each b∈B,f−1(b) ∈ P(A). Hencef−1 is a function with domain B and range (codomain) P(A), the set of all subsets of A. This is true for any function f and does not require f to be bijection. For example, if f ∈ {a, b, c}5 is given in one-line form as
(a, c, a, a, c), then,f−1, in two-line notation is
a b c
{1,3,4} ∅ {2,5}
If, we take the domain of f−1 to be Image(f), instead of all of B, thenf−1 is a bijection
from Image(f) to Coimage(f). In the case of our example (a, c, a, a, c), we get, in two-line notation
a c
{1,3,4} {2,5}
for the image–coimage bijection associated with f−1. If we are only given the coimage of
a function then we don’t have enough information to specify the function. For example, suppose we are given only that {{1,3,4},{2,5}} is the coimage of some function g with codomain {a, b, c}. We can see immediately that the domain of g is 5. But what isg? To specifyg we need to know the elementsx andy in {a, b, c} that make
x y
{1,3,4} {2,5}
the correct two-line description ofg−1(restricted to its image). There are (3)2= 6 choices6
for xy, namely, ab,ac, bc, ba, ca, and cb. In general, supposef:A → B and we are given that a particular partition of A with k blocks is the coimage of f. Then, by comparison with our example (A = 5, B = {a, b, c}), it is easy to see that there are exactly (|B|)k
choices for the functionf.
We can describe the image and coimage of a function by the arrow pictures introduced in Example 5. Image(f) is the set of thoseb∈B which appear as labels of arrowheads. A block in Coimage(f) is the set of labels on the tails of those arrows that all have their heads pointing to the same value; for example, the block of Coimage(f) arising fromb∈Image(f) is the set of labels on the tails of those arrows pointing to b.
Example 13 (Counting functions with specified image size) How many functions in BA have an image with exactly k elements? You will need to recall that the symbol S(n, k), stands for the number of partitions of set of sizen intokblocks. (The S(n, k) are called the Stirling numbers of the second kind and are discussed in Unit CL. See the index for page numbers.) Iff ∈BAhaskelements in its image, then this means that the coimage of f is a partition of A having exactly k blocks. Suppose that|A|=aand|B|=b. There
6 Recall that (n)
k =n(n−1)· · ·(n−k+ 1) =n!/(n−k)! is the number ofk-lists without
are S(a, k) ways to choose the blocks of the coimage. The partition of A does not fully specify a functionf ∈BA. To complete the specification, we must specify the image of the
elements in each block (Example 12). In other words, an injection from the set ofk blocks toB must be specified. This is an ordered selection of size kwithout replacement fromB. There are (b)k = b!/(b−k)! such injections, independent of which k block partition of A
we are considering. By the Rule of Product, there are S(a, k)(b)k functionsf ∈BA with |Image(f)|=k. For example, when the domain is 5 and the range is {a, b, c}, the number of functions with |Image(f)| = 2 is S(5,2)(3)2 = 15×6 = 90, where the value of S(5,2)
was obtained from the table in the discussion of Stirling numbers in Unit CL. Example 12 gave one of these 90 possibilities.
We consider some special cases.
• Supposek=a.
− If b < a, there are no functionsf with |Image(f)| = a because the size a of the
image is at most the size bof the codomain.
− Ifb≥athere are (b)a functions with|Image(f)|=a.
− Ifb=a, the previous formula, (b)a, reduces to a! and the functions are injections
from Ato B.
• Supposek=b.
− Ifb > athere are no functionsf with|Image(f)|=bbecause the size of the image
is at most the size of the domain.
− Ifb≤athen there areS(a, b)(b)b=S(a, b)b! functionsf ∈BA with|Image(f)|= b. These functions are exactly the surjections.