Docsity

Proving Functions: One-to-One, Onto, and Composition - Prof. Margaret M. Fleck, Study notes of Discrete Structures and Graph Theory

Toggle sidebar
bg1
Proofs with Functions
Operations on Functions
Margaret M. Fleck
26 Sept 2008
This lecture finishes the material in section 2.3 of Rosen. It discusses
composition of functions, addition/multiplication of functions, and proving
facts about functions.
1 Recap
Recall that a function f:A→Bis one-to-one (injective) if
∀x, y ∈A, f (x) = f(y)→x=y
and it is onto (surjective) if
∀y∈B, ∃x∈A, f (x) = y
A function that is both one-to-one and onto is called a bijection or a one-to-
one correspondence.
Bijective functions are special for a variety of reasons, including the fact
that every bijection fhas an inverse function f−1.
2 Proving that a function is one-to-one
Claim 1 Let f:Z→Zbe defined by f(x) = 3x+ 7.fis one-to-one.
Let’s prove this using our definition of one-to-one.
1
pf3
pf4
pf5

Partial preview of the text

Download Proving Functions: One-to-One, Onto, and Composition - Prof. Margaret M. Fleck and more Study notes Discrete Structures and Graph Theory in PDF only on Docsity!

Proofs with Functions

Operations on Functions

Margaret M. Fleck

26 Sept 2008

This lecture finishes the material in section 2.3 of Rosen. It discusses composition of functions, addition/multiplication of functions, and proving facts about functions.

1 Recap

Recall that a function f : A → B is one-to-one (injective) if

∀x, y ∈ A, f (x) = f (y) → x = y

and it is onto (surjective) if

∀y ∈ B, ∃x ∈ A, f (x) = y

A function that is both one-to-one and onto is called a bijection or a one-to- one correspondence. Bijective functions are special for a variety of reasons, including the fact that every bijection f has an inverse function f −^1.

2 Proving that a function is one-to-one

Claim 1 Let f : Z → Z be defined by f (x) = 3x + 7. f is one-to-one.

Let’s prove this using our definition of one-to-one.

Proof: We need to show that for every integers x and y, f (x) = f (y) → x = y. So, let x and y be integers and suppose that f (x) = f (y). We need to show that x = y. We know that f (x) = f (y). So, substituting in our formula for f , 3 x + 7 = 3y + 7. So 3x = 3y and therefore x = y, by high school algebra. This is what we needed to show.

When we pick x and y at the start of the proof, notice that we haven’t specified whether they are the same number or not. Mathematical convention leaves this vague, unlike normal English where the same statement would strongly suggest that they were different. You may have encountered the abbreviation QED at the end of a proof. This stands for “quod erat demonstrandum” which is simply the Latin for “this is what we needed to show.” Some people put a little box or a little triangle of 3 dots at the end of the proof. It’s good style to have something at the end of your proof which tells the reader that the proof is complete.

3 Proving that a function is onto

Now, consider this claim:

Claim 2 Define the function g from the integers to the integers by the for- mula g(x) = x − 8. g is onto.

Proof: We need to show that for every integer y, there is an integer x such that g(x) = y. So, let y be some arbitrary integer. Choose x to be (y + 8). x is an integer, since it’s the sum of two integers. But then g(x) = (y + 8) − 8 = y, so we’ve found the required pre-image for y and our proof is done.

Notice that our function f from the last section wasn’t onto. Suppose we tried to build a proof that it was.

Proof: We need to show that for every integer y, there is an integer x such that f (x) = y. So, let y be some arbitrary integer. Choose x to be (y− 3 7)....

Claim 3 For any sets A, B, and C and for any functions f : A → B and g : B → C, if f and g are injective, then g ◦ f is also injective.

We can prove this with a direct proof, by being systematic about using our definitions and standard proof outlines. First, let’s pick some representative objects of the right types and assume everything in our hypothesis.

Proof: Let A, B, and C be sets. Let f : A → B and g : B → C be functions. Suppose that f and g are injective. We need to show that g ◦ f is injective.

To show that g ◦ f is injective, we need to pick two elements x and y in its domain, assume that their output values are equal, and then show that x and y must themselves be equal. Let’s splice this into our draft proof. Remember that the domain of g ◦ f is A and its co-domain is C.

Proof: Let A, B, and C be sets. Let f : A → B and g : B → C be functions. Suppose that f and g are injective. We need to show that g ◦ f is injective. So, choose x and y in A and suppose that (g ◦ f )(x) = (g ◦ f )(y) We need to show that x = y.

Now, we need to apply the definition of function composition and the fact that f and g are each injective:

Proof: Let A, B, and C be sets. Let f : A → B and g : B → C be functions. Suppose that f and g are injective. We need to show that g ◦ f is injective. So, choose x and y in A and suppose that (g ◦ f )(x) = (g ◦ f )(y) Using the definition of function composition, we can rewrite this as g(f (x)) = g(f (y)). Combining this with the fact that g is injective, we find that f (x) = f (y). But, since f is injective, this implies that x = y, which is what we needed to show.

6 Another proof involving composition

Let’s prove a similar claim involving surjective:

Claim 4 For any sets A, B, and C and for any functions f : A → B and g : B → C, if f and g are surjective, then g ◦ f is also surjective.

Proof: Let A, B, and C be sets. Let f : A → B and g : B → C be functions. Suppose that f and g are surjective. We need to show that g ◦f is surjective. That is, we need to show that for any element x in C, there is an element y in A such that (g ◦ f )(y) = x. So, pick some element x in C. Since g is surjective, there is an element z in B such that g(z) = x. Since f is surjective, there is an element y in A such that f (y) = z. Substituting the value f (y) = z into the equation g(z) = x, we get g(f (y)) = x. That is, (g ◦ f )(y) = x. So y is the element of A we needed to find.

7 Proof by cases

Now, let’s do a slightly trickier proof. First, a definition. Suppose that A and B are sets of numbers (e.g. the reals, the rationals, the integers). A function f : A → B is increasing if, for every x and y in A, x ≤ y implies that f (x) ≤ f (y). f is called strictly increasing if, for every x and y in A, x < y implies that f (x) < f (y).

Claim 5 For any sets of number A and B, if f is any strictly increasing function from A to B, then f is one-to-one.

A similar fact applies to strictly decreasing functions. To prove this, we will restate one-to-one using the alternative, contrapos- itive version of its definition.

∀x, y ∈ A, x 6 = y → f (x) 6 = f (y) Normally, this wouldn’t be a helpful move because we’ve created negative facts when we used to have positive facts. But, in this case, it’s a good approach.

Case 2: y < x. Similar to case 1. In either case, we have that f (x) 6 = f (y), which is what we needed to show.

This method only works if you, and your reader, both agree that it’s obvious that the two cases are very similar and the proof will really be similar. Dangerous assumption right now. And we’ve only saved a small amount of writing, which isn’t worth the risk of losing points if the TA doesn’t think it was obvious. But this simplificiation is very useful in more complicated situations (e.g. in CS 273) where you have may have lots of cases and the proofs really are very similar and the proof for each case is long. Here’s another way to simplify our proof:

Proof: Let A and B be sets of numbers and let f : A → B be a strictly increasing function. Let x and y be distinct elements of A. We need to show that f (x) 6 = f (y). We know that x 6 = y, so either x < y or y < x. Without loss of generality, assume that x < y. Since f is strictly increasing, x < y implies that f (x) < f (y). So f (x) 6 = f (y), which is what we needed to show.

The phrase “without loss of generality” means that we are adding an additional assumption to our proof but we claim it isn’t really adding any more information. In this case, x and y are both arbitrary elements of A and the condition f (x) 6 = f (y) is symmetrical in its two inputs (i.e. it means the same thing as f (y) 6 = f (x). So we haven’t yet made any real distinction in properties between x and y. It doesn’t actually matter which of the two numbers is called x and which is called y. So if we happen to have chosen our names in the wrong order so that y < x, we can just rename our two numbers in the opposite way. And then we’ll have x < y. Again, this is a potentially dangerous proof technique that you’ll probably want to see a few times before you use it yourself. It’s actually used fairly often to simplify proofs, so it has an abbreviation: WOLOG or WLOG.