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 divides , written , if there exists an integer such that
In that case, is called a divisor or factor of .
The phrase "there exists an integer" is the essential part of the definition. For example, because , while because there is no integer with .
Several edge cases are worth fixing immediately:
- every integer divides , because ;
- divides only , because forces ;
- divides every integer;
- if , then both and divide .
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 .
To prove the combination rule, write and with integer . Then , and the new multiplier is still an integer. This argument uses no division by , so it remains valid when .
Primes, composites, and well-ordering
Definition
Prime and composite
Let with .
- is prime if its only positive divisors are and ;
- is composite if it is not prime.
The integer 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.
A least element must belong to the set; a lower bound need not. The real interval has lower bound but no least element, since is a smaller member whenever is a member. To obtain well-ordering from strong induction, suppose a subset of has no least element. It cannot contain . If it contains none of , it cannot contain either, since that would be least. Induction shows the subset is empty.
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 be the least integer greater than with no prime factor. Then cannot itself be prime. So with . By minimality of , the smaller number has a prime factor . Since and , transitivity gives , contradicting the choice of .
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 . 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 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.
Changing either sign preserves divisibility, so . In particular, . The value is a separate convention: all positive integers divide both inputs, so there is no greatest positive common divisor in that case.
Definition
Relatively prime
Two nonzero integers and are relatively prime if their only positive common divisor is . Equivalently,
For inputs that are not both zero, the gcd removes their common part. If
then
Indeed, a positive common divisor of and makes a common divisor of . Since is greatest, , so . Thus . Dividing by would be invalid for the excluded pair .
For example, , so
and and 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 and such that
The integer is the quotient and is the remainder.
The condition is not decoration. It is what makes the remainder unique. For example,
has an allowed remainder , while
does not count as the division algorithm because is not smaller than .
For existence, first take and . The set
contains , so well-ordering supplies a least member . If , then would be a smaller nonnegative member. Hence . If and , the integer is nonnegative. Divide by the case just proved; rearranging gives with the same allowed remainder. For , divide by and replace the resulting quotient by . Thus no sign case requires a negative remainder.
For uniqueness, suppose with both remainders in range. Then , but . A nonzero integer multiple of has absolute value at least , so . Since , the remaining equality forces . The strict upper bound proves uniqueness; merely requiring a nonnegative remainder would not.
Common mistake
Do not ignore the remainder range
The equation alone is not enough. There are infinitely many such representations if is unrestricted, because changing changes . The inequality is what selects the canonical quotient and remainder.
Gcd invariance and the Euclidean algorithm
The division algorithm is useful because replacing by preserves the gcd.
Theorem
Gcd step
If , then
Proof: Preserve the entire set of common divisors
The target is equality of two gcds. A stronger intermediate statement makes the proof direct: an integer divides both exactly when it divides both . In the forward direction use ; in the reverse direction use . Both steps use closure under integer linear combinations.
The two divisor sets therefore have the same greatest element when the inputs are not both zero. If , then and both gcds equal by convention. The identity itself does not need a remainder bound; the bound is needed to make the algorithm progress.
Concept lensAlgorithmic
An invariant and a decreasing computation
The gcd is the quantity preserved by each replacement . The remainder is the quantity made smaller. These serve different purposes: preservation proves that the final answer is the original gcd, while strict decrease proves that a final step will occur. Start with absolute values, swap to put the larger positive input first, and stop immediately if the other input is zero. In every remaining division the divisor is positive.
Worked example
Euclidean algorithm for
Apply the division algorithm repeatedly:
The last nonzero remainder is , 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 Bézout'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
Back-substitution can also be organized forward. For positive inputs put , , and keep coefficients , starting with and . If , then
Substituting the two known linear combinations proves this update. Every coefficient remains integral, and the row for the last nonzero remainder supplies the required coefficients of the gcd.
From Euclidean division to Bézout coefficients
The downward Euclidean computation and the upward back-substitution are not two separate tricks. They are the same division equations read in opposite directions: first to locate the last nonzero remainder, then to rewrite that remainder using the original two integers.
Follow the Euclidean algorithm first find the gcd and then reverse into a concrete Bézout identity for integer equations.
First division
The computation starts with 7224=1290*5+774, so the next pair is (1290,774).
Gcd invariant
If a=bq+r, then the positive common divisors of (a,b) are exactly the positive common divisors of (b,r).
Remainder chain
The remainders 774, 516, 258, 0 show that the last nonzero remainder is gcd(7224,1290)=258.
Back-substitution
Running the equations backward first gives 258=2*774-1290.
Bézout combination
Substituting 774=7224-5*1290 gives the concrete identity 258=2*7224-11*1290.
Equation test
A linear integer equation ax+by=c has integer solutions exactly when gcd(a,b) divides c.
The Euclidean algorithm moves downward through smaller remainders to find the gcd. The extended algorithm then reads the same equations backward to express that gcd as a Bézout combination, which is why gcd(a,b) controls when ax+by=c has integer solutions.
Theorem
Bézout's identity
For any integers , there exist integers such that
For signed nonzero inputs, compute using and absorb their signs into the resulting coefficients. If one input is zero, use or its counterpart for ; for use . This proves all cases of the identity.
When the inputs are not both zero, the gcd is also the smallest positive integer linear combination. It is such a combination by the identity, and every positive combination is a positive multiple of the gcd, hence at least as large. For there is no positive combination.
Theorem
Relative primality criterion
Let be nonzero integers. Then and are relatively prime if and only if there exist integers such that
One direction is Bézout's identity when . For the converse, if , then every common divisor of and must divide ; hence the greatest positive common divisor is .
Worked example
Extended Euclidean table
For and , the Euclidean algorithm gives
So the gcd is . Back-substitution, or the coefficient table form of the extended Euclidean algorithm, gives
The successive coefficient pairs are
For example, the row for remainder comes from . The next row subtracts this pair from and yields the displayed identity.
This proves in particular that and are relatively prime.
Common divisors and Euclid's lemma
Bézout's identity also gives a cleaner characterization of the gcd.
Theorem
Common divisors divide the gcd
For integers ,
The forward direction is the useful one. If divides both and , then it divides every linear combination ; in particular, it divides the Bézout combination equal to .
Theorem
Euclid's lemma
Let be prime. If , then or .
If , then , so there exist integers with
Multiplying by gives
Since , both terms on the left are divisible by , so .
The same proof gives cancellation without assuming primality: if and , then . Multiply a Bézout identity by ; both terms on the left are divisible by . This applies to signed integers and will justify the parameter step in integer equations below.
For example, if , , and , then . Write with integer . Since , coprime cancellation gives , so and for an integer . The coprimality condition matters: and , but .
Unique prime factorization
Theorem
Fundamental theorem of arithmetic
Every positive integer greater than 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 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.
Repeating Euclid's lemma reduces divisibility of a finite product to one factor. Cancellation cannot exhaust only one prime list: that would leave equal to a nonempty product of primes, which is greater than . Thus the lists have the same length and the same factors with multiplicity.
For positive integers , the theorem lets us compare exponents. If
where missing primes have exponent , then
In the same notation, exactly when for every prime. A positive common divisor can use at most copies of each prime. Taking all these allowed copies gives a common divisor divisible by every other one. For signed nonzero inputs apply this description to absolute values; zero is handled by the gcd convention instead.
Worked example
Gcd from prime powers
Since
we have
Linear Diophantine equations
An equation
where the unknowns must be integers is called a linear Diophantine equation. Bézout's identity tells us exactly when it is solvable.
Theorem
Solvability criterion
Let and let . The equation
has an integer solution if and only if .
If a solution exists, then divides and , so divides . Conversely, if , Bézout's identity gives , and then
Thus is a solution.
First suppose are both nonzero. Once one solution is known, all solutions can be described. With , put
and let be one solution. Then every solution is
There are two claims to prove. Substitution shows that every displayed pair is a solution, since the extra terms cancel: . For completeness, subtract the equation for from any other solution:
Since , the cancellation result gives . Write . Substitution and cancellation of the nonzero integer then give . This establishes that there are no other solutions; finding several pairs by trial would not prove completeness.
Handle zero coefficients before this cancellation. If , , solutions exist precisely when ; then and is any integer. If , , then and is arbitrary, provided . If , every integer pair solves the equation when , and no pair does when . This agrees with exactly when , without dividing by the zero gcd.
Worked example
A measuring problem
Can a mL cup and a mL glass measure exactly mL? Algebraically, we ask whether
has integer solutions. Since
and , the equation is solvable.
Using the extended Euclidean algorithm,
Multiplying by gives
So one solution is . Since and , all solutions are
In the measuring interpretation, positive coefficients count additions to the bucket and negative coefficients count removals. Fill with six cups of mL, then remove ten glasses of mL. The bucket holds mL; an integer solution does not require both coefficients to be nonnegative.
Quick checks
Checkpoint
What does mean in integer language?
Use the quantifier hidden in the definition.
Solution · Answer
It means that there exists an integer such that .
Checkpoint
Why does every common divisor of and divide every expression with ?
Use the definition of divisibility twice.
Solution · Answer
If and , then and for some integers . Thus , and is an integer.
Checkpoint
In the Euclidean algorithm for and , why is the gcd the last nonzero remainder?
Use the identity after each division step.
Solution · Answer
Each division step preserves the gcd, so the original gcd equals the gcd of the last nonzero remainder and . That gcd is .
Checkpoint
What condition decides whether has integer solutions?
State it using .
Solution · Answer
The equation has integer solutions if and only if .
Exercises
- List all positive divisors of , 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 · Model solution 1
The positive divisors of are . Since and , .
Solution · Model solution 2
We need a remainder between and . Since , the quotient is and the remainder is .
Solution · Model solution 3
, , , and . Hence .
Solution · Model solution 4
Back-substitute: . Since , we get .
Solution · Model solution 5
By Bézout's identity, for some integers . If divides both and , then divides the right-hand side.
Solution · Model solution 6
, and , so solutions exist. The direct check gives as one solution. All solutions are for integer , since and .
Solution · Model solution 7
, but , so there are no integer solutions.
Solution · Model solution 8
Compare the smaller exponent of each prime: .