Question: I'm having some trouble understanding the following Corollary (and construction of its proof) given in the book "An Introduction to Mathematical Reasoning".
The main reason being the condition $0 \le q \lt r$, which seems to me non-sense because it would imply that $0 \lt r$, so that $r$ couldn't be zero (contradicting the corollary itself!).
Also, regarding the second sentence of the construction of the proof, wouldn't $gcd(b, r)$ and $gcd(b, 0)$ be two other possible solutions?
Corollary: Let $a$ and $b$ be integers with $b \gt 0$ and suppose that $a = bq +r$ for integers $q$ and $r$ with $0 \le q \lt r$. Then $b$ divides $a$ if and only if $r = 0$.
Construction of the proof: The point here is that if $b$ divides $a$ then, for some integer $q_1$, $a=bq_1=bq_1+r_1$ with $r_1 = 0$. So if $a=bq+r$ with $0 \lt r \lt q$ then $gcd(q, r)$ and $gcd(q_1, 0)$ would be two distinct solutions to the division problem, contradicting the uniqueness part of the division theorem.
For completeness, I leave the statement of the division theorem as given in the book.
Division theorem: Let $a$ and $b$ be integers with $b \gt 0$. Then there are unique integers $q$ and $r$ such that $$a = bq + r \quad and \quad 0 \le r \lt b$$
Thank you.
For your first question, yes, that's surely a typo and should be $0\le r<q$.
As for the second question: I'm pretty sure those gcds shouldn't be there—it seems that they want to say that the ordered pairs $(q,r)$ and $(q_1,0)$ are two distinct solutions to the division problem.