Set operations
We may construct a new set by combining existing sets through set operations. Thus, sets equipped with set operations form an algebra of sets, so to speak. We will see set operations are closely related to logical operations.
Definition (union of sets)
Let \(A\) and \(B\) be sets. Then, their union, denoted \(A \cup B\), is defined as
\[A\cup B = \{x | x \in A \lor x \in B\}.\]
That is, \(A \cup B\) is a set consisting of elements that are in \(A\) or in \(B\).
Remark: "\(x \in A\)" and "\(x \in B\)" are logical propositions (predicates).
Example: If \(A = \{1, 2, 3\}\) and \(B = \{1, 3, 5\}\), then \(A \cup B = \{1, 2, 3, 5\}\).
Definition (intersection of sets)
Let \(A\) and \(B\) be sets. Then, their intersection, denoted \(A \cap B\), is defined as
\[A\cap B = \{x | x \in A \land x \in B\}.\]
That is, \(A \cap B\) is a set consisting of elements that are in \(A\) and in \(B\).
Remark: The logical "and" (i.e., conjunction) is often written as a comma (",") so that the above definition is often written as
\[A\cap B = \{x | x \in A, x \in B\}.\]
Example: If \(A = \{1, 2, 3\}\) and \(B = \{1, 3, 5\}\), then \(A \cap B = \{1, 3\}\).
Definition (disjoint sets)
The two sets \(A\) and \(B\) are said to be disjoint if \(A \cap B = \emptyset\).
We know that addition and multiplication of real numbers are commutative. That is, for any \(x, y\in\mathbb{R}\), we have
\[x + y = y + x\]
and
\[xy = yx.\]
Similarly, the set union and intersection are commutative:
Lemma
Let \(A\) and \(B\) be sets. Then,
\[\begin{eqnarray} A\cup B &=& B\cup A\\ A\cap B &=& B\cap A.\\ \end{eqnarray}\]
Proof. Let us prove this for the union. Suppose \(x \in A\cup B\). Then, by definition of union, \(x \in A \lor x \in B\). But this proposition is equivalent to \(x \in B \lor x\in A\). Again by the definition of union, this means that \(x \in B \cup A\). Therefore, \(A \cup B \subset B \cup A\). By reversing this argument, we can also show that \(B \cup A \subset A\cup B\). Therefore, \(A \cup B = B \cup A\). More concisely, we can say
\[A \cup B = \{x | x \in A \lor x \in B\} = \{x | x \in B \lor x\in A\} = B \cup A.\]
The proof for the intersection is left as an exercise. ■
We also know that the addition and multiplication of real numbers are associative. That is, for any \(x, y, z \in \mathbb{R}\), we have
\[x + (y + z) = (x + y) + z\]
and
\[x(yz) = (xy)z.\]
This means that, if we first add \(y\) and \(z\), and then add \(x\), the result is the same as if we first add \(x\) and \(y\), and then add \(z\) (similar for the multiplication). The associativity also holds for set union and intersection.
Lemma
Let \(A, B,\) and \(C\) be sets. Then,
\[\begin{eqnarray} A \cup (B \cup C) &=& (A\cup B) \cup C,\\ A \cap (B \cap C) &=& (A \cap B)\cap C. \end{eqnarray}\]
Proof. Exercise. ■
For ordinary numbers, we have the distributive law. That is, for any \(x, y, z\in \mathbb{R}\), we have \[x(y + z) = xy + xz.\]
Similar, but different, laws apply to set union and intersection.
Lemma
For any sets \(A, B,\) and \(C\), we have \[\begin{eqnarray} 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{eqnarray}\]
Proof. Exercise. ■
Note that both the union and intersection distribute over one another. In contrast, addition does not distribute over multiplication: \[x + (y\cdot z) \neq (x+y)\cdot(x+z).\]
In ordinary numbers, the number 0 (zero) plays a special role. For any \(x \in \mathbb{R}\), we have \[\begin{eqnarray} x + 0 &=& x,\\ x\cdot 0 &=& 0.\end{eqnarray}\] In sets, the empty set \(\emptyset\) plays a similar role.
Lemma
For any set \(A\), we have \[ \begin{eqnarray} A \cup \emptyset &=& A,\\ A \cap \emptyset &=& \emptyset.\end{eqnarray}\]
Proof. Noting that \(x \in \emptyset\) is always false, \(x \in A \lor x\in\emptyset\) is true if and only if \(x \in A\) is true (if in doubt, write down the truth table). Thus,
\[A \cup \emptyset = \{x | x \in A \lor x \in \emptyset\} =\{x | x \in A\} = A.\]
The other equality is an exercise. ■
Definition (Set difference)
Let \(A\) and \(B\) be sets. The set difference, denoted \(A \setminus B\), is defined as
\[A\setminus B = \{x | x \in A \land x\not\in B\}.\]
Note that \(x \not\in B\) may be also written as \(\lnot (x \in B).\)
Lemma
\(A \setminus B\) and \(B \setminus A\) are disjoint. That is,
\[(A \setminus B) \cap (B \setminus A) = \emptyset.\]
Proof. Exercise. Hint: \(x \not\in B\) may be also written as \(\lnot (x \in B)\). ■
It is often convenient to consider a universal set (or universe), that is, the set of all things we ever want to consider, as long as it makes sense. In other words, everything we consider in mathematics is (supposed to be) an element of that universal set. If \(U\) is a universal set, then, by definition, \(x \in U\) is always true for any \(x\).
Definition (Set complement)
Let \(U\) be a universal set. For any set \(A\), its complement, denoted \(A^c\), is defined as \[A^c = U\setminus A.\]
Remark: Some people have different notations for the set complement: instead of \(A^c\), we may use \(A'\) or \(\bar{A}\), or something else.
Lemma
For any set \(A\), we have \[(A^c)^c = A.\]
That is, the complement of the complement of \(A\) is \(A\) itself.
Proof. By definition, \[A^c = \{x | x \in U \land \lnot(x \in A)\}\] and
\[(A^c)^c = \{x | x \in U \land \lnot (x \in A^c)\}.\]
Since \(x \in A^c \equiv x \in U \land \lnot (x \in A)\) (equivalence), we have
\[\begin{eqnarray} \lnot (x \in A^c) &\equiv& \lnot(x \in U \land \lnot (x \in A))\\ &\equiv&\lnot(x \in U) \lor \lnot(\lnot (x \in A)) ~~ \text{(De Morgan's law for logical operations)}\\ &\equiv& \bot \lor x \in A\\ &\equiv& x \in A \end{eqnarray}\]
Thus, \[(A^c)^c = \{x | x \in U \land x \in A\} = \{x | x \in A\} = A \] because \(x \in U\) is always true (\(\top\)) by definition. ■
Lemma
Let \(U\) be a universal set and \(A\) be any set. Then,
\[\begin{eqnarray} A \cup A^c &=& U,\\ A\cap A^c &=& \emptyset.\end{eqnarray}\]
Proof. Exercise. ■
Theorem (De Morgan's laws (set version))
For any sets \(A\) and \(B\), we have \[ \begin{eqnarray} (A \cup B)^c &=& A^c\cap A^c,\\ (A \cap B)^c &=& A^c \cup B^c. \end{eqnarray}\]
Proof. Exercise. ■
Comments
Post a Comment