rattac.
eapply H0.
unfold posnatMult, natToPosnat, posnatToNat in *.
destruct p1.
destruct p0.
rewrite mult_plus_distr_r in l.
rewrite <- mult_assoc in l.
rewrite (mult_comm x) in l.
assert ((n1 * x0 * x0) = O)%nat.
remember (n0 * (x0 * x))%nat as a.
remember (n1 * x0 * x0)%nat as b.
omega.
apply mult_is_O in H1;
intuition;
subst.
apply mult_is_O in H2;
intuition;
subst.
apply rat_num_0.
omega.
omega.
Qed.
(* relational versions of arithmetic operations. *)
Definition ratSubtract_rel (r1 r2 : Rat -> Prop) d :=
forall r1' r2', r1 r1' -> r2 r2' -> d == ratSubtract r1' r2'.
Definition ratAdd_rel(r1 r2 : Rat -> Prop) r :=
forall r1' r2', r1 r1' -> r2 r2' -> r == r1' + r2'.
Definition ratMult_rel (r1 r2 : Rat -> Prop)(r : Rat) :=
forall r1' r2', r1 r1' -> r2 r2' -> r == r1' * r2'.
Definition expRat_rel (r1 : Rat -> Prop) n r :=
forall r1', r1 r1' -> r == expRat r1' n.
Definition ratInverse_rel (r : Rat -> Prop) v :=
forall r',
r r' -> v == ratInverse r'.

(* Specifications: *)
Lemma eqRat_flip : forall (p1 p2 p3 p4 : posnat),
RatIntro p1 p2 == RatIntro p3 p4 ->
RatIntro p2 p1 == RatIntro p4 p3.