[EDIT/CONCLUSION] It turns out it was actually working.. I was just like too stupid to let the prover run for more time and assumed it would take a lot / not be able to prove with what I've provided because it wasn't doing it fast and because it took it ~1 minute with a similar goal asking for numbers lower or equal than 1. However, the goal I gave as an example in this post (leq(x,2)) took ~1 minute as well and for leq(x,5), it was actually able to prove it faster I think (~40 seconds if I recall correctly). Thank you very much to everyone who helped!!
[EDIT:] I apologize for not describing my axioms properly.. I have now written them so as they pretty much resemble what I actually wrote.
Hello and Happy New Year,
I am trying to define natural numbers in order to use them in a First-Order Logic Theorem Prover. The problem is I'm unable to solve the following problem:
"Show that the only numbers lower or equal than (for example) 2 are 0,1 and 2".
My axioms go like this: $$nat(0)$$ $$\forall x( nat(x) \to nat(s(x)) )$$ $$\forall x,y( (nat(x)\land nat(y)) \to nat(add(x,y))$$ $$\forall x( nat(x) \to (s(x) \neq 0) )$$ $$\forall x,y ( (nat(x) \land nat(y)) \to ( (s(x)=s(y)) \to (s=y)))$$ $$\forall x( (nat(x)\land x\neq 0) \to (\exists z (nat(z) \land (x = s(z)))))$$ $$\forall x(nat(x) \to (add(x,0) = x))$$ $$\forall x,y((nat(x)\land nat(y)) \to (add(x,s(y)) = s(add(x,y))))$$ $$\forall x,y((nat(x)\land nat(y)) \to ((leq(x,y) \leftrightarrow (\exists z(nat(z)\land (y = x + z) )))))$$
I have also added addition axioms for commutativity and associativity of addition.
So, what I'd like to be able to prove is something like this (for any number, not just for $2$):
$ \forall x(nat(x) \to (x\leq 2 \to (x = 0) \lor(x=1)\lor(x=2))) $.
Are additional axioms needed in order to be able to prove this?
These axioms are sufficient. Here's an outline of the proof in natural language:
Since $x\leq s(s(0))$, there exists $z$ such that $x + z = s(s(0))$.
Case 1: $z = 0$. Then $x = x + z = s(s(0))$, and we're done ($x = 2$). [Note that you've stated as an axiom $\text{add}(x,0) = 0$, and I assume you meant $\text{add}(x,0) = x$!]
Case 2: $z\neq 0$. Then there exists $y$ such that $z = s(y)$. Then $x + s(y) = s(s(0))$, so $s(x+y) = s(s(0))$, so $x+y = s(0)$.
We've managed to decrease the number of applications of $s$ by one. Now we repeat.
Case 1: $y = 0$. Then $x = x+y = s(0)$, and we're done ($x = 1$).
Case 2: $y \neq 0$. Then there exists $w$ such that $y = s(w)$. Then $x + s(w) = s(0)$, so $s(x+w) = s(0)$, so $x+w = 0$.
If $w = 0$, we're done, just as above ($x = 0$). Otherwise, $w = s(t)$, so $0 = x+ s(t) = s(x+t)$, and $0$ is a successor, contradiction.