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_append_inj i j j' : prev_append i j = prev_append i j' -> j = j'.