From f1aefb80d264cd5f7d60d7a018abcb6664db9762 Mon Sep 17 00:00:00 2001 From: tomit4 Date: Sat, 22 Aug 2026 19:59:01 -0700 Subject: [PATCH] :construction: Setup for 8.4 --- chapter_8/exercises.md | 267 +++++++++++++++++++++ chapter_8/notes.md | 466 +++++++++++++++++++++++++++++++++++++ chapter_8/test_yourself.md | 42 ++++ 3 files changed, 775 insertions(+) diff --git a/chapter_8/exercises.md b/chapter_8/exercises.md index bc57b17..4f217a6 100644 --- a/chapter_8/exercises.md +++ b/chapter_8/exercises.md @@ -4009,3 +4009,270 @@ Omitted. g. What _are_ you? (Do not answer this on paper; just think about it.) Omitted. + +--- + +Page 567 + +**Exercise Set 8.4** + +1. + +a. Use the Caesar cipher to encrypt the message WHERE SHALL WE MEET. + +b. Use the Caesar cipher to decrypt the message LQ WKH FDIHWHULD. + +2. + +a. Use the Caesar cipher to encrypt the message AN APPLE A DAY. + +b. Use the Caesar cipher to decrypt the message NHHSV WKH GRFWRU DZDB. + +3. Let $a = 25, $b = 19$, and $n = 3$. + +a. Verify that $3 | (25 - 19)$. + +b. Explain why $25 \equiv 19 (\mod 3)$. + +c. What value of $k$ has the property that $25 = 19 + 3k$? + +d. What is the (nonnegative) remainder obtained when $25$ is divided by $3$? +When $19$ is divided by $3$? + +e. Explain why $25 \mod 3 = 19 \mod 3$. + +4. Let $a = 68$, $b = 33$, and $n = 7$. + +a. Verify that $7 | (68 - 33)$. + +b. Explain why $68 \equiv 33(\mod 7)$. + +c. What value of $k$ has the property that $68 = 33 + 7k$? + +d. What is the (nonnegative) remainder obtained when $68$ is divided by $7$? +When $33$ is divided by $7$? + +e. Explain why $68 \mod 7 = 33 \mod 7$. + +5. Prove the transitivity of modular congruence. That is, prove that for all + integers $a$, $b$, $c$, and $n$ with $n > 1$, if $a \equiv b(\mod n)$ and + $b \equiv c(\mod n)$ then $a \equiv c(\mod n)$. + +6. Prove that the distinct equivalence classes of the relation of congruence + modulo $n$ are the sets $[0], [1], [2], \dots, [n - 1]$, where for each + $a = 0, 1, 2, \dots, n - 1$, + +$$ [a] = \{m \in \mathbb{Z} | m \equiv a (\mod n)\} $$ + +7. Verify the following statements. + +a. $128 \equiv 2(\mod 7)$ and $61 \equiv 5(\mod 7)$ + +b. $(128 + 61) \equiv (2 + 5)(\mod 7)$ + +c. $(128 - 61) \equiv (2 - 5)(\mod 7)$ + +d. $(128 \cdot 61) \equiv (2 \cdot 5)(\mod 7)$ + +e. $128^2 = 2^2(\mod 7)$ + +8. Verify the following statements. + +a. $45 \equiv 3(\mod 6)$ and $104 \equiv 2(\mod 6)$ + +b. $(45 + 104) \equiv (3 + 2)(\mod 6)$ + +c. $(45 - 104) \equiv (3 - 2)(\mod 6)$ + +d. $(45 \cdot 104) \equiv (3 \cdot 2)(\mod 6)$ + +e. $45^2 \equiv 3^2(\mod 6)$ + +In 9-11, prove each of the following statements, assuming that $a$, $b$, $c$, +$d$, and $n$ are integers with $n > 1$ and that $a \equiv c(\mod n)$ and +$b \equiv d(\mod n)$. + +9. + +a. $(a + b) \equiv (c + d)(\mod n)$ + +b. $(a - b) \equiv (c - d)(\mod n)$ + +10. $a^2 \equiv c^2(\mod n$ + +11. $a^m \equiv c^m(\mod n)$ for every integer $m \geq 1$ (Use mathematical + induction on $m$.) + +12. + +a. Prove that for every integer $n \geq 0$, $10^n \equiv 1(\mod 9)$. + +b. Use part (a) to prove that a positive integer is divisible by $9$ if, and +only if, the sum of its digits is divisible by $9$. + +13. + +a. Prove that for every integer $n \geq 1$, $10^n \equiv (-1)^n(\mod 11)$ . + +b. Use part (a) to prove that a positive integer is divisible by $11$ if, and +only if, the alternating sum of its digits is divisible by $114. (For instance, +the alternating sum of the digits of $82,379$ is $8 - 2 + 3 - 7 + 9 = 11$ and +$82,379 = 11 \cdot 7489$.) + +14. Use the technique of Example 8.4.4 to find $14^2 \mod 55$, $14^4 \mod 55$, + $14^8 \mod 55$, and $14^{16} \mod 55$. + +15. Use the result of exercise 14 and the technique of Example 8.4.5 to find + $14^{27} \mod 55$. + +In 16-18, use the techniques of Example 8.4.4 and Example 8.4.5 to find the +given numbers. + +16. $675^{307} \mod 713$ + +17. $89^{307} \mod 713$ + +18. $48^{307} \mod 713$ + +In 19-24, use the RSA cipher from Examples 8.4.9 and 8.4.10. In 19-21, translate +the message into its numeric equivalent and encrypt it. In 22-24, decrypt the +cipher-text and translate the result into letters of the alphabet to discover +the message. + +19. HELLO + +20. WELCOME + +21. EXCELLENT + +22. 13 20 20 09 + +23. 08 05 15 + +24. 51 14 49 15 + +25. Use Theorem 5.2.2 to prove that if $a$ and $n$ are positive integers and + $a^{n - 1}$ is prime, then $a = 2$ and $n$ is prime. + +In 26 and 27, use the extended Euclidean algorithm to find the greatest common +divisor of the given numbers and express it as a linear combination of the two +numbers. + +26. 6664 and 765 + +27. 4158 and 1568 + +Exercises 28 and 29 refer to the following formal version of the extended +Euclidean algorithm. + +**Algorithm 8.4.1 Extended Euclidean Algorithm** + +_[Given integers $A$ and $B$ with $A > B > 0$, this algorithm computes +$\text{gcd}(A, B) and finds integers $s$ and $t$ such that +$sA + tB = \text{gcd}(A, B)$.]_ + +**Input:** $A$, $B$ _[integers with $A > B > 0$]_ + +**Algorithm Body:** + +$a := A, b := B, s := 1, t := 0, u := 0, v := 1\\ \textit{[pre-codndition: } a = +sA + tB \textit{ and } b = uA + vB,\\ \text{gcd}(a, b) = \text{gcd}(A, B) +\textit{]}\\ \textbf{while} (b \neq 0) \\ \ \ \textit{[loop invariant: } a = +sA + tB \textit{ and } b = uA + vB,\\ \ \ \text{gcd}(a, b) = \text{gcd}(A, B)\\ \ \ r:= a \mod b, q := a \text{ div } b\\ \ \ a := b, b := r\\ \ \ \textit{newu } := s - uq, \textit{newv } := t - vq\\ \ \ s := u, t := v\\ \ \ u:= \textit{newu}, v := \textit{newv}\\ \textbf{end while}\\ gcd := a\\ \textit{[post condition: } \text{gcd}(A, B) = a = sA + tB \textit{]}$ + +**Output:** $\text{gcd}\textit{[a positive integer]}, s, t \textit{[integers]}$ + +In 28 and 29, for the given values of $A$ and $B$, make a table showing the +values of $s$, $t$, and $sA + tB$ before the start of the while loop and after +each iteration of the loop + +28. $A = 330$, $B = 156$ + +29. $A = 284$, $B = 168$ + +30. Finis the proof of Theorem 8.4.5 by proving that if $a$, $b$, and $c$ are as + in the proof, then $c | b$. + +31. + +a. Find an inverse for $210$ modulo $13$. + +b. Find a positive inverse for $210$ modulo $13$. + +c. Find a positive solution for the congruence $210x \equiv 8 (\mod 13)$. + +32. + +a. Find an inverse for $41$ modulo $660$. + +b. Find the least positive solution for the following congruence: +$41x \equiv 125(\mod 660)$. + +33. Use Theorem 8.4.5 to prove that for all integers $a$, $b$, and $c$, if + $\text{gcd}(a, b) = 1$ and $a | c$ and $b | c$, then $ab | c$. + +34. Give a counterexample to show that the statement of exercise 33 is false if + the hypothesis that $\text{gcd}(a, b) = 1$ is removed. + +35. Corollary 8.4.7 guarantees the existence of an inverse modulo $n$ for an + integer $a$ when $a$ and $n$ are relatively prime. Use Euclid's lemma to + prove that the inverse is unique modulo $n$. In other words, show that if + $s$ and $t$ are any two integers whose product with $a$ is congruent to $1$ + modulo $n$, then $s$ and $t$ are congruent to each other modulo $n$. + +In 36, 37, 39, and 40, use the RSA cipher with public key +$n = 713 = 23 \cdot 31$ and $e = 43$. In 36 and 37, encode the messages into +their numeric equivalents and encrypt them. In 39 and 40, decrypt the given +ciphertext and find the original messages. + +36. HELP + +37. COME + +38. Find the least positive inverse for $43$ modulo $660$. + +39. 675 089 089 048 + +40. 028 018 675 129 + +41. + +a. Use mathematical induction and Euclid's lemma to prove that for every +positive integer $s$, if $p$ and $q_1, q_2, \dots, q_s$ are 0rime numbers and +$p | q_1q_2 \cdots q_s$, then $p = q_i$ for some $i$ with $1 \leq i \leq s$. + +b. The uniqueness part of the unique factorization theorem for the integers says +that given any integer $n$, if + +$$ n = p_1p_2 \cdots p_r = q_1q_2 \cdots q_s $$ + +for some positive integers $r$ and $s$ and prime numbers +$p_1 \leq p_2 \leq \cdots \leq p_r$ and $q_1 \leq q_2 \leq \cdots \leq q_s$, +then $r = s$ and $p_i = q_i$ for every integer $i$ with $1 \leq i \leq r$. + +Use the result of part (a) to fill in the details of the following sketch of a +proof: + +Suppose that $n$ is an integer with two different prime factorizations: +$n = p_1p_2 \cdots p_t = q_1q_2 \cdots q_u$. All the prime factors that appear +on both sides can be cancelled (as many times as they appear on both sides) to +arrive at the situation where $p_1p_2 \cdots p_r = q_1q_2 \cdots q_s$, +$p_1 \leq p_2 \leq \cdots \leq p_r$, $q_1 \leq q_2 \leq \cdots \leq q_s$, and +$p_i \neq q_j$ for any integers $i$ and $j$. Then use part (a) to deduce a +contradiction, and conclude that the prime factorization of $n$ is unique +except, possibly, for the order in which the prime factors are written. + +42. According to Fermat's little theorem, if $p$ is a prime number and $a$ and + $p$ are relatively prime, then $a^{p - 1} \equiv 1 (\mod p)$. Verify that + this theorem gives correct results for the following: + +a. $a = 15$ and $p = 7$ + +b. $a = 8$ and $p = 11$ + +43. Fermat's little theorem can be used to show that a number is not prime by + finding a number $a$ relatively prime to $p$ with the property that + $a^{p - 1} \cancel{\equiv} 1(\mod p)$. However, it cannot be used to show + that a number _is_ prime. Find an example to illustrate this fact. That is, + find integers $a$ and $p$ such that $a$ and $p$ are relatively prime and + $a^{p - 1} \equiv 1(\mod p)$ but $p$ is not prime. diff --git a/chapter_8/notes.md b/chapter_8/notes.md index 5c1e411..19d6429 100644 --- a/chapter_8/notes.md +++ b/chapter_8/notes.md @@ -459,3 +459,469 @@ $A$, $$ (a, b) R (c, d) \Leftrightarrow ad = bc $$ The fact is that $R$ is an equivalence relation. + +--- + +Page 549 + +**Theorem 8.4.1 Modular Equivalences** + +Let $a$, $b$, and $n$ be any integers and suppose $n > 1$. The following +statements are all equivalent: + +1. $n | (a - b)$ + +2. $a \equiv b (\mod n)$ + +3. $a = b + kn$ for some integer $k$ + +4. $a$ and $b$ have the same (nonnegative) remainder when divided by $n$ + +5. $a \mod n = b \mod n$ + +**Proof:** + +We will show that +$(1) \Rightarrow (2) \Rightarrow (3) \Rightarrow (4) \Rightarrow (5) \Rightarrow (1)$. +It will follow by the transitivity of if-then that all five statements are +equivalent. + +So let $a$, $b$, and $n$ be any integers with $n > 1$. + +_Proof that $(1) \Rightarrow (2)$:_ + +Suppose that $n | (a - b)$. By definition of congruence module $n$, we can +immediately conclude that $a \equiv b (\mod n)$. + +_Proof that $(2) \Rightarrow (3)$:_ + +Suppose $a \equiv b (\mod n)$. By definition of congruence modulo $n$, +$n | (a - b)$. Thus, by definition of divisibility, $a - b = kn$, for some +integer $k$. Adding $b$ to both sides gives that $a = b + kn$. + +_Proof that $(3) \Rightarrow (4)$:_ + +Suppose that $a = b + kn$, for some integer $k$. Use the quotient-remainder +theorem to divide $a$ by $n$ to obtain + +$$ a = qn + r \text{ where } q \text{ and } r \text{ are integers and } 0 \leq r < n $$ + +So $r$ is the remainder obtained when $a$ is divided by $n$. Substituting +$b + kn$ for $a$ in the equation $a = qn + r$ gives that + +$$ b + kn = qn + r $$ + +and subtracting $kn$ from both sides and factoring out $n$ yields + +$$ b = (q - k)n + r $$ + +Now since $0 \leq r < n$, the uniqueness property of the quotient-remainder +theorem guarantees that $r$ is also the remainder obtained when $b$ is divided +by $n$. Thus $a$ and $b$ have the same remainder when divided by $n$. + +_Proof that $(4) \Rightarrow (5)$:_ + +Suppose that $a$ and $b$ have the same remainder when divided by $n$. It follows +immediately from the definition of the $\mod$ function that +$a \mod n = b \mod n$. + +_Proof that $(5) \Rightarrow (1)$:_ + +Suppose that $a \mod n = b \mod n$. By definition of the $\mod$ function, $a$ +and $b$ have the same remainder when divided by $n$. Thus, by the +quotient-remainder theorem, we can write + +$$ a = q_1n + r \text{ and } b = q_2n + r \text{ where } q_1, q_2 \text{ and } r \text{ are integers and } 0 \leq r < n $$ + +It follows that + +$$ a - b = (q_1n + r) - (q_2n + r) = (q_1 - q_2)n $$ + +Therefore, since $q_1 - q_2$ is an integer, $n | (a - b)$. + +--- + +Page 550 + +**Definition** + +Given integers $a$ and $n$ with $n > 1$, **the residue of $a$ modulo $n$** is +$a \mod n$, the nonnegative remainder obtained when $a$ is divided by $n$. The +numbers $0, 1, 2, \dots, n - 1$ are called a **complete set of residues modulo +$n$**. To **reduce a number modulo $n$** means to set it equal to its residue +modulo $n$. If a modulus $n > 1$ is fixed throughout a discussion and an integer +$a$ is given, the words "modulo $n$" are often dropped and we simply speak of +**the residue of $a$**. + +--- + +Page 550 + +**Theorem 8.4.2 Congruence Modulo $n$ Is an Equivalence Relation** + +If $n$ is any integer with $n > 1$, congruence modulo $n$ is an equivalence +relation on the set of all integers. The distinct equivalence classes of the +relation are the sets $[0], [1], [2], \dots, [n - 1]$, where for each +$a = 0, 1, 2, \dots, n - 1$, + +$$ [a] = \{m \in \mathbb{Z} | m \equiv a (\mod n)\} $$ + +or, equivalently, + +$$ [a] = \{m \in \mathbb{Z} | m = a + kn \text{ for some integer } k\} $$ + +**Proof:** + +Suppose $n$ is any integer with $n > 1$. We must show that congruence modulo $n$ +is reflexive, symmetric, and transitive. + +_Proof of reflexivity:_ + +Suppose $a$ is any integer. To show that $a \equiv a (\mod n)$, we must show +that $n | (a - a)$. Now $a - a = 0$, and $n | 0$ because $0 = n \cdot 0$. +Therefore $a \equiv a (\mod n)$. + +_Proof of symmetry:_ + +Suppose $a$ and $b$ are any integers such that $a \equiv b(\mod n)$. We must +show that $b \equiv a (\mod n)$. Now since $a \equiv b(\mod n)$, then +$n | (a - b)$. Thus, by definition of divisibility, $a - b = nk$, for some +integer $k$. Multiplying both sides of this equation by $-1$ to obtain + +$$ -(a - b) = -nk $$ + +or, equivalently, + +$$ b - a = n(-k) $$ + +Thus, by definition of divisibility $n | (b - a)$, and so, by definition of +congruence modulo $n$, $b \equiv a (\mod n)$. + +_Proof of transitivity:_ + +This is left as exercise 5 at the end of the section. + +_Proof that the distinct equivalence classes are +$[0], [1], [2], \dots, [n - 1]$:_ + +This is left as exercise 6 at the end of the section. + +--- + +Page 551 + +**Theorem 8.4.3 Modular Arithmetic** + +Let $a$, $b$, $c$, $d$, and $n$ be integers with $n > 1$, and suppose + +$$ a \equiv c (\mod n) \text{ and } b \equiv d(\mod n) $$ + +Then + +1. $(a + b) \equiv (c + d)(\mod n)$ + +2. $(a - b) \equiv (c - d)(\mod n)$ + +3. $ab \equiv cd(\mod n)$ + +4. $a^m \equiv c^m(\mod n)$ for every positive integer $m$ + +**Proof:** + +Because we will make greatest use of part 3 of this theorem, we prove it here +and leave the proofs of the remaining parts of the theorem to exercises 9-11 at +the end of the section. + +_Proof of Part 3:_Proof Suppose $a$, $b$, $c$, $d$, and $n$ are integers with +$n > 1$, and suppose $a \equiv b(\mod n)$ and $c \equiv d(\mod n)$. By Theorem +8.4.1, there exists integers $s$ and $t$ such that + +$$ a = c + sn \text{ and } b = d + tn $$ + +Then + +$$ ab = (c + sn)(d + tn) $$ + +$$ = cd + ctn + snd + sntn $$ + +$$ = cd + n(ct + sd + stn) $$ + +Let $k = ct + sd + stn$. Then $k$ is an integer because it is a sum of products +of integers, and $ab = cd + nk$. Thus by Theorem 8.4.1, $ab \equiv cd(\mod n)$. + +--- + +Page 552 + +**Corollary 8.4.4** + +Let $a$, $b$, and $n$ be integers with $n > 1$. Then + +$$ ab \equiv [(a \mod n)(b \mod n)](\mod n) $$ + +or, equivalently, + +$$ ab \mod n = [(a \mod n)(b \mod n)]\mod n $$ + +In particular, if $m$ is a positive integer, then + +$$ a^m \equiv [(a \mod n)^m](\mod n) $$ + +--- + +Page 555 + +**Definition** + +An integer $d$ is said to be a **linear combination of integers** $a$ and $b$ +if, and only if, there exist integers $s$ and $t$ such that $as + bt = d$. + +--- + +Page 555 + +**Theorem 8.4.5 Writing a Greatest Common Divisor as a Linear Combination** + +For all integers $a$ and $b$, not both zero, if $d = \text{gcd}(a, b)$, then +there exist integers $s$ and $t$ such that $as + bt = d$. + +**Proof:** + +Given integers $a$ and $b$, not both zero, and given $d = \text{gcd}(a, b)$, let + +$$ S = \{x | x \text{ is a positive integer and } x = as + bt \text{ for some integers } s \text{ and } t\} $$ + +Note that $S$ is a nonempty set because (1) if $a > 0$ then +$1 \cdot a + 0 \cdot b \in S$, (2) if $a < 0$ then +$(-1) \cdot a + 0 \cdot b \in S$, and (3) if $a = 0$ then, by assumption, +$b \neq 0$, and hence $0 \cdot a + 1 \cdot b \in S$ or +$0 \cdot a + (-1) \cdot b \in S$. Thus, because $S$ is a nonempty subset of +positive integers, by the well-ordering principle for the integers there is a +least element $c$ in $S$. By definition of $S$, + +$$ c = as + bt \text{ for some integers } s \text{ and } t $$ + +We will show that (1) $c \geq d$, and (2) $c \leq d$, and we will therefore be +able to conclude that $c = d = \text{gcd}(a, b)$. + +_(1) Proof that $c \geq d$:_ + +_[In this part of the proof, we show that $d$ is a divisor of $c$ and thus that +$d \leq c$.]_ Because $d = \text{gcd}(a, b)$, by definition of greatest common +divisor, $d | a$ and $d | b$. Hence $a = dx$ and $b = dy$ for some integers $x$ +and $y$. Then + +$$ c = as + bt $$ + +$$ = (dx)s + (dy)t $$ + +$$ = d(xs + y) $$ + +Now $xs + yt$ is an integer because it is a sum of products of integers. Thus, +by definition of divisibility, $d | c$. Both $c$ and $d$ are positive, and +hence, by Theorem 4.4.1, $c \geq d$. + +_(2) Proof that $c \leq d$:_ + +_[In this part of the proof, we show that $c$ is a divisor of both $a$ and $b$ +and therefore that $c$ is less than or equal to the greatest common divisor of +$a$ and $b$, which is $d$.]_ Apply the quotient-remainder theorem to the +division of $a$ by $c$ to obtain + +$$ a = cq + r \text{ for some integers } q \text{ and } r \text{ with } 0 \leq r < c $$ + +Thus for some integers $q$ and $r$ with $0 \leq r < c$, + +$$ r = q - cq $$ + +Now $c = as + bt$. Therefore, for some integers $q$ and $r$ with $0 \leq r < c$, + +$$ r = a - (as + bt)q $$ + +$$ = a(1 - sq) - btq $$ + +Thus $r$ is a linear combination of $a$ and $b$. If $r > 0$, then $r$ would be +in $S$, and so $r$ would be a smaller element of $S$ than $c$, which would +contradict the fact that $c$ is the least element of $S$. Hence $r = 0$. By +substitution into (8.4.4), + +$$ a = cq $$ + +and therefore $c | a$. + +An almost identical argument establishes that $c | b$ and is left as exercise 30 +at the end of the section. + +Because $c | a$ and $c | b$, $c$ is a common divisor of $a$ and $b$. Hence $c$ +is less than or equal to the greatest common divisor of $a$ and $b$. In other +words, $c \leq d$. + +From (1) and (2), we conclude that $c = d$. It follows that $d$, the greatest +common divisor of $a$ and $b$, is equal to $as + bt$. + +--- + +Page 557 + +**Definition** + +Given any integer $a$ and any positive integer $n$, if there exists an integer +$s$ such that $as \equiv 1(\mod n)$, then $s$ is called **an inverse for $a$ +modulo $n$.** + +--- + +Page 557 + +**Definition** + +Integers $a$ and $b$ are **relatively prime** if, and only if, +$\text{gcd}(a, b) = 1$. Integers $a_1, a_2, a_3, \dots, a_n$ are **pairwise +relatively prime** if, and only if, $\text{gcd}(a_i, a_j) = 1$ for all integers +$i$ and $j$ with $1 \leq i$, $j \leq n$, and $i \neq j$. + +--- + +Page 557 + +**Corollary 8.4.6** + +If $a$ and $b$ are relatively prime integers, then there exist integers $s$ and +$t$ such that $as + bt = 1$. + +--- + +Page 558 + +**Corollary 8.4.7 Existence of Inverses Modulo $n$** + +For all integers $a$ and $n$, if $\text{gcd}(a, n) = 1$, then there exists an +integer $s$ such that $as \equiv 1(\mod n)$, and so $s$ is an inverse for $a$ +modulo $n$. + +**Proof:** + +Suppose $a$ and $n$ are integers and $\text{gcd}(a, n) = 1$. By Corollary 8.4.6, +there exist integers $s$ and $t$ such that + +$$ as + nt = 1 $$ + +Subtracting $nt$ from both sides gives that + +$$ as = 1 - nt = 1 + (-t)n $$ + +Thus, by definition of congruence modulo $n$, + +$$ as \equiv 1(\mod n) $$ + +--- + +Page 562 + +**Theorem 8.4.8 Euclid's Lemma** + +For all integers $a$, $b$, and $c$, if $\text{gcd}(a, c) = 1$ and $a | bc$, then +$a | b$. + +**Proof:** + +Suppose $a$, $b$, and $c$ are integers, $\text{gcd}(a, c) = 1$, and $a | bc$. +_[We must show that $a | b$.]_ By Theorem 8.4.5, there exist integers $s$ and +$t$ so that + +$$ as + ct = 1 $$ + +Multiply both sides of this equation by $b$ to obtain + +$$ bas + bct = b $$ + +Since $a | bc$, by definition of divisibility there exists an integer $k$ such +that + +$$ bc = ak $$ + +Substituting (8.4.8) into (8.4.7), rewriting, and factoring out an $a$ gives +that + +$$ b = bas + (ak)t = a(bs + kt) $$ + +Let $r = bs + kt$. Then $r$ is an integer (because $b$, $s$, $k$, and $t$ are +all integers), and $b = ar$. Thus $a | b$ by definition of divisibility. + +Page 562 + +**Theorem 8.4.9 Cancellation Theorem for Modular Congruence** + +For all integers $a$, $b$, and $c$, and $n$ with $n > 1$, if +$\text{gcd}(c, n) = 1$ and $ac = bc(\mod n)$, then $a \equiv b(\mod n)$. + +**Proof:** + +Suppose $a$, $b$, $c$, and $n$ are integers, $\text{gcd}(c, n) = 1$, and +$ac \equiv bc(\mod n)$. _[We must show that $a \equiv b(\mod n)$.]_ By +definition of congruence modulo $n$, + +$$ n | (ac - bc) $$ + +and so, since + +$$ ac - bc = (a - b)c $$ + +then + +$$ n | (a - b)c $$ + +Because $\text{gcd}(c, n) = 1$, we may apply Euclid's lemma to obtain + +$$ n | (a - b) $$ + +and so, by definition of congruence modulo $n$, + +$$ a \equiv b(\mod n) $$ + +--- + +Page 563 + +**Theorem 8.4.10 Fermat's Little Theorem** + +If $p$ is any prime number and $a$ is any integer such that $p \cancel{|} a$, +then $a^{p - 1} \equiv 1(\mod p)$. + +**Proof:** + +Suppose $p$ is any prime number and $a$ is any integer such that +$p \cancel{|} a$. Note that $a \neq 0$ because otherwise $p$ would divide $a$. +Consider the set of integers + +$$ S = \{a, 2a, 3a, \dots, (p - 1)a\} $$ + +We claim that no two elements of $S$ are congruent modulo $p$. For suppose +$sa \equiv ra(\mod p)$ for some integers $s$ and $r$ with +$1 \leq r < s \leq p - 1$. Then, by definition of congruence modulo $p$, + +$$ p | (sa - ra) \text{ or, equivalently, } p | (s - r)a $$ + +Now $p \cancel{|} a$ by hypothesis, and because $p$ is prime, +$\text{gcd}(a, p) = 1$. Thus, by Euclid's lemma, $p | (s - r)$, But this is +impossible because $0 < s - r < p$. + +Consider the function $F$ from $S$ to the set $T = \{1, 2, 3, \dots, (p - 1)\}$ +that sends each element of $S$ to its residue modulo $p$. Then $F$ is one-to-one +because no two elements of $S$ are congruent modulo $p$. In Section 9.4 we prove +that if a function from one finite set to another is one-to-one, then it is also +onto. Hence $F$ is onto, and so $p - 1$ residues of the $p - 1$ elements of $S$ +are exactly the numbers $1, 2, 3 \dots, (p - 1)$. + +It follows by Theorem 8.4.3(3) that + +$$ a \cdot 2a \cdot 3a \cdots (p - 1)a \equiv [1 \cdot 2 \cdot 3 \cdots (p - 1)](\mod p) $$ + +or, equivalently, + +$$ a^{p - 1}(p - 1)! \equiv (p - 1)!(\mod p) $$ + +Now because $p$ is prime, $p$ and $(p - 1)!$ are relatively prime. Thus, by the +cancellation theorem for modular congruence (Theorem 8.4.9), + +$$ a^{p - 1} \equiv 1(\mod p) $$ diff --git a/chapter_8/test_yourself.md b/chapter_8/test_yourself.md index 14472e9..943a536 100644 --- a/chapter_8/test_yourself.md +++ b/chapter_8/test_yourself.md @@ -113,3 +113,45 @@ a partition of $A$ equivalence class of $R$ for each ____. rational number + +--- + +Page 566 + +**Test Yourself** + +1. When letters of the alphabet are encrypted using the Caesar cipher, the + encrypted version of the letter is ____. + +2. If $a$, $b$, and $n$ are integers with $n > 1$, all of the following are + different ways to express the fact that $n | (a - b)$: ____, ____, ____, + ____. + +3. If $a$, $b$, $c$, $d$, $m$, and $n$ are integers with $n > 1$ and if + $a \equiv c(\mod n)$ and $b \equiv d(\mod n)$, then $a + b \equiv$ ____, + $a - b \equiv$ ____, $ab \equiv$ ____, and $a^m \equiv$ ____ + +4. If $a$, $n$, and $k$ are positive integers with $n > 1$, an efficient way to + compute $a^k(\mod n)$ is to write $k$ as a ____ and use the facts about + computing products and powers modulo $n$. + +5. To express a greatest common divisor of two integers as a linear combination + of the integers, use the extended version of the ____ algorithm. + +6. To find an inverse for a positive integer $a$ modulo an integer $n$ with + $n > 1$, you express the number $1$ as ____. + +7. To encrypt a message $M$ using RSA cryptography with public key $pq$ and $e$, + you use the formula ____, and to decrypt a message $C$, you use the formula + ____, where ____. + +8. Euclid's lemma says that for all integers $a$, $b$, and $c$ if + $\text{gcd}(a, c) = 1$ and $a | bc$, then ____. + +9. Fermat's little theorem says that if $p$ is any prime number and $a$ is any + integer such that $p | a$, then ____. + +10. The crux of the proof that the RSA cipher works is that if (1) $p$ and $q$ + are distinct large prime numbers, (2) $M < pq$, (3) $M$ is relatively prime + to $pq$, (4) $e$ is relatively prime to $(p - 1)(q - 1)$, and (5) $d$ is a + positive inverse for $e$ modulo $(p - 1)(q - 1)$, then $M =$ ____.