# 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^{[3]} either is prime itself or is the product of prime numbers, and that, although the order of the primes in the second case is arbitrary, the primes themselves are not.^{[4]}^{[5]}^{[6]} For example,

1200 = 2^{4} × 3^{1} × 5^{2} = 3 × 2 × 2 × 2 × 2 × 5 × 5 = 5 × 2 × 3 × 2 × 5 × 2 × 2 = etc.

The theorem is stating two things: first, that 1200 *can* be represented as a product of primes, and second, no matter how this is done, there will always be 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).

## History

Book VII, propositions 30 and 32 of Euclid's Elements is 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

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

Proposition 31 is derived from proposition 30.

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.

Article 16 of Gauss' *Disquisitiones Arithmeticae* is an early modern statement and proof employing modular arithmetic.^{[1]}

## 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:

where Template:Nowrap begin*p*_{1} < *p*_{2} < ... < *p*_{k}Template:Nowrap end are primes and the α_{i} are positive integers.

This representation is called the **canonical representation**^{[7]} of *n*, or the **standard form**^{[8]}^{[9]} of *n*.

- For example 999 = 3
^{3}×37, 1000 = 2^{3}×5^{3}, 1001 = 7×11×13

Note that factors *p*^{0} = 1 may be inserted without changing the value of *n* (e.g. 1000 = 2^{3}×3^{0}×5^{3}).

In fact, any positive integer can be uniquely represented as an infinite product taken over all the positive prime numbers,

where a finite number of the *n*_{i} are positive integers, and the rest are zero. Allowing negative exponents provides a canonical form for positive rational numbers.

### Arithmetic operations

This representation is convenient for expressions like these for the product, gcd, and lcm:

While expressions like these are of great theoretical importance their practical use is limited by our ability to factor numbers.

### Arithmetical functions

{{#invoke:main|main}}

Many arithmetical 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 of two natural numbers *a* and *b*, then *p* divides *a* or *p* divides *b* (or both). That article has a proof of Euclid's lemma (in a nutshell: Euclid's lemma follows from Bézout's identity which in turn follows from Euclid's algorithm.)

### Existence

We need to show that every integer greater than 1 is a product of primes.
By induction: assume it is true for all numbers between 1 and *n*. If *n* is prime, there is nothing more to prove (a prime is a trivial product of primes, a "product" with only one factor). Otherwise, there are integers *a* and *b*, where *n* = *ab* and Template:Nowrap begin1 < *a* ≤ *b* < *n*.Template:Nowrap end
By the induction hypothesis,
Template:Nowrap begin*a* = *p*_{1}*p*_{2}...*p*_{j}Template:Nowrap end
and
Template:Nowrap begin*b* = *q*_{1}*q*_{2}...*q*_{k}Template:Nowrap end are products of primes. But then
Template:Nowrap begin*n* = *ab* = *p*_{1}*p*_{2}...*p*_{j}*q*_{1}*q*_{2}...*q*_{k}Template:Nowrap end is a product of primes.

### Uniqueness

Assume that *s* > 1 is the product of prime numbers in two different ways:

We must show *m* = *n* and that the *q*_{j} are a rearrangement of the *p*_{i}.

By Euclid's lemma, *p*_{1} must divide one of the *q*_{j}; relabeling the *q*_{j} if necessary, say that *p*_{1} divides *q*_{1}. But *q*_{1} is prime, so its only divisors are itself and 1. Therefore, *p*_{1} = *q*_{1}, so that

Reasoning the same way, *p*_{2} must equal one of the remaining *q*_{j}. Relabeling again if necessary, say *p*_{2} = *q*_{2}. Then

This can be done for each of the *m* *p*_{i}'s, showing that *m* ≤ *n* and every *p*_{i} is a *q*_{j}. Applying the same argument with the 's and 's reversed shows *n* ≤ *m* (hence *m* = *n*) and every *q*_{j} is a *p*_{i}.

### 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 there must be at least two primes in each factorization of *s*:

If any *p*_{i} = *q*_{j} then, by cancellation, *s*/*p*_{i} = *s*/*q*_{j} would be a positive integer greater than 1 with two distinct factorizations. But *s*/*p*_{i} is smaller than *s*, meaning *s* would not actually be the smallest such integer. Therefore every *p*_{i} must be distinct from every *q*_{j}.

Without loss of generality, take *p*_{1} < *q*_{1} (if this is not already the case, switch the *p* and *q* designations.) Consider

and note that 1 < *q*_{2} ≤ *t* < *s*. Therefore *t* must have a unique prime factorization. By rearrangement we see,

Here *u* = ((*p*_{2} ... *p*_{m}) - (*q*_{2} ... *q*_{n})) is positive, for if it were negative or zero then so would be its product with *p*_{1}, but that product equals *t* which is positive. So *u* is either 1 or factors into primes. In either case, *t* = *p*_{1}*u* yields a prime factorization of *t*, which we know to be unique, so *p*_{1} appears in the prime factorization of *t*.

If (*q*_{1} - *p*_{1}) equaled 1 then the prime factorization of *t* would be all *q'*s, which would preclude *p*_{1} from appearing. Thus (*q*_{1} - *p*_{1}) is not 1, but is positive, so it factors into primes: (*q*_{1} - *p*_{1}) = (*r*_{1} ... *r*_{h}). This yields a prime factorization of

which we know is unique. Now, *p*_{1} 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 *p*_{1} is a factor of (*q*_{1} - *p*_{1}), so there exists a positive integer *k* such that *p*_{1}*k* = (*q*_{1} - *p*_{1}), and therefore

But that means *q*_{1} 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 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.^{[10]}

Similarly, in 1844 while working on cubic reciprocity, Eisenstein introduced the ring , where is a cube root of unity. This is the ring of Eisenstein integers, and he proved it has the six units and that it has unique factorization.

However, it was also discovered that unique factorization does not always hold. An example is given by . In this ring one has^{[11]}

Examples like this caused the notion of "prime" to be modified. In 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 (only divisible by itself or a unit) but not **prime** in in (if it divides a product it must divide one of the factors). The mention of is required because 2 is prime and irreducible in Similarly, 5 is prime and irreducible in and not prime nor irreducible in Using these definitions it can be proven that in any ring a prime must be irreducible. Euclid's classical lemma can be rephrased as "in the ring of integers every irreducible is prime". This is also true in and but not in

The rings where every irreducible is prime are called unique factorization domains. As the name indicates, the fundamental theorem of arithmetic is true in them. 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.

## See also

## Notes

- ↑
^{1.0}^{1.1}Template:Harvtxt - ↑ Template:Harvtxt
- ↑ Using the empty product rule one need not exclude the number 1, and the theorem can be stated as: every positive integer has unique prime factorization.
- ↑ Template:Harvtxt
- ↑ Template:Harvtxt
- ↑ Template:Harvtxt
- ↑ Template:Harvtxt
- ↑ Template:Harvtxt
- ↑ Template:Harvtxt
- ↑ Gauss, BQ, §§ 31–34
- ↑ Template:Harvtxt

## References

The *Disquisitiones Arithmeticae* has been translated from Latin into English and German. The German edition includes all of his papers on number theory: all the proofs of quadratic reciprocity, the determination of the sign of the Gauss sum, the investigations into biquadratic reciprocity, and unpublished notes.

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

The two monographs Gauss published on biquadratic reciprocity have consecutively numbered sections: the first contains §§ 1–23 and the second §§ 24–76. Footnotes referencing these are of the form "Gauss, BQ, § *n*". Footnotes referencing the *Disquisitiones Arithmeticae* are of the form "Gauss, DA, Art. *n*".

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

These are in Gauss's *Werke*, Vol II, pp. 65–92 and 93–148; German translations are pp. 511–533 and 534–586 of the German edition of the *Disquisitiones*.

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}.

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}.

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}

- Weisstein, Eric W., "Abnormal number",
*MathWorld*. - Weisstein, Eric W., "Fundamental Theorem of Arithmetic",
*MathWorld*.

## External links

- GCD and the Fundamental Theorem of Arithmetic at cut-the-knot.
- PlanetMath: Proof of fundamental theorem of arithmetic
- Fermat's Last Theorem Blog: Unique Factorization, a blog that covers the history of Fermat's Last Theorem from Diophantus of Alexandria to the proof by Andrew Wiles.
- "Fundamental Theorem of Arithmetic" by Hector Zenil, Wolfram Demonstrations Project, 2007.
- Template:Cite web