Let $x$ and $y$ be two nodes of a binary tree $B$.
Prove that $x$ is an ancestor of $y$ $\iff$ $x$ stands before $y$ in the pre-order traversal of $B$ and $x$ stands after $y$ in the post-order traversal of $B$.
I can do the $\implies$ part without trouble, but I can't deal with the converse with enough rigour.
Thanks for any kind of rigorous proof.
$\Longleftarrow$: Assume that (a) $x$ stands before $y$ in the pre-order traversal of $B$ and that (b) $x$ stands after $y$ in the post-order traversal of $B$.
Now assume that (c) $x$ is not an ancestor of $y$ (a proof by contradiction will follow). There are two cases:
(d) $y$ is not an ancestor of $x$: neither $x$ nor $y$ is the root, for otherwise one would be the ancestor of the other (contradicting either (c) or (d)). Thus there definitely exists at least one common ancestor. Let the lowest common ancestor $a$ be the first ancestor that you encounter when you trace the paths upward from $x$ and $y$ towards the root. There are three cases:
Since (c) results in only contradictions under the assumption of (a) and (b), its negation, i.e. that $x$ is an ancestor of $y$, must follow from the conjunction of (a) and (b).
Is this sufficiently rigorous?