# simultaneous linear congruences

Consider the simultaneous linear congruences - $$ax+by\equiv u\mod m; \\ cx+dy\equiv v\mod m.$$ What are the conditions (if any) on $a,b,c,d,m$ so that the mapping of all pairs $(x,y)$ to $(u,v)$ is one-to-one, $x,y,u,v \epsilon \{0,1,...,m-1\}$. And what is the general result for a linear equation of the form $$AX \equiv B \mod m.$$

-

Just as in ordinary linear algebra, the question is equivalent to the question of when the matrix $\left[ \begin{array}{cc} a & b \\\ c & d \end{array} \right]$ has an inverse ($\bmod m$). The answer, just as in ordinary linear algebra (suitably interpreted), is that it is necessary and sufficient that the determinant $ad - bc$ be a unit $\bmod m$. (This is a good exercise.)