There's a theorem in Abstract Algebra which states that:
An element of a quotient ring $\mathbb{Z}/\langle n \rangle$ or $\mathbb{Z_n}$ that is a coset $\overline{a}$ is invertible iff $a$ and $n$ are relatively prime.
I'm having problem understanding this theorem.
My confusion is: can't there be situations where $a$ and/or $n$ are not primes but $\overline{a}$ is invertible.
I know I'm wrong but I like to know where I'm wrong.
Suppose there's an ideal of $\mathbb{Z}$ which is $\langle 6 \rangle$
Now here $n$ which is $6$ is not prime.
An element(one of the coset) of quotient ring $\mathbb{Z_6}$ is:
$$ \overline{4} = \langle 6 \rangle + 4 = \{ \cdots, -8, -2, 4, 10, 16, \cdots \} $$
Here take a number from this set:
Say $4$ but $4$ is invertible in the sense that $4 - 4 = 0$ so it's inverse is $-4$ and $4$ is not prime.
Why's this invertible?
Can anyone kindly tell me the error in my thought process?