Definition hackfun phi0 phi :=
level phi0 = level phi /\ ghost_of phi0 = ghost_of phi /\
forall loc, (identity (phi0 @ loc) <-> identity (phi @ loc)) /\
(~identity (phi0 @ loc) -> (phi0 @ loc = phi @ loc)).

Lemma Pos_to_nat_eq_S:
forall b, Pos.to_nat b = S (nat_of_Z (Z.pos b) - 1).