Proving an equality in set theory Now, I want to show that 
$$ A \cup B = A \cap B \leftrightarrow A = B $$ 
I  tried to show that every element from the left side is in the right and vice versa.
I started by showing $$ A = B \rightarrow A \cup B = A \cap B $$ 
Now assuming $$ A = B $$ to be true and plugging in the definition 
$$ \forall x : (x \in A \rightarrow x \in B ) \wedge ( x \in B \rightarrow x \in A ) $$ 
and rearranging, I could quickly show that $$ x \in (A \cap B) \rightarrow x \in (A \cup B) $$ 
Now I need to show that $$ x \in (A \cup B) \rightarrow x \in (A \cap B) $$ to show the equality  ($A \cup B = A \cap B$)  and I struggle to do that. 
Furthermore I struggle with the other direction, that is to prove $$ A \cup B = A \cap B \rightarrow A = B $$
Here, too, I could use the definition giving me 
$$ (x\in A \lor x \in B ) \rightarrow (x\in A \wedge x \in B ) \wedge (x\in A \wedge x \in B ) \rightarrow (x\in A \lor x \in B ) $$ 
but I am not sure how to proceed from here.
Any hints on how to go from here are appreciated.
 A: There is a much easier way to do the first direction: show that both $A \cup B$ and $A \cap B$ are equal to something else, rather than showing them to be equal to each other. In fact, I don't see a way to proceed from your end-point, other than to do the "easier way".
The other direction: suppose $A \not = B$. Then there is an element $a$ in $A$ which is not in $B$ (wlog, since if it were the case that every element of $A$ were also in $B$, then $A$ is a strict subset of $B$ so there is an element in $B$ but not in $A$). What can we say about $a$ in $A \cup B$ and $A \cap B$?
A: Suppose 
$$A\cup B=A\cap B$$
Now assume $\exists a\in A:a\not\in B$. This implies $a\in A\cup B$ and $a\not\in A\cap B$ or equivalentely $A\cup B\neq A\cap B$, which is a contradiction. Hence $\forall a\in A: a\in B$ and because of symmetry we have also proven that $\forall b\in B:b\in A$. Now, we easily see that $A=B$
A: $A=B$ does indeed mean that $(a\in A \implies a \in B) \land (a\in B \implies a \in B)$ but I can not think of a more complex, confusing, and convoluted way to express this.  If $A = B$ they are the same  set.
If $A= B$ then $A\cup B = A\cup A=A$ and $A \cap B = A \cap A=A$.
$A\cup A= A=A\cap A$ because $a \in A \iff (a\in A \lor a\in A) \iff a\in A \land a\in A)$.
But even if I did it your convoluted way.
Let $a \in A \cap B$ then $a \in A \land a\in B \implies a\in A \lor a \in B \implies a \in A\cup B \implies A\cap B \subset A \cup B$.  This is always true, even if $A \ne B$.
Let $a \in A \cup B$ and $A= B$.  By your definition of equality, $a \in A \lor a \in B$  if $a \in A$ then $a \in B$.  If $a \in B$ then $a \in B$.  So either way $a \in B$. And so $a \in B \implies a \in A$ so $ a \in A$.  So $a \in B$ and $ a \in A$ so $a \in A\cap B$.
So $A \cup B \subset A \cap B$.  So $A\cup B = A\cap B$.
But that was preposterously and unnecessarily complicated as $A$ IS $B$ we didn't need to do make any distinction between them.
So that's the first half.  
The easy obvious and trivial half.  If $A = B$ then $A\cup B = A\cup A = A = A \cap A = A \cap B$.
sheesh.
==
No the hard direction.  Let $A \cup B = A \cap B$
Let $a \in A$ then $a \in A \lor a \in B$.  So $a \in A \cup B$.  (Note $A \subset A \cup B$.  That is always true.)  So as $A \cup B = A \cap B$, $a \in A \cap B$.  So $a \in A \land a \in B$.  So $a \in B$ so $A \subset B$.
Let's not be so absurdly obtuse in proving $B \subset A$...
Let $a \in B$.  Then $a \in B \subset A\cup B = A\cap B$.  Therefore $a \in A$.
So $B \subset A$.  So $A = B$.
So $A=B \iff A\cup B = A\cap B$.
=====
But we could have done the whole thing, a lot easierly.
$A = B \implies A\cup B = A\cup A = A = A\cap A = A\cap B$.
$A\cup B = A\cap B \implies A \subset A\cup B = A\cap B \subset B$ and $B \subset A \cup B = A\cap B \subset A$.  So $A =B$.
A: $x\in A\implies x\in A∪B\implies x\in A∩B\implies x\in B$
Same as opposite
