0% found this document useful (0 votes)
27 views

Function Notes

1. A function f from a set X to a set Y is a rule that assigns each element x in X to a unique element y in Y. X is called the domain and Y is called the codomain. 2. A function f is one-to-one (injective) if every element in the domain X has a different image in Y. A function f is onto (surjective) if every element in the codomain Y has a preimage in X. 3. Examples show functions that are one-to-one but not onto, like f(x)=4x-1 from R to R, and functions that are neither one-to-one nor onto, like g(

Uploaded by

Ankit Poonia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Function Notes

1. A function f from a set X to a set Y is a rule that assigns each element x in X to a unique element y in Y. X is called the domain and Y is called the codomain. 2. A function f is one-to-one (injective) if every element in the domain X has a different image in Y. A function f is onto (surjective) if every element in the codomain Y has a preimage in X. 3. Examples show functions that are one-to-one but not onto, like f(x)=4x-1 from R to R, and functions that are neither one-to-one nor onto, like g(

Uploaded by

Ankit Poonia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

FUNCTION

Chapter 10

Functions

“One of the most important concepts in all of mathematics is that


of function.” (T.P. Dick and C.M. Patton)
Functions...finally a topic that most of you must be familiar with. How-
ever here, we will not study derivatives or integrals, but rather the notions of
one-to-one and onto (or injective and surjective), how to compose functions,
and when they are invertible.
Let us start with a formal definition.
Definition 63. 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. Formally, using predicate logic:
(∀x ∈ X, ∃y ∈ Y, y = f (x)) ∧ (∀x1 , x2 ∈ X, f (x1 ) 6= f (x2 ) → x1 6= x2 ).
Then X is called the domain of f , and Y is called the codomain of f . The
element y is the image of x under f , while x is the preimage of y under f .
Finally, we call range the subset of Y with preimages.
Example 96. Consider the assignment rule f : X = {a, b, c} → Y =
{1, 2, 3, 4} which is defined by: f = {(a, 2), (b, 4), (c, 2)}. We first check
that this is a function. For every element in X, we do have an assign-
ment: f (a) = 2, f (b) = 4, f (c) = 2. Then the condition that whenever
f (x1 ) 6= f (x2 ) it must be that x1 6= x2 is also satisfied. The the domain
of f is X, the codomain of f is Y . The preimage of 2 is {a, c} because
f (a) = f (c) = 2. For the range, we look at Y , and among 1, 2, 3, 4, only 2
and 4 have a preimage, therefore the range is {2, 4}.

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.

Definition 64. Let f be a function from X to Y , X, Y two sets, and consider


the subset S ⊂ X. The image of the subset S is the subset of Y that consists
of the images of the elements of S: f (S) = {f (s), s ∈ S}

We next move to our first important definition, that of one-to-one.

Definition 65. A function f is one-to-one or injective if and only if f (x) =


f (y) implies x = y for all x, y in the domain X of f . Formally:

∀x, y ∈ X(f (x) = f (y) → x = y).

In words, this says that all elements in the domain of f have different
images.

Example 98. Consider the function f : R → R, f (x) = 4x − 1. We want


to know whether each element of R has a different image. Yes, this is the
case, why? well, visually, this function is a line, so one may ”see” that two
distinct elements have distinct images, but let us try a proof of this. We have
to show that f (x) = f (y) implies x = y. Ok, let us take f (x) = f (y), that is
two images that are the same. Then f (x) = 4x − 1, f (y) = 4y − 1, and thus
we must have 4x − 1 = 4y − 1. But then 4x = 4y and it must be that x = y,
as we wanted. Therefore f is injective.

Example 99. Consider the function g : R → R, g(x) = x2 . Do we also have


that two distinct reals have distinct images? Well no... because 1 and −1
are both sent to 1...so this function is not injective! If g(x) = g(y) = 1, we
cannot conclude that x = y, in fact this is wrong, it could be that x = −y.

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

No, No, Yes,


b has no image c has two images each element of X has exactly
one image
235

Image of a Set
Let f be a functions from X to Y and SX. The image of S
is the subset of Y that consists of the images of the
elements of S: f(S) = {f(s)sS}

f:XY

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:AB is one-to-one  x1, x2A (f(x1)=f(x2)  x1 = x2 )
or
f:AB is one-to-one   x1, x2A (x1 x2  f(x1)f(x2))
236 CHAPTER 10. FUNCTIONS

Example: One-to-One (Injective)

A B A B
a 1 a 1
b 2 b 2
c 3 c 3
4 4

one-to-one not one-to-one


(all elements in A have a (a and b have the same image)
different image)

Example: One-To-One (Injective)


f: R  R, f(x) = 4x1 g: R  R, g(x) = x2
(“Does each element in R have a different image ?”)
f(x) g(x)

  4
x1
x
x2
x
2 2
Yes ! 
No !
To show:x1, x2  R (f(x1)=f(x2)  x1= x2)
Take x1 = 2 and x2 = 2.
Take some x1, x2  R with f(x1) = f(x2).
Then g(x1) = 22 = 4 = g(x2)
Then 4x11 = 4x21  4x1 = 4x2  x1=x2
and x1 x2
237

Definition 66. A function f is onto or surjective if and only if for every


element y ∈ Y , there is an element x ∈ X with f (x) = y:
∀y ∈ Y, ∃x ∈ X, f (x) = y.
In words, each element in the co-domain of f has a pre-image.
Example 100. Consider again the function f : R → R, f (x) = 4x − 1. We
want to know whether each element of R has a preimage. Yes, it has, let us
see why: we want to show that there exists x such that f (x) = 4x − 1 = y.
Given y, we have the relation x = (y + 1)/4 thus this x is indeed sent to y
by f .
Example 101. Consider again the function g : R → R, g(x) = x2 . Does
each element in R have a preimage? well, again no... Because R contains all
the negative real numbers, and it is not possible to square a real number and
get something negative... Formally, if y = −1, there is no x ∈ R such that
g(x) = x2 = −1.
We next combine the definitions of one-to-one and onto, to get:
Definition 67. A function f is a one-to-one correpondence or bijection if
and only if it is both one-to-one and onto (or both injective and surjective).
An important example of bijection is the identity function.
Definition 68. The identity function iA on the set A is defined by:
iA : A → A, iA (x) = x.
Example 102. Consider the function f : R → R, f (x) = 4x − 1, which we
have just studied in two examples. We know it is both injective (see Example
98) and surjective (see Example 100), therefore it is a bijection.
Bijections have a special feature: they are invertible, formally:
Definition 69. Let f : A → B be a bijection. Then the inverse function
of f , f −1 : B → B is defined elementwise by: f −1 (b) is the unique element
a ∈ A such that f (a) = b. We say that f is invertible.
Note the importance of the hypothesis: f must be a bijection, otherwise
the inverse function is not well defined. For example, if f is not one-to-one,
then f −1 (b) will have more than one value, and thus is not properly defined.
Note that given a bijection f : A → B and its inverse f −1 : B → A, we
can write formally the above definition as:
∀b ∈ B, ∀a ∈ A(f −1 (b) = a ⇐⇒ b = f (a)).
238 CHAPTER 10. FUNCTIONS

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:XY is onto  y x, f(x) = y

Example: Onto (Surjective)

X Y
X Y
a 1
a 1
b 2
b 2
c 3
c 3
d
d

onto not onto

(all elements in Y have a (1 has no pre-image)


pre-image)
239

Example: Onto (Surjective)


g:RR, g(x)=x2
g(x)
(“Does each element in R have a pre-image ?”)
No ! R0
To show: yR such that xR g(x)  y
x
Take y = 1
1
Then any xR holds g(x) = x2  1 = y

But g:RR0, g(x)=x2 ,(where R0 denotes the set of non-negative


real numbers) is onto !

One-to-one Correspondence

A function f is a one-to-one correspondence (or


bijection), if and only if it is both one-to-one and onto

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:AA, 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.

Suppose that you have two functions f and g. It may be possible to


compose them to obtain a third function, here is how:
Definition 70. Let f : A → B be a function, and g : B → C be a function.
Then the composition of f and g is a new function denoted by g ◦ f , and
defined by: g ◦ f : A → C, (g ◦ f )(a) = g(f (a)).
Note that the codomain of f is B, which is the domain of g. Under this
condition, the composition g ◦ f consists of applying first f , and then apply
g on the result. Therefore, g ◦ f 6= f ◦ g in general!
242 CHAPTER 10. FUNCTIONS

Inverse Function
Let f:AB be a one-to-one correspondence (bijection).
Then the inverse function of f, f1:BA, is defined by:
f1(b) = that unique element aA such that f(a)=b.
We say that f is invertible.

A B
f(a)=b
b
a f1(b)=a
f1

Example 1
Find the inverse function of the following function:
f f1
A B A B
a 1 a 1
b 2 b 2
c 3 c 3
d 4 d 4

Let f:AB be a one-to-one correspondence and f1:BA


its inverse. Then bB aA (f1(b)=a  b=f(a))
243

Example 2
What is the inverse of f:RR, What is the inverse of g:RR,
f(x)=4x1? g(x)=x2 ? g(x)
f(x)

y
x x
x=f-1(y)

Let yR. Calculate x with f(x)=y:


y = 4x1  (y+1)/4 = x
Hence, f1(y) = (y+1)/4

One-to-one Correspondence
Theorem 1: If f:XY is a one-to-one correspondence,
then f1:YX is a one-to-one correspondence. f
X Y
f(y1) y1
Proof: x
(a) f1 is one-to-one: f(y2) y2
Take y1,y2 Y such that f1(y1) =f1(y2)=x.
f
Then f(x) = y1 and f(x) = y2, thus y1 = y2.
f
X Y
f1
(b) To show is onto: f(x)
x
Take some xX, and let y = f(x).
Then f1(y) = x. f(y) y

f
244 CHAPTER 10. FUNCTIONS

Composition of Functions
Let f:AB and g:BC 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

f(a) g(f(a)) = (g°f)(a)


a

Examples
Example :Given functions s:XY and t:YZ. 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

Example f:ZZ, f(n)=2n+3, g:ZZ, g(n)=3n+2. What is g ° f and f ° g?


(f ° g)(n) = f(g(n)) = f(3n + 2) = 2(3n+2) + 3 = 6n + 7
(g ° f)(n) = g(f(n)) = g(2n + 3) = 3(2n+3) + 2 = 6n + 11
f ° g  g ° f (no commutativity for the composition of functions !)
245

Example 104. Consider f : Z → Z and g : Z → Z defined by f (n) = 2n+3,


g(n) = 3n + 2. We have

(f ◦ g)(n) = f (g(n)) = f (3n + 2) = 2(3n + 2) + 3 = 6n + 7,

while

(g ◦ f )(n) = g(f (n)) = g(2n + 3) = 3(2n + 3) + 2 = 6n + 11.

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!

Proposition 2. Let f : X → Y and g : Y → Z be two injective functions.


Then g ◦ f is also injective.

Proof. What we need to do is check the injectivity of a function, so we do


this as usual: we check that g ◦ f (x1 ) = g ◦ f (x2 ) implies x1 = x2 . Typically,
to be able to prove this, you will have to keep in mind assumptions, namely
that both f and g are injective. So let us start. We have g ◦ f (x1 ) = g ◦ f (x2 )
or equivalently g(f (x1 )) = g(f (x2 )). But we know that g is injective, so this
implies f (x1 ) = f (x2 ). Next we use that f is injective, thus x1 = x2 , as
needed!
Let us ask the same question with surjectivity, namely whether the com-
position of two surjective functions gives a function which is surjective too.
Here is the answer:

Proposition 3. Let f : X → Y and g : Y → Z be two surjective functions.


Then g ◦ f is also surjective.

Proof. The codomain of g ◦ f is Z, therefore we need to show that every


z ∈ Z has a preimage x, namely that there always exists an x such that
g ◦ f (x) = z. Again, we keep in mind that f and g are both surjective.
Since g is surjective, we know there exists y ∈ Y such that g(y) = z. Now
again, since f is surjective, we know there exists x ∈ X such that f (x) = y.
Therefore there exist x, y such that z = g(y) = g(f (x)) as needed.
246 CHAPTER 10. FUNCTIONS

One-to-one Propagation
Theorem 2: Let f:XY and g:YZ be both one-to-one functions.
Then g ° f is also one-to-one.

Proof: to show: x1, x2  X ((g ° f )(x1) = (g ° f )(x2)  x1 = x2)


Suppose x1, x2  X with (g ° f )(x1) = (g ° f )(x2).
Then g (f (x1))=g(f (x2)).
Since g is one-to-one, it follows f (x1) = f (x2).
Since f is one-to-one, it follows x1 = x2.

Onto Propagation
Theorem 3: Let f:XY and g:YZ be both onto functions.
Then g ° f is also onto.

Proof: to show: zZ xX such that (g ° f )(x) = z


Let zZ.
Since g is onto yY with g(y)=z.
Since f is onto xX with f(x)=y.
Hence, with (g ° f )(x) = g(f (x)) = g(y) = z.

You might also like