Bijection from set of constant functions

elementary-set-theoryfunctions

I am trying to provide a proof for the following question but I can't seem to figure out what the bijection would be. I feel like I am missing something quite trivial. I imagine it has something to do with mapping constant functions to each individual element of B.

Let $A$ and $B$ be sets. Let $C$ be the set of constant functions from $A$ into $B$. There is a bijection between $B$ and $C$.

Best Answer

This question is elementary so I'll be formal.

If $A = \emptyset$ then $C = \emptyset$ and, in fact, the result does not hold.

Now if $A \neq \emptyset$, $\exists a\in A $. Then define $f: C \to B$ to be $f(g) = g(a)$. As a more general result, if $g$ is a constant function on some domain $D$ with some value $d$, then $g = D\times{d}$ (you might prove this by extensionality). Therefore, if $f(g) = f(h)$, $A\times\{g(a)\} = A\times\{h(a)\}$ and then $g = h$ so $f$ is surjective. Also, $\forall b\in B$, $A\times \{b\}$ is a constant function so $f$ is surjective. Therefore $f$ is a bijection between $B$ and $C$.

Related Question