# Definition of functionality

Suppose we have the Cartesian product of sets $A$ and $B$. Let $f$ be a subset of $A\times B$. The usual textbook approach to proving that $f$ is a function mapping $A$ to $B$ is to prove that for all $x\in A$, there exists a unique $y \in B$ such that $(x,y)\in f$.

Should you not also have to prove that $A$ is empty or $B$ is non-empty?

-
You may find math.stackexchange.com/questions/45625 as an interesting read. –  Asaf Karagila Oct 9 '11 at 7:53

No. If $A=\varnothing$, then certainly any statement of the form "for all $x\in A$, ____" is true, so any subset of $A\times B=\varnothing\times B=\varnothing$ is a function. Thus, consider the case when $A\neq\varnothing$, i.e. $\exists a\in A$ for some $a$. If one has proven that "for all $x\in A$, there exists a unique $y\in B$ such that $(x,y)\in f$", then in particular, there exists a unique $b\in B$ such that $(a,b)\in f$. For our purposes, we don't care about uniqueness: the fact remains that we have proven that there does exist some $b\in B$, thereby demonstrating that $B\neq\varnothing$.
Thus, proving that "for all $x\in A$, there exists a unique $y\in B$ such that $(x,y)\in f$" does indeed suffice to prove that $f$ is a function: if $A$ is empty, there is no problem, and if $A$ is non-empty, then we can deduce that $B$ is non-empty. So we don't need to prove that "$A$ is empty or $B$ is non-empty" separately.