[definition: String Operations]
Fix an alphabet $\Omega$. The following operations and conventions apply:
- **Natural numbers**: $\mathbb{N} := \{1, 2, 3, \ldots\}$. For indexing string positions and lengths, we use the von Neumann ordinal construction extended to include $0$: write $\mathbb{N}_0 := \{0, 1, 2, \ldots\} = \mathbb{N} \cup \{0\}$, and identify each $n \in \mathbb{N}_0$ with the set $\{0, 1, \ldots, n-1\}$ of all smaller non-negative integers. The string space is then $\Omega^\star = \bigcup_{n \in \mathbb{N}_0} \Omega^n$.
- **String length**: For $\alpha \in \Omega^n$, we write $|\alpha| = n$.
- **Empty string**: $\Omega^0 = (0 \to \Omega)$ has exactly one element, $\varepsilon$, the empty sequence.
- **Truncation**: For $\alpha \in \Omega^n$ and $k \leq n$, the truncation $\alpha|_k \in \Omega^k$ is the unique sequence of length $k$ such that $\alpha|_k \subseteq \alpha$ (viewing sequences as functions, $\alpha|_k$ is the restriction of $\alpha$ to $\{0, \ldots, k-1\}$).
- **Concatenation**: For $\alpha \in \Omega^m$ and $\beta \in \Omega^n$, their concatenation $\alpha\beta \in \Omega^{m+n}$ is defined piecewise:
\begin{align*}
(\alpha\beta)(i) = \begin{cases} \alpha(i) & i < m \\ \beta(i - m) & m \leq i < m + n. \end{cases}
\end{align*}
- **Powers of strings**: By recursion, $\alpha^0 := \varepsilon$ and $\alpha^{n+1} := \alpha \cdot \alpha^n$.
- **Singletons**: An element $x \in \Omega$ is identified with the string $(x) \in \Omega^1$.
- **Language concatenation**: For sets $Y, Z \subseteq \Omega^\star$, write $YZ := \{\alpha\beta \mid \alpha \in Y,\, \beta \in Z\}$. For a singleton $Y = \{\alpha\}$, write $\alpha Z := \{\alpha\beta \mid \beta \in Z\}$.
- **Functorial lift**: A function $f: \Omega \to \Lambda$ lifts to a function $\hat{f}: \Omega^\star \to \Lambda^\star$ by applying $f$ componentwise. The hat is often omitted when context is clear.
[/definition]