Generalizing the summation process for infinite sets

Today I found myself wondering about the sum of all integers $$\mathbb Z$$.

We know that $$\mathbb Z$$ is a countable set, This means that we can list all the elements of $$\mathbb Z$$, thus we can solve the problem using sums:

$$\sum_{z\in \mathbb Z}z=\sum_{z=1}^\infty z + (-z) = 0$$

So we have that the sum of all integers is 0. By the same argument we have that the sums of all rational numbers $$\mathbb Q$$ is also 0.

My first question is: Is this argument valid and correct?

Then I wonder: Then what is the sum of all real numbers $$\mathbb R$$?

Contrarily to $$\Bbb Z$$ and $$\Bbb Q$$, the set $$\Bbb R$$ is not countable. This means that it is impossible to list the numbers of $$\Bbb R$$ and thus impossible to sum all numbers using a sum. The first thing that came to my mind was integrals. I sometimes tend to think of integrals like the continuous version of summation. So we can express the sum of all real numbers as:

$$\int_{-\infty}^\infty x \ dx = 0$$

This allows us to sum all elements of uncountable sets. For example the of all elements of $$(0,1)$$, using this method would be:

$$\int\limits_{x\in (0,1)} x \ dx = \int_0^1 x \ dx = \frac{1}{2}$$

My second question is: Is this generalization correct?

My third question occurs when, assuming that this method is correct, I tried to calculate the sum of all irrational numbers. If the method is correct, then the sum of all irrational numbers would be:

$$\int\limits_{x\in\mathbb I} x \ dx$$

But I don't know how to evaluate the integral because (I don't know the proper mathematical term for what I'm about to say so I'm sorry if it sounds not very rigorous) It has "Holes" in it. Between every 2 irrational numbers there's allays a rational number!

If we try to integrate a function over $$(0,1) \cup (2,3)$$ there's also a hole in this, but we can divide the integral in two: one over $$(0,1)$$ and the other over $$(2,3)$$. If we try to make use of this in our integral over $$\mathbb I$$ we would get:

$$\sum_{q \in \Bbb I} \int\limits_{x\in\{q\}} x \ dx$$

But we have two problems with this:

• Firstly, that integral is a integral over a point, and that's allays zero. So that is not ideal because it would mean that the sum of any uncountable set will always be zero.

• We can't use a regular summation there because again, the set $$\Bbb I$$ is not countable.

So we where trying to avoid the regular summation by generalizing it with integrals, but then it pops out again!

So my third and last question is: Even if my generalization is not correct, is it sill possible to evaluate this integral?

• Why would a sum need a countable collection in order to work? why would not $\sum_{x\in \mathbb{R}}x+(-x)=0$ work? – André Armatowski Aug 16 '20 at 12:00
• Because how would you formally evaluate $\sum _{x \in \mathbb R} x + (-x)$? That's just an informal way of writing sums, but then to evaluate you have to write the sum as $\sum_{i = a}^\infty$, and you can't do that for $\Bbb R$ because it is not countable – Eduardo Magalhães Aug 16 '20 at 12:04
• See for example this or this. – André Armatowski Aug 16 '20 at 12:22

Such bogus speculations gives various answers such as $$\Sigma$$Z
= 0 + 1 + 1 + 1 + 1 + ... = $$\infty$$
= 0 - 1 - 1 - 1 - 1 - ... = -$$\infty$$