# What is the difference between cardinality of $\mathbb Z$ and of $\mathbb Q$

My intuition says there must be difference because $\mathbb Z\subset\mathbb Q$ so there are elements in $\mathbb Q$ but not in $\mathbb Z$.

My question is about whether the following explanation true or not.

There is bijective mapping between $\mathbb Z$ and $\mathbb Q$ (because both are countable) so they are isomorph one another because of it their elements (elements of $\mathbb Z$ and of $\mathbb Q$ ) are just symbol so they are actually the same set with different symbol.

• They have the same cardinality. That does not mean that they are the same---they have different structures. – Xander Henderson Feb 25 '18 at 15:15
• They are not the same set, but there is the "same amount" of elements in them. – lush Feb 25 '18 at 15:15
• As James Grime would put it, they are both "listable" because they can both be written out in a list in some order. Therefore, they have the same cardinality. – stuart stevenson Feb 25 '18 at 15:20
• @XanderHenderson: They are the "same" set, in the same sense that all cyclic groups of order 3 are the "same" group. – user14972 Feb 25 '18 at 15:26
• @Hurkyl Indeed, I fleshed this out more completely in an answer below. – Xander Henderson Feb 25 '18 at 15:28

In the category of sets where the morphisms are arbitrary functions, isomorphisms are bijective functions. Since there exist bijections between the integers $\mathbb{Z}$ and $\mathbb{Q}$, they are isomorphic in the category of sets. Thus if the only structure you care about is the structure of a set, then you can treat $\mathbb{Z}$ and $\mathbb{Q}$ as the same object. In this setting, one can reasonably say that they are "equal".

However, we don't generally work in the category of sets. Typically, we want more structure than that. For example, in the category of abelian groups, the morphisms are group homomorphisms, and isomorphisms are group isomorphisms. A group isomorphism must be bijective, and preserve the group operation, i.e. it is a map $\varphi$ such that $\varphi(x+y) = \varphi(x) + \varphi(y)$ for all $x$ and $y$ in the domain.

In this setting, $\mathbb{Z}$ and $\mathbb{Q}$ are quite different, as there is no bijective map $\varphi : \mathbb{Z} \to \mathbb{Q}$ such that $\varphi(m + n) = \varphi(m) + \varphi(n)$ for all integers $m$ and $n$. To see this, suppose that $\varphi$ is a homomorphism and note that as soon as you know what $\varphi(1)$ is, you have completely determined what $\varphi$ does. If $\varphi(1) = r$, then $\varphi(\mathbb{Z})$ is the set of all integer multiples of $r$ in $\mathbb{Q}$. But $\frac{r}{2}$ is a rational number, and is not in the image of $\mathbb{Z}$, hence it is impossible for $\varphi$ to be surjective onto $\mathbb{Q}$.

Everything you said up until "so they are actually the same set with different symbol" was correct.

They are isomorphic in the category of sets (meaning there is a bijection between them), but that does not mean that they are the same set with different symbols. There are other structures on these sets besides the underlying set of elements which distinguish them.

For example, if you want a bijection $f: \mathbb Q \to \mathbb Z$ which also satisfies the property that it preserves addition, i.e., $f(x+y)=f(x)+f(y)$, then you will not be able to find one.

• A more sophisticated point of view would be that it's not that $\mathbb{Q}$ and $\mathbb{Z}$ that are different, but instead the structures $(\mathbb{Q}, +)$ and $(\mathbb{Z}, +)$. E.g. there is an exotic addition (which I will write as $\oplus$) on $\mathbb{Q}$ so that $(\mathbb{Q}, \oplus)$ and $(\mathbb{Z}, +)$ are isomorphic! – user14972 Feb 25 '18 at 15:29
• @Hurkyl I get your point, but I don't think mathematicians would typically ignore the context of these naming conventions, and I'm not sure why you would consider that point of view to be "more sophisticated". – Dustan Levenstein Feb 25 '18 at 15:37
• @Hurkyl to put it another way, if a mathematician is using only the structure $\mathbb Z$ "as a set", then they would typically add that adjective in front to emphasize that they're not concerned with the additional baggage the notation comes equipped with. – Dustan Levenstein Feb 25 '18 at 15:44

Theorem: If $Y$ is a finite set, then any injection $X \to Y$ is an isomorphism (of sets) if and only if it is surjective.

• $f : \mathbb{Z} \to \mathbb{Q}$ is not surjective

However, most of your experience is probably about finite sets, and so your experience has mislead you to intuit "$X$ and $Y$ have the same cardinality" and "all injections $X \to Y$ are bijections" the same way.

Another possibility of where your intuition has gone astray is

Theorem: If $Y$ is a finite set, then if any one morphism $X \to Y$ is an isomorphism, then all injections $X \to Y$ are isomorphisms.

and your experience with finite sets has led you to intuit "same cardinality" with "all injections are bijections" the same.

• I assume you're referencing the fact that an injection of sets of the same finite cardinality is automatically a bijection, but that's not what you stated. – Dustan Levenstein Feb 25 '18 at 15:39
• I don't understand the second theorem. – lush Feb 25 '18 at 15:55
• @lush The first theorem is true of all sets, and the second theorem is just false. Likely for the second one he meant to say "all injections" rather than "all morphisms". – Dustan Levenstein Feb 25 '18 at 15:58
• @DustanLevenstein all right, that makes sense. – lush Feb 25 '18 at 16:08