Let $(A,<)$ be a nonempty linearly ordered set, and let $\operatorname{Seq}(A)$ denote the set of finite sequences of elements of $A$. That is, $f\in\operatorname{Seq}(A)$ is a function $f:n\to A$, where $n=\{0,1,\ldots,n-1\}$, $n\in\mathbb{N}$.
The shortlex (also called length-lexicographic) ordering $\prec$ on $\operatorname{Seq}(A)$ is the same as the lexicographic ordering, except that shorter sequences precede their extensions. That is, let $f=\langle f_{0},\ldots,f_{m-1}\rangle$ and $g=\langle g_{0},\ldots,g_{n-1}\rangle$. Then,
$f\prec g$ if and only if there exists $k<n$ such that either ($f_{i}=g_{i}$ for all $i<k$ and $f_{k}<g_{k}$) or ($f_{k}$ is undefined).
That is, $f\prec g$ if and only if either $m<n$ or $m=n$ and there exists $k<n$ such that $f_{i}=g_{i}$ for all $i<k$ and $f_{k}<g_{k}$
I can show that $(\operatorname{Seq},\prec)$ is a linearly ordered set.
If $(A,<)$ is well-ordered, I am trying to show that $(\operatorname{Seq},\prec)$ is also well-ordered. But I cannot complete my argument, which proceeds as follows:
Let $X\subseteq\operatorname{Seq}(A)$ be nonempty. Then, it is reasonable to try to find the least element of $X$ among the shortest sequences it contains. The set $$\{n\in\mathbb{N}:\text{there exists $f\in X$ having length $n$}\}$$ is nonempty, and so it has a least element, say $l\in\mathbb{N}$.
Let $X_{l}$ denote the set of all sequences of $X$ having length $l$ (which is nonempty since $X$ is nonempty). It is clear from the definition of $\prec$ that the least element of $X_{l}$ (if it exists) will be the least element of $X$.
Define a sequence $s$ recursively as follows:
- $s_{0}=\text{least $a\in A$ such that there exists $f\in X_{l}$ with $f_{0}=a$}$. This is well-defined, since we know the set $B_{0}=\{a\in A:\text{there exists $f\in X_{l}$ with $f_{0}=a$}\}$ is a nonempty subset of $A$ (since $X_{l}$ is nonempty), so it has a least element.
- $s_{i+1}=\text{least $a\in A$ such that there exists $f\in X_{l}$ with $f_{i+1}=a$ and $f_{j}=s_{j}$ for all $j\leq i$}$ (if such $a$ exists)
The sequence $s$ thus obtained is undefined for $i\geq l$, so it is a finite sequence $\langle s_{0},\ldots,s_{l-1}\rangle$ of length $l$.
Question 1: How do we know $s\in X_{l}$? The set $B_{0}$ is nonempty, so there exists $f\in X_{l}$ with $f_{0}=s_{0}$. This seems like the base case of a proof by induction (on $l$) that there will be an $f\in X_{l}$ with $f_{i}=s_{i}$ for all $i<l$. Am I heading in the right direction?
Question 2: What version of the Recursion Theorem fits the pattern of the recursive definition of $s$ I gave? The two versions of the Recursion Theorem I am aware of are:
First version:
For any set $A$, any $a\in A$ and any function $g:A\times\mathbb{N}\to A$, there exists a unique infinite sequence $f:\mathbb{N}\to A$ such that
- $f_{0}=a$;
- $f_{i+1}=g(f_{i},i)$ for all $i\in\mathbb{N}$.
Second version:
For any set $A$ and any function $g:\operatorname{Seq}(A)\to A$ there exists a unique sequence $f:\mathbb{N}\to A$ such that $$f_{n}=g(\langle f_{0},\ldots,f_{n-1}\rangle)\;\text{ for all $n\in\mathbb{N}$}$$ where $f_{0}=g(\langle\rangle)=g(\emptyset)$.
This is related.