# Math notation for an equivalence relation

What is the proper way to define a relation on $\mathbb{Z}\times\mathbb{Z}$ when $(a,b)\in\mathbb{Z}\times\mathbb{Z}$ represents $a+b$ is even?

$\mathcal{R}=\{(a,b)\in\mathbb{Z}\times\mathbb{Z} \mid \exists k\in\mathbb{Z},a+b=2k\}$?

I'm not so great with quantifiers and set builder notation just yet. I have the right idea, but there are a few nuances I need to get used to.

-
Do you want a relation on the set $\mathbb Z$, meaning the relation is a subset of $\mathbb Z \times \mathbb Z$? Or do you want a relation on the set $\mathbb Z \times \mathbb Z$, meaning the relation is a subset of $(\mathbb Z \times \mathbb Z) \times (\mathbb Z \times \mathbb Z)$? –  Jim Feb 7 '13 at 23:15
I have done a tiny edit to your question, replacing the "|" in the definition of the set with a "\mid", that leaves the proper spacing. –  Andreas Caranti Feb 7 '13 at 23:15
@Jim I want a relation on the set $\mathbb{Z}$, the first you mentioned. –  agent154 Feb 7 '13 at 23:45
Ah, then as Cameron mentioned below, what you have written is correct. –  Jim Feb 7 '13 at 23:56

That absolutely works, since an integer $n$ is even if and only if there is an integer $k$ such that $n=2k$ (by definition).

-

We can simplify a problem by breaking it into parts. We can clearly define

$$\mathcal{R} = \{ (a,b) \in \mathbb{Z} \times \mathbb{Z} \mid \text{Even}(a+b) \}$$

where $\text{Even}$ is the predicate that identifies whether an integer is even. Then, if we needed to do so, we can define $\text{Even}$ via

$$\text{Even}(x) \equiv \left( \exists k \in \mathbb{Z} : x = 2k \right)$$

And then, if we really needed to, we could substitute this into the original:

$$\mathcal{R} = \{ (a,b) \in \mathbb{Z} \times \mathbb{Z} \mid \exists k \in \mathbb{Z} : (a+b) = 2k \}$$

-