# Is $GF_9[x]$ a principal ideal domain but not a field?

In this post

A commutative ring $A$ is a field iff $A[x]$ is a PID

It was proved that a commutative ring $A$ is a field iff $A[x]$ is a principal ideal domain. By this theorem, because $GF_9$ is a finite field, then $GF_9[x]$ must be a principal ideal domian. However in my midterm exam of cryptography. There is a problem said $GF_9[x]$ is a principal ideal domain but not a field. Using the polynomial representation of $GF_9$, we can view $GF_9[x]$ as two variables polynomial in $\alpha$ and $x$ with coefficient belong to $GF_3$.

My question is, how to prove that it is not a field?
Are there any necessary and sufficient condition to make it become a field?

Furthermore, from Wikipedia it is said that
"$K[x,y]$ : rings of polynomials in two variables. The ideal $(x,y)$ is not principal." It confused me that whether $GF_9[x]$ is a principal ideal domain or not.

My question is, how to prove that it is not a field?

You can observe that $x$ does not have an inverse. (Argue by degree, for example.)

Are there any necessary and sufficient condition to make it become a field?

No. The indeterminate $x$ is never invertible in an ordinary polynomial ring over a field.

It confused me that whether $GF_9[x]$ is a principal ideal domain or not.

That example requires two free indeterminates. The point is that $x$ and $y$ cannot be multiples of a single element of $K[x,y]$. In your case, (with a single variable) the argument does not apply.

Using the polynomial representation of $GF_9$, we can view $GF_9[x]$ as two variables polynomial in $α$ and $x$ with coefficient belong to $GF_3$.

No, it is not a full polynomial ring of two variables. It is true that $GF_9\cong GF_3[\alpha]/p(\alpha)$ where $p(\alpha)$ is an irreducible quadratic over $GF_3$, but that does not make the quotient "a polynomial ring." You are describing $GF_3[x,\alpha]/(p(\alpha))$ which is a quotient of $GF_3[x,\alpha]$, and does not fit that argument.

The polynomial ring $K[x]$ is never a field, for a field $K$. Consider the polynomial $f(x)=x$. What could its inverse be, with respect to multiplication? So for $K=GF(9)$ the same is true. And indeed, $K[x]$ is a PID for any field $K$, see this duplicate.

In a field, each nonzero element is invertible. A polynomial ring $R[x]$, where $R$ is a commutative ring without zero divisors, the grade formula holds: $grade(f\cdot g) =\grade(f)+ \grade(g)$ for all nonzero polynomials $f$ and $g$. It follows that $f\cdot g=1$ means that both $f$ and $g$ have grade zero, i.e., are elements of $R$.