0

Suppose we have a language $\mathfrak{L}=\{\bf{C},\bf{P},\bf{F},\#\}$ consisting of constant, predicate, function symbols and an arity symbol for functions, $\#$, with alphabet $\Sigma(\mathfrak{L})$. We also include in this language all the logical symbols: conjunction, negation etc. as well as punctuation symbols: parentheses, commas ets.

Let the class of terms of $\mathfrak{L}$, denoted $Terms_{\mathfrak{L}}$, be defined as the least subset $X$ of $\Sigma(\mathfrak{L})^*$ such that

1) $X$ contains the variables and constant symbols of the language $Var(\mathfrak{L})\cup \bf{C} \subset X$.

2) $f\frown ( \frown t_1\frown...\frown t_n\frown) \in X$ whenever $t_1, ..., t_n \in X$.

Note: $^*$ is the kleene star, and $\frown$ denotes concatenation. I'm no expert, but I believe this is a standard way of defining a formal language.

Suppose we are in the universe of sets, so every element of the language (i.e. a sequence of symbols concatenated) is a set (here is one way to do this: Codification of a formal language in set theory.) I want to make a characteristic function for the class $Terms_{\mathfrak{L}}$, i.e. a function that returns 1 for every element of $\Sigma(\mathfrak{L})^*$that satisfies conditions 1) and 2) above, and returns 0 for all others. In other words, I want to construct the set of terms of this language.


Clearly, by condition 1) all constants and variable symbols are terms, so the difficulty here is in identifying all the terms of the form $f\frown ( \frown t_1\frown...\frown t_n\frown)$ for arbitrary $n \in N$

Naturally, the characteristic function on $Terms_{\mathfrak{L}}$ must be recursive. I have very little experience with recursion, so I'm not sure how to proceed. If I fix $n$ and take the string $f\frown ( \frown t_1\frown...\frown t_n\frown)$, then I know it is a term because it has parentheses and commas separating the terms $t_i$, and the first element of the string is a symbol from the set $\bf{f}$. But how can my characteristic function tell that a string looks like this for any arbitrary string?

Mike
  • 2,097
  • 4
    In set theory, it is usually easier to define terms, formulas, etc. as finitely branching finite trees. There's no reason to work with concatenation itself when you are working in set theory, and it is straightforward to see that we can convert finitely branching finite trees whose nodes are labeled from an alphabet to and from strings of symbols over the alphabet. But it is much more convenient to work with finite trees in set theory, because they can be directly represented as sets, unlike strings of symbols. – Carl Mummert Mar 11 '19 at 01:38
  • 1
    As I elaborated upon here, I completely agree with Carl Mummert. There is no advantage of rigor obtained by working with regards to sequences of symbols as opposed to syntax trees, and a large amount of unenlightening complexity added by doing so. – Derek Elkins left SE Mar 11 '19 at 02:00

1 Answers1

2

The full, formal, exact definitions are very much not the point, it's a good exercise to do once in your life, partially. Other than that, to quote one of my professors when I was a freshman "convince yourself that it's true".

The idea is that terms, or formulas, or whatnot, which are defined recursively, have a sequence of previously-defined terms.

A string in a language is a term if and only if it is an atomic term, or there is a (finite) sequence such that every member of the sequence is either atomic or is obtained from terms appearing before it in the sequence, and the last thing in the sequence is the term itself.

So, $f(x+y)$ is given by $(x,y,x+y,f(x+y))$, for example. Note that these sequences need not be unique!

And we can write the whole thing into the language of set theory, it's just relatively long and ugly. Although it's getting slightly better once you've written some basic formulas such as "$f$ is a finite sequence" etc.

Asaf Karagila
  • 405,794
  • I can see intuitively what is happening with $f(x+y)$ in your examples, however the 'full, formal, exact definitions' is what I'm after these days. It is very tedious, and I have a hard time coming up with everything on my own, that's why I post here hoping people will fill in the blanks.

    Do you know of any textbooks that go through these constructions in complete detail, with no appeal to the reader's intuition? I have tried to find the papers of the mathematicians who first made these constructions, but it's very hard to piece it all together.

    – Mike Mar 11 '19 at 00:12
  • I'm trying to replicate the sequence for $f(x+y)$ you used as an example in my case for $f(t_1,...,t_n)$. Here I don't have any operations, just terms $t_1$ in a row, so I don't see how I can obtain say $t_4$ from $t_3$.

    Something else I have in mind is to explicitly define the positions in the string where the $t_i$ are, and say that the string is a term if these explicit positions are terms, and apply it recursively to each $t_i$.

    – Mike Mar 11 '19 at 00:16
  • Work top down. Assume that you have the building blocks, that you know how to identify a finite sequence. Can you say something about whether or not it has this recursive properties? Start small, and work larger step by step. I am not here to write down a full-page definition for your convenience. I will waste my time, and you will learn nothing. I am here to help you make that understanding for yourself. – Asaf Karagila Mar 11 '19 at 00:18
  • Obtaining the terms from previous ones mean that you have some $k$-ary function symbol in your language, and $t_1,\dots,t_k$ appearing already in the sequence, and $f(t_1,\dots,t_k)$ is the next term. – Asaf Karagila Mar 11 '19 at 00:19
  • 1
    Work with specific examples at first. When Galileo tested acceleration he tested it. He tried it out. He didn't just wrote some equations and hoped they were true. Test things out with simple "toy models of mathematics". It will impart incredibly intuition, as well as mistakes (i.e., things which are true in your toy models but do not follow your proposed definitions) which are all invaluable tools for mathematical understanding. And now, good night. – Asaf Karagila Mar 11 '19 at 00:21
  • @Mike If you are interested in "full, formal, and exact" definitions, I would recommend looking at proof assistants. If you particularly want set theory, as opposed to type theory, Mizar is based on Tarski-Grothendieck set theory and you can find a formalization of well-formed formulas, for example, defined here. It is, of course, based on several other more primitive notions, such as finite sequences, whose formal definitions are linked. – Derek Elkins left SE Mar 11 '19 at 01:52
  • @DerekElkins Thanks, I'll definitely look into that. – Mike Mar 11 '19 at 01:55
  • @AsafKaragila would this definition suffice: If $x$ is a string in $\Sigma^(\mathfrak{L})$, then define the characteristic function of $Terms_\mathfrak{L}$ by $\chi(x)=1$ if $x \in \bf{C}$ or $x \in Var(\mathfrak{L})$ and if $x$ is an $n$-ary function, $\chi(f(t_1,...t_n))=\chi(t_1)...*\chi(t_n)$ – Mike Mar 11 '19 at 01:55