I was looking at the Axiom of Extensionality:
$\forall A\,\forall B\,(\forall X\,(X\in A\iff X\in B)\Rightarrow A=B)$
I somewhat understand the 'if and only if' statement, but I am having (a lot) of trouble formalizing it. In my head, I imagine a situation like this:
If $X$ is the entire set of $A$ and $X$ is the entire set of $B$, $A=B$.
And the statement holds.
But what about this:
Say $A = [1,2,3]$ and $B = [1,2,3,4,5]$ and $X = 1$. $X$ is an element of $A$ and $B$, but $A$ is not $B$.
Clearly, my counterexample is wrong, and it has something to do with the 'If and only if' statement. But I do not understand where the logic is wrong.