Checks if a morphism is a homomorphism.