Set is Open iff Union of Open Balls

Theorem
Let $M = \struct {A, d}$ be a metric space.

Let $U \subseteq A$.

Then $U$ is open in $M$ it is a union of open balls.

Necessary Condition
Let $U$ be open in $M$.

Let $a \in U$.

Then by definition of open set:
 * $\exists \delta_a \in \R_{>0}: \map {B_{\delta_a} } {a, d} \subseteq U$

where $\map {B_{\delta_a} } {a, d}$ is the open $\delta_a$-ball of $a$ in $M$.

Therefore:
 * $\ds U = \bigcup_{a \mathop \in U} \map {B_{\delta_a} } {a, d}$

and so $U$ is a union of open balls.

Sufficient Condition
Let $U$ be a union of open balls of $M$.

Let the centers of these open balls be the elements of an indexing set $I$.

Then $U$ can be written as:
 * $\ds U = \bigcup_{a \mathop \in I} \map {B_{\delta_a} } {a, d}$

where $\delta_a \in \R_{>0}$ is the radius of the open ball of $a$.

Let $x \in U$.

Then by definition of union:
 * $\exists a \in I: x \in \map {B_{\delta_a} } {a, d}$

From Open Ball is Neighborhood of all Points Inside, $\map {B_{\delta_a} } {a, d}$ is a neighborhood of $x$.

By Set is Subset of Union:
 * $\map {B_{\delta_a} } {a, d} \subseteq U$

From Superset of Neighborhood in Metric Space is Neighborhood, it follows that $U$ is a neighborhood of $x$.

Since $x$ is arbitrary, it follows that $U$ is a neighborhood of each of its points.

Hence by definition, $U$ is open in $M$.

Necessary Condition
See Proof 1.

Sufficient Condition
$U$ is a union of open balls but not open.

As $U$ is not open, there is a $y \in U$ such that for any $\epsilon \in \R_{>0}$, $\map {B_\epsilon} y \setminus U \ne \O$.

As $U$ is a union of open balls, there is an $x \in U$ and $r \in \R_{>0}$ such that $y \in \map {B_r} x$.

By Open Ball of Point Inside Open Ball, there exists a $\delta \in \R_{>0}$ such that $\map {B_\delta} y \subseteq \map {B_r} x$.

This is contradicted by the assumption.

Thus, $U$ has to be open.