Talk:Second-order logic

message: The article should record the widespread existence of logics called second-order, since Leon Henkin, which are not like the intractable theory described in the article:
*Henkin-style second order logic admits complete axiomatisation, and is usually axiomatised in a language with support for lambda-abstractions; this theory can be expressed in first-order logic;
*The intractable theory is what  "set theory in sheep's clothing" that cannot be expressed in FOL.
I've no time to tackle this now, but hope to get around to it before too long. --- Charles Stewart 20:18, 22 July 2005 (UTC)
thread_title: Kinds of second-order logic

message: the article claims that restricting to first order logic was one of the ways they eliminated Russell's paradox.  I am wondering if second order logics are more likely to contain Russell's paradox than a first order logic (which can also contain Russell's paradox).  -Lethe | Talk 20:56, August 7, 2005 (UTC)
: Russell's paradox applies to neither first-order nor second-order logic, indeed, both these logics are consistent. As stated in the article, it applies to Frege's system, which is a kind of "mixed-order" logic. Don't be confused by the fact that it also applies to variants of naive set theory, which can be formulated on top of, say, first-order logic; this is not a problem of the logic, but of the theory. -- EJ 12:04, 18 August 2005 (UTC)
thread_title:  second order logic and russell's paradox 

message: Another similar question: in the first order language of axiomatic set theory, one can view classes as abbreviations for first order statements about sets, in which case one may not quantify over 
class variables.  If one extends the language to allow quantification over classes, is that the same as moving to a second order language about sets? -Lethe | Talk 22:34, August 7, 2005 (UTC)
: Yes (more or less), if you understand "language" in purely syntactic way, as the set of well-formed formulas. No, if you intend to give the second-order quantifiers also their second-order semantics. That means, Gödel-Bernays or Kelley-Morse set theory is a first-order theory, it does not obey the rules of second-order logic. -- EJ 12:19, 18 August 2005 (UTC)
replies: text: Nonetheless, the term "second-order" is often used to apply to these sorts of theories, also second-order arithmetic (Z_2) is standard terminology, and the terms second-order and higher-order are regularly used in type theories to refer to first-order-describable logics, eg.  Chuch's simple theory of types is often called higher-order logic, and is a little stronger than Z_2.  The article really needs to take account of all this. --- Charles Stewart 19:57, 18 August 2005 (UTC)
replies: text: Yes, this is an unfortunate bit of terminology which further adds to the confusion. Second-order arithmetic is a two-sorted first-order theory. It will be tricky to incorporate this in the article without confusing everybody. Technically, it does not even belong here, as the article is about second-order logic, which is not involved in these "second-order" theories. But I'm not sure whether having a separate article on, say, second-order theory or second-order language would be helpful. -- EJ 10:14, 19 August 2005 (UTC)
thread_title:  second order logic and class theory 

message: I fail to understand how reverse mathematics could be relevant to the claim that second order logic is needed for topology etc. what ever that means exactly. After all, reverse mathematics is mostly concerned with fragments of second order arithmetic, which - unfortunately, perhaps - is a multisorted first order theory.  Is there something I'm missing in the work of Simpson, Friedman or others that would justify the claim in the article? Aatu 21:45, 13 December 2005 (UTC)
replies: text: The claims in that paragraph are very misleading: Simpson and the others use second-order arithmetic, which is a two sorted first-order theory with quantifiers over numbers and sets of numbers, and one could, with not much difficulty but at the price of some syntactic nuisance, recast it is a single-sorted first-order theory, using a relation singsub(X,Y) which is true iff X is a singleton subset of Y.  It is not second-order logic in the sense that is debated here.  I'll change the paragraph. --- Charles Stewart 16:33, 15 December 2005 (UTC)
thread_title:  Reverse mathematics 

message: I think it would be nice to add a section describing the various semantics.  Right now there is a hint about Henkin semantics, but it is very vague.  I will write the section soon unless people object here. - CMummert 11:37, 26 April 2006 (UTC)
thread_title:  Semantics 

message: The first part of the article should be broken into a short intro paragraph and a new section on the definition.  I think that the special semantics of second order logic need to be emphasized more.  The following sentence is just not true:
:That is, the following expression: ∃P P(x) is not a sentence of first-order logic.
What is true is (something like):  the meaning of the sentence assigned by the semantics of second order logic is not expressible in first order logic. CMummert 15:25, 13 June 2006 (UTC)
thread_title:  changes needed to beginning part 

message: To all who have toiled in this soil:
:This is a very nicely-written, smoothly flowing article, but ohmygod where are the references?!! Us lesser mortals need more (lower-level, "first-order" <== writ ironic) information.
wvbaileyWvbailey 21:45, 17 September 2006 (UTC)
replies: text: I'm glad you think this article is clear, but I am planning significant changes.  Some of these changes are indicated in higher comments of mine on this page.   One part of the changes is to add references; I have been looking into which things are appropriate.  Any suggestions would be welcome. CMummert 23:38, 17 September 2006 (UTC)
thread_title:  A nice article ...  but Holy Smokes! Not a single reference? 

message: I love to see detailed technical articles on wikipedia, but I can't make any sense of the first paragraph, even though I have a functional understanding of first-order logic. It would be nice if there were one or two more generalized and dumbed-down introduction sentences before launching into the highly technical explanation. --24.200.34.209 21:52, 27 October 2006 (UTC)
replies: text: Thanks for the feedback. The entire article needs revision, but it has to wait until somebody actually does it. The collection of editors who know about the topic and have a lot of spare time is not so large. I have plans to do it sometime, but I am working on other articles right now. CMummert 22:51, 27 October 2006 (UTC)
replies: text: The Stanford Encyclopedia of Philosophy has a much more comprehensible article on the subject. --Brian Josephson (talk) 10:58, 10 October 2014 (UTC)
thread_title:  Dumbed down intro? 

message: I am moving the following from the article to here.
:As George Boolos has pointed out, though, this incompleteness enters only with polyadic second-order logic: logic quantifying over n-place predicates, for n > 1.  But monadic second-order logic, restricted to one-place predicates, is not only complete and consistent but decidable--that is, a proof of every true theorem is not only possible but determinately accessible by a mechanical method.  In this respect, monadic second-order logic fares better than polyadic first-order logic: monadic second-order logic is complete, consistent and decidable, but polyadic first-order logic, though consistent and complete, is no longer decidable (See halting problem).
The monadic-second-order theory of arithmetic is the same as the full second-order theory,  and is not decidable.  Boolos probably made a correct claim which has been vaguely reprinted in the paragraph above.  Until a reference is found, the claim should be kept off the main page. CMummert 23:55, 21 November 2006 (UTC)
thread_title:  Claims about monadic second order logic 

message: Paragraph 3 states 'For example, if the domain is the set of all real numbers, one can assert in first-order logic the existence of an additive inverse of each real number by writing ∀x ∃y (x + y = 0) but one needs second-order logic to assert the least-upper-bound property for sets of real numbers, which states that every bounded, nonempty set of real numbers has a supremum.'
The necessity of SOL asserted in paragraphs 3 might be
clarified. This specific point has been addressed by
Herbert Enderton here:
http://sci.tech-archive.net/Archive/sci.logic/2004-10/0224.html  —Preceding unsigned comment added by 66.81.75.254 (talk) 21:28, 27 April 2008 (UTC)
thread_title:  re: Expressive power of second order logic 

message: This section includes a (huge sentence) with the excerpt: "because the real numbers are up to isomorphism the unique ordered field that satisfies this property" even if it is correct grammar or the thing that was meant, shouldn't it just not have "isomorphism" the noun there... Like unless I'm interpreting the concept wrongly, shouldn't it say "are isomorphic to"? I just feel like the noun there doesn't work. Could someone who does know, rephrase or break up the sentence (or confirm that it's correct as is?) 110.175.9.69 (talk) 13:53, 24 June 2015 (UTC)
thread_title:  Expressive Power 

message: Was linking 'Monadic second-order logic' to the article on 'Monadic predicate calculus' which doesn't really discuss *second order* so much, but it does give one an intuition what 'monadic' would mean in the context of SOL; I narrowed the scope of what was linked to remove 'second-order' so that ppl going to the 
target article wouldn't expect to find SOL discussed there.
Zero sharp 04:24, 14 October 2007 (UTC)
thread_title: Power of the Existential Fragment

message: Should this not  be "whereas second-order logic allows predicate variables that range over predicates"--Philogo 21:07, 17 July 2008 (UTC)
replies: text: What exactly is meant by "individuals"? Predicates? Objects? There should be a definition or a link. 65.183.135.231 (talk) 02:07, 22 April 2009 (UTC)
replies: text: I added a link. — Carl (CBM · talk) 02:24, 22 April 2009 (UTC)
thread_title: "whereas second-order logic uses variables that range over sets of individuals"

message: The formula does not say that x is an upper bound. It only says there is a number, x, that is smaller or equal to every upper bound. That implies that the set of upper bounds is limited from below, but it still does not say that any particular of the upper bounds is a least upper bound. The structure of the formula should be
For all A,
  if
    A is not empty, and
    A has an upper bound,
  then
    there is an x such that
      x is an upper bound, and
      for all y,
        if
          y is an upper bound of A.
        then
          x <= y
or,
: \forall A \big[(\exists w (w \in A) \land \exists y \forall w (w \in A \rightarrow w \leq y)) \rightarrow \exists x (   \forall w(w \in A \rightarrow w \leq x) \land ( \forall y \forall w (w \in A \rightarrow w \leq y) \rightarrow (x \leq y)))\big]
(Here I stick to the convention used earlier, that the scope of a quantifier is limited to the inside of the parenthesis that follows it.  I actually prefer the notation (\exists x . x \leq y) over \exists x(x \leq y). That is, I prefer a notation where the scope is to the end of the enclosing parenthesis.)
I concur with the discussion above that the example is more complex than it needs to be in the article.
As to the suggestion that such formulas should be explained using a two-column display, I don't think it helps much in understanding the topic of the article. The effect of being able to quantify over more than individuals can and should be grasped independently of the technical issue of learning to read expressions with lots of parentheses.
When such things are expressed in prose, the effect of the parentheses is usually achieved with the help of terminology. Inventing the concept of "upper bound" and using it in a larger formula, effectively wraps all parts of the expression defining "upper bound" in a pair of parentheses.
The purpose of formulas is usually to make something more apparent than it would be with prose. A formula like A = l \times w is more readable than "area equals the product of length and width". However, formulas in formal logic have a different purpose. They are restricted to a limited set of symbols precisely to make it easier to prove properties of the language itself. For this reason, the formulas in formal logic are fare less readable than the prose versions (with higher-level concepts like "upper bound"). To train readers in comprehending large formulas in this restricted language is quite pointless. Cacadril (talk) 11:31, 11 December 2008 (UTC)
replies: text: The formula in the article is correct. Read it carefully, especially notice that the last connective is an equivalence, not an implication. — Emil J. 13:25, 11 December 2008 (UTC)
thread_title:  The lub formula is not correct 

message: I searched for ["second-order logic"] on Google Scholar, and made a not-very-rigorous analysis of the results, trying to see what semantics were being used.  Of the 20 I judged that:
*10 were talking about monadic second-order logic, with some, the papers by Courcelle, mentioning the full semantics, but most talking about model checking,  which is generally restricted to decidable, and mostly finitary problems.
*4 appeared to be talking characterising compexity classes in terms of second-order semantics, which generally means model checking.
*3 appeared to be talking about the full semantics for the full theory of second-order logic; one or two of these might have been using the semantics informally;
*1 talked of both full and Henkin semantics side by side;
*1 was talking about the Henkin semantics only;
*1 was talking about second-order language without reference to any semantics.
Since for finitary strucrures, Henking and full semantics agree, 
I was a little surprised by the results.  They are, as expected, skewed towards computer science applications, but I was surprised to the extent to which these were tilted towards decision problems.—Preceding unsigned comment added by Chalst (talk • contribs) 11:35, 22 June 2009
:A google books search turns up some additional resources. Many of them will involve Shapiro or Boolos, who each have advocated the study of second-order logic. But even others (I found a book by Landman on Google books) will carefully explain that it is the full semantics that make second-order logic differ from first-order logic, and in particular those semantics are what make the completeness, compactness, and Löwenheim–Skolem theorems fail. — Carl (CBM · talk) 12:51, 22 June 2009 (UTC)
replies: text: P.S. I also noticed on Google books that JRSpriggs' observation about defining identity is on p. 171 of Logic, Language, and Meaning by L. T. F. Gamut. — Carl (CBM · talk) 12:51, 22 June 2009 (UTC)
thread_title:  Popularity contest 

message: Could someone cite original paper with proof that EXPTIME  is the set of languages expressible by second-order logic with an added least fixed point operator? (like in case for NP) Letac (talk) 10:15, 15 March 2010 (UTC)
thread_title: Could someone cite original paper

message: It would be helpful to have a separate article Henkin semantics or perhaps "Henkin models".  Tkuvho (talk) 18:57, 20 March 2013 (UTC)
replies: text: I don't immediately see that it would be very helpful. The only place the term comes up is in the context of second-order logic and similar type theories, and I don't see how splitting it into a separate article would make things easier to explain here or there. Is there some topic in particular that should be covered but is not covered here? One particular concern I have is that there is no general definition of "Henkin semantics" apart from the specific definitions in second-order logic and type theories - so there will be few to no sources on "Henkin semantics" specifically, just sources on second-order logic or type theory. We'd have to extrapolate from those, but then the article would be at risk of being classified "original research" even if the content is completely routine. — Carl (CBM · talk) 19:26, 20 March 2013 (UTC)
replies: text: At Skolem's paradox it is asserted that Henkin model is a way of properly understanding the paradox, the latter page being redirected to a subsection of second order logic, but I don't find the link particularly useful in explaining the assertion.  Perhaps there is some other way of clarifying this, perhaps at the Skolem page itself.  Tkuvho (talk) 12:16, 21 March 2013 (UTC)
replies: text: That paragraph is talking about Henkin's proof of the completeness theorem for first-order logic, which is related-in-some-way but not formally the same as Henkin semantics for second-order logic. I copyedited the paragraph. — Carl (CBM · talk) 13:40, 21 March 2013 (UTC)
thread_title:  separate article on Henkin semantics? 

message: Shouldn't the last sentence of the enumeration be talking about a second-order term:
For each natural number k there is a sort of variables that ranges over all functions taking k elements of the domain and returning a single element of the domain. If f is such a k-ary function variable and t1,...,tk are first-order terms then the expression f(t1,...,tk) is a first-order term.  — Preceding unsigned comment added by Fdehne (talk • contribs) 10:44, 13 August 2015 (UTC)
replies: text: A first-order term is the kind of thing that a function can be applied to. Because we can write "g(f(x))", the expression "f(x)" must be a first-order term. Similarly, an expression such as "f(x)" is evaluated, in a given interpretation, to a first-order element (once "x" has an interpretation as a first-order element). So "f(x)" is a first-order term. Only in third-order logic would we have a function (third-order) that could be applied to a second-order term. — Carl (CBM · talk) 12:09, 13 August 2015 (UTC)
thread_title:  Syntax and fragments  

message: : (∀ A) ([ ∧ ] 
::→ )
Nothing in this formula is telling us that x is also an upper bound. --Igor Yalovecky (talk) 07:16, 31 October 2015 (UTC)
replies: text: In the final clause, there is an if and only if. So consider what happens when $y$ takes the same value as $x$. Then $x \leq y$ holds, so  $(\forall w)[w \in A \to w \leq x]$ must also hold, so $x$ must be an upper bound for $A$. — Carl (CBM · talk) 12:16, 31 October 2015 (UTC)
thread_title:   least-upper-bound  

message: There are pages that actually give an axiomisation for deductive systems based on first order logic, like Hilbert system, Natural deduction or Sequent calculus. These pages actually list out axioms completely and properly explain how the deductive system works. Is there anywhere which does this for second order logic? 
All this page says is that the single sort of first order logic (i.e. individuals) is extended with a number of different sorts (k-ary relations and k-ary functions, for every natural k). And so I'm assuming that the axioms that govern quantification are applied to these sorts as well. But how would you deduce something like:
\forall P \forall Q \exists R \forall x (R(x) \leftrightarrow P(x) \wedge  Q(x))       where P, Q, R are unary relations?
It seems to me that there need to be some sort of extra axioms of the form: 
* If t(x_1,\dots,x_n,f_1,\dots,f_m) is some first order term where its free variables are individuals x_1,\dots,x_n and functions f_1,\dots,f_m, then
 \forall f_1 \dots \forall f_m \exists g \forall x_1,\dots, \forall x_n (g(x_1,\dots,x_n) = t(x_1,\dots,x_n,f_1,\dots,f_m)) , where g is a function variable of arity n
* If \phi(x_1,\dots,x_n,f_1,\dots,f_m,r_1,\dots,r_k) is some second order formula where its free variables are individuals x_1,\dots,x_n, functions f_1,\dots,f_m, and relations r_1,\dots,r_k, then
 \forall f_1 \dots\forall f_m \forall r_1 \dots \forall r_k \exists s \forall x_1,\dots, \forall x_n (s(x_1,\dots,x_n) \leftrightarrow \phi(x_1,\dots,x_n,f_1,\dots,f_m,r_1,\dots,r_k)) , where s is a relation variable of arity n
Should things like this be explained more specifically on this page? --AndreRD (talk) 10:52, 16 June 2016 (UTC)
thread_title:  Axiomisation of second order logic 

message: "A sort of variables that range over sets of individuals."
"For each natural number k there is a sort of variables that ranges over all k-ary relations on the individuals"
Isn't the first merely a particular case of the second with k=1?
109.65.3.224 (talk) 11:51, 22 October 2019 (UTC)
thread_title:  Excessive definition 

message: OK, so I took a look at the corresponding SEP article and confirmed that indeed, meta-variables for "properties of properties" (such as the presented Shape predicate in the example) are not allowed in second-order logic. See this excerpt from SEP:
  It is noteworthy that although we have property variables we do not have variables for properties of properties. Such variables would be part of the formalism of third order logic, see §12.
As a result, I placed the "Disputed section" template in the section for now. It needs to be rewritten, but the shape example is much less compelling without a meta-property for shapes, so I fear it needs a substantial rewrite. Thoughts welcome Caleb Stanford (talk) 18:48, 6 March 2022 (UTC)
thread_title:  Examples section presents third-order logic, not second-order