Home page for accesible maths 5 Congruences

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

5.1 Introduction to congruences

We begin with the formal definition of the notion at the heart of this chapter.

Definition 5.1.1

Given a,b∈ℤa,b\in\mathbb{Z} and m∈ℕm\in\mathbb{N}, we say that aa is congruent to bb modulo mm if mm divides a-ba-b. In this case we write a≡bmodma\equiv b\bmod m; otherwise we write a≢bmodma\not\equiv b\bmod m.

A statement of the form ‘‘a≡bmodma\equiv b\bmod m’’ is called a congruence; the number mm is called the modulus here.

Example 5.1.2
  1. (i)

    We have 7≡2mod57\equiv 2\bmod 5 because 5|(7-2).5|(7-2).

  2. (ii)

    We have -10≡8mod6-10\equiv 8\bmod 6 because 6|(-10-8).6|(-10-8).

  3. (iii)

    We have 20≡0mod220\equiv 0\bmod 2 because 2|(20-0).2|(20-0).

  4. (iv)

    We have 3≢8mod23\not\equiv 8\bmod 2 because 2|(3-8).2\!\!\!\!\;\not\!\!\!\;|\!\;(3-8).

The following result gives two alternative ways of expressing that a≡bmodma\equiv b\bmod m.

Proposition 5.1.3

For a,b∈ℤa,b\in\mathbb{Z} and m∈ℕm\in\mathbb{N}, the following three conditions are equivalent:

  1. (a)

    a≡bmodma\equiv b\bmod m;

  2. (b)

    a=q⁢m+ba=qm+b for some q∈ℤq\in\mathbb{Z};

  3. (c)

    aa and bb have the same remainder on division by mm.

Example 5.1.4

If a=28a=28, b=13b=13 and m=5m=5, then we have

  1. (a)

    28≡13mod528\equiv 13\bmod 5 because 5|(28-13);5|(28-13);

  2. (b)

    28=3⋅5+1328=3\cdot 5+13, so we can take q=3;q=3;

  3. (c)

    28=5⋅5+328=5\cdot 5+3 and 13=2⋅5+313=2\cdot 5+3, so 2828 and 1313 both have remainder 33 on division by 55.

Proof. We shall show that each condition implies the next (and the last implies the first).

‘‘(a)⇒\Rightarrow(b)’’. If a≡bmodma\equiv b\bmod m, then a-b=q⁢ma-b=qm for some q∈ℤq\in\mathbb{Z}, and so a=q⁢m+b.a=qm+b.

‘‘(b)⇒\Rightarrow(c)’’. Suppose that a=q⁢m+ba=qm+b, and let the remainder on dividing bb by mm be rr, so that b=s⁢m+rb=sm+r for some s∈ℤs\in\mathbb{Z}. Then we have

a=q⁢m+(s⁢m+r)=(q+s)⁢m+ra=qm+(sm+r)=(q+s)m+r

which shows that the remainder on dividing aa by mm is also r.r.

‘‘(c)⇒\Rightarrow(a)’’. If both aa and bb have remainder rr on division by mm, then we can write a=p⁢m+ra=pm+r and b=q⁢m+rb=qm+r for some p,q∈ℤp,q\in\mathbb{Z}; thus

a-b=(p⁢m+r)-(q⁢m+r)=(p-q)⁢m,a-b=(pm+r)-(qm+r)=(p-q)m,

and so m|(a-b).m|(a-b). □\Box

Corollary 5.1.5

Let a∈ℤa\in\mathbb{Z} and m∈ℕm\in\mathbb{N}.

  1. (i)

    The numbers congruent to aa modulo mm are

    …,a-2⁢m,a-m,a,a+m,a+2⁢m,…\dots,a-2m,a-m,a,a+m,a+2m,\dots
  2. (ii)

    If the remainder on dividing aa by mm is rr, then a≡rmodma\equiv r\bmod m, and rr is the only integer in {0,1,2,…,m-1}\{0,1,2,\ldots,m-1\} which is congruent to aa modulo mm.

Example 5.1.6
  1. (i)

    The numbers congruent to 22 modulo 55 are

    …,-8,-3,2,7,12,…\dots,-8,-3,2,7,12,\dots
  2. (ii)

    The remainder on dividing 2222 by 55 is 22, so that 22≡2mod522\equiv 2\bmod 5, and 22 is clearly the only integer in {0,1,2,3,4}\{0,1,2,3,4\} which is congruent to 2222 modulo 55.

Proof. (i). This is clear from Proposition 5.1.3(b).

(ii). Proposition 5.1.3(c) shows that a≡rmodma\equiv r\bmod m. The uniqueness of rr follows from the uniqueness of the remainder in Theorem 4.1.8. □\Box

The congruence a≡bmodma\equiv b\bmod m looks a little like the equation a=ba=b, and we shall see that it behaves in a somewhat similar fashion.

Lemma 5.1.7

Let a,b,c∈ℤa,b,c\in\mathbb{Z} and m∈ℕm\in\mathbb{N}, and suppose that a≡bmodma\equiv b\bmod m. Then

b≡amodm,  a+c≡b+cmodm  𝑎𝑛𝑑  a⁢c≡b⁢cmodm.b\equiv a\bmod m,\qquad a+c\equiv b+c\bmod m\qquad\hbox{and}\qquad ac\equiv bc% \bmod m.
Example 5.1.8

Since -3≡7mod5-3\equiv 7\bmod 5, we have 7≡-3mod57\equiv-3\bmod 5,

-1=-3+2≡7+2=9mod5,-1=-3+2\equiv 7+2=9\bmod 5,

and -6=(-3)⁢2≡7⋅2=14mod5-6=(-3)2\equiv 7\cdot 2=14\bmod 5.

Proof. If mm divides a-ba-b, then mm also divides b-ab-a, (a+c)-(b+c)=a-b(a+c)-(b+c)=a-b and a⁢c-b⁢c=(a-b)⁢c.ac-bc=(a-b)c. □\Box

Lemma 5.1.9

Suppose that a≡bmodma\equiv b\bmod m and b≡cmodmb\equiv c\bmod m, where a,b,c∈ℤa,b,c\in\mathbb{Z} and m∈ℕm\in\mathbb{N}. Then a≡cmodma\equiv c\bmod m.

Example 5.1.10

Since -3≡7mod5-3\equiv 7\bmod 5 and 7≡2mod57\equiv 2\bmod 5, we have -3≡2mod5-3\equiv 2\bmod 5.

Proof. By assumption, mm divides a-ba-b and b-cb-c, and so Lemma 4.2.13 implies that mm divides (a-b)+(b-c)=a-c.(a-b)+(b-c)=a-c. □\Box