Relations II - University of Brighton

Download Report

Transcript Relations II - University of Brighton

Relations II
• Examples: on the set of positive integers
is bigger than
is bigger than or equal to
is a factor of
mRn iff mn is square
mRn iff m+n is a multiple of 3
mRn iff m, n have same number of factors
Example 1
m R n iff m > n
Examples: 3 R 1, 56 R 45
(substitute in for m and n)
Directed Graph:
1
2
3
4
….
reflexive
Is “is bigger than” a reflexive relation?
(do elements of the set relate to themselves?)
no
proof? Give an example of an element which
doesn’t relate to itself
A non-reflexive proof
Proposition: The relation R is not reflexive
Proof:
It is not the case that
13 is bigger than 13,
so 13 R 13
Therefore, it is not true that
for all x, x R x.
symmetric
Is the relation “is bigger than” symmetric?
(do all arrows have reverse arrows?)
no.
proof: find one arrow whose reverse isn’t
included
Proof for non-symmetry
Proposition: R is not symmetric
Proof:
It is the case that 23 is bigger than 12
but it is not that case that 12 is bigger than 23.
So 23 R 12, but 12 R 23.
It is not the case that
for all x, y, xRy implies that yRx
transitivity
Is “is bigger than” transitive?
(can you shortcut triangles?)
On my directed graph, all arrows pointed left
and anything which goes left was there, so
all triangles could be shortcut
Yes, the relation is transitive
Proof of transitivity
Proposition: R is transitive.
Proof:
Take any positive integers x, y, z which have
xRy and yRz.
ie. x is bigger than y and y is bigger than z.
So x must be bigger than z, and xRz.
So, for all choices of x,y,z with xRy and yRz,
we can show than xRz.
antisymmetry
Is “is bigger than” antisymmetric?
(you never see arrows with their reverse?)
This seems to be the case - intuitively using
the “points left” idea
yes, the relation is antisymmetric
Proof of antisymmetry
Proposition: R is antisymmetric
Proof:
Take any x, y with xRy and yRx.
xRy means that x is bigger than y, and
yRx means that y is bigger than x.
This can’t ever happen, and it’s not possible to
find such an x,y.
It is the case that xRy , yRx implies x = y
(because F implies anything)
total
Is “is bigger than” total?
(can you compare any two elements, one way
round or the other?)
Given two numbers, can we always say that
one is bigger than the other?
(no)
the relation is not total
Proof of non-totality
Proposition: R is not total
Proof:
13 is not bigger than 13, so 13 R 13
So if x =13, and y =13, x R y and y R x
This means that it’s not true that
for all choices of x,y, either xRy or yRx.
partial order
Is “is bigger than” a partial order?
(is the relation reflexive, anti-symmetric and
transitive?)
no - it’s not reflexive (and I don’t need to
check the other two conditions now)
The relation is not a partial order
Proof of not - partial order
Proposition: R is not a partial order
Proof:
A partial order is a reflexive, anti-symmetric
and transitive relation.
But we have shown earlier that R is not
reflexive.
mRn iff mn is square
start with a directed graph:
1
2
3
4
5
6
7
8
9
mRn iff mn is square
• reflexive?
yes
• symmetric? yes
• transitive? not sure - do some examples…
we need to choose x, y, z (could be equal)
with xRy and yRz
eg: 1R1 and 1R4, and 1R4
eg: 4R1 and 1R9, and 4R9
guess yes
Proof for reflexive property
Proposition:
R is a reflexive relation.
Proof:
Take x, any positive integer.
The product of x with itself is a square,
xx is square, so xRx.
Proof for symmetry
Proposition:
R is a symmetric relation.
Proof:
Take x, y any positive integers with xRy.
This means that the product xy is a square.
But yx = xy, so yx must also be a square
number, and yRx.
For all x, y, with xRy, we also have yRx.
Proof for transitivity
Proposition:
R is a transitive relation.
Proof:
Take x, y, z any positive integers
with xRy and yRz.
This means that xy is a square and yz is a
square. Let xy = p2 and yz = q2.

xy  yz 
xz 

y2
 pq 
p q

 
2
y
 y 
2
2
so xz is a square and xRz.
2
Proof for equivalence relation
Proposition:
R is an equivalence relation.
Proof:
An equivalence relation is a
relation which is reflexive, symmetric and
transitive. We have shown that R has these
three properties, so R is an equivalence
relation.
Relations on sets
• Examples: on the set of sets
is a subset of
has non-empty intersection with
has a bijection to
Relations on sets
A~B
iff
there is some bijective function from A to B
Show that {1, 2, 3} ~ {a, b, c}.
Show that {1,7,6,2} ~ {p, q}.
Equivalence relations and
partitions
The directed graph of an equivalence relation
looks like this:
The set splits into
subsets which are
completely interrelated
- each element is in an
interrelated subset
This is a partition of
the set
Equivalence classes
Given an equivalence relation R on set A, and
an element a of A,
the equivalence class of a in A is the set of
elements of A which are related to a.
a  x  A | xRa
The equivalence class of a
for any a in A,
a
The equivalence class of a
[a] is a subset of A
[a]
The equivalence class of b
for any b in A,
b
Equivalence relations and
partitions
[b] is a subset of A
[b]
Equivalence relations and
partitions
in this example, [c] = [b]
b
c
Equivalence relations and
partitions
in this example, [a] = [d]
d
a
Equivalence classes
Proposition:
If R is an equivalence relation
then
[a] = [b] iff aRb.
Proof: (needs two sections)
First show that if [a] = [b] then aRb.
This is because b is an element of [b], because
R is reflexive. And [b] = [a], so b is in [a].
But
, so we must have aRb.
a  x  A | xRa
continued….
Equivalence classes
Proposition: If R is an equivalence relation then
[a] = [b] iff
aRb.
Proof: (continued)
Now show that if aRb then [a] = [b].
Assume aRb. To show the subsets [a] and [b] are
equal, show one contains the other and v.v.
To show: [a] is a subset of [b]
To show: elements of [a] must be in [b]
ctd…..
Equivalence classes
Proposition: If R is an equivalence relation then
[a] = [b] iff
aRb.
Proof: (continued)
aRb implies that elements of [a] must be in [b]:
Assume aRb and that c is in [a], ie. aRc.
bRa and aRc, so bRc, and c is in [b].
Now show that all elements of [b] are in [a]
Assume aRb and that d is in [b], ie. bRd.
R is transitive, so aRd, and d is in [a].
mRn iff mn is square
• is an equivalence relation
What is [1]?
What is [2]?
What is the partition of the set of positive
integers?
Size of sets
A~B
iff
there is some bijective function from A to B
is an equivalence relation.
List some elements of [{1,2}].
List some elements of [the set of integers].