Sei sulla pagina 1di 30

Lecture #1 Sets and Functions

1 Outline
1. Sets
- Subsets
- The Power Set
- Set Operations
2. Functions
- One-to-one/onto functions
- Isomorphism
- Higher-order functions
3. Countable and Uncountable Sets (Advanced Topic)

2 Sets
2.1 Introduction

 Sets are used to group objects which have similar properties together.
(George Cantor : a Russian German Mathematician 1895)

Example 2.1 The set V of all vowels in the English alphabet

= f a, e, i, o ,u g

Example 2.2 The set O of odd positive integers less than 10

O = f 1, 3, 5, 7, 9 g

De nition 2.1 Set Terminology


The objects in a set are also called the elements, or members, of the set.

De nition 2.2 Set Equivalence


Two sets are equal if and only if (i ) they have the same elements.

Example 2.3 Set Equivalence

The sets f1, 3, 5g, f1, 3, 5g are equal.

We denote this by f1, 3, 5g = f1, 3, 5g.

 What do we mean by the same elements ?


De nition 2.3 Same Elements
1. a 2 A i a is an element of set A, where a is an element and A is a set.
2. Thus, A and B have the same elements i ( a 2 A i a 2 B ).
2

Example 2.4 Same Elements


1) The following are true.
1 2 f1, 3, 5g
3 2 f1, 3, 5g
5 2 f1, 3, 5g
2) The following are true.

f1, 3, 5g = f5, 3, 1g
f1, 3, 5g = f1, 1, 3, 3, 5, 5, 5g

2.2 Some Notations

 N stands for the set of natural numbers f0,1,2,3,...g.


 Z stands for the set of integers f...,-2,-1,0,1,2,...g.
 R stands for the set of real numbers. An example of R is f 0.15, 0.2879465,
0.123456..., 6.895 g.
 Z+ stands for the set of positive integers, ie. f 1, 2, 3, ... g.
 Set Builder : a way to describe a set
S = f x j x has a certain property g
Example 2.5 The set of all even positive intergers less than 20
E = f x j x is an even positive integer less than 20 g

 Misc.
; or f g

empty set or null set: a special set that has no element

2.3 Paradoxes

 Paradox means self-contradiction. It also means logical inconsistency.


 Some formal (mathematical) systems have paradoxes.
 Indeed, Cantor's set theory has a paradox.
 Sets may themselves be members of sets. Eg., the set of all sets of integers
has sets as its members.

 Most sets are not members of themselves.

Eg., the set of cats is not a

member of itself because the set of cats is not a cat.

 However, there may be sets that do belong to themselves. Eg., the set of
all sets.

 A paradox of Cantor's set theory was found by Bertrand Russell (1872 1970). It's called Russell's paradox.

T = f A j A is a set and A 62 A g

Suppose that 2 is allowed to test set membership between two sets.

 In other words, T is the set of all sets that are not members of themselves.
Is T 2 T ?
a) If T 2 T, then due to the condition A 62 A for being in the set T, it must
be that T 62 T. Thus, the inconsistency arises.
b) If T

62 T, then it follows from the condition for being in the set T that

T 2 T. Thus, the inconsistency arises.

 Clearly, it follows from the de nition of T that T 2 T i T 62 T.


4

2.4 Venn Diagram

 A graphical illustration for sets and the relationship between them (John
Venn: an English Mathematician 1881)

 The Universal set U contains all objects under consideration. A rectangle


represents U.

 Circles or other geometric gures inside the rectangle represent sets. Also,
points represent particular elements in a set.
|> Figure 1

2.5 Subset and Proper Subset


De nition 2.4 Subset
The set A is a subset of the set B i every element of A is also an element
of B. We denote the subset by A  B.
|> Figure 2

De nition 2.5 Alternative De nition of Subset


A  B i 8X ( X 2 A ! X 2 B )
Note:

8 means universal quanti cation (forall, every) and ! stands for the

implication.

Example 2.6 Subset


1) The set of all subjects in IT is a subset of the set of all subjects in
Computer Science.
5

2) f1,2,3g  f1,2,3,4,5g

3) ;  S where S is a set. Why ?????

De nition 2.6 Proper Subset

The set A is a proper subset of the set B, denoted by A  B, if A  B but


A 6= B.

It follows that if A  B and B  A, then A = B.

2.6 Cardinality
De nition 2.7 Cardinality
1. If there are exactly n distinct elements in a set S where n is a nonnegative integer, then S is a nite set and n is the cardinality of S.
2. jSj stands for the cardinality of set S.

Example 2.7 Cardinality

1) Suppose set E = f2,4,6,8g. Then, jEj = 4.

2) Let S be the set of all letters in the English alphabet. Then jSj = 26.
3) j fY, O, N, G, Y, U, T, Hg j = 7
4) j;j = 0 Why ?????
5) jf;gj = 1.

De nition 2.8 In nite Set


A set is in nite if it is not nite.

2.7 Tuples (Ordered Sets)

 An ordered set is a set where its elements are ordered.

We denote such

an ordered set by (a1,a2,...,an).

 An ordered set is also called a tuple, or a list.


De nition 2.9 Tuple
1. A nite ordered set of n elements is called an n-tuple or a nite sequence.
2. A 2-tuple is called a pair.
3. A 3-tuple is called a triple.
4. A 4-tuple is called a quadruple.

Example 2.8 Tuple


1) A triple (1,2,3) is di erent from a triple (3,2,1).
2) A 7-tuple: (Monday, Tuesday, Wednesday, Thrusday, Friday, Saturday,
Sunday)
3) An in nite sequence: (1,2,3,4,...)

De nition 2.10 Tuples Equivalence


1. Two n-tuples (x1,...,xn) and (y1,...,yn) are equal i xi = yi for 1  i  n.
2. We denote this equality between tuples by (x1,...,xn) = (y1,...,yn)

Example 2.9 Tuples Equivalence


1) (1,2) 6= (2,1)

2) (1,3,5) 6= (1, 1, 3, 3, 5, 5, 5)

2.8 The Power Set

 The power set can be used to build a new set which contains all combinations of elements of a set.

De nition 2.11 Power Set


1. The power set of a set S is the set of all subsets of the set S.
2. Both P(S) and 2S denote the power set of S.
3. Formally, P(S) = 2S = f X j X  S g.

Example 2.10 Power Set

1) P(f0,1g) = f ;, f0g, f1g, f0,1g g

2) P(f0,1,2g) = f ;, f0g, f1g, f2g, f0,1g, f0,2g, f1,2g, f0,1,2g g

3) P(;) = f ; g

Why ????

;  ; due to de nition of .
4) P(f;g) = f ;, f;g g Why ????
Ans:

It follows that if jSj = n where S is a set, then j P(S) j = 2n.

2.9 Cartesian Products

 The Cartesian Product is to build the set of all

ordered tuples of some

particular sets. (Rene Descartes : a French Mathematician 16?? )

De nition 2.12 Cartesian Product of Two Sets

1. The Cartesian Product of a set A and a set B, denoted by A  B, is the


set of all ordered pairs (a,b) where a 2 A and b 2 B.
2. A  B = f (a,b) j a 2 A and b 2 B g
8

Example 2.11 Cartesian Product

1) f1,2g  fa,b,cg = f(1,a), (1,b), (1,c), (2,a), (2,b), (2,c) g


2) fa,b,cg  f1,2g = f(a,1), (a,2), (b,1), (b,2), (c,1), (c,2) g

De nition 2.13 Generalised Cartesian Products

1. The Cartesian Product of the sets A1,A2,...,An, denoted by A1A2...An,


is the set of ordered n-tuples (a1,a2,...,an) where ai belongs to Ai for i =
1,2,...,n.

2. A1  A2...An = f(a1,a2,...,an) j ai

2 Ai for i = 1,2,...,n g

2.10 Set Operations


2.10.1 Union

De nition 2.14 Union

The Union of sets A and B, denoted by A [ B, is the set that contains those
elements that are either in A or in B, or in both.
A [ B = f x j x 2 A or x 2 B g
|> Figure 3 (page 47)

Example 2.12 Union

f1, 3, 9g [ f2, 4, 9g = f 1, 2, 3, 4, 9 g
2.10.2 Intersection

De nition 2.15 Intersection

The intersection of sets A and B, denoted by A \ B, is the set that contains


those elements in both A and B.

A \ B = f x j x 2 A and x 2 B g
|> Figure 4 (page 47)

Example 2.13 Intersection

f1, 3, 9g \ f2, 4, 9g = f 9 g
De nition 2.16 Disjoint
Two sets are disjoint if their intersection is the empty set.

Example 2.14 Disjoint

f1, 3g and f2, 4g are disjoint.


2.10.3 Di erence

De nition 2.17 Di erence


The di erence of set A and set B, denoted by A - B, is the set containing
those elements that are in A but not in B.
A - B = f x j x 2 A and x 62 B g
|> Figure 5 (page 49)

Example 2.15 Di erence

f1, 3, 9g - f2, 4, 9g = f1, 3g


10

2.10.4 Complement

De nition 2.18 Complement

The Complement of a set A, denoted by A, is the complement of A with


respect to (wrt.) the universal set U.

A=U-A
A = f x j x 2 U and x 62 A g
|> Figure 6 (page 49)

 The di erence of set A and set B is also called the complement of B wrt.
A.

Example 2.16 Complement

1) Suppose V0 = fag. Thus, V 0 wrt. the set of all vowels in English is

fe, i, o, ug.

2) Suppose A is a set of natural numbers greater than 7. Thus,


is f0, 1, 2, 3, 4, 5, 6, 7g.

A wrt. N

2.10.5 Properties of Set Operations (Algebraic Properties)

|> Table 1 (Page 50) Emphasize on generalisation with Logic.

Proposition 2.1

A\B = A [ B

Proof.

A \ B = f x j x 62 A \ B g (by defn of complement)


= f x j :(x 2 (A \ B)) g
= f x j :(x 2 A and x 2 B) g (by defn of \ using \and")
11

= f x j x 62 A or x 62 B g (by De Morgan's laws)


= f x j x 2 A or x 2 B

=fxjx2A[B

 Membership table:

g (by defn of [ using \or")

QED.

a table which shows membership of sets, and mem-

bership of sets obtained by applying particular operations on the sets.

 Membership tables can be used to show the equivalence between sets.


The following membership shows that A \ (B [ C) = (A \ B) [ (A \ C).
|> Table 2 (Page52)

Note that 1 means that an element is in a set, and 0 means that an element
is not in a set.

 if two sets have the same membership for every possibility, then the two
sets are equal.
2.10.6 Generalised Unions and Intersections

De nition 2.19 Generalised Union

Sn A

i=1

A1

[ A2 [ ... [ An

De nition 2.20 Generalised Intersection

Tn A

i=1

A1

\ A2 \ ... \ An

Example 2.17 Generalised Union and Intersection

1) Suppose Ai = f i g. Eg. A1 = f1g, A2 = f2g,...,An = fng.


Sn A = f1,2,...,ng
i
i=1
12

2) Suppose Bi = f x j x is a natural number and x  i g.


Tn B = fn, n+1, n+2,...g
i
i=1
Can you see this ??? Why is it the case ???? Discuss ????

3 Functions
3.1 Introduction

 A function is an assignment of (or a mapping from) an element in a set


to another element in another set.
|> Figure 7 (page 59)

De nition 3.1 Function


A function f from set A to set B is an assignment of exactly one element of
B to each element of A.

De nition 3.2 Some notations of Function


1. We write f(a) = b to mean that b is the only one element of B assigned
by the function f to the element a of A.

2. We write f : A ! B to stand for a function from set A to set B.

 Given that f : A ! B, we may call A as a set of inputs to function f , and


B as a set of outputs to f .
 Suppose that f(a) = b, b is an output of f given input a.
De nition 3.3 Some terminologies for Functions
13

1. Set A is the domain of a function f, denoted by dom(f), and a set B is


the codomain, denoted by codomain(f), of f if f is a function from A to B.
2. An element b is the image of an element a, and a is a pre-image of b if

f(a) = b.
3. The range of f is the set of all images of elements of A.
4. f maps A to B if f is a function from A to B.

 What is the di erence between codomain and range ???? (Discuss ???)
Example 3.1 Function
1) Suppose that f(a) = 0 and f(a) = 1. Then f is not a function.

Why ??

2) Suppose G be the function that assigns a grade to a student in a discrete

math class (in gure 8). The domain of G is fAdams, Chou, Goodfriend,
Rodriguez, Stevensg, and the codomain of G is fA,B,C,D,Fg. The range of
G is fA,B,C,Fg.
3) Suppose f: Z

! Z. In particular, f(x) = x2.

The domain of f is the set

of all integers and so does the codomain. The range of f is nonnegative

integers, ie. f0, 1, 4, 9, .... g. 4 is the image of the pre-image 2.

3.2 Partial and Total Functions

 A partial function from a set A to a set B is a function that does not


produce output for every input.

 In other words, for some input a, a partial function produces no output.


 A total function from A to B is a function that generates output for every
input.
14

De nition 3.4 Partial and Total Functions


1. A partial function f from A to B is an assignment of exactly one element
in B to each element in a subset of A. Thus, dom(f)  A.
2. A total function f from A to B is a function where dom(f) = A.
Example 3.2 Partial Function

 is a partial function of the type N  N ! N since it is not de ned for


all pairs of the form (X,0) for any X in the domain of consideration.

 Any partial function f can be transformed into a total function by the


following techniques.
1) Shrinking the domain

For example,  is a total function of N  (N - f0g) ! N.

2) Increasing the codomain


For example,  is a total function of N  N ! N [ f#g, where # is

a special symbol which is not in N, and X  0 = # for any X in N.

3.3 One-to-one and Onto Functions


De nition 3.5 One-to-one
1. A function f is one-to-one i ( X 6= Y ! f(X) 6= f(Y) ), for all X and Y
in the domain of f.
2. A function f is called a injection if it is one-to-one.
|> Figure 9 (page 62)
15

Example 3.3 One-to-one


1) The identity function (id) f(X) = X is one-to-one. Why ?????
2) The function f(X) = X2 where f : Z ! Z is not one-to-one because f(1)
= 1 while f(-1) = 1.
3) The function f(X) = X + 1 where f : N

! N is one-to-one function.

Why ???????
4) The function f(X,Y) = X + Y where f : Z

 Z ! Z is not one-to-one

function. Why ???????


Ans: 0 + 0 = 0 and -1 + 1 = 0

 Note that the identity function is a total function.


De nition 3.6 Strictly Increasing and Decreasing
1. A function f whose domain and codomain of f are subsets of R is called
strictly increasing if ( f(X) < f(Y)
X < Y ) where X , Y are in the
domain of f.
2. Function f is called strictly decreasing if ( f(X) > f(Y) X < Y ) where
X , Y are in the domain of f.

 It follows that if a function is either strictly increasing or strictly decreasing, then it must be one-to-one.

Why ???

Ans: Either of them preserves the ordering of input domains. Thus, two
di erent elements which are ordered are mapped to two di erent elements
which are ordered.
16

De nition 3.7 Onto


1. A function f from A to B is onto, or surjective, i for every element b 2
B, there is an element a 2 A such that f(a) = b.

2. A function f is called a surjection if it is onto.

 The onto function is a function where its range is equal to its codomain.
|> Figure 10 (page 63)

Example 3.4 Onto


1) The identity function f(X) = X is onto. Why ?????
2) The function f(X) = X2 where f : Z ! Z is not onto because there is no

integer X which is mapped to -1 (no X such that X2 = -1).

3) The function f(X) = X + 1 where f : N ! N is not onto function. Why


???????
Ans: There is no element which is mapped to 0.
4) The function f(X) = X + 1 where f : Z

! Z is onto function.

Why

???????

De nition 3.8 Bijection


The function f is a one-to-one correspondence, or a bijection, if it is both

one-to-one and onto.


|> Figure 11 (page 64)

17

Example 3.5 Bijection


1) The identity function is a bijection.

2) The function f(X) = X + 1 where f : Z ! Z is a bijection.

3.4 Inverse Functions


De nition 3.9 Inverse Function
Suppose that f : A ! B is a bijection, the inverse of a function f is function

g : B ! A such that
For any y in B , f (g(y )) = y, and
For any x in A, g(f (x )) = x
|> Figure 13 (page 65)

Example 3.6 Inverse Function


1) Suppose that f(X) = X + 1, and de ne g as g(X ) = X - 1. Thus, it is
not hard to see that g is an inverse of f .

 Note that if a function f is not a bijection, then there is no inverse function


of f. Why ?????
Ans:
1) If

is not one-to-one, then it maps two di erent elements to a single

element and thus, any such

g is not a function (since it maps one element

to two elements).
18

2) If f is not onto, any g will be partial, that is some element in the codomain
has no corresponding element in the domain. Thus, the following does not
hold.

f (g(B)) = B
De nition 3.10 Invertible
1. A one-to-one correpondence is called invertible since we can de ne an
inverse of this function.
2. A function is not invertible if it is not one-to-one correspondence.

3.5 Isomorphism
De nition 3.11 Isomorphism
A function f is an isomorphism if it has an inverse.
Example 3.7 Isomorphism
Imagine some pairing of men and women at a dance. If the pairing is exact,
then a function f : Men ! Women which maps a man to his partner has an
inverse which maps the partner to the man. Thus, f is an isomorphism.

 It follows that a function is an isomorphism i it is a bijection.


3.6 Higher-Order Functions
De nition 3.12 Higher-Order Function
A function is called a higher-order function if its arguments (inputs) and
values (outputs) are allowed to be functions.
19

De nition 3.13 Compositions of Functions


The composition of functions f and g, denoted by f g, where f : B
and g : A ! B is de ned by
(f g)(a) = f(g(a))
where a is any element in A.

!C

|> Figure 12 (page 66)

Example 3.8 Compositions of Functions


1) Suppose f : Z ! Z and g : Z ! Z such that f(X) = X + 1 and g(Y) =
2  Y.
Thus, (f g)(1) = 3 but (g f)(1) = 4.
De nition 3.14 Tuples of Functions : another way to combine functions
An n-tuple of functions (f1,f2,...,fn) where fi : A ! Bi is de ned such that
(f1,f2,...,fn)(a) = (f1(a),f2(a),...fn(a))

where the function (f1,f2,...,fn) is of type A ! B1

 B2  ...  Bn.

Example 3.9 Tuples of Functions


1) From Example 3.8, (f,g)(2) = (f(2),g(2)) = (3,4).
2) Suppose h(X) = f(X) + g(X).
Thus, h(X) = +(f(X),g(X))

(From In x to Pre x Notation)

= +( (f,g)(X) )

(By defn of Tuple of Func.)

= (+ (f,g))(X)

(By defn of Composition)

 The composition and tupling are examples of higher-order functions.


20

Example 3.10 Higher-Order Function


1) Suppose g : A ! B and f : B ! C. Thus, the composition in f g is
a function which takes functions f and g as arguments and then implicitly
yields another function as a result.

The composition in f g is of type (A ! B)  (B ! C) ! (A ! C)


2) If we de ne T(f,g) = (f,g), then T is a higher-order function which is of

type (A ! B)  (B ! C) ! (A ! B  C).

 The following higher-order functions are very useful and are employed
most of functional programming languages.
3.6.1 The Map Function (Apply to All)

 Applying a function to a tuple of data individually.


De nition 3.15 Map Function
The map function takes a function f : A ! B, and returns as a result the
function (a1,a2,...,an) ! (b1,b2,...,bn) where n,m  0 and ai
for 0  i  n, and it is de ned as

map(f)(a1,a2,...,an) = (f(a1),f(a2),...,f(an)).

Example 3.11 Map Function


1) map(-)((2,1),(5,3)) = (-(2,1), -(5,3)) = (1,2).
3.6.2 The Apply Function

21

2 A and bi 2 B

De nition 3.16 Apply Function


The apply function takes two arguments: a function f : A ! B and an
element x 2 A, and then returns the result of applying f to x, ie.
apply(f,x) = f(x).

 A selector function is a function that selects one component from a tuple.


We use n 2 N to name the selector.
Eg. 1(a,b,c) = a

2(a,b,c) = b.

Example 3.12 Apply Function


1) Supppose g(f,x) = f(x) + x.
Thus, g(f,x) = +(f(x),x)
= +(apply(f,x),x)
= +(apply,2)(f,x)

(By defn of the selector and tupling)

Why ????? Discuss ??

= (+ (apply,2))(f,x).

Hence, g = + (apply,2) by canceling the arguments (f,x).


Ans: +(apply(f,x),x) = +(apply(f,x),2(f,x))
= +(apply,2)(f,x)

(By defn of Selector)

(By defn of Tupling)

3.6.3 The Insert Function

 Applying a function to a tuple of data collectively.

22

De nition 3.17 Insert Function


The insert function is de ned as
insert(f)(x1,x2,...,xn) = f(x1, f (x2,...,f(xn 1,xn)...))
where f is a function of type A  A ! A, n  2 and xi 2 A for 1  i  n.
Example 3.13 Insert Function
1) insert(+)(1,2,3) = +(1, +(2,3)) = +(1,5) = 6.

 The insert can be seen as an extension of a binary function to take narguments where n  2.
3.7 The Graphs of Functions

 The graph of a function is employed to show the behaviour of the function


pictorially.

De nition 3.18 Graph of Function


The graph of a function f from the set A to the set B is the set of ordered
pair f(a,b) j a 2 A and f(a) = b g.
|> Figure 14 (page 68)

4 Countable and Uncountable Sets (Advanced Topic)


4.1 Introduction
23

De nition 4.1 Equivalence of Cardinality between Two Finite Sets


Given two nite sets A and B,

jAj = jBj i there exists a bijection A ! B.

Example 4.1 Equivalence of Cardinality between Two Finite Sets


1) jf1,2,3gj = jfa,b,cgj = 3.
2)

jf1,2,3,4gj 6= jfa,b,cgj because there is no bijection between them (the

cardinality of the former set is 4).

4.2 Counting In nite Sets

 It is to show that some in nite sets have the same cardinality as others,
or they have di erent cardinality than others, even though both of them
are in nite.

De nition 4.2 Equivalence of Cardinality between Two In nite Sets


Given two in nite sets A and B,

jAj = jBj i there is a bijection from A ! B.

 Surprises !!!!! - there are in nite sets much smaller or larger than N which
still have the cardinality of N.

Example 4.2 j N j = j Z j

Is this the case ??????

Yes. There is an isomorphism (thus bijection) from N to Z as follows.


Before that, let introduce mod (the \modulo" function). i mod j gives
remainder when i is divided by j. Eg. 2 mod 2 = 0 but 3 mod 2 = 1.
24

f : N ! Z is de ned by

f(n) = n  2, if n mod 2 = 0

= -((n  2)+1), if n mod 2 = 1

Thus,

0, 1, 2, 3, ...

... -2, -1, 0, 1, 2, ...

g : Z ! N is de ned by
g(z) = 2  z, if z  0
= (2  -z) - 1, if z < 0.
It is not dicult to see that f (g(Z)) = Z and g(f (N)) = N.
The inverse of f , ie.

It exploits the in nity of two sets to construct the argument.

De nition 4.3

 between in nite sets

1. jAj  jBj where A,B are (in nite) sets if there is an injection f : A ! B.
2. jAj < jBj where A,B are (in nite) sets if there is an injection f : A ! B
but there is no bijection between them.

 Intuitively, injection from A to B shows that set A is included in set B.


Example 4.3

 between in nite sets

Let Odd be the set of odd natural numbers. Then, the function f : Odd !

N de ned by f(X) = X is an injection from Odd to N. Thus, jOddj  jNj.

25

Theorem 4.1 George Cantor's theorem on the relation between a set and
its power set

jAj < jP(A)j where A is a (in nite) set.

 There are more subsets of A than there are elements of A, although both
of them are in nite.

4.3 Countable and Uncountable


4.3.1 Introduction

 To describe some in nite sets that can be counted even if it takes forever
to count them.

De nition 4.4 Countable


1. A set C is countable if it is either nite or jCj = jNj.
2. In case that jCj = jNj, C is called countably in nite.

 Note that if jCj  jNj, then C is also countable.


 A way to show that a set C is countable is to nd that there is either an
injection from C to N or a surjection from N to C.

 Why surjection from N to C ? Discuss this ????

Ans: It means that every element in C is related to some element in N.


Thus, this implies that there is an injection from N to C.

De nition 4.5 Uncountable


A set is uncountable if it is not countable.
26

Example 4.4 Uncountable


1) P(N) is uncountable since N is countable and jNj

< jP(N)j (Cantor's


theorem 4.1). Note that jNj < jP(N)j implies that jNj 6= jP(N)j.
2) R is uncountable. (We shall discuss this later.)
4.3.2 Counting Unions of Countable Sets

 The following result can be used to show that a set is countable if it can
be represented as a countable union of countable sets.

Theorem 4.2 Countable unions of countable sets


A set A is countable if it is the union of a countable collection of sets, where
each set in the collection is countable.
Proof Outline Let A0,A1,...,An,... be the countable collection of sets and let

ai0, ai1, ai2 are in each set Ai. Then list all the elements where each row is
for each countable set as follows.

a00, a01, a02, a03, ...


a10, a11, a12, a13, ...
a20, a21, a22, a23, ...
a30, a31, a32, a33, ...
a40, a41, a42, a43, ...
.
.

27

We can count the elements above diagonally in the order

a00, a01, a10, a02, a11, a20, a03, a12, a21, a30, ...
It can be shown that there is a bijection between the elements in the order
and N. In particular,

f (aij ) = (the sum of the lengths of diagonals preceding aij ) + i


= [1 + 2 + ... + (i+j)] + i

Eg. f (a00) = 0, f (a01) = 1, f (a10) = 2.

QED.

Thus, the elements are countable.

 This technique can be used to show that the set N  N is countable by


representing the set as a union of sets where each such a set is in the form

f(i,0), (i,1), (i,2), ... g for each i 2 N.


4.3.3 Showing the same cardinality of two sets

 It is not always easy to construct a bijection to show that two sets (either
in nite or nite) have the same cardinality (See Defn 4.1 and 4.2).

 Cantor proposed the following technique to show that two sets have the
same cardinality without explicitly exhibiting a bijection between them.
If jAj  jBj and jBj  jAj, then jAj = jBj.

 In other words, to show that a bijection exists between A and B, it suces


to nd two injections, one from A to B and the other from B to A.

 At the time, Cantor did not prove the correctness of the technique. Indeed,
it is a conjecture which is proved later by Bernstein, and independently by
Schroder.
28

Example 4.5 Show that jRj = j(0,1)j where the interval (0,1) is any real
number between 0 and 1, excluding 0 and 1.
Since (0,1)  R, it follows that j(0,1)j  jRj. Note that the identity function would establish an injection from (0,1) to R.
An injection from R to (0,1) can be established by using a composition of
the following functions.

f (x) = 2x, which maps from R to the set of positive real numbers.
1 , which maps from the positive real numbers to (0,1).
g(x) = x+1
Thus, g f is an injection from R to (0,1).
QED.
4.3.4 Diagonalization

 Cantor proposed a technique to show that some sets are uncountable.


 Recall that to show that a set is countable is to nd a bijection between
the set and N. Note that a bijection is a function which is both one-to-one
(injection) and onto (surjection).

 Cantor's Diagonal Argument shows that it does not exist an onto function
from N to the set by demonstrating that any function would fail to map to
an element in the set.

Example 4.6 Show that R is uncountable.


We want to show that it does not exist an onto function f : N ! R. Let f
be any map from N to R, which can be displayed as follows.
f(0) = a0.b00 b01 b02 ...
29

f(1) = a1.b10 b11 b12 ...

f(2) = a2.b20 b21 b22 ...

f(3) = a3.b30 b31 b32 ...


.
.
.

where each ai is an integer and each bij is the digit (0 - 9) after the decimal

point (.) Let de ne a new real number (b) from the diagonal elements by
changing each 0 to 1 and each non-zero digit to 0.

b = 0.b00 b11 b22 b33 ...

where bij = 0 if bij =


6 0,

bij = 1 if bij = 0.

De nitely, b is in R but it is not in the range f(N). This is because b is not

equal to f(n) for any n in that bnn is not equal to bnn.

Thus, f is not onto. Since f was any map from N to R, there is no any map
of N onto R.

QED.

What is the kind of structure of the set that Diagonalization can be

applied to ?
Ans: The kind of sets where each element has the in nite length.

30

Potrebbero piacerti anche