Exercise 31.1-1

Prove that if \(a > b > 0\) and \(c = a + b\), then \(c \text{ mod } a = b\).

Mathematically:

\[\begin{align*} c \text{ mod } a &= (a + b) \text{ mod } a \\ &= a \text{ mod } a + b \text{ mod } a \\ &= 0 + b \\ &= b \end{align*}\]

This conclusion also follows from a careful reading of Theorem 31.1 which defines the concept of a remainder as follows:

For any integer \(a\) and any positive integer \(n\), there exist unique integers \(q\) and \(r\) such that \(0 \le r < n\) and \(a = qn + r\). The value \(q = \lfloor \frac{a}{n} \rfloor\) is the quotient of the division. The value \(r = a \text{ mod } n\) is the remainder of the divison.

So in our case, \(c \text{ mod } a = b\) is simply a restating of the core remainder concept with differently labeled variables.