Artificial intelligent assistant

Why, precisely, is $\{r \in \mathbb{Q}: - \sqrt{2} < r < \sqrt{2}\}$ clopen in $\mathbb{Q}$? Just going over some old notes and I realized I always took this for granted without actually fleshing out exactly why it is true. The set of all r is closed in $\mathbb{Q}$, because the set of all r is just all of the rationals in that interval, and obviously contains all of its limits. If you take its complement, the irrational numbers between $- \sqrt{2}$ and $\sqrt{2}$, what precisely can we say about this to conclude that the original set is clopen? i.e. why precisely is the complement open? Thanks.

$\Bbb Q$ inherits ist topology from $\Bbb R$. So if a set $U$ is open in $\Bbb R$, then $\Bbb Q \cap U$ is open in $\Bbb Q$, and the same thing goes for closed sets.

Now, the funny thing is that your set is both the intersection of a closed interval in $\Bbb R$ with $\Bbb Q$ (namely $[-\sqrt 2, \sqrt 2] \cap \Bbb Q$), and it's the intersection of an open interval with $\Bbb Q$ (namely $(-\sqrt 2, \sqrt 2)\cap \Bbb Q$). Thus, from the topology it ingerits from $\Bbb R$, your set is both an open set and a closed set. That is why it's a clopen set.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 2ef9686bcd04396fa2f5deceb1a9349b