If $(a,b)=1$ then there exist positive integers $x$ and $y$ s.t $ax+by=1$. [duplicate]

How can i prove that if $\gcd(a,b)=1$ there exist $x>0$ and $y>0$ such that $ax-by=1$?


(assuming $a,b>0$)

Let $S = ${$b,b^2, b^3,...$}, all taken mod $a$. There are only $a$ possible values in $S$, but the sequence in question has infinitely many terms; therefore, there is some $n<m$ so that $b^n \equiv b^m$ (mod $a$). Then $(b^{n})(b^{m-n}-1) = b^m - b^n = sa$ for some integer $s>0$. $(b, a) = 1$, so $(b^n,a) = 1$, so $b^n|(sa)\implies b^n|s$, so $x=\frac{s}{b^n}$ is an integer. Thus, we have $$bb^{m-n-1}-1=b^{m-n}-1=xa$$ Setting $y = b^{m-n-1}$, we have the desired result. You can also see that we have $x, y > 0$.