Lecture Slides For Classical Logic
Lecture Slides For Classical Logic
Section 5.6
Equivalence Classes Modulo n
Residue Systems
Equivalence Relations
Definition
A relation R is an equivalence relation, if it is reflexive,
symmetric, and transitive.
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Partitions
Definition
A partition of a set X is a family of non-empty and pairwise
disjoint subsets of X , the union of which is X . The sets in a
partition are called clusters of the partition.
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Lemma
Let ∼ be an equivalence relation in a set X . Then:
1. If x, y ∈ X and y ∈ [[x]]∼ then [[x]]∼ = [[y ]]∼ .
2. The family {[[x]]∼ | x ∈ X } is a partition of X .
The set
Zn = {[[x]]n | x ∈ Z}
is called the set of integers modulo n.
Zn has precisely n different elements: [[0]]n , [[1]]n ..., [[n − 1]]n .
Hereafter we will denote them by [0]n , [1]n ..., [n − 1]n , i.e.
Thus,
[[x]]n = [a]n iff a = (x rem n).
The set
Zn = {[[x]]n | x ∈ Z}
is called the set of integers modulo n.
Zn has precisely n different elements: [[0]]n , [[1]]n ..., [[n − 1]]n .
Hereafter we will denote them by [0]n , [1]n ..., [n − 1]n , i.e.
Thus,
[[x]]n = [a]n iff a = (x rem n).
The set
Zn = {[[x]]n | x ∈ Z}
is called the set of integers modulo n.
Zn has precisely n different elements: [[0]]n , [[1]]n ..., [[n − 1]]n .
Hereafter we will denote them by [0]n , [1]n ..., [n − 1]n , i.e.
Thus,
[[x]]n = [a]n iff a = (x rem n).
The set
Zn = {[[x]]n | x ∈ Z}
is called the set of integers modulo n.
Zn has precisely n different elements: [[0]]n , [[1]]n ..., [[n − 1]]n .
Hereafter we will denote them by [0]n , [1]n ..., [n − 1]n , i.e.
Thus,
[[x]]n = [a]n iff a = (x rem n).
The set
Zn = {[[x]]n | x ∈ Z}
is called the set of integers modulo n.
Zn has precisely n different elements: [[0]]n , [[1]]n ..., [[n − 1]]n .
Hereafter we will denote them by [0]n , [1]n ..., [n − 1]n , i.e.
Thus,
[[x]]n = [a]n iff a = (x rem n).
The set
Zn = {[[x]]n | x ∈ Z}
is called the set of integers modulo n.
Zn has precisely n different elements: [[0]]n , [[1]]n ..., [[n − 1]]n .
Hereafter we will denote them by [0]n , [1]n ..., [n − 1]n , i.e.
Thus,
[[x]]n = [a]n iff a = (x rem n).
The set
Zn = {[[x]]n | x ∈ Z}
is called the set of integers modulo n.
Zn has precisely n different elements: [[0]]n , [[1]]n ..., [[n − 1]]n .
Hereafter we will denote them by [0]n , [1]n ..., [n − 1]n , i.e.
Thus,
[[x]]n = [a]n iff a = (x rem n).
The set
Zn = {[[x]]n | x ∈ Z}
is called the set of integers modulo n.
Zn has precisely n different elements: [[0]]n , [[1]]n ..., [[n − 1]]n .
Hereafter we will denote them by [0]n , [1]n ..., [n − 1]n , i.e.
Thus,
[[x]]n = [a]n iff a = (x rem n).
The set
Zn = {[[x]]n | x ∈ Z}
is called the set of integers modulo n.
Zn has precisely n different elements: [[0]]n , [[1]]n ..., [[n − 1]]n .
Hereafter we will denote them by [0]n , [1]n ..., [n − 1]n , i.e.
Thus,
[[x]]n = [a]n iff a = (x rem n).
Modular arithmetic
[[x]]n = [[y ]]n iff x and y leave the same remainders modulo n.
There are precisely n possible remainders modulo n :
0, 1, ..., n − 1
Zn has precisely n different elements:
Thus:
Example
In Z6 :
[2]6 ⊕6 [5]6 = [[2 + 5]]6 = [[7]]6 = [1]6 ;
[3]6 6 [4]6 = [[3.4]]6 = [[12]]6 = [0]6 .
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Lemma
For any positive integer n :
1. n integers form a complete residue system modulo n if and
only if no two of them are congruent modulo m.
2. If {x1 , . . . , xn } is a complete residue system modulo n then
for any integer a, {x1 + a, . . . , xn + a} is a complete
residue system modulo n, too.
3. If {x1 , . . . , xn } is a complete residue system modulo n then
for any integer a, {ax1 , . . . , axn } is a complete residue
system modulo n iff gcd(a, n) = 1.
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Multiplicative inverses in Zn
For any element [a]n ∈ Zn :
[a]n ⊕ [n − a]n = [n − a]n ⊕ [a]n = [0]n ,
i.e. [n − a]n is an additive inverse of [a]n in Zn .
An element [b]n is a multiplicative inverse of [a]n in Zn if
Theorem
[a]n has a multiplicative inverse in Zn iff gcd(a, n) = 1.
E XAMPLE . In Z6 : [5]6 has a multiplicative inverse (which?)
but [4]6 does not have one.
Corollary
Given an integer n > 1, the element [a]n ∈ Zn has a
multiplicative inverse for every 0 < a < n iff n is prime.
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Multiplicative inverses in Zn
For any element [a]n ∈ Zn :
[a]n ⊕ [n − a]n = [n − a]n ⊕ [a]n = [0]n ,
i.e. [n − a]n is an additive inverse of [a]n in Zn .
An element [b]n is a multiplicative inverse of [a]n in Zn if
Theorem
[a]n has a multiplicative inverse in Zn iff gcd(a, n) = 1.
E XAMPLE . In Z6 : [5]6 has a multiplicative inverse (which?)
but [4]6 does not have one.
Corollary
Given an integer n > 1, the element [a]n ∈ Zn has a
multiplicative inverse for every 0 < a < n iff n is prime.
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Multiplicative inverses in Zn
For any element [a]n ∈ Zn :
[a]n ⊕ [n − a]n = [n − a]n ⊕ [a]n = [0]n ,
i.e. [n − a]n is an additive inverse of [a]n in Zn .
An element [b]n is a multiplicative inverse of [a]n in Zn if
Theorem
[a]n has a multiplicative inverse in Zn iff gcd(a, n) = 1.
E XAMPLE . In Z6 : [5]6 has a multiplicative inverse (which?)
but [4]6 does not have one.
Corollary
Given an integer n > 1, the element [a]n ∈ Zn has a
multiplicative inverse for every 0 < a < n iff n is prime.
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Multiplicative inverses in Zn
For any element [a]n ∈ Zn :
[a]n ⊕ [n − a]n = [n − a]n ⊕ [a]n = [0]n ,
i.e. [n − a]n is an additive inverse of [a]n in Zn .
An element [b]n is a multiplicative inverse of [a]n in Zn if
Theorem
[a]n has a multiplicative inverse in Zn iff gcd(a, n) = 1.
E XAMPLE . In Z6 : [5]6 has a multiplicative inverse (which?)
but [4]6 does not have one.
Corollary
Given an integer n > 1, the element [a]n ∈ Zn has a
multiplicative inverse for every 0 < a < n iff n is prime.
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Multiplicative inverses in Zn
For any element [a]n ∈ Zn :
[a]n ⊕ [n − a]n = [n − a]n ⊕ [a]n = [0]n ,
i.e. [n − a]n is an additive inverse of [a]n in Zn .
An element [b]n is a multiplicative inverse of [a]n in Zn if
Theorem
[a]n has a multiplicative inverse in Zn iff gcd(a, n) = 1.
E XAMPLE . In Z6 : [5]6 has a multiplicative inverse (which?)
but [4]6 does not have one.
Corollary
Given an integer n > 1, the element [a]n ∈ Zn has a
multiplicative inverse for every 0 < a < n iff n is prime.
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Multiplicative inverses in Zn
For any element [a]n ∈ Zn :
[a]n ⊕ [n − a]n = [n − a]n ⊕ [a]n = [0]n ,
i.e. [n − a]n is an additive inverse of [a]n in Zn .
An element [b]n is a multiplicative inverse of [a]n in Zn if
Theorem
[a]n has a multiplicative inverse in Zn iff gcd(a, n) = 1.
E XAMPLE . In Z6 : [5]6 has a multiplicative inverse (which?)
but [4]6 does not have one.
Corollary
Given an integer n > 1, the element [a]n ∈ Zn has a
multiplicative inverse for every 0 < a < n iff n is prime.
Equivalence relations and partitions Equivalence classes modulo n Residue systems
Multiplicative inverses in Zn
For any element [a]n ∈ Zn :
[a]n ⊕ [n − a]n = [n − a]n ⊕ [a]n = [0]n ,
i.e. [n − a]n is an additive inverse of [a]n in Zn .
An element [b]n is a multiplicative inverse of [a]n in Zn if
Theorem
[a]n has a multiplicative inverse in Zn iff gcd(a, n) = 1.
E XAMPLE . In Z6 : [5]6 has a multiplicative inverse (which?)
but [4]6 does not have one.
Corollary
Given an integer n > 1, the element [a]n ∈ Zn has a
multiplicative inverse for every 0 < a < n iff n is prime.