Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Quotient type

From Wikipedia, the free encyclopedia
Data type in type theory

In the field oftype theory incomputer science, aquotient type is adata type that respects a user-definedequality relation. A quotient type defines anequivalence relation{\displaystyle \equiv } on elements of the type — for example, we might say that two values of the typePoint are equivalent if they have the same respective x- and y-coordinates; formallyp1 == p2 ifp1.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, iff is a function on values of typePoint, it must be the case that for twoPointsp1 andp2, ifp1 == p2 thenf(p1) == f(p2).

Quotient types are part of a general class of types known asalgebraic data types. In the early 1980s, quotient types were defined and implemented as part of theNuprlproof assistant, in work led byRobert L. Constable and others.[1][2] Quotient types have been studied in the context ofMartin-Löf type theory,[3]dependent type theory,[4]higher-order logic,[5] andhomotopy type theory.[6]

Definition

[edit]

To define a quotient type, one typically provides adata type together with anequivalence relation on that type, for example,Point // ==, where== is a user-defined equality relation. The elements of the quotient type areequivalence classes of elements of the original type.[3]

Quotient types can be used to definemodular arithmetic. For example, ifInteger is a data type of integers,2{\displaystyle \equiv _{2}} can be defined by saying thatx2y{\displaystyle x\equiv _{2}y} if the differencexy{\displaystyle x-y} is even. We then form the type of integers modulo 2:[1]

Integer //2{\displaystyle \equiv _{2}}

The operations on integers,+,- can be proven to be well-defined on the new quotient type.

Variations

[edit]

In type theories that lack quotient types,setoids (sets explicitly equipped with an equivalence relation) are often used instead of quotient types. However, unlike with setoids, many type theories may require aformal proof that any functions defined on quotient types arewell-defined.[7]

Properties

[edit]

Quotient types are part of a general class of types known asalgebraic data types. Just asproduct types andsum types are analogous to the cartesian product and disjoint union of abstract algebraic structures, quotient types reflect the concept of set-theoreticquotients, sets whose elements are partitioned intoequivalence classes by a given equivalence relation on the set. Algebraic structures whoseunderlying set is a quotient are also termed quotients. Examples of such quotient structures include quotientsets,groups,rings,categories and, in topology,quotient spaces.[3]

References

[edit]
  1. ^abConstable, Robert L. (1986).Implementing Mathematics with the Nuprl Proof Development System. Prentice-Hall.ISBN 978-0-13-451832-9.
  2. ^Constable, R. L. (1984)."Mathematics as programming". In Clarke, Edmund; Kozen, Dexter (eds.).Logics of Programs. Lecture Notes in Computer Science. Vol. 164. Berlin, Heidelberg: Springer. pp. 116–128.doi:10.1007/3-540-12896-4_359.hdl:1813/6405.ISBN 978-3-540-38775-6.
  3. ^abcLi, Nuo (2015-07-15)."Quotient types in type theory".eprints.nottingham.ac.uk. Retrieved2023-09-13.
  4. ^Hofmann, Martin (1995)."A simple model for quotient types".Typed Lambda Calculi and Applications. Lecture Notes in Computer Science. Vol. 902. Berlin, Heidelberg: Springer. pp. 216–234.doi:10.1007/BFb0014055.ISBN 978-3-540-49178-1.
  5. ^Homeier, Peter V. (2005)."A Design Structure for Higher Order Quotients". In Hurd, Joe; Melham, Tom (eds.).Theorem Proving in Higher Order Logics. Lecture Notes in Computer Science. Vol. 3603. Berlin, Heidelberg: Springer. pp. 130–146.doi:10.1007/11541868_9.ISBN 978-3-540-31820-0.
  6. ^"The HoTT Book".Homotopy Type Theory. 2013-03-12. Retrieved2023-09-13.
  7. ^Hofmann, Martin (1997).Extensional Constructs in Intensional Type Theory.doi:10.1007/978-1-4471-0963-1.ISBN 978-1-4471-1243-3.

See also

[edit]
Uninterpreted
Numeric
Reference
Text
Composite
Other
Related
topics
Retrieved from "https://en.wikipedia.org/w/index.php?title=Quotient_type&oldid=1316023810"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp