<<

Functions Definition A f from A to B is a from A to B such that:

(i) Dom(f) = A, and (ii) If (x,y) ∈ f and (x,z) ∈ f then y = z.

If A = B, we say that f is a function on A.

In terms of ordered pairs, (i) and (ii) say that every of A appears as a first coordinate in one and only one .

If f is a function and (x,y) ∈ f then we will write y = f(x).

Since f is the name of a relation we could write x f y, but absolutely no one ever writes that. More Terminology Functions are also called mappings.

We usually write f: A → B read as "f maps A to B"

The B is called the of f.

Recall that the range of f, Rng(f) is the set of second coordinates of the relation f. So, Rng(f) ⊆ B, but they need not be equal.

Example: Consider f : {1,2,3} → {a,b,c,d,e} given by f = {(1,a), (2,b), (3,c)} f is a function, Rng(f) = {a,b,c}, Codomain of f = {a,b,c,d,e}, Dom (f) = {1,2,3}, f(1) = a, f(2) = b and f(3) = c. More Examples

Consider: f : {1,2,3,4} → {a,b,c,d,e} given by f = {(1,a), (2,b), (3,c)} This is not a function since Dom(f) ≠ A.

Consider: f : {1,2,3} → {a,b,c,d,e} given by f = {(1,a), (2,b), (3,c), (1,e)} This is not a function since 1 appears as a first coordinate in more than one ordered pair. More Terminology If f: A → B is a function and f(x) = y we say that:

y is the value of f at x;

y is the of x under f;

x is the pre-image of y under f;

x is an of f.

Notice that f(x) is the image of x under f, it is NOT the name of the function, f is the name of the function. It is an abuse of the language to call f(x) a function, although many people do. Functions Notice that each argument of a function has exactly one image, but an element of the codomain may have several pre-images or none at all.

Given a function f: A → B we may write f = {(x, f(x)) | x ∈ A }. This underscores the notion that a function is a set ... however, we don't often think of functions that way.

Typically, we specify a function by giving a "rule" for computing the image of an arbitrary argument such as: f(x) = 2x -3 where x ∈ ℤ.

Note that giving the "rule" by itself does not define a function, you must also specify the domain ( x ∈ ℤ in the above example). Real-Valued Functions A real-valued function is a function whose codomain is ℝ.

A real-valued function of a real variable is a function whose codomain is R and whose domain is a of ℝ.

Real-valued functions of a real variable are so common in some branches of mathematics that we have a special convention concerning them:

If the is not specified, it is assumed to be a real-valued function of a real variable whose domain is the largest set of real numbers for which the "rule" produces a real value. Real-Valued Functions Examples: f(x) = 5x2 -2x + ½ by convention is a function f : ℝ  ℝ.

x2−2 x3 f  x= x1 x−5 by convention is a function f :ℝ−{−1,5}ℝ.

f  x= x2−4 by convention is a function f :ℝ−{−2,2}ℝ. Equality of Functions

Since functions are sets of ordered pairs, we already know what it means for two functions to be equal, since we know what it means for two sets to be equal and we know what it means for two ordered pairs to be equal. But we shall restate this in the function terminology:

Two functions f and g are equal iff (a) Dom(f) = Dom(g), and (b) ∀ x ∈ Dom(f), f(x) = g(x). Examples

x2−1 for x≠1 f  x={ x−1 } and g  x=x1 2 for x=1 are the same function, but

f(x) = 2x and g(x) = 2x for x ∈ ℤ are not the same function. Inverses and Compositions

Since functions are special types of relations, the definitions of inverses and compositions of relations applies to them.

However, the definitions of inverses and compositions do not guarantee that the inverse or composition of functions will be a function.

For instance, the function given by f(x) = x2 contains the ordered pairs (1, 1), (-1, 1), (2, 4), (-2, 4) , ... etc. The inverse would contain (1,1), (1,-1), (4,2), (4,-2), ... etc. and it is not a function (but it still is a relation).

Only under special conditions, which we shall see later, will the inverse of a function be a function. Composition of Functions Recall that if f: A → B and g: B → C are functions then g⊙ f = {(x,z) | ∃ y ∈ B so that (x,y) ∈ f and (y,z) ∈ g }. Using our functional notation we can rewrite this as: g⊙ f = {(x,z) | ∃ y ∈ B so that f(x) = y and g(y) = z }. Now, because f is a function, for each x ∈ A, there is a y ∈ B (and only one) so that f(x) = y and because g is a function, there will be a z ∈ C (again, only one) so that g(y) = z. So, we can go further and write: g⊙ f (x) = z = g(y), where y = f(x) or even more compactly: g⊙ f (x) = g(f(x)) .

The formula above is the reason for choosing the "backwards" notation for composition. Composition of Functions : If f: A → B and g: B → C are functions then g⊙ f : A → C is a function.

Pf: We already know that g⊙ f is a relation between A and C. Suppose that (x,y) ∈ g⊙ f and (x,z) ∈ g⊙ f . We then have y = g⊙ f (x) = g(f(x)) and z = g⊙ f (x) = g(f(x)). Since g is a function y = z.

Dom(g⊙ f ) ⊆ A by the definition of composition. Suppose a ∈ A. Since f is a function, Dom(f) = A and f(a) ∈ B. Because g is a function and Dom(g) = B, g(f(a)) exists in C. Thus, a ∈ Dom(g⊙ f ) so A ⊆ Dom(g⊙ f ). We now have Dom(g⊙ f ) = A, so g⊙ f is a function. Restrictions

If f: A → B is a function and D ⊆ A, we can define a new function, the restriction of f to D, denoted by f | , by keeping only the D ordered pairs of f which have their first coordinate in D.

The domain of the restriction of f to D is D.

It is clear that the restriction of a function is also a function. Surjections We know that for a function f: A → B, the range of f need not be the same as the codomain.

Definition: A function f: A → B is onto B iff Rng(f) = B. Such functions are referred to as onto functions or surjections.

Note that the common English word "onto" has a technical mathematical meaning. One should be careful when using this word in any mathematical context.

Also, realize that you can not tell if a function is onto unless you know the codomain. The range can be calculated, but generally you have to be told what the codomain is. Examples

Let f: ℤℤ be given by f(x) = x2. This function is not onto since, for instance, 6 in the codomain is not in the range of f. For this function, the Rng(f) consists only of squares, and the codomain ℤ also contains non-squares.

Let f: ℝ [0, ∞) be given by f(x) = x2. This function is a surjection because Rng(f) = [0, ∞). That is, every non-negative is the of a real number. More precisely, if real number c ≥ 0 is the square of √c, which is a real number, i.e., f(√c) = c. Proving a Function is Onto Suppose that f: A → B is a function that we wish to prove is a surjection.

Since we always have Rng(f) ⊆ B, we need to prove B ⊆ Rng(f). That is we need to show that (∀ b) ( b ∈ B ⇒ b ∈ Rng(f)). To show that b ∈ Rng(f), we have to find an x in Dom(f) = A so that f(x) = b.

Example: Show that the function given by f(x) = 2x + 3 is onto. By convention, the codomain of this function is ℝ and the domain is also ℝ. Let z ∈ ℝ be an arbitrary element of the codomain. We seek an x in the domain, so that f(x) = z, i.e., 2x + 3 = z. Solving for x we get x = ½(z – 3). Now this x is a real number if z is a real number, so is in the domain of f and f(½(z – 3)) = z. So f is onto. Proving a Function is Not Onto Suppose that f: A → B is a function that we wish to prove is not a surjection. We usually show that a function is not onto by providing a counterexample, i.e., an element of the codomain which is not in the range of the function. We often locate such a counterexample by trying to prove the function is onto ... and failing. Example: Show that the function f: ℤℤ given by f(x) = 2x + 3 is not onto. The codomain of this function is given as ℤ and the domain is also ℤ. Let z ∈ ℤ be an arbitrary element of the codomain. We seek an x in the domain, so that f(x) = z, i.e., 2x + 3 = z. Solving for x we get x = ½(z – 3). Now if z – 3 is not even, the x we get is not an , so will not be in the domain. So, for instance, z = 4 is a counterexample, since it is in the codomain, but there is no integer x so that f(x) = 4. Surjections Theorem 4.7: The composition of two surjections is a surjection.

Pf: Let f: A → B and g: B → C be surjections and consider the composition g⊙ f : A → C. Let c ∈ C be an arbitrary element of the codomain. Since g is onto, there is a b ∈ B so that g(b) = c. Now, because f is onto, there exists an a ∈ A so that f(a) = b. For this a, g⊙ f (a) = g(f(a)) = g(b) = c. Thus, c is in Rng(g⊙ f ). Since c was arbitrary, every element of the codomain is in the range, i.e., g⊙ f is a surjection.

Theorem 4.8 If the composition g⊙ f : A → C is a surjection, then g is onto.

Pf: Let f: A → B and g: B → C be the functions that are being composed. Let c be an arbitrary element of C (which is the codomain of both g and g⊙ f. Since g⊙ f is a surjection, there is an a ∈ A, so that g⊙ f(a)= c. Thus, g(f(a)) = c. Since A is the domain of f, there is a b ∈ B so that f(a) = b. Hence, g(b) = c. Since c was arbitrary, g is a surjection. Injections For an onto function, each element of the codomain appears as a second coordinate at least once. We get another type of function if we require that each element of the codomain appears at most once.

Definition: A function f: A → B is one-to-one iff whenever x ≠ z, then f(x) ≠ f(z). One-to-one functions are also called injections.

The conditional in this definition can be replaced by its contrapositive, so we can also say that a function f is an injection iff whenever f(x) = f(z) then x = z.

In this form the definition gives a method for providing a direct proof that a function is an injection. Examples The function f: ℤℤ given by f(x) = 2x + 3 is an injection.

Suppose that f(x) = f(z). Then 2x + 3 = 2z + 3. Subtracting 3 and dividing by 2 on each side of the equation gives x = z. Therefore f is a one-to-one function. The function f: ℤℤ given by f(x) = 2x2 + 3 is not one-to-one.

Suppose that f(x) = f(z). Then 2x2 + 3 = 2z2 + 3. This gives x2 = z2. But this only gives |x| = |z| and not x = z. A counterexample is given by two numbers (not equal) with the same absolute value, like 2 and -2. f(2) = 11 and f(-2) = 11. Composition Theorem 4.11: The composition of injective functions is an injection.

Pf: Let f: A → B and g: B → C be injections and consider the composition g⊙ f : A → C. Suppose g⊙ f (x) = g⊙ f (z). Then g(f(x)) = g(f(z)). Because g is one-to-one, we conclude that f(x) = f(z). Then, because f is one-to-one, we get x = z. Therefore, g⊙ f is an injection. Inverses

We have already noticed that the inverse of a function need not be a function, we now see when the inverse is a function.

Theorem 4.9: Let f: A → B. Then f -1 is a function from Rng(f) to A iff f is one-to-one. Furthermore, if f -1 is a function then f -1 is an injection. Pf: Suppose that f is one-to-one. Suppose that (x, y) and (x, z) are in f -1. Then, (y,x) and (z,x) ∈ f. Since f is one-to-one, and we have f (y) = x = f(z), we must have y = z. Thus, f -1 is a function. Now suppose that f -1 is a function. Suppose that f(x) = f(y) = z. Then (x,z) and (y,z) ∈ f. Therefore, (z,x) and (z,y) ∈ f -1. But since f -1 is a function, x = y. Hence, f is one-to-one. Furthermore, if f -1(u) = f -1(v) = w, then (u,w) and (v,w) ∈ f -1. Thus, (w,u) and (w,v) ∈ f, and so u = v since f is a function. Hence, f -1 is an injection. Caveat Be careful, the last theorem says that if f: A → B is an injection then f -1: Rng(f) → A is a function. It does not say that f -1: B → A is a function. Of course, these two statements would be the same if Rng(f) = B, that is, if f is onto.

So, we have the important

Corollary 4.10: If f: A → B is a one-to-one and onto function, then f -1: B → A is a one-to-one and onto function. Definition: A function which is both one-to-one and onto its codomain, is called a one-to-one correspondence. Such functions are also called bijections.

For a , each element of the codomain appears as a second coordinate once and only once.

Example: The function given by f(x) = ax + b for any a and b with a ≠ 0 is a bijection. Recall that by convention, the domain and codomain of this function is ℝ.

Note that f(x) = b is neither an injection nor a surjection. Example

The function f: ℕ×ℕℕ given by f(n,m) = 2n-1(2m – 1) is a bijection.

We first show that f is one-to-one. Suppose f(n,m) = f(r,s), then 2n-1(2m-1) = 2r-1(2s-1). Divide both sides by 2r-1(2m-1), which can not be 0, to get 2n-r = (2s-1)/(2m-1). (If n-r is negative, take reciprocals of both sides.) The right hand side is an odd number, and the only power of 2 which is odd is 20 = 1. Thus, n = r. Now return to 2n-1(2m-1) = 2r-1(2s-1). Since n = r we can divide both sides by 2n-1 to get 2m – 1 = 2s – 1. From this we conclude m = s. Hence f is one-to-one. Example

The function f: ℕ×ℕℕ given by f(n,m) = 2n-1(2m – 1) is a bijection.

Now we need to show that f is onto. Let b be an arbitrary . By the fundamental theorem of arithmetic we can write b = 2a(some odd positive integer) = 2a(2k+1) where a and k are that are ≥ 0. Let n = a + 1 and m = k + 1. We have n and m ∈ ℕ and f(n,m) = 2n-1(2m-1) = 2a+1-1(2(k+1)-1) = 2a(2k+1) = b. Therefore, any element of the codomain is in the range and f is a surjection. Thus f is a bijection. Bijections

The basic properties of bijections can be obtained by combining the results we have already obtained concerning surjections and injections. Thus,

Theorem: The composition of two bijections is a bijection.

Pf: Combine Theorem 4.11 and Theorem 4.7.

Theorem: The inverse of a bijection is a bijection.

Pf: This is just a rewording of Corollary 4.10. Inverses and Composition

Theorem: Let f: A → B and g: B → A. Then g = f -1 iff g⊙f = I A and f⊙g = I . B

Pf: Suppose that g = f -1. Then for any a ∈ A, let f(a) = b and therefore f -1(b) = a. So, g⊙f (a) = g(f(a)) = g(b) = f -1(b) = a. Thus, g⊙f = I . For any b ∈ B, let f -1(b) = c, so f(c) = b. Now f⊙g(b) = A f(g(b)) = f(f -1(b)) = f(c) = b, so f⊙g = I . B Now assume that g⊙f = I and f⊙g = I . If f -1 exists, then A B f -1 = f -1⊙ I = f -1 ⊙ (f⊙g) = (f -1⊙f ) ⊙ g = I ⊙ g = g. B A So we only need to show that f -1 exists. Suppose that f(x) = f(y). Then g(f(x)) = g(f(y)) since g is a function. Since g⊙f = I we have A x = y, and so f is an injection. Thus, f -1 is a function.