# Open + Closed

Example 1. Let
$(\mathcal{X},d)$
be a metric space and
$x\in\mathcal{X}$
. Prove
$\{x\}\subset \mathcal{X}$
is closed.
Hint
Visual
Formal Write-Up
Follow-Up
It may be easier to prove the complement is open than the prove
$\{x\}$
is closed. Sometimes it is hard to make a direct proof. Here we take an alternative route by proving that the complement is open. We pick a point not equal to and must show . This is done by picking a radius to be half the distance between and so that . We get the proof by rearranging the triangle inequality to show
We use the fact a set is open if and only if its complement is closed. We proceed by showing the complement set
$\mathcal{C} \triangleq \mathcal{X} - \{x\}$
is open. Recall
$\mathcal{C}$
is open if and only if each element of
$\mathcal{C}$
is an interior point. To this end, let
$z \in \mathcal{C}$
be given. It suffices to show
$z \in \text{int}(\mathcal{C})$
.
Since
$z\in\mathcal{C}$
,
$z \neq x$
, and so
$d(x,z) > 0$
. Thus, setting
$r \triangleq d(x,z) / 2$
gives
$r > 0$
. For all
$y \in B(z,r)$
, the triangle inequality and choice of
$r$
imply
 ​$\begin{array}{cl} &d(x,z) \leq d(x,y) + d(y,z) \\ \implies \ \ & d(x,y) \geq d(x,z) - d(y,z) \geq 2r - r = r > 0 \\ \implies \ \ & y \neq x \\ \implies \ \ & y \in \mathcal{C}.\end{array}$​ ​
Thus,
$B(z,r) \subseteq \mathcal{C}$
, i.e.
$z$
is an interior point.
 ​$\blacksquare$​ ​
As noted previously, when proving something holds "for all elements,'' it is typically easiest to let an arbitrary element be given and prove the relation for that element. The result then will follow.
Example 2. Let
$\mathcal{X}$
be a metric space. If
$\mathcal{X} = \mathcal{A}\cup \mathcal{B}$
with nonempty
$\mathcal{A}$
and
$\mathcal{B}$
,
$\overline{\mathcal{A}} \cap \mathcal{B} = \emptyset$
, and
$\mathcal{A} \cap \overline{\mathcal{B}} = \emptyset$
. Show both
$\mathcal{A}$
and
$\mathcal{B}$
are open.
Visual
Formal Write-Up Illustration of and a ball in . Note the ball is shown in red and is not the entire green circle. This follows from the fact a ball in can only contain elements in . Thus, in general, a ball might not be round.
Let
$x\in \mathcal{A}$
be given. Set
$ho_x$
to be the distance from
$x$
to
$\overline{\mathcal{B}}$
, i.e.
 ​$ho_x \triangleq d(x, \overline{\mathcal{B}}) = \inf \{ d(x,y) : y \in \overline{\mathcal{B}}\}.$​ ​
Since
$\{x\}$
is compact,
$\overline{\mathcal{B}}$
is closed and
$\{x\}\cap\overline{\mathcal{B}}=\emptyset$
, the distance
$ho_x$
is positive.* Then consider the ball
 ​$B\left(x, \frac{\rho_x}{2}\ \right) \triangleq \left\lbrace z : d(x,z) < \frac{\rho_x}{2}, \ z \in \mathcal{X}\right\rbrace.$​ ​
For all
$y \in \mathcal{B}$
,
 ​$d(x,y) \geq \rho_x > \dfrac{\rho_x}{2} \ \ \ \implies \ \ \ y \notin B\left(x, \frac{\rho_x}{2}\right).$​ ​
Hence
$B(x,\rho_x/2)\cap \overline{B} = \emptyset$
. With the fact
$B(x,\rho_x/2) \subseteq \mathcal{X} = \mathcal{A}\cup \mathcal{B}$
, we deduce
$B(x,\rho_x) \subseteq \mathcal{A}$
, i.e.
$x$
is an interior point of
$\mathcal{A}$
. Since
$x$
was arbitrarily chosen, every element of
$\mathcal{A}$
is an interior point, i.e.
$\mathcal{A}$
is open. An analogous argument applies to show
$\mathcal{B}$
is open, completing the proof.
 ​$\blacksquare$​ ​
*This follows from a prior example.