Function Notes
Function Notes
Chapter 10
Functions
231
232 CHAPTER 10. FUNCTIONS
Function
Let X and Y be sets. A function f from X to Y is a rule
that assigns every element x of X to a unique y in Y.
We write f: X Y and f(x) = y
(∀𝑥 ∈ 𝑋 ∃𝑦 ∈ 𝑌, 𝑦 = 𝑓(𝑥)) ∧(∀𝑥1 , 𝑥2 ∈ 𝑋, 𝑓 𝑥1 ≠ 𝑓(𝑥2 ) → 𝑥1 ≠ 𝑥2 )
X = domain, Y = codomain
y = image of x under f,
x = preimage of y under f
range = subset of Y with preimages
Example 1
(∀𝑥 ∈ 𝑋 ∃𝑦 ∈ 𝑌, 𝑦 = 𝑓(𝑥)) ∧(∀𝑥1 , 𝑥2 ∈ 𝑋, 𝑓 𝑥1 ≠ 𝑓(𝑥2 ) → 𝑥1 ≠ 𝑥2 )
Arrow Diagram of f:
Domain X={a,b,c},
Co-domainY={1,2,3,4} X Y
f={(a,2),(b,4),(c,2)},
a• •1
preimage of 2 is{a,c} b• •2
Range={2,4} c• •3
•4
233
Example 97. The rule f that assigns the square of an integer to this integer
is a function. Indeed, every integer has an image: its square. Also whenever
two squares are different, it must be that their square roots were different.
We write
f : Z → Z, f (x) = x2 .
Its domain is Z, its codomain is Z as well, but its range is {0, 1, 4, 9, 16, . . .},
that is the set of squares in Z.
In words, this says that all elements in the domain of f have different
images.
The other definition that always comes in pair with that of one-to-one/injective
is that of onto.
234 CHAPTER 10. FUNCTIONS
Example 2
Let f be the function from Z to Z Z
that assigns the square of an Z
integer to this integer. •4
•3
Then, f: Z Z, f(x) = x2
•2
2 •1
1 •0
0 • 1
Domain and co-domain of f: Z 1
2
Range(f) = {0, 1, 4, 9, 16, 25, ….}
Functions Vs Non-functions
(∀𝑥 ∈ 𝑋 ∃𝑦 ∈ 𝑌, 𝑦 = 𝑓(𝑥)) ∧(∀𝑥1 , 𝑥2 ∈ 𝑋, 𝑓 𝑥1 ≠ 𝑓(𝑥2 ) → 𝑥1 ≠ 𝑥2 )
X = {a,b,c} to Y = {1,2,3,4}
f g h
1 1 1
a a a
2 2 2
b b b
3 3 3
c c c
4 4 4
Image of a Set
Let f be a functions from X to Y and SX. The image of S
is the subset of Y that consists of the images of the
elements of S: f(S) = {f(s)sS}
f:XY
s
S f(s)
f(S)
X Y
One-To-One Function
A function f is one-to-one (or injective), if and only if
f(x) = f (y) implies x = y for all x and y in the domain of f.
In words:
“All elements in the domain of f have different images”
Mathematical Description:
f:AB is one-to-one x1, x2A (f(x1)=f(x2) x1 = x2 )
or
f:AB is one-to-one x1, x2A (x1 x2 f(x1)f(x2))
236 CHAPTER 10. FUNCTIONS
A B A B
a 1 a 1
b 2 b 2
c 3 c 3
4 4
Onto Functions
A function f from X to Y is onto (or surjective), if and only if
for every element y∈Y there is an element x∈X with f(x)=y.
In words:
“Each element in the co-domain of f has a pre-image”
Mathematical Description:
f:XY is onto y x, f(x) = y
X Y
X Y
a 1
a 1
b 2
b 2
c 3
c 3
d
d
One-to-one Correspondence
In words:
“No element in the co-domain of f has two (or more) pre-
images” (one-to-one) and
“Each element in the co-domain of f has a pre-image” (onto)
240 CHAPTER 10. FUNCTIONS
Example: Bijection
a 1 a 1 a 1 a 1 a 1
b 2 b 2 b 2 b 2 b 2
c 3 c 3 c 3 c 3 c 3
4 d d 4 d 4 4
No No Yes No No
(not onto, 2 (not one-to- (each element (neither one- (not a function,
has no pre- one, 1 has has exactly one to-one nor a has two
image) two pre- pre-image) onto) images)
images)
Identity Function
The identity function on a set A is defined as:
iA:AA, iA(x) = x.
Example. Any identity function is a bijection.
e.g. for A = {a, c, e}:
A A
a• •a
c • •c
e• •e
241
Example 103. Let us look again at our two previous examples, namely,
f (x) = 4x − 1 and g(x) = x2 . Then g(x), for g : R → R is not a bijection,
so it cannot have an inverse. Now f (x) is a bijection, so we can compute its
inverse. Suppose that y = f (x), then
y+1
y = 4x − 1 ⇐⇒ y + 1 = 4x ⇐⇒ x = ,
4
y+1
and f −1 (y) = 4
.
We saw that for the notion of inverse f −1 to be defined, we need f to be
a bijection. The next result shows that f −1 is a bijection as well.
Proposition 1. If f : X → Y is a one-to-one correspondence, then f −1 :
Y → X is a one-to-one correspondence.
Proof. To prove this, we just apply the definition of bijection, namely, we
need to show that f −1 is an injection, and a surjection. Let us start with
injection.
• f −1 is an injection: we have to prove that if f −1 (y1 ) = f −1 (y2 ), then
y1 = y2 . All right, then f −1 (y1 ) = f −1 (y2 ) = x for some x in X.
But f −1 (y1 ) = x means that y1 = f (x), and f −1 (y2 ) = x means that
y2 = f (x), by definition of the inverse of function. But this shows that
y1 = y2 , as needed.
• f −1 is an surjection: by definition, we need to prove that any x ∈ X
has a preimage, that is, there exists y such that f −1 (y) = x. Because f
is a bijection, there is some y such that y = f (x), therefore x = f −1 (y)
as needed.
Inverse Function
Let f:AB be a one-to-one correspondence (bijection).
Then the inverse function of f, f1:BA, is defined by:
f1(b) = that unique element aA such that f(a)=b.
We say that f is invertible.
A B
f(a)=b
b
a f1(b)=a
f1
Example 1
Find the inverse function of the following function:
f f1
A B A B
a 1 a 1
b 2 b 2
c 3 c 3
d 4 d 4
Example 2
What is the inverse of f:RR, What is the inverse of g:RR,
f(x)=4x1? g(x)=x2 ? g(x)
f(x)
y
x x
x=f-1(y)
One-to-one Correspondence
Theorem 1: If f:XY is a one-to-one correspondence,
then f1:YX is a one-to-one correspondence. f
X Y
f(y1) y1
Proof: x
(a) f1 is one-to-one: f(y2) y2
Take y1,y2 Y such that f1(y1) =f1(y2)=x.
f
Then f(x) = y1 and f(x) = y2, thus y1 = y2.
f
X Y
f1
(b) To show is onto: f(x)
x
Take some xX, and let y = f(x).
Then f1(y) = x. f(y) y
f
244 CHAPTER 10. FUNCTIONS
Composition of Functions
Let f:AB and g:BC be functions. The composition
of the functions f and g, denoted as g ° f, is defined by:
g ° f: A C, (g ° f)(a) = g(f(a))
g°f
g
f
A B C
Examples
Example :Given functions s:XY and t:YZ. Find t ° s and s ° t.
s t
X Y Y Z X t °s Z
a 1 1 m a m
b 2 2 n b n
c 3 3 p c p
4 4 q q
5 5
while
Suppose now that you compose two functions f, g, and both of them turn
out to be injective. The next result tells us that the combination will be as
well!
One-to-one Propagation
Theorem 2: Let f:XY and g:YZ be both one-to-one functions.
Then g ° f is also one-to-one.
Onto Propagation
Theorem 3: Let f:XY and g:YZ be both onto functions.
Then g ° f is also onto.