# Understanding the syntax of subsitution

I have a question about the meaning and semantics of substitution, I apologise if this is off-topic but I thought here would be the best place as it's more about the semantics and meaning than any formal ideas or practical hindrances in Mathematics, I also post this here because I wonder if there is any answer in Logic to these questions, as in particular there is relational logic which covers some of these.

For example we can have an equation for which there is one solution for x and we are told 'there exists a number x such that' in this case is it acceptable to substitute any value for x as it is still a variable, yielding potentially a false answer if we see the equation as a predicate for which can be true or false depending on what value you assign to x? or do we have to see x as only representing particular value in this case as we say x is a particular number that exists as written above, so by substituting an incorrect value you are defining x to have a value it simply cannot represent? In what cases can we view equality as a predicate, and the variable in an equation x as being something that can vary, yielding true and false instead of as a particular number

Similarly we might use a variable A to represent a matrix, and we might use A in this context to define something that is true for the particular Matrix we've defined on the opposite side of the equality 'A = ...' would then substituting a different matrix for A in any equation we have defined by incorrect as we are using A in this context to refer to a specific matrix?

The final issue I have with substitution is the use of x=a when defining the value a for the variable x in a certain context, does this mean that everywhere that I'm investigating an expression with a variable x I can have x being a form that refers to the number 5 for example when x=5? do we then view this almost as an assignment operation instead of a replacement operation Could I then have an expression 5x+5 and substitute every occurrence of 5 with an occurrence of x? Giving me a different, yet true expression for when x=5?

If these questions are meaningless for you I can post somewhere else, but I would be interested if we can approach these from a logic point of view that could answer this.

Edit:

The use of quantifiers makes a lot more sense to me, I have one other question though, when we write 'there exists a number x such that x+1=2' I would interpret this as 'there is a particular number, represented by x such that this is true', as opposed to there is a value of a variable x such that x+1 = 2, the difference is very small but seems to make a difference to my thinking.

• Not very clear.. To say that e.g. equation Px=0 has a real solution means that the formula ∃x(Px=0) is true in the domain R: no substitution at all. Commented Feb 22, 2022 at 15:42
• To say that x0 is a solution, means that Px0=0 is true in R. Commented Feb 22, 2022 at 15:43
• Regarding equality, if x=a form Substitution axiom we can derive phi(a) from phi(x). Commented Feb 22, 2022 at 15:45
• Substitution is a "syntactical" operation: replace a name with another into a sentence. Commented Feb 22, 2022 at 15:57
• @user1007028 "there exists a value x such that" This is where the problem lies. The wording is just wrong. You have to keep the distinction between values and variables. So, there may exist a value which is the value OF a variable. So x is not a value (which value would that be?). Commented Feb 22, 2022 at 17:45

Some of what you are asking relates to the distinction between an existentially quantified and a universally quantified sentence. If you have an equation that holds for a particular value of x, such as 5x + 5 = 25, this sentence is true when x is substituted with 4 and false otherwise. But if you have an equation such as sin2x + cos2x = 1, this holds for all substitutions for x. We could write the sentences more fully as:

(∃x)(5x + 5 = 25)
(∀x)(sin2x + cos2x = 1)

In practice, mathematicians often get sloppy with the notation and don't put the quantifiers in explicitly. Worse, they sometimes try to say that the second sentence needs a different kind of connective, an identity symbol or something, or that there are two different kinds of variable, one representing a definite value and the other a range of values. In fact, neither of these things are needed; we just need to put the quantifiers in to make the distinction clear. In both cases, the variable x can be said to range over a domain of values, such as the real numbers. Also, in both cases, = is the identity predicate.

If you introduce a constant symbol A or a, this is taken to refer to a particular thing, so you cannot simply substitute it for a different symbol that is already in use and expect your sentence to remain true.

I'm not quite sure what you are asking in the last paragraph. You cannot substitute a constant such as 5 with a variable, and expect the equation to hold for all x, except in circumstances when the rule of universal generalisation applies. You can take a sentence such as 5.4 + 5 = 25 and substitute x for 4 to get an existentially quantified (∃x)(5x + 5 = 25) which is true for x=4 but false otherwise.

If you are interested in some philosophical thinking about the meaning of variables in logic and mathematics, there are a couple of good papers by Quine. "Variables Explained Away" in Proceedings of the American Philosophical Society, Vol. 104, (1960), pp. 343-347; and "The Variable" in Ways of Paradox and Other Essays.

• the last paragraph is asking that question, if we want to talk about 'when x = 5' does this mean that in that particular context we can use the variable x to represent the number 5 as the value of x, I can do the substitution to receive a statement that is true in a particular context when you define it, essentially 'so if x is 5 than 25 is x squared', thank you for that source, I find for me with variables the logic of it can be more difficult than the actual reality of the structures you are studying. Commented Feb 22, 2022 at 18:00