Homomorphism theorems for graphs