Functions, High-School Edition

Size: px
Start display at page:

Download "Functions, High-School Edition"

Transcription

1 Functions

2 What is a function?

3 Functions, High-School Edition

4 f(x) = x4 5x2 + 4 source:

5 source:

6 Functions, High-School Edition In high school, functions are usually given as objects of the form x3 +3 x2 +15 x+7 f (x) = 1 x137 What does a function do? It takes in as input a real number. It outputs a real number except when there are vertical asymptotes or other discontinuities, in which case the function doesn't output anything.

7 Functions, CS Edition

8 int int flipuntil(int flipuntil(int n) n) {{ int int numheads numheads == 0; 0; int int numtries numtries == 0; 0; while while (numheads (numheads << n) n) {{ if if (randomboolean()) (randomboolean()) numheads++; numheads++; }} }} numtries++; numtries++; return return numtries; numtries;

9 Functions, CS Edition In programming, functions might take in inputs, might return values, might have side efects, might never return anything, might crash, and might return diferent values when called multiple times.

10 What's Common? Although high-school math functions and CS functions are pretty diferent, they have two key aspects in common: They take in inputs. They produce outputs. In math, we like to keep things easy, so that's pretty much how we're going to defne a function.

11 Rough Idea of a Function: A function is an object f that takes in an input and produces exactly one output. x f f(x) (This is not a complete defnition we'll revisit this in a bit.)

12 High School versus CS Functions In high school, functions usually were given by a rule: f(x) = 4x + 15 In CS, functions are usually given by code: int factorial(int n) { int result = 1; for (int i = 1; i <= n; i++) { result *= i; } return result; } What sorts of functions are we going to allow from a mathematical perspective?

13 Dikdik Nubian Ibex Sloth

14

15 but also

16 f(x) = x2 + 3x 15

17 n/2 if n is even f (n)= (n+1)/2 otherwise { Functions Functionslike likethese these are arecalled calledpiecewise piecewise functions. functions.

18 To defne a function, you will typically either draw a picture, or give a rule for determining the output.

19 In mathematics, functions are deterministic. That is, given the same input, a function must always produce the same output. The following is a perfectly valid piece of C++ code, but it s not a valid function under our defnition: int randomnumber(int numoutcomes) { return rand() % numoutcomes; }

20 One Challenge

21 f(x) = x2 + 2x + 5 f( 3 ) = = 20 f( 0 ) = = 5 f( 3 ) =?

22 f(x) = x2 + 2x + 5 f( 3 ) = = 20 f( 0 ) = = 5 f( 3 ) =?

23 f(x) = x2 + 2x + 5 f( 3 ) = = 20 f( 0 ) = = 5 f( 3 ) =?

24 f(x) = x2 + 2x + 5 f( 3 ) = = 20 f( 0 ) = = 5 f( 3 ) =?

25 f( )= f(137 ) =?

26 We need to make sure we can't apply functions to meaningless inputs.

27 Domains and Codomains Every function f has two sets associated with it: its domain and its codomain. A function f can only be applied to elements of its domain. For any x in the domain, f(x) belongs to the codomain. The Thefunction function must be must bedefned defned for every element for every element ofofthe thedomain. domain. Domain Codomain The Theoutput outputofofthe the function must function must always alwaysbe beininthe the codomain, but codomain, but not notall allelements elements ofofthe codomain the codomain must mustbe be produced producedas as outputs. outputs.

28 Domains and Codomains Every function f has two sets associated with it: its domain and its codomain. A function f can only be applied to elements of its domain. For any x in the domain, f(x) belongs to the codomain. The Thecodomain codomainofofthis thisfunction functionisis ℝ. ℝ.Everything Everythingproduced producedisisaareal real number, but not all real numbers number, but not all real numbers can canbe beproduced. produced. The Thedomain domainofofthis thisfunction function isisℝ. Any real number ℝ. Any real numbercan canbe be provided as input. provided as input. private double absolutevalueof(double x) { if (x >= 0) { return x; } else { return -x; } }

29 Domains and Codomains If f is a function whose domain is A and whose codomain is B, we write f : A B. This notation just says what the domain and codomain of the function are. It doesn't say how the function is evaluated. Think of it like a function prototype in C or C++. The notation f : ArgType RetType is like writing RetType f(argtype argument); We know that f takes in an ArgType and returns a RetType, but we don't know exactly which RetType it's going to return for a given ArgType.

30 The Oficial Rules for Functions Formally speaking, we say that f : A B if the following two rules hold. First, f must be obey its domain/codomain rules: a A. b B. f(a) = b ( Every input in A maps to some output in B. ) Second, f must be deterministic: a₁ A. a₂ A. (a₁ = a₂ f(a₁) = f(a₂)) ( Equal inputs produce equal outputs. ) If you re ever curious about whether something is a function, look back at these rules and check! For example: Can a function have an empty domain? Can a function with a nonempty domain have an empty codomain?

31 Defning Functions Typically, we specify a function by describing a rule that maps every element of the domain to some element of the codomain. Examples: f(n) = n + 1, where f : ℤ ℤ f(x) = sin x, where f : ℝ ℝ f(x) = x, where f : ℝ ℤ Notice that we're giving both a rule and the domain/codomain.

32 Defning Functions Typically, we specify a function by describing a rule that maps every element This function of the domain to some element of the This isis the the ceiling ceiling function the codomain. the smallest smallest integer integer Examples: greater greater than than or or equal equal to to x. x. For For example, example, 1 1 == 1,1, == 2, 2, and and == f(n) = n + 1, where f : ℤ ℤ f(x) = sin x, where f : ℝ ℝ f(x) = x, where f : ℝ ℤ Notice that we're giving both a rule and the domain/codomain.

33 Is This a Function From A to B? Stanford Cardinal Berkeley Blue Michigan Gold Arkansas White A B

34 Is This a Function From A to B? California Dover New York Sacramento Delaware Albany Washington DC A B

35 م ح رم Is This a Function From A to B? ص فر الأل ربيع ربيع الثاني جمادى الألى عيد الفطر جمادى الخآرة ر جب عيد الضحى ش عبان A ر مضان شوال ذأ القعدة Answer Answerat atpollev.com/cs103 PollEv.com/cs103or or text CS103 to once to join, then text CS103 to once to join, thenyyor orn. N. ذأ الحجة B

36 Combining Functions

37 f : People Places Cynthia g : Places Prices Mountain View Far Too Much Guy San Francisco King's Ransom Dana Redding, CA A Modest Amount Chioma Barrow, AK Pocket Change Diego People Palo Alto Places h : People Prices h(x) = g(f(x)) Prices

38 Function Composition Suppose that we have two functions f : A B and g : B C. Notice that the codomain of f is the domain of g. This means that we can use outputs from f as inputs to g. x f f(x) g g(f(x))

39 Function Composition Suppose that we have two functions f : A B and g : B C. The composition of f and g, denoted g f, is a function where g f : A C, and (g f)(x) = g(f(x)). The Thename nameofofthe thefunction functionisisgg f.f. When Whenwe weapply applyititto toan aninput inputx,x, we wewrite write(g (g f)(x). f)(x).i Idon't don'tknow know why, but that's what we do. why, but that's what we do. A few things to notice: The domain of g f is the domain of f. Its codomain is the codomain of g. Even though the composition is written g f, when evaluating (g f)(x), the function f is evaluated frst.

40 Special Types of Functions

41 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto

42 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto

43 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

44 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

45 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

46 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

47 Injective Functions A function f : A B is called injective (or one-to-one) if the following statement is true about f: a₁ A. a₂ A. (a₁ a₂ f(a₁) f(a₂)) ( If the inputs are diferent, the outputs are diferent. ) The following frst-order defnition is equivalent and is often useful in proofs. a₁ A. a₂ A. (f(a₁) = f(a₂) a₁ = a₂) ( If the outputs are the same, the inputs are the same. ) A function with this property is called an injection. How does this compare to our second rule for functions?

48 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. Since f(n₀) = f(n₁), we see that 2n₀ + 7 = 2n₁ + 7. This in turn means that 2n₀ = 2n₁, so n₀ = n₁, as required.

49 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. Since f(n₀) = f(n₁), we see that 2n₀ + 7 = 2n₁ + 7. This in turn means that 2n₀ = 2n₁, so n₀ = n₁, as required.

50 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. Since f(n₀) = f(n₁), we see that How Howmany manyof ofthe thefollowing followingare arecorrect correctways waysof ofstarting startingof ofthis thisproof? proof? 2n₀ + 7 = 2n₁ + 7. Consider any n₁, n₂ ℕ where n₁ ==n₂. We will prove that f(n₁) ==f(n₂). Consider any n₁, n₂ ℕ where n₁ n₂. We will prove that f(n₁) f(n₂). This in turn means that Consider Considerany anyn₁, n₁,n₂ n₂ ℕℕwhere wheren₁ n₁ n₂. n₂.we Wewill willprove provethat thatf(n₁) f(n₁) f(n₂). f(n₂). Consider Considerany anyn₁, n₁,n₂ n₂ ℕℕwhere wheref(n₁) f(n₁)= =f(n₂). f(n₂).we Wewill willprove provethat thatn₁ n₁==n₂. n₂. 2n₀ = 2n₁, Consider any n₁, n₂ ℕ where f(n₁) f(n₂). We will prove that n₁ n₂. Consider any n₁, n₂ ℕ where f(n₁) f(n₂). We will prove that n₁ n₂. so n₀ = n₁, as required. Answer Answerat atpollev.com/cs103 PollEv.com/cs103or or text CS103 to once to join, then a number text CS103 to once to join, then a numberbetween between00and and4. 4.

51 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. What does it mean for the function ff to What does it mean for the function to Since f(n₀) = f(n₁), we see that be be injective? injective? 2n₀ + 7 = 2n₁ + 7. This in turn means that n₀ n₀ ℕ. ℕ. n₁ n₁ ℕ. ℕ.((f(n₀) f(n₀)==f(n₁) f(n₁) n₀ n₀==n₁ n₁)) 2n₀ = 2n₁, n₀ n₀ ℕ. ℕ. n₁ n₁ ℕ. ℕ.((n₀ n₀ n₁ n₁ f(n₀) f(n₀) f(n₁) f(n₁))) so n₀ = n₁, as required. Therefore, Therefore, we'll we'll pick pick arbitrary arbitrary n₀, n₀,n₁ n₁ ℕ ℕ where where f(n₀) f(n₀)==f(n₁), f(n₁), then then prove prove that that n₀ n₀==n₁. n₁.

52 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. What does it mean for the function ff to What does it mean for the function to Since f(n₀) = f(n₁), we see that be be injective? injective? 2n₀ + 7 = 2n₁ + 7. This in turn means that n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) 2n₀ = 2n₁, n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((n₁ n₁ n₂ n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as required. Therefore, Therefore, we'll we'll pick pick arbitrary arbitrary n₀, n₀,n₁ n₁ ℕ ℕ where where f(n₀) f(n₀)==f(n₁), f(n₁), then then prove prove that that n₀ n₀==n₁. n₁.

53 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. What does it mean for the function ff to What does it mean for the function to Since f(n₀) = f(n₁), we see that be be injective? injective? 2n₀ + 7 = 2n₁ + 7. This in turn means that n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) 2n₀ = 2n₁, n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((n₁ n₁ n₂ n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as required. Therefore, Therefore, we'll we'll pick pick arbitrary arbitrary n₀, n₀,n₁ n₁ ℕ ℕ where where f(n₀) f(n₀)==f(n₁), f(n₁), then then prove prove that that n₀ n₀==n₁. n₁.

54 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. What does it mean for the function ff to What does it mean for the function to Since f(n₀) = f(n₁), we see that be be injective? injective? 2n₀ + 7 = 2n₁ + 7. This in turn means that n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) 2n₀ = 2n₁, n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((n₁ n₁ n₂ n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as required. Therefore, Therefore, we'll we'll pick pick arbitrary arbitrary n₁, n₁,n₂ n₂ ℕ ℕ where where f(n₁) f(n₁)==f(n₂), f(n₂), then then prove prove that that n₁ n₁==n₂. n₂.

55 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. What does it mean for the function ff to What does it mean for the function to Since f(n₀) = f(n₁), we see that be be injective? injective? 2n₀ + 7 = 2n₁ + 7. This in turn means that n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) 2n₀ = 2n₁, n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((n₁ n₁ n₂ n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as required. Therefore, Therefore, we'll we'll pick pick arbitrary arbitrary n₁, n₁,n₂ n₂ ℕ ℕ where where f(n₁) f(n₁)==f(n₂), f(n₂), then then prove prove that that n₁ n₁==n₂. n₂.

56 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. What does it mean for the function ff to What does it mean for the function to Since f(n₀) = f(n₁), we see that be be injective? injective? 2n₀ + 7 = 2n₁ + 7. This in turn means that n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) 2n₀ = 2n₁, n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((n₁ n₁ n₂ n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as required. Therefore, Therefore, we'll we'll pick pick arbitrary arbitrary n₁, n₁,n₂ n₂ ℕ ℕ where where f(n₁) f(n₁)==f(n₂), f(n₂), then then prove prove that that n₁ n₁==n₂. n₂.

57 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₀, n₁ ℕ where f(n₀) = f(n₁). We will prove that n₀ = n₁. What does it mean for the function ff to What does it mean for the function to Since f(n₀) = f(n₁), we see that be be injective? injective? 2n₀ + 7 = 2n₁ + 7. This in turn means that n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) 2n₀ = 2n₁, n₁ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.((n₁ n₁ n₂ n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as required. Therefore, Therefore, we'll we'll pick pick arbitrary arbitrary n₁, n₁,n₂ n₂ ℕ ℕ where where f(n₁) f(n₁)==f(n₂), f(n₂), then then prove prove that that n₁ n₁==n₂. n₂.

58 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₁, n₂ ℕ where f(n₁) = f(n₂). We will prove that n₁ = n₂. Since f(n₀) = f(n₁), we see that 2n₀ + 7 = 2n₁ + 7. This in turn means that 2n₀ = 2n₁, so n₀ = n₁, as required.

59 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₁, n₂ ℕ where f(n₁) = f(n₂). We will prove that n₁ = n₂. Since f(n₁) = f(n₂), we see that 2n₁ + 7 = 2n₂ + 7. This in turn means that 2n₀ = 2n₁, so n₀ = n₁, as required.

60 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₁, n₂ ℕ where f(n₁) = f(n₂). We will prove that n₁ = n₂. Since f(n₁) = f(n₂), we see that 2n₁ + 7 = 2n₂ + 7. This in turn means that 2n₁ = 2n₂ so n₀ = n₁, as required.

61 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₁, n₂ ℕ where f(n₁) = f(n₂). We will prove that n₁ = n₂. Since f(n₁) = f(n₂), we see that 2n₁ + 7 = 2n₂ + 7. This in turn means that 2n₁ = 2n₂ so n₁ = n₂, as required.

62 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₁, n₂ ℕ where f(n₁) = f(n₂). We will prove that n₁ = n₂. Since f(n₁) = f(n₂), we see that 2n₁ + 7 = 2n₂ + 7. This in turn means that 2n₁ = 2n₂ so n₁ = n₂, as required.

63 Injective Functions Theorem: Let f : ℕ ℕ be defned as f(n) = 2n + 7. Then f is injective. Proof: Consider any n₁, n₂ ℕ where f(n₁) = f(n₂). We will prove that n₁ = n₂. Since f(n₁) = f(n₂), we see that How Howmany manyof ofthe thefollowing followingare arecorrect correctways waysof ofstarting startingof ofthis thisproof? proof? 2n₁n₁+=7n₂. =We 2n₂will + prove 7. Consider any n₁, n₂ ℕ where Consider any n₁, n₂ ℕ where n₁ = n₂. We will provethat thatf(n₁) f(n₁)==f(n₂). f(n₂). This any in turn means that Consider n₁, n₂ ℕ where n₁ n₂. We will prove that f(n₁) f(n₂). Consider any n₁, n₂ ℕ where n₁ n₂. We will prove that f(n₁) f(n₂). Consider Considerany anyn₁, n₁,n₂ n₂ ℕℕwhere wheref(n₁) f(n₁)= =f(n₂). f(n₂).we Wewill willprove provethat thatn₁ n₁==n₂. n₂. 2n₁ = 2n₂ Consider Considerany anyn₁, n₁,n₂ n₂ ℕℕwhere wheref(n₁) f(n₁) f(n₂). f(n₂).we Wewill willprove provethat thatn₁ n₁ n₂. n₂. so n₁ = n₂, as required. Good Good exercise: exercise: Repeat Repeat this this proof proof using using the the other other defnition defnition of of injectivity! injectivity!

64 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). Let x₀ = -1 and x₁ = +1. Then f(x₀) = f(-1) = (-1)4 = 1 and f(x₁) = f(1) = 14 = 1, so f(x₀) = f(x₁) even though x₀ x₁, as required.

65 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). Let x₀ = -1 and x₁ = +1. Then f(x₀) = f(-1) = (-1)4 = 1 and f(x₁) = f(1) = 14 = 1, so f(x₀) = f(x₁) even though x₀ x₁, as required.

66 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). How many of the following are correct ways of starting of this proof? How many of the following are correct ways of starting of this proof? Let for x₀ the = -1sake and x₁ = +1. Then Assume of Assumefor thesake ofcontradiction contradictionthat thatf fisisnot notinjective. injective. 4 are integers x₁ and x₂ Assume there f(x₀) = f(-1)that = (-1) =are 1 integers x₁ and x₂ Assumefor forthe thesake sakeof ofcontradiction contradiction that there where wheref(x₁) f(x₁)==f(x₂) f(x₂)but butx₁ x₁ x₂. x₂. and arbitrary integers x₁ and x₂ where x₁ x₂. We will prove Consider Consider arbitrary integers x₁ and x₂ where x₁ x₂. We will prove that f(x₁) = f(1) = 14 = 1, thatf(x₁) f(x₁)==f(x₂). f(x₂). Consider arbitrary integers x₁ and x₂ where f(x₁) ==f(x₂). We will prove Consider arbitrary integers x₁ and x₂ where f(x₁) f(x₂). We will prove so f(x₀) = f(x₁) even though x₀ x₁, as required. that thatx₁ x₁ x₂. x₂. Answer Answerat atpollev.com/cs103 PollEv.com/cs103or or text CS103 to once to join, then a number text CS103 to once to join, then a numberbetween between00and and4. 4.

67 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₀ ℤ. x₁ ℤ. (x₀ x₀ ℤ. x₁ ℤ. (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) x₀ ℤ. x₀ ℤ. ℤ. x₁ x₁ ℤ.(x₀ (x₀ x₁ f(x₀) f(x₁)) f(x₁) = f(1) =x₁ 14 =f(x₀) 1, f(x₁)) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ. (x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ (f(x₀) (f(x₀) f(x₁))) f(x₁))) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀)==f(x₁)) f(x₁)) Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

68 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) x₀ ℤ. x₀ ℤ. ℤ. x₁ x₁ ℤ.(x₀ (x₀ x₁ f(x₀) f(x₁)) f(x₁) = f(1) =x₁ 14 =f(x₀) 1, f(x₁)) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ. (x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ (f(x₀) (f(x₀) f(x₁))) f(x₁))) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀)==f(x₁)) f(x₁)) Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

69 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) x₀ ℤ. x₀ ℤ. ℤ. x₁ x₁ ℤ.(x₀ (x₀ x₁ f(x₀) f(x₁)) f(x₁) = f(1) =x₁ 14 =f(x₀) 1, f(x₁)) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ. (x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ (f(x₀) (f(x₀) f(x₁))) f(x₁))) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀)==f(x₁)) f(x₁)) Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

70 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₀ ℤ. = x₁ 4 f(x₀) f(x₁)) x₀ ℤ. ℤ. x₁ x₁ ℤ. (x₀ x₁1 =f(x₀) f(x₁) =(x₀ f(1) 1, f(x₁)) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ. (x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ (f(x₀) (f(x₀) f(x₁))) f(x₁))) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀)==f(x₁)) f(x₁)) Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

71 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ ℤ. = x₂ 4 f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. (x₁ x₂1 =f(x₁) f(x₁) =(x₁ f(1) 1, f(x₂)) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ. (x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ (f(x₀) (f(x₀) f(x₁))) f(x₁))) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀)==f(x₁)) f(x₁)) Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

72 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ ℤ. = x₂ 4 f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. (x₁ x₂1 =f(x₁) f(x₁) =(x₁ f(1) 1, f(x₂)) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ. (x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ (f(x₀) (f(x₀) f(x₁))) f(x₁))) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀)==f(x₁)) f(x₁)) Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

73 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ ℤ. = x₂ 4 f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. (x₁ x₂1 =f(x₁) f(x₁) =(x₁ f(1) 1, f(x₂)) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ. (x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ (f(x₁) (f(x₁) f(x₂))) f(x₂))) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀)==f(x₁)) f(x₁)) Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

74 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ ℤ. = x₂ 4 f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. (x₁ x₂1 =f(x₁) f(x₁) =(x₁ f(1) 1, f(x₂)) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ. (x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ (f(x₁) (f(x₁) f(x₂))) f(x₂))) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁)==f(x₂)) f(x₂)) Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to fnd x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

75 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ ℤ. = x₂ 4 f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. (x₁ x₂1 =f(x₁) f(x₁) =(x₁ f(1) 1, f(x₂)) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ. (x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ (f(x₁) (f(x₁) f(x₂))) f(x₂))) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁)==f(x₂)) f(x₂)) Therefore, we need to fnd x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = Therefore, we need to fnd x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we do that? f(x₂). Can we do that?

76 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ ℤ. = x₂ 4 f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. (x₁ x₂1 =f(x₁) f(x₁) =(x₁ f(1) 1, f(x₂)) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ. (x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ (f(x₁) (f(x₁) f(x₂))) f(x₂))) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁)==f(x₂)) f(x₂)) Therefore, we need to fnd x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = Therefore, we need to fnd x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we do that? f(x₂). Can we do that?

77 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ ℤ. = x₂ 4 f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. (x₁ x₂1 =f(x₁) f(x₁) =(x₁ f(1) 1, f(x₂)) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ. (x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ (f(x₁) (f(x₁) f(x₂))) f(x₂))) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁)==f(x₂)) f(x₂)) Therefore, we need to fnd x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = Therefore, we need to fnd x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we do that? f(x₂). Can we do that?

78 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ x₁, but f(x₀) = f(x₁). What does it mean for f to be injective? What does it mean for f to be injective? Let x₀ = -1 and x₁ = +1. Then x₁ ℤ. x₂ ℤ. (x₁ x₁ ℤ. x₂ ℤ. (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) 4 = f(-1) = (-1) =1 What is the negation f(x₀) of this statement? What is the negation of this statement? and x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ ℤ. = x₂ 4 f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. (x₁ x₂1 =f(x₁) f(x₁) =(x₁ f(1) 1, f(x₂)) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ. (x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) so f(x₀) = f(x₁) even though x₀ x₁, as required. x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ (f(x₁) (f(x₁) f(x₂))) f(x₂))) x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁)==f(x₂)) f(x₂)) Therefore, we need to fnd x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = Therefore, we need to fnd x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we do that? f(x₂). Can we do that?

79 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₁ and x₂ such that x₁ x₂, but f(x₁) = f(x₂). Let x₀ = -1 and x₁ = +1. Then f(x₀) = f(-1) = (-1)4 = 1 and f(x₁) = f(1) = 14 = 1, so f(x₀) = f(x₁) even though x₀ x₁, as required.

80 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₁ and x₂ such that x₁ x₂, but f(x₁) = f(x₂). Let x₁ = -1 and x₂ = +1. Then f(x₀) = f(-1) = (-1)4 = 1 and f(x₁) = f(1) = 14 = 1, so f(x₀) = f(x₁) even though x₀ x₁, as required.

81 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₁ and x₂ such that x₁ x₂, but f(x₁) = f(x₂). Let x₁ = -1 and x₂ = +1. f(x₁) = f(-1) = (-1)4 = 1 and f(x₁) = f(1) = 14 = 1, so f(x₀) = f(x₁) even though x₀ x₁, as required.

82 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₁ and x₂ such that x₁ x₂, but f(x₁) = f(x₂). Let x₁ = -1 and x₂ = +1. f(x₁) = f(-1) = (-1)4 = 1 and f(x₂) = f(1) = 14 = 1, so f(x₀) = f(x₁) even though x₀ x₁, as required.

83 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₁ and x₂ such that x₁ x₂, but f(x₁) = f(x₂). Let x₁ = -1 and x₂ = +1. f(x₁) = f(-1) = (-1)4 = 1 and f(x₂) = f(1) = 14 = 1, so f(x₁) = f(x₂) even though x₁ x₂, as required.

84 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₁ and x₂ such that x₁ x₂, but f(x₁) = f(x₂). Let x₁ = -1 and x₂ = +1. f(x₁) = f(-1) = (-1)4 = 1 and f(x₂) = f(1) = 14 = 1, so f(x₁) = f(x₂) even though x₁ x₂, as required.

85 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₁ and x₂ such that x₁ x₂, but f(x₁) = f(x₂). Let x₀ = -1 and x₁ = +1. Then How starting of this proof? Howmany manyof ofthe thefollowing followingare arecorrect correctways waysof of starting of this proof? 4 f(x₀) = f(-1)that = (-1) = injective. 1 Assume for the sake of contradiction f is not Assume for the sake of contradiction that f is not injective. Assume for and Assume forthe thesake sakeof ofcontradiction contradictionthat thatthere thereare areintegers integersx₁ x₁and andx₂ x₂ where f(x₁) = f(x₂) but x₁ x₂. where f(x₁) = f(x₂) but x₁ x₂. 4 f(x₁) = f(1) = 1 = 1, Consider Considerarbitrary arbitraryintegers integersx₁ x₁and andx₂ x₂where wherex₁ x₁ x₂. x₂.we Wewill willprove prove that so f(x₁) f(x₀) =f(x₂). f(x₁) even though x₀ x₁, as required. that f(x₁)== f(x₂). Consider Considerarbitrary arbitraryintegers integersx₁ x₁and andx₂ x₂where wheref(x₁) f(x₁)==f(x₂). f(x₂).we Wewill willprove prove that thatx₁ x₁ x₂. x₂.

86 Injective Functions Theorem: Let f : ℤ ℕ be defned as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₁ and x₂ such that x₁ x₂, but f(x₁) = f(x₂). Let x₁ = -1 and x₂ = +1. f(x₁) = f(-1) = (-1)4 = 1 and f(x₂) = f(1) = 14 = 1, so f(x₁) = f(x₂) even though x₁ x₂, as required.

87 Injections and Composition

88 Injections and Composition Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is an injection. Our goal will be to prove this result. To do so, we're going to have to call back to the formal defnitions of injectivity and function composition.

89 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required.

90 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required.

91 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required.

92 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required.

93 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). There There are are two two defnitions defnitions of of injectivity injectivity that that we we can can use use here: here: Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that a₁ A. A. ((g f)(a₁) = a₁ A. a₂ a₂ A.as ((g f)(a₁) =(g (g f)(a₂) f)(a₂) a₁ a₁= = a₂) a₂) g(f(a₁)) g(f(a₂)), required. a₁ a₁ A. A. a₂ a₂ A. A.(a₁ (a₁ a₂ a₂ (g (g f)(a₁) f)(a₁) (g (g f)(a₂)) f)(a₂)) Therefore, Therefore, we ll we ll choose choose an an arbitrary arbitrary a₁, a₁,a₂ a₂ AA where where a₁ a₁ a₂, a₂, then then prove prove that that (g (g f)(a₁) f)(a₁) (g (g f)(a₂). f)(a₂).

94 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). There There are are two two defnitions defnitions of of injectivity injectivity that that we we can can use use here: here: Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that a₁ A. A. ((g f)(a₁) = a₁ A. a₂ a₂ A.as ((g f)(a₁) =(g (g f)(a₂) f)(a₂) a₁ a₁= = a₂) a₂) g(f(a₁)) g(f(a₂)), required. a₁ a₁ A. A. a₂ a₂ A. A.(a₁ (a₁ a₂ a₂ (g (g f)(a₁) f)(a₁) (g (g f)(a₂)) f)(a₂)) Therefore, Therefore, we ll we ll choose choose an an arbitrary arbitrary a₁, a₁,a₂ a₂ AA where where a₁ a₁ a₂, a₂, then then prove prove that that (g (g f)(a₁) f)(a₁) (g (g f)(a₂). f)(a₂).

95 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). There There are are two two defnitions defnitions of of injectivity injectivity that that we we can can use use here: here: Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that a₁ A. A. ((g f)(a₁) = a₁ A. a₂ a₂ A.as ((g f)(a₁) =(g (g f)(a₂) f)(a₂) a₁ a₁= = a₂) a₂) g(f(a₁)) g(f(a₂)), required. a₁ a₁ A. A. a₂ a₂ A. A.(a₁ (a₁ a₂ a₂ (g (g f)(a₁) f)(a₁) (g (g f)(a₂)) f)(a₂)) Therefore, Therefore, we ll we ll choose choose an an arbitrary arbitrary a₁, a₁,a₂ a₂ AA where where a₁ a₁ a₂, a₂, then then prove prove that that (g (g f)(a₁) f)(a₁) (g (g f)(a₂). f)(a₂).

96 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required.

97 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required.

98 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁)defned? f(a₂), we see that How is (g f)(x) Howasisrequired. (g f)(x) g(f(a₁)) g(f(a₂)), defned? (g (g f)(x) f)(x)==g(f(x)) g(f(x)) So So we we need need to to prove prove that that g(f(a₁)) g(f(a₁)) g(f(a₂)). g(f(a₂)).

99 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁)defned? f(a₂), we see that How is (g f)(x) Howasisrequired. (g f)(x) g(f(a₁)) g(f(a₂)), defned? (g (g f)(x) f)(x)==g(f(x)) g(f(x)) So So we we need need to to prove prove that that g(f(a₁)) g(f(a₁)) g(f(a₂)). g(f(a₂)).

100 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁)defned? f(a₂), we see that How is (g f)(x) Howasisrequired. (g f)(x) g(f(a₁)) g(f(a₂)), defned? (g (g f)(x) f)(x)==g(f(x)) g(f(x)) So So we we need need to to prove prove that that g(f(a₁)) g(f(a₁)) g(f(a₂)). g(f(a₂)).

101 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁)defned? f(a₂), we see that How is (g f)(x) Howasisrequired. (g f)(x) g(f(a₁)) g(f(a₂)), defned? (g (g f)(x) f)(x)==g(f(x)) g(f(x)) So So we we need need to to prove prove that that g(f(a₁)) g(f(a₁)) g(f(a₂)). g(f(a₂)).

102 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required. g(f(a₁)) f(a₁) a₁ a₂ g(f(a₂)) f(a₂) A B C

103 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required. g(f(a₁)) f(a₁) a₁ a₂ g(f(a₂)) f(a₂) A B C

104 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required. g(f(a₁)) f(a₁) a₁ a₂ g(f(a₂)) f(a₂) A B C

105 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required. g(f(a₁)) f(a₁) a₁ a₂ g(f(a₂)) f(a₂) A B C

106 Theorem: If f : A B is an injection and g : B C is an injection, then the function g f : A C is also an injection. Proof: Let f : A B and g : B C be arbitrary injections. We will prove that the function g f : A C is also injective. To do so, consider any a₁, a₂ A where a₁ a₂. We will prove that (g f)(a₁) (g f)(a₂). Equivalently, we need to show that g(f(a₁)) g(f(a₂)). Since f is injective and a₁ a₂, we see that f(a₁) f(a₂). Then, since g is injective and f(a₁) f(a₂), we see that g(f(a₁)) g(f(a₂)), as required. g(f(a₁)) f(a₁) a₁ a₂ Great Great exercise: exercise: Repeat Repeat this this proof proof using using the the g(f(a₂)) f(a₂) A B other other defnition defnition of of injectivity. C injectivity.

107 Another Class of Functions

108 Mt. Lassen California Mt. Hood Washington Mt. St. Helens Oregon Mt. Shasta

109 Surjective Functions A function f : A B is called surjective (or onto) if this frst-order logic statement is true about f: b B. a A. f(a) = b ( For every possible output, there's at least one possible input that produces it ) A function with this property is called a surjection. How does this compare to our frst rule of functions?

110 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

111 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

112 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. for Let What xwhat = 2y.does Then it we see that does it mean mean for ff to to be be surjective? surjective?f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required. y y ℝ. ℝ. x x ℝ. ℝ.f(x) f(x)==yy Therefore, Therefore, we'll we'll choose choose an an arbitrary arbitrary yy ℝ, ℝ, then then prove prove that that there there isis some some xx ℝℝ where where f(x) f(x)==y. y.

113 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. for Let What xwhat = 2y.does Then it we see that does it mean mean for ff to to be be surjective? surjective?f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required. y y ℝ. ℝ. x x ℝ. ℝ.f(x) f(x)==yy Therefore, Therefore, we'll we'll choose choose an an arbitrary arbitrary yy ℝ, ℝ, then then prove prove that that there there isis some some xx ℝℝ where where f(x) f(x)==y. y.

114 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. for Let What xwhat = 2y.does Then it we see that does it mean mean for ff to to be be surjective? surjective?f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required. y y ℝ. ℝ. x x ℝ. ℝ.f(x) f(x)==yy Therefore, Therefore, we'll we'll choose choose an an arbitrary arbitrary yy ℝ, ℝ, then then prove prove that that there there isis some some xx ℝℝ where where f(x) f(x)==y. y.

115 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. for Let What xwhat = 2y.does Then it we see that does it mean mean for ff to to be be surjective? surjective?f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required. y y ℝ. ℝ. x x ℝ. ℝ.f(x) f(x)==yy Therefore, Therefore, we'll we'll choose choose an an arbitrary arbitrary yy ℝ, ℝ, then then prove prove that that there there isis some some xx ℝℝ where where f(x) f(x)==y. y.

116 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. for Let What xwhat = 2y.does Then it we see that does it mean mean for ff to to be be surjective? surjective?f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required. y y ℝ. ℝ. x x ℝ. ℝ.f(x) f(x)==yy Therefore, Therefore, we'll we'll choose choose an an arbitrary arbitrary yy ℝ, ℝ, then then prove prove that that there there isis some some xx ℝℝ where where f(x) f(x)==y. y.

117 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. for Let What xwhat = 2y.does Then it we see that does it mean mean for ff to to be be surjective? surjective?f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required. y y ℝ. ℝ. x x ℝ. ℝ.f(x) f(x)==yy Therefore, Therefore, we'll we'll choose choose an an arbitrary arbitrary yy ℝ, ℝ, then then prove prove that that there there isis some some xx ℝℝ where where f(x) f(x)==y. y.

118 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

119 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

120 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

121 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

122 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

123 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

124 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

125 Surjective Functions Theorem: Let f : ℝ ℝ be defned as f(x) = x / 2. Then f(x) is surjective. Proof: Consider any y ℝ. We will prove that there is a choice of x ℝ such that f(x) = y. Let x = 2y. Then we see that f(x) = f(2y) = 2y / 2 = y. So f(x) = y, as required.

126 Composing Surjections

127 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, which is what we needed to show.

128 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, which is what we needed to show.

129 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, which is what we needed to show.

130 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, which is what we needed to show.

131 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. itit mean What What does does mean for for gg ff :: AA CC to to be be surjective? surjective? Consider any c C. Since g : B C is surjective, there is c C. = A. f)(a) = some b B such g(b) Similarly, c that C. a a A.c.(g (g f)(a)since = cc f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such Therefore, we'll choose arbitrary c Cthat and prove that there Therefore, we'll choose arbitrary c C and prove that there isis some AA such that g(b)(g = c, some aa g(f(a)) such= that (g f)(a) f)(a) == c. c. which is what we needed to show.

132 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. itit mean What What does does mean for for gg ff :: AA CC to to be be surjective? surjective? Consider any c C. Since g : B C is surjective, there is c C. = A. f)(a) = some b B such g(b) Similarly, c that C. a a A.c.(g (g f)(a)since = cc f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such Therefore, we'll choose arbitrary c Cthat and prove that there Therefore, we'll choose arbitrary c C and prove that there isis some AA such that g(b)(g = c, some aa g(f(a)) such= that (g f)(a) f)(a) == c. c. which is what we needed to show.

133 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. itit mean What What does does mean for for gg ff :: AA CC to to be be surjective? surjective? Consider any c C. Since g : B C is surjective, there is c C. = A. f)(a) = some b B such g(b) Similarly, c that C. a a A.c.(g (g f)(a)since = cc f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such Therefore, we'll choose arbitrary c Cthat and prove that there Therefore, we'll choose arbitrary c C and prove that there isis some AA such that g(b)(g = c, some aa g(f(a)) such= that (g f)(a) f)(a) == c. c. which is what we needed to show.

134 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, which is what we needed to show.

135 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, c which is what we needed to show. a A B b C

136 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, c which is what we needed to show. a A B b C

137 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, c which is what we needed to show. a A B b C

138 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, c which is what we needed to show. a A B b C

139 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, c which is what we needed to show. a A B b C

140 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, c which is what we needed to show. a A B b C

141 Theorem: If f : A B is surjective and g : B C is surjective, then g f : A C is also surjective. Proof: Let f : A B and g : B C be arbitrary surjections. We will prove that the function g f : A C is also surjective. To do so, we will prove that for any c C, there is some a A such that (g f)(a) = c. Equivalently, we will prove that for any c C, there is some a A such that g(f(a)) = c. Consider any c C. Since g : B C is surjective, there is some b B such that g(b) = c. Similarly, since f : A B is surjective, there is some a A such that f(a) = b. This means that there is some a A such that g(f(a)) = g(b) = c, which is what we needed to show.

142 Injections and Surjections An injective function associates at most one element of the domain with each element of the codomain. A surjective function associates at least one element of the domain with each element of the codomain. What about functions that associate exactly one element of the domain with each element of the codomain?

143 Katniss Everdeen Elsa Hermione Granger

144 Bijections A function that associates each element of the codomain with a unique element of the domain is called bijective. Such a function is a bijection. Formally, a bijection is a function that is both injective and surjective. Bijections are sometimes called one-toone correspondences. Not to be confused with one-to-one functions.

145 Bijections and Composition Suppose that f : A B and g : B C are bijections. Is g f necessarily a bijection? Yes! Since both f and g are injective, we know that g f is injective. Since both f and g are surjective, we know that g f is surjective. Therefore, g f is a bijection.

146 Inverse Functions

147 Katniss Everdeen Elsa Hermione Granger

148 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

149 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

150 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

151 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

152 Mt. Lassen California Mt. Hood Washington Mt. St. Helens Oregon Mt. Shasta

153 Mt. Lassen California Mt. Hood Washington Mt. St. Helens Oregon Mt. Shasta

f(x) = x4 5x2 + 4 source:

f(x) = x4 5x2 + 4 source: Functions What is a function? f(x) = x4 5x2 + 4 source: https://saylordotorg.github.io/text_intermediate-algebra/section_07/6aaf3a5ab540885474d58855068b64ce.png int int flipuntil(int flipuntil(int n) n)

More information

Functions, High-School Edition

Functions, High-School Edition Functions What is a function? Functions, High-School Edition f(x) = x4 5x2 + 4 source: https://saylordotorg.github.io/text_intermediate-algebra/section_07/6aaf3a5ab540885474d58855068b64ce.png source: http://study.com/cimages/multimages/16/asymptote_1.jpg

More information

Functions, High-School Edition

Functions, High-School Edition Functions What is a function? Functions, High-School Edition f(x) = x4 5x2 + 4 source: https://saylordotorg.github.io/text_intermediate-algebra/section_07/6aaf3a5ab540885474d58855068b64ce.png source: http://study.com/cimages/multimages/16/asymptote_1.jpg

More information

Functions, High-School Edition

Functions, High-School Edition Functions What is a function? Functions, High-School Edition f(x) = x4 5x2 + 4 source: https://saylordotorg.github.io/text_intermediate-algebra/section_07/6aaf3a5ab540885474d58855068b64ce.png source: http://study.com/cimages/multimages/16/asymptote_1.jpg

More information

Functions, High-School Edition

Functions, High-School Edition Functions What is a function? Functions, High-School Edition f(x) = x4 5x2 + 4 source: https://saylordotorg.github.io/text_intermediate-algebra/section_07/6aaf3a5ab540885474d58855068b64ce.png source: http://study.com/cimages/multimages/16/asymptote_1.jpg

More information

The Pigeonhole Principle & Functions

The Pigeonhole Principle & Functions The Pigeonhole Principle & Functions Problem Problem Set Set Two Two due due in in the the box box up up front. front. The pigeonhole principle is the following: If m objects are placed into n bins, where

More information

Announcements. Problem Set 3 due Friday, October 21. Alternate Midterm Times. Drop by office hours! Ask questions at

Announcements. Problem Set 3 due Friday, October 21. Alternate Midterm Times. Drop by office hours! Ask questions at Functions Announcements Problem Set 3 due Friday, October 21 Drop by office hours! Ask questions at cs103@cs.stanford.edu. Alternate Midterm Times Wednesday, October 26, 7:00PM 10:00PM Thursday, October

More information

Functions. How is this definition written in symbolic logic notation?

Functions. How is this definition written in symbolic logic notation? functions 1 Functions Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. We write f(a) = b if b is the unique element of B assigned by

More information

Graph Theory Part Two

Graph Theory Part Two Graph Theory Part Two Recap from Last Time A graph is a mathematical structure for representing relationships. Nodes A graph consists of a set of nodes (or vertices) connected by edges (or arcs) A graph

More information

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A.

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. Functions functions 1 Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. a A! b B b is assigned to a a A! b B f ( a) = b Notation: If

More information

2. Functions, sets, countability and uncountability. Let A, B be sets (often, in this module, subsets of R).

2. Functions, sets, countability and uncountability. Let A, B be sets (often, in this module, subsets of R). 2. Functions, sets, countability and uncountability I. Functions Let A, B be sets (often, in this module, subsets of R). A function f : A B is some rule that assigns to each element of A a unique element

More information

Functions 2/1/2017. Exercises. Exercises. Exercises. and the following mathematical appetizer is about. Functions. Functions

Functions 2/1/2017. Exercises. Exercises. Exercises. and the following mathematical appetizer is about. Functions. Functions Exercises Question 1: Given a set A = {x, y, z} and a set B = {1, 2, 3, 4}, what is the value of 2 A 2 B? Answer: 2 A 2 B = 2 A 2 B = 2 A 2 B = 8 16 = 128 Exercises Question 2: Is it true for all sets

More information

Binary Relations Part One

Binary Relations Part One Binary Relations Part One Outline for Today Binary Relations Reasoning about connections between objects. Equivalence Relations Reasoning about clusters. A Fundamental Theorem How do we know we have the

More information

Cardinality Lectures

Cardinality Lectures Cardinality Lectures Enrique Treviño March 8, 014 1 Definition of cardinality The cardinality of a set is a measure of the size of a set. When a set A is finite, its cardinality is the number of elements

More information

MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan

MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan MATH 22 Lecture M: 10/14/2003 MORE ABOUT FUNCTIONS Form follows function. Louis Henri Sullivan This frightful word, function, was born under other skies than those I have loved. Le Corbusier D ora innanzi

More information

Notes on metric spaces and topology. Math 309: Topics in geometry. Dale Rolfsen. University of British Columbia

Notes on metric spaces and topology. Math 309: Topics in geometry. Dale Rolfsen. University of British Columbia Notes on metric spaces and topology Math 309: Topics in geometry Dale Rolfsen University of British Columbia Let X be a set; we ll generally refer to its elements as points. A distance function, or metric

More information

MATH 271 Summer 2016 Assignment 4 solutions

MATH 271 Summer 2016 Assignment 4 solutions MATH 7 ummer 06 Assignment 4 solutions Problem Let A, B, and C be some sets and suppose that f : A B and g : B C are functions Prove or disprove each of the following statements (a) If f is one-to-one

More information

CS103 Spring 2018 Mathematical Vocabulary

CS103 Spring 2018 Mathematical Vocabulary CS103 Spring 2018 Mathematical Vocabulary You keep using that word. I do not think it means what you think it means. - Inigo Montoya, from The Princess Bride Consider the humble while loop in most programming

More information

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology.

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. Guide to and Hi everybody! In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. This guide focuses on two of those symbols: and. These symbols represent concepts

More information

3. Determine whether f is a function from the set of all bit strings to the set of integers if

3. Determine whether f is a function from the set of all bit strings to the set of integers if Exercises Exercises 1. Why is f not a function from R to R if a) f(x) = 1/x? b) c) 2. Determine whether f is a function from Z to R if a) f(n) = ± n. b). c) f(n) = 1/(n2 4). 3. Determine whether f is a

More information

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall CSE 20 https://goo.gl/forms/1o 1KOd17RMoURxjn2 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Explain the steps in a proof by mathematical and/or structural

More information

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 [talking head] This lecture we study theory design and implementation. Programmers have two roles to play here. In one role, they

More information

A graph is a mathematical structure for representing relationships.

A graph is a mathematical structure for representing relationships. Graphs Part Two A graph is a mathematical structure for representing relationships. Nodes A graph consists of a set of nodes (or vertices) connected by edges (or arcs) A graph is a mathematical structure

More information

Denotational semantics

Denotational semantics 1 Denotational semantics 2 What we're doing today We're looking at how to reason about the effect of a program by mapping it into mathematical objects Specifically, answering the question which function

More information

Definition: A graph G = (V, E) is called a tree if G is connected and acyclic. The following theorem captures many important facts about trees.

Definition: A graph G = (V, E) is called a tree if G is connected and acyclic. The following theorem captures many important facts about trees. Tree 1. Trees and their Properties. Spanning trees 3. Minimum Spanning Trees 4. Applications of Minimum Spanning Trees 5. Minimum Spanning Tree Algorithms 1.1 Properties of Trees: Definition: A graph G

More information

Extra Practice Problems 2

Extra Practice Problems 2 CS103 Handout 31 Fall 2018 October 29, 2018 Extra Practice Problems 2 Here's a set of a bunch of practice problems you can work through to solidify your understanding of the topics from Problem Sets Three,

More information

Problem One: A Quick Algebra Review

Problem One: A Quick Algebra Review CS103A Winter 2019 Solutions for Week One Handout 01S Problem One: A Quick Algebra Review In the first week of CS103, we'll be doing a few proofs that will require some algebraic manipulations and reasoning

More information

Cardinality of Sets. Washington University Math Circle 10/30/2016

Cardinality of Sets. Washington University Math Circle 10/30/2016 Cardinality of Sets Washington University Math Circle 0/0/06 The cardinality of a finite set A is just the number of elements of A, denoted by A. For example, A = {a, b, c, d}, B = {n Z : n } = {,,, 0,,,

More information

Grade 6 Math Circles November 6 & Relations, Functions, and Morphisms

Grade 6 Math Circles November 6 & Relations, Functions, and Morphisms Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Relations Let s talk about relations! Grade 6 Math Circles November 6 & 7 2018 Relations, Functions, and

More information

.Math 0450 Honors intro to analysis Spring, 2009 Notes #4 corrected (as of Monday evening, 1/12) some changes on page 6, as in .

.Math 0450 Honors intro to analysis Spring, 2009 Notes #4 corrected (as of Monday evening, 1/12) some changes on page 6, as in  . 0.1 More on innity.math 0450 Honors intro to analysis Spring, 2009 Notes #4 corrected (as of Monday evening, 1/12) some changes on page 6, as in email. 0.1.1 If you haven't read 1.3, do so now! In notes#1

More information

Functions. Jason Filippou UMCP. Jason Filippou UMCP) Functions / 19

Functions. Jason Filippou UMCP. Jason Filippou UMCP) Functions / 19 Functions Jason Filippou CMSC250 @ UMCP 06-22-2016 Jason Filippou (CMSC250 @ UMCP) Functions 06-22-2016 1 / 19 Outline 1 Basic definitions and examples 2 Properties of functions 3 The pigeonhole principle

More information

Proofwriting Checklist

Proofwriting Checklist CS103 Winter 2019 Proofwriting Checklist Cynthia Lee Keith Schwarz Over the years, we ve found many common proofwriting errors that can easily be spotted once you know how to look for them. In this handout,

More information

CS 115 Exam 3, Spring 2011

CS 115 Exam 3, Spring 2011 CS 115 Exam 3, Spring 2011 Your name: Rules You may use one handwritten 8.5 x 11 cheat sheet (front and back). This is the only resource you may consult during this exam. Explain/show work if you want

More information

W13:Homework:H07. CS40 Foundations of Computer Science W13. From 40wiki

W13:Homework:H07. CS40 Foundations of Computer Science W13. From 40wiki W13:Homework:H07 From 40wiki CS40 Foundations of Computer Science W13 W13:Exams W13:Homework in Class and Web Work W13:Calendar W13:Syllabus and Lecture Notes UCSB-CS40-W13 on Facebook (https://www.facebook.com/groups/ucsb.cs40.w13/)

More information

13 th Annual Johns Hopkins Math Tournament Saturday, February 19, 2011 Automata Theory EUR solutions

13 th Annual Johns Hopkins Math Tournament Saturday, February 19, 2011 Automata Theory EUR solutions 13 th Annual Johns Hopkins Math Tournament Saturday, February 19, 011 Automata Theory EUR solutions Problem 1 (5 points). Prove that any surjective map between finite sets of the same cardinality is a

More information

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus)

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus) Math 30 Introduction to Proofs via Number Theory Robert Jewett (with small modifications by B. Ćurgus) March 30, 009 Contents 1 The Integers 3 1.1 Axioms of Z...................................... 3 1.

More information

2.3: FUNCTIONS. abs( x)

2.3: FUNCTIONS. abs( x) 2.3: FUNCTIONS Definition: Let A and B be sets. A function f is a rule that assigns to each element x A exactly one element y B, written y = f (x). A is called the domain of f and f is said to be defined

More information

The Language of Sets and Functions

The Language of Sets and Functions MAT067 University of California, Davis Winter 2007 The Language of Sets and Functions Isaiah Lankham, Bruno Nachtergaele, Anne Schilling (January 7, 2007) 1 The Language of Sets 1.1 Definition and Notation

More information

Functions (4A) Young Won Lim 5/8/17

Functions (4A) Young Won Lim 5/8/17 Functions (4A) Copyright (c) 2015 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version

More information

Lecture 20 : Trees DRAFT

Lecture 20 : Trees DRAFT CS/Math 240: Introduction to Discrete Mathematics 4/12/2011 Lecture 20 : Trees Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last time we discussed graphs. Today we continue this discussion,

More information

Math 443/543 Graph Theory Notes

Math 443/543 Graph Theory Notes Math 443/543 Graph Theory Notes David Glickenstein September 3, 2008 1 Introduction We will begin by considering several problems which may be solved using graphs, directed graphs (digraphs), and networks.

More information

Binary Relations Part One

Binary Relations Part One Binary Relations Part One Outline for Today Binary Relations Reasoning about connections between objects. Equivalence Relations Reasoning about clusters. A Fundamental Theorem How do we know we have the

More information

Packages in Julia. Downloading Packages A Word of Caution Sawtooth, Revisited

Packages in Julia. Downloading Packages A Word of Caution Sawtooth, Revisited Packages in Julia Downloading Packages A Word of Caution Sawtooth, Revisited Downloading Packages Because Julia is an open-source language, there are a ton of packages available online that enable such

More information

Range Minimum Queries Part Two

Range Minimum Queries Part Two Range Minimum Queries Part Two Recap from Last Time The RMQ Problem The Range Minimum Query (RMQ) problem is the following: Given a fied array A and two indices i j, what is the smallest element out of

More information

Sets 1. The things in a set are called the elements of it. If x is an element of the set S, we say

Sets 1. The things in a set are called the elements of it. If x is an element of the set S, we say Sets 1 Where does mathematics start? What are the ideas which come first, in a logical sense, and form the foundation for everything else? Can we get a very small number of basic ideas? Can we reduce it

More information

Continuous functions and homeomorphisms

Continuous functions and homeomorphisms Continuous functions and homeomorphisms 1 Motivation Up to now we have defined just a few topological properties, like the first three T -axioms and the countability properties (separable, ccc, first and

More information

MITOCW watch?v=4dj1oguwtem

MITOCW watch?v=4dj1oguwtem MITOCW watch?v=4dj1oguwtem PROFESSOR: So it's time to examine uncountable sets. And that's what we're going to do in this segment. So Cantor's question was, are all sets the same size? And he gives a definitive

More information

Introduction to Denotational Semantics. Class Likes/Dislikes Survey. Dueling Semantics. Denotational Semantics Learning Goals. You re On Jeopardy!

Introduction to Denotational Semantics. Class Likes/Dislikes Survey. Dueling Semantics. Denotational Semantics Learning Goals. You re On Jeopardy! Introduction to Denotational Semantics Class Likes/Dislikes Survey would change [the bijection question] to be one that still tested students' recollection of set theory but that didn't take as much time

More information

Functions (4A) Young Won Lim 3/16/18

Functions (4A) Young Won Lim 3/16/18 Functions (4A) Copyright (c) 2015 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version

More information

CS 2530 INTERMEDIATE COMPUTING

CS 2530 INTERMEDIATE COMPUTING CS 2530 INTERMEDIATE COMPUTING Spring 2016 1-8-2018 Michael J. Holmes University of Northern Iowa Object Oriented Concepts In some cases we ll learn the concepts prior to learning the terminology. Other

More information

CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist

CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist In Handout 28, the Guide to Inductive Proofs, we outlined a number of specifc issues and concepts to be mindful about when

More information

1 Elementary number theory

1 Elementary number theory Math 215 - Introduction to Advanced Mathematics Spring 2019 1 Elementary number theory We assume the existence of the natural numbers and the integers N = {1, 2, 3,...} Z = {..., 3, 2, 1, 0, 1, 2, 3,...},

More information

ASYMPTOTIC COMPLEXITY

ASYMPTOTIC COMPLEXITY Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better. - Edsger Dijkstra ASYMPTOTIC COMPLEXITY Lecture

More information

Fundamental Graph Algorithms Part Three

Fundamental Graph Algorithms Part Three Fundamental Graph Algorithms Part Three Outline for Today Topological Sorting, Part II How can we quickly compute a topological ordering on a DAG? Connected Components How do we find the pieces of an undirected

More information

Announcement. Submit assignment 3 on CourSys Do not hand in hard copy Due Friday, 15:20:00. Caution: Assignment 4 will be due next Wednesday

Announcement. Submit assignment 3 on CourSys Do not hand in hard copy Due Friday, 15:20:00. Caution: Assignment 4 will be due next Wednesday Announcement Submit assignment 3 on CourSys Do not hand in hard copy Due Friday, 15:20:00 Caution: Assignment 4 will be due next Wednesday Recursion Examples and Simple Searching CMPT 125 Jan. 28 Recursion

More information

Introduction to Denotational Semantics. Brutus Is An Honorable Man. Class Likes/Dislikes Survey. Dueling Semantics

Introduction to Denotational Semantics. Brutus Is An Honorable Man. Class Likes/Dislikes Survey. Dueling Semantics Brutus Is An Honorable Man HW2 will not be due today. Homework X+1 will never be due until after I have returned Homework X to you. Normally this is never an issue, but I was sick yesterday and was hosting

More information

ASYMPTOTIC COMPLEXITY

ASYMPTOTIC COMPLEXITY Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better. - Edsger Dijkstra ASYMPTOTIC COMPLEXITY Lecture

More information

AXIOMS FOR THE INTEGERS

AXIOMS FOR THE INTEGERS AXIOMS FOR THE INTEGERS BRIAN OSSERMAN We describe the set of axioms for the integers which we will use in the class. The axioms are almost the same as what is presented in Appendix A of the textbook,

More information

Lecture 25 : Counting DRAFT

Lecture 25 : Counting DRAFT CS/Math 240: Introduction to Discrete Mathematics 4/28/2011 Lecture 25 : Counting Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Today we start the last topic of the course, counting. For

More information

Math 443/543 Graph Theory Notes

Math 443/543 Graph Theory Notes Math 443/543 Graph Theory Notes David Glickenstein September 8, 2014 1 Introduction We will begin by considering several problems which may be solved using graphs, directed graphs (digraphs), and networks.

More information

Section 1.7 Sequences, Summations Cardinality of Infinite Sets

Section 1.7 Sequences, Summations Cardinality of Infinite Sets Section 1.7 Sequences, Summations Cardinality of Infinite Sets Definition: A sequence is a function from a subset of the natural numbers (usually of the form {0, 1, 2,... } to a set S. Note: the sets and

More information

Specifications. Prof. Clarkson Fall Today s music: Nice to know you by Incubus

Specifications. Prof. Clarkson Fall Today s music: Nice to know you by Incubus Specifications Prof. Clarkson Fall 2015 Today s music: Nice to know you by Incubus Question Would you like a tiny bonus to your final grade for being here on time today? A. Yes B. Sí C. Hai D. Haan E.

More information

Section 2.4 Sequences and Summations

Section 2.4 Sequences and Summations Section 2.4 Sequences and Summations Definition: A sequence is a function from a subset of the natural numbers (usually of the form {0, 1, 2,... } to a set S. Note: the sets and {0, 1, 2, 3,..., k} {1,

More information

CS103 Handout 39 Winter 2018 February 23, 2018 Problem Set 7

CS103 Handout 39 Winter 2018 February 23, 2018 Problem Set 7 CS103 Handout 39 Winter 2018 February 23, 2018 Problem Set 7 What can you do with regular expressions? What are the limits of regular languages? In this problem set, you'll explore the answers to these

More information

Shared Variables and Interference

Shared Variables and Interference Solved Shared Variables and Interference CS 536: Science of Programming, Fall 2018 A. Why Parallel programs can coordinate their work using shared variables, but it s important for threads to not interfere

More information

Solutions to Some Examination Problems MATH 300 Monday 25 April 2016

Solutions to Some Examination Problems MATH 300 Monday 25 April 2016 Name: s to Some Examination Problems MATH 300 Monday 25 April 2016 Do each of the following. (a) Let [0, 1] denote the unit interval that is the set of all real numbers r that satisfy the contraints that

More information

Figure 1: From Left to Right, General Venn Diagrams for One, Two, and Three Sets

Figure 1: From Left to Right, General Venn Diagrams for One, Two, and Three Sets 2.3. VENN DIAGRAMS & SET OPERATIONS In this section we introduce Venn diagrams and define four basic operations on sets. We also present some important properties related to these operations. Venn Diagrams

More information

Mathematical Logic Part One

Mathematical Logic Part One Mathematical Logic Part One Question: How do we formalize the logic we've been using in our proofs? Where We're Going Propositional Logic (Today) Basic logical connectives. Truth tables. Logical equivalences.

More information

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS Definition 1.1. Let X be a set and T a subset of the power set P(X) of X. Then T is a topology on X if and only if all of the following

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set

More information

MA651 Topology. Lecture 4. Topological spaces 2

MA651 Topology. Lecture 4. Topological spaces 2 MA651 Topology. Lecture 4. Topological spaces 2 This text is based on the following books: Linear Algebra and Analysis by Marc Zamansky Topology by James Dugundgji Fundamental concepts of topology by Peter

More information

Introduction to Homotopy Type Theory

Introduction to Homotopy Type Theory Introduction to Homotopy Type Theory Lecture notes for a course at EWSCS 2017 Thorsten Altenkirch March 5, 2017 1 What is this course about? To explain what Homotopy Type Theory is, I will first talk about

More information

It is important that you show your work. There are 134 points available on this test.

It is important that you show your work. There are 134 points available on this test. Math 1165 Discrete Math Test April 4, 001 Your name It is important that you show your work There are 134 points available on this test 1 (10 points) Show how to tile the punctured chess boards below with

More information

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 CS 3512, Spring 2011 Instructor: Doug Dunham Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 Prerequisites: Calc I, CS2511 Rough course outline:

More information

Chapter 3. Set Theory. 3.1 What is a Set?

Chapter 3. Set Theory. 3.1 What is a Set? Chapter 3 Set Theory 3.1 What is a Set? A set is a well-defined collection of objects called elements or members of the set. Here, well-defined means accurately and unambiguously stated or described. Any

More information

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ). MATH 139 W12 Review 1 Checklist 1 Exam Checklist 1. Introduction to Predicates and Quantified Statements (chapters 3.1-3.4). universal and existential statements truth set negations of universal and existential

More information

QED Q: Why is it called the triangle inequality? A: Analogue with euclidean distance in the plane: picture Defn: Minimum Distance of a code C:

QED Q: Why is it called the triangle inequality? A: Analogue with euclidean distance in the plane: picture Defn: Minimum Distance of a code C: Lecture 3: Lecture notes posted online each week. Recall Defn Hamming distance: for words x = x 1... x n, y = y 1... y n of the same length over the same alphabet, d(x, y) = {1 i n : x i y i } i.e., d(x,

More information

Cardinality of Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Cardinality of Sets Fall / 15

Cardinality of Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Cardinality of Sets Fall / 15 Cardinality of Sets MAT Transition to Higher Mathematics Fall 0 MAT (Transition to Higher Math) Cardinality of Sets Fall 0 / Outline Sets with Equal Cardinality Countable and Uncountable Sets MAT (Transition

More information

Outline for Today. The Pigeonhole Principle. Graph Theory Party Tricks. The Hadwiger-Nelson Problem. Results that are too big to fail.

Outline for Today. The Pigeonhole Principle. Graph Theory Party Tricks. The Hadwiger-Nelson Problem. Results that are too big to fail. Graphs Part Two Outline for Today The Pigeonhole Principle Graph Theory Party Tricks Results that are too big to fail. Applying graph theory to real life! The Hadwiger-Nelson Problem A glimpse of advanced

More information

Skill 3 Relations and Functions

Skill 3 Relations and Functions Skill 3 Relations and Functions 3a: Use Interval and Set Notation 3b: Determine the domain and range of a relation given a set of ordered pairs, a graph, or an equation 3c: Determine whether a relation

More information

CS 6110 S14 Lecture 1 Introduction 24 January 2014

CS 6110 S14 Lecture 1 Introduction 24 January 2014 CS 6110 S14 Lecture 1 Introduction 24 January 2014 1 Introduction What is a program? Is it just something that tells the computer what to do? Yes, but there is much more to it than that. The basic expressions

More information

ECS 20 Lecture 9 Fall Oct 2013 Phil Rogaway

ECS 20 Lecture 9 Fall Oct 2013 Phil Rogaway ECS 20 Lecture 9 Fall 2013 24 Oct 2013 Phil Rogaway Today: o Sets of strings (languages) o Regular expressions Distinguished Lecture after class : Some Hash-Based Data Structures and Algorithms Everyone

More information

Instructor: Craig Duckett. Lecture 04: Thursday, April 5, Relationships

Instructor: Craig Duckett. Lecture 04: Thursday, April 5, Relationships Instructor: Craig Duckett Lecture 04: Thursday, April 5, 2018 Relationships 1 Assignment 1 is due NEXT LECTURE 5, Tuesday, April 10 th in StudentTracker by MIDNIGHT MID-TERM EXAM is LECTURE 10, Tuesday,

More information

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively Enumerable Languages, Turing Machines, and Decidability Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm

More information

γ(ɛ) (a, b) (a, d) (d, a) (a, b) (c, d) (d, d) (e, e) (e, a) (e, e) (a) Draw a picture of G.

γ(ɛ) (a, b) (a, d) (d, a) (a, b) (c, d) (d, d) (e, e) (e, a) (e, e) (a) Draw a picture of G. MAD 3105 Spring 2006 Solutions for Review for Test 2 1. Define a graph G with V (G) = {a, b, c, d, e}, E(G) = {r, s, t, u, v, w, x, y, z} and γ, the function defining the edges, is given by the table ɛ

More information

Lecture 7: the quotient topology

Lecture 7: the quotient topology Lecture 7: the quotient topology Saul Glasman September 21, 2016 Why couldn t we say that a homeomorphism was just a continuous bijection? Why did we have to explicitly require the inverse to be continuous

More information

Shared Variables and Interference

Shared Variables and Interference Illinois Institute of Technology Lecture 24 Shared Variables and Interference CS 536: Science of Programming, Spring 2018 A. Why Parallel programs can coordinate their work using shared variables, but

More information

Continuity and Tangent Lines for functions of two variables

Continuity and Tangent Lines for functions of two variables Continuity and Tangent Lines for functions of two variables James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University April 4, 2014 Outline 1 Continuity

More information

Balanced Trees Part One

Balanced Trees Part One Balanced Trees Part One Balanced Trees Balanced search trees are among the most useful and versatile data structures. Many programming languages ship with a balanced tree library. C++: std::map / std::set

More information

Comparing sizes of sets

Comparing sizes of sets Comparing sizes of sets Sets A and B are the same size if there is a bijection from A to B. (That was a definition!) For finite sets A, B, it is not difficult to verify that there is a bijection from A

More information

Surfaces and Partial Derivatives

Surfaces and Partial Derivatives Surfaces and James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University November 15, 2017 Outline 1 2 Tangent Planes Let s go back to our simple surface

More information

Chapter 4. Relations & Graphs. 4.1 Relations. Exercises For each of the relations specified below:

Chapter 4. Relations & Graphs. 4.1 Relations. Exercises For each of the relations specified below: Chapter 4 Relations & Graphs 4.1 Relations Definition: Let A and B be sets. A relation from A to B is a subset of A B. When we have a relation from A to A we often call it a relation on A. When we have

More information

Kuratowski Notes , Fall 2005, Prof. Peter Shor Revised Fall 2007

Kuratowski Notes , Fall 2005, Prof. Peter Shor Revised Fall 2007 Kuratowski Notes 8.30, Fall 005, Prof. Peter Shor Revised Fall 007 Unfortunately, the OCW notes on Kuratowski s theorem seem to have several things substantially wrong with the proof, and the notes from

More information

Cantor s Diagonal Argument for Different Levels of Infinity

Cantor s Diagonal Argument for Different Levels of Infinity JANUARY 2015 1 Cantor s Diagonal Argument for Different Levels of Infinity Michael J. Neely University of Southern California http://www-bcf.usc.edu/ mjneely Abstract These notes develop the classic Cantor

More information

1. (10 points) Draw the state diagram of the DFA that recognizes the language over Σ = {0, 1}

1. (10 points) Draw the state diagram of the DFA that recognizes the language over Σ = {0, 1} CSE 5 Homework 2 Due: Monday October 6, 27 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments in

More information

Mathematical Logic Part Two

Mathematical Logic Part Two Mathematical Logic Part Two Recap from Last Time Recap So Far A propositional variable is a variable that is either true or false. The propositional connectives are as follows: Negation: p Conjunction:

More information

CPSC 121: Models of Computation Assignment #4, due Thursday, March 16 th,2017at16:00

CPSC 121: Models of Computation Assignment #4, due Thursday, March 16 th,2017at16:00 CPSC 121: Models of Computation Assignment #4, due Thursday, March 16 th,2017at16:00 [18] 1. Consider the following predicate logic statement: 9x 2 A, 8y 2 B,9z 2 C, P(x, y, z)! Q(x, y, z), where A, B,

More information

CISC-235. At this point we fnally turned our atention to a data structure: the stack

CISC-235. At this point we fnally turned our atention to a data structure: the stack CISC-235 20180918 At this point we fnally turned our atention to a data structure: the stack A stack is our frst example of an Abstract Data Type: we specify the operations we need to be able to perform

More information

EDAA40 At home exercises 1

EDAA40 At home exercises 1 EDAA40 At home exercises 1 1. Given, with as always the natural numbers starting at 1, let us define the following sets (with iff ): Give the number of elements in these sets as follows: 1. 23 2. 6 3.

More information

Lattice Polygon s and Pick s Theorem From Dana Paquin and Tom Davis 1 Warm-Up to Ponder

Lattice Polygon s and Pick s Theorem From Dana Paquin and Tom Davis   1 Warm-Up to Ponder Lattice Polygon s and Pick s Theorem From Dana Paquin and Tom Davis http://www.geometer.org/mathcircles/pick.pdf 1 Warm-Up to Ponder 1. Is it possible to draw an equilateral triangle on graph paper so

More information