The following formula: $$\forall x(\forall y (\forall z((x=y)\lor(y=z)\lor(z=y) )))$$ is interpreted as "there are at most two elements ". how can we write a formula for "there are exactly two elements"?
I have the idea that this is done as follows: we can find two elements that are different, but if we take more than two elements then the third is equal to one of the other two.
However, I don't have a very clear idea how to write this as a formula
$$\exists x \exists y \big(x\neq y \land \forall z(z=x \lor z=y)\big)$$