Skip to main content

Quotients by Idempotent Functions in Cedille

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12053))

Abstract

We present a simple characterization of definable quotient types as being induced by idempotent functions, and an encoding of this in Cedille (a dependently typed programming language) in which both equational constraints and the packaging that associates these with elements of the carrier type are irrelevant, facilitating equational reasoning in proofs. We provide several concrete examples of definable quotients using this encoding and give combinators for function lifting (with one variant having zero run-time cost).

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    The listing of function rem omits necessary type coercions for Cedille to ensure that the recursive call on minus n’ k’ is well-founded.

  2. 2.

    github.com/cedille/cedille-developments/tree/master/idem-quotients.

References

  1. Altenkirch, T., Kaposi, A.: Type theory in type theory using quotient inductive types. In: Proceedings of the 43rd Annual ACMSIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, vol. 51, pp. 18–29. ACM (2016)

    Google Scholar 

  2. Anand, A., Bickford, M., Constable, R.L., Rahli, V.: A type theory with partial equivalence relations as types. In: 20th International Conference on Types for Proofs and Programs (2014)

    Google Scholar 

  3. Chicli, L., Pottier, L., Simpson, C.: Mathematical quotients and quotient types in Coq. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 95–107. Springer, Heidelberg (2003). https://doi.org/10.1007/3-540-39185-1_6

    Chapter  MATH  Google Scholar 

  4. Cohen, C.: Pragmatic quotient types in Coq. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 213–228. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39634-2_17

    Chapter  Google Scholar 

  5. Coquand, T., Huet, G.: The calculus of constructions. Ph.D. thesis, INRIA (1986)

    Google Scholar 

  6. Courtieu, P.: Normalized types. In: Fribourg, L. (ed.) CSL 2001. LNCS, vol. 2142, pp. 554–569. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-44802-0_39

    Chapter  Google Scholar 

  7. Firsov, D., Blair, R., Stump, A.: Efficient mendler-style lambda-encodings in cedille. In: Avigad, J., Mahboubi, A. (eds.) ITP 2018. LNCS, vol. 10895, pp. 235–252. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-94821-8_14

    Chapter  Google Scholar 

  8. Frumin, D., Geuvers, H., Gondelman, L., Weide, N.V.D.: Finite sets in homotopy type theory. In: Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, pp. 201–214. ACM (2018)

    Google Scholar 

  9. Garillot, F., Gonthier, G., Mahboubi, A., Rideau, L.: Packaging mathematical structures. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 327–342. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03359-9_23

    Chapter  Google Scholar 

  10. Giménez, E.: Codifying guarded definitions with recursive schemes. In: Dybjer, P., Nordström, B., Smith, J. (eds.) TYPES 1994. LNCS, vol. 996, pp. 39–59. Springer, Heidelberg (1995). https://doi.org/10.1007/3-540-60579-7_3

    Chapter  Google Scholar 

  11. Hofmann, M.: A simple model for quotient types. In: Dezani-Ciancaglini, M., Plotkin, G. (eds.) TLCA 1995. LNCS, vol. 902, pp. 216–234. Springer, Heidelberg (1995). https://doi.org/10.1007/BFb0014055

    Chapter  Google Scholar 

  12. Homeier, P.V.: A design structure for higher order quotients. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 130–146. Springer, Heidelberg (2005). https://doi.org/10.1007/11541868_9

    Chapter  MATH  Google Scholar 

  13. Jenkins, C., McDonald, C., Stump, A.: Elaborating inductive datatypes and course-of-values pattern matching to Cedille. CoRR (2019). http://arxiv.org/abs/1903.08233

  14. Kopylov, A.: Dependent intersection: a new way of defining records in type theory. In: Proceedings of the 18th Annual IEEE Symposium on Logic in Computer Science, LICS 2003. IEEE Computer Society, Washington, DC (2003)

    Google Scholar 

  15. Li, N.: Quotient types in type theory. Ph.D. thesis, University of Nottingham (2015)

    Google Scholar 

  16. Maietti, M.E.: About effective quotients in constructive type theory. In: Altenkirch, T., Reus, B., Naraschewski, W. (eds.) TYPES 1998. LNCS, vol. 1657, pp. 166–178. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48167-2_12

    Chapter  Google Scholar 

  17. McBride, C.: Elimination with a motive. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, pp. 197–216. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45842-5_13

    Chapter  Google Scholar 

  18. Miquel, A.: The implicit calculus of constructions extending pure type systems with an intersection type binder and subtyping. In: Abramsky, S. (ed.) TLCA 2001. LNCS, vol. 2044, pp. 344–359. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-45413-6_27

    Chapter  MATH  Google Scholar 

  19. Nogin, A.: Quotient types: a modular approach. In: Carreño, V.A., Muñoz, C.A., Tahar, S. (eds.) TPHOLs 2002. LNCS, vol. 2410, pp. 263–280. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45685-6_18

    Chapter  Google Scholar 

  20. Pinyo, G., Altenkirch, T.: Integers as a higher inductive type. In: 24th International Conference on Types for Proofs and Programs (2018)

    Google Scholar 

  21. Stump, A.: The calculus of dependent lambda eliminations. J. Funct. Program. 27, e14 (2017)

    Article  MathSciNet  Google Scholar 

  22. Stump, A.: Syntax and semantics of Cedille (2018). https://arxiv.org/abs/1806.04709

  23. Veltri, N.: Two set-based implementations of quotients in type theory. In: Proceedings of the 14th Symposium on Programming Languages and Software Tools, pp. 194–205 (2015)

    Google Scholar 

  24. Vezzosi, A., Mörtberg, A., Abel, A.: Cubical agda: a dependently typed programming language with univalence and higher inductive types, vol. 3, p. 87. ACM (2019)

    Google Scholar 

  25. van der Weide, N., Geuvers, H.: The construction of set-truncated higher inductive types. In: Thirty-Fifth Conference on the Mathematical Foundations of Programming Semantics (2019)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Andrew Marmaduke .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Marmaduke, A., Jenkins, C., Stump, A. (2020). Quotients by Idempotent Functions in Cedille. In: Bowman, W., Garcia, R. (eds) Trends in Functional Programming. TFP 2019. Lecture Notes in Computer Science(), vol 12053. Springer, Cham. https://doi.org/10.1007/978-3-030-47147-7_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-47147-7_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-47146-0

  • Online ISBN: 978-3-030-47147-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics