## § 2.1 Functions: Solved problems

20. The ``Vertical Line Test'' from calculus says that a curve in the xy-plane is the graph of a function of x if and only if no vertical line intersects the curve more than once. Explain why this agrees with Definition 2.1.1.

Solution: We assume that the x-axis is the domain and the y-axis is the codomain of the function that is to be defined by the given curve. According to Definition 2.1.1, a subset of the plane defines a function if for each element x in the domain there is a unique element y in the codomain such that (x, y) belongs to the subset of the plane. If a vertical line intersects the curve in two distinct points, then there will be points (x1, y1) and (x2, y2) on the curve with x1 = x2 and y1 y2. Thus if we apply Definition 2.1.1 to the given curve, the uniqueness part of the definition translates directly into the ``vertical line test''.

21. The ``Horizontal Line Test'' from calculus says that a function is one-to-one if and only if no horizontal line intersects its graph more than once. Explain why this agrees with Definition 2.1.4.

Solution: If a horizontal line intersects the graph of the function more than once, then the points of intersection represent points
(x1,y1) and (x2,y2) for which x1 x2 but y1 = y2. According to Definition 2.1.4, a function is one-to-one if
f(x1) = f(x2) implies x1 = x2. Equivalently, if (x1, y1) and (x2, y2) line on its graph, then we cannot have
y1 = y2 while x1 x2. In this context, the ``horizontal line test'' is exactly the same as the condition given in Definition 2.1.4.

22. In calculus the graph of an inverse function f -1 is obtained by reflecting the graph of f about the line y = x. Explain why this agrees with Definition 2.1.7.

Solution: We first note that the reflection of a point (a,b) in the line y = x is the point (b,a). This can be seen by observing that the line segment joining (a,b) and (b,a) has slope -1, which makes it perpendicular to the line y = x, and that this line segment intersects the line y = x at the midpoint ((a+b)/2,(a+b)/2) of the segment.

If f : R -> R has an inverse, and the point (x,y) lies on the graph of f, then y = f(x), and so
f -1(y) = f -1(f(x)) = x. This shows that the point (x,y) lies on the graph of f -1. Conversely, if
(x,y) lies on the graph of f -1, then
x = f -1(y), and therefore y = f(f -1(y)) = f(x), which shows that (y,x) lies on the graph of f.

On the other hand, suppose that the graph of the function g is defined by reflecting the graph of f in the line y = x. For any real number x, if
y = f(x) then we have g(f(x)) = g(y) = x and for any real number y we have
f(g(y)) = f(x) = y, where x = g(y). This shows that g = f -1, and so f has an inverse.

23. Let A be an n × n matrix with entries in R. Define a linear transformation L : Rn -> Rn by L(x) = Ax, for all x in Rn.

(a) Show that L is an invertible function if and only if det(A) 0.

(b) Show that if L is either one-to-one or onto, then it is invertible.

Solution: (a) We need to assume that you know that a square matrix A is invertible if and only if det(A) 0.

First, if L has an inverse, then it can also be described by multiplication by a matrix B, which must satisfy the conditions BA = I, and AB = I, where I is the n × n identity matrix. Thus A is an invertible matrix, and so det(A) 0.

On the other hand, if det(A) 0, then A is invertible, and so L has an inverse, defined by
L-1(x) = A-1x, for all x in Rn.

(b) The rank of the matrix A is the dimension of the column space of A, and this is the image of the transformation L, so L is onto if and only if A has rank n.

On the other hand, the nullity of A is the dimension of the solution space of the equation
Ax = 0, and L is one-to-one if and only if the nullity of A is zero, since
Ax1 = Ax2 if and only if A(x1 - x2) = 0.

To prove part (b) we need to use the Rank-Nullity Theorem, which states that if A is an n × n matrix, then the rank of A plus the nullity of A is n. Since the matrix A is invertible if and only if it has rank n, it follows that L is invertible if and only if L is onto, and then the Rank-Nullity Theorem shows that this happens if and only if L is one-to-one.

24. Let A be an m × n matrix with entries in R, and assume that m > n. Define a linear transformation
L : Rn -> Rm by L(x) = Ax, for all x in Rn. Show that L is a one-to-one function if
det(ATA) 0, where AT is the transpose of A.

Solution: If det(ATA) 0, then ATA is an invertible matrix. If we define
K : Rm -> Rn by K(x) = (ATA) -1ATx, for all x in Rm, then KL is the identity function on Rm. It then follows from Exercise 2.1.17 that L is one-to-one.

Comment: There is a stronger result that depends on knowing a little more linear algebra. In some linear algebra courses it is proved that det(ATA) gives the n-dimensional ``content'' of the parallepiped defined by the column vectors of A. This content is nonzero if and only if the vectors are linearly independent, and so det(ATA) 0 if and only if the column vectors of A are linearly independent. According to the Rank-Nullity Theorem, this happens if and only if the nullity of A is zero. In other words, L is a one-to-one linear transformation if and only if det(ATA) 0.

25. Let A be an n × n matrix with entries in R. Define a linear transformation L : Rn -> Rn by L(x) = Ax, for all x in Rn. Prove that L is one-to-one if and only if no eigenvalue of A is zero.

Note: A vector x is called an eigenvector of A if it is nonzero and there exists a scalar such that Ax = x.

Solution: As noted in the solution to Problem 2.1.23, Ax1 = Ax2 if and only if A(x1-x2) = 0, and so L is one-to-one if and only if Ax 0 for all nonzero vectors x. This is equivalent to the statement that there is no nonzero vector x for which Ax = 0 · x, which translates into the given statement about eigenvalues of A.

26. Define the formula f : Z6 -> Z15 by f([x]6) = [5x]15, for all [x]6 in Z6. Show that f gives a well-defined function, and compute its values.

Comment: The problem is that there can be two names for the same element of Z6. For example,
[1]6 = [7]6. The given formula looks like it might depend on
the particular name of an element, since f([x]6) = [5x]15. For example, we have
f([1]6) = [5 · 1]15 = [5]15. On the other hand,
f([7]6) = [5 · 7]15 = [35]15. Fortunately, this doesn't cause any problems because
[35]15 = [5]15. We need to prove that the function behaves properly for all choices of a representative for all of the congruence classes in Z6.

Solution: Suppose that [a]6 = [b]6. Then
a b (mod 6), so a = b + 6k, for some integer k. Multiplying both sides of this equation by 5 gives us
5a = 5b + 30k, so 5a 5b (mod 30), which means that
[5a]30 = [5b]30. This shows that the formula for f will have the same effect on a and b, so that
f ([a]6) = [5a]30 = [5b]30 = f ([b]6). This allows us to conclude that f is a well-defined function.

Here are the values of the function f:

f ([0]6) = [5 · 0]30 = [0]30 ;
f ([1]6) = [5 · 1]30 = [5]30 ;
f ([2]6) = [5 · 2]30 = [10]30 ;
f ([3]6) = [5 · 3]30 = [15]30 ;
f ([4]6) = [5 · 4]30 = [20]30 ;
f ([5]6) = [5 · 5]30 = [25]30 .

27. Define the formula f : Z24× -> Z12× by f([x]24) = [5x]12, for all [x]24 in Z24×. Show that f gives a well-defined function, and compute its values.

Solution: First, if x is relatively prime to 24, then so is 5x, and therefore 5x is relatively prime to 12. This shows that the formula does allow any input in Z24×, and will produce an output in Z12×. That is, the formula does work on the given domain and codomain.

To show that f is well-defined, suppose that [a]24 = [b]24. Then
5a 5b (mod 24), since multiplication is well-defined in
Z24×, and it follows that 5a 5b (mod 12), so
f ([a]24) = [5a]12 = [5b]12 = f ([b]24).
This allows us to conclude that f is a well-defined function.

The elements of Z24× are { 1, 5, 7, 11, 13, 17, 19, 23 }.
It may be easier to use { ±1, ±5, ±7, ±11 }.
Here are the values of the function f:

f ([1]24) = [5 · 1]12 = [5]12 ;
f ([-1]24) = [5 · (-1)]12 = [-5]12 = [7]12 ;
f ([5]24) = [5 · 5]12 f ([25]12) = [1]12 ;
f ([-5]24) = [5 · (-5)]12 f ([-25]12) = [11]12 ;
f ([7]24) = [5 · 7]12 f ([35]12) = [11]12 ;
f ([-7]24) = [5 · (-7)]12 f ([-35]12) = [1]12 ;
f ([11]24) = [5 · 11]12 f ([55]12) = [7]12 ;
f ([-11]24) = [5 · (-11)]12 f ([-55]12) = [5]12 .

28. Let [a]17 be a fixed element of Z17×. Define the function f : Z17× -> Z17× by f([x]17) = [ax]17, for all [x]17 in Z17×. Is f one-to-one? Is f onto? If possible, find the inverse function f -1.

Solution: Remember that the set Zn× is defined to be the set of all congruence classes modulo n that are represented by an integer relatively prime to n. Since 17 is prime, this is the set of nonzero congruence classes modulo 17. By Proposition 1.4.5, this is precisely the set of congruence classes [k]17 for which there is a multiplicative inverse in Z17×. Therefore we can define
g : Z17× -> Z17× by g([x]) = [a] -1[x], for all [x] in Z17×. Then
g(f([x])) = g([ax]) = [a] -1([a][x]) = ([a] -1[a])[x] = [x] and
f(g([x])) = f([a] -1[x]) = [a]([a] -1[x]) = ([a][a] -1)[x] = [x], which shows that g = f -1.
This implies that f is both one-to-one and onto.