# Set problem where $f=A\times B$

The problem states:

If there is function $f:A\to B$ and $$\left(f=A \times B \right) \iff \left( A= \varnothing \text{ or } |B| = 1\right)$$

(where $A \times B$ is the cartesian product and $|B|$ is the cardinality of $B$)

So I must demonstrate that equivalence. I've tried to slove it, but i can't wrap my head around what $f=A\times B$ means. Please help me!

• $f=A\times B$ means that $f$ is the set of all pairs $(a,b)$ where $a\in A$ and $b\in B$. – Xoff Nov 17 '13 at 15:48

Recall that $A\times B$ is the set of all possible ordered pairs from $A$ and $B$, a function is just a subset of these pairs. For example if $A=\{x,y\}$ then a function whose domain is $A$ will only have two elements $\langle x,f(x)\rangle$ and $\langle y,f(y)\rangle$.
You are asked to show that if $f$ has all the possible ordered pairs, then either $A$ is the empty set or $B$ is a singleton. To do so, first you have the show that if $A$ is the empty set, or $B=\{b\}$, then $A\times B$ is a function; and in the other direction show either that from the assumption $f=A\times B$ you can conclude at least one of the things hold ($A=\varnothing$ or $B=\{b\}$), or work towards contradiction or contrapositive and assume that $A$ is not empty, $B$ is either empty, or have two elements, and conclude that $A\times B$ cannot be a function whose domain is $A$.