##### Definition1.2.1Intersection

Let \(A\) and \(B\) be sets. The intersection of \(A\) and \(B\) (denoted by \(A \cap B\)) is the set of all elements that are in both \(A\) and \(B\). That is, \(A \cap B = \{x:x \in A \textrm{ and } x \in B\}\).

Let \(A\) and \(B\) be sets. The intersection of \(A\) and \(B\) (denoted by \(A \cap B\)) is the set of all elements that are in both \(A\) and \(B\). That is, \(A \cap B = \{x:x \in A \textrm{ and } x \in B\}\).

Let \(A = \{1, 3, 8\}\) and \(B = \{-9, 22, 3\}\). Then \(A \cap B = \{3\}\).

- Solving a system of simultaneous equations such as \(x + y = 7\) and \(x - y = 3\) can be viewed as an intersection. Let \(A = \{(x,y): x + y = 7, x,y \in \mathbb{R}\}\) and \(B = \{(x,y): x - y = 3, x,y\in \mathbb{R}\}\). These two sets are lines in the plane and their intersection, \(A \cap B = \{(5, 2)\}\), is the solution to the system.
\(\mathbb{Z}\cap \mathbb{Q}=\mathbb{Z}\).

If \(A = \{3, 5, 9\}\) and \(B = \{-5, 8\}\), then \(A\cap B =\emptyset\).

Two sets are disjoint if they have no elements in common. That is, \(A\) and \(B\) are disjoint if \(A \cap B = \emptyset\).

Let \(A\) and \(B\) be sets. The union of \(A\) and \(B\) (denoted by \(A \cup B\)) is the set of all elements that are in \(A\) or in \(B\) or in both A and B. That is, \(A\cup B= \{x:x \in A\textrm{ or } x\in B\}\).

It is important to note in the set-builder notation for \(A\cup B\), the word “or” is used in the inclusive sense; it includes the case where \( x\) is in both \(A\) and \(B\).

If \(A = \{2, 5, 8\}\) and \(B = \{7, 5, 22\}\), then \(A \cup B = \{2, 5, 8, 7, 22\}\).

\(\mathbb{Z}\cup \mathbb{Q}=\mathbb{Q}.\)

\(A \cup \emptyset = A\) for any set \(A\).

Frequently, when doing mathematics, we need to establish a universe or set of elements under discussion. For example, the set \(A = \{x : 81x^4 -16 = 0 \}\) contains different elements depending on what kinds of numbers we allow ourselves to use in solving the equation \(81 x^4 -16 = 0\). This set of numbers would be our universe. For example, if the universe is the integers, then \(A\) is empty. If our universe is the rational numbers, then \(A\) is \(\{2/3, -2/3\}\) and if the universe is the complex numbers, then \(A\) is \(\{2/3, -2/3, 2i/3, - 2i/3\}\).

The universe, or universal set, is the set of all elements under discussion for possible membership in a set. We normally reserve the letter \( U\) for a universe in general discussions.

When working with sets, as in other branches of mathematics, it is often quite useful to be able to draw a picture or diagram of the situation under consideration. A diagram of a set is called a Venn diagram. The universal set \(U\) is represented by the interior of a rectangle and the sets by disks inside the rectangle.

\(A \cap B\) is illustrated in 1.2.8 by shading the appropriate region.

The union \(A \cup B\) is illustrated in 1.2.9.

In a Venn diagram, the region representing \(A \cap B\) does not appear empty; however, in some instances it will represent the empty set. The same is true for any other region in a Venn diagram.

Let \( A\) and \( B\) be sets. The complement of \( A\) relative to \( B\) (notation \(B - A\)) is the set of elements that are in \( B\) and not in \( A\). That is, \(B-A=\{x: x\in B \textrm{ and } x\notin A\}\). If \( U\) is the universal set, then \(U-A\) is denoted by \(A^c\) and is called simply the complement of \( A\). \(A^c=\{x\in U : x\notin A\}\).

Let \(U = \{1,2, 3, \text{...} , 10\}\) and \(A = \{2,4,6,8, 10\}\). Then \(U-A = \{1, 3, 5, 7, 9\}\) and \(A - U= \emptyset\).

If \(U = \mathbb{R}\), then the complement of the set of rational numbers is the set of irrational numbers.

\(U^c= \emptyset\) and \(\emptyset ^c= U\).

The Venn diagram of \(B - A\) is represented in 1.2.11.

The Venn diagram of \(A^c\) is represented in 1.2.13.

If \(B\subseteq A\), then the Venn diagram of \(A- B\) is as shown in 1.2.14.

In the universe of integers, the set of even integers, \(\{\ldots , - 4,-2, 0, 2, 4,\ldots \}\), has the set of odd integers as its complement.

Let \(A\) and \(B\) be sets. The symmetric difference of \(A\) and \(B\) (denoted by \(A\oplus B\)) is the set of all elements that are in \(A\) and \(B\) but not in both. That is, \(A \oplus B = (A \cup B) - (A \cap B)\).

- Let \(A = \{1, 3, 8\}\) and \(B = \{2, 4, 8\}\). Then \(A \oplus B = \{1, 2, 3, 4\}\).
- \(A \oplus 0 = A\) and \(A \oplus A = \emptyset\) for any set \(A\).
- \(\mathbb{R} \oplus \mathbb{Q}\) is the set of irrational numbers.
The Venn diagram of \(A \oplus B\) is represented in 1.2.17.

To work with sets in Sage, a set is an expression of the form Set(*list*). By wrapping a list with `Set( )`, the order of elements appearing in the list and their duplication are ignored. For example, L1 and L2 are two different lists, but notice how as sets they are considered equal:

The standard set operations are all methods and/or functions that can act on Sage sets. *You need to evalute the following cell to use the subsequent cell.*

We can test membership, asking whether 10 is in each of the sets:

The ampersand is used for the intersection of sets. Change it to the vertical bar, |, for union.

Symmetric difference and set complement are defined as “methods” in Sage. Here is how to compute the symmetric difference of \(A\) with \(B\), followed by their differences.

Let \(A = \{0, 2, 3\}\), \(B = \{2, 3\}\), \(C = \{1, 5, 9\}\), and let the universal set be \(U = \{0, 1, 2, . . . , 9\}\). Determine:

\(A \cap B\)

\(A \cup B\)

\(B \cup A\)

\(A \cup C\)

\(A - B\)

\(B - A\)

\(A^c\)

\(C^c\)

\(A\cap C\)

\(A\oplus B\)

Let \( A\), \( B\), and \( C\) be as in Exercise 1, let \(D = \{3, 2\}\), and let \(E = \{2, 3, 2\}\). Determine which of the following are true. Give reasons for your decisions.

\(A = B\)

\(B = C\)

\(B = D\)

\(E=D\)

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

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

\(A-B = B-A\)

\(A \oplus B = B \oplus A\)

Let \(U= \{1, 2, 3, . . . , 9\}\). Give examples of sets \( A\), \( B\), and \( C\) for which:

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

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

\((A \cup B)^c= A^c\cap B^c\)

\(A \cup A^c = U\)

\(A \subseteq A\cup B\)

\(A\cap B \subseteq A\)

Let \(U= \{1, 2, 3, . . . , 9\}\). Give examples to illustrate the following facts:

If \(A \subseteq B\) and \(B \subseteq C\), then \(A\subseteq C\).

There are sets \(A\) and \(B\) such that \(A - B \neq B - A\)

If \(U = A\cup B\) and \(A \cap B = \emptyset\), it always follows that \(A = U - B\).

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

What can you say about \(A\) if \(U = \{1, 2, 3, 4, 5\}\), \(B = \{2, 3\}\), and (separately)

\(A \cup B = \{1, 2, 3,4\}\)

\(A \cap B = \{2\}\)

\(A \oplus B = \{3, 4, 5\}\)

Suppose that \( U\) is an infinite universal set, and \( A\) and \( B\) are infinite subsets of \( U\). Answer the following questions with a brief explanation.

Must \(A^c\) be finite?

Must \(A\cup B\) infinite?

Must \(A\cap B\) be infinite?

Given that \( U\) = all students at a university, \( D\) = day students, \( M\) = mathematics majors, and \( G\) = graduate students. Draw Venn diagrams illustrating this situation and shade in the following sets:

evening students

undergraduate mathematics majors

non-math graduate students

non-math undergraduate students

Let the sets \( D\), \( M\), \( G\), and \( U\) be as in exercise 7. Let \(\lvert U \rvert = 16,000\), \(\lvert D \rvert = 9,000\), \(|M |= 300\), and \(\lvert G \rvert = 1,000\). Also assume that the number of day students who are mathematics majors is 250, 50 of whom are graduate students, that there are 95 graduate mathematics majors, and that the total number of day graduate students is 700. Determine the number of students who are:

evening students

nonmathematics majors

undergraduates (day or evening)

day graduate nonmathematics majors

evening graduate students

evening graduate mathematics majors

evening undergraduate nonmathematics majors