set theory — union on a collection of sets I'm working on some set theory problems and I've run across some issues. I need to prove:
(Sorry if this looks messy but I dont know exactly how to type this out. It's a union of a collection of sets, by the way.)
$$\bigcup_{X\in\{A,B\}} X=A\cup B.$$
So I start off using the definition of $\bigcup$ and I get:
$$\forall x\colon(\exists X\colon X\in\{A,B\}\land x\in X)$$
So my question is...can I go ahead and assume that $X$ is an element of $A \cup B$ since it is an element of $\{A,B\}$?
And then my next step would look like:
$$(\forall X)(X \in A \cup B \Rightarrow x \in X)$$
 A: On the one hand, suppose that $$x\in\bigcup_{X\in\{A,B\}}X.$$ Then there is some $X\in\{A,B\}$ such that $x\in X$ (by definition). Since $X\in\{A,B\}$, then $X=A$ or $X=B$, so $x\in A$ or $x\in B$, and in any case $x\in A\cup B:=\{y:y\in A\text{ or }y\in B\}$. Therefore, $$\bigcup_{X\in\{A,B\}}X\subseteq A\cup B.$$
On the other hand, suppose that $x\in A\cup B$. By definition, $x\in A$ or $x\in B$, so there is some $X\in\{A,B\}$ such that $x\in X$. Hence, $$x\in\bigcup_{X\in\{A,B\}}X,$$ and therefore, $$\bigcup_{X\in\{A,B\}}X\supseteq A\cup B.$$
By extensionality, it follows that $$\bigcup_{X\in\{A,B\}}X= A\cup B.$$
A: You were exchanging the $\in$ and $\subseteq$ notions. The set $\{A, B\}$ has exactly two elements (unless $A=B$), so either $X=A$ or $X=B$.
So, we can conlcude, that $X$ is a subset of $A\cup B$, not an element.
A: Here is how I would solve this, using the rules of predicate logic.  Using a slightly different notation, let's see which elements $\;x\;$ are in the left hand side set:
\begin{align}
& x \in \langle \cup X : X \in \{A,B\} : X \rangle \\
\equiv & \qquad \text{"definition of $\;\cup\;$-quantification"} \\
& \langle \exists X : X \in \{A,B\} : x \in X \rangle \\
\equiv & \qquad \text{"definition of $\;\{\ldots,\ldots\}\;$"} \\
& \langle \exists X : X = A \lor X = B : x \in X \rangle \\
\equiv & \qquad \text{"logic: split range of quantification"} \\
& \langle \exists X : X = A : x \in X \rangle \;\lor\; \langle \exists X : X = B : x \in X \rangle \\
\equiv & \qquad \text{"logic: one-point rule, twice"} \\
& x \in A \;\lor\; x \in B \\
\equiv & \qquad \text{"definition of $\;\cup\;$"} \\
& x \in A \cup B \\
\end{align}
By set extensionality, this proves the original statement.
