The axiom of choice asserts that for any set $X$ there exists a function $f : (2^X − \{\emptyset\}) \rightarrow X$ such that for any nonempty $A \subseteq X$, $f(A) \in A$. Show that this is equivalent to the assertion that every relation includes a function with the same domain.
I am given this problem in my assignment. My approach is following.
I have a set $X$. Then it has a choice function $g : \mathcal{P}(X) \setminus \left\{\emptyset\right\} \rightarrow X$. Suppose $X$ has a relation $R \subseteq X \times X$. $dom(R) \subseteq X$. Then the required function $f : dom(R) \rightarrow X$ is
$$f(x) = g(\{y\ |\ (x, y) \in R\})$$
Conversely, suppose $X \supseteq Y$ is a non-empty subset. Let $$R_Y = \{(x, y)\ |\ y \in Y, x \in Y, (p, q) \in R_Y \Rightarrow p = x\}$$
Then there is a function $f_Y : dom(R_Y) \rightarrow X$. But $dom(R_Y)$ is singleton from the definition of $R_Y$. Then $im(f_Y)$ is also singleton. We define our choice function as $f = \{(Y, y)\ |\ y \in im(f_Y)\}$
Are my arguments correct?
Edit.1: what I tried to do for converse is, for any subset $Y$, I construct a relation $Y_1 \times Y$ where $Y \supseteq Y_1 = \{y\}$. Then there is a function $f_Y : Y_1 \rightarrow Y$. Then if $f$ is my choice function I define $f(Y) = f_Y(y)$.
May be I should define $R_Y$ as
$$R_Y = \{(x, y)\ |\ y \in Y; x \in Y; (p, q), (p', q) \in R_Y \Rightarrow p = p'\}$$
I understand there may be multiple $R_y$'s. But can't I define a singleton set as $\{s\in S\ |\ a, b \in S \Rightarrow a = b\}$? This can be $\{s\}$ $\forall s \in S$. But isn't it a valid specification?
Edit.2: This is the final solution with the help from @Asaf.
If we assume axiom of choice then for any $X$ there is a choice function $f : \mathcal{P}(X) \setminus \left\{\emptyset\right\} \rightarrow X$ such that $f(A) \in A$. Suppose $R$ is a relation between $P$ and $Q$. Then we have a choice function $f_Q$ for $Q$. Let $f_R(p) = f_Q(\{q\ |\ pRq\})$. The function $f_R : P \rightarrow Q$ and $dom(f_R) = dom(R)$. So this is our required function.
Conversely, if every relation includes a function with same domain. Let $R$ be a relation between $\mathcal{P}(X) \setminus \left\{\emptyset\right\}$ and $X$ such that $aRb \Rightarrow b \in a$. Now $R$ includes a function $f : \mathcal{P}(X) \setminus \left\{\emptyset\right\} \rightarrow X$. Then $xRf(x) \Rightarrow f(x) \in x$. So $f$ is the choice function for $X$.