Union of Boundaries

Theorem
Let $T = \left({S, \tau}\right)$ be a topological space.

Let $A, B$ be subsets of $S$.

Then:
 * $\partial A \cup \partial B = \partial \left({A \cup B}\right) \cup \partial \left({A \cap B}\right) \cup \left({\partial A \cap \partial B}\right)$

where $\partial A$ denotes the boundary of $A$.

Proof
First we will prove that
 * $\partial A \subseteq \partial \left({A \cup B}\right) \cup \partial \left({A \cap B}\right) \cup \left({\partial A \cap \partial B}\right)$

Let $x \in \partial A$.

Aiming for a contradiction suppose that
 * $x \notin \partial \left({A \cup B}\right) \cup \partial \left({A \cap B}\right) \cup \left({\partial A \cap \partial B}\right)$

Then by definition of union:
 * $x \notin \partial \left({A \cup B}\right) \land x \notin \partial \left({A \cap B}\right) \land x \notin \left({\partial A \cap \partial B}\right)$

By Characterization of Boundary by Open Sets:
 * $\exists Q \in \tau: x \in Q \land \left({\left({A \cup B}\right) \cap Q = \varnothing \lor \complement_S \left({A \cup B}\right) \cap Q = \varnothing}\right)$

By Intersection Distributes over Union. Complement of Union:
 * $\left({A \cap Q}\right) \cup \left({B \cap Q}\right) = \varnothing \lor \complement_S \left({ A }\right) \cap \complement_S \left({B}\right) \cap Q = \varnothing$

Because $x \notin \left({\partial A \cap \partial B}\right)$ therefore by definition of intersection:
 * $x \notin \partial B$

By Characterization of Boundary by Open Sets:
 * $\exists U \in \tau: x \in U \land \left({B \cap U = \varnothing \lor \complement_S \left({B}\right) \cap U = \varnothing}\right)$

As $x \in \partial A$ by Characterization of Boundary by Open Sets:
 * $A \cap Q \ne \varnothing$

Then by Union is Empty iff Sets are Empty:
 * $\left({A \cap Q}\right) \cup \left({B \cap Q}\right) \ne \varnothing$

Hence
 * $\complement_S \left({ A }\right) \cap \complement_S \left({B}\right) \cap Q = \varnothing$

We will show that
 * $B \cap U = \varnothing \implies \complement_S \left({ A }\right) \cap Q \cap U = \varnothing$

Assume
 * $B \cap U = \varnothing$

Then:
 * $U \subseteq \complement_S \left({B}\right)$

By Intersection with Empty Set:
 * $\complement_S \left({ A }\right) \cap Q \cap \complement_S \left({B}\right) \cap U = \varnothing \cap U = \varnothing$

Thus by Intersection with Subset is Subset:
 * $\complement_S \left({ A }\right) \cap Q \cap U = \varnothing$