Closure of Real Interval is Closed Real Interval

Theorem
Let $$I$$ be a real interval such that:
 * $$I = \left({a \, . \, . \, b}\right)$$;
 * $$I = \left[{a \, . \, . \, b}\right)$$;
 * $$I = \left({a \, . \, . \, b}\right]$$, or
 * $$I = \left[{a \, . \, . \, b}\right]$$.

Then $$\operatorname{cl} \left({I}\right)$$, the closure of $$I$$, is the closed interval $$\left[{a \,. \, . \, b}\right]$$.

Proof
Let $$I$$ be one of the intervals as specified in the exposition.

We are to show that $$x \in \left[{a \,. \, . \, b}\right]$$ iff every open set in $$\R$$ containing $$x$$ contains a point in $$I$$.

Let $$x \in \left[{a \,. \, . \, b}\right]$$.

Then one of the following three possibilities holds:


 * $$a < x < b$$;
 * $$x = a$$;
 * $$x = b$$.

Let $$\left({c \, . \, . \, d}\right)$$ be an open interval in $$\R$$ such that $$x \in \left({c \, . \, . \, d}\right)$$.

Then $$\left({c \, . \, . \, d}\right)$$ is an open set in $$\R$$.

By definition, there exists an $\epsilon$-neighborhood $$N_\epsilon \left({x}\right)$$ of $$x$$ such that $$N_\epsilon \left({x}\right) \subseteq \left({c \, . \, . \, d}\right)$$.


 * If $$a < x < b$$ then $$x \in I$$ and so $$\left({c \, . \, . \, d}\right)$$ contains a point in $$I$$.


 * If $$x = a$$, then $$\exists \epsilon > 0: a + \epsilon < b$$.

Hence $$\exists y \in N_\epsilon \left({x}\right)$$ such that $$y > a$$ and $$y < b$$.

Hence $$y \in I$$.


 * If $$x = b$$, then $$\exists \epsilon > 0: b - \epsilon > a$$.

Hence $$\exists y \in N_\epsilon \left({x}\right)$$ such that $$y > a$$ and $$y < b$$.

Hence $$y \in I$$.

Now suppose $$x \notin \left[{a \,. \, . \, b}\right]$$.

Then $$x < a$$ or $$x > b$$.


 * Let $$x < a$$.

Then $$\exists \epsilon > 0: x + \epsilon < a$$.

Hence $$\exists N_\epsilon \left({x}\right): N_\epsilon \left({x}\right) \cap \left[{a \,. \, . \, b}\right] = \varnothing$$.


 * Similarly for $$x > b$$.

The result follows from Condition for Point being in Closure.