TITLE: How many variables in formal logic?
QUESTION [6 upvotes]: Remark: I assume the equality symbol „$=$“ with its standard semantics to always be included in first-order logic.
Suppose we want to formalize some first-order theory. For our first-order language, we need to fix some set of variables and some set of contstants, e.g. one constant in group theory and Peano arithmetic, no constant at all in ZFC. The choice of a set of constants is most often done quite canonical. 
Also, the cardinality of the set of constants can have a direct influence on semantics. For if the set of constants has cardinality $\kappa$ and we add for any two distinct constants $c,d$ the axiom $c\neq d$, each model must have at least cardinality $\kappa$.
What consequences does the choice of the set of variables have?
I can think of these two cases:

One usually takes an at least infinite set of variables to be able to nest arbitrary many quantifiers. Example: Let $P$ be a 1-ary predicate and $F$ be a 2-ary function, then the formula
$$ \forall x_1 \forall x_2 \forall x_3 \dots \forall x_n : P(F(x_1,F(x_2,F(x_3, \dots ,F(x_{n-1},x_n)))))$$
does only make sense, if one has at least $n$ distinct variables.
If one has at least $n$ distinct variables, one can add axioms like
$$ \exists^{\ge n} x : P(x) \qquad \text{or} \qquad \exists^{\le n} x : P(x)$$
which imply each model to contain at least $n$ or at most $n$ elements.
If one wants to enumerate the set of all strings and do some gödelian reasoning, one must only take a countable set of variables.

Do you know any more cases, where the cardinality of the set of variables does matter? Does it, as long as it is infinite, affect the class of models for our formal theory?

REPLY [4 votes]: In standard first-order logic, there is always an infinite set of variables available.  As you point out, if there were only finitely many variables, that would severely diminish the expressiveness of the language.  I've never seen such a thing studied, and it seems like more of a syntactic curiosity than something that is really of interest as a logic.
Assuming you have infinitely many variables, it doesn't matter how many you have (so, the standard setup is just to say you have countably infinitely many).  Any formula only uses finitely many variables, and the semantic value of a sentence (i.e., which models satisfy it) is unchanged if you replace all of its variables with different variables.  Similarly, if you want to talk about proofs, any proof will involve only finitely many formulas with finitely many variables, which you can replace freely with other variables without changing the validity of the proof.  So, if you have some fixed countably infinite set of variables, you can always just replace all the variables in a given formula by variables from that set.
Note that despite their syntactic similarity, constants and variables are in some sense very different sorts of things and you should not think of them as being on an equal footing.  Variables are just part of the basic underlying syntactic machinery of the logic, analogous to connectives and quantifiers.  No matter what theory you are studying, you still use the same set of variables (not that you have to, but there's just no reason to change it).  Constant symbols, on the other hand, are non-logical symbols which are chosen as part of the specific theory you want to talk about and which receive interpretations in models, along with relation and function symbols (in fact, I would consider them to be a special case of function symbols, namely the $0$-ary function symbols).