Boolean Algebra of Sets
(Content adapted from Critchlow & Eck)
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 makes it possible to use predicates to specify sets. And if is any set, then the formula defines a one place predicate that is true for an entity if and only if is a member of . So it should not be a surprise that many of the rules of logic have analogs in set theory.
For example, we have already noted that and are commutative operations. This fact can be verified using the rules of logic. Let and be sets. According to the definition of equality of sets, we can show that by showing that . But for any ,
definition of | ||
commutativity of | ||
definition of |
The commutativity of follows in the same way from the definition of in terms of and the commutativity of , 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 , , and be any sets. Then
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 ,
definition of , | ||
distributivity of | ||
definition of | ||
definition of |
The second distributive law for sets follows in exactly the same way.
Complement
While is analogous to and is analogous to , we have not yet seen any operation in set theory that is analogous to the logical "not" operator, . Given a set , it is tempting to try to define , the set that contains everything that does not belong to . Unfortunately, the rules of set theory do not allow us to define such a set. The notation can only be used when the domain of discourse of is a set, so there must be an underlying set from which the elements that are/are not in are chosen, i.e. some underlying set of which 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 and any subset of , we can define the set .
Let be a given universal set, and let be any subset of . We define the complement of in to be the set that is defined by .
Usually, we will refer to the complement of in simply as the complement of , but you should remember that whenever complements of sets are used, there must be some universal set in the background.
Given the complement operation on sets, we can look for analogs to the rules of logic that involve negation. For example, we know that for any proposition . It follows that for any subset of ,
definition of | ||
definition of complement | ||
definition of ) | ||
the last equality following because the proposition is false for any . Similarly, we can show that and that (where is the complement of the complement of , that is, the set obtained by taking the complement of .)
The most important laws for working with complements of sets are De Morgan's Laws for sets. These laws, which follow directly from De Morgan's Laws for logic, state that for any subsets and of a universal set ,
For example, we can verify the first of these laws with the calculation
definition of complement | ||
definition of | ||
definition of | ||
De Morgan's Law for logic | ||
definition of | ||
definition of complement | ||
definition of |
Comparison with Propositional Boolean Algebra
Just as the laws of logic allow us to do algebra with logical formulas, the laws of set theory allow us to do algebra with sets. Because of the close relationship between logic and set theory, their algebras are very similar. The algebra of sets, like the algebra of logic, is Boolean algebra. When George Boole wrote his 1854 book about logic, it was really as much about set theory as logic. In fact, Boole did not make a clear distinction between a predicate and the set of objects for which that predicate is true. His algebraic laws and formulas apply equally to both cases. More exactly, if we consider only subsets of some given universal set , then there is a direct correspondence between the basic symbols and operations of propositional logic and certain symbols and operations in set theory, as shown in this table:
Logic | Set Theory |
---|---|
Any valid logical formula or computation involving propositional variables and the symbols , , , , and can be transformed into a valid formula or computation in set theory by replacing the propositions in the formula with subsets of and replacing the logical symbols with , , , , and the complement operator.
Here are some of the laws of Boolean Algebra for sets. , , and are sets. For the laws that involve the complement operator, they are assumed to be subsets of some universal set, . For the most part, these laws correspond directly to laws of Boolean Algebra for propositional logic.
Name | Law |
---|---|
Double complement | |
Miscellaneous laws | |
Idempotent laws | |
Commutative laws | |
Associative laws | |
Distributive laws | |
De Morgan's laws | |
Precedence
Just as in logic, the operations of set theory can be combined to form complex expressions such as . Parentheses can always be used in such expressions to specify the order in which the operations are to be performed. In the absence of parentheses, we need precedence rules to determine the order of operation. The precedence rules for the Boolean algebra of sets are carried over directly from the Boolean algebra of propositions. When union and intersection are used together without parentheses, intersection has precedence over union. Furthermore, when several operators of the same type are used without parentheses, then they are evaluated in order from left to right. (Of course, since and are both associative operations, it really doesn't matter whether the order of evaluation is left-to-right or right-to-left.) For example, is evaluated as . The complement operation is a special case. Since it is denoted by drawing a line over its operand, there is never any ambiguity about which part of a formula it applies to.
Simplification
The laws of set theory can be used to simplify complex expressions involving sets. (As usual, of course, the meaning of "simplification" is partly in the eye of the beholder.) For example, for any sets and ,
Commutative Law | ||
Idempotent Law |
where in the second step, the Idempotent Law, which says that , is applied with . For expressions that use the complement operation, it is usually considered to be simpler to apply the operation to an individual set, as in , rather than to a formula, as in . De Morgan's Laws can always be used to simplify an expression in which the complement operation is applied to a formula. For example,
De Morgan's Law | ||
Double Complement | ||
Commutative Law | ||
Associative Law | ||
Idempotent Law |
As a final example of the relationship between set theory and logic, consider the set-theoretical expression and the corresponding compound proposition . (These correspond since for any , .) You might find it intuitively clear that . Formally, this follows from the fact that , which might be less intuitively clear and is surprising difficult to prove algebraically from the laws of logic. However, there is another way to check that a logical equivalence is valid: Make a truth table. Consider a truth table for :
false | false | false | false |
false | true | true | false |
true | false | true | true |
true | true | true | true |
The fact that the first column and the last column of this table are identical shows that . Taking to be the proposition and to be the proposition , it follows that the sets and have the same members and therefore are equal.
Exercises
Use the laws of logic to verify the associative laws for union and intersection. That is, show that if , , and are sets, then and .
Show that for any sets and , and .
Recall that the symbol denotes the logical exclusive or operation. If and sets, define the set by . Show that . ( is known as the symmetric difference of and .)
Let be a subset of some given universal set . Verify that and that .
Verify the second of De Morgan's Laws for sets, . For each step in your verification, state why that step is valid.
The subset operator, , is defined in terms of the logical implication operator, . However, differs from the and operators in that and are sets, while is a statement. So the relationship between and isn't quite the same as the relationship between and or between and . Nevertheless, and do share some similar properties. This problem shows one example.
Show that the following three compound propositions are logically equivalent: , , and .
Show that for any sets and , the following three statements are equivalent: , , and .
De Morgan's Laws apply to subsets of some given universal set . Show that for a subset of , . It follows that De Morgan's Laws can be written as and . Show that these laws hold whether or not and are subsets of . That is, show that for any sets , , and , and .
Show that for any sets and .
Answer
Distributive Law Idempotence Identity Distributive Intersection with empty set Identity Let and be sets. Simplify each of the following expressions. Justify each step in the simplification with one of the rules of set theory.
Answer
Commutative Associative Idempotent Answer
Commutative Associative Disjoint Intersection with empty set Answer
Distributive Disjoint Identity Definition of Answer
Associative Commutative Previous exercise (Absorption Law)
Let , , and be sets. Simplify each of the following expressions. In your answer, the complement operator should only be applied to the individual sets , , and .
Answer
Answer
(note that intersection has precedence over union)
Answer
(double complement)
Answer
Answer
Answer