[Math] Why doesn’t the definition “$p$ is called ‘prime’ if $p\mid ab\implies p\mid a\,\text{ or }\,p\mid b$” hold up when we square numbers

abstract-algebraexamples-counterexamplesgroup-theoryprime numbersring-theory

So, I've been given the actual definition of a prime for the first time, as opposed to the definition of an irreducible which I was previously taught (as is customary), it goes as follows:

An element $p$ of a ring $R$ is called "prime" if $a,b\in R$ and $p|ab\rightarrow p|a$ or $p|b$

$4^2 = 16$. So inversely $4|16$. Now let's look at all the combinations of two integers $a,b\in R$ where $ab = 16$ and whether $p|a$ or $p|b$:

$1 * 16$ ($4|16$)

$2 * 8$ ($4|8$)

$4 * 4$ ($4|4$)

By my logic, $4$ is prime.

However, as we all know $4 = 2^2$. But $2$ is not a unit so $4$ is an irreducible. Since the ring of integers is an integral domain $4$ must, therefore, be prime as well. Why does this happen?

Edit

Thanks for your help everyone. I understand your answers logically and experimentally but not really conceptually. The reason this definition works (from my perspective) because your saying that

A number is prime if it necessary to represent its multiples in
factorisations.

Whereby factorisations, I mean $8 = 2^3, 6 = 2*3$ and relevantly $16 = 2^4$.

The answer I had kind-of expected from this question (and was going to include in my original query until I forgot) was that more generally if there exists the product of any amount of numbers that is equivalent to $ab$ and for each of those numbers $n$, $n$ suffices $p|n$ then $p$ is composite.

This makes much more sense to me logically. In the case of $16$ you saying that you don't need $4$ to express $16$ since you can instead use $2*2*2*2$ or $2^4$ to represent the same thing. For this reason, $4$ is composite.

By this logic, you don't need to prove it for every multiple of 4, only 1. Have I completely confused myself? Can someone provide a counter-example? Also, could you provide an explanation of why my logic doesn't work?

Edit 2

Yes everyone, the correct definition of includes checking the factors of every $ab$ such $p|ab$. However, as @Vincent and I showed in our respective answers (the former much better) the definition I used is equivalent to the definition everyone else is using in integral domains. I highly suggest you read @Vincent answer as he makes this very clear.

Regardless, I'm not accepting any answer that simply says that my definition is wrong when it is actually equivalent.

Best Answer

Take $\mathbb Z$ and $12$.

$12$ is divided by $4$.

$12=6\cdot2$, but $6$ is not divided by $4$ and $2$ is not divided by $4$, which says that $4$ is not prime.