eng
Schloss Dagstuhl – Leibniz-Zentrum für Informatik
Leibniz International Proceedings in Informatics
1868-8969
2023-02-01
19:1
19:19
10.4230/LIPIcs.CSL.2023.19
article
Translating Proofs from an Impredicative Type System to a Predicative One
Felicissimo, Thiago
1
Blanqui, Frédéric
1
Barnawal, Ashish Kumar
2
Université Paris-Saclay, INRIA project, Deducteam, Laboratoire Méthodes Formelles, ENS Paris-Saclay, 91190 France
Indian Institute of Technology Guwahati, Guwahati 781039, Assam, India
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, such as Coq, Matita and the HOL family, to proof assistants based on predicative logics like Agda, whenever impredicativity is not used in an essential way.
In this paper we present an algorithm to do such a translation between a core impredicative type system and a core predicative one allowing prenex universe polymorphism like in Agda. It consists in trying to turn a potentially impredicative term into a universe polymorphic term as general as possible. The use of universe polymorphism is justified by the fact that mapping an impredicative universe to a fixed predicative one is not sufficient in most cases.
During the algorithm, we need to solve unification problems modulo the max-successor algebra on universe levels. But, in this algebra, there are solvable problems having no most general solution. We however provide an incomplete algorithm whose solutions, when it succeeds, are most general ones.
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 arithmetic library to Agda, including Bertrand’s Postulate and Fermat’s Little Theorem, which were not available in Agda yet.
https://drops.dagstuhl.de/storage/00lipics/lipics-vol252-csl2023/LIPIcs.CSL.2023.19/LIPIcs.CSL.2023.19.pdf
Type Theory
Impredicativity
Predicativity
Proof Translation
Universe Polymorphism
Unification Modulo Max
Agda
Dedukti