Lecture 11: We were in the process of proving: Theorem: Zm is a field iff m is prime. We proved ‘only if.’ If: We already know that Zm is a ring for all m. So it remains to show that every nonzero element has a multiplicative inverse. Suppose that m is prime. Let a ∈ Zm, a 6= 0 (mod m). Consider the set {a, 2a, 3a, . . . , (m − 1)a} (mod m) Claim 1: None of these is 0 (mod m). Proof: Suppose that for some 1 ≤ i ≤ m − 1, ia = 0 (mod m). Then since m is prime, by Lemma 2, m divides i or a. But i is too small and a 6= 0 (mod m), a contradiction. Claim 2: {a, 2a, 3a, . . . , (m−1)a} (mod m) are distinct ( (mod m)). Proof: Suppose two of these are the same: ia = ja (mod m), with 1 ≤ i < j ≤ m − 1. Then (j − i)a = 0 (mod m). Thus, either m|(j − i) or m|a, neither of which is possible. Thus, all of {a, 2a, 3a, . . . , (m − 1)a} are distinct (mod m). Thus, {a, 2a, 3a, . . . , (m − 1)a} = {1, 2, 3, . . . , (m − 1)} Thus, for some 1 ≤ i ≤ m − 1, ia = 1 exists and thus Zm is a field. (mod m). So, a−1 = i Theorem: For every finite field F , |F | = pn where p is a prime and n is a positive integer. Proof (postponed) uses concept of the characteristic of a field. 1 Theorem: For every prime p and positive integer n, there exists a field F s.t. |F | = pn. In fact, the field is unique in some sense. Proof (postponed) uses polynomials with coefficients in Zp. The unique field of this size is denoted GF (pn) and called a Galois field. For n = 1, GF (p) = Zp. Q: What is GF (4)? (it is not Z4, because that is not a field). GF (4) is defined by the following addition and multiplication tables. + 0 1 a b 0 0 1 a b 1 1 0 b a a a b 0 1 b b a 1 0 · 0 1 a b 0 0 0 0 0 1 0 1 a b a 0 a b 1 b 0 b 1 a Theorem: GF (4) as defined above is a field. Proof: Verify that (GF (4), +) and (GF (4) \ {0}, ·) are abelian groups; for this, deduce the group axioms and commutativity from the addition and multiplication tables; verification of associativity can be done on a case by case basis. So, it remains to check distributivity. Can be done on a case-bycase basis Example of distributivity: a · (a + b) = a · 1 = a a · a + a · b = b + 1 = a. 2 Later, we will have a more systematic way of verifying associativity and distributivity. You can use the addition and multiplication tables above to compute in GF (4). For instance, ab + a2 + b = 1 + b + b = 1 Compare with GF (4) with Z4: ∀x ∈ GF (4), x + x = 0; but in Z4, 1 + 1 = 2 6= 0. Algorithm for finding inverses of elements in a GF (p) = Zp, p prime. Defn: Let a and b be positive integers. The greatest common divisor of a and b (written gcd(a, b), or sometimes (a, b)) is the largest integer which is a divisor of a and b. Example: (30, 45) = 15, (30, 49) = 1. The Euclidean Algorithm is an efficient method for finding the gcd. This method is based on the Division Algorithm: Theorem (Division Algorithm): Let a and b be nonnegative integers. There exist nonnegative integers q and 0 ≤ r < a such that b = aq + r Here, q is the quotient and r is the remainder. Example: b = 306, a = 45, 306 = 45 · 6 + 36. Euclidean Algorithm (EA): Let a and b be positive integers. Iteratively apply the Division Algorithm until the remainder is 0: Set r−1 = b, r0 = a 3 r−1 = r0q0 + r1, r0 = r1q1 + r2, r1 = r2q2 + r3, ... ri−1 = riqi + ri+1, ... rj−2 = rj−1qj−1 + rj , rj−1 = rj qj 0 ≤ r1 < r0 0 ≤ r2 < r1 0 ≤ r3 < r2 ... 0 ≤ ri+1 < ri ... 0 ≤ rj < rj−1 Theorem: gcd(a, b) = rj . Proof: will be posted. Example: Let a = 657 and b = 963. 963 657 306 45 36 = = = = = 657 · 1 + 306 306 · 2 + 45 45 · 6 + 36 36 · 1 + 9 9·4 Thus, gcd(657, 963) = 9. Why? Step 1: Proof that 9 is a divisor of 657 and 963: 9 divides 9 and 36 9 divides 36 and 45 9 divides 45 and 306 9 divides 306 and 657 9 divides 657 and 963. Step 2: Proof that any common divisor, d, of 657 and 963 divides 9: d divides 657 and 963 4 d divides 306 and 657 d divides 45 and 306 d divides 36 and 45 d divides 9 and 36 Bezout’s Identity: Let a and b be positive integers. Then there exist integers m, n (not necessarily positive) such that am + bn = gcd(a, b) Proof: will be posted. You can find m and n by working backwards through the Euclidean Algorithm: 9 = = = = = = = = 45 − 36 45 − (306 − 45 · 6) −306 + 45 · 7 −306 + (657 − 306 · 2) · 7 657 · 7 − 306 · 15 657 · 7 − (963 − 657) · 15 −963 · 15 + 657 · 22 657 · 22 − 963 · 15 So, m = 22 and n = −15. Note that the m and n in Bezout’s Identity are by no means unique. For example, let a = 2 and b = 3, with gcd = 1. Then 1 = 2 · (−1) + 3 · 1 = 2 · 2 − 3 · 1. Finally, we apply EA and Bezout to find inverses in Zp when p is prime. First, observe that if p is prime and a ∈ Zp and a 6= 0 mod p, then gcd(a, p) = 1. By Bezout, there exist integers m, n such that am + pn = 1. Thus, am = 1 mod p, and so a−1 = m mod p. Use EA and Bezout to explicitly find m. 5 For example, if p = 5 and a = 2, then −2 · 2 + 1 · 5 = 1 and so in Z5, 2−1 = −2 = 3. Lecture 12: Midterm 1 6