Exit
Lesson 051 · Step 1 of 5Streak 00

Dividing with a remainder

Theorem 20

Division algorithm

For integers aa and b>0b > 0 there are integers qq and rr with a=b⋅q+ra = b\cdot q + r and 0≤r<b0 \le r < b.

  1. 01Let SS be the set of non-negative integers of the form a−b⋅qa - b\cdot q, over all integers qq.Define SS
  2. 02SS is not empty: taking q=−∣a∣q = -|a| gives a+b⋅∣a∣≥0a + b\cdot |a| \ge 0.Nonempty
  3. 03Let rr be the smallest element of SS, say r=a−b⋅qr = a - b\cdot q.Smallest element
  4. 04If r≥br \ge b, then r−b=a−b⋅(q+1)r - b = a - b\cdot (q + 1) is in SS and smaller than rr, a contradiction.Contradiction
  5. 05So 0≤r<b0 \le r < b, and a=b⋅q+ra = b\cdot q + r. ■\blacksquareConclusion