Numeric types and their relationships

There are a few ways to look at it. One is that implementations of rationals are not a subset of implementations of integers. Another is to ask this question: how would you define rationals without already having defined the integers?

Another view is a bit more philosophical, but fundamentally similar… Although the integers are isomorphic to a subset of the rationals (those with unit denominator), and are conventionally identified with this subset, they are not the same as this subset. If they were, you’d have a circular definition of the integers since you have to define the rationals in terms of the integers. This is similar to the situation in a computer implementation: you define rationals in terms of integers, so the integers cannot be a subtype of rationals.

4 Likes