Cancellability of Congruences

Theorem
$$c a \equiv c b \pmod n \iff a \equiv b \pmod {\frac n d}$$ where $$d = \gcd \left\{{c, n}\right\}$$.

Corollary
Let $$c \perp n$$.

Then $$c \perp n \iff c a \equiv c b \pmod n \Longrightarrow a \equiv b \pmod n$$.

Proof

 * Let $$c a \equiv c b \pmod n$$.

Then we have that $$c a - c b = k n$$ for some $$k \in \Z$$ by Congruent iff Difference Multiple of Modulus.

Now $$d = \gcd \left\{{c, n}\right\}$$, so from Divide by GCD for Coprime Integers we have:
 * $$\exists r, s \in Z: r \perp s: c = dr, n = ds$$.

So we substitute for $$c$$ and $$n$$ in $$c a - c b = k n$$:
 * $$d r a - d r b = k d s$$

which leads us to:
 * $$r \left({a - b}\right) = k s$$

So $$s \backslash r \left({a - b}\right)$$ and as $$r \perp s$$, from Euclid's Lemma $$s \backslash \left({a - b}\right)$$.

So $$a \equiv b \pmod s$$ where $$s = \frac n d$$.


 * Now suppose $$a \equiv b \pmod {\frac n d}$$ where $$d = \gcd \left\{{c, n}\right\}$$.

Then $$\exists k \in \Z: a - b = k \frac n d$$.

Hence $$c a - c b = \frac {k c} d n$$.

As $$d = \gcd \left\{{c, n}\right\}$$ we have $$d \backslash c$$ and so $$\frac c d \in \Z$$

So $$c a \equiv c b \pmod n$$.

Proof of Corollary
Follows directly from the fact that $$c \perp n$$ means $$\gcd \left\{{c, n}\right\} = 1$$.