unfold app_rel, eqfraction in |- *.
intros x y z H' H'0; try assumption.
apply INTEGRAL_DOMAIN_simpl_l with (den y).
auto with algebra.
apply Trans with (ring_mult (ring_mult (den y) (num x)) (den z)).
auto with algebra.
apply Trans with (ring_mult (ring_mult (num x) (den y)) (den z)).
auto with algebra.
apply Trans with (ring_mult (ring_mult (num y) (den x)) (den z)).
auto with algebra.
apply Trans with (ring_mult (ring_mult (den x) (num y)) (den z)).
auto with algebra.
apply Trans with (ring_mult (den x) (ring_mult (num y) (den z))).
auto with algebra.
apply Trans with (ring_mult (den x) (ring_mult (num z) (den y))).
auto with algebra.
apply Trans with (ring_mult (ring_mult (den x) (num z)) (den y)).
auto with algebra.
apply Trans with (ring_mult (ring_mult (num z) (den x)) (den y));
auto with algebra.
Qed.
Definition fraction_set : SET.
apply (Build_Setoid (Carrier:=fraction) (Equal:=eqfraction)).
red in |- *.
split; [ try assumption | idtac ].
exact eqfraction_refl.
red in |- *.
split; [ try assumption | idtac ].
exact eqfraction_trans.
exact eqfraction_sym.
Defined.
Definition addfraction_fun (x y : fraction_set) : fraction_set :=
Build_fraction
(sgroup_law R (ring_mult (num x) (den y)) (ring_mult (num y) (den x)))
(ring_mult (den x) (den y))
(INTEGRAL_DOMAIN_prop_rev (den_prf x) (den_prf y)).
Definition opfraction_fun (x : fraction_set) : fraction_set :=
Build_fraction (group_inverse R (num x)) (den x) (den_prf x).
Definition multfraction_fun (x y : fraction_set) : fraction_set :=
Build_fraction (ring_mult (num x) (num y)) (ring_mult (den x) (den y))
(INTEGRAL_DOMAIN_prop_rev (den_prf x) (den_prf y)).
Definition fraction1 : fraction_set :=
Build_fraction (ring_unit R) (ring_unit R) diff10.

Lemma addfraction_law_l :
forall x x' y : fraction_set,
Equal x x' -> Equal (addfraction_fun x y) (addfraction_fun x' y).