There’s a very neat way of encoding any set as a set of ordinals, which has the somewhat peculiar feature of it being hard (which here meaning that it requires the axiom of choice) to encode sets, but easy to decode them. Like some kind of a very ineffective crypto-system.
Let’s start out with the encoding process. If we’re given a set and want to encode it as a set of ordinals, we first “unpack” our set, meaning that we pass to its transitive closure , which is defined recursively as ,
and finally . Now, our next step is to use the axiom of choice to find a well-ordering of , because then there exists a unique ordinal such that
Let be the underlying bijection. We can then take the point-wise image under of the membership relation to achieve a binary relation , giving us a new isomorphism
Letting be the cardinality of we also have a bijection (without using choice since is an ordinal), so by now taking the point-wise image of under , we end up with a binary relation .
Next up, we have the canonical Gödel pairing function, a bijective function — here we’re using that , being a cardinal, is closed under this function. By taking that point-wise image of under , we wind up with a set of ordinals . This, is our encoding of . The thing that made this encoding hard was that we had to rely on the axiom of choice to pull out the well-ordering along the way.
Now, let’s start out with the encoded set and begin the decoding procedure. First of all, since the Gödel pairing function works the same way in every universe, we can extract the binary relation from , by taking the point-wise image of under . Now we consider , which satisfies the requirements for taking the Mostowski collapse, so we retrieve the isomorphism
by uniqueness of the collapse, using that is in fact transitive. But now that we have extracted , we can from this also extract , since is the unique element of which isn’t an element of any . This encoding procedure doesn’t refer to the well-ordering at all!
A consequence of this encoding-decoding procedure is that, given any set , we can find a set of ordinals such that : by simply letting encode , we get that as contains all the ordinals, so we can perform the above decoding process inside to extract .