Please can you check my proof of only clopen sets in $\mathbb R$ is $\mathbb R$ and $\varnothing$ [duplicate]

I tried prove the following:

In $\mathbb R$ the only clopen sets are $\mathbb R$ and $\varnothing$.

please can you check my proof?

Let $S$ be non-empty and proper subset of $\mathbb R$ such that $S$ is both open and closed. Let $x \in S$ and $y \in S^c$. Without loss of generality assume $x < y$. Then $[x,y]$ is closed and non-empty. Also, $S$ is closed hence $S \cap [x,y]$ is closed. By definition of closure, $\sup A \in \overline{A}$ for all sets $A$ and since for closed sets $S$ the closure $\overline{S} = S$ it follows that $s = \sup (S \cap [x,y]) \in (S \cap [x,y])$.

Similarly, $i = \inf (S^c \cap [x,y]) \in (S^c \cap [x,y])$.

Then, $i \le s$ because if $i > s$ then there is $s < x < i$ such that $x \notin S \cup S^c$ which is a contradiction. If $i < s$ then there is $i < x < s$ such that $x \notin S \cup S^c$ which would also be a contradiction. Therefore $i = s$. But then $i \in S \cap S^c$ which would again be a contradiction hence $S$ must be either empty or all of $\mathbb R$.

marked as duplicate by BCLC, Adrian Keister, José Carlos Santos real-analysis StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Sep 15 '18 at 17:56

Your basic idea is correct, completeness is important here. However, you seem to prove the stronger statement that there is no $S\subset\mathbb [x,y]$ such that $x\in S$, $y\notin S$, $\sup S\in S$ and $\inf ([x,y]\setminus S)\in ([x,y]\setminus S)$. That statement is wrong.

For an example consider $[x,y]=[0,4]$, $S=[0,1)\cup[2,3]$. What happens in your proof if you follow it using this example?

• Thank you I will try to prove again. – blue Jan 2 '14 at 14:13
• Please can you show me an example of a set $S\subset\mathbb [x,y]$ such that $x\in S$, $y\notin S$, $\sup S\in S$ and $\inf ([x,y]\setminus S)\in ([x,y]\setminus S)$ where $S$ and $[x,y]\setminus S$ are closed? – blue Jan 2 '14 at 14:38
• Of course I cannot, since these do not exist. My point was that you only used that they are closed to guarantee that one contains its supremum, the other its infimum. That is not sufficient, I will add an example to my answer. – Carsten S Jan 2 '14 at 14:51
• Okay. The sentence ''If $i<s$ then there is $i < x < s$ ...'' is wrong, right? Because the $x$ between $i$ and $s$ are all either in $S$ or $S^c$. – blue Jan 2 '14 at 17:04
• Exactly. The $i$ does not really help. It should suffice to look at $s$. What can you say about the set $(s,y]$? – Carsten S Jan 2 '14 at 18:02

Suppose $A\subset\boldsymbol{R}$, $A\notin\{\boldsymbol{R},\emptyset\}$, is closed and open. Then $A$ and $\boldsymbol{R}\setminus A$ are both non-empty and open, hence $\boldsymbol{R}$ would not be connected.

• So you have given a name to the property that is to be shown... ;) – Carsten S Jan 2 '14 at 13:01
• Thank you but I don't know about connected sets yet. – blue Jan 2 '14 at 14:12

Perhaps this way: So you've got your interval $I_1 = [x,y]$, where $x\in S$ and $y\in S^c$, and, say, $x<y$ (I hope that under $S^c$ you meant $\mathbb{R}\backslash S$...). Take $z = \frac{x+y}{2}$. Then either $z\in S$ or $z\in S^c$. If $z\in S$, then take $I_2 = [x_1,y_1]$, where $x_1 = z, y_1 = y$, if $z\in S^c$, then take $I_2 = [x_1,y_1]$, where $x_1 = x, y_1 = z$. The idea is to obtain intervals $I_n$ with ends in different sets... Each interval is twice shorter than the previous one. So you'll get the family of closed intervals $\{I_n = [x_n,y_n]\}_{n\in\mathbb{N}}$ with $y_n-x_n\to 0$. Hence there is the unique $x\in \cap_{n\in\mathbb{N}} I_n$. Where does it belong? Obviously it can't belong neither to $S$ nor to $S^c$: indeed, consider for example the case of $x\in S$. Then, since $S$ is open, $x$ is contained there with some open interval. But this cannot be the case since such interval would contain all $I_n$ starting from some $n_0$, and hence infinitely many points from $S^c$ (by construction!) - a contradiction. Since $S^c$ is also open by assumption, a contradiction is obtained in case $x\in S^c$ the same way... So, a contradiction!

I don't have permission to give a comment so I will have to post it as an answer, please check the following link Showing that $\mathbb{R}$ is connected. The question which you asked was answered here before. It is good to search this forum before writing the question, but you didn't know the notion `connected set' so you couldn't anyway. Good luck.