Show that if $\gcd(x,y)=1$ then given integers $a,b$ there is an $m$ such that two congruences are satisfied If $x, y$ are coprime, then for any integer $a,b$ there is an integer $m$ such that:
$m \equiv a \;(\bmod\; x)$
$m \equiv b \;(\bmod\; y)$
I approached it like this:
Since they are coprime then 

$xi + yj = 1$

Then
$1 - yj = xi \;\text{  and  } \; 1 - xi = yj $
Then 
$1 \equiv yj \;(\bmod\; x) \;\text{ and } \;1 \equiv xi \;(\bmod\; y)$
But unfortunately I am not sure if this approach is correct. Can someone hint me?
 A: The trick is you want to get the two to reduce out separately so you just tweak the $1=xi+yj$ by the $a$ and $b$. We use the fact that
$$\begin{cases}1\equiv xi+yj\equiv xi\mod y\\
1\equiv xi+yj\equiv yj\mod x\end{cases}$$
We consider then, that $m=bxi+ayj$ has the property that

$$m\equiv ayj\equiv a\cdot 1\mod x,\quad m\equiv bxi\equiv b\mod y.$$

The "trick" that allows you to solve this is that $bxi\equiv 0\mod x$ and $ayj\equiv 0\mod y$. That means if we add them straight together they don't affect one another in the opposite modulus. This is the general strategy for solving these sorts of things, find one that works in your first modulus, but is $0$ in the second modulus, so that you can just add up all the individual ones to get the final answer.
A: If you write out what to do, than it is this:
Find $k, l, m$ so that: 
$m - a = kx$
$m - b = ly$
So, as $m$ is completely determined by $l$ and $k$, you just have to solve the equation
$kx + a = ly + b$
Equivalently:
$kx - ly = b - a$
You already have the equation 
$ix + yj = 1$
So, clearly, $k = (b-a)i$ and $l = (a-b)j$ will do it. Then, from the first two equations, you get $m$.
A: You're close, from $ix+jy=1$ we have
(1) $ix+jy\equiv 1 (mod y)$
(2) $ix+jy\equiv 1 (mod x)$
Scaling $i$, by say $b$, only alters (1). Scaling $j$ only alters (2).
I'll leave the rest to you.
