Equality of 2 Sets I'm reading a book that states "If $X$ and $Y$ are sets, then $X=Y$ if and only if, for all $x, x\in X$ if and only if $x\in Y$."
Perhaps it's because I learned the equality of two sets being defined as each one being a subset of the other (which makes perfect sense to me but perhaps that's just because it's had time to), but this definition does not strike me as true; couldn't there exist some $y\in Y$ such that $y\notin X$ and thus the two sets are not equivalent? 
Also, I apologize for any mistakes in the writing of my math; I'm still getting used to this site. 
 A: What you have written is the same as $X \subseteq Y$ and $Y\subseteq X$. Notice that $X \subseteq Y$ iff $\forall z(z\in X \rightarrow z\in Y)$, so $X\subseteq Y$ and $Y\subseteq X$ iff $\forall z(z\in X \rightarrow z\in Y \text{ and } z\in Y \rightarrow z\in X)$ iff $\forall z(z\in X \leftrightarrow z\in Y)$ iff $X=Y$ by definition.
A: The two definitions really are saying the same thing. And not even in one of those weird ways where two things are equivalent but don't sound at all related. Like the Bolzano-Weierstrass Theorem.
For a proof by contradiction, let's suppose your definition of equal sets ($X \subseteq Y$ and $Y \subseteq X$) holds while the new definition you have is not true. Then we'd have some sets $A,B$ such that $A \subseteq B, B\subseteq A$ but at least one $b \in B$ where $b \notin A$. Since $b \notin A$ and $b \in B$, $B$ cannot be a subset of $A$; to be a subset of $A$ would require that every element of $B$ is contained in $A$. Contradiction. Therefore the two definitions are equivalent. 
