function to compare dual spaces