Sets and Funcctions, Cardinality
Sets and Funcctions, Cardinality
program in mathematics
CONTENTS
1.
SETS
Set, equal sets, subset, the empty set, power set of a set;
union, intersection, difference of sets; de Morgans laws;
ordered pairs, Cartesian product of sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
EXERCISES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.
LOGIC
RELATIONS
FUNCTIONS
5.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
CARDINALITY OF SETS
We do not define neither the set nor the element of a set, their meanings can be
understood intuitively (not needing definition).
However, we say that a set is any collection of definite, distinguishable objects, and
we call these objects the elements of the set.
Notations.
(1) Sets are usually denoted by capital letters (A, B, C, ...) .
The elements of the set are usually denoted by small letters (a, b, c, ...) .
(2) If X is a set and x is an element of X, we write x X .
(We also say that x belongs to X.)
If X is a set and y is not an element of X, we write y
/ X.
(We also say that y does not belong to X.)
(3) When we give a set, we generally use braces, e.g.:
(i) S := {a, b, c, . . .} where the elements are listed between braces,
three dots imply that the law of formation of other elements is known,
(ii) S := {x X : p(x) is true} where x stands for a generic element
of the set S and p is a property defined on the set X.
Remark.
If we want to emphasize that the elements of the set are also sets, we denote the set
by script capital letter, such as:
(i) A := {A, B, C, . . .} where A, B, C, . . . are sets,
(ii) A := {A : } where is the so called indexing set and A s are sets.
Examples.
1. N := {0, 1, 2, 3, . . .} the set of all natural numbers,
N+ := {n N : n > 0},
2. Z := {0, 1, +1, 2, +2, . . .} the set of all integers,
3. Q := {p/q : p Z, q N+ } the set of all rational numbers,
Q+ := {r Q : r > 0},
4. R := the set of all real numbers,
R+ := {x R : x > 0},
5. C := the set of all complex numbers.
1
Definitions.
(1) Equal sets:
We define A = B
(2) Subset:
We say that A is a subset of B and we write A B or B A
if every element of A is also an element of B.
(We also say that A is included in B or B includes A or B is a superset of A. )
(3) Proper subset:
We say that A is a proper subset of B and we write A B strictly
if A B and A 6= B.
(There exists at least one element b B such that b
/ A. )
(4) The empty set:
The set which has no element is called the empty set and is denoted by .
(That is = {x A : x
/ A}, where A is any set. )
(5) Power set of a set:
Let X be any set. The set of all subsets of X is called the power set of X
and is denoted by P(X).
(That is we define P(X) := {A : A X} )
Remarks.
Let A and B be any sets. Then the following propositions can be proved easily:
(1)
(2)
(3)
(4)
(denoted by \ )
EXERCISES
A B.
B A.
1.
B := {1, 3, 5}.
B \A=?
P(B) = ?
Ac = ?
Bc = ?
A (B C) = (A B) (A C)
2. LOGIC
Basic ideas of logic:
Proposition:
We define a proposition to be a statement which is either true or false.
When we deal with propositions in logic we consider sentences without being interested
in their meanings, only examining them as true or false statements.
In the following, propositions will be denoted by small letters ( p, q, r, . . . ).
Logical values:
There are two logical values:
Examples.
1. p := for each real number x, x2 +1 is positive .
The logical value of the proposition p is true.
2. q := if x = 2 then x2 1 = 0.
The logical value of the proposition q is false.
true
if p is false
p :=
false
if p is true .
Conjunction:
true
if p and q are both true
p q :=
false
if at least one of p and q is false .
Disjunction:
true
if at least one of p and q is true
p q :=
false
if p and q are both false .
Implication:
true
if p and q are both true, or p is false
p q :=
false
if p is true and q is false .
5
Equivalence:
true
if p and q have the same logical value
p q :=
false
if p and q have different logical values .
Remarks.
(1) For p q we can also say that
if p then q,
p only if q,
p is a sufficient condition for q,
q is a necessary condition for p.
(2) For p q we can also say that
p if and only if q, ( p iff q ),
p is a necessary and sufficient condition for q.
(3) The following truth tables can be useful to resume the definitions of
the logical operations:
p
pq
pq
pq
pq
p q is equivalent to (p q) (q p),
that is, for all values of p and q p q = (p q) (q p),
(ii) p q = (p) q
(i) p q (p q) (q p) T,
(ii) (p q) (p) q T,
true
if p(s) is true for all s S
(i) s S p(s) :=
false
if there exists at least one s S such that p(s) is false ,
true
if there exists at least one s S such that p(s) is true
(ii) s S p(s) :=
false
if p(s) is false for all s S .
The symbol is read for all and is called the universal quantifier,
the symbol is read there exists and is called the existential quantifier.
Negation of propositions.
It is of crucial importance that we can negate propositions correctly. In the following
we show how to negate propositions in accordance with the definitions of the logical
operations and the universal and existential quantifiers.
(1) When the quantifiers do not occur in the proposition, we have
(i) (p q) (p) (q) ,
(ii) (p q) (p) (q) ,
(iv) (p q)
(p
q)
(q
p)
(p
q)
(q
p)
p (q) q (p) p q (p) (q) .
(2) When quantifiers occur in the proposition, we have
(q)
r p q, thus we can prove
EXERCISES
2.
1. Prove that for all values of p, q, r the following statements are true.
pq = qp
(p q) r = p (q r)
pq = qp
(p q) r = p (q r)
p (q r) = (p q) (p r)
p (q r) = (p q) (p r)
2. Answer the questions for any values of p.
pp= ?
pT= ?
pF= ?
pp= ?
pT= ?
pF= ?
pp=?
pT=?
pF=?
pp=?
pT=?
pF=?
3. Determine which of the following propositions are true:
(a)
nZ
n2 > 1
3
(b)
x R
x 2x2 +x2 = 0
(c)
(x, y) R2
x2 +xy+y 2 < 0
4. Negate the following propositions, then determine which of them are true.
(a)
p R+
K R+
x (K, +)
(b)
p R+
K R+
x (K, +)
(c)
p R+
K R+
x (K, +)
(d)
p R+
K R+
x (K, +)
x2 px + 1 > 0
p
x sin > 0
x
p
cos > 0
x
p < log2 x
(e)
p R+
K R+
x (K, +)
xp < 106
(f)
p R+
K R+
x (K, +)
(g)
R+
x (0, /4]
sin x = p
+ 1/
1
sin x = p
+ 1/
5. Prove that (p r) (r q) p q T .
(h)
R+
6. Prove that
7. Prove that
x (0, ] R+
n
k N+ n N+
k is an integer or an irrational number.
3. RELATIONS
Definition. (Relations.)
Any subset of a Cartesian product of sets is called a relation.
( I.e., a relation is a set of ordered pairs. )
If X and Y are sets and X Y , we say that is a relation from X to Y .
(We can also say that is a relation between the elements of X and Y .)
If X X , we say that is a relation in X.
If (x, y) , we often write x y .
Examples.
1. The relation of equality in a nonempty set X.
1 := { (x, x) : x X },
thus (x, y) 1 X X iff x = y.
2. The relation of divisibility in N+ .
2 := { (m, n) N+ N+ : k N+ n = k m },
thus (m, n) 2 N+ N+ iff m | n ,
that is n can be divided by m without remainder (n is divisible by m).
3. The relation of congruence modulo m in Z.
3 := { (a, b) Z Z : k Z ab = k m }, (m N+ ),
thus (a, b) 3 Z Z iff m | ab ,
that is (ab) can be divided by m without remainder;
(ab) is divisible by m; dividing a and b by m we get the same remainder.
4. The relation of less in R.
4 := { (x, y) R R : x < y },
thus (x, y) 4 R R iff yx is a positive number.
5. The relation of greater or equal in R.
5 := { (x, y) R R : x y },
thus (x, y) 5 R R iff xy is a nonnegative number.
6. Relation between the elements of the set T of all triangles of the plane and
the elements of the set R+
0 of all nonnegative numbers,
+
6 := { (t, a) T R0 : the area of the triangle t is a }.
7. Relation between the elements of the set R+
0 of all nonnegative numbers and
the elements of the set T of all triangles of the plane,
7 := { (a, t) R+
0 T : the area of the triangle t is a }.
8. Relation between the elements of the set C of all circles of the plane and
the elements of the set L of all lines of the plane,
8 := { (c, l) C L : l is a tangent of c }.
9
( X Y ).
D() := {x X : y Y
(x, y) }.
R() := {y Y : x X (x, y) }.
(x, x) .
(x, x)
/ .
(3) Symmetry:
is called symmetric if (x, y) (y, x) ,
that is (x, y) implies (y, x) .
(4) Antisymmetry:
implies (x, z) .
x
subsetof X,
X Ax is a nonempty
implies Ax Ay = or
Sx, y X and x 6= y
{ Ax : x X } = X,
Ax = Ay ,
11
Proof.
(i) x X (A A x A) (x, x) is reflexive,
(x, y) (A A x, y A) y, x A (y, x) is symmetric,
(x, y) and (y, z) (A1 A x, y A1 ) and (A2 A y, z A2 )
y A1 A2 A1 = A2 x, z A1 (x, z) is transitive,
thus is an equivalence relation.
(ii)
EXERCISES
3.
if
if
if
if
if
is
is
is
is
is
:= {
:= {
:= {
:= {
(x, y) Q Q : x > y },
(x, y) R R : x y },
(A, B) P(X) P(X) : A B }, (X 6= ),
((m1 , m2 ), (n1 , n2 )) (N+ )2 (N+ )2 : m1 | n1 and m2 | n2 }.
:= { (p, q) N N : m | qp }, (m N+ ),
:= { ((m1 , m2 ), (n1 , n2 )) (N+ )2 (N+ )2 : m1 + n2 = m2 + n1 },
:= { ((m1 , m2 ), (n1 , n2 )) (ZZ\{0})(ZZ\{0}) : m1 n2 = m2 n1 },
:= { (x, y) R R : y x Q },
:= { (p, q) Q Q : n Z n p < n+1 and n q < n+1 }.
:= { (x, y) (R\{0})2 : x |y| = y |x| },
:= { (p, q) N N : m | qp }, (m N+ ),
= 3,
:= { (x, y) R R : y x Q },
= ,
:= { (p, q) Q Q : n Z n p < n+1 and n q < n+1 },
= 3, 14.
4. FUNCTIONS
Definition. (Functions.)
Let X and Y be sets.
A relation f X Y is called a function from X to Y if
(i) D(f ) = X ,
(ii) x X the set { y Y : (x, y) f } has exactly one element.
(I.e. x X there exists exactly one element y Y such that (x, y) f . )
We also say that f is a map, mapping or transformation from X to Y .
If f is a function from X to Y , we write f : X Y .
The notations y = f (x) (traditionally said y is a function of x) and
x 7 y mean that (x, y) f .
We call f (x) the element associated with x .
We also say that f (x) is the image of x under f or the value of f at x.
Remarks. (Domain, range and target of functions.)
Let X, Y be sets and
f : X Y be a function.
According to the definitions for relations, D(f ) is the domain of the function f
and R(f ) = { f (x) : x D(f ) } is the range of the function f .
If X Z, we can also write f : Z Y , which means that D(f ) Z.
Y is called the target of the function f .
Definition. (Restrictions of functions.)
Let X, Y , A be sets, A X , and f : X Y be a function.
The function g : A Y , g(x) := f (x) is called the restriction of f to A,
and we use the notation f |A := g .
Definitions. (Injective, surjective, bijective functions.)
Let X, Y be sets and f : X Y be a function.
(1) Injective function:
We say that f is injective if for all x, z X f (x) = f (z) implies x = z,
that is x 6= z implies f (x) 6= f (z).
(We also say that f is an injection, or a onetoone correspondence.)
(2) Surjective function:
We say that f is surjective if y Y there exists x X such that f (x) = y,
that is R(f ) = Y .
(We also say that f is a surjection, or f is a map onto Y .)
14
D(f g) := { x X : g(x) Y2 },
such as
(f g)(x) := f (g(x)).
if and only if
EXERCISES
4.
(b)
(d)
(f)
exp ln,
arcsin sin,
arccos cos.
5. CARDINALITY OF SETS
We do not define the cardinality (cardinal number) of a set in general, but we compare sets
considering the number of their elements by putting them in onetoone correspondance.
Definitions.
Let X and Y be any sets.
(i)
We say that X and Y have the same cardinality and write | X |=| Y |
or say that X and Y are equivalent sets and write X Y
if there exists a bijective function f : X Y .
(ii)
(iii)
Theorem (5.1).
Let X, Y and Z be sets. Then
(i) X X ,
(ii) X Y Y X ,
(iii) (X Y and Y Z) X Z .
Proof.
(i) idX : X X, x 7 x is bijective,
(ii) If f : X Y is bijective, then f 1 : Y X is also bijective,
(iii) If g : X Y and f : Y Z are bijective,
then (f g) : X Z is also bijective.
Theorem (5.2).
Let X and Y be sets. Then the following statements are equivalent:
(i) There exists an injective function f : X Y .
(ii) There exists a surjective function g : Y X .
Proof.
If X = or Y = , then (i) and (ii) are obviously equivalent.
If X =
6 and Y 6= , then
(1) if f : X Y is injective, then, choosing any x0 X,
the function g : Y X defined by
1
f (y)
if y R(f )
is a surjection.
g(y) :=
x0
if y Y \ R(f )
(2)
17
Remarks.
(i) According to the previous theorem we can say that | X || Y |
if and only if there exists a surjective function f : Y X .
(ii) The following theorem (whose proof is omitted) shows that
| X |=| Y |
if and only if
(| X || Y | and | Y || X | ).
Theorem (5.3). (Bernsteins theorem.)
Let X and Y be sets. Then the following statements are equivalent:
(i) There exists a bijective function f : X Y .
(ii) There exist injective functions g1 : X Y and g2 : Y X .
(iii) There exist surjective functions h1 : Y X and h2 : X Y .
Definition. (Finite and infinite sets.)
(i) A set X is called finite if either X = or m N+ such that X {1, 2, . . . , m}.
We call m (that is uniquely determined) the cardinality (cardinal number) of X
and write | X | := m.
The cardinality (cardinal number) of the empty set is defined by | | := 0.
(ii)
Theorem (5.4).
A set X is finite if and only if
if it is not finite.
| X |<| N+ |.
Proof.
(1) If X = , then we evidently have | X |<| N+ | .
If | X |= m N+ , then a bijection f : X {1, 2, . . . , m} ,
thus f : X N+, f (x) := f(x) is an injection, so we have | X || N+ |.
If we suppose that a bijection g : X N+ , then (g f1 ) : {1, 2, . . . , m} N+
is a bijection, which is obviously impossible. Thus, we have | X |<| N+ |.
(2)
Theorem (5.5).
If X is an infinite set, then | X || N+ | and Y X such that | Y |=| N+ |.
Proof.
Let x0 X and define f : N+ X recursively: f (1) := x0 , and
for each n N+ choosing any xn X \ {x0 , . . . , xn1 } let f (n+1) := xn .
Since f is injective, it follows that | N+ || X | and N+ R(f ) =: Y .
18
| X |>| N+ |.
Examples.
+
1. N+ is countably infinite, since idN : N+ N+ is a bijection.
2. N is countably infinite, since f : N N+ , f (n) := n+1 is a bijection.
3. Z is countably infinite, since f : N+ Z,
f (1) := 0, f (2n) := n, f (2n+1) := n (n N+ ) is a bijection.
4. Q+ is countably infinite, since it is infinite and countable
( f : Q+ N+ , f (p/q) := 2p 3q p, q N+ , (p, q) = 1 is an injection ).
5. N+ N+ is countably infinite, since it is infinite and countable
( f : N+ N+ N+ , f (m, n) := 2m 3n is an injection ).
Theorem (5.6).
If A is
Sa countable set and for all A A
then
A is also countable.
A is countable,
Proof.
S
(1) If A = or A = { } then
A is the empty set which is countable.
S
S
(2) If
A 6= then we define an injection from
A to N+ as follows:
There exists an injection f : A N+ and
for all A A there exists an injection gA : A N+ .
S
For each x A S
there exists at least one set A A such that x A.
Now we define F : A N+ N+ , F (x) := (f (A), gA (x)) N+ N+ .
F is injective, since if F (x) = F (y) =: (m, n) then x, y f 1 (m) =: A,
thus n = gA (x) = gA (y), which implies that x = y.
Let G : N+ N+ N+ be an injection (e.g. (m, n) 7 2m 3n ).
S
S
Since (G F ) :
A N+ is injective, it follows that
A is countable.
19
Theorem (5.7).
The set R of all real numbers is uncountable.
Proof.
(1) First we prove (by contradiction) that (0, 1) R is uncountable.
If we suppose that (0, 1) is countable, then a surjection f : N+ (0, 1) .
Let x (0, 1) be defined such that n N+ , the nth digit in the decimal
representation of x is different from the nth digit in the decimal representation
of f (n) and from 0 and 9. It is evident that x
/ R(f ), which is a contradiction,
since R(f ) = (0, 1). Thus, (0, 1) is uncountable.
(2) It is easy to see that (0, 1) R implies that R is also uncountable.
Remark. (5.9).
If X is an infinite set, then there exists Z X strictly such that | Z |=| X |.
Proof.
Let Y X such that | Y |=| N+ |. Then a bijection f : N+ Y ,
thus g : N+ Y , g(n) := f (2n) is injective and R(g) Y strictly.
Hence, the function h : X X defined by
(g f 1 )(x)
if x Y
h(x) :=
x
if x X \ Y
is injective and Z := R(h) = R(g) (X \ Y ) X strictly.
20
EXERCISES
5.