I read the proof of a 'set theory' equation from a website called Meritnation. But I can't understand the proof after 30 minutes of trying and even find some mistakes in it.
This is the proof(I have copied it from a particular website and numbered the lines)

Now in line 5, it says $x \in (A \cap B)$ which is a subset to $(A \cup B) \cup (A-B).$ I think the $(A-B)$ is not required as $A \cup B$ already contains $(A-B).$ Same goes for line 10.
I can't understand the purpose of line 8 to 10 and line 11 comes out all of a sudden. From line 11, everything is easily understood and seems correct but almost all of the lines before it seem either wrong or unnecessary. Please help.
Lines 7-8: If $x$ is not in $A\cap B$, there are two overlapping subcases: $x\not\in A$ and/or $x\not\in B$.
Line 9: But the first subcase contradicts line 1, therefore certainly $x\not\in B$.
Line 10 should say that $x\in A,\ x\not\in B\implies x\in A-B$ which is $\subset (A\cap B)\cup(A-B)$.