Let $X=<x_1,x_2,…,x_m>$ and $Y=<y_1,y_2,…,y_n>$ be sequences and let $Z=<z_1,z_2,…,z_k>$ a longest common subsequence (LCS) of $X$ and $Y$.Then:
If $x_m=y_n$,then $z_k=x_m=y_n$ and $Z_{k-1}$ is a LCS of $X_{m-1}$ and $Y_{n-1}$
If $x_m \neq y_n$ and $z_k \neq x_m$,it implies that $Z$ is a LCS of $X_{m-1}$ and $Y$
- I haven't understood why $x_m=y_n \Rightarrow z_k=x_m=y_n$. $$$$
If we have for example $X=<A,B,E,A,F,A>$ and $Y=<D,F,B,A>$, should the last element of $Z$ be $A$,or can it also be $F$ or $B$ and we could write $A$ at which position we want?
$$$$
- At the second sentence,why do we conclude that $Z$ is a LCS of $X_{m-1}$ and $Y$ ?
CS stands for common subseseuqnce and LCS stands for longest common subsequence
Firstly, by definition, we call $b_k = a_{n_k}, k=1,2,\cdots$ a subsequence of $(a_n)_{n=1,2,\cdots}$ if $n_k$ is strictly increasing as a function of $k$.
Using your example, if $X = <A,B,E,A,F,A>$, then $<A,E,F,A>$ is its subequence but $<F,E,B>$ is not. Although all the three elements(F, E and B) are contained in $X$, they don't appear in the right order.
Then we have $X=<x_1,x_2,…,x_m>$, $Y=<y_1,y_2,…,y_n>$ and $Z=<z_1,z_2,…,z_k>$ is a LCS of X and Y. We prove if $x_m =y_n$ then $z_k = x_m=y_n$ by contradiction.
Suppose $z_k \neq x_m$, then we can construct another CS of $X$ and $Y$ by adding $x_m$(i.e.$y_n$) at the end of $Z$, but the new CS is longer than $Z$, which is contradictory with the fact that $Z$ is a LCS. Thus we have proven if $x_m =y_n$ then $z_k = x_m=y_n$
Now since $z_k=x_m=y_n$, obviously $Z_{k-1}$ is a CS of $X_{m-1}$ and $Y_{n-1}$. If $X_{m-1}$ and $Y_{n-1}$ has a CS longer than $Z_{k-1}$, then by adding $z_k$ at the end of this new CS, we get a CS of $X$ and $Y$, which is longer than $Z$. Contradiction
Next, we will prove $x_m \neq y_n$ and $z_k \neq x_m$ implies that $Z$ is a LCS of $X_{m-1}$ and $Y$.
Since $z_k \neq x_m$, $Z$ is a subsequence of $X_{m-1}=<x_1,x_2,\cdots,x_{m-1}>$, thus it is a CS of $X_{m-1}$ and $Y$. It is the longest one because if there is another one longer than it, then this longer one will also be CS of $X$ and $Y$, thus in contradiction with the fact that $Z$ is a LCS of $X$ and $Y$. So $Z$ has to be a LCS of $X_{m-1}$ and $Y$