induction x; intuition; simpl in *.
assert (S (x + y) = x + S y).
omega.
rewrite H0 in H.
clear H0.
assert (S (x + z) = x + S z).
omega.
rewrite H0 in H.
clear H0.
apply IHx in H.
destruct (modNat_correct (S y) p).
destruct (modNat_correct (S z) p).
rewrite H in H0.
assert (S y - x0 * p = modNat (S z) p).
omega.
assert (S z - x1 * p = modNat (S z) p).
omega.
rewrite <- H2 in H3.
assert (z - x1 * p = y - x0 * p).
omega.
assert (x1 * p + y = x0 * p + z).
omega.
apply modNat_correct_if in H5.
rewrite modNat_plus in H5.
rewrite modNat_mult in H5.
rewrite plus_0_l in H5.
auto.
Qed.

Lemma modNat_add_same_r : forall x y z p,
modNat (y + x) p = modNat (z + x) p ->
modNat y p = modNat z p.