Are the only sets in $\mathbb{R^1}$ which are both open and closed $\mathbb{R^1}$ and $\emptyset$? [duplicate]

As the topic, how to prove that the only set in $\mathbb{R^1}$ which are both open and close are the $\mathbb{R^1}$ and $\emptyset$. I tried to prove by contradiction, but i can't really show that the assumption implies the contrary.


Solution 1:

Take a set $A\subseteq \bf R$ which is closed and open. Suppose towards contradiction that $A$ is not the entire $\bf R$ and nonempty. Then there is some point $x_1\notin A$ and $x_0\in A$. Without loss of generality $x_0<x_1$.

Consider the interval $I=[x_0,x_1]$. $I\cap A$ is an intersection of closed sets, so it is closed, so $x'=\sup(I\cap A)$ is in $I\cap A$. Obviously, $x'<x_1$. But $A$ is open, so there is an $\varepsilon>0$ such that $(x'-\varepsilon,x'+\varepsilon )\subseteq A$, but then there's some other point of $A$ in $(x',x_1]$, so we have a contradiction.

Solution 2:

Let $S\subset \Bbb R$ non-empty, open and closed. Fix $x_0\in S$. Let $I:=\{r>0:[x_0-r,x_0+r]\subset S\}$. As $S$ is open, $I$ is non-empty. If $I$ is bounded, let $\{r_n\}$ be a sequence which increases to $\sup I$. Then $x_0+r_n\in S$ for each $n$, and as $S$ is closed, $x_0+\sup I\in S$. But $S$ is open, so we can find $\delta>0$ such that $x_0\pm \sup I\pm t \in S$ for $0\leq t\leq \delta$, hence $\sup I+\delta\in I$, a contradiction.

So $S=\Bbb R$.

Note that such an approach works for $\Bbb R^d$ instead of $\Bbb R$. Just replace the interval $[x_0-r,x_0+r]$ by the closed ball $\bar B(x^{(0)},r):=\{x\in\Bbb R^d,\max_{1\leq j\leq d}|x_j-x_j^{(0)}|\leq r\}$.