Type Classes for Mathematics in Type Theory

Bas Spitters, Eelis van der Weegen
2/7/2011
116 citations
cs.LO

Official code: rocq-community/math-classes (167 stars, Rocq Prover, MIT, last commit 2026-11-04).

Abstract

The introduction of first-class type classes in the Coq system calls for re-examination of the basic interfaces used for mathematical formalization in type theory. We present a new set of type classes for mathematics and take full advantage of their unique features to make practical a particularly flexible approach formerly thought infeasible.

Show full abstract

Thus, we address both traditional proof engineering challenges as well as new ones resulting from our ambition to build upon this development a library of constructive analysis in which abstraction penalties inhibiting efficient computation are reduced to a minimum. The base of our development consists of type classes representing a standard algebraic hierarchy, as well as portions of category theory and universal algebra. On this foundation we build a set of mathematically sound abstract interfaces for different kinds of numbers, succinctly expressed using categorical language and universal algebra constructions. Strategic use of type classes lets us support these high-level theory-friendly definitions while still enabling efficient implementations unhindered by gratuitous indirection, conversion or projection. Algebra thrives on the interplay between syntax and semantics. The Prolog-like abilities of type class instance resolution allow us to conveniently define a quote function, thus facilitating the use of reflective techniques.

View on arXivView PDF

Code Implementations(1)

MIT

A library of abstract interfaces for mathematical structures in Coq [maintainer=@spitters,@Lysxia]

16742Rocq Prover, PythonMay 13, 20113 weeks agoMIT
coqcoq-cicoq-librarycoq-platformmathematics+1 more

Similar Papers

Cite this paper

@article{spitters2011type,
  title  = {Type Classes for Mathematics in Type Theory},
  author = {Bas Spitters and Eelis van der Weegen},
  year   = {2011},
  eprint = {1102.1323},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1102.1323}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1102.1323.svg)](https://codeofpaper.com/paper/1102.1323)

Discussion