Def/Finite sequence

 

=Operations on sequences=

Reversion
Suppose that $a_0, \ldots, a_{n-1}$ is a sequence of elements of $X$. The defines::reversion, or defines::reverse sequence is the sequence $a_{n-1}, \ldots, a_0$. More formally, the reverse sequence is the function $rev(a) \colon n \rightarrow X$ defined by: $$rev(a)_i = a_{n - (i + 1)}, \mbox{ for all } i \in n.$$

Entrywise Operation
Suppose that $a_0, \ldots, a_{n-1}$ is a sequence of elements of $X$. Suppose that $Y$ is another set, and $f \colon X \rightarrow Y$ is a function. Then one may apply $f$ defines::entrywise to obtain a new sequence $f \circ a$, given by: $$(f \circ a)_i = f(a_i), \mbox{ for all } i \in n.$$

Similarly, if $a_0, \ldots, a_{n-1}$ is a sequence of elements of $X$, and $b_0, \ldots, b_{n-1}$ is a sequence of elements of $Y$, $Z$ is a set, and $g \colon X \times Y \rightarrow Z$ is a function, one may apply $g$ defines::entrywise to the sequences $a$ and $b$ to obtain a sequence $g(a,b)$, given by: $$g(a,b)_i = g(a_i, b_i).$$

Concatenation
Suppose that $a_0, \ldots, a_{n-1}$ is a sequence of elements of $X$, of length $n$, and $b_0, \ldots, b_{m-1}$ is another sequence of elements of $X$ of length $m$. Then, one may defines::concatenate the two sequences $a$ and $b$, to obtain a sequence $Conc(a,b)$ of length $n+m$, given by: $$Conc(a,b)_i = a_i \mbox{ if } 0 \leq i < n, \mbox{ and } Conc(a,b)_i = b_{i-n}, \mbox{ if } n \leq i < n+m.$$

Observe that $Conc(a, \emptyset) = Conc(\emptyset, a)$ for any sequence $a_0, \ldots, a_{n-1}$.