Assume we have a non-empty indexed family of sets $X \equiv \{ A_i \}_{i \in I}$. Then the axiom of choice asserts that there exists a choice function $F: X \rightarrow \cup X$ such that $F(A_i) \in A_i$.
I claim that it is possible to build the choice function using just the powerset axiom. Of course this cannot be true because choice is independent of $ZF$. So where am I going wrong?
Constructing the choice function $F$ using $X \equiv \{ A_i \}_{i \in I}$ and powerset axiom
Given an indexed family of sets $X \equiv \{ A_i \}_{i \in I}$, first make this family unique, by creating a new collection of elements $Y \equiv \cup_{i \in I}\{i\} \times A_i$. This
Build the powerset $P = 2^Y$.
Filter subsets of the powerset that have a single element $(i, \text{some element in }A_i)$ for each $i \in I$. Formally, create the set:
\begin{align*} &\operatorname{ChoiceFns} \equiv \{ p \in P : \forall i \in I, \text{there exists a unique $a$ such that $(i, a) \in p$}\} \\ &\operatorname{ChoiceFns} \equiv \{ p \in P : \forall i \in I, (\exists a \in A_i, ((i, a) \in p) \land (\lnot \exists a' \in A_i, a' \neq a \land (i, a') \in p)) \} \end{align*}
This now gives us a collection of choice functions, since each element $p \in P$ maps the index $i \in I$ to a unique element $a \in p$?
What am I missing? How am I able to build a set of choice functions ?