# Measure Theory/Basic Structures And Definitions/Semialgebras, Algebras and σ-algebras
## Semialgebras

Roughly speaking, a semialgebra over a set $\,X$ is a class that is closed under intersection and semi closed under set difference. Since these restrictions are strong, it's very common that the sets in it have a defined characterization and then it's easier to construct measures over those sets. Then, we'll see the structure of an algebra, that it's closed under set difference, and then the σ-algebra, that it is an algebra and closed under countable unions. The first structures are of importance because they appear naturally on sets of interest, and the last one because it's the central structure to work with measures, because of its properties.
Definition 1.1.1: A class ${\mathcal {S}}\subseteq {\mathcal {P}}(X)$ is a Semialgebra over $\,X$ if:
* The empty set and whole set are in ${\mathcal {S}}$:
       $\emptyset \in {\mathcal {S}},X\in {\mathcal {S}}$
* It's closed under intersection:
       $\forall A,B\in S\Rightarrow A\cap B\in {\mathcal {S}}$
* The set difference of any two sets in ${\mathcal {S}}$ is the finite disjoint union of elements in ${\mathcal {S}}$:
       $\forall A,B\in S,\;\;\exists \{C_{i}\}_{i=1}^{n}\subseteq {\mathcal {S}}$ pairwise-disjoint such that $\;A\setminus B=\bigcup _{i=1}^{n}C_{i}$
Example: It might seem—at first sight—that a semialgebra is a very restricted subset of ${\mathcal {P}}(X)$, but it's easy to prove that with $X=\mathbb {R}$ the class of all intervals (bounded, unbounded, semi-open, open, closed or any other class) is a semialgebra over $\mathbb {R}$ and clearly this set is non-trivial. For example, let A be $(2,5)$ and B be $(3,4)$. Then $A\setminus B=(2,3]\cup [4,5)=C$, say. Let us call $(2,3]=C1$ and $[4,5)=C2$. Then $C=C1\cup C2,C\notin S$ (because it is not an interval) even though $C1,C2\in S$. Further, $C1$ and $C2$ are disjoint.

## Algebras

An algebra over a set $\,X$ is a class closed under all finite set operations.
Definition 1.1.2 : A class ${\mathcal {A}}\subseteq {\mathcal {P}}(X)$ is an Algebra over $\,X$ if:
* $X\in {\mathcal {A}}$
* $\forall A,B\in {\mathcal {A}}\Rightarrow A\setminus B\in {\mathcal {A}}$
This definition suffices for the closure under finite operations. The following properties shows it
Proposition 1.1 : A class ${\mathcal {A}}\subseteq {\mathcal {P}}(X)$ is an algebra if and only if ${\mathcal {A}}$ satisfies :
* $X\in {\mathcal {A}}$
* $\forall A\in {\mathcal {A}}\Rightarrow A^{c}\in {\mathcal {A}}$
* $\forall A,B\in {\mathcal {A}}\Rightarrow A\cap B\in {\mathcal {A}}$
Proof : $(\Rightarrow )$
Property 1 is identical.
For property 2 , note that $\forall A\in {\mathcal {A}}$:
    $A^{c}=X\setminus A\in {\mathcal {A}}$
Finally for property 3 , since the property 2 holds, $\forall B\in {\mathcal {A}}$ :
    $B^{c}\in {\mathcal {A}}\Rightarrow A\setminus B^{c}=A\cap B\in {\mathcal {A}}$
$(\Leftarrow )$
Property 1 is identical.
For all $A,B\in {\mathcal {A}}$, from property 2 we have that $B^{c}\in {\mathcal {A}}$. Property 3 then implies that $A\cap B^{c}\in {\mathcal {A}}$, which is equivalent to $A\setminus B\in {\mathcal {A}}$ $\Box$
Note: It's easy to see that given $\forall A,B\in {\mathcal {A}}$, then, from properties 2 and 3, $(A^{c}\cap B^{c})^{c}=A\cup B\in {\mathcal {A}}$, so an algebra is closed for all finite set operations.

## σ-algebras

A σ-algebra (also called σ-ring) over a set $\,X$ is an algebra closed under countable unions.
Definition 1.1.3 : A class ${\mathcal {T}}\subseteq {\mathcal {P}}(X)$ is a σ-algebra over $\,X$ if:
* ${\mathcal {T}}$ is an algebra
* $\forall \{{A_{n}\}}_{n\in \mathbb {N} }\subset {\mathcal {T}}\Rightarrow \cup _{n\in \mathbb {N} }A_{n}\in {\mathcal {T}}$
Note: A σ-algebra is also closed under countable intersections, because the complement of a countable union, is the countable intersection of the complement of the sets considered in the union.

## Borel Sets
### Theorem

Let $X$ be a set and let ${\mathcal {F}}$ be a collection of subsets of $X$. Then, there exists a smallest σ-ring ${\mathcal {F}}^{*}$ containing ${\mathcal {F}}$, that is, if ${\mathcal {M}}$ is a σ-ring containing ${\mathcal {F}}$, then ${\mathcal {F}}^{*}\subseteq {\mathcal {M}}$

#### Proof

Let ${\mathcal {F}}^{*}$ be the intersection of all σ-rings that contain ${\mathcal {F}}$. It is easy to see that $E\in {\mathcal {F}}^{*}\Rightarrow E^{c}\in {\mathcal {F}}^{*}$ and that ${\mathcal {M}}_{1},{\mathcal {M}}_{2},\ldots \in {\mathcal {F}}^{*}\Rightarrow \bigcup _{i=1}^{\infty }{\mathcal {M}}_{i}\in {\mathcal {F}}^{*}$ and thus, ${\mathcal {F}}^{*}$ is a σ-ring.
${\mathcal {F}}^{*}$ is sometimes said to be the extension of ${\mathcal {F}}$
Now, let ${\mathcal {T}}$ be a topology over $X$. Thus, there exists a σ-algebra ${\mathcal {B}}$ over $X$ such that ${\mathcal {B}}={\mathcal {T}}^{*}$. ${\mathcal {B}}$ is called Borel algebra and the members of ${\mathcal {B}}$ are called Borel sets