4.2. The Boolean Algebra of Sets#

It is clear that set theory is closely related to logic. The intersection and union of sets can be defined in terms of the logical ‘and’ and logical ‘or’ operators. The notation \(\{x| P(x)\}\) makes it possible to use predicates to specify sets. And if \(A\) is any set, then the formula \(x\in A\) defines a one place predicate that is true for an entity \(x\) if and only if \(x\) is a member of \(A\). So it should not be a surprise that many of the rules of logic have analogues in set theory.

For example, we have already noted that \(\cup\) and \(\cap\) are commutative operations. This fact can be verified using the rules of logic. Let \(A\) and \(B\) be sets. According to the definition of equality of sets, we can show that \(A\cup B=B\cup A\) by showing that \(\forall x\,\big((x\in A\cup B)\leftrightarrow(x\in B\cup A)\big)\). But for any \(x\),

\[\begin{split}\begin{align*} x\in A\cup B &\leftrightarrow x\in A \vee x\in B &&\text{(definition of $\cup$)}\\ &\leftrightarrow x\in B \vee x\in A &&\text{(commutativity of $\vee$)}\\ &\leftrightarrow x\in B \cup A &&\text{(definition of $\cup$)} \end{align*}\end{split}\]

The commutativity of \(\cap\) follows in the same way from the definition of \(\cap\) in terms of \(\wedge\) and the commutativity of \(\wedge\), and a similar argument shows that union and intersection are associative operations.

The distributive laws for propositional logic give rise to two similar rules in set theory. Let \(A\), \(B\), and \(C\) be any sets. Then

\[\begin{split}\begin{align*} A\cup(B\cap C)&=(A\cup B)\cap(A\cup C)\\ \text{ and }\\ A\cap(B\cup C)&=(A\cap B)\cup(A\cap C) \end{align*}\end{split}\]

These rules are called the distributive laws for set theory. To verify the first of these laws, we just have to note that for any \(x\),

\[\begin{split}\begin{align*} x\in A&\cup(B\cap C) \\ &\leftrightarrow (x\in A)\vee((x\in B)\wedge (x\in C)) &&\text{(definition of $\cup$, $\cap$)}\\ &\leftrightarrow ((x\in A)\vee(x\in B)) \wedge((x \in A)\vee (x\in C)) &&\text{(distributivity of $\vee$)}\\ &\leftrightarrow (x\in A\cup B) \wedge (x \in A\cup C) &&\text{(definition of $\cup$)}\\ &\leftrightarrow x\in ((A\cup B)\cap(A\cup C)) &&\text{(definition of $\cap$)} \end{align*}\end{split}\]

The second distributive law for sets follows in exactly the same way.

4.2.1. Set complement#

While \(\cup\) is analogous to \(\vee\) and \(\cap\) is analogous to \(\wedge\), we have not yet seen any operation in set theory that is analogous to the logical ‘not’ operator, \(\lnot\). Given a set \(A\), it is tempting to try to define \(\{x| \lnot(x\in A)\}\), the set that contains everything that does not belong to \(A\). Unfortunately, the rules of set theory do not allow us to define such a set. The notation \(\{x| P(x)\}\) can only be used when the domain of discourse of \(P\) is a set, so there must be an underlying set from which the elements that are/are not in \(A\) are chosen, i.e., some underlying set of which \(A\) is a subset. We can get around this problem by restricting the discussion to subsets of some fixed set. This set will be known as the universal set. Keep in mind that the universal set is only universal for some particular discussion. It is simply some set that is large enough to contain all the sets under discussion as subsets. Given a universal set \(U\) and any subset \(A\) of \(U\), we can define the set \(\{x\in U| \lnot(x\in A)\}\).

Definition 4.1

Let \(U\) be a given universal set, and let \(A\) be any subset of \(U\). We define the complement of \(A\) in \(U\) to be the set \(\overline{A}\) that is defined by \(\overline{A}=\{x\in U| x\not\in A\}\).

Usually, we will refer to the complement of \(A\) in \(U\) simply as the complement of \(A\), but you should remember that whenever complements of sets are used, there must be some universal set in the background. Other textbooks may use \(A^c\) to denote the complement of \(A\) instead.

Given the complement operation on sets, we can look for analogues to the rules of logic that involve negation. For example, we know that \(p\wedge\lnot p=\mathbb{F}\) for any proposition \(p\). It follows that for any subset \(A\) of \(U\),

\[\begin{split}\begin{align*} A\cap\overline{A} &= \{x\in U| (x\in A)\wedge (x\in \overline{A})\} &&\text{(definition of $\cap$)}\\ &= \{x\in U| (x\in A)\wedge (x\not\in A)\} &&\text{(definition of complement)}\\ &= \{x\in U| (x\in A)\wedge \lnot(x\in A)\} &&\text{(definition of $\not\in$)}\\ &= \emptyset \end{align*}\end{split}\]

the last equality following because the proposition \((x\in A)\wedge \lnot(x\in A)\) is false for any \(x\). Similarly, we can show that \(A\cup\overline{A}=U\) and that \(\overline{\overline{A}}=A\) (where \(\overline{\overline{A}}\) is the complement of the complement of \(A\), that is, the set obtained by taking the complement of \(\overline{A}\).)

The most important laws for working with complements of sets are DeMorgan’s Laws for sets. These laws, which follow directly from DeMorgan’s Laws for logic, state that for any subsets \(A\) and \(B\) of a universal set \(U\),

\[\begin{split}\begin{align*} \overline{A\cup B}&=\overline{A}\cap\overline{B}\\ \text{ and }\\ \overline{A\cap B}&=\overline{A}\cup\overline{B} \end{align*}\end{split}\]

For example, we can verify the first of these laws with the calculation

\[\begin{split}\begin{align*} \overline{A\cup B}&= \{x\in U| x \not\in (A\cup B)\} &&\text{(definition of complement)}\\ &= \{x\in U| \lnot( x\in A\cup B)\} &&\text{(definition of $\not\in$)}\\ &= \{x\in U| \lnot(x\in A \vee x\in B)\} &&\text{(definition of $\cup$)}\\ &= \{x\in U| (\lnot(x\in A))\wedge(\lnot(x\in B))\} &&\text{(DeMorgan's Law for logic)}\\ &= \{x\in U| (x\not\in A) \wedge (x\not\in B)\} &&\text{(definition of $\not\in$)}\\ &= \{x\in U| (x\in\overline{A}) \wedge (x\in\overline{B})\} &&\text{(definition of complement)}\\ &= \overline{A}\cap\overline{B} &&\text{(definition of $\cap$)} \end{align*}\end{split}\]
Table 4.2 Some Laws of Boolean Algebra for sets. \(A\), \(B\), and \(C\) are sets. For the laws that involve the complement operator, they are assumed to be subsets of some universal set, \(U\). For the most part, these laws correspond directly to laws of Boolean Algebra for propositional logic as given in this table.#

Double complement

\(\overline{\overline{A}}=A\)

Miscellaneous laws

\(A\cup\overline{A}=U\)

\(A\cap\overline{A}=\emptyset\)

\(\emptyset\cup A=A\)

\(\emptyset\cap A=\emptyset\)

Idempotent laws

\(A\cap A= A\)

\(A\cup A= A\)

Commutative laws

\(A\cap B = B\cap A\)

\(A\cup B=B\cup A\)

Associative laws

\(A\cap (B\cap C) = (A\cap B)\cap C\)

\(A\cup (B\cup C) = (A\cup B)\cup C\)

Distributive laws

\(A\cap(B\cup C) = (A\cap B)\cup (A\cap C)\)

\(A\cup (B\cap C) = (A\cup B)\cap (A\cup C)\)

DeMorgan’s laws

\(\overline{A\cap B} = \overline{A}\cup\overline{B}\)

\(\overline{A\cup B} = \overline{A}\cap\overline{B}\)

An easy inductive proof can be used to verify generalized versions of DeMorgan’s Laws for set theory.
(In this context, all sets are assumed to be subsets of some unnamed universal set.) A simple calculation verifies DeMorgan’s Law for three sets:

\[\begin{split}\begin{align*} \overline{A\cup B\cup C}&=\overline{(A\cup B)\cup C}\\ &=\overline{(A\cup B)}\cap\overline{C} &\text{(by DeMorgan's Law for two sets)}\\ &=(\overline{A}\cap\overline{B})\cap\overline{C} &\text{(by DeMorgan's Law for two sets)}\\ &=\overline{A}\cap\overline{B}\cap\overline{C} \end{align*}\end{split}\]

From there, we can derive similar laws for four sets, five sets, and so on. However, just saying ‘and so on’ is not a rigorous proof of this fact. Whereas we may have excused ourselves about that in Section 2, we can now prove this fact. Here is a rigorous inductive proof of a generalized DeMorgan’s Law:

Theorem 4.5

For any natural number \(n\geq 2\) and for any sets \(X_1\), \(X_2\), … , \(X_n\), \(\overline{X_1\cup X_2\cup \cdots \cup X_n} = \overline{X_1} \cap \overline{X_2} \cap\cdots\cap \overline{X_n}\)

Proof. We give a proof by induction. In the base case, \(n=2\), the statement is that \(\overline{X_1\cup X_2}=\overline{X_1}\cap\overline{X_2}\). This is true since it is just an application of DeMorgan’s law for two sets.

For the inductive case, suppose that the statement is true for \(n=k\). We want to show that it is true for \(n=k+1\). Let \(X_1\), \(X_2\), … , \(X_{k+1}\) be any \(k+1\) sets. Then we have:

\[\begin{split}\begin{align*} \overline{X_1\cup X_2\cup \cdots \cup X_{k+1}} &= \overline{(X_1\cup X_2\cup \cdots \cup X_k) \cup X_{k+1}}\\ &= \overline{(X_1\cup X_2\cup \cdots \cup X_k)}\cap\overline{X_{k+1}}\\ &= (\overline{X_1}\cap\overline{X_2}\cap\cdots\cap\overline{X_k})\cap\overline{X_{k+1}}\\ &= \overline{X_1}\cap\overline{X_2}\cap\cdots\cap\overline{X_{k+1}} \end{align*}\end{split}\]

In this computation, the second step follows by DeMorgan’s Law for two sets, while the third step follows from the induction hypothesis. Therefore by the principle of induction we have proven the theorem.

4.2.3. Exercises#