Well-Ordering Principle implies Zorn's Lemma
Does my attempt look fine or contain logical flaws/gaps? Any suggestion is greatly appreciated. Thank you for your help!
My attempt:
Let $(A,\preccurlyeq)$ be a partially ordered set in which every chain has an upper bound.
By Well-Ordering Principle, there is a well-ordering $\preccurlyeq'$ on $A$. Let $V$ be the class of all sets and $\rm Ord$ be the class of all ordinals. First, we define function $f:\mathcal{P}(A)\setminus\{\emptyset\} \to A$ by $f(X)=\min X$ (with regard to $\preccurlyeq'$).
Next, we define function $G:V \to V$ by $G(x)=f(\{a\in A \mid \forall t\in {\rm ran}(x):t \prec a\})$ if $x$ is a function and $\{a\in A \mid \forall t\in {\rm ran}(x):t \prec a\} \neq \emptyset$, and $G(x)=A$ otherwise. By Transfinite Recursion Theorem, there is a function $F: {\rm Ord} \to V$ such that $F(\alpha)=G(F \restriction \alpha)$ for all $\alpha \in {\rm Ord}$.
It is not hard to verify (by Hartogs number) that $F(\alpha)= A$ for some ordinal $\alpha$. Let $\lambda=\min\{\alpha \in {\rm Ord} \mid F(\alpha)= A\}$. Then ${\rm ran}(F\restriction \lambda)$ is clearly a chain in $(A,\preccurlyeq)$ and has an upper bound $u \in A$. If $u \prec \bar a$ for some $\bar a\in A$, we have $\bar a\in\{a\in A \mid \forall t\in {\rm ran}(F\restriction \lambda):t \prec a\} \neq \emptyset$ and thus $F(\lambda) \in A$. This contradicts the fact that $F(\lambda)=A$. So $u$ is the maximal element of $A$.