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

Size: px
Start display at page:

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

Transcription

1 Functions

2 What is a function?

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

4 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;

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

6 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?

7 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 definition we'll revisit this in a bit.)

8 Dikdik Nubian Ibex Sloth

9

10 but also

11 f(x) = x2 + 3x 15

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

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

14 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 definition: int randomnumber(int numoutcomes) { return rand() % numoutcomes; }

15 f( )= f(137 ) =?

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

17 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 bedefined defined 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.

18 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. double absolutevalueof(double x) { if (x >= 0) { return x; } else { return -x; } }

19 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.

20 The Official 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?

21 Defining 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.

22 Defining Functions Typically, we specify a function by describing a rule that maps every element This of the domain to some element of function the Thisisisthe theceiling ceiling function the the smallest integer greater than smallest integer greater thanor or codomain. equal to x. For example, 1 = 1, equal to x. For example, 1 = 1, Examples: ==2,2,and and π π ==4.4. 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.

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

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

25 ح رم م 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

26 Combining Functions

27 f : People Places Cynthia g : Places Prices San Jose Far Too Much Divya San Francisco King's Ransom Hugo Redding A Modest Amount Teresa Fresno A Bit Too Much John People Palo Alto Places h : People Prices h(x) = g(f(x)) Prices

28 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))

29 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 first.

30 Special Types of Functions

31 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto

32 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

33 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 different, the outputs are different. ) The following first-order definition 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?

34 Injective Functions Theorem: Let f : ℕ ℕ be defined 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.

35 Injective Functions Theorem: Let f : ℕ ℕ be defined 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.

36 Injective Functions Theorem: Let f : ℕ ℕ be defined 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 startingoff offthis 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.

37 Injective Functions Theorem: Let f : ℕ ℕ be defined 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 Whatdoes doesititmean meanfor forthe thefunction functionffto tobe be Since f(n₀) = f(n₁), we see that injective? injective? 2n₀ + 7 = 2n₁ + 7. n₀ n₁ n₀ ℕ. ℕ.means n₁ ℕ. ℕ.((f(n₀) f(n₀)==f(n₁) f(n₁) n₀ n₀==n₁ n₁)) This in turn that n₀ 2n₁, n₁ n₀ ℕ. ℕ. n₁ n₁ ℕ. ℕ.(2n₀ (n₀ n₀= n₁ f(n₀) f(n₀) f(n₁) f(n₁))) so n₀ = n₁, as we'll required. Therefore, pick arbitrary Therefore, we'll pick arbitraryn₀, n₀,n₁ n₁ ℕ ℕwhere where f(n₀) f(n₀)==f(n₁), f(n₁),then thenprove provethat thatn₀ n₀==n₁. n₁.

38 Injective Functions Theorem: Let f : ℕ ℕ be defined 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 Whatdoes doesititmean meanfor forthe thefunction functionffto tobe be Since f(n₀) = f(n₁), we see that injective? injective? 2n₀ + 7 = 2n₁ + 7. n₁ n₂ n₁ ℕ. ℕ.means n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) This in turn that n₁ 2n₁, n₂ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.(2n₀ (n₁ n₁= n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as we'll required. Therefore, pick arbitrary Therefore, we'll pick arbitraryn₀, n₀,n₁ n₁ ℕ ℕwhere where f(n₀) f(n₀)==f(n₁), f(n₁),then thenprove provethat thatn₀ n₀==n₁. n₁.

39 Injective Functions Theorem: Let f : ℕ ℕ be defined 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 Whatdoes doesititmean meanfor forthe thefunction functionffto tobe be Since f(n₀) = f(n₁), we see that injective? injective? 2n₀ + 7 = 2n₁ + 7. n₁ n₂ n₁ ℕ. ℕ.means n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) This in turn that n₁ 2n₁, n₂ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.(2n₀ (n₁ n₁= n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as we'll required. Therefore, pick arbitrary Therefore, we'll pick arbitraryn₀, n₀,n₁ n₁ ℕ ℕwhere where f(n₀) f(n₀)==f(n₁), f(n₁),then thenprove provethat thatn₀ n₀==n₁. n₁.

40 Injective Functions Theorem: Let f : ℕ ℕ be defined 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 Whatdoes doesititmean meanfor forthe thefunction functionffto tobe be Since f(n₀) = f(n₁), we see that injective? injective? 2n₀ + 7 = 2n₁ + 7. n₁ n₂ n₁ ℕ. ℕ.means n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) This in turn that n₁ 2n₁, n₂ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.(2n₀ (n₁ n₁= n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as we'll required. Therefore, pick arbitrary Therefore, we'll pick arbitraryn₁, n₁,n₂ n₂ ℕ ℕwhere where f(n₁) f(n₁)==f(n₂), f(n₂),then thenprove provethat thatn₁ n₁==n₂. n₂.

41 Injective Functions Theorem: Let f : ℕ ℕ be defined 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 Whatdoes doesititmean meanfor forthe thefunction functionffto tobe be Since f(n₀) = f(n₁), we see that injective? injective? 2n₀ + 7 = 2n₁ + 7. n₁ n₂ n₁ ℕ. ℕ.means n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) This in turn that n₁ 2n₁, n₂ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.(2n₀ (n₁ n₁= n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as we'll required. Therefore, pick arbitrary Therefore, we'll pick arbitraryn₁, n₁,n₂ n₂ ℕ ℕwhere where f(n₁) f(n₁)==f(n₂), f(n₂),then thenprove provethat thatn₁ n₁==n₂. n₂.

42 Injective Functions Theorem: Let f : ℕ ℕ be defined 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 Whatdoes doesititmean meanfor forthe thefunction functionffto tobe be Since f(n₀) = f(n₁), we see that injective? injective? 2n₀ + 7 = 2n₁ + 7. n₁ n₂ n₁ ℕ. ℕ.means n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) This in turn that n₁ 2n₁, n₂ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.(2n₀ (n₁ n₁= n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as we'll required. Therefore, pick arbitrary Therefore, we'll pick arbitraryn₁, n₁,n₂ n₂ ℕ ℕwhere where f(n₁) f(n₁)==f(n₂), f(n₂),then thenprove provethat thatn₁ n₁==n₂. n₂.

43 Injective Functions Theorem: Let f : ℕ ℕ be defined 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 Whatdoes doesititmean meanfor forthe thefunction functionffto tobe be Since f(n₀) = f(n₁), we see that injective? injective? 2n₀ + 7 = 2n₁ + 7. n₁ n₂ n₁ ℕ. ℕ.means n₂ ℕ. ℕ.((f(n₁) f(n₁)==f(n₂) f(n₂) n₁ n₁==n₂ n₂)) This in turn that n₁ 2n₁, n₂ n₁ ℕ. ℕ. n₂ n₂ ℕ. ℕ.(2n₀ (n₁ n₁= n₂ f(n₁) f(n₁) f(n₂) f(n₂))) so n₀ = n₁, as we'll required. Therefore, pick arbitrary Therefore, we'll pick arbitraryn₁, n₁,n₂ n₂ ℕ ℕwhere where f(n₁) f(n₁)==f(n₂), f(n₂),then thenprove provethat thatn₁ n₁==n₂. n₂.

44 Injective Functions Theorem: Let f : ℕ ℕ be defined 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.

45 Injective Functions Theorem: Let f : ℕ ℕ be defined 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.

46 Injective Functions Theorem: Let f : ℕ ℕ be defined 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.

47 Injective Functions Theorem: Let f : ℕ ℕ be defined 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.

48 Injective Functions Theorem: Let f : ℕ ℕ be defined 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 defined 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.

50 Injective Functions Theorem: Let f : ℤ ℕ be defined 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.

51 Injective Functions Theorem: Let f : ℤ ℕ be defined 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 off this proof? How many of the following are correct ways of starting off 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.

52 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₁)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁4 f(x₀) f(x₀) f(x₁)) f(x₁)) f(1) =x₁ 1 =f(x₀) 1, f(x₁)) x₀ ℤ. (x₀ x₀ ℤ. ℤ. x₁ x₁f(x₁) ℤ.= (x₀ x₁ f(x₀) f(x₁)) x₀ ℤ. ℤ. (x₀ f(x₁))) x₀ ℤ. x₁ x₁ ℤ. (x₀ x₁ 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₁)) and Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

53 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁4 f(x₀) f(x₀) f(x₁)) f(x₁)) f(1) =x₁ 1 =f(x₀) 1, f(x₁)) x₀ ℤ. (x₀ x₀ ℤ. ℤ. x₁ x₁f(x₁) ℤ.= (x₀ x₁ f(x₀) f(x₁)) x₀ ℤ. ℤ. (x₀ f(x₁))) x₀ ℤ. x₁ x₁ ℤ. (x₀ x₁ 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₁)) and Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

54 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₀) f(x₁)) f(x₁)) x₀ x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁4 f(x₀) f(x₀) f(x₁)) f(x₁)) f(1) =x₁ 1 =f(x₀) 1, f(x₁)) x₀ ℤ. (x₀ x₀ ℤ. ℤ. x₁ x₁f(x₁) ℤ.= (x₀ x₁ f(x₀) f(x₁)) x₀ ℤ. ℤ. (x₀ f(x₁))) x₀ ℤ. x₁ x₁ ℤ. (x₀ x₁ 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₁)) and Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

55 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₀ f(x₀) f(x₁)) x₀ ℤ. ℤ. x₁ x₁ ℤ. ℤ.(x₀ (x₀ x₁ x₁ f(x₀) f(x₁)) 4 = f(1) 1, f(x₁)) x₀ ℤ. = x₁ f(x₀) x₀ ℤ. ℤ. x₁ x₁f(x₁) ℤ. (x₀ (x₀ x₁1 = f(x₀) f(x₁)) x₀ ℤ. f(x₁))) x₀ ℤ. ℤ. x₁ x₁ ℤ.(x₀ (x₀ x₁ 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₁)) and Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

56 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₂)) 4 = f(1) 1, f(x₁)) x₀ ℤ. = x₁ f(x₀) x₀ ℤ. ℤ. x₁ x₁f(x₁) ℤ. (x₀ (x₀ x₁1 = f(x₀) f(x₁)) x₀ ℤ. f(x₁))) x₀ ℤ. ℤ. x₁ x₁ ℤ.(x₀ (x₀ x₁ 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₁)) and Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

57 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₂)) 4 = f(1) 1, f(x₂)) x₁ ℤ. = x₂ f(x₁) x₁ ℤ. ℤ. x₂ x₂f(x₁) ℤ. (x₁ (x₁ x₂1 = f(x₁) f(x₂)) x₀ ℤ. f(x₁))) x₀ ℤ. ℤ. x₁ x₁ ℤ.(x₀ (x₀ x₁ 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₁)) and Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

58 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₂)) 4 = f(1) 1, f(x₂)) x₁ ℤ. = x₂ f(x₁) x₁ ℤ. ℤ. x₂ x₂f(x₁) ℤ. (x₁ (x₁ x₂1 = f(x₁) f(x₂)) x₁ ℤ. f(x₂))) x₁ ℤ. ℤ. x₂ x₂ ℤ.(x₁ (x₁ x₂ 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₁)) and Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

59 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₂)) 4 = f(1) 1, f(x₂)) x₁ ℤ. = x₂ f(x₁) x₁ ℤ. ℤ. x₂ x₂f(x₁) ℤ. (x₁ (x₁ x₂1 = f(x₁) f(x₂)) x₁ ℤ. f(x₂))) x₁ ℤ. ℤ. x₂ x₂ ℤ.(x₁ (x₁ x₂ 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₂)) and Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but Therefore, we need to find x₀, x₁ ℤ such that x₀ x₁, but f(x₀) = f(x₁). Can we do that? f(x₀) = f(x₁). Can we do that?

60 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₂)) 4 = f(1) 1, f(x₂)) x₁ ℤ. = x₂ f(x₁) x₁ ℤ. ℤ. x₂ x₂f(x₁) ℤ. (x₁ (x₁ x₂1 = f(x₁) f(x₂)) x₁ ℤ. f(x₂))) x₁ ℤ. ℤ. x₂ x₂ ℤ.(x₁ (x₁ x₂ 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₂)) and Therefore, we need to find x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we Therefore, we need to find x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we do that? do that?

61 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₂)) 4 = f(1) 1, f(x₂)) x₁ ℤ. = x₂ f(x₁) x₁ ℤ. ℤ. x₂ x₂f(x₁) ℤ. (x₁ (x₁ x₂1 = f(x₁) f(x₂)) x₁ ℤ. f(x₂))) x₁ ℤ. ℤ. x₂ x₂ ℤ.(x₁ (x₁ x₂ 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₂)) and Therefore, we need to find x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we Therefore, we need to find x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we do that? do that?

62 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₂)) 4 = f(1) 1, f(x₂)) x₁ ℤ. = x₂ f(x₁) x₁ ℤ. ℤ. x₂ x₂f(x₁) ℤ. (x₁ (x₁ x₂1 = f(x₁) f(x₂)) x₁ ℤ. f(x₂))) x₁ ℤ. ℤ. x₂ x₂ ℤ.(x₁ (x₁ x₂ 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₂)) and Therefore, we need to find x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we Therefore, we need to find x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we do that? do that?

63 Injective Functions Theorem: Let f : ℤ ℕ be defined as f(x) = x4. Then f is not injective. Proof: We will prove that there exist integers x₀ and x₁ such that x₀ but f(x₀) = f(x₁). What does it mean for fx₁, 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₂)) What is the negation of this statement? = f(-1) = (-1)4 = 1 What is the negation of f(x₀) this statement? x₁ x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₁) f(x₂)) f(x₂)) x₁ f(x₁) f(x₂)) x₁ ℤ. ℤ. x₂ x₂ ℤ. ℤ.(x₁ (x₁ x₂ x₂ f(x₁) f(x₂)) 4 = f(1) 1, f(x₂)) x₁ ℤ. = x₂ f(x₁) x₁ ℤ. ℤ. x₂ x₂f(x₁) ℤ. (x₁ (x₁ x₂1 = f(x₁) f(x₂)) x₁ ℤ. f(x₂))) x₁ ℤ. ℤ. x₂ x₂ ℤ.(x₁ (x₁ x₂ 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₂)) and Therefore, we need to find x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we Therefore, we need to find x₁, x₂ ℤ such that x₁ x₂, but f(x₁) = f(x₂). Can we do that? do that?

64 Injective Functions Theorem: Let f : ℤ ℕ be defined 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 defined 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 defined 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.

67 Injective Functions Theorem: Let f : ℤ ℕ be defined 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.

68 Injective Functions Theorem: Let f : ℤ ℕ be defined 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.

69 Injective Functions Theorem: Let f : ℤ ℕ be defined 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.

70 Injective Functions Theorem: Let f : ℤ ℕ be defined 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 off this proof? Howmany manyof ofthe thefollowing followingare arecorrect correctways waysof of starting off 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₂.

71 Injective Functions Theorem: Let f : ℤ ℕ be defined 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.

72 Injections and Composition

73 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 definitions of injectivity and function composition.

74 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.

75 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.

76 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.

77 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.

78 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 two that we use here: Since f isare injective and a₁ofof injectivity a₂, we see f(a₁) f(a₂). There are twodefinitions definitions injectivity thatthat wecan can use here: Then, since g is injective and f(a₁) f(a₂), we see that a₁ A. A. ((g f)(a₁) = g(f(a₁)) g(f(a₂)), required. a₁ A. a₂ a₂ A.as ((g f)(a₁) =(g (g f)(a₂) f)(a₂) a₁ a₁= = a₂) a₂) 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 llchoose choosean anarbitrary arbitrarya₁, a₁,a₂ a₂ AAwhere wherea₁ a₁ a₂, a₂, then thenprove provethat that(g (g f)(a₁) f)(a₁) (g (g f)(a₂). f)(a₂).

79 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 two that we use here: Since f isare injective and a₁ofof injectivity a₂, we see f(a₁) f(a₂). There are twodefinitions definitions injectivity thatthat wecan can use here: Then, since g is injective and f(a₁) f(a₂), we see that a₁ A. A. ((g f)(a₁) = g(f(a₁)) g(f(a₂)), required. a₁ A. a₂ a₂ A.as ((g f)(a₁) =(g (g f)(a₂) f)(a₂) a₁ a₁= = a₂) a₂) 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 llchoose choosean anarbitrary arbitrarya₁, a₁,a₂ a₂ AAwhere wherea₁ a₁ a₂, a₂, then thenprove provethat that(g (g f)(a₁) f)(a₁) (g (g f)(a₂). f)(a₂).

80 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 two that we use here: Since f isare injective and a₁ofof injectivity a₂, we see f(a₁) f(a₂). There are twodefinitions definitions injectivity thatthat wecan can use here: Then, since g is injective and f(a₁) f(a₂), we see that a₁ A. A. ((g f)(a₁) = g(f(a₁)) g(f(a₂)), required. a₁ A. a₂ a₂ A.as ((g f)(a₁) =(g (g f)(a₂) f)(a₂) a₁ a₁= = a₂) a₂) 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 llchoose choosean anarbitrary arbitrarya₁, a₁,a₂ a₂ AAwhere wherea₁ a₁ a₂, a₂, then thenprove provethat that(g (g f)(a₁) f)(a₁) (g (g f)(a₂). f)(a₂).

81 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.

82 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.

83 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 isis(g defined? g(f(a₁)) g(f(a₂)), How as required. How (g f)(x) f)(x) defined? (g (g f)(x) f)(x)==g(f(x)) g(f(x)) So Sowe weneed needto toprove provethat thatg(f(a₁)) g(f(a₁)) g(f(a₂)). g(f(a₂)).

84 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 isis(g defined? g(f(a₁)) g(f(a₂)), How as required. How (g f)(x) f)(x) defined? (g (g f)(x) f)(x)==g(f(x)) g(f(x)) So Sowe weneed needto toprove provethat thatg(f(a₁)) g(f(a₁)) g(f(a₂)). g(f(a₂)).

85 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 isis(g defined? g(f(a₁)) g(f(a₂)), How as required. How (g f)(x) f)(x) defined? (g (g f)(x) f)(x)==g(f(x)) g(f(x)) So Sowe weneed needto toprove provethat thatg(f(a₁)) g(f(a₁)) g(f(a₂)). g(f(a₂)).

86 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 isis(g defined? g(f(a₁)) g(f(a₂)), How as required. How (g f)(x) f)(x) defined? (g (g f)(x) f)(x)==g(f(x)) g(f(x)) So Sowe weneed needto toprove provethat thatg(f(a₁)) g(f(a₁)) g(f(a₂)). g(f(a₂)).

87 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

88 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

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. g(f(a₁)) f(a₁) a₁ a₂ g(f(a₂)) f(a₂) A B C

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. g(f(a₁)) f(a₁) a₁ a₂ g(f(a₂)) f(a₂) A B C

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. g(f(a₁)) f(a₁) a₁ a₂ Great Greatexercise: exercise:repeat Repeatthis this proof proofusing usingthe theother other g(f(a₂)) definition of injectivity. definition of injectivity. f(a₂) A B C

92 Another Class of Functions

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

94 Surjective Functions A function f : A B is called surjective (or onto) if this first-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 first rule of functions?

95 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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.

96 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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.

97 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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. does ititmean for f fto Let What xwhat = 2y. Then we see that does mean for tobe besurjective? surjective? f(x) =ℝ.f(2y) =ℝ. 2yf(x) / 2 ==y.y y x y ℝ. x ℝ. f(x) = y So f(x) = y, as required. Therefore, Therefore,we'll we'llchoose choosean anarbitrary arbitraryyy ℝ, ℝ,then then prove provethat thatthere thereisissome somexx ℝℝwhere wheref(x) f(x)==y. y.

98 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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. does ititmean for f fto Let What xwhat = 2y. Then we see that does mean for tobe besurjective? surjective? f(x) =ℝ.f(2y) =ℝ. 2yf(x) / 2 ==y.y y x y ℝ. x ℝ. f(x) = y So f(x) = y, as required. Therefore, Therefore,we'll we'llchoose choosean anarbitrary arbitraryyy ℝ, ℝ,then then prove provethat thatthere thereisissome somexx ℝℝwhere wheref(x) f(x)==y. y.

99 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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. does ititmean for f fto Let What xwhat = 2y. Then we see that does mean for tobe besurjective? surjective? f(x) =ℝ.f(2y) =ℝ. 2yf(x) / 2 ==y.y y x y ℝ. x ℝ. f(x) = y So f(x) = y, as required. Therefore, Therefore,we'll we'llchoose choosean anarbitrary arbitraryyy ℝ, ℝ,then then prove provethat thatthere thereisissome somexx ℝℝwhere wheref(x) f(x)==y. y.

100 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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. does ititmean for f fto Let What xwhat = 2y. Then we see that does mean for tobe besurjective? surjective? f(x) =ℝ.f(2y) =ℝ. 2yf(x) / 2 ==y.y y x y ℝ. x ℝ. f(x) = y So f(x) = y, as required. Therefore, Therefore,we'll we'llchoose choosean anarbitrary arbitraryyy ℝ, ℝ,then then prove provethat thatthere thereisissome somexx ℝℝwhere wheref(x) f(x)==y. y.

101 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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. does ititmean for f fto Let What xwhat = 2y. Then we see that does mean for tobe besurjective? surjective? f(x) =ℝ.f(2y) =ℝ. 2yf(x) / 2 ==y.y y x y ℝ. x ℝ. f(x) = y So f(x) = y, as required. Therefore, Therefore,we'll we'llchoose choosean anarbitrary arbitraryyy ℝ, ℝ,then then prove provethat thatthere thereisissome somexx ℝℝwhere wheref(x) f(x)==y. y.

102 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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. does ititmean for f fto Let What xwhat = 2y. Then we see that does mean for tobe besurjective? surjective? f(x) =ℝ.f(2y) =ℝ. 2yf(x) / 2 ==y.y y x y ℝ. x ℝ. f(x) = y So f(x) = y, as required. Therefore, Therefore,we'll we'llchoose choosean anarbitrary arbitraryyy ℝ, ℝ,then then prove provethat thatthere thereisissome somexx ℝℝwhere wheref(x) f(x)==y. y.

103 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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.

104 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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.

105 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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.

106 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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.

107 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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.

108 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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.

109 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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.

110 Surjective Functions Theorem: Let f : ℝ ℝ be defined 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 Composing Surjections

112 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.

113 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.

114 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.

115 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.

116 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. What Whatdoes doesititmean meanfor forgg f f: :AA CCto tobe besurjective? surjective? Consider any c C. Since g : B C is surjective, there is some b B such g(b) Similarly, c C. = A. f)(a) = 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 Therefore, we'll arbitrary prove means that there is some a Acsuch that Therefore, we'llchoose choose arbitrary c CCand and provethat thatthere there isissome someaa AAsuch suchthat that(g (g f)(a) f)(a)==c.c. g(f(a)) = g(b) = c, which is what we needed to show.

117 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. What Whatdoes doesititmean meanfor forgg f f: :AA CCto tobe besurjective? surjective? Consider any c C. Since g : B C is surjective, there is some b B such g(b) Similarly, c C. = A. f)(a) = 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 Therefore, we'll arbitrary prove means that there is some a Acsuch that Therefore, we'llchoose choose arbitrary c CCand and provethat thatthere there isissome someaa AAsuch suchthat that(g (g f)(a) f)(a)==c.c. g(f(a)) = g(b) = c, which is what we needed to show.

118 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. What Whatdoes doesititmean meanfor forgg f f: :AA CCto tobe besurjective? surjective? Consider any c C. Since g : B C is surjective, there is some b B such g(b) Similarly, c C. = A. f)(a) = 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 Therefore, we'll arbitrary prove means that there is some a Acsuch that Therefore, we'llchoose choose arbitrary c CCand and provethat thatthere there isissome someaa AAsuch suchthat that(g (g f)(a) f)(a)==c.c. g(f(a)) = g(b) = c, which is what we needed to show.

119 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.

120 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

121 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

122 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

123 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

124 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

125 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

126 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.

127 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?

128 Katniss Everdeen Elsa Hermione Granger

129 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.

130 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.

131 Inverse Functions

132 Katniss Everdeen Elsa Hermione Granger

133 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

134 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

135 Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 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

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

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

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

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

.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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Ramsey s Theorem on Graphs

Ramsey s Theorem on Graphs Ramsey s Theorem on Graphs 1 Introduction Exposition by William Gasarch Imagine that you have 6 people at a party. We assume that, for every pair of them, either THEY KNOW EACH OTHER or NEITHER OF THEM

More information

CPSC 121: Models of Computation PART 1 REVIEW OF TEXT READING

CPSC 121: Models of Computation PART 1 REVIEW OF TEXT READING CPSC 121: Models of Computation PART 1 REVIEW OF TEXT READING Unit 12: Functions These pages correspond to tet reading and are not covered in the lectures. Based on slides by Patrice Belleville and Steve

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

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM Name: Student ID: Signature: Section (circle one): George Steve Your signature acknowledges your understanding of and agreement

More information

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 9 Notes. Class URL:

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 9 Notes. Class URL: Notes slides from before lecture CSE 21, Winter 2017, Section A00 Lecture 9 Notes Class URL: http://vlsicad.ucsd.edu/courses/cse21-w17/ Notes slides from before lecture Notes February 8 (1) HW4 is due

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

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

Lecture 2 Finite Automata

Lecture 2 Finite Automata Lecture 2 Finite Automata August 31, 2007 This lecture is intended as a kind of road map to Chapter 1 of the text just the informal examples that I ll present to motivate the ideas. 1 Expressions without

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

function at the given point. Thus, for our previous example we would find that lim f(x) = 0

function at the given point. Thus, for our previous example we would find that lim f(x) = 0 Limits In order to introduce the notion of the it, we will consider the following situation. Suppose you are given a function, defined on some interval, except at a single point in the interval. What,

More information

13 th Annual Johns Hopkins Math Tournament Saturday, February 18, 2012 Explorations Unlimited Round Automata Theory

13 th Annual Johns Hopkins Math Tournament Saturday, February 18, 2012 Explorations Unlimited Round Automata Theory 13 th Annual Johns Hopkins Math Tournament Saturday, February 18, 2012 Explorations Unlimited Round Automata Theory 1. Introduction Automata theory is an investigation of the intersection of mathematics,

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

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

CS 395T Computational Learning Theory. Scribe: Wei Tang

CS 395T Computational Learning Theory. Scribe: Wei Tang CS 395T Computational Learning Theory Lecture 1: September 5th, 2007 Lecturer: Adam Klivans Scribe: Wei Tang 1.1 Introduction Many tasks from real application domain can be described as a process of learning.

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

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

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

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

γ(ɛ) (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

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS JOSHUA LENERS Abstract. An algorithm is function from ω to ω defined by a finite set of instructions to transform a given input x to the desired output

More information

5 Graphs

5 Graphs 5 Graphs jacques@ucsd.edu Some of the putnam problems are to do with graphs. They do not assume more than a basic familiarity with the definitions and terminology of graph theory. 5.1 Basic definitions

More information

CONNECTED SPACES AND HOW TO USE THEM

CONNECTED SPACES AND HOW TO USE THEM CONNECTED SPACES AND HOW TO USE THEM 1. How to prove X is connected Checking that a space X is NOT connected is typically easy: you just have to find two disjoint, non-empty subsets A and B in X, such

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

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

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics 400 lecture note #4 [Ch 6] Set Theory 1. Basic Concepts and Definitions 1) Basics Element: ; A is a set consisting of elements x which is in a/another set S such that P(x) is true. Empty set: notated {

More information

MC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points

MC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points MC 0 GRAPH THEORY 0// Solutions to HW # 0 points + XC points ) [CH] p.,..7. This problem introduces an important class of graphs called the hypercubes or k-cubes, Q, Q, Q, etc. I suggest that before you

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

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np Chapter 1: Introduction Introduction Purpose of the Theory of Computation: Develop formal mathematical models of computation that reflect real-world computers. Nowadays, the Theory of Computation can be

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

1 Matchings in Graphs

1 Matchings in Graphs Matchings in Graphs J J 2 J 3 J 4 J 5 J J J 6 8 7 C C 2 C 3 C 4 C 5 C C 7 C 8 6 J J 2 J 3 J 4 J 5 J J J 6 8 7 C C 2 C 3 C 4 C 5 C C 7 C 8 6 Definition Two edges are called independent if they are not adjacent

More information

4 Mathematical Data Types

4 Mathematical Data Types mcs 2015/5/18 1:43 page 81 #89 4 Mathematical Data Types We have assumed that you ve already been introduced to the concepts of sets, sequences, and functions, and we ve used them informally several times

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

CS126 Final Exam Review

CS126 Final Exam Review CS126 Final Exam Review Fall 2007 1 Asymptotic Analysis (Big-O) Definition. f(n) is O(g(n)) if there exists constants c, n 0 > 0 such that f(n) c g(n) n n 0 We have not formed any theorems dealing with

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

Notes on categories, the subspace topology and the product topology

Notes on categories, the subspace topology and the product topology Notes on categories, the subspace topology and the product topology John Terilla Fall 2014 Contents 1 Introduction 1 2 A little category theory 1 3 The subspace topology 3 3.1 First characterization of

More information

Z Notation. June 21, 2018

Z Notation. June 21, 2018 Z Notation June 21, 2018 1 Definitions There are many different ways to introduce an object in a Z specification: declarations, abbreviations, axiomatic definitions, and free types. Keep in mind that the

More information

Relations I. Margaret M. Fleck. 7 November 2008

Relations I. Margaret M. Fleck. 7 November 2008 Relations I Margaret M. Fleck 7 November 2008 This lecture covers relations and basic properties of relations, which is most of section 8.1 of Rosen. 1 Announcements Model solutions for the second midterm

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

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

6.1 Evaluate Roots and Rational Exponents

6.1 Evaluate Roots and Rational Exponents VOCABULARY:. Evaluate Roots and Rational Exponents Radical: We know radicals as square roots. But really, radicals can be used to express any root: 0 8, 8, Index: The index tells us exactly what type of

More information