1.1.4. The Fundamental Theorem of Arithmetic

This section is based on parts of [BUR11, Sec. 3.1, Sec. 3.2, Sec. 6.1].

Recall the following basic definition.

Definition 1.1.4.1.

An integer p>1{p>1} is prime if it has exactly two positive divisors, necessarily 11 and pp. A positive integer n>1{n>1} that is not prime is said to be composite.

Primes have an important property that we use often throughout Part 1.

Theorem 1.1.4.2 (Euclid’s Lemma).

Let pp be a prime and a,b∈ℤ{a,b\in\mathbb{Z}}. Then p∣a⁢b{p\mid ab} if and only if p∣a{p\mid a} or p∣b{p\mid b} (possibly both).

Proof.

Suppose that p∣a⁢b{p\mid ab}. If p∣a{p\mid a}, then there is nothing to prove. Suppose that p∤a{p\nmid a}. Since gcd⁡(a,p)\gcd(a,p) is a positive divisor of the prime pp, we must have gcd⁡(a,p)=1{\gcd(a,p)=1} or gcd⁡(a,p)=p{\gcd(a,p)=p}. But gcd⁡(a,p)=p{\gcd(a,p)=p} is impossible since p∤a{p\nmid a} by assumption. Therefore, gcd⁡(a,p)=1{\gcd(a,p)=1}. Corollary 1.1.3.18 yields p∣b{p\mid b}. The converse statement does not need pp to be prime (Proposition 1.1.1.6(10)). ∎

Corollary 1.1.4.3.

Let pp and p1,…,pkp_{1},\dots,p_{k} be primes. If pp divides the product p1⁢⋯⁢pkp_{1}\cdots p_{k}, then there exists 1≤i≤k{1\leq i\leq k} such that p=pi{p=p_{i}}.

Proof.

Since pp is prime, by induction, Euclid’s Lemma (Theorem 1.1.4.2) implies that there exists 1≤i≤k{1\leq i\leq k} such that pp divides pip_{i}. Since pip_{i} is prime, p=1{p=1} or p=pi{p=p_{i}}, but p=1{p=1} is impossible by definition. ∎

Corollary 1.1.4.4.

Let p,qp,q be primes and b≥1{b\geq 1} an integer. If p∣qb{p\mid q^{b}}, then p=q{p=q}.

Proof.

Take k=b{k=b} and p1=⋯=pk=q{p_{1}=\cdots=p_{k}=q} in Corollary 1.1.4.3. ∎

As its name suggests, the following (familiar) theorem plays a crucial role in the sequel. It formalises the fact that every positive integer >1{>1} admits a unique prime factorisation.

Theorem 1.1.4.5 (Fundamental Theorem of Arithmetic).

Let n>1{n>1} be an integer. Then there exist a unique integer k≥1{k\geq 1}, unique primes p1<p2<⋯<pk{p_{1}<p_{2}<\dots<p_{k}}, and unique positive integers a1,…,aka_{1},\dots,a_{k} such that

n=p1a1⁢⋯⁢pkak.n=p_{1}^{a_{1}}\cdots p_{k}^{a_{k}}.
Proof.

If nn is prime, then we take k=1{k=1}, p1=n{p_{1}=n} and a1=1{a_{1}=1}. Uniqueness of this factorisation is clear in this case: by Corollary 1.1.4.4, if a prime pp divides nn, then p=n{p=n}.

Suppose now that nn is composite. We first prove that the required factorisation exists. The integer nn admits a positive divisor different from 11 and nn. Let

p1≔min⁡{d∈ℕ:1<d⁢<n,d∣⁢n}.p_{1}\coloneqq\min\{d\in\mathbb{N}\colon{1<d<n,\ d\mid n}\}.

We claim that p1p_{1} is prime. Indeed, otherwise p1p_{1} admits a positive divisor 1<d<p1{1<d<p_{1}}; but then d∣p1{d\mid p_{1}} and p1∣n{p_{1}\mid n}, so that d∣n{d\mid n} (Proposition 1.1.1.6(9)). This contradicts the minimality of p1p_{1}. Since p1≥2{p_{1}\geq 2}, we have

1<p1<p12<p13<⋯.1<p_{1}<p_{1}^{2}<p_{1}^{3}<\cdots.

Proposition 1.1.2.1 implies that there exists a largest positive integer a1a_{1} such that p1a1∣n{p_{1}^{a_{1}}\mid n}. Set n1≔n{n_{1}\coloneqq n} and n2≔n1/p1a1≥1{n_{2}\coloneqq n_{1}/p_{1}^{a_{1}}\geq 1}, so that n1=p1a1⁢n2{n_{1}=p_{1}^{a_{1}}n_{2}}. By Proposition 1.1.1.6(9), every positive divisor dd of n2n_{2} is a divisor of n1n_{1}; since d≤n2<n1{d\leq n_{2}<n_{1}}, d=1{d=1} or p1<d{p_{1}<d} (the equality p1=d{p_{1}=d} is impossible since it implies p1a1+1∣n1{p_{1}^{a_{1}+1}\mid n_{1}}).

Iterating this procedure yields a decreasing sequence of integers

n1>n2>n3>⋯≥1,n_{1}>n_{2}>n_{3}>\cdots\geq 1,

and hence there exists a first integer k≥1{k\geq 1} such that nk+1=1{n_{k+1}=1}, together with primes

1<p1<p2<⋯<pk1<p_{1}<p_{2}<\cdots<p_{k}

such that

ni+1=nipiai.n_{i+1}=\frac{n_{i}}{p_{i}^{a_{i}}}.

Notice that ni=piai⁢ni+1{n_{i}=p_{i}^{a_{i}}n_{i+1}}. Here, pip_{i} is the smallest divisor of nin_{i} greater than 11, and aia_{i} is the largest positive integer such that piai∣ni{p_{i}^{a_{i}}\mid n_{i}}. In particular, nk=pkak{n_{k}=p_{k}^{a_{k}}} with ak≥1{a_{k}\geq 1}. This yields the required factorisation

n=n1=p1a1⁢n2=p1a1⁢p2a2⁢n3=⋯=p1a1⁢⋯⁢pkak.n=n_{1}=p_{1}^{a_{1}}n_{2}=p_{1}^{a_{1}}p_{2}^{a_{2}}n_{3}=\cdots=p_{1}^{a_{1}% }\cdots p_{k}^{a_{k}}.

We now prove the uniqueness of the factorisation by induction on the number kk of distinct primes in the factorisation constructed above. Suppose that there are an integer ℓ≥1{\ell\geq 1}, primes q1<q2<⋯<qℓ{q_{1}<q_{2}<\dots<q_{\ell}}, and positive integers b1,…,bℓb_{1},\dots,b_{\ell} such that

n=q1b1⁢⋯⁢qℓbℓ.n=q_{1}^{b_{1}}\cdots q_{\ell}^{b_{\ell}}.

By Corollary 1.1.4.3, there exists 1≤j≤ℓ{1\leq j\leq\ell} such that p1=qj{p_{1}=q_{j}}. Also, since nn is composite, n≠qi{n\neq q_{i}} for 1≤i≤ℓ{1\leq i\leq\ell}. The minimality of p1p_{1} then implies

p1≤q1<⋯<qℓ.p_{1}\leq q_{1}<\cdots<q_{\ell}.

Hence, we must have p1=q1{p_{1}=q_{1}}. Then, by the maximality of a1a_{1}, we must also have b1≤a1{b_{1}\leq a_{1}}. Since

n=p1a1⁢p2a2⁢⋯⁢pkak=p1b1⁢q2b2⁢⋯⁢qℓbℓ,n=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{k}^{a_{k}}=p_{1}^{b_{1}}q_{2}^{b_{2}}% \cdots q_{\ell}^{b_{\ell}},

dividing by p1b1p_{1}^{b_{1}} we obtain

p1a1−b1⁢p2a2⁢⋯⁢pkak=q2b2⁢⋯⁢qℓbℓ.p_{1}^{a_{1}-b_{1}}p_{2}^{a_{2}}\cdots p_{k}^{a_{k}}=q_{2}^{b_{2}}\cdots q_{% \ell}^{b_{\ell}}.

In view of Corollary 1.1.4.3, the prime p1p_{1} does not divide the right-hand side, and hence a1−b1=0{a_{1}-b_{1}=0} or, equivalently, a1=b1{a_{1}=b_{1}}. As above, inductively, we set n1≔n{n_{1}\coloneqq n} and n2≔n1/p1a1{n_{2}\coloneqq n_{1}/p_{1}^{a_{1}}}. Consider the factorisations

n2=p2a2⁢⋯⁢pkakandn2=q2b2⁢⋯⁢qℓbℓ.n_{2}=p_{2}^{a_{2}}\cdots p_{k}^{a_{k}}\qquad\text{and}\qquad n_{2}=q_{2}^{b_{% 2}}\cdots q_{\ell}^{b_{\ell}}.

If k=1{k=1}, then n2=1{n_{2}=1}, which implies ℓ=1{\ell=1}, and uniqueness follows. Suppose that k>1{k>1} and that uniqueness holds for every integer greater than 11 whose constructed factorisation involves k−1{k-1} distinct primes. Applied to n2n_{2}, the construction above (or, if n2n_{2} is prime, the first paragraph of the proof) yields precisely the factorisation n2=p2a2⁢⋯⁢pkak{n_{2}=p_{2}^{a_{2}}\cdots p_{k}^{a_{k}}}. By the induction hypothesis, it coincides with n2=q2b2⁢⋯⁢qℓbℓ{n_{2}=q_{2}^{b_{2}}\cdots q_{\ell}^{b_{\ell}}}, so that k=ℓ{k=\ell} and

p1=q1,p2=q2,…,pk=qkanda1=b1,a2=b2,…,ak=bk.p_{1}=q_{1},\ p_{2}=q_{2},\ \dots,\ p_{k}=q_{k}\qquad\text{and}\qquad a_{1}=b_% {1},\ a_{2}=b_{2},\ \dots,\ a_{k}=b_{k}.

This finishes the proof. ∎

End of Lecture 3

Definition 1.1.4.6.

Let n>1{n>1} be an integer. Using the Fundamental Theorem of Arithmetic (Theorem 1.1.4.5), write

n=p1a1⁢⋯⁢pkakn=p_{1}^{a_{1}}\cdots p_{k}^{a_{k}}

with k≥1{k\geq 1} an integer, p1<p2<⋯<pk{p_{1}<p_{2}<\dots<p_{k}} primes, and a1,…,aka_{1},\dots,a_{k} positive integers. We call this the (canonical) prime factorisation of nn; if convenient, we also use the terminology ‘prime factorisation’ when the primes are not ordered.

Remark 1.1.4.7.

The integer 11 can be written as the empty product of primes, and it is convenient to refer to this empty product as the (unique) prime factorisation of 11.

Example 1.1.4.8.

Not covered in the lectureWe have 504=23⋅32⋅7{504=2^{3}\cdot 3^{2}\cdot 7}, etc.

Corollary 1.1.4.9.

Let n>1{n>1} be an integer and

n=p1a1⁢p2a2⁢⋯⁢pkakn=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{k}^{a_{k}}

be its prime factorisation. The positive divisors of nn are the pairwise distinct numbers

p1b1⁢p2b2⁢⋯⁢pkbk,0≤bi≤ai,andbi∈ℤ.p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{k}^{b_{k}},\qquad 0\leq b_{i}\leq a_{i},% \quad\text{and}\quad b_{i}\in\mathbb{Z}.
Proof.

Let b1,…,bkb_{1},\dots,b_{k} be integers such that 0≤bi≤ai{0\leq b_{i}\leq a_{i}} for each 1≤i≤k{1\leq i\leq k}. Set

d≔p1b1⁢p2b2⁢⋯⁢pkbk≥1.d\coloneqq p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{k}^{b_{k}}\geq 1.

Then

n=p1a1⁢p2a2⁢⋯⁢pkak=(p1a1−b1⁢p2a2−b2⁢⋯⁢pkak−bk)⁢(p1b1⁢p2b2⁢⋯⁢pkbk),n=p_{1}^{a_{1}}p_{2}^{a_{2}}\cdots p_{k}^{a_{k}}=(p_{1}^{a_{1}-b_{1}}p_{2}^{a_% {2}-b_{2}}\cdots p_{k}^{a_{k}-b_{k}})(p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{k}^{% b_{k}}),

so that d∣n{d\mid n}.

Conversely, let d>0{d>0} be a divisor of nn. If d=1{d=1}, then we may take b1=⋯=bk=0{b_{1}=\cdots=b_{k}=0}. Suppose that d>1{d>1} and let pp be a prime divisor of dd. Then:

  • •
    ​

    p∣d{p\mid d} and d∣n{d\mid n}, and hence p∣n{p\mid n} (Proposition 1.1.1.6(9)).

  • •
    ​

    Since p∣n{p\mid n} and pp is prime, Corollary 1.1.4.3 implies that there exists 1≤j≤k{1\leq j\leq k} such that p=pj{p=p_{j}}.

This shows that every prime factor of dd is also a prime factor of nn. Consequently, the prime factorisation of dd has the form

d=p1b1⁢p2b2⁢⋯⁢pkbk,0≤biandbi∈ℤ.d=p_{1}^{b_{1}}p_{2}^{b_{2}}\cdots p_{k}^{b_{k}},\qquad 0\leq b_{i}\quad\text{% and}\quad b_{i}\in\mathbb{Z}.

Finally, bi≤ai{b_{i}\leq a_{i}} for each 1≤i≤k{1\leq i\leq k} since pibi∤n{p_{i}^{b_{i}}\nmid n} if bi>ai{b_{i}>a_{i}}. Indeed, if pibi∣n{p_{i}^{b_{i}}\mid n}, then aia_{i} cannot be the exponent of pip_{i} in the prime factorisation of nn. The fact that the numbers p1b1⁢⋯⁢pkbkp_{1}^{b_{1}}\cdots p_{k}^{b_{k}} are pairwise distinct follows from the uniqueness of prime factorisations (Theorem 1.1.4.5). ∎

Example 1.1.4.10.

Not covered in the lecture We have 504=23⋅32⋅7{504=2^{3}\cdot 3^{2}\cdot 7}. By Corollary 1.1.4.9, the number of positive divisors of 504504 is the number of tuples (i,j,k)∈ℤ3{(i,j,k)\in\mathbb{Z}^{3}} such that 0≤i≤3{0\leq i\leq 3}, 0≤j≤2{0\leq j\leq 2} and k=0,1{k=0,1}. Thus, 504504 has 24=4⋅3⋅2{24=4\cdot 3\cdot 2} positive divisors, namely the integers 2i⋅3j⋅7k{2^{i}\cdot 3^{j}\cdot 7^{k}} with i,j,ki,j,k as before.

Corollary 1.1.4.11.

Not covered in the lectureLet n>1{n>1} be a composite integer and pp its smallest positive divisor different from 11. Then pp is prime and satisfies 1<p≤n{1<p\leq\sqrt{n}}.

Proof.

That the divisor p>1{p>1} is prime is shown in the course of the proof of the Fundamental Theorem of Arithmetic (Theorem 1.1.4.5). Since nn is composite and p∣n{p\mid n}, there exists an integer k>1{k>1} such that n=k⁢p{n=kp}. Since k∣n{k\mid n} and pp is the smallest divisor of nn greater than 11, we conclude that p≤k{p\leq k}. Consequently,

p2≤k⁢p=n.p^{2}\leq kp=n.

Therefore, p≤n{p\leq\sqrt{n}}. ∎

Corollary 1.1.4.12.

Let m,n∈ℤ+{m,n\in\mathbb{Z}_{+}} be such that gcd⁡(m,n)=1{\gcd(m,n)=1}. Then the function

f:{(d1,d2)∈ℤ+2:d1⁢∣m⁢ and ⁢d2∣⁢n}\displaystyle f\colon\{(d_{1},d_{2})\in\mathbb{Z}_{+}^{2}\colon{d_{1}\mid m% \text{ and }d_{2}\mid n}\} ⟶{d∈ℤ+:d∣m⁢n}\displaystyle\longrightarrow\{d\in\mathbb{Z}_{+}\colon{d\mid mn}\}
(d1,d2)\displaystyle(d_{1},d_{2}) ⟼d1⁢d2\displaystyle\longmapsto d_{1}d_{2}

is bijective.

Proof.

If d1,d2∈ℤ+{d_{1},d_{2}\in\mathbb{Z}_{+}} are such that d1∣m{d_{1}\mid m} and d2∣n{d_{2}\mid n}, then d1⁢d2∣m⁢n{d_{1}d_{2}\mid mn} by Proposition 1.1.1.6(10). This shows that the function ff is well defined.

The function ff is surjective. Let d∈ℤ+{d\in\mathbb{Z}_{+}} be such that d∣m⁢n{d\mid mn}. If n=1{n=1}, we can take d1=d{d_{1}=d} and d2=1{d_{2}=1} and the factorisation d=d1⁢d2{d=d_{1}d_{2}} has the required properties. Thus, since the roles of mm and nn are symmetric, it remains to deal with the case m,n≠1{m,n\neq 1}. In this case, mm and nn admit prime factorisations

m=p1a1⁢⋯⁢pkakandn=q1b1⁢⋯⁢qℓbℓ.m=p_{1}^{a_{1}}\cdots p_{k}^{a_{k}}\qquad\text{and}\qquad n=q_{1}^{b_{1}}% \cdots q_{\ell}^{b_{\ell}}.

Since gcd⁡(m,n)=1{\gcd(m,n)=1}, the integers mm and nn have no common prime divisors. The prime factorisation of m⁢nmn is therefore

m⁢n=p1a1⁢⋯⁢pkak⁢q1b1⁢⋯⁢qℓbℓ.mn=p_{1}^{a_{1}}\cdots p_{k}^{a_{k}}q_{1}^{b_{1}}\cdots q_{\ell}^{b_{\ell}}.

Let dd be a positive divisor of m⁢nmn. By Corollary 1.1.4.9,

d=p1u1⁢⋯⁢pkuk⁢q1v1⁢⋯⁢qℓvℓ,0≤ui≤ai, 0≤vj≤bj,ui,vj∈ℤ.d=p_{1}^{u_{1}}\cdots p_{k}^{u_{k}}q_{1}^{v_{1}}\cdots q_{\ell}^{v_{\ell}},% \qquad 0\leq u_{i}\leq a_{i},\ 0\leq v_{j}\leq b_{j},\ u_{i},v_{j}\in\mathbb{Z}.

Set d1≔p1u1⁢⋯⁢pkuk{d_{1}\coloneqq p_{1}^{u_{1}}\cdots p_{k}^{u_{k}}} and d2≔q1v1⁢⋯⁢qℓvℓ{d_{2}\coloneqq q_{1}^{v_{1}}\cdots q_{\ell}^{v_{\ell}}}. Again by Corollary 1.1.4.9, d1∣m{d_{1}\mid m} and d2∣n{d_{2}\mid n}. Therefore, d=f⁢(d1,d2){d=f(d_{1},d_{2})}.

The function ff is injective. Let d1,d2,d1′,d2′∈ℤ+{d_{1},d_{2},d_{1}^{\prime},d_{2}^{\prime}\in\mathbb{Z}_{+}} be such that d1∣m{d_{1}\mid m} and d2∣n{d_{2}\mid n}, and such that d1′∣m{d_{1}^{\prime}\mid m} and d2′∣n{d_{2}^{\prime}\mid n}. Suppose that d≔d1⁢d2=d1′⁢d2′{d\coloneqq d_{1}d_{2}=d_{1}^{\prime}d_{2}^{\prime}}. We need to prove that d1=d1′{d_{1}=d_{1}^{\prime}} and d2=d2′{d_{2}=d_{2}^{\prime}}. If m=1{m=1}, then d1=d1′=1{d_{1}=d_{1}^{\prime}=1} and d=d2=d2′{d=d_{2}=d_{2}^{\prime}}. Since the roles of mm and nn are symmetric, this argument also deals with the case n=1{n=1}.

Suppose that m,n>1{m,n>1}. By Corollary 1.1.4.9, d1d_{1} and d2d_{2} can be written in the form

d1=p1u1⁢⋯⁢pkukandd2=q1v1⁢⋯⁢qℓvℓd_{1}=p_{1}^{u_{1}}\cdots p_{k}^{u_{k}}\qquad\text{and}\qquad d_{2}=q_{1}^{v_{% 1}}\cdots q_{\ell}^{v_{\ell}}

for some integers 0≤ui≤ai{0\leq u_{i}\leq a_{i}} and 0≤vj≤bj{0\leq v_{j}\leq b_{j}}. Similarly, the prime factorisations of d1′d_{1}^{\prime} and d2′d_{2}^{\prime} must be of the form

d1′=p1s1⁢⋯⁢pkskandd2′=q1t1⁢⋯⁢qℓtℓd_{1}^{\prime}=p_{1}^{s_{1}}\cdots p_{k}^{s_{k}}\qquad\text{and}\qquad d_{2}^{% \prime}=q_{1}^{t_{1}}\cdots q_{\ell}^{t_{\ell}}

for some integers 0≤si≤ai{0\leq s_{i}\leq a_{i}} and 0≤tj≤bj{0\leq t_{j}\leq b_{j}}. Then the positive integer dd has prime factorisations

p1u1⁢⋯⁢pkuk⁢q1v1⁢⋯⁢qℓvℓ=d=p1s1⁢⋯⁢pksk⁢q1t1⁢⋯⁢qℓtℓ.p_{1}^{u_{1}}\cdots p_{k}^{u_{k}}q_{1}^{v_{1}}\cdots q_{\ell}^{v_{\ell}}=d=p_{% 1}^{s_{1}}\cdots p_{k}^{s_{k}}q_{1}^{t_{1}}\cdots q_{\ell}^{t_{\ell}}.

Since prime factorisations are unique by the Fundamental Theorem of Arithmetic (Theorem 1.1.4.5), we must have ui=si{u_{i}=s_{i}} and vj=tj{v_{j}=t_{j}} for all i,ji,j. This shows that d1=d1′{d_{1}=d_{1}^{\prime}} and d2=d2′{d_{2}=d_{2}^{\prime}}. ∎

Theorem 1.1.4.13 (Euclid).

There are infinitely many primes.

Proof.

There is at least one prime number, namely the integer 22. Let p1,…,pkp_{1},\dots,p_{k} be a finite collection of pairwise distinct primes, with k≥1{k\geq 1}. Set n≔p1⁢⋯⁢pk+1{n\coloneqq p_{1}\cdots p_{k}+1}. By the Division with Remainder Theorem (Theorem 1.1.1.8) and Remark 1.1.1.10, none of the primes pip_{i} in the collection divides nn: since

n=(∏j≠ipj)⁢pi+1,n=\Big{(}\prod_{j\neq i}p_{j}\Big{)}p_{i}+1,

the remainder of division by pip_{i} is 1≠0{1\neq 0}. Since n>1{n>1}, by the Fundamental Theorem of Arithmetic (Theorem 1.1.4.5) the integer nn admits a prime divisor, say qq. Moreover, q≠pi{q\neq p_{i}} for all 1≤i≤k{1\leq i\leq k}. This shows that any finite collection of pairwise distinct primes can be extended to a collection with the same property and one additional prime. Hence, the set of primes is infinite. ∎

Warning 1.1.4.14.

Not covered in the lectureThe number nn constructed in the proof of Theorem 1.1.4.13 need not be prime: Indeed, 16=3⋅5+1{16=3\cdot 5+1} is composite but has the prime divisor 2≠3,5{2\neq 3,5}. Even if p1,…,pk{p_{1},\dots,p_{k}} are the first kk primes, the integer nn need not be prime:

2⋅3⋅5⋅7⋅11⋅13+1=30⁢031=59⋅509.2\cdot 3\cdot 5\cdot 7\cdot 11\cdot 13+1=30~{}031=59\cdot 509.