Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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)
= f a, e, i, o ,u g
O = f 1, 3, 5, 7, 9 g
f1, 3, 5g = f5, 3, 1g
f1, 3, 5g = f1, 1, 3, 3, 5, 5, 5g
Misc.
; or f g
2.3 Paradoxes
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
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
A graphical illustration for sets and the relationship between them (John
Venn: an English Mathematician 1881)
Circles or other geometric gures inside the rectangle represent sets. Also,
points represent particular elements in a set.
|> Figure 1
8 means universal quantication (forall, every) and ! stands for the
implication.
2) f1,2,3g f1,2,3,4,5g
2.6 Cardinality
Denition 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.
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.
We denote such
2) (1,3,5) 6= (1, 1, 3, 3, 5, 5, 5)
The power set can be used to build a new set which contains all combinations of elements of a set.
3) P(;) = f ; g
Why ????
; ; due to denition of .
4) P(f;g) = f ;, f;g g Why ????
Ans:
2. A1 A2...An = f(a1,a2,...,an) j ai
2 Ai for i = 1,2,...,n g
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)
f1, 3, 9g [ f2, 4, 9g = f 1, 2, 3, 4, 9 g
2.10.2 Intersection
A \ B = f x j x 2 A and x 2 B g
|> Figure 4 (page 47)
f1, 3, 9g \ f2, 4, 9g = f 9 g
Denition 2.16 Disjoint
Two sets are disjoint if their intersection is the empty set.
2.10.4 Complement
A=U-A
A = f x j x 2 U and x 62 A g
|> Figure 6 (page 49)
The dierence of set A and set B is also called the complement of B wrt.
A.
fe, i, o, ug.
A wrt. N
Proposition 2.1
A\B = A [ B
Proof.
=fxjx2A[B
Membership table:
QED.
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
Sn A
i=1
A1
[ A2 [ ... [ An
Tn A
i=1
A1
\ A2 \ ... \ An
3 Functions
3.1 Introduction
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 dierence 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 ??
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
! 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
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
dierent elements which are ordered are mapped to two dierent elements
which are ordered.
16
The onto function is a function where its range is equal to its codomain.
|> Figure 10 (page 63)
! Z is onto function.
Why
???????
17
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)
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
Denition 3.10 Invertible
1. A one-to-one correpondence is called invertible since we can dene an
inverse of this function.
2. A function is not invertible if it is not one-to-one correspondence.
3.5 Isomorphism
Denition 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.
!C
B2 ... Bn.
= +( (f,g)(X) )
= (+ (f,g))(X)
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)
map(f)(a1,a2,...,an) = (f(a1),f(a2),...,f(an)).
21
2 A and bi 2 B
2(a,b,c) = b.
= (+ (apply,2))(f,x).
22
The insert can be seen as an extension of a binary function to take narguments where n 2.
3.7 The Graphs of Functions
It is to show that some innite sets have the same cardinality as others,
or they have dierent cardinality than others, even though both of them
are innite.
Surprises !!!!! - there are innite sets much smaller or larger than N which
still have the cardinality of N.
Example 4.2 j N j = j Z j
f : N ! Z is dened by
f(n) = n 2, if n mod 2 = 0
Thus,
0, 1, 2, 3, ...
g : Z ! N is dened 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.
Denition 4.3
1. jAj jBj where A,B are (innite) sets if there is an injection f : A ! B.
2. jAj < jBj where A,B are (innite) sets if there is an injection f : A ! B
but there is no bijection between them.
Let Odd be the set of odd natural numbers. Then, the function f : Odd !
25
Theorem 4.1 George Cantor's theorem on the relation between a set and
its power set
There are more subsets of A than there are elements of A, although both
of them are innite.
To describe some innite sets that can be counted even if it takes forever
to count them.
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.
ai0, ai1, ai2 are in each set Ai. Then list all the elements where each row is
for each countable set as follows.
27
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,
QED.
It is not always easy to construct a bijection to show that two sets (either
innite 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.
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'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.
where each ai is an integer and each bij is the digit (0 - 9) after the decimal
point (.) Let dene a new real number (b) from the diagonal elements by
changing each 0 to 1 and each non-zero digit to 0.
bij = 1 if bij = 0.
Thus, f is not onto. Since f was any map from N to R, there is no any map
of N onto R.
QED.
applied to ?
Ans: The kind of sets where each element has the innite length.
30