# Finding equivalence class with a binary set

I'm new to discrete math so there might be problems with this solution. Prompt is to find at least one equivalence class if it is an equivalence relation.

$$X = R^2, (x_1, y_1) \sim (x_2, y_2) \iff y_1 = y_2$$

1. Reflexivity

$$(x_1, y_1) \sim (x_1, y_1) \iff y_1 = y_1$$

Since $y_1 = y_1$, it is reflexive.

2. Symmetry

$$(x_1, y_1) \sim (x_2, y_2) \iff y_1 = y_2$$

Assuming $y_1 = y_2$ (eqn1),

$$(x_2, y_2) \sim (x_1, y_1) \iff y_2 = y_1$$

from eqn 1, $y_2 = y_1$, so it is a symmetry.

3. Transitivity

$$(x_1, y_1) \sim (x_2, y_2) \iff y_1 = y_2$$

$$(x_2, y_2) \sim (x_3, y_3) \iff y_2 = y_2$$

Assuming $y_1 = y_2$ and $y_2 = y_3$, we get $y_1 = y_3$.

$$(x_1, y_1) \sim (x_3, y_3) \iff y_1 = y_3,$$

since $y_1 = y_3$, so it is transitive.

Is this the correct way to solve the problem? Also how to find the equivalence classes for the same?

You did correctly. Well.. to find the equivalent class, you often need a representant of that class. Take $(x, y)$, and we want $[(x, y)]$ to be an equivalent class which contains the element $(x, y)$. In other words, $(x, y)$ represents that class. That is: $$[(x, y)] = \{(a, b)\in\mathbb{R}^2 : (x, y)\sim(a, b)\}$$
We have an equivalent class such that $(x, y)\in [(x, y)]$. Now, its all a matter of inserting the definition of $\sim$ in the set. $$[(x, y)] = \{(a, b)\in\mathbb{R}^2 : y=b\}$$
Can you come up with a concrete example? What would $[(1, 2)]$ be, for instance?
Yes, your proof is correct. To construct an equivalence class, pick an element of the set and find (describe) all elements that are equivalent to it. More formally: if $R$ is an equivalence relation on a set $X$, then for an $x\in X$, its equivalence class is $[x]=\{y\in X\,\colon\,yRx\}$. In this example: pick an arbitrary $(x,y)\in\mathbb{R}^2$. By the given definition, any other $(x_1,y_1)\in\mathbb{R}^2$ is equivalent to it, $(x_1,y_1)\sim(x,y)$, iff $y_1=y$, so $(x_1,y_1)=(x_1,y)$. Note that there are no constraints on $x_1$, so it can be any real. Thus the equivalence class of $(x,y)$ is $\{(x_1,y)\in\mathbb{R}^2\,\colon\,x_1\in\mathbb{R}\}$ (where $y$ is fixed). Geometrically, they are horizontal lines $y=\text{const}$.