Chap. 5 Relations and Functions. Cartesian Product For sets A, B the Cartesian product, or cross product, of A and B is denoted by A ╳ B and equals {(a,

Slides:



Advertisements
Similar presentations
Chapter 5 Relations and Functions
Advertisements

Functions Section 2.3 of Rosen Fall 2008
Discrete Structures Chapter 5 Relations and Functions Nurul Amelina Nasharuddin Multimedia Department.
Lecture 3 Set Operations & Set Functions. Recap Set: unordered collection of objects Equal sets have the same elements Subset: elements in A are also.
CSE115/ENGR160 Discrete Mathematics 02/16/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/21/12
Functions f( ) = A B Lecture 15: Nov 4.
1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
Functions, Sequences, and Sums
Discrete Structures Functions Dr. Muhammad Humayoun Assistant Professor COMSATS Institute of Computer Science, Lahore.
Section 1.8: Functions A function is a mapping from one set to another that satisfies certain properties. We will first introduce the notion of a mapping.
Sets Set Operations Functions. 1. Sets 1.1 Introduction and Notation 1.2 Cardinality 1.3 Power Set 1.4 Cartesian Products.
2.1 Sets 2.2 Set Operations 2.3 Functions ‒Functions ‒ Injections, Surjections and Bijections ‒ Inverse Functions ‒Composition 2.4 Sequences and Summations.
FUNCTION Discrete Mathematics Asst. Prof. Dr. Choopan Rattanapoka.
Functions. Copyright © Peter Cappello2 Definition Let D and C be nonempty sets. A function f from D to C, for each element d  D, assigns exactly 1 element.
1 Relations and Functions Chapter 5 1 to many 1 to 1 many to many.
ICS 253: Discrete Structures I
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFunctions.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
1 Annoucement n Skills you need: (1) (In Thinking) You think and move by Logic Definitions Mathematical properties (Basic algebra etc.) (2) (In Exploration)
FUNCTIONS.
Counting CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Functions Section 2.3 of Rosen Spring 2012 CSCE 235 Introduction to Discrete Structures Course web-page: cse.unl.edu/~cse235 Questions: Use Piazza.
MSU/CSE 260 Fall Functions Read Section 1.8.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,
Functions1 Elementary Discrete Mathematics Jim Skon.
Chapter 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs BY: MISS FARAH ADIBAH ADNAN IMK.
321 Section, Week 3 Natalie Linnell. Functions A function from A to B is an assignment of exactly one element of B to each element of A. We write f(a)
1.4 Sets Definition 1. A set is a group of objects . The objects in a set are called the elements, or members, of the set. Example 2 The set of positive.
Example Prove that: “IF 3n + 2 is odd, then n is odd” Proof by Contradiction: -p = 3n + 2 is odd, q = n is odd. -Assume that ~(p  q) is true OR -(p 
Chapter 9 Functions Let A and B be nonempty sets. A function f from A to B, written f: A  B is a relation from A to B with the property that every element.
Basic Structures: Functions Muhammad Arief download dari
Chapter 5 – Relations and Functions. 5.1Cartesian Products and Relations Definition 5.1: For sets A, B  U, the Cartesian product, or cross product, of.
Agenda Week 10 Lecture coverage: –Functions –Types of Function –Composite function –Inverse of a function.
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
 R  A×B,R is a relation from A to B , DomR  A 。  (a,b)  R (a, c)  R  (a,b)  R (a, c)  R unless b=c  function  DomR=A , (everywhere)function.
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
Basic Structures: Sets, Functions, Sequences, and Sums.
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 5 Relations and Functions.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
UNIT - 2.  A binary operation on a set combines two elements of the set to produce another element of the set. a*b  G,  a, b  G e.g. +, -, ,  are.
CSC102 - Discrete Structures Functions
CSci 2011 Discrete Mathematics Lecture 9, 10
Functions (Mappings). Definitions A function (or mapping)  from a set A to a set B is a rule that assigns to each element a of A exactly one element.
1 Functions CS 202 Epp section ??? Aaron Bloomfield.
FUNCTIONS COSC-1321 Discrete Structures 1. Function. Definition Let X and Y be sets. A function f from X to Y is a relation from X to Y with the property.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
Functions CSRU1400 Spring 2008Ellen Zhang 1 CISC1400, Fall 2010 Ellen Zhang.
 2. Inverse functions  Inverse relation,  Function is a relation  Is the function’s inverse relation a function? No  Example: A={1,2,3},B={a,b}, f:A→B,
1 Lecture 5 Functions. 2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit.
Section 2.3. Section Summary  Definition of a Function. o Domain, Cdomain o Image, Preimage  One-to-one (Injection), onto (Surjection), Bijection 
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
FUNCTIONS.
Discrete Mathematics Lecture # 17 Function. Relations and Functions  A function F from a set X to a set Y is a relation from X to Y that satisfies the.
Prepared By Meri Dedania (AITS) Discrete Mathematics by Meri Dedania Assistant Professor MCA department Atmiya Institute of Technology & Science Yogidham.
Discrete Mathematics Functions
Functions.
Chapter 2 Sets and Functions.
Functions.
Functions Section 2.3.
Functions.
CSE15 Discrete Mathematics 02/27/17
Functions CS 202 Epp section 7.1.
Functions.
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Functions Section 2.3.
Presentation transcript:

Chap. 5 Relations and Functions

Cartesian Product For sets A, B the Cartesian product, or cross product, of A and B is denoted by A ╳ B and equals {(a, b)|a ∈ A, b ∈ B}. e.g. Let A={2, 3, 5}, B={5, 6}. Then, a) A ╳ B={(2,5), (2,6), (3,5), (3,6), (5,5), (5,6)}. b) B ╳ A={(5,2), (5,3), (5,5), (6,2), (6,3), (6,5)}. c) B 2 =B ╳ B= d) B 3 =B ╳ B ╳ B={(a,b,c)|a,b,c ∈ B}; for instance, (5,5,6) ∈ B 3. {(5,5), (5,6), (6,5), (6,6)}.

Binary Relation For sets A, B, any subset of A ╳ B is called a (binary) relation from A to B. Any subset of A ╳ A is called a (binary) relation on A. e.g. Let A={2, 3, 5}, B={5, 6}. Which one of the following is a relation from A to B? a) ∅. b) {(3,5), (3,6), (5,6)}. c) {(2,5), (2,6), (6,5)}. d) A ╳ B. O O O X

Number of Relations e.g. Let A={2, 3, 5}, B={5, 6}. How many relations are from A to B? The number of relations from A to B is |A ╳ B|

Number of Relations (2)

Theorem 5.1 For any sets A, B, C ⊆ U, A ╳ (B∩C)=(A ╳ B)∩(A ╳ C) pf. 1. It suffices to show for all a, b ∈ U, (a,b) ∈ A ╳ (B∩C) ⇔ (a,b) ∈ (A ╳ B)∩(A ╳ C) 2. (a,b) ∈ A ╳ (B∩C) ⇔ a ∈ A and b ∈ B∩C ⇔ a ∈ A, b ∈ B and a ∈ A, b ∈ C ⇔ (a,b) ∈ A ╳ B and (a,b) ∈ A ╳ C ⇔ (a,b) ∈ (A ╳ B)∩(A ╳ C)

Theorem 5.1 (2) For any sets A, B, C ⊆ U, a)A ╳ (B∩C)=(A ╳ B)∩(A ╳ C) b)A ╳ (B ⋃ C)=(A ╳ B) ⋃ (A ╳ C) c)(A∩B) ╳ C=(A ╳ C)∩(B ╳ C) d)(A ⋃ B) ╳ C=(A ╳ C) ⋃ (B ╳ C)

Function For nonempty sets A, B, a function, or mapping, f from A to B, denoted f: A→B, is a relation from A to B in which every element of A appears exactly once as the first component of an ordered pair in the relation. e.g. Let A={2, 3, 5}, B={5, 6}. Which of the following is a function from A to B? a) {(2,5), (3,6), (5,5)}. b) {(2,5), (2,6), (3,5), (5,5), (5,6)}. c) {(2,6), (3,5)}. O X X

Domain and Range For the function f: A→B, A is called the domain of f and B the codomain of f. The subset of B consisting of those elements that appear as second components in the ordered pairs of f is called the range of f and is also denoted by f(A) because it is the set of images (of the elements of A) under f. DomainCodomain Range

Domain and Range e.g. Let A={2, 3, 5}, B={5, 6, 7}. f={(2,5), (3,6), (5,5)}. Then, the domian of f is {2, 3, 5}, the codomain of f is {5, 6, 7}, and the range of f is {5, 6}.

Number of Functions e.g. Let A={2, 3, 5}, B={5, 6}. How many functions are from A to B? sol. The number of functions from A to B is

Number of Functions (2)

One-to-One Function A function f: A→B is called one-to-one, or injective, if each element of B appears at most once as the image of an element of A. e.g. Let A={2, 3, 5}, B={5, 6, 7, 8}. Which of the following is a one-to-one function from A to B? a) {(2,5), (3,6), (5,7)}. b) {(2,5), (3,6), (5,6)}. O X

Example 5.13 Given the function f: R→R where f(x)=3x+7 for all x ∈ R. Show that the given function f is one-to-one. sol. 1. It suffices to show f(x 1 )=f(x 2 ) ⇒ x 1 =x 2 for all x 1, x 2 ∈ R. 2. f(x 1 )=f(x 2 ) ⇒ 3x 1 +7= 3x 2 +7 ⇒ x1=x2⇒ x1=x2

Number of One-to-One Functions e.g. Let A={2, 3, 5}, B={5, 6, 7, 8}. How many one-to-one functions are from A to B? sol. The number of one-to-one functions from A to B is 4 ╳3╳2.

Number of One-to-One Functions

The Image of a Subdomain If f: A→B and A 1 ⊆ A, then f(A 1 )={b ∈ B|b=f(a) for some a ∈ A 1 }, and f(A 1 ) is called the image of A 1 under f. e.g. For A={1, 2, 3, 4, 5} and B={w, x, y, z}, let f: A→B be given by f={(1, w), (2, x), (3, x), (4, y), (5, y)}. Then for A 1 ={1, 2}, A 2 ={2, 3, 4, 5}, what are f(A 1 ) and f(A 2 )? f(A 1 )={f(a)|a ∈ A 1 }= f(A 2 )={f(a)|a ∈ A 2 }= {x, y}. {w, x};

Theorem 5.2 Let f: A→B, with A 1, A 2 ⊆ A. Then f(A 1 ∩A 2 ) ⊆ f(A 1 )∩f(A 2 ) pf. 1. It suffices to show for all b ∈ B, b∈f(A1∩A2) ⇒ b∈f(A1)∩f(A2)b∈f(A1∩A2) ⇒ b∈f(A1)∩f(A2) 2. b ∈ f(A 1 ∩A 2 ) ⇒ b=f(a) for some a ∈ A 1 ∩A 2 ⇒ b=f(a) for some a ∈ A 1 and b=f(a) for some a ∈ A 2 ⇒ b ∈ f(A 1 ) and b ∈ f(A 2 ) ⇒ b∈f(A1)∩f(A2)⇒ b∈f(A1)∩f(A2)

Remark Let f: A→B, with A 1, A 2 ⊆ A. Then f(A1∩A2)⊇f(A1)∩f(A2)f(A1∩A2)⊇f(A1)∩f(A2) pf. 1. It suffices to show for all b ∈ B, b∈f(A1∩A2) ⇐ b∈f(A1)∩f(A2)b∈f(A1∩A2) ⇐ b∈f(A1)∩f(A2) 2. b ∈ f(A 1 ∩A 2 ) ⇐ b=f(a) for some a ∈ A 1 ∩A 2 ⇐ b=f(a) for some a ∈ A 1 and b=f(a) for some a ∈ A 2 ⇐ b ∈ f(A 1 ) and b ∈ f(A 2 ) ⇐ b∈f(A1)∩f(A2)⇐ b∈f(A1)∩f(A2) X ? ? ? ? x y A1A1 A2A2

Remark Let f: A→B, with A 1, A 2 ⊆ A. Then f(A 1 ∩A 2 ) ⊇ f(A 1 )∩f(A 2 ) x y A1A1 A2A2 f(A 1 ∩A 2 ) = {x}. f(A 1 )∩f(A 2 ) = {x, y}.

Remark Let f: A→B, with A 1, A 2 ⊆ A. Then, when does f(A 1 ∩A 2 ) ⊇ f(A 1 )∩f(A 2 ) hold? pf. 1. It suffices to show for all b ∈ B, b∈f(A1∩A2) ⇐ b∈f(A1)∩f(A2)b∈f(A1∩A2) ⇐ b∈f(A1)∩f(A2) 2. b ∈ f(A 1 ∩A 2 ) ⇐ b=f(a) for some a ∈ A 1 ∩A 2 ⇐ b=f(a) for some a ∈ A 1 and b=f(a) for some a ∈ A 2 ⇐ b ∈ f(A 1 ) and b ∈ f(A 2 ) ⇐ b∈f(A1)∩f(A2)⇐ b∈f(A1)∩f(A2) if f is one-to-one X x y A1A1 A2A2

Theorem 5.1 (2) Let f: A→B, with A 1, A 2 ⊆ A. Then a) f(A 1 ∪ A 2 ) = f(A 1 ) ∪ f(A 2 ) b) f(A 1 ∩A 2 ) ⊆ f(A 1 )∩f(A 2 ) c) f(A 1 ∩A 2 ) = f(A 1 )∩f(A 2 ) when f is one-to-one

Onto Function A function f: A→B is called onto, or surjective, if f (A)=B—that is, if for all b ∈ B there is at least one a ∈ A with f(a)=b. e.g. Which of the following is a onto function? (a) f 1 : A→B defined by f 1 ={(1,z), (2,y), (3,x), (4,y)}, where A={1, 2, 3, 4} and B={x, y, z}. (b) f 2 : R→R defined by f(x)=x 3. (c) f 3 : Z→Z defined by f(x)= 3x+1. O X O

Number of Onto Functions e.g. Let A={w, x, y, z}, B={1, 2, 3}. How many onto functions are from A to B? 1. Number of functions from A to B is 2. Number of functions from A to {1, 2} is 3. Number of functions from A to {1} is 4. Then, we have number of onto functions from A to B is ·2 4 -3· The functions from A to {1} is also counted in the number of functions from A to {1, 2} and in the number of functions from A to {1, 3}

Number of Onto Functions · · =36. no 1no 2 no 3 U: A  {1, 2, 3} no 1: A  {2, 3} no 2: A  {1, 3} no 3: A  {1, 2} no 1,2: A  {3} no 1,3: A  {2} no 2,3: A  {1} no 1,2,3: A  { } The number of onto functions from A to B is |U|-|no 1  no 2  no 3| = |U|-(|no 1|+|no 2|+|no 3|-(|no 1,2|+|no 1,3|+|no 2,3|)+|no 1,2,3|) = C(3,2)C(3,1) C(n,n-1) Let |A|=m, |B|=n.1· C(3,3) C(3,0) C(n,n) C(n,n-2) C(n,n-3) n n-1 n-2 n-3 4 m

Number of Onto Functions

Example 5.26 How many ways are there to distribute four distinct objects into three distinguishable containers, with no container empty? 36 because the number of ways to distribute four distinct objects into three distinguishable containers, with no container empty is equal to the number of onto functions from A={w, x, y, z} to B={1, 2, 3}.

Example 5.26 (2) How many ways to distribute four distinct objects into three identical containers, with no container empty? The following distributions become identical. 1) {a, b} 1 {c} 2 {d} 3 2) {a, b} 1 {d} 2 {c} 3 3) {c} 1 {a, b} 2 {d} 3 4) {c} 1 {d} 2 {a, b} 3 5) {d} 1 {a, b} 2 {c} 3 6) {d} 1 {c} 2 {a, b} 3, Therefore, the number of ways is 36/3!.

Stirling Number of the Second Kind

╳ 3= ╳ 4=1701 ⇒ S(m+1,n)=S(m,n−1)+nS(m, n).

Theorem 5.3 Let m, n be positive integers with 1<n≤m. Then S(m+1,n)=S(m,n−1)+nS(m, n). 1.The number of distributions to place a 1, a 2, …, a m+1 in n identical containers with none left empty (N 1 ) is equal to the number of distributions to place a 1, a 2, …, a m+1 in n identical containers with none left empty in which a m+1 is in a container by itself (N 2 ) plus the number of distributions to place a 1, a 2, …, a m+1 in n identical containers with none left empty in which a m+1 is not in a container by itself (N 3 ) n times the number of distributions to place a 1, a 2, …, a m in n identical containers with none left empty N1=N1=N2=N2=S(m,n−1).S(m+1,n). N3=N3= =nS(m,n). N 1 =N 2 +N 3.

Unary and Binary Operations For any nonempty sets A, B, any function f: A ╳ A→B is called a binary operation on A. A function g: A→A is called a unary, or monary, operation on A. e.g. (a) The function h: R+→R+ defined by h(a)=1/a is a unary operation on R+. (b) The function f: Z ╳ Z→Z defined by f(a, b)=a−b is a binary operation on R.

Closed Binary Operation If B ⊆ A, then the binary operation is said to be closed (on A). (When B ⊆ A we may also say that A is closed under f.) e.g. Which of the following binary operation is closed? (a) f: Z ╳ Z→Z, defined by f(a, b)=a−b. (b) g: Z + ╳ Z + →Z, defined by g(a, b)=a−b. O X

Commutative Binary Operation Let f : A ╳ A→B. Then f is said to be commutative if f(a, b)=f(b, a) for all (a, b) ∈ A ╳ A. e.g. Which of the following binary operation is commutative? (a) Let U be a universe, and let A, B ⊆ U. f: P ( U ) ╳ P ( U )→ P ( U ) defined by f(A, B)=A ∪ B. (b) f: Z ╳ Z→Z, defined by f(a, b)=a−b. O X Why are they not U?

Number of Closed Binary Operations Let A = {a, b, c, d}. The number of closed binary operations is # of f(a,a) # of f(a,b) # of f(a,c) # of f(a,d) # of f(b,a) # of f(b,b) # of f(b,c) # of f(b,d) # of f(c,a) # of f(c,b) # of f(c,c) # of f(c,d) # of f(d,a) # of f(d,b) # of f(d,c) # of f(d,d) (a,a) (a,b) (a,c) (a,d) (b,a) (b,b) (b,c) (b,d) (c,a) (c,b) (c,c) (c,d) (d,a) (d,b) (d,c) (d,d) a b c d

Number of Commutative Closed Binary Operations Let A= {a, b, c, d}. The number of commutative closed binary operations is

Identity Let f: A ╳ A→B be a binary operation on A. An element x ∈ A is called an identity (or identity element) for f if f(a, x)=f(x, a)=a, for all a ∈ A. e.g. For the (closed) binary operation f : Z ╳ Z→Z, where f(a, b)=a+b, what is an identity? why? 0 f(a, 0)=a+0=a=0+a=f(0, a).

Number of Closed Binary Operations with Identities If A={x, a, b, c, d}, how many closed binary operations on A have x as the identity? Ans:

Number of Commutative Closed Binary Operations with Identities If A={x, a, b, c, d}, how many commutative closed binary operations on A have x as the identity? Ans:

THEOREM 5.4 Let f: A ╳ A→B be a binary operation. If f has an identity, then that identity is unique. pf. 1. It suffices to show x 1, x 2 ∈ A are identities of f ⇒ x 1 =x Because x 1 is identity of f, f(x 1, x 2 )=x Because x 2 is identity of f, f(x 1, x 2 )=x This implies x 1 =x 2.

The Pigeonhole Principle If m pigeons occupy n pigeonholes and m>n, then at least one pigeonhole has two or more pigeons roosting in it. e.g. An office employs 13 file clerks, so at least two of them must have birthdays during the same month.

Example 5.43 Prove that if 101 integers are selected from the set S ={1, 2, 3,..., 200}, then there are two integers such that one divides the other. pf. 1. For each x ∈ S, we may write x=2 k y, with k ≥ 0, and gcd(2,y)=1. 2. y ∈ T={1, 3, 5,..., 199}, where |T|= By the pigeonhole principle there are two distinct integers of the form a=2 m y, b=2 n y for some (the same) y ∈ T. 4. a and b are the desired two integers.

Example 5.44 Any subset of size 6 from the set S {1, 2, 3,..., 9} must contain two elements whose sum is 10. pf. 1. Here the pigeons constitute a six-element subset of {1, 2, 3,..., 9}, and the pigeonholes are the subsets {1, 9}, {2, 8}, {3, 7}, {4, 6}, {5}. 2. When the six pigeons go to their respective pigeonholes, they must fill at least one of the two-element subsets whose members sum to 10.

One-to-One Correspondence If f : A→B, then f is said to be bijective, or to be a one-to-one correspondence, if f is both one-to-one and onto. e.g. Let A={1, 2, 3, 4} and B={w, x, y, z}. Which of the following function is a one-to- one correspondence? (a) f={(1, w), (2, x), (3, y), (4, z)}. (b) f={(w, 1), (x, 2), (y, 3), (z, 4)}. (c) f={(1, w), (2, x), (3, y), (4, y)}. (d) f={(1, w), (2, x), (3, y), (3, z)}. O X O X

Identity Function The function I A : A→A, defined by I A (a)=a for all a ∈ A, is called the identity function for A. If f, g: A→B, we say that f and g are equal and write f=g, if f(a)=g(a) for all a ∈ A.

Composite Function If f : A→B and g: B →C, we define the composite function, which is denoted g ◦ f: A→C, by (g ◦ f )(a)=g(f(a)), for each a ∈ A. e.g. Let A={1, 2, 3, 4}, B={a, b, c}, and C={w, x, y, z} with f : A→B and g: B →C given by f={(1, a), (2, a), (3, b), (4, c)} and g={(a, x), (b, y), (c, z)}. Then, (g ◦ f)(1)= (g ◦ f)(2)= (g ◦ f)(3)= (g ◦ f)(4)= So, g ◦ f= {(1, x), (2, x), (3, y), (4, z)}. g(f(1))=g(a)=x. g(f(2))=g(a)=x. g(f(3))=g(b)=y. g(f(4))=g(c)=z.

THEOREM 5.5 Let f: A→B and g: B →C. If f and g are one- to-one, then g ◦ f is one-to-one. pf. 1. It suffices to show (g ◦ f)(a 1 )=(g ◦ f)(a 2 ) for a 1, a 2 ∈ A ⇒ a 1 =a (g ◦ f)(a 1 )=(g ◦ f)(a 2 ) ⇒ g(f(a 1 ))= g(f(a 2 )) ⇒ f(a 1 ))= f(a 2 ) ⇒ a 1 =a 2 because g is one-to-one. because f is one-to-one.

THEOREM 5.5 (2) Let f: A→B and g: B →C. If f and g are onto, then g ◦ f is onto. pf. 1. It suffices to show z ∈ C ⇒ there exists x ∈ A such that g(f(x))=z. 2. z ∈ C ⇒ there exists y ∈ B such that g(y)=z ⇒ there exists x ∈ A such that f(x)=y ⇒ there exists x ∈ A such that g(f(x))=z. because g is onto. because f is onto.

THEOREM 5.6 Let f: A→B, g: B →C, and h: C →D, then (h ◦ g) ◦ f = h ◦ (g ◦ f). pf. 1. Since the two functions have the same domain,, and codomain,, it suffices to show ((h ◦ g) ◦ f)(x) = (h ◦ (g ◦ f))(x) for every x ∈ A. AD

THEOREM (g ◦ f)(x)=g(f(x)). 3. (h ◦ (g ◦ f))(x) = h(g(f(x))). 4. Similarly, ((h ◦ g) ◦ f)(x) = h(g(f(x))).

Converse of Relation For sets A, B, if R is a relation from A to B, then the converse of R, denoted R c, is the relation from B to A defined by R c ={(b, a)|(a, b) ∈ R }. e.g. With A={1, 2, 3, 4}, B={w, x, y}, and R ={(1,w), (2,w), (3,x)}. Then, Rc=Rc= {(w, 1), (w, 2), (x, 3)}.

Invertible Function If f: A→B, then f is said to be invertible if there is a function g: B→A such that g ◦ f=I A and f ◦ g=I B. e.g. Let f: R→R be defined by f(x)=2x+5. Find the invertible function of f. Let g: R→R be the invertible function of f. Then, g(f(x))=I A (x)=x. ⇒ g(2x+5)=x. ⇒ g(2x+5)=((2x+5)-5)/2. ⇒ g(x)=(x-5)/2.

THEOREM 5.7 If a function f: A→B is invertible and a function g: B→A satisfies g ◦ f=I A and f ◦ g=I B, then this function g is unique. pf. 1. Let h: B→A be another function with h ◦ f=I A and f ◦ h=I B. It suffices to show h=g.h=g. 2. h=h ◦ I B =h◦(f◦g)=h◦(f◦g) =(h ◦ f ) ◦ g =I A ◦ g=g.

THEOREM 5.8 A function f: A→B is invertible if and only if it is one-to-one and onto.

THEOREM 5.8 (Proof of only if part) f is invertible ⇒ f is one-to-one and onto (f: A→B). pf. 1. Let g be the invertible function of f. To show f is one-to-one, it suffices to show a 1, a 2 ∈ A with f(a 1 )=f(a 2 ) ⇒ a 1 =a f(a 1 )=f(a 2 ) ⇒ g(f(a 1 ))=g(f(a 2 )) ⇒ a1=a2⇒ a1=a2 3. To show f is onto, it suffices to show for any b ∈ B, b=f(a) for some a ∈ A. 4. g(b) ∈ A and f(g(b))=b because f ◦ g=I B. 5. Therefore, g(b) is the desired a. because g ◦ f=I A.

THEOREM 5.8 (Proof of if part) f is invertible ⇐ f is one-to-one and onto (f: A→B). pf. 1. It suffices to show there is a function g: B→A such that g ◦ f= and f ◦ g=. 2. Since f is onto, for each b ∈ B there is an a ∈ A with f(a)=b. 3. Define the function g: B→A by g(b)=a. 4. g is unique because f is one-to-one. 5. Clearly, g(f(a))=g(b)=a, implying g ◦ f=I A. 6. And, f(g(b))=f(a)=b, implying f ◦ g=I B. IAIA IBIB

THEOREM 5.9 If f: A→B, g: B →C are invertible functions, then g ◦ f: A→C is invertible and (g ◦ f) −1 = f −1 ◦ g −1. pf. 1. f and g each are one-to-one and onto by Theorem g ◦ f is one-to-one and onto by 3. g ◦ f is invertible by 4. Suppose that f(a)=b and g(b)=c, where a ∈ A, b ∈ B, and c ∈ C. 5. Clearly, (g ◦ f) −1 (c)=a=f -1 (b)=f -1 (g -1 (c)), implying (g ◦ f) −1 = f −1 ◦ g −1. Theorem 5.5. Theorem 5.8.

Preimage If f: A→B and B 1 ⊆ B, then f −1 (B 1 )={x ∈ A|f (x) ∈ B 1 }. The set f −1 (B 1 ) is called the preimage of B 1 under f. e.g. Let A={1, 2, 3, 4, 5, 6} and B={6, 7, 8, 9, 10}. If f: A→B with f={(1, 7), (2, 7), (3, 8), (4, 6), (5, 9), (6, 9)}, then for B 1 ={6, 8} ⊆ B, f −1 (B 1 )= {3, 4}. Remark: Here, f is not necessary to be invertible.

Example 5.63 What is f -1 [-5,-5]?

Example 5.63 Sol: f -1 [-5,-5]=[-4/3,10/3].

Theorem 5.10 Proof of (b): 1. It suffices to show for a ∈ A, a ∈ f -1 (B 1 ⋃B 2 ) ⇔ a ∈ f -1 (B 1 ) ⋃ f -1 (B 2 ). 2. a ∈ f -1 (B 1 ⋃ B 2 ) ⇔ f(a) ∈ B 1 ⋃ B 2 ⇔ f(a) ∈ B 1 or f(a) ∈ B 2 ⇔ a ∈ f -1 (B 1 ) or a ∈ f -1 (B 2 ) ⇔ a ∈ f -1 (B 1 ) ⋃ f -1 (B 2 ).

Theorem By Theorem 5.8, (a) and (b) ⇔ (c). It suffices to show 2. (Proof of (a) ⇒ (b)). If f is one-to-one, |A|=. Then =|B|, implying f is onto. 3. (Proof of (b) ⇒ (a)). If f is onto, =|B|. Then =|A|, implying f is one-to-one. (a) ⇔ (b). |f(A)|