2

I'm trying to figure out this problem, without any luck now. Maybe you can help me. Suppose we have a first order logic with functions and predicates. We pick a signature, that consists of operation symbols: S^1, +^2, *^2 and a predicate symbol =^2(symbol and number or arguments).

We pick the natural implementation for this symbols, and we only work on natural numbers, including zero.

Now we can do things like this:

nonZero(n) := exists x. S(x) = n
isZero(n) := !nonZero(n)
isOne(n) := exists x. S(x) = n \/ isZero(x)
lessOrEqual(a,b) := exists y. a + y = b
divides(a,b) := exists y. a * y = b

And so on. Also I have the Gödel's β function available, S(x,c) which can map any finite sequence to constance c.

This thing might be called Peano arithmetic, but I'm not sure about this.

Suppose we have this function:

pair(x,y) := (x + y) * (x + y) + x

which works kinda the same as an operation symbol.

I need to create two other functions, fst and snd so that fst(pair(x,y)) = x and snd(pair(x,y)) = y

I thought that I can do it like this:

isFst(x, c) : exists b. (b * b <= c) & (Sb * Sb > c) & (b * b + x = c)

isSnd(y, c) : exists b. (b * b <= c) & (Sb * Sb > c) & exists x. isFst(x, c) & (x + y = b)

But it does not hold the equations above.

Can you help me? Maybe I'm missing something.

EDIT:

Firstly, I'm not good at this. Second, I don't know exactly, what my prof wants. From my perspective we have a function

pair(x,y) = (x+y)*(x+y)+x

which takes two numbers, and returns one. It works like a a+b function, which takes two numbers and returns a single one.

On the other hand, isFst is a predicate. It takes two numbers and returns TRUE or FALSE.

But I think, that I was given a task to make a function fst that takes one number and returns one number.

When I said that equation does not hold, I meant that isFst takes two arguments, but fst takes only one.

Then I thought that I can do it like this:

isFst(x,pair(x,y)) which is actually the same as fst(pair(x,y)) = x, so the predicate will be fst(c) = x := exists b. pair(x, b) = c

I saw this in a book, that I attach the screenshot to:

Gödel's Theorems and Zermelo's Axioms

So my main question is if the predicate can become a function?

And yes, can you show "the function fst from ℕ to ℕ is definable in the language of PA" this?

  • Can you explain what you think is wrong with your definitions? Also, why can't you just say isFst(x, c) := exists b. pair(x, b) = c? – Izaak van Dongen Aug 09 '22 at 09:10
  • @IzaakvanDongen I agree, your formula also work. But for you formula(and mine) the equation fst(pair(x,y)) = x does not hold. – nutella_eater Aug 09 '22 at 09:38
  • Please could you spell out what you mean by "the equation fst(pair(x, y)) = x does not hold"? For which values of $x$ and $y$ do you think it doesn't hold? Are you concerned about the fact that fst is not a total function? Or the fact that we have not given an explicit formula for it? The first is easily fixed, which shows "the function fst from $\Bbb N$ to $\Bbb N$ is definable in the language of PA". Is this what you want to show? If not, perhaps you could give a little more context so we can understand what you are trying to achieve. – Izaak van Dongen Aug 11 '22 at 10:13
  • @IzaakvanDongen hi! I've updated my question! – nutella_eater Aug 11 '22 at 14:38
  • Please give me the Peano axioms you're allowed to work with. I need to know exactly how addition and multiplication are defined in those axioms so we can proceed. – ShyPerson Aug 11 '22 at 21:55
  • @ShyPerson I think that its not Peano arithmetic. This is called Elementary Arithmetic(although I doubt this is an English name for it), because it works with natural numbers only. This is actually FOL with functions. And we are given with 3 functions: add, mul, succ, and one predicate: equals. Then we pick the interpretation for this functions. This interpretation is called normal, because we think of functions as regular addition, multiplication etc. Same with equality. I was not given with any axioms. – nutella_eater Aug 11 '22 at 22:33
  • @ShyPerson I guess you can refer to this https://www.cmu.edu/dietrich/philosophy/docs/tech-reports/134_Avigad.pdf which describes what I'm talking about. There are some axioms there. Although my signature lacks pow operation. – nutella_eater Aug 11 '22 at 22:37
  • Could you give a reference to the book so we can look at it? – ShyPerson Aug 12 '22 at 05:02
  • I'm talking about the book the screenshot came from. – ShyPerson Aug 12 '22 at 05:19
  • And do you have a printed form of the question you were given to solve? Please show it in a screenshot. – ShyPerson Aug 12 '22 at 05:20
  • I understand your issue a lot better now! Indeed you can say you've defined a function if you've defined its graph - ie you've given a necessary and sufficient condition for $f(x) = y$. This is what functions actually are in set theory, and in logic, functions are called definable if you can give such a condition in the first-order language you happen to be working in. Definable functions are very important for all the Goedel's theorem stuff! If you have shown $f$ is definable, then you can make a statement $P(f(x))$ involving an output of $f$ by saying $(\exists y)(y = f(x) \land P(y))$. – Izaak van Dongen Aug 12 '22 at 11:28
  • @IzaakvanDongen what do you mean by graph? Should I draw it? What is the "sufficient condition"? How should I show that pair, fst are definable in first order language? Is it pair (x,y) = c := (x + y) (x + y) + x = c and fst(c) = x := exists b. pair(x, b) = c ? But this are not functions, this are predicates! – nutella_eater Aug 12 '22 at 11:49
  • In this case "to show $f$ is definable in the language of PA" indeed exactly means "exhibit such a predicate using this language that's equivalent to $f(x) = y$". Our ultimate goal here is presumably something like constructing some complicated formula in the language of PA that holds in $\Bbb N$ but is not provable in PA. To make this formula, it will be useful to construct some intermediate formulas that make use of definable functions - and as I showed in my previous comment, once you have shown a function is definable, you can make reference to it from inside a formula. – Izaak van Dongen Aug 12 '22 at 14:01
  • @IzaakvanDongen sorry, but I still don't understand what you are trying to say. Does any of my statements true? Can you give an example, showing that some meaningful function is definable? And then use this function in some formula. – nutella_eater Aug 12 '22 at 18:38

2 Answers2

1

Imagine you were tasked with recapitulating something close to the relatively simple proof of the halting problem inside Peano arithmetic. In the case of the halting problem, the proof is pretty simple because it's based on a relatively powerful architecture called a Turing machine. You are now tasked with recapitulating that proof inside Peano arithmetic using only addition and multiplication, a very weak architecture indeed.

You are now stuck with having to implement most of a programming language based only on the operations addition and multiplication. This includes substantial data structures as well as a parser at least. Where to begin? One idea would be to copy an existing programming language. Fortunately, several such languages exist, notably Lisp. In Lisp, all the data structures are built on one fundamental data structure: a pair. In Lisp, such a pair is called a cons cell; in Scheme, this thing is called a pair. To use such a pair, we need to define accessors to get to the first element of the pair as well as the second element of the pair.

So here we find ourselves on your question. We have to define a pair based on addition and multiplication. And so we can see in your page from your attached textbook that the authors are doing just that. But they're doing it in a somewhat dodgy way. They're creating a quadratic function based on addition and multiplication. This is fine until one wants to extract $x$ and $y$ back from $c$. At this point this requires square roots, but these are not closed over the natural numbers. So they define the function implicitly using logic. Luckily this works fine for a mathematical proof, even though this can't work in any efficient way if at all in creating an actual programming language.

So to get to your questions: first, the $\text{fst}(c)$ function is defined implicitly on the page you enclosed from the textbook as I described in the previous paragraph. Second, the definition is based only on the standard logical operators as well as addition and multiplication so the function is indeed defined in terms of Peano arithmetic.

ShyPerson
  • 1,720
0

To your first question, yes, there is no problem transforming a predicate into a function using the "if and only if" operator.

In the other hand, first of all fst is not a function from $\mathbb N$ to $\mathbb N$. This is to de fact that are natural numbers that cannot be form with the operator pair, for example 3. A side from this, the construction of it shows that it is definable in the language of PA, due to the fact that we have only used definitions that at their base come from first-order logic and the functions S,+,* that come from the PA itself.