intuition.
unfold minRat.
case_eq (bleRat r1 r2); intuition;
case_eq (bleRat r3 r4); intuition.
apply bleRat_total in H2.
eapply leRat_impl_eqRat;
eauto using leRat_trans, eqRat_impl_leRat, eqRat_symm.
apply bleRat_total in H1.
eapply leRat_impl_eqRat;
eauto using leRat_trans, eqRat_impl_leRat, eqRat_symm.
Qed.
Add Parametric Morphism : minRat
with signature (eqRat ==> eqRat ==> eqRat)
as minRat_eqRat_mor.
intuition.
eapply minRat_eqRat_compat; trivial.
Qed.

Theorem ratDistance_eqRat_compat : forall r1 r2 r3 r4,
r1 == r3 ->
r2 == r4 ->
ratDistance r1 r2 == ratDistance r3 r4.