Well, relational algebra isn't set theory (one deals with relations, the other deals with sets, after all).
What's "unmathematical" is asking for the row before or after another one in the table. The principles of relational algebra (which is what relational databases are based on) mean that the rows of a table can be freely swapped about with each other without any change to the information stored in the table. There is no such thing as "the row before" another; all the ordering happens afterward.
Another suggested method to go with the ones above - assuming there aren't millions of states involved - would be to select all of them (if the column is indexed the table itself can be avoided), sort them however, then pick out whichever items are wanted and use those in a selection.
A relational solution would be to have a relation with attributes for state, preceding state, and following state. In other words, store the relevant data in the database.