intuition.
assert (modNat x p < p).
eapply modNat_lt.
assert (modNat y p < p).
eapply modNat_lt.
rewrite modNat_plus in H.
unfold modNatAddInverse in *.
rewrite minus_add_assoc in H; intuition.
rewrite plus_comm in H.
apply modNat_divides in H.
destruct H.
remember (modNat x p) as a.
remember (modNat y p) as b.
assert (p + a >= p).
omega.
assert (p + a < 2 * p)%nat.
omega.
assert (p + a - b < 2 * p).
omega.
assert (p + a - b > 0).
omega.
assert (x0 * p > 0).
omega.
assert (x0 * p < 2 * p).
omega.
destruct x0.
omega.
destruct x0.
simpl in H.
rewrite plus_0_r in H.
omega.
assert (p > 0).
eapply posnat_pos.
simpl in H7.
remember (x0 * p)%nat as c.
omega.
Qed.

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