> [!NOTE] Lemma (Types of Intervals)
> An [[Real intervals|interval]] is one of the following sets $\mathbb{R}, (-\infty,b), (-\infty,b], (a,b), [a,b), (a,b], [a,b], \{ a \}, (a,\infty),[a,\infty),$where $a<b$.
>
>*Proof*. If $I$ is an interval then by definition it is non-empty. Let $a= \inf I$ and $b = \sup I$ be the [[Bound of Set of Reals#^de37d4|supremum & infimum]] of $I$, then $a=-\infty$ or $a \in \mathbb{R}$, and $b =+\infty$ or $b \in \mathbb{R}$.
>
>For every $x \in I$, we have $a \leq x \leq b$ so $I \subset [a,b]$. If $a=b$ then $I=\{ a \}$.
>
>Otherwise we start by showing $(a,b) \subset I$. If $a<x$ then there exists $a' \in I$ such that $a'<x$: if $a=-\infty$ then $I$ is not bounded below so there exists $a' \in I$ with $a'<x$, while if $a \in \mathbb{R}$ we can take $\epsilon=(x-a)/2$ and find $a' \in I$ such that $a'<a+\epsilon<(x+a)/2<x.$
>
>Similarly if $x<b$ then there exists $b' \in I$ with $b'>x$.
>
>Since $[a',b']\subset I$ we have $x \in I$. Hence if both $a$ and $b$ are finite, whether the endpoints are included depends on if $\inf I$ and $\sup I \in I$; e.g. if $a \in I$ but $b\not \in I$ then $I = [a,b)$.
>
>If only one of $a$ and $b$ are finite then the interval is either $(-\infty,b), (-\infty,b], (a,\infty),[a,\infty),$ depending on whether $a \in I$ and $b\in I$.
>
>If neither $a$ nor $b$ is finite then $I=\mathbb{R}$.