3 ms·
That's just an example of how we naturally use dependent types in everyday mathematics: the set of monoids is the set of triplets of a set M, a function m from
by lmm 6y ago
That's just an example of how we naturally use dependent types in everyday mathematics: the set of monoids is the set of triplets of a set M, a function m from that M^2 to that M, and an element 1 of that set M such that the given laws hold. You can only define the type of monoids (members of the set of monoids) dependently, because 1 isn't just an element of any set, it's an element of the specific set M.
(Groups might have been a better example than monoids, given that groups are more familiar to mathematicians and the point is to emphasise that this is normal everyday mathematics).
- tomp 6y agoNot really, Rossberg’s 1ML / F-ing modules provides a way to elaborate such type to plain System F types, i.e. existentials, but not dependent types. The type of such monoid would be: exists[T] . (M : [= T], f : T -> T, e : T)
- lmm 6y agoSure, but that's distinctly not the way you'd write or think about that definition in everyday mathematics. It encodes the definition but it doesn't really express it.
- GregarianChild 6y agoI think you need HKTs, in other words System F-omega, to carry out Rossberg's idea.
- tomp 6y agoOnly for applicative functors (i.e. OCaml’s version, where Set[int].t == Set[int].t), which 1ML models as pure functions.