The cardinality of a domain of a function is larger than the cardinality of the range

analysisfunctions

Is the cardinality of a domain of a function say f, must be larger than the cardinality of the range of f?

Say for sets A and B, we have a function mapping from A to B, does |A|>|B| be necessary?

Since according to Rudin,

Consider two sets A and B, whose elements may be any objects whatsoever, and suppose that with each element x of A there is associated, in some manner, an element of B, which we denote by f(x). Then f is said to be a function from A to B (or a mapping of A into B). The set A is called the domain of f (we also say f is defined on A), and the elements f(x) are called the values of f The set of all values of f is called the range of f.

It didn't mention anything about the cardinality of both sets, but if we set A={1,2}, B={1,2,3}, we cannot get a function can we?

Best Answer

I think you have confused the range of a function with its codomain.

In the explanation you quoted from Rudin, there is no reason to suspect that all elements of $B$ are used. So there is no reason $B$ can't be larger than $A$. For instance, with your example $A=\{1,2\},B=\{1,2,3\}$, there are many functions from $A$ to $B$, one of them being the mapping $f(1)=1, f(2)=2$. This way, $B$ is called the codomain of the function. There is in general no relation between the cardinalities of a domain and of a codomain.

However, one could also restrict $B$ to be just the elements that are hit by $f$. This is what's called the range of $f$, and it can indeed be no larger than $A$. (If you want to get technical, there are subtleties in that last sentence that involves the Axiom of Choice, but I think we can save that for later.)