intros x y.
simple induction a.
auto.
intros x0 w Hyp inmonoid_X_cons_x0_w Der_x_y.
change (Deriveg X R (cons x0 (Append w x)) (cons x0 (Append w y))) in |- *.
apply Deriveg2.
apply inmonoid_cons_inv2 with w; assumption.
apply Hyp.
apply inmonoid_cons_inv with x0; assumption.
assumption.
Qed.

Lemma Derive_P_A_3_imp_Derivegstar :
forall x y x' y' s s' : Word,
Derive_P_A_3 (s, (x, y)) (s', (x', y')) ->
inmonoid X s -> Derivegstar X R (Append s x) (Append s' x').