Trying to implement the naturals in Mathematica, I follow E. Mendelson, Introduction to Mathematical Logic, Ch. 3, Par. 1. Here is my code for the axioms (exept the induction axiom)
Naxioms = {ForAll[{x, y, z}, Implies[x == y, Implies[x == z, y == z]]],
ForAll[{x, y}, Implies[x == y, next[x] == next[y]]],
ForAll[x, zero != next[x]], ForAll[{x, y}, Implies[next[x] == next[y], x == y]],
ForAll[x, plus[x, zero] == x],ForAll[{x, y}, plus[x, next[y]] == next[plus[x, y]]],
ForAll[x, mul[x, zero] == zero],ForAll[{x, y}, mul[x, next[y]] == plus[mul[x, y], next[x]]]};
However, I fail with it, proving a simple theorem
FindEquationalProof[ForAll[x, plus[zero, x] == x], Naxioms]
FindEquationalProof::invs: Invalid specification of propositions !(*SubscriptBox[([ForAll]), ({x})](plus[zero, x] == x)) and axioms {!(*SubscriptBox[([ForAll]), ({x, y, z})]((x == y [Implies] ((x == z [Implies] y == z))))),!(*SubscriptBox[([ForAll]), ({x, y})]((x == y [Implies] next[x] == next[y]))),<<5>>,!(*SubscriptBox[([ForAll]), ({x, y})](mul[x, next[y]] == plus[mul[x, y], next[x]]))}
and the returned input. The questions arise: what is the reason? how to fix it? how to formulate the induction axiom?
Naxioms = { ForAll[{x, y}, plus[x, y] == plus[y, x]], ForAll[x, plus[x, zero] == x] };
works. $\endgroup$Language`EquationalProofDump`isEquationQ /@ Naxioms
returns{False, False, False, False, True, True, True, True}
$\endgroup$FindEquationalProof
is kind of broken for a lot of use cases like yours, unless there are subtle semantics ofForAll
that I'm not aware of. $\endgroup$FindEquationalProof
seems to suit first-order logic only. For example you cannot do second-order problems quantified over propositions like:FindEquationalProof[Exists[X, X[0]], {P[0], Q[0]}]
expecting to getP[0]
orQ[0]
unifyingX
withP
orQ
. You may want to try Prolog, TLA+, z3, Lean theorem prover, perhaps. $\endgroup$Language`EquationalProofDump`waldmeister
. Also check here: mpi-inf.mpg.de/departments/automation-of-logic/software/… ...Stephen Wolfram has employed our system to carry out investigations in the area of singleton axiom systems for Boolean algebra... . So it wouldn't surprise me if that's being used as part ofFindEquationalProof
. $\endgroup$