Determining if relations are functions