Skip to content
Theorem·T10

The division algorithm

Dividing with remainder: quotient and remainder exist and are unique.

For all with , there exist unique such that is the quotient and the remainder of divided by . Addition from D027, multiplication from D028, order from D029.
In words
For any natural numbers a and b with b non-zero, there is exactly one pair of natural numbers q and r such that a equals q times b plus r and r is strictly below b: q is the quotient and r the remainder of a divided by b.
Never needed: F05 · F10 · F13 · A02 · A03 · A04 · A05 · A07 (computed from the citation graph, not asserted).

Proof

  1. 1
    Existence, by induction on (T05 on , Separation; fixed throughout).
  2. 2
    Base: : take . Indeed by Claim A of L11 and D027; and because (L15 (iv)) and .
  3. 3
    Step: let with . Then by the second equation of D027 read right to left. Since , L15 (v) gives , so two cases.
  4. 4
    Case : the pair witnesses directly.
  5. 5
    Case : then by Claim B of L11 read right to left, so using (D027), and as in the base case: the pair works. T05 closes existence.
  6. 6
    Uniqueness of the quotient: suppose with and , and suppose ; by L16 assume (the other case is symmetric). L17 (ii) gives with , and L15 (vii) writes . Then by distributivity (mirrored via L12) and Claim B of L11. So using associativity, and cancellation leaves .
  7. 7
    Rearranging with commutativity and associativity, , so by L17 (i). But , and chaining gives (L15 (ii), equality case by substitutivity), contradicting irreflexivity (L15 (i), negation). Hence .
  8. 8
    Uniqueness of the remainder: with , the equation reads , and cancellation gives .

Remarks

Euclidean division, the fundamental computation of arithmetic. Everything algorithmic about the integers flows from it: decimal notation (divide by ten, keep the remainder), the Euclidean algorithm for greatest common divisors, and modular arithmetic ( and are congruent mod when they leave the same remainder). The existence half is a single induction; the uniqueness half is where the order theory of L17 and L18 earns its keep. Note the theorem does not need well-ordering, though the textbook proof via "least " uses it; on , plain induction suffices.

Used by