A Question on the Type System: Concrete Types, Super-Types and Type Intersections

Effectively, are you asking if a \in T, a \in C implies C \subseteq T? It doesn’t.

No, in Julia types are not their own supertypes.

Yes, this is correct.

Not that I am aware of (but the code may of course qualify as a rigorous description, just not in the language of math).

Generally an axiomatic approach is not needed, it would be a lot of notation for little insight as the type system is pretty intuitive conceptually. But if you insist on creating one, keep parametric types in mind, they complicate the picture a bit as technically Julia does not consider the UnionAll a supertype, eg

julia> Rational{Int} <: Rational
true

julia> supertype(Rational{Int})
Real
1 Like