# Beginning Rigorous Mathematics/Sets and Functions

We will now discuss some important set operations. Recall from the preliminaries that we only intuitively define a set to be a collection of distinct mathematical objects. There are much better and rigorous definitions of what sets are and form a subject for study all by itself, into which we will not delve.

Recall the meaning of the symbol "${\displaystyle \in }$", which reads "is an element of" so that if ${\displaystyle A}$ is a set and ${\displaystyle x}$ an object, then ${\displaystyle x\in A}$ a is a statement (which is either true of false, depending on whether ${\displaystyle x}$ is an element of ${\displaystyle A}$).

### Sets and Set operations

In the following discussion, ${\displaystyle A}$ and ${\displaystyle B}$ denote any sets.

## Definitions

### The empty set: ${\displaystyle \emptyset }$

We will assume that the empty set exists, and is denoted by ${\displaystyle \emptyset }$. As the name suggests, the empty set contains no elements so that for any object ${\displaystyle x}$ the statement ${\displaystyle x\in \emptyset }$ is false.

### Set equality

Usually there is no ambiguity when we use the symbol "=" to refer to equality between sets. It is important that equality between sets is completely different to equality between numbers.

We define the logical statement "${\displaystyle A=B}$" to be true by definition when the statement "${\displaystyle x\in A\Leftrightarrow x\in B}$" (which reads "${\displaystyle x}$ is contained in ${\displaystyle A}$ if and only if ${\displaystyle x}$ is contained in ${\displaystyle B}$") is true, and false otherwise. Intuitively this means that sets are equal if and only if they contain exactly the same elements. For example, ${\displaystyle \{1,2,3\}=\{1,2\}}$ is false since "${\displaystyle 3\in \{1,2\}}$" is false. It might be helpful to check the truth table to see that "${\displaystyle 3\in \{1,2,3\}\Leftrightarrow 3\in \{1,2\}}$" is a false statement. It should then be clear that "${\displaystyle \{5,6,7\}=\{5,6,7\}}$" is true.

### Subsets

If every element of the set ${\displaystyle A}$ is an element of ${\displaystyle B}$, we then say that ${\displaystyle A}$ is a subset of ${\displaystyle B}$.

Rigorously, we say that the statement "${\displaystyle A\subset B}$" is true by definition when the statement "${\displaystyle x\in A\Rightarrow x\in B}$" (which reads "If ${\displaystyle x}$ is contained in ${\displaystyle A}$ then ${\displaystyle x}$ is contained in ${\displaystyle B}$") is true.

We have seen previously that the statement ${\displaystyle \{1,2\}=\{1,2,3\}}$ is false, however the statement ${\displaystyle \{1,2\}\subset \{1,2,3\}}$ is true. It should be clear that ${\displaystyle \{1,2,3,5\}\subset \{1,2,3,4\}}$ is false, since the statement "${\displaystyle 5\in \{1,2,3,5\}\Rightarrow 5\in \{1,2,3,4\}}$" is false.

### Intersection

We define the intersection of sets by the symbol "${\displaystyle \cap }$". Rigorously we write "${\displaystyle A\cap B:=\{x|x\in A\land x\in B\}}$" which reads "The intersection of the sets ${\displaystyle A}$ and ${\displaystyle B}$ is by definition equal to the set which contains exactly the elements which are contained in both ${\displaystyle A}$ and ${\displaystyle B}$".

For example "${\displaystyle \{1,2,3,4\}\cap \{1,4,5\}:=\{1,4\}}$".

We say that ${\displaystyle A}$ and ${\displaystyle B}$ are disjoint when ${\displaystyle A\cap B=\emptyset }$.

### Union

We define the union of sets by the symbol "${\displaystyle \cup }$". Rigorously we write "${\displaystyle A\cup B:=\{x|x\in A\lor x\in B\}}$" which reads "The union of the sets ${\displaystyle A}$ and ${\displaystyle B}$ is by definition equal to the set which contains exactly the elements which are contained in either one of ${\displaystyle A}$ and ${\displaystyle B}$".

For example "${\displaystyle \{1,2,3,4\}\cup \{1,4,5\}:=\{1,2,3,4,5\}}$".

### Complement

To define the complement of the set ${\displaystyle A}$ we assume that the set ${\displaystyle A}$ is a subset of some universal set ${\displaystyle X}$. We say "${\displaystyle A}$ lives in ${\displaystyle X}$". Often the universal set is implicitly clear, for example when we are studying real analysis we often just assume ${\displaystyle X=\mathbb {R} }$ or when studying complex analysis we assume ${\displaystyle X=\mathbb {C} }$.

We define the complement of a set by the superscript "${\displaystyle c}$". Rigorously "${\displaystyle A^{c}:=\{x\in X|\lnot x\in A\}}$" which reads "the complement of ${\displaystyle A}$ in ${\displaystyle X}$ is the set of all elements which are contained in ${\displaystyle X}$ and not in ${\displaystyle A}$".

For example, if we assume ${\displaystyle X=\{1,2,3,4,5\}}$ then ${\displaystyle \{1,5\}^{c}:=\{2,3,4\}}$.

### Relative complement

We define the relative complement of sets by the symbol "${\displaystyle \backslash }$". Rigorously, "${\displaystyle A\backslash B:=\{x\in A|\lnot x\in B\}}$" which reads "the relative complement of ${\displaystyle B}$ in ${\displaystyle A}$ is by definition equal to the set containing all the elements contained in ${\displaystyle A}$ and is not contained in ${\displaystyle B}$".

For example "${\displaystyle \{1,2,3,4\}\backslash \{1,4,5\}:=\{2,3\}}$".

## Some basic results

### Lemma 1

${\displaystyle (A=B)\Leftrightarrow (A\subset B)\land (B\subset A)}$. Which reads "A equals B if and only if A is a subset of B AND B is a subset of A"

proof As explained in the previous chapter, ${\displaystyle (A=B)\Leftrightarrow (A\subset B)\land (B\subset A)}$ will be true by adjunction when both ${\displaystyle (A=B)\Rightarrow (A\subset B)\land (B\subset A)}$ and ${\displaystyle (A\subset B)\land (B\subset A)\Rightarrow (A=B)}$ are true.

We prove first ${\displaystyle (A=B)\Rightarrow (A\subset B)\land (B\subset A)}$.

Let ${\displaystyle A=B}$, then by definition we have ${\displaystyle x\in A\Leftrightarrow x\in B}$, which is logically equivalent to ${\displaystyle (x\in A\Rightarrow x\in B)\land (x\in A\Rightarrow x\in B)}$. By simplification we have that ${\displaystyle x\in A\Rightarrow x\in B}$ is true, and that ${\displaystyle x\in A\Rightarrow x\in B}$ is true. Therefore by definition ${\displaystyle A\subset B}$, and ${\displaystyle B\subset A}$ are both true. By adjunction ${\displaystyle (A\subset B)\land (B\subset A)}$ is true. Therefore ${\displaystyle (A=B)\Rightarrow (A\subset B)\land (B\subset A)}$ is true.

Conversely, we prove ${\displaystyle (A\subset B)\land (B\subset A)\Rightarrow (A=B)}$.

Let ${\displaystyle (A\subset B)\land (B\subset A)}$. Then, by simplification, both ${\displaystyle A\subset B}$ and ${\displaystyle B\subset A}$ are true. By definition both ${\displaystyle x\in A\Rightarrow x\in B}$ and ${\displaystyle x\in B\Rightarrow x\in A}$ are true. By adjunction, ${\displaystyle (x\in A\Rightarrow x\in B)\land (x\in B\Rightarrow x\in A)}$ is true, which is logically equivalent to ${\displaystyle x\in A\Leftrightarrow x\in B}$. Then by definition ${\displaystyle A=B}$ is true. Therefore ${\displaystyle (A\subset B)\land (B\subset A)\Rightarrow (A=B)}$ is true. QED.

### Lemma 2

${\displaystyle A\subset A\cup B}$

### Lemma 3

${\displaystyle A\cap B\subset A}$ and ${\displaystyle A\cap B\subset B}$