0.2: Relations
( \newcommand{\kernel}{\mathrm{null}\,}\)
Definition: Binary Relation
Let S be a nonempty set. Then any subset R of S×S is said to be a relation over S. In other words, a relation is a rule that is defined between two elements in S. Intuitively, if R is a relation over S, then the statement aRb is either true or false for all a,b∈S.
If the statement aRb is false, we denote this by aR̸b.
Example 0.2.1:
Let S={1,2,3}. Define R by aRb if and only if a<b, for a,b∈S.
Then 1R2,1R3,2R3 and 2R̸1.
We can visualize the above binary relation as a graph, where the vertices are the elements of S, and there is an edge from a to b if and only if aRb, for ab∈S.

The following are some examples of relations defined on Z.
Example 0.2.2:
- Define R by aRb if and only if a<b, for a,b∈Z.
- Define R by aRb if and only if a>b, for a,b∈Z.
- Define R by aRb if and only if a≤b, for a,b∈Z.
- Define R by aRb if and only if a≥b, for a,b∈Z.
- Define R by aRb if and only if a=b, for a,b∈Z.
Definition: Divisor/Divides
Let a and b be integers. We say that a divides b is denoted a∣b, provided we have an integer m such that b=am. In this case we can also say the following:
- b is divisible by a
- a is a factor of b
- a is a divisor of b
- b is a multiple of a
If a does not divide b, then it is is denoted by a∤b.
Properties of binary relation:
Definition: Reflexive
Let S be a set and R be a binary relation on S. Then R is said to be reflexive if aRa,∀a∈S.
We will follow the template below to answer the question about reflexive.
Example 0.2.7:
Define R by aRb if and only if a<b, for a,b∈Z. Is R reflexive?
Counter Example:
Choose a=2.
Since 2≮2, R is not reflexive.
Example 0.2.8:
Define R by aRb if and only if a∣b, for a,b∈Z. Is R reflexive?
Proof:
Let a∈Z. Since a=(1)(a), a∣a.
Thus R is reflexive. ◻
Definition: Symmetric
Let S be a set and R be a binary relation on S. Then R is said to be symmetric if the following statement is true:
∀a,b∈S, if aRb then bRa, in other words, ∀a,b∈S,aRb⟹bRa.
Example 0.2.8: Visually
∀a,b∈S,aRb⟹bRa. holds!
We will follow the template below to answer the question about symmetric.
Example 0.2.9:
Define R by aRb if and only if a<b, for a,b∈Z. Is R symmetric?
Counter Example:
1<2 but 2≮1.
Example 0.2.10:
Define R by aRb if and only if a∣b, for a,b∈Z. Is R symmetric?
Counter Example:
2∣4 but 4∤2.
Definition: Transitive
Let S be a set and R be a binary relation on S. Then R is said to be transitive if the following statement is true
∀a,b,c∈S, if aRb and bRc, then aRc.
In other words, ∀a,b,c∈S, aRb∧bRc⟹aRc.
Example 0.2.14: VISUALLY
∀a,b,c∈S, aRb∧bRc⟹aRc holds!
We will follow the template below to answer the question about transitive.
Example 0.2.15:
Define R by aRb if and only if a<b, for a,b∈Z. Is R transitive?
Example 0.2.16:
Define R by aRb if and only if a∣b, for a,b∈Z+. Is R transitive?
Definition: Equivalence Relation
A binary relation is an equivalence relation on a nonempty set S if and only if the relation is reflexive(R), symmetric(S) and transitive(T).
Definition: Equivalence Relation
Example 0.2.1: =
Let S=R and R be =. Is the relation a) reflexive, b) symmetric, c) antisymmetric, d) transitive, e) an equivalence relation, f) a partial order.
Solution:
-
Yes R is reflexive.
Proof:
Let a∈R.
Then a=a.
Hence R is reflexive. ◼
Yes R is symmetric.
Proof:
Let (a,b)∈R such that a=b.
Clearly b=a.
Hence R is symmetric. ◼
Yes R is antisymmetric.
Proof:
Let a,b∈R s.t. a=b and b=a. Then clearly a=b∀a,b∈R. ◼
Yes R is transitive.
Proof:
Let a,b,c∈R s.t. a=b and b=c.
We shall show that aRc.
Since a=b and b=c it follows that a=c
Thus aRc. ◼
Yes R is an equivalence relation.
Proof:
Since R is reflexive, symmetric and transitive, it is an equivalence relation.
Yes R is a partial order.
Proof:
Since R is a partial order since R is reflexive, antisymmetric and transitive.
Example 0.2.2: Less than or equal to
Let S=R and R be ≤. Is the relation a) reflexive, b) symmetric, c) antisymmetric, d) transitive, e) an equivalence relation, f) a partial order.
Solution
Proof:
Counterexample:
It is true that , but it is not true that
.
Proof:
We will show that given and
that
.
Proof:
We will show that given and
that
.
5. No, is not an equivalence relation on
since it is not symmetric.
6. Yes, is a partial order on
since it is reflexive, antisymmetric and transitive.
Definition: Equivalence Class
Given an equivalence relation R over a set S, for any a∈S the equivalence class of a is the set [a]R={b∈S∣aRb}, that is
[a]R is the set of all elements of S that are related to a.
Example 0.2.3: Equivalence relation
Define a relation that two shapes are related iff they are the same color. Is this relation an equivalence relation?
Equivalence classes are:
Example 0.2.4:
Define a relation that two shapes are related iff they are similar. Is this relation an equivalence relation?
Equivalence classes are:
Let A be a nonempty set. A partition of A is a set of nonempty pairwise disjoint sets whose union is A.
Note
For every equivalence relation over a nonempty set S, S has a partition.
Theorem 0.2.1
If ∼ is an equivalence relation over a nonempty set S. Then the set of all equivalence classes is denoted by {[a]∼|a∈S} forms a partition of S.
This means
1. Either [a]∩[b]=∅ or [a]=[b], for all a,b∈S.
2. S=∪a∈S[a].
- Proof
-
Assume
is an equivalence relation on a nonempty set
.
Let
. If
, then we are done. Otherwise,
Let
be the common element between them.
Then
and
, which means that
and
.
Since
is an equivalence relation and
.
Since
and
(due to transitive property),
.
For the following examples, determine whether or not each of the following binary relations on the given set
is reflexive, symmetric, antisymmetric, or transitive. If a relation has a certain property, prove this is so; otherwise, provide a counterexample to show that it does not. If
is an equivalence relation, describe the equivalence classes of
.
Example 0.2.5:
Let S={0,1,2,3,4,5,6,7,8,9}. Define a relation R on A=S×S by (a,b)R(c,d) if and only if 10a+b≤10c+d.
Solution
Proof:
Counter Example:
Since ,
is not symmetric on
.◻
Proof:
Thus is antisymmetric on
.◻
5. is transitive on .
Proof:
6. is not an equivalence relation since it is not reflexive, symmetric, and transitive.
Example 0.2.6:
Let . Define a relation
on
, by
if and only if
Solution
Proof:
Clearly since
and a negative integer multiplied by a negative integer is a positive integer in
.
Since ,
is reflexive on
.◻
2. is symmetric on .
Proof:
Counter Example:
Since ,
is not antisymmetric on
.◻
Proof:
There are two cases to be examined:
Since in both possible cases
is transitive on
.◻
5. Since is reflexive, symmetric and transitive, it is an equivalence relation. Equivalence classes are
and
.
Note this is a partition since or
. So we have all the intersections are empty.
Recall:
Let m,n∈Z.
We say that m divides n (written as m|n) if n=mk for some k∈Z.
Let S=Z,m∈Z+. Define aRb if and only if m|(a−b),∀a,b∈Z.
Note that m is a positive integer.
Let m=3. Choose a=1 and b=2.
Are 1 and 2 related? i.e. does 3|1−2? Does 1−2=3k,k∈Z? Since there is no integer k s.t. −1=3k, ∴ 1 is not related to 2.
However, we can see that we have three groups, as shown in the image below:
Definition: Modulo
Let m ∈ Z+.
a is congruent to b modulo m denoted as a≡b(modn), if a and b have the remainder when they are divided by n, for a,b∈Z.
Properties
Let n∈Z+. Then
Theorem 1 :
Two integers a and b are said to be congruent modulo n, a≡b(modn), if all of the following are true:
a) m∣(a−b).
b) both a and b have the same remainder when divided by n.
c) a−b=kn, for some k∈Z.
NOTE: Possible remainders of n are 0,...,n−1.
Reflexive Property
Theorem 2:
The relation " ≡ " over Z is reflexive.
Proof: Let a∈Z.
Then a−a=0(n), and 0∈Z.
Hence a≡a(modn).
Thus congruence modulo n is Reflexive.
Symmetric Property
Theorem 3:
The relation " ≡ " over Z is symmetric.
Proof: Let a,b∈Z such that a≡b (mod n).
Then a−b=kn, for some k∈Z.
Now b−a=(−k)n and −k∈Z.
Hence b≡a(modn).
Thus the relation is symmetric.
Antisymmetric Property
Is the relation " ≡ " over Z antisymmetric?
Counter Example: n is fixed
choose: a=n+1,b=2n+1, then
a≡b(modn) and b≡a(modn)
but a≠b.
Thus the relation " ≡ "on Z is not antisymmetric.
Transitive Property
Theorem 4 :
The relation " ≡ " over Z is transitive.
Proof: Let a,b,c∈ Z, such that a≡b(modn) and b≡c(modn).
Then a=b+kn,k∈ Z and b=c+hn,h∈ Z.
We shall show that a≡c(modn).
Consider a=b+kn=(c+hn)+kn=c+(hn+kn)=c+(h+k)n,h+k∈ Z.
Hence a≡c(modn).
Thus congruence modulo n is transitive.
Theorem 5:
The relation " ≡ " over Z is an equivalence relation.
Modulo classes
Let . The relation ≡ on
by a≡b if and only if
, is an equivalence relation. The Classes of
have the following equivalence classes:
Example of writing equivalence classes:
Modulo Arithmetic
In this section, we will explore arithmetic operations in a modulo world.
Let n∈Z+.
Theorem 5 :
Let a,b,c,d,∈Z such that a≡b(modn) and c≡d(modn). Then (a+c)≡(b+d)(modn).
- Proof:
-
Let a,b,c,d∈Z, such that a≡b(modn) and c≡d(modn).
We shall show that (a+c)≡(b+d)(modn).
Since a≡b(modn) and c≡d(modn),n∣(a−b) and n∣(c−d)
Thus a=b+nk, and c=d+nl, for k and l∈Z.
Consider(a+c)−(b+d)=a−b+c−d=n(k+l),k+l∈Z.
Hence (a+c)≡(b+d)(modn).◻
Theorem 6:
Let a,b,c,d,∈Z such that a≡b(modn) and c≡d(modn). Then (ac)≡(bd)(modn).
- Proof:
-
Let a,b,c,d∈Z, such that a≡b(modn) and c≡d(modn).
We shall show that (ac)≡(bd)(modn).
Since a≡b(modn) and c≡d(modn),n∣(a−b) and n∣(c−d)
Thus a=b+nk, and c=d+nl, for k and l∈Z.
Consider (ac)−(bd)=(b+nk)(d+nl)−bd=bnl+dnk+n2lk=n(bl+dk+nlk), where (bl+dk+nlk)∈Z.
Hence (ac)≡(bd)(modn).◻
Theorem 7:
Let a,b∈ Z such that a≡b(modn). Then a2≡b2(modn).
- Proof:
-
Let a,b∈ Z, and n ∈ Z+, such that a≡b(modn).
We shall show that a2≡b2(modn).
Since a≡b(modn),n∣(a−b).
Thus (a−b)=nx, where x∈ Z.
Consider (a2−b2)=(a+b)(a−b)=(a+b)(nx),=n(ax+bx),ax+bx∈Z.
Hence n∣a2−b2, therefore a2≡b2(modn). ◻
Theorem 8:
Let a,b∈ Z such that a≡b(modn). Then am≡bm(modn), ∀∈ Z.
- Proof:
-
Exercise.
By using the above result, we can solve many problems. Some of them are discussed below:
Example 0.2.1: mod3 Arithmetic
Let n=3.
Addition
+ | [0] | [1] | [2] |
[0] | [0] | [1] | [2] |
[1] | [1] | [2] | [0] |
[2] | [2] | [0] | [1] |
Multiplication
x | [0] | [1] | [2] |
[0] | [0] | [0] | [0] |
[1] | [0] | [1] | [2] |
[2] | [0] | [2] | [1] |
Example 0.2.2: mod4 Arithmetic
Let n=4.
x | [0] | [1] | [2] | [3] |
[0] | [0] | [0] | [0] | [0] |
[1] | [0] | [1] | [2] | [3] |
[2] | [0] | [2] | [0] | [2] |
[3] | [0] | [3] | [2] | [1] |
Example 0.2.3:
Find the remainder when (101)(103)(107)(109) is divided by 11.
- Answer
-
101≡2(mod11)
103≡4(mod11)
107≡8(mod11)
109≡10(mod11).
Therefore,
(101)(103)(107)(109)≡(2)(4)(8)(10)(mod11)≡2(mod11).
Example 0.2.4:
Find the remainder when71453 is divided by 8.
- Answer
-
70≡1(mod8)
71≡7(mod8)
72≡1(mod8)
73≡7(mod8),
As there is a consistent pattern emerging and we know that 1453 is odd, then 71453≡7(mod8). Thus the remainder is 7.
Example 0.2.5:
Find the remainder when 72020 is divided by 18.
- Answer
-
70≡1(mod18)
71≡7(mod18)
72≡13(mod18)
73≡1(mod18),
As there is a consistent pattern emerging and we know that 2020=(673)3+1, 72020=7(673)3+1=(73)67371≡7(mod18). Thus the remainder is 7.
Example 0.2.6:
Find the remainder when 261453 is divided by 3.