Automata - proving the reverse operation through induction N elements

221 Views Asked by At

I am facing some difficulties proving the reverse operation on N elements.

Let Σ be an alphabet, given a word x ∈ Σ∗ and rev(x) the reverse of x. I want to prove that

for n >= 1 and for  X1,X2,...,Xn ∈ Σ∗ 

rev (X1,X2,...,Xn) = rev(Xn),...,rev(X1)

I would appriciate your assistance.

2

There are 2 best solutions below

0
On BEST ANSWER

You can prove it by (strong) induction on $n$. The base case $n=1$ is trivial, since it just says that $\operatorname{rev}(x_1)=\operatorname{rev}(x_1)$. For the induction step you need to show that if $n>1$, and

$$\operatorname{rev}(x_1,\ldots,x_m)=\operatorname{rev}(x_m),\ldots,\operatorname{rev}(x_1)$$

for arbitrary $x_1,\ldots,x_m\in\Sigma^*$ whenever $1\le m<n$, then

$$\operatorname{rev}(x_1,\ldots,x_n)=\operatorname{rev}(x_n),\ldots,\operatorname{rev}(x_1)$$

for arbitrary $x_1,\ldots,x_n\in\Sigma^*$.

If $n>2$, you can let $y=x_1,x_2,\ldots,x_{n-1}$; then $x_1,\ldots,x_n=y,x_n$, so

$$\operatorname{rev}(x_1,\ldots,x_n)=\operatorname{rev}(y,x_n)=\operatorname{rev}(x_n),\operatorname{rev}(y)$$

by the induction hypothesis with $m=2$, and $\operatorname{rev}=\operatorname{rev}(x_{n-1},\ldots,x_1)$ by the induction hypothesis with $m=n-1$, so $\operatorname{rev}(x_1,\ldots,x_n)=\operatorname{rev}(x_n),\operatorname{rev}(x_{n-1}),\ldots,\operatorname{rev}(x_1)$, as desired.

Unfortunately, this still leaves the $n=2$ case to be dealt with: you have to show that for any $x_1,x_2\in\Sigma^*$, $\operatorname{rev}(x_1,x_2)=\operatorname{rev}(x_2),\operatorname{rev}(x_1)$. You can do this by writing out $x_1$ and $x_2$ in terms of elements of $\Sigma$ (e.g., $x_1=a_1a_2\ldots a_r$ and $x_2=b_1b_2\ldots b_s$) and expressing $\operatorname{rev}(x_1,x_2)$, $\operatorname{rev}(x_1)$, and $\operatorname{rev}(x_2)$ directly in terms of elements of $\Sigma$.

A more formal approach requires defining the reversal operation more formally, first on strings of elements of $\Sigma$ (i.e., on members of $\Sigma^*$), then on strings of elements of $\Sigma^*$ (which is what you need here). The former is done in this question.

3
On

Because it's evident...? If this is not enough, you could say that for two finite words a and b, Rev(ab)=Rev(b)Rec(a) and then conclude by induction.