The study of the operations of union (), intersection (), and set difference (), together with the inclusion relation (), goes by the algebra of sets.
Symmetric Difference
Define the symmetric difference of sets and as $$A \vartriangle B = (A - B) \cup (B - A)$$
Cartesian Product
Given two sets and , the Cartesian product is defined as: $$A \times B = {\langle x, y \rangle \mid x \in A \land y \in B}.$$
The Cartesian square of a set is the Cartesian product $$A^2 = A \times A.$$
The -ary Cartesian power of a set , denoted , is defined as $$\begin{align*} A^n & = A \times A \times \cdots \times A \ & = { \langle a_1, \ldots, a_n \rangle \mid a_i \in A \text{ for every } i \in {1, \ldots, n }}. \end{align*}$$
As a special case, the -ary Cartesian power, denoted , is defined as the singleton set containing the empty function (with codomain ).
We can also form (something like) the Cartesian product of infinitely many sets, provided that the sets are suitably indexed. Let be an index set and a function whose domain includes . Define $$\bigtimes_{i \in I} H(i) = {f \mid f \text{ is a function with domain } I \text{ and } \forall i \in I, f(i) \in H(i)}$$
Laws
Commutative Laws
For any sets and , $$\begin{align*} A \cup B & = B \cup A \ A \cap B & = B \cap A \end{align*}$$
Associative Laws
For any sets and , $$\begin{align*} A \cup (B \cup C) & = (A \cup B) \cup C \ A \cap (B \cap C) & = (A \cap B) \cap C \end{align*}$$
Distributive Laws
For any sets , , and , $$\begin{align*} A \cap (B \cup C) & = (A \cap B) \cup (A \cap C) \ A \cup (B \cap C) & = (A \cup B) \cap (A \cup C) \end{align*}$$
More generally, for any sets and , $$\begin{align*} A \cup \bigcap \mathscr{B} & = \bigcap, {A \cup X \mid X \in \mathscr{B}}, \text{ for } \mathscr{B} \neq \varnothing \ A \cap \bigcup \mathscr{B} & = \bigcup, {A \cap X \mid X \in \mathscr{B}} \end{align*}$$
For any sets , , and , $$\begin{align*} A \times (B \cap C) & = (A \times B) \cap (A \times C) \ A \times (B \cup C) & = (A \times B) \cup (A \times C) \ A \times (B - C) & = (A \times B) - (A \times C) \end{align*}$$
In addition, $$\begin{align*} A \times \bigcup \mathscr{B} & = \bigcup, {A \times X \mid X \in \mathscr{B}} \ A \times \bigcap \mathscr{B} & = \bigcap, {A \times X \mid X \in \mathscr{B}} \end{align*}$$
De Morgan's Laws
For any sets , , and , $$\begin{align*} C - (A \cup B) & = (C - A) \cap (C - B) \ C - (A \cap B) & = (C - A) \cup (C - B) \end{align*}$$
More generally, for any sets and , $$\begin{align*} C - \bigcup \mathscr{A} & = \bigcap, {C - X \mid X \in \mathscr{A}} \ C - \bigcap \mathscr{A} & = \bigcup, {C - X \mid X \in \mathscr{A}} \end{align*}$$
Monotonicity
Let , , and be arbitrary sets. Then
,
,
Antimonotonicity
Let , , and be arbitrary sets. Then
,
Cancellation Laws
Let , , and be sets. If ,
Index Sets
Let be a set, called the index set. Let be a function whose domain includes . Then we define $$\bigcup_{i \in I} F(i) = \bigcup,{F(i) \mid i \in I}$$
and, if , $$\bigcap_{i \in I} F(i) = \bigcap, {F(i) \mid i \in I}$$
Function Sets
For sets and , the collection of functions from into is: $$^AB = {F \mid F \colon A \rightarrow B}$$ is read as "-pre-". It is often written as instead.