The Timpson Lyceum seal

The Timpson Lyceum · Discrete Math (2025)

Fundamental Theorem of Arithmetic - Lecture 21 (Discrete Math)

Overview

This lecture proves the Fundamental Theorem of Arithmetic: every positive integer has a unique prime factorization. The argument has two halves — existence (every integer factors into primes) and uniqueness (it factors in only one way) — and both run by way of contradiction using the well-ordering principle and the smallest counterexample. With that theorem secured, the lecture closes with two classic "for fun" applications that depend on it: Euclid's proof that there are infinitely many primes, and the proof that 2\sqrt{2} is irrational. Together these show how a single structural fact about the integers powers some of the oldest and most famous results in mathematics.

Key Concepts

Prime factorization. Writing a positive integer as a product of prime numbers, e.g. 60=22⋅3⋅560 = 2^2 \cdot 3 \cdot 5. A prime p>1p > 1 has no positive divisors other than 11 and pp; a composite is an integer greater than 11 that is not prime, so it can be written as abab with 1<a,b<n1 < a, b < n.

Edge cases.

Fundamental Theorem of Arithmetic. Every positive integer nn has a prime factorization, and that factorization is unique up to the order of the factors.

Key lemma (proved previously, used in uniqueness). If a prime pp divides a product of primes q1q2⋯qmq_1 q_2 \cdots q_m, then pp must equal one of those primes qiq_i. This is Euclid's lemma, and it is the hinge of the uniqueness argument.

Well-ordering principle. Every nonempty subset of the positive integers has a least element. This is what licenses the "smallest counterexample" technique: assume the set of counterexamples is nonempty, take its smallest member, and derive a contradiction — forcing the set to be empty.

Existence — proof strategy. Let X={ k∈Z+:k has no prime factorization }X = \{\, k \in \mathbb{Z}^+ : k \text{ has no prime factorization}\,\}. Note 1∉X1 \notin X and no prime is in XX. Suppose X≠∅X \neq \varnothing; by well-ordering it has a least element x>1x > 1. Since xx is not prime it is composite, so x=abx = ab with 1<a,b<x1 < a, b < x. Because xx is the smallest integer lacking a factorization, both aa and bb do factor into primes. Multiplying those factorizations gives a prime factorization of xx — contradicting x∈Xx \in X. Hence X=∅X = \varnothing.

Uniqueness — proof strategy. Let Y={ k∈Z+:k has two or more distinct prime factorizations }Y = \{\, k \in \mathbb{Z}^+ : k \text{ has two or more distinct prime factorizations}\,\}. Suppose Y≠∅Y \neq \varnothing with least element yy, written two ways: y=p1p2⋯pn=q1q2⋯qmy = p_1 p_2 \cdots p_n = q_1 q_2 \cdots q_m. No pip_i can equal any qjq_j — otherwise dividing out that common prime would produce a smaller integer with two factorizations, contradicting minimality of yy. But p1∣q1q2⋯qmp_1 \mid q_1 q_2 \cdots q_m, so by Euclid's lemma p1p_1 equals some qjq_j — a shared prime. Contradiction. Hence Y=∅Y = \varnothing: every integer factors in exactly one way.

Infinitude of primes (Euclid). Suppose there are finitely many primes, with largest prime pp. Form Q=(2⋅3⋅5⋯p)+1Q = (2 \cdot 3 \cdot 5 \cdots p) + 1. Dividing QQ by any prime in the list leaves remainder 11, so no known prime divides QQ. But QQ has a prime factorization, so QQ has a prime factor larger than pp — contradicting that pp was largest. This also gives a prime-generating procedure: multiply known primes and add 11 to always uncover a new prime (it skips many, but never fails).

Irrationality of 2\sqrt{2}. Suppose 2=a/b\sqrt{2} = a/b with integers a,ba, b. Then 2b2=a22b^2 = a^2. Counting the power of the prime 22: in a2a^2 it appears an even number of times, while in 2b22b^2 it appears an odd number of times. Since the integer a2=2b2a^2 = 2b^2 has one unique factorization, the count of 22's must agree — even cannot equal odd. Contradiction, so 2\sqrt{2} is irrational. The Greeks found this shocking: a line segment they could construct (the diagonal of a unit square) corresponds to no ratio of integers, meaning no common unit ever measures both the side and the diagonal of a square.

Worked Example

Claim: 2\sqrt{2} is irrational.

Assume for contradiction that 2=a/b\sqrt{2} = a/b for integers a,ba, b. Squaring and clearing the denominator gives 2b2=a22b^2 = a^2. Let e2(⋅)e_2(\cdot) denote the number of times the prime 22 appears in a number's factorization. Squaring doubles every exponent, so e2(a2)=2 e2(a)e_2(a^2) = 2\,e_2(a) (even) while e2(2b2)=2 e2(b)+1e_2(2b^2) = 2\,e_2(b) + 1 (odd). Unique factorization forces these counts to be equal:

2=ab  ⟹  2b2=a2e2 ⁣(2b2)=e2 ⁣(a2)2 e2(b)+1=2 e2(a)2 e2(b)+1⏟odd=2 e2(a)⏟even\begin{aligned} \sqrt{2} = \frac{a}{b} \;\Longrightarrow\; 2b^2 &= a^2 \\ e_2\!\left(2b^2\right) &= e_2\!\left(a^2\right) \\ 2\,e_2(b) + 1 &= 2\,e_2(a) \\ \underbrace{2\,e_2(b)+1}_{\text{odd}} &= \underbrace{2\,e_2(a)}_{\text{even}} \end{aligned}

No integer is both even and odd, so the equation is impossible. Therefore no such a,ba, b exist, and 2\sqrt{2} is irrational. ■\blacksquare

Summary