# Prove that for any set A and B, the cardinality of the set of all functions mapping A to B is $\vert B \vert ^ {\vert A \vert}$

What I do is for finite sets A, B, let $$A={a_1, a_2, ...a_n}$$ and $$B={b_1, b_2, ...b_m}$$

A function f assigns each element $$a_i$$ of $$A$$ to an element $$b_j = f (a_i)$$ of $$B$$; there are $$m$$ possibilities for each element of $$A$$, we have $$m, m, ...m=m^n= \vert B \vert ^ {\vert A \vert}$$ possible functions.

Since A and B are any sets, how can we extend above to an infinite countable or uncountable sets?

• This depends on how you define $|B|^{|A|}$ for infinite cardinals. The definition is usually "the cardinality of all the set of all functions from $A$ to $B,$ which is really what you are trying to prove. – Thomas Andrews Jul 18 '19 at 14:33
• Yes that is what I mean. It confused me when I tried to solve a problem mapping finite sets to infinite countable sets. Since $b_m$ cannot be shown in an infinite set, I am confused on how to extend this to A finite and B infinite countable. – WaterBro Jul 18 '19 at 14:50
• It's not clear what you mean by "Yes that is what I mean." If this is your definition of $|B|^{|A|}$, then the problem is answered "by definition." The only thing that is really needed is the case when $A,B$ finite, then you'd want the definition to be the same as the natural number definition of exponentiation. – Thomas Andrews Jul 18 '19 at 15:04
• Sorry I did not state it clearly, the question can be easily answered by definition if $A, B$ are finite, while for example, if $A$ is finite and $B$ is infinite countable, then the cardinality of the set of all functions mapping A to B should be $\aleph_0$, but I don't know how to generate a formal proof based on $A, B$ finite situation. – WaterBro Jul 18 '19 at 15:09
• @WaterBro the point is that the definition is not limited to the finite case; that's also taken for the definition of cardinal exponentiation in the infinite case. If your question is 'how can I show that $\aleph_0^n=\aleph_0$ for all $n$?', that's a separate one, though also relatively straightforward. – Steven Stadnicki Jul 18 '19 at 16:18