I know by Bézout theorem two integers $u$ and $v$ exist and verify $pu+qv=1$ but to show that $u$ and $v$ are naturals I'm stuck.
-
3Hint: $pq-qp=0$ so you can add that to your original expression as many times as you like. – lulu Jul 02 '20 at 19:57
-
Maybe this question can be of interest https://math.stackexchange.com/a/2215456/399263 – zwim Jul 02 '20 at 20:01
-
The ideal $(p,q)$ in $\mathbf Z$ is generated by $\gcd(p,q)$. – Bernard Jul 02 '20 at 20:17
2 Answers
If $p$ and $q$ are both positive integers and $pu+qv=1$ with integers $u$ and $v$, then one of them is positive and the other is not. If $u$ is the positive one, then you're done (i.e., just change the sign of $v$ and subtract instead of adding). If $u$ is not positive, then let $u'=u+(\text{a gazillion})q$ and $v'=(\text{a gazillion})p-v$, where "a gazillion" is whatever it takes to make $u'$ positive, and note that
$$pu'-qv'=p(u+(\text{a gazillion})q)-q((\text{a gazillion})p-v)=pu+qv=1$$

- 79,832
The usual trick is to look at the set $S=\{up+vq: u, v\in \mathbb{Z}\}.$ First of all, note that $up+vq$ is always non-zero, otherwise $p$ and $q$ will have common factors. It is therefore clear that if the linear combination $up+vq=1$ for some $u, v,$ then $1$ is the smallest natural number in the $S.$ This suggests that one should look at $r=\min\{s\in S: s\ge 0\}.$ The goal is to show that $r=1.$ The idea here is that $r$ is a linear combination of $p$ and $q,$ therefore, $gcd(p, q)$ divides $r.$ Well, this does not seem to help much. So let us look at what happens if we divide $gcd(p, q)$ by $r.$ To do this, we use a trick. We show that $r$ divides both $p$ and $q.$ To see this we write, $$p= mr+ n,$$ for some natural numbers $m, n$ where $0\le n<r.$
Now, look at it carefully. Note that $r=up+vq,$ It is clear that $P-mr$ is a linear combination of $p$ And $q.$ Therefore, $n\in S.$ If $n>0,$ It will contradict the fact that $r=\min(S).$ Therefore, $n=0.$ In other words, $r$ divides $p.$ Replace $p$ By $q$ and the above argument shows that $r$ divides $q.$ Therefore, $r$ divides $gcd(p, q).$
Conclusion: $\textbf{r=gcd(p, q)}=1.$

- 3,026