I am currently reading a book on basic number theory and in the first chapter the author uses the fact that if $d \mid x$ and also $d\mid y$, then it is true that $d$ is a divisor to both sides of the equation: $$ x = y +r $$
I see that it is true, but how could you prove that? I mean, if $x$ and $y$ are even, then the $\gcd(x,y)$ is even and the rest $r = 0$, hence for any other divisor $c < \gcd(x,y)$ the rest $r$ will of course be even.
What about if $\gcd(x,y)$ is odd? Or is this a bad way to approach a proof for above statement? How would you do to prove it?