# Is there a way of defining the notion of a variable mathematically?

I know that the notion of "set" is one that cannot be defined mathematically since it is the fundamental data type that is used to define everything else (and the definition which says that "sets" are the objects in any model of set theory is to me circular since models are defined in terms of sets).

It seems to me that there is another fundamental concept just like "set", namely the notion of a "variable". Is this true?

-
The word "variable" means many different things, and many of these meanings are non-rigorous. What do you mean by "variable"? – gspr Apr 18 '12 at 19:13
We called a certain theory "Set theory" and the objects in models of this theory "sets". It would make no sense to say that "sets are the objects in a universe of a model of Kreplach theory". :-) – Asaf Karagila Apr 18 '12 at 19:46
There was a notion of variable quantity, abbreviated as variable, in the $18$th century, and well into the $19$th. In principle the notion has vanished, has been replaced by function, which is a set of ordered pairs such that $\dots$. But the word variable is still around, just like the symbol $\infty$ is still around, and we all still have an appendix. – André Nicolas Apr 18 '12 at 20:43
Thinking about it, I'm not sure [set-theory] actually fits this question. It is about "variable" and not about "set". – Asaf Karagila Apr 18 '12 at 21:37
@Andre: I don't think the notion of "function" has replaced the notion of a "variable quantity" any more than the notion of "set" has replaced the notion of a "mathematical object". – Hurkyl Apr 18 '12 at 23:27

In pure mathematics there is no such thing as variable, there are only constants. Consider equality $a = 5$. This supposed "variable" isn't variable at all!

On the other hand, there are those curious letters in the formulas, what do they mean you ask? Well, those are informal expressions that describe the objects we reason about, however, they do not have any precise meaning, they are not formal. It doesn't contradict that the description of the object might be perfectly fine, after all you use natural language to describe the notion of set, don't you?

Still, there is a way of formalizing this and the domain which happens to deal with such problems is called semantics, where there actually is something that is called a variable, but all the formal derivations are usually long, tedious and cumbersome. Moreover semantics is more about computer science, where the precise meaning of an expression is important for the computer that is to evaluate it (it doesn't know anything about our informal notion of variable, so we need to explain everything in the tiniest details).

In mathematics we deal with those informal expressions and "pattern-match" them with suitable cases. If you do it properly, everyone knows what do you mean (i.e. what function you want to define, etc.) so there is no need to overformalize it.

I know what I wrote looks more like a peculiar fairytale than a concrete answer, but that's the way I understand it. Hope that helps, even if only a bit ;-)

-
I'd think you'd want to talk about syntax before (or instead of) semantics. – Hurkyl Apr 18 '12 at 23:10
@Hurkyl Yeah, you are right, but I just wanted to sketch the situation, besides, where is the semantics, the syntax also follows ;-) Still, I think that talking about syntax without semantics in this case is close to useless, and this the reason I skipped it. – dtldarek Apr 18 '12 at 23:16
I think I understand what you are getting at. If we take an informal expression with variables and make it formal ala metamath, we would get some string of symbols involving those variables, which is just a string in some formal language. Thus, in the language of metamath, a variable is any greek and roman letter that appears in a string of that language. – echoone Apr 19 '12 at 3:43
@echoone Exactly ;-) – dtldarek Apr 19 '12 at 10:19

dtldarek has given an answer from one point of view. Let me offer another.

A variable in mathematics often means an element in something (a ring, a group, a vector space, ...) which can be specialized to some more specific value.

In modern algebra, this notion becomes formalized in various ways, one of which is by the notion of the free object on (wikipedia say "over", but my own experience is that it is more common to speak of the free object "on") a particular set of variables.

If you haven't seen it before, this notion will probably seem quite abstract (like a lot of formalism the first time you see it!). But it actually provides a rather precise formal match with the intuitive notion of a variable.

Added in response to the OP's comment: E.g. the polynomial ring $\mathbb C[x_1,\ldots,x_n]$ is the free commutative $\mathbb C$-algebra in the variables $x_1,\ldots,x_n$. If $A$ is any other commutative $\mathbb C$-algebra (e.g. $\mathbb C$ itself), then giving a homomorphism $\mathbb C[x_1,\ldots,x_n] \to A$ is the same as choosing $n$ elements $a_1,\ldots,a_n \in A$ ("the values of the variables") and declaring $x_1\mapsto a_1,\ldots, x_n \mapsto a_n$.

This illustrates the general principal that the free object (in some particular context) on the variables $x_1,\ldots,x_n$ is an object in which no relations are imposed between the elements $x_1,\ldots,x_n$, and so it can be mapped to any other object (of the appropriate sort) just by choosing values of the variables $x_1,\ldots,x_n$ in that object.

Variations of this point of view are how idea about variables and equations between them are implemented in contemporary algebraic geometry, for example.

-
I do not see the connection. Can you give me a concrete example? – echoone Apr 19 '12 at 3:48
@echoone: Dear echoone, I have added an example to my answer. Regards, – Matt E Apr 19 '12 at 4:19
Thanks for the example. However, I am not convinced this clarifies what a variable is. Calling the symbol $x$ a variable when defining a polynomial ring $F[x]$ does not define what a variable is. – echoone Apr 20 '12 at 2:47
@echoone: Dear echoone, If you say so. Your question asked whether the notion of variable could be defined. My answer describes a central piece of formalized mathematics which captures the intuition of the classical notion of variable as it is traditionally used in algebra. If you're asking about something else, that's fine; I've probably misinterpreted the question. Regards, – Matt E Apr 20 '12 at 3:21

Most uses of "variable" should really be replaced by "undetermined", either in the sense "this is a fixed value, but I don't care to give it's value right now" or (in equations) "this is a fixed value, which we don't know except that it satisfies...". The first sense is what Matt E's answer describes formally.

-