Dense and locally compact subset of a Hausdorff space is open
Let $X$ be a Hausdorff space and let $D \subseteq X$ be locally compact and dense in $X$. Why is $D$ open?
I can see that $D$ is regular but don't see why $D$ is in fact open.
Solution 1:
If $D$ is not open, let $p \in D$ such that $D$ contains no neighbourhood (in $X$) of $p$.
Since $D$ is locally compact, there is a compact $K \subseteq D$ that is a neighbourhood (in $D$) of $p$. That is, there is an open set $U$ of $X$ containing $p$ such that $U \cap D \subseteq K$. Now since $D$ is dense in $X$, if the open set $U \backslash K$ was nonempty it would contain a member of $D$, which contradicts $U \cap D \subseteq K$. So in fact
$U \backslash K = \emptyset$, i.e. $U \subseteq K \subseteq D$, i.e. $D$ does contain a neighbourhood of $p$.
Solution 2:
Whenever I write $\overline{A}$ this will mean the closure of $A$ in $X$.
Take a point $d \in D$ and choose an open neighborhood $U$ of $d$ in $D$ such that $F = \overline{U} \cap D$ is compact (by local compactness of $D$). Then $F$ is also closed in $X$ since the inclusion $D \subset X$ is continuous. Because $U \subset F$ and $F \subset X$ is closed we have $\overline{U} \subset F \subset D$.
Now $U$ is open in $D$, so there is an open $V \subset X$ such that $U = D \cap V$. As $D \subset X$ is dense and $V$ is open, $\overline{D \cap V} = \overline V$. Therefore $V \subset \overline{V} = \overline{D\cap V} = \overline{ U} \subset F \subset D$. But by assumption $d \in V$ and $V$ is open in $X$ and we've just argued that $V \subset D$. Therefore $D$ is open in $X$.