1

How can I prove that the following function is neither injective nor surjective? How can I change the domain and codomain in order to make the function both injective or surjective?

All finite subsets of Z→ Z given by h(L) = |L|.

My main challenge is to understand the function itself and not the definition of injection and surjection.

Thanks

Bob_Bobb
  • 339

1 Answers1

4

This function takes in a finite subset of $\mathbb{Z}$ and outputs its cardinality. For instance, $$h(\{-2,0,5\}) = 3, \quad h(\emptyset) = 0, \quad h(\{1,2,\dots,n\}) = n.$$ To show that this function is not injective, it suffices to find two different finite subsets of $\mathbb{Z}$, $A \neq B$, such that $h(A)=h(B)$. That is, $|A|=|B|$. Non-injectivity means the doman of $h$ is too big - there are too many sets that map to the same value. So to fix this, you want to restrict the domain of $h$ so that there is at most one set of any given size.

To show that this function is not surjective, it suffices to find an integer $z$ such that there is no finite subset $A \subseteq \mathbb{Z}$ with $f(A)=|A|=z$. (Hint: The cardinality of a finite set is always nonnegative.) Non-surjectivity means that the codomain of $h$ is too big - there are elements in the codomain that are not mapped to by any element in the domain. To fix this, you need to restrict the codomain so that each element has a corresponding finite subset of $\mathbb{Z}$ in the domain of that size.

kccu
  • 20,808
  • 1
  • 22
  • 41
  • This is a great explanation, can you elaborate on " you need to restrict the codomain so that each element has a corresponding finite subset of ℤ in the domain of that size." Maybe to share an example? Thanks! – Bob_Bobb Sep 22 '19 at 20:51
  • @King_Iverson I think this will be clear to you once you figure out why $h$ is not currently surjective. This is just a matter of removing the values in the codomain that you can't get out of $h$. – kccu Sep 22 '19 at 20:56
  • got it. Is there a way to make this function injective without changing the mapping? (changing only the domain and codomain). Thanks! – Bob_Bobb Sep 22 '19 at 21:46
  • Yes, as I said you have to pare down the domain until no two elements map to the same value. Said another way, for each value $n$ in the range, you need to choose just one set of size $n$ that you'll keep in the domain. (Or you could have no sets of size $n$ in the domain.) – kccu Sep 22 '19 at 23:24