I'm self-studying Analysis from Terence Tao's "Analysis I" and one of the exercises given is prove the following proposition
Proposition 2.3.9 (Euclidean Algorithm). Let $n$ be a natural number and let $q$ be a positive natural number. Then there exist natural numbers $m$, $r$ such that $0 \leq r < q$ and $n = mq + r$.
I'm fairly new to proving so I initially got stuck so I looked at the hint which was to fix $q$ and induct on $n$. And now I currently have the following:
Proof.
We fix $q$ and use induction on $n$. We first prove the base case $n=0$. If we set $m=0$ and $r=0$ then we have $n = 0 \cdot q + 0 = 0$ but $0 \leq 0 < q$, so we are done with the base case.
Now suppose inductively that $n = m \cdot q + r$ for some natural numbers $m$, $r$ such that $0 \leq r < q$ and $n = mq + r$. We wish to show that there exist natural numbers $m'$ and $r'$ such that $n+1= m' \cdot q + r'$ where $0\leq r'< q$.
From the inductive hypothesis we have $n+1 = mq + (r+1)$.
Since $r<q$, $r+1 \leq q$ that is $r+1 = q$ or $r+1 <q$.
If $r+1 = q$, we set $m' = m+1$ and $r'=0$ then $m' \cdot q + r' = (m+1) \cdot q + 0$ but $n+1 =(m+1) \cdot q + 0$, so $n+1 = m' \cdot q + r'$ and $0\leq r'< q$.
If however $r+1 <q$ then we set $m' = m$ and $r' = r+1$ then we have that $n+1 = m' \cdot q + r'$ and $0\leq r'< q$.
This completes the induction. $$\tag*{$\Box$}$$
I'd be grateful for any corrections or suggestions for improvement.