Source: https://www.math.utah.edu/~schwede/MichiganClasses/math186/InjectiveAndSurjectiveFunctions.pdf