TITLE: How would you define the set of even numbers in $\mathbb{Z}$ using a first order sentence?
QUESTION [5 upvotes]: Given a language $\mathcal{L} = \{+,0\}$ and structure $\mathcal{M}$ with underlying universe $\mathbb{Z}$, I would like to write a formula or sentence $\phi$ so that the set 
$$\Big\{ \bar{a} ~:~ \mathcal{M} \models \phi(\bar{a}) \Big\}$$
correspond to the set of even numbers. My current attempt is
$$\phi = \exists x \exists z ~ (z + z = x)$$
But it does not look correct to me. Could someone confirm improve my attempt?

REPLY [7 votes]: Remember, you are trying to find a formula, not a sentence. Every time you put an even number (as a parameter), you now have a sentence which holds (with said parameter). It fails every time you put in an odd number. 
So you are close! but the actual formula would be $$ \varphi(x) \equiv (\exists z)( z+ z =x)$$

REPLY [2 votes]: Your attempt is very close to the answer. Instead of quantifying $x$, use $\phi = \exists z (z+z=x)$ and then the even numbers are those $a$ such $\phi$ with $x$ substituted by $a$ is a theorem

REPLY [2 votes]: Your $\phi$ is almost correct. But note that $\phi(\bar a)$ has the same meaning for all $\bar a$: There exists some $x$ that is the sum of some $z$ with itself.
For $\phi(\bar a)$ to have a meaningful interpretation, it is necessary that $\phi$ contain some free variables. We can correct the expression by removing the quantification over $x$:
$$\phi: \exists z: z + z = x$$
so that $\phi(\bar a)$ becomes $\exists z: z+z= a$, which has the desired meaning.