Shortlex predecessor
Haskell, 64, 63, 56, 55 bytes


c is an infinite list of all strings composed of 97..122 in shortlex order.
\x y -&gt; last$fst$span(/=x)y gives the predecessor of x in y




a b=last$fst$span(/=b)c
c=[]:[d++[e]|d&lt;-c,e&lt;-[97..122]]


Try it online!


1 byte saved by using code points: [97..122] vs. ['a'..'z']
9 bytes saved by ovs
1 bytes saved by Laikoni


Shortlex optimality

To get the lowest-ordered version of this code:


Each variable is chosen to be the smallest, front-to-back
The two lines are sorted (' ' &lt; '=')