Is this proof right?
Prove: if a|b and a>0 then gcd(a,b)=a.
Let a|b and the GCD(a,b) = m, then b=aq for some integer q and the GCD(a,b) can be expressed as a linear combination with some integer x and y,
ax + by = m .
Substituting in b we get,
ax + (aq)y = m
a(x + qy) = m
But x + qy = GCD(1,q) =1. Thus,
a(1) = m
Hence a = GCD(a,b), which is what we needed to show.
Thanks for all the comments :)
Update 1: I did not think I said that x and y were any integer I said that there was some integer x and some integer y so that ax +by = m Since I am supposing that the GCD(a,b) = m and a|b, then by substituting b into the GCD(a,b), then
GCD(a,b)=GCD(a,aq)
=a*GCD(1,q) Which is a property of GCD
But the GCD(1,q)=1. So, GCD(a,b) = a
Thanks for the comments :)