logo

Fundamental Theorem of Arithmetic Proof 📂Number Theory

Fundamental Theorem of Arithmetic Proof

Theorem 1

Every natural number n>2n >2 has a unique prime factorization n=p1p2prn = p_{1} p_{2} \cdots p_{r}. The order of the primes p1,p2,,prp_{1} , p_{2} , \cdots , p_{r} is ignored.

Explanation

It may seem strange that a property we’ve naturally used since elementary school requires proof, but it is extremely important. The fact that this is so simple perhaps serves as evidence that it merits the name theorem.

Proof

Elementary Proof

Part 1. Existence

Given 2=22=2 and 3=33= 3, and 4=224 = 2^2, there exists a unique prime factorization. For all possible nn, let’s find the prime factorization, and say the last number is NN. Here, N+1N+1 could be a prime or a composite number, so let’s check both cases.

  • Case 1. If N+1N+1 is Prime
    If N+1N+1 is a prime, then it is its own prime factorization.
  • Case 2. If N+1N+1 is Composite
    If N+1N+1 is composite, it can be represented as the product of two natural numbers N+1=n1n2N+1 = n_{1} n_{2}.

Since we’ve found the prime factorization for all natural numbers up to NN, n1=p1p2pmn2=qm+1qm+2qr n_{1} = p_{1} p_{2} \cdots p_{m} \\ n_{2} = q_{m+1} q_{m+2} \cdots q_{r} , by simply multiplying, we obtain N+1=p1p2prN+1 = p_{1} p_{2} \cdots p_{r}, thus we can determine the prime factorization of N+1N+1. Since we can find the prime factorization for N+1N+1 in both cases, all natural numbers greater than 22 have a prime factorization.


Part 2. Uniqueness

Now we need to show that n=p1p2prn = p_{1} p_{2} \cdots p_{r} is unique.

Assuming that nn has a non-unique prime factorization, so that n=p1p2pr=q1q2qsn = p_{1} p_{2} \cdots p_{r} = q_{1} q_{2} \cdots q_{s} holds. The order does not affect uniqueness, so for convenience, let’s say p1p2prp_{1} \le p_{2} \le \cdots \le p_{r}.

Prime Factorization Principle: If a prime pp divides a natural number n:=d1d2dr n : = d_{1} d_{2} \cdots d_{r} such that pnp \mid n, then pp must divide at least one of d1,d2,,drd_{1} , d_{2} , \cdots , d_{r}.

Since a prime dividing some number must divide at least one of its factors, p1p_{1} must divide one of q1,q2,,qsq_{1} , q_{2} , \cdots , q_{s}. The order is free, so a divisible qiq_{i} by p1p_{1} can be considered as q1q_{1}, and q1q_{1} could substitute for qiq_{i}.

However, since q1q_{1} is also a prime like p1p_{1}, p1=q1p_{1} = q_{1} holds and p1p2pr=q1q2qs p_{1} p_{2} \cdots p_{r} = q_{1} q_{2} \cdots q_{s} , eliminating both from each side gives p2pr=q2qs p_{2} \cdots p_{r} = q_{2} \cdots q_{s} . The same method continues until one side becomes 11. If the other side is not 11, the product of primes must be greater than 11, making the equation invalid. Therefore, p1=q1p2=q2pi=qi p_{1} =q_{1} \\ p_{2} = q_{2} \\ \vdots \\ p_{i} = q_{i} \\ \vdots must hold, and finally, pr=qsp_{r} = q_{s} must be true.

Algebraic Proof

Algebraic Proof of the Fundamental Theorem of Arithmetic: The ring of integers Z\mathbb{Z}](../587) is a PID, thus a UFD.

Code

Below is the implementation of prime factorization in R. It’s fast because it doesn’t need to check for primes, using a list of primes instead. As an algorithm, it’s virtually useless. It returns the factorization in list form, which might be less readable. If you want it in exponential form, simply use the built-in function table() on the returned vector.

prime = read.table("../attachment
                   /cfile8.uf@25411C3C5968BBE322F0D4.txt"); prime = prime[,1]
 
factorize<-function(p)
{
  q=p
  factors<-numeric(0)
  i=1; j=1
  while(q!=1)
  {
    if(q%%prime[i]) {i=i+1}
    else
    {
      q<-q/prime[i]
      factors[j]<-prime[i]
      i=1
      j=j+1
    }
  }
  return(factors)
}
 
factorize(54)
factorize(101)
factorize(256)
factorize(420)
table(factorize(420))

Here is the result of running the code.

20190226\_193733.png


  1. Silverman. (2012). A Friendly Introduction to Number Theory (4th Edition): p49. ↩︎