Probability, analysis, and algebra find their foundational roots in set theory, which offers a unified language for defining crucial concepts and facilitating calculations within these mathematical domains. In this article, we present a succinct course aimed at introducing the fundamentals of set theory and exploring its essential properties. Whether you’re a budding mathematician or simply curious about the foundations of mathematics, this article will provide you with a solid understanding of this essential field. It’s worth noting that set theory finds practical applications across STEM disciplines.

## Origins of Set Theory

Set theory had its roots in the 19th century, with mathematicians like Georg Cantor and Richard Dedekind making significant contributions. Cantor, in particular, revolutionized mathematics by introducing the concept of infinite sets and exploring their properties. This laid the groundwork for a new branch of mathematics focused on sets and their relationships.

## Defining Sets

a set, which is a collection of distinct objects or elements. These elements can be anything – numbers, letters, or even other sets. Sets are typically denoted using capital letters (e.g., $A$, $B$, $C$) and are defined by listing their elements within braces.

The set $$ A=\{\spadesuit,\clubsuit,\heartsuit\}$$ contains three object. We say that $\spadesuit,\clubsuit$, $\heartsuit$ belong to $A$ and use the symbole “$\in$” to mention that an object belongs to the set $A$, as example $\spadesuit\in A$.

A subset $B$ of a set $A$ is a set for which all its elements belong to the set $A$. In the case, we write $A\subset B$.

The following are classical sets of numbers:

- $ \mathbb{N}:=\{0,1,2,3,\cdots\}$, the set of natural numbers.
- $ \mathbb{Z}:=\{\cdots,-2,-1,0,1,2,\cdots\}$, the set of integers
- $ \mathbb{Q}:=\{\frac{p}{q}: p,q\in \mathbb{Z},\;q\neq 0\}$, the set of rational numbers.
- $\mathbb{R}$ is the set of real numbers

## Key Concepts in Set Theory

Let us first define a trivial set. The set that has no element is called the empty set and will be denoted by $\emptyset$

### Subsets

A set $A$ is considered a **subset** of another set $B$ if every element of $A$ is also an element of $B$. This is denoted as $A\subset B$. we also say that $B$ is a **superset** of $A$, and we write $B\supset A$. Observe that always $\emptyset \subset B$. For example $$ \mathbb{N}\subset \mathbb{Z}\subset \mathbb{Q}\subset \mathbb{R}.$$

### Union and Intersection

Sets can be combined through union (combining all unique elements) and intersection (finding common elements). For sets $A$ and $B$, the union is denoted as $A\cup B$ and the intersection as $A\cap B$. Thus $ x\in A\cup B$ is equivalent to $x\in A$ or $x\in B$. Similarly, $x\in A\cap B$ if and only if $x\in A$ and $x\in B$. Moreover, we have \begin{align*}& A\cap B \subset A,\quad A\cap B\subset B\cr & A\subset A\cup B,\quad B\subset A\cup B.\end{align*} Let $\{ A_i: i\in I\}$ (here $I$ is a set) is a collection of nonempty sets. The union and the intersection of all elements of this collection are, respectively, denoted by $$ \bigcup_{i\in I} A_i,\quad \bigcap_{i\in I} A_i$$. We say that $\{ A_i: i\in I\}$ is a **partition** of a set $A$ if for any $i,j\in I$ such that $i\neq j$, $A_i\cap A_j=\emptyset$ and $$ A=\bigcup_{i\in I} A_i.$$

** Distributive law:** For any sets $A,B$, and $C$, we have

- $A\cap (B\cup C)=(A\cap B)\cup (A\cap C)$.
- $A\cup (B\cap C)=(A\cup B)\cap (A\cup C)$.

### Complement

The complement of a set A with respect to a universal set U contains all elements for $U$ that are not in $A$. It is denoted as $A^c$ or $\overline{A}$.

** De Morgan’s law:** For any subsets $A$ and $B$ of a universal set $U$, we have $$ (A\cup B)^c=A^c\cap B^c,\quad (A\cap B)^c=A^c\cup B^c.$$

### Cartesian product

Let $A$ and $B$ be two sets. The **cartesian product** of $A$ and $B$ is the set $$ A\times B=\{(x,y): x\in A,\;y\in B\}.$$ For $n\in \mathbb{N}\setminus\{0\}$, we define \begin{align*}A^n&=A\times A\times\cdots\times A\cr &= \{(x_1,x_2,\cdots,x_n): x_i\in A,\;i=1,\cdots,n\}.\end{align*}

### Functions between sets

In the realm of probability, functions play a pivotal role. A function, denoted as $f$, serves as a guiding rule that takes input from a specific set, known as the **domain**, and generates an output from another set, termed the **co-domain**. This process constitutes a mapping, ensuring that each input uniquely corresponds to a single output.

For any given function $f,$ when an element $x$ resides in the domain, the resulting output is represented as $f(x)$. To specify this relationship, where $A$ signifies the domain and $B$ designates the co-domain of the function $f$, we adopt the notation $f: A\to B$.

When $C$ is a subset of $A$ and $f: A\to B$ is a function, the set $f(C)$, known as the direct image of $C$ under $f$, is a subset of $B$. Mathematically, it is defined as $$ f(C)=\{f(x): x\in C\}.$$ Now when $D$ is a subset of $B$, we defined a subset of $A$ by selecting $$f^{-1}(D):=\{x\in A: f(x)\in D\}.$$ This set is referred to as the inverse image of $D$.

A function $f: A\to B$ is called **injective** if for $x,y\in A$, the condition $f(x)=f(y)$ implise that $x=y$. Additionally, $f$ is called **surjective**, if for any $b\in B$ there exists an element $a\in A$ such that $b=f(a)$. Furthermore, $f$ est dite **bijective** if it possesses both injective and surjective properties. In other words, for any $b\in B$, there exists a unique $a\in A$ such that $b=f(a)$.

## Cardinality: Countable and Uncountable Sets

The cardinality of a set refers to the number of elements it contains. For finite sets, this is a straightforward concept, but set theory extends this to infinite sets. The cardinality of set $A$ will be denoted by $|A|$. Here we observe that $|A|\in \mathbb{N}$. For example $|\emptyset|=0$.

### Finite Sets:

A set $A$ is finite if there exists $p\in \mathbb{N}$ such that $|A|=p$. We write $|A| < \infty$ to indicate that the set $A$ is finite. In addition

If $|A| < \infty$ and $|B| < \infty$, then $|A\cup B| < \infty$ and $$ |A\cup B|=|A|+|B|-|A\cap B|.$$

### Infinite sets

A set is considered **countable** when its elements can be enumerated in such a way that each element is assigned a unique natural number during the counting process, even if the enumeration continues infinitely.

An **uncountable set** is a set that is too vast to be enumerated in such a way that each of its elements can be assigned a unique natural number. In other words, an uncountable set contains an infinite number of elements, and there is no one-to-one correspondence between its elements and the natural numbers. The most famous example of an uncountable set is the set of all real numbers between 0 and 1, often denoted as the interval $(0,1)$.

Mathematically, we have the following definition:

A set $C$ is called countable if one of the following assertions hold:

- $C$ is finite, $|C| < \infty$, or
- there exists a bijection $f:\mathbb{N}\to C$.