How to calculate number of elements in HomSet

458 Views Asked by At

Im giving category theory a chance but have very limited math background, I'm learning from the book "Category theory for the sciences" but got lost on page 16 :)

Exercise 2.1.2.12. Let $A=\{1,2,3,4,5\}$ and $B=\{x,y\}$.

  1. How many elements does $\operatorname{HomSet}(A,B)$ have?
  2. How many elements does $\operatorname{HomSet}(B,A)$ have?

My thinking is that $\operatorname{HomSet}(A,B) = \operatorname{HomSet}(B,A) = 10$ since there are 10 ways i can map and element in $A$ to an element in $B$ but I'm clearly missing the whole point since this is not the correct answer.

2

There are 2 best solutions below

0
On BEST ANSWER

Assuming the morphisms are just plain old functions, then let me tell you a very clever bit of notation: the set of functions from $A$ to $B$ to denoted $B^A$. Why? Because it has size $|B|^{|A|}$. Why? Because for every $a$ in $A$, there are $|B|$ places it can go; since we can pick where $a$ goes independently of where we pick $a'$ goes, for $a' \ne a$, we have $\underbrace{|B|\times\dotsb\times|B|}_{|A|\text{ times}}$ possibilities.

0
On

I'm guessing your thought process goes something like this:

Hom-set(A,B) and Hom-set(B,A)

Within $Hom_{Set}(A, B)$, you could have a function that takes a $1$ and returns an $x$, a function that takes a $1$ and returns a $y$, a function that takes a $2$ and returns an $x$, and so on. The process is reversed for $Hom_{Set}(B, A)$, but still yields the same number of functions.

Unfortunately, this is wrong. Let's go back a few pages and read what Spivak has to say about functions:

If $X$ and $Y$ are sets, then a function f from $X$ to $Y$, denoted $f \colon X \rightarrow Y$, is a mapping that sends each element $x \in X$ to an element of $Y$, denoted $f(x) \in Y$. We call $X$ the domain of the function $f$ and we call $Y$ the codomain of $f$.

Note that for every element $x \in X$, there is exactly one arrow emanating from $x$, but for an element $y \in Y$, there can be several arrows pointing to $y$, or there can be no arrows pointing to $y$.

A function maps every element of a set (the domain) to exactly one element in another set (the codomain). The line of thinking above is incorrect because of the following reasons:

a. Instead of applying to the entire set, each "function" only applies to a single element within the set.
b. Each domain element maps to multiple codomain elements.

As Unit answered, the number of elements in a hom-set can be calculated using the following equation:

$$|Hom_{Set}(X, Y)| = |Y|^{|X|}$$

A more in-depth explanation (with clarifying examples) can be found here.