# What are free variables and what does it mean for a statement to contain one?

I am puzzled a bit. I read the wiki page and an introductory book on logics, but I can't quite grasp it yet. The place where i came across them is Van Inwagens 'Material Beings'.

Consider the following three sentences:

(1) x=x

(2) ∃x x=x

(3) ∀x x=x

It seems to me that they are all equally true.

Also, I can't see the difference between the next two sentences:

(4) If x happens, I will get mad (free)

(5) ∃x If x happens, I will get mad (bound)

The only difference I see is to (6):

(6) ∀x If x happens, I will get mad (bound)

Clearly, in (6) im constantly mad and in (5) not.

A good answer would explain the difference between (4) and (5), I feel that that explanation would help me along in understanding what it means for a sentence to contain a free variable.

Edit: there is now a follow up question here

• Regarding the first formula (x = x). You say it is true. However, you haven't actually made a statement yet until you specify what x is. You say it doesn't matter because it's true for all x! And I say so the statement you're really claiming to be true is the third one you referred to: ∀x(x = x), in which case I agree. :) – David H Aug 9 '13 at 17:46
• – Thomas Klimpel Aug 10 '13 at 9:43
• Note that (4) is not a sentence, because a sentence is defined to be a formula with no free variables. So even informally (4) can at most be "equivalent" to a formula. Of course, the same is also true for (1). Regarding (1), a constant function is not (necessarily) the same as a constant, even so some languages may allow you to use a constant in place of a (constant) function. – Thomas Klimpel Aug 10 '13 at 16:59

I apologize for the change of notation, but it will simplify things in the long run. Consider sentences (1-6):

╔════════════╦══════════════╗
║ (1) x=x    ║ (4) Hx->M    ║
║ (2) ∃x:x=x ║ (5) ∃x:Hx->M ║
║ (3) ∀x:x=x ║ (6) ∀x:Hx->M ║
╚════════════╩══════════════╝


Notice the difference between the columns: in the first the sentential function is "x = x", in the second it is "if x happens, I will get mad" ("Hx -> M"). Briefly, some informal definitions:

Sentential functions are functions which, when their arguments are supplied, return a declarative sentence. Declarative sentences are expressions that can be given truth-conditions and thus can be evaluated to true or false.

Let g(x) denote "x = x", and h(x) denote "if x happens, I will get mad" ("Hx -> M"), to obtain:

╔═════════════╦═════════════╗
║ (1) g(x)    ║ (4) h(x)    ║
║ (2) ∃x:g(x) ║ (5) ∃x:h(x) ║
║ (3) ∀x:g(x) ║ (6) ∀x:h(x) ║
╚═════════════╩═════════════╝


This table is just to show how formally similar (1-3) and (4-6) are. Now let's get to the problems.

Claim 1. (1-3) are all equally true.

Expression (1) cannot be true, because it's a sentential function; sentential functions don't have truth-conditions (see the definition above). Sentence (3) says that everything is self-identical, so it's pretty uncontroversially true. Sentence (2) says that there exists something which is self-identical. In order for (2) to be true, at least one thing has to exist, while (3) is true for even empty domains.

In sum: (1) has no truth-conditions, (2) is true in all non-empty domains, and (3) is true in all domains.

Claim 2. (5 & 6) have different truth-conditions.

Exactly! For the same reason (2 & 3) have different truth-conditions.

Question. What's the difference between (4 & 5)?

As I said in my response to your first claim: (1) has no truth-conditions. The same is true for (4); it too has no truth-conditions. (5), like (2), however, does have truth-conditions: (5) is true if and only if: there exists some x such that either: x is not happening or you're getting mad.

Hope that makes things a little clearer.

First difference:

• In some sense statement (4) is incomplete, if x indeed is a variable, then the truth value of (4) is undefined.

• However, statement (5) does have a well defined truth value (even if it is unknown) even though the statement contains a variable.

a second difference:

• (5) is logically entailed by one (or more) true statements of (4) for different x's.

• However, one can know/assert/prove a statement of form (5) without knowing/identifying/proving, for any particular 'x', a statement of the form (4).

Variables are a useful concept in various contexts. Their usefulness arises from their ability to refer to objects by a more or less arbitrary name or symbol. In first order logic, the need for this ability arises for the quantifiers ∃ and ∀. Also the lambda abstraction λ needs this ability, and other examples less closely related to logic are probably easy to find. There are alternatives like de Bruijn indices, which allow to avoid the usage of variables.

Like a bound variable, a free variable refers to an object. Depending on context, more or less assumptions about such an object are made. In the context of first order logic, the only assumption is that the referenced object exists. So in this context, free variables are nearly the same thing as constants, except for the fact that they serve a different purpose. Therefore, the treatment and exact interpretation of (free) variables is often more restricted and slightly more subtle than the treatment of constants.

For example in Ebbinghaus et. al, officially only the variables "v_0, v_1, v_2, ..." exists, despite the fact that the text normally uses "x, y, z, ..." when talking about variables. The funny thing is that "x, y, z, ..." can mean any of "v_0, v_1, v_2, ...", so that the text has to sometimes explicitly exclude the case "x=y" (the text uses "\equiv" for equality between objects). The text further defines the subset "L^S_n" of the language "L^S" for the formulas which only contain "v_0, ..., v_{n-1}" freely. S-structures and S-interpretations are two separate notions, where an S-interpretation contains a concrete assignment of objects to the variables "v_0, v_1, v_2, ...". For an S-structure, you can ask whether it could satisfy a given set of S-formulas, or whether a set of S-formulas will be satisfied by the S-structure for all possible variable assignments.

As another example, my references for universal algebra explicitly specify "X" as a finite or countable infinite set, whose elements are called variables, and explicitly tag this "X" to any set of terms or formulas. What this has in common with the previous example is that there are at most countable infinite different variables. Still, in universal algebra, the free variables are also use as a sort of generic element, although not through abuse of notation but through an explicit construction of corresponding free algebras.

Sentences with free variables are like the indefinite integrals in calculus, until they're bound to some interval they do not have a well-defined value, and similarly such a sentence until it is bound has no well-defined truth value, that is, in a sense it is incomplete. But note that this does not mean that they are not valuable, in the same way that an indefinite integral is valuable in calculus. A free variable should be thought of a 'generic' variable, or a placeholder.

Informally we can say that the difference between free & bound variables is that for the free variables we do not know what kind of values the variable takes, for example take the sentence:

x=x,

Now is x an integer, a real number, a cat, infinity or the universe? We do not know as we haven't been told. A free variable is bound when this information is available, for example:

(for all x in the integers) x=x

This is a bound sentence as we now know that x must be an integer, similarly

(for all x in {cats in Europe}) x is a mammal

This is bound since x must be a cat that is in Europe.

Now the first-order calculus introduces the quantifiers 'for all' & 'there exists', and for these to make any sense we also must have variables (there are none in the propositional calculus) and one can distinguish sentences in which all variables are bound to a quantifier and those that are not.

Now, we can distinguish two further cases:

1. at least some but not all variables are bound

2. and all variables are bound.

It turns out that of these two cases it is the second that is of the most direct interest. This is because these are the sentences that have well defined truth values under an 'interpretation' that assigns values to x. For example:

2x=x

has no well defined truth value as we do not know what the value of x should be, but:

(for all x in the integers) 2x=x

is obviously false, and

(there exists x in the integers) 2x=x

is true since we can choose x to be zero.

• -1 Even after reading your answer multiple times, it's still unclear to me how you assign meaning to free variables. You make it pretty clear that bound variables are relatively unproblematic to you, but you fail to make it clear why free variables are useful at all, not even talking about how to assign meaning to them. – Thomas Klimpel Aug 10 '13 at 17:07
• Well, the OP asked 'A good answer would explain the difference between (4) and (5)', with (4) being free, and (5) being bound. But you're right I've placed more weight on bound variables, and nor have I discussed assigning meaning to free variables, I only mentioned in passing that they're used in the propositional calculus. To discuss meaning for free variables there would mean discussing their model theory or truth tables. Are you suggesting that free variables are also useful in first-order logic? – Mozibur Ullah Aug 10 '13 at 18:47
• You simply seem not to be at ease with free variables (in first-order logic), which puts you in an unfortunate position to answer this question. The term algebra "T(X)" and the related factor algebra "T(X)/Gl_X(K)" are examples from universal algebra where free variables are useful. Both the term algebra "T(X)" and "T(X)/Gl_X(K)" (the free algebra of the class of algebras "K" with the generating set "X" also noted as "F_K(X)") are free algebras. – Thomas Klimpel Aug 11 '13 at 10:04
• @klimpel:Well, I'm certainly not correct about free variables in the propositional calculus - they don't have variables, never mind free ones! Now, according to your linked article, Term algebras are freely generated structures for a given signature, and the nearest equivalent in logic is a Herbrand universe - but this consists simply of all ground terms, that is all terms without any free variables in them. It doesn't say, but it looks likely that any quotient of the Herbrand universe doesn't have free variables either. – Mozibur Ullah Aug 11 '13 at 15:14
• It seems to me that the use of free in 'freely generated' & 'free variables' are somewhat different, or have I misconstrued the article? – Mozibur Ullah Aug 11 '13 at 15:18

1. "it is the same thing as it"

2. "something is the same thing as itself"

3. "everything is the same thing as itself"