Divisibility & Unique Factorisation

definitions
discrete-math
number-theory
divisibility

Definition

\[d \mid n \iff d \neq 0 \text{ and } n = dk \text{ for some integer } k\]

Both \(n\) and \(d\) must be integers, and \(d \neq 0\) — this side condition is part of the definition, not an afterthought. Equivalently, \(d \mid n \iff \frac{n}{d} \in \mathbb{Z}\).

All of these say the same thing:

  • \(d\) divides \(n\)
  • \(d\) is a divisor of \(n\)
  • \(d\) is a factor of \(n\)
  • \(n\) is a multiple of \(d\)

\(d \nmid n\) means \(d\) does not divide \(n\). Note that \(d \mid n\) is a statement (it has a truth value) — \(2 \mid 6\) is true, \(10 \nmid 5\) is true since \(\frac{5}{10} \notin \mathbb{Z}\).

Proving and disproving divisibility statements

The pattern for a direct proof: unfold \(d \mid n\) into \(n = dk\), do algebra, then re-fold into the definition by exhibiting the integer witness.

\(\forall a, b, c \in \mathbb{Z}\), if \(c \mid a\) then \(c \mid ab\).

Let \(a, b, c \in \mathbb{Z}\) and suppose \(c \mid a\). Then \(\exists k \in \mathbb{Z}\) such that \(a = ck\). Multiplying both sides by \(b\): \(ab = ckb = c(kb)\). Since \(k, b \in \mathbb{Z}\) we have \(kb \in \mathbb{Z}\). Thus \(c \mid ab\). \(\square\)

\(\forall m \in \mathbb{Z}\), \(6m(2m + 10m^2)\) is divisible by 4.

Let \(m \in \mathbb{Z}\). Then \(6m(2m + 10m^2) = 2(3m) \cdot 2(m + 5m^2) = 4 \big(3m(m + 5m^2)\big)\). Since \(m \in \mathbb{Z}\), \(3m(m + 5m^2) \in \mathbb{Z}\). Thus \(4 \mid 6m(2m + 10m^2)\). \(\square\)

\(\forall a, b, c \in \mathbb{Z}\), if \(a \mid (b + c)\) then \(a \mid b\) or \(a \mid c\)false. Counterexample \(a = 3, b = 4, c = 2\): \(a \mid (b+c)\) since \(3 \mid 6\), but \(3 \nmid 4\) and \(3 \nmid 2\).

\(\forall a, b, m \in \mathbb{Z}\), if \(m \mid (a+b)\) then \(m \mid (a-b)\)false. A counterexample needs the hypothesis true and the conclusion false:

\(m \mid (a+b)\) \(m \mid (a-b)\) conditional
\(m=5, a=20, b=10\) \(5 \mid 30\) T \(5 \mid 10\) T T
\(m=5, a=21, b=13\) \(5 \mid 34\) F \(5 \mid 8\) F T
\(m=5, a=27, b=7\) \(5 \mid 34\) F \(5 \mid 20\) T T
\(m=5, a=19, b=-9\) \(5 \mid 10\) T \(5 \mid 28\) F F
\(m=5, a=23, b=12\) \(5 \mid 35\) T \(5 \mid 11\) F F
\(m=5, a=-10, b=-3\) \(5 \mid -13\) F \(5 \mid -7\) F T

Only the two rows with hypothesis T and conclusion F are counterexamples.

\(\forall m, n, q \in \mathbb{Z}\), if \(m \mid n\) and \(n \mid q\) then \(m^2 \mid nq\)true.

Let \(m, n, q\) be non-zero integers with \(m \mid n\) and \(n \mid q\). By definition there exist \(a, b \in \mathbb{Z}\) with \(n = ma\) and \(q = nb\). Then \[nq = (ma)(nb) = ma \cdot (mab) = m^2(a^2b).\] Since \(a^2 b \in \mathbb{Z}\), we conclude \(m^2 \mid nq\). \(\square\)

If \(k\) is even and \(m\) is odd, then \((k+2)^2 - (m-3)^2\) is divisible by 4.

Let \(k = 2a\) and \(m = 2b+1\) for some \(a, b \in \mathbb{Z}\). Then \((k+2)^2 = (2a+2)^2 = 4(a+1)^2\) and \((m-3)^2 = (2b-2)^2 = 4(b-1)^2\), so \[(k+2)^2 - (m-3)^2 = 4\big((a+1)^2 - (b-1)^2\big),\] and \((a+1)^2 - (b-1)^2 \in \mathbb{Z}\). \(\square\)

\(\forall c, d, e \in \mathbb{Z}\), if \(c \mid d\) and \(c \nmid e\), then \(c \nmid (d+e)\).

Proof by contradiction. Suppose there exist integers \(c, d, e\) with \(c \mid d\), \(c \nmid e\) and \(c \mid (d+e)\). Then \(d = cx\) for some \(x \in \mathbb{Z}\), and \(d + e = cy\) for some \(y \in \mathbb{Z}\). Hence \(cx + e = cy\), so \(e = c(y - x)\) with \(y - x \in \mathbb{Z}\) — so \(c \mid e\), a contradiction. \(\square\)

Every integer \(n > 1\) is a product of primes

Proof by contradiction. Suppose the theorem is false. Then there exists an integer \(n > 1\) that is not a product of primes. Choose the smallest such \(n\) — such a smallest one exists by the well-ordering principle. Choosing the smallest is what lets us assume every integer strictly between \(1\) and \(n\) is a product of primes.

Every integer \(n > 1\) is either prime or composite (not both).

Case 1: \(n\) is prime. Then \(n\) is a product of primes (namely itself) — contradiction.

Case 2: \(n\) is composite. Then \(n = rs\) for positive integers \(r, s\) with \(r \neq 1\) and \(s \neq 1\), which forces \(1 < r < n\) and \(1 < s < n\). Because \(n\) was chosen smallest, both \(r\) and \(s\) are products of primes, say \(r = p_1 p_2 \cdots p_k\) and \(s = q_1 q_2 \cdots q_\ell\). Therefore \(n = rs = p_1 \cdots p_k q_1 \cdots q_\ell\) is a product of primes too.

Either way \(n\) is a product of primes, contradicting our choice of \(n\). \(\square\)

Unique Factorisation Theorem

Provided in the exam. This theorem and the Quotient-Remainder Theorem are both stated on the MATH1061/MATH7861 Examination Formula Page, so they can be cited rather than restated from memory — see also logical-equivalence-laws for the rest of what that page carries.

Given any integer \(n > 1\), the standard factored form of \(n\) is \[n = p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k}\] where \(k \in \mathbb{Z}^+\), the \(p_i\) are primes, the \(e_i\) are positive integers, and \(p_1 < p_2 < \cdots < p_k\).

Both the primes and their exponents are unique — this is what makes the factored form a canonical fingerprint of an integer, and it’s the engine behind divisor counting, gcd and lcm (see gcd-lcm-and-euclidean-algorithm).

Counting divisors from the factorisation

Any positive divisor of \(n = p_1^{e_1} \cdots p_k^{e_k}\) has the form \(p_1^{a_1} \cdots p_k^{a_k}\) with \(0 \leq a_i \leq e_i\), so there are

\[(e_1 + 1)(e_2 + 1) \cdots (e_k + 1)\]

positive divisors.

\(6975 = 3^2 \cdot 5^2 \cdot 31\), found by trial division: \(6975 = 3 \cdot 2325 = 3 \cdot 3 \cdot 775 = 3 \cdot 3 \cdot 5 \cdot 155 = 3^2 \cdot 5^2 \cdot 31\). A divisor has \(0\), \(1\) or \(2\) threes; \(0\), \(1\) or \(2\) fives; and \(0\) or \(1\) thirty-ones — so \(3 \cdot 3 \cdot 2 = 18\) positive divisors.

\(27720 = 2^3 \cdot 3^2 \cdot 5 \cdot 7 \cdot 11\).

\(1400 = 2^3 \cdot 5^2 \cdot 7\), worked through:

  • \(1400 = 2(700) = 2 \cdot 2(350) = 2 \cdot 2(35)(10) = 2^2 (5 \cdot 7)(2 \cdot 5) = 2^3 \cdot 5^2 \cdot 7^1\) — note the primes are written in increasing order.
  • \(1400^2 = (2^3 \cdot 5^2 \cdot 7)^2 = 2^6 \cdot 5^4 \cdot 7^2\) — raising to a power multiplies the exponents.
  • \(1400^3 = 1400 \cdot 1400^2 = 2^9 \cdot 5^6 \cdot 7^3\) — multiplying adds the exponents.
  • Number of positive divisors of \(1400\): \((3+1)(2+1)(1+1) = 24\).
  • Divisors of \(1400\) divisible by \(8\): all factors of the form \(2^3 \cdot 5^* \cdot 7^*\), i.e. \(8, 40, 200, 56, 280, 1400\).
  • Smallest \(n\) with \(1400n\) a perfect square: \(1400n = t^2\) needs every exponent even. \(t^2 = 2^3 \cdot 5^2 \cdot 7^1 \cdot n\), and splitting each power in half (bigger halves on the left) gives \(t = 2^2 \cdot 5^1 \cdot 7^1\) against \(2^1 \cdot 5^1 \cdot 7^0 \cdot n\), so \(n = 2 \cdot 7 = 14\).

Primality testing

Lemma: for every integer \(n > 1\), if no integer \(x\) in the range \(1 < x \leq \sqrt{n}\) divides \(n\), then \(n\) is prime.

This is why trial division only has to go as far as \(\sqrt{n}\) — for \(6975\), only up to \(\sqrt{6975} = 83.51\dots\)

Proof by contraposition. The contrapositive is: \(\forall n \in \mathbb{Z}^{\geq 2}\), if \(n\) is not prime, then there exists an integer \(x\) with \(1 < x \leq \sqrt{n}\) such that \(x \mid n\).

Suppose \(n \in \mathbb{Z}^{\geq 2}\) and \(n\) is not prime. Then \(n\) is composite, so by definition \(\exists r, s \in \mathbb{Z}^+\) with \(n = rs\) and \(1 < r < n\) and \(1 < s < n\).

Case 1: \(r = s\). Then \(r = s = \sqrt{n}\).

Case 2: \(r \neq s\). Then one of \(r, s\) is less than \(\sqrt{n}\) and the other greater — if both were greater we’d have \(rs > n\), and if both were less we’d have \(rs < n\).

In either case there is an \(x \in \{r, s\}\) with \(1 < x \leq \sqrt{n}\) and \(x \mid n\). \(\square\)

There are infinitely many primes

Lemma: for any integer \(a\) and any prime \(p\), if \(p \mid a\) then \(p \nmid (a+1)\).

Proof by contradiction. Let \(a \in \mathbb{Z}\), let \(p\) be prime, suppose \(p \mid a\), and assume for a contradiction that \(p \mid (a+1)\). Since \(p \mid a\) there exists \(k \in \mathbb{Z}\) with \(a = pk\); since \(p \mid (a+1)\) there exists \(\ell \in \mathbb{Z}\) with \(a + 1 = p\ell\). So \[1 = (a+1) - a = p\ell - pk = p(\ell - k),\] and \(\ell - k \in \mathbb{Z}\), so \(p \mid 1\). But \(p \geq 2\) for any prime, whereas \(p \mid 1\) forces \(p = \pm 1\) — a contradiction. \(\square\)

Theorem: there are an infinite number of primes.

Proof by contradiction. Suppose the number of primes is finite. Then some prime \(p\) is the largest, and we can list every prime in ascending order: \(2, 3, 5, 7, 11, \dots, p\).

Let \(N = (2 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdots p) + 1\).

Then \(N > 1\), so by the Unique Factorisation Theorem \(N\) is a product of primes and hence divisible by some prime \(q\). Because \(q\) is prime it must be one of \(2, 3, 5, 7, 11, \dots, p\).

So \(q\) divides \(2 \cdot 3 \cdot 5 \cdots p\) — that is, \(q \mid (N - 1)\) — and hence by the lemma \(q \nmid \big((2 \cdot 3 \cdot 5 \cdots p) + 1\big) = N\).

So \(q\) divides \(N\) and \(q\) does not divide \(N\): a contradiction. Therefore the original statement is true. \(\square\)

See also