TITLE: The analogue of euler's theorem in $\mathbb{F}_p[x]$
QUESTION [6 upvotes]: Let $p$ be a prime number, and $m(x)$ be in $\mathbb{F}_p[x]$. the analogue of euler's theorem is that for certain polynomials $a(x)$ in $\mathbb{F}_p$, and some number $\phi_p(m)$,
$$a(x)^{\phi_p(m)} = 1\mod m(x)$$
for which polynomials $a(x)$ does this theorem apply?
what is the number $\phi_p(x)?$
my solution but not sure if this is right?
$\phi_p(m)$ is the totient function. it gives back the integers less than or equal to $m$ which are relatively prime to $m$, this theorem applies for $a(x)$ polynomials which are coprimes with $m(x).$

REPLY [2 votes]: Obviously the polynomial $a(x)$ has to be coprime to $m(x)$ for otherwise the common factor will always prevent this. If the factorization of $m(x)$ to powers of irreducible polynomials is
$$
m(x)=\prod_i p_i(x)^{a_i},
$$
then by the Chinese remainder theorem
$$
\mathbb{F_p}[x]/(m(x))\simeq\bigoplus_i\mathbb{F_p}[x]/(p_i(x)^{a_i}).
$$
Denote $R_i=\mathbb{F_p}[x]/(p_i(x)^{a_i}).$ The coset of $a(x)$ is a unit of $R_i$ as $p_i(x)\nmid a(x)$. Can you count the size of the unit group of $R_i$? 
If you know that $|R_i^*|=n_i$, then Lagrange's theorem tells you that
$$
a(x)^{n_i}\equiv 1\pmod{p_i(x)^{a_i}}.
$$ 
For the rest you are expected to mimic the integer case and apply Chinese remainder theorem backwards.

In some cases it is possible to replace the number $n_i$ by its proper divisor.
This is because the group $R_i^*$ is not always cyclic, and thus its exponent is strictly smaller than its cardinality. Consider the following. As explained in Alex Youcis' answer, when $a_i=1$, $R_i$ is a finite field, and thus $R_i^*$ is cyclic of order $q-1, q=|\mathbb{F_p}[x]/(p_i(x)|=p^{\deg p_i(x)}$. So we always have the congruence
$$
a(x)^{q-1}\equiv1 \pmod {p_i(x)},
$$
and thus $a(x)^{q-1}\equiv 1+p_i(x) b(x)\pmod {p_i(x)^2}$ for some polynomial $b(x)$. Raising this congruence to $p^{th}$ power gives then that
$$
a(x)^{p(q-1)}\equiv1\pmod  {p_i(x)^2}
$$
even though $|\mathbb{F_p}[x]/(p_i(x)^2)^*|=q(q-1)>p(q-1)$ whenever $\deg p_i>1$.
This shows that for $R_i^*$ to be cyclic when $a_i>1$, it is necessary that $\deg p_i=1$. It would not be too difficult to analyze the structure of $R_i^*$ further, but at this point the reader can hopefully already appreciate that the exponent of $R_i$ depends on the parameters $\deg p_i$, $p$, and $a_i$ in a non-trivial way.