intros p r; replace (S p) with (1 + p);
[ rewrite Zpower_nat_is_exp | auto with arith ].
rewrite Zpower_nat_1; ring.
Qed.

Theorem Zcompare_correct :
forall p q : Z,
match (p ?= q)%Z with
| Datatypes.Gt => (q < p)%Z
| Datatypes.Lt => (p < q)%Z
| Datatypes.Eq => p = q
end.