I am attempting to prove the fact that Zorn’s lemma implies the axiom of choice, however my proof falls short when I try to prove every chain has an upper bound. I understand there are other proofs on stackexchange, however my question is quite specific and I have not seen them answered elsewhere.

Here is my attempt so far.

Let $X$ be a non-empty set. I will use Zorn’s lemma to prove a choice function on $X$ exists (a choice function on $X$ is $c: (P(X)-{emptyset}) to X$ such that for every non-empty set $A subset X$, $c(A) in A$). Then define the set $mathcal{A}$ to be the collection of all $(f, Y)$ where $f$ is a choice function on $Y$, where $Y subset X$ , and equip $mathcal{A}$ with the partial order $(f, Y) preceq (f’, Y’)$ if $Y subset Y’$ and $f’|_{Y} = f$.

Now let $mathcal{B} subset mathcal{A}$ be a linearly ordered subset (or commonly known as “chain”) of $mathcal{A}$. Then defining $Z = bigcup_{(f,Y) in mathcal{B}}Y$ and $g = bigcup_{(f,Y) in mathcal{B}} f$, I claim $(g, Z) in mathcal{A}$ (where I refer to $f$, I’m refering to $f$ as a set, namely $(x, y) in f iff y = f(x)$).

This is the part where I’m having trouble. I know $g$ is a function, since if $(x, y), (x,z) in g$, then $(x,y) in f$ and $(x,z) in f’$, where $(f, Y), (f’, Y’) in mathcal{B}$. Since $mathcal{B}$ is linearly ordered, we have without loss of generality $(f, Y) preceq (f’, Y’)$ and so $(x,y), (x,z) in f’$ and since $f’$ is a function, we have $y=z$. Hence $g$ is a function.

However, I’m having a hard time showing that the domain of $g$ is $P(Z)-{emptyset}$. Since if $Wsubset Z$ and $W neq emptyset$, then by defintion of $Z$, $W subset bigcup_{(f,Y) in mathcal{B}}Y$. To show $g$ is defined on $W$ then requires us to show there exists a $Y$ such that $Wsubset Y$ and $(f,Y) in mathcal{B}$ but how do I show such a $Y$ esists?

It seems to me using the fact that $mathcal{B}$ is linearly ordered is essential, but I fail to see how it works. I am comfortable with the continuing the rest of the proof to completion.