taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.1-5

Exercise 1.2.1-5

proved in Lean solution written

Rating21
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.1 of Volume 1. Companion chapter: Mathematical induction

The task

Show by induction that each integer larger than 11 is a product of one or more primes.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

The statement for nn may need the statement for smaller numbers that are not n−1n - 1, so use the strong form of induction.

Hint 2

Split the cases: nn is a prime, or nn has a divisor strictly between 11 and nn.

Solution

Show the solution

Let P(n)P(n) be the statement "nn is a product of one or more primes", for n≥2n \ge 2. Assume P(k)P(k) for each kk with 2≤k<n2 \le k < n. (For n=2n = 2 this assumption is empty, and the proof below still works.)

Case 1: nn is a prime. Then nn is the product of the one prime nn.

Case 2: nn is not a prime. Then n>1n > 1 has a positive divisor kk other than 11 and nn. Write n=kmn = km with an integer mm. Since 1<k<n1 < k < n, also 1<m=n/k<n1 < m = n/k < n. By the assumption, k=p1⋯psk = p_1 \cdots p_s and m=ps+1⋯ptm = p_{s+1} \cdots p_t for some primes. Then n=p1⋯ptn = p_1 \cdots p_t is a product of primes.

So P(n)P(n) holds in both cases. By strong induction it holds for all n≥2n \ge 2. □\square

Check

60=6⋅10=(2⋅3)(2⋅5)=2⋅2⋅3⋅560 = 6 \cdot 10 = (2 \cdot 3)(2 \cdot 5) = 2 \cdot 2 \cdot 3 \cdot 5 and 9797 is a prime, a product of one prime. A python3 run that applies the rule to all n≤1000n \le 1000 gave a product of primes that equals nn each time.

Remarks

The factorization is also unique apart from order. That is a different theorem. Its proof needs the lemma that a prime that divides a product divides one of the factors, and this lemma follows from the extended Euclid's algorithm of this section.

This solution is checked, and a person has not reviewed it yet. The source.

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.