quotient type
In the field of type theory in computer science, a quotient type is a data type that respects a user-defined equality relation. A quotient type defines an equivalence relation \equiv on elements of the type — for example, we might say that two values of the type Point are equivalent if they have the same respective x- and y-coordinates; formally p1. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
In the field of type theory in computer science, a quotient type is a data type that respects a user-defined equality relation. A quotient type defines an equivalence relation \equiv on elements of the type — for example, we might say that two values of the type Point are equivalent if they have the same respective x- and y-coordinates; formally p1 == p2 if p1.x == p2.x && p1.y == p2.y . In type theories that allow quotient types, an additional requirement is made that all operations must respect the equivalence between elements. For example, if f is a function on values of type Point , it must be the case that for two Point s p1 and p2 , if p1 == p2 then f(p1) == f(p2) . Quotient types are part of a general class of types known as algebraic data types. In the early 1980s, quotient types were defined and implemented as part of the Nuprl proof assistant, in work led by Robert L. Constable and others. Quotient types have been studied in the context of Martin-Löf type theory, dependent type theory, higher-order logic, and homotopy type theory. To define a quotient type, one typically provides a data type together with an equivalence relation on that type, for example, Point // == , where == is a user-defined equality relation. The elements of the quotient type are equivalence classes of elements of the original type. Quotient types can be used to define modular arithmetic. For example, if Integer is a data type of integers, \equiv_2 can be defined by saying that x \equiv_2 y if the difference x - y is even. We then form the type of integers modulo 2: Integer // \equiv_2 The operations on integers, + , - can be proven to be well-defined on the new quotient type.
Cite this
"quotient type". 1760052314. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1316023810 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy