# why $\mathbb{Q}$ and $\mathbb{Z}$ are zero-dimensional spaces?

why $$\mathbb{Q}$$ and $$\mathbb{Z}$$ are zero-dimensional spaces ?

My attempt : Definition of zero-dimensional spaces:

A topological space $$(X, \tau)$$ is said to be zero-dimensional if there is a basis for the topology consisting of clopen sets

we know that in discrete space all basis for the topology consisting of clopen sets.so here i can said that obviously $$\mathbb{Z}$$ will be zero-dimensional spaces since $$\mathbb{Z}$$ induce discrete topology

But im confused about $$\mathbb{Q}$$ because it is neither closed nor open

• $\Bbb Q$ and $\Bbb Z$ have a topology induced from the usual topology on $\Bbb R$. And $\Bbb Q$ is both closed and open in $\Bbb Q$. Try showing that the set of open intervals with irrational endpoints intersected with $\Bbb Q$ is a basis of clopen sets. – Elliot G Aug 14 '20 at 5:09
• For any topological space $X$, the whole space is both closed and open, so that's not an issue. You need to find a basis for $\mathbb Q$ so that each basis element is both closed and open. Do you know any bases for $\mathbb Q$? Can they be adjusted? – Cheerful Parsnip Aug 14 '20 at 5:09
• okks u mean $(\sqrt a,\sqrt b) \cap \mathbb{Q}$ @CheerfulParsnip – jasmine Aug 14 '20 at 5:13
• There are more irrationals than just square roots... – Henno Brandsma Aug 14 '20 at 7:36

The set $$\mathcal{B}=\{(a,b)\mid a, b \in \Bbb P\}$$ forms a base for the usual topology on $$\Bbb R$$ (where $$\Bbb P = \Bbb R \setminus \Bbb Q$$ is the set of irrationals).
For each $$(a,b) \in \mathcal{B}$$ it’s clear that $$(a,b) \cap \Bbb Q = [a,b]\cap \Bbb Q$$ and so the set $$\{B \cap \Bbb Q\mid B \in \mathcal{B}\}$$ is a base for the subspace topology of $$\Bbb Q$$ that consists of closed-and-open (clopen) sets.