Tutorials › Topology (Undergraduate) › Relative Complements and De Morgan’s Laws

Sets, Functions and Relations for Topology · Tutorial 4 of 799

Relative Complements and De Morgan's Laws

Learn to compute complements relative to a specified universe and justify complement identities and De Morgan’s laws by checking membership.

Beginner 8 min read

What You'll Learn

  • Define the complement of a set relative to a specified universe
  • Prove the basic complement identities, including the double-complement law
  • Prove both of De Morgan’s laws using element-by-element arguments
  • Compute complements and set expressions in finite universes and in the real line
  • Recognize and correct errors caused by changing the universe

Complements Depend on a Universe

To say that an element is “not in \(A\)” does not by itself specify a set: we must also say which elements are being considered. In topology, for example, a set is usually considered as a subset of a specified space. The complement of \(A\) in that space consists of the points of the space that are not in \(A\). Keeping the universe explicit makes complement identities precise and prevents errors in calculations.

Throughout, let \(X\) be a set, called the universe, and let \(A,B\subseteq X\). We use the set difference notation from the earlier material: \(X\setminus A\) consists of elements of \(X\) that are not in \(A\). Set equality can be checked by showing that an arbitrary element belongs to one set exactly when it belongs to the other.

Definition: If \(A\subseteq X\), the complement of \(A\) relative to \(X\) is \(X\setminus A=\{x\in X:x\notin A\}\). The universe is part of the data: complements of the same set can differ when the universe changes.

For example, if \(X=\{1,2,3\}\) and \(A=\{1\}\), then \(X\setminus A=\{2,3\}\). If the universe is instead \(Y=\{1,2,3,4\}\), then \(Y\setminus A=\{2,3,4\}\). The set \(A\) has not changed; the collection of eligible elements outside it has changed.

Basic Complement Identities

The basic identities describe what happens when we take the complement of the empty set, the whole universe, or a complement itself. They also say that a set and its complement fit together without overlap and cover the universe.

Theorem (Complement laws): If \(A\subseteq X\), then $$ X\setminus\varnothing=X,\qquad X\setminus X=\varnothing,\qquad X\setminus(X\setminus A)=A, $$ and $$ A\cap(X\setminus A)=\varnothing,\qquad A\cup(X\setminus A)=X. $$

Proof. Let \(x\in X\). By the definition of complement, \(x\in X\setminus\varnothing\) exactly when \(x\in X\) and \(x\notin\varnothing\). Since no element belongs to the empty set, this is equivalent to \(x\in X\). Thus \(X\setminus\varnothing=X\). Also, \(x\in X\setminus X\) would require both \(x\in X\) and \(x\notin X\), which cannot hold; therefore \(X\setminus X=\varnothing\).

For the double-complement identity, membership in \(X\setminus(X\setminus A)\) means that \(x\in X\) and \(x\notin X\setminus A\). Because \(A\subseteq X\), an element \(x\in X\) fails to belong to \(X\setminus A\) exactly when \(x\in A\). Hence \(x\in X\setminus(X\setminus A)\) if and only if \(x\in A\), proving \(X\setminus(X\setminus A)=A\).

An element of \(A\cap(X\setminus A)\) would have to belong to \(A\) and not belong to \(A\), so no such element exists and the intersection is empty. Finally, if \(x\in X\), then either \(x\in A\), or \(x\notin A\) and hence \(x\in X\setminus A\). Thus every \(x\in X\) belongs to \(A\cup(X\setminus A)\); both sets in this union are subsets of \(X\), so the union equals \(X\). \(\square\)

The double-complement law requires \(A\subseteq X\), as assumed: the complement is defined relative to \(X\), and the conclusion recovers \(A\) because \(A\) lies inside that universe. These laws also distinguish two different facts: \(A\) and \(X\setminus A\) are disjoint, and together they contain every element of \(X\).

Worked Example: Complements in a Finite Universe

Let \(X=\{1,2,3,4,5,6\}\), \(A=\{1,2,4\}\), and \(B=\{2,3,5\}\). Find the complements of \(A\) and \(B\), and check the basic complement laws for \(A\).

To find \(X\setminus A\), inspect the elements of \(X\): \(1,2,4\) are in \(A\), while \(3,5,6\) are not. Therefore \(X\setminus A=\{3,5,6\}\). Likewise, \(2,3,5\) are in \(B\), while \(1,4,6\) are not, so \(X\setminus B=\{1,4,6\}\).

The two parts for \(A\) have no common elements, giving \(A\cap(X\setminus A)=\varnothing\). Listing their union gives \(A\cup(X\setminus A)=\{1,2,4\}\cup\{3,5,6\}=\{1,2,3,4,5,6\}=X\). Taking the complement a second time gives \(X\setminus\{3,5,6\}=\{1,2,4\}=A\).

Check: each element of \(X\) appears in exactly one of \(A=\{1,2,4\}\) and \(X\setminus A=\{3,5,6\}\). Thus the listed complement both misses every element of \(A\) and accounts for every element of \(X\) outside \(A\).

De Morgan’s Laws

De Morgan’s laws describe how a complement interacts with a union or an intersection. The universe remains fixed throughout each identity. The key membership translations are: to be outside a union is to be outside both sets, while to be outside an intersection is to be outside at least one of the sets.

Theorem (De Morgan’s laws): If \(A,B\subseteq X\), then $$ X\setminus(A\cup B)=(X\setminus A)\cap(X\setminus B) $$ and $$ X\setminus(A\cap B)=(X\setminus A)\cup(X\setminus B). $$

Proof. To prove the first identity, let \(x\in X\). Then \(x\in X\setminus(A\cup B)\) if and only if \(x\in X\) and \(x\notin A\cup B\). Membership in a union means membership in at least one of its sets, so \(x\notin A\cup B\) means \(x\notin A\) and \(x\notin B\). The resulting condition is exactly \(x\in(X\setminus A)\cap(X\setminus B)\). The two sets therefore have the same elements.

For the second identity, let \(x\in X\). Then \(x\in X\setminus(A\cap B)\) if and only if \(x\in X\) and it is not the case that \(x\in A\) and \(x\in B\). The latter condition means \(x\notin A\) or \(x\notin B\). This is equivalent to \(x\in X\setminus A\) or \(x\in X\setminus B\), which means \(x\in(X\setminus A)\cup(X\setminus B)\). Thus the two sets in the second identity have the same elements as well. \(\square\)

Worked Example: Checking Both Laws in a Finite Set

Let \(X=\{0,1,2,3,4,5,6,7,8,9,10\}\), \(A=\{0,2,4,6,8,10\}\), and \(B=\{0,3,6,9\}\). Compute each side of both De Morgan identities.

First, \(A\cup B=\{0,2,3,4,6,8,9,10\}\), so \(X\setminus(A\cup B)=\{1,5,7\}\). The individual complements are \(X\setminus A=\{1,3,5,7,9\}\) and \(X\setminus B=\{1,2,4,5,7,8,10\}\). Their intersection is \(\{1,5,7\}\), so the first identity holds for these sets.

Next, \(A\cap B=\{0,6\}\), so \(X\setminus(A\cap B)=\{1,2,3,4,5,7,8,9,10\}\). The union of the individual complements is \(\{1,3,5,7,9\}\cup\{1,2,4,5,7,8,10\} =\{1,2,3,4,5,7,8,9,10\}\). Thus the second identity also holds.

Check: \(0\) and \(6\) belong to both \(A\) and \(B\), so they are precisely the elements of the intersection and are excluded from its complement. Every other element of \(X\) is included there, matching the computed list.

Worked Example: Complements of Intervals in the Real Line

Take \(X=\mathbb{R}\) with its standard topology, \(A=[0,2)\), and \(B=(1,3]\). Compute the complements of their union and intersection and verify De Morgan’s laws. The interval endpoints matter: \(0\) belongs to \(A\), \(2\) does not belong to \(A\), \(1\) does not belong to \(B\), and \(3\) belongs to \(B\).

The union is \(A\cup B=[0,3]\), so \(X\setminus(A\cup B)=(-\infty,0)\cup(3,\infty)\). Also \(X\setminus A=(-\infty,0)\cup[2,\infty)\) and \(X\setminus B=(-\infty,1]\cup(3,\infty)\). Their intersection is \((-\infty,0)\cup(3,\infty)\): the part \((-\infty,1]\) meets \((-\infty,0)\) in \((-\infty,0)\), and \([2,\infty)\) meets \((3,\infty)\) in \((3,\infty)\). This verifies the law for the complement of a union.

The intersection is \(A\cap B=(1,2)\). Therefore \(X\setminus(A\cap B)=(-\infty,1]\cup[2,\infty)\). Taking the union of the individual complements gives \((-\infty,0)\cup[2,\infty)\cup(-\infty,1]\cup(3,\infty) =(-\infty,1]\cup[2,\infty)\). This verifies the law for the complement of an intersection.

Check: the point \(1\) is not in \(A\cap B=(1,2)\), so it belongs to its complement; the point \(2\) is also not in the intersection, so it belongs as well. Both are included in the calculated complement \((-\infty,1]\cup[2,\infty)\).

A Common Pitfall: Silently Changing the Universe

A complement is not specified by \(A\) alone; it is specified by \(A\) and the universe containing it. A common incorrect calculation uses one universe for one complement and a different universe for another, then treats the results as though they were complements in the same setting.

Wrong calculation. Let \(X=\{1,2,3\}\) and \(A=\{1\}\). One might write \(X\setminus A=\{2,3,4\}\), perhaps because the calculation has silently included \(4\). This is incorrect: \(4\notin X\), so it cannot belong to \(X\setminus A\).

Correction. Test membership against the stated universe. The elements of \(X\) not in \(A\) are exactly \(2\) and \(3\), so \(X\setminus A=\{2,3\}\). If the intended universe is \(Y=\{1,2,3,4\}\), then the correct complement is instead \(Y\setminus A=\{2,3,4\}\); the universe must be stated and kept fixed.

For a set expression, a reliable procedure is to write down the universe, identify which elements satisfy the expression, and compare both sides by membership. This is the same method used in the proofs: every step follows from the definitions of complement, union, and intersection, with the universe held constant.

Check Your Understanding

In each question, keep the specified universe fixed and use membership to justify your answer.

  1. If \(X=\{a,b,c,d\}\) and \(A=\{a,c\}\), find \(X\setminus A\) and \(X\setminus(X\setminus A)\).
  2. For \(X=\{1,2,3,4,5\}\), \(A=\{1,2,3\}\), and \(B=\{3,4\}\), compute both sides of the law for the complement of a union.
  3. In the same universe and with the same sets, compute both sides of the law for the complement of an intersection.
  4. Let \(A=[-1,1]\) and \(B=(0,2)\), with universe \(\mathbb{R}\). Find \(\mathbb{R}\setminus(A\cup B)\) and \((\mathbb{R}\setminus A)\cap(\mathbb{R}\setminus B)\).
  5. Give two different universes containing the same set \(A\) for which the relative complements of \(A\) differ.