Let $a,b\in\mathbb Z$ and $d=\gcd(a,b)$. Then there exist $x,y\in\mathbb Z$ such that $xa+yb=d$.
I don't really understand the proof for this theorem.
They state the following (translation):
We are going to construct two sequences of integers $x_0,x_1,x_2,\dots$ and $y_0,y_1,y_2,\dots$ such that $$ x_na+y_nb=r_n. $$ For $n=0$ we have $r_n=|a|=\pm a$, so we can take $x_0=\pm 1$ and $y_0=0$. In the same way we can take $x_1=0$ and $y_1=\pm 1$. If $n\geq1$, and $r_n\neq0$, then we can determine $x_{n+1}$ and $y_{n+1}$ by subtraction $q_n$ times $$ x_na+y_nb=r_n $$ from $$ x_{n-1}a+y_{n-1}b=r_{n-1}. $$ Because $r_{n-1}-q_nr_n=r_{n+1}$, this gives $$ (x_{n-1}-q_nx_n)\cdot a+(y_{n-1}-q_ny_n)\cdot b=r_{n+1}, $$ so we can choose $x_{n+1}=x_{n-1}-q_nx_n$ and $y_{n+1}=y_{n-1}-q_ny_n$. Continuing this way, we will eventually get $r_m=0$, and then we have $$ x_{m-1}a+y_{m-1}b=r_{m-1}=d. $$
I have two questions concerning this proof:
1) Do we need that $|a|\geq|b|$?
2) How do we determine $q_n$?
3) And why is the last line true; $$ x_{m-1}a+y_{m-1}b=r_{m-1}=d. $$