Despite mathematical convenience, being â€śisomorphic toâ€ť is not the same as being â€śidentical toâ€ť. Mathematically, the rational numbers are *defined* as the equivalence classes of pairs of integers (a,b) where b \neq 0 under the equivalence relation

\qquad (a, b) \equiv (c, d) \iff ad = bc

The rational numbers with representatives (a,1) form a subset of this set of classes that are isomorphic to the ring of integers, but they are not formally the same objects, they just behave the same. In symbols: a \neq \left[(a,1)\right]_\equiv. These cannot be the same object because of the axiom of regularity. (Or more simply, because `a`

is a finite set whereas the equivalence class \left[(a,1)\right]_\equiv is an infinite set of pairs of integers, so theyâ€™re quite different objects.)

When mathematicians consider the integers to be a â€śsubsetâ€ť of the rationals, they are not talking about the same set of integers that were used in the above definition, they are talking about the subset of rationals that behave like those â€śoriginal integersâ€ť. For humans, this distinction is easy to gloss over and we transparently switch between which meaning of â€śthe integersâ€ť weâ€™re talking about without even realizing it. But they are very much distinct mathematical entities.

In computers, we have to do a similar construction and for the same reason, the integers which the rationals are defined in terms of cannot logically be a subset of the rationals that they are used to define. If this doesnâ€™t make sense to you, thatâ€™s fine (Iâ€™m not going to argue the point further), but my point is that even mathematically, the integers from which the rationals are constructed are not a subset of the rationals, they are merely isomorphic to a subset of the rationals. In Julia, we model this kind of isomorphism between structurally different objects by just giving them compatible behaviors, rather than with a type relation.