7

I am seeking a comprehensible yet formal definition of a varaible.

I have already looked at the post What is the formal definition of a variable?, yet it is largely incomprehensible for someone who have never studied first-order logic.

My thoughts:

When writing proofs, we usally say

Let $x\in\mathbb{R}$ be given.

What exactly are we saying here? We are saying let an arbitrary element in $\mathbb{R}$ be given the name $x$. But when people talk about varaible, it seemes like variables are subject to change.

Consider the production fucntion in economics $Q(K,L)=K^{.5}L^{0.5}$

It is intutive to call $K$ and $L$ variables. Sometimes, people even describe the function as

$Q=K^{.5}L^{0.5}$

and call $Q$ a variable instead of function.

It also seemes popular in many textbooks to write the following:

$Q=Q(x)$

Also consider OLS linear regression, practioners usally write

$\mathbb{E}[y]=\alpha +\beta x$

and treat $x,y$ as variables, while mathematicians often write

$\mathbb{E}[Y\mid X=x]=\alpha + \beta x$

where $Y,X$ are random variables, which are functions, and $x$ is a variable. Motivated by the examples above, it seems adequate to define a varaible as a random variable, or a function. Then a variable can take a varieties of values and its definition can be statisfactory resolved on the basis of material set theory; since a variable will be a function and a function is a set, a variable will be a set.

Help to make my question concise and a satisfactory answer are greatly apprecaited. I am not looking for a philosophical answer.

Jam
  • 10,325
Kun
  • 2,496
  • 9
    Since a variable is not a mathematical object (or "thing") itself, attempts to give a definition of what it is are doomed to either failure or mind-numbing abstraction (which is also a kind of failure). The idea of a variable is much better described by explaining what one can do with it -- but that won't look much like the kind of definitions we use for mathematical objects. – hmakholm left over Monica Mar 18 '16 at 19:03
  • 2
    To relax a bit: https://www.ted.com/talks/terry_moore_why_is_x_the_unknown – mvw Mar 18 '16 at 19:13
  • Then try: https://en.wikipedia.org/wiki/Free_variables_and_bound_variables – mvw Mar 18 '16 at 19:14
  • @mvm so a variable is really just a placeholder? Also, I like the video:-) – Kun Mar 18 '16 at 19:22
  • To go along the video: $(\text{something})^2 - 4 = 0$, hm what might it be? It is a placeholder for some number. It is at the same time an address (insert number here) and an abstraction (something stripped of unnecessary detail). We do not know yet, that it might be $2$ or $-2$, but we can work with it like a number to go towards a situation, where we reduce the possibilities from all complex numbers just to those two feasible solutions. – mvw Mar 18 '16 at 19:53
  • 1
  • 1
    A variable is a symbol of the language; it works as a pronoun in natural language: "$x \in \mathbb R$" has the same behaviour of "it is a real number". What "it" denotes ? it depend on the context. – Mauro ALLEGRANZA Mar 19 '16 at 08:54
  • @MauroALLEGRANZA : Hi Mauro, I know this is an old post so I hope you don’t mind me commenting as I would love your feedback. When mathematicians say things like, for example, “let the variable $t$ Be time” do they mean that we’re assuming the variable $t$ represents time? Just making sure my usage of the word “represents” is correct here, thank you in advance. – Taylor Rendon Aug 11 '22 at 22:24
  • 1
    @TaylorRendon - basically: YES. We have a "magnitude": time (it is an object of the external world) and we have a name for it: the expression "time" of natural language. In a mathematical context where we use a jargon made of language + symbols, we introduce a symbol: $t$, to name that magnitude. – Mauro ALLEGRANZA Aug 12 '22 at 09:12
  • To add to Carl’s answer below: the terminology for these placeholders is informal, and usage is guided by context and framing or intended signalling; here is my explanation: https://math.stackexchange.com/a/4254850/21813 – ryang Mar 03 '23 at 09:53

4 Answers4

4

Here is an analogy with programming, in case you have some experience with that. A variable in a programming language is not an "object", it's a "name" for an object, which is only seen by the compiler. Using variable names makes it possible for a programmer to refer to multiple data objects in a coherent way so it is clear which data object each part of the code refers to. Once a program is fully compiled into machine code, there are no longer variable names so to speak. Unless "debugging info" is included by the compiler, it is not possible to tell what name was originally used for a data object solely by inspecting the compiled machine code.

Similarly, syntactic variables in mathematics -- expressions such as "x", "t", "Q", etc. -- are not mathematical objects, they are names that mathematicians use in their writing to refer to mathematical objects. Just as a compiled program no longer has variable names, the mathematical objects themselves don't have variable names.

The definition of a variable is, foremost, a definition as part of the language of mathematics. Most mathematics is carried out in natural language, which has no formal grammar. In logic, we sometimes study formalized languages, which do have formal grammars. In these languages, a certain collection of expressions are chosen at the outset to be the "variables". The semantics of the formal languages allow these variables to refer to various mathematics objects.

Carl Mummert
  • 81,604
1

There are three different notions that you have mentioned in you question.

Variables in logic

A variable in logic is just a symbol that can be used in existential or universal quantification. In English we can say "Not everything is perishable." but in logic we'd have to say something like:

$\neg \forall x \in Things\ ( Perishable(x) )$.

Here "$x$" is merely a symbol that appears in two places, the quantification as well as the quantified statement, in order to precisely describe the range of all entities that are claimed to be perishable.

Depending on the kind of logic system you are working in or talking about, you might have free variables and bound variables, the former being not quantified and the latter being quantified. Personally in practical use it is better not having free variables at all. Why do I say so? Consider "$x^2 \ge 0$". It is usually understood correctly because of the context, but it is not actually precise. Better is "$\forall x \in \mathbb{R}\ ( x^2 \ge 0 )$", assuming that "$\ge$" and "$^2$" had been previously defined for real numbers.

Variables in calculus

Variables here are totally different from the variables in logic. This usage was the original usage of variables, which were indeed named aptly since each variable referred to a varying quantity, usually with respect to time. If say we had an object moving in a circle around the origin, then if we express its position using Cartesian coordinates, over time its coordinates $x,y$ would be variables. We could then define the following:

At any time $t$, let $Δx$ to be the change in $x$ from that time.

Note that at time $t$, when $t$ changes to $t+Δt$, $x$ would change to $x+Δx$. For nonzero $Δt$ the ratio $\frac{Δx}{Δt}$ would be interesting to consider, since it captures how much $x$ changes with respect to $t$. Generalizing, if $Δx$ tends to (but not equal to) $0$ as $Δt$ tends to $0$, we can consider the ratio $\frac{Δy}{Δx}$, and then we could define rate of change as follows:

If $\frac{Δy}{Δx}$ eventually stabilizes at a value $r$ as $Δt$ tends to $0$, then let $\frac{dy}{dx} = r$, otherwise we say that $\frac{dy}{dx}$ is undefined.

This kind of reasoning was what originally led to calculus, and in this form it is very useful to treat variables this way as varying quantities. Notice that this viewpoint explains trivially why we can do the following:

Take any variables $x,y$ varying with time, and let $z = x^2 y$. Then $z$ also is a variable, and if $\frac{dx}{dt},\frac{dy}{dt}$ exist then $\frac{dz}{dt} = 2xy \frac{dx}{dt} + x^2 \frac{dy}{dt}$.

Variables in probability theory

The third kind of variable is the random variable in probability theory, which is different from the earlier two kinds of variables. A random variable is best thought of as a generator of values from its probability distribution rather than a single value.

We also define basic arithmetic on random variables and between random variables and ordinary values, so that we can do things like:

Take any real random variables $X,Y$, and let $Z = \frac{1}{2}(X+Y)$. Then $Z$ is also a random variable, and $\mathbb{E}(Z) = \frac{1}{2}(\mathbb{E}(X)+\mathbb{E}(Y))$.

Comments

You can see that random variables and variables in calculus are handled in similar ways, because it follows intuition. Of course if one wants absolute rigour some care has to be taken in setting up the necessary foundations, but it is possible, which is why most mathematicians manipulate these variables in this manner instead of doing everything in set theory over first-order logic. There is no need for concern that these manipulations are non-rigorous, as long as one strictly follows the rules governing these notations.

It is akin to our use of the standard axiomatization of the real numbers rather than the use of an actual structure satisfying those axioms. If you know a bit of programming, the axiomatization is just an interface (contract) while the actual structures are implementations (concrete instances).

Interfaces are always more robust and hence preferable to implementations. This is not just a philosophical viewpoint but a practical one. Should we want to translate our existing mathematical knowledge to a different underlying formal system such as type theory instead of set theory, it certainly would be easier by far for those structures where we use axiomatizations or simpler notation.

user21820
  • 57,693
  • 9
  • 98
  • 256
  • Variables appear as far back as Aristotle and I have seen an author or two credit him with inventing them (Lukasiewicz's book Aristotle's Syllogistic also has some passages of Aristotle using variables and even the commentator Alexander of Aphrodisias both in Greek where they use variables) http://www.individual.utoronto.ca/pking/miscellaneous/history-of-logic.pdf. I do no believe there exists any universal or any existential quantification in Aristotelian term logic also. – Doug Spoonwood Sep 28 '16 at 02:50
  • @Kun: http://meta.math.stackexchange.com/questions/2831/troll-or-skeptic/2867. – user21820 Oct 31 '16 at 11:32
  • Aristotle's Syllogistic p.7, Oxford University Press 1951 "The introduction of variables into logic is one of Aristotle's greatest inventions." p.8 "I am glad to learn that Sir David Ross in his edition of the Analytics, p. 29, emphasizes that by using variables Aristotle became the founder of formal logic." – Doug Spoonwood Oct 31 '16 at 18:12
0

There is a lot of ambiguous notation in practice of math, especially in calculus and analysis.

The notion of a variable is tightly connected to the notion of a type. One of the (informal) definitions of a type is that a type is the range of significance of a variable.

When asserting that $x\in\mathbb{R}$, it means that $x$ has a type which is equipped with the structure of real numbers. Actually we should say something like "$x$ is of a type $A$, and $A$ has the structure of $\mathbb{R}$".
Then, for example, there may be some other variable $y$ of a type $B$ which also has the structure of $\mathbb{R}$, but $x$ and $y$ are not allowed to inter-operate in general, if only we don't know that $A=B$.
So here the algebraic structure and the carrier are (ambiguously!) denoted by the same symbol $\mathbb{R}$.

Another ambiguous notation is to call a function and it's value on an implicit arguments by the same name.
So for example when one speaks that $Q = \text{an expression on } x$, they mean that $Q$ is the value of an implicit function on a fixed argument $x$, and they often denote that implicit function by the same name as the value, so to write "$Q=Q(x)$".

P.S. Your idea of defining a variable via set theory is outdated at best, in modern mathematics sets are quite not basic notion, but type, variable and function are. Not to speak about that "random variable" has quite different meaning in the rest of mathematics than in statistics.

Andrew
  • 449
  • Can you suggest some reference regarding the elements of foundation of modern mathematics, such as the type, variable, and function you mentioned? – Kun Mar 18 '16 at 19:38
  • @Kun First chapter of this book: http://homotopytypetheory.org/ (Introduction to Type Theory). And http://openlogicproject.org/ may also be of use (Textbook on Logic). – Andrew Mar 18 '16 at 19:43
  • I will defintiely take a look, thanks! Also, would you say logic is the foundation of type theory or type theory is the foundation of logic? – Kun Mar 18 '16 at 19:51
  • Aha! The first paragraph of the text explains itseft: type theory is not built from first-order logic. – Kun Mar 18 '16 at 19:56
  • @Kun Mathematical Logic is a broader topic, it is suitable for studying not only Type Theory but also other, less powerful, logics (proposition, predicate calculus etc.). Type Theory and Proof Theory however are basically the same thing as Category Theory, which is proposed to be the foundation of mathematics and to be defined without Mathematical Logic. I personally prefer to ponder Mathematical Logic and formal languages than categories in an intuitive sense. – Andrew Mar 18 '16 at 20:04
  • 1
    @AndrewMiloradovsky Might there be a touch of enthusiasm in your claim that type theory has already supplanted set theory as the standard foundation of math? You may be right that this is happening now and will continue over the next couple of decades; but surely this is not a true statement today. Would my perspective be wrong? Also, my understanding is that at some level, Category theorists DO ultimately care about set theoretical issues. Not an expert, just wondering if you can supply some context. – user4894 Mar 19 '16 at 01:02
  • @user4894 Sets as such are not "bad", they may still fit well as the foundation for specific branches of math, where it does make sense to view the structure as consisting of an elements, and is possible to decide whether something belongs to something; i.e. where binary logic holds true. But generally they don't fit well when people try to use them to, say, define the notion of a function or an ordered pair. Types existed almost as long as sets as a candidate for the foundations, but are still less popular, it doesn't however mean that they are "worse", actually the opposite. – Andrew Mar 19 '16 at 01:22
  • @user4894 For example, in Type Theory everything is constructive, and therefore such a "kludges" like Axiom of Choice become a theorems... (in short, yes, I'm biased; but reasonably :) – Andrew Mar 19 '16 at 01:23
  • Also search for the name Robert Harper, computer scientist at CMU. – Andrew Mar 19 '16 at 01:27
  • 1
    @AndrewMiloradovsky Not debating merits and virtues. Rather wondering about this: "... in modern mathematics sets are quite not basic notion, but type, variable and function are." I'm thinking that perhaps set theory may be on the way out, but has quite a bit of mindshare and "installed base" as they say in tech. So that for (some, many, most?) mathematicians, sets are still the basic notion. And Category theory would be in second place and moving up fast. Type theory's a relative newcomer, is that fair to say? Or an oldie gaining new life lately. – user4894 Mar 19 '16 at 02:51
  • @user4894 Sets and binary logic are quick and dirty solution, still popular though. But I think it is inevitable that rather sooner than later they will be pushed into a small domain of applications, and Type/Proof and Category Theory will be the basis. Type Theory is rather the second, oldie, gaining new life lately, because the limitations of sets become increasingly apparent. It's true that Homotopy Type Theory and Infinity Category Theory are somewhat difficult to understand, yet, and are actually bleeding edge, require somewhat different mindset. But there is apparently no other way. – Andrew Mar 19 '16 at 03:13
  • 1
    To add yet a bit more details. Sets are actually predicates based on classical (binary) logic: for every instance of the variable there is (just) supposed to exist a definite answer - is this true or false. This non-constructive approach creates lot of conceptual problems because it is computationally impossible to give a definite answer for every such proposition (equality of real numbers etc.). Types conversely are based on constructive intuitionistic logic, eliminating all such problems, but requiring to track more details about the proofs (say, whether they're obtained by contradiction). – Andrew Mar 19 '16 at 03:39
0

A variable is not an object but is a property that some objects (or concepts?) may own. The main property of a variable is able to vary, that’s why it is called variable, isn’t it? A variable may vary in the whole real number line $\mathbb{R}$ or just within a tiny range $[0, 1]$. Since a variable is not an object, you would not say that a thing is a variable then it could not be other things (e.g. function). They are not mutually exclusive. So you could say $Q(x)$ is a function and use a variable $Q$ to represent $Q(x)$. In Calculus, an unknown notation $x$ could sometimes be treated as a constant but at later time treated as a variable. But this duality lies in the Calculus problem itself but not the definition of a variable. So in simple terms a variable is a variable.

Ken T
  • 337