This question is from Christopher Tapp's Matrix groups for Undergraduates:
Let $S \subset G \subset \mathbb R^n$ be subsets. Prove the following:
$S$ is open in $G$ if and only if for all $p \in S$, there exists $r>0$ such that $\left\{ q \in G | \text{ dist}(p,q) < r \right\} \subset S$, where dist$(p,q)$ is the usual Euclidean distance in $\mathbb R^n$.
I have attempted the $\impliedby$ direction as follows:
$\exists r > 0$ such that $\left\{ q \in G | \text{ dist}(p,q) < r \right\} \subset S$. Further, we will assume that $S$ is closed, and aim for a contradiction.
Then there exists a closed subset $E$ of $\mathbb R^n$ such that $E \cap G = S.$
Since $E$ is closed it contains all of its boundary points, so there is at least one boundary point of $E$ that is in $S$.
And clearly at this boundary point $\nexists r >0$ such that $\left\{ q \in G | \text{ dist}(p,q) < r \right\} \subset S$. Contradiction.
Would anyone be able to tell me if this attempt has a vague relation to correctness? Also, any thoughts on the reverse implication. Thanks very much.
What you do is proving that $S$ is not closed in $G$.
That is not the same as proving that $S$ is open in $G$.
For a legitimate proof of $\impliedby$ note at first that set $\{q\in G\mid\text{dist}(p,q)<r\}=G\cap\{q\in\mathbb R^n\mid\text{dist}(p,q)<r\}$ is open in $G$ since $\{q\in\mathbb R^n\mid\text{dist}(p,q)<r\}$ is an open subset of $\mathbb R^n$.
Secondly note that: $$S=\bigcup_{p\in S}\{q\in G\mid\text{dist}(p,q)<r_p\}\tag1$$ where $r_p>0$ such that $\{q\in G\mid\text{dist}(p,q)<r_p\}\subseteq S$ for every $p\in S$.
This tells us that $S$ is a union of open sets in $G$ hence is open in $G$.
The reverse.
Let $S\subseteq G$ be open in $G$ and let $p\in S$.
We have $S=G\cap U$ where $U$ is an open subset of $\mathbb R^n$.
Then $p\in U$ and some $r>0$ exists with $\{q\in\mathbb R^n\mid\text{dist}(p,q)<r\}\subseteq U$.
Then $p\in G\cap\{q\in\mathbb R^n\mid\text{dist}(p,q)<r\}=\{q\in G\mid\text{dist}(p,q)<r\}$.