Construction of a sequence function in Halmos' proof of the comparability theorem for well ordered sets using transfinite recursion
The proof mentioned is from Halmos's Naive Set Theory and is identical to the one described here and here. I have some trouble understanding the construction of the sequence function f below.
We assume that X and Y are non-empty well ordered sets such that neither is similar to an initial segment of the other; we proceed to prove that under these circumstances X must be similar to Y. Suppose that $a \in X$ and that t is a sequence of type a in Y; in other words t is a function from s(a) into Y. Let f(t) be the least of the proper upper bounds of the range of t in Y, if there are any; in the contrary case, let f(t) be the least element of Y.
(s(a) is the the initial segment of a in X)
My question is: In what kind of sets does "the contrary case" occur?
I've arrived at the conclusion that this will only happen if either Ran(t) has no upper bound or Ran(t) has only one upper bound $y \in Ran(t)$ due to X and Y both being well-ordered. But in the latter case, f wouldn't be one-to-one and X would (probably) not be similar to Y. I can't think of any set where Ran(t) doesn't have an upper bound. Can you help me out?
Thank you.
For instance, consider $X=Y=\{0,1\}$. Take $a=1$ and define $t:s(a)\to Y$ by $t(0)=1$. Then the image of $t$ has no strict upper bounds in $Y$, since $1$ is its largest element.