Nour Bachir University Center logo
Nour Bachir University Center, El Bayadh, AlgeriaSciences Institute · Mathematics Department

Set Theory

Sets, Subsets and the Empty Set

A set is simply a collection of objects. The objects that form a set are called the elements of the set.

One should be aware of the fact that there is nothing that prevents a set from being an element of another set. Indeed, as we will see later, not only is every element a set, but everything is a set.

An element of a set is sometimes called a member of the set. If \(X\) is a set and \(x\) is an element of \(X\), we write \[x \in X.\] If \(x\) is not an element of the set \(X\), we write \[x \notin X.\]

Examples

There is a set whose elements are \(0\), \(1\), and \(2\). We denote this set by \[\{0,1,2\}.\] Clearly, \[2 \in \{0,1,2\}, \quad \text{but} \quad 3 \notin \{0,1,2\}.\]

In general, a set with finitely many elements \(x_1, x_2, \ldots, x_n\) is denoted by \[\{x_1, x_2, \ldots, x_n\}.\]

Conversely, given sets \(x_1, x_2, \ldots, x_n\), we can form the set \[\{x_1, x_2, \ldots, x_n\},\] whose elements are precisely the sets \(x_1, x_2, \ldots, x_n\).

In particular, if \(x\) is a set, we can form the set \[\{x\},\] whose only element is \(x\). In this case, we have \(x \in \{x\}\). A set with exactly one element is called a singleton.

Equality of Sets

Two sets are said to be equal if they contain exactly the same elements. Equality of sets does not depend on the number of elements alone.

For example, \[\{0\} \neq \{2\},\] because these two sets have different elements.

Finite and Infinite Sets

A set is called finite if it has finitely many elements. Otherwise, it is called infinite.

A finite set cannot be equal to an infinite set. Furthermore, two finite sets with different numbers of elements cannot be equal.

This chapter introduces set theory, mathematical induction, and formalizes the notion of mathematical functions. The material is mostly elementary. For those of you new to abstract mathematics, elementary does not mean simple (though much of the material is fairly simple). Rather, elementary means that the material requires very little previous education to understand it.

Elementary material can be quite challenging, and some of the material in this chapter, if not exactly rocket science, may require that you adjust your point of view to understand it. The single most powerful technique in mathematics is to adjust your point of view until the problem you are trying to solve becomes simple.

Another point at which this material may diverge from your previous experience is that it will require proof. In standard introductory classes in algebra, trigonometry, and calculus, there is currently very little emphasis on the discipline of proof. Proof is, however, the central tool of mathematics. This text is for a course that is a student’s formal introduction to the tools and methods of proof.

A set is a collection of distinct objects. This means that \[\{1,2,3\}\] is a set, but \[\{1,1,3\}\] is not, because the element \(1\) appears twice in the second collection. The second collection is called a multiset.

Sets are often specified using curly brace notation. For example, the set of even integers can be written as \[\{2n : n \text{ is an integer}\}.\]

The opening and closing curly braces denote a set, \(2n\) specifies the members of the set, the colon means “such that” or “where,” and everything following the colon gives conditions that explain or refine the membership.

All correct mathematics can be spoken in English. The set definition above is read as “The set of \(2n\) where \(n\) is an integer.”

The only problem with this definition is that we do not yet have a formal definition of the integers. The integers are the set of whole numbers, both positive and negative: \[\{0, \pm1, \pm2, \pm3, \ldots\}.\]

We now introduce the operations used to manipulate sets, using the opportunity to practice curly brace notation.

The empty set is a set containing no objects. It is written as a pair of curly braces with nothing inside, \[\{\},\] or by using the symbol \(\varnothing\).

As we shall see, the empty set is a handy object. It is also quite strange. The set of all humans who weigh at least eight tons, for example, is the empty set. Sets whose definitions contain a contradiction or impossibility are often empty.

The set membership symbol \(\in\) is used to say that an object is a member of a set. Its partner symbol \(\notin\) is used to say that an object is not a member of a set.

Two sets are said to be equal if they have exactly the same members.

If \[S = \{1,2,3\},\] then \(3 \in S\) and \(4 \notin S\). The set membership symbol is often used in defining operations that manipulate sets.

The set \[T = \{2,3,1\}\] is equal to \(S\) because they have the same members: \(1\), \(2\), and \(3\). While we usually list the members of a set in a “standard” order (if one is available), there is no requirement to do so, and sets are indifferent to the order in which their members are listed.

The cardinality of a set is its size. For a finite set, the cardinality of a set is the number of members it contains. In symbolic notation, the size of a set \(S\) is written \(|S|\). We will deal with the idea of the cardinality of an infinite set later.

For the set \[S = \{1,2,3\},\] we show its cardinality by writing \(|S| = 3\).

We now move on to a number of operations on sets. You are already familiar with several operations on numbers, such as addition, multiplication, and negation.

The intersection of two sets \(S\) and \(T\) is the collection of all objects that are in both sets. It is written \(S \cap T\). Using curly brace notation, \[S \cap T = \{x : (x \in S) \text{ and } (x \in T)\}.\]

The word and in the above definition is an example of a Boolean (logical) operation. It is true only when both propositions it joins are true. Its symbolic equivalent is \(\wedge\), which allows us to write the definition more compactly: \[S \cap T = \{x : (x \in S) \wedge (x \in T)\}.\]

Suppose \[S = \{1,2,3,5\}, \quad T = \{1,3,4,5\}, \quad U = \{2,3,4,5\}.\] Then \[S \cap T = \{1,3,5\}, \quad S \cap U = \{2,3,5\}, \quad T \cap U = \{3,4,5\}.\]

If \(A\) and \(B\) are sets and \(A \cap B = \varnothing\), then we say that \(A\) and \(B\) are disjoint, or disjoint sets.

The union of two sets \(S\) and \(T\) is the collection of all objects that are in either set. It is written \(S \cup T\). Using curly brace notation, \[S \cup T = \{x : (x \in S) \text{ or } (x \in T)\}.\]

The word or is another Boolean operation. It is true if either of the propositions it joins is true. Its symbolic equivalent is \(\vee\), which allows us to rewrite the definition as \[S \cup T = \{x : (x \in S) \vee (x \in T)\}.\]

Suppose \[S = \{1,2,3\}, \quad T = \{1,3,5\}, \quad U = \{2,3,4,5\}.\] Then \[S \cup T = \{1,2,3,5\}, \quad S \cup U = \{1,2,3,4,5\}, \quad T \cup U = \{1,2,3,4,5\}.\]

When performing set-theoretic computations, you should declare the domain in which you are working. In set theory, this is done by declaring a universal set.

The universal set, at least for a given collection of set-theoretic computations, is the set of all possible objects. It is commonly written as \(U\).

If we declare our universal set to be the integers, then \[\left\{\frac{1}{2}, \frac{2}{3}\right\}\] is not a well-defined set because the objects used to define it are not members of the universal set. The symbols \[\left\{\frac{1}{2}, \frac{2}{3}\right\}\] do define a set if a universal set that includes \(\frac{1}{2}\) and \(\frac{2}{3}\) is chosen. The problem arises from the fact that neither of these numbers are integers.

Now that we have the idea of declaring a universal set, we can define another operation on sets.

Venn Diagrams

A Venn diagram is a way of depicting the relationship between sets. Each set is shown as a circle, and circles overlap if the sets intersect.

The following are Venn diagrams for the intersection and union of two sets. The shaded parts of the diagrams represent the intersection and the union, respectively: \[A \cap B \qquad\qquad A \cup B\] Notice that the rectangle containing the diagram is labeled \(\Omega\), representing the universal set.

1.1 Ensembles

1.1.4 Operations in \(\mathcal{P}(E)\)

\(\blacklozenge\) Definition 1 Let \(E\) be a set, and \(A, B \in \mathcal{P}(E)\). We define the following subsets of \(E\):

Venn Diagrams for Set Operations

The complement of a set \(S\) is the collection of objects in the universal set that are not in \(S\). The complement is written \(S^{c}\).

Using curly brace notation, \[S^{c} = \{x : (x \in U) \wedge (x \notin S)\}.\]

More compactly, this may be written as \[S^{c} = \{x : x \notin S\}.\] It should be apparent that the complement of a set always depends on which universal set is chosen.

There is also a Boolean symbol associated with the complementation operation: the not operation. The notation for not is \(\neg\). Using this symbol, the definition of complement can be written as \[S^{c} = \{x : \neg(x \in S)\}.\]

  1. Let the universal set be the integers. Then the complement of the even integers is the set of odd integers.

  2. Let the universal set be \(\{1,2,3,4,5\}\). Then the complement of \[S = \{1,2,3\}\] is \[S^{c} = \{4,5\},\] while the complement of \[T = \{1,3,5\}\] is \[T^{c} = \{2,4\}.\]

  3. Let the universal set be the letters \[\{a,e,i,o,u,y\}.\] Then \[\{y\}^{c} = \{a,e,i,o,u\}.\]

The Venn diagram for \(A^{c}\) is illustrated below: \[A^{c}\]

We now have enough set-theoretic operators to define additional operations quickly. As before, we will give both English and symbolic definitions.

The difference of two sets \(S\) and \(T\) is the collection of objects in \(S\) that are not in \(T\). The difference is written \(S - T\).

Using curly brace notation, \[S - T = \{x : x \in (S \cap T^{c})\}.\]

Equivalently, this may be written as \[S - T = \{x : (x \in S) \wedge (x \notin T)\}.\]

Notice how intersection and complementation can be combined to define the difference operation, and how the definition can be expressed using Boolean operations. There is a set of rules that reduces the number of parentheses required in such expressions; these are called operator precedence rules. \[y = \frac{x}{x-1} \quad \Rightarrow \quad y(x-1) = x \quad \Rightarrow \quad xy - y = x \quad \Rightarrow \quad xy - x = y \quad \Rightarrow \quad x(y-1) = y \quad \Rightarrow \quad x = \frac{y}{y-1}\]

which tells us that \(g^{-1}(x) = \frac{x}{x-1}\), so \(g = g^{-1}\): the function is its own inverse.

A function has an inverse if and only if it is a bijection.

Proof. Suppose that \(f : S \to T\) is a bijection. Then if \(g : T \to S\) has ordered pairs that are the exact reverse of those given by \(f\), it is obvious that for all \(x \in S\), \(g(f(x)) = x\), likewise that for all \(y \in T\), \(f(g(y)) = y\). We have that bijections possess inverses.

It remains to show that non-bijections do not have inverses. If \(f : S \to T\) is not a bijection, then either it is not a surjection or it is not an injection. If \(f\) is not a surjection, then there is some \(t \in T\) that appears in no ordered pair of \(f\). This means that no matter what \(g(t)\) is, \(f(g(t)) \neq t\) and we fail to have an inverse.

If, on the other hand, \(f : S \to T\) is a surjection but fails to be an injection, then for some distinct \(a, b \in S\) we have that \(f(a) = t = f(b)\). For \(g : T \to S\) to be an inverse of \(f\), we would need \(g(t) = a\) and \(g(t) = b\), forcing \(t\) to appear as the first coordinate of two ordered pairs in \(g\) and so rendering \(g\) a non-function. We thus have that non-bijections do not have inverses. ◻

The type of inverse we are discussing above is a two-sided inverse. The functions \(f\) and \(f^{-1}\) are mutually inverses of one another. It is possible to find a function that is a one-way inverse of a function so that \(f(g(x)) = x\) but \(g(f(x))\) is not even defined. These are called one-sided inverses.

Note on mathematical grammar: Recall that when two notions, such as “bijection” and “has an inverse”, are equivalent we use the phrase “if and only if” (abbreviated iff) to phrase a proposition declaring that the notions are equivalent. A proposition that \(A \iff B\) is proven by first assuming \(A\) and deducing \(B\) and then separately assuming \(B\) and deducing \(A\). The formal symbol for \(A \iff B\) is \(A \Leftrightarrow B\). Likewise we have symbols for the ability to deduce \(B\) given \(A\), \(A \Rightarrow B\) and vice-versa \(B \Rightarrow A\). These symbols are spoken “\(A\) implies \(B\)” and “\(B\) implies \(A\)” respectively.

Suppose that \(X, Y, Z\) are sets. If \(f : X \to Y\) and \(g : Y \to Z\) are bijections, then so is \(g \circ f : X \to Z\).

Proof: this proof is left as an exercise.

Suppose that \(f : A \to B\) is a function. The image of \(A\) in \(B\) is the subset of \(B\) made of elements that appear as the second element of ordered pairs in \(f\). Colloquially, the image of \(f\) is the set of elements of \(B\) hit by \(f\). We use the notation \(\mathrm{Im}(f)\) for images. In other words, \[\mathrm{Im}(f) = \{ f(a) : a \in A \}.\]

If \(f : \mathbb{N} \to \mathbb{N}\) is given by the rule \(f(n) = 3n\), then the set \(T = \{0, 3, 6, \dots\}\) of natural numbers that are multiples of three is the image of \(f\). Notation: \(\mathrm{Im}(f) = T\).

If \(g : \mathbb{R} \to \mathbb{R}\) is given by \(g(x) = x^2\), then \[\mathrm{Im}(g) = \{y : y \ge 0, y \in \mathbb{R} \}.\]

If \(A\) and \(B\) are sets, then the set of all ordered pairs with the first element from \(A\) and the second from \(B\) is called the Cartesian Product of \(A\) and \(B\). The notation for the Cartesian product of \(A\) and \(B\) is \(A \times B\). Using curly brace notation: \[A \times B = \{ (a, b) : a \in A, b \in B \}.\]

If \(A = \{1, 2\}\) and \(B = \{x, y\}\), then \[A \times B = \{(1, x), (1, y), (2, x), (2, y)\}.\] The Cartesian plane is an example of a Cartesian product of the real numbers with themselves: \(\mathbb{R} \times \mathbb{R}\).


Algebra I Courses · Mathematics Department · University Center of El Bayadh Nour El Bachir · 2025/2026