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:
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?

isFst(x, c) := exists b. pair(x, b) = c? – Izaak van Dongen Aug 09 '22 at 09:10fst(pair(x, y)) = xdoes not hold"? For which values of $x$ and $y$ do you think it doesn't hold? Are you concerned about the fact thatfstis 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 functionfstfrom $\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