Wiki.RIP

# Fundamental theorem of arithmetic

In number theory, the fundamental theorem of arithmetic, also called the unique factorization theorem or the unique-prime-factorization theorem, states that every integer greater than 1 either is a prime number itself or can be represented as the product of prime numbers and that, moreover, this representation is unique, up to (except for) the order of the factors. For example,

1200 = 24 × 31 × 52 = 2 × 2 × 2 × 2 × 3 × 5 × 5 = 5 × 2 × 5 × 2 × 3 × 2 × 2 = ...

The theorem says two things for this example: first, that 1200 can be represented as a product of primes, and second, that no matter how this is done, there will always be exactly four 2s, one 3, two 5s, and no other primes in the product.

The requirement that the factors be prime is necessary: factorizations containing composite numbers may not be unique (e.g., 12 = 2 × 6 = 3 × 4).

This theorem is one of the main reasons why 1 is not considered a prime number: if 1 were prime, then factorization into primes would not be unique; for example, 2 = 2 × 1 = 2 × 1 × 1 = ...

## Euclid's original version

Book VII, propositions 30, 31 and 32, and Book IX, proposition 14 of Euclid's Elements are essentially the statement and proof of the fundamental theorem.

If two numbers by multiplying one another make some number, and any prime number measure the product, it will also measure one of the original numbers.

— Euclid, Elements Book VII, Proposition 30

(In modern terminology: if a prime p divides the product ab, then p divides either a or b or both.) Proposition 30 is referred to as Euclid's lemma, and it is the key in the proof of the fundamental theorem of arithmetic.

Any composite number is measured by some prime number.

— Euclid, Elements Book VII, Proposition 31

(In modern terminology: every integer greater than one is divided evenly by some prime number.) Proposition 31 is proved directly by infinite descent.

Any number either is prime or is measured by some prime number.

— Euclid, Elements Book VII, Proposition 32

Proposition 32 is derived from proposition 31, and proves that the decomposition is possible.

If a number be the least that is measured by prime numbers, it will not be measured by any other prime number except those originally measuring it.

— Euclid, Elements Book IX, Proposition 14

(In modern terminology: a least common multiple of several prime numbers is not a multiple of any other prime number.) Book IX, proposition 14 is derived from Book VII, proposition 30, and proves partially that the decomposition is unique – a point critically noted by André Weil. Indeed, in this proposition the exponents are all equal to one, so nothing is said for the general case.

Article 16 of Gauss' Disquisitiones Arithmeticae is an early modern statement and proof employing modular arithmetic.

## Applications

### Canonical representation of a positive integer

Every positive integer n > 1 can be represented in exactly one way as a product of prime powers:

$n=p_{1}^{n_{1}}p_{2}^{n_{2}}\cdots p_{k}^{n_{k}}=\prod _{i=1}^{k}p_{i}^{n_{i}}$ where p1 < p2 < ... < pk are primes and the ni are positive integers. This representation is commonly extended to all positive integers, including 1, by the convention that the empty product is equal to 1 (the empty product corresponds to k = 0).

This representation is called the canonical representation of n, or the standard form of n. For example,

999 = 33×37,
1000 = 23×53,
1001 = 7×11×13.

Note that factors p0 = 1 may be inserted without changing the value of n (e.g., 1000 = 23×30×53).
In fact, any positive integer can be uniquely represented as an infinite product taken over all the positive prime numbers:

$n=2^{n_{1}}3^{n_{2}}5^{n_{3}}7^{n_{4}}\cdots =\prod _{i=1}^{\infty }p_{i}^{n_{i}},$ where a finite number of the ni are positive integers, and the rest are zero. Allowing negative exponents provides a canonical form for positive rational numbers.

### Arithmetic operations

The canonical representations of the product, greatest common divisor (GCD), and least common multiple (LCM) of two numbers a and b can be expressed simply in terms of the canonical representations of a and b themselves:

{\begin{alignedat}{2}a\cdot b&{}={}2^{a_{1}+b_{1}}3^{a_{2}+b_{2}}5^{a_{3}+b_{3}}7^{a_{4}+b_{4}}\cdots &&{}={}\prod p_{i}^{a_{i}+b_{i}},\\\gcd(a,b)&{}={}2^{\min(a_{1},b_{1})}3^{\min(a_{2},b_{2})}5^{\min(a_{3},b_{3})}7^{\min(a_{4},b_{4})}\cdots &&{}={}\prod p_{i}^{\min(a_{i},b_{i})},\\\operatorname {lcm} (a,b)&{}={}2^{\max(a_{1},b_{1})}3^{\max(a_{2},b_{2})}5^{\max(a_{3},b_{3})}7^{\max(a_{4},b_{4})}\cdots &&{}={}\prod p_{i}^{\max(a_{i},b_{i})}.\end{alignedat}} However, integer factorization, especially of large numbers, is much more difficult than computing products, GCDs, or LCMs. So these formulas have limited use in practice.

### Arithmetic functions

Many arithmetic functions are defined using the canonical representation. In particular, the values of additive and multiplicative functions are determined by their values on the powers of prime numbers.

## Proof

The proof uses Euclid's lemma (Elements VII, 30): If a prime p divides the product ab of two integers a and b, then p must divide at least one of those integers a and b.

### Existence

It must be shown that every integer greater than 1 is either prime or a product of primes. First, 2 is prime. Then, by strong induction, assume this is true for all numbers greater than 1 and less than n. If n is prime, there is nothing more to prove. Otherwise, there are integers a and b, where n = ab, and 1 < ab < n. By the induction hypothesis, a = p1p2...pj and b = q1q2...qk are products of primes. But then n = ab = p1p2...pjq1q2...qk is a product of primes.

### Uniqueness

Suppose, to the contrary, there is an integer that has two distinct prime factorizations. Let n be the least such integer and write n = p1 p2 ... pj = q1 q2 ... qk, where each pi and qi is prime. (Note j and k are both at least 2.) We see p1 divides q1 q2 ... qk, so p1 divides some qi by Euclid's lemma. Without loss of generality, say p1 divides q1. Since p1 and q1 are both prime, it follows that p1 = q1. Returning to our factorizations of n, we may cancel these two terms to conclude p2 ... pj = q2 ... qk. We now have two distinct prime factorizations of some integer strictly smaller than n, which contradicts the minimality of n.

### Elementary proof of uniqueness

The fundamental theorem of arithmetic can also be proved without using Euclid's lemma, as follows:

Assume that s > 1 is the smallest positive integer which is the product of prime numbers in two different ways. If s were prime then it would factor uniquely as itself, so s is not prime and there must be at least two primes in each factorization of s:

{\begin{aligned}s&=p_{1}p_{2}\cdots p_{m}\\&=q_{1}q_{2}\cdots q_{n}.\end{aligned}} If any pi = qj then, by cancellation, s/pi = s/qj would be another positive integer, different from s, which is greater than 1 and also has two distinct factorizations. But s/pi is smaller than s, meaning s would not actually be the smallest such integer. Therefore every pi must be distinct from every qj.

Without loss of generality, take p1 < q1 (if this is not already the case, switch the p and q designations.) Consider

$t=(q_{1}-p_{1})(q_{2}\cdots q_{n}),$ and note that 1 < q2t < s. Therefore t must have a unique prime factorization. By rearrangement we see,

{\begin{aligned}t&=q_{1}(q_{2}\cdots q_{n})-p_{1}(q_{2}\cdots q_{n})\\&=s-p_{1}(q_{2}\cdots q_{n})\\&=p_{1}((p_{2}\cdots p_{m})-(q_{2}\cdots q_{n})).\end{aligned}} Here u = ((p2 ... pm) - (q2 ... qn)) is positive, for if it were negative or zero then so would be its product with p1, but that product equals t which is positive. So u is either 1 or factors into primes. In either case, t = p1u yields a prime factorization of t, which we know to be unique, so p1 appears in the prime factorization of t.

If (q1 - p1) equaled 1 then the prime factorization of t would be all q's, which would preclude p1 from appearing. Thus (q1 - p1) is not 1, but is positive, so it factors into primes: (q1 - p1) = (r1 ... rh). This yields a prime factorization of

$t=(r_{1}\cdots r_{h})(q_{2}\cdots q_{n}),$ which we know is unique. Now, p1 appears in the prime factorization of t, and it is not equal to any q, so it must be one of the r's. That means p1 is a factor of (q1 - p1), so there exists a positive integer k such that p1k = (q1 - p1), and therefore

$p_{1}(k+1)=q_{1}.$ But that means q1 has a proper factorization, so it is not a prime number. This contradiction shows that s does not actually have two different prime factorizations. As a result, there is no smallest positive integer with multiple prime factorizations, hence all positive integers greater than 1 factor uniquely into primes.

## Generalizations

The first generalization of the theorem is found in Gauss's second monograph (1832) on biquadratic reciprocity. This paper introduced what is now called the ring of Gaussian integers, the set of all complex numbers a + bi where a and b are integers. It is now denoted by $\mathbb {Z} [i].$ He showed that this ring has the four units ±1 and ±i, that the non-zero, non-unit numbers fall into two classes, primes and composites, and that (except for order), the composites have unique factorization as a product of primes.

Similarly, in 1844 while working on cubic reciprocity, Eisenstein introduced the ring $\mathbb {Z} [\omega ]$ , where $\omega ={\frac {-1+{\sqrt {-3}}}{2}},$ $\omega ^{3}=1$ is a cube root of unity. This is the ring of Eisenstein integers, and he proved it has the six units $\pm 1,\pm \omega ,\pm \omega ^{2}$ and that it has unique factorization.

However, it was also discovered that unique factorization does not always hold. An example is given by $\mathbb {Z} [{\sqrt {-5}}]$ . In this ring one has

$6=2\cdot 3=(1+{\sqrt {-5}})(1-{\sqrt {-5}}).$ Examples like this caused the notion of "prime" to be modified. In $\mathbb {Z} [{\sqrt {-5}}]$ it can be proven that if any of the factors above can be represented as a product, e.g., 2 = ab, then one of a or b must be a unit. This is the traditional definition of "prime". It can also be proven that none of these factors obeys Euclid's lemma; e.g., 2 divides neither (1 + −5) nor (1 − −5) even though it divides their product 6. In algebraic number theory 2 is called irreducible in $\mathbb {Z} [{\sqrt {-5}}]$ (only divisible by itself or a unit) but not prime in $\mathbb {Z} [{\sqrt {-5}}]$ (if it divides a product it must divide one of the factors). The mention of $\mathbb {Z} [{\sqrt {-5}}]$ is required because 2 is prime and irreducible in $\mathbb {Z} .$ Using these definitions it can be proven that in any integral domain a prime must be irreducible. Euclid's classical lemma can be rephrased as "in the ring of integers $\mathbb {Z}$ every irreducible is prime". This is also true in $\mathbb {Z} [i]$ and $\mathbb {Z} [\omega ],$ but not in $\mathbb {Z} [{\sqrt {-5}}].$ The rings in which factorization into irreducibles is essentially unique are called unique factorization domains. Important examples are polynomial rings over the integers or over a field, Euclidean domains and principal ideal domains.

In 1843 Kummer introduced the concept of ideal number, which was developed further by Dedekind (1876) into the modern theory of ideals, special subsets of rings. Multiplication is defined for ideals, and the rings in which they have unique factorization are called Dedekind domains.

There is a version of unique factorization for ordinals, though it requires some additional conditions to ensure uniqueness.