Where does this naive proof of the axiom of choice from the partition principle fall down?

Reflecting upon the axiom of choice and its independence from Zermelo Frankel set theory, I came to the conclusion that there must be definitions of sets in $$ZF$$ which encode the elements of sets, without providing the opportunity to encode some arbitrary order on the elements within the sets.

Part of the fundamental essence of sets is all mutually distinct elements - in fact for any $$a,b\in X$$ we have that $$a\neq b$$. Question: Assuming the above insight is correct, is something slightly weaker than an ordering of elements possible, without the axiom of choice, namely to assign a distinct ordinal to every pair $$a\neq b$$ at the point we define the set? It seems intutive to me that we must necessarily encode every pair of elements to be different, and therefore these $$\neq$$ relations might be ordered at the point they are encoded, for any expressible set. Is that correct?

I was reading some material and it stated that it is an open problem whether $$(A$$ surjects $$B\implies B$$ injects $$A)$$ implies the axiom of choice. The axiom of choice is equivalent to the statement that an injection $$f$$ can be found for every surjection $$g$$ such that $$gf=\textrm {id}$$.

If what I state in the second paragraph is possible, then it would seem that for any surjection, by picking the least-numbered $$\neq$$ we can at least get as close to defining the injection $$f$$ that gives $$gf=\textrm {id}$$ as identifying some pair $$b\mapsto\{a_1,a_2\}$$ simply by picking the pair $$a_1,a_2$$ having the least $$\neq$$-index.

Then if we define $$A \cup B$$, by the hypothesis of the 2nd paragraph, we would have assigned $$a_1\neq b$$ and $$a_2\neq b$$ distinct ordinals by which the least $$a,b:a\in\{a_1,a_2\}$$ can be picked (and therefore the injection $$f$$ can be defined), giving us the axiom of choice.

I assume I'm being naive in the second paragraph's assumptions, and may also have made more errors. Assuming this does fail, where and why does it?

• Actually, we often write “for all $i,j\in I$“ and include the case $i=j.$ The only case where $i\neq j$ is when we explicitly say $i\neq j.$ Commented Apr 19, 2021 at 19:58
• @ThomasAndrews but that can never give us $|\{i,j\}|=2$, when $i=j$, right? Do I claim more than I write in this comment, in the question? Is this subtlety you're pointing out at the heart of the axiom of choice? Commented Apr 20, 2021 at 1:51

If you have a set $$A$$, and you assume that you can match a unique ordinal to each pair $$\{a,b\}$$ where $$a\neq b$$, then you can well-order $$A$$:
1. If $$A=\varnothing$$, we're done.
2. Assume it's not empty. Pick some $$a\in A$$, if $$A=\{a\}$$, it's well-ordered.
3. Assume it's not $$\{a\}$$, then map $$b$$ to the unique ordinal $$\alpha$$ matched to $$\{a,b\}$$ for all $$b\neq a$$. Now map $$a$$ to the least ordinal not used by that map.