Congruence classes For given integer m 2, the congruence relation modulo m at the set Z is the equivalence relation, thus, it provides a corresponding partition of Z into mutually disjoint sets. Definition Let m N, m 2, a Z. The set a m = {b Z a b (mod m)} is called a-th congruence class modulo m. The set Z m = {0 m, 1 m,..., (m 1) m } is called the ring of integers modulo m. Example For m = 2, Z 2 consists of two sets 0 2 a 1 2, which represent all even and all odd numbers; Z 3 = {0 3, 1 3, 2 3 } consists of three sets: the numbers divisible by 3 and the numbers givign the remainder 1 resp. 2 after division by 3.
From the opint of view of abstract algebra, the congruence classes can be considered as certain number-like objects, thus, one may define for them the equality relation and the operations of sum and product. Lemma For any a, b Z, m N, a m = b m if and only if a b (mod m).
Definition Let m N, m 2. Define, on Z m, the sum of congruence classes in the following way: a m b m = (a + b) m. Note: the operation + at right handside of this equality is the sum of integers (yielding again an integer, which determines certain congruence class); on the left handside is the "sum" of sets. The properties of : commutativity: ( a m, b m Z m ) a m b m = b m a m associativity: ( a m, b m, c m Z m ) (a m b m ) c m = a m (b m c m ) ( 0 m Z m )( a m Z m ) a m 0 m = a m ( a m Z m )( b m Z m ) a m b m = 0 m
Definition Let m N, m 2. Define, on Z m, the product of congruence classes in the following way: a m b m = (a b) m. Note: the operation on the right handside of given equality is the product of integers; on the left handside is the "product" of sets. The properties of : commutativity: ( a m, b m Z m ) a m b m = b m a m associativity: ( a m, b m, c m Z m ) (a m b m ) c m = a m (b m c m ) ( 1 m Z m )( a m Z m ) a m 1 m = a m ( a m, b m, c m Z m ) a m (b m c m ) = (a m b m ) (a m c m ) ( a m, b m, c m Z m ) (a m b m ) c m = (a m c m ) (b m c m )
For every two integers a, b it follows that if a b = 0, then a or b is equal 0. The congruence classes behave differently: Theorem Let m N, m 2. Then, in Z m, ( a m, b m Z m ) a m b m = 0 m (a m = 0 m b m = 0 m ) if and only if m is prime. Proof: For forward implication, the proof is indirect - let m > 1 be composite integer. Then m = a b, where 1 < a, b < m. From this we obtain 0 m = m m = (a b) m = a m b m ; nevertheless, from inequalities 1 < a, b < m it follows that a m 0 m, b m 0 m. To prove the backward implication, suppose that m is a prime and a m b m = 0 m. This yields (a b) m = 0 m, thus ab 0 (mod m), which implies that m ab. Hence, one has to have m a or m b; this means that a 0 (mod m) or b 0 (mod m), thus a m = 0 m or b m = 0 m.
For every integer m 2 and for every congruence class a m Z m, there exists "negative" congruence class ( a) m such that a m + ( a) m = 0 m ; thus, with the summation of congruence classes (using the operation ), it is also possible to define their subtraction, which has similar properties as the subtraction of common numbers. On the other hand, sometimes it is not possible to define, for congruence classes, the operation of division in such a way it would be similar to division of real numbers: Example In Z 5, each "nonzero" congruence class a 5 has its "reciprocal" such that their product is equal to 1 5 : 1 5 1 5 = 1 5, 2 5 3 5 = 1 5, 4 5 4 5 = 1 5 (hence 1 5, 4 5 are reciprocals themselves, 2 5 is reciprocal to 3 5 and vice versa). However, in Z 6, the congruence class 2 6 has no reciprocal: 2 6 1 6 = 2 6, 2 6 2 6 = 4 6, 2 6 3 6 = 0 6, 2 6 4 6 = 2 6, 2 6 5 6 = 4 6.
Theorem Let m N, m 2. Then, in Z m, ( a m Z m, a m 0 m )( b m Z m ) a m b m = 1 m holds if and only if m is prime. Thus, if m is prime, then Z m, together with operations, has similar properties as the set of real (or rational) numbers with standard operations +, ; we then say that triples (Z m,, ) and (R, +, ) form so called field.
Definition Let X be any set and, X X X be binary operations on X. The triple (X,, ) is called field, if the following axioms hold: commutativity of : ( a, b X) a b = b a associativity of : ( a, b, c X) (a b) c = a (b c) existence of zero element for : ( 0 X)( a X) a 0 = a existence of opposite ("negative") element for : ( a X)( b X) a b = 0 commutativity of : ( a, b X) a b = b a associativity of : ( a, b, c X) (a b) c = a (b c) existence of unit element for : ( 1 X)( a X) a 1 = a
Definition Definition (cont.) the existence of inverse element ("reciprocal") for : ( a X, a 0)( b X) a b = 1 left-distributivity of over : ( a, b, c X) a (b c) = (a b) (a c) right distributivity of over : ( a, b, c X) (a b) c = (a c) (b c)
Example Let X = {0, 1, a, b} and let the operations be given by the following tables: 0 1 a b 0 0 0 0 0 1 0 1 a b a 0 a b 1 b 0 b 1 a 0 1 a b 0 0 1 a b 1 1 0 b a a a b 0 1 b b a 1 0 The triple (X,, ) is 4-element finite field (the validity of particular axioms can be checked using the computer). Notice that the operation differs from the operation of the sum of congruence classes in Z 4.