Sharing proofs with predicative theories through universe-polymorphic elaboration (2308.15465v6)
Abstract: As the development of formal proofs is a time-consuming task, it is important to devise ways of sharing the already written proofs to prevent wasting time redoing them. One of the challenges in this domain is to translate proofs written in proof assistants based on impredicative logics to proof assistants based on predicative logics, whenever impredicativity is not used in an essential way. In this paper we present a transformation for sharing proofs with a core predicative system supporting prenex universe polymorphism. It consists in trying to elaborate each term into a predicative universe-polymorphic term as general as possible. The use of universe polymorphism is justified by the fact that mapping each universe to a fixed one in the target theory is not sufficient in most cases. During the elaboration, we need to solve unification problems in the equational theory of universe levels. In order to do this, we give a complete characterization of when a single equation admits a most general unifier. This characterization is then employed in a partial algorithm which uses a constraint-postponement strategy for trying to solve unification problems. The proposed translation is of course partial, but in practice allows one to translate many proofs that do not use impredicativity in an essential way. Indeed, it was implemented in the tool Predicativize and then used to translate semi-automatically many non-trivial developments from Matita's library to Agda, including proofs of Bertrand's Postulate and Fermat's Little Theorem, which (as far as we know) were not available in Agda yet.
- Dedukti: a logical framework based on the λ𝜆\lambdaitalic_λ π𝜋\piitalic_π-calculus modulo theory. Unpublished, 2016.
- Setoid type theory—a syntactic translation. In Mathematics of Program Construction: 13th International Conference, MPC 2019, Porto, Portugal, October 7–9, 2019, Proceedings 13, pages 155–196. Springer, 2019.
- Untyped Confluence In Dependent Type Theories. working paper or preprint, April 2017. URL: https://hal.inria.fr/hal-01515505.
- A proof of bertrand’s postulate. Journal of Formalized Reasoning, 5(1):37–57, 2012.
- Ali Assaf. A framework for defining computational higher-order logics. These, École polytechnique, September 2015. URL: https://pastel.archives-ouvertes.fr/tel-01235303.
- H. P. Barendregt. Lambda Calculi with Types, page 117–309. Oxford University Press, Inc., USA, 1993.
- Unification in commutative idempotent monoids. Theoretical Computer Science, 56(3):345–353, 1988. URL: https://www.sciencedirect.com/science/article/pii/0304397588901405, doi:https://doi.org/10.1016/0304-3975(88)90140-5.
- Type theory with explicit universe polymorphism, 2023. arXiv:2212.03284.
- A modular construction of type theories. Logical Methods in Computer Science, Volume 19, Issue 1, February 2023. URL: http://lmcs.episciences.org/10959, doi:10.46298/lmcs-19(1:12)2023.
- Frédéric Blanqui. Théorie des types et réécriture. (Type theory and rewriting). PhD thesis, University of Paris-Sud, Orsay, France, 2001. URL: https://tel.archives-ouvertes.fr/tel-00105522.
- Frédéric Blanqui. Rewriting modulo in deduction modulo. In Proceedings of the 14th International Conference on Rewriting Techniques and Applications, Lecture Notes in Computer Science 2706, 2003. 15 pages.
- Frédéric Blanqui. Definitions by rewriting in the calculus of constructions. Mathematical Structures in Computer Science, 15(1):37–92, 2005.
- Frédéric Blanqui. Encoding type universes without using matching modulo AC. In Proceedings of the 7th International Conference on Formal Structures for Computation and Deduction, Leibniz International Proceedings in Informatics 228, 2022.
- Proof-checking Euclid. Annals of Mathematics and Artificial Intelligence, page 53, January 2019. URL: https://hal.archives-ouvertes.fr/hal-01612807, doi:10.1007/s10472-018-9606-x.
- Unification theory., 1994.
- Embedding pure type systems in the lambda-pi-calculus modulo. In Simona Ronchi Della Rocca, editor, Typed Lambda Calculi and Applications, pages 102–117, Berlin, Heidelberg, 2007. Springer Berlin Heidelberg.
- Thierry Coquand. Canonicity and normalisation for dependent type theory. arXiv preprint arXiv:1810.09367, 2018.
- Deducteam. Lambdapi. URL: https://github.com/Deducteam/lambdapi [cited 2023].
- Deducteam. Matita’s arithmetic library in Dedukti. URL: https://github.com/Deducteam/Deducteam.github.io/blob/master/data/libraries/matita.tar.gz.
- Tristan Delort. Importer les preuves de Logipedia dans Agda. Internship report, Inria Saclay Ile de France, November 2020. URL: https://hal.inria.fr/hal-02985530.
- Unification via explicit substitutions: The case of higher-order patterns. In JICSLP, pages 259–273, 1996.
- Gilles Dowek. The undecidability of typability in the lambda-pi-calculus. In Proceedings of the International Conference on Typed Lambda Calculi and Applications, TLCA ’93, page 139–145, Berlin, Heidelberg, 1993. Springer-Verlag.
- Translating proofs from an impredicative type system to a predicative one. In Bartek Klin and Elaine Pimentel, editors, 31st EACSL Annual Conference on Computer Science Logic, CSL 2023, February 13-16, 2023, Warsaw, Poland, volume 252 of LIPIcs, pages 19:1–19:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.CSL.2023.19.
- Thiago Felicissimo. Adequate and Computational Encodings in the Logical Framework Dedukti. In Amy P. Felty, editor, 7th International Conference on Formal Structures for Computation and Deduction (FSCD 2022), volume 228 of Leibniz International Proceedings in Informatics (LIPIcs), pages 25:1–25:18, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. URL: https://drops.dagstuhl.de/opus/volltexte/2022/16306, doi:10.4230/LIPIcs.FSCD.2022.25.
- Thiago Felicissimo. Generic bidirectional typing for dependent type theories, 2023. arXiv:2307.08523.
- Gaspard Ferey. Higher-Order Confluence and Universe Embedding in the Logical Framework. These, Université Paris-Saclay, June 2021. URL: https://tel.archives-ouvertes.fr/tel-03418761.
- Guillaume Genestier. Encoding agda programs using rewriting. In Zena M. Ariola, editor, 5th International Conference on Formal Structures for Computation and Deduction, FSCD 2020, June 29-July 6, 2020, Paris, France (Virtual Conference), volume 167 of LIPIcs, pages 31:1–31:17. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPIcs.FSCD.2020.31.
- Jan Herman Geuvers. Logics and type systems. [Sl: sn], 1993.
- Yoan Géran. Euclid’s elements book 1 in dedukti. URL: https://github.com/Karnaj/sttfa_geocoq_euclid [cited 2022].
- Type checking with universes. Theor. Comput. Sci., 89(1):107–136, aug 1991. doi:10.1016/0304-3975(90)90108-T.
- Gluing for type theory. In 4th International Conference on Formal Structures for Computation and Deduction (FSCD 2019). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2019.
- Jan Willem Klop. Combinatory reduction systems. PhD thesis, Rijksuniversiteit Utrecht, 1963.
- Combinatory reduction systems: introduction and survey. Theoretical Computer Science, 121(1):279–308, 1993. URL: https://www.sciencedirect.com/science/article/pii/0304397593900917, doi:https://doi.org/10.1016/0304-3975(93)90091-7.
- Matita’s arithmetic library. URL: https://github.com/LPCIC/matita/tree/master/matita/matita/lib/arithmetics.
- Higher-order rewrite systems and their confluence. Theoretical computer science, 192(1):3–29, 1998.
- A generic normalisation proof for pure type systems. In International Workshop on Types for Proofs and Programs, pages 254–276. Springer, 1996.
- Jason Reed. Higher-order constraint simplification in dependent type theory. In Proceedings of the Fourth International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice, pages 49–56, 2009.
- Ronan Saillard. Type checking in the Lambda-Pi-calculus modulo: theory and practice. PhD thesis, Mines ParisTech, France, 2015.
- Ronan Saillard. Type checking in the Lambda-Pi-calculus modulo: theory and practice. PhD thesis, PhD thesis, Mines ParisTech, France, 2015.
- Universe polymorphism in coq. In International Conference on Interactive Theorem Proving, pages 499–514. Springer, 2014.
- Agda Development Team. Agda 2.6.2.1 documentation. URL: https://agda.readthedocs.io/en/v2.6.2.1/index.html [cited 2022].
- François Thiré. Sharing a library between proof assistants: Reaching out to the HOL family. In Frédéric Blanqui and Giselle Reis, editors, Proceedings of the 13th International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice, LFMTP@FSCD 2018, Oxford, UK, 7th July 2018, volume 274 of EPTCS, pages 57–71, 2018. doi:10.4204/EPTCS.274.5.
- François Thiré. Interoperability between proof systems using the logical framework Dedukti. PhD thesis, ENS Paris-Saclay, 2020.
- Vladimir Voevodsky. A universe polymorphic type system, October 22, 2014. An unfinished unreleased manuscript. URL: http://www.math.ias.edu/Voevodsky/voevodsky-publications_abstracts.html#UPTS.
- A comprehensible guide to a new unifier for cic including universe polymorphism and overloading. Journal of Functional Programming, 27:e10, 2017.