Section Def.
Variable R : INTEGRAL_DOMAIN.
Variable diff10 : ~ Equal (ring_unit R) (monoid_unit R).
Set Strict Implicit.
Unset Implicit Arguments.
Record fraction : Type :=
{num : R; den : R; den_prf : ~ Equal den (monoid_unit R)}.
Set Implicit Arguments.
Unset Strict Implicit.
Hint Resolve den_prf: algebra.
Definition eqfraction (x y : fraction) :=
Equal (ring_mult (num x) (den y)) (ring_mult (num y) (den x)).
red in |- *.
intros x; red in |- *.
red in |- *.
auto with algebra.
Qed.
Definition fraction0 := Build_fraction (monoid_unit R) (ring_unit R) diff10.
intros x; try assumption.
case x; unfold eqfraction, fraction0 in |- *; simpl in |- *.
intros numer denom H' H'0; try assumption.
apply Trans with (ring_mult numer (ring_unit R)); auto with algebra.
apply Trans with (ring_mult (monoid_unit R) denom); auto with algebra.
Qed.
intros x; try assumption.
case x; unfold eqfraction, fraction0 in |- *; simpl in |- *.
intros numer denom H' H'0; try assumption.
apply Trans with numer; auto with algebra.
apply Trans with (monoid_unit R); auto with algebra.
Qed.
red in |- *.
unfold app_rel, eqfraction in |- *; auto with algebra.
Qed.

Lemma eqfraction_trans : transitive eqfraction.