0

I am struggling to define "first-order language." In principle, a first-order language is any language produced by a "first-order grammar," but there doesn't seem to be any way to state what a "first-order grammar" is without employing the use of first-order logic at some point. In particular, I can't seem to reduce...

if $F$ is an $n$-ary function symbol and $t_1,\ldots,t_n$ is a list of $n$ terms, then $F(t_1,\ldots,t_n)$ is a term

...and...

if $R$ is an $n$-ary relation symbol and $t_1,\ldots,t_n$ is a list of $n$ terms, then $R(t_1,\ldots,t_n)$ is a formula

...to production rules. This is a problem because "is $n$-ary" is a proposition which must be proven - leading very quickly to circularity. I am not comfortable pretending that an infinitely long list of grammars is contained within any medium currently available (if you happen to have developed some means of encoding an infinite amount of information, please let me know). So what is a first order language, and how do I know that $\mathcal{L}$ is first-order without knowing what a "number" is?


Clarification

I understand quite well the intended meaning of "first-order language." My issue is that I see no way of conveying this meaning in a purely mechanical, finitistic way. It is not possible to commit "first-order languages" to writing, because the totality of "first-order languages" is infinite - the best we can hope for is a finite set of instructions for generating arbitrary finite subsets of arbitrary first-order languages. In reality, this is all any author has ever actually done.

The reason I assume these instructions to take the form of a formal grammar is that this is how first-order logic is introduced. In identifying the class of first-order theories, authors often introduce a formal grammar (sometimes in the form of "inductive definitions," which are just production rules stated in English) to describe what a first-order language is.

The entire problem is easily resolved using conditional rewriting rules in place of a grammar - but I have never seen anyone do this.


For reference:

Bell and Slomson Models and Ultraproducts: An Introduction

Ben-Ari Mathematical Logic for Computer Science

Pudlák Logical Foundations of Mathematics and Computational Complexity

Weiss Fundamentals of Model Theory

Wikipedia First-order Logic

A few other books that I haven't read in a while go through the "from language to logic" process as well, and I will add them as soon as I find them.

R. Burton
  • 4,942
  • 2
    I don’t know the answer here, but when I was struggling with foundations of mathematics as an undergraduate, I at one point had the profound realisation that the foundational order is: Language → Mathematics → Logic and not vice versa, with the chain completed by … → Formalized Mathematics, within which lies Formalized Logic as a special case. So I bet that you’re at step “Logic”, which is not (fully) formalized and expecting something fully formalized, which only comes in the next step. – k.stm Jul 14 '20 at 22:33
  • 4
    Why does "is n-ary" have to be proven? The definition includes the assumption that you know what $n$ terms are and what an n-ary function symbol is. – John Douma Jul 14 '20 at 22:34
  • @JohnDouma The questioner probably expects a formalized definition of first-order language not using anything upon which first-order lanugage rests such as (formalized) notions of natural numbers. – k.stm Jul 14 '20 at 23:00
  • It would be helpful if you could cite the texts that you are having difficulty with."first-order langage" is standard terminology, but "first-order grammar" is not. In the standard terminology a first-order language is determined by a signature that associates an arity with each of a set of function symbols and a set of predicate symbols. You can derive a grammar from a signature in a fairly obvious way. – Rob Arthan Jul 14 '20 at 23:26
  • ... and as regards your final point, the mathematics of strings of symbols and the mathematics of natural numbers are equally mysterious. The good thing is that ever since shepherds first made marks on gates to count their sheep in and out, we have never have had any doubt about how to reconcile the two mysteries. – Rob Arthan Jul 14 '20 at 23:35
  • @JohnDouma it needs to be proven because we cannot assume that the meaning of "$n$ terms" and "$n$-ary" are understood a priori. – R. Burton Jul 14 '20 at 23:49
  • @RobArthan "first-order grammar" is not from any text, it is the term I am artificially using to refer to the thing which produces a first-order language. In regards to your second point, I find the idea of mystery unappealing in general. I am not comfortable accepting that because the natural-language explanation is sufficiently easy to comprehend, it is good enough. – R. Burton Jul 14 '20 at 23:54
  • @RobArthan I should add that I am quite familiar with first-order logic in general. The issue isn't my understanding, it's presenting first-order theories in a way that doesn't rely on a preexisting shared understanding or consensus (aside from the symbol ::= used in the production rules). – R. Burton Jul 15 '20 at 00:03
  • 5
    It's unclear to me what you're trying to achieve, and why. A definition of first-order language with no dependency whatsoever on any logical or numerical notions? Why should we think that's possible or desirable? And why do you think production rules don't carry any such baggage? You can write a parser for a first-order language on a computer if you can specify the inputs on the computer (symbols, arities, etc.). Is that not sufficient? Do we also not know what a real number is because we can't directly represent all of them on a computer? (These questions are largely rhetorical.) – blargoner Jul 15 '20 at 02:55
  • 1
    See George Tourlakis, Lectures in Logic and Set Theory. Volume 1 : Mathematical Logic (Cambridge UP; 2003): you can "minimize" the mathematical notions needed, but it is hard for me to imagine that you can avoid the use of some "basic" linguistic mechanisms, included elementary counting. – Mauro ALLEGRANZA Jul 15 '20 at 07:30
  • It seems that some of your concerns are similar to those in Define a model of N without set theory – Mark S. Jul 15 '20 at 13:07
  • @MauroALLEGRANZA Okay, but what is "basic"? Who decides what "basic" is? Certainly, there are languages in which the natural numbers don't exist - Pirahã for example. Are speakers of these languages somehow wrong? What language should they speak instead? Who decides this? – R. Burton Jul 15 '20 at 21:21
  • @MauroALLEGRANZA Setting aside the controversy surrounding language universals, the point is that "first-order language" is usually presented as a "purely syntactic" concept, something which is contradicted by the fact the introduction of "numbers" is part of the semantics of the language. If it is not possible to construct the hierarchy of first-order languages from a grammar then we need to build a theory in which the assertion "L is a first order language" has meaning. As it stands, I cannot say "L is a first order language," because the theory in which this is provable does not yet exist. – R. Burton Jul 16 '20 at 01:33
  • @R.Burton - quite non-sensical :-) Human language is the product of evolution, etc. Nobody "decided" it. Human language in turn "evolved" in time: some languages are very poor in terms of "counting" capabilities, while others (most of) have names for numbers and way to manage them. This is basic: if you have no language, you cannot read and write a book whatever, and thus neither a mathematical logic book. – Mauro ALLEGRANZA Jul 16 '20 at 06:12
  • The syntax of FOL is defined without mentioning semantical aspects (most of) but it is defined with natural language and the "meta"-language used has semantics: it speaks about a formal language. Language is unavoidably circular: we use it to speak of absolutely everything, language included. – Mauro ALLEGRANZA Jul 16 '20 at 06:14
  • @R.Burton When I asked these questions to one of my lecturers I was told to look into coherentism. Needless to say I wasn't very satisfied. I think your question is similar in its intent, at least, to mine: https://math.stackexchange.com/questions/3755965/mathematics-as-several-type-0-grammars Would I be correct to say that you want to eliminate the infinite regress? When I once asked about non-standard logics, I was told to look at Hilbert calculi, etc. Needless to say, you must use standard logic to determine if you're using the formalism correctly. Which is more miserable than not for me. – Threnody Jul 17 '20 at 23:34
  • @R.Burton that being said, I do not see mathematics as a means to acquire absolute truth. From my purist, formalist way of seeing things, mathematics is one of those Playstation 1 discs that contained 100s of minigames. – Threnody Jul 17 '20 at 23:37
  • @MauroALLEGRANZA It is entirely possible to represent the syntax of first-order languages without referencing the natural numbers, see my posted answer. – R. Burton Jul 22 '20 at 01:57

1 Answers1

1

Not only can the complete syntax of first order languages be defined in terms of a single grammar, this grammar is context-free. As a consequence, whether or not a given string is a formula in a first order language is decidable. The grammar is as follows...

$$\begin{align} &\langle formula\rangle&\to&\qquad\neg\langle formula\rangle\\ &&&\qquad\mid(\langle formula\rangle\langle connective\rangle\langle formula\rangle)\\ &&&\qquad\mid\langle quantifier\rangle\langle variable\rangle(\langle formula\rangle)\\ &&&\qquad\mid\langle relation\rangle\langle args\rangle\\ &\langle relation\rangle&\to&\qquad\langle relation\rangle_\text{I}\mid R\\ &\langle args\rangle&\to&\qquad ^\text{I}\langle args\rangle\langle term\rangle\mid\varepsilon\\ &\langle term\rangle&\to&\qquad\langle variable\rangle\mid\langle function\rangle\langle args\rangle\\ &\langle function\rangle&\to&\qquad\langle function\rangle_\text{I}\mid F\\ &\langle variable\rangle&\to&\qquad\langle variable\rangle_\text{I}\mid v\\ &\langle quantifier\rangle&\to&\qquad\exists\mid\forall \end{align}$$

...using $\langle formula\rangle$ as the start symbol, and $^\text{I},_\text{I},(,),\varepsilon,F,R,v,\exists,\forall$ as terminals. It is acceptable to exclude the connectives here solely because the set of functionally complete logical connectives is finite. It is possible to create a list of grammars for each set of logical connectives within a finite space, and I will do so if asked.

The language generated by this grammar includes all syntactically valid first-order formulas, and thus suffices to define the notion of "first-order languages." Note that constant symbols - and, incidentally, propositional variables (which is something that I did not expect) - are accounted for by $0$-ary function and relation symbols, respectively. The arity of a function or relation symbol is explicitly stated by the tallies in the upper index, while the tallies in the lower index serve to distinguish function/relation symbols of the same arity - e.g. $F_\text{II}^\text{III}$ is $\text{II}^\text{th}$ ($2^\text{nd}$) $\text{III}$-ary (3-ary) function symbol.

The resulting formulas necessarily match the arity of each function/relation symbol with an argument of the appropriate length. For example, the formula...

$$\exists v(\forall v_\text{I}((R_\text{II}^\text{II}vF^\text{II}v_\text{II}v_\text{IIII}\land\neg R_\text{I}^\text{II}v_\text{I}F_\text{III})))$$

...("$\exists x.\forall y.R_2(x,F(u,v))\land R_1(y,c)$, where $R_1,R_2$ are binary relations, $F$ is a binary function, and $c$ is a constant" in commonspeak) is well formed, while...

$$(\neg R_\text{I}^\text{III}F_\text{II}v\lor\exists v_\text{II}(R\land R^\text{II}v_\text{II}v))$$

...("$R_1(c,x)\implies\exists y.\varphi\land R(y,x)$, where $R_1$ is a ternary relation symbol, $R$ is a binary relation symbol, $c$ is a constant, and $\varphi$ is a propositional variable" in commonspeak) is not.

It is worth noting that the arity of a function/relation symbol is defined in terms of the list of arguments, instead of being "bound" to a specific function/relation symbol. This is actually rather profound - we cannot define a grammar where the arity of a function/relation symbol occurs in the righthand side of a production rule independently of the arguments; productions of the form...

$$\begin{align} &\langle formula\rangle&\to&\qquad\langle relation\rangle\langle args\rangle\\ &\langle term\rangle&\to&\qquad\langle function\rangle\langle args\rangle\\ &\langle relation\rangle&\to&\qquad\langle relation\rangle_\text{I}\mid\langle relation\rangle^\text{I}\mid R\\ &\langle function\rangle&\to&\qquad\langle function\rangle_\text{I}\mid\langle function\rangle^\text{I}\mid F\\ &\langle args\rangle&\to&\qquad\langle args\rangle\langle term\rangle\mid\varepsilon \end{align}$$

...where the nonterminals $\langle function\rangle$ and $\langle relation\rangle$ are replaced with function/relation symbols of a particular arity, yield invalid formulas. In other words, "arity" if it is to be considered a part of syntax, cannot be considered a property of function/relation symbols themeselves.

R. Burton
  • 4,942