Why integer arithmetic needs new language
Integer arithmetic looks familiar, but proofs about integers need vocabulary that is more precise than ordinary division. When we write in real algebra, the quotient usually exists as a real number. In integer arithmetic, the important question is different: can the quotient be chosen as another integer?
This question controls many later methods. It lets us define prime numbers, measure common factors, compute greatest common divisors efficiently, and decide when an equation such as
has integer solutions.
Divisibility
Definition
Divisibility
Let . We say that a divides b, written , if
there exists an integer d such that
In that case, a is called a divisor or factor of b.
The phrase "there exists an integer" is the essential part of the definition.
For example, because , while because
there is no integer d with .
Several edge cases are worth fixing immediately:
- every integer divides
0, because ; 0divides only0, because forces ;- divides every integer;
- if , then both
aand dividea.
Theorem
Basic divisibility rules
Let .
- If and , then .
- If , then .
- If and , then .
- If and , then for all .
The fourth rule is the one that quietly powers much of the chapter. If a number divides two integers, then it divides every integer linear combination of them. For instance, if and , then
for every pair of integers x,y.
Primes, composites, and well-ordering
Definition
Prime and composite
Let with .
nis prime if its only positive divisors are1andn;nis composite if it is not prime.
The integer 1 is neither prime nor composite.
Equivalently, is composite exactly when
for integers satisfying .
The proofs about prime numbers rely on a simple but powerful ordering fact.
Theorem
Well-ordering principle
Every nonempty subset of has a least element.
This principle is a way to run a least-counterexample argument. If a bad set of positive integers is nonempty, choose its least bad element and show that this least element creates an even smaller bad element. That contradiction proves that the bad set was empty.
Theorem
Every integer greater than 1 has a prime factor
Every positive integer is divisible by at least one prime.
Here is the proof pattern. Suppose the claim fails, and let m be the least
integer greater than 1 with no prime factor. Then m cannot itself be prime.
So with . By minimality of m, the smaller number
has a prime factor p. Since and , transitivity
gives , contradicting the choice of m.
Theorem
Infinitely many primes
There are infinitely many prime numbers.
If there were only finitely many primes , consider
The previous theorem gives a prime divisor of n. That prime must be one of
the listed primes, say . But also divides the product
, so it divides the difference
which is impossible for a prime.
Greatest common divisors
Definition
Greatest common divisor
Let . If at least one of a,b is nonzero, the greatest common
divisor is
If , define .
For nonzero input, the maximum exists because the possible common divisors are bounded in absolute value. Also, is always positive unless both inputs are zero.
Definition
Relatively prime
Two nonzero integers a and b are relatively prime if their only positive
common divisor is 1. Equivalently,
The gcd removes the common part of two integers. If
then
For example, , so
and 9 and 10 are relatively prime.
The division algorithm
The next task is computational: how do we find the gcd without already knowing all common divisors? The key is integer division with a controlled remainder.
Theorem
Division algorithm
Let with . Then there exist unique integers q and
r such that
The integer q is the quotient and r is the remainder.
The condition is not decoration. It is what makes the remainder unique. For example,
has an allowed remainder 2, while
does not count as the division algorithm because 7 is not smaller than 5.
Common mistake
Do not ignore the remainder range
The equation alone is not enough. There are infinitely many such
representations if r is unrestricted, because changing q changes r.
The inequality is what selects the canonical quotient and
remainder.
Gcd invariance and the Euclidean algorithm
The division algorithm is useful because replacing (a,b) by (b,r) preserves
the gcd.
Theorem
Gcd step
If , then
Indeed, a common divisor of a and b divides , and a common divisor
of b and r divides . Therefore the two pairs have exactly the same
positive common divisors.
Worked example
Euclidean algorithm for
Apply the division algorithm repeatedly:
The last nonzero remainder is 258, so
The algorithm must terminate because the remainders form a strictly decreasing sequence of nonnegative integers:
A strictly decreasing sequence of nonnegative integers cannot continue forever.
Extended Euclidean algorithm and Bezout's identity
The same computation can be run backward to express the gcd as an integer linear combination of the original two numbers.
Worked example
Back-substitution
From the previous computation,
Substitute :
Substitute :
Thus
Theorem
Bezout's identity
For any integers a,b, there exist integers x,y such that
This result says that the gcd is not merely the largest common divisor; it is
also the smallest positive integer that can be built as an integer linear
combination of a and b.
Theorem
Relative primality criterion
Let a,b be nonzero integers. Then a and b are relatively prime if and only
if there exist integers x,y such that
One direction is Bezout's identity when . For the converse, if
, then every common divisor of a and b must divide 1; hence the
greatest positive common divisor is 1.
Worked example
Extended Euclidean table
For 12345 and 11111, the Euclidean algorithm gives
So the gcd is 1. Back-substitution, or the coefficient table form of the
extended Euclidean algorithm, gives
This proves in particular that 12345 and 11111 are relatively prime.
Common divisors and Euclid's lemma
Bezout's identity also gives a cleaner characterization of the gcd.
Theorem
Common divisors divide the gcd
For integers a,b,n,
The forward direction is the useful one. If n divides both a and b, then
it divides every linear combination ; in particular, it divides the
Bezout combination equal to .
Theorem
Euclid's lemma
Let p be prime. If , then or .
If , then , so there exist integers m,n with
Multiplying by b gives
Since , both terms on the left are divisible by p, so .
Unique prime factorization
Theorem
Fundamental theorem of arithmetic
Every positive integer greater than 1 can be written as a product of primes,
and this product is unique up to the order of the factors.
Existence follows from the same least-counterexample strategy used earlier.
If there were a least integer greater than 1 that could not be written as a
product of primes, it would not be prime, so it would split into smaller
factors, and those smaller factors would already have prime factorizations.
Uniqueness uses Euclid's lemma. If
then divides the right-hand product, so must divide one of the prime factors . Hence . Cancel and repeat.
The theorem lets us compute gcds by comparing exponents. If
where missing primes have exponent 0, then
Worked example
Gcd from prime powers
Since
we have
Linear Diophantine equations
An equation
where the unknowns x,y must be integers is called a linear Diophantine
equation. Bezout's identity tells us exactly when it is solvable.
Theorem
Solvability criterion
Let and let . The equation
has an integer solution (x,y) if and only if .
If a solution exists, then d divides a and b, so d divides
. Conversely, if , Bezout's identity gives , and then
Thus (mr,nr) is a solution.
Once one solution is known, all solutions can be described. Suppose , put
and let be one solution. Then every solution is
Worked example
A measuring problem
Can a 180 mL cup and a 105 mL glass measure exactly 30 mL? Algebraically,
we ask whether
has integer solutions. Since
and , the equation is solvable.
Using the extended Euclidean algorithm,
Multiplying by 2 gives
So one solution is . Since and , all solutions are
Quick checks
Quick check
What does mean in integer language?
Use the quantifier hidden in the definition.
Solution
Answer
Quick check
Why does every common divisor of a and b divide every expression with ?
Use the definition of divisibility twice.
Solution
Answer
Quick check
In the Euclidean algorithm for 7224 and 1290, why is the gcd the last nonzero remainder?
Use the identity after each division step.
Solution
Answer
Quick check
What condition decides whether has integer solutions?
State it using .
Solution
Answer
Exercises
- List all positive divisors of
84, and compute . - Use the division algorithm to write with .
- Use the Euclidean algorithm to compute .
- Express as .
- Prove that if and , then .
- Determine whether has integer solutions. If it does, find one.
- Determine whether has integer solutions.
- Use prime factorizations to compute .
Solution