Talk:Substitution (logic)

Latest comment: 2 days ago by Caleb Stanford in topic Revision of September 7, 2024

notation

edit

Hi, sorry to disturb you, my english is not perfect,

I saw the notation:

  • [t/x]

which seems to stand for a substitution, can you describe it here?

thank you for what you do.

--Nicobzz (talk) 19:15, 26 August 2011 (UTC)Reply

Added a ref note on notation [t/x]. Jochen Burghardt (talk) 18:47, 20 June 2013 (UTC)Reply

Closure Under Substitution

edit

Hey, I removed the statement "For any consistent formal system, any substitution of a tautology will also produce a tautology." earlier from this page but my edit was reverted and now the statement is back. The reason for the edit is because it's not true - it holds only for systems closed under substitution. The Logic of Public Announcements for example is not closed under substitution. [p]p is a tautology of PAL while [φ]φ is not. I don't want to start an edit/reverse war so I'm keeping the page as it is and ask someone else to remove the statement or clarify it.

Cheers 213.220.246.73 (talk) 12:49, 11 August 2012 (UTC)Reply

You're right. It should say "closed under substitution" instead of "consistent". That paragraph is also a bit confused about whether it wants to talk about propositional logic or arbitrary formal systems. In the latter case the statement could be generalized further to substitution preserving other relations, not just tautologies. —Ruud 17:05, 11 August 2012 (UTC)Reply
If there are clarifications to be made...then make the clarification, don't delete the line. Greg Bard (talk) 19:55, 13 August 2012 (UTC)Reply
The sentence was not merely "in need of clarification", but as the anonymous editor pointed out here and in his edit summary, factually incorrect. So, conversely, it would probably also be a good idea to correct the statement instead of reverting the removal without comment. The whole article is in a pretty sorrow state, I'll put it on my to so list. —Ruud 01:14, 14 August 2012 (UTC)Reply

Justification for editing the lead

edit

Here are my justifications for my editing of the lead (in blockquote: old text, sentence by sentence):

Substitution is a fundamental concept in logic.

I deleted the reference to concept, since I considered it as too general: any wikipedia article is in some way about some concept.

Substitution is a syntactic transformation on strings of symbols of a formal language.

I replaced "strings" by "expressions", since I consider a tree structure as the best way to represent a formula, in predicate logic as well as in propositional, or other logics.

In propositional logic, a substitution instance of a propositional formula is a second formula obtained by replacing symbols of the original formula by other formulas.

I deleted this sentence, which is now redundant.

For any formal system that is closed under substitution, any substitution of a tautology will also produce a tautology.

This sentence seems important; I'd like to keep it. However, I don't understand:

  • Is this a definition of "closure under subtitution" or a theorem about propositional logic and related systems? In the former case, a phrase like "... is called closed under substitution if ..." would be more clear. In the second case, a citation should be added (who has proven precisely which theorem where?).
  • What does "substitution" mean anyway in an arbitrary formal system? Although the article "formal system" uses the notion of "formal system" in a rather narrow way, (i.e. consisting of alphabet, formulas, axioms, inference rules, thus excluding e.g. formal systems operating on values rather than on truths, such as term rewriting systems), it does not require the notion of variables and/or substitutions for something to be a formal system. - It doesn't even mention the notion of "tautology", but that could probably repaired (def.d as "inferred from axioms by rules").

Jochen Burghardt (talk) 19:28, 16 June 2013 (UTC)Reply

On the whole I don't object to this contribution, however I have no choice but to say that it will be extremely confusing to most readers. Perhaps the more simplified explanation as it relates to propositional logic needs to come first. Also, you should know that not everything in Wikipedia is a concept. That actually is a meaningful distinction, because it tells the readers and editors what the subject matter of the article is. Please observe the "concepts in logic" category. You can reasonably expect any article in that category tree to mention the fact the the article is about the concept (i.e. not about, for instance, the typographical symbols, etcetera.) In this case, not only is substitution a concept (which there are many), but it is one of the most fundamental concepts in logic. I do agree about "expression" over "string", and that is also consistent with the usage of terminology in the category structure (i.e. there is a category for "logical expressions", not "strings"). I also hope the statement about closure, and substitution within tautologies resulting in tautologies reappears. Good luck. Greg Bard (talk) 22:36, 16 June 2013 (UTC)Reply
I agree to your suggestion of swapping the sections about propositonal and first-order logic, and edited the article accordingly.
Although I don't yet fully understand the meaning of the "conept" notion, I restored the respective lead sentence, being impressed by the existence of a category about logical concepts. (Concerning typographical symbols as non-concepts, I'd disagree, referring to Hofstadter's work about analogical reasoning in font design, cf. Ch.10 in D. Hofstadter, The Fluid Analogies Research Group (1995). Fluid Concepts and Creative Analogies. Basic Books., or Gary McGraw, Douglas R. Hofstadter. "Emergent Letter Perception: Implementing the Role Hypothesis". {{cite journal}}: Cite journal requires |journal= (help); but maybe e.g. Marilyn Monroe is not a concept.)
Concerning the statement about closure, I'd like to wait for a clarification, unless you insist on restoring it immediately. Its instance concerning propositional logic (which seems well understandable to me) is still contained in the respective section, anyway. Jochen Burghardt (talk) 07:15, 17 June 2013 (UTC)Reply
You and I agree about typographical symbols. They are marks on the page, and they are ideas too. When logicians talk about symbols, and expressions, they are always talking about the ideas, unless they specifically say so. However, there are articles that deal with typographical symbols, and they talk about the history of the marks on the page. We are talking about metalogical distinctions, and want to make sure that the classification of things is clear. I am not an immediatist, so at some point in the future I', sure we will get a clarification on closure that is satisfactory. Carry on, and be well.Greg Bard (talk) 17:46, 17 June 2013 (UTC)Reply

Refactoring of sections?

edit

During work on the "first-order logic" section, I got the impression that the section headings do not reflect the contents distinction in the best way.

The section currently called "Propositional logic" explains the use of substitutions in propositional logic. It even briefly explains (in the paragraph before "Tautologies") the use in first-order logic, which a reader wouldn't expect there, as long as an own section seems to be devoted to "First-order logic".

On the other hand, the section currently called "First-order logic" explains the mechanism of substitution and many algebraic properties needed for unification, resolution proving, term rewriting etc. If we are willing to accept propositional formulas as terms over the operators   (or better: as meta-terms, in order not to confuse the notions of "term" and "formula"), e.g. the 1st example substitution from section "propositional logic" can be described by  , using the notation from the "First-order logic" section.

To start a discussion, I suggest to refactor the article to have the following sections:

  • "Use in propositional logic" (to keep the most easily readable section first, as suggested by User:Gregbard)
  • "Use in first-order logic" (to be composed from the first-order paragraph currently under "Propositional logic", and explanations of the  -elim and  -intro rule of natural deduction, we also should think about a first-order property corresponding to the one explained under "Tautologies", maybe   implies   if   and   ?)
  • "Formal definition" (essentially the contents of the current "First-order logic" section, extended as needed in the new "Use in propositional logic" section (meta-terms? etc.)

Jochen Burghardt (talk) 19:36, 20 June 2013 (UTC)Reply

Merge with Substitution (Algebra)?

edit
The following discussion is closed. Please do not modify it. Subsequent comments should be made in a new section. A summary of the conclusions reached follows.
Merge - Jochen Burghardt (talk) 14:43, 19 March 2023 (UTC)Reply

My impression of proper Wikipedia math articles is that both informal and formal descriptions of the same concept can fit in the same article, starting with the informal description in the (Top) section. Is this a correct judgement? HyenHks (talk) 10:19, 13 March 2023 (UTC)Reply

I agree. Both articles describe the same concept, but maybe from different viewpoints and on different levels of formality. - Jochen Burghardt (talk) 12:15, 13 March 2023 (UTC)Reply
+1, if you have the bandwidth, please go ahead and make the merge! I don't see a need to maintain two separate articles. Caleb Stanford (talk) 17:17, 13 March 2023 (UTC)Reply
I placed merge tags to both Substitution (logic) and Substitution (algebra), to ask for opinions of more editors. If there is no objection within the next days, I could perform the merger. - Jochen Burghardt (talk) 08:56, 14 March 2023 (UTC)Reply
The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

Typo and possible wrong order of examples?

edit

{ x ↦ y2, y ↦ y2 } is flat, but non-linear, { x ↦ x1, y ↦ y2 } is both linear and flat, but not a renaming, since is maps both y and y2 to y2; each of these substitutions has the set {x,y} as its


I'm not sure this paragraph is correct? "since is maps" should probably be "since it maps"? But also "maps both y and y2 to y2" seems to apply to the second substitution but only holds for the first? 2A02:A420:44:AE92:197A:88B5:2987:BDA1 (talk) 19:09, 25 October 2023 (UTC)Reply

The "is" should indeed be "it", thanks for noticing. Both substitutions map y to y2 (given explicitly in the braces), and y2 to y2 (since every variable outside the domain is mapped to itself). - Jochen Burghardt (talk) 09:29, 26 October 2023 (UTC)Reply

False claim about idempotence

edit

The article makes the claim "The substitution { x1 ↦ t1, …, xk ↦ tk } is idempotent if and only if none of the variables xi occurs in any ti."

However, the identity substitution seems to be a counterexample. I suppose it is true if xx mappings are not allowed in the substitution, but that does not appear to be made clear in the article. MattWithTwoTees (talk) 09:15, 4 June 2024 (UTC)Reply

fixed! Caleb Stanford (talk) 18:11, 4 June 2024 (UTC)Reply
You are right, x↦x mappings indeed are not allowed by the cited authors. I changed the previous fix accordingly. Moreover, it should be "none of the variables xi occurs in any tj" (now fixed, too). - Jochen Burghardt (talk) 17:48, 5 June 2024 (UTC)Reply
Looks correct now. Thanks, Caleb Stanford (talk) 18:52, 5 June 2024 (UTC)Reply

Substitution in computer science

edit

We have sections on logic and math; probably would be good to also have a section on its use in computer science, covering lambda calculus, variable assignment, program rewrites, etc. Something to do if someone is looking for a small project or perhaps I will look into it if I get the time! Caleb Stanford (talk) 15:19, 7 September 2024 (UTC)Reply

The concept in Lambda calculus is pretty much the same; for variable assignments, you might refer to Hoare_logic#Assignment_axiom_schema. - Jochen Burghardt (talk) 18:36, 7 September 2024 (UTC)Reply
Yes pointers to these articles would be one way to cover it, of course. Caleb Stanford (talk) 01:36, 16 September 2024 (UTC)Reply

Revision of September 7, 2024

edit

I expanded a section from "Algebra" to "Mathematics", with the intention that other articles could link here and get a more broad description of substitution than simply substitution in polynomials, as the article currently stands; this was, however, reverted by @Jochen Burghardt. This is a discussion going over their conscerns and trying to improve the article.

  • (subst. of var.s for const.s" should be "subst. of terms for var.s" (see above));

Two issues here; first, "term" used in math is not really the same as "term" in logic. Outside of mathematical logic, a "term" almost universally refers to an addend of a sum. For instance, 2+2 would not be one term, but two (see "Summation" or "Term (mathematics) on Simple English Wikipdedia"). The closest related word in standard mathematics would likely be Expression (mathematics).

Second, "Term" or "Expression" is more general than what is intended here. For instance, one usually doesn't want to substitute one variable for another, or one variable for any non-constant expression, unless they are suggesting an equality between the variables/expressions, and hence the second use of substitution mentioned. Of course, this doesn't take into account the idea of "Substitution" of indeterminates in a polynomial ring or Formal power series. But this is beyond the scope of what most readers will be looking for, too Technical for an introduction, and is mentioned in the Algebra section anyway.

(Edit: and substitution in this second sense isn't a property unique to variables either. Substitution can occur for any expression. For instance, if 2 = 3x+5u, and 3x-2 = u, then we can substitute '2' for that expression and get 3x-(3x+5u) = u)

  • there are more binding mechanisms than quantif.; arg.s of a fct. *def.* are bound;

While, yes, I agree to remove the statment saying that bound variables are quantified, I would like to note, I am having a lot of trouble finding any sources defining "Binding mechanism" or "Binding operation"; and the only sources I can find that try to formally define "bound variable" say that a variable is bound if and only if it is being quantified, except for this source that defines a bound variable as simply being unable to be substituted for constants. And further, I can't seem to find any sources (outside of programming) that explicitly state that a function argument is bound.

It may also just be that function declaration is itself a quantified formula. For instance,   may be defined as the assertion  , which would comply with both definitions, but honestlly, I'm not sure. Do you have any sources?

  • univ. inst. requires quantif. formula to be true; in \sum_{i<k} a_{ik}, both i and k may well be free, to abbreviate (i<k ? a_{ik} : 0);

As far as I can tell, no authour defines a summation like this. All sources I can find require the index variable to be bound. Nevertheless, this example is taken directly from the source in the citation following that sentence: Bound variable: Encyclopedia of Mathematics.

  • we don't need a copy of the Leibniz law article everywhere

I don't know what you mean... I've only linked the article once here. And I agree the term shouldn't be mentioned on every article, but if the term is going to be mentioned on any article, in a section about "Substitution in mathematics", and specifically about the "substitution property of equality" is certainly the place it should be. The terms "Substitution property of equality" (in the formal sense) and "Leibniz's Law" mean exactly the same thing, except "Leibniz's Law" was the original, and was later rebranded by mathematicians and logicians as the "Substitution property of equality". I think that's reason enough to deserve at least a mention in the section. Farkle Griffen (talk) 04:47, 11 September 2024 (UTC)Reply

@Jochen Burghardt I think the pieces of this section going over semantics of free and bound variables isn't really very necessary anyway... It may be reasonable to just delete that or replace it with a description similar to that proposed by @Caleb Stanford, and maybe a following section on substitution in computer science? The current Algebra section already mentions computer algebra. It may be reasonable to create a dedicated subsection to go over it? Farkle Griffen (talk) 05:00, 11 September 2024 (UTC)Reply
Sorry for the delay, I didn't find much time for Wikipedia during the preceeding week. I'll try to reply in the same order as above.
  • You have a point that for non-logicians, Expression (mathematics) is more common than its synonym Term (logic). Since the whole article is about a logic issue, while the particular section is about its applications in mathematics, I suggest to briefly mention both names and then continue to use one of them. If you insist, "expression" is ok.
However, substituting arbitrary expressions is not too general for mathematics applications. One examples is using an instance of a law in a proof step, e.g. the expression   can be transformed to   by applying a universal instantiation of the binomial theorem  ; the latter uses the substitution  . Another example is evaluating the function definition   at the argument  , which employs the substitution  .
Moreover, it seems to me you confused some terminology: by "substitute ... one variable for any non-constant expression" you mean (as I guess) "substitute ... one variable by any non-constant expression". Afaik, "substitute x for u" corresponds to a substitution   (where u has to be a variable), while "substitute x by u" corresponds to   (where x has to be a variable).
As for your parenthetical edit, the step you describe is valid, but it can't be achieved by applying a "substitution"  . It seems that logic terminology and mathematics terminology are different here.
  • (I'll reply to that later.)
  • In a general sum, there is usually a bound variable running over a given domain, like   in  . Additionally, some contraints may be given, like in   in  . If the given domain is clear from the context, the "running" variable and ist bound are often omitted, like  . I never saw any restrictions to the form of a constraint. Usually it doesn't make much sense to have a constraint without any occurrence of the running variable, but it is not forbidden or ill-defined. (In fact, I occasionally used such notation in internal reports.) I couldn't find your example in the page https://encyclopediaofmath.org/wiki/Bound_variable .
  • You devote a long paragraph to the Leibniz law, which is not particularly relevant here at all. You wouldn't mention the law in an article on e.g. the sine function ("Note that, if x=y, then sin(x)=sin(y)"). This article is about a concept in logic (and its applications e.g. in mathematics), not about everything that has "substitution" in its name. Substitution property of equality should be explained once and for all in an appropriate article (Identity_of_indiscernibles#Identity_and_indiscernibility), and just briefly be mentioned or linked in a few closely related (based on the concepts, not the namings) articles.
So much for now. Best regards - Jochen Burghardt (talk) 09:29, 15 September 2024 (UTC)Reply
Oops! I seem to have gotten them mixed up; the correct link was https://encyclopediaofmath.org/wiki/Free_variable. That's my bad.
As for the rest of your comments, I agree that much of the content I added shouldn't belong on an article titled "Substitution (logic)", but that just makes it more confusing as to why "Substitution (algebra)" was merged here...
So, here's the thing, the reason I made the edit was that several mathematics articles link here when mentioning substitution, but there was very little explanation related here, so my edit was not intended to add to the notion of "Substitution in logic", but rather to add to "Substitution in mathematics". Given that there is no "Substitution (mathematics)" article, and with the inclusion of "Algebra" in the article, this seemed like the most appropriate place. And yes, I agree that the substitution property should "be explained once and for all in an appropriate article"; this was intended to be that article. However, I do see your point given the title of the article.
I think the meaning of "substitution" in mathematics is simply different from that in logic. I propose that either the section "Mathematics" simply be treated as an isolated section, or that the contents should be moved to a relevant "Substitution (mathematics)" article. I'll wait for your opinion before proceeding discussion in either direction.
As a side note:
  • "Moreover, it seems to me you confused some terminology: by "substitute ... one variable for any non-constant expression" you mean (as I guess) "substitute ... one variable by any non-constant expression""
I don't think I had ever realized there was a difference; thank you! Farkle Griffen (talk) 11:59, 15 September 2024 (UTC)Reply
I didn't read the whole discussion but briefly -- these changes look good to me in terms of improving the overall coverage/scope of the article! Thanks, Caleb Stanford (talk) 01:37, 16 September 2024 (UTC)Reply