Rings and modular arithmetic

Similar documents
4 Powers of an Element; Cyclic Groups

1 Overview and revision

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

1. multiplication is commutative and associative;

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

Modular Arithmetic and Elementary Algebra

0 Sets and Induction. Sets

Discrete Mathematics with Applications MATH236

Rings If R is a commutative ring, a zero divisor is a nonzero element x such that xy = 0 for some nonzero element y R.

NOTES ON INTEGERS. 1. Integers

Chapter 5: The Integers

Elementary Properties of the Integers

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

Basic elements of number theory

Basic elements of number theory

Greatest Common Divisor MATH Greatest Common Divisor. Benjamin V.C. Collins, James A. Swenson MATH 2730

The Euclidean Algorithm and Multiplicative Inverses

The following is an informal description of Euclid s algorithm for finding the greatest common divisor of a pair of numbers:

Commutative Rings and Fields

Chapter 14: Divisibility and factorization

Finite Fields. Mike Reiter

1. Factorization Divisibility in Z.

Mathematics for Cryptography

CHAPTER 14. Ideals and Factor Rings

CHAPTER I. Rings. Definition A ring R is a set with two binary operations, addition + and

Math 2070BC Term 2 Weeks 1 13 Lecture Notes

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today?

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6

Algebra for error control codes

download instant at

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

Chapter 4 Finite Fields

Elementary Number Theory Review. Franz Luef

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

Gaussian integers. 1 = a 2 + b 2 = c 2 + d 2.

2. THE EUCLIDEAN ALGORITHM More ring essentials

5: The Integers (An introduction to Number Theory)

Chapter 2. Divisibility. 2.1 Common Divisors

8 Primes and Modular Arithmetic

5 Group theory. 5.1 Binary operations

Chapter 5. Modular arithmetic. 5.1 The modular ring

2.2 Inverses and GCDs

ECEN 5022 Cryptography

Numbers, Groups and Cryptography. Gordan Savin

Public-key Cryptography: Theory and Practice

2 Elementary number theory

Abstract Algebra. Joseph R. Mileti. January 22, 2012

FROM GROUPS TO GALOIS Amin Witno

Lecture 4: Number theory

Section 19 Integral domains

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

QUADRATIC RINGS PETE L. CLARK

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

Algebraic structures I

EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972)

MATH 361: NUMBER THEORY FOURTH LECTURE

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS

Divisibility in the Fibonacci Numbers. Stefan Erickson Colorado College January 27, 2006

Number Theory Proof Portfolio

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Honors Algebra 4, MATH 371 Winter 2010 Assignment 3 Due Friday, February 5 at 08:35

Mathematical Foundations of Cryptography

MATH 420 FINAL EXAM J. Beachy, 5/7/97

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

ALGEBRA II: RINGS AND MODULES OVER LITTLE RINGS.

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Number theory. Myrto Arapinis School of Informatics University of Edinburgh. October 9, /29

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

CSC 474 Network Security. Outline. GCD and Euclid s Algorithm. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

MATH 3330 ABSTRACT ALGEBRA SPRING Definition. A statement is a declarative sentence that is either true or false.

A Guide to Arithmetic

Groups, Rings, and Finite Fields. Andreas Klappenecker. September 12, 2002

Course 2316 Sample Paper 1

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

Section 18 Rings and fields

Deepening Mathematics Instruction for Secondary Teachers: Algebraic Structures

LARGE PRIME NUMBERS (32, 42; 4) (32, 24; 2) (32, 20; 1) ( 105, 20; 0).

Math 118: Advanced Number Theory. Samit Dasgupta and Gary Kirby

a the relation arb is defined if and only if = 2 k, k

Number Theory Notes Spring 2011

However another possibility is

Abstract Algebra. Joseph R. Mileti. May 5, 2014

Chapter 1. Greatest common divisor. 1.1 The division theorem. In the beginning, there are the natural numbers 0, 1, 2, 3, 4,...,

Some Facts from Number Theory

CHAPTER 3. Congruences. Congruence: definitions and properties

Number theory (Chapter 4)

Arithmetic Algorithms, Part 1

Outline. Some Review: Divisors. Common Divisors. Primes and Factors. b divides a (or b is a divisor of a) if a = mb for some m

Outline. AIT 682: Network and Systems Security. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

1 First Theme: Sums of Squares

Groups in Cryptography. Çetin Kaya Koç Winter / 13

Solution Sheet (i) q = 5, r = 15 (ii) q = 58, r = 15 (iii) q = 3, r = 7 (iv) q = 6, r = (i) gcd (97, 157) = 1 = ,

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

Lecture 7.5: Euclidean domains and algebraic integers

Congruences and Residue Class Rings

Transcription:

Chapter 8 Rings and modular arithmetic So far, we have been working with just one operation at a time. But standard number systems, such as Z, have two operations + and which interact. It is useful to give a name to this sort of thing. Definition 8.1. A ring consists of a set R with elements 0, 1 2 R, and binary operations + and such that: (R, +, 0) is an Abelian group, is associative with 1 as the identity, and distributes over + on the left and right: x (y + z) =x y + x z (y + z) x = y x + z x Definition 8.2. A ring is commutative if in addition x y = y x Here are some basic examples that everyone should already know. Example 8.3. Let Z (respectively Q, R, C) be the set of integers (respectively rational numbers, real numbers, complex numbers) with the usual operations. These are all commutative rings. Example 8.4. The set M nn (R) of n n matrices over R with the usual matrix operations forms a ring. It is not commutative when n>1. We now focus on a new example. Let n be a positive integer, and write Z n = Z/nZ = {0, 1,...,n 1}, wherex = x + nz. We already know that this has an addition given by addition of cosets: a + b = a + b 40

For hereon in, we ll stop writing same way by. We will try to define multiplication the ab = ab However, we have to prove that this definition makes sense. In other words, we have to show that right side depends only on a and b rather than a and b. Lemma 8.5. If a = a 0 and b = b 0, then ab = a 0 b 0 Proof. The equality x = x 0 holds if and only if x x 0 is divisible by n. Therefore a 0 = a + nx and b = b 0 + ny for some x, y 2 Z. It follows that a 0 b 0 = ab + n(xb 0 + ya 0 + nxy). Theorem 8.6. Z n is a commutative ring. Proof. The laws follow from the fact that Z is a commutative ring, the definition of the operations in Z n, and the fact that the map Z! Z n is onto. For example, here is a proof of the distributive law (x + y)z =(x + y)z = (x + y)z When it s clear we re working in Z n, we usually just write x instead of x. To get a feeling for modular multiplication, lets write down the table for Z 6 0 1 2 3 4 5 0 0 0 0 0 0 0 1 0 1 2 3 4 5 2 0 2 4 0 2 4 3 0 3 0 3 0 3 4 0 4 2 0 4 2 5 0 5 4 3 2 1 One curious fact is that some nonzero numbers, such as 2, can be multiplied by other nonzero numbers to get 0. We say that such a number is a zero divisor. Lemma 8.7. An element m 2 Z n is a zero divisor if m>1 and m divides n. Proof. We have that n = mm 0 for some 0 <m 0 <n. So that mm 0 = 0 Also notice that the number 5 has a reciprocal, namely 5. Definition 8.8. An element x 2 R of a ring is invertible if there exists an element y such that xy = yx =1. Let R denote the set of invertible elements. (When R is commutative, invertible elements are also called units.) Lemma 8.9. If R is a ring R is a group with respect to multiplication. 41

This will be proven in the exercises. The group of invertible elements are easy to determine for the previous examples. For example, M nn (R) = GL n (R). Given two integers a, b, a common divisor is an integer d such that d a and d b. The greatest common divisor is exactly that, the common divisor greater than or equal to all others (it exists since the set of common divisors is finite). We denote this by gcd(a, b). Lemma 8.10 (Euclid). If a, b are natural numbers then gcd(a, b) = gcd(b, a mod b) Proof. Let r = a mod b. Then the division algorithm gives a = qb + r for some integer q. SInce gcd(b, r) divides b and r, it divides qb + r = a. Therefore gcd(b, r) is a common divisor of a and b, so that that gcd(b, r) apple gcd(a, b). On the other hand, r = a qb implies that gcd(a, b) r. Therefore gcd(a, b) is a common divisor of b and r, so gcd(a, b) apple gcd(b, r), which forces them to be equal. This lemma leads to a method for computing gcds. For example gcd(100, 40) = gcd(40, 20) = gcd(20, 0) = 20. For our purposes, a diophantine equation is an equation with integer coe cients where the solutions are also required to be integers. The simplest examples are the linear ones: given integers a, b, c, find all integers m, n such that am + bn = c. Theorem 8.11. Given integers a, b, c, am+bn = c has a solution with m, n 2 Z if and only if gcd(a, b) c. Proof. Since (m 0,n 0 )=(±m, ±n) is a solution of ±an 0 + ±bm 0 = c, we may as well assume that a, b 0. We now prove the theorem for natural numbers a, b by induction on the minimum min(a, b). If min(a, b) = 0, then one of them, say b = 0. Since a = gcd(a, b) divides c by assumption, (c/a, 0) gives a solution of am + bn = c. Now assume that a 0 m + b 0 n = c 0 has a solution whenever min(a 0,b 0 ) < min(a, b) and the other conditions are fulfilled. Suppose b apple a, and let r = r(a, b) = a mod b and q = q(a, b) be given as in theorem 4.5. Thenrm 0 + bn 0 = c has a solution since min(r, b) =r<b= min(a, b) and gcd(b, r) = gcd(a, b) dividesc. Let m = n 0 and n = m 0 qn 0,then am + bn = an 0 + b(m 0 qn 0 )=bm 0 + rn 0 = c. From the last proof, we can deduce: Corollary 8.12. Given a, b 2 Z, there exists m, n 2 Z such that am + bn = gcd(a, b). We can now determine the invertible elements 42

Theorem 8.13. m 2 Z n is invertible if and only if gcd(m, n) =1(we also say that m and n are relatively prime or coprime). Proof. If gcd(m, n) = 1, then mm 0 + nn 0 = 1 or mm 0 = n 0 n + 1 for some integers by corollary 8.12. After replacing (m 0,n 0 )by(m 0 + m 00 n, n 0 m 00 ) for some suitable m 00, we can assume that 0 apple m 0 apple n. Sincehaver(mm 0,n) = 1, mm 0 = 1. The converse follows by reversing these steps. {0}. Acommu- Definition 8.14. A ring is called a division ring if R = R tative division ring is called a field. For example Q, R and C are fields. We will see a noncommutative division ring later on. The previous theorem implies the following: Theorem 8.15. The ring Z n is a field if and only if n is prime. Corollary 8.16 (Fermat s little theorem). When p is a prime and n and integer, then p divides n p n. Proof. If p divides n, then clearly it divides n p n. Now suppose that p does not divide n, thenn 2 Z p. This is a group of order p 1. So by Lagrange s theorem, n has order dividing p 1. This implies that n p 1 = 1, or that n p 1 1=0. This implies that p divides n p 1 1 (which is usually taken as the statement of Fermat s little theorem) and therefore n p n. 8.17 Exercises 1. Let R be a commutative ring. Prove that 0 x = 0. (This might appear to be a completely obvious statement, but it isn t the only things you know about R are what follows from the axioms.) 2. Let R be a commutative ring. Prove that ( 1) x = x, where x is the additive inverse of x, that is ( x)+x = 0. 3. The Gaussian integers Z[i] ={a + bi a, b 2 Z}, wherei = p 1. (a) Check that is closed under addition and multiplication, and is therefore a ring. (b) Determine the group Z[i] of invertible elements. 4. Check that the Gaussian field Q[i] ={a + bi a, b 2 Q} is a field when equipped with the usual operations. 5. Prove that there are no zero divisors in a field, i.e. if xy =0thenx =0 or y = 0. 43

6. If R 1 and R 2 are commutative rings, define R = R 1 R 2 with operations (a 1,a 2 )+(b 1,b 2 )=(a 1 + b 1,a 2 + b 2 ) and (a 1,a 2 ) (b 1,b 2 )=(a 1 b 1,a 1 b 2 ). Check that this is a commutative ring with appropriate choice of constants. Show that this has zero divisors. 7. An element x of a commutative ring is nilpotent if x N = 0 for some integer N 0. Determine the nilpotent elements of Z n. 8. Prove that the sum and product of nilpotent elements in a commutative ring are also nilpotent. 9. Sequences of random numbers are often generated on a computer by the following method: Choose integers n 2,a,b,x 0, and consider the sequence x i+1 =(ax i + b) mod n. This sequence will eventually repeat itself. The period is the smallest k such that x i+k = x i for all i large enough. Obviously, short periods are less useful, since the pattern shouldn t be too predictable. (a) Prove that the period is at most n. (b) Explain why picking a nilpotent in Z n would be a really bad choice. 44