End BOOLEAN_EQUALITY.
Fixpoint prev_append (i j: positive) {struct i} : positive :=
match i with
| xH => j
| xI i' => prev_append i' (xI j)
| xO i' => prev_append i' (xO j)
end.
Definition prev (i: positive) : positive :=
prev_append i xH.

Lemma prev_involutive i :
prev (prev i) = i.