• Keine Ergebnisse gefunden

Examples from modular arithmetic

2. A closer look at induction

2.2. Examples from modular arithmetic

2.2.1. Divisibility of integers

We shall soon give some more examples of inductive proofs, including some that will include slightly new tactics. These examples come from the realm of modular arithmetic, which is the study of congruences modulo integers. Before we come to these examples, we will introduce the definition of such congruences. But first, let us recall the definition of divisibility:

Definition 2.4. Let u and v be two integers. Then, we say that u divides v if and only if there exists an integer w such thatv = uw. Instead of saying “u divides v”, we can also say “v isdivisible by u” or “v is amultipleof u” or “u is adivisor

Definition 2.4 is fairly common in the modern literature (e.g., it is used in [Day16], [LeLeMe16], [Mulhol16] and [Rotman15]), but there are also some books that define these notations differently. For example, in [GrKnPa94], the notation “u dividesv”

is defined differently (it requires not only the existence of an integer w such that v = uw, but also that u is positive), whereas the notation “v is a multiple of u”

is defined as it is here (i.e., it just means that there exists an integer w such that v=uw); thus, these two notations are not mutually interchangeable in [GrKnPa94].

Let us first prove some basic properties of divisibility:

Proposition 2.5. Let a, b and c be three integers such that a | b and b | c. Then, a| c.

Proof of Proposition 2.5. We have a| b. In other words, there exists an integerwsuch that b = aw (by the definition of “divides”). Consider this w, and denote it by k.

Thus, kis an integer such thatb =ak.

We haveb | c. In other words, there exists an integer w such that c =bw(by the definition of “divides”). Consider this w, and denote it by j. Thus, j is an integer such thatc =bj.

Now,c= b

|{z}

=ak

j =akj. Hence, there exists an integerwsuch thatc =aw(namely, w=kj). In other words,adividesc(by the definition of “divides”). In other words, a |c. This proves Proposition 2.5.

Proposition 2.6. Let a, band c be three integers such that a| b. Then, ac| bc.

Proof of Proposition 2.6. We have a| b. In other words, there exists an integerwsuch that b = aw (by the definition of “divides”). Consider this w, and denote it by k.

Thus,k is an integer such thatb =ak. Hence, b

|{z}

=ak

c =akc =ack. Thus, there exists an integer w such that bc = acw (namely, w = k). In other words, ac divides bc (by the definition of “divides”). In other words, ac | bc. This proves Proposition 2.6.

Proposition 2.7. Let a, b, g, x and y be integers such that g = ax+by. Let d be an integer such thatd | aand d| b. Then, d| g.

Proof of Proposition 2.7. We haved |a. In other words, there exists an integerwsuch that a = dw (by the definition of “divides”). Consider this w, and denote it by p.

Thus, pis an integer and satisfies a =dp.

Similarly, there is an integerq such thatb =dq. Consider thisq.

Now, g = a

|{z}

=dp

x+ b

|{z}

=dq

y = dpx+dqy = d(px+qy). Hence, there exists an integer w such that g = dw (namely, w = px+qy). In other words, d | g (by the definition of “divides”). This proves Proposition 2.7.

It is easy to characterize divisibility in terms of fractions:

Proposition 2.8. Let a and b be two integers such that a 6=0. Then, a | b if and only if b/ais an integer.

Proof of Proposition 2.8. We first claim the following logical implication40:

(a| b) =⇒ (b/a is an integer). (45) [Proof of (45): Assume that a | b. In other words, there exists an integer w such that b = aw (by the definition of “divides”). Consider this w. Now, dividing the equality b = aw by a, we obtain b/a = w (since a 6= 0). Hence, b/a is an integer (sincewis an integer). This proves the implication (45).]

Next, we claim the following logical implication:

(b/ais an integer) =⇒ (a| b). (46) [Proof of (46): Assume that b/a is an integer. Let k denote this integer. Thus, b/a =k, so that b =ak. Hence, there exists an integerwsuch that b= aw(namely, w=k). In other words,adividesb(by the definition of “divides”). In other words, a |b. This proves the implication (46).]

Combining the implications (45) and (46), we obtain the equivalence(a| b) ⇐⇒

(b/a is an integer). In other words,a| bif and only ifb/ais an integer. This proves Proposition 2.8.

2.2.2. Definition of congruences We can now define congruences:

Definition 2.9. Let a, b and nbe three integers. Then, we say that a is congruent to b modulo n if and only if n | a−b. We shall use the notation “a ≡ bmodn”

for “a is congruent to b modulo n”. Relations of the form “a ≡ bmodn” (for integers a,b and n) are calledcongruences modulo n.

Thus, three integersa, b and nsatisfy a≡bmodnif and only ifn | a−b.

Hence, in particular:

• Any two integersaandbsatisfy a≡bmod 1. (Indeed, any two integers aand b satisfy a−b =1(a−b), thus 1| a−b, thus a≡bmod 1.)

• Two integers a and b satisfy a ≡ bmod 0 if and only if a = b. (Indeed, a ≡bmod 0 is equivalent to 0| a−b, which in turn is equivalent toa−b =0, which in turn is equivalent toa =b.)

• Two integers a and b satisfy a ≡ bmod 2 if and only if they have the same parity (i.e., they are either both odd or both even). This is not obvious at this point yet, but follows from Proposition 2.159 further below.

40Alogical implication(or, short,implication) is a logical statement of the form “ifA, thenB” (where AandBare two statements).

We have

4≡10 mod 3 and 5≡ −35 mod 4.

Note that Day, in [Day16], writes “a ≡n b” instead of “a ≡ bmodn”. Also, other authors (particularly of older texts) write “a ≡ b (mod n)” instead of “a ≡ bmodn”.

Let us next introduce notations for the negations of the statements “u | v” and

“a ≡bmodn”:

Definition 2.10. (a) If u and v are two integers, then the notation “u - v” shall mean “not u| v” (that is, “u does not dividev”).

(b)If a,b and nare three integers, then the notation “a 6≡bmodn” shall mean

“not a≡bmodn” (that is, “a is not congruent tob modulo n”).

Thus, three integers a, b and n satisfy a 6≡ bmodn if and only if n - a−b. For example, 16≡ −1 mod 3, since 3-1−(−1).

2.2.3. Congruence basics

Let us now state some of the basic laws of congruences (so far, not needing induc-tion to prove):

Proposition 2.11. Let aand nbe integers. Then:

(a)We have a≡0 modnif and only ifn | a.

(b)Let b be an integer. Then,a ≡bmodnif and only if a≡bmod(−n). (c)Let m andb be integers such that m| n. If a≡bmodn, thena ≡bmodm.

Proof of Proposition 2.11. (a)We have the following chain of logical equivalences:

(a ≡0 modn)

⇐⇒ (a is congruent to 0 modulon)

(since “a ≡0 modn” is just a notation for “ais congruent to 0 modulon”)

⇐⇒ n| a−0

| {z }

=a

!

(by the definition of “congruent”)

⇐⇒ (n| a).

Thus, we have a≡0 modnif and only ifn | a. This proves Proposition 2.11(a).

(b) Let us first assume that a ≡ bmodn. Thus, a is congruent to b modulo n.

In other words, n | a−b (by the definition of “congruent”). In other words, n dividesa−b. In other words, there exists an integerwsuch thata−b =nw(by the definition of “divides”). Consider this w, and denote it by k. Thus,k is an integer such that a−b =nk.

Thus, a−b = nk = (−n) (−k). Hence, there exists an integer w such that a−b = (−n)w (namely, w = −k). In other words, −n divides a−b (by the

definition of “divides”). In other words, −n| a−b. In other words, a is congruent tobmodulo−n(by the definition of “congruent”). In other words,a ≡bmod(−n).

Now, forget that we assumed that a≡bmodn. We thus have shown that

if a≡bmodn, thena ≡bmod(−n). (47) The same argument (applied to −ninstead ofn) shows that

if a ≡bmod(−n), thena ≡bmod(−(−n)). Since−(−n) = n, this rewrites as follows:

if a≡bmod(−n), then a≡bmodn.

Combining this implication with (47), we conclude that a ≡bmodn if and only if a ≡bmod(−n). This proves Proposition 2.11(b).

(c)Assume thata≡bmodn. Thus,ais congruent tobmodulon. In other words, n | a−b (by the definition of “congruent”). Hence, Proposition 2.5 (applied to m, n and a−b instead of a, b and c) yields m | a−b (since m | n). In other words, a is congruent tob modulom (by the definition of “congruent”). Thus, a≡bmodm.

This proves Proposition 2.11(c).

Proposition 2.12. Let n be an integer.

(a)For any integer a, we have a≡amodn.

(b)For any integers aand b satisfying a≡bmodn, we have b ≡amodn.

(c)For any integersa, bandcsatisfyinga ≡bmodnandb ≡cmodn, we have a≡cmodn.

Proof of Proposition 2.12. (a) Let a be an integer. Then, a−a = 0 = n·0. Hence, there exists an integer w such that a−a = nw (namely, w =0). In other words, n divides a−a (by the definition of “divides”). In other words, n | a−a. In other words, a is congruent to a modulo n (by the definition of “congruent”). In other words,a ≡amodn. This proves Proposition 2.12 (a).

(b) Let a and b be two integers satisfying a ≡ bmodn. Thus, a is congruent to b modulo n (since a ≡ bmodn). In other words, n | a−b (by the definition of “congruent”). In other words, n divides a−b. In other words, there exists an integer w such that a−b = nw (by the definition of “divides”). Consider this w, and denote it by q. Thus, q is an integer such that a−b = nq. Now, b−a =

−(a−b)

| {z }

=nq

= −nq = n(−q). Hence, there exists an integer w such that b−a = nw (namely, w =−q). In other words,n dividesb−a (by the definition of “divides”).

In other words, n | b−a. In other words, b is congruent to a modulo n (by the definition of “congruent”). In other words, b ≡ amodn. This proves Proposition 2.12(b).

(c)Let a, b and cbe three integers satisfying a≡bmodnand bcmodn.

Just as in the above proof of Proposition 2.12 (b), we can use the assumption a ≡ bmodn to construct an integer q such that a−b = nq. Similarly, we can use the assumptionb≡cmodnto construct an integerrsuch thatb−c=nr. Consider theseq and r.

Now,

a−c = (a−b)

| {z }

=nq

+ (b−c)

| {z }

=nr

=nq+nr =n(q+r).

Hence, there exists an integer wsuch that a−c =nw (namely,w =q+r). In other words, n divides a−c (by the definition of “divides”). In other words, n | a−c.

In other words,ais congruent to cmodulo n (by the definition of “congruent”). In other words,a ≡cmodn. This proves Proposition 2.12 (c).

Simple as they are, the three parts of Proposition 2.12 have names: Proposition 2.12(a)is called thereflexivity of congruence (modulo n); Proposition 2.12(b)is called thesymmetry of congruence (modulo n); Proposition 2.12(c)is called thetransitivity of congruence (modulo n).

Proposition 2.12(b)allows the following definition:

Definition 2.13. Let n, a and b be three integers. Then, we say that a and b are congruent modulo n if and only if a ≡ bmodn. Proposition 2.12 (b) shows that a and b actually play equal roles in this relation (i.e., the statement “a and b are congruent modulon” is equivalent to “b and aare congruent modulo n”).

Proposition 2.14. Let n be an integer. Then,n≡0 modn.

Proof of Proposition 2.14. We have n = n·1. Thus, there exists an integer w such that n = nw (namely, w = 1). Therefore, n | n (by the definition of “divides”).

Proposition 2.11(a)(applied to a=n) shows that we haven ≡0 modn if and only ifn| n. Hence, we haven ≡0 modn(sincen| n). This proves Proposition 2.14.

2.2.4. Chains of congruences

Proposition 2.12 shows that congruences (modulo n) behave like equalities – in that we can turn them around (since Proposition 2.12 (b) says that a ≡ bmodn implies b ≡amodn) and we can chain them together (by Proposition 2.12(c)) and in that every integer is congruent to itself (by Proposition 2.12 (a)). This leads to the following notation:

Definition 2.15. Ifa1,a2, . . . ,ak andnare integers, then the statement “a1 ≡a2

· · · ≡ akmodn” shall mean that

(ai ≡ai+1modnholds for each i ∈ {1, 2, . . . ,k−1}).

Such a statement is called a chain of congruences modulo n (or, less precisely, a chain of congruences). We shall refer to the integers a1,a2, . . . ,ak (but notn) as the members of this chain.

For example, the chain a ≡ b ≡ c ≡ dmodn (for five integers a,b,c,d,n) means that a≡bmodn and b≡cmodnand c≡dmodn.

The usefulness of such chains lies in the following fact:

Proposition 2.16. Let a1,a2, . . . ,ak and n be integers such that a1 ≡ a2 ≡ · · · ≡ akmodn. Let uand vbe two elements of{1, 2, . . . ,k}. Then,

au ≡ avmodn.

In other words, any two members of a chain of congruences modulo n are con-gruent to each other modulo n. Thus, chains of congruences are like chains of equalities: From any chain of congruences modulo n with k members, you can extractk2 congruences modulon by picking any two members of the chain.

Example 2.17. Proposition 2.16 shows (among other things) that if a,b,c,d,e,n are integers such that a ≡ b ≡ c ≡ d ≡ emodn, then a ≡ dmodn and b ≡ dmodn and e≡bmodn (and various other congruences).

Unsurprisingly, Proposition 2.16 can be proven by induction, although not in an immediately obvious manner: We cannot directly prove it by induction onn, onk, on uor on v. Instead, we will first introduce an auxiliary statement (the statement (49) in the following proof) which will be tailored to an inductive proof. This is a commonly used tactic, and particularly helpful to us now as we only have the most basic form of the principle of induction available. (Soon, we will see more versions of that principle, which will obviate the need for some of the tailoring.)

Proof of Proposition 2.16. By assumption, we have a1 ≡ a2 ≡ · · · ≡ akmodn. In other words,

(ai ≡ai+1modnholds for each i∈ {1, 2, . . . ,k−1}) (48) (since this is what “a1 ≡a2 ≡ · · · ≡ akmodn” means).

Fix p∈ {1, 2, . . . ,k}. For eachi ∈N, we let A(i) be the statement if p+i∈ {1, 2, . . . ,k}, then ap ≡ap+imodn

. (49)

We shall prove that this statementA(i) holds for eachi ∈N.

In fact, let us prove this by induction oni: 41

Induction base: The statementA(0) holds42. This completes the induction base.

Induction step: Let m ∈ N. Assume that A(m) holds. We must show that A(m+1) holds.

41Thus, the letter “i” plays the role of the “n” in Theorem 2.1 (since we are already using “n” for a different thing).

42Proof. Proposition 2.12(a) (applied toa = ap) yields ap apmodn. In view of p = p+0, this rewrites as ap ap+0modn. Hence, if p+0∈ {1, 2, . . . ,k}, thenapap+0modn

. But this is precisely the statementA(0). Hence, the statementA(0)holds.

We have assumed thatA(m) holds. In other words,

if p+m ∈ {1, 2, . . . ,k}, then ap ≡ap+mmodn

. (50)

Next, let us assume that p+ (m+1) ∈ {1, 2, . . . ,k}. Thus, p+ (m+1) ≤ k, so that p+m+1 = p+ (m+1) ≤ k and therefore p+m ≤ k−1. Also, p ∈ {1, 2, . . . ,k}, so that p ≥ 1 and thus p

|{z}1

+ m

|{z}0

1+0 = 1. Combining this with p+m ≤ k−1, we obtain p+m ∈ {1, 2, . . . ,k−1} ⊆ {1, 2, . . . ,k}. Hence, (50) shows that ap ≡ ap+mmodn. But (48) (applied to p+m instead of i) yields ap+m ≡ a(p+m)+1modn(since p+m∈ {1, 2, . . . ,k−1}).

So we know that ap ≡ ap+mmodn and ap+m ≡ a(p+m)+1modn. Hence, Propo-sition 2.12 (c) (applied to a = ap, b = ap+m and c = a(p+m)+1) yields ap ≡ a(p+m)+1modn. Since(p+m) +1= p+ (m+1), this rewrites asap ≡ap+(m+1)modn.

Now, forget that we assumed that p+ (m+1) ∈ {1, 2, . . . ,k}. We thus have shown that

if p+ (m+1)∈ {1, 2, . . . ,k}, then apap+(m+1)modn. But this is precisely the statementA(m+1). Thus, A(m+1) holds.

Now, forget that we fixed m. We thus have shown that if m ∈ N is such that A(m)holds, then A(m+1) also holds. This completes the induction step.

Thus, we have completed both the induction base and the induction step. Hence, by induction, we conclude that A(i) holds for each i ∈ N. In other words, (49) holds for eachi ∈ N.

We are not done yet, since our goal is to prove Proposition 2.16, not merely to proveA(i). But this is now easy.

First, let us forget that we fixed p. Thus, we have shown that (49) holds for each p∈ {1, 2, . . . ,k} andi ∈N.

But we have eitheru≤voru>v. In other words, we are in one of the following two cases:

Case 1: We haveu≤v.

Case 2: We haveu>v.

Let us first consider Case 1. In this case, we haveu ≤v. Thus, v−u ≥0, so that v−u∈ N. But recall that (49) holds for each p∈ {1, 2, . . . ,k} andi ∈N. Applying this to p = u and i = v−u, we conclude that (49) holds for p = u and i = v−u (sinceu∈ {1, 2, . . . ,k} andv−u∈ N). In other words,

if u+ (v−u) ∈ {1, 2, . . . ,k}, then au ≡au+(vu)modn . Sinceu+ (v−u) =v, this rewrites as

(ifv ∈ {1, 2, . . . ,k}, thenau ≡ avmodn).

Since v ∈ {1, 2, . . . ,k} holds (by assumption), we conclude that au ≡ avmodn.

Thus, Proposition 2.16 is proven in Case 1.

Let us now consider Case 2. In this case, we haveu >v. Thus, u−v>0, so that u−v∈ N. But recall that (49) holds for each p∈ {1, 2, . . . ,k} andi ∈N. Applying this to p = v and i = u−v, we conclude that (49) holds for p = v and i = u−v (sincev∈ {1, 2, . . . ,k} andu−v∈ N). In other words,

if v+ (u−v)∈ {1, 2, . . . ,k}, then av ≡av+(uv)modn . Sincev+ (u−v) =u, this rewrites as

(if u∈ {1, 2, . . . ,k}, then av ≡aumodn).

Since u ∈ {1, 2, . . . ,k} holds (by assumption), we conclude that av ≡ aumodn.

Therefore, Proposition 2.12 (b) (applied to a = av and b = au) yields that au ≡ avmodn. Thus, Proposition 2.16 is proven in Case 2.

Hence, Proposition 2.16 is proven in both Cases 1 and 2. Since these two Cases cover all possibilities, we thus conclude that Proposition 2.16 always holds.

2.2.5. Chains of inequalities (a digression)

Much of the above proof of Proposition 2.16 was unremarkable and straightforward reasoning – but this proof is nevertheless fundamental and important. More or less the same argument can be used to show the following fact about chains of inequalities:

Proposition 2.18. Let a1,a2, . . . ,ak be integers such that a1 ≤ a2 ≤ · · · ≤ ak. (Recall that the statement “a1 ≤ a2 ≤ · · · ≤ ak” means that (ai ≤ai+1 holds for each i∈ {1, 2, . . . ,k−1}).) Let u and v be two elements of {1, 2, . . . ,k} such thatu ≤v. Then,

au ≤av.

Proposition 2.18 is similar to Proposition 2.16, with the congruences replaced by inequalities; but note that the condition “u ≤ v” is now required. Make sure you understand where you need this condition when adapting the proof of Proposition 2.16 to Proposition 2.18!

For future use, let us prove a corollary of Proposition 2.18 which essentially observes that the inequality sign in au ≤av can be made strict if there is any strict inequality sign between au and av in the chain a1 ≤a2 ≤ · · · ≤ ak:

Corollary 2.19. Let a1,a2, . . . ,ak be integers such that a1 ≤ a2 ≤ · · · ≤ ak. Let u and v be two elements of {1, 2, . . . ,k} such that u ≤ v. Let p ∈ {u,u+1, . . . ,v−1}be such that ap <ap+1. Then,

au <av.

Proof of Corollary 2.19. Fromu∈ {1, 2, . . . ,k}, we obtainu≥1. Fromv ∈ {1, 2, . . . ,k}, we obtain v ≤ k. From p ∈ {u,u+1, . . . ,v−1}, we obtain p ≥ u and p ≤ v−1.

From p≤v−1, we obtain p+1≤v ≤k. Combining this with p+1 ≥ pu1, we obtain p+1 ∈ {1, 2, . . . ,k} (since p+1 is an integer). Combining p ≤ v−1 ≤ v ≤ k with p ≥ u ≥1, we obtain p ∈ {1, 2, . . . ,k} (since p is an integer). We thus know that both p and p+1 are elements of{1, 2, . . . ,k}.

We have p ≥ u, thus u ≤ p. Hence, Proposition 2.18 (applied to p instead of v) yieldsau ≤ap. Combining this with ap <ap+1, we find au <ap+1.

We havep+1≤v. Hence, Proposition 2.18 (applied to p+1 instead ofu) yields ap+1 ≤ av. Combining au < ap+1 with ap+1 ≤ av, we obtain au < av. This proves Corollary 2.19.

In particular, we see that the inequality sign inau ≤ avis strict when u<vholds andall inequality signs in the chaina1 ≤a2 ≤ · · · ≤ ak are strict:

Corollary 2.20. Let a1,a2, . . . ,ak be integers such that a1 < a2 < · · · <

ak. (Recall that the statement “a1 < a2 < · · · < ak” means that (ai <ai+1 holds for each i∈ {1, 2, . . . ,k−1}).) Let u and v be two elements of {1, 2, . . . ,k} such thatu <v. Then,

au <av.

Proof of Corollary 2.20. Fromu<v, we obtainu≤v−1 (sinceuandvare integers).

Combining this with u≥ u, we conclude thatu ∈ {u,u+1, . . . ,v−1}. Also, from a1<a2<· · · <ak, we obtaina1 ≤a2≤ · · · ≤ ak.

We haveu≤v−1, thusu+1≤v≤k (sincev∈ {1, 2, . . . ,k}), so that u≤k−1.

Combining this with u ≥ 1 (which is a consequence of u ∈ {1, 2, . . . ,k}), we find u ∈ {1, 2, . . . ,k−1}. Hence, froma1 <a2 < · · · <ak, we obtain au < au+1. Hence, Corollary 2.19 (applied to p=u) yields au <av (sinceu≤v (becauseu <v)). This proves Corollary 2.20.

2.2.6. Addition, subtraction and multiplication of congruences Let us now return to the topic of congruences.

Chains of congruences can include equality signs. For example, if a,b,c,d,n are integers, then “a ≡ b = c ≡ dmodn” means that a ≡ bmodn and b = c and c ≡ dmodn. Such a chain is still a chain of congruences, because b = c implies b ≡cmodn(by Proposition 2.12 (a)).

Let us continue with basic properties of congruences:

Proposition 2.21. Let a, b, c, d and n be integers such that a ≡ bmodn and c≡dmodn. Then:

(a)We have a+c ≡b+dmodn.

(b)We have a−c ≡b−dmodn.

(c)We have ac≡bdmodn.

Note that Proposition 2.21 does not claim that a/c ≡ b/dmodn. Indeed, this would not be true in general. One reason for this is thata/c andb/d aren’t always integers. But even when they are, they may not satisfy a/c ≡ b/dmodn. For ex-ample, 6 ≡4 mod 2 and 2 ≡ 2 mod 2, but 6/2 6≡ 4/2 mod 2. Likewise, Proposition 2.21 doesnotclaim thatac ≡bdmodneven when a,b,c,dare nonnegative; that too would not be true. But we will soon see that a weaker statement (Proposition 2.22) holds. First, let us prove Proposition 2.21:

Proof of Proposition 2.21. From a ≡ bmodn, we conclude that a is congruent to b modulo n. In other words, n | a−b (by the definition of “congruent”). In other words, ndivides a−b. In other words, there exists an integerw such that a−b = nw (by the definition of “divides”). Consider thisw, and denote it by q. Thus, q is an integer such thata−b=nq.

Similarly, from c ≡dmodn, we can construct an integer r such that c−d = nr.

Consider thisr.

(a)We have

(a+c)−(b+d) = (a−b)

| {z }

=nq

+ (c−d)

| {z }

=nr

=nq+nr =n(q+r).

Hence, there exists an integer w such that (a+c)−(b+d) = nw (namely, w = q+r). In other words, n divides (a+c)−(b+d) (by the definition of “divides”).

In other words, n | (a+c)−(b+d). In other words, a+c ≡ b+dmodn (by the definition of “congruent”). This proves Proposition 2.21 (a).

(b)We have

(a−c)−(b−d) = (a−b)

| {z }

=nq

−(c−d)

| {z }

=nr

=nq−nr =n(q−r).

Hence, there exists an integer w such that (a−c)−(b−d) = nw (namely, w = q−r). In other words, n divides (a−c)−(b−d) (by the definition of “divides”).

In other words, n | (a−c)−(b−d). In other words, a−c ≡ b−dmodn (by the definition of “congruent”). This proves Proposition 2.21 (b).

(c)We have ac−ad = a(c−d)

| {z }

=nr

= anr =n(ar). Hence, there exists an integer w such that ac−ad =nw (namely, w =ar). In other words,n dividesac−ad(by the definition of “divides”). In other words,n | ac−ad. In other words, ac≡admodn (by the definition of “congruent”).

We have ad−bd = (a−b)

| {z }

=nq

d = nqd = n(qd). Hence, there exists an integer w such thatad−bd=nw(namely, w=qd). In other words,ndivides ad−bd(by the definition of “divides”). In other words,n | ad−bd. In other words,ad ≡bdmodn (by the definition of “congruent”).

Now, we know that ac ≡ admodn and ad ≡ bdmodn. Hence, Proposition 2.12 (c) (applied to ac, ad and bdinstead of a, b and c) shows that ac ≡ bdmodn. This proves Proposition 2.21(c).

Proposition 2.21 shows yet another aspect in which congruences (modulo n) be-have like equalities: They can be added, subtracted and multiplied, in the following sense:

• We can add two congruences modulo n (in the sense of adding each side of one congruence to the corresponding side of the other); this yields a new congruence modulon (because of Proposition 2.21 (a)).

• We can subtract two congruences modulo n; this yields a new congruence modulo n(because of Proposition 2.21 (b)).

• We can multiply two congruences modulo n; this yields a new congruence modulo n(because of Proposition 2.21 (c)).

2.2.7. Substitutivity for congruences

Combined with Proposition 2.12, these observations lead to a further feature of congruences, which is even more important: the principle of substitutivity for con-gruences. We are not going to state it fully formally (as it is a meta-mathematical principle), but merely explain what it means.

Recall that theprinciple of substitutivity for equalities says the following:

Principle of substitutivity for equalities: If two objects43 xand x0 are equal, and if we have any expression Athat involves the object x, then we can replace this x (or, more precisely, any arbitrary appearance of x in A) in A by x0; the value of the resulting expression A0 will be equal to the value of A.

Here are two examples of how this principle can be used:

• Ifa,b,c,d,e,c0are numbers such thatc =c0, then the principle of substitutivity for equalities says that we can replacecbyc0in the expressiona(b−(c+d)e), and the value of the resulting expression a(b−(c0+d)e) will be equal to the value of a(b−(c+d)e); that is, we have

a(b−(c+d)e) = a b− c0+d e

. (51)

• Ifa,b,c,a0 are numbers such that a=a0, then (a−b) (a+b) = a0−b

(a+b), (52) because the principle of substitutivity allows us to replace the firsta appear-ing in the expression(a−b) (a+b) by ana0. (We can also replace the second a by a0, of course.)

43“Objects” can be numbers, sets, tuples or any other mathematical objects.

More generally, we can make several such replacements at the same time.

The principle of substitutivity for equalities is one of the headstones of mathe-matical logic; it is the essence of what it means for two objects to be equal.

Theprinciple of substitutivity for congruencesis similar, but far less fundamental; it says the following:

Principle of substitutivity for congruences: Fix an integern. If two numbers x and x0 are congruent to each other modulo n (that is, x ≡ x0modn), and if we have any expression A that involves only integers, addition,

Principle of substitutivity for congruences: Fix an integern. If two numbers x and x0 are congruent to each other modulo n (that is, x ≡ x0modn), and if we have any expression A that involves only integers, addition,