TITLE: Proof that the number of proofs is countably infinite
QUESTION [24 upvotes]: I think that the number of mathematical statements is countably infinite, since each statement is a finite string of finitely many symbols, but i am not sure how to prove it.
Once i prove that, i can say that a every math proof with $n$ steps is a subset of the cartesian product $A^n$ where $A$ is the set of all mathematical statement, and each element in the resulting set is a statement that is a step in the proof.
Since the cartesian product of countably infinite sets is countably infinite, then the set of all proofs with $n$ steps is countably infinite, for any $n$.
How can i prove that the number of mathematical statements is countably infinite, and is the rest of the proof correct?

REPLY [2 votes]: I think that the number of mathematical statements is countably infinite, since each statement is a finite string of finitely many symbols

Well, be careful here. Please note that for every number $n$ of symbols you have, you can generate a mathematical statement that contains more than $n$ variables (but is still of finite length). So, if each variable is given its own symbol ($x$, $y$, $z$ ,...) , we may need an infinite set of symbols. Indeed, this is exactly the assumption in formal logic.
Now, of course, in practice we write $x_1$, $x_2$, ..., $x_9$, $x_{10}$, $x_{11}$, i.e. we can separate variables using indices, and those indices only require finitely many digits. So ... the proofs as given (which all assume finitely many symbols) can stand.
Still, if you're worried about the set of symbols possibly having to be infinite, it is clear that it only needs to be countably infinite: To create any sentence, we sometimes need another variable, but we only introduce one of them at a time, and a different sentence can simply reuse those variables.  
Even more interestingly, the number of finite strings you can generate using a countable set of symbols is still countable as well.
To see this, you can first show that the set $S_1$ of all strings of length $1$ is countable (and of course it is! This is basically the set of symbols themselves). 
We can then show that the set $S_2$ of all strings of length $2$ are countable by concatenating two strings of length $1$. That is, we can take the Cartesian product of $S_1 \times S_1$, and regard each entry $(s_i, s_j)$ as the string $s_is_j$, and apparently you already know that 

the cartesian product of countably infinite sets is countably infinite

With that, you can then also show the set of all strings of length $3$ to be countable, ... and indeed using induction you can show that for any $n$: the set $S_n$ of all finite strings of length $n$, as generated using a countable infinite set of symbols $S$, is countable.  Finally, you need to show that the union of all those sets
$$U=\bigcup_{n=1}^\infty S_n$$
is countable, but that is easily done by putting all those entries in one big table as well ($S_{i,j}$ is the $j$-th entry of the enumeration of all strings in $S_i$), and zig-zagging through that table.
So finally, since all proofs are a subset of $U$, that set is countable as well.