I am going through my number theory notes and have got on to the bit about the ring $\mathbb{Z}_p[x]$, where $p$ is prime, and unique factorisation domains. The example I am looking at is to do with irreducible and reducible polynomials. It says
e.g in $\mathbb{Z}_3[x]$, $x^2 + x + 1 = (x + 2)(x+2) = (x-1)(x-1)$ because $x^2 + x + 1 = x^2 - 2x + 1$. So $x^2 + x + 1$ is reducible in $\mathbb{Z}_3[x]$. But $x^2 + x + 1$ is irreducible in $\mathbb{Z}_2[x]$ or $\mathbb{Z}_2[x]$ (for example).
I don't get how my lecturer has done this. How can she write $x^2 + x + 1 = (x + 2)(x + 2)$ when $(x + 2) (x+2) = x^2 + 4x + 4$ and how can she say that $x^2 + x + 1 = x^2 - 2x + 1$? Also, why does this only work in $\mathbb{Z}_3[x]$ and not say $\mathbb{Z}_2[x]$ or $\mathbb{Z}_5[x]$?
EDIT: In case it helps, my definition of $\mathbb{Z}_p[x]$ is given by:
The proof of the Primitive Element Theorem uses the fact that if $p \in \mathbb{Z}_+$ is prime, then the ring $\mathbb{Z}_p[x] = \{a_0 + a_1x + \cdots + a_nx^n: n \in \mathbb{Z}, a_i \in \mathbb{Z}_p, 0 \leq i \leq n\}$ is a unique factorisation domain (UFD). This means that $\mathbb{Z}_p[x]$:
- is a commutative ring with identity
- has no zero divisors
- has unique factorisations into irreducibles - which are also primes sinc this is a UFD. The "units" in $\mathbb{Z}_p[x]$ are the constant polynomials $a_0 \in \mathbb{Z}_p^*$.
When we write $(x+2)(x+2)$ in $\Bbb Z_3[x]$, we formally write $(x+[2])(x+[2])$ where $[2]$ is the equivalence class $2 \pmod 3$. Now by definition of multiplication by polynomials:
$$(x+[2])(x+[2]) = x^2 + ([2]+[2])x + [2][2] = x^2 + [4]x + [4] = x^2 + [1]x + [1]$$
where the last step follows as the equivalence classes $4 \pmod 3$ and $1 \pmod 3$ are equal.
If OTOH we were working in $\Bbb Z_5$ or some other $\Bbb Z_p$, then the meaning of $[2]$ would change to $2 \pmod 5$ or $2 \pmod p$, which obviously behave differently under multiplication.
Once we have a solid understanding of the ring $\Bbb Z_p$ that we are working in, we may choose to drop the square brackets as an abuse of notation (because mathematicians are lazy).