MATH2400 2,839 words·15 min read

Divisibility and Primes

Sets and Closure#

A set is an unordered collection of distinct mathematical objects.
Sets can be denoted by S={a,b,c}S=\{a,b,c\}, where SS is a set and a,ba,b and cc are elements of the set SS.

To represent membership, we use x∈Sx \in S, stating that xx is in SS. Therefore, we can say that a∈S,a \in S, read as "aa is an element of SS".

A subset is a set whose elements are also all elements of another set; denoted as T⊆ST \subseteq S. We can say that {b}⊆S\{b\} \subseteq S as {b}\{b\} is a set containing the element bb.

Some examples of special sets include:

N={0,1,2,3,4,5,… }\mathbb{N} = \{0,1,2,3,4,5,\dots\}

called the set of natural numbers, which are all whole numbers from zero onwards. It is important to remember that the naturals contains 0.
Another set can be the set of integers,

Z={…,−3,−2,−1,0,1,2,3,… }\mathbb{Z} = \{\dots,-3,-2,-1,0,1,2,3,\dots\}

which is the set of naturals with the inclusion of the negative numbers.
You can also restrict sets with rules, such as:

Z+={1,2,3,… }\mathbb{Z}^+ = \{1,2,3,\dots\}

which is the set of positive integers, (notice the ++ sign).
Another set can be the rational numbers,

Q={pq:p∈Z,q∈Z+} \mathbb{Q} = \{\frac{p}{q}:p \in \mathbb{Z}, q \in \mathbb{Z}^+ \}

where pp is any integer, and qq is a positive integer, representing any number that is a fraction.
Furthermore, there is the set of the reals,

R={All points on the real number line},\mathbb{R} = \{\text{All points on the real number line}\},

which includes irrational numbers such as 2\sqrt{2} or π\pi.
And finally, there is the set of the complex numbers,

C={a+bi:a,b∈R,i2=−1}\mathbb{C} = \{a+bi: a,b \in \mathbb{R}, i^2=-1\}

Note:

Z+⊆N⊆Z⊆Q⊆R⊆C.\mathbb{Z}^+ \subseteq \mathbb{N} \subseteq \mathbb{Z} \subseteq \mathbb{Q} \subseteq \mathbb{R} \subseteq \mathbb{C}.

Nested number sets showing positive integers inside natural numbers, integers, rationals, reals, and complex numbers, with example elements in each

A set SS is said to be closed under addition if for any x,y∈Sx,y \in S, x+y∈Sx+y \in S.
This means that addition between any two elements within a set must also result in an element in that same set:

−2,3∈Z⇒−2+3∈Z.-2,3 \in \mathbb{Z} \Rightarrow -2 + 3 \in \mathbb{Z}.

Each of the sets that we've looked at so far are closed under addition.

A set SS is said to be closed under multiplication if for any x,y∈S,x⋅y∈Sx,y \in S, x \cdot y \in S;

2,e∈R⇒2⋅e∈R\sqrt{2},e \in \mathbb{R} \Rightarrow \sqrt{2} \cdot e \in \mathbb{R}

Each of the sets that we've looked at so far are also closed under multiplication.

Example. A set SS is said to be closed under subtraction if, given any x,y∈Sx,y \in S, we have that x−y∈Sx - y \in S.
Decide whether each of the following sets is closed under subtraction.

Closed under subtraction Not closed
N\mathbb{N}
Z\mathbb{Z}
Z+\mathbb{Z}^+
Q\mathbb{Q}
R\mathbb{R}
C\mathbb{C}
The reason N\mathbb{N} and Z+\mathbb{Z}^+:

 Consider 1,2∈N,Z+,1−2=−1, However, −1∉N,Z+.\begin{align*} \text{ Consider } &1,2 \in \mathbb{N}, \mathbb{Z}^+, \\ &1-2 = -1, \\ \text{ However, } &-1 \notin \mathbb{N}, \mathbb{Z}^+. \end{align*}

Example. Decide whether each of the following sets is closed under division (excluding division by 00): N,Z,Z+,Q,R,C\mathbb{N}, \mathbb{Z}, \mathbb{Z}^+, \mathbb{Q}, \mathbb{R}, \mathbb{C}.
None of N,Z\mathbb{N},\mathbb{Z} or Z+\mathbb{Z}^+ are closed under division;

 Consider 1,2∈N,Z,Z+,1÷2=12, However, 12∉N,Z,Z+.\begin{align*} \text{ Consider } &1,2 \in \mathbb{N}, \mathbb{Z}, \mathbb{Z}^+, \\ &1\div 2 = \frac{1}{2}, \\ \text{ However, } &\frac{1}{2} \notin \mathbb{N}, \mathbb{Z}, \mathbb{Z}^+. \end{align*}

On the other hand, Q,R\mathbb{Q},\mathbb{R} and C\mathbb{C} are closed under division; dividing by any non-zero element keeps you in the set. For example, given pq,rs∈Q\frac{p}{q}, \frac{r}{s} \in \mathbb{Q} with rs≠0\frac{r}{s} \neq 0,

pq÷rs=psqr,\frac{p}{q} \div \frac{r}{s} = \frac{ps}{qr},

which is still a ratio of integers with a non-zero denominator; i.e. still rational. Therefore, Q,R\mathbb{Q}, \mathbb{R} and C\mathbb{C} are closed under division, whilst N,Z\mathbb{N}, \mathbb{Z} and Z+\mathbb{Z}^+ are not.

This failure of closure is basically the reason Number Theory exists; since dividing one integer by another is not guaranteed to give an integer, the special cases where it does are worth studying in their own right. That is exactly the idea of divisibility.

Divisibility#

Given two integers aa and bb, we say that aa divides bb if we can write b=akb = ak, for some integer kk. This can also be represented by

a∣b, read as ‘a divides b’ and means that b=ak for some integer k.a∤b read as ‘a does not divide b’ and means that b≠ak for any integer k.\begin{align*} a \mid b \text{, read as ‘} a \text{ divides } b \text{' and means that } b=ak \text{ for some integer } k. \\ a \nmid b \text{ read as ‘} a \text{ does not divide } b \text{' and means that } b \neq ak \text{ for any integer } k. \end{align*}

Notice that the first statement requires at least one integer kk, whilst the second requires it to be false for any integer kk.

If a∣ba \mid b, we can equivalently say that aa is a divisor of bb, aa is a factor of bb, bb is divisible by aa, or bb is a multiple of aa; these all mean exactly the same thing, so don't get thrown off if a question uses one phrasing over another.

Example. Decide whether the following statements are true or false.

3∣15: True, since 15=3×5.15∣3: False, since 3=15k forces k=15∉Z.3∣3: True, since 3=3×1.−5∣15: True, since 15=(−5)×(−3).\begin{align*} 3 \mid 15 &: \text{ True, since } 15 = 3 \times 5. \\ 15 \mid 3 &: \text{ False, since } 3 = 15k \text{ forces } k = \tfrac{1}{5} \notin \mathbb{Z}. \\ 3 \mid 3 &: \text{ True, since } 3 = 3 \times 1. \\ -5 \mid 15 &: \text{ True, since } 15 = (-5) \times (-3). \end{align*}

Notice how the order matters (3∣153 \mid 15 but 15∤315 \nmid 3), and how divisors are perfectly allowed to be negative; kk just has to be some integer.

Example. Is it true that 0∣30 \mid 3?
Using our definition, in order for it to be true, we would need to be able to find an integer kk such that 33 is equal to 00 times kk;

3=0k,k∈Z.3 = 0k, k \in \mathbb{Z}.

However, the right hand side here is always going to be equal to zero regardless of kk, therefore
0∤30 \nmid 3.

Example. Is it true that 3∣03 \mid 0?
Using our definition again, we need to find an integer kk such that 0 is equal to 3 times kk,

0=3k,k∈Z,0 = 3k, k \in \mathbb{Z},

we can see here that setting k=0k=0, we see that the statement is true. Therefore, 3∣03 \mid 0.

Regarding 0, is it true that 0∣00 \mid 0?
It is indeed true; every number divides 0, including 0 itself.

Example. For which integers xx is it true that 0∣x0 \mid x?
By the definition, 0∣x0 \mid x requires an integer kk with

x=0kx=0.\begin{align*} x &= 0k \\ x &= 0. \end{align*}

So the only integer that 00 divides is 00 itself. Therefore, 0∣x0 \mid x if and only if x=0x = 0.

Be careful not to mix up the two directions: every integer divides 00, but 00 divides nothing except 00.

x∣0 for all x∈Z,but0∣x  ⟺  x=0.\boxed{x \mid 0 \text{ for all } x \in \mathbb{Z}, \quad \text{but} \quad 0 \mid x \iff x = 0.}

Note

Lemma 1.1
For all integers aa, we have that a∣aa \mid a. That is, ∣\mid is reflexive.
Since a=a⋅1a = a \cdot 1 and 1∈Z1 \in \mathbb{Z}, taking k=1k = 1 in the definition immediately gives a∣aa \mid a.

Note

Lemma 1.2
For all integers a,b,ca, b, c if a∣ba \mid b and b∣cb \mid c, then a∣ca \mid c. That is, ∣\mid is transitive.
We are given that b=akb = ak and c=bℓc = b\ell, for some k,ℓ∈Zk,\ell \in \mathbb{Z}, we can rewrite b=akb = ak to get c=(ak)ℓc = (ak) \ell; c=a(kℓ)c = a(k\ell).
Since kℓ∈Zk \ell \in \mathbb{Z}, we conclude that a∣ca \mid c.

Note

Lemma 1.3
For all integers a,b,ca,b,c, if a∣ba \mid b and a∣ca \mid c, then a∣bx+cya \mid bx + cy for any x,y∈Zx,y \in \mathbb{Z}.
By definition, b=akb = ak and c=aℓc = a \ell, for some k,ℓ∈Zk, \ell \in \mathbb{Z}.
Given any integers x,yx,y,

bx+cy=a(kx+ℓy)bx + cy = a(kx +\ell y)

Since kx+ℓy∈Zkx + \ell y \in \mathbb{Z}, we can conclude that a∣bx+cya \mid bx+cy.

A couple of handy facts fall straight out of these lemmas:

  • a∣ama \mid am for any integer mm; take b=c=ab = c = a and x=m,y=0x = m, y = 0 in Lemma 1.3.
  • If a∣ba \mid b, then a∣bma \mid bm for any integer mm; take c=bc = b and x=m,y=0x = m, y = 0.

Basically, once aa divides something, it also divides every multiple of that thing, and every "integer combination" of things it already divides. Lemma 1.3 is the real workhorse of this topic; most divisibility proofs boil down to writing your target as bx+cybx + cy for clever choices of xx and yy.

Example. Suppose that aa is a positive integer such that a∣2n+3a \mid 2n+3 and a∣n+1a \mid n+1 for some integer nn. Show that a=1a = 1.
The trick is to use Lemma 1.3 to eliminate nn. Choosing x=1x = 1 and y=−2y = -2,

a∣(2n+3)(1)+(n+1)(−2)a∣2n+3−2n−2a∣1.\begin{align*} a &\mid (2n+3)(1) + (n+1)(-2) \\ a &\mid 2n+3-2n-2 \\ a &\mid 1. \end{align*}

The only positive integer dividing 11 is 11 itself. Therefore, a=1a = 1.

Example. Prove that 3∣4n−13 \mid 4^n - 1 for all n∈Nn \in \mathbb{N}.
This is a classic induction + divisibility combo; whenever the nn sits in an exponent, induction is usually the way to go.
Let P(n)P(n) be the statement "3∣4n−13 \mid 4^n -1".
Base case: P(0)P(0) states that 3∣40−13 \mid 4^0 - 1, i.e. 3∣03 \mid 0, which is true since every integer divides 00.
Inductive step: suppose that P(n)P(n) holds, i.e. 3∣4n−13 \mid 4^n - 1. Then,

4n+1−1=4⋅4n−1=4(4n−1)+4−1=4(4n−1)+3.\begin{align*} 4^{n+1} - 1 &= 4 \cdot 4^n - 1 \\ &= 4(4^n - 1) + 4 - 1 \\ &= 4(4^n-1) + 3. \end{align*}

Since 3∣4n−13 \mid 4^n - 1 (inductive hypothesis) and 3∣33 \mid 3 (reflexivity), Lemma 1.3 with x=4,y=1x = 4, y = 1 tells us that 3∣4(4n−1)+3(1)3 \mid 4(4^n-1) + 3(1); that is, 3∣4n+1−13 \mid 4^{n+1}-1. Hence P(n)⇒P(n+1)P(n) \Rightarrow P(n+1), and by induction 3∣4n−13 \mid 4^n - 1 for all n∈Nn \in \mathbb{N}. ■\blacksquare

Example. Prove that for all integers nn, if 3∤n23 \nmid n^2 then 3∤n3 \nmid n.
Proving this directly is awkward, because "∤\nmid" gives us no equation to work with. Instead, we prove the contrapositive, which is logically equivalent:

if 3∣n, then 3∣n2.\text{if } 3 \mid n \text{, then } 3 \mid n^2.

Proof. Suppose that 3∣n3 \mid n, so n=3kn = 3k for some k∈Zk \in \mathbb{Z}. Then,

n2=(3k)2=9k2=3(3k2).\begin{align*} n^2 &= (3k)^2 \\ &= 9k^2 \\ &= 3(3k^2). \end{align*}

Since 3k2∈Z3k^2 \in \mathbb{Z}, we have 3∣n23 \mid n^2; this proves the contrapositive, and hence the original statement. ■\blacksquare
When a divisibility statement starts with "does not divide", try the contrapositive first; it turns ∤\nmid into ∣\mid, which hands you an actual equation like n=3kn = 3k to substitute.

Primes#

Uhm this is self explanatory so I'm not gonna write much;

A prime is defined as a number in Z\mathbb{Z} such that it is not 0 or ±10 \text{ or } \pm1, and it's only divisors are ±1\pm 1 and the number itself.

A composite is a number in Z\mathbb{Z} that is not 0,±10, \pm 1 or a prime.

More formally, the lecture defines primes via irreducibility:

Note

Definition
An irreducible number (or irreducible element of N\mathbb{N}) is any p∈Np \in \mathbb{N} such that both

  • pp is not 00 or 11, and
  • the only divisors of pp in N\mathbb{N} are 11 and pp.

A prime number (or just a prime) is an irreducible number.

Note

Definition
An irreducible integer (or irreducible element of Z\mathbb{Z}) is any p∈Zp \in \mathbb{Z} such that both

  • pp is not 00, 11, or −1-1, and
  • the only divisors of pp in Z\mathbb{Z} are 11, −1-1, pp, and −p-p.

A prime integer is an irreducible integer, and a composite integer is any integer that is not 00, 11, −1-1, or a prime integer.

Basically, a prime refuses to factorise; the only way to write it as a product of integers is the boring way, ±1\pm 1 times ±\pm itself. The first few prime numbers are 2,3,5,7,11,13,17,19,…2,3,5,7,11,13,17,19,\dots, but notice that over Z\mathbb{Z} the prime integers also include the negatives −2,−3,−5,−7,…-2,-3,-5,-7,\dots, and likewise the composite integers include −4,−6,−8,−9,…-4, -6, -8, -9, \dots. The numbers 00 and ±1\pm 1 are deliberately excluded from both camps (what makes them so special gets explored later in the course, in Lectures 2.3, 3.2 and 7.1).

Note

Theorem
Suppose that aa and bb are integers and pp is a prime integer.
If p∣abp \mid ab, then p∣ap \mid a or p∣bp \mid b.
Note: pp can divide both aa and bb; they are not exclusive.

Basically, a prime cannot be "split" across a product; if it divides the whole thing, it must divide at least one of the pieces. This property is actually how prime elements are defined in general (the proof is in Lecture 1.3).

It is important to note that this property fails for composite numbers. For example, 6∣4×96 \mid 4 \times 9 (since 4×9=36=6×64 \times 9 = 36 = 6 \times 6), yet 6∤46 \nmid 4 and 6∤96 \nmid 9; the 66 got split into a 22 (hiding inside the 44) and a 33 (hiding inside the 99). That can only happen because 66 is composite.

Example. Suppose that pp is prime and p∣a2p \mid a^2 for some integer aa. Show that p∣ap \mid a.
Since a2=a⋅aa^2 = a \cdot a, applying the theorem with b=ab = a gives

p∣a⋅a  ⟹  p∣a or p∣a,p \mid a \cdot a \implies p \mid a \text{ or } p \mid a,

which is just p∣ap \mid a. Therefore, p∣ap \mid a; a prime dividing a perfect square must divide the base. (This is the key step in the classic proof that 2\sqrt{2} is irrational.)

Example. Prove that 6∣n3−n6 \mid n^3 - n for all integers nn.
First, factorise;

n3−n=n(n2−1)=(n−1)n(n+1),\begin{align*} n^3 - n &= n(n^2-1) \\ &= (n-1)n(n+1), \end{align*}

which is a product of three consecutive integers. Out of any two consecutive integers one must be even, so 2∣n3−n2 \mid n^3 - n; out of any three consecutive integers one must be a multiple of 33, so 3∣n3−n3 \mid n^3 - n.
Now we combine the two. Write n3−n=3ℓn^3 - n = 3\ell for some ℓ∈Z\ell \in \mathbb{Z}. Since 2∣3ℓ2 \mid 3\ell and 22 is prime, the prime divisor theorem says that 2∣32 \mid 3 or 2∣ℓ2 \mid \ell; clearly 2∤32 \nmid 3, so 2∣ℓ2 \mid \ell, i.e. ℓ=2k\ell = 2k for some k∈Zk \in \mathbb{Z}. Hence,

n3−n=3ℓ=3(2k)=6k.\begin{align*} n^3 - n &= 3\ell \\ &= 3(2k) \\ &= 6k. \end{align*}

Therefore, 6∣n3−n6 \mid n^3 - n for every integer nn. ■\blacksquare
Notice how "2∣m2 \mid m and 3∣m3 \mid m, therefore 6∣m6 \mid m" needed an actual argument; you cannot just multiply divisors together in general (4∣124 \mid 12 and 6∣126 \mid 12, but 24∤1224 \nmid 12). It only worked here because one of the divisors was a prime not dividing the other.

Example. Suppose p∣ap \mid a where pp is prime and aa is an integer. Prove that p∤a+1p \nmid a + 1.
Suppose, for contradiction, that p∣ap \mid a and p∣a+1p \mid a+1. By Lemma 1.3 with x=−1,y=1x = -1, y = 1,

p∣a(−1)+(a+1)(1)p∣1.\begin{align*} p &\mid a(-1) + (a+1)(1) \\ p &\mid 1. \end{align*}

But the only divisors of 11 are ±1\pm 1, and a prime is not ±1\pm 1; contradiction. Therefore, p∤a+1p \nmid a+1. In other words, consecutive integers never share a prime factor — keep this in your back pocket, it is exactly the trick that powers Euclid's proof below.

Mersenne primes are primes of the form 2p−12^p -1 where pp is prime.

Fermat primes are primes of the form 22n+12^{2^n} +1 where nn is a natural number.

Twin prime pairs are pairs of primes that differ from each other by 2, such as (3,5)(3,5) or (71,73).(71,73).

Sophie Germain primes are primes pp for which 2p+12p+1 is also prime, such as
33 (since 7 is prime) or 5353 (since 107 is prime).

For such a fundamental object, surprisingly little is actually known about primes; it is still an open problem whether there are infinitely many of any of the four types above. Some things we do know:

  • The largest known Mersenne prime to date is 282 589 933−12^{82\,589\,933} - 1.
  • Only five Fermat primes are currently known: 3,5,17,257,655373, 5, 17, 257, 65537.
  • It was shown in 2018 (Maynard, Tao, Zhang, et al.) that there are infinitely many pairs of primes that differ by at most 246246; the largest known twin prime pair has 388342388342 digits in each prime.
  • The largest known Sophie Germain pair (p,2p+1)(p, 2p+1) also starts with a 388342388342-digit prime.

This mystery is also useful; finding large primes is computationally hard, but doing arithmetic with them is computationally easy, and cryptography schemes are built exactly on that imbalance (more on this later in the course).

Example. We have 2047=211−12047 = 2^{11} - 1, and 1111 is prime. Is 20472047 a Mersenne prime?
No! Checking small prime divisors,

2047=23×89,\begin{align*} 2047 &= 23 \times 89, \end{align*}

so 20472047 is composite, and being composite it cannot be a Mersenne prime (or any kind of prime). A prime exponent pp does not guarantee that 2p−12^p - 1 is prime; it only makes it a candidate. Compare with 25−1=312^5 - 1 = 31 and 27−1=1272^7 - 1 = 127, which really are Mersenne primes.

Example. Show that if 2n−12^n - 1 is prime, then nn must be prime.
This explains why the Mersenne definition insists on a prime exponent in the first place. Once again the direct statement is awkward, so we prove the contrapositive: if nn is composite, then 2n−12^n - 1 is composite.
Suppose that n=abn = ab, where a,ba, b are integers with 1<a,b<n1 < a, b < n. Recall the factorisation xb−1=(x−1)(xb−1+xb−2+⋯+x+1)x^b - 1 = (x-1)(x^{b-1} + x^{b-2} + \dots + x + 1); substituting x=2ax = 2^a,

2n−1=(2a)b−1=(2a−1)((2a)b−1+(2a)b−2+⋯+2a+1).\begin{align*} 2^n - 1 &= (2^a)^b - 1 \\ &= (2^a - 1)\left( (2^a)^{b-1} + (2^a)^{b-2} + \dots + 2^a + 1 \right). \end{align*}

Since 1<a<n1 < a < n, we have 1<2a−1<2n−11 < 2^a - 1 < 2^n - 1, so 2a−12^a - 1 is a divisor of 2n−12^n - 1 that is neither 11 nor the number itself; hence 2n−12^n - 1 is composite. ■\blacksquare
For instance, 24−1=15=(22−1)(22+1)=3×52^4 - 1 = 15 = (2^2-1)(2^2+1) = 3 \times 5; a composite exponent never even had a chance.

Example. Classify each of 55, 3131 and 257257 as Mersenne, Fermat, twin and/or Sophie Germain primes.
For 55:

5=221+1Fermat prime,(3,5) and (5,7) are both prime pairstwin prime (twice over),2(5)+1=11, which is primeSophie Germain prime.\begin{align*} 5 &= 2^{2^1} + 1 &&\text{Fermat prime}, \\ (3,5) \text{ and } (5,7) &\text{ are both prime pairs} &&\text{twin prime (twice over)}, \\ 2(5) + 1 &= 11, \text{ which is prime} &&\text{Sophie Germain prime}. \end{align*}

It is not Mersenne, since 2p−1=52^p - 1 = 5 would need 2p=62^p = 6, which is not a power of 22.
For 3131:

31=25−1, and 5 is primeMersenne prime,(29,31) is a prime pairtwin prime.\begin{align*} 31 &= 2^5 - 1, \text{ and } 5 \text{ is prime} &&\text{Mersenne prime}, \\ (29, 31) &\text{ is a prime pair} &&\text{twin prime}. \end{align*}

It is not Fermat (22n=302^{2^n} = 30 is impossible) and not Sophie Germain, since 2(31)+1=63=7×92(31)+1 = 63 = 7 \times 9 is composite.
For 257257:

257=223+1Fermat prime.\begin{align*} 257 &= 2^{2^3} + 1 &&\text{Fermat prime}. \end{align*}

It is not Mersenne (2p−1=2572^p - 1 = 257 would need 2p=2582^p = 258, which is not a power of 22), not twin (255=5×51255 = 5 \times 51 and 259=7×37259 = 7 \times 37 are both composite) and not Sophie Germain, since 2(257)+1=515=5×1032(257) + 1 = 515 = 5 \times 103 is composite.
Therefore, 55 is simultaneously Fermat, twin and Sophie Germain; 3131 is Mersenne and twin; and 257257 is only Fermat. The categories are not mutually exclusive — always check each definition separately.

Two Key Theorems about Primes#

Note

Fundamental Theorem of Arithmetic
Every positive integer greater than 1 has a unique prime factorisation; any positive integer n>1n > 1 can be written uniquely in the form

n=p1α1p2α2p3α3…pkαkn = p_1^{\alpha_1} p_2^{\alpha_2} p_3^{\alpha_3} \dots p_k^{\alpha_k}

where p1,p2…pkp_1,p_2 \dots p_k are primes such that p1<p2<⋯<pkp_1 < p_2 < \dots < p_k and α1,α2,…,αk\alpha_1, \alpha_2, \dots, \alpha_k are positive integers for some k∈Z+k \in \mathbb{Z}^+.

Strong Induction
Involves two things,
(1). Proving a base case P(n0)P(n_0).
(2). Proving that if P(m)P(m) holds for all n0≤m<nn_0 \leq m < n, then P(n)P(n) holds.
In other words, strong induction involves proving that every value less than nn is true in order to verify if nn is true for a given statement.
If p(0)p(0) and p(1)p(1) is true, we can use this information to confirm whether or not p(2)p(2) is true;

P(n0)P(n0+1)⋮P(n−1)}⟶P(n).\left. \begin{matrix} P(n_0) \\ P(n_0 + 1) \\ \vdots \\ P(n - 1) \end{matrix} \right\} \longrightarrow P(n).

We now use strong induction to prove the Fundamental theorem of Arithmetic.
In order to complete our induction we simply need to confirm if for all p(m)p(m),

P(m)=“The integer m has a unique prime factorisation".\boxed{P(m)=\text{“The integer } m \text{ has a unique prime factorisation"}. }

(1).
Our base case can be P(2)P(2), since 2 is the smallest number that is itself a prime and is its own unique prime factorisation. With this, we have completed the first step.

(2).
Since our base case is 2,

P(2)P(3)⋮P(n−1)}⟶P(n) \left. \begin{matrix} P(2) \\ P(3) \\ \vdots \\ P(n - 1) \end{matrix} \right\} \longrightarrow \quad P(n)

Now for the choice of nn, we have two possibilities,

  1. nn is prime, meaning that it's prime factorisation is simply n=n.n = n.
  2. nn is composite. In this case, nn can be written as n=abn=ab, where a,ba,b are both integers larger than 1 and less than nn. Since aa is greater than 1 and strictly less than nn, this means that aa is a part of our inductive hypothesis,

P(2)⋮P(a)⋮P(n−1)}⟶P(n)\left. \begin{matrix} P(2) \\ \vdots \\ P(a) \\ \vdots \\ P(n - 1) \end{matrix} \right\} \longrightarrow \quad P(n)

in other words, aa has a unique prime factorisation. bb is also similarly strictly between 1 and nn, meaning it also has a unique prime factorisation. We can combine the unique prime factorisations of aa and bb together to get the nthn_{\text{th}} prime factorisation.

However, we haven't shown that the nthn_{\text{th}} prime factorisation is unique, only that it exists.
Let's suppose that nn had two prime factorisations; it can be written in two ways:

n=p1α1p2α2p3α3…pkαk=q1β1q2β2q3β3…qℓβℓ.n=p_{1}^{\alpha_1} p_{2}^{\alpha_2} p_{3}^{\alpha_3} \dots p_{k}^{\alpha_k} = q_{1}^{\beta_1} q_{2}^{\beta_2} q_{3}^{\beta_3} \dots q_{\ell}^{\beta_\ell}.

Where each pk,qℓp_k,q_{\ell} are primes. Looking at p1p_1, we know that it divides nn, p1∣np_1 \mid n, and therefore it divides one of the terms on the RHS, p1∣q1β1q2β2q3β3…qℓβℓp_1 \mid q_{1}^{\beta_1} q_{2}^{\beta_2} q_{3}^{\beta_3} \dots q_{\ell}^{\beta_\ell}. Since all of our qq terms give us all of the prime factors of nn, and p1p_1 is a prime factor of nn, this means that p1p_1 must be equal to one of those qq terms. Suppose that it is equal to qiq_i, giving us

n=p1α1p2α2p3α3…pkαk=q1β1…p1βi…qℓβℓ. n=p_{1}^{\alpha_1} p_{2}^{\alpha_2} p_{3}^{\alpha_3} \dots p_{k}^{\alpha_k} = q_{1}^{\beta_1} \dots p_{1}^{\beta_i} \dots q_{\ell}^{\beta_\ell}.

If we divide both sides by p1p_1, we get

n>p1α1−1p2α2p3α3…pkαk=q1β1…p1βi−1…qℓβℓ. n > p_{1}^{\alpha_1-1} p_{2}^{\alpha_2} p_{3}^{\alpha_3} \dots p_{k}^{\alpha_k} = q_{1}^{\beta_1} \dots p_{1}^{\beta_i - 1} \dots q_{\ell}^{\beta_\ell}.

Since both statements are now smaller than nn but larger than 11, the statements are a part of our inductive hypothesis and therefore must have a unique prime factorisation, meaning that both statements are identical. Since both of the expressions are identical, we can multiply both expressions by p1p_1 to get nn, meaning that nn must have a unique prime factorisation.

This completes the proof.

Example. Find the prime factorisation of 11761176.
Peel off primes from smallest to largest;

1176=2×588=22×294=23×147=23×3×49=23×3×72.\begin{align*} 1176 &= 2 \times 588 \\ &= 2^2 \times 294 \\ &= 2^3 \times 147 \\ &= 2^3 \times 3 \times 49 \\ &= 2^3 \times 3 \times 7^2. \end{align*}

Therefore, 1176=23⋅3⋅721176 = 2^3 \cdot 3 \cdot 7^2, and by the Fundamental Theorem of Arithmetic this is the only way to write 11761176 as a product of primes (the condition p1<p2<⋯<pkp_1 < p_2 < \dots < p_k is what pins down the ordering, so we don't count 3⋅72⋅233 \cdot 7^2 \cdot 2^3 as a "different" factorisation).

Example. Use the Fundamental Theorem of Arithmetic to prove that 2\sqrt{2} is irrational.
Suppose, for contradiction, that 2=pq\sqrt{2} = \frac{p}{q} for some p∈Z,q∈Z+p \in \mathbb{Z}, q \in \mathbb{Z}^+. Squaring both sides and rearranging,

2=p2q22q2=p2.\begin{align*} 2 &= \frac{p^2}{q^2} \\ 2q^2 &= p^2. \end{align*}

Now count how many times the prime 22 appears on each side. By the FTA, pp and qq each have a unique prime factorisation; say 22 appears in them with exponents α\alpha and β\beta respectively (possibly 00). Squaring doubles every exponent, so 22 appears in p2p^2 exactly 2α2\alpha times — an even number of times — whilst it appears in 2q22q^2 exactly 2β+12\beta + 1 times — an odd number of times. But 2q22q^2 and p2p^2 are the same integer, so by uniqueness of the prime factorisation they must contain exactly the same number of 22s. An even number can never equal an odd number, so we have a contradiction; hence 2\sqrt{2} is irrational. ■\blacksquare

Basically, a perfect square must contain an even amount of every prime, and 2q22q^2 is stuck with an odd amount of 22s, so it can never be a perfect square. The exact same exponent-counting argument shows 3,5,6,…\sqrt{3}, \sqrt{5}, \sqrt{6}, \dots are irrational; the FTA turns questions about irrationality into questions about parity.

Note

Euclid's theorem
There are infinitely many primes.

To prove this theorem, we will use proof by contradiction.

Suppose that there are finitely many primes;

p1,p2,p3…pn,p_1,p_2,p_3 \dots p_n,

where n∈Z+n \in \mathbb{Z}^+. Consider the number

P=p1p2p3…pn+1.P = p_1 p_2 p_3 \dots p_n + 1.

By the Fundamental Theorem of Arithmetic, there is a prime qq such that

q∣Pandq∣P−1,q \mid P \quad \text{and} \quad q \mid P - 1,

q∣Pq \mid P as every number must have a unique prime factorisation, and since PP is a product of every prime, qq definitely divides P−1P - 1. Since it divides both PP and P−1P-1, it must divide P−(P−1)P - (P - 1), or 11, but if q∣1q \mid 1, that must mean qq is 1. However, 1 is not a prime number, and we assumed that qq is a prime. This is a contradiction, and hence our original assumption was false.

Example. A common trap is to think that Euclid's construction P=p1p2p3…pn+1P = p_1p_2p_3\dots p_n + 1 always produces a prime. Show that this is false by considering the first six primes.

P=2×3×5×7×11×13+1=30030+1=30031=59×509,\begin{align*} P &= 2 \times 3 \times 5 \times 7 \times 11 \times 13 + 1 \\ &= 30030 + 1 \\ &= 30031 \\ &= 59 \times 509, \end{align*}

and both 5959 and 509509 are prime, so 3003130031 is composite. This doesn't break the proof at all; the proof only needs some prime factor qq of PP, and shows that qq cannot be on our supposedly complete list (since qq would divide both PP and P−1P - 1). Here, 5959 and 509509 are indeed both missing from {2,3,5,7,11,13}\{2,3,5,7,11,13\}, which is exactly the kind of "new prime" the argument promises.
Euclid's argument does not claim that p1p2…pn+1p_1p_2 \dots p_n + 1 is prime; it only claims that its prime factors are new.