Are there fewer positive integers than all integers? [duplicate]

In our 6th grade math class we got introduced to the concept of integers. With all the talk about positive and negative, it got me wondering. Is the amount of elements in $\mathbb{Z^+}$ less than the amount of elements in $\mathbb{Z}$?

Here is how I thought of it. If we have $\mathbb{Z^+}$ and add one element to the "back" of it ($\mathbb{Z}^{\geq-1}$) there are certainly more elements in that new set, so there must be more elements in $\mathbb{Z}$ than in $\mathbb{Z}^+$ but on the other side if we try to express the amount of elements in them "numerically" (In a loose sense of the word) they both have $\infty$ elements.

So what is the right answer? Is there even one?

(Please note I am a bit of a layman when it comes to mathematics)

Edit: About the possible duplicate, I am not looking for a bijection between the two sets, I am looking for if they even have the same number of elements and why a bijection shows that they do/don't


Great question!

Before I address it directly, let me make a general point:

When talking about infinity, it's important to make all your notions precise.

Basically, a lot of the time, if we ask vague questions the answer winds up being "it depends." And this isn't to say that these vague questions are uninteresting; on the contrary, the point is that they're so interesting, that they are really many questions secretly rolled into one.

So on to your question. Basically, this comes down to what you mean by "amount;" I'm going to answer for the usual sense of the word "amount" in set theory.


Cardinality. Say two sets $A$ and $B$ have the same size if and only if there is a bijection between them - that is, if there is a function $f: A\rightarrow B$ (takes in an element of $A$, spits out an element of $B$) which "pairs up" elements of $B$ with elements of $A$: that is, $f(a)=f(b)\implies a=b$ (the function is injective) and for each $c\in B$, there is some $a\in A$ with $f(a)=c$ (the function is surjective).

This is a lovely notion of size! It makes sense no matter what sort of sets $A$ and $B$ are, we can still ask whether there is a bijection between them or not. Also, for finite sets it agrees with our usual notion of "same size".

At the same time, it is somewhat subtle: for example, there is a bijection between the set of all integers and the set of even integers, even though we might think there are "more" of the former. The bijection is just $$f(x)=2x.$$ Similarly, there is a bijection between $\mathbb{N}$ and $\mathbb{Z}$, so in this sense they have the same size.

One natural response at this point is to ask, "Wait a minute! If bijections can't even distinguish between the evens and the integers, can they tell the difference between any pair of infinite sets?" That is, are there different kinds of infinity, in the bijections sense? The answer, perhaps surprisingly, is yes! This is Cantor's diagonal theorem, and was the beginning of modern set theory: Cantor's diagonal argument.


One natural question at this point is, "Are bijections the right tool for measuring the sizes of infinite sets?" Based on the following facts, it's quite reasonable to be skeptical:

  • There are bijections between each of the following sets: $\mathbb{N},\mathbb{Z},\mathbb{Q}$.

  • There is a bijection between $(0, 1)$ and $\mathbb{R}$.

  • There is a bijection between the set of integers and the set of finite strings of integers.

  • There is a bijection between the set of real numbers and the set of infinite sequences of real numbers. (Fine, by "infinite sequence" I mean "$\omega$-sequence.")

It's impossible to argue mathematically that bijections are the "best" way to get a notion of sizes of infinity, since "size of infinity" is an informal concept. But we can give some good arguments for why it's at least the best notion we have so far:

  • It really is how we count finite sets. If I give you two giant piles of marbles, and ask you to tell me if there are the same number of marbles in each pile, you would probably figure this out by removing one marble from each pile at the same time, and keep doing this until one or both piles ran out of marbles. If they run out at the same time, they had the same size, otherwise they didn’t. In case they run out at the same time, what you’ve done is build a bijection between the two piles!

  • The "sizes of infinity" are things we can study. If we assume the axiom of choice, we can show that given any two sets, either they have the same size or one is "bigger" than the other (i.e., there is an injection from one to the other). This really is something that bijections give us: without the language of bijections, which would you say is larger, the set of even integers or the set of odd integers?

  • We’re already interested in bijections. There are lots of theorems in mathematics that basically are talking about sizes in terms of bijections already. For example, if $A$ is a set of real numbers, is there some function $f$ whose local extrema are exactly the points in $A$? The answer turns out to be, “Yes, if and only if $A$ is either finite or in bijection with $\mathbb{N}$.” There are plenty of other examples of this sort of thing. So, size in terms of bijection is already mathematically interesting.


By the way, Alex S has given an explicit example of a bijection between $\mathbb{Z}^+$ and $\mathbb{Z}$. I can't resist giving one of my own favorite bijections, between $\mathbb{N}$ and the set $\mathbb{N}^2$ of ordered pairs of natural numbers: the Cantor pairing function! Note: for me, $0$ is a natural number - there are no kangaroos in my refrigerator!

EXERCISE: using the Cantor pairing function, come up with a bijection between $\mathbb{N}$ and $\mathbb{Q}$. It won't look nearly so nice, but you can do it!

FINAL NOTE: what if we restrict attention to "nice" bijections, whatever that means? This turns out to be super interesting, and leads (at least in one direction) to descriptive set theory, but that's a topic for another question.


Good Question! When we talk about the size of sets, we say that the sets $A$ and $B$ are the same if there exists a function $f$ which takes elements in $A$ and outputs elements in $B$ that has two properties:

  • if $a$ is an element of $A$, and $f(a)=b$, where $b$ is an element of $b$, then no other element of $A$ maps to $b$. In other words, there is no $a'$ in $A$ such that $f(a')=b$ unless $a=a'$
  • For all $b$ in $B$, there exists an $a$ in $A$ such that $f(a)=b.$

A function with both of these properties is called a bijective function. Can you see why two finite sets are the same size if and only if there is a bijective function between them? Mathematicians extend this idea to infinite sets.

Now let's see if there is a bijective function from $\mathbb Z^+$ to $\mathbb Z$. Consider $$f(x)=\cases{x/2 & \text{ if $x$ is even}\\-(x-1)/2 & \text{ if $x$ is odd}}.$$

Thus, $$f(1)=0$$ $$f(2)=1$$ $$f(3)=-1$$ $$f(4)=2$$ $$f(5)=-2$$ $$\vdots$$ The list goes on. Can you see why $f$ is bijective? Every integer gets mapped to exactly one time. Thus, $\mathbb Z^+$ and $\mathbb Z$ are the same size.


Your intuition fails you here because you are starting to consider what happens with infinite sets. Everything you've learned about numbers really applies to finite sets.

The set of all positive integers is actually the same size as the set of all integers. This is because I can find a way to "pair" all the elements of one set with a unique element of the other set.

Eventually, you will be able to say:

The cardinality of the infinite set of positive integers is the same as the cardinality of the infinite set of integers because there exists a bijection between the two sets.