prove that formula exists in first order logic expressing complete binary tree of depth $n$

255 Views Asked by At

Prove that for each finite binary tree $T$ there exists formula in first order logic $\phi_n$ such that $T\models \phi_n$ iff $T$ is complete binary tree with depth $n$. Structure is two binary relations: $L(x,y)$ iff $y$ is left son of father $y$, and analogically for $R(\cdot, \cdot)$. Additional difficulty is fact that formula can use only two variables, but it is possible to requantify them.

Being honestly I have no idea how to start. First of all, I don't know how to think about it - I have no root, moreover I have never solved similiar exercise. I ask for help :)

1

There are 1 best solutions below

3
On BEST ANSWER

Let $$\psi_0(x)\equiv \forall y\,(\neg L(x,y)\land\neg R(x,y))$$ ("$x$ is a leaf" or: "the subtree rooted at $x$ is complete binary of depth $0$") and then recursively $$\psi_{n+1}(x)\equiv \exists y\,(L(x,y)\land\psi_n(y))\land \exists y\,(R(x,y)\land\psi_n(y)).$$ Finally, $$\phi_n\equiv \exists x\,(\psi_n(x)\land \forall y \,(\neg L(y,x)\land \neg R(y,x))) $$