Are ideals necessarily definable?

Consider the first-order language of rings. Let $R$ be a ring and $I \subseteq R$ be an ideal. Is $I$ necessarily $\emptyset$-definable? If not, what if we allow parameters from $R$?

• Not sure what $\emptyset$-definable is, but note that if $\mathcal{U}$ is a free ultrafilter on $\mathbb{N}$, then $\{U^c\colon U\in\mathcal{U}\}$ is an ideal in the boolean ring $\mathcal{P}(\mathbb{N})$. It would be a strange theory (to me) that allows this to be “definable”. – Harald Hanche-Olsen Sep 13 '14 at 7:42

There are rings with ideals that are not definable (with parameters). The cardinality of the set of definable ideals is at most the cardinality of the ring (I am assuming the ring is infinite). Then for a counter example it suffices to take a ring $R$ that has $2^{|R|}$ ideals.
If you know some model theory of arithmetic, you may find the following example of a nondefinable ideal helpful. Let $\mathbb{Z}$ be the ordered ring of integers. Let $M$ be a proper elementary extension of $\mathbb{Z}$ such that $M$ contains an element which is divisible by every standard prime. (Such a model is a nonstandard model of $Th(\mathbb{Z})$ and it can easily be constructed by using compactness). Let $I$ be the set consisting of all $a \in M$ such that $a$ is divisible by every standard prime. By construction of $M$, $I \neq \{0\}$. It is easy to show that $I$ is an ideal in $M$. I claim that $I$ is not definable. Assume $I$ is definable. Then, it follows from elementary arithmetic that $I$ must contain a smallest element $>0$ (because $I \neq \{0\}$). Let $a$ be this element. Since $a$ is divisible by every standard prime, it follows by overspill that there is a nonstandard prime which divides $a$. Let $p$ be such a nonstandard prime. Then $a=pb$ for some $b>0$. It follows from elementary arithmetic that $b$ must be divisible by every standard prime and hence $b \in I$. But we have $b < a$, a contradiction.