According to this answer (and the modular arithmetic theory), $ax\equiv ay \pmod{n} \iff x\equiv y \pmod{n}$, if $a$ and $n$ are relatively prime. I tried to prove the forward implication but reached a contradiction:
$ ax\equiv ay \pmod{n} \rightarrow x\equiv y \pmod{n} \iff ax \in n \mathbb{Z}+\{ay\} \rightarrow x \in n \mathbb{Z}+ \{y\} $ $\quad$ ("$+$" here denotes Minkowski addition)
$x \in n \mathbb{Z}+\{y\} \iff ax \in an \mathbb{Z}+\{ay\}^{(*)} $, therefore $ ax \in n \mathbb{Z}+\{ay\} \rightarrow x \in n \mathbb{Z}+ \{y\} \rightarrow ax \in an \mathbb{Z}+\{ay\}^{(**)} $ in particular.
For simplicity, we will assign the following names to our formulae: $ A:=ax \in n \mathbb{Z}+\{ay\} \quad B:=x \in n \mathbb{Z}+ \{y\} \quad C:=ax \in an \mathbb{Z}+\{ay\}$
If $ A \rightarrow B \rightarrow C $ (see $^{(**)})$ then $ A \rightarrow C $:
$ ax \in n \mathbb{Z}+\{ay\} \rightarrow ax \in an \mathbb{Z}+\{ay\} \iff (n \mathbb{Z}+\{ay\}) \subset (an \mathbb{Z}+\{ay\}) \iff n \mathbb{Z} \subset an \mathbb{Z} \iff \mathbb{Z} \subset a \mathbb{Z} $ which is clearly false, therefore $ A \rightarrow B \rightarrow C $ didn't pass the necessary condition and since we've deduced $ B \rightarrow C $ to be true (see $^{(*)})$ it follows that $A \not\rightarrow B$
What am I doing wrong?