What modular arithmetic theorem is being ignored here?

  1. Suppose $4x\equiv 6 \pmod {18} $ Then $2x\equiv 3 \pmod 9$ Then $6x\equiv 9 \pmod 9$ Then $6x\equiv 0 \pmod 9$ Then $x\equiv 0 \pmod 9$ Then $x=9k$

vs.

  1. Suppose $4x\equiv 6 \pmod {18}$ Then $2x\equiv 3 \pmod 9$ Then $2x\equiv 12 \pmod 9$ Then $x\equiv 6 \pmod 9$ Then $x = 9k+6$

$6x\equiv 0\pmod 9$ does not imply $x\equiv 0\pmod 9$. Because $6$ and $9$ are not coprime. What you do get by dividing out one $3$ is that $2x\equiv 0\pmod 3$, though - but you knew that already.


In $1$ the step from $6x\equiv 0$ (mod $9$) to $x\equiv 9$ (mod $9$) is invalid. The conclusion should be $2x\equiv 0$ (mod $3$), because the modulus is divisible by $3$ and then $x\equiv 0$ (mod $3$), because $(2,3)=1$. Or equivalently go all the way in one step because $(6,9)=3$ and if you want to divide by $6$ you must divide the modulus by $(6,9)$.